From cb00206255d9c9c0fbd833ce370fed9c919008f4 Mon Sep 17 00:00:00 2001 From: Quentin Rousseau Date: Fri, 14 Aug 2026 09:34:53 -0700 Subject: [PATCH 1/5] Regenerate SDK for v2.0.0 --- .github/release-drafter.yml | 55 + CHANGELOG.md | 18 +- pyproject.toml | 2 +- rootly_sdk/api/ai_chat/create_ai_chat.py | 87 +- .../api/ai_chat/delete_ai_chat_session.py | 12 +- .../ai_chat/list_ai_chat_session_messages.py | 68 +- rootly_sdk/api/ai_chat/stream_ai_chat.py | 43 +- .../api/alert_events/create_alert_event.py | 54 +- .../api/alert_events/delete_alert_event.py | 32 +- .../api/alert_events/get_alert_event.py | 32 +- .../api/alert_events/list_alert_events.py | 110 +- .../alert_events/list_alert_events_feed.py | 219 +- .../api/alert_events/update_alert_event.py | 62 +- .../api/alert_fields/create_alert_field.py | 26 +- .../api/alert_fields/delete_alert_field.py | 50 +- .../api/alert_fields/get_alert_field.py | 50 +- .../api/alert_fields/list_alert_fields.py | 357 +- .../api/alert_fields/update_alert_field.py | 49 +- .../api/alert_groups/create_alert_group.py | 26 +- .../api/alert_groups/delete_alert_group.py | 50 +- .../api/alert_groups/get_alert_group.py | 50 +- .../api/alert_groups/list_alert_groups.py | 177 +- .../api/alert_groups/update_alert_group.py | 49 +- .../api/alert_retrigger_rules/__init__.py | 1 + .../create_alert_retrigger_rule.py | 166 + .../delete_alert_retrigger_rule.py | 94 + .../get_alert_retrigger_rule.py | 151 + .../list_alert_retrigger_rules.py | 127 + .../update_alert_retrigger_rule.py | 173 + .../api/alert_routes/create_alert_route.py | 26 +- .../api/alert_routes/delete_alert_route.py | 32 +- .../api/alert_routes/get_alert_route.py | 32 +- .../api/alert_routes/list_alert_routes.py | 261 +- .../api/alert_routes/patch_alert_route.py | 31 +- .../api/alert_routes/update_alert_route.py | 31 +- .../create_alert_routing_rule.py | 26 +- .../delete_alert_routing_rule.py | 50 +- .../get_alert_routing_rule.py | 50 +- .../list_alert_routing_rules.py | 337 +- .../update_alert_routing_rule.py | 49 +- .../api/alert_sources/create_alerts_source.py | 26 +- .../api/alert_sources/delete_alerts_source.py | 32 +- .../api/alert_sources/get_alerts_source.py | 32 +- .../api/alert_sources/list_alerts_sources.py | 177 +- .../api/alert_sources/update_alerts_source.py | 31 +- .../alert_urgencies/create_alert_urgency.py | 26 +- .../alert_urgencies/delete_alert_urgency.py | 32 +- .../api/alert_urgencies/get_alert_urgency.py | 32 +- .../alert_urgencies/list_alert_urgencies.py | 267 +- .../alert_urgencies/update_alert_urgency.py | 31 +- rootly_sdk/api/alerts/acknowledge_alert.py | 32 +- rootly_sdk/api/alerts/attach_alert.py | 31 +- rootly_sdk/api/alerts/create_alert.py | 26 +- rootly_sdk/api/alerts/escalate_alert.py | 54 +- rootly_sdk/api/alerts/get_alert.py | 52 +- rootly_sdk/api/alerts/get_receipt.py | 32 +- rootly_sdk/api/alerts/list_alerts.py | 913 +++-- rootly_sdk/api/alerts/list_incident_alerts.py | 36 +- rootly_sdk/api/alerts/resolve_alert.py | 54 +- rootly_sdk/api/alerts/snooze_alert.py | 31 +- rootly_sdk/api/alerts/update_alert.py | 54 +- rootly_sdk/api/api_keys/create_api_key.py | 26 +- rootly_sdk/api/api_keys/delete_api_key.py | 32 +- rootly_sdk/api/api_keys/get_api_key.py | 50 +- rootly_sdk/api/api_keys/list_api_keys.py | 459 ++- rootly_sdk/api/api_keys/rotate_api_key.py | 54 +- rootly_sdk/api/api_keys/update_api_key.py | 31 +- rootly_sdk/api/audits/list_audits.py | 515 ++- .../authorizations/create_authorization.py | 26 +- .../authorizations/delete_authorization.py | 32 +- .../api/authorizations/get_authorization.py | 32 +- .../api/authorizations/list_authorizations.py | 231 +- .../authorizations/update_authorization.py | 31 +- .../create_catalog_checklist_template.py | 26 +- .../delete_catalog_checklist_template.py | 50 +- .../get_catalog_checklist_template.py | 50 +- .../list_catalog_checklist_templates.py | 233 +- .../trigger_catalog_checklist_template.py | 50 +- .../update_catalog_checklist_template.py | 49 +- .../bulk_delete_catalog_entities.py | 74 +- .../bulk_upsert_catalog_entities.py | 47 +- .../catalog_entities/create_catalog_entity.py | 31 +- .../catalog_entities/delete_catalog_entity.py | 50 +- .../catalog_entities/get_catalog_entity.py | 70 +- .../catalog_entities/list_catalog_entities.py | 492 +-- .../catalog_entities/update_catalog_entity.py | 49 +- .../get_catalog_entity_checklist.py | 32 +- .../list_catalog_entity_checklists.py | 193 +- .../create_catalog_entity_property.py | 31 +- .../delete_catalog_entity_property.py | 32 +- .../get_catalog_entity_property.py | 52 +- .../list_catalog_entity_properties.py | 202 +- .../update_catalog_entity_property.py | 31 +- .../create_catalog_property.py | 11 +- .../delete_catalog_property.py | 12 +- .../get_catalog_property.py | 12 +- .../list_catalog_properties.py | 12 +- .../update_catalog_property.py | 11 +- rootly_sdk/api/catalogs/create_catalog.py | 26 +- rootly_sdk/api/catalogs/delete_catalog.py | 50 +- rootly_sdk/api/catalogs/get_catalog.py | 50 +- rootly_sdk/api/catalogs/list_catalogs.py | 465 ++- rootly_sdk/api/catalogs/update_catalog.py | 49 +- rootly_sdk/api/causes/create_cause.py | 26 +- .../causes/create_cause_catalog_property.py | 26 +- rootly_sdk/api/causes/delete_cause.py | 50 +- rootly_sdk/api/causes/get_cause.py | 50 +- .../causes/list_cause_catalog_properties.py | 217 +- rootly_sdk/api/causes/list_causes.py | 335 +- rootly_sdk/api/causes/update_cause.py | 49 +- .../create_communications_group.py | 26 +- .../delete_communications_group.py | 32 +- .../get_communications_group.py | 32 +- .../list_communications_groups.py | 247 +- .../update_communications_group.py | 31 +- .../create_communications_stage.py | 26 +- .../delete_communications_stage.py | 32 +- .../get_communications_stage.py | 32 +- .../list_communications_stages.py | 193 +- .../update_communications_stage.py | 31 +- .../create_communications_template.py | 26 +- .../delete_communications_template.py | 32 +- .../get_communications_template.py | 32 +- .../list_communications_templates.py | 211 +- .../update_communications_template.py | 31 +- .../create_communications_type.py | 26 +- .../delete_communications_type.py | 32 +- .../get_communications_type.py | 32 +- .../list_communications_types.py | 193 +- .../update_communications_type.py | 31 +- .../api/custom_forms/create_custom_form.py | 26 +- .../api/custom_forms/delete_custom_form.py | 50 +- .../api/custom_forms/get_custom_form.py | 50 +- .../api/custom_forms/list_custom_forms.py | 225 +- .../api/custom_forms/update_custom_form.py | 49 +- .../create_dashboard_panel.py | 31 +- .../delete_dashboard_panel.py | 18 +- .../duplicate_dashboard_panel.py | 32 +- .../dashboard_panels/get_dashboard_panel.py | 72 +- .../dashboard_panels/list_dashboard_panels.py | 74 +- .../update_dashboard_panel.py | 17 +- rootly_sdk/api/dashboards/create_dashboard.py | 26 +- rootly_sdk/api/dashboards/delete_dashboard.py | 50 +- .../api/dashboards/duplicate_dashboard.py | 50 +- rootly_sdk/api/dashboards/get_dashboard.py | 70 +- rootly_sdk/api/dashboards/list_dashboards.py | 67 +- .../api/dashboards/set_default_dashboard.py | 50 +- rootly_sdk/api/dashboards/update_dashboard.py | 49 +- .../create_custom_field_option.py | 31 +- .../delete_custom_field_option.py | 32 +- .../get_custom_field_option.py | 32 +- .../list_custom_field_options.py | 108 +- .../update_custom_field_option.py | 31 +- .../create_custom_field.py | 26 +- .../delete_custom_field.py | 32 +- .../get_custom_field.py | 52 +- .../list_custom_fields.py | 523 +-- .../update_custom_field.py | 31 +- .../create_incident_custom_field_selection.py | 31 +- .../delete_incident_custom_field_selection.py | 32 +- .../get_incident_custom_field_selection.py | 32 +- .../list_incident_custom_field_selections.py | 72 +- .../update_incident_custom_field_selection.py | 31 +- .../create_workflow_custom_field_selection.py | 31 +- .../delete_workflow_custom_field_selection.py | 32 +- .../get_workflow_custom_field_selection.py | 32 +- .../list_workflow_custom_field_selections.py | 72 +- .../update_workflow_custom_field_selection.py | 31 +- .../create_edge_connector_action.py | 26 +- .../delete_edge_connector_action.py | 23 +- .../get_edge_connector_action.py | 23 +- .../list_edge_connector_actions.py | 12 +- .../update_edge_connector_action.py | 37 +- .../edge_connectors/create_edge_connector.py | 21 +- .../edge_connectors/delete_edge_connector.py | 12 +- .../api/edge_connectors/get_edge_connector.py | 12 +- .../edge_connectors/list_edge_connectors.py | 47 +- .../edge_connectors/update_edge_connector.py | 26 +- .../environments/bulk_delete_environments.py | 77 +- .../environments/bulk_upsert_environments.py | 30 +- .../api/environments/create_environment.py | 26 +- .../create_environment_catalog_property.py | 26 +- .../api/environments/delete_environment.py | 50 +- .../api/environments/get_environment.py | 50 +- .../list_environment_catalog_properties.py | 217 +- .../api/environments/list_environments.py | 447 +-- .../api/environments/update_environment.py | 49 +- .../delete_escalation_level.py | 32 +- .../escalation_levels/get_escalation_level.py | 32 +- .../update_escalation_level.py | 31 +- .../create_escalation_level_paths.py | 31 +- .../list_escalation_levels_paths.py | 72 +- .../create_escalation_level.py | 31 +- .../list_escalation_levels.py | 72 +- .../create_escalation_path.py | 31 +- .../delete_escalation_path.py | 32 +- .../escalation_paths/get_escalation_path.py | 52 +- .../escalation_paths/list_escalation_paths.py | 94 +- .../update_escalation_path.py | 31 +- .../create_escalation_policy.py | 26 +- .../delete_escalation_policy.py | 32 +- .../get_escalation_policy.py | 52 +- .../list_escalation_policies.py | 339 +- .../update_escalation_policy.py | 31 +- .../create_form_field_option.py | 31 +- .../delete_form_field_option.py | 32 +- .../get_form_field_option.py | 32 +- .../list_form_field_options.py | 110 +- .../update_form_field_option.py | 31 +- .../create_form_field_placement_condition.py | 31 +- .../delete_form_field_placement_condition.py | 32 +- .../get_form_field_placement_condition.py | 32 +- .../list_form_field_placement_conditions.py | 90 +- .../update_form_field_placement_condition.py | 31 +- .../create_form_field_placement.py | 31 +- .../delete_form_field_placement.py | 32 +- .../get_form_field_placement.py | 32 +- .../list_form_field_placements.py | 90 +- .../update_form_field_placement.py | 31 +- .../create_form_field_position.py | 31 +- .../delete_form_field_position.py | 32 +- .../get_form_field_position.py | 32 +- .../list_form_field_positions.py | 90 +- .../update_form_field_position.py | 31 +- .../api/form_fields/create_form_field.py | 26 +- .../api/form_fields/delete_form_field.py | 50 +- rootly_sdk/api/form_fields/get_form_field.py | 70 +- .../api/form_fields/list_form_fields.py | 517 ++- .../api/form_fields/update_form_field.py | 49 +- .../create_form_set_condition.py | 31 +- .../delete_form_set_condition.py | 32 +- .../get_form_set_condition.py | 32 +- .../list_form_set_conditions.py | 90 +- .../update_form_set_condition.py | 31 +- rootly_sdk/api/form_sets/create_form_set.py | 26 +- rootly_sdk/api/form_sets/delete_form_set.py | 50 +- rootly_sdk/api/form_sets/get_form_set.py | 50 +- rootly_sdk/api/form_sets/list_form_sets.py | 173 +- rootly_sdk/api/form_sets/update_form_set.py | 49 +- .../bulk_delete_functionalities.py | 77 +- .../bulk_upsert_functionalities.py | 42 +- .../functionalities/create_functionality.py | 26 +- .../create_functionality_catalog_property.py | 26 +- .../functionalities/delete_functionality.py | 50 +- .../api/functionalities/get_functionality.py | 50 +- .../get_functionality_incidents_chart.py | 50 +- .../get_functionality_uptime_chart.py | 68 +- .../functionalities/list_functionalities.py | 429 +-- .../list_functionality_catalog_properties.py | 217 +- .../functionalities/update_functionality.py | 49 +- rootly_sdk/api/heartbeats/create_heartbeat.py | 26 +- rootly_sdk/api/heartbeats/delete_heartbeat.py | 50 +- rootly_sdk/api/heartbeats/get_heartbeat.py | 50 +- rootly_sdk/api/heartbeats/list_heartbeats.py | 191 +- rootly_sdk/api/heartbeats/ping_heartbeat.py | 32 +- rootly_sdk/api/heartbeats/update_heartbeat.py | 49 +- .../create_incident_action_item.py | 31 +- .../delete_incident_action_item.py | 32 +- .../get_incident_action_items.py | 32 +- .../list_all_incident_action_items.py | 661 ++-- .../list_incident_action_items.py | 72 +- .../update_incident_action_item.py | 31 +- .../create_incident_event_functionality.py | 31 +- .../delete_incident_event_functionality.py | 32 +- .../get_incident_event_functionalities.py | 32 +- .../list_incident_event_functionalities.py | 72 +- .../update_incident_event_functionality.py | 31 +- .../create_incident_event_service.py | 31 +- .../delete_incident_event_service.py | 32 +- .../get_incident_event_services.py | 32 +- .../list_incident_event_services.py | 72 +- .../update_incident_event_service.py | 31 +- .../incident_events/create_incident_event.py | 31 +- .../incident_events/delete_incident_event.py | 32 +- .../incident_events/get_incident_events.py | 32 +- .../incident_events/list_incident_events.py | 74 +- .../incident_events/update_incident_event.py | 31 +- .../create_incident_feedback.py | 31 +- .../get_incident_feedbacks.py | 32 +- .../list_incident_feedbacks.py | 72 +- .../update_incident_feedback.py | 31 +- .../create_incident_form_field_selection.py | 31 +- .../delete_incident_form_field_selection.py | 32 +- .../get_incident_form_field_selection.py | 32 +- .../list_incident_form_field_selections.py | 72 +- .../update_incident_form_field_selection.py | 31 +- .../create_incident_permission_set_boolean.py | 31 +- .../delete_incident_permission_set_boolean.py | 32 +- .../get_incident_permission_set_boolean.py | 32 +- .../list_incident_permission_set_booleans.py | 180 +- .../update_incident_permission_set_boolean.py | 31 +- ...create_incident_permission_set_resource.py | 31 +- ...delete_incident_permission_set_resource.py | 32 +- .../get_incident_permission_set_resource.py | 32 +- .../list_incident_permission_set_resources.py | 180 +- ...update_incident_permission_set_resource.py | 31 +- .../create_incident_permission_set.py | 26 +- .../delete_incident_permission_set.py | 50 +- .../get_incident_permission_set.py | 50 +- .../list_incident_permission_sets.py | 211 +- .../update_incident_permission_set.py | 49 +- .../get_incident_retrospective_step.py | 32 +- .../update_incident_retrospective_step.py | 31 +- .../list_incident_post_mortems.py | 679 ++-- .../list_incident_postmortem.py | 50 +- .../update_incident_postmortem.py | 49 +- .../create_incident_role_task.py | 31 +- .../delete_incident_role_task.py | 32 +- .../get_incident_role_task.py | 32 +- .../list_incident_role_tasks.py | 72 +- .../update_incident_role_task.py | 31 +- .../incident_roles/create_incident_role.py | 26 +- .../incident_roles/delete_incident_role.py | 50 +- .../api/incident_roles/get_incident_role.py | 50 +- .../api/incident_roles/list_incident_roles.py | 429 +-- .../incident_roles/update_incident_role.py | 49 +- .../create_incident_status_page.py | 31 +- .../delete_incident_status_page.py | 32 +- .../get_incident_status_pages.py | 32 +- .../list_incident_status_pages.py | 72 +- .../update_incident_status_page.py | 31 +- .../create_incident_sub_status.py | 31 +- .../delete_incident_sub_status.py | 32 +- .../get_incident_sub_status.py | 38 +- .../list_incident_sub_statuses.py | 184 +- .../update_incident_sub_status.py | 17 +- .../incident_types/create_incident_type.py | 26 +- .../create_incident_type_catalog_property.py | 26 +- .../incident_types/delete_incident_type.py | 50 +- .../api/incident_types/get_incident_type.py | 50 +- .../list_incident_type_catalog_properties.py | 217 +- .../api/incident_types/list_incident_types.py | 429 +-- .../incident_types/update_incident_type.py | 49 +- .../incidents/add_subscribers_to_incident.py | 49 +- .../api/incidents/assign_user_to_incident.py | 49 +- rootly_sdk/api/incidents/cancel_incident.py | 49 +- rootly_sdk/api/incidents/create_incident.py | 26 +- rootly_sdk/api/incidents/delete_incident.py | 50 +- .../incidents/detach_from_parent_incident.py | 50 +- rootly_sdk/api/incidents/get_incident.py | 70 +- rootly_sdk/api/incidents/list_incidents.py | 2965 ++++++++--------- .../incidents/mark_as_duplicate_incident.py | 49 +- rootly_sdk/api/incidents/mitigate_incident.py | 49 +- .../remove_assigned_user_from_incident.py | 49 +- .../remove_subscribers_to_incident.py | 49 +- rootly_sdk/api/incidents/resolve_incident.py | 49 +- rootly_sdk/api/incidents/restart_incident.py | 49 +- rootly_sdk/api/incidents/triage_incident.py | 49 +- .../incidents/unmark_as_duplicate_incident.py | 50 +- rootly_sdk/api/incidents/update_incident.py | 49 +- rootly_sdk/api/ip_ranges/get_ip_ranges.py | 15 +- .../create_live_call_router.py | 26 +- .../delete_live_call_router.py | 32 +- .../generate_phone_number_live_call_router.py | 27 +- .../live_call_routers/get_live_call_router.py | 32 +- .../list_live_call_routers.py | 213 +- .../update_live_call_router.py | 31 +- .../create_meeting_recording.py | 52 +- .../delete_meeting_recording.py | 32 +- .../delete_meeting_recording_video.py | 32 +- .../delete_standalone_meeting_recording.py | 12 +- .../get_meeting_recording.py | 52 +- .../import_meeting_recording.py | 54 +- .../leave_meeting_recording.py | 32 +- .../list_all_meeting_recordings.py | 67 +- .../list_meeting_recordings.py | 68 +- .../pause_meeting_recording.py | 32 +- .../resume_meeting_recording.py | 32 +- .../start_recording_session.py | 49 +- .../stop_meeting_recording.py | 32 +- .../create_on_call_pay_report.py | 26 +- .../get_on_call_pay_report.py | 50 +- .../list_on_call_pay_reports.py | 159 +- .../regenerate_on_call_pay_report.py | 32 +- .../update_on_call_pay_report.py | 31 +- .../api/on_call_roles/create_on_call_role.py | 26 +- .../api/on_call_roles/delete_on_call_role.py | 32 +- .../api/on_call_roles/get_on_call_role.py | 32 +- .../api/on_call_roles/list_on_call_roles.py | 213 +- .../api/on_call_roles/update_on_call_role.py | 31 +- .../on_call_shadows/create_on_call_shadow.py | 31 +- .../api/on_call_shadows/get_on_call_shadow.py | 32 +- .../on_call_shadows/list_on_call_shadows.py | 74 +- .../on_call_shadows/update_on_call_shadow.py | 31 +- rootly_sdk/api/on_calls/list_oncalls.py | 227 +- .../override_shifts/create_override_shift.py | 31 +- .../override_shifts/delete_on_call_shadow.py | 32 +- .../override_shifts/delete_override_shift.py | 32 +- .../api/override_shifts/get_override_shift.py | 32 +- .../override_shifts/list_override_shifts.py | 74 +- .../override_shifts/update_override_shift.py | 31 +- .../playbook_tasks/create_playbook_task.py | 31 +- .../playbook_tasks/delete_playbook_task.py | 32 +- .../api/playbook_tasks/get_playbook_task.py | 32 +- .../api/playbook_tasks/list_playbook_tasks.py | 74 +- .../playbook_tasks/update_playbook_task.py | 31 +- rootly_sdk/api/playbooks/create_playbook.py | 26 +- rootly_sdk/api/playbooks/delete_playbook.py | 32 +- rootly_sdk/api/playbooks/get_playbook.py | 52 +- rootly_sdk/api/playbooks/list_playbooks.py | 67 +- rootly_sdk/api/playbooks/update_playbook.py | 31 +- rootly_sdk/api/pulses/create_pulse.py | 26 +- rootly_sdk/api/pulses/get_pulse.py | 32 +- rootly_sdk/api/pulses/list_pulses.py | 731 ++-- rootly_sdk/api/pulses/update_pulse.py | 31 +- .../get_retrospective_configuration.py | 52 +- .../list_retrospective_configurations.py | 87 +- .../update_retrospective_configuration.py | 31 +- ...create_retrospective_process_group_step.py | 31 +- ...delete_retrospective_process_group_step.py | 32 +- .../get_retrospective_process_group_step.py | 18 +- .../list_retrospective_process_group_steps.py | 162 +- ...update_retrospective_process_group_step.py | 17 +- .../create_retrospective_process_group.py | 31 +- .../delete_retrospective_process_group.py | 32 +- .../get_retrospective_process_group.py | 38 +- .../list_retrospective_process_groups.py | 184 +- .../update_retrospective_process_group.py | 17 +- .../create_retrospective_process.py | 26 +- .../delete_retrospective_process.py | 32 +- .../get_retrospective_process.py | 52 +- .../list_retrospective_processes.py | 69 +- .../update_retrospective_process.py | 31 +- .../create_retrospective_step.py | 31 +- .../delete_retrospective_step.py | 32 +- .../get_retrospective_step.py | 32 +- .../list_retrospective_steps.py | 90 +- .../update_retrospective_step.py | 31 +- .../create_postmortem_template.py | 26 +- .../delete_postmortem_template.py | 50 +- .../get_postmortem_template.py | 50 +- .../list_postmortem_templates.py | 67 +- .../update_postmortem_template.py | 49 +- rootly_sdk/api/roles/create_role.py | 26 +- rootly_sdk/api/roles/delete_role.py | 50 +- rootly_sdk/api/roles/get_role.py | 50 +- rootly_sdk/api/roles/list_roles.py | 209 +- rootly_sdk/api/roles/update_role.py | 49 +- .../create_schedule_rotation_active_day.py | 31 +- .../delete_schedule_rotation_active_day.py | 32 +- .../get_schedule_rotation_active_day.py | 32 +- .../list_schedule_rotation_active_days.py | 72 +- .../update_schedule_rotation_active_day.py | 31 +- .../create_schedule_rotation_user.py | 31 +- .../delete_schedule_rotation_user.py | 32 +- .../get_schedule_rotation_user.py | 32 +- .../list_schedule_rotation_users.py | 72 +- .../update_schedule_rotation_user.py | 31 +- .../create_schedule_rotation.py | 31 +- .../delete_schedule_rotation.py | 32 +- .../get_schedule_rotation.py | 32 +- .../list_schedule_rotations.py | 90 +- .../update_schedule_rotation.py | 31 +- rootly_sdk/api/schedules/create_schedule.py | 26 +- rootly_sdk/api/schedules/delete_schedule.py | 32 +- rootly_sdk/api/schedules/get_schedule.py | 32 +- rootly_sdk/api/schedules/list_schedules.py | 320 +- rootly_sdk/api/schedules/update_schedule.py | 31 +- rootly_sdk/api/secrets/create_secret.py | 26 +- rootly_sdk/api/secrets/delete_secret.py | 32 +- rootly_sdk/api/secrets/get_secret.py | 32 +- rootly_sdk/api/secrets/list_secrets.py | 65 +- rootly_sdk/api/secrets/update_secret.py | 31 +- .../api/services/bulk_delete_services.py | 65 +- .../api/services/bulk_upsert_services.py | 30 +- rootly_sdk/api/services/create_service.py | 26 +- .../create_service_catalog_property.py | 26 +- rootly_sdk/api/services/delete_service.py | 50 +- rootly_sdk/api/services/get_service.py | 50 +- .../services/get_service_incidents_chart.py | 50 +- .../api/services/get_service_uptime_chart.py | 68 +- .../list_service_catalog_properties.py | 217 +- rootly_sdk/api/services/list_services.py | 605 ++-- rootly_sdk/api/services/update_service.py | 49 +- rootly_sdk/api/severities/create_severity.py | 26 +- rootly_sdk/api/severities/delete_severity.py | 50 +- rootly_sdk/api/severities/get_severity.py | 50 +- rootly_sdk/api/severities/list_severities.py | 533 ++- rootly_sdk/api/severities/update_severity.py | 49 +- .../create_shift_coverage_request.py | 31 +- .../delete_shift_coverage_request.py | 18 +- .../get_shift_coverage_request.py | 18 +- .../list_shift_coverage_requests.py | 18 +- rootly_sdk/api/shifts/get_schedule_shifts.py | 68 +- rootly_sdk/api/shifts/list_shifts.py | 159 +- rootly_sdk/api/sl_as/create_sla.py | 26 +- rootly_sdk/api/sl_as/delete_sla.py | 32 +- rootly_sdk/api/sl_as/get_sla.py | 32 +- rootly_sdk/api/sl_as/list_sl_as.py | 335 +- rootly_sdk/api/sl_as/update_sla.py | 31 +- .../api/status_page_announcements/__init__.py | 1 + .../create_status_page_announcement.py | 196 ++ .../delete_status_page_announcement.py | 165 + .../get_status_page_announcement.py | 165 + .../list_status_page_announcements.py | 210 ++ .../update_status_page_announcement.py | 187 ++ .../status_page_component_groups/__init__.py | 1 + .../create_status_page_component_group.py | 192 ++ .../delete_status_page_component_group.py | 98 + .../get_status_page_component_group.py | 186 ++ .../list_status_page_component_groups.py | 210 ++ .../update_status_page_component_group.py | 187 ++ .../api/status_page_components/__init__.py | 1 + .../create_status_page_component.py | 192 ++ .../delete_status_page_component.py | 98 + .../get_status_page_component.py | 186 ++ .../list_status_page_components.py | 210 ++ .../update_status_page_component.py | 187 ++ .../create_status_page_template.py | 31 +- .../delete_status_page_template.py | 32 +- .../get_status_page_template.py | 32 +- .../list_status_page_templates.py | 72 +- .../update_status_page_template.py | 31 +- .../api/status_pages/create_status_page.py | 26 +- .../api/status_pages/delete_status_page.py | 50 +- .../api/status_pages/get_status_page.py | 50 +- .../api/status_pages/list_status_pages.py | 357 +- .../api/status_pages/update_status_page.py | 49 +- rootly_sdk/api/statuses/get_status.py | 50 +- rootly_sdk/api/statuses/list_statuses.py | 207 +- .../api/sub_statuses/create_sub_status.py | 26 +- .../api/sub_statuses/delete_sub_status.py | 50 +- rootly_sdk/api/sub_statuses/get_sub_status.py | 50 +- .../api/sub_statuses/list_sub_statuses.py | 191 +- .../api/sub_statuses/update_sub_status.py | 49 +- rootly_sdk/api/teams/bulk_delete_groups.py | 65 +- rootly_sdk/api/teams/bulk_upsert_groups.py | 30 +- .../teams/create_group_catalog_property.py | 26 +- rootly_sdk/api/teams/create_team.py | 26 +- rootly_sdk/api/teams/delete_team.py | 50 +- rootly_sdk/api/teams/get_team.py | 70 +- .../api/teams/get_team_incidents_chart.py | 32 +- .../teams/list_group_catalog_properties.py | 217 +- rootly_sdk/api/teams/list_teams.py | 697 ++-- rootly_sdk/api/teams/update_team.py | 49 +- .../create_user_email_address.py | 31 +- .../delete_user_email_address.py | 32 +- .../get_user_email_addresses.py | 32 +- .../resend_user_email_address_verification.py | 32 +- .../show_user_email_address.py | 32 +- .../update_user_email_address.py | 31 +- .../verify_user_email_address.py | 32 +- .../create_user_notification_rule.py | 31 +- .../delete_user_notification_rule.py | 32 +- .../get_user_notification_rule.py | 32 +- .../list_user_notification_rules.py | 90 +- .../update_user_notification_rule.py | 31 +- .../create_user_phone_number.py | 31 +- .../delete_user_phone_number.py | 32 +- .../get_user_phone_numbers.py | 32 +- .../show_user_phone_number.py | 32 +- .../update_user_phone_number.py | 31 +- rootly_sdk/api/users/delete_user.py | 32 +- rootly_sdk/api/users/get_current_user.py | 27 +- rootly_sdk/api/users/get_user.py | 52 +- rootly_sdk/api/users/list_users.py | 211 +- rootly_sdk/api/users/update_user.py | 54 +- rootly_sdk/api/verified_domains/__init__.py | 1 + .../delete_v1_verified_domains_id.py | 151 + .../get_v1_verified_domains.py | 174 + .../get_v1_verified_domains_id.py | 151 + .../post_v1_verified_domains.py | 160 + .../deliver_webhooks_delivery.py | 18 +- .../get_webhooks_delivery.py | 32 +- .../list_webhooks_deliveries.py | 252 +- .../create_webhooks_endpoint.py | 26 +- .../delete_webhooks_endpoint.py | 32 +- .../get_webhooks_endpoint.py | 32 +- .../list_webhooks_endpoints.py | 103 +- .../update_webhooks_endpoint.py | 31 +- ...rkflow_action_item_form_field_condition.py | 31 +- ...rkflow_action_item_form_field_condition.py | 32 +- ...rkflow_action_item_form_field_condition.py | 32 +- ...kflow_action_item_form_field_conditions.py | 72 +- ...rkflow_action_item_form_field_condition.py | 31 +- .../create_workflow_form_field_condition.py | 36 +- .../delete_workflow_form_field_condition.py | 32 +- .../get_workflow_form_field_condition.py | 32 +- .../list_workflow_form_field_conditions.py | 72 +- .../update_workflow_form_field_condition.py | 36 +- .../workflow_groups/create_workflow_group.py | 26 +- .../workflow_groups/delete_workflow_group.py | 32 +- .../api/workflow_groups/get_workflow_group.py | 32 +- .../workflow_groups/list_workflow_groups.py | 177 +- .../workflow_groups/update_workflow_group.py | 31 +- .../api/workflow_runs/create_workflow_run.py | 31 +- .../api/workflow_runs/list_workflow_runs.py | 148 +- .../workflow_tasks/create_workflow_task.py | 31 +- .../workflow_tasks/delete_workflow_task.py | 32 +- .../api/workflow_tasks/get_workflow_task.py | 32 +- .../api/workflow_tasks/list_workflow_tasks.py | 272 +- .../workflow_tasks/update_workflow_task.py | 31 +- rootly_sdk/api/workflows/create_workflow.py | 26 +- rootly_sdk/api/workflows/delete_workflow.py | 50 +- rootly_sdk/api/workflows/get_workflow.py | 70 +- rootly_sdk/api/workflows/list_workflows.py | 357 +- rootly_sdk/api/workflows/update_workflow.py | 49 +- rootly_sdk/client.py | 26 +- rootly_sdk/models/__init__.py | 272 +- .../models/action_item_trigger_params.py | 351 +- .../models/add_action_item_task_params.py | 94 +- ...ction_item_task_params_assigned_to_user.py | 12 +- ...task_params_post_to_slack_channels_item.py | 12 +- ...dd_microsoft_teams_chat_tab_task_params.py | 15 +- ...crosoft_teams_chat_tab_task_params_chat.py | 12 +- ..._microsoft_teams_tab_task_params_type_0.py | 2 - ..._microsoft_teams_tab_task_params_type_1.py | 2 - rootly_sdk/models/add_role_task_params.py | 27 +- .../add_role_task_params_assigned_to_user.py | 12 +- .../add_slack_bookmark_task_params_type_0.py | 2 - .../add_slack_bookmark_task_params_type_1.py | 2 - rootly_sdk/models/add_subscribers.py | 5 +- rootly_sdk/models/add_subscribers_data.py | 5 +- .../models/add_subscribers_data_attributes.py | 28 +- rootly_sdk/models/add_team_task_params.py | 12 +- .../models/add_to_timeline_task_params.py | 37 +- ...task_params_post_to_slack_channels_item.py | 12 +- rootly_sdk/models/ai_chat_response.py | 23 +- rootly_sdk/models/ai_chat_response_data.py | 5 +- .../ai_chat_response_data_attributes.py | 22 +- rootly_sdk/models/ai_chat_session_message.py | 2 - .../models/ai_chat_session_message_list.py | 17 +- .../ai_chat_session_message_list_meta.py | 3 - rootly_sdk/models/alert.py | 374 +-- .../alert_alert_field_values_type_0_item.py | 2 - .../alert_alerting_targets_type_0_item.py | 2 - rootly_sdk/models/alert_data_type_0.py | 3 - rootly_sdk/models/alert_event.py | 110 +- rootly_sdk/models/alert_event_action.py | 6 + .../alert_event_escalation_target_type_0.py | 13 +- ...ert_event_escalation_target_type_0_data.py | 21 +- ...scalation_target_type_0_data_attributes.py | 3 - rootly_sdk/models/alert_event_feed_list.py | 35 +- .../models/alert_event_feed_list_data_item.py | 5 +- rootly_sdk/models/alert_event_feed_meta.py | 64 +- .../models/alert_event_incident_type_0.py | 80 +- rootly_sdk/models/alert_event_list.py | 29 +- .../models/alert_event_list_data_item.py | 5 +- rootly_sdk/models/alert_event_response.py | 23 +- .../models/alert_event_response_data.py | 5 +- .../models/alert_event_schedule_type_0.py | 51 +- ...chedule_type_0_escalation_policies_item.py | 20 +- rootly_sdk/models/alert_event_user.py | 54 +- rootly_sdk/models/alert_field.py | 8 +- rootly_sdk/models/alert_field_list.py | 29 +- .../models/alert_field_list_data_item.py | 5 +- rootly_sdk/models/alert_field_response.py | 23 +- .../models/alert_field_response_data.py | 11 +- rootly_sdk/models/alert_group.py | 91 +- .../models/alert_group_attributes_item.py | 8 +- .../models/alert_group_conditions_item.py | 112 +- ...roup_conditions_item_values_item_type_0.py | 2 - rootly_sdk/models/alert_group_list.py | 25 +- .../models/alert_group_list_data_item.py | 5 +- rootly_sdk/models/alert_group_response.py | 23 +- .../models/alert_group_response_data.py | 5 +- rootly_sdk/models/alert_group_targets_item.py | 2 - rootly_sdk/models/alert_labels_item_type_0.py | 14 +- rootly_sdk/models/alert_list.py | 29 +- rootly_sdk/models/alert_list_data_item.py | 11 +- rootly_sdk/models/alert_response.py | 23 +- rootly_sdk/models/alert_response_data.py | 11 +- rootly_sdk/models/alert_retrigger_rule.py | 165 + .../alert_retrigger_rule_conditions_item.py | 130 + ...ert_retrigger_rule_conditions_item_kind.py | 20 + ...retrigger_rule_conditions_item_operator.py | 37 + .../models/alert_retrigger_rule_list.py | 116 + .../alert_retrigger_rule_list_data_item.py | 86 + ...lert_retrigger_rule_list_data_item_type.py | 15 + .../models/alert_retrigger_rule_match_mode.py | 16 + .../models/alert_retrigger_rule_response.py | 88 + .../alert_retrigger_rule_response_data.py | 86 + ...alert_retrigger_rule_response_data_type.py | 15 + rootly_sdk/models/alert_route.py | 41 +- rootly_sdk/models/alert_route_list.py | 11 +- .../models/alert_route_list_data_item.py | 5 +- rootly_sdk/models/alert_route_response.py | 5 +- .../models/alert_route_response_data.py | 5 +- rootly_sdk/models/alert_route_rules_item.py | 21 +- ..._route_rules_item_condition_groups_item.py | 13 +- ...m_condition_groups_item_conditions_item.py | 64 +- ...lert_route_rules_item_destinations_item.py | 2 - rootly_sdk/models/alert_routing_rule.py | 49 +- .../models/alert_routing_rule_condition.py | 64 +- .../alert_routing_rule_condition_group.py | 37 +- ...lert_routing_rule_condition_groups_item.py | 38 +- ...e_condition_groups_item_conditions_item.py | 64 +- .../alert_routing_rule_conditions_item.py | 22 +- .../alert_routing_rule_destination_type_0.py | 2 - rootly_sdk/models/alert_routing_rule_list.py | 29 +- .../alert_routing_rule_list_data_item.py | 5 +- .../models/alert_routing_rule_response.py | 23 +- .../alert_routing_rule_response_data.py | 5 +- .../alert_routing_rule_target_type_0.py | 2 - rootly_sdk/models/alert_trigger_params.py | 163 +- ...gger_params_alert_field_conditions_item.py | 10 +- ...trigger_params_alert_payload_conditions.py | 29 +- ...lert_payload_conditions_conditions_item.py | 14 +- rootly_sdk/models/alert_urgency.py | 63 +- rootly_sdk/models/alert_urgency_list.py | 29 +- .../models/alert_urgency_list_data_item.py | 5 +- rootly_sdk/models/alert_urgency_response.py | 23 +- .../models/alert_urgency_response_data.py | 5 +- rootly_sdk/models/alerts_source.py | 176 +- ...rce_alert_source_fields_attributes_item.py | 20 +- ...rt_source_urgency_rules_attributes_item.py | 62 +- ...source_alert_template_attributes_type_0.py | 34 +- rootly_sdk/models/alerts_source_list.py | 29 +- .../models/alerts_source_list_data_item.py | 5 +- ...ource_resolution_rule_attributes_type_0.py | 99 +- ...butes_type_0_conditions_attributes_item.py | 63 +- rootly_sdk/models/alerts_source_response.py | 23 +- .../models/alerts_source_response_data.py | 5 +- ...rts_source_sourceable_attributes_type_0.py | 78 +- ...s_type_0_field_mappings_attributes_item.py | 18 +- rootly_sdk/models/api_key.py | 64 +- rootly_sdk/models/api_key_list.py | 29 +- rootly_sdk/models/api_key_list_data_item.py | 5 +- rootly_sdk/models/api_key_response.py | 23 +- rootly_sdk/models/api_key_response_data.py | 5 +- .../models/api_key_with_token_response.py | 23 +- .../api_key_with_token_response_data.py | 5 +- ...key_with_token_response_data_attributes.py | 64 +- .../archive_google_chat_spaces_task_params.py | 17 +- ...gle_chat_spaces_task_params_spaces_item.py | 12 +- ...ve_microsoft_teams_channels_task_params.py | 19 +- ...eams_channels_task_params_channels_item.py | 12 +- ...crosoft_teams_channels_task_params_team.py | 12 +- .../archive_slack_channels_task_params.py | 17 +- ...lack_channels_task_params_channels_item.py | 12 +- rootly_sdk/models/assign_role_to_user.py | 5 +- rootly_sdk/models/assign_role_to_user_data.py | 5 +- .../assign_role_to_user_data_attributes.py | 12 +- rootly_sdk/models/attach_alert.py | 5 +- rootly_sdk/models/attach_alert_data.py | 5 +- .../models/attach_alert_data_attributes.py | 16 +- .../attach_datadog_dashboards_task_params.py | 41 +- ..._dashboards_task_params_dashboards_item.py | 12 +- ...task_params_post_to_slack_channels_item.py | 12 +- ..._pdf_to_freshservice_ticket_task_params.py | 90 + ...eshservice_ticket_task_params_task_type.py | 23 + ...ospective_pdf_to_jira_issue_task_params.py | 27 +- ...f_to_jira_issue_task_params_integration.py | 12 +- rootly_sdk/models/audit.py | 140 +- .../models/audit_object_changes_type_0.py | 3 - rootly_sdk/models/audit_object_type_0.py | 3 - rootly_sdk/models/audits_list.py | 29 +- rootly_sdk/models/audits_list_data_item.py | 5 +- rootly_sdk/models/authorization.py | 2 - rootly_sdk/models/authorization_list.py | 29 +- .../models/authorization_list_data_item.py | 5 +- rootly_sdk/models/authorization_response.py | 23 +- .../models/authorization_response_data.py | 5 +- .../auto_assign_role_opsgenie_task_params.py | 15 +- ...sign_role_opsgenie_task_params_schedule.py | 12 +- ...e_pagerduty_task_params_type_0_schedule.py | 12 +- ...ty_task_params_type_1_escalation_policy.py | 12 +- .../auto_assign_role_rootly_task_params.py | 190 -- ...ssign_role_rootly_task_params_task_type.py | 19 - ...params_type_0_escalation_policy_target.py} | 22 +- ...otly_task_params_type_1_service_target.py} | 22 +- ..._rootly_task_params_type_2_user_target.py} | 22 +- ...rootly_task_params_type_3_group_target.py} | 22 +- ...otly_task_params_type_4_schedule_target.py | 68 + ...auto_assign_role_victor_ops_task_params.py | 15 +- ...assign_role_victor_ops_task_params_team.py | 12 +- .../bulk_destroy_catalog_entities_response.py | 13 +- ..._destroy_catalog_entities_response_data.py | 26 +- .../bulk_destroy_catalog_entities_type_0.py | 2 - .../bulk_destroy_catalog_entities_type_1.py | 10 +- .../bulk_destroy_environments_response.py | 13 +- ...bulk_destroy_environments_response_data.py | 26 +- .../bulk_destroy_environments_type_0.py | 2 - .../bulk_destroy_environments_type_1.py | 10 +- .../bulk_destroy_functionalities_response.py | 13 +- ...k_destroy_functionalities_response_data.py | 26 +- .../bulk_destroy_functionalities_type_0.py | 2 - .../bulk_destroy_functionalities_type_1.py | 10 +- .../models/bulk_destroy_services_response.py | 13 +- .../bulk_destroy_services_response_data.py | 26 +- .../models/bulk_destroy_services_type_0.py | 2 - .../models/bulk_destroy_services_type_1.py | 10 +- .../models/bulk_destroy_teams_response.py | 13 +- .../bulk_destroy_teams_response_data.py | 26 +- .../models/bulk_destroy_teams_type_0.py | 2 - .../models/bulk_destroy_teams_type_1.py | 10 +- .../models/bulk_upsert_catalog_entities.py | 7 +- ...k_upsert_catalog_entities_entities_item.py | 69 +- ...alog_entities_entities_item_fields_item.py | 14 +- .../bulk_upsert_catalog_entities_error.py | 7 +- ...sert_catalog_entities_error_errors_item.py | 2 - .../bulk_upsert_catalog_entities_response.py | 21 +- ...ert_catalog_entities_response_data_item.py | 25 +- rootly_sdk/models/bulk_upsert_environments.py | 9 +- .../bulk_upsert_environments_entities_item.py | 89 +- ..._environments_entities_item_fields_item.py | 14 +- .../models/bulk_upsert_environments_error.py | 7 +- ...k_upsert_environments_error_errors_item.py | 2 - .../bulk_upsert_environments_response.py | 21 +- ..._upsert_environments_response_data_item.py | 25 +- .../models/bulk_upsert_functionalities.py | 7 +- ...lk_upsert_functionalities_entities_item.py | 167 +- ...nctionalities_entities_item_fields_item.py | 14 +- .../bulk_upsert_functionalities_error.py | 7 +- ...psert_functionalities_error_errors_item.py | 2 - .../bulk_upsert_functionalities_response.py | 21 +- ...sert_functionalities_response_data_item.py | 25 +- rootly_sdk/models/bulk_upsert_services.py | 7 +- .../bulk_upsert_services_entities_item.py | 229 +- ...sert_services_entities_item_fields_item.py | 14 +- .../models/bulk_upsert_services_error.py | 7 +- .../bulk_upsert_services_error_errors_item.py | 2 - .../models/bulk_upsert_services_response.py | 21 +- ...bulk_upsert_services_response_data_item.py | 25 +- rootly_sdk/models/bulk_upsert_teams.py | 7 +- .../models/bulk_upsert_teams_entities_item.py | 189 +- ..._upsert_teams_entities_item_fields_item.py | 14 +- rootly_sdk/models/bulk_upsert_teams_error.py | 7 +- .../bulk_upsert_teams_error_errors_item.py | 2 - .../models/bulk_upsert_teams_response.py | 21 +- .../bulk_upsert_teams_response_data_item.py | 25 +- rootly_sdk/models/call_people_task_params.py | 12 +- rootly_sdk/models/cancel_incident.py | 5 +- rootly_sdk/models/cancel_incident_data.py | 5 +- .../models/cancel_incident_data_attributes.py | 14 +- rootly_sdk/models/catalog.py | 51 +- .../models/catalog_checklist_template.py | 43 +- ...g_checklist_template_fields_type_0_item.py | 26 +- .../models/catalog_checklist_template_list.py | 41 +- ...talog_checklist_template_list_data_item.py | 5 +- ...g_checklist_template_owners_type_0_item.py | 16 +- .../catalog_checklist_template_response.py | 23 +- ...atalog_checklist_template_response_data.py | 5 +- rootly_sdk/models/catalog_entity.py | 98 +- rootly_sdk/models/catalog_entity_checklist.py | 59 +- ..._checklist_checklist_fields_type_0_item.py | 13 +- ...klist_checklist_fields_type_0_item_data.py | 25 +- ...list_fields_type_0_item_data_attributes.py | 73 +- ...m_data_attributes_value_snapshot_type_0.py | 3 - ..._checklist_checklist_owners_type_0_item.py | 13 +- ...klist_checklist_owners_type_0_item_data.py | 25 +- ...list_owners_type_0_item_data_attributes.py | 20 +- .../models/catalog_entity_checklist_list.py | 41 +- ...catalog_entity_checklist_list_data_item.py | 5 +- .../catalog_entity_checklist_response.py | 23 +- .../catalog_entity_checklist_response_data.py | 5 +- rootly_sdk/models/catalog_entity_list.py | 29 +- .../models/catalog_entity_list_data_item.py | 5 +- .../models/catalog_entity_properties_item.py | 2 - rootly_sdk/models/catalog_entity_property.py | 2 - .../models/catalog_entity_property_list.py | 29 +- .../catalog_entity_property_list_data_item.py | 5 +- .../catalog_entity_property_response.py | 23 +- .../catalog_entity_property_response_data.py | 5 +- rootly_sdk/models/catalog_entity_response.py | 23 +- .../models/catalog_entity_response_data.py | 5 +- rootly_sdk/models/catalog_field.py | 68 +- rootly_sdk/models/catalog_field_list.py | 29 +- .../models/catalog_field_list_data_item.py | 5 +- rootly_sdk/models/catalog_field_response.py | 23 +- .../models/catalog_field_response_data.py | 5 +- rootly_sdk/models/catalog_list.py | 29 +- rootly_sdk/models/catalog_list_data_item.py | 5 +- rootly_sdk/models/catalog_property.py | 70 +- rootly_sdk/models/catalog_property_list.py | 29 +- .../models/catalog_property_list_data_item.py | 5 +- .../models/catalog_property_response.py | 23 +- .../models/catalog_property_response_data.py | 5 +- rootly_sdk/models/catalog_response.py | 23 +- rootly_sdk/models/catalog_response_data.py | 5 +- rootly_sdk/models/cause.py | 65 +- rootly_sdk/models/cause_list.py | 29 +- rootly_sdk/models/cause_list_data_item.py | 5 +- rootly_sdk/models/cause_properties_item.py | 2 - rootly_sdk/models/cause_response.py | 23 +- rootly_sdk/models/cause_response_data.py | 5 +- ...e_google_chat_space_privacy_task_params.py | 25 +- ...le_chat_space_privacy_task_params_space.py | 12 +- ...hange_slack_channel_privacy_task_params.py | 15 +- ...ack_channel_privacy_task_params_channel.py | 12 +- rootly_sdk/models/communications_group.py | 79 +- ...tion_external_group_members_type_0_item.py | 20 +- ...munication_group_conditions_type_0_item.py | 73 +- .../models/communications_group_response.py | 23 +- .../communications_group_response_data.py | 5 +- .../models/communications_groups_response.py | 41 +- ...ommunications_groups_response_data_item.py | 5 +- rootly_sdk/models/communications_stage.py | 28 +- .../models/communications_stage_response.py | 23 +- .../communications_stage_response_data.py | 5 +- .../models/communications_stages_response.py | 41 +- ...ommunications_stages_response_data_item.py | 5 +- rootly_sdk/models/communications_template.py | 59 +- ...mmunication_template_stages_type_0_item.py | 13 +- ...cation_template_stages_type_0_item_data.py | 25 +- ...late_stages_type_0_item_data_attributes.py | 89 +- ...tem_data_attributes_communication_stage.py | 12 +- ..._data_attributes_communication_template.py | 12 +- ...munications_template_communication_type.py | 12 +- .../communications_template_response.py | 23 +- .../communications_template_response_data.py | 5 +- .../communications_templates_response.py | 41 +- ...unications_templates_response_data_item.py | 5 +- rootly_sdk/models/communications_type.py | 28 +- .../models/communications_type_response.py | 23 +- .../communications_type_response_data.py | 5 +- .../models/communications_types_response.py | 41 +- ...communications_types_response_data_item.py | 5 +- ...reate_airtable_table_record_task_params.py | 27 +- ..._airtable_table_record_task_params_base.py | 12 +- ...airtable_table_record_task_params_table.py | 12 +- ...e_anthropic_chat_completion_task_params.py | 28 +- ...ropic_chat_completion_task_params_model.py | 12 +- .../create_asana_subtask_task_params.py | 57 +- ...te_asana_subtask_task_params_completion.py | 12 +- .../models/create_asana_task_task_params.py | 63 +- ...reate_asana_task_task_params_completion.py | 12 +- ...te_asana_task_task_params_projects_item.py | 12 +- ...create_asana_task_task_params_workspace.py | 12 +- .../models/create_clickup_task_task_params.py | 63 +- ...> create_clickup_task_task_params_list.py} | 22 +- ...reate_clickup_task_task_params_priority.py | 12 +- .../models/create_coda_page_task_params.py | 49 +- .../create_coda_page_task_params_doc.py | 12 +- .../create_coda_page_task_params_template.py | 12 +- .../create_confluence_page_task_params.py | 74 +- ...te_confluence_page_task_params_ancestor.py | 12 +- ...confluence_page_task_params_integration.py | 12 +- ...reate_confluence_page_task_params_space.py | 12 +- ...te_confluence_page_task_params_template.py | 12 +- .../create_datadog_notebook_task_params.py | 33 +- ...e_datadog_notebook_task_params_template.py | 12 +- .../create_dropbox_paper_page_task_params.py | 41 +- ...ropbox_paper_page_task_params_namespace.py | 12 +- ...ox_paper_page_task_params_parent_folder.py | 12 +- .../create_edge_connector_action_body.py | 13 +- ...reate_edge_connector_action_body_action.py | 13 +- ...e_connector_action_body_action_metadata.py | 31 +- ...on_body_action_metadata_parameters_item.py | 30 +- .../models/create_edge_connector_body.py | 5 +- .../models/create_edge_connector_body_data.py | 5 +- ...ate_edge_connector_body_data_attributes.py | 33 +- ..._connector_body_data_attributes_filters.py | 28 +- .../models/create_github_issue_task_params.py | 63 +- ...ate_github_issue_task_params_issue_type.py | 12 +- ...te_github_issue_task_params_labels_item.py | 12 +- ...ate_github_issue_task_params_repository.py | 12 +- .../models/create_gitlab_issue_task_params.py | 49 +- ...ate_gitlab_issue_task_params_repository.py | 12 +- .../create_go_to_meeting_task_params.py | 56 +- ...task_params_post_to_slack_channels_item.py | 12 +- ...reate_google_calendar_event_task_params.py | 91 +- ...task_params_post_to_slack_channels_item.py | 12 +- .../create_google_chat_space_task_params.py | 21 +- .../create_google_docs_page_task_params.py | 66 +- ...eate_google_docs_page_task_params_drive.py | 12 +- ...gle_docs_page_task_params_parent_folder.py | 12 +- ...ate_google_docs_permissions_task_params.py | 26 +- ...ogle_gemini_chat_completion_task_params.py | 19 +- ...emini_chat_completion_task_params_model.py | 12 +- .../create_google_meeting_task_params.py | 83 +- ...task_params_post_to_slack_channels_item.py | 12 +- .../create_incident_postmortem_task_params.py | 34 +- ..._postmortem_task_params_template_type_0.py | 12 +- .../models/create_incident_task_params.py | 64 +- .../models/create_jira_issue_task_params.py | 101 +- ...eate_jira_issue_task_params_integration.py | 12 +- ...reate_jira_issue_task_params_issue_type.py | 12 +- .../create_jira_issue_task_params_priority.py | 12 +- .../create_jira_issue_task_params_status.py | 12 +- .../models/create_jira_subtask_task_params.py | 101 +- ...te_jira_subtask_task_params_integration.py | 12 +- ...reate_jira_subtask_task_params_priority.py | 12 +- .../create_jira_subtask_task_params_status.py | 12 +- ..._subtask_task_params_subtask_issue_type.py | 12 +- .../models/create_jsmops_alert_task_params.py | 107 +- ...mops_alert_task_params_escalations_item.py | 12 +- ...jsmops_alert_task_params_schedules_item.py | 12 +- ...ate_jsmops_alert_task_params_teams_item.py | 12 +- ...ate_jsmops_alert_task_params_users_item.py | 12 +- ...create_linear_issue_comment_task_params.py | 12 +- .../models/create_linear_issue_task_params.py | 67 +- ...te_linear_issue_task_params_labels_item.py | 12 +- ...reate_linear_issue_task_params_priority.py | 12 +- ...create_linear_issue_task_params_project.py | 12 +- .../create_linear_issue_task_params_state.py | 12 +- .../create_linear_issue_task_params_team.py | 12 +- ...create_linear_subtask_issue_task_params.py | 57 +- ...r_subtask_issue_task_params_labels_item.py | 12 +- ...near_subtask_issue_task_params_priority.py | 12 +- ..._linear_subtask_issue_task_params_state.py | 12 +- ...ate_microsoft_teams_channel_task_params.py | 27 +- ...icrosoft_teams_channel_task_params_team.py | 12 +- ...create_microsoft_teams_chat_task_params.py | 35 +- ...oft_teams_chat_task_params_members_item.py | 12 +- ...ate_microsoft_teams_meeting_task_params.py | 53 +- ...task_params_post_to_slack_channels_item.py | 12 +- ...ate_mistral_chat_completion_task_params.py | 31 +- ...stral_chat_completion_task_params_model.py | 12 +- .../models/create_motion_task_task_params.py | 61 +- ...create_motion_task_task_params_priority.py | 12 +- .../create_motion_task_task_params_project.py | 12 +- .../create_motion_task_task_params_status.py | 12 +- ...reate_motion_task_task_params_workspace.py | 12 +- .../models/create_notion_page_task_params.py | 37 +- ...ate_notion_page_task_params_parent_page.py | 12 +- ...eate_openai_chat_completion_task_params.py | 49 +- ...penai_chat_completion_task_params_model.py | 12 +- .../create_opsgenie_alert_task_params.py | 99 +- ...enie_alert_task_params_escalations_item.py | 12 +- ...sgenie_alert_task_params_schedules_item.py | 12 +- ...e_opsgenie_alert_task_params_teams_item.py | 12 +- ...e_opsgenie_alert_task_params_users_item.py | 12 +- .../create_outlook_event_task_params.py | 63 +- ...eate_outlook_event_task_params_calendar.py | 12 +- ...task_params_post_to_slack_channels_item.py | 12 +- ...ate_pagerduty_status_update_task_params.py | 12 +- .../create_pagertree_alert_task_params.py | 73 +- ..._pagertree_alert_task_params_teams_item.py | 12 +- ..._pagertree_alert_task_params_users_item.py | 12 +- .../models/create_quip_page_task_params.py | 32 +- ...create_service_now_incident_task_params.py | 43 +- ...ice_now_incident_task_params_completion.py | 12 +- ...rvice_now_incident_task_params_priority.py | 12 +- .../create_sharepoint_page_task_params.py | 41 +- ...reate_sharepoint_page_task_params_drive.py | 12 +- ...arepoint_page_task_params_parent_folder.py | 12 +- ...create_sharepoint_page_task_params_site.py | 12 +- ...ortcut_story_task_params_type_0_project.py | 12 +- ...story_task_params_type_1_workflow_state.py | 12 +- .../create_shortcut_task_task_params.py | 15 +- ...te_shortcut_task_task_params_completion.py | 12 +- .../create_slack_channel_task_params.py | 23 +- ...ate_slack_channel_task_params_workspace.py | 12 +- .../models/create_sub_incident_task_params.py | 16 +- .../models/create_trello_card_task_params.py | 49 +- ...ate_trello_card_task_params_archivation.py | 12 +- .../create_trello_card_task_params_board.py | 12 +- ...ate_trello_card_task_params_labels_item.py | 12 +- .../create_trello_card_task_params_list.py | 12 +- ...ate_watsonx_chat_completion_task_params.py | 19 +- ...tsonx_chat_completion_task_params_model.py | 12 +- .../create_webex_meeting_task_params.py | 57 +- ...task_params_post_to_slack_channels_item.py | 12 +- .../create_zendesk_jira_link_task_params.py | 12 +- .../create_zendesk_ticket_task_params.py | 57 +- ...e_zendesk_ticket_task_params_completion.py | 12 +- ...ate_zendesk_ticket_task_params_priority.py | 12 +- .../models/create_zoom_meeting_task_params.py | 79 +- ...task_params_post_to_slack_channels_item.py | 12 +- rootly_sdk/models/custom_field.py | 65 +- rootly_sdk/models/custom_field_list.py | 29 +- .../models/custom_field_list_data_item.py | 5 +- rootly_sdk/models/custom_field_option.py | 12 +- rootly_sdk/models/custom_field_option_list.py | 29 +- .../custom_field_option_list_data_item.py | 5 +- .../models/custom_field_option_response.py | 23 +- .../custom_field_option_response_data.py | 5 +- .../models/custom_field_resource_type.py | 16 + rootly_sdk/models/custom_field_response.py | 23 +- .../models/custom_field_response_data.py | 5 +- rootly_sdk/models/custom_form.py | 20 +- rootly_sdk/models/custom_form_list.py | 29 +- .../models/custom_form_list_data_item.py | 5 +- rootly_sdk/models/custom_form_response.py | 23 +- .../models/custom_form_response_data.py | 5 +- rootly_sdk/models/dashboard.py | 72 +- rootly_sdk/models/dashboard_list.py | 29 +- rootly_sdk/models/dashboard_list_data_item.py | 5 +- rootly_sdk/models/dashboard_panel.py | 48 +- .../models/dashboard_panel_data_item.py | 3 - rootly_sdk/models/dashboard_panel_list.py | 29 +- .../models/dashboard_panel_list_data_item.py | 5 +- rootly_sdk/models/dashboard_panel_params.py | 55 +- .../dashboard_panel_params_datalabels.py | 8 +- .../dashboard_panel_params_datasets_item.py | 64 +- ...l_params_datasets_item_aggregate_type_0.py | 32 +- ..._panel_params_datasets_item_filter_item.py | 29 +- ...ms_datasets_item_filter_item_rules_item.py | 28 +- ...ms_datasets_item_group_by_type_1_type_0.py | 2 - .../models/dashboard_panel_params_legend.py | 12 +- .../models/dashboard_panel_position_type_0.py | 2 - rootly_sdk/models/dashboard_panel_response.py | 23 +- .../models/dashboard_panel_response_data.py | 5 +- rootly_sdk/models/dashboard_response.py | 23 +- rootly_sdk/models/dashboard_response_data.py | 5 +- .../models/delete_alert_route_response_200.py | 13 +- .../delete_alert_route_response_200_data.py | 21 +- ...lert_route_response_200_data_attributes.py | 8 +- rootly_sdk/models/duplicate_incident.py | 5 +- rootly_sdk/models/duplicate_incident_data.py | 5 +- .../duplicate_incident_data_attributes.py | 28 +- rootly_sdk/models/edge_connector.py | 5 +- rootly_sdk/models/edge_connector_action.py | 5 +- .../models/edge_connector_action_data.py | 5 +- .../edge_connector_action_data_attributes.py | 78 +- ..._data_attributes_parameters_type_0_item.py | 52 +- rootly_sdk/models/edge_connector_data.py | 5 +- .../models/edge_connector_data_attributes.py | 72 +- rootly_sdk/models/environment.py | 130 +- rootly_sdk/models/environment_list.py | 29 +- .../models/environment_list_data_item.py | 5 +- .../environment_properties_type_0_item.py | 2 - rootly_sdk/models/environment_response.py | 23 +- .../models/environment_response_data.py | 5 +- .../environment_slack_aliases_type_0_item.py | 2 - .../environment_slack_channels_type_0_item.py | 2 - rootly_sdk/models/errors_list.py | 21 +- rootly_sdk/models/errors_list_errors_item.py | 24 +- rootly_sdk/models/escalate_alert.py | 13 +- rootly_sdk/models/escalate_alert_data.py | 21 +- .../models/escalate_alert_data_attributes.py | 17 +- rootly_sdk/models/escalation_policy.py | 50 +- ...escalation_policy_business_hours_type_0.py | 44 +- rootly_sdk/models/escalation_policy_level.py | 172 +- .../models/escalation_policy_level_list.py | 29 +- .../escalation_policy_level_list_data_item.py | 5 +- ..._notification_target_params_item_type_0.py | 12 +- ...ing_strategy_configuration_repeats_mode.py | 22 + ...g_strategy_configuration_rotation_scope.py | 22 + .../escalation_policy_level_response.py | 23 +- .../escalation_policy_level_response_data.py | 15 +- rootly_sdk/models/escalation_policy_list.py | 29 +- .../escalation_policy_list_data_item.py | 5 +- rootly_sdk/models/escalation_policy_path.py | 676 ++-- .../models/escalation_policy_path_list.py | 29 +- .../escalation_policy_path_list_data_item.py | 5 +- .../models/escalation_policy_path_response.py | 23 +- .../escalation_policy_path_response_data.py | 15 +- ...scalation_policy_path_rules_item_type_0.py | 2 - ...scalation_policy_path_rules_item_type_1.py | 2 - ...scalation_policy_path_rules_item_type_2.py | 20 +- ...scalation_policy_path_rules_item_type_3.py | 10 +- ...scalation_policy_path_rules_item_type_4.py | 2 - ...scalation_policy_path_rules_item_type_5.py | 7 +- ...path_rules_item_type_5_time_blocks_item.py | 54 +- ...scalation_policy_path_rules_item_type_6.py | 2 - ...scalation_policy_path_rules_item_type_7.py | 2 - ...on_policy_path_rules_item_type_8_type_0.py | 2 - ...on_policy_path_rules_item_type_8_type_1.py | 2 - ...on_policy_path_rules_item_type_8_type_2.py | 20 +- ...on_policy_path_rules_item_type_8_type_3.py | 10 +- ...on_policy_path_rules_item_type_8_type_4.py | 2 - ...on_policy_path_rules_item_type_8_type_5.py | 9 +- ...les_item_type_8_type_5_time_blocks_item.py | 54 +- ...on_policy_path_rules_item_type_8_type_6.py | 2 - ...on_policy_path_rules_item_type_8_type_7.py | 2 - ...on_policy_path_rules_item_type_9_type_0.py | 2 - ...on_policy_path_rules_item_type_9_type_1.py | 2 - ...on_policy_path_rules_item_type_9_type_2.py | 20 +- ...on_policy_path_rules_item_type_9_type_3.py | 10 +- ...on_policy_path_rules_item_type_9_type_4.py | 2 - ...on_policy_path_rules_item_type_9_type_5.py | 9 +- ...les_item_type_9_type_5_time_blocks_item.py | 54 +- ...on_policy_path_rules_item_type_9_type_6.py | 2 - ...on_policy_path_rules_item_type_9_type_7.py | 2 - ...tion_policy_path_time_restrictions_item.py | 28 +- .../models/escalation_policy_response.py | 23 +- .../models/escalation_policy_response_data.py | 5 +- rootly_sdk/models/form_field.py | 63 +- rootly_sdk/models/form_field_list.py | 29 +- .../models/form_field_list_data_item.py | 5 +- rootly_sdk/models/form_field_option.py | 16 +- rootly_sdk/models/form_field_option_list.py | 29 +- .../form_field_option_list_data_item.py | 5 +- .../models/form_field_option_response.py | 23 +- .../models/form_field_option_response_data.py | 5 +- rootly_sdk/models/form_field_placement.py | 29 +- .../models/form_field_placement_condition.py | 2 - .../form_field_placement_condition_list.py | 29 +- ...ield_placement_condition_list_data_item.py | 5 +- ...form_field_placement_condition_response.py | 23 +- ...field_placement_condition_response_data.py | 5 +- .../models/form_field_placement_list.py | 29 +- .../form_field_placement_list_data_item.py | 5 +- .../models/form_field_placement_response.py | 23 +- .../form_field_placement_response_data.py | 5 +- rootly_sdk/models/form_field_position.py | 2 - rootly_sdk/models/form_field_position_form.py | 4 + rootly_sdk/models/form_field_position_list.py | 29 +- .../form_field_position_list_data_item.py | 5 +- .../models/form_field_position_response.py | 23 +- .../form_field_position_response_data.py | 5 +- rootly_sdk/models/form_field_resource_type.py | 16 + rootly_sdk/models/form_field_response.py | 23 +- rootly_sdk/models/form_field_response_data.py | 5 +- rootly_sdk/models/form_set.py | 11 +- rootly_sdk/models/form_set_condition.py | 2 - rootly_sdk/models/form_set_condition_list.py | 29 +- .../form_set_condition_list_data_item.py | 5 +- .../models/form_set_condition_response.py | 23 +- .../form_set_condition_response_data.py | 5 +- rootly_sdk/models/form_set_list.py | 29 +- rootly_sdk/models/form_set_list_data_item.py | 5 +- rootly_sdk/models/form_set_response.py | 23 +- rootly_sdk/models/form_set_response_data.py | 5 +- rootly_sdk/models/functionality.py | 237 +- rootly_sdk/models/functionality_list.py | 29 +- .../models/functionality_list_data_item.py | 5 +- .../functionality_properties_type_0_item.py | 2 - rootly_sdk/models/functionality_response.py | 23 +- .../models/functionality_response_data.py | 5 +- ...functionality_slack_aliases_type_0_item.py | 2 - ...unctionality_slack_channels_type_0_item.py | 2 - rootly_sdk/models/get_alerts_task_params.py | 79 +- ..._task_params_parent_message_thread_task.py | 12 +- ...task_params_post_to_slack_channels_item.py | 12 +- .../get_github_commits_task_params_type_0.py | 2 - .../get_github_commits_task_params_type_1.py | 2 - .../get_gitlab_commits_task_params_type_0.py | 2 - .../get_gitlab_commits_task_params_type_1.py | 2 - rootly_sdk/models/get_pulses_task_params.py | 85 +- ..._task_params_parent_message_thread_task.py | 12 +- ...task_params_post_to_slack_channels_item.py | 12 +- rootly_sdk/models/heartbeat.py | 81 +- rootly_sdk/models/heartbeat_list.py | 29 +- rootly_sdk/models/heartbeat_list_data_item.py | 5 +- rootly_sdk/models/heartbeat_response.py | 23 +- rootly_sdk/models/heartbeat_response_data.py | 5 +- rootly_sdk/models/http_client_task_params.py | 77 +- ...task_params_post_to_slack_channels_item.py | 12 +- rootly_sdk/models/import_meeting_recording.py | 38 +- rootly_sdk/models/in_triage_incident.py | 5 +- rootly_sdk/models/in_triage_incident_data.py | 2 - rootly_sdk/models/incident.py | 1328 ++++---- rootly_sdk/models/incident_action_item.py | 107 +- .../models/incident_action_item_list.py | 29 +- .../incident_action_item_list_data_item.py | 5 +- .../models/incident_action_item_response.py | 23 +- .../incident_action_item_response_data.py | 5 +- .../models/incident_cancelled_by_type_0.py | 3 - .../models/incident_closed_by_type_0.py | 3 - .../models/incident_custom_field_selection.py | 22 +- .../incident_custom_field_selection_list.py | 29 +- ...t_custom_field_selection_list_data_item.py | 5 +- ...ncident_custom_field_selection_response.py | 23 +- ...nt_custom_field_selection_response_data.py | 5 +- rootly_sdk/models/incident_event.py | 12 +- .../models/incident_event_functionality.py | 2 - .../incident_event_functionality_list.py | 29 +- ...dent_event_functionality_list_data_item.py | 5 +- .../incident_event_functionality_response.py | 23 +- ...ident_event_functionality_response_data.py | 5 +- rootly_sdk/models/incident_event_list.py | 29 +- .../models/incident_event_list_data_item.py | 5 +- rootly_sdk/models/incident_event_response.py | 23 +- .../models/incident_event_response_data.py | 5 +- rootly_sdk/models/incident_event_service.py | 2 - .../models/incident_event_service_list.py | 29 +- .../incident_event_service_list_data_item.py | 5 +- .../models/incident_event_service_response.py | 23 +- .../incident_event_service_response_data.py | 5 +- rootly_sdk/models/incident_feedback.py | 2 - rootly_sdk/models/incident_feedback_list.py | 29 +- .../incident_feedback_list_data_item.py | 5 +- .../models/incident_feedback_response.py | 23 +- .../models/incident_feedback_response_data.py | 5 +- .../models/incident_form_field_selection.py | 68 +- .../incident_form_field_selection_list.py | 29 +- ...ent_form_field_selection_list_data_item.py | 5 +- .../incident_form_field_selection_response.py | 23 +- ...dent_form_field_selection_response_data.py | 5 +- .../models/incident_in_triage_by_type_0.py | 3 - rootly_sdk/models/incident_labels_type_0.py | 3 - rootly_sdk/models/incident_list.py | 29 +- rootly_sdk/models/incident_list_data_item.py | 5 +- .../models/incident_mitigated_by_type_0.py | 3 - rootly_sdk/models/incident_permission_set.py | 58 +- .../models/incident_permission_set_boolean.py | 16 +- .../incident_permission_set_boolean_list.py | 29 +- ...t_permission_set_boolean_list_data_item.py | 5 +- ...ncident_permission_set_boolean_response.py | 23 +- ...nt_permission_set_boolean_response_data.py | 5 +- .../models/incident_permission_set_list.py | 29 +- .../incident_permission_set_list_data_item.py | 5 +- .../incident_permission_set_resource.py | 16 +- .../incident_permission_set_resource_list.py | 29 +- ..._permission_set_resource_list_data_item.py | 5 +- ...cident_permission_set_resource_response.py | 23 +- ...t_permission_set_resource_response_data.py | 5 +- .../incident_permission_set_response.py | 23 +- .../incident_permission_set_response_data.py | 5 +- rootly_sdk/models/incident_post_mortem.py | 100 +- .../models/incident_post_mortem_list.py | 29 +- .../incident_post_mortem_list_data_item.py | 5 +- .../models/incident_post_mortem_response.py | 23 +- .../incident_post_mortem_response_data.py | 5 +- .../models/incident_resolved_by_type_0.py | 3 - rootly_sdk/models/incident_response.py | 23 +- rootly_sdk/models/incident_response_data.py | 5 +- .../models/incident_retrospective_step.py | 50 +- .../incident_retrospective_step_response.py | 23 +- ...cident_retrospective_step_response_data.py | 5 +- rootly_sdk/models/incident_role.py | 50 +- rootly_sdk/models/incident_role_list.py | 29 +- .../models/incident_role_list_data_item.py | 5 +- rootly_sdk/models/incident_role_response.py | 23 +- .../models/incident_role_response_data.py | 5 +- rootly_sdk/models/incident_role_task.py | 26 +- rootly_sdk/models/incident_role_task_list.py | 29 +- .../incident_role_task_list_data_item.py | 5 +- .../models/incident_role_task_response.py | 23 +- .../incident_role_task_response_data.py | 5 +- .../models/incident_started_by_type_0.py | 3 - .../models/incident_status_page_event.py | 56 +- .../models/incident_status_page_event_list.py | 29 +- ...cident_status_page_event_list_data_item.py | 5 +- .../incident_status_page_event_response.py | 23 +- ...ncident_status_page_event_response_data.py | 5 +- ..._page_event_status_page_components_item.py | 82 + ...vent_status_page_components_item_status.py | 26 + rootly_sdk/models/incident_sub_status.py | 14 +- rootly_sdk/models/incident_sub_status_list.py | 29 +- .../incident_sub_status_list_data_item.py | 5 +- .../models/incident_sub_status_response.py | 23 +- .../incident_sub_status_response_data.py | 5 +- rootly_sdk/models/incident_trigger_params.py | 249 +- rootly_sdk/models/incident_type.py | 115 +- rootly_sdk/models/incident_type_list.py | 29 +- .../models/incident_type_list_data_item.py | 5 +- .../models/incident_type_properties_item.py | 2 - rootly_sdk/models/incident_type_response.py | 23 +- .../models/incident_type_response_data.py | 5 +- ...incident_type_slack_aliases_type_0_item.py | 2 - ...ncident_type_slack_channels_type_0_item.py | 2 - rootly_sdk/models/incident_user_type_0.py | 3 - ...ting_global_dial_in_numbers_type_0_item.py | 24 +- rootly_sdk/models/incidents_chart_response.py | 5 +- .../models/incidents_chart_response_data.py | 3 - ...invite_to_google_chat_space_task_params.py | 15 +- ..._to_google_chat_space_task_params_space.py | 12 +- ...rosoft_teams_channel_rootly_task_params.py | 59 +- ...eams_channel_rootly_task_params_channel.py | 12 +- ...ly_task_params_escalation_policy_target.py | 12 +- ...channel_rootly_task_params_group_target.py | 12 +- ...nnel_rootly_task_params_schedule_target.py | 12 +- ...annel_rootly_task_params_service_target.py | 12 +- ...t_teams_channel_rootly_task_params_team.py | 12 +- ..._channel_rootly_task_params_user_target.py | 12 +- ..._to_microsoft_teams_channel_task_params.py | 23 +- ...osoft_teams_channel_task_params_channel.py | 12 +- ...icrosoft_teams_channel_task_params_team.py | 12 +- ...e_to_slack_channel_opsgenie_task_params.py | 19 +- ...nnel_opsgenie_task_params_channels_item.py | 12 +- ...k_channel_opsgenie_task_params_schedule.py | 12 +- ...ty_task_params_type_0_escalation_policy.py | 12 +- ...l_pagerduty_task_params_type_1_schedule.py | 12 +- ...ite_to_slack_channel_rootly_task_params.py | 57 +- ...hannel_rootly_task_params_channels_item.py | 12 +- ...ly_task_params_escalation_policy_target.py | 12 +- ...channel_rootly_task_params_group_target.py | 12 +- ...nnel_rootly_task_params_schedule_target.py | 12 +- ...annel_rootly_task_params_service_target.py | 12 +- ..._channel_rootly_task_params_user_target.py | 12 +- ...nel_task_params_type_0_slack_users_item.py | 12 +- ...sk_params_type_1_slack_user_groups_item.py | 12 +- ...ite_to_slack_channel_task_params_type_2.py | 2 - ...to_slack_channel_victor_ops_task_params.py | 19 +- ...el_victor_ops_task_params_channels_item.py | 12 +- ...ack_channel_victor_ops_task_params_team.py | 12 +- rootly_sdk/models/ip_ranges.py | 2 - rootly_sdk/models/ip_ranges_response.py | 5 +- rootly_sdk/models/ip_ranges_response_data.py | 5 +- .../models/jsonapi_included_resource.py | 21 +- .../jsonapi_included_resource_attributes.py | 3 - ...jsonapi_included_resource_relationships.py | 3 - rootly_sdk/models/links.py | 34 +- .../list_alert_events_feed_filteraction.py | 6 + rootly_sdk/models/live_call_router.py | 143 +- ...router_escalation_policy_trigger_params.py | 2 - rootly_sdk/models/live_call_router_list.py | 29 +- .../models/live_call_router_list_data_item.py | 5 +- .../live_call_router_paging_targets_item.py | 2 - .../models/live_call_router_response.py | 23 +- .../models/live_call_router_response_data.py | 5 +- rootly_sdk/models/meeting_recording.py | 98 +- rootly_sdk/models/meeting_recording_detail.py | 141 +- .../meeting_recording_detail_response.py | 5 +- .../meeting_recording_detail_response_data.py | 5 +- ...ting_recording_detail_transcript_type_1.py | 3 - rootly_sdk/models/meeting_recording_list.py | 17 +- .../meeting_recording_list_data_item.py | 5 +- .../models/meeting_recording_response.py | 5 +- .../models/meeting_recording_response_data.py | 5 +- .../meeting_recording_transcript_segment.py | 7 +- .../meeting_recording_transcript_word.py | 12 +- rootly_sdk/models/meta.py | 44 +- rootly_sdk/models/mitigate_incident.py | 5 +- rootly_sdk/models/mitigate_incident_data.py | 5 +- .../mitigate_incident_data_attributes.py | 14 +- rootly_sdk/models/new_alert.py | 5 +- rootly_sdk/models/new_alert_data.py | 5 +- .../models/new_alert_data_attributes.py | 310 +- ...ert_field_values_attributes_item_type_0.py | 2 - .../new_alert_data_attributes_data_type_0.py | 3 - ...lert_data_attributes_labels_item_type_0.py | 14 +- ...ibutes_notification_targets_type_0_item.py | 2 - rootly_sdk/models/new_alert_event.py | 5 +- rootly_sdk/models/new_alert_event_data.py | 5 +- .../models/new_alert_event_data_attributes.py | 8 +- rootly_sdk/models/new_alert_field.py | 5 +- rootly_sdk/models/new_alert_field_data.py | 5 +- .../models/new_alert_field_data_attributes.py | 27 +- rootly_sdk/models/new_alert_group.py | 5 +- rootly_sdk/models/new_alert_group_data.py | 5 +- .../models/new_alert_group_data_attributes.py | 124 +- ...t_group_data_attributes_attributes_item.py | 8 +- ...t_group_data_attributes_conditions_item.py | 57 +- ...lert_group_data_attributes_targets_item.py | 2 - rootly_sdk/models/new_alert_retrigger_rule.py | 65 + .../models/new_alert_retrigger_rule_data.py | 78 + ...ew_alert_retrigger_rule_data_attributes.py | 124 + ...er_rule_data_attributes_conditions_item.py | 123 + ...le_data_attributes_conditions_item_kind.py | 28 + ...ata_attributes_conditions_item_operator.py | 39 + ...trigger_rule_data_attributes_match_mode.py | 20 + ...er_rule_data_attributes_timeout_minutes.py | 34 + .../new_alert_retrigger_rule_data_type.py | 15 + rootly_sdk/models/new_alert_route.py | 13 +- rootly_sdk/models/new_alert_route_data.py | 21 +- .../models/new_alert_route_data_attributes.py | 41 +- ..._alert_route_data_attributes_rules_item.py | 21 +- ...ibutes_rules_item_condition_groups_item.py | 13 +- ...m_condition_groups_item_conditions_item.py | 73 +- ...attributes_rules_item_destinations_item.py | 2 - rootly_sdk/models/new_alert_routing_rule.py | 5 +- .../models/new_alert_routing_rule_data.py | 5 +- .../new_alert_routing_rule_data_attributes.py | 61 +- ...ng_rule_data_attributes_conditions_item.py | 19 +- ...outing_rule_data_attributes_destination.py | 2 - rootly_sdk/models/new_alert_urgency.py | 5 +- rootly_sdk/models/new_alert_urgency_data.py | 5 +- .../new_alert_urgency_data_attributes.py | 35 +- rootly_sdk/models/new_alerts_source.py | 5 +- rootly_sdk/models/new_alerts_source_data.py | 5 +- .../new_alerts_source_data_attributes.py | 166 +- ...tes_alert_source_fields_attributes_item.py | 20 +- ...rt_source_urgency_rules_attributes_item.py | 69 +- ...ibutes_alert_template_attributes_type_0.py | 34 +- ...butes_resolution_rule_attributes_type_0.py | 124 +- ...butes_type_0_conditions_attributes_item.py | 73 +- ...attributes_sourceable_attributes_type_0.py | 66 +- ...s_type_0_field_mappings_attributes_item.py | 18 +- rootly_sdk/models/new_api_key.py | 5 +- rootly_sdk/models/new_api_key_data.py | 5 +- .../models/new_api_key_data_attributes.py | 44 +- rootly_sdk/models/new_authorization.py | 5 +- rootly_sdk/models/new_authorization_data.py | 5 +- .../new_authorization_data_attributes.py | 2 - rootly_sdk/models/new_catalog.py | 5 +- .../models/new_catalog_checklist_template.py | 5 +- .../new_catalog_checklist_template_data.py | 5 +- ...alog_checklist_template_data_attributes.py | 118 +- ..._template_data_attributes_builtin_field.py | 2 - ...t_template_data_attributes_custom_field.py | 8 +- ...late_data_attributes_owners_type_0_item.py | 2 - rootly_sdk/models/new_catalog_data.py | 5 +- .../models/new_catalog_data_attributes.py | 63 +- rootly_sdk/models/new_catalog_entity.py | 5 +- rootly_sdk/models/new_catalog_entity_data.py | 5 +- .../new_catalog_entity_data_attributes.py | 104 +- ..._entity_data_attributes_properties_item.py | 2 - .../models/new_catalog_entity_property.py | 5 +- .../new_catalog_entity_property_data.py | 5 +- ...catalog_entity_property_data_attributes.py | 8 +- rootly_sdk/models/new_catalog_field.py | 5 +- rootly_sdk/models/new_catalog_field_data.py | 5 +- .../new_catalog_field_data_attributes.py | 71 +- rootly_sdk/models/new_catalog_property.py | 5 +- .../models/new_catalog_property_data.py | 5 +- .../new_catalog_property_data_attributes.py | 74 +- rootly_sdk/models/new_cause.py | 5 +- rootly_sdk/models/new_cause_data.py | 5 +- .../models/new_cause_data_attributes.py | 83 +- ...w_cause_data_attributes_properties_item.py | 2 - rootly_sdk/models/new_communications_group.py | 5 +- .../models/new_communications_group_data.py | 5 +- ...ew_communications_group_data_attributes.py | 118 +- ...tion_external_group_members_type_0_item.py | 16 +- ...munication_group_conditions_type_0_item.py | 78 +- rootly_sdk/models/new_communications_stage.py | 5 +- .../models/new_communications_stage_data.py | 5 +- ...ew_communications_stage_data_attributes.py | 45 +- .../models/new_communications_template.py | 5 +- .../new_communications_template_data.py | 5 +- ...communications_template_data_attributes.py | 53 +- ..._template_stages_attributes_type_0_item.py | 48 +- rootly_sdk/models/new_communications_type.py | 5 +- .../models/new_communications_type_data.py | 5 +- ...new_communications_type_data_attributes.py | 55 +- rootly_sdk/models/new_custom_field.py | 5 +- rootly_sdk/models/new_custom_field_data.py | 5 +- .../new_custom_field_data_attributes.py | 56 +- rootly_sdk/models/new_custom_field_option.py | 5 +- .../models/new_custom_field_option_data.py | 5 +- ...new_custom_field_option_data_attributes.py | 16 +- rootly_sdk/models/new_custom_form.py | 5 +- rootly_sdk/models/new_custom_form_data.py | 5 +- .../models/new_custom_form_data_attributes.py | 39 +- rootly_sdk/models/new_dashboard.py | 5 +- rootly_sdk/models/new_dashboard_data.py | 5 +- .../models/new_dashboard_data_attributes.py | 52 +- rootly_sdk/models/new_dashboard_panel.py | 5 +- rootly_sdk/models/new_dashboard_panel_data.py | 5 +- .../new_dashboard_panel_data_attributes.py | 28 +- ..._dashboard_panel_data_attributes_params.py | 55 +- ...panel_data_attributes_params_datalabels.py | 8 +- ...el_data_attributes_params_datasets_item.py | 64 +- ...s_params_datasets_item_aggregate_type_0.py | 32 +- ...ibutes_params_datasets_item_filter_item.py | 31 +- ...ms_datasets_item_filter_item_rules_item.py | 28 +- ...ms_datasets_item_group_by_type_1_type_0.py | 2 - ...ard_panel_data_attributes_params_legend.py | 12 +- ...d_panel_data_attributes_position_type_0.py | 2 - rootly_sdk/models/new_edge_connector.py | 5 +- .../models/new_edge_connector_action.py | 5 +- .../new_edge_connector_action_action.py | 13 +- ...w_edge_connector_action_action_metadata.py | 45 +- ..._action_metadata_parameters_type_0_item.py | 52 +- .../new_edge_connector_edge_connector.py | 28 +- rootly_sdk/models/new_environment.py | 5 +- rootly_sdk/models/new_environment_data.py | 5 +- .../models/new_environment_data_attributes.py | 140 +- ...ronment_data_attributes_properties_item.py | 2 - ...ta_attributes_slack_aliases_type_0_item.py | 2 - ...a_attributes_slack_channels_type_0_item.py | 2 - rootly_sdk/models/new_escalation_policy.py | 5 +- .../models/new_escalation_policy_data.py | 5 +- .../new_escalation_policy_data_attributes.py | 46 +- ...y_data_attributes_business_hours_type_0.py | 47 +- .../models/new_escalation_policy_level.py | 5 +- .../new_escalation_policy_level_data.py | 5 +- ...escalation_policy_level_data_attributes.py | 182 +- ..._notification_target_params_item_type_0.py | 16 +- ...ing_strategy_configuration_repeats_mode.py | 22 + ...g_strategy_configuration_rotation_scope.py | 24 + .../models/new_escalation_policy_path.py | 5 +- .../models/new_escalation_policy_path_data.py | 5 +- ..._escalation_policy_path_data_attributes.py | 343 +- ..._path_data_attributes_rules_item_type_0.py | 2 - ..._path_data_attributes_rules_item_type_1.py | 2 - ..._path_data_attributes_rules_item_type_2.py | 20 +- ..._path_data_attributes_rules_item_type_3.py | 10 +- ..._path_data_attributes_rules_item_type_4.py | 2 - ..._path_data_attributes_rules_item_type_5.py | 9 +- ...utes_rules_item_type_5_time_blocks_item.py | 54 +- ..._path_data_attributes_rules_item_type_6.py | 2 - ..._path_data_attributes_rules_item_type_7.py | 2 - ..._data_attributes_time_restrictions_item.py | 2 - rootly_sdk/models/new_form_field.py | 5 +- rootly_sdk/models/new_form_field_data.py | 5 +- .../models/new_form_field_data_attributes.py | 97 +- rootly_sdk/models/new_form_field_option.py | 5 +- .../models/new_form_field_option_data.py | 5 +- .../new_form_field_option_data_attributes.py | 16 +- rootly_sdk/models/new_form_field_placement.py | 5 +- .../new_form_field_placement_condition.py | 5 +- ...new_form_field_placement_condition_data.py | 5 +- ...eld_placement_condition_data_attributes.py | 8 +- .../models/new_form_field_placement_data.py | 5 +- ...ew_form_field_placement_data_attributes.py | 35 +- rootly_sdk/models/new_form_field_position.py | 5 +- .../models/new_form_field_position_data.py | 5 +- ...new_form_field_position_data_attributes.py | 2 - ...orm_field_position_data_attributes_form.py | 4 + rootly_sdk/models/new_form_set.py | 5 +- rootly_sdk/models/new_form_set_condition.py | 5 +- .../models/new_form_set_condition_data.py | 5 +- .../new_form_set_condition_data_attributes.py | 2 - rootly_sdk/models/new_form_set_data.py | 5 +- .../models/new_form_set_data_attributes.py | 30 +- rootly_sdk/models/new_functionality.py | 5 +- rootly_sdk/models/new_functionality_data.py | 5 +- .../new_functionality_data_attributes.py | 268 +- ...onality_data_attributes_properties_item.py | 2 - ...ta_attributes_slack_aliases_type_0_item.py | 2 - ...a_attributes_slack_channels_type_0_item.py | 2 - rootly_sdk/models/new_heartbeat.py | 5 +- rootly_sdk/models/new_heartbeat_data.py | 5 +- .../models/new_heartbeat_data_attributes.py | 44 +- rootly_sdk/models/new_incident.py | 5 +- rootly_sdk/models/new_incident_action_item.py | 5 +- .../models/new_incident_action_item_data.py | 5 +- ...ew_incident_action_item_data_attributes.py | 115 +- ...butes_form_field_selections_type_0_item.py | 87 +- .../new_incident_custom_field_selection.py | 5 +- ...ew_incident_custom_field_selection_data.py | 5 +- ..._custom_field_selection_data_attributes.py | 20 +- rootly_sdk/models/new_incident_data.py | 5 +- .../models/new_incident_data_attributes.py | 420 ++- ..._incident_data_attributes_labels_type_0.py | 3 - rootly_sdk/models/new_incident_event.py | 5 +- rootly_sdk/models/new_incident_event_data.py | 5 +- .../new_incident_event_data_attributes.py | 12 +- .../new_incident_event_functionality.py | 5 +- .../new_incident_event_functionality_data.py | 5 +- ...ent_event_functionality_data_attributes.py | 2 - .../models/new_incident_event_service.py | 5 +- .../models/new_incident_event_service_data.py | 5 +- ..._incident_event_service_data_attributes.py | 2 - rootly_sdk/models/new_incident_feedback.py | 5 +- .../models/new_incident_feedback_data.py | 5 +- .../new_incident_feedback_data_attributes.py | 8 +- .../new_incident_form_field_selection.py | 5 +- .../new_incident_form_field_selection_data.py | 5 +- ...nt_form_field_selection_data_attributes.py | 68 +- .../models/new_incident_permission_set.py | 5 +- .../new_incident_permission_set_boolean.py | 5 +- ...ew_incident_permission_set_boolean_data.py | 5 +- ..._permission_set_boolean_data_attributes.py | 21 +- ...boolean_data_attributes_severity_params.py | 30 +- .../new_incident_permission_set_data.py | 5 +- ...incident_permission_set_data_attributes.py | 94 +- .../new_incident_permission_set_resource.py | 5 +- ...w_incident_permission_set_resource_data.py | 5 +- ...permission_set_resource_data_attributes.py | 25 +- ...esource_data_attributes_severity_params.py | 30 +- rootly_sdk/models/new_incident_role.py | 5 +- rootly_sdk/models/new_incident_role_data.py | 5 +- .../new_incident_role_data_attributes.py | 67 +- rootly_sdk/models/new_incident_role_task.py | 5 +- .../models/new_incident_role_task_data.py | 5 +- .../new_incident_role_task_data_attributes.py | 26 +- .../models/new_incident_status_page_event.py | 5 +- .../new_incident_status_page_event_data.py | 5 +- ...ident_status_page_event_data_attributes.py | 113 +- ...utes_status_page_components_type_0_item.py | 65 + ...atus_page_components_type_0_item_status.py | 26 + rootly_sdk/models/new_incident_sub_status.py | 5 +- .../models/new_incident_sub_status_data.py | 5 +- ...new_incident_sub_status_data_attributes.py | 14 +- rootly_sdk/models/new_incident_type.py | 5 +- rootly_sdk/models/new_incident_type_data.py | 5 +- .../new_incident_type_data_attributes.py | 130 +- ...nt_type_data_attributes_properties_item.py | 2 - ...ta_attributes_slack_aliases_type_0_item.py | 2 - ...a_attributes_slack_channels_type_0_item.py | 2 - rootly_sdk/models/new_live_call_router.py | 5 +- .../models/new_live_call_router_data.py | 5 +- .../new_live_call_router_data_attributes.py | 105 +- ...ibutes_escalation_policy_trigger_params.py | 2 - ...ter_data_attributes_paging_targets_item.py | 2 - rootly_sdk/models/new_on_call_pay_report.py | 5 +- .../models/new_on_call_pay_report_data.py | 5 +- .../new_on_call_pay_report_data_attributes.py | 20 +- rootly_sdk/models/new_on_call_role.py | 5 +- rootly_sdk/models/new_on_call_role_data.py | 5 +- .../new_on_call_role_data_attributes.py | 542 ++- rootly_sdk/models/new_on_call_shadow.py | 5 +- rootly_sdk/models/new_on_call_shadow_data.py | 5 +- .../new_on_call_shadow_data_attributes.py | 2 - rootly_sdk/models/new_override_shift.py | 5 +- rootly_sdk/models/new_override_shift_data.py | 5 +- .../new_override_shift_data_attributes.py | 2 - rootly_sdk/models/new_playbook.py | 5 +- rootly_sdk/models/new_playbook_data.py | 5 +- .../models/new_playbook_data_attributes.py | 96 +- rootly_sdk/models/new_playbook_task.py | 5 +- rootly_sdk/models/new_playbook_task_data.py | 5 +- .../new_playbook_task_data_attributes.py | 24 +- rootly_sdk/models/new_post_mortem_template.py | 5 +- .../models/new_post_mortem_template_data.py | 5 +- ...ew_post_mortem_template_data_attributes.py | 47 +- rootly_sdk/models/new_pulse.py | 5 +- rootly_sdk/models/new_pulse_data.py | 5 +- .../models/new_pulse_data_attributes.py | 164 +- .../new_pulse_data_attributes_data_type_0.py | 3 - ...ulse_data_attributes_labels_item_type_0.py | 2 - ..._pulse_data_attributes_refs_item_type_0.py | 2 - .../models/new_retrospective_process.py | 5 +- .../models/new_retrospective_process_data.py | 5 +- ...w_retrospective_process_data_attributes.py | 50 +- ...ective_process_matching_criteria_type_0.py | 2 - ...ective_process_matching_criteria_type_1.py | 2 - ...ective_process_matching_criteria_type_2.py | 2 - .../models/new_retrospective_process_group.py | 5 +- .../new_retrospective_process_group_data.py | 5 +- ...ospective_process_group_data_attributes.py | 8 +- .../new_retrospective_process_group_step.py | 5 +- ...w_retrospective_process_group_step_data.py | 5 +- ...tive_process_group_step_data_attributes.py | 8 +- rootly_sdk/models/new_retrospective_step.py | 5 +- .../models/new_retrospective_step_data.py | 5 +- .../new_retrospective_step_data_attributes.py | 71 +- rootly_sdk/models/new_role.py | 5 +- rootly_sdk/models/new_role_data.py | 5 +- rootly_sdk/models/new_role_data_attributes.py | 699 ++-- rootly_sdk/models/new_schedule.py | 5 +- rootly_sdk/models/new_schedule_data.py | 5 +- .../models/new_schedule_data_attributes.py | 134 +- ...le_data_attributes_slack_channel_type_0.py | 12 +- ...hedule_data_attributes_slack_user_group.py | 12 +- rootly_sdk/models/new_schedule_rotation.py | 5 +- .../new_schedule_rotation_active_day.py | 5 +- .../new_schedule_rotation_active_day_data.py | 5 +- ...ule_rotation_active_day_data_attributes.py | 7 +- ..._attributes_active_time_attributes_item.py | 12 +- .../models/new_schedule_rotation_data.py | 5 +- .../new_schedule_rotation_data_attributes.py | 143 +- ..._attributes_active_time_attributes_item.py | 2 - ...s_schedule_rotation_members_type_0_item.py | 8 +- ...schedule_rotationable_attributes_type_0.py | 2 - ...schedule_rotationable_attributes_type_1.py | 2 - ...schedule_rotationable_attributes_type_2.py | 2 - ...schedule_rotationable_attributes_type_3.py | 2 - .../models/new_schedule_rotation_user.py | 13 +- .../models/new_schedule_rotation_user_data.py | 21 +- ..._schedule_rotation_user_data_attributes.py | 8 +- rootly_sdk/models/new_secret.py | 5 +- rootly_sdk/models/new_secret_data.py | 5 +- .../models/new_secret_data_attributes.py | 42 +- rootly_sdk/models/new_service.py | 5 +- rootly_sdk/models/new_service_data.py | 5 +- .../models/new_service_data_attributes.py | 395 ++- ...tributes_alert_broadcast_channel_type_0.py | 8 +- ...butes_incident_broadcast_channel_type_0.py | 8 +- ...service_data_attributes_properties_item.py | 2 - ...ta_attributes_slack_aliases_type_0_item.py | 2 - ...a_attributes_slack_channels_type_0_item.py | 2 - rootly_sdk/models/new_severity.py | 5 +- rootly_sdk/models/new_severity_data.py | 5 +- .../models/new_severity_data_attributes.py | 108 +- ...ta_attributes_slack_aliases_type_0_item.py | 2 - ...a_attributes_slack_channels_type_0_item.py | 2 - .../models/new_shift_coverage_request.py | 5 +- .../models/new_shift_coverage_request_data.py | 5 +- ..._shift_coverage_request_data_attributes.py | 10 +- rootly_sdk/models/new_sla.py | 5 +- rootly_sdk/models/new_sla_data.py | 5 +- rootly_sdk/models/new_sla_data_attributes.py | 155 +- ...new_sla_data_attributes_conditions_item.py | 42 +- ...ibutes_notification_configurations_item.py | 2 - rootly_sdk/models/new_status_page.py | 5 +- .../models/new_status_page_announcement.py | 65 + .../new_status_page_announcement_data.py | 78 + ...tatus_page_announcement_data_attributes.py | 60 + .../new_status_page_announcement_data_type.py | 15 + .../models/new_status_page_component.py | 65 + .../models/new_status_page_component_data.py | 78 + ...w_status_page_component_data_attributes.py | 146 + ...e_component_data_attributes_source_type.py | 20 + .../new_status_page_component_data_type.py | 15 + .../models/new_status_page_component_group.py | 65 + .../new_status_page_component_group_data.py | 78 + ...us_page_component_group_data_attributes.py | 92 + ...w_status_page_component_group_data_type.py | 15 + rootly_sdk/models/new_status_page_data.py | 5 +- .../models/new_status_page_data_attributes.py | 303 +- rootly_sdk/models/new_status_page_template.py | 5 +- .../models/new_status_page_template_data.py | 5 +- ...ew_status_page_template_data_attributes.py | 60 +- rootly_sdk/models/new_sub_status.py | 5 +- rootly_sdk/models/new_sub_status_data.py | 5 +- .../models/new_sub_status_data_attributes.py | 45 +- rootly_sdk/models/new_team.py | 5 +- rootly_sdk/models/new_team_data.py | 5 +- rootly_sdk/models/new_team_data_attributes.py | 350 +- ...tributes_alert_broadcast_channel_type_0.py | 8 +- ...butes_incident_broadcast_channel_type_0.py | 8 +- ...ew_team_data_attributes_properties_item.py | 2 - ...ta_attributes_slack_aliases_type_0_item.py | 2 - ...a_attributes_slack_channels_type_0_item.py | 2 - rootly_sdk/models/new_user_email_address.py | 5 +- .../models/new_user_email_address_data.py | 5 +- .../new_user_email_address_data_attributes.py | 2 - .../models/new_user_notification_rule.py | 5 +- .../models/new_user_notification_rule_data.py | 5 +- ..._user_notification_rule_data_attributes.py | 64 +- ...a_attributes_enabled_contact_types_item.py | 3 +- rootly_sdk/models/new_user_phone_number.py | 5 +- .../models/new_user_phone_number_data.py | 5 +- .../new_user_phone_number_data_attributes.py | 2 - rootly_sdk/models/new_verified_domain.py | 65 + rootly_sdk/models/new_verified_domain_data.py | 75 + .../new_verified_domain_data_attributes.py | 40 + .../models/new_verified_domain_data_type.py | 15 + rootly_sdk/models/new_webhooks_endpoint.py | 5 +- .../models/new_webhooks_endpoint_data.py | 5 +- .../new_webhooks_endpoint_data_attributes.py | 70 +- ...int_data_attributes_custom_headers_item.py | 2 - ...dpoint_data_attributes_event_types_item.py | 2 + rootly_sdk/models/new_workflow.py | 5 +- ...rkflow_action_item_form_field_condition.py | 5 +- ...w_action_item_form_field_condition_data.py | 5 +- ...em_form_field_condition_data_attributes.py | 64 +- .../new_workflow_custom_field_selection.py | 5 +- ...ew_workflow_custom_field_selection_data.py | 5 +- ..._custom_field_selection_data_attributes.py | 20 +- rootly_sdk/models/new_workflow_data.py | 26 +- .../models/new_workflow_data_attributes.py | 245 +- .../new_workflow_form_field_condition.py | 5 +- .../new_workflow_form_field_condition_data.py | 5 +- ...ow_form_field_condition_data_attributes.py | 68 +- rootly_sdk/models/new_workflow_group.py | 5 +- rootly_sdk/models/new_workflow_group_data.py | 5 +- .../new_workflow_group_data_attributes.py | 55 +- rootly_sdk/models/new_workflow_run.py | 5 +- rootly_sdk/models/new_workflow_run_data.py | 52 +- ...new_workflow_run_data_attributes_type_0.py | 35 +- ...flow_run_data_attributes_type_0_context.py | 3 - ...new_workflow_run_data_attributes_type_1.py | 36 +- ...flow_run_data_attributes_type_1_context.py | 3 - ...new_workflow_run_data_attributes_type_2.py | 36 +- ...flow_run_data_attributes_type_2_context.py | 3 - ...new_workflow_run_data_attributes_type_3.py | 36 +- ...flow_run_data_attributes_type_3_context.py | 3 - ...new_workflow_run_data_attributes_type_4.py | 36 +- ...flow_run_data_attributes_type_4_context.py | 3 - ...new_workflow_run_data_attributes_type_5.py | 36 +- ...flow_run_data_attributes_type_5_context.py | 3 - rootly_sdk/models/new_workflow_task.py | 5 +- rootly_sdk/models/new_workflow_task_data.py | 5 +- .../new_workflow_task_data_attributes.py | 1495 +++++---- rootly_sdk/models/on_call_pay_report.py | 102 +- rootly_sdk/models/on_call_pay_report_list.py | 29 +- .../on_call_pay_report_list_data_item.py | 5 +- .../models/on_call_pay_report_response.py | 23 +- .../on_call_pay_report_response_data.py | 5 +- rootly_sdk/models/on_call_role.py | 458 ++- rootly_sdk/models/on_call_role_list.py | 29 +- .../models/on_call_role_list_data_item.py | 5 +- .../models/on_call_role_relationship.py | 16 +- .../on_call_role_relationship_data_type_0.py | 16 +- rootly_sdk/models/on_call_role_response.py | 23 +- .../models/on_call_role_response_data.py | 5 +- rootly_sdk/models/on_call_shadow.py | 12 +- rootly_sdk/models/on_call_shadow_response.py | 23 +- .../models/on_call_shadow_response_data.py | 5 +- rootly_sdk/models/on_call_shadows_list.py | 29 +- .../models/on_call_shadows_list_data_item.py | 5 +- rootly_sdk/models/oncall.py | 67 +- rootly_sdk/models/oncall_list.py | 25 +- rootly_sdk/models/oncall_list_data_item.py | 15 +- rootly_sdk/models/oncall_relationships.py | 29 +- .../oncall_relationships_escalation_policy.py | 16 +- ...tionships_escalation_policy_data_type_0.py | 16 +- .../models/oncall_relationships_schedule.py | 16 +- ...call_relationships_schedule_data_type_0.py | 16 +- .../models/oncall_relationships_user.py | 16 +- .../oncall_relationships_user_data_type_0.py | 16 +- rootly_sdk/models/override_shift.py | 43 +- rootly_sdk/models/override_shift_list.py | 29 +- .../models/override_shift_list_data_item.py | 5 +- rootly_sdk/models/override_shift_response.py | 23 +- .../models/override_shift_response_data.py | 5 +- ...e_jsmops_on_call_responders_task_params.py | 71 +- ..._call_responders_task_params_teams_item.py | 12 +- ..._call_responders_task_params_users_item.py | 12 +- ...opsgenie_on_call_responders_task_params.py | 71 +- ..._call_responders_task_params_teams_item.py | 12 +- ..._call_responders_task_params_users_item.py | 12 +- ...agerduty_on_call_responders_task_params.py | 87 +- ...rs_task_params_escalation_policies_item.py | 12 +- ..._on_call_responders_task_params_service.py | 12 +- ..._call_responders_task_params_users_item.py | 12 +- ...e_rootly_on_call_responders_task_params.py | 65 +- ...rs_task_params_escalation_policy_target.py | 12 +- ...onders_task_params_functionality_target.py | 12 +- ...all_responders_task_params_group_target.py | 12 +- ...l_responders_task_params_service_target.py | 12 +- ...call_responders_task_params_user_target.py | 12 +- ...esponders_task_params_type_0_users_item.py | 12 +- ..._params_type_1_escalation_policies_item.py | 12 +- rootly_sdk/models/patch_alert_route.py | 5 +- rootly_sdk/models/patch_alert_route_data.py | 5 +- .../patch_alert_route_data_attributes.py | 61 +- ..._alert_route_data_attributes_rules_item.py | 67 +- ...ibutes_rules_item_condition_groups_item.py | 42 +- ...m_condition_groups_item_conditions_item.py | 121 +- ...attributes_rules_item_destinations_item.py | 34 +- .../models/phone_verification_response.py | 12 +- rootly_sdk/models/playbook.py | 96 +- rootly_sdk/models/playbook_list.py | 29 +- rootly_sdk/models/playbook_list_data_item.py | 5 +- rootly_sdk/models/playbook_response.py | 23 +- rootly_sdk/models/playbook_response_data.py | 5 +- rootly_sdk/models/playbook_task.py | 28 +- rootly_sdk/models/playbook_task_list.py | 29 +- .../models/playbook_task_list_data_item.py | 5 +- rootly_sdk/models/playbook_task_response.py | 23 +- .../models/playbook_task_response_data.py | 5 +- rootly_sdk/models/post_mortem_template.py | 55 +- ...ost_mortem_template_content_json_type_0.py | 3 - .../models/post_mortem_template_list.py | 29 +- .../post_mortem_template_list_data_item.py | 5 +- .../models/post_mortem_template_response.py | 23 +- .../post_mortem_template_response_data.py | 5 +- .../models/post_mortem_trigger_params.py | 291 +- rootly_sdk/models/print_task_params.py | 12 +- .../models/publish_incident_task_params.py | 64 +- .../publish_incident_task_params_incident.py | 12 +- ...cident_task_params_status_page_template.py | 12 +- rootly_sdk/models/pulse.py | 148 +- rootly_sdk/models/pulse_data_type_0.py | 3 - rootly_sdk/models/pulse_labels_item_type_0.py | 2 - rootly_sdk/models/pulse_list.py | 29 +- rootly_sdk/models/pulse_list_data_item.py | 5 +- rootly_sdk/models/pulse_refs_item_type_0.py | 2 - rootly_sdk/models/pulse_response.py | 23 +- rootly_sdk/models/pulse_response_data.py | 5 +- rootly_sdk/models/pulse_trigger_params.py | 92 +- rootly_sdk/models/receipt.py | 20 +- rootly_sdk/models/redis_client_task_params.py | 45 +- ...task_params_post_to_slack_channels_item.py | 12 +- ...ove_google_docs_permissions_task_params.py | 12 +- rootly_sdk/models/remove_subscribers.py | 5 +- rootly_sdk/models/remove_subscribers_data.py | 5 +- .../remove_subscribers_data_attributes.py | 28 +- .../rename_google_chat_space_task_params.py | 15 +- ...ame_google_chat_space_task_params_space.py | 12 +- ...ame_microsoft_teams_channel_task_params.py | 17 +- ...osoft_teams_channel_task_params_channel.py | 12 +- ...icrosoft_teams_channel_task_params_team.py | 12 +- .../rename_slack_channel_task_params.py | 15 +- ...ename_slack_channel_task_params_channel.py | 12 +- rootly_sdk/models/resolve_alert.py | 13 +- rootly_sdk/models/resolve_alert_data.py | 21 +- .../models/resolve_alert_data_attributes.py | 24 +- rootly_sdk/models/resolve_incident.py | 5 +- rootly_sdk/models/resolve_incident_data.py | 5 +- .../resolve_incident_data_attributes.py | 14 +- rootly_sdk/models/restart_incident.py | 5 +- rootly_sdk/models/restart_incident_data.py | 13 +- .../restart_incident_data_attributes.py | 3 - .../models/retrospective_configuration.py | 57 +- .../retrospective_configuration_list.py | 25 +- ...rospective_configuration_list_data_item.py | 5 +- .../retrospective_configuration_response.py | 23 +- ...trospective_configuration_response_data.py | 5 +- rootly_sdk/models/retrospective_process.py | 72 +- .../models/retrospective_process_group.py | 2 - .../retrospective_process_group_list.py | 29 +- ...rospective_process_group_list_data_item.py | 5 +- .../retrospective_process_group_response.py | 23 +- ...trospective_process_group_response_data.py | 5 +- .../retrospective_process_group_step.py | 2 - .../retrospective_process_group_step_list.py | 29 +- ...ctive_process_group_step_list_data_item.py | 5 +- ...trospective_process_group_step_response.py | 23 +- ...ective_process_group_step_response_data.py | 5 +- .../models/retrospective_process_list.py | 29 +- .../retrospective_process_list_data_item.py | 5 +- .../models/retrospective_process_response.py | 23 +- .../retrospective_process_response_data.py | 5 +- ...ective_process_matching_criteria_type_0.py | 2 - ...ective_process_matching_criteria_type_1.py | 2 - ...ective_process_matching_criteria_type_2.py | 2 - rootly_sdk/models/retrospective_step.py | 48 +- rootly_sdk/models/retrospective_step_list.py | 29 +- .../retrospective_step_list_data_item.py | 5 +- .../models/retrospective_step_response.py | 23 +- .../retrospective_step_response_data.py | 5 +- rootly_sdk/models/role.py | 606 ++-- rootly_sdk/models/role_list.py | 29 +- rootly_sdk/models/role_list_data_item.py | 5 +- rootly_sdk/models/role_relationship.py | 16 +- .../models/role_relationship_data_type_0.py | 16 +- rootly_sdk/models/role_response.py | 23 +- rootly_sdk/models/role_response_data.py | 5 +- rootly_sdk/models/rotate_api_key.py | 5 +- rootly_sdk/models/rotate_api_key_data.py | 5 +- .../models/rotate_api_key_data_attributes.py | 22 +- .../models/run_command_heroku_task_params.py | 37 +- ...task_params_post_to_slack_channels_item.py | 12 +- rootly_sdk/models/schedule.py | 97 +- rootly_sdk/models/schedule_list.py | 29 +- rootly_sdk/models/schedule_list_data_item.py | 5 +- rootly_sdk/models/schedule_response.py | 23 +- rootly_sdk/models/schedule_response_data.py | 5 +- rootly_sdk/models/schedule_rotation.py | 120 +- .../models/schedule_rotation_active_day.py | 9 +- ..._active_day_active_time_attributes_item.py | 12 +- .../schedule_rotation_active_day_list.py | 29 +- ...dule_rotation_active_day_list_data_item.py | 5 +- .../schedule_rotation_active_day_response.py | 29 +- ...edule_rotation_active_day_response_data.py | 25 +- ...le_rotation_active_time_attributes_item.py | 2 - rootly_sdk/models/schedule_rotation_list.py | 29 +- .../schedule_rotation_list_data_item.py | 5 +- .../models/schedule_rotation_response.py | 23 +- .../models/schedule_rotation_response_data.py | 5 +- ...schedule_rotationable_attributes_type_0.py | 2 - ...schedule_rotationable_attributes_type_1.py | 2 - ...schedule_rotationable_attributes_type_2.py | 2 - ...schedule_rotationable_attributes_type_3.py | 2 - rootly_sdk/models/schedule_rotation_user.py | 2 - .../models/schedule_rotation_user_list.py | 29 +- .../schedule_rotation_user_list_data_item.py | 5 +- .../models/schedule_rotation_user_response.py | 23 +- .../schedule_rotation_user_response_data.py | 5 +- .../models/schedule_slack_channel_type_0.py | 12 +- .../schedule_slack_user_group_type_0.py | 12 +- rootly_sdk/models/secret.py | 26 +- rootly_sdk/models/secret_list.py | 25 +- rootly_sdk/models/secret_list_data_item.py | 5 +- rootly_sdk/models/secret_response.py | 5 +- rootly_sdk/models/secret_response_data.py | 5 +- .../send_dashboard_report_task_params.py | 38 +- rootly_sdk/models/send_email_task_params.py | 68 +- ...end_google_chat_attachments_task_params.py | 17 +- ...hat_attachments_task_params_spaces_item.py | 12 +- .../send_google_chat_message_task_params.py | 27 +- ...le_chat_message_task_params_spaces_item.py | 12 +- ...blocks_task_params_type_0_channels_item.py | 12 +- ...icrosoft_teams_chat_message_task_params.py | 17 +- ...ams_chat_message_task_params_chats_item.py | 12 +- ...essage_task_params_type_0_channels_item.py | 12 +- ...blocks_task_params_type_0_channels_item.py | 12 +- ...cks_task_params_type_1_slack_users_item.py | 12 +- ...sk_params_type_2_slack_user_groups_item.py | 12 +- ...essage_task_params_type_0_channels_item.py | 12 +- ...age_task_params_type_1_slack_users_item.py | 12 +- ...sk_params_type_2_slack_user_groups_item.py | 12 +- rootly_sdk/models/send_sms_task_params.py | 12 +- .../send_whatsapp_message_task_params.py | 12 +- rootly_sdk/models/service.py | 359 +- .../service_alert_broadcast_channel_type_0.py | 12 +- ...rvice_incident_broadcast_channel_type_0.py | 12 +- rootly_sdk/models/service_list.py | 29 +- rootly_sdk/models/service_list_data_item.py | 5 +- .../models/service_properties_type_0_item.py | 2 - rootly_sdk/models/service_response.py | 23 +- rootly_sdk/models/service_response_data.py | 5 +- .../service_slack_aliases_type_0_item.py | 2 - .../service_slack_channels_type_0_item.py | 2 - rootly_sdk/models/severity.py | 84 +- rootly_sdk/models/severity_list.py | 29 +- rootly_sdk/models/severity_list_data_item.py | 5 +- rootly_sdk/models/severity_response.py | 23 +- rootly_sdk/models/severity_response_data.py | 5 +- .../severity_slack_aliases_type_0_item.py | 2 - .../severity_slack_channels_type_0_item.py | 2 - rootly_sdk/models/shift.py | 24 +- rootly_sdk/models/shift_coverage_request.py | 45 +- .../models/shift_coverage_request_list.py | 41 +- .../shift_coverage_request_list_data_item.py | 5 +- .../models/shift_coverage_request_response.py | 23 +- .../shift_coverage_request_response_data.py | 5 +- rootly_sdk/models/shift_list.py | 33 +- rootly_sdk/models/shift_list_data_item.py | 15 +- rootly_sdk/models/shift_override.py | 12 +- rootly_sdk/models/shift_override_response.py | 23 +- .../models/shift_override_response_data.py | 5 +- rootly_sdk/models/shift_relationships.py | 29 +- .../models/shift_relationships_assignee.py | 16 +- ...hift_relationships_assignee_data_type_0.py | 12 +- .../shift_relationships_shift_override.py | 16 +- ...elationships_shift_override_data_type_0.py | 16 +- rootly_sdk/models/shift_relationships_user.py | 16 +- .../shift_relationships_user_data_type_0.py | 16 +- rootly_sdk/models/simple_trigger_params.py | 20 +- rootly_sdk/models/sla.py | 128 +- rootly_sdk/models/sla_conditions_item.py | 62 +- rootly_sdk/models/sla_list.py | 29 +- rootly_sdk/models/sla_list_data_item.py | 5 +- .../sla_notification_configurations_item.py | 34 +- rootly_sdk/models/sla_response.py | 23 +- rootly_sdk/models/sla_response_data.py | 5 +- rootly_sdk/models/slack_channel.py | 2 - .../snapshot_datadog_graph_task_params.py | 59 +- ...tadog_graph_task_params_dashboards_item.py | 12 +- ...task_params_post_to_slack_channels_item.py | 12 +- .../snapshot_grafana_dashboard_task_params.py | 41 +- ...a_dashboard_task_params_dashboards_item.py | 12 +- ...task_params_post_to_slack_channels_item.py | 12 +- .../snapshot_looker_look_task_params.py | 41 +- ...looker_look_task_params_dashboards_item.py | 12 +- ...task_params_post_to_slack_channels_item.py | 12 +- .../snapshot_new_relic_graph_task_params.py | 37 +- ...task_params_post_to_slack_channels_item.py | 12 +- rootly_sdk/models/snooze_alert.py | 5 +- rootly_sdk/models/snooze_alert_data.py | 5 +- .../models/snooze_alert_data_attributes.py | 2 - rootly_sdk/models/start_session_request.py | 22 +- rootly_sdk/models/start_session_response.py | 13 +- .../models/start_session_response_data.py | 2 - rootly_sdk/models/status.py | 18 +- rootly_sdk/models/status_list.py | 29 +- rootly_sdk/models/status_list_data_item.py | 5 +- rootly_sdk/models/status_page.py | 296 +- rootly_sdk/models/status_page_announcement.py | 121 + .../models/status_page_announcement_list.py | 116 + ...status_page_announcement_list_data_item.py | 86 + ...s_page_announcement_list_data_item_type.py | 19 + .../status_page_announcement_response.py | 88 + .../status_page_announcement_response_data.py | 86 + ...us_page_announcement_response_data_type.py | 19 + .../status_page_cname_records_type_0.py | 3 - rootly_sdk/models/status_page_component.py | 207 ++ .../models/status_page_component_group.py | 124 + .../status_page_component_group_list.py | 116 + ...tus_page_component_group_list_data_item.py | 86 + ...age_component_group_list_data_item_type.py | 19 + .../status_page_component_group_response.py | 88 + ...atus_page_component_group_response_data.py | 86 + ...page_component_group_response_data_type.py | 19 + .../models/status_page_component_list.py | 116 + .../status_page_component_list_data_item.py | 86 + ...atus_page_component_list_data_item_type.py | 15 + .../models/status_page_component_response.py | 88 + .../status_page_component_response_data.py | 86 + ...tatus_page_component_response_data_type.py | 15 + .../models/status_page_component_status.py | 22 + rootly_sdk/models/status_page_list.py | 29 +- .../models/status_page_list_data_item.py | 5 +- rootly_sdk/models/status_page_response.py | 23 +- .../models/status_page_response_data.py | 5 +- rootly_sdk/models/status_page_template.py | 56 +- .../models/status_page_template_list.py | 29 +- .../status_page_template_list_data_item.py | 5 +- .../models/status_page_template_response.py | 23 +- .../status_page_template_response_data.py | 5 +- rootly_sdk/models/status_response.py | 23 +- rootly_sdk/models/status_response_data.py | 5 +- rootly_sdk/models/sub_status.py | 28 +- rootly_sdk/models/sub_status_list.py | 29 +- .../models/sub_status_list_data_item.py | 5 +- rootly_sdk/models/sub_status_response.py | 23 +- rootly_sdk/models/sub_status_response_data.py | 5 +- rootly_sdk/models/team.py | 330 +- .../team_alert_broadcast_channel_type_0.py | 12 +- .../team_incident_broadcast_channel_type_0.py | 12 +- rootly_sdk/models/team_list.py | 29 +- rootly_sdk/models/team_list_data_item.py | 5 +- .../models/team_properties_type_0_item.py | 2 - rootly_sdk/models/team_response.py | 23 +- rootly_sdk/models/team_response_data.py | 5 +- .../models/team_slack_aliases_type_0_item.py | 2 - .../models/team_slack_channels_type_0_item.py | 2 - rootly_sdk/models/tiptap_block_schema.py | 21 +- .../tiptap_block_schema_followup_component.py | 12 +- .../tiptap_block_schema_timeline_component.py | 2 - .../models/trigger_workflow_task_params.py | 30 +- .../trigger_workflow_task_params_resource.py | 12 +- .../trigger_workflow_task_params_workflow.py | 12 +- .../tweet_twitter_message_task_params.py | 12 +- rootly_sdk/models/unassign_role_from_user.py | 5 +- .../models/unassign_role_from_user_data.py | 5 +- ...unassign_role_from_user_data_attributes.py | 12 +- .../models/update_action_item_task_params.py | 78 +- ...ction_item_task_params_assigned_to_user.py | 12 +- ...pdate_airtable_table_record_task_params.py | 22 +- rootly_sdk/models/update_alert.py | 5 +- rootly_sdk/models/update_alert_data.py | 5 +- .../models/update_alert_data_attributes.py | 266 +- ...ert_field_values_attributes_item_type_0.py | 2 - ...pdate_alert_data_attributes_data_type_0.py | 3 - ...lert_data_attributes_labels_item_type_0.py | 14 +- rootly_sdk/models/update_alert_event.py | 5 +- rootly_sdk/models/update_alert_event_data.py | 5 +- .../update_alert_event_data_attributes.py | 8 +- rootly_sdk/models/update_alert_field.py | 5 +- rootly_sdk/models/update_alert_field_data.py | 5 +- .../update_alert_field_data_attributes.py | 30 +- rootly_sdk/models/update_alert_group.py | 5 +- rootly_sdk/models/update_alert_group_data.py | 5 +- .../update_alert_group_data_attributes.py | 125 +- ...t_group_data_attributes_attributes_item.py | 8 +- ...t_group_data_attributes_conditions_item.py | 59 +- ...lert_group_data_attributes_targets_item.py | 2 - .../models/update_alert_retrigger_rule.py | 65 + .../update_alert_retrigger_rule_data.py | 78 + ...te_alert_retrigger_rule_data_attributes.py | 121 + ...er_rule_data_attributes_conditions_item.py | 123 + ...le_data_attributes_conditions_item_kind.py | 28 + ...ata_attributes_conditions_item_operator.py | 39 + ...trigger_rule_data_attributes_match_mode.py | 20 + ...er_rule_data_attributes_timeout_minutes.py | 34 + .../update_alert_retrigger_rule_data_type.py | 15 + rootly_sdk/models/update_alert_route.py | 5 +- rootly_sdk/models/update_alert_route_data.py | 5 +- .../update_alert_route_data_attributes.py | 61 +- ..._alert_route_data_attributes_rules_item.py | 21 +- ...ibutes_rules_item_condition_groups_item.py | 13 +- ...m_condition_groups_item_conditions_item.py | 73 +- ...attributes_rules_item_destinations_item.py | 2 - .../models/update_alert_routing_rule.py | 5 +- .../models/update_alert_routing_rule_data.py | 5 +- ...date_alert_routing_rule_data_attributes.py | 75 +- ...ng_rule_data_attributes_conditions_item.py | 69 +- ...outing_rule_data_attributes_destination.py | 22 +- rootly_sdk/models/update_alert_urgency.py | 5 +- .../models/update_alert_urgency_data.py | 5 +- .../update_alert_urgency_data_attributes.py | 43 +- rootly_sdk/models/update_alerts_source.py | 5 +- .../models/update_alerts_source_data.py | 5 +- .../update_alerts_source_data_attributes.py | 173 +- ...tes_alert_source_fields_attributes_item.py | 20 +- ...rt_source_urgency_rules_attributes_item.py | 73 +- ...ibutes_alert_template_attributes_type_0.py | 34 +- ...butes_resolution_rule_attributes_type_0.py | 123 +- ...butes_type_0_conditions_attributes_item.py | 77 +- ...attributes_sourceable_attributes_type_0.py | 66 +- ...s_type_0_field_mappings_attributes_item.py | 18 +- rootly_sdk/models/update_api_key.py | 5 +- rootly_sdk/models/update_api_key_data.py | 5 +- .../models/update_api_key_data_attributes.py | 30 +- .../models/update_asana_task_task_params.py | 61 +- ...pdate_asana_task_task_params_completion.py | 12 +- .../update_attached_alerts_task_params.py | 12 +- rootly_sdk/models/update_authorization.py | 5 +- .../models/update_authorization_data.py | 5 +- .../update_authorization_data_attributes.py | 20 +- rootly_sdk/models/update_catalog.py | 5 +- .../update_catalog_checklist_template.py | 5 +- .../update_catalog_checklist_template_data.py | 5 +- ...alog_checklist_template_data_attributes.py | 122 +- ..._template_data_attributes_builtin_field.py | 2 - ...t_template_data_attributes_custom_field.py | 8 +- ...late_data_attributes_owners_type_0_item.py | 2 - rootly_sdk/models/update_catalog_data.py | 5 +- .../models/update_catalog_data_attributes.py | 68 +- rootly_sdk/models/update_catalog_entity.py | 5 +- .../models/update_catalog_entity_data.py | 5 +- .../update_catalog_entity_data_attributes.py | 107 +- ..._entity_data_attributes_properties_item.py | 2 - .../models/update_catalog_entity_property.py | 5 +- .../update_catalog_entity_property_data.py | 5 +- ...catalog_entity_property_data_attributes.py | 16 +- rootly_sdk/models/update_catalog_field.py | 5 +- .../models/update_catalog_field_data.py | 5 +- .../update_catalog_field_data_attributes.py | 81 +- rootly_sdk/models/update_catalog_property.py | 5 +- .../models/update_catalog_property_data.py | 5 +- ...update_catalog_property_data_attributes.py | 84 +- rootly_sdk/models/update_cause.py | 5 +- rootly_sdk/models/update_cause_data.py | 5 +- .../models/update_cause_data_attributes.py | 86 +- ...e_cause_data_attributes_properties_item.py | 2 - .../models/update_clickup_task_task_params.py | 57 +- ...pdate_clickup_task_task_params_priority.py | 12 +- .../models/update_coda_page_task_params.py | 37 +- .../update_coda_page_task_params_template.py | 12 +- .../models/update_communications_group.py | 5 +- .../update_communications_group_data.py | 5 +- ...te_communications_group_data_attributes.py | 134 +- ...tion_external_group_members_type_0_item.py | 26 +- ...munication_group_conditions_type_0_item.py | 90 +- .../models/update_communications_stage.py | 5 +- .../update_communications_stage_data.py | 5 +- ...te_communications_stage_data_attributes.py | 50 +- .../models/update_communications_template.py | 5 +- .../update_communications_template_data.py | 5 +- ...communications_template_data_attributes.py | 67 +- ..._template_stages_attributes_type_0_item.py | 54 +- .../models/update_communications_type.py | 5 +- .../models/update_communications_type_data.py | 5 +- ...ate_communications_type_data_attributes.py | 60 +- .../update_confluence_page_task_params.py | 60 +- ...confluence_page_task_params_integration.py | 12 +- ...te_confluence_page_task_params_template.py | 12 +- rootly_sdk/models/update_custom_field.py | 5 +- rootly_sdk/models/update_custom_field_data.py | 5 +- .../update_custom_field_data_attributes.py | 60 +- .../models/update_custom_field_option.py | 5 +- .../models/update_custom_field_option_data.py | 5 +- ...ate_custom_field_option_data_attributes.py | 20 +- rootly_sdk/models/update_custom_form.py | 5 +- rootly_sdk/models/update_custom_form_data.py | 5 +- .../update_custom_form_data_attributes.py | 48 +- rootly_sdk/models/update_dashboard.py | 5 +- rootly_sdk/models/update_dashboard_data.py | 21 +- .../update_dashboard_data_attributes.py | 64 +- rootly_sdk/models/update_dashboard_panel.py | 5 +- .../models/update_dashboard_panel_data.py | 21 +- .../update_dashboard_panel_data_attributes.py | 34 +- ..._dashboard_panel_data_attributes_params.py | 55 +- ...panel_data_attributes_params_datalabels.py | 8 +- ...el_data_attributes_params_datasets_item.py | 62 +- ...s_params_datasets_item_aggregate_type_0.py | 32 +- ...ibutes_params_datasets_item_filter_item.py | 33 +- ...ms_datasets_item_filter_item_rules_item.py | 28 +- ...ms_datasets_item_group_by_type_1_type_0.py | 2 - ...ard_panel_data_attributes_params_legend.py | 12 +- ...d_panel_data_attributes_position_type_0.py | 2 - .../update_datadog_notebook_task_params.py | 41 +- ...e_datadog_notebook_task_params_template.py | 12 +- .../update_dropbox_paper_page_task_params.py | 24 +- rootly_sdk/models/update_edge_connector.py | 5 +- .../models/update_edge_connector_action.py | 5 +- .../update_edge_connector_action_action.py | 25 +- ...e_edge_connector_action_action_metadata.py | 3 - .../update_edge_connector_action_body.py | 13 +- ...pdate_edge_connector_action_body_action.py | 25 +- ...e_connector_action_body_action_metadata.py | 3 - .../models/update_edge_connector_body.py | 13 +- .../models/update_edge_connector_body_data.py | 25 +- ...ate_edge_connector_body_data_attributes.py | 35 +- ..._connector_body_data_attributes_filters.py | 3 - .../update_edge_connector_edge_connector.py | 26 +- rootly_sdk/models/update_environment.py | 5 +- rootly_sdk/models/update_environment_data.py | 5 +- .../update_environment_data_attributes.py | 145 +- ...ronment_data_attributes_properties_item.py | 2 - ...ta_attributes_slack_aliases_type_0_item.py | 2 - ...a_attributes_slack_channels_type_0_item.py | 2 - rootly_sdk/models/update_escalation_policy.py | 5 +- .../models/update_escalation_policy_data.py | 5 +- ...pdate_escalation_policy_data_attributes.py | 48 +- ...y_data_attributes_business_hours_type_0.py | 48 +- .../models/update_escalation_policy_level.py | 5 +- .../update_escalation_policy_level_data.py | 5 +- ...escalation_policy_level_data_attributes.py | 234 +- ..._notification_target_params_item_type_0.py | 19 +- ...ing_strategy_configuration_repeats_mode.py | 22 + ...g_strategy_configuration_rotation_scope.py | 24 + .../models/update_escalation_policy_path.py | 5 +- .../update_escalation_policy_path_data.py | 5 +- ..._escalation_policy_path_data_attributes.py | 781 +++-- ..._path_data_attributes_rules_item_type_0.py | 2 - ..._path_data_attributes_rules_item_type_1.py | 2 - ..._path_data_attributes_rules_item_type_2.py | 20 +- ..._path_data_attributes_rules_item_type_3.py | 10 +- ..._path_data_attributes_rules_item_type_4.py | 2 - ..._path_data_attributes_rules_item_type_5.py | 7 +- ...utes_rules_item_type_5_time_blocks_item.py | 54 +- ..._path_data_attributes_rules_item_type_6.py | 2 - ..._path_data_attributes_rules_item_type_7.py | 2 - ...ata_attributes_rules_item_type_8_type_0.py | 2 - ...ata_attributes_rules_item_type_8_type_1.py | 2 - ...ata_attributes_rules_item_type_8_type_2.py | 20 +- ...ata_attributes_rules_item_type_8_type_3.py | 10 +- ...ata_attributes_rules_item_type_8_type_4.py | 2 - ...ata_attributes_rules_item_type_8_type_5.py | 7 +- ...les_item_type_8_type_5_time_blocks_item.py | 54 +- ...ata_attributes_rules_item_type_8_type_6.py | 2 - ...ata_attributes_rules_item_type_8_type_7.py | 2 - ...ata_attributes_rules_item_type_9_type_0.py | 2 - ...ata_attributes_rules_item_type_9_type_1.py | 2 - ...ata_attributes_rules_item_type_9_type_2.py | 20 +- ...ata_attributes_rules_item_type_9_type_3.py | 10 +- ...ata_attributes_rules_item_type_9_type_4.py | 2 - ...ata_attributes_rules_item_type_9_type_5.py | 7 +- ...les_item_type_9_type_5_time_blocks_item.py | 54 +- ...ata_attributes_rules_item_type_9_type_6.py | 2 - ...ata_attributes_rules_item_type_9_type_7.py | 2 - ..._data_attributes_time_restrictions_item.py | 28 +- rootly_sdk/models/update_form_field.py | 5 +- rootly_sdk/models/update_form_field_data.py | 5 +- .../update_form_field_data_attributes.py | 110 +- rootly_sdk/models/update_form_field_option.py | 5 +- .../models/update_form_field_option_data.py | 5 +- ...pdate_form_field_option_data_attributes.py | 20 +- .../models/update_form_field_placement.py | 5 +- .../update_form_field_placement_condition.py | 5 +- ...ate_form_field_placement_condition_data.py | 5 +- ...eld_placement_condition_data_attributes.py | 36 +- .../update_form_field_placement_data.py | 5 +- ...te_form_field_placement_data_attributes.py | 43 +- .../models/update_form_field_position.py | 5 +- .../models/update_form_field_position_data.py | 5 +- ...ate_form_field_position_data_attributes.py | 20 +- ...orm_field_position_data_attributes_form.py | 4 + rootly_sdk/models/update_form_set.py | 5 +- .../models/update_form_set_condition.py | 5 +- .../models/update_form_set_condition_data.py | 5 +- ...date_form_set_condition_data_attributes.py | 22 +- rootly_sdk/models/update_form_set_data.py | 5 +- .../models/update_form_set_data_attributes.py | 40 +- rootly_sdk/models/update_functionality.py | 5 +- .../models/update_functionality_data.py | 5 +- .../update_functionality_data_attributes.py | 257 +- ...onality_data_attributes_properties_item.py | 2 - ...ta_attributes_slack_aliases_type_0_item.py | 2 - ...a_attributes_slack_channels_type_0_item.py | 2 - .../models/update_github_issue_task_params.py | 77 +- ...ate_github_issue_task_params_completion.py | 12 +- ...ate_github_issue_task_params_issue_type.py | 12 +- ...te_github_issue_task_params_labels_item.py | 12 +- ...ate_github_issue_task_params_repository.py | 12 +- .../models/update_gitlab_issue_task_params.py | 39 +- ...ate_gitlab_issue_task_params_completion.py | 12 +- ...pdate_google_calendar_event_task_params.py | 101 +- ...task_params_post_to_slack_channels_item.py | 12 +- ...ogle_chat_space_description_task_params.py | 15 +- ...hat_space_description_task_params_space.py | 12 +- .../update_google_docs_page_task_params.py | 45 +- rootly_sdk/models/update_heartbeat.py | 5 +- rootly_sdk/models/update_heartbeat_data.py | 5 +- .../update_heartbeat_data_attributes.py | 76 +- rootly_sdk/models/update_incident.py | 5 +- .../models/update_incident_action_item.py | 5 +- .../update_incident_action_item_data.py | 5 +- ...te_incident_action_item_data_attributes.py | 127 +- ...butes_form_field_selections_type_0_item.py | 87 +- .../update_incident_custom_field_selection.py | 5 +- ...te_incident_custom_field_selection_data.py | 5 +- ..._custom_field_selection_data_attributes.py | 20 +- rootly_sdk/models/update_incident_data.py | 5 +- .../models/update_incident_data_attributes.py | 422 ++- ..._incident_data_attributes_labels_type_0.py | 3 - rootly_sdk/models/update_incident_event.py | 5 +- .../models/update_incident_event_data.py | 5 +- .../update_incident_event_data_attributes.py | 17 +- .../update_incident_event_functionality.py | 5 +- ...pdate_incident_event_functionality_data.py | 5 +- ...ent_event_functionality_data_attributes.py | 2 - .../models/update_incident_event_service.py | 5 +- .../update_incident_event_service_data.py | 5 +- ..._incident_event_service_data_attributes.py | 2 - rootly_sdk/models/update_incident_feedback.py | 5 +- .../models/update_incident_feedback_data.py | 5 +- ...pdate_incident_feedback_data_attributes.py | 20 +- .../update_incident_form_field_selection.py | 5 +- ...date_incident_form_field_selection_data.py | 5 +- ...nt_form_field_selection_data_attributes.py | 68 +- .../models/update_incident_permission_set.py | 5 +- .../update_incident_permission_set_boolean.py | 5 +- ...te_incident_permission_set_boolean_data.py | 5 +- ..._permission_set_boolean_data_attributes.py | 29 +- ...boolean_data_attributes_severity_params.py | 30 +- .../update_incident_permission_set_data.py | 5 +- ...incident_permission_set_data_attributes.py | 100 +- ...update_incident_permission_set_resource.py | 5 +- ...e_incident_permission_set_resource_data.py | 5 +- ...permission_set_resource_data_attributes.py | 33 +- ...esource_data_attributes_severity_params.py | 30 +- .../models/update_incident_post_mortem.py | 5 +- .../update_incident_post_mortem_data.py | 5 +- ...te_incident_post_mortem_data_attributes.py | 98 +- .../update_incident_postmortem_task_params.py | 32 +- .../update_incident_retrospective_step.py | 5 +- ...update_incident_retrospective_step_data.py | 5 +- ...dent_retrospective_step_data_attributes.py | 51 +- rootly_sdk/models/update_incident_role.py | 5 +- .../models/update_incident_role_data.py | 5 +- .../update_incident_role_data_attributes.py | 72 +- .../models/update_incident_role_task.py | 5 +- .../models/update_incident_role_task_data.py | 5 +- ...date_incident_role_task_data_attributes.py | 26 +- .../update_incident_status_page_event.py | 5 +- .../update_incident_status_page_event_data.py | 5 +- ...ident_status_page_event_data_attributes.py | 54 +- ...e_incident_status_timestamp_task_params.py | 12 +- .../models/update_incident_sub_status.py | 5 +- .../models/update_incident_sub_status_data.py | 5 +- ...ate_incident_sub_status_data_attributes.py | 26 +- .../models/update_incident_task_params.py | 184 +- rootly_sdk/models/update_incident_type.py | 5 +- .../models/update_incident_type_data.py | 5 +- .../update_incident_type_data_attributes.py | 135 +- ...nt_type_data_attributes_properties_item.py | 2 - ...ta_attributes_slack_aliases_type_0_item.py | 2 - ...a_attributes_slack_channels_type_0_item.py | 2 - .../models/update_jira_issue_task_params.py | 103 +- ...date_jira_issue_task_params_integration.py | 12 +- .../update_jira_issue_task_params_priority.py | 12 +- .../update_jira_issue_task_params_status.py | 12 +- .../models/update_linear_issue_task_params.py | 78 +- ...te_linear_issue_task_params_labels_item.py | 12 +- ...pdate_linear_issue_task_params_priority.py | 12 +- ...update_linear_issue_task_params_project.py | 12 +- ...e_linear_issue_task_params_state_type_0.py | 12 +- rootly_sdk/models/update_live_call_router.py | 5 +- .../models/update_live_call_router_data.py | 5 +- ...update_live_call_router_data_attributes.py | 155 +- ...ibutes_escalation_policy_trigger_params.py | 2 - ...ter_data_attributes_paging_targets_item.py | 2 - .../models/update_motion_task_task_params.py | 43 +- ...update_motion_task_task_params_priority.py | 12 +- .../models/update_notion_page_task_params.py | 34 +- .../models/update_on_call_pay_report.py | 5 +- .../models/update_on_call_pay_report_data.py | 5 +- ...date_on_call_pay_report_data_attributes.py | 36 +- rootly_sdk/models/update_on_call_role.py | 5 +- rootly_sdk/models/update_on_call_role_data.py | 5 +- .../update_on_call_role_data_attributes.py | 559 ++-- rootly_sdk/models/update_on_call_shadow.py | 5 +- .../models/update_on_call_shadow_data.py | 5 +- .../update_on_call_shadow_data_attributes.py | 40 +- .../update_opsgenie_alert_task_params.py | 23 +- ...e_opsgenie_alert_task_params_completion.py | 12 +- .../update_opsgenie_incident_task_params.py | 36 +- rootly_sdk/models/update_override_shift.py | 5 +- .../models/update_override_shift_data.py | 5 +- .../update_override_shift_data_attributes.py | 2 - .../update_pagerduty_incident_task_params.py | 46 +- .../update_pagertree_alert_task_params.py | 77 +- ..._pagertree_alert_task_params_teams_item.py | 12 +- ..._pagertree_alert_task_params_users_item.py | 12 +- rootly_sdk/models/update_playbook.py | 5 +- rootly_sdk/models/update_playbook_data.py | 5 +- .../models/update_playbook_data_attributes.py | 100 +- rootly_sdk/models/update_playbook_task.py | 5 +- .../models/update_playbook_task_data.py | 5 +- .../update_playbook_task_data_attributes.py | 28 +- .../models/update_post_mortem_template.py | 5 +- .../update_post_mortem_template_data.py | 5 +- ...te_post_mortem_template_data_attributes.py | 52 +- rootly_sdk/models/update_pulse.py | 5 +- rootly_sdk/models/update_pulse_data.py | 5 +- .../models/update_pulse_data_attributes.py | 168 +- ...pdate_pulse_data_attributes_data_type_0.py | 3 - ...ulse_data_attributes_labels_item_type_0.py | 2 - ..._pulse_data_attributes_refs_item_type_0.py | 2 - .../models/update_quip_page_task_params.py | 28 +- .../update_retrospective_configuration.py | 5 +- ...update_retrospective_configuration_data.py | 5 +- ...ospective_configuration_data_attributes.py | 41 +- .../models/update_retrospective_process.py | 5 +- .../update_retrospective_process_data.py | 5 +- ...e_retrospective_process_data_attributes.py | 56 +- ...ective_process_matching_criteria_type_0.py | 2 - ...ective_process_matching_criteria_type_1.py | 2 - ...ective_process_matching_criteria_type_2.py | 2 - .../update_retrospective_process_group.py | 5 +- ...update_retrospective_process_group_data.py | 5 +- ...ospective_process_group_data_attributes.py | 12 +- ...update_retrospective_process_group_step.py | 5 +- ...e_retrospective_process_group_step_data.py | 5 +- ...tive_process_group_step_data_attributes.py | 8 +- .../models/update_retrospective_step.py | 5 +- .../models/update_retrospective_step_data.py | 5 +- ...date_retrospective_step_data_attributes.py | 76 +- rootly_sdk/models/update_role.py | 5 +- rootly_sdk/models/update_role_data.py | 5 +- .../models/update_role_data_attributes.py | 680 ++-- rootly_sdk/models/update_schedule.py | 5 +- rootly_sdk/models/update_schedule_data.py | 5 +- .../models/update_schedule_data_attributes.py | 148 +- ...le_data_attributes_slack_channel_type_0.py | 12 +- ...hedule_data_attributes_slack_user_group.py | 12 +- rootly_sdk/models/update_schedule_rotation.py | 5 +- .../update_schedule_rotation_active_day.py | 5 +- ...pdate_schedule_rotation_active_day_data.py | 5 +- ...ule_rotation_active_day_data_attributes.py | 44 +- ..._attributes_active_time_attributes_item.py | 12 +- .../models/update_schedule_rotation_data.py | 5 +- ...pdate_schedule_rotation_data_attributes.py | 157 +- ..._attributes_active_time_attributes_item.py | 2 - ...s_schedule_rotation_members_type_0_item.py | 8 +- ...schedule_rotationable_attributes_type_0.py | 2 - ...schedule_rotationable_attributes_type_1.py | 2 - ...schedule_rotationable_attributes_type_2.py | 2 - ...schedule_rotationable_attributes_type_3.py | 2 - .../models/update_schedule_rotation_user.py | 5 +- .../update_schedule_rotation_user_data.py | 5 +- ..._schedule_rotation_user_data_attributes.py | 12 +- rootly_sdk/models/update_secret.py | 5 +- rootly_sdk/models/update_secret_data.py | 5 +- .../models/update_secret_data_attributes.py | 38 +- rootly_sdk/models/update_service.py | 5 +- rootly_sdk/models/update_service_data.py | 5 +- .../models/update_service_data_attributes.py | 369 +- ...tributes_alert_broadcast_channel_type_0.py | 8 +- ...butes_incident_broadcast_channel_type_0.py | 8 +- ...service_data_attributes_properties_item.py | 2 - ...ta_attributes_slack_aliases_type_0_item.py | 2 - ...a_attributes_slack_channels_type_0_item.py | 2 - ...update_service_now_incident_task_params.py | 47 +- ...ice_now_incident_task_params_completion.py | 12 +- ...rvice_now_incident_task_params_priority.py | 12 +- rootly_sdk/models/update_severity.py | 5 +- rootly_sdk/models/update_severity_data.py | 5 +- .../models/update_severity_data_attributes.py | 105 +- ...ta_attributes_slack_aliases_type_0_item.py | 2 - ...a_attributes_slack_channels_type_0_item.py | 2 - .../update_sharepoint_page_task_params.py | 24 +- .../update_shortcut_story_task_params.py | 31 +- ..._shortcut_story_task_params_archivation.py | 12 +- .../update_shortcut_task_task_params.py | 19 +- ...te_shortcut_task_task_params_completion.py | 12 +- rootly_sdk/models/update_sla.py | 5 +- rootly_sdk/models/update_sla_data.py | 5 +- .../models/update_sla_data_attributes.py | 193 +- ...ate_sla_data_attributes_conditions_item.py | 42 +- ...ibutes_notification_configurations_item.py | 2 - .../update_slack_channel_topic_task_params.py | 15 +- ...slack_channel_topic_task_params_channel.py | 12 +- rootly_sdk/models/update_status_page.py | 5 +- .../models/update_status_page_announcement.py | 65 + .../update_status_page_announcement_data.py | 78 + ...tatus_page_announcement_data_attributes.py | 49 + ...date_status_page_announcement_data_type.py | 15 + .../models/update_status_page_component.py | 65 + .../update_status_page_component_data.py | 78 + ...e_status_page_component_data_attributes.py | 105 + .../update_status_page_component_data_type.py | 15 + .../update_status_page_component_group.py | 65 + ...update_status_page_component_group_data.py | 80 + ...us_page_component_group_data_attributes.py | 90 + ...e_status_page_component_group_data_type.py | 19 + rootly_sdk/models/update_status_page_data.py | 5 +- .../update_status_page_data_attributes.py | 302 +- .../models/update_status_page_template.py | 5 +- .../update_status_page_template_data.py | 5 +- ...te_status_page_template_data_attributes.py | 56 +- .../models/update_status_task_params.py | 16 +- rootly_sdk/models/update_sub_status.py | 5 +- rootly_sdk/models/update_sub_status_data.py | 5 +- .../update_sub_status_data_attributes.py | 50 +- rootly_sdk/models/update_team.py | 5 +- rootly_sdk/models/update_team_data.py | 5 +- .../models/update_team_data_attributes.py | 344 +- ...tributes_alert_broadcast_channel_type_0.py | 8 +- ...butes_incident_broadcast_channel_type_0.py | 8 +- ...te_team_data_attributes_properties_item.py | 2 - ...ta_attributes_slack_aliases_type_0_item.py | 2 - ...a_attributes_slack_channels_type_0_item.py | 2 - .../models/update_trello_card_task_params.py | 59 +- ...ate_trello_card_task_params_archivation.py | 12 +- .../update_trello_card_task_params_board.py | 12 +- ...ate_trello_card_task_params_labels_item.py | 12 +- .../update_trello_card_task_params_list.py | 12 +- rootly_sdk/models/update_user.py | 5 +- rootly_sdk/models/update_user_data.py | 5 +- .../models/update_user_data_attributes.py | 44 +- .../models/update_user_email_address.py | 5 +- .../models/update_user_email_address_data.py | 5 +- ...date_user_email_address_data_attributes.py | 8 +- .../models/update_user_notification_rule.py | 5 +- .../update_user_notification_rule_data.py | 5 +- ..._user_notification_rule_data_attributes.py | 88 +- ...a_attributes_enabled_contact_types_item.py | 3 +- rootly_sdk/models/update_user_phone_number.py | 5 +- .../models/update_user_phone_number_data.py | 5 +- ...pdate_user_phone_number_data_attributes.py | 8 +- .../update_victor_ops_incident_task_params.py | 16 +- rootly_sdk/models/update_webhooks_endpoint.py | 5 +- .../models/update_webhooks_endpoint_data.py | 5 +- ...pdate_webhooks_endpoint_data_attributes.py | 74 +- ...int_data_attributes_custom_headers_item.py | 2 - ...dpoint_data_attributes_event_types_item.py | 2 + rootly_sdk/models/update_workflow.py | 5 +- ...rkflow_action_item_form_field_condition.py | 5 +- ...w_action_item_form_field_condition_data.py | 5 +- ...em_form_field_condition_data_attributes.py | 77 +- .../update_workflow_custom_field_selection.py | 5 +- ...te_workflow_custom_field_selection_data.py | 5 +- ..._custom_field_selection_data_attributes.py | 26 +- rootly_sdk/models/update_workflow_data.py | 39 +- .../models/update_workflow_data_attributes.py | 226 +- .../update_workflow_form_field_condition.py | 5 +- ...date_workflow_form_field_condition_data.py | 5 +- ...ow_form_field_condition_data_attributes.py | 72 +- rootly_sdk/models/update_workflow_group.py | 5 +- .../models/update_workflow_group_data.py | 5 +- .../update_workflow_group_data_attributes.py | 60 +- rootly_sdk/models/update_workflow_task.py | 5 +- .../models/update_workflow_task_data.py | 5 +- .../update_workflow_task_data_attributes.py | 1501 +++++---- .../update_zendesk_ticket_task_params.py | 57 +- ...e_zendesk_ticket_task_params_completion.py | 12 +- ...ate_zendesk_ticket_task_params_priority.py | 12 +- rootly_sdk/models/uptime_chart_response.py | 5 +- .../models/uptime_chart_response_data.py | 3 - rootly_sdk/models/user.py | 54 +- rootly_sdk/models/user_email_address.py | 24 +- rootly_sdk/models/user_email_address_list.py | 29 +- .../user_email_address_list_data_item.py | 5 +- .../models/user_email_address_response.py | 23 +- .../user_email_address_response_data.py | 5 +- rootly_sdk/models/user_flat_response.py | 98 +- rootly_sdk/models/user_list.py | 29 +- rootly_sdk/models/user_list_data_item.py | 15 +- rootly_sdk/models/user_notification_rule.py | 106 +- ...ication_rule_enabled_contact_types_item.py | 3 +- .../models/user_notification_rule_list.py | 29 +- .../user_notification_rule_list_data_item.py | 5 +- .../models/user_notification_rule_response.py | 23 +- .../user_notification_rule_response_data.py | 5 +- rootly_sdk/models/user_phone_number.py | 40 +- rootly_sdk/models/user_phone_number_list.py | 29 +- .../user_phone_number_list_data_item.py | 5 +- .../models/user_phone_number_response.py | 23 +- .../models/user_phone_number_response_data.py | 5 +- rootly_sdk/models/user_relationships.py | 21 +- rootly_sdk/models/user_response.py | 23 +- rootly_sdk/models/user_response_data.py | 15 +- rootly_sdk/models/verified_domain.py | 199 ++ rootly_sdk/models/verified_domain_list.py | 116 + .../models/verified_domain_list_data_item.py | 86 + .../verified_domain_list_data_item_type.py | 15 + rootly_sdk/models/verified_domain_response.py | 88 + .../models/verified_domain_response_data.py | 86 + .../verified_domain_response_data_type.py | 15 + rootly_sdk/models/verified_domain_source.py | 17 + .../verified_domain_verification_status.py | 18 + .../models/verify_phone_number_request.py | 2 - rootly_sdk/models/webhooks_delivery.py | 40 +- rootly_sdk/models/webhooks_delivery_list.py | 41 +- .../webhooks_delivery_list_data_item.py | 5 +- .../models/webhooks_delivery_response.py | 23 +- .../models/webhooks_delivery_response_data.py | 5 +- rootly_sdk/models/webhooks_delivery_status.py | 17 + rootly_sdk/models/webhooks_endpoint.py | 27 +- .../webhooks_endpoint_custom_headers_item.py | 2 - .../webhooks_endpoint_event_types_item.py | 2 + rootly_sdk/models/webhooks_endpoint_list.py | 41 +- .../webhooks_endpoint_list_data_item.py | 5 +- .../models/webhooks_endpoint_response.py | 23 +- .../models/webhooks_endpoint_response_data.py | 5 +- rootly_sdk/models/workflow.py | 216 +- ...rkflow_action_item_form_field_condition.py | 46 +- ...w_action_item_form_field_condition_list.py | 29 +- ...tem_form_field_condition_list_data_item.py | 5 +- ...tion_item_form_field_condition_response.py | 23 +- ...item_form_field_condition_response_data.py | 5 +- .../models/workflow_custom_field_selection.py | 10 +- .../workflow_custom_field_selection_list.py | 29 +- ...w_custom_field_selection_list_data_item.py | 5 +- ...orkflow_custom_field_selection_response.py | 23 +- ...ow_custom_field_selection_response_data.py | 5 +- .../models/workflow_form_field_condition.py | 46 +- .../workflow_form_field_condition_list.py | 29 +- ...low_form_field_condition_list_data_item.py | 5 +- .../workflow_form_field_condition_response.py | 23 +- ...flow_form_field_condition_response_data.py | 5 +- rootly_sdk/models/workflow_group.py | 34 +- rootly_sdk/models/workflow_group_list.py | 29 +- .../models/workflow_group_list_data_item.py | 5 +- rootly_sdk/models/workflow_group_response.py | 23 +- .../models/workflow_group_response_data.py | 5 +- rootly_sdk/models/workflow_list.py | 29 +- rootly_sdk/models/workflow_list_data_item.py | 5 +- rootly_sdk/models/workflow_response.py | 23 +- rootly_sdk/models/workflow_response_data.py | 5 +- rootly_sdk/models/workflow_run.py | 113 +- rootly_sdk/models/workflow_run_context.py | 3 - rootly_sdk/models/workflow_run_response.py | 23 +- .../models/workflow_run_response_data.py | 5 +- rootly_sdk/models/workflow_runs_list.py | 29 +- .../models/workflow_runs_list_data_item.py | 5 +- rootly_sdk/models/workflow_task.py | 1483 +++++---- rootly_sdk/models/workflow_task_list.py | 29 +- .../models/workflow_task_list_data_item.py | 5 +- rootly_sdk/models/workflow_task_response.py | 23 +- .../models/workflow_task_response_data.py | 5 +- rootly_sdk/types.py | 18 +- 2729 files changed, 60687 insertions(+), 54646 deletions(-) create mode 100644 .github/release-drafter.yml create mode 100644 rootly_sdk/api/alert_retrigger_rules/__init__.py create mode 100644 rootly_sdk/api/alert_retrigger_rules/create_alert_retrigger_rule.py create mode 100644 rootly_sdk/api/alert_retrigger_rules/delete_alert_retrigger_rule.py create mode 100644 rootly_sdk/api/alert_retrigger_rules/get_alert_retrigger_rule.py create mode 100644 rootly_sdk/api/alert_retrigger_rules/list_alert_retrigger_rules.py create mode 100644 rootly_sdk/api/alert_retrigger_rules/update_alert_retrigger_rule.py create mode 100644 rootly_sdk/api/status_page_announcements/__init__.py create mode 100644 rootly_sdk/api/status_page_announcements/create_status_page_announcement.py create mode 100644 rootly_sdk/api/status_page_announcements/delete_status_page_announcement.py create mode 100644 rootly_sdk/api/status_page_announcements/get_status_page_announcement.py create mode 100644 rootly_sdk/api/status_page_announcements/list_status_page_announcements.py create mode 100644 rootly_sdk/api/status_page_announcements/update_status_page_announcement.py create mode 100644 rootly_sdk/api/status_page_component_groups/__init__.py create mode 100644 rootly_sdk/api/status_page_component_groups/create_status_page_component_group.py create mode 100644 rootly_sdk/api/status_page_component_groups/delete_status_page_component_group.py create mode 100644 rootly_sdk/api/status_page_component_groups/get_status_page_component_group.py create mode 100644 rootly_sdk/api/status_page_component_groups/list_status_page_component_groups.py create mode 100644 rootly_sdk/api/status_page_component_groups/update_status_page_component_group.py create mode 100644 rootly_sdk/api/status_page_components/__init__.py create mode 100644 rootly_sdk/api/status_page_components/create_status_page_component.py create mode 100644 rootly_sdk/api/status_page_components/delete_status_page_component.py create mode 100644 rootly_sdk/api/status_page_components/get_status_page_component.py create mode 100644 rootly_sdk/api/status_page_components/list_status_page_components.py create mode 100644 rootly_sdk/api/status_page_components/update_status_page_component.py create mode 100644 rootly_sdk/api/verified_domains/__init__.py create mode 100644 rootly_sdk/api/verified_domains/delete_v1_verified_domains_id.py create mode 100644 rootly_sdk/api/verified_domains/get_v1_verified_domains.py create mode 100644 rootly_sdk/api/verified_domains/get_v1_verified_domains_id.py create mode 100644 rootly_sdk/api/verified_domains/post_v1_verified_domains.py create mode 100644 rootly_sdk/models/alert_retrigger_rule.py create mode 100644 rootly_sdk/models/alert_retrigger_rule_conditions_item.py create mode 100644 rootly_sdk/models/alert_retrigger_rule_conditions_item_kind.py create mode 100644 rootly_sdk/models/alert_retrigger_rule_conditions_item_operator.py create mode 100644 rootly_sdk/models/alert_retrigger_rule_list.py create mode 100644 rootly_sdk/models/alert_retrigger_rule_list_data_item.py create mode 100644 rootly_sdk/models/alert_retrigger_rule_list_data_item_type.py create mode 100644 rootly_sdk/models/alert_retrigger_rule_match_mode.py create mode 100644 rootly_sdk/models/alert_retrigger_rule_response.py create mode 100644 rootly_sdk/models/alert_retrigger_rule_response_data.py create mode 100644 rootly_sdk/models/alert_retrigger_rule_response_data_type.py create mode 100644 rootly_sdk/models/attach_retrospective_pdf_to_freshservice_ticket_task_params.py create mode 100644 rootly_sdk/models/attach_retrospective_pdf_to_freshservice_ticket_task_params_task_type.py delete mode 100644 rootly_sdk/models/auto_assign_role_rootly_task_params.py delete mode 100644 rootly_sdk/models/auto_assign_role_rootly_task_params_task_type.py rename rootly_sdk/models/{auto_assign_role_rootly_task_params_escalation_policy_target.py => auto_assign_role_rootly_task_params_type_0_escalation_policy_target.py} (70%) rename rootly_sdk/models/{auto_assign_role_rootly_task_params_schedule_target.py => auto_assign_role_rootly_task_params_type_1_service_target.py} (71%) rename rootly_sdk/models/{auto_assign_role_rootly_task_params_service_target.py => auto_assign_role_rootly_task_params_type_2_user_target.py} (72%) rename rootly_sdk/models/{auto_assign_role_rootly_task_params_group_target.py => auto_assign_role_rootly_task_params_type_3_group_target.py} (72%) create mode 100644 rootly_sdk/models/auto_assign_role_rootly_task_params_type_4_schedule_target.py rename rootly_sdk/models/{auto_assign_role_rootly_task_params_user_target.py => create_clickup_task_task_params_list.py} (73%) create mode 100644 rootly_sdk/models/custom_field_resource_type.py create mode 100644 rootly_sdk/models/escalation_policy_level_paging_strategy_configuration_repeats_mode.py create mode 100644 rootly_sdk/models/escalation_policy_level_paging_strategy_configuration_rotation_scope.py create mode 100644 rootly_sdk/models/form_field_resource_type.py create mode 100644 rootly_sdk/models/incident_status_page_event_status_page_components_item.py create mode 100644 rootly_sdk/models/incident_status_page_event_status_page_components_item_status.py create mode 100644 rootly_sdk/models/new_alert_retrigger_rule.py create mode 100644 rootly_sdk/models/new_alert_retrigger_rule_data.py create mode 100644 rootly_sdk/models/new_alert_retrigger_rule_data_attributes.py create mode 100644 rootly_sdk/models/new_alert_retrigger_rule_data_attributes_conditions_item.py create mode 100644 rootly_sdk/models/new_alert_retrigger_rule_data_attributes_conditions_item_kind.py create mode 100644 rootly_sdk/models/new_alert_retrigger_rule_data_attributes_conditions_item_operator.py create mode 100644 rootly_sdk/models/new_alert_retrigger_rule_data_attributes_match_mode.py create mode 100644 rootly_sdk/models/new_alert_retrigger_rule_data_attributes_timeout_minutes.py create mode 100644 rootly_sdk/models/new_alert_retrigger_rule_data_type.py create mode 100644 rootly_sdk/models/new_escalation_policy_level_data_attributes_paging_strategy_configuration_repeats_mode.py create mode 100644 rootly_sdk/models/new_escalation_policy_level_data_attributes_paging_strategy_configuration_rotation_scope.py create mode 100644 rootly_sdk/models/new_incident_status_page_event_data_attributes_status_page_components_type_0_item.py create mode 100644 rootly_sdk/models/new_incident_status_page_event_data_attributes_status_page_components_type_0_item_status.py create mode 100644 rootly_sdk/models/new_status_page_announcement.py create mode 100644 rootly_sdk/models/new_status_page_announcement_data.py create mode 100644 rootly_sdk/models/new_status_page_announcement_data_attributes.py create mode 100644 rootly_sdk/models/new_status_page_announcement_data_type.py create mode 100644 rootly_sdk/models/new_status_page_component.py create mode 100644 rootly_sdk/models/new_status_page_component_data.py create mode 100644 rootly_sdk/models/new_status_page_component_data_attributes.py create mode 100644 rootly_sdk/models/new_status_page_component_data_attributes_source_type.py create mode 100644 rootly_sdk/models/new_status_page_component_data_type.py create mode 100644 rootly_sdk/models/new_status_page_component_group.py create mode 100644 rootly_sdk/models/new_status_page_component_group_data.py create mode 100644 rootly_sdk/models/new_status_page_component_group_data_attributes.py create mode 100644 rootly_sdk/models/new_status_page_component_group_data_type.py create mode 100644 rootly_sdk/models/new_verified_domain.py create mode 100644 rootly_sdk/models/new_verified_domain_data.py create mode 100644 rootly_sdk/models/new_verified_domain_data_attributes.py create mode 100644 rootly_sdk/models/new_verified_domain_data_type.py create mode 100644 rootly_sdk/models/status_page_announcement.py create mode 100644 rootly_sdk/models/status_page_announcement_list.py create mode 100644 rootly_sdk/models/status_page_announcement_list_data_item.py create mode 100644 rootly_sdk/models/status_page_announcement_list_data_item_type.py create mode 100644 rootly_sdk/models/status_page_announcement_response.py create mode 100644 rootly_sdk/models/status_page_announcement_response_data.py create mode 100644 rootly_sdk/models/status_page_announcement_response_data_type.py create mode 100644 rootly_sdk/models/status_page_component.py create mode 100644 rootly_sdk/models/status_page_component_group.py create mode 100644 rootly_sdk/models/status_page_component_group_list.py create mode 100644 rootly_sdk/models/status_page_component_group_list_data_item.py create mode 100644 rootly_sdk/models/status_page_component_group_list_data_item_type.py create mode 100644 rootly_sdk/models/status_page_component_group_response.py create mode 100644 rootly_sdk/models/status_page_component_group_response_data.py create mode 100644 rootly_sdk/models/status_page_component_group_response_data_type.py create mode 100644 rootly_sdk/models/status_page_component_list.py create mode 100644 rootly_sdk/models/status_page_component_list_data_item.py create mode 100644 rootly_sdk/models/status_page_component_list_data_item_type.py create mode 100644 rootly_sdk/models/status_page_component_response.py create mode 100644 rootly_sdk/models/status_page_component_response_data.py create mode 100644 rootly_sdk/models/status_page_component_response_data_type.py create mode 100644 rootly_sdk/models/status_page_component_status.py create mode 100644 rootly_sdk/models/update_alert_retrigger_rule.py create mode 100644 rootly_sdk/models/update_alert_retrigger_rule_data.py create mode 100644 rootly_sdk/models/update_alert_retrigger_rule_data_attributes.py create mode 100644 rootly_sdk/models/update_alert_retrigger_rule_data_attributes_conditions_item.py create mode 100644 rootly_sdk/models/update_alert_retrigger_rule_data_attributes_conditions_item_kind.py create mode 100644 rootly_sdk/models/update_alert_retrigger_rule_data_attributes_conditions_item_operator.py create mode 100644 rootly_sdk/models/update_alert_retrigger_rule_data_attributes_match_mode.py create mode 100644 rootly_sdk/models/update_alert_retrigger_rule_data_attributes_timeout_minutes.py create mode 100644 rootly_sdk/models/update_alert_retrigger_rule_data_type.py create mode 100644 rootly_sdk/models/update_escalation_policy_level_data_attributes_paging_strategy_configuration_repeats_mode.py create mode 100644 rootly_sdk/models/update_escalation_policy_level_data_attributes_paging_strategy_configuration_rotation_scope.py create mode 100644 rootly_sdk/models/update_status_page_announcement.py create mode 100644 rootly_sdk/models/update_status_page_announcement_data.py create mode 100644 rootly_sdk/models/update_status_page_announcement_data_attributes.py create mode 100644 rootly_sdk/models/update_status_page_announcement_data_type.py create mode 100644 rootly_sdk/models/update_status_page_component.py create mode 100644 rootly_sdk/models/update_status_page_component_data.py create mode 100644 rootly_sdk/models/update_status_page_component_data_attributes.py create mode 100644 rootly_sdk/models/update_status_page_component_data_type.py create mode 100644 rootly_sdk/models/update_status_page_component_group.py create mode 100644 rootly_sdk/models/update_status_page_component_group_data.py create mode 100644 rootly_sdk/models/update_status_page_component_group_data_attributes.py create mode 100644 rootly_sdk/models/update_status_page_component_group_data_type.py create mode 100644 rootly_sdk/models/verified_domain.py create mode 100644 rootly_sdk/models/verified_domain_list.py create mode 100644 rootly_sdk/models/verified_domain_list_data_item.py create mode 100644 rootly_sdk/models/verified_domain_list_data_item_type.py create mode 100644 rootly_sdk/models/verified_domain_response.py create mode 100644 rootly_sdk/models/verified_domain_response_data.py create mode 100644 rootly_sdk/models/verified_domain_response_data_type.py create mode 100644 rootly_sdk/models/verified_domain_source.py create mode 100644 rootly_sdk/models/verified_domain_verification_status.py create mode 100644 rootly_sdk/models/webhooks_delivery_status.py diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml new file mode 100644 index 00000000..40c14d1c --- /dev/null +++ b/.github/release-drafter.yml @@ -0,0 +1,55 @@ +# Configuration for Release Drafter: https://github.com/toolmantim/release-drafter +name-template: v$RESOLVED_VERSION +tag-template: v$RESOLVED_VERSION + +template: | + $CHANGES + + ## OpenAPI spec + + + +categories: + - title: 🚀 New features and improvements + labels: + - enhancement + - title: 🐛 Bug fixes + labels: + - bug + - title: 📝 Documentation updates + labels: + - documentation + - title: 👻 Maintenance + labels: + - chore + - maintenance + - title: 🚦 Tests + labels: + - test + - title: ✍ Other changes + - title: 📦 Dependency updates + labels: + - dependencies + collapse-after: 5 + - title: 🔐 Security + labels: + - "🔐 security" + - type: version-resolver + semver-increment: major + when: + label: major + - type: version-resolver + semver-increment: minor + when: + label: minor + - type: version-resolver + semver-increment: patch + +exclude-labels: + - skip-changelog + - invalid + +autolabeler: + - label: "documentation" + files: + - "*.md" diff --git a/CHANGELOG.md b/CHANGELOG.md index cc25935d..c5719583 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,22 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [2.0.0] - 2026-08-14 + +### Added +- Alert retrigger rule endpoints and models +- Status page announcement, component, and component group endpoints and models +- Verified domain endpoints and models +- Freshservice retrospective PDF workflow task support + +### Changed +- Regenerated the client from the latest OpenAPI specification +- **BREAKING**: Replaced `AutoAssignRoleRootlyTaskParams` with target-specific variants for escalation policies, + services, users, groups, and schedules + +### Fixed +- Applied the nullable enum fix to generated model files + ## [1.4.0] - 2026-07-20 ### Added @@ -176,4 +192,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Previous Releases -Changes before this version were not systematically tracked in a changelog. \ No newline at end of file +Changes before this version were not systematically tracked in a changelog. diff --git a/pyproject.toml b/pyproject.toml index 0c87f93c..31d1083c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "rootly" -version = "1.4.0" +version = "2.0.0" description = "A client library for accessing Rootly API v1" authors = [] readme = "README.md" diff --git a/rootly_sdk/api/ai_chat/create_ai_chat.py b/rootly_sdk/api/ai_chat/create_ai_chat.py index a1b78093..3c39d143 100644 --- a/rootly_sdk/api/ai_chat/create_ai_chat.py +++ b/rootly_sdk/api/ai_chat/create_ai_chat.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, cast +from typing import Any, Optional, Union, cast from uuid import UUID import httpx @@ -13,26 +13,25 @@ def _get_kwargs( *, message: str, - session_id: UUID | Unset = UNSET, - incident_id: UUID | Unset = UNSET, - alert_id: UUID | Unset = UNSET, + session_id: Union[Unset, UUID] = UNSET, + incident_id: Union[Unset, UUID] = UNSET, + alert_id: Union[Unset, UUID] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["message"] = message - json_session_id: str | Unset = UNSET + json_session_id: Union[Unset, str] = UNSET if not isinstance(session_id, Unset): json_session_id = str(session_id) params["session_id"] = json_session_id - json_incident_id: str | Unset = UNSET + json_incident_id: Union[Unset, str] = UNSET if not isinstance(incident_id, Unset): json_incident_id = str(incident_id) params["incident_id"] = json_incident_id - json_alert_id: str | Unset = UNSET + json_alert_id: Union[Unset, str] = UNSET if not isinstance(alert_id, Unset): json_alert_id = str(alert_id) params["alert_id"] = json_alert_id @@ -48,7 +47,9 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> AiChatResponse | Any | None: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[AiChatResponse, Any]]: if response.status_code == 200: response_200 = AiChatResponse.from_dict(response.json()) @@ -69,8 +70,8 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AiChatResponse | Any]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[AiChatResponse, Any]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -83,10 +84,10 @@ def sync_detailed( *, client: AuthenticatedClient, message: str, - session_id: UUID | Unset = UNSET, - incident_id: UUID | Unset = UNSET, - alert_id: UUID | Unset = UNSET, -) -> Response[AiChatResponse | Any]: + session_id: Union[Unset, UUID] = UNSET, + incident_id: Union[Unset, UUID] = UNSET, + alert_id: Union[Unset, UUID] = UNSET, +) -> Response[Union[AiChatResponse, Any]]: """Send AI chat message Send a message to the AI assistant and receive a synchronous reply. Optionally bind the conversation @@ -95,16 +96,16 @@ def sync_detailed( Args: message (str): - session_id (UUID | Unset): - incident_id (UUID | Unset): - alert_id (UUID | Unset): + session_id (Union[Unset, UUID]): + incident_id (Union[Unset, UUID]): + alert_id (Union[Unset, UUID]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AiChatResponse | Any] + Response[Union[AiChatResponse, Any]] """ kwargs = _get_kwargs( @@ -125,10 +126,10 @@ def sync( *, client: AuthenticatedClient, message: str, - session_id: UUID | Unset = UNSET, - incident_id: UUID | Unset = UNSET, - alert_id: UUID | Unset = UNSET, -) -> AiChatResponse | Any | None: + session_id: Union[Unset, UUID] = UNSET, + incident_id: Union[Unset, UUID] = UNSET, + alert_id: Union[Unset, UUID] = UNSET, +) -> Optional[Union[AiChatResponse, Any]]: """Send AI chat message Send a message to the AI assistant and receive a synchronous reply. Optionally bind the conversation @@ -137,16 +138,16 @@ def sync( Args: message (str): - session_id (UUID | Unset): - incident_id (UUID | Unset): - alert_id (UUID | Unset): + session_id (Union[Unset, UUID]): + incident_id (Union[Unset, UUID]): + alert_id (Union[Unset, UUID]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AiChatResponse | Any + Union[AiChatResponse, Any] """ return sync_detailed( @@ -162,10 +163,10 @@ async def asyncio_detailed( *, client: AuthenticatedClient, message: str, - session_id: UUID | Unset = UNSET, - incident_id: UUID | Unset = UNSET, - alert_id: UUID | Unset = UNSET, -) -> Response[AiChatResponse | Any]: + session_id: Union[Unset, UUID] = UNSET, + incident_id: Union[Unset, UUID] = UNSET, + alert_id: Union[Unset, UUID] = UNSET, +) -> Response[Union[AiChatResponse, Any]]: """Send AI chat message Send a message to the AI assistant and receive a synchronous reply. Optionally bind the conversation @@ -174,16 +175,16 @@ async def asyncio_detailed( Args: message (str): - session_id (UUID | Unset): - incident_id (UUID | Unset): - alert_id (UUID | Unset): + session_id (Union[Unset, UUID]): + incident_id (Union[Unset, UUID]): + alert_id (Union[Unset, UUID]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AiChatResponse | Any] + Response[Union[AiChatResponse, Any]] """ kwargs = _get_kwargs( @@ -202,10 +203,10 @@ async def asyncio( *, client: AuthenticatedClient, message: str, - session_id: UUID | Unset = UNSET, - incident_id: UUID | Unset = UNSET, - alert_id: UUID | Unset = UNSET, -) -> AiChatResponse | Any | None: + session_id: Union[Unset, UUID] = UNSET, + incident_id: Union[Unset, UUID] = UNSET, + alert_id: Union[Unset, UUID] = UNSET, +) -> Optional[Union[AiChatResponse, Any]]: """Send AI chat message Send a message to the AI assistant and receive a synchronous reply. Optionally bind the conversation @@ -214,16 +215,16 @@ async def asyncio( Args: message (str): - session_id (UUID | Unset): - incident_id (UUID | Unset): - alert_id (UUID | Unset): + session_id (Union[Unset, UUID]): + incident_id (Union[Unset, UUID]): + alert_id (Union[Unset, UUID]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AiChatResponse | Any + Union[AiChatResponse, Any] """ return ( diff --git a/rootly_sdk/api/ai_chat/delete_ai_chat_session.py b/rootly_sdk/api/ai_chat/delete_ai_chat_session.py index 810d9b1e..b99efc94 100644 --- a/rootly_sdk/api/ai_chat/delete_ai_chat_session.py +++ b/rootly_sdk/api/ai_chat/delete_ai_chat_session.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union from uuid import UUID import httpx @@ -13,18 +12,15 @@ def _get_kwargs( id: UUID, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/ai/chat/sessions/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/ai/chat/sessions/{id}", } return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Any | None: +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: if response.status_code == 204: return None @@ -37,7 +33,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Any]: +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, diff --git a/rootly_sdk/api/ai_chat/list_ai_chat_session_messages.py b/rootly_sdk/api/ai_chat/list_ai_chat_session_messages.py index 8f13b2d4..3f8081ec 100644 --- a/rootly_sdk/api/ai_chat/list_ai_chat_session_messages.py +++ b/rootly_sdk/api/ai_chat/list_ai_chat_session_messages.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any, cast -from urllib.parse import quote +from typing import Any, Optional, Union, cast from uuid import UUID import httpx @@ -14,10 +13,9 @@ def _get_kwargs( session_id: UUID, *, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["page[number]"] = pagenumber @@ -28,9 +26,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/ai/chat/sessions/{session_id}/messages".format( - session_id=quote(str(session_id), safe=""), - ), + "url": f"/v1/ai/chat/sessions/{session_id}/messages", "params": params, } @@ -38,8 +34,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AiChatSessionMessageList | Any | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[AiChatSessionMessageList, Any]]: if response.status_code == 200: response_200 = AiChatSessionMessageList.from_dict(response.json()) @@ -56,8 +52,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AiChatSessionMessageList | Any]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[AiChatSessionMessageList, Any]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -70,9 +66,9 @@ def sync_detailed( session_id: UUID, *, client: AuthenticatedClient, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, -) -> Response[AiChatSessionMessageList | Any]: + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, +) -> Response[Union[AiChatSessionMessageList, Any]]: """List AI chat session messages Returns the user and assistant message history for a session, paginated and chronologically ordered. @@ -80,15 +76,15 @@ def sync_detailed( Args: session_id (UUID): - pagenumber (int | Unset): - pagesize (int | Unset): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AiChatSessionMessageList | Any] + Response[Union[AiChatSessionMessageList, Any]] """ kwargs = _get_kwargs( @@ -108,9 +104,9 @@ def sync( session_id: UUID, *, client: AuthenticatedClient, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, -) -> AiChatSessionMessageList | Any | None: + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, +) -> Optional[Union[AiChatSessionMessageList, Any]]: """List AI chat session messages Returns the user and assistant message history for a session, paginated and chronologically ordered. @@ -118,15 +114,15 @@ def sync( Args: session_id (UUID): - pagenumber (int | Unset): - pagesize (int | Unset): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AiChatSessionMessageList | Any + Union[AiChatSessionMessageList, Any] """ return sync_detailed( @@ -141,9 +137,9 @@ async def asyncio_detailed( session_id: UUID, *, client: AuthenticatedClient, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, -) -> Response[AiChatSessionMessageList | Any]: + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, +) -> Response[Union[AiChatSessionMessageList, Any]]: """List AI chat session messages Returns the user and assistant message history for a session, paginated and chronologically ordered. @@ -151,15 +147,15 @@ async def asyncio_detailed( Args: session_id (UUID): - pagenumber (int | Unset): - pagesize (int | Unset): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AiChatSessionMessageList | Any] + Response[Union[AiChatSessionMessageList, Any]] """ kwargs = _get_kwargs( @@ -177,9 +173,9 @@ async def asyncio( session_id: UUID, *, client: AuthenticatedClient, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, -) -> AiChatSessionMessageList | Any | None: + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, +) -> Optional[Union[AiChatSessionMessageList, Any]]: """List AI chat session messages Returns the user and assistant message history for a session, paginated and chronologically ordered. @@ -187,15 +183,15 @@ async def asyncio( Args: session_id (UUID): - pagenumber (int | Unset): - pagesize (int | Unset): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AiChatSessionMessageList | Any + Union[AiChatSessionMessageList, Any] """ return ( diff --git a/rootly_sdk/api/ai_chat/stream_ai_chat.py b/rootly_sdk/api/ai_chat/stream_ai_chat.py index db3d600b..7c8371d8 100644 --- a/rootly_sdk/api/ai_chat/stream_ai_chat.py +++ b/rootly_sdk/api/ai_chat/stream_ai_chat.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union from uuid import UUID import httpx @@ -12,26 +12,25 @@ def _get_kwargs( *, message: str, - session_id: UUID | Unset = UNSET, - incident_id: UUID | Unset = UNSET, - alert_id: UUID | Unset = UNSET, + session_id: Union[Unset, UUID] = UNSET, + incident_id: Union[Unset, UUID] = UNSET, + alert_id: Union[Unset, UUID] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["message"] = message - json_session_id: str | Unset = UNSET + json_session_id: Union[Unset, str] = UNSET if not isinstance(session_id, Unset): json_session_id = str(session_id) params["session_id"] = json_session_id - json_incident_id: str | Unset = UNSET + json_incident_id: Union[Unset, str] = UNSET if not isinstance(incident_id, Unset): json_incident_id = str(incident_id) params["incident_id"] = json_incident_id - json_alert_id: str | Unset = UNSET + json_alert_id: Union[Unset, str] = UNSET if not isinstance(alert_id, Unset): json_alert_id = str(alert_id) params["alert_id"] = json_alert_id @@ -47,7 +46,7 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Any | None: +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: if response.status_code == 200: return None @@ -60,7 +59,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Any]: +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -73,9 +72,9 @@ def sync_detailed( *, client: AuthenticatedClient, message: str, - session_id: UUID | Unset = UNSET, - incident_id: UUID | Unset = UNSET, - alert_id: UUID | Unset = UNSET, + session_id: Union[Unset, UUID] = UNSET, + incident_id: Union[Unset, UUID] = UNSET, + alert_id: Union[Unset, UUID] = UNSET, ) -> Response[Any]: """Stream AI chat response (SSE) @@ -86,9 +85,9 @@ def sync_detailed( Args: message (str): - session_id (UUID | Unset): - incident_id (UUID | Unset): - alert_id (UUID | Unset): + session_id (Union[Unset, UUID]): + incident_id (Union[Unset, UUID]): + alert_id (Union[Unset, UUID]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -116,9 +115,9 @@ async def asyncio_detailed( *, client: AuthenticatedClient, message: str, - session_id: UUID | Unset = UNSET, - incident_id: UUID | Unset = UNSET, - alert_id: UUID | Unset = UNSET, + session_id: Union[Unset, UUID] = UNSET, + incident_id: Union[Unset, UUID] = UNSET, + alert_id: Union[Unset, UUID] = UNSET, ) -> Response[Any]: """Stream AI chat response (SSE) @@ -129,9 +128,9 @@ async def asyncio_detailed( Args: message (str): - session_id (UUID | Unset): - incident_id (UUID | Unset): - alert_id (UUID | Unset): + session_id (Union[Unset, UUID]): + incident_id (Union[Unset, UUID]): + alert_id (Union[Unset, UUID]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/alert_events/create_alert_event.py b/rootly_sdk/api/alert_events/create_alert_event.py index 1ba1d753..0f0a5955 100644 --- a/rootly_sdk/api/alert_events/create_alert_event.py +++ b/rootly_sdk/api/alert_events/create_alert_event.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -9,25 +8,22 @@ from ...models.alert_event_response import AlertEventResponse from ...models.errors_list import ErrorsList from ...models.new_alert_event import NewAlertEvent -from ...types import UNSET, Response, Unset +from ...types import Response def _get_kwargs( alert_id: str, *, - body: NewAlertEvent | Unset = UNSET, + body: NewAlertEvent, ) -> dict[str, Any]: headers: dict[str, Any] = {} _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/alerts/{alert_id}/events".format( - alert_id=quote(str(alert_id), safe=""), - ), + "url": f"/v1/alerts/{alert_id}/events", } - if not isinstance(body, Unset): - _kwargs["json"] = body.to_dict() + _kwargs["json"] = body.to_dict() headers["Content-Type"] = "application/vnd.api+json" @@ -36,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AlertEventResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[AlertEventResponse, ErrorsList]]: if response.status_code == 201: response_201 = AlertEventResponse.from_dict(response.json()) @@ -55,8 +51,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AlertEventResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[AlertEventResponse, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,22 +65,22 @@ def sync_detailed( alert_id: str, *, client: AuthenticatedClient, - body: NewAlertEvent | Unset = UNSET, -) -> Response[AlertEventResponse | ErrorsList]: + body: NewAlertEvent, +) -> Response[Union[AlertEventResponse, ErrorsList]]: """Create alert event Creates a new alert event Args: alert_id (str): - body (NewAlertEvent | Unset): + body (NewAlertEvent): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertEventResponse | ErrorsList] + Response[Union[AlertEventResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -103,22 +99,22 @@ def sync( alert_id: str, *, client: AuthenticatedClient, - body: NewAlertEvent | Unset = UNSET, -) -> AlertEventResponse | ErrorsList | None: + body: NewAlertEvent, +) -> Optional[Union[AlertEventResponse, ErrorsList]]: """Create alert event Creates a new alert event Args: alert_id (str): - body (NewAlertEvent | Unset): + body (NewAlertEvent): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertEventResponse | ErrorsList + Union[AlertEventResponse, ErrorsList] """ return sync_detailed( @@ -132,22 +128,22 @@ async def asyncio_detailed( alert_id: str, *, client: AuthenticatedClient, - body: NewAlertEvent | Unset = UNSET, -) -> Response[AlertEventResponse | ErrorsList]: + body: NewAlertEvent, +) -> Response[Union[AlertEventResponse, ErrorsList]]: """Create alert event Creates a new alert event Args: alert_id (str): - body (NewAlertEvent | Unset): + body (NewAlertEvent): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertEventResponse | ErrorsList] + Response[Union[AlertEventResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -164,22 +160,22 @@ async def asyncio( alert_id: str, *, client: AuthenticatedClient, - body: NewAlertEvent | Unset = UNSET, -) -> AlertEventResponse | ErrorsList | None: + body: NewAlertEvent, +) -> Optional[Union[AlertEventResponse, ErrorsList]]: """Create alert event Creates a new alert event Args: alert_id (str): - body (NewAlertEvent | Unset): + body (NewAlertEvent): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertEventResponse | ErrorsList + Union[AlertEventResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/alert_events/delete_alert_event.py b/rootly_sdk/api/alert_events/delete_alert_event.py index fa37ebdf..1dbeba70 100644 --- a/rootly_sdk/api/alert_events/delete_alert_event.py +++ b/rootly_sdk/api/alert_events/delete_alert_event.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any, cast -from urllib.parse import quote +from typing import Any, Optional, Union, cast import httpx @@ -13,18 +12,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/alert_events/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/alert_events/{id}", } return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Any | ErrorsList | None: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorsList]]: if response.status_code == 200: response_200 = cast(Any, None) return response_200 @@ -40,7 +38,9 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Any | ErrorsList]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -53,7 +53,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Any | ErrorsList]: +) -> Response[Union[Any, ErrorsList]]: """Delete alert event Deletes a specific alert event. Only alert events with kind 'note' (user-created notes) can be @@ -67,7 +67,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | ErrorsList] + Response[Union[Any, ErrorsList]] """ kwargs = _get_kwargs( @@ -85,7 +85,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Any | ErrorsList | None: +) -> Optional[Union[Any, ErrorsList]]: """Delete alert event Deletes a specific alert event. Only alert events with kind 'note' (user-created notes) can be @@ -99,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | ErrorsList + Union[Any, ErrorsList] """ return sync_detailed( @@ -112,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Any | ErrorsList]: +) -> Response[Union[Any, ErrorsList]]: """Delete alert event Deletes a specific alert event. Only alert events with kind 'note' (user-created notes) can be @@ -126,7 +126,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | ErrorsList] + Response[Union[Any, ErrorsList]] """ kwargs = _get_kwargs( @@ -142,7 +142,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Any | ErrorsList | None: +) -> Optional[Union[Any, ErrorsList]]: """Delete alert event Deletes a specific alert event. Only alert events with kind 'note' (user-created notes) can be @@ -156,7 +156,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | ErrorsList + Union[Any, ErrorsList] """ return ( diff --git a/rootly_sdk/api/alert_events/get_alert_event.py b/rootly_sdk/api/alert_events/get_alert_event.py index 0c7b7f99..a9544bfd 100644 --- a/rootly_sdk/api/alert_events/get_alert_event.py +++ b/rootly_sdk/api/alert_events/get_alert_event.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/alert_events/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/alert_events/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AlertEventResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[AlertEventResponse, ErrorsList]]: if response.status_code == 200: response_200 = AlertEventResponse.from_dict(response.json()) @@ -45,8 +41,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AlertEventResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[AlertEventResponse, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[AlertEventResponse | ErrorsList]: +) -> Response[Union[AlertEventResponse, ErrorsList]]: """Retrieve alert event Retrieves a specific alert_event by id @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertEventResponse | ErrorsList] + Response[Union[AlertEventResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -90,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> AlertEventResponse | ErrorsList | None: +) -> Optional[Union[AlertEventResponse, ErrorsList]]: """Retrieve alert event Retrieves a specific alert_event by id @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertEventResponse | ErrorsList + Union[AlertEventResponse, ErrorsList] """ return sync_detailed( @@ -116,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[AlertEventResponse | ErrorsList]: +) -> Response[Union[AlertEventResponse, ErrorsList]]: """Retrieve alert event Retrieves a specific alert_event by id @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertEventResponse | ErrorsList] + Response[Union[AlertEventResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -145,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> AlertEventResponse | ErrorsList | None: +) -> Optional[Union[AlertEventResponse, ErrorsList]]: """Retrieve alert event Retrieves a specific alert_event by id @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertEventResponse | ErrorsList + Union[AlertEventResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/alert_events/list_alert_events.py b/rootly_sdk/api/alert_events/list_alert_events.py index cdbb09b0..51b26ed6 100644 --- a/rootly_sdk/api/alert_events/list_alert_events.py +++ b/rootly_sdk/api/alert_events/list_alert_events.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -13,13 +12,12 @@ def _get_kwargs( alert_id: str, *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterkind: str | Unset = UNSET, - filteraction: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterkind: Union[Unset, str] = UNSET, + filteraction: Union[Unset, str] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -36,16 +34,16 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/alerts/{alert_id}/events".format( - alert_id=quote(str(alert_id), safe=""), - ), + "url": f"/v1/alerts/{alert_id}/events", "params": params, } return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> AlertEventList | None: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[AlertEventList]: if response.status_code == 200: response_200 = AlertEventList.from_dict(response.json()) @@ -57,7 +55,9 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[AlertEventList]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[AlertEventList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -70,11 +70,11 @@ def sync_detailed( alert_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterkind: str | Unset = UNSET, - filteraction: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterkind: Union[Unset, str] = UNSET, + filteraction: Union[Unset, str] = UNSET, ) -> Response[AlertEventList]: """List alert events @@ -82,11 +82,11 @@ def sync_detailed( Args: alert_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterkind (str | Unset): - filteraction (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterkind (Union[Unset, str]): + filteraction (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -116,23 +116,23 @@ def sync( alert_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterkind: str | Unset = UNSET, - filteraction: str | Unset = UNSET, -) -> AlertEventList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterkind: Union[Unset, str] = UNSET, + filteraction: Union[Unset, str] = UNSET, +) -> Optional[AlertEventList]: """List alert events List alert_events Args: alert_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterkind (str | Unset): - filteraction (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterkind (Union[Unset, str]): + filteraction (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -157,11 +157,11 @@ async def asyncio_detailed( alert_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterkind: str | Unset = UNSET, - filteraction: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterkind: Union[Unset, str] = UNSET, + filteraction: Union[Unset, str] = UNSET, ) -> Response[AlertEventList]: """List alert events @@ -169,11 +169,11 @@ async def asyncio_detailed( Args: alert_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterkind (str | Unset): - filteraction (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterkind (Union[Unset, str]): + filteraction (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -201,23 +201,23 @@ async def asyncio( alert_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterkind: str | Unset = UNSET, - filteraction: str | Unset = UNSET, -) -> AlertEventList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterkind: Union[Unset, str] = UNSET, + filteraction: Union[Unset, str] = UNSET, +) -> Optional[AlertEventList]: """List alert events List alert_events Args: alert_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterkind (str | Unset): - filteraction (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterkind (Union[Unset, str]): + filteraction (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/alert_events/list_alert_events_feed.py b/rootly_sdk/api/alert_events/list_alert_events_feed.py index b9a7a95a..cd82cfb5 100644 --- a/rootly_sdk/api/alert_events/list_alert_events_feed.py +++ b/rootly_sdk/api/alert_events/list_alert_events_feed.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -18,19 +18,18 @@ def _get_kwargs( *, - include: str | Unset = UNSET, - pagesize: int | Unset = UNSET, - pageafter: str | Unset = UNSET, - sort: ListAlertEventsFeedSort | Unset = UNSET, - filterkind: ListAlertEventsFeedFilterkind | Unset = UNSET, - filteraction: ListAlertEventsFeedFilteraction | Unset = UNSET, - filteralert_id: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagesize: Union[Unset, int] = UNSET, + pageafter: Union[Unset, str] = UNSET, + sort: Union[Unset, ListAlertEventsFeedSort] = UNSET, + filterkind: Union[Unset, ListAlertEventsFeedFilterkind] = UNSET, + filteraction: Union[Unset, ListAlertEventsFeedFilteraction] = UNSET, + filteralert_id: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -39,19 +38,19 @@ def _get_kwargs( params["page[after]"] = pageafter - json_sort: str | Unset = UNSET + json_sort: Union[Unset, str] = UNSET if not isinstance(sort, Unset): json_sort = sort params["sort"] = json_sort - json_filterkind: str | Unset = UNSET + json_filterkind: Union[Unset, str] = UNSET if not isinstance(filterkind, Unset): json_filterkind = filterkind params["filter[kind]"] = json_filterkind - json_filteraction: str | Unset = UNSET + json_filteraction: Union[Unset, str] = UNSET if not isinstance(filteraction, Unset): json_filteraction = filteraction @@ -78,7 +77,9 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> AlertEventFeedList | None: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[AlertEventFeedList]: if response.status_code == 200: response_200 = AlertEventFeedList.from_dict(response.json()) @@ -90,7 +91,9 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[AlertEventFeedList]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[AlertEventFeedList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -102,17 +105,17 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagesize: int | Unset = UNSET, - pageafter: str | Unset = UNSET, - sort: ListAlertEventsFeedSort | Unset = UNSET, - filterkind: ListAlertEventsFeedFilterkind | Unset = UNSET, - filteraction: ListAlertEventsFeedFilteraction | Unset = UNSET, - filteralert_id: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagesize: Union[Unset, int] = UNSET, + pageafter: Union[Unset, str] = UNSET, + sort: Union[Unset, ListAlertEventsFeedSort] = UNSET, + filterkind: Union[Unset, ListAlertEventsFeedFilterkind] = UNSET, + filteraction: Union[Unset, ListAlertEventsFeedFilteraction] = UNSET, + filteralert_id: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, ) -> Response[AlertEventFeedList]: """List alert events across alerts @@ -121,17 +124,17 @@ def sync_detailed( stream forward. Args: - include (str | Unset): - pagesize (int | Unset): - pageafter (str | Unset): - sort (ListAlertEventsFeedSort | Unset): - filterkind (ListAlertEventsFeedFilterkind | Unset): - filteraction (ListAlertEventsFeedFilteraction | Unset): - filteralert_id (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, str]): + pagesize (Union[Unset, int]): + pageafter (Union[Unset, str]): + sort (Union[Unset, ListAlertEventsFeedSort]): + filterkind (Union[Unset, ListAlertEventsFeedFilterkind]): + filteraction (Union[Unset, ListAlertEventsFeedFilteraction]): + filteralert_id (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -165,18 +168,18 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagesize: int | Unset = UNSET, - pageafter: str | Unset = UNSET, - sort: ListAlertEventsFeedSort | Unset = UNSET, - filterkind: ListAlertEventsFeedFilterkind | Unset = UNSET, - filteraction: ListAlertEventsFeedFilteraction | Unset = UNSET, - filteralert_id: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, -) -> AlertEventFeedList | None: + include: Union[Unset, str] = UNSET, + pagesize: Union[Unset, int] = UNSET, + pageafter: Union[Unset, str] = UNSET, + sort: Union[Unset, ListAlertEventsFeedSort] = UNSET, + filterkind: Union[Unset, ListAlertEventsFeedFilterkind] = UNSET, + filteraction: Union[Unset, ListAlertEventsFeedFilteraction] = UNSET, + filteralert_id: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, +) -> Optional[AlertEventFeedList]: """List alert events across alerts Returns a flat list of alert events across all alerts the requester can access. Designed for @@ -184,17 +187,17 @@ def sync( stream forward. Args: - include (str | Unset): - pagesize (int | Unset): - pageafter (str | Unset): - sort (ListAlertEventsFeedSort | Unset): - filterkind (ListAlertEventsFeedFilterkind | Unset): - filteraction (ListAlertEventsFeedFilteraction | Unset): - filteralert_id (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, str]): + pagesize (Union[Unset, int]): + pageafter (Union[Unset, str]): + sort (Union[Unset, ListAlertEventsFeedSort]): + filterkind (Union[Unset, ListAlertEventsFeedFilterkind]): + filteraction (Union[Unset, ListAlertEventsFeedFilteraction]): + filteralert_id (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -223,17 +226,17 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagesize: int | Unset = UNSET, - pageafter: str | Unset = UNSET, - sort: ListAlertEventsFeedSort | Unset = UNSET, - filterkind: ListAlertEventsFeedFilterkind | Unset = UNSET, - filteraction: ListAlertEventsFeedFilteraction | Unset = UNSET, - filteralert_id: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagesize: Union[Unset, int] = UNSET, + pageafter: Union[Unset, str] = UNSET, + sort: Union[Unset, ListAlertEventsFeedSort] = UNSET, + filterkind: Union[Unset, ListAlertEventsFeedFilterkind] = UNSET, + filteraction: Union[Unset, ListAlertEventsFeedFilteraction] = UNSET, + filteralert_id: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, ) -> Response[AlertEventFeedList]: """List alert events across alerts @@ -242,17 +245,17 @@ async def asyncio_detailed( stream forward. Args: - include (str | Unset): - pagesize (int | Unset): - pageafter (str | Unset): - sort (ListAlertEventsFeedSort | Unset): - filterkind (ListAlertEventsFeedFilterkind | Unset): - filteraction (ListAlertEventsFeedFilteraction | Unset): - filteralert_id (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, str]): + pagesize (Union[Unset, int]): + pageafter (Union[Unset, str]): + sort (Union[Unset, ListAlertEventsFeedSort]): + filterkind (Union[Unset, ListAlertEventsFeedFilterkind]): + filteraction (Union[Unset, ListAlertEventsFeedFilteraction]): + filteralert_id (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -284,18 +287,18 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagesize: int | Unset = UNSET, - pageafter: str | Unset = UNSET, - sort: ListAlertEventsFeedSort | Unset = UNSET, - filterkind: ListAlertEventsFeedFilterkind | Unset = UNSET, - filteraction: ListAlertEventsFeedFilteraction | Unset = UNSET, - filteralert_id: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, -) -> AlertEventFeedList | None: + include: Union[Unset, str] = UNSET, + pagesize: Union[Unset, int] = UNSET, + pageafter: Union[Unset, str] = UNSET, + sort: Union[Unset, ListAlertEventsFeedSort] = UNSET, + filterkind: Union[Unset, ListAlertEventsFeedFilterkind] = UNSET, + filteraction: Union[Unset, ListAlertEventsFeedFilteraction] = UNSET, + filteralert_id: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, +) -> Optional[AlertEventFeedList]: """List alert events across alerts Returns a flat list of alert events across all alerts the requester can access. Designed for @@ -303,17 +306,17 @@ async def asyncio( stream forward. Args: - include (str | Unset): - pagesize (int | Unset): - pageafter (str | Unset): - sort (ListAlertEventsFeedSort | Unset): - filterkind (ListAlertEventsFeedFilterkind | Unset): - filteraction (ListAlertEventsFeedFilteraction | Unset): - filteralert_id (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, str]): + pagesize (Union[Unset, int]): + pageafter (Union[Unset, str]): + sort (Union[Unset, ListAlertEventsFeedSort]): + filterkind (Union[Unset, ListAlertEventsFeedFilterkind]): + filteraction (Union[Unset, ListAlertEventsFeedFilteraction]): + filteralert_id (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/alert_events/update_alert_event.py b/rootly_sdk/api/alert_events/update_alert_event.py index ef172e7d..ad592d52 100644 --- a/rootly_sdk/api/alert_events/update_alert_event.py +++ b/rootly_sdk/api/alert_events/update_alert_event.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -9,25 +8,22 @@ from ...models.alert_event_response import AlertEventResponse from ...models.errors_list import ErrorsList from ...models.update_alert_event import UpdateAlertEvent -from ...types import UNSET, Response, Unset +from ...types import Response def _get_kwargs( id: str, *, - body: UpdateAlertEvent | Unset = UNSET, + body: UpdateAlertEvent, ) -> dict[str, Any]: headers: dict[str, Any] = {} _kwargs: dict[str, Any] = { "method": "patch", - "url": "/v1/alert_events/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/alert_events/{id}", } - if not isinstance(body, Unset): - _kwargs["json"] = body.to_dict() + _kwargs["json"] = body.to_dict() headers["Content-Type"] = "application/vnd.api+json" @@ -36,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AlertEventResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[AlertEventResponse, ErrorsList]]: if response.status_code == 200: response_200 = AlertEventResponse.from_dict(response.json()) @@ -55,8 +51,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AlertEventResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[AlertEventResponse, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,8 +65,8 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, - body: UpdateAlertEvent | Unset = UNSET, -) -> Response[AlertEventResponse | ErrorsList]: + body: UpdateAlertEvent, +) -> Response[Union[AlertEventResponse, ErrorsList]]: """Update alert event Updates a specific alert event. Only alert events with kind 'note' (user-created notes) can be @@ -78,15 +74,15 @@ def sync_detailed( Args: id (str): - body (UpdateAlertEvent | Unset): Update an alert event. Note: Only alert events with - kind='note' can be updated. You cannot change the kind field. + body (UpdateAlertEvent): Update an alert event. Note: Only alert events with kind='note' + can be updated. You cannot change the kind field. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertEventResponse | ErrorsList] + Response[Union[AlertEventResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -105,8 +101,8 @@ def sync( id: str, *, client: AuthenticatedClient, - body: UpdateAlertEvent | Unset = UNSET, -) -> AlertEventResponse | ErrorsList | None: + body: UpdateAlertEvent, +) -> Optional[Union[AlertEventResponse, ErrorsList]]: """Update alert event Updates a specific alert event. Only alert events with kind 'note' (user-created notes) can be @@ -114,15 +110,15 @@ def sync( Args: id (str): - body (UpdateAlertEvent | Unset): Update an alert event. Note: Only alert events with - kind='note' can be updated. You cannot change the kind field. + body (UpdateAlertEvent): Update an alert event. Note: Only alert events with kind='note' + can be updated. You cannot change the kind field. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertEventResponse | ErrorsList + Union[AlertEventResponse, ErrorsList] """ return sync_detailed( @@ -136,8 +132,8 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, - body: UpdateAlertEvent | Unset = UNSET, -) -> Response[AlertEventResponse | ErrorsList]: + body: UpdateAlertEvent, +) -> Response[Union[AlertEventResponse, ErrorsList]]: """Update alert event Updates a specific alert event. Only alert events with kind 'note' (user-created notes) can be @@ -145,15 +141,15 @@ async def asyncio_detailed( Args: id (str): - body (UpdateAlertEvent | Unset): Update an alert event. Note: Only alert events with - kind='note' can be updated. You cannot change the kind field. + body (UpdateAlertEvent): Update an alert event. Note: Only alert events with kind='note' + can be updated. You cannot change the kind field. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertEventResponse | ErrorsList] + Response[Union[AlertEventResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -170,8 +166,8 @@ async def asyncio( id: str, *, client: AuthenticatedClient, - body: UpdateAlertEvent | Unset = UNSET, -) -> AlertEventResponse | ErrorsList | None: + body: UpdateAlertEvent, +) -> Optional[Union[AlertEventResponse, ErrorsList]]: """Update alert event Updates a specific alert event. Only alert events with kind 'note' (user-created notes) can be @@ -179,15 +175,15 @@ async def asyncio( Args: id (str): - body (UpdateAlertEvent | Unset): Update an alert event. Note: Only alert events with - kind='note' can be updated. You cannot change the kind field. + body (UpdateAlertEvent): Update an alert event. Note: Only alert events with kind='note' + can be updated. You cannot change the kind field. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertEventResponse | ErrorsList + Union[AlertEventResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/alert_fields/create_alert_field.py b/rootly_sdk/api/alert_fields/create_alert_field.py index 7d0b7150..96f2e3a2 100644 --- a/rootly_sdk/api/alert_fields/create_alert_field.py +++ b/rootly_sdk/api/alert_fields/create_alert_field.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AlertFieldResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[AlertFieldResponse, ErrorsList]]: if response.status_code == 201: response_201 = AlertFieldResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AlertFieldResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[AlertFieldResponse, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +69,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewAlertField, -) -> Response[AlertFieldResponse | ErrorsList]: +) -> Response[Union[AlertFieldResponse, ErrorsList]]: """Creates an alert field Creates a new alert field from provided data @@ -82,7 +82,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertFieldResponse | ErrorsList] + Response[Union[AlertFieldResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: NewAlertField, -) -> AlertFieldResponse | ErrorsList | None: +) -> Optional[Union[AlertFieldResponse, ErrorsList]]: """Creates an alert field Creates a new alert field from provided data @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertFieldResponse | ErrorsList + Union[AlertFieldResponse, ErrorsList] """ return sync_detailed( @@ -126,7 +126,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewAlertField, -) -> Response[AlertFieldResponse | ErrorsList]: +) -> Response[Union[AlertFieldResponse, ErrorsList]]: """Creates an alert field Creates a new alert field from provided data @@ -139,7 +139,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertFieldResponse | ErrorsList] + Response[Union[AlertFieldResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -155,7 +155,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewAlertField, -) -> AlertFieldResponse | ErrorsList | None: +) -> Optional[Union[AlertFieldResponse, ErrorsList]]: """Creates an alert field Creates a new alert field from provided data @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertFieldResponse | ErrorsList + Union[AlertFieldResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/alert_fields/delete_alert_field.py b/rootly_sdk/api/alert_fields/delete_alert_field.py index 0b0984e0..3eaa5e59 100644 --- a/rootly_sdk/api/alert_fields/delete_alert_field.py +++ b/rootly_sdk/api/alert_fields/delete_alert_field.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union from uuid import UUID import httpx @@ -13,22 +12,19 @@ def _get_kwargs( - id: str | UUID, + id: Union[UUID, str], ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/alert_fields/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/alert_fields/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AlertFieldResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[AlertFieldResponse, ErrorsList]]: if response.status_code == 200: response_200 = AlertFieldResponse.from_dict(response.json()) @@ -51,8 +47,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AlertFieldResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[AlertFieldResponse, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -62,23 +58,23 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Response[AlertFieldResponse | ErrorsList]: +) -> Response[Union[AlertFieldResponse, ErrorsList]]: """Delete an alert field Delete a specific alert field by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertFieldResponse | ErrorsList] + Response[Union[AlertFieldResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -93,23 +89,23 @@ def sync_detailed( def sync( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> AlertFieldResponse | ErrorsList | None: +) -> Optional[Union[AlertFieldResponse, ErrorsList]]: """Delete an alert field Delete a specific alert field by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertFieldResponse | ErrorsList + Union[AlertFieldResponse, ErrorsList] """ return sync_detailed( @@ -119,23 +115,23 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Response[AlertFieldResponse | ErrorsList]: +) -> Response[Union[AlertFieldResponse, ErrorsList]]: """Delete an alert field Delete a specific alert field by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertFieldResponse | ErrorsList] + Response[Union[AlertFieldResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -148,23 +144,23 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> AlertFieldResponse | ErrorsList | None: +) -> Optional[Union[AlertFieldResponse, ErrorsList]]: """Delete an alert field Delete a specific alert field by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertFieldResponse | ErrorsList + Union[AlertFieldResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/alert_fields/get_alert_field.py b/rootly_sdk/api/alert_fields/get_alert_field.py index 10e2a4c9..5484e155 100644 --- a/rootly_sdk/api/alert_fields/get_alert_field.py +++ b/rootly_sdk/api/alert_fields/get_alert_field.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union from uuid import UUID import httpx @@ -13,22 +12,19 @@ def _get_kwargs( - id: str | UUID, + id: Union[UUID, str], ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/alert_fields/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/alert_fields/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AlertFieldResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[AlertFieldResponse, ErrorsList]]: if response.status_code == 200: response_200 = AlertFieldResponse.from_dict(response.json()) @@ -46,8 +42,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AlertFieldResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[AlertFieldResponse, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -57,23 +53,23 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Response[AlertFieldResponse | ErrorsList]: +) -> Response[Union[AlertFieldResponse, ErrorsList]]: """Retrieves an alert field Retrieves a specific alert field by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertFieldResponse | ErrorsList] + Response[Union[AlertFieldResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -88,23 +84,23 @@ def sync_detailed( def sync( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> AlertFieldResponse | ErrorsList | None: +) -> Optional[Union[AlertFieldResponse, ErrorsList]]: """Retrieves an alert field Retrieves a specific alert field by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertFieldResponse | ErrorsList + Union[AlertFieldResponse, ErrorsList] """ return sync_detailed( @@ -114,23 +110,23 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Response[AlertFieldResponse | ErrorsList]: +) -> Response[Union[AlertFieldResponse, ErrorsList]]: """Retrieves an alert field Retrieves a specific alert field by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertFieldResponse | ErrorsList] + Response[Union[AlertFieldResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -143,23 +139,23 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> AlertFieldResponse | ErrorsList | None: +) -> Optional[Union[AlertFieldResponse, ErrorsList]]: """Retrieves an alert field Retrieves a specific alert field by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertFieldResponse | ErrorsList + Union[AlertFieldResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/alert_fields/list_alert_fields.py b/rootly_sdk/api/alert_fields/list_alert_fields.py index 3215ff00..ee6c0e82 100644 --- a/rootly_sdk/api/alert_fields/list_alert_fields.py +++ b/rootly_sdk/api/alert_fields/list_alert_fields.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -11,27 +11,26 @@ def _get_kwargs( *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filterkindeq: str | Unset = UNSET, - filterkindnot_eq: str | Unset = UNSET, - filterkindin: str | Unset = UNSET, - filterkindnot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterkind: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, + filterkindeq: Union[Unset, str] = UNSET, + filterkindnot_eq: Union[Unset, str] = UNSET, + filterkindin: Union[Unset, str] = UNSET, + filterkindnot_in: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -83,7 +82,9 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> AlertFieldList | None: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[AlertFieldList]: if response.status_code == 200: response_200 = AlertFieldList.from_dict(response.json()) @@ -95,7 +96,9 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[AlertFieldList]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[AlertFieldList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -107,50 +110,50 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filterkindeq: str | Unset = UNSET, - filterkindnot_eq: str | Unset = UNSET, - filterkindin: str | Unset = UNSET, - filterkindnot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterkind: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, + filterkindeq: Union[Unset, str] = UNSET, + filterkindnot_eq: Union[Unset, str] = UNSET, + filterkindin: Union[Unset, str] = UNSET, + filterkindnot_in: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, ) -> Response[AlertFieldList]: """List alert fields List alert fields Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterkind (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filterkindeq (str | Unset): - filterkindnot_eq (str | Unset): - filterkindin (str | Unset): - filterkindnot_in (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterkind (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filterkindeq (Union[Unset, str]): + filterkindnot_eq (Union[Unset, str]): + filterkindin (Union[Unset, str]): + filterkindnot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -192,50 +195,50 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filterkindeq: str | Unset = UNSET, - filterkindnot_eq: str | Unset = UNSET, - filterkindin: str | Unset = UNSET, - filterkindnot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, -) -> AlertFieldList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterkind: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, + filterkindeq: Union[Unset, str] = UNSET, + filterkindnot_eq: Union[Unset, str] = UNSET, + filterkindin: Union[Unset, str] = UNSET, + filterkindnot_in: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, +) -> Optional[AlertFieldList]: """List alert fields List alert fields Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterkind (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filterkindeq (str | Unset): - filterkindnot_eq (str | Unset): - filterkindin (str | Unset): - filterkindnot_in (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterkind (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filterkindeq (Union[Unset, str]): + filterkindnot_eq (Union[Unset, str]): + filterkindin (Union[Unset, str]): + filterkindnot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -272,50 +275,50 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filterkindeq: str | Unset = UNSET, - filterkindnot_eq: str | Unset = UNSET, - filterkindin: str | Unset = UNSET, - filterkindnot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterkind: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, + filterkindeq: Union[Unset, str] = UNSET, + filterkindnot_eq: Union[Unset, str] = UNSET, + filterkindin: Union[Unset, str] = UNSET, + filterkindnot_in: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, ) -> Response[AlertFieldList]: """List alert fields List alert fields Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterkind (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filterkindeq (str | Unset): - filterkindnot_eq (str | Unset): - filterkindin (str | Unset): - filterkindnot_in (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterkind (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filterkindeq (Union[Unset, str]): + filterkindnot_eq (Union[Unset, str]): + filterkindin (Union[Unset, str]): + filterkindnot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -355,50 +358,50 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filterkindeq: str | Unset = UNSET, - filterkindnot_eq: str | Unset = UNSET, - filterkindin: str | Unset = UNSET, - filterkindnot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, -) -> AlertFieldList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterkind: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, + filterkindeq: Union[Unset, str] = UNSET, + filterkindnot_eq: Union[Unset, str] = UNSET, + filterkindin: Union[Unset, str] = UNSET, + filterkindnot_in: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, +) -> Optional[AlertFieldList]: """List alert fields List alert fields Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterkind (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filterkindeq (str | Unset): - filterkindnot_eq (str | Unset): - filterkindin (str | Unset): - filterkindnot_in (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterkind (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filterkindeq (Union[Unset, str]): + filterkindnot_eq (Union[Unset, str]): + filterkindin (Union[Unset, str]): + filterkindnot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/alert_fields/update_alert_field.py b/rootly_sdk/api/alert_fields/update_alert_field.py index a65a1e6f..516f53fb 100644 --- a/rootly_sdk/api/alert_fields/update_alert_field.py +++ b/rootly_sdk/api/alert_fields/update_alert_field.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union from uuid import UUID import httpx @@ -14,7 +13,7 @@ def _get_kwargs( - id: str | UUID, + id: Union[UUID, str], *, body: UpdateAlertField, ) -> dict[str, Any]: @@ -22,9 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/alert_fields/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/alert_fields/{id}", } _kwargs["json"] = body.to_dict() @@ -36,8 +33,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AlertFieldResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[AlertFieldResponse, ErrorsList]]: if response.status_code == 200: response_200 = AlertFieldResponse.from_dict(response.json()) @@ -55,8 +52,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AlertFieldResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[AlertFieldResponse, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,17 +63,17 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdateAlertField, -) -> Response[AlertFieldResponse | ErrorsList]: +) -> Response[Union[AlertFieldResponse, ErrorsList]]: """Update an alert field Update a specific alert field by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateAlertField): Raises: @@ -84,7 +81,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertFieldResponse | ErrorsList] + Response[Union[AlertFieldResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -100,17 +97,17 @@ def sync_detailed( def sync( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdateAlertField, -) -> AlertFieldResponse | ErrorsList | None: +) -> Optional[Union[AlertFieldResponse, ErrorsList]]: """Update an alert field Update a specific alert field by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateAlertField): Raises: @@ -118,7 +115,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertFieldResponse | ErrorsList + Union[AlertFieldResponse, ErrorsList] """ return sync_detailed( @@ -129,17 +126,17 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdateAlertField, -) -> Response[AlertFieldResponse | ErrorsList]: +) -> Response[Union[AlertFieldResponse, ErrorsList]]: """Update an alert field Update a specific alert field by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateAlertField): Raises: @@ -147,7 +144,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertFieldResponse | ErrorsList] + Response[Union[AlertFieldResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -161,17 +158,17 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdateAlertField, -) -> AlertFieldResponse | ErrorsList | None: +) -> Optional[Union[AlertFieldResponse, ErrorsList]]: """Update an alert field Update a specific alert field by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateAlertField): Raises: @@ -179,7 +176,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertFieldResponse | ErrorsList + Union[AlertFieldResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/alert_groups/create_alert_group.py b/rootly_sdk/api/alert_groups/create_alert_group.py index fc100c79..87890912 100644 --- a/rootly_sdk/api/alert_groups/create_alert_group.py +++ b/rootly_sdk/api/alert_groups/create_alert_group.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AlertGroupResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[AlertGroupResponse, ErrorsList]]: if response.status_code == 201: response_201 = AlertGroupResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AlertGroupResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[AlertGroupResponse, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +69,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewAlertGroup, -) -> Response[AlertGroupResponse | ErrorsList]: +) -> Response[Union[AlertGroupResponse, ErrorsList]]: """Creates an alert group Creates a new alert group. **Note**: For enhanced functionality and future compatibility, consider @@ -84,7 +84,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertGroupResponse | ErrorsList] + Response[Union[AlertGroupResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -102,7 +102,7 @@ def sync( *, client: AuthenticatedClient, body: NewAlertGroup, -) -> AlertGroupResponse | ErrorsList | None: +) -> Optional[Union[AlertGroupResponse, ErrorsList]]: """Creates an alert group Creates a new alert group. **Note**: For enhanced functionality and future compatibility, consider @@ -117,7 +117,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertGroupResponse | ErrorsList + Union[AlertGroupResponse, ErrorsList] """ return sync_detailed( @@ -130,7 +130,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewAlertGroup, -) -> Response[AlertGroupResponse | ErrorsList]: +) -> Response[Union[AlertGroupResponse, ErrorsList]]: """Creates an alert group Creates a new alert group. **Note**: For enhanced functionality and future compatibility, consider @@ -145,7 +145,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertGroupResponse | ErrorsList] + Response[Union[AlertGroupResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -161,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewAlertGroup, -) -> AlertGroupResponse | ErrorsList | None: +) -> Optional[Union[AlertGroupResponse, ErrorsList]]: """Creates an alert group Creates a new alert group. **Note**: For enhanced functionality and future compatibility, consider @@ -176,7 +176,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertGroupResponse | ErrorsList + Union[AlertGroupResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/alert_groups/delete_alert_group.py b/rootly_sdk/api/alert_groups/delete_alert_group.py index e23900a9..e0beea6d 100644 --- a/rootly_sdk/api/alert_groups/delete_alert_group.py +++ b/rootly_sdk/api/alert_groups/delete_alert_group.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union from uuid import UUID import httpx @@ -13,22 +12,19 @@ def _get_kwargs( - id: str | UUID, + id: Union[UUID, str], ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/alert_groups/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/alert_groups/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AlertGroupResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[AlertGroupResponse, ErrorsList]]: if response.status_code == 200: response_200 = AlertGroupResponse.from_dict(response.json()) @@ -46,8 +42,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AlertGroupResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[AlertGroupResponse, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -57,23 +53,23 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Response[AlertGroupResponse | ErrorsList]: +) -> Response[Union[AlertGroupResponse, ErrorsList]]: """Delete an alert group Delete a specific alert group by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertGroupResponse | ErrorsList] + Response[Union[AlertGroupResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -88,23 +84,23 @@ def sync_detailed( def sync( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> AlertGroupResponse | ErrorsList | None: +) -> Optional[Union[AlertGroupResponse, ErrorsList]]: """Delete an alert group Delete a specific alert group by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertGroupResponse | ErrorsList + Union[AlertGroupResponse, ErrorsList] """ return sync_detailed( @@ -114,23 +110,23 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Response[AlertGroupResponse | ErrorsList]: +) -> Response[Union[AlertGroupResponse, ErrorsList]]: """Delete an alert group Delete a specific alert group by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertGroupResponse | ErrorsList] + Response[Union[AlertGroupResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -143,23 +139,23 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> AlertGroupResponse | ErrorsList | None: +) -> Optional[Union[AlertGroupResponse, ErrorsList]]: """Delete an alert group Delete a specific alert group by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertGroupResponse | ErrorsList + Union[AlertGroupResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/alert_groups/get_alert_group.py b/rootly_sdk/api/alert_groups/get_alert_group.py index 67e96c43..d446f287 100644 --- a/rootly_sdk/api/alert_groups/get_alert_group.py +++ b/rootly_sdk/api/alert_groups/get_alert_group.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union from uuid import UUID import httpx @@ -13,22 +12,19 @@ def _get_kwargs( - id: str | UUID, + id: Union[UUID, str], ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/alert_groups/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/alert_groups/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AlertGroupResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[AlertGroupResponse, ErrorsList]]: if response.status_code == 200: response_200 = AlertGroupResponse.from_dict(response.json()) @@ -46,8 +42,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AlertGroupResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[AlertGroupResponse, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -57,23 +53,23 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Response[AlertGroupResponse | ErrorsList]: +) -> Response[Union[AlertGroupResponse, ErrorsList]]: """Retrieves an alert group Retrieves a specific alert group by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertGroupResponse | ErrorsList] + Response[Union[AlertGroupResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -88,23 +84,23 @@ def sync_detailed( def sync( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> AlertGroupResponse | ErrorsList | None: +) -> Optional[Union[AlertGroupResponse, ErrorsList]]: """Retrieves an alert group Retrieves a specific alert group by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertGroupResponse | ErrorsList + Union[AlertGroupResponse, ErrorsList] """ return sync_detailed( @@ -114,23 +110,23 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Response[AlertGroupResponse | ErrorsList]: +) -> Response[Union[AlertGroupResponse, ErrorsList]]: """Retrieves an alert group Retrieves a specific alert group by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertGroupResponse | ErrorsList] + Response[Union[AlertGroupResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -143,23 +139,23 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> AlertGroupResponse | ErrorsList | None: +) -> Optional[Union[AlertGroupResponse, ErrorsList]]: """Retrieves an alert group Retrieves a specific alert group by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertGroupResponse | ErrorsList + Union[AlertGroupResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/alert_groups/list_alert_groups.py b/rootly_sdk/api/alert_groups/list_alert_groups.py index a7d416e0..9a19b2dc 100644 --- a/rootly_sdk/api/alert_groups/list_alert_groups.py +++ b/rootly_sdk/api/alert_groups/list_alert_groups.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -11,17 +11,16 @@ def _get_kwargs( *, - include: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + filterslugeq: Union[Unset, str] = UNSET, + filterslugnot_eq: Union[Unset, str] = UNSET, + filterslugin: Union[Unset, str] = UNSET, + filterslugnot_in: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -53,7 +52,9 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> AlertGroupList | None: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[AlertGroupList]: if response.status_code == 200: response_200 = AlertGroupList.from_dict(response.json()) @@ -65,7 +66,9 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[AlertGroupList]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[AlertGroupList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -77,30 +80,30 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + filterslugeq: Union[Unset, str] = UNSET, + filterslugnot_eq: Union[Unset, str] = UNSET, + filterslugin: Union[Unset, str] = UNSET, + filterslugnot_in: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, ) -> Response[AlertGroupList]: """List alert groups List alert groups Args: - include (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): + include (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -132,30 +135,30 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, -) -> AlertGroupList | None: + include: Union[Unset, str] = UNSET, + filterslugeq: Union[Unset, str] = UNSET, + filterslugnot_eq: Union[Unset, str] = UNSET, + filterslugin: Union[Unset, str] = UNSET, + filterslugnot_in: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, +) -> Optional[AlertGroupList]: """List alert groups List alert groups Args: - include (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): + include (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -182,30 +185,30 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + filterslugeq: Union[Unset, str] = UNSET, + filterslugnot_eq: Union[Unset, str] = UNSET, + filterslugin: Union[Unset, str] = UNSET, + filterslugnot_in: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, ) -> Response[AlertGroupList]: """List alert groups List alert groups Args: - include (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): + include (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -235,30 +238,30 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, -) -> AlertGroupList | None: + include: Union[Unset, str] = UNSET, + filterslugeq: Union[Unset, str] = UNSET, + filterslugnot_eq: Union[Unset, str] = UNSET, + filterslugin: Union[Unset, str] = UNSET, + filterslugnot_in: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, +) -> Optional[AlertGroupList]: """List alert groups List alert groups Args: - include (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): + include (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/alert_groups/update_alert_group.py b/rootly_sdk/api/alert_groups/update_alert_group.py index 34654d17..ebe97731 100644 --- a/rootly_sdk/api/alert_groups/update_alert_group.py +++ b/rootly_sdk/api/alert_groups/update_alert_group.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union from uuid import UUID import httpx @@ -14,7 +13,7 @@ def _get_kwargs( - id: str | UUID, + id: Union[UUID, str], *, body: UpdateAlertGroup, ) -> dict[str, Any]: @@ -22,9 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "patch", - "url": "/v1/alert_groups/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/alert_groups/{id}", } _kwargs["json"] = body.to_dict() @@ -36,8 +33,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AlertGroupResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[AlertGroupResponse, ErrorsList]]: if response.status_code == 200: response_200 = AlertGroupResponse.from_dict(response.json()) @@ -55,8 +52,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AlertGroupResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[AlertGroupResponse, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,11 +63,11 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdateAlertGroup, -) -> Response[AlertGroupResponse | ErrorsList]: +) -> Response[Union[AlertGroupResponse, ErrorsList]]: """Update an alert group Update a specific alert group by id. **Note**: For enhanced functionality and future compatibility, @@ -78,7 +75,7 @@ def sync_detailed( `group_by_alert_title`, `group_by_alert_urgency`, and `attributes` fields. Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateAlertGroup): Raises: @@ -86,7 +83,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertGroupResponse | ErrorsList] + Response[Union[AlertGroupResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -102,11 +99,11 @@ def sync_detailed( def sync( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdateAlertGroup, -) -> AlertGroupResponse | ErrorsList | None: +) -> Optional[Union[AlertGroupResponse, ErrorsList]]: """Update an alert group Update a specific alert group by id. **Note**: For enhanced functionality and future compatibility, @@ -114,7 +111,7 @@ def sync( `group_by_alert_title`, `group_by_alert_urgency`, and `attributes` fields. Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateAlertGroup): Raises: @@ -122,7 +119,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertGroupResponse | ErrorsList + Union[AlertGroupResponse, ErrorsList] """ return sync_detailed( @@ -133,11 +130,11 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdateAlertGroup, -) -> Response[AlertGroupResponse | ErrorsList]: +) -> Response[Union[AlertGroupResponse, ErrorsList]]: """Update an alert group Update a specific alert group by id. **Note**: For enhanced functionality and future compatibility, @@ -145,7 +142,7 @@ async def asyncio_detailed( `group_by_alert_title`, `group_by_alert_urgency`, and `attributes` fields. Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateAlertGroup): Raises: @@ -153,7 +150,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertGroupResponse | ErrorsList] + Response[Union[AlertGroupResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -167,11 +164,11 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdateAlertGroup, -) -> AlertGroupResponse | ErrorsList | None: +) -> Optional[Union[AlertGroupResponse, ErrorsList]]: """Update an alert group Update a specific alert group by id. **Note**: For enhanced functionality and future compatibility, @@ -179,7 +176,7 @@ async def asyncio( `group_by_alert_title`, `group_by_alert_urgency`, and `attributes` fields. Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateAlertGroup): Raises: @@ -187,7 +184,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertGroupResponse | ErrorsList + Union[AlertGroupResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/alert_retrigger_rules/__init__.py b/rootly_sdk/api/alert_retrigger_rules/__init__.py new file mode 100644 index 00000000..2d7c0b23 --- /dev/null +++ b/rootly_sdk/api/alert_retrigger_rules/__init__.py @@ -0,0 +1 @@ +"""Contains endpoint functions for accessing the API""" diff --git a/rootly_sdk/api/alert_retrigger_rules/create_alert_retrigger_rule.py b/rootly_sdk/api/alert_retrigger_rules/create_alert_retrigger_rule.py new file mode 100644 index 00000000..7affe65a --- /dev/null +++ b/rootly_sdk/api/alert_retrigger_rules/create_alert_retrigger_rule.py @@ -0,0 +1,166 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.alert_retrigger_rule_response import AlertRetriggerRuleResponse +from ...models.errors_list import ErrorsList +from ...models.new_alert_retrigger_rule import NewAlertRetriggerRule +from ...types import Response + + +def _get_kwargs( + *, + body: NewAlertRetriggerRule, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/v1/alert_retrigger_rules", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/vnd.api+json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[AlertRetriggerRuleResponse, ErrorsList]]: + if response.status_code == 201: + response_201 = AlertRetriggerRuleResponse.from_dict(response.json()) + + return response_201 + + if response.status_code == 422: + response_422 = ErrorsList.from_dict(response.json()) + + return response_422 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[AlertRetriggerRuleResponse, ErrorsList]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: NewAlertRetriggerRule, +) -> Response[Union[AlertRetriggerRuleResponse, ErrorsList]]: + """Creates an alert re-trigger rule + + Args: + body (NewAlertRetriggerRule): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[AlertRetriggerRuleResponse, ErrorsList]] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: NewAlertRetriggerRule, +) -> Optional[Union[AlertRetriggerRuleResponse, ErrorsList]]: + """Creates an alert re-trigger rule + + Args: + body (NewAlertRetriggerRule): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[AlertRetriggerRuleResponse, ErrorsList] + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: NewAlertRetriggerRule, +) -> Response[Union[AlertRetriggerRuleResponse, ErrorsList]]: + """Creates an alert re-trigger rule + + Args: + body (NewAlertRetriggerRule): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[AlertRetriggerRuleResponse, ErrorsList]] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: NewAlertRetriggerRule, +) -> Optional[Union[AlertRetriggerRuleResponse, ErrorsList]]: + """Creates an alert re-trigger rule + + Args: + body (NewAlertRetriggerRule): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[AlertRetriggerRuleResponse, ErrorsList] + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/rootly_sdk/api/alert_retrigger_rules/delete_alert_retrigger_rule.py b/rootly_sdk/api/alert_retrigger_rules/delete_alert_retrigger_rule.py new file mode 100644 index 00000000..45f2565e --- /dev/null +++ b/rootly_sdk/api/alert_retrigger_rules/delete_alert_retrigger_rule.py @@ -0,0 +1,94 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...types import Response + + +def _get_kwargs( + id: str, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "delete", + "url": f"/v1/alert_retrigger_rules/{id}", + } + + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: + if response.status_code == 200: + return None + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: str, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """Deletes an alert re-trigger rule + + Args: + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +async def asyncio_detailed( + id: str, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """Deletes an alert re-trigger rule + + Args: + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) diff --git a/rootly_sdk/api/alert_retrigger_rules/get_alert_retrigger_rule.py b/rootly_sdk/api/alert_retrigger_rules/get_alert_retrigger_rule.py new file mode 100644 index 00000000..50968ed9 --- /dev/null +++ b/rootly_sdk/api/alert_retrigger_rules/get_alert_retrigger_rule.py @@ -0,0 +1,151 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.alert_retrigger_rule_response import AlertRetriggerRuleResponse +from ...types import Response + + +def _get_kwargs( + id: str, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "get", + "url": f"/v1/alert_retrigger_rules/{id}", + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[AlertRetriggerRuleResponse]: + if response.status_code == 200: + response_200 = AlertRetriggerRuleResponse.from_dict(response.json()) + + return response_200 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[AlertRetriggerRuleResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: str, + *, + client: AuthenticatedClient, +) -> Response[AlertRetriggerRuleResponse]: + """Retrieves an alert re-trigger rule + + Args: + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[AlertRetriggerRuleResponse] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: str, + *, + client: AuthenticatedClient, +) -> Optional[AlertRetriggerRuleResponse]: + """Retrieves an alert re-trigger rule + + Args: + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + AlertRetriggerRuleResponse + """ + + return sync_detailed( + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + id: str, + *, + client: AuthenticatedClient, +) -> Response[AlertRetriggerRuleResponse]: + """Retrieves an alert re-trigger rule + + Args: + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[AlertRetriggerRuleResponse] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: str, + *, + client: AuthenticatedClient, +) -> Optional[AlertRetriggerRuleResponse]: + """Retrieves an alert re-trigger rule + + Args: + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + AlertRetriggerRuleResponse + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + ) + ).parsed diff --git a/rootly_sdk/api/alert_retrigger_rules/list_alert_retrigger_rules.py b/rootly_sdk/api/alert_retrigger_rules/list_alert_retrigger_rules.py new file mode 100644 index 00000000..30ee5df5 --- /dev/null +++ b/rootly_sdk/api/alert_retrigger_rules/list_alert_retrigger_rules.py @@ -0,0 +1,127 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.alert_retrigger_rule_list import AlertRetriggerRuleList +from ...types import Response + + +def _get_kwargs() -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/v1/alert_retrigger_rules", + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[AlertRetriggerRuleList]: + if response.status_code == 200: + response_200 = AlertRetriggerRuleList.from_dict(response.json()) + + return response_200 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[AlertRetriggerRuleList]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, +) -> Response[AlertRetriggerRuleList]: + """List alert re-trigger rules + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[AlertRetriggerRuleList] + """ + + kwargs = _get_kwargs() + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, +) -> Optional[AlertRetriggerRuleList]: + """List alert re-trigger rules + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + AlertRetriggerRuleList + """ + + return sync_detailed( + client=client, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, +) -> Response[AlertRetriggerRuleList]: + """List alert re-trigger rules + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[AlertRetriggerRuleList] + """ + + kwargs = _get_kwargs() + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, +) -> Optional[AlertRetriggerRuleList]: + """List alert re-trigger rules + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + AlertRetriggerRuleList + """ + + return ( + await asyncio_detailed( + client=client, + ) + ).parsed diff --git a/rootly_sdk/api/alert_retrigger_rules/update_alert_retrigger_rule.py b/rootly_sdk/api/alert_retrigger_rules/update_alert_retrigger_rule.py new file mode 100644 index 00000000..c464f2a6 --- /dev/null +++ b/rootly_sdk/api/alert_retrigger_rules/update_alert_retrigger_rule.py @@ -0,0 +1,173 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.alert_retrigger_rule_response import AlertRetriggerRuleResponse +from ...models.update_alert_retrigger_rule import UpdateAlertRetriggerRule +from ...types import Response + + +def _get_kwargs( + id: str, + *, + body: UpdateAlertRetriggerRule, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "put", + "url": f"/v1/alert_retrigger_rules/{id}", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/vnd.api+json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[AlertRetriggerRuleResponse]: + if response.status_code == 200: + response_200 = AlertRetriggerRuleResponse.from_dict(response.json()) + + return response_200 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[AlertRetriggerRuleResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: str, + *, + client: AuthenticatedClient, + body: UpdateAlertRetriggerRule, +) -> Response[AlertRetriggerRuleResponse]: + """Updates an alert re-trigger rule + + Args: + id (str): + body (UpdateAlertRetriggerRule): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[AlertRetriggerRuleResponse] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: str, + *, + client: AuthenticatedClient, + body: UpdateAlertRetriggerRule, +) -> Optional[AlertRetriggerRuleResponse]: + """Updates an alert re-trigger rule + + Args: + id (str): + body (UpdateAlertRetriggerRule): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + AlertRetriggerRuleResponse + """ + + return sync_detailed( + id=id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + id: str, + *, + client: AuthenticatedClient, + body: UpdateAlertRetriggerRule, +) -> Response[AlertRetriggerRuleResponse]: + """Updates an alert re-trigger rule + + Args: + id (str): + body (UpdateAlertRetriggerRule): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[AlertRetriggerRuleResponse] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: str, + *, + client: AuthenticatedClient, + body: UpdateAlertRetriggerRule, +) -> Optional[AlertRetriggerRuleResponse]: + """Updates an alert re-trigger rule + + Args: + id (str): + body (UpdateAlertRetriggerRule): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + AlertRetriggerRuleResponse + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + body=body, + ) + ).parsed diff --git a/rootly_sdk/api/alert_routes/create_alert_route.py b/rootly_sdk/api/alert_routes/create_alert_route.py index 26d162de..a2f05a42 100644 --- a/rootly_sdk/api/alert_routes/create_alert_route.py +++ b/rootly_sdk/api/alert_routes/create_alert_route.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AlertRouteResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[AlertRouteResponse, ErrorsList]]: if response.status_code == 201: response_201 = AlertRouteResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AlertRouteResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[AlertRouteResponse, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +69,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewAlertRoute, -) -> Response[AlertRouteResponse | ErrorsList]: +) -> Response[Union[AlertRouteResponse, ErrorsList]]: """Creates an alert route Creates a new alert route from provided data. **Note: This endpoint requires access to Advanced @@ -96,7 +96,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertRouteResponse | ErrorsList] + Response[Union[AlertRouteResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -114,7 +114,7 @@ def sync( *, client: AuthenticatedClient, body: NewAlertRoute, -) -> AlertRouteResponse | ErrorsList | None: +) -> Optional[Union[AlertRouteResponse, ErrorsList]]: """Creates an alert route Creates a new alert route from provided data. **Note: This endpoint requires access to Advanced @@ -141,7 +141,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertRouteResponse | ErrorsList + Union[AlertRouteResponse, ErrorsList] """ return sync_detailed( @@ -154,7 +154,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewAlertRoute, -) -> Response[AlertRouteResponse | ErrorsList]: +) -> Response[Union[AlertRouteResponse, ErrorsList]]: """Creates an alert route Creates a new alert route from provided data. **Note: This endpoint requires access to Advanced @@ -181,7 +181,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertRouteResponse | ErrorsList] + Response[Union[AlertRouteResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -197,7 +197,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewAlertRoute, -) -> AlertRouteResponse | ErrorsList | None: +) -> Optional[Union[AlertRouteResponse, ErrorsList]]: """Creates an alert route Creates a new alert route from provided data. **Note: This endpoint requires access to Advanced @@ -224,7 +224,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertRouteResponse | ErrorsList + Union[AlertRouteResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/alert_routes/delete_alert_route.py b/rootly_sdk/api/alert_routes/delete_alert_route.py index 013c2d58..17ff6ee4 100644 --- a/rootly_sdk/api/alert_routes/delete_alert_route.py +++ b/rootly_sdk/api/alert_routes/delete_alert_route.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/alert_routes/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/alert_routes/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> DeleteAlertRouteResponse200 | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[DeleteAlertRouteResponse200, ErrorsList]]: if response.status_code == 200: response_200 = DeleteAlertRouteResponse200.from_dict(response.json()) @@ -55,8 +51,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[DeleteAlertRouteResponse200 | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[DeleteAlertRouteResponse200, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +65,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[DeleteAlertRouteResponse200 | ErrorsList]: +) -> Response[Union[DeleteAlertRouteResponse200, ErrorsList]]: """Delete an alert route Delete a specific alert route by id. **Note: This endpoint requires access to Advanced Alert @@ -84,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[DeleteAlertRouteResponse200 | ErrorsList] + Response[Union[DeleteAlertRouteResponse200, ErrorsList]] """ kwargs = _get_kwargs( @@ -102,7 +98,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> DeleteAlertRouteResponse200 | ErrorsList | None: +) -> Optional[Union[DeleteAlertRouteResponse200, ErrorsList]]: """Delete an alert route Delete a specific alert route by id. **Note: This endpoint requires access to Advanced Alert @@ -117,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - DeleteAlertRouteResponse200 | ErrorsList + Union[DeleteAlertRouteResponse200, ErrorsList] """ return sync_detailed( @@ -130,7 +126,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[DeleteAlertRouteResponse200 | ErrorsList]: +) -> Response[Union[DeleteAlertRouteResponse200, ErrorsList]]: """Delete an alert route Delete a specific alert route by id. **Note: This endpoint requires access to Advanced Alert @@ -145,7 +141,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[DeleteAlertRouteResponse200 | ErrorsList] + Response[Union[DeleteAlertRouteResponse200, ErrorsList]] """ kwargs = _get_kwargs( @@ -161,7 +157,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> DeleteAlertRouteResponse200 | ErrorsList | None: +) -> Optional[Union[DeleteAlertRouteResponse200, ErrorsList]]: """Delete an alert route Delete a specific alert route by id. **Note: This endpoint requires access to Advanced Alert @@ -176,7 +172,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - DeleteAlertRouteResponse200 | ErrorsList + Union[DeleteAlertRouteResponse200, ErrorsList] """ return ( diff --git a/rootly_sdk/api/alert_routes/get_alert_route.py b/rootly_sdk/api/alert_routes/get_alert_route.py index 72f3fec8..0384cd75 100644 --- a/rootly_sdk/api/alert_routes/get_alert_route.py +++ b/rootly_sdk/api/alert_routes/get_alert_route.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/alert_routes/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/alert_routes/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AlertRouteResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[AlertRouteResponse, ErrorsList]]: if response.status_code == 200: response_200 = AlertRouteResponse.from_dict(response.json()) @@ -50,8 +46,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AlertRouteResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[AlertRouteResponse, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -64,7 +60,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[AlertRouteResponse | ErrorsList]: +) -> Response[Union[AlertRouteResponse, ErrorsList]]: """Get an alert route Get a specific alert route by id. **Note: This endpoint requires access to Advanced Alert Routing. @@ -86,7 +82,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertRouteResponse | ErrorsList] + Response[Union[AlertRouteResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -104,7 +100,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> AlertRouteResponse | ErrorsList | None: +) -> Optional[Union[AlertRouteResponse, ErrorsList]]: """Get an alert route Get a specific alert route by id. **Note: This endpoint requires access to Advanced Alert Routing. @@ -126,7 +122,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertRouteResponse | ErrorsList + Union[AlertRouteResponse, ErrorsList] """ return sync_detailed( @@ -139,7 +135,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[AlertRouteResponse | ErrorsList]: +) -> Response[Union[AlertRouteResponse, ErrorsList]]: """Get an alert route Get a specific alert route by id. **Note: This endpoint requires access to Advanced Alert Routing. @@ -161,7 +157,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertRouteResponse | ErrorsList] + Response[Union[AlertRouteResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -177,7 +173,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> AlertRouteResponse | ErrorsList | None: +) -> Optional[Union[AlertRouteResponse, ErrorsList]]: """Get an alert route Get a specific alert route by id. **Note: This endpoint requires access to Advanced Alert Routing. @@ -199,7 +195,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertRouteResponse | ErrorsList + Union[AlertRouteResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/alert_routes/list_alert_routes.py b/rootly_sdk/api/alert_routes/list_alert_routes.py index 45ccfeeb..e65f78e3 100644 --- a/rootly_sdk/api/alert_routes/list_alert_routes.py +++ b/rootly_sdk/api/alert_routes/list_alert_routes.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -12,21 +12,20 @@ def _get_kwargs( *, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterslugeq: Union[Unset, str] = UNSET, + filterslugnot_eq: Union[Unset, str] = UNSET, + filterslugin: Union[Unset, str] = UNSET, + filterslugnot_in: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["page[number]"] = pagenumber @@ -67,8 +66,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AlertRouteList | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[AlertRouteList, ErrorsList]]: if response.status_code == 200: response_200 = AlertRouteList.from_dict(response.json()) @@ -86,8 +85,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AlertRouteList | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[AlertRouteList, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -99,20 +98,20 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, -) -> Response[AlertRouteList | ErrorsList]: + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterslugeq: Union[Unset, str] = UNSET, + filterslugnot_eq: Union[Unset, str] = UNSET, + filterslugin: Union[Unset, str] = UNSET, + filterslugnot_in: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, +) -> Response[Union[AlertRouteList, ErrorsList]]: """List alert routes List all alert routes for the current team with filtering and pagination. **Note: This endpoint @@ -120,26 +119,26 @@ def sync_detailed( please contact Rootly customer support.** Args: - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - sort (str | Unset): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertRouteList | ErrorsList] + Response[Union[AlertRouteList, ErrorsList]] """ kwargs = _get_kwargs( @@ -168,20 +167,20 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, -) -> AlertRouteList | ErrorsList | None: + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterslugeq: Union[Unset, str] = UNSET, + filterslugnot_eq: Union[Unset, str] = UNSET, + filterslugin: Union[Unset, str] = UNSET, + filterslugnot_in: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, +) -> Optional[Union[AlertRouteList, ErrorsList]]: """List alert routes List all alert routes for the current team with filtering and pagination. **Note: This endpoint @@ -189,26 +188,26 @@ def sync( please contact Rootly customer support.** Args: - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - sort (str | Unset): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertRouteList | ErrorsList + Union[AlertRouteList, ErrorsList] """ return sync_detailed( @@ -232,20 +231,20 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, -) -> Response[AlertRouteList | ErrorsList]: + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterslugeq: Union[Unset, str] = UNSET, + filterslugnot_eq: Union[Unset, str] = UNSET, + filterslugin: Union[Unset, str] = UNSET, + filterslugnot_in: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, +) -> Response[Union[AlertRouteList, ErrorsList]]: """List alert routes List all alert routes for the current team with filtering and pagination. **Note: This endpoint @@ -253,26 +252,26 @@ async def asyncio_detailed( please contact Rootly customer support.** Args: - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - sort (str | Unset): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertRouteList | ErrorsList] + Response[Union[AlertRouteList, ErrorsList]] """ kwargs = _get_kwargs( @@ -299,20 +298,20 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, -) -> AlertRouteList | ErrorsList | None: + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterslugeq: Union[Unset, str] = UNSET, + filterslugnot_eq: Union[Unset, str] = UNSET, + filterslugin: Union[Unset, str] = UNSET, + filterslugnot_in: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, +) -> Optional[Union[AlertRouteList, ErrorsList]]: """List alert routes List all alert routes for the current team with filtering and pagination. **Note: This endpoint @@ -320,26 +319,26 @@ async def asyncio( please contact Rootly customer support.** Args: - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - sort (str | Unset): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertRouteList | ErrorsList + Union[AlertRouteList, ErrorsList] """ return ( diff --git a/rootly_sdk/api/alert_routes/patch_alert_route.py b/rootly_sdk/api/alert_routes/patch_alert_route.py index a8c0c4a9..31f0fd42 100644 --- a/rootly_sdk/api/alert_routes/patch_alert_route.py +++ b/rootly_sdk/api/alert_routes/patch_alert_route.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "patch", - "url": "/v1/alert_routes/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/alert_routes/{id}", } _kwargs["json"] = body.to_dict() @@ -35,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AlertRouteResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[AlertRouteResponse, ErrorsList]]: if response.status_code == 200: response_200 = AlertRouteResponse.from_dict(response.json()) @@ -64,8 +61,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AlertRouteResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[AlertRouteResponse, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -79,7 +76,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: PatchAlertRoute, -) -> Response[AlertRouteResponse | ErrorsList]: +) -> Response[Union[AlertRouteResponse, ErrorsList]]: """Update an alert route Updates an alert route. **Note: This endpoint requires access to Advanced Alert Routing. If you're @@ -94,7 +91,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertRouteResponse | ErrorsList] + Response[Union[AlertRouteResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -114,7 +111,7 @@ def sync( *, client: AuthenticatedClient, body: PatchAlertRoute, -) -> AlertRouteResponse | ErrorsList | None: +) -> Optional[Union[AlertRouteResponse, ErrorsList]]: """Update an alert route Updates an alert route. **Note: This endpoint requires access to Advanced Alert Routing. If you're @@ -129,7 +126,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertRouteResponse | ErrorsList + Union[AlertRouteResponse, ErrorsList] """ return sync_detailed( @@ -144,7 +141,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: PatchAlertRoute, -) -> Response[AlertRouteResponse | ErrorsList]: +) -> Response[Union[AlertRouteResponse, ErrorsList]]: """Update an alert route Updates an alert route. **Note: This endpoint requires access to Advanced Alert Routing. If you're @@ -159,7 +156,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertRouteResponse | ErrorsList] + Response[Union[AlertRouteResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -177,7 +174,7 @@ async def asyncio( *, client: AuthenticatedClient, body: PatchAlertRoute, -) -> AlertRouteResponse | ErrorsList | None: +) -> Optional[Union[AlertRouteResponse, ErrorsList]]: """Update an alert route Updates an alert route. **Note: This endpoint requires access to Advanced Alert Routing. If you're @@ -192,7 +189,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertRouteResponse | ErrorsList + Union[AlertRouteResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/alert_routes/update_alert_route.py b/rootly_sdk/api/alert_routes/update_alert_route.py index 5a47cf35..d7045642 100644 --- a/rootly_sdk/api/alert_routes/update_alert_route.py +++ b/rootly_sdk/api/alert_routes/update_alert_route.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/alert_routes/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/alert_routes/{id}", } _kwargs["json"] = body.to_dict() @@ -35,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AlertRouteResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[AlertRouteResponse, ErrorsList]]: if response.status_code == 200: response_200 = AlertRouteResponse.from_dict(response.json()) @@ -59,8 +56,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AlertRouteResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[AlertRouteResponse, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -74,7 +71,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateAlertRoute, -) -> Response[AlertRouteResponse | ErrorsList]: +) -> Response[Union[AlertRouteResponse, ErrorsList]]: """Update an alert route Update a specific alert route by id. **Note: This endpoint requires access to Advanced Alert @@ -102,7 +99,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertRouteResponse | ErrorsList] + Response[Union[AlertRouteResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -122,7 +119,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateAlertRoute, -) -> AlertRouteResponse | ErrorsList | None: +) -> Optional[Union[AlertRouteResponse, ErrorsList]]: """Update an alert route Update a specific alert route by id. **Note: This endpoint requires access to Advanced Alert @@ -150,7 +147,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertRouteResponse | ErrorsList + Union[AlertRouteResponse, ErrorsList] """ return sync_detailed( @@ -165,7 +162,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateAlertRoute, -) -> Response[AlertRouteResponse | ErrorsList]: +) -> Response[Union[AlertRouteResponse, ErrorsList]]: """Update an alert route Update a specific alert route by id. **Note: This endpoint requires access to Advanced Alert @@ -193,7 +190,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertRouteResponse | ErrorsList] + Response[Union[AlertRouteResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -211,7 +208,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateAlertRoute, -) -> AlertRouteResponse | ErrorsList | None: +) -> Optional[Union[AlertRouteResponse, ErrorsList]]: """Update an alert route Update a specific alert route by id. **Note: This endpoint requires access to Advanced Alert @@ -239,7 +236,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertRouteResponse | ErrorsList + Union[AlertRouteResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/alert_routing_rules/create_alert_routing_rule.py b/rootly_sdk/api/alert_routing_rules/create_alert_routing_rule.py index 55f243d7..3b79e264 100644 --- a/rootly_sdk/api/alert_routing_rules/create_alert_routing_rule.py +++ b/rootly_sdk/api/alert_routing_rules/create_alert_routing_rule.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AlertRoutingRuleResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[AlertRoutingRuleResponse, ErrorsList]]: if response.status_code == 201: response_201 = AlertRoutingRuleResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AlertRoutingRuleResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[AlertRoutingRuleResponse, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +69,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewAlertRoutingRule, -) -> Response[AlertRoutingRuleResponse | ErrorsList]: +) -> Response[Union[AlertRoutingRuleResponse, ErrorsList]]: """Creates an alert routing rule Creates a new alert routing rule from provided data. **Note: If you are an advanced alert routing @@ -84,7 +84,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertRoutingRuleResponse | ErrorsList] + Response[Union[AlertRoutingRuleResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -102,7 +102,7 @@ def sync( *, client: AuthenticatedClient, body: NewAlertRoutingRule, -) -> AlertRoutingRuleResponse | ErrorsList | None: +) -> Optional[Union[AlertRoutingRuleResponse, ErrorsList]]: """Creates an alert routing rule Creates a new alert routing rule from provided data. **Note: If you are an advanced alert routing @@ -117,7 +117,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertRoutingRuleResponse | ErrorsList + Union[AlertRoutingRuleResponse, ErrorsList] """ return sync_detailed( @@ -130,7 +130,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewAlertRoutingRule, -) -> Response[AlertRoutingRuleResponse | ErrorsList]: +) -> Response[Union[AlertRoutingRuleResponse, ErrorsList]]: """Creates an alert routing rule Creates a new alert routing rule from provided data. **Note: If you are an advanced alert routing @@ -145,7 +145,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertRoutingRuleResponse | ErrorsList] + Response[Union[AlertRoutingRuleResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -161,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewAlertRoutingRule, -) -> AlertRoutingRuleResponse | ErrorsList | None: +) -> Optional[Union[AlertRoutingRuleResponse, ErrorsList]]: """Creates an alert routing rule Creates a new alert routing rule from provided data. **Note: If you are an advanced alert routing @@ -176,7 +176,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertRoutingRuleResponse | ErrorsList + Union[AlertRoutingRuleResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/alert_routing_rules/delete_alert_routing_rule.py b/rootly_sdk/api/alert_routing_rules/delete_alert_routing_rule.py index 9a0263e6..f9ea676c 100644 --- a/rootly_sdk/api/alert_routing_rules/delete_alert_routing_rule.py +++ b/rootly_sdk/api/alert_routing_rules/delete_alert_routing_rule.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union from uuid import UUID import httpx @@ -13,22 +12,19 @@ def _get_kwargs( - id: str | UUID, + id: Union[UUID, str], ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/alert_routing_rules/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/alert_routing_rules/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AlertRoutingRuleResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[AlertRoutingRuleResponse, ErrorsList]]: if response.status_code == 200: response_200 = AlertRoutingRuleResponse.from_dict(response.json()) @@ -46,8 +42,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AlertRoutingRuleResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[AlertRoutingRuleResponse, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -57,10 +53,10 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Response[AlertRoutingRuleResponse | ErrorsList]: +) -> Response[Union[AlertRoutingRuleResponse, ErrorsList]]: """Delete an alert routing rule Delete a specific alert routing rule by id. **Note: If you are an advanced alert routing user, you @@ -68,14 +64,14 @@ def sync_detailed( advanced user, please contact Rootly customer support.** Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertRoutingRuleResponse | ErrorsList] + Response[Union[AlertRoutingRuleResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -90,10 +86,10 @@ def sync_detailed( def sync( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> AlertRoutingRuleResponse | ErrorsList | None: +) -> Optional[Union[AlertRoutingRuleResponse, ErrorsList]]: """Delete an alert routing rule Delete a specific alert routing rule by id. **Note: If you are an advanced alert routing user, you @@ -101,14 +97,14 @@ def sync( advanced user, please contact Rootly customer support.** Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertRoutingRuleResponse | ErrorsList + Union[AlertRoutingRuleResponse, ErrorsList] """ return sync_detailed( @@ -118,10 +114,10 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Response[AlertRoutingRuleResponse | ErrorsList]: +) -> Response[Union[AlertRoutingRuleResponse, ErrorsList]]: """Delete an alert routing rule Delete a specific alert routing rule by id. **Note: If you are an advanced alert routing user, you @@ -129,14 +125,14 @@ async def asyncio_detailed( advanced user, please contact Rootly customer support.** Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertRoutingRuleResponse | ErrorsList] + Response[Union[AlertRoutingRuleResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -149,10 +145,10 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> AlertRoutingRuleResponse | ErrorsList | None: +) -> Optional[Union[AlertRoutingRuleResponse, ErrorsList]]: """Delete an alert routing rule Delete a specific alert routing rule by id. **Note: If you are an advanced alert routing user, you @@ -160,14 +156,14 @@ async def asyncio( advanced user, please contact Rootly customer support.** Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertRoutingRuleResponse | ErrorsList + Union[AlertRoutingRuleResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/alert_routing_rules/get_alert_routing_rule.py b/rootly_sdk/api/alert_routing_rules/get_alert_routing_rule.py index 5946c97a..c2ea686c 100644 --- a/rootly_sdk/api/alert_routing_rules/get_alert_routing_rule.py +++ b/rootly_sdk/api/alert_routing_rules/get_alert_routing_rule.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union from uuid import UUID import httpx @@ -13,22 +12,19 @@ def _get_kwargs( - id: str | UUID, + id: Union[UUID, str], ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/alert_routing_rules/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/alert_routing_rules/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AlertRoutingRuleResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[AlertRoutingRuleResponse, ErrorsList]]: if response.status_code == 200: response_200 = AlertRoutingRuleResponse.from_dict(response.json()) @@ -46,8 +42,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AlertRoutingRuleResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[AlertRoutingRuleResponse, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -57,10 +53,10 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Response[AlertRoutingRuleResponse | ErrorsList]: +) -> Response[Union[AlertRoutingRuleResponse, ErrorsList]]: """Retrieves an alert routing rule Retrieves a specific alert routing rule by id. **Note: If you are an advanced alert routing user, @@ -68,14 +64,14 @@ def sync_detailed( an advanced user, please contact Rootly customer support.** Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertRoutingRuleResponse | ErrorsList] + Response[Union[AlertRoutingRuleResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -90,10 +86,10 @@ def sync_detailed( def sync( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> AlertRoutingRuleResponse | ErrorsList | None: +) -> Optional[Union[AlertRoutingRuleResponse, ErrorsList]]: """Retrieves an alert routing rule Retrieves a specific alert routing rule by id. **Note: If you are an advanced alert routing user, @@ -101,14 +97,14 @@ def sync( an advanced user, please contact Rootly customer support.** Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertRoutingRuleResponse | ErrorsList + Union[AlertRoutingRuleResponse, ErrorsList] """ return sync_detailed( @@ -118,10 +114,10 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Response[AlertRoutingRuleResponse | ErrorsList]: +) -> Response[Union[AlertRoutingRuleResponse, ErrorsList]]: """Retrieves an alert routing rule Retrieves a specific alert routing rule by id. **Note: If you are an advanced alert routing user, @@ -129,14 +125,14 @@ async def asyncio_detailed( an advanced user, please contact Rootly customer support.** Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertRoutingRuleResponse | ErrorsList] + Response[Union[AlertRoutingRuleResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -149,10 +145,10 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> AlertRoutingRuleResponse | ErrorsList | None: +) -> Optional[Union[AlertRoutingRuleResponse, ErrorsList]]: """Retrieves an alert routing rule Retrieves a specific alert routing rule by id. **Note: If you are an advanced alert routing user, @@ -160,14 +156,14 @@ async def asyncio( an advanced user, please contact Rootly customer support.** Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertRoutingRuleResponse | ErrorsList + Union[AlertRoutingRuleResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/alert_routing_rules/list_alert_routing_rules.py b/rootly_sdk/api/alert_routing_rules/list_alert_routing_rules.py index 19c93281..f96a0a60 100644 --- a/rootly_sdk/api/alert_routing_rules/list_alert_routing_rules.py +++ b/rootly_sdk/api/alert_routing_rules/list_alert_routing_rules.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -11,26 +11,25 @@ def _get_kwargs( *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filterslugeq: Union[Unset, str] = UNSET, + filterslugnot_eq: Union[Unset, str] = UNSET, + filterslugin: Union[Unset, str] = UNSET, + filterslugnot_in: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -80,7 +79,9 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> AlertRoutingRuleList | None: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[AlertRoutingRuleList]: if response.status_code == 200: response_200 = AlertRoutingRuleList.from_dict(response.json()) @@ -93,7 +94,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[AlertRoutingRuleList]: return Response( status_code=HTTPStatus(response.status_code), @@ -106,24 +107,24 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filterslugeq: Union[Unset, str] = UNSET, + filterslugnot_eq: Union[Unset, str] = UNSET, + filterslugin: Union[Unset, str] = UNSET, + filterslugnot_in: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, ) -> Response[AlertRoutingRuleList]: """List alert routing rules @@ -132,24 +133,24 @@ def sync_detailed( please contact Rootly customer support.** Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -190,25 +191,25 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, -) -> AlertRoutingRuleList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filterslugeq: Union[Unset, str] = UNSET, + filterslugnot_eq: Union[Unset, str] = UNSET, + filterslugin: Union[Unset, str] = UNSET, + filterslugnot_in: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, +) -> Optional[AlertRoutingRuleList]: """List alert routing rules List alert routing rules. **Note: If you are an advanced alert routing user, you should use the @@ -216,24 +217,24 @@ def sync( please contact Rootly customer support.** Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -269,24 +270,24 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filterslugeq: Union[Unset, str] = UNSET, + filterslugnot_eq: Union[Unset, str] = UNSET, + filterslugin: Union[Unset, str] = UNSET, + filterslugnot_in: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, ) -> Response[AlertRoutingRuleList]: """List alert routing rules @@ -295,24 +296,24 @@ async def asyncio_detailed( please contact Rootly customer support.** Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -351,25 +352,25 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, -) -> AlertRoutingRuleList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filterslugeq: Union[Unset, str] = UNSET, + filterslugnot_eq: Union[Unset, str] = UNSET, + filterslugin: Union[Unset, str] = UNSET, + filterslugnot_in: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, +) -> Optional[AlertRoutingRuleList]: """List alert routing rules List alert routing rules. **Note: If you are an advanced alert routing user, you should use the @@ -377,24 +378,24 @@ async def asyncio( please contact Rootly customer support.** Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/alert_routing_rules/update_alert_routing_rule.py b/rootly_sdk/api/alert_routing_rules/update_alert_routing_rule.py index 6bc038cd..69931d36 100644 --- a/rootly_sdk/api/alert_routing_rules/update_alert_routing_rule.py +++ b/rootly_sdk/api/alert_routing_rules/update_alert_routing_rule.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union from uuid import UUID import httpx @@ -14,7 +13,7 @@ def _get_kwargs( - id: str | UUID, + id: Union[UUID, str], *, body: UpdateAlertRoutingRule, ) -> dict[str, Any]: @@ -22,9 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/alert_routing_rules/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/alert_routing_rules/{id}", } _kwargs["json"] = body.to_dict() @@ -36,8 +33,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AlertRoutingRuleResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[AlertRoutingRuleResponse, ErrorsList]]: if response.status_code == 200: response_200 = AlertRoutingRuleResponse.from_dict(response.json()) @@ -55,8 +52,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AlertRoutingRuleResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[AlertRoutingRuleResponse, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,11 +63,11 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdateAlertRoutingRule, -) -> Response[AlertRoutingRuleResponse | ErrorsList]: +) -> Response[Union[AlertRoutingRuleResponse, ErrorsList]]: """Update an alert routing rule Update a specific alert routing rule by id. **Note: If you are an advanced alert routing user, you @@ -78,7 +75,7 @@ def sync_detailed( advanced user, please contact Rootly customer support.** Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateAlertRoutingRule): Raises: @@ -86,7 +83,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertRoutingRuleResponse | ErrorsList] + Response[Union[AlertRoutingRuleResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -102,11 +99,11 @@ def sync_detailed( def sync( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdateAlertRoutingRule, -) -> AlertRoutingRuleResponse | ErrorsList | None: +) -> Optional[Union[AlertRoutingRuleResponse, ErrorsList]]: """Update an alert routing rule Update a specific alert routing rule by id. **Note: If you are an advanced alert routing user, you @@ -114,7 +111,7 @@ def sync( advanced user, please contact Rootly customer support.** Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateAlertRoutingRule): Raises: @@ -122,7 +119,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertRoutingRuleResponse | ErrorsList + Union[AlertRoutingRuleResponse, ErrorsList] """ return sync_detailed( @@ -133,11 +130,11 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdateAlertRoutingRule, -) -> Response[AlertRoutingRuleResponse | ErrorsList]: +) -> Response[Union[AlertRoutingRuleResponse, ErrorsList]]: """Update an alert routing rule Update a specific alert routing rule by id. **Note: If you are an advanced alert routing user, you @@ -145,7 +142,7 @@ async def asyncio_detailed( advanced user, please contact Rootly customer support.** Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateAlertRoutingRule): Raises: @@ -153,7 +150,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertRoutingRuleResponse | ErrorsList] + Response[Union[AlertRoutingRuleResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -167,11 +164,11 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdateAlertRoutingRule, -) -> AlertRoutingRuleResponse | ErrorsList | None: +) -> Optional[Union[AlertRoutingRuleResponse, ErrorsList]]: """Update an alert routing rule Update a specific alert routing rule by id. **Note: If you are an advanced alert routing user, you @@ -179,7 +176,7 @@ async def asyncio( advanced user, please contact Rootly customer support.** Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateAlertRoutingRule): Raises: @@ -187,7 +184,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertRoutingRuleResponse | ErrorsList + Union[AlertRoutingRuleResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/alert_sources/create_alerts_source.py b/rootly_sdk/api/alert_sources/create_alerts_source.py index 893eb998..5eb02737 100644 --- a/rootly_sdk/api/alert_sources/create_alerts_source.py +++ b/rootly_sdk/api/alert_sources/create_alerts_source.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AlertsSourceResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[AlertsSourceResponse, ErrorsList]]: if response.status_code == 201: response_201 = AlertsSourceResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AlertsSourceResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[AlertsSourceResponse, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +69,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewAlertsSource, -) -> Response[AlertsSourceResponse | ErrorsList]: +) -> Response[Union[AlertsSourceResponse, ErrorsList]]: """Creates an alert source Creates a new alert source from provided data @@ -82,7 +82,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertsSourceResponse | ErrorsList] + Response[Union[AlertsSourceResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: NewAlertsSource, -) -> AlertsSourceResponse | ErrorsList | None: +) -> Optional[Union[AlertsSourceResponse, ErrorsList]]: """Creates an alert source Creates a new alert source from provided data @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertsSourceResponse | ErrorsList + Union[AlertsSourceResponse, ErrorsList] """ return sync_detailed( @@ -126,7 +126,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewAlertsSource, -) -> Response[AlertsSourceResponse | ErrorsList]: +) -> Response[Union[AlertsSourceResponse, ErrorsList]]: """Creates an alert source Creates a new alert source from provided data @@ -139,7 +139,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertsSourceResponse | ErrorsList] + Response[Union[AlertsSourceResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -155,7 +155,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewAlertsSource, -) -> AlertsSourceResponse | ErrorsList | None: +) -> Optional[Union[AlertsSourceResponse, ErrorsList]]: """Creates an alert source Creates a new alert source from provided data @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertsSourceResponse | ErrorsList + Union[AlertsSourceResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/alert_sources/delete_alerts_source.py b/rootly_sdk/api/alert_sources/delete_alerts_source.py index 24e0748d..f6f0dc74 100644 --- a/rootly_sdk/api/alert_sources/delete_alerts_source.py +++ b/rootly_sdk/api/alert_sources/delete_alerts_source.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/alert_sources/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/alert_sources/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AlertsSourceResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[AlertsSourceResponse, ErrorsList]]: if response.status_code == 200: response_200 = AlertsSourceResponse.from_dict(response.json()) @@ -45,8 +41,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AlertsSourceResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[AlertsSourceResponse, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[AlertsSourceResponse | ErrorsList]: +) -> Response[Union[AlertsSourceResponse, ErrorsList]]: """Delete an alert source Delete a specific alert source by id @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertsSourceResponse | ErrorsList] + Response[Union[AlertsSourceResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -90,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> AlertsSourceResponse | ErrorsList | None: +) -> Optional[Union[AlertsSourceResponse, ErrorsList]]: """Delete an alert source Delete a specific alert source by id @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertsSourceResponse | ErrorsList + Union[AlertsSourceResponse, ErrorsList] """ return sync_detailed( @@ -116,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[AlertsSourceResponse | ErrorsList]: +) -> Response[Union[AlertsSourceResponse, ErrorsList]]: """Delete an alert source Delete a specific alert source by id @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertsSourceResponse | ErrorsList] + Response[Union[AlertsSourceResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -145,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> AlertsSourceResponse | ErrorsList | None: +) -> Optional[Union[AlertsSourceResponse, ErrorsList]]: """Delete an alert source Delete a specific alert source by id @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertsSourceResponse | ErrorsList + Union[AlertsSourceResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/alert_sources/get_alerts_source.py b/rootly_sdk/api/alert_sources/get_alerts_source.py index e3617a5a..1affea50 100644 --- a/rootly_sdk/api/alert_sources/get_alerts_source.py +++ b/rootly_sdk/api/alert_sources/get_alerts_source.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/alert_sources/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/alert_sources/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AlertsSourceResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[AlertsSourceResponse, ErrorsList]]: if response.status_code == 200: response_200 = AlertsSourceResponse.from_dict(response.json()) @@ -45,8 +41,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AlertsSourceResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[AlertsSourceResponse, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[AlertsSourceResponse | ErrorsList]: +) -> Response[Union[AlertsSourceResponse, ErrorsList]]: """Retrieves an alert source Retrieves a specific alert source by id @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertsSourceResponse | ErrorsList] + Response[Union[AlertsSourceResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -90,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> AlertsSourceResponse | ErrorsList | None: +) -> Optional[Union[AlertsSourceResponse, ErrorsList]]: """Retrieves an alert source Retrieves a specific alert source by id @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertsSourceResponse | ErrorsList + Union[AlertsSourceResponse, ErrorsList] """ return sync_detailed( @@ -116,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[AlertsSourceResponse | ErrorsList]: +) -> Response[Union[AlertsSourceResponse, ErrorsList]]: """Retrieves an alert source Retrieves a specific alert source by id @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertsSourceResponse | ErrorsList] + Response[Union[AlertsSourceResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -145,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> AlertsSourceResponse | ErrorsList | None: +) -> Optional[Union[AlertsSourceResponse, ErrorsList]]: """Retrieves an alert source Retrieves a specific alert source by id @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertsSourceResponse | ErrorsList + Union[AlertsSourceResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/alert_sources/list_alerts_sources.py b/rootly_sdk/api/alert_sources/list_alerts_sources.py index 39744362..1fd86d39 100644 --- a/rootly_sdk/api/alert_sources/list_alerts_sources.py +++ b/rootly_sdk/api/alert_sources/list_alerts_sources.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -11,17 +11,16 @@ def _get_kwargs( *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterstatuses: str | Unset = UNSET, - filtersource_types: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterenabled: bool | Unset = UNSET, - sort: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filterstatuses: Union[Unset, str] = UNSET, + filtersource_types: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterenabled: Union[Unset, bool] = UNSET, + sort: Union[Unset, str] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -53,7 +52,9 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> AlertsSourceList | None: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[AlertsSourceList]: if response.status_code == 200: response_200 = AlertsSourceList.from_dict(response.json()) @@ -65,7 +66,9 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[AlertsSourceList]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[AlertsSourceList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -77,30 +80,30 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterstatuses: str | Unset = UNSET, - filtersource_types: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterenabled: bool | Unset = UNSET, - sort: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filterstatuses: Union[Unset, str] = UNSET, + filtersource_types: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterenabled: Union[Unset, bool] = UNSET, + sort: Union[Unset, str] = UNSET, ) -> Response[AlertsSourceList]: """List alert sources List alert sources Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterstatuses (str | Unset): - filtersource_types (str | Unset): - filtername (str | Unset): - filterenabled (bool | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterstatuses (Union[Unset, str]): + filtersource_types (Union[Unset, str]): + filtername (Union[Unset, str]): + filterenabled (Union[Unset, bool]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -132,30 +135,30 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterstatuses: str | Unset = UNSET, - filtersource_types: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterenabled: bool | Unset = UNSET, - sort: str | Unset = UNSET, -) -> AlertsSourceList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filterstatuses: Union[Unset, str] = UNSET, + filtersource_types: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterenabled: Union[Unset, bool] = UNSET, + sort: Union[Unset, str] = UNSET, +) -> Optional[AlertsSourceList]: """List alert sources List alert sources Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterstatuses (str | Unset): - filtersource_types (str | Unset): - filtername (str | Unset): - filterenabled (bool | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterstatuses (Union[Unset, str]): + filtersource_types (Union[Unset, str]): + filtername (Union[Unset, str]): + filterenabled (Union[Unset, bool]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -182,30 +185,30 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterstatuses: str | Unset = UNSET, - filtersource_types: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterenabled: bool | Unset = UNSET, - sort: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filterstatuses: Union[Unset, str] = UNSET, + filtersource_types: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterenabled: Union[Unset, bool] = UNSET, + sort: Union[Unset, str] = UNSET, ) -> Response[AlertsSourceList]: """List alert sources List alert sources Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterstatuses (str | Unset): - filtersource_types (str | Unset): - filtername (str | Unset): - filterenabled (bool | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterstatuses (Union[Unset, str]): + filtersource_types (Union[Unset, str]): + filtername (Union[Unset, str]): + filterenabled (Union[Unset, bool]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -235,30 +238,30 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterstatuses: str | Unset = UNSET, - filtersource_types: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterenabled: bool | Unset = UNSET, - sort: str | Unset = UNSET, -) -> AlertsSourceList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filterstatuses: Union[Unset, str] = UNSET, + filtersource_types: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterenabled: Union[Unset, bool] = UNSET, + sort: Union[Unset, str] = UNSET, +) -> Optional[AlertsSourceList]: """List alert sources List alert sources Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterstatuses (str | Unset): - filtersource_types (str | Unset): - filtername (str | Unset): - filterenabled (bool | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterstatuses (Union[Unset, str]): + filtersource_types (Union[Unset, str]): + filtername (Union[Unset, str]): + filterenabled (Union[Unset, bool]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/alert_sources/update_alerts_source.py b/rootly_sdk/api/alert_sources/update_alerts_source.py index 32c1f348..32406f2d 100644 --- a/rootly_sdk/api/alert_sources/update_alerts_source.py +++ b/rootly_sdk/api/alert_sources/update_alerts_source.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/alert_sources/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/alert_sources/{id}", } _kwargs["json"] = body.to_dict() @@ -35,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AlertsSourceResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[AlertsSourceResponse, ErrorsList]]: if response.status_code == 200: response_200 = AlertsSourceResponse.from_dict(response.json()) @@ -54,8 +51,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AlertsSourceResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[AlertsSourceResponse, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateAlertsSource, -) -> Response[AlertsSourceResponse | ErrorsList]: +) -> Response[Union[AlertsSourceResponse, ErrorsList]]: """Update an alert source Update a specific alert source by id @@ -83,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertsSourceResponse | ErrorsList] + Response[Union[AlertsSourceResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -103,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateAlertsSource, -) -> AlertsSourceResponse | ErrorsList | None: +) -> Optional[Union[AlertsSourceResponse, ErrorsList]]: """Update an alert source Update a specific alert source by id @@ -117,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertsSourceResponse | ErrorsList + Union[AlertsSourceResponse, ErrorsList] """ return sync_detailed( @@ -132,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateAlertsSource, -) -> Response[AlertsSourceResponse | ErrorsList]: +) -> Response[Union[AlertsSourceResponse, ErrorsList]]: """Update an alert source Update a specific alert source by id @@ -146,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertsSourceResponse | ErrorsList] + Response[Union[AlertsSourceResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -164,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateAlertsSource, -) -> AlertsSourceResponse | ErrorsList | None: +) -> Optional[Union[AlertsSourceResponse, ErrorsList]]: """Update an alert source Update a specific alert source by id @@ -178,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertsSourceResponse | ErrorsList + Union[AlertsSourceResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/alert_urgencies/create_alert_urgency.py b/rootly_sdk/api/alert_urgencies/create_alert_urgency.py index d44f0d38..2d1e5e01 100644 --- a/rootly_sdk/api/alert_urgencies/create_alert_urgency.py +++ b/rootly_sdk/api/alert_urgencies/create_alert_urgency.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AlertUrgencyResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[AlertUrgencyResponse, ErrorsList]]: if response.status_code == 201: response_201 = AlertUrgencyResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AlertUrgencyResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[AlertUrgencyResponse, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +69,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewAlertUrgency, -) -> Response[AlertUrgencyResponse | ErrorsList]: +) -> Response[Union[AlertUrgencyResponse, ErrorsList]]: """Creates an alert urgency Creates a new alert urgency from provided data @@ -82,7 +82,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertUrgencyResponse | ErrorsList] + Response[Union[AlertUrgencyResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: NewAlertUrgency, -) -> AlertUrgencyResponse | ErrorsList | None: +) -> Optional[Union[AlertUrgencyResponse, ErrorsList]]: """Creates an alert urgency Creates a new alert urgency from provided data @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertUrgencyResponse | ErrorsList + Union[AlertUrgencyResponse, ErrorsList] """ return sync_detailed( @@ -126,7 +126,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewAlertUrgency, -) -> Response[AlertUrgencyResponse | ErrorsList]: +) -> Response[Union[AlertUrgencyResponse, ErrorsList]]: """Creates an alert urgency Creates a new alert urgency from provided data @@ -139,7 +139,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertUrgencyResponse | ErrorsList] + Response[Union[AlertUrgencyResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -155,7 +155,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewAlertUrgency, -) -> AlertUrgencyResponse | ErrorsList | None: +) -> Optional[Union[AlertUrgencyResponse, ErrorsList]]: """Creates an alert urgency Creates a new alert urgency from provided data @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertUrgencyResponse | ErrorsList + Union[AlertUrgencyResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/alert_urgencies/delete_alert_urgency.py b/rootly_sdk/api/alert_urgencies/delete_alert_urgency.py index 46ed88c4..1d92430d 100644 --- a/rootly_sdk/api/alert_urgencies/delete_alert_urgency.py +++ b/rootly_sdk/api/alert_urgencies/delete_alert_urgency.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/alert_urgencies/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/alert_urgencies/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AlertUrgencyResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[AlertUrgencyResponse, ErrorsList]]: if response.status_code == 200: response_200 = AlertUrgencyResponse.from_dict(response.json()) @@ -45,8 +41,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AlertUrgencyResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[AlertUrgencyResponse, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[AlertUrgencyResponse | ErrorsList]: +) -> Response[Union[AlertUrgencyResponse, ErrorsList]]: """Delete an alert urgency Delete a specific alert urgency by id @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertUrgencyResponse | ErrorsList] + Response[Union[AlertUrgencyResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -90,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> AlertUrgencyResponse | ErrorsList | None: +) -> Optional[Union[AlertUrgencyResponse, ErrorsList]]: """Delete an alert urgency Delete a specific alert urgency by id @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertUrgencyResponse | ErrorsList + Union[AlertUrgencyResponse, ErrorsList] """ return sync_detailed( @@ -116,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[AlertUrgencyResponse | ErrorsList]: +) -> Response[Union[AlertUrgencyResponse, ErrorsList]]: """Delete an alert urgency Delete a specific alert urgency by id @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertUrgencyResponse | ErrorsList] + Response[Union[AlertUrgencyResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -145,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> AlertUrgencyResponse | ErrorsList | None: +) -> Optional[Union[AlertUrgencyResponse, ErrorsList]]: """Delete an alert urgency Delete a specific alert urgency by id @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertUrgencyResponse | ErrorsList + Union[AlertUrgencyResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/alert_urgencies/get_alert_urgency.py b/rootly_sdk/api/alert_urgencies/get_alert_urgency.py index 947f8dd9..ecf14a8e 100644 --- a/rootly_sdk/api/alert_urgencies/get_alert_urgency.py +++ b/rootly_sdk/api/alert_urgencies/get_alert_urgency.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/alert_urgencies/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/alert_urgencies/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AlertUrgencyResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[AlertUrgencyResponse, ErrorsList]]: if response.status_code == 200: response_200 = AlertUrgencyResponse.from_dict(response.json()) @@ -45,8 +41,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AlertUrgencyResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[AlertUrgencyResponse, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[AlertUrgencyResponse | ErrorsList]: +) -> Response[Union[AlertUrgencyResponse, ErrorsList]]: """Retrieves an alert urgency Retrieves a specific alert urgency by id @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertUrgencyResponse | ErrorsList] + Response[Union[AlertUrgencyResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -90,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> AlertUrgencyResponse | ErrorsList | None: +) -> Optional[Union[AlertUrgencyResponse, ErrorsList]]: """Retrieves an alert urgency Retrieves a specific alert urgency by id @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertUrgencyResponse | ErrorsList + Union[AlertUrgencyResponse, ErrorsList] """ return sync_detailed( @@ -116,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[AlertUrgencyResponse | ErrorsList]: +) -> Response[Union[AlertUrgencyResponse, ErrorsList]]: """Retrieves an alert urgency Retrieves a specific alert urgency by id @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertUrgencyResponse | ErrorsList] + Response[Union[AlertUrgencyResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -145,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> AlertUrgencyResponse | ErrorsList | None: +) -> Optional[Union[AlertUrgencyResponse, ErrorsList]]: """Retrieves an alert urgency Retrieves a specific alert urgency by id @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertUrgencyResponse | ErrorsList + Union[AlertUrgencyResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/alert_urgencies/list_alert_urgencies.py b/rootly_sdk/api/alert_urgencies/list_alert_urgencies.py index a4455d0f..130acb3b 100644 --- a/rootly_sdk/api/alert_urgencies/list_alert_urgencies.py +++ b/rootly_sdk/api/alert_urgencies/list_alert_urgencies.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -11,22 +11,21 @@ def _get_kwargs( *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -68,7 +67,9 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> AlertUrgencyList | None: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[AlertUrgencyList]: if response.status_code == 200: response_200 = AlertUrgencyList.from_dict(response.json()) @@ -80,7 +81,9 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[AlertUrgencyList]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[AlertUrgencyList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -92,40 +95,40 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, ) -> Response[AlertUrgencyList]: """List alert urgencies List alert urgencies Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -162,40 +165,40 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, -) -> AlertUrgencyList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, +) -> Optional[AlertUrgencyList]: """List alert urgencies List alert urgencies Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -227,40 +230,40 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, ) -> Response[AlertUrgencyList]: """List alert urgencies List alert urgencies Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -295,40 +298,40 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, -) -> AlertUrgencyList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, +) -> Optional[AlertUrgencyList]: """List alert urgencies List alert urgencies Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/alert_urgencies/update_alert_urgency.py b/rootly_sdk/api/alert_urgencies/update_alert_urgency.py index 2bef0a08..75c95584 100644 --- a/rootly_sdk/api/alert_urgencies/update_alert_urgency.py +++ b/rootly_sdk/api/alert_urgencies/update_alert_urgency.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/alert_urgencies/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/alert_urgencies/{id}", } _kwargs["json"] = body.to_dict() @@ -35,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AlertUrgencyResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[AlertUrgencyResponse, ErrorsList]]: if response.status_code == 200: response_200 = AlertUrgencyResponse.from_dict(response.json()) @@ -54,8 +51,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AlertUrgencyResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[AlertUrgencyResponse, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateAlertUrgency, -) -> Response[AlertUrgencyResponse | ErrorsList]: +) -> Response[Union[AlertUrgencyResponse, ErrorsList]]: """Update an alert urgency Update a specific alert urgency by id @@ -83,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertUrgencyResponse | ErrorsList] + Response[Union[AlertUrgencyResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -103,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateAlertUrgency, -) -> AlertUrgencyResponse | ErrorsList | None: +) -> Optional[Union[AlertUrgencyResponse, ErrorsList]]: """Update an alert urgency Update a specific alert urgency by id @@ -117,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertUrgencyResponse | ErrorsList + Union[AlertUrgencyResponse, ErrorsList] """ return sync_detailed( @@ -132,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateAlertUrgency, -) -> Response[AlertUrgencyResponse | ErrorsList]: +) -> Response[Union[AlertUrgencyResponse, ErrorsList]]: """Update an alert urgency Update a specific alert urgency by id @@ -146,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertUrgencyResponse | ErrorsList] + Response[Union[AlertUrgencyResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -164,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateAlertUrgency, -) -> AlertUrgencyResponse | ErrorsList | None: +) -> Optional[Union[AlertUrgencyResponse, ErrorsList]]: """Update an alert urgency Update a specific alert urgency by id @@ -178,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertUrgencyResponse | ErrorsList + Union[AlertUrgencyResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/alerts/acknowledge_alert.py b/rootly_sdk/api/alerts/acknowledge_alert.py index be8c6611..8529aae3 100644 --- a/rootly_sdk/api/alerts/acknowledge_alert.py +++ b/rootly_sdk/api/alerts/acknowledge_alert.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/alerts/{id}/acknowledge".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/alerts/{id}/acknowledge", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AlertResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[AlertResponse, ErrorsList]]: if response.status_code == 200: response_200 = AlertResponse.from_dict(response.json()) @@ -50,8 +46,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AlertResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[AlertResponse, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -64,7 +60,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[AlertResponse | ErrorsList]: +) -> Response[Union[AlertResponse, ErrorsList]]: """Acknowledges an alert Acknowledges a specific alert by id @@ -77,7 +73,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertResponse | ErrorsList] + Response[Union[AlertResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -95,7 +91,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> AlertResponse | ErrorsList | None: +) -> Optional[Union[AlertResponse, ErrorsList]]: """Acknowledges an alert Acknowledges a specific alert by id @@ -108,7 +104,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertResponse | ErrorsList + Union[AlertResponse, ErrorsList] """ return sync_detailed( @@ -121,7 +117,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[AlertResponse | ErrorsList]: +) -> Response[Union[AlertResponse, ErrorsList]]: """Acknowledges an alert Acknowledges a specific alert by id @@ -134,7 +130,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertResponse | ErrorsList] + Response[Union[AlertResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -150,7 +146,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> AlertResponse | ErrorsList | None: +) -> Optional[Union[AlertResponse, ErrorsList]]: """Acknowledges an alert Acknowledges a specific alert by id @@ -163,7 +159,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertResponse | ErrorsList + Union[AlertResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/alerts/attach_alert.py b/rootly_sdk/api/alerts/attach_alert.py index 3f0911e6..69f8b112 100644 --- a/rootly_sdk/api/alerts/attach_alert.py +++ b/rootly_sdk/api/alerts/attach_alert.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/incidents/{incident_id}/alerts".format( - incident_id=quote(str(incident_id), safe=""), - ), + "url": f"/v1/incidents/{incident_id}/alerts", } _kwargs["json"] = body.to_dict() @@ -34,7 +31,9 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> AlertList | ErrorsList | None: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[AlertList, ErrorsList]]: if response.status_code == 200: response_200 = AlertList.from_dict(response.json()) @@ -52,8 +51,8 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AlertList | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[AlertList, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -67,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: AttachAlert, -) -> Response[AlertList | ErrorsList]: +) -> Response[Union[AlertList, ErrorsList]]: """Attach alerts to an incident Attach alerts to an incident from provided data @@ -81,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertList | ErrorsList] + Response[Union[AlertList, ErrorsList]] """ kwargs = _get_kwargs( @@ -101,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: AttachAlert, -) -> AlertList | ErrorsList | None: +) -> Optional[Union[AlertList, ErrorsList]]: """Attach alerts to an incident Attach alerts to an incident from provided data @@ -115,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertList | ErrorsList + Union[AlertList, ErrorsList] """ return sync_detailed( @@ -130,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: AttachAlert, -) -> Response[AlertList | ErrorsList]: +) -> Response[Union[AlertList, ErrorsList]]: """Attach alerts to an incident Attach alerts to an incident from provided data @@ -144,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertList | ErrorsList] + Response[Union[AlertList, ErrorsList]] """ kwargs = _get_kwargs( @@ -162,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: AttachAlert, -) -> AlertList | ErrorsList | None: +) -> Optional[Union[AlertList, ErrorsList]]: """Attach alerts to an incident Attach alerts to an incident from provided data @@ -176,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertList | ErrorsList + Union[AlertList, ErrorsList] """ return ( diff --git a/rootly_sdk/api/alerts/create_alert.py b/rootly_sdk/api/alerts/create_alert.py index e7ef6e59..739c2cf6 100644 --- a/rootly_sdk/api/alerts/create_alert.py +++ b/rootly_sdk/api/alerts/create_alert.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AlertResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[AlertResponse, ErrorsList]]: if response.status_code == 201: response_201 = AlertResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AlertResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[AlertResponse, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +69,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewAlert, -) -> Response[AlertResponse | ErrorsList]: +) -> Response[Union[AlertResponse, ErrorsList]]: """Creates an alert Creates a new alert from provided data @@ -82,7 +82,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertResponse | ErrorsList] + Response[Union[AlertResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: NewAlert, -) -> AlertResponse | ErrorsList | None: +) -> Optional[Union[AlertResponse, ErrorsList]]: """Creates an alert Creates a new alert from provided data @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertResponse | ErrorsList + Union[AlertResponse, ErrorsList] """ return sync_detailed( @@ -126,7 +126,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewAlert, -) -> Response[AlertResponse | ErrorsList]: +) -> Response[Union[AlertResponse, ErrorsList]]: """Creates an alert Creates a new alert from provided data @@ -139,7 +139,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertResponse | ErrorsList] + Response[Union[AlertResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -155,7 +155,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewAlert, -) -> AlertResponse | ErrorsList | None: +) -> Optional[Union[AlertResponse, ErrorsList]]: """Creates an alert Creates a new alert from provided data @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertResponse | ErrorsList + Union[AlertResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/alerts/escalate_alert.py b/rootly_sdk/api/alerts/escalate_alert.py index c4a33380..5be96021 100644 --- a/rootly_sdk/api/alerts/escalate_alert.py +++ b/rootly_sdk/api/alerts/escalate_alert.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -9,25 +8,22 @@ from ...models.alert_response import AlertResponse from ...models.errors_list import ErrorsList from ...models.escalate_alert import EscalateAlert -from ...types import UNSET, Response, Unset +from ...types import Response def _get_kwargs( id: str, *, - body: EscalateAlert | Unset = UNSET, + body: EscalateAlert, ) -> dict[str, Any]: headers: dict[str, Any] = {} _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/alerts/{id}/escalate".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/alerts/{id}/escalate", } - if not isinstance(body, Unset): - _kwargs["json"] = body.to_dict() + _kwargs["json"] = body.to_dict() headers["Content-Type"] = "application/vnd.api+json" @@ -36,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AlertResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[AlertResponse, ErrorsList]]: if response.status_code == 200: response_200 = AlertResponse.from_dict(response.json()) @@ -65,8 +61,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AlertResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[AlertResponse, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -79,22 +75,22 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, - body: EscalateAlert | Unset = UNSET, -) -> Response[AlertResponse | ErrorsList]: + body: EscalateAlert, +) -> Response[Union[AlertResponse, ErrorsList]]: """Escalates an alert Escalates a specific alert to the next or specified level in its escalation policy Args: id (str): - body (EscalateAlert | Unset): + body (EscalateAlert): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertResponse | ErrorsList] + Response[Union[AlertResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -113,22 +109,22 @@ def sync( id: str, *, client: AuthenticatedClient, - body: EscalateAlert | Unset = UNSET, -) -> AlertResponse | ErrorsList | None: + body: EscalateAlert, +) -> Optional[Union[AlertResponse, ErrorsList]]: """Escalates an alert Escalates a specific alert to the next or specified level in its escalation policy Args: id (str): - body (EscalateAlert | Unset): + body (EscalateAlert): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertResponse | ErrorsList + Union[AlertResponse, ErrorsList] """ return sync_detailed( @@ -142,22 +138,22 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, - body: EscalateAlert | Unset = UNSET, -) -> Response[AlertResponse | ErrorsList]: + body: EscalateAlert, +) -> Response[Union[AlertResponse, ErrorsList]]: """Escalates an alert Escalates a specific alert to the next or specified level in its escalation policy Args: id (str): - body (EscalateAlert | Unset): + body (EscalateAlert): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertResponse | ErrorsList] + Response[Union[AlertResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -174,22 +170,22 @@ async def asyncio( id: str, *, client: AuthenticatedClient, - body: EscalateAlert | Unset = UNSET, -) -> AlertResponse | ErrorsList | None: + body: EscalateAlert, +) -> Optional[Union[AlertResponse, ErrorsList]]: """Escalates an alert Escalates a specific alert to the next or specified level in its escalation policy Args: id (str): - body (EscalateAlert | Unset): + body (EscalateAlert): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertResponse | ErrorsList + Union[AlertResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/alerts/get_alert.py b/rootly_sdk/api/alerts/get_alert.py index 20a1c7fd..037095a9 100644 --- a/rootly_sdk/api/alerts/get_alert.py +++ b/rootly_sdk/api/alerts/get_alert.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -15,12 +14,11 @@ def _get_kwargs( id: str, *, - include: GetAlertInclude | Unset = UNSET, + include: Union[Unset, GetAlertInclude] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} - json_include: str | Unset = UNSET + json_include: Union[Unset, str] = UNSET if not isinstance(include, Unset): json_include = include @@ -30,9 +28,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/alerts/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/alerts/{id}", "params": params, } @@ -40,8 +36,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AlertResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[AlertResponse, ErrorsList]]: if response.status_code == 200: response_200 = AlertResponse.from_dict(response.json()) @@ -59,8 +55,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AlertResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[AlertResponse, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -73,22 +69,22 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, - include: GetAlertInclude | Unset = UNSET, -) -> Response[AlertResponse | ErrorsList]: + include: Union[Unset, GetAlertInclude] = UNSET, +) -> Response[Union[AlertResponse, ErrorsList]]: """Retrieves an alert Retrieves a specific alert by id Args: id (str): - include (GetAlertInclude | Unset): + include (Union[Unset, GetAlertInclude]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertResponse | ErrorsList] + Response[Union[AlertResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -107,22 +103,22 @@ def sync( id: str, *, client: AuthenticatedClient, - include: GetAlertInclude | Unset = UNSET, -) -> AlertResponse | ErrorsList | None: + include: Union[Unset, GetAlertInclude] = UNSET, +) -> Optional[Union[AlertResponse, ErrorsList]]: """Retrieves an alert Retrieves a specific alert by id Args: id (str): - include (GetAlertInclude | Unset): + include (Union[Unset, GetAlertInclude]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertResponse | ErrorsList + Union[AlertResponse, ErrorsList] """ return sync_detailed( @@ -136,22 +132,22 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, - include: GetAlertInclude | Unset = UNSET, -) -> Response[AlertResponse | ErrorsList]: + include: Union[Unset, GetAlertInclude] = UNSET, +) -> Response[Union[AlertResponse, ErrorsList]]: """Retrieves an alert Retrieves a specific alert by id Args: id (str): - include (GetAlertInclude | Unset): + include (Union[Unset, GetAlertInclude]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertResponse | ErrorsList] + Response[Union[AlertResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -168,22 +164,22 @@ async def asyncio( id: str, *, client: AuthenticatedClient, - include: GetAlertInclude | Unset = UNSET, -) -> AlertResponse | ErrorsList | None: + include: Union[Unset, GetAlertInclude] = UNSET, +) -> Optional[Union[AlertResponse, ErrorsList]]: """Retrieves an alert Retrieves a specific alert by id Args: id (str): - include (GetAlertInclude | Unset): + include (Union[Unset, GetAlertInclude]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertResponse | ErrorsList + Union[AlertResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/alerts/get_receipt.py b/rootly_sdk/api/alerts/get_receipt.py index 0cd00675..56b056be 100644 --- a/rootly_sdk/api/alerts/get_receipt.py +++ b/rootly_sdk/api/alerts/get_receipt.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any, cast -from urllib.parse import quote +from typing import Any, Optional, Union, cast import httpx @@ -13,18 +12,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/alerts/receipts/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/alerts/receipts/{id}", } return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Any | Receipt | None: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, Receipt]]: if response.status_code == 200: response_200 = Receipt.from_dict(response.json()) @@ -40,7 +38,9 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Any | Receipt]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, Receipt]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -53,7 +53,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Any | Receipt]: +) -> Response[Union[Any, Receipt]]: """Get a receipt Retrieve the delivery receipt for a notification by ID, including its state and (when applicable) @@ -67,7 +67,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | Receipt] + Response[Union[Any, Receipt]] """ kwargs = _get_kwargs( @@ -85,7 +85,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Any | Receipt | None: +) -> Optional[Union[Any, Receipt]]: """Get a receipt Retrieve the delivery receipt for a notification by ID, including its state and (when applicable) @@ -99,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | Receipt + Union[Any, Receipt] """ return sync_detailed( @@ -112,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Any | Receipt]: +) -> Response[Union[Any, Receipt]]: """Get a receipt Retrieve the delivery receipt for a notification by ID, including its state and (when applicable) @@ -126,7 +126,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | Receipt] + Response[Union[Any, Receipt]] """ kwargs = _get_kwargs( @@ -142,7 +142,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Any | Receipt | None: +) -> Optional[Union[Any, Receipt]]: """Get a receipt Retrieve the delivery receipt for a notification by ID, including its state and (when applicable) @@ -156,7 +156,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | Receipt + Union[Any, Receipt] """ return ( diff --git a/rootly_sdk/api/alerts/list_alerts.py b/rootly_sdk/api/alerts/list_alerts.py index 6e36af8d..21ccb452 100644 --- a/rootly_sdk/api/alerts/list_alerts.py +++ b/rootly_sdk/api/alerts/list_alerts.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -12,61 +12,60 @@ def _get_kwargs( *, - include: ListAlertsInclude | Unset = UNSET, - filterstatus: str | Unset = UNSET, - filtersource: str | Unset = UNSET, - filterservices: str | Unset = UNSET, - filterenvironments: str | Unset = UNSET, - filtergroups: str | Unset = UNSET, - filterlabels: str | Unset = UNSET, - filterstarted_atgt: str | Unset = UNSET, - filterstarted_atgte: str | Unset = UNSET, - filterstarted_atlt: str | Unset = UNSET, - filterstarted_atlte: str | Unset = UNSET, - filterended_atgt: str | Unset = UNSET, - filterended_atgte: str | Unset = UNSET, - filterended_atlt: str | Unset = UNSET, - filterended_atlte: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterupdated_atgt: str | Unset = UNSET, - filterupdated_atgte: str | Unset = UNSET, - filterupdated_atlt: str | Unset = UNSET, - filterupdated_atlte: str | Unset = UNSET, - filterstatuseq: str | Unset = UNSET, - filterstatusnot_eq: str | Unset = UNSET, - filterstatusin: str | Unset = UNSET, - filterstatusnot_in: str | Unset = UNSET, - filtersourceeq: str | Unset = UNSET, - filtersourcenot_eq: str | Unset = UNSET, - filtersourcein: str | Unset = UNSET, - filtersourcenot_in: str | Unset = UNSET, - filterserviceseq: str | Unset = UNSET, - filterservicesnot_eq: str | Unset = UNSET, - filterservicesin: str | Unset = UNSET, - filterservicesnot_in: str | Unset = UNSET, - filtergroupseq: str | Unset = UNSET, - filtergroupsnot_eq: str | Unset = UNSET, - filtergroupsin: str | Unset = UNSET, - filtergroupsnot_in: str | Unset = UNSET, - filterenvironmentseq: str | Unset = UNSET, - filterenvironmentsnot_eq: str | Unset = UNSET, - filterenvironmentsin: str | Unset = UNSET, - filterenvironmentsnot_in: str | Unset = UNSET, - filterlabelseq: str | Unset = UNSET, - filterlabelsnot_eq: str | Unset = UNSET, - filterlabelsin: str | Unset = UNSET, - filterlabelsnot_in: str | Unset = UNSET, - pageafter: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Union[Unset, ListAlertsInclude] = UNSET, + filterstatus: Union[Unset, str] = UNSET, + filtersource: Union[Unset, str] = UNSET, + filterservices: Union[Unset, str] = UNSET, + filterenvironments: Union[Unset, str] = UNSET, + filtergroups: Union[Unset, str] = UNSET, + filterlabels: Union[Unset, str] = UNSET, + filterstarted_atgt: Union[Unset, str] = UNSET, + filterstarted_atgte: Union[Unset, str] = UNSET, + filterstarted_atlt: Union[Unset, str] = UNSET, + filterstarted_atlte: Union[Unset, str] = UNSET, + filterended_atgt: Union[Unset, str] = UNSET, + filterended_atgte: Union[Unset, str] = UNSET, + filterended_atlt: Union[Unset, str] = UNSET, + filterended_atlte: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filterupdated_atgt: Union[Unset, str] = UNSET, + filterupdated_atgte: Union[Unset, str] = UNSET, + filterupdated_atlt: Union[Unset, str] = UNSET, + filterupdated_atlte: Union[Unset, str] = UNSET, + filterstatuseq: Union[Unset, str] = UNSET, + filterstatusnot_eq: Union[Unset, str] = UNSET, + filterstatusin: Union[Unset, str] = UNSET, + filterstatusnot_in: Union[Unset, str] = UNSET, + filtersourceeq: Union[Unset, str] = UNSET, + filtersourcenot_eq: Union[Unset, str] = UNSET, + filtersourcein: Union[Unset, str] = UNSET, + filtersourcenot_in: Union[Unset, str] = UNSET, + filterserviceseq: Union[Unset, str] = UNSET, + filterservicesnot_eq: Union[Unset, str] = UNSET, + filterservicesin: Union[Unset, str] = UNSET, + filterservicesnot_in: Union[Unset, str] = UNSET, + filtergroupseq: Union[Unset, str] = UNSET, + filtergroupsnot_eq: Union[Unset, str] = UNSET, + filtergroupsin: Union[Unset, str] = UNSET, + filtergroupsnot_in: Union[Unset, str] = UNSET, + filterenvironmentseq: Union[Unset, str] = UNSET, + filterenvironmentsnot_eq: Union[Unset, str] = UNSET, + filterenvironmentsin: Union[Unset, str] = UNSET, + filterenvironmentsnot_in: Union[Unset, str] = UNSET, + filterlabelseq: Union[Unset, str] = UNSET, + filterlabelsnot_eq: Union[Unset, str] = UNSET, + filterlabelsin: Union[Unset, str] = UNSET, + filterlabelsnot_in: Union[Unset, str] = UNSET, + pageafter: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} - json_include: str | Unset = UNSET + json_include: Union[Unset, str] = UNSET if not isinstance(include, Unset): json_include = include @@ -181,7 +180,7 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> AlertList | None: +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[AlertList]: if response.status_code == 200: response_200 = AlertList.from_dict(response.json()) @@ -193,7 +192,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[AlertList]: +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[AlertList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -205,112 +204,112 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - include: ListAlertsInclude | Unset = UNSET, - filterstatus: str | Unset = UNSET, - filtersource: str | Unset = UNSET, - filterservices: str | Unset = UNSET, - filterenvironments: str | Unset = UNSET, - filtergroups: str | Unset = UNSET, - filterlabels: str | Unset = UNSET, - filterstarted_atgt: str | Unset = UNSET, - filterstarted_atgte: str | Unset = UNSET, - filterstarted_atlt: str | Unset = UNSET, - filterstarted_atlte: str | Unset = UNSET, - filterended_atgt: str | Unset = UNSET, - filterended_atgte: str | Unset = UNSET, - filterended_atlt: str | Unset = UNSET, - filterended_atlte: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterupdated_atgt: str | Unset = UNSET, - filterupdated_atgte: str | Unset = UNSET, - filterupdated_atlt: str | Unset = UNSET, - filterupdated_atlte: str | Unset = UNSET, - filterstatuseq: str | Unset = UNSET, - filterstatusnot_eq: str | Unset = UNSET, - filterstatusin: str | Unset = UNSET, - filterstatusnot_in: str | Unset = UNSET, - filtersourceeq: str | Unset = UNSET, - filtersourcenot_eq: str | Unset = UNSET, - filtersourcein: str | Unset = UNSET, - filtersourcenot_in: str | Unset = UNSET, - filterserviceseq: str | Unset = UNSET, - filterservicesnot_eq: str | Unset = UNSET, - filterservicesin: str | Unset = UNSET, - filterservicesnot_in: str | Unset = UNSET, - filtergroupseq: str | Unset = UNSET, - filtergroupsnot_eq: str | Unset = UNSET, - filtergroupsin: str | Unset = UNSET, - filtergroupsnot_in: str | Unset = UNSET, - filterenvironmentseq: str | Unset = UNSET, - filterenvironmentsnot_eq: str | Unset = UNSET, - filterenvironmentsin: str | Unset = UNSET, - filterenvironmentsnot_in: str | Unset = UNSET, - filterlabelseq: str | Unset = UNSET, - filterlabelsnot_eq: str | Unset = UNSET, - filterlabelsin: str | Unset = UNSET, - filterlabelsnot_in: str | Unset = UNSET, - pageafter: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Union[Unset, ListAlertsInclude] = UNSET, + filterstatus: Union[Unset, str] = UNSET, + filtersource: Union[Unset, str] = UNSET, + filterservices: Union[Unset, str] = UNSET, + filterenvironments: Union[Unset, str] = UNSET, + filtergroups: Union[Unset, str] = UNSET, + filterlabels: Union[Unset, str] = UNSET, + filterstarted_atgt: Union[Unset, str] = UNSET, + filterstarted_atgte: Union[Unset, str] = UNSET, + filterstarted_atlt: Union[Unset, str] = UNSET, + filterstarted_atlte: Union[Unset, str] = UNSET, + filterended_atgt: Union[Unset, str] = UNSET, + filterended_atgte: Union[Unset, str] = UNSET, + filterended_atlt: Union[Unset, str] = UNSET, + filterended_atlte: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filterupdated_atgt: Union[Unset, str] = UNSET, + filterupdated_atgte: Union[Unset, str] = UNSET, + filterupdated_atlt: Union[Unset, str] = UNSET, + filterupdated_atlte: Union[Unset, str] = UNSET, + filterstatuseq: Union[Unset, str] = UNSET, + filterstatusnot_eq: Union[Unset, str] = UNSET, + filterstatusin: Union[Unset, str] = UNSET, + filterstatusnot_in: Union[Unset, str] = UNSET, + filtersourceeq: Union[Unset, str] = UNSET, + filtersourcenot_eq: Union[Unset, str] = UNSET, + filtersourcein: Union[Unset, str] = UNSET, + filtersourcenot_in: Union[Unset, str] = UNSET, + filterserviceseq: Union[Unset, str] = UNSET, + filterservicesnot_eq: Union[Unset, str] = UNSET, + filterservicesin: Union[Unset, str] = UNSET, + filterservicesnot_in: Union[Unset, str] = UNSET, + filtergroupseq: Union[Unset, str] = UNSET, + filtergroupsnot_eq: Union[Unset, str] = UNSET, + filtergroupsin: Union[Unset, str] = UNSET, + filtergroupsnot_in: Union[Unset, str] = UNSET, + filterenvironmentseq: Union[Unset, str] = UNSET, + filterenvironmentsnot_eq: Union[Unset, str] = UNSET, + filterenvironmentsin: Union[Unset, str] = UNSET, + filterenvironmentsnot_in: Union[Unset, str] = UNSET, + filterlabelseq: Union[Unset, str] = UNSET, + filterlabelsnot_eq: Union[Unset, str] = UNSET, + filterlabelsin: Union[Unset, str] = UNSET, + filterlabelsnot_in: Union[Unset, str] = UNSET, + pageafter: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, ) -> Response[AlertList]: """List alerts List alerts Args: - include (ListAlertsInclude | Unset): - filterstatus (str | Unset): - filtersource (str | Unset): - filterservices (str | Unset): - filterenvironments (str | Unset): - filtergroups (str | Unset): - filterlabels (str | Unset): - filterstarted_atgt (str | Unset): - filterstarted_atgte (str | Unset): - filterstarted_atlt (str | Unset): - filterstarted_atlte (str | Unset): - filterended_atgt (str | Unset): - filterended_atgte (str | Unset): - filterended_atlt (str | Unset): - filterended_atlte (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterupdated_atgt (str | Unset): - filterupdated_atgte (str | Unset): - filterupdated_atlt (str | Unset): - filterupdated_atlte (str | Unset): - filterstatuseq (str | Unset): - filterstatusnot_eq (str | Unset): - filterstatusin (str | Unset): - filterstatusnot_in (str | Unset): - filtersourceeq (str | Unset): - filtersourcenot_eq (str | Unset): - filtersourcein (str | Unset): - filtersourcenot_in (str | Unset): - filterserviceseq (str | Unset): - filterservicesnot_eq (str | Unset): - filterservicesin (str | Unset): - filterservicesnot_in (str | Unset): - filtergroupseq (str | Unset): - filtergroupsnot_eq (str | Unset): - filtergroupsin (str | Unset): - filtergroupsnot_in (str | Unset): - filterenvironmentseq (str | Unset): - filterenvironmentsnot_eq (str | Unset): - filterenvironmentsin (str | Unset): - filterenvironmentsnot_in (str | Unset): - filterlabelseq (str | Unset): - filterlabelsnot_eq (str | Unset): - filterlabelsin (str | Unset): - filterlabelsnot_in (str | Unset): - pageafter (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, ListAlertsInclude]): + filterstatus (Union[Unset, str]): + filtersource (Union[Unset, str]): + filterservices (Union[Unset, str]): + filterenvironments (Union[Unset, str]): + filtergroups (Union[Unset, str]): + filterlabels (Union[Unset, str]): + filterstarted_atgt (Union[Unset, str]): + filterstarted_atgte (Union[Unset, str]): + filterstarted_atlt (Union[Unset, str]): + filterstarted_atlte (Union[Unset, str]): + filterended_atgt (Union[Unset, str]): + filterended_atgte (Union[Unset, str]): + filterended_atlt (Union[Unset, str]): + filterended_atlte (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterupdated_atgt (Union[Unset, str]): + filterupdated_atgte (Union[Unset, str]): + filterupdated_atlt (Union[Unset, str]): + filterupdated_atlte (Union[Unset, str]): + filterstatuseq (Union[Unset, str]): + filterstatusnot_eq (Union[Unset, str]): + filterstatusin (Union[Unset, str]): + filterstatusnot_in (Union[Unset, str]): + filtersourceeq (Union[Unset, str]): + filtersourcenot_eq (Union[Unset, str]): + filtersourcein (Union[Unset, str]): + filtersourcenot_in (Union[Unset, str]): + filterserviceseq (Union[Unset, str]): + filterservicesnot_eq (Union[Unset, str]): + filterservicesin (Union[Unset, str]): + filterservicesnot_in (Union[Unset, str]): + filtergroupseq (Union[Unset, str]): + filtergroupsnot_eq (Union[Unset, str]): + filtergroupsin (Union[Unset, str]): + filtergroupsnot_in (Union[Unset, str]): + filterenvironmentseq (Union[Unset, str]): + filterenvironmentsnot_eq (Union[Unset, str]): + filterenvironmentsin (Union[Unset, str]): + filterenvironmentsnot_in (Union[Unset, str]): + filterlabelseq (Union[Unset, str]): + filterlabelsnot_eq (Union[Unset, str]): + filterlabelsin (Union[Unset, str]): + filterlabelsnot_in (Union[Unset, str]): + pageafter (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -383,112 +382,112 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: ListAlertsInclude | Unset = UNSET, - filterstatus: str | Unset = UNSET, - filtersource: str | Unset = UNSET, - filterservices: str | Unset = UNSET, - filterenvironments: str | Unset = UNSET, - filtergroups: str | Unset = UNSET, - filterlabels: str | Unset = UNSET, - filterstarted_atgt: str | Unset = UNSET, - filterstarted_atgte: str | Unset = UNSET, - filterstarted_atlt: str | Unset = UNSET, - filterstarted_atlte: str | Unset = UNSET, - filterended_atgt: str | Unset = UNSET, - filterended_atgte: str | Unset = UNSET, - filterended_atlt: str | Unset = UNSET, - filterended_atlte: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterupdated_atgt: str | Unset = UNSET, - filterupdated_atgte: str | Unset = UNSET, - filterupdated_atlt: str | Unset = UNSET, - filterupdated_atlte: str | Unset = UNSET, - filterstatuseq: str | Unset = UNSET, - filterstatusnot_eq: str | Unset = UNSET, - filterstatusin: str | Unset = UNSET, - filterstatusnot_in: str | Unset = UNSET, - filtersourceeq: str | Unset = UNSET, - filtersourcenot_eq: str | Unset = UNSET, - filtersourcein: str | Unset = UNSET, - filtersourcenot_in: str | Unset = UNSET, - filterserviceseq: str | Unset = UNSET, - filterservicesnot_eq: str | Unset = UNSET, - filterservicesin: str | Unset = UNSET, - filterservicesnot_in: str | Unset = UNSET, - filtergroupseq: str | Unset = UNSET, - filtergroupsnot_eq: str | Unset = UNSET, - filtergroupsin: str | Unset = UNSET, - filtergroupsnot_in: str | Unset = UNSET, - filterenvironmentseq: str | Unset = UNSET, - filterenvironmentsnot_eq: str | Unset = UNSET, - filterenvironmentsin: str | Unset = UNSET, - filterenvironmentsnot_in: str | Unset = UNSET, - filterlabelseq: str | Unset = UNSET, - filterlabelsnot_eq: str | Unset = UNSET, - filterlabelsin: str | Unset = UNSET, - filterlabelsnot_in: str | Unset = UNSET, - pageafter: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, -) -> AlertList | None: + include: Union[Unset, ListAlertsInclude] = UNSET, + filterstatus: Union[Unset, str] = UNSET, + filtersource: Union[Unset, str] = UNSET, + filterservices: Union[Unset, str] = UNSET, + filterenvironments: Union[Unset, str] = UNSET, + filtergroups: Union[Unset, str] = UNSET, + filterlabels: Union[Unset, str] = UNSET, + filterstarted_atgt: Union[Unset, str] = UNSET, + filterstarted_atgte: Union[Unset, str] = UNSET, + filterstarted_atlt: Union[Unset, str] = UNSET, + filterstarted_atlte: Union[Unset, str] = UNSET, + filterended_atgt: Union[Unset, str] = UNSET, + filterended_atgte: Union[Unset, str] = UNSET, + filterended_atlt: Union[Unset, str] = UNSET, + filterended_atlte: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filterupdated_atgt: Union[Unset, str] = UNSET, + filterupdated_atgte: Union[Unset, str] = UNSET, + filterupdated_atlt: Union[Unset, str] = UNSET, + filterupdated_atlte: Union[Unset, str] = UNSET, + filterstatuseq: Union[Unset, str] = UNSET, + filterstatusnot_eq: Union[Unset, str] = UNSET, + filterstatusin: Union[Unset, str] = UNSET, + filterstatusnot_in: Union[Unset, str] = UNSET, + filtersourceeq: Union[Unset, str] = UNSET, + filtersourcenot_eq: Union[Unset, str] = UNSET, + filtersourcein: Union[Unset, str] = UNSET, + filtersourcenot_in: Union[Unset, str] = UNSET, + filterserviceseq: Union[Unset, str] = UNSET, + filterservicesnot_eq: Union[Unset, str] = UNSET, + filterservicesin: Union[Unset, str] = UNSET, + filterservicesnot_in: Union[Unset, str] = UNSET, + filtergroupseq: Union[Unset, str] = UNSET, + filtergroupsnot_eq: Union[Unset, str] = UNSET, + filtergroupsin: Union[Unset, str] = UNSET, + filtergroupsnot_in: Union[Unset, str] = UNSET, + filterenvironmentseq: Union[Unset, str] = UNSET, + filterenvironmentsnot_eq: Union[Unset, str] = UNSET, + filterenvironmentsin: Union[Unset, str] = UNSET, + filterenvironmentsnot_in: Union[Unset, str] = UNSET, + filterlabelseq: Union[Unset, str] = UNSET, + filterlabelsnot_eq: Union[Unset, str] = UNSET, + filterlabelsin: Union[Unset, str] = UNSET, + filterlabelsnot_in: Union[Unset, str] = UNSET, + pageafter: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, +) -> Optional[AlertList]: """List alerts List alerts Args: - include (ListAlertsInclude | Unset): - filterstatus (str | Unset): - filtersource (str | Unset): - filterservices (str | Unset): - filterenvironments (str | Unset): - filtergroups (str | Unset): - filterlabels (str | Unset): - filterstarted_atgt (str | Unset): - filterstarted_atgte (str | Unset): - filterstarted_atlt (str | Unset): - filterstarted_atlte (str | Unset): - filterended_atgt (str | Unset): - filterended_atgte (str | Unset): - filterended_atlt (str | Unset): - filterended_atlte (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterupdated_atgt (str | Unset): - filterupdated_atgte (str | Unset): - filterupdated_atlt (str | Unset): - filterupdated_atlte (str | Unset): - filterstatuseq (str | Unset): - filterstatusnot_eq (str | Unset): - filterstatusin (str | Unset): - filterstatusnot_in (str | Unset): - filtersourceeq (str | Unset): - filtersourcenot_eq (str | Unset): - filtersourcein (str | Unset): - filtersourcenot_in (str | Unset): - filterserviceseq (str | Unset): - filterservicesnot_eq (str | Unset): - filterservicesin (str | Unset): - filterservicesnot_in (str | Unset): - filtergroupseq (str | Unset): - filtergroupsnot_eq (str | Unset): - filtergroupsin (str | Unset): - filtergroupsnot_in (str | Unset): - filterenvironmentseq (str | Unset): - filterenvironmentsnot_eq (str | Unset): - filterenvironmentsin (str | Unset): - filterenvironmentsnot_in (str | Unset): - filterlabelseq (str | Unset): - filterlabelsnot_eq (str | Unset): - filterlabelsin (str | Unset): - filterlabelsnot_in (str | Unset): - pageafter (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, ListAlertsInclude]): + filterstatus (Union[Unset, str]): + filtersource (Union[Unset, str]): + filterservices (Union[Unset, str]): + filterenvironments (Union[Unset, str]): + filtergroups (Union[Unset, str]): + filterlabels (Union[Unset, str]): + filterstarted_atgt (Union[Unset, str]): + filterstarted_atgte (Union[Unset, str]): + filterstarted_atlt (Union[Unset, str]): + filterstarted_atlte (Union[Unset, str]): + filterended_atgt (Union[Unset, str]): + filterended_atgte (Union[Unset, str]): + filterended_atlt (Union[Unset, str]): + filterended_atlte (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterupdated_atgt (Union[Unset, str]): + filterupdated_atgte (Union[Unset, str]): + filterupdated_atlt (Union[Unset, str]): + filterupdated_atlte (Union[Unset, str]): + filterstatuseq (Union[Unset, str]): + filterstatusnot_eq (Union[Unset, str]): + filterstatusin (Union[Unset, str]): + filterstatusnot_in (Union[Unset, str]): + filtersourceeq (Union[Unset, str]): + filtersourcenot_eq (Union[Unset, str]): + filtersourcein (Union[Unset, str]): + filtersourcenot_in (Union[Unset, str]): + filterserviceseq (Union[Unset, str]): + filterservicesnot_eq (Union[Unset, str]): + filterservicesin (Union[Unset, str]): + filterservicesnot_in (Union[Unset, str]): + filtergroupseq (Union[Unset, str]): + filtergroupsnot_eq (Union[Unset, str]): + filtergroupsin (Union[Unset, str]): + filtergroupsnot_in (Union[Unset, str]): + filterenvironmentseq (Union[Unset, str]): + filterenvironmentsnot_eq (Union[Unset, str]): + filterenvironmentsin (Union[Unset, str]): + filterenvironmentsnot_in (Union[Unset, str]): + filterlabelseq (Union[Unset, str]): + filterlabelsnot_eq (Union[Unset, str]): + filterlabelsin (Union[Unset, str]): + filterlabelsnot_in (Union[Unset, str]): + pageafter (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -556,112 +555,112 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: ListAlertsInclude | Unset = UNSET, - filterstatus: str | Unset = UNSET, - filtersource: str | Unset = UNSET, - filterservices: str | Unset = UNSET, - filterenvironments: str | Unset = UNSET, - filtergroups: str | Unset = UNSET, - filterlabels: str | Unset = UNSET, - filterstarted_atgt: str | Unset = UNSET, - filterstarted_atgte: str | Unset = UNSET, - filterstarted_atlt: str | Unset = UNSET, - filterstarted_atlte: str | Unset = UNSET, - filterended_atgt: str | Unset = UNSET, - filterended_atgte: str | Unset = UNSET, - filterended_atlt: str | Unset = UNSET, - filterended_atlte: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterupdated_atgt: str | Unset = UNSET, - filterupdated_atgte: str | Unset = UNSET, - filterupdated_atlt: str | Unset = UNSET, - filterupdated_atlte: str | Unset = UNSET, - filterstatuseq: str | Unset = UNSET, - filterstatusnot_eq: str | Unset = UNSET, - filterstatusin: str | Unset = UNSET, - filterstatusnot_in: str | Unset = UNSET, - filtersourceeq: str | Unset = UNSET, - filtersourcenot_eq: str | Unset = UNSET, - filtersourcein: str | Unset = UNSET, - filtersourcenot_in: str | Unset = UNSET, - filterserviceseq: str | Unset = UNSET, - filterservicesnot_eq: str | Unset = UNSET, - filterservicesin: str | Unset = UNSET, - filterservicesnot_in: str | Unset = UNSET, - filtergroupseq: str | Unset = UNSET, - filtergroupsnot_eq: str | Unset = UNSET, - filtergroupsin: str | Unset = UNSET, - filtergroupsnot_in: str | Unset = UNSET, - filterenvironmentseq: str | Unset = UNSET, - filterenvironmentsnot_eq: str | Unset = UNSET, - filterenvironmentsin: str | Unset = UNSET, - filterenvironmentsnot_in: str | Unset = UNSET, - filterlabelseq: str | Unset = UNSET, - filterlabelsnot_eq: str | Unset = UNSET, - filterlabelsin: str | Unset = UNSET, - filterlabelsnot_in: str | Unset = UNSET, - pageafter: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Union[Unset, ListAlertsInclude] = UNSET, + filterstatus: Union[Unset, str] = UNSET, + filtersource: Union[Unset, str] = UNSET, + filterservices: Union[Unset, str] = UNSET, + filterenvironments: Union[Unset, str] = UNSET, + filtergroups: Union[Unset, str] = UNSET, + filterlabels: Union[Unset, str] = UNSET, + filterstarted_atgt: Union[Unset, str] = UNSET, + filterstarted_atgte: Union[Unset, str] = UNSET, + filterstarted_atlt: Union[Unset, str] = UNSET, + filterstarted_atlte: Union[Unset, str] = UNSET, + filterended_atgt: Union[Unset, str] = UNSET, + filterended_atgte: Union[Unset, str] = UNSET, + filterended_atlt: Union[Unset, str] = UNSET, + filterended_atlte: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filterupdated_atgt: Union[Unset, str] = UNSET, + filterupdated_atgte: Union[Unset, str] = UNSET, + filterupdated_atlt: Union[Unset, str] = UNSET, + filterupdated_atlte: Union[Unset, str] = UNSET, + filterstatuseq: Union[Unset, str] = UNSET, + filterstatusnot_eq: Union[Unset, str] = UNSET, + filterstatusin: Union[Unset, str] = UNSET, + filterstatusnot_in: Union[Unset, str] = UNSET, + filtersourceeq: Union[Unset, str] = UNSET, + filtersourcenot_eq: Union[Unset, str] = UNSET, + filtersourcein: Union[Unset, str] = UNSET, + filtersourcenot_in: Union[Unset, str] = UNSET, + filterserviceseq: Union[Unset, str] = UNSET, + filterservicesnot_eq: Union[Unset, str] = UNSET, + filterservicesin: Union[Unset, str] = UNSET, + filterservicesnot_in: Union[Unset, str] = UNSET, + filtergroupseq: Union[Unset, str] = UNSET, + filtergroupsnot_eq: Union[Unset, str] = UNSET, + filtergroupsin: Union[Unset, str] = UNSET, + filtergroupsnot_in: Union[Unset, str] = UNSET, + filterenvironmentseq: Union[Unset, str] = UNSET, + filterenvironmentsnot_eq: Union[Unset, str] = UNSET, + filterenvironmentsin: Union[Unset, str] = UNSET, + filterenvironmentsnot_in: Union[Unset, str] = UNSET, + filterlabelseq: Union[Unset, str] = UNSET, + filterlabelsnot_eq: Union[Unset, str] = UNSET, + filterlabelsin: Union[Unset, str] = UNSET, + filterlabelsnot_in: Union[Unset, str] = UNSET, + pageafter: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, ) -> Response[AlertList]: """List alerts List alerts Args: - include (ListAlertsInclude | Unset): - filterstatus (str | Unset): - filtersource (str | Unset): - filterservices (str | Unset): - filterenvironments (str | Unset): - filtergroups (str | Unset): - filterlabels (str | Unset): - filterstarted_atgt (str | Unset): - filterstarted_atgte (str | Unset): - filterstarted_atlt (str | Unset): - filterstarted_atlte (str | Unset): - filterended_atgt (str | Unset): - filterended_atgte (str | Unset): - filterended_atlt (str | Unset): - filterended_atlte (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterupdated_atgt (str | Unset): - filterupdated_atgte (str | Unset): - filterupdated_atlt (str | Unset): - filterupdated_atlte (str | Unset): - filterstatuseq (str | Unset): - filterstatusnot_eq (str | Unset): - filterstatusin (str | Unset): - filterstatusnot_in (str | Unset): - filtersourceeq (str | Unset): - filtersourcenot_eq (str | Unset): - filtersourcein (str | Unset): - filtersourcenot_in (str | Unset): - filterserviceseq (str | Unset): - filterservicesnot_eq (str | Unset): - filterservicesin (str | Unset): - filterservicesnot_in (str | Unset): - filtergroupseq (str | Unset): - filtergroupsnot_eq (str | Unset): - filtergroupsin (str | Unset): - filtergroupsnot_in (str | Unset): - filterenvironmentseq (str | Unset): - filterenvironmentsnot_eq (str | Unset): - filterenvironmentsin (str | Unset): - filterenvironmentsnot_in (str | Unset): - filterlabelseq (str | Unset): - filterlabelsnot_eq (str | Unset): - filterlabelsin (str | Unset): - filterlabelsnot_in (str | Unset): - pageafter (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, ListAlertsInclude]): + filterstatus (Union[Unset, str]): + filtersource (Union[Unset, str]): + filterservices (Union[Unset, str]): + filterenvironments (Union[Unset, str]): + filtergroups (Union[Unset, str]): + filterlabels (Union[Unset, str]): + filterstarted_atgt (Union[Unset, str]): + filterstarted_atgte (Union[Unset, str]): + filterstarted_atlt (Union[Unset, str]): + filterstarted_atlte (Union[Unset, str]): + filterended_atgt (Union[Unset, str]): + filterended_atgte (Union[Unset, str]): + filterended_atlt (Union[Unset, str]): + filterended_atlte (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterupdated_atgt (Union[Unset, str]): + filterupdated_atgte (Union[Unset, str]): + filterupdated_atlt (Union[Unset, str]): + filterupdated_atlte (Union[Unset, str]): + filterstatuseq (Union[Unset, str]): + filterstatusnot_eq (Union[Unset, str]): + filterstatusin (Union[Unset, str]): + filterstatusnot_in (Union[Unset, str]): + filtersourceeq (Union[Unset, str]): + filtersourcenot_eq (Union[Unset, str]): + filtersourcein (Union[Unset, str]): + filtersourcenot_in (Union[Unset, str]): + filterserviceseq (Union[Unset, str]): + filterservicesnot_eq (Union[Unset, str]): + filterservicesin (Union[Unset, str]): + filterservicesnot_in (Union[Unset, str]): + filtergroupseq (Union[Unset, str]): + filtergroupsnot_eq (Union[Unset, str]): + filtergroupsin (Union[Unset, str]): + filtergroupsnot_in (Union[Unset, str]): + filterenvironmentseq (Union[Unset, str]): + filterenvironmentsnot_eq (Union[Unset, str]): + filterenvironmentsin (Union[Unset, str]): + filterenvironmentsnot_in (Union[Unset, str]): + filterlabelseq (Union[Unset, str]): + filterlabelsnot_eq (Union[Unset, str]): + filterlabelsin (Union[Unset, str]): + filterlabelsnot_in (Union[Unset, str]): + pageafter (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -732,112 +731,112 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: ListAlertsInclude | Unset = UNSET, - filterstatus: str | Unset = UNSET, - filtersource: str | Unset = UNSET, - filterservices: str | Unset = UNSET, - filterenvironments: str | Unset = UNSET, - filtergroups: str | Unset = UNSET, - filterlabels: str | Unset = UNSET, - filterstarted_atgt: str | Unset = UNSET, - filterstarted_atgte: str | Unset = UNSET, - filterstarted_atlt: str | Unset = UNSET, - filterstarted_atlte: str | Unset = UNSET, - filterended_atgt: str | Unset = UNSET, - filterended_atgte: str | Unset = UNSET, - filterended_atlt: str | Unset = UNSET, - filterended_atlte: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterupdated_atgt: str | Unset = UNSET, - filterupdated_atgte: str | Unset = UNSET, - filterupdated_atlt: str | Unset = UNSET, - filterupdated_atlte: str | Unset = UNSET, - filterstatuseq: str | Unset = UNSET, - filterstatusnot_eq: str | Unset = UNSET, - filterstatusin: str | Unset = UNSET, - filterstatusnot_in: str | Unset = UNSET, - filtersourceeq: str | Unset = UNSET, - filtersourcenot_eq: str | Unset = UNSET, - filtersourcein: str | Unset = UNSET, - filtersourcenot_in: str | Unset = UNSET, - filterserviceseq: str | Unset = UNSET, - filterservicesnot_eq: str | Unset = UNSET, - filterservicesin: str | Unset = UNSET, - filterservicesnot_in: str | Unset = UNSET, - filtergroupseq: str | Unset = UNSET, - filtergroupsnot_eq: str | Unset = UNSET, - filtergroupsin: str | Unset = UNSET, - filtergroupsnot_in: str | Unset = UNSET, - filterenvironmentseq: str | Unset = UNSET, - filterenvironmentsnot_eq: str | Unset = UNSET, - filterenvironmentsin: str | Unset = UNSET, - filterenvironmentsnot_in: str | Unset = UNSET, - filterlabelseq: str | Unset = UNSET, - filterlabelsnot_eq: str | Unset = UNSET, - filterlabelsin: str | Unset = UNSET, - filterlabelsnot_in: str | Unset = UNSET, - pageafter: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, -) -> AlertList | None: + include: Union[Unset, ListAlertsInclude] = UNSET, + filterstatus: Union[Unset, str] = UNSET, + filtersource: Union[Unset, str] = UNSET, + filterservices: Union[Unset, str] = UNSET, + filterenvironments: Union[Unset, str] = UNSET, + filtergroups: Union[Unset, str] = UNSET, + filterlabels: Union[Unset, str] = UNSET, + filterstarted_atgt: Union[Unset, str] = UNSET, + filterstarted_atgte: Union[Unset, str] = UNSET, + filterstarted_atlt: Union[Unset, str] = UNSET, + filterstarted_atlte: Union[Unset, str] = UNSET, + filterended_atgt: Union[Unset, str] = UNSET, + filterended_atgte: Union[Unset, str] = UNSET, + filterended_atlt: Union[Unset, str] = UNSET, + filterended_atlte: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filterupdated_atgt: Union[Unset, str] = UNSET, + filterupdated_atgte: Union[Unset, str] = UNSET, + filterupdated_atlt: Union[Unset, str] = UNSET, + filterupdated_atlte: Union[Unset, str] = UNSET, + filterstatuseq: Union[Unset, str] = UNSET, + filterstatusnot_eq: Union[Unset, str] = UNSET, + filterstatusin: Union[Unset, str] = UNSET, + filterstatusnot_in: Union[Unset, str] = UNSET, + filtersourceeq: Union[Unset, str] = UNSET, + filtersourcenot_eq: Union[Unset, str] = UNSET, + filtersourcein: Union[Unset, str] = UNSET, + filtersourcenot_in: Union[Unset, str] = UNSET, + filterserviceseq: Union[Unset, str] = UNSET, + filterservicesnot_eq: Union[Unset, str] = UNSET, + filterservicesin: Union[Unset, str] = UNSET, + filterservicesnot_in: Union[Unset, str] = UNSET, + filtergroupseq: Union[Unset, str] = UNSET, + filtergroupsnot_eq: Union[Unset, str] = UNSET, + filtergroupsin: Union[Unset, str] = UNSET, + filtergroupsnot_in: Union[Unset, str] = UNSET, + filterenvironmentseq: Union[Unset, str] = UNSET, + filterenvironmentsnot_eq: Union[Unset, str] = UNSET, + filterenvironmentsin: Union[Unset, str] = UNSET, + filterenvironmentsnot_in: Union[Unset, str] = UNSET, + filterlabelseq: Union[Unset, str] = UNSET, + filterlabelsnot_eq: Union[Unset, str] = UNSET, + filterlabelsin: Union[Unset, str] = UNSET, + filterlabelsnot_in: Union[Unset, str] = UNSET, + pageafter: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, +) -> Optional[AlertList]: """List alerts List alerts Args: - include (ListAlertsInclude | Unset): - filterstatus (str | Unset): - filtersource (str | Unset): - filterservices (str | Unset): - filterenvironments (str | Unset): - filtergroups (str | Unset): - filterlabels (str | Unset): - filterstarted_atgt (str | Unset): - filterstarted_atgte (str | Unset): - filterstarted_atlt (str | Unset): - filterstarted_atlte (str | Unset): - filterended_atgt (str | Unset): - filterended_atgte (str | Unset): - filterended_atlt (str | Unset): - filterended_atlte (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterupdated_atgt (str | Unset): - filterupdated_atgte (str | Unset): - filterupdated_atlt (str | Unset): - filterupdated_atlte (str | Unset): - filterstatuseq (str | Unset): - filterstatusnot_eq (str | Unset): - filterstatusin (str | Unset): - filterstatusnot_in (str | Unset): - filtersourceeq (str | Unset): - filtersourcenot_eq (str | Unset): - filtersourcein (str | Unset): - filtersourcenot_in (str | Unset): - filterserviceseq (str | Unset): - filterservicesnot_eq (str | Unset): - filterservicesin (str | Unset): - filterservicesnot_in (str | Unset): - filtergroupseq (str | Unset): - filtergroupsnot_eq (str | Unset): - filtergroupsin (str | Unset): - filtergroupsnot_in (str | Unset): - filterenvironmentseq (str | Unset): - filterenvironmentsnot_eq (str | Unset): - filterenvironmentsin (str | Unset): - filterenvironmentsnot_in (str | Unset): - filterlabelseq (str | Unset): - filterlabelsnot_eq (str | Unset): - filterlabelsin (str | Unset): - filterlabelsnot_in (str | Unset): - pageafter (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, ListAlertsInclude]): + filterstatus (Union[Unset, str]): + filtersource (Union[Unset, str]): + filterservices (Union[Unset, str]): + filterenvironments (Union[Unset, str]): + filtergroups (Union[Unset, str]): + filterlabels (Union[Unset, str]): + filterstarted_atgt (Union[Unset, str]): + filterstarted_atgte (Union[Unset, str]): + filterstarted_atlt (Union[Unset, str]): + filterstarted_atlte (Union[Unset, str]): + filterended_atgt (Union[Unset, str]): + filterended_atgte (Union[Unset, str]): + filterended_atlt (Union[Unset, str]): + filterended_atlte (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterupdated_atgt (Union[Unset, str]): + filterupdated_atgte (Union[Unset, str]): + filterupdated_atlt (Union[Unset, str]): + filterupdated_atlte (Union[Unset, str]): + filterstatuseq (Union[Unset, str]): + filterstatusnot_eq (Union[Unset, str]): + filterstatusin (Union[Unset, str]): + filterstatusnot_in (Union[Unset, str]): + filtersourceeq (Union[Unset, str]): + filtersourcenot_eq (Union[Unset, str]): + filtersourcein (Union[Unset, str]): + filtersourcenot_in (Union[Unset, str]): + filterserviceseq (Union[Unset, str]): + filterservicesnot_eq (Union[Unset, str]): + filterservicesin (Union[Unset, str]): + filterservicesnot_in (Union[Unset, str]): + filtergroupseq (Union[Unset, str]): + filtergroupsnot_eq (Union[Unset, str]): + filtergroupsin (Union[Unset, str]): + filtergroupsnot_in (Union[Unset, str]): + filterenvironmentseq (Union[Unset, str]): + filterenvironmentsnot_eq (Union[Unset, str]): + filterenvironmentsin (Union[Unset, str]): + filterenvironmentsnot_in (Union[Unset, str]): + filterlabelseq (Union[Unset, str]): + filterlabelsnot_eq (Union[Unset, str]): + filterlabelsin (Union[Unset, str]): + filterlabelsnot_in (Union[Unset, str]): + pageafter (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/alerts/list_incident_alerts.py b/rootly_sdk/api/alerts/list_incident_alerts.py index 4358b186..171a2398 100644 --- a/rootly_sdk/api/alerts/list_incident_alerts.py +++ b/rootly_sdk/api/alerts/list_incident_alerts.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,12 +13,11 @@ def _get_kwargs( incident_id: str, *, - include: ListIncidentAlertsInclude | Unset = UNSET, + include: Union[Unset, ListIncidentAlertsInclude] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} - json_include: str | Unset = UNSET + json_include: Union[Unset, str] = UNSET if not isinstance(include, Unset): json_include = include @@ -29,16 +27,14 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/incidents/{incident_id}/alerts".format( - incident_id=quote(str(incident_id), safe=""), - ), + "url": f"/v1/incidents/{incident_id}/alerts", "params": params, } return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> AlertList | None: +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[AlertList]: if response.status_code == 200: response_200 = AlertList.from_dict(response.json()) @@ -50,7 +46,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[AlertList]: +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[AlertList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -63,7 +59,7 @@ def sync_detailed( incident_id: str, *, client: AuthenticatedClient, - include: ListIncidentAlertsInclude | Unset = UNSET, + include: Union[Unset, ListIncidentAlertsInclude] = UNSET, ) -> Response[AlertList]: """List Incident alerts @@ -71,7 +67,7 @@ def sync_detailed( Args: incident_id (str): - include (ListIncidentAlertsInclude | Unset): + include (Union[Unset, ListIncidentAlertsInclude]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -97,15 +93,15 @@ def sync( incident_id: str, *, client: AuthenticatedClient, - include: ListIncidentAlertsInclude | Unset = UNSET, -) -> AlertList | None: + include: Union[Unset, ListIncidentAlertsInclude] = UNSET, +) -> Optional[AlertList]: """List Incident alerts List incident alerts Args: incident_id (str): - include (ListIncidentAlertsInclude | Unset): + include (Union[Unset, ListIncidentAlertsInclude]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -126,7 +122,7 @@ async def asyncio_detailed( incident_id: str, *, client: AuthenticatedClient, - include: ListIncidentAlertsInclude | Unset = UNSET, + include: Union[Unset, ListIncidentAlertsInclude] = UNSET, ) -> Response[AlertList]: """List Incident alerts @@ -134,7 +130,7 @@ async def asyncio_detailed( Args: incident_id (str): - include (ListIncidentAlertsInclude | Unset): + include (Union[Unset, ListIncidentAlertsInclude]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -158,15 +154,15 @@ async def asyncio( incident_id: str, *, client: AuthenticatedClient, - include: ListIncidentAlertsInclude | Unset = UNSET, -) -> AlertList | None: + include: Union[Unset, ListIncidentAlertsInclude] = UNSET, +) -> Optional[AlertList]: """List Incident alerts List incident alerts Args: incident_id (str): - include (ListIncidentAlertsInclude | Unset): + include (Union[Unset, ListIncidentAlertsInclude]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/alerts/resolve_alert.py b/rootly_sdk/api/alerts/resolve_alert.py index 66ec0165..9e57e8d3 100644 --- a/rootly_sdk/api/alerts/resolve_alert.py +++ b/rootly_sdk/api/alerts/resolve_alert.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -9,25 +8,22 @@ from ...models.alert_response import AlertResponse from ...models.errors_list import ErrorsList from ...models.resolve_alert import ResolveAlert -from ...types import UNSET, Response, Unset +from ...types import Response def _get_kwargs( id: str, *, - body: ResolveAlert | Unset = UNSET, + body: ResolveAlert, ) -> dict[str, Any]: headers: dict[str, Any] = {} _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/alerts/{id}/resolve".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/alerts/{id}/resolve", } - if not isinstance(body, Unset): - _kwargs["json"] = body.to_dict() + _kwargs["json"] = body.to_dict() headers["Content-Type"] = "application/vnd.api+json" @@ -36,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AlertResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[AlertResponse, ErrorsList]]: if response.status_code == 200: response_200 = AlertResponse.from_dict(response.json()) @@ -55,8 +51,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AlertResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[AlertResponse, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,22 +65,22 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, - body: ResolveAlert | Unset = UNSET, -) -> Response[AlertResponse | ErrorsList]: + body: ResolveAlert, +) -> Response[Union[AlertResponse, ErrorsList]]: """Resolves an alert Resolves a specific alert by id Args: id (str): - body (ResolveAlert | Unset): + body (ResolveAlert): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertResponse | ErrorsList] + Response[Union[AlertResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -103,22 +99,22 @@ def sync( id: str, *, client: AuthenticatedClient, - body: ResolveAlert | Unset = UNSET, -) -> AlertResponse | ErrorsList | None: + body: ResolveAlert, +) -> Optional[Union[AlertResponse, ErrorsList]]: """Resolves an alert Resolves a specific alert by id Args: id (str): - body (ResolveAlert | Unset): + body (ResolveAlert): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertResponse | ErrorsList + Union[AlertResponse, ErrorsList] """ return sync_detailed( @@ -132,22 +128,22 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, - body: ResolveAlert | Unset = UNSET, -) -> Response[AlertResponse | ErrorsList]: + body: ResolveAlert, +) -> Response[Union[AlertResponse, ErrorsList]]: """Resolves an alert Resolves a specific alert by id Args: id (str): - body (ResolveAlert | Unset): + body (ResolveAlert): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertResponse | ErrorsList] + Response[Union[AlertResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -164,22 +160,22 @@ async def asyncio( id: str, *, client: AuthenticatedClient, - body: ResolveAlert | Unset = UNSET, -) -> AlertResponse | ErrorsList | None: + body: ResolveAlert, +) -> Optional[Union[AlertResponse, ErrorsList]]: """Resolves an alert Resolves a specific alert by id Args: id (str): - body (ResolveAlert | Unset): + body (ResolveAlert): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertResponse | ErrorsList + Union[AlertResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/alerts/snooze_alert.py b/rootly_sdk/api/alerts/snooze_alert.py index cf592ccd..e6b03f50 100644 --- a/rootly_sdk/api/alerts/snooze_alert.py +++ b/rootly_sdk/api/alerts/snooze_alert.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/alerts/{id}/snooze".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/alerts/{id}/snooze", } _kwargs["json"] = body.to_dict() @@ -35,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AlertResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[AlertResponse, ErrorsList]]: if response.status_code == 200: response_200 = AlertResponse.from_dict(response.json()) @@ -64,8 +61,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AlertResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[AlertResponse, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -79,7 +76,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: SnoozeAlert, -) -> Response[AlertResponse | ErrorsList]: +) -> Response[Union[AlertResponse, ErrorsList]]: """Snoozes an alert Snoozes a specific alert by id, extending the acknowledgment timeout @@ -93,7 +90,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertResponse | ErrorsList] + Response[Union[AlertResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -113,7 +110,7 @@ def sync( *, client: AuthenticatedClient, body: SnoozeAlert, -) -> AlertResponse | ErrorsList | None: +) -> Optional[Union[AlertResponse, ErrorsList]]: """Snoozes an alert Snoozes a specific alert by id, extending the acknowledgment timeout @@ -127,7 +124,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertResponse | ErrorsList + Union[AlertResponse, ErrorsList] """ return sync_detailed( @@ -142,7 +139,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: SnoozeAlert, -) -> Response[AlertResponse | ErrorsList]: +) -> Response[Union[AlertResponse, ErrorsList]]: """Snoozes an alert Snoozes a specific alert by id, extending the acknowledgment timeout @@ -156,7 +153,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertResponse | ErrorsList] + Response[Union[AlertResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -174,7 +171,7 @@ async def asyncio( *, client: AuthenticatedClient, body: SnoozeAlert, -) -> AlertResponse | ErrorsList | None: +) -> Optional[Union[AlertResponse, ErrorsList]]: """Snoozes an alert Snoozes a specific alert by id, extending the acknowledgment timeout @@ -188,7 +185,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertResponse | ErrorsList + Union[AlertResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/alerts/update_alert.py b/rootly_sdk/api/alerts/update_alert.py index 5a60b818..0a41f5bc 100644 --- a/rootly_sdk/api/alerts/update_alert.py +++ b/rootly_sdk/api/alerts/update_alert.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -9,25 +8,22 @@ from ...models.alert_response import AlertResponse from ...models.errors_list import ErrorsList from ...models.update_alert import UpdateAlert -from ...types import UNSET, Response, Unset +from ...types import Response def _get_kwargs( id: str, *, - body: UpdateAlert | Unset = UNSET, + body: UpdateAlert, ) -> dict[str, Any]: headers: dict[str, Any] = {} _kwargs: dict[str, Any] = { "method": "patch", - "url": "/v1/alerts/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/alerts/{id}", } - if not isinstance(body, Unset): - _kwargs["json"] = body.to_dict() + _kwargs["json"] = body.to_dict() headers["Content-Type"] = "application/vnd.api+json" @@ -36,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AlertResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[AlertResponse, ErrorsList]]: if response.status_code == 200: response_200 = AlertResponse.from_dict(response.json()) @@ -55,8 +51,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AlertResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[AlertResponse, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,22 +65,22 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, - body: UpdateAlert | Unset = UNSET, -) -> Response[AlertResponse | ErrorsList]: + body: UpdateAlert, +) -> Response[Union[AlertResponse, ErrorsList]]: """Update alert Updates an alert Args: id (str): - body (UpdateAlert | Unset): + body (UpdateAlert): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertResponse | ErrorsList] + Response[Union[AlertResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -103,22 +99,22 @@ def sync( id: str, *, client: AuthenticatedClient, - body: UpdateAlert | Unset = UNSET, -) -> AlertResponse | ErrorsList | None: + body: UpdateAlert, +) -> Optional[Union[AlertResponse, ErrorsList]]: """Update alert Updates an alert Args: id (str): - body (UpdateAlert | Unset): + body (UpdateAlert): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertResponse | ErrorsList + Union[AlertResponse, ErrorsList] """ return sync_detailed( @@ -132,22 +128,22 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, - body: UpdateAlert | Unset = UNSET, -) -> Response[AlertResponse | ErrorsList]: + body: UpdateAlert, +) -> Response[Union[AlertResponse, ErrorsList]]: """Update alert Updates an alert Args: id (str): - body (UpdateAlert | Unset): + body (UpdateAlert): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertResponse | ErrorsList] + Response[Union[AlertResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -164,22 +160,22 @@ async def asyncio( id: str, *, client: AuthenticatedClient, - body: UpdateAlert | Unset = UNSET, -) -> AlertResponse | ErrorsList | None: + body: UpdateAlert, +) -> Optional[Union[AlertResponse, ErrorsList]]: """Update alert Updates an alert Args: id (str): - body (UpdateAlert | Unset): + body (UpdateAlert): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertResponse | ErrorsList + Union[AlertResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/api_keys/create_api_key.py b/rootly_sdk/api/api_keys/create_api_key.py index 6573821d..c06b60be 100644 --- a/rootly_sdk/api/api_keys/create_api_key.py +++ b/rootly_sdk/api/api_keys/create_api_key.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ApiKeyWithTokenResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ApiKeyWithTokenResponse, ErrorsList]]: if response.status_code == 201: response_201 = ApiKeyWithTokenResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ApiKeyWithTokenResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ApiKeyWithTokenResponse, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +69,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewApiKey, -) -> Response[ApiKeyWithTokenResponse | ErrorsList]: +) -> Response[Union[ApiKeyWithTokenResponse, ErrorsList]]: """Creates an API key Creates a new API key and returns it with the plaintext token. **The token is only returned once** — @@ -93,7 +93,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ApiKeyWithTokenResponse | ErrorsList] + Response[Union[ApiKeyWithTokenResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -111,7 +111,7 @@ def sync( *, client: AuthenticatedClient, body: NewApiKey, -) -> ApiKeyWithTokenResponse | ErrorsList | None: +) -> Optional[Union[ApiKeyWithTokenResponse, ErrorsList]]: """Creates an API key Creates a new API key and returns it with the plaintext token. **The token is only returned once** — @@ -135,7 +135,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ApiKeyWithTokenResponse | ErrorsList + Union[ApiKeyWithTokenResponse, ErrorsList] """ return sync_detailed( @@ -148,7 +148,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewApiKey, -) -> Response[ApiKeyWithTokenResponse | ErrorsList]: +) -> Response[Union[ApiKeyWithTokenResponse, ErrorsList]]: """Creates an API key Creates a new API key and returns it with the plaintext token. **The token is only returned once** — @@ -172,7 +172,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ApiKeyWithTokenResponse | ErrorsList] + Response[Union[ApiKeyWithTokenResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -188,7 +188,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewApiKey, -) -> ApiKeyWithTokenResponse | ErrorsList | None: +) -> Optional[Union[ApiKeyWithTokenResponse, ErrorsList]]: """Creates an API key Creates a new API key and returns it with the plaintext token. **The token is only returned once** — @@ -212,7 +212,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ApiKeyWithTokenResponse | ErrorsList + Union[ApiKeyWithTokenResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/api_keys/delete_api_key.py b/rootly_sdk/api/api_keys/delete_api_key.py index 948015a0..1e68358a 100644 --- a/rootly_sdk/api/api_keys/delete_api_key.py +++ b/rootly_sdk/api/api_keys/delete_api_key.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union from uuid import UUID import httpx @@ -15,20 +14,17 @@ def _get_kwargs( id: UUID, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/api_keys/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/api_keys/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ApiKeyResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ApiKeyResponse, ErrorsList]]: if response.status_code == 200: response_200 = ApiKeyResponse.from_dict(response.json()) @@ -46,8 +42,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ApiKeyResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ApiKeyResponse, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -60,7 +56,7 @@ def sync_detailed( id: UUID, *, client: AuthenticatedClient, -) -> Response[ApiKeyResponse | ErrorsList]: +) -> Response[Union[ApiKeyResponse, ErrorsList]]: """Revoke an API key Revoke an API key. The key is immediately invalidated and can no longer be used for authentication. @@ -77,7 +73,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ApiKeyResponse | ErrorsList] + Response[Union[ApiKeyResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -95,7 +91,7 @@ def sync( id: UUID, *, client: AuthenticatedClient, -) -> ApiKeyResponse | ErrorsList | None: +) -> Optional[Union[ApiKeyResponse, ErrorsList]]: """Revoke an API key Revoke an API key. The key is immediately invalidated and can no longer be used for authentication. @@ -112,7 +108,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ApiKeyResponse | ErrorsList + Union[ApiKeyResponse, ErrorsList] """ return sync_detailed( @@ -125,7 +121,7 @@ async def asyncio_detailed( id: UUID, *, client: AuthenticatedClient, -) -> Response[ApiKeyResponse | ErrorsList]: +) -> Response[Union[ApiKeyResponse, ErrorsList]]: """Revoke an API key Revoke an API key. The key is immediately invalidated and can no longer be used for authentication. @@ -142,7 +138,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ApiKeyResponse | ErrorsList] + Response[Union[ApiKeyResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -158,7 +154,7 @@ async def asyncio( id: UUID, *, client: AuthenticatedClient, -) -> ApiKeyResponse | ErrorsList | None: +) -> Optional[Union[ApiKeyResponse, ErrorsList]]: """Revoke an API key Revoke an API key. The key is immediately invalidated and can no longer be used for authentication. @@ -175,7 +171,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ApiKeyResponse | ErrorsList + Union[ApiKeyResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/api_keys/get_api_key.py b/rootly_sdk/api/api_keys/get_api_key.py index 6ba239a8..318c71b2 100644 --- a/rootly_sdk/api/api_keys/get_api_key.py +++ b/rootly_sdk/api/api_keys/get_api_key.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union from uuid import UUID import httpx @@ -15,9 +14,8 @@ def _get_kwargs( id: UUID, *, - include: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -26,9 +24,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/api_keys/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/api_keys/{id}", "params": params, } @@ -36,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ApiKeyResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ApiKeyResponse, ErrorsList]]: if response.status_code == 200: response_200 = ApiKeyResponse.from_dict(response.json()) @@ -55,8 +51,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ApiKeyResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ApiKeyResponse, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,8 +65,8 @@ def sync_detailed( id: UUID, *, client: AuthenticatedClient, - include: str | Unset = UNSET, -) -> Response[ApiKeyResponse | ErrorsList]: + include: Union[Unset, str] = UNSET, +) -> Response[Union[ApiKeyResponse, ErrorsList]]: """Retrieves an API key Retrieves a specific API key by its UUID. Returns key metadata including name, kind, expiration, @@ -78,14 +74,14 @@ def sync_detailed( Args: id (UUID): - include (str | Unset): + include (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ApiKeyResponse | ErrorsList] + Response[Union[ApiKeyResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -104,8 +100,8 @@ def sync( id: UUID, *, client: AuthenticatedClient, - include: str | Unset = UNSET, -) -> ApiKeyResponse | ErrorsList | None: + include: Union[Unset, str] = UNSET, +) -> Optional[Union[ApiKeyResponse, ErrorsList]]: """Retrieves an API key Retrieves a specific API key by its UUID. Returns key metadata including name, kind, expiration, @@ -113,14 +109,14 @@ def sync( Args: id (UUID): - include (str | Unset): + include (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ApiKeyResponse | ErrorsList + Union[ApiKeyResponse, ErrorsList] """ return sync_detailed( @@ -134,8 +130,8 @@ async def asyncio_detailed( id: UUID, *, client: AuthenticatedClient, - include: str | Unset = UNSET, -) -> Response[ApiKeyResponse | ErrorsList]: + include: Union[Unset, str] = UNSET, +) -> Response[Union[ApiKeyResponse, ErrorsList]]: """Retrieves an API key Retrieves a specific API key by its UUID. Returns key metadata including name, kind, expiration, @@ -143,14 +139,14 @@ async def asyncio_detailed( Args: id (UUID): - include (str | Unset): + include (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ApiKeyResponse | ErrorsList] + Response[Union[ApiKeyResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -167,8 +163,8 @@ async def asyncio( id: UUID, *, client: AuthenticatedClient, - include: str | Unset = UNSET, -) -> ApiKeyResponse | ErrorsList | None: + include: Union[Unset, str] = UNSET, +) -> Optional[Union[ApiKeyResponse, ErrorsList]]: """Retrieves an API key Retrieves a specific API key by its UUID. Returns key metadata including name, kind, expiration, @@ -176,14 +172,14 @@ async def asyncio( Args: id (UUID): - include (str | Unset): + include (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ApiKeyResponse | ErrorsList + Union[ApiKeyResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/api_keys/list_api_keys.py b/rootly_sdk/api/api_keys/list_api_keys.py index 6f057d91..83cd1e6d 100644 --- a/rootly_sdk/api/api_keys/list_api_keys.py +++ b/rootly_sdk/api/api_keys/list_api_keys.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -12,32 +12,31 @@ def _get_kwargs( *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterkind: str | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filteruser_id: str | Unset = UNSET, - filtergroup_ids: str | Unset = UNSET, - filterrole_id: str | Unset = UNSET, - filteractive: bool | Unset = UNSET, - filterexpired: bool | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterexpires_atgt: str | Unset = UNSET, - filterexpires_atgte: str | Unset = UNSET, - filterexpires_atlt: str | Unset = UNSET, - filterexpires_atlte: str | Unset = UNSET, - filterlast_used_atgt: str | Unset = UNSET, - filterlast_used_atgte: str | Unset = UNSET, - filterlast_used_atlt: str | Unset = UNSET, - filterlast_used_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterkind: Union[Unset, str] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filteruser_id: Union[Unset, str] = UNSET, + filtergroup_ids: Union[Unset, str] = UNSET, + filterrole_id: Union[Unset, str] = UNSET, + filteractive: Union[Unset, bool] = UNSET, + filterexpired: Union[Unset, bool] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filterexpires_atgt: Union[Unset, str] = UNSET, + filterexpires_atgte: Union[Unset, str] = UNSET, + filterexpires_atlt: Union[Unset, str] = UNSET, + filterexpires_atlte: Union[Unset, str] = UNSET, + filterlast_used_atgt: Union[Unset, str] = UNSET, + filterlast_used_atgte: Union[Unset, str] = UNSET, + filterlast_used_atlt: Union[Unset, str] = UNSET, + filterlast_used_atlte: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -100,8 +99,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ApiKeyList | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ApiKeyList, ErrorsList]]: if response.status_code == 200: response_200 = ApiKeyList.from_dict(response.json()) @@ -119,8 +118,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ApiKeyList | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ApiKeyList, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -132,31 +131,31 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterkind: str | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filteruser_id: str | Unset = UNSET, - filtergroup_ids: str | Unset = UNSET, - filterrole_id: str | Unset = UNSET, - filteractive: bool | Unset = UNSET, - filterexpired: bool | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterexpires_atgt: str | Unset = UNSET, - filterexpires_atgte: str | Unset = UNSET, - filterexpires_atlt: str | Unset = UNSET, - filterexpires_atlte: str | Unset = UNSET, - filterlast_used_atgt: str | Unset = UNSET, - filterlast_used_atgte: str | Unset = UNSET, - filterlast_used_atlt: str | Unset = UNSET, - filterlast_used_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, -) -> Response[ApiKeyList | ErrorsList]: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterkind: Union[Unset, str] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filteruser_id: Union[Unset, str] = UNSET, + filtergroup_ids: Union[Unset, str] = UNSET, + filterrole_id: Union[Unset, str] = UNSET, + filteractive: Union[Unset, bool] = UNSET, + filterexpired: Union[Unset, bool] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filterexpires_atgt: Union[Unset, str] = UNSET, + filterexpires_atgte: Union[Unset, str] = UNSET, + filterexpires_atlt: Union[Unset, str] = UNSET, + filterexpires_atlte: Union[Unset, str] = UNSET, + filterlast_used_atgt: Union[Unset, str] = UNSET, + filterlast_used_atgte: Union[Unset, str] = UNSET, + filterlast_used_atlt: Union[Unset, str] = UNSET, + filterlast_used_atlte: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, +) -> Response[Union[ApiKeyList, ErrorsList]]: """List API keys List API keys for the current organization. Returns key metadata including name, kind, expiration, @@ -178,37 +177,37 @@ def sync_detailed( `updated_at`, `expires_at`, `last_used_at`. Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterkind (str | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filteruser_id (str | Unset): - filtergroup_ids (str | Unset): - filterrole_id (str | Unset): - filteractive (bool | Unset): - filterexpired (bool | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterexpires_atgt (str | Unset): - filterexpires_atgte (str | Unset): - filterexpires_atlt (str | Unset): - filterexpires_atlte (str | Unset): - filterlast_used_atgt (str | Unset): - filterlast_used_atgte (str | Unset): - filterlast_used_atlt (str | Unset): - filterlast_used_atlte (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterkind (Union[Unset, str]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filteruser_id (Union[Unset, str]): + filtergroup_ids (Union[Unset, str]): + filterrole_id (Union[Unset, str]): + filteractive (Union[Unset, bool]): + filterexpired (Union[Unset, bool]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterexpires_atgt (Union[Unset, str]): + filterexpires_atgte (Union[Unset, str]): + filterexpires_atlt (Union[Unset, str]): + filterexpires_atlte (Union[Unset, str]): + filterlast_used_atgt (Union[Unset, str]): + filterlast_used_atgte (Union[Unset, str]): + filterlast_used_atlt (Union[Unset, str]): + filterlast_used_atlte (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ApiKeyList | ErrorsList] + Response[Union[ApiKeyList, ErrorsList]] """ kwargs = _get_kwargs( @@ -248,31 +247,31 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterkind: str | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filteruser_id: str | Unset = UNSET, - filtergroup_ids: str | Unset = UNSET, - filterrole_id: str | Unset = UNSET, - filteractive: bool | Unset = UNSET, - filterexpired: bool | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterexpires_atgt: str | Unset = UNSET, - filterexpires_atgte: str | Unset = UNSET, - filterexpires_atlt: str | Unset = UNSET, - filterexpires_atlte: str | Unset = UNSET, - filterlast_used_atgt: str | Unset = UNSET, - filterlast_used_atgte: str | Unset = UNSET, - filterlast_used_atlt: str | Unset = UNSET, - filterlast_used_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, -) -> ApiKeyList | ErrorsList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterkind: Union[Unset, str] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filteruser_id: Union[Unset, str] = UNSET, + filtergroup_ids: Union[Unset, str] = UNSET, + filterrole_id: Union[Unset, str] = UNSET, + filteractive: Union[Unset, bool] = UNSET, + filterexpired: Union[Unset, bool] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filterexpires_atgt: Union[Unset, str] = UNSET, + filterexpires_atgte: Union[Unset, str] = UNSET, + filterexpires_atlt: Union[Unset, str] = UNSET, + filterexpires_atlte: Union[Unset, str] = UNSET, + filterlast_used_atgt: Union[Unset, str] = UNSET, + filterlast_used_atgte: Union[Unset, str] = UNSET, + filterlast_used_atlt: Union[Unset, str] = UNSET, + filterlast_used_atlte: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, +) -> Optional[Union[ApiKeyList, ErrorsList]]: """List API keys List API keys for the current organization. Returns key metadata including name, kind, expiration, @@ -294,37 +293,37 @@ def sync( `updated_at`, `expires_at`, `last_used_at`. Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterkind (str | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filteruser_id (str | Unset): - filtergroup_ids (str | Unset): - filterrole_id (str | Unset): - filteractive (bool | Unset): - filterexpired (bool | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterexpires_atgt (str | Unset): - filterexpires_atgte (str | Unset): - filterexpires_atlt (str | Unset): - filterexpires_atlte (str | Unset): - filterlast_used_atgt (str | Unset): - filterlast_used_atgte (str | Unset): - filterlast_used_atlt (str | Unset): - filterlast_used_atlte (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterkind (Union[Unset, str]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filteruser_id (Union[Unset, str]): + filtergroup_ids (Union[Unset, str]): + filterrole_id (Union[Unset, str]): + filteractive (Union[Unset, bool]): + filterexpired (Union[Unset, bool]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterexpires_atgt (Union[Unset, str]): + filterexpires_atgte (Union[Unset, str]): + filterexpires_atlt (Union[Unset, str]): + filterexpires_atlte (Union[Unset, str]): + filterlast_used_atgt (Union[Unset, str]): + filterlast_used_atgte (Union[Unset, str]): + filterlast_used_atlt (Union[Unset, str]): + filterlast_used_atlte (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ApiKeyList | ErrorsList + Union[ApiKeyList, ErrorsList] """ return sync_detailed( @@ -359,31 +358,31 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterkind: str | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filteruser_id: str | Unset = UNSET, - filtergroup_ids: str | Unset = UNSET, - filterrole_id: str | Unset = UNSET, - filteractive: bool | Unset = UNSET, - filterexpired: bool | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterexpires_atgt: str | Unset = UNSET, - filterexpires_atgte: str | Unset = UNSET, - filterexpires_atlt: str | Unset = UNSET, - filterexpires_atlte: str | Unset = UNSET, - filterlast_used_atgt: str | Unset = UNSET, - filterlast_used_atgte: str | Unset = UNSET, - filterlast_used_atlt: str | Unset = UNSET, - filterlast_used_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, -) -> Response[ApiKeyList | ErrorsList]: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterkind: Union[Unset, str] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filteruser_id: Union[Unset, str] = UNSET, + filtergroup_ids: Union[Unset, str] = UNSET, + filterrole_id: Union[Unset, str] = UNSET, + filteractive: Union[Unset, bool] = UNSET, + filterexpired: Union[Unset, bool] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filterexpires_atgt: Union[Unset, str] = UNSET, + filterexpires_atgte: Union[Unset, str] = UNSET, + filterexpires_atlt: Union[Unset, str] = UNSET, + filterexpires_atlte: Union[Unset, str] = UNSET, + filterlast_used_atgt: Union[Unset, str] = UNSET, + filterlast_used_atgte: Union[Unset, str] = UNSET, + filterlast_used_atlt: Union[Unset, str] = UNSET, + filterlast_used_atlte: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, +) -> Response[Union[ApiKeyList, ErrorsList]]: """List API keys List API keys for the current organization. Returns key metadata including name, kind, expiration, @@ -405,37 +404,37 @@ async def asyncio_detailed( `updated_at`, `expires_at`, `last_used_at`. Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterkind (str | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filteruser_id (str | Unset): - filtergroup_ids (str | Unset): - filterrole_id (str | Unset): - filteractive (bool | Unset): - filterexpired (bool | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterexpires_atgt (str | Unset): - filterexpires_atgte (str | Unset): - filterexpires_atlt (str | Unset): - filterexpires_atlte (str | Unset): - filterlast_used_atgt (str | Unset): - filterlast_used_atgte (str | Unset): - filterlast_used_atlt (str | Unset): - filterlast_used_atlte (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterkind (Union[Unset, str]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filteruser_id (Union[Unset, str]): + filtergroup_ids (Union[Unset, str]): + filterrole_id (Union[Unset, str]): + filteractive (Union[Unset, bool]): + filterexpired (Union[Unset, bool]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterexpires_atgt (Union[Unset, str]): + filterexpires_atgte (Union[Unset, str]): + filterexpires_atlt (Union[Unset, str]): + filterexpires_atlte (Union[Unset, str]): + filterlast_used_atgt (Union[Unset, str]): + filterlast_used_atgte (Union[Unset, str]): + filterlast_used_atlt (Union[Unset, str]): + filterlast_used_atlte (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ApiKeyList | ErrorsList] + Response[Union[ApiKeyList, ErrorsList]] """ kwargs = _get_kwargs( @@ -473,31 +472,31 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterkind: str | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filteruser_id: str | Unset = UNSET, - filtergroup_ids: str | Unset = UNSET, - filterrole_id: str | Unset = UNSET, - filteractive: bool | Unset = UNSET, - filterexpired: bool | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterexpires_atgt: str | Unset = UNSET, - filterexpires_atgte: str | Unset = UNSET, - filterexpires_atlt: str | Unset = UNSET, - filterexpires_atlte: str | Unset = UNSET, - filterlast_used_atgt: str | Unset = UNSET, - filterlast_used_atgte: str | Unset = UNSET, - filterlast_used_atlt: str | Unset = UNSET, - filterlast_used_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, -) -> ApiKeyList | ErrorsList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterkind: Union[Unset, str] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filteruser_id: Union[Unset, str] = UNSET, + filtergroup_ids: Union[Unset, str] = UNSET, + filterrole_id: Union[Unset, str] = UNSET, + filteractive: Union[Unset, bool] = UNSET, + filterexpired: Union[Unset, bool] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filterexpires_atgt: Union[Unset, str] = UNSET, + filterexpires_atgte: Union[Unset, str] = UNSET, + filterexpires_atlt: Union[Unset, str] = UNSET, + filterexpires_atlte: Union[Unset, str] = UNSET, + filterlast_used_atgt: Union[Unset, str] = UNSET, + filterlast_used_atgte: Union[Unset, str] = UNSET, + filterlast_used_atlt: Union[Unset, str] = UNSET, + filterlast_used_atlte: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, +) -> Optional[Union[ApiKeyList, ErrorsList]]: """List API keys List API keys for the current organization. Returns key metadata including name, kind, expiration, @@ -519,37 +518,37 @@ async def asyncio( `updated_at`, `expires_at`, `last_used_at`. Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterkind (str | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filteruser_id (str | Unset): - filtergroup_ids (str | Unset): - filterrole_id (str | Unset): - filteractive (bool | Unset): - filterexpired (bool | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterexpires_atgt (str | Unset): - filterexpires_atgte (str | Unset): - filterexpires_atlt (str | Unset): - filterexpires_atlte (str | Unset): - filterlast_used_atgt (str | Unset): - filterlast_used_atgte (str | Unset): - filterlast_used_atlt (str | Unset): - filterlast_used_atlte (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterkind (Union[Unset, str]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filteruser_id (Union[Unset, str]): + filtergroup_ids (Union[Unset, str]): + filterrole_id (Union[Unset, str]): + filteractive (Union[Unset, bool]): + filterexpired (Union[Unset, bool]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterexpires_atgt (Union[Unset, str]): + filterexpires_atgte (Union[Unset, str]): + filterexpires_atlt (Union[Unset, str]): + filterexpires_atlte (Union[Unset, str]): + filterlast_used_atgt (Union[Unset, str]): + filterlast_used_atgte (Union[Unset, str]): + filterlast_used_atlt (Union[Unset, str]): + filterlast_used_atlte (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ApiKeyList | ErrorsList + Union[ApiKeyList, ErrorsList] """ return ( diff --git a/rootly_sdk/api/api_keys/rotate_api_key.py b/rootly_sdk/api/api_keys/rotate_api_key.py index 9bdb2773..e49584eb 100644 --- a/rootly_sdk/api/api_keys/rotate_api_key.py +++ b/rootly_sdk/api/api_keys/rotate_api_key.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -9,25 +8,22 @@ from ...models.api_key_with_token_response import ApiKeyWithTokenResponse from ...models.errors_list import ErrorsList from ...models.rotate_api_key import RotateApiKey -from ...types import UNSET, Response, Unset +from ...types import Response def _get_kwargs( id: str, *, - body: RotateApiKey | Unset = UNSET, + body: RotateApiKey, ) -> dict[str, Any]: headers: dict[str, Any] = {} _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/api_keys/{id}/rotate".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/api_keys/{id}/rotate", } - if not isinstance(body, Unset): - _kwargs["json"] = body.to_dict() + _kwargs["json"] = body.to_dict() headers["Content-Type"] = "application/vnd.api+json" @@ -36,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ApiKeyWithTokenResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ApiKeyWithTokenResponse, ErrorsList]]: if response.status_code == 200: response_200 = ApiKeyWithTokenResponse.from_dict(response.json()) @@ -55,8 +51,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ApiKeyWithTokenResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ApiKeyWithTokenResponse, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,8 +65,8 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, - body: RotateApiKey | Unset = UNSET, -) -> Response[ApiKeyWithTokenResponse | ErrorsList]: + body: RotateApiKey, +) -> Response[Union[ApiKeyWithTokenResponse, ErrorsList]]: """Rotate an API key Rotate an API key's token. Issues a new secret token and returns it — **the new token is only shown @@ -96,14 +92,14 @@ def sync_detailed( Args: id (str): - body (RotateApiKey | Unset): + body (RotateApiKey): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ApiKeyWithTokenResponse | ErrorsList] + Response[Union[ApiKeyWithTokenResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -122,8 +118,8 @@ def sync( id: str, *, client: AuthenticatedClient, - body: RotateApiKey | Unset = UNSET, -) -> ApiKeyWithTokenResponse | ErrorsList | None: + body: RotateApiKey, +) -> Optional[Union[ApiKeyWithTokenResponse, ErrorsList]]: """Rotate an API key Rotate an API key's token. Issues a new secret token and returns it — **the new token is only shown @@ -149,14 +145,14 @@ def sync( Args: id (str): - body (RotateApiKey | Unset): + body (RotateApiKey): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ApiKeyWithTokenResponse | ErrorsList + Union[ApiKeyWithTokenResponse, ErrorsList] """ return sync_detailed( @@ -170,8 +166,8 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, - body: RotateApiKey | Unset = UNSET, -) -> Response[ApiKeyWithTokenResponse | ErrorsList]: + body: RotateApiKey, +) -> Response[Union[ApiKeyWithTokenResponse, ErrorsList]]: """Rotate an API key Rotate an API key's token. Issues a new secret token and returns it — **the new token is only shown @@ -197,14 +193,14 @@ async def asyncio_detailed( Args: id (str): - body (RotateApiKey | Unset): + body (RotateApiKey): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ApiKeyWithTokenResponse | ErrorsList] + Response[Union[ApiKeyWithTokenResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -221,8 +217,8 @@ async def asyncio( id: str, *, client: AuthenticatedClient, - body: RotateApiKey | Unset = UNSET, -) -> ApiKeyWithTokenResponse | ErrorsList | None: + body: RotateApiKey, +) -> Optional[Union[ApiKeyWithTokenResponse, ErrorsList]]: """Rotate an API key Rotate an API key's token. Issues a new secret token and returns it — **the new token is only shown @@ -248,14 +244,14 @@ async def asyncio( Args: id (str): - body (RotateApiKey | Unset): + body (RotateApiKey): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ApiKeyWithTokenResponse | ErrorsList + Union[ApiKeyWithTokenResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/api_keys/update_api_key.py b/rootly_sdk/api/api_keys/update_api_key.py index 94cebad5..4ceb9e2b 100644 --- a/rootly_sdk/api/api_keys/update_api_key.py +++ b/rootly_sdk/api/api_keys/update_api_key.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union from uuid import UUID import httpx @@ -22,9 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/api_keys/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/api_keys/{id}", } _kwargs["json"] = body.to_dict() @@ -36,8 +33,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ApiKeyResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ApiKeyResponse, ErrorsList]]: if response.status_code == 200: response_200 = ApiKeyResponse.from_dict(response.json()) @@ -55,8 +52,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ApiKeyResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ApiKeyResponse, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -70,7 +67,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateApiKey, -) -> Response[ApiKeyResponse | ErrorsList]: +) -> Response[Union[ApiKeyResponse, ErrorsList]]: """Update an API key Update an API key's mutable attributes: `name`, `description`, and `expires_at`. @@ -90,7 +87,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ApiKeyResponse | ErrorsList] + Response[Union[ApiKeyResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -110,7 +107,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateApiKey, -) -> ApiKeyResponse | ErrorsList | None: +) -> Optional[Union[ApiKeyResponse, ErrorsList]]: """Update an API key Update an API key's mutable attributes: `name`, `description`, and `expires_at`. @@ -130,7 +127,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ApiKeyResponse | ErrorsList + Union[ApiKeyResponse, ErrorsList] """ return sync_detailed( @@ -145,7 +142,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateApiKey, -) -> Response[ApiKeyResponse | ErrorsList]: +) -> Response[Union[ApiKeyResponse, ErrorsList]]: """Update an API key Update an API key's mutable attributes: `name`, `description`, and `expires_at`. @@ -165,7 +162,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ApiKeyResponse | ErrorsList] + Response[Union[ApiKeyResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -183,7 +180,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateApiKey, -) -> ApiKeyResponse | ErrorsList | None: +) -> Optional[Union[ApiKeyResponse, ErrorsList]]: """Update an API key Update an API key's mutable attributes: `name`, `description`, and `expires_at`. @@ -203,7 +200,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ApiKeyResponse | ErrorsList + Union[ApiKeyResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/audits/list_audits.py b/rootly_sdk/api/audits/list_audits.py index fce7f754..9fc427af 100644 --- a/rootly_sdk/api/audits/list_audits.py +++ b/rootly_sdk/api/audits/list_audits.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -11,36 +11,35 @@ def _get_kwargs( *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filteruser_id: str | Unset = UNSET, - filterapi_key_id: str | Unset = UNSET, - filtersource: str | Unset = UNSET, - filteritem_type: str | Unset = UNSET, - filteruser_ideq: str | Unset = UNSET, - filteruser_idnot_eq: str | Unset = UNSET, - filteruser_idin: str | Unset = UNSET, - filteruser_idnot_in: str | Unset = UNSET, - filterapi_key_ideq: str | Unset = UNSET, - filterapi_key_idnot_eq: str | Unset = UNSET, - filterapi_key_idin: str | Unset = UNSET, - filterapi_key_idnot_in: str | Unset = UNSET, - filtersourceeq: str | Unset = UNSET, - filtersourcenot_eq: str | Unset = UNSET, - filtersourcein: str | Unset = UNSET, - filtersourcenot_in: str | Unset = UNSET, - filteritem_typeeq: str | Unset = UNSET, - filteritem_typenot_eq: str | Unset = UNSET, - filteritem_typein: str | Unset = UNSET, - filteritem_typenot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filteruser_id: Union[Unset, str] = UNSET, + filterapi_key_id: Union[Unset, str] = UNSET, + filtersource: Union[Unset, str] = UNSET, + filteritem_type: Union[Unset, str] = UNSET, + filteruser_ideq: Union[Unset, str] = UNSET, + filteruser_idnot_eq: Union[Unset, str] = UNSET, + filteruser_idin: Union[Unset, str] = UNSET, + filteruser_idnot_in: Union[Unset, str] = UNSET, + filterapi_key_ideq: Union[Unset, str] = UNSET, + filterapi_key_idnot_eq: Union[Unset, str] = UNSET, + filterapi_key_idin: Union[Unset, str] = UNSET, + filterapi_key_idnot_in: Union[Unset, str] = UNSET, + filtersourceeq: Union[Unset, str] = UNSET, + filtersourcenot_eq: Union[Unset, str] = UNSET, + filtersourcein: Union[Unset, str] = UNSET, + filtersourcenot_in: Union[Unset, str] = UNSET, + filteritem_typeeq: Union[Unset, str] = UNSET, + filteritem_typenot_eq: Union[Unset, str] = UNSET, + filteritem_typein: Union[Unset, str] = UNSET, + filteritem_typenot_in: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -110,7 +109,7 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> AuditsList | None: +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[AuditsList]: if response.status_code == 200: response_200 = AuditsList.from_dict(response.json()) @@ -122,7 +121,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[AuditsList]: +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[AuditsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -134,68 +133,68 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filteruser_id: str | Unset = UNSET, - filterapi_key_id: str | Unset = UNSET, - filtersource: str | Unset = UNSET, - filteritem_type: str | Unset = UNSET, - filteruser_ideq: str | Unset = UNSET, - filteruser_idnot_eq: str | Unset = UNSET, - filteruser_idin: str | Unset = UNSET, - filteruser_idnot_in: str | Unset = UNSET, - filterapi_key_ideq: str | Unset = UNSET, - filterapi_key_idnot_eq: str | Unset = UNSET, - filterapi_key_idin: str | Unset = UNSET, - filterapi_key_idnot_in: str | Unset = UNSET, - filtersourceeq: str | Unset = UNSET, - filtersourcenot_eq: str | Unset = UNSET, - filtersourcein: str | Unset = UNSET, - filtersourcenot_in: str | Unset = UNSET, - filteritem_typeeq: str | Unset = UNSET, - filteritem_typenot_eq: str | Unset = UNSET, - filteritem_typein: str | Unset = UNSET, - filteritem_typenot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filteruser_id: Union[Unset, str] = UNSET, + filterapi_key_id: Union[Unset, str] = UNSET, + filtersource: Union[Unset, str] = UNSET, + filteritem_type: Union[Unset, str] = UNSET, + filteruser_ideq: Union[Unset, str] = UNSET, + filteruser_idnot_eq: Union[Unset, str] = UNSET, + filteruser_idin: Union[Unset, str] = UNSET, + filteruser_idnot_in: Union[Unset, str] = UNSET, + filterapi_key_ideq: Union[Unset, str] = UNSET, + filterapi_key_idnot_eq: Union[Unset, str] = UNSET, + filterapi_key_idin: Union[Unset, str] = UNSET, + filterapi_key_idnot_in: Union[Unset, str] = UNSET, + filtersourceeq: Union[Unset, str] = UNSET, + filtersourcenot_eq: Union[Unset, str] = UNSET, + filtersourcein: Union[Unset, str] = UNSET, + filtersourcenot_in: Union[Unset, str] = UNSET, + filteritem_typeeq: Union[Unset, str] = UNSET, + filteritem_typenot_eq: Union[Unset, str] = UNSET, + filteritem_typein: Union[Unset, str] = UNSET, + filteritem_typenot_in: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, ) -> Response[AuditsList]: """List audits List audits Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filteruser_id (str | Unset): - filterapi_key_id (str | Unset): - filtersource (str | Unset): - filteritem_type (str | Unset): - filteruser_ideq (str | Unset): - filteruser_idnot_eq (str | Unset): - filteruser_idin (str | Unset): - filteruser_idnot_in (str | Unset): - filterapi_key_ideq (str | Unset): - filterapi_key_idnot_eq (str | Unset): - filterapi_key_idin (str | Unset): - filterapi_key_idnot_in (str | Unset): - filtersourceeq (str | Unset): - filtersourcenot_eq (str | Unset): - filtersourcein (str | Unset): - filtersourcenot_in (str | Unset): - filteritem_typeeq (str | Unset): - filteritem_typenot_eq (str | Unset): - filteritem_typein (str | Unset): - filteritem_typenot_in (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filteruser_id (Union[Unset, str]): + filterapi_key_id (Union[Unset, str]): + filtersource (Union[Unset, str]): + filteritem_type (Union[Unset, str]): + filteruser_ideq (Union[Unset, str]): + filteruser_idnot_eq (Union[Unset, str]): + filteruser_idin (Union[Unset, str]): + filteruser_idnot_in (Union[Unset, str]): + filterapi_key_ideq (Union[Unset, str]): + filterapi_key_idnot_eq (Union[Unset, str]): + filterapi_key_idin (Union[Unset, str]): + filterapi_key_idnot_in (Union[Unset, str]): + filtersourceeq (Union[Unset, str]): + filtersourcenot_eq (Union[Unset, str]): + filtersourcein (Union[Unset, str]): + filtersourcenot_in (Union[Unset, str]): + filteritem_typeeq (Union[Unset, str]): + filteritem_typenot_eq (Union[Unset, str]): + filteritem_typein (Union[Unset, str]): + filteritem_typenot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -246,68 +245,68 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filteruser_id: str | Unset = UNSET, - filterapi_key_id: str | Unset = UNSET, - filtersource: str | Unset = UNSET, - filteritem_type: str | Unset = UNSET, - filteruser_ideq: str | Unset = UNSET, - filteruser_idnot_eq: str | Unset = UNSET, - filteruser_idin: str | Unset = UNSET, - filteruser_idnot_in: str | Unset = UNSET, - filterapi_key_ideq: str | Unset = UNSET, - filterapi_key_idnot_eq: str | Unset = UNSET, - filterapi_key_idin: str | Unset = UNSET, - filterapi_key_idnot_in: str | Unset = UNSET, - filtersourceeq: str | Unset = UNSET, - filtersourcenot_eq: str | Unset = UNSET, - filtersourcein: str | Unset = UNSET, - filtersourcenot_in: str | Unset = UNSET, - filteritem_typeeq: str | Unset = UNSET, - filteritem_typenot_eq: str | Unset = UNSET, - filteritem_typein: str | Unset = UNSET, - filteritem_typenot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, -) -> AuditsList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filteruser_id: Union[Unset, str] = UNSET, + filterapi_key_id: Union[Unset, str] = UNSET, + filtersource: Union[Unset, str] = UNSET, + filteritem_type: Union[Unset, str] = UNSET, + filteruser_ideq: Union[Unset, str] = UNSET, + filteruser_idnot_eq: Union[Unset, str] = UNSET, + filteruser_idin: Union[Unset, str] = UNSET, + filteruser_idnot_in: Union[Unset, str] = UNSET, + filterapi_key_ideq: Union[Unset, str] = UNSET, + filterapi_key_idnot_eq: Union[Unset, str] = UNSET, + filterapi_key_idin: Union[Unset, str] = UNSET, + filterapi_key_idnot_in: Union[Unset, str] = UNSET, + filtersourceeq: Union[Unset, str] = UNSET, + filtersourcenot_eq: Union[Unset, str] = UNSET, + filtersourcein: Union[Unset, str] = UNSET, + filtersourcenot_in: Union[Unset, str] = UNSET, + filteritem_typeeq: Union[Unset, str] = UNSET, + filteritem_typenot_eq: Union[Unset, str] = UNSET, + filteritem_typein: Union[Unset, str] = UNSET, + filteritem_typenot_in: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, +) -> Optional[AuditsList]: """List audits List audits Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filteruser_id (str | Unset): - filterapi_key_id (str | Unset): - filtersource (str | Unset): - filteritem_type (str | Unset): - filteruser_ideq (str | Unset): - filteruser_idnot_eq (str | Unset): - filteruser_idin (str | Unset): - filteruser_idnot_in (str | Unset): - filterapi_key_ideq (str | Unset): - filterapi_key_idnot_eq (str | Unset): - filterapi_key_idin (str | Unset): - filterapi_key_idnot_in (str | Unset): - filtersourceeq (str | Unset): - filtersourcenot_eq (str | Unset): - filtersourcein (str | Unset): - filtersourcenot_in (str | Unset): - filteritem_typeeq (str | Unset): - filteritem_typenot_eq (str | Unset): - filteritem_typein (str | Unset): - filteritem_typenot_in (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filteruser_id (Union[Unset, str]): + filterapi_key_id (Union[Unset, str]): + filtersource (Union[Unset, str]): + filteritem_type (Union[Unset, str]): + filteruser_ideq (Union[Unset, str]): + filteruser_idnot_eq (Union[Unset, str]): + filteruser_idin (Union[Unset, str]): + filteruser_idnot_in (Union[Unset, str]): + filterapi_key_ideq (Union[Unset, str]): + filterapi_key_idnot_eq (Union[Unset, str]): + filterapi_key_idin (Union[Unset, str]): + filterapi_key_idnot_in (Union[Unset, str]): + filtersourceeq (Union[Unset, str]): + filtersourcenot_eq (Union[Unset, str]): + filtersourcein (Union[Unset, str]): + filtersourcenot_in (Union[Unset, str]): + filteritem_typeeq (Union[Unset, str]): + filteritem_typenot_eq (Union[Unset, str]): + filteritem_typein (Union[Unset, str]): + filteritem_typenot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -353,68 +352,68 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filteruser_id: str | Unset = UNSET, - filterapi_key_id: str | Unset = UNSET, - filtersource: str | Unset = UNSET, - filteritem_type: str | Unset = UNSET, - filteruser_ideq: str | Unset = UNSET, - filteruser_idnot_eq: str | Unset = UNSET, - filteruser_idin: str | Unset = UNSET, - filteruser_idnot_in: str | Unset = UNSET, - filterapi_key_ideq: str | Unset = UNSET, - filterapi_key_idnot_eq: str | Unset = UNSET, - filterapi_key_idin: str | Unset = UNSET, - filterapi_key_idnot_in: str | Unset = UNSET, - filtersourceeq: str | Unset = UNSET, - filtersourcenot_eq: str | Unset = UNSET, - filtersourcein: str | Unset = UNSET, - filtersourcenot_in: str | Unset = UNSET, - filteritem_typeeq: str | Unset = UNSET, - filteritem_typenot_eq: str | Unset = UNSET, - filteritem_typein: str | Unset = UNSET, - filteritem_typenot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filteruser_id: Union[Unset, str] = UNSET, + filterapi_key_id: Union[Unset, str] = UNSET, + filtersource: Union[Unset, str] = UNSET, + filteritem_type: Union[Unset, str] = UNSET, + filteruser_ideq: Union[Unset, str] = UNSET, + filteruser_idnot_eq: Union[Unset, str] = UNSET, + filteruser_idin: Union[Unset, str] = UNSET, + filteruser_idnot_in: Union[Unset, str] = UNSET, + filterapi_key_ideq: Union[Unset, str] = UNSET, + filterapi_key_idnot_eq: Union[Unset, str] = UNSET, + filterapi_key_idin: Union[Unset, str] = UNSET, + filterapi_key_idnot_in: Union[Unset, str] = UNSET, + filtersourceeq: Union[Unset, str] = UNSET, + filtersourcenot_eq: Union[Unset, str] = UNSET, + filtersourcein: Union[Unset, str] = UNSET, + filtersourcenot_in: Union[Unset, str] = UNSET, + filteritem_typeeq: Union[Unset, str] = UNSET, + filteritem_typenot_eq: Union[Unset, str] = UNSET, + filteritem_typein: Union[Unset, str] = UNSET, + filteritem_typenot_in: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, ) -> Response[AuditsList]: """List audits List audits Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filteruser_id (str | Unset): - filterapi_key_id (str | Unset): - filtersource (str | Unset): - filteritem_type (str | Unset): - filteruser_ideq (str | Unset): - filteruser_idnot_eq (str | Unset): - filteruser_idin (str | Unset): - filteruser_idnot_in (str | Unset): - filterapi_key_ideq (str | Unset): - filterapi_key_idnot_eq (str | Unset): - filterapi_key_idin (str | Unset): - filterapi_key_idnot_in (str | Unset): - filtersourceeq (str | Unset): - filtersourcenot_eq (str | Unset): - filtersourcein (str | Unset): - filtersourcenot_in (str | Unset): - filteritem_typeeq (str | Unset): - filteritem_typenot_eq (str | Unset): - filteritem_typein (str | Unset): - filteritem_typenot_in (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filteruser_id (Union[Unset, str]): + filterapi_key_id (Union[Unset, str]): + filtersource (Union[Unset, str]): + filteritem_type (Union[Unset, str]): + filteruser_ideq (Union[Unset, str]): + filteruser_idnot_eq (Union[Unset, str]): + filteruser_idin (Union[Unset, str]): + filteruser_idnot_in (Union[Unset, str]): + filterapi_key_ideq (Union[Unset, str]): + filterapi_key_idnot_eq (Union[Unset, str]): + filterapi_key_idin (Union[Unset, str]): + filterapi_key_idnot_in (Union[Unset, str]): + filtersourceeq (Union[Unset, str]): + filtersourcenot_eq (Union[Unset, str]): + filtersourcein (Union[Unset, str]): + filtersourcenot_in (Union[Unset, str]): + filteritem_typeeq (Union[Unset, str]): + filteritem_typenot_eq (Union[Unset, str]): + filteritem_typein (Union[Unset, str]): + filteritem_typenot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -463,68 +462,68 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filteruser_id: str | Unset = UNSET, - filterapi_key_id: str | Unset = UNSET, - filtersource: str | Unset = UNSET, - filteritem_type: str | Unset = UNSET, - filteruser_ideq: str | Unset = UNSET, - filteruser_idnot_eq: str | Unset = UNSET, - filteruser_idin: str | Unset = UNSET, - filteruser_idnot_in: str | Unset = UNSET, - filterapi_key_ideq: str | Unset = UNSET, - filterapi_key_idnot_eq: str | Unset = UNSET, - filterapi_key_idin: str | Unset = UNSET, - filterapi_key_idnot_in: str | Unset = UNSET, - filtersourceeq: str | Unset = UNSET, - filtersourcenot_eq: str | Unset = UNSET, - filtersourcein: str | Unset = UNSET, - filtersourcenot_in: str | Unset = UNSET, - filteritem_typeeq: str | Unset = UNSET, - filteritem_typenot_eq: str | Unset = UNSET, - filteritem_typein: str | Unset = UNSET, - filteritem_typenot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, -) -> AuditsList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filteruser_id: Union[Unset, str] = UNSET, + filterapi_key_id: Union[Unset, str] = UNSET, + filtersource: Union[Unset, str] = UNSET, + filteritem_type: Union[Unset, str] = UNSET, + filteruser_ideq: Union[Unset, str] = UNSET, + filteruser_idnot_eq: Union[Unset, str] = UNSET, + filteruser_idin: Union[Unset, str] = UNSET, + filteruser_idnot_in: Union[Unset, str] = UNSET, + filterapi_key_ideq: Union[Unset, str] = UNSET, + filterapi_key_idnot_eq: Union[Unset, str] = UNSET, + filterapi_key_idin: Union[Unset, str] = UNSET, + filterapi_key_idnot_in: Union[Unset, str] = UNSET, + filtersourceeq: Union[Unset, str] = UNSET, + filtersourcenot_eq: Union[Unset, str] = UNSET, + filtersourcein: Union[Unset, str] = UNSET, + filtersourcenot_in: Union[Unset, str] = UNSET, + filteritem_typeeq: Union[Unset, str] = UNSET, + filteritem_typenot_eq: Union[Unset, str] = UNSET, + filteritem_typein: Union[Unset, str] = UNSET, + filteritem_typenot_in: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, +) -> Optional[AuditsList]: """List audits List audits Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filteruser_id (str | Unset): - filterapi_key_id (str | Unset): - filtersource (str | Unset): - filteritem_type (str | Unset): - filteruser_ideq (str | Unset): - filteruser_idnot_eq (str | Unset): - filteruser_idin (str | Unset): - filteruser_idnot_in (str | Unset): - filterapi_key_ideq (str | Unset): - filterapi_key_idnot_eq (str | Unset): - filterapi_key_idin (str | Unset): - filterapi_key_idnot_in (str | Unset): - filtersourceeq (str | Unset): - filtersourcenot_eq (str | Unset): - filtersourcein (str | Unset): - filtersourcenot_in (str | Unset): - filteritem_typeeq (str | Unset): - filteritem_typenot_eq (str | Unset): - filteritem_typein (str | Unset): - filteritem_typenot_in (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filteruser_id (Union[Unset, str]): + filterapi_key_id (Union[Unset, str]): + filtersource (Union[Unset, str]): + filteritem_type (Union[Unset, str]): + filteruser_ideq (Union[Unset, str]): + filteruser_idnot_eq (Union[Unset, str]): + filteruser_idin (Union[Unset, str]): + filteruser_idnot_in (Union[Unset, str]): + filterapi_key_ideq (Union[Unset, str]): + filterapi_key_idnot_eq (Union[Unset, str]): + filterapi_key_idin (Union[Unset, str]): + filterapi_key_idnot_in (Union[Unset, str]): + filtersourceeq (Union[Unset, str]): + filtersourcenot_eq (Union[Unset, str]): + filtersourcein (Union[Unset, str]): + filtersourcenot_in (Union[Unset, str]): + filteritem_typeeq (Union[Unset, str]): + filteritem_typenot_eq (Union[Unset, str]): + filteritem_typein (Union[Unset, str]): + filteritem_typenot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/authorizations/create_authorization.py b/rootly_sdk/api/authorizations/create_authorization.py index 2d0bfee5..3d6f1257 100644 --- a/rootly_sdk/api/authorizations/create_authorization.py +++ b/rootly_sdk/api/authorizations/create_authorization.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AuthorizationResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[AuthorizationResponse, ErrorsList]]: if response.status_code == 201: response_201 = AuthorizationResponse.from_dict(response.json()) @@ -50,8 +50,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AuthorizationResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[AuthorizationResponse, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -64,7 +64,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewAuthorization, -) -> Response[AuthorizationResponse | ErrorsList]: +) -> Response[Union[AuthorizationResponse, ErrorsList]]: """Creates an authorization Creates a new authorization from provided data @@ -77,7 +77,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AuthorizationResponse | ErrorsList] + Response[Union[AuthorizationResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -95,7 +95,7 @@ def sync( *, client: AuthenticatedClient, body: NewAuthorization, -) -> AuthorizationResponse | ErrorsList | None: +) -> Optional[Union[AuthorizationResponse, ErrorsList]]: """Creates an authorization Creates a new authorization from provided data @@ -108,7 +108,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AuthorizationResponse | ErrorsList + Union[AuthorizationResponse, ErrorsList] """ return sync_detailed( @@ -121,7 +121,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewAuthorization, -) -> Response[AuthorizationResponse | ErrorsList]: +) -> Response[Union[AuthorizationResponse, ErrorsList]]: """Creates an authorization Creates a new authorization from provided data @@ -134,7 +134,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AuthorizationResponse | ErrorsList] + Response[Union[AuthorizationResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -150,7 +150,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewAuthorization, -) -> AuthorizationResponse | ErrorsList | None: +) -> Optional[Union[AuthorizationResponse, ErrorsList]]: """Creates an authorization Creates a new authorization from provided data @@ -163,7 +163,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AuthorizationResponse | ErrorsList + Union[AuthorizationResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/authorizations/delete_authorization.py b/rootly_sdk/api/authorizations/delete_authorization.py index 9fed121b..00afe7d4 100644 --- a/rootly_sdk/api/authorizations/delete_authorization.py +++ b/rootly_sdk/api/authorizations/delete_authorization.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/authorizations/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/authorizations/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AuthorizationResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[AuthorizationResponse, ErrorsList]]: if response.status_code == 200: response_200 = AuthorizationResponse.from_dict(response.json()) @@ -45,8 +41,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AuthorizationResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[AuthorizationResponse, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[AuthorizationResponse | ErrorsList]: +) -> Response[Union[AuthorizationResponse, ErrorsList]]: """Delete an authorization Delete a specific authorization by id @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AuthorizationResponse | ErrorsList] + Response[Union[AuthorizationResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -90,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> AuthorizationResponse | ErrorsList | None: +) -> Optional[Union[AuthorizationResponse, ErrorsList]]: """Delete an authorization Delete a specific authorization by id @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AuthorizationResponse | ErrorsList + Union[AuthorizationResponse, ErrorsList] """ return sync_detailed( @@ -116,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[AuthorizationResponse | ErrorsList]: +) -> Response[Union[AuthorizationResponse, ErrorsList]]: """Delete an authorization Delete a specific authorization by id @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AuthorizationResponse | ErrorsList] + Response[Union[AuthorizationResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -145,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> AuthorizationResponse | ErrorsList | None: +) -> Optional[Union[AuthorizationResponse, ErrorsList]]: """Delete an authorization Delete a specific authorization by id @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AuthorizationResponse | ErrorsList + Union[AuthorizationResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/authorizations/get_authorization.py b/rootly_sdk/api/authorizations/get_authorization.py index c58b0704..e54e9d6f 100644 --- a/rootly_sdk/api/authorizations/get_authorization.py +++ b/rootly_sdk/api/authorizations/get_authorization.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/authorizations/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/authorizations/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AuthorizationResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[AuthorizationResponse, ErrorsList]]: if response.status_code == 200: response_200 = AuthorizationResponse.from_dict(response.json()) @@ -45,8 +41,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AuthorizationResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[AuthorizationResponse, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[AuthorizationResponse | ErrorsList]: +) -> Response[Union[AuthorizationResponse, ErrorsList]]: """Retrieves an authorization Retrieves a specific authorization by id @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AuthorizationResponse | ErrorsList] + Response[Union[AuthorizationResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -90,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> AuthorizationResponse | ErrorsList | None: +) -> Optional[Union[AuthorizationResponse, ErrorsList]]: """Retrieves an authorization Retrieves a specific authorization by id @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AuthorizationResponse | ErrorsList + Union[AuthorizationResponse, ErrorsList] """ return sync_detailed( @@ -116,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[AuthorizationResponse | ErrorsList]: +) -> Response[Union[AuthorizationResponse, ErrorsList]]: """Retrieves an authorization Retrieves a specific authorization by id @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AuthorizationResponse | ErrorsList] + Response[Union[AuthorizationResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -145,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> AuthorizationResponse | ErrorsList | None: +) -> Optional[Union[AuthorizationResponse, ErrorsList]]: """Retrieves an authorization Retrieves a specific authorization by id @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AuthorizationResponse | ErrorsList + Union[AuthorizationResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/authorizations/list_authorizations.py b/rootly_sdk/api/authorizations/list_authorizations.py index 46d7343d..7877045f 100644 --- a/rootly_sdk/api/authorizations/list_authorizations.py +++ b/rootly_sdk/api/authorizations/list_authorizations.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -11,20 +11,19 @@ def _get_kwargs( *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterauthorizable_id: str | Unset = UNSET, - filterauthorizable_type: str | Unset = UNSET, - filtergrantee_id: str | Unset = UNSET, - filtergrantee_type: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterauthorizable_id: Union[Unset, str] = UNSET, + filterauthorizable_type: Union[Unset, str] = UNSET, + filtergrantee_id: Union[Unset, str] = UNSET, + filtergrantee_type: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -62,7 +61,9 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> AuthorizationList | None: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[AuthorizationList]: if response.status_code == 200: response_200 = AuthorizationList.from_dict(response.json()) @@ -74,7 +75,9 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[AuthorizationList]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[AuthorizationList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -86,36 +89,36 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterauthorizable_id: str | Unset = UNSET, - filterauthorizable_type: str | Unset = UNSET, - filtergrantee_id: str | Unset = UNSET, - filtergrantee_type: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterauthorizable_id: Union[Unset, str] = UNSET, + filterauthorizable_type: Union[Unset, str] = UNSET, + filtergrantee_id: Union[Unset, str] = UNSET, + filtergrantee_type: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, ) -> Response[AuthorizationList]: """List authorizations List authorizations Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterauthorizable_id (str | Unset): - filterauthorizable_type (str | Unset): - filtergrantee_id (str | Unset): - filtergrantee_type (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterauthorizable_id (Union[Unset, str]): + filterauthorizable_type (Union[Unset, str]): + filtergrantee_id (Union[Unset, str]): + filtergrantee_type (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -150,36 +153,36 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterauthorizable_id: str | Unset = UNSET, - filterauthorizable_type: str | Unset = UNSET, - filtergrantee_id: str | Unset = UNSET, - filtergrantee_type: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, -) -> AuthorizationList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterauthorizable_id: Union[Unset, str] = UNSET, + filterauthorizable_type: Union[Unset, str] = UNSET, + filtergrantee_id: Union[Unset, str] = UNSET, + filtergrantee_type: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, +) -> Optional[AuthorizationList]: """List authorizations List authorizations Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterauthorizable_id (str | Unset): - filterauthorizable_type (str | Unset): - filtergrantee_id (str | Unset): - filtergrantee_type (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterauthorizable_id (Union[Unset, str]): + filterauthorizable_type (Union[Unset, str]): + filtergrantee_id (Union[Unset, str]): + filtergrantee_type (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -209,36 +212,36 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterauthorizable_id: str | Unset = UNSET, - filterauthorizable_type: str | Unset = UNSET, - filtergrantee_id: str | Unset = UNSET, - filtergrantee_type: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterauthorizable_id: Union[Unset, str] = UNSET, + filterauthorizable_type: Union[Unset, str] = UNSET, + filtergrantee_id: Union[Unset, str] = UNSET, + filtergrantee_type: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, ) -> Response[AuthorizationList]: """List authorizations List authorizations Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterauthorizable_id (str | Unset): - filterauthorizable_type (str | Unset): - filtergrantee_id (str | Unset): - filtergrantee_type (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterauthorizable_id (Union[Unset, str]): + filterauthorizable_type (Union[Unset, str]): + filtergrantee_id (Union[Unset, str]): + filtergrantee_type (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -271,36 +274,36 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterauthorizable_id: str | Unset = UNSET, - filterauthorizable_type: str | Unset = UNSET, - filtergrantee_id: str | Unset = UNSET, - filtergrantee_type: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, -) -> AuthorizationList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterauthorizable_id: Union[Unset, str] = UNSET, + filterauthorizable_type: Union[Unset, str] = UNSET, + filtergrantee_id: Union[Unset, str] = UNSET, + filtergrantee_type: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, +) -> Optional[AuthorizationList]: """List authorizations List authorizations Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterauthorizable_id (str | Unset): - filterauthorizable_type (str | Unset): - filtergrantee_id (str | Unset): - filtergrantee_type (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterauthorizable_id (Union[Unset, str]): + filterauthorizable_type (Union[Unset, str]): + filtergrantee_id (Union[Unset, str]): + filtergrantee_type (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/authorizations/update_authorization.py b/rootly_sdk/api/authorizations/update_authorization.py index 958e25ad..d5e4d6d3 100644 --- a/rootly_sdk/api/authorizations/update_authorization.py +++ b/rootly_sdk/api/authorizations/update_authorization.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/authorizations/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/authorizations/{id}", } _kwargs["json"] = body.to_dict() @@ -35,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AuthorizationResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[AuthorizationResponse, ErrorsList]]: if response.status_code == 200: response_200 = AuthorizationResponse.from_dict(response.json()) @@ -54,8 +51,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AuthorizationResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[AuthorizationResponse, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateAuthorization, -) -> Response[AuthorizationResponse | ErrorsList]: +) -> Response[Union[AuthorizationResponse, ErrorsList]]: """Update an authorization Update a specific authorization by id @@ -83,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AuthorizationResponse | ErrorsList] + Response[Union[AuthorizationResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -103,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateAuthorization, -) -> AuthorizationResponse | ErrorsList | None: +) -> Optional[Union[AuthorizationResponse, ErrorsList]]: """Update an authorization Update a specific authorization by id @@ -117,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AuthorizationResponse | ErrorsList + Union[AuthorizationResponse, ErrorsList] """ return sync_detailed( @@ -132,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateAuthorization, -) -> Response[AuthorizationResponse | ErrorsList]: +) -> Response[Union[AuthorizationResponse, ErrorsList]]: """Update an authorization Update a specific authorization by id @@ -146,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AuthorizationResponse | ErrorsList] + Response[Union[AuthorizationResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -164,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateAuthorization, -) -> AuthorizationResponse | ErrorsList | None: +) -> Optional[Union[AuthorizationResponse, ErrorsList]]: """Update an authorization Update a specific authorization by id @@ -178,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AuthorizationResponse | ErrorsList + Union[AuthorizationResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/catalog_checklist_templates/create_catalog_checklist_template.py b/rootly_sdk/api/catalog_checklist_templates/create_catalog_checklist_template.py index a0c9a8cf..e28bb282 100644 --- a/rootly_sdk/api/catalog_checklist_templates/create_catalog_checklist_template.py +++ b/rootly_sdk/api/catalog_checklist_templates/create_catalog_checklist_template.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> CatalogChecklistTemplateResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[CatalogChecklistTemplateResponse, ErrorsList]]: if response.status_code == 201: response_201 = CatalogChecklistTemplateResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[CatalogChecklistTemplateResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[CatalogChecklistTemplateResponse, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +69,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewCatalogChecklistTemplate, -) -> Response[CatalogChecklistTemplateResponse | ErrorsList]: +) -> Response[Union[CatalogChecklistTemplateResponse, ErrorsList]]: """Creates a catalog checklist template Creates a new catalog checklist template @@ -82,7 +82,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CatalogChecklistTemplateResponse | ErrorsList] + Response[Union[CatalogChecklistTemplateResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: NewCatalogChecklistTemplate, -) -> CatalogChecklistTemplateResponse | ErrorsList | None: +) -> Optional[Union[CatalogChecklistTemplateResponse, ErrorsList]]: """Creates a catalog checklist template Creates a new catalog checklist template @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CatalogChecklistTemplateResponse | ErrorsList + Union[CatalogChecklistTemplateResponse, ErrorsList] """ return sync_detailed( @@ -126,7 +126,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewCatalogChecklistTemplate, -) -> Response[CatalogChecklistTemplateResponse | ErrorsList]: +) -> Response[Union[CatalogChecklistTemplateResponse, ErrorsList]]: """Creates a catalog checklist template Creates a new catalog checklist template @@ -139,7 +139,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CatalogChecklistTemplateResponse | ErrorsList] + Response[Union[CatalogChecklistTemplateResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -155,7 +155,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewCatalogChecklistTemplate, -) -> CatalogChecklistTemplateResponse | ErrorsList | None: +) -> Optional[Union[CatalogChecklistTemplateResponse, ErrorsList]]: """Creates a catalog checklist template Creates a new catalog checklist template @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CatalogChecklistTemplateResponse | ErrorsList + Union[CatalogChecklistTemplateResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/catalog_checklist_templates/delete_catalog_checklist_template.py b/rootly_sdk/api/catalog_checklist_templates/delete_catalog_checklist_template.py index e96022f3..f4b0be89 100644 --- a/rootly_sdk/api/catalog_checklist_templates/delete_catalog_checklist_template.py +++ b/rootly_sdk/api/catalog_checklist_templates/delete_catalog_checklist_template.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union from uuid import UUID import httpx @@ -13,22 +12,19 @@ def _get_kwargs( - id: str | UUID, + id: Union[UUID, str], ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/catalog_checklist_templates/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/catalog_checklist_templates/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> CatalogChecklistTemplateResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[CatalogChecklistTemplateResponse, ErrorsList]]: if response.status_code == 200: response_200 = CatalogChecklistTemplateResponse.from_dict(response.json()) @@ -46,8 +42,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[CatalogChecklistTemplateResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[CatalogChecklistTemplateResponse, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -57,23 +53,23 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Response[CatalogChecklistTemplateResponse | ErrorsList]: +) -> Response[Union[CatalogChecklistTemplateResponse, ErrorsList]]: """Delete a catalog checklist template Delete a specific catalog checklist template by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CatalogChecklistTemplateResponse | ErrorsList] + Response[Union[CatalogChecklistTemplateResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -88,23 +84,23 @@ def sync_detailed( def sync( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> CatalogChecklistTemplateResponse | ErrorsList | None: +) -> Optional[Union[CatalogChecklistTemplateResponse, ErrorsList]]: """Delete a catalog checklist template Delete a specific catalog checklist template by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CatalogChecklistTemplateResponse | ErrorsList + Union[CatalogChecklistTemplateResponse, ErrorsList] """ return sync_detailed( @@ -114,23 +110,23 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Response[CatalogChecklistTemplateResponse | ErrorsList]: +) -> Response[Union[CatalogChecklistTemplateResponse, ErrorsList]]: """Delete a catalog checklist template Delete a specific catalog checklist template by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CatalogChecklistTemplateResponse | ErrorsList] + Response[Union[CatalogChecklistTemplateResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -143,23 +139,23 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> CatalogChecklistTemplateResponse | ErrorsList | None: +) -> Optional[Union[CatalogChecklistTemplateResponse, ErrorsList]]: """Delete a catalog checklist template Delete a specific catalog checklist template by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CatalogChecklistTemplateResponse | ErrorsList + Union[CatalogChecklistTemplateResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/catalog_checklist_templates/get_catalog_checklist_template.py b/rootly_sdk/api/catalog_checklist_templates/get_catalog_checklist_template.py index baaac4c8..e4ef31cd 100644 --- a/rootly_sdk/api/catalog_checklist_templates/get_catalog_checklist_template.py +++ b/rootly_sdk/api/catalog_checklist_templates/get_catalog_checklist_template.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union from uuid import UUID import httpx @@ -13,22 +12,19 @@ def _get_kwargs( - id: str | UUID, + id: Union[UUID, str], ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/catalog_checklist_templates/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/catalog_checklist_templates/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> CatalogChecklistTemplateResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[CatalogChecklistTemplateResponse, ErrorsList]]: if response.status_code == 200: response_200 = CatalogChecklistTemplateResponse.from_dict(response.json()) @@ -46,8 +42,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[CatalogChecklistTemplateResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[CatalogChecklistTemplateResponse, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -57,23 +53,23 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Response[CatalogChecklistTemplateResponse | ErrorsList]: +) -> Response[Union[CatalogChecklistTemplateResponse, ErrorsList]]: """Retrieves a catalog checklist template Retrieves a specific catalog checklist template by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CatalogChecklistTemplateResponse | ErrorsList] + Response[Union[CatalogChecklistTemplateResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -88,23 +84,23 @@ def sync_detailed( def sync( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> CatalogChecklistTemplateResponse | ErrorsList | None: +) -> Optional[Union[CatalogChecklistTemplateResponse, ErrorsList]]: """Retrieves a catalog checklist template Retrieves a specific catalog checklist template by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CatalogChecklistTemplateResponse | ErrorsList + Union[CatalogChecklistTemplateResponse, ErrorsList] """ return sync_detailed( @@ -114,23 +110,23 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Response[CatalogChecklistTemplateResponse | ErrorsList]: +) -> Response[Union[CatalogChecklistTemplateResponse, ErrorsList]]: """Retrieves a catalog checklist template Retrieves a specific catalog checklist template by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CatalogChecklistTemplateResponse | ErrorsList] + Response[Union[CatalogChecklistTemplateResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -143,23 +139,23 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> CatalogChecklistTemplateResponse | ErrorsList | None: +) -> Optional[Union[CatalogChecklistTemplateResponse, ErrorsList]]: """Retrieves a catalog checklist template Retrieves a specific catalog checklist template by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CatalogChecklistTemplateResponse | ErrorsList + Union[CatalogChecklistTemplateResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/catalog_checklist_templates/list_catalog_checklist_templates.py b/rootly_sdk/api/catalog_checklist_templates/list_catalog_checklist_templates.py index 4b04ef57..c36c8ac8 100644 --- a/rootly_sdk/api/catalog_checklist_templates/list_catalog_checklist_templates.py +++ b/rootly_sdk/api/catalog_checklist_templates/list_catalog_checklist_templates.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -17,29 +17,28 @@ def _get_kwargs( *, - include: ListCatalogChecklistTemplatesInclude | Unset = UNSET, - sort: ListCatalogChecklistTemplatesSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtercatalog_type: str | Unset = UNSET, - filterscope_type: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Union[Unset, ListCatalogChecklistTemplatesInclude] = UNSET, + sort: Union[Unset, ListCatalogChecklistTemplatesSort] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtercatalog_type: Union[Unset, str] = UNSET, + filterscope_type: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} - json_include: str | Unset = UNSET + json_include: Union[Unset, str] = UNSET if not isinstance(include, Unset): json_include = include params["include"] = json_include - json_sort: str | Unset = UNSET + json_sort: Union[Unset, str] = UNSET if not isinstance(sort, Unset): json_sort = sort @@ -77,8 +76,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> CatalogChecklistTemplateList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[CatalogChecklistTemplateList]: if response.status_code == 200: response_200 = CatalogChecklistTemplateList.from_dict(response.json()) @@ -91,7 +90,7 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[CatalogChecklistTemplateList]: return Response( status_code=HTTPStatus(response.status_code), @@ -104,36 +103,36 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - include: ListCatalogChecklistTemplatesInclude | Unset = UNSET, - sort: ListCatalogChecklistTemplatesSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtercatalog_type: str | Unset = UNSET, - filterscope_type: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Union[Unset, ListCatalogChecklistTemplatesInclude] = UNSET, + sort: Union[Unset, ListCatalogChecklistTemplatesSort] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtercatalog_type: Union[Unset, str] = UNSET, + filterscope_type: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, ) -> Response[CatalogChecklistTemplateList]: """List catalog checklist templates List catalog checklist templates Args: - include (ListCatalogChecklistTemplatesInclude | Unset): - sort (ListCatalogChecklistTemplatesSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtername (str | Unset): - filterslug (str | Unset): - filtercatalog_type (str | Unset): - filterscope_type (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, ListCatalogChecklistTemplatesInclude]): + sort (Union[Unset, ListCatalogChecklistTemplatesSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtername (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtercatalog_type (Union[Unset, str]): + filterscope_type (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -168,36 +167,36 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: ListCatalogChecklistTemplatesInclude | Unset = UNSET, - sort: ListCatalogChecklistTemplatesSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtercatalog_type: str | Unset = UNSET, - filterscope_type: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, -) -> CatalogChecklistTemplateList | None: + include: Union[Unset, ListCatalogChecklistTemplatesInclude] = UNSET, + sort: Union[Unset, ListCatalogChecklistTemplatesSort] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtercatalog_type: Union[Unset, str] = UNSET, + filterscope_type: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, +) -> Optional[CatalogChecklistTemplateList]: """List catalog checklist templates List catalog checklist templates Args: - include (ListCatalogChecklistTemplatesInclude | Unset): - sort (ListCatalogChecklistTemplatesSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtername (str | Unset): - filterslug (str | Unset): - filtercatalog_type (str | Unset): - filterscope_type (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, ListCatalogChecklistTemplatesInclude]): + sort (Union[Unset, ListCatalogChecklistTemplatesSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtername (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtercatalog_type (Union[Unset, str]): + filterscope_type (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -227,36 +226,36 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: ListCatalogChecklistTemplatesInclude | Unset = UNSET, - sort: ListCatalogChecklistTemplatesSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtercatalog_type: str | Unset = UNSET, - filterscope_type: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Union[Unset, ListCatalogChecklistTemplatesInclude] = UNSET, + sort: Union[Unset, ListCatalogChecklistTemplatesSort] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtercatalog_type: Union[Unset, str] = UNSET, + filterscope_type: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, ) -> Response[CatalogChecklistTemplateList]: """List catalog checklist templates List catalog checklist templates Args: - include (ListCatalogChecklistTemplatesInclude | Unset): - sort (ListCatalogChecklistTemplatesSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtername (str | Unset): - filterslug (str | Unset): - filtercatalog_type (str | Unset): - filterscope_type (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, ListCatalogChecklistTemplatesInclude]): + sort (Union[Unset, ListCatalogChecklistTemplatesSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtername (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtercatalog_type (Union[Unset, str]): + filterscope_type (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -289,36 +288,36 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: ListCatalogChecklistTemplatesInclude | Unset = UNSET, - sort: ListCatalogChecklistTemplatesSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtercatalog_type: str | Unset = UNSET, - filterscope_type: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, -) -> CatalogChecklistTemplateList | None: + include: Union[Unset, ListCatalogChecklistTemplatesInclude] = UNSET, + sort: Union[Unset, ListCatalogChecklistTemplatesSort] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtercatalog_type: Union[Unset, str] = UNSET, + filterscope_type: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, +) -> Optional[CatalogChecklistTemplateList]: """List catalog checklist templates List catalog checklist templates Args: - include (ListCatalogChecklistTemplatesInclude | Unset): - sort (ListCatalogChecklistTemplatesSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtername (str | Unset): - filterslug (str | Unset): - filtercatalog_type (str | Unset): - filterscope_type (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, ListCatalogChecklistTemplatesInclude]): + sort (Union[Unset, ListCatalogChecklistTemplatesSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtername (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtercatalog_type (Union[Unset, str]): + filterscope_type (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/catalog_checklist_templates/trigger_catalog_checklist_template.py b/rootly_sdk/api/catalog_checklist_templates/trigger_catalog_checklist_template.py index 03363ecf..47561a90 100644 --- a/rootly_sdk/api/catalog_checklist_templates/trigger_catalog_checklist_template.py +++ b/rootly_sdk/api/catalog_checklist_templates/trigger_catalog_checklist_template.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any, cast -from urllib.parse import quote +from typing import Any, Optional, Union, cast from uuid import UUID import httpx @@ -12,20 +11,19 @@ def _get_kwargs( - id: str | UUID, + id: Union[UUID, str], ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/catalog_checklist_templates/{id}/trigger".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/catalog_checklist_templates/{id}/trigger", } return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Any | ErrorsList | None: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorsList]]: if response.status_code == 202: response_202 = cast(Any, None) return response_202 @@ -41,7 +39,9 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Any | ErrorsList]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -51,23 +51,23 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Response[Any | ErrorsList]: +) -> Response[Union[Any, ErrorsList]]: """Trigger an audit for a catalog checklist template Triggers an audit for all applicable entities of the checklist template Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | ErrorsList] + Response[Union[Any, ErrorsList]] """ kwargs = _get_kwargs( @@ -82,23 +82,23 @@ def sync_detailed( def sync( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Any | ErrorsList | None: +) -> Optional[Union[Any, ErrorsList]]: """Trigger an audit for a catalog checklist template Triggers an audit for all applicable entities of the checklist template Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | ErrorsList + Union[Any, ErrorsList] """ return sync_detailed( @@ -108,23 +108,23 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Response[Any | ErrorsList]: +) -> Response[Union[Any, ErrorsList]]: """Trigger an audit for a catalog checklist template Triggers an audit for all applicable entities of the checklist template Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | ErrorsList] + Response[Union[Any, ErrorsList]] """ kwargs = _get_kwargs( @@ -137,23 +137,23 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Any | ErrorsList | None: +) -> Optional[Union[Any, ErrorsList]]: """Trigger an audit for a catalog checklist template Triggers an audit for all applicable entities of the checklist template Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | ErrorsList + Union[Any, ErrorsList] """ return ( diff --git a/rootly_sdk/api/catalog_checklist_templates/update_catalog_checklist_template.py b/rootly_sdk/api/catalog_checklist_templates/update_catalog_checklist_template.py index 180d4b3c..3a311850 100644 --- a/rootly_sdk/api/catalog_checklist_templates/update_catalog_checklist_template.py +++ b/rootly_sdk/api/catalog_checklist_templates/update_catalog_checklist_template.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union from uuid import UUID import httpx @@ -14,7 +13,7 @@ def _get_kwargs( - id: str | UUID, + id: Union[UUID, str], *, body: UpdateCatalogChecklistTemplate, ) -> dict[str, Any]: @@ -22,9 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/catalog_checklist_templates/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/catalog_checklist_templates/{id}", } _kwargs["json"] = body.to_dict() @@ -36,8 +33,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> CatalogChecklistTemplateResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[CatalogChecklistTemplateResponse, ErrorsList]]: if response.status_code == 200: response_200 = CatalogChecklistTemplateResponse.from_dict(response.json()) @@ -55,8 +52,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[CatalogChecklistTemplateResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[CatalogChecklistTemplateResponse, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,17 +63,17 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdateCatalogChecklistTemplate, -) -> Response[CatalogChecklistTemplateResponse | ErrorsList]: +) -> Response[Union[CatalogChecklistTemplateResponse, ErrorsList]]: """Update a catalog checklist template Update a specific catalog checklist template by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateCatalogChecklistTemplate): Raises: @@ -84,7 +81,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CatalogChecklistTemplateResponse | ErrorsList] + Response[Union[CatalogChecklistTemplateResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -100,17 +97,17 @@ def sync_detailed( def sync( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdateCatalogChecklistTemplate, -) -> CatalogChecklistTemplateResponse | ErrorsList | None: +) -> Optional[Union[CatalogChecklistTemplateResponse, ErrorsList]]: """Update a catalog checklist template Update a specific catalog checklist template by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateCatalogChecklistTemplate): Raises: @@ -118,7 +115,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CatalogChecklistTemplateResponse | ErrorsList + Union[CatalogChecklistTemplateResponse, ErrorsList] """ return sync_detailed( @@ -129,17 +126,17 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdateCatalogChecklistTemplate, -) -> Response[CatalogChecklistTemplateResponse | ErrorsList]: +) -> Response[Union[CatalogChecklistTemplateResponse, ErrorsList]]: """Update a catalog checklist template Update a specific catalog checklist template by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateCatalogChecklistTemplate): Raises: @@ -147,7 +144,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CatalogChecklistTemplateResponse | ErrorsList] + Response[Union[CatalogChecklistTemplateResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -161,17 +158,17 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdateCatalogChecklistTemplate, -) -> CatalogChecklistTemplateResponse | ErrorsList | None: +) -> Optional[Union[CatalogChecklistTemplateResponse, ErrorsList]]: """Update a catalog checklist template Update a specific catalog checklist template by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateCatalogChecklistTemplate): Raises: @@ -179,7 +176,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CatalogChecklistTemplateResponse | ErrorsList + Union[CatalogChecklistTemplateResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/catalog_entities/bulk_delete_catalog_entities.py b/rootly_sdk/api/catalog_entities/bulk_delete_catalog_entities.py index 2e7b988d..047595cc 100644 --- a/rootly_sdk/api/catalog_entities/bulk_delete_catalog_entities.py +++ b/rootly_sdk/api/catalog_entities/bulk_delete_catalog_entities.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -16,17 +15,16 @@ def _get_kwargs( catalog_id: str, *, - body: BulkDestroyCatalogEntitiesType0 | BulkDestroyCatalogEntitiesType1, + body: Union["BulkDestroyCatalogEntitiesType0", "BulkDestroyCatalogEntitiesType1"], ) -> dict[str, Any]: headers: dict[str, Any] = {} _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/catalogs/{catalog_id}/entities/bulk_delete".format( - catalog_id=quote(str(catalog_id), safe=""), - ), + "url": f"/v1/catalogs/{catalog_id}/entities/bulk_delete", } + _kwargs["json"]: dict[str, Any] if isinstance(body, BulkDestroyCatalogEntitiesType0): _kwargs["json"] = body.to_dict() else: @@ -39,8 +37,10 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> BulkDestroyCatalogEntitiesResponse | BulkDestroyCatalogEntitiesResponse | ErrorsList | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[ + Union[BulkDestroyCatalogEntitiesResponse, ErrorsList, Union["BulkDestroyCatalogEntitiesResponse", "ErrorsList"]] +]: if response.status_code == 200: response_200 = BulkDestroyCatalogEntitiesResponse.from_dict(response.json()) @@ -53,14 +53,14 @@ def _parse_response( if response.status_code == 422: - def _parse_response_422(data: object) -> BulkDestroyCatalogEntitiesResponse | ErrorsList: + def _parse_response_422(data: object) -> Union["BulkDestroyCatalogEntitiesResponse", "ErrorsList"]: try: if not isinstance(data, dict): raise TypeError() response_422_type_0 = ErrorsList.from_dict(data) return response_422_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass if not isinstance(data, dict): raise TypeError() @@ -79,8 +79,10 @@ def _parse_response_422(data: object) -> BulkDestroyCatalogEntitiesResponse | Er def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[BulkDestroyCatalogEntitiesResponse | BulkDestroyCatalogEntitiesResponse | ErrorsList | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[ + Union[BulkDestroyCatalogEntitiesResponse, ErrorsList, Union["BulkDestroyCatalogEntitiesResponse", "ErrorsList"]] +]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -93,8 +95,10 @@ def sync_detailed( catalog_id: str, *, client: AuthenticatedClient, - body: BulkDestroyCatalogEntitiesType0 | BulkDestroyCatalogEntitiesType1, -) -> Response[BulkDestroyCatalogEntitiesResponse | BulkDestroyCatalogEntitiesResponse | ErrorsList | ErrorsList]: + body: Union["BulkDestroyCatalogEntitiesType0", "BulkDestroyCatalogEntitiesType1"], +) -> Response[ + Union[BulkDestroyCatalogEntitiesResponse, ErrorsList, Union["BulkDestroyCatalogEntitiesResponse", "ErrorsList"]] +]: """Bulk delete Catalog Entities Delete catalog entities by external_id list, or prune by managed_by source. Two mutually exclusive @@ -102,8 +106,8 @@ def sync_detailed( Args: catalog_id (str): - body (BulkDestroyCatalogEntitiesType0 | BulkDestroyCatalogEntitiesType1): Two mutually - exclusive modes. Pass exactly one of: external_ids (delete specific entities) or + body (Union['BulkDestroyCatalogEntitiesType0', 'BulkDestroyCatalogEntitiesType1']): Two + mutually exclusive modes. Pass exactly one of: external_ids (delete specific entities) or managed_by (prune all managed entities not in keep set). Raises: @@ -111,7 +115,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[BulkDestroyCatalogEntitiesResponse | BulkDestroyCatalogEntitiesResponse | ErrorsList | ErrorsList] + Response[Union[BulkDestroyCatalogEntitiesResponse, ErrorsList, Union['BulkDestroyCatalogEntitiesResponse', 'ErrorsList']]] """ kwargs = _get_kwargs( @@ -130,8 +134,10 @@ def sync( catalog_id: str, *, client: AuthenticatedClient, - body: BulkDestroyCatalogEntitiesType0 | BulkDestroyCatalogEntitiesType1, -) -> BulkDestroyCatalogEntitiesResponse | BulkDestroyCatalogEntitiesResponse | ErrorsList | ErrorsList | None: + body: Union["BulkDestroyCatalogEntitiesType0", "BulkDestroyCatalogEntitiesType1"], +) -> Optional[ + Union[BulkDestroyCatalogEntitiesResponse, ErrorsList, Union["BulkDestroyCatalogEntitiesResponse", "ErrorsList"]] +]: """Bulk delete Catalog Entities Delete catalog entities by external_id list, or prune by managed_by source. Two mutually exclusive @@ -139,8 +145,8 @@ def sync( Args: catalog_id (str): - body (BulkDestroyCatalogEntitiesType0 | BulkDestroyCatalogEntitiesType1): Two mutually - exclusive modes. Pass exactly one of: external_ids (delete specific entities) or + body (Union['BulkDestroyCatalogEntitiesType0', 'BulkDestroyCatalogEntitiesType1']): Two + mutually exclusive modes. Pass exactly one of: external_ids (delete specific entities) or managed_by (prune all managed entities not in keep set). Raises: @@ -148,7 +154,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - BulkDestroyCatalogEntitiesResponse | BulkDestroyCatalogEntitiesResponse | ErrorsList | ErrorsList + Union[BulkDestroyCatalogEntitiesResponse, ErrorsList, Union['BulkDestroyCatalogEntitiesResponse', 'ErrorsList']] """ return sync_detailed( @@ -162,8 +168,10 @@ async def asyncio_detailed( catalog_id: str, *, client: AuthenticatedClient, - body: BulkDestroyCatalogEntitiesType0 | BulkDestroyCatalogEntitiesType1, -) -> Response[BulkDestroyCatalogEntitiesResponse | BulkDestroyCatalogEntitiesResponse | ErrorsList | ErrorsList]: + body: Union["BulkDestroyCatalogEntitiesType0", "BulkDestroyCatalogEntitiesType1"], +) -> Response[ + Union[BulkDestroyCatalogEntitiesResponse, ErrorsList, Union["BulkDestroyCatalogEntitiesResponse", "ErrorsList"]] +]: """Bulk delete Catalog Entities Delete catalog entities by external_id list, or prune by managed_by source. Two mutually exclusive @@ -171,8 +179,8 @@ async def asyncio_detailed( Args: catalog_id (str): - body (BulkDestroyCatalogEntitiesType0 | BulkDestroyCatalogEntitiesType1): Two mutually - exclusive modes. Pass exactly one of: external_ids (delete specific entities) or + body (Union['BulkDestroyCatalogEntitiesType0', 'BulkDestroyCatalogEntitiesType1']): Two + mutually exclusive modes. Pass exactly one of: external_ids (delete specific entities) or managed_by (prune all managed entities not in keep set). Raises: @@ -180,7 +188,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[BulkDestroyCatalogEntitiesResponse | BulkDestroyCatalogEntitiesResponse | ErrorsList | ErrorsList] + Response[Union[BulkDestroyCatalogEntitiesResponse, ErrorsList, Union['BulkDestroyCatalogEntitiesResponse', 'ErrorsList']]] """ kwargs = _get_kwargs( @@ -197,8 +205,10 @@ async def asyncio( catalog_id: str, *, client: AuthenticatedClient, - body: BulkDestroyCatalogEntitiesType0 | BulkDestroyCatalogEntitiesType1, -) -> BulkDestroyCatalogEntitiesResponse | BulkDestroyCatalogEntitiesResponse | ErrorsList | ErrorsList | None: + body: Union["BulkDestroyCatalogEntitiesType0", "BulkDestroyCatalogEntitiesType1"], +) -> Optional[ + Union[BulkDestroyCatalogEntitiesResponse, ErrorsList, Union["BulkDestroyCatalogEntitiesResponse", "ErrorsList"]] +]: """Bulk delete Catalog Entities Delete catalog entities by external_id list, or prune by managed_by source. Two mutually exclusive @@ -206,8 +216,8 @@ async def asyncio( Args: catalog_id (str): - body (BulkDestroyCatalogEntitiesType0 | BulkDestroyCatalogEntitiesType1): Two mutually - exclusive modes. Pass exactly one of: external_ids (delete specific entities) or + body (Union['BulkDestroyCatalogEntitiesType0', 'BulkDestroyCatalogEntitiesType1']): Two + mutually exclusive modes. Pass exactly one of: external_ids (delete specific entities) or managed_by (prune all managed entities not in keep set). Raises: @@ -215,7 +225,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - BulkDestroyCatalogEntitiesResponse | BulkDestroyCatalogEntitiesResponse | ErrorsList | ErrorsList + Union[BulkDestroyCatalogEntitiesResponse, ErrorsList, Union['BulkDestroyCatalogEntitiesResponse', 'ErrorsList']] """ return ( diff --git a/rootly_sdk/api/catalog_entities/bulk_upsert_catalog_entities.py b/rootly_sdk/api/catalog_entities/bulk_upsert_catalog_entities.py index 586bef40..85a0658d 100644 --- a/rootly_sdk/api/catalog_entities/bulk_upsert_catalog_entities.py +++ b/rootly_sdk/api/catalog_entities/bulk_upsert_catalog_entities.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -22,9 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/catalogs/{catalog_id}/entities/bulk_upsert".format( - catalog_id=quote(str(catalog_id), safe=""), - ), + "url": f"/v1/catalogs/{catalog_id}/entities/bulk_upsert", } _kwargs["json"] = body.to_dict() @@ -36,8 +33,10 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> BulkUpsertCatalogEntitiesError | ErrorsList | BulkUpsertCatalogEntitiesResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[ + Union[BulkUpsertCatalogEntitiesResponse, ErrorsList, Union["BulkUpsertCatalogEntitiesError", "ErrorsList"]] +]: if response.status_code == 200: response_200 = BulkUpsertCatalogEntitiesResponse.from_dict(response.json()) @@ -50,14 +49,14 @@ def _parse_response( if response.status_code == 422: - def _parse_response_422(data: object) -> BulkUpsertCatalogEntitiesError | ErrorsList: + def _parse_response_422(data: object) -> Union["BulkUpsertCatalogEntitiesError", "ErrorsList"]: try: if not isinstance(data, dict): raise TypeError() response_422_type_0 = ErrorsList.from_dict(data) return response_422_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass if not isinstance(data, dict): raise TypeError() @@ -76,8 +75,10 @@ def _parse_response_422(data: object) -> BulkUpsertCatalogEntitiesError | Errors def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[BulkUpsertCatalogEntitiesError | ErrorsList | BulkUpsertCatalogEntitiesResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[ + Union[BulkUpsertCatalogEntitiesResponse, ErrorsList, Union["BulkUpsertCatalogEntitiesError", "ErrorsList"]] +]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -91,7 +92,9 @@ def sync_detailed( *, client: AuthenticatedClient, body: BulkUpsertCatalogEntities, -) -> Response[BulkUpsertCatalogEntitiesError | ErrorsList | BulkUpsertCatalogEntitiesResponse | ErrorsList]: +) -> Response[ + Union[BulkUpsertCatalogEntitiesResponse, ErrorsList, Union["BulkUpsertCatalogEntitiesError", "ErrorsList"]] +]: """Bulk upsert Catalog Entities Create or update multiple catalog entities by external_id. Only attributes present in the payload @@ -106,7 +109,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[BulkUpsertCatalogEntitiesError | ErrorsList | BulkUpsertCatalogEntitiesResponse | ErrorsList] + Response[Union[BulkUpsertCatalogEntitiesResponse, ErrorsList, Union['BulkUpsertCatalogEntitiesError', 'ErrorsList']]] """ kwargs = _get_kwargs( @@ -126,7 +129,9 @@ def sync( *, client: AuthenticatedClient, body: BulkUpsertCatalogEntities, -) -> BulkUpsertCatalogEntitiesError | ErrorsList | BulkUpsertCatalogEntitiesResponse | ErrorsList | None: +) -> Optional[ + Union[BulkUpsertCatalogEntitiesResponse, ErrorsList, Union["BulkUpsertCatalogEntitiesError", "ErrorsList"]] +]: """Bulk upsert Catalog Entities Create or update multiple catalog entities by external_id. Only attributes present in the payload @@ -141,7 +146,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - BulkUpsertCatalogEntitiesError | ErrorsList | BulkUpsertCatalogEntitiesResponse | ErrorsList + Union[BulkUpsertCatalogEntitiesResponse, ErrorsList, Union['BulkUpsertCatalogEntitiesError', 'ErrorsList']] """ return sync_detailed( @@ -156,7 +161,9 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: BulkUpsertCatalogEntities, -) -> Response[BulkUpsertCatalogEntitiesError | ErrorsList | BulkUpsertCatalogEntitiesResponse | ErrorsList]: +) -> Response[ + Union[BulkUpsertCatalogEntitiesResponse, ErrorsList, Union["BulkUpsertCatalogEntitiesError", "ErrorsList"]] +]: """Bulk upsert Catalog Entities Create or update multiple catalog entities by external_id. Only attributes present in the payload @@ -171,7 +178,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[BulkUpsertCatalogEntitiesError | ErrorsList | BulkUpsertCatalogEntitiesResponse | ErrorsList] + Response[Union[BulkUpsertCatalogEntitiesResponse, ErrorsList, Union['BulkUpsertCatalogEntitiesError', 'ErrorsList']]] """ kwargs = _get_kwargs( @@ -189,7 +196,9 @@ async def asyncio( *, client: AuthenticatedClient, body: BulkUpsertCatalogEntities, -) -> BulkUpsertCatalogEntitiesError | ErrorsList | BulkUpsertCatalogEntitiesResponse | ErrorsList | None: +) -> Optional[ + Union[BulkUpsertCatalogEntitiesResponse, ErrorsList, Union["BulkUpsertCatalogEntitiesError", "ErrorsList"]] +]: """Bulk upsert Catalog Entities Create or update multiple catalog entities by external_id. Only attributes present in the payload @@ -204,7 +213,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - BulkUpsertCatalogEntitiesError | ErrorsList | BulkUpsertCatalogEntitiesResponse | ErrorsList + Union[BulkUpsertCatalogEntitiesResponse, ErrorsList, Union['BulkUpsertCatalogEntitiesError', 'ErrorsList']] """ return ( diff --git a/rootly_sdk/api/catalog_entities/create_catalog_entity.py b/rootly_sdk/api/catalog_entities/create_catalog_entity.py index 37fa998e..e066c4ec 100644 --- a/rootly_sdk/api/catalog_entities/create_catalog_entity.py +++ b/rootly_sdk/api/catalog_entities/create_catalog_entity.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/catalogs/{catalog_id}/entities".format( - catalog_id=quote(str(catalog_id), safe=""), - ), + "url": f"/v1/catalogs/{catalog_id}/entities", } _kwargs["json"] = body.to_dict() @@ -35,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> CatalogEntityResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[CatalogEntityResponse, ErrorsList]]: if response.status_code == 201: response_201 = CatalogEntityResponse.from_dict(response.json()) @@ -59,8 +56,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[CatalogEntityResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[CatalogEntityResponse, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -74,7 +71,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewCatalogEntity, -) -> Response[CatalogEntityResponse | ErrorsList]: +) -> Response[Union[CatalogEntityResponse, ErrorsList]]: """Creates a Catalog Entity Creates a new Catalog Entity from provided data @@ -88,7 +85,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CatalogEntityResponse | ErrorsList] + Response[Union[CatalogEntityResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -108,7 +105,7 @@ def sync( *, client: AuthenticatedClient, body: NewCatalogEntity, -) -> CatalogEntityResponse | ErrorsList | None: +) -> Optional[Union[CatalogEntityResponse, ErrorsList]]: """Creates a Catalog Entity Creates a new Catalog Entity from provided data @@ -122,7 +119,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CatalogEntityResponse | ErrorsList + Union[CatalogEntityResponse, ErrorsList] """ return sync_detailed( @@ -137,7 +134,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewCatalogEntity, -) -> Response[CatalogEntityResponse | ErrorsList]: +) -> Response[Union[CatalogEntityResponse, ErrorsList]]: """Creates a Catalog Entity Creates a new Catalog Entity from provided data @@ -151,7 +148,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CatalogEntityResponse | ErrorsList] + Response[Union[CatalogEntityResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -169,7 +166,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewCatalogEntity, -) -> CatalogEntityResponse | ErrorsList | None: +) -> Optional[Union[CatalogEntityResponse, ErrorsList]]: """Creates a Catalog Entity Creates a new Catalog Entity from provided data @@ -183,7 +180,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CatalogEntityResponse | ErrorsList + Union[CatalogEntityResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/catalog_entities/delete_catalog_entity.py b/rootly_sdk/api/catalog_entities/delete_catalog_entity.py index f256d19c..8ccaf331 100644 --- a/rootly_sdk/api/catalog_entities/delete_catalog_entity.py +++ b/rootly_sdk/api/catalog_entities/delete_catalog_entity.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union from uuid import UUID import httpx @@ -13,22 +12,19 @@ def _get_kwargs( - id: str | UUID, + id: Union[UUID, str], ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/catalog_entities/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/catalog_entities/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> CatalogEntityResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[CatalogEntityResponse, ErrorsList]]: if response.status_code == 200: response_200 = CatalogEntityResponse.from_dict(response.json()) @@ -46,8 +42,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[CatalogEntityResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[CatalogEntityResponse, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -57,23 +53,23 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Response[CatalogEntityResponse | ErrorsList]: +) -> Response[Union[CatalogEntityResponse, ErrorsList]]: """Delete a Catalog Entity Delete a specific Catalog Entity by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CatalogEntityResponse | ErrorsList] + Response[Union[CatalogEntityResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -88,23 +84,23 @@ def sync_detailed( def sync( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> CatalogEntityResponse | ErrorsList | None: +) -> Optional[Union[CatalogEntityResponse, ErrorsList]]: """Delete a Catalog Entity Delete a specific Catalog Entity by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CatalogEntityResponse | ErrorsList + Union[CatalogEntityResponse, ErrorsList] """ return sync_detailed( @@ -114,23 +110,23 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Response[CatalogEntityResponse | ErrorsList]: +) -> Response[Union[CatalogEntityResponse, ErrorsList]]: """Delete a Catalog Entity Delete a specific Catalog Entity by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CatalogEntityResponse | ErrorsList] + Response[Union[CatalogEntityResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -143,23 +139,23 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> CatalogEntityResponse | ErrorsList | None: +) -> Optional[Union[CatalogEntityResponse, ErrorsList]]: """Delete a Catalog Entity Delete a specific Catalog Entity by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CatalogEntityResponse | ErrorsList + Union[CatalogEntityResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/catalog_entities/get_catalog_entity.py b/rootly_sdk/api/catalog_entities/get_catalog_entity.py index a2b59694..8dfde1a1 100644 --- a/rootly_sdk/api/catalog_entities/get_catalog_entity.py +++ b/rootly_sdk/api/catalog_entities/get_catalog_entity.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union from uuid import UUID import httpx @@ -14,14 +13,13 @@ def _get_kwargs( - id: str | UUID, + id: Union[UUID, str], *, - include: GetCatalogEntityInclude | Unset = UNSET, + include: Union[Unset, GetCatalogEntityInclude] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} - json_include: str | Unset = UNSET + json_include: Union[Unset, str] = UNSET if not isinstance(include, Unset): json_include = include @@ -31,9 +29,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/catalog_entities/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/catalog_entities/{id}", "params": params, } @@ -41,8 +37,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> CatalogEntityResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[CatalogEntityResponse, ErrorsList]]: if response.status_code == 200: response_200 = CatalogEntityResponse.from_dict(response.json()) @@ -60,8 +56,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[CatalogEntityResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[CatalogEntityResponse, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -71,25 +67,25 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, - include: GetCatalogEntityInclude | Unset = UNSET, -) -> Response[CatalogEntityResponse | ErrorsList]: + include: Union[Unset, GetCatalogEntityInclude] = UNSET, +) -> Response[Union[CatalogEntityResponse, ErrorsList]]: """Retrieves a Catalog Entity Retrieves a specific Catalog Entity by id Args: - id (str | UUID): - include (GetCatalogEntityInclude | Unset): + id (Union[UUID, str]): + include (Union[Unset, GetCatalogEntityInclude]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CatalogEntityResponse | ErrorsList] + Response[Union[CatalogEntityResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -105,25 +101,25 @@ def sync_detailed( def sync( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, - include: GetCatalogEntityInclude | Unset = UNSET, -) -> CatalogEntityResponse | ErrorsList | None: + include: Union[Unset, GetCatalogEntityInclude] = UNSET, +) -> Optional[Union[CatalogEntityResponse, ErrorsList]]: """Retrieves a Catalog Entity Retrieves a specific Catalog Entity by id Args: - id (str | UUID): - include (GetCatalogEntityInclude | Unset): + id (Union[UUID, str]): + include (Union[Unset, GetCatalogEntityInclude]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CatalogEntityResponse | ErrorsList + Union[CatalogEntityResponse, ErrorsList] """ return sync_detailed( @@ -134,25 +130,25 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, - include: GetCatalogEntityInclude | Unset = UNSET, -) -> Response[CatalogEntityResponse | ErrorsList]: + include: Union[Unset, GetCatalogEntityInclude] = UNSET, +) -> Response[Union[CatalogEntityResponse, ErrorsList]]: """Retrieves a Catalog Entity Retrieves a specific Catalog Entity by id Args: - id (str | UUID): - include (GetCatalogEntityInclude | Unset): + id (Union[UUID, str]): + include (Union[Unset, GetCatalogEntityInclude]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CatalogEntityResponse | ErrorsList] + Response[Union[CatalogEntityResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -166,25 +162,25 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, - include: GetCatalogEntityInclude | Unset = UNSET, -) -> CatalogEntityResponse | ErrorsList | None: + include: Union[Unset, GetCatalogEntityInclude] = UNSET, +) -> Optional[Union[CatalogEntityResponse, ErrorsList]]: """Retrieves a Catalog Entity Retrieves a specific Catalog Entity by id Args: - id (str | UUID): - include (GetCatalogEntityInclude | Unset): + id (Union[UUID, str]): + include (Union[Unset, GetCatalogEntityInclude]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CatalogEntityResponse | ErrorsList + Union[CatalogEntityResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/catalog_entities/list_catalog_entities.py b/rootly_sdk/api/catalog_entities/list_catalog_entities.py index 82ca16de..accf6ef1 100644 --- a/rootly_sdk/api/catalog_entities/list_catalog_entities.py +++ b/rootly_sdk/api/catalog_entities/list_catalog_entities.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -15,43 +14,42 @@ def _get_kwargs( catalog_id: str, *, - include: ListCatalogEntitiesInclude | Unset = UNSET, - sort: ListCatalogEntitiesSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterbackstage_id: str | Unset = UNSET, - filterexternal_id: str | Unset = UNSET, - filtermanaged_by: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filtermanaged_byeq: str | Unset = UNSET, - filtermanaged_bynot_eq: str | Unset = UNSET, - filtermanaged_byin: str | Unset = UNSET, - filtermanaged_bynot_in: str | Unset = UNSET, + include: Union[Unset, ListCatalogEntitiesInclude] = UNSET, + sort: Union[Unset, ListCatalogEntitiesSort] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterbackstage_id: Union[Unset, str] = UNSET, + filterexternal_id: Union[Unset, str] = UNSET, + filtermanaged_by: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filterslugeq: Union[Unset, str] = UNSET, + filterslugnot_eq: Union[Unset, str] = UNSET, + filterslugin: Union[Unset, str] = UNSET, + filterslugnot_in: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, + filtermanaged_byeq: Union[Unset, str] = UNSET, + filtermanaged_bynot_eq: Union[Unset, str] = UNSET, + filtermanaged_byin: Union[Unset, str] = UNSET, + filtermanaged_bynot_in: Union[Unset, str] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} - json_include: str | Unset = UNSET + json_include: Union[Unset, str] = UNSET if not isinstance(include, Unset): json_include = include params["include"] = json_include - json_sort: str | Unset = UNSET + json_sort: Union[Unset, str] = UNSET if not isinstance(sort, Unset): json_sort = sort @@ -109,16 +107,16 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/catalogs/{catalog_id}/entities".format( - catalog_id=quote(str(catalog_id), safe=""), - ), + "url": f"/v1/catalogs/{catalog_id}/entities", "params": params, } return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> CatalogEntityList | None: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[CatalogEntityList]: if response.status_code == 200: response_200 = CatalogEntityList.from_dict(response.json()) @@ -130,7 +128,9 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[CatalogEntityList]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[CatalogEntityList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -143,32 +143,32 @@ def sync_detailed( catalog_id: str, *, client: AuthenticatedClient, - include: ListCatalogEntitiesInclude | Unset = UNSET, - sort: ListCatalogEntitiesSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterbackstage_id: str | Unset = UNSET, - filterexternal_id: str | Unset = UNSET, - filtermanaged_by: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filtermanaged_byeq: str | Unset = UNSET, - filtermanaged_bynot_eq: str | Unset = UNSET, - filtermanaged_byin: str | Unset = UNSET, - filtermanaged_bynot_in: str | Unset = UNSET, + include: Union[Unset, ListCatalogEntitiesInclude] = UNSET, + sort: Union[Unset, ListCatalogEntitiesSort] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterbackstage_id: Union[Unset, str] = UNSET, + filterexternal_id: Union[Unset, str] = UNSET, + filtermanaged_by: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filterslugeq: Union[Unset, str] = UNSET, + filterslugnot_eq: Union[Unset, str] = UNSET, + filterslugin: Union[Unset, str] = UNSET, + filterslugnot_in: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, + filtermanaged_byeq: Union[Unset, str] = UNSET, + filtermanaged_bynot_eq: Union[Unset, str] = UNSET, + filtermanaged_byin: Union[Unset, str] = UNSET, + filtermanaged_bynot_in: Union[Unset, str] = UNSET, ) -> Response[CatalogEntityList]: """List Catalog Entities @@ -176,32 +176,32 @@ def sync_detailed( Args: catalog_id (str): - include (ListCatalogEntitiesInclude | Unset): - sort (ListCatalogEntitiesSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterbackstage_id (str | Unset): - filterexternal_id (str | Unset): - filtermanaged_by (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filtermanaged_byeq (str | Unset): - filtermanaged_bynot_eq (str | Unset): - filtermanaged_byin (str | Unset): - filtermanaged_bynot_in (str | Unset): + include (Union[Unset, ListCatalogEntitiesInclude]): + sort (Union[Unset, ListCatalogEntitiesSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterbackstage_id (Union[Unset, str]): + filterexternal_id (Union[Unset, str]): + filtermanaged_by (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filtermanaged_byeq (Union[Unset, str]): + filtermanaged_bynot_eq (Union[Unset, str]): + filtermanaged_byin (Union[Unset, str]): + filtermanaged_bynot_in (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -252,65 +252,65 @@ def sync( catalog_id: str, *, client: AuthenticatedClient, - include: ListCatalogEntitiesInclude | Unset = UNSET, - sort: ListCatalogEntitiesSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterbackstage_id: str | Unset = UNSET, - filterexternal_id: str | Unset = UNSET, - filtermanaged_by: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filtermanaged_byeq: str | Unset = UNSET, - filtermanaged_bynot_eq: str | Unset = UNSET, - filtermanaged_byin: str | Unset = UNSET, - filtermanaged_bynot_in: str | Unset = UNSET, -) -> CatalogEntityList | None: + include: Union[Unset, ListCatalogEntitiesInclude] = UNSET, + sort: Union[Unset, ListCatalogEntitiesSort] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterbackstage_id: Union[Unset, str] = UNSET, + filterexternal_id: Union[Unset, str] = UNSET, + filtermanaged_by: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filterslugeq: Union[Unset, str] = UNSET, + filterslugnot_eq: Union[Unset, str] = UNSET, + filterslugin: Union[Unset, str] = UNSET, + filterslugnot_in: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, + filtermanaged_byeq: Union[Unset, str] = UNSET, + filtermanaged_bynot_eq: Union[Unset, str] = UNSET, + filtermanaged_byin: Union[Unset, str] = UNSET, + filtermanaged_bynot_in: Union[Unset, str] = UNSET, +) -> Optional[CatalogEntityList]: """List Catalog Entities List Catalog Entities Args: catalog_id (str): - include (ListCatalogEntitiesInclude | Unset): - sort (ListCatalogEntitiesSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterbackstage_id (str | Unset): - filterexternal_id (str | Unset): - filtermanaged_by (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filtermanaged_byeq (str | Unset): - filtermanaged_bynot_eq (str | Unset): - filtermanaged_byin (str | Unset): - filtermanaged_bynot_in (str | Unset): + include (Union[Unset, ListCatalogEntitiesInclude]): + sort (Union[Unset, ListCatalogEntitiesSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterbackstage_id (Union[Unset, str]): + filterexternal_id (Union[Unset, str]): + filtermanaged_by (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filtermanaged_byeq (Union[Unset, str]): + filtermanaged_bynot_eq (Union[Unset, str]): + filtermanaged_byin (Union[Unset, str]): + filtermanaged_bynot_in (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -356,32 +356,32 @@ async def asyncio_detailed( catalog_id: str, *, client: AuthenticatedClient, - include: ListCatalogEntitiesInclude | Unset = UNSET, - sort: ListCatalogEntitiesSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterbackstage_id: str | Unset = UNSET, - filterexternal_id: str | Unset = UNSET, - filtermanaged_by: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filtermanaged_byeq: str | Unset = UNSET, - filtermanaged_bynot_eq: str | Unset = UNSET, - filtermanaged_byin: str | Unset = UNSET, - filtermanaged_bynot_in: str | Unset = UNSET, + include: Union[Unset, ListCatalogEntitiesInclude] = UNSET, + sort: Union[Unset, ListCatalogEntitiesSort] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterbackstage_id: Union[Unset, str] = UNSET, + filterexternal_id: Union[Unset, str] = UNSET, + filtermanaged_by: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filterslugeq: Union[Unset, str] = UNSET, + filterslugnot_eq: Union[Unset, str] = UNSET, + filterslugin: Union[Unset, str] = UNSET, + filterslugnot_in: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, + filtermanaged_byeq: Union[Unset, str] = UNSET, + filtermanaged_bynot_eq: Union[Unset, str] = UNSET, + filtermanaged_byin: Union[Unset, str] = UNSET, + filtermanaged_bynot_in: Union[Unset, str] = UNSET, ) -> Response[CatalogEntityList]: """List Catalog Entities @@ -389,32 +389,32 @@ async def asyncio_detailed( Args: catalog_id (str): - include (ListCatalogEntitiesInclude | Unset): - sort (ListCatalogEntitiesSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterbackstage_id (str | Unset): - filterexternal_id (str | Unset): - filtermanaged_by (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filtermanaged_byeq (str | Unset): - filtermanaged_bynot_eq (str | Unset): - filtermanaged_byin (str | Unset): - filtermanaged_bynot_in (str | Unset): + include (Union[Unset, ListCatalogEntitiesInclude]): + sort (Union[Unset, ListCatalogEntitiesSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterbackstage_id (Union[Unset, str]): + filterexternal_id (Union[Unset, str]): + filtermanaged_by (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filtermanaged_byeq (Union[Unset, str]): + filtermanaged_bynot_eq (Union[Unset, str]): + filtermanaged_byin (Union[Unset, str]): + filtermanaged_bynot_in (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -463,65 +463,65 @@ async def asyncio( catalog_id: str, *, client: AuthenticatedClient, - include: ListCatalogEntitiesInclude | Unset = UNSET, - sort: ListCatalogEntitiesSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterbackstage_id: str | Unset = UNSET, - filterexternal_id: str | Unset = UNSET, - filtermanaged_by: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filtermanaged_byeq: str | Unset = UNSET, - filtermanaged_bynot_eq: str | Unset = UNSET, - filtermanaged_byin: str | Unset = UNSET, - filtermanaged_bynot_in: str | Unset = UNSET, -) -> CatalogEntityList | None: + include: Union[Unset, ListCatalogEntitiesInclude] = UNSET, + sort: Union[Unset, ListCatalogEntitiesSort] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterbackstage_id: Union[Unset, str] = UNSET, + filterexternal_id: Union[Unset, str] = UNSET, + filtermanaged_by: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filterslugeq: Union[Unset, str] = UNSET, + filterslugnot_eq: Union[Unset, str] = UNSET, + filterslugin: Union[Unset, str] = UNSET, + filterslugnot_in: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, + filtermanaged_byeq: Union[Unset, str] = UNSET, + filtermanaged_bynot_eq: Union[Unset, str] = UNSET, + filtermanaged_byin: Union[Unset, str] = UNSET, + filtermanaged_bynot_in: Union[Unset, str] = UNSET, +) -> Optional[CatalogEntityList]: """List Catalog Entities List Catalog Entities Args: catalog_id (str): - include (ListCatalogEntitiesInclude | Unset): - sort (ListCatalogEntitiesSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterbackstage_id (str | Unset): - filterexternal_id (str | Unset): - filtermanaged_by (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filtermanaged_byeq (str | Unset): - filtermanaged_bynot_eq (str | Unset): - filtermanaged_byin (str | Unset): - filtermanaged_bynot_in (str | Unset): + include (Union[Unset, ListCatalogEntitiesInclude]): + sort (Union[Unset, ListCatalogEntitiesSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterbackstage_id (Union[Unset, str]): + filterexternal_id (Union[Unset, str]): + filtermanaged_by (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filtermanaged_byeq (Union[Unset, str]): + filtermanaged_bynot_eq (Union[Unset, str]): + filtermanaged_byin (Union[Unset, str]): + filtermanaged_bynot_in (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/catalog_entities/update_catalog_entity.py b/rootly_sdk/api/catalog_entities/update_catalog_entity.py index 6613d141..2cb1cb4c 100644 --- a/rootly_sdk/api/catalog_entities/update_catalog_entity.py +++ b/rootly_sdk/api/catalog_entities/update_catalog_entity.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union from uuid import UUID import httpx @@ -14,7 +13,7 @@ def _get_kwargs( - id: str | UUID, + id: Union[UUID, str], *, body: UpdateCatalogEntity, ) -> dict[str, Any]: @@ -22,9 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/catalog_entities/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/catalog_entities/{id}", } _kwargs["json"] = body.to_dict() @@ -36,8 +33,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> CatalogEntityResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[CatalogEntityResponse, ErrorsList]]: if response.status_code == 200: response_200 = CatalogEntityResponse.from_dict(response.json()) @@ -55,8 +52,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[CatalogEntityResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[CatalogEntityResponse, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,17 +63,17 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdateCatalogEntity, -) -> Response[CatalogEntityResponse | ErrorsList]: +) -> Response[Union[CatalogEntityResponse, ErrorsList]]: """Update a Catalog Entity Update a specific Catalog Entity by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateCatalogEntity): Raises: @@ -84,7 +81,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CatalogEntityResponse | ErrorsList] + Response[Union[CatalogEntityResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -100,17 +97,17 @@ def sync_detailed( def sync( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdateCatalogEntity, -) -> CatalogEntityResponse | ErrorsList | None: +) -> Optional[Union[CatalogEntityResponse, ErrorsList]]: """Update a Catalog Entity Update a specific Catalog Entity by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateCatalogEntity): Raises: @@ -118,7 +115,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CatalogEntityResponse | ErrorsList + Union[CatalogEntityResponse, ErrorsList] """ return sync_detailed( @@ -129,17 +126,17 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdateCatalogEntity, -) -> Response[CatalogEntityResponse | ErrorsList]: +) -> Response[Union[CatalogEntityResponse, ErrorsList]]: """Update a Catalog Entity Update a specific Catalog Entity by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateCatalogEntity): Raises: @@ -147,7 +144,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CatalogEntityResponse | ErrorsList] + Response[Union[CatalogEntityResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -161,17 +158,17 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdateCatalogEntity, -) -> CatalogEntityResponse | ErrorsList | None: +) -> Optional[Union[CatalogEntityResponse, ErrorsList]]: """Update a Catalog Entity Update a specific Catalog Entity by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateCatalogEntity): Raises: @@ -179,7 +176,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CatalogEntityResponse | ErrorsList + Union[CatalogEntityResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/catalog_entity_checklists/get_catalog_entity_checklist.py b/rootly_sdk/api/catalog_entity_checklists/get_catalog_entity_checklist.py index b1dacf13..b5a59482 100644 --- a/rootly_sdk/api/catalog_entity_checklists/get_catalog_entity_checklist.py +++ b/rootly_sdk/api/catalog_entity_checklists/get_catalog_entity_checklist.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union from uuid import UUID import httpx @@ -15,20 +14,17 @@ def _get_kwargs( id: UUID, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/catalog_entity_checklists/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/catalog_entity_checklists/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> CatalogEntityChecklistResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[CatalogEntityChecklistResponse, ErrorsList]]: if response.status_code == 200: response_200 = CatalogEntityChecklistResponse.from_dict(response.json()) @@ -46,8 +42,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[CatalogEntityChecklistResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[CatalogEntityChecklistResponse, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -60,7 +56,7 @@ def sync_detailed( id: UUID, *, client: AuthenticatedClient, -) -> Response[CatalogEntityChecklistResponse | ErrorsList]: +) -> Response[Union[CatalogEntityChecklistResponse, ErrorsList]]: """Retrieves a catalog entity checklist Retrieves a specific catalog entity checklist by id @@ -73,7 +69,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CatalogEntityChecklistResponse | ErrorsList] + Response[Union[CatalogEntityChecklistResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -91,7 +87,7 @@ def sync( id: UUID, *, client: AuthenticatedClient, -) -> CatalogEntityChecklistResponse | ErrorsList | None: +) -> Optional[Union[CatalogEntityChecklistResponse, ErrorsList]]: """Retrieves a catalog entity checklist Retrieves a specific catalog entity checklist by id @@ -104,7 +100,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CatalogEntityChecklistResponse | ErrorsList + Union[CatalogEntityChecklistResponse, ErrorsList] """ return sync_detailed( @@ -117,7 +113,7 @@ async def asyncio_detailed( id: UUID, *, client: AuthenticatedClient, -) -> Response[CatalogEntityChecklistResponse | ErrorsList]: +) -> Response[Union[CatalogEntityChecklistResponse, ErrorsList]]: """Retrieves a catalog entity checklist Retrieves a specific catalog entity checklist by id @@ -130,7 +126,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CatalogEntityChecklistResponse | ErrorsList] + Response[Union[CatalogEntityChecklistResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -146,7 +142,7 @@ async def asyncio( id: UUID, *, client: AuthenticatedClient, -) -> CatalogEntityChecklistResponse | ErrorsList | None: +) -> Optional[Union[CatalogEntityChecklistResponse, ErrorsList]]: """Retrieves a catalog entity checklist Retrieves a specific catalog entity checklist by id @@ -159,7 +155,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CatalogEntityChecklistResponse | ErrorsList + Union[CatalogEntityChecklistResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/catalog_entity_checklists/list_catalog_entity_checklists.py b/rootly_sdk/api/catalog_entity_checklists/list_catalog_entity_checklists.py index 63fefcf6..8bff27bd 100644 --- a/rootly_sdk/api/catalog_entity_checklists/list_catalog_entity_checklists.py +++ b/rootly_sdk/api/catalog_entity_checklists/list_catalog_entity_checklists.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -11,18 +11,17 @@ def _get_kwargs( *, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterstatus: str | Unset = UNSET, - filtercatalog_checklist_template_id: str | Unset = UNSET, - filterauditable_type: str | Unset = UNSET, - filterauditable_id: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterstatus: Union[Unset, str] = UNSET, + filtercatalog_checklist_template_id: Union[Unset, str] = UNSET, + filterauditable_type: Union[Unset, str] = UNSET, + filterauditable_id: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["page[number]"] = pagenumber @@ -57,8 +56,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> CatalogEntityChecklistList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[CatalogEntityChecklistList]: if response.status_code == 200: response_200 = CatalogEntityChecklistList.from_dict(response.json()) @@ -71,7 +70,7 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[CatalogEntityChecklistList]: return Response( status_code=HTTPStatus(response.status_code), @@ -84,32 +83,32 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterstatus: str | Unset = UNSET, - filtercatalog_checklist_template_id: str | Unset = UNSET, - filterauditable_type: str | Unset = UNSET, - filterauditable_id: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterstatus: Union[Unset, str] = UNSET, + filtercatalog_checklist_template_id: Union[Unset, str] = UNSET, + filterauditable_type: Union[Unset, str] = UNSET, + filterauditable_id: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, ) -> Response[CatalogEntityChecklistList]: """List catalog entity checklists List catalog entity checklists Args: - pagenumber (int | Unset): - pagesize (int | Unset): - filterstatus (str | Unset): - filtercatalog_checklist_template_id (str | Unset): - filterauditable_type (str | Unset): - filterauditable_id (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterstatus (Union[Unset, str]): + filtercatalog_checklist_template_id (Union[Unset, str]): + filterauditable_type (Union[Unset, str]): + filterauditable_id (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -142,32 +141,32 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterstatus: str | Unset = UNSET, - filtercatalog_checklist_template_id: str | Unset = UNSET, - filterauditable_type: str | Unset = UNSET, - filterauditable_id: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, -) -> CatalogEntityChecklistList | None: + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterstatus: Union[Unset, str] = UNSET, + filtercatalog_checklist_template_id: Union[Unset, str] = UNSET, + filterauditable_type: Union[Unset, str] = UNSET, + filterauditable_id: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, +) -> Optional[CatalogEntityChecklistList]: """List catalog entity checklists List catalog entity checklists Args: - pagenumber (int | Unset): - pagesize (int | Unset): - filterstatus (str | Unset): - filtercatalog_checklist_template_id (str | Unset): - filterauditable_type (str | Unset): - filterauditable_id (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterstatus (Union[Unset, str]): + filtercatalog_checklist_template_id (Union[Unset, str]): + filterauditable_type (Union[Unset, str]): + filterauditable_id (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -195,32 +194,32 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterstatus: str | Unset = UNSET, - filtercatalog_checklist_template_id: str | Unset = UNSET, - filterauditable_type: str | Unset = UNSET, - filterauditable_id: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterstatus: Union[Unset, str] = UNSET, + filtercatalog_checklist_template_id: Union[Unset, str] = UNSET, + filterauditable_type: Union[Unset, str] = UNSET, + filterauditable_id: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, ) -> Response[CatalogEntityChecklistList]: """List catalog entity checklists List catalog entity checklists Args: - pagenumber (int | Unset): - pagesize (int | Unset): - filterstatus (str | Unset): - filtercatalog_checklist_template_id (str | Unset): - filterauditable_type (str | Unset): - filterauditable_id (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterstatus (Union[Unset, str]): + filtercatalog_checklist_template_id (Union[Unset, str]): + filterauditable_type (Union[Unset, str]): + filterauditable_id (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -251,32 +250,32 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterstatus: str | Unset = UNSET, - filtercatalog_checklist_template_id: str | Unset = UNSET, - filterauditable_type: str | Unset = UNSET, - filterauditable_id: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, -) -> CatalogEntityChecklistList | None: + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterstatus: Union[Unset, str] = UNSET, + filtercatalog_checklist_template_id: Union[Unset, str] = UNSET, + filterauditable_type: Union[Unset, str] = UNSET, + filterauditable_id: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, +) -> Optional[CatalogEntityChecklistList]: """List catalog entity checklists List catalog entity checklists Args: - pagenumber (int | Unset): - pagesize (int | Unset): - filterstatus (str | Unset): - filtercatalog_checklist_template_id (str | Unset): - filterauditable_type (str | Unset): - filterauditable_id (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterstatus (Union[Unset, str]): + filtercatalog_checklist_template_id (Union[Unset, str]): + filterauditable_type (Union[Unset, str]): + filterauditable_id (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/catalog_entity_properties/create_catalog_entity_property.py b/rootly_sdk/api/catalog_entity_properties/create_catalog_entity_property.py index 3c834928..6df3ab90 100644 --- a/rootly_sdk/api/catalog_entity_properties/create_catalog_entity_property.py +++ b/rootly_sdk/api/catalog_entity_properties/create_catalog_entity_property.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/catalog_entities/{catalog_entity_id}/properties".format( - catalog_entity_id=quote(str(catalog_entity_id), safe=""), - ), + "url": f"/v1/catalog_entities/{catalog_entity_id}/properties", } _kwargs["json"] = body.to_dict() @@ -35,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> CatalogEntityPropertyResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[CatalogEntityPropertyResponse, ErrorsList]]: if response.status_code == 201: response_201 = CatalogEntityPropertyResponse.from_dict(response.json()) @@ -59,8 +56,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[CatalogEntityPropertyResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[CatalogEntityPropertyResponse, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -74,7 +71,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewCatalogEntityProperty, -) -> Response[CatalogEntityPropertyResponse | ErrorsList]: +) -> Response[Union[CatalogEntityPropertyResponse, ErrorsList]]: """Creates a Catalog Entity Property **Deprecated:** This endpoint is deprecated, please use the `fields` attribute on catalog entities @@ -94,7 +91,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CatalogEntityPropertyResponse | ErrorsList] + Response[Union[CatalogEntityPropertyResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -114,7 +111,7 @@ def sync( *, client: AuthenticatedClient, body: NewCatalogEntityProperty, -) -> CatalogEntityPropertyResponse | ErrorsList | None: +) -> Optional[Union[CatalogEntityPropertyResponse, ErrorsList]]: """Creates a Catalog Entity Property **Deprecated:** This endpoint is deprecated, please use the `fields` attribute on catalog entities @@ -134,7 +131,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CatalogEntityPropertyResponse | ErrorsList + Union[CatalogEntityPropertyResponse, ErrorsList] """ return sync_detailed( @@ -149,7 +146,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewCatalogEntityProperty, -) -> Response[CatalogEntityPropertyResponse | ErrorsList]: +) -> Response[Union[CatalogEntityPropertyResponse, ErrorsList]]: """Creates a Catalog Entity Property **Deprecated:** This endpoint is deprecated, please use the `fields` attribute on catalog entities @@ -169,7 +166,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CatalogEntityPropertyResponse | ErrorsList] + Response[Union[CatalogEntityPropertyResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -187,7 +184,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewCatalogEntityProperty, -) -> CatalogEntityPropertyResponse | ErrorsList | None: +) -> Optional[Union[CatalogEntityPropertyResponse, ErrorsList]]: """Creates a Catalog Entity Property **Deprecated:** This endpoint is deprecated, please use the `fields` attribute on catalog entities @@ -207,7 +204,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CatalogEntityPropertyResponse | ErrorsList + Union[CatalogEntityPropertyResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/catalog_entity_properties/delete_catalog_entity_property.py b/rootly_sdk/api/catalog_entity_properties/delete_catalog_entity_property.py index 5fb2acac..49026906 100644 --- a/rootly_sdk/api/catalog_entity_properties/delete_catalog_entity_property.py +++ b/rootly_sdk/api/catalog_entity_properties/delete_catalog_entity_property.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/catalog_entity_properties/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/catalog_entity_properties/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> CatalogEntityPropertyResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[CatalogEntityPropertyResponse, ErrorsList]]: if response.status_code == 200: response_200 = CatalogEntityPropertyResponse.from_dict(response.json()) @@ -45,8 +41,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[CatalogEntityPropertyResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[CatalogEntityPropertyResponse, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[CatalogEntityPropertyResponse | ErrorsList]: +) -> Response[Union[CatalogEntityPropertyResponse, ErrorsList]]: """Delete a Catalog Entity Property **Deprecated:** This endpoint is deprecated, please use the `fields` attribute on catalog entities @@ -76,7 +72,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CatalogEntityPropertyResponse | ErrorsList] + Response[Union[CatalogEntityPropertyResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -94,7 +90,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> CatalogEntityPropertyResponse | ErrorsList | None: +) -> Optional[Union[CatalogEntityPropertyResponse, ErrorsList]]: """Delete a Catalog Entity Property **Deprecated:** This endpoint is deprecated, please use the `fields` attribute on catalog entities @@ -111,7 +107,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CatalogEntityPropertyResponse | ErrorsList + Union[CatalogEntityPropertyResponse, ErrorsList] """ return sync_detailed( @@ -124,7 +120,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[CatalogEntityPropertyResponse | ErrorsList]: +) -> Response[Union[CatalogEntityPropertyResponse, ErrorsList]]: """Delete a Catalog Entity Property **Deprecated:** This endpoint is deprecated, please use the `fields` attribute on catalog entities @@ -141,7 +137,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CatalogEntityPropertyResponse | ErrorsList] + Response[Union[CatalogEntityPropertyResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -157,7 +153,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> CatalogEntityPropertyResponse | ErrorsList | None: +) -> Optional[Union[CatalogEntityPropertyResponse, ErrorsList]]: """Delete a Catalog Entity Property **Deprecated:** This endpoint is deprecated, please use the `fields` attribute on catalog entities @@ -174,7 +170,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CatalogEntityPropertyResponse | ErrorsList + Union[CatalogEntityPropertyResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/catalog_entity_properties/get_catalog_entity_property.py b/rootly_sdk/api/catalog_entity_properties/get_catalog_entity_property.py index 698b1a78..c2006b31 100644 --- a/rootly_sdk/api/catalog_entity_properties/get_catalog_entity_property.py +++ b/rootly_sdk/api/catalog_entity_properties/get_catalog_entity_property.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -17,12 +16,11 @@ def _get_kwargs( id: str, *, - include: GetCatalogEntityPropertyInclude | Unset = UNSET, + include: Union[Unset, GetCatalogEntityPropertyInclude] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} - json_include: str | Unset = UNSET + json_include: Union[Unset, str] = UNSET if not isinstance(include, Unset): json_include = include @@ -32,9 +30,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/catalog_entity_properties/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/catalog_entity_properties/{id}", "params": params, } @@ -42,8 +38,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> CatalogEntityPropertyResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[CatalogEntityPropertyResponse, ErrorsList]]: if response.status_code == 200: response_200 = CatalogEntityPropertyResponse.from_dict(response.json()) @@ -61,8 +57,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[CatalogEntityPropertyResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[CatalogEntityPropertyResponse, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -75,8 +71,8 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, - include: GetCatalogEntityPropertyInclude | Unset = UNSET, -) -> Response[CatalogEntityPropertyResponse | ErrorsList]: + include: Union[Unset, GetCatalogEntityPropertyInclude] = UNSET, +) -> Response[Union[CatalogEntityPropertyResponse, ErrorsList]]: """Retrieves a Catalog Entity Property **Deprecated:** This endpoint is deprecated, please use `include=fields` on catalog entities or @@ -87,14 +83,14 @@ def sync_detailed( Args: id (str): - include (GetCatalogEntityPropertyInclude | Unset): + include (Union[Unset, GetCatalogEntityPropertyInclude]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CatalogEntityPropertyResponse | ErrorsList] + Response[Union[CatalogEntityPropertyResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -113,8 +109,8 @@ def sync( id: str, *, client: AuthenticatedClient, - include: GetCatalogEntityPropertyInclude | Unset = UNSET, -) -> CatalogEntityPropertyResponse | ErrorsList | None: + include: Union[Unset, GetCatalogEntityPropertyInclude] = UNSET, +) -> Optional[Union[CatalogEntityPropertyResponse, ErrorsList]]: """Retrieves a Catalog Entity Property **Deprecated:** This endpoint is deprecated, please use `include=fields` on catalog entities or @@ -125,14 +121,14 @@ def sync( Args: id (str): - include (GetCatalogEntityPropertyInclude | Unset): + include (Union[Unset, GetCatalogEntityPropertyInclude]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CatalogEntityPropertyResponse | ErrorsList + Union[CatalogEntityPropertyResponse, ErrorsList] """ return sync_detailed( @@ -146,8 +142,8 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, - include: GetCatalogEntityPropertyInclude | Unset = UNSET, -) -> Response[CatalogEntityPropertyResponse | ErrorsList]: + include: Union[Unset, GetCatalogEntityPropertyInclude] = UNSET, +) -> Response[Union[CatalogEntityPropertyResponse, ErrorsList]]: """Retrieves a Catalog Entity Property **Deprecated:** This endpoint is deprecated, please use `include=fields` on catalog entities or @@ -158,14 +154,14 @@ async def asyncio_detailed( Args: id (str): - include (GetCatalogEntityPropertyInclude | Unset): + include (Union[Unset, GetCatalogEntityPropertyInclude]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CatalogEntityPropertyResponse | ErrorsList] + Response[Union[CatalogEntityPropertyResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -182,8 +178,8 @@ async def asyncio( id: str, *, client: AuthenticatedClient, - include: GetCatalogEntityPropertyInclude | Unset = UNSET, -) -> CatalogEntityPropertyResponse | ErrorsList | None: + include: Union[Unset, GetCatalogEntityPropertyInclude] = UNSET, +) -> Optional[Union[CatalogEntityPropertyResponse, ErrorsList]]: """Retrieves a Catalog Entity Property **Deprecated:** This endpoint is deprecated, please use `include=fields` on catalog entities or @@ -194,14 +190,14 @@ async def asyncio( Args: id (str): - include (GetCatalogEntityPropertyInclude | Unset): + include (Union[Unset, GetCatalogEntityPropertyInclude]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CatalogEntityPropertyResponse | ErrorsList + Union[CatalogEntityPropertyResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/catalog_entity_properties/list_catalog_entity_properties.py b/rootly_sdk/api/catalog_entity_properties/list_catalog_entity_properties.py index f4183034..9346c562 100644 --- a/rootly_sdk/api/catalog_entity_properties/list_catalog_entity_properties.py +++ b/rootly_sdk/api/catalog_entity_properties/list_catalog_entity_properties.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -19,27 +18,26 @@ def _get_kwargs( catalog_entity_id: str, *, - include: ListCatalogEntityPropertiesInclude | Unset = UNSET, - sort: ListCatalogEntityPropertiesSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtercatalog_field_id: str | Unset = UNSET, - filterkey: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Union[Unset, ListCatalogEntityPropertiesInclude] = UNSET, + sort: Union[Unset, ListCatalogEntityPropertiesSort] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtercatalog_field_id: Union[Unset, str] = UNSET, + filterkey: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} - json_include: str | Unset = UNSET + json_include: Union[Unset, str] = UNSET if not isinstance(include, Unset): json_include = include params["include"] = json_include - json_sort: str | Unset = UNSET + json_sort: Union[Unset, str] = UNSET if not isinstance(sort, Unset): json_sort = sort @@ -65,9 +63,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/catalog_entities/{catalog_entity_id}/properties".format( - catalog_entity_id=quote(str(catalog_entity_id), safe=""), - ), + "url": f"/v1/catalog_entities/{catalog_entity_id}/properties", "params": params, } @@ -75,8 +71,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> CatalogEntityPropertyList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[CatalogEntityPropertyList]: if response.status_code == 200: response_200 = CatalogEntityPropertyList.from_dict(response.json()) @@ -89,7 +85,7 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[CatalogEntityPropertyList]: return Response( status_code=HTTPStatus(response.status_code), @@ -103,16 +99,16 @@ def sync_detailed( catalog_entity_id: str, *, client: AuthenticatedClient, - include: ListCatalogEntityPropertiesInclude | Unset = UNSET, - sort: ListCatalogEntityPropertiesSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtercatalog_field_id: str | Unset = UNSET, - filterkey: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Union[Unset, ListCatalogEntityPropertiesInclude] = UNSET, + sort: Union[Unset, ListCatalogEntityPropertiesSort] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtercatalog_field_id: Union[Unset, str] = UNSET, + filterkey: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, ) -> Response[CatalogEntityPropertyList]: """List catalog properties @@ -124,16 +120,16 @@ def sync_detailed( Args: catalog_entity_id (str): - include (ListCatalogEntityPropertiesInclude | Unset): - sort (ListCatalogEntityPropertiesSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtercatalog_field_id (str | Unset): - filterkey (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, ListCatalogEntityPropertiesInclude]): + sort (Union[Unset, ListCatalogEntityPropertiesSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtercatalog_field_id (Union[Unset, str]): + filterkey (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -168,17 +164,17 @@ def sync( catalog_entity_id: str, *, client: AuthenticatedClient, - include: ListCatalogEntityPropertiesInclude | Unset = UNSET, - sort: ListCatalogEntityPropertiesSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtercatalog_field_id: str | Unset = UNSET, - filterkey: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, -) -> CatalogEntityPropertyList | None: + include: Union[Unset, ListCatalogEntityPropertiesInclude] = UNSET, + sort: Union[Unset, ListCatalogEntityPropertiesSort] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtercatalog_field_id: Union[Unset, str] = UNSET, + filterkey: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, +) -> Optional[CatalogEntityPropertyList]: """List catalog properties **Deprecated:** This endpoint is deprecated, please use `include=fields` on catalog entities or @@ -189,16 +185,16 @@ def sync( Args: catalog_entity_id (str): - include (ListCatalogEntityPropertiesInclude | Unset): - sort (ListCatalogEntityPropertiesSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtercatalog_field_id (str | Unset): - filterkey (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, ListCatalogEntityPropertiesInclude]): + sort (Union[Unset, ListCatalogEntityPropertiesSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtercatalog_field_id (Union[Unset, str]): + filterkey (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -228,16 +224,16 @@ async def asyncio_detailed( catalog_entity_id: str, *, client: AuthenticatedClient, - include: ListCatalogEntityPropertiesInclude | Unset = UNSET, - sort: ListCatalogEntityPropertiesSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtercatalog_field_id: str | Unset = UNSET, - filterkey: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Union[Unset, ListCatalogEntityPropertiesInclude] = UNSET, + sort: Union[Unset, ListCatalogEntityPropertiesSort] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtercatalog_field_id: Union[Unset, str] = UNSET, + filterkey: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, ) -> Response[CatalogEntityPropertyList]: """List catalog properties @@ -249,16 +245,16 @@ async def asyncio_detailed( Args: catalog_entity_id (str): - include (ListCatalogEntityPropertiesInclude | Unset): - sort (ListCatalogEntityPropertiesSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtercatalog_field_id (str | Unset): - filterkey (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, ListCatalogEntityPropertiesInclude]): + sort (Union[Unset, ListCatalogEntityPropertiesSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtercatalog_field_id (Union[Unset, str]): + filterkey (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -291,17 +287,17 @@ async def asyncio( catalog_entity_id: str, *, client: AuthenticatedClient, - include: ListCatalogEntityPropertiesInclude | Unset = UNSET, - sort: ListCatalogEntityPropertiesSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtercatalog_field_id: str | Unset = UNSET, - filterkey: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, -) -> CatalogEntityPropertyList | None: + include: Union[Unset, ListCatalogEntityPropertiesInclude] = UNSET, + sort: Union[Unset, ListCatalogEntityPropertiesSort] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtercatalog_field_id: Union[Unset, str] = UNSET, + filterkey: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, +) -> Optional[CatalogEntityPropertyList]: """List catalog properties **Deprecated:** This endpoint is deprecated, please use `include=fields` on catalog entities or @@ -312,16 +308,16 @@ async def asyncio( Args: catalog_entity_id (str): - include (ListCatalogEntityPropertiesInclude | Unset): - sort (ListCatalogEntityPropertiesSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtercatalog_field_id (str | Unset): - filterkey (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, ListCatalogEntityPropertiesInclude]): + sort (Union[Unset, ListCatalogEntityPropertiesSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtercatalog_field_id (Union[Unset, str]): + filterkey (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/catalog_entity_properties/update_catalog_entity_property.py b/rootly_sdk/api/catalog_entity_properties/update_catalog_entity_property.py index 5d1cc4b3..498661cb 100644 --- a/rootly_sdk/api/catalog_entity_properties/update_catalog_entity_property.py +++ b/rootly_sdk/api/catalog_entity_properties/update_catalog_entity_property.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/catalog_entity_properties/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/catalog_entity_properties/{id}", } _kwargs["json"] = body.to_dict() @@ -35,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> CatalogEntityPropertyResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[CatalogEntityPropertyResponse, ErrorsList]]: if response.status_code == 200: response_200 = CatalogEntityPropertyResponse.from_dict(response.json()) @@ -54,8 +51,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[CatalogEntityPropertyResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[CatalogEntityPropertyResponse, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateCatalogEntityProperty, -) -> Response[CatalogEntityPropertyResponse | ErrorsList]: +) -> Response[Union[CatalogEntityPropertyResponse, ErrorsList]]: """Update a Catalog Entity Property **Deprecated:** This endpoint is deprecated, please use the `fields` attribute on catalog entities @@ -90,7 +87,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CatalogEntityPropertyResponse | ErrorsList] + Response[Union[CatalogEntityPropertyResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -110,7 +107,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateCatalogEntityProperty, -) -> CatalogEntityPropertyResponse | ErrorsList | None: +) -> Optional[Union[CatalogEntityPropertyResponse, ErrorsList]]: """Update a Catalog Entity Property **Deprecated:** This endpoint is deprecated, please use the `fields` attribute on catalog entities @@ -131,7 +128,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CatalogEntityPropertyResponse | ErrorsList + Union[CatalogEntityPropertyResponse, ErrorsList] """ return sync_detailed( @@ -146,7 +143,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateCatalogEntityProperty, -) -> Response[CatalogEntityPropertyResponse | ErrorsList]: +) -> Response[Union[CatalogEntityPropertyResponse, ErrorsList]]: """Update a Catalog Entity Property **Deprecated:** This endpoint is deprecated, please use the `fields` attribute on catalog entities @@ -167,7 +164,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CatalogEntityPropertyResponse | ErrorsList] + Response[Union[CatalogEntityPropertyResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -185,7 +182,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateCatalogEntityProperty, -) -> CatalogEntityPropertyResponse | ErrorsList | None: +) -> Optional[Union[CatalogEntityPropertyResponse, ErrorsList]]: """Update a Catalog Entity Property **Deprecated:** This endpoint is deprecated, please use the `fields` attribute on catalog entities @@ -206,7 +203,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CatalogEntityPropertyResponse | ErrorsList + Union[CatalogEntityPropertyResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/catalog_properties/create_catalog_property.py b/rootly_sdk/api/catalog_properties/create_catalog_property.py index ce8b71c5..9fc7b1e4 100644 --- a/rootly_sdk/api/catalog_properties/create_catalog_property.py +++ b/rootly_sdk/api/catalog_properties/create_catalog_property.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -19,9 +18,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/catalogs/{catalog_id}/properties".format( - catalog_id=quote(str(catalog_id), safe=""), - ), + "url": f"/v1/catalogs/{catalog_id}/properties", } _kwargs["json"] = body.to_dict() @@ -32,7 +29,7 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Any | None: +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: if response.status_code == 201: return None @@ -42,7 +39,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Any]: +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, diff --git a/rootly_sdk/api/catalog_properties/delete_catalog_property.py b/rootly_sdk/api/catalog_properties/delete_catalog_property.py index b08c47da..d00bb3c6 100644 --- a/rootly_sdk/api/catalog_properties/delete_catalog_property.py +++ b/rootly_sdk/api/catalog_properties/delete_catalog_property.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -12,18 +11,15 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/catalog_properties/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/catalog_properties/{id}", } return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Any | None: +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: if response.status_code == 200: return None @@ -33,7 +29,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Any]: +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, diff --git a/rootly_sdk/api/catalog_properties/get_catalog_property.py b/rootly_sdk/api/catalog_properties/get_catalog_property.py index e42871f8..7f9963fb 100644 --- a/rootly_sdk/api/catalog_properties/get_catalog_property.py +++ b/rootly_sdk/api/catalog_properties/get_catalog_property.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -12,18 +11,15 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/catalog_properties/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/catalog_properties/{id}", } return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Any | None: +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: if response.status_code == 200: return None @@ -33,7 +29,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Any]: +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, diff --git a/rootly_sdk/api/catalog_properties/list_catalog_properties.py b/rootly_sdk/api/catalog_properties/list_catalog_properties.py index 4d717126..05930da5 100644 --- a/rootly_sdk/api/catalog_properties/list_catalog_properties.py +++ b/rootly_sdk/api/catalog_properties/list_catalog_properties.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -12,18 +11,15 @@ def _get_kwargs( catalog_id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/catalogs/{catalog_id}/properties".format( - catalog_id=quote(str(catalog_id), safe=""), - ), + "url": f"/v1/catalogs/{catalog_id}/properties", } return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Any | None: +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: if response.status_code == 200: return None @@ -33,7 +29,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Any]: +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, diff --git a/rootly_sdk/api/catalog_properties/update_catalog_property.py b/rootly_sdk/api/catalog_properties/update_catalog_property.py index 2847e350..6c837ccf 100644 --- a/rootly_sdk/api/catalog_properties/update_catalog_property.py +++ b/rootly_sdk/api/catalog_properties/update_catalog_property.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -19,9 +18,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/catalog_properties/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/catalog_properties/{id}", } _kwargs["json"] = body.to_dict() @@ -32,7 +29,7 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Any | None: +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: if response.status_code == 200: return None @@ -42,7 +39,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Any]: +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, diff --git a/rootly_sdk/api/catalogs/create_catalog.py b/rootly_sdk/api/catalogs/create_catalog.py index 736014b9..cfb0ab3a 100644 --- a/rootly_sdk/api/catalogs/create_catalog.py +++ b/rootly_sdk/api/catalogs/create_catalog.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> CatalogResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[CatalogResponse, ErrorsList]]: if response.status_code == 201: response_201 = CatalogResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[CatalogResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[CatalogResponse, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +69,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewCatalog, -) -> Response[CatalogResponse | ErrorsList]: +) -> Response[Union[CatalogResponse, ErrorsList]]: """Creates a catalog Creates a new catalog from provided data @@ -82,7 +82,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CatalogResponse | ErrorsList] + Response[Union[CatalogResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: NewCatalog, -) -> CatalogResponse | ErrorsList | None: +) -> Optional[Union[CatalogResponse, ErrorsList]]: """Creates a catalog Creates a new catalog from provided data @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CatalogResponse | ErrorsList + Union[CatalogResponse, ErrorsList] """ return sync_detailed( @@ -126,7 +126,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewCatalog, -) -> Response[CatalogResponse | ErrorsList]: +) -> Response[Union[CatalogResponse, ErrorsList]]: """Creates a catalog Creates a new catalog from provided data @@ -139,7 +139,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CatalogResponse | ErrorsList] + Response[Union[CatalogResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -155,7 +155,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewCatalog, -) -> CatalogResponse | ErrorsList | None: +) -> Optional[Union[CatalogResponse, ErrorsList]]: """Creates a catalog Creates a new catalog from provided data @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CatalogResponse | ErrorsList + Union[CatalogResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/catalogs/delete_catalog.py b/rootly_sdk/api/catalogs/delete_catalog.py index eeebd62e..c2a0ea18 100644 --- a/rootly_sdk/api/catalogs/delete_catalog.py +++ b/rootly_sdk/api/catalogs/delete_catalog.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union from uuid import UUID import httpx @@ -13,22 +12,19 @@ def _get_kwargs( - id: str | UUID, + id: Union[UUID, str], ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/catalogs/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/catalogs/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> CatalogResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[CatalogResponse, ErrorsList]]: if response.status_code == 200: response_200 = CatalogResponse.from_dict(response.json()) @@ -46,8 +42,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[CatalogResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[CatalogResponse, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -57,23 +53,23 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Response[CatalogResponse | ErrorsList]: +) -> Response[Union[CatalogResponse, ErrorsList]]: """Delete a catalog Delete a specific catalog by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CatalogResponse | ErrorsList] + Response[Union[CatalogResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -88,23 +84,23 @@ def sync_detailed( def sync( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> CatalogResponse | ErrorsList | None: +) -> Optional[Union[CatalogResponse, ErrorsList]]: """Delete a catalog Delete a specific catalog by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CatalogResponse | ErrorsList + Union[CatalogResponse, ErrorsList] """ return sync_detailed( @@ -114,23 +110,23 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Response[CatalogResponse | ErrorsList]: +) -> Response[Union[CatalogResponse, ErrorsList]]: """Delete a catalog Delete a specific catalog by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CatalogResponse | ErrorsList] + Response[Union[CatalogResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -143,23 +139,23 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> CatalogResponse | ErrorsList | None: +) -> Optional[Union[CatalogResponse, ErrorsList]]: """Delete a catalog Delete a specific catalog by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CatalogResponse | ErrorsList + Union[CatalogResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/catalogs/get_catalog.py b/rootly_sdk/api/catalogs/get_catalog.py index 146cb1a4..59324e2a 100644 --- a/rootly_sdk/api/catalogs/get_catalog.py +++ b/rootly_sdk/api/catalogs/get_catalog.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union from uuid import UUID import httpx @@ -13,22 +12,19 @@ def _get_kwargs( - id: str | UUID, + id: Union[UUID, str], ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/catalogs/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/catalogs/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> CatalogResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[CatalogResponse, ErrorsList]]: if response.status_code == 200: response_200 = CatalogResponse.from_dict(response.json()) @@ -46,8 +42,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[CatalogResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[CatalogResponse, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -57,23 +53,23 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Response[CatalogResponse | ErrorsList]: +) -> Response[Union[CatalogResponse, ErrorsList]]: """Retrieves a catalog Retrieves a specific catalog by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CatalogResponse | ErrorsList] + Response[Union[CatalogResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -88,23 +84,23 @@ def sync_detailed( def sync( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> CatalogResponse | ErrorsList | None: +) -> Optional[Union[CatalogResponse, ErrorsList]]: """Retrieves a catalog Retrieves a specific catalog by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CatalogResponse | ErrorsList + Union[CatalogResponse, ErrorsList] """ return sync_detailed( @@ -114,23 +110,23 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Response[CatalogResponse | ErrorsList]: +) -> Response[Union[CatalogResponse, ErrorsList]]: """Retrieves a catalog Retrieves a specific catalog by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CatalogResponse | ErrorsList] + Response[Union[CatalogResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -143,23 +139,23 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> CatalogResponse | ErrorsList | None: +) -> Optional[Union[CatalogResponse, ErrorsList]]: """Retrieves a catalog Retrieves a specific catalog by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CatalogResponse | ErrorsList + Union[CatalogResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/catalogs/list_catalogs.py b/rootly_sdk/api/catalogs/list_catalogs.py index 47f483e2..babbf4c7 100644 --- a/rootly_sdk/api/catalogs/list_catalogs.py +++ b/rootly_sdk/api/catalogs/list_catalogs.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -13,42 +13,41 @@ def _get_kwargs( *, - include: ListCatalogsInclude | Unset = UNSET, - sort: ListCatalogsSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterexternal_id: str | Unset = UNSET, - filtermanaged_by: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filtermanaged_byeq: str | Unset = UNSET, - filtermanaged_bynot_eq: str | Unset = UNSET, - filtermanaged_byin: str | Unset = UNSET, - filtermanaged_bynot_in: str | Unset = UNSET, + include: Union[Unset, ListCatalogsInclude] = UNSET, + sort: Union[Unset, ListCatalogsSort] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterexternal_id: Union[Unset, str] = UNSET, + filtermanaged_by: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filterslugeq: Union[Unset, str] = UNSET, + filterslugnot_eq: Union[Unset, str] = UNSET, + filterslugin: Union[Unset, str] = UNSET, + filterslugnot_in: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, + filtermanaged_byeq: Union[Unset, str] = UNSET, + filtermanaged_bynot_eq: Union[Unset, str] = UNSET, + filtermanaged_byin: Union[Unset, str] = UNSET, + filtermanaged_bynot_in: Union[Unset, str] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} - json_include: str | Unset = UNSET + json_include: Union[Unset, str] = UNSET if not isinstance(include, Unset): json_include = include params["include"] = json_include - json_sort: str | Unset = UNSET + json_sort: Union[Unset, str] = UNSET if not isinstance(sort, Unset): json_sort = sort @@ -111,7 +110,7 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> CatalogList | None: +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[CatalogList]: if response.status_code == 200: response_200 = CatalogList.from_dict(response.json()) @@ -123,7 +122,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[CatalogList]: +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[CatalogList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -135,62 +134,62 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - include: ListCatalogsInclude | Unset = UNSET, - sort: ListCatalogsSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterexternal_id: str | Unset = UNSET, - filtermanaged_by: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filtermanaged_byeq: str | Unset = UNSET, - filtermanaged_bynot_eq: str | Unset = UNSET, - filtermanaged_byin: str | Unset = UNSET, - filtermanaged_bynot_in: str | Unset = UNSET, + include: Union[Unset, ListCatalogsInclude] = UNSET, + sort: Union[Unset, ListCatalogsSort] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterexternal_id: Union[Unset, str] = UNSET, + filtermanaged_by: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filterslugeq: Union[Unset, str] = UNSET, + filterslugnot_eq: Union[Unset, str] = UNSET, + filterslugin: Union[Unset, str] = UNSET, + filterslugnot_in: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, + filtermanaged_byeq: Union[Unset, str] = UNSET, + filtermanaged_bynot_eq: Union[Unset, str] = UNSET, + filtermanaged_byin: Union[Unset, str] = UNSET, + filtermanaged_bynot_in: Union[Unset, str] = UNSET, ) -> Response[CatalogList]: """List catalogs List catalogs Args: - include (ListCatalogsInclude | Unset): - sort (ListCatalogsSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterexternal_id (str | Unset): - filtermanaged_by (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filtermanaged_byeq (str | Unset): - filtermanaged_bynot_eq (str | Unset): - filtermanaged_byin (str | Unset): - filtermanaged_bynot_in (str | Unset): + include (Union[Unset, ListCatalogsInclude]): + sort (Union[Unset, ListCatalogsSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterexternal_id (Union[Unset, str]): + filtermanaged_by (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filtermanaged_byeq (Union[Unset, str]): + filtermanaged_bynot_eq (Union[Unset, str]): + filtermanaged_byin (Union[Unset, str]): + filtermanaged_bynot_in (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -238,62 +237,62 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: ListCatalogsInclude | Unset = UNSET, - sort: ListCatalogsSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterexternal_id: str | Unset = UNSET, - filtermanaged_by: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filtermanaged_byeq: str | Unset = UNSET, - filtermanaged_bynot_eq: str | Unset = UNSET, - filtermanaged_byin: str | Unset = UNSET, - filtermanaged_bynot_in: str | Unset = UNSET, -) -> CatalogList | None: + include: Union[Unset, ListCatalogsInclude] = UNSET, + sort: Union[Unset, ListCatalogsSort] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterexternal_id: Union[Unset, str] = UNSET, + filtermanaged_by: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filterslugeq: Union[Unset, str] = UNSET, + filterslugnot_eq: Union[Unset, str] = UNSET, + filterslugin: Union[Unset, str] = UNSET, + filterslugnot_in: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, + filtermanaged_byeq: Union[Unset, str] = UNSET, + filtermanaged_bynot_eq: Union[Unset, str] = UNSET, + filtermanaged_byin: Union[Unset, str] = UNSET, + filtermanaged_bynot_in: Union[Unset, str] = UNSET, +) -> Optional[CatalogList]: """List catalogs List catalogs Args: - include (ListCatalogsInclude | Unset): - sort (ListCatalogsSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterexternal_id (str | Unset): - filtermanaged_by (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filtermanaged_byeq (str | Unset): - filtermanaged_bynot_eq (str | Unset): - filtermanaged_byin (str | Unset): - filtermanaged_bynot_in (str | Unset): + include (Union[Unset, ListCatalogsInclude]): + sort (Union[Unset, ListCatalogsSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterexternal_id (Union[Unset, str]): + filtermanaged_by (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filtermanaged_byeq (Union[Unset, str]): + filtermanaged_bynot_eq (Union[Unset, str]): + filtermanaged_byin (Union[Unset, str]): + filtermanaged_bynot_in (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -336,62 +335,62 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: ListCatalogsInclude | Unset = UNSET, - sort: ListCatalogsSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterexternal_id: str | Unset = UNSET, - filtermanaged_by: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filtermanaged_byeq: str | Unset = UNSET, - filtermanaged_bynot_eq: str | Unset = UNSET, - filtermanaged_byin: str | Unset = UNSET, - filtermanaged_bynot_in: str | Unset = UNSET, + include: Union[Unset, ListCatalogsInclude] = UNSET, + sort: Union[Unset, ListCatalogsSort] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterexternal_id: Union[Unset, str] = UNSET, + filtermanaged_by: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filterslugeq: Union[Unset, str] = UNSET, + filterslugnot_eq: Union[Unset, str] = UNSET, + filterslugin: Union[Unset, str] = UNSET, + filterslugnot_in: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, + filtermanaged_byeq: Union[Unset, str] = UNSET, + filtermanaged_bynot_eq: Union[Unset, str] = UNSET, + filtermanaged_byin: Union[Unset, str] = UNSET, + filtermanaged_bynot_in: Union[Unset, str] = UNSET, ) -> Response[CatalogList]: """List catalogs List catalogs Args: - include (ListCatalogsInclude | Unset): - sort (ListCatalogsSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterexternal_id (str | Unset): - filtermanaged_by (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filtermanaged_byeq (str | Unset): - filtermanaged_bynot_eq (str | Unset): - filtermanaged_byin (str | Unset): - filtermanaged_bynot_in (str | Unset): + include (Union[Unset, ListCatalogsInclude]): + sort (Union[Unset, ListCatalogsSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterexternal_id (Union[Unset, str]): + filtermanaged_by (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filtermanaged_byeq (Union[Unset, str]): + filtermanaged_bynot_eq (Union[Unset, str]): + filtermanaged_byin (Union[Unset, str]): + filtermanaged_bynot_in (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -437,62 +436,62 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: ListCatalogsInclude | Unset = UNSET, - sort: ListCatalogsSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterexternal_id: str | Unset = UNSET, - filtermanaged_by: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filtermanaged_byeq: str | Unset = UNSET, - filtermanaged_bynot_eq: str | Unset = UNSET, - filtermanaged_byin: str | Unset = UNSET, - filtermanaged_bynot_in: str | Unset = UNSET, -) -> CatalogList | None: + include: Union[Unset, ListCatalogsInclude] = UNSET, + sort: Union[Unset, ListCatalogsSort] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterexternal_id: Union[Unset, str] = UNSET, + filtermanaged_by: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filterslugeq: Union[Unset, str] = UNSET, + filterslugnot_eq: Union[Unset, str] = UNSET, + filterslugin: Union[Unset, str] = UNSET, + filterslugnot_in: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, + filtermanaged_byeq: Union[Unset, str] = UNSET, + filtermanaged_bynot_eq: Union[Unset, str] = UNSET, + filtermanaged_byin: Union[Unset, str] = UNSET, + filtermanaged_bynot_in: Union[Unset, str] = UNSET, +) -> Optional[CatalogList]: """List catalogs List catalogs Args: - include (ListCatalogsInclude | Unset): - sort (ListCatalogsSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterexternal_id (str | Unset): - filtermanaged_by (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filtermanaged_byeq (str | Unset): - filtermanaged_bynot_eq (str | Unset): - filtermanaged_byin (str | Unset): - filtermanaged_bynot_in (str | Unset): + include (Union[Unset, ListCatalogsInclude]): + sort (Union[Unset, ListCatalogsSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterexternal_id (Union[Unset, str]): + filtermanaged_by (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filtermanaged_byeq (Union[Unset, str]): + filtermanaged_bynot_eq (Union[Unset, str]): + filtermanaged_byin (Union[Unset, str]): + filtermanaged_bynot_in (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/catalogs/update_catalog.py b/rootly_sdk/api/catalogs/update_catalog.py index 47da6eea..93d889a8 100644 --- a/rootly_sdk/api/catalogs/update_catalog.py +++ b/rootly_sdk/api/catalogs/update_catalog.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union from uuid import UUID import httpx @@ -14,7 +13,7 @@ def _get_kwargs( - id: str | UUID, + id: Union[UUID, str], *, body: UpdateCatalog, ) -> dict[str, Any]: @@ -22,9 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/catalogs/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/catalogs/{id}", } _kwargs["json"] = body.to_dict() @@ -36,8 +33,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> CatalogResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[CatalogResponse, ErrorsList]]: if response.status_code == 200: response_200 = CatalogResponse.from_dict(response.json()) @@ -55,8 +52,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[CatalogResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[CatalogResponse, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,17 +63,17 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdateCatalog, -) -> Response[CatalogResponse | ErrorsList]: +) -> Response[Union[CatalogResponse, ErrorsList]]: """Update a catalog Update a specific catalog by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateCatalog): Raises: @@ -84,7 +81,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CatalogResponse | ErrorsList] + Response[Union[CatalogResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -100,17 +97,17 @@ def sync_detailed( def sync( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdateCatalog, -) -> CatalogResponse | ErrorsList | None: +) -> Optional[Union[CatalogResponse, ErrorsList]]: """Update a catalog Update a specific catalog by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateCatalog): Raises: @@ -118,7 +115,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CatalogResponse | ErrorsList + Union[CatalogResponse, ErrorsList] """ return sync_detailed( @@ -129,17 +126,17 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdateCatalog, -) -> Response[CatalogResponse | ErrorsList]: +) -> Response[Union[CatalogResponse, ErrorsList]]: """Update a catalog Update a specific catalog by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateCatalog): Raises: @@ -147,7 +144,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CatalogResponse | ErrorsList] + Response[Union[CatalogResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -161,17 +158,17 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdateCatalog, -) -> CatalogResponse | ErrorsList | None: +) -> Optional[Union[CatalogResponse, ErrorsList]]: """Update a catalog Update a specific catalog by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateCatalog): Raises: @@ -179,7 +176,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CatalogResponse | ErrorsList + Union[CatalogResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/causes/create_cause.py b/rootly_sdk/api/causes/create_cause.py index c1e704a0..8762e9c3 100644 --- a/rootly_sdk/api/causes/create_cause.py +++ b/rootly_sdk/api/causes/create_cause.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> CauseResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[CauseResponse, ErrorsList]]: if response.status_code == 201: response_201 = CauseResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[CauseResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[CauseResponse, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +69,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewCause, -) -> Response[CauseResponse | ErrorsList]: +) -> Response[Union[CauseResponse, ErrorsList]]: """Creates a cause Creates a new cause from provided data @@ -82,7 +82,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CauseResponse | ErrorsList] + Response[Union[CauseResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: NewCause, -) -> CauseResponse | ErrorsList | None: +) -> Optional[Union[CauseResponse, ErrorsList]]: """Creates a cause Creates a new cause from provided data @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CauseResponse | ErrorsList + Union[CauseResponse, ErrorsList] """ return sync_detailed( @@ -126,7 +126,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewCause, -) -> Response[CauseResponse | ErrorsList]: +) -> Response[Union[CauseResponse, ErrorsList]]: """Creates a cause Creates a new cause from provided data @@ -139,7 +139,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CauseResponse | ErrorsList] + Response[Union[CauseResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -155,7 +155,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewCause, -) -> CauseResponse | ErrorsList | None: +) -> Optional[Union[CauseResponse, ErrorsList]]: """Creates a cause Creates a new cause from provided data @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CauseResponse | ErrorsList + Union[CauseResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/causes/create_cause_catalog_property.py b/rootly_sdk/api/causes/create_cause_catalog_property.py index 6e2bf436..91b16895 100644 --- a/rootly_sdk/api/causes/create_cause_catalog_property.py +++ b/rootly_sdk/api/causes/create_cause_catalog_property.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> CatalogPropertyResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[CatalogPropertyResponse, ErrorsList]]: if response.status_code == 201: response_201 = CatalogPropertyResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[CatalogPropertyResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[CatalogPropertyResponse, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +69,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewCatalogProperty, -) -> Response[CatalogPropertyResponse | ErrorsList]: +) -> Response[Union[CatalogPropertyResponse, ErrorsList]]: """Creates a Catalog Property Creates a new Catalog Property from provided data @@ -82,7 +82,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CatalogPropertyResponse | ErrorsList] + Response[Union[CatalogPropertyResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: NewCatalogProperty, -) -> CatalogPropertyResponse | ErrorsList | None: +) -> Optional[Union[CatalogPropertyResponse, ErrorsList]]: """Creates a Catalog Property Creates a new Catalog Property from provided data @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CatalogPropertyResponse | ErrorsList + Union[CatalogPropertyResponse, ErrorsList] """ return sync_detailed( @@ -126,7 +126,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewCatalogProperty, -) -> Response[CatalogPropertyResponse | ErrorsList]: +) -> Response[Union[CatalogPropertyResponse, ErrorsList]]: """Creates a Catalog Property Creates a new Catalog Property from provided data @@ -139,7 +139,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CatalogPropertyResponse | ErrorsList] + Response[Union[CatalogPropertyResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -155,7 +155,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewCatalogProperty, -) -> CatalogPropertyResponse | ErrorsList | None: +) -> Optional[Union[CatalogPropertyResponse, ErrorsList]]: """Creates a Catalog Property Creates a new Catalog Property from provided data @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CatalogPropertyResponse | ErrorsList + Union[CatalogPropertyResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/causes/delete_cause.py b/rootly_sdk/api/causes/delete_cause.py index 3edaf3a4..59220ddd 100644 --- a/rootly_sdk/api/causes/delete_cause.py +++ b/rootly_sdk/api/causes/delete_cause.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union from uuid import UUID import httpx @@ -13,22 +12,19 @@ def _get_kwargs( - id: str | UUID, + id: Union[UUID, str], ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/causes/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/causes/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> CauseResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[CauseResponse, ErrorsList]]: if response.status_code == 200: response_200 = CauseResponse.from_dict(response.json()) @@ -46,8 +42,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[CauseResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[CauseResponse, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -57,23 +53,23 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Response[CauseResponse | ErrorsList]: +) -> Response[Union[CauseResponse, ErrorsList]]: """Delete a cause Delete a specific cause by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CauseResponse | ErrorsList] + Response[Union[CauseResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -88,23 +84,23 @@ def sync_detailed( def sync( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> CauseResponse | ErrorsList | None: +) -> Optional[Union[CauseResponse, ErrorsList]]: """Delete a cause Delete a specific cause by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CauseResponse | ErrorsList + Union[CauseResponse, ErrorsList] """ return sync_detailed( @@ -114,23 +110,23 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Response[CauseResponse | ErrorsList]: +) -> Response[Union[CauseResponse, ErrorsList]]: """Delete a cause Delete a specific cause by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CauseResponse | ErrorsList] + Response[Union[CauseResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -143,23 +139,23 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> CauseResponse | ErrorsList | None: +) -> Optional[Union[CauseResponse, ErrorsList]]: """Delete a cause Delete a specific cause by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CauseResponse | ErrorsList + Union[CauseResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/causes/get_cause.py b/rootly_sdk/api/causes/get_cause.py index e8c8bff7..f8a5cfc6 100644 --- a/rootly_sdk/api/causes/get_cause.py +++ b/rootly_sdk/api/causes/get_cause.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union from uuid import UUID import httpx @@ -13,22 +12,19 @@ def _get_kwargs( - id: str | UUID, + id: Union[UUID, str], ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/causes/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/causes/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> CauseResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[CauseResponse, ErrorsList]]: if response.status_code == 200: response_200 = CauseResponse.from_dict(response.json()) @@ -46,8 +42,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[CauseResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[CauseResponse, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -57,23 +53,23 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Response[CauseResponse | ErrorsList]: +) -> Response[Union[CauseResponse, ErrorsList]]: """Retrieves a cause Retrieves a specific cause by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CauseResponse | ErrorsList] + Response[Union[CauseResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -88,23 +84,23 @@ def sync_detailed( def sync( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> CauseResponse | ErrorsList | None: +) -> Optional[Union[CauseResponse, ErrorsList]]: """Retrieves a cause Retrieves a specific cause by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CauseResponse | ErrorsList + Union[CauseResponse, ErrorsList] """ return sync_detailed( @@ -114,23 +110,23 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Response[CauseResponse | ErrorsList]: +) -> Response[Union[CauseResponse, ErrorsList]]: """Retrieves a cause Retrieves a specific cause by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CauseResponse | ErrorsList] + Response[Union[CauseResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -143,23 +139,23 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> CauseResponse | ErrorsList | None: +) -> Optional[Union[CauseResponse, ErrorsList]]: """Retrieves a cause Retrieves a specific cause by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CauseResponse | ErrorsList + Union[CauseResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/causes/list_cause_catalog_properties.py b/rootly_sdk/api/causes/list_cause_catalog_properties.py index 56923dc0..714d68a1 100644 --- a/rootly_sdk/api/causes/list_cause_catalog_properties.py +++ b/rootly_sdk/api/causes/list_cause_catalog_properties.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -17,28 +17,27 @@ def _get_kwargs( *, - include: ListCauseCatalogPropertiesInclude | Unset = UNSET, - sort: ListCauseCatalogPropertiesSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Union[Unset, ListCauseCatalogPropertiesInclude] = UNSET, + sort: Union[Unset, ListCauseCatalogPropertiesSort] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterkind: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} - json_include: str | Unset = UNSET + json_include: Union[Unset, str] = UNSET if not isinstance(include, Unset): json_include = include params["include"] = json_include - json_sort: str | Unset = UNSET + json_sort: Union[Unset, str] = UNSET if not isinstance(sort, Unset): json_sort = sort @@ -73,7 +72,9 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> CatalogPropertyList | None: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[CatalogPropertyList]: if response.status_code == 200: response_200 = CatalogPropertyList.from_dict(response.json()) @@ -85,7 +86,9 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[CatalogPropertyList]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[CatalogPropertyList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -97,34 +100,34 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - include: ListCauseCatalogPropertiesInclude | Unset = UNSET, - sort: ListCauseCatalogPropertiesSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Union[Unset, ListCauseCatalogPropertiesInclude] = UNSET, + sort: Union[Unset, ListCauseCatalogPropertiesSort] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterkind: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, ) -> Response[CatalogPropertyList]: """List Catalog Properties List Cause Catalog Properties Args: - include (ListCauseCatalogPropertiesInclude | Unset): - sort (ListCauseCatalogPropertiesSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterkind (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, ListCauseCatalogPropertiesInclude]): + sort (Union[Unset, ListCauseCatalogPropertiesSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterkind (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -158,34 +161,34 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: ListCauseCatalogPropertiesInclude | Unset = UNSET, - sort: ListCauseCatalogPropertiesSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, -) -> CatalogPropertyList | None: + include: Union[Unset, ListCauseCatalogPropertiesInclude] = UNSET, + sort: Union[Unset, ListCauseCatalogPropertiesSort] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterkind: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, +) -> Optional[CatalogPropertyList]: """List Catalog Properties List Cause Catalog Properties Args: - include (ListCauseCatalogPropertiesInclude | Unset): - sort (ListCauseCatalogPropertiesSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterkind (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, ListCauseCatalogPropertiesInclude]): + sort (Union[Unset, ListCauseCatalogPropertiesSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterkind (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -214,34 +217,34 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: ListCauseCatalogPropertiesInclude | Unset = UNSET, - sort: ListCauseCatalogPropertiesSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Union[Unset, ListCauseCatalogPropertiesInclude] = UNSET, + sort: Union[Unset, ListCauseCatalogPropertiesSort] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterkind: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, ) -> Response[CatalogPropertyList]: """List Catalog Properties List Cause Catalog Properties Args: - include (ListCauseCatalogPropertiesInclude | Unset): - sort (ListCauseCatalogPropertiesSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterkind (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, ListCauseCatalogPropertiesInclude]): + sort (Union[Unset, ListCauseCatalogPropertiesSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterkind (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -273,34 +276,34 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: ListCauseCatalogPropertiesInclude | Unset = UNSET, - sort: ListCauseCatalogPropertiesSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, -) -> CatalogPropertyList | None: + include: Union[Unset, ListCauseCatalogPropertiesInclude] = UNSET, + sort: Union[Unset, ListCauseCatalogPropertiesSort] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterkind: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, +) -> Optional[CatalogPropertyList]: """List Catalog Properties List Cause Catalog Properties Args: - include (ListCauseCatalogPropertiesInclude | Unset): - sort (ListCauseCatalogPropertiesSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterkind (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, ListCauseCatalogPropertiesInclude]): + sort (Union[Unset, ListCauseCatalogPropertiesSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterkind (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/causes/list_causes.py b/rootly_sdk/api/causes/list_causes.py index 183d88e9..c33d8b2d 100644 --- a/rootly_sdk/api/causes/list_causes.py +++ b/rootly_sdk/api/causes/list_causes.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -11,26 +11,25 @@ def _get_kwargs( *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filterslugeq: Union[Unset, str] = UNSET, + filterslugnot_eq: Union[Unset, str] = UNSET, + filterslugin: Union[Unset, str] = UNSET, + filterslugnot_in: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -80,7 +79,7 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> CauseList | None: +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[CauseList]: if response.status_code == 200: response_200 = CauseList.from_dict(response.json()) @@ -92,7 +91,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[CauseList]: +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[CauseList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -104,48 +103,48 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filterslugeq: Union[Unset, str] = UNSET, + filterslugnot_eq: Union[Unset, str] = UNSET, + filterslugin: Union[Unset, str] = UNSET, + filterslugnot_in: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, ) -> Response[CauseList]: """List causes List causes Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -186,48 +185,48 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, -) -> CauseList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filterslugeq: Union[Unset, str] = UNSET, + filterslugnot_eq: Union[Unset, str] = UNSET, + filterslugin: Union[Unset, str] = UNSET, + filterslugnot_in: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, +) -> Optional[CauseList]: """List causes List causes Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -263,48 +262,48 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filterslugeq: Union[Unset, str] = UNSET, + filterslugnot_eq: Union[Unset, str] = UNSET, + filterslugin: Union[Unset, str] = UNSET, + filterslugnot_in: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, ) -> Response[CauseList]: """List causes List causes Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -343,48 +342,48 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, -) -> CauseList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filterslugeq: Union[Unset, str] = UNSET, + filterslugnot_eq: Union[Unset, str] = UNSET, + filterslugin: Union[Unset, str] = UNSET, + filterslugnot_in: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, +) -> Optional[CauseList]: """List causes List causes Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/causes/update_cause.py b/rootly_sdk/api/causes/update_cause.py index 46e11dce..39ff3759 100644 --- a/rootly_sdk/api/causes/update_cause.py +++ b/rootly_sdk/api/causes/update_cause.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union from uuid import UUID import httpx @@ -14,7 +13,7 @@ def _get_kwargs( - id: str | UUID, + id: Union[UUID, str], *, body: UpdateCause, ) -> dict[str, Any]: @@ -22,9 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/causes/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/causes/{id}", } _kwargs["json"] = body.to_dict() @@ -36,8 +33,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> CauseResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[CauseResponse, ErrorsList]]: if response.status_code == 200: response_200 = CauseResponse.from_dict(response.json()) @@ -55,8 +52,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[CauseResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[CauseResponse, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,17 +63,17 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdateCause, -) -> Response[CauseResponse | ErrorsList]: +) -> Response[Union[CauseResponse, ErrorsList]]: """Update a cause Update a specific cause by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateCause): Raises: @@ -84,7 +81,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CauseResponse | ErrorsList] + Response[Union[CauseResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -100,17 +97,17 @@ def sync_detailed( def sync( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdateCause, -) -> CauseResponse | ErrorsList | None: +) -> Optional[Union[CauseResponse, ErrorsList]]: """Update a cause Update a specific cause by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateCause): Raises: @@ -118,7 +115,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CauseResponse | ErrorsList + Union[CauseResponse, ErrorsList] """ return sync_detailed( @@ -129,17 +126,17 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdateCause, -) -> Response[CauseResponse | ErrorsList]: +) -> Response[Union[CauseResponse, ErrorsList]]: """Update a cause Update a specific cause by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateCause): Raises: @@ -147,7 +144,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CauseResponse | ErrorsList] + Response[Union[CauseResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -161,17 +158,17 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdateCause, -) -> CauseResponse | ErrorsList | None: +) -> Optional[Union[CauseResponse, ErrorsList]]: """Update a cause Update a specific cause by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateCause): Raises: @@ -179,7 +176,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CauseResponse | ErrorsList + Union[CauseResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/communications_groups/create_communications_group.py b/rootly_sdk/api/communications_groups/create_communications_group.py index 84fa7b89..c02b8fcd 100644 --- a/rootly_sdk/api/communications_groups/create_communications_group.py +++ b/rootly_sdk/api/communications_groups/create_communications_group.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> CommunicationsGroupResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[CommunicationsGroupResponse, ErrorsList]]: if response.status_code == 201: response_201 = CommunicationsGroupResponse.from_dict(response.json()) @@ -50,8 +50,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[CommunicationsGroupResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[CommunicationsGroupResponse, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -64,7 +64,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewCommunicationsGroup, -) -> Response[CommunicationsGroupResponse | ErrorsList]: +) -> Response[Union[CommunicationsGroupResponse, ErrorsList]]: """Creates a communications group Creates a new communications group from provided data @@ -77,7 +77,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CommunicationsGroupResponse | ErrorsList] + Response[Union[CommunicationsGroupResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -95,7 +95,7 @@ def sync( *, client: AuthenticatedClient, body: NewCommunicationsGroup, -) -> CommunicationsGroupResponse | ErrorsList | None: +) -> Optional[Union[CommunicationsGroupResponse, ErrorsList]]: """Creates a communications group Creates a new communications group from provided data @@ -108,7 +108,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CommunicationsGroupResponse | ErrorsList + Union[CommunicationsGroupResponse, ErrorsList] """ return sync_detailed( @@ -121,7 +121,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewCommunicationsGroup, -) -> Response[CommunicationsGroupResponse | ErrorsList]: +) -> Response[Union[CommunicationsGroupResponse, ErrorsList]]: """Creates a communications group Creates a new communications group from provided data @@ -134,7 +134,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CommunicationsGroupResponse | ErrorsList] + Response[Union[CommunicationsGroupResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -150,7 +150,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewCommunicationsGroup, -) -> CommunicationsGroupResponse | ErrorsList | None: +) -> Optional[Union[CommunicationsGroupResponse, ErrorsList]]: """Creates a communications group Creates a new communications group from provided data @@ -163,7 +163,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CommunicationsGroupResponse | ErrorsList + Union[CommunicationsGroupResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/communications_groups/delete_communications_group.py b/rootly_sdk/api/communications_groups/delete_communications_group.py index 7bb4306a..9b8f1c84 100644 --- a/rootly_sdk/api/communications_groups/delete_communications_group.py +++ b/rootly_sdk/api/communications_groups/delete_communications_group.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any, cast -from urllib.parse import quote +from typing import Any, Optional, Union, cast import httpx @@ -13,18 +12,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/communications/groups/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/communications/groups/{id}", } return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Any | ErrorsList | None: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorsList]]: if response.status_code == 200: response_200 = cast(Any, None) return response_200 @@ -40,7 +38,9 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Any | ErrorsList]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -53,7 +53,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Any | ErrorsList]: +) -> Response[Union[Any, ErrorsList]]: """Deletes a communications group Deletes a communications group @@ -66,7 +66,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | ErrorsList] + Response[Union[Any, ErrorsList]] """ kwargs = _get_kwargs( @@ -84,7 +84,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Any | ErrorsList | None: +) -> Optional[Union[Any, ErrorsList]]: """Deletes a communications group Deletes a communications group @@ -97,7 +97,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | ErrorsList + Union[Any, ErrorsList] """ return sync_detailed( @@ -110,7 +110,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Any | ErrorsList]: +) -> Response[Union[Any, ErrorsList]]: """Deletes a communications group Deletes a communications group @@ -123,7 +123,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | ErrorsList] + Response[Union[Any, ErrorsList]] """ kwargs = _get_kwargs( @@ -139,7 +139,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Any | ErrorsList | None: +) -> Optional[Union[Any, ErrorsList]]: """Deletes a communications group Deletes a communications group @@ -152,7 +152,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | ErrorsList + Union[Any, ErrorsList] """ return ( diff --git a/rootly_sdk/api/communications_groups/get_communications_group.py b/rootly_sdk/api/communications_groups/get_communications_group.py index 9c1e74ef..3120d336 100644 --- a/rootly_sdk/api/communications_groups/get_communications_group.py +++ b/rootly_sdk/api/communications_groups/get_communications_group.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/communications/groups/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/communications/groups/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> CommunicationsGroupResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[CommunicationsGroupResponse, ErrorsList]]: if response.status_code == 200: response_200 = CommunicationsGroupResponse.from_dict(response.json()) @@ -45,8 +41,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[CommunicationsGroupResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[CommunicationsGroupResponse, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[CommunicationsGroupResponse | ErrorsList]: +) -> Response[Union[CommunicationsGroupResponse, ErrorsList]]: """Shows a communications group Shows details of a communications group @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CommunicationsGroupResponse | ErrorsList] + Response[Union[CommunicationsGroupResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -90,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> CommunicationsGroupResponse | ErrorsList | None: +) -> Optional[Union[CommunicationsGroupResponse, ErrorsList]]: """Shows a communications group Shows details of a communications group @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CommunicationsGroupResponse | ErrorsList + Union[CommunicationsGroupResponse, ErrorsList] """ return sync_detailed( @@ -116,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[CommunicationsGroupResponse | ErrorsList]: +) -> Response[Union[CommunicationsGroupResponse, ErrorsList]]: """Shows a communications group Shows details of a communications group @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CommunicationsGroupResponse | ErrorsList] + Response[Union[CommunicationsGroupResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -145,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> CommunicationsGroupResponse | ErrorsList | None: +) -> Optional[Union[CommunicationsGroupResponse, ErrorsList]]: """Shows a communications group Shows details of a communications group @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CommunicationsGroupResponse | ErrorsList + Union[CommunicationsGroupResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/communications_groups/list_communications_groups.py b/rootly_sdk/api/communications_groups/list_communications_groups.py index 880eea27..574ab3a2 100644 --- a/rootly_sdk/api/communications_groups/list_communications_groups.py +++ b/rootly_sdk/api/communications_groups/list_communications_groups.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -11,21 +11,20 @@ def _get_kwargs( *, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filteris_private: str | Unset = UNSET, - filtercommunication_type_id: str | Unset = UNSET, - filtercondition_type: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filteris_private: Union[Unset, str] = UNSET, + filtercommunication_type_id: Union[Unset, str] = UNSET, + filtercondition_type: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["page[number]"] = pagenumber @@ -66,8 +65,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> CommunicationsGroupsResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[CommunicationsGroupsResponse]: if response.status_code == 200: response_200 = CommunicationsGroupsResponse.from_dict(response.json()) @@ -80,7 +79,7 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[CommunicationsGroupsResponse]: return Response( status_code=HTTPStatus(response.status_code), @@ -93,38 +92,38 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filteris_private: str | Unset = UNSET, - filtercommunication_type_id: str | Unset = UNSET, - filtercondition_type: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filteris_private: Union[Unset, str] = UNSET, + filtercommunication_type_id: Union[Unset, str] = UNSET, + filtercondition_type: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, ) -> Response[CommunicationsGroupsResponse]: """Lists communications groups Lists communications groups Args: - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterslug (str | Unset): - filteris_private (str | Unset): - filtercommunication_type_id (str | Unset): - filtercondition_type (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - sort (str | Unset): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterslug (Union[Unset, str]): + filteris_private (Union[Unset, str]): + filtercommunication_type_id (Union[Unset, str]): + filtercondition_type (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -160,38 +159,38 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filteris_private: str | Unset = UNSET, - filtercommunication_type_id: str | Unset = UNSET, - filtercondition_type: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, -) -> CommunicationsGroupsResponse | None: + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filteris_private: Union[Unset, str] = UNSET, + filtercommunication_type_id: Union[Unset, str] = UNSET, + filtercondition_type: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, +) -> Optional[CommunicationsGroupsResponse]: """Lists communications groups Lists communications groups Args: - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterslug (str | Unset): - filteris_private (str | Unset): - filtercommunication_type_id (str | Unset): - filtercondition_type (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - sort (str | Unset): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterslug (Union[Unset, str]): + filteris_private (Union[Unset, str]): + filtercommunication_type_id (Union[Unset, str]): + filtercondition_type (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -222,38 +221,38 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filteris_private: str | Unset = UNSET, - filtercommunication_type_id: str | Unset = UNSET, - filtercondition_type: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filteris_private: Union[Unset, str] = UNSET, + filtercommunication_type_id: Union[Unset, str] = UNSET, + filtercondition_type: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, ) -> Response[CommunicationsGroupsResponse]: """Lists communications groups Lists communications groups Args: - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterslug (str | Unset): - filteris_private (str | Unset): - filtercommunication_type_id (str | Unset): - filtercondition_type (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - sort (str | Unset): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterslug (Union[Unset, str]): + filteris_private (Union[Unset, str]): + filtercommunication_type_id (Union[Unset, str]): + filtercondition_type (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -287,38 +286,38 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filteris_private: str | Unset = UNSET, - filtercommunication_type_id: str | Unset = UNSET, - filtercondition_type: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, -) -> CommunicationsGroupsResponse | None: + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filteris_private: Union[Unset, str] = UNSET, + filtercommunication_type_id: Union[Unset, str] = UNSET, + filtercondition_type: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, +) -> Optional[CommunicationsGroupsResponse]: """Lists communications groups Lists communications groups Args: - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterslug (str | Unset): - filteris_private (str | Unset): - filtercommunication_type_id (str | Unset): - filtercondition_type (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - sort (str | Unset): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterslug (Union[Unset, str]): + filteris_private (Union[Unset, str]): + filtercommunication_type_id (Union[Unset, str]): + filtercondition_type (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/communications_groups/update_communications_group.py b/rootly_sdk/api/communications_groups/update_communications_group.py index 56751baf..8ff0d27b 100644 --- a/rootly_sdk/api/communications_groups/update_communications_group.py +++ b/rootly_sdk/api/communications_groups/update_communications_group.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "patch", - "url": "/v1/communications/groups/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/communications/groups/{id}", } _kwargs["json"] = body.to_dict() @@ -35,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> CommunicationsGroupResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[CommunicationsGroupResponse, ErrorsList]]: if response.status_code == 200: response_200 = CommunicationsGroupResponse.from_dict(response.json()) @@ -54,8 +51,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[CommunicationsGroupResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[CommunicationsGroupResponse, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateCommunicationsGroup, -) -> Response[CommunicationsGroupResponse | ErrorsList]: +) -> Response[Union[CommunicationsGroupResponse, ErrorsList]]: """Updates a communications group Updates a communications group @@ -83,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CommunicationsGroupResponse | ErrorsList] + Response[Union[CommunicationsGroupResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -103,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateCommunicationsGroup, -) -> CommunicationsGroupResponse | ErrorsList | None: +) -> Optional[Union[CommunicationsGroupResponse, ErrorsList]]: """Updates a communications group Updates a communications group @@ -117,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CommunicationsGroupResponse | ErrorsList + Union[CommunicationsGroupResponse, ErrorsList] """ return sync_detailed( @@ -132,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateCommunicationsGroup, -) -> Response[CommunicationsGroupResponse | ErrorsList]: +) -> Response[Union[CommunicationsGroupResponse, ErrorsList]]: """Updates a communications group Updates a communications group @@ -146,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CommunicationsGroupResponse | ErrorsList] + Response[Union[CommunicationsGroupResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -164,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateCommunicationsGroup, -) -> CommunicationsGroupResponse | ErrorsList | None: +) -> Optional[Union[CommunicationsGroupResponse, ErrorsList]]: """Updates a communications group Updates a communications group @@ -178,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CommunicationsGroupResponse | ErrorsList + Union[CommunicationsGroupResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/communications_stages/create_communications_stage.py b/rootly_sdk/api/communications_stages/create_communications_stage.py index 9e90afde..a25921cf 100644 --- a/rootly_sdk/api/communications_stages/create_communications_stage.py +++ b/rootly_sdk/api/communications_stages/create_communications_stage.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> CommunicationsStageResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[CommunicationsStageResponse, ErrorsList]]: if response.status_code == 201: response_201 = CommunicationsStageResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[CommunicationsStageResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[CommunicationsStageResponse, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +69,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewCommunicationsStage, -) -> Response[CommunicationsStageResponse | ErrorsList]: +) -> Response[Union[CommunicationsStageResponse, ErrorsList]]: """Creates a communications stage Creates a new communications stage from provided data @@ -82,7 +82,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CommunicationsStageResponse | ErrorsList] + Response[Union[CommunicationsStageResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: NewCommunicationsStage, -) -> CommunicationsStageResponse | ErrorsList | None: +) -> Optional[Union[CommunicationsStageResponse, ErrorsList]]: """Creates a communications stage Creates a new communications stage from provided data @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CommunicationsStageResponse | ErrorsList + Union[CommunicationsStageResponse, ErrorsList] """ return sync_detailed( @@ -126,7 +126,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewCommunicationsStage, -) -> Response[CommunicationsStageResponse | ErrorsList]: +) -> Response[Union[CommunicationsStageResponse, ErrorsList]]: """Creates a communications stage Creates a new communications stage from provided data @@ -139,7 +139,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CommunicationsStageResponse | ErrorsList] + Response[Union[CommunicationsStageResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -155,7 +155,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewCommunicationsStage, -) -> CommunicationsStageResponse | ErrorsList | None: +) -> Optional[Union[CommunicationsStageResponse, ErrorsList]]: """Creates a communications stage Creates a new communications stage from provided data @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CommunicationsStageResponse | ErrorsList + Union[CommunicationsStageResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/communications_stages/delete_communications_stage.py b/rootly_sdk/api/communications_stages/delete_communications_stage.py index b5921be8..a8efae30 100644 --- a/rootly_sdk/api/communications_stages/delete_communications_stage.py +++ b/rootly_sdk/api/communications_stages/delete_communications_stage.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any, cast -from urllib.parse import quote +from typing import Any, Optional, Union, cast import httpx @@ -13,18 +12,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/communications/stages/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/communications/stages/{id}", } return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Any | ErrorsList | None: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorsList]]: if response.status_code == 200: response_200 = cast(Any, None) return response_200 @@ -40,7 +38,9 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Any | ErrorsList]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -53,7 +53,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Any | ErrorsList]: +) -> Response[Union[Any, ErrorsList]]: """Deletes a communications stage Deletes a communications stage @@ -66,7 +66,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | ErrorsList] + Response[Union[Any, ErrorsList]] """ kwargs = _get_kwargs( @@ -84,7 +84,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Any | ErrorsList | None: +) -> Optional[Union[Any, ErrorsList]]: """Deletes a communications stage Deletes a communications stage @@ -97,7 +97,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | ErrorsList + Union[Any, ErrorsList] """ return sync_detailed( @@ -110,7 +110,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Any | ErrorsList]: +) -> Response[Union[Any, ErrorsList]]: """Deletes a communications stage Deletes a communications stage @@ -123,7 +123,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | ErrorsList] + Response[Union[Any, ErrorsList]] """ kwargs = _get_kwargs( @@ -139,7 +139,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Any | ErrorsList | None: +) -> Optional[Union[Any, ErrorsList]]: """Deletes a communications stage Deletes a communications stage @@ -152,7 +152,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | ErrorsList + Union[Any, ErrorsList] """ return ( diff --git a/rootly_sdk/api/communications_stages/get_communications_stage.py b/rootly_sdk/api/communications_stages/get_communications_stage.py index 477e0d9a..349beb9b 100644 --- a/rootly_sdk/api/communications_stages/get_communications_stage.py +++ b/rootly_sdk/api/communications_stages/get_communications_stage.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/communications/stages/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/communications/stages/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> CommunicationsStageResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[CommunicationsStageResponse, ErrorsList]]: if response.status_code == 200: response_200 = CommunicationsStageResponse.from_dict(response.json()) @@ -45,8 +41,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[CommunicationsStageResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[CommunicationsStageResponse, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[CommunicationsStageResponse | ErrorsList]: +) -> Response[Union[CommunicationsStageResponse, ErrorsList]]: """Shows a communications stage Shows details of a communications stage @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CommunicationsStageResponse | ErrorsList] + Response[Union[CommunicationsStageResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -90,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> CommunicationsStageResponse | ErrorsList | None: +) -> Optional[Union[CommunicationsStageResponse, ErrorsList]]: """Shows a communications stage Shows details of a communications stage @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CommunicationsStageResponse | ErrorsList + Union[CommunicationsStageResponse, ErrorsList] """ return sync_detailed( @@ -116,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[CommunicationsStageResponse | ErrorsList]: +) -> Response[Union[CommunicationsStageResponse, ErrorsList]]: """Shows a communications stage Shows details of a communications stage @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CommunicationsStageResponse | ErrorsList] + Response[Union[CommunicationsStageResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -145,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> CommunicationsStageResponse | ErrorsList | None: +) -> Optional[Union[CommunicationsStageResponse, ErrorsList]]: """Shows a communications stage Shows details of a communications stage @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CommunicationsStageResponse | ErrorsList + Union[CommunicationsStageResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/communications_stages/list_communications_stages.py b/rootly_sdk/api/communications_stages/list_communications_stages.py index 174a6873..e9375099 100644 --- a/rootly_sdk/api/communications_stages/list_communications_stages.py +++ b/rootly_sdk/api/communications_stages/list_communications_stages.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -11,18 +11,17 @@ def _get_kwargs( *, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["page[number]"] = pagenumber @@ -57,8 +56,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> CommunicationsStagesResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[CommunicationsStagesResponse]: if response.status_code == 200: response_200 = CommunicationsStagesResponse.from_dict(response.json()) @@ -71,7 +70,7 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[CommunicationsStagesResponse]: return Response( status_code=HTTPStatus(response.status_code), @@ -84,32 +83,32 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, ) -> Response[CommunicationsStagesResponse]: """Lists communications stages Lists communications stages Args: - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterslug (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - sort (str | Unset): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -142,32 +141,32 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, -) -> CommunicationsStagesResponse | None: + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, +) -> Optional[CommunicationsStagesResponse]: """Lists communications stages Lists communications stages Args: - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterslug (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - sort (str | Unset): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -195,32 +194,32 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, ) -> Response[CommunicationsStagesResponse]: """Lists communications stages Lists communications stages Args: - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterslug (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - sort (str | Unset): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -251,32 +250,32 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, -) -> CommunicationsStagesResponse | None: + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, +) -> Optional[CommunicationsStagesResponse]: """Lists communications stages Lists communications stages Args: - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterslug (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - sort (str | Unset): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/communications_stages/update_communications_stage.py b/rootly_sdk/api/communications_stages/update_communications_stage.py index 13ed4698..51fc8ce7 100644 --- a/rootly_sdk/api/communications_stages/update_communications_stage.py +++ b/rootly_sdk/api/communications_stages/update_communications_stage.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "patch", - "url": "/v1/communications/stages/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/communications/stages/{id}", } _kwargs["json"] = body.to_dict() @@ -35,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> CommunicationsStageResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[CommunicationsStageResponse, ErrorsList]]: if response.status_code == 200: response_200 = CommunicationsStageResponse.from_dict(response.json()) @@ -54,8 +51,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[CommunicationsStageResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[CommunicationsStageResponse, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateCommunicationsStage, -) -> Response[CommunicationsStageResponse | ErrorsList]: +) -> Response[Union[CommunicationsStageResponse, ErrorsList]]: """Updates a communications stage Updates a communications stage @@ -83,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CommunicationsStageResponse | ErrorsList] + Response[Union[CommunicationsStageResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -103,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateCommunicationsStage, -) -> CommunicationsStageResponse | ErrorsList | None: +) -> Optional[Union[CommunicationsStageResponse, ErrorsList]]: """Updates a communications stage Updates a communications stage @@ -117,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CommunicationsStageResponse | ErrorsList + Union[CommunicationsStageResponse, ErrorsList] """ return sync_detailed( @@ -132,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateCommunicationsStage, -) -> Response[CommunicationsStageResponse | ErrorsList]: +) -> Response[Union[CommunicationsStageResponse, ErrorsList]]: """Updates a communications stage Updates a communications stage @@ -146,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CommunicationsStageResponse | ErrorsList] + Response[Union[CommunicationsStageResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -164,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateCommunicationsStage, -) -> CommunicationsStageResponse | ErrorsList | None: +) -> Optional[Union[CommunicationsStageResponse, ErrorsList]]: """Updates a communications stage Updates a communications stage @@ -178,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CommunicationsStageResponse | ErrorsList + Union[CommunicationsStageResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/communications_templates/create_communications_template.py b/rootly_sdk/api/communications_templates/create_communications_template.py index 5c62ff97..d3c18079 100644 --- a/rootly_sdk/api/communications_templates/create_communications_template.py +++ b/rootly_sdk/api/communications_templates/create_communications_template.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> CommunicationsTemplateResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[CommunicationsTemplateResponse, ErrorsList]]: if response.status_code == 201: response_201 = CommunicationsTemplateResponse.from_dict(response.json()) @@ -50,8 +50,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[CommunicationsTemplateResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[CommunicationsTemplateResponse, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -64,7 +64,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewCommunicationsTemplate, -) -> Response[CommunicationsTemplateResponse | ErrorsList]: +) -> Response[Union[CommunicationsTemplateResponse, ErrorsList]]: """Creates a communications template Creates a new communications template from provided data @@ -77,7 +77,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CommunicationsTemplateResponse | ErrorsList] + Response[Union[CommunicationsTemplateResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -95,7 +95,7 @@ def sync( *, client: AuthenticatedClient, body: NewCommunicationsTemplate, -) -> CommunicationsTemplateResponse | ErrorsList | None: +) -> Optional[Union[CommunicationsTemplateResponse, ErrorsList]]: """Creates a communications template Creates a new communications template from provided data @@ -108,7 +108,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CommunicationsTemplateResponse | ErrorsList + Union[CommunicationsTemplateResponse, ErrorsList] """ return sync_detailed( @@ -121,7 +121,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewCommunicationsTemplate, -) -> Response[CommunicationsTemplateResponse | ErrorsList]: +) -> Response[Union[CommunicationsTemplateResponse, ErrorsList]]: """Creates a communications template Creates a new communications template from provided data @@ -134,7 +134,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CommunicationsTemplateResponse | ErrorsList] + Response[Union[CommunicationsTemplateResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -150,7 +150,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewCommunicationsTemplate, -) -> CommunicationsTemplateResponse | ErrorsList | None: +) -> Optional[Union[CommunicationsTemplateResponse, ErrorsList]]: """Creates a communications template Creates a new communications template from provided data @@ -163,7 +163,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CommunicationsTemplateResponse | ErrorsList + Union[CommunicationsTemplateResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/communications_templates/delete_communications_template.py b/rootly_sdk/api/communications_templates/delete_communications_template.py index 5750a7a4..f8f22391 100644 --- a/rootly_sdk/api/communications_templates/delete_communications_template.py +++ b/rootly_sdk/api/communications_templates/delete_communications_template.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any, cast -from urllib.parse import quote +from typing import Any, Optional, Union, cast import httpx @@ -13,18 +12,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/communications/templates/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/communications/templates/{id}", } return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Any | ErrorsList | None: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorsList]]: if response.status_code == 200: response_200 = cast(Any, None) return response_200 @@ -40,7 +38,9 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Any | ErrorsList]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -53,7 +53,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Any | ErrorsList]: +) -> Response[Union[Any, ErrorsList]]: """Deletes a communications template Deletes a communications template @@ -66,7 +66,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | ErrorsList] + Response[Union[Any, ErrorsList]] """ kwargs = _get_kwargs( @@ -84,7 +84,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Any | ErrorsList | None: +) -> Optional[Union[Any, ErrorsList]]: """Deletes a communications template Deletes a communications template @@ -97,7 +97,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | ErrorsList + Union[Any, ErrorsList] """ return sync_detailed( @@ -110,7 +110,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Any | ErrorsList]: +) -> Response[Union[Any, ErrorsList]]: """Deletes a communications template Deletes a communications template @@ -123,7 +123,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | ErrorsList] + Response[Union[Any, ErrorsList]] """ kwargs = _get_kwargs( @@ -139,7 +139,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Any | ErrorsList | None: +) -> Optional[Union[Any, ErrorsList]]: """Deletes a communications template Deletes a communications template @@ -152,7 +152,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | ErrorsList + Union[Any, ErrorsList] """ return ( diff --git a/rootly_sdk/api/communications_templates/get_communications_template.py b/rootly_sdk/api/communications_templates/get_communications_template.py index 84eda309..baa98196 100644 --- a/rootly_sdk/api/communications_templates/get_communications_template.py +++ b/rootly_sdk/api/communications_templates/get_communications_template.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/communications/templates/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/communications/templates/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> CommunicationsTemplateResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[CommunicationsTemplateResponse, ErrorsList]]: if response.status_code == 200: response_200 = CommunicationsTemplateResponse.from_dict(response.json()) @@ -45,8 +41,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[CommunicationsTemplateResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[CommunicationsTemplateResponse, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[CommunicationsTemplateResponse | ErrorsList]: +) -> Response[Union[CommunicationsTemplateResponse, ErrorsList]]: """Shows a communications template Shows details of a communications template @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CommunicationsTemplateResponse | ErrorsList] + Response[Union[CommunicationsTemplateResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -90,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> CommunicationsTemplateResponse | ErrorsList | None: +) -> Optional[Union[CommunicationsTemplateResponse, ErrorsList]]: """Shows a communications template Shows details of a communications template @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CommunicationsTemplateResponse | ErrorsList + Union[CommunicationsTemplateResponse, ErrorsList] """ return sync_detailed( @@ -116,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[CommunicationsTemplateResponse | ErrorsList]: +) -> Response[Union[CommunicationsTemplateResponse, ErrorsList]]: """Shows a communications template Shows details of a communications template @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CommunicationsTemplateResponse | ErrorsList] + Response[Union[CommunicationsTemplateResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -145,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> CommunicationsTemplateResponse | ErrorsList | None: +) -> Optional[Union[CommunicationsTemplateResponse, ErrorsList]]: """Shows a communications template Shows details of a communications template @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CommunicationsTemplateResponse | ErrorsList + Union[CommunicationsTemplateResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/communications_templates/list_communications_templates.py b/rootly_sdk/api/communications_templates/list_communications_templates.py index 8d3f4fb0..e8e25f3e 100644 --- a/rootly_sdk/api/communications_templates/list_communications_templates.py +++ b/rootly_sdk/api/communications_templates/list_communications_templates.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -11,19 +11,18 @@ def _get_kwargs( *, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtercommunication_type_id: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtercommunication_type_id: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["page[number]"] = pagenumber @@ -60,8 +59,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> CommunicationsTemplatesResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[CommunicationsTemplatesResponse]: if response.status_code == 200: response_200 = CommunicationsTemplatesResponse.from_dict(response.json()) @@ -74,7 +73,7 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[CommunicationsTemplatesResponse]: return Response( status_code=HTTPStatus(response.status_code), @@ -87,34 +86,34 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtercommunication_type_id: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtercommunication_type_id: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, ) -> Response[CommunicationsTemplatesResponse]: """Lists communications templates Lists communications templates Args: - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterslug (str | Unset): - filtercommunication_type_id (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - sort (str | Unset): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtercommunication_type_id (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -148,34 +147,34 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtercommunication_type_id: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, -) -> CommunicationsTemplatesResponse | None: + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtercommunication_type_id: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, +) -> Optional[CommunicationsTemplatesResponse]: """Lists communications templates Lists communications templates Args: - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterslug (str | Unset): - filtercommunication_type_id (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - sort (str | Unset): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtercommunication_type_id (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -204,34 +203,34 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtercommunication_type_id: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtercommunication_type_id: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, ) -> Response[CommunicationsTemplatesResponse]: """Lists communications templates Lists communications templates Args: - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterslug (str | Unset): - filtercommunication_type_id (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - sort (str | Unset): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtercommunication_type_id (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -263,34 +262,34 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtercommunication_type_id: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, -) -> CommunicationsTemplatesResponse | None: + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtercommunication_type_id: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, +) -> Optional[CommunicationsTemplatesResponse]: """Lists communications templates Lists communications templates Args: - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterslug (str | Unset): - filtercommunication_type_id (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - sort (str | Unset): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtercommunication_type_id (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/communications_templates/update_communications_template.py b/rootly_sdk/api/communications_templates/update_communications_template.py index d3b3b5a0..f0da99f7 100644 --- a/rootly_sdk/api/communications_templates/update_communications_template.py +++ b/rootly_sdk/api/communications_templates/update_communications_template.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "patch", - "url": "/v1/communications/templates/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/communications/templates/{id}", } _kwargs["json"] = body.to_dict() @@ -35,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> CommunicationsTemplateResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[CommunicationsTemplateResponse, ErrorsList]]: if response.status_code == 200: response_200 = CommunicationsTemplateResponse.from_dict(response.json()) @@ -54,8 +51,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[CommunicationsTemplateResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[CommunicationsTemplateResponse, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateCommunicationsTemplate, -) -> Response[CommunicationsTemplateResponse | ErrorsList]: +) -> Response[Union[CommunicationsTemplateResponse, ErrorsList]]: """Updates a communications template Updates a communications template @@ -83,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CommunicationsTemplateResponse | ErrorsList] + Response[Union[CommunicationsTemplateResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -103,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateCommunicationsTemplate, -) -> CommunicationsTemplateResponse | ErrorsList | None: +) -> Optional[Union[CommunicationsTemplateResponse, ErrorsList]]: """Updates a communications template Updates a communications template @@ -117,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CommunicationsTemplateResponse | ErrorsList + Union[CommunicationsTemplateResponse, ErrorsList] """ return sync_detailed( @@ -132,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateCommunicationsTemplate, -) -> Response[CommunicationsTemplateResponse | ErrorsList]: +) -> Response[Union[CommunicationsTemplateResponse, ErrorsList]]: """Updates a communications template Updates a communications template @@ -146,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CommunicationsTemplateResponse | ErrorsList] + Response[Union[CommunicationsTemplateResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -164,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateCommunicationsTemplate, -) -> CommunicationsTemplateResponse | ErrorsList | None: +) -> Optional[Union[CommunicationsTemplateResponse, ErrorsList]]: """Updates a communications template Updates a communications template @@ -178,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CommunicationsTemplateResponse | ErrorsList + Union[CommunicationsTemplateResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/communications_types/create_communications_type.py b/rootly_sdk/api/communications_types/create_communications_type.py index 873b6e89..20a87539 100644 --- a/rootly_sdk/api/communications_types/create_communications_type.py +++ b/rootly_sdk/api/communications_types/create_communications_type.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> CommunicationsTypeResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[CommunicationsTypeResponse, ErrorsList]]: if response.status_code == 201: response_201 = CommunicationsTypeResponse.from_dict(response.json()) @@ -50,8 +50,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[CommunicationsTypeResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[CommunicationsTypeResponse, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -64,7 +64,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewCommunicationsType, -) -> Response[CommunicationsTypeResponse | ErrorsList]: +) -> Response[Union[CommunicationsTypeResponse, ErrorsList]]: """Creates a communications type Creates a new communications type from provided data @@ -77,7 +77,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CommunicationsTypeResponse | ErrorsList] + Response[Union[CommunicationsTypeResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -95,7 +95,7 @@ def sync( *, client: AuthenticatedClient, body: NewCommunicationsType, -) -> CommunicationsTypeResponse | ErrorsList | None: +) -> Optional[Union[CommunicationsTypeResponse, ErrorsList]]: """Creates a communications type Creates a new communications type from provided data @@ -108,7 +108,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CommunicationsTypeResponse | ErrorsList + Union[CommunicationsTypeResponse, ErrorsList] """ return sync_detailed( @@ -121,7 +121,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewCommunicationsType, -) -> Response[CommunicationsTypeResponse | ErrorsList]: +) -> Response[Union[CommunicationsTypeResponse, ErrorsList]]: """Creates a communications type Creates a new communications type from provided data @@ -134,7 +134,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CommunicationsTypeResponse | ErrorsList] + Response[Union[CommunicationsTypeResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -150,7 +150,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewCommunicationsType, -) -> CommunicationsTypeResponse | ErrorsList | None: +) -> Optional[Union[CommunicationsTypeResponse, ErrorsList]]: """Creates a communications type Creates a new communications type from provided data @@ -163,7 +163,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CommunicationsTypeResponse | ErrorsList + Union[CommunicationsTypeResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/communications_types/delete_communications_type.py b/rootly_sdk/api/communications_types/delete_communications_type.py index c14a941b..5da11018 100644 --- a/rootly_sdk/api/communications_types/delete_communications_type.py +++ b/rootly_sdk/api/communications_types/delete_communications_type.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any, cast -from urllib.parse import quote +from typing import Any, Optional, Union, cast import httpx @@ -13,18 +12,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/communications/types/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/communications/types/{id}", } return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Any | ErrorsList | None: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorsList]]: if response.status_code == 200: response_200 = cast(Any, None) return response_200 @@ -40,7 +38,9 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Any | ErrorsList]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -53,7 +53,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Any | ErrorsList]: +) -> Response[Union[Any, ErrorsList]]: """Deletes a communications type Deletes a communications type @@ -66,7 +66,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | ErrorsList] + Response[Union[Any, ErrorsList]] """ kwargs = _get_kwargs( @@ -84,7 +84,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Any | ErrorsList | None: +) -> Optional[Union[Any, ErrorsList]]: """Deletes a communications type Deletes a communications type @@ -97,7 +97,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | ErrorsList + Union[Any, ErrorsList] """ return sync_detailed( @@ -110,7 +110,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Any | ErrorsList]: +) -> Response[Union[Any, ErrorsList]]: """Deletes a communications type Deletes a communications type @@ -123,7 +123,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | ErrorsList] + Response[Union[Any, ErrorsList]] """ kwargs = _get_kwargs( @@ -139,7 +139,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Any | ErrorsList | None: +) -> Optional[Union[Any, ErrorsList]]: """Deletes a communications type Deletes a communications type @@ -152,7 +152,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | ErrorsList + Union[Any, ErrorsList] """ return ( diff --git a/rootly_sdk/api/communications_types/get_communications_type.py b/rootly_sdk/api/communications_types/get_communications_type.py index 1326081e..59bdd836 100644 --- a/rootly_sdk/api/communications_types/get_communications_type.py +++ b/rootly_sdk/api/communications_types/get_communications_type.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/communications/types/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/communications/types/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> CommunicationsTypeResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[CommunicationsTypeResponse, ErrorsList]]: if response.status_code == 200: response_200 = CommunicationsTypeResponse.from_dict(response.json()) @@ -45,8 +41,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[CommunicationsTypeResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[CommunicationsTypeResponse, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[CommunicationsTypeResponse | ErrorsList]: +) -> Response[Union[CommunicationsTypeResponse, ErrorsList]]: """Shows a communications type Shows details of a communications type @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CommunicationsTypeResponse | ErrorsList] + Response[Union[CommunicationsTypeResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -90,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> CommunicationsTypeResponse | ErrorsList | None: +) -> Optional[Union[CommunicationsTypeResponse, ErrorsList]]: """Shows a communications type Shows details of a communications type @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CommunicationsTypeResponse | ErrorsList + Union[CommunicationsTypeResponse, ErrorsList] """ return sync_detailed( @@ -116,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[CommunicationsTypeResponse | ErrorsList]: +) -> Response[Union[CommunicationsTypeResponse, ErrorsList]]: """Shows a communications type Shows details of a communications type @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CommunicationsTypeResponse | ErrorsList] + Response[Union[CommunicationsTypeResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -145,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> CommunicationsTypeResponse | ErrorsList | None: +) -> Optional[Union[CommunicationsTypeResponse, ErrorsList]]: """Shows a communications type Shows details of a communications type @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CommunicationsTypeResponse | ErrorsList + Union[CommunicationsTypeResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/communications_types/list_communications_types.py b/rootly_sdk/api/communications_types/list_communications_types.py index fdbac8ae..f67df31b 100644 --- a/rootly_sdk/api/communications_types/list_communications_types.py +++ b/rootly_sdk/api/communications_types/list_communications_types.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -11,18 +11,17 @@ def _get_kwargs( *, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["page[number]"] = pagenumber @@ -57,8 +56,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> CommunicationsTypesResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[CommunicationsTypesResponse]: if response.status_code == 200: response_200 = CommunicationsTypesResponse.from_dict(response.json()) @@ -71,7 +70,7 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[CommunicationsTypesResponse]: return Response( status_code=HTTPStatus(response.status_code), @@ -84,32 +83,32 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, ) -> Response[CommunicationsTypesResponse]: """Lists communications types Lists communications types Args: - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterslug (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - sort (str | Unset): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -142,32 +141,32 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, -) -> CommunicationsTypesResponse | None: + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, +) -> Optional[CommunicationsTypesResponse]: """Lists communications types Lists communications types Args: - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterslug (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - sort (str | Unset): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -195,32 +194,32 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, ) -> Response[CommunicationsTypesResponse]: """Lists communications types Lists communications types Args: - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterslug (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - sort (str | Unset): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -251,32 +250,32 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, -) -> CommunicationsTypesResponse | None: + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, +) -> Optional[CommunicationsTypesResponse]: """Lists communications types Lists communications types Args: - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterslug (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - sort (str | Unset): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/communications_types/update_communications_type.py b/rootly_sdk/api/communications_types/update_communications_type.py index 7e463b14..134d596b 100644 --- a/rootly_sdk/api/communications_types/update_communications_type.py +++ b/rootly_sdk/api/communications_types/update_communications_type.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "patch", - "url": "/v1/communications/types/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/communications/types/{id}", } _kwargs["json"] = body.to_dict() @@ -35,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> CommunicationsTypeResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[CommunicationsTypeResponse, ErrorsList]]: if response.status_code == 200: response_200 = CommunicationsTypeResponse.from_dict(response.json()) @@ -54,8 +51,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[CommunicationsTypeResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[CommunicationsTypeResponse, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateCommunicationsType, -) -> Response[CommunicationsTypeResponse | ErrorsList]: +) -> Response[Union[CommunicationsTypeResponse, ErrorsList]]: """Updates a communications type Updates a communications type @@ -83,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CommunicationsTypeResponse | ErrorsList] + Response[Union[CommunicationsTypeResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -103,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateCommunicationsType, -) -> CommunicationsTypeResponse | ErrorsList | None: +) -> Optional[Union[CommunicationsTypeResponse, ErrorsList]]: """Updates a communications type Updates a communications type @@ -117,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CommunicationsTypeResponse | ErrorsList + Union[CommunicationsTypeResponse, ErrorsList] """ return sync_detailed( @@ -132,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateCommunicationsType, -) -> Response[CommunicationsTypeResponse | ErrorsList]: +) -> Response[Union[CommunicationsTypeResponse, ErrorsList]]: """Updates a communications type Updates a communications type @@ -146,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CommunicationsTypeResponse | ErrorsList] + Response[Union[CommunicationsTypeResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -164,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateCommunicationsType, -) -> CommunicationsTypeResponse | ErrorsList | None: +) -> Optional[Union[CommunicationsTypeResponse, ErrorsList]]: """Updates a communications type Updates a communications type @@ -178,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CommunicationsTypeResponse | ErrorsList + Union[CommunicationsTypeResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/custom_forms/create_custom_form.py b/rootly_sdk/api/custom_forms/create_custom_form.py index 3ce9ad7d..317f41b4 100644 --- a/rootly_sdk/api/custom_forms/create_custom_form.py +++ b/rootly_sdk/api/custom_forms/create_custom_form.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> CustomFormResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[CustomFormResponse, ErrorsList]]: if response.status_code == 201: response_201 = CustomFormResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[CustomFormResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[CustomFormResponse, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +69,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewCustomForm, -) -> Response[CustomFormResponse | ErrorsList]: +) -> Response[Union[CustomFormResponse, ErrorsList]]: """Creates a custom form Creates a new custom form from provided data @@ -82,7 +82,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CustomFormResponse | ErrorsList] + Response[Union[CustomFormResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: NewCustomForm, -) -> CustomFormResponse | ErrorsList | None: +) -> Optional[Union[CustomFormResponse, ErrorsList]]: """Creates a custom form Creates a new custom form from provided data @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CustomFormResponse | ErrorsList + Union[CustomFormResponse, ErrorsList] """ return sync_detailed( @@ -126,7 +126,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewCustomForm, -) -> Response[CustomFormResponse | ErrorsList]: +) -> Response[Union[CustomFormResponse, ErrorsList]]: """Creates a custom form Creates a new custom form from provided data @@ -139,7 +139,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CustomFormResponse | ErrorsList] + Response[Union[CustomFormResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -155,7 +155,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewCustomForm, -) -> CustomFormResponse | ErrorsList | None: +) -> Optional[Union[CustomFormResponse, ErrorsList]]: """Creates a custom form Creates a new custom form from provided data @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CustomFormResponse | ErrorsList + Union[CustomFormResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/custom_forms/delete_custom_form.py b/rootly_sdk/api/custom_forms/delete_custom_form.py index 596f17a9..a707fa7c 100644 --- a/rootly_sdk/api/custom_forms/delete_custom_form.py +++ b/rootly_sdk/api/custom_forms/delete_custom_form.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union from uuid import UUID import httpx @@ -13,22 +12,19 @@ def _get_kwargs( - id: str | UUID, + id: Union[UUID, str], ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/custom_forms/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/custom_forms/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> CustomFormResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[CustomFormResponse, ErrorsList]]: if response.status_code == 200: response_200 = CustomFormResponse.from_dict(response.json()) @@ -46,8 +42,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[CustomFormResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[CustomFormResponse, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -57,23 +53,23 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Response[CustomFormResponse | ErrorsList]: +) -> Response[Union[CustomFormResponse, ErrorsList]]: """Delete a custom form Delete a specific custom form by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CustomFormResponse | ErrorsList] + Response[Union[CustomFormResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -88,23 +84,23 @@ def sync_detailed( def sync( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> CustomFormResponse | ErrorsList | None: +) -> Optional[Union[CustomFormResponse, ErrorsList]]: """Delete a custom form Delete a specific custom form by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CustomFormResponse | ErrorsList + Union[CustomFormResponse, ErrorsList] """ return sync_detailed( @@ -114,23 +110,23 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Response[CustomFormResponse | ErrorsList]: +) -> Response[Union[CustomFormResponse, ErrorsList]]: """Delete a custom form Delete a specific custom form by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CustomFormResponse | ErrorsList] + Response[Union[CustomFormResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -143,23 +139,23 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> CustomFormResponse | ErrorsList | None: +) -> Optional[Union[CustomFormResponse, ErrorsList]]: """Delete a custom form Delete a specific custom form by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CustomFormResponse | ErrorsList + Union[CustomFormResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/custom_forms/get_custom_form.py b/rootly_sdk/api/custom_forms/get_custom_form.py index bddf53a7..a9a6bd95 100644 --- a/rootly_sdk/api/custom_forms/get_custom_form.py +++ b/rootly_sdk/api/custom_forms/get_custom_form.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union from uuid import UUID import httpx @@ -13,22 +12,19 @@ def _get_kwargs( - id: str | UUID, + id: Union[UUID, str], ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/custom_forms/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/custom_forms/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> CustomFormResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[CustomFormResponse, ErrorsList]]: if response.status_code == 200: response_200 = CustomFormResponse.from_dict(response.json()) @@ -46,8 +42,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[CustomFormResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[CustomFormResponse, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -57,23 +53,23 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Response[CustomFormResponse | ErrorsList]: +) -> Response[Union[CustomFormResponse, ErrorsList]]: """Retrieves a custom form Retrieves a specific custom form by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CustomFormResponse | ErrorsList] + Response[Union[CustomFormResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -88,23 +84,23 @@ def sync_detailed( def sync( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> CustomFormResponse | ErrorsList | None: +) -> Optional[Union[CustomFormResponse, ErrorsList]]: """Retrieves a custom form Retrieves a specific custom form by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CustomFormResponse | ErrorsList + Union[CustomFormResponse, ErrorsList] """ return sync_detailed( @@ -114,23 +110,23 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Response[CustomFormResponse | ErrorsList]: +) -> Response[Union[CustomFormResponse, ErrorsList]]: """Retrieves a custom form Retrieves a specific custom form by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CustomFormResponse | ErrorsList] + Response[Union[CustomFormResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -143,23 +139,23 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> CustomFormResponse | ErrorsList | None: +) -> Optional[Union[CustomFormResponse, ErrorsList]]: """Retrieves a custom form Retrieves a specific custom form by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CustomFormResponse | ErrorsList + Union[CustomFormResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/custom_forms/list_custom_forms.py b/rootly_sdk/api/custom_forms/list_custom_forms.py index 0308a583..3c6aafc2 100644 --- a/rootly_sdk/api/custom_forms/list_custom_forms.py +++ b/rootly_sdk/api/custom_forms/list_custom_forms.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -12,19 +12,18 @@ def _get_kwargs( *, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtercommand: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtercommand: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["page[number]"] = pagenumber @@ -61,8 +60,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> CustomFormList | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[CustomFormList, ErrorsList]]: if response.status_code == 200: response_200 = CustomFormList.from_dict(response.json()) @@ -80,8 +79,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[CustomFormList | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[CustomFormList, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -93,41 +92,41 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtercommand: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, -) -> Response[CustomFormList | ErrorsList]: + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtercommand: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, +) -> Response[Union[CustomFormList, ErrorsList]]: """List custom forms List custom forms Args: - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterslug (str | Unset): - filtercommand (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - sort (str | Unset): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtercommand (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CustomFormList | ErrorsList] + Response[Union[CustomFormList, ErrorsList]] """ kwargs = _get_kwargs( @@ -154,41 +153,41 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtercommand: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, -) -> CustomFormList | ErrorsList | None: + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtercommand: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, +) -> Optional[Union[CustomFormList, ErrorsList]]: """List custom forms List custom forms Args: - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterslug (str | Unset): - filtercommand (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - sort (str | Unset): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtercommand (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CustomFormList | ErrorsList + Union[CustomFormList, ErrorsList] """ return sync_detailed( @@ -210,41 +209,41 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtercommand: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, -) -> Response[CustomFormList | ErrorsList]: + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtercommand: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, +) -> Response[Union[CustomFormList, ErrorsList]]: """List custom forms List custom forms Args: - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterslug (str | Unset): - filtercommand (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - sort (str | Unset): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtercommand (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CustomFormList | ErrorsList] + Response[Union[CustomFormList, ErrorsList]] """ kwargs = _get_kwargs( @@ -269,41 +268,41 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtercommand: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, -) -> CustomFormList | ErrorsList | None: + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtercommand: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, +) -> Optional[Union[CustomFormList, ErrorsList]]: """List custom forms List custom forms Args: - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterslug (str | Unset): - filtercommand (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - sort (str | Unset): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtercommand (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CustomFormList | ErrorsList + Union[CustomFormList, ErrorsList] """ return ( diff --git a/rootly_sdk/api/custom_forms/update_custom_form.py b/rootly_sdk/api/custom_forms/update_custom_form.py index 1b640d81..717b2052 100644 --- a/rootly_sdk/api/custom_forms/update_custom_form.py +++ b/rootly_sdk/api/custom_forms/update_custom_form.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union from uuid import UUID import httpx @@ -14,7 +13,7 @@ def _get_kwargs( - id: str | UUID, + id: Union[UUID, str], *, body: UpdateCustomForm, ) -> dict[str, Any]: @@ -22,9 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/custom_forms/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/custom_forms/{id}", } _kwargs["json"] = body.to_dict() @@ -36,8 +33,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> CustomFormResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[CustomFormResponse, ErrorsList]]: if response.status_code == 200: response_200 = CustomFormResponse.from_dict(response.json()) @@ -55,8 +52,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[CustomFormResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[CustomFormResponse, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,17 +63,17 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdateCustomForm, -) -> Response[CustomFormResponse | ErrorsList]: +) -> Response[Union[CustomFormResponse, ErrorsList]]: """Update a custom form Update a specific custom form by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateCustomForm): Raises: @@ -84,7 +81,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CustomFormResponse | ErrorsList] + Response[Union[CustomFormResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -100,17 +97,17 @@ def sync_detailed( def sync( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdateCustomForm, -) -> CustomFormResponse | ErrorsList | None: +) -> Optional[Union[CustomFormResponse, ErrorsList]]: """Update a custom form Update a specific custom form by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateCustomForm): Raises: @@ -118,7 +115,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CustomFormResponse | ErrorsList + Union[CustomFormResponse, ErrorsList] """ return sync_detailed( @@ -129,17 +126,17 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdateCustomForm, -) -> Response[CustomFormResponse | ErrorsList]: +) -> Response[Union[CustomFormResponse, ErrorsList]]: """Update a custom form Update a specific custom form by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateCustomForm): Raises: @@ -147,7 +144,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CustomFormResponse | ErrorsList] + Response[Union[CustomFormResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -161,17 +158,17 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdateCustomForm, -) -> CustomFormResponse | ErrorsList | None: +) -> Optional[Union[CustomFormResponse, ErrorsList]]: """Update a custom form Update a specific custom form by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateCustomForm): Raises: @@ -179,7 +176,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CustomFormResponse | ErrorsList + Union[CustomFormResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/dashboard_panels/create_dashboard_panel.py b/rootly_sdk/api/dashboard_panels/create_dashboard_panel.py index 89a6b704..ad486a8b 100644 --- a/rootly_sdk/api/dashboard_panels/create_dashboard_panel.py +++ b/rootly_sdk/api/dashboard_panels/create_dashboard_panel.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/dashboards/{dashboard_id}/panels".format( - dashboard_id=quote(str(dashboard_id), safe=""), - ), + "url": f"/v1/dashboards/{dashboard_id}/panels", } _kwargs["json"] = body.to_dict() @@ -35,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> DashboardPanelResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[DashboardPanelResponse, ErrorsList]]: if response.status_code == 201: response_201 = DashboardPanelResponse.from_dict(response.json()) @@ -54,8 +51,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[DashboardPanelResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[DashboardPanelResponse, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewDashboardPanel, -) -> Response[DashboardPanelResponse | ErrorsList]: +) -> Response[Union[DashboardPanelResponse, ErrorsList]]: """Creates a dashboard panel Creates a new dashboard panel from provided data @@ -83,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[DashboardPanelResponse | ErrorsList] + Response[Union[DashboardPanelResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -103,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: NewDashboardPanel, -) -> DashboardPanelResponse | ErrorsList | None: +) -> Optional[Union[DashboardPanelResponse, ErrorsList]]: """Creates a dashboard panel Creates a new dashboard panel from provided data @@ -117,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - DashboardPanelResponse | ErrorsList + Union[DashboardPanelResponse, ErrorsList] """ return sync_detailed( @@ -132,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewDashboardPanel, -) -> Response[DashboardPanelResponse | ErrorsList]: +) -> Response[Union[DashboardPanelResponse, ErrorsList]]: """Creates a dashboard panel Creates a new dashboard panel from provided data @@ -146,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[DashboardPanelResponse | ErrorsList] + Response[Union[DashboardPanelResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -164,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewDashboardPanel, -) -> DashboardPanelResponse | ErrorsList | None: +) -> Optional[Union[DashboardPanelResponse, ErrorsList]]: """Creates a dashboard panel Creates a new dashboard panel from provided data @@ -178,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - DashboardPanelResponse | ErrorsList + Union[DashboardPanelResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/dashboard_panels/delete_dashboard_panel.py b/rootly_sdk/api/dashboard_panels/delete_dashboard_panel.py index d630d717..4a41bc7e 100644 --- a/rootly_sdk/api/dashboard_panels/delete_dashboard_panel.py +++ b/rootly_sdk/api/dashboard_panels/delete_dashboard_panel.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -13,18 +12,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/dashboard_panels/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/dashboard_panels/{id}", } return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> DashboardPanelResponse | None: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[DashboardPanelResponse]: if response.status_code == 200: response_200 = DashboardPanelResponse.from_dict(response.json()) @@ -37,7 +35,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[DashboardPanelResponse]: return Response( status_code=HTTPStatus(response.status_code), @@ -82,7 +80,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> DashboardPanelResponse | None: +) -> Optional[DashboardPanelResponse]: """Delete a dashboard panel Delete a specific dashboard panel by id @@ -137,7 +135,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> DashboardPanelResponse | None: +) -> Optional[DashboardPanelResponse]: """Delete a dashboard panel Delete a specific dashboard panel by id diff --git a/rootly_sdk/api/dashboard_panels/duplicate_dashboard_panel.py b/rootly_sdk/api/dashboard_panels/duplicate_dashboard_panel.py index 825e1ab8..8b5448ec 100644 --- a/rootly_sdk/api/dashboard_panels/duplicate_dashboard_panel.py +++ b/rootly_sdk/api/dashboard_panels/duplicate_dashboard_panel.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/dashboard_panels/{id}/duplicate".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/dashboard_panels/{id}/duplicate", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> DashboardPanelResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[DashboardPanelResponse, ErrorsList]]: if response.status_code == 201: response_201 = DashboardPanelResponse.from_dict(response.json()) @@ -45,8 +41,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[DashboardPanelResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[DashboardPanelResponse, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[DashboardPanelResponse | ErrorsList]: +) -> Response[Union[DashboardPanelResponse, ErrorsList]]: """Duplicates a dashboard panel Duplicates a dashboard panel @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[DashboardPanelResponse | ErrorsList] + Response[Union[DashboardPanelResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -90,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> DashboardPanelResponse | ErrorsList | None: +) -> Optional[Union[DashboardPanelResponse, ErrorsList]]: """Duplicates a dashboard panel Duplicates a dashboard panel @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - DashboardPanelResponse | ErrorsList + Union[DashboardPanelResponse, ErrorsList] """ return sync_detailed( @@ -116,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[DashboardPanelResponse | ErrorsList]: +) -> Response[Union[DashboardPanelResponse, ErrorsList]]: """Duplicates a dashboard panel Duplicates a dashboard panel @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[DashboardPanelResponse | ErrorsList] + Response[Union[DashboardPanelResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -145,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> DashboardPanelResponse | ErrorsList | None: +) -> Optional[Union[DashboardPanelResponse, ErrorsList]]: """Duplicates a dashboard panel Duplicates a dashboard panel @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - DashboardPanelResponse | ErrorsList + Union[DashboardPanelResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/dashboard_panels/get_dashboard_panel.py b/rootly_sdk/api/dashboard_panels/get_dashboard_panel.py index 9bee49b7..534e3c58 100644 --- a/rootly_sdk/api/dashboard_panels/get_dashboard_panel.py +++ b/rootly_sdk/api/dashboard_panels/get_dashboard_panel.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -13,11 +12,10 @@ def _get_kwargs( id: str, *, - range_: str | Unset = UNSET, - period: str | Unset = UNSET, - time_zone: str | Unset = UNSET, + range_: Union[Unset, str] = UNSET, + period: Union[Unset, str] = UNSET, + time_zone: Union[Unset, str] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["range"] = range_ @@ -30,16 +28,16 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/dashboard_panels/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/dashboard_panels/{id}", "params": params, } return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> DashboardPanelResponse | None: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[DashboardPanelResponse]: if response.status_code == 200: response_200 = DashboardPanelResponse.from_dict(response.json()) @@ -52,7 +50,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[DashboardPanelResponse]: return Response( status_code=HTTPStatus(response.status_code), @@ -66,9 +64,9 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, - range_: str | Unset = UNSET, - period: str | Unset = UNSET, - time_zone: str | Unset = UNSET, + range_: Union[Unset, str] = UNSET, + period: Union[Unset, str] = UNSET, + time_zone: Union[Unset, str] = UNSET, ) -> Response[DashboardPanelResponse]: """Retrieves a dashboard panel @@ -76,9 +74,9 @@ def sync_detailed( Args: id (str): - range_ (str | Unset): - period (str | Unset): - time_zone (str | Unset): + range_ (Union[Unset, str]): + period (Union[Unset, str]): + time_zone (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -106,19 +104,19 @@ def sync( id: str, *, client: AuthenticatedClient, - range_: str | Unset = UNSET, - period: str | Unset = UNSET, - time_zone: str | Unset = UNSET, -) -> DashboardPanelResponse | None: + range_: Union[Unset, str] = UNSET, + period: Union[Unset, str] = UNSET, + time_zone: Union[Unset, str] = UNSET, +) -> Optional[DashboardPanelResponse]: """Retrieves a dashboard panel Retrieves a specific dashboard panel by id Args: id (str): - range_ (str | Unset): - period (str | Unset): - time_zone (str | Unset): + range_ (Union[Unset, str]): + period (Union[Unset, str]): + time_zone (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -141,9 +139,9 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, - range_: str | Unset = UNSET, - period: str | Unset = UNSET, - time_zone: str | Unset = UNSET, + range_: Union[Unset, str] = UNSET, + period: Union[Unset, str] = UNSET, + time_zone: Union[Unset, str] = UNSET, ) -> Response[DashboardPanelResponse]: """Retrieves a dashboard panel @@ -151,9 +149,9 @@ async def asyncio_detailed( Args: id (str): - range_ (str | Unset): - period (str | Unset): - time_zone (str | Unset): + range_ (Union[Unset, str]): + period (Union[Unset, str]): + time_zone (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -179,19 +177,19 @@ async def asyncio( id: str, *, client: AuthenticatedClient, - range_: str | Unset = UNSET, - period: str | Unset = UNSET, - time_zone: str | Unset = UNSET, -) -> DashboardPanelResponse | None: + range_: Union[Unset, str] = UNSET, + period: Union[Unset, str] = UNSET, + time_zone: Union[Unset, str] = UNSET, +) -> Optional[DashboardPanelResponse]: """Retrieves a dashboard panel Retrieves a specific dashboard panel by id Args: id (str): - range_ (str | Unset): - period (str | Unset): - time_zone (str | Unset): + range_ (Union[Unset, str]): + period (Union[Unset, str]): + time_zone (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/dashboard_panels/list_dashboard_panels.py b/rootly_sdk/api/dashboard_panels/list_dashboard_panels.py index d807646c..87bbc3d6 100644 --- a/rootly_sdk/api/dashboard_panels/list_dashboard_panels.py +++ b/rootly_sdk/api/dashboard_panels/list_dashboard_panels.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -13,11 +12,10 @@ def _get_kwargs( dashboard_id: str, *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -30,16 +28,16 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/dashboards/{dashboard_id}/panels".format( - dashboard_id=quote(str(dashboard_id), safe=""), - ), + "url": f"/v1/dashboards/{dashboard_id}/panels", "params": params, } return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> DashboardPanelList | None: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[DashboardPanelList]: if response.status_code == 200: response_200 = DashboardPanelList.from_dict(response.json()) @@ -51,7 +49,9 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[DashboardPanelList]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[DashboardPanelList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -64,9 +64,9 @@ def sync_detailed( dashboard_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, ) -> Response[DashboardPanelList]: """List dashboard panels @@ -74,9 +74,9 @@ def sync_detailed( Args: dashboard_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -104,19 +104,19 @@ def sync( dashboard_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, -) -> DashboardPanelList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, +) -> Optional[DashboardPanelList]: """List dashboard panels List dashboard panels Args: dashboard_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -139,9 +139,9 @@ async def asyncio_detailed( dashboard_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, ) -> Response[DashboardPanelList]: """List dashboard panels @@ -149,9 +149,9 @@ async def asyncio_detailed( Args: dashboard_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -177,19 +177,19 @@ async def asyncio( dashboard_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, -) -> DashboardPanelList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, +) -> Optional[DashboardPanelList]: """List dashboard panels List dashboard panels Args: dashboard_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/dashboard_panels/update_dashboard_panel.py b/rootly_sdk/api/dashboard_panels/update_dashboard_panel.py index 8c15920b..e5aa46ee 100644 --- a/rootly_sdk/api/dashboard_panels/update_dashboard_panel.py +++ b/rootly_sdk/api/dashboard_panels/update_dashboard_panel.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -20,9 +19,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/dashboard_panels/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/dashboard_panels/{id}", } _kwargs["json"] = body.to_dict() @@ -33,7 +30,9 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> DashboardPanelResponse | None: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[DashboardPanelResponse]: if response.status_code == 200: response_200 = DashboardPanelResponse.from_dict(response.json()) @@ -46,7 +45,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[DashboardPanelResponse]: return Response( status_code=HTTPStatus(response.status_code), @@ -95,7 +94,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateDashboardPanel, -) -> DashboardPanelResponse | None: +) -> Optional[DashboardPanelResponse]: """Update a dashboard panel Update a specific dashboard panel by id @@ -156,7 +155,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateDashboardPanel, -) -> DashboardPanelResponse | None: +) -> Optional[DashboardPanelResponse]: """Update a dashboard panel Update a specific dashboard panel by id diff --git a/rootly_sdk/api/dashboards/create_dashboard.py b/rootly_sdk/api/dashboards/create_dashboard.py index 32bb4589..4680a26d 100644 --- a/rootly_sdk/api/dashboards/create_dashboard.py +++ b/rootly_sdk/api/dashboards/create_dashboard.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> DashboardResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[DashboardResponse, ErrorsList]]: if response.status_code == 201: response_201 = DashboardResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[DashboardResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[DashboardResponse, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +69,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewDashboard, -) -> Response[DashboardResponse | ErrorsList]: +) -> Response[Union[DashboardResponse, ErrorsList]]: """Creates a dashboard Creates a new dashboard from provided data @@ -82,7 +82,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[DashboardResponse | ErrorsList] + Response[Union[DashboardResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: NewDashboard, -) -> DashboardResponse | ErrorsList | None: +) -> Optional[Union[DashboardResponse, ErrorsList]]: """Creates a dashboard Creates a new dashboard from provided data @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - DashboardResponse | ErrorsList + Union[DashboardResponse, ErrorsList] """ return sync_detailed( @@ -126,7 +126,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewDashboard, -) -> Response[DashboardResponse | ErrorsList]: +) -> Response[Union[DashboardResponse, ErrorsList]]: """Creates a dashboard Creates a new dashboard from provided data @@ -139,7 +139,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[DashboardResponse | ErrorsList] + Response[Union[DashboardResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -155,7 +155,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewDashboard, -) -> DashboardResponse | ErrorsList | None: +) -> Optional[Union[DashboardResponse, ErrorsList]]: """Creates a dashboard Creates a new dashboard from provided data @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - DashboardResponse | ErrorsList + Union[DashboardResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/dashboards/delete_dashboard.py b/rootly_sdk/api/dashboards/delete_dashboard.py index e16a82d5..04100988 100644 --- a/rootly_sdk/api/dashboards/delete_dashboard.py +++ b/rootly_sdk/api/dashboards/delete_dashboard.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union from uuid import UUID import httpx @@ -13,22 +12,19 @@ def _get_kwargs( - id: str | UUID, + id: Union[UUID, str], ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/dashboards/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/dashboards/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> DashboardResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[DashboardResponse, ErrorsList]]: if response.status_code == 200: response_200 = DashboardResponse.from_dict(response.json()) @@ -46,8 +42,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[DashboardResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[DashboardResponse, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -57,23 +53,23 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Response[DashboardResponse | ErrorsList]: +) -> Response[Union[DashboardResponse, ErrorsList]]: """Delete a dashboard Delete a specific dashboard by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[DashboardResponse | ErrorsList] + Response[Union[DashboardResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -88,23 +84,23 @@ def sync_detailed( def sync( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> DashboardResponse | ErrorsList | None: +) -> Optional[Union[DashboardResponse, ErrorsList]]: """Delete a dashboard Delete a specific dashboard by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - DashboardResponse | ErrorsList + Union[DashboardResponse, ErrorsList] """ return sync_detailed( @@ -114,23 +110,23 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Response[DashboardResponse | ErrorsList]: +) -> Response[Union[DashboardResponse, ErrorsList]]: """Delete a dashboard Delete a specific dashboard by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[DashboardResponse | ErrorsList] + Response[Union[DashboardResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -143,23 +139,23 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> DashboardResponse | ErrorsList | None: +) -> Optional[Union[DashboardResponse, ErrorsList]]: """Delete a dashboard Delete a specific dashboard by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - DashboardResponse | ErrorsList + Union[DashboardResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/dashboards/duplicate_dashboard.py b/rootly_sdk/api/dashboards/duplicate_dashboard.py index 2c874a17..0840cbae 100644 --- a/rootly_sdk/api/dashboards/duplicate_dashboard.py +++ b/rootly_sdk/api/dashboards/duplicate_dashboard.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union from uuid import UUID import httpx @@ -13,22 +12,19 @@ def _get_kwargs( - id: str | UUID, + id: Union[UUID, str], ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/dashboards/{id}/duplicate".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/dashboards/{id}/duplicate", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> DashboardResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[DashboardResponse, ErrorsList]]: if response.status_code == 201: response_201 = DashboardResponse.from_dict(response.json()) @@ -46,8 +42,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[DashboardResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[DashboardResponse, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -57,23 +53,23 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Response[DashboardResponse | ErrorsList]: +) -> Response[Union[DashboardResponse, ErrorsList]]: """Duplicates a dashboard Duplicates a dashboard Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[DashboardResponse | ErrorsList] + Response[Union[DashboardResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -88,23 +84,23 @@ def sync_detailed( def sync( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> DashboardResponse | ErrorsList | None: +) -> Optional[Union[DashboardResponse, ErrorsList]]: """Duplicates a dashboard Duplicates a dashboard Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - DashboardResponse | ErrorsList + Union[DashboardResponse, ErrorsList] """ return sync_detailed( @@ -114,23 +110,23 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Response[DashboardResponse | ErrorsList]: +) -> Response[Union[DashboardResponse, ErrorsList]]: """Duplicates a dashboard Duplicates a dashboard Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[DashboardResponse | ErrorsList] + Response[Union[DashboardResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -143,23 +139,23 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> DashboardResponse | ErrorsList | None: +) -> Optional[Union[DashboardResponse, ErrorsList]]: """Duplicates a dashboard Duplicates a dashboard Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - DashboardResponse | ErrorsList + Union[DashboardResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/dashboards/get_dashboard.py b/rootly_sdk/api/dashboards/get_dashboard.py index f20260b3..d282f5d7 100644 --- a/rootly_sdk/api/dashboards/get_dashboard.py +++ b/rootly_sdk/api/dashboards/get_dashboard.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union from uuid import UUID import httpx @@ -14,14 +13,13 @@ def _get_kwargs( - id: str | UUID, + id: Union[UUID, str], *, - include: GetDashboardInclude | Unset = UNSET, + include: Union[Unset, GetDashboardInclude] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} - json_include: str | Unset = UNSET + json_include: Union[Unset, str] = UNSET if not isinstance(include, Unset): json_include = include @@ -31,9 +29,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/dashboards/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/dashboards/{id}", "params": params, } @@ -41,8 +37,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> DashboardResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[DashboardResponse, ErrorsList]]: if response.status_code == 200: response_200 = DashboardResponse.from_dict(response.json()) @@ -60,8 +56,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[DashboardResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[DashboardResponse, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -71,25 +67,25 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, - include: GetDashboardInclude | Unset = UNSET, -) -> Response[DashboardResponse | ErrorsList]: + include: Union[Unset, GetDashboardInclude] = UNSET, +) -> Response[Union[DashboardResponse, ErrorsList]]: """Retrieves a dashboard Retrieves a specific dashboard by id Args: - id (str | UUID): - include (GetDashboardInclude | Unset): + id (Union[UUID, str]): + include (Union[Unset, GetDashboardInclude]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[DashboardResponse | ErrorsList] + Response[Union[DashboardResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -105,25 +101,25 @@ def sync_detailed( def sync( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, - include: GetDashboardInclude | Unset = UNSET, -) -> DashboardResponse | ErrorsList | None: + include: Union[Unset, GetDashboardInclude] = UNSET, +) -> Optional[Union[DashboardResponse, ErrorsList]]: """Retrieves a dashboard Retrieves a specific dashboard by id Args: - id (str | UUID): - include (GetDashboardInclude | Unset): + id (Union[UUID, str]): + include (Union[Unset, GetDashboardInclude]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - DashboardResponse | ErrorsList + Union[DashboardResponse, ErrorsList] """ return sync_detailed( @@ -134,25 +130,25 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, - include: GetDashboardInclude | Unset = UNSET, -) -> Response[DashboardResponse | ErrorsList]: + include: Union[Unset, GetDashboardInclude] = UNSET, +) -> Response[Union[DashboardResponse, ErrorsList]]: """Retrieves a dashboard Retrieves a specific dashboard by id Args: - id (str | UUID): - include (GetDashboardInclude | Unset): + id (Union[UUID, str]): + include (Union[Unset, GetDashboardInclude]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[DashboardResponse | ErrorsList] + Response[Union[DashboardResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -166,25 +162,25 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, - include: GetDashboardInclude | Unset = UNSET, -) -> DashboardResponse | ErrorsList | None: + include: Union[Unset, GetDashboardInclude] = UNSET, +) -> Optional[Union[DashboardResponse, ErrorsList]]: """Retrieves a dashboard Retrieves a specific dashboard by id Args: - id (str | UUID): - include (GetDashboardInclude | Unset): + id (Union[UUID, str]): + include (Union[Unset, GetDashboardInclude]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - DashboardResponse | ErrorsList + Union[DashboardResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/dashboards/list_dashboards.py b/rootly_sdk/api/dashboards/list_dashboards.py index c0c41cd8..db9bcb29 100644 --- a/rootly_sdk/api/dashboards/list_dashboards.py +++ b/rootly_sdk/api/dashboards/list_dashboards.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -12,14 +12,13 @@ def _get_kwargs( *, - include: ListDashboardsInclude | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Union[Unset, ListDashboardsInclude] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} - json_include: str | Unset = UNSET + json_include: Union[Unset, str] = UNSET if not isinstance(include, Unset): json_include = include @@ -40,7 +39,7 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> DashboardList | None: +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[DashboardList]: if response.status_code == 200: response_200 = DashboardList.from_dict(response.json()) @@ -52,7 +51,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[DashboardList]: +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[DashboardList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -64,18 +63,18 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - include: ListDashboardsInclude | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Union[Unset, ListDashboardsInclude] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, ) -> Response[DashboardList]: """List dashboards List dashboards Args: - include (ListDashboardsInclude | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, ListDashboardsInclude]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -101,18 +100,18 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: ListDashboardsInclude | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, -) -> DashboardList | None: + include: Union[Unset, ListDashboardsInclude] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, +) -> Optional[DashboardList]: """List dashboards List dashboards Args: - include (ListDashboardsInclude | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, ListDashboardsInclude]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -133,18 +132,18 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: ListDashboardsInclude | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Union[Unset, ListDashboardsInclude] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, ) -> Response[DashboardList]: """List dashboards List dashboards Args: - include (ListDashboardsInclude | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, ListDashboardsInclude]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -168,18 +167,18 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: ListDashboardsInclude | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, -) -> DashboardList | None: + include: Union[Unset, ListDashboardsInclude] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, +) -> Optional[DashboardList]: """List dashboards List dashboards Args: - include (ListDashboardsInclude | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, ListDashboardsInclude]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/dashboards/set_default_dashboard.py b/rootly_sdk/api/dashboards/set_default_dashboard.py index 7cf3246d..31841b9e 100644 --- a/rootly_sdk/api/dashboards/set_default_dashboard.py +++ b/rootly_sdk/api/dashboards/set_default_dashboard.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union from uuid import UUID import httpx @@ -13,22 +12,19 @@ def _get_kwargs( - id: str | UUID, + id: Union[UUID, str], ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/dashboards/{id}/set_default".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/dashboards/{id}/set_default", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> DashboardResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[DashboardResponse, ErrorsList]]: if response.status_code == 200: response_200 = DashboardResponse.from_dict(response.json()) @@ -46,8 +42,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[DashboardResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[DashboardResponse, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -57,23 +53,23 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Response[DashboardResponse | ErrorsList]: +) -> Response[Union[DashboardResponse, ErrorsList]]: """Sets dashboard to user default Sets dashboard to user default Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[DashboardResponse | ErrorsList] + Response[Union[DashboardResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -88,23 +84,23 @@ def sync_detailed( def sync( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> DashboardResponse | ErrorsList | None: +) -> Optional[Union[DashboardResponse, ErrorsList]]: """Sets dashboard to user default Sets dashboard to user default Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - DashboardResponse | ErrorsList + Union[DashboardResponse, ErrorsList] """ return sync_detailed( @@ -114,23 +110,23 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Response[DashboardResponse | ErrorsList]: +) -> Response[Union[DashboardResponse, ErrorsList]]: """Sets dashboard to user default Sets dashboard to user default Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[DashboardResponse | ErrorsList] + Response[Union[DashboardResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -143,23 +139,23 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> DashboardResponse | ErrorsList | None: +) -> Optional[Union[DashboardResponse, ErrorsList]]: """Sets dashboard to user default Sets dashboard to user default Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - DashboardResponse | ErrorsList + Union[DashboardResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/dashboards/update_dashboard.py b/rootly_sdk/api/dashboards/update_dashboard.py index 56ac6566..1ea219f3 100644 --- a/rootly_sdk/api/dashboards/update_dashboard.py +++ b/rootly_sdk/api/dashboards/update_dashboard.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union from uuid import UUID import httpx @@ -14,7 +13,7 @@ def _get_kwargs( - id: str | UUID, + id: Union[UUID, str], *, body: UpdateDashboard, ) -> dict[str, Any]: @@ -22,9 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/dashboards/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/dashboards/{id}", } _kwargs["json"] = body.to_dict() @@ -36,8 +33,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> DashboardResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[DashboardResponse, ErrorsList]]: if response.status_code == 200: response_200 = DashboardResponse.from_dict(response.json()) @@ -55,8 +52,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[DashboardResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[DashboardResponse, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,17 +63,17 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdateDashboard, -) -> Response[DashboardResponse | ErrorsList]: +) -> Response[Union[DashboardResponse, ErrorsList]]: """Update a dashboard Update a specific dashboard by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateDashboard): Raises: @@ -84,7 +81,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[DashboardResponse | ErrorsList] + Response[Union[DashboardResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -100,17 +97,17 @@ def sync_detailed( def sync( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdateDashboard, -) -> DashboardResponse | ErrorsList | None: +) -> Optional[Union[DashboardResponse, ErrorsList]]: """Update a dashboard Update a specific dashboard by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateDashboard): Raises: @@ -118,7 +115,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - DashboardResponse | ErrorsList + Union[DashboardResponse, ErrorsList] """ return sync_detailed( @@ -129,17 +126,17 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdateDashboard, -) -> Response[DashboardResponse | ErrorsList]: +) -> Response[Union[DashboardResponse, ErrorsList]]: """Update a dashboard Update a specific dashboard by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateDashboard): Raises: @@ -147,7 +144,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[DashboardResponse | ErrorsList] + Response[Union[DashboardResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -161,17 +158,17 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdateDashboard, -) -> DashboardResponse | ErrorsList | None: +) -> Optional[Union[DashboardResponse, ErrorsList]]: """Update a dashboard Update a specific dashboard by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateDashboard): Raises: @@ -179,7 +176,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - DashboardResponse | ErrorsList + Union[DashboardResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/deprecated_custom_field_options/create_custom_field_option.py b/rootly_sdk/api/deprecated_custom_field_options/create_custom_field_option.py index 65314afc..d3ed1d1d 100644 --- a/rootly_sdk/api/deprecated_custom_field_options/create_custom_field_option.py +++ b/rootly_sdk/api/deprecated_custom_field_options/create_custom_field_option.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/custom_fields/{custom_field_id}/options".format( - custom_field_id=quote(str(custom_field_id), safe=""), - ), + "url": f"/v1/custom_fields/{custom_field_id}/options", } _kwargs["json"] = body.to_dict() @@ -35,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> CustomFieldOptionResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[CustomFieldOptionResponse, ErrorsList]]: if response.status_code == 201: response_201 = CustomFieldOptionResponse.from_dict(response.json()) @@ -59,8 +56,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[CustomFieldOptionResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[CustomFieldOptionResponse, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -74,7 +71,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewCustomFieldOption, -) -> Response[CustomFieldOptionResponse | ErrorsList]: +) -> Response[Union[CustomFieldOptionResponse, ErrorsList]]: """[DEPRECATED] Creates a custom field option [DEPRECATED] Use form field endpoints instead. Creates a new custom field option from provided data @@ -88,7 +85,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CustomFieldOptionResponse | ErrorsList] + Response[Union[CustomFieldOptionResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -108,7 +105,7 @@ def sync( *, client: AuthenticatedClient, body: NewCustomFieldOption, -) -> CustomFieldOptionResponse | ErrorsList | None: +) -> Optional[Union[CustomFieldOptionResponse, ErrorsList]]: """[DEPRECATED] Creates a custom field option [DEPRECATED] Use form field endpoints instead. Creates a new custom field option from provided data @@ -122,7 +119,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CustomFieldOptionResponse | ErrorsList + Union[CustomFieldOptionResponse, ErrorsList] """ return sync_detailed( @@ -137,7 +134,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewCustomFieldOption, -) -> Response[CustomFieldOptionResponse | ErrorsList]: +) -> Response[Union[CustomFieldOptionResponse, ErrorsList]]: """[DEPRECATED] Creates a custom field option [DEPRECATED] Use form field endpoints instead. Creates a new custom field option from provided data @@ -151,7 +148,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CustomFieldOptionResponse | ErrorsList] + Response[Union[CustomFieldOptionResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -169,7 +166,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewCustomFieldOption, -) -> CustomFieldOptionResponse | ErrorsList | None: +) -> Optional[Union[CustomFieldOptionResponse, ErrorsList]]: """[DEPRECATED] Creates a custom field option [DEPRECATED] Use form field endpoints instead. Creates a new custom field option from provided data @@ -183,7 +180,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CustomFieldOptionResponse | ErrorsList + Union[CustomFieldOptionResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/deprecated_custom_field_options/delete_custom_field_option.py b/rootly_sdk/api/deprecated_custom_field_options/delete_custom_field_option.py index 3968cd4d..c235a7a1 100644 --- a/rootly_sdk/api/deprecated_custom_field_options/delete_custom_field_option.py +++ b/rootly_sdk/api/deprecated_custom_field_options/delete_custom_field_option.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/custom_field_options/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/custom_field_options/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> CustomFieldOptionResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[CustomFieldOptionResponse, ErrorsList]]: if response.status_code == 200: response_200 = CustomFieldOptionResponse.from_dict(response.json()) @@ -45,8 +41,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[CustomFieldOptionResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[CustomFieldOptionResponse, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[CustomFieldOptionResponse | ErrorsList]: +) -> Response[Union[CustomFieldOptionResponse, ErrorsList]]: """[DEPRECATED] Delete a custom field option [DEPRECATED] Use form field endpoints instead. Delete a specific Custom Field Option by id @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CustomFieldOptionResponse | ErrorsList] + Response[Union[CustomFieldOptionResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -90,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> CustomFieldOptionResponse | ErrorsList | None: +) -> Optional[Union[CustomFieldOptionResponse, ErrorsList]]: """[DEPRECATED] Delete a custom field option [DEPRECATED] Use form field endpoints instead. Delete a specific Custom Field Option by id @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CustomFieldOptionResponse | ErrorsList + Union[CustomFieldOptionResponse, ErrorsList] """ return sync_detailed( @@ -116,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[CustomFieldOptionResponse | ErrorsList]: +) -> Response[Union[CustomFieldOptionResponse, ErrorsList]]: """[DEPRECATED] Delete a custom field option [DEPRECATED] Use form field endpoints instead. Delete a specific Custom Field Option by id @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CustomFieldOptionResponse | ErrorsList] + Response[Union[CustomFieldOptionResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -145,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> CustomFieldOptionResponse | ErrorsList | None: +) -> Optional[Union[CustomFieldOptionResponse, ErrorsList]]: """[DEPRECATED] Delete a custom field option [DEPRECATED] Use form field endpoints instead. Delete a specific Custom Field Option by id @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CustomFieldOptionResponse | ErrorsList + Union[CustomFieldOptionResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/deprecated_custom_field_options/get_custom_field_option.py b/rootly_sdk/api/deprecated_custom_field_options/get_custom_field_option.py index afdda05c..62f5f606 100644 --- a/rootly_sdk/api/deprecated_custom_field_options/get_custom_field_option.py +++ b/rootly_sdk/api/deprecated_custom_field_options/get_custom_field_option.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/custom_field_options/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/custom_field_options/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> CustomFieldOptionResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[CustomFieldOptionResponse, ErrorsList]]: if response.status_code == 200: response_200 = CustomFieldOptionResponse.from_dict(response.json()) @@ -45,8 +41,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[CustomFieldOptionResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[CustomFieldOptionResponse, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[CustomFieldOptionResponse | ErrorsList]: +) -> Response[Union[CustomFieldOptionResponse, ErrorsList]]: """[DEPRECATED] Retrieves a custom field option [DEPRECATED] Use form field endpoints instead. Retrieves a specific custom field option by id @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CustomFieldOptionResponse | ErrorsList] + Response[Union[CustomFieldOptionResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -90,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> CustomFieldOptionResponse | ErrorsList | None: +) -> Optional[Union[CustomFieldOptionResponse, ErrorsList]]: """[DEPRECATED] Retrieves a custom field option [DEPRECATED] Use form field endpoints instead. Retrieves a specific custom field option by id @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CustomFieldOptionResponse | ErrorsList + Union[CustomFieldOptionResponse, ErrorsList] """ return sync_detailed( @@ -116,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[CustomFieldOptionResponse | ErrorsList]: +) -> Response[Union[CustomFieldOptionResponse, ErrorsList]]: """[DEPRECATED] Retrieves a custom field option [DEPRECATED] Use form field endpoints instead. Retrieves a specific custom field option by id @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CustomFieldOptionResponse | ErrorsList] + Response[Union[CustomFieldOptionResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -145,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> CustomFieldOptionResponse | ErrorsList | None: +) -> Optional[Union[CustomFieldOptionResponse, ErrorsList]]: """[DEPRECATED] Retrieves a custom field option [DEPRECATED] Use form field endpoints instead. Retrieves a specific custom field option by id @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CustomFieldOptionResponse | ErrorsList + Union[CustomFieldOptionResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/deprecated_custom_field_options/list_custom_field_options.py b/rootly_sdk/api/deprecated_custom_field_options/list_custom_field_options.py index bca688b3..54959f33 100644 --- a/rootly_sdk/api/deprecated_custom_field_options/list_custom_field_options.py +++ b/rootly_sdk/api/deprecated_custom_field_options/list_custom_field_options.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -13,13 +12,12 @@ def _get_kwargs( custom_field_id: str, *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtervalue: str | Unset = UNSET, - filtercolor: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtervalue: Union[Unset, str] = UNSET, + filtercolor: Union[Unset, str] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -36,16 +34,16 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/custom_fields/{custom_field_id}/options".format( - custom_field_id=quote(str(custom_field_id), safe=""), - ), + "url": f"/v1/custom_fields/{custom_field_id}/options", "params": params, } return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> CustomFieldOptionList | None: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[CustomFieldOptionList]: if response.status_code == 200: response_200 = CustomFieldOptionList.from_dict(response.json()) @@ -58,7 +56,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[CustomFieldOptionList]: return Response( status_code=HTTPStatus(response.status_code), @@ -72,11 +70,11 @@ def sync_detailed( custom_field_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtervalue: str | Unset = UNSET, - filtercolor: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtervalue: Union[Unset, str] = UNSET, + filtercolor: Union[Unset, str] = UNSET, ) -> Response[CustomFieldOptionList]: """[DEPRECATED] List custom field options @@ -84,11 +82,11 @@ def sync_detailed( Args: custom_field_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtervalue (str | Unset): - filtercolor (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtervalue (Union[Unset, str]): + filtercolor (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -118,23 +116,23 @@ def sync( custom_field_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtervalue: str | Unset = UNSET, - filtercolor: str | Unset = UNSET, -) -> CustomFieldOptionList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtervalue: Union[Unset, str] = UNSET, + filtercolor: Union[Unset, str] = UNSET, +) -> Optional[CustomFieldOptionList]: """[DEPRECATED] List custom field options [DEPRECATED] Use form field endpoints instead. List custom field options Args: custom_field_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtervalue (str | Unset): - filtercolor (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtervalue (Union[Unset, str]): + filtercolor (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -159,11 +157,11 @@ async def asyncio_detailed( custom_field_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtervalue: str | Unset = UNSET, - filtercolor: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtervalue: Union[Unset, str] = UNSET, + filtercolor: Union[Unset, str] = UNSET, ) -> Response[CustomFieldOptionList]: """[DEPRECATED] List custom field options @@ -171,11 +169,11 @@ async def asyncio_detailed( Args: custom_field_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtervalue (str | Unset): - filtercolor (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtervalue (Union[Unset, str]): + filtercolor (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -203,23 +201,23 @@ async def asyncio( custom_field_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtervalue: str | Unset = UNSET, - filtercolor: str | Unset = UNSET, -) -> CustomFieldOptionList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtervalue: Union[Unset, str] = UNSET, + filtercolor: Union[Unset, str] = UNSET, +) -> Optional[CustomFieldOptionList]: """[DEPRECATED] List custom field options [DEPRECATED] Use form field endpoints instead. List custom field options Args: custom_field_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtervalue (str | Unset): - filtercolor (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtervalue (Union[Unset, str]): + filtercolor (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/deprecated_custom_field_options/update_custom_field_option.py b/rootly_sdk/api/deprecated_custom_field_options/update_custom_field_option.py index 394362f8..80432df7 100644 --- a/rootly_sdk/api/deprecated_custom_field_options/update_custom_field_option.py +++ b/rootly_sdk/api/deprecated_custom_field_options/update_custom_field_option.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/custom_field_options/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/custom_field_options/{id}", } _kwargs["json"] = body.to_dict() @@ -35,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> CustomFieldOptionResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[CustomFieldOptionResponse, ErrorsList]]: if response.status_code == 200: response_200 = CustomFieldOptionResponse.from_dict(response.json()) @@ -54,8 +51,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[CustomFieldOptionResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[CustomFieldOptionResponse, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateCustomFieldOption, -) -> Response[CustomFieldOptionResponse | ErrorsList]: +) -> Response[Union[CustomFieldOptionResponse, ErrorsList]]: """[DEPRECATED] Update a custom field option [DEPRECATED] Use form field endpoints instead. Update a specific custom field option by id @@ -83,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CustomFieldOptionResponse | ErrorsList] + Response[Union[CustomFieldOptionResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -103,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateCustomFieldOption, -) -> CustomFieldOptionResponse | ErrorsList | None: +) -> Optional[Union[CustomFieldOptionResponse, ErrorsList]]: """[DEPRECATED] Update a custom field option [DEPRECATED] Use form field endpoints instead. Update a specific custom field option by id @@ -117,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CustomFieldOptionResponse | ErrorsList + Union[CustomFieldOptionResponse, ErrorsList] """ return sync_detailed( @@ -132,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateCustomFieldOption, -) -> Response[CustomFieldOptionResponse | ErrorsList]: +) -> Response[Union[CustomFieldOptionResponse, ErrorsList]]: """[DEPRECATED] Update a custom field option [DEPRECATED] Use form field endpoints instead. Update a specific custom field option by id @@ -146,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CustomFieldOptionResponse | ErrorsList] + Response[Union[CustomFieldOptionResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -164,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateCustomFieldOption, -) -> CustomFieldOptionResponse | ErrorsList | None: +) -> Optional[Union[CustomFieldOptionResponse, ErrorsList]]: """[DEPRECATED] Update a custom field option [DEPRECATED] Use form field endpoints instead. Update a specific custom field option by id @@ -178,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CustomFieldOptionResponse | ErrorsList + Union[CustomFieldOptionResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/deprecated_custom_fields/create_custom_field.py b/rootly_sdk/api/deprecated_custom_fields/create_custom_field.py index d4ca5660..90daacb1 100644 --- a/rootly_sdk/api/deprecated_custom_fields/create_custom_field.py +++ b/rootly_sdk/api/deprecated_custom_fields/create_custom_field.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> CustomFieldResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[CustomFieldResponse, ErrorsList]]: if response.status_code == 201: response_201 = CustomFieldResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[CustomFieldResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[CustomFieldResponse, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +69,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewCustomField, -) -> Response[CustomFieldResponse | ErrorsList]: +) -> Response[Union[CustomFieldResponse, ErrorsList]]: """[DEPRECATED] Creates a Custom Field [DEPRECATED] Use form field endpoints instead. Creates a new custom field from provided data @@ -82,7 +82,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CustomFieldResponse | ErrorsList] + Response[Union[CustomFieldResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: NewCustomField, -) -> CustomFieldResponse | ErrorsList | None: +) -> Optional[Union[CustomFieldResponse, ErrorsList]]: """[DEPRECATED] Creates a Custom Field [DEPRECATED] Use form field endpoints instead. Creates a new custom field from provided data @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CustomFieldResponse | ErrorsList + Union[CustomFieldResponse, ErrorsList] """ return sync_detailed( @@ -126,7 +126,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewCustomField, -) -> Response[CustomFieldResponse | ErrorsList]: +) -> Response[Union[CustomFieldResponse, ErrorsList]]: """[DEPRECATED] Creates a Custom Field [DEPRECATED] Use form field endpoints instead. Creates a new custom field from provided data @@ -139,7 +139,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CustomFieldResponse | ErrorsList] + Response[Union[CustomFieldResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -155,7 +155,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewCustomField, -) -> CustomFieldResponse | ErrorsList | None: +) -> Optional[Union[CustomFieldResponse, ErrorsList]]: """[DEPRECATED] Creates a Custom Field [DEPRECATED] Use form field endpoints instead. Creates a new custom field from provided data @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CustomFieldResponse | ErrorsList + Union[CustomFieldResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/deprecated_custom_fields/delete_custom_field.py b/rootly_sdk/api/deprecated_custom_fields/delete_custom_field.py index 9fa62894..c472b2c7 100644 --- a/rootly_sdk/api/deprecated_custom_fields/delete_custom_field.py +++ b/rootly_sdk/api/deprecated_custom_fields/delete_custom_field.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/custom_fields/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/custom_fields/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> CustomFieldResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[CustomFieldResponse, ErrorsList]]: if response.status_code == 200: response_200 = CustomFieldResponse.from_dict(response.json()) @@ -45,8 +41,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[CustomFieldResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[CustomFieldResponse, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[CustomFieldResponse | ErrorsList]: +) -> Response[Union[CustomFieldResponse, ErrorsList]]: """[DEPRECATED] Delete a Custom Field [DEPRECATED] Use form field endpoints instead. Delete a specific custom field by id @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CustomFieldResponse | ErrorsList] + Response[Union[CustomFieldResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -90,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> CustomFieldResponse | ErrorsList | None: +) -> Optional[Union[CustomFieldResponse, ErrorsList]]: """[DEPRECATED] Delete a Custom Field [DEPRECATED] Use form field endpoints instead. Delete a specific custom field by id @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CustomFieldResponse | ErrorsList + Union[CustomFieldResponse, ErrorsList] """ return sync_detailed( @@ -116,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[CustomFieldResponse | ErrorsList]: +) -> Response[Union[CustomFieldResponse, ErrorsList]]: """[DEPRECATED] Delete a Custom Field [DEPRECATED] Use form field endpoints instead. Delete a specific custom field by id @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CustomFieldResponse | ErrorsList] + Response[Union[CustomFieldResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -145,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> CustomFieldResponse | ErrorsList | None: +) -> Optional[Union[CustomFieldResponse, ErrorsList]]: """[DEPRECATED] Delete a Custom Field [DEPRECATED] Use form field endpoints instead. Delete a specific custom field by id @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CustomFieldResponse | ErrorsList + Union[CustomFieldResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/deprecated_custom_fields/get_custom_field.py b/rootly_sdk/api/deprecated_custom_fields/get_custom_field.py index 3ee224fc..4d7309ce 100644 --- a/rootly_sdk/api/deprecated_custom_fields/get_custom_field.py +++ b/rootly_sdk/api/deprecated_custom_fields/get_custom_field.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -15,12 +14,11 @@ def _get_kwargs( id: str, *, - include: GetCustomFieldInclude | Unset = UNSET, + include: Union[Unset, GetCustomFieldInclude] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} - json_include: str | Unset = UNSET + json_include: Union[Unset, str] = UNSET if not isinstance(include, Unset): json_include = include @@ -30,9 +28,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/custom_fields/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/custom_fields/{id}", "params": params, } @@ -40,8 +36,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> CustomFieldResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[CustomFieldResponse, ErrorsList]]: if response.status_code == 200: response_200 = CustomFieldResponse.from_dict(response.json()) @@ -59,8 +55,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[CustomFieldResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[CustomFieldResponse, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -73,22 +69,22 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, - include: GetCustomFieldInclude | Unset = UNSET, -) -> Response[CustomFieldResponse | ErrorsList]: + include: Union[Unset, GetCustomFieldInclude] = UNSET, +) -> Response[Union[CustomFieldResponse, ErrorsList]]: """[DEPRECATED] Retrieves a Custom Field Retrieves a specific custom_field by id Args: id (str): - include (GetCustomFieldInclude | Unset): + include (Union[Unset, GetCustomFieldInclude]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CustomFieldResponse | ErrorsList] + Response[Union[CustomFieldResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -107,22 +103,22 @@ def sync( id: str, *, client: AuthenticatedClient, - include: GetCustomFieldInclude | Unset = UNSET, -) -> CustomFieldResponse | ErrorsList | None: + include: Union[Unset, GetCustomFieldInclude] = UNSET, +) -> Optional[Union[CustomFieldResponse, ErrorsList]]: """[DEPRECATED] Retrieves a Custom Field Retrieves a specific custom_field by id Args: id (str): - include (GetCustomFieldInclude | Unset): + include (Union[Unset, GetCustomFieldInclude]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CustomFieldResponse | ErrorsList + Union[CustomFieldResponse, ErrorsList] """ return sync_detailed( @@ -136,22 +132,22 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, - include: GetCustomFieldInclude | Unset = UNSET, -) -> Response[CustomFieldResponse | ErrorsList]: + include: Union[Unset, GetCustomFieldInclude] = UNSET, +) -> Response[Union[CustomFieldResponse, ErrorsList]]: """[DEPRECATED] Retrieves a Custom Field Retrieves a specific custom_field by id Args: id (str): - include (GetCustomFieldInclude | Unset): + include (Union[Unset, GetCustomFieldInclude]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CustomFieldResponse | ErrorsList] + Response[Union[CustomFieldResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -168,22 +164,22 @@ async def asyncio( id: str, *, client: AuthenticatedClient, - include: GetCustomFieldInclude | Unset = UNSET, -) -> CustomFieldResponse | ErrorsList | None: + include: Union[Unset, GetCustomFieldInclude] = UNSET, +) -> Optional[Union[CustomFieldResponse, ErrorsList]]: """[DEPRECATED] Retrieves a Custom Field Retrieves a specific custom_field by id Args: id (str): - include (GetCustomFieldInclude | Unset): + include (Union[Unset, GetCustomFieldInclude]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CustomFieldResponse | ErrorsList + Union[CustomFieldResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/deprecated_custom_fields/list_custom_fields.py b/rootly_sdk/api/deprecated_custom_fields/list_custom_fields.py index 3d059a21..350e2492 100644 --- a/rootly_sdk/api/deprecated_custom_fields/list_custom_fields.py +++ b/rootly_sdk/api/deprecated_custom_fields/list_custom_fields.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -13,45 +13,44 @@ def _get_kwargs( *, - include: ListCustomFieldsInclude | Unset = UNSET, - sort: ListCustomFieldsSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filterlabel: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filterenabled: bool | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filterlabeleq: str | Unset = UNSET, - filterlabelnot_eq: str | Unset = UNSET, - filterlabelin: str | Unset = UNSET, - filterlabelnot_in: str | Unset = UNSET, - filterkindeq: str | Unset = UNSET, - filterkindnot_eq: str | Unset = UNSET, - filterkindin: str | Unset = UNSET, - filterkindnot_in: str | Unset = UNSET, - filterenabledeq: str | Unset = UNSET, - filterenablednot_eq: str | Unset = UNSET, - filterenabledin: str | Unset = UNSET, - filterenablednot_in: str | Unset = UNSET, + include: Union[Unset, ListCustomFieldsInclude] = UNSET, + sort: Union[Unset, ListCustomFieldsSort] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filterlabel: Union[Unset, str] = UNSET, + filterkind: Union[Unset, str] = UNSET, + filterenabled: Union[Unset, bool] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filterslugeq: Union[Unset, str] = UNSET, + filterslugnot_eq: Union[Unset, str] = UNSET, + filterslugin: Union[Unset, str] = UNSET, + filterslugnot_in: Union[Unset, str] = UNSET, + filterlabeleq: Union[Unset, str] = UNSET, + filterlabelnot_eq: Union[Unset, str] = UNSET, + filterlabelin: Union[Unset, str] = UNSET, + filterlabelnot_in: Union[Unset, str] = UNSET, + filterkindeq: Union[Unset, str] = UNSET, + filterkindnot_eq: Union[Unset, str] = UNSET, + filterkindin: Union[Unset, str] = UNSET, + filterkindnot_in: Union[Unset, str] = UNSET, + filterenabledeq: Union[Unset, str] = UNSET, + filterenablednot_eq: Union[Unset, str] = UNSET, + filterenabledin: Union[Unset, str] = UNSET, + filterenablednot_in: Union[Unset, str] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} - json_include: str | Unset = UNSET + json_include: Union[Unset, str] = UNSET if not isinstance(include, Unset): json_include = include params["include"] = json_include - json_sort: str | Unset = UNSET + json_sort: Union[Unset, str] = UNSET if not isinstance(sort, Unset): json_sort = sort @@ -120,7 +119,9 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> CustomFieldList | None: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[CustomFieldList]: if response.status_code == 200: response_200 = CustomFieldList.from_dict(response.json()) @@ -132,7 +133,9 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[CustomFieldList]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[CustomFieldList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -144,68 +147,68 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - include: ListCustomFieldsInclude | Unset = UNSET, - sort: ListCustomFieldsSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filterlabel: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filterenabled: bool | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filterlabeleq: str | Unset = UNSET, - filterlabelnot_eq: str | Unset = UNSET, - filterlabelin: str | Unset = UNSET, - filterlabelnot_in: str | Unset = UNSET, - filterkindeq: str | Unset = UNSET, - filterkindnot_eq: str | Unset = UNSET, - filterkindin: str | Unset = UNSET, - filterkindnot_in: str | Unset = UNSET, - filterenabledeq: str | Unset = UNSET, - filterenablednot_eq: str | Unset = UNSET, - filterenabledin: str | Unset = UNSET, - filterenablednot_in: str | Unset = UNSET, + include: Union[Unset, ListCustomFieldsInclude] = UNSET, + sort: Union[Unset, ListCustomFieldsSort] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filterlabel: Union[Unset, str] = UNSET, + filterkind: Union[Unset, str] = UNSET, + filterenabled: Union[Unset, bool] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filterslugeq: Union[Unset, str] = UNSET, + filterslugnot_eq: Union[Unset, str] = UNSET, + filterslugin: Union[Unset, str] = UNSET, + filterslugnot_in: Union[Unset, str] = UNSET, + filterlabeleq: Union[Unset, str] = UNSET, + filterlabelnot_eq: Union[Unset, str] = UNSET, + filterlabelin: Union[Unset, str] = UNSET, + filterlabelnot_in: Union[Unset, str] = UNSET, + filterkindeq: Union[Unset, str] = UNSET, + filterkindnot_eq: Union[Unset, str] = UNSET, + filterkindin: Union[Unset, str] = UNSET, + filterkindnot_in: Union[Unset, str] = UNSET, + filterenabledeq: Union[Unset, str] = UNSET, + filterenablednot_eq: Union[Unset, str] = UNSET, + filterenabledin: Union[Unset, str] = UNSET, + filterenablednot_in: Union[Unset, str] = UNSET, ) -> Response[CustomFieldList]: """[DEPRECATED] List Custom Fields [DEPRECATED] Use form field endpoints instead. List Custom fields Args: - include (ListCustomFieldsInclude | Unset): - sort (ListCustomFieldsSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterslug (str | Unset): - filterlabel (str | Unset): - filterkind (str | Unset): - filterenabled (bool | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filterlabeleq (str | Unset): - filterlabelnot_eq (str | Unset): - filterlabelin (str | Unset): - filterlabelnot_in (str | Unset): - filterkindeq (str | Unset): - filterkindnot_eq (str | Unset): - filterkindin (str | Unset): - filterkindnot_in (str | Unset): - filterenabledeq (str | Unset): - filterenablednot_eq (str | Unset): - filterenabledin (str | Unset): - filterenablednot_in (str | Unset): + include (Union[Unset, ListCustomFieldsInclude]): + sort (Union[Unset, ListCustomFieldsSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterslug (Union[Unset, str]): + filterlabel (Union[Unset, str]): + filterkind (Union[Unset, str]): + filterenabled (Union[Unset, bool]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filterlabeleq (Union[Unset, str]): + filterlabelnot_eq (Union[Unset, str]): + filterlabelin (Union[Unset, str]): + filterlabelnot_in (Union[Unset, str]): + filterkindeq (Union[Unset, str]): + filterkindnot_eq (Union[Unset, str]): + filterkindin (Union[Unset, str]): + filterkindnot_in (Union[Unset, str]): + filterenabledeq (Union[Unset, str]): + filterenablednot_eq (Union[Unset, str]): + filterenabledin (Union[Unset, str]): + filterenablednot_in (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -256,68 +259,68 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: ListCustomFieldsInclude | Unset = UNSET, - sort: ListCustomFieldsSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filterlabel: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filterenabled: bool | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filterlabeleq: str | Unset = UNSET, - filterlabelnot_eq: str | Unset = UNSET, - filterlabelin: str | Unset = UNSET, - filterlabelnot_in: str | Unset = UNSET, - filterkindeq: str | Unset = UNSET, - filterkindnot_eq: str | Unset = UNSET, - filterkindin: str | Unset = UNSET, - filterkindnot_in: str | Unset = UNSET, - filterenabledeq: str | Unset = UNSET, - filterenablednot_eq: str | Unset = UNSET, - filterenabledin: str | Unset = UNSET, - filterenablednot_in: str | Unset = UNSET, -) -> CustomFieldList | None: + include: Union[Unset, ListCustomFieldsInclude] = UNSET, + sort: Union[Unset, ListCustomFieldsSort] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filterlabel: Union[Unset, str] = UNSET, + filterkind: Union[Unset, str] = UNSET, + filterenabled: Union[Unset, bool] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filterslugeq: Union[Unset, str] = UNSET, + filterslugnot_eq: Union[Unset, str] = UNSET, + filterslugin: Union[Unset, str] = UNSET, + filterslugnot_in: Union[Unset, str] = UNSET, + filterlabeleq: Union[Unset, str] = UNSET, + filterlabelnot_eq: Union[Unset, str] = UNSET, + filterlabelin: Union[Unset, str] = UNSET, + filterlabelnot_in: Union[Unset, str] = UNSET, + filterkindeq: Union[Unset, str] = UNSET, + filterkindnot_eq: Union[Unset, str] = UNSET, + filterkindin: Union[Unset, str] = UNSET, + filterkindnot_in: Union[Unset, str] = UNSET, + filterenabledeq: Union[Unset, str] = UNSET, + filterenablednot_eq: Union[Unset, str] = UNSET, + filterenabledin: Union[Unset, str] = UNSET, + filterenablednot_in: Union[Unset, str] = UNSET, +) -> Optional[CustomFieldList]: """[DEPRECATED] List Custom Fields [DEPRECATED] Use form field endpoints instead. List Custom fields Args: - include (ListCustomFieldsInclude | Unset): - sort (ListCustomFieldsSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterslug (str | Unset): - filterlabel (str | Unset): - filterkind (str | Unset): - filterenabled (bool | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filterlabeleq (str | Unset): - filterlabelnot_eq (str | Unset): - filterlabelin (str | Unset): - filterlabelnot_in (str | Unset): - filterkindeq (str | Unset): - filterkindnot_eq (str | Unset): - filterkindin (str | Unset): - filterkindnot_in (str | Unset): - filterenabledeq (str | Unset): - filterenablednot_eq (str | Unset): - filterenabledin (str | Unset): - filterenablednot_in (str | Unset): + include (Union[Unset, ListCustomFieldsInclude]): + sort (Union[Unset, ListCustomFieldsSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterslug (Union[Unset, str]): + filterlabel (Union[Unset, str]): + filterkind (Union[Unset, str]): + filterenabled (Union[Unset, bool]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filterlabeleq (Union[Unset, str]): + filterlabelnot_eq (Union[Unset, str]): + filterlabelin (Union[Unset, str]): + filterlabelnot_in (Union[Unset, str]): + filterkindeq (Union[Unset, str]): + filterkindnot_eq (Union[Unset, str]): + filterkindin (Union[Unset, str]): + filterkindnot_in (Union[Unset, str]): + filterenabledeq (Union[Unset, str]): + filterenablednot_eq (Union[Unset, str]): + filterenabledin (Union[Unset, str]): + filterenablednot_in (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -363,68 +366,68 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: ListCustomFieldsInclude | Unset = UNSET, - sort: ListCustomFieldsSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filterlabel: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filterenabled: bool | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filterlabeleq: str | Unset = UNSET, - filterlabelnot_eq: str | Unset = UNSET, - filterlabelin: str | Unset = UNSET, - filterlabelnot_in: str | Unset = UNSET, - filterkindeq: str | Unset = UNSET, - filterkindnot_eq: str | Unset = UNSET, - filterkindin: str | Unset = UNSET, - filterkindnot_in: str | Unset = UNSET, - filterenabledeq: str | Unset = UNSET, - filterenablednot_eq: str | Unset = UNSET, - filterenabledin: str | Unset = UNSET, - filterenablednot_in: str | Unset = UNSET, + include: Union[Unset, ListCustomFieldsInclude] = UNSET, + sort: Union[Unset, ListCustomFieldsSort] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filterlabel: Union[Unset, str] = UNSET, + filterkind: Union[Unset, str] = UNSET, + filterenabled: Union[Unset, bool] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filterslugeq: Union[Unset, str] = UNSET, + filterslugnot_eq: Union[Unset, str] = UNSET, + filterslugin: Union[Unset, str] = UNSET, + filterslugnot_in: Union[Unset, str] = UNSET, + filterlabeleq: Union[Unset, str] = UNSET, + filterlabelnot_eq: Union[Unset, str] = UNSET, + filterlabelin: Union[Unset, str] = UNSET, + filterlabelnot_in: Union[Unset, str] = UNSET, + filterkindeq: Union[Unset, str] = UNSET, + filterkindnot_eq: Union[Unset, str] = UNSET, + filterkindin: Union[Unset, str] = UNSET, + filterkindnot_in: Union[Unset, str] = UNSET, + filterenabledeq: Union[Unset, str] = UNSET, + filterenablednot_eq: Union[Unset, str] = UNSET, + filterenabledin: Union[Unset, str] = UNSET, + filterenablednot_in: Union[Unset, str] = UNSET, ) -> Response[CustomFieldList]: """[DEPRECATED] List Custom Fields [DEPRECATED] Use form field endpoints instead. List Custom fields Args: - include (ListCustomFieldsInclude | Unset): - sort (ListCustomFieldsSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterslug (str | Unset): - filterlabel (str | Unset): - filterkind (str | Unset): - filterenabled (bool | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filterlabeleq (str | Unset): - filterlabelnot_eq (str | Unset): - filterlabelin (str | Unset): - filterlabelnot_in (str | Unset): - filterkindeq (str | Unset): - filterkindnot_eq (str | Unset): - filterkindin (str | Unset): - filterkindnot_in (str | Unset): - filterenabledeq (str | Unset): - filterenablednot_eq (str | Unset): - filterenabledin (str | Unset): - filterenablednot_in (str | Unset): + include (Union[Unset, ListCustomFieldsInclude]): + sort (Union[Unset, ListCustomFieldsSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterslug (Union[Unset, str]): + filterlabel (Union[Unset, str]): + filterkind (Union[Unset, str]): + filterenabled (Union[Unset, bool]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filterlabeleq (Union[Unset, str]): + filterlabelnot_eq (Union[Unset, str]): + filterlabelin (Union[Unset, str]): + filterlabelnot_in (Union[Unset, str]): + filterkindeq (Union[Unset, str]): + filterkindnot_eq (Union[Unset, str]): + filterkindin (Union[Unset, str]): + filterkindnot_in (Union[Unset, str]): + filterenabledeq (Union[Unset, str]): + filterenablednot_eq (Union[Unset, str]): + filterenabledin (Union[Unset, str]): + filterenablednot_in (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -473,68 +476,68 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: ListCustomFieldsInclude | Unset = UNSET, - sort: ListCustomFieldsSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filterlabel: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filterenabled: bool | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filterlabeleq: str | Unset = UNSET, - filterlabelnot_eq: str | Unset = UNSET, - filterlabelin: str | Unset = UNSET, - filterlabelnot_in: str | Unset = UNSET, - filterkindeq: str | Unset = UNSET, - filterkindnot_eq: str | Unset = UNSET, - filterkindin: str | Unset = UNSET, - filterkindnot_in: str | Unset = UNSET, - filterenabledeq: str | Unset = UNSET, - filterenablednot_eq: str | Unset = UNSET, - filterenabledin: str | Unset = UNSET, - filterenablednot_in: str | Unset = UNSET, -) -> CustomFieldList | None: + include: Union[Unset, ListCustomFieldsInclude] = UNSET, + sort: Union[Unset, ListCustomFieldsSort] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filterlabel: Union[Unset, str] = UNSET, + filterkind: Union[Unset, str] = UNSET, + filterenabled: Union[Unset, bool] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filterslugeq: Union[Unset, str] = UNSET, + filterslugnot_eq: Union[Unset, str] = UNSET, + filterslugin: Union[Unset, str] = UNSET, + filterslugnot_in: Union[Unset, str] = UNSET, + filterlabeleq: Union[Unset, str] = UNSET, + filterlabelnot_eq: Union[Unset, str] = UNSET, + filterlabelin: Union[Unset, str] = UNSET, + filterlabelnot_in: Union[Unset, str] = UNSET, + filterkindeq: Union[Unset, str] = UNSET, + filterkindnot_eq: Union[Unset, str] = UNSET, + filterkindin: Union[Unset, str] = UNSET, + filterkindnot_in: Union[Unset, str] = UNSET, + filterenabledeq: Union[Unset, str] = UNSET, + filterenablednot_eq: Union[Unset, str] = UNSET, + filterenabledin: Union[Unset, str] = UNSET, + filterenablednot_in: Union[Unset, str] = UNSET, +) -> Optional[CustomFieldList]: """[DEPRECATED] List Custom Fields [DEPRECATED] Use form field endpoints instead. List Custom fields Args: - include (ListCustomFieldsInclude | Unset): - sort (ListCustomFieldsSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterslug (str | Unset): - filterlabel (str | Unset): - filterkind (str | Unset): - filterenabled (bool | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filterlabeleq (str | Unset): - filterlabelnot_eq (str | Unset): - filterlabelin (str | Unset): - filterlabelnot_in (str | Unset): - filterkindeq (str | Unset): - filterkindnot_eq (str | Unset): - filterkindin (str | Unset): - filterkindnot_in (str | Unset): - filterenabledeq (str | Unset): - filterenablednot_eq (str | Unset): - filterenabledin (str | Unset): - filterenablednot_in (str | Unset): + include (Union[Unset, ListCustomFieldsInclude]): + sort (Union[Unset, ListCustomFieldsSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterslug (Union[Unset, str]): + filterlabel (Union[Unset, str]): + filterkind (Union[Unset, str]): + filterenabled (Union[Unset, bool]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filterlabeleq (Union[Unset, str]): + filterlabelnot_eq (Union[Unset, str]): + filterlabelin (Union[Unset, str]): + filterlabelnot_in (Union[Unset, str]): + filterkindeq (Union[Unset, str]): + filterkindnot_eq (Union[Unset, str]): + filterkindin (Union[Unset, str]): + filterkindnot_in (Union[Unset, str]): + filterenabledeq (Union[Unset, str]): + filterenablednot_eq (Union[Unset, str]): + filterenabledin (Union[Unset, str]): + filterenablednot_in (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/deprecated_custom_fields/update_custom_field.py b/rootly_sdk/api/deprecated_custom_fields/update_custom_field.py index 6c03fcb7..5000d73a 100644 --- a/rootly_sdk/api/deprecated_custom_fields/update_custom_field.py +++ b/rootly_sdk/api/deprecated_custom_fields/update_custom_field.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/custom_fields/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/custom_fields/{id}", } _kwargs["json"] = body.to_dict() @@ -35,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> CustomFieldResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[CustomFieldResponse, ErrorsList]]: if response.status_code == 200: response_200 = CustomFieldResponse.from_dict(response.json()) @@ -54,8 +51,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[CustomFieldResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[CustomFieldResponse, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateCustomField, -) -> Response[CustomFieldResponse | ErrorsList]: +) -> Response[Union[CustomFieldResponse, ErrorsList]]: """[DEPRECATED] Update a Custom Field [DEPRECATED] Use form field endpoints instead. Update a specific custom field by id @@ -83,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CustomFieldResponse | ErrorsList] + Response[Union[CustomFieldResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -103,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateCustomField, -) -> CustomFieldResponse | ErrorsList | None: +) -> Optional[Union[CustomFieldResponse, ErrorsList]]: """[DEPRECATED] Update a Custom Field [DEPRECATED] Use form field endpoints instead. Update a specific custom field by id @@ -117,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CustomFieldResponse | ErrorsList + Union[CustomFieldResponse, ErrorsList] """ return sync_detailed( @@ -132,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateCustomField, -) -> Response[CustomFieldResponse | ErrorsList]: +) -> Response[Union[CustomFieldResponse, ErrorsList]]: """[DEPRECATED] Update a Custom Field [DEPRECATED] Use form field endpoints instead. Update a specific custom field by id @@ -146,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CustomFieldResponse | ErrorsList] + Response[Union[CustomFieldResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -164,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateCustomField, -) -> CustomFieldResponse | ErrorsList | None: +) -> Optional[Union[CustomFieldResponse, ErrorsList]]: """[DEPRECATED] Update a Custom Field [DEPRECATED] Use form field endpoints instead. Update a specific custom field by id @@ -178,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CustomFieldResponse | ErrorsList + Union[CustomFieldResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/deprecated_incident_custom_field_selections/create_incident_custom_field_selection.py b/rootly_sdk/api/deprecated_incident_custom_field_selections/create_incident_custom_field_selection.py index 656ce720..1bb4a08c 100644 --- a/rootly_sdk/api/deprecated_incident_custom_field_selections/create_incident_custom_field_selection.py +++ b/rootly_sdk/api/deprecated_incident_custom_field_selections/create_incident_custom_field_selection.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/incidents/{incident_id}/custom_field_selections".format( - incident_id=quote(str(incident_id), safe=""), - ), + "url": f"/v1/incidents/{incident_id}/custom_field_selections", } _kwargs["json"] = body.to_dict() @@ -35,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | IncidentCustomFieldSelectionResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, IncidentCustomFieldSelectionResponse]]: if response.status_code == 201: response_201 = IncidentCustomFieldSelectionResponse.from_dict(response.json()) @@ -59,8 +56,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | IncidentCustomFieldSelectionResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, IncidentCustomFieldSelectionResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -74,7 +71,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewIncidentCustomFieldSelection, -) -> Response[ErrorsList | IncidentCustomFieldSelectionResponse]: +) -> Response[Union[ErrorsList, IncidentCustomFieldSelectionResponse]]: """[DEPRECATED] Creates an incident custom field selection [DEPRECATED] Use form field endpoints instead. Creates a new incident custom field selection from @@ -89,7 +86,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentCustomFieldSelectionResponse] + Response[Union[ErrorsList, IncidentCustomFieldSelectionResponse]] """ kwargs = _get_kwargs( @@ -109,7 +106,7 @@ def sync( *, client: AuthenticatedClient, body: NewIncidentCustomFieldSelection, -) -> ErrorsList | IncidentCustomFieldSelectionResponse | None: +) -> Optional[Union[ErrorsList, IncidentCustomFieldSelectionResponse]]: """[DEPRECATED] Creates an incident custom field selection [DEPRECATED] Use form field endpoints instead. Creates a new incident custom field selection from @@ -124,7 +121,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentCustomFieldSelectionResponse + Union[ErrorsList, IncidentCustomFieldSelectionResponse] """ return sync_detailed( @@ -139,7 +136,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewIncidentCustomFieldSelection, -) -> Response[ErrorsList | IncidentCustomFieldSelectionResponse]: +) -> Response[Union[ErrorsList, IncidentCustomFieldSelectionResponse]]: """[DEPRECATED] Creates an incident custom field selection [DEPRECATED] Use form field endpoints instead. Creates a new incident custom field selection from @@ -154,7 +151,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentCustomFieldSelectionResponse] + Response[Union[ErrorsList, IncidentCustomFieldSelectionResponse]] """ kwargs = _get_kwargs( @@ -172,7 +169,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewIncidentCustomFieldSelection, -) -> ErrorsList | IncidentCustomFieldSelectionResponse | None: +) -> Optional[Union[ErrorsList, IncidentCustomFieldSelectionResponse]]: """[DEPRECATED] Creates an incident custom field selection [DEPRECATED] Use form field endpoints instead. Creates a new incident custom field selection from @@ -187,7 +184,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentCustomFieldSelectionResponse + Union[ErrorsList, IncidentCustomFieldSelectionResponse] """ return ( diff --git a/rootly_sdk/api/deprecated_incident_custom_field_selections/delete_incident_custom_field_selection.py b/rootly_sdk/api/deprecated_incident_custom_field_selections/delete_incident_custom_field_selection.py index b96d8ac0..3975d183 100644 --- a/rootly_sdk/api/deprecated_incident_custom_field_selections/delete_incident_custom_field_selection.py +++ b/rootly_sdk/api/deprecated_incident_custom_field_selections/delete_incident_custom_field_selection.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/incident_custom_field_selections/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/incident_custom_field_selections/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | IncidentCustomFieldSelectionResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, IncidentCustomFieldSelectionResponse]]: if response.status_code == 200: response_200 = IncidentCustomFieldSelectionResponse.from_dict(response.json()) @@ -45,8 +41,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | IncidentCustomFieldSelectionResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, IncidentCustomFieldSelectionResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | IncidentCustomFieldSelectionResponse]: +) -> Response[Union[ErrorsList, IncidentCustomFieldSelectionResponse]]: """[DEPRECATED] Delete an incident custom field selection [DEPRECATED] Use form field endpoints instead. Delete a specific incident custom field selection by @@ -73,7 +69,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentCustomFieldSelectionResponse] + Response[Union[ErrorsList, IncidentCustomFieldSelectionResponse]] """ kwargs = _get_kwargs( @@ -91,7 +87,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | IncidentCustomFieldSelectionResponse | None: +) -> Optional[Union[ErrorsList, IncidentCustomFieldSelectionResponse]]: """[DEPRECATED] Delete an incident custom field selection [DEPRECATED] Use form field endpoints instead. Delete a specific incident custom field selection by @@ -105,7 +101,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentCustomFieldSelectionResponse + Union[ErrorsList, IncidentCustomFieldSelectionResponse] """ return sync_detailed( @@ -118,7 +114,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | IncidentCustomFieldSelectionResponse]: +) -> Response[Union[ErrorsList, IncidentCustomFieldSelectionResponse]]: """[DEPRECATED] Delete an incident custom field selection [DEPRECATED] Use form field endpoints instead. Delete a specific incident custom field selection by @@ -132,7 +128,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentCustomFieldSelectionResponse] + Response[Union[ErrorsList, IncidentCustomFieldSelectionResponse]] """ kwargs = _get_kwargs( @@ -148,7 +144,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | IncidentCustomFieldSelectionResponse | None: +) -> Optional[Union[ErrorsList, IncidentCustomFieldSelectionResponse]]: """[DEPRECATED] Delete an incident custom field selection [DEPRECATED] Use form field endpoints instead. Delete a specific incident custom field selection by @@ -162,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentCustomFieldSelectionResponse + Union[ErrorsList, IncidentCustomFieldSelectionResponse] """ return ( diff --git a/rootly_sdk/api/deprecated_incident_custom_field_selections/get_incident_custom_field_selection.py b/rootly_sdk/api/deprecated_incident_custom_field_selections/get_incident_custom_field_selection.py index 51ee55a3..9570ee31 100644 --- a/rootly_sdk/api/deprecated_incident_custom_field_selections/get_incident_custom_field_selection.py +++ b/rootly_sdk/api/deprecated_incident_custom_field_selections/get_incident_custom_field_selection.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/incident_custom_field_selections/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/incident_custom_field_selections/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | IncidentCustomFieldSelectionResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, IncidentCustomFieldSelectionResponse]]: if response.status_code == 200: response_200 = IncidentCustomFieldSelectionResponse.from_dict(response.json()) @@ -45,8 +41,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | IncidentCustomFieldSelectionResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, IncidentCustomFieldSelectionResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | IncidentCustomFieldSelectionResponse]: +) -> Response[Union[ErrorsList, IncidentCustomFieldSelectionResponse]]: """[DEPRECATED] Retrieves an incident custom field selection [DEPRECATED] Use form field endpoints instead. Retrieves a specific incident custom field selection @@ -73,7 +69,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentCustomFieldSelectionResponse] + Response[Union[ErrorsList, IncidentCustomFieldSelectionResponse]] """ kwargs = _get_kwargs( @@ -91,7 +87,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | IncidentCustomFieldSelectionResponse | None: +) -> Optional[Union[ErrorsList, IncidentCustomFieldSelectionResponse]]: """[DEPRECATED] Retrieves an incident custom field selection [DEPRECATED] Use form field endpoints instead. Retrieves a specific incident custom field selection @@ -105,7 +101,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentCustomFieldSelectionResponse + Union[ErrorsList, IncidentCustomFieldSelectionResponse] """ return sync_detailed( @@ -118,7 +114,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | IncidentCustomFieldSelectionResponse]: +) -> Response[Union[ErrorsList, IncidentCustomFieldSelectionResponse]]: """[DEPRECATED] Retrieves an incident custom field selection [DEPRECATED] Use form field endpoints instead. Retrieves a specific incident custom field selection @@ -132,7 +128,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentCustomFieldSelectionResponse] + Response[Union[ErrorsList, IncidentCustomFieldSelectionResponse]] """ kwargs = _get_kwargs( @@ -148,7 +144,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | IncidentCustomFieldSelectionResponse | None: +) -> Optional[Union[ErrorsList, IncidentCustomFieldSelectionResponse]]: """[DEPRECATED] Retrieves an incident custom field selection [DEPRECATED] Use form field endpoints instead. Retrieves a specific incident custom field selection @@ -162,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentCustomFieldSelectionResponse + Union[ErrorsList, IncidentCustomFieldSelectionResponse] """ return ( diff --git a/rootly_sdk/api/deprecated_incident_custom_field_selections/list_incident_custom_field_selections.py b/rootly_sdk/api/deprecated_incident_custom_field_selections/list_incident_custom_field_selections.py index 5e6f60d6..5529de84 100644 --- a/rootly_sdk/api/deprecated_incident_custom_field_selections/list_incident_custom_field_selections.py +++ b/rootly_sdk/api/deprecated_incident_custom_field_selections/list_incident_custom_field_selections.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -13,11 +12,10 @@ def _get_kwargs( incident_id: str, *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -30,9 +28,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/incidents/{incident_id}/custom_field_selections".format( - incident_id=quote(str(incident_id), safe=""), - ), + "url": f"/v1/incidents/{incident_id}/custom_field_selections", "params": params, } @@ -40,8 +36,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> IncidentCustomFieldSelectionList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[IncidentCustomFieldSelectionList]: if response.status_code == 200: response_200 = IncidentCustomFieldSelectionList.from_dict(response.json()) @@ -54,7 +50,7 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[IncidentCustomFieldSelectionList]: return Response( status_code=HTTPStatus(response.status_code), @@ -68,9 +64,9 @@ def sync_detailed( incident_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, ) -> Response[IncidentCustomFieldSelectionList]: """[DEPRECATED] List incident custom field selections @@ -78,9 +74,9 @@ def sync_detailed( Args: incident_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -108,19 +104,19 @@ def sync( incident_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, -) -> IncidentCustomFieldSelectionList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, +) -> Optional[IncidentCustomFieldSelectionList]: """[DEPRECATED] List incident custom field selections [DEPRECATED] Use form field endpoints instead. List incident custom field selections Args: incident_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -143,9 +139,9 @@ async def asyncio_detailed( incident_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, ) -> Response[IncidentCustomFieldSelectionList]: """[DEPRECATED] List incident custom field selections @@ -153,9 +149,9 @@ async def asyncio_detailed( Args: incident_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -181,19 +177,19 @@ async def asyncio( incident_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, -) -> IncidentCustomFieldSelectionList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, +) -> Optional[IncidentCustomFieldSelectionList]: """[DEPRECATED] List incident custom field selections [DEPRECATED] Use form field endpoints instead. List incident custom field selections Args: incident_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/deprecated_incident_custom_field_selections/update_incident_custom_field_selection.py b/rootly_sdk/api/deprecated_incident_custom_field_selections/update_incident_custom_field_selection.py index b94030b8..18aabdda 100644 --- a/rootly_sdk/api/deprecated_incident_custom_field_selections/update_incident_custom_field_selection.py +++ b/rootly_sdk/api/deprecated_incident_custom_field_selections/update_incident_custom_field_selection.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/incident_custom_field_selections/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/incident_custom_field_selections/{id}", } _kwargs["json"] = body.to_dict() @@ -35,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | IncidentCustomFieldSelectionResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, IncidentCustomFieldSelectionResponse]]: if response.status_code == 200: response_200 = IncidentCustomFieldSelectionResponse.from_dict(response.json()) @@ -54,8 +51,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | IncidentCustomFieldSelectionResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, IncidentCustomFieldSelectionResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateIncidentCustomFieldSelection, -) -> Response[ErrorsList | IncidentCustomFieldSelectionResponse]: +) -> Response[Union[ErrorsList, IncidentCustomFieldSelectionResponse]]: """[DEPRECATED] Update an incident custom field selection [DEPRECATED] Use form field endpoints instead. Update a specific incident custom field selection by @@ -84,7 +81,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentCustomFieldSelectionResponse] + Response[Union[ErrorsList, IncidentCustomFieldSelectionResponse]] """ kwargs = _get_kwargs( @@ -104,7 +101,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateIncidentCustomFieldSelection, -) -> ErrorsList | IncidentCustomFieldSelectionResponse | None: +) -> Optional[Union[ErrorsList, IncidentCustomFieldSelectionResponse]]: """[DEPRECATED] Update an incident custom field selection [DEPRECATED] Use form field endpoints instead. Update a specific incident custom field selection by @@ -119,7 +116,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentCustomFieldSelectionResponse + Union[ErrorsList, IncidentCustomFieldSelectionResponse] """ return sync_detailed( @@ -134,7 +131,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateIncidentCustomFieldSelection, -) -> Response[ErrorsList | IncidentCustomFieldSelectionResponse]: +) -> Response[Union[ErrorsList, IncidentCustomFieldSelectionResponse]]: """[DEPRECATED] Update an incident custom field selection [DEPRECATED] Use form field endpoints instead. Update a specific incident custom field selection by @@ -149,7 +146,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentCustomFieldSelectionResponse] + Response[Union[ErrorsList, IncidentCustomFieldSelectionResponse]] """ kwargs = _get_kwargs( @@ -167,7 +164,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateIncidentCustomFieldSelection, -) -> ErrorsList | IncidentCustomFieldSelectionResponse | None: +) -> Optional[Union[ErrorsList, IncidentCustomFieldSelectionResponse]]: """[DEPRECATED] Update an incident custom field selection [DEPRECATED] Use form field endpoints instead. Update a specific incident custom field selection by @@ -182,7 +179,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentCustomFieldSelectionResponse + Union[ErrorsList, IncidentCustomFieldSelectionResponse] """ return ( diff --git a/rootly_sdk/api/deprecated_workflow_custom_field_selections/create_workflow_custom_field_selection.py b/rootly_sdk/api/deprecated_workflow_custom_field_selections/create_workflow_custom_field_selection.py index 60ac3c5d..60c9b18d 100644 --- a/rootly_sdk/api/deprecated_workflow_custom_field_selections/create_workflow_custom_field_selection.py +++ b/rootly_sdk/api/deprecated_workflow_custom_field_selections/create_workflow_custom_field_selection.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/workflows/{workflow_id}/custom_field_selections".format( - workflow_id=quote(str(workflow_id), safe=""), - ), + "url": f"/v1/workflows/{workflow_id}/custom_field_selections", } _kwargs["json"] = body.to_dict() @@ -35,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | WorkflowCustomFieldSelectionResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, WorkflowCustomFieldSelectionResponse]]: if response.status_code == 201: response_201 = WorkflowCustomFieldSelectionResponse.from_dict(response.json()) @@ -54,8 +51,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | WorkflowCustomFieldSelectionResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, WorkflowCustomFieldSelectionResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewWorkflowCustomFieldSelection, -) -> Response[ErrorsList | WorkflowCustomFieldSelectionResponse]: +) -> Response[Union[ErrorsList, WorkflowCustomFieldSelectionResponse]]: """[DEPRECATED] Creates a workflow custom field selection [DEPRECATED] Use form field endpoints instead. Creates a new workflow custom field selection from @@ -84,7 +81,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WorkflowCustomFieldSelectionResponse] + Response[Union[ErrorsList, WorkflowCustomFieldSelectionResponse]] """ kwargs = _get_kwargs( @@ -104,7 +101,7 @@ def sync( *, client: AuthenticatedClient, body: NewWorkflowCustomFieldSelection, -) -> ErrorsList | WorkflowCustomFieldSelectionResponse | None: +) -> Optional[Union[ErrorsList, WorkflowCustomFieldSelectionResponse]]: """[DEPRECATED] Creates a workflow custom field selection [DEPRECATED] Use form field endpoints instead. Creates a new workflow custom field selection from @@ -119,7 +116,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WorkflowCustomFieldSelectionResponse + Union[ErrorsList, WorkflowCustomFieldSelectionResponse] """ return sync_detailed( @@ -134,7 +131,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewWorkflowCustomFieldSelection, -) -> Response[ErrorsList | WorkflowCustomFieldSelectionResponse]: +) -> Response[Union[ErrorsList, WorkflowCustomFieldSelectionResponse]]: """[DEPRECATED] Creates a workflow custom field selection [DEPRECATED] Use form field endpoints instead. Creates a new workflow custom field selection from @@ -149,7 +146,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WorkflowCustomFieldSelectionResponse] + Response[Union[ErrorsList, WorkflowCustomFieldSelectionResponse]] """ kwargs = _get_kwargs( @@ -167,7 +164,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewWorkflowCustomFieldSelection, -) -> ErrorsList | WorkflowCustomFieldSelectionResponse | None: +) -> Optional[Union[ErrorsList, WorkflowCustomFieldSelectionResponse]]: """[DEPRECATED] Creates a workflow custom field selection [DEPRECATED] Use form field endpoints instead. Creates a new workflow custom field selection from @@ -182,7 +179,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WorkflowCustomFieldSelectionResponse + Union[ErrorsList, WorkflowCustomFieldSelectionResponse] """ return ( diff --git a/rootly_sdk/api/deprecated_workflow_custom_field_selections/delete_workflow_custom_field_selection.py b/rootly_sdk/api/deprecated_workflow_custom_field_selections/delete_workflow_custom_field_selection.py index c41ac11d..bd73c09f 100644 --- a/rootly_sdk/api/deprecated_workflow_custom_field_selections/delete_workflow_custom_field_selection.py +++ b/rootly_sdk/api/deprecated_workflow_custom_field_selections/delete_workflow_custom_field_selection.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/workflow_custom_field_selections/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/workflow_custom_field_selections/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | WorkflowCustomFieldSelectionResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, WorkflowCustomFieldSelectionResponse]]: if response.status_code == 200: response_200 = WorkflowCustomFieldSelectionResponse.from_dict(response.json()) @@ -45,8 +41,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | WorkflowCustomFieldSelectionResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, WorkflowCustomFieldSelectionResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | WorkflowCustomFieldSelectionResponse]: +) -> Response[Union[ErrorsList, WorkflowCustomFieldSelectionResponse]]: """[DEPRECATED] Delete a workflow custom field selection [DEPRECATED] Use form field endpoints instead. Delete a specific workflow custom field selection by @@ -73,7 +69,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WorkflowCustomFieldSelectionResponse] + Response[Union[ErrorsList, WorkflowCustomFieldSelectionResponse]] """ kwargs = _get_kwargs( @@ -91,7 +87,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | WorkflowCustomFieldSelectionResponse | None: +) -> Optional[Union[ErrorsList, WorkflowCustomFieldSelectionResponse]]: """[DEPRECATED] Delete a workflow custom field selection [DEPRECATED] Use form field endpoints instead. Delete a specific workflow custom field selection by @@ -105,7 +101,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WorkflowCustomFieldSelectionResponse + Union[ErrorsList, WorkflowCustomFieldSelectionResponse] """ return sync_detailed( @@ -118,7 +114,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | WorkflowCustomFieldSelectionResponse]: +) -> Response[Union[ErrorsList, WorkflowCustomFieldSelectionResponse]]: """[DEPRECATED] Delete a workflow custom field selection [DEPRECATED] Use form field endpoints instead. Delete a specific workflow custom field selection by @@ -132,7 +128,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WorkflowCustomFieldSelectionResponse] + Response[Union[ErrorsList, WorkflowCustomFieldSelectionResponse]] """ kwargs = _get_kwargs( @@ -148,7 +144,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | WorkflowCustomFieldSelectionResponse | None: +) -> Optional[Union[ErrorsList, WorkflowCustomFieldSelectionResponse]]: """[DEPRECATED] Delete a workflow custom field selection [DEPRECATED] Use form field endpoints instead. Delete a specific workflow custom field selection by @@ -162,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WorkflowCustomFieldSelectionResponse + Union[ErrorsList, WorkflowCustomFieldSelectionResponse] """ return ( diff --git a/rootly_sdk/api/deprecated_workflow_custom_field_selections/get_workflow_custom_field_selection.py b/rootly_sdk/api/deprecated_workflow_custom_field_selections/get_workflow_custom_field_selection.py index 30f721e6..577d072c 100644 --- a/rootly_sdk/api/deprecated_workflow_custom_field_selections/get_workflow_custom_field_selection.py +++ b/rootly_sdk/api/deprecated_workflow_custom_field_selections/get_workflow_custom_field_selection.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/workflow_custom_field_selections/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/workflow_custom_field_selections/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | WorkflowCustomFieldSelectionResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, WorkflowCustomFieldSelectionResponse]]: if response.status_code == 200: response_200 = WorkflowCustomFieldSelectionResponse.from_dict(response.json()) @@ -45,8 +41,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | WorkflowCustomFieldSelectionResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, WorkflowCustomFieldSelectionResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | WorkflowCustomFieldSelectionResponse]: +) -> Response[Union[ErrorsList, WorkflowCustomFieldSelectionResponse]]: """[DEPRECATED] Retrieves a workflow custom field selection [DEPRECATED] Use form field endpoints instead. Retrieves a specific workflow custom field selection @@ -73,7 +69,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WorkflowCustomFieldSelectionResponse] + Response[Union[ErrorsList, WorkflowCustomFieldSelectionResponse]] """ kwargs = _get_kwargs( @@ -91,7 +87,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | WorkflowCustomFieldSelectionResponse | None: +) -> Optional[Union[ErrorsList, WorkflowCustomFieldSelectionResponse]]: """[DEPRECATED] Retrieves a workflow custom field selection [DEPRECATED] Use form field endpoints instead. Retrieves a specific workflow custom field selection @@ -105,7 +101,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WorkflowCustomFieldSelectionResponse + Union[ErrorsList, WorkflowCustomFieldSelectionResponse] """ return sync_detailed( @@ -118,7 +114,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | WorkflowCustomFieldSelectionResponse]: +) -> Response[Union[ErrorsList, WorkflowCustomFieldSelectionResponse]]: """[DEPRECATED] Retrieves a workflow custom field selection [DEPRECATED] Use form field endpoints instead. Retrieves a specific workflow custom field selection @@ -132,7 +128,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WorkflowCustomFieldSelectionResponse] + Response[Union[ErrorsList, WorkflowCustomFieldSelectionResponse]] """ kwargs = _get_kwargs( @@ -148,7 +144,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | WorkflowCustomFieldSelectionResponse | None: +) -> Optional[Union[ErrorsList, WorkflowCustomFieldSelectionResponse]]: """[DEPRECATED] Retrieves a workflow custom field selection [DEPRECATED] Use form field endpoints instead. Retrieves a specific workflow custom field selection @@ -162,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WorkflowCustomFieldSelectionResponse + Union[ErrorsList, WorkflowCustomFieldSelectionResponse] """ return ( diff --git a/rootly_sdk/api/deprecated_workflow_custom_field_selections/list_workflow_custom_field_selections.py b/rootly_sdk/api/deprecated_workflow_custom_field_selections/list_workflow_custom_field_selections.py index 764381f7..14aaedb8 100644 --- a/rootly_sdk/api/deprecated_workflow_custom_field_selections/list_workflow_custom_field_selections.py +++ b/rootly_sdk/api/deprecated_workflow_custom_field_selections/list_workflow_custom_field_selections.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -13,11 +12,10 @@ def _get_kwargs( workflow_id: str, *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -30,9 +28,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/workflows/{workflow_id}/custom_field_selections".format( - workflow_id=quote(str(workflow_id), safe=""), - ), + "url": f"/v1/workflows/{workflow_id}/custom_field_selections", "params": params, } @@ -40,8 +36,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> WorkflowCustomFieldSelectionList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[WorkflowCustomFieldSelectionList]: if response.status_code == 200: response_200 = WorkflowCustomFieldSelectionList.from_dict(response.json()) @@ -54,7 +50,7 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[WorkflowCustomFieldSelectionList]: return Response( status_code=HTTPStatus(response.status_code), @@ -68,9 +64,9 @@ def sync_detailed( workflow_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, ) -> Response[WorkflowCustomFieldSelectionList]: """[DEPRECATED] List workflow custom field selections @@ -78,9 +74,9 @@ def sync_detailed( Args: workflow_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -108,19 +104,19 @@ def sync( workflow_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, -) -> WorkflowCustomFieldSelectionList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, +) -> Optional[WorkflowCustomFieldSelectionList]: """[DEPRECATED] List workflow custom field selections [DEPRECATED] Use form field endpoints instead. List workflow custom field selections Args: workflow_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -143,9 +139,9 @@ async def asyncio_detailed( workflow_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, ) -> Response[WorkflowCustomFieldSelectionList]: """[DEPRECATED] List workflow custom field selections @@ -153,9 +149,9 @@ async def asyncio_detailed( Args: workflow_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -181,19 +177,19 @@ async def asyncio( workflow_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, -) -> WorkflowCustomFieldSelectionList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, +) -> Optional[WorkflowCustomFieldSelectionList]: """[DEPRECATED] List workflow custom field selections [DEPRECATED] Use form field endpoints instead. List workflow custom field selections Args: workflow_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/deprecated_workflow_custom_field_selections/update_workflow_custom_field_selection.py b/rootly_sdk/api/deprecated_workflow_custom_field_selections/update_workflow_custom_field_selection.py index 5f683704..94961cd3 100644 --- a/rootly_sdk/api/deprecated_workflow_custom_field_selections/update_workflow_custom_field_selection.py +++ b/rootly_sdk/api/deprecated_workflow_custom_field_selections/update_workflow_custom_field_selection.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/workflow_custom_field_selections/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/workflow_custom_field_selections/{id}", } _kwargs["json"] = body.to_dict() @@ -35,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | WorkflowCustomFieldSelectionResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, WorkflowCustomFieldSelectionResponse]]: if response.status_code == 200: response_200 = WorkflowCustomFieldSelectionResponse.from_dict(response.json()) @@ -54,8 +51,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | WorkflowCustomFieldSelectionResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, WorkflowCustomFieldSelectionResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateWorkflowCustomFieldSelection, -) -> Response[ErrorsList | WorkflowCustomFieldSelectionResponse]: +) -> Response[Union[ErrorsList, WorkflowCustomFieldSelectionResponse]]: """[DEPRECATED] Update a workflow custom field selection [DEPRECATED] Use form field endpoints instead. Update a specific workflow custom field selection by @@ -84,7 +81,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WorkflowCustomFieldSelectionResponse] + Response[Union[ErrorsList, WorkflowCustomFieldSelectionResponse]] """ kwargs = _get_kwargs( @@ -104,7 +101,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateWorkflowCustomFieldSelection, -) -> ErrorsList | WorkflowCustomFieldSelectionResponse | None: +) -> Optional[Union[ErrorsList, WorkflowCustomFieldSelectionResponse]]: """[DEPRECATED] Update a workflow custom field selection [DEPRECATED] Use form field endpoints instead. Update a specific workflow custom field selection by @@ -119,7 +116,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WorkflowCustomFieldSelectionResponse + Union[ErrorsList, WorkflowCustomFieldSelectionResponse] """ return sync_detailed( @@ -134,7 +131,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateWorkflowCustomFieldSelection, -) -> Response[ErrorsList | WorkflowCustomFieldSelectionResponse]: +) -> Response[Union[ErrorsList, WorkflowCustomFieldSelectionResponse]]: """[DEPRECATED] Update a workflow custom field selection [DEPRECATED] Use form field endpoints instead. Update a specific workflow custom field selection by @@ -149,7 +146,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WorkflowCustomFieldSelectionResponse] + Response[Union[ErrorsList, WorkflowCustomFieldSelectionResponse]] """ kwargs = _get_kwargs( @@ -167,7 +164,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateWorkflowCustomFieldSelection, -) -> ErrorsList | WorkflowCustomFieldSelectionResponse | None: +) -> Optional[Union[ErrorsList, WorkflowCustomFieldSelectionResponse]]: """[DEPRECATED] Update a workflow custom field selection [DEPRECATED] Use form field endpoints instead. Update a specific workflow custom field selection by @@ -182,7 +179,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WorkflowCustomFieldSelectionResponse + Union[ErrorsList, WorkflowCustomFieldSelectionResponse] """ return ( diff --git a/rootly_sdk/api/edge_connector_actions/create_edge_connector_action.py b/rootly_sdk/api/edge_connector_actions/create_edge_connector_action.py index 2fab426e..f868d88d 100644 --- a/rootly_sdk/api/edge_connector_actions/create_edge_connector_action.py +++ b/rootly_sdk/api/edge_connector_actions/create_edge_connector_action.py @@ -1,31 +1,27 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx from ... import errors from ...client import AuthenticatedClient, Client from ...models.create_edge_connector_action_body import CreateEdgeConnectorActionBody -from ...types import UNSET, Response, Unset +from ...types import Response def _get_kwargs( edge_connector_id: str, *, - body: CreateEdgeConnectorActionBody | Unset = UNSET, + body: CreateEdgeConnectorActionBody, ) -> dict[str, Any]: headers: dict[str, Any] = {} _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/edge_connectors/{edge_connector_id}/actions".format( - edge_connector_id=quote(str(edge_connector_id), safe=""), - ), + "url": f"/v1/edge_connectors/{edge_connector_id}/actions", } - if not isinstance(body, Unset): - _kwargs["json"] = body.to_dict() + _kwargs["json"] = body.to_dict() headers["Content-Type"] = "application/vnd.api+json" @@ -33,7 +29,7 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Any | None: +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: if response.status_code == 201: return None @@ -46,7 +42,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Any]: +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,13 +55,13 @@ def sync_detailed( edge_connector_id: str, *, client: AuthenticatedClient, - body: CreateEdgeConnectorActionBody | Unset = UNSET, + body: CreateEdgeConnectorActionBody, ) -> Response[Any]: """Create edge connector action Args: edge_connector_id (str): - body (CreateEdgeConnectorActionBody | Unset): + body (CreateEdgeConnectorActionBody): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -91,13 +87,13 @@ async def asyncio_detailed( edge_connector_id: str, *, client: AuthenticatedClient, - body: CreateEdgeConnectorActionBody | Unset = UNSET, + body: CreateEdgeConnectorActionBody, ) -> Response[Any]: """Create edge connector action Args: edge_connector_id (str): - body (CreateEdgeConnectorActionBody | Unset): + body (CreateEdgeConnectorActionBody): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/edge_connector_actions/delete_edge_connector_action.py b/rootly_sdk/api/edge_connector_actions/delete_edge_connector_action.py index bcad29a3..0acc33cb 100644 --- a/rootly_sdk/api/edge_connector_actions/delete_edge_connector_action.py +++ b/rootly_sdk/api/edge_connector_actions/delete_edge_connector_action.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union from uuid import UUID import httpx @@ -12,21 +11,17 @@ def _get_kwargs( edge_connector_id: str, - id: str | UUID, + id: Union[UUID, str], ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/edge_connectors/{edge_connector_id}/actions/{id}".format( - edge_connector_id=quote(str(edge_connector_id), safe=""), - id=quote(str(id), safe=""), - ), + "url": f"/v1/edge_connectors/{edge_connector_id}/actions/{id}", } return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Any | None: +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: if response.status_code == 200: return None @@ -36,7 +31,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Any]: +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -47,7 +42,7 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( edge_connector_id: str, - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, ) -> Response[Any]: @@ -55,7 +50,7 @@ def sync_detailed( Args: edge_connector_id (str): - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -79,7 +74,7 @@ def sync_detailed( async def asyncio_detailed( edge_connector_id: str, - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, ) -> Response[Any]: @@ -87,7 +82,7 @@ async def asyncio_detailed( Args: edge_connector_id (str): - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/edge_connector_actions/get_edge_connector_action.py b/rootly_sdk/api/edge_connector_actions/get_edge_connector_action.py index 35449bd3..b198edb9 100644 --- a/rootly_sdk/api/edge_connector_actions/get_edge_connector_action.py +++ b/rootly_sdk/api/edge_connector_actions/get_edge_connector_action.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union from uuid import UUID import httpx @@ -12,21 +11,17 @@ def _get_kwargs( edge_connector_id: str, - id: str | UUID, + id: Union[UUID, str], ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/edge_connectors/{edge_connector_id}/actions/{id}".format( - edge_connector_id=quote(str(edge_connector_id), safe=""), - id=quote(str(id), safe=""), - ), + "url": f"/v1/edge_connectors/{edge_connector_id}/actions/{id}", } return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Any | None: +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: if response.status_code == 200: return None @@ -39,7 +34,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Any]: +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -50,7 +45,7 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( edge_connector_id: str, - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, ) -> Response[Any]: @@ -58,7 +53,7 @@ def sync_detailed( Args: edge_connector_id (str): - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -82,7 +77,7 @@ def sync_detailed( async def asyncio_detailed( edge_connector_id: str, - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, ) -> Response[Any]: @@ -90,7 +85,7 @@ async def asyncio_detailed( Args: edge_connector_id (str): - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/edge_connector_actions/list_edge_connector_actions.py b/rootly_sdk/api/edge_connector_actions/list_edge_connector_actions.py index ac27ce42..77ce3cc8 100644 --- a/rootly_sdk/api/edge_connector_actions/list_edge_connector_actions.py +++ b/rootly_sdk/api/edge_connector_actions/list_edge_connector_actions.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -12,18 +11,15 @@ def _get_kwargs( edge_connector_id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/edge_connectors/{edge_connector_id}/actions".format( - edge_connector_id=quote(str(edge_connector_id), safe=""), - ), + "url": f"/v1/edge_connectors/{edge_connector_id}/actions", } return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Any | None: +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: if response.status_code == 200: return None @@ -36,7 +32,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Any]: +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, diff --git a/rootly_sdk/api/edge_connector_actions/update_edge_connector_action.py b/rootly_sdk/api/edge_connector_actions/update_edge_connector_action.py index 9be920e7..e8b5ffad 100644 --- a/rootly_sdk/api/edge_connector_actions/update_edge_connector_action.py +++ b/rootly_sdk/api/edge_connector_actions/update_edge_connector_action.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union from uuid import UUID import httpx @@ -8,27 +7,23 @@ from ... import errors from ...client import AuthenticatedClient, Client from ...models.update_edge_connector_action_body import UpdateEdgeConnectorActionBody -from ...types import UNSET, Response, Unset +from ...types import Response def _get_kwargs( edge_connector_id: str, - id: str | UUID, + id: Union[UUID, str], *, - body: UpdateEdgeConnectorActionBody | Unset = UNSET, + body: UpdateEdgeConnectorActionBody, ) -> dict[str, Any]: headers: dict[str, Any] = {} _kwargs: dict[str, Any] = { "method": "patch", - "url": "/v1/edge_connectors/{edge_connector_id}/actions/{id}".format( - edge_connector_id=quote(str(edge_connector_id), safe=""), - id=quote(str(id), safe=""), - ), + "url": f"/v1/edge_connectors/{edge_connector_id}/actions/{id}", } - if not isinstance(body, Unset): - _kwargs["json"] = body.to_dict() + _kwargs["json"] = body.to_dict() headers["Content-Type"] = "application/vnd.api+json" @@ -36,7 +31,7 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Any | None: +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: if response.status_code == 200: return None @@ -46,7 +41,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Any]: +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -57,17 +52,17 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( edge_connector_id: str, - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, - body: UpdateEdgeConnectorActionBody | Unset = UNSET, + body: UpdateEdgeConnectorActionBody, ) -> Response[Any]: """Update edge connector action Args: edge_connector_id (str): - id (str | UUID): - body (UpdateEdgeConnectorActionBody | Unset): + id (Union[UUID, str]): + body (UpdateEdgeConnectorActionBody): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -92,17 +87,17 @@ def sync_detailed( async def asyncio_detailed( edge_connector_id: str, - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, - body: UpdateEdgeConnectorActionBody | Unset = UNSET, + body: UpdateEdgeConnectorActionBody, ) -> Response[Any]: """Update edge connector action Args: edge_connector_id (str): - id (str | UUID): - body (UpdateEdgeConnectorActionBody | Unset): + id (Union[UUID, str]): + body (UpdateEdgeConnectorActionBody): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/edge_connectors/create_edge_connector.py b/rootly_sdk/api/edge_connectors/create_edge_connector.py index 4fd4237e..de16ac85 100644 --- a/rootly_sdk/api/edge_connectors/create_edge_connector.py +++ b/rootly_sdk/api/edge_connectors/create_edge_connector.py @@ -1,17 +1,17 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx from ... import errors from ...client import AuthenticatedClient, Client from ...models.create_edge_connector_body import CreateEdgeConnectorBody -from ...types import UNSET, Response, Unset +from ...types import Response def _get_kwargs( *, - body: CreateEdgeConnectorBody | Unset = UNSET, + body: CreateEdgeConnectorBody, ) -> dict[str, Any]: headers: dict[str, Any] = {} @@ -20,8 +20,7 @@ def _get_kwargs( "url": "/v1/edge_connectors", } - if not isinstance(body, Unset): - _kwargs["json"] = body.to_dict() + _kwargs["json"] = body.to_dict() headers["Content-Type"] = "application/vnd.api+json" @@ -29,7 +28,7 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Any | None: +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: if response.status_code == 201: return None @@ -42,7 +41,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Any]: +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -54,12 +53,12 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - body: CreateEdgeConnectorBody | Unset = UNSET, + body: CreateEdgeConnectorBody, ) -> Response[Any]: """Create edge connector Args: - body (CreateEdgeConnectorBody | Unset): + body (CreateEdgeConnectorBody): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -83,12 +82,12 @@ def sync_detailed( async def asyncio_detailed( *, client: AuthenticatedClient, - body: CreateEdgeConnectorBody | Unset = UNSET, + body: CreateEdgeConnectorBody, ) -> Response[Any]: """Create edge connector Args: - body (CreateEdgeConnectorBody | Unset): + body (CreateEdgeConnectorBody): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/edge_connectors/delete_edge_connector.py b/rootly_sdk/api/edge_connectors/delete_edge_connector.py index a289f349..d9b27fde 100644 --- a/rootly_sdk/api/edge_connectors/delete_edge_connector.py +++ b/rootly_sdk/api/edge_connectors/delete_edge_connector.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -12,18 +11,15 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/edge_connectors/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/edge_connectors/{id}", } return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Any | None: +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: if response.status_code == 200: return None @@ -33,7 +29,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Any]: +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, diff --git a/rootly_sdk/api/edge_connectors/get_edge_connector.py b/rootly_sdk/api/edge_connectors/get_edge_connector.py index ce73bfe0..68b51cb3 100644 --- a/rootly_sdk/api/edge_connectors/get_edge_connector.py +++ b/rootly_sdk/api/edge_connectors/get_edge_connector.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -12,18 +11,15 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/edge_connectors/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/edge_connectors/{id}", } return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Any | None: +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: if response.status_code == 200: return None @@ -36,7 +32,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Any]: +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, diff --git a/rootly_sdk/api/edge_connectors/list_edge_connectors.py b/rootly_sdk/api/edge_connectors/list_edge_connectors.py index e24a0844..4ea586aa 100644 --- a/rootly_sdk/api/edge_connectors/list_edge_connectors.py +++ b/rootly_sdk/api/edge_connectors/list_edge_connectors.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -10,12 +10,11 @@ def _get_kwargs( *, - page: int | Unset = UNSET, - per_page: int | Unset = UNSET, - status: str | Unset = UNSET, - name: str | Unset = UNSET, + page: Union[Unset, int] = UNSET, + per_page: Union[Unset, int] = UNSET, + status: Union[Unset, str] = UNSET, + name: Union[Unset, str] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["page"] = page @@ -37,7 +36,7 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Any | None: +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: if response.status_code == 200: return None @@ -47,7 +46,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Any]: +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,18 +58,18 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - page: int | Unset = UNSET, - per_page: int | Unset = UNSET, - status: str | Unset = UNSET, - name: str | Unset = UNSET, + page: Union[Unset, int] = UNSET, + per_page: Union[Unset, int] = UNSET, + status: Union[Unset, str] = UNSET, + name: Union[Unset, str] = UNSET, ) -> Response[Any]: """List edge connectors Args: - page (int | Unset): - per_page (int | Unset): - status (str | Unset): - name (str | Unset): + page (Union[Unset, int]): + per_page (Union[Unset, int]): + status (Union[Unset, str]): + name (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -97,18 +96,18 @@ def sync_detailed( async def asyncio_detailed( *, client: AuthenticatedClient, - page: int | Unset = UNSET, - per_page: int | Unset = UNSET, - status: str | Unset = UNSET, - name: str | Unset = UNSET, + page: Union[Unset, int] = UNSET, + per_page: Union[Unset, int] = UNSET, + status: Union[Unset, str] = UNSET, + name: Union[Unset, str] = UNSET, ) -> Response[Any]: """List edge connectors Args: - page (int | Unset): - per_page (int | Unset): - status (str | Unset): - name (str | Unset): + page (Union[Unset, int]): + per_page (Union[Unset, int]): + status (Union[Unset, str]): + name (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/edge_connectors/update_edge_connector.py b/rootly_sdk/api/edge_connectors/update_edge_connector.py index df27a0bb..3d417ae8 100644 --- a/rootly_sdk/api/edge_connectors/update_edge_connector.py +++ b/rootly_sdk/api/edge_connectors/update_edge_connector.py @@ -1,31 +1,27 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx from ... import errors from ...client import AuthenticatedClient, Client from ...models.update_edge_connector_body import UpdateEdgeConnectorBody -from ...types import UNSET, Response, Unset +from ...types import Response def _get_kwargs( id: str, *, - body: UpdateEdgeConnectorBody | Unset = UNSET, + body: UpdateEdgeConnectorBody, ) -> dict[str, Any]: headers: dict[str, Any] = {} _kwargs: dict[str, Any] = { "method": "patch", - "url": "/v1/edge_connectors/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/edge_connectors/{id}", } - if not isinstance(body, Unset): - _kwargs["json"] = body.to_dict() + _kwargs["json"] = body.to_dict() headers["Content-Type"] = "application/vnd.api+json" @@ -33,7 +29,7 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Any | None: +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: if response.status_code == 200: return None @@ -46,7 +42,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Any]: +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,13 +55,13 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, - body: UpdateEdgeConnectorBody | Unset = UNSET, + body: UpdateEdgeConnectorBody, ) -> Response[Any]: """Update edge connector Args: id (str): - body (UpdateEdgeConnectorBody | Unset): + body (UpdateEdgeConnectorBody): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -91,13 +87,13 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, - body: UpdateEdgeConnectorBody | Unset = UNSET, + body: UpdateEdgeConnectorBody, ) -> Response[Any]: """Update edge connector Args: id (str): - body (UpdateEdgeConnectorBody | Unset): + body (UpdateEdgeConnectorBody): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/environments/bulk_delete_environments.py b/rootly_sdk/api/environments/bulk_delete_environments.py index 7a889981..3d6ca2c4 100644 --- a/rootly_sdk/api/environments/bulk_delete_environments.py +++ b/rootly_sdk/api/environments/bulk_delete_environments.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -14,7 +14,7 @@ def _get_kwargs( *, - body: BulkDestroyEnvironmentsType0 | BulkDestroyEnvironmentsType1, + body: Union["BulkDestroyEnvironmentsType0", "BulkDestroyEnvironmentsType1"], ) -> dict[str, Any]: headers: dict[str, Any] = {} @@ -23,6 +23,7 @@ def _get_kwargs( "url": "/v1/environments/bulk_delete", } + _kwargs["json"]: dict[str, Any] if isinstance(body, BulkDestroyEnvironmentsType0): _kwargs["json"] = body.to_dict() else: @@ -35,8 +36,10 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> BulkDestroyEnvironmentsResponse | BulkDestroyEnvironmentsResponse | ErrorsList | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[ + Union[BulkDestroyEnvironmentsResponse, ErrorsList, Union["BulkDestroyEnvironmentsResponse", "ErrorsList"]] +]: if response.status_code == 200: response_200 = BulkDestroyEnvironmentsResponse.from_dict(response.json()) @@ -49,14 +52,14 @@ def _parse_response( if response.status_code == 422: - def _parse_response_422(data: object) -> BulkDestroyEnvironmentsResponse | ErrorsList: + def _parse_response_422(data: object) -> Union["BulkDestroyEnvironmentsResponse", "ErrorsList"]: try: if not isinstance(data, dict): raise TypeError() response_422_type_0 = ErrorsList.from_dict(data) return response_422_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass if not isinstance(data, dict): raise TypeError() @@ -75,8 +78,10 @@ def _parse_response_422(data: object) -> BulkDestroyEnvironmentsResponse | Error def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[BulkDestroyEnvironmentsResponse | BulkDestroyEnvironmentsResponse | ErrorsList | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[ + Union[BulkDestroyEnvironmentsResponse, ErrorsList, Union["BulkDestroyEnvironmentsResponse", "ErrorsList"]] +]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -88,24 +93,26 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - body: BulkDestroyEnvironmentsType0 | BulkDestroyEnvironmentsType1, -) -> Response[BulkDestroyEnvironmentsResponse | BulkDestroyEnvironmentsResponse | ErrorsList | ErrorsList]: + body: Union["BulkDestroyEnvironmentsType0", "BulkDestroyEnvironmentsType1"], +) -> Response[ + Union[BulkDestroyEnvironmentsResponse, ErrorsList, Union["BulkDestroyEnvironmentsResponse", "ErrorsList"]] +]: """Bulk delete Environments Delete environments by external_id list, or prune by managed_by source. Two mutually exclusive modes. Args: - body (BulkDestroyEnvironmentsType0 | BulkDestroyEnvironmentsType1): Two mutually exclusive - modes. Pass exactly one of: external_ids (delete specific records) or managed_by (prune - all managed records not in keep set). + body (Union['BulkDestroyEnvironmentsType0', 'BulkDestroyEnvironmentsType1']): Two mutually + exclusive modes. Pass exactly one of: external_ids (delete specific records) or managed_by + (prune all managed records not in keep set). Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[BulkDestroyEnvironmentsResponse | BulkDestroyEnvironmentsResponse | ErrorsList | ErrorsList] + Response[Union[BulkDestroyEnvironmentsResponse, ErrorsList, Union['BulkDestroyEnvironmentsResponse', 'ErrorsList']]] """ kwargs = _get_kwargs( @@ -122,24 +129,26 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - body: BulkDestroyEnvironmentsType0 | BulkDestroyEnvironmentsType1, -) -> BulkDestroyEnvironmentsResponse | BulkDestroyEnvironmentsResponse | ErrorsList | ErrorsList | None: + body: Union["BulkDestroyEnvironmentsType0", "BulkDestroyEnvironmentsType1"], +) -> Optional[ + Union[BulkDestroyEnvironmentsResponse, ErrorsList, Union["BulkDestroyEnvironmentsResponse", "ErrorsList"]] +]: """Bulk delete Environments Delete environments by external_id list, or prune by managed_by source. Two mutually exclusive modes. Args: - body (BulkDestroyEnvironmentsType0 | BulkDestroyEnvironmentsType1): Two mutually exclusive - modes. Pass exactly one of: external_ids (delete specific records) or managed_by (prune - all managed records not in keep set). + body (Union['BulkDestroyEnvironmentsType0', 'BulkDestroyEnvironmentsType1']): Two mutually + exclusive modes. Pass exactly one of: external_ids (delete specific records) or managed_by + (prune all managed records not in keep set). Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - BulkDestroyEnvironmentsResponse | BulkDestroyEnvironmentsResponse | ErrorsList | ErrorsList + Union[BulkDestroyEnvironmentsResponse, ErrorsList, Union['BulkDestroyEnvironmentsResponse', 'ErrorsList']] """ return sync_detailed( @@ -151,24 +160,26 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - body: BulkDestroyEnvironmentsType0 | BulkDestroyEnvironmentsType1, -) -> Response[BulkDestroyEnvironmentsResponse | BulkDestroyEnvironmentsResponse | ErrorsList | ErrorsList]: + body: Union["BulkDestroyEnvironmentsType0", "BulkDestroyEnvironmentsType1"], +) -> Response[ + Union[BulkDestroyEnvironmentsResponse, ErrorsList, Union["BulkDestroyEnvironmentsResponse", "ErrorsList"]] +]: """Bulk delete Environments Delete environments by external_id list, or prune by managed_by source. Two mutually exclusive modes. Args: - body (BulkDestroyEnvironmentsType0 | BulkDestroyEnvironmentsType1): Two mutually exclusive - modes. Pass exactly one of: external_ids (delete specific records) or managed_by (prune - all managed records not in keep set). + body (Union['BulkDestroyEnvironmentsType0', 'BulkDestroyEnvironmentsType1']): Two mutually + exclusive modes. Pass exactly one of: external_ids (delete specific records) or managed_by + (prune all managed records not in keep set). Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[BulkDestroyEnvironmentsResponse | BulkDestroyEnvironmentsResponse | ErrorsList | ErrorsList] + Response[Union[BulkDestroyEnvironmentsResponse, ErrorsList, Union['BulkDestroyEnvironmentsResponse', 'ErrorsList']]] """ kwargs = _get_kwargs( @@ -183,24 +194,26 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - body: BulkDestroyEnvironmentsType0 | BulkDestroyEnvironmentsType1, -) -> BulkDestroyEnvironmentsResponse | BulkDestroyEnvironmentsResponse | ErrorsList | ErrorsList | None: + body: Union["BulkDestroyEnvironmentsType0", "BulkDestroyEnvironmentsType1"], +) -> Optional[ + Union[BulkDestroyEnvironmentsResponse, ErrorsList, Union["BulkDestroyEnvironmentsResponse", "ErrorsList"]] +]: """Bulk delete Environments Delete environments by external_id list, or prune by managed_by source. Two mutually exclusive modes. Args: - body (BulkDestroyEnvironmentsType0 | BulkDestroyEnvironmentsType1): Two mutually exclusive - modes. Pass exactly one of: external_ids (delete specific records) or managed_by (prune - all managed records not in keep set). + body (Union['BulkDestroyEnvironmentsType0', 'BulkDestroyEnvironmentsType1']): Two mutually + exclusive modes. Pass exactly one of: external_ids (delete specific records) or managed_by + (prune all managed records not in keep set). Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - BulkDestroyEnvironmentsResponse | BulkDestroyEnvironmentsResponse | ErrorsList | ErrorsList + Union[BulkDestroyEnvironmentsResponse, ErrorsList, Union['BulkDestroyEnvironmentsResponse', 'ErrorsList']] """ return ( diff --git a/rootly_sdk/api/environments/bulk_upsert_environments.py b/rootly_sdk/api/environments/bulk_upsert_environments.py index 32b2cd6c..dce558a8 100644 --- a/rootly_sdk/api/environments/bulk_upsert_environments.py +++ b/rootly_sdk/api/environments/bulk_upsert_environments.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> BulkUpsertEnvironmentsError | ErrorsList | BulkUpsertEnvironmentsResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[BulkUpsertEnvironmentsResponse, ErrorsList, Union["BulkUpsertEnvironmentsError", "ErrorsList"]]]: if response.status_code == 200: response_200 = BulkUpsertEnvironmentsResponse.from_dict(response.json()) @@ -46,14 +46,14 @@ def _parse_response( if response.status_code == 422: - def _parse_response_422(data: object) -> BulkUpsertEnvironmentsError | ErrorsList: + def _parse_response_422(data: object) -> Union["BulkUpsertEnvironmentsError", "ErrorsList"]: try: if not isinstance(data, dict): raise TypeError() response_422_type_0 = ErrorsList.from_dict(data) return response_422_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass if not isinstance(data, dict): raise TypeError() @@ -72,8 +72,8 @@ def _parse_response_422(data: object) -> BulkUpsertEnvironmentsError | ErrorsLis def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[BulkUpsertEnvironmentsError | ErrorsList | BulkUpsertEnvironmentsResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[BulkUpsertEnvironmentsResponse, ErrorsList, Union["BulkUpsertEnvironmentsError", "ErrorsList"]]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -86,7 +86,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: BulkUpsertEnvironments, -) -> Response[BulkUpsertEnvironmentsError | ErrorsList | BulkUpsertEnvironmentsResponse | ErrorsList]: +) -> Response[Union[BulkUpsertEnvironmentsResponse, ErrorsList, Union["BulkUpsertEnvironmentsError", "ErrorsList"]]]: """Bulk upsert Environments Create or update multiple environments by external_id. Only attributes present in the payload are @@ -103,7 +103,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[BulkUpsertEnvironmentsError | ErrorsList | BulkUpsertEnvironmentsResponse | ErrorsList] + Response[Union[BulkUpsertEnvironmentsResponse, ErrorsList, Union['BulkUpsertEnvironmentsError', 'ErrorsList']]] """ kwargs = _get_kwargs( @@ -121,7 +121,7 @@ def sync( *, client: AuthenticatedClient, body: BulkUpsertEnvironments, -) -> BulkUpsertEnvironmentsError | ErrorsList | BulkUpsertEnvironmentsResponse | ErrorsList | None: +) -> Optional[Union[BulkUpsertEnvironmentsResponse, ErrorsList, Union["BulkUpsertEnvironmentsError", "ErrorsList"]]]: """Bulk upsert Environments Create or update multiple environments by external_id. Only attributes present in the payload are @@ -138,7 +138,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - BulkUpsertEnvironmentsError | ErrorsList | BulkUpsertEnvironmentsResponse | ErrorsList + Union[BulkUpsertEnvironmentsResponse, ErrorsList, Union['BulkUpsertEnvironmentsError', 'ErrorsList']] """ return sync_detailed( @@ -151,7 +151,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: BulkUpsertEnvironments, -) -> Response[BulkUpsertEnvironmentsError | ErrorsList | BulkUpsertEnvironmentsResponse | ErrorsList]: +) -> Response[Union[BulkUpsertEnvironmentsResponse, ErrorsList, Union["BulkUpsertEnvironmentsError", "ErrorsList"]]]: """Bulk upsert Environments Create or update multiple environments by external_id. Only attributes present in the payload are @@ -168,7 +168,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[BulkUpsertEnvironmentsError | ErrorsList | BulkUpsertEnvironmentsResponse | ErrorsList] + Response[Union[BulkUpsertEnvironmentsResponse, ErrorsList, Union['BulkUpsertEnvironmentsError', 'ErrorsList']]] """ kwargs = _get_kwargs( @@ -184,7 +184,7 @@ async def asyncio( *, client: AuthenticatedClient, body: BulkUpsertEnvironments, -) -> BulkUpsertEnvironmentsError | ErrorsList | BulkUpsertEnvironmentsResponse | ErrorsList | None: +) -> Optional[Union[BulkUpsertEnvironmentsResponse, ErrorsList, Union["BulkUpsertEnvironmentsError", "ErrorsList"]]]: """Bulk upsert Environments Create or update multiple environments by external_id. Only attributes present in the payload are @@ -201,7 +201,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - BulkUpsertEnvironmentsError | ErrorsList | BulkUpsertEnvironmentsResponse | ErrorsList + Union[BulkUpsertEnvironmentsResponse, ErrorsList, Union['BulkUpsertEnvironmentsError', 'ErrorsList']] """ return ( diff --git a/rootly_sdk/api/environments/create_environment.py b/rootly_sdk/api/environments/create_environment.py index a12a138c..2e9683dc 100644 --- a/rootly_sdk/api/environments/create_environment.py +++ b/rootly_sdk/api/environments/create_environment.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> EnvironmentResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[EnvironmentResponse, ErrorsList]]: if response.status_code == 201: response_201 = EnvironmentResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[EnvironmentResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[EnvironmentResponse, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +69,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewEnvironment, -) -> Response[EnvironmentResponse | ErrorsList]: +) -> Response[Union[EnvironmentResponse, ErrorsList]]: """Creates an environment Creates a new environment from provided data @@ -82,7 +82,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[EnvironmentResponse | ErrorsList] + Response[Union[EnvironmentResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: NewEnvironment, -) -> EnvironmentResponse | ErrorsList | None: +) -> Optional[Union[EnvironmentResponse, ErrorsList]]: """Creates an environment Creates a new environment from provided data @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - EnvironmentResponse | ErrorsList + Union[EnvironmentResponse, ErrorsList] """ return sync_detailed( @@ -126,7 +126,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewEnvironment, -) -> Response[EnvironmentResponse | ErrorsList]: +) -> Response[Union[EnvironmentResponse, ErrorsList]]: """Creates an environment Creates a new environment from provided data @@ -139,7 +139,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[EnvironmentResponse | ErrorsList] + Response[Union[EnvironmentResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -155,7 +155,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewEnvironment, -) -> EnvironmentResponse | ErrorsList | None: +) -> Optional[Union[EnvironmentResponse, ErrorsList]]: """Creates an environment Creates a new environment from provided data @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - EnvironmentResponse | ErrorsList + Union[EnvironmentResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/environments/create_environment_catalog_property.py b/rootly_sdk/api/environments/create_environment_catalog_property.py index d3a415ba..4686a137 100644 --- a/rootly_sdk/api/environments/create_environment_catalog_property.py +++ b/rootly_sdk/api/environments/create_environment_catalog_property.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> CatalogPropertyResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[CatalogPropertyResponse, ErrorsList]]: if response.status_code == 201: response_201 = CatalogPropertyResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[CatalogPropertyResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[CatalogPropertyResponse, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +69,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewCatalogProperty, -) -> Response[CatalogPropertyResponse | ErrorsList]: +) -> Response[Union[CatalogPropertyResponse, ErrorsList]]: """Creates a Catalog Property Creates a new Catalog Property from provided data @@ -82,7 +82,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CatalogPropertyResponse | ErrorsList] + Response[Union[CatalogPropertyResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: NewCatalogProperty, -) -> CatalogPropertyResponse | ErrorsList | None: +) -> Optional[Union[CatalogPropertyResponse, ErrorsList]]: """Creates a Catalog Property Creates a new Catalog Property from provided data @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CatalogPropertyResponse | ErrorsList + Union[CatalogPropertyResponse, ErrorsList] """ return sync_detailed( @@ -126,7 +126,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewCatalogProperty, -) -> Response[CatalogPropertyResponse | ErrorsList]: +) -> Response[Union[CatalogPropertyResponse, ErrorsList]]: """Creates a Catalog Property Creates a new Catalog Property from provided data @@ -139,7 +139,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CatalogPropertyResponse | ErrorsList] + Response[Union[CatalogPropertyResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -155,7 +155,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewCatalogProperty, -) -> CatalogPropertyResponse | ErrorsList | None: +) -> Optional[Union[CatalogPropertyResponse, ErrorsList]]: """Creates a Catalog Property Creates a new Catalog Property from provided data @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CatalogPropertyResponse | ErrorsList + Union[CatalogPropertyResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/environments/delete_environment.py b/rootly_sdk/api/environments/delete_environment.py index 48221a57..cb682340 100644 --- a/rootly_sdk/api/environments/delete_environment.py +++ b/rootly_sdk/api/environments/delete_environment.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union from uuid import UUID import httpx @@ -13,22 +12,19 @@ def _get_kwargs( - id: str | UUID, + id: Union[UUID, str], ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/environments/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/environments/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> EnvironmentResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[EnvironmentResponse, ErrorsList]]: if response.status_code == 200: response_200 = EnvironmentResponse.from_dict(response.json()) @@ -46,8 +42,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[EnvironmentResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[EnvironmentResponse, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -57,23 +53,23 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Response[EnvironmentResponse | ErrorsList]: +) -> Response[Union[EnvironmentResponse, ErrorsList]]: """Delete an environment Delete a specific environment by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[EnvironmentResponse | ErrorsList] + Response[Union[EnvironmentResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -88,23 +84,23 @@ def sync_detailed( def sync( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> EnvironmentResponse | ErrorsList | None: +) -> Optional[Union[EnvironmentResponse, ErrorsList]]: """Delete an environment Delete a specific environment by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - EnvironmentResponse | ErrorsList + Union[EnvironmentResponse, ErrorsList] """ return sync_detailed( @@ -114,23 +110,23 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Response[EnvironmentResponse | ErrorsList]: +) -> Response[Union[EnvironmentResponse, ErrorsList]]: """Delete an environment Delete a specific environment by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[EnvironmentResponse | ErrorsList] + Response[Union[EnvironmentResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -143,23 +139,23 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> EnvironmentResponse | ErrorsList | None: +) -> Optional[Union[EnvironmentResponse, ErrorsList]]: """Delete an environment Delete a specific environment by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - EnvironmentResponse | ErrorsList + Union[EnvironmentResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/environments/get_environment.py b/rootly_sdk/api/environments/get_environment.py index 2fb16213..795b467e 100644 --- a/rootly_sdk/api/environments/get_environment.py +++ b/rootly_sdk/api/environments/get_environment.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union from uuid import UUID import httpx @@ -13,22 +12,19 @@ def _get_kwargs( - id: str | UUID, + id: Union[UUID, str], ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/environments/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/environments/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> EnvironmentResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[EnvironmentResponse, ErrorsList]]: if response.status_code == 200: response_200 = EnvironmentResponse.from_dict(response.json()) @@ -46,8 +42,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[EnvironmentResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[EnvironmentResponse, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -57,23 +53,23 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Response[EnvironmentResponse | ErrorsList]: +) -> Response[Union[EnvironmentResponse, ErrorsList]]: """Retrieves an environment Retrieves a specific environment by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[EnvironmentResponse | ErrorsList] + Response[Union[EnvironmentResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -88,23 +84,23 @@ def sync_detailed( def sync( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> EnvironmentResponse | ErrorsList | None: +) -> Optional[Union[EnvironmentResponse, ErrorsList]]: """Retrieves an environment Retrieves a specific environment by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - EnvironmentResponse | ErrorsList + Union[EnvironmentResponse, ErrorsList] """ return sync_detailed( @@ -114,23 +110,23 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Response[EnvironmentResponse | ErrorsList]: +) -> Response[Union[EnvironmentResponse, ErrorsList]]: """Retrieves an environment Retrieves a specific environment by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[EnvironmentResponse | ErrorsList] + Response[Union[EnvironmentResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -143,23 +139,23 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> EnvironmentResponse | ErrorsList | None: +) -> Optional[Union[EnvironmentResponse, ErrorsList]]: """Retrieves an environment Retrieves a specific environment by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - EnvironmentResponse | ErrorsList + Union[EnvironmentResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/environments/list_environment_catalog_properties.py b/rootly_sdk/api/environments/list_environment_catalog_properties.py index cb526165..aec11ddf 100644 --- a/rootly_sdk/api/environments/list_environment_catalog_properties.py +++ b/rootly_sdk/api/environments/list_environment_catalog_properties.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -17,28 +17,27 @@ def _get_kwargs( *, - include: ListEnvironmentCatalogPropertiesInclude | Unset = UNSET, - sort: ListEnvironmentCatalogPropertiesSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Union[Unset, ListEnvironmentCatalogPropertiesInclude] = UNSET, + sort: Union[Unset, ListEnvironmentCatalogPropertiesSort] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterkind: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} - json_include: str | Unset = UNSET + json_include: Union[Unset, str] = UNSET if not isinstance(include, Unset): json_include = include params["include"] = json_include - json_sort: str | Unset = UNSET + json_sort: Union[Unset, str] = UNSET if not isinstance(sort, Unset): json_sort = sort @@ -73,7 +72,9 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> CatalogPropertyList | None: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[CatalogPropertyList]: if response.status_code == 200: response_200 = CatalogPropertyList.from_dict(response.json()) @@ -85,7 +86,9 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[CatalogPropertyList]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[CatalogPropertyList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -97,34 +100,34 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - include: ListEnvironmentCatalogPropertiesInclude | Unset = UNSET, - sort: ListEnvironmentCatalogPropertiesSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Union[Unset, ListEnvironmentCatalogPropertiesInclude] = UNSET, + sort: Union[Unset, ListEnvironmentCatalogPropertiesSort] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterkind: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, ) -> Response[CatalogPropertyList]: """List Catalog Properties List Environment Catalog Properties Args: - include (ListEnvironmentCatalogPropertiesInclude | Unset): - sort (ListEnvironmentCatalogPropertiesSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterkind (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, ListEnvironmentCatalogPropertiesInclude]): + sort (Union[Unset, ListEnvironmentCatalogPropertiesSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterkind (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -158,34 +161,34 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: ListEnvironmentCatalogPropertiesInclude | Unset = UNSET, - sort: ListEnvironmentCatalogPropertiesSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, -) -> CatalogPropertyList | None: + include: Union[Unset, ListEnvironmentCatalogPropertiesInclude] = UNSET, + sort: Union[Unset, ListEnvironmentCatalogPropertiesSort] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterkind: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, +) -> Optional[CatalogPropertyList]: """List Catalog Properties List Environment Catalog Properties Args: - include (ListEnvironmentCatalogPropertiesInclude | Unset): - sort (ListEnvironmentCatalogPropertiesSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterkind (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, ListEnvironmentCatalogPropertiesInclude]): + sort (Union[Unset, ListEnvironmentCatalogPropertiesSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterkind (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -214,34 +217,34 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: ListEnvironmentCatalogPropertiesInclude | Unset = UNSET, - sort: ListEnvironmentCatalogPropertiesSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Union[Unset, ListEnvironmentCatalogPropertiesInclude] = UNSET, + sort: Union[Unset, ListEnvironmentCatalogPropertiesSort] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterkind: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, ) -> Response[CatalogPropertyList]: """List Catalog Properties List Environment Catalog Properties Args: - include (ListEnvironmentCatalogPropertiesInclude | Unset): - sort (ListEnvironmentCatalogPropertiesSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterkind (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, ListEnvironmentCatalogPropertiesInclude]): + sort (Union[Unset, ListEnvironmentCatalogPropertiesSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterkind (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -273,34 +276,34 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: ListEnvironmentCatalogPropertiesInclude | Unset = UNSET, - sort: ListEnvironmentCatalogPropertiesSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, -) -> CatalogPropertyList | None: + include: Union[Unset, ListEnvironmentCatalogPropertiesInclude] = UNSET, + sort: Union[Unset, ListEnvironmentCatalogPropertiesSort] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterkind: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, +) -> Optional[CatalogPropertyList]: """List Catalog Properties List Environment Catalog Properties Args: - include (ListEnvironmentCatalogPropertiesInclude | Unset): - sort (ListEnvironmentCatalogPropertiesSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterkind (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, ListEnvironmentCatalogPropertiesInclude]): + sort (Union[Unset, ListEnvironmentCatalogPropertiesSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterkind (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/environments/list_environments.py b/rootly_sdk/api/environments/list_environments.py index 20855cd6..7de3109b 100644 --- a/rootly_sdk/api/environments/list_environments.py +++ b/rootly_sdk/api/environments/list_environments.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -11,32 +11,31 @@ def _get_kwargs( *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercolor: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filtercoloreq: str | Unset = UNSET, - filtercolornot_eq: str | Unset = UNSET, - filtercolorin: str | Unset = UNSET, - filtercolornot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filtercolor: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filterslugeq: Union[Unset, str] = UNSET, + filterslugnot_eq: Union[Unset, str] = UNSET, + filterslugin: Union[Unset, str] = UNSET, + filterslugnot_in: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, + filtercoloreq: Union[Unset, str] = UNSET, + filtercolornot_eq: Union[Unset, str] = UNSET, + filtercolorin: Union[Unset, str] = UNSET, + filtercolornot_in: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -98,7 +97,9 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> EnvironmentList | None: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[EnvironmentList]: if response.status_code == 200: response_200 = EnvironmentList.from_dict(response.json()) @@ -110,7 +111,9 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[EnvironmentList]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[EnvironmentList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -122,60 +125,60 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercolor: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filtercoloreq: str | Unset = UNSET, - filtercolornot_eq: str | Unset = UNSET, - filtercolorin: str | Unset = UNSET, - filtercolornot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filtercolor: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filterslugeq: Union[Unset, str] = UNSET, + filterslugnot_eq: Union[Unset, str] = UNSET, + filterslugin: Union[Unset, str] = UNSET, + filterslugnot_in: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, + filtercoloreq: Union[Unset, str] = UNSET, + filtercolornot_eq: Union[Unset, str] = UNSET, + filtercolorin: Union[Unset, str] = UNSET, + filtercolornot_in: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, ) -> Response[EnvironmentList]: """List environments List environments Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filtercolor (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filtercoloreq (str | Unset): - filtercolornot_eq (str | Unset): - filtercolorin (str | Unset): - filtercolornot_in (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filtercolor (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filtercoloreq (Union[Unset, str]): + filtercolornot_eq (Union[Unset, str]): + filtercolorin (Union[Unset, str]): + filtercolornot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -222,60 +225,60 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercolor: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filtercoloreq: str | Unset = UNSET, - filtercolornot_eq: str | Unset = UNSET, - filtercolorin: str | Unset = UNSET, - filtercolornot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, -) -> EnvironmentList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filtercolor: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filterslugeq: Union[Unset, str] = UNSET, + filterslugnot_eq: Union[Unset, str] = UNSET, + filterslugin: Union[Unset, str] = UNSET, + filterslugnot_in: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, + filtercoloreq: Union[Unset, str] = UNSET, + filtercolornot_eq: Union[Unset, str] = UNSET, + filtercolorin: Union[Unset, str] = UNSET, + filtercolornot_in: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, +) -> Optional[EnvironmentList]: """List environments List environments Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filtercolor (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filtercoloreq (str | Unset): - filtercolornot_eq (str | Unset): - filtercolorin (str | Unset): - filtercolornot_in (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filtercolor (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filtercoloreq (Union[Unset, str]): + filtercolornot_eq (Union[Unset, str]): + filtercolorin (Union[Unset, str]): + filtercolornot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -317,60 +320,60 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercolor: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filtercoloreq: str | Unset = UNSET, - filtercolornot_eq: str | Unset = UNSET, - filtercolorin: str | Unset = UNSET, - filtercolornot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filtercolor: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filterslugeq: Union[Unset, str] = UNSET, + filterslugnot_eq: Union[Unset, str] = UNSET, + filterslugin: Union[Unset, str] = UNSET, + filterslugnot_in: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, + filtercoloreq: Union[Unset, str] = UNSET, + filtercolornot_eq: Union[Unset, str] = UNSET, + filtercolorin: Union[Unset, str] = UNSET, + filtercolornot_in: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, ) -> Response[EnvironmentList]: """List environments List environments Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filtercolor (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filtercoloreq (str | Unset): - filtercolornot_eq (str | Unset): - filtercolorin (str | Unset): - filtercolornot_in (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filtercolor (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filtercoloreq (Union[Unset, str]): + filtercolornot_eq (Union[Unset, str]): + filtercolorin (Union[Unset, str]): + filtercolornot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -415,60 +418,60 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercolor: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filtercoloreq: str | Unset = UNSET, - filtercolornot_eq: str | Unset = UNSET, - filtercolorin: str | Unset = UNSET, - filtercolornot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, -) -> EnvironmentList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filtercolor: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filterslugeq: Union[Unset, str] = UNSET, + filterslugnot_eq: Union[Unset, str] = UNSET, + filterslugin: Union[Unset, str] = UNSET, + filterslugnot_in: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, + filtercoloreq: Union[Unset, str] = UNSET, + filtercolornot_eq: Union[Unset, str] = UNSET, + filtercolorin: Union[Unset, str] = UNSET, + filtercolornot_in: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, +) -> Optional[EnvironmentList]: """List environments List environments Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filtercolor (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filtercoloreq (str | Unset): - filtercolornot_eq (str | Unset): - filtercolorin (str | Unset): - filtercolornot_in (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filtercolor (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filtercoloreq (Union[Unset, str]): + filtercolornot_eq (Union[Unset, str]): + filtercolorin (Union[Unset, str]): + filtercolornot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/environments/update_environment.py b/rootly_sdk/api/environments/update_environment.py index 6e9348d0..d6b6eb9e 100644 --- a/rootly_sdk/api/environments/update_environment.py +++ b/rootly_sdk/api/environments/update_environment.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union from uuid import UUID import httpx @@ -14,7 +13,7 @@ def _get_kwargs( - id: str | UUID, + id: Union[UUID, str], *, body: UpdateEnvironment, ) -> dict[str, Any]: @@ -22,9 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/environments/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/environments/{id}", } _kwargs["json"] = body.to_dict() @@ -36,8 +33,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> EnvironmentResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[EnvironmentResponse, ErrorsList]]: if response.status_code == 200: response_200 = EnvironmentResponse.from_dict(response.json()) @@ -55,8 +52,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[EnvironmentResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[EnvironmentResponse, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,17 +63,17 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdateEnvironment, -) -> Response[EnvironmentResponse | ErrorsList]: +) -> Response[Union[EnvironmentResponse, ErrorsList]]: """Update an environment Update a specific environment by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateEnvironment): Raises: @@ -84,7 +81,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[EnvironmentResponse | ErrorsList] + Response[Union[EnvironmentResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -100,17 +97,17 @@ def sync_detailed( def sync( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdateEnvironment, -) -> EnvironmentResponse | ErrorsList | None: +) -> Optional[Union[EnvironmentResponse, ErrorsList]]: """Update an environment Update a specific environment by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateEnvironment): Raises: @@ -118,7 +115,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - EnvironmentResponse | ErrorsList + Union[EnvironmentResponse, ErrorsList] """ return sync_detailed( @@ -129,17 +126,17 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdateEnvironment, -) -> Response[EnvironmentResponse | ErrorsList]: +) -> Response[Union[EnvironmentResponse, ErrorsList]]: """Update an environment Update a specific environment by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateEnvironment): Raises: @@ -147,7 +144,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[EnvironmentResponse | ErrorsList] + Response[Union[EnvironmentResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -161,17 +158,17 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdateEnvironment, -) -> EnvironmentResponse | ErrorsList | None: +) -> Optional[Union[EnvironmentResponse, ErrorsList]]: """Update an environment Update a specific environment by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateEnvironment): Raises: @@ -179,7 +176,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - EnvironmentResponse | ErrorsList + Union[EnvironmentResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/escalation_levels/delete_escalation_level.py b/rootly_sdk/api/escalation_levels/delete_escalation_level.py index 957eb67f..108f983c 100644 --- a/rootly_sdk/api/escalation_levels/delete_escalation_level.py +++ b/rootly_sdk/api/escalation_levels/delete_escalation_level.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/escalation_levels/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/escalation_levels/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | EscalationPolicyLevelResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, EscalationPolicyLevelResponse]]: if response.status_code == 200: response_200 = EscalationPolicyLevelResponse.from_dict(response.json()) @@ -45,8 +41,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | EscalationPolicyLevelResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, EscalationPolicyLevelResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | EscalationPolicyLevelResponse]: +) -> Response[Union[ErrorsList, EscalationPolicyLevelResponse]]: """Delete an escalation level Delete a specific escalation level by id @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | EscalationPolicyLevelResponse] + Response[Union[ErrorsList, EscalationPolicyLevelResponse]] """ kwargs = _get_kwargs( @@ -90,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | EscalationPolicyLevelResponse | None: +) -> Optional[Union[ErrorsList, EscalationPolicyLevelResponse]]: """Delete an escalation level Delete a specific escalation level by id @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | EscalationPolicyLevelResponse + Union[ErrorsList, EscalationPolicyLevelResponse] """ return sync_detailed( @@ -116,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | EscalationPolicyLevelResponse]: +) -> Response[Union[ErrorsList, EscalationPolicyLevelResponse]]: """Delete an escalation level Delete a specific escalation level by id @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | EscalationPolicyLevelResponse] + Response[Union[ErrorsList, EscalationPolicyLevelResponse]] """ kwargs = _get_kwargs( @@ -145,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | EscalationPolicyLevelResponse | None: +) -> Optional[Union[ErrorsList, EscalationPolicyLevelResponse]]: """Delete an escalation level Delete a specific escalation level by id @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | EscalationPolicyLevelResponse + Union[ErrorsList, EscalationPolicyLevelResponse] """ return ( diff --git a/rootly_sdk/api/escalation_levels/get_escalation_level.py b/rootly_sdk/api/escalation_levels/get_escalation_level.py index b8da372a..1886acef 100644 --- a/rootly_sdk/api/escalation_levels/get_escalation_level.py +++ b/rootly_sdk/api/escalation_levels/get_escalation_level.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/escalation_levels/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/escalation_levels/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | EscalationPolicyLevelResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, EscalationPolicyLevelResponse]]: if response.status_code == 200: response_200 = EscalationPolicyLevelResponse.from_dict(response.json()) @@ -45,8 +41,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | EscalationPolicyLevelResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, EscalationPolicyLevelResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | EscalationPolicyLevelResponse]: +) -> Response[Union[ErrorsList, EscalationPolicyLevelResponse]]: """Retrieves an escalation level Retrieves a specific escalation level by id @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | EscalationPolicyLevelResponse] + Response[Union[ErrorsList, EscalationPolicyLevelResponse]] """ kwargs = _get_kwargs( @@ -90,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | EscalationPolicyLevelResponse | None: +) -> Optional[Union[ErrorsList, EscalationPolicyLevelResponse]]: """Retrieves an escalation level Retrieves a specific escalation level by id @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | EscalationPolicyLevelResponse + Union[ErrorsList, EscalationPolicyLevelResponse] """ return sync_detailed( @@ -116,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | EscalationPolicyLevelResponse]: +) -> Response[Union[ErrorsList, EscalationPolicyLevelResponse]]: """Retrieves an escalation level Retrieves a specific escalation level by id @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | EscalationPolicyLevelResponse] + Response[Union[ErrorsList, EscalationPolicyLevelResponse]] """ kwargs = _get_kwargs( @@ -145,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | EscalationPolicyLevelResponse | None: +) -> Optional[Union[ErrorsList, EscalationPolicyLevelResponse]]: """Retrieves an escalation level Retrieves a specific escalation level by id @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | EscalationPolicyLevelResponse + Union[ErrorsList, EscalationPolicyLevelResponse] """ return ( diff --git a/rootly_sdk/api/escalation_levels/update_escalation_level.py b/rootly_sdk/api/escalation_levels/update_escalation_level.py index 880d0415..9e854c4b 100644 --- a/rootly_sdk/api/escalation_levels/update_escalation_level.py +++ b/rootly_sdk/api/escalation_levels/update_escalation_level.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/escalation_levels/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/escalation_levels/{id}", } _kwargs["json"] = body.to_dict() @@ -35,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | EscalationPolicyLevelResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, EscalationPolicyLevelResponse]]: if response.status_code == 200: response_200 = EscalationPolicyLevelResponse.from_dict(response.json()) @@ -54,8 +51,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | EscalationPolicyLevelResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, EscalationPolicyLevelResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateEscalationPolicyLevel, -) -> Response[ErrorsList | EscalationPolicyLevelResponse]: +) -> Response[Union[ErrorsList, EscalationPolicyLevelResponse]]: """Update an escalation level Update a specific escalation level by id @@ -83,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | EscalationPolicyLevelResponse] + Response[Union[ErrorsList, EscalationPolicyLevelResponse]] """ kwargs = _get_kwargs( @@ -103,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateEscalationPolicyLevel, -) -> ErrorsList | EscalationPolicyLevelResponse | None: +) -> Optional[Union[ErrorsList, EscalationPolicyLevelResponse]]: """Update an escalation level Update a specific escalation level by id @@ -117,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | EscalationPolicyLevelResponse + Union[ErrorsList, EscalationPolicyLevelResponse] """ return sync_detailed( @@ -132,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateEscalationPolicyLevel, -) -> Response[ErrorsList | EscalationPolicyLevelResponse]: +) -> Response[Union[ErrorsList, EscalationPolicyLevelResponse]]: """Update an escalation level Update a specific escalation level by id @@ -146,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | EscalationPolicyLevelResponse] + Response[Union[ErrorsList, EscalationPolicyLevelResponse]] """ kwargs = _get_kwargs( @@ -164,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateEscalationPolicyLevel, -) -> ErrorsList | EscalationPolicyLevelResponse | None: +) -> Optional[Union[ErrorsList, EscalationPolicyLevelResponse]]: """Update an escalation level Update a specific escalation level by id @@ -178,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | EscalationPolicyLevelResponse + Union[ErrorsList, EscalationPolicyLevelResponse] """ return ( diff --git a/rootly_sdk/api/escalation_levels_path/create_escalation_level_paths.py b/rootly_sdk/api/escalation_levels_path/create_escalation_level_paths.py index 9527978d..481053e5 100644 --- a/rootly_sdk/api/escalation_levels_path/create_escalation_level_paths.py +++ b/rootly_sdk/api/escalation_levels_path/create_escalation_level_paths.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/escalation_paths/{escalation_policy_path_id}/escalation_levels".format( - escalation_policy_path_id=quote(str(escalation_policy_path_id), safe=""), - ), + "url": f"/v1/escalation_paths/{escalation_policy_path_id}/escalation_levels", } _kwargs["json"] = body.to_dict() @@ -35,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | EscalationPolicyLevelResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, EscalationPolicyLevelResponse]]: if response.status_code == 201: response_201 = EscalationPolicyLevelResponse.from_dict(response.json()) @@ -59,8 +56,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | EscalationPolicyLevelResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, EscalationPolicyLevelResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -74,7 +71,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewEscalationPolicyLevel, -) -> Response[ErrorsList | EscalationPolicyLevelResponse]: +) -> Response[Union[ErrorsList, EscalationPolicyLevelResponse]]: """Creates an escalation level for an Escalation Path Creates a new escalation level from provided data @@ -88,7 +85,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | EscalationPolicyLevelResponse] + Response[Union[ErrorsList, EscalationPolicyLevelResponse]] """ kwargs = _get_kwargs( @@ -108,7 +105,7 @@ def sync( *, client: AuthenticatedClient, body: NewEscalationPolicyLevel, -) -> ErrorsList | EscalationPolicyLevelResponse | None: +) -> Optional[Union[ErrorsList, EscalationPolicyLevelResponse]]: """Creates an escalation level for an Escalation Path Creates a new escalation level from provided data @@ -122,7 +119,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | EscalationPolicyLevelResponse + Union[ErrorsList, EscalationPolicyLevelResponse] """ return sync_detailed( @@ -137,7 +134,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewEscalationPolicyLevel, -) -> Response[ErrorsList | EscalationPolicyLevelResponse]: +) -> Response[Union[ErrorsList, EscalationPolicyLevelResponse]]: """Creates an escalation level for an Escalation Path Creates a new escalation level from provided data @@ -151,7 +148,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | EscalationPolicyLevelResponse] + Response[Union[ErrorsList, EscalationPolicyLevelResponse]] """ kwargs = _get_kwargs( @@ -169,7 +166,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewEscalationPolicyLevel, -) -> ErrorsList | EscalationPolicyLevelResponse | None: +) -> Optional[Union[ErrorsList, EscalationPolicyLevelResponse]]: """Creates an escalation level for an Escalation Path Creates a new escalation level from provided data @@ -183,7 +180,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | EscalationPolicyLevelResponse + Union[ErrorsList, EscalationPolicyLevelResponse] """ return ( diff --git a/rootly_sdk/api/escalation_levels_path/list_escalation_levels_paths.py b/rootly_sdk/api/escalation_levels_path/list_escalation_levels_paths.py index 362d2739..947aa789 100644 --- a/rootly_sdk/api/escalation_levels_path/list_escalation_levels_paths.py +++ b/rootly_sdk/api/escalation_levels_path/list_escalation_levels_paths.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -13,11 +12,10 @@ def _get_kwargs( escalation_policy_path_id: str, *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -30,9 +28,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/escalation_paths/{escalation_policy_path_id}/escalation_levels".format( - escalation_policy_path_id=quote(str(escalation_policy_path_id), safe=""), - ), + "url": f"/v1/escalation_paths/{escalation_policy_path_id}/escalation_levels", "params": params, } @@ -40,8 +36,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> EscalationPolicyLevelList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[EscalationPolicyLevelList]: if response.status_code == 200: response_200 = EscalationPolicyLevelList.from_dict(response.json()) @@ -54,7 +50,7 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[EscalationPolicyLevelList]: return Response( status_code=HTTPStatus(response.status_code), @@ -68,9 +64,9 @@ def sync_detailed( escalation_policy_path_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, ) -> Response[EscalationPolicyLevelList]: """List escalation levels for an Escalation Path @@ -78,9 +74,9 @@ def sync_detailed( Args: escalation_policy_path_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -108,19 +104,19 @@ def sync( escalation_policy_path_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, -) -> EscalationPolicyLevelList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, +) -> Optional[EscalationPolicyLevelList]: """List escalation levels for an Escalation Path List escalation levels Args: escalation_policy_path_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -143,9 +139,9 @@ async def asyncio_detailed( escalation_policy_path_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, ) -> Response[EscalationPolicyLevelList]: """List escalation levels for an Escalation Path @@ -153,9 +149,9 @@ async def asyncio_detailed( Args: escalation_policy_path_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -181,19 +177,19 @@ async def asyncio( escalation_policy_path_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, -) -> EscalationPolicyLevelList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, +) -> Optional[EscalationPolicyLevelList]: """List escalation levels for an Escalation Path List escalation levels Args: escalation_policy_path_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/escalation_levels_policies/create_escalation_level.py b/rootly_sdk/api/escalation_levels_policies/create_escalation_level.py index 4132bf34..a5203b74 100644 --- a/rootly_sdk/api/escalation_levels_policies/create_escalation_level.py +++ b/rootly_sdk/api/escalation_levels_policies/create_escalation_level.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/escalation_policies/{escalation_policy_id}/escalation_levels".format( - escalation_policy_id=quote(str(escalation_policy_id), safe=""), - ), + "url": f"/v1/escalation_policies/{escalation_policy_id}/escalation_levels", } _kwargs["json"] = body.to_dict() @@ -35,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | EscalationPolicyLevelResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, EscalationPolicyLevelResponse]]: if response.status_code == 201: response_201 = EscalationPolicyLevelResponse.from_dict(response.json()) @@ -59,8 +56,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | EscalationPolicyLevelResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, EscalationPolicyLevelResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -74,7 +71,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewEscalationPolicyLevel, -) -> Response[ErrorsList | EscalationPolicyLevelResponse]: +) -> Response[Union[ErrorsList, EscalationPolicyLevelResponse]]: """Creates an escalation level for an Escalation Policy Creates a new escalation level from provided data @@ -88,7 +85,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | EscalationPolicyLevelResponse] + Response[Union[ErrorsList, EscalationPolicyLevelResponse]] """ kwargs = _get_kwargs( @@ -108,7 +105,7 @@ def sync( *, client: AuthenticatedClient, body: NewEscalationPolicyLevel, -) -> ErrorsList | EscalationPolicyLevelResponse | None: +) -> Optional[Union[ErrorsList, EscalationPolicyLevelResponse]]: """Creates an escalation level for an Escalation Policy Creates a new escalation level from provided data @@ -122,7 +119,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | EscalationPolicyLevelResponse + Union[ErrorsList, EscalationPolicyLevelResponse] """ return sync_detailed( @@ -137,7 +134,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewEscalationPolicyLevel, -) -> Response[ErrorsList | EscalationPolicyLevelResponse]: +) -> Response[Union[ErrorsList, EscalationPolicyLevelResponse]]: """Creates an escalation level for an Escalation Policy Creates a new escalation level from provided data @@ -151,7 +148,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | EscalationPolicyLevelResponse] + Response[Union[ErrorsList, EscalationPolicyLevelResponse]] """ kwargs = _get_kwargs( @@ -169,7 +166,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewEscalationPolicyLevel, -) -> ErrorsList | EscalationPolicyLevelResponse | None: +) -> Optional[Union[ErrorsList, EscalationPolicyLevelResponse]]: """Creates an escalation level for an Escalation Policy Creates a new escalation level from provided data @@ -183,7 +180,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | EscalationPolicyLevelResponse + Union[ErrorsList, EscalationPolicyLevelResponse] """ return ( diff --git a/rootly_sdk/api/escalation_levels_policies/list_escalation_levels.py b/rootly_sdk/api/escalation_levels_policies/list_escalation_levels.py index b6baf965..07a35e04 100644 --- a/rootly_sdk/api/escalation_levels_policies/list_escalation_levels.py +++ b/rootly_sdk/api/escalation_levels_policies/list_escalation_levels.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -13,11 +12,10 @@ def _get_kwargs( escalation_policy_id: str, *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -30,9 +28,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/escalation_policies/{escalation_policy_id}/escalation_levels".format( - escalation_policy_id=quote(str(escalation_policy_id), safe=""), - ), + "url": f"/v1/escalation_policies/{escalation_policy_id}/escalation_levels", "params": params, } @@ -40,8 +36,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> EscalationPolicyLevelList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[EscalationPolicyLevelList]: if response.status_code == 200: response_200 = EscalationPolicyLevelList.from_dict(response.json()) @@ -54,7 +50,7 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[EscalationPolicyLevelList]: return Response( status_code=HTTPStatus(response.status_code), @@ -68,9 +64,9 @@ def sync_detailed( escalation_policy_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, ) -> Response[EscalationPolicyLevelList]: """List escalation levels for an Escalation Policy @@ -78,9 +74,9 @@ def sync_detailed( Args: escalation_policy_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -108,19 +104,19 @@ def sync( escalation_policy_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, -) -> EscalationPolicyLevelList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, +) -> Optional[EscalationPolicyLevelList]: """List escalation levels for an Escalation Policy List escalation levels Args: escalation_policy_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -143,9 +139,9 @@ async def asyncio_detailed( escalation_policy_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, ) -> Response[EscalationPolicyLevelList]: """List escalation levels for an Escalation Policy @@ -153,9 +149,9 @@ async def asyncio_detailed( Args: escalation_policy_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -181,19 +177,19 @@ async def asyncio( escalation_policy_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, -) -> EscalationPolicyLevelList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, +) -> Optional[EscalationPolicyLevelList]: """List escalation levels for an Escalation Policy List escalation levels Args: escalation_policy_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/escalation_paths/create_escalation_path.py b/rootly_sdk/api/escalation_paths/create_escalation_path.py index 169f479f..be5a537d 100644 --- a/rootly_sdk/api/escalation_paths/create_escalation_path.py +++ b/rootly_sdk/api/escalation_paths/create_escalation_path.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/escalation_policies/{escalation_policy_id}/escalation_paths".format( - escalation_policy_id=quote(str(escalation_policy_id), safe=""), - ), + "url": f"/v1/escalation_policies/{escalation_policy_id}/escalation_paths", } _kwargs["json"] = body.to_dict() @@ -35,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | EscalationPolicyPathResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, EscalationPolicyPathResponse]]: if response.status_code == 201: response_201 = EscalationPolicyPathResponse.from_dict(response.json()) @@ -59,8 +56,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | EscalationPolicyPathResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, EscalationPolicyPathResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -74,7 +71,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewEscalationPolicyPath, -) -> Response[ErrorsList | EscalationPolicyPathResponse]: +) -> Response[Union[ErrorsList, EscalationPolicyPathResponse]]: """Creates an escalation path Creates a new escalation path from provided data @@ -88,7 +85,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | EscalationPolicyPathResponse] + Response[Union[ErrorsList, EscalationPolicyPathResponse]] """ kwargs = _get_kwargs( @@ -108,7 +105,7 @@ def sync( *, client: AuthenticatedClient, body: NewEscalationPolicyPath, -) -> ErrorsList | EscalationPolicyPathResponse | None: +) -> Optional[Union[ErrorsList, EscalationPolicyPathResponse]]: """Creates an escalation path Creates a new escalation path from provided data @@ -122,7 +119,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | EscalationPolicyPathResponse + Union[ErrorsList, EscalationPolicyPathResponse] """ return sync_detailed( @@ -137,7 +134,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewEscalationPolicyPath, -) -> Response[ErrorsList | EscalationPolicyPathResponse]: +) -> Response[Union[ErrorsList, EscalationPolicyPathResponse]]: """Creates an escalation path Creates a new escalation path from provided data @@ -151,7 +148,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | EscalationPolicyPathResponse] + Response[Union[ErrorsList, EscalationPolicyPathResponse]] """ kwargs = _get_kwargs( @@ -169,7 +166,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewEscalationPolicyPath, -) -> ErrorsList | EscalationPolicyPathResponse | None: +) -> Optional[Union[ErrorsList, EscalationPolicyPathResponse]]: """Creates an escalation path Creates a new escalation path from provided data @@ -183,7 +180,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | EscalationPolicyPathResponse + Union[ErrorsList, EscalationPolicyPathResponse] """ return ( diff --git a/rootly_sdk/api/escalation_paths/delete_escalation_path.py b/rootly_sdk/api/escalation_paths/delete_escalation_path.py index 8162cca8..a81287a1 100644 --- a/rootly_sdk/api/escalation_paths/delete_escalation_path.py +++ b/rootly_sdk/api/escalation_paths/delete_escalation_path.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/escalation_paths/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/escalation_paths/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | EscalationPolicyPathResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, EscalationPolicyPathResponse]]: if response.status_code == 200: response_200 = EscalationPolicyPathResponse.from_dict(response.json()) @@ -45,8 +41,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | EscalationPolicyPathResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, EscalationPolicyPathResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | EscalationPolicyPathResponse]: +) -> Response[Union[ErrorsList, EscalationPolicyPathResponse]]: """Delete an escalation path Delete a specific escalation path by id @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | EscalationPolicyPathResponse] + Response[Union[ErrorsList, EscalationPolicyPathResponse]] """ kwargs = _get_kwargs( @@ -90,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | EscalationPolicyPathResponse | None: +) -> Optional[Union[ErrorsList, EscalationPolicyPathResponse]]: """Delete an escalation path Delete a specific escalation path by id @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | EscalationPolicyPathResponse + Union[ErrorsList, EscalationPolicyPathResponse] """ return sync_detailed( @@ -116,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | EscalationPolicyPathResponse]: +) -> Response[Union[ErrorsList, EscalationPolicyPathResponse]]: """Delete an escalation path Delete a specific escalation path by id @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | EscalationPolicyPathResponse] + Response[Union[ErrorsList, EscalationPolicyPathResponse]] """ kwargs = _get_kwargs( @@ -145,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | EscalationPolicyPathResponse | None: +) -> Optional[Union[ErrorsList, EscalationPolicyPathResponse]]: """Delete an escalation path Delete a specific escalation path by id @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | EscalationPolicyPathResponse + Union[ErrorsList, EscalationPolicyPathResponse] """ return ( diff --git a/rootly_sdk/api/escalation_paths/get_escalation_path.py b/rootly_sdk/api/escalation_paths/get_escalation_path.py index 1735ff2f..05f73ee1 100644 --- a/rootly_sdk/api/escalation_paths/get_escalation_path.py +++ b/rootly_sdk/api/escalation_paths/get_escalation_path.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -15,12 +14,11 @@ def _get_kwargs( id: str, *, - include: GetEscalationPathInclude | Unset = UNSET, + include: Union[Unset, GetEscalationPathInclude] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} - json_include: str | Unset = UNSET + json_include: Union[Unset, str] = UNSET if not isinstance(include, Unset): json_include = include @@ -30,9 +28,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/escalation_paths/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/escalation_paths/{id}", "params": params, } @@ -40,8 +36,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | EscalationPolicyPathResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, EscalationPolicyPathResponse]]: if response.status_code == 200: response_200 = EscalationPolicyPathResponse.from_dict(response.json()) @@ -59,8 +55,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | EscalationPolicyPathResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, EscalationPolicyPathResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -73,22 +69,22 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, - include: GetEscalationPathInclude | Unset = UNSET, -) -> Response[ErrorsList | EscalationPolicyPathResponse]: + include: Union[Unset, GetEscalationPathInclude] = UNSET, +) -> Response[Union[ErrorsList, EscalationPolicyPathResponse]]: """Retrieves an escalation path Retrieves a specific escalation path by id Args: id (str): - include (GetEscalationPathInclude | Unset): + include (Union[Unset, GetEscalationPathInclude]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | EscalationPolicyPathResponse] + Response[Union[ErrorsList, EscalationPolicyPathResponse]] """ kwargs = _get_kwargs( @@ -107,22 +103,22 @@ def sync( id: str, *, client: AuthenticatedClient, - include: GetEscalationPathInclude | Unset = UNSET, -) -> ErrorsList | EscalationPolicyPathResponse | None: + include: Union[Unset, GetEscalationPathInclude] = UNSET, +) -> Optional[Union[ErrorsList, EscalationPolicyPathResponse]]: """Retrieves an escalation path Retrieves a specific escalation path by id Args: id (str): - include (GetEscalationPathInclude | Unset): + include (Union[Unset, GetEscalationPathInclude]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | EscalationPolicyPathResponse + Union[ErrorsList, EscalationPolicyPathResponse] """ return sync_detailed( @@ -136,22 +132,22 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, - include: GetEscalationPathInclude | Unset = UNSET, -) -> Response[ErrorsList | EscalationPolicyPathResponse]: + include: Union[Unset, GetEscalationPathInclude] = UNSET, +) -> Response[Union[ErrorsList, EscalationPolicyPathResponse]]: """Retrieves an escalation path Retrieves a specific escalation path by id Args: id (str): - include (GetEscalationPathInclude | Unset): + include (Union[Unset, GetEscalationPathInclude]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | EscalationPolicyPathResponse] + Response[Union[ErrorsList, EscalationPolicyPathResponse]] """ kwargs = _get_kwargs( @@ -168,22 +164,22 @@ async def asyncio( id: str, *, client: AuthenticatedClient, - include: GetEscalationPathInclude | Unset = UNSET, -) -> ErrorsList | EscalationPolicyPathResponse | None: + include: Union[Unset, GetEscalationPathInclude] = UNSET, +) -> Optional[Union[ErrorsList, EscalationPolicyPathResponse]]: """Retrieves an escalation path Retrieves a specific escalation path by id Args: id (str): - include (GetEscalationPathInclude | Unset): + include (Union[Unset, GetEscalationPathInclude]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | EscalationPolicyPathResponse + Union[ErrorsList, EscalationPolicyPathResponse] """ return ( diff --git a/rootly_sdk/api/escalation_paths/list_escalation_paths.py b/rootly_sdk/api/escalation_paths/list_escalation_paths.py index 43a4fcd8..e8a97b85 100644 --- a/rootly_sdk/api/escalation_paths/list_escalation_paths.py +++ b/rootly_sdk/api/escalation_paths/list_escalation_paths.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -17,21 +16,20 @@ def _get_kwargs( escalation_policy_id: str, *, - include: ListEscalationPathsInclude | Unset = UNSET, - filterpath_type: ListEscalationPathsFilterpathType | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Union[Unset, ListEscalationPathsInclude] = UNSET, + filterpath_type: Union[Unset, ListEscalationPathsFilterpathType] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} - json_include: str | Unset = UNSET + json_include: Union[Unset, str] = UNSET if not isinstance(include, Unset): json_include = include params["include"] = json_include - json_filterpath_type: str | Unset = UNSET + json_filterpath_type: Union[Unset, str] = UNSET if not isinstance(filterpath_type, Unset): json_filterpath_type = filterpath_type @@ -45,9 +43,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/escalation_policies/{escalation_policy_id}/escalation_paths".format( - escalation_policy_id=quote(str(escalation_policy_id), safe=""), - ), + "url": f"/v1/escalation_policies/{escalation_policy_id}/escalation_paths", "params": params, } @@ -55,8 +51,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> EscalationPolicyPathList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[EscalationPolicyPathList]: if response.status_code == 200: response_200 = EscalationPolicyPathList.from_dict(response.json()) @@ -69,7 +65,7 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[EscalationPolicyPathList]: return Response( status_code=HTTPStatus(response.status_code), @@ -83,10 +79,10 @@ def sync_detailed( escalation_policy_id: str, *, client: AuthenticatedClient, - include: ListEscalationPathsInclude | Unset = UNSET, - filterpath_type: ListEscalationPathsFilterpathType | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Union[Unset, ListEscalationPathsInclude] = UNSET, + filterpath_type: Union[Unset, ListEscalationPathsFilterpathType] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, ) -> Response[EscalationPolicyPathList]: """List escalation paths @@ -94,10 +90,10 @@ def sync_detailed( Args: escalation_policy_id (str): - include (ListEscalationPathsInclude | Unset): - filterpath_type (ListEscalationPathsFilterpathType | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, ListEscalationPathsInclude]): + filterpath_type (Union[Unset, ListEscalationPathsFilterpathType]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -126,21 +122,21 @@ def sync( escalation_policy_id: str, *, client: AuthenticatedClient, - include: ListEscalationPathsInclude | Unset = UNSET, - filterpath_type: ListEscalationPathsFilterpathType | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, -) -> EscalationPolicyPathList | None: + include: Union[Unset, ListEscalationPathsInclude] = UNSET, + filterpath_type: Union[Unset, ListEscalationPathsFilterpathType] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, +) -> Optional[EscalationPolicyPathList]: """List escalation paths List escalation paths Args: escalation_policy_id (str): - include (ListEscalationPathsInclude | Unset): - filterpath_type (ListEscalationPathsFilterpathType | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, ListEscalationPathsInclude]): + filterpath_type (Union[Unset, ListEscalationPathsFilterpathType]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -164,10 +160,10 @@ async def asyncio_detailed( escalation_policy_id: str, *, client: AuthenticatedClient, - include: ListEscalationPathsInclude | Unset = UNSET, - filterpath_type: ListEscalationPathsFilterpathType | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Union[Unset, ListEscalationPathsInclude] = UNSET, + filterpath_type: Union[Unset, ListEscalationPathsFilterpathType] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, ) -> Response[EscalationPolicyPathList]: """List escalation paths @@ -175,10 +171,10 @@ async def asyncio_detailed( Args: escalation_policy_id (str): - include (ListEscalationPathsInclude | Unset): - filterpath_type (ListEscalationPathsFilterpathType | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, ListEscalationPathsInclude]): + filterpath_type (Union[Unset, ListEscalationPathsFilterpathType]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -205,21 +201,21 @@ async def asyncio( escalation_policy_id: str, *, client: AuthenticatedClient, - include: ListEscalationPathsInclude | Unset = UNSET, - filterpath_type: ListEscalationPathsFilterpathType | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, -) -> EscalationPolicyPathList | None: + include: Union[Unset, ListEscalationPathsInclude] = UNSET, + filterpath_type: Union[Unset, ListEscalationPathsFilterpathType] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, +) -> Optional[EscalationPolicyPathList]: """List escalation paths List escalation paths Args: escalation_policy_id (str): - include (ListEscalationPathsInclude | Unset): - filterpath_type (ListEscalationPathsFilterpathType | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, ListEscalationPathsInclude]): + filterpath_type (Union[Unset, ListEscalationPathsFilterpathType]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/escalation_paths/update_escalation_path.py b/rootly_sdk/api/escalation_paths/update_escalation_path.py index ccbf345f..1f0fa8a4 100644 --- a/rootly_sdk/api/escalation_paths/update_escalation_path.py +++ b/rootly_sdk/api/escalation_paths/update_escalation_path.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/escalation_paths/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/escalation_paths/{id}", } _kwargs["json"] = body.to_dict() @@ -35,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | EscalationPolicyPathResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, EscalationPolicyPathResponse]]: if response.status_code == 200: response_200 = EscalationPolicyPathResponse.from_dict(response.json()) @@ -54,8 +51,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | EscalationPolicyPathResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, EscalationPolicyPathResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateEscalationPolicyPath, -) -> Response[ErrorsList | EscalationPolicyPathResponse]: +) -> Response[Union[ErrorsList, EscalationPolicyPathResponse]]: """Update an escalation path Update a specific escalation path by id @@ -83,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | EscalationPolicyPathResponse] + Response[Union[ErrorsList, EscalationPolicyPathResponse]] """ kwargs = _get_kwargs( @@ -103,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateEscalationPolicyPath, -) -> ErrorsList | EscalationPolicyPathResponse | None: +) -> Optional[Union[ErrorsList, EscalationPolicyPathResponse]]: """Update an escalation path Update a specific escalation path by id @@ -117,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | EscalationPolicyPathResponse + Union[ErrorsList, EscalationPolicyPathResponse] """ return sync_detailed( @@ -132,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateEscalationPolicyPath, -) -> Response[ErrorsList | EscalationPolicyPathResponse]: +) -> Response[Union[ErrorsList, EscalationPolicyPathResponse]]: """Update an escalation path Update a specific escalation path by id @@ -146,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | EscalationPolicyPathResponse] + Response[Union[ErrorsList, EscalationPolicyPathResponse]] """ kwargs = _get_kwargs( @@ -164,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateEscalationPolicyPath, -) -> ErrorsList | EscalationPolicyPathResponse | None: +) -> Optional[Union[ErrorsList, EscalationPolicyPathResponse]]: """Update an escalation path Update a specific escalation path by id @@ -178,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | EscalationPolicyPathResponse + Union[ErrorsList, EscalationPolicyPathResponse] """ return ( diff --git a/rootly_sdk/api/escalation_policies/create_escalation_policy.py b/rootly_sdk/api/escalation_policies/create_escalation_policy.py index 714b4503..8c61e2bf 100644 --- a/rootly_sdk/api/escalation_policies/create_escalation_policy.py +++ b/rootly_sdk/api/escalation_policies/create_escalation_policy.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | EscalationPolicyResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, EscalationPolicyResponse]]: if response.status_code == 201: response_201 = EscalationPolicyResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | EscalationPolicyResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, EscalationPolicyResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +69,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewEscalationPolicy, -) -> Response[ErrorsList | EscalationPolicyResponse]: +) -> Response[Union[ErrorsList, EscalationPolicyResponse]]: """Creates an escalation policy Creates a new escalation policy from provided data @@ -82,7 +82,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | EscalationPolicyResponse] + Response[Union[ErrorsList, EscalationPolicyResponse]] """ kwargs = _get_kwargs( @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: NewEscalationPolicy, -) -> ErrorsList | EscalationPolicyResponse | None: +) -> Optional[Union[ErrorsList, EscalationPolicyResponse]]: """Creates an escalation policy Creates a new escalation policy from provided data @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | EscalationPolicyResponse + Union[ErrorsList, EscalationPolicyResponse] """ return sync_detailed( @@ -126,7 +126,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewEscalationPolicy, -) -> Response[ErrorsList | EscalationPolicyResponse]: +) -> Response[Union[ErrorsList, EscalationPolicyResponse]]: """Creates an escalation policy Creates a new escalation policy from provided data @@ -139,7 +139,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | EscalationPolicyResponse] + Response[Union[ErrorsList, EscalationPolicyResponse]] """ kwargs = _get_kwargs( @@ -155,7 +155,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewEscalationPolicy, -) -> ErrorsList | EscalationPolicyResponse | None: +) -> Optional[Union[ErrorsList, EscalationPolicyResponse]]: """Creates an escalation policy Creates a new escalation policy from provided data @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | EscalationPolicyResponse + Union[ErrorsList, EscalationPolicyResponse] """ return ( diff --git a/rootly_sdk/api/escalation_policies/delete_escalation_policy.py b/rootly_sdk/api/escalation_policies/delete_escalation_policy.py index 2c40b934..b6a7f55f 100644 --- a/rootly_sdk/api/escalation_policies/delete_escalation_policy.py +++ b/rootly_sdk/api/escalation_policies/delete_escalation_policy.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/escalation_policies/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/escalation_policies/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | EscalationPolicyResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, EscalationPolicyResponse]]: if response.status_code == 200: response_200 = EscalationPolicyResponse.from_dict(response.json()) @@ -45,8 +41,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | EscalationPolicyResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, EscalationPolicyResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | EscalationPolicyResponse]: +) -> Response[Union[ErrorsList, EscalationPolicyResponse]]: """Delete an escalation policy Delete a specific escalation policy by id @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | EscalationPolicyResponse] + Response[Union[ErrorsList, EscalationPolicyResponse]] """ kwargs = _get_kwargs( @@ -90,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | EscalationPolicyResponse | None: +) -> Optional[Union[ErrorsList, EscalationPolicyResponse]]: """Delete an escalation policy Delete a specific escalation policy by id @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | EscalationPolicyResponse + Union[ErrorsList, EscalationPolicyResponse] """ return sync_detailed( @@ -116,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | EscalationPolicyResponse]: +) -> Response[Union[ErrorsList, EscalationPolicyResponse]]: """Delete an escalation policy Delete a specific escalation policy by id @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | EscalationPolicyResponse] + Response[Union[ErrorsList, EscalationPolicyResponse]] """ kwargs = _get_kwargs( @@ -145,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | EscalationPolicyResponse | None: +) -> Optional[Union[ErrorsList, EscalationPolicyResponse]]: """Delete an escalation policy Delete a specific escalation policy by id @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | EscalationPolicyResponse + Union[ErrorsList, EscalationPolicyResponse] """ return ( diff --git a/rootly_sdk/api/escalation_policies/get_escalation_policy.py b/rootly_sdk/api/escalation_policies/get_escalation_policy.py index e17a0ca0..2037e6b8 100644 --- a/rootly_sdk/api/escalation_policies/get_escalation_policy.py +++ b/rootly_sdk/api/escalation_policies/get_escalation_policy.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -15,12 +14,11 @@ def _get_kwargs( id: str, *, - include: GetEscalationPolicyInclude | Unset = UNSET, + include: Union[Unset, GetEscalationPolicyInclude] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} - json_include: str | Unset = UNSET + json_include: Union[Unset, str] = UNSET if not isinstance(include, Unset): json_include = include @@ -30,9 +28,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/escalation_policies/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/escalation_policies/{id}", "params": params, } @@ -40,8 +36,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | EscalationPolicyResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, EscalationPolicyResponse]]: if response.status_code == 200: response_200 = EscalationPolicyResponse.from_dict(response.json()) @@ -59,8 +55,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | EscalationPolicyResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, EscalationPolicyResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -73,22 +69,22 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, - include: GetEscalationPolicyInclude | Unset = UNSET, -) -> Response[ErrorsList | EscalationPolicyResponse]: + include: Union[Unset, GetEscalationPolicyInclude] = UNSET, +) -> Response[Union[ErrorsList, EscalationPolicyResponse]]: """Retrieves an escalation policy Retrieves a specific escalation policy by id Args: id (str): - include (GetEscalationPolicyInclude | Unset): + include (Union[Unset, GetEscalationPolicyInclude]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | EscalationPolicyResponse] + Response[Union[ErrorsList, EscalationPolicyResponse]] """ kwargs = _get_kwargs( @@ -107,22 +103,22 @@ def sync( id: str, *, client: AuthenticatedClient, - include: GetEscalationPolicyInclude | Unset = UNSET, -) -> ErrorsList | EscalationPolicyResponse | None: + include: Union[Unset, GetEscalationPolicyInclude] = UNSET, +) -> Optional[Union[ErrorsList, EscalationPolicyResponse]]: """Retrieves an escalation policy Retrieves a specific escalation policy by id Args: id (str): - include (GetEscalationPolicyInclude | Unset): + include (Union[Unset, GetEscalationPolicyInclude]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | EscalationPolicyResponse + Union[ErrorsList, EscalationPolicyResponse] """ return sync_detailed( @@ -136,22 +132,22 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, - include: GetEscalationPolicyInclude | Unset = UNSET, -) -> Response[ErrorsList | EscalationPolicyResponse]: + include: Union[Unset, GetEscalationPolicyInclude] = UNSET, +) -> Response[Union[ErrorsList, EscalationPolicyResponse]]: """Retrieves an escalation policy Retrieves a specific escalation policy by id Args: id (str): - include (GetEscalationPolicyInclude | Unset): + include (Union[Unset, GetEscalationPolicyInclude]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | EscalationPolicyResponse] + Response[Union[ErrorsList, EscalationPolicyResponse]] """ kwargs = _get_kwargs( @@ -168,22 +164,22 @@ async def asyncio( id: str, *, client: AuthenticatedClient, - include: GetEscalationPolicyInclude | Unset = UNSET, -) -> ErrorsList | EscalationPolicyResponse | None: + include: Union[Unset, GetEscalationPolicyInclude] = UNSET, +) -> Optional[Union[ErrorsList, EscalationPolicyResponse]]: """Retrieves an escalation policy Retrieves a specific escalation policy by id Args: id (str): - include (GetEscalationPolicyInclude | Unset): + include (Union[Unset, GetEscalationPolicyInclude]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | EscalationPolicyResponse + Union[ErrorsList, EscalationPolicyResponse] """ return ( diff --git a/rootly_sdk/api/escalation_policies/list_escalation_policies.py b/rootly_sdk/api/escalation_policies/list_escalation_policies.py index 28e01db1..c4116c19 100644 --- a/rootly_sdk/api/escalation_policies/list_escalation_policies.py +++ b/rootly_sdk/api/escalation_policies/list_escalation_policies.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -14,29 +14,28 @@ def _get_kwargs( *, - include: ListEscalationPoliciesInclude | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterteam_ids: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filterteam_idseq: str | Unset = UNSET, - filterteam_idsnot_eq: str | Unset = UNSET, - filterteam_idsin: str | Unset = UNSET, - filterteam_idsnot_in: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Union[Unset, ListEscalationPoliciesInclude] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterteam_ids: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, + filterteam_idseq: Union[Unset, str] = UNSET, + filterteam_idsnot_eq: Union[Unset, str] = UNSET, + filterteam_idsin: Union[Unset, str] = UNSET, + filterteam_idsnot_in: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} - json_include: str | Unset = UNSET + json_include: Union[Unset, str] = UNSET if not isinstance(include, Unset): json_include = include @@ -87,7 +86,9 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> EscalationPolicyList | None: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[EscalationPolicyList]: if response.status_code == 200: response_200 = EscalationPolicyList.from_dict(response.json()) @@ -100,7 +101,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[EscalationPolicyList]: return Response( status_code=HTTPStatus(response.status_code), @@ -113,48 +114,48 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - include: ListEscalationPoliciesInclude | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterteam_ids: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filterteam_idseq: str | Unset = UNSET, - filterteam_idsnot_eq: str | Unset = UNSET, - filterteam_idsin: str | Unset = UNSET, - filterteam_idsnot_in: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Union[Unset, ListEscalationPoliciesInclude] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterteam_ids: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, + filterteam_idseq: Union[Unset, str] = UNSET, + filterteam_idsnot_eq: Union[Unset, str] = UNSET, + filterteam_idsin: Union[Unset, str] = UNSET, + filterteam_idsnot_in: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, ) -> Response[EscalationPolicyList]: """List escalation policies List escalation policies Args: - include (ListEscalationPoliciesInclude | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterteam_ids (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filterteam_idseq (str | Unset): - filterteam_idsnot_eq (str | Unset): - filterteam_idsin (str | Unset): - filterteam_idsnot_in (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, ListEscalationPoliciesInclude]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterteam_ids (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filterteam_idseq (Union[Unset, str]): + filterteam_idsnot_eq (Union[Unset, str]): + filterteam_idsin (Union[Unset, str]): + filterteam_idsnot_in (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -195,48 +196,48 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: ListEscalationPoliciesInclude | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterteam_ids: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filterteam_idseq: str | Unset = UNSET, - filterteam_idsnot_eq: str | Unset = UNSET, - filterteam_idsin: str | Unset = UNSET, - filterteam_idsnot_in: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, -) -> EscalationPolicyList | None: + include: Union[Unset, ListEscalationPoliciesInclude] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterteam_ids: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, + filterteam_idseq: Union[Unset, str] = UNSET, + filterteam_idsnot_eq: Union[Unset, str] = UNSET, + filterteam_idsin: Union[Unset, str] = UNSET, + filterteam_idsnot_in: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, +) -> Optional[EscalationPolicyList]: """List escalation policies List escalation policies Args: - include (ListEscalationPoliciesInclude | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterteam_ids (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filterteam_idseq (str | Unset): - filterteam_idsnot_eq (str | Unset): - filterteam_idsin (str | Unset): - filterteam_idsnot_in (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, ListEscalationPoliciesInclude]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterteam_ids (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filterteam_idseq (Union[Unset, str]): + filterteam_idsnot_eq (Union[Unset, str]): + filterteam_idsin (Union[Unset, str]): + filterteam_idsnot_in (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -272,48 +273,48 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: ListEscalationPoliciesInclude | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterteam_ids: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filterteam_idseq: str | Unset = UNSET, - filterteam_idsnot_eq: str | Unset = UNSET, - filterteam_idsin: str | Unset = UNSET, - filterteam_idsnot_in: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Union[Unset, ListEscalationPoliciesInclude] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterteam_ids: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, + filterteam_idseq: Union[Unset, str] = UNSET, + filterteam_idsnot_eq: Union[Unset, str] = UNSET, + filterteam_idsin: Union[Unset, str] = UNSET, + filterteam_idsnot_in: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, ) -> Response[EscalationPolicyList]: """List escalation policies List escalation policies Args: - include (ListEscalationPoliciesInclude | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterteam_ids (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filterteam_idseq (str | Unset): - filterteam_idsnot_eq (str | Unset): - filterteam_idsin (str | Unset): - filterteam_idsnot_in (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, ListEscalationPoliciesInclude]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterteam_ids (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filterteam_idseq (Union[Unset, str]): + filterteam_idsnot_eq (Union[Unset, str]): + filterteam_idsin (Union[Unset, str]): + filterteam_idsnot_in (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -352,48 +353,48 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: ListEscalationPoliciesInclude | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterteam_ids: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filterteam_idseq: str | Unset = UNSET, - filterteam_idsnot_eq: str | Unset = UNSET, - filterteam_idsin: str | Unset = UNSET, - filterteam_idsnot_in: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, -) -> EscalationPolicyList | None: + include: Union[Unset, ListEscalationPoliciesInclude] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterteam_ids: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, + filterteam_idseq: Union[Unset, str] = UNSET, + filterteam_idsnot_eq: Union[Unset, str] = UNSET, + filterteam_idsin: Union[Unset, str] = UNSET, + filterteam_idsnot_in: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, +) -> Optional[EscalationPolicyList]: """List escalation policies List escalation policies Args: - include (ListEscalationPoliciesInclude | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterteam_ids (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filterteam_idseq (str | Unset): - filterteam_idsnot_eq (str | Unset): - filterteam_idsin (str | Unset): - filterteam_idsnot_in (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, ListEscalationPoliciesInclude]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterteam_ids (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filterteam_idseq (Union[Unset, str]): + filterteam_idsnot_eq (Union[Unset, str]): + filterteam_idsin (Union[Unset, str]): + filterteam_idsnot_in (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/escalation_policies/update_escalation_policy.py b/rootly_sdk/api/escalation_policies/update_escalation_policy.py index d779d41b..72c99902 100644 --- a/rootly_sdk/api/escalation_policies/update_escalation_policy.py +++ b/rootly_sdk/api/escalation_policies/update_escalation_policy.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/escalation_policies/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/escalation_policies/{id}", } _kwargs["json"] = body.to_dict() @@ -35,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | EscalationPolicyResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, EscalationPolicyResponse]]: if response.status_code == 200: response_200 = EscalationPolicyResponse.from_dict(response.json()) @@ -54,8 +51,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | EscalationPolicyResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, EscalationPolicyResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateEscalationPolicy, -) -> Response[ErrorsList | EscalationPolicyResponse]: +) -> Response[Union[ErrorsList, EscalationPolicyResponse]]: """Update an escalation policy Update a specific escalation policy by id @@ -83,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | EscalationPolicyResponse] + Response[Union[ErrorsList, EscalationPolicyResponse]] """ kwargs = _get_kwargs( @@ -103,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateEscalationPolicy, -) -> ErrorsList | EscalationPolicyResponse | None: +) -> Optional[Union[ErrorsList, EscalationPolicyResponse]]: """Update an escalation policy Update a specific escalation policy by id @@ -117,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | EscalationPolicyResponse + Union[ErrorsList, EscalationPolicyResponse] """ return sync_detailed( @@ -132,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateEscalationPolicy, -) -> Response[ErrorsList | EscalationPolicyResponse]: +) -> Response[Union[ErrorsList, EscalationPolicyResponse]]: """Update an escalation policy Update a specific escalation policy by id @@ -146,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | EscalationPolicyResponse] + Response[Union[ErrorsList, EscalationPolicyResponse]] """ kwargs = _get_kwargs( @@ -164,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateEscalationPolicy, -) -> ErrorsList | EscalationPolicyResponse | None: +) -> Optional[Union[ErrorsList, EscalationPolicyResponse]]: """Update an escalation policy Update a specific escalation policy by id @@ -178,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | EscalationPolicyResponse + Union[ErrorsList, EscalationPolicyResponse] """ return ( diff --git a/rootly_sdk/api/form_field_options/create_form_field_option.py b/rootly_sdk/api/form_field_options/create_form_field_option.py index f403634b..57b1e452 100644 --- a/rootly_sdk/api/form_field_options/create_form_field_option.py +++ b/rootly_sdk/api/form_field_options/create_form_field_option.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/form_fields/{form_field_id}/options".format( - form_field_id=quote(str(form_field_id), safe=""), - ), + "url": f"/v1/form_fields/{form_field_id}/options", } _kwargs["json"] = body.to_dict() @@ -35,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | FormFieldOptionResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, FormFieldOptionResponse]]: if response.status_code == 201: response_201 = FormFieldOptionResponse.from_dict(response.json()) @@ -59,8 +56,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | FormFieldOptionResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, FormFieldOptionResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -74,7 +71,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewFormFieldOption, -) -> Response[ErrorsList | FormFieldOptionResponse]: +) -> Response[Union[ErrorsList, FormFieldOptionResponse]]: """Creates FormField Options Creates a new form_field_option from provided data @@ -88,7 +85,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FormFieldOptionResponse] + Response[Union[ErrorsList, FormFieldOptionResponse]] """ kwargs = _get_kwargs( @@ -108,7 +105,7 @@ def sync( *, client: AuthenticatedClient, body: NewFormFieldOption, -) -> ErrorsList | FormFieldOptionResponse | None: +) -> Optional[Union[ErrorsList, FormFieldOptionResponse]]: """Creates FormField Options Creates a new form_field_option from provided data @@ -122,7 +119,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FormFieldOptionResponse + Union[ErrorsList, FormFieldOptionResponse] """ return sync_detailed( @@ -137,7 +134,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewFormFieldOption, -) -> Response[ErrorsList | FormFieldOptionResponse]: +) -> Response[Union[ErrorsList, FormFieldOptionResponse]]: """Creates FormField Options Creates a new form_field_option from provided data @@ -151,7 +148,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FormFieldOptionResponse] + Response[Union[ErrorsList, FormFieldOptionResponse]] """ kwargs = _get_kwargs( @@ -169,7 +166,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewFormFieldOption, -) -> ErrorsList | FormFieldOptionResponse | None: +) -> Optional[Union[ErrorsList, FormFieldOptionResponse]]: """Creates FormField Options Creates a new form_field_option from provided data @@ -183,7 +180,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FormFieldOptionResponse + Union[ErrorsList, FormFieldOptionResponse] """ return ( diff --git a/rootly_sdk/api/form_field_options/delete_form_field_option.py b/rootly_sdk/api/form_field_options/delete_form_field_option.py index 7475c4c1..1570e14e 100644 --- a/rootly_sdk/api/form_field_options/delete_form_field_option.py +++ b/rootly_sdk/api/form_field_options/delete_form_field_option.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/form_field_options/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/form_field_options/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | FormFieldOptionResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, FormFieldOptionResponse]]: if response.status_code == 200: response_200 = FormFieldOptionResponse.from_dict(response.json()) @@ -45,8 +41,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | FormFieldOptionResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, FormFieldOptionResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | FormFieldOptionResponse]: +) -> Response[Union[ErrorsList, FormFieldOptionResponse]]: """Delete FormField Options Delete a specific form_field_option by id @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FormFieldOptionResponse] + Response[Union[ErrorsList, FormFieldOptionResponse]] """ kwargs = _get_kwargs( @@ -90,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | FormFieldOptionResponse | None: +) -> Optional[Union[ErrorsList, FormFieldOptionResponse]]: """Delete FormField Options Delete a specific form_field_option by id @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FormFieldOptionResponse + Union[ErrorsList, FormFieldOptionResponse] """ return sync_detailed( @@ -116,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | FormFieldOptionResponse]: +) -> Response[Union[ErrorsList, FormFieldOptionResponse]]: """Delete FormField Options Delete a specific form_field_option by id @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FormFieldOptionResponse] + Response[Union[ErrorsList, FormFieldOptionResponse]] """ kwargs = _get_kwargs( @@ -145,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | FormFieldOptionResponse | None: +) -> Optional[Union[ErrorsList, FormFieldOptionResponse]]: """Delete FormField Options Delete a specific form_field_option by id @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FormFieldOptionResponse + Union[ErrorsList, FormFieldOptionResponse] """ return ( diff --git a/rootly_sdk/api/form_field_options/get_form_field_option.py b/rootly_sdk/api/form_field_options/get_form_field_option.py index 6b07adca..71b50416 100644 --- a/rootly_sdk/api/form_field_options/get_form_field_option.py +++ b/rootly_sdk/api/form_field_options/get_form_field_option.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/form_field_options/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/form_field_options/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | FormFieldOptionResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, FormFieldOptionResponse]]: if response.status_code == 200: response_200 = FormFieldOptionResponse.from_dict(response.json()) @@ -45,8 +41,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | FormFieldOptionResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, FormFieldOptionResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | FormFieldOptionResponse]: +) -> Response[Union[ErrorsList, FormFieldOptionResponse]]: """Retrieves FormField Options Retrieves a specific form_field_option by id @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FormFieldOptionResponse] + Response[Union[ErrorsList, FormFieldOptionResponse]] """ kwargs = _get_kwargs( @@ -90,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | FormFieldOptionResponse | None: +) -> Optional[Union[ErrorsList, FormFieldOptionResponse]]: """Retrieves FormField Options Retrieves a specific form_field_option by id @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FormFieldOptionResponse + Union[ErrorsList, FormFieldOptionResponse] """ return sync_detailed( @@ -116,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | FormFieldOptionResponse]: +) -> Response[Union[ErrorsList, FormFieldOptionResponse]]: """Retrieves FormField Options Retrieves a specific form_field_option by id @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FormFieldOptionResponse] + Response[Union[ErrorsList, FormFieldOptionResponse]] """ kwargs = _get_kwargs( @@ -145,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | FormFieldOptionResponse | None: +) -> Optional[Union[ErrorsList, FormFieldOptionResponse]]: """Retrieves FormField Options Retrieves a specific form_field_option by id @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FormFieldOptionResponse + Union[ErrorsList, FormFieldOptionResponse] """ return ( diff --git a/rootly_sdk/api/form_field_options/list_form_field_options.py b/rootly_sdk/api/form_field_options/list_form_field_options.py index 9acb8d0b..c5ea6e83 100644 --- a/rootly_sdk/api/form_field_options/list_form_field_options.py +++ b/rootly_sdk/api/form_field_options/list_form_field_options.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -13,13 +12,12 @@ def _get_kwargs( form_field_id: str, *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtervalue: str | Unset = UNSET, - filtercolor: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtervalue: Union[Unset, str] = UNSET, + filtercolor: Union[Unset, str] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -36,16 +34,16 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/form_fields/{form_field_id}/options".format( - form_field_id=quote(str(form_field_id), safe=""), - ), + "url": f"/v1/form_fields/{form_field_id}/options", "params": params, } return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> FormFieldOptionList | None: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[FormFieldOptionList]: if response.status_code == 200: response_200 = FormFieldOptionList.from_dict(response.json()) @@ -57,7 +55,9 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[FormFieldOptionList]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[FormFieldOptionList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -70,11 +70,11 @@ def sync_detailed( form_field_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtervalue: str | Unset = UNSET, - filtercolor: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtervalue: Union[Unset, str] = UNSET, + filtercolor: Union[Unset, str] = UNSET, ) -> Response[FormFieldOptionList]: """List FormField Options @@ -82,11 +82,11 @@ def sync_detailed( Args: form_field_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtervalue (str | Unset): - filtercolor (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtervalue (Union[Unset, str]): + filtercolor (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -116,23 +116,23 @@ def sync( form_field_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtervalue: str | Unset = UNSET, - filtercolor: str | Unset = UNSET, -) -> FormFieldOptionList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtervalue: Union[Unset, str] = UNSET, + filtercolor: Union[Unset, str] = UNSET, +) -> Optional[FormFieldOptionList]: """List FormField Options List form_field_options Args: form_field_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtervalue (str | Unset): - filtercolor (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtervalue (Union[Unset, str]): + filtercolor (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -157,11 +157,11 @@ async def asyncio_detailed( form_field_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtervalue: str | Unset = UNSET, - filtercolor: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtervalue: Union[Unset, str] = UNSET, + filtercolor: Union[Unset, str] = UNSET, ) -> Response[FormFieldOptionList]: """List FormField Options @@ -169,11 +169,11 @@ async def asyncio_detailed( Args: form_field_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtervalue (str | Unset): - filtercolor (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtervalue (Union[Unset, str]): + filtercolor (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -201,23 +201,23 @@ async def asyncio( form_field_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtervalue: str | Unset = UNSET, - filtercolor: str | Unset = UNSET, -) -> FormFieldOptionList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtervalue: Union[Unset, str] = UNSET, + filtercolor: Union[Unset, str] = UNSET, +) -> Optional[FormFieldOptionList]: """List FormField Options List form_field_options Args: form_field_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtervalue (str | Unset): - filtercolor (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtervalue (Union[Unset, str]): + filtercolor (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/form_field_options/update_form_field_option.py b/rootly_sdk/api/form_field_options/update_form_field_option.py index 246e39f3..603badf4 100644 --- a/rootly_sdk/api/form_field_options/update_form_field_option.py +++ b/rootly_sdk/api/form_field_options/update_form_field_option.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/form_field_options/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/form_field_options/{id}", } _kwargs["json"] = body.to_dict() @@ -35,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | FormFieldOptionResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, FormFieldOptionResponse]]: if response.status_code == 200: response_200 = FormFieldOptionResponse.from_dict(response.json()) @@ -54,8 +51,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | FormFieldOptionResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, FormFieldOptionResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateFormFieldOption, -) -> Response[ErrorsList | FormFieldOptionResponse]: +) -> Response[Union[ErrorsList, FormFieldOptionResponse]]: """Update FormField Options Update a specific form_field_option by id @@ -83,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FormFieldOptionResponse] + Response[Union[ErrorsList, FormFieldOptionResponse]] """ kwargs = _get_kwargs( @@ -103,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateFormFieldOption, -) -> ErrorsList | FormFieldOptionResponse | None: +) -> Optional[Union[ErrorsList, FormFieldOptionResponse]]: """Update FormField Options Update a specific form_field_option by id @@ -117,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FormFieldOptionResponse + Union[ErrorsList, FormFieldOptionResponse] """ return sync_detailed( @@ -132,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateFormFieldOption, -) -> Response[ErrorsList | FormFieldOptionResponse]: +) -> Response[Union[ErrorsList, FormFieldOptionResponse]]: """Update FormField Options Update a specific form_field_option by id @@ -146,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FormFieldOptionResponse] + Response[Union[ErrorsList, FormFieldOptionResponse]] """ kwargs = _get_kwargs( @@ -164,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateFormFieldOption, -) -> ErrorsList | FormFieldOptionResponse | None: +) -> Optional[Union[ErrorsList, FormFieldOptionResponse]]: """Update FormField Options Update a specific form_field_option by id @@ -178,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FormFieldOptionResponse + Union[ErrorsList, FormFieldOptionResponse] """ return ( diff --git a/rootly_sdk/api/form_field_placement_conditions/create_form_field_placement_condition.py b/rootly_sdk/api/form_field_placement_conditions/create_form_field_placement_condition.py index 014965e1..f6a660a4 100644 --- a/rootly_sdk/api/form_field_placement_conditions/create_form_field_placement_condition.py +++ b/rootly_sdk/api/form_field_placement_conditions/create_form_field_placement_condition.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/form_field_placements/{form_field_placement_id}/conditions".format( - form_field_placement_id=quote(str(form_field_placement_id), safe=""), - ), + "url": f"/v1/form_field_placements/{form_field_placement_id}/conditions", } _kwargs["json"] = body.to_dict() @@ -35,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | FormFieldPlacementConditionResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, FormFieldPlacementConditionResponse]]: if response.status_code == 201: response_201 = FormFieldPlacementConditionResponse.from_dict(response.json()) @@ -59,8 +56,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | FormFieldPlacementConditionResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, FormFieldPlacementConditionResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -74,7 +71,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewFormFieldPlacementCondition, -) -> Response[ErrorsList | FormFieldPlacementConditionResponse]: +) -> Response[Union[ErrorsList, FormFieldPlacementConditionResponse]]: """Creates a Form Set Condition Creates a new form_field_placement_condition from provided data @@ -88,7 +85,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FormFieldPlacementConditionResponse] + Response[Union[ErrorsList, FormFieldPlacementConditionResponse]] """ kwargs = _get_kwargs( @@ -108,7 +105,7 @@ def sync( *, client: AuthenticatedClient, body: NewFormFieldPlacementCondition, -) -> ErrorsList | FormFieldPlacementConditionResponse | None: +) -> Optional[Union[ErrorsList, FormFieldPlacementConditionResponse]]: """Creates a Form Set Condition Creates a new form_field_placement_condition from provided data @@ -122,7 +119,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FormFieldPlacementConditionResponse + Union[ErrorsList, FormFieldPlacementConditionResponse] """ return sync_detailed( @@ -137,7 +134,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewFormFieldPlacementCondition, -) -> Response[ErrorsList | FormFieldPlacementConditionResponse]: +) -> Response[Union[ErrorsList, FormFieldPlacementConditionResponse]]: """Creates a Form Set Condition Creates a new form_field_placement_condition from provided data @@ -151,7 +148,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FormFieldPlacementConditionResponse] + Response[Union[ErrorsList, FormFieldPlacementConditionResponse]] """ kwargs = _get_kwargs( @@ -169,7 +166,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewFormFieldPlacementCondition, -) -> ErrorsList | FormFieldPlacementConditionResponse | None: +) -> Optional[Union[ErrorsList, FormFieldPlacementConditionResponse]]: """Creates a Form Set Condition Creates a new form_field_placement_condition from provided data @@ -183,7 +180,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FormFieldPlacementConditionResponse + Union[ErrorsList, FormFieldPlacementConditionResponse] """ return ( diff --git a/rootly_sdk/api/form_field_placement_conditions/delete_form_field_placement_condition.py b/rootly_sdk/api/form_field_placement_conditions/delete_form_field_placement_condition.py index 568253ab..0eb7fc5e 100644 --- a/rootly_sdk/api/form_field_placement_conditions/delete_form_field_placement_condition.py +++ b/rootly_sdk/api/form_field_placement_conditions/delete_form_field_placement_condition.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/form_field_placement_conditions/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/form_field_placement_conditions/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | FormFieldPlacementConditionResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, FormFieldPlacementConditionResponse]]: if response.status_code == 200: response_200 = FormFieldPlacementConditionResponse.from_dict(response.json()) @@ -45,8 +41,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | FormFieldPlacementConditionResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, FormFieldPlacementConditionResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | FormFieldPlacementConditionResponse]: +) -> Response[Union[ErrorsList, FormFieldPlacementConditionResponse]]: """Delete a Form Set Condition Delete a specific form_field_placement_condition by id @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FormFieldPlacementConditionResponse] + Response[Union[ErrorsList, FormFieldPlacementConditionResponse]] """ kwargs = _get_kwargs( @@ -90,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | FormFieldPlacementConditionResponse | None: +) -> Optional[Union[ErrorsList, FormFieldPlacementConditionResponse]]: """Delete a Form Set Condition Delete a specific form_field_placement_condition by id @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FormFieldPlacementConditionResponse + Union[ErrorsList, FormFieldPlacementConditionResponse] """ return sync_detailed( @@ -116,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | FormFieldPlacementConditionResponse]: +) -> Response[Union[ErrorsList, FormFieldPlacementConditionResponse]]: """Delete a Form Set Condition Delete a specific form_field_placement_condition by id @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FormFieldPlacementConditionResponse] + Response[Union[ErrorsList, FormFieldPlacementConditionResponse]] """ kwargs = _get_kwargs( @@ -145,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | FormFieldPlacementConditionResponse | None: +) -> Optional[Union[ErrorsList, FormFieldPlacementConditionResponse]]: """Delete a Form Set Condition Delete a specific form_field_placement_condition by id @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FormFieldPlacementConditionResponse + Union[ErrorsList, FormFieldPlacementConditionResponse] """ return ( diff --git a/rootly_sdk/api/form_field_placement_conditions/get_form_field_placement_condition.py b/rootly_sdk/api/form_field_placement_conditions/get_form_field_placement_condition.py index 8d6e2170..19026f81 100644 --- a/rootly_sdk/api/form_field_placement_conditions/get_form_field_placement_condition.py +++ b/rootly_sdk/api/form_field_placement_conditions/get_form_field_placement_condition.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/form_field_placement_conditions/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/form_field_placement_conditions/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | FormFieldPlacementConditionResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, FormFieldPlacementConditionResponse]]: if response.status_code == 200: response_200 = FormFieldPlacementConditionResponse.from_dict(response.json()) @@ -45,8 +41,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | FormFieldPlacementConditionResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, FormFieldPlacementConditionResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | FormFieldPlacementConditionResponse]: +) -> Response[Union[ErrorsList, FormFieldPlacementConditionResponse]]: """Retrieves a Form Set Condition Retrieves a specific form_field_placement_condition by id @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FormFieldPlacementConditionResponse] + Response[Union[ErrorsList, FormFieldPlacementConditionResponse]] """ kwargs = _get_kwargs( @@ -90,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | FormFieldPlacementConditionResponse | None: +) -> Optional[Union[ErrorsList, FormFieldPlacementConditionResponse]]: """Retrieves a Form Set Condition Retrieves a specific form_field_placement_condition by id @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FormFieldPlacementConditionResponse + Union[ErrorsList, FormFieldPlacementConditionResponse] """ return sync_detailed( @@ -116,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | FormFieldPlacementConditionResponse]: +) -> Response[Union[ErrorsList, FormFieldPlacementConditionResponse]]: """Retrieves a Form Set Condition Retrieves a specific form_field_placement_condition by id @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FormFieldPlacementConditionResponse] + Response[Union[ErrorsList, FormFieldPlacementConditionResponse]] """ kwargs = _get_kwargs( @@ -145,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | FormFieldPlacementConditionResponse | None: +) -> Optional[Union[ErrorsList, FormFieldPlacementConditionResponse]]: """Retrieves a Form Set Condition Retrieves a specific form_field_placement_condition by id @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FormFieldPlacementConditionResponse + Union[ErrorsList, FormFieldPlacementConditionResponse] """ return ( diff --git a/rootly_sdk/api/form_field_placement_conditions/list_form_field_placement_conditions.py b/rootly_sdk/api/form_field_placement_conditions/list_form_field_placement_conditions.py index 5730bb1d..882973e3 100644 --- a/rootly_sdk/api/form_field_placement_conditions/list_form_field_placement_conditions.py +++ b/rootly_sdk/api/form_field_placement_conditions/list_form_field_placement_conditions.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -13,12 +12,11 @@ def _get_kwargs( form_field_placement_id: str, *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterform_field_id: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterform_field_id: Union[Unset, str] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -33,9 +31,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/form_field_placements/{form_field_placement_id}/conditions".format( - form_field_placement_id=quote(str(form_field_placement_id), safe=""), - ), + "url": f"/v1/form_field_placements/{form_field_placement_id}/conditions", "params": params, } @@ -43,8 +39,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> FormFieldPlacementConditionList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[FormFieldPlacementConditionList]: if response.status_code == 200: response_200 = FormFieldPlacementConditionList.from_dict(response.json()) @@ -57,7 +53,7 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[FormFieldPlacementConditionList]: return Response( status_code=HTTPStatus(response.status_code), @@ -71,10 +67,10 @@ def sync_detailed( form_field_placement_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterform_field_id: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterform_field_id: Union[Unset, str] = UNSET, ) -> Response[FormFieldPlacementConditionList]: """List Form Set Conditions @@ -82,10 +78,10 @@ def sync_detailed( Args: form_field_placement_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterform_field_id (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterform_field_id (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -114,21 +110,21 @@ def sync( form_field_placement_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterform_field_id: str | Unset = UNSET, -) -> FormFieldPlacementConditionList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterform_field_id: Union[Unset, str] = UNSET, +) -> Optional[FormFieldPlacementConditionList]: """List Form Set Conditions List form_field_placement_conditions Args: form_field_placement_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterform_field_id (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterform_field_id (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -152,10 +148,10 @@ async def asyncio_detailed( form_field_placement_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterform_field_id: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterform_field_id: Union[Unset, str] = UNSET, ) -> Response[FormFieldPlacementConditionList]: """List Form Set Conditions @@ -163,10 +159,10 @@ async def asyncio_detailed( Args: form_field_placement_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterform_field_id (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterform_field_id (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -193,21 +189,21 @@ async def asyncio( form_field_placement_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterform_field_id: str | Unset = UNSET, -) -> FormFieldPlacementConditionList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterform_field_id: Union[Unset, str] = UNSET, +) -> Optional[FormFieldPlacementConditionList]: """List Form Set Conditions List form_field_placement_conditions Args: form_field_placement_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterform_field_id (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterform_field_id (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/form_field_placement_conditions/update_form_field_placement_condition.py b/rootly_sdk/api/form_field_placement_conditions/update_form_field_placement_condition.py index a9fe050c..25352fce 100644 --- a/rootly_sdk/api/form_field_placement_conditions/update_form_field_placement_condition.py +++ b/rootly_sdk/api/form_field_placement_conditions/update_form_field_placement_condition.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/form_field_placement_conditions/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/form_field_placement_conditions/{id}", } _kwargs["json"] = body.to_dict() @@ -35,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | FormFieldPlacementConditionResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, FormFieldPlacementConditionResponse]]: if response.status_code == 200: response_200 = FormFieldPlacementConditionResponse.from_dict(response.json()) @@ -54,8 +51,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | FormFieldPlacementConditionResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, FormFieldPlacementConditionResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateFormFieldPlacementCondition, -) -> Response[ErrorsList | FormFieldPlacementConditionResponse]: +) -> Response[Union[ErrorsList, FormFieldPlacementConditionResponse]]: """Update a Form Set Condition Update a specific form_field_placement_condition by id @@ -83,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FormFieldPlacementConditionResponse] + Response[Union[ErrorsList, FormFieldPlacementConditionResponse]] """ kwargs = _get_kwargs( @@ -103,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateFormFieldPlacementCondition, -) -> ErrorsList | FormFieldPlacementConditionResponse | None: +) -> Optional[Union[ErrorsList, FormFieldPlacementConditionResponse]]: """Update a Form Set Condition Update a specific form_field_placement_condition by id @@ -117,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FormFieldPlacementConditionResponse + Union[ErrorsList, FormFieldPlacementConditionResponse] """ return sync_detailed( @@ -132,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateFormFieldPlacementCondition, -) -> Response[ErrorsList | FormFieldPlacementConditionResponse]: +) -> Response[Union[ErrorsList, FormFieldPlacementConditionResponse]]: """Update a Form Set Condition Update a specific form_field_placement_condition by id @@ -146,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FormFieldPlacementConditionResponse] + Response[Union[ErrorsList, FormFieldPlacementConditionResponse]] """ kwargs = _get_kwargs( @@ -164,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateFormFieldPlacementCondition, -) -> ErrorsList | FormFieldPlacementConditionResponse | None: +) -> Optional[Union[ErrorsList, FormFieldPlacementConditionResponse]]: """Update a Form Set Condition Update a specific form_field_placement_condition by id @@ -178,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FormFieldPlacementConditionResponse + Union[ErrorsList, FormFieldPlacementConditionResponse] """ return ( diff --git a/rootly_sdk/api/form_field_placements/create_form_field_placement.py b/rootly_sdk/api/form_field_placements/create_form_field_placement.py index 247a26a7..35bfce1b 100644 --- a/rootly_sdk/api/form_field_placements/create_form_field_placement.py +++ b/rootly_sdk/api/form_field_placements/create_form_field_placement.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/form_fields/{form_field_id}/placements".format( - form_field_id=quote(str(form_field_id), safe=""), - ), + "url": f"/v1/form_fields/{form_field_id}/placements", } _kwargs["json"] = body.to_dict() @@ -35,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | FormFieldPlacementResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, FormFieldPlacementResponse]]: if response.status_code == 201: response_201 = FormFieldPlacementResponse.from_dict(response.json()) @@ -59,8 +56,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | FormFieldPlacementResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, FormFieldPlacementResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -74,7 +71,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewFormFieldPlacement, -) -> Response[ErrorsList | FormFieldPlacementResponse]: +) -> Response[Union[ErrorsList, FormFieldPlacementResponse]]: """Creates a Form Field Placement Creates a new form_field_placement from provided data @@ -88,7 +85,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FormFieldPlacementResponse] + Response[Union[ErrorsList, FormFieldPlacementResponse]] """ kwargs = _get_kwargs( @@ -108,7 +105,7 @@ def sync( *, client: AuthenticatedClient, body: NewFormFieldPlacement, -) -> ErrorsList | FormFieldPlacementResponse | None: +) -> Optional[Union[ErrorsList, FormFieldPlacementResponse]]: """Creates a Form Field Placement Creates a new form_field_placement from provided data @@ -122,7 +119,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FormFieldPlacementResponse + Union[ErrorsList, FormFieldPlacementResponse] """ return sync_detailed( @@ -137,7 +134,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewFormFieldPlacement, -) -> Response[ErrorsList | FormFieldPlacementResponse]: +) -> Response[Union[ErrorsList, FormFieldPlacementResponse]]: """Creates a Form Field Placement Creates a new form_field_placement from provided data @@ -151,7 +148,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FormFieldPlacementResponse] + Response[Union[ErrorsList, FormFieldPlacementResponse]] """ kwargs = _get_kwargs( @@ -169,7 +166,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewFormFieldPlacement, -) -> ErrorsList | FormFieldPlacementResponse | None: +) -> Optional[Union[ErrorsList, FormFieldPlacementResponse]]: """Creates a Form Field Placement Creates a new form_field_placement from provided data @@ -183,7 +180,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FormFieldPlacementResponse + Union[ErrorsList, FormFieldPlacementResponse] """ return ( diff --git a/rootly_sdk/api/form_field_placements/delete_form_field_placement.py b/rootly_sdk/api/form_field_placements/delete_form_field_placement.py index 424eeaa0..1cae6093 100644 --- a/rootly_sdk/api/form_field_placements/delete_form_field_placement.py +++ b/rootly_sdk/api/form_field_placements/delete_form_field_placement.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/form_field_placements/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/form_field_placements/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | FormFieldPlacementResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, FormFieldPlacementResponse]]: if response.status_code == 200: response_200 = FormFieldPlacementResponse.from_dict(response.json()) @@ -45,8 +41,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | FormFieldPlacementResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, FormFieldPlacementResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | FormFieldPlacementResponse]: +) -> Response[Union[ErrorsList, FormFieldPlacementResponse]]: """Delete a Form Field Placement Delete a specific form_field_placement by id @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FormFieldPlacementResponse] + Response[Union[ErrorsList, FormFieldPlacementResponse]] """ kwargs = _get_kwargs( @@ -90,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | FormFieldPlacementResponse | None: +) -> Optional[Union[ErrorsList, FormFieldPlacementResponse]]: """Delete a Form Field Placement Delete a specific form_field_placement by id @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FormFieldPlacementResponse + Union[ErrorsList, FormFieldPlacementResponse] """ return sync_detailed( @@ -116,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | FormFieldPlacementResponse]: +) -> Response[Union[ErrorsList, FormFieldPlacementResponse]]: """Delete a Form Field Placement Delete a specific form_field_placement by id @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FormFieldPlacementResponse] + Response[Union[ErrorsList, FormFieldPlacementResponse]] """ kwargs = _get_kwargs( @@ -145,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | FormFieldPlacementResponse | None: +) -> Optional[Union[ErrorsList, FormFieldPlacementResponse]]: """Delete a Form Field Placement Delete a specific form_field_placement by id @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FormFieldPlacementResponse + Union[ErrorsList, FormFieldPlacementResponse] """ return ( diff --git a/rootly_sdk/api/form_field_placements/get_form_field_placement.py b/rootly_sdk/api/form_field_placements/get_form_field_placement.py index 0d9e7d4e..83cfc9e1 100644 --- a/rootly_sdk/api/form_field_placements/get_form_field_placement.py +++ b/rootly_sdk/api/form_field_placements/get_form_field_placement.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/form_field_placements/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/form_field_placements/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | FormFieldPlacementResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, FormFieldPlacementResponse]]: if response.status_code == 200: response_200 = FormFieldPlacementResponse.from_dict(response.json()) @@ -45,8 +41,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | FormFieldPlacementResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, FormFieldPlacementResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | FormFieldPlacementResponse]: +) -> Response[Union[ErrorsList, FormFieldPlacementResponse]]: """Retrieves a Form Field Placement Retrieves a specific form_field_placement by id @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FormFieldPlacementResponse] + Response[Union[ErrorsList, FormFieldPlacementResponse]] """ kwargs = _get_kwargs( @@ -90,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | FormFieldPlacementResponse | None: +) -> Optional[Union[ErrorsList, FormFieldPlacementResponse]]: """Retrieves a Form Field Placement Retrieves a specific form_field_placement by id @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FormFieldPlacementResponse + Union[ErrorsList, FormFieldPlacementResponse] """ return sync_detailed( @@ -116,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | FormFieldPlacementResponse]: +) -> Response[Union[ErrorsList, FormFieldPlacementResponse]]: """Retrieves a Form Field Placement Retrieves a specific form_field_placement by id @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FormFieldPlacementResponse] + Response[Union[ErrorsList, FormFieldPlacementResponse]] """ kwargs = _get_kwargs( @@ -145,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | FormFieldPlacementResponse | None: +) -> Optional[Union[ErrorsList, FormFieldPlacementResponse]]: """Retrieves a Form Field Placement Retrieves a specific form_field_placement by id @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FormFieldPlacementResponse + Union[ErrorsList, FormFieldPlacementResponse] """ return ( diff --git a/rootly_sdk/api/form_field_placements/list_form_field_placements.py b/rootly_sdk/api/form_field_placements/list_form_field_placements.py index cfc35101..09872d3b 100644 --- a/rootly_sdk/api/form_field_placements/list_form_field_placements.py +++ b/rootly_sdk/api/form_field_placements/list_form_field_placements.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -13,12 +12,11 @@ def _get_kwargs( form_field_id: str, *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterform_field_id: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterform_field_id: Union[Unset, str] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -33,16 +31,16 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/form_fields/{form_field_id}/placements".format( - form_field_id=quote(str(form_field_id), safe=""), - ), + "url": f"/v1/form_fields/{form_field_id}/placements", "params": params, } return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> FormFieldPlacementList | None: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[FormFieldPlacementList]: if response.status_code == 200: response_200 = FormFieldPlacementList.from_dict(response.json()) @@ -55,7 +53,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[FormFieldPlacementList]: return Response( status_code=HTTPStatus(response.status_code), @@ -69,10 +67,10 @@ def sync_detailed( form_field_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterform_field_id: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterform_field_id: Union[Unset, str] = UNSET, ) -> Response[FormFieldPlacementList]: """List Form Field Placements @@ -80,10 +78,10 @@ def sync_detailed( Args: form_field_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterform_field_id (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterform_field_id (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -112,21 +110,21 @@ def sync( form_field_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterform_field_id: str | Unset = UNSET, -) -> FormFieldPlacementList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterform_field_id: Union[Unset, str] = UNSET, +) -> Optional[FormFieldPlacementList]: """List Form Field Placements List form_field_placements Args: form_field_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterform_field_id (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterform_field_id (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -150,10 +148,10 @@ async def asyncio_detailed( form_field_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterform_field_id: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterform_field_id: Union[Unset, str] = UNSET, ) -> Response[FormFieldPlacementList]: """List Form Field Placements @@ -161,10 +159,10 @@ async def asyncio_detailed( Args: form_field_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterform_field_id (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterform_field_id (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -191,21 +189,21 @@ async def asyncio( form_field_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterform_field_id: str | Unset = UNSET, -) -> FormFieldPlacementList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterform_field_id: Union[Unset, str] = UNSET, +) -> Optional[FormFieldPlacementList]: """List Form Field Placements List form_field_placements Args: form_field_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterform_field_id (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterform_field_id (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/form_field_placements/update_form_field_placement.py b/rootly_sdk/api/form_field_placements/update_form_field_placement.py index 47e84275..1a82b14b 100644 --- a/rootly_sdk/api/form_field_placements/update_form_field_placement.py +++ b/rootly_sdk/api/form_field_placements/update_form_field_placement.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/form_field_placements/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/form_field_placements/{id}", } _kwargs["json"] = body.to_dict() @@ -35,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | FormFieldPlacementResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, FormFieldPlacementResponse]]: if response.status_code == 200: response_200 = FormFieldPlacementResponse.from_dict(response.json()) @@ -59,8 +56,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | FormFieldPlacementResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, FormFieldPlacementResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -74,7 +71,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateFormFieldPlacement, -) -> Response[ErrorsList | FormFieldPlacementResponse]: +) -> Response[Union[ErrorsList, FormFieldPlacementResponse]]: """Update a Form Field Placement Update a specific form_field_placement by id @@ -88,7 +85,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FormFieldPlacementResponse] + Response[Union[ErrorsList, FormFieldPlacementResponse]] """ kwargs = _get_kwargs( @@ -108,7 +105,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateFormFieldPlacement, -) -> ErrorsList | FormFieldPlacementResponse | None: +) -> Optional[Union[ErrorsList, FormFieldPlacementResponse]]: """Update a Form Field Placement Update a specific form_field_placement by id @@ -122,7 +119,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FormFieldPlacementResponse + Union[ErrorsList, FormFieldPlacementResponse] """ return sync_detailed( @@ -137,7 +134,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateFormFieldPlacement, -) -> Response[ErrorsList | FormFieldPlacementResponse]: +) -> Response[Union[ErrorsList, FormFieldPlacementResponse]]: """Update a Form Field Placement Update a specific form_field_placement by id @@ -151,7 +148,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FormFieldPlacementResponse] + Response[Union[ErrorsList, FormFieldPlacementResponse]] """ kwargs = _get_kwargs( @@ -169,7 +166,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateFormFieldPlacement, -) -> ErrorsList | FormFieldPlacementResponse | None: +) -> Optional[Union[ErrorsList, FormFieldPlacementResponse]]: """Update a Form Field Placement Update a specific form_field_placement by id @@ -183,7 +180,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FormFieldPlacementResponse + Union[ErrorsList, FormFieldPlacementResponse] """ return ( diff --git a/rootly_sdk/api/form_field_positions/create_form_field_position.py b/rootly_sdk/api/form_field_positions/create_form_field_position.py index baa834ef..78bc3b12 100644 --- a/rootly_sdk/api/form_field_positions/create_form_field_position.py +++ b/rootly_sdk/api/form_field_positions/create_form_field_position.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/form_fields/{form_field_id}/positions".format( - form_field_id=quote(str(form_field_id), safe=""), - ), + "url": f"/v1/form_fields/{form_field_id}/positions", } _kwargs["json"] = body.to_dict() @@ -35,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | FormFieldPositionResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, FormFieldPositionResponse]]: if response.status_code == 201: response_201 = FormFieldPositionResponse.from_dict(response.json()) @@ -59,8 +56,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | FormFieldPositionResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, FormFieldPositionResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -74,7 +71,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewFormFieldPosition, -) -> Response[ErrorsList | FormFieldPositionResponse]: +) -> Response[Union[ErrorsList, FormFieldPositionResponse]]: """Creates FormField Positions Creates a new form field_position from provided data @@ -88,7 +85,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FormFieldPositionResponse] + Response[Union[ErrorsList, FormFieldPositionResponse]] """ kwargs = _get_kwargs( @@ -108,7 +105,7 @@ def sync( *, client: AuthenticatedClient, body: NewFormFieldPosition, -) -> ErrorsList | FormFieldPositionResponse | None: +) -> Optional[Union[ErrorsList, FormFieldPositionResponse]]: """Creates FormField Positions Creates a new form field_position from provided data @@ -122,7 +119,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FormFieldPositionResponse + Union[ErrorsList, FormFieldPositionResponse] """ return sync_detailed( @@ -137,7 +134,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewFormFieldPosition, -) -> Response[ErrorsList | FormFieldPositionResponse]: +) -> Response[Union[ErrorsList, FormFieldPositionResponse]]: """Creates FormField Positions Creates a new form field_position from provided data @@ -151,7 +148,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FormFieldPositionResponse] + Response[Union[ErrorsList, FormFieldPositionResponse]] """ kwargs = _get_kwargs( @@ -169,7 +166,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewFormFieldPosition, -) -> ErrorsList | FormFieldPositionResponse | None: +) -> Optional[Union[ErrorsList, FormFieldPositionResponse]]: """Creates FormField Positions Creates a new form field_position from provided data @@ -183,7 +180,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FormFieldPositionResponse + Union[ErrorsList, FormFieldPositionResponse] """ return ( diff --git a/rootly_sdk/api/form_field_positions/delete_form_field_position.py b/rootly_sdk/api/form_field_positions/delete_form_field_position.py index e4c0d5a2..1466a269 100644 --- a/rootly_sdk/api/form_field_positions/delete_form_field_position.py +++ b/rootly_sdk/api/form_field_positions/delete_form_field_position.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/form_field_positions/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/form_field_positions/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | FormFieldPositionResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, FormFieldPositionResponse]]: if response.status_code == 200: response_200 = FormFieldPositionResponse.from_dict(response.json()) @@ -45,8 +41,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | FormFieldPositionResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, FormFieldPositionResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | FormFieldPositionResponse]: +) -> Response[Union[ErrorsList, FormFieldPositionResponse]]: """Delete a FormFieldPosition Delete a specific form_field position by id @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FormFieldPositionResponse] + Response[Union[ErrorsList, FormFieldPositionResponse]] """ kwargs = _get_kwargs( @@ -90,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | FormFieldPositionResponse | None: +) -> Optional[Union[ErrorsList, FormFieldPositionResponse]]: """Delete a FormFieldPosition Delete a specific form_field position by id @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FormFieldPositionResponse + Union[ErrorsList, FormFieldPositionResponse] """ return sync_detailed( @@ -116,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | FormFieldPositionResponse]: +) -> Response[Union[ErrorsList, FormFieldPositionResponse]]: """Delete a FormFieldPosition Delete a specific form_field position by id @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FormFieldPositionResponse] + Response[Union[ErrorsList, FormFieldPositionResponse]] """ kwargs = _get_kwargs( @@ -145,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | FormFieldPositionResponse | None: +) -> Optional[Union[ErrorsList, FormFieldPositionResponse]]: """Delete a FormFieldPosition Delete a specific form_field position by id @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FormFieldPositionResponse + Union[ErrorsList, FormFieldPositionResponse] """ return ( diff --git a/rootly_sdk/api/form_field_positions/get_form_field_position.py b/rootly_sdk/api/form_field_positions/get_form_field_position.py index 999abfae..4d75ebe2 100644 --- a/rootly_sdk/api/form_field_positions/get_form_field_position.py +++ b/rootly_sdk/api/form_field_positions/get_form_field_position.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/form_field_positions/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/form_field_positions/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | FormFieldPositionResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, FormFieldPositionResponse]]: if response.status_code == 200: response_200 = FormFieldPositionResponse.from_dict(response.json()) @@ -45,8 +41,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | FormFieldPositionResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, FormFieldPositionResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | FormFieldPositionResponse]: +) -> Response[Union[ErrorsList, FormFieldPositionResponse]]: """Retrieves a FormFieldPosition Retrieves a specific form field_position by id @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FormFieldPositionResponse] + Response[Union[ErrorsList, FormFieldPositionResponse]] """ kwargs = _get_kwargs( @@ -90,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | FormFieldPositionResponse | None: +) -> Optional[Union[ErrorsList, FormFieldPositionResponse]]: """Retrieves a FormFieldPosition Retrieves a specific form field_position by id @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FormFieldPositionResponse + Union[ErrorsList, FormFieldPositionResponse] """ return sync_detailed( @@ -116,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | FormFieldPositionResponse]: +) -> Response[Union[ErrorsList, FormFieldPositionResponse]]: """Retrieves a FormFieldPosition Retrieves a specific form field_position by id @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FormFieldPositionResponse] + Response[Union[ErrorsList, FormFieldPositionResponse]] """ kwargs = _get_kwargs( @@ -145,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | FormFieldPositionResponse | None: +) -> Optional[Union[ErrorsList, FormFieldPositionResponse]]: """Retrieves a FormFieldPosition Retrieves a specific form field_position by id @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FormFieldPositionResponse + Union[ErrorsList, FormFieldPositionResponse] """ return ( diff --git a/rootly_sdk/api/form_field_positions/list_form_field_positions.py b/rootly_sdk/api/form_field_positions/list_form_field_positions.py index cb81b62a..38d25f2a 100644 --- a/rootly_sdk/api/form_field_positions/list_form_field_positions.py +++ b/rootly_sdk/api/form_field_positions/list_form_field_positions.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -13,12 +12,11 @@ def _get_kwargs( form_field_id: str, *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterform: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterform: Union[Unset, str] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -33,16 +31,16 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/form_fields/{form_field_id}/positions".format( - form_field_id=quote(str(form_field_id), safe=""), - ), + "url": f"/v1/form_fields/{form_field_id}/positions", "params": params, } return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> FormFieldPositionList | None: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[FormFieldPositionList]: if response.status_code == 200: response_200 = FormFieldPositionList.from_dict(response.json()) @@ -55,7 +53,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[FormFieldPositionList]: return Response( status_code=HTTPStatus(response.status_code), @@ -69,10 +67,10 @@ def sync_detailed( form_field_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterform: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterform: Union[Unset, str] = UNSET, ) -> Response[FormFieldPositionList]: """List FormField Position @@ -80,10 +78,10 @@ def sync_detailed( Args: form_field_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterform (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterform (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -112,21 +110,21 @@ def sync( form_field_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterform: str | Unset = UNSET, -) -> FormFieldPositionList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterform: Union[Unset, str] = UNSET, +) -> Optional[FormFieldPositionList]: """List FormField Position List form field positions Args: form_field_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterform (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterform (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -150,10 +148,10 @@ async def asyncio_detailed( form_field_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterform: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterform: Union[Unset, str] = UNSET, ) -> Response[FormFieldPositionList]: """List FormField Position @@ -161,10 +159,10 @@ async def asyncio_detailed( Args: form_field_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterform (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterform (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -191,21 +189,21 @@ async def asyncio( form_field_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterform: str | Unset = UNSET, -) -> FormFieldPositionList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterform: Union[Unset, str] = UNSET, +) -> Optional[FormFieldPositionList]: """List FormField Position List form field positions Args: form_field_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterform (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterform (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/form_field_positions/update_form_field_position.py b/rootly_sdk/api/form_field_positions/update_form_field_position.py index 71c94ee0..8783d7ed 100644 --- a/rootly_sdk/api/form_field_positions/update_form_field_position.py +++ b/rootly_sdk/api/form_field_positions/update_form_field_position.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/form_field_positions/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/form_field_positions/{id}", } _kwargs["json"] = body.to_dict() @@ -35,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | FormFieldPositionResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, FormFieldPositionResponse]]: if response.status_code == 200: response_200 = FormFieldPositionResponse.from_dict(response.json()) @@ -59,8 +56,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | FormFieldPositionResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, FormFieldPositionResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -74,7 +71,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateFormFieldPosition, -) -> Response[ErrorsList | FormFieldPositionResponse]: +) -> Response[Union[ErrorsList, FormFieldPositionResponse]]: """Update a FormFieldPosition Update a specific form_field position by id @@ -88,7 +85,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FormFieldPositionResponse] + Response[Union[ErrorsList, FormFieldPositionResponse]] """ kwargs = _get_kwargs( @@ -108,7 +105,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateFormFieldPosition, -) -> ErrorsList | FormFieldPositionResponse | None: +) -> Optional[Union[ErrorsList, FormFieldPositionResponse]]: """Update a FormFieldPosition Update a specific form_field position by id @@ -122,7 +119,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FormFieldPositionResponse + Union[ErrorsList, FormFieldPositionResponse] """ return sync_detailed( @@ -137,7 +134,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateFormFieldPosition, -) -> Response[ErrorsList | FormFieldPositionResponse]: +) -> Response[Union[ErrorsList, FormFieldPositionResponse]]: """Update a FormFieldPosition Update a specific form_field position by id @@ -151,7 +148,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FormFieldPositionResponse] + Response[Union[ErrorsList, FormFieldPositionResponse]] """ kwargs = _get_kwargs( @@ -169,7 +166,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateFormFieldPosition, -) -> ErrorsList | FormFieldPositionResponse | None: +) -> Optional[Union[ErrorsList, FormFieldPositionResponse]]: """Update a FormFieldPosition Update a specific form_field position by id @@ -183,7 +180,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FormFieldPositionResponse + Union[ErrorsList, FormFieldPositionResponse] """ return ( diff --git a/rootly_sdk/api/form_fields/create_form_field.py b/rootly_sdk/api/form_fields/create_form_field.py index c2069472..045e4010 100644 --- a/rootly_sdk/api/form_fields/create_form_field.py +++ b/rootly_sdk/api/form_fields/create_form_field.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | FormFieldResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, FormFieldResponse]]: if response.status_code == 201: response_201 = FormFieldResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | FormFieldResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, FormFieldResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +69,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewFormField, -) -> Response[ErrorsList | FormFieldResponse]: +) -> Response[Union[ErrorsList, FormFieldResponse]]: """Creates a Form Field Creates a new form_field from provided data @@ -82,7 +82,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FormFieldResponse] + Response[Union[ErrorsList, FormFieldResponse]] """ kwargs = _get_kwargs( @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: NewFormField, -) -> ErrorsList | FormFieldResponse | None: +) -> Optional[Union[ErrorsList, FormFieldResponse]]: """Creates a Form Field Creates a new form_field from provided data @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FormFieldResponse + Union[ErrorsList, FormFieldResponse] """ return sync_detailed( @@ -126,7 +126,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewFormField, -) -> Response[ErrorsList | FormFieldResponse]: +) -> Response[Union[ErrorsList, FormFieldResponse]]: """Creates a Form Field Creates a new form_field from provided data @@ -139,7 +139,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FormFieldResponse] + Response[Union[ErrorsList, FormFieldResponse]] """ kwargs = _get_kwargs( @@ -155,7 +155,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewFormField, -) -> ErrorsList | FormFieldResponse | None: +) -> Optional[Union[ErrorsList, FormFieldResponse]]: """Creates a Form Field Creates a new form_field from provided data @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FormFieldResponse + Union[ErrorsList, FormFieldResponse] """ return ( diff --git a/rootly_sdk/api/form_fields/delete_form_field.py b/rootly_sdk/api/form_fields/delete_form_field.py index 40362583..4d123ad4 100644 --- a/rootly_sdk/api/form_fields/delete_form_field.py +++ b/rootly_sdk/api/form_fields/delete_form_field.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union from uuid import UUID import httpx @@ -13,22 +12,19 @@ def _get_kwargs( - id: str | UUID, + id: Union[UUID, str], ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/form_fields/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/form_fields/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | FormFieldResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, FormFieldResponse]]: if response.status_code == 200: response_200 = FormFieldResponse.from_dict(response.json()) @@ -46,8 +42,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | FormFieldResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, FormFieldResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -57,23 +53,23 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Response[ErrorsList | FormFieldResponse]: +) -> Response[Union[ErrorsList, FormFieldResponse]]: """Delete a Form Field Delete a specific form_field by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FormFieldResponse] + Response[Union[ErrorsList, FormFieldResponse]] """ kwargs = _get_kwargs( @@ -88,23 +84,23 @@ def sync_detailed( def sync( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> ErrorsList | FormFieldResponse | None: +) -> Optional[Union[ErrorsList, FormFieldResponse]]: """Delete a Form Field Delete a specific form_field by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FormFieldResponse + Union[ErrorsList, FormFieldResponse] """ return sync_detailed( @@ -114,23 +110,23 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Response[ErrorsList | FormFieldResponse]: +) -> Response[Union[ErrorsList, FormFieldResponse]]: """Delete a Form Field Delete a specific form_field by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FormFieldResponse] + Response[Union[ErrorsList, FormFieldResponse]] """ kwargs = _get_kwargs( @@ -143,23 +139,23 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> ErrorsList | FormFieldResponse | None: +) -> Optional[Union[ErrorsList, FormFieldResponse]]: """Delete a Form Field Delete a specific form_field by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FormFieldResponse + Union[ErrorsList, FormFieldResponse] """ return ( diff --git a/rootly_sdk/api/form_fields/get_form_field.py b/rootly_sdk/api/form_fields/get_form_field.py index b6fcd5f0..0e6e3aa0 100644 --- a/rootly_sdk/api/form_fields/get_form_field.py +++ b/rootly_sdk/api/form_fields/get_form_field.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union from uuid import UUID import httpx @@ -14,14 +13,13 @@ def _get_kwargs( - id: str | UUID, + id: Union[UUID, str], *, - include: GetFormFieldInclude | Unset = UNSET, + include: Union[Unset, GetFormFieldInclude] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} - json_include: str | Unset = UNSET + json_include: Union[Unset, str] = UNSET if not isinstance(include, Unset): json_include = include @@ -31,9 +29,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/form_fields/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/form_fields/{id}", "params": params, } @@ -41,8 +37,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | FormFieldResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, FormFieldResponse]]: if response.status_code == 200: response_200 = FormFieldResponse.from_dict(response.json()) @@ -60,8 +56,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | FormFieldResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, FormFieldResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -71,25 +67,25 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, - include: GetFormFieldInclude | Unset = UNSET, -) -> Response[ErrorsList | FormFieldResponse]: + include: Union[Unset, GetFormFieldInclude] = UNSET, +) -> Response[Union[ErrorsList, FormFieldResponse]]: """Retrieves a Form Field Retrieves a specific form_field by id Args: - id (str | UUID): - include (GetFormFieldInclude | Unset): + id (Union[UUID, str]): + include (Union[Unset, GetFormFieldInclude]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FormFieldResponse] + Response[Union[ErrorsList, FormFieldResponse]] """ kwargs = _get_kwargs( @@ -105,25 +101,25 @@ def sync_detailed( def sync( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, - include: GetFormFieldInclude | Unset = UNSET, -) -> ErrorsList | FormFieldResponse | None: + include: Union[Unset, GetFormFieldInclude] = UNSET, +) -> Optional[Union[ErrorsList, FormFieldResponse]]: """Retrieves a Form Field Retrieves a specific form_field by id Args: - id (str | UUID): - include (GetFormFieldInclude | Unset): + id (Union[UUID, str]): + include (Union[Unset, GetFormFieldInclude]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FormFieldResponse + Union[ErrorsList, FormFieldResponse] """ return sync_detailed( @@ -134,25 +130,25 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, - include: GetFormFieldInclude | Unset = UNSET, -) -> Response[ErrorsList | FormFieldResponse]: + include: Union[Unset, GetFormFieldInclude] = UNSET, +) -> Response[Union[ErrorsList, FormFieldResponse]]: """Retrieves a Form Field Retrieves a specific form_field by id Args: - id (str | UUID): - include (GetFormFieldInclude | Unset): + id (Union[UUID, str]): + include (Union[Unset, GetFormFieldInclude]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FormFieldResponse] + Response[Union[ErrorsList, FormFieldResponse]] """ kwargs = _get_kwargs( @@ -166,25 +162,25 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, - include: GetFormFieldInclude | Unset = UNSET, -) -> ErrorsList | FormFieldResponse | None: + include: Union[Unset, GetFormFieldInclude] = UNSET, +) -> Optional[Union[ErrorsList, FormFieldResponse]]: """Retrieves a Form Field Retrieves a specific form_field by id Args: - id (str | UUID): - include (GetFormFieldInclude | Unset): + id (Union[UUID, str]): + include (Union[Unset, GetFormFieldInclude]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FormFieldResponse + Union[ErrorsList, FormFieldResponse] """ return ( diff --git a/rootly_sdk/api/form_fields/list_form_fields.py b/rootly_sdk/api/form_fields/list_form_fields.py index 737edc91..e400b81a 100644 --- a/rootly_sdk/api/form_fields/list_form_fields.py +++ b/rootly_sdk/api/form_fields/list_form_fields.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -12,39 +12,38 @@ def _get_kwargs( *, - include: ListFormFieldsInclude | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filterenabled: bool | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filterkindeq: str | Unset = UNSET, - filterkindnot_eq: str | Unset = UNSET, - filterkindin: str | Unset = UNSET, - filterkindnot_in: str | Unset = UNSET, - filterenabledeq: str | Unset = UNSET, - filterenablednot_eq: str | Unset = UNSET, - filterenabledin: str | Unset = UNSET, - filterenablednot_in: str | Unset = UNSET, + include: Union[Unset, ListFormFieldsInclude] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterkind: Union[Unset, str] = UNSET, + filterenabled: Union[Unset, bool] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filterslugeq: Union[Unset, str] = UNSET, + filterslugnot_eq: Union[Unset, str] = UNSET, + filterslugin: Union[Unset, str] = UNSET, + filterslugnot_in: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, + filterkindeq: Union[Unset, str] = UNSET, + filterkindnot_eq: Union[Unset, str] = UNSET, + filterkindin: Union[Unset, str] = UNSET, + filterkindnot_in: Union[Unset, str] = UNSET, + filterenabledeq: Union[Unset, str] = UNSET, + filterenablednot_eq: Union[Unset, str] = UNSET, + filterenabledin: Union[Unset, str] = UNSET, + filterenablednot_in: Union[Unset, str] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} - json_include: str | Unset = UNSET + json_include: Union[Unset, str] = UNSET if not isinstance(include, Unset): json_include = include @@ -115,7 +114,7 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> FormFieldList | None: +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[FormFieldList]: if response.status_code == 200: response_200 = FormFieldList.from_dict(response.json()) @@ -127,7 +126,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[FormFieldList]: +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[FormFieldList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -139,68 +138,68 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - include: ListFormFieldsInclude | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filterenabled: bool | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filterkindeq: str | Unset = UNSET, - filterkindnot_eq: str | Unset = UNSET, - filterkindin: str | Unset = UNSET, - filterkindnot_in: str | Unset = UNSET, - filterenabledeq: str | Unset = UNSET, - filterenablednot_eq: str | Unset = UNSET, - filterenabledin: str | Unset = UNSET, - filterenablednot_in: str | Unset = UNSET, + include: Union[Unset, ListFormFieldsInclude] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterkind: Union[Unset, str] = UNSET, + filterenabled: Union[Unset, bool] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filterslugeq: Union[Unset, str] = UNSET, + filterslugnot_eq: Union[Unset, str] = UNSET, + filterslugin: Union[Unset, str] = UNSET, + filterslugnot_in: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, + filterkindeq: Union[Unset, str] = UNSET, + filterkindnot_eq: Union[Unset, str] = UNSET, + filterkindin: Union[Unset, str] = UNSET, + filterkindnot_in: Union[Unset, str] = UNSET, + filterenabledeq: Union[Unset, str] = UNSET, + filterenablednot_eq: Union[Unset, str] = UNSET, + filterenabledin: Union[Unset, str] = UNSET, + filterenablednot_in: Union[Unset, str] = UNSET, ) -> Response[FormFieldList]: """List Form Fields List form_fields Args: - include (ListFormFieldsInclude | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterkind (str | Unset): - filterenabled (bool | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filterkindeq (str | Unset): - filterkindnot_eq (str | Unset): - filterkindin (str | Unset): - filterkindnot_in (str | Unset): - filterenabledeq (str | Unset): - filterenablednot_eq (str | Unset): - filterenabledin (str | Unset): - filterenablednot_in (str | Unset): + include (Union[Unset, ListFormFieldsInclude]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterkind (Union[Unset, str]): + filterenabled (Union[Unset, bool]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filterkindeq (Union[Unset, str]): + filterkindnot_eq (Union[Unset, str]): + filterkindin (Union[Unset, str]): + filterkindnot_in (Union[Unset, str]): + filterenabledeq (Union[Unset, str]): + filterenablednot_eq (Union[Unset, str]): + filterenabledin (Union[Unset, str]): + filterenablednot_in (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -251,68 +250,68 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: ListFormFieldsInclude | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filterenabled: bool | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filterkindeq: str | Unset = UNSET, - filterkindnot_eq: str | Unset = UNSET, - filterkindin: str | Unset = UNSET, - filterkindnot_in: str | Unset = UNSET, - filterenabledeq: str | Unset = UNSET, - filterenablednot_eq: str | Unset = UNSET, - filterenabledin: str | Unset = UNSET, - filterenablednot_in: str | Unset = UNSET, -) -> FormFieldList | None: + include: Union[Unset, ListFormFieldsInclude] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterkind: Union[Unset, str] = UNSET, + filterenabled: Union[Unset, bool] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filterslugeq: Union[Unset, str] = UNSET, + filterslugnot_eq: Union[Unset, str] = UNSET, + filterslugin: Union[Unset, str] = UNSET, + filterslugnot_in: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, + filterkindeq: Union[Unset, str] = UNSET, + filterkindnot_eq: Union[Unset, str] = UNSET, + filterkindin: Union[Unset, str] = UNSET, + filterkindnot_in: Union[Unset, str] = UNSET, + filterenabledeq: Union[Unset, str] = UNSET, + filterenablednot_eq: Union[Unset, str] = UNSET, + filterenabledin: Union[Unset, str] = UNSET, + filterenablednot_in: Union[Unset, str] = UNSET, +) -> Optional[FormFieldList]: """List Form Fields List form_fields Args: - include (ListFormFieldsInclude | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterkind (str | Unset): - filterenabled (bool | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filterkindeq (str | Unset): - filterkindnot_eq (str | Unset): - filterkindin (str | Unset): - filterkindnot_in (str | Unset): - filterenabledeq (str | Unset): - filterenablednot_eq (str | Unset): - filterenabledin (str | Unset): - filterenablednot_in (str | Unset): + include (Union[Unset, ListFormFieldsInclude]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterkind (Union[Unset, str]): + filterenabled (Union[Unset, bool]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filterkindeq (Union[Unset, str]): + filterkindnot_eq (Union[Unset, str]): + filterkindin (Union[Unset, str]): + filterkindnot_in (Union[Unset, str]): + filterenabledeq (Union[Unset, str]): + filterenablednot_eq (Union[Unset, str]): + filterenabledin (Union[Unset, str]): + filterenablednot_in (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -358,68 +357,68 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: ListFormFieldsInclude | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filterenabled: bool | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filterkindeq: str | Unset = UNSET, - filterkindnot_eq: str | Unset = UNSET, - filterkindin: str | Unset = UNSET, - filterkindnot_in: str | Unset = UNSET, - filterenabledeq: str | Unset = UNSET, - filterenablednot_eq: str | Unset = UNSET, - filterenabledin: str | Unset = UNSET, - filterenablednot_in: str | Unset = UNSET, + include: Union[Unset, ListFormFieldsInclude] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterkind: Union[Unset, str] = UNSET, + filterenabled: Union[Unset, bool] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filterslugeq: Union[Unset, str] = UNSET, + filterslugnot_eq: Union[Unset, str] = UNSET, + filterslugin: Union[Unset, str] = UNSET, + filterslugnot_in: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, + filterkindeq: Union[Unset, str] = UNSET, + filterkindnot_eq: Union[Unset, str] = UNSET, + filterkindin: Union[Unset, str] = UNSET, + filterkindnot_in: Union[Unset, str] = UNSET, + filterenabledeq: Union[Unset, str] = UNSET, + filterenablednot_eq: Union[Unset, str] = UNSET, + filterenabledin: Union[Unset, str] = UNSET, + filterenablednot_in: Union[Unset, str] = UNSET, ) -> Response[FormFieldList]: """List Form Fields List form_fields Args: - include (ListFormFieldsInclude | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterkind (str | Unset): - filterenabled (bool | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filterkindeq (str | Unset): - filterkindnot_eq (str | Unset): - filterkindin (str | Unset): - filterkindnot_in (str | Unset): - filterenabledeq (str | Unset): - filterenablednot_eq (str | Unset): - filterenabledin (str | Unset): - filterenablednot_in (str | Unset): + include (Union[Unset, ListFormFieldsInclude]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterkind (Union[Unset, str]): + filterenabled (Union[Unset, bool]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filterkindeq (Union[Unset, str]): + filterkindnot_eq (Union[Unset, str]): + filterkindin (Union[Unset, str]): + filterkindnot_in (Union[Unset, str]): + filterenabledeq (Union[Unset, str]): + filterenablednot_eq (Union[Unset, str]): + filterenabledin (Union[Unset, str]): + filterenablednot_in (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -468,68 +467,68 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: ListFormFieldsInclude | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filterenabled: bool | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filterkindeq: str | Unset = UNSET, - filterkindnot_eq: str | Unset = UNSET, - filterkindin: str | Unset = UNSET, - filterkindnot_in: str | Unset = UNSET, - filterenabledeq: str | Unset = UNSET, - filterenablednot_eq: str | Unset = UNSET, - filterenabledin: str | Unset = UNSET, - filterenablednot_in: str | Unset = UNSET, -) -> FormFieldList | None: + include: Union[Unset, ListFormFieldsInclude] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterkind: Union[Unset, str] = UNSET, + filterenabled: Union[Unset, bool] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filterslugeq: Union[Unset, str] = UNSET, + filterslugnot_eq: Union[Unset, str] = UNSET, + filterslugin: Union[Unset, str] = UNSET, + filterslugnot_in: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, + filterkindeq: Union[Unset, str] = UNSET, + filterkindnot_eq: Union[Unset, str] = UNSET, + filterkindin: Union[Unset, str] = UNSET, + filterkindnot_in: Union[Unset, str] = UNSET, + filterenabledeq: Union[Unset, str] = UNSET, + filterenablednot_eq: Union[Unset, str] = UNSET, + filterenabledin: Union[Unset, str] = UNSET, + filterenablednot_in: Union[Unset, str] = UNSET, +) -> Optional[FormFieldList]: """List Form Fields List form_fields Args: - include (ListFormFieldsInclude | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterkind (str | Unset): - filterenabled (bool | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filterkindeq (str | Unset): - filterkindnot_eq (str | Unset): - filterkindin (str | Unset): - filterkindnot_in (str | Unset): - filterenabledeq (str | Unset): - filterenablednot_eq (str | Unset): - filterenabledin (str | Unset): - filterenablednot_in (str | Unset): + include (Union[Unset, ListFormFieldsInclude]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterkind (Union[Unset, str]): + filterenabled (Union[Unset, bool]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filterkindeq (Union[Unset, str]): + filterkindnot_eq (Union[Unset, str]): + filterkindin (Union[Unset, str]): + filterkindnot_in (Union[Unset, str]): + filterenabledeq (Union[Unset, str]): + filterenablednot_eq (Union[Unset, str]): + filterenabledin (Union[Unset, str]): + filterenablednot_in (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/form_fields/update_form_field.py b/rootly_sdk/api/form_fields/update_form_field.py index 2aa102db..f0f70838 100644 --- a/rootly_sdk/api/form_fields/update_form_field.py +++ b/rootly_sdk/api/form_fields/update_form_field.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union from uuid import UUID import httpx @@ -14,7 +13,7 @@ def _get_kwargs( - id: str | UUID, + id: Union[UUID, str], *, body: UpdateFormField, ) -> dict[str, Any]: @@ -22,9 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/form_fields/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/form_fields/{id}", } _kwargs["json"] = body.to_dict() @@ -36,8 +33,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | FormFieldResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, FormFieldResponse]]: if response.status_code == 200: response_200 = FormFieldResponse.from_dict(response.json()) @@ -55,8 +52,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | FormFieldResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, FormFieldResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,17 +63,17 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdateFormField, -) -> Response[ErrorsList | FormFieldResponse]: +) -> Response[Union[ErrorsList, FormFieldResponse]]: """Update a Form Field Update a specific form_field by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateFormField): Raises: @@ -84,7 +81,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FormFieldResponse] + Response[Union[ErrorsList, FormFieldResponse]] """ kwargs = _get_kwargs( @@ -100,17 +97,17 @@ def sync_detailed( def sync( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdateFormField, -) -> ErrorsList | FormFieldResponse | None: +) -> Optional[Union[ErrorsList, FormFieldResponse]]: """Update a Form Field Update a specific form_field by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateFormField): Raises: @@ -118,7 +115,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FormFieldResponse + Union[ErrorsList, FormFieldResponse] """ return sync_detailed( @@ -129,17 +126,17 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdateFormField, -) -> Response[ErrorsList | FormFieldResponse]: +) -> Response[Union[ErrorsList, FormFieldResponse]]: """Update a Form Field Update a specific form_field by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateFormField): Raises: @@ -147,7 +144,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FormFieldResponse] + Response[Union[ErrorsList, FormFieldResponse]] """ kwargs = _get_kwargs( @@ -161,17 +158,17 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdateFormField, -) -> ErrorsList | FormFieldResponse | None: +) -> Optional[Union[ErrorsList, FormFieldResponse]]: """Update a Form Field Update a specific form_field by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateFormField): Raises: @@ -179,7 +176,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FormFieldResponse + Union[ErrorsList, FormFieldResponse] """ return ( diff --git a/rootly_sdk/api/form_set_conditions/create_form_set_condition.py b/rootly_sdk/api/form_set_conditions/create_form_set_condition.py index 09e9bfec..f7038be8 100644 --- a/rootly_sdk/api/form_set_conditions/create_form_set_condition.py +++ b/rootly_sdk/api/form_set_conditions/create_form_set_condition.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/form_sets/{form_set_id}/conditions".format( - form_set_id=quote(str(form_set_id), safe=""), - ), + "url": f"/v1/form_sets/{form_set_id}/conditions", } _kwargs["json"] = body.to_dict() @@ -35,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | FormSetConditionResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, FormSetConditionResponse]]: if response.status_code == 201: response_201 = FormSetConditionResponse.from_dict(response.json()) @@ -59,8 +56,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | FormSetConditionResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, FormSetConditionResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -74,7 +71,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewFormSetCondition, -) -> Response[ErrorsList | FormSetConditionResponse]: +) -> Response[Union[ErrorsList, FormSetConditionResponse]]: """Creates a Form Set Condition Creates a new form_set_condition from provided data @@ -88,7 +85,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FormSetConditionResponse] + Response[Union[ErrorsList, FormSetConditionResponse]] """ kwargs = _get_kwargs( @@ -108,7 +105,7 @@ def sync( *, client: AuthenticatedClient, body: NewFormSetCondition, -) -> ErrorsList | FormSetConditionResponse | None: +) -> Optional[Union[ErrorsList, FormSetConditionResponse]]: """Creates a Form Set Condition Creates a new form_set_condition from provided data @@ -122,7 +119,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FormSetConditionResponse + Union[ErrorsList, FormSetConditionResponse] """ return sync_detailed( @@ -137,7 +134,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewFormSetCondition, -) -> Response[ErrorsList | FormSetConditionResponse]: +) -> Response[Union[ErrorsList, FormSetConditionResponse]]: """Creates a Form Set Condition Creates a new form_set_condition from provided data @@ -151,7 +148,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FormSetConditionResponse] + Response[Union[ErrorsList, FormSetConditionResponse]] """ kwargs = _get_kwargs( @@ -169,7 +166,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewFormSetCondition, -) -> ErrorsList | FormSetConditionResponse | None: +) -> Optional[Union[ErrorsList, FormSetConditionResponse]]: """Creates a Form Set Condition Creates a new form_set_condition from provided data @@ -183,7 +180,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FormSetConditionResponse + Union[ErrorsList, FormSetConditionResponse] """ return ( diff --git a/rootly_sdk/api/form_set_conditions/delete_form_set_condition.py b/rootly_sdk/api/form_set_conditions/delete_form_set_condition.py index ba34efc2..06b7f5d4 100644 --- a/rootly_sdk/api/form_set_conditions/delete_form_set_condition.py +++ b/rootly_sdk/api/form_set_conditions/delete_form_set_condition.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/form_set_conditions/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/form_set_conditions/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | FormSetConditionResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, FormSetConditionResponse]]: if response.status_code == 200: response_200 = FormSetConditionResponse.from_dict(response.json()) @@ -45,8 +41,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | FormSetConditionResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, FormSetConditionResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | FormSetConditionResponse]: +) -> Response[Union[ErrorsList, FormSetConditionResponse]]: """Delete a Form Set Condition Delete a specific form_set_condition by id @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FormSetConditionResponse] + Response[Union[ErrorsList, FormSetConditionResponse]] """ kwargs = _get_kwargs( @@ -90,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | FormSetConditionResponse | None: +) -> Optional[Union[ErrorsList, FormSetConditionResponse]]: """Delete a Form Set Condition Delete a specific form_set_condition by id @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FormSetConditionResponse + Union[ErrorsList, FormSetConditionResponse] """ return sync_detailed( @@ -116,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | FormSetConditionResponse]: +) -> Response[Union[ErrorsList, FormSetConditionResponse]]: """Delete a Form Set Condition Delete a specific form_set_condition by id @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FormSetConditionResponse] + Response[Union[ErrorsList, FormSetConditionResponse]] """ kwargs = _get_kwargs( @@ -145,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | FormSetConditionResponse | None: +) -> Optional[Union[ErrorsList, FormSetConditionResponse]]: """Delete a Form Set Condition Delete a specific form_set_condition by id @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FormSetConditionResponse + Union[ErrorsList, FormSetConditionResponse] """ return ( diff --git a/rootly_sdk/api/form_set_conditions/get_form_set_condition.py b/rootly_sdk/api/form_set_conditions/get_form_set_condition.py index e84846b0..59a9c023 100644 --- a/rootly_sdk/api/form_set_conditions/get_form_set_condition.py +++ b/rootly_sdk/api/form_set_conditions/get_form_set_condition.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/form_set_conditions/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/form_set_conditions/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | FormSetConditionResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, FormSetConditionResponse]]: if response.status_code == 200: response_200 = FormSetConditionResponse.from_dict(response.json()) @@ -45,8 +41,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | FormSetConditionResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, FormSetConditionResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | FormSetConditionResponse]: +) -> Response[Union[ErrorsList, FormSetConditionResponse]]: """Retrieves a Form Set Condition Retrieves a specific form_set_condition by id @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FormSetConditionResponse] + Response[Union[ErrorsList, FormSetConditionResponse]] """ kwargs = _get_kwargs( @@ -90,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | FormSetConditionResponse | None: +) -> Optional[Union[ErrorsList, FormSetConditionResponse]]: """Retrieves a Form Set Condition Retrieves a specific form_set_condition by id @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FormSetConditionResponse + Union[ErrorsList, FormSetConditionResponse] """ return sync_detailed( @@ -116,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | FormSetConditionResponse]: +) -> Response[Union[ErrorsList, FormSetConditionResponse]]: """Retrieves a Form Set Condition Retrieves a specific form_set_condition by id @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FormSetConditionResponse] + Response[Union[ErrorsList, FormSetConditionResponse]] """ kwargs = _get_kwargs( @@ -145,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | FormSetConditionResponse | None: +) -> Optional[Union[ErrorsList, FormSetConditionResponse]]: """Retrieves a Form Set Condition Retrieves a specific form_set_condition by id @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FormSetConditionResponse + Union[ErrorsList, FormSetConditionResponse] """ return ( diff --git a/rootly_sdk/api/form_set_conditions/list_form_set_conditions.py b/rootly_sdk/api/form_set_conditions/list_form_set_conditions.py index c12eaca5..c37fa74d 100644 --- a/rootly_sdk/api/form_set_conditions/list_form_set_conditions.py +++ b/rootly_sdk/api/form_set_conditions/list_form_set_conditions.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -13,12 +12,11 @@ def _get_kwargs( form_set_id: str, *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterform_field_id: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterform_field_id: Union[Unset, str] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -33,16 +31,16 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/form_sets/{form_set_id}/conditions".format( - form_set_id=quote(str(form_set_id), safe=""), - ), + "url": f"/v1/form_sets/{form_set_id}/conditions", "params": params, } return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> FormSetConditionList | None: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[FormSetConditionList]: if response.status_code == 200: response_200 = FormSetConditionList.from_dict(response.json()) @@ -55,7 +53,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[FormSetConditionList]: return Response( status_code=HTTPStatus(response.status_code), @@ -69,10 +67,10 @@ def sync_detailed( form_set_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterform_field_id: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterform_field_id: Union[Unset, str] = UNSET, ) -> Response[FormSetConditionList]: """List Form Set Conditions @@ -80,10 +78,10 @@ def sync_detailed( Args: form_set_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterform_field_id (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterform_field_id (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -112,21 +110,21 @@ def sync( form_set_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterform_field_id: str | Unset = UNSET, -) -> FormSetConditionList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterform_field_id: Union[Unset, str] = UNSET, +) -> Optional[FormSetConditionList]: """List Form Set Conditions List form_set_conditions Args: form_set_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterform_field_id (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterform_field_id (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -150,10 +148,10 @@ async def asyncio_detailed( form_set_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterform_field_id: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterform_field_id: Union[Unset, str] = UNSET, ) -> Response[FormSetConditionList]: """List Form Set Conditions @@ -161,10 +159,10 @@ async def asyncio_detailed( Args: form_set_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterform_field_id (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterform_field_id (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -191,21 +189,21 @@ async def asyncio( form_set_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterform_field_id: str | Unset = UNSET, -) -> FormSetConditionList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterform_field_id: Union[Unset, str] = UNSET, +) -> Optional[FormSetConditionList]: """List Form Set Conditions List form_set_conditions Args: form_set_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterform_field_id (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterform_field_id (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/form_set_conditions/update_form_set_condition.py b/rootly_sdk/api/form_set_conditions/update_form_set_condition.py index e1ad30f4..6f25633d 100644 --- a/rootly_sdk/api/form_set_conditions/update_form_set_condition.py +++ b/rootly_sdk/api/form_set_conditions/update_form_set_condition.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/form_set_conditions/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/form_set_conditions/{id}", } _kwargs["json"] = body.to_dict() @@ -35,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | FormSetConditionResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, FormSetConditionResponse]]: if response.status_code == 200: response_200 = FormSetConditionResponse.from_dict(response.json()) @@ -54,8 +51,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | FormSetConditionResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, FormSetConditionResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateFormSetCondition, -) -> Response[ErrorsList | FormSetConditionResponse]: +) -> Response[Union[ErrorsList, FormSetConditionResponse]]: """Update a Form Set Condition Update a specific form_set_condition by id @@ -83,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FormSetConditionResponse] + Response[Union[ErrorsList, FormSetConditionResponse]] """ kwargs = _get_kwargs( @@ -103,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateFormSetCondition, -) -> ErrorsList | FormSetConditionResponse | None: +) -> Optional[Union[ErrorsList, FormSetConditionResponse]]: """Update a Form Set Condition Update a specific form_set_condition by id @@ -117,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FormSetConditionResponse + Union[ErrorsList, FormSetConditionResponse] """ return sync_detailed( @@ -132,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateFormSetCondition, -) -> Response[ErrorsList | FormSetConditionResponse]: +) -> Response[Union[ErrorsList, FormSetConditionResponse]]: """Update a Form Set Condition Update a specific form_set_condition by id @@ -146,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FormSetConditionResponse] + Response[Union[ErrorsList, FormSetConditionResponse]] """ kwargs = _get_kwargs( @@ -164,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateFormSetCondition, -) -> ErrorsList | FormSetConditionResponse | None: +) -> Optional[Union[ErrorsList, FormSetConditionResponse]]: """Update a Form Set Condition Update a specific form_set_condition by id @@ -178,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FormSetConditionResponse + Union[ErrorsList, FormSetConditionResponse] """ return ( diff --git a/rootly_sdk/api/form_sets/create_form_set.py b/rootly_sdk/api/form_sets/create_form_set.py index b1132cef..95c8c074 100644 --- a/rootly_sdk/api/form_sets/create_form_set.py +++ b/rootly_sdk/api/form_sets/create_form_set.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | FormSetResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, FormSetResponse]]: if response.status_code == 201: response_201 = FormSetResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | FormSetResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, FormSetResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +69,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewFormSet, -) -> Response[ErrorsList | FormSetResponse]: +) -> Response[Union[ErrorsList, FormSetResponse]]: """Creates a Form Set Creates a new form_set from provided data @@ -82,7 +82,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FormSetResponse] + Response[Union[ErrorsList, FormSetResponse]] """ kwargs = _get_kwargs( @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: NewFormSet, -) -> ErrorsList | FormSetResponse | None: +) -> Optional[Union[ErrorsList, FormSetResponse]]: """Creates a Form Set Creates a new form_set from provided data @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FormSetResponse + Union[ErrorsList, FormSetResponse] """ return sync_detailed( @@ -126,7 +126,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewFormSet, -) -> Response[ErrorsList | FormSetResponse]: +) -> Response[Union[ErrorsList, FormSetResponse]]: """Creates a Form Set Creates a new form_set from provided data @@ -139,7 +139,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FormSetResponse] + Response[Union[ErrorsList, FormSetResponse]] """ kwargs = _get_kwargs( @@ -155,7 +155,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewFormSet, -) -> ErrorsList | FormSetResponse | None: +) -> Optional[Union[ErrorsList, FormSetResponse]]: """Creates a Form Set Creates a new form_set from provided data @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FormSetResponse + Union[ErrorsList, FormSetResponse] """ return ( diff --git a/rootly_sdk/api/form_sets/delete_form_set.py b/rootly_sdk/api/form_sets/delete_form_set.py index 8f5e77e5..b10ad82a 100644 --- a/rootly_sdk/api/form_sets/delete_form_set.py +++ b/rootly_sdk/api/form_sets/delete_form_set.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union from uuid import UUID import httpx @@ -13,22 +12,19 @@ def _get_kwargs( - id: str | UUID, + id: Union[UUID, str], ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/form_sets/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/form_sets/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | FormSetResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, FormSetResponse]]: if response.status_code == 200: response_200 = FormSetResponse.from_dict(response.json()) @@ -46,8 +42,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | FormSetResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, FormSetResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -57,23 +53,23 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Response[ErrorsList | FormSetResponse]: +) -> Response[Union[ErrorsList, FormSetResponse]]: """Delete a Form Set Delete a specific form_set by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FormSetResponse] + Response[Union[ErrorsList, FormSetResponse]] """ kwargs = _get_kwargs( @@ -88,23 +84,23 @@ def sync_detailed( def sync( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> ErrorsList | FormSetResponse | None: +) -> Optional[Union[ErrorsList, FormSetResponse]]: """Delete a Form Set Delete a specific form_set by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FormSetResponse + Union[ErrorsList, FormSetResponse] """ return sync_detailed( @@ -114,23 +110,23 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Response[ErrorsList | FormSetResponse]: +) -> Response[Union[ErrorsList, FormSetResponse]]: """Delete a Form Set Delete a specific form_set by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FormSetResponse] + Response[Union[ErrorsList, FormSetResponse]] """ kwargs = _get_kwargs( @@ -143,23 +139,23 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> ErrorsList | FormSetResponse | None: +) -> Optional[Union[ErrorsList, FormSetResponse]]: """Delete a Form Set Delete a specific form_set by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FormSetResponse + Union[ErrorsList, FormSetResponse] """ return ( diff --git a/rootly_sdk/api/form_sets/get_form_set.py b/rootly_sdk/api/form_sets/get_form_set.py index 6028ddb4..e4f2c1d9 100644 --- a/rootly_sdk/api/form_sets/get_form_set.py +++ b/rootly_sdk/api/form_sets/get_form_set.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union from uuid import UUID import httpx @@ -13,22 +12,19 @@ def _get_kwargs( - id: str | UUID, + id: Union[UUID, str], ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/form_sets/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/form_sets/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | FormSetResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, FormSetResponse]]: if response.status_code == 200: response_200 = FormSetResponse.from_dict(response.json()) @@ -46,8 +42,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | FormSetResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, FormSetResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -57,23 +53,23 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Response[ErrorsList | FormSetResponse]: +) -> Response[Union[ErrorsList, FormSetResponse]]: """Retrieves a Form Set Retrieves a specific form_set by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FormSetResponse] + Response[Union[ErrorsList, FormSetResponse]] """ kwargs = _get_kwargs( @@ -88,23 +84,23 @@ def sync_detailed( def sync( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> ErrorsList | FormSetResponse | None: +) -> Optional[Union[ErrorsList, FormSetResponse]]: """Retrieves a Form Set Retrieves a specific form_set by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FormSetResponse + Union[ErrorsList, FormSetResponse] """ return sync_detailed( @@ -114,23 +110,23 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Response[ErrorsList | FormSetResponse]: +) -> Response[Union[ErrorsList, FormSetResponse]]: """Retrieves a Form Set Retrieves a specific form_set by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FormSetResponse] + Response[Union[ErrorsList, FormSetResponse]] """ kwargs = _get_kwargs( @@ -143,23 +139,23 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> ErrorsList | FormSetResponse | None: +) -> Optional[Union[ErrorsList, FormSetResponse]]: """Retrieves a Form Set Retrieves a specific form_set by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FormSetResponse + Union[ErrorsList, FormSetResponse] """ return ( diff --git a/rootly_sdk/api/form_sets/list_form_sets.py b/rootly_sdk/api/form_sets/list_form_sets.py index 794d9d24..e8de0a26 100644 --- a/rootly_sdk/api/form_sets/list_form_sets.py +++ b/rootly_sdk/api/form_sets/list_form_sets.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -11,17 +11,16 @@ def _get_kwargs( *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filteris_default: bool | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filteris_default: Union[Unset, bool] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -53,7 +52,7 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> FormSetList | None: +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[FormSetList]: if response.status_code == 200: response_200 = FormSetList.from_dict(response.json()) @@ -65,7 +64,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[FormSetList]: +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[FormSetList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -77,30 +76,30 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filteris_default: bool | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filteris_default: Union[Unset, bool] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, ) -> Response[FormSetList]: """List Form Sets List form_sets Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterslug (str | Unset): - filteris_default (bool | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterslug (Union[Unset, str]): + filteris_default (Union[Unset, bool]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -132,30 +131,30 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filteris_default: bool | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, -) -> FormSetList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filteris_default: Union[Unset, bool] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, +) -> Optional[FormSetList]: """List Form Sets List form_sets Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterslug (str | Unset): - filteris_default (bool | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterslug (Union[Unset, str]): + filteris_default (Union[Unset, bool]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -182,30 +181,30 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filteris_default: bool | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filteris_default: Union[Unset, bool] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, ) -> Response[FormSetList]: """List Form Sets List form_sets Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterslug (str | Unset): - filteris_default (bool | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterslug (Union[Unset, str]): + filteris_default (Union[Unset, bool]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -235,30 +234,30 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filteris_default: bool | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, -) -> FormSetList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filteris_default: Union[Unset, bool] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, +) -> Optional[FormSetList]: """List Form Sets List form_sets Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterslug (str | Unset): - filteris_default (bool | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterslug (Union[Unset, str]): + filteris_default (Union[Unset, bool]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/form_sets/update_form_set.py b/rootly_sdk/api/form_sets/update_form_set.py index 1fd4b788..c45931db 100644 --- a/rootly_sdk/api/form_sets/update_form_set.py +++ b/rootly_sdk/api/form_sets/update_form_set.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union from uuid import UUID import httpx @@ -14,7 +13,7 @@ def _get_kwargs( - id: str | UUID, + id: Union[UUID, str], *, body: UpdateFormSet, ) -> dict[str, Any]: @@ -22,9 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/form_sets/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/form_sets/{id}", } _kwargs["json"] = body.to_dict() @@ -36,8 +33,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | FormSetResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, FormSetResponse]]: if response.status_code == 200: response_200 = FormSetResponse.from_dict(response.json()) @@ -55,8 +52,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | FormSetResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, FormSetResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,17 +63,17 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdateFormSet, -) -> Response[ErrorsList | FormSetResponse]: +) -> Response[Union[ErrorsList, FormSetResponse]]: """Update a Form Set Update a specific form_set by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateFormSet): Raises: @@ -84,7 +81,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FormSetResponse] + Response[Union[ErrorsList, FormSetResponse]] """ kwargs = _get_kwargs( @@ -100,17 +97,17 @@ def sync_detailed( def sync( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdateFormSet, -) -> ErrorsList | FormSetResponse | None: +) -> Optional[Union[ErrorsList, FormSetResponse]]: """Update a Form Set Update a specific form_set by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateFormSet): Raises: @@ -118,7 +115,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FormSetResponse + Union[ErrorsList, FormSetResponse] """ return sync_detailed( @@ -129,17 +126,17 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdateFormSet, -) -> Response[ErrorsList | FormSetResponse]: +) -> Response[Union[ErrorsList, FormSetResponse]]: """Update a Form Set Update a specific form_set by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateFormSet): Raises: @@ -147,7 +144,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FormSetResponse] + Response[Union[ErrorsList, FormSetResponse]] """ kwargs = _get_kwargs( @@ -161,17 +158,17 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdateFormSet, -) -> ErrorsList | FormSetResponse | None: +) -> Optional[Union[ErrorsList, FormSetResponse]]: """Update a Form Set Update a specific form_set by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateFormSet): Raises: @@ -179,7 +176,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FormSetResponse + Union[ErrorsList, FormSetResponse] """ return ( diff --git a/rootly_sdk/api/functionalities/bulk_delete_functionalities.py b/rootly_sdk/api/functionalities/bulk_delete_functionalities.py index 9889d1b6..9e873495 100644 --- a/rootly_sdk/api/functionalities/bulk_delete_functionalities.py +++ b/rootly_sdk/api/functionalities/bulk_delete_functionalities.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -14,7 +14,7 @@ def _get_kwargs( *, - body: BulkDestroyFunctionalitiesType0 | BulkDestroyFunctionalitiesType1, + body: Union["BulkDestroyFunctionalitiesType0", "BulkDestroyFunctionalitiesType1"], ) -> dict[str, Any]: headers: dict[str, Any] = {} @@ -23,6 +23,7 @@ def _get_kwargs( "url": "/v1/functionalities/bulk_delete", } + _kwargs["json"]: dict[str, Any] if isinstance(body, BulkDestroyFunctionalitiesType0): _kwargs["json"] = body.to_dict() else: @@ -35,8 +36,10 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> BulkDestroyFunctionalitiesResponse | BulkDestroyFunctionalitiesResponse | ErrorsList | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[ + Union[BulkDestroyFunctionalitiesResponse, ErrorsList, Union["BulkDestroyFunctionalitiesResponse", "ErrorsList"]] +]: if response.status_code == 200: response_200 = BulkDestroyFunctionalitiesResponse.from_dict(response.json()) @@ -49,14 +52,14 @@ def _parse_response( if response.status_code == 422: - def _parse_response_422(data: object) -> BulkDestroyFunctionalitiesResponse | ErrorsList: + def _parse_response_422(data: object) -> Union["BulkDestroyFunctionalitiesResponse", "ErrorsList"]: try: if not isinstance(data, dict): raise TypeError() response_422_type_0 = ErrorsList.from_dict(data) return response_422_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass if not isinstance(data, dict): raise TypeError() @@ -75,8 +78,10 @@ def _parse_response_422(data: object) -> BulkDestroyFunctionalitiesResponse | Er def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[BulkDestroyFunctionalitiesResponse | BulkDestroyFunctionalitiesResponse | ErrorsList | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[ + Union[BulkDestroyFunctionalitiesResponse, ErrorsList, Union["BulkDestroyFunctionalitiesResponse", "ErrorsList"]] +]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -88,24 +93,26 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - body: BulkDestroyFunctionalitiesType0 | BulkDestroyFunctionalitiesType1, -) -> Response[BulkDestroyFunctionalitiesResponse | BulkDestroyFunctionalitiesResponse | ErrorsList | ErrorsList]: + body: Union["BulkDestroyFunctionalitiesType0", "BulkDestroyFunctionalitiesType1"], +) -> Response[ + Union[BulkDestroyFunctionalitiesResponse, ErrorsList, Union["BulkDestroyFunctionalitiesResponse", "ErrorsList"]] +]: """Bulk delete Functionalities Delete functionalities by external_id list, or prune by managed_by source. Two mutually exclusive modes. Args: - body (BulkDestroyFunctionalitiesType0 | BulkDestroyFunctionalitiesType1): Two mutually - exclusive modes. Pass exactly one of: external_ids (delete specific records) or managed_by - (prune all managed records not in keep set). + body (Union['BulkDestroyFunctionalitiesType0', 'BulkDestroyFunctionalitiesType1']): Two + mutually exclusive modes. Pass exactly one of: external_ids (delete specific records) or + managed_by (prune all managed records not in keep set). Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[BulkDestroyFunctionalitiesResponse | BulkDestroyFunctionalitiesResponse | ErrorsList | ErrorsList] + Response[Union[BulkDestroyFunctionalitiesResponse, ErrorsList, Union['BulkDestroyFunctionalitiesResponse', 'ErrorsList']]] """ kwargs = _get_kwargs( @@ -122,24 +129,26 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - body: BulkDestroyFunctionalitiesType0 | BulkDestroyFunctionalitiesType1, -) -> BulkDestroyFunctionalitiesResponse | BulkDestroyFunctionalitiesResponse | ErrorsList | ErrorsList | None: + body: Union["BulkDestroyFunctionalitiesType0", "BulkDestroyFunctionalitiesType1"], +) -> Optional[ + Union[BulkDestroyFunctionalitiesResponse, ErrorsList, Union["BulkDestroyFunctionalitiesResponse", "ErrorsList"]] +]: """Bulk delete Functionalities Delete functionalities by external_id list, or prune by managed_by source. Two mutually exclusive modes. Args: - body (BulkDestroyFunctionalitiesType0 | BulkDestroyFunctionalitiesType1): Two mutually - exclusive modes. Pass exactly one of: external_ids (delete specific records) or managed_by - (prune all managed records not in keep set). + body (Union['BulkDestroyFunctionalitiesType0', 'BulkDestroyFunctionalitiesType1']): Two + mutually exclusive modes. Pass exactly one of: external_ids (delete specific records) or + managed_by (prune all managed records not in keep set). Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - BulkDestroyFunctionalitiesResponse | BulkDestroyFunctionalitiesResponse | ErrorsList | ErrorsList + Union[BulkDestroyFunctionalitiesResponse, ErrorsList, Union['BulkDestroyFunctionalitiesResponse', 'ErrorsList']] """ return sync_detailed( @@ -151,24 +160,26 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - body: BulkDestroyFunctionalitiesType0 | BulkDestroyFunctionalitiesType1, -) -> Response[BulkDestroyFunctionalitiesResponse | BulkDestroyFunctionalitiesResponse | ErrorsList | ErrorsList]: + body: Union["BulkDestroyFunctionalitiesType0", "BulkDestroyFunctionalitiesType1"], +) -> Response[ + Union[BulkDestroyFunctionalitiesResponse, ErrorsList, Union["BulkDestroyFunctionalitiesResponse", "ErrorsList"]] +]: """Bulk delete Functionalities Delete functionalities by external_id list, or prune by managed_by source. Two mutually exclusive modes. Args: - body (BulkDestroyFunctionalitiesType0 | BulkDestroyFunctionalitiesType1): Two mutually - exclusive modes. Pass exactly one of: external_ids (delete specific records) or managed_by - (prune all managed records not in keep set). + body (Union['BulkDestroyFunctionalitiesType0', 'BulkDestroyFunctionalitiesType1']): Two + mutually exclusive modes. Pass exactly one of: external_ids (delete specific records) or + managed_by (prune all managed records not in keep set). Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[BulkDestroyFunctionalitiesResponse | BulkDestroyFunctionalitiesResponse | ErrorsList | ErrorsList] + Response[Union[BulkDestroyFunctionalitiesResponse, ErrorsList, Union['BulkDestroyFunctionalitiesResponse', 'ErrorsList']]] """ kwargs = _get_kwargs( @@ -183,24 +194,26 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - body: BulkDestroyFunctionalitiesType0 | BulkDestroyFunctionalitiesType1, -) -> BulkDestroyFunctionalitiesResponse | BulkDestroyFunctionalitiesResponse | ErrorsList | ErrorsList | None: + body: Union["BulkDestroyFunctionalitiesType0", "BulkDestroyFunctionalitiesType1"], +) -> Optional[ + Union[BulkDestroyFunctionalitiesResponse, ErrorsList, Union["BulkDestroyFunctionalitiesResponse", "ErrorsList"]] +]: """Bulk delete Functionalities Delete functionalities by external_id list, or prune by managed_by source. Two mutually exclusive modes. Args: - body (BulkDestroyFunctionalitiesType0 | BulkDestroyFunctionalitiesType1): Two mutually - exclusive modes. Pass exactly one of: external_ids (delete specific records) or managed_by - (prune all managed records not in keep set). + body (Union['BulkDestroyFunctionalitiesType0', 'BulkDestroyFunctionalitiesType1']): Two + mutually exclusive modes. Pass exactly one of: external_ids (delete specific records) or + managed_by (prune all managed records not in keep set). Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - BulkDestroyFunctionalitiesResponse | BulkDestroyFunctionalitiesResponse | ErrorsList | ErrorsList + Union[BulkDestroyFunctionalitiesResponse, ErrorsList, Union['BulkDestroyFunctionalitiesResponse', 'ErrorsList']] """ return ( diff --git a/rootly_sdk/api/functionalities/bulk_upsert_functionalities.py b/rootly_sdk/api/functionalities/bulk_upsert_functionalities.py index f2e88ac0..5411b075 100644 --- a/rootly_sdk/api/functionalities/bulk_upsert_functionalities.py +++ b/rootly_sdk/api/functionalities/bulk_upsert_functionalities.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -32,8 +32,10 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> BulkUpsertFunctionalitiesError | ErrorsList | BulkUpsertFunctionalitiesResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[ + Union[BulkUpsertFunctionalitiesResponse, ErrorsList, Union["BulkUpsertFunctionalitiesError", "ErrorsList"]] +]: if response.status_code == 200: response_200 = BulkUpsertFunctionalitiesResponse.from_dict(response.json()) @@ -46,14 +48,14 @@ def _parse_response( if response.status_code == 422: - def _parse_response_422(data: object) -> BulkUpsertFunctionalitiesError | ErrorsList: + def _parse_response_422(data: object) -> Union["BulkUpsertFunctionalitiesError", "ErrorsList"]: try: if not isinstance(data, dict): raise TypeError() response_422_type_0 = ErrorsList.from_dict(data) return response_422_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass if not isinstance(data, dict): raise TypeError() @@ -72,8 +74,10 @@ def _parse_response_422(data: object) -> BulkUpsertFunctionalitiesError | Errors def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[BulkUpsertFunctionalitiesError | ErrorsList | BulkUpsertFunctionalitiesResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[ + Union[BulkUpsertFunctionalitiesResponse, ErrorsList, Union["BulkUpsertFunctionalitiesError", "ErrorsList"]] +]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -86,7 +90,9 @@ def sync_detailed( *, client: AuthenticatedClient, body: BulkUpsertFunctionalities, -) -> Response[BulkUpsertFunctionalitiesError | ErrorsList | BulkUpsertFunctionalitiesResponse | ErrorsList]: +) -> Response[ + Union[BulkUpsertFunctionalitiesResponse, ErrorsList, Union["BulkUpsertFunctionalitiesError", "ErrorsList"]] +]: """Bulk upsert Functionalities Create or update multiple functionalities by external_id. Only attributes present in the payload are @@ -103,7 +109,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[BulkUpsertFunctionalitiesError | ErrorsList | BulkUpsertFunctionalitiesResponse | ErrorsList] + Response[Union[BulkUpsertFunctionalitiesResponse, ErrorsList, Union['BulkUpsertFunctionalitiesError', 'ErrorsList']]] """ kwargs = _get_kwargs( @@ -121,7 +127,9 @@ def sync( *, client: AuthenticatedClient, body: BulkUpsertFunctionalities, -) -> BulkUpsertFunctionalitiesError | ErrorsList | BulkUpsertFunctionalitiesResponse | ErrorsList | None: +) -> Optional[ + Union[BulkUpsertFunctionalitiesResponse, ErrorsList, Union["BulkUpsertFunctionalitiesError", "ErrorsList"]] +]: """Bulk upsert Functionalities Create or update multiple functionalities by external_id. Only attributes present in the payload are @@ -138,7 +146,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - BulkUpsertFunctionalitiesError | ErrorsList | BulkUpsertFunctionalitiesResponse | ErrorsList + Union[BulkUpsertFunctionalitiesResponse, ErrorsList, Union['BulkUpsertFunctionalitiesError', 'ErrorsList']] """ return sync_detailed( @@ -151,7 +159,9 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: BulkUpsertFunctionalities, -) -> Response[BulkUpsertFunctionalitiesError | ErrorsList | BulkUpsertFunctionalitiesResponse | ErrorsList]: +) -> Response[ + Union[BulkUpsertFunctionalitiesResponse, ErrorsList, Union["BulkUpsertFunctionalitiesError", "ErrorsList"]] +]: """Bulk upsert Functionalities Create or update multiple functionalities by external_id. Only attributes present in the payload are @@ -168,7 +178,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[BulkUpsertFunctionalitiesError | ErrorsList | BulkUpsertFunctionalitiesResponse | ErrorsList] + Response[Union[BulkUpsertFunctionalitiesResponse, ErrorsList, Union['BulkUpsertFunctionalitiesError', 'ErrorsList']]] """ kwargs = _get_kwargs( @@ -184,7 +194,9 @@ async def asyncio( *, client: AuthenticatedClient, body: BulkUpsertFunctionalities, -) -> BulkUpsertFunctionalitiesError | ErrorsList | BulkUpsertFunctionalitiesResponse | ErrorsList | None: +) -> Optional[ + Union[BulkUpsertFunctionalitiesResponse, ErrorsList, Union["BulkUpsertFunctionalitiesError", "ErrorsList"]] +]: """Bulk upsert Functionalities Create or update multiple functionalities by external_id. Only attributes present in the payload are @@ -201,7 +213,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - BulkUpsertFunctionalitiesError | ErrorsList | BulkUpsertFunctionalitiesResponse | ErrorsList + Union[BulkUpsertFunctionalitiesResponse, ErrorsList, Union['BulkUpsertFunctionalitiesError', 'ErrorsList']] """ return ( diff --git a/rootly_sdk/api/functionalities/create_functionality.py b/rootly_sdk/api/functionalities/create_functionality.py index 1f7ef099..8772515d 100644 --- a/rootly_sdk/api/functionalities/create_functionality.py +++ b/rootly_sdk/api/functionalities/create_functionality.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | FunctionalityResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, FunctionalityResponse]]: if response.status_code == 201: response_201 = FunctionalityResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | FunctionalityResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, FunctionalityResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +69,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewFunctionality, -) -> Response[ErrorsList | FunctionalityResponse]: +) -> Response[Union[ErrorsList, FunctionalityResponse]]: """Creates a functionality Creates a new functionality from provided data @@ -82,7 +82,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FunctionalityResponse] + Response[Union[ErrorsList, FunctionalityResponse]] """ kwargs = _get_kwargs( @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: NewFunctionality, -) -> ErrorsList | FunctionalityResponse | None: +) -> Optional[Union[ErrorsList, FunctionalityResponse]]: """Creates a functionality Creates a new functionality from provided data @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FunctionalityResponse + Union[ErrorsList, FunctionalityResponse] """ return sync_detailed( @@ -126,7 +126,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewFunctionality, -) -> Response[ErrorsList | FunctionalityResponse]: +) -> Response[Union[ErrorsList, FunctionalityResponse]]: """Creates a functionality Creates a new functionality from provided data @@ -139,7 +139,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FunctionalityResponse] + Response[Union[ErrorsList, FunctionalityResponse]] """ kwargs = _get_kwargs( @@ -155,7 +155,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewFunctionality, -) -> ErrorsList | FunctionalityResponse | None: +) -> Optional[Union[ErrorsList, FunctionalityResponse]]: """Creates a functionality Creates a new functionality from provided data @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FunctionalityResponse + Union[ErrorsList, FunctionalityResponse] """ return ( diff --git a/rootly_sdk/api/functionalities/create_functionality_catalog_property.py b/rootly_sdk/api/functionalities/create_functionality_catalog_property.py index ffaecab2..9c6630e8 100644 --- a/rootly_sdk/api/functionalities/create_functionality_catalog_property.py +++ b/rootly_sdk/api/functionalities/create_functionality_catalog_property.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> CatalogPropertyResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[CatalogPropertyResponse, ErrorsList]]: if response.status_code == 201: response_201 = CatalogPropertyResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[CatalogPropertyResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[CatalogPropertyResponse, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +69,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewCatalogProperty, -) -> Response[CatalogPropertyResponse | ErrorsList]: +) -> Response[Union[CatalogPropertyResponse, ErrorsList]]: """Creates a Catalog Property Creates a new Catalog Property from provided data @@ -82,7 +82,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CatalogPropertyResponse | ErrorsList] + Response[Union[CatalogPropertyResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: NewCatalogProperty, -) -> CatalogPropertyResponse | ErrorsList | None: +) -> Optional[Union[CatalogPropertyResponse, ErrorsList]]: """Creates a Catalog Property Creates a new Catalog Property from provided data @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CatalogPropertyResponse | ErrorsList + Union[CatalogPropertyResponse, ErrorsList] """ return sync_detailed( @@ -126,7 +126,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewCatalogProperty, -) -> Response[CatalogPropertyResponse | ErrorsList]: +) -> Response[Union[CatalogPropertyResponse, ErrorsList]]: """Creates a Catalog Property Creates a new Catalog Property from provided data @@ -139,7 +139,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CatalogPropertyResponse | ErrorsList] + Response[Union[CatalogPropertyResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -155,7 +155,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewCatalogProperty, -) -> CatalogPropertyResponse | ErrorsList | None: +) -> Optional[Union[CatalogPropertyResponse, ErrorsList]]: """Creates a Catalog Property Creates a new Catalog Property from provided data @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CatalogPropertyResponse | ErrorsList + Union[CatalogPropertyResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/functionalities/delete_functionality.py b/rootly_sdk/api/functionalities/delete_functionality.py index fe3cb866..e58d65fc 100644 --- a/rootly_sdk/api/functionalities/delete_functionality.py +++ b/rootly_sdk/api/functionalities/delete_functionality.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union from uuid import UUID import httpx @@ -13,22 +12,19 @@ def _get_kwargs( - id: str | UUID, + id: Union[UUID, str], ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/functionalities/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/functionalities/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | FunctionalityResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, FunctionalityResponse]]: if response.status_code == 200: response_200 = FunctionalityResponse.from_dict(response.json()) @@ -46,8 +42,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | FunctionalityResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, FunctionalityResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -57,23 +53,23 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Response[ErrorsList | FunctionalityResponse]: +) -> Response[Union[ErrorsList, FunctionalityResponse]]: """Delete a functionality Delete a specific functionality by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FunctionalityResponse] + Response[Union[ErrorsList, FunctionalityResponse]] """ kwargs = _get_kwargs( @@ -88,23 +84,23 @@ def sync_detailed( def sync( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> ErrorsList | FunctionalityResponse | None: +) -> Optional[Union[ErrorsList, FunctionalityResponse]]: """Delete a functionality Delete a specific functionality by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FunctionalityResponse + Union[ErrorsList, FunctionalityResponse] """ return sync_detailed( @@ -114,23 +110,23 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Response[ErrorsList | FunctionalityResponse]: +) -> Response[Union[ErrorsList, FunctionalityResponse]]: """Delete a functionality Delete a specific functionality by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FunctionalityResponse] + Response[Union[ErrorsList, FunctionalityResponse]] """ kwargs = _get_kwargs( @@ -143,23 +139,23 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> ErrorsList | FunctionalityResponse | None: +) -> Optional[Union[ErrorsList, FunctionalityResponse]]: """Delete a functionality Delete a specific functionality by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FunctionalityResponse + Union[ErrorsList, FunctionalityResponse] """ return ( diff --git a/rootly_sdk/api/functionalities/get_functionality.py b/rootly_sdk/api/functionalities/get_functionality.py index 746c5e60..5ac0a55e 100644 --- a/rootly_sdk/api/functionalities/get_functionality.py +++ b/rootly_sdk/api/functionalities/get_functionality.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union from uuid import UUID import httpx @@ -13,22 +12,19 @@ def _get_kwargs( - id: str | UUID, + id: Union[UUID, str], ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/functionalities/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/functionalities/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | FunctionalityResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, FunctionalityResponse]]: if response.status_code == 200: response_200 = FunctionalityResponse.from_dict(response.json()) @@ -46,8 +42,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | FunctionalityResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, FunctionalityResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -57,23 +53,23 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Response[ErrorsList | FunctionalityResponse]: +) -> Response[Union[ErrorsList, FunctionalityResponse]]: """Retrieves a functionality Retrieves a specific functionality by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FunctionalityResponse] + Response[Union[ErrorsList, FunctionalityResponse]] """ kwargs = _get_kwargs( @@ -88,23 +84,23 @@ def sync_detailed( def sync( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> ErrorsList | FunctionalityResponse | None: +) -> Optional[Union[ErrorsList, FunctionalityResponse]]: """Retrieves a functionality Retrieves a specific functionality by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FunctionalityResponse + Union[ErrorsList, FunctionalityResponse] """ return sync_detailed( @@ -114,23 +110,23 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Response[ErrorsList | FunctionalityResponse]: +) -> Response[Union[ErrorsList, FunctionalityResponse]]: """Retrieves a functionality Retrieves a specific functionality by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FunctionalityResponse] + Response[Union[ErrorsList, FunctionalityResponse]] """ kwargs = _get_kwargs( @@ -143,23 +139,23 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> ErrorsList | FunctionalityResponse | None: +) -> Optional[Union[ErrorsList, FunctionalityResponse]]: """Retrieves a functionality Retrieves a specific functionality by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FunctionalityResponse + Union[ErrorsList, FunctionalityResponse] """ return ( diff --git a/rootly_sdk/api/functionalities/get_functionality_incidents_chart.py b/rootly_sdk/api/functionalities/get_functionality_incidents_chart.py index 0ebccfaf..cc465bc2 100644 --- a/rootly_sdk/api/functionalities/get_functionality_incidents_chart.py +++ b/rootly_sdk/api/functionalities/get_functionality_incidents_chart.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union from uuid import UUID import httpx @@ -13,11 +12,10 @@ def _get_kwargs( - id: str | UUID, + id: Union[UUID, str], *, period: str, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["period"] = period @@ -26,9 +24,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/functionalities/{id}/incidents_chart".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/functionalities/{id}/incidents_chart", "params": params, } @@ -36,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | IncidentsChartResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, IncidentsChartResponse]]: if response.status_code == 200: response_200 = IncidentsChartResponse.from_dict(response.json()) @@ -55,8 +51,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | IncidentsChartResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, IncidentsChartResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,17 +62,17 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, period: str, -) -> Response[ErrorsList | IncidentsChartResponse]: +) -> Response[Union[ErrorsList, IncidentsChartResponse]]: """Get functionality incidents chart Get functionality incidents chart Args: - id (str | UUID): + id (Union[UUID, str]): period (str): Raises: @@ -84,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentsChartResponse] + Response[Union[ErrorsList, IncidentsChartResponse]] """ kwargs = _get_kwargs( @@ -100,17 +96,17 @@ def sync_detailed( def sync( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, period: str, -) -> ErrorsList | IncidentsChartResponse | None: +) -> Optional[Union[ErrorsList, IncidentsChartResponse]]: """Get functionality incidents chart Get functionality incidents chart Args: - id (str | UUID): + id (Union[UUID, str]): period (str): Raises: @@ -118,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentsChartResponse + Union[ErrorsList, IncidentsChartResponse] """ return sync_detailed( @@ -129,17 +125,17 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, period: str, -) -> Response[ErrorsList | IncidentsChartResponse]: +) -> Response[Union[ErrorsList, IncidentsChartResponse]]: """Get functionality incidents chart Get functionality incidents chart Args: - id (str | UUID): + id (Union[UUID, str]): period (str): Raises: @@ -147,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentsChartResponse] + Response[Union[ErrorsList, IncidentsChartResponse]] """ kwargs = _get_kwargs( @@ -161,17 +157,17 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, period: str, -) -> ErrorsList | IncidentsChartResponse | None: +) -> Optional[Union[ErrorsList, IncidentsChartResponse]]: """Get functionality incidents chart Get functionality incidents chart Args: - id (str | UUID): + id (Union[UUID, str]): period (str): Raises: @@ -179,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentsChartResponse + Union[ErrorsList, IncidentsChartResponse] """ return ( diff --git a/rootly_sdk/api/functionalities/get_functionality_uptime_chart.py b/rootly_sdk/api/functionalities/get_functionality_uptime_chart.py index 6fa744af..09e7424f 100644 --- a/rootly_sdk/api/functionalities/get_functionality_uptime_chart.py +++ b/rootly_sdk/api/functionalities/get_functionality_uptime_chart.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union from uuid import UUID import httpx @@ -13,11 +12,10 @@ def _get_kwargs( - id: str | UUID, + id: Union[UUID, str], *, - period: str | Unset = UNSET, + period: Union[Unset, str] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["period"] = period @@ -26,9 +24,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/functionalities/{id}/uptime_chart".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/functionalities/{id}/uptime_chart", "params": params, } @@ -36,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | UptimeChartResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, UptimeChartResponse]]: if response.status_code == 200: response_200 = UptimeChartResponse.from_dict(response.json()) @@ -55,8 +51,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | UptimeChartResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, UptimeChartResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,25 +62,25 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, - period: str | Unset = UNSET, -) -> Response[ErrorsList | UptimeChartResponse]: + period: Union[Unset, str] = UNSET, +) -> Response[Union[ErrorsList, UptimeChartResponse]]: """Get functionality uptime chart Get functionality uptime chart Args: - id (str | UUID): - period (str | Unset): + id (Union[UUID, str]): + period (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | UptimeChartResponse] + Response[Union[ErrorsList, UptimeChartResponse]] """ kwargs = _get_kwargs( @@ -100,25 +96,25 @@ def sync_detailed( def sync( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, - period: str | Unset = UNSET, -) -> ErrorsList | UptimeChartResponse | None: + period: Union[Unset, str] = UNSET, +) -> Optional[Union[ErrorsList, UptimeChartResponse]]: """Get functionality uptime chart Get functionality uptime chart Args: - id (str | UUID): - period (str | Unset): + id (Union[UUID, str]): + period (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | UptimeChartResponse + Union[ErrorsList, UptimeChartResponse] """ return sync_detailed( @@ -129,25 +125,25 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, - period: str | Unset = UNSET, -) -> Response[ErrorsList | UptimeChartResponse]: + period: Union[Unset, str] = UNSET, +) -> Response[Union[ErrorsList, UptimeChartResponse]]: """Get functionality uptime chart Get functionality uptime chart Args: - id (str | UUID): - period (str | Unset): + id (Union[UUID, str]): + period (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | UptimeChartResponse] + Response[Union[ErrorsList, UptimeChartResponse]] """ kwargs = _get_kwargs( @@ -161,25 +157,25 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, - period: str | Unset = UNSET, -) -> ErrorsList | UptimeChartResponse | None: + period: Union[Unset, str] = UNSET, +) -> Optional[Union[ErrorsList, UptimeChartResponse]]: """Get functionality uptime chart Get functionality uptime chart Args: - id (str | UUID): - period (str | Unset): + id (Union[UUID, str]): + period (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | UptimeChartResponse + Union[ErrorsList, UptimeChartResponse] """ return ( diff --git a/rootly_sdk/api/functionalities/list_functionalities.py b/rootly_sdk/api/functionalities/list_functionalities.py index d00ffd21..e73d4744 100644 --- a/rootly_sdk/api/functionalities/list_functionalities.py +++ b/rootly_sdk/api/functionalities/list_functionalities.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -11,31 +11,30 @@ def _get_kwargs( *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterbackstage_id: str | Unset = UNSET, - filtercortex_id: str | Unset = UNSET, - filteropslevel_id: str | Unset = UNSET, - filterexternal_id: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterbackstage_id: Union[Unset, str] = UNSET, + filtercortex_id: Union[Unset, str] = UNSET, + filteropslevel_id: Union[Unset, str] = UNSET, + filterexternal_id: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, + filterslugeq: Union[Unset, str] = UNSET, + filterslugnot_eq: Union[Unset, str] = UNSET, + filterslugin: Union[Unset, str] = UNSET, + filterslugnot_in: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -95,7 +94,9 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> FunctionalityList | None: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[FunctionalityList]: if response.status_code == 200: response_200 = FunctionalityList.from_dict(response.json()) @@ -107,7 +108,9 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[FunctionalityList]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[FunctionalityList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -119,58 +122,58 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterbackstage_id: str | Unset = UNSET, - filtercortex_id: str | Unset = UNSET, - filteropslevel_id: str | Unset = UNSET, - filterexternal_id: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterbackstage_id: Union[Unset, str] = UNSET, + filtercortex_id: Union[Unset, str] = UNSET, + filteropslevel_id: Union[Unset, str] = UNSET, + filterexternal_id: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, + filterslugeq: Union[Unset, str] = UNSET, + filterslugnot_eq: Union[Unset, str] = UNSET, + filterslugin: Union[Unset, str] = UNSET, + filterslugnot_in: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, ) -> Response[FunctionalityList]: """List functionalities List functionalities Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterbackstage_id (str | Unset): - filtercortex_id (str | Unset): - filteropslevel_id (str | Unset): - filterexternal_id (str | Unset): - filterslug (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterbackstage_id (Union[Unset, str]): + filtercortex_id (Union[Unset, str]): + filteropslevel_id (Union[Unset, str]): + filterexternal_id (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -216,58 +219,58 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterbackstage_id: str | Unset = UNSET, - filtercortex_id: str | Unset = UNSET, - filteropslevel_id: str | Unset = UNSET, - filterexternal_id: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, -) -> FunctionalityList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterbackstage_id: Union[Unset, str] = UNSET, + filtercortex_id: Union[Unset, str] = UNSET, + filteropslevel_id: Union[Unset, str] = UNSET, + filterexternal_id: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, + filterslugeq: Union[Unset, str] = UNSET, + filterslugnot_eq: Union[Unset, str] = UNSET, + filterslugin: Union[Unset, str] = UNSET, + filterslugnot_in: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, +) -> Optional[FunctionalityList]: """List functionalities List functionalities Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterbackstage_id (str | Unset): - filtercortex_id (str | Unset): - filteropslevel_id (str | Unset): - filterexternal_id (str | Unset): - filterslug (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterbackstage_id (Union[Unset, str]): + filtercortex_id (Union[Unset, str]): + filteropslevel_id (Union[Unset, str]): + filterexternal_id (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -308,58 +311,58 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterbackstage_id: str | Unset = UNSET, - filtercortex_id: str | Unset = UNSET, - filteropslevel_id: str | Unset = UNSET, - filterexternal_id: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterbackstage_id: Union[Unset, str] = UNSET, + filtercortex_id: Union[Unset, str] = UNSET, + filteropslevel_id: Union[Unset, str] = UNSET, + filterexternal_id: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, + filterslugeq: Union[Unset, str] = UNSET, + filterslugnot_eq: Union[Unset, str] = UNSET, + filterslugin: Union[Unset, str] = UNSET, + filterslugnot_in: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, ) -> Response[FunctionalityList]: """List functionalities List functionalities Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterbackstage_id (str | Unset): - filtercortex_id (str | Unset): - filteropslevel_id (str | Unset): - filterexternal_id (str | Unset): - filterslug (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterbackstage_id (Union[Unset, str]): + filtercortex_id (Union[Unset, str]): + filteropslevel_id (Union[Unset, str]): + filterexternal_id (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -403,58 +406,58 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterbackstage_id: str | Unset = UNSET, - filtercortex_id: str | Unset = UNSET, - filteropslevel_id: str | Unset = UNSET, - filterexternal_id: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, -) -> FunctionalityList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterbackstage_id: Union[Unset, str] = UNSET, + filtercortex_id: Union[Unset, str] = UNSET, + filteropslevel_id: Union[Unset, str] = UNSET, + filterexternal_id: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, + filterslugeq: Union[Unset, str] = UNSET, + filterslugnot_eq: Union[Unset, str] = UNSET, + filterslugin: Union[Unset, str] = UNSET, + filterslugnot_in: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, +) -> Optional[FunctionalityList]: """List functionalities List functionalities Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterbackstage_id (str | Unset): - filtercortex_id (str | Unset): - filteropslevel_id (str | Unset): - filterexternal_id (str | Unset): - filterslug (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterbackstage_id (Union[Unset, str]): + filtercortex_id (Union[Unset, str]): + filteropslevel_id (Union[Unset, str]): + filterexternal_id (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/functionalities/list_functionality_catalog_properties.py b/rootly_sdk/api/functionalities/list_functionality_catalog_properties.py index 80b13adb..900fc08a 100644 --- a/rootly_sdk/api/functionalities/list_functionality_catalog_properties.py +++ b/rootly_sdk/api/functionalities/list_functionality_catalog_properties.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -17,28 +17,27 @@ def _get_kwargs( *, - include: ListFunctionalityCatalogPropertiesInclude | Unset = UNSET, - sort: ListFunctionalityCatalogPropertiesSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Union[Unset, ListFunctionalityCatalogPropertiesInclude] = UNSET, + sort: Union[Unset, ListFunctionalityCatalogPropertiesSort] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterkind: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} - json_include: str | Unset = UNSET + json_include: Union[Unset, str] = UNSET if not isinstance(include, Unset): json_include = include params["include"] = json_include - json_sort: str | Unset = UNSET + json_sort: Union[Unset, str] = UNSET if not isinstance(sort, Unset): json_sort = sort @@ -73,7 +72,9 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> CatalogPropertyList | None: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[CatalogPropertyList]: if response.status_code == 200: response_200 = CatalogPropertyList.from_dict(response.json()) @@ -85,7 +86,9 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[CatalogPropertyList]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[CatalogPropertyList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -97,34 +100,34 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - include: ListFunctionalityCatalogPropertiesInclude | Unset = UNSET, - sort: ListFunctionalityCatalogPropertiesSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Union[Unset, ListFunctionalityCatalogPropertiesInclude] = UNSET, + sort: Union[Unset, ListFunctionalityCatalogPropertiesSort] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterkind: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, ) -> Response[CatalogPropertyList]: """List Catalog Properties List Functionality Catalog Properties Args: - include (ListFunctionalityCatalogPropertiesInclude | Unset): - sort (ListFunctionalityCatalogPropertiesSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterkind (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, ListFunctionalityCatalogPropertiesInclude]): + sort (Union[Unset, ListFunctionalityCatalogPropertiesSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterkind (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -158,34 +161,34 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: ListFunctionalityCatalogPropertiesInclude | Unset = UNSET, - sort: ListFunctionalityCatalogPropertiesSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, -) -> CatalogPropertyList | None: + include: Union[Unset, ListFunctionalityCatalogPropertiesInclude] = UNSET, + sort: Union[Unset, ListFunctionalityCatalogPropertiesSort] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterkind: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, +) -> Optional[CatalogPropertyList]: """List Catalog Properties List Functionality Catalog Properties Args: - include (ListFunctionalityCatalogPropertiesInclude | Unset): - sort (ListFunctionalityCatalogPropertiesSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterkind (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, ListFunctionalityCatalogPropertiesInclude]): + sort (Union[Unset, ListFunctionalityCatalogPropertiesSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterkind (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -214,34 +217,34 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: ListFunctionalityCatalogPropertiesInclude | Unset = UNSET, - sort: ListFunctionalityCatalogPropertiesSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Union[Unset, ListFunctionalityCatalogPropertiesInclude] = UNSET, + sort: Union[Unset, ListFunctionalityCatalogPropertiesSort] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterkind: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, ) -> Response[CatalogPropertyList]: """List Catalog Properties List Functionality Catalog Properties Args: - include (ListFunctionalityCatalogPropertiesInclude | Unset): - sort (ListFunctionalityCatalogPropertiesSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterkind (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, ListFunctionalityCatalogPropertiesInclude]): + sort (Union[Unset, ListFunctionalityCatalogPropertiesSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterkind (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -273,34 +276,34 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: ListFunctionalityCatalogPropertiesInclude | Unset = UNSET, - sort: ListFunctionalityCatalogPropertiesSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, -) -> CatalogPropertyList | None: + include: Union[Unset, ListFunctionalityCatalogPropertiesInclude] = UNSET, + sort: Union[Unset, ListFunctionalityCatalogPropertiesSort] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterkind: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, +) -> Optional[CatalogPropertyList]: """List Catalog Properties List Functionality Catalog Properties Args: - include (ListFunctionalityCatalogPropertiesInclude | Unset): - sort (ListFunctionalityCatalogPropertiesSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterkind (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, ListFunctionalityCatalogPropertiesInclude]): + sort (Union[Unset, ListFunctionalityCatalogPropertiesSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterkind (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/functionalities/update_functionality.py b/rootly_sdk/api/functionalities/update_functionality.py index 5098e9df..8b76fce9 100644 --- a/rootly_sdk/api/functionalities/update_functionality.py +++ b/rootly_sdk/api/functionalities/update_functionality.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union from uuid import UUID import httpx @@ -14,7 +13,7 @@ def _get_kwargs( - id: str | UUID, + id: Union[UUID, str], *, body: UpdateFunctionality, ) -> dict[str, Any]: @@ -22,9 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/functionalities/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/functionalities/{id}", } _kwargs["json"] = body.to_dict() @@ -36,8 +33,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | FunctionalityResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, FunctionalityResponse]]: if response.status_code == 200: response_200 = FunctionalityResponse.from_dict(response.json()) @@ -55,8 +52,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | FunctionalityResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, FunctionalityResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,17 +63,17 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdateFunctionality, -) -> Response[ErrorsList | FunctionalityResponse]: +) -> Response[Union[ErrorsList, FunctionalityResponse]]: """Update a functionality Update a specific functionality by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateFunctionality): Raises: @@ -84,7 +81,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FunctionalityResponse] + Response[Union[ErrorsList, FunctionalityResponse]] """ kwargs = _get_kwargs( @@ -100,17 +97,17 @@ def sync_detailed( def sync( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdateFunctionality, -) -> ErrorsList | FunctionalityResponse | None: +) -> Optional[Union[ErrorsList, FunctionalityResponse]]: """Update a functionality Update a specific functionality by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateFunctionality): Raises: @@ -118,7 +115,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FunctionalityResponse + Union[ErrorsList, FunctionalityResponse] """ return sync_detailed( @@ -129,17 +126,17 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdateFunctionality, -) -> Response[ErrorsList | FunctionalityResponse]: +) -> Response[Union[ErrorsList, FunctionalityResponse]]: """Update a functionality Update a specific functionality by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateFunctionality): Raises: @@ -147,7 +144,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | FunctionalityResponse] + Response[Union[ErrorsList, FunctionalityResponse]] """ kwargs = _get_kwargs( @@ -161,17 +158,17 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdateFunctionality, -) -> ErrorsList | FunctionalityResponse | None: +) -> Optional[Union[ErrorsList, FunctionalityResponse]]: """Update a functionality Update a specific functionality by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateFunctionality): Raises: @@ -179,7 +176,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | FunctionalityResponse + Union[ErrorsList, FunctionalityResponse] """ return ( diff --git a/rootly_sdk/api/heartbeats/create_heartbeat.py b/rootly_sdk/api/heartbeats/create_heartbeat.py index c03eed95..470b270e 100644 --- a/rootly_sdk/api/heartbeats/create_heartbeat.py +++ b/rootly_sdk/api/heartbeats/create_heartbeat.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | HeartbeatResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, HeartbeatResponse]]: if response.status_code == 201: response_201 = HeartbeatResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | HeartbeatResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, HeartbeatResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +69,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewHeartbeat, -) -> Response[ErrorsList | HeartbeatResponse]: +) -> Response[Union[ErrorsList, HeartbeatResponse]]: """Creates a heartbeat Creates a new heartbeat from provided data @@ -82,7 +82,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | HeartbeatResponse] + Response[Union[ErrorsList, HeartbeatResponse]] """ kwargs = _get_kwargs( @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: NewHeartbeat, -) -> ErrorsList | HeartbeatResponse | None: +) -> Optional[Union[ErrorsList, HeartbeatResponse]]: """Creates a heartbeat Creates a new heartbeat from provided data @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | HeartbeatResponse + Union[ErrorsList, HeartbeatResponse] """ return sync_detailed( @@ -126,7 +126,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewHeartbeat, -) -> Response[ErrorsList | HeartbeatResponse]: +) -> Response[Union[ErrorsList, HeartbeatResponse]]: """Creates a heartbeat Creates a new heartbeat from provided data @@ -139,7 +139,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | HeartbeatResponse] + Response[Union[ErrorsList, HeartbeatResponse]] """ kwargs = _get_kwargs( @@ -155,7 +155,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewHeartbeat, -) -> ErrorsList | HeartbeatResponse | None: +) -> Optional[Union[ErrorsList, HeartbeatResponse]]: """Creates a heartbeat Creates a new heartbeat from provided data @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | HeartbeatResponse + Union[ErrorsList, HeartbeatResponse] """ return ( diff --git a/rootly_sdk/api/heartbeats/delete_heartbeat.py b/rootly_sdk/api/heartbeats/delete_heartbeat.py index 674106f9..68ff2836 100644 --- a/rootly_sdk/api/heartbeats/delete_heartbeat.py +++ b/rootly_sdk/api/heartbeats/delete_heartbeat.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union from uuid import UUID import httpx @@ -13,22 +12,19 @@ def _get_kwargs( - id: str | UUID, + id: Union[UUID, str], ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/heartbeats/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/heartbeats/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | HeartbeatResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, HeartbeatResponse]]: if response.status_code == 200: response_200 = HeartbeatResponse.from_dict(response.json()) @@ -46,8 +42,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | HeartbeatResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, HeartbeatResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -57,23 +53,23 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Response[ErrorsList | HeartbeatResponse]: +) -> Response[Union[ErrorsList, HeartbeatResponse]]: """Delete a heartbeat Delete a specific heartbeat by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | HeartbeatResponse] + Response[Union[ErrorsList, HeartbeatResponse]] """ kwargs = _get_kwargs( @@ -88,23 +84,23 @@ def sync_detailed( def sync( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> ErrorsList | HeartbeatResponse | None: +) -> Optional[Union[ErrorsList, HeartbeatResponse]]: """Delete a heartbeat Delete a specific heartbeat by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | HeartbeatResponse + Union[ErrorsList, HeartbeatResponse] """ return sync_detailed( @@ -114,23 +110,23 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Response[ErrorsList | HeartbeatResponse]: +) -> Response[Union[ErrorsList, HeartbeatResponse]]: """Delete a heartbeat Delete a specific heartbeat by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | HeartbeatResponse] + Response[Union[ErrorsList, HeartbeatResponse]] """ kwargs = _get_kwargs( @@ -143,23 +139,23 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> ErrorsList | HeartbeatResponse | None: +) -> Optional[Union[ErrorsList, HeartbeatResponse]]: """Delete a heartbeat Delete a specific heartbeat by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | HeartbeatResponse + Union[ErrorsList, HeartbeatResponse] """ return ( diff --git a/rootly_sdk/api/heartbeats/get_heartbeat.py b/rootly_sdk/api/heartbeats/get_heartbeat.py index 8ab9ac45..6a9a9827 100644 --- a/rootly_sdk/api/heartbeats/get_heartbeat.py +++ b/rootly_sdk/api/heartbeats/get_heartbeat.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union from uuid import UUID import httpx @@ -13,22 +12,19 @@ def _get_kwargs( - id: str | UUID, + id: Union[UUID, str], ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/heartbeats/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/heartbeats/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | HeartbeatResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, HeartbeatResponse]]: if response.status_code == 200: response_200 = HeartbeatResponse.from_dict(response.json()) @@ -46,8 +42,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | HeartbeatResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, HeartbeatResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -57,23 +53,23 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Response[ErrorsList | HeartbeatResponse]: +) -> Response[Union[ErrorsList, HeartbeatResponse]]: """Retrieves a heartbeat Retrieves a specific heartbeat by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | HeartbeatResponse] + Response[Union[ErrorsList, HeartbeatResponse]] """ kwargs = _get_kwargs( @@ -88,23 +84,23 @@ def sync_detailed( def sync( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> ErrorsList | HeartbeatResponse | None: +) -> Optional[Union[ErrorsList, HeartbeatResponse]]: """Retrieves a heartbeat Retrieves a specific heartbeat by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | HeartbeatResponse + Union[ErrorsList, HeartbeatResponse] """ return sync_detailed( @@ -114,23 +110,23 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Response[ErrorsList | HeartbeatResponse]: +) -> Response[Union[ErrorsList, HeartbeatResponse]]: """Retrieves a heartbeat Retrieves a specific heartbeat by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | HeartbeatResponse] + Response[Union[ErrorsList, HeartbeatResponse]] """ kwargs = _get_kwargs( @@ -143,23 +139,23 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> ErrorsList | HeartbeatResponse | None: +) -> Optional[Union[ErrorsList, HeartbeatResponse]]: """Retrieves a heartbeat Retrieves a specific heartbeat by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | HeartbeatResponse + Union[ErrorsList, HeartbeatResponse] """ return ( diff --git a/rootly_sdk/api/heartbeats/list_heartbeats.py b/rootly_sdk/api/heartbeats/list_heartbeats.py index 19af7d67..13277877 100644 --- a/rootly_sdk/api/heartbeats/list_heartbeats.py +++ b/rootly_sdk/api/heartbeats/list_heartbeats.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -11,18 +11,17 @@ def _get_kwargs( *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -56,7 +55,7 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> HeartbeatList | None: +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[HeartbeatList]: if response.status_code == 200: response_200 = HeartbeatList.from_dict(response.json()) @@ -68,7 +67,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[HeartbeatList]: +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[HeartbeatList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -80,32 +79,32 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, ) -> Response[HeartbeatList]: """List heartbeats List heartbeats Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -138,32 +137,32 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, -) -> HeartbeatList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, +) -> Optional[HeartbeatList]: """List heartbeats List heartbeats Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -191,32 +190,32 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, ) -> Response[HeartbeatList]: """List heartbeats List heartbeats Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -247,32 +246,32 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, -) -> HeartbeatList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, +) -> Optional[HeartbeatList]: """List heartbeats List heartbeats Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/heartbeats/ping_heartbeat.py b/rootly_sdk/api/heartbeats/ping_heartbeat.py index 786ca9cc..2d55dc02 100644 --- a/rootly_sdk/api/heartbeats/ping_heartbeat.py +++ b/rootly_sdk/api/heartbeats/ping_heartbeat.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any, cast -from urllib.parse import quote +from typing import Any, Optional, Union, cast import httpx @@ -13,18 +12,17 @@ def _get_kwargs( heartbeat_id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/heartbeats/{heartbeat_id}/ping".format( - heartbeat_id=quote(str(heartbeat_id), safe=""), - ), + "url": f"/v1/heartbeats/{heartbeat_id}/ping", } return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Any | ErrorsList | None: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorsList]]: if response.status_code == 204: response_204 = cast(Any, None) return response_204 @@ -40,7 +38,9 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Any | ErrorsList]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -53,7 +53,7 @@ def sync_detailed( heartbeat_id: str, *, client: AuthenticatedClient, -) -> Response[Any | ErrorsList]: +) -> Response[Union[Any, ErrorsList]]: """Ping a heartbeat Ping a specific heartbeat by id @@ -66,7 +66,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | ErrorsList] + Response[Union[Any, ErrorsList]] """ kwargs = _get_kwargs( @@ -84,7 +84,7 @@ def sync( heartbeat_id: str, *, client: AuthenticatedClient, -) -> Any | ErrorsList | None: +) -> Optional[Union[Any, ErrorsList]]: """Ping a heartbeat Ping a specific heartbeat by id @@ -97,7 +97,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | ErrorsList + Union[Any, ErrorsList] """ return sync_detailed( @@ -110,7 +110,7 @@ async def asyncio_detailed( heartbeat_id: str, *, client: AuthenticatedClient, -) -> Response[Any | ErrorsList]: +) -> Response[Union[Any, ErrorsList]]: """Ping a heartbeat Ping a specific heartbeat by id @@ -123,7 +123,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | ErrorsList] + Response[Union[Any, ErrorsList]] """ kwargs = _get_kwargs( @@ -139,7 +139,7 @@ async def asyncio( heartbeat_id: str, *, client: AuthenticatedClient, -) -> Any | ErrorsList | None: +) -> Optional[Union[Any, ErrorsList]]: """Ping a heartbeat Ping a specific heartbeat by id @@ -152,7 +152,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | ErrorsList + Union[Any, ErrorsList] """ return ( diff --git a/rootly_sdk/api/heartbeats/update_heartbeat.py b/rootly_sdk/api/heartbeats/update_heartbeat.py index 533b0dfb..af6abf1e 100644 --- a/rootly_sdk/api/heartbeats/update_heartbeat.py +++ b/rootly_sdk/api/heartbeats/update_heartbeat.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union from uuid import UUID import httpx @@ -14,7 +13,7 @@ def _get_kwargs( - id: str | UUID, + id: Union[UUID, str], *, body: UpdateHeartbeat, ) -> dict[str, Any]: @@ -22,9 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/heartbeats/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/heartbeats/{id}", } _kwargs["json"] = body.to_dict() @@ -36,8 +33,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | HeartbeatResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, HeartbeatResponse]]: if response.status_code == 200: response_200 = HeartbeatResponse.from_dict(response.json()) @@ -60,8 +57,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | HeartbeatResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, HeartbeatResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -71,17 +68,17 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdateHeartbeat, -) -> Response[ErrorsList | HeartbeatResponse]: +) -> Response[Union[ErrorsList, HeartbeatResponse]]: """Update a heartbeat Update a specific heartbeat by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateHeartbeat): Raises: @@ -89,7 +86,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | HeartbeatResponse] + Response[Union[ErrorsList, HeartbeatResponse]] """ kwargs = _get_kwargs( @@ -105,17 +102,17 @@ def sync_detailed( def sync( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdateHeartbeat, -) -> ErrorsList | HeartbeatResponse | None: +) -> Optional[Union[ErrorsList, HeartbeatResponse]]: """Update a heartbeat Update a specific heartbeat by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateHeartbeat): Raises: @@ -123,7 +120,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | HeartbeatResponse + Union[ErrorsList, HeartbeatResponse] """ return sync_detailed( @@ -134,17 +131,17 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdateHeartbeat, -) -> Response[ErrorsList | HeartbeatResponse]: +) -> Response[Union[ErrorsList, HeartbeatResponse]]: """Update a heartbeat Update a specific heartbeat by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateHeartbeat): Raises: @@ -152,7 +149,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | HeartbeatResponse] + Response[Union[ErrorsList, HeartbeatResponse]] """ kwargs = _get_kwargs( @@ -166,17 +163,17 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdateHeartbeat, -) -> ErrorsList | HeartbeatResponse | None: +) -> Optional[Union[ErrorsList, HeartbeatResponse]]: """Update a heartbeat Update a specific heartbeat by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateHeartbeat): Raises: @@ -184,7 +181,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | HeartbeatResponse + Union[ErrorsList, HeartbeatResponse] """ return ( diff --git a/rootly_sdk/api/incident_action_items/create_incident_action_item.py b/rootly_sdk/api/incident_action_items/create_incident_action_item.py index 8eefa46c..94b0f125 100644 --- a/rootly_sdk/api/incident_action_items/create_incident_action_item.py +++ b/rootly_sdk/api/incident_action_items/create_incident_action_item.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/incidents/{incident_id}/action_items".format( - incident_id=quote(str(incident_id), safe=""), - ), + "url": f"/v1/incidents/{incident_id}/action_items", } _kwargs["json"] = body.to_dict() @@ -35,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | IncidentActionItemResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, IncidentActionItemResponse]]: if response.status_code == 201: response_201 = IncidentActionItemResponse.from_dict(response.json()) @@ -59,8 +56,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | IncidentActionItemResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, IncidentActionItemResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -74,7 +71,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewIncidentActionItem, -) -> Response[ErrorsList | IncidentActionItemResponse]: +) -> Response[Union[ErrorsList, IncidentActionItemResponse]]: """Creates an incident action item Creates a new action item from provided data @@ -88,7 +85,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentActionItemResponse] + Response[Union[ErrorsList, IncidentActionItemResponse]] """ kwargs = _get_kwargs( @@ -108,7 +105,7 @@ def sync( *, client: AuthenticatedClient, body: NewIncidentActionItem, -) -> ErrorsList | IncidentActionItemResponse | None: +) -> Optional[Union[ErrorsList, IncidentActionItemResponse]]: """Creates an incident action item Creates a new action item from provided data @@ -122,7 +119,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentActionItemResponse + Union[ErrorsList, IncidentActionItemResponse] """ return sync_detailed( @@ -137,7 +134,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewIncidentActionItem, -) -> Response[ErrorsList | IncidentActionItemResponse]: +) -> Response[Union[ErrorsList, IncidentActionItemResponse]]: """Creates an incident action item Creates a new action item from provided data @@ -151,7 +148,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentActionItemResponse] + Response[Union[ErrorsList, IncidentActionItemResponse]] """ kwargs = _get_kwargs( @@ -169,7 +166,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewIncidentActionItem, -) -> ErrorsList | IncidentActionItemResponse | None: +) -> Optional[Union[ErrorsList, IncidentActionItemResponse]]: """Creates an incident action item Creates a new action item from provided data @@ -183,7 +180,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentActionItemResponse + Union[ErrorsList, IncidentActionItemResponse] """ return ( diff --git a/rootly_sdk/api/incident_action_items/delete_incident_action_item.py b/rootly_sdk/api/incident_action_items/delete_incident_action_item.py index 3c58343a..0f608c3e 100644 --- a/rootly_sdk/api/incident_action_items/delete_incident_action_item.py +++ b/rootly_sdk/api/incident_action_items/delete_incident_action_item.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/action_items/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/action_items/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | IncidentActionItemResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, IncidentActionItemResponse]]: if response.status_code == 200: response_200 = IncidentActionItemResponse.from_dict(response.json()) @@ -45,8 +41,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | IncidentActionItemResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, IncidentActionItemResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | IncidentActionItemResponse]: +) -> Response[Union[ErrorsList, IncidentActionItemResponse]]: """Delete an incident action item Delete a specific incident action item by id @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentActionItemResponse] + Response[Union[ErrorsList, IncidentActionItemResponse]] """ kwargs = _get_kwargs( @@ -90,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | IncidentActionItemResponse | None: +) -> Optional[Union[ErrorsList, IncidentActionItemResponse]]: """Delete an incident action item Delete a specific incident action item by id @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentActionItemResponse + Union[ErrorsList, IncidentActionItemResponse] """ return sync_detailed( @@ -116,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | IncidentActionItemResponse]: +) -> Response[Union[ErrorsList, IncidentActionItemResponse]]: """Delete an incident action item Delete a specific incident action item by id @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentActionItemResponse] + Response[Union[ErrorsList, IncidentActionItemResponse]] """ kwargs = _get_kwargs( @@ -145,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | IncidentActionItemResponse | None: +) -> Optional[Union[ErrorsList, IncidentActionItemResponse]]: """Delete an incident action item Delete a specific incident action item by id @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentActionItemResponse + Union[ErrorsList, IncidentActionItemResponse] """ return ( diff --git a/rootly_sdk/api/incident_action_items/get_incident_action_items.py b/rootly_sdk/api/incident_action_items/get_incident_action_items.py index 978d0899..369eb41c 100644 --- a/rootly_sdk/api/incident_action_items/get_incident_action_items.py +++ b/rootly_sdk/api/incident_action_items/get_incident_action_items.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/action_items/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/action_items/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | IncidentActionItemResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, IncidentActionItemResponse]]: if response.status_code == 200: response_200 = IncidentActionItemResponse.from_dict(response.json()) @@ -45,8 +41,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | IncidentActionItemResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, IncidentActionItemResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | IncidentActionItemResponse]: +) -> Response[Union[ErrorsList, IncidentActionItemResponse]]: """Retrieves an incident action item Retrieves a specific incident_action_item by id @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentActionItemResponse] + Response[Union[ErrorsList, IncidentActionItemResponse]] """ kwargs = _get_kwargs( @@ -90,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | IncidentActionItemResponse | None: +) -> Optional[Union[ErrorsList, IncidentActionItemResponse]]: """Retrieves an incident action item Retrieves a specific incident_action_item by id @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentActionItemResponse + Union[ErrorsList, IncidentActionItemResponse] """ return sync_detailed( @@ -116,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | IncidentActionItemResponse]: +) -> Response[Union[ErrorsList, IncidentActionItemResponse]]: """Retrieves an incident action item Retrieves a specific incident_action_item by id @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentActionItemResponse] + Response[Union[ErrorsList, IncidentActionItemResponse]] """ kwargs = _get_kwargs( @@ -145,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | IncidentActionItemResponse | None: +) -> Optional[Union[ErrorsList, IncidentActionItemResponse]]: """Retrieves an incident action item Retrieves a specific incident_action_item by id @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentActionItemResponse + Union[ErrorsList, IncidentActionItemResponse] """ return ( diff --git a/rootly_sdk/api/incident_action_items/list_all_incident_action_items.py b/rootly_sdk/api/incident_action_items/list_all_incident_action_items.py index 9fdcf45a..b77c604e 100644 --- a/rootly_sdk/api/incident_action_items/list_all_incident_action_items.py +++ b/rootly_sdk/api/incident_action_items/list_all_incident_action_items.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -11,44 +11,43 @@ def _get_kwargs( *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterkind: str | Unset = UNSET, - filterpriority: str | Unset = UNSET, - filterstatus: str | Unset = UNSET, - filterincident_status: str | Unset = UNSET, - filterincident_created_atgt: str | Unset = UNSET, - filterincident_created_atgte: str | Unset = UNSET, - filterincident_created_atlt: str | Unset = UNSET, - filterincident_created_atlte: str | Unset = UNSET, - filterdue_dategt: str | Unset = UNSET, - filterdue_dategte: str | Unset = UNSET, - filterdue_datelt: str | Unset = UNSET, - filterdue_datelte: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterkindeq: str | Unset = UNSET, - filterkindnot_eq: str | Unset = UNSET, - filterkindin: str | Unset = UNSET, - filterkindnot_in: str | Unset = UNSET, - filterpriorityeq: str | Unset = UNSET, - filterprioritynot_eq: str | Unset = UNSET, - filterpriorityin: str | Unset = UNSET, - filterprioritynot_in: str | Unset = UNSET, - filterstatuseq: str | Unset = UNSET, - filterstatusnot_eq: str | Unset = UNSET, - filterstatusin: str | Unset = UNSET, - filterstatusnot_in: str | Unset = UNSET, - filterincident_statuseq: str | Unset = UNSET, - filterincident_statusnot_eq: str | Unset = UNSET, - filterincident_statusin: str | Unset = UNSET, - filterincident_statusnot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterkind: Union[Unset, str] = UNSET, + filterpriority: Union[Unset, str] = UNSET, + filterstatus: Union[Unset, str] = UNSET, + filterincident_status: Union[Unset, str] = UNSET, + filterincident_created_atgt: Union[Unset, str] = UNSET, + filterincident_created_atgte: Union[Unset, str] = UNSET, + filterincident_created_atlt: Union[Unset, str] = UNSET, + filterincident_created_atlte: Union[Unset, str] = UNSET, + filterdue_dategt: Union[Unset, str] = UNSET, + filterdue_dategte: Union[Unset, str] = UNSET, + filterdue_datelt: Union[Unset, str] = UNSET, + filterdue_datelte: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filterkindeq: Union[Unset, str] = UNSET, + filterkindnot_eq: Union[Unset, str] = UNSET, + filterkindin: Union[Unset, str] = UNSET, + filterkindnot_in: Union[Unset, str] = UNSET, + filterpriorityeq: Union[Unset, str] = UNSET, + filterprioritynot_eq: Union[Unset, str] = UNSET, + filterpriorityin: Union[Unset, str] = UNSET, + filterprioritynot_in: Union[Unset, str] = UNSET, + filterstatuseq: Union[Unset, str] = UNSET, + filterstatusnot_eq: Union[Unset, str] = UNSET, + filterstatusin: Union[Unset, str] = UNSET, + filterstatusnot_in: Union[Unset, str] = UNSET, + filterincident_statuseq: Union[Unset, str] = UNSET, + filterincident_statusnot_eq: Union[Unset, str] = UNSET, + filterincident_statusin: Union[Unset, str] = UNSET, + filterincident_statusnot_in: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -134,7 +133,9 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> IncidentActionItemList | None: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[IncidentActionItemList]: if response.status_code == 200: response_200 = IncidentActionItemList.from_dict(response.json()) @@ -147,7 +148,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[IncidentActionItemList]: return Response( status_code=HTTPStatus(response.status_code), @@ -160,84 +161,84 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterkind: str | Unset = UNSET, - filterpriority: str | Unset = UNSET, - filterstatus: str | Unset = UNSET, - filterincident_status: str | Unset = UNSET, - filterincident_created_atgt: str | Unset = UNSET, - filterincident_created_atgte: str | Unset = UNSET, - filterincident_created_atlt: str | Unset = UNSET, - filterincident_created_atlte: str | Unset = UNSET, - filterdue_dategt: str | Unset = UNSET, - filterdue_dategte: str | Unset = UNSET, - filterdue_datelt: str | Unset = UNSET, - filterdue_datelte: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterkindeq: str | Unset = UNSET, - filterkindnot_eq: str | Unset = UNSET, - filterkindin: str | Unset = UNSET, - filterkindnot_in: str | Unset = UNSET, - filterpriorityeq: str | Unset = UNSET, - filterprioritynot_eq: str | Unset = UNSET, - filterpriorityin: str | Unset = UNSET, - filterprioritynot_in: str | Unset = UNSET, - filterstatuseq: str | Unset = UNSET, - filterstatusnot_eq: str | Unset = UNSET, - filterstatusin: str | Unset = UNSET, - filterstatusnot_in: str | Unset = UNSET, - filterincident_statuseq: str | Unset = UNSET, - filterincident_statusnot_eq: str | Unset = UNSET, - filterincident_statusin: str | Unset = UNSET, - filterincident_statusnot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterkind: Union[Unset, str] = UNSET, + filterpriority: Union[Unset, str] = UNSET, + filterstatus: Union[Unset, str] = UNSET, + filterincident_status: Union[Unset, str] = UNSET, + filterincident_created_atgt: Union[Unset, str] = UNSET, + filterincident_created_atgte: Union[Unset, str] = UNSET, + filterincident_created_atlt: Union[Unset, str] = UNSET, + filterincident_created_atlte: Union[Unset, str] = UNSET, + filterdue_dategt: Union[Unset, str] = UNSET, + filterdue_dategte: Union[Unset, str] = UNSET, + filterdue_datelt: Union[Unset, str] = UNSET, + filterdue_datelte: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filterkindeq: Union[Unset, str] = UNSET, + filterkindnot_eq: Union[Unset, str] = UNSET, + filterkindin: Union[Unset, str] = UNSET, + filterkindnot_in: Union[Unset, str] = UNSET, + filterpriorityeq: Union[Unset, str] = UNSET, + filterprioritynot_eq: Union[Unset, str] = UNSET, + filterpriorityin: Union[Unset, str] = UNSET, + filterprioritynot_in: Union[Unset, str] = UNSET, + filterstatuseq: Union[Unset, str] = UNSET, + filterstatusnot_eq: Union[Unset, str] = UNSET, + filterstatusin: Union[Unset, str] = UNSET, + filterstatusnot_in: Union[Unset, str] = UNSET, + filterincident_statuseq: Union[Unset, str] = UNSET, + filterincident_statusnot_eq: Union[Unset, str] = UNSET, + filterincident_statusin: Union[Unset, str] = UNSET, + filterincident_statusnot_in: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, ) -> Response[IncidentActionItemList]: """List all action items for an organization List all action items for an organization Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterkind (str | Unset): - filterpriority (str | Unset): - filterstatus (str | Unset): - filterincident_status (str | Unset): - filterincident_created_atgt (str | Unset): - filterincident_created_atgte (str | Unset): - filterincident_created_atlt (str | Unset): - filterincident_created_atlte (str | Unset): - filterdue_dategt (str | Unset): - filterdue_dategte (str | Unset): - filterdue_datelt (str | Unset): - filterdue_datelte (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterkindeq (str | Unset): - filterkindnot_eq (str | Unset): - filterkindin (str | Unset): - filterkindnot_in (str | Unset): - filterpriorityeq (str | Unset): - filterprioritynot_eq (str | Unset): - filterpriorityin (str | Unset): - filterprioritynot_in (str | Unset): - filterstatuseq (str | Unset): - filterstatusnot_eq (str | Unset): - filterstatusin (str | Unset): - filterstatusnot_in (str | Unset): - filterincident_statuseq (str | Unset): - filterincident_statusnot_eq (str | Unset): - filterincident_statusin (str | Unset): - filterincident_statusnot_in (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterkind (Union[Unset, str]): + filterpriority (Union[Unset, str]): + filterstatus (Union[Unset, str]): + filterincident_status (Union[Unset, str]): + filterincident_created_atgt (Union[Unset, str]): + filterincident_created_atgte (Union[Unset, str]): + filterincident_created_atlt (Union[Unset, str]): + filterincident_created_atlte (Union[Unset, str]): + filterdue_dategt (Union[Unset, str]): + filterdue_dategte (Union[Unset, str]): + filterdue_datelt (Union[Unset, str]): + filterdue_datelte (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterkindeq (Union[Unset, str]): + filterkindnot_eq (Union[Unset, str]): + filterkindin (Union[Unset, str]): + filterkindnot_in (Union[Unset, str]): + filterpriorityeq (Union[Unset, str]): + filterprioritynot_eq (Union[Unset, str]): + filterpriorityin (Union[Unset, str]): + filterprioritynot_in (Union[Unset, str]): + filterstatuseq (Union[Unset, str]): + filterstatusnot_eq (Union[Unset, str]): + filterstatusin (Union[Unset, str]): + filterstatusnot_in (Union[Unset, str]): + filterincident_statuseq (Union[Unset, str]): + filterincident_statusnot_eq (Union[Unset, str]): + filterincident_statusin (Union[Unset, str]): + filterincident_statusnot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -296,84 +297,84 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterkind: str | Unset = UNSET, - filterpriority: str | Unset = UNSET, - filterstatus: str | Unset = UNSET, - filterincident_status: str | Unset = UNSET, - filterincident_created_atgt: str | Unset = UNSET, - filterincident_created_atgte: str | Unset = UNSET, - filterincident_created_atlt: str | Unset = UNSET, - filterincident_created_atlte: str | Unset = UNSET, - filterdue_dategt: str | Unset = UNSET, - filterdue_dategte: str | Unset = UNSET, - filterdue_datelt: str | Unset = UNSET, - filterdue_datelte: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterkindeq: str | Unset = UNSET, - filterkindnot_eq: str | Unset = UNSET, - filterkindin: str | Unset = UNSET, - filterkindnot_in: str | Unset = UNSET, - filterpriorityeq: str | Unset = UNSET, - filterprioritynot_eq: str | Unset = UNSET, - filterpriorityin: str | Unset = UNSET, - filterprioritynot_in: str | Unset = UNSET, - filterstatuseq: str | Unset = UNSET, - filterstatusnot_eq: str | Unset = UNSET, - filterstatusin: str | Unset = UNSET, - filterstatusnot_in: str | Unset = UNSET, - filterincident_statuseq: str | Unset = UNSET, - filterincident_statusnot_eq: str | Unset = UNSET, - filterincident_statusin: str | Unset = UNSET, - filterincident_statusnot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, -) -> IncidentActionItemList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterkind: Union[Unset, str] = UNSET, + filterpriority: Union[Unset, str] = UNSET, + filterstatus: Union[Unset, str] = UNSET, + filterincident_status: Union[Unset, str] = UNSET, + filterincident_created_atgt: Union[Unset, str] = UNSET, + filterincident_created_atgte: Union[Unset, str] = UNSET, + filterincident_created_atlt: Union[Unset, str] = UNSET, + filterincident_created_atlte: Union[Unset, str] = UNSET, + filterdue_dategt: Union[Unset, str] = UNSET, + filterdue_dategte: Union[Unset, str] = UNSET, + filterdue_datelt: Union[Unset, str] = UNSET, + filterdue_datelte: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filterkindeq: Union[Unset, str] = UNSET, + filterkindnot_eq: Union[Unset, str] = UNSET, + filterkindin: Union[Unset, str] = UNSET, + filterkindnot_in: Union[Unset, str] = UNSET, + filterpriorityeq: Union[Unset, str] = UNSET, + filterprioritynot_eq: Union[Unset, str] = UNSET, + filterpriorityin: Union[Unset, str] = UNSET, + filterprioritynot_in: Union[Unset, str] = UNSET, + filterstatuseq: Union[Unset, str] = UNSET, + filterstatusnot_eq: Union[Unset, str] = UNSET, + filterstatusin: Union[Unset, str] = UNSET, + filterstatusnot_in: Union[Unset, str] = UNSET, + filterincident_statuseq: Union[Unset, str] = UNSET, + filterincident_statusnot_eq: Union[Unset, str] = UNSET, + filterincident_statusin: Union[Unset, str] = UNSET, + filterincident_statusnot_in: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, +) -> Optional[IncidentActionItemList]: """List all action items for an organization List all action items for an organization Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterkind (str | Unset): - filterpriority (str | Unset): - filterstatus (str | Unset): - filterincident_status (str | Unset): - filterincident_created_atgt (str | Unset): - filterincident_created_atgte (str | Unset): - filterincident_created_atlt (str | Unset): - filterincident_created_atlte (str | Unset): - filterdue_dategt (str | Unset): - filterdue_dategte (str | Unset): - filterdue_datelt (str | Unset): - filterdue_datelte (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterkindeq (str | Unset): - filterkindnot_eq (str | Unset): - filterkindin (str | Unset): - filterkindnot_in (str | Unset): - filterpriorityeq (str | Unset): - filterprioritynot_eq (str | Unset): - filterpriorityin (str | Unset): - filterprioritynot_in (str | Unset): - filterstatuseq (str | Unset): - filterstatusnot_eq (str | Unset): - filterstatusin (str | Unset): - filterstatusnot_in (str | Unset): - filterincident_statuseq (str | Unset): - filterincident_statusnot_eq (str | Unset): - filterincident_statusin (str | Unset): - filterincident_statusnot_in (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterkind (Union[Unset, str]): + filterpriority (Union[Unset, str]): + filterstatus (Union[Unset, str]): + filterincident_status (Union[Unset, str]): + filterincident_created_atgt (Union[Unset, str]): + filterincident_created_atgte (Union[Unset, str]): + filterincident_created_atlt (Union[Unset, str]): + filterincident_created_atlte (Union[Unset, str]): + filterdue_dategt (Union[Unset, str]): + filterdue_dategte (Union[Unset, str]): + filterdue_datelt (Union[Unset, str]): + filterdue_datelte (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterkindeq (Union[Unset, str]): + filterkindnot_eq (Union[Unset, str]): + filterkindin (Union[Unset, str]): + filterkindnot_in (Union[Unset, str]): + filterpriorityeq (Union[Unset, str]): + filterprioritynot_eq (Union[Unset, str]): + filterpriorityin (Union[Unset, str]): + filterprioritynot_in (Union[Unset, str]): + filterstatuseq (Union[Unset, str]): + filterstatusnot_eq (Union[Unset, str]): + filterstatusin (Union[Unset, str]): + filterstatusnot_in (Union[Unset, str]): + filterincident_statuseq (Union[Unset, str]): + filterincident_statusnot_eq (Union[Unset, str]): + filterincident_statusin (Union[Unset, str]): + filterincident_statusnot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -427,84 +428,84 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterkind: str | Unset = UNSET, - filterpriority: str | Unset = UNSET, - filterstatus: str | Unset = UNSET, - filterincident_status: str | Unset = UNSET, - filterincident_created_atgt: str | Unset = UNSET, - filterincident_created_atgte: str | Unset = UNSET, - filterincident_created_atlt: str | Unset = UNSET, - filterincident_created_atlte: str | Unset = UNSET, - filterdue_dategt: str | Unset = UNSET, - filterdue_dategte: str | Unset = UNSET, - filterdue_datelt: str | Unset = UNSET, - filterdue_datelte: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterkindeq: str | Unset = UNSET, - filterkindnot_eq: str | Unset = UNSET, - filterkindin: str | Unset = UNSET, - filterkindnot_in: str | Unset = UNSET, - filterpriorityeq: str | Unset = UNSET, - filterprioritynot_eq: str | Unset = UNSET, - filterpriorityin: str | Unset = UNSET, - filterprioritynot_in: str | Unset = UNSET, - filterstatuseq: str | Unset = UNSET, - filterstatusnot_eq: str | Unset = UNSET, - filterstatusin: str | Unset = UNSET, - filterstatusnot_in: str | Unset = UNSET, - filterincident_statuseq: str | Unset = UNSET, - filterincident_statusnot_eq: str | Unset = UNSET, - filterincident_statusin: str | Unset = UNSET, - filterincident_statusnot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterkind: Union[Unset, str] = UNSET, + filterpriority: Union[Unset, str] = UNSET, + filterstatus: Union[Unset, str] = UNSET, + filterincident_status: Union[Unset, str] = UNSET, + filterincident_created_atgt: Union[Unset, str] = UNSET, + filterincident_created_atgte: Union[Unset, str] = UNSET, + filterincident_created_atlt: Union[Unset, str] = UNSET, + filterincident_created_atlte: Union[Unset, str] = UNSET, + filterdue_dategt: Union[Unset, str] = UNSET, + filterdue_dategte: Union[Unset, str] = UNSET, + filterdue_datelt: Union[Unset, str] = UNSET, + filterdue_datelte: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filterkindeq: Union[Unset, str] = UNSET, + filterkindnot_eq: Union[Unset, str] = UNSET, + filterkindin: Union[Unset, str] = UNSET, + filterkindnot_in: Union[Unset, str] = UNSET, + filterpriorityeq: Union[Unset, str] = UNSET, + filterprioritynot_eq: Union[Unset, str] = UNSET, + filterpriorityin: Union[Unset, str] = UNSET, + filterprioritynot_in: Union[Unset, str] = UNSET, + filterstatuseq: Union[Unset, str] = UNSET, + filterstatusnot_eq: Union[Unset, str] = UNSET, + filterstatusin: Union[Unset, str] = UNSET, + filterstatusnot_in: Union[Unset, str] = UNSET, + filterincident_statuseq: Union[Unset, str] = UNSET, + filterincident_statusnot_eq: Union[Unset, str] = UNSET, + filterincident_statusin: Union[Unset, str] = UNSET, + filterincident_statusnot_in: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, ) -> Response[IncidentActionItemList]: """List all action items for an organization List all action items for an organization Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterkind (str | Unset): - filterpriority (str | Unset): - filterstatus (str | Unset): - filterincident_status (str | Unset): - filterincident_created_atgt (str | Unset): - filterincident_created_atgte (str | Unset): - filterincident_created_atlt (str | Unset): - filterincident_created_atlte (str | Unset): - filterdue_dategt (str | Unset): - filterdue_dategte (str | Unset): - filterdue_datelt (str | Unset): - filterdue_datelte (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterkindeq (str | Unset): - filterkindnot_eq (str | Unset): - filterkindin (str | Unset): - filterkindnot_in (str | Unset): - filterpriorityeq (str | Unset): - filterprioritynot_eq (str | Unset): - filterpriorityin (str | Unset): - filterprioritynot_in (str | Unset): - filterstatuseq (str | Unset): - filterstatusnot_eq (str | Unset): - filterstatusin (str | Unset): - filterstatusnot_in (str | Unset): - filterincident_statuseq (str | Unset): - filterincident_statusnot_eq (str | Unset): - filterincident_statusin (str | Unset): - filterincident_statusnot_in (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterkind (Union[Unset, str]): + filterpriority (Union[Unset, str]): + filterstatus (Union[Unset, str]): + filterincident_status (Union[Unset, str]): + filterincident_created_atgt (Union[Unset, str]): + filterincident_created_atgte (Union[Unset, str]): + filterincident_created_atlt (Union[Unset, str]): + filterincident_created_atlte (Union[Unset, str]): + filterdue_dategt (Union[Unset, str]): + filterdue_dategte (Union[Unset, str]): + filterdue_datelt (Union[Unset, str]): + filterdue_datelte (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterkindeq (Union[Unset, str]): + filterkindnot_eq (Union[Unset, str]): + filterkindin (Union[Unset, str]): + filterkindnot_in (Union[Unset, str]): + filterpriorityeq (Union[Unset, str]): + filterprioritynot_eq (Union[Unset, str]): + filterpriorityin (Union[Unset, str]): + filterprioritynot_in (Union[Unset, str]): + filterstatuseq (Union[Unset, str]): + filterstatusnot_eq (Union[Unset, str]): + filterstatusin (Union[Unset, str]): + filterstatusnot_in (Union[Unset, str]): + filterincident_statuseq (Union[Unset, str]): + filterincident_statusnot_eq (Union[Unset, str]): + filterincident_statusin (Union[Unset, str]): + filterincident_statusnot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -561,84 +562,84 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterkind: str | Unset = UNSET, - filterpriority: str | Unset = UNSET, - filterstatus: str | Unset = UNSET, - filterincident_status: str | Unset = UNSET, - filterincident_created_atgt: str | Unset = UNSET, - filterincident_created_atgte: str | Unset = UNSET, - filterincident_created_atlt: str | Unset = UNSET, - filterincident_created_atlte: str | Unset = UNSET, - filterdue_dategt: str | Unset = UNSET, - filterdue_dategte: str | Unset = UNSET, - filterdue_datelt: str | Unset = UNSET, - filterdue_datelte: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterkindeq: str | Unset = UNSET, - filterkindnot_eq: str | Unset = UNSET, - filterkindin: str | Unset = UNSET, - filterkindnot_in: str | Unset = UNSET, - filterpriorityeq: str | Unset = UNSET, - filterprioritynot_eq: str | Unset = UNSET, - filterpriorityin: str | Unset = UNSET, - filterprioritynot_in: str | Unset = UNSET, - filterstatuseq: str | Unset = UNSET, - filterstatusnot_eq: str | Unset = UNSET, - filterstatusin: str | Unset = UNSET, - filterstatusnot_in: str | Unset = UNSET, - filterincident_statuseq: str | Unset = UNSET, - filterincident_statusnot_eq: str | Unset = UNSET, - filterincident_statusin: str | Unset = UNSET, - filterincident_statusnot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, -) -> IncidentActionItemList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterkind: Union[Unset, str] = UNSET, + filterpriority: Union[Unset, str] = UNSET, + filterstatus: Union[Unset, str] = UNSET, + filterincident_status: Union[Unset, str] = UNSET, + filterincident_created_atgt: Union[Unset, str] = UNSET, + filterincident_created_atgte: Union[Unset, str] = UNSET, + filterincident_created_atlt: Union[Unset, str] = UNSET, + filterincident_created_atlte: Union[Unset, str] = UNSET, + filterdue_dategt: Union[Unset, str] = UNSET, + filterdue_dategte: Union[Unset, str] = UNSET, + filterdue_datelt: Union[Unset, str] = UNSET, + filterdue_datelte: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filterkindeq: Union[Unset, str] = UNSET, + filterkindnot_eq: Union[Unset, str] = UNSET, + filterkindin: Union[Unset, str] = UNSET, + filterkindnot_in: Union[Unset, str] = UNSET, + filterpriorityeq: Union[Unset, str] = UNSET, + filterprioritynot_eq: Union[Unset, str] = UNSET, + filterpriorityin: Union[Unset, str] = UNSET, + filterprioritynot_in: Union[Unset, str] = UNSET, + filterstatuseq: Union[Unset, str] = UNSET, + filterstatusnot_eq: Union[Unset, str] = UNSET, + filterstatusin: Union[Unset, str] = UNSET, + filterstatusnot_in: Union[Unset, str] = UNSET, + filterincident_statuseq: Union[Unset, str] = UNSET, + filterincident_statusnot_eq: Union[Unset, str] = UNSET, + filterincident_statusin: Union[Unset, str] = UNSET, + filterincident_statusnot_in: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, +) -> Optional[IncidentActionItemList]: """List all action items for an organization List all action items for an organization Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterkind (str | Unset): - filterpriority (str | Unset): - filterstatus (str | Unset): - filterincident_status (str | Unset): - filterincident_created_atgt (str | Unset): - filterincident_created_atgte (str | Unset): - filterincident_created_atlt (str | Unset): - filterincident_created_atlte (str | Unset): - filterdue_dategt (str | Unset): - filterdue_dategte (str | Unset): - filterdue_datelt (str | Unset): - filterdue_datelte (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterkindeq (str | Unset): - filterkindnot_eq (str | Unset): - filterkindin (str | Unset): - filterkindnot_in (str | Unset): - filterpriorityeq (str | Unset): - filterprioritynot_eq (str | Unset): - filterpriorityin (str | Unset): - filterprioritynot_in (str | Unset): - filterstatuseq (str | Unset): - filterstatusnot_eq (str | Unset): - filterstatusin (str | Unset): - filterstatusnot_in (str | Unset): - filterincident_statuseq (str | Unset): - filterincident_statusnot_eq (str | Unset): - filterincident_statusin (str | Unset): - filterincident_statusnot_in (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterkind (Union[Unset, str]): + filterpriority (Union[Unset, str]): + filterstatus (Union[Unset, str]): + filterincident_status (Union[Unset, str]): + filterincident_created_atgt (Union[Unset, str]): + filterincident_created_atgte (Union[Unset, str]): + filterincident_created_atlt (Union[Unset, str]): + filterincident_created_atlte (Union[Unset, str]): + filterdue_dategt (Union[Unset, str]): + filterdue_dategte (Union[Unset, str]): + filterdue_datelt (Union[Unset, str]): + filterdue_datelte (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterkindeq (Union[Unset, str]): + filterkindnot_eq (Union[Unset, str]): + filterkindin (Union[Unset, str]): + filterkindnot_in (Union[Unset, str]): + filterpriorityeq (Union[Unset, str]): + filterprioritynot_eq (Union[Unset, str]): + filterpriorityin (Union[Unset, str]): + filterprioritynot_in (Union[Unset, str]): + filterstatuseq (Union[Unset, str]): + filterstatusnot_eq (Union[Unset, str]): + filterstatusin (Union[Unset, str]): + filterstatusnot_in (Union[Unset, str]): + filterincident_statuseq (Union[Unset, str]): + filterincident_statusnot_eq (Union[Unset, str]): + filterincident_statusin (Union[Unset, str]): + filterincident_statusnot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/incident_action_items/list_incident_action_items.py b/rootly_sdk/api/incident_action_items/list_incident_action_items.py index da0cf81e..541a55a4 100644 --- a/rootly_sdk/api/incident_action_items/list_incident_action_items.py +++ b/rootly_sdk/api/incident_action_items/list_incident_action_items.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -13,11 +12,10 @@ def _get_kwargs( incident_id: str, *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -30,16 +28,16 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/incidents/{incident_id}/action_items".format( - incident_id=quote(str(incident_id), safe=""), - ), + "url": f"/v1/incidents/{incident_id}/action_items", "params": params, } return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> IncidentActionItemList | None: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[IncidentActionItemList]: if response.status_code == 200: response_200 = IncidentActionItemList.from_dict(response.json()) @@ -52,7 +50,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[IncidentActionItemList]: return Response( status_code=HTTPStatus(response.status_code), @@ -66,9 +64,9 @@ def sync_detailed( incident_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, ) -> Response[IncidentActionItemList]: """List incident action items @@ -76,9 +74,9 @@ def sync_detailed( Args: incident_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -106,19 +104,19 @@ def sync( incident_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, -) -> IncidentActionItemList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, +) -> Optional[IncidentActionItemList]: """List incident action items List incident action items Args: incident_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -141,9 +139,9 @@ async def asyncio_detailed( incident_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, ) -> Response[IncidentActionItemList]: """List incident action items @@ -151,9 +149,9 @@ async def asyncio_detailed( Args: incident_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -179,19 +177,19 @@ async def asyncio( incident_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, -) -> IncidentActionItemList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, +) -> Optional[IncidentActionItemList]: """List incident action items List incident action items Args: incident_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/incident_action_items/update_incident_action_item.py b/rootly_sdk/api/incident_action_items/update_incident_action_item.py index 709c5962..a370f7ff 100644 --- a/rootly_sdk/api/incident_action_items/update_incident_action_item.py +++ b/rootly_sdk/api/incident_action_items/update_incident_action_item.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/action_items/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/action_items/{id}", } _kwargs["json"] = body.to_dict() @@ -35,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | IncidentActionItemResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, IncidentActionItemResponse]]: if response.status_code == 200: response_200 = IncidentActionItemResponse.from_dict(response.json()) @@ -54,8 +51,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | IncidentActionItemResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, IncidentActionItemResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateIncidentActionItem, -) -> Response[ErrorsList | IncidentActionItemResponse]: +) -> Response[Union[ErrorsList, IncidentActionItemResponse]]: """Update an incident action item Update a specific incident action item by id @@ -83,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentActionItemResponse] + Response[Union[ErrorsList, IncidentActionItemResponse]] """ kwargs = _get_kwargs( @@ -103,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateIncidentActionItem, -) -> ErrorsList | IncidentActionItemResponse | None: +) -> Optional[Union[ErrorsList, IncidentActionItemResponse]]: """Update an incident action item Update a specific incident action item by id @@ -117,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentActionItemResponse + Union[ErrorsList, IncidentActionItemResponse] """ return sync_detailed( @@ -132,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateIncidentActionItem, -) -> Response[ErrorsList | IncidentActionItemResponse]: +) -> Response[Union[ErrorsList, IncidentActionItemResponse]]: """Update an incident action item Update a specific incident action item by id @@ -146,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentActionItemResponse] + Response[Union[ErrorsList, IncidentActionItemResponse]] """ kwargs = _get_kwargs( @@ -164,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateIncidentActionItem, -) -> ErrorsList | IncidentActionItemResponse | None: +) -> Optional[Union[ErrorsList, IncidentActionItemResponse]]: """Update an incident action item Update a specific incident action item by id @@ -178,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentActionItemResponse + Union[ErrorsList, IncidentActionItemResponse] """ return ( diff --git a/rootly_sdk/api/incident_event_functionalities/create_incident_event_functionality.py b/rootly_sdk/api/incident_event_functionalities/create_incident_event_functionality.py index 44067ca5..b1c50def 100644 --- a/rootly_sdk/api/incident_event_functionalities/create_incident_event_functionality.py +++ b/rootly_sdk/api/incident_event_functionalities/create_incident_event_functionality.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/events/{incident_event_id}/functionalities".format( - incident_event_id=quote(str(incident_event_id), safe=""), - ), + "url": f"/v1/events/{incident_event_id}/functionalities", } _kwargs["json"] = body.to_dict() @@ -35,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | IncidentEventFunctionalityResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, IncidentEventFunctionalityResponse]]: if response.status_code == 201: response_201 = IncidentEventFunctionalityResponse.from_dict(response.json()) @@ -59,8 +56,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | IncidentEventFunctionalityResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, IncidentEventFunctionalityResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -74,7 +71,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewIncidentEventFunctionality, -) -> Response[ErrorsList | IncidentEventFunctionalityResponse]: +) -> Response[Union[ErrorsList, IncidentEventFunctionalityResponse]]: """Creates an incident event functionality Creates a new event functionality from provided data @@ -88,7 +85,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentEventFunctionalityResponse] + Response[Union[ErrorsList, IncidentEventFunctionalityResponse]] """ kwargs = _get_kwargs( @@ -108,7 +105,7 @@ def sync( *, client: AuthenticatedClient, body: NewIncidentEventFunctionality, -) -> ErrorsList | IncidentEventFunctionalityResponse | None: +) -> Optional[Union[ErrorsList, IncidentEventFunctionalityResponse]]: """Creates an incident event functionality Creates a new event functionality from provided data @@ -122,7 +119,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentEventFunctionalityResponse + Union[ErrorsList, IncidentEventFunctionalityResponse] """ return sync_detailed( @@ -137,7 +134,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewIncidentEventFunctionality, -) -> Response[ErrorsList | IncidentEventFunctionalityResponse]: +) -> Response[Union[ErrorsList, IncidentEventFunctionalityResponse]]: """Creates an incident event functionality Creates a new event functionality from provided data @@ -151,7 +148,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentEventFunctionalityResponse] + Response[Union[ErrorsList, IncidentEventFunctionalityResponse]] """ kwargs = _get_kwargs( @@ -169,7 +166,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewIncidentEventFunctionality, -) -> ErrorsList | IncidentEventFunctionalityResponse | None: +) -> Optional[Union[ErrorsList, IncidentEventFunctionalityResponse]]: """Creates an incident event functionality Creates a new event functionality from provided data @@ -183,7 +180,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentEventFunctionalityResponse + Union[ErrorsList, IncidentEventFunctionalityResponse] """ return ( diff --git a/rootly_sdk/api/incident_event_functionalities/delete_incident_event_functionality.py b/rootly_sdk/api/incident_event_functionalities/delete_incident_event_functionality.py index 31be22c6..0f934365 100644 --- a/rootly_sdk/api/incident_event_functionalities/delete_incident_event_functionality.py +++ b/rootly_sdk/api/incident_event_functionalities/delete_incident_event_functionality.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/incident_event_functionalities/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/incident_event_functionalities/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | IncidentEventFunctionalityResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, IncidentEventFunctionalityResponse]]: if response.status_code == 200: response_200 = IncidentEventFunctionalityResponse.from_dict(response.json()) @@ -45,8 +41,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | IncidentEventFunctionalityResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, IncidentEventFunctionalityResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | IncidentEventFunctionalityResponse]: +) -> Response[Union[ErrorsList, IncidentEventFunctionalityResponse]]: """Delete an incident event functionality Delete a specific incident event functionality by id @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentEventFunctionalityResponse] + Response[Union[ErrorsList, IncidentEventFunctionalityResponse]] """ kwargs = _get_kwargs( @@ -90,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | IncidentEventFunctionalityResponse | None: +) -> Optional[Union[ErrorsList, IncidentEventFunctionalityResponse]]: """Delete an incident event functionality Delete a specific incident event functionality by id @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentEventFunctionalityResponse + Union[ErrorsList, IncidentEventFunctionalityResponse] """ return sync_detailed( @@ -116,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | IncidentEventFunctionalityResponse]: +) -> Response[Union[ErrorsList, IncidentEventFunctionalityResponse]]: """Delete an incident event functionality Delete a specific incident event functionality by id @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentEventFunctionalityResponse] + Response[Union[ErrorsList, IncidentEventFunctionalityResponse]] """ kwargs = _get_kwargs( @@ -145,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | IncidentEventFunctionalityResponse | None: +) -> Optional[Union[ErrorsList, IncidentEventFunctionalityResponse]]: """Delete an incident event functionality Delete a specific incident event functionality by id @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentEventFunctionalityResponse + Union[ErrorsList, IncidentEventFunctionalityResponse] """ return ( diff --git a/rootly_sdk/api/incident_event_functionalities/get_incident_event_functionalities.py b/rootly_sdk/api/incident_event_functionalities/get_incident_event_functionalities.py index 5b698657..b1913571 100644 --- a/rootly_sdk/api/incident_event_functionalities/get_incident_event_functionalities.py +++ b/rootly_sdk/api/incident_event_functionalities/get_incident_event_functionalities.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/incident_event_functionalities/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/incident_event_functionalities/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | IncidentEventFunctionalityResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, IncidentEventFunctionalityResponse]]: if response.status_code == 200: response_200 = IncidentEventFunctionalityResponse.from_dict(response.json()) @@ -45,8 +41,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | IncidentEventFunctionalityResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, IncidentEventFunctionalityResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | IncidentEventFunctionalityResponse]: +) -> Response[Union[ErrorsList, IncidentEventFunctionalityResponse]]: """Retrieves an incident event functionality Retrieves a specific incident_event_functionality by id @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentEventFunctionalityResponse] + Response[Union[ErrorsList, IncidentEventFunctionalityResponse]] """ kwargs = _get_kwargs( @@ -90,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | IncidentEventFunctionalityResponse | None: +) -> Optional[Union[ErrorsList, IncidentEventFunctionalityResponse]]: """Retrieves an incident event functionality Retrieves a specific incident_event_functionality by id @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentEventFunctionalityResponse + Union[ErrorsList, IncidentEventFunctionalityResponse] """ return sync_detailed( @@ -116,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | IncidentEventFunctionalityResponse]: +) -> Response[Union[ErrorsList, IncidentEventFunctionalityResponse]]: """Retrieves an incident event functionality Retrieves a specific incident_event_functionality by id @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentEventFunctionalityResponse] + Response[Union[ErrorsList, IncidentEventFunctionalityResponse]] """ kwargs = _get_kwargs( @@ -145,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | IncidentEventFunctionalityResponse | None: +) -> Optional[Union[ErrorsList, IncidentEventFunctionalityResponse]]: """Retrieves an incident event functionality Retrieves a specific incident_event_functionality by id @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentEventFunctionalityResponse + Union[ErrorsList, IncidentEventFunctionalityResponse] """ return ( diff --git a/rootly_sdk/api/incident_event_functionalities/list_incident_event_functionalities.py b/rootly_sdk/api/incident_event_functionalities/list_incident_event_functionalities.py index 805eeb7a..65374aac 100644 --- a/rootly_sdk/api/incident_event_functionalities/list_incident_event_functionalities.py +++ b/rootly_sdk/api/incident_event_functionalities/list_incident_event_functionalities.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -13,11 +12,10 @@ def _get_kwargs( incident_event_id: str, *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -30,9 +28,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/events/{incident_event_id}/functionalities".format( - incident_event_id=quote(str(incident_event_id), safe=""), - ), + "url": f"/v1/events/{incident_event_id}/functionalities", "params": params, } @@ -40,8 +36,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> IncidentEventFunctionalityList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[IncidentEventFunctionalityList]: if response.status_code == 200: response_200 = IncidentEventFunctionalityList.from_dict(response.json()) @@ -54,7 +50,7 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[IncidentEventFunctionalityList]: return Response( status_code=HTTPStatus(response.status_code), @@ -68,9 +64,9 @@ def sync_detailed( incident_event_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, ) -> Response[IncidentEventFunctionalityList]: """List incident event functionalities @@ -78,9 +74,9 @@ def sync_detailed( Args: incident_event_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -108,19 +104,19 @@ def sync( incident_event_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, -) -> IncidentEventFunctionalityList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, +) -> Optional[IncidentEventFunctionalityList]: """List incident event functionalities List incident event functionalities Args: incident_event_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -143,9 +139,9 @@ async def asyncio_detailed( incident_event_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, ) -> Response[IncidentEventFunctionalityList]: """List incident event functionalities @@ -153,9 +149,9 @@ async def asyncio_detailed( Args: incident_event_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -181,19 +177,19 @@ async def asyncio( incident_event_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, -) -> IncidentEventFunctionalityList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, +) -> Optional[IncidentEventFunctionalityList]: """List incident event functionalities List incident event functionalities Args: incident_event_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/incident_event_functionalities/update_incident_event_functionality.py b/rootly_sdk/api/incident_event_functionalities/update_incident_event_functionality.py index 3f2bf2b7..4e3b4c62 100644 --- a/rootly_sdk/api/incident_event_functionalities/update_incident_event_functionality.py +++ b/rootly_sdk/api/incident_event_functionalities/update_incident_event_functionality.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/incident_event_functionalities/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/incident_event_functionalities/{id}", } _kwargs["json"] = body.to_dict() @@ -35,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | IncidentEventFunctionalityResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, IncidentEventFunctionalityResponse]]: if response.status_code == 200: response_200 = IncidentEventFunctionalityResponse.from_dict(response.json()) @@ -54,8 +51,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | IncidentEventFunctionalityResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, IncidentEventFunctionalityResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateIncidentEventFunctionality, -) -> Response[ErrorsList | IncidentEventFunctionalityResponse]: +) -> Response[Union[ErrorsList, IncidentEventFunctionalityResponse]]: """Update an incident event Update a specific incident event functionality by id @@ -83,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentEventFunctionalityResponse] + Response[Union[ErrorsList, IncidentEventFunctionalityResponse]] """ kwargs = _get_kwargs( @@ -103,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateIncidentEventFunctionality, -) -> ErrorsList | IncidentEventFunctionalityResponse | None: +) -> Optional[Union[ErrorsList, IncidentEventFunctionalityResponse]]: """Update an incident event Update a specific incident event functionality by id @@ -117,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentEventFunctionalityResponse + Union[ErrorsList, IncidentEventFunctionalityResponse] """ return sync_detailed( @@ -132,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateIncidentEventFunctionality, -) -> Response[ErrorsList | IncidentEventFunctionalityResponse]: +) -> Response[Union[ErrorsList, IncidentEventFunctionalityResponse]]: """Update an incident event Update a specific incident event functionality by id @@ -146,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentEventFunctionalityResponse] + Response[Union[ErrorsList, IncidentEventFunctionalityResponse]] """ kwargs = _get_kwargs( @@ -164,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateIncidentEventFunctionality, -) -> ErrorsList | IncidentEventFunctionalityResponse | None: +) -> Optional[Union[ErrorsList, IncidentEventFunctionalityResponse]]: """Update an incident event Update a specific incident event functionality by id @@ -178,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentEventFunctionalityResponse + Union[ErrorsList, IncidentEventFunctionalityResponse] """ return ( diff --git a/rootly_sdk/api/incident_event_services/create_incident_event_service.py b/rootly_sdk/api/incident_event_services/create_incident_event_service.py index e1b7f48f..88cb5b8c 100644 --- a/rootly_sdk/api/incident_event_services/create_incident_event_service.py +++ b/rootly_sdk/api/incident_event_services/create_incident_event_service.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/events/{incident_event_id}/services".format( - incident_event_id=quote(str(incident_event_id), safe=""), - ), + "url": f"/v1/events/{incident_event_id}/services", } _kwargs["json"] = body.to_dict() @@ -35,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | IncidentEventServiceResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, IncidentEventServiceResponse]]: if response.status_code == 201: response_201 = IncidentEventServiceResponse.from_dict(response.json()) @@ -59,8 +56,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | IncidentEventServiceResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, IncidentEventServiceResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -74,7 +71,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewIncidentEventService, -) -> Response[ErrorsList | IncidentEventServiceResponse]: +) -> Response[Union[ErrorsList, IncidentEventServiceResponse]]: """Creates an incident event service Creates a new event service from provided data @@ -88,7 +85,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentEventServiceResponse] + Response[Union[ErrorsList, IncidentEventServiceResponse]] """ kwargs = _get_kwargs( @@ -108,7 +105,7 @@ def sync( *, client: AuthenticatedClient, body: NewIncidentEventService, -) -> ErrorsList | IncidentEventServiceResponse | None: +) -> Optional[Union[ErrorsList, IncidentEventServiceResponse]]: """Creates an incident event service Creates a new event service from provided data @@ -122,7 +119,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentEventServiceResponse + Union[ErrorsList, IncidentEventServiceResponse] """ return sync_detailed( @@ -137,7 +134,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewIncidentEventService, -) -> Response[ErrorsList | IncidentEventServiceResponse]: +) -> Response[Union[ErrorsList, IncidentEventServiceResponse]]: """Creates an incident event service Creates a new event service from provided data @@ -151,7 +148,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentEventServiceResponse] + Response[Union[ErrorsList, IncidentEventServiceResponse]] """ kwargs = _get_kwargs( @@ -169,7 +166,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewIncidentEventService, -) -> ErrorsList | IncidentEventServiceResponse | None: +) -> Optional[Union[ErrorsList, IncidentEventServiceResponse]]: """Creates an incident event service Creates a new event service from provided data @@ -183,7 +180,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentEventServiceResponse + Union[ErrorsList, IncidentEventServiceResponse] """ return ( diff --git a/rootly_sdk/api/incident_event_services/delete_incident_event_service.py b/rootly_sdk/api/incident_event_services/delete_incident_event_service.py index e4ce309c..4e789fb7 100644 --- a/rootly_sdk/api/incident_event_services/delete_incident_event_service.py +++ b/rootly_sdk/api/incident_event_services/delete_incident_event_service.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/incident_event_services/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/incident_event_services/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | IncidentEventServiceResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, IncidentEventServiceResponse]]: if response.status_code == 200: response_200 = IncidentEventServiceResponse.from_dict(response.json()) @@ -45,8 +41,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | IncidentEventServiceResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, IncidentEventServiceResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | IncidentEventServiceResponse]: +) -> Response[Union[ErrorsList, IncidentEventServiceResponse]]: """Delete an incident event functionalitu Delete a specific incident event service by id @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentEventServiceResponse] + Response[Union[ErrorsList, IncidentEventServiceResponse]] """ kwargs = _get_kwargs( @@ -90,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | IncidentEventServiceResponse | None: +) -> Optional[Union[ErrorsList, IncidentEventServiceResponse]]: """Delete an incident event functionalitu Delete a specific incident event service by id @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentEventServiceResponse + Union[ErrorsList, IncidentEventServiceResponse] """ return sync_detailed( @@ -116,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | IncidentEventServiceResponse]: +) -> Response[Union[ErrorsList, IncidentEventServiceResponse]]: """Delete an incident event functionalitu Delete a specific incident event service by id @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentEventServiceResponse] + Response[Union[ErrorsList, IncidentEventServiceResponse]] """ kwargs = _get_kwargs( @@ -145,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | IncidentEventServiceResponse | None: +) -> Optional[Union[ErrorsList, IncidentEventServiceResponse]]: """Delete an incident event functionalitu Delete a specific incident event service by id @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentEventServiceResponse + Union[ErrorsList, IncidentEventServiceResponse] """ return ( diff --git a/rootly_sdk/api/incident_event_services/get_incident_event_services.py b/rootly_sdk/api/incident_event_services/get_incident_event_services.py index 83c948c2..aeedae16 100644 --- a/rootly_sdk/api/incident_event_services/get_incident_event_services.py +++ b/rootly_sdk/api/incident_event_services/get_incident_event_services.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/incident_event_services/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/incident_event_services/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | IncidentEventServiceResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, IncidentEventServiceResponse]]: if response.status_code == 200: response_200 = IncidentEventServiceResponse.from_dict(response.json()) @@ -45,8 +41,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | IncidentEventServiceResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, IncidentEventServiceResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | IncidentEventServiceResponse]: +) -> Response[Union[ErrorsList, IncidentEventServiceResponse]]: """Retrieves an incident event service Retrieves a specific incident_event_service by id @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentEventServiceResponse] + Response[Union[ErrorsList, IncidentEventServiceResponse]] """ kwargs = _get_kwargs( @@ -90,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | IncidentEventServiceResponse | None: +) -> Optional[Union[ErrorsList, IncidentEventServiceResponse]]: """Retrieves an incident event service Retrieves a specific incident_event_service by id @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentEventServiceResponse + Union[ErrorsList, IncidentEventServiceResponse] """ return sync_detailed( @@ -116,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | IncidentEventServiceResponse]: +) -> Response[Union[ErrorsList, IncidentEventServiceResponse]]: """Retrieves an incident event service Retrieves a specific incident_event_service by id @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentEventServiceResponse] + Response[Union[ErrorsList, IncidentEventServiceResponse]] """ kwargs = _get_kwargs( @@ -145,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | IncidentEventServiceResponse | None: +) -> Optional[Union[ErrorsList, IncidentEventServiceResponse]]: """Retrieves an incident event service Retrieves a specific incident_event_service by id @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentEventServiceResponse + Union[ErrorsList, IncidentEventServiceResponse] """ return ( diff --git a/rootly_sdk/api/incident_event_services/list_incident_event_services.py b/rootly_sdk/api/incident_event_services/list_incident_event_services.py index 5087b62e..b8b44bad 100644 --- a/rootly_sdk/api/incident_event_services/list_incident_event_services.py +++ b/rootly_sdk/api/incident_event_services/list_incident_event_services.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -13,11 +12,10 @@ def _get_kwargs( incident_event_id: str, *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -30,9 +28,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/events/{incident_event_id}/services".format( - incident_event_id=quote(str(incident_event_id), safe=""), - ), + "url": f"/v1/events/{incident_event_id}/services", "params": params, } @@ -40,8 +36,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> IncidentEventServiceList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[IncidentEventServiceList]: if response.status_code == 200: response_200 = IncidentEventServiceList.from_dict(response.json()) @@ -54,7 +50,7 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[IncidentEventServiceList]: return Response( status_code=HTTPStatus(response.status_code), @@ -68,9 +64,9 @@ def sync_detailed( incident_event_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, ) -> Response[IncidentEventServiceList]: """List incident event services @@ -78,9 +74,9 @@ def sync_detailed( Args: incident_event_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -108,19 +104,19 @@ def sync( incident_event_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, -) -> IncidentEventServiceList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, +) -> Optional[IncidentEventServiceList]: """List incident event services List incident event services Args: incident_event_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -143,9 +139,9 @@ async def asyncio_detailed( incident_event_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, ) -> Response[IncidentEventServiceList]: """List incident event services @@ -153,9 +149,9 @@ async def asyncio_detailed( Args: incident_event_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -181,19 +177,19 @@ async def asyncio( incident_event_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, -) -> IncidentEventServiceList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, +) -> Optional[IncidentEventServiceList]: """List incident event services List incident event services Args: incident_event_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/incident_event_services/update_incident_event_service.py b/rootly_sdk/api/incident_event_services/update_incident_event_service.py index 11e2528f..ba086e52 100644 --- a/rootly_sdk/api/incident_event_services/update_incident_event_service.py +++ b/rootly_sdk/api/incident_event_services/update_incident_event_service.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/incident_event_services/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/incident_event_services/{id}", } _kwargs["json"] = body.to_dict() @@ -35,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | IncidentEventServiceResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, IncidentEventServiceResponse]]: if response.status_code == 200: response_200 = IncidentEventServiceResponse.from_dict(response.json()) @@ -54,8 +51,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | IncidentEventServiceResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, IncidentEventServiceResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateIncidentEventService, -) -> Response[ErrorsList | IncidentEventServiceResponse]: +) -> Response[Union[ErrorsList, IncidentEventServiceResponse]]: """Update an incident event Update a specific incident event service by id @@ -83,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentEventServiceResponse] + Response[Union[ErrorsList, IncidentEventServiceResponse]] """ kwargs = _get_kwargs( @@ -103,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateIncidentEventService, -) -> ErrorsList | IncidentEventServiceResponse | None: +) -> Optional[Union[ErrorsList, IncidentEventServiceResponse]]: """Update an incident event Update a specific incident event service by id @@ -117,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentEventServiceResponse + Union[ErrorsList, IncidentEventServiceResponse] """ return sync_detailed( @@ -132,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateIncidentEventService, -) -> Response[ErrorsList | IncidentEventServiceResponse]: +) -> Response[Union[ErrorsList, IncidentEventServiceResponse]]: """Update an incident event Update a specific incident event service by id @@ -146,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentEventServiceResponse] + Response[Union[ErrorsList, IncidentEventServiceResponse]] """ kwargs = _get_kwargs( @@ -164,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateIncidentEventService, -) -> ErrorsList | IncidentEventServiceResponse | None: +) -> Optional[Union[ErrorsList, IncidentEventServiceResponse]]: """Update an incident event Update a specific incident event service by id @@ -178,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentEventServiceResponse + Union[ErrorsList, IncidentEventServiceResponse] """ return ( diff --git a/rootly_sdk/api/incident_events/create_incident_event.py b/rootly_sdk/api/incident_events/create_incident_event.py index 443576f9..4e2580bb 100644 --- a/rootly_sdk/api/incident_events/create_incident_event.py +++ b/rootly_sdk/api/incident_events/create_incident_event.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/incidents/{incident_id}/events".format( - incident_id=quote(str(incident_id), safe=""), - ), + "url": f"/v1/incidents/{incident_id}/events", } _kwargs["json"] = body.to_dict() @@ -35,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | IncidentEventResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, IncidentEventResponse]]: if response.status_code == 201: response_201 = IncidentEventResponse.from_dict(response.json()) @@ -59,8 +56,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | IncidentEventResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, IncidentEventResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -74,7 +71,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewIncidentEvent, -) -> Response[ErrorsList | IncidentEventResponse]: +) -> Response[Union[ErrorsList, IncidentEventResponse]]: """Creates an incident event Creates a new event from provided data @@ -88,7 +85,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentEventResponse] + Response[Union[ErrorsList, IncidentEventResponse]] """ kwargs = _get_kwargs( @@ -108,7 +105,7 @@ def sync( *, client: AuthenticatedClient, body: NewIncidentEvent, -) -> ErrorsList | IncidentEventResponse | None: +) -> Optional[Union[ErrorsList, IncidentEventResponse]]: """Creates an incident event Creates a new event from provided data @@ -122,7 +119,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentEventResponse + Union[ErrorsList, IncidentEventResponse] """ return sync_detailed( @@ -137,7 +134,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewIncidentEvent, -) -> Response[ErrorsList | IncidentEventResponse]: +) -> Response[Union[ErrorsList, IncidentEventResponse]]: """Creates an incident event Creates a new event from provided data @@ -151,7 +148,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentEventResponse] + Response[Union[ErrorsList, IncidentEventResponse]] """ kwargs = _get_kwargs( @@ -169,7 +166,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewIncidentEvent, -) -> ErrorsList | IncidentEventResponse | None: +) -> Optional[Union[ErrorsList, IncidentEventResponse]]: """Creates an incident event Creates a new event from provided data @@ -183,7 +180,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentEventResponse + Union[ErrorsList, IncidentEventResponse] """ return ( diff --git a/rootly_sdk/api/incident_events/delete_incident_event.py b/rootly_sdk/api/incident_events/delete_incident_event.py index 906602f5..13fe1ae0 100644 --- a/rootly_sdk/api/incident_events/delete_incident_event.py +++ b/rootly_sdk/api/incident_events/delete_incident_event.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/events/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/events/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | IncidentEventResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, IncidentEventResponse]]: if response.status_code == 200: response_200 = IncidentEventResponse.from_dict(response.json()) @@ -45,8 +41,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | IncidentEventResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, IncidentEventResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | IncidentEventResponse]: +) -> Response[Union[ErrorsList, IncidentEventResponse]]: """Delete an incident event Delete a specific incident event by id @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentEventResponse] + Response[Union[ErrorsList, IncidentEventResponse]] """ kwargs = _get_kwargs( @@ -90,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | IncidentEventResponse | None: +) -> Optional[Union[ErrorsList, IncidentEventResponse]]: """Delete an incident event Delete a specific incident event by id @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentEventResponse + Union[ErrorsList, IncidentEventResponse] """ return sync_detailed( @@ -116,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | IncidentEventResponse]: +) -> Response[Union[ErrorsList, IncidentEventResponse]]: """Delete an incident event Delete a specific incident event by id @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentEventResponse] + Response[Union[ErrorsList, IncidentEventResponse]] """ kwargs = _get_kwargs( @@ -145,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | IncidentEventResponse | None: +) -> Optional[Union[ErrorsList, IncidentEventResponse]]: """Delete an incident event Delete a specific incident event by id @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentEventResponse + Union[ErrorsList, IncidentEventResponse] """ return ( diff --git a/rootly_sdk/api/incident_events/get_incident_events.py b/rootly_sdk/api/incident_events/get_incident_events.py index 092a2816..7782f618 100644 --- a/rootly_sdk/api/incident_events/get_incident_events.py +++ b/rootly_sdk/api/incident_events/get_incident_events.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/events/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/events/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | IncidentEventResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, IncidentEventResponse]]: if response.status_code == 200: response_200 = IncidentEventResponse.from_dict(response.json()) @@ -45,8 +41,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | IncidentEventResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, IncidentEventResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | IncidentEventResponse]: +) -> Response[Union[ErrorsList, IncidentEventResponse]]: """Retrieves an incident event Retrieves a specific incident_event by id @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentEventResponse] + Response[Union[ErrorsList, IncidentEventResponse]] """ kwargs = _get_kwargs( @@ -90,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | IncidentEventResponse | None: +) -> Optional[Union[ErrorsList, IncidentEventResponse]]: """Retrieves an incident event Retrieves a specific incident_event by id @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentEventResponse + Union[ErrorsList, IncidentEventResponse] """ return sync_detailed( @@ -116,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | IncidentEventResponse]: +) -> Response[Union[ErrorsList, IncidentEventResponse]]: """Retrieves an incident event Retrieves a specific incident_event by id @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentEventResponse] + Response[Union[ErrorsList, IncidentEventResponse]] """ kwargs = _get_kwargs( @@ -145,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | IncidentEventResponse | None: +) -> Optional[Union[ErrorsList, IncidentEventResponse]]: """Retrieves an incident event Retrieves a specific incident_event by id @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentEventResponse + Union[ErrorsList, IncidentEventResponse] """ return ( diff --git a/rootly_sdk/api/incident_events/list_incident_events.py b/rootly_sdk/api/incident_events/list_incident_events.py index ddd02177..2df8fc47 100644 --- a/rootly_sdk/api/incident_events/list_incident_events.py +++ b/rootly_sdk/api/incident_events/list_incident_events.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -13,11 +12,10 @@ def _get_kwargs( incident_id: str, *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -30,16 +28,16 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/incidents/{incident_id}/events".format( - incident_id=quote(str(incident_id), safe=""), - ), + "url": f"/v1/incidents/{incident_id}/events", "params": params, } return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> IncidentEventList | None: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[IncidentEventList]: if response.status_code == 200: response_200 = IncidentEventList.from_dict(response.json()) @@ -51,7 +49,9 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[IncidentEventList]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[IncidentEventList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -64,9 +64,9 @@ def sync_detailed( incident_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, ) -> Response[IncidentEventList]: """List incident events @@ -74,9 +74,9 @@ def sync_detailed( Args: incident_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -104,19 +104,19 @@ def sync( incident_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, -) -> IncidentEventList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, +) -> Optional[IncidentEventList]: """List incident events List incident events Args: incident_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -139,9 +139,9 @@ async def asyncio_detailed( incident_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, ) -> Response[IncidentEventList]: """List incident events @@ -149,9 +149,9 @@ async def asyncio_detailed( Args: incident_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -177,19 +177,19 @@ async def asyncio( incident_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, -) -> IncidentEventList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, +) -> Optional[IncidentEventList]: """List incident events List incident events Args: incident_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/incident_events/update_incident_event.py b/rootly_sdk/api/incident_events/update_incident_event.py index 6e364970..d30cddb0 100644 --- a/rootly_sdk/api/incident_events/update_incident_event.py +++ b/rootly_sdk/api/incident_events/update_incident_event.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/events/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/events/{id}", } _kwargs["json"] = body.to_dict() @@ -35,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | IncidentEventResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, IncidentEventResponse]]: if response.status_code == 200: response_200 = IncidentEventResponse.from_dict(response.json()) @@ -54,8 +51,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | IncidentEventResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, IncidentEventResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateIncidentEvent, -) -> Response[ErrorsList | IncidentEventResponse]: +) -> Response[Union[ErrorsList, IncidentEventResponse]]: """Update an incident event Update a specific incident event by id @@ -83,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentEventResponse] + Response[Union[ErrorsList, IncidentEventResponse]] """ kwargs = _get_kwargs( @@ -103,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateIncidentEvent, -) -> ErrorsList | IncidentEventResponse | None: +) -> Optional[Union[ErrorsList, IncidentEventResponse]]: """Update an incident event Update a specific incident event by id @@ -117,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentEventResponse + Union[ErrorsList, IncidentEventResponse] """ return sync_detailed( @@ -132,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateIncidentEvent, -) -> Response[ErrorsList | IncidentEventResponse]: +) -> Response[Union[ErrorsList, IncidentEventResponse]]: """Update an incident event Update a specific incident event by id @@ -146,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentEventResponse] + Response[Union[ErrorsList, IncidentEventResponse]] """ kwargs = _get_kwargs( @@ -164,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateIncidentEvent, -) -> ErrorsList | IncidentEventResponse | None: +) -> Optional[Union[ErrorsList, IncidentEventResponse]]: """Update an incident event Update a specific incident event by id @@ -178,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentEventResponse + Union[ErrorsList, IncidentEventResponse] """ return ( diff --git a/rootly_sdk/api/incident_feedbacks/create_incident_feedback.py b/rootly_sdk/api/incident_feedbacks/create_incident_feedback.py index 3a29fbc2..1cbb51ee 100644 --- a/rootly_sdk/api/incident_feedbacks/create_incident_feedback.py +++ b/rootly_sdk/api/incident_feedbacks/create_incident_feedback.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/incidents/{incident_id}/feedbacks".format( - incident_id=quote(str(incident_id), safe=""), - ), + "url": f"/v1/incidents/{incident_id}/feedbacks", } _kwargs["json"] = body.to_dict() @@ -35,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | IncidentFeedbackResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, IncidentFeedbackResponse]]: if response.status_code == 201: response_201 = IncidentFeedbackResponse.from_dict(response.json()) @@ -59,8 +56,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | IncidentFeedbackResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, IncidentFeedbackResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -74,7 +71,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewIncidentFeedback, -) -> Response[ErrorsList | IncidentFeedbackResponse]: +) -> Response[Union[ErrorsList, IncidentFeedbackResponse]]: """Creates an incident feedback Creates a new feedback from provided data @@ -88,7 +85,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentFeedbackResponse] + Response[Union[ErrorsList, IncidentFeedbackResponse]] """ kwargs = _get_kwargs( @@ -108,7 +105,7 @@ def sync( *, client: AuthenticatedClient, body: NewIncidentFeedback, -) -> ErrorsList | IncidentFeedbackResponse | None: +) -> Optional[Union[ErrorsList, IncidentFeedbackResponse]]: """Creates an incident feedback Creates a new feedback from provided data @@ -122,7 +119,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentFeedbackResponse + Union[ErrorsList, IncidentFeedbackResponse] """ return sync_detailed( @@ -137,7 +134,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewIncidentFeedback, -) -> Response[ErrorsList | IncidentFeedbackResponse]: +) -> Response[Union[ErrorsList, IncidentFeedbackResponse]]: """Creates an incident feedback Creates a new feedback from provided data @@ -151,7 +148,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentFeedbackResponse] + Response[Union[ErrorsList, IncidentFeedbackResponse]] """ kwargs = _get_kwargs( @@ -169,7 +166,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewIncidentFeedback, -) -> ErrorsList | IncidentFeedbackResponse | None: +) -> Optional[Union[ErrorsList, IncidentFeedbackResponse]]: """Creates an incident feedback Creates a new feedback from provided data @@ -183,7 +180,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentFeedbackResponse + Union[ErrorsList, IncidentFeedbackResponse] """ return ( diff --git a/rootly_sdk/api/incident_feedbacks/get_incident_feedbacks.py b/rootly_sdk/api/incident_feedbacks/get_incident_feedbacks.py index 6c834602..2158a77c 100644 --- a/rootly_sdk/api/incident_feedbacks/get_incident_feedbacks.py +++ b/rootly_sdk/api/incident_feedbacks/get_incident_feedbacks.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/feedbacks/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/feedbacks/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | IncidentFeedbackResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, IncidentFeedbackResponse]]: if response.status_code == 200: response_200 = IncidentFeedbackResponse.from_dict(response.json()) @@ -45,8 +41,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | IncidentFeedbackResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, IncidentFeedbackResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | IncidentFeedbackResponse]: +) -> Response[Union[ErrorsList, IncidentFeedbackResponse]]: """Retrieves an incident feedback Retrieves a specific incident_feedback by id @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentFeedbackResponse] + Response[Union[ErrorsList, IncidentFeedbackResponse]] """ kwargs = _get_kwargs( @@ -90,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | IncidentFeedbackResponse | None: +) -> Optional[Union[ErrorsList, IncidentFeedbackResponse]]: """Retrieves an incident feedback Retrieves a specific incident_feedback by id @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentFeedbackResponse + Union[ErrorsList, IncidentFeedbackResponse] """ return sync_detailed( @@ -116,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | IncidentFeedbackResponse]: +) -> Response[Union[ErrorsList, IncidentFeedbackResponse]]: """Retrieves an incident feedback Retrieves a specific incident_feedback by id @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentFeedbackResponse] + Response[Union[ErrorsList, IncidentFeedbackResponse]] """ kwargs = _get_kwargs( @@ -145,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | IncidentFeedbackResponse | None: +) -> Optional[Union[ErrorsList, IncidentFeedbackResponse]]: """Retrieves an incident feedback Retrieves a specific incident_feedback by id @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentFeedbackResponse + Union[ErrorsList, IncidentFeedbackResponse] """ return ( diff --git a/rootly_sdk/api/incident_feedbacks/list_incident_feedbacks.py b/rootly_sdk/api/incident_feedbacks/list_incident_feedbacks.py index e9606100..ed523ed2 100644 --- a/rootly_sdk/api/incident_feedbacks/list_incident_feedbacks.py +++ b/rootly_sdk/api/incident_feedbacks/list_incident_feedbacks.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -13,11 +12,10 @@ def _get_kwargs( incident_id: str, *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -30,16 +28,16 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/incidents/{incident_id}/feedbacks".format( - incident_id=quote(str(incident_id), safe=""), - ), + "url": f"/v1/incidents/{incident_id}/feedbacks", "params": params, } return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> IncidentFeedbackList | None: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[IncidentFeedbackList]: if response.status_code == 200: response_200 = IncidentFeedbackList.from_dict(response.json()) @@ -52,7 +50,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[IncidentFeedbackList]: return Response( status_code=HTTPStatus(response.status_code), @@ -66,9 +64,9 @@ def sync_detailed( incident_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, ) -> Response[IncidentFeedbackList]: """List incident feedbacks @@ -76,9 +74,9 @@ def sync_detailed( Args: incident_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -106,19 +104,19 @@ def sync( incident_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, -) -> IncidentFeedbackList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, +) -> Optional[IncidentFeedbackList]: """List incident feedbacks List incident feedbacks Args: incident_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -141,9 +139,9 @@ async def asyncio_detailed( incident_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, ) -> Response[IncidentFeedbackList]: """List incident feedbacks @@ -151,9 +149,9 @@ async def asyncio_detailed( Args: incident_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -179,19 +177,19 @@ async def asyncio( incident_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, -) -> IncidentFeedbackList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, +) -> Optional[IncidentFeedbackList]: """List incident feedbacks List incident feedbacks Args: incident_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/incident_feedbacks/update_incident_feedback.py b/rootly_sdk/api/incident_feedbacks/update_incident_feedback.py index 95e97705..a07f8db8 100644 --- a/rootly_sdk/api/incident_feedbacks/update_incident_feedback.py +++ b/rootly_sdk/api/incident_feedbacks/update_incident_feedback.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/feedbacks/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/feedbacks/{id}", } _kwargs["json"] = body.to_dict() @@ -35,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | IncidentFeedbackResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, IncidentFeedbackResponse]]: if response.status_code == 200: response_200 = IncidentFeedbackResponse.from_dict(response.json()) @@ -54,8 +51,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | IncidentFeedbackResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, IncidentFeedbackResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateIncidentFeedback, -) -> Response[ErrorsList | IncidentFeedbackResponse]: +) -> Response[Union[ErrorsList, IncidentFeedbackResponse]]: """Update an incident feedback Update a specific incident feedback by id @@ -83,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentFeedbackResponse] + Response[Union[ErrorsList, IncidentFeedbackResponse]] """ kwargs = _get_kwargs( @@ -103,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateIncidentFeedback, -) -> ErrorsList | IncidentFeedbackResponse | None: +) -> Optional[Union[ErrorsList, IncidentFeedbackResponse]]: """Update an incident feedback Update a specific incident feedback by id @@ -117,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentFeedbackResponse + Union[ErrorsList, IncidentFeedbackResponse] """ return sync_detailed( @@ -132,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateIncidentFeedback, -) -> Response[ErrorsList | IncidentFeedbackResponse]: +) -> Response[Union[ErrorsList, IncidentFeedbackResponse]]: """Update an incident feedback Update a specific incident feedback by id @@ -146,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentFeedbackResponse] + Response[Union[ErrorsList, IncidentFeedbackResponse]] """ kwargs = _get_kwargs( @@ -164,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateIncidentFeedback, -) -> ErrorsList | IncidentFeedbackResponse | None: +) -> Optional[Union[ErrorsList, IncidentFeedbackResponse]]: """Update an incident feedback Update a specific incident feedback by id @@ -178,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentFeedbackResponse + Union[ErrorsList, IncidentFeedbackResponse] """ return ( diff --git a/rootly_sdk/api/incident_form_field_selections/create_incident_form_field_selection.py b/rootly_sdk/api/incident_form_field_selections/create_incident_form_field_selection.py index a24a4d0c..cb178ab2 100644 --- a/rootly_sdk/api/incident_form_field_selections/create_incident_form_field_selection.py +++ b/rootly_sdk/api/incident_form_field_selections/create_incident_form_field_selection.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/incidents/{incident_id}/form_field_selections".format( - incident_id=quote(str(incident_id), safe=""), - ), + "url": f"/v1/incidents/{incident_id}/form_field_selections", } _kwargs["json"] = body.to_dict() @@ -35,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | IncidentFormFieldSelectionResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, IncidentFormFieldSelectionResponse]]: if response.status_code == 201: response_201 = IncidentFormFieldSelectionResponse.from_dict(response.json()) @@ -59,8 +56,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | IncidentFormFieldSelectionResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, IncidentFormFieldSelectionResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -74,7 +71,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewIncidentFormFieldSelection, -) -> Response[ErrorsList | IncidentFormFieldSelectionResponse]: +) -> Response[Union[ErrorsList, IncidentFormFieldSelectionResponse]]: """Creates an incident form field selection Creates a new incident form field selection from provided data @@ -88,7 +85,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentFormFieldSelectionResponse] + Response[Union[ErrorsList, IncidentFormFieldSelectionResponse]] """ kwargs = _get_kwargs( @@ -108,7 +105,7 @@ def sync( *, client: AuthenticatedClient, body: NewIncidentFormFieldSelection, -) -> ErrorsList | IncidentFormFieldSelectionResponse | None: +) -> Optional[Union[ErrorsList, IncidentFormFieldSelectionResponse]]: """Creates an incident form field selection Creates a new incident form field selection from provided data @@ -122,7 +119,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentFormFieldSelectionResponse + Union[ErrorsList, IncidentFormFieldSelectionResponse] """ return sync_detailed( @@ -137,7 +134,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewIncidentFormFieldSelection, -) -> Response[ErrorsList | IncidentFormFieldSelectionResponse]: +) -> Response[Union[ErrorsList, IncidentFormFieldSelectionResponse]]: """Creates an incident form field selection Creates a new incident form field selection from provided data @@ -151,7 +148,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentFormFieldSelectionResponse] + Response[Union[ErrorsList, IncidentFormFieldSelectionResponse]] """ kwargs = _get_kwargs( @@ -169,7 +166,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewIncidentFormFieldSelection, -) -> ErrorsList | IncidentFormFieldSelectionResponse | None: +) -> Optional[Union[ErrorsList, IncidentFormFieldSelectionResponse]]: """Creates an incident form field selection Creates a new incident form field selection from provided data @@ -183,7 +180,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentFormFieldSelectionResponse + Union[ErrorsList, IncidentFormFieldSelectionResponse] """ return ( diff --git a/rootly_sdk/api/incident_form_field_selections/delete_incident_form_field_selection.py b/rootly_sdk/api/incident_form_field_selections/delete_incident_form_field_selection.py index e1158bcf..99f336db 100644 --- a/rootly_sdk/api/incident_form_field_selections/delete_incident_form_field_selection.py +++ b/rootly_sdk/api/incident_form_field_selections/delete_incident_form_field_selection.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/incident_form_field_selections/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/incident_form_field_selections/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | IncidentFormFieldSelectionResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, IncidentFormFieldSelectionResponse]]: if response.status_code == 200: response_200 = IncidentFormFieldSelectionResponse.from_dict(response.json()) @@ -45,8 +41,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | IncidentFormFieldSelectionResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, IncidentFormFieldSelectionResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | IncidentFormFieldSelectionResponse]: +) -> Response[Union[ErrorsList, IncidentFormFieldSelectionResponse]]: """Delete an incident form field selection Delete a specific incident form field selection by id @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentFormFieldSelectionResponse] + Response[Union[ErrorsList, IncidentFormFieldSelectionResponse]] """ kwargs = _get_kwargs( @@ -90,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | IncidentFormFieldSelectionResponse | None: +) -> Optional[Union[ErrorsList, IncidentFormFieldSelectionResponse]]: """Delete an incident form field selection Delete a specific incident form field selection by id @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentFormFieldSelectionResponse + Union[ErrorsList, IncidentFormFieldSelectionResponse] """ return sync_detailed( @@ -116,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | IncidentFormFieldSelectionResponse]: +) -> Response[Union[ErrorsList, IncidentFormFieldSelectionResponse]]: """Delete an incident form field selection Delete a specific incident form field selection by id @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentFormFieldSelectionResponse] + Response[Union[ErrorsList, IncidentFormFieldSelectionResponse]] """ kwargs = _get_kwargs( @@ -145,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | IncidentFormFieldSelectionResponse | None: +) -> Optional[Union[ErrorsList, IncidentFormFieldSelectionResponse]]: """Delete an incident form field selection Delete a specific incident form field selection by id @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentFormFieldSelectionResponse + Union[ErrorsList, IncidentFormFieldSelectionResponse] """ return ( diff --git a/rootly_sdk/api/incident_form_field_selections/get_incident_form_field_selection.py b/rootly_sdk/api/incident_form_field_selections/get_incident_form_field_selection.py index 7649c119..dec522c8 100644 --- a/rootly_sdk/api/incident_form_field_selections/get_incident_form_field_selection.py +++ b/rootly_sdk/api/incident_form_field_selections/get_incident_form_field_selection.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/incident_form_field_selections/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/incident_form_field_selections/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | IncidentFormFieldSelectionResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, IncidentFormFieldSelectionResponse]]: if response.status_code == 200: response_200 = IncidentFormFieldSelectionResponse.from_dict(response.json()) @@ -45,8 +41,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | IncidentFormFieldSelectionResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, IncidentFormFieldSelectionResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | IncidentFormFieldSelectionResponse]: +) -> Response[Union[ErrorsList, IncidentFormFieldSelectionResponse]]: """Retrieves an incident form field selection Retrieves a specific incident form field selection by id @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentFormFieldSelectionResponse] + Response[Union[ErrorsList, IncidentFormFieldSelectionResponse]] """ kwargs = _get_kwargs( @@ -90,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | IncidentFormFieldSelectionResponse | None: +) -> Optional[Union[ErrorsList, IncidentFormFieldSelectionResponse]]: """Retrieves an incident form field selection Retrieves a specific incident form field selection by id @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentFormFieldSelectionResponse + Union[ErrorsList, IncidentFormFieldSelectionResponse] """ return sync_detailed( @@ -116,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | IncidentFormFieldSelectionResponse]: +) -> Response[Union[ErrorsList, IncidentFormFieldSelectionResponse]]: """Retrieves an incident form field selection Retrieves a specific incident form field selection by id @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentFormFieldSelectionResponse] + Response[Union[ErrorsList, IncidentFormFieldSelectionResponse]] """ kwargs = _get_kwargs( @@ -145,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | IncidentFormFieldSelectionResponse | None: +) -> Optional[Union[ErrorsList, IncidentFormFieldSelectionResponse]]: """Retrieves an incident form field selection Retrieves a specific incident form field selection by id @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentFormFieldSelectionResponse + Union[ErrorsList, IncidentFormFieldSelectionResponse] """ return ( diff --git a/rootly_sdk/api/incident_form_field_selections/list_incident_form_field_selections.py b/rootly_sdk/api/incident_form_field_selections/list_incident_form_field_selections.py index 8da161a7..fecfec73 100644 --- a/rootly_sdk/api/incident_form_field_selections/list_incident_form_field_selections.py +++ b/rootly_sdk/api/incident_form_field_selections/list_incident_form_field_selections.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -13,11 +12,10 @@ def _get_kwargs( incident_id: str, *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -30,9 +28,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/incidents/{incident_id}/form_field_selections".format( - incident_id=quote(str(incident_id), safe=""), - ), + "url": f"/v1/incidents/{incident_id}/form_field_selections", "params": params, } @@ -40,8 +36,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> IncidentFormFieldSelectionList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[IncidentFormFieldSelectionList]: if response.status_code == 200: response_200 = IncidentFormFieldSelectionList.from_dict(response.json()) @@ -54,7 +50,7 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[IncidentFormFieldSelectionList]: return Response( status_code=HTTPStatus(response.status_code), @@ -68,9 +64,9 @@ def sync_detailed( incident_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, ) -> Response[IncidentFormFieldSelectionList]: """List incident form field selections @@ -78,9 +74,9 @@ def sync_detailed( Args: incident_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -108,19 +104,19 @@ def sync( incident_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, -) -> IncidentFormFieldSelectionList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, +) -> Optional[IncidentFormFieldSelectionList]: """List incident form field selections List incident form field selections Args: incident_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -143,9 +139,9 @@ async def asyncio_detailed( incident_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, ) -> Response[IncidentFormFieldSelectionList]: """List incident form field selections @@ -153,9 +149,9 @@ async def asyncio_detailed( Args: incident_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -181,19 +177,19 @@ async def asyncio( incident_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, -) -> IncidentFormFieldSelectionList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, +) -> Optional[IncidentFormFieldSelectionList]: """List incident form field selections List incident form field selections Args: incident_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/incident_form_field_selections/update_incident_form_field_selection.py b/rootly_sdk/api/incident_form_field_selections/update_incident_form_field_selection.py index 8d933d3b..9f722097 100644 --- a/rootly_sdk/api/incident_form_field_selections/update_incident_form_field_selection.py +++ b/rootly_sdk/api/incident_form_field_selections/update_incident_form_field_selection.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/incident_form_field_selections/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/incident_form_field_selections/{id}", } _kwargs["json"] = body.to_dict() @@ -35,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | IncidentFormFieldSelectionResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, IncidentFormFieldSelectionResponse]]: if response.status_code == 200: response_200 = IncidentFormFieldSelectionResponse.from_dict(response.json()) @@ -54,8 +51,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | IncidentFormFieldSelectionResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, IncidentFormFieldSelectionResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateIncidentFormFieldSelection, -) -> Response[ErrorsList | IncidentFormFieldSelectionResponse]: +) -> Response[Union[ErrorsList, IncidentFormFieldSelectionResponse]]: """Update an incident form field selection Update a specific incident form field selection by id @@ -83,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentFormFieldSelectionResponse] + Response[Union[ErrorsList, IncidentFormFieldSelectionResponse]] """ kwargs = _get_kwargs( @@ -103,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateIncidentFormFieldSelection, -) -> ErrorsList | IncidentFormFieldSelectionResponse | None: +) -> Optional[Union[ErrorsList, IncidentFormFieldSelectionResponse]]: """Update an incident form field selection Update a specific incident form field selection by id @@ -117,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentFormFieldSelectionResponse + Union[ErrorsList, IncidentFormFieldSelectionResponse] """ return sync_detailed( @@ -132,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateIncidentFormFieldSelection, -) -> Response[ErrorsList | IncidentFormFieldSelectionResponse]: +) -> Response[Union[ErrorsList, IncidentFormFieldSelectionResponse]]: """Update an incident form field selection Update a specific incident form field selection by id @@ -146,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentFormFieldSelectionResponse] + Response[Union[ErrorsList, IncidentFormFieldSelectionResponse]] """ kwargs = _get_kwargs( @@ -164,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateIncidentFormFieldSelection, -) -> ErrorsList | IncidentFormFieldSelectionResponse | None: +) -> Optional[Union[ErrorsList, IncidentFormFieldSelectionResponse]]: """Update an incident form field selection Update a specific incident form field selection by id @@ -178,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentFormFieldSelectionResponse + Union[ErrorsList, IncidentFormFieldSelectionResponse] """ return ( diff --git a/rootly_sdk/api/incident_permission_set_booleans/create_incident_permission_set_boolean.py b/rootly_sdk/api/incident_permission_set_booleans/create_incident_permission_set_boolean.py index b2923285..25c20550 100644 --- a/rootly_sdk/api/incident_permission_set_booleans/create_incident_permission_set_boolean.py +++ b/rootly_sdk/api/incident_permission_set_booleans/create_incident_permission_set_boolean.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/incident_permission_sets/{incident_permission_set_id}/booleans".format( - incident_permission_set_id=quote(str(incident_permission_set_id), safe=""), - ), + "url": f"/v1/incident_permission_sets/{incident_permission_set_id}/booleans", } _kwargs["json"] = body.to_dict() @@ -35,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | IncidentPermissionSetBooleanResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, IncidentPermissionSetBooleanResponse]]: if response.status_code == 201: response_201 = IncidentPermissionSetBooleanResponse.from_dict(response.json()) @@ -59,8 +56,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | IncidentPermissionSetBooleanResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, IncidentPermissionSetBooleanResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -74,7 +71,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewIncidentPermissionSetBoolean, -) -> Response[ErrorsList | IncidentPermissionSetBooleanResponse]: +) -> Response[Union[ErrorsList, IncidentPermissionSetBooleanResponse]]: """Creates an incident_permission_set_boolean Creates a new incident_permission_set_boolean from provided data @@ -88,7 +85,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentPermissionSetBooleanResponse] + Response[Union[ErrorsList, IncidentPermissionSetBooleanResponse]] """ kwargs = _get_kwargs( @@ -108,7 +105,7 @@ def sync( *, client: AuthenticatedClient, body: NewIncidentPermissionSetBoolean, -) -> ErrorsList | IncidentPermissionSetBooleanResponse | None: +) -> Optional[Union[ErrorsList, IncidentPermissionSetBooleanResponse]]: """Creates an incident_permission_set_boolean Creates a new incident_permission_set_boolean from provided data @@ -122,7 +119,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentPermissionSetBooleanResponse + Union[ErrorsList, IncidentPermissionSetBooleanResponse] """ return sync_detailed( @@ -137,7 +134,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewIncidentPermissionSetBoolean, -) -> Response[ErrorsList | IncidentPermissionSetBooleanResponse]: +) -> Response[Union[ErrorsList, IncidentPermissionSetBooleanResponse]]: """Creates an incident_permission_set_boolean Creates a new incident_permission_set_boolean from provided data @@ -151,7 +148,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentPermissionSetBooleanResponse] + Response[Union[ErrorsList, IncidentPermissionSetBooleanResponse]] """ kwargs = _get_kwargs( @@ -169,7 +166,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewIncidentPermissionSetBoolean, -) -> ErrorsList | IncidentPermissionSetBooleanResponse | None: +) -> Optional[Union[ErrorsList, IncidentPermissionSetBooleanResponse]]: """Creates an incident_permission_set_boolean Creates a new incident_permission_set_boolean from provided data @@ -183,7 +180,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentPermissionSetBooleanResponse + Union[ErrorsList, IncidentPermissionSetBooleanResponse] """ return ( diff --git a/rootly_sdk/api/incident_permission_set_booleans/delete_incident_permission_set_boolean.py b/rootly_sdk/api/incident_permission_set_booleans/delete_incident_permission_set_boolean.py index 2597380c..19d611a9 100644 --- a/rootly_sdk/api/incident_permission_set_booleans/delete_incident_permission_set_boolean.py +++ b/rootly_sdk/api/incident_permission_set_booleans/delete_incident_permission_set_boolean.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/incident_permission_set_booleans/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/incident_permission_set_booleans/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | IncidentPermissionSetBooleanResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, IncidentPermissionSetBooleanResponse]]: if response.status_code == 200: response_200 = IncidentPermissionSetBooleanResponse.from_dict(response.json()) @@ -45,8 +41,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | IncidentPermissionSetBooleanResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, IncidentPermissionSetBooleanResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | IncidentPermissionSetBooleanResponse]: +) -> Response[Union[ErrorsList, IncidentPermissionSetBooleanResponse]]: """Delete an incident_permission_set_boolean Delete a specific incident_permission_set_boolean by id @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentPermissionSetBooleanResponse] + Response[Union[ErrorsList, IncidentPermissionSetBooleanResponse]] """ kwargs = _get_kwargs( @@ -90,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | IncidentPermissionSetBooleanResponse | None: +) -> Optional[Union[ErrorsList, IncidentPermissionSetBooleanResponse]]: """Delete an incident_permission_set_boolean Delete a specific incident_permission_set_boolean by id @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentPermissionSetBooleanResponse + Union[ErrorsList, IncidentPermissionSetBooleanResponse] """ return sync_detailed( @@ -116,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | IncidentPermissionSetBooleanResponse]: +) -> Response[Union[ErrorsList, IncidentPermissionSetBooleanResponse]]: """Delete an incident_permission_set_boolean Delete a specific incident_permission_set_boolean by id @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentPermissionSetBooleanResponse] + Response[Union[ErrorsList, IncidentPermissionSetBooleanResponse]] """ kwargs = _get_kwargs( @@ -145,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | IncidentPermissionSetBooleanResponse | None: +) -> Optional[Union[ErrorsList, IncidentPermissionSetBooleanResponse]]: """Delete an incident_permission_set_boolean Delete a specific incident_permission_set_boolean by id @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentPermissionSetBooleanResponse + Union[ErrorsList, IncidentPermissionSetBooleanResponse] """ return ( diff --git a/rootly_sdk/api/incident_permission_set_booleans/get_incident_permission_set_boolean.py b/rootly_sdk/api/incident_permission_set_booleans/get_incident_permission_set_boolean.py index fd412645..832962f2 100644 --- a/rootly_sdk/api/incident_permission_set_booleans/get_incident_permission_set_boolean.py +++ b/rootly_sdk/api/incident_permission_set_booleans/get_incident_permission_set_boolean.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/incident_permission_set_booleans/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/incident_permission_set_booleans/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | IncidentPermissionSetBooleanResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, IncidentPermissionSetBooleanResponse]]: if response.status_code == 200: response_200 = IncidentPermissionSetBooleanResponse.from_dict(response.json()) @@ -45,8 +41,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | IncidentPermissionSetBooleanResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, IncidentPermissionSetBooleanResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | IncidentPermissionSetBooleanResponse]: +) -> Response[Union[ErrorsList, IncidentPermissionSetBooleanResponse]]: """Retrieves an incident_permission_set_boolean Retrieves a specific incident_permission_set_boolean by id @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentPermissionSetBooleanResponse] + Response[Union[ErrorsList, IncidentPermissionSetBooleanResponse]] """ kwargs = _get_kwargs( @@ -90,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | IncidentPermissionSetBooleanResponse | None: +) -> Optional[Union[ErrorsList, IncidentPermissionSetBooleanResponse]]: """Retrieves an incident_permission_set_boolean Retrieves a specific incident_permission_set_boolean by id @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentPermissionSetBooleanResponse + Union[ErrorsList, IncidentPermissionSetBooleanResponse] """ return sync_detailed( @@ -116,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | IncidentPermissionSetBooleanResponse]: +) -> Response[Union[ErrorsList, IncidentPermissionSetBooleanResponse]]: """Retrieves an incident_permission_set_boolean Retrieves a specific incident_permission_set_boolean by id @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentPermissionSetBooleanResponse] + Response[Union[ErrorsList, IncidentPermissionSetBooleanResponse]] """ kwargs = _get_kwargs( @@ -145,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | IncidentPermissionSetBooleanResponse | None: +) -> Optional[Union[ErrorsList, IncidentPermissionSetBooleanResponse]]: """Retrieves an incident_permission_set_boolean Retrieves a specific incident_permission_set_boolean by id @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentPermissionSetBooleanResponse + Union[ErrorsList, IncidentPermissionSetBooleanResponse] """ return ( diff --git a/rootly_sdk/api/incident_permission_set_booleans/list_incident_permission_set_booleans.py b/rootly_sdk/api/incident_permission_set_booleans/list_incident_permission_set_booleans.py index 4f640b28..3905738e 100644 --- a/rootly_sdk/api/incident_permission_set_booleans/list_incident_permission_set_booleans.py +++ b/rootly_sdk/api/incident_permission_set_booleans/list_incident_permission_set_booleans.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -13,17 +12,16 @@ def _get_kwargs( incident_permission_set_id: str, *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterkind: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterkind: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -48,9 +46,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/incident_permission_sets/{incident_permission_set_id}/booleans".format( - incident_permission_set_id=quote(str(incident_permission_set_id), safe=""), - ), + "url": f"/v1/incident_permission_sets/{incident_permission_set_id}/booleans", "params": params, } @@ -58,8 +54,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> IncidentPermissionSetBooleanList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[IncidentPermissionSetBooleanList]: if response.status_code == 200: response_200 = IncidentPermissionSetBooleanList.from_dict(response.json()) @@ -72,7 +68,7 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[IncidentPermissionSetBooleanList]: return Response( status_code=HTTPStatus(response.status_code), @@ -86,15 +82,15 @@ def sync_detailed( incident_permission_set_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterkind: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterkind: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, ) -> Response[IncidentPermissionSetBooleanList]: """List incident_permission_set_booleans @@ -102,15 +98,15 @@ def sync_detailed( Args: incident_permission_set_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterkind (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterkind (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -144,31 +140,31 @@ def sync( incident_permission_set_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterkind: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, -) -> IncidentPermissionSetBooleanList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterkind: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, +) -> Optional[IncidentPermissionSetBooleanList]: """List incident_permission_set_booleans List incident_permission_set_booleans Args: incident_permission_set_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterkind (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterkind (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -197,15 +193,15 @@ async def asyncio_detailed( incident_permission_set_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterkind: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterkind: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, ) -> Response[IncidentPermissionSetBooleanList]: """List incident_permission_set_booleans @@ -213,15 +209,15 @@ async def asyncio_detailed( Args: incident_permission_set_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterkind (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterkind (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -253,31 +249,31 @@ async def asyncio( incident_permission_set_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterkind: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, -) -> IncidentPermissionSetBooleanList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterkind: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, +) -> Optional[IncidentPermissionSetBooleanList]: """List incident_permission_set_booleans List incident_permission_set_booleans Args: incident_permission_set_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterkind (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterkind (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/incident_permission_set_booleans/update_incident_permission_set_boolean.py b/rootly_sdk/api/incident_permission_set_booleans/update_incident_permission_set_boolean.py index cd4630de..c8c539b6 100644 --- a/rootly_sdk/api/incident_permission_set_booleans/update_incident_permission_set_boolean.py +++ b/rootly_sdk/api/incident_permission_set_booleans/update_incident_permission_set_boolean.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/incident_permission_set_booleans/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/incident_permission_set_booleans/{id}", } _kwargs["json"] = body.to_dict() @@ -35,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | IncidentPermissionSetBooleanResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, IncidentPermissionSetBooleanResponse]]: if response.status_code == 200: response_200 = IncidentPermissionSetBooleanResponse.from_dict(response.json()) @@ -54,8 +51,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | IncidentPermissionSetBooleanResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, IncidentPermissionSetBooleanResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateIncidentPermissionSetBoolean, -) -> Response[ErrorsList | IncidentPermissionSetBooleanResponse]: +) -> Response[Union[ErrorsList, IncidentPermissionSetBooleanResponse]]: """Update an incident_permission_set_boolean Update a specific incident_permission_set_boolean by id @@ -83,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentPermissionSetBooleanResponse] + Response[Union[ErrorsList, IncidentPermissionSetBooleanResponse]] """ kwargs = _get_kwargs( @@ -103,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateIncidentPermissionSetBoolean, -) -> ErrorsList | IncidentPermissionSetBooleanResponse | None: +) -> Optional[Union[ErrorsList, IncidentPermissionSetBooleanResponse]]: """Update an incident_permission_set_boolean Update a specific incident_permission_set_boolean by id @@ -117,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentPermissionSetBooleanResponse + Union[ErrorsList, IncidentPermissionSetBooleanResponse] """ return sync_detailed( @@ -132,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateIncidentPermissionSetBoolean, -) -> Response[ErrorsList | IncidentPermissionSetBooleanResponse]: +) -> Response[Union[ErrorsList, IncidentPermissionSetBooleanResponse]]: """Update an incident_permission_set_boolean Update a specific incident_permission_set_boolean by id @@ -146,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentPermissionSetBooleanResponse] + Response[Union[ErrorsList, IncidentPermissionSetBooleanResponse]] """ kwargs = _get_kwargs( @@ -164,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateIncidentPermissionSetBoolean, -) -> ErrorsList | IncidentPermissionSetBooleanResponse | None: +) -> Optional[Union[ErrorsList, IncidentPermissionSetBooleanResponse]]: """Update an incident_permission_set_boolean Update a specific incident_permission_set_boolean by id @@ -178,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentPermissionSetBooleanResponse + Union[ErrorsList, IncidentPermissionSetBooleanResponse] """ return ( diff --git a/rootly_sdk/api/incident_permission_set_resources/create_incident_permission_set_resource.py b/rootly_sdk/api/incident_permission_set_resources/create_incident_permission_set_resource.py index 1c90322b..7834de08 100644 --- a/rootly_sdk/api/incident_permission_set_resources/create_incident_permission_set_resource.py +++ b/rootly_sdk/api/incident_permission_set_resources/create_incident_permission_set_resource.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/incident_permission_sets/{incident_permission_set_id}/resources".format( - incident_permission_set_id=quote(str(incident_permission_set_id), safe=""), - ), + "url": f"/v1/incident_permission_sets/{incident_permission_set_id}/resources", } _kwargs["json"] = body.to_dict() @@ -35,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | IncidentPermissionSetResourceResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, IncidentPermissionSetResourceResponse]]: if response.status_code == 201: response_201 = IncidentPermissionSetResourceResponse.from_dict(response.json()) @@ -59,8 +56,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | IncidentPermissionSetResourceResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, IncidentPermissionSetResourceResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -74,7 +71,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewIncidentPermissionSetResource, -) -> Response[ErrorsList | IncidentPermissionSetResourceResponse]: +) -> Response[Union[ErrorsList, IncidentPermissionSetResourceResponse]]: """Creates an incident_permission_set_resource Creates a new incident_permission_set_resource from provided data @@ -88,7 +85,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentPermissionSetResourceResponse] + Response[Union[ErrorsList, IncidentPermissionSetResourceResponse]] """ kwargs = _get_kwargs( @@ -108,7 +105,7 @@ def sync( *, client: AuthenticatedClient, body: NewIncidentPermissionSetResource, -) -> ErrorsList | IncidentPermissionSetResourceResponse | None: +) -> Optional[Union[ErrorsList, IncidentPermissionSetResourceResponse]]: """Creates an incident_permission_set_resource Creates a new incident_permission_set_resource from provided data @@ -122,7 +119,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentPermissionSetResourceResponse + Union[ErrorsList, IncidentPermissionSetResourceResponse] """ return sync_detailed( @@ -137,7 +134,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewIncidentPermissionSetResource, -) -> Response[ErrorsList | IncidentPermissionSetResourceResponse]: +) -> Response[Union[ErrorsList, IncidentPermissionSetResourceResponse]]: """Creates an incident_permission_set_resource Creates a new incident_permission_set_resource from provided data @@ -151,7 +148,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentPermissionSetResourceResponse] + Response[Union[ErrorsList, IncidentPermissionSetResourceResponse]] """ kwargs = _get_kwargs( @@ -169,7 +166,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewIncidentPermissionSetResource, -) -> ErrorsList | IncidentPermissionSetResourceResponse | None: +) -> Optional[Union[ErrorsList, IncidentPermissionSetResourceResponse]]: """Creates an incident_permission_set_resource Creates a new incident_permission_set_resource from provided data @@ -183,7 +180,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentPermissionSetResourceResponse + Union[ErrorsList, IncidentPermissionSetResourceResponse] """ return ( diff --git a/rootly_sdk/api/incident_permission_set_resources/delete_incident_permission_set_resource.py b/rootly_sdk/api/incident_permission_set_resources/delete_incident_permission_set_resource.py index b0df5cea..95a1ff9d 100644 --- a/rootly_sdk/api/incident_permission_set_resources/delete_incident_permission_set_resource.py +++ b/rootly_sdk/api/incident_permission_set_resources/delete_incident_permission_set_resource.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/incident_permission_set_resources/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/incident_permission_set_resources/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | IncidentPermissionSetResourceResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, IncidentPermissionSetResourceResponse]]: if response.status_code == 200: response_200 = IncidentPermissionSetResourceResponse.from_dict(response.json()) @@ -45,8 +41,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | IncidentPermissionSetResourceResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, IncidentPermissionSetResourceResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | IncidentPermissionSetResourceResponse]: +) -> Response[Union[ErrorsList, IncidentPermissionSetResourceResponse]]: """Delete an incident_permission_set_resource Delete a specific incident_permission_set_resource by id @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentPermissionSetResourceResponse] + Response[Union[ErrorsList, IncidentPermissionSetResourceResponse]] """ kwargs = _get_kwargs( @@ -90,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | IncidentPermissionSetResourceResponse | None: +) -> Optional[Union[ErrorsList, IncidentPermissionSetResourceResponse]]: """Delete an incident_permission_set_resource Delete a specific incident_permission_set_resource by id @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentPermissionSetResourceResponse + Union[ErrorsList, IncidentPermissionSetResourceResponse] """ return sync_detailed( @@ -116,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | IncidentPermissionSetResourceResponse]: +) -> Response[Union[ErrorsList, IncidentPermissionSetResourceResponse]]: """Delete an incident_permission_set_resource Delete a specific incident_permission_set_resource by id @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentPermissionSetResourceResponse] + Response[Union[ErrorsList, IncidentPermissionSetResourceResponse]] """ kwargs = _get_kwargs( @@ -145,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | IncidentPermissionSetResourceResponse | None: +) -> Optional[Union[ErrorsList, IncidentPermissionSetResourceResponse]]: """Delete an incident_permission_set_resource Delete a specific incident_permission_set_resource by id @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentPermissionSetResourceResponse + Union[ErrorsList, IncidentPermissionSetResourceResponse] """ return ( diff --git a/rootly_sdk/api/incident_permission_set_resources/get_incident_permission_set_resource.py b/rootly_sdk/api/incident_permission_set_resources/get_incident_permission_set_resource.py index 3ecc6bcb..45e2ce20 100644 --- a/rootly_sdk/api/incident_permission_set_resources/get_incident_permission_set_resource.py +++ b/rootly_sdk/api/incident_permission_set_resources/get_incident_permission_set_resource.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/incident_permission_set_resources/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/incident_permission_set_resources/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | IncidentPermissionSetResourceResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, IncidentPermissionSetResourceResponse]]: if response.status_code == 200: response_200 = IncidentPermissionSetResourceResponse.from_dict(response.json()) @@ -45,8 +41,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | IncidentPermissionSetResourceResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, IncidentPermissionSetResourceResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | IncidentPermissionSetResourceResponse]: +) -> Response[Union[ErrorsList, IncidentPermissionSetResourceResponse]]: """Retrieves an incident_permission_set_resource Retrieves a specific incident_permission_set_resource by id @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentPermissionSetResourceResponse] + Response[Union[ErrorsList, IncidentPermissionSetResourceResponse]] """ kwargs = _get_kwargs( @@ -90,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | IncidentPermissionSetResourceResponse | None: +) -> Optional[Union[ErrorsList, IncidentPermissionSetResourceResponse]]: """Retrieves an incident_permission_set_resource Retrieves a specific incident_permission_set_resource by id @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentPermissionSetResourceResponse + Union[ErrorsList, IncidentPermissionSetResourceResponse] """ return sync_detailed( @@ -116,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | IncidentPermissionSetResourceResponse]: +) -> Response[Union[ErrorsList, IncidentPermissionSetResourceResponse]]: """Retrieves an incident_permission_set_resource Retrieves a specific incident_permission_set_resource by id @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentPermissionSetResourceResponse] + Response[Union[ErrorsList, IncidentPermissionSetResourceResponse]] """ kwargs = _get_kwargs( @@ -145,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | IncidentPermissionSetResourceResponse | None: +) -> Optional[Union[ErrorsList, IncidentPermissionSetResourceResponse]]: """Retrieves an incident_permission_set_resource Retrieves a specific incident_permission_set_resource by id @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentPermissionSetResourceResponse + Union[ErrorsList, IncidentPermissionSetResourceResponse] """ return ( diff --git a/rootly_sdk/api/incident_permission_set_resources/list_incident_permission_set_resources.py b/rootly_sdk/api/incident_permission_set_resources/list_incident_permission_set_resources.py index 7be18300..bc553002 100644 --- a/rootly_sdk/api/incident_permission_set_resources/list_incident_permission_set_resources.py +++ b/rootly_sdk/api/incident_permission_set_resources/list_incident_permission_set_resources.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -13,17 +12,16 @@ def _get_kwargs( incident_permission_set_id: str, *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterkind: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterkind: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -48,9 +46,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/incident_permission_sets/{incident_permission_set_id}/resources".format( - incident_permission_set_id=quote(str(incident_permission_set_id), safe=""), - ), + "url": f"/v1/incident_permission_sets/{incident_permission_set_id}/resources", "params": params, } @@ -58,8 +54,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> IncidentPermissionSetResourceList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[IncidentPermissionSetResourceList]: if response.status_code == 200: response_200 = IncidentPermissionSetResourceList.from_dict(response.json()) @@ -72,7 +68,7 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[IncidentPermissionSetResourceList]: return Response( status_code=HTTPStatus(response.status_code), @@ -86,15 +82,15 @@ def sync_detailed( incident_permission_set_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterkind: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterkind: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, ) -> Response[IncidentPermissionSetResourceList]: """List incident_permission_set_resources @@ -102,15 +98,15 @@ def sync_detailed( Args: incident_permission_set_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterkind (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterkind (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -144,31 +140,31 @@ def sync( incident_permission_set_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterkind: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, -) -> IncidentPermissionSetResourceList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterkind: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, +) -> Optional[IncidentPermissionSetResourceList]: """List incident_permission_set_resources List incident_permission_set_resources Args: incident_permission_set_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterkind (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterkind (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -197,15 +193,15 @@ async def asyncio_detailed( incident_permission_set_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterkind: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterkind: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, ) -> Response[IncidentPermissionSetResourceList]: """List incident_permission_set_resources @@ -213,15 +209,15 @@ async def asyncio_detailed( Args: incident_permission_set_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterkind (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterkind (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -253,31 +249,31 @@ async def asyncio( incident_permission_set_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterkind: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, -) -> IncidentPermissionSetResourceList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterkind: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, +) -> Optional[IncidentPermissionSetResourceList]: """List incident_permission_set_resources List incident_permission_set_resources Args: incident_permission_set_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterkind (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterkind (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/incident_permission_set_resources/update_incident_permission_set_resource.py b/rootly_sdk/api/incident_permission_set_resources/update_incident_permission_set_resource.py index 9448553c..dd125cbf 100644 --- a/rootly_sdk/api/incident_permission_set_resources/update_incident_permission_set_resource.py +++ b/rootly_sdk/api/incident_permission_set_resources/update_incident_permission_set_resource.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/incident_permission_set_resources/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/incident_permission_set_resources/{id}", } _kwargs["json"] = body.to_dict() @@ -35,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | IncidentPermissionSetResourceResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, IncidentPermissionSetResourceResponse]]: if response.status_code == 200: response_200 = IncidentPermissionSetResourceResponse.from_dict(response.json()) @@ -54,8 +51,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | IncidentPermissionSetResourceResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, IncidentPermissionSetResourceResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateIncidentPermissionSetResource, -) -> Response[ErrorsList | IncidentPermissionSetResourceResponse]: +) -> Response[Union[ErrorsList, IncidentPermissionSetResourceResponse]]: """Update an incident_permission_set_resource Update a specific incident_permission_set_resource by id @@ -83,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentPermissionSetResourceResponse] + Response[Union[ErrorsList, IncidentPermissionSetResourceResponse]] """ kwargs = _get_kwargs( @@ -103,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateIncidentPermissionSetResource, -) -> ErrorsList | IncidentPermissionSetResourceResponse | None: +) -> Optional[Union[ErrorsList, IncidentPermissionSetResourceResponse]]: """Update an incident_permission_set_resource Update a specific incident_permission_set_resource by id @@ -117,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentPermissionSetResourceResponse + Union[ErrorsList, IncidentPermissionSetResourceResponse] """ return sync_detailed( @@ -132,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateIncidentPermissionSetResource, -) -> Response[ErrorsList | IncidentPermissionSetResourceResponse]: +) -> Response[Union[ErrorsList, IncidentPermissionSetResourceResponse]]: """Update an incident_permission_set_resource Update a specific incident_permission_set_resource by id @@ -146,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentPermissionSetResourceResponse] + Response[Union[ErrorsList, IncidentPermissionSetResourceResponse]] """ kwargs = _get_kwargs( @@ -164,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateIncidentPermissionSetResource, -) -> ErrorsList | IncidentPermissionSetResourceResponse | None: +) -> Optional[Union[ErrorsList, IncidentPermissionSetResourceResponse]]: """Update an incident_permission_set_resource Update a specific incident_permission_set_resource by id @@ -178,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentPermissionSetResourceResponse + Union[ErrorsList, IncidentPermissionSetResourceResponse] """ return ( diff --git a/rootly_sdk/api/incident_permission_sets/create_incident_permission_set.py b/rootly_sdk/api/incident_permission_sets/create_incident_permission_set.py index 72ee39ce..212ff795 100644 --- a/rootly_sdk/api/incident_permission_sets/create_incident_permission_set.py +++ b/rootly_sdk/api/incident_permission_sets/create_incident_permission_set.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | IncidentPermissionSetResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, IncidentPermissionSetResponse]]: if response.status_code == 201: response_201 = IncidentPermissionSetResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | IncidentPermissionSetResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, IncidentPermissionSetResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +69,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewIncidentPermissionSet, -) -> Response[ErrorsList | IncidentPermissionSetResponse]: +) -> Response[Union[ErrorsList, IncidentPermissionSetResponse]]: """Creates an incident_permission_set Creates a new incident_permission_set from provided data @@ -82,7 +82,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentPermissionSetResponse] + Response[Union[ErrorsList, IncidentPermissionSetResponse]] """ kwargs = _get_kwargs( @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: NewIncidentPermissionSet, -) -> ErrorsList | IncidentPermissionSetResponse | None: +) -> Optional[Union[ErrorsList, IncidentPermissionSetResponse]]: """Creates an incident_permission_set Creates a new incident_permission_set from provided data @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentPermissionSetResponse + Union[ErrorsList, IncidentPermissionSetResponse] """ return sync_detailed( @@ -126,7 +126,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewIncidentPermissionSet, -) -> Response[ErrorsList | IncidentPermissionSetResponse]: +) -> Response[Union[ErrorsList, IncidentPermissionSetResponse]]: """Creates an incident_permission_set Creates a new incident_permission_set from provided data @@ -139,7 +139,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentPermissionSetResponse] + Response[Union[ErrorsList, IncidentPermissionSetResponse]] """ kwargs = _get_kwargs( @@ -155,7 +155,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewIncidentPermissionSet, -) -> ErrorsList | IncidentPermissionSetResponse | None: +) -> Optional[Union[ErrorsList, IncidentPermissionSetResponse]]: """Creates an incident_permission_set Creates a new incident_permission_set from provided data @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentPermissionSetResponse + Union[ErrorsList, IncidentPermissionSetResponse] """ return ( diff --git a/rootly_sdk/api/incident_permission_sets/delete_incident_permission_set.py b/rootly_sdk/api/incident_permission_sets/delete_incident_permission_set.py index e4a987ec..49a6f59b 100644 --- a/rootly_sdk/api/incident_permission_sets/delete_incident_permission_set.py +++ b/rootly_sdk/api/incident_permission_sets/delete_incident_permission_set.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union from uuid import UUID import httpx @@ -13,22 +12,19 @@ def _get_kwargs( - id: str | UUID, + id: Union[UUID, str], ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/incident_permission_sets/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/incident_permission_sets/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | IncidentPermissionSetResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, IncidentPermissionSetResponse]]: if response.status_code == 200: response_200 = IncidentPermissionSetResponse.from_dict(response.json()) @@ -46,8 +42,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | IncidentPermissionSetResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, IncidentPermissionSetResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -57,23 +53,23 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Response[ErrorsList | IncidentPermissionSetResponse]: +) -> Response[Union[ErrorsList, IncidentPermissionSetResponse]]: """Delete an incident_permission_set Delete a specific incident_permission_set by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentPermissionSetResponse] + Response[Union[ErrorsList, IncidentPermissionSetResponse]] """ kwargs = _get_kwargs( @@ -88,23 +84,23 @@ def sync_detailed( def sync( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> ErrorsList | IncidentPermissionSetResponse | None: +) -> Optional[Union[ErrorsList, IncidentPermissionSetResponse]]: """Delete an incident_permission_set Delete a specific incident_permission_set by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentPermissionSetResponse + Union[ErrorsList, IncidentPermissionSetResponse] """ return sync_detailed( @@ -114,23 +110,23 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Response[ErrorsList | IncidentPermissionSetResponse]: +) -> Response[Union[ErrorsList, IncidentPermissionSetResponse]]: """Delete an incident_permission_set Delete a specific incident_permission_set by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentPermissionSetResponse] + Response[Union[ErrorsList, IncidentPermissionSetResponse]] """ kwargs = _get_kwargs( @@ -143,23 +139,23 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> ErrorsList | IncidentPermissionSetResponse | None: +) -> Optional[Union[ErrorsList, IncidentPermissionSetResponse]]: """Delete an incident_permission_set Delete a specific incident_permission_set by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentPermissionSetResponse + Union[ErrorsList, IncidentPermissionSetResponse] """ return ( diff --git a/rootly_sdk/api/incident_permission_sets/get_incident_permission_set.py b/rootly_sdk/api/incident_permission_sets/get_incident_permission_set.py index 6ceccff2..4650cc75 100644 --- a/rootly_sdk/api/incident_permission_sets/get_incident_permission_set.py +++ b/rootly_sdk/api/incident_permission_sets/get_incident_permission_set.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union from uuid import UUID import httpx @@ -13,22 +12,19 @@ def _get_kwargs( - id: str | UUID, + id: Union[UUID, str], ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/incident_permission_sets/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/incident_permission_sets/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | IncidentPermissionSetResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, IncidentPermissionSetResponse]]: if response.status_code == 200: response_200 = IncidentPermissionSetResponse.from_dict(response.json()) @@ -46,8 +42,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | IncidentPermissionSetResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, IncidentPermissionSetResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -57,23 +53,23 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Response[ErrorsList | IncidentPermissionSetResponse]: +) -> Response[Union[ErrorsList, IncidentPermissionSetResponse]]: """Retrieves an incident_permission_set Retrieves a specific incident_permission_set by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentPermissionSetResponse] + Response[Union[ErrorsList, IncidentPermissionSetResponse]] """ kwargs = _get_kwargs( @@ -88,23 +84,23 @@ def sync_detailed( def sync( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> ErrorsList | IncidentPermissionSetResponse | None: +) -> Optional[Union[ErrorsList, IncidentPermissionSetResponse]]: """Retrieves an incident_permission_set Retrieves a specific incident_permission_set by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentPermissionSetResponse + Union[ErrorsList, IncidentPermissionSetResponse] """ return sync_detailed( @@ -114,23 +110,23 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Response[ErrorsList | IncidentPermissionSetResponse]: +) -> Response[Union[ErrorsList, IncidentPermissionSetResponse]]: """Retrieves an incident_permission_set Retrieves a specific incident_permission_set by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentPermissionSetResponse] + Response[Union[ErrorsList, IncidentPermissionSetResponse]] """ kwargs = _get_kwargs( @@ -143,23 +139,23 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> ErrorsList | IncidentPermissionSetResponse | None: +) -> Optional[Union[ErrorsList, IncidentPermissionSetResponse]]: """Retrieves an incident_permission_set Retrieves a specific incident_permission_set by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentPermissionSetResponse + Union[ErrorsList, IncidentPermissionSetResponse] """ return ( diff --git a/rootly_sdk/api/incident_permission_sets/list_incident_permission_sets.py b/rootly_sdk/api/incident_permission_sets/list_incident_permission_sets.py index cd7a2c18..184071a3 100644 --- a/rootly_sdk/api/incident_permission_sets/list_incident_permission_sets.py +++ b/rootly_sdk/api/incident_permission_sets/list_incident_permission_sets.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -11,19 +11,18 @@ def _get_kwargs( *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -60,8 +59,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> IncidentPermissionSetList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[IncidentPermissionSetList]: if response.status_code == 200: response_200 = IncidentPermissionSetList.from_dict(response.json()) @@ -74,7 +73,7 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[IncidentPermissionSetList]: return Response( status_code=HTTPStatus(response.status_code), @@ -87,34 +86,34 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, ) -> Response[IncidentPermissionSetList]: """List incident_permission_sets List incident_permission_sets Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -148,34 +147,34 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, -) -> IncidentPermissionSetList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, +) -> Optional[IncidentPermissionSetList]: """List incident_permission_sets List incident_permission_sets Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -204,34 +203,34 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, ) -> Response[IncidentPermissionSetList]: """List incident_permission_sets List incident_permission_sets Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -263,34 +262,34 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, -) -> IncidentPermissionSetList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, +) -> Optional[IncidentPermissionSetList]: """List incident_permission_sets List incident_permission_sets Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/incident_permission_sets/update_incident_permission_set.py b/rootly_sdk/api/incident_permission_sets/update_incident_permission_set.py index 32f42235..206cc135 100644 --- a/rootly_sdk/api/incident_permission_sets/update_incident_permission_set.py +++ b/rootly_sdk/api/incident_permission_sets/update_incident_permission_set.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union from uuid import UUID import httpx @@ -14,7 +13,7 @@ def _get_kwargs( - id: str | UUID, + id: Union[UUID, str], *, body: UpdateIncidentPermissionSet, ) -> dict[str, Any]: @@ -22,9 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/incident_permission_sets/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/incident_permission_sets/{id}", } _kwargs["json"] = body.to_dict() @@ -36,8 +33,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | IncidentPermissionSetResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, IncidentPermissionSetResponse]]: if response.status_code == 200: response_200 = IncidentPermissionSetResponse.from_dict(response.json()) @@ -55,8 +52,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | IncidentPermissionSetResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, IncidentPermissionSetResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,17 +63,17 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdateIncidentPermissionSet, -) -> Response[ErrorsList | IncidentPermissionSetResponse]: +) -> Response[Union[ErrorsList, IncidentPermissionSetResponse]]: """Update an incident_permission_set Update a specific incident_permission_set by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateIncidentPermissionSet): Raises: @@ -84,7 +81,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentPermissionSetResponse] + Response[Union[ErrorsList, IncidentPermissionSetResponse]] """ kwargs = _get_kwargs( @@ -100,17 +97,17 @@ def sync_detailed( def sync( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdateIncidentPermissionSet, -) -> ErrorsList | IncidentPermissionSetResponse | None: +) -> Optional[Union[ErrorsList, IncidentPermissionSetResponse]]: """Update an incident_permission_set Update a specific incident_permission_set by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateIncidentPermissionSet): Raises: @@ -118,7 +115,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentPermissionSetResponse + Union[ErrorsList, IncidentPermissionSetResponse] """ return sync_detailed( @@ -129,17 +126,17 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdateIncidentPermissionSet, -) -> Response[ErrorsList | IncidentPermissionSetResponse]: +) -> Response[Union[ErrorsList, IncidentPermissionSetResponse]]: """Update an incident_permission_set Update a specific incident_permission_set by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateIncidentPermissionSet): Raises: @@ -147,7 +144,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentPermissionSetResponse] + Response[Union[ErrorsList, IncidentPermissionSetResponse]] """ kwargs = _get_kwargs( @@ -161,17 +158,17 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdateIncidentPermissionSet, -) -> ErrorsList | IncidentPermissionSetResponse | None: +) -> Optional[Union[ErrorsList, IncidentPermissionSetResponse]]: """Update an incident_permission_set Update a specific incident_permission_set by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateIncidentPermissionSet): Raises: @@ -179,7 +176,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentPermissionSetResponse + Union[ErrorsList, IncidentPermissionSetResponse] """ return ( diff --git a/rootly_sdk/api/incident_retrospective_steps/get_incident_retrospective_step.py b/rootly_sdk/api/incident_retrospective_steps/get_incident_retrospective_step.py index ab0153d1..b9bd386c 100644 --- a/rootly_sdk/api/incident_retrospective_steps/get_incident_retrospective_step.py +++ b/rootly_sdk/api/incident_retrospective_steps/get_incident_retrospective_step.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/incident_retrospective_steps/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/incident_retrospective_steps/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | IncidentRetrospectiveStepResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, IncidentRetrospectiveStepResponse]]: if response.status_code == 200: response_200 = IncidentRetrospectiveStepResponse.from_dict(response.json()) @@ -45,8 +41,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | IncidentRetrospectiveStepResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, IncidentRetrospectiveStepResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | IncidentRetrospectiveStepResponse]: +) -> Response[Union[ErrorsList, IncidentRetrospectiveStepResponse]]: """Retrieves an incident retrospective step Retrieves a specific incident retrospective step by id @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentRetrospectiveStepResponse] + Response[Union[ErrorsList, IncidentRetrospectiveStepResponse]] """ kwargs = _get_kwargs( @@ -90,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | IncidentRetrospectiveStepResponse | None: +) -> Optional[Union[ErrorsList, IncidentRetrospectiveStepResponse]]: """Retrieves an incident retrospective step Retrieves a specific incident retrospective step by id @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentRetrospectiveStepResponse + Union[ErrorsList, IncidentRetrospectiveStepResponse] """ return sync_detailed( @@ -116,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | IncidentRetrospectiveStepResponse]: +) -> Response[Union[ErrorsList, IncidentRetrospectiveStepResponse]]: """Retrieves an incident retrospective step Retrieves a specific incident retrospective step by id @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentRetrospectiveStepResponse] + Response[Union[ErrorsList, IncidentRetrospectiveStepResponse]] """ kwargs = _get_kwargs( @@ -145,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | IncidentRetrospectiveStepResponse | None: +) -> Optional[Union[ErrorsList, IncidentRetrospectiveStepResponse]]: """Retrieves an incident retrospective step Retrieves a specific incident retrospective step by id @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentRetrospectiveStepResponse + Union[ErrorsList, IncidentRetrospectiveStepResponse] """ return ( diff --git a/rootly_sdk/api/incident_retrospective_steps/update_incident_retrospective_step.py b/rootly_sdk/api/incident_retrospective_steps/update_incident_retrospective_step.py index 8956c7c5..4eb42fe9 100644 --- a/rootly_sdk/api/incident_retrospective_steps/update_incident_retrospective_step.py +++ b/rootly_sdk/api/incident_retrospective_steps/update_incident_retrospective_step.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/incident_retrospective_steps/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/incident_retrospective_steps/{id}", } _kwargs["json"] = body.to_dict() @@ -35,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | IncidentRetrospectiveStepResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, IncidentRetrospectiveStepResponse]]: if response.status_code == 200: response_200 = IncidentRetrospectiveStepResponse.from_dict(response.json()) @@ -54,8 +51,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | IncidentRetrospectiveStepResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, IncidentRetrospectiveStepResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateIncidentRetrospectiveStep, -) -> Response[ErrorsList | IncidentRetrospectiveStepResponse]: +) -> Response[Union[ErrorsList, IncidentRetrospectiveStepResponse]]: """Update an incident retrospective step Update a specific incident retrospective step by id @@ -83,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentRetrospectiveStepResponse] + Response[Union[ErrorsList, IncidentRetrospectiveStepResponse]] """ kwargs = _get_kwargs( @@ -103,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateIncidentRetrospectiveStep, -) -> ErrorsList | IncidentRetrospectiveStepResponse | None: +) -> Optional[Union[ErrorsList, IncidentRetrospectiveStepResponse]]: """Update an incident retrospective step Update a specific incident retrospective step by id @@ -117,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentRetrospectiveStepResponse + Union[ErrorsList, IncidentRetrospectiveStepResponse] """ return sync_detailed( @@ -132,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateIncidentRetrospectiveStep, -) -> Response[ErrorsList | IncidentRetrospectiveStepResponse]: +) -> Response[Union[ErrorsList, IncidentRetrospectiveStepResponse]]: """Update an incident retrospective step Update a specific incident retrospective step by id @@ -146,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentRetrospectiveStepResponse] + Response[Union[ErrorsList, IncidentRetrospectiveStepResponse]] """ kwargs = _get_kwargs( @@ -164,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateIncidentRetrospectiveStep, -) -> ErrorsList | IncidentRetrospectiveStepResponse | None: +) -> Optional[Union[ErrorsList, IncidentRetrospectiveStepResponse]]: """Update an incident retrospective step Update a specific incident retrospective step by id @@ -178,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentRetrospectiveStepResponse + Union[ErrorsList, IncidentRetrospectiveStepResponse] """ return ( diff --git a/rootly_sdk/api/incident_retrospectives/list_incident_post_mortems.py b/rootly_sdk/api/incident_retrospectives/list_incident_post_mortems.py index 1c183c5c..2f45f6d0 100644 --- a/rootly_sdk/api/incident_retrospectives/list_incident_post_mortems.py +++ b/rootly_sdk/api/incident_retrospectives/list_incident_post_mortems.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -11,45 +11,44 @@ def _get_kwargs( *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterstatus: str | Unset = UNSET, - filterseverity: str | Unset = UNSET, - filtertype: str | Unset = UNSET, - filteruser_id: int | Unset = UNSET, - filtertypes: str | Unset = UNSET, - filtertype_ids: str | Unset = UNSET, - filterenvironments: str | Unset = UNSET, - filterenvironment_ids: str | Unset = UNSET, - filterfunctionalities: str | Unset = UNSET, - filterfunctionality_ids: str | Unset = UNSET, - filterservices: str | Unset = UNSET, - filterservice_ids: str | Unset = UNSET, - filterteams: str | Unset = UNSET, - filterteam_ids: str | Unset = UNSET, - filtercauses: str | Unset = UNSET, - filtercause_ids: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterstarted_atgt: str | Unset = UNSET, - filterstarted_atgte: str | Unset = UNSET, - filterstarted_atlt: str | Unset = UNSET, - filterstarted_atlte: str | Unset = UNSET, - filtermitigated_atgt: str | Unset = UNSET, - filtermitigated_atgte: str | Unset = UNSET, - filtermitigated_atlt: str | Unset = UNSET, - filtermitigated_atlte: str | Unset = UNSET, - filterresolved_atgt: str | Unset = UNSET, - filterresolved_atgte: str | Unset = UNSET, - filterresolved_atlt: str | Unset = UNSET, - filterresolved_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filterstatus: Union[Unset, str] = UNSET, + filterseverity: Union[Unset, str] = UNSET, + filtertype: Union[Unset, str] = UNSET, + filteruser_id: Union[Unset, int] = UNSET, + filtertypes: Union[Unset, str] = UNSET, + filtertype_ids: Union[Unset, str] = UNSET, + filterenvironments: Union[Unset, str] = UNSET, + filterenvironment_ids: Union[Unset, str] = UNSET, + filterfunctionalities: Union[Unset, str] = UNSET, + filterfunctionality_ids: Union[Unset, str] = UNSET, + filterservices: Union[Unset, str] = UNSET, + filterservice_ids: Union[Unset, str] = UNSET, + filterteams: Union[Unset, str] = UNSET, + filterteam_ids: Union[Unset, str] = UNSET, + filtercauses: Union[Unset, str] = UNSET, + filtercause_ids: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filterstarted_atgt: Union[Unset, str] = UNSET, + filterstarted_atgte: Union[Unset, str] = UNSET, + filterstarted_atlt: Union[Unset, str] = UNSET, + filterstarted_atlte: Union[Unset, str] = UNSET, + filtermitigated_atgt: Union[Unset, str] = UNSET, + filtermitigated_atgte: Union[Unset, str] = UNSET, + filtermitigated_atlt: Union[Unset, str] = UNSET, + filtermitigated_atlte: Union[Unset, str] = UNSET, + filterresolved_atgt: Union[Unset, str] = UNSET, + filterresolved_atgte: Union[Unset, str] = UNSET, + filterresolved_atlt: Union[Unset, str] = UNSET, + filterresolved_atlte: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -137,7 +136,9 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> IncidentPostMortemList | None: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[IncidentPostMortemList]: if response.status_code == 200: response_200 = IncidentPostMortemList.from_dict(response.json()) @@ -150,7 +151,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[IncidentPostMortemList]: return Response( status_code=HTTPStatus(response.status_code), @@ -163,86 +164,86 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterstatus: str | Unset = UNSET, - filterseverity: str | Unset = UNSET, - filtertype: str | Unset = UNSET, - filteruser_id: int | Unset = UNSET, - filtertypes: str | Unset = UNSET, - filtertype_ids: str | Unset = UNSET, - filterenvironments: str | Unset = UNSET, - filterenvironment_ids: str | Unset = UNSET, - filterfunctionalities: str | Unset = UNSET, - filterfunctionality_ids: str | Unset = UNSET, - filterservices: str | Unset = UNSET, - filterservice_ids: str | Unset = UNSET, - filterteams: str | Unset = UNSET, - filterteam_ids: str | Unset = UNSET, - filtercauses: str | Unset = UNSET, - filtercause_ids: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterstarted_atgt: str | Unset = UNSET, - filterstarted_atgte: str | Unset = UNSET, - filterstarted_atlt: str | Unset = UNSET, - filterstarted_atlte: str | Unset = UNSET, - filtermitigated_atgt: str | Unset = UNSET, - filtermitigated_atgte: str | Unset = UNSET, - filtermitigated_atlt: str | Unset = UNSET, - filtermitigated_atlte: str | Unset = UNSET, - filterresolved_atgt: str | Unset = UNSET, - filterresolved_atgte: str | Unset = UNSET, - filterresolved_atlt: str | Unset = UNSET, - filterresolved_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filterstatus: Union[Unset, str] = UNSET, + filterseverity: Union[Unset, str] = UNSET, + filtertype: Union[Unset, str] = UNSET, + filteruser_id: Union[Unset, int] = UNSET, + filtertypes: Union[Unset, str] = UNSET, + filtertype_ids: Union[Unset, str] = UNSET, + filterenvironments: Union[Unset, str] = UNSET, + filterenvironment_ids: Union[Unset, str] = UNSET, + filterfunctionalities: Union[Unset, str] = UNSET, + filterfunctionality_ids: Union[Unset, str] = UNSET, + filterservices: Union[Unset, str] = UNSET, + filterservice_ids: Union[Unset, str] = UNSET, + filterteams: Union[Unset, str] = UNSET, + filterteam_ids: Union[Unset, str] = UNSET, + filtercauses: Union[Unset, str] = UNSET, + filtercause_ids: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filterstarted_atgt: Union[Unset, str] = UNSET, + filterstarted_atgte: Union[Unset, str] = UNSET, + filterstarted_atlt: Union[Unset, str] = UNSET, + filterstarted_atlte: Union[Unset, str] = UNSET, + filtermitigated_atgt: Union[Unset, str] = UNSET, + filtermitigated_atgte: Union[Unset, str] = UNSET, + filtermitigated_atlt: Union[Unset, str] = UNSET, + filtermitigated_atlte: Union[Unset, str] = UNSET, + filterresolved_atgt: Union[Unset, str] = UNSET, + filterresolved_atgte: Union[Unset, str] = UNSET, + filterresolved_atlt: Union[Unset, str] = UNSET, + filterresolved_atlte: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, ) -> Response[IncidentPostMortemList]: """List incident retrospectives List incident retrospectives Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterstatus (str | Unset): - filterseverity (str | Unset): - filtertype (str | Unset): - filteruser_id (int | Unset): - filtertypes (str | Unset): - filtertype_ids (str | Unset): - filterenvironments (str | Unset): - filterenvironment_ids (str | Unset): - filterfunctionalities (str | Unset): - filterfunctionality_ids (str | Unset): - filterservices (str | Unset): - filterservice_ids (str | Unset): - filterteams (str | Unset): - filterteam_ids (str | Unset): - filtercauses (str | Unset): - filtercause_ids (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterstarted_atgt (str | Unset): - filterstarted_atgte (str | Unset): - filterstarted_atlt (str | Unset): - filterstarted_atlte (str | Unset): - filtermitigated_atgt (str | Unset): - filtermitigated_atgte (str | Unset): - filtermitigated_atlt (str | Unset): - filtermitigated_atlte (str | Unset): - filterresolved_atgt (str | Unset): - filterresolved_atgte (str | Unset): - filterresolved_atlt (str | Unset): - filterresolved_atlte (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterstatus (Union[Unset, str]): + filterseverity (Union[Unset, str]): + filtertype (Union[Unset, str]): + filteruser_id (Union[Unset, int]): + filtertypes (Union[Unset, str]): + filtertype_ids (Union[Unset, str]): + filterenvironments (Union[Unset, str]): + filterenvironment_ids (Union[Unset, str]): + filterfunctionalities (Union[Unset, str]): + filterfunctionality_ids (Union[Unset, str]): + filterservices (Union[Unset, str]): + filterservice_ids (Union[Unset, str]): + filterteams (Union[Unset, str]): + filterteam_ids (Union[Unset, str]): + filtercauses (Union[Unset, str]): + filtercause_ids (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterstarted_atgt (Union[Unset, str]): + filterstarted_atgte (Union[Unset, str]): + filterstarted_atlt (Union[Unset, str]): + filterstarted_atlte (Union[Unset, str]): + filtermitigated_atgt (Union[Unset, str]): + filtermitigated_atgte (Union[Unset, str]): + filtermitigated_atlt (Union[Unset, str]): + filtermitigated_atlte (Union[Unset, str]): + filterresolved_atgt (Union[Unset, str]): + filterresolved_atgte (Union[Unset, str]): + filterresolved_atlt (Union[Unset, str]): + filterresolved_atlte (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -302,86 +303,86 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterstatus: str | Unset = UNSET, - filterseverity: str | Unset = UNSET, - filtertype: str | Unset = UNSET, - filteruser_id: int | Unset = UNSET, - filtertypes: str | Unset = UNSET, - filtertype_ids: str | Unset = UNSET, - filterenvironments: str | Unset = UNSET, - filterenvironment_ids: str | Unset = UNSET, - filterfunctionalities: str | Unset = UNSET, - filterfunctionality_ids: str | Unset = UNSET, - filterservices: str | Unset = UNSET, - filterservice_ids: str | Unset = UNSET, - filterteams: str | Unset = UNSET, - filterteam_ids: str | Unset = UNSET, - filtercauses: str | Unset = UNSET, - filtercause_ids: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterstarted_atgt: str | Unset = UNSET, - filterstarted_atgte: str | Unset = UNSET, - filterstarted_atlt: str | Unset = UNSET, - filterstarted_atlte: str | Unset = UNSET, - filtermitigated_atgt: str | Unset = UNSET, - filtermitigated_atgte: str | Unset = UNSET, - filtermitigated_atlt: str | Unset = UNSET, - filtermitigated_atlte: str | Unset = UNSET, - filterresolved_atgt: str | Unset = UNSET, - filterresolved_atgte: str | Unset = UNSET, - filterresolved_atlt: str | Unset = UNSET, - filterresolved_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, -) -> IncidentPostMortemList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filterstatus: Union[Unset, str] = UNSET, + filterseverity: Union[Unset, str] = UNSET, + filtertype: Union[Unset, str] = UNSET, + filteruser_id: Union[Unset, int] = UNSET, + filtertypes: Union[Unset, str] = UNSET, + filtertype_ids: Union[Unset, str] = UNSET, + filterenvironments: Union[Unset, str] = UNSET, + filterenvironment_ids: Union[Unset, str] = UNSET, + filterfunctionalities: Union[Unset, str] = UNSET, + filterfunctionality_ids: Union[Unset, str] = UNSET, + filterservices: Union[Unset, str] = UNSET, + filterservice_ids: Union[Unset, str] = UNSET, + filterteams: Union[Unset, str] = UNSET, + filterteam_ids: Union[Unset, str] = UNSET, + filtercauses: Union[Unset, str] = UNSET, + filtercause_ids: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filterstarted_atgt: Union[Unset, str] = UNSET, + filterstarted_atgte: Union[Unset, str] = UNSET, + filterstarted_atlt: Union[Unset, str] = UNSET, + filterstarted_atlte: Union[Unset, str] = UNSET, + filtermitigated_atgt: Union[Unset, str] = UNSET, + filtermitigated_atgte: Union[Unset, str] = UNSET, + filtermitigated_atlt: Union[Unset, str] = UNSET, + filtermitigated_atlte: Union[Unset, str] = UNSET, + filterresolved_atgt: Union[Unset, str] = UNSET, + filterresolved_atgte: Union[Unset, str] = UNSET, + filterresolved_atlt: Union[Unset, str] = UNSET, + filterresolved_atlte: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, +) -> Optional[IncidentPostMortemList]: """List incident retrospectives List incident retrospectives Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterstatus (str | Unset): - filterseverity (str | Unset): - filtertype (str | Unset): - filteruser_id (int | Unset): - filtertypes (str | Unset): - filtertype_ids (str | Unset): - filterenvironments (str | Unset): - filterenvironment_ids (str | Unset): - filterfunctionalities (str | Unset): - filterfunctionality_ids (str | Unset): - filterservices (str | Unset): - filterservice_ids (str | Unset): - filterteams (str | Unset): - filterteam_ids (str | Unset): - filtercauses (str | Unset): - filtercause_ids (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterstarted_atgt (str | Unset): - filterstarted_atgte (str | Unset): - filterstarted_atlt (str | Unset): - filterstarted_atlte (str | Unset): - filtermitigated_atgt (str | Unset): - filtermitigated_atgte (str | Unset): - filtermitigated_atlt (str | Unset): - filtermitigated_atlte (str | Unset): - filterresolved_atgt (str | Unset): - filterresolved_atgte (str | Unset): - filterresolved_atlt (str | Unset): - filterresolved_atlte (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterstatus (Union[Unset, str]): + filterseverity (Union[Unset, str]): + filtertype (Union[Unset, str]): + filteruser_id (Union[Unset, int]): + filtertypes (Union[Unset, str]): + filtertype_ids (Union[Unset, str]): + filterenvironments (Union[Unset, str]): + filterenvironment_ids (Union[Unset, str]): + filterfunctionalities (Union[Unset, str]): + filterfunctionality_ids (Union[Unset, str]): + filterservices (Union[Unset, str]): + filterservice_ids (Union[Unset, str]): + filterteams (Union[Unset, str]): + filterteam_ids (Union[Unset, str]): + filtercauses (Union[Unset, str]): + filtercause_ids (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterstarted_atgt (Union[Unset, str]): + filterstarted_atgte (Union[Unset, str]): + filterstarted_atlt (Union[Unset, str]): + filterstarted_atlte (Union[Unset, str]): + filtermitigated_atgt (Union[Unset, str]): + filtermitigated_atgte (Union[Unset, str]): + filtermitigated_atlt (Union[Unset, str]): + filtermitigated_atlte (Union[Unset, str]): + filterresolved_atgt (Union[Unset, str]): + filterresolved_atgte (Union[Unset, str]): + filterresolved_atlt (Union[Unset, str]): + filterresolved_atlte (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -436,86 +437,86 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterstatus: str | Unset = UNSET, - filterseverity: str | Unset = UNSET, - filtertype: str | Unset = UNSET, - filteruser_id: int | Unset = UNSET, - filtertypes: str | Unset = UNSET, - filtertype_ids: str | Unset = UNSET, - filterenvironments: str | Unset = UNSET, - filterenvironment_ids: str | Unset = UNSET, - filterfunctionalities: str | Unset = UNSET, - filterfunctionality_ids: str | Unset = UNSET, - filterservices: str | Unset = UNSET, - filterservice_ids: str | Unset = UNSET, - filterteams: str | Unset = UNSET, - filterteam_ids: str | Unset = UNSET, - filtercauses: str | Unset = UNSET, - filtercause_ids: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterstarted_atgt: str | Unset = UNSET, - filterstarted_atgte: str | Unset = UNSET, - filterstarted_atlt: str | Unset = UNSET, - filterstarted_atlte: str | Unset = UNSET, - filtermitigated_atgt: str | Unset = UNSET, - filtermitigated_atgte: str | Unset = UNSET, - filtermitigated_atlt: str | Unset = UNSET, - filtermitigated_atlte: str | Unset = UNSET, - filterresolved_atgt: str | Unset = UNSET, - filterresolved_atgte: str | Unset = UNSET, - filterresolved_atlt: str | Unset = UNSET, - filterresolved_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filterstatus: Union[Unset, str] = UNSET, + filterseverity: Union[Unset, str] = UNSET, + filtertype: Union[Unset, str] = UNSET, + filteruser_id: Union[Unset, int] = UNSET, + filtertypes: Union[Unset, str] = UNSET, + filtertype_ids: Union[Unset, str] = UNSET, + filterenvironments: Union[Unset, str] = UNSET, + filterenvironment_ids: Union[Unset, str] = UNSET, + filterfunctionalities: Union[Unset, str] = UNSET, + filterfunctionality_ids: Union[Unset, str] = UNSET, + filterservices: Union[Unset, str] = UNSET, + filterservice_ids: Union[Unset, str] = UNSET, + filterteams: Union[Unset, str] = UNSET, + filterteam_ids: Union[Unset, str] = UNSET, + filtercauses: Union[Unset, str] = UNSET, + filtercause_ids: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filterstarted_atgt: Union[Unset, str] = UNSET, + filterstarted_atgte: Union[Unset, str] = UNSET, + filterstarted_atlt: Union[Unset, str] = UNSET, + filterstarted_atlte: Union[Unset, str] = UNSET, + filtermitigated_atgt: Union[Unset, str] = UNSET, + filtermitigated_atgte: Union[Unset, str] = UNSET, + filtermitigated_atlt: Union[Unset, str] = UNSET, + filtermitigated_atlte: Union[Unset, str] = UNSET, + filterresolved_atgt: Union[Unset, str] = UNSET, + filterresolved_atgte: Union[Unset, str] = UNSET, + filterresolved_atlt: Union[Unset, str] = UNSET, + filterresolved_atlte: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, ) -> Response[IncidentPostMortemList]: """List incident retrospectives List incident retrospectives Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterstatus (str | Unset): - filterseverity (str | Unset): - filtertype (str | Unset): - filteruser_id (int | Unset): - filtertypes (str | Unset): - filtertype_ids (str | Unset): - filterenvironments (str | Unset): - filterenvironment_ids (str | Unset): - filterfunctionalities (str | Unset): - filterfunctionality_ids (str | Unset): - filterservices (str | Unset): - filterservice_ids (str | Unset): - filterteams (str | Unset): - filterteam_ids (str | Unset): - filtercauses (str | Unset): - filtercause_ids (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterstarted_atgt (str | Unset): - filterstarted_atgte (str | Unset): - filterstarted_atlt (str | Unset): - filterstarted_atlte (str | Unset): - filtermitigated_atgt (str | Unset): - filtermitigated_atgte (str | Unset): - filtermitigated_atlt (str | Unset): - filtermitigated_atlte (str | Unset): - filterresolved_atgt (str | Unset): - filterresolved_atgte (str | Unset): - filterresolved_atlt (str | Unset): - filterresolved_atlte (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterstatus (Union[Unset, str]): + filterseverity (Union[Unset, str]): + filtertype (Union[Unset, str]): + filteruser_id (Union[Unset, int]): + filtertypes (Union[Unset, str]): + filtertype_ids (Union[Unset, str]): + filterenvironments (Union[Unset, str]): + filterenvironment_ids (Union[Unset, str]): + filterfunctionalities (Union[Unset, str]): + filterfunctionality_ids (Union[Unset, str]): + filterservices (Union[Unset, str]): + filterservice_ids (Union[Unset, str]): + filterteams (Union[Unset, str]): + filterteam_ids (Union[Unset, str]): + filtercauses (Union[Unset, str]): + filtercause_ids (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterstarted_atgt (Union[Unset, str]): + filterstarted_atgte (Union[Unset, str]): + filterstarted_atlt (Union[Unset, str]): + filterstarted_atlte (Union[Unset, str]): + filtermitigated_atgt (Union[Unset, str]): + filtermitigated_atgte (Union[Unset, str]): + filtermitigated_atlt (Union[Unset, str]): + filtermitigated_atlte (Union[Unset, str]): + filterresolved_atgt (Union[Unset, str]): + filterresolved_atgte (Union[Unset, str]): + filterresolved_atlt (Union[Unset, str]): + filterresolved_atlte (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -573,86 +574,86 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterstatus: str | Unset = UNSET, - filterseverity: str | Unset = UNSET, - filtertype: str | Unset = UNSET, - filteruser_id: int | Unset = UNSET, - filtertypes: str | Unset = UNSET, - filtertype_ids: str | Unset = UNSET, - filterenvironments: str | Unset = UNSET, - filterenvironment_ids: str | Unset = UNSET, - filterfunctionalities: str | Unset = UNSET, - filterfunctionality_ids: str | Unset = UNSET, - filterservices: str | Unset = UNSET, - filterservice_ids: str | Unset = UNSET, - filterteams: str | Unset = UNSET, - filterteam_ids: str | Unset = UNSET, - filtercauses: str | Unset = UNSET, - filtercause_ids: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterstarted_atgt: str | Unset = UNSET, - filterstarted_atgte: str | Unset = UNSET, - filterstarted_atlt: str | Unset = UNSET, - filterstarted_atlte: str | Unset = UNSET, - filtermitigated_atgt: str | Unset = UNSET, - filtermitigated_atgte: str | Unset = UNSET, - filtermitigated_atlt: str | Unset = UNSET, - filtermitigated_atlte: str | Unset = UNSET, - filterresolved_atgt: str | Unset = UNSET, - filterresolved_atgte: str | Unset = UNSET, - filterresolved_atlt: str | Unset = UNSET, - filterresolved_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, -) -> IncidentPostMortemList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filterstatus: Union[Unset, str] = UNSET, + filterseverity: Union[Unset, str] = UNSET, + filtertype: Union[Unset, str] = UNSET, + filteruser_id: Union[Unset, int] = UNSET, + filtertypes: Union[Unset, str] = UNSET, + filtertype_ids: Union[Unset, str] = UNSET, + filterenvironments: Union[Unset, str] = UNSET, + filterenvironment_ids: Union[Unset, str] = UNSET, + filterfunctionalities: Union[Unset, str] = UNSET, + filterfunctionality_ids: Union[Unset, str] = UNSET, + filterservices: Union[Unset, str] = UNSET, + filterservice_ids: Union[Unset, str] = UNSET, + filterteams: Union[Unset, str] = UNSET, + filterteam_ids: Union[Unset, str] = UNSET, + filtercauses: Union[Unset, str] = UNSET, + filtercause_ids: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filterstarted_atgt: Union[Unset, str] = UNSET, + filterstarted_atgte: Union[Unset, str] = UNSET, + filterstarted_atlt: Union[Unset, str] = UNSET, + filterstarted_atlte: Union[Unset, str] = UNSET, + filtermitigated_atgt: Union[Unset, str] = UNSET, + filtermitigated_atgte: Union[Unset, str] = UNSET, + filtermitigated_atlt: Union[Unset, str] = UNSET, + filtermitigated_atlte: Union[Unset, str] = UNSET, + filterresolved_atgt: Union[Unset, str] = UNSET, + filterresolved_atgte: Union[Unset, str] = UNSET, + filterresolved_atlt: Union[Unset, str] = UNSET, + filterresolved_atlte: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, +) -> Optional[IncidentPostMortemList]: """List incident retrospectives List incident retrospectives Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterstatus (str | Unset): - filterseverity (str | Unset): - filtertype (str | Unset): - filteruser_id (int | Unset): - filtertypes (str | Unset): - filtertype_ids (str | Unset): - filterenvironments (str | Unset): - filterenvironment_ids (str | Unset): - filterfunctionalities (str | Unset): - filterfunctionality_ids (str | Unset): - filterservices (str | Unset): - filterservice_ids (str | Unset): - filterteams (str | Unset): - filterteam_ids (str | Unset): - filtercauses (str | Unset): - filtercause_ids (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterstarted_atgt (str | Unset): - filterstarted_atgte (str | Unset): - filterstarted_atlt (str | Unset): - filterstarted_atlte (str | Unset): - filtermitigated_atgt (str | Unset): - filtermitigated_atgte (str | Unset): - filtermitigated_atlt (str | Unset): - filtermitigated_atlte (str | Unset): - filterresolved_atgt (str | Unset): - filterresolved_atgte (str | Unset): - filterresolved_atlt (str | Unset): - filterresolved_atlte (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterstatus (Union[Unset, str]): + filterseverity (Union[Unset, str]): + filtertype (Union[Unset, str]): + filteruser_id (Union[Unset, int]): + filtertypes (Union[Unset, str]): + filtertype_ids (Union[Unset, str]): + filterenvironments (Union[Unset, str]): + filterenvironment_ids (Union[Unset, str]): + filterfunctionalities (Union[Unset, str]): + filterfunctionality_ids (Union[Unset, str]): + filterservices (Union[Unset, str]): + filterservice_ids (Union[Unset, str]): + filterteams (Union[Unset, str]): + filterteam_ids (Union[Unset, str]): + filtercauses (Union[Unset, str]): + filtercause_ids (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterstarted_atgt (Union[Unset, str]): + filterstarted_atgte (Union[Unset, str]): + filterstarted_atlt (Union[Unset, str]): + filterstarted_atlte (Union[Unset, str]): + filtermitigated_atgt (Union[Unset, str]): + filtermitigated_atgte (Union[Unset, str]): + filtermitigated_atlt (Union[Unset, str]): + filtermitigated_atlte (Union[Unset, str]): + filterresolved_atgt (Union[Unset, str]): + filterresolved_atgte (Union[Unset, str]): + filterresolved_atlt (Union[Unset, str]): + filterresolved_atlte (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/incident_retrospectives/list_incident_postmortem.py b/rootly_sdk/api/incident_retrospectives/list_incident_postmortem.py index 0914afba..eea6fc07 100644 --- a/rootly_sdk/api/incident_retrospectives/list_incident_postmortem.py +++ b/rootly_sdk/api/incident_retrospectives/list_incident_postmortem.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union from uuid import UUID import httpx @@ -13,22 +12,19 @@ def _get_kwargs( - id: str | UUID, + id: Union[UUID, str], ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/post_mortems/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/post_mortems/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | IncidentPostMortemResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, IncidentPostMortemResponse]]: if response.status_code == 200: response_200 = IncidentPostMortemResponse.from_dict(response.json()) @@ -46,8 +42,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | IncidentPostMortemResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, IncidentPostMortemResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -57,23 +53,23 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Response[ErrorsList | IncidentPostMortemResponse]: +) -> Response[Union[ErrorsList, IncidentPostMortemResponse]]: """Retrieves an incident retrospective List incidents retrospectives Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentPostMortemResponse] + Response[Union[ErrorsList, IncidentPostMortemResponse]] """ kwargs = _get_kwargs( @@ -88,23 +84,23 @@ def sync_detailed( def sync( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> ErrorsList | IncidentPostMortemResponse | None: +) -> Optional[Union[ErrorsList, IncidentPostMortemResponse]]: """Retrieves an incident retrospective List incidents retrospectives Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentPostMortemResponse + Union[ErrorsList, IncidentPostMortemResponse] """ return sync_detailed( @@ -114,23 +110,23 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Response[ErrorsList | IncidentPostMortemResponse]: +) -> Response[Union[ErrorsList, IncidentPostMortemResponse]]: """Retrieves an incident retrospective List incidents retrospectives Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentPostMortemResponse] + Response[Union[ErrorsList, IncidentPostMortemResponse]] """ kwargs = _get_kwargs( @@ -143,23 +139,23 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> ErrorsList | IncidentPostMortemResponse | None: +) -> Optional[Union[ErrorsList, IncidentPostMortemResponse]]: """Retrieves an incident retrospective List incidents retrospectives Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentPostMortemResponse + Union[ErrorsList, IncidentPostMortemResponse] """ return ( diff --git a/rootly_sdk/api/incident_retrospectives/update_incident_postmortem.py b/rootly_sdk/api/incident_retrospectives/update_incident_postmortem.py index 226bb3b4..42655644 100644 --- a/rootly_sdk/api/incident_retrospectives/update_incident_postmortem.py +++ b/rootly_sdk/api/incident_retrospectives/update_incident_postmortem.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union from uuid import UUID import httpx @@ -14,7 +13,7 @@ def _get_kwargs( - id: str | UUID, + id: Union[UUID, str], *, body: UpdateIncidentPostMortem, ) -> dict[str, Any]: @@ -22,9 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/post_mortems/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/post_mortems/{id}", } _kwargs["json"] = body.to_dict() @@ -36,8 +33,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | IncidentPostMortemResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, IncidentPostMortemResponse]]: if response.status_code == 200: response_200 = IncidentPostMortemResponse.from_dict(response.json()) @@ -55,8 +52,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | IncidentPostMortemResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, IncidentPostMortemResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,17 +63,17 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdateIncidentPostMortem, -) -> Response[ErrorsList | IncidentPostMortemResponse]: +) -> Response[Union[ErrorsList, IncidentPostMortemResponse]]: """Update an incident retrospective Update a specific incident retrospective by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateIncidentPostMortem): Raises: @@ -84,7 +81,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentPostMortemResponse] + Response[Union[ErrorsList, IncidentPostMortemResponse]] """ kwargs = _get_kwargs( @@ -100,17 +97,17 @@ def sync_detailed( def sync( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdateIncidentPostMortem, -) -> ErrorsList | IncidentPostMortemResponse | None: +) -> Optional[Union[ErrorsList, IncidentPostMortemResponse]]: """Update an incident retrospective Update a specific incident retrospective by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateIncidentPostMortem): Raises: @@ -118,7 +115,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentPostMortemResponse + Union[ErrorsList, IncidentPostMortemResponse] """ return sync_detailed( @@ -129,17 +126,17 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdateIncidentPostMortem, -) -> Response[ErrorsList | IncidentPostMortemResponse]: +) -> Response[Union[ErrorsList, IncidentPostMortemResponse]]: """Update an incident retrospective Update a specific incident retrospective by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateIncidentPostMortem): Raises: @@ -147,7 +144,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentPostMortemResponse] + Response[Union[ErrorsList, IncidentPostMortemResponse]] """ kwargs = _get_kwargs( @@ -161,17 +158,17 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdateIncidentPostMortem, -) -> ErrorsList | IncidentPostMortemResponse | None: +) -> Optional[Union[ErrorsList, IncidentPostMortemResponse]]: """Update an incident retrospective Update a specific incident retrospective by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateIncidentPostMortem): Raises: @@ -179,7 +176,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentPostMortemResponse + Union[ErrorsList, IncidentPostMortemResponse] """ return ( diff --git a/rootly_sdk/api/incident_role_tasks/create_incident_role_task.py b/rootly_sdk/api/incident_role_tasks/create_incident_role_task.py index ee4e706e..8bea2ead 100644 --- a/rootly_sdk/api/incident_role_tasks/create_incident_role_task.py +++ b/rootly_sdk/api/incident_role_tasks/create_incident_role_task.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/incident_roles/{incident_role_id}/incident_role_tasks".format( - incident_role_id=quote(str(incident_role_id), safe=""), - ), + "url": f"/v1/incident_roles/{incident_role_id}/incident_role_tasks", } _kwargs["json"] = body.to_dict() @@ -35,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | IncidentRoleTaskResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, IncidentRoleTaskResponse]]: if response.status_code == 201: response_201 = IncidentRoleTaskResponse.from_dict(response.json()) @@ -59,8 +56,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | IncidentRoleTaskResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, IncidentRoleTaskResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -74,7 +71,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewIncidentRoleTask, -) -> Response[ErrorsList | IncidentRoleTaskResponse]: +) -> Response[Union[ErrorsList, IncidentRoleTaskResponse]]: """Creates an incident role task Creates a new task from provided data @@ -88,7 +85,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentRoleTaskResponse] + Response[Union[ErrorsList, IncidentRoleTaskResponse]] """ kwargs = _get_kwargs( @@ -108,7 +105,7 @@ def sync( *, client: AuthenticatedClient, body: NewIncidentRoleTask, -) -> ErrorsList | IncidentRoleTaskResponse | None: +) -> Optional[Union[ErrorsList, IncidentRoleTaskResponse]]: """Creates an incident role task Creates a new task from provided data @@ -122,7 +119,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentRoleTaskResponse + Union[ErrorsList, IncidentRoleTaskResponse] """ return sync_detailed( @@ -137,7 +134,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewIncidentRoleTask, -) -> Response[ErrorsList | IncidentRoleTaskResponse]: +) -> Response[Union[ErrorsList, IncidentRoleTaskResponse]]: """Creates an incident role task Creates a new task from provided data @@ -151,7 +148,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentRoleTaskResponse] + Response[Union[ErrorsList, IncidentRoleTaskResponse]] """ kwargs = _get_kwargs( @@ -169,7 +166,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewIncidentRoleTask, -) -> ErrorsList | IncidentRoleTaskResponse | None: +) -> Optional[Union[ErrorsList, IncidentRoleTaskResponse]]: """Creates an incident role task Creates a new task from provided data @@ -183,7 +180,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentRoleTaskResponse + Union[ErrorsList, IncidentRoleTaskResponse] """ return ( diff --git a/rootly_sdk/api/incident_role_tasks/delete_incident_role_task.py b/rootly_sdk/api/incident_role_tasks/delete_incident_role_task.py index d4271588..345ed218 100644 --- a/rootly_sdk/api/incident_role_tasks/delete_incident_role_task.py +++ b/rootly_sdk/api/incident_role_tasks/delete_incident_role_task.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/incident_role_tasks/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/incident_role_tasks/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | IncidentRoleTaskResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, IncidentRoleTaskResponse]]: if response.status_code == 200: response_200 = IncidentRoleTaskResponse.from_dict(response.json()) @@ -45,8 +41,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | IncidentRoleTaskResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, IncidentRoleTaskResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | IncidentRoleTaskResponse]: +) -> Response[Union[ErrorsList, IncidentRoleTaskResponse]]: """Delete an incident role task Delete a specific incident_role task by id @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentRoleTaskResponse] + Response[Union[ErrorsList, IncidentRoleTaskResponse]] """ kwargs = _get_kwargs( @@ -90,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | IncidentRoleTaskResponse | None: +) -> Optional[Union[ErrorsList, IncidentRoleTaskResponse]]: """Delete an incident role task Delete a specific incident_role task by id @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentRoleTaskResponse + Union[ErrorsList, IncidentRoleTaskResponse] """ return sync_detailed( @@ -116,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | IncidentRoleTaskResponse]: +) -> Response[Union[ErrorsList, IncidentRoleTaskResponse]]: """Delete an incident role task Delete a specific incident_role task by id @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentRoleTaskResponse] + Response[Union[ErrorsList, IncidentRoleTaskResponse]] """ kwargs = _get_kwargs( @@ -145,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | IncidentRoleTaskResponse | None: +) -> Optional[Union[ErrorsList, IncidentRoleTaskResponse]]: """Delete an incident role task Delete a specific incident_role task by id @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentRoleTaskResponse + Union[ErrorsList, IncidentRoleTaskResponse] """ return ( diff --git a/rootly_sdk/api/incident_role_tasks/get_incident_role_task.py b/rootly_sdk/api/incident_role_tasks/get_incident_role_task.py index 8c240008..b7e3e1ab 100644 --- a/rootly_sdk/api/incident_role_tasks/get_incident_role_task.py +++ b/rootly_sdk/api/incident_role_tasks/get_incident_role_task.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/incident_role_tasks/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/incident_role_tasks/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | IncidentRoleTaskResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, IncidentRoleTaskResponse]]: if response.status_code == 200: response_200 = IncidentRoleTaskResponse.from_dict(response.json()) @@ -45,8 +41,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | IncidentRoleTaskResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, IncidentRoleTaskResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | IncidentRoleTaskResponse]: +) -> Response[Union[ErrorsList, IncidentRoleTaskResponse]]: """Retrieves an incident role task Retrieves a specific incident_role_task by id @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentRoleTaskResponse] + Response[Union[ErrorsList, IncidentRoleTaskResponse]] """ kwargs = _get_kwargs( @@ -90,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | IncidentRoleTaskResponse | None: +) -> Optional[Union[ErrorsList, IncidentRoleTaskResponse]]: """Retrieves an incident role task Retrieves a specific incident_role_task by id @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentRoleTaskResponse + Union[ErrorsList, IncidentRoleTaskResponse] """ return sync_detailed( @@ -116,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | IncidentRoleTaskResponse]: +) -> Response[Union[ErrorsList, IncidentRoleTaskResponse]]: """Retrieves an incident role task Retrieves a specific incident_role_task by id @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentRoleTaskResponse] + Response[Union[ErrorsList, IncidentRoleTaskResponse]] """ kwargs = _get_kwargs( @@ -145,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | IncidentRoleTaskResponse | None: +) -> Optional[Union[ErrorsList, IncidentRoleTaskResponse]]: """Retrieves an incident role task Retrieves a specific incident_role_task by id @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentRoleTaskResponse + Union[ErrorsList, IncidentRoleTaskResponse] """ return ( diff --git a/rootly_sdk/api/incident_role_tasks/list_incident_role_tasks.py b/rootly_sdk/api/incident_role_tasks/list_incident_role_tasks.py index c5d8a805..cb8fef89 100644 --- a/rootly_sdk/api/incident_role_tasks/list_incident_role_tasks.py +++ b/rootly_sdk/api/incident_role_tasks/list_incident_role_tasks.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -13,11 +12,10 @@ def _get_kwargs( incident_role_id: str, *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -30,16 +28,16 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/incident_roles/{incident_role_id}/incident_role_tasks".format( - incident_role_id=quote(str(incident_role_id), safe=""), - ), + "url": f"/v1/incident_roles/{incident_role_id}/incident_role_tasks", "params": params, } return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> IncidentRoleTaskList | None: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[IncidentRoleTaskList]: if response.status_code == 200: response_200 = IncidentRoleTaskList.from_dict(response.json()) @@ -52,7 +50,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[IncidentRoleTaskList]: return Response( status_code=HTTPStatus(response.status_code), @@ -66,9 +64,9 @@ def sync_detailed( incident_role_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, ) -> Response[IncidentRoleTaskList]: """List incident role tasks @@ -76,9 +74,9 @@ def sync_detailed( Args: incident_role_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -106,19 +104,19 @@ def sync( incident_role_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, -) -> IncidentRoleTaskList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, +) -> Optional[IncidentRoleTaskList]: """List incident role tasks List incident_role tasks Args: incident_role_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -141,9 +139,9 @@ async def asyncio_detailed( incident_role_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, ) -> Response[IncidentRoleTaskList]: """List incident role tasks @@ -151,9 +149,9 @@ async def asyncio_detailed( Args: incident_role_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -179,19 +177,19 @@ async def asyncio( incident_role_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, -) -> IncidentRoleTaskList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, +) -> Optional[IncidentRoleTaskList]: """List incident role tasks List incident_role tasks Args: incident_role_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/incident_role_tasks/update_incident_role_task.py b/rootly_sdk/api/incident_role_tasks/update_incident_role_task.py index 0ab3fb0a..676d3209 100644 --- a/rootly_sdk/api/incident_role_tasks/update_incident_role_task.py +++ b/rootly_sdk/api/incident_role_tasks/update_incident_role_task.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/incident_role_tasks/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/incident_role_tasks/{id}", } _kwargs["json"] = body.to_dict() @@ -35,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | IncidentRoleTaskResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, IncidentRoleTaskResponse]]: if response.status_code == 200: response_200 = IncidentRoleTaskResponse.from_dict(response.json()) @@ -54,8 +51,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | IncidentRoleTaskResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, IncidentRoleTaskResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateIncidentRoleTask, -) -> Response[ErrorsList | IncidentRoleTaskResponse]: +) -> Response[Union[ErrorsList, IncidentRoleTaskResponse]]: """Update an incident role task Update a specific incident_role task by id @@ -83,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentRoleTaskResponse] + Response[Union[ErrorsList, IncidentRoleTaskResponse]] """ kwargs = _get_kwargs( @@ -103,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateIncidentRoleTask, -) -> ErrorsList | IncidentRoleTaskResponse | None: +) -> Optional[Union[ErrorsList, IncidentRoleTaskResponse]]: """Update an incident role task Update a specific incident_role task by id @@ -117,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentRoleTaskResponse + Union[ErrorsList, IncidentRoleTaskResponse] """ return sync_detailed( @@ -132,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateIncidentRoleTask, -) -> Response[ErrorsList | IncidentRoleTaskResponse]: +) -> Response[Union[ErrorsList, IncidentRoleTaskResponse]]: """Update an incident role task Update a specific incident_role task by id @@ -146,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentRoleTaskResponse] + Response[Union[ErrorsList, IncidentRoleTaskResponse]] """ kwargs = _get_kwargs( @@ -164,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateIncidentRoleTask, -) -> ErrorsList | IncidentRoleTaskResponse | None: +) -> Optional[Union[ErrorsList, IncidentRoleTaskResponse]]: """Update an incident role task Update a specific incident_role task by id @@ -178,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentRoleTaskResponse + Union[ErrorsList, IncidentRoleTaskResponse] """ return ( diff --git a/rootly_sdk/api/incident_roles/create_incident_role.py b/rootly_sdk/api/incident_roles/create_incident_role.py index 6b747e39..41318ccc 100644 --- a/rootly_sdk/api/incident_roles/create_incident_role.py +++ b/rootly_sdk/api/incident_roles/create_incident_role.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | IncidentRoleResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, IncidentRoleResponse]]: if response.status_code == 201: response_201 = IncidentRoleResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | IncidentRoleResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, IncidentRoleResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +69,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewIncidentRole, -) -> Response[ErrorsList | IncidentRoleResponse]: +) -> Response[Union[ErrorsList, IncidentRoleResponse]]: """Creates an incident role Creates a new incident role from provided data @@ -82,7 +82,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentRoleResponse] + Response[Union[ErrorsList, IncidentRoleResponse]] """ kwargs = _get_kwargs( @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: NewIncidentRole, -) -> ErrorsList | IncidentRoleResponse | None: +) -> Optional[Union[ErrorsList, IncidentRoleResponse]]: """Creates an incident role Creates a new incident role from provided data @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentRoleResponse + Union[ErrorsList, IncidentRoleResponse] """ return sync_detailed( @@ -126,7 +126,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewIncidentRole, -) -> Response[ErrorsList | IncidentRoleResponse]: +) -> Response[Union[ErrorsList, IncidentRoleResponse]]: """Creates an incident role Creates a new incident role from provided data @@ -139,7 +139,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentRoleResponse] + Response[Union[ErrorsList, IncidentRoleResponse]] """ kwargs = _get_kwargs( @@ -155,7 +155,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewIncidentRole, -) -> ErrorsList | IncidentRoleResponse | None: +) -> Optional[Union[ErrorsList, IncidentRoleResponse]]: """Creates an incident role Creates a new incident role from provided data @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentRoleResponse + Union[ErrorsList, IncidentRoleResponse] """ return ( diff --git a/rootly_sdk/api/incident_roles/delete_incident_role.py b/rootly_sdk/api/incident_roles/delete_incident_role.py index 82e614df..844c6bc5 100644 --- a/rootly_sdk/api/incident_roles/delete_incident_role.py +++ b/rootly_sdk/api/incident_roles/delete_incident_role.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union from uuid import UUID import httpx @@ -13,22 +12,19 @@ def _get_kwargs( - id: str | UUID, + id: Union[UUID, str], ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/incident_roles/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/incident_roles/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | IncidentRoleResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, IncidentRoleResponse]]: if response.status_code == 200: response_200 = IncidentRoleResponse.from_dict(response.json()) @@ -46,8 +42,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | IncidentRoleResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, IncidentRoleResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -57,23 +53,23 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Response[ErrorsList | IncidentRoleResponse]: +) -> Response[Union[ErrorsList, IncidentRoleResponse]]: """Delete an incident role Delete a specific incident_role by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentRoleResponse] + Response[Union[ErrorsList, IncidentRoleResponse]] """ kwargs = _get_kwargs( @@ -88,23 +84,23 @@ def sync_detailed( def sync( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> ErrorsList | IncidentRoleResponse | None: +) -> Optional[Union[ErrorsList, IncidentRoleResponse]]: """Delete an incident role Delete a specific incident_role by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentRoleResponse + Union[ErrorsList, IncidentRoleResponse] """ return sync_detailed( @@ -114,23 +110,23 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Response[ErrorsList | IncidentRoleResponse]: +) -> Response[Union[ErrorsList, IncidentRoleResponse]]: """Delete an incident role Delete a specific incident_role by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentRoleResponse] + Response[Union[ErrorsList, IncidentRoleResponse]] """ kwargs = _get_kwargs( @@ -143,23 +139,23 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> ErrorsList | IncidentRoleResponse | None: +) -> Optional[Union[ErrorsList, IncidentRoleResponse]]: """Delete an incident role Delete a specific incident_role by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentRoleResponse + Union[ErrorsList, IncidentRoleResponse] """ return ( diff --git a/rootly_sdk/api/incident_roles/get_incident_role.py b/rootly_sdk/api/incident_roles/get_incident_role.py index 17763838..2a6513ce 100644 --- a/rootly_sdk/api/incident_roles/get_incident_role.py +++ b/rootly_sdk/api/incident_roles/get_incident_role.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union from uuid import UUID import httpx @@ -13,22 +12,19 @@ def _get_kwargs( - id: str | UUID, + id: Union[UUID, str], ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/incident_roles/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/incident_roles/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | IncidentRoleResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, IncidentRoleResponse]]: if response.status_code == 200: response_200 = IncidentRoleResponse.from_dict(response.json()) @@ -46,8 +42,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | IncidentRoleResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, IncidentRoleResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -57,23 +53,23 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Response[ErrorsList | IncidentRoleResponse]: +) -> Response[Union[ErrorsList, IncidentRoleResponse]]: """Retrieves an incident role Retrieves a specific incident_role by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentRoleResponse] + Response[Union[ErrorsList, IncidentRoleResponse]] """ kwargs = _get_kwargs( @@ -88,23 +84,23 @@ def sync_detailed( def sync( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> ErrorsList | IncidentRoleResponse | None: +) -> Optional[Union[ErrorsList, IncidentRoleResponse]]: """Retrieves an incident role Retrieves a specific incident_role by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentRoleResponse + Union[ErrorsList, IncidentRoleResponse] """ return sync_detailed( @@ -114,23 +110,23 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Response[ErrorsList | IncidentRoleResponse]: +) -> Response[Union[ErrorsList, IncidentRoleResponse]]: """Retrieves an incident role Retrieves a specific incident_role by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentRoleResponse] + Response[Union[ErrorsList, IncidentRoleResponse]] """ kwargs = _get_kwargs( @@ -143,23 +139,23 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> ErrorsList | IncidentRoleResponse | None: +) -> Optional[Union[ErrorsList, IncidentRoleResponse]]: """Retrieves an incident role Retrieves a specific incident_role by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentRoleResponse + Union[ErrorsList, IncidentRoleResponse] """ return ( diff --git a/rootly_sdk/api/incident_roles/list_incident_roles.py b/rootly_sdk/api/incident_roles/list_incident_roles.py index 3d27e9e4..abd9a583 100644 --- a/rootly_sdk/api/incident_roles/list_incident_roles.py +++ b/rootly_sdk/api/incident_roles/list_incident_roles.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -11,31 +11,30 @@ def _get_kwargs( *, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterenabled: bool | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filterenabledeq: str | Unset = UNSET, - filterenablednot_eq: str | Unset = UNSET, - filterenabledin: str | Unset = UNSET, - filterenablednot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterenabled: Union[Unset, bool] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filterslugeq: Union[Unset, str] = UNSET, + filterslugnot_eq: Union[Unset, str] = UNSET, + filterslugin: Union[Unset, str] = UNSET, + filterslugnot_in: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, + filterenabledeq: Union[Unset, str] = UNSET, + filterenablednot_eq: Union[Unset, str] = UNSET, + filterenabledin: Union[Unset, str] = UNSET, + filterenablednot_in: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["page[number]"] = pagenumber @@ -95,7 +94,9 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> IncidentRoleList | None: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[IncidentRoleList]: if response.status_code == 200: response_200 = IncidentRoleList.from_dict(response.json()) @@ -107,7 +108,9 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[IncidentRoleList]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[IncidentRoleList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -119,58 +122,58 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterenabled: bool | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filterenabledeq: str | Unset = UNSET, - filterenablednot_eq: str | Unset = UNSET, - filterenabledin: str | Unset = UNSET, - filterenablednot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterenabled: Union[Unset, bool] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filterslugeq: Union[Unset, str] = UNSET, + filterslugnot_eq: Union[Unset, str] = UNSET, + filterslugin: Union[Unset, str] = UNSET, + filterslugnot_in: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, + filterenabledeq: Union[Unset, str] = UNSET, + filterenablednot_eq: Union[Unset, str] = UNSET, + filterenabledin: Union[Unset, str] = UNSET, + filterenablednot_in: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, ) -> Response[IncidentRoleList]: """List incident roles List incident roles Args: - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterenabled (bool | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filterenabledeq (str | Unset): - filterenablednot_eq (str | Unset): - filterenabledin (str | Unset): - filterenablednot_in (str | Unset): - sort (str | Unset): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterenabled (Union[Unset, bool]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filterenabledeq (Union[Unset, str]): + filterenablednot_eq (Union[Unset, str]): + filterenabledin (Union[Unset, str]): + filterenablednot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -216,58 +219,58 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterenabled: bool | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filterenabledeq: str | Unset = UNSET, - filterenablednot_eq: str | Unset = UNSET, - filterenabledin: str | Unset = UNSET, - filterenablednot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, -) -> IncidentRoleList | None: + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterenabled: Union[Unset, bool] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filterslugeq: Union[Unset, str] = UNSET, + filterslugnot_eq: Union[Unset, str] = UNSET, + filterslugin: Union[Unset, str] = UNSET, + filterslugnot_in: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, + filterenabledeq: Union[Unset, str] = UNSET, + filterenablednot_eq: Union[Unset, str] = UNSET, + filterenabledin: Union[Unset, str] = UNSET, + filterenablednot_in: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, +) -> Optional[IncidentRoleList]: """List incident roles List incident roles Args: - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterenabled (bool | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filterenabledeq (str | Unset): - filterenablednot_eq (str | Unset): - filterenabledin (str | Unset): - filterenablednot_in (str | Unset): - sort (str | Unset): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterenabled (Union[Unset, bool]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filterenabledeq (Union[Unset, str]): + filterenablednot_eq (Union[Unset, str]): + filterenabledin (Union[Unset, str]): + filterenablednot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -308,58 +311,58 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterenabled: bool | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filterenabledeq: str | Unset = UNSET, - filterenablednot_eq: str | Unset = UNSET, - filterenabledin: str | Unset = UNSET, - filterenablednot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterenabled: Union[Unset, bool] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filterslugeq: Union[Unset, str] = UNSET, + filterslugnot_eq: Union[Unset, str] = UNSET, + filterslugin: Union[Unset, str] = UNSET, + filterslugnot_in: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, + filterenabledeq: Union[Unset, str] = UNSET, + filterenablednot_eq: Union[Unset, str] = UNSET, + filterenabledin: Union[Unset, str] = UNSET, + filterenablednot_in: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, ) -> Response[IncidentRoleList]: """List incident roles List incident roles Args: - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterenabled (bool | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filterenabledeq (str | Unset): - filterenablednot_eq (str | Unset): - filterenabledin (str | Unset): - filterenablednot_in (str | Unset): - sort (str | Unset): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterenabled (Union[Unset, bool]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filterenabledeq (Union[Unset, str]): + filterenablednot_eq (Union[Unset, str]): + filterenabledin (Union[Unset, str]): + filterenablednot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -403,58 +406,58 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterenabled: bool | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filterenabledeq: str | Unset = UNSET, - filterenablednot_eq: str | Unset = UNSET, - filterenabledin: str | Unset = UNSET, - filterenablednot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, -) -> IncidentRoleList | None: + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterenabled: Union[Unset, bool] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filterslugeq: Union[Unset, str] = UNSET, + filterslugnot_eq: Union[Unset, str] = UNSET, + filterslugin: Union[Unset, str] = UNSET, + filterslugnot_in: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, + filterenabledeq: Union[Unset, str] = UNSET, + filterenablednot_eq: Union[Unset, str] = UNSET, + filterenabledin: Union[Unset, str] = UNSET, + filterenablednot_in: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, +) -> Optional[IncidentRoleList]: """List incident roles List incident roles Args: - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterenabled (bool | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filterenabledeq (str | Unset): - filterenablednot_eq (str | Unset): - filterenabledin (str | Unset): - filterenablednot_in (str | Unset): - sort (str | Unset): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterenabled (Union[Unset, bool]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filterenabledeq (Union[Unset, str]): + filterenablednot_eq (Union[Unset, str]): + filterenabledin (Union[Unset, str]): + filterenablednot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/incident_roles/update_incident_role.py b/rootly_sdk/api/incident_roles/update_incident_role.py index e9c102f3..c379068e 100644 --- a/rootly_sdk/api/incident_roles/update_incident_role.py +++ b/rootly_sdk/api/incident_roles/update_incident_role.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union from uuid import UUID import httpx @@ -14,7 +13,7 @@ def _get_kwargs( - id: str | UUID, + id: Union[UUID, str], *, body: UpdateIncidentRole, ) -> dict[str, Any]: @@ -22,9 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/incident_roles/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/incident_roles/{id}", } _kwargs["json"] = body.to_dict() @@ -36,8 +33,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | IncidentRoleResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, IncidentRoleResponse]]: if response.status_code == 200: response_200 = IncidentRoleResponse.from_dict(response.json()) @@ -55,8 +52,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | IncidentRoleResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, IncidentRoleResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,17 +63,17 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdateIncidentRole, -) -> Response[ErrorsList | IncidentRoleResponse]: +) -> Response[Union[ErrorsList, IncidentRoleResponse]]: """Update an incident role Update a specific incident_role by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateIncidentRole): Raises: @@ -84,7 +81,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentRoleResponse] + Response[Union[ErrorsList, IncidentRoleResponse]] """ kwargs = _get_kwargs( @@ -100,17 +97,17 @@ def sync_detailed( def sync( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdateIncidentRole, -) -> ErrorsList | IncidentRoleResponse | None: +) -> Optional[Union[ErrorsList, IncidentRoleResponse]]: """Update an incident role Update a specific incident_role by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateIncidentRole): Raises: @@ -118,7 +115,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentRoleResponse + Union[ErrorsList, IncidentRoleResponse] """ return sync_detailed( @@ -129,17 +126,17 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdateIncidentRole, -) -> Response[ErrorsList | IncidentRoleResponse]: +) -> Response[Union[ErrorsList, IncidentRoleResponse]]: """Update an incident role Update a specific incident_role by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateIncidentRole): Raises: @@ -147,7 +144,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentRoleResponse] + Response[Union[ErrorsList, IncidentRoleResponse]] """ kwargs = _get_kwargs( @@ -161,17 +158,17 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdateIncidentRole, -) -> ErrorsList | IncidentRoleResponse | None: +) -> Optional[Union[ErrorsList, IncidentRoleResponse]]: """Update an incident role Update a specific incident_role by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateIncidentRole): Raises: @@ -179,7 +176,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentRoleResponse + Union[ErrorsList, IncidentRoleResponse] """ return ( diff --git a/rootly_sdk/api/incident_status_page_events/create_incident_status_page.py b/rootly_sdk/api/incident_status_page_events/create_incident_status_page.py index 8372e2da..859cfe78 100644 --- a/rootly_sdk/api/incident_status_page_events/create_incident_status_page.py +++ b/rootly_sdk/api/incident_status_page_events/create_incident_status_page.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/incidents/{incident_id}/status-page-events".format( - incident_id=quote(str(incident_id), safe=""), - ), + "url": f"/v1/incidents/{incident_id}/status-page-events", } _kwargs["json"] = body.to_dict() @@ -35,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | IncidentStatusPageEventResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, IncidentStatusPageEventResponse]]: if response.status_code == 201: response_201 = IncidentStatusPageEventResponse.from_dict(response.json()) @@ -59,8 +56,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | IncidentStatusPageEventResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, IncidentStatusPageEventResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -74,7 +71,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewIncidentStatusPageEvent, -) -> Response[ErrorsList | IncidentStatusPageEventResponse]: +) -> Response[Union[ErrorsList, IncidentStatusPageEventResponse]]: """Creates an incident status page event Creates a new event from provided data @@ -88,7 +85,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentStatusPageEventResponse] + Response[Union[ErrorsList, IncidentStatusPageEventResponse]] """ kwargs = _get_kwargs( @@ -108,7 +105,7 @@ def sync( *, client: AuthenticatedClient, body: NewIncidentStatusPageEvent, -) -> ErrorsList | IncidentStatusPageEventResponse | None: +) -> Optional[Union[ErrorsList, IncidentStatusPageEventResponse]]: """Creates an incident status page event Creates a new event from provided data @@ -122,7 +119,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentStatusPageEventResponse + Union[ErrorsList, IncidentStatusPageEventResponse] """ return sync_detailed( @@ -137,7 +134,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewIncidentStatusPageEvent, -) -> Response[ErrorsList | IncidentStatusPageEventResponse]: +) -> Response[Union[ErrorsList, IncidentStatusPageEventResponse]]: """Creates an incident status page event Creates a new event from provided data @@ -151,7 +148,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentStatusPageEventResponse] + Response[Union[ErrorsList, IncidentStatusPageEventResponse]] """ kwargs = _get_kwargs( @@ -169,7 +166,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewIncidentStatusPageEvent, -) -> ErrorsList | IncidentStatusPageEventResponse | None: +) -> Optional[Union[ErrorsList, IncidentStatusPageEventResponse]]: """Creates an incident status page event Creates a new event from provided data @@ -183,7 +180,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentStatusPageEventResponse + Union[ErrorsList, IncidentStatusPageEventResponse] """ return ( diff --git a/rootly_sdk/api/incident_status_page_events/delete_incident_status_page.py b/rootly_sdk/api/incident_status_page_events/delete_incident_status_page.py index 8dd1c6e7..1a1264a8 100644 --- a/rootly_sdk/api/incident_status_page_events/delete_incident_status_page.py +++ b/rootly_sdk/api/incident_status_page_events/delete_incident_status_page.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/status-page-events/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/status-page-events/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | IncidentStatusPageEventResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, IncidentStatusPageEventResponse]]: if response.status_code == 200: response_200 = IncidentStatusPageEventResponse.from_dict(response.json()) @@ -45,8 +41,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | IncidentStatusPageEventResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, IncidentStatusPageEventResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | IncidentStatusPageEventResponse]: +) -> Response[Union[ErrorsList, IncidentStatusPageEventResponse]]: """Delete an incident status page event Delete a specific incident status page event by id @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentStatusPageEventResponse] + Response[Union[ErrorsList, IncidentStatusPageEventResponse]] """ kwargs = _get_kwargs( @@ -90,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | IncidentStatusPageEventResponse | None: +) -> Optional[Union[ErrorsList, IncidentStatusPageEventResponse]]: """Delete an incident status page event Delete a specific incident status page event by id @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentStatusPageEventResponse + Union[ErrorsList, IncidentStatusPageEventResponse] """ return sync_detailed( @@ -116,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | IncidentStatusPageEventResponse]: +) -> Response[Union[ErrorsList, IncidentStatusPageEventResponse]]: """Delete an incident status page event Delete a specific incident status page event by id @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentStatusPageEventResponse] + Response[Union[ErrorsList, IncidentStatusPageEventResponse]] """ kwargs = _get_kwargs( @@ -145,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | IncidentStatusPageEventResponse | None: +) -> Optional[Union[ErrorsList, IncidentStatusPageEventResponse]]: """Delete an incident status page event Delete a specific incident status page event by id @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentStatusPageEventResponse + Union[ErrorsList, IncidentStatusPageEventResponse] """ return ( diff --git a/rootly_sdk/api/incident_status_page_events/get_incident_status_pages.py b/rootly_sdk/api/incident_status_page_events/get_incident_status_pages.py index d7df3eea..ab178a36 100644 --- a/rootly_sdk/api/incident_status_page_events/get_incident_status_pages.py +++ b/rootly_sdk/api/incident_status_page_events/get_incident_status_pages.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/status-page-events/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/status-page-events/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | IncidentStatusPageEventResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, IncidentStatusPageEventResponse]]: if response.status_code == 200: response_200 = IncidentStatusPageEventResponse.from_dict(response.json()) @@ -45,8 +41,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | IncidentStatusPageEventResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, IncidentStatusPageEventResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | IncidentStatusPageEventResponse]: +) -> Response[Union[ErrorsList, IncidentStatusPageEventResponse]]: """Retrieves an incident status page event Retrieves a specific incident_status_page_event by id @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentStatusPageEventResponse] + Response[Union[ErrorsList, IncidentStatusPageEventResponse]] """ kwargs = _get_kwargs( @@ -90,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | IncidentStatusPageEventResponse | None: +) -> Optional[Union[ErrorsList, IncidentStatusPageEventResponse]]: """Retrieves an incident status page event Retrieves a specific incident_status_page_event by id @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentStatusPageEventResponse + Union[ErrorsList, IncidentStatusPageEventResponse] """ return sync_detailed( @@ -116,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | IncidentStatusPageEventResponse]: +) -> Response[Union[ErrorsList, IncidentStatusPageEventResponse]]: """Retrieves an incident status page event Retrieves a specific incident_status_page_event by id @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentStatusPageEventResponse] + Response[Union[ErrorsList, IncidentStatusPageEventResponse]] """ kwargs = _get_kwargs( @@ -145,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | IncidentStatusPageEventResponse | None: +) -> Optional[Union[ErrorsList, IncidentStatusPageEventResponse]]: """Retrieves an incident status page event Retrieves a specific incident_status_page_event by id @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentStatusPageEventResponse + Union[ErrorsList, IncidentStatusPageEventResponse] """ return ( diff --git a/rootly_sdk/api/incident_status_page_events/list_incident_status_pages.py b/rootly_sdk/api/incident_status_page_events/list_incident_status_pages.py index e247949f..7b1881b0 100644 --- a/rootly_sdk/api/incident_status_page_events/list_incident_status_pages.py +++ b/rootly_sdk/api/incident_status_page_events/list_incident_status_pages.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -13,11 +12,10 @@ def _get_kwargs( incident_id: str, *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -30,9 +28,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/incidents/{incident_id}/status-page-events".format( - incident_id=quote(str(incident_id), safe=""), - ), + "url": f"/v1/incidents/{incident_id}/status-page-events", "params": params, } @@ -40,8 +36,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> IncidentStatusPageEventList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[IncidentStatusPageEventList]: if response.status_code == 200: response_200 = IncidentStatusPageEventList.from_dict(response.json()) @@ -54,7 +50,7 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[IncidentStatusPageEventList]: return Response( status_code=HTTPStatus(response.status_code), @@ -68,9 +64,9 @@ def sync_detailed( incident_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, ) -> Response[IncidentStatusPageEventList]: """List incident status page events @@ -78,9 +74,9 @@ def sync_detailed( Args: incident_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -108,19 +104,19 @@ def sync( incident_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, -) -> IncidentStatusPageEventList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, +) -> Optional[IncidentStatusPageEventList]: """List incident status page events List incident status page events Args: incident_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -143,9 +139,9 @@ async def asyncio_detailed( incident_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, ) -> Response[IncidentStatusPageEventList]: """List incident status page events @@ -153,9 +149,9 @@ async def asyncio_detailed( Args: incident_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -181,19 +177,19 @@ async def asyncio( incident_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, -) -> IncidentStatusPageEventList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, +) -> Optional[IncidentStatusPageEventList]: """List incident status page events List incident status page events Args: incident_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/incident_status_page_events/update_incident_status_page.py b/rootly_sdk/api/incident_status_page_events/update_incident_status_page.py index acd3ab5f..a1bb222f 100644 --- a/rootly_sdk/api/incident_status_page_events/update_incident_status_page.py +++ b/rootly_sdk/api/incident_status_page_events/update_incident_status_page.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/status-page-events/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/status-page-events/{id}", } _kwargs["json"] = body.to_dict() @@ -35,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | IncidentStatusPageEventResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, IncidentStatusPageEventResponse]]: if response.status_code == 200: response_200 = IncidentStatusPageEventResponse.from_dict(response.json()) @@ -54,8 +51,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | IncidentStatusPageEventResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, IncidentStatusPageEventResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateIncidentStatusPageEvent, -) -> Response[ErrorsList | IncidentStatusPageEventResponse]: +) -> Response[Union[ErrorsList, IncidentStatusPageEventResponse]]: """Update an incident status page event Update a specific incident status page event by id @@ -83,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentStatusPageEventResponse] + Response[Union[ErrorsList, IncidentStatusPageEventResponse]] """ kwargs = _get_kwargs( @@ -103,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateIncidentStatusPageEvent, -) -> ErrorsList | IncidentStatusPageEventResponse | None: +) -> Optional[Union[ErrorsList, IncidentStatusPageEventResponse]]: """Update an incident status page event Update a specific incident status page event by id @@ -117,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentStatusPageEventResponse + Union[ErrorsList, IncidentStatusPageEventResponse] """ return sync_detailed( @@ -132,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateIncidentStatusPageEvent, -) -> Response[ErrorsList | IncidentStatusPageEventResponse]: +) -> Response[Union[ErrorsList, IncidentStatusPageEventResponse]]: """Update an incident status page event Update a specific incident status page event by id @@ -146,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentStatusPageEventResponse] + Response[Union[ErrorsList, IncidentStatusPageEventResponse]] """ kwargs = _get_kwargs( @@ -164,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateIncidentStatusPageEvent, -) -> ErrorsList | IncidentStatusPageEventResponse | None: +) -> Optional[Union[ErrorsList, IncidentStatusPageEventResponse]]: """Update an incident status page event Update a specific incident status page event by id @@ -178,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentStatusPageEventResponse + Union[ErrorsList, IncidentStatusPageEventResponse] """ return ( diff --git a/rootly_sdk/api/incident_sub_statuses/create_incident_sub_status.py b/rootly_sdk/api/incident_sub_statuses/create_incident_sub_status.py index 005343b0..1d1611f4 100644 --- a/rootly_sdk/api/incident_sub_statuses/create_incident_sub_status.py +++ b/rootly_sdk/api/incident_sub_statuses/create_incident_sub_status.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/incidents/{incident_id}/sub_statuses".format( - incident_id=quote(str(incident_id), safe=""), - ), + "url": f"/v1/incidents/{incident_id}/sub_statuses", } _kwargs["json"] = body.to_dict() @@ -35,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | IncidentSubStatusResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, IncidentSubStatusResponse]]: if response.status_code == 201: response_201 = IncidentSubStatusResponse.from_dict(response.json()) @@ -54,8 +51,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | IncidentSubStatusResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, IncidentSubStatusResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewIncidentSubStatus, -) -> Response[ErrorsList | IncidentSubStatusResponse]: +) -> Response[Union[ErrorsList, IncidentSubStatusResponse]]: """Creates a sub-status assignment Creates a new sub-status assignment from provided data @@ -83,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentSubStatusResponse] + Response[Union[ErrorsList, IncidentSubStatusResponse]] """ kwargs = _get_kwargs( @@ -103,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: NewIncidentSubStatus, -) -> ErrorsList | IncidentSubStatusResponse | None: +) -> Optional[Union[ErrorsList, IncidentSubStatusResponse]]: """Creates a sub-status assignment Creates a new sub-status assignment from provided data @@ -117,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentSubStatusResponse + Union[ErrorsList, IncidentSubStatusResponse] """ return sync_detailed( @@ -132,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewIncidentSubStatus, -) -> Response[ErrorsList | IncidentSubStatusResponse]: +) -> Response[Union[ErrorsList, IncidentSubStatusResponse]]: """Creates a sub-status assignment Creates a new sub-status assignment from provided data @@ -146,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentSubStatusResponse] + Response[Union[ErrorsList, IncidentSubStatusResponse]] """ kwargs = _get_kwargs( @@ -164,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewIncidentSubStatus, -) -> ErrorsList | IncidentSubStatusResponse | None: +) -> Optional[Union[ErrorsList, IncidentSubStatusResponse]]: """Creates a sub-status assignment Creates a new sub-status assignment from provided data @@ -178,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentSubStatusResponse + Union[ErrorsList, IncidentSubStatusResponse] """ return ( diff --git a/rootly_sdk/api/incident_sub_statuses/delete_incident_sub_status.py b/rootly_sdk/api/incident_sub_statuses/delete_incident_sub_status.py index d0ede7b9..bd3ab981 100644 --- a/rootly_sdk/api/incident_sub_statuses/delete_incident_sub_status.py +++ b/rootly_sdk/api/incident_sub_statuses/delete_incident_sub_status.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/incident_sub_statuses/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/incident_sub_statuses/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | IncidentSubStatusResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, IncidentSubStatusResponse]]: if response.status_code == 200: response_200 = IncidentSubStatusResponse.from_dict(response.json()) @@ -45,8 +41,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | IncidentSubStatusResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, IncidentSubStatusResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | IncidentSubStatusResponse]: +) -> Response[Union[ErrorsList, IncidentSubStatusResponse]]: """Delete an incident_sub_status Delete a specific incident_sub_status by id @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentSubStatusResponse] + Response[Union[ErrorsList, IncidentSubStatusResponse]] """ kwargs = _get_kwargs( @@ -90,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | IncidentSubStatusResponse | None: +) -> Optional[Union[ErrorsList, IncidentSubStatusResponse]]: """Delete an incident_sub_status Delete a specific incident_sub_status by id @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentSubStatusResponse + Union[ErrorsList, IncidentSubStatusResponse] """ return sync_detailed( @@ -116,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | IncidentSubStatusResponse]: +) -> Response[Union[ErrorsList, IncidentSubStatusResponse]]: """Delete an incident_sub_status Delete a specific incident_sub_status by id @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentSubStatusResponse] + Response[Union[ErrorsList, IncidentSubStatusResponse]] """ kwargs = _get_kwargs( @@ -145,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | IncidentSubStatusResponse | None: +) -> Optional[Union[ErrorsList, IncidentSubStatusResponse]]: """Delete an incident_sub_status Delete a specific incident_sub_status by id @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentSubStatusResponse + Union[ErrorsList, IncidentSubStatusResponse] """ return ( diff --git a/rootly_sdk/api/incident_sub_statuses/get_incident_sub_status.py b/rootly_sdk/api/incident_sub_statuses/get_incident_sub_status.py index 8c79545a..2d81f56e 100644 --- a/rootly_sdk/api/incident_sub_statuses/get_incident_sub_status.py +++ b/rootly_sdk/api/incident_sub_statuses/get_incident_sub_status.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,12 +13,11 @@ def _get_kwargs( id: str, *, - include: GetIncidentSubStatusInclude | Unset = UNSET, + include: Union[Unset, GetIncidentSubStatusInclude] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} - json_include: str | Unset = UNSET + json_include: Union[Unset, str] = UNSET if not isinstance(include, Unset): json_include = include @@ -29,9 +27,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/incident_sub_statuses/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/incident_sub_statuses/{id}", "params": params, } @@ -39,8 +35,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> IncidentSubStatusResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[IncidentSubStatusResponse]: if response.status_code == 200: response_200 = IncidentSubStatusResponse.from_dict(response.json()) @@ -53,7 +49,7 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[IncidentSubStatusResponse]: return Response( status_code=HTTPStatus(response.status_code), @@ -67,7 +63,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, - include: GetIncidentSubStatusInclude | Unset = UNSET, + include: Union[Unset, GetIncidentSubStatusInclude] = UNSET, ) -> Response[IncidentSubStatusResponse]: """Retrieves incident_sub_status @@ -75,7 +71,7 @@ def sync_detailed( Args: id (str): - include (GetIncidentSubStatusInclude | Unset): + include (Union[Unset, GetIncidentSubStatusInclude]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -101,15 +97,15 @@ def sync( id: str, *, client: AuthenticatedClient, - include: GetIncidentSubStatusInclude | Unset = UNSET, -) -> IncidentSubStatusResponse | None: + include: Union[Unset, GetIncidentSubStatusInclude] = UNSET, +) -> Optional[IncidentSubStatusResponse]: """Retrieves incident_sub_status Retrieves a specific incident_sub_status by id Args: id (str): - include (GetIncidentSubStatusInclude | Unset): + include (Union[Unset, GetIncidentSubStatusInclude]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -130,7 +126,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, - include: GetIncidentSubStatusInclude | Unset = UNSET, + include: Union[Unset, GetIncidentSubStatusInclude] = UNSET, ) -> Response[IncidentSubStatusResponse]: """Retrieves incident_sub_status @@ -138,7 +134,7 @@ async def asyncio_detailed( Args: id (str): - include (GetIncidentSubStatusInclude | Unset): + include (Union[Unset, GetIncidentSubStatusInclude]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -162,15 +158,15 @@ async def asyncio( id: str, *, client: AuthenticatedClient, - include: GetIncidentSubStatusInclude | Unset = UNSET, -) -> IncidentSubStatusResponse | None: + include: Union[Unset, GetIncidentSubStatusInclude] = UNSET, +) -> Optional[IncidentSubStatusResponse]: """Retrieves incident_sub_status Retrieves a specific incident_sub_status by id Args: id (str): - include (GetIncidentSubStatusInclude | Unset): + include (Union[Unset, GetIncidentSubStatusInclude]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/incident_sub_statuses/list_incident_sub_statuses.py b/rootly_sdk/api/incident_sub_statuses/list_incident_sub_statuses.py index 9baf07e2..22322f17 100644 --- a/rootly_sdk/api/incident_sub_statuses/list_incident_sub_statuses.py +++ b/rootly_sdk/api/incident_sub_statuses/list_incident_sub_statuses.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -17,26 +16,25 @@ def _get_kwargs( incident_id: str, *, - include: ListIncidentSubStatusesInclude | Unset = UNSET, - sort: ListIncidentSubStatusesSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersub_status_id: str | Unset = UNSET, - filterassigned_atgt: str | Unset = UNSET, - filterassigned_atgte: str | Unset = UNSET, - filterassigned_atlt: str | Unset = UNSET, - filterassigned_atlte: str | Unset = UNSET, + include: Union[Unset, ListIncidentSubStatusesInclude] = UNSET, + sort: Union[Unset, ListIncidentSubStatusesSort] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersub_status_id: Union[Unset, str] = UNSET, + filterassigned_atgt: Union[Unset, str] = UNSET, + filterassigned_atgte: Union[Unset, str] = UNSET, + filterassigned_atlt: Union[Unset, str] = UNSET, + filterassigned_atlte: Union[Unset, str] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} - json_include: str | Unset = UNSET + json_include: Union[Unset, str] = UNSET if not isinstance(include, Unset): json_include = include params["include"] = json_include - json_sort: str | Unset = UNSET + json_sort: Union[Unset, str] = UNSET if not isinstance(sort, Unset): json_sort = sort @@ -60,16 +58,16 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/incidents/{incident_id}/sub_statuses".format( - incident_id=quote(str(incident_id), safe=""), - ), + "url": f"/v1/incidents/{incident_id}/sub_statuses", "params": params, } return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> IncidentSubStatusList | None: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[IncidentSubStatusList]: if response.status_code == 200: response_200 = IncidentSubStatusList.from_dict(response.json()) @@ -82,7 +80,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[IncidentSubStatusList]: return Response( status_code=HTTPStatus(response.status_code), @@ -96,15 +94,15 @@ def sync_detailed( incident_id: str, *, client: AuthenticatedClient, - include: ListIncidentSubStatusesInclude | Unset = UNSET, - sort: ListIncidentSubStatusesSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersub_status_id: str | Unset = UNSET, - filterassigned_atgt: str | Unset = UNSET, - filterassigned_atgte: str | Unset = UNSET, - filterassigned_atlt: str | Unset = UNSET, - filterassigned_atlte: str | Unset = UNSET, + include: Union[Unset, ListIncidentSubStatusesInclude] = UNSET, + sort: Union[Unset, ListIncidentSubStatusesSort] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersub_status_id: Union[Unset, str] = UNSET, + filterassigned_atgt: Union[Unset, str] = UNSET, + filterassigned_atgte: Union[Unset, str] = UNSET, + filterassigned_atlt: Union[Unset, str] = UNSET, + filterassigned_atlte: Union[Unset, str] = UNSET, ) -> Response[IncidentSubStatusList]: """List incident_sub_statuses @@ -112,15 +110,15 @@ def sync_detailed( Args: incident_id (str): - include (ListIncidentSubStatusesInclude | Unset): - sort (ListIncidentSubStatusesSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersub_status_id (str | Unset): - filterassigned_atgt (str | Unset): - filterassigned_atgte (str | Unset): - filterassigned_atlt (str | Unset): - filterassigned_atlte (str | Unset): + include (Union[Unset, ListIncidentSubStatusesInclude]): + sort (Union[Unset, ListIncidentSubStatusesSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersub_status_id (Union[Unset, str]): + filterassigned_atgt (Union[Unset, str]): + filterassigned_atgte (Union[Unset, str]): + filterassigned_atlt (Union[Unset, str]): + filterassigned_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -154,31 +152,31 @@ def sync( incident_id: str, *, client: AuthenticatedClient, - include: ListIncidentSubStatusesInclude | Unset = UNSET, - sort: ListIncidentSubStatusesSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersub_status_id: str | Unset = UNSET, - filterassigned_atgt: str | Unset = UNSET, - filterassigned_atgte: str | Unset = UNSET, - filterassigned_atlt: str | Unset = UNSET, - filterassigned_atlte: str | Unset = UNSET, -) -> IncidentSubStatusList | None: + include: Union[Unset, ListIncidentSubStatusesInclude] = UNSET, + sort: Union[Unset, ListIncidentSubStatusesSort] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersub_status_id: Union[Unset, str] = UNSET, + filterassigned_atgt: Union[Unset, str] = UNSET, + filterassigned_atgte: Union[Unset, str] = UNSET, + filterassigned_atlt: Union[Unset, str] = UNSET, + filterassigned_atlte: Union[Unset, str] = UNSET, +) -> Optional[IncidentSubStatusList]: """List incident_sub_statuses List incident_sub_statuses Args: incident_id (str): - include (ListIncidentSubStatusesInclude | Unset): - sort (ListIncidentSubStatusesSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersub_status_id (str | Unset): - filterassigned_atgt (str | Unset): - filterassigned_atgte (str | Unset): - filterassigned_atlt (str | Unset): - filterassigned_atlte (str | Unset): + include (Union[Unset, ListIncidentSubStatusesInclude]): + sort (Union[Unset, ListIncidentSubStatusesSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersub_status_id (Union[Unset, str]): + filterassigned_atgt (Union[Unset, str]): + filterassigned_atgte (Union[Unset, str]): + filterassigned_atlt (Union[Unset, str]): + filterassigned_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -207,15 +205,15 @@ async def asyncio_detailed( incident_id: str, *, client: AuthenticatedClient, - include: ListIncidentSubStatusesInclude | Unset = UNSET, - sort: ListIncidentSubStatusesSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersub_status_id: str | Unset = UNSET, - filterassigned_atgt: str | Unset = UNSET, - filterassigned_atgte: str | Unset = UNSET, - filterassigned_atlt: str | Unset = UNSET, - filterassigned_atlte: str | Unset = UNSET, + include: Union[Unset, ListIncidentSubStatusesInclude] = UNSET, + sort: Union[Unset, ListIncidentSubStatusesSort] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersub_status_id: Union[Unset, str] = UNSET, + filterassigned_atgt: Union[Unset, str] = UNSET, + filterassigned_atgte: Union[Unset, str] = UNSET, + filterassigned_atlt: Union[Unset, str] = UNSET, + filterassigned_atlte: Union[Unset, str] = UNSET, ) -> Response[IncidentSubStatusList]: """List incident_sub_statuses @@ -223,15 +221,15 @@ async def asyncio_detailed( Args: incident_id (str): - include (ListIncidentSubStatusesInclude | Unset): - sort (ListIncidentSubStatusesSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersub_status_id (str | Unset): - filterassigned_atgt (str | Unset): - filterassigned_atgte (str | Unset): - filterassigned_atlt (str | Unset): - filterassigned_atlte (str | Unset): + include (Union[Unset, ListIncidentSubStatusesInclude]): + sort (Union[Unset, ListIncidentSubStatusesSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersub_status_id (Union[Unset, str]): + filterassigned_atgt (Union[Unset, str]): + filterassigned_atgte (Union[Unset, str]): + filterassigned_atlt (Union[Unset, str]): + filterassigned_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -263,31 +261,31 @@ async def asyncio( incident_id: str, *, client: AuthenticatedClient, - include: ListIncidentSubStatusesInclude | Unset = UNSET, - sort: ListIncidentSubStatusesSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersub_status_id: str | Unset = UNSET, - filterassigned_atgt: str | Unset = UNSET, - filterassigned_atgte: str | Unset = UNSET, - filterassigned_atlt: str | Unset = UNSET, - filterassigned_atlte: str | Unset = UNSET, -) -> IncidentSubStatusList | None: + include: Union[Unset, ListIncidentSubStatusesInclude] = UNSET, + sort: Union[Unset, ListIncidentSubStatusesSort] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersub_status_id: Union[Unset, str] = UNSET, + filterassigned_atgt: Union[Unset, str] = UNSET, + filterassigned_atgte: Union[Unset, str] = UNSET, + filterassigned_atlt: Union[Unset, str] = UNSET, + filterassigned_atlte: Union[Unset, str] = UNSET, +) -> Optional[IncidentSubStatusList]: """List incident_sub_statuses List incident_sub_statuses Args: incident_id (str): - include (ListIncidentSubStatusesInclude | Unset): - sort (ListIncidentSubStatusesSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersub_status_id (str | Unset): - filterassigned_atgt (str | Unset): - filterassigned_atgte (str | Unset): - filterassigned_atlt (str | Unset): - filterassigned_atlte (str | Unset): + include (Union[Unset, ListIncidentSubStatusesInclude]): + sort (Union[Unset, ListIncidentSubStatusesSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersub_status_id (Union[Unset, str]): + filterassigned_atgt (Union[Unset, str]): + filterassigned_atgte (Union[Unset, str]): + filterassigned_atlt (Union[Unset, str]): + filterassigned_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/incident_sub_statuses/update_incident_sub_status.py b/rootly_sdk/api/incident_sub_statuses/update_incident_sub_status.py index a2e84f7f..e9c29d41 100644 --- a/rootly_sdk/api/incident_sub_statuses/update_incident_sub_status.py +++ b/rootly_sdk/api/incident_sub_statuses/update_incident_sub_status.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -20,9 +19,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/incident_sub_statuses/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/incident_sub_statuses/{id}", } _kwargs["json"] = body.to_dict() @@ -34,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> IncidentSubStatusResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[IncidentSubStatusResponse]: if response.status_code == 200: response_200 = IncidentSubStatusResponse.from_dict(response.json()) @@ -48,7 +45,7 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[IncidentSubStatusResponse]: return Response( status_code=HTTPStatus(response.status_code), @@ -97,7 +94,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateIncidentSubStatus, -) -> IncidentSubStatusResponse | None: +) -> Optional[IncidentSubStatusResponse]: """Update incident_sub_status Update a specific incident_sub_status by id @@ -158,7 +155,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateIncidentSubStatus, -) -> IncidentSubStatusResponse | None: +) -> Optional[IncidentSubStatusResponse]: """Update incident_sub_status Update a specific incident_sub_status by id diff --git a/rootly_sdk/api/incident_types/create_incident_type.py b/rootly_sdk/api/incident_types/create_incident_type.py index d54679eb..12c734ce 100644 --- a/rootly_sdk/api/incident_types/create_incident_type.py +++ b/rootly_sdk/api/incident_types/create_incident_type.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | IncidentTypeResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, IncidentTypeResponse]]: if response.status_code == 201: response_201 = IncidentTypeResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | IncidentTypeResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, IncidentTypeResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +69,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewIncidentType, -) -> Response[ErrorsList | IncidentTypeResponse]: +) -> Response[Union[ErrorsList, IncidentTypeResponse]]: """Creates an incident type Creates a new incident_type from provided data @@ -82,7 +82,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentTypeResponse] + Response[Union[ErrorsList, IncidentTypeResponse]] """ kwargs = _get_kwargs( @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: NewIncidentType, -) -> ErrorsList | IncidentTypeResponse | None: +) -> Optional[Union[ErrorsList, IncidentTypeResponse]]: """Creates an incident type Creates a new incident_type from provided data @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentTypeResponse + Union[ErrorsList, IncidentTypeResponse] """ return sync_detailed( @@ -126,7 +126,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewIncidentType, -) -> Response[ErrorsList | IncidentTypeResponse]: +) -> Response[Union[ErrorsList, IncidentTypeResponse]]: """Creates an incident type Creates a new incident_type from provided data @@ -139,7 +139,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentTypeResponse] + Response[Union[ErrorsList, IncidentTypeResponse]] """ kwargs = _get_kwargs( @@ -155,7 +155,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewIncidentType, -) -> ErrorsList | IncidentTypeResponse | None: +) -> Optional[Union[ErrorsList, IncidentTypeResponse]]: """Creates an incident type Creates a new incident_type from provided data @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentTypeResponse + Union[ErrorsList, IncidentTypeResponse] """ return ( diff --git a/rootly_sdk/api/incident_types/create_incident_type_catalog_property.py b/rootly_sdk/api/incident_types/create_incident_type_catalog_property.py index 7a8b50ab..f2378b02 100644 --- a/rootly_sdk/api/incident_types/create_incident_type_catalog_property.py +++ b/rootly_sdk/api/incident_types/create_incident_type_catalog_property.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> CatalogPropertyResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[CatalogPropertyResponse, ErrorsList]]: if response.status_code == 201: response_201 = CatalogPropertyResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[CatalogPropertyResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[CatalogPropertyResponse, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +69,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewCatalogProperty, -) -> Response[CatalogPropertyResponse | ErrorsList]: +) -> Response[Union[CatalogPropertyResponse, ErrorsList]]: """Creates a Catalog Property Creates a new Catalog Property from provided data @@ -82,7 +82,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CatalogPropertyResponse | ErrorsList] + Response[Union[CatalogPropertyResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: NewCatalogProperty, -) -> CatalogPropertyResponse | ErrorsList | None: +) -> Optional[Union[CatalogPropertyResponse, ErrorsList]]: """Creates a Catalog Property Creates a new Catalog Property from provided data @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CatalogPropertyResponse | ErrorsList + Union[CatalogPropertyResponse, ErrorsList] """ return sync_detailed( @@ -126,7 +126,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewCatalogProperty, -) -> Response[CatalogPropertyResponse | ErrorsList]: +) -> Response[Union[CatalogPropertyResponse, ErrorsList]]: """Creates a Catalog Property Creates a new Catalog Property from provided data @@ -139,7 +139,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CatalogPropertyResponse | ErrorsList] + Response[Union[CatalogPropertyResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -155,7 +155,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewCatalogProperty, -) -> CatalogPropertyResponse | ErrorsList | None: +) -> Optional[Union[CatalogPropertyResponse, ErrorsList]]: """Creates a Catalog Property Creates a new Catalog Property from provided data @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CatalogPropertyResponse | ErrorsList + Union[CatalogPropertyResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/incident_types/delete_incident_type.py b/rootly_sdk/api/incident_types/delete_incident_type.py index c6f0addd..96a4038e 100644 --- a/rootly_sdk/api/incident_types/delete_incident_type.py +++ b/rootly_sdk/api/incident_types/delete_incident_type.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union from uuid import UUID import httpx @@ -13,22 +12,19 @@ def _get_kwargs( - id: str | UUID, + id: Union[UUID, str], ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/incident_types/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/incident_types/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | IncidentTypeResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, IncidentTypeResponse]]: if response.status_code == 200: response_200 = IncidentTypeResponse.from_dict(response.json()) @@ -46,8 +42,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | IncidentTypeResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, IncidentTypeResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -57,23 +53,23 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Response[ErrorsList | IncidentTypeResponse]: +) -> Response[Union[ErrorsList, IncidentTypeResponse]]: """Delete an incident type Delete a specific incident_type by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentTypeResponse] + Response[Union[ErrorsList, IncidentTypeResponse]] """ kwargs = _get_kwargs( @@ -88,23 +84,23 @@ def sync_detailed( def sync( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> ErrorsList | IncidentTypeResponse | None: +) -> Optional[Union[ErrorsList, IncidentTypeResponse]]: """Delete an incident type Delete a specific incident_type by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentTypeResponse + Union[ErrorsList, IncidentTypeResponse] """ return sync_detailed( @@ -114,23 +110,23 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Response[ErrorsList | IncidentTypeResponse]: +) -> Response[Union[ErrorsList, IncidentTypeResponse]]: """Delete an incident type Delete a specific incident_type by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentTypeResponse] + Response[Union[ErrorsList, IncidentTypeResponse]] """ kwargs = _get_kwargs( @@ -143,23 +139,23 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> ErrorsList | IncidentTypeResponse | None: +) -> Optional[Union[ErrorsList, IncidentTypeResponse]]: """Delete an incident type Delete a specific incident_type by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentTypeResponse + Union[ErrorsList, IncidentTypeResponse] """ return ( diff --git a/rootly_sdk/api/incident_types/get_incident_type.py b/rootly_sdk/api/incident_types/get_incident_type.py index 598b47e2..765b2668 100644 --- a/rootly_sdk/api/incident_types/get_incident_type.py +++ b/rootly_sdk/api/incident_types/get_incident_type.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union from uuid import UUID import httpx @@ -13,22 +12,19 @@ def _get_kwargs( - id: str | UUID, + id: Union[UUID, str], ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/incident_types/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/incident_types/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | IncidentTypeResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, IncidentTypeResponse]]: if response.status_code == 200: response_200 = IncidentTypeResponse.from_dict(response.json()) @@ -46,8 +42,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | IncidentTypeResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, IncidentTypeResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -57,23 +53,23 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Response[ErrorsList | IncidentTypeResponse]: +) -> Response[Union[ErrorsList, IncidentTypeResponse]]: """Retrieves an incident type Retrieves a specific incident_type by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentTypeResponse] + Response[Union[ErrorsList, IncidentTypeResponse]] """ kwargs = _get_kwargs( @@ -88,23 +84,23 @@ def sync_detailed( def sync( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> ErrorsList | IncidentTypeResponse | None: +) -> Optional[Union[ErrorsList, IncidentTypeResponse]]: """Retrieves an incident type Retrieves a specific incident_type by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentTypeResponse + Union[ErrorsList, IncidentTypeResponse] """ return sync_detailed( @@ -114,23 +110,23 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Response[ErrorsList | IncidentTypeResponse]: +) -> Response[Union[ErrorsList, IncidentTypeResponse]]: """Retrieves an incident type Retrieves a specific incident_type by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentTypeResponse] + Response[Union[ErrorsList, IncidentTypeResponse]] """ kwargs = _get_kwargs( @@ -143,23 +139,23 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> ErrorsList | IncidentTypeResponse | None: +) -> Optional[Union[ErrorsList, IncidentTypeResponse]]: """Retrieves an incident type Retrieves a specific incident_type by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentTypeResponse + Union[ErrorsList, IncidentTypeResponse] """ return ( diff --git a/rootly_sdk/api/incident_types/list_incident_type_catalog_properties.py b/rootly_sdk/api/incident_types/list_incident_type_catalog_properties.py index 322d4536..b0dd576c 100644 --- a/rootly_sdk/api/incident_types/list_incident_type_catalog_properties.py +++ b/rootly_sdk/api/incident_types/list_incident_type_catalog_properties.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -17,28 +17,27 @@ def _get_kwargs( *, - include: ListIncidentTypeCatalogPropertiesInclude | Unset = UNSET, - sort: ListIncidentTypeCatalogPropertiesSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Union[Unset, ListIncidentTypeCatalogPropertiesInclude] = UNSET, + sort: Union[Unset, ListIncidentTypeCatalogPropertiesSort] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterkind: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} - json_include: str | Unset = UNSET + json_include: Union[Unset, str] = UNSET if not isinstance(include, Unset): json_include = include params["include"] = json_include - json_sort: str | Unset = UNSET + json_sort: Union[Unset, str] = UNSET if not isinstance(sort, Unset): json_sort = sort @@ -73,7 +72,9 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> CatalogPropertyList | None: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[CatalogPropertyList]: if response.status_code == 200: response_200 = CatalogPropertyList.from_dict(response.json()) @@ -85,7 +86,9 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[CatalogPropertyList]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[CatalogPropertyList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -97,34 +100,34 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - include: ListIncidentTypeCatalogPropertiesInclude | Unset = UNSET, - sort: ListIncidentTypeCatalogPropertiesSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Union[Unset, ListIncidentTypeCatalogPropertiesInclude] = UNSET, + sort: Union[Unset, ListIncidentTypeCatalogPropertiesSort] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterkind: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, ) -> Response[CatalogPropertyList]: """List Catalog Properties List IncidentType Catalog Properties Args: - include (ListIncidentTypeCatalogPropertiesInclude | Unset): - sort (ListIncidentTypeCatalogPropertiesSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterkind (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, ListIncidentTypeCatalogPropertiesInclude]): + sort (Union[Unset, ListIncidentTypeCatalogPropertiesSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterkind (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -158,34 +161,34 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: ListIncidentTypeCatalogPropertiesInclude | Unset = UNSET, - sort: ListIncidentTypeCatalogPropertiesSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, -) -> CatalogPropertyList | None: + include: Union[Unset, ListIncidentTypeCatalogPropertiesInclude] = UNSET, + sort: Union[Unset, ListIncidentTypeCatalogPropertiesSort] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterkind: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, +) -> Optional[CatalogPropertyList]: """List Catalog Properties List IncidentType Catalog Properties Args: - include (ListIncidentTypeCatalogPropertiesInclude | Unset): - sort (ListIncidentTypeCatalogPropertiesSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterkind (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, ListIncidentTypeCatalogPropertiesInclude]): + sort (Union[Unset, ListIncidentTypeCatalogPropertiesSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterkind (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -214,34 +217,34 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: ListIncidentTypeCatalogPropertiesInclude | Unset = UNSET, - sort: ListIncidentTypeCatalogPropertiesSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Union[Unset, ListIncidentTypeCatalogPropertiesInclude] = UNSET, + sort: Union[Unset, ListIncidentTypeCatalogPropertiesSort] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterkind: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, ) -> Response[CatalogPropertyList]: """List Catalog Properties List IncidentType Catalog Properties Args: - include (ListIncidentTypeCatalogPropertiesInclude | Unset): - sort (ListIncidentTypeCatalogPropertiesSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterkind (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, ListIncidentTypeCatalogPropertiesInclude]): + sort (Union[Unset, ListIncidentTypeCatalogPropertiesSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterkind (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -273,34 +276,34 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: ListIncidentTypeCatalogPropertiesInclude | Unset = UNSET, - sort: ListIncidentTypeCatalogPropertiesSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, -) -> CatalogPropertyList | None: + include: Union[Unset, ListIncidentTypeCatalogPropertiesInclude] = UNSET, + sort: Union[Unset, ListIncidentTypeCatalogPropertiesSort] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterkind: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, +) -> Optional[CatalogPropertyList]: """List Catalog Properties List IncidentType Catalog Properties Args: - include (ListIncidentTypeCatalogPropertiesInclude | Unset): - sort (ListIncidentTypeCatalogPropertiesSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterkind (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, ListIncidentTypeCatalogPropertiesInclude]): + sort (Union[Unset, ListIncidentTypeCatalogPropertiesSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterkind (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/incident_types/list_incident_types.py b/rootly_sdk/api/incident_types/list_incident_types.py index ba2eeaf3..91e31896 100644 --- a/rootly_sdk/api/incident_types/list_incident_types.py +++ b/rootly_sdk/api/incident_types/list_incident_types.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -11,31 +11,30 @@ def _get_kwargs( *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercolor: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filtercoloreq: str | Unset = UNSET, - filtercolornot_eq: str | Unset = UNSET, - filtercolorin: str | Unset = UNSET, - filtercolornot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filtercolor: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filterslugeq: Union[Unset, str] = UNSET, + filterslugnot_eq: Union[Unset, str] = UNSET, + filterslugin: Union[Unset, str] = UNSET, + filterslugnot_in: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, + filtercoloreq: Union[Unset, str] = UNSET, + filtercolornot_eq: Union[Unset, str] = UNSET, + filtercolorin: Union[Unset, str] = UNSET, + filtercolornot_in: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -95,7 +94,9 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> IncidentTypeList | None: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[IncidentTypeList]: if response.status_code == 200: response_200 = IncidentTypeList.from_dict(response.json()) @@ -107,7 +108,9 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[IncidentTypeList]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[IncidentTypeList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -119,58 +122,58 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercolor: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filtercoloreq: str | Unset = UNSET, - filtercolornot_eq: str | Unset = UNSET, - filtercolorin: str | Unset = UNSET, - filtercolornot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filtercolor: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filterslugeq: Union[Unset, str] = UNSET, + filterslugnot_eq: Union[Unset, str] = UNSET, + filterslugin: Union[Unset, str] = UNSET, + filterslugnot_in: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, + filtercoloreq: Union[Unset, str] = UNSET, + filtercolornot_eq: Union[Unset, str] = UNSET, + filtercolorin: Union[Unset, str] = UNSET, + filtercolornot_in: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, ) -> Response[IncidentTypeList]: """List incident types List incident types Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filtercolor (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filtercoloreq (str | Unset): - filtercolornot_eq (str | Unset): - filtercolorin (str | Unset): - filtercolornot_in (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filtercolor (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filtercoloreq (Union[Unset, str]): + filtercolornot_eq (Union[Unset, str]): + filtercolorin (Union[Unset, str]): + filtercolornot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -216,58 +219,58 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercolor: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filtercoloreq: str | Unset = UNSET, - filtercolornot_eq: str | Unset = UNSET, - filtercolorin: str | Unset = UNSET, - filtercolornot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, -) -> IncidentTypeList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filtercolor: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filterslugeq: Union[Unset, str] = UNSET, + filterslugnot_eq: Union[Unset, str] = UNSET, + filterslugin: Union[Unset, str] = UNSET, + filterslugnot_in: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, + filtercoloreq: Union[Unset, str] = UNSET, + filtercolornot_eq: Union[Unset, str] = UNSET, + filtercolorin: Union[Unset, str] = UNSET, + filtercolornot_in: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, +) -> Optional[IncidentTypeList]: """List incident types List incident types Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filtercolor (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filtercoloreq (str | Unset): - filtercolornot_eq (str | Unset): - filtercolorin (str | Unset): - filtercolornot_in (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filtercolor (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filtercoloreq (Union[Unset, str]): + filtercolornot_eq (Union[Unset, str]): + filtercolorin (Union[Unset, str]): + filtercolornot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -308,58 +311,58 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercolor: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filtercoloreq: str | Unset = UNSET, - filtercolornot_eq: str | Unset = UNSET, - filtercolorin: str | Unset = UNSET, - filtercolornot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filtercolor: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filterslugeq: Union[Unset, str] = UNSET, + filterslugnot_eq: Union[Unset, str] = UNSET, + filterslugin: Union[Unset, str] = UNSET, + filterslugnot_in: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, + filtercoloreq: Union[Unset, str] = UNSET, + filtercolornot_eq: Union[Unset, str] = UNSET, + filtercolorin: Union[Unset, str] = UNSET, + filtercolornot_in: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, ) -> Response[IncidentTypeList]: """List incident types List incident types Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filtercolor (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filtercoloreq (str | Unset): - filtercolornot_eq (str | Unset): - filtercolorin (str | Unset): - filtercolornot_in (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filtercolor (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filtercoloreq (Union[Unset, str]): + filtercolornot_eq (Union[Unset, str]): + filtercolorin (Union[Unset, str]): + filtercolornot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -403,58 +406,58 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercolor: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filtercoloreq: str | Unset = UNSET, - filtercolornot_eq: str | Unset = UNSET, - filtercolorin: str | Unset = UNSET, - filtercolornot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, -) -> IncidentTypeList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filtercolor: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filterslugeq: Union[Unset, str] = UNSET, + filterslugnot_eq: Union[Unset, str] = UNSET, + filterslugin: Union[Unset, str] = UNSET, + filterslugnot_in: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, + filtercoloreq: Union[Unset, str] = UNSET, + filtercolornot_eq: Union[Unset, str] = UNSET, + filtercolorin: Union[Unset, str] = UNSET, + filtercolornot_in: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, +) -> Optional[IncidentTypeList]: """List incident types List incident types Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filtercolor (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filtercoloreq (str | Unset): - filtercolornot_eq (str | Unset): - filtercolorin (str | Unset): - filtercolornot_in (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filtercolor (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filtercoloreq (Union[Unset, str]): + filtercolornot_eq (Union[Unset, str]): + filtercolorin (Union[Unset, str]): + filtercolornot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/incident_types/update_incident_type.py b/rootly_sdk/api/incident_types/update_incident_type.py index 3df712c1..76a0aa5e 100644 --- a/rootly_sdk/api/incident_types/update_incident_type.py +++ b/rootly_sdk/api/incident_types/update_incident_type.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union from uuid import UUID import httpx @@ -14,7 +13,7 @@ def _get_kwargs( - id: str | UUID, + id: Union[UUID, str], *, body: UpdateIncidentType, ) -> dict[str, Any]: @@ -22,9 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/incident_types/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/incident_types/{id}", } _kwargs["json"] = body.to_dict() @@ -36,8 +33,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | IncidentTypeResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, IncidentTypeResponse]]: if response.status_code == 200: response_200 = IncidentTypeResponse.from_dict(response.json()) @@ -55,8 +52,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | IncidentTypeResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, IncidentTypeResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,17 +63,17 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdateIncidentType, -) -> Response[ErrorsList | IncidentTypeResponse]: +) -> Response[Union[ErrorsList, IncidentTypeResponse]]: """Update an incident type Update a specific incident_type by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateIncidentType): Raises: @@ -84,7 +81,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentTypeResponse] + Response[Union[ErrorsList, IncidentTypeResponse]] """ kwargs = _get_kwargs( @@ -100,17 +97,17 @@ def sync_detailed( def sync( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdateIncidentType, -) -> ErrorsList | IncidentTypeResponse | None: +) -> Optional[Union[ErrorsList, IncidentTypeResponse]]: """Update an incident type Update a specific incident_type by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateIncidentType): Raises: @@ -118,7 +115,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentTypeResponse + Union[ErrorsList, IncidentTypeResponse] """ return sync_detailed( @@ -129,17 +126,17 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdateIncidentType, -) -> Response[ErrorsList | IncidentTypeResponse]: +) -> Response[Union[ErrorsList, IncidentTypeResponse]]: """Update an incident type Update a specific incident_type by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateIncidentType): Raises: @@ -147,7 +144,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentTypeResponse] + Response[Union[ErrorsList, IncidentTypeResponse]] """ kwargs = _get_kwargs( @@ -161,17 +158,17 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdateIncidentType, -) -> ErrorsList | IncidentTypeResponse | None: +) -> Optional[Union[ErrorsList, IncidentTypeResponse]]: """Update an incident type Update a specific incident_type by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateIncidentType): Raises: @@ -179,7 +176,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentTypeResponse + Union[ErrorsList, IncidentTypeResponse] """ return ( diff --git a/rootly_sdk/api/incidents/add_subscribers_to_incident.py b/rootly_sdk/api/incidents/add_subscribers_to_incident.py index d652ab8a..3d163aa7 100644 --- a/rootly_sdk/api/incidents/add_subscribers_to_incident.py +++ b/rootly_sdk/api/incidents/add_subscribers_to_incident.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union from uuid import UUID import httpx @@ -14,7 +13,7 @@ def _get_kwargs( - id: str | UUID, + id: Union[UUID, str], *, body: AddSubscribers, ) -> dict[str, Any]: @@ -22,9 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/incidents/{id}/add_subscribers".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/incidents/{id}/add_subscribers", } _kwargs["json"] = body.to_dict() @@ -36,8 +33,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | IncidentResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, IncidentResponse]]: if response.status_code == 200: response_200 = IncidentResponse.from_dict(response.json()) @@ -55,8 +52,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | IncidentResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, IncidentResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,17 +63,17 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: AddSubscribers, -) -> Response[ErrorsList | IncidentResponse]: +) -> Response[Union[ErrorsList, IncidentResponse]]: """Add subscribers to incident Add subscribers to incident Args: - id (str | UUID): + id (Union[UUID, str]): body (AddSubscribers): Raises: @@ -84,7 +81,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentResponse] + Response[Union[ErrorsList, IncidentResponse]] """ kwargs = _get_kwargs( @@ -100,17 +97,17 @@ def sync_detailed( def sync( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: AddSubscribers, -) -> ErrorsList | IncidentResponse | None: +) -> Optional[Union[ErrorsList, IncidentResponse]]: """Add subscribers to incident Add subscribers to incident Args: - id (str | UUID): + id (Union[UUID, str]): body (AddSubscribers): Raises: @@ -118,7 +115,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentResponse + Union[ErrorsList, IncidentResponse] """ return sync_detailed( @@ -129,17 +126,17 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: AddSubscribers, -) -> Response[ErrorsList | IncidentResponse]: +) -> Response[Union[ErrorsList, IncidentResponse]]: """Add subscribers to incident Add subscribers to incident Args: - id (str | UUID): + id (Union[UUID, str]): body (AddSubscribers): Raises: @@ -147,7 +144,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentResponse] + Response[Union[ErrorsList, IncidentResponse]] """ kwargs = _get_kwargs( @@ -161,17 +158,17 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: AddSubscribers, -) -> ErrorsList | IncidentResponse | None: +) -> Optional[Union[ErrorsList, IncidentResponse]]: """Add subscribers to incident Add subscribers to incident Args: - id (str | UUID): + id (Union[UUID, str]): body (AddSubscribers): Raises: @@ -179,7 +176,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentResponse + Union[ErrorsList, IncidentResponse] """ return ( diff --git a/rootly_sdk/api/incidents/assign_user_to_incident.py b/rootly_sdk/api/incidents/assign_user_to_incident.py index 183ed7ec..68cc66c8 100644 --- a/rootly_sdk/api/incidents/assign_user_to_incident.py +++ b/rootly_sdk/api/incidents/assign_user_to_incident.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union from uuid import UUID import httpx @@ -14,7 +13,7 @@ def _get_kwargs( - id: str | UUID, + id: Union[UUID, str], *, body: AssignRoleToUser, ) -> dict[str, Any]: @@ -22,9 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/incidents/{id}/assign_role_to_user".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/incidents/{id}/assign_role_to_user", } _kwargs["json"] = body.to_dict() @@ -36,8 +33,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | IncidentResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, IncidentResponse]]: if response.status_code == 200: response_200 = IncidentResponse.from_dict(response.json()) @@ -55,8 +52,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | IncidentResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, IncidentResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,17 +63,17 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: AssignRoleToUser, -) -> Response[ErrorsList | IncidentResponse]: +) -> Response[Union[ErrorsList, IncidentResponse]]: """Assign user to incident Assign user to incident Args: - id (str | UUID): + id (Union[UUID, str]): body (AssignRoleToUser): Raises: @@ -84,7 +81,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentResponse] + Response[Union[ErrorsList, IncidentResponse]] """ kwargs = _get_kwargs( @@ -100,17 +97,17 @@ def sync_detailed( def sync( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: AssignRoleToUser, -) -> ErrorsList | IncidentResponse | None: +) -> Optional[Union[ErrorsList, IncidentResponse]]: """Assign user to incident Assign user to incident Args: - id (str | UUID): + id (Union[UUID, str]): body (AssignRoleToUser): Raises: @@ -118,7 +115,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentResponse + Union[ErrorsList, IncidentResponse] """ return sync_detailed( @@ -129,17 +126,17 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: AssignRoleToUser, -) -> Response[ErrorsList | IncidentResponse]: +) -> Response[Union[ErrorsList, IncidentResponse]]: """Assign user to incident Assign user to incident Args: - id (str | UUID): + id (Union[UUID, str]): body (AssignRoleToUser): Raises: @@ -147,7 +144,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentResponse] + Response[Union[ErrorsList, IncidentResponse]] """ kwargs = _get_kwargs( @@ -161,17 +158,17 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: AssignRoleToUser, -) -> ErrorsList | IncidentResponse | None: +) -> Optional[Union[ErrorsList, IncidentResponse]]: """Assign user to incident Assign user to incident Args: - id (str | UUID): + id (Union[UUID, str]): body (AssignRoleToUser): Raises: @@ -179,7 +176,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentResponse + Union[ErrorsList, IncidentResponse] """ return ( diff --git a/rootly_sdk/api/incidents/cancel_incident.py b/rootly_sdk/api/incidents/cancel_incident.py index acdcb056..c2da65cc 100644 --- a/rootly_sdk/api/incidents/cancel_incident.py +++ b/rootly_sdk/api/incidents/cancel_incident.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union from uuid import UUID import httpx @@ -14,7 +13,7 @@ def _get_kwargs( - id: str | UUID, + id: Union[UUID, str], *, body: CancelIncident, ) -> dict[str, Any]: @@ -22,9 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/incidents/{id}/cancel".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/incidents/{id}/cancel", } _kwargs["json"] = body.to_dict() @@ -36,8 +33,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | IncidentResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, IncidentResponse]]: if response.status_code == 200: response_200 = IncidentResponse.from_dict(response.json()) @@ -55,8 +52,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | IncidentResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, IncidentResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,17 +63,17 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: CancelIncident, -) -> Response[ErrorsList | IncidentResponse]: +) -> Response[Union[ErrorsList, IncidentResponse]]: """Cancel an incident Cancel a specific incident by id Args: - id (str | UUID): + id (Union[UUID, str]): body (CancelIncident): Raises: @@ -84,7 +81,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentResponse] + Response[Union[ErrorsList, IncidentResponse]] """ kwargs = _get_kwargs( @@ -100,17 +97,17 @@ def sync_detailed( def sync( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: CancelIncident, -) -> ErrorsList | IncidentResponse | None: +) -> Optional[Union[ErrorsList, IncidentResponse]]: """Cancel an incident Cancel a specific incident by id Args: - id (str | UUID): + id (Union[UUID, str]): body (CancelIncident): Raises: @@ -118,7 +115,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentResponse + Union[ErrorsList, IncidentResponse] """ return sync_detailed( @@ -129,17 +126,17 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: CancelIncident, -) -> Response[ErrorsList | IncidentResponse]: +) -> Response[Union[ErrorsList, IncidentResponse]]: """Cancel an incident Cancel a specific incident by id Args: - id (str | UUID): + id (Union[UUID, str]): body (CancelIncident): Raises: @@ -147,7 +144,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentResponse] + Response[Union[ErrorsList, IncidentResponse]] """ kwargs = _get_kwargs( @@ -161,17 +158,17 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: CancelIncident, -) -> ErrorsList | IncidentResponse | None: +) -> Optional[Union[ErrorsList, IncidentResponse]]: """Cancel an incident Cancel a specific incident by id Args: - id (str | UUID): + id (Union[UUID, str]): body (CancelIncident): Raises: @@ -179,7 +176,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentResponse + Union[ErrorsList, IncidentResponse] """ return ( diff --git a/rootly_sdk/api/incidents/create_incident.py b/rootly_sdk/api/incidents/create_incident.py index 5e580107..8a0ccd50 100644 --- a/rootly_sdk/api/incidents/create_incident.py +++ b/rootly_sdk/api/incidents/create_incident.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | IncidentResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, IncidentResponse]]: if response.status_code == 201: response_201 = IncidentResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | IncidentResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, IncidentResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +69,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewIncident, -) -> Response[ErrorsList | IncidentResponse]: +) -> Response[Union[ErrorsList, IncidentResponse]]: """Creates an incident Creates a new incident from provided data @@ -82,7 +82,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentResponse] + Response[Union[ErrorsList, IncidentResponse]] """ kwargs = _get_kwargs( @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: NewIncident, -) -> ErrorsList | IncidentResponse | None: +) -> Optional[Union[ErrorsList, IncidentResponse]]: """Creates an incident Creates a new incident from provided data @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentResponse + Union[ErrorsList, IncidentResponse] """ return sync_detailed( @@ -126,7 +126,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewIncident, -) -> Response[ErrorsList | IncidentResponse]: +) -> Response[Union[ErrorsList, IncidentResponse]]: """Creates an incident Creates a new incident from provided data @@ -139,7 +139,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentResponse] + Response[Union[ErrorsList, IncidentResponse]] """ kwargs = _get_kwargs( @@ -155,7 +155,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewIncident, -) -> ErrorsList | IncidentResponse | None: +) -> Optional[Union[ErrorsList, IncidentResponse]]: """Creates an incident Creates a new incident from provided data @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentResponse + Union[ErrorsList, IncidentResponse] """ return ( diff --git a/rootly_sdk/api/incidents/delete_incident.py b/rootly_sdk/api/incidents/delete_incident.py index 93326984..5568243c 100644 --- a/rootly_sdk/api/incidents/delete_incident.py +++ b/rootly_sdk/api/incidents/delete_incident.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union from uuid import UUID import httpx @@ -13,22 +12,19 @@ def _get_kwargs( - id: str | UUID, + id: Union[UUID, str], ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/incidents/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/incidents/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | IncidentResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, IncidentResponse]]: if response.status_code == 200: response_200 = IncidentResponse.from_dict(response.json()) @@ -46,8 +42,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | IncidentResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, IncidentResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -57,23 +53,23 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Response[ErrorsList | IncidentResponse]: +) -> Response[Union[ErrorsList, IncidentResponse]]: """Delete an incident Delete a specific incident by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentResponse] + Response[Union[ErrorsList, IncidentResponse]] """ kwargs = _get_kwargs( @@ -88,23 +84,23 @@ def sync_detailed( def sync( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> ErrorsList | IncidentResponse | None: +) -> Optional[Union[ErrorsList, IncidentResponse]]: """Delete an incident Delete a specific incident by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentResponse + Union[ErrorsList, IncidentResponse] """ return sync_detailed( @@ -114,23 +110,23 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Response[ErrorsList | IncidentResponse]: +) -> Response[Union[ErrorsList, IncidentResponse]]: """Delete an incident Delete a specific incident by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentResponse] + Response[Union[ErrorsList, IncidentResponse]] """ kwargs = _get_kwargs( @@ -143,23 +139,23 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> ErrorsList | IncidentResponse | None: +) -> Optional[Union[ErrorsList, IncidentResponse]]: """Delete an incident Delete a specific incident by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentResponse + Union[ErrorsList, IncidentResponse] """ return ( diff --git a/rootly_sdk/api/incidents/detach_from_parent_incident.py b/rootly_sdk/api/incidents/detach_from_parent_incident.py index 97f2e681..00a608f7 100644 --- a/rootly_sdk/api/incidents/detach_from_parent_incident.py +++ b/rootly_sdk/api/incidents/detach_from_parent_incident.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any, cast -from urllib.parse import quote +from typing import Any, Optional, Union, cast from uuid import UUID import httpx @@ -13,22 +12,19 @@ def _get_kwargs( - id: str | UUID, + id: Union[UUID, str], ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/incidents/{id}/detach_from_parent".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/incidents/{id}/detach_from_parent", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Any | ErrorsList | IncidentResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorsList, IncidentResponse]]: if response.status_code == 200: response_200 = IncidentResponse.from_dict(response.json()) @@ -50,8 +46,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[Any | ErrorsList | IncidentResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorsList, IncidentResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -61,23 +57,23 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Response[Any | ErrorsList | IncidentResponse]: +) -> Response[Union[Any, ErrorsList, IncidentResponse]]: """Detach an incident from its parent Detach a sub-incident from its parent incident Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | ErrorsList | IncidentResponse] + Response[Union[Any, ErrorsList, IncidentResponse]] """ kwargs = _get_kwargs( @@ -92,23 +88,23 @@ def sync_detailed( def sync( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Any | ErrorsList | IncidentResponse | None: +) -> Optional[Union[Any, ErrorsList, IncidentResponse]]: """Detach an incident from its parent Detach a sub-incident from its parent incident Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | ErrorsList | IncidentResponse + Union[Any, ErrorsList, IncidentResponse] """ return sync_detailed( @@ -118,23 +114,23 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Response[Any | ErrorsList | IncidentResponse]: +) -> Response[Union[Any, ErrorsList, IncidentResponse]]: """Detach an incident from its parent Detach a sub-incident from its parent incident Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | ErrorsList | IncidentResponse] + Response[Union[Any, ErrorsList, IncidentResponse]] """ kwargs = _get_kwargs( @@ -147,23 +143,23 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Any | ErrorsList | IncidentResponse | None: +) -> Optional[Union[Any, ErrorsList, IncidentResponse]]: """Detach an incident from its parent Detach a sub-incident from its parent incident Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | ErrorsList | IncidentResponse + Union[Any, ErrorsList, IncidentResponse] """ return ( diff --git a/rootly_sdk/api/incidents/get_incident.py b/rootly_sdk/api/incidents/get_incident.py index 60b93b84..d803a802 100644 --- a/rootly_sdk/api/incidents/get_incident.py +++ b/rootly_sdk/api/incidents/get_incident.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union from uuid import UUID import httpx @@ -14,14 +13,13 @@ def _get_kwargs( - id: str | UUID, + id: Union[UUID, str], *, - include: GetIncidentInclude | Unset = UNSET, + include: Union[Unset, GetIncidentInclude] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} - json_include: str | Unset = UNSET + json_include: Union[Unset, str] = UNSET if not isinstance(include, Unset): json_include = include @@ -31,9 +29,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/incidents/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/incidents/{id}", "params": params, } @@ -41,8 +37,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | IncidentResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, IncidentResponse]]: if response.status_code == 200: response_200 = IncidentResponse.from_dict(response.json()) @@ -60,8 +56,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | IncidentResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, IncidentResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -71,25 +67,25 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, - include: GetIncidentInclude | Unset = UNSET, -) -> Response[ErrorsList | IncidentResponse]: + include: Union[Unset, GetIncidentInclude] = UNSET, +) -> Response[Union[ErrorsList, IncidentResponse]]: """Retrieves an incident Retrieves a specific incident by id Args: - id (str | UUID): - include (GetIncidentInclude | Unset): + id (Union[UUID, str]): + include (Union[Unset, GetIncidentInclude]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentResponse] + Response[Union[ErrorsList, IncidentResponse]] """ kwargs = _get_kwargs( @@ -105,25 +101,25 @@ def sync_detailed( def sync( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, - include: GetIncidentInclude | Unset = UNSET, -) -> ErrorsList | IncidentResponse | None: + include: Union[Unset, GetIncidentInclude] = UNSET, +) -> Optional[Union[ErrorsList, IncidentResponse]]: """Retrieves an incident Retrieves a specific incident by id Args: - id (str | UUID): - include (GetIncidentInclude | Unset): + id (Union[UUID, str]): + include (Union[Unset, GetIncidentInclude]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentResponse + Union[ErrorsList, IncidentResponse] """ return sync_detailed( @@ -134,25 +130,25 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, - include: GetIncidentInclude | Unset = UNSET, -) -> Response[ErrorsList | IncidentResponse]: + include: Union[Unset, GetIncidentInclude] = UNSET, +) -> Response[Union[ErrorsList, IncidentResponse]]: """Retrieves an incident Retrieves a specific incident by id Args: - id (str | UUID): - include (GetIncidentInclude | Unset): + id (Union[UUID, str]): + include (Union[Unset, GetIncidentInclude]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentResponse] + Response[Union[ErrorsList, IncidentResponse]] """ kwargs = _get_kwargs( @@ -166,25 +162,25 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, - include: GetIncidentInclude | Unset = UNSET, -) -> ErrorsList | IncidentResponse | None: + include: Union[Unset, GetIncidentInclude] = UNSET, +) -> Optional[Union[ErrorsList, IncidentResponse]]: """Retrieves an incident Retrieves a specific incident by id Args: - id (str | UUID): - include (GetIncidentInclude | Unset): + id (Union[UUID, str]): + include (Union[Unset, GetIncidentInclude]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentResponse + Union[ErrorsList, IncidentResponse] """ return ( diff --git a/rootly_sdk/api/incidents/list_incidents.py b/rootly_sdk/api/incidents/list_incidents.py index f320a9cc..d522e89f 100644 --- a/rootly_sdk/api/incidents/list_incidents.py +++ b/rootly_sdk/api/incidents/list_incidents.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -14,171 +14,170 @@ def _get_kwargs( *, - pageafter: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filterstatus: str | Unset = UNSET, - filterprivate: str | Unset = UNSET, - filteruser_id: int | Unset = UNSET, - filterseverity: str | Unset = UNSET, - filterseverity_id: str | Unset = UNSET, - filterlabels: str | Unset = UNSET, - filtertypes: str | Unset = UNSET, - filtertype_ids: str | Unset = UNSET, - filterenvironments: str | Unset = UNSET, - filterenvironment_ids: str | Unset = UNSET, - filterfunctionalities: str | Unset = UNSET, - filterfunctionality_ids: str | Unset = UNSET, - filterfunctionality_names: str | Unset = UNSET, - filterservices: str | Unset = UNSET, - filterservice_ids: str | Unset = UNSET, - filterservice_names: str | Unset = UNSET, - filterteams: str | Unset = UNSET, - filterteam_ids: str | Unset = UNSET, - filterteam_names: str | Unset = UNSET, - filtercause: str | Unset = UNSET, - filtercause_ids: str | Unset = UNSET, - filtercustom_field_selected_option_ids: str | Unset = UNSET, - filterslack_channel_id: str | Unset = UNSET, - filtersequential_id: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterupdated_atgt: str | Unset = UNSET, - filterupdated_atgte: str | Unset = UNSET, - filterupdated_atlt: str | Unset = UNSET, - filterupdated_atlte: str | Unset = UNSET, - filterstarted_atgt: str | Unset = UNSET, - filterstarted_atgte: str | Unset = UNSET, - filterstarted_atlt: str | Unset = UNSET, - filterstarted_atlte: str | Unset = UNSET, - filterdetected_atgt: str | Unset = UNSET, - filterdetected_atgte: str | Unset = UNSET, - filterdetected_atlt: str | Unset = UNSET, - filterdetected_atlte: str | Unset = UNSET, - filteracknowledged_atgt: str | Unset = UNSET, - filteracknowledged_atgte: str | Unset = UNSET, - filteracknowledged_atlt: str | Unset = UNSET, - filteracknowledged_atlte: str | Unset = UNSET, - filtermitigated_atgt: str | Unset = UNSET, - filtermitigated_atgte: str | Unset = UNSET, - filtermitigated_atlt: str | Unset = UNSET, - filtermitigated_atlte: str | Unset = UNSET, - filterresolved_atgt: str | Unset = UNSET, - filterresolved_atgte: str | Unset = UNSET, - filterresolved_atlt: str | Unset = UNSET, - filterresolved_atlte: str | Unset = UNSET, - filterclosed_atgt: str | Unset = UNSET, - filterclosed_atgte: str | Unset = UNSET, - filterclosed_atlt: str | Unset = UNSET, - filterclosed_atlte: str | Unset = UNSET, - filterin_triage_atgt: str | Unset = UNSET, - filterin_triage_atgte: str | Unset = UNSET, - filterin_triage_atlt: str | Unset = UNSET, - filterin_triage_atlte: str | Unset = UNSET, - filterkindeq: str | Unset = UNSET, - filterkindnot_eq: str | Unset = UNSET, - filterkindin: str | Unset = UNSET, - filterkindnot_in: str | Unset = UNSET, - filterstatuseq: str | Unset = UNSET, - filterstatusnot_eq: str | Unset = UNSET, - filterstatusin: str | Unset = UNSET, - filterstatusnot_in: str | Unset = UNSET, - filterprivateeq: str | Unset = UNSET, - filterprivatenot_eq: str | Unset = UNSET, - filterprivatein: str | Unset = UNSET, - filterprivatenot_in: str | Unset = UNSET, - filteruser_ideq: str | Unset = UNSET, - filteruser_idnot_eq: str | Unset = UNSET, - filteruser_idin: str | Unset = UNSET, - filteruser_idnot_in: str | Unset = UNSET, - filterseverityeq: str | Unset = UNSET, - filterseveritynot_eq: str | Unset = UNSET, - filterseverityin: str | Unset = UNSET, - filterseveritynot_in: str | Unset = UNSET, - filterseverity_ideq: str | Unset = UNSET, - filterseverity_idnot_eq: str | Unset = UNSET, - filterseverity_idin: str | Unset = UNSET, - filterseverity_idnot_in: str | Unset = UNSET, - filterlabelseq: str | Unset = UNSET, - filterlabelsnot_eq: str | Unset = UNSET, - filterlabelsin: str | Unset = UNSET, - filterlabelsnot_in: str | Unset = UNSET, - filterzendesk_ticket_ideq: str | Unset = UNSET, - filterzendesk_ticket_idnot_eq: str | Unset = UNSET, - filterzendesk_ticket_idin: str | Unset = UNSET, - filterzendesk_ticket_idnot_in: str | Unset = UNSET, - filtersequential_ideq: str | Unset = UNSET, - filtersequential_idnot_eq: str | Unset = UNSET, - filtersequential_idin: str | Unset = UNSET, - filtersequential_idnot_in: str | Unset = UNSET, - filtertypeseq: str | Unset = UNSET, - filtertypesnot_eq: str | Unset = UNSET, - filtertypesin: str | Unset = UNSET, - filtertypesnot_in: str | Unset = UNSET, - filtertype_idseq: str | Unset = UNSET, - filtertype_idsnot_eq: str | Unset = UNSET, - filtertype_idsin: str | Unset = UNSET, - filtertype_idsnot_in: str | Unset = UNSET, - filterenvironmentseq: str | Unset = UNSET, - filterenvironmentsnot_eq: str | Unset = UNSET, - filterenvironmentsin: str | Unset = UNSET, - filterenvironmentsnot_in: str | Unset = UNSET, - filterenvironment_idseq: str | Unset = UNSET, - filterenvironment_idsnot_eq: str | Unset = UNSET, - filterenvironment_idsin: str | Unset = UNSET, - filterenvironment_idsnot_in: str | Unset = UNSET, - filterserviceseq: str | Unset = UNSET, - filterservicesnot_eq: str | Unset = UNSET, - filterservicesin: str | Unset = UNSET, - filterservicesnot_in: str | Unset = UNSET, - filterservice_idseq: str | Unset = UNSET, - filterservice_idsnot_eq: str | Unset = UNSET, - filterservice_idsin: str | Unset = UNSET, - filterservice_idsnot_in: str | Unset = UNSET, - filterservice_nameseq: str | Unset = UNSET, - filterservice_namesnot_eq: str | Unset = UNSET, - filterservice_namesin: str | Unset = UNSET, - filterservice_namesnot_in: str | Unset = UNSET, - filterfunctionalitieseq: str | Unset = UNSET, - filterfunctionalitiesnot_eq: str | Unset = UNSET, - filterfunctionalitiesin: str | Unset = UNSET, - filterfunctionalitiesnot_in: str | Unset = UNSET, - filterfunctionality_idseq: str | Unset = UNSET, - filterfunctionality_idsnot_eq: str | Unset = UNSET, - filterfunctionality_idsin: str | Unset = UNSET, - filterfunctionality_idsnot_in: str | Unset = UNSET, - filterfunctionality_nameseq: str | Unset = UNSET, - filterfunctionality_namesnot_eq: str | Unset = UNSET, - filterfunctionality_namesin: str | Unset = UNSET, - filterfunctionality_namesnot_in: str | Unset = UNSET, - filtercauseseq: str | Unset = UNSET, - filtercausesnot_eq: str | Unset = UNSET, - filtercausesin: str | Unset = UNSET, - filtercausesnot_in: str | Unset = UNSET, - filtercause_idseq: str | Unset = UNSET, - filtercause_idsnot_eq: str | Unset = UNSET, - filtercause_idsin: str | Unset = UNSET, - filtercause_idsnot_in: str | Unset = UNSET, - filterteamseq: str | Unset = UNSET, - filterteamsnot_eq: str | Unset = UNSET, - filterteamsin: str | Unset = UNSET, - filterteamsnot_in: str | Unset = UNSET, - filterteam_idseq: str | Unset = UNSET, - filterteam_idsnot_eq: str | Unset = UNSET, - filterteam_idsin: str | Unset = UNSET, - filterteam_idsnot_in: str | Unset = UNSET, - filterteam_nameseq: str | Unset = UNSET, - filterteam_namesnot_eq: str | Unset = UNSET, - filterteam_namesin: str | Unset = UNSET, - filterteam_namesnot_in: str | Unset = UNSET, - sort: ListIncidentsSort | Unset = UNSET, - include: ListIncidentsInclude | Unset = UNSET, + pageafter: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filterkind: Union[Unset, str] = UNSET, + filterstatus: Union[Unset, str] = UNSET, + filterprivate: Union[Unset, str] = UNSET, + filteruser_id: Union[Unset, int] = UNSET, + filterseverity: Union[Unset, str] = UNSET, + filterseverity_id: Union[Unset, str] = UNSET, + filterlabels: Union[Unset, str] = UNSET, + filtertypes: Union[Unset, str] = UNSET, + filtertype_ids: Union[Unset, str] = UNSET, + filterenvironments: Union[Unset, str] = UNSET, + filterenvironment_ids: Union[Unset, str] = UNSET, + filterfunctionalities: Union[Unset, str] = UNSET, + filterfunctionality_ids: Union[Unset, str] = UNSET, + filterfunctionality_names: Union[Unset, str] = UNSET, + filterservices: Union[Unset, str] = UNSET, + filterservice_ids: Union[Unset, str] = UNSET, + filterservice_names: Union[Unset, str] = UNSET, + filterteams: Union[Unset, str] = UNSET, + filterteam_ids: Union[Unset, str] = UNSET, + filterteam_names: Union[Unset, str] = UNSET, + filtercause: Union[Unset, str] = UNSET, + filtercause_ids: Union[Unset, str] = UNSET, + filtercustom_field_selected_option_ids: Union[Unset, str] = UNSET, + filterslack_channel_id: Union[Unset, str] = UNSET, + filtersequential_id: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filterupdated_atgt: Union[Unset, str] = UNSET, + filterupdated_atgte: Union[Unset, str] = UNSET, + filterupdated_atlt: Union[Unset, str] = UNSET, + filterupdated_atlte: Union[Unset, str] = UNSET, + filterstarted_atgt: Union[Unset, str] = UNSET, + filterstarted_atgte: Union[Unset, str] = UNSET, + filterstarted_atlt: Union[Unset, str] = UNSET, + filterstarted_atlte: Union[Unset, str] = UNSET, + filterdetected_atgt: Union[Unset, str] = UNSET, + filterdetected_atgte: Union[Unset, str] = UNSET, + filterdetected_atlt: Union[Unset, str] = UNSET, + filterdetected_atlte: Union[Unset, str] = UNSET, + filteracknowledged_atgt: Union[Unset, str] = UNSET, + filteracknowledged_atgte: Union[Unset, str] = UNSET, + filteracknowledged_atlt: Union[Unset, str] = UNSET, + filteracknowledged_atlte: Union[Unset, str] = UNSET, + filtermitigated_atgt: Union[Unset, str] = UNSET, + filtermitigated_atgte: Union[Unset, str] = UNSET, + filtermitigated_atlt: Union[Unset, str] = UNSET, + filtermitigated_atlte: Union[Unset, str] = UNSET, + filterresolved_atgt: Union[Unset, str] = UNSET, + filterresolved_atgte: Union[Unset, str] = UNSET, + filterresolved_atlt: Union[Unset, str] = UNSET, + filterresolved_atlte: Union[Unset, str] = UNSET, + filterclosed_atgt: Union[Unset, str] = UNSET, + filterclosed_atgte: Union[Unset, str] = UNSET, + filterclosed_atlt: Union[Unset, str] = UNSET, + filterclosed_atlte: Union[Unset, str] = UNSET, + filterin_triage_atgt: Union[Unset, str] = UNSET, + filterin_triage_atgte: Union[Unset, str] = UNSET, + filterin_triage_atlt: Union[Unset, str] = UNSET, + filterin_triage_atlte: Union[Unset, str] = UNSET, + filterkindeq: Union[Unset, str] = UNSET, + filterkindnot_eq: Union[Unset, str] = UNSET, + filterkindin: Union[Unset, str] = UNSET, + filterkindnot_in: Union[Unset, str] = UNSET, + filterstatuseq: Union[Unset, str] = UNSET, + filterstatusnot_eq: Union[Unset, str] = UNSET, + filterstatusin: Union[Unset, str] = UNSET, + filterstatusnot_in: Union[Unset, str] = UNSET, + filterprivateeq: Union[Unset, str] = UNSET, + filterprivatenot_eq: Union[Unset, str] = UNSET, + filterprivatein: Union[Unset, str] = UNSET, + filterprivatenot_in: Union[Unset, str] = UNSET, + filteruser_ideq: Union[Unset, str] = UNSET, + filteruser_idnot_eq: Union[Unset, str] = UNSET, + filteruser_idin: Union[Unset, str] = UNSET, + filteruser_idnot_in: Union[Unset, str] = UNSET, + filterseverityeq: Union[Unset, str] = UNSET, + filterseveritynot_eq: Union[Unset, str] = UNSET, + filterseverityin: Union[Unset, str] = UNSET, + filterseveritynot_in: Union[Unset, str] = UNSET, + filterseverity_ideq: Union[Unset, str] = UNSET, + filterseverity_idnot_eq: Union[Unset, str] = UNSET, + filterseverity_idin: Union[Unset, str] = UNSET, + filterseverity_idnot_in: Union[Unset, str] = UNSET, + filterlabelseq: Union[Unset, str] = UNSET, + filterlabelsnot_eq: Union[Unset, str] = UNSET, + filterlabelsin: Union[Unset, str] = UNSET, + filterlabelsnot_in: Union[Unset, str] = UNSET, + filterzendesk_ticket_ideq: Union[Unset, str] = UNSET, + filterzendesk_ticket_idnot_eq: Union[Unset, str] = UNSET, + filterzendesk_ticket_idin: Union[Unset, str] = UNSET, + filterzendesk_ticket_idnot_in: Union[Unset, str] = UNSET, + filtersequential_ideq: Union[Unset, str] = UNSET, + filtersequential_idnot_eq: Union[Unset, str] = UNSET, + filtersequential_idin: Union[Unset, str] = UNSET, + filtersequential_idnot_in: Union[Unset, str] = UNSET, + filtertypeseq: Union[Unset, str] = UNSET, + filtertypesnot_eq: Union[Unset, str] = UNSET, + filtertypesin: Union[Unset, str] = UNSET, + filtertypesnot_in: Union[Unset, str] = UNSET, + filtertype_idseq: Union[Unset, str] = UNSET, + filtertype_idsnot_eq: Union[Unset, str] = UNSET, + filtertype_idsin: Union[Unset, str] = UNSET, + filtertype_idsnot_in: Union[Unset, str] = UNSET, + filterenvironmentseq: Union[Unset, str] = UNSET, + filterenvironmentsnot_eq: Union[Unset, str] = UNSET, + filterenvironmentsin: Union[Unset, str] = UNSET, + filterenvironmentsnot_in: Union[Unset, str] = UNSET, + filterenvironment_idseq: Union[Unset, str] = UNSET, + filterenvironment_idsnot_eq: Union[Unset, str] = UNSET, + filterenvironment_idsin: Union[Unset, str] = UNSET, + filterenvironment_idsnot_in: Union[Unset, str] = UNSET, + filterserviceseq: Union[Unset, str] = UNSET, + filterservicesnot_eq: Union[Unset, str] = UNSET, + filterservicesin: Union[Unset, str] = UNSET, + filterservicesnot_in: Union[Unset, str] = UNSET, + filterservice_idseq: Union[Unset, str] = UNSET, + filterservice_idsnot_eq: Union[Unset, str] = UNSET, + filterservice_idsin: Union[Unset, str] = UNSET, + filterservice_idsnot_in: Union[Unset, str] = UNSET, + filterservice_nameseq: Union[Unset, str] = UNSET, + filterservice_namesnot_eq: Union[Unset, str] = UNSET, + filterservice_namesin: Union[Unset, str] = UNSET, + filterservice_namesnot_in: Union[Unset, str] = UNSET, + filterfunctionalitieseq: Union[Unset, str] = UNSET, + filterfunctionalitiesnot_eq: Union[Unset, str] = UNSET, + filterfunctionalitiesin: Union[Unset, str] = UNSET, + filterfunctionalitiesnot_in: Union[Unset, str] = UNSET, + filterfunctionality_idseq: Union[Unset, str] = UNSET, + filterfunctionality_idsnot_eq: Union[Unset, str] = UNSET, + filterfunctionality_idsin: Union[Unset, str] = UNSET, + filterfunctionality_idsnot_in: Union[Unset, str] = UNSET, + filterfunctionality_nameseq: Union[Unset, str] = UNSET, + filterfunctionality_namesnot_eq: Union[Unset, str] = UNSET, + filterfunctionality_namesin: Union[Unset, str] = UNSET, + filterfunctionality_namesnot_in: Union[Unset, str] = UNSET, + filtercauseseq: Union[Unset, str] = UNSET, + filtercausesnot_eq: Union[Unset, str] = UNSET, + filtercausesin: Union[Unset, str] = UNSET, + filtercausesnot_in: Union[Unset, str] = UNSET, + filtercause_idseq: Union[Unset, str] = UNSET, + filtercause_idsnot_eq: Union[Unset, str] = UNSET, + filtercause_idsin: Union[Unset, str] = UNSET, + filtercause_idsnot_in: Union[Unset, str] = UNSET, + filterteamseq: Union[Unset, str] = UNSET, + filterteamsnot_eq: Union[Unset, str] = UNSET, + filterteamsin: Union[Unset, str] = UNSET, + filterteamsnot_in: Union[Unset, str] = UNSET, + filterteam_idseq: Union[Unset, str] = UNSET, + filterteam_idsnot_eq: Union[Unset, str] = UNSET, + filterteam_idsin: Union[Unset, str] = UNSET, + filterteam_idsnot_in: Union[Unset, str] = UNSET, + filterteam_nameseq: Union[Unset, str] = UNSET, + filterteam_namesnot_eq: Union[Unset, str] = UNSET, + filterteam_namesin: Union[Unset, str] = UNSET, + filterteam_namesnot_in: Union[Unset, str] = UNSET, + sort: Union[Unset, ListIncidentsSort] = UNSET, + include: Union[Unset, ListIncidentsInclude] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["page[after]"] = pageafter @@ -503,13 +502,13 @@ def _get_kwargs( params["filter[team_names][not_in]"] = filterteam_namesnot_in - json_sort: str | Unset = UNSET + json_sort: Union[Unset, str] = UNSET if not isinstance(sort, Unset): json_sort = sort params["sort"] = json_sort - json_include: str | Unset = UNSET + json_include: Union[Unset, str] = UNSET if not isinstance(include, Unset): json_include = include @@ -527,8 +526,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | IncidentList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, IncidentList]]: if response.status_code == 200: response_200 = IncidentList.from_dict(response.json()) @@ -546,8 +545,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | IncidentList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, IncidentList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -559,345 +558,345 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - pageafter: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filterstatus: str | Unset = UNSET, - filterprivate: str | Unset = UNSET, - filteruser_id: int | Unset = UNSET, - filterseverity: str | Unset = UNSET, - filterseverity_id: str | Unset = UNSET, - filterlabels: str | Unset = UNSET, - filtertypes: str | Unset = UNSET, - filtertype_ids: str | Unset = UNSET, - filterenvironments: str | Unset = UNSET, - filterenvironment_ids: str | Unset = UNSET, - filterfunctionalities: str | Unset = UNSET, - filterfunctionality_ids: str | Unset = UNSET, - filterfunctionality_names: str | Unset = UNSET, - filterservices: str | Unset = UNSET, - filterservice_ids: str | Unset = UNSET, - filterservice_names: str | Unset = UNSET, - filterteams: str | Unset = UNSET, - filterteam_ids: str | Unset = UNSET, - filterteam_names: str | Unset = UNSET, - filtercause: str | Unset = UNSET, - filtercause_ids: str | Unset = UNSET, - filtercustom_field_selected_option_ids: str | Unset = UNSET, - filterslack_channel_id: str | Unset = UNSET, - filtersequential_id: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterupdated_atgt: str | Unset = UNSET, - filterupdated_atgte: str | Unset = UNSET, - filterupdated_atlt: str | Unset = UNSET, - filterupdated_atlte: str | Unset = UNSET, - filterstarted_atgt: str | Unset = UNSET, - filterstarted_atgte: str | Unset = UNSET, - filterstarted_atlt: str | Unset = UNSET, - filterstarted_atlte: str | Unset = UNSET, - filterdetected_atgt: str | Unset = UNSET, - filterdetected_atgte: str | Unset = UNSET, - filterdetected_atlt: str | Unset = UNSET, - filterdetected_atlte: str | Unset = UNSET, - filteracknowledged_atgt: str | Unset = UNSET, - filteracknowledged_atgte: str | Unset = UNSET, - filteracknowledged_atlt: str | Unset = UNSET, - filteracknowledged_atlte: str | Unset = UNSET, - filtermitigated_atgt: str | Unset = UNSET, - filtermitigated_atgte: str | Unset = UNSET, - filtermitigated_atlt: str | Unset = UNSET, - filtermitigated_atlte: str | Unset = UNSET, - filterresolved_atgt: str | Unset = UNSET, - filterresolved_atgte: str | Unset = UNSET, - filterresolved_atlt: str | Unset = UNSET, - filterresolved_atlte: str | Unset = UNSET, - filterclosed_atgt: str | Unset = UNSET, - filterclosed_atgte: str | Unset = UNSET, - filterclosed_atlt: str | Unset = UNSET, - filterclosed_atlte: str | Unset = UNSET, - filterin_triage_atgt: str | Unset = UNSET, - filterin_triage_atgte: str | Unset = UNSET, - filterin_triage_atlt: str | Unset = UNSET, - filterin_triage_atlte: str | Unset = UNSET, - filterkindeq: str | Unset = UNSET, - filterkindnot_eq: str | Unset = UNSET, - filterkindin: str | Unset = UNSET, - filterkindnot_in: str | Unset = UNSET, - filterstatuseq: str | Unset = UNSET, - filterstatusnot_eq: str | Unset = UNSET, - filterstatusin: str | Unset = UNSET, - filterstatusnot_in: str | Unset = UNSET, - filterprivateeq: str | Unset = UNSET, - filterprivatenot_eq: str | Unset = UNSET, - filterprivatein: str | Unset = UNSET, - filterprivatenot_in: str | Unset = UNSET, - filteruser_ideq: str | Unset = UNSET, - filteruser_idnot_eq: str | Unset = UNSET, - filteruser_idin: str | Unset = UNSET, - filteruser_idnot_in: str | Unset = UNSET, - filterseverityeq: str | Unset = UNSET, - filterseveritynot_eq: str | Unset = UNSET, - filterseverityin: str | Unset = UNSET, - filterseveritynot_in: str | Unset = UNSET, - filterseverity_ideq: str | Unset = UNSET, - filterseverity_idnot_eq: str | Unset = UNSET, - filterseverity_idin: str | Unset = UNSET, - filterseverity_idnot_in: str | Unset = UNSET, - filterlabelseq: str | Unset = UNSET, - filterlabelsnot_eq: str | Unset = UNSET, - filterlabelsin: str | Unset = UNSET, - filterlabelsnot_in: str | Unset = UNSET, - filterzendesk_ticket_ideq: str | Unset = UNSET, - filterzendesk_ticket_idnot_eq: str | Unset = UNSET, - filterzendesk_ticket_idin: str | Unset = UNSET, - filterzendesk_ticket_idnot_in: str | Unset = UNSET, - filtersequential_ideq: str | Unset = UNSET, - filtersequential_idnot_eq: str | Unset = UNSET, - filtersequential_idin: str | Unset = UNSET, - filtersequential_idnot_in: str | Unset = UNSET, - filtertypeseq: str | Unset = UNSET, - filtertypesnot_eq: str | Unset = UNSET, - filtertypesin: str | Unset = UNSET, - filtertypesnot_in: str | Unset = UNSET, - filtertype_idseq: str | Unset = UNSET, - filtertype_idsnot_eq: str | Unset = UNSET, - filtertype_idsin: str | Unset = UNSET, - filtertype_idsnot_in: str | Unset = UNSET, - filterenvironmentseq: str | Unset = UNSET, - filterenvironmentsnot_eq: str | Unset = UNSET, - filterenvironmentsin: str | Unset = UNSET, - filterenvironmentsnot_in: str | Unset = UNSET, - filterenvironment_idseq: str | Unset = UNSET, - filterenvironment_idsnot_eq: str | Unset = UNSET, - filterenvironment_idsin: str | Unset = UNSET, - filterenvironment_idsnot_in: str | Unset = UNSET, - filterserviceseq: str | Unset = UNSET, - filterservicesnot_eq: str | Unset = UNSET, - filterservicesin: str | Unset = UNSET, - filterservicesnot_in: str | Unset = UNSET, - filterservice_idseq: str | Unset = UNSET, - filterservice_idsnot_eq: str | Unset = UNSET, - filterservice_idsin: str | Unset = UNSET, - filterservice_idsnot_in: str | Unset = UNSET, - filterservice_nameseq: str | Unset = UNSET, - filterservice_namesnot_eq: str | Unset = UNSET, - filterservice_namesin: str | Unset = UNSET, - filterservice_namesnot_in: str | Unset = UNSET, - filterfunctionalitieseq: str | Unset = UNSET, - filterfunctionalitiesnot_eq: str | Unset = UNSET, - filterfunctionalitiesin: str | Unset = UNSET, - filterfunctionalitiesnot_in: str | Unset = UNSET, - filterfunctionality_idseq: str | Unset = UNSET, - filterfunctionality_idsnot_eq: str | Unset = UNSET, - filterfunctionality_idsin: str | Unset = UNSET, - filterfunctionality_idsnot_in: str | Unset = UNSET, - filterfunctionality_nameseq: str | Unset = UNSET, - filterfunctionality_namesnot_eq: str | Unset = UNSET, - filterfunctionality_namesin: str | Unset = UNSET, - filterfunctionality_namesnot_in: str | Unset = UNSET, - filtercauseseq: str | Unset = UNSET, - filtercausesnot_eq: str | Unset = UNSET, - filtercausesin: str | Unset = UNSET, - filtercausesnot_in: str | Unset = UNSET, - filtercause_idseq: str | Unset = UNSET, - filtercause_idsnot_eq: str | Unset = UNSET, - filtercause_idsin: str | Unset = UNSET, - filtercause_idsnot_in: str | Unset = UNSET, - filterteamseq: str | Unset = UNSET, - filterteamsnot_eq: str | Unset = UNSET, - filterteamsin: str | Unset = UNSET, - filterteamsnot_in: str | Unset = UNSET, - filterteam_idseq: str | Unset = UNSET, - filterteam_idsnot_eq: str | Unset = UNSET, - filterteam_idsin: str | Unset = UNSET, - filterteam_idsnot_in: str | Unset = UNSET, - filterteam_nameseq: str | Unset = UNSET, - filterteam_namesnot_eq: str | Unset = UNSET, - filterteam_namesin: str | Unset = UNSET, - filterteam_namesnot_in: str | Unset = UNSET, - sort: ListIncidentsSort | Unset = UNSET, - include: ListIncidentsInclude | Unset = UNSET, -) -> Response[ErrorsList | IncidentList]: + pageafter: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filterkind: Union[Unset, str] = UNSET, + filterstatus: Union[Unset, str] = UNSET, + filterprivate: Union[Unset, str] = UNSET, + filteruser_id: Union[Unset, int] = UNSET, + filterseverity: Union[Unset, str] = UNSET, + filterseverity_id: Union[Unset, str] = UNSET, + filterlabels: Union[Unset, str] = UNSET, + filtertypes: Union[Unset, str] = UNSET, + filtertype_ids: Union[Unset, str] = UNSET, + filterenvironments: Union[Unset, str] = UNSET, + filterenvironment_ids: Union[Unset, str] = UNSET, + filterfunctionalities: Union[Unset, str] = UNSET, + filterfunctionality_ids: Union[Unset, str] = UNSET, + filterfunctionality_names: Union[Unset, str] = UNSET, + filterservices: Union[Unset, str] = UNSET, + filterservice_ids: Union[Unset, str] = UNSET, + filterservice_names: Union[Unset, str] = UNSET, + filterteams: Union[Unset, str] = UNSET, + filterteam_ids: Union[Unset, str] = UNSET, + filterteam_names: Union[Unset, str] = UNSET, + filtercause: Union[Unset, str] = UNSET, + filtercause_ids: Union[Unset, str] = UNSET, + filtercustom_field_selected_option_ids: Union[Unset, str] = UNSET, + filterslack_channel_id: Union[Unset, str] = UNSET, + filtersequential_id: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filterupdated_atgt: Union[Unset, str] = UNSET, + filterupdated_atgte: Union[Unset, str] = UNSET, + filterupdated_atlt: Union[Unset, str] = UNSET, + filterupdated_atlte: Union[Unset, str] = UNSET, + filterstarted_atgt: Union[Unset, str] = UNSET, + filterstarted_atgte: Union[Unset, str] = UNSET, + filterstarted_atlt: Union[Unset, str] = UNSET, + filterstarted_atlte: Union[Unset, str] = UNSET, + filterdetected_atgt: Union[Unset, str] = UNSET, + filterdetected_atgte: Union[Unset, str] = UNSET, + filterdetected_atlt: Union[Unset, str] = UNSET, + filterdetected_atlte: Union[Unset, str] = UNSET, + filteracknowledged_atgt: Union[Unset, str] = UNSET, + filteracknowledged_atgte: Union[Unset, str] = UNSET, + filteracknowledged_atlt: Union[Unset, str] = UNSET, + filteracknowledged_atlte: Union[Unset, str] = UNSET, + filtermitigated_atgt: Union[Unset, str] = UNSET, + filtermitigated_atgte: Union[Unset, str] = UNSET, + filtermitigated_atlt: Union[Unset, str] = UNSET, + filtermitigated_atlte: Union[Unset, str] = UNSET, + filterresolved_atgt: Union[Unset, str] = UNSET, + filterresolved_atgte: Union[Unset, str] = UNSET, + filterresolved_atlt: Union[Unset, str] = UNSET, + filterresolved_atlte: Union[Unset, str] = UNSET, + filterclosed_atgt: Union[Unset, str] = UNSET, + filterclosed_atgte: Union[Unset, str] = UNSET, + filterclosed_atlt: Union[Unset, str] = UNSET, + filterclosed_atlte: Union[Unset, str] = UNSET, + filterin_triage_atgt: Union[Unset, str] = UNSET, + filterin_triage_atgte: Union[Unset, str] = UNSET, + filterin_triage_atlt: Union[Unset, str] = UNSET, + filterin_triage_atlte: Union[Unset, str] = UNSET, + filterkindeq: Union[Unset, str] = UNSET, + filterkindnot_eq: Union[Unset, str] = UNSET, + filterkindin: Union[Unset, str] = UNSET, + filterkindnot_in: Union[Unset, str] = UNSET, + filterstatuseq: Union[Unset, str] = UNSET, + filterstatusnot_eq: Union[Unset, str] = UNSET, + filterstatusin: Union[Unset, str] = UNSET, + filterstatusnot_in: Union[Unset, str] = UNSET, + filterprivateeq: Union[Unset, str] = UNSET, + filterprivatenot_eq: Union[Unset, str] = UNSET, + filterprivatein: Union[Unset, str] = UNSET, + filterprivatenot_in: Union[Unset, str] = UNSET, + filteruser_ideq: Union[Unset, str] = UNSET, + filteruser_idnot_eq: Union[Unset, str] = UNSET, + filteruser_idin: Union[Unset, str] = UNSET, + filteruser_idnot_in: Union[Unset, str] = UNSET, + filterseverityeq: Union[Unset, str] = UNSET, + filterseveritynot_eq: Union[Unset, str] = UNSET, + filterseverityin: Union[Unset, str] = UNSET, + filterseveritynot_in: Union[Unset, str] = UNSET, + filterseverity_ideq: Union[Unset, str] = UNSET, + filterseverity_idnot_eq: Union[Unset, str] = UNSET, + filterseverity_idin: Union[Unset, str] = UNSET, + filterseverity_idnot_in: Union[Unset, str] = UNSET, + filterlabelseq: Union[Unset, str] = UNSET, + filterlabelsnot_eq: Union[Unset, str] = UNSET, + filterlabelsin: Union[Unset, str] = UNSET, + filterlabelsnot_in: Union[Unset, str] = UNSET, + filterzendesk_ticket_ideq: Union[Unset, str] = UNSET, + filterzendesk_ticket_idnot_eq: Union[Unset, str] = UNSET, + filterzendesk_ticket_idin: Union[Unset, str] = UNSET, + filterzendesk_ticket_idnot_in: Union[Unset, str] = UNSET, + filtersequential_ideq: Union[Unset, str] = UNSET, + filtersequential_idnot_eq: Union[Unset, str] = UNSET, + filtersequential_idin: Union[Unset, str] = UNSET, + filtersequential_idnot_in: Union[Unset, str] = UNSET, + filtertypeseq: Union[Unset, str] = UNSET, + filtertypesnot_eq: Union[Unset, str] = UNSET, + filtertypesin: Union[Unset, str] = UNSET, + filtertypesnot_in: Union[Unset, str] = UNSET, + filtertype_idseq: Union[Unset, str] = UNSET, + filtertype_idsnot_eq: Union[Unset, str] = UNSET, + filtertype_idsin: Union[Unset, str] = UNSET, + filtertype_idsnot_in: Union[Unset, str] = UNSET, + filterenvironmentseq: Union[Unset, str] = UNSET, + filterenvironmentsnot_eq: Union[Unset, str] = UNSET, + filterenvironmentsin: Union[Unset, str] = UNSET, + filterenvironmentsnot_in: Union[Unset, str] = UNSET, + filterenvironment_idseq: Union[Unset, str] = UNSET, + filterenvironment_idsnot_eq: Union[Unset, str] = UNSET, + filterenvironment_idsin: Union[Unset, str] = UNSET, + filterenvironment_idsnot_in: Union[Unset, str] = UNSET, + filterserviceseq: Union[Unset, str] = UNSET, + filterservicesnot_eq: Union[Unset, str] = UNSET, + filterservicesin: Union[Unset, str] = UNSET, + filterservicesnot_in: Union[Unset, str] = UNSET, + filterservice_idseq: Union[Unset, str] = UNSET, + filterservice_idsnot_eq: Union[Unset, str] = UNSET, + filterservice_idsin: Union[Unset, str] = UNSET, + filterservice_idsnot_in: Union[Unset, str] = UNSET, + filterservice_nameseq: Union[Unset, str] = UNSET, + filterservice_namesnot_eq: Union[Unset, str] = UNSET, + filterservice_namesin: Union[Unset, str] = UNSET, + filterservice_namesnot_in: Union[Unset, str] = UNSET, + filterfunctionalitieseq: Union[Unset, str] = UNSET, + filterfunctionalitiesnot_eq: Union[Unset, str] = UNSET, + filterfunctionalitiesin: Union[Unset, str] = UNSET, + filterfunctionalitiesnot_in: Union[Unset, str] = UNSET, + filterfunctionality_idseq: Union[Unset, str] = UNSET, + filterfunctionality_idsnot_eq: Union[Unset, str] = UNSET, + filterfunctionality_idsin: Union[Unset, str] = UNSET, + filterfunctionality_idsnot_in: Union[Unset, str] = UNSET, + filterfunctionality_nameseq: Union[Unset, str] = UNSET, + filterfunctionality_namesnot_eq: Union[Unset, str] = UNSET, + filterfunctionality_namesin: Union[Unset, str] = UNSET, + filterfunctionality_namesnot_in: Union[Unset, str] = UNSET, + filtercauseseq: Union[Unset, str] = UNSET, + filtercausesnot_eq: Union[Unset, str] = UNSET, + filtercausesin: Union[Unset, str] = UNSET, + filtercausesnot_in: Union[Unset, str] = UNSET, + filtercause_idseq: Union[Unset, str] = UNSET, + filtercause_idsnot_eq: Union[Unset, str] = UNSET, + filtercause_idsin: Union[Unset, str] = UNSET, + filtercause_idsnot_in: Union[Unset, str] = UNSET, + filterteamseq: Union[Unset, str] = UNSET, + filterteamsnot_eq: Union[Unset, str] = UNSET, + filterteamsin: Union[Unset, str] = UNSET, + filterteamsnot_in: Union[Unset, str] = UNSET, + filterteam_idseq: Union[Unset, str] = UNSET, + filterteam_idsnot_eq: Union[Unset, str] = UNSET, + filterteam_idsin: Union[Unset, str] = UNSET, + filterteam_idsnot_in: Union[Unset, str] = UNSET, + filterteam_nameseq: Union[Unset, str] = UNSET, + filterteam_namesnot_eq: Union[Unset, str] = UNSET, + filterteam_namesin: Union[Unset, str] = UNSET, + filterteam_namesnot_in: Union[Unset, str] = UNSET, + sort: Union[Unset, ListIncidentsSort] = UNSET, + include: Union[Unset, ListIncidentsInclude] = UNSET, +) -> Response[Union[ErrorsList, IncidentList]]: """List incidents List incidents Args: - pageafter (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterkind (str | Unset): - filterstatus (str | Unset): - filterprivate (str | Unset): - filteruser_id (int | Unset): - filterseverity (str | Unset): - filterseverity_id (str | Unset): - filterlabels (str | Unset): - filtertypes (str | Unset): - filtertype_ids (str | Unset): - filterenvironments (str | Unset): - filterenvironment_ids (str | Unset): - filterfunctionalities (str | Unset): - filterfunctionality_ids (str | Unset): - filterfunctionality_names (str | Unset): - filterservices (str | Unset): - filterservice_ids (str | Unset): - filterservice_names (str | Unset): - filterteams (str | Unset): - filterteam_ids (str | Unset): - filterteam_names (str | Unset): - filtercause (str | Unset): - filtercause_ids (str | Unset): - filtercustom_field_selected_option_ids (str | Unset): - filterslack_channel_id (str | Unset): - filtersequential_id (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterupdated_atgt (str | Unset): - filterupdated_atgte (str | Unset): - filterupdated_atlt (str | Unset): - filterupdated_atlte (str | Unset): - filterstarted_atgt (str | Unset): - filterstarted_atgte (str | Unset): - filterstarted_atlt (str | Unset): - filterstarted_atlte (str | Unset): - filterdetected_atgt (str | Unset): - filterdetected_atgte (str | Unset): - filterdetected_atlt (str | Unset): - filterdetected_atlte (str | Unset): - filteracknowledged_atgt (str | Unset): - filteracknowledged_atgte (str | Unset): - filteracknowledged_atlt (str | Unset): - filteracknowledged_atlte (str | Unset): - filtermitigated_atgt (str | Unset): - filtermitigated_atgte (str | Unset): - filtermitigated_atlt (str | Unset): - filtermitigated_atlte (str | Unset): - filterresolved_atgt (str | Unset): - filterresolved_atgte (str | Unset): - filterresolved_atlt (str | Unset): - filterresolved_atlte (str | Unset): - filterclosed_atgt (str | Unset): - filterclosed_atgte (str | Unset): - filterclosed_atlt (str | Unset): - filterclosed_atlte (str | Unset): - filterin_triage_atgt (str | Unset): - filterin_triage_atgte (str | Unset): - filterin_triage_atlt (str | Unset): - filterin_triage_atlte (str | Unset): - filterkindeq (str | Unset): - filterkindnot_eq (str | Unset): - filterkindin (str | Unset): - filterkindnot_in (str | Unset): - filterstatuseq (str | Unset): - filterstatusnot_eq (str | Unset): - filterstatusin (str | Unset): - filterstatusnot_in (str | Unset): - filterprivateeq (str | Unset): - filterprivatenot_eq (str | Unset): - filterprivatein (str | Unset): - filterprivatenot_in (str | Unset): - filteruser_ideq (str | Unset): - filteruser_idnot_eq (str | Unset): - filteruser_idin (str | Unset): - filteruser_idnot_in (str | Unset): - filterseverityeq (str | Unset): - filterseveritynot_eq (str | Unset): - filterseverityin (str | Unset): - filterseveritynot_in (str | Unset): - filterseverity_ideq (str | Unset): - filterseverity_idnot_eq (str | Unset): - filterseverity_idin (str | Unset): - filterseverity_idnot_in (str | Unset): - filterlabelseq (str | Unset): - filterlabelsnot_eq (str | Unset): - filterlabelsin (str | Unset): - filterlabelsnot_in (str | Unset): - filterzendesk_ticket_ideq (str | Unset): - filterzendesk_ticket_idnot_eq (str | Unset): - filterzendesk_ticket_idin (str | Unset): - filterzendesk_ticket_idnot_in (str | Unset): - filtersequential_ideq (str | Unset): - filtersequential_idnot_eq (str | Unset): - filtersequential_idin (str | Unset): - filtersequential_idnot_in (str | Unset): - filtertypeseq (str | Unset): - filtertypesnot_eq (str | Unset): - filtertypesin (str | Unset): - filtertypesnot_in (str | Unset): - filtertype_idseq (str | Unset): - filtertype_idsnot_eq (str | Unset): - filtertype_idsin (str | Unset): - filtertype_idsnot_in (str | Unset): - filterenvironmentseq (str | Unset): - filterenvironmentsnot_eq (str | Unset): - filterenvironmentsin (str | Unset): - filterenvironmentsnot_in (str | Unset): - filterenvironment_idseq (str | Unset): - filterenvironment_idsnot_eq (str | Unset): - filterenvironment_idsin (str | Unset): - filterenvironment_idsnot_in (str | Unset): - filterserviceseq (str | Unset): - filterservicesnot_eq (str | Unset): - filterservicesin (str | Unset): - filterservicesnot_in (str | Unset): - filterservice_idseq (str | Unset): - filterservice_idsnot_eq (str | Unset): - filterservice_idsin (str | Unset): - filterservice_idsnot_in (str | Unset): - filterservice_nameseq (str | Unset): - filterservice_namesnot_eq (str | Unset): - filterservice_namesin (str | Unset): - filterservice_namesnot_in (str | Unset): - filterfunctionalitieseq (str | Unset): - filterfunctionalitiesnot_eq (str | Unset): - filterfunctionalitiesin (str | Unset): - filterfunctionalitiesnot_in (str | Unset): - filterfunctionality_idseq (str | Unset): - filterfunctionality_idsnot_eq (str | Unset): - filterfunctionality_idsin (str | Unset): - filterfunctionality_idsnot_in (str | Unset): - filterfunctionality_nameseq (str | Unset): - filterfunctionality_namesnot_eq (str | Unset): - filterfunctionality_namesin (str | Unset): - filterfunctionality_namesnot_in (str | Unset): - filtercauseseq (str | Unset): - filtercausesnot_eq (str | Unset): - filtercausesin (str | Unset): - filtercausesnot_in (str | Unset): - filtercause_idseq (str | Unset): - filtercause_idsnot_eq (str | Unset): - filtercause_idsin (str | Unset): - filtercause_idsnot_in (str | Unset): - filterteamseq (str | Unset): - filterteamsnot_eq (str | Unset): - filterteamsin (str | Unset): - filterteamsnot_in (str | Unset): - filterteam_idseq (str | Unset): - filterteam_idsnot_eq (str | Unset): - filterteam_idsin (str | Unset): - filterteam_idsnot_in (str | Unset): - filterteam_nameseq (str | Unset): - filterteam_namesnot_eq (str | Unset): - filterteam_namesin (str | Unset): - filterteam_namesnot_in (str | Unset): - sort (ListIncidentsSort | Unset): - include (ListIncidentsInclude | Unset): + pageafter (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterkind (Union[Unset, str]): + filterstatus (Union[Unset, str]): + filterprivate (Union[Unset, str]): + filteruser_id (Union[Unset, int]): + filterseverity (Union[Unset, str]): + filterseverity_id (Union[Unset, str]): + filterlabels (Union[Unset, str]): + filtertypes (Union[Unset, str]): + filtertype_ids (Union[Unset, str]): + filterenvironments (Union[Unset, str]): + filterenvironment_ids (Union[Unset, str]): + filterfunctionalities (Union[Unset, str]): + filterfunctionality_ids (Union[Unset, str]): + filterfunctionality_names (Union[Unset, str]): + filterservices (Union[Unset, str]): + filterservice_ids (Union[Unset, str]): + filterservice_names (Union[Unset, str]): + filterteams (Union[Unset, str]): + filterteam_ids (Union[Unset, str]): + filterteam_names (Union[Unset, str]): + filtercause (Union[Unset, str]): + filtercause_ids (Union[Unset, str]): + filtercustom_field_selected_option_ids (Union[Unset, str]): + filterslack_channel_id (Union[Unset, str]): + filtersequential_id (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterupdated_atgt (Union[Unset, str]): + filterupdated_atgte (Union[Unset, str]): + filterupdated_atlt (Union[Unset, str]): + filterupdated_atlte (Union[Unset, str]): + filterstarted_atgt (Union[Unset, str]): + filterstarted_atgte (Union[Unset, str]): + filterstarted_atlt (Union[Unset, str]): + filterstarted_atlte (Union[Unset, str]): + filterdetected_atgt (Union[Unset, str]): + filterdetected_atgte (Union[Unset, str]): + filterdetected_atlt (Union[Unset, str]): + filterdetected_atlte (Union[Unset, str]): + filteracknowledged_atgt (Union[Unset, str]): + filteracknowledged_atgte (Union[Unset, str]): + filteracknowledged_atlt (Union[Unset, str]): + filteracknowledged_atlte (Union[Unset, str]): + filtermitigated_atgt (Union[Unset, str]): + filtermitigated_atgte (Union[Unset, str]): + filtermitigated_atlt (Union[Unset, str]): + filtermitigated_atlte (Union[Unset, str]): + filterresolved_atgt (Union[Unset, str]): + filterresolved_atgte (Union[Unset, str]): + filterresolved_atlt (Union[Unset, str]): + filterresolved_atlte (Union[Unset, str]): + filterclosed_atgt (Union[Unset, str]): + filterclosed_atgte (Union[Unset, str]): + filterclosed_atlt (Union[Unset, str]): + filterclosed_atlte (Union[Unset, str]): + filterin_triage_atgt (Union[Unset, str]): + filterin_triage_atgte (Union[Unset, str]): + filterin_triage_atlt (Union[Unset, str]): + filterin_triage_atlte (Union[Unset, str]): + filterkindeq (Union[Unset, str]): + filterkindnot_eq (Union[Unset, str]): + filterkindin (Union[Unset, str]): + filterkindnot_in (Union[Unset, str]): + filterstatuseq (Union[Unset, str]): + filterstatusnot_eq (Union[Unset, str]): + filterstatusin (Union[Unset, str]): + filterstatusnot_in (Union[Unset, str]): + filterprivateeq (Union[Unset, str]): + filterprivatenot_eq (Union[Unset, str]): + filterprivatein (Union[Unset, str]): + filterprivatenot_in (Union[Unset, str]): + filteruser_ideq (Union[Unset, str]): + filteruser_idnot_eq (Union[Unset, str]): + filteruser_idin (Union[Unset, str]): + filteruser_idnot_in (Union[Unset, str]): + filterseverityeq (Union[Unset, str]): + filterseveritynot_eq (Union[Unset, str]): + filterseverityin (Union[Unset, str]): + filterseveritynot_in (Union[Unset, str]): + filterseverity_ideq (Union[Unset, str]): + filterseverity_idnot_eq (Union[Unset, str]): + filterseverity_idin (Union[Unset, str]): + filterseverity_idnot_in (Union[Unset, str]): + filterlabelseq (Union[Unset, str]): + filterlabelsnot_eq (Union[Unset, str]): + filterlabelsin (Union[Unset, str]): + filterlabelsnot_in (Union[Unset, str]): + filterzendesk_ticket_ideq (Union[Unset, str]): + filterzendesk_ticket_idnot_eq (Union[Unset, str]): + filterzendesk_ticket_idin (Union[Unset, str]): + filterzendesk_ticket_idnot_in (Union[Unset, str]): + filtersequential_ideq (Union[Unset, str]): + filtersequential_idnot_eq (Union[Unset, str]): + filtersequential_idin (Union[Unset, str]): + filtersequential_idnot_in (Union[Unset, str]): + filtertypeseq (Union[Unset, str]): + filtertypesnot_eq (Union[Unset, str]): + filtertypesin (Union[Unset, str]): + filtertypesnot_in (Union[Unset, str]): + filtertype_idseq (Union[Unset, str]): + filtertype_idsnot_eq (Union[Unset, str]): + filtertype_idsin (Union[Unset, str]): + filtertype_idsnot_in (Union[Unset, str]): + filterenvironmentseq (Union[Unset, str]): + filterenvironmentsnot_eq (Union[Unset, str]): + filterenvironmentsin (Union[Unset, str]): + filterenvironmentsnot_in (Union[Unset, str]): + filterenvironment_idseq (Union[Unset, str]): + filterenvironment_idsnot_eq (Union[Unset, str]): + filterenvironment_idsin (Union[Unset, str]): + filterenvironment_idsnot_in (Union[Unset, str]): + filterserviceseq (Union[Unset, str]): + filterservicesnot_eq (Union[Unset, str]): + filterservicesin (Union[Unset, str]): + filterservicesnot_in (Union[Unset, str]): + filterservice_idseq (Union[Unset, str]): + filterservice_idsnot_eq (Union[Unset, str]): + filterservice_idsin (Union[Unset, str]): + filterservice_idsnot_in (Union[Unset, str]): + filterservice_nameseq (Union[Unset, str]): + filterservice_namesnot_eq (Union[Unset, str]): + filterservice_namesin (Union[Unset, str]): + filterservice_namesnot_in (Union[Unset, str]): + filterfunctionalitieseq (Union[Unset, str]): + filterfunctionalitiesnot_eq (Union[Unset, str]): + filterfunctionalitiesin (Union[Unset, str]): + filterfunctionalitiesnot_in (Union[Unset, str]): + filterfunctionality_idseq (Union[Unset, str]): + filterfunctionality_idsnot_eq (Union[Unset, str]): + filterfunctionality_idsin (Union[Unset, str]): + filterfunctionality_idsnot_in (Union[Unset, str]): + filterfunctionality_nameseq (Union[Unset, str]): + filterfunctionality_namesnot_eq (Union[Unset, str]): + filterfunctionality_namesin (Union[Unset, str]): + filterfunctionality_namesnot_in (Union[Unset, str]): + filtercauseseq (Union[Unset, str]): + filtercausesnot_eq (Union[Unset, str]): + filtercausesin (Union[Unset, str]): + filtercausesnot_in (Union[Unset, str]): + filtercause_idseq (Union[Unset, str]): + filtercause_idsnot_eq (Union[Unset, str]): + filtercause_idsin (Union[Unset, str]): + filtercause_idsnot_in (Union[Unset, str]): + filterteamseq (Union[Unset, str]): + filterteamsnot_eq (Union[Unset, str]): + filterteamsin (Union[Unset, str]): + filterteamsnot_in (Union[Unset, str]): + filterteam_idseq (Union[Unset, str]): + filterteam_idsnot_eq (Union[Unset, str]): + filterteam_idsin (Union[Unset, str]): + filterteam_idsnot_in (Union[Unset, str]): + filterteam_nameseq (Union[Unset, str]): + filterteam_namesnot_eq (Union[Unset, str]): + filterteam_namesin (Union[Unset, str]): + filterteam_namesnot_in (Union[Unset, str]): + sort (Union[Unset, ListIncidentsSort]): + include (Union[Unset, ListIncidentsInclude]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentList] + Response[Union[ErrorsList, IncidentList]] """ kwargs = _get_kwargs( @@ -1076,345 +1075,345 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - pageafter: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filterstatus: str | Unset = UNSET, - filterprivate: str | Unset = UNSET, - filteruser_id: int | Unset = UNSET, - filterseverity: str | Unset = UNSET, - filterseverity_id: str | Unset = UNSET, - filterlabels: str | Unset = UNSET, - filtertypes: str | Unset = UNSET, - filtertype_ids: str | Unset = UNSET, - filterenvironments: str | Unset = UNSET, - filterenvironment_ids: str | Unset = UNSET, - filterfunctionalities: str | Unset = UNSET, - filterfunctionality_ids: str | Unset = UNSET, - filterfunctionality_names: str | Unset = UNSET, - filterservices: str | Unset = UNSET, - filterservice_ids: str | Unset = UNSET, - filterservice_names: str | Unset = UNSET, - filterteams: str | Unset = UNSET, - filterteam_ids: str | Unset = UNSET, - filterteam_names: str | Unset = UNSET, - filtercause: str | Unset = UNSET, - filtercause_ids: str | Unset = UNSET, - filtercustom_field_selected_option_ids: str | Unset = UNSET, - filterslack_channel_id: str | Unset = UNSET, - filtersequential_id: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterupdated_atgt: str | Unset = UNSET, - filterupdated_atgte: str | Unset = UNSET, - filterupdated_atlt: str | Unset = UNSET, - filterupdated_atlte: str | Unset = UNSET, - filterstarted_atgt: str | Unset = UNSET, - filterstarted_atgte: str | Unset = UNSET, - filterstarted_atlt: str | Unset = UNSET, - filterstarted_atlte: str | Unset = UNSET, - filterdetected_atgt: str | Unset = UNSET, - filterdetected_atgte: str | Unset = UNSET, - filterdetected_atlt: str | Unset = UNSET, - filterdetected_atlte: str | Unset = UNSET, - filteracknowledged_atgt: str | Unset = UNSET, - filteracknowledged_atgte: str | Unset = UNSET, - filteracknowledged_atlt: str | Unset = UNSET, - filteracknowledged_atlte: str | Unset = UNSET, - filtermitigated_atgt: str | Unset = UNSET, - filtermitigated_atgte: str | Unset = UNSET, - filtermitigated_atlt: str | Unset = UNSET, - filtermitigated_atlte: str | Unset = UNSET, - filterresolved_atgt: str | Unset = UNSET, - filterresolved_atgte: str | Unset = UNSET, - filterresolved_atlt: str | Unset = UNSET, - filterresolved_atlte: str | Unset = UNSET, - filterclosed_atgt: str | Unset = UNSET, - filterclosed_atgte: str | Unset = UNSET, - filterclosed_atlt: str | Unset = UNSET, - filterclosed_atlte: str | Unset = UNSET, - filterin_triage_atgt: str | Unset = UNSET, - filterin_triage_atgte: str | Unset = UNSET, - filterin_triage_atlt: str | Unset = UNSET, - filterin_triage_atlte: str | Unset = UNSET, - filterkindeq: str | Unset = UNSET, - filterkindnot_eq: str | Unset = UNSET, - filterkindin: str | Unset = UNSET, - filterkindnot_in: str | Unset = UNSET, - filterstatuseq: str | Unset = UNSET, - filterstatusnot_eq: str | Unset = UNSET, - filterstatusin: str | Unset = UNSET, - filterstatusnot_in: str | Unset = UNSET, - filterprivateeq: str | Unset = UNSET, - filterprivatenot_eq: str | Unset = UNSET, - filterprivatein: str | Unset = UNSET, - filterprivatenot_in: str | Unset = UNSET, - filteruser_ideq: str | Unset = UNSET, - filteruser_idnot_eq: str | Unset = UNSET, - filteruser_idin: str | Unset = UNSET, - filteruser_idnot_in: str | Unset = UNSET, - filterseverityeq: str | Unset = UNSET, - filterseveritynot_eq: str | Unset = UNSET, - filterseverityin: str | Unset = UNSET, - filterseveritynot_in: str | Unset = UNSET, - filterseverity_ideq: str | Unset = UNSET, - filterseverity_idnot_eq: str | Unset = UNSET, - filterseverity_idin: str | Unset = UNSET, - filterseverity_idnot_in: str | Unset = UNSET, - filterlabelseq: str | Unset = UNSET, - filterlabelsnot_eq: str | Unset = UNSET, - filterlabelsin: str | Unset = UNSET, - filterlabelsnot_in: str | Unset = UNSET, - filterzendesk_ticket_ideq: str | Unset = UNSET, - filterzendesk_ticket_idnot_eq: str | Unset = UNSET, - filterzendesk_ticket_idin: str | Unset = UNSET, - filterzendesk_ticket_idnot_in: str | Unset = UNSET, - filtersequential_ideq: str | Unset = UNSET, - filtersequential_idnot_eq: str | Unset = UNSET, - filtersequential_idin: str | Unset = UNSET, - filtersequential_idnot_in: str | Unset = UNSET, - filtertypeseq: str | Unset = UNSET, - filtertypesnot_eq: str | Unset = UNSET, - filtertypesin: str | Unset = UNSET, - filtertypesnot_in: str | Unset = UNSET, - filtertype_idseq: str | Unset = UNSET, - filtertype_idsnot_eq: str | Unset = UNSET, - filtertype_idsin: str | Unset = UNSET, - filtertype_idsnot_in: str | Unset = UNSET, - filterenvironmentseq: str | Unset = UNSET, - filterenvironmentsnot_eq: str | Unset = UNSET, - filterenvironmentsin: str | Unset = UNSET, - filterenvironmentsnot_in: str | Unset = UNSET, - filterenvironment_idseq: str | Unset = UNSET, - filterenvironment_idsnot_eq: str | Unset = UNSET, - filterenvironment_idsin: str | Unset = UNSET, - filterenvironment_idsnot_in: str | Unset = UNSET, - filterserviceseq: str | Unset = UNSET, - filterservicesnot_eq: str | Unset = UNSET, - filterservicesin: str | Unset = UNSET, - filterservicesnot_in: str | Unset = UNSET, - filterservice_idseq: str | Unset = UNSET, - filterservice_idsnot_eq: str | Unset = UNSET, - filterservice_idsin: str | Unset = UNSET, - filterservice_idsnot_in: str | Unset = UNSET, - filterservice_nameseq: str | Unset = UNSET, - filterservice_namesnot_eq: str | Unset = UNSET, - filterservice_namesin: str | Unset = UNSET, - filterservice_namesnot_in: str | Unset = UNSET, - filterfunctionalitieseq: str | Unset = UNSET, - filterfunctionalitiesnot_eq: str | Unset = UNSET, - filterfunctionalitiesin: str | Unset = UNSET, - filterfunctionalitiesnot_in: str | Unset = UNSET, - filterfunctionality_idseq: str | Unset = UNSET, - filterfunctionality_idsnot_eq: str | Unset = UNSET, - filterfunctionality_idsin: str | Unset = UNSET, - filterfunctionality_idsnot_in: str | Unset = UNSET, - filterfunctionality_nameseq: str | Unset = UNSET, - filterfunctionality_namesnot_eq: str | Unset = UNSET, - filterfunctionality_namesin: str | Unset = UNSET, - filterfunctionality_namesnot_in: str | Unset = UNSET, - filtercauseseq: str | Unset = UNSET, - filtercausesnot_eq: str | Unset = UNSET, - filtercausesin: str | Unset = UNSET, - filtercausesnot_in: str | Unset = UNSET, - filtercause_idseq: str | Unset = UNSET, - filtercause_idsnot_eq: str | Unset = UNSET, - filtercause_idsin: str | Unset = UNSET, - filtercause_idsnot_in: str | Unset = UNSET, - filterteamseq: str | Unset = UNSET, - filterteamsnot_eq: str | Unset = UNSET, - filterteamsin: str | Unset = UNSET, - filterteamsnot_in: str | Unset = UNSET, - filterteam_idseq: str | Unset = UNSET, - filterteam_idsnot_eq: str | Unset = UNSET, - filterteam_idsin: str | Unset = UNSET, - filterteam_idsnot_in: str | Unset = UNSET, - filterteam_nameseq: str | Unset = UNSET, - filterteam_namesnot_eq: str | Unset = UNSET, - filterteam_namesin: str | Unset = UNSET, - filterteam_namesnot_in: str | Unset = UNSET, - sort: ListIncidentsSort | Unset = UNSET, - include: ListIncidentsInclude | Unset = UNSET, -) -> ErrorsList | IncidentList | None: + pageafter: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filterkind: Union[Unset, str] = UNSET, + filterstatus: Union[Unset, str] = UNSET, + filterprivate: Union[Unset, str] = UNSET, + filteruser_id: Union[Unset, int] = UNSET, + filterseverity: Union[Unset, str] = UNSET, + filterseverity_id: Union[Unset, str] = UNSET, + filterlabels: Union[Unset, str] = UNSET, + filtertypes: Union[Unset, str] = UNSET, + filtertype_ids: Union[Unset, str] = UNSET, + filterenvironments: Union[Unset, str] = UNSET, + filterenvironment_ids: Union[Unset, str] = UNSET, + filterfunctionalities: Union[Unset, str] = UNSET, + filterfunctionality_ids: Union[Unset, str] = UNSET, + filterfunctionality_names: Union[Unset, str] = UNSET, + filterservices: Union[Unset, str] = UNSET, + filterservice_ids: Union[Unset, str] = UNSET, + filterservice_names: Union[Unset, str] = UNSET, + filterteams: Union[Unset, str] = UNSET, + filterteam_ids: Union[Unset, str] = UNSET, + filterteam_names: Union[Unset, str] = UNSET, + filtercause: Union[Unset, str] = UNSET, + filtercause_ids: Union[Unset, str] = UNSET, + filtercustom_field_selected_option_ids: Union[Unset, str] = UNSET, + filterslack_channel_id: Union[Unset, str] = UNSET, + filtersequential_id: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filterupdated_atgt: Union[Unset, str] = UNSET, + filterupdated_atgte: Union[Unset, str] = UNSET, + filterupdated_atlt: Union[Unset, str] = UNSET, + filterupdated_atlte: Union[Unset, str] = UNSET, + filterstarted_atgt: Union[Unset, str] = UNSET, + filterstarted_atgte: Union[Unset, str] = UNSET, + filterstarted_atlt: Union[Unset, str] = UNSET, + filterstarted_atlte: Union[Unset, str] = UNSET, + filterdetected_atgt: Union[Unset, str] = UNSET, + filterdetected_atgte: Union[Unset, str] = UNSET, + filterdetected_atlt: Union[Unset, str] = UNSET, + filterdetected_atlte: Union[Unset, str] = UNSET, + filteracknowledged_atgt: Union[Unset, str] = UNSET, + filteracknowledged_atgte: Union[Unset, str] = UNSET, + filteracknowledged_atlt: Union[Unset, str] = UNSET, + filteracknowledged_atlte: Union[Unset, str] = UNSET, + filtermitigated_atgt: Union[Unset, str] = UNSET, + filtermitigated_atgte: Union[Unset, str] = UNSET, + filtermitigated_atlt: Union[Unset, str] = UNSET, + filtermitigated_atlte: Union[Unset, str] = UNSET, + filterresolved_atgt: Union[Unset, str] = UNSET, + filterresolved_atgte: Union[Unset, str] = UNSET, + filterresolved_atlt: Union[Unset, str] = UNSET, + filterresolved_atlte: Union[Unset, str] = UNSET, + filterclosed_atgt: Union[Unset, str] = UNSET, + filterclosed_atgte: Union[Unset, str] = UNSET, + filterclosed_atlt: Union[Unset, str] = UNSET, + filterclosed_atlte: Union[Unset, str] = UNSET, + filterin_triage_atgt: Union[Unset, str] = UNSET, + filterin_triage_atgte: Union[Unset, str] = UNSET, + filterin_triage_atlt: Union[Unset, str] = UNSET, + filterin_triage_atlte: Union[Unset, str] = UNSET, + filterkindeq: Union[Unset, str] = UNSET, + filterkindnot_eq: Union[Unset, str] = UNSET, + filterkindin: Union[Unset, str] = UNSET, + filterkindnot_in: Union[Unset, str] = UNSET, + filterstatuseq: Union[Unset, str] = UNSET, + filterstatusnot_eq: Union[Unset, str] = UNSET, + filterstatusin: Union[Unset, str] = UNSET, + filterstatusnot_in: Union[Unset, str] = UNSET, + filterprivateeq: Union[Unset, str] = UNSET, + filterprivatenot_eq: Union[Unset, str] = UNSET, + filterprivatein: Union[Unset, str] = UNSET, + filterprivatenot_in: Union[Unset, str] = UNSET, + filteruser_ideq: Union[Unset, str] = UNSET, + filteruser_idnot_eq: Union[Unset, str] = UNSET, + filteruser_idin: Union[Unset, str] = UNSET, + filteruser_idnot_in: Union[Unset, str] = UNSET, + filterseverityeq: Union[Unset, str] = UNSET, + filterseveritynot_eq: Union[Unset, str] = UNSET, + filterseverityin: Union[Unset, str] = UNSET, + filterseveritynot_in: Union[Unset, str] = UNSET, + filterseverity_ideq: Union[Unset, str] = UNSET, + filterseverity_idnot_eq: Union[Unset, str] = UNSET, + filterseverity_idin: Union[Unset, str] = UNSET, + filterseverity_idnot_in: Union[Unset, str] = UNSET, + filterlabelseq: Union[Unset, str] = UNSET, + filterlabelsnot_eq: Union[Unset, str] = UNSET, + filterlabelsin: Union[Unset, str] = UNSET, + filterlabelsnot_in: Union[Unset, str] = UNSET, + filterzendesk_ticket_ideq: Union[Unset, str] = UNSET, + filterzendesk_ticket_idnot_eq: Union[Unset, str] = UNSET, + filterzendesk_ticket_idin: Union[Unset, str] = UNSET, + filterzendesk_ticket_idnot_in: Union[Unset, str] = UNSET, + filtersequential_ideq: Union[Unset, str] = UNSET, + filtersequential_idnot_eq: Union[Unset, str] = UNSET, + filtersequential_idin: Union[Unset, str] = UNSET, + filtersequential_idnot_in: Union[Unset, str] = UNSET, + filtertypeseq: Union[Unset, str] = UNSET, + filtertypesnot_eq: Union[Unset, str] = UNSET, + filtertypesin: Union[Unset, str] = UNSET, + filtertypesnot_in: Union[Unset, str] = UNSET, + filtertype_idseq: Union[Unset, str] = UNSET, + filtertype_idsnot_eq: Union[Unset, str] = UNSET, + filtertype_idsin: Union[Unset, str] = UNSET, + filtertype_idsnot_in: Union[Unset, str] = UNSET, + filterenvironmentseq: Union[Unset, str] = UNSET, + filterenvironmentsnot_eq: Union[Unset, str] = UNSET, + filterenvironmentsin: Union[Unset, str] = UNSET, + filterenvironmentsnot_in: Union[Unset, str] = UNSET, + filterenvironment_idseq: Union[Unset, str] = UNSET, + filterenvironment_idsnot_eq: Union[Unset, str] = UNSET, + filterenvironment_idsin: Union[Unset, str] = UNSET, + filterenvironment_idsnot_in: Union[Unset, str] = UNSET, + filterserviceseq: Union[Unset, str] = UNSET, + filterservicesnot_eq: Union[Unset, str] = UNSET, + filterservicesin: Union[Unset, str] = UNSET, + filterservicesnot_in: Union[Unset, str] = UNSET, + filterservice_idseq: Union[Unset, str] = UNSET, + filterservice_idsnot_eq: Union[Unset, str] = UNSET, + filterservice_idsin: Union[Unset, str] = UNSET, + filterservice_idsnot_in: Union[Unset, str] = UNSET, + filterservice_nameseq: Union[Unset, str] = UNSET, + filterservice_namesnot_eq: Union[Unset, str] = UNSET, + filterservice_namesin: Union[Unset, str] = UNSET, + filterservice_namesnot_in: Union[Unset, str] = UNSET, + filterfunctionalitieseq: Union[Unset, str] = UNSET, + filterfunctionalitiesnot_eq: Union[Unset, str] = UNSET, + filterfunctionalitiesin: Union[Unset, str] = UNSET, + filterfunctionalitiesnot_in: Union[Unset, str] = UNSET, + filterfunctionality_idseq: Union[Unset, str] = UNSET, + filterfunctionality_idsnot_eq: Union[Unset, str] = UNSET, + filterfunctionality_idsin: Union[Unset, str] = UNSET, + filterfunctionality_idsnot_in: Union[Unset, str] = UNSET, + filterfunctionality_nameseq: Union[Unset, str] = UNSET, + filterfunctionality_namesnot_eq: Union[Unset, str] = UNSET, + filterfunctionality_namesin: Union[Unset, str] = UNSET, + filterfunctionality_namesnot_in: Union[Unset, str] = UNSET, + filtercauseseq: Union[Unset, str] = UNSET, + filtercausesnot_eq: Union[Unset, str] = UNSET, + filtercausesin: Union[Unset, str] = UNSET, + filtercausesnot_in: Union[Unset, str] = UNSET, + filtercause_idseq: Union[Unset, str] = UNSET, + filtercause_idsnot_eq: Union[Unset, str] = UNSET, + filtercause_idsin: Union[Unset, str] = UNSET, + filtercause_idsnot_in: Union[Unset, str] = UNSET, + filterteamseq: Union[Unset, str] = UNSET, + filterteamsnot_eq: Union[Unset, str] = UNSET, + filterteamsin: Union[Unset, str] = UNSET, + filterteamsnot_in: Union[Unset, str] = UNSET, + filterteam_idseq: Union[Unset, str] = UNSET, + filterteam_idsnot_eq: Union[Unset, str] = UNSET, + filterteam_idsin: Union[Unset, str] = UNSET, + filterteam_idsnot_in: Union[Unset, str] = UNSET, + filterteam_nameseq: Union[Unset, str] = UNSET, + filterteam_namesnot_eq: Union[Unset, str] = UNSET, + filterteam_namesin: Union[Unset, str] = UNSET, + filterteam_namesnot_in: Union[Unset, str] = UNSET, + sort: Union[Unset, ListIncidentsSort] = UNSET, + include: Union[Unset, ListIncidentsInclude] = UNSET, +) -> Optional[Union[ErrorsList, IncidentList]]: """List incidents List incidents Args: - pageafter (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterkind (str | Unset): - filterstatus (str | Unset): - filterprivate (str | Unset): - filteruser_id (int | Unset): - filterseverity (str | Unset): - filterseverity_id (str | Unset): - filterlabels (str | Unset): - filtertypes (str | Unset): - filtertype_ids (str | Unset): - filterenvironments (str | Unset): - filterenvironment_ids (str | Unset): - filterfunctionalities (str | Unset): - filterfunctionality_ids (str | Unset): - filterfunctionality_names (str | Unset): - filterservices (str | Unset): - filterservice_ids (str | Unset): - filterservice_names (str | Unset): - filterteams (str | Unset): - filterteam_ids (str | Unset): - filterteam_names (str | Unset): - filtercause (str | Unset): - filtercause_ids (str | Unset): - filtercustom_field_selected_option_ids (str | Unset): - filterslack_channel_id (str | Unset): - filtersequential_id (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterupdated_atgt (str | Unset): - filterupdated_atgte (str | Unset): - filterupdated_atlt (str | Unset): - filterupdated_atlte (str | Unset): - filterstarted_atgt (str | Unset): - filterstarted_atgte (str | Unset): - filterstarted_atlt (str | Unset): - filterstarted_atlte (str | Unset): - filterdetected_atgt (str | Unset): - filterdetected_atgte (str | Unset): - filterdetected_atlt (str | Unset): - filterdetected_atlte (str | Unset): - filteracknowledged_atgt (str | Unset): - filteracknowledged_atgte (str | Unset): - filteracknowledged_atlt (str | Unset): - filteracknowledged_atlte (str | Unset): - filtermitigated_atgt (str | Unset): - filtermitigated_atgte (str | Unset): - filtermitigated_atlt (str | Unset): - filtermitigated_atlte (str | Unset): - filterresolved_atgt (str | Unset): - filterresolved_atgte (str | Unset): - filterresolved_atlt (str | Unset): - filterresolved_atlte (str | Unset): - filterclosed_atgt (str | Unset): - filterclosed_atgte (str | Unset): - filterclosed_atlt (str | Unset): - filterclosed_atlte (str | Unset): - filterin_triage_atgt (str | Unset): - filterin_triage_atgte (str | Unset): - filterin_triage_atlt (str | Unset): - filterin_triage_atlte (str | Unset): - filterkindeq (str | Unset): - filterkindnot_eq (str | Unset): - filterkindin (str | Unset): - filterkindnot_in (str | Unset): - filterstatuseq (str | Unset): - filterstatusnot_eq (str | Unset): - filterstatusin (str | Unset): - filterstatusnot_in (str | Unset): - filterprivateeq (str | Unset): - filterprivatenot_eq (str | Unset): - filterprivatein (str | Unset): - filterprivatenot_in (str | Unset): - filteruser_ideq (str | Unset): - filteruser_idnot_eq (str | Unset): - filteruser_idin (str | Unset): - filteruser_idnot_in (str | Unset): - filterseverityeq (str | Unset): - filterseveritynot_eq (str | Unset): - filterseverityin (str | Unset): - filterseveritynot_in (str | Unset): - filterseverity_ideq (str | Unset): - filterseverity_idnot_eq (str | Unset): - filterseverity_idin (str | Unset): - filterseverity_idnot_in (str | Unset): - filterlabelseq (str | Unset): - filterlabelsnot_eq (str | Unset): - filterlabelsin (str | Unset): - filterlabelsnot_in (str | Unset): - filterzendesk_ticket_ideq (str | Unset): - filterzendesk_ticket_idnot_eq (str | Unset): - filterzendesk_ticket_idin (str | Unset): - filterzendesk_ticket_idnot_in (str | Unset): - filtersequential_ideq (str | Unset): - filtersequential_idnot_eq (str | Unset): - filtersequential_idin (str | Unset): - filtersequential_idnot_in (str | Unset): - filtertypeseq (str | Unset): - filtertypesnot_eq (str | Unset): - filtertypesin (str | Unset): - filtertypesnot_in (str | Unset): - filtertype_idseq (str | Unset): - filtertype_idsnot_eq (str | Unset): - filtertype_idsin (str | Unset): - filtertype_idsnot_in (str | Unset): - filterenvironmentseq (str | Unset): - filterenvironmentsnot_eq (str | Unset): - filterenvironmentsin (str | Unset): - filterenvironmentsnot_in (str | Unset): - filterenvironment_idseq (str | Unset): - filterenvironment_idsnot_eq (str | Unset): - filterenvironment_idsin (str | Unset): - filterenvironment_idsnot_in (str | Unset): - filterserviceseq (str | Unset): - filterservicesnot_eq (str | Unset): - filterservicesin (str | Unset): - filterservicesnot_in (str | Unset): - filterservice_idseq (str | Unset): - filterservice_idsnot_eq (str | Unset): - filterservice_idsin (str | Unset): - filterservice_idsnot_in (str | Unset): - filterservice_nameseq (str | Unset): - filterservice_namesnot_eq (str | Unset): - filterservice_namesin (str | Unset): - filterservice_namesnot_in (str | Unset): - filterfunctionalitieseq (str | Unset): - filterfunctionalitiesnot_eq (str | Unset): - filterfunctionalitiesin (str | Unset): - filterfunctionalitiesnot_in (str | Unset): - filterfunctionality_idseq (str | Unset): - filterfunctionality_idsnot_eq (str | Unset): - filterfunctionality_idsin (str | Unset): - filterfunctionality_idsnot_in (str | Unset): - filterfunctionality_nameseq (str | Unset): - filterfunctionality_namesnot_eq (str | Unset): - filterfunctionality_namesin (str | Unset): - filterfunctionality_namesnot_in (str | Unset): - filtercauseseq (str | Unset): - filtercausesnot_eq (str | Unset): - filtercausesin (str | Unset): - filtercausesnot_in (str | Unset): - filtercause_idseq (str | Unset): - filtercause_idsnot_eq (str | Unset): - filtercause_idsin (str | Unset): - filtercause_idsnot_in (str | Unset): - filterteamseq (str | Unset): - filterteamsnot_eq (str | Unset): - filterteamsin (str | Unset): - filterteamsnot_in (str | Unset): - filterteam_idseq (str | Unset): - filterteam_idsnot_eq (str | Unset): - filterteam_idsin (str | Unset): - filterteam_idsnot_in (str | Unset): - filterteam_nameseq (str | Unset): - filterteam_namesnot_eq (str | Unset): - filterteam_namesin (str | Unset): - filterteam_namesnot_in (str | Unset): - sort (ListIncidentsSort | Unset): - include (ListIncidentsInclude | Unset): + pageafter (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterkind (Union[Unset, str]): + filterstatus (Union[Unset, str]): + filterprivate (Union[Unset, str]): + filteruser_id (Union[Unset, int]): + filterseverity (Union[Unset, str]): + filterseverity_id (Union[Unset, str]): + filterlabels (Union[Unset, str]): + filtertypes (Union[Unset, str]): + filtertype_ids (Union[Unset, str]): + filterenvironments (Union[Unset, str]): + filterenvironment_ids (Union[Unset, str]): + filterfunctionalities (Union[Unset, str]): + filterfunctionality_ids (Union[Unset, str]): + filterfunctionality_names (Union[Unset, str]): + filterservices (Union[Unset, str]): + filterservice_ids (Union[Unset, str]): + filterservice_names (Union[Unset, str]): + filterteams (Union[Unset, str]): + filterteam_ids (Union[Unset, str]): + filterteam_names (Union[Unset, str]): + filtercause (Union[Unset, str]): + filtercause_ids (Union[Unset, str]): + filtercustom_field_selected_option_ids (Union[Unset, str]): + filterslack_channel_id (Union[Unset, str]): + filtersequential_id (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterupdated_atgt (Union[Unset, str]): + filterupdated_atgte (Union[Unset, str]): + filterupdated_atlt (Union[Unset, str]): + filterupdated_atlte (Union[Unset, str]): + filterstarted_atgt (Union[Unset, str]): + filterstarted_atgte (Union[Unset, str]): + filterstarted_atlt (Union[Unset, str]): + filterstarted_atlte (Union[Unset, str]): + filterdetected_atgt (Union[Unset, str]): + filterdetected_atgte (Union[Unset, str]): + filterdetected_atlt (Union[Unset, str]): + filterdetected_atlte (Union[Unset, str]): + filteracknowledged_atgt (Union[Unset, str]): + filteracknowledged_atgte (Union[Unset, str]): + filteracknowledged_atlt (Union[Unset, str]): + filteracknowledged_atlte (Union[Unset, str]): + filtermitigated_atgt (Union[Unset, str]): + filtermitigated_atgte (Union[Unset, str]): + filtermitigated_atlt (Union[Unset, str]): + filtermitigated_atlte (Union[Unset, str]): + filterresolved_atgt (Union[Unset, str]): + filterresolved_atgte (Union[Unset, str]): + filterresolved_atlt (Union[Unset, str]): + filterresolved_atlte (Union[Unset, str]): + filterclosed_atgt (Union[Unset, str]): + filterclosed_atgte (Union[Unset, str]): + filterclosed_atlt (Union[Unset, str]): + filterclosed_atlte (Union[Unset, str]): + filterin_triage_atgt (Union[Unset, str]): + filterin_triage_atgte (Union[Unset, str]): + filterin_triage_atlt (Union[Unset, str]): + filterin_triage_atlte (Union[Unset, str]): + filterkindeq (Union[Unset, str]): + filterkindnot_eq (Union[Unset, str]): + filterkindin (Union[Unset, str]): + filterkindnot_in (Union[Unset, str]): + filterstatuseq (Union[Unset, str]): + filterstatusnot_eq (Union[Unset, str]): + filterstatusin (Union[Unset, str]): + filterstatusnot_in (Union[Unset, str]): + filterprivateeq (Union[Unset, str]): + filterprivatenot_eq (Union[Unset, str]): + filterprivatein (Union[Unset, str]): + filterprivatenot_in (Union[Unset, str]): + filteruser_ideq (Union[Unset, str]): + filteruser_idnot_eq (Union[Unset, str]): + filteruser_idin (Union[Unset, str]): + filteruser_idnot_in (Union[Unset, str]): + filterseverityeq (Union[Unset, str]): + filterseveritynot_eq (Union[Unset, str]): + filterseverityin (Union[Unset, str]): + filterseveritynot_in (Union[Unset, str]): + filterseverity_ideq (Union[Unset, str]): + filterseverity_idnot_eq (Union[Unset, str]): + filterseverity_idin (Union[Unset, str]): + filterseverity_idnot_in (Union[Unset, str]): + filterlabelseq (Union[Unset, str]): + filterlabelsnot_eq (Union[Unset, str]): + filterlabelsin (Union[Unset, str]): + filterlabelsnot_in (Union[Unset, str]): + filterzendesk_ticket_ideq (Union[Unset, str]): + filterzendesk_ticket_idnot_eq (Union[Unset, str]): + filterzendesk_ticket_idin (Union[Unset, str]): + filterzendesk_ticket_idnot_in (Union[Unset, str]): + filtersequential_ideq (Union[Unset, str]): + filtersequential_idnot_eq (Union[Unset, str]): + filtersequential_idin (Union[Unset, str]): + filtersequential_idnot_in (Union[Unset, str]): + filtertypeseq (Union[Unset, str]): + filtertypesnot_eq (Union[Unset, str]): + filtertypesin (Union[Unset, str]): + filtertypesnot_in (Union[Unset, str]): + filtertype_idseq (Union[Unset, str]): + filtertype_idsnot_eq (Union[Unset, str]): + filtertype_idsin (Union[Unset, str]): + filtertype_idsnot_in (Union[Unset, str]): + filterenvironmentseq (Union[Unset, str]): + filterenvironmentsnot_eq (Union[Unset, str]): + filterenvironmentsin (Union[Unset, str]): + filterenvironmentsnot_in (Union[Unset, str]): + filterenvironment_idseq (Union[Unset, str]): + filterenvironment_idsnot_eq (Union[Unset, str]): + filterenvironment_idsin (Union[Unset, str]): + filterenvironment_idsnot_in (Union[Unset, str]): + filterserviceseq (Union[Unset, str]): + filterservicesnot_eq (Union[Unset, str]): + filterservicesin (Union[Unset, str]): + filterservicesnot_in (Union[Unset, str]): + filterservice_idseq (Union[Unset, str]): + filterservice_idsnot_eq (Union[Unset, str]): + filterservice_idsin (Union[Unset, str]): + filterservice_idsnot_in (Union[Unset, str]): + filterservice_nameseq (Union[Unset, str]): + filterservice_namesnot_eq (Union[Unset, str]): + filterservice_namesin (Union[Unset, str]): + filterservice_namesnot_in (Union[Unset, str]): + filterfunctionalitieseq (Union[Unset, str]): + filterfunctionalitiesnot_eq (Union[Unset, str]): + filterfunctionalitiesin (Union[Unset, str]): + filterfunctionalitiesnot_in (Union[Unset, str]): + filterfunctionality_idseq (Union[Unset, str]): + filterfunctionality_idsnot_eq (Union[Unset, str]): + filterfunctionality_idsin (Union[Unset, str]): + filterfunctionality_idsnot_in (Union[Unset, str]): + filterfunctionality_nameseq (Union[Unset, str]): + filterfunctionality_namesnot_eq (Union[Unset, str]): + filterfunctionality_namesin (Union[Unset, str]): + filterfunctionality_namesnot_in (Union[Unset, str]): + filtercauseseq (Union[Unset, str]): + filtercausesnot_eq (Union[Unset, str]): + filtercausesin (Union[Unset, str]): + filtercausesnot_in (Union[Unset, str]): + filtercause_idseq (Union[Unset, str]): + filtercause_idsnot_eq (Union[Unset, str]): + filtercause_idsin (Union[Unset, str]): + filtercause_idsnot_in (Union[Unset, str]): + filterteamseq (Union[Unset, str]): + filterteamsnot_eq (Union[Unset, str]): + filterteamsin (Union[Unset, str]): + filterteamsnot_in (Union[Unset, str]): + filterteam_idseq (Union[Unset, str]): + filterteam_idsnot_eq (Union[Unset, str]): + filterteam_idsin (Union[Unset, str]): + filterteam_idsnot_in (Union[Unset, str]): + filterteam_nameseq (Union[Unset, str]): + filterteam_namesnot_eq (Union[Unset, str]): + filterteam_namesin (Union[Unset, str]): + filterteam_namesnot_in (Union[Unset, str]): + sort (Union[Unset, ListIncidentsSort]): + include (Union[Unset, ListIncidentsInclude]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentList + Union[ErrorsList, IncidentList] """ return sync_detailed( @@ -1588,345 +1587,345 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - pageafter: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filterstatus: str | Unset = UNSET, - filterprivate: str | Unset = UNSET, - filteruser_id: int | Unset = UNSET, - filterseverity: str | Unset = UNSET, - filterseverity_id: str | Unset = UNSET, - filterlabels: str | Unset = UNSET, - filtertypes: str | Unset = UNSET, - filtertype_ids: str | Unset = UNSET, - filterenvironments: str | Unset = UNSET, - filterenvironment_ids: str | Unset = UNSET, - filterfunctionalities: str | Unset = UNSET, - filterfunctionality_ids: str | Unset = UNSET, - filterfunctionality_names: str | Unset = UNSET, - filterservices: str | Unset = UNSET, - filterservice_ids: str | Unset = UNSET, - filterservice_names: str | Unset = UNSET, - filterteams: str | Unset = UNSET, - filterteam_ids: str | Unset = UNSET, - filterteam_names: str | Unset = UNSET, - filtercause: str | Unset = UNSET, - filtercause_ids: str | Unset = UNSET, - filtercustom_field_selected_option_ids: str | Unset = UNSET, - filterslack_channel_id: str | Unset = UNSET, - filtersequential_id: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterupdated_atgt: str | Unset = UNSET, - filterupdated_atgte: str | Unset = UNSET, - filterupdated_atlt: str | Unset = UNSET, - filterupdated_atlte: str | Unset = UNSET, - filterstarted_atgt: str | Unset = UNSET, - filterstarted_atgte: str | Unset = UNSET, - filterstarted_atlt: str | Unset = UNSET, - filterstarted_atlte: str | Unset = UNSET, - filterdetected_atgt: str | Unset = UNSET, - filterdetected_atgte: str | Unset = UNSET, - filterdetected_atlt: str | Unset = UNSET, - filterdetected_atlte: str | Unset = UNSET, - filteracknowledged_atgt: str | Unset = UNSET, - filteracknowledged_atgte: str | Unset = UNSET, - filteracknowledged_atlt: str | Unset = UNSET, - filteracknowledged_atlte: str | Unset = UNSET, - filtermitigated_atgt: str | Unset = UNSET, - filtermitigated_atgte: str | Unset = UNSET, - filtermitigated_atlt: str | Unset = UNSET, - filtermitigated_atlte: str | Unset = UNSET, - filterresolved_atgt: str | Unset = UNSET, - filterresolved_atgte: str | Unset = UNSET, - filterresolved_atlt: str | Unset = UNSET, - filterresolved_atlte: str | Unset = UNSET, - filterclosed_atgt: str | Unset = UNSET, - filterclosed_atgte: str | Unset = UNSET, - filterclosed_atlt: str | Unset = UNSET, - filterclosed_atlte: str | Unset = UNSET, - filterin_triage_atgt: str | Unset = UNSET, - filterin_triage_atgte: str | Unset = UNSET, - filterin_triage_atlt: str | Unset = UNSET, - filterin_triage_atlte: str | Unset = UNSET, - filterkindeq: str | Unset = UNSET, - filterkindnot_eq: str | Unset = UNSET, - filterkindin: str | Unset = UNSET, - filterkindnot_in: str | Unset = UNSET, - filterstatuseq: str | Unset = UNSET, - filterstatusnot_eq: str | Unset = UNSET, - filterstatusin: str | Unset = UNSET, - filterstatusnot_in: str | Unset = UNSET, - filterprivateeq: str | Unset = UNSET, - filterprivatenot_eq: str | Unset = UNSET, - filterprivatein: str | Unset = UNSET, - filterprivatenot_in: str | Unset = UNSET, - filteruser_ideq: str | Unset = UNSET, - filteruser_idnot_eq: str | Unset = UNSET, - filteruser_idin: str | Unset = UNSET, - filteruser_idnot_in: str | Unset = UNSET, - filterseverityeq: str | Unset = UNSET, - filterseveritynot_eq: str | Unset = UNSET, - filterseverityin: str | Unset = UNSET, - filterseveritynot_in: str | Unset = UNSET, - filterseverity_ideq: str | Unset = UNSET, - filterseverity_idnot_eq: str | Unset = UNSET, - filterseverity_idin: str | Unset = UNSET, - filterseverity_idnot_in: str | Unset = UNSET, - filterlabelseq: str | Unset = UNSET, - filterlabelsnot_eq: str | Unset = UNSET, - filterlabelsin: str | Unset = UNSET, - filterlabelsnot_in: str | Unset = UNSET, - filterzendesk_ticket_ideq: str | Unset = UNSET, - filterzendesk_ticket_idnot_eq: str | Unset = UNSET, - filterzendesk_ticket_idin: str | Unset = UNSET, - filterzendesk_ticket_idnot_in: str | Unset = UNSET, - filtersequential_ideq: str | Unset = UNSET, - filtersequential_idnot_eq: str | Unset = UNSET, - filtersequential_idin: str | Unset = UNSET, - filtersequential_idnot_in: str | Unset = UNSET, - filtertypeseq: str | Unset = UNSET, - filtertypesnot_eq: str | Unset = UNSET, - filtertypesin: str | Unset = UNSET, - filtertypesnot_in: str | Unset = UNSET, - filtertype_idseq: str | Unset = UNSET, - filtertype_idsnot_eq: str | Unset = UNSET, - filtertype_idsin: str | Unset = UNSET, - filtertype_idsnot_in: str | Unset = UNSET, - filterenvironmentseq: str | Unset = UNSET, - filterenvironmentsnot_eq: str | Unset = UNSET, - filterenvironmentsin: str | Unset = UNSET, - filterenvironmentsnot_in: str | Unset = UNSET, - filterenvironment_idseq: str | Unset = UNSET, - filterenvironment_idsnot_eq: str | Unset = UNSET, - filterenvironment_idsin: str | Unset = UNSET, - filterenvironment_idsnot_in: str | Unset = UNSET, - filterserviceseq: str | Unset = UNSET, - filterservicesnot_eq: str | Unset = UNSET, - filterservicesin: str | Unset = UNSET, - filterservicesnot_in: str | Unset = UNSET, - filterservice_idseq: str | Unset = UNSET, - filterservice_idsnot_eq: str | Unset = UNSET, - filterservice_idsin: str | Unset = UNSET, - filterservice_idsnot_in: str | Unset = UNSET, - filterservice_nameseq: str | Unset = UNSET, - filterservice_namesnot_eq: str | Unset = UNSET, - filterservice_namesin: str | Unset = UNSET, - filterservice_namesnot_in: str | Unset = UNSET, - filterfunctionalitieseq: str | Unset = UNSET, - filterfunctionalitiesnot_eq: str | Unset = UNSET, - filterfunctionalitiesin: str | Unset = UNSET, - filterfunctionalitiesnot_in: str | Unset = UNSET, - filterfunctionality_idseq: str | Unset = UNSET, - filterfunctionality_idsnot_eq: str | Unset = UNSET, - filterfunctionality_idsin: str | Unset = UNSET, - filterfunctionality_idsnot_in: str | Unset = UNSET, - filterfunctionality_nameseq: str | Unset = UNSET, - filterfunctionality_namesnot_eq: str | Unset = UNSET, - filterfunctionality_namesin: str | Unset = UNSET, - filterfunctionality_namesnot_in: str | Unset = UNSET, - filtercauseseq: str | Unset = UNSET, - filtercausesnot_eq: str | Unset = UNSET, - filtercausesin: str | Unset = UNSET, - filtercausesnot_in: str | Unset = UNSET, - filtercause_idseq: str | Unset = UNSET, - filtercause_idsnot_eq: str | Unset = UNSET, - filtercause_idsin: str | Unset = UNSET, - filtercause_idsnot_in: str | Unset = UNSET, - filterteamseq: str | Unset = UNSET, - filterteamsnot_eq: str | Unset = UNSET, - filterteamsin: str | Unset = UNSET, - filterteamsnot_in: str | Unset = UNSET, - filterteam_idseq: str | Unset = UNSET, - filterteam_idsnot_eq: str | Unset = UNSET, - filterteam_idsin: str | Unset = UNSET, - filterteam_idsnot_in: str | Unset = UNSET, - filterteam_nameseq: str | Unset = UNSET, - filterteam_namesnot_eq: str | Unset = UNSET, - filterteam_namesin: str | Unset = UNSET, - filterteam_namesnot_in: str | Unset = UNSET, - sort: ListIncidentsSort | Unset = UNSET, - include: ListIncidentsInclude | Unset = UNSET, -) -> Response[ErrorsList | IncidentList]: + pageafter: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filterkind: Union[Unset, str] = UNSET, + filterstatus: Union[Unset, str] = UNSET, + filterprivate: Union[Unset, str] = UNSET, + filteruser_id: Union[Unset, int] = UNSET, + filterseverity: Union[Unset, str] = UNSET, + filterseverity_id: Union[Unset, str] = UNSET, + filterlabels: Union[Unset, str] = UNSET, + filtertypes: Union[Unset, str] = UNSET, + filtertype_ids: Union[Unset, str] = UNSET, + filterenvironments: Union[Unset, str] = UNSET, + filterenvironment_ids: Union[Unset, str] = UNSET, + filterfunctionalities: Union[Unset, str] = UNSET, + filterfunctionality_ids: Union[Unset, str] = UNSET, + filterfunctionality_names: Union[Unset, str] = UNSET, + filterservices: Union[Unset, str] = UNSET, + filterservice_ids: Union[Unset, str] = UNSET, + filterservice_names: Union[Unset, str] = UNSET, + filterteams: Union[Unset, str] = UNSET, + filterteam_ids: Union[Unset, str] = UNSET, + filterteam_names: Union[Unset, str] = UNSET, + filtercause: Union[Unset, str] = UNSET, + filtercause_ids: Union[Unset, str] = UNSET, + filtercustom_field_selected_option_ids: Union[Unset, str] = UNSET, + filterslack_channel_id: Union[Unset, str] = UNSET, + filtersequential_id: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filterupdated_atgt: Union[Unset, str] = UNSET, + filterupdated_atgte: Union[Unset, str] = UNSET, + filterupdated_atlt: Union[Unset, str] = UNSET, + filterupdated_atlte: Union[Unset, str] = UNSET, + filterstarted_atgt: Union[Unset, str] = UNSET, + filterstarted_atgte: Union[Unset, str] = UNSET, + filterstarted_atlt: Union[Unset, str] = UNSET, + filterstarted_atlte: Union[Unset, str] = UNSET, + filterdetected_atgt: Union[Unset, str] = UNSET, + filterdetected_atgte: Union[Unset, str] = UNSET, + filterdetected_atlt: Union[Unset, str] = UNSET, + filterdetected_atlte: Union[Unset, str] = UNSET, + filteracknowledged_atgt: Union[Unset, str] = UNSET, + filteracknowledged_atgte: Union[Unset, str] = UNSET, + filteracknowledged_atlt: Union[Unset, str] = UNSET, + filteracknowledged_atlte: Union[Unset, str] = UNSET, + filtermitigated_atgt: Union[Unset, str] = UNSET, + filtermitigated_atgte: Union[Unset, str] = UNSET, + filtermitigated_atlt: Union[Unset, str] = UNSET, + filtermitigated_atlte: Union[Unset, str] = UNSET, + filterresolved_atgt: Union[Unset, str] = UNSET, + filterresolved_atgte: Union[Unset, str] = UNSET, + filterresolved_atlt: Union[Unset, str] = UNSET, + filterresolved_atlte: Union[Unset, str] = UNSET, + filterclosed_atgt: Union[Unset, str] = UNSET, + filterclosed_atgte: Union[Unset, str] = UNSET, + filterclosed_atlt: Union[Unset, str] = UNSET, + filterclosed_atlte: Union[Unset, str] = UNSET, + filterin_triage_atgt: Union[Unset, str] = UNSET, + filterin_triage_atgte: Union[Unset, str] = UNSET, + filterin_triage_atlt: Union[Unset, str] = UNSET, + filterin_triage_atlte: Union[Unset, str] = UNSET, + filterkindeq: Union[Unset, str] = UNSET, + filterkindnot_eq: Union[Unset, str] = UNSET, + filterkindin: Union[Unset, str] = UNSET, + filterkindnot_in: Union[Unset, str] = UNSET, + filterstatuseq: Union[Unset, str] = UNSET, + filterstatusnot_eq: Union[Unset, str] = UNSET, + filterstatusin: Union[Unset, str] = UNSET, + filterstatusnot_in: Union[Unset, str] = UNSET, + filterprivateeq: Union[Unset, str] = UNSET, + filterprivatenot_eq: Union[Unset, str] = UNSET, + filterprivatein: Union[Unset, str] = UNSET, + filterprivatenot_in: Union[Unset, str] = UNSET, + filteruser_ideq: Union[Unset, str] = UNSET, + filteruser_idnot_eq: Union[Unset, str] = UNSET, + filteruser_idin: Union[Unset, str] = UNSET, + filteruser_idnot_in: Union[Unset, str] = UNSET, + filterseverityeq: Union[Unset, str] = UNSET, + filterseveritynot_eq: Union[Unset, str] = UNSET, + filterseverityin: Union[Unset, str] = UNSET, + filterseveritynot_in: Union[Unset, str] = UNSET, + filterseverity_ideq: Union[Unset, str] = UNSET, + filterseverity_idnot_eq: Union[Unset, str] = UNSET, + filterseverity_idin: Union[Unset, str] = UNSET, + filterseverity_idnot_in: Union[Unset, str] = UNSET, + filterlabelseq: Union[Unset, str] = UNSET, + filterlabelsnot_eq: Union[Unset, str] = UNSET, + filterlabelsin: Union[Unset, str] = UNSET, + filterlabelsnot_in: Union[Unset, str] = UNSET, + filterzendesk_ticket_ideq: Union[Unset, str] = UNSET, + filterzendesk_ticket_idnot_eq: Union[Unset, str] = UNSET, + filterzendesk_ticket_idin: Union[Unset, str] = UNSET, + filterzendesk_ticket_idnot_in: Union[Unset, str] = UNSET, + filtersequential_ideq: Union[Unset, str] = UNSET, + filtersequential_idnot_eq: Union[Unset, str] = UNSET, + filtersequential_idin: Union[Unset, str] = UNSET, + filtersequential_idnot_in: Union[Unset, str] = UNSET, + filtertypeseq: Union[Unset, str] = UNSET, + filtertypesnot_eq: Union[Unset, str] = UNSET, + filtertypesin: Union[Unset, str] = UNSET, + filtertypesnot_in: Union[Unset, str] = UNSET, + filtertype_idseq: Union[Unset, str] = UNSET, + filtertype_idsnot_eq: Union[Unset, str] = UNSET, + filtertype_idsin: Union[Unset, str] = UNSET, + filtertype_idsnot_in: Union[Unset, str] = UNSET, + filterenvironmentseq: Union[Unset, str] = UNSET, + filterenvironmentsnot_eq: Union[Unset, str] = UNSET, + filterenvironmentsin: Union[Unset, str] = UNSET, + filterenvironmentsnot_in: Union[Unset, str] = UNSET, + filterenvironment_idseq: Union[Unset, str] = UNSET, + filterenvironment_idsnot_eq: Union[Unset, str] = UNSET, + filterenvironment_idsin: Union[Unset, str] = UNSET, + filterenvironment_idsnot_in: Union[Unset, str] = UNSET, + filterserviceseq: Union[Unset, str] = UNSET, + filterservicesnot_eq: Union[Unset, str] = UNSET, + filterservicesin: Union[Unset, str] = UNSET, + filterservicesnot_in: Union[Unset, str] = UNSET, + filterservice_idseq: Union[Unset, str] = UNSET, + filterservice_idsnot_eq: Union[Unset, str] = UNSET, + filterservice_idsin: Union[Unset, str] = UNSET, + filterservice_idsnot_in: Union[Unset, str] = UNSET, + filterservice_nameseq: Union[Unset, str] = UNSET, + filterservice_namesnot_eq: Union[Unset, str] = UNSET, + filterservice_namesin: Union[Unset, str] = UNSET, + filterservice_namesnot_in: Union[Unset, str] = UNSET, + filterfunctionalitieseq: Union[Unset, str] = UNSET, + filterfunctionalitiesnot_eq: Union[Unset, str] = UNSET, + filterfunctionalitiesin: Union[Unset, str] = UNSET, + filterfunctionalitiesnot_in: Union[Unset, str] = UNSET, + filterfunctionality_idseq: Union[Unset, str] = UNSET, + filterfunctionality_idsnot_eq: Union[Unset, str] = UNSET, + filterfunctionality_idsin: Union[Unset, str] = UNSET, + filterfunctionality_idsnot_in: Union[Unset, str] = UNSET, + filterfunctionality_nameseq: Union[Unset, str] = UNSET, + filterfunctionality_namesnot_eq: Union[Unset, str] = UNSET, + filterfunctionality_namesin: Union[Unset, str] = UNSET, + filterfunctionality_namesnot_in: Union[Unset, str] = UNSET, + filtercauseseq: Union[Unset, str] = UNSET, + filtercausesnot_eq: Union[Unset, str] = UNSET, + filtercausesin: Union[Unset, str] = UNSET, + filtercausesnot_in: Union[Unset, str] = UNSET, + filtercause_idseq: Union[Unset, str] = UNSET, + filtercause_idsnot_eq: Union[Unset, str] = UNSET, + filtercause_idsin: Union[Unset, str] = UNSET, + filtercause_idsnot_in: Union[Unset, str] = UNSET, + filterteamseq: Union[Unset, str] = UNSET, + filterteamsnot_eq: Union[Unset, str] = UNSET, + filterteamsin: Union[Unset, str] = UNSET, + filterteamsnot_in: Union[Unset, str] = UNSET, + filterteam_idseq: Union[Unset, str] = UNSET, + filterteam_idsnot_eq: Union[Unset, str] = UNSET, + filterteam_idsin: Union[Unset, str] = UNSET, + filterteam_idsnot_in: Union[Unset, str] = UNSET, + filterteam_nameseq: Union[Unset, str] = UNSET, + filterteam_namesnot_eq: Union[Unset, str] = UNSET, + filterteam_namesin: Union[Unset, str] = UNSET, + filterteam_namesnot_in: Union[Unset, str] = UNSET, + sort: Union[Unset, ListIncidentsSort] = UNSET, + include: Union[Unset, ListIncidentsInclude] = UNSET, +) -> Response[Union[ErrorsList, IncidentList]]: """List incidents List incidents Args: - pageafter (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterkind (str | Unset): - filterstatus (str | Unset): - filterprivate (str | Unset): - filteruser_id (int | Unset): - filterseverity (str | Unset): - filterseverity_id (str | Unset): - filterlabels (str | Unset): - filtertypes (str | Unset): - filtertype_ids (str | Unset): - filterenvironments (str | Unset): - filterenvironment_ids (str | Unset): - filterfunctionalities (str | Unset): - filterfunctionality_ids (str | Unset): - filterfunctionality_names (str | Unset): - filterservices (str | Unset): - filterservice_ids (str | Unset): - filterservice_names (str | Unset): - filterteams (str | Unset): - filterteam_ids (str | Unset): - filterteam_names (str | Unset): - filtercause (str | Unset): - filtercause_ids (str | Unset): - filtercustom_field_selected_option_ids (str | Unset): - filterslack_channel_id (str | Unset): - filtersequential_id (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterupdated_atgt (str | Unset): - filterupdated_atgte (str | Unset): - filterupdated_atlt (str | Unset): - filterupdated_atlte (str | Unset): - filterstarted_atgt (str | Unset): - filterstarted_atgte (str | Unset): - filterstarted_atlt (str | Unset): - filterstarted_atlte (str | Unset): - filterdetected_atgt (str | Unset): - filterdetected_atgte (str | Unset): - filterdetected_atlt (str | Unset): - filterdetected_atlte (str | Unset): - filteracknowledged_atgt (str | Unset): - filteracknowledged_atgte (str | Unset): - filteracknowledged_atlt (str | Unset): - filteracknowledged_atlte (str | Unset): - filtermitigated_atgt (str | Unset): - filtermitigated_atgte (str | Unset): - filtermitigated_atlt (str | Unset): - filtermitigated_atlte (str | Unset): - filterresolved_atgt (str | Unset): - filterresolved_atgte (str | Unset): - filterresolved_atlt (str | Unset): - filterresolved_atlte (str | Unset): - filterclosed_atgt (str | Unset): - filterclosed_atgte (str | Unset): - filterclosed_atlt (str | Unset): - filterclosed_atlte (str | Unset): - filterin_triage_atgt (str | Unset): - filterin_triage_atgte (str | Unset): - filterin_triage_atlt (str | Unset): - filterin_triage_atlte (str | Unset): - filterkindeq (str | Unset): - filterkindnot_eq (str | Unset): - filterkindin (str | Unset): - filterkindnot_in (str | Unset): - filterstatuseq (str | Unset): - filterstatusnot_eq (str | Unset): - filterstatusin (str | Unset): - filterstatusnot_in (str | Unset): - filterprivateeq (str | Unset): - filterprivatenot_eq (str | Unset): - filterprivatein (str | Unset): - filterprivatenot_in (str | Unset): - filteruser_ideq (str | Unset): - filteruser_idnot_eq (str | Unset): - filteruser_idin (str | Unset): - filteruser_idnot_in (str | Unset): - filterseverityeq (str | Unset): - filterseveritynot_eq (str | Unset): - filterseverityin (str | Unset): - filterseveritynot_in (str | Unset): - filterseverity_ideq (str | Unset): - filterseverity_idnot_eq (str | Unset): - filterseverity_idin (str | Unset): - filterseverity_idnot_in (str | Unset): - filterlabelseq (str | Unset): - filterlabelsnot_eq (str | Unset): - filterlabelsin (str | Unset): - filterlabelsnot_in (str | Unset): - filterzendesk_ticket_ideq (str | Unset): - filterzendesk_ticket_idnot_eq (str | Unset): - filterzendesk_ticket_idin (str | Unset): - filterzendesk_ticket_idnot_in (str | Unset): - filtersequential_ideq (str | Unset): - filtersequential_idnot_eq (str | Unset): - filtersequential_idin (str | Unset): - filtersequential_idnot_in (str | Unset): - filtertypeseq (str | Unset): - filtertypesnot_eq (str | Unset): - filtertypesin (str | Unset): - filtertypesnot_in (str | Unset): - filtertype_idseq (str | Unset): - filtertype_idsnot_eq (str | Unset): - filtertype_idsin (str | Unset): - filtertype_idsnot_in (str | Unset): - filterenvironmentseq (str | Unset): - filterenvironmentsnot_eq (str | Unset): - filterenvironmentsin (str | Unset): - filterenvironmentsnot_in (str | Unset): - filterenvironment_idseq (str | Unset): - filterenvironment_idsnot_eq (str | Unset): - filterenvironment_idsin (str | Unset): - filterenvironment_idsnot_in (str | Unset): - filterserviceseq (str | Unset): - filterservicesnot_eq (str | Unset): - filterservicesin (str | Unset): - filterservicesnot_in (str | Unset): - filterservice_idseq (str | Unset): - filterservice_idsnot_eq (str | Unset): - filterservice_idsin (str | Unset): - filterservice_idsnot_in (str | Unset): - filterservice_nameseq (str | Unset): - filterservice_namesnot_eq (str | Unset): - filterservice_namesin (str | Unset): - filterservice_namesnot_in (str | Unset): - filterfunctionalitieseq (str | Unset): - filterfunctionalitiesnot_eq (str | Unset): - filterfunctionalitiesin (str | Unset): - filterfunctionalitiesnot_in (str | Unset): - filterfunctionality_idseq (str | Unset): - filterfunctionality_idsnot_eq (str | Unset): - filterfunctionality_idsin (str | Unset): - filterfunctionality_idsnot_in (str | Unset): - filterfunctionality_nameseq (str | Unset): - filterfunctionality_namesnot_eq (str | Unset): - filterfunctionality_namesin (str | Unset): - filterfunctionality_namesnot_in (str | Unset): - filtercauseseq (str | Unset): - filtercausesnot_eq (str | Unset): - filtercausesin (str | Unset): - filtercausesnot_in (str | Unset): - filtercause_idseq (str | Unset): - filtercause_idsnot_eq (str | Unset): - filtercause_idsin (str | Unset): - filtercause_idsnot_in (str | Unset): - filterteamseq (str | Unset): - filterteamsnot_eq (str | Unset): - filterteamsin (str | Unset): - filterteamsnot_in (str | Unset): - filterteam_idseq (str | Unset): - filterteam_idsnot_eq (str | Unset): - filterteam_idsin (str | Unset): - filterteam_idsnot_in (str | Unset): - filterteam_nameseq (str | Unset): - filterteam_namesnot_eq (str | Unset): - filterteam_namesin (str | Unset): - filterteam_namesnot_in (str | Unset): - sort (ListIncidentsSort | Unset): - include (ListIncidentsInclude | Unset): + pageafter (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterkind (Union[Unset, str]): + filterstatus (Union[Unset, str]): + filterprivate (Union[Unset, str]): + filteruser_id (Union[Unset, int]): + filterseverity (Union[Unset, str]): + filterseverity_id (Union[Unset, str]): + filterlabels (Union[Unset, str]): + filtertypes (Union[Unset, str]): + filtertype_ids (Union[Unset, str]): + filterenvironments (Union[Unset, str]): + filterenvironment_ids (Union[Unset, str]): + filterfunctionalities (Union[Unset, str]): + filterfunctionality_ids (Union[Unset, str]): + filterfunctionality_names (Union[Unset, str]): + filterservices (Union[Unset, str]): + filterservice_ids (Union[Unset, str]): + filterservice_names (Union[Unset, str]): + filterteams (Union[Unset, str]): + filterteam_ids (Union[Unset, str]): + filterteam_names (Union[Unset, str]): + filtercause (Union[Unset, str]): + filtercause_ids (Union[Unset, str]): + filtercustom_field_selected_option_ids (Union[Unset, str]): + filterslack_channel_id (Union[Unset, str]): + filtersequential_id (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterupdated_atgt (Union[Unset, str]): + filterupdated_atgte (Union[Unset, str]): + filterupdated_atlt (Union[Unset, str]): + filterupdated_atlte (Union[Unset, str]): + filterstarted_atgt (Union[Unset, str]): + filterstarted_atgte (Union[Unset, str]): + filterstarted_atlt (Union[Unset, str]): + filterstarted_atlte (Union[Unset, str]): + filterdetected_atgt (Union[Unset, str]): + filterdetected_atgte (Union[Unset, str]): + filterdetected_atlt (Union[Unset, str]): + filterdetected_atlte (Union[Unset, str]): + filteracknowledged_atgt (Union[Unset, str]): + filteracknowledged_atgte (Union[Unset, str]): + filteracknowledged_atlt (Union[Unset, str]): + filteracknowledged_atlte (Union[Unset, str]): + filtermitigated_atgt (Union[Unset, str]): + filtermitigated_atgte (Union[Unset, str]): + filtermitigated_atlt (Union[Unset, str]): + filtermitigated_atlte (Union[Unset, str]): + filterresolved_atgt (Union[Unset, str]): + filterresolved_atgte (Union[Unset, str]): + filterresolved_atlt (Union[Unset, str]): + filterresolved_atlte (Union[Unset, str]): + filterclosed_atgt (Union[Unset, str]): + filterclosed_atgte (Union[Unset, str]): + filterclosed_atlt (Union[Unset, str]): + filterclosed_atlte (Union[Unset, str]): + filterin_triage_atgt (Union[Unset, str]): + filterin_triage_atgte (Union[Unset, str]): + filterin_triage_atlt (Union[Unset, str]): + filterin_triage_atlte (Union[Unset, str]): + filterkindeq (Union[Unset, str]): + filterkindnot_eq (Union[Unset, str]): + filterkindin (Union[Unset, str]): + filterkindnot_in (Union[Unset, str]): + filterstatuseq (Union[Unset, str]): + filterstatusnot_eq (Union[Unset, str]): + filterstatusin (Union[Unset, str]): + filterstatusnot_in (Union[Unset, str]): + filterprivateeq (Union[Unset, str]): + filterprivatenot_eq (Union[Unset, str]): + filterprivatein (Union[Unset, str]): + filterprivatenot_in (Union[Unset, str]): + filteruser_ideq (Union[Unset, str]): + filteruser_idnot_eq (Union[Unset, str]): + filteruser_idin (Union[Unset, str]): + filteruser_idnot_in (Union[Unset, str]): + filterseverityeq (Union[Unset, str]): + filterseveritynot_eq (Union[Unset, str]): + filterseverityin (Union[Unset, str]): + filterseveritynot_in (Union[Unset, str]): + filterseverity_ideq (Union[Unset, str]): + filterseverity_idnot_eq (Union[Unset, str]): + filterseverity_idin (Union[Unset, str]): + filterseverity_idnot_in (Union[Unset, str]): + filterlabelseq (Union[Unset, str]): + filterlabelsnot_eq (Union[Unset, str]): + filterlabelsin (Union[Unset, str]): + filterlabelsnot_in (Union[Unset, str]): + filterzendesk_ticket_ideq (Union[Unset, str]): + filterzendesk_ticket_idnot_eq (Union[Unset, str]): + filterzendesk_ticket_idin (Union[Unset, str]): + filterzendesk_ticket_idnot_in (Union[Unset, str]): + filtersequential_ideq (Union[Unset, str]): + filtersequential_idnot_eq (Union[Unset, str]): + filtersequential_idin (Union[Unset, str]): + filtersequential_idnot_in (Union[Unset, str]): + filtertypeseq (Union[Unset, str]): + filtertypesnot_eq (Union[Unset, str]): + filtertypesin (Union[Unset, str]): + filtertypesnot_in (Union[Unset, str]): + filtertype_idseq (Union[Unset, str]): + filtertype_idsnot_eq (Union[Unset, str]): + filtertype_idsin (Union[Unset, str]): + filtertype_idsnot_in (Union[Unset, str]): + filterenvironmentseq (Union[Unset, str]): + filterenvironmentsnot_eq (Union[Unset, str]): + filterenvironmentsin (Union[Unset, str]): + filterenvironmentsnot_in (Union[Unset, str]): + filterenvironment_idseq (Union[Unset, str]): + filterenvironment_idsnot_eq (Union[Unset, str]): + filterenvironment_idsin (Union[Unset, str]): + filterenvironment_idsnot_in (Union[Unset, str]): + filterserviceseq (Union[Unset, str]): + filterservicesnot_eq (Union[Unset, str]): + filterservicesin (Union[Unset, str]): + filterservicesnot_in (Union[Unset, str]): + filterservice_idseq (Union[Unset, str]): + filterservice_idsnot_eq (Union[Unset, str]): + filterservice_idsin (Union[Unset, str]): + filterservice_idsnot_in (Union[Unset, str]): + filterservice_nameseq (Union[Unset, str]): + filterservice_namesnot_eq (Union[Unset, str]): + filterservice_namesin (Union[Unset, str]): + filterservice_namesnot_in (Union[Unset, str]): + filterfunctionalitieseq (Union[Unset, str]): + filterfunctionalitiesnot_eq (Union[Unset, str]): + filterfunctionalitiesin (Union[Unset, str]): + filterfunctionalitiesnot_in (Union[Unset, str]): + filterfunctionality_idseq (Union[Unset, str]): + filterfunctionality_idsnot_eq (Union[Unset, str]): + filterfunctionality_idsin (Union[Unset, str]): + filterfunctionality_idsnot_in (Union[Unset, str]): + filterfunctionality_nameseq (Union[Unset, str]): + filterfunctionality_namesnot_eq (Union[Unset, str]): + filterfunctionality_namesin (Union[Unset, str]): + filterfunctionality_namesnot_in (Union[Unset, str]): + filtercauseseq (Union[Unset, str]): + filtercausesnot_eq (Union[Unset, str]): + filtercausesin (Union[Unset, str]): + filtercausesnot_in (Union[Unset, str]): + filtercause_idseq (Union[Unset, str]): + filtercause_idsnot_eq (Union[Unset, str]): + filtercause_idsin (Union[Unset, str]): + filtercause_idsnot_in (Union[Unset, str]): + filterteamseq (Union[Unset, str]): + filterteamsnot_eq (Union[Unset, str]): + filterteamsin (Union[Unset, str]): + filterteamsnot_in (Union[Unset, str]): + filterteam_idseq (Union[Unset, str]): + filterteam_idsnot_eq (Union[Unset, str]): + filterteam_idsin (Union[Unset, str]): + filterteam_idsnot_in (Union[Unset, str]): + filterteam_nameseq (Union[Unset, str]): + filterteam_namesnot_eq (Union[Unset, str]): + filterteam_namesin (Union[Unset, str]): + filterteam_namesnot_in (Union[Unset, str]): + sort (Union[Unset, ListIncidentsSort]): + include (Union[Unset, ListIncidentsInclude]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentList] + Response[Union[ErrorsList, IncidentList]] """ kwargs = _get_kwargs( @@ -2103,345 +2102,345 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - pageafter: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filterstatus: str | Unset = UNSET, - filterprivate: str | Unset = UNSET, - filteruser_id: int | Unset = UNSET, - filterseverity: str | Unset = UNSET, - filterseverity_id: str | Unset = UNSET, - filterlabels: str | Unset = UNSET, - filtertypes: str | Unset = UNSET, - filtertype_ids: str | Unset = UNSET, - filterenvironments: str | Unset = UNSET, - filterenvironment_ids: str | Unset = UNSET, - filterfunctionalities: str | Unset = UNSET, - filterfunctionality_ids: str | Unset = UNSET, - filterfunctionality_names: str | Unset = UNSET, - filterservices: str | Unset = UNSET, - filterservice_ids: str | Unset = UNSET, - filterservice_names: str | Unset = UNSET, - filterteams: str | Unset = UNSET, - filterteam_ids: str | Unset = UNSET, - filterteam_names: str | Unset = UNSET, - filtercause: str | Unset = UNSET, - filtercause_ids: str | Unset = UNSET, - filtercustom_field_selected_option_ids: str | Unset = UNSET, - filterslack_channel_id: str | Unset = UNSET, - filtersequential_id: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterupdated_atgt: str | Unset = UNSET, - filterupdated_atgte: str | Unset = UNSET, - filterupdated_atlt: str | Unset = UNSET, - filterupdated_atlte: str | Unset = UNSET, - filterstarted_atgt: str | Unset = UNSET, - filterstarted_atgte: str | Unset = UNSET, - filterstarted_atlt: str | Unset = UNSET, - filterstarted_atlte: str | Unset = UNSET, - filterdetected_atgt: str | Unset = UNSET, - filterdetected_atgte: str | Unset = UNSET, - filterdetected_atlt: str | Unset = UNSET, - filterdetected_atlte: str | Unset = UNSET, - filteracknowledged_atgt: str | Unset = UNSET, - filteracknowledged_atgte: str | Unset = UNSET, - filteracknowledged_atlt: str | Unset = UNSET, - filteracknowledged_atlte: str | Unset = UNSET, - filtermitigated_atgt: str | Unset = UNSET, - filtermitigated_atgte: str | Unset = UNSET, - filtermitigated_atlt: str | Unset = UNSET, - filtermitigated_atlte: str | Unset = UNSET, - filterresolved_atgt: str | Unset = UNSET, - filterresolved_atgte: str | Unset = UNSET, - filterresolved_atlt: str | Unset = UNSET, - filterresolved_atlte: str | Unset = UNSET, - filterclosed_atgt: str | Unset = UNSET, - filterclosed_atgte: str | Unset = UNSET, - filterclosed_atlt: str | Unset = UNSET, - filterclosed_atlte: str | Unset = UNSET, - filterin_triage_atgt: str | Unset = UNSET, - filterin_triage_atgte: str | Unset = UNSET, - filterin_triage_atlt: str | Unset = UNSET, - filterin_triage_atlte: str | Unset = UNSET, - filterkindeq: str | Unset = UNSET, - filterkindnot_eq: str | Unset = UNSET, - filterkindin: str | Unset = UNSET, - filterkindnot_in: str | Unset = UNSET, - filterstatuseq: str | Unset = UNSET, - filterstatusnot_eq: str | Unset = UNSET, - filterstatusin: str | Unset = UNSET, - filterstatusnot_in: str | Unset = UNSET, - filterprivateeq: str | Unset = UNSET, - filterprivatenot_eq: str | Unset = UNSET, - filterprivatein: str | Unset = UNSET, - filterprivatenot_in: str | Unset = UNSET, - filteruser_ideq: str | Unset = UNSET, - filteruser_idnot_eq: str | Unset = UNSET, - filteruser_idin: str | Unset = UNSET, - filteruser_idnot_in: str | Unset = UNSET, - filterseverityeq: str | Unset = UNSET, - filterseveritynot_eq: str | Unset = UNSET, - filterseverityin: str | Unset = UNSET, - filterseveritynot_in: str | Unset = UNSET, - filterseverity_ideq: str | Unset = UNSET, - filterseverity_idnot_eq: str | Unset = UNSET, - filterseverity_idin: str | Unset = UNSET, - filterseverity_idnot_in: str | Unset = UNSET, - filterlabelseq: str | Unset = UNSET, - filterlabelsnot_eq: str | Unset = UNSET, - filterlabelsin: str | Unset = UNSET, - filterlabelsnot_in: str | Unset = UNSET, - filterzendesk_ticket_ideq: str | Unset = UNSET, - filterzendesk_ticket_idnot_eq: str | Unset = UNSET, - filterzendesk_ticket_idin: str | Unset = UNSET, - filterzendesk_ticket_idnot_in: str | Unset = UNSET, - filtersequential_ideq: str | Unset = UNSET, - filtersequential_idnot_eq: str | Unset = UNSET, - filtersequential_idin: str | Unset = UNSET, - filtersequential_idnot_in: str | Unset = UNSET, - filtertypeseq: str | Unset = UNSET, - filtertypesnot_eq: str | Unset = UNSET, - filtertypesin: str | Unset = UNSET, - filtertypesnot_in: str | Unset = UNSET, - filtertype_idseq: str | Unset = UNSET, - filtertype_idsnot_eq: str | Unset = UNSET, - filtertype_idsin: str | Unset = UNSET, - filtertype_idsnot_in: str | Unset = UNSET, - filterenvironmentseq: str | Unset = UNSET, - filterenvironmentsnot_eq: str | Unset = UNSET, - filterenvironmentsin: str | Unset = UNSET, - filterenvironmentsnot_in: str | Unset = UNSET, - filterenvironment_idseq: str | Unset = UNSET, - filterenvironment_idsnot_eq: str | Unset = UNSET, - filterenvironment_idsin: str | Unset = UNSET, - filterenvironment_idsnot_in: str | Unset = UNSET, - filterserviceseq: str | Unset = UNSET, - filterservicesnot_eq: str | Unset = UNSET, - filterservicesin: str | Unset = UNSET, - filterservicesnot_in: str | Unset = UNSET, - filterservice_idseq: str | Unset = UNSET, - filterservice_idsnot_eq: str | Unset = UNSET, - filterservice_idsin: str | Unset = UNSET, - filterservice_idsnot_in: str | Unset = UNSET, - filterservice_nameseq: str | Unset = UNSET, - filterservice_namesnot_eq: str | Unset = UNSET, - filterservice_namesin: str | Unset = UNSET, - filterservice_namesnot_in: str | Unset = UNSET, - filterfunctionalitieseq: str | Unset = UNSET, - filterfunctionalitiesnot_eq: str | Unset = UNSET, - filterfunctionalitiesin: str | Unset = UNSET, - filterfunctionalitiesnot_in: str | Unset = UNSET, - filterfunctionality_idseq: str | Unset = UNSET, - filterfunctionality_idsnot_eq: str | Unset = UNSET, - filterfunctionality_idsin: str | Unset = UNSET, - filterfunctionality_idsnot_in: str | Unset = UNSET, - filterfunctionality_nameseq: str | Unset = UNSET, - filterfunctionality_namesnot_eq: str | Unset = UNSET, - filterfunctionality_namesin: str | Unset = UNSET, - filterfunctionality_namesnot_in: str | Unset = UNSET, - filtercauseseq: str | Unset = UNSET, - filtercausesnot_eq: str | Unset = UNSET, - filtercausesin: str | Unset = UNSET, - filtercausesnot_in: str | Unset = UNSET, - filtercause_idseq: str | Unset = UNSET, - filtercause_idsnot_eq: str | Unset = UNSET, - filtercause_idsin: str | Unset = UNSET, - filtercause_idsnot_in: str | Unset = UNSET, - filterteamseq: str | Unset = UNSET, - filterteamsnot_eq: str | Unset = UNSET, - filterteamsin: str | Unset = UNSET, - filterteamsnot_in: str | Unset = UNSET, - filterteam_idseq: str | Unset = UNSET, - filterteam_idsnot_eq: str | Unset = UNSET, - filterteam_idsin: str | Unset = UNSET, - filterteam_idsnot_in: str | Unset = UNSET, - filterteam_nameseq: str | Unset = UNSET, - filterteam_namesnot_eq: str | Unset = UNSET, - filterteam_namesin: str | Unset = UNSET, - filterteam_namesnot_in: str | Unset = UNSET, - sort: ListIncidentsSort | Unset = UNSET, - include: ListIncidentsInclude | Unset = UNSET, -) -> ErrorsList | IncidentList | None: + pageafter: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filterkind: Union[Unset, str] = UNSET, + filterstatus: Union[Unset, str] = UNSET, + filterprivate: Union[Unset, str] = UNSET, + filteruser_id: Union[Unset, int] = UNSET, + filterseverity: Union[Unset, str] = UNSET, + filterseverity_id: Union[Unset, str] = UNSET, + filterlabels: Union[Unset, str] = UNSET, + filtertypes: Union[Unset, str] = UNSET, + filtertype_ids: Union[Unset, str] = UNSET, + filterenvironments: Union[Unset, str] = UNSET, + filterenvironment_ids: Union[Unset, str] = UNSET, + filterfunctionalities: Union[Unset, str] = UNSET, + filterfunctionality_ids: Union[Unset, str] = UNSET, + filterfunctionality_names: Union[Unset, str] = UNSET, + filterservices: Union[Unset, str] = UNSET, + filterservice_ids: Union[Unset, str] = UNSET, + filterservice_names: Union[Unset, str] = UNSET, + filterteams: Union[Unset, str] = UNSET, + filterteam_ids: Union[Unset, str] = UNSET, + filterteam_names: Union[Unset, str] = UNSET, + filtercause: Union[Unset, str] = UNSET, + filtercause_ids: Union[Unset, str] = UNSET, + filtercustom_field_selected_option_ids: Union[Unset, str] = UNSET, + filterslack_channel_id: Union[Unset, str] = UNSET, + filtersequential_id: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filterupdated_atgt: Union[Unset, str] = UNSET, + filterupdated_atgte: Union[Unset, str] = UNSET, + filterupdated_atlt: Union[Unset, str] = UNSET, + filterupdated_atlte: Union[Unset, str] = UNSET, + filterstarted_atgt: Union[Unset, str] = UNSET, + filterstarted_atgte: Union[Unset, str] = UNSET, + filterstarted_atlt: Union[Unset, str] = UNSET, + filterstarted_atlte: Union[Unset, str] = UNSET, + filterdetected_atgt: Union[Unset, str] = UNSET, + filterdetected_atgte: Union[Unset, str] = UNSET, + filterdetected_atlt: Union[Unset, str] = UNSET, + filterdetected_atlte: Union[Unset, str] = UNSET, + filteracknowledged_atgt: Union[Unset, str] = UNSET, + filteracknowledged_atgte: Union[Unset, str] = UNSET, + filteracknowledged_atlt: Union[Unset, str] = UNSET, + filteracknowledged_atlte: Union[Unset, str] = UNSET, + filtermitigated_atgt: Union[Unset, str] = UNSET, + filtermitigated_atgte: Union[Unset, str] = UNSET, + filtermitigated_atlt: Union[Unset, str] = UNSET, + filtermitigated_atlte: Union[Unset, str] = UNSET, + filterresolved_atgt: Union[Unset, str] = UNSET, + filterresolved_atgte: Union[Unset, str] = UNSET, + filterresolved_atlt: Union[Unset, str] = UNSET, + filterresolved_atlte: Union[Unset, str] = UNSET, + filterclosed_atgt: Union[Unset, str] = UNSET, + filterclosed_atgte: Union[Unset, str] = UNSET, + filterclosed_atlt: Union[Unset, str] = UNSET, + filterclosed_atlte: Union[Unset, str] = UNSET, + filterin_triage_atgt: Union[Unset, str] = UNSET, + filterin_triage_atgte: Union[Unset, str] = UNSET, + filterin_triage_atlt: Union[Unset, str] = UNSET, + filterin_triage_atlte: Union[Unset, str] = UNSET, + filterkindeq: Union[Unset, str] = UNSET, + filterkindnot_eq: Union[Unset, str] = UNSET, + filterkindin: Union[Unset, str] = UNSET, + filterkindnot_in: Union[Unset, str] = UNSET, + filterstatuseq: Union[Unset, str] = UNSET, + filterstatusnot_eq: Union[Unset, str] = UNSET, + filterstatusin: Union[Unset, str] = UNSET, + filterstatusnot_in: Union[Unset, str] = UNSET, + filterprivateeq: Union[Unset, str] = UNSET, + filterprivatenot_eq: Union[Unset, str] = UNSET, + filterprivatein: Union[Unset, str] = UNSET, + filterprivatenot_in: Union[Unset, str] = UNSET, + filteruser_ideq: Union[Unset, str] = UNSET, + filteruser_idnot_eq: Union[Unset, str] = UNSET, + filteruser_idin: Union[Unset, str] = UNSET, + filteruser_idnot_in: Union[Unset, str] = UNSET, + filterseverityeq: Union[Unset, str] = UNSET, + filterseveritynot_eq: Union[Unset, str] = UNSET, + filterseverityin: Union[Unset, str] = UNSET, + filterseveritynot_in: Union[Unset, str] = UNSET, + filterseverity_ideq: Union[Unset, str] = UNSET, + filterseverity_idnot_eq: Union[Unset, str] = UNSET, + filterseverity_idin: Union[Unset, str] = UNSET, + filterseverity_idnot_in: Union[Unset, str] = UNSET, + filterlabelseq: Union[Unset, str] = UNSET, + filterlabelsnot_eq: Union[Unset, str] = UNSET, + filterlabelsin: Union[Unset, str] = UNSET, + filterlabelsnot_in: Union[Unset, str] = UNSET, + filterzendesk_ticket_ideq: Union[Unset, str] = UNSET, + filterzendesk_ticket_idnot_eq: Union[Unset, str] = UNSET, + filterzendesk_ticket_idin: Union[Unset, str] = UNSET, + filterzendesk_ticket_idnot_in: Union[Unset, str] = UNSET, + filtersequential_ideq: Union[Unset, str] = UNSET, + filtersequential_idnot_eq: Union[Unset, str] = UNSET, + filtersequential_idin: Union[Unset, str] = UNSET, + filtersequential_idnot_in: Union[Unset, str] = UNSET, + filtertypeseq: Union[Unset, str] = UNSET, + filtertypesnot_eq: Union[Unset, str] = UNSET, + filtertypesin: Union[Unset, str] = UNSET, + filtertypesnot_in: Union[Unset, str] = UNSET, + filtertype_idseq: Union[Unset, str] = UNSET, + filtertype_idsnot_eq: Union[Unset, str] = UNSET, + filtertype_idsin: Union[Unset, str] = UNSET, + filtertype_idsnot_in: Union[Unset, str] = UNSET, + filterenvironmentseq: Union[Unset, str] = UNSET, + filterenvironmentsnot_eq: Union[Unset, str] = UNSET, + filterenvironmentsin: Union[Unset, str] = UNSET, + filterenvironmentsnot_in: Union[Unset, str] = UNSET, + filterenvironment_idseq: Union[Unset, str] = UNSET, + filterenvironment_idsnot_eq: Union[Unset, str] = UNSET, + filterenvironment_idsin: Union[Unset, str] = UNSET, + filterenvironment_idsnot_in: Union[Unset, str] = UNSET, + filterserviceseq: Union[Unset, str] = UNSET, + filterservicesnot_eq: Union[Unset, str] = UNSET, + filterservicesin: Union[Unset, str] = UNSET, + filterservicesnot_in: Union[Unset, str] = UNSET, + filterservice_idseq: Union[Unset, str] = UNSET, + filterservice_idsnot_eq: Union[Unset, str] = UNSET, + filterservice_idsin: Union[Unset, str] = UNSET, + filterservice_idsnot_in: Union[Unset, str] = UNSET, + filterservice_nameseq: Union[Unset, str] = UNSET, + filterservice_namesnot_eq: Union[Unset, str] = UNSET, + filterservice_namesin: Union[Unset, str] = UNSET, + filterservice_namesnot_in: Union[Unset, str] = UNSET, + filterfunctionalitieseq: Union[Unset, str] = UNSET, + filterfunctionalitiesnot_eq: Union[Unset, str] = UNSET, + filterfunctionalitiesin: Union[Unset, str] = UNSET, + filterfunctionalitiesnot_in: Union[Unset, str] = UNSET, + filterfunctionality_idseq: Union[Unset, str] = UNSET, + filterfunctionality_idsnot_eq: Union[Unset, str] = UNSET, + filterfunctionality_idsin: Union[Unset, str] = UNSET, + filterfunctionality_idsnot_in: Union[Unset, str] = UNSET, + filterfunctionality_nameseq: Union[Unset, str] = UNSET, + filterfunctionality_namesnot_eq: Union[Unset, str] = UNSET, + filterfunctionality_namesin: Union[Unset, str] = UNSET, + filterfunctionality_namesnot_in: Union[Unset, str] = UNSET, + filtercauseseq: Union[Unset, str] = UNSET, + filtercausesnot_eq: Union[Unset, str] = UNSET, + filtercausesin: Union[Unset, str] = UNSET, + filtercausesnot_in: Union[Unset, str] = UNSET, + filtercause_idseq: Union[Unset, str] = UNSET, + filtercause_idsnot_eq: Union[Unset, str] = UNSET, + filtercause_idsin: Union[Unset, str] = UNSET, + filtercause_idsnot_in: Union[Unset, str] = UNSET, + filterteamseq: Union[Unset, str] = UNSET, + filterteamsnot_eq: Union[Unset, str] = UNSET, + filterteamsin: Union[Unset, str] = UNSET, + filterteamsnot_in: Union[Unset, str] = UNSET, + filterteam_idseq: Union[Unset, str] = UNSET, + filterteam_idsnot_eq: Union[Unset, str] = UNSET, + filterteam_idsin: Union[Unset, str] = UNSET, + filterteam_idsnot_in: Union[Unset, str] = UNSET, + filterteam_nameseq: Union[Unset, str] = UNSET, + filterteam_namesnot_eq: Union[Unset, str] = UNSET, + filterteam_namesin: Union[Unset, str] = UNSET, + filterteam_namesnot_in: Union[Unset, str] = UNSET, + sort: Union[Unset, ListIncidentsSort] = UNSET, + include: Union[Unset, ListIncidentsInclude] = UNSET, +) -> Optional[Union[ErrorsList, IncidentList]]: """List incidents List incidents Args: - pageafter (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterkind (str | Unset): - filterstatus (str | Unset): - filterprivate (str | Unset): - filteruser_id (int | Unset): - filterseverity (str | Unset): - filterseverity_id (str | Unset): - filterlabels (str | Unset): - filtertypes (str | Unset): - filtertype_ids (str | Unset): - filterenvironments (str | Unset): - filterenvironment_ids (str | Unset): - filterfunctionalities (str | Unset): - filterfunctionality_ids (str | Unset): - filterfunctionality_names (str | Unset): - filterservices (str | Unset): - filterservice_ids (str | Unset): - filterservice_names (str | Unset): - filterteams (str | Unset): - filterteam_ids (str | Unset): - filterteam_names (str | Unset): - filtercause (str | Unset): - filtercause_ids (str | Unset): - filtercustom_field_selected_option_ids (str | Unset): - filterslack_channel_id (str | Unset): - filtersequential_id (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterupdated_atgt (str | Unset): - filterupdated_atgte (str | Unset): - filterupdated_atlt (str | Unset): - filterupdated_atlte (str | Unset): - filterstarted_atgt (str | Unset): - filterstarted_atgte (str | Unset): - filterstarted_atlt (str | Unset): - filterstarted_atlte (str | Unset): - filterdetected_atgt (str | Unset): - filterdetected_atgte (str | Unset): - filterdetected_atlt (str | Unset): - filterdetected_atlte (str | Unset): - filteracknowledged_atgt (str | Unset): - filteracknowledged_atgte (str | Unset): - filteracknowledged_atlt (str | Unset): - filteracknowledged_atlte (str | Unset): - filtermitigated_atgt (str | Unset): - filtermitigated_atgte (str | Unset): - filtermitigated_atlt (str | Unset): - filtermitigated_atlte (str | Unset): - filterresolved_atgt (str | Unset): - filterresolved_atgte (str | Unset): - filterresolved_atlt (str | Unset): - filterresolved_atlte (str | Unset): - filterclosed_atgt (str | Unset): - filterclosed_atgte (str | Unset): - filterclosed_atlt (str | Unset): - filterclosed_atlte (str | Unset): - filterin_triage_atgt (str | Unset): - filterin_triage_atgte (str | Unset): - filterin_triage_atlt (str | Unset): - filterin_triage_atlte (str | Unset): - filterkindeq (str | Unset): - filterkindnot_eq (str | Unset): - filterkindin (str | Unset): - filterkindnot_in (str | Unset): - filterstatuseq (str | Unset): - filterstatusnot_eq (str | Unset): - filterstatusin (str | Unset): - filterstatusnot_in (str | Unset): - filterprivateeq (str | Unset): - filterprivatenot_eq (str | Unset): - filterprivatein (str | Unset): - filterprivatenot_in (str | Unset): - filteruser_ideq (str | Unset): - filteruser_idnot_eq (str | Unset): - filteruser_idin (str | Unset): - filteruser_idnot_in (str | Unset): - filterseverityeq (str | Unset): - filterseveritynot_eq (str | Unset): - filterseverityin (str | Unset): - filterseveritynot_in (str | Unset): - filterseverity_ideq (str | Unset): - filterseverity_idnot_eq (str | Unset): - filterseverity_idin (str | Unset): - filterseverity_idnot_in (str | Unset): - filterlabelseq (str | Unset): - filterlabelsnot_eq (str | Unset): - filterlabelsin (str | Unset): - filterlabelsnot_in (str | Unset): - filterzendesk_ticket_ideq (str | Unset): - filterzendesk_ticket_idnot_eq (str | Unset): - filterzendesk_ticket_idin (str | Unset): - filterzendesk_ticket_idnot_in (str | Unset): - filtersequential_ideq (str | Unset): - filtersequential_idnot_eq (str | Unset): - filtersequential_idin (str | Unset): - filtersequential_idnot_in (str | Unset): - filtertypeseq (str | Unset): - filtertypesnot_eq (str | Unset): - filtertypesin (str | Unset): - filtertypesnot_in (str | Unset): - filtertype_idseq (str | Unset): - filtertype_idsnot_eq (str | Unset): - filtertype_idsin (str | Unset): - filtertype_idsnot_in (str | Unset): - filterenvironmentseq (str | Unset): - filterenvironmentsnot_eq (str | Unset): - filterenvironmentsin (str | Unset): - filterenvironmentsnot_in (str | Unset): - filterenvironment_idseq (str | Unset): - filterenvironment_idsnot_eq (str | Unset): - filterenvironment_idsin (str | Unset): - filterenvironment_idsnot_in (str | Unset): - filterserviceseq (str | Unset): - filterservicesnot_eq (str | Unset): - filterservicesin (str | Unset): - filterservicesnot_in (str | Unset): - filterservice_idseq (str | Unset): - filterservice_idsnot_eq (str | Unset): - filterservice_idsin (str | Unset): - filterservice_idsnot_in (str | Unset): - filterservice_nameseq (str | Unset): - filterservice_namesnot_eq (str | Unset): - filterservice_namesin (str | Unset): - filterservice_namesnot_in (str | Unset): - filterfunctionalitieseq (str | Unset): - filterfunctionalitiesnot_eq (str | Unset): - filterfunctionalitiesin (str | Unset): - filterfunctionalitiesnot_in (str | Unset): - filterfunctionality_idseq (str | Unset): - filterfunctionality_idsnot_eq (str | Unset): - filterfunctionality_idsin (str | Unset): - filterfunctionality_idsnot_in (str | Unset): - filterfunctionality_nameseq (str | Unset): - filterfunctionality_namesnot_eq (str | Unset): - filterfunctionality_namesin (str | Unset): - filterfunctionality_namesnot_in (str | Unset): - filtercauseseq (str | Unset): - filtercausesnot_eq (str | Unset): - filtercausesin (str | Unset): - filtercausesnot_in (str | Unset): - filtercause_idseq (str | Unset): - filtercause_idsnot_eq (str | Unset): - filtercause_idsin (str | Unset): - filtercause_idsnot_in (str | Unset): - filterteamseq (str | Unset): - filterteamsnot_eq (str | Unset): - filterteamsin (str | Unset): - filterteamsnot_in (str | Unset): - filterteam_idseq (str | Unset): - filterteam_idsnot_eq (str | Unset): - filterteam_idsin (str | Unset): - filterteam_idsnot_in (str | Unset): - filterteam_nameseq (str | Unset): - filterteam_namesnot_eq (str | Unset): - filterteam_namesin (str | Unset): - filterteam_namesnot_in (str | Unset): - sort (ListIncidentsSort | Unset): - include (ListIncidentsInclude | Unset): + pageafter (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterkind (Union[Unset, str]): + filterstatus (Union[Unset, str]): + filterprivate (Union[Unset, str]): + filteruser_id (Union[Unset, int]): + filterseverity (Union[Unset, str]): + filterseverity_id (Union[Unset, str]): + filterlabels (Union[Unset, str]): + filtertypes (Union[Unset, str]): + filtertype_ids (Union[Unset, str]): + filterenvironments (Union[Unset, str]): + filterenvironment_ids (Union[Unset, str]): + filterfunctionalities (Union[Unset, str]): + filterfunctionality_ids (Union[Unset, str]): + filterfunctionality_names (Union[Unset, str]): + filterservices (Union[Unset, str]): + filterservice_ids (Union[Unset, str]): + filterservice_names (Union[Unset, str]): + filterteams (Union[Unset, str]): + filterteam_ids (Union[Unset, str]): + filterteam_names (Union[Unset, str]): + filtercause (Union[Unset, str]): + filtercause_ids (Union[Unset, str]): + filtercustom_field_selected_option_ids (Union[Unset, str]): + filterslack_channel_id (Union[Unset, str]): + filtersequential_id (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterupdated_atgt (Union[Unset, str]): + filterupdated_atgte (Union[Unset, str]): + filterupdated_atlt (Union[Unset, str]): + filterupdated_atlte (Union[Unset, str]): + filterstarted_atgt (Union[Unset, str]): + filterstarted_atgte (Union[Unset, str]): + filterstarted_atlt (Union[Unset, str]): + filterstarted_atlte (Union[Unset, str]): + filterdetected_atgt (Union[Unset, str]): + filterdetected_atgte (Union[Unset, str]): + filterdetected_atlt (Union[Unset, str]): + filterdetected_atlte (Union[Unset, str]): + filteracknowledged_atgt (Union[Unset, str]): + filteracknowledged_atgte (Union[Unset, str]): + filteracknowledged_atlt (Union[Unset, str]): + filteracknowledged_atlte (Union[Unset, str]): + filtermitigated_atgt (Union[Unset, str]): + filtermitigated_atgte (Union[Unset, str]): + filtermitigated_atlt (Union[Unset, str]): + filtermitigated_atlte (Union[Unset, str]): + filterresolved_atgt (Union[Unset, str]): + filterresolved_atgte (Union[Unset, str]): + filterresolved_atlt (Union[Unset, str]): + filterresolved_atlte (Union[Unset, str]): + filterclosed_atgt (Union[Unset, str]): + filterclosed_atgte (Union[Unset, str]): + filterclosed_atlt (Union[Unset, str]): + filterclosed_atlte (Union[Unset, str]): + filterin_triage_atgt (Union[Unset, str]): + filterin_triage_atgte (Union[Unset, str]): + filterin_triage_atlt (Union[Unset, str]): + filterin_triage_atlte (Union[Unset, str]): + filterkindeq (Union[Unset, str]): + filterkindnot_eq (Union[Unset, str]): + filterkindin (Union[Unset, str]): + filterkindnot_in (Union[Unset, str]): + filterstatuseq (Union[Unset, str]): + filterstatusnot_eq (Union[Unset, str]): + filterstatusin (Union[Unset, str]): + filterstatusnot_in (Union[Unset, str]): + filterprivateeq (Union[Unset, str]): + filterprivatenot_eq (Union[Unset, str]): + filterprivatein (Union[Unset, str]): + filterprivatenot_in (Union[Unset, str]): + filteruser_ideq (Union[Unset, str]): + filteruser_idnot_eq (Union[Unset, str]): + filteruser_idin (Union[Unset, str]): + filteruser_idnot_in (Union[Unset, str]): + filterseverityeq (Union[Unset, str]): + filterseveritynot_eq (Union[Unset, str]): + filterseverityin (Union[Unset, str]): + filterseveritynot_in (Union[Unset, str]): + filterseverity_ideq (Union[Unset, str]): + filterseverity_idnot_eq (Union[Unset, str]): + filterseverity_idin (Union[Unset, str]): + filterseverity_idnot_in (Union[Unset, str]): + filterlabelseq (Union[Unset, str]): + filterlabelsnot_eq (Union[Unset, str]): + filterlabelsin (Union[Unset, str]): + filterlabelsnot_in (Union[Unset, str]): + filterzendesk_ticket_ideq (Union[Unset, str]): + filterzendesk_ticket_idnot_eq (Union[Unset, str]): + filterzendesk_ticket_idin (Union[Unset, str]): + filterzendesk_ticket_idnot_in (Union[Unset, str]): + filtersequential_ideq (Union[Unset, str]): + filtersequential_idnot_eq (Union[Unset, str]): + filtersequential_idin (Union[Unset, str]): + filtersequential_idnot_in (Union[Unset, str]): + filtertypeseq (Union[Unset, str]): + filtertypesnot_eq (Union[Unset, str]): + filtertypesin (Union[Unset, str]): + filtertypesnot_in (Union[Unset, str]): + filtertype_idseq (Union[Unset, str]): + filtertype_idsnot_eq (Union[Unset, str]): + filtertype_idsin (Union[Unset, str]): + filtertype_idsnot_in (Union[Unset, str]): + filterenvironmentseq (Union[Unset, str]): + filterenvironmentsnot_eq (Union[Unset, str]): + filterenvironmentsin (Union[Unset, str]): + filterenvironmentsnot_in (Union[Unset, str]): + filterenvironment_idseq (Union[Unset, str]): + filterenvironment_idsnot_eq (Union[Unset, str]): + filterenvironment_idsin (Union[Unset, str]): + filterenvironment_idsnot_in (Union[Unset, str]): + filterserviceseq (Union[Unset, str]): + filterservicesnot_eq (Union[Unset, str]): + filterservicesin (Union[Unset, str]): + filterservicesnot_in (Union[Unset, str]): + filterservice_idseq (Union[Unset, str]): + filterservice_idsnot_eq (Union[Unset, str]): + filterservice_idsin (Union[Unset, str]): + filterservice_idsnot_in (Union[Unset, str]): + filterservice_nameseq (Union[Unset, str]): + filterservice_namesnot_eq (Union[Unset, str]): + filterservice_namesin (Union[Unset, str]): + filterservice_namesnot_in (Union[Unset, str]): + filterfunctionalitieseq (Union[Unset, str]): + filterfunctionalitiesnot_eq (Union[Unset, str]): + filterfunctionalitiesin (Union[Unset, str]): + filterfunctionalitiesnot_in (Union[Unset, str]): + filterfunctionality_idseq (Union[Unset, str]): + filterfunctionality_idsnot_eq (Union[Unset, str]): + filterfunctionality_idsin (Union[Unset, str]): + filterfunctionality_idsnot_in (Union[Unset, str]): + filterfunctionality_nameseq (Union[Unset, str]): + filterfunctionality_namesnot_eq (Union[Unset, str]): + filterfunctionality_namesin (Union[Unset, str]): + filterfunctionality_namesnot_in (Union[Unset, str]): + filtercauseseq (Union[Unset, str]): + filtercausesnot_eq (Union[Unset, str]): + filtercausesin (Union[Unset, str]): + filtercausesnot_in (Union[Unset, str]): + filtercause_idseq (Union[Unset, str]): + filtercause_idsnot_eq (Union[Unset, str]): + filtercause_idsin (Union[Unset, str]): + filtercause_idsnot_in (Union[Unset, str]): + filterteamseq (Union[Unset, str]): + filterteamsnot_eq (Union[Unset, str]): + filterteamsin (Union[Unset, str]): + filterteamsnot_in (Union[Unset, str]): + filterteam_idseq (Union[Unset, str]): + filterteam_idsnot_eq (Union[Unset, str]): + filterteam_idsin (Union[Unset, str]): + filterteam_idsnot_in (Union[Unset, str]): + filterteam_nameseq (Union[Unset, str]): + filterteam_namesnot_eq (Union[Unset, str]): + filterteam_namesin (Union[Unset, str]): + filterteam_namesnot_in (Union[Unset, str]): + sort (Union[Unset, ListIncidentsSort]): + include (Union[Unset, ListIncidentsInclude]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentList + Union[ErrorsList, IncidentList] """ return ( diff --git a/rootly_sdk/api/incidents/mark_as_duplicate_incident.py b/rootly_sdk/api/incidents/mark_as_duplicate_incident.py index e93e2b46..5c00bfce 100644 --- a/rootly_sdk/api/incidents/mark_as_duplicate_incident.py +++ b/rootly_sdk/api/incidents/mark_as_duplicate_incident.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union from uuid import UUID import httpx @@ -14,7 +13,7 @@ def _get_kwargs( - id: str | UUID, + id: Union[UUID, str], *, body: ResolveIncident, ) -> dict[str, Any]: @@ -22,9 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/incidents/{id}/duplicate".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/incidents/{id}/duplicate", } _kwargs["json"] = body.to_dict() @@ -36,8 +33,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | IncidentResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, IncidentResponse]]: if response.status_code == 200: response_200 = IncidentResponse.from_dict(response.json()) @@ -55,8 +52,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | IncidentResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, IncidentResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,17 +63,17 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: ResolveIncident, -) -> Response[ErrorsList | IncidentResponse]: +) -> Response[Union[ErrorsList, IncidentResponse]]: """Mark an incident as a duplicate Mark an incident as a duplicate Args: - id (str | UUID): + id (Union[UUID, str]): body (ResolveIncident): Raises: @@ -84,7 +81,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentResponse] + Response[Union[ErrorsList, IncidentResponse]] """ kwargs = _get_kwargs( @@ -100,17 +97,17 @@ def sync_detailed( def sync( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: ResolveIncident, -) -> ErrorsList | IncidentResponse | None: +) -> Optional[Union[ErrorsList, IncidentResponse]]: """Mark an incident as a duplicate Mark an incident as a duplicate Args: - id (str | UUID): + id (Union[UUID, str]): body (ResolveIncident): Raises: @@ -118,7 +115,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentResponse + Union[ErrorsList, IncidentResponse] """ return sync_detailed( @@ -129,17 +126,17 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: ResolveIncident, -) -> Response[ErrorsList | IncidentResponse]: +) -> Response[Union[ErrorsList, IncidentResponse]]: """Mark an incident as a duplicate Mark an incident as a duplicate Args: - id (str | UUID): + id (Union[UUID, str]): body (ResolveIncident): Raises: @@ -147,7 +144,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentResponse] + Response[Union[ErrorsList, IncidentResponse]] """ kwargs = _get_kwargs( @@ -161,17 +158,17 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: ResolveIncident, -) -> ErrorsList | IncidentResponse | None: +) -> Optional[Union[ErrorsList, IncidentResponse]]: """Mark an incident as a duplicate Mark an incident as a duplicate Args: - id (str | UUID): + id (Union[UUID, str]): body (ResolveIncident): Raises: @@ -179,7 +176,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentResponse + Union[ErrorsList, IncidentResponse] """ return ( diff --git a/rootly_sdk/api/incidents/mitigate_incident.py b/rootly_sdk/api/incidents/mitigate_incident.py index 4c713578..903539bf 100644 --- a/rootly_sdk/api/incidents/mitigate_incident.py +++ b/rootly_sdk/api/incidents/mitigate_incident.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union from uuid import UUID import httpx @@ -14,7 +13,7 @@ def _get_kwargs( - id: str | UUID, + id: Union[UUID, str], *, body: MitigateIncident, ) -> dict[str, Any]: @@ -22,9 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/incidents/{id}/mitigate".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/incidents/{id}/mitigate", } _kwargs["json"] = body.to_dict() @@ -36,8 +33,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | IncidentResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, IncidentResponse]]: if response.status_code == 200: response_200 = IncidentResponse.from_dict(response.json()) @@ -55,8 +52,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | IncidentResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, IncidentResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,17 +63,17 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: MitigateIncident, -) -> Response[ErrorsList | IncidentResponse]: +) -> Response[Union[ErrorsList, IncidentResponse]]: """Mitigate an incident Mitigate a specific incident by id Args: - id (str | UUID): + id (Union[UUID, str]): body (MitigateIncident): Raises: @@ -84,7 +81,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentResponse] + Response[Union[ErrorsList, IncidentResponse]] """ kwargs = _get_kwargs( @@ -100,17 +97,17 @@ def sync_detailed( def sync( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: MitigateIncident, -) -> ErrorsList | IncidentResponse | None: +) -> Optional[Union[ErrorsList, IncidentResponse]]: """Mitigate an incident Mitigate a specific incident by id Args: - id (str | UUID): + id (Union[UUID, str]): body (MitigateIncident): Raises: @@ -118,7 +115,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentResponse + Union[ErrorsList, IncidentResponse] """ return sync_detailed( @@ -129,17 +126,17 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: MitigateIncident, -) -> Response[ErrorsList | IncidentResponse]: +) -> Response[Union[ErrorsList, IncidentResponse]]: """Mitigate an incident Mitigate a specific incident by id Args: - id (str | UUID): + id (Union[UUID, str]): body (MitigateIncident): Raises: @@ -147,7 +144,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentResponse] + Response[Union[ErrorsList, IncidentResponse]] """ kwargs = _get_kwargs( @@ -161,17 +158,17 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: MitigateIncident, -) -> ErrorsList | IncidentResponse | None: +) -> Optional[Union[ErrorsList, IncidentResponse]]: """Mitigate an incident Mitigate a specific incident by id Args: - id (str | UUID): + id (Union[UUID, str]): body (MitigateIncident): Raises: @@ -179,7 +176,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentResponse + Union[ErrorsList, IncidentResponse] """ return ( diff --git a/rootly_sdk/api/incidents/remove_assigned_user_from_incident.py b/rootly_sdk/api/incidents/remove_assigned_user_from_incident.py index c86e1ec4..924fa2dd 100644 --- a/rootly_sdk/api/incidents/remove_assigned_user_from_incident.py +++ b/rootly_sdk/api/incidents/remove_assigned_user_from_incident.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union from uuid import UUID import httpx @@ -14,7 +13,7 @@ def _get_kwargs( - id: str | UUID, + id: Union[UUID, str], *, body: UnassignRoleFromUser, ) -> dict[str, Any]: @@ -22,9 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/incidents/{id}/unassign_role_from_user".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/incidents/{id}/unassign_role_from_user", } _kwargs["json"] = body.to_dict() @@ -36,8 +33,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | IncidentResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, IncidentResponse]]: if response.status_code == 200: response_200 = IncidentResponse.from_dict(response.json()) @@ -55,8 +52,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | IncidentResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, IncidentResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,17 +63,17 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UnassignRoleFromUser, -) -> Response[ErrorsList | IncidentResponse]: +) -> Response[Union[ErrorsList, IncidentResponse]]: """Remove assigned user from incident Remove assigned user from incident Args: - id (str | UUID): + id (Union[UUID, str]): body (UnassignRoleFromUser): Raises: @@ -84,7 +81,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentResponse] + Response[Union[ErrorsList, IncidentResponse]] """ kwargs = _get_kwargs( @@ -100,17 +97,17 @@ def sync_detailed( def sync( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UnassignRoleFromUser, -) -> ErrorsList | IncidentResponse | None: +) -> Optional[Union[ErrorsList, IncidentResponse]]: """Remove assigned user from incident Remove assigned user from incident Args: - id (str | UUID): + id (Union[UUID, str]): body (UnassignRoleFromUser): Raises: @@ -118,7 +115,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentResponse + Union[ErrorsList, IncidentResponse] """ return sync_detailed( @@ -129,17 +126,17 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UnassignRoleFromUser, -) -> Response[ErrorsList | IncidentResponse]: +) -> Response[Union[ErrorsList, IncidentResponse]]: """Remove assigned user from incident Remove assigned user from incident Args: - id (str | UUID): + id (Union[UUID, str]): body (UnassignRoleFromUser): Raises: @@ -147,7 +144,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentResponse] + Response[Union[ErrorsList, IncidentResponse]] """ kwargs = _get_kwargs( @@ -161,17 +158,17 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UnassignRoleFromUser, -) -> ErrorsList | IncidentResponse | None: +) -> Optional[Union[ErrorsList, IncidentResponse]]: """Remove assigned user from incident Remove assigned user from incident Args: - id (str | UUID): + id (Union[UUID, str]): body (UnassignRoleFromUser): Raises: @@ -179,7 +176,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentResponse + Union[ErrorsList, IncidentResponse] """ return ( diff --git a/rootly_sdk/api/incidents/remove_subscribers_to_incident.py b/rootly_sdk/api/incidents/remove_subscribers_to_incident.py index 0be005da..1ad27b4b 100644 --- a/rootly_sdk/api/incidents/remove_subscribers_to_incident.py +++ b/rootly_sdk/api/incidents/remove_subscribers_to_incident.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union from uuid import UUID import httpx @@ -14,7 +13,7 @@ def _get_kwargs( - id: str | UUID, + id: Union[UUID, str], *, body: RemoveSubscribers, ) -> dict[str, Any]: @@ -22,9 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/incidents/{id}/remove_subscribers".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/incidents/{id}/remove_subscribers", } _kwargs["json"] = body.to_dict() @@ -36,8 +33,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | IncidentResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, IncidentResponse]]: if response.status_code == 200: response_200 = IncidentResponse.from_dict(response.json()) @@ -55,8 +52,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | IncidentResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, IncidentResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,17 +63,17 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: RemoveSubscribers, -) -> Response[ErrorsList | IncidentResponse]: +) -> Response[Union[ErrorsList, IncidentResponse]]: """Remove subscribers from incident Remove subscribers to incident Args: - id (str | UUID): + id (Union[UUID, str]): body (RemoveSubscribers): Raises: @@ -84,7 +81,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentResponse] + Response[Union[ErrorsList, IncidentResponse]] """ kwargs = _get_kwargs( @@ -100,17 +97,17 @@ def sync_detailed( def sync( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: RemoveSubscribers, -) -> ErrorsList | IncidentResponse | None: +) -> Optional[Union[ErrorsList, IncidentResponse]]: """Remove subscribers from incident Remove subscribers to incident Args: - id (str | UUID): + id (Union[UUID, str]): body (RemoveSubscribers): Raises: @@ -118,7 +115,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentResponse + Union[ErrorsList, IncidentResponse] """ return sync_detailed( @@ -129,17 +126,17 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: RemoveSubscribers, -) -> Response[ErrorsList | IncidentResponse]: +) -> Response[Union[ErrorsList, IncidentResponse]]: """Remove subscribers from incident Remove subscribers to incident Args: - id (str | UUID): + id (Union[UUID, str]): body (RemoveSubscribers): Raises: @@ -147,7 +144,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentResponse] + Response[Union[ErrorsList, IncidentResponse]] """ kwargs = _get_kwargs( @@ -161,17 +158,17 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: RemoveSubscribers, -) -> ErrorsList | IncidentResponse | None: +) -> Optional[Union[ErrorsList, IncidentResponse]]: """Remove subscribers from incident Remove subscribers to incident Args: - id (str | UUID): + id (Union[UUID, str]): body (RemoveSubscribers): Raises: @@ -179,7 +176,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentResponse + Union[ErrorsList, IncidentResponse] """ return ( diff --git a/rootly_sdk/api/incidents/resolve_incident.py b/rootly_sdk/api/incidents/resolve_incident.py index 094ca943..7e243c74 100644 --- a/rootly_sdk/api/incidents/resolve_incident.py +++ b/rootly_sdk/api/incidents/resolve_incident.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union from uuid import UUID import httpx @@ -14,7 +13,7 @@ def _get_kwargs( - id: str | UUID, + id: Union[UUID, str], *, body: ResolveIncident, ) -> dict[str, Any]: @@ -22,9 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/incidents/{id}/resolve".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/incidents/{id}/resolve", } _kwargs["json"] = body.to_dict() @@ -36,8 +33,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | IncidentResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, IncidentResponse]]: if response.status_code == 200: response_200 = IncidentResponse.from_dict(response.json()) @@ -55,8 +52,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | IncidentResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, IncidentResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,17 +63,17 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: ResolveIncident, -) -> Response[ErrorsList | IncidentResponse]: +) -> Response[Union[ErrorsList, IncidentResponse]]: """Resolve an incident Resolve a specific incident by id Args: - id (str | UUID): + id (Union[UUID, str]): body (ResolveIncident): Raises: @@ -84,7 +81,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentResponse] + Response[Union[ErrorsList, IncidentResponse]] """ kwargs = _get_kwargs( @@ -100,17 +97,17 @@ def sync_detailed( def sync( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: ResolveIncident, -) -> ErrorsList | IncidentResponse | None: +) -> Optional[Union[ErrorsList, IncidentResponse]]: """Resolve an incident Resolve a specific incident by id Args: - id (str | UUID): + id (Union[UUID, str]): body (ResolveIncident): Raises: @@ -118,7 +115,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentResponse + Union[ErrorsList, IncidentResponse] """ return sync_detailed( @@ -129,17 +126,17 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: ResolveIncident, -) -> Response[ErrorsList | IncidentResponse]: +) -> Response[Union[ErrorsList, IncidentResponse]]: """Resolve an incident Resolve a specific incident by id Args: - id (str | UUID): + id (Union[UUID, str]): body (ResolveIncident): Raises: @@ -147,7 +144,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentResponse] + Response[Union[ErrorsList, IncidentResponse]] """ kwargs = _get_kwargs( @@ -161,17 +158,17 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: ResolveIncident, -) -> ErrorsList | IncidentResponse | None: +) -> Optional[Union[ErrorsList, IncidentResponse]]: """Resolve an incident Resolve a specific incident by id Args: - id (str | UUID): + id (Union[UUID, str]): body (ResolveIncident): Raises: @@ -179,7 +176,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentResponse + Union[ErrorsList, IncidentResponse] """ return ( diff --git a/rootly_sdk/api/incidents/restart_incident.py b/rootly_sdk/api/incidents/restart_incident.py index 45953fc9..0c1a990b 100644 --- a/rootly_sdk/api/incidents/restart_incident.py +++ b/rootly_sdk/api/incidents/restart_incident.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union from uuid import UUID import httpx @@ -14,7 +13,7 @@ def _get_kwargs( - id: str | UUID, + id: Union[UUID, str], *, body: RestartIncident, ) -> dict[str, Any]: @@ -22,9 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/incidents/{id}/restart".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/incidents/{id}/restart", } _kwargs["json"] = body.to_dict() @@ -36,8 +33,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | IncidentResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, IncidentResponse]]: if response.status_code == 200: response_200 = IncidentResponse.from_dict(response.json()) @@ -55,8 +52,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | IncidentResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, IncidentResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,17 +63,17 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: RestartIncident, -) -> Response[ErrorsList | IncidentResponse]: +) -> Response[Union[ErrorsList, IncidentResponse]]: """Restart an incident Restart a specific incident by id Args: - id (str | UUID): + id (Union[UUID, str]): body (RestartIncident): Raises: @@ -84,7 +81,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentResponse] + Response[Union[ErrorsList, IncidentResponse]] """ kwargs = _get_kwargs( @@ -100,17 +97,17 @@ def sync_detailed( def sync( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: RestartIncident, -) -> ErrorsList | IncidentResponse | None: +) -> Optional[Union[ErrorsList, IncidentResponse]]: """Restart an incident Restart a specific incident by id Args: - id (str | UUID): + id (Union[UUID, str]): body (RestartIncident): Raises: @@ -118,7 +115,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentResponse + Union[ErrorsList, IncidentResponse] """ return sync_detailed( @@ -129,17 +126,17 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: RestartIncident, -) -> Response[ErrorsList | IncidentResponse]: +) -> Response[Union[ErrorsList, IncidentResponse]]: """Restart an incident Restart a specific incident by id Args: - id (str | UUID): + id (Union[UUID, str]): body (RestartIncident): Raises: @@ -147,7 +144,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentResponse] + Response[Union[ErrorsList, IncidentResponse]] """ kwargs = _get_kwargs( @@ -161,17 +158,17 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: RestartIncident, -) -> ErrorsList | IncidentResponse | None: +) -> Optional[Union[ErrorsList, IncidentResponse]]: """Restart an incident Restart a specific incident by id Args: - id (str | UUID): + id (Union[UUID, str]): body (RestartIncident): Raises: @@ -179,7 +176,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentResponse + Union[ErrorsList, IncidentResponse] """ return ( diff --git a/rootly_sdk/api/incidents/triage_incident.py b/rootly_sdk/api/incidents/triage_incident.py index 819bedd0..1a8a4eb3 100644 --- a/rootly_sdk/api/incidents/triage_incident.py +++ b/rootly_sdk/api/incidents/triage_incident.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union from uuid import UUID import httpx @@ -14,7 +13,7 @@ def _get_kwargs( - id: str | UUID, + id: Union[UUID, str], *, body: InTriageIncident, ) -> dict[str, Any]: @@ -22,9 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/incidents/{id}/in_triage".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/incidents/{id}/in_triage", } _kwargs["json"] = body.to_dict() @@ -36,8 +33,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | IncidentResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, IncidentResponse]]: if response.status_code == 200: response_200 = IncidentResponse.from_dict(response.json()) @@ -55,8 +52,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | IncidentResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, IncidentResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,17 +63,17 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: InTriageIncident, -) -> Response[ErrorsList | IncidentResponse]: +) -> Response[Union[ErrorsList, IncidentResponse]]: """Triage an incident Set a specific incident by ID to triage state Args: - id (str | UUID): + id (Union[UUID, str]): body (InTriageIncident): Raises: @@ -84,7 +81,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentResponse] + Response[Union[ErrorsList, IncidentResponse]] """ kwargs = _get_kwargs( @@ -100,17 +97,17 @@ def sync_detailed( def sync( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: InTriageIncident, -) -> ErrorsList | IncidentResponse | None: +) -> Optional[Union[ErrorsList, IncidentResponse]]: """Triage an incident Set a specific incident by ID to triage state Args: - id (str | UUID): + id (Union[UUID, str]): body (InTriageIncident): Raises: @@ -118,7 +115,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentResponse + Union[ErrorsList, IncidentResponse] """ return sync_detailed( @@ -129,17 +126,17 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: InTriageIncident, -) -> Response[ErrorsList | IncidentResponse]: +) -> Response[Union[ErrorsList, IncidentResponse]]: """Triage an incident Set a specific incident by ID to triage state Args: - id (str | UUID): + id (Union[UUID, str]): body (InTriageIncident): Raises: @@ -147,7 +144,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentResponse] + Response[Union[ErrorsList, IncidentResponse]] """ kwargs = _get_kwargs( @@ -161,17 +158,17 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: InTriageIncident, -) -> ErrorsList | IncidentResponse | None: +) -> Optional[Union[ErrorsList, IncidentResponse]]: """Triage an incident Set a specific incident by ID to triage state Args: - id (str | UUID): + id (Union[UUID, str]): body (InTriageIncident): Raises: @@ -179,7 +176,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentResponse + Union[ErrorsList, IncidentResponse] """ return ( diff --git a/rootly_sdk/api/incidents/unmark_as_duplicate_incident.py b/rootly_sdk/api/incidents/unmark_as_duplicate_incident.py index d5a053f8..2e052b26 100644 --- a/rootly_sdk/api/incidents/unmark_as_duplicate_incident.py +++ b/rootly_sdk/api/incidents/unmark_as_duplicate_incident.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any, cast -from urllib.parse import quote +from typing import Any, Optional, Union, cast from uuid import UUID import httpx @@ -13,22 +12,19 @@ def _get_kwargs( - id: str | UUID, + id: Union[UUID, str], ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/incidents/{id}/unmark_as_duplicate".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/incidents/{id}/unmark_as_duplicate", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Any | ErrorsList | IncidentResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorsList, IncidentResponse]]: if response.status_code == 200: response_200 = IncidentResponse.from_dict(response.json()) @@ -50,8 +46,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[Any | ErrorsList | IncidentResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorsList, IncidentResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -61,23 +57,23 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Response[Any | ErrorsList | IncidentResponse]: +) -> Response[Union[Any, ErrorsList, IncidentResponse]]: """Remove duplicate marking from an incident Remove the duplicate marking from an incident Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | ErrorsList | IncidentResponse] + Response[Union[Any, ErrorsList, IncidentResponse]] """ kwargs = _get_kwargs( @@ -92,23 +88,23 @@ def sync_detailed( def sync( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Any | ErrorsList | IncidentResponse | None: +) -> Optional[Union[Any, ErrorsList, IncidentResponse]]: """Remove duplicate marking from an incident Remove the duplicate marking from an incident Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | ErrorsList | IncidentResponse + Union[Any, ErrorsList, IncidentResponse] """ return sync_detailed( @@ -118,23 +114,23 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Response[Any | ErrorsList | IncidentResponse]: +) -> Response[Union[Any, ErrorsList, IncidentResponse]]: """Remove duplicate marking from an incident Remove the duplicate marking from an incident Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | ErrorsList | IncidentResponse] + Response[Union[Any, ErrorsList, IncidentResponse]] """ kwargs = _get_kwargs( @@ -147,23 +143,23 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Any | ErrorsList | IncidentResponse | None: +) -> Optional[Union[Any, ErrorsList, IncidentResponse]]: """Remove duplicate marking from an incident Remove the duplicate marking from an incident Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | ErrorsList | IncidentResponse + Union[Any, ErrorsList, IncidentResponse] """ return ( diff --git a/rootly_sdk/api/incidents/update_incident.py b/rootly_sdk/api/incidents/update_incident.py index 470c044e..1c2f3a56 100644 --- a/rootly_sdk/api/incidents/update_incident.py +++ b/rootly_sdk/api/incidents/update_incident.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union from uuid import UUID import httpx @@ -14,7 +13,7 @@ def _get_kwargs( - id: str | UUID, + id: Union[UUID, str], *, body: UpdateIncident, ) -> dict[str, Any]: @@ -22,9 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/incidents/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/incidents/{id}", } _kwargs["json"] = body.to_dict() @@ -36,8 +33,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | IncidentResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, IncidentResponse]]: if response.status_code == 200: response_200 = IncidentResponse.from_dict(response.json()) @@ -55,8 +52,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | IncidentResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, IncidentResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,17 +63,17 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdateIncident, -) -> Response[ErrorsList | IncidentResponse]: +) -> Response[Union[ErrorsList, IncidentResponse]]: """Update an incident Update a specific incident by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateIncident): Raises: @@ -84,7 +81,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentResponse] + Response[Union[ErrorsList, IncidentResponse]] """ kwargs = _get_kwargs( @@ -100,17 +97,17 @@ def sync_detailed( def sync( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdateIncident, -) -> ErrorsList | IncidentResponse | None: +) -> Optional[Union[ErrorsList, IncidentResponse]]: """Update an incident Update a specific incident by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateIncident): Raises: @@ -118,7 +115,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentResponse + Union[ErrorsList, IncidentResponse] """ return sync_detailed( @@ -129,17 +126,17 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdateIncident, -) -> Response[ErrorsList | IncidentResponse]: +) -> Response[Union[ErrorsList, IncidentResponse]]: """Update an incident Update a specific incident by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateIncident): Raises: @@ -147,7 +144,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentResponse] + Response[Union[ErrorsList, IncidentResponse]] """ kwargs = _get_kwargs( @@ -161,17 +158,17 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdateIncident, -) -> ErrorsList | IncidentResponse | None: +) -> Optional[Union[ErrorsList, IncidentResponse]]: """Update an incident Update a specific incident by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateIncident): Raises: @@ -179,7 +176,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentResponse + Union[ErrorsList, IncidentResponse] """ return ( diff --git a/rootly_sdk/api/ip_ranges/get_ip_ranges.py b/rootly_sdk/api/ip_ranges/get_ip_ranges.py index 1c8c7d81..b257179c 100644 --- a/rootly_sdk/api/ip_ranges/get_ip_ranges.py +++ b/rootly_sdk/api/ip_ranges/get_ip_ranges.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -10,7 +10,6 @@ def _get_kwargs() -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", "url": "/v1/ip_ranges", @@ -19,7 +18,9 @@ def _get_kwargs() -> dict[str, Any]: return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> IpRangesResponse | None: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[IpRangesResponse]: if response.status_code == 200: response_200 = IpRangesResponse.from_dict(response.json()) @@ -31,7 +32,9 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[IpRangesResponse]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[IpRangesResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -68,7 +71,7 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, -) -> IpRangesResponse | None: +) -> Optional[IpRangesResponse]: """Retrieves IP ranges Retrieves the IP ranges for rootly.com services @@ -112,7 +115,7 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, -) -> IpRangesResponse | None: +) -> Optional[IpRangesResponse]: """Retrieves IP ranges Retrieves the IP ranges for rootly.com services diff --git a/rootly_sdk/api/live_call_routers/create_live_call_router.py b/rootly_sdk/api/live_call_routers/create_live_call_router.py index 3411697b..0b553c6a 100644 --- a/rootly_sdk/api/live_call_routers/create_live_call_router.py +++ b/rootly_sdk/api/live_call_routers/create_live_call_router.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | LiveCallRouterResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, LiveCallRouterResponse]]: if response.status_code == 201: response_201 = LiveCallRouterResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | LiveCallRouterResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, LiveCallRouterResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +69,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewLiveCallRouter, -) -> Response[ErrorsList | LiveCallRouterResponse]: +) -> Response[Union[ErrorsList, LiveCallRouterResponse]]: """Creates a Live Call Router Creates a new Live Call Router from provided data @@ -82,7 +82,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | LiveCallRouterResponse] + Response[Union[ErrorsList, LiveCallRouterResponse]] """ kwargs = _get_kwargs( @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: NewLiveCallRouter, -) -> ErrorsList | LiveCallRouterResponse | None: +) -> Optional[Union[ErrorsList, LiveCallRouterResponse]]: """Creates a Live Call Router Creates a new Live Call Router from provided data @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | LiveCallRouterResponse + Union[ErrorsList, LiveCallRouterResponse] """ return sync_detailed( @@ -126,7 +126,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewLiveCallRouter, -) -> Response[ErrorsList | LiveCallRouterResponse]: +) -> Response[Union[ErrorsList, LiveCallRouterResponse]]: """Creates a Live Call Router Creates a new Live Call Router from provided data @@ -139,7 +139,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | LiveCallRouterResponse] + Response[Union[ErrorsList, LiveCallRouterResponse]] """ kwargs = _get_kwargs( @@ -155,7 +155,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewLiveCallRouter, -) -> ErrorsList | LiveCallRouterResponse | None: +) -> Optional[Union[ErrorsList, LiveCallRouterResponse]]: """Creates a Live Call Router Creates a new Live Call Router from provided data @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | LiveCallRouterResponse + Union[ErrorsList, LiveCallRouterResponse] """ return ( diff --git a/rootly_sdk/api/live_call_routers/delete_live_call_router.py b/rootly_sdk/api/live_call_routers/delete_live_call_router.py index 599d3193..39286617 100644 --- a/rootly_sdk/api/live_call_routers/delete_live_call_router.py +++ b/rootly_sdk/api/live_call_routers/delete_live_call_router.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/live_call_routers/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/live_call_routers/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | LiveCallRouterResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, LiveCallRouterResponse]]: if response.status_code == 200: response_200 = LiveCallRouterResponse.from_dict(response.json()) @@ -45,8 +41,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | LiveCallRouterResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, LiveCallRouterResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | LiveCallRouterResponse]: +) -> Response[Union[ErrorsList, LiveCallRouterResponse]]: """Delete a Live Call Router Delete a specific Live Call Router by id @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | LiveCallRouterResponse] + Response[Union[ErrorsList, LiveCallRouterResponse]] """ kwargs = _get_kwargs( @@ -90,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | LiveCallRouterResponse | None: +) -> Optional[Union[ErrorsList, LiveCallRouterResponse]]: """Delete a Live Call Router Delete a specific Live Call Router by id @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | LiveCallRouterResponse + Union[ErrorsList, LiveCallRouterResponse] """ return sync_detailed( @@ -116,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | LiveCallRouterResponse]: +) -> Response[Union[ErrorsList, LiveCallRouterResponse]]: """Delete a Live Call Router Delete a specific Live Call Router by id @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | LiveCallRouterResponse] + Response[Union[ErrorsList, LiveCallRouterResponse]] """ kwargs = _get_kwargs( @@ -145,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | LiveCallRouterResponse | None: +) -> Optional[Union[ErrorsList, LiveCallRouterResponse]]: """Delete a Live Call Router Delete a specific Live Call Router by id @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | LiveCallRouterResponse + Union[ErrorsList, LiveCallRouterResponse] """ return ( diff --git a/rootly_sdk/api/live_call_routers/generate_phone_number_live_call_router.py b/rootly_sdk/api/live_call_routers/generate_phone_number_live_call_router.py index f9a03d53..1aed77d4 100644 --- a/rootly_sdk/api/live_call_routers/generate_phone_number_live_call_router.py +++ b/rootly_sdk/api/live_call_routers/generate_phone_number_live_call_router.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, cast +from typing import Any, Optional, Union, cast import httpx @@ -20,7 +20,6 @@ def _get_kwargs( country_code: GeneratePhoneNumberLiveCallRouterCountryCode, phone_type: GeneratePhoneNumberLiveCallRouterPhoneType, ) -> dict[str, Any]: - params: dict[str, Any] = {} json_country_code: str = country_code @@ -40,7 +39,9 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Any | ErrorsList | None: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorsList]]: if response.status_code == 200: response_200 = cast(Any, None) return response_200 @@ -56,7 +57,9 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Any | ErrorsList]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -70,7 +73,7 @@ def sync_detailed( client: AuthenticatedClient, country_code: GeneratePhoneNumberLiveCallRouterCountryCode, phone_type: GeneratePhoneNumberLiveCallRouterPhoneType, -) -> Response[Any | ErrorsList]: +) -> Response[Union[Any, ErrorsList]]: """Generates a phone number for Live Call Router Generates a phone number for Live Call Router @@ -84,7 +87,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | ErrorsList] + Response[Union[Any, ErrorsList]] """ kwargs = _get_kwargs( @@ -104,7 +107,7 @@ def sync( client: AuthenticatedClient, country_code: GeneratePhoneNumberLiveCallRouterCountryCode, phone_type: GeneratePhoneNumberLiveCallRouterPhoneType, -) -> Any | ErrorsList | None: +) -> Optional[Union[Any, ErrorsList]]: """Generates a phone number for Live Call Router Generates a phone number for Live Call Router @@ -118,7 +121,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | ErrorsList + Union[Any, ErrorsList] """ return sync_detailed( @@ -133,7 +136,7 @@ async def asyncio_detailed( client: AuthenticatedClient, country_code: GeneratePhoneNumberLiveCallRouterCountryCode, phone_type: GeneratePhoneNumberLiveCallRouterPhoneType, -) -> Response[Any | ErrorsList]: +) -> Response[Union[Any, ErrorsList]]: """Generates a phone number for Live Call Router Generates a phone number for Live Call Router @@ -147,7 +150,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | ErrorsList] + Response[Union[Any, ErrorsList]] """ kwargs = _get_kwargs( @@ -165,7 +168,7 @@ async def asyncio( client: AuthenticatedClient, country_code: GeneratePhoneNumberLiveCallRouterCountryCode, phone_type: GeneratePhoneNumberLiveCallRouterPhoneType, -) -> Any | ErrorsList | None: +) -> Optional[Union[Any, ErrorsList]]: """Generates a phone number for Live Call Router Generates a phone number for Live Call Router @@ -179,7 +182,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | ErrorsList + Union[Any, ErrorsList] """ return ( diff --git a/rootly_sdk/api/live_call_routers/get_live_call_router.py b/rootly_sdk/api/live_call_routers/get_live_call_router.py index df6f8458..39cf19b6 100644 --- a/rootly_sdk/api/live_call_routers/get_live_call_router.py +++ b/rootly_sdk/api/live_call_routers/get_live_call_router.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/live_call_routers/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/live_call_routers/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | LiveCallRouterResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, LiveCallRouterResponse]]: if response.status_code == 200: response_200 = LiveCallRouterResponse.from_dict(response.json()) @@ -45,8 +41,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | LiveCallRouterResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, LiveCallRouterResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | LiveCallRouterResponse]: +) -> Response[Union[ErrorsList, LiveCallRouterResponse]]: """Retrieves a Live Call Router Retrieves a specific Live Call Router by id @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | LiveCallRouterResponse] + Response[Union[ErrorsList, LiveCallRouterResponse]] """ kwargs = _get_kwargs( @@ -90,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | LiveCallRouterResponse | None: +) -> Optional[Union[ErrorsList, LiveCallRouterResponse]]: """Retrieves a Live Call Router Retrieves a specific Live Call Router by id @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | LiveCallRouterResponse + Union[ErrorsList, LiveCallRouterResponse] """ return sync_detailed( @@ -116,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | LiveCallRouterResponse]: +) -> Response[Union[ErrorsList, LiveCallRouterResponse]]: """Retrieves a Live Call Router Retrieves a specific Live Call Router by id @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | LiveCallRouterResponse] + Response[Union[ErrorsList, LiveCallRouterResponse]] """ kwargs = _get_kwargs( @@ -145,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | LiveCallRouterResponse | None: +) -> Optional[Union[ErrorsList, LiveCallRouterResponse]]: """Retrieves a Live Call Router Retrieves a specific Live Call Router by id @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | LiveCallRouterResponse + Union[ErrorsList, LiveCallRouterResponse] """ return ( diff --git a/rootly_sdk/api/live_call_routers/list_live_call_routers.py b/rootly_sdk/api/live_call_routers/list_live_call_routers.py index fe5ad768..23a42fec 100644 --- a/rootly_sdk/api/live_call_routers/list_live_call_routers.py +++ b/rootly_sdk/api/live_call_routers/list_live_call_routers.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -11,19 +11,18 @@ def _get_kwargs( *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -59,7 +58,9 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> LiveCallRouterList | None: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[LiveCallRouterList]: if response.status_code == 200: response_200 = LiveCallRouterList.from_dict(response.json()) @@ -71,7 +72,9 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[LiveCallRouterList]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[LiveCallRouterList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -83,34 +86,34 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, ) -> Response[LiveCallRouterList]: """List Live Call Routers List Live Call Routers Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterslug (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -144,34 +147,34 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, -) -> LiveCallRouterList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, +) -> Optional[LiveCallRouterList]: """List Live Call Routers List Live Call Routers Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterslug (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -200,34 +203,34 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, ) -> Response[LiveCallRouterList]: """List Live Call Routers List Live Call Routers Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterslug (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -259,34 +262,34 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, -) -> LiveCallRouterList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, +) -> Optional[LiveCallRouterList]: """List Live Call Routers List Live Call Routers Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterslug (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/live_call_routers/update_live_call_router.py b/rootly_sdk/api/live_call_routers/update_live_call_router.py index 8fd9e6f4..f39a6175 100644 --- a/rootly_sdk/api/live_call_routers/update_live_call_router.py +++ b/rootly_sdk/api/live_call_routers/update_live_call_router.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/live_call_routers/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/live_call_routers/{id}", } _kwargs["json"] = body.to_dict() @@ -35,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | LiveCallRouterResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, LiveCallRouterResponse]]: if response.status_code == 200: response_200 = LiveCallRouterResponse.from_dict(response.json()) @@ -54,8 +51,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | LiveCallRouterResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, LiveCallRouterResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateLiveCallRouter, -) -> Response[ErrorsList | LiveCallRouterResponse]: +) -> Response[Union[ErrorsList, LiveCallRouterResponse]]: """Update a Live Call Router Update a specific Live Call Router by id @@ -83,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | LiveCallRouterResponse] + Response[Union[ErrorsList, LiveCallRouterResponse]] """ kwargs = _get_kwargs( @@ -103,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateLiveCallRouter, -) -> ErrorsList | LiveCallRouterResponse | None: +) -> Optional[Union[ErrorsList, LiveCallRouterResponse]]: """Update a Live Call Router Update a specific Live Call Router by id @@ -117,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | LiveCallRouterResponse + Union[ErrorsList, LiveCallRouterResponse] """ return sync_detailed( @@ -132,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateLiveCallRouter, -) -> Response[ErrorsList | LiveCallRouterResponse]: +) -> Response[Union[ErrorsList, LiveCallRouterResponse]]: """Update a Live Call Router Update a specific Live Call Router by id @@ -146,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | LiveCallRouterResponse] + Response[Union[ErrorsList, LiveCallRouterResponse]] """ kwargs = _get_kwargs( @@ -164,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateLiveCallRouter, -) -> ErrorsList | LiveCallRouterResponse | None: +) -> Optional[Union[ErrorsList, LiveCallRouterResponse]]: """Update a Live Call Router Update a specific Live Call Router by id @@ -178,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | LiveCallRouterResponse + Union[ErrorsList, LiveCallRouterResponse] """ return ( diff --git a/rootly_sdk/api/meeting_recordings/create_meeting_recording.py b/rootly_sdk/api/meeting_recordings/create_meeting_recording.py index 567609c4..29d42edb 100644 --- a/rootly_sdk/api/meeting_recordings/create_meeting_recording.py +++ b/rootly_sdk/api/meeting_recordings/create_meeting_recording.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any, cast -from urllib.parse import quote +from typing import Any, Optional, Union, cast import httpx @@ -16,12 +15,11 @@ def _get_kwargs( incident_id: str, *, - platform: CreateMeetingRecordingPlatform | Unset = UNSET, + platform: Union[Unset, CreateMeetingRecordingPlatform] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} - json_platform: str | Unset = UNSET + json_platform: Union[Unset, str] = UNSET if not isinstance(platform, Unset): json_platform = platform @@ -31,9 +29,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/incidents/{incident_id}/meeting_recordings".format( - incident_id=quote(str(incident_id), safe=""), - ), + "url": f"/v1/incidents/{incident_id}/meeting_recordings", "params": params, } @@ -41,8 +37,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Any | MeetingRecordingResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, MeetingRecordingResponse]]: if response.status_code == 201: response_201 = MeetingRecordingResponse.from_dict(response.json()) @@ -59,8 +55,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[Any | MeetingRecordingResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, MeetingRecordingResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -73,8 +69,8 @@ def sync_detailed( incident_id: str, *, client: AuthenticatedClient, - platform: CreateMeetingRecordingPlatform | Unset = UNSET, -) -> Response[Any | MeetingRecordingResponse]: + platform: Union[Unset, CreateMeetingRecordingPlatform] = UNSET, +) -> Response[Union[Any, MeetingRecordingResponse]]: """Create meeting recording Invite a recording bot to the incident's meeting. If no previous recordings exist for the platform, @@ -83,14 +79,14 @@ def sync_detailed( Args: incident_id (str): - platform (CreateMeetingRecordingPlatform | Unset): + platform (Union[Unset, CreateMeetingRecordingPlatform]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | MeetingRecordingResponse] + Response[Union[Any, MeetingRecordingResponse]] """ kwargs = _get_kwargs( @@ -109,8 +105,8 @@ def sync( incident_id: str, *, client: AuthenticatedClient, - platform: CreateMeetingRecordingPlatform | Unset = UNSET, -) -> Any | MeetingRecordingResponse | None: + platform: Union[Unset, CreateMeetingRecordingPlatform] = UNSET, +) -> Optional[Union[Any, MeetingRecordingResponse]]: """Create meeting recording Invite a recording bot to the incident's meeting. If no previous recordings exist for the platform, @@ -119,14 +115,14 @@ def sync( Args: incident_id (str): - platform (CreateMeetingRecordingPlatform | Unset): + platform (Union[Unset, CreateMeetingRecordingPlatform]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | MeetingRecordingResponse + Union[Any, MeetingRecordingResponse] """ return sync_detailed( @@ -140,8 +136,8 @@ async def asyncio_detailed( incident_id: str, *, client: AuthenticatedClient, - platform: CreateMeetingRecordingPlatform | Unset = UNSET, -) -> Response[Any | MeetingRecordingResponse]: + platform: Union[Unset, CreateMeetingRecordingPlatform] = UNSET, +) -> Response[Union[Any, MeetingRecordingResponse]]: """Create meeting recording Invite a recording bot to the incident's meeting. If no previous recordings exist for the platform, @@ -150,14 +146,14 @@ async def asyncio_detailed( Args: incident_id (str): - platform (CreateMeetingRecordingPlatform | Unset): + platform (Union[Unset, CreateMeetingRecordingPlatform]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | MeetingRecordingResponse] + Response[Union[Any, MeetingRecordingResponse]] """ kwargs = _get_kwargs( @@ -174,8 +170,8 @@ async def asyncio( incident_id: str, *, client: AuthenticatedClient, - platform: CreateMeetingRecordingPlatform | Unset = UNSET, -) -> Any | MeetingRecordingResponse | None: + platform: Union[Unset, CreateMeetingRecordingPlatform] = UNSET, +) -> Optional[Union[Any, MeetingRecordingResponse]]: """Create meeting recording Invite a recording bot to the incident's meeting. If no previous recordings exist for the platform, @@ -184,14 +180,14 @@ async def asyncio( Args: incident_id (str): - platform (CreateMeetingRecordingPlatform | Unset): + platform (Union[Unset, CreateMeetingRecordingPlatform]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | MeetingRecordingResponse + Union[Any, MeetingRecordingResponse] """ return ( diff --git a/rootly_sdk/api/meeting_recordings/delete_meeting_recording.py b/rootly_sdk/api/meeting_recordings/delete_meeting_recording.py index d1b80dd8..8b6880f5 100644 --- a/rootly_sdk/api/meeting_recordings/delete_meeting_recording.py +++ b/rootly_sdk/api/meeting_recordings/delete_meeting_recording.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any, cast -from urllib.parse import quote +from typing import Any, Optional, Union, cast import httpx @@ -13,20 +12,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/meeting_recordings/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/meeting_recordings/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Any | MeetingRecordingResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, MeetingRecordingResponse]]: if response.status_code == 200: response_200 = MeetingRecordingResponse.from_dict(response.json()) @@ -43,8 +39,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[Any | MeetingRecordingResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, MeetingRecordingResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -57,7 +53,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Any | MeetingRecordingResponse]: +) -> Response[Union[Any, MeetingRecordingResponse]]: """Delete a meeting recording Delete a meeting recording. Only completed or failed recordings can be deleted. Active recordings @@ -71,7 +67,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | MeetingRecordingResponse] + Response[Union[Any, MeetingRecordingResponse]] """ kwargs = _get_kwargs( @@ -89,7 +85,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Any | MeetingRecordingResponse | None: +) -> Optional[Union[Any, MeetingRecordingResponse]]: """Delete a meeting recording Delete a meeting recording. Only completed or failed recordings can be deleted. Active recordings @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | MeetingRecordingResponse + Union[Any, MeetingRecordingResponse] """ return sync_detailed( @@ -116,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Any | MeetingRecordingResponse]: +) -> Response[Union[Any, MeetingRecordingResponse]]: """Delete a meeting recording Delete a meeting recording. Only completed or failed recordings can be deleted. Active recordings @@ -130,7 +126,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | MeetingRecordingResponse] + Response[Union[Any, MeetingRecordingResponse]] """ kwargs = _get_kwargs( @@ -146,7 +142,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Any | MeetingRecordingResponse | None: +) -> Optional[Union[Any, MeetingRecordingResponse]]: """Delete a meeting recording Delete a meeting recording. Only completed or failed recordings can be deleted. Active recordings @@ -160,7 +156,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | MeetingRecordingResponse + Union[Any, MeetingRecordingResponse] """ return ( diff --git a/rootly_sdk/api/meeting_recordings/delete_meeting_recording_video.py b/rootly_sdk/api/meeting_recordings/delete_meeting_recording_video.py index b673907a..7a9aa0d7 100644 --- a/rootly_sdk/api/meeting_recordings/delete_meeting_recording_video.py +++ b/rootly_sdk/api/meeting_recordings/delete_meeting_recording_video.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any, cast -from urllib.parse import quote +from typing import Any, Optional, Union, cast import httpx @@ -13,20 +12,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/meeting_recordings/{id}/delete_video".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/meeting_recordings/{id}/delete_video", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Any | MeetingRecordingResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, MeetingRecordingResponse]]: if response.status_code == 200: response_200 = MeetingRecordingResponse.from_dict(response.json()) @@ -43,8 +39,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[Any | MeetingRecordingResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, MeetingRecordingResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -57,7 +53,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Any | MeetingRecordingResponse]: +) -> Response[Union[Any, MeetingRecordingResponse]]: """Delete video from a meeting recording Delete only the video file from a meeting recording. The transcript, summary, and all metadata are @@ -71,7 +67,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | MeetingRecordingResponse] + Response[Union[Any, MeetingRecordingResponse]] """ kwargs = _get_kwargs( @@ -89,7 +85,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Any | MeetingRecordingResponse | None: +) -> Optional[Union[Any, MeetingRecordingResponse]]: """Delete video from a meeting recording Delete only the video file from a meeting recording. The transcript, summary, and all metadata are @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | MeetingRecordingResponse + Union[Any, MeetingRecordingResponse] """ return sync_detailed( @@ -116,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Any | MeetingRecordingResponse]: +) -> Response[Union[Any, MeetingRecordingResponse]]: """Delete video from a meeting recording Delete only the video file from a meeting recording. The transcript, summary, and all metadata are @@ -130,7 +126,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | MeetingRecordingResponse] + Response[Union[Any, MeetingRecordingResponse]] """ kwargs = _get_kwargs( @@ -146,7 +142,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Any | MeetingRecordingResponse | None: +) -> Optional[Union[Any, MeetingRecordingResponse]]: """Delete video from a meeting recording Delete only the video file from a meeting recording. The transcript, summary, and all metadata are @@ -160,7 +156,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | MeetingRecordingResponse + Union[Any, MeetingRecordingResponse] """ return ( diff --git a/rootly_sdk/api/meeting_recordings/delete_standalone_meeting_recording.py b/rootly_sdk/api/meeting_recordings/delete_standalone_meeting_recording.py index 92892c14..9671c261 100644 --- a/rootly_sdk/api/meeting_recordings/delete_standalone_meeting_recording.py +++ b/rootly_sdk/api/meeting_recordings/delete_standalone_meeting_recording.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -12,18 +11,15 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/meeting_recordings/{id}/delete_session".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/meeting_recordings/{id}/delete_session", } return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Any | None: +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: if response.status_code == 204: return None @@ -39,7 +35,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Any]: +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, diff --git a/rootly_sdk/api/meeting_recordings/get_meeting_recording.py b/rootly_sdk/api/meeting_recordings/get_meeting_recording.py index a32f12ff..ff274db9 100644 --- a/rootly_sdk/api/meeting_recordings/get_meeting_recording.py +++ b/rootly_sdk/api/meeting_recordings/get_meeting_recording.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any, cast -from urllib.parse import quote +from typing import Any, Optional, Union, cast import httpx @@ -14,12 +13,11 @@ def _get_kwargs( id: str, *, - include: GetMeetingRecordingInclude | Unset = UNSET, + include: Union[Unset, GetMeetingRecordingInclude] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} - json_include: str | Unset = UNSET + json_include: Union[Unset, str] = UNSET if not isinstance(include, Unset): json_include = include @@ -29,9 +27,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/meeting_recordings/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/meeting_recordings/{id}", "params": params, } @@ -39,8 +35,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Any | MeetingRecordingResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, MeetingRecordingResponse]]: if response.status_code == 200: response_200 = MeetingRecordingResponse.from_dict(response.json()) @@ -57,8 +53,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[Any | MeetingRecordingResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, MeetingRecordingResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -71,8 +67,8 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, - include: GetMeetingRecordingInclude | Unset = UNSET, -) -> Response[Any | MeetingRecordingResponse]: + include: Union[Unset, GetMeetingRecordingInclude] = UNSET, +) -> Response[Union[Any, MeetingRecordingResponse]]: """Get a meeting recording Retrieve a single meeting recording session including its status, duration, speaker count, word @@ -80,14 +76,14 @@ def sync_detailed( Args: id (str): - include (GetMeetingRecordingInclude | Unset): + include (Union[Unset, GetMeetingRecordingInclude]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | MeetingRecordingResponse] + Response[Union[Any, MeetingRecordingResponse]] """ kwargs = _get_kwargs( @@ -106,8 +102,8 @@ def sync( id: str, *, client: AuthenticatedClient, - include: GetMeetingRecordingInclude | Unset = UNSET, -) -> Any | MeetingRecordingResponse | None: + include: Union[Unset, GetMeetingRecordingInclude] = UNSET, +) -> Optional[Union[Any, MeetingRecordingResponse]]: """Get a meeting recording Retrieve a single meeting recording session including its status, duration, speaker count, word @@ -115,14 +111,14 @@ def sync( Args: id (str): - include (GetMeetingRecordingInclude | Unset): + include (Union[Unset, GetMeetingRecordingInclude]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | MeetingRecordingResponse + Union[Any, MeetingRecordingResponse] """ return sync_detailed( @@ -136,8 +132,8 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, - include: GetMeetingRecordingInclude | Unset = UNSET, -) -> Response[Any | MeetingRecordingResponse]: + include: Union[Unset, GetMeetingRecordingInclude] = UNSET, +) -> Response[Union[Any, MeetingRecordingResponse]]: """Get a meeting recording Retrieve a single meeting recording session including its status, duration, speaker count, word @@ -145,14 +141,14 @@ async def asyncio_detailed( Args: id (str): - include (GetMeetingRecordingInclude | Unset): + include (Union[Unset, GetMeetingRecordingInclude]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | MeetingRecordingResponse] + Response[Union[Any, MeetingRecordingResponse]] """ kwargs = _get_kwargs( @@ -169,8 +165,8 @@ async def asyncio( id: str, *, client: AuthenticatedClient, - include: GetMeetingRecordingInclude | Unset = UNSET, -) -> Any | MeetingRecordingResponse | None: + include: Union[Unset, GetMeetingRecordingInclude] = UNSET, +) -> Optional[Union[Any, MeetingRecordingResponse]]: """Get a meeting recording Retrieve a single meeting recording session including its status, duration, speaker count, word @@ -178,14 +174,14 @@ async def asyncio( Args: id (str): - include (GetMeetingRecordingInclude | Unset): + include (Union[Unset, GetMeetingRecordingInclude]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | MeetingRecordingResponse + Union[Any, MeetingRecordingResponse] """ return ( diff --git a/rootly_sdk/api/meeting_recordings/import_meeting_recording.py b/rootly_sdk/api/meeting_recordings/import_meeting_recording.py index 121345b4..81df5ada 100644 --- a/rootly_sdk/api/meeting_recordings/import_meeting_recording.py +++ b/rootly_sdk/api/meeting_recordings/import_meeting_recording.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any, cast -from urllib.parse import quote +from typing import Any, Optional, Union, cast import httpx @@ -8,25 +7,22 @@ from ...client import AuthenticatedClient, Client from ...models.import_meeting_recording import ImportMeetingRecording from ...models.meeting_recording_response import MeetingRecordingResponse -from ...types import UNSET, Response, Unset +from ...types import Response def _get_kwargs( incident_id: str, *, - body: ImportMeetingRecording | Unset = UNSET, + body: ImportMeetingRecording, ) -> dict[str, Any]: headers: dict[str, Any] = {} _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/incidents/{incident_id}/meeting_recordings/import".format( - incident_id=quote(str(incident_id), safe=""), - ), + "url": f"/v1/incidents/{incident_id}/meeting_recordings/import", } - if not isinstance(body, Unset): - _kwargs["json"] = body.to_dict() + _kwargs["json"] = body.to_dict() headers["Content-Type"] = "application/vnd.api+json" @@ -35,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Any | MeetingRecordingResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, MeetingRecordingResponse]]: if response.status_code == 201: response_201 = MeetingRecordingResponse.from_dict(response.json()) @@ -53,8 +49,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[Any | MeetingRecordingResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, MeetingRecordingResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -67,8 +63,8 @@ def sync_detailed( incident_id: str, *, client: AuthenticatedClient, - body: ImportMeetingRecording | Unset = UNSET, -) -> Response[Any | MeetingRecordingResponse]: + body: ImportMeetingRecording, +) -> Response[Union[Any, MeetingRecordingResponse]]: """Import a meeting recording Import an externally captured meeting recording and attach it to an incident. Video and transcript @@ -78,14 +74,14 @@ def sync_detailed( Args: incident_id (str): - body (ImportMeetingRecording | Unset): + body (ImportMeetingRecording): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | MeetingRecordingResponse] + Response[Union[Any, MeetingRecordingResponse]] """ kwargs = _get_kwargs( @@ -104,8 +100,8 @@ def sync( incident_id: str, *, client: AuthenticatedClient, - body: ImportMeetingRecording | Unset = UNSET, -) -> Any | MeetingRecordingResponse | None: + body: ImportMeetingRecording, +) -> Optional[Union[Any, MeetingRecordingResponse]]: """Import a meeting recording Import an externally captured meeting recording and attach it to an incident. Video and transcript @@ -115,14 +111,14 @@ def sync( Args: incident_id (str): - body (ImportMeetingRecording | Unset): + body (ImportMeetingRecording): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | MeetingRecordingResponse + Union[Any, MeetingRecordingResponse] """ return sync_detailed( @@ -136,8 +132,8 @@ async def asyncio_detailed( incident_id: str, *, client: AuthenticatedClient, - body: ImportMeetingRecording | Unset = UNSET, -) -> Response[Any | MeetingRecordingResponse]: + body: ImportMeetingRecording, +) -> Response[Union[Any, MeetingRecordingResponse]]: """Import a meeting recording Import an externally captured meeting recording and attach it to an incident. Video and transcript @@ -147,14 +143,14 @@ async def asyncio_detailed( Args: incident_id (str): - body (ImportMeetingRecording | Unset): + body (ImportMeetingRecording): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | MeetingRecordingResponse] + Response[Union[Any, MeetingRecordingResponse]] """ kwargs = _get_kwargs( @@ -171,8 +167,8 @@ async def asyncio( incident_id: str, *, client: AuthenticatedClient, - body: ImportMeetingRecording | Unset = UNSET, -) -> Any | MeetingRecordingResponse | None: + body: ImportMeetingRecording, +) -> Optional[Union[Any, MeetingRecordingResponse]]: """Import a meeting recording Import an externally captured meeting recording and attach it to an incident. Video and transcript @@ -182,14 +178,14 @@ async def asyncio( Args: incident_id (str): - body (ImportMeetingRecording | Unset): + body (ImportMeetingRecording): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | MeetingRecordingResponse + Union[Any, MeetingRecordingResponse] """ return ( diff --git a/rootly_sdk/api/meeting_recordings/leave_meeting_recording.py b/rootly_sdk/api/meeting_recordings/leave_meeting_recording.py index 1e6a2067..ab5fe030 100644 --- a/rootly_sdk/api/meeting_recordings/leave_meeting_recording.py +++ b/rootly_sdk/api/meeting_recordings/leave_meeting_recording.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any, cast -from urllib.parse import quote +from typing import Any, Optional, Union, cast import httpx @@ -13,20 +12,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/meeting_recordings/{id}/leave".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/meeting_recordings/{id}/leave", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Any | MeetingRecordingResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, MeetingRecordingResponse]]: if response.status_code == 200: response_200 = MeetingRecordingResponse.from_dict(response.json()) @@ -43,8 +39,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[Any | MeetingRecordingResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, MeetingRecordingResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -57,7 +53,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Any | MeetingRecordingResponse]: +) -> Response[Union[Any, MeetingRecordingResponse]]: """Leave a meeting call Remove the recording bot from the meeting entirely. Unlike stop, this immediately disconnects the @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | MeetingRecordingResponse] + Response[Union[Any, MeetingRecordingResponse]] """ kwargs = _get_kwargs( @@ -90,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Any | MeetingRecordingResponse | None: +) -> Optional[Union[Any, MeetingRecordingResponse]]: """Leave a meeting call Remove the recording bot from the meeting entirely. Unlike stop, this immediately disconnects the @@ -105,7 +101,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | MeetingRecordingResponse + Union[Any, MeetingRecordingResponse] """ return sync_detailed( @@ -118,7 +114,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Any | MeetingRecordingResponse]: +) -> Response[Union[Any, MeetingRecordingResponse]]: """Leave a meeting call Remove the recording bot from the meeting entirely. Unlike stop, this immediately disconnects the @@ -133,7 +129,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | MeetingRecordingResponse] + Response[Union[Any, MeetingRecordingResponse]] """ kwargs = _get_kwargs( @@ -149,7 +145,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Any | MeetingRecordingResponse | None: +) -> Optional[Union[Any, MeetingRecordingResponse]]: """Leave a meeting call Remove the recording bot from the meeting entirely. Unlike stop, this immediately disconnects the @@ -164,7 +160,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | MeetingRecordingResponse + Union[Any, MeetingRecordingResponse] """ return ( diff --git a/rootly_sdk/api/meeting_recordings/list_all_meeting_recordings.py b/rootly_sdk/api/meeting_recordings/list_all_meeting_recordings.py index 65341cd2..b13d093a 100644 --- a/rootly_sdk/api/meeting_recordings/list_all_meeting_recordings.py +++ b/rootly_sdk/api/meeting_recordings/list_all_meeting_recordings.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -11,11 +11,10 @@ def _get_kwargs( *, - status: str | Unset = UNSET, - platform: str | Unset = UNSET, - created_by: str | Unset = UNSET, + status: Union[Unset, str] = UNSET, + platform: Union[Unset, str] = UNSET, + created_by: Union[Unset, str] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["status"] = status @@ -35,7 +34,9 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> MeetingRecordingList | None: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[MeetingRecordingList]: if response.status_code == 200: response_200 = MeetingRecordingList.from_dict(response.json()) @@ -48,7 +49,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[MeetingRecordingList]: return Response( status_code=HTTPStatus(response.status_code), @@ -61,9 +62,9 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - status: str | Unset = UNSET, - platform: str | Unset = UNSET, - created_by: str | Unset = UNSET, + status: Union[Unset, str] = UNSET, + platform: Union[Unset, str] = UNSET, + created_by: Union[Unset, str] = UNSET, ) -> Response[MeetingRecordingList]: """List all meeting recordings @@ -72,9 +73,9 @@ def sync_detailed( created_by. Args: - status (str | Unset): - platform (str | Unset): - created_by (str | Unset): + status (Union[Unset, str]): + platform (Union[Unset, str]): + created_by (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -100,10 +101,10 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - status: str | Unset = UNSET, - platform: str | Unset = UNSET, - created_by: str | Unset = UNSET, -) -> MeetingRecordingList | None: + status: Union[Unset, str] = UNSET, + platform: Union[Unset, str] = UNSET, + created_by: Union[Unset, str] = UNSET, +) -> Optional[MeetingRecordingList]: """List all meeting recordings List meeting recordings across the organization. Returns the current user's standalone recordings @@ -111,9 +112,9 @@ def sync( created_by. Args: - status (str | Unset): - platform (str | Unset): - created_by (str | Unset): + status (Union[Unset, str]): + platform (Union[Unset, str]): + created_by (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -134,9 +135,9 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - status: str | Unset = UNSET, - platform: str | Unset = UNSET, - created_by: str | Unset = UNSET, + status: Union[Unset, str] = UNSET, + platform: Union[Unset, str] = UNSET, + created_by: Union[Unset, str] = UNSET, ) -> Response[MeetingRecordingList]: """List all meeting recordings @@ -145,9 +146,9 @@ async def asyncio_detailed( created_by. Args: - status (str | Unset): - platform (str | Unset): - created_by (str | Unset): + status (Union[Unset, str]): + platform (Union[Unset, str]): + created_by (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -171,10 +172,10 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - status: str | Unset = UNSET, - platform: str | Unset = UNSET, - created_by: str | Unset = UNSET, -) -> MeetingRecordingList | None: + status: Union[Unset, str] = UNSET, + platform: Union[Unset, str] = UNSET, + created_by: Union[Unset, str] = UNSET, +) -> Optional[MeetingRecordingList]: """List all meeting recordings List meeting recordings across the organization. Returns the current user's standalone recordings @@ -182,9 +183,9 @@ async def asyncio( created_by. Args: - status (str | Unset): - platform (str | Unset): - created_by (str | Unset): + status (Union[Unset, str]): + platform (Union[Unset, str]): + created_by (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/meeting_recordings/list_meeting_recordings.py b/rootly_sdk/api/meeting_recordings/list_meeting_recordings.py index 891b4d58..add21fdb 100644 --- a/rootly_sdk/api/meeting_recordings/list_meeting_recordings.py +++ b/rootly_sdk/api/meeting_recordings/list_meeting_recordings.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any, cast -from urllib.parse import quote +from typing import Any, Optional, Union, cast import httpx @@ -13,10 +12,9 @@ def _get_kwargs( incident_id: str, *, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["page[number]"] = pagenumber @@ -27,9 +25,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/incidents/{incident_id}/meeting_recordings".format( - incident_id=quote(str(incident_id), safe=""), - ), + "url": f"/v1/incidents/{incident_id}/meeting_recordings", "params": params, } @@ -37,8 +33,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Any | MeetingRecordingList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, MeetingRecordingList]]: if response.status_code == 200: response_200 = MeetingRecordingList.from_dict(response.json()) @@ -55,8 +51,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[Any | MeetingRecordingList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, MeetingRecordingList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,9 +65,9 @@ def sync_detailed( incident_id: str, *, client: AuthenticatedClient, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, -) -> Response[Any | MeetingRecordingList]: + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, +) -> Response[Union[Any, MeetingRecordingList]]: """List meeting recordings List all meeting recording sessions for an incident. Returns recordings sorted by session number. @@ -79,15 +75,15 @@ def sync_detailed( Args: incident_id (str): - pagenumber (int | Unset): - pagesize (int | Unset): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | MeetingRecordingList] + Response[Union[Any, MeetingRecordingList]] """ kwargs = _get_kwargs( @@ -107,9 +103,9 @@ def sync( incident_id: str, *, client: AuthenticatedClient, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, -) -> Any | MeetingRecordingList | None: + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, +) -> Optional[Union[Any, MeetingRecordingList]]: """List meeting recordings List all meeting recording sessions for an incident. Returns recordings sorted by session number. @@ -117,15 +113,15 @@ def sync( Args: incident_id (str): - pagenumber (int | Unset): - pagesize (int | Unset): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | MeetingRecordingList + Union[Any, MeetingRecordingList] """ return sync_detailed( @@ -140,9 +136,9 @@ async def asyncio_detailed( incident_id: str, *, client: AuthenticatedClient, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, -) -> Response[Any | MeetingRecordingList]: + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, +) -> Response[Union[Any, MeetingRecordingList]]: """List meeting recordings List all meeting recording sessions for an incident. Returns recordings sorted by session number. @@ -150,15 +146,15 @@ async def asyncio_detailed( Args: incident_id (str): - pagenumber (int | Unset): - pagesize (int | Unset): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | MeetingRecordingList] + Response[Union[Any, MeetingRecordingList]] """ kwargs = _get_kwargs( @@ -176,9 +172,9 @@ async def asyncio( incident_id: str, *, client: AuthenticatedClient, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, -) -> Any | MeetingRecordingList | None: + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, +) -> Optional[Union[Any, MeetingRecordingList]]: """List meeting recordings List all meeting recording sessions for an incident. Returns recordings sorted by session number. @@ -186,15 +182,15 @@ async def asyncio( Args: incident_id (str): - pagenumber (int | Unset): - pagesize (int | Unset): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | MeetingRecordingList + Union[Any, MeetingRecordingList] """ return ( diff --git a/rootly_sdk/api/meeting_recordings/pause_meeting_recording.py b/rootly_sdk/api/meeting_recordings/pause_meeting_recording.py index ad7f07dc..c4d86bea 100644 --- a/rootly_sdk/api/meeting_recordings/pause_meeting_recording.py +++ b/rootly_sdk/api/meeting_recordings/pause_meeting_recording.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any, cast -from urllib.parse import quote +from typing import Any, Optional, Union, cast import httpx @@ -13,20 +12,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/meeting_recordings/{id}/pause".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/meeting_recordings/{id}/pause", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Any | MeetingRecordingResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, MeetingRecordingResponse]]: if response.status_code == 200: response_200 = MeetingRecordingResponse.from_dict(response.json()) @@ -43,8 +39,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[Any | MeetingRecordingResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, MeetingRecordingResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -57,7 +53,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Any | MeetingRecordingResponse]: +) -> Response[Union[Any, MeetingRecordingResponse]]: """Pause a meeting recording Pause an active recording session. The bot remains in the meeting but stops capturing audio/video. @@ -71,7 +67,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | MeetingRecordingResponse] + Response[Union[Any, MeetingRecordingResponse]] """ kwargs = _get_kwargs( @@ -89,7 +85,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Any | MeetingRecordingResponse | None: +) -> Optional[Union[Any, MeetingRecordingResponse]]: """Pause a meeting recording Pause an active recording session. The bot remains in the meeting but stops capturing audio/video. @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | MeetingRecordingResponse + Union[Any, MeetingRecordingResponse] """ return sync_detailed( @@ -116,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Any | MeetingRecordingResponse]: +) -> Response[Union[Any, MeetingRecordingResponse]]: """Pause a meeting recording Pause an active recording session. The bot remains in the meeting but stops capturing audio/video. @@ -130,7 +126,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | MeetingRecordingResponse] + Response[Union[Any, MeetingRecordingResponse]] """ kwargs = _get_kwargs( @@ -146,7 +142,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Any | MeetingRecordingResponse | None: +) -> Optional[Union[Any, MeetingRecordingResponse]]: """Pause a meeting recording Pause an active recording session. The bot remains in the meeting but stops capturing audio/video. @@ -160,7 +156,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | MeetingRecordingResponse + Union[Any, MeetingRecordingResponse] """ return ( diff --git a/rootly_sdk/api/meeting_recordings/resume_meeting_recording.py b/rootly_sdk/api/meeting_recordings/resume_meeting_recording.py index 867ec697..d6a8b823 100644 --- a/rootly_sdk/api/meeting_recordings/resume_meeting_recording.py +++ b/rootly_sdk/api/meeting_recordings/resume_meeting_recording.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any, cast -from urllib.parse import quote +from typing import Any, Optional, Union, cast import httpx @@ -13,20 +12,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/meeting_recordings/{id}/resume".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/meeting_recordings/{id}/resume", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Any | MeetingRecordingResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, MeetingRecordingResponse]]: if response.status_code == 200: response_200 = MeetingRecordingResponse.from_dict(response.json()) @@ -43,8 +39,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[Any | MeetingRecordingResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, MeetingRecordingResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -57,7 +53,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Any | MeetingRecordingResponse]: +) -> Response[Union[Any, MeetingRecordingResponse]]: """Resume a meeting recording Resume a paused recording session. The bot continues capturing audio/video from the meeting. @@ -70,7 +66,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | MeetingRecordingResponse] + Response[Union[Any, MeetingRecordingResponse]] """ kwargs = _get_kwargs( @@ -88,7 +84,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Any | MeetingRecordingResponse | None: +) -> Optional[Union[Any, MeetingRecordingResponse]]: """Resume a meeting recording Resume a paused recording session. The bot continues capturing audio/video from the meeting. @@ -101,7 +97,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | MeetingRecordingResponse + Union[Any, MeetingRecordingResponse] """ return sync_detailed( @@ -114,7 +110,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Any | MeetingRecordingResponse]: +) -> Response[Union[Any, MeetingRecordingResponse]]: """Resume a meeting recording Resume a paused recording session. The bot continues capturing audio/video from the meeting. @@ -127,7 +123,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | MeetingRecordingResponse] + Response[Union[Any, MeetingRecordingResponse]] """ kwargs = _get_kwargs( @@ -143,7 +139,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Any | MeetingRecordingResponse | None: +) -> Optional[Union[Any, MeetingRecordingResponse]]: """Resume a meeting recording Resume a paused recording session. The bot continues capturing audio/video from the meeting. @@ -156,7 +152,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | MeetingRecordingResponse + Union[Any, MeetingRecordingResponse] """ return ( diff --git a/rootly_sdk/api/meeting_recordings/start_recording_session.py b/rootly_sdk/api/meeting_recordings/start_recording_session.py index 21addcf5..ef4121b8 100644 --- a/rootly_sdk/api/meeting_recordings/start_recording_session.py +++ b/rootly_sdk/api/meeting_recordings/start_recording_session.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, cast +from typing import Any, Optional, Union, cast import httpx @@ -7,12 +7,12 @@ from ...client import AuthenticatedClient, Client from ...models.start_session_request import StartSessionRequest from ...models.start_session_response import StartSessionResponse -from ...types import UNSET, Response, Unset +from ...types import Response def _get_kwargs( *, - body: StartSessionRequest | Unset = UNSET, + body: StartSessionRequest, ) -> dict[str, Any]: headers: dict[str, Any] = {} @@ -21,8 +21,7 @@ def _get_kwargs( "url": "/v1/meeting_recordings/start_session", } - if not isinstance(body, Unset): - _kwargs["json"] = body.to_dict() + _kwargs["json"] = body.to_dict() headers["Content-Type"] = "application/vnd.api+json" @@ -31,8 +30,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Any | StartSessionResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, StartSessionResponse]]: if response.status_code == 201: response_201 = StartSessionResponse.from_dict(response.json()) @@ -49,8 +48,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[Any | StartSessionResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, StartSessionResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -62,8 +61,8 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - body: StartSessionRequest | Unset = UNSET, -) -> Response[Any | StartSessionResponse]: + body: StartSessionRequest, +) -> Response[Union[Any, StartSessionResponse]]: """Start a recording session Start a new desktop recording session. The server creates a recording record and returns a stream @@ -71,14 +70,14 @@ def sync_detailed( client. Args: - body (StartSessionRequest | Unset): + body (StartSessionRequest): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | StartSessionResponse] + Response[Union[Any, StartSessionResponse]] """ kwargs = _get_kwargs( @@ -95,8 +94,8 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - body: StartSessionRequest | Unset = UNSET, -) -> Any | StartSessionResponse | None: + body: StartSessionRequest, +) -> Optional[Union[Any, StartSessionResponse]]: """Start a recording session Start a new desktop recording session. The server creates a recording record and returns a stream @@ -104,14 +103,14 @@ def sync( client. Args: - body (StartSessionRequest | Unset): + body (StartSessionRequest): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | StartSessionResponse + Union[Any, StartSessionResponse] """ return sync_detailed( @@ -123,8 +122,8 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - body: StartSessionRequest | Unset = UNSET, -) -> Response[Any | StartSessionResponse]: + body: StartSessionRequest, +) -> Response[Union[Any, StartSessionResponse]]: """Start a recording session Start a new desktop recording session. The server creates a recording record and returns a stream @@ -132,14 +131,14 @@ async def asyncio_detailed( client. Args: - body (StartSessionRequest | Unset): + body (StartSessionRequest): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | StartSessionResponse] + Response[Union[Any, StartSessionResponse]] """ kwargs = _get_kwargs( @@ -154,8 +153,8 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - body: StartSessionRequest | Unset = UNSET, -) -> Any | StartSessionResponse | None: + body: StartSessionRequest, +) -> Optional[Union[Any, StartSessionResponse]]: """Start a recording session Start a new desktop recording session. The server creates a recording record and returns a stream @@ -163,14 +162,14 @@ async def asyncio( client. Args: - body (StartSessionRequest | Unset): + body (StartSessionRequest): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | StartSessionResponse + Union[Any, StartSessionResponse] """ return ( diff --git a/rootly_sdk/api/meeting_recordings/stop_meeting_recording.py b/rootly_sdk/api/meeting_recordings/stop_meeting_recording.py index 4b59b83a..a960c348 100644 --- a/rootly_sdk/api/meeting_recordings/stop_meeting_recording.py +++ b/rootly_sdk/api/meeting_recordings/stop_meeting_recording.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any, cast -from urllib.parse import quote +from typing import Any, Optional, Union, cast import httpx @@ -13,20 +12,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/meeting_recordings/{id}/stop".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/meeting_recordings/{id}/stop", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Any | MeetingRecordingResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, MeetingRecordingResponse]]: if response.status_code == 200: response_200 = MeetingRecordingResponse.from_dict(response.json()) @@ -43,8 +39,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[Any | MeetingRecordingResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, MeetingRecordingResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -57,7 +53,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Any | MeetingRecordingResponse]: +) -> Response[Union[Any, MeetingRecordingResponse]]: """Stop a meeting recording Stop an active or paused recording. The bot finishes processing, generates a transcript, and the @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | MeetingRecordingResponse] + Response[Union[Any, MeetingRecordingResponse]] """ kwargs = _get_kwargs( @@ -90,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Any | MeetingRecordingResponse | None: +) -> Optional[Union[Any, MeetingRecordingResponse]]: """Stop a meeting recording Stop an active or paused recording. The bot finishes processing, generates a transcript, and the @@ -105,7 +101,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | MeetingRecordingResponse + Union[Any, MeetingRecordingResponse] """ return sync_detailed( @@ -118,7 +114,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Any | MeetingRecordingResponse]: +) -> Response[Union[Any, MeetingRecordingResponse]]: """Stop a meeting recording Stop an active or paused recording. The bot finishes processing, generates a transcript, and the @@ -133,7 +129,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | MeetingRecordingResponse] + Response[Union[Any, MeetingRecordingResponse]] """ kwargs = _get_kwargs( @@ -149,7 +145,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Any | MeetingRecordingResponse | None: +) -> Optional[Union[Any, MeetingRecordingResponse]]: """Stop a meeting recording Stop an active or paused recording. The bot finishes processing, generates a transcript, and the @@ -164,7 +160,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | MeetingRecordingResponse + Union[Any, MeetingRecordingResponse] """ return ( diff --git a/rootly_sdk/api/on_call_pay_reports/create_on_call_pay_report.py b/rootly_sdk/api/on_call_pay_reports/create_on_call_pay_report.py index cf078832..ebfd7d20 100644 --- a/rootly_sdk/api/on_call_pay_reports/create_on_call_pay_report.py +++ b/rootly_sdk/api/on_call_pay_reports/create_on_call_pay_report.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | OnCallPayReportResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, OnCallPayReportResponse]]: if response.status_code == 201: response_201 = OnCallPayReportResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | OnCallPayReportResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, OnCallPayReportResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +69,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewOnCallPayReport, -) -> Response[ErrorsList | OnCallPayReportResponse]: +) -> Response[Union[ErrorsList, OnCallPayReportResponse]]: """Creates an On-Call Pay Report Generates a new on-call pay report for the given date range. The report is generated asynchronously. @@ -82,7 +82,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | OnCallPayReportResponse] + Response[Union[ErrorsList, OnCallPayReportResponse]] """ kwargs = _get_kwargs( @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: NewOnCallPayReport, -) -> ErrorsList | OnCallPayReportResponse | None: +) -> Optional[Union[ErrorsList, OnCallPayReportResponse]]: """Creates an On-Call Pay Report Generates a new on-call pay report for the given date range. The report is generated asynchronously. @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | OnCallPayReportResponse + Union[ErrorsList, OnCallPayReportResponse] """ return sync_detailed( @@ -126,7 +126,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewOnCallPayReport, -) -> Response[ErrorsList | OnCallPayReportResponse]: +) -> Response[Union[ErrorsList, OnCallPayReportResponse]]: """Creates an On-Call Pay Report Generates a new on-call pay report for the given date range. The report is generated asynchronously. @@ -139,7 +139,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | OnCallPayReportResponse] + Response[Union[ErrorsList, OnCallPayReportResponse]] """ kwargs = _get_kwargs( @@ -155,7 +155,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewOnCallPayReport, -) -> ErrorsList | OnCallPayReportResponse | None: +) -> Optional[Union[ErrorsList, OnCallPayReportResponse]]: """Creates an On-Call Pay Report Generates a new on-call pay report for the given date range. The report is generated asynchronously. @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | OnCallPayReportResponse + Union[ErrorsList, OnCallPayReportResponse] """ return ( diff --git a/rootly_sdk/api/on_call_pay_reports/get_on_call_pay_report.py b/rootly_sdk/api/on_call_pay_reports/get_on_call_pay_report.py index e367d8f4..40284b38 100644 --- a/rootly_sdk/api/on_call_pay_reports/get_on_call_pay_report.py +++ b/rootly_sdk/api/on_call_pay_reports/get_on_call_pay_report.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,9 +13,8 @@ def _get_kwargs( id: str, *, - include: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -25,9 +23,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/on_call_pay_reports/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/on_call_pay_reports/{id}", "params": params, } @@ -35,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | OnCallPayReportResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, OnCallPayReportResponse]]: if response.status_code == 200: response_200 = OnCallPayReportResponse.from_dict(response.json()) @@ -54,8 +50,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | OnCallPayReportResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, OnCallPayReportResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -68,22 +64,22 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, -) -> Response[ErrorsList | OnCallPayReportResponse]: + include: Union[Unset, str] = UNSET, +) -> Response[Union[ErrorsList, OnCallPayReportResponse]]: """Retrieves an On-Call Pay Report Retrieves a specific on-call pay report by id Args: id (str): - include (str | Unset): + include (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | OnCallPayReportResponse] + Response[Union[ErrorsList, OnCallPayReportResponse]] """ kwargs = _get_kwargs( @@ -102,22 +98,22 @@ def sync( id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, -) -> ErrorsList | OnCallPayReportResponse | None: + include: Union[Unset, str] = UNSET, +) -> Optional[Union[ErrorsList, OnCallPayReportResponse]]: """Retrieves an On-Call Pay Report Retrieves a specific on-call pay report by id Args: id (str): - include (str | Unset): + include (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | OnCallPayReportResponse + Union[ErrorsList, OnCallPayReportResponse] """ return sync_detailed( @@ -131,22 +127,22 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, -) -> Response[ErrorsList | OnCallPayReportResponse]: + include: Union[Unset, str] = UNSET, +) -> Response[Union[ErrorsList, OnCallPayReportResponse]]: """Retrieves an On-Call Pay Report Retrieves a specific on-call pay report by id Args: id (str): - include (str | Unset): + include (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | OnCallPayReportResponse] + Response[Union[ErrorsList, OnCallPayReportResponse]] """ kwargs = _get_kwargs( @@ -163,22 +159,22 @@ async def asyncio( id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, -) -> ErrorsList | OnCallPayReportResponse | None: + include: Union[Unset, str] = UNSET, +) -> Optional[Union[ErrorsList, OnCallPayReportResponse]]: """Retrieves an On-Call Pay Report Retrieves a specific on-call pay report by id Args: id (str): - include (str | Unset): + include (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | OnCallPayReportResponse + Union[ErrorsList, OnCallPayReportResponse] """ return ( diff --git a/rootly_sdk/api/on_call_pay_reports/list_on_call_pay_reports.py b/rootly_sdk/api/on_call_pay_reports/list_on_call_pay_reports.py index b365e4b4..db45ecec 100644 --- a/rootly_sdk/api/on_call_pay_reports/list_on_call_pay_reports.py +++ b/rootly_sdk/api/on_call_pay_reports/list_on_call_pay_reports.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -11,16 +11,15 @@ def _get_kwargs( *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterstatus: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterstatus: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -50,7 +49,9 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> OnCallPayReportList | None: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[OnCallPayReportList]: if response.status_code == 200: response_200 = OnCallPayReportList.from_dict(response.json()) @@ -62,7 +63,9 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[OnCallPayReportList]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[OnCallPayReportList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -74,28 +77,28 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterstatus: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterstatus: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, ) -> Response[OnCallPayReportList]: """List On-Call Pay Reports List on-call pay reports Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterstatus (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterstatus (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -126,28 +129,28 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterstatus: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, -) -> OnCallPayReportList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterstatus: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, +) -> Optional[OnCallPayReportList]: """List On-Call Pay Reports List on-call pay reports Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterstatus (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterstatus (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -173,28 +176,28 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterstatus: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterstatus: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, ) -> Response[OnCallPayReportList]: """List On-Call Pay Reports List on-call pay reports Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterstatus (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterstatus (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -223,28 +226,28 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterstatus: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, -) -> OnCallPayReportList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterstatus: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, +) -> Optional[OnCallPayReportList]: """List On-Call Pay Reports List on-call pay reports Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterstatus (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterstatus (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/on_call_pay_reports/regenerate_on_call_pay_report.py b/rootly_sdk/api/on_call_pay_reports/regenerate_on_call_pay_report.py index a1d72c27..2a73983d 100644 --- a/rootly_sdk/api/on_call_pay_reports/regenerate_on_call_pay_report.py +++ b/rootly_sdk/api/on_call_pay_reports/regenerate_on_call_pay_report.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/on_call_pay_reports/{id}/regenerate".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/on_call_pay_reports/{id}/regenerate", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | OnCallPayReportResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, OnCallPayReportResponse]]: if response.status_code == 200: response_200 = OnCallPayReportResponse.from_dict(response.json()) @@ -45,8 +41,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | OnCallPayReportResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, OnCallPayReportResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | OnCallPayReportResponse]: +) -> Response[Union[ErrorsList, OnCallPayReportResponse]]: """Regenerate an On-Call Pay Report Triggers regeneration of an existing on-call pay report. @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | OnCallPayReportResponse] + Response[Union[ErrorsList, OnCallPayReportResponse]] """ kwargs = _get_kwargs( @@ -90,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | OnCallPayReportResponse | None: +) -> Optional[Union[ErrorsList, OnCallPayReportResponse]]: """Regenerate an On-Call Pay Report Triggers regeneration of an existing on-call pay report. @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | OnCallPayReportResponse + Union[ErrorsList, OnCallPayReportResponse] """ return sync_detailed( @@ -116,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | OnCallPayReportResponse]: +) -> Response[Union[ErrorsList, OnCallPayReportResponse]]: """Regenerate an On-Call Pay Report Triggers regeneration of an existing on-call pay report. @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | OnCallPayReportResponse] + Response[Union[ErrorsList, OnCallPayReportResponse]] """ kwargs = _get_kwargs( @@ -145,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | OnCallPayReportResponse | None: +) -> Optional[Union[ErrorsList, OnCallPayReportResponse]]: """Regenerate an On-Call Pay Report Triggers regeneration of an existing on-call pay report. @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | OnCallPayReportResponse + Union[ErrorsList, OnCallPayReportResponse] """ return ( diff --git a/rootly_sdk/api/on_call_pay_reports/update_on_call_pay_report.py b/rootly_sdk/api/on_call_pay_reports/update_on_call_pay_report.py index 7939e005..d27af043 100644 --- a/rootly_sdk/api/on_call_pay_reports/update_on_call_pay_report.py +++ b/rootly_sdk/api/on_call_pay_reports/update_on_call_pay_report.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/on_call_pay_reports/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/on_call_pay_reports/{id}", } _kwargs["json"] = body.to_dict() @@ -35,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | OnCallPayReportResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, OnCallPayReportResponse]]: if response.status_code == 200: response_200 = OnCallPayReportResponse.from_dict(response.json()) @@ -59,8 +56,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | OnCallPayReportResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, OnCallPayReportResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -74,7 +71,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateOnCallPayReport, -) -> Response[ErrorsList | OnCallPayReportResponse]: +) -> Response[Union[ErrorsList, OnCallPayReportResponse]]: """Update an On-Call Pay Report Update a specific on-call pay report by id. Triggers report regeneration. @@ -88,7 +85,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | OnCallPayReportResponse] + Response[Union[ErrorsList, OnCallPayReportResponse]] """ kwargs = _get_kwargs( @@ -108,7 +105,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateOnCallPayReport, -) -> ErrorsList | OnCallPayReportResponse | None: +) -> Optional[Union[ErrorsList, OnCallPayReportResponse]]: """Update an On-Call Pay Report Update a specific on-call pay report by id. Triggers report regeneration. @@ -122,7 +119,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | OnCallPayReportResponse + Union[ErrorsList, OnCallPayReportResponse] """ return sync_detailed( @@ -137,7 +134,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateOnCallPayReport, -) -> Response[ErrorsList | OnCallPayReportResponse]: +) -> Response[Union[ErrorsList, OnCallPayReportResponse]]: """Update an On-Call Pay Report Update a specific on-call pay report by id. Triggers report regeneration. @@ -151,7 +148,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | OnCallPayReportResponse] + Response[Union[ErrorsList, OnCallPayReportResponse]] """ kwargs = _get_kwargs( @@ -169,7 +166,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateOnCallPayReport, -) -> ErrorsList | OnCallPayReportResponse | None: +) -> Optional[Union[ErrorsList, OnCallPayReportResponse]]: """Update an On-Call Pay Report Update a specific on-call pay report by id. Triggers report regeneration. @@ -183,7 +180,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | OnCallPayReportResponse + Union[ErrorsList, OnCallPayReportResponse] """ return ( diff --git a/rootly_sdk/api/on_call_roles/create_on_call_role.py b/rootly_sdk/api/on_call_roles/create_on_call_role.py index 322f9107..d90d9cf7 100644 --- a/rootly_sdk/api/on_call_roles/create_on_call_role.py +++ b/rootly_sdk/api/on_call_roles/create_on_call_role.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | OnCallRoleResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, OnCallRoleResponse]]: if response.status_code == 201: response_201 = OnCallRoleResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | OnCallRoleResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, OnCallRoleResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +69,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewOnCallRole, -) -> Response[ErrorsList | OnCallRoleResponse]: +) -> Response[Union[ErrorsList, OnCallRoleResponse]]: """Creates an On-Call Role Creates a new On-Call Role from provided data @@ -82,7 +82,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | OnCallRoleResponse] + Response[Union[ErrorsList, OnCallRoleResponse]] """ kwargs = _get_kwargs( @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: NewOnCallRole, -) -> ErrorsList | OnCallRoleResponse | None: +) -> Optional[Union[ErrorsList, OnCallRoleResponse]]: """Creates an On-Call Role Creates a new On-Call Role from provided data @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | OnCallRoleResponse + Union[ErrorsList, OnCallRoleResponse] """ return sync_detailed( @@ -126,7 +126,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewOnCallRole, -) -> Response[ErrorsList | OnCallRoleResponse]: +) -> Response[Union[ErrorsList, OnCallRoleResponse]]: """Creates an On-Call Role Creates a new On-Call Role from provided data @@ -139,7 +139,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | OnCallRoleResponse] + Response[Union[ErrorsList, OnCallRoleResponse]] """ kwargs = _get_kwargs( @@ -155,7 +155,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewOnCallRole, -) -> ErrorsList | OnCallRoleResponse | None: +) -> Optional[Union[ErrorsList, OnCallRoleResponse]]: """Creates an On-Call Role Creates a new On-Call Role from provided data @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | OnCallRoleResponse + Union[ErrorsList, OnCallRoleResponse] """ return ( diff --git a/rootly_sdk/api/on_call_roles/delete_on_call_role.py b/rootly_sdk/api/on_call_roles/delete_on_call_role.py index 3fe85371..cba7de3b 100644 --- a/rootly_sdk/api/on_call_roles/delete_on_call_role.py +++ b/rootly_sdk/api/on_call_roles/delete_on_call_role.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/on_call_roles/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/on_call_roles/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | OnCallRoleResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, OnCallRoleResponse]]: if response.status_code == 200: response_200 = OnCallRoleResponse.from_dict(response.json()) @@ -45,8 +41,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | OnCallRoleResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, OnCallRoleResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | OnCallRoleResponse]: +) -> Response[Union[ErrorsList, OnCallRoleResponse]]: """Delete an On-Call Role Delete a specific On-Call Role by id @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | OnCallRoleResponse] + Response[Union[ErrorsList, OnCallRoleResponse]] """ kwargs = _get_kwargs( @@ -90,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | OnCallRoleResponse | None: +) -> Optional[Union[ErrorsList, OnCallRoleResponse]]: """Delete an On-Call Role Delete a specific On-Call Role by id @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | OnCallRoleResponse + Union[ErrorsList, OnCallRoleResponse] """ return sync_detailed( @@ -116,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | OnCallRoleResponse]: +) -> Response[Union[ErrorsList, OnCallRoleResponse]]: """Delete an On-Call Role Delete a specific On-Call Role by id @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | OnCallRoleResponse] + Response[Union[ErrorsList, OnCallRoleResponse]] """ kwargs = _get_kwargs( @@ -145,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | OnCallRoleResponse | None: +) -> Optional[Union[ErrorsList, OnCallRoleResponse]]: """Delete an On-Call Role Delete a specific On-Call Role by id @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | OnCallRoleResponse + Union[ErrorsList, OnCallRoleResponse] """ return ( diff --git a/rootly_sdk/api/on_call_roles/get_on_call_role.py b/rootly_sdk/api/on_call_roles/get_on_call_role.py index b58a3457..8fd359bc 100644 --- a/rootly_sdk/api/on_call_roles/get_on_call_role.py +++ b/rootly_sdk/api/on_call_roles/get_on_call_role.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/on_call_roles/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/on_call_roles/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | OnCallRoleResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, OnCallRoleResponse]]: if response.status_code == 200: response_200 = OnCallRoleResponse.from_dict(response.json()) @@ -45,8 +41,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | OnCallRoleResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, OnCallRoleResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | OnCallRoleResponse]: +) -> Response[Union[ErrorsList, OnCallRoleResponse]]: """Retrieves an On-Call Role Retrieves a specific On-Call Role by id @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | OnCallRoleResponse] + Response[Union[ErrorsList, OnCallRoleResponse]] """ kwargs = _get_kwargs( @@ -90,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | OnCallRoleResponse | None: +) -> Optional[Union[ErrorsList, OnCallRoleResponse]]: """Retrieves an On-Call Role Retrieves a specific On-Call Role by id @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | OnCallRoleResponse + Union[ErrorsList, OnCallRoleResponse] """ return sync_detailed( @@ -116,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | OnCallRoleResponse]: +) -> Response[Union[ErrorsList, OnCallRoleResponse]]: """Retrieves an On-Call Role Retrieves a specific On-Call Role by id @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | OnCallRoleResponse] + Response[Union[ErrorsList, OnCallRoleResponse]] """ kwargs = _get_kwargs( @@ -145,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | OnCallRoleResponse | None: +) -> Optional[Union[ErrorsList, OnCallRoleResponse]]: """Retrieves an On-Call Role Retrieves a specific On-Call Role by id @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | OnCallRoleResponse + Union[ErrorsList, OnCallRoleResponse] """ return ( diff --git a/rootly_sdk/api/on_call_roles/list_on_call_roles.py b/rootly_sdk/api/on_call_roles/list_on_call_roles.py index cee91de5..90270c3c 100644 --- a/rootly_sdk/api/on_call_roles/list_on_call_roles.py +++ b/rootly_sdk/api/on_call_roles/list_on_call_roles.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -11,19 +11,18 @@ def _get_kwargs( *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -59,7 +58,9 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> OnCallRoleList | None: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[OnCallRoleList]: if response.status_code == 200: response_200 = OnCallRoleList.from_dict(response.json()) @@ -71,7 +72,9 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[OnCallRoleList]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[OnCallRoleList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -83,34 +86,34 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, ) -> Response[OnCallRoleList]: """List On-Call Roles List On-Call Roles Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -144,34 +147,34 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, -) -> OnCallRoleList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, +) -> Optional[OnCallRoleList]: """List On-Call Roles List On-Call Roles Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -200,34 +203,34 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, ) -> Response[OnCallRoleList]: """List On-Call Roles List On-Call Roles Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -259,34 +262,34 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, -) -> OnCallRoleList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, +) -> Optional[OnCallRoleList]: """List On-Call Roles List On-Call Roles Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/on_call_roles/update_on_call_role.py b/rootly_sdk/api/on_call_roles/update_on_call_role.py index 9fc73101..823ce122 100644 --- a/rootly_sdk/api/on_call_roles/update_on_call_role.py +++ b/rootly_sdk/api/on_call_roles/update_on_call_role.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/on_call_roles/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/on_call_roles/{id}", } _kwargs["json"] = body.to_dict() @@ -35,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | OnCallRoleResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, OnCallRoleResponse]]: if response.status_code == 200: response_200 = OnCallRoleResponse.from_dict(response.json()) @@ -54,8 +51,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | OnCallRoleResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, OnCallRoleResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateOnCallRole, -) -> Response[ErrorsList | OnCallRoleResponse]: +) -> Response[Union[ErrorsList, OnCallRoleResponse]]: """Update an On-Call Role Update a specific On-Call Role by id @@ -83,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | OnCallRoleResponse] + Response[Union[ErrorsList, OnCallRoleResponse]] """ kwargs = _get_kwargs( @@ -103,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateOnCallRole, -) -> ErrorsList | OnCallRoleResponse | None: +) -> Optional[Union[ErrorsList, OnCallRoleResponse]]: """Update an On-Call Role Update a specific On-Call Role by id @@ -117,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | OnCallRoleResponse + Union[ErrorsList, OnCallRoleResponse] """ return sync_detailed( @@ -132,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateOnCallRole, -) -> Response[ErrorsList | OnCallRoleResponse]: +) -> Response[Union[ErrorsList, OnCallRoleResponse]]: """Update an On-Call Role Update a specific On-Call Role by id @@ -146,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | OnCallRoleResponse] + Response[Union[ErrorsList, OnCallRoleResponse]] """ kwargs = _get_kwargs( @@ -164,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateOnCallRole, -) -> ErrorsList | OnCallRoleResponse | None: +) -> Optional[Union[ErrorsList, OnCallRoleResponse]]: """Update an On-Call Role Update a specific On-Call Role by id @@ -178,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | OnCallRoleResponse + Union[ErrorsList, OnCallRoleResponse] """ return ( diff --git a/rootly_sdk/api/on_call_shadows/create_on_call_shadow.py b/rootly_sdk/api/on_call_shadows/create_on_call_shadow.py index e1038ade..fca68680 100644 --- a/rootly_sdk/api/on_call_shadows/create_on_call_shadow.py +++ b/rootly_sdk/api/on_call_shadows/create_on_call_shadow.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/schedules/{schedule_id}/on_call_shadows".format( - schedule_id=quote(str(schedule_id), safe=""), - ), + "url": f"/v1/schedules/{schedule_id}/on_call_shadows", } _kwargs["json"] = body.to_dict() @@ -35,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | OnCallShadowResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, OnCallShadowResponse]]: if response.status_code == 201: response_201 = OnCallShadowResponse.from_dict(response.json()) @@ -59,8 +56,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | OnCallShadowResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, OnCallShadowResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -74,7 +71,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewOnCallShadow, -) -> Response[ErrorsList | OnCallShadowResponse]: +) -> Response[Union[ErrorsList, OnCallShadowResponse]]: """creates an shadow configuration Creates a new on call shadow configuration from provided data @@ -88,7 +85,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | OnCallShadowResponse] + Response[Union[ErrorsList, OnCallShadowResponse]] """ kwargs = _get_kwargs( @@ -108,7 +105,7 @@ def sync( *, client: AuthenticatedClient, body: NewOnCallShadow, -) -> ErrorsList | OnCallShadowResponse | None: +) -> Optional[Union[ErrorsList, OnCallShadowResponse]]: """creates an shadow configuration Creates a new on call shadow configuration from provided data @@ -122,7 +119,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | OnCallShadowResponse + Union[ErrorsList, OnCallShadowResponse] """ return sync_detailed( @@ -137,7 +134,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewOnCallShadow, -) -> Response[ErrorsList | OnCallShadowResponse]: +) -> Response[Union[ErrorsList, OnCallShadowResponse]]: """creates an shadow configuration Creates a new on call shadow configuration from provided data @@ -151,7 +148,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | OnCallShadowResponse] + Response[Union[ErrorsList, OnCallShadowResponse]] """ kwargs = _get_kwargs( @@ -169,7 +166,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewOnCallShadow, -) -> ErrorsList | OnCallShadowResponse | None: +) -> Optional[Union[ErrorsList, OnCallShadowResponse]]: """creates an shadow configuration Creates a new on call shadow configuration from provided data @@ -183,7 +180,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | OnCallShadowResponse + Union[ErrorsList, OnCallShadowResponse] """ return ( diff --git a/rootly_sdk/api/on_call_shadows/get_on_call_shadow.py b/rootly_sdk/api/on_call_shadows/get_on_call_shadow.py index 3892b844..33dc51e4 100644 --- a/rootly_sdk/api/on_call_shadows/get_on_call_shadow.py +++ b/rootly_sdk/api/on_call_shadows/get_on_call_shadow.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/on_call_shadows/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/on_call_shadows/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | OnCallShadowResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, OnCallShadowResponse]]: if response.status_code == 200: response_200 = OnCallShadowResponse.from_dict(response.json()) @@ -45,8 +41,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | OnCallShadowResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, OnCallShadowResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | OnCallShadowResponse]: +) -> Response[Union[ErrorsList, OnCallShadowResponse]]: """Retrieves an On Call Shadow configuration by ID Retrieves a specific On Call Shadow configuration by ID @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | OnCallShadowResponse] + Response[Union[ErrorsList, OnCallShadowResponse]] """ kwargs = _get_kwargs( @@ -90,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | OnCallShadowResponse | None: +) -> Optional[Union[ErrorsList, OnCallShadowResponse]]: """Retrieves an On Call Shadow configuration by ID Retrieves a specific On Call Shadow configuration by ID @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | OnCallShadowResponse + Union[ErrorsList, OnCallShadowResponse] """ return sync_detailed( @@ -116,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | OnCallShadowResponse]: +) -> Response[Union[ErrorsList, OnCallShadowResponse]]: """Retrieves an On Call Shadow configuration by ID Retrieves a specific On Call Shadow configuration by ID @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | OnCallShadowResponse] + Response[Union[ErrorsList, OnCallShadowResponse]] """ kwargs = _get_kwargs( @@ -145,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | OnCallShadowResponse | None: +) -> Optional[Union[ErrorsList, OnCallShadowResponse]]: """Retrieves an On Call Shadow configuration by ID Retrieves a specific On Call Shadow configuration by ID @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | OnCallShadowResponse + Union[ErrorsList, OnCallShadowResponse] """ return ( diff --git a/rootly_sdk/api/on_call_shadows/list_on_call_shadows.py b/rootly_sdk/api/on_call_shadows/list_on_call_shadows.py index 310cdcf4..e40bd629 100644 --- a/rootly_sdk/api/on_call_shadows/list_on_call_shadows.py +++ b/rootly_sdk/api/on_call_shadows/list_on_call_shadows.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -13,11 +12,10 @@ def _get_kwargs( schedule_id: str, *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -30,16 +28,16 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/schedules/{schedule_id}/on_call_shadows".format( - schedule_id=quote(str(schedule_id), safe=""), - ), + "url": f"/v1/schedules/{schedule_id}/on_call_shadows", "params": params, } return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> OnCallShadowsList | None: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[OnCallShadowsList]: if response.status_code == 200: response_200 = OnCallShadowsList.from_dict(response.json()) @@ -51,7 +49,9 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[OnCallShadowsList]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[OnCallShadowsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -64,9 +64,9 @@ def sync_detailed( schedule_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, ) -> Response[OnCallShadowsList]: """List On Call Shadows for Shift @@ -74,9 +74,9 @@ def sync_detailed( Args: schedule_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -104,19 +104,19 @@ def sync( schedule_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, -) -> OnCallShadowsList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, +) -> Optional[OnCallShadowsList]: """List On Call Shadows for Shift List shadow shifts for schedule Args: schedule_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -139,9 +139,9 @@ async def asyncio_detailed( schedule_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, ) -> Response[OnCallShadowsList]: """List On Call Shadows for Shift @@ -149,9 +149,9 @@ async def asyncio_detailed( Args: schedule_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -177,19 +177,19 @@ async def asyncio( schedule_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, -) -> OnCallShadowsList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, +) -> Optional[OnCallShadowsList]: """List On Call Shadows for Shift List shadow shifts for schedule Args: schedule_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/on_call_shadows/update_on_call_shadow.py b/rootly_sdk/api/on_call_shadows/update_on_call_shadow.py index cbaeedb7..a004160b 100644 --- a/rootly_sdk/api/on_call_shadows/update_on_call_shadow.py +++ b/rootly_sdk/api/on_call_shadows/update_on_call_shadow.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/on_call_shadows/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/on_call_shadows/{id}", } _kwargs["json"] = body.to_dict() @@ -35,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | OnCallShadowResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, OnCallShadowResponse]]: if response.status_code == 200: response_200 = OnCallShadowResponse.from_dict(response.json()) @@ -54,8 +51,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | OnCallShadowResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, OnCallShadowResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateOnCallShadow, -) -> Response[ErrorsList | OnCallShadowResponse]: +) -> Response[Union[ErrorsList, OnCallShadowResponse]]: """Update an On Call Shadow configuration Update a specific on call shadow configuration by id @@ -83,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | OnCallShadowResponse] + Response[Union[ErrorsList, OnCallShadowResponse]] """ kwargs = _get_kwargs( @@ -103,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateOnCallShadow, -) -> ErrorsList | OnCallShadowResponse | None: +) -> Optional[Union[ErrorsList, OnCallShadowResponse]]: """Update an On Call Shadow configuration Update a specific on call shadow configuration by id @@ -117,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | OnCallShadowResponse + Union[ErrorsList, OnCallShadowResponse] """ return sync_detailed( @@ -132,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateOnCallShadow, -) -> Response[ErrorsList | OnCallShadowResponse]: +) -> Response[Union[ErrorsList, OnCallShadowResponse]]: """Update an On Call Shadow configuration Update a specific on call shadow configuration by id @@ -146,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | OnCallShadowResponse] + Response[Union[ErrorsList, OnCallShadowResponse]] """ kwargs = _get_kwargs( @@ -164,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateOnCallShadow, -) -> ErrorsList | OnCallShadowResponse | None: +) -> Optional[Union[ErrorsList, OnCallShadowResponse]]: """Update an On Call Shadow configuration Update a specific on call shadow configuration by id @@ -178,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | OnCallShadowResponse + Union[ErrorsList, OnCallShadowResponse] """ return ( diff --git a/rootly_sdk/api/on_calls/list_oncalls.py b/rootly_sdk/api/on_calls/list_oncalls.py index 4d9fca2e..e74a4212 100644 --- a/rootly_sdk/api/on_calls/list_oncalls.py +++ b/rootly_sdk/api/on_calls/list_oncalls.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -13,22 +13,21 @@ def _get_kwargs( *, - include: ListOncallsInclude | Unset = UNSET, - since: str | Unset = UNSET, - until: str | Unset = UNSET, - earliest: bool | Unset = UNSET, - time_zone: str | Unset = UNSET, - filterescalation_policy_ids: str | Unset = UNSET, - filterschedule_ids: str | Unset = UNSET, - filteruser_ids: str | Unset = UNSET, - filterservice_ids: str | Unset = UNSET, - filtergroup_ids: str | Unset = UNSET, - filternotification_types: str | Unset = UNSET, + include: Union[Unset, ListOncallsInclude] = UNSET, + since: Union[Unset, str] = UNSET, + until: Union[Unset, str] = UNSET, + earliest: Union[Unset, bool] = UNSET, + time_zone: Union[Unset, str] = UNSET, + filterescalation_policy_ids: Union[Unset, str] = UNSET, + filterschedule_ids: Union[Unset, str] = UNSET, + filteruser_ids: Union[Unset, str] = UNSET, + filterservice_ids: Union[Unset, str] = UNSET, + filtergroup_ids: Union[Unset, str] = UNSET, + filternotification_types: Union[Unset, str] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} - json_include: str | Unset = UNSET + json_include: Union[Unset, str] = UNSET if not isinstance(include, Unset): json_include = include @@ -66,8 +65,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | OncallList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, OncallList]]: if response.status_code == 200: response_200 = OncallList.from_dict(response.json()) @@ -90,8 +89,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | OncallList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, OncallList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -103,42 +102,42 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - include: ListOncallsInclude | Unset = UNSET, - since: str | Unset = UNSET, - until: str | Unset = UNSET, - earliest: bool | Unset = UNSET, - time_zone: str | Unset = UNSET, - filterescalation_policy_ids: str | Unset = UNSET, - filterschedule_ids: str | Unset = UNSET, - filteruser_ids: str | Unset = UNSET, - filterservice_ids: str | Unset = UNSET, - filtergroup_ids: str | Unset = UNSET, - filternotification_types: str | Unset = UNSET, -) -> Response[ErrorsList | OncallList]: + include: Union[Unset, ListOncallsInclude] = UNSET, + since: Union[Unset, str] = UNSET, + until: Union[Unset, str] = UNSET, + earliest: Union[Unset, bool] = UNSET, + time_zone: Union[Unset, str] = UNSET, + filterescalation_policy_ids: Union[Unset, str] = UNSET, + filterschedule_ids: Union[Unset, str] = UNSET, + filteruser_ids: Union[Unset, str] = UNSET, + filterservice_ids: Union[Unset, str] = UNSET, + filtergroup_ids: Union[Unset, str] = UNSET, + filternotification_types: Union[Unset, str] = UNSET, +) -> Response[Union[ErrorsList, OncallList]]: """List on-calls List who is currently on-call, with support for filtering by escalation policy, schedule, and user. Returns on-call entries grouped by escalation policy level. Args: - include (ListOncallsInclude | Unset): - since (str | Unset): - until (str | Unset): - earliest (bool | Unset): - time_zone (str | Unset): - filterescalation_policy_ids (str | Unset): - filterschedule_ids (str | Unset): - filteruser_ids (str | Unset): - filterservice_ids (str | Unset): - filtergroup_ids (str | Unset): - filternotification_types (str | Unset): + include (Union[Unset, ListOncallsInclude]): + since (Union[Unset, str]): + until (Union[Unset, str]): + earliest (Union[Unset, bool]): + time_zone (Union[Unset, str]): + filterescalation_policy_ids (Union[Unset, str]): + filterschedule_ids (Union[Unset, str]): + filteruser_ids (Union[Unset, str]): + filterservice_ids (Union[Unset, str]): + filtergroup_ids (Union[Unset, str]): + filternotification_types (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | OncallList] + Response[Union[ErrorsList, OncallList]] """ kwargs = _get_kwargs( @@ -165,42 +164,42 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: ListOncallsInclude | Unset = UNSET, - since: str | Unset = UNSET, - until: str | Unset = UNSET, - earliest: bool | Unset = UNSET, - time_zone: str | Unset = UNSET, - filterescalation_policy_ids: str | Unset = UNSET, - filterschedule_ids: str | Unset = UNSET, - filteruser_ids: str | Unset = UNSET, - filterservice_ids: str | Unset = UNSET, - filtergroup_ids: str | Unset = UNSET, - filternotification_types: str | Unset = UNSET, -) -> ErrorsList | OncallList | None: + include: Union[Unset, ListOncallsInclude] = UNSET, + since: Union[Unset, str] = UNSET, + until: Union[Unset, str] = UNSET, + earliest: Union[Unset, bool] = UNSET, + time_zone: Union[Unset, str] = UNSET, + filterescalation_policy_ids: Union[Unset, str] = UNSET, + filterschedule_ids: Union[Unset, str] = UNSET, + filteruser_ids: Union[Unset, str] = UNSET, + filterservice_ids: Union[Unset, str] = UNSET, + filtergroup_ids: Union[Unset, str] = UNSET, + filternotification_types: Union[Unset, str] = UNSET, +) -> Optional[Union[ErrorsList, OncallList]]: """List on-calls List who is currently on-call, with support for filtering by escalation policy, schedule, and user. Returns on-call entries grouped by escalation policy level. Args: - include (ListOncallsInclude | Unset): - since (str | Unset): - until (str | Unset): - earliest (bool | Unset): - time_zone (str | Unset): - filterescalation_policy_ids (str | Unset): - filterschedule_ids (str | Unset): - filteruser_ids (str | Unset): - filterservice_ids (str | Unset): - filtergroup_ids (str | Unset): - filternotification_types (str | Unset): + include (Union[Unset, ListOncallsInclude]): + since (Union[Unset, str]): + until (Union[Unset, str]): + earliest (Union[Unset, bool]): + time_zone (Union[Unset, str]): + filterescalation_policy_ids (Union[Unset, str]): + filterschedule_ids (Union[Unset, str]): + filteruser_ids (Union[Unset, str]): + filterservice_ids (Union[Unset, str]): + filtergroup_ids (Union[Unset, str]): + filternotification_types (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | OncallList + Union[ErrorsList, OncallList] """ return sync_detailed( @@ -222,42 +221,42 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: ListOncallsInclude | Unset = UNSET, - since: str | Unset = UNSET, - until: str | Unset = UNSET, - earliest: bool | Unset = UNSET, - time_zone: str | Unset = UNSET, - filterescalation_policy_ids: str | Unset = UNSET, - filterschedule_ids: str | Unset = UNSET, - filteruser_ids: str | Unset = UNSET, - filterservice_ids: str | Unset = UNSET, - filtergroup_ids: str | Unset = UNSET, - filternotification_types: str | Unset = UNSET, -) -> Response[ErrorsList | OncallList]: + include: Union[Unset, ListOncallsInclude] = UNSET, + since: Union[Unset, str] = UNSET, + until: Union[Unset, str] = UNSET, + earliest: Union[Unset, bool] = UNSET, + time_zone: Union[Unset, str] = UNSET, + filterescalation_policy_ids: Union[Unset, str] = UNSET, + filterschedule_ids: Union[Unset, str] = UNSET, + filteruser_ids: Union[Unset, str] = UNSET, + filterservice_ids: Union[Unset, str] = UNSET, + filtergroup_ids: Union[Unset, str] = UNSET, + filternotification_types: Union[Unset, str] = UNSET, +) -> Response[Union[ErrorsList, OncallList]]: """List on-calls List who is currently on-call, with support for filtering by escalation policy, schedule, and user. Returns on-call entries grouped by escalation policy level. Args: - include (ListOncallsInclude | Unset): - since (str | Unset): - until (str | Unset): - earliest (bool | Unset): - time_zone (str | Unset): - filterescalation_policy_ids (str | Unset): - filterschedule_ids (str | Unset): - filteruser_ids (str | Unset): - filterservice_ids (str | Unset): - filtergroup_ids (str | Unset): - filternotification_types (str | Unset): + include (Union[Unset, ListOncallsInclude]): + since (Union[Unset, str]): + until (Union[Unset, str]): + earliest (Union[Unset, bool]): + time_zone (Union[Unset, str]): + filterescalation_policy_ids (Union[Unset, str]): + filterschedule_ids (Union[Unset, str]): + filteruser_ids (Union[Unset, str]): + filterservice_ids (Union[Unset, str]): + filtergroup_ids (Union[Unset, str]): + filternotification_types (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | OncallList] + Response[Union[ErrorsList, OncallList]] """ kwargs = _get_kwargs( @@ -282,42 +281,42 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: ListOncallsInclude | Unset = UNSET, - since: str | Unset = UNSET, - until: str | Unset = UNSET, - earliest: bool | Unset = UNSET, - time_zone: str | Unset = UNSET, - filterescalation_policy_ids: str | Unset = UNSET, - filterschedule_ids: str | Unset = UNSET, - filteruser_ids: str | Unset = UNSET, - filterservice_ids: str | Unset = UNSET, - filtergroup_ids: str | Unset = UNSET, - filternotification_types: str | Unset = UNSET, -) -> ErrorsList | OncallList | None: + include: Union[Unset, ListOncallsInclude] = UNSET, + since: Union[Unset, str] = UNSET, + until: Union[Unset, str] = UNSET, + earliest: Union[Unset, bool] = UNSET, + time_zone: Union[Unset, str] = UNSET, + filterescalation_policy_ids: Union[Unset, str] = UNSET, + filterschedule_ids: Union[Unset, str] = UNSET, + filteruser_ids: Union[Unset, str] = UNSET, + filterservice_ids: Union[Unset, str] = UNSET, + filtergroup_ids: Union[Unset, str] = UNSET, + filternotification_types: Union[Unset, str] = UNSET, +) -> Optional[Union[ErrorsList, OncallList]]: """List on-calls List who is currently on-call, with support for filtering by escalation policy, schedule, and user. Returns on-call entries grouped by escalation policy level. Args: - include (ListOncallsInclude | Unset): - since (str | Unset): - until (str | Unset): - earliest (bool | Unset): - time_zone (str | Unset): - filterescalation_policy_ids (str | Unset): - filterschedule_ids (str | Unset): - filteruser_ids (str | Unset): - filterservice_ids (str | Unset): - filtergroup_ids (str | Unset): - filternotification_types (str | Unset): + include (Union[Unset, ListOncallsInclude]): + since (Union[Unset, str]): + until (Union[Unset, str]): + earliest (Union[Unset, bool]): + time_zone (Union[Unset, str]): + filterescalation_policy_ids (Union[Unset, str]): + filterschedule_ids (Union[Unset, str]): + filteruser_ids (Union[Unset, str]): + filterservice_ids (Union[Unset, str]): + filtergroup_ids (Union[Unset, str]): + filternotification_types (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | OncallList + Union[ErrorsList, OncallList] """ return ( diff --git a/rootly_sdk/api/override_shifts/create_override_shift.py b/rootly_sdk/api/override_shifts/create_override_shift.py index ec336dd4..bdd7f59d 100644 --- a/rootly_sdk/api/override_shifts/create_override_shift.py +++ b/rootly_sdk/api/override_shifts/create_override_shift.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/schedules/{schedule_id}/override_shifts".format( - schedule_id=quote(str(schedule_id), safe=""), - ), + "url": f"/v1/schedules/{schedule_id}/override_shifts", } _kwargs["json"] = body.to_dict() @@ -35,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | OverrideShiftResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, OverrideShiftResponse]]: if response.status_code == 200: response_200 = OverrideShiftResponse.from_dict(response.json()) @@ -64,8 +61,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | OverrideShiftResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, OverrideShiftResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -79,7 +76,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewOverrideShift, -) -> Response[ErrorsList | OverrideShiftResponse]: +) -> Response[Union[ErrorsList, OverrideShiftResponse]]: """creates an override shift Creates a new override shift from provided data. If any existing override shifts overlap with the @@ -96,7 +93,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | OverrideShiftResponse] + Response[Union[ErrorsList, OverrideShiftResponse]] """ kwargs = _get_kwargs( @@ -116,7 +113,7 @@ def sync( *, client: AuthenticatedClient, body: NewOverrideShift, -) -> ErrorsList | OverrideShiftResponse | None: +) -> Optional[Union[ErrorsList, OverrideShiftResponse]]: """creates an override shift Creates a new override shift from provided data. If any existing override shifts overlap with the @@ -133,7 +130,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | OverrideShiftResponse + Union[ErrorsList, OverrideShiftResponse] """ return sync_detailed( @@ -148,7 +145,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewOverrideShift, -) -> Response[ErrorsList | OverrideShiftResponse]: +) -> Response[Union[ErrorsList, OverrideShiftResponse]]: """creates an override shift Creates a new override shift from provided data. If any existing override shifts overlap with the @@ -165,7 +162,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | OverrideShiftResponse] + Response[Union[ErrorsList, OverrideShiftResponse]] """ kwargs = _get_kwargs( @@ -183,7 +180,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewOverrideShift, -) -> ErrorsList | OverrideShiftResponse | None: +) -> Optional[Union[ErrorsList, OverrideShiftResponse]]: """creates an override shift Creates a new override shift from provided data. If any existing override shifts overlap with the @@ -200,7 +197,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | OverrideShiftResponse + Union[ErrorsList, OverrideShiftResponse] """ return ( diff --git a/rootly_sdk/api/override_shifts/delete_on_call_shadow.py b/rootly_sdk/api/override_shifts/delete_on_call_shadow.py index ee1f2e0d..eb2e34f1 100644 --- a/rootly_sdk/api/override_shifts/delete_on_call_shadow.py +++ b/rootly_sdk/api/override_shifts/delete_on_call_shadow.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/on_call_shadows/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/on_call_shadows/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | OnCallShadowResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, OnCallShadowResponse]]: if response.status_code == 200: response_200 = OnCallShadowResponse.from_dict(response.json()) @@ -50,8 +46,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | OnCallShadowResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, OnCallShadowResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -64,7 +60,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | OnCallShadowResponse]: +) -> Response[Union[ErrorsList, OnCallShadowResponse]]: """Delete an on call shadow configuration Delete a specific on call shadow configuration by id. Future shadows are hard-deleted. Active @@ -78,7 +74,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | OnCallShadowResponse] + Response[Union[ErrorsList, OnCallShadowResponse]] """ kwargs = _get_kwargs( @@ -96,7 +92,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | OnCallShadowResponse | None: +) -> Optional[Union[ErrorsList, OnCallShadowResponse]]: """Delete an on call shadow configuration Delete a specific on call shadow configuration by id. Future shadows are hard-deleted. Active @@ -110,7 +106,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | OnCallShadowResponse + Union[ErrorsList, OnCallShadowResponse] """ return sync_detailed( @@ -123,7 +119,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | OnCallShadowResponse]: +) -> Response[Union[ErrorsList, OnCallShadowResponse]]: """Delete an on call shadow configuration Delete a specific on call shadow configuration by id. Future shadows are hard-deleted. Active @@ -137,7 +133,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | OnCallShadowResponse] + Response[Union[ErrorsList, OnCallShadowResponse]] """ kwargs = _get_kwargs( @@ -153,7 +149,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | OnCallShadowResponse | None: +) -> Optional[Union[ErrorsList, OnCallShadowResponse]]: """Delete an on call shadow configuration Delete a specific on call shadow configuration by id. Future shadows are hard-deleted. Active @@ -167,7 +163,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | OnCallShadowResponse + Union[ErrorsList, OnCallShadowResponse] """ return ( diff --git a/rootly_sdk/api/override_shifts/delete_override_shift.py b/rootly_sdk/api/override_shifts/delete_override_shift.py index 200bc1a1..b4534a10 100644 --- a/rootly_sdk/api/override_shifts/delete_override_shift.py +++ b/rootly_sdk/api/override_shifts/delete_override_shift.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/override_shifts/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/override_shifts/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | OverrideShiftResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, OverrideShiftResponse]]: if response.status_code == 200: response_200 = OverrideShiftResponse.from_dict(response.json()) @@ -45,8 +41,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | OverrideShiftResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, OverrideShiftResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | OverrideShiftResponse]: +) -> Response[Union[ErrorsList, OverrideShiftResponse]]: """Delete an override shift Delete a specific override shift by id @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | OverrideShiftResponse] + Response[Union[ErrorsList, OverrideShiftResponse]] """ kwargs = _get_kwargs( @@ -90,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | OverrideShiftResponse | None: +) -> Optional[Union[ErrorsList, OverrideShiftResponse]]: """Delete an override shift Delete a specific override shift by id @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | OverrideShiftResponse + Union[ErrorsList, OverrideShiftResponse] """ return sync_detailed( @@ -116,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | OverrideShiftResponse]: +) -> Response[Union[ErrorsList, OverrideShiftResponse]]: """Delete an override shift Delete a specific override shift by id @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | OverrideShiftResponse] + Response[Union[ErrorsList, OverrideShiftResponse]] """ kwargs = _get_kwargs( @@ -145,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | OverrideShiftResponse | None: +) -> Optional[Union[ErrorsList, OverrideShiftResponse]]: """Delete an override shift Delete a specific override shift by id @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | OverrideShiftResponse + Union[ErrorsList, OverrideShiftResponse] """ return ( diff --git a/rootly_sdk/api/override_shifts/get_override_shift.py b/rootly_sdk/api/override_shifts/get_override_shift.py index 1116f33d..cec3b722 100644 --- a/rootly_sdk/api/override_shifts/get_override_shift.py +++ b/rootly_sdk/api/override_shifts/get_override_shift.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/override_shifts/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/override_shifts/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | OverrideShiftResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, OverrideShiftResponse]]: if response.status_code == 200: response_200 = OverrideShiftResponse.from_dict(response.json()) @@ -45,8 +41,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | OverrideShiftResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, OverrideShiftResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | OverrideShiftResponse]: +) -> Response[Union[ErrorsList, OverrideShiftResponse]]: """Retrieves an override shift Retrieves a specific override shift by id @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | OverrideShiftResponse] + Response[Union[ErrorsList, OverrideShiftResponse]] """ kwargs = _get_kwargs( @@ -90,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | OverrideShiftResponse | None: +) -> Optional[Union[ErrorsList, OverrideShiftResponse]]: """Retrieves an override shift Retrieves a specific override shift by id @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | OverrideShiftResponse + Union[ErrorsList, OverrideShiftResponse] """ return sync_detailed( @@ -116,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | OverrideShiftResponse]: +) -> Response[Union[ErrorsList, OverrideShiftResponse]]: """Retrieves an override shift Retrieves a specific override shift by id @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | OverrideShiftResponse] + Response[Union[ErrorsList, OverrideShiftResponse]] """ kwargs = _get_kwargs( @@ -145,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | OverrideShiftResponse | None: +) -> Optional[Union[ErrorsList, OverrideShiftResponse]]: """Retrieves an override shift Retrieves a specific override shift by id @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | OverrideShiftResponse + Union[ErrorsList, OverrideShiftResponse] """ return ( diff --git a/rootly_sdk/api/override_shifts/list_override_shifts.py b/rootly_sdk/api/override_shifts/list_override_shifts.py index 8370ff93..7a7f83d1 100644 --- a/rootly_sdk/api/override_shifts/list_override_shifts.py +++ b/rootly_sdk/api/override_shifts/list_override_shifts.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -13,11 +12,10 @@ def _get_kwargs( schedule_id: str, *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -30,16 +28,16 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/schedules/{schedule_id}/override_shifts".format( - schedule_id=quote(str(schedule_id), safe=""), - ), + "url": f"/v1/schedules/{schedule_id}/override_shifts", "params": params, } return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> OverrideShiftList | None: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[OverrideShiftList]: if response.status_code == 200: response_200 = OverrideShiftList.from_dict(response.json()) @@ -51,7 +49,9 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[OverrideShiftList]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[OverrideShiftList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -64,9 +64,9 @@ def sync_detailed( schedule_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, ) -> Response[OverrideShiftList]: """List override shifts @@ -74,9 +74,9 @@ def sync_detailed( Args: schedule_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -104,19 +104,19 @@ def sync( schedule_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, -) -> OverrideShiftList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, +) -> Optional[OverrideShiftList]: """List override shifts List override shifts Args: schedule_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -139,9 +139,9 @@ async def asyncio_detailed( schedule_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, ) -> Response[OverrideShiftList]: """List override shifts @@ -149,9 +149,9 @@ async def asyncio_detailed( Args: schedule_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -177,19 +177,19 @@ async def asyncio( schedule_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, -) -> OverrideShiftList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, +) -> Optional[OverrideShiftList]: """List override shifts List override shifts Args: schedule_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/override_shifts/update_override_shift.py b/rootly_sdk/api/override_shifts/update_override_shift.py index 3f692427..77f6afe3 100644 --- a/rootly_sdk/api/override_shifts/update_override_shift.py +++ b/rootly_sdk/api/override_shifts/update_override_shift.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/override_shifts/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/override_shifts/{id}", } _kwargs["json"] = body.to_dict() @@ -35,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | OverrideShiftResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, OverrideShiftResponse]]: if response.status_code == 200: response_200 = OverrideShiftResponse.from_dict(response.json()) @@ -54,8 +51,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | OverrideShiftResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, OverrideShiftResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateOverrideShift, -) -> Response[ErrorsList | OverrideShiftResponse]: +) -> Response[Union[ErrorsList, OverrideShiftResponse]]: """Update an override shift Update a specific override shift by id @@ -83,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | OverrideShiftResponse] + Response[Union[ErrorsList, OverrideShiftResponse]] """ kwargs = _get_kwargs( @@ -103,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateOverrideShift, -) -> ErrorsList | OverrideShiftResponse | None: +) -> Optional[Union[ErrorsList, OverrideShiftResponse]]: """Update an override shift Update a specific override shift by id @@ -117,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | OverrideShiftResponse + Union[ErrorsList, OverrideShiftResponse] """ return sync_detailed( @@ -132,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateOverrideShift, -) -> Response[ErrorsList | OverrideShiftResponse]: +) -> Response[Union[ErrorsList, OverrideShiftResponse]]: """Update an override shift Update a specific override shift by id @@ -146,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | OverrideShiftResponse] + Response[Union[ErrorsList, OverrideShiftResponse]] """ kwargs = _get_kwargs( @@ -164,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateOverrideShift, -) -> ErrorsList | OverrideShiftResponse | None: +) -> Optional[Union[ErrorsList, OverrideShiftResponse]]: """Update an override shift Update a specific override shift by id @@ -178,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | OverrideShiftResponse + Union[ErrorsList, OverrideShiftResponse] """ return ( diff --git a/rootly_sdk/api/playbook_tasks/create_playbook_task.py b/rootly_sdk/api/playbook_tasks/create_playbook_task.py index 4589a663..bb41ac7f 100644 --- a/rootly_sdk/api/playbook_tasks/create_playbook_task.py +++ b/rootly_sdk/api/playbook_tasks/create_playbook_task.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/playbooks/{playbook_id}/playbook_tasks".format( - playbook_id=quote(str(playbook_id), safe=""), - ), + "url": f"/v1/playbooks/{playbook_id}/playbook_tasks", } _kwargs["json"] = body.to_dict() @@ -35,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | PlaybookTaskResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, PlaybookTaskResponse]]: if response.status_code == 201: response_201 = PlaybookTaskResponse.from_dict(response.json()) @@ -59,8 +56,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | PlaybookTaskResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, PlaybookTaskResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -74,7 +71,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewPlaybookTask, -) -> Response[ErrorsList | PlaybookTaskResponse]: +) -> Response[Union[ErrorsList, PlaybookTaskResponse]]: """Creates a playbook task Creates a new task from provided data @@ -88,7 +85,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | PlaybookTaskResponse] + Response[Union[ErrorsList, PlaybookTaskResponse]] """ kwargs = _get_kwargs( @@ -108,7 +105,7 @@ def sync( *, client: AuthenticatedClient, body: NewPlaybookTask, -) -> ErrorsList | PlaybookTaskResponse | None: +) -> Optional[Union[ErrorsList, PlaybookTaskResponse]]: """Creates a playbook task Creates a new task from provided data @@ -122,7 +119,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | PlaybookTaskResponse + Union[ErrorsList, PlaybookTaskResponse] """ return sync_detailed( @@ -137,7 +134,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewPlaybookTask, -) -> Response[ErrorsList | PlaybookTaskResponse]: +) -> Response[Union[ErrorsList, PlaybookTaskResponse]]: """Creates a playbook task Creates a new task from provided data @@ -151,7 +148,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | PlaybookTaskResponse] + Response[Union[ErrorsList, PlaybookTaskResponse]] """ kwargs = _get_kwargs( @@ -169,7 +166,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewPlaybookTask, -) -> ErrorsList | PlaybookTaskResponse | None: +) -> Optional[Union[ErrorsList, PlaybookTaskResponse]]: """Creates a playbook task Creates a new task from provided data @@ -183,7 +180,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | PlaybookTaskResponse + Union[ErrorsList, PlaybookTaskResponse] """ return ( diff --git a/rootly_sdk/api/playbook_tasks/delete_playbook_task.py b/rootly_sdk/api/playbook_tasks/delete_playbook_task.py index 9c9328d4..0bd2b482 100644 --- a/rootly_sdk/api/playbook_tasks/delete_playbook_task.py +++ b/rootly_sdk/api/playbook_tasks/delete_playbook_task.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/playbook_tasks/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/playbook_tasks/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | PlaybookTaskResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, PlaybookTaskResponse]]: if response.status_code == 200: response_200 = PlaybookTaskResponse.from_dict(response.json()) @@ -45,8 +41,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | PlaybookTaskResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, PlaybookTaskResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | PlaybookTaskResponse]: +) -> Response[Union[ErrorsList, PlaybookTaskResponse]]: """Delete a playbook task Delete a specific playbook task by id @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | PlaybookTaskResponse] + Response[Union[ErrorsList, PlaybookTaskResponse]] """ kwargs = _get_kwargs( @@ -90,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | PlaybookTaskResponse | None: +) -> Optional[Union[ErrorsList, PlaybookTaskResponse]]: """Delete a playbook task Delete a specific playbook task by id @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | PlaybookTaskResponse + Union[ErrorsList, PlaybookTaskResponse] """ return sync_detailed( @@ -116,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | PlaybookTaskResponse]: +) -> Response[Union[ErrorsList, PlaybookTaskResponse]]: """Delete a playbook task Delete a specific playbook task by id @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | PlaybookTaskResponse] + Response[Union[ErrorsList, PlaybookTaskResponse]] """ kwargs = _get_kwargs( @@ -145,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | PlaybookTaskResponse | None: +) -> Optional[Union[ErrorsList, PlaybookTaskResponse]]: """Delete a playbook task Delete a specific playbook task by id @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | PlaybookTaskResponse + Union[ErrorsList, PlaybookTaskResponse] """ return ( diff --git a/rootly_sdk/api/playbook_tasks/get_playbook_task.py b/rootly_sdk/api/playbook_tasks/get_playbook_task.py index 415605da..7e61b14f 100644 --- a/rootly_sdk/api/playbook_tasks/get_playbook_task.py +++ b/rootly_sdk/api/playbook_tasks/get_playbook_task.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/playbook_tasks/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/playbook_tasks/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | PlaybookTaskResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, PlaybookTaskResponse]]: if response.status_code == 200: response_200 = PlaybookTaskResponse.from_dict(response.json()) @@ -45,8 +41,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | PlaybookTaskResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, PlaybookTaskResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | PlaybookTaskResponse]: +) -> Response[Union[ErrorsList, PlaybookTaskResponse]]: """Retrieves a playbook task Retrieves a specific playbook_task by id @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | PlaybookTaskResponse] + Response[Union[ErrorsList, PlaybookTaskResponse]] """ kwargs = _get_kwargs( @@ -90,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | PlaybookTaskResponse | None: +) -> Optional[Union[ErrorsList, PlaybookTaskResponse]]: """Retrieves a playbook task Retrieves a specific playbook_task by id @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | PlaybookTaskResponse + Union[ErrorsList, PlaybookTaskResponse] """ return sync_detailed( @@ -116,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | PlaybookTaskResponse]: +) -> Response[Union[ErrorsList, PlaybookTaskResponse]]: """Retrieves a playbook task Retrieves a specific playbook_task by id @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | PlaybookTaskResponse] + Response[Union[ErrorsList, PlaybookTaskResponse]] """ kwargs = _get_kwargs( @@ -145,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | PlaybookTaskResponse | None: +) -> Optional[Union[ErrorsList, PlaybookTaskResponse]]: """Retrieves a playbook task Retrieves a specific playbook_task by id @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | PlaybookTaskResponse + Union[ErrorsList, PlaybookTaskResponse] """ return ( diff --git a/rootly_sdk/api/playbook_tasks/list_playbook_tasks.py b/rootly_sdk/api/playbook_tasks/list_playbook_tasks.py index cc9e0fa2..37ef2e38 100644 --- a/rootly_sdk/api/playbook_tasks/list_playbook_tasks.py +++ b/rootly_sdk/api/playbook_tasks/list_playbook_tasks.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -13,11 +12,10 @@ def _get_kwargs( playbook_id: str, *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -30,16 +28,16 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/playbooks/{playbook_id}/playbook_tasks".format( - playbook_id=quote(str(playbook_id), safe=""), - ), + "url": f"/v1/playbooks/{playbook_id}/playbook_tasks", "params": params, } return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> PlaybookTaskList | None: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[PlaybookTaskList]: if response.status_code == 200: response_200 = PlaybookTaskList.from_dict(response.json()) @@ -51,7 +49,9 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[PlaybookTaskList]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[PlaybookTaskList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -64,9 +64,9 @@ def sync_detailed( playbook_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, ) -> Response[PlaybookTaskList]: """List playbook tasks @@ -74,9 +74,9 @@ def sync_detailed( Args: playbook_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -104,19 +104,19 @@ def sync( playbook_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, -) -> PlaybookTaskList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, +) -> Optional[PlaybookTaskList]: """List playbook tasks List playbook tasks Args: playbook_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -139,9 +139,9 @@ async def asyncio_detailed( playbook_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, ) -> Response[PlaybookTaskList]: """List playbook tasks @@ -149,9 +149,9 @@ async def asyncio_detailed( Args: playbook_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -177,19 +177,19 @@ async def asyncio( playbook_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, -) -> PlaybookTaskList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, +) -> Optional[PlaybookTaskList]: """List playbook tasks List playbook tasks Args: playbook_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/playbook_tasks/update_playbook_task.py b/rootly_sdk/api/playbook_tasks/update_playbook_task.py index b84699b6..25a75f3f 100644 --- a/rootly_sdk/api/playbook_tasks/update_playbook_task.py +++ b/rootly_sdk/api/playbook_tasks/update_playbook_task.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/playbook_tasks/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/playbook_tasks/{id}", } _kwargs["json"] = body.to_dict() @@ -35,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | PlaybookTaskResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, PlaybookTaskResponse]]: if response.status_code == 200: response_200 = PlaybookTaskResponse.from_dict(response.json()) @@ -54,8 +51,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | PlaybookTaskResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, PlaybookTaskResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdatePlaybookTask, -) -> Response[ErrorsList | PlaybookTaskResponse]: +) -> Response[Union[ErrorsList, PlaybookTaskResponse]]: """Update a playbook task Update a specific playbook task by id @@ -83,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | PlaybookTaskResponse] + Response[Union[ErrorsList, PlaybookTaskResponse]] """ kwargs = _get_kwargs( @@ -103,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: UpdatePlaybookTask, -) -> ErrorsList | PlaybookTaskResponse | None: +) -> Optional[Union[ErrorsList, PlaybookTaskResponse]]: """Update a playbook task Update a specific playbook task by id @@ -117,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | PlaybookTaskResponse + Union[ErrorsList, PlaybookTaskResponse] """ return sync_detailed( @@ -132,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdatePlaybookTask, -) -> Response[ErrorsList | PlaybookTaskResponse]: +) -> Response[Union[ErrorsList, PlaybookTaskResponse]]: """Update a playbook task Update a specific playbook task by id @@ -146,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | PlaybookTaskResponse] + Response[Union[ErrorsList, PlaybookTaskResponse]] """ kwargs = _get_kwargs( @@ -164,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdatePlaybookTask, -) -> ErrorsList | PlaybookTaskResponse | None: +) -> Optional[Union[ErrorsList, PlaybookTaskResponse]]: """Update a playbook task Update a specific playbook task by id @@ -178,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | PlaybookTaskResponse + Union[ErrorsList, PlaybookTaskResponse] """ return ( diff --git a/rootly_sdk/api/playbooks/create_playbook.py b/rootly_sdk/api/playbooks/create_playbook.py index cee3273e..9dfa3a60 100644 --- a/rootly_sdk/api/playbooks/create_playbook.py +++ b/rootly_sdk/api/playbooks/create_playbook.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | PlaybookResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, PlaybookResponse]]: if response.status_code == 201: response_201 = PlaybookResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | PlaybookResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, PlaybookResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +69,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewPlaybook, -) -> Response[ErrorsList | PlaybookResponse]: +) -> Response[Union[ErrorsList, PlaybookResponse]]: """Creates a playbook Creates a new playbook from provided data @@ -82,7 +82,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | PlaybookResponse] + Response[Union[ErrorsList, PlaybookResponse]] """ kwargs = _get_kwargs( @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: NewPlaybook, -) -> ErrorsList | PlaybookResponse | None: +) -> Optional[Union[ErrorsList, PlaybookResponse]]: """Creates a playbook Creates a new playbook from provided data @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | PlaybookResponse + Union[ErrorsList, PlaybookResponse] """ return sync_detailed( @@ -126,7 +126,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewPlaybook, -) -> Response[ErrorsList | PlaybookResponse]: +) -> Response[Union[ErrorsList, PlaybookResponse]]: """Creates a playbook Creates a new playbook from provided data @@ -139,7 +139,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | PlaybookResponse] + Response[Union[ErrorsList, PlaybookResponse]] """ kwargs = _get_kwargs( @@ -155,7 +155,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewPlaybook, -) -> ErrorsList | PlaybookResponse | None: +) -> Optional[Union[ErrorsList, PlaybookResponse]]: """Creates a playbook Creates a new playbook from provided data @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | PlaybookResponse + Union[ErrorsList, PlaybookResponse] """ return ( diff --git a/rootly_sdk/api/playbooks/delete_playbook.py b/rootly_sdk/api/playbooks/delete_playbook.py index f666eef3..0cd04ede 100644 --- a/rootly_sdk/api/playbooks/delete_playbook.py +++ b/rootly_sdk/api/playbooks/delete_playbook.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/playbooks/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/playbooks/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | PlaybookResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, PlaybookResponse]]: if response.status_code == 200: response_200 = PlaybookResponse.from_dict(response.json()) @@ -45,8 +41,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | PlaybookResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, PlaybookResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | PlaybookResponse]: +) -> Response[Union[ErrorsList, PlaybookResponse]]: """Delete a playbook Delete a specific playbook by id @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | PlaybookResponse] + Response[Union[ErrorsList, PlaybookResponse]] """ kwargs = _get_kwargs( @@ -90,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | PlaybookResponse | None: +) -> Optional[Union[ErrorsList, PlaybookResponse]]: """Delete a playbook Delete a specific playbook by id @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | PlaybookResponse + Union[ErrorsList, PlaybookResponse] """ return sync_detailed( @@ -116,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | PlaybookResponse]: +) -> Response[Union[ErrorsList, PlaybookResponse]]: """Delete a playbook Delete a specific playbook by id @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | PlaybookResponse] + Response[Union[ErrorsList, PlaybookResponse]] """ kwargs = _get_kwargs( @@ -145,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | PlaybookResponse | None: +) -> Optional[Union[ErrorsList, PlaybookResponse]]: """Delete a playbook Delete a specific playbook by id @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | PlaybookResponse + Union[ErrorsList, PlaybookResponse] """ return ( diff --git a/rootly_sdk/api/playbooks/get_playbook.py b/rootly_sdk/api/playbooks/get_playbook.py index 7faea0c0..658fb0ea 100644 --- a/rootly_sdk/api/playbooks/get_playbook.py +++ b/rootly_sdk/api/playbooks/get_playbook.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -15,12 +14,11 @@ def _get_kwargs( id: str, *, - include: GetPlaybookInclude | Unset = UNSET, + include: Union[Unset, GetPlaybookInclude] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} - json_include: str | Unset = UNSET + json_include: Union[Unset, str] = UNSET if not isinstance(include, Unset): json_include = include @@ -30,9 +28,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/playbooks/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/playbooks/{id}", "params": params, } @@ -40,8 +36,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | PlaybookResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, PlaybookResponse]]: if response.status_code == 200: response_200 = PlaybookResponse.from_dict(response.json()) @@ -59,8 +55,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | PlaybookResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, PlaybookResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -73,22 +69,22 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, - include: GetPlaybookInclude | Unset = UNSET, -) -> Response[ErrorsList | PlaybookResponse]: + include: Union[Unset, GetPlaybookInclude] = UNSET, +) -> Response[Union[ErrorsList, PlaybookResponse]]: """Retrieves a playbook Retrieves a specific playbook by id Args: id (str): - include (GetPlaybookInclude | Unset): + include (Union[Unset, GetPlaybookInclude]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | PlaybookResponse] + Response[Union[ErrorsList, PlaybookResponse]] """ kwargs = _get_kwargs( @@ -107,22 +103,22 @@ def sync( id: str, *, client: AuthenticatedClient, - include: GetPlaybookInclude | Unset = UNSET, -) -> ErrorsList | PlaybookResponse | None: + include: Union[Unset, GetPlaybookInclude] = UNSET, +) -> Optional[Union[ErrorsList, PlaybookResponse]]: """Retrieves a playbook Retrieves a specific playbook by id Args: id (str): - include (GetPlaybookInclude | Unset): + include (Union[Unset, GetPlaybookInclude]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | PlaybookResponse + Union[ErrorsList, PlaybookResponse] """ return sync_detailed( @@ -136,22 +132,22 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, - include: GetPlaybookInclude | Unset = UNSET, -) -> Response[ErrorsList | PlaybookResponse]: + include: Union[Unset, GetPlaybookInclude] = UNSET, +) -> Response[Union[ErrorsList, PlaybookResponse]]: """Retrieves a playbook Retrieves a specific playbook by id Args: id (str): - include (GetPlaybookInclude | Unset): + include (Union[Unset, GetPlaybookInclude]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | PlaybookResponse] + Response[Union[ErrorsList, PlaybookResponse]] """ kwargs = _get_kwargs( @@ -168,22 +164,22 @@ async def asyncio( id: str, *, client: AuthenticatedClient, - include: GetPlaybookInclude | Unset = UNSET, -) -> ErrorsList | PlaybookResponse | None: + include: Union[Unset, GetPlaybookInclude] = UNSET, +) -> Optional[Union[ErrorsList, PlaybookResponse]]: """Retrieves a playbook Retrieves a specific playbook by id Args: id (str): - include (GetPlaybookInclude | Unset): + include (Union[Unset, GetPlaybookInclude]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | PlaybookResponse + Union[ErrorsList, PlaybookResponse] """ return ( diff --git a/rootly_sdk/api/playbooks/list_playbooks.py b/rootly_sdk/api/playbooks/list_playbooks.py index 0326a21d..9c569938 100644 --- a/rootly_sdk/api/playbooks/list_playbooks.py +++ b/rootly_sdk/api/playbooks/list_playbooks.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -12,14 +12,13 @@ def _get_kwargs( *, - include: ListPlaybooksInclude | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Union[Unset, ListPlaybooksInclude] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} - json_include: str | Unset = UNSET + json_include: Union[Unset, str] = UNSET if not isinstance(include, Unset): json_include = include @@ -40,7 +39,7 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> PlaybookList | None: +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[PlaybookList]: if response.status_code == 200: response_200 = PlaybookList.from_dict(response.json()) @@ -52,7 +51,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[PlaybookList]: +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[PlaybookList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -64,18 +63,18 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - include: ListPlaybooksInclude | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Union[Unset, ListPlaybooksInclude] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, ) -> Response[PlaybookList]: """List playbooks List playbooks Args: - include (ListPlaybooksInclude | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, ListPlaybooksInclude]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -101,18 +100,18 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: ListPlaybooksInclude | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, -) -> PlaybookList | None: + include: Union[Unset, ListPlaybooksInclude] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, +) -> Optional[PlaybookList]: """List playbooks List playbooks Args: - include (ListPlaybooksInclude | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, ListPlaybooksInclude]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -133,18 +132,18 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: ListPlaybooksInclude | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Union[Unset, ListPlaybooksInclude] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, ) -> Response[PlaybookList]: """List playbooks List playbooks Args: - include (ListPlaybooksInclude | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, ListPlaybooksInclude]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -168,18 +167,18 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: ListPlaybooksInclude | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, -) -> PlaybookList | None: + include: Union[Unset, ListPlaybooksInclude] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, +) -> Optional[PlaybookList]: """List playbooks List playbooks Args: - include (ListPlaybooksInclude | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, ListPlaybooksInclude]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/playbooks/update_playbook.py b/rootly_sdk/api/playbooks/update_playbook.py index 9fe8a131..370dc2c9 100644 --- a/rootly_sdk/api/playbooks/update_playbook.py +++ b/rootly_sdk/api/playbooks/update_playbook.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/playbooks/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/playbooks/{id}", } _kwargs["json"] = body.to_dict() @@ -35,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | PlaybookResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, PlaybookResponse]]: if response.status_code == 200: response_200 = PlaybookResponse.from_dict(response.json()) @@ -54,8 +51,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | PlaybookResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, PlaybookResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdatePlaybook, -) -> Response[ErrorsList | PlaybookResponse]: +) -> Response[Union[ErrorsList, PlaybookResponse]]: """Update a playbook Update a specific playbook by id @@ -83,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | PlaybookResponse] + Response[Union[ErrorsList, PlaybookResponse]] """ kwargs = _get_kwargs( @@ -103,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: UpdatePlaybook, -) -> ErrorsList | PlaybookResponse | None: +) -> Optional[Union[ErrorsList, PlaybookResponse]]: """Update a playbook Update a specific playbook by id @@ -117,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | PlaybookResponse + Union[ErrorsList, PlaybookResponse] """ return sync_detailed( @@ -132,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdatePlaybook, -) -> Response[ErrorsList | PlaybookResponse]: +) -> Response[Union[ErrorsList, PlaybookResponse]]: """Update a playbook Update a specific playbook by id @@ -146,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | PlaybookResponse] + Response[Union[ErrorsList, PlaybookResponse]] """ kwargs = _get_kwargs( @@ -164,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdatePlaybook, -) -> ErrorsList | PlaybookResponse | None: +) -> Optional[Union[ErrorsList, PlaybookResponse]]: """Update a playbook Update a specific playbook by id @@ -178,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | PlaybookResponse + Union[ErrorsList, PlaybookResponse] """ return ( diff --git a/rootly_sdk/api/pulses/create_pulse.py b/rootly_sdk/api/pulses/create_pulse.py index 30b82b81..c4f507be 100644 --- a/rootly_sdk/api/pulses/create_pulse.py +++ b/rootly_sdk/api/pulses/create_pulse.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | PulseResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, PulseResponse]]: if response.status_code == 201: response_201 = PulseResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | PulseResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, PulseResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +69,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewPulse, -) -> Response[ErrorsList | PulseResponse]: +) -> Response[Union[ErrorsList, PulseResponse]]: """Creates a pulse Creates a new pulse from provided data @@ -82,7 +82,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | PulseResponse] + Response[Union[ErrorsList, PulseResponse]] """ kwargs = _get_kwargs( @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: NewPulse, -) -> ErrorsList | PulseResponse | None: +) -> Optional[Union[ErrorsList, PulseResponse]]: """Creates a pulse Creates a new pulse from provided data @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | PulseResponse + Union[ErrorsList, PulseResponse] """ return sync_detailed( @@ -126,7 +126,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewPulse, -) -> Response[ErrorsList | PulseResponse]: +) -> Response[Union[ErrorsList, PulseResponse]]: """Creates a pulse Creates a new pulse from provided data @@ -139,7 +139,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | PulseResponse] + Response[Union[ErrorsList, PulseResponse]] """ kwargs = _get_kwargs( @@ -155,7 +155,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewPulse, -) -> ErrorsList | PulseResponse | None: +) -> Optional[Union[ErrorsList, PulseResponse]]: """Creates a pulse Creates a new pulse from provided data @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | PulseResponse + Union[ErrorsList, PulseResponse] """ return ( diff --git a/rootly_sdk/api/pulses/get_pulse.py b/rootly_sdk/api/pulses/get_pulse.py index 1d751fd4..01f70acb 100644 --- a/rootly_sdk/api/pulses/get_pulse.py +++ b/rootly_sdk/api/pulses/get_pulse.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/pulses/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/pulses/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | PulseResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, PulseResponse]]: if response.status_code == 200: response_200 = PulseResponse.from_dict(response.json()) @@ -45,8 +41,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | PulseResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, PulseResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | PulseResponse]: +) -> Response[Union[ErrorsList, PulseResponse]]: """Retrieves a pulse Retrieves a specific pulse by id @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | PulseResponse] + Response[Union[ErrorsList, PulseResponse]] """ kwargs = _get_kwargs( @@ -90,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | PulseResponse | None: +) -> Optional[Union[ErrorsList, PulseResponse]]: """Retrieves a pulse Retrieves a specific pulse by id @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | PulseResponse + Union[ErrorsList, PulseResponse] """ return sync_detailed( @@ -116,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | PulseResponse]: +) -> Response[Union[ErrorsList, PulseResponse]]: """Retrieves a pulse Retrieves a specific pulse by id @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | PulseResponse] + Response[Union[ErrorsList, PulseResponse]] """ kwargs = _get_kwargs( @@ -145,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | PulseResponse | None: +) -> Optional[Union[ErrorsList, PulseResponse]]: """Retrieves a pulse Retrieves a specific pulse by id @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | PulseResponse + Union[ErrorsList, PulseResponse] """ return ( diff --git a/rootly_sdk/api/pulses/list_pulses.py b/rootly_sdk/api/pulses/list_pulses.py index 1603a528..23667696 100644 --- a/rootly_sdk/api/pulses/list_pulses.py +++ b/rootly_sdk/api/pulses/list_pulses.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -11,48 +11,47 @@ def _get_kwargs( *, - include: str | Unset = UNSET, - filtersource: str | Unset = UNSET, - filterservices: str | Unset = UNSET, - filterenvironments: str | Unset = UNSET, - filterlabels: str | Unset = UNSET, - filterrefs: str | Unset = UNSET, - filterstarted_atgt: str | Unset = UNSET, - filterstarted_atgte: str | Unset = UNSET, - filterstarted_atlt: str | Unset = UNSET, - filterstarted_atlte: str | Unset = UNSET, - filterended_atgt: str | Unset = UNSET, - filterended_atgte: str | Unset = UNSET, - filterended_atlt: str | Unset = UNSET, - filterended_atlte: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filtersourceeq: str | Unset = UNSET, - filtersourcenot_eq: str | Unset = UNSET, - filtersourcein: str | Unset = UNSET, - filtersourcenot_in: str | Unset = UNSET, - filterserviceseq: str | Unset = UNSET, - filterservicesnot_eq: str | Unset = UNSET, - filterservicesin: str | Unset = UNSET, - filterservicesnot_in: str | Unset = UNSET, - filterenvironmentseq: str | Unset = UNSET, - filterenvironmentsnot_eq: str | Unset = UNSET, - filterenvironmentsin: str | Unset = UNSET, - filterenvironmentsnot_in: str | Unset = UNSET, - filterlabelseq: str | Unset = UNSET, - filterlabelsnot_eq: str | Unset = UNSET, - filterlabelsin: str | Unset = UNSET, - filterlabelsnot_in: str | Unset = UNSET, - filterrefseq: str | Unset = UNSET, - filterrefsnot_eq: str | Unset = UNSET, - filterrefsin: str | Unset = UNSET, - filterrefsnot_in: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Union[Unset, str] = UNSET, + filtersource: Union[Unset, str] = UNSET, + filterservices: Union[Unset, str] = UNSET, + filterenvironments: Union[Unset, str] = UNSET, + filterlabels: Union[Unset, str] = UNSET, + filterrefs: Union[Unset, str] = UNSET, + filterstarted_atgt: Union[Unset, str] = UNSET, + filterstarted_atgte: Union[Unset, str] = UNSET, + filterstarted_atlt: Union[Unset, str] = UNSET, + filterstarted_atlte: Union[Unset, str] = UNSET, + filterended_atgt: Union[Unset, str] = UNSET, + filterended_atgte: Union[Unset, str] = UNSET, + filterended_atlt: Union[Unset, str] = UNSET, + filterended_atlte: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filtersourceeq: Union[Unset, str] = UNSET, + filtersourcenot_eq: Union[Unset, str] = UNSET, + filtersourcein: Union[Unset, str] = UNSET, + filtersourcenot_in: Union[Unset, str] = UNSET, + filterserviceseq: Union[Unset, str] = UNSET, + filterservicesnot_eq: Union[Unset, str] = UNSET, + filterservicesin: Union[Unset, str] = UNSET, + filterservicesnot_in: Union[Unset, str] = UNSET, + filterenvironmentseq: Union[Unset, str] = UNSET, + filterenvironmentsnot_eq: Union[Unset, str] = UNSET, + filterenvironmentsin: Union[Unset, str] = UNSET, + filterenvironmentsnot_in: Union[Unset, str] = UNSET, + filterlabelseq: Union[Unset, str] = UNSET, + filterlabelsnot_eq: Union[Unset, str] = UNSET, + filterlabelsin: Union[Unset, str] = UNSET, + filterlabelsnot_in: Union[Unset, str] = UNSET, + filterrefseq: Union[Unset, str] = UNSET, + filterrefsnot_eq: Union[Unset, str] = UNSET, + filterrefsin: Union[Unset, str] = UNSET, + filterrefsnot_in: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -146,7 +145,7 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> PulseList | None: +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[PulseList]: if response.status_code == 200: response_200 = PulseList.from_dict(response.json()) @@ -158,7 +157,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[PulseList]: +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[PulseList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -170,92 +169,92 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - filtersource: str | Unset = UNSET, - filterservices: str | Unset = UNSET, - filterenvironments: str | Unset = UNSET, - filterlabels: str | Unset = UNSET, - filterrefs: str | Unset = UNSET, - filterstarted_atgt: str | Unset = UNSET, - filterstarted_atgte: str | Unset = UNSET, - filterstarted_atlt: str | Unset = UNSET, - filterstarted_atlte: str | Unset = UNSET, - filterended_atgt: str | Unset = UNSET, - filterended_atgte: str | Unset = UNSET, - filterended_atlt: str | Unset = UNSET, - filterended_atlte: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filtersourceeq: str | Unset = UNSET, - filtersourcenot_eq: str | Unset = UNSET, - filtersourcein: str | Unset = UNSET, - filtersourcenot_in: str | Unset = UNSET, - filterserviceseq: str | Unset = UNSET, - filterservicesnot_eq: str | Unset = UNSET, - filterservicesin: str | Unset = UNSET, - filterservicesnot_in: str | Unset = UNSET, - filterenvironmentseq: str | Unset = UNSET, - filterenvironmentsnot_eq: str | Unset = UNSET, - filterenvironmentsin: str | Unset = UNSET, - filterenvironmentsnot_in: str | Unset = UNSET, - filterlabelseq: str | Unset = UNSET, - filterlabelsnot_eq: str | Unset = UNSET, - filterlabelsin: str | Unset = UNSET, - filterlabelsnot_in: str | Unset = UNSET, - filterrefseq: str | Unset = UNSET, - filterrefsnot_eq: str | Unset = UNSET, - filterrefsin: str | Unset = UNSET, - filterrefsnot_in: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Union[Unset, str] = UNSET, + filtersource: Union[Unset, str] = UNSET, + filterservices: Union[Unset, str] = UNSET, + filterenvironments: Union[Unset, str] = UNSET, + filterlabels: Union[Unset, str] = UNSET, + filterrefs: Union[Unset, str] = UNSET, + filterstarted_atgt: Union[Unset, str] = UNSET, + filterstarted_atgte: Union[Unset, str] = UNSET, + filterstarted_atlt: Union[Unset, str] = UNSET, + filterstarted_atlte: Union[Unset, str] = UNSET, + filterended_atgt: Union[Unset, str] = UNSET, + filterended_atgte: Union[Unset, str] = UNSET, + filterended_atlt: Union[Unset, str] = UNSET, + filterended_atlte: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filtersourceeq: Union[Unset, str] = UNSET, + filtersourcenot_eq: Union[Unset, str] = UNSET, + filtersourcein: Union[Unset, str] = UNSET, + filtersourcenot_in: Union[Unset, str] = UNSET, + filterserviceseq: Union[Unset, str] = UNSET, + filterservicesnot_eq: Union[Unset, str] = UNSET, + filterservicesin: Union[Unset, str] = UNSET, + filterservicesnot_in: Union[Unset, str] = UNSET, + filterenvironmentseq: Union[Unset, str] = UNSET, + filterenvironmentsnot_eq: Union[Unset, str] = UNSET, + filterenvironmentsin: Union[Unset, str] = UNSET, + filterenvironmentsnot_in: Union[Unset, str] = UNSET, + filterlabelseq: Union[Unset, str] = UNSET, + filterlabelsnot_eq: Union[Unset, str] = UNSET, + filterlabelsin: Union[Unset, str] = UNSET, + filterlabelsnot_in: Union[Unset, str] = UNSET, + filterrefseq: Union[Unset, str] = UNSET, + filterrefsnot_eq: Union[Unset, str] = UNSET, + filterrefsin: Union[Unset, str] = UNSET, + filterrefsnot_in: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, ) -> Response[PulseList]: """List pulses List pulses Args: - include (str | Unset): - filtersource (str | Unset): - filterservices (str | Unset): - filterenvironments (str | Unset): - filterlabels (str | Unset): - filterrefs (str | Unset): - filterstarted_atgt (str | Unset): - filterstarted_atgte (str | Unset): - filterstarted_atlt (str | Unset): - filterstarted_atlte (str | Unset): - filterended_atgt (str | Unset): - filterended_atgte (str | Unset): - filterended_atlt (str | Unset): - filterended_atlte (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filtersourceeq (str | Unset): - filtersourcenot_eq (str | Unset): - filtersourcein (str | Unset): - filtersourcenot_in (str | Unset): - filterserviceseq (str | Unset): - filterservicesnot_eq (str | Unset): - filterservicesin (str | Unset): - filterservicesnot_in (str | Unset): - filterenvironmentseq (str | Unset): - filterenvironmentsnot_eq (str | Unset): - filterenvironmentsin (str | Unset): - filterenvironmentsnot_in (str | Unset): - filterlabelseq (str | Unset): - filterlabelsnot_eq (str | Unset): - filterlabelsin (str | Unset): - filterlabelsnot_in (str | Unset): - filterrefseq (str | Unset): - filterrefsnot_eq (str | Unset): - filterrefsin (str | Unset): - filterrefsnot_in (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + filtersource (Union[Unset, str]): + filterservices (Union[Unset, str]): + filterenvironments (Union[Unset, str]): + filterlabels (Union[Unset, str]): + filterrefs (Union[Unset, str]): + filterstarted_atgt (Union[Unset, str]): + filterstarted_atgte (Union[Unset, str]): + filterstarted_atlt (Union[Unset, str]): + filterstarted_atlte (Union[Unset, str]): + filterended_atgt (Union[Unset, str]): + filterended_atgte (Union[Unset, str]): + filterended_atlt (Union[Unset, str]): + filterended_atlte (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filtersourceeq (Union[Unset, str]): + filtersourcenot_eq (Union[Unset, str]): + filtersourcein (Union[Unset, str]): + filtersourcenot_in (Union[Unset, str]): + filterserviceseq (Union[Unset, str]): + filterservicesnot_eq (Union[Unset, str]): + filterservicesin (Union[Unset, str]): + filterservicesnot_in (Union[Unset, str]): + filterenvironmentseq (Union[Unset, str]): + filterenvironmentsnot_eq (Union[Unset, str]): + filterenvironmentsin (Union[Unset, str]): + filterenvironmentsnot_in (Union[Unset, str]): + filterlabelseq (Union[Unset, str]): + filterlabelsnot_eq (Union[Unset, str]): + filterlabelsin (Union[Unset, str]): + filterlabelsnot_in (Union[Unset, str]): + filterrefseq (Union[Unset, str]): + filterrefsnot_eq (Union[Unset, str]): + filterrefsin (Union[Unset, str]): + filterrefsnot_in (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -318,92 +317,92 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - filtersource: str | Unset = UNSET, - filterservices: str | Unset = UNSET, - filterenvironments: str | Unset = UNSET, - filterlabels: str | Unset = UNSET, - filterrefs: str | Unset = UNSET, - filterstarted_atgt: str | Unset = UNSET, - filterstarted_atgte: str | Unset = UNSET, - filterstarted_atlt: str | Unset = UNSET, - filterstarted_atlte: str | Unset = UNSET, - filterended_atgt: str | Unset = UNSET, - filterended_atgte: str | Unset = UNSET, - filterended_atlt: str | Unset = UNSET, - filterended_atlte: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filtersourceeq: str | Unset = UNSET, - filtersourcenot_eq: str | Unset = UNSET, - filtersourcein: str | Unset = UNSET, - filtersourcenot_in: str | Unset = UNSET, - filterserviceseq: str | Unset = UNSET, - filterservicesnot_eq: str | Unset = UNSET, - filterservicesin: str | Unset = UNSET, - filterservicesnot_in: str | Unset = UNSET, - filterenvironmentseq: str | Unset = UNSET, - filterenvironmentsnot_eq: str | Unset = UNSET, - filterenvironmentsin: str | Unset = UNSET, - filterenvironmentsnot_in: str | Unset = UNSET, - filterlabelseq: str | Unset = UNSET, - filterlabelsnot_eq: str | Unset = UNSET, - filterlabelsin: str | Unset = UNSET, - filterlabelsnot_in: str | Unset = UNSET, - filterrefseq: str | Unset = UNSET, - filterrefsnot_eq: str | Unset = UNSET, - filterrefsin: str | Unset = UNSET, - filterrefsnot_in: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, -) -> PulseList | None: + include: Union[Unset, str] = UNSET, + filtersource: Union[Unset, str] = UNSET, + filterservices: Union[Unset, str] = UNSET, + filterenvironments: Union[Unset, str] = UNSET, + filterlabels: Union[Unset, str] = UNSET, + filterrefs: Union[Unset, str] = UNSET, + filterstarted_atgt: Union[Unset, str] = UNSET, + filterstarted_atgte: Union[Unset, str] = UNSET, + filterstarted_atlt: Union[Unset, str] = UNSET, + filterstarted_atlte: Union[Unset, str] = UNSET, + filterended_atgt: Union[Unset, str] = UNSET, + filterended_atgte: Union[Unset, str] = UNSET, + filterended_atlt: Union[Unset, str] = UNSET, + filterended_atlte: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filtersourceeq: Union[Unset, str] = UNSET, + filtersourcenot_eq: Union[Unset, str] = UNSET, + filtersourcein: Union[Unset, str] = UNSET, + filtersourcenot_in: Union[Unset, str] = UNSET, + filterserviceseq: Union[Unset, str] = UNSET, + filterservicesnot_eq: Union[Unset, str] = UNSET, + filterservicesin: Union[Unset, str] = UNSET, + filterservicesnot_in: Union[Unset, str] = UNSET, + filterenvironmentseq: Union[Unset, str] = UNSET, + filterenvironmentsnot_eq: Union[Unset, str] = UNSET, + filterenvironmentsin: Union[Unset, str] = UNSET, + filterenvironmentsnot_in: Union[Unset, str] = UNSET, + filterlabelseq: Union[Unset, str] = UNSET, + filterlabelsnot_eq: Union[Unset, str] = UNSET, + filterlabelsin: Union[Unset, str] = UNSET, + filterlabelsnot_in: Union[Unset, str] = UNSET, + filterrefseq: Union[Unset, str] = UNSET, + filterrefsnot_eq: Union[Unset, str] = UNSET, + filterrefsin: Union[Unset, str] = UNSET, + filterrefsnot_in: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, +) -> Optional[PulseList]: """List pulses List pulses Args: - include (str | Unset): - filtersource (str | Unset): - filterservices (str | Unset): - filterenvironments (str | Unset): - filterlabels (str | Unset): - filterrefs (str | Unset): - filterstarted_atgt (str | Unset): - filterstarted_atgte (str | Unset): - filterstarted_atlt (str | Unset): - filterstarted_atlte (str | Unset): - filterended_atgt (str | Unset): - filterended_atgte (str | Unset): - filterended_atlt (str | Unset): - filterended_atlte (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filtersourceeq (str | Unset): - filtersourcenot_eq (str | Unset): - filtersourcein (str | Unset): - filtersourcenot_in (str | Unset): - filterserviceseq (str | Unset): - filterservicesnot_eq (str | Unset): - filterservicesin (str | Unset): - filterservicesnot_in (str | Unset): - filterenvironmentseq (str | Unset): - filterenvironmentsnot_eq (str | Unset): - filterenvironmentsin (str | Unset): - filterenvironmentsnot_in (str | Unset): - filterlabelseq (str | Unset): - filterlabelsnot_eq (str | Unset): - filterlabelsin (str | Unset): - filterlabelsnot_in (str | Unset): - filterrefseq (str | Unset): - filterrefsnot_eq (str | Unset): - filterrefsin (str | Unset): - filterrefsnot_in (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + filtersource (Union[Unset, str]): + filterservices (Union[Unset, str]): + filterenvironments (Union[Unset, str]): + filterlabels (Union[Unset, str]): + filterrefs (Union[Unset, str]): + filterstarted_atgt (Union[Unset, str]): + filterstarted_atgte (Union[Unset, str]): + filterstarted_atlt (Union[Unset, str]): + filterstarted_atlte (Union[Unset, str]): + filterended_atgt (Union[Unset, str]): + filterended_atgte (Union[Unset, str]): + filterended_atlt (Union[Unset, str]): + filterended_atlte (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filtersourceeq (Union[Unset, str]): + filtersourcenot_eq (Union[Unset, str]): + filtersourcein (Union[Unset, str]): + filtersourcenot_in (Union[Unset, str]): + filterserviceseq (Union[Unset, str]): + filterservicesnot_eq (Union[Unset, str]): + filterservicesin (Union[Unset, str]): + filterservicesnot_in (Union[Unset, str]): + filterenvironmentseq (Union[Unset, str]): + filterenvironmentsnot_eq (Union[Unset, str]): + filterenvironmentsin (Union[Unset, str]): + filterenvironmentsnot_in (Union[Unset, str]): + filterlabelseq (Union[Unset, str]): + filterlabelsnot_eq (Union[Unset, str]): + filterlabelsin (Union[Unset, str]): + filterlabelsnot_in (Union[Unset, str]): + filterrefseq (Union[Unset, str]): + filterrefsnot_eq (Union[Unset, str]): + filterrefsin (Union[Unset, str]): + filterrefsnot_in (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -461,92 +460,92 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - filtersource: str | Unset = UNSET, - filterservices: str | Unset = UNSET, - filterenvironments: str | Unset = UNSET, - filterlabels: str | Unset = UNSET, - filterrefs: str | Unset = UNSET, - filterstarted_atgt: str | Unset = UNSET, - filterstarted_atgte: str | Unset = UNSET, - filterstarted_atlt: str | Unset = UNSET, - filterstarted_atlte: str | Unset = UNSET, - filterended_atgt: str | Unset = UNSET, - filterended_atgte: str | Unset = UNSET, - filterended_atlt: str | Unset = UNSET, - filterended_atlte: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filtersourceeq: str | Unset = UNSET, - filtersourcenot_eq: str | Unset = UNSET, - filtersourcein: str | Unset = UNSET, - filtersourcenot_in: str | Unset = UNSET, - filterserviceseq: str | Unset = UNSET, - filterservicesnot_eq: str | Unset = UNSET, - filterservicesin: str | Unset = UNSET, - filterservicesnot_in: str | Unset = UNSET, - filterenvironmentseq: str | Unset = UNSET, - filterenvironmentsnot_eq: str | Unset = UNSET, - filterenvironmentsin: str | Unset = UNSET, - filterenvironmentsnot_in: str | Unset = UNSET, - filterlabelseq: str | Unset = UNSET, - filterlabelsnot_eq: str | Unset = UNSET, - filterlabelsin: str | Unset = UNSET, - filterlabelsnot_in: str | Unset = UNSET, - filterrefseq: str | Unset = UNSET, - filterrefsnot_eq: str | Unset = UNSET, - filterrefsin: str | Unset = UNSET, - filterrefsnot_in: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Union[Unset, str] = UNSET, + filtersource: Union[Unset, str] = UNSET, + filterservices: Union[Unset, str] = UNSET, + filterenvironments: Union[Unset, str] = UNSET, + filterlabels: Union[Unset, str] = UNSET, + filterrefs: Union[Unset, str] = UNSET, + filterstarted_atgt: Union[Unset, str] = UNSET, + filterstarted_atgte: Union[Unset, str] = UNSET, + filterstarted_atlt: Union[Unset, str] = UNSET, + filterstarted_atlte: Union[Unset, str] = UNSET, + filterended_atgt: Union[Unset, str] = UNSET, + filterended_atgte: Union[Unset, str] = UNSET, + filterended_atlt: Union[Unset, str] = UNSET, + filterended_atlte: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filtersourceeq: Union[Unset, str] = UNSET, + filtersourcenot_eq: Union[Unset, str] = UNSET, + filtersourcein: Union[Unset, str] = UNSET, + filtersourcenot_in: Union[Unset, str] = UNSET, + filterserviceseq: Union[Unset, str] = UNSET, + filterservicesnot_eq: Union[Unset, str] = UNSET, + filterservicesin: Union[Unset, str] = UNSET, + filterservicesnot_in: Union[Unset, str] = UNSET, + filterenvironmentseq: Union[Unset, str] = UNSET, + filterenvironmentsnot_eq: Union[Unset, str] = UNSET, + filterenvironmentsin: Union[Unset, str] = UNSET, + filterenvironmentsnot_in: Union[Unset, str] = UNSET, + filterlabelseq: Union[Unset, str] = UNSET, + filterlabelsnot_eq: Union[Unset, str] = UNSET, + filterlabelsin: Union[Unset, str] = UNSET, + filterlabelsnot_in: Union[Unset, str] = UNSET, + filterrefseq: Union[Unset, str] = UNSET, + filterrefsnot_eq: Union[Unset, str] = UNSET, + filterrefsin: Union[Unset, str] = UNSET, + filterrefsnot_in: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, ) -> Response[PulseList]: """List pulses List pulses Args: - include (str | Unset): - filtersource (str | Unset): - filterservices (str | Unset): - filterenvironments (str | Unset): - filterlabels (str | Unset): - filterrefs (str | Unset): - filterstarted_atgt (str | Unset): - filterstarted_atgte (str | Unset): - filterstarted_atlt (str | Unset): - filterstarted_atlte (str | Unset): - filterended_atgt (str | Unset): - filterended_atgte (str | Unset): - filterended_atlt (str | Unset): - filterended_atlte (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filtersourceeq (str | Unset): - filtersourcenot_eq (str | Unset): - filtersourcein (str | Unset): - filtersourcenot_in (str | Unset): - filterserviceseq (str | Unset): - filterservicesnot_eq (str | Unset): - filterservicesin (str | Unset): - filterservicesnot_in (str | Unset): - filterenvironmentseq (str | Unset): - filterenvironmentsnot_eq (str | Unset): - filterenvironmentsin (str | Unset): - filterenvironmentsnot_in (str | Unset): - filterlabelseq (str | Unset): - filterlabelsnot_eq (str | Unset): - filterlabelsin (str | Unset): - filterlabelsnot_in (str | Unset): - filterrefseq (str | Unset): - filterrefsnot_eq (str | Unset): - filterrefsin (str | Unset): - filterrefsnot_in (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + filtersource (Union[Unset, str]): + filterservices (Union[Unset, str]): + filterenvironments (Union[Unset, str]): + filterlabels (Union[Unset, str]): + filterrefs (Union[Unset, str]): + filterstarted_atgt (Union[Unset, str]): + filterstarted_atgte (Union[Unset, str]): + filterstarted_atlt (Union[Unset, str]): + filterstarted_atlte (Union[Unset, str]): + filterended_atgt (Union[Unset, str]): + filterended_atgte (Union[Unset, str]): + filterended_atlt (Union[Unset, str]): + filterended_atlte (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filtersourceeq (Union[Unset, str]): + filtersourcenot_eq (Union[Unset, str]): + filtersourcein (Union[Unset, str]): + filtersourcenot_in (Union[Unset, str]): + filterserviceseq (Union[Unset, str]): + filterservicesnot_eq (Union[Unset, str]): + filterservicesin (Union[Unset, str]): + filterservicesnot_in (Union[Unset, str]): + filterenvironmentseq (Union[Unset, str]): + filterenvironmentsnot_eq (Union[Unset, str]): + filterenvironmentsin (Union[Unset, str]): + filterenvironmentsnot_in (Union[Unset, str]): + filterlabelseq (Union[Unset, str]): + filterlabelsnot_eq (Union[Unset, str]): + filterlabelsin (Union[Unset, str]): + filterlabelsnot_in (Union[Unset, str]): + filterrefseq (Union[Unset, str]): + filterrefsnot_eq (Union[Unset, str]): + filterrefsin (Union[Unset, str]): + filterrefsnot_in (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -607,92 +606,92 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - filtersource: str | Unset = UNSET, - filterservices: str | Unset = UNSET, - filterenvironments: str | Unset = UNSET, - filterlabels: str | Unset = UNSET, - filterrefs: str | Unset = UNSET, - filterstarted_atgt: str | Unset = UNSET, - filterstarted_atgte: str | Unset = UNSET, - filterstarted_atlt: str | Unset = UNSET, - filterstarted_atlte: str | Unset = UNSET, - filterended_atgt: str | Unset = UNSET, - filterended_atgte: str | Unset = UNSET, - filterended_atlt: str | Unset = UNSET, - filterended_atlte: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filtersourceeq: str | Unset = UNSET, - filtersourcenot_eq: str | Unset = UNSET, - filtersourcein: str | Unset = UNSET, - filtersourcenot_in: str | Unset = UNSET, - filterserviceseq: str | Unset = UNSET, - filterservicesnot_eq: str | Unset = UNSET, - filterservicesin: str | Unset = UNSET, - filterservicesnot_in: str | Unset = UNSET, - filterenvironmentseq: str | Unset = UNSET, - filterenvironmentsnot_eq: str | Unset = UNSET, - filterenvironmentsin: str | Unset = UNSET, - filterenvironmentsnot_in: str | Unset = UNSET, - filterlabelseq: str | Unset = UNSET, - filterlabelsnot_eq: str | Unset = UNSET, - filterlabelsin: str | Unset = UNSET, - filterlabelsnot_in: str | Unset = UNSET, - filterrefseq: str | Unset = UNSET, - filterrefsnot_eq: str | Unset = UNSET, - filterrefsin: str | Unset = UNSET, - filterrefsnot_in: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, -) -> PulseList | None: + include: Union[Unset, str] = UNSET, + filtersource: Union[Unset, str] = UNSET, + filterservices: Union[Unset, str] = UNSET, + filterenvironments: Union[Unset, str] = UNSET, + filterlabels: Union[Unset, str] = UNSET, + filterrefs: Union[Unset, str] = UNSET, + filterstarted_atgt: Union[Unset, str] = UNSET, + filterstarted_atgte: Union[Unset, str] = UNSET, + filterstarted_atlt: Union[Unset, str] = UNSET, + filterstarted_atlte: Union[Unset, str] = UNSET, + filterended_atgt: Union[Unset, str] = UNSET, + filterended_atgte: Union[Unset, str] = UNSET, + filterended_atlt: Union[Unset, str] = UNSET, + filterended_atlte: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filtersourceeq: Union[Unset, str] = UNSET, + filtersourcenot_eq: Union[Unset, str] = UNSET, + filtersourcein: Union[Unset, str] = UNSET, + filtersourcenot_in: Union[Unset, str] = UNSET, + filterserviceseq: Union[Unset, str] = UNSET, + filterservicesnot_eq: Union[Unset, str] = UNSET, + filterservicesin: Union[Unset, str] = UNSET, + filterservicesnot_in: Union[Unset, str] = UNSET, + filterenvironmentseq: Union[Unset, str] = UNSET, + filterenvironmentsnot_eq: Union[Unset, str] = UNSET, + filterenvironmentsin: Union[Unset, str] = UNSET, + filterenvironmentsnot_in: Union[Unset, str] = UNSET, + filterlabelseq: Union[Unset, str] = UNSET, + filterlabelsnot_eq: Union[Unset, str] = UNSET, + filterlabelsin: Union[Unset, str] = UNSET, + filterlabelsnot_in: Union[Unset, str] = UNSET, + filterrefseq: Union[Unset, str] = UNSET, + filterrefsnot_eq: Union[Unset, str] = UNSET, + filterrefsin: Union[Unset, str] = UNSET, + filterrefsnot_in: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, +) -> Optional[PulseList]: """List pulses List pulses Args: - include (str | Unset): - filtersource (str | Unset): - filterservices (str | Unset): - filterenvironments (str | Unset): - filterlabels (str | Unset): - filterrefs (str | Unset): - filterstarted_atgt (str | Unset): - filterstarted_atgte (str | Unset): - filterstarted_atlt (str | Unset): - filterstarted_atlte (str | Unset): - filterended_atgt (str | Unset): - filterended_atgte (str | Unset): - filterended_atlt (str | Unset): - filterended_atlte (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filtersourceeq (str | Unset): - filtersourcenot_eq (str | Unset): - filtersourcein (str | Unset): - filtersourcenot_in (str | Unset): - filterserviceseq (str | Unset): - filterservicesnot_eq (str | Unset): - filterservicesin (str | Unset): - filterservicesnot_in (str | Unset): - filterenvironmentseq (str | Unset): - filterenvironmentsnot_eq (str | Unset): - filterenvironmentsin (str | Unset): - filterenvironmentsnot_in (str | Unset): - filterlabelseq (str | Unset): - filterlabelsnot_eq (str | Unset): - filterlabelsin (str | Unset): - filterlabelsnot_in (str | Unset): - filterrefseq (str | Unset): - filterrefsnot_eq (str | Unset): - filterrefsin (str | Unset): - filterrefsnot_in (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + filtersource (Union[Unset, str]): + filterservices (Union[Unset, str]): + filterenvironments (Union[Unset, str]): + filterlabels (Union[Unset, str]): + filterrefs (Union[Unset, str]): + filterstarted_atgt (Union[Unset, str]): + filterstarted_atgte (Union[Unset, str]): + filterstarted_atlt (Union[Unset, str]): + filterstarted_atlte (Union[Unset, str]): + filterended_atgt (Union[Unset, str]): + filterended_atgte (Union[Unset, str]): + filterended_atlt (Union[Unset, str]): + filterended_atlte (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filtersourceeq (Union[Unset, str]): + filtersourcenot_eq (Union[Unset, str]): + filtersourcein (Union[Unset, str]): + filtersourcenot_in (Union[Unset, str]): + filterserviceseq (Union[Unset, str]): + filterservicesnot_eq (Union[Unset, str]): + filterservicesin (Union[Unset, str]): + filterservicesnot_in (Union[Unset, str]): + filterenvironmentseq (Union[Unset, str]): + filterenvironmentsnot_eq (Union[Unset, str]): + filterenvironmentsin (Union[Unset, str]): + filterenvironmentsnot_in (Union[Unset, str]): + filterlabelseq (Union[Unset, str]): + filterlabelsnot_eq (Union[Unset, str]): + filterlabelsin (Union[Unset, str]): + filterlabelsnot_in (Union[Unset, str]): + filterrefseq (Union[Unset, str]): + filterrefsnot_eq (Union[Unset, str]): + filterrefsin (Union[Unset, str]): + filterrefsnot_in (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/pulses/update_pulse.py b/rootly_sdk/api/pulses/update_pulse.py index 38022933..961c0885 100644 --- a/rootly_sdk/api/pulses/update_pulse.py +++ b/rootly_sdk/api/pulses/update_pulse.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/pulses/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/pulses/{id}", } _kwargs["json"] = body.to_dict() @@ -35,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | PulseResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, PulseResponse]]: if response.status_code == 200: response_200 = PulseResponse.from_dict(response.json()) @@ -54,8 +51,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | PulseResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, PulseResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdatePulse, -) -> Response[ErrorsList | PulseResponse]: +) -> Response[Union[ErrorsList, PulseResponse]]: """Update a pulse Update a specific pulse by id @@ -83,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | PulseResponse] + Response[Union[ErrorsList, PulseResponse]] """ kwargs = _get_kwargs( @@ -103,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: UpdatePulse, -) -> ErrorsList | PulseResponse | None: +) -> Optional[Union[ErrorsList, PulseResponse]]: """Update a pulse Update a specific pulse by id @@ -117,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | PulseResponse + Union[ErrorsList, PulseResponse] """ return sync_detailed( @@ -132,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdatePulse, -) -> Response[ErrorsList | PulseResponse]: +) -> Response[Union[ErrorsList, PulseResponse]]: """Update a pulse Update a specific pulse by id @@ -146,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | PulseResponse] + Response[Union[ErrorsList, PulseResponse]] """ kwargs = _get_kwargs( @@ -164,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdatePulse, -) -> ErrorsList | PulseResponse | None: +) -> Optional[Union[ErrorsList, PulseResponse]]: """Update a pulse Update a specific pulse by id @@ -178,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | PulseResponse + Union[ErrorsList, PulseResponse] """ return ( diff --git a/rootly_sdk/api/retrospective_configurations/get_retrospective_configuration.py b/rootly_sdk/api/retrospective_configurations/get_retrospective_configuration.py index a198248f..b4e6f9cc 100644 --- a/rootly_sdk/api/retrospective_configurations/get_retrospective_configuration.py +++ b/rootly_sdk/api/retrospective_configurations/get_retrospective_configuration.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -17,12 +16,11 @@ def _get_kwargs( id: str, *, - include: GetRetrospectiveConfigurationInclude | Unset = UNSET, + include: Union[Unset, GetRetrospectiveConfigurationInclude] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} - json_include: str | Unset = UNSET + json_include: Union[Unset, str] = UNSET if not isinstance(include, Unset): json_include = include @@ -32,9 +30,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/retrospective_configurations/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/retrospective_configurations/{id}", "params": params, } @@ -42,8 +38,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | RetrospectiveConfigurationResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, RetrospectiveConfigurationResponse]]: if response.status_code == 200: response_200 = RetrospectiveConfigurationResponse.from_dict(response.json()) @@ -61,8 +57,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | RetrospectiveConfigurationResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, RetrospectiveConfigurationResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -75,22 +71,22 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, - include: GetRetrospectiveConfigurationInclude | Unset = UNSET, -) -> Response[ErrorsList | RetrospectiveConfigurationResponse]: + include: Union[Unset, GetRetrospectiveConfigurationInclude] = UNSET, +) -> Response[Union[ErrorsList, RetrospectiveConfigurationResponse]]: """Retrieves a Retrospective Configuration Retrieves a specific retrospective_configuration by id Args: id (str): - include (GetRetrospectiveConfigurationInclude | Unset): + include (Union[Unset, GetRetrospectiveConfigurationInclude]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | RetrospectiveConfigurationResponse] + Response[Union[ErrorsList, RetrospectiveConfigurationResponse]] """ kwargs = _get_kwargs( @@ -109,22 +105,22 @@ def sync( id: str, *, client: AuthenticatedClient, - include: GetRetrospectiveConfigurationInclude | Unset = UNSET, -) -> ErrorsList | RetrospectiveConfigurationResponse | None: + include: Union[Unset, GetRetrospectiveConfigurationInclude] = UNSET, +) -> Optional[Union[ErrorsList, RetrospectiveConfigurationResponse]]: """Retrieves a Retrospective Configuration Retrieves a specific retrospective_configuration by id Args: id (str): - include (GetRetrospectiveConfigurationInclude | Unset): + include (Union[Unset, GetRetrospectiveConfigurationInclude]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | RetrospectiveConfigurationResponse + Union[ErrorsList, RetrospectiveConfigurationResponse] """ return sync_detailed( @@ -138,22 +134,22 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, - include: GetRetrospectiveConfigurationInclude | Unset = UNSET, -) -> Response[ErrorsList | RetrospectiveConfigurationResponse]: + include: Union[Unset, GetRetrospectiveConfigurationInclude] = UNSET, +) -> Response[Union[ErrorsList, RetrospectiveConfigurationResponse]]: """Retrieves a Retrospective Configuration Retrieves a specific retrospective_configuration by id Args: id (str): - include (GetRetrospectiveConfigurationInclude | Unset): + include (Union[Unset, GetRetrospectiveConfigurationInclude]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | RetrospectiveConfigurationResponse] + Response[Union[ErrorsList, RetrospectiveConfigurationResponse]] """ kwargs = _get_kwargs( @@ -170,22 +166,22 @@ async def asyncio( id: str, *, client: AuthenticatedClient, - include: GetRetrospectiveConfigurationInclude | Unset = UNSET, -) -> ErrorsList | RetrospectiveConfigurationResponse | None: + include: Union[Unset, GetRetrospectiveConfigurationInclude] = UNSET, +) -> Optional[Union[ErrorsList, RetrospectiveConfigurationResponse]]: """Retrieves a Retrospective Configuration Retrieves a specific retrospective_configuration by id Args: id (str): - include (GetRetrospectiveConfigurationInclude | Unset): + include (Union[Unset, GetRetrospectiveConfigurationInclude]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | RetrospectiveConfigurationResponse + Union[ErrorsList, RetrospectiveConfigurationResponse] """ return ( diff --git a/rootly_sdk/api/retrospective_configurations/list_retrospective_configurations.py b/rootly_sdk/api/retrospective_configurations/list_retrospective_configurations.py index 41494cab..fccc98da 100644 --- a/rootly_sdk/api/retrospective_configurations/list_retrospective_configurations.py +++ b/rootly_sdk/api/retrospective_configurations/list_retrospective_configurations.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -14,15 +14,14 @@ def _get_kwargs( *, - include: ListRetrospectiveConfigurationsInclude | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterkind: str | Unset = UNSET, + include: Union[Unset, ListRetrospectiveConfigurationsInclude] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterkind: Union[Unset, str] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} - json_include: str | Unset = UNSET + json_include: Union[Unset, str] = UNSET if not isinstance(include, Unset): json_include = include @@ -46,8 +45,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> RetrospectiveConfigurationList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[RetrospectiveConfigurationList]: if response.status_code == 200: response_200 = RetrospectiveConfigurationList.from_dict(response.json()) @@ -60,7 +59,7 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[RetrospectiveConfigurationList]: return Response( status_code=HTTPStatus(response.status_code), @@ -73,20 +72,20 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - include: ListRetrospectiveConfigurationsInclude | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterkind: str | Unset = UNSET, + include: Union[Unset, ListRetrospectiveConfigurationsInclude] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterkind: Union[Unset, str] = UNSET, ) -> Response[RetrospectiveConfigurationList]: """List retrospective configurations List retrospective configurations Args: - include (ListRetrospectiveConfigurationsInclude | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterkind (str | Unset): + include (Union[Unset, ListRetrospectiveConfigurationsInclude]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterkind (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -113,20 +112,20 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: ListRetrospectiveConfigurationsInclude | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterkind: str | Unset = UNSET, -) -> RetrospectiveConfigurationList | None: + include: Union[Unset, ListRetrospectiveConfigurationsInclude] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterkind: Union[Unset, str] = UNSET, +) -> Optional[RetrospectiveConfigurationList]: """List retrospective configurations List retrospective configurations Args: - include (ListRetrospectiveConfigurationsInclude | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterkind (str | Unset): + include (Union[Unset, ListRetrospectiveConfigurationsInclude]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterkind (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -148,20 +147,20 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: ListRetrospectiveConfigurationsInclude | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterkind: str | Unset = UNSET, + include: Union[Unset, ListRetrospectiveConfigurationsInclude] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterkind: Union[Unset, str] = UNSET, ) -> Response[RetrospectiveConfigurationList]: """List retrospective configurations List retrospective configurations Args: - include (ListRetrospectiveConfigurationsInclude | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterkind (str | Unset): + include (Union[Unset, ListRetrospectiveConfigurationsInclude]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterkind (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -186,20 +185,20 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: ListRetrospectiveConfigurationsInclude | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterkind: str | Unset = UNSET, -) -> RetrospectiveConfigurationList | None: + include: Union[Unset, ListRetrospectiveConfigurationsInclude] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterkind: Union[Unset, str] = UNSET, +) -> Optional[RetrospectiveConfigurationList]: """List retrospective configurations List retrospective configurations Args: - include (ListRetrospectiveConfigurationsInclude | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterkind (str | Unset): + include (Union[Unset, ListRetrospectiveConfigurationsInclude]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterkind (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/retrospective_configurations/update_retrospective_configuration.py b/rootly_sdk/api/retrospective_configurations/update_retrospective_configuration.py index ceb35adb..15f4eb22 100644 --- a/rootly_sdk/api/retrospective_configurations/update_retrospective_configuration.py +++ b/rootly_sdk/api/retrospective_configurations/update_retrospective_configuration.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/retrospective_configurations/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/retrospective_configurations/{id}", } _kwargs["json"] = body.to_dict() @@ -35,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | RetrospectiveConfigurationResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, RetrospectiveConfigurationResponse]]: if response.status_code == 200: response_200 = RetrospectiveConfigurationResponse.from_dict(response.json()) @@ -54,8 +51,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | RetrospectiveConfigurationResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, RetrospectiveConfigurationResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateRetrospectiveConfiguration, -) -> Response[ErrorsList | RetrospectiveConfigurationResponse]: +) -> Response[Union[ErrorsList, RetrospectiveConfigurationResponse]]: """Update a retrospective configuration Update a specific retrospective configuration by id @@ -83,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | RetrospectiveConfigurationResponse] + Response[Union[ErrorsList, RetrospectiveConfigurationResponse]] """ kwargs = _get_kwargs( @@ -103,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateRetrospectiveConfiguration, -) -> ErrorsList | RetrospectiveConfigurationResponse | None: +) -> Optional[Union[ErrorsList, RetrospectiveConfigurationResponse]]: """Update a retrospective configuration Update a specific retrospective configuration by id @@ -117,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | RetrospectiveConfigurationResponse + Union[ErrorsList, RetrospectiveConfigurationResponse] """ return sync_detailed( @@ -132,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateRetrospectiveConfiguration, -) -> Response[ErrorsList | RetrospectiveConfigurationResponse]: +) -> Response[Union[ErrorsList, RetrospectiveConfigurationResponse]]: """Update a retrospective configuration Update a specific retrospective configuration by id @@ -146,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | RetrospectiveConfigurationResponse] + Response[Union[ErrorsList, RetrospectiveConfigurationResponse]] """ kwargs = _get_kwargs( @@ -164,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateRetrospectiveConfiguration, -) -> ErrorsList | RetrospectiveConfigurationResponse | None: +) -> Optional[Union[ErrorsList, RetrospectiveConfigurationResponse]]: """Update a retrospective configuration Update a specific retrospective configuration by id @@ -178,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | RetrospectiveConfigurationResponse + Union[ErrorsList, RetrospectiveConfigurationResponse] """ return ( diff --git a/rootly_sdk/api/retrospective_process_group_steps/create_retrospective_process_group_step.py b/rootly_sdk/api/retrospective_process_group_steps/create_retrospective_process_group_step.py index 2284fedd..c901772c 100644 --- a/rootly_sdk/api/retrospective_process_group_steps/create_retrospective_process_group_step.py +++ b/rootly_sdk/api/retrospective_process_group_steps/create_retrospective_process_group_step.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/retrospective_process_groups/{retrospective_process_group_id}/steps".format( - retrospective_process_group_id=quote(str(retrospective_process_group_id), safe=""), - ), + "url": f"/v1/retrospective_process_groups/{retrospective_process_group_id}/steps", } _kwargs["json"] = body.to_dict() @@ -35,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | RetrospectiveProcessGroupStepResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, RetrospectiveProcessGroupStepResponse]]: if response.status_code == 201: response_201 = RetrospectiveProcessGroupStepResponse.from_dict(response.json()) @@ -54,8 +51,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | RetrospectiveProcessGroupStepResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, RetrospectiveProcessGroupStepResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewRetrospectiveProcessGroupStep, -) -> Response[ErrorsList | RetrospectiveProcessGroupStepResponse]: +) -> Response[Union[ErrorsList, RetrospectiveProcessGroupStepResponse]]: """Creates a retrospective process group step Creates a new retrospective process group step from provided data @@ -83,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | RetrospectiveProcessGroupStepResponse] + Response[Union[ErrorsList, RetrospectiveProcessGroupStepResponse]] """ kwargs = _get_kwargs( @@ -103,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: NewRetrospectiveProcessGroupStep, -) -> ErrorsList | RetrospectiveProcessGroupStepResponse | None: +) -> Optional[Union[ErrorsList, RetrospectiveProcessGroupStepResponse]]: """Creates a retrospective process group step Creates a new retrospective process group step from provided data @@ -117,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | RetrospectiveProcessGroupStepResponse + Union[ErrorsList, RetrospectiveProcessGroupStepResponse] """ return sync_detailed( @@ -132,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewRetrospectiveProcessGroupStep, -) -> Response[ErrorsList | RetrospectiveProcessGroupStepResponse]: +) -> Response[Union[ErrorsList, RetrospectiveProcessGroupStepResponse]]: """Creates a retrospective process group step Creates a new retrospective process group step from provided data @@ -146,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | RetrospectiveProcessGroupStepResponse] + Response[Union[ErrorsList, RetrospectiveProcessGroupStepResponse]] """ kwargs = _get_kwargs( @@ -164,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewRetrospectiveProcessGroupStep, -) -> ErrorsList | RetrospectiveProcessGroupStepResponse | None: +) -> Optional[Union[ErrorsList, RetrospectiveProcessGroupStepResponse]]: """Creates a retrospective process group step Creates a new retrospective process group step from provided data @@ -178,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | RetrospectiveProcessGroupStepResponse + Union[ErrorsList, RetrospectiveProcessGroupStepResponse] """ return ( diff --git a/rootly_sdk/api/retrospective_process_group_steps/delete_retrospective_process_group_step.py b/rootly_sdk/api/retrospective_process_group_steps/delete_retrospective_process_group_step.py index e49707dd..3b314bcf 100644 --- a/rootly_sdk/api/retrospective_process_group_steps/delete_retrospective_process_group_step.py +++ b/rootly_sdk/api/retrospective_process_group_steps/delete_retrospective_process_group_step.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/retrospective_process_group_steps/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/retrospective_process_group_steps/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | RetrospectiveProcessGroupStepResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, RetrospectiveProcessGroupStepResponse]]: if response.status_code == 200: response_200 = RetrospectiveProcessGroupStepResponse.from_dict(response.json()) @@ -45,8 +41,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | RetrospectiveProcessGroupStepResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, RetrospectiveProcessGroupStepResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | RetrospectiveProcessGroupStepResponse]: +) -> Response[Union[ErrorsList, RetrospectiveProcessGroupStepResponse]]: """Delete a RetrospectiveProcessGroup Step Delete a specific RetrospectiveProcessGroup Step by id @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | RetrospectiveProcessGroupStepResponse] + Response[Union[ErrorsList, RetrospectiveProcessGroupStepResponse]] """ kwargs = _get_kwargs( @@ -90,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | RetrospectiveProcessGroupStepResponse | None: +) -> Optional[Union[ErrorsList, RetrospectiveProcessGroupStepResponse]]: """Delete a RetrospectiveProcessGroup Step Delete a specific RetrospectiveProcessGroup Step by id @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | RetrospectiveProcessGroupStepResponse + Union[ErrorsList, RetrospectiveProcessGroupStepResponse] """ return sync_detailed( @@ -116,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | RetrospectiveProcessGroupStepResponse]: +) -> Response[Union[ErrorsList, RetrospectiveProcessGroupStepResponse]]: """Delete a RetrospectiveProcessGroup Step Delete a specific RetrospectiveProcessGroup Step by id @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | RetrospectiveProcessGroupStepResponse] + Response[Union[ErrorsList, RetrospectiveProcessGroupStepResponse]] """ kwargs = _get_kwargs( @@ -145,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | RetrospectiveProcessGroupStepResponse | None: +) -> Optional[Union[ErrorsList, RetrospectiveProcessGroupStepResponse]]: """Delete a RetrospectiveProcessGroup Step Delete a specific RetrospectiveProcessGroup Step by id @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | RetrospectiveProcessGroupStepResponse + Union[ErrorsList, RetrospectiveProcessGroupStepResponse] """ return ( diff --git a/rootly_sdk/api/retrospective_process_group_steps/get_retrospective_process_group_step.py b/rootly_sdk/api/retrospective_process_group_steps/get_retrospective_process_group_step.py index 7cb7eca6..b4a17ddc 100644 --- a/rootly_sdk/api/retrospective_process_group_steps/get_retrospective_process_group_step.py +++ b/rootly_sdk/api/retrospective_process_group_steps/get_retrospective_process_group_step.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -13,20 +12,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/retrospective_process_group_steps/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/retrospective_process_group_steps/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> RetrospectiveProcessGroupStepResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[RetrospectiveProcessGroupStepResponse]: if response.status_code == 200: response_200 = RetrospectiveProcessGroupStepResponse.from_dict(response.json()) @@ -39,7 +35,7 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[RetrospectiveProcessGroupStepResponse]: return Response( status_code=HTTPStatus(response.status_code), @@ -84,7 +80,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> RetrospectiveProcessGroupStepResponse | None: +) -> Optional[RetrospectiveProcessGroupStepResponse]: """Retrieves a RetrospectiveProcessGroup Step Retrieves a specific RetrospectiveProcessGroup Step by id @@ -139,7 +135,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> RetrospectiveProcessGroupStepResponse | None: +) -> Optional[RetrospectiveProcessGroupStepResponse]: """Retrieves a RetrospectiveProcessGroup Step Retrieves a specific RetrospectiveProcessGroup Step by id diff --git a/rootly_sdk/api/retrospective_process_group_steps/list_retrospective_process_group_steps.py b/rootly_sdk/api/retrospective_process_group_steps/list_retrospective_process_group_steps.py index 71508e1f..a0213bb5 100644 --- a/rootly_sdk/api/retrospective_process_group_steps/list_retrospective_process_group_steps.py +++ b/rootly_sdk/api/retrospective_process_group_steps/list_retrospective_process_group_steps.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -13,16 +12,15 @@ def _get_kwargs( retrospective_process_group_id: str, *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterretrospective_step_id: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterretrospective_step_id: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -45,9 +43,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/retrospective_process_groups/{retrospective_process_group_id}/steps".format( - retrospective_process_group_id=quote(str(retrospective_process_group_id), safe=""), - ), + "url": f"/v1/retrospective_process_groups/{retrospective_process_group_id}/steps", "params": params, } @@ -55,8 +51,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> RetrospectiveProcessGroupStepList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[RetrospectiveProcessGroupStepList]: if response.status_code == 200: response_200 = RetrospectiveProcessGroupStepList.from_dict(response.json()) @@ -69,7 +65,7 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[RetrospectiveProcessGroupStepList]: return Response( status_code=HTTPStatus(response.status_code), @@ -83,14 +79,14 @@ def sync_detailed( retrospective_process_group_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterretrospective_step_id: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterretrospective_step_id: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, ) -> Response[RetrospectiveProcessGroupStepList]: """List RetrospectiveProcessGroup Steps @@ -98,14 +94,14 @@ def sync_detailed( Args: retrospective_process_group_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterretrospective_step_id (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterretrospective_step_id (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -138,29 +134,29 @@ def sync( retrospective_process_group_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterretrospective_step_id: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, -) -> RetrospectiveProcessGroupStepList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterretrospective_step_id: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, +) -> Optional[RetrospectiveProcessGroupStepList]: """List RetrospectiveProcessGroup Steps List RetrospectiveProcessGroup Steps Args: retrospective_process_group_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterretrospective_step_id (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterretrospective_step_id (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -188,14 +184,14 @@ async def asyncio_detailed( retrospective_process_group_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterretrospective_step_id: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterretrospective_step_id: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, ) -> Response[RetrospectiveProcessGroupStepList]: """List RetrospectiveProcessGroup Steps @@ -203,14 +199,14 @@ async def asyncio_detailed( Args: retrospective_process_group_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterretrospective_step_id (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterretrospective_step_id (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -241,29 +237,29 @@ async def asyncio( retrospective_process_group_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterretrospective_step_id: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, -) -> RetrospectiveProcessGroupStepList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterretrospective_step_id: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, +) -> Optional[RetrospectiveProcessGroupStepList]: """List RetrospectiveProcessGroup Steps List RetrospectiveProcessGroup Steps Args: retrospective_process_group_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterretrospective_step_id (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterretrospective_step_id (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/retrospective_process_group_steps/update_retrospective_process_group_step.py b/rootly_sdk/api/retrospective_process_group_steps/update_retrospective_process_group_step.py index 6672af62..c362ddd6 100644 --- a/rootly_sdk/api/retrospective_process_group_steps/update_retrospective_process_group_step.py +++ b/rootly_sdk/api/retrospective_process_group_steps/update_retrospective_process_group_step.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -20,9 +19,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/retrospective_process_group_steps/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/retrospective_process_group_steps/{id}", } _kwargs["json"] = body.to_dict() @@ -34,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> RetrospectiveProcessGroupStepResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[RetrospectiveProcessGroupStepResponse]: if response.status_code == 200: response_200 = RetrospectiveProcessGroupStepResponse.from_dict(response.json()) @@ -48,7 +45,7 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[RetrospectiveProcessGroupStepResponse]: return Response( status_code=HTTPStatus(response.status_code), @@ -97,7 +94,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateRetrospectiveProcessGroupStep, -) -> RetrospectiveProcessGroupStepResponse | None: +) -> Optional[RetrospectiveProcessGroupStepResponse]: """Update RetrospectiveProcessGroup Step Update a specific RetrospectiveProcessGroup Step by id @@ -158,7 +155,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateRetrospectiveProcessGroupStep, -) -> RetrospectiveProcessGroupStepResponse | None: +) -> Optional[RetrospectiveProcessGroupStepResponse]: """Update RetrospectiveProcessGroup Step Update a specific RetrospectiveProcessGroup Step by id diff --git a/rootly_sdk/api/retrospective_process_groups/create_retrospective_process_group.py b/rootly_sdk/api/retrospective_process_groups/create_retrospective_process_group.py index 5d7feb3c..7fe70e89 100644 --- a/rootly_sdk/api/retrospective_process_groups/create_retrospective_process_group.py +++ b/rootly_sdk/api/retrospective_process_groups/create_retrospective_process_group.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/retrospective_processes/{retrospective_process_id}/groups".format( - retrospective_process_id=quote(str(retrospective_process_id), safe=""), - ), + "url": f"/v1/retrospective_processes/{retrospective_process_id}/groups", } _kwargs["json"] = body.to_dict() @@ -35,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | RetrospectiveProcessGroupResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, RetrospectiveProcessGroupResponse]]: if response.status_code == 201: response_201 = RetrospectiveProcessGroupResponse.from_dict(response.json()) @@ -54,8 +51,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | RetrospectiveProcessGroupResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, RetrospectiveProcessGroupResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewRetrospectiveProcessGroup, -) -> Response[ErrorsList | RetrospectiveProcessGroupResponse]: +) -> Response[Union[ErrorsList, RetrospectiveProcessGroupResponse]]: """Creates a retrospective process group Creates a new retrospective process group from provided data @@ -83,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | RetrospectiveProcessGroupResponse] + Response[Union[ErrorsList, RetrospectiveProcessGroupResponse]] """ kwargs = _get_kwargs( @@ -103,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: NewRetrospectiveProcessGroup, -) -> ErrorsList | RetrospectiveProcessGroupResponse | None: +) -> Optional[Union[ErrorsList, RetrospectiveProcessGroupResponse]]: """Creates a retrospective process group Creates a new retrospective process group from provided data @@ -117,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | RetrospectiveProcessGroupResponse + Union[ErrorsList, RetrospectiveProcessGroupResponse] """ return sync_detailed( @@ -132,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewRetrospectiveProcessGroup, -) -> Response[ErrorsList | RetrospectiveProcessGroupResponse]: +) -> Response[Union[ErrorsList, RetrospectiveProcessGroupResponse]]: """Creates a retrospective process group Creates a new retrospective process group from provided data @@ -146,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | RetrospectiveProcessGroupResponse] + Response[Union[ErrorsList, RetrospectiveProcessGroupResponse]] """ kwargs = _get_kwargs( @@ -164,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewRetrospectiveProcessGroup, -) -> ErrorsList | RetrospectiveProcessGroupResponse | None: +) -> Optional[Union[ErrorsList, RetrospectiveProcessGroupResponse]]: """Creates a retrospective process group Creates a new retrospective process group from provided data @@ -178,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | RetrospectiveProcessGroupResponse + Union[ErrorsList, RetrospectiveProcessGroupResponse] """ return ( diff --git a/rootly_sdk/api/retrospective_process_groups/delete_retrospective_process_group.py b/rootly_sdk/api/retrospective_process_groups/delete_retrospective_process_group.py index ffa0bd00..62377dde 100644 --- a/rootly_sdk/api/retrospective_process_groups/delete_retrospective_process_group.py +++ b/rootly_sdk/api/retrospective_process_groups/delete_retrospective_process_group.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/retrospective_process_groups/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/retrospective_process_groups/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | RetrospectiveProcessGroupResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, RetrospectiveProcessGroupResponse]]: if response.status_code == 200: response_200 = RetrospectiveProcessGroupResponse.from_dict(response.json()) @@ -45,8 +41,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | RetrospectiveProcessGroupResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, RetrospectiveProcessGroupResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | RetrospectiveProcessGroupResponse]: +) -> Response[Union[ErrorsList, RetrospectiveProcessGroupResponse]]: """Delete a Retrospective Process Group Delete a specific Retrospective Process Group by id @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | RetrospectiveProcessGroupResponse] + Response[Union[ErrorsList, RetrospectiveProcessGroupResponse]] """ kwargs = _get_kwargs( @@ -90,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | RetrospectiveProcessGroupResponse | None: +) -> Optional[Union[ErrorsList, RetrospectiveProcessGroupResponse]]: """Delete a Retrospective Process Group Delete a specific Retrospective Process Group by id @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | RetrospectiveProcessGroupResponse + Union[ErrorsList, RetrospectiveProcessGroupResponse] """ return sync_detailed( @@ -116,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | RetrospectiveProcessGroupResponse]: +) -> Response[Union[ErrorsList, RetrospectiveProcessGroupResponse]]: """Delete a Retrospective Process Group Delete a specific Retrospective Process Group by id @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | RetrospectiveProcessGroupResponse] + Response[Union[ErrorsList, RetrospectiveProcessGroupResponse]] """ kwargs = _get_kwargs( @@ -145,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | RetrospectiveProcessGroupResponse | None: +) -> Optional[Union[ErrorsList, RetrospectiveProcessGroupResponse]]: """Delete a Retrospective Process Group Delete a specific Retrospective Process Group by id @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | RetrospectiveProcessGroupResponse + Union[ErrorsList, RetrospectiveProcessGroupResponse] """ return ( diff --git a/rootly_sdk/api/retrospective_process_groups/get_retrospective_process_group.py b/rootly_sdk/api/retrospective_process_groups/get_retrospective_process_group.py index a1f3483d..650413ad 100644 --- a/rootly_sdk/api/retrospective_process_groups/get_retrospective_process_group.py +++ b/rootly_sdk/api/retrospective_process_groups/get_retrospective_process_group.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -16,12 +15,11 @@ def _get_kwargs( id: str, *, - include: GetRetrospectiveProcessGroupInclude | Unset = UNSET, + include: Union[Unset, GetRetrospectiveProcessGroupInclude] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} - json_include: str | Unset = UNSET + json_include: Union[Unset, str] = UNSET if not isinstance(include, Unset): json_include = include @@ -31,9 +29,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/retrospective_process_groups/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/retrospective_process_groups/{id}", "params": params, } @@ -41,8 +37,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> RetrospectiveProcessGroupResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[RetrospectiveProcessGroupResponse]: if response.status_code == 200: response_200 = RetrospectiveProcessGroupResponse.from_dict(response.json()) @@ -55,7 +51,7 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[RetrospectiveProcessGroupResponse]: return Response( status_code=HTTPStatus(response.status_code), @@ -69,7 +65,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, - include: GetRetrospectiveProcessGroupInclude | Unset = UNSET, + include: Union[Unset, GetRetrospectiveProcessGroupInclude] = UNSET, ) -> Response[RetrospectiveProcessGroupResponse]: """Retrieves a Retrospective Process Group @@ -77,7 +73,7 @@ def sync_detailed( Args: id (str): - include (GetRetrospectiveProcessGroupInclude | Unset): + include (Union[Unset, GetRetrospectiveProcessGroupInclude]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -103,15 +99,15 @@ def sync( id: str, *, client: AuthenticatedClient, - include: GetRetrospectiveProcessGroupInclude | Unset = UNSET, -) -> RetrospectiveProcessGroupResponse | None: + include: Union[Unset, GetRetrospectiveProcessGroupInclude] = UNSET, +) -> Optional[RetrospectiveProcessGroupResponse]: """Retrieves a Retrospective Process Group Retrieves a specific Retrospective Process Group by id Args: id (str): - include (GetRetrospectiveProcessGroupInclude | Unset): + include (Union[Unset, GetRetrospectiveProcessGroupInclude]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -132,7 +128,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, - include: GetRetrospectiveProcessGroupInclude | Unset = UNSET, + include: Union[Unset, GetRetrospectiveProcessGroupInclude] = UNSET, ) -> Response[RetrospectiveProcessGroupResponse]: """Retrieves a Retrospective Process Group @@ -140,7 +136,7 @@ async def asyncio_detailed( Args: id (str): - include (GetRetrospectiveProcessGroupInclude | Unset): + include (Union[Unset, GetRetrospectiveProcessGroupInclude]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -164,15 +160,15 @@ async def asyncio( id: str, *, client: AuthenticatedClient, - include: GetRetrospectiveProcessGroupInclude | Unset = UNSET, -) -> RetrospectiveProcessGroupResponse | None: + include: Union[Unset, GetRetrospectiveProcessGroupInclude] = UNSET, +) -> Optional[RetrospectiveProcessGroupResponse]: """Retrieves a Retrospective Process Group Retrieves a specific Retrospective Process Group by id Args: id (str): - include (GetRetrospectiveProcessGroupInclude | Unset): + include (Union[Unset, GetRetrospectiveProcessGroupInclude]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/retrospective_process_groups/list_retrospective_process_groups.py b/rootly_sdk/api/retrospective_process_groups/list_retrospective_process_groups.py index a2ace0f8..f8475227 100644 --- a/rootly_sdk/api/retrospective_process_groups/list_retrospective_process_groups.py +++ b/rootly_sdk/api/retrospective_process_groups/list_retrospective_process_groups.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -19,26 +18,25 @@ def _get_kwargs( retrospective_process_id: str, *, - include: ListRetrospectiveProcessGroupsInclude | Unset = UNSET, - sort: ListRetrospectiveProcessGroupsSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersub_status_id: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Union[Unset, ListRetrospectiveProcessGroupsInclude] = UNSET, + sort: Union[Unset, ListRetrospectiveProcessGroupsSort] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersub_status_id: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} - json_include: str | Unset = UNSET + json_include: Union[Unset, str] = UNSET if not isinstance(include, Unset): json_include = include params["include"] = json_include - json_sort: str | Unset = UNSET + json_sort: Union[Unset, str] = UNSET if not isinstance(sort, Unset): json_sort = sort @@ -62,9 +60,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/retrospective_processes/{retrospective_process_id}/groups".format( - retrospective_process_id=quote(str(retrospective_process_id), safe=""), - ), + "url": f"/v1/retrospective_processes/{retrospective_process_id}/groups", "params": params, } @@ -72,8 +68,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> RetrospectiveProcessGroupList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[RetrospectiveProcessGroupList]: if response.status_code == 200: response_200 = RetrospectiveProcessGroupList.from_dict(response.json()) @@ -86,7 +82,7 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[RetrospectiveProcessGroupList]: return Response( status_code=HTTPStatus(response.status_code), @@ -100,15 +96,15 @@ def sync_detailed( retrospective_process_id: str, *, client: AuthenticatedClient, - include: ListRetrospectiveProcessGroupsInclude | Unset = UNSET, - sort: ListRetrospectiveProcessGroupsSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersub_status_id: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Union[Unset, ListRetrospectiveProcessGroupsInclude] = UNSET, + sort: Union[Unset, ListRetrospectiveProcessGroupsSort] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersub_status_id: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, ) -> Response[RetrospectiveProcessGroupList]: """List Retrospective Process Groups @@ -116,15 +112,15 @@ def sync_detailed( Args: retrospective_process_id (str): - include (ListRetrospectiveProcessGroupsInclude | Unset): - sort (ListRetrospectiveProcessGroupsSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersub_status_id (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, ListRetrospectiveProcessGroupsInclude]): + sort (Union[Unset, ListRetrospectiveProcessGroupsSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersub_status_id (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -158,31 +154,31 @@ def sync( retrospective_process_id: str, *, client: AuthenticatedClient, - include: ListRetrospectiveProcessGroupsInclude | Unset = UNSET, - sort: ListRetrospectiveProcessGroupsSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersub_status_id: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, -) -> RetrospectiveProcessGroupList | None: + include: Union[Unset, ListRetrospectiveProcessGroupsInclude] = UNSET, + sort: Union[Unset, ListRetrospectiveProcessGroupsSort] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersub_status_id: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, +) -> Optional[RetrospectiveProcessGroupList]: """List Retrospective Process Groups List Retrospective Process Groups Args: retrospective_process_id (str): - include (ListRetrospectiveProcessGroupsInclude | Unset): - sort (ListRetrospectiveProcessGroupsSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersub_status_id (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, ListRetrospectiveProcessGroupsInclude]): + sort (Union[Unset, ListRetrospectiveProcessGroupsSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersub_status_id (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -211,15 +207,15 @@ async def asyncio_detailed( retrospective_process_id: str, *, client: AuthenticatedClient, - include: ListRetrospectiveProcessGroupsInclude | Unset = UNSET, - sort: ListRetrospectiveProcessGroupsSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersub_status_id: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Union[Unset, ListRetrospectiveProcessGroupsInclude] = UNSET, + sort: Union[Unset, ListRetrospectiveProcessGroupsSort] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersub_status_id: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, ) -> Response[RetrospectiveProcessGroupList]: """List Retrospective Process Groups @@ -227,15 +223,15 @@ async def asyncio_detailed( Args: retrospective_process_id (str): - include (ListRetrospectiveProcessGroupsInclude | Unset): - sort (ListRetrospectiveProcessGroupsSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersub_status_id (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, ListRetrospectiveProcessGroupsInclude]): + sort (Union[Unset, ListRetrospectiveProcessGroupsSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersub_status_id (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -267,31 +263,31 @@ async def asyncio( retrospective_process_id: str, *, client: AuthenticatedClient, - include: ListRetrospectiveProcessGroupsInclude | Unset = UNSET, - sort: ListRetrospectiveProcessGroupsSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersub_status_id: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, -) -> RetrospectiveProcessGroupList | None: + include: Union[Unset, ListRetrospectiveProcessGroupsInclude] = UNSET, + sort: Union[Unset, ListRetrospectiveProcessGroupsSort] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersub_status_id: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, +) -> Optional[RetrospectiveProcessGroupList]: """List Retrospective Process Groups List Retrospective Process Groups Args: retrospective_process_id (str): - include (ListRetrospectiveProcessGroupsInclude | Unset): - sort (ListRetrospectiveProcessGroupsSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersub_status_id (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, ListRetrospectiveProcessGroupsInclude]): + sort (Union[Unset, ListRetrospectiveProcessGroupsSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersub_status_id (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/retrospective_process_groups/update_retrospective_process_group.py b/rootly_sdk/api/retrospective_process_groups/update_retrospective_process_group.py index 025b6851..9a311992 100644 --- a/rootly_sdk/api/retrospective_process_groups/update_retrospective_process_group.py +++ b/rootly_sdk/api/retrospective_process_groups/update_retrospective_process_group.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -20,9 +19,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/retrospective_process_groups/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/retrospective_process_groups/{id}", } _kwargs["json"] = body.to_dict() @@ -34,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> RetrospectiveProcessGroupResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[RetrospectiveProcessGroupResponse]: if response.status_code == 200: response_200 = RetrospectiveProcessGroupResponse.from_dict(response.json()) @@ -48,7 +45,7 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[RetrospectiveProcessGroupResponse]: return Response( status_code=HTTPStatus(response.status_code), @@ -97,7 +94,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateRetrospectiveProcessGroup, -) -> RetrospectiveProcessGroupResponse | None: +) -> Optional[RetrospectiveProcessGroupResponse]: """Update a Retrospective Process Group Update a specific Retrospective Process Group by id @@ -158,7 +155,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateRetrospectiveProcessGroup, -) -> RetrospectiveProcessGroupResponse | None: +) -> Optional[RetrospectiveProcessGroupResponse]: """Update a Retrospective Process Group Update a specific Retrospective Process Group by id diff --git a/rootly_sdk/api/retrospective_processes/create_retrospective_process.py b/rootly_sdk/api/retrospective_processes/create_retrospective_process.py index 958b54e7..d7eb7c9d 100644 --- a/rootly_sdk/api/retrospective_processes/create_retrospective_process.py +++ b/rootly_sdk/api/retrospective_processes/create_retrospective_process.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | RetrospectiveProcessResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, RetrospectiveProcessResponse]]: if response.status_code == 201: response_201 = RetrospectiveProcessResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | RetrospectiveProcessResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, RetrospectiveProcessResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +69,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewRetrospectiveProcess, -) -> Response[ErrorsList | RetrospectiveProcessResponse]: +) -> Response[Union[ErrorsList, RetrospectiveProcessResponse]]: """Creates a retrospective process Creates a new retrospective process from provided data @@ -82,7 +82,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | RetrospectiveProcessResponse] + Response[Union[ErrorsList, RetrospectiveProcessResponse]] """ kwargs = _get_kwargs( @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: NewRetrospectiveProcess, -) -> ErrorsList | RetrospectiveProcessResponse | None: +) -> Optional[Union[ErrorsList, RetrospectiveProcessResponse]]: """Creates a retrospective process Creates a new retrospective process from provided data @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | RetrospectiveProcessResponse + Union[ErrorsList, RetrospectiveProcessResponse] """ return sync_detailed( @@ -126,7 +126,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewRetrospectiveProcess, -) -> Response[ErrorsList | RetrospectiveProcessResponse]: +) -> Response[Union[ErrorsList, RetrospectiveProcessResponse]]: """Creates a retrospective process Creates a new retrospective process from provided data @@ -139,7 +139,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | RetrospectiveProcessResponse] + Response[Union[ErrorsList, RetrospectiveProcessResponse]] """ kwargs = _get_kwargs( @@ -155,7 +155,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewRetrospectiveProcess, -) -> ErrorsList | RetrospectiveProcessResponse | None: +) -> Optional[Union[ErrorsList, RetrospectiveProcessResponse]]: """Creates a retrospective process Creates a new retrospective process from provided data @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | RetrospectiveProcessResponse + Union[ErrorsList, RetrospectiveProcessResponse] """ return ( diff --git a/rootly_sdk/api/retrospective_processes/delete_retrospective_process.py b/rootly_sdk/api/retrospective_processes/delete_retrospective_process.py index cb4c54f8..012851be 100644 --- a/rootly_sdk/api/retrospective_processes/delete_retrospective_process.py +++ b/rootly_sdk/api/retrospective_processes/delete_retrospective_process.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/retrospective_processes/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/retrospective_processes/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | RetrospectiveProcessResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, RetrospectiveProcessResponse]]: if response.status_code == 200: response_200 = RetrospectiveProcessResponse.from_dict(response.json()) @@ -45,8 +41,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | RetrospectiveProcessResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, RetrospectiveProcessResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | RetrospectiveProcessResponse]: +) -> Response[Union[ErrorsList, RetrospectiveProcessResponse]]: """Delete a retrospective process Delete a specific retrospective process by id @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | RetrospectiveProcessResponse] + Response[Union[ErrorsList, RetrospectiveProcessResponse]] """ kwargs = _get_kwargs( @@ -90,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | RetrospectiveProcessResponse | None: +) -> Optional[Union[ErrorsList, RetrospectiveProcessResponse]]: """Delete a retrospective process Delete a specific retrospective process by id @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | RetrospectiveProcessResponse + Union[ErrorsList, RetrospectiveProcessResponse] """ return sync_detailed( @@ -116,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | RetrospectiveProcessResponse]: +) -> Response[Union[ErrorsList, RetrospectiveProcessResponse]]: """Delete a retrospective process Delete a specific retrospective process by id @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | RetrospectiveProcessResponse] + Response[Union[ErrorsList, RetrospectiveProcessResponse]] """ kwargs = _get_kwargs( @@ -145,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | RetrospectiveProcessResponse | None: +) -> Optional[Union[ErrorsList, RetrospectiveProcessResponse]]: """Delete a retrospective process Delete a specific retrospective process by id @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | RetrospectiveProcessResponse + Union[ErrorsList, RetrospectiveProcessResponse] """ return ( diff --git a/rootly_sdk/api/retrospective_processes/get_retrospective_process.py b/rootly_sdk/api/retrospective_processes/get_retrospective_process.py index f88cfd09..e0b2b766 100644 --- a/rootly_sdk/api/retrospective_processes/get_retrospective_process.py +++ b/rootly_sdk/api/retrospective_processes/get_retrospective_process.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -17,12 +16,11 @@ def _get_kwargs( id: str, *, - include: GetRetrospectiveProcessInclude | Unset = UNSET, + include: Union[Unset, GetRetrospectiveProcessInclude] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} - json_include: str | Unset = UNSET + json_include: Union[Unset, str] = UNSET if not isinstance(include, Unset): json_include = include @@ -32,9 +30,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/retrospective_processes/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/retrospective_processes/{id}", "params": params, } @@ -42,8 +38,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | RetrospectiveProcessResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, RetrospectiveProcessResponse]]: if response.status_code == 200: response_200 = RetrospectiveProcessResponse.from_dict(response.json()) @@ -61,8 +57,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | RetrospectiveProcessResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, RetrospectiveProcessResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -75,22 +71,22 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, - include: GetRetrospectiveProcessInclude | Unset = UNSET, -) -> Response[ErrorsList | RetrospectiveProcessResponse]: + include: Union[Unset, GetRetrospectiveProcessInclude] = UNSET, +) -> Response[Union[ErrorsList, RetrospectiveProcessResponse]]: """Retrieves a retrospective process Retrieves a specific retrospective process by id Args: id (str): - include (GetRetrospectiveProcessInclude | Unset): + include (Union[Unset, GetRetrospectiveProcessInclude]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | RetrospectiveProcessResponse] + Response[Union[ErrorsList, RetrospectiveProcessResponse]] """ kwargs = _get_kwargs( @@ -109,22 +105,22 @@ def sync( id: str, *, client: AuthenticatedClient, - include: GetRetrospectiveProcessInclude | Unset = UNSET, -) -> ErrorsList | RetrospectiveProcessResponse | None: + include: Union[Unset, GetRetrospectiveProcessInclude] = UNSET, +) -> Optional[Union[ErrorsList, RetrospectiveProcessResponse]]: """Retrieves a retrospective process Retrieves a specific retrospective process by id Args: id (str): - include (GetRetrospectiveProcessInclude | Unset): + include (Union[Unset, GetRetrospectiveProcessInclude]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | RetrospectiveProcessResponse + Union[ErrorsList, RetrospectiveProcessResponse] """ return sync_detailed( @@ -138,22 +134,22 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, - include: GetRetrospectiveProcessInclude | Unset = UNSET, -) -> Response[ErrorsList | RetrospectiveProcessResponse]: + include: Union[Unset, GetRetrospectiveProcessInclude] = UNSET, +) -> Response[Union[ErrorsList, RetrospectiveProcessResponse]]: """Retrieves a retrospective process Retrieves a specific retrospective process by id Args: id (str): - include (GetRetrospectiveProcessInclude | Unset): + include (Union[Unset, GetRetrospectiveProcessInclude]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | RetrospectiveProcessResponse] + Response[Union[ErrorsList, RetrospectiveProcessResponse]] """ kwargs = _get_kwargs( @@ -170,22 +166,22 @@ async def asyncio( id: str, *, client: AuthenticatedClient, - include: GetRetrospectiveProcessInclude | Unset = UNSET, -) -> ErrorsList | RetrospectiveProcessResponse | None: + include: Union[Unset, GetRetrospectiveProcessInclude] = UNSET, +) -> Optional[Union[ErrorsList, RetrospectiveProcessResponse]]: """Retrieves a retrospective process Retrieves a specific retrospective process by id Args: id (str): - include (GetRetrospectiveProcessInclude | Unset): + include (Union[Unset, GetRetrospectiveProcessInclude]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | RetrospectiveProcessResponse + Union[ErrorsList, RetrospectiveProcessResponse] """ return ( diff --git a/rootly_sdk/api/retrospective_processes/list_retrospective_processes.py b/rootly_sdk/api/retrospective_processes/list_retrospective_processes.py index a106a418..55c638e7 100644 --- a/rootly_sdk/api/retrospective_processes/list_retrospective_processes.py +++ b/rootly_sdk/api/retrospective_processes/list_retrospective_processes.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -14,14 +14,13 @@ def _get_kwargs( *, - include: ListRetrospectiveProcessesInclude | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Union[Unset, ListRetrospectiveProcessesInclude] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} - json_include: str | Unset = UNSET + json_include: Union[Unset, str] = UNSET if not isinstance(include, Unset): json_include = include @@ -43,8 +42,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> RetrospectiveProcessList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[RetrospectiveProcessList]: if response.status_code == 200: response_200 = RetrospectiveProcessList.from_dict(response.json()) @@ -57,7 +56,7 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[RetrospectiveProcessList]: return Response( status_code=HTTPStatus(response.status_code), @@ -70,18 +69,18 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - include: ListRetrospectiveProcessesInclude | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Union[Unset, ListRetrospectiveProcessesInclude] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, ) -> Response[RetrospectiveProcessList]: """List retrospective processes List retrospective processes Args: - include (ListRetrospectiveProcessesInclude | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, ListRetrospectiveProcessesInclude]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -107,18 +106,18 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: ListRetrospectiveProcessesInclude | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, -) -> RetrospectiveProcessList | None: + include: Union[Unset, ListRetrospectiveProcessesInclude] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, +) -> Optional[RetrospectiveProcessList]: """List retrospective processes List retrospective processes Args: - include (ListRetrospectiveProcessesInclude | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, ListRetrospectiveProcessesInclude]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -139,18 +138,18 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: ListRetrospectiveProcessesInclude | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Union[Unset, ListRetrospectiveProcessesInclude] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, ) -> Response[RetrospectiveProcessList]: """List retrospective processes List retrospective processes Args: - include (ListRetrospectiveProcessesInclude | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, ListRetrospectiveProcessesInclude]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -174,18 +173,18 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: ListRetrospectiveProcessesInclude | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, -) -> RetrospectiveProcessList | None: + include: Union[Unset, ListRetrospectiveProcessesInclude] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, +) -> Optional[RetrospectiveProcessList]: """List retrospective processes List retrospective processes Args: - include (ListRetrospectiveProcessesInclude | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, ListRetrospectiveProcessesInclude]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/retrospective_processes/update_retrospective_process.py b/rootly_sdk/api/retrospective_processes/update_retrospective_process.py index d290ed1b..01d66581 100644 --- a/rootly_sdk/api/retrospective_processes/update_retrospective_process.py +++ b/rootly_sdk/api/retrospective_processes/update_retrospective_process.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/retrospective_processes/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/retrospective_processes/{id}", } _kwargs["json"] = body.to_dict() @@ -35,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | RetrospectiveProcessResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, RetrospectiveProcessResponse]]: if response.status_code == 200: response_200 = RetrospectiveProcessResponse.from_dict(response.json()) @@ -54,8 +51,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | RetrospectiveProcessResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, RetrospectiveProcessResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateRetrospectiveProcess, -) -> Response[ErrorsList | RetrospectiveProcessResponse]: +) -> Response[Union[ErrorsList, RetrospectiveProcessResponse]]: """Update a retrospective process Updates a specific retrospective process by id @@ -83,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | RetrospectiveProcessResponse] + Response[Union[ErrorsList, RetrospectiveProcessResponse]] """ kwargs = _get_kwargs( @@ -103,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateRetrospectiveProcess, -) -> ErrorsList | RetrospectiveProcessResponse | None: +) -> Optional[Union[ErrorsList, RetrospectiveProcessResponse]]: """Update a retrospective process Updates a specific retrospective process by id @@ -117,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | RetrospectiveProcessResponse + Union[ErrorsList, RetrospectiveProcessResponse] """ return sync_detailed( @@ -132,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateRetrospectiveProcess, -) -> Response[ErrorsList | RetrospectiveProcessResponse]: +) -> Response[Union[ErrorsList, RetrospectiveProcessResponse]]: """Update a retrospective process Updates a specific retrospective process by id @@ -146,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | RetrospectiveProcessResponse] + Response[Union[ErrorsList, RetrospectiveProcessResponse]] """ kwargs = _get_kwargs( @@ -164,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateRetrospectiveProcess, -) -> ErrorsList | RetrospectiveProcessResponse | None: +) -> Optional[Union[ErrorsList, RetrospectiveProcessResponse]]: """Update a retrospective process Updates a specific retrospective process by id @@ -178,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | RetrospectiveProcessResponse + Union[ErrorsList, RetrospectiveProcessResponse] """ return ( diff --git a/rootly_sdk/api/retrospective_steps/create_retrospective_step.py b/rootly_sdk/api/retrospective_steps/create_retrospective_step.py index 92dfb6e8..ee7406f8 100644 --- a/rootly_sdk/api/retrospective_steps/create_retrospective_step.py +++ b/rootly_sdk/api/retrospective_steps/create_retrospective_step.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/retrospective_processes/{retrospective_process_id}/retrospective_steps".format( - retrospective_process_id=quote(str(retrospective_process_id), safe=""), - ), + "url": f"/v1/retrospective_processes/{retrospective_process_id}/retrospective_steps", } _kwargs["json"] = body.to_dict() @@ -35,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | RetrospectiveStepResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, RetrospectiveStepResponse]]: if response.status_code == 201: response_201 = RetrospectiveStepResponse.from_dict(response.json()) @@ -59,8 +56,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | RetrospectiveStepResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, RetrospectiveStepResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -74,7 +71,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewRetrospectiveStep, -) -> Response[ErrorsList | RetrospectiveStepResponse]: +) -> Response[Union[ErrorsList, RetrospectiveStepResponse]]: """Creates a retrospective step Creates a new retrospective step from provided data @@ -88,7 +85,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | RetrospectiveStepResponse] + Response[Union[ErrorsList, RetrospectiveStepResponse]] """ kwargs = _get_kwargs( @@ -108,7 +105,7 @@ def sync( *, client: AuthenticatedClient, body: NewRetrospectiveStep, -) -> ErrorsList | RetrospectiveStepResponse | None: +) -> Optional[Union[ErrorsList, RetrospectiveStepResponse]]: """Creates a retrospective step Creates a new retrospective step from provided data @@ -122,7 +119,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | RetrospectiveStepResponse + Union[ErrorsList, RetrospectiveStepResponse] """ return sync_detailed( @@ -137,7 +134,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewRetrospectiveStep, -) -> Response[ErrorsList | RetrospectiveStepResponse]: +) -> Response[Union[ErrorsList, RetrospectiveStepResponse]]: """Creates a retrospective step Creates a new retrospective step from provided data @@ -151,7 +148,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | RetrospectiveStepResponse] + Response[Union[ErrorsList, RetrospectiveStepResponse]] """ kwargs = _get_kwargs( @@ -169,7 +166,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewRetrospectiveStep, -) -> ErrorsList | RetrospectiveStepResponse | None: +) -> Optional[Union[ErrorsList, RetrospectiveStepResponse]]: """Creates a retrospective step Creates a new retrospective step from provided data @@ -183,7 +180,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | RetrospectiveStepResponse + Union[ErrorsList, RetrospectiveStepResponse] """ return ( diff --git a/rootly_sdk/api/retrospective_steps/delete_retrospective_step.py b/rootly_sdk/api/retrospective_steps/delete_retrospective_step.py index 51361c85..2f8e11ca 100644 --- a/rootly_sdk/api/retrospective_steps/delete_retrospective_step.py +++ b/rootly_sdk/api/retrospective_steps/delete_retrospective_step.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/retrospective_steps/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/retrospective_steps/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | RetrospectiveStepResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, RetrospectiveStepResponse]]: if response.status_code == 200: response_200 = RetrospectiveStepResponse.from_dict(response.json()) @@ -45,8 +41,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | RetrospectiveStepResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, RetrospectiveStepResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | RetrospectiveStepResponse]: +) -> Response[Union[ErrorsList, RetrospectiveStepResponse]]: """Delete a retrospective step Delete a specific retrospective step by id @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | RetrospectiveStepResponse] + Response[Union[ErrorsList, RetrospectiveStepResponse]] """ kwargs = _get_kwargs( @@ -90,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | RetrospectiveStepResponse | None: +) -> Optional[Union[ErrorsList, RetrospectiveStepResponse]]: """Delete a retrospective step Delete a specific retrospective step by id @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | RetrospectiveStepResponse + Union[ErrorsList, RetrospectiveStepResponse] """ return sync_detailed( @@ -116,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | RetrospectiveStepResponse]: +) -> Response[Union[ErrorsList, RetrospectiveStepResponse]]: """Delete a retrospective step Delete a specific retrospective step by id @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | RetrospectiveStepResponse] + Response[Union[ErrorsList, RetrospectiveStepResponse]] """ kwargs = _get_kwargs( @@ -145,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | RetrospectiveStepResponse | None: +) -> Optional[Union[ErrorsList, RetrospectiveStepResponse]]: """Delete a retrospective step Delete a specific retrospective step by id @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | RetrospectiveStepResponse + Union[ErrorsList, RetrospectiveStepResponse] """ return ( diff --git a/rootly_sdk/api/retrospective_steps/get_retrospective_step.py b/rootly_sdk/api/retrospective_steps/get_retrospective_step.py index 416a641b..65b918d7 100644 --- a/rootly_sdk/api/retrospective_steps/get_retrospective_step.py +++ b/rootly_sdk/api/retrospective_steps/get_retrospective_step.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/retrospective_steps/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/retrospective_steps/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | RetrospectiveStepResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, RetrospectiveStepResponse]]: if response.status_code == 200: response_200 = RetrospectiveStepResponse.from_dict(response.json()) @@ -45,8 +41,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | RetrospectiveStepResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, RetrospectiveStepResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | RetrospectiveStepResponse]: +) -> Response[Union[ErrorsList, RetrospectiveStepResponse]]: """Retrieves a retrospective step Retrieves a specific retrospective step by id @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | RetrospectiveStepResponse] + Response[Union[ErrorsList, RetrospectiveStepResponse]] """ kwargs = _get_kwargs( @@ -90,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | RetrospectiveStepResponse | None: +) -> Optional[Union[ErrorsList, RetrospectiveStepResponse]]: """Retrieves a retrospective step Retrieves a specific retrospective step by id @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | RetrospectiveStepResponse + Union[ErrorsList, RetrospectiveStepResponse] """ return sync_detailed( @@ -116,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | RetrospectiveStepResponse]: +) -> Response[Union[ErrorsList, RetrospectiveStepResponse]]: """Retrieves a retrospective step Retrieves a specific retrospective step by id @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | RetrospectiveStepResponse] + Response[Union[ErrorsList, RetrospectiveStepResponse]] """ kwargs = _get_kwargs( @@ -145,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | RetrospectiveStepResponse | None: +) -> Optional[Union[ErrorsList, RetrospectiveStepResponse]]: """Retrieves a retrospective step Retrieves a specific retrospective step by id @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | RetrospectiveStepResponse + Union[ErrorsList, RetrospectiveStepResponse] """ return ( diff --git a/rootly_sdk/api/retrospective_steps/list_retrospective_steps.py b/rootly_sdk/api/retrospective_steps/list_retrospective_steps.py index d611a9e0..58772c57 100644 --- a/rootly_sdk/api/retrospective_steps/list_retrospective_steps.py +++ b/rootly_sdk/api/retrospective_steps/list_retrospective_steps.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -13,12 +12,11 @@ def _get_kwargs( retrospective_process_id: str, *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - sort: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + sort: Union[Unset, str] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -33,16 +31,16 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/retrospective_processes/{retrospective_process_id}/retrospective_steps".format( - retrospective_process_id=quote(str(retrospective_process_id), safe=""), - ), + "url": f"/v1/retrospective_processes/{retrospective_process_id}/retrospective_steps", "params": params, } return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> RetrospectiveStepList | None: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[RetrospectiveStepList]: if response.status_code == 200: response_200 = RetrospectiveStepList.from_dict(response.json()) @@ -55,7 +53,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[RetrospectiveStepList]: return Response( status_code=HTTPStatus(response.status_code), @@ -69,10 +67,10 @@ def sync_detailed( retrospective_process_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - sort: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + sort: Union[Unset, str] = UNSET, ) -> Response[RetrospectiveStepList]: """List retrospective steps @@ -80,10 +78,10 @@ def sync_detailed( Args: retrospective_process_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -112,21 +110,21 @@ def sync( retrospective_process_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - sort: str | Unset = UNSET, -) -> RetrospectiveStepList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + sort: Union[Unset, str] = UNSET, +) -> Optional[RetrospectiveStepList]: """List retrospective steps List retrospective steps Args: retrospective_process_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -150,10 +148,10 @@ async def asyncio_detailed( retrospective_process_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - sort: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + sort: Union[Unset, str] = UNSET, ) -> Response[RetrospectiveStepList]: """List retrospective steps @@ -161,10 +159,10 @@ async def asyncio_detailed( Args: retrospective_process_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -191,21 +189,21 @@ async def asyncio( retrospective_process_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - sort: str | Unset = UNSET, -) -> RetrospectiveStepList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + sort: Union[Unset, str] = UNSET, +) -> Optional[RetrospectiveStepList]: """List retrospective steps List retrospective steps Args: retrospective_process_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/retrospective_steps/update_retrospective_step.py b/rootly_sdk/api/retrospective_steps/update_retrospective_step.py index 004aa760..bef07255 100644 --- a/rootly_sdk/api/retrospective_steps/update_retrospective_step.py +++ b/rootly_sdk/api/retrospective_steps/update_retrospective_step.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/retrospective_steps/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/retrospective_steps/{id}", } _kwargs["json"] = body.to_dict() @@ -35,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | RetrospectiveStepResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, RetrospectiveStepResponse]]: if response.status_code == 200: response_200 = RetrospectiveStepResponse.from_dict(response.json()) @@ -54,8 +51,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | RetrospectiveStepResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, RetrospectiveStepResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateRetrospectiveStep, -) -> Response[ErrorsList | RetrospectiveStepResponse]: +) -> Response[Union[ErrorsList, RetrospectiveStepResponse]]: """Update a retrospective step Update a specific retrospective step by id @@ -83,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | RetrospectiveStepResponse] + Response[Union[ErrorsList, RetrospectiveStepResponse]] """ kwargs = _get_kwargs( @@ -103,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateRetrospectiveStep, -) -> ErrorsList | RetrospectiveStepResponse | None: +) -> Optional[Union[ErrorsList, RetrospectiveStepResponse]]: """Update a retrospective step Update a specific retrospective step by id @@ -117,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | RetrospectiveStepResponse + Union[ErrorsList, RetrospectiveStepResponse] """ return sync_detailed( @@ -132,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateRetrospectiveStep, -) -> Response[ErrorsList | RetrospectiveStepResponse]: +) -> Response[Union[ErrorsList, RetrospectiveStepResponse]]: """Update a retrospective step Update a specific retrospective step by id @@ -146,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | RetrospectiveStepResponse] + Response[Union[ErrorsList, RetrospectiveStepResponse]] """ kwargs = _get_kwargs( @@ -164,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateRetrospectiveStep, -) -> ErrorsList | RetrospectiveStepResponse | None: +) -> Optional[Union[ErrorsList, RetrospectiveStepResponse]]: """Update a retrospective step Update a specific retrospective step by id @@ -178,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | RetrospectiveStepResponse + Union[ErrorsList, RetrospectiveStepResponse] """ return ( diff --git a/rootly_sdk/api/retrospective_templates/create_postmortem_template.py b/rootly_sdk/api/retrospective_templates/create_postmortem_template.py index a45d193d..943e4b9f 100644 --- a/rootly_sdk/api/retrospective_templates/create_postmortem_template.py +++ b/rootly_sdk/api/retrospective_templates/create_postmortem_template.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | PostMortemTemplateResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, PostMortemTemplateResponse]]: if response.status_code == 201: response_201 = PostMortemTemplateResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | PostMortemTemplateResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, PostMortemTemplateResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +69,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewPostMortemTemplate, -) -> Response[ErrorsList | PostMortemTemplateResponse]: +) -> Response[Union[ErrorsList, PostMortemTemplateResponse]]: """Creates a retrospective template Creates a new Retrospective Template from provided data @@ -82,7 +82,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | PostMortemTemplateResponse] + Response[Union[ErrorsList, PostMortemTemplateResponse]] """ kwargs = _get_kwargs( @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: NewPostMortemTemplate, -) -> ErrorsList | PostMortemTemplateResponse | None: +) -> Optional[Union[ErrorsList, PostMortemTemplateResponse]]: """Creates a retrospective template Creates a new Retrospective Template from provided data @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | PostMortemTemplateResponse + Union[ErrorsList, PostMortemTemplateResponse] """ return sync_detailed( @@ -126,7 +126,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewPostMortemTemplate, -) -> Response[ErrorsList | PostMortemTemplateResponse]: +) -> Response[Union[ErrorsList, PostMortemTemplateResponse]]: """Creates a retrospective template Creates a new Retrospective Template from provided data @@ -139,7 +139,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | PostMortemTemplateResponse] + Response[Union[ErrorsList, PostMortemTemplateResponse]] """ kwargs = _get_kwargs( @@ -155,7 +155,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewPostMortemTemplate, -) -> ErrorsList | PostMortemTemplateResponse | None: +) -> Optional[Union[ErrorsList, PostMortemTemplateResponse]]: """Creates a retrospective template Creates a new Retrospective Template from provided data @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | PostMortemTemplateResponse + Union[ErrorsList, PostMortemTemplateResponse] """ return ( diff --git a/rootly_sdk/api/retrospective_templates/delete_postmortem_template.py b/rootly_sdk/api/retrospective_templates/delete_postmortem_template.py index aafa6848..75e30f7e 100644 --- a/rootly_sdk/api/retrospective_templates/delete_postmortem_template.py +++ b/rootly_sdk/api/retrospective_templates/delete_postmortem_template.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union from uuid import UUID import httpx @@ -13,22 +12,19 @@ def _get_kwargs( - id: str | UUID, + id: Union[UUID, str], ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/post_mortem_templates/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/post_mortem_templates/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | PostMortemTemplateResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, PostMortemTemplateResponse]]: if response.status_code == 200: response_200 = PostMortemTemplateResponse.from_dict(response.json()) @@ -46,8 +42,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | PostMortemTemplateResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, PostMortemTemplateResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -57,23 +53,23 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Response[ErrorsList | PostMortemTemplateResponse]: +) -> Response[Union[ErrorsList, PostMortemTemplateResponse]]: """Delete a Retrospective Template Delete a specific Retrospective Template by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | PostMortemTemplateResponse] + Response[Union[ErrorsList, PostMortemTemplateResponse]] """ kwargs = _get_kwargs( @@ -88,23 +84,23 @@ def sync_detailed( def sync( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> ErrorsList | PostMortemTemplateResponse | None: +) -> Optional[Union[ErrorsList, PostMortemTemplateResponse]]: """Delete a Retrospective Template Delete a specific Retrospective Template by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | PostMortemTemplateResponse + Union[ErrorsList, PostMortemTemplateResponse] """ return sync_detailed( @@ -114,23 +110,23 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Response[ErrorsList | PostMortemTemplateResponse]: +) -> Response[Union[ErrorsList, PostMortemTemplateResponse]]: """Delete a Retrospective Template Delete a specific Retrospective Template by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | PostMortemTemplateResponse] + Response[Union[ErrorsList, PostMortemTemplateResponse]] """ kwargs = _get_kwargs( @@ -143,23 +139,23 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> ErrorsList | PostMortemTemplateResponse | None: +) -> Optional[Union[ErrorsList, PostMortemTemplateResponse]]: """Delete a Retrospective Template Delete a specific Retrospective Template by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | PostMortemTemplateResponse + Union[ErrorsList, PostMortemTemplateResponse] """ return ( diff --git a/rootly_sdk/api/retrospective_templates/get_postmortem_template.py b/rootly_sdk/api/retrospective_templates/get_postmortem_template.py index 20fda05d..14b3417b 100644 --- a/rootly_sdk/api/retrospective_templates/get_postmortem_template.py +++ b/rootly_sdk/api/retrospective_templates/get_postmortem_template.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union from uuid import UUID import httpx @@ -13,22 +12,19 @@ def _get_kwargs( - id: str | UUID, + id: Union[UUID, str], ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/post_mortem_templates/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/post_mortem_templates/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | PostMortemTemplateResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, PostMortemTemplateResponse]]: if response.status_code == 200: response_200 = PostMortemTemplateResponse.from_dict(response.json()) @@ -46,8 +42,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | PostMortemTemplateResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, PostMortemTemplateResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -57,23 +53,23 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Response[ErrorsList | PostMortemTemplateResponse]: +) -> Response[Union[ErrorsList, PostMortemTemplateResponse]]: """Retrieves a Retrospective Template Retrieves a specific Retrospective Template by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | PostMortemTemplateResponse] + Response[Union[ErrorsList, PostMortemTemplateResponse]] """ kwargs = _get_kwargs( @@ -88,23 +84,23 @@ def sync_detailed( def sync( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> ErrorsList | PostMortemTemplateResponse | None: +) -> Optional[Union[ErrorsList, PostMortemTemplateResponse]]: """Retrieves a Retrospective Template Retrieves a specific Retrospective Template by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | PostMortemTemplateResponse + Union[ErrorsList, PostMortemTemplateResponse] """ return sync_detailed( @@ -114,23 +110,23 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Response[ErrorsList | PostMortemTemplateResponse]: +) -> Response[Union[ErrorsList, PostMortemTemplateResponse]]: """Retrieves a Retrospective Template Retrieves a specific Retrospective Template by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | PostMortemTemplateResponse] + Response[Union[ErrorsList, PostMortemTemplateResponse]] """ kwargs = _get_kwargs( @@ -143,23 +139,23 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> ErrorsList | PostMortemTemplateResponse | None: +) -> Optional[Union[ErrorsList, PostMortemTemplateResponse]]: """Retrieves a Retrospective Template Retrieves a specific Retrospective Template by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | PostMortemTemplateResponse + Union[ErrorsList, PostMortemTemplateResponse] """ return ( diff --git a/rootly_sdk/api/retrospective_templates/list_postmortem_templates.py b/rootly_sdk/api/retrospective_templates/list_postmortem_templates.py index a85e9595..3bb0cf1c 100644 --- a/rootly_sdk/api/retrospective_templates/list_postmortem_templates.py +++ b/rootly_sdk/api/retrospective_templates/list_postmortem_templates.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -11,11 +11,10 @@ def _get_kwargs( *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -35,7 +34,9 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> PostMortemTemplateList | None: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[PostMortemTemplateList]: if response.status_code == 200: response_200 = PostMortemTemplateList.from_dict(response.json()) @@ -48,7 +49,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[PostMortemTemplateList]: return Response( status_code=HTTPStatus(response.status_code), @@ -61,18 +62,18 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, ) -> Response[PostMortemTemplateList]: """List Retrospective Templates List Retrospective Templates Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -98,18 +99,18 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, -) -> PostMortemTemplateList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, +) -> Optional[PostMortemTemplateList]: """List Retrospective Templates List Retrospective Templates Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -130,18 +131,18 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, ) -> Response[PostMortemTemplateList]: """List Retrospective Templates List Retrospective Templates Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -165,18 +166,18 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, -) -> PostMortemTemplateList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, +) -> Optional[PostMortemTemplateList]: """List Retrospective Templates List Retrospective Templates Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/retrospective_templates/update_postmortem_template.py b/rootly_sdk/api/retrospective_templates/update_postmortem_template.py index 32d1be7f..eaad68a3 100644 --- a/rootly_sdk/api/retrospective_templates/update_postmortem_template.py +++ b/rootly_sdk/api/retrospective_templates/update_postmortem_template.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union from uuid import UUID import httpx @@ -14,7 +13,7 @@ def _get_kwargs( - id: str | UUID, + id: Union[UUID, str], *, body: UpdatePostMortemTemplate, ) -> dict[str, Any]: @@ -22,9 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/post_mortem_templates/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/post_mortem_templates/{id}", } _kwargs["json"] = body.to_dict() @@ -36,8 +33,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | PostMortemTemplateResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, PostMortemTemplateResponse]]: if response.status_code == 200: response_200 = PostMortemTemplateResponse.from_dict(response.json()) @@ -55,8 +52,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | PostMortemTemplateResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, PostMortemTemplateResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,17 +63,17 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdatePostMortemTemplate, -) -> Response[ErrorsList | PostMortemTemplateResponse]: +) -> Response[Union[ErrorsList, PostMortemTemplateResponse]]: """Update a Retrospective Template Update a specific Retrospective Template by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdatePostMortemTemplate): Raises: @@ -84,7 +81,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | PostMortemTemplateResponse] + Response[Union[ErrorsList, PostMortemTemplateResponse]] """ kwargs = _get_kwargs( @@ -100,17 +97,17 @@ def sync_detailed( def sync( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdatePostMortemTemplate, -) -> ErrorsList | PostMortemTemplateResponse | None: +) -> Optional[Union[ErrorsList, PostMortemTemplateResponse]]: """Update a Retrospective Template Update a specific Retrospective Template by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdatePostMortemTemplate): Raises: @@ -118,7 +115,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | PostMortemTemplateResponse + Union[ErrorsList, PostMortemTemplateResponse] """ return sync_detailed( @@ -129,17 +126,17 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdatePostMortemTemplate, -) -> Response[ErrorsList | PostMortemTemplateResponse]: +) -> Response[Union[ErrorsList, PostMortemTemplateResponse]]: """Update a Retrospective Template Update a specific Retrospective Template by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdatePostMortemTemplate): Raises: @@ -147,7 +144,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | PostMortemTemplateResponse] + Response[Union[ErrorsList, PostMortemTemplateResponse]] """ kwargs = _get_kwargs( @@ -161,17 +158,17 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdatePostMortemTemplate, -) -> ErrorsList | PostMortemTemplateResponse | None: +) -> Optional[Union[ErrorsList, PostMortemTemplateResponse]]: """Update a Retrospective Template Update a specific Retrospective Template by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdatePostMortemTemplate): Raises: @@ -179,7 +176,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | PostMortemTemplateResponse + Union[ErrorsList, PostMortemTemplateResponse] """ return ( diff --git a/rootly_sdk/api/roles/create_role.py b/rootly_sdk/api/roles/create_role.py index 14a23064..0a33ff76 100644 --- a/rootly_sdk/api/roles/create_role.py +++ b/rootly_sdk/api/roles/create_role.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | RoleResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, RoleResponse]]: if response.status_code == 201: response_201 = RoleResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | RoleResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, RoleResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +69,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewRole, -) -> Response[ErrorsList | RoleResponse]: +) -> Response[Union[ErrorsList, RoleResponse]]: """Creates a role Creates a new role from provided data @@ -82,7 +82,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | RoleResponse] + Response[Union[ErrorsList, RoleResponse]] """ kwargs = _get_kwargs( @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: NewRole, -) -> ErrorsList | RoleResponse | None: +) -> Optional[Union[ErrorsList, RoleResponse]]: """Creates a role Creates a new role from provided data @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | RoleResponse + Union[ErrorsList, RoleResponse] """ return sync_detailed( @@ -126,7 +126,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewRole, -) -> Response[ErrorsList | RoleResponse]: +) -> Response[Union[ErrorsList, RoleResponse]]: """Creates a role Creates a new role from provided data @@ -139,7 +139,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | RoleResponse] + Response[Union[ErrorsList, RoleResponse]] """ kwargs = _get_kwargs( @@ -155,7 +155,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewRole, -) -> ErrorsList | RoleResponse | None: +) -> Optional[Union[ErrorsList, RoleResponse]]: """Creates a role Creates a new role from provided data @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | RoleResponse + Union[ErrorsList, RoleResponse] """ return ( diff --git a/rootly_sdk/api/roles/delete_role.py b/rootly_sdk/api/roles/delete_role.py index 72c04400..428bebfb 100644 --- a/rootly_sdk/api/roles/delete_role.py +++ b/rootly_sdk/api/roles/delete_role.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union from uuid import UUID import httpx @@ -13,22 +12,19 @@ def _get_kwargs( - id: str | UUID, + id: Union[UUID, str], ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/roles/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/roles/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | RoleResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, RoleResponse]]: if response.status_code == 200: response_200 = RoleResponse.from_dict(response.json()) @@ -46,8 +42,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | RoleResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, RoleResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -57,23 +53,23 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Response[ErrorsList | RoleResponse]: +) -> Response[Union[ErrorsList, RoleResponse]]: """Delete a role Delete a specific role by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | RoleResponse] + Response[Union[ErrorsList, RoleResponse]] """ kwargs = _get_kwargs( @@ -88,23 +84,23 @@ def sync_detailed( def sync( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> ErrorsList | RoleResponse | None: +) -> Optional[Union[ErrorsList, RoleResponse]]: """Delete a role Delete a specific role by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | RoleResponse + Union[ErrorsList, RoleResponse] """ return sync_detailed( @@ -114,23 +110,23 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Response[ErrorsList | RoleResponse]: +) -> Response[Union[ErrorsList, RoleResponse]]: """Delete a role Delete a specific role by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | RoleResponse] + Response[Union[ErrorsList, RoleResponse]] """ kwargs = _get_kwargs( @@ -143,23 +139,23 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> ErrorsList | RoleResponse | None: +) -> Optional[Union[ErrorsList, RoleResponse]]: """Delete a role Delete a specific role by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | RoleResponse + Union[ErrorsList, RoleResponse] """ return ( diff --git a/rootly_sdk/api/roles/get_role.py b/rootly_sdk/api/roles/get_role.py index ec32d7ee..4f8dc7c2 100644 --- a/rootly_sdk/api/roles/get_role.py +++ b/rootly_sdk/api/roles/get_role.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union from uuid import UUID import httpx @@ -13,22 +12,19 @@ def _get_kwargs( - id: str | UUID, + id: Union[UUID, str], ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/roles/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/roles/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | RoleResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, RoleResponse]]: if response.status_code == 200: response_200 = RoleResponse.from_dict(response.json()) @@ -46,8 +42,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | RoleResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, RoleResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -57,23 +53,23 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Response[ErrorsList | RoleResponse]: +) -> Response[Union[ErrorsList, RoleResponse]]: """Retrieves a role Retrieves a specific role by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | RoleResponse] + Response[Union[ErrorsList, RoleResponse]] """ kwargs = _get_kwargs( @@ -88,23 +84,23 @@ def sync_detailed( def sync( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> ErrorsList | RoleResponse | None: +) -> Optional[Union[ErrorsList, RoleResponse]]: """Retrieves a role Retrieves a specific role by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | RoleResponse + Union[ErrorsList, RoleResponse] """ return sync_detailed( @@ -114,23 +110,23 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Response[ErrorsList | RoleResponse]: +) -> Response[Union[ErrorsList, RoleResponse]]: """Retrieves a role Retrieves a specific role by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | RoleResponse] + Response[Union[ErrorsList, RoleResponse]] """ kwargs = _get_kwargs( @@ -143,23 +139,23 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> ErrorsList | RoleResponse | None: +) -> Optional[Union[ErrorsList, RoleResponse]]: """Retrieves a role Retrieves a specific role by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | RoleResponse + Union[ErrorsList, RoleResponse] """ return ( diff --git a/rootly_sdk/api/roles/list_roles.py b/rootly_sdk/api/roles/list_roles.py index fd378970..e0bb35dd 100644 --- a/rootly_sdk/api/roles/list_roles.py +++ b/rootly_sdk/api/roles/list_roles.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -11,19 +11,18 @@ def _get_kwargs( *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -59,7 +58,7 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> RoleList | None: +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[RoleList]: if response.status_code == 200: response_200 = RoleList.from_dict(response.json()) @@ -71,7 +70,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[RoleList]: +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[RoleList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -83,34 +82,34 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, ) -> Response[RoleList]: """List roles List roles Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -144,34 +143,34 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, -) -> RoleList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, +) -> Optional[RoleList]: """List roles List roles Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -200,34 +199,34 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, ) -> Response[RoleList]: """List roles List roles Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -259,34 +258,34 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: str | Unset = UNSET, -) -> RoleList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, +) -> Optional[RoleList]: """List roles List roles Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/roles/update_role.py b/rootly_sdk/api/roles/update_role.py index a0e1e4cd..8db0ac1e 100644 --- a/rootly_sdk/api/roles/update_role.py +++ b/rootly_sdk/api/roles/update_role.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union from uuid import UUID import httpx @@ -14,7 +13,7 @@ def _get_kwargs( - id: str | UUID, + id: Union[UUID, str], *, body: UpdateRole, ) -> dict[str, Any]: @@ -22,9 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/roles/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/roles/{id}", } _kwargs["json"] = body.to_dict() @@ -36,8 +33,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | RoleResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, RoleResponse]]: if response.status_code == 200: response_200 = RoleResponse.from_dict(response.json()) @@ -55,8 +52,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | RoleResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, RoleResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,17 +63,17 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdateRole, -) -> Response[ErrorsList | RoleResponse]: +) -> Response[Union[ErrorsList, RoleResponse]]: """Update a role Update a specific role by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateRole): Raises: @@ -84,7 +81,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | RoleResponse] + Response[Union[ErrorsList, RoleResponse]] """ kwargs = _get_kwargs( @@ -100,17 +97,17 @@ def sync_detailed( def sync( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdateRole, -) -> ErrorsList | RoleResponse | None: +) -> Optional[Union[ErrorsList, RoleResponse]]: """Update a role Update a specific role by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateRole): Raises: @@ -118,7 +115,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | RoleResponse + Union[ErrorsList, RoleResponse] """ return sync_detailed( @@ -129,17 +126,17 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdateRole, -) -> Response[ErrorsList | RoleResponse]: +) -> Response[Union[ErrorsList, RoleResponse]]: """Update a role Update a specific role by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateRole): Raises: @@ -147,7 +144,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | RoleResponse] + Response[Union[ErrorsList, RoleResponse]] """ kwargs = _get_kwargs( @@ -161,17 +158,17 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdateRole, -) -> ErrorsList | RoleResponse | None: +) -> Optional[Union[ErrorsList, RoleResponse]]: """Update a role Update a specific role by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateRole): Raises: @@ -179,7 +176,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | RoleResponse + Union[ErrorsList, RoleResponse] """ return ( diff --git a/rootly_sdk/api/schedule_rotation_active_days/create_schedule_rotation_active_day.py b/rootly_sdk/api/schedule_rotation_active_days/create_schedule_rotation_active_day.py index 8bb86f5f..ff0e1cbe 100644 --- a/rootly_sdk/api/schedule_rotation_active_days/create_schedule_rotation_active_day.py +++ b/rootly_sdk/api/schedule_rotation_active_days/create_schedule_rotation_active_day.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/schedule_rotations/{schedule_rotation_id}/schedule_rotation_active_days".format( - schedule_rotation_id=quote(str(schedule_rotation_id), safe=""), - ), + "url": f"/v1/schedule_rotations/{schedule_rotation_id}/schedule_rotation_active_days", } _kwargs["json"] = body.to_dict() @@ -35,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | ScheduleRotationActiveDayResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, ScheduleRotationActiveDayResponse]]: if response.status_code == 201: response_201 = ScheduleRotationActiveDayResponse.from_dict(response.json()) @@ -59,8 +56,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | ScheduleRotationActiveDayResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, ScheduleRotationActiveDayResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -74,7 +71,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewScheduleRotationActiveDay, -) -> Response[ErrorsList | ScheduleRotationActiveDayResponse]: +) -> Response[Union[ErrorsList, ScheduleRotationActiveDayResponse]]: """Creates a schedule rotation active day Creates a new schedule rotation active day from provided data @@ -88,7 +85,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | ScheduleRotationActiveDayResponse] + Response[Union[ErrorsList, ScheduleRotationActiveDayResponse]] """ kwargs = _get_kwargs( @@ -108,7 +105,7 @@ def sync( *, client: AuthenticatedClient, body: NewScheduleRotationActiveDay, -) -> ErrorsList | ScheduleRotationActiveDayResponse | None: +) -> Optional[Union[ErrorsList, ScheduleRotationActiveDayResponse]]: """Creates a schedule rotation active day Creates a new schedule rotation active day from provided data @@ -122,7 +119,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | ScheduleRotationActiveDayResponse + Union[ErrorsList, ScheduleRotationActiveDayResponse] """ return sync_detailed( @@ -137,7 +134,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewScheduleRotationActiveDay, -) -> Response[ErrorsList | ScheduleRotationActiveDayResponse]: +) -> Response[Union[ErrorsList, ScheduleRotationActiveDayResponse]]: """Creates a schedule rotation active day Creates a new schedule rotation active day from provided data @@ -151,7 +148,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | ScheduleRotationActiveDayResponse] + Response[Union[ErrorsList, ScheduleRotationActiveDayResponse]] """ kwargs = _get_kwargs( @@ -169,7 +166,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewScheduleRotationActiveDay, -) -> ErrorsList | ScheduleRotationActiveDayResponse | None: +) -> Optional[Union[ErrorsList, ScheduleRotationActiveDayResponse]]: """Creates a schedule rotation active day Creates a new schedule rotation active day from provided data @@ -183,7 +180,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | ScheduleRotationActiveDayResponse + Union[ErrorsList, ScheduleRotationActiveDayResponse] """ return ( diff --git a/rootly_sdk/api/schedule_rotation_active_days/delete_schedule_rotation_active_day.py b/rootly_sdk/api/schedule_rotation_active_days/delete_schedule_rotation_active_day.py index a98550d8..badcfaaf 100644 --- a/rootly_sdk/api/schedule_rotation_active_days/delete_schedule_rotation_active_day.py +++ b/rootly_sdk/api/schedule_rotation_active_days/delete_schedule_rotation_active_day.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/schedule_rotation_active_days/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/schedule_rotation_active_days/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | ScheduleRotationActiveDayResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, ScheduleRotationActiveDayResponse]]: if response.status_code == 200: response_200 = ScheduleRotationActiveDayResponse.from_dict(response.json()) @@ -45,8 +41,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | ScheduleRotationActiveDayResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, ScheduleRotationActiveDayResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | ScheduleRotationActiveDayResponse]: +) -> Response[Union[ErrorsList, ScheduleRotationActiveDayResponse]]: """Delete a schedule rotation active day Delete a specific schedule rotation active day @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | ScheduleRotationActiveDayResponse] + Response[Union[ErrorsList, ScheduleRotationActiveDayResponse]] """ kwargs = _get_kwargs( @@ -90,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | ScheduleRotationActiveDayResponse | None: +) -> Optional[Union[ErrorsList, ScheduleRotationActiveDayResponse]]: """Delete a schedule rotation active day Delete a specific schedule rotation active day @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | ScheduleRotationActiveDayResponse + Union[ErrorsList, ScheduleRotationActiveDayResponse] """ return sync_detailed( @@ -116,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | ScheduleRotationActiveDayResponse]: +) -> Response[Union[ErrorsList, ScheduleRotationActiveDayResponse]]: """Delete a schedule rotation active day Delete a specific schedule rotation active day @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | ScheduleRotationActiveDayResponse] + Response[Union[ErrorsList, ScheduleRotationActiveDayResponse]] """ kwargs = _get_kwargs( @@ -145,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | ScheduleRotationActiveDayResponse | None: +) -> Optional[Union[ErrorsList, ScheduleRotationActiveDayResponse]]: """Delete a schedule rotation active day Delete a specific schedule rotation active day @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | ScheduleRotationActiveDayResponse + Union[ErrorsList, ScheduleRotationActiveDayResponse] """ return ( diff --git a/rootly_sdk/api/schedule_rotation_active_days/get_schedule_rotation_active_day.py b/rootly_sdk/api/schedule_rotation_active_days/get_schedule_rotation_active_day.py index fa2947c6..c1806ee7 100644 --- a/rootly_sdk/api/schedule_rotation_active_days/get_schedule_rotation_active_day.py +++ b/rootly_sdk/api/schedule_rotation_active_days/get_schedule_rotation_active_day.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/schedule_rotation_active_days/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/schedule_rotation_active_days/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | ScheduleRotationActiveDayResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, ScheduleRotationActiveDayResponse]]: if response.status_code == 200: response_200 = ScheduleRotationActiveDayResponse.from_dict(response.json()) @@ -45,8 +41,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | ScheduleRotationActiveDayResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, ScheduleRotationActiveDayResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | ScheduleRotationActiveDayResponse]: +) -> Response[Union[ErrorsList, ScheduleRotationActiveDayResponse]]: """Retrieves a schedule rotation active day Retrieves a specific schedule rotation active day by id @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | ScheduleRotationActiveDayResponse] + Response[Union[ErrorsList, ScheduleRotationActiveDayResponse]] """ kwargs = _get_kwargs( @@ -90,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | ScheduleRotationActiveDayResponse | None: +) -> Optional[Union[ErrorsList, ScheduleRotationActiveDayResponse]]: """Retrieves a schedule rotation active day Retrieves a specific schedule rotation active day by id @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | ScheduleRotationActiveDayResponse + Union[ErrorsList, ScheduleRotationActiveDayResponse] """ return sync_detailed( @@ -116,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | ScheduleRotationActiveDayResponse]: +) -> Response[Union[ErrorsList, ScheduleRotationActiveDayResponse]]: """Retrieves a schedule rotation active day Retrieves a specific schedule rotation active day by id @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | ScheduleRotationActiveDayResponse] + Response[Union[ErrorsList, ScheduleRotationActiveDayResponse]] """ kwargs = _get_kwargs( @@ -145,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | ScheduleRotationActiveDayResponse | None: +) -> Optional[Union[ErrorsList, ScheduleRotationActiveDayResponse]]: """Retrieves a schedule rotation active day Retrieves a specific schedule rotation active day by id @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | ScheduleRotationActiveDayResponse + Union[ErrorsList, ScheduleRotationActiveDayResponse] """ return ( diff --git a/rootly_sdk/api/schedule_rotation_active_days/list_schedule_rotation_active_days.py b/rootly_sdk/api/schedule_rotation_active_days/list_schedule_rotation_active_days.py index 17ccecb6..2881f106 100644 --- a/rootly_sdk/api/schedule_rotation_active_days/list_schedule_rotation_active_days.py +++ b/rootly_sdk/api/schedule_rotation_active_days/list_schedule_rotation_active_days.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -13,11 +12,10 @@ def _get_kwargs( schedule_rotation_id: str, *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -30,9 +28,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/schedule_rotations/{schedule_rotation_id}/schedule_rotation_active_days".format( - schedule_rotation_id=quote(str(schedule_rotation_id), safe=""), - ), + "url": f"/v1/schedule_rotations/{schedule_rotation_id}/schedule_rotation_active_days", "params": params, } @@ -40,8 +36,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ScheduleRotationActiveDayList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[ScheduleRotationActiveDayList]: if response.status_code == 200: response_200 = ScheduleRotationActiveDayList.from_dict(response.json()) @@ -54,7 +50,7 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[ScheduleRotationActiveDayList]: return Response( status_code=HTTPStatus(response.status_code), @@ -68,9 +64,9 @@ def sync_detailed( schedule_rotation_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, ) -> Response[ScheduleRotationActiveDayList]: """List schedule rotation active days @@ -78,9 +74,9 @@ def sync_detailed( Args: schedule_rotation_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -108,19 +104,19 @@ def sync( schedule_rotation_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, -) -> ScheduleRotationActiveDayList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, +) -> Optional[ScheduleRotationActiveDayList]: """List schedule rotation active days List schedule rotation active days Args: schedule_rotation_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -143,9 +139,9 @@ async def asyncio_detailed( schedule_rotation_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, ) -> Response[ScheduleRotationActiveDayList]: """List schedule rotation active days @@ -153,9 +149,9 @@ async def asyncio_detailed( Args: schedule_rotation_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -181,19 +177,19 @@ async def asyncio( schedule_rotation_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, -) -> ScheduleRotationActiveDayList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, +) -> Optional[ScheduleRotationActiveDayList]: """List schedule rotation active days List schedule rotation active days Args: schedule_rotation_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/schedule_rotation_active_days/update_schedule_rotation_active_day.py b/rootly_sdk/api/schedule_rotation_active_days/update_schedule_rotation_active_day.py index b6446600..8679b6bd 100644 --- a/rootly_sdk/api/schedule_rotation_active_days/update_schedule_rotation_active_day.py +++ b/rootly_sdk/api/schedule_rotation_active_days/update_schedule_rotation_active_day.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/schedule_rotation_active_days/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/schedule_rotation_active_days/{id}", } _kwargs["json"] = body.to_dict() @@ -35,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | ScheduleRotationActiveDayResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, ScheduleRotationActiveDayResponse]]: if response.status_code == 200: response_200 = ScheduleRotationActiveDayResponse.from_dict(response.json()) @@ -54,8 +51,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | ScheduleRotationActiveDayResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, ScheduleRotationActiveDayResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateScheduleRotationActiveDay, -) -> Response[ErrorsList | ScheduleRotationActiveDayResponse]: +) -> Response[Union[ErrorsList, ScheduleRotationActiveDayResponse]]: """Update a schedule rotation active day Update a specific schedule rotation active day by id @@ -83,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | ScheduleRotationActiveDayResponse] + Response[Union[ErrorsList, ScheduleRotationActiveDayResponse]] """ kwargs = _get_kwargs( @@ -103,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateScheduleRotationActiveDay, -) -> ErrorsList | ScheduleRotationActiveDayResponse | None: +) -> Optional[Union[ErrorsList, ScheduleRotationActiveDayResponse]]: """Update a schedule rotation active day Update a specific schedule rotation active day by id @@ -117,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | ScheduleRotationActiveDayResponse + Union[ErrorsList, ScheduleRotationActiveDayResponse] """ return sync_detailed( @@ -132,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateScheduleRotationActiveDay, -) -> Response[ErrorsList | ScheduleRotationActiveDayResponse]: +) -> Response[Union[ErrorsList, ScheduleRotationActiveDayResponse]]: """Update a schedule rotation active day Update a specific schedule rotation active day by id @@ -146,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | ScheduleRotationActiveDayResponse] + Response[Union[ErrorsList, ScheduleRotationActiveDayResponse]] """ kwargs = _get_kwargs( @@ -164,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateScheduleRotationActiveDay, -) -> ErrorsList | ScheduleRotationActiveDayResponse | None: +) -> Optional[Union[ErrorsList, ScheduleRotationActiveDayResponse]]: """Update a schedule rotation active day Update a specific schedule rotation active day by id @@ -178,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | ScheduleRotationActiveDayResponse + Union[ErrorsList, ScheduleRotationActiveDayResponse] """ return ( diff --git a/rootly_sdk/api/schedule_rotation_users/create_schedule_rotation_user.py b/rootly_sdk/api/schedule_rotation_users/create_schedule_rotation_user.py index 87733a8a..f1a7bd87 100644 --- a/rootly_sdk/api/schedule_rotation_users/create_schedule_rotation_user.py +++ b/rootly_sdk/api/schedule_rotation_users/create_schedule_rotation_user.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/schedule_rotations/{schedule_rotation_id}/schedule_rotation_users".format( - schedule_rotation_id=quote(str(schedule_rotation_id), safe=""), - ), + "url": f"/v1/schedule_rotations/{schedule_rotation_id}/schedule_rotation_users", } _kwargs["json"] = body.to_dict() @@ -35,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | ScheduleRotationUserResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, ScheduleRotationUserResponse]]: if response.status_code == 201: response_201 = ScheduleRotationUserResponse.from_dict(response.json()) @@ -59,8 +56,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | ScheduleRotationUserResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, ScheduleRotationUserResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -74,7 +71,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewScheduleRotationUser, -) -> Response[ErrorsList | ScheduleRotationUserResponse]: +) -> Response[Union[ErrorsList, ScheduleRotationUserResponse]]: """Creates a schedule rotation user Creates a new schedule rotation user from provided data @@ -88,7 +85,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | ScheduleRotationUserResponse] + Response[Union[ErrorsList, ScheduleRotationUserResponse]] """ kwargs = _get_kwargs( @@ -108,7 +105,7 @@ def sync( *, client: AuthenticatedClient, body: NewScheduleRotationUser, -) -> ErrorsList | ScheduleRotationUserResponse | None: +) -> Optional[Union[ErrorsList, ScheduleRotationUserResponse]]: """Creates a schedule rotation user Creates a new schedule rotation user from provided data @@ -122,7 +119,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | ScheduleRotationUserResponse + Union[ErrorsList, ScheduleRotationUserResponse] """ return sync_detailed( @@ -137,7 +134,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewScheduleRotationUser, -) -> Response[ErrorsList | ScheduleRotationUserResponse]: +) -> Response[Union[ErrorsList, ScheduleRotationUserResponse]]: """Creates a schedule rotation user Creates a new schedule rotation user from provided data @@ -151,7 +148,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | ScheduleRotationUserResponse] + Response[Union[ErrorsList, ScheduleRotationUserResponse]] """ kwargs = _get_kwargs( @@ -169,7 +166,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewScheduleRotationUser, -) -> ErrorsList | ScheduleRotationUserResponse | None: +) -> Optional[Union[ErrorsList, ScheduleRotationUserResponse]]: """Creates a schedule rotation user Creates a new schedule rotation user from provided data @@ -183,7 +180,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | ScheduleRotationUserResponse + Union[ErrorsList, ScheduleRotationUserResponse] """ return ( diff --git a/rootly_sdk/api/schedule_rotation_users/delete_schedule_rotation_user.py b/rootly_sdk/api/schedule_rotation_users/delete_schedule_rotation_user.py index 77221b81..b5eb4cc8 100644 --- a/rootly_sdk/api/schedule_rotation_users/delete_schedule_rotation_user.py +++ b/rootly_sdk/api/schedule_rotation_users/delete_schedule_rotation_user.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/schedule_rotation_users/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/schedule_rotation_users/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | ScheduleRotationUserResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, ScheduleRotationUserResponse]]: if response.status_code == 200: response_200 = ScheduleRotationUserResponse.from_dict(response.json()) @@ -45,8 +41,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | ScheduleRotationUserResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, ScheduleRotationUserResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | ScheduleRotationUserResponse]: +) -> Response[Union[ErrorsList, ScheduleRotationUserResponse]]: """Delete a schedule rotation user Delete a specific schedule rotation user by id @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | ScheduleRotationUserResponse] + Response[Union[ErrorsList, ScheduleRotationUserResponse]] """ kwargs = _get_kwargs( @@ -90,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | ScheduleRotationUserResponse | None: +) -> Optional[Union[ErrorsList, ScheduleRotationUserResponse]]: """Delete a schedule rotation user Delete a specific schedule rotation user by id @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | ScheduleRotationUserResponse + Union[ErrorsList, ScheduleRotationUserResponse] """ return sync_detailed( @@ -116,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | ScheduleRotationUserResponse]: +) -> Response[Union[ErrorsList, ScheduleRotationUserResponse]]: """Delete a schedule rotation user Delete a specific schedule rotation user by id @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | ScheduleRotationUserResponse] + Response[Union[ErrorsList, ScheduleRotationUserResponse]] """ kwargs = _get_kwargs( @@ -145,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | ScheduleRotationUserResponse | None: +) -> Optional[Union[ErrorsList, ScheduleRotationUserResponse]]: """Delete a schedule rotation user Delete a specific schedule rotation user by id @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | ScheduleRotationUserResponse + Union[ErrorsList, ScheduleRotationUserResponse] """ return ( diff --git a/rootly_sdk/api/schedule_rotation_users/get_schedule_rotation_user.py b/rootly_sdk/api/schedule_rotation_users/get_schedule_rotation_user.py index bf1a538b..1ab416c0 100644 --- a/rootly_sdk/api/schedule_rotation_users/get_schedule_rotation_user.py +++ b/rootly_sdk/api/schedule_rotation_users/get_schedule_rotation_user.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/schedule_rotation_users/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/schedule_rotation_users/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | ScheduleRotationUserResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, ScheduleRotationUserResponse]]: if response.status_code == 200: response_200 = ScheduleRotationUserResponse.from_dict(response.json()) @@ -45,8 +41,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | ScheduleRotationUserResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, ScheduleRotationUserResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | ScheduleRotationUserResponse]: +) -> Response[Union[ErrorsList, ScheduleRotationUserResponse]]: """Retrieves a schedule rotation user Retrieves a specific schedule rotation user by id @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | ScheduleRotationUserResponse] + Response[Union[ErrorsList, ScheduleRotationUserResponse]] """ kwargs = _get_kwargs( @@ -90,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | ScheduleRotationUserResponse | None: +) -> Optional[Union[ErrorsList, ScheduleRotationUserResponse]]: """Retrieves a schedule rotation user Retrieves a specific schedule rotation user by id @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | ScheduleRotationUserResponse + Union[ErrorsList, ScheduleRotationUserResponse] """ return sync_detailed( @@ -116,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | ScheduleRotationUserResponse]: +) -> Response[Union[ErrorsList, ScheduleRotationUserResponse]]: """Retrieves a schedule rotation user Retrieves a specific schedule rotation user by id @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | ScheduleRotationUserResponse] + Response[Union[ErrorsList, ScheduleRotationUserResponse]] """ kwargs = _get_kwargs( @@ -145,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | ScheduleRotationUserResponse | None: +) -> Optional[Union[ErrorsList, ScheduleRotationUserResponse]]: """Retrieves a schedule rotation user Retrieves a specific schedule rotation user by id @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | ScheduleRotationUserResponse + Union[ErrorsList, ScheduleRotationUserResponse] """ return ( diff --git a/rootly_sdk/api/schedule_rotation_users/list_schedule_rotation_users.py b/rootly_sdk/api/schedule_rotation_users/list_schedule_rotation_users.py index a217745f..4b02a448 100644 --- a/rootly_sdk/api/schedule_rotation_users/list_schedule_rotation_users.py +++ b/rootly_sdk/api/schedule_rotation_users/list_schedule_rotation_users.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -13,11 +12,10 @@ def _get_kwargs( schedule_rotation_id: str, *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -30,9 +28,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/schedule_rotations/{schedule_rotation_id}/schedule_rotation_users".format( - schedule_rotation_id=quote(str(schedule_rotation_id), safe=""), - ), + "url": f"/v1/schedule_rotations/{schedule_rotation_id}/schedule_rotation_users", "params": params, } @@ -40,8 +36,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ScheduleRotationUserList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[ScheduleRotationUserList]: if response.status_code == 200: response_200 = ScheduleRotationUserList.from_dict(response.json()) @@ -54,7 +50,7 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[ScheduleRotationUserList]: return Response( status_code=HTTPStatus(response.status_code), @@ -68,17 +64,17 @@ def sync_detailed( schedule_rotation_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, ) -> Response[ScheduleRotationUserList]: """List schedule rotation users Args: schedule_rotation_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -106,17 +102,17 @@ def sync( schedule_rotation_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, -) -> ScheduleRotationUserList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, +) -> Optional[ScheduleRotationUserList]: """List schedule rotation users Args: schedule_rotation_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -139,17 +135,17 @@ async def asyncio_detailed( schedule_rotation_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, ) -> Response[ScheduleRotationUserList]: """List schedule rotation users Args: schedule_rotation_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -175,17 +171,17 @@ async def asyncio( schedule_rotation_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, -) -> ScheduleRotationUserList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, +) -> Optional[ScheduleRotationUserList]: """List schedule rotation users Args: schedule_rotation_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/schedule_rotation_users/update_schedule_rotation_user.py b/rootly_sdk/api/schedule_rotation_users/update_schedule_rotation_user.py index c8dbb34b..93609cb0 100644 --- a/rootly_sdk/api/schedule_rotation_users/update_schedule_rotation_user.py +++ b/rootly_sdk/api/schedule_rotation_users/update_schedule_rotation_user.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/schedule_rotation_users/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/schedule_rotation_users/{id}", } _kwargs["json"] = body.to_dict() @@ -35,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | ScheduleRotationUserResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, ScheduleRotationUserResponse]]: if response.status_code == 200: response_200 = ScheduleRotationUserResponse.from_dict(response.json()) @@ -54,8 +51,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | ScheduleRotationUserResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, ScheduleRotationUserResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateScheduleRotationUser, -) -> Response[ErrorsList | ScheduleRotationUserResponse]: +) -> Response[Union[ErrorsList, ScheduleRotationUserResponse]]: """Update schedule rotation user Update a specific schedule rotation user by id @@ -83,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | ScheduleRotationUserResponse] + Response[Union[ErrorsList, ScheduleRotationUserResponse]] """ kwargs = _get_kwargs( @@ -103,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateScheduleRotationUser, -) -> ErrorsList | ScheduleRotationUserResponse | None: +) -> Optional[Union[ErrorsList, ScheduleRotationUserResponse]]: """Update schedule rotation user Update a specific schedule rotation user by id @@ -117,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | ScheduleRotationUserResponse + Union[ErrorsList, ScheduleRotationUserResponse] """ return sync_detailed( @@ -132,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateScheduleRotationUser, -) -> Response[ErrorsList | ScheduleRotationUserResponse]: +) -> Response[Union[ErrorsList, ScheduleRotationUserResponse]]: """Update schedule rotation user Update a specific schedule rotation user by id @@ -146,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | ScheduleRotationUserResponse] + Response[Union[ErrorsList, ScheduleRotationUserResponse]] """ kwargs = _get_kwargs( @@ -164,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateScheduleRotationUser, -) -> ErrorsList | ScheduleRotationUserResponse | None: +) -> Optional[Union[ErrorsList, ScheduleRotationUserResponse]]: """Update schedule rotation user Update a specific schedule rotation user by id @@ -178,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | ScheduleRotationUserResponse + Union[ErrorsList, ScheduleRotationUserResponse] """ return ( diff --git a/rootly_sdk/api/schedule_rotations/create_schedule_rotation.py b/rootly_sdk/api/schedule_rotations/create_schedule_rotation.py index 61069e24..3d3e5a0c 100644 --- a/rootly_sdk/api/schedule_rotations/create_schedule_rotation.py +++ b/rootly_sdk/api/schedule_rotations/create_schedule_rotation.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/schedules/{schedule_id}/schedule_rotations".format( - schedule_id=quote(str(schedule_id), safe=""), - ), + "url": f"/v1/schedules/{schedule_id}/schedule_rotations", } _kwargs["json"] = body.to_dict() @@ -35,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | ScheduleRotationResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, ScheduleRotationResponse]]: if response.status_code == 201: response_201 = ScheduleRotationResponse.from_dict(response.json()) @@ -59,8 +56,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | ScheduleRotationResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, ScheduleRotationResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -74,7 +71,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewScheduleRotation, -) -> Response[ErrorsList | ScheduleRotationResponse]: +) -> Response[Union[ErrorsList, ScheduleRotationResponse]]: """Creates a schedule rotation Creates a new schedule rotation from provided data @@ -88,7 +85,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | ScheduleRotationResponse] + Response[Union[ErrorsList, ScheduleRotationResponse]] """ kwargs = _get_kwargs( @@ -108,7 +105,7 @@ def sync( *, client: AuthenticatedClient, body: NewScheduleRotation, -) -> ErrorsList | ScheduleRotationResponse | None: +) -> Optional[Union[ErrorsList, ScheduleRotationResponse]]: """Creates a schedule rotation Creates a new schedule rotation from provided data @@ -122,7 +119,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | ScheduleRotationResponse + Union[ErrorsList, ScheduleRotationResponse] """ return sync_detailed( @@ -137,7 +134,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewScheduleRotation, -) -> Response[ErrorsList | ScheduleRotationResponse]: +) -> Response[Union[ErrorsList, ScheduleRotationResponse]]: """Creates a schedule rotation Creates a new schedule rotation from provided data @@ -151,7 +148,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | ScheduleRotationResponse] + Response[Union[ErrorsList, ScheduleRotationResponse]] """ kwargs = _get_kwargs( @@ -169,7 +166,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewScheduleRotation, -) -> ErrorsList | ScheduleRotationResponse | None: +) -> Optional[Union[ErrorsList, ScheduleRotationResponse]]: """Creates a schedule rotation Creates a new schedule rotation from provided data @@ -183,7 +180,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | ScheduleRotationResponse + Union[ErrorsList, ScheduleRotationResponse] """ return ( diff --git a/rootly_sdk/api/schedule_rotations/delete_schedule_rotation.py b/rootly_sdk/api/schedule_rotations/delete_schedule_rotation.py index 441f2ff1..d38a8889 100644 --- a/rootly_sdk/api/schedule_rotations/delete_schedule_rotation.py +++ b/rootly_sdk/api/schedule_rotations/delete_schedule_rotation.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/schedule_rotations/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/schedule_rotations/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | ScheduleRotationResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, ScheduleRotationResponse]]: if response.status_code == 200: response_200 = ScheduleRotationResponse.from_dict(response.json()) @@ -45,8 +41,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | ScheduleRotationResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, ScheduleRotationResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | ScheduleRotationResponse]: +) -> Response[Union[ErrorsList, ScheduleRotationResponse]]: """Delete a schedule rotation Delete a specific schedule rotation by id @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | ScheduleRotationResponse] + Response[Union[ErrorsList, ScheduleRotationResponse]] """ kwargs = _get_kwargs( @@ -90,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | ScheduleRotationResponse | None: +) -> Optional[Union[ErrorsList, ScheduleRotationResponse]]: """Delete a schedule rotation Delete a specific schedule rotation by id @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | ScheduleRotationResponse + Union[ErrorsList, ScheduleRotationResponse] """ return sync_detailed( @@ -116,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | ScheduleRotationResponse]: +) -> Response[Union[ErrorsList, ScheduleRotationResponse]]: """Delete a schedule rotation Delete a specific schedule rotation by id @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | ScheduleRotationResponse] + Response[Union[ErrorsList, ScheduleRotationResponse]] """ kwargs = _get_kwargs( @@ -145,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | ScheduleRotationResponse | None: +) -> Optional[Union[ErrorsList, ScheduleRotationResponse]]: """Delete a schedule rotation Delete a specific schedule rotation by id @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | ScheduleRotationResponse + Union[ErrorsList, ScheduleRotationResponse] """ return ( diff --git a/rootly_sdk/api/schedule_rotations/get_schedule_rotation.py b/rootly_sdk/api/schedule_rotations/get_schedule_rotation.py index 09f83172..3990016f 100644 --- a/rootly_sdk/api/schedule_rotations/get_schedule_rotation.py +++ b/rootly_sdk/api/schedule_rotations/get_schedule_rotation.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/schedule_rotations/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/schedule_rotations/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | ScheduleRotationResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, ScheduleRotationResponse]]: if response.status_code == 200: response_200 = ScheduleRotationResponse.from_dict(response.json()) @@ -45,8 +41,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | ScheduleRotationResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, ScheduleRotationResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | ScheduleRotationResponse]: +) -> Response[Union[ErrorsList, ScheduleRotationResponse]]: """Retrieves a schedule rotation Retrieves a specific schedule rotation by id @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | ScheduleRotationResponse] + Response[Union[ErrorsList, ScheduleRotationResponse]] """ kwargs = _get_kwargs( @@ -90,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | ScheduleRotationResponse | None: +) -> Optional[Union[ErrorsList, ScheduleRotationResponse]]: """Retrieves a schedule rotation Retrieves a specific schedule rotation by id @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | ScheduleRotationResponse + Union[ErrorsList, ScheduleRotationResponse] """ return sync_detailed( @@ -116,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | ScheduleRotationResponse]: +) -> Response[Union[ErrorsList, ScheduleRotationResponse]]: """Retrieves a schedule rotation Retrieves a specific schedule rotation by id @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | ScheduleRotationResponse] + Response[Union[ErrorsList, ScheduleRotationResponse]] """ kwargs = _get_kwargs( @@ -145,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | ScheduleRotationResponse | None: +) -> Optional[Union[ErrorsList, ScheduleRotationResponse]]: """Retrieves a schedule rotation Retrieves a specific schedule rotation by id @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | ScheduleRotationResponse + Union[ErrorsList, ScheduleRotationResponse] """ return ( diff --git a/rootly_sdk/api/schedule_rotations/list_schedule_rotations.py b/rootly_sdk/api/schedule_rotations/list_schedule_rotations.py index 80ad5986..e81b15cb 100644 --- a/rootly_sdk/api/schedule_rotations/list_schedule_rotations.py +++ b/rootly_sdk/api/schedule_rotations/list_schedule_rotations.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -13,12 +12,11 @@ def _get_kwargs( schedule_id: str, *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - sort: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + sort: Union[Unset, str] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -33,16 +31,16 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/schedules/{schedule_id}/schedule_rotations".format( - schedule_id=quote(str(schedule_id), safe=""), - ), + "url": f"/v1/schedules/{schedule_id}/schedule_rotations", "params": params, } return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> ScheduleRotationList | None: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[ScheduleRotationList]: if response.status_code == 200: response_200 = ScheduleRotationList.from_dict(response.json()) @@ -55,7 +53,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[ScheduleRotationList]: return Response( status_code=HTTPStatus(response.status_code), @@ -69,10 +67,10 @@ def sync_detailed( schedule_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - sort: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + sort: Union[Unset, str] = UNSET, ) -> Response[ScheduleRotationList]: """List schedule rotations @@ -80,10 +78,10 @@ def sync_detailed( Args: schedule_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -112,21 +110,21 @@ def sync( schedule_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - sort: str | Unset = UNSET, -) -> ScheduleRotationList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + sort: Union[Unset, str] = UNSET, +) -> Optional[ScheduleRotationList]: """List schedule rotations List schedule rotations Args: schedule_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -150,10 +148,10 @@ async def asyncio_detailed( schedule_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - sort: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + sort: Union[Unset, str] = UNSET, ) -> Response[ScheduleRotationList]: """List schedule rotations @@ -161,10 +159,10 @@ async def asyncio_detailed( Args: schedule_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -191,21 +189,21 @@ async def asyncio( schedule_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - sort: str | Unset = UNSET, -) -> ScheduleRotationList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + sort: Union[Unset, str] = UNSET, +) -> Optional[ScheduleRotationList]: """List schedule rotations List schedule rotations Args: schedule_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/schedule_rotations/update_schedule_rotation.py b/rootly_sdk/api/schedule_rotations/update_schedule_rotation.py index 2016f193..994916bb 100644 --- a/rootly_sdk/api/schedule_rotations/update_schedule_rotation.py +++ b/rootly_sdk/api/schedule_rotations/update_schedule_rotation.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/schedule_rotations/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/schedule_rotations/{id}", } _kwargs["json"] = body.to_dict() @@ -35,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | ScheduleRotationResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, ScheduleRotationResponse]]: if response.status_code == 200: response_200 = ScheduleRotationResponse.from_dict(response.json()) @@ -54,8 +51,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | ScheduleRotationResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, ScheduleRotationResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateScheduleRotation, -) -> Response[ErrorsList | ScheduleRotationResponse]: +) -> Response[Union[ErrorsList, ScheduleRotationResponse]]: """Update a schedule rotation Update a specific schedule rotation by id @@ -83,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | ScheduleRotationResponse] + Response[Union[ErrorsList, ScheduleRotationResponse]] """ kwargs = _get_kwargs( @@ -103,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateScheduleRotation, -) -> ErrorsList | ScheduleRotationResponse | None: +) -> Optional[Union[ErrorsList, ScheduleRotationResponse]]: """Update a schedule rotation Update a specific schedule rotation by id @@ -117,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | ScheduleRotationResponse + Union[ErrorsList, ScheduleRotationResponse] """ return sync_detailed( @@ -132,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateScheduleRotation, -) -> Response[ErrorsList | ScheduleRotationResponse]: +) -> Response[Union[ErrorsList, ScheduleRotationResponse]]: """Update a schedule rotation Update a specific schedule rotation by id @@ -146,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | ScheduleRotationResponse] + Response[Union[ErrorsList, ScheduleRotationResponse]] """ kwargs = _get_kwargs( @@ -164,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateScheduleRotation, -) -> ErrorsList | ScheduleRotationResponse | None: +) -> Optional[Union[ErrorsList, ScheduleRotationResponse]]: """Update a schedule rotation Update a specific schedule rotation by id @@ -178,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | ScheduleRotationResponse + Union[ErrorsList, ScheduleRotationResponse] """ return ( diff --git a/rootly_sdk/api/schedules/create_schedule.py b/rootly_sdk/api/schedules/create_schedule.py index fe6cb78c..ea80b639 100644 --- a/rootly_sdk/api/schedules/create_schedule.py +++ b/rootly_sdk/api/schedules/create_schedule.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | ScheduleResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, ScheduleResponse]]: if response.status_code == 201: response_201 = ScheduleResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | ScheduleResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, ScheduleResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +69,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewSchedule, -) -> Response[ErrorsList | ScheduleResponse]: +) -> Response[Union[ErrorsList, ScheduleResponse]]: """Creates a schedule Creates a new schedule from provided data @@ -82,7 +82,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | ScheduleResponse] + Response[Union[ErrorsList, ScheduleResponse]] """ kwargs = _get_kwargs( @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: NewSchedule, -) -> ErrorsList | ScheduleResponse | None: +) -> Optional[Union[ErrorsList, ScheduleResponse]]: """Creates a schedule Creates a new schedule from provided data @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | ScheduleResponse + Union[ErrorsList, ScheduleResponse] """ return sync_detailed( @@ -126,7 +126,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewSchedule, -) -> Response[ErrorsList | ScheduleResponse]: +) -> Response[Union[ErrorsList, ScheduleResponse]]: """Creates a schedule Creates a new schedule from provided data @@ -139,7 +139,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | ScheduleResponse] + Response[Union[ErrorsList, ScheduleResponse]] """ kwargs = _get_kwargs( @@ -155,7 +155,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewSchedule, -) -> ErrorsList | ScheduleResponse | None: +) -> Optional[Union[ErrorsList, ScheduleResponse]]: """Creates a schedule Creates a new schedule from provided data @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | ScheduleResponse + Union[ErrorsList, ScheduleResponse] """ return ( diff --git a/rootly_sdk/api/schedules/delete_schedule.py b/rootly_sdk/api/schedules/delete_schedule.py index 1d4d73ba..830d8dc6 100644 --- a/rootly_sdk/api/schedules/delete_schedule.py +++ b/rootly_sdk/api/schedules/delete_schedule.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/schedules/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/schedules/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | ScheduleResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, ScheduleResponse]]: if response.status_code == 200: response_200 = ScheduleResponse.from_dict(response.json()) @@ -45,8 +41,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | ScheduleResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, ScheduleResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | ScheduleResponse]: +) -> Response[Union[ErrorsList, ScheduleResponse]]: """Delete a schedule Delete a specific schedule by id @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | ScheduleResponse] + Response[Union[ErrorsList, ScheduleResponse]] """ kwargs = _get_kwargs( @@ -90,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | ScheduleResponse | None: +) -> Optional[Union[ErrorsList, ScheduleResponse]]: """Delete a schedule Delete a specific schedule by id @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | ScheduleResponse + Union[ErrorsList, ScheduleResponse] """ return sync_detailed( @@ -116,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | ScheduleResponse]: +) -> Response[Union[ErrorsList, ScheduleResponse]]: """Delete a schedule Delete a specific schedule by id @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | ScheduleResponse] + Response[Union[ErrorsList, ScheduleResponse]] """ kwargs = _get_kwargs( @@ -145,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | ScheduleResponse | None: +) -> Optional[Union[ErrorsList, ScheduleResponse]]: """Delete a schedule Delete a specific schedule by id @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | ScheduleResponse + Union[ErrorsList, ScheduleResponse] """ return ( diff --git a/rootly_sdk/api/schedules/get_schedule.py b/rootly_sdk/api/schedules/get_schedule.py index 254e51f6..9d4c10c5 100644 --- a/rootly_sdk/api/schedules/get_schedule.py +++ b/rootly_sdk/api/schedules/get_schedule.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/schedules/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/schedules/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | ScheduleResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, ScheduleResponse]]: if response.status_code == 200: response_200 = ScheduleResponse.from_dict(response.json()) @@ -45,8 +41,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | ScheduleResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, ScheduleResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | ScheduleResponse]: +) -> Response[Union[ErrorsList, ScheduleResponse]]: """Retrieves a schedule Retrieves a specific schedule by id @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | ScheduleResponse] + Response[Union[ErrorsList, ScheduleResponse]] """ kwargs = _get_kwargs( @@ -90,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | ScheduleResponse | None: +) -> Optional[Union[ErrorsList, ScheduleResponse]]: """Retrieves a schedule Retrieves a specific schedule by id @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | ScheduleResponse + Union[ErrorsList, ScheduleResponse] """ return sync_detailed( @@ -116,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | ScheduleResponse]: +) -> Response[Union[ErrorsList, ScheduleResponse]]: """Retrieves a schedule Retrieves a specific schedule by id @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | ScheduleResponse] + Response[Union[ErrorsList, ScheduleResponse]] """ kwargs = _get_kwargs( @@ -145,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | ScheduleResponse | None: +) -> Optional[Union[ErrorsList, ScheduleResponse]]: """Retrieves a schedule Retrieves a specific schedule by id @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | ScheduleResponse + Union[ErrorsList, ScheduleResponse] """ return ( diff --git a/rootly_sdk/api/schedules/list_schedules.py b/rootly_sdk/api/schedules/list_schedules.py index a10d4e91..671ca77e 100644 --- a/rootly_sdk/api/schedules/list_schedules.py +++ b/rootly_sdk/api/schedules/list_schedules.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -11,21 +11,25 @@ def _get_kwargs( *, - include: str | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Union[Unset, str] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterteam_ids: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, + filterteam_idseq: Union[Unset, str] = UNSET, + filterteam_idsnot_eq: Union[Unset, str] = UNSET, + filterteam_idsin: Union[Unset, str] = UNSET, + filterteam_idsnot_in: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -34,6 +38,8 @@ def _get_kwargs( params["filter[name]"] = filtername + params["filter[team_ids]"] = filterteam_ids + params["filter[created_at][gt]"] = filtercreated_atgt params["filter[created_at][gte]"] = filtercreated_atgte @@ -50,6 +56,14 @@ def _get_kwargs( params["filter[name][not_in]"] = filternamenot_in + params["filter[team_ids][eq]"] = filterteam_idseq + + params["filter[team_ids][not_eq]"] = filterteam_idsnot_eq + + params["filter[team_ids][in]"] = filterteam_idsin + + params["filter[team_ids][not_in]"] = filterteam_idsnot_in + params["page[number]"] = pagenumber params["page[size]"] = pagesize @@ -65,7 +79,7 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> ScheduleList | None: +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[ScheduleList]: if response.status_code == 200: response_200 = ScheduleList.from_dict(response.json()) @@ -77,7 +91,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[ScheduleList]: +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[ScheduleList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -89,38 +103,48 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Union[Unset, str] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterteam_ids: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, + filterteam_idseq: Union[Unset, str] = UNSET, + filterteam_idsnot_eq: Union[Unset, str] = UNSET, + filterteam_idsin: Union[Unset, str] = UNSET, + filterteam_idsnot_in: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, ) -> Response[ScheduleList]: """List schedules List schedules Args: - include (str | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterteam_ids (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filterteam_idseq (Union[Unset, str]): + filterteam_idsnot_eq (Union[Unset, str]): + filterteam_idsin (Union[Unset, str]): + filterteam_idsnot_in (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -134,6 +158,7 @@ def sync_detailed( include=include, filtersearch=filtersearch, filtername=filtername, + filterteam_ids=filterteam_ids, filtercreated_atgt=filtercreated_atgt, filtercreated_atgte=filtercreated_atgte, filtercreated_atlt=filtercreated_atlt, @@ -142,6 +167,10 @@ def sync_detailed( filternamenot_eq=filternamenot_eq, filternamein=filternamein, filternamenot_in=filternamenot_in, + filterteam_idseq=filterteam_idseq, + filterteam_idsnot_eq=filterteam_idsnot_eq, + filterteam_idsin=filterteam_idsin, + filterteam_idsnot_in=filterteam_idsnot_in, pagenumber=pagenumber, pagesize=pagesize, ) @@ -156,38 +185,48 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, -) -> ScheduleList | None: + include: Union[Unset, str] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterteam_ids: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, + filterteam_idseq: Union[Unset, str] = UNSET, + filterteam_idsnot_eq: Union[Unset, str] = UNSET, + filterteam_idsin: Union[Unset, str] = UNSET, + filterteam_idsnot_in: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, +) -> Optional[ScheduleList]: """List schedules List schedules Args: - include (str | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterteam_ids (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filterteam_idseq (Union[Unset, str]): + filterteam_idsnot_eq (Union[Unset, str]): + filterteam_idsin (Union[Unset, str]): + filterteam_idsnot_in (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -202,6 +241,7 @@ def sync( include=include, filtersearch=filtersearch, filtername=filtername, + filterteam_ids=filterteam_ids, filtercreated_atgt=filtercreated_atgt, filtercreated_atgte=filtercreated_atgte, filtercreated_atlt=filtercreated_atlt, @@ -210,6 +250,10 @@ def sync( filternamenot_eq=filternamenot_eq, filternamein=filternamein, filternamenot_in=filternamenot_in, + filterteam_idseq=filterteam_idseq, + filterteam_idsnot_eq=filterteam_idsnot_eq, + filterteam_idsin=filterteam_idsin, + filterteam_idsnot_in=filterteam_idsnot_in, pagenumber=pagenumber, pagesize=pagesize, ).parsed @@ -218,38 +262,48 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Union[Unset, str] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterteam_ids: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, + filterteam_idseq: Union[Unset, str] = UNSET, + filterteam_idsnot_eq: Union[Unset, str] = UNSET, + filterteam_idsin: Union[Unset, str] = UNSET, + filterteam_idsnot_in: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, ) -> Response[ScheduleList]: """List schedules List schedules Args: - include (str | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterteam_ids (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filterteam_idseq (Union[Unset, str]): + filterteam_idsnot_eq (Union[Unset, str]): + filterteam_idsin (Union[Unset, str]): + filterteam_idsnot_in (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -263,6 +317,7 @@ async def asyncio_detailed( include=include, filtersearch=filtersearch, filtername=filtername, + filterteam_ids=filterteam_ids, filtercreated_atgt=filtercreated_atgt, filtercreated_atgte=filtercreated_atgte, filtercreated_atlt=filtercreated_atlt, @@ -271,6 +326,10 @@ async def asyncio_detailed( filternamenot_eq=filternamenot_eq, filternamein=filternamein, filternamenot_in=filternamenot_in, + filterteam_idseq=filterteam_idseq, + filterteam_idsnot_eq=filterteam_idsnot_eq, + filterteam_idsin=filterteam_idsin, + filterteam_idsnot_in=filterteam_idsnot_in, pagenumber=pagenumber, pagesize=pagesize, ) @@ -283,38 +342,48 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, -) -> ScheduleList | None: + include: Union[Unset, str] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterteam_ids: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, + filterteam_idseq: Union[Unset, str] = UNSET, + filterteam_idsnot_eq: Union[Unset, str] = UNSET, + filterteam_idsin: Union[Unset, str] = UNSET, + filterteam_idsnot_in: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, +) -> Optional[ScheduleList]: """List schedules List schedules Args: - include (str | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterteam_ids (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filterteam_idseq (Union[Unset, str]): + filterteam_idsnot_eq (Union[Unset, str]): + filterteam_idsin (Union[Unset, str]): + filterteam_idsnot_in (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -330,6 +399,7 @@ async def asyncio( include=include, filtersearch=filtersearch, filtername=filtername, + filterteam_ids=filterteam_ids, filtercreated_atgt=filtercreated_atgt, filtercreated_atgte=filtercreated_atgte, filtercreated_atlt=filtercreated_atlt, @@ -338,6 +408,10 @@ async def asyncio( filternamenot_eq=filternamenot_eq, filternamein=filternamein, filternamenot_in=filternamenot_in, + filterteam_idseq=filterteam_idseq, + filterteam_idsnot_eq=filterteam_idsnot_eq, + filterteam_idsin=filterteam_idsin, + filterteam_idsnot_in=filterteam_idsnot_in, pagenumber=pagenumber, pagesize=pagesize, ) diff --git a/rootly_sdk/api/schedules/update_schedule.py b/rootly_sdk/api/schedules/update_schedule.py index cc14d173..9b38f097 100644 --- a/rootly_sdk/api/schedules/update_schedule.py +++ b/rootly_sdk/api/schedules/update_schedule.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/schedules/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/schedules/{id}", } _kwargs["json"] = body.to_dict() @@ -35,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | ScheduleResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, ScheduleResponse]]: if response.status_code == 200: response_200 = ScheduleResponse.from_dict(response.json()) @@ -54,8 +51,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | ScheduleResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, ScheduleResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateSchedule, -) -> Response[ErrorsList | ScheduleResponse]: +) -> Response[Union[ErrorsList, ScheduleResponse]]: """Update a schedule Updates a specific schedule by id @@ -83,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | ScheduleResponse] + Response[Union[ErrorsList, ScheduleResponse]] """ kwargs = _get_kwargs( @@ -103,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateSchedule, -) -> ErrorsList | ScheduleResponse | None: +) -> Optional[Union[ErrorsList, ScheduleResponse]]: """Update a schedule Updates a specific schedule by id @@ -117,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | ScheduleResponse + Union[ErrorsList, ScheduleResponse] """ return sync_detailed( @@ -132,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateSchedule, -) -> Response[ErrorsList | ScheduleResponse]: +) -> Response[Union[ErrorsList, ScheduleResponse]]: """Update a schedule Updates a specific schedule by id @@ -146,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | ScheduleResponse] + Response[Union[ErrorsList, ScheduleResponse]] """ kwargs = _get_kwargs( @@ -164,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateSchedule, -) -> ErrorsList | ScheduleResponse | None: +) -> Optional[Union[ErrorsList, ScheduleResponse]]: """Update a schedule Updates a specific schedule by id @@ -178,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | ScheduleResponse + Union[ErrorsList, ScheduleResponse] """ return ( diff --git a/rootly_sdk/api/secrets/create_secret.py b/rootly_sdk/api/secrets/create_secret.py index 927e7547..7c9f7b88 100644 --- a/rootly_sdk/api/secrets/create_secret.py +++ b/rootly_sdk/api/secrets/create_secret.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | SecretResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, SecretResponse]]: if response.status_code == 201: response_201 = SecretResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | SecretResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, SecretResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +69,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewSecret, -) -> Response[ErrorsList | SecretResponse]: +) -> Response[Union[ErrorsList, SecretResponse]]: """Creates a secret Creates a new secret from provided data @@ -82,7 +82,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | SecretResponse] + Response[Union[ErrorsList, SecretResponse]] """ kwargs = _get_kwargs( @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: NewSecret, -) -> ErrorsList | SecretResponse | None: +) -> Optional[Union[ErrorsList, SecretResponse]]: """Creates a secret Creates a new secret from provided data @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | SecretResponse + Union[ErrorsList, SecretResponse] """ return sync_detailed( @@ -126,7 +126,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewSecret, -) -> Response[ErrorsList | SecretResponse]: +) -> Response[Union[ErrorsList, SecretResponse]]: """Creates a secret Creates a new secret from provided data @@ -139,7 +139,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | SecretResponse] + Response[Union[ErrorsList, SecretResponse]] """ kwargs = _get_kwargs( @@ -155,7 +155,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewSecret, -) -> ErrorsList | SecretResponse | None: +) -> Optional[Union[ErrorsList, SecretResponse]]: """Creates a secret Creates a new secret from provided data @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | SecretResponse + Union[ErrorsList, SecretResponse] """ return ( diff --git a/rootly_sdk/api/secrets/delete_secret.py b/rootly_sdk/api/secrets/delete_secret.py index cab7f849..59636160 100644 --- a/rootly_sdk/api/secrets/delete_secret.py +++ b/rootly_sdk/api/secrets/delete_secret.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/secrets/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/secrets/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | SecretResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, SecretResponse]]: if response.status_code == 200: response_200 = SecretResponse.from_dict(response.json()) @@ -45,8 +41,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | SecretResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, SecretResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | SecretResponse]: +) -> Response[Union[ErrorsList, SecretResponse]]: """Delete a secret Delete a specific secret by id @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | SecretResponse] + Response[Union[ErrorsList, SecretResponse]] """ kwargs = _get_kwargs( @@ -90,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | SecretResponse | None: +) -> Optional[Union[ErrorsList, SecretResponse]]: """Delete a secret Delete a specific secret by id @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | SecretResponse + Union[ErrorsList, SecretResponse] """ return sync_detailed( @@ -116,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | SecretResponse]: +) -> Response[Union[ErrorsList, SecretResponse]]: """Delete a secret Delete a specific secret by id @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | SecretResponse] + Response[Union[ErrorsList, SecretResponse]] """ kwargs = _get_kwargs( @@ -145,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | SecretResponse | None: +) -> Optional[Union[ErrorsList, SecretResponse]]: """Delete a secret Delete a specific secret by id @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | SecretResponse + Union[ErrorsList, SecretResponse] """ return ( diff --git a/rootly_sdk/api/secrets/get_secret.py b/rootly_sdk/api/secrets/get_secret.py index 0a85cd44..a3fc9b87 100644 --- a/rootly_sdk/api/secrets/get_secret.py +++ b/rootly_sdk/api/secrets/get_secret.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/secrets/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/secrets/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | SecretResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, SecretResponse]]: if response.status_code == 200: response_200 = SecretResponse.from_dict(response.json()) @@ -45,8 +41,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | SecretResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, SecretResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | SecretResponse]: +) -> Response[Union[ErrorsList, SecretResponse]]: """Retrieves a secret Retrieve a specific secret by id @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | SecretResponse] + Response[Union[ErrorsList, SecretResponse]] """ kwargs = _get_kwargs( @@ -90,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | SecretResponse | None: +) -> Optional[Union[ErrorsList, SecretResponse]]: """Retrieves a secret Retrieve a specific secret by id @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | SecretResponse + Union[ErrorsList, SecretResponse] """ return sync_detailed( @@ -116,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | SecretResponse]: +) -> Response[Union[ErrorsList, SecretResponse]]: """Retrieves a secret Retrieve a specific secret by id @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | SecretResponse] + Response[Union[ErrorsList, SecretResponse]] """ kwargs = _get_kwargs( @@ -145,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | SecretResponse | None: +) -> Optional[Union[ErrorsList, SecretResponse]]: """Retrieves a secret Retrieve a specific secret by id @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | SecretResponse + Union[ErrorsList, SecretResponse] """ return ( diff --git a/rootly_sdk/api/secrets/list_secrets.py b/rootly_sdk/api/secrets/list_secrets.py index 5763e6c0..42d88361 100644 --- a/rootly_sdk/api/secrets/list_secrets.py +++ b/rootly_sdk/api/secrets/list_secrets.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -11,11 +11,10 @@ def _get_kwargs( *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -35,7 +34,7 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> SecretList | None: +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[SecretList]: if response.status_code == 200: response_200 = SecretList.from_dict(response.json()) @@ -47,7 +46,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[SecretList]: +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[SecretList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,18 +58,18 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, ) -> Response[SecretList]: """List secrets List secrets Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -96,18 +95,18 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, -) -> SecretList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, +) -> Optional[SecretList]: """List secrets List secrets Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -128,18 +127,18 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, ) -> Response[SecretList]: """List secrets List secrets Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -163,18 +162,18 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, -) -> SecretList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, +) -> Optional[SecretList]: """List secrets List secrets Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/secrets/update_secret.py b/rootly_sdk/api/secrets/update_secret.py index 41fe293e..fac42927 100644 --- a/rootly_sdk/api/secrets/update_secret.py +++ b/rootly_sdk/api/secrets/update_secret.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/secrets/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/secrets/{id}", } _kwargs["json"] = body.to_dict() @@ -35,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | SecretResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, SecretResponse]]: if response.status_code == 200: response_200 = SecretResponse.from_dict(response.json()) @@ -54,8 +51,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | SecretResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, SecretResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateSecret, -) -> Response[ErrorsList | SecretResponse]: +) -> Response[Union[ErrorsList, SecretResponse]]: """Update a secret Update a specific secret by id @@ -83,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | SecretResponse] + Response[Union[ErrorsList, SecretResponse]] """ kwargs = _get_kwargs( @@ -103,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateSecret, -) -> ErrorsList | SecretResponse | None: +) -> Optional[Union[ErrorsList, SecretResponse]]: """Update a secret Update a specific secret by id @@ -117,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | SecretResponse + Union[ErrorsList, SecretResponse] """ return sync_detailed( @@ -132,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateSecret, -) -> Response[ErrorsList | SecretResponse]: +) -> Response[Union[ErrorsList, SecretResponse]]: """Update a secret Update a specific secret by id @@ -146,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | SecretResponse] + Response[Union[ErrorsList, SecretResponse]] """ kwargs = _get_kwargs( @@ -164,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateSecret, -) -> ErrorsList | SecretResponse | None: +) -> Optional[Union[ErrorsList, SecretResponse]]: """Update a secret Update a specific secret by id @@ -178,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | SecretResponse + Union[ErrorsList, SecretResponse] """ return ( diff --git a/rootly_sdk/api/services/bulk_delete_services.py b/rootly_sdk/api/services/bulk_delete_services.py index cb45739c..68b67c7f 100644 --- a/rootly_sdk/api/services/bulk_delete_services.py +++ b/rootly_sdk/api/services/bulk_delete_services.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -14,7 +14,7 @@ def _get_kwargs( *, - body: BulkDestroyServicesType0 | BulkDestroyServicesType1, + body: Union["BulkDestroyServicesType0", "BulkDestroyServicesType1"], ) -> dict[str, Any]: headers: dict[str, Any] = {} @@ -23,6 +23,7 @@ def _get_kwargs( "url": "/v1/services/bulk_delete", } + _kwargs["json"]: dict[str, Any] if isinstance(body, BulkDestroyServicesType0): _kwargs["json"] = body.to_dict() else: @@ -35,8 +36,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> BulkDestroyServicesResponse | BulkDestroyServicesResponse | ErrorsList | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[BulkDestroyServicesResponse, ErrorsList, Union["BulkDestroyServicesResponse", "ErrorsList"]]]: if response.status_code == 200: response_200 = BulkDestroyServicesResponse.from_dict(response.json()) @@ -49,14 +50,14 @@ def _parse_response( if response.status_code == 422: - def _parse_response_422(data: object) -> BulkDestroyServicesResponse | ErrorsList: + def _parse_response_422(data: object) -> Union["BulkDestroyServicesResponse", "ErrorsList"]: try: if not isinstance(data, dict): raise TypeError() response_422_type_0 = ErrorsList.from_dict(data) return response_422_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass if not isinstance(data, dict): raise TypeError() @@ -75,8 +76,8 @@ def _parse_response_422(data: object) -> BulkDestroyServicesResponse | ErrorsLis def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[BulkDestroyServicesResponse | BulkDestroyServicesResponse | ErrorsList | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[BulkDestroyServicesResponse, ErrorsList, Union["BulkDestroyServicesResponse", "ErrorsList"]]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -88,23 +89,23 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - body: BulkDestroyServicesType0 | BulkDestroyServicesType1, -) -> Response[BulkDestroyServicesResponse | BulkDestroyServicesResponse | ErrorsList | ErrorsList]: + body: Union["BulkDestroyServicesType0", "BulkDestroyServicesType1"], +) -> Response[Union[BulkDestroyServicesResponse, ErrorsList, Union["BulkDestroyServicesResponse", "ErrorsList"]]]: """Bulk delete Services Delete services by external_id list, or prune by managed_by source. Two mutually exclusive modes. Args: - body (BulkDestroyServicesType0 | BulkDestroyServicesType1): Two mutually exclusive modes. - Pass exactly one of: external_ids (delete specific records) or managed_by (prune all - managed records not in keep set). + body (Union['BulkDestroyServicesType0', 'BulkDestroyServicesType1']): Two mutually + exclusive modes. Pass exactly one of: external_ids (delete specific records) or managed_by + (prune all managed records not in keep set). Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[BulkDestroyServicesResponse | BulkDestroyServicesResponse | ErrorsList | ErrorsList] + Response[Union[BulkDestroyServicesResponse, ErrorsList, Union['BulkDestroyServicesResponse', 'ErrorsList']]] """ kwargs = _get_kwargs( @@ -121,23 +122,23 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - body: BulkDestroyServicesType0 | BulkDestroyServicesType1, -) -> BulkDestroyServicesResponse | BulkDestroyServicesResponse | ErrorsList | ErrorsList | None: + body: Union["BulkDestroyServicesType0", "BulkDestroyServicesType1"], +) -> Optional[Union[BulkDestroyServicesResponse, ErrorsList, Union["BulkDestroyServicesResponse", "ErrorsList"]]]: """Bulk delete Services Delete services by external_id list, or prune by managed_by source. Two mutually exclusive modes. Args: - body (BulkDestroyServicesType0 | BulkDestroyServicesType1): Two mutually exclusive modes. - Pass exactly one of: external_ids (delete specific records) or managed_by (prune all - managed records not in keep set). + body (Union['BulkDestroyServicesType0', 'BulkDestroyServicesType1']): Two mutually + exclusive modes. Pass exactly one of: external_ids (delete specific records) or managed_by + (prune all managed records not in keep set). Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - BulkDestroyServicesResponse | BulkDestroyServicesResponse | ErrorsList | ErrorsList + Union[BulkDestroyServicesResponse, ErrorsList, Union['BulkDestroyServicesResponse', 'ErrorsList']] """ return sync_detailed( @@ -149,23 +150,23 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - body: BulkDestroyServicesType0 | BulkDestroyServicesType1, -) -> Response[BulkDestroyServicesResponse | BulkDestroyServicesResponse | ErrorsList | ErrorsList]: + body: Union["BulkDestroyServicesType0", "BulkDestroyServicesType1"], +) -> Response[Union[BulkDestroyServicesResponse, ErrorsList, Union["BulkDestroyServicesResponse", "ErrorsList"]]]: """Bulk delete Services Delete services by external_id list, or prune by managed_by source. Two mutually exclusive modes. Args: - body (BulkDestroyServicesType0 | BulkDestroyServicesType1): Two mutually exclusive modes. - Pass exactly one of: external_ids (delete specific records) or managed_by (prune all - managed records not in keep set). + body (Union['BulkDestroyServicesType0', 'BulkDestroyServicesType1']): Two mutually + exclusive modes. Pass exactly one of: external_ids (delete specific records) or managed_by + (prune all managed records not in keep set). Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[BulkDestroyServicesResponse | BulkDestroyServicesResponse | ErrorsList | ErrorsList] + Response[Union[BulkDestroyServicesResponse, ErrorsList, Union['BulkDestroyServicesResponse', 'ErrorsList']]] """ kwargs = _get_kwargs( @@ -180,23 +181,23 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - body: BulkDestroyServicesType0 | BulkDestroyServicesType1, -) -> BulkDestroyServicesResponse | BulkDestroyServicesResponse | ErrorsList | ErrorsList | None: + body: Union["BulkDestroyServicesType0", "BulkDestroyServicesType1"], +) -> Optional[Union[BulkDestroyServicesResponse, ErrorsList, Union["BulkDestroyServicesResponse", "ErrorsList"]]]: """Bulk delete Services Delete services by external_id list, or prune by managed_by source. Two mutually exclusive modes. Args: - body (BulkDestroyServicesType0 | BulkDestroyServicesType1): Two mutually exclusive modes. - Pass exactly one of: external_ids (delete specific records) or managed_by (prune all - managed records not in keep set). + body (Union['BulkDestroyServicesType0', 'BulkDestroyServicesType1']): Two mutually + exclusive modes. Pass exactly one of: external_ids (delete specific records) or managed_by + (prune all managed records not in keep set). Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - BulkDestroyServicesResponse | BulkDestroyServicesResponse | ErrorsList | ErrorsList + Union[BulkDestroyServicesResponse, ErrorsList, Union['BulkDestroyServicesResponse', 'ErrorsList']] """ return ( diff --git a/rootly_sdk/api/services/bulk_upsert_services.py b/rootly_sdk/api/services/bulk_upsert_services.py index c1aaa566..777c01b8 100644 --- a/rootly_sdk/api/services/bulk_upsert_services.py +++ b/rootly_sdk/api/services/bulk_upsert_services.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> BulkUpsertServicesError | ErrorsList | BulkUpsertServicesResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[BulkUpsertServicesResponse, ErrorsList, Union["BulkUpsertServicesError", "ErrorsList"]]]: if response.status_code == 200: response_200 = BulkUpsertServicesResponse.from_dict(response.json()) @@ -46,14 +46,14 @@ def _parse_response( if response.status_code == 422: - def _parse_response_422(data: object) -> BulkUpsertServicesError | ErrorsList: + def _parse_response_422(data: object) -> Union["BulkUpsertServicesError", "ErrorsList"]: try: if not isinstance(data, dict): raise TypeError() response_422_type_0 = ErrorsList.from_dict(data) return response_422_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass if not isinstance(data, dict): raise TypeError() @@ -72,8 +72,8 @@ def _parse_response_422(data: object) -> BulkUpsertServicesError | ErrorsList: def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[BulkUpsertServicesError | ErrorsList | BulkUpsertServicesResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[BulkUpsertServicesResponse, ErrorsList, Union["BulkUpsertServicesError", "ErrorsList"]]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -86,7 +86,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: BulkUpsertServices, -) -> Response[BulkUpsertServicesError | ErrorsList | BulkUpsertServicesResponse | ErrorsList]: +) -> Response[Union[BulkUpsertServicesResponse, ErrorsList, Union["BulkUpsertServicesError", "ErrorsList"]]]: """Bulk upsert Services Create or update multiple services by external_id. Only attributes present in the payload are @@ -103,7 +103,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[BulkUpsertServicesError | ErrorsList | BulkUpsertServicesResponse | ErrorsList] + Response[Union[BulkUpsertServicesResponse, ErrorsList, Union['BulkUpsertServicesError', 'ErrorsList']]] """ kwargs = _get_kwargs( @@ -121,7 +121,7 @@ def sync( *, client: AuthenticatedClient, body: BulkUpsertServices, -) -> BulkUpsertServicesError | ErrorsList | BulkUpsertServicesResponse | ErrorsList | None: +) -> Optional[Union[BulkUpsertServicesResponse, ErrorsList, Union["BulkUpsertServicesError", "ErrorsList"]]]: """Bulk upsert Services Create or update multiple services by external_id. Only attributes present in the payload are @@ -138,7 +138,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - BulkUpsertServicesError | ErrorsList | BulkUpsertServicesResponse | ErrorsList + Union[BulkUpsertServicesResponse, ErrorsList, Union['BulkUpsertServicesError', 'ErrorsList']] """ return sync_detailed( @@ -151,7 +151,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: BulkUpsertServices, -) -> Response[BulkUpsertServicesError | ErrorsList | BulkUpsertServicesResponse | ErrorsList]: +) -> Response[Union[BulkUpsertServicesResponse, ErrorsList, Union["BulkUpsertServicesError", "ErrorsList"]]]: """Bulk upsert Services Create or update multiple services by external_id. Only attributes present in the payload are @@ -168,7 +168,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[BulkUpsertServicesError | ErrorsList | BulkUpsertServicesResponse | ErrorsList] + Response[Union[BulkUpsertServicesResponse, ErrorsList, Union['BulkUpsertServicesError', 'ErrorsList']]] """ kwargs = _get_kwargs( @@ -184,7 +184,7 @@ async def asyncio( *, client: AuthenticatedClient, body: BulkUpsertServices, -) -> BulkUpsertServicesError | ErrorsList | BulkUpsertServicesResponse | ErrorsList | None: +) -> Optional[Union[BulkUpsertServicesResponse, ErrorsList, Union["BulkUpsertServicesError", "ErrorsList"]]]: """Bulk upsert Services Create or update multiple services by external_id. Only attributes present in the payload are @@ -201,7 +201,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - BulkUpsertServicesError | ErrorsList | BulkUpsertServicesResponse | ErrorsList + Union[BulkUpsertServicesResponse, ErrorsList, Union['BulkUpsertServicesError', 'ErrorsList']] """ return ( diff --git a/rootly_sdk/api/services/create_service.py b/rootly_sdk/api/services/create_service.py index fcd786db..c3a8b42e 100644 --- a/rootly_sdk/api/services/create_service.py +++ b/rootly_sdk/api/services/create_service.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | ServiceResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, ServiceResponse]]: if response.status_code == 201: response_201 = ServiceResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | ServiceResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, ServiceResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +69,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewService, -) -> Response[ErrorsList | ServiceResponse]: +) -> Response[Union[ErrorsList, ServiceResponse]]: """Creates a service Creates a new service from provided data @@ -82,7 +82,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | ServiceResponse] + Response[Union[ErrorsList, ServiceResponse]] """ kwargs = _get_kwargs( @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: NewService, -) -> ErrorsList | ServiceResponse | None: +) -> Optional[Union[ErrorsList, ServiceResponse]]: """Creates a service Creates a new service from provided data @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | ServiceResponse + Union[ErrorsList, ServiceResponse] """ return sync_detailed( @@ -126,7 +126,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewService, -) -> Response[ErrorsList | ServiceResponse]: +) -> Response[Union[ErrorsList, ServiceResponse]]: """Creates a service Creates a new service from provided data @@ -139,7 +139,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | ServiceResponse] + Response[Union[ErrorsList, ServiceResponse]] """ kwargs = _get_kwargs( @@ -155,7 +155,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewService, -) -> ErrorsList | ServiceResponse | None: +) -> Optional[Union[ErrorsList, ServiceResponse]]: """Creates a service Creates a new service from provided data @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | ServiceResponse + Union[ErrorsList, ServiceResponse] """ return ( diff --git a/rootly_sdk/api/services/create_service_catalog_property.py b/rootly_sdk/api/services/create_service_catalog_property.py index 3c61dc54..29dd5aac 100644 --- a/rootly_sdk/api/services/create_service_catalog_property.py +++ b/rootly_sdk/api/services/create_service_catalog_property.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> CatalogPropertyResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[CatalogPropertyResponse, ErrorsList]]: if response.status_code == 201: response_201 = CatalogPropertyResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[CatalogPropertyResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[CatalogPropertyResponse, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +69,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewCatalogProperty, -) -> Response[CatalogPropertyResponse | ErrorsList]: +) -> Response[Union[CatalogPropertyResponse, ErrorsList]]: """Creates a Catalog Property Creates a new Catalog Property from provided data @@ -82,7 +82,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CatalogPropertyResponse | ErrorsList] + Response[Union[CatalogPropertyResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: NewCatalogProperty, -) -> CatalogPropertyResponse | ErrorsList | None: +) -> Optional[Union[CatalogPropertyResponse, ErrorsList]]: """Creates a Catalog Property Creates a new Catalog Property from provided data @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CatalogPropertyResponse | ErrorsList + Union[CatalogPropertyResponse, ErrorsList] """ return sync_detailed( @@ -126,7 +126,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewCatalogProperty, -) -> Response[CatalogPropertyResponse | ErrorsList]: +) -> Response[Union[CatalogPropertyResponse, ErrorsList]]: """Creates a Catalog Property Creates a new Catalog Property from provided data @@ -139,7 +139,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CatalogPropertyResponse | ErrorsList] + Response[Union[CatalogPropertyResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -155,7 +155,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewCatalogProperty, -) -> CatalogPropertyResponse | ErrorsList | None: +) -> Optional[Union[CatalogPropertyResponse, ErrorsList]]: """Creates a Catalog Property Creates a new Catalog Property from provided data @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CatalogPropertyResponse | ErrorsList + Union[CatalogPropertyResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/services/delete_service.py b/rootly_sdk/api/services/delete_service.py index 52fc6e7d..07842636 100644 --- a/rootly_sdk/api/services/delete_service.py +++ b/rootly_sdk/api/services/delete_service.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union from uuid import UUID import httpx @@ -13,22 +12,19 @@ def _get_kwargs( - id: str | UUID, + id: Union[UUID, str], ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/services/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/services/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | ServiceResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, ServiceResponse]]: if response.status_code == 200: response_200 = ServiceResponse.from_dict(response.json()) @@ -46,8 +42,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | ServiceResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, ServiceResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -57,23 +53,23 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Response[ErrorsList | ServiceResponse]: +) -> Response[Union[ErrorsList, ServiceResponse]]: """Delete a service Delete a specific service by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | ServiceResponse] + Response[Union[ErrorsList, ServiceResponse]] """ kwargs = _get_kwargs( @@ -88,23 +84,23 @@ def sync_detailed( def sync( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> ErrorsList | ServiceResponse | None: +) -> Optional[Union[ErrorsList, ServiceResponse]]: """Delete a service Delete a specific service by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | ServiceResponse + Union[ErrorsList, ServiceResponse] """ return sync_detailed( @@ -114,23 +110,23 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Response[ErrorsList | ServiceResponse]: +) -> Response[Union[ErrorsList, ServiceResponse]]: """Delete a service Delete a specific service by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | ServiceResponse] + Response[Union[ErrorsList, ServiceResponse]] """ kwargs = _get_kwargs( @@ -143,23 +139,23 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> ErrorsList | ServiceResponse | None: +) -> Optional[Union[ErrorsList, ServiceResponse]]: """Delete a service Delete a specific service by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | ServiceResponse + Union[ErrorsList, ServiceResponse] """ return ( diff --git a/rootly_sdk/api/services/get_service.py b/rootly_sdk/api/services/get_service.py index 17d3ef16..bdb5a8a7 100644 --- a/rootly_sdk/api/services/get_service.py +++ b/rootly_sdk/api/services/get_service.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union from uuid import UUID import httpx @@ -13,22 +12,19 @@ def _get_kwargs( - id: str | UUID, + id: Union[UUID, str], ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/services/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/services/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | ServiceResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, ServiceResponse]]: if response.status_code == 200: response_200 = ServiceResponse.from_dict(response.json()) @@ -46,8 +42,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | ServiceResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, ServiceResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -57,23 +53,23 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Response[ErrorsList | ServiceResponse]: +) -> Response[Union[ErrorsList, ServiceResponse]]: """Retrieves a service Retrieves a specific service by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | ServiceResponse] + Response[Union[ErrorsList, ServiceResponse]] """ kwargs = _get_kwargs( @@ -88,23 +84,23 @@ def sync_detailed( def sync( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> ErrorsList | ServiceResponse | None: +) -> Optional[Union[ErrorsList, ServiceResponse]]: """Retrieves a service Retrieves a specific service by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | ServiceResponse + Union[ErrorsList, ServiceResponse] """ return sync_detailed( @@ -114,23 +110,23 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Response[ErrorsList | ServiceResponse]: +) -> Response[Union[ErrorsList, ServiceResponse]]: """Retrieves a service Retrieves a specific service by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | ServiceResponse] + Response[Union[ErrorsList, ServiceResponse]] """ kwargs = _get_kwargs( @@ -143,23 +139,23 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> ErrorsList | ServiceResponse | None: +) -> Optional[Union[ErrorsList, ServiceResponse]]: """Retrieves a service Retrieves a specific service by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | ServiceResponse + Union[ErrorsList, ServiceResponse] """ return ( diff --git a/rootly_sdk/api/services/get_service_incidents_chart.py b/rootly_sdk/api/services/get_service_incidents_chart.py index 7a881811..b46278c6 100644 --- a/rootly_sdk/api/services/get_service_incidents_chart.py +++ b/rootly_sdk/api/services/get_service_incidents_chart.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union from uuid import UUID import httpx @@ -13,11 +12,10 @@ def _get_kwargs( - id: str | UUID, + id: Union[UUID, str], *, period: str, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["period"] = period @@ -26,9 +24,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/services/{id}/incidents_chart".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/services/{id}/incidents_chart", "params": params, } @@ -36,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | IncidentsChartResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, IncidentsChartResponse]]: if response.status_code == 200: response_200 = IncidentsChartResponse.from_dict(response.json()) @@ -55,8 +51,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | IncidentsChartResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, IncidentsChartResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,17 +62,17 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, period: str, -) -> Response[ErrorsList | IncidentsChartResponse]: +) -> Response[Union[ErrorsList, IncidentsChartResponse]]: """Get service incidents chart Get service incidents chart Args: - id (str | UUID): + id (Union[UUID, str]): period (str): Raises: @@ -84,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentsChartResponse] + Response[Union[ErrorsList, IncidentsChartResponse]] """ kwargs = _get_kwargs( @@ -100,17 +96,17 @@ def sync_detailed( def sync( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, period: str, -) -> ErrorsList | IncidentsChartResponse | None: +) -> Optional[Union[ErrorsList, IncidentsChartResponse]]: """Get service incidents chart Get service incidents chart Args: - id (str | UUID): + id (Union[UUID, str]): period (str): Raises: @@ -118,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentsChartResponse + Union[ErrorsList, IncidentsChartResponse] """ return sync_detailed( @@ -129,17 +125,17 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, period: str, -) -> Response[ErrorsList | IncidentsChartResponse]: +) -> Response[Union[ErrorsList, IncidentsChartResponse]]: """Get service incidents chart Get service incidents chart Args: - id (str | UUID): + id (Union[UUID, str]): period (str): Raises: @@ -147,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentsChartResponse] + Response[Union[ErrorsList, IncidentsChartResponse]] """ kwargs = _get_kwargs( @@ -161,17 +157,17 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, period: str, -) -> ErrorsList | IncidentsChartResponse | None: +) -> Optional[Union[ErrorsList, IncidentsChartResponse]]: """Get service incidents chart Get service incidents chart Args: - id (str | UUID): + id (Union[UUID, str]): period (str): Raises: @@ -179,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentsChartResponse + Union[ErrorsList, IncidentsChartResponse] """ return ( diff --git a/rootly_sdk/api/services/get_service_uptime_chart.py b/rootly_sdk/api/services/get_service_uptime_chart.py index 1976e560..56d80b98 100644 --- a/rootly_sdk/api/services/get_service_uptime_chart.py +++ b/rootly_sdk/api/services/get_service_uptime_chart.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union from uuid import UUID import httpx @@ -13,11 +12,10 @@ def _get_kwargs( - id: str | UUID, + id: Union[UUID, str], *, - period: str | Unset = UNSET, + period: Union[Unset, str] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["period"] = period @@ -26,9 +24,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/services/{id}/uptime_chart".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/services/{id}/uptime_chart", "params": params, } @@ -36,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | UptimeChartResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, UptimeChartResponse]]: if response.status_code == 200: response_200 = UptimeChartResponse.from_dict(response.json()) @@ -55,8 +51,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | UptimeChartResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, UptimeChartResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,25 +62,25 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, - period: str | Unset = UNSET, -) -> Response[ErrorsList | UptimeChartResponse]: + period: Union[Unset, str] = UNSET, +) -> Response[Union[ErrorsList, UptimeChartResponse]]: """Get service uptime chart Get service uptime chart Args: - id (str | UUID): - period (str | Unset): + id (Union[UUID, str]): + period (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | UptimeChartResponse] + Response[Union[ErrorsList, UptimeChartResponse]] """ kwargs = _get_kwargs( @@ -100,25 +96,25 @@ def sync_detailed( def sync( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, - period: str | Unset = UNSET, -) -> ErrorsList | UptimeChartResponse | None: + period: Union[Unset, str] = UNSET, +) -> Optional[Union[ErrorsList, UptimeChartResponse]]: """Get service uptime chart Get service uptime chart Args: - id (str | UUID): - period (str | Unset): + id (Union[UUID, str]): + period (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | UptimeChartResponse + Union[ErrorsList, UptimeChartResponse] """ return sync_detailed( @@ -129,25 +125,25 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, - period: str | Unset = UNSET, -) -> Response[ErrorsList | UptimeChartResponse]: + period: Union[Unset, str] = UNSET, +) -> Response[Union[ErrorsList, UptimeChartResponse]]: """Get service uptime chart Get service uptime chart Args: - id (str | UUID): - period (str | Unset): + id (Union[UUID, str]): + period (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | UptimeChartResponse] + Response[Union[ErrorsList, UptimeChartResponse]] """ kwargs = _get_kwargs( @@ -161,25 +157,25 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, - period: str | Unset = UNSET, -) -> ErrorsList | UptimeChartResponse | None: + period: Union[Unset, str] = UNSET, +) -> Optional[Union[ErrorsList, UptimeChartResponse]]: """Get service uptime chart Get service uptime chart Args: - id (str | UUID): - period (str | Unset): + id (Union[UUID, str]): + period (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | UptimeChartResponse + Union[ErrorsList, UptimeChartResponse] """ return ( diff --git a/rootly_sdk/api/services/list_service_catalog_properties.py b/rootly_sdk/api/services/list_service_catalog_properties.py index 54b4e887..3a5e9383 100644 --- a/rootly_sdk/api/services/list_service_catalog_properties.py +++ b/rootly_sdk/api/services/list_service_catalog_properties.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -17,28 +17,27 @@ def _get_kwargs( *, - include: ListServiceCatalogPropertiesInclude | Unset = UNSET, - sort: ListServiceCatalogPropertiesSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Union[Unset, ListServiceCatalogPropertiesInclude] = UNSET, + sort: Union[Unset, ListServiceCatalogPropertiesSort] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterkind: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} - json_include: str | Unset = UNSET + json_include: Union[Unset, str] = UNSET if not isinstance(include, Unset): json_include = include params["include"] = json_include - json_sort: str | Unset = UNSET + json_sort: Union[Unset, str] = UNSET if not isinstance(sort, Unset): json_sort = sort @@ -73,7 +72,9 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> CatalogPropertyList | None: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[CatalogPropertyList]: if response.status_code == 200: response_200 = CatalogPropertyList.from_dict(response.json()) @@ -85,7 +86,9 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[CatalogPropertyList]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[CatalogPropertyList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -97,34 +100,34 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - include: ListServiceCatalogPropertiesInclude | Unset = UNSET, - sort: ListServiceCatalogPropertiesSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Union[Unset, ListServiceCatalogPropertiesInclude] = UNSET, + sort: Union[Unset, ListServiceCatalogPropertiesSort] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterkind: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, ) -> Response[CatalogPropertyList]: """List Catalog Properties List Service Catalog Properties Args: - include (ListServiceCatalogPropertiesInclude | Unset): - sort (ListServiceCatalogPropertiesSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterkind (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, ListServiceCatalogPropertiesInclude]): + sort (Union[Unset, ListServiceCatalogPropertiesSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterkind (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -158,34 +161,34 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: ListServiceCatalogPropertiesInclude | Unset = UNSET, - sort: ListServiceCatalogPropertiesSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, -) -> CatalogPropertyList | None: + include: Union[Unset, ListServiceCatalogPropertiesInclude] = UNSET, + sort: Union[Unset, ListServiceCatalogPropertiesSort] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterkind: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, +) -> Optional[CatalogPropertyList]: """List Catalog Properties List Service Catalog Properties Args: - include (ListServiceCatalogPropertiesInclude | Unset): - sort (ListServiceCatalogPropertiesSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterkind (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, ListServiceCatalogPropertiesInclude]): + sort (Union[Unset, ListServiceCatalogPropertiesSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterkind (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -214,34 +217,34 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: ListServiceCatalogPropertiesInclude | Unset = UNSET, - sort: ListServiceCatalogPropertiesSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Union[Unset, ListServiceCatalogPropertiesInclude] = UNSET, + sort: Union[Unset, ListServiceCatalogPropertiesSort] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterkind: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, ) -> Response[CatalogPropertyList]: """List Catalog Properties List Service Catalog Properties Args: - include (ListServiceCatalogPropertiesInclude | Unset): - sort (ListServiceCatalogPropertiesSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterkind (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, ListServiceCatalogPropertiesInclude]): + sort (Union[Unset, ListServiceCatalogPropertiesSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterkind (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -273,34 +276,34 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: ListServiceCatalogPropertiesInclude | Unset = UNSET, - sort: ListServiceCatalogPropertiesSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, -) -> CatalogPropertyList | None: + include: Union[Unset, ListServiceCatalogPropertiesInclude] = UNSET, + sort: Union[Unset, ListServiceCatalogPropertiesSort] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterkind: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, +) -> Optional[CatalogPropertyList]: """List Catalog Properties List Service Catalog Properties Args: - include (ListServiceCatalogPropertiesInclude | Unset): - sort (ListServiceCatalogPropertiesSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterkind (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, ListServiceCatalogPropertiesInclude]): + sort (Union[Unset, ListServiceCatalogPropertiesSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterkind (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/services/list_services.py b/rootly_sdk/api/services/list_services.py index 0bec2c70..4858e922 100644 --- a/rootly_sdk/api/services/list_services.py +++ b/rootly_sdk/api/services/list_services.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -11,41 +11,40 @@ def _get_kwargs( *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filterbackstage_id: str | Unset = UNSET, - filtercortex_id: str | Unset = UNSET, - filteropslevel_id: str | Unset = UNSET, - filterexternal_id: str | Unset = UNSET, - filteralert_broadcast_enabled: bool | Unset = UNSET, - filterincident_broadcast_enabled: bool | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filteralert_broadcast_enabledeq: str | Unset = UNSET, - filteralert_broadcast_enablednot_eq: str | Unset = UNSET, - filteralert_broadcast_enabledin: str | Unset = UNSET, - filteralert_broadcast_enablednot_in: str | Unset = UNSET, - filterincident_broadcast_enabledeq: str | Unset = UNSET, - filterincident_broadcast_enablednot_eq: str | Unset = UNSET, - filterincident_broadcast_enabledin: str | Unset = UNSET, - filterincident_broadcast_enablednot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filterbackstage_id: Union[Unset, str] = UNSET, + filtercortex_id: Union[Unset, str] = UNSET, + filteropslevel_id: Union[Unset, str] = UNSET, + filterexternal_id: Union[Unset, str] = UNSET, + filteralert_broadcast_enabled: Union[Unset, bool] = UNSET, + filterincident_broadcast_enabled: Union[Unset, bool] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, + filterslugeq: Union[Unset, str] = UNSET, + filterslugnot_eq: Union[Unset, str] = UNSET, + filterslugin: Union[Unset, str] = UNSET, + filterslugnot_in: Union[Unset, str] = UNSET, + filteralert_broadcast_enabledeq: Union[Unset, str] = UNSET, + filteralert_broadcast_enablednot_eq: Union[Unset, str] = UNSET, + filteralert_broadcast_enabledin: Union[Unset, str] = UNSET, + filteralert_broadcast_enablednot_in: Union[Unset, str] = UNSET, + filterincident_broadcast_enabledeq: Union[Unset, str] = UNSET, + filterincident_broadcast_enablednot_eq: Union[Unset, str] = UNSET, + filterincident_broadcast_enabledin: Union[Unset, str] = UNSET, + filterincident_broadcast_enablednot_in: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -125,7 +124,7 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> ServiceList | None: +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[ServiceList]: if response.status_code == 200: response_200 = ServiceList.from_dict(response.json()) @@ -137,7 +136,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[ServiceList]: +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[ServiceList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -149,78 +148,78 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filterbackstage_id: str | Unset = UNSET, - filtercortex_id: str | Unset = UNSET, - filteropslevel_id: str | Unset = UNSET, - filterexternal_id: str | Unset = UNSET, - filteralert_broadcast_enabled: bool | Unset = UNSET, - filterincident_broadcast_enabled: bool | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filteralert_broadcast_enabledeq: str | Unset = UNSET, - filteralert_broadcast_enablednot_eq: str | Unset = UNSET, - filteralert_broadcast_enabledin: str | Unset = UNSET, - filteralert_broadcast_enablednot_in: str | Unset = UNSET, - filterincident_broadcast_enabledeq: str | Unset = UNSET, - filterincident_broadcast_enablednot_eq: str | Unset = UNSET, - filterincident_broadcast_enabledin: str | Unset = UNSET, - filterincident_broadcast_enablednot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filterbackstage_id: Union[Unset, str] = UNSET, + filtercortex_id: Union[Unset, str] = UNSET, + filteropslevel_id: Union[Unset, str] = UNSET, + filterexternal_id: Union[Unset, str] = UNSET, + filteralert_broadcast_enabled: Union[Unset, bool] = UNSET, + filterincident_broadcast_enabled: Union[Unset, bool] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, + filterslugeq: Union[Unset, str] = UNSET, + filterslugnot_eq: Union[Unset, str] = UNSET, + filterslugin: Union[Unset, str] = UNSET, + filterslugnot_in: Union[Unset, str] = UNSET, + filteralert_broadcast_enabledeq: Union[Unset, str] = UNSET, + filteralert_broadcast_enablednot_eq: Union[Unset, str] = UNSET, + filteralert_broadcast_enabledin: Union[Unset, str] = UNSET, + filteralert_broadcast_enablednot_in: Union[Unset, str] = UNSET, + filterincident_broadcast_enabledeq: Union[Unset, str] = UNSET, + filterincident_broadcast_enablednot_eq: Union[Unset, str] = UNSET, + filterincident_broadcast_enabledin: Union[Unset, str] = UNSET, + filterincident_broadcast_enablednot_in: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, ) -> Response[ServiceList]: """List services List services Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterslug (str | Unset): - filterbackstage_id (str | Unset): - filtercortex_id (str | Unset): - filteropslevel_id (str | Unset): - filterexternal_id (str | Unset): - filteralert_broadcast_enabled (bool | Unset): - filterincident_broadcast_enabled (bool | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filteralert_broadcast_enabledeq (str | Unset): - filteralert_broadcast_enablednot_eq (str | Unset): - filteralert_broadcast_enabledin (str | Unset): - filteralert_broadcast_enablednot_in (str | Unset): - filterincident_broadcast_enabledeq (str | Unset): - filterincident_broadcast_enablednot_eq (str | Unset): - filterincident_broadcast_enabledin (str | Unset): - filterincident_broadcast_enablednot_in (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterslug (Union[Unset, str]): + filterbackstage_id (Union[Unset, str]): + filtercortex_id (Union[Unset, str]): + filteropslevel_id (Union[Unset, str]): + filterexternal_id (Union[Unset, str]): + filteralert_broadcast_enabled (Union[Unset, bool]): + filterincident_broadcast_enabled (Union[Unset, bool]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filteralert_broadcast_enabledeq (Union[Unset, str]): + filteralert_broadcast_enablednot_eq (Union[Unset, str]): + filteralert_broadcast_enabledin (Union[Unset, str]): + filteralert_broadcast_enablednot_in (Union[Unset, str]): + filterincident_broadcast_enabledeq (Union[Unset, str]): + filterincident_broadcast_enablednot_eq (Union[Unset, str]): + filterincident_broadcast_enabledin (Union[Unset, str]): + filterincident_broadcast_enablednot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -276,78 +275,78 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filterbackstage_id: str | Unset = UNSET, - filtercortex_id: str | Unset = UNSET, - filteropslevel_id: str | Unset = UNSET, - filterexternal_id: str | Unset = UNSET, - filteralert_broadcast_enabled: bool | Unset = UNSET, - filterincident_broadcast_enabled: bool | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filteralert_broadcast_enabledeq: str | Unset = UNSET, - filteralert_broadcast_enablednot_eq: str | Unset = UNSET, - filteralert_broadcast_enabledin: str | Unset = UNSET, - filteralert_broadcast_enablednot_in: str | Unset = UNSET, - filterincident_broadcast_enabledeq: str | Unset = UNSET, - filterincident_broadcast_enablednot_eq: str | Unset = UNSET, - filterincident_broadcast_enabledin: str | Unset = UNSET, - filterincident_broadcast_enablednot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, -) -> ServiceList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filterbackstage_id: Union[Unset, str] = UNSET, + filtercortex_id: Union[Unset, str] = UNSET, + filteropslevel_id: Union[Unset, str] = UNSET, + filterexternal_id: Union[Unset, str] = UNSET, + filteralert_broadcast_enabled: Union[Unset, bool] = UNSET, + filterincident_broadcast_enabled: Union[Unset, bool] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, + filterslugeq: Union[Unset, str] = UNSET, + filterslugnot_eq: Union[Unset, str] = UNSET, + filterslugin: Union[Unset, str] = UNSET, + filterslugnot_in: Union[Unset, str] = UNSET, + filteralert_broadcast_enabledeq: Union[Unset, str] = UNSET, + filteralert_broadcast_enablednot_eq: Union[Unset, str] = UNSET, + filteralert_broadcast_enabledin: Union[Unset, str] = UNSET, + filteralert_broadcast_enablednot_in: Union[Unset, str] = UNSET, + filterincident_broadcast_enabledeq: Union[Unset, str] = UNSET, + filterincident_broadcast_enablednot_eq: Union[Unset, str] = UNSET, + filterincident_broadcast_enabledin: Union[Unset, str] = UNSET, + filterincident_broadcast_enablednot_in: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, +) -> Optional[ServiceList]: """List services List services Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterslug (str | Unset): - filterbackstage_id (str | Unset): - filtercortex_id (str | Unset): - filteropslevel_id (str | Unset): - filterexternal_id (str | Unset): - filteralert_broadcast_enabled (bool | Unset): - filterincident_broadcast_enabled (bool | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filteralert_broadcast_enabledeq (str | Unset): - filteralert_broadcast_enablednot_eq (str | Unset): - filteralert_broadcast_enabledin (str | Unset): - filteralert_broadcast_enablednot_in (str | Unset): - filterincident_broadcast_enabledeq (str | Unset): - filterincident_broadcast_enablednot_eq (str | Unset): - filterincident_broadcast_enabledin (str | Unset): - filterincident_broadcast_enablednot_in (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterslug (Union[Unset, str]): + filterbackstage_id (Union[Unset, str]): + filtercortex_id (Union[Unset, str]): + filteropslevel_id (Union[Unset, str]): + filterexternal_id (Union[Unset, str]): + filteralert_broadcast_enabled (Union[Unset, bool]): + filterincident_broadcast_enabled (Union[Unset, bool]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filteralert_broadcast_enabledeq (Union[Unset, str]): + filteralert_broadcast_enablednot_eq (Union[Unset, str]): + filteralert_broadcast_enabledin (Union[Unset, str]): + filteralert_broadcast_enablednot_in (Union[Unset, str]): + filterincident_broadcast_enabledeq (Union[Unset, str]): + filterincident_broadcast_enablednot_eq (Union[Unset, str]): + filterincident_broadcast_enabledin (Union[Unset, str]): + filterincident_broadcast_enablednot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -398,78 +397,78 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filterbackstage_id: str | Unset = UNSET, - filtercortex_id: str | Unset = UNSET, - filteropslevel_id: str | Unset = UNSET, - filterexternal_id: str | Unset = UNSET, - filteralert_broadcast_enabled: bool | Unset = UNSET, - filterincident_broadcast_enabled: bool | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filteralert_broadcast_enabledeq: str | Unset = UNSET, - filteralert_broadcast_enablednot_eq: str | Unset = UNSET, - filteralert_broadcast_enabledin: str | Unset = UNSET, - filteralert_broadcast_enablednot_in: str | Unset = UNSET, - filterincident_broadcast_enabledeq: str | Unset = UNSET, - filterincident_broadcast_enablednot_eq: str | Unset = UNSET, - filterincident_broadcast_enabledin: str | Unset = UNSET, - filterincident_broadcast_enablednot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filterbackstage_id: Union[Unset, str] = UNSET, + filtercortex_id: Union[Unset, str] = UNSET, + filteropslevel_id: Union[Unset, str] = UNSET, + filterexternal_id: Union[Unset, str] = UNSET, + filteralert_broadcast_enabled: Union[Unset, bool] = UNSET, + filterincident_broadcast_enabled: Union[Unset, bool] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, + filterslugeq: Union[Unset, str] = UNSET, + filterslugnot_eq: Union[Unset, str] = UNSET, + filterslugin: Union[Unset, str] = UNSET, + filterslugnot_in: Union[Unset, str] = UNSET, + filteralert_broadcast_enabledeq: Union[Unset, str] = UNSET, + filteralert_broadcast_enablednot_eq: Union[Unset, str] = UNSET, + filteralert_broadcast_enabledin: Union[Unset, str] = UNSET, + filteralert_broadcast_enablednot_in: Union[Unset, str] = UNSET, + filterincident_broadcast_enabledeq: Union[Unset, str] = UNSET, + filterincident_broadcast_enablednot_eq: Union[Unset, str] = UNSET, + filterincident_broadcast_enabledin: Union[Unset, str] = UNSET, + filterincident_broadcast_enablednot_in: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, ) -> Response[ServiceList]: """List services List services Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterslug (str | Unset): - filterbackstage_id (str | Unset): - filtercortex_id (str | Unset): - filteropslevel_id (str | Unset): - filterexternal_id (str | Unset): - filteralert_broadcast_enabled (bool | Unset): - filterincident_broadcast_enabled (bool | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filteralert_broadcast_enabledeq (str | Unset): - filteralert_broadcast_enablednot_eq (str | Unset): - filteralert_broadcast_enabledin (str | Unset): - filteralert_broadcast_enablednot_in (str | Unset): - filterincident_broadcast_enabledeq (str | Unset): - filterincident_broadcast_enablednot_eq (str | Unset): - filterincident_broadcast_enabledin (str | Unset): - filterincident_broadcast_enablednot_in (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterslug (Union[Unset, str]): + filterbackstage_id (Union[Unset, str]): + filtercortex_id (Union[Unset, str]): + filteropslevel_id (Union[Unset, str]): + filterexternal_id (Union[Unset, str]): + filteralert_broadcast_enabled (Union[Unset, bool]): + filterincident_broadcast_enabled (Union[Unset, bool]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filteralert_broadcast_enabledeq (Union[Unset, str]): + filteralert_broadcast_enablednot_eq (Union[Unset, str]): + filteralert_broadcast_enabledin (Union[Unset, str]): + filteralert_broadcast_enablednot_in (Union[Unset, str]): + filterincident_broadcast_enabledeq (Union[Unset, str]): + filterincident_broadcast_enablednot_eq (Union[Unset, str]): + filterincident_broadcast_enabledin (Union[Unset, str]): + filterincident_broadcast_enablednot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -523,78 +522,78 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filterbackstage_id: str | Unset = UNSET, - filtercortex_id: str | Unset = UNSET, - filteropslevel_id: str | Unset = UNSET, - filterexternal_id: str | Unset = UNSET, - filteralert_broadcast_enabled: bool | Unset = UNSET, - filterincident_broadcast_enabled: bool | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filteralert_broadcast_enabledeq: str | Unset = UNSET, - filteralert_broadcast_enablednot_eq: str | Unset = UNSET, - filteralert_broadcast_enabledin: str | Unset = UNSET, - filteralert_broadcast_enablednot_in: str | Unset = UNSET, - filterincident_broadcast_enabledeq: str | Unset = UNSET, - filterincident_broadcast_enablednot_eq: str | Unset = UNSET, - filterincident_broadcast_enabledin: str | Unset = UNSET, - filterincident_broadcast_enablednot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, -) -> ServiceList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filterbackstage_id: Union[Unset, str] = UNSET, + filtercortex_id: Union[Unset, str] = UNSET, + filteropslevel_id: Union[Unset, str] = UNSET, + filterexternal_id: Union[Unset, str] = UNSET, + filteralert_broadcast_enabled: Union[Unset, bool] = UNSET, + filterincident_broadcast_enabled: Union[Unset, bool] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, + filterslugeq: Union[Unset, str] = UNSET, + filterslugnot_eq: Union[Unset, str] = UNSET, + filterslugin: Union[Unset, str] = UNSET, + filterslugnot_in: Union[Unset, str] = UNSET, + filteralert_broadcast_enabledeq: Union[Unset, str] = UNSET, + filteralert_broadcast_enablednot_eq: Union[Unset, str] = UNSET, + filteralert_broadcast_enabledin: Union[Unset, str] = UNSET, + filteralert_broadcast_enablednot_in: Union[Unset, str] = UNSET, + filterincident_broadcast_enabledeq: Union[Unset, str] = UNSET, + filterincident_broadcast_enablednot_eq: Union[Unset, str] = UNSET, + filterincident_broadcast_enabledin: Union[Unset, str] = UNSET, + filterincident_broadcast_enablednot_in: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, +) -> Optional[ServiceList]: """List services List services Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterslug (str | Unset): - filterbackstage_id (str | Unset): - filtercortex_id (str | Unset): - filteropslevel_id (str | Unset): - filterexternal_id (str | Unset): - filteralert_broadcast_enabled (bool | Unset): - filterincident_broadcast_enabled (bool | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filteralert_broadcast_enabledeq (str | Unset): - filteralert_broadcast_enablednot_eq (str | Unset): - filteralert_broadcast_enabledin (str | Unset): - filteralert_broadcast_enablednot_in (str | Unset): - filterincident_broadcast_enabledeq (str | Unset): - filterincident_broadcast_enablednot_eq (str | Unset): - filterincident_broadcast_enabledin (str | Unset): - filterincident_broadcast_enablednot_in (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterslug (Union[Unset, str]): + filterbackstage_id (Union[Unset, str]): + filtercortex_id (Union[Unset, str]): + filteropslevel_id (Union[Unset, str]): + filterexternal_id (Union[Unset, str]): + filteralert_broadcast_enabled (Union[Unset, bool]): + filterincident_broadcast_enabled (Union[Unset, bool]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filteralert_broadcast_enabledeq (Union[Unset, str]): + filteralert_broadcast_enablednot_eq (Union[Unset, str]): + filteralert_broadcast_enabledin (Union[Unset, str]): + filteralert_broadcast_enablednot_in (Union[Unset, str]): + filterincident_broadcast_enabledeq (Union[Unset, str]): + filterincident_broadcast_enablednot_eq (Union[Unset, str]): + filterincident_broadcast_enabledin (Union[Unset, str]): + filterincident_broadcast_enablednot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/services/update_service.py b/rootly_sdk/api/services/update_service.py index 5ba68ee9..d75507ca 100644 --- a/rootly_sdk/api/services/update_service.py +++ b/rootly_sdk/api/services/update_service.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union from uuid import UUID import httpx @@ -14,7 +13,7 @@ def _get_kwargs( - id: str | UUID, + id: Union[UUID, str], *, body: UpdateService, ) -> dict[str, Any]: @@ -22,9 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/services/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/services/{id}", } _kwargs["json"] = body.to_dict() @@ -36,8 +33,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | ServiceResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, ServiceResponse]]: if response.status_code == 200: response_200 = ServiceResponse.from_dict(response.json()) @@ -55,8 +52,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | ServiceResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, ServiceResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,17 +63,17 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdateService, -) -> Response[ErrorsList | ServiceResponse]: +) -> Response[Union[ErrorsList, ServiceResponse]]: """Update a service Update a specific service by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateService): Raises: @@ -84,7 +81,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | ServiceResponse] + Response[Union[ErrorsList, ServiceResponse]] """ kwargs = _get_kwargs( @@ -100,17 +97,17 @@ def sync_detailed( def sync( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdateService, -) -> ErrorsList | ServiceResponse | None: +) -> Optional[Union[ErrorsList, ServiceResponse]]: """Update a service Update a specific service by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateService): Raises: @@ -118,7 +115,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | ServiceResponse + Union[ErrorsList, ServiceResponse] """ return sync_detailed( @@ -129,17 +126,17 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdateService, -) -> Response[ErrorsList | ServiceResponse]: +) -> Response[Union[ErrorsList, ServiceResponse]]: """Update a service Update a specific service by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateService): Raises: @@ -147,7 +144,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | ServiceResponse] + Response[Union[ErrorsList, ServiceResponse]] """ kwargs = _get_kwargs( @@ -161,17 +158,17 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdateService, -) -> ErrorsList | ServiceResponse | None: +) -> Optional[Union[ErrorsList, ServiceResponse]]: """Update a service Update a specific service by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateService): Raises: @@ -179,7 +176,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | ServiceResponse + Union[ErrorsList, ServiceResponse] """ return ( diff --git a/rootly_sdk/api/severities/create_severity.py b/rootly_sdk/api/severities/create_severity.py index ac3b5494..f7c094c7 100644 --- a/rootly_sdk/api/severities/create_severity.py +++ b/rootly_sdk/api/severities/create_severity.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | SeverityResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, SeverityResponse]]: if response.status_code == 201: response_201 = SeverityResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | SeverityResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, SeverityResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +69,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewSeverity, -) -> Response[ErrorsList | SeverityResponse]: +) -> Response[Union[ErrorsList, SeverityResponse]]: """Creates a severity Creates a new severity from provided data @@ -82,7 +82,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | SeverityResponse] + Response[Union[ErrorsList, SeverityResponse]] """ kwargs = _get_kwargs( @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: NewSeverity, -) -> ErrorsList | SeverityResponse | None: +) -> Optional[Union[ErrorsList, SeverityResponse]]: """Creates a severity Creates a new severity from provided data @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | SeverityResponse + Union[ErrorsList, SeverityResponse] """ return sync_detailed( @@ -126,7 +126,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewSeverity, -) -> Response[ErrorsList | SeverityResponse]: +) -> Response[Union[ErrorsList, SeverityResponse]]: """Creates a severity Creates a new severity from provided data @@ -139,7 +139,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | SeverityResponse] + Response[Union[ErrorsList, SeverityResponse]] """ kwargs = _get_kwargs( @@ -155,7 +155,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewSeverity, -) -> ErrorsList | SeverityResponse | None: +) -> Optional[Union[ErrorsList, SeverityResponse]]: """Creates a severity Creates a new severity from provided data @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | SeverityResponse + Union[ErrorsList, SeverityResponse] """ return ( diff --git a/rootly_sdk/api/severities/delete_severity.py b/rootly_sdk/api/severities/delete_severity.py index 466626a3..908fa1be 100644 --- a/rootly_sdk/api/severities/delete_severity.py +++ b/rootly_sdk/api/severities/delete_severity.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union from uuid import UUID import httpx @@ -13,22 +12,19 @@ def _get_kwargs( - id: str | UUID, + id: Union[UUID, str], ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/severities/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/severities/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | SeverityResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, SeverityResponse]]: if response.status_code == 200: response_200 = SeverityResponse.from_dict(response.json()) @@ -46,8 +42,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | SeverityResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, SeverityResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -57,23 +53,23 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Response[ErrorsList | SeverityResponse]: +) -> Response[Union[ErrorsList, SeverityResponse]]: """Delete a severity Delete a specific severity by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | SeverityResponse] + Response[Union[ErrorsList, SeverityResponse]] """ kwargs = _get_kwargs( @@ -88,23 +84,23 @@ def sync_detailed( def sync( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> ErrorsList | SeverityResponse | None: +) -> Optional[Union[ErrorsList, SeverityResponse]]: """Delete a severity Delete a specific severity by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | SeverityResponse + Union[ErrorsList, SeverityResponse] """ return sync_detailed( @@ -114,23 +110,23 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Response[ErrorsList | SeverityResponse]: +) -> Response[Union[ErrorsList, SeverityResponse]]: """Delete a severity Delete a specific severity by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | SeverityResponse] + Response[Union[ErrorsList, SeverityResponse]] """ kwargs = _get_kwargs( @@ -143,23 +139,23 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> ErrorsList | SeverityResponse | None: +) -> Optional[Union[ErrorsList, SeverityResponse]]: """Delete a severity Delete a specific severity by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | SeverityResponse + Union[ErrorsList, SeverityResponse] """ return ( diff --git a/rootly_sdk/api/severities/get_severity.py b/rootly_sdk/api/severities/get_severity.py index f36d72b9..e054f225 100644 --- a/rootly_sdk/api/severities/get_severity.py +++ b/rootly_sdk/api/severities/get_severity.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union from uuid import UUID import httpx @@ -13,22 +12,19 @@ def _get_kwargs( - id: str | UUID, + id: Union[UUID, str], ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/severities/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/severities/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | SeverityResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, SeverityResponse]]: if response.status_code == 200: response_200 = SeverityResponse.from_dict(response.json()) @@ -46,8 +42,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | SeverityResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, SeverityResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -57,23 +53,23 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Response[ErrorsList | SeverityResponse]: +) -> Response[Union[ErrorsList, SeverityResponse]]: """Retrieves a severity Retrieves a specific severity by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | SeverityResponse] + Response[Union[ErrorsList, SeverityResponse]] """ kwargs = _get_kwargs( @@ -88,23 +84,23 @@ def sync_detailed( def sync( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> ErrorsList | SeverityResponse | None: +) -> Optional[Union[ErrorsList, SeverityResponse]]: """Retrieves a severity Retrieves a specific severity by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | SeverityResponse + Union[ErrorsList, SeverityResponse] """ return sync_detailed( @@ -114,23 +110,23 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Response[ErrorsList | SeverityResponse]: +) -> Response[Union[ErrorsList, SeverityResponse]]: """Retrieves a severity Retrieves a specific severity by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | SeverityResponse] + Response[Union[ErrorsList, SeverityResponse]] """ kwargs = _get_kwargs( @@ -143,23 +139,23 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> ErrorsList | SeverityResponse | None: +) -> Optional[Union[ErrorsList, SeverityResponse]]: """Retrieves a severity Retrieves a specific severity by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | SeverityResponse + Union[ErrorsList, SeverityResponse] """ return ( diff --git a/rootly_sdk/api/severities/list_severities.py b/rootly_sdk/api/severities/list_severities.py index 8102f620..c0f47c57 100644 --- a/rootly_sdk/api/severities/list_severities.py +++ b/rootly_sdk/api/severities/list_severities.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -11,37 +11,36 @@ def _get_kwargs( *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterseverity: str | Unset = UNSET, - filtercolor: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filterseverityeq: str | Unset = UNSET, - filterseveritynot_eq: str | Unset = UNSET, - filterseverityin: str | Unset = UNSET, - filterseveritynot_in: str | Unset = UNSET, - filtercoloreq: str | Unset = UNSET, - filtercolornot_eq: str | Unset = UNSET, - filtercolorin: str | Unset = UNSET, - filtercolornot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterseverity: Union[Unset, str] = UNSET, + filtercolor: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filterslugeq: Union[Unset, str] = UNSET, + filterslugnot_eq: Union[Unset, str] = UNSET, + filterslugin: Union[Unset, str] = UNSET, + filterslugnot_in: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, + filterseverityeq: Union[Unset, str] = UNSET, + filterseveritynot_eq: Union[Unset, str] = UNSET, + filterseverityin: Union[Unset, str] = UNSET, + filterseveritynot_in: Union[Unset, str] = UNSET, + filtercoloreq: Union[Unset, str] = UNSET, + filtercolornot_eq: Union[Unset, str] = UNSET, + filtercolorin: Union[Unset, str] = UNSET, + filtercolornot_in: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -113,7 +112,7 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> SeverityList | None: +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[SeverityList]: if response.status_code == 200: response_200 = SeverityList.from_dict(response.json()) @@ -125,7 +124,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[SeverityList]: +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[SeverityList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -137,70 +136,70 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterseverity: str | Unset = UNSET, - filtercolor: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filterseverityeq: str | Unset = UNSET, - filterseveritynot_eq: str | Unset = UNSET, - filterseverityin: str | Unset = UNSET, - filterseveritynot_in: str | Unset = UNSET, - filtercoloreq: str | Unset = UNSET, - filtercolornot_eq: str | Unset = UNSET, - filtercolorin: str | Unset = UNSET, - filtercolornot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterseverity: Union[Unset, str] = UNSET, + filtercolor: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filterslugeq: Union[Unset, str] = UNSET, + filterslugnot_eq: Union[Unset, str] = UNSET, + filterslugin: Union[Unset, str] = UNSET, + filterslugnot_in: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, + filterseverityeq: Union[Unset, str] = UNSET, + filterseveritynot_eq: Union[Unset, str] = UNSET, + filterseverityin: Union[Unset, str] = UNSET, + filterseveritynot_in: Union[Unset, str] = UNSET, + filtercoloreq: Union[Unset, str] = UNSET, + filtercolornot_eq: Union[Unset, str] = UNSET, + filtercolorin: Union[Unset, str] = UNSET, + filtercolornot_in: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, ) -> Response[SeverityList]: """List severities List severities Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterseverity (str | Unset): - filtercolor (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filterseverityeq (str | Unset): - filterseveritynot_eq (str | Unset): - filterseverityin (str | Unset): - filterseveritynot_in (str | Unset): - filtercoloreq (str | Unset): - filtercolornot_eq (str | Unset): - filtercolorin (str | Unset): - filtercolornot_in (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterseverity (Union[Unset, str]): + filtercolor (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filterseverityeq (Union[Unset, str]): + filterseveritynot_eq (Union[Unset, str]): + filterseverityin (Union[Unset, str]): + filterseveritynot_in (Union[Unset, str]): + filtercoloreq (Union[Unset, str]): + filtercolornot_eq (Union[Unset, str]): + filtercolorin (Union[Unset, str]): + filtercolornot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -252,70 +251,70 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterseverity: str | Unset = UNSET, - filtercolor: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filterseverityeq: str | Unset = UNSET, - filterseveritynot_eq: str | Unset = UNSET, - filterseverityin: str | Unset = UNSET, - filterseveritynot_in: str | Unset = UNSET, - filtercoloreq: str | Unset = UNSET, - filtercolornot_eq: str | Unset = UNSET, - filtercolorin: str | Unset = UNSET, - filtercolornot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, -) -> SeverityList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterseverity: Union[Unset, str] = UNSET, + filtercolor: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filterslugeq: Union[Unset, str] = UNSET, + filterslugnot_eq: Union[Unset, str] = UNSET, + filterslugin: Union[Unset, str] = UNSET, + filterslugnot_in: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, + filterseverityeq: Union[Unset, str] = UNSET, + filterseveritynot_eq: Union[Unset, str] = UNSET, + filterseverityin: Union[Unset, str] = UNSET, + filterseveritynot_in: Union[Unset, str] = UNSET, + filtercoloreq: Union[Unset, str] = UNSET, + filtercolornot_eq: Union[Unset, str] = UNSET, + filtercolorin: Union[Unset, str] = UNSET, + filtercolornot_in: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, +) -> Optional[SeverityList]: """List severities List severities Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterseverity (str | Unset): - filtercolor (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filterseverityeq (str | Unset): - filterseveritynot_eq (str | Unset): - filterseverityin (str | Unset): - filterseveritynot_in (str | Unset): - filtercoloreq (str | Unset): - filtercolornot_eq (str | Unset): - filtercolorin (str | Unset): - filtercolornot_in (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterseverity (Union[Unset, str]): + filtercolor (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filterseverityeq (Union[Unset, str]): + filterseveritynot_eq (Union[Unset, str]): + filterseverityin (Union[Unset, str]): + filterseveritynot_in (Union[Unset, str]): + filtercoloreq (Union[Unset, str]): + filtercolornot_eq (Union[Unset, str]): + filtercolorin (Union[Unset, str]): + filtercolornot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -362,70 +361,70 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterseverity: str | Unset = UNSET, - filtercolor: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filterseverityeq: str | Unset = UNSET, - filterseveritynot_eq: str | Unset = UNSET, - filterseverityin: str | Unset = UNSET, - filterseveritynot_in: str | Unset = UNSET, - filtercoloreq: str | Unset = UNSET, - filtercolornot_eq: str | Unset = UNSET, - filtercolorin: str | Unset = UNSET, - filtercolornot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterseverity: Union[Unset, str] = UNSET, + filtercolor: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filterslugeq: Union[Unset, str] = UNSET, + filterslugnot_eq: Union[Unset, str] = UNSET, + filterslugin: Union[Unset, str] = UNSET, + filterslugnot_in: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, + filterseverityeq: Union[Unset, str] = UNSET, + filterseveritynot_eq: Union[Unset, str] = UNSET, + filterseverityin: Union[Unset, str] = UNSET, + filterseveritynot_in: Union[Unset, str] = UNSET, + filtercoloreq: Union[Unset, str] = UNSET, + filtercolornot_eq: Union[Unset, str] = UNSET, + filtercolorin: Union[Unset, str] = UNSET, + filtercolornot_in: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, ) -> Response[SeverityList]: """List severities List severities Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterseverity (str | Unset): - filtercolor (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filterseverityeq (str | Unset): - filterseveritynot_eq (str | Unset): - filterseverityin (str | Unset): - filterseveritynot_in (str | Unset): - filtercoloreq (str | Unset): - filtercolornot_eq (str | Unset): - filtercolorin (str | Unset): - filtercolornot_in (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterseverity (Union[Unset, str]): + filtercolor (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filterseverityeq (Union[Unset, str]): + filterseveritynot_eq (Union[Unset, str]): + filterseverityin (Union[Unset, str]): + filterseveritynot_in (Union[Unset, str]): + filtercoloreq (Union[Unset, str]): + filtercolornot_eq (Union[Unset, str]): + filtercolorin (Union[Unset, str]): + filtercolornot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -475,70 +474,70 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterseverity: str | Unset = UNSET, - filtercolor: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filterseverityeq: str | Unset = UNSET, - filterseveritynot_eq: str | Unset = UNSET, - filterseverityin: str | Unset = UNSET, - filterseveritynot_in: str | Unset = UNSET, - filtercoloreq: str | Unset = UNSET, - filtercolornot_eq: str | Unset = UNSET, - filtercolorin: str | Unset = UNSET, - filtercolornot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, -) -> SeverityList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterseverity: Union[Unset, str] = UNSET, + filtercolor: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filterslugeq: Union[Unset, str] = UNSET, + filterslugnot_eq: Union[Unset, str] = UNSET, + filterslugin: Union[Unset, str] = UNSET, + filterslugnot_in: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, + filterseverityeq: Union[Unset, str] = UNSET, + filterseveritynot_eq: Union[Unset, str] = UNSET, + filterseverityin: Union[Unset, str] = UNSET, + filterseveritynot_in: Union[Unset, str] = UNSET, + filtercoloreq: Union[Unset, str] = UNSET, + filtercolornot_eq: Union[Unset, str] = UNSET, + filtercolorin: Union[Unset, str] = UNSET, + filtercolornot_in: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, +) -> Optional[SeverityList]: """List severities List severities Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterseverity (str | Unset): - filtercolor (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filterseverityeq (str | Unset): - filterseveritynot_eq (str | Unset): - filterseverityin (str | Unset): - filterseveritynot_in (str | Unset): - filtercoloreq (str | Unset): - filtercolornot_eq (str | Unset): - filtercolorin (str | Unset): - filtercolornot_in (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterseverity (Union[Unset, str]): + filtercolor (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filterseverityeq (Union[Unset, str]): + filterseveritynot_eq (Union[Unset, str]): + filterseverityin (Union[Unset, str]): + filterseveritynot_in (Union[Unset, str]): + filtercoloreq (Union[Unset, str]): + filtercolornot_eq (Union[Unset, str]): + filtercolorin (Union[Unset, str]): + filtercolornot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/severities/update_severity.py b/rootly_sdk/api/severities/update_severity.py index d1794033..900f77d4 100644 --- a/rootly_sdk/api/severities/update_severity.py +++ b/rootly_sdk/api/severities/update_severity.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union from uuid import UUID import httpx @@ -14,7 +13,7 @@ def _get_kwargs( - id: str | UUID, + id: Union[UUID, str], *, body: UpdateSeverity, ) -> dict[str, Any]: @@ -22,9 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/severities/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/severities/{id}", } _kwargs["json"] = body.to_dict() @@ -36,8 +33,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | SeverityResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, SeverityResponse]]: if response.status_code == 200: response_200 = SeverityResponse.from_dict(response.json()) @@ -55,8 +52,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | SeverityResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, SeverityResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,17 +63,17 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdateSeverity, -) -> Response[ErrorsList | SeverityResponse]: +) -> Response[Union[ErrorsList, SeverityResponse]]: """Update a severity Update a specific severity by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateSeverity): Raises: @@ -84,7 +81,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | SeverityResponse] + Response[Union[ErrorsList, SeverityResponse]] """ kwargs = _get_kwargs( @@ -100,17 +97,17 @@ def sync_detailed( def sync( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdateSeverity, -) -> ErrorsList | SeverityResponse | None: +) -> Optional[Union[ErrorsList, SeverityResponse]]: """Update a severity Update a specific severity by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateSeverity): Raises: @@ -118,7 +115,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | SeverityResponse + Union[ErrorsList, SeverityResponse] """ return sync_detailed( @@ -129,17 +126,17 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdateSeverity, -) -> Response[ErrorsList | SeverityResponse]: +) -> Response[Union[ErrorsList, SeverityResponse]]: """Update a severity Update a specific severity by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateSeverity): Raises: @@ -147,7 +144,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | SeverityResponse] + Response[Union[ErrorsList, SeverityResponse]] """ kwargs = _get_kwargs( @@ -161,17 +158,17 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdateSeverity, -) -> ErrorsList | SeverityResponse | None: +) -> Optional[Union[ErrorsList, SeverityResponse]]: """Update a severity Update a specific severity by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateSeverity): Raises: @@ -179,7 +176,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | SeverityResponse + Union[ErrorsList, SeverityResponse] """ return ( diff --git a/rootly_sdk/api/shift_coverage_requests/create_shift_coverage_request.py b/rootly_sdk/api/shift_coverage_requests/create_shift_coverage_request.py index 422f1a19..6ff99b3e 100644 --- a/rootly_sdk/api/shift_coverage_requests/create_shift_coverage_request.py +++ b/rootly_sdk/api/shift_coverage_requests/create_shift_coverage_request.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/schedules/{schedule_id}/shift_coverage_requests".format( - schedule_id=quote(str(schedule_id), safe=""), - ), + "url": f"/v1/schedules/{schedule_id}/shift_coverage_requests", } _kwargs["json"] = body.to_dict() @@ -35,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | ShiftCoverageRequestList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, ShiftCoverageRequestList]]: if response.status_code == 201: response_201 = ShiftCoverageRequestList.from_dict(response.json()) @@ -54,8 +51,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | ShiftCoverageRequestList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, ShiftCoverageRequestList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewShiftCoverageRequest, -) -> Response[ErrorsList | ShiftCoverageRequestList]: +) -> Response[Union[ErrorsList, ShiftCoverageRequestList]]: """creates shift coverage requests Creates coverage requests for the shifts overlapping the requested time range. A range can span @@ -86,7 +83,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | ShiftCoverageRequestList] + Response[Union[ErrorsList, ShiftCoverageRequestList]] """ kwargs = _get_kwargs( @@ -106,7 +103,7 @@ def sync( *, client: AuthenticatedClient, body: NewShiftCoverageRequest, -) -> ErrorsList | ShiftCoverageRequestList | None: +) -> Optional[Union[ErrorsList, ShiftCoverageRequestList]]: """creates shift coverage requests Creates coverage requests for the shifts overlapping the requested time range. A range can span @@ -123,7 +120,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | ShiftCoverageRequestList + Union[ErrorsList, ShiftCoverageRequestList] """ return sync_detailed( @@ -138,7 +135,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewShiftCoverageRequest, -) -> Response[ErrorsList | ShiftCoverageRequestList]: +) -> Response[Union[ErrorsList, ShiftCoverageRequestList]]: """creates shift coverage requests Creates coverage requests for the shifts overlapping the requested time range. A range can span @@ -155,7 +152,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | ShiftCoverageRequestList] + Response[Union[ErrorsList, ShiftCoverageRequestList]] """ kwargs = _get_kwargs( @@ -173,7 +170,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewShiftCoverageRequest, -) -> ErrorsList | ShiftCoverageRequestList | None: +) -> Optional[Union[ErrorsList, ShiftCoverageRequestList]]: """creates shift coverage requests Creates coverage requests for the shifts overlapping the requested time range. A range can span @@ -190,7 +187,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | ShiftCoverageRequestList + Union[ErrorsList, ShiftCoverageRequestList] """ return ( diff --git a/rootly_sdk/api/shift_coverage_requests/delete_shift_coverage_request.py b/rootly_sdk/api/shift_coverage_requests/delete_shift_coverage_request.py index af89d0d5..ad36be34 100644 --- a/rootly_sdk/api/shift_coverage_requests/delete_shift_coverage_request.py +++ b/rootly_sdk/api/shift_coverage_requests/delete_shift_coverage_request.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -13,20 +12,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/shift_coverage_requests/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/shift_coverage_requests/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ShiftCoverageRequestResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[ShiftCoverageRequestResponse]: if response.status_code == 200: response_200 = ShiftCoverageRequestResponse.from_dict(response.json()) @@ -39,7 +35,7 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[ShiftCoverageRequestResponse]: return Response( status_code=HTTPStatus(response.status_code), @@ -84,7 +80,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> ShiftCoverageRequestResponse | None: +) -> Optional[ShiftCoverageRequestResponse]: """deletes a shift coverage request Deletes a shift coverage request. @@ -139,7 +135,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> ShiftCoverageRequestResponse | None: +) -> Optional[ShiftCoverageRequestResponse]: """deletes a shift coverage request Deletes a shift coverage request. diff --git a/rootly_sdk/api/shift_coverage_requests/get_shift_coverage_request.py b/rootly_sdk/api/shift_coverage_requests/get_shift_coverage_request.py index b841df57..3309d75b 100644 --- a/rootly_sdk/api/shift_coverage_requests/get_shift_coverage_request.py +++ b/rootly_sdk/api/shift_coverage_requests/get_shift_coverage_request.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -13,20 +12,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/shift_coverage_requests/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/shift_coverage_requests/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ShiftCoverageRequestResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[ShiftCoverageRequestResponse]: if response.status_code == 200: response_200 = ShiftCoverageRequestResponse.from_dict(response.json()) @@ -39,7 +35,7 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[ShiftCoverageRequestResponse]: return Response( status_code=HTTPStatus(response.status_code), @@ -84,7 +80,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> ShiftCoverageRequestResponse | None: +) -> Optional[ShiftCoverageRequestResponse]: """retrieves a shift coverage request Retrieves a specific shift coverage request. @@ -139,7 +135,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> ShiftCoverageRequestResponse | None: +) -> Optional[ShiftCoverageRequestResponse]: """retrieves a shift coverage request Retrieves a specific shift coverage request. diff --git a/rootly_sdk/api/shift_coverage_requests/list_shift_coverage_requests.py b/rootly_sdk/api/shift_coverage_requests/list_shift_coverage_requests.py index 62355c3a..5e118cd4 100644 --- a/rootly_sdk/api/shift_coverage_requests/list_shift_coverage_requests.py +++ b/rootly_sdk/api/shift_coverage_requests/list_shift_coverage_requests.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -13,20 +12,17 @@ def _get_kwargs( schedule_id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/schedules/{schedule_id}/shift_coverage_requests".format( - schedule_id=quote(str(schedule_id), safe=""), - ), + "url": f"/v1/schedules/{schedule_id}/shift_coverage_requests", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ShiftCoverageRequestList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[ShiftCoverageRequestList]: if response.status_code == 200: response_200 = ShiftCoverageRequestList.from_dict(response.json()) @@ -39,7 +35,7 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[ShiftCoverageRequestList]: return Response( status_code=HTTPStatus(response.status_code), @@ -84,7 +80,7 @@ def sync( schedule_id: str, *, client: AuthenticatedClient, -) -> ShiftCoverageRequestList | None: +) -> Optional[ShiftCoverageRequestList]: """list shift coverage requests List active shift coverage requests for a schedule. @@ -139,7 +135,7 @@ async def asyncio( schedule_id: str, *, client: AuthenticatedClient, -) -> ShiftCoverageRequestList | None: +) -> Optional[ShiftCoverageRequestList]: """list shift coverage requests List active shift coverage requests for a schedule. diff --git a/rootly_sdk/api/shifts/get_schedule_shifts.py b/rootly_sdk/api/shifts/get_schedule_shifts.py index e263871a..f1f858fd 100644 --- a/rootly_sdk/api/shifts/get_schedule_shifts.py +++ b/rootly_sdk/api/shifts/get_schedule_shifts.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,10 +13,9 @@ def _get_kwargs( id: str, *, - to: str | Unset = UNSET, - from_: str | Unset = UNSET, + to: Union[Unset, str] = UNSET, + from_: Union[Unset, str] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["to"] = to @@ -28,16 +26,16 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/schedules/{id}/shifts".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/schedules/{id}/shifts", "params": params, } return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> ErrorsList | ShiftList | None: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, ShiftList]]: if response.status_code == 200: response_200 = ShiftList.from_dict(response.json()) @@ -55,8 +53,8 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | ShiftList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, ShiftList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,24 +67,24 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, - to: str | Unset = UNSET, - from_: str | Unset = UNSET, -) -> Response[ErrorsList | ShiftList]: + to: Union[Unset, str] = UNSET, + from_: Union[Unset, str] = UNSET, +) -> Response[Union[ErrorsList, ShiftList]]: """Retrieves a schedule shifts Retrieves schedule shifts Args: id (str): - to (str | Unset): - from_ (str | Unset): + to (Union[Unset, str]): + from_ (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | ShiftList] + Response[Union[ErrorsList, ShiftList]] """ kwargs = _get_kwargs( @@ -106,24 +104,24 @@ def sync( id: str, *, client: AuthenticatedClient, - to: str | Unset = UNSET, - from_: str | Unset = UNSET, -) -> ErrorsList | ShiftList | None: + to: Union[Unset, str] = UNSET, + from_: Union[Unset, str] = UNSET, +) -> Optional[Union[ErrorsList, ShiftList]]: """Retrieves a schedule shifts Retrieves schedule shifts Args: id (str): - to (str | Unset): - from_ (str | Unset): + to (Union[Unset, str]): + from_ (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | ShiftList + Union[ErrorsList, ShiftList] """ return sync_detailed( @@ -138,24 +136,24 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, - to: str | Unset = UNSET, - from_: str | Unset = UNSET, -) -> Response[ErrorsList | ShiftList]: + to: Union[Unset, str] = UNSET, + from_: Union[Unset, str] = UNSET, +) -> Response[Union[ErrorsList, ShiftList]]: """Retrieves a schedule shifts Retrieves schedule shifts Args: id (str): - to (str | Unset): - from_ (str | Unset): + to (Union[Unset, str]): + from_ (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | ShiftList] + Response[Union[ErrorsList, ShiftList]] """ kwargs = _get_kwargs( @@ -173,24 +171,24 @@ async def asyncio( id: str, *, client: AuthenticatedClient, - to: str | Unset = UNSET, - from_: str | Unset = UNSET, -) -> ErrorsList | ShiftList | None: + to: Union[Unset, str] = UNSET, + from_: Union[Unset, str] = UNSET, +) -> Optional[Union[ErrorsList, ShiftList]]: """Retrieves a schedule shifts Retrieves schedule shifts Args: id (str): - to (str | Unset): - from_ (str | Unset): + to (Union[Unset, str]): + from_ (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | ShiftList + Union[ErrorsList, ShiftList] """ return ( diff --git a/rootly_sdk/api/shifts/list_shifts.py b/rootly_sdk/api/shifts/list_shifts.py index 33fbd52d..8af3168b 100644 --- a/rootly_sdk/api/shifts/list_shifts.py +++ b/rootly_sdk/api/shifts/list_shifts.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -13,18 +13,17 @@ def _get_kwargs( *, - include: ListShiftsInclude | Unset = UNSET, - from_: str | Unset = UNSET, - to: str | Unset = UNSET, - user_ids: list[int] | Unset = UNSET, - schedule_ids: list[str] | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Union[Unset, ListShiftsInclude] = UNSET, + from_: Union[Unset, str] = UNSET, + to: Union[Unset, str] = UNSET, + user_ids: Union[Unset, list[int]] = UNSET, + schedule_ids: Union[Unset, list[str]] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} - json_include: str | Unset = UNSET + json_include: Union[Unset, str] = UNSET if not isinstance(include, Unset): json_include = include @@ -34,13 +33,13 @@ def _get_kwargs( params["to"] = to - json_user_ids: list[int] | Unset = UNSET + json_user_ids: Union[Unset, list[int]] = UNSET if not isinstance(user_ids, Unset): json_user_ids = user_ids params["user_ids[]"] = json_user_ids - json_schedule_ids: list[str] | Unset = UNSET + json_schedule_ids: Union[Unset, list[str]] = UNSET if not isinstance(schedule_ids, Unset): json_schedule_ids = schedule_ids @@ -61,7 +60,9 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> ErrorsList | ShiftList | None: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, ShiftList]]: if response.status_code == 200: response_200 = ShiftList.from_dict(response.json()) @@ -79,8 +80,8 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | ShiftList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, ShiftList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -92,33 +93,33 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - include: ListShiftsInclude | Unset = UNSET, - from_: str | Unset = UNSET, - to: str | Unset = UNSET, - user_ids: list[int] | Unset = UNSET, - schedule_ids: list[str] | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, -) -> Response[ErrorsList | ShiftList]: + include: Union[Unset, ListShiftsInclude] = UNSET, + from_: Union[Unset, str] = UNSET, + to: Union[Unset, str] = UNSET, + user_ids: Union[Unset, list[int]] = UNSET, + schedule_ids: Union[Unset, list[str]] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, +) -> Response[Union[ErrorsList, ShiftList]]: """List shifts List shifts Args: - include (ListShiftsInclude | Unset): - from_ (str | Unset): - to (str | Unset): - user_ids (list[int] | Unset): - schedule_ids (list[str] | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, ListShiftsInclude]): + from_ (Union[Unset, str]): + to (Union[Unset, str]): + user_ids (Union[Unset, list[int]]): + schedule_ids (Union[Unset, list[str]]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | ShiftList] + Response[Union[ErrorsList, ShiftList]] """ kwargs = _get_kwargs( @@ -141,33 +142,33 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: ListShiftsInclude | Unset = UNSET, - from_: str | Unset = UNSET, - to: str | Unset = UNSET, - user_ids: list[int] | Unset = UNSET, - schedule_ids: list[str] | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, -) -> ErrorsList | ShiftList | None: + include: Union[Unset, ListShiftsInclude] = UNSET, + from_: Union[Unset, str] = UNSET, + to: Union[Unset, str] = UNSET, + user_ids: Union[Unset, list[int]] = UNSET, + schedule_ids: Union[Unset, list[str]] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, +) -> Optional[Union[ErrorsList, ShiftList]]: """List shifts List shifts Args: - include (ListShiftsInclude | Unset): - from_ (str | Unset): - to (str | Unset): - user_ids (list[int] | Unset): - schedule_ids (list[str] | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, ListShiftsInclude]): + from_ (Union[Unset, str]): + to (Union[Unset, str]): + user_ids (Union[Unset, list[int]]): + schedule_ids (Union[Unset, list[str]]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | ShiftList + Union[ErrorsList, ShiftList] """ return sync_detailed( @@ -185,33 +186,33 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: ListShiftsInclude | Unset = UNSET, - from_: str | Unset = UNSET, - to: str | Unset = UNSET, - user_ids: list[int] | Unset = UNSET, - schedule_ids: list[str] | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, -) -> Response[ErrorsList | ShiftList]: + include: Union[Unset, ListShiftsInclude] = UNSET, + from_: Union[Unset, str] = UNSET, + to: Union[Unset, str] = UNSET, + user_ids: Union[Unset, list[int]] = UNSET, + schedule_ids: Union[Unset, list[str]] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, +) -> Response[Union[ErrorsList, ShiftList]]: """List shifts List shifts Args: - include (ListShiftsInclude | Unset): - from_ (str | Unset): - to (str | Unset): - user_ids (list[int] | Unset): - schedule_ids (list[str] | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, ListShiftsInclude]): + from_ (Union[Unset, str]): + to (Union[Unset, str]): + user_ids (Union[Unset, list[int]]): + schedule_ids (Union[Unset, list[str]]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | ShiftList] + Response[Union[ErrorsList, ShiftList]] """ kwargs = _get_kwargs( @@ -232,33 +233,33 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: ListShiftsInclude | Unset = UNSET, - from_: str | Unset = UNSET, - to: str | Unset = UNSET, - user_ids: list[int] | Unset = UNSET, - schedule_ids: list[str] | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, -) -> ErrorsList | ShiftList | None: + include: Union[Unset, ListShiftsInclude] = UNSET, + from_: Union[Unset, str] = UNSET, + to: Union[Unset, str] = UNSET, + user_ids: Union[Unset, list[int]] = UNSET, + schedule_ids: Union[Unset, list[str]] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, +) -> Optional[Union[ErrorsList, ShiftList]]: """List shifts List shifts Args: - include (ListShiftsInclude | Unset): - from_ (str | Unset): - to (str | Unset): - user_ids (list[int] | Unset): - schedule_ids (list[str] | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, ListShiftsInclude]): + from_ (Union[Unset, str]): + to (Union[Unset, str]): + user_ids (Union[Unset, list[int]]): + schedule_ids (Union[Unset, list[str]]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | ShiftList + Union[ErrorsList, ShiftList] """ return ( diff --git a/rootly_sdk/api/sl_as/create_sla.py b/rootly_sdk/api/sl_as/create_sla.py index 578b60d8..6a5a53a1 100644 --- a/rootly_sdk/api/sl_as/create_sla.py +++ b/rootly_sdk/api/sl_as/create_sla.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | SlaResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, SlaResponse]]: if response.status_code == 201: response_201 = SlaResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | SlaResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, SlaResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +69,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewSla, -) -> Response[ErrorsList | SlaResponse]: +) -> Response[Union[ErrorsList, SlaResponse]]: """Creates an SLA Creates a new SLA from provided data @@ -82,7 +82,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | SlaResponse] + Response[Union[ErrorsList, SlaResponse]] """ kwargs = _get_kwargs( @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: NewSla, -) -> ErrorsList | SlaResponse | None: +) -> Optional[Union[ErrorsList, SlaResponse]]: """Creates an SLA Creates a new SLA from provided data @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | SlaResponse + Union[ErrorsList, SlaResponse] """ return sync_detailed( @@ -126,7 +126,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewSla, -) -> Response[ErrorsList | SlaResponse]: +) -> Response[Union[ErrorsList, SlaResponse]]: """Creates an SLA Creates a new SLA from provided data @@ -139,7 +139,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | SlaResponse] + Response[Union[ErrorsList, SlaResponse]] """ kwargs = _get_kwargs( @@ -155,7 +155,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewSla, -) -> ErrorsList | SlaResponse | None: +) -> Optional[Union[ErrorsList, SlaResponse]]: """Creates an SLA Creates a new SLA from provided data @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | SlaResponse + Union[ErrorsList, SlaResponse] """ return ( diff --git a/rootly_sdk/api/sl_as/delete_sla.py b/rootly_sdk/api/sl_as/delete_sla.py index 19b1e4eb..0b9a5ae8 100644 --- a/rootly_sdk/api/sl_as/delete_sla.py +++ b/rootly_sdk/api/sl_as/delete_sla.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/slas/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/slas/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | SlaResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, SlaResponse]]: if response.status_code == 200: response_200 = SlaResponse.from_dict(response.json()) @@ -45,8 +41,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | SlaResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, SlaResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | SlaResponse]: +) -> Response[Union[ErrorsList, SlaResponse]]: """Delete an SLA Delete a specific SLA by id @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | SlaResponse] + Response[Union[ErrorsList, SlaResponse]] """ kwargs = _get_kwargs( @@ -90,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | SlaResponse | None: +) -> Optional[Union[ErrorsList, SlaResponse]]: """Delete an SLA Delete a specific SLA by id @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | SlaResponse + Union[ErrorsList, SlaResponse] """ return sync_detailed( @@ -116,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | SlaResponse]: +) -> Response[Union[ErrorsList, SlaResponse]]: """Delete an SLA Delete a specific SLA by id @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | SlaResponse] + Response[Union[ErrorsList, SlaResponse]] """ kwargs = _get_kwargs( @@ -145,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | SlaResponse | None: +) -> Optional[Union[ErrorsList, SlaResponse]]: """Delete an SLA Delete a specific SLA by id @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | SlaResponse + Union[ErrorsList, SlaResponse] """ return ( diff --git a/rootly_sdk/api/sl_as/get_sla.py b/rootly_sdk/api/sl_as/get_sla.py index b2dcad6d..4ebaae43 100644 --- a/rootly_sdk/api/sl_as/get_sla.py +++ b/rootly_sdk/api/sl_as/get_sla.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/slas/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/slas/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | SlaResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, SlaResponse]]: if response.status_code == 200: response_200 = SlaResponse.from_dict(response.json()) @@ -45,8 +41,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | SlaResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, SlaResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | SlaResponse]: +) -> Response[Union[ErrorsList, SlaResponse]]: """Retrieves an SLA Retrieves a specific SLA by id @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | SlaResponse] + Response[Union[ErrorsList, SlaResponse]] """ kwargs = _get_kwargs( @@ -90,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | SlaResponse | None: +) -> Optional[Union[ErrorsList, SlaResponse]]: """Retrieves an SLA Retrieves a specific SLA by id @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | SlaResponse + Union[ErrorsList, SlaResponse] """ return sync_detailed( @@ -116,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | SlaResponse]: +) -> Response[Union[ErrorsList, SlaResponse]]: """Retrieves an SLA Retrieves a specific SLA by id @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | SlaResponse] + Response[Union[ErrorsList, SlaResponse]] """ kwargs = _get_kwargs( @@ -145,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | SlaResponse | None: +) -> Optional[Union[ErrorsList, SlaResponse]]: """Retrieves an SLA Retrieves a specific SLA by id @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | SlaResponse + Union[ErrorsList, SlaResponse] """ return ( diff --git a/rootly_sdk/api/sl_as/list_sl_as.py b/rootly_sdk/api/sl_as/list_sl_as.py index d7f57b0a..6c9e7694 100644 --- a/rootly_sdk/api/sl_as/list_sl_as.py +++ b/rootly_sdk/api/sl_as/list_sl_as.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -11,26 +11,25 @@ def _get_kwargs( *, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filterslugeq: Union[Unset, str] = UNSET, + filterslugnot_eq: Union[Unset, str] = UNSET, + filterslugin: Union[Unset, str] = UNSET, + filterslugnot_in: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["page[number]"] = pagenumber @@ -80,7 +79,7 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> SlaList | None: +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[SlaList]: if response.status_code == 200: response_200 = SlaList.from_dict(response.json()) @@ -92,7 +91,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[SlaList]: +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[SlaList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -104,48 +103,48 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filterslugeq: Union[Unset, str] = UNSET, + filterslugnot_eq: Union[Unset, str] = UNSET, + filterslugin: Union[Unset, str] = UNSET, + filterslugnot_in: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, ) -> Response[SlaList]: """List SLAs List SLAs Args: - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - sort (str | Unset): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -186,48 +185,48 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, -) -> SlaList | None: + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filterslugeq: Union[Unset, str] = UNSET, + filterslugnot_eq: Union[Unset, str] = UNSET, + filterslugin: Union[Unset, str] = UNSET, + filterslugnot_in: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, +) -> Optional[SlaList]: """List SLAs List SLAs Args: - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - sort (str | Unset): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -263,48 +262,48 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filterslugeq: Union[Unset, str] = UNSET, + filterslugnot_eq: Union[Unset, str] = UNSET, + filterslugin: Union[Unset, str] = UNSET, + filterslugnot_in: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, ) -> Response[SlaList]: """List SLAs List SLAs Args: - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - sort (str | Unset): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -343,48 +342,48 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, -) -> SlaList | None: + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filterslugeq: Union[Unset, str] = UNSET, + filterslugnot_eq: Union[Unset, str] = UNSET, + filterslugin: Union[Unset, str] = UNSET, + filterslugnot_in: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, +) -> Optional[SlaList]: """List SLAs List SLAs Args: - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - sort (str | Unset): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/sl_as/update_sla.py b/rootly_sdk/api/sl_as/update_sla.py index f168bfc9..b23291a7 100644 --- a/rootly_sdk/api/sl_as/update_sla.py +++ b/rootly_sdk/api/sl_as/update_sla.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/slas/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/slas/{id}", } _kwargs["json"] = body.to_dict() @@ -35,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | SlaResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, SlaResponse]]: if response.status_code == 200: response_200 = SlaResponse.from_dict(response.json()) @@ -54,8 +51,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | SlaResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, SlaResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateSla, -) -> Response[ErrorsList | SlaResponse]: +) -> Response[Union[ErrorsList, SlaResponse]]: """Update an SLA Update a specific SLA by id @@ -83,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | SlaResponse] + Response[Union[ErrorsList, SlaResponse]] """ kwargs = _get_kwargs( @@ -103,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateSla, -) -> ErrorsList | SlaResponse | None: +) -> Optional[Union[ErrorsList, SlaResponse]]: """Update an SLA Update a specific SLA by id @@ -117,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | SlaResponse + Union[ErrorsList, SlaResponse] """ return sync_detailed( @@ -132,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateSla, -) -> Response[ErrorsList | SlaResponse]: +) -> Response[Union[ErrorsList, SlaResponse]]: """Update an SLA Update a specific SLA by id @@ -146,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | SlaResponse] + Response[Union[ErrorsList, SlaResponse]] """ kwargs = _get_kwargs( @@ -164,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateSla, -) -> ErrorsList | SlaResponse | None: +) -> Optional[Union[ErrorsList, SlaResponse]]: """Update an SLA Update a specific SLA by id @@ -178,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | SlaResponse + Union[ErrorsList, SlaResponse] """ return ( diff --git a/rootly_sdk/api/status_page_announcements/__init__.py b/rootly_sdk/api/status_page_announcements/__init__.py new file mode 100644 index 00000000..2d7c0b23 --- /dev/null +++ b/rootly_sdk/api/status_page_announcements/__init__.py @@ -0,0 +1 @@ +"""Contains endpoint functions for accessing the API""" diff --git a/rootly_sdk/api/status_page_announcements/create_status_page_announcement.py b/rootly_sdk/api/status_page_announcements/create_status_page_announcement.py new file mode 100644 index 00000000..390347ba --- /dev/null +++ b/rootly_sdk/api/status_page_announcements/create_status_page_announcement.py @@ -0,0 +1,196 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.errors_list import ErrorsList +from ...models.new_status_page_announcement import NewStatusPageAnnouncement +from ...models.status_page_announcement_response import StatusPageAnnouncementResponse +from ...types import Response + + +def _get_kwargs( + status_page_id: str, + *, + body: NewStatusPageAnnouncement, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": f"/v1/status-pages/{status_page_id}/announcements", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/vnd.api+json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, StatusPageAnnouncementResponse]]: + if response.status_code == 201: + response_201 = StatusPageAnnouncementResponse.from_dict(response.json()) + + return response_201 + + if response.status_code == 401: + response_401 = ErrorsList.from_dict(response.json()) + + return response_401 + + if response.status_code == 422: + response_422 = ErrorsList.from_dict(response.json()) + + return response_422 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, StatusPageAnnouncementResponse]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + status_page_id: str, + *, + client: AuthenticatedClient, + body: NewStatusPageAnnouncement, +) -> Response[Union[ErrorsList, StatusPageAnnouncementResponse]]: + """Creates a status page announcement + + Posts an announcement to a status page and notifies its subscribers unless notify_subscribers is + false + + Args: + status_page_id (str): + body (NewStatusPageAnnouncement): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[ErrorsList, StatusPageAnnouncementResponse]] + """ + + kwargs = _get_kwargs( + status_page_id=status_page_id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + status_page_id: str, + *, + client: AuthenticatedClient, + body: NewStatusPageAnnouncement, +) -> Optional[Union[ErrorsList, StatusPageAnnouncementResponse]]: + """Creates a status page announcement + + Posts an announcement to a status page and notifies its subscribers unless notify_subscribers is + false + + Args: + status_page_id (str): + body (NewStatusPageAnnouncement): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[ErrorsList, StatusPageAnnouncementResponse] + """ + + return sync_detailed( + status_page_id=status_page_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + status_page_id: str, + *, + client: AuthenticatedClient, + body: NewStatusPageAnnouncement, +) -> Response[Union[ErrorsList, StatusPageAnnouncementResponse]]: + """Creates a status page announcement + + Posts an announcement to a status page and notifies its subscribers unless notify_subscribers is + false + + Args: + status_page_id (str): + body (NewStatusPageAnnouncement): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[ErrorsList, StatusPageAnnouncementResponse]] + """ + + kwargs = _get_kwargs( + status_page_id=status_page_id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + status_page_id: str, + *, + client: AuthenticatedClient, + body: NewStatusPageAnnouncement, +) -> Optional[Union[ErrorsList, StatusPageAnnouncementResponse]]: + """Creates a status page announcement + + Posts an announcement to a status page and notifies its subscribers unless notify_subscribers is + false + + Args: + status_page_id (str): + body (NewStatusPageAnnouncement): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[ErrorsList, StatusPageAnnouncementResponse] + """ + + return ( + await asyncio_detailed( + status_page_id=status_page_id, + client=client, + body=body, + ) + ).parsed diff --git a/rootly_sdk/api/status_page_announcements/delete_status_page_announcement.py b/rootly_sdk/api/status_page_announcements/delete_status_page_announcement.py new file mode 100644 index 00000000..542649c9 --- /dev/null +++ b/rootly_sdk/api/status_page_announcements/delete_status_page_announcement.py @@ -0,0 +1,165 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.errors_list import ErrorsList +from ...models.status_page_announcement_response import StatusPageAnnouncementResponse +from ...types import Response + + +def _get_kwargs( + id: str, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "delete", + "url": f"/v1/announcements/{id}", + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, StatusPageAnnouncementResponse]]: + if response.status_code == 200: + response_200 = StatusPageAnnouncementResponse.from_dict(response.json()) + + return response_200 + + if response.status_code == 404: + response_404 = ErrorsList.from_dict(response.json()) + + return response_404 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, StatusPageAnnouncementResponse]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: str, + *, + client: AuthenticatedClient, +) -> Response[Union[ErrorsList, StatusPageAnnouncementResponse]]: + """Delete a status page announcement + + Delete a specific status page announcement by id + + Args: + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[ErrorsList, StatusPageAnnouncementResponse]] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: str, + *, + client: AuthenticatedClient, +) -> Optional[Union[ErrorsList, StatusPageAnnouncementResponse]]: + """Delete a status page announcement + + Delete a specific status page announcement by id + + Args: + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[ErrorsList, StatusPageAnnouncementResponse] + """ + + return sync_detailed( + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + id: str, + *, + client: AuthenticatedClient, +) -> Response[Union[ErrorsList, StatusPageAnnouncementResponse]]: + """Delete a status page announcement + + Delete a specific status page announcement by id + + Args: + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[ErrorsList, StatusPageAnnouncementResponse]] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: str, + *, + client: AuthenticatedClient, +) -> Optional[Union[ErrorsList, StatusPageAnnouncementResponse]]: + """Delete a status page announcement + + Delete a specific status page announcement by id + + Args: + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[ErrorsList, StatusPageAnnouncementResponse] + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + ) + ).parsed diff --git a/rootly_sdk/api/status_page_announcements/get_status_page_announcement.py b/rootly_sdk/api/status_page_announcements/get_status_page_announcement.py new file mode 100644 index 00000000..1c6c6bd8 --- /dev/null +++ b/rootly_sdk/api/status_page_announcements/get_status_page_announcement.py @@ -0,0 +1,165 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.errors_list import ErrorsList +from ...models.status_page_announcement_response import StatusPageAnnouncementResponse +from ...types import Response + + +def _get_kwargs( + id: str, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "get", + "url": f"/v1/announcements/{id}", + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, StatusPageAnnouncementResponse]]: + if response.status_code == 200: + response_200 = StatusPageAnnouncementResponse.from_dict(response.json()) + + return response_200 + + if response.status_code == 404: + response_404 = ErrorsList.from_dict(response.json()) + + return response_404 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, StatusPageAnnouncementResponse]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: str, + *, + client: AuthenticatedClient, +) -> Response[Union[ErrorsList, StatusPageAnnouncementResponse]]: + """Retrieves a status page announcement + + Retrieves a specific status page announcement by id + + Args: + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[ErrorsList, StatusPageAnnouncementResponse]] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: str, + *, + client: AuthenticatedClient, +) -> Optional[Union[ErrorsList, StatusPageAnnouncementResponse]]: + """Retrieves a status page announcement + + Retrieves a specific status page announcement by id + + Args: + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[ErrorsList, StatusPageAnnouncementResponse] + """ + + return sync_detailed( + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + id: str, + *, + client: AuthenticatedClient, +) -> Response[Union[ErrorsList, StatusPageAnnouncementResponse]]: + """Retrieves a status page announcement + + Retrieves a specific status page announcement by id + + Args: + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[ErrorsList, StatusPageAnnouncementResponse]] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: str, + *, + client: AuthenticatedClient, +) -> Optional[Union[ErrorsList, StatusPageAnnouncementResponse]]: + """Retrieves a status page announcement + + Retrieves a specific status page announcement by id + + Args: + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[ErrorsList, StatusPageAnnouncementResponse] + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + ) + ).parsed diff --git a/rootly_sdk/api/status_page_announcements/list_status_page_announcements.py b/rootly_sdk/api/status_page_announcements/list_status_page_announcements.py new file mode 100644 index 00000000..1088c155 --- /dev/null +++ b/rootly_sdk/api/status_page_announcements/list_status_page_announcements.py @@ -0,0 +1,210 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.status_page_announcement_list import StatusPageAnnouncementList +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + status_page_id: str, + *, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["include"] = include + + params["page[number]"] = pagenumber + + params["page[size]"] = pagesize + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": f"/v1/status-pages/{status_page_id}/announcements", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[StatusPageAnnouncementList]: + if response.status_code == 200: + response_200 = StatusPageAnnouncementList.from_dict(response.json()) + + return response_200 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[StatusPageAnnouncementList]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + status_page_id: str, + *, + client: AuthenticatedClient, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, +) -> Response[StatusPageAnnouncementList]: + """List status page announcements + + List status page announcements + + Args: + status_page_id (str): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[StatusPageAnnouncementList] + """ + + kwargs = _get_kwargs( + status_page_id=status_page_id, + include=include, + pagenumber=pagenumber, + pagesize=pagesize, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + status_page_id: str, + *, + client: AuthenticatedClient, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, +) -> Optional[StatusPageAnnouncementList]: + """List status page announcements + + List status page announcements + + Args: + status_page_id (str): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + StatusPageAnnouncementList + """ + + return sync_detailed( + status_page_id=status_page_id, + client=client, + include=include, + pagenumber=pagenumber, + pagesize=pagesize, + ).parsed + + +async def asyncio_detailed( + status_page_id: str, + *, + client: AuthenticatedClient, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, +) -> Response[StatusPageAnnouncementList]: + """List status page announcements + + List status page announcements + + Args: + status_page_id (str): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[StatusPageAnnouncementList] + """ + + kwargs = _get_kwargs( + status_page_id=status_page_id, + include=include, + pagenumber=pagenumber, + pagesize=pagesize, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + status_page_id: str, + *, + client: AuthenticatedClient, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, +) -> Optional[StatusPageAnnouncementList]: + """List status page announcements + + List status page announcements + + Args: + status_page_id (str): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + StatusPageAnnouncementList + """ + + return ( + await asyncio_detailed( + status_page_id=status_page_id, + client=client, + include=include, + pagenumber=pagenumber, + pagesize=pagesize, + ) + ).parsed diff --git a/rootly_sdk/api/status_page_announcements/update_status_page_announcement.py b/rootly_sdk/api/status_page_announcements/update_status_page_announcement.py new file mode 100644 index 00000000..a2cb8335 --- /dev/null +++ b/rootly_sdk/api/status_page_announcements/update_status_page_announcement.py @@ -0,0 +1,187 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.errors_list import ErrorsList +from ...models.status_page_announcement_response import StatusPageAnnouncementResponse +from ...models.update_status_page_announcement import UpdateStatusPageAnnouncement +from ...types import Response + + +def _get_kwargs( + id: str, + *, + body: UpdateStatusPageAnnouncement, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "put", + "url": f"/v1/announcements/{id}", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/vnd.api+json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, StatusPageAnnouncementResponse]]: + if response.status_code == 200: + response_200 = StatusPageAnnouncementResponse.from_dict(response.json()) + + return response_200 + + if response.status_code == 404: + response_404 = ErrorsList.from_dict(response.json()) + + return response_404 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, StatusPageAnnouncementResponse]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: str, + *, + client: AuthenticatedClient, + body: UpdateStatusPageAnnouncement, +) -> Response[Union[ErrorsList, StatusPageAnnouncementResponse]]: + """Update a status page announcement + + Update a specific status page announcement by id + + Args: + id (str): + body (UpdateStatusPageAnnouncement): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[ErrorsList, StatusPageAnnouncementResponse]] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: str, + *, + client: AuthenticatedClient, + body: UpdateStatusPageAnnouncement, +) -> Optional[Union[ErrorsList, StatusPageAnnouncementResponse]]: + """Update a status page announcement + + Update a specific status page announcement by id + + Args: + id (str): + body (UpdateStatusPageAnnouncement): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[ErrorsList, StatusPageAnnouncementResponse] + """ + + return sync_detailed( + id=id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + id: str, + *, + client: AuthenticatedClient, + body: UpdateStatusPageAnnouncement, +) -> Response[Union[ErrorsList, StatusPageAnnouncementResponse]]: + """Update a status page announcement + + Update a specific status page announcement by id + + Args: + id (str): + body (UpdateStatusPageAnnouncement): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[ErrorsList, StatusPageAnnouncementResponse]] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: str, + *, + client: AuthenticatedClient, + body: UpdateStatusPageAnnouncement, +) -> Optional[Union[ErrorsList, StatusPageAnnouncementResponse]]: + """Update a status page announcement + + Update a specific status page announcement by id + + Args: + id (str): + body (UpdateStatusPageAnnouncement): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[ErrorsList, StatusPageAnnouncementResponse] + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + body=body, + ) + ).parsed diff --git a/rootly_sdk/api/status_page_component_groups/__init__.py b/rootly_sdk/api/status_page_component_groups/__init__.py new file mode 100644 index 00000000..2d7c0b23 --- /dev/null +++ b/rootly_sdk/api/status_page_component_groups/__init__.py @@ -0,0 +1 @@ +"""Contains endpoint functions for accessing the API""" diff --git a/rootly_sdk/api/status_page_component_groups/create_status_page_component_group.py b/rootly_sdk/api/status_page_component_groups/create_status_page_component_group.py new file mode 100644 index 00000000..0070a911 --- /dev/null +++ b/rootly_sdk/api/status_page_component_groups/create_status_page_component_group.py @@ -0,0 +1,192 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.errors_list import ErrorsList +from ...models.new_status_page_component_group import NewStatusPageComponentGroup +from ...models.status_page_component_group_response import StatusPageComponentGroupResponse +from ...types import Response + + +def _get_kwargs( + status_page_id: str, + *, + body: NewStatusPageComponentGroup, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": f"/v1/status-pages/{status_page_id}/component-groups", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/vnd.api+json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, StatusPageComponentGroupResponse]]: + if response.status_code == 201: + response_201 = StatusPageComponentGroupResponse.from_dict(response.json()) + + return response_201 + + if response.status_code == 401: + response_401 = ErrorsList.from_dict(response.json()) + + return response_401 + + if response.status_code == 422: + response_422 = ErrorsList.from_dict(response.json()) + + return response_422 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, StatusPageComponentGroupResponse]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + status_page_id: str, + *, + client: AuthenticatedClient, + body: NewStatusPageComponentGroup, +) -> Response[Union[ErrorsList, StatusPageComponentGroupResponse]]: + """Creates a status page component group + + Creates a new status page component group from provided data + + Args: + status_page_id (str): + body (NewStatusPageComponentGroup): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[ErrorsList, StatusPageComponentGroupResponse]] + """ + + kwargs = _get_kwargs( + status_page_id=status_page_id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + status_page_id: str, + *, + client: AuthenticatedClient, + body: NewStatusPageComponentGroup, +) -> Optional[Union[ErrorsList, StatusPageComponentGroupResponse]]: + """Creates a status page component group + + Creates a new status page component group from provided data + + Args: + status_page_id (str): + body (NewStatusPageComponentGroup): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[ErrorsList, StatusPageComponentGroupResponse] + """ + + return sync_detailed( + status_page_id=status_page_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + status_page_id: str, + *, + client: AuthenticatedClient, + body: NewStatusPageComponentGroup, +) -> Response[Union[ErrorsList, StatusPageComponentGroupResponse]]: + """Creates a status page component group + + Creates a new status page component group from provided data + + Args: + status_page_id (str): + body (NewStatusPageComponentGroup): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[ErrorsList, StatusPageComponentGroupResponse]] + """ + + kwargs = _get_kwargs( + status_page_id=status_page_id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + status_page_id: str, + *, + client: AuthenticatedClient, + body: NewStatusPageComponentGroup, +) -> Optional[Union[ErrorsList, StatusPageComponentGroupResponse]]: + """Creates a status page component group + + Creates a new status page component group from provided data + + Args: + status_page_id (str): + body (NewStatusPageComponentGroup): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[ErrorsList, StatusPageComponentGroupResponse] + """ + + return ( + await asyncio_detailed( + status_page_id=status_page_id, + client=client, + body=body, + ) + ).parsed diff --git a/rootly_sdk/api/status_page_component_groups/delete_status_page_component_group.py b/rootly_sdk/api/status_page_component_groups/delete_status_page_component_group.py new file mode 100644 index 00000000..3074986c --- /dev/null +++ b/rootly_sdk/api/status_page_component_groups/delete_status_page_component_group.py @@ -0,0 +1,98 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...types import Response + + +def _get_kwargs( + id: str, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "delete", + "url": f"/v1/component-groups/{id}", + } + + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: + if response.status_code == 200: + return None + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: str, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """Delete a status page component group + + Delete a status page component group together with its components + + Args: + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +async def asyncio_detailed( + id: str, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """Delete a status page component group + + Delete a status page component group together with its components + + Args: + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) diff --git a/rootly_sdk/api/status_page_component_groups/get_status_page_component_group.py b/rootly_sdk/api/status_page_component_groups/get_status_page_component_group.py new file mode 100644 index 00000000..03f27eb3 --- /dev/null +++ b/rootly_sdk/api/status_page_component_groups/get_status_page_component_group.py @@ -0,0 +1,186 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.errors_list import ErrorsList +from ...models.status_page_component_group_response import StatusPageComponentGroupResponse +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + id: str, + *, + include: Union[Unset, str] = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["include"] = include + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": f"/v1/component-groups/{id}", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, StatusPageComponentGroupResponse]]: + if response.status_code == 200: + response_200 = StatusPageComponentGroupResponse.from_dict(response.json()) + + return response_200 + + if response.status_code == 404: + response_404 = ErrorsList.from_dict(response.json()) + + return response_404 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, StatusPageComponentGroupResponse]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: str, + *, + client: AuthenticatedClient, + include: Union[Unset, str] = UNSET, +) -> Response[Union[ErrorsList, StatusPageComponentGroupResponse]]: + """Retrieves a status page component group + + Retrieves a status page component group + + Args: + id (str): + include (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[ErrorsList, StatusPageComponentGroupResponse]] + """ + + kwargs = _get_kwargs( + id=id, + include=include, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: str, + *, + client: AuthenticatedClient, + include: Union[Unset, str] = UNSET, +) -> Optional[Union[ErrorsList, StatusPageComponentGroupResponse]]: + """Retrieves a status page component group + + Retrieves a status page component group + + Args: + id (str): + include (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[ErrorsList, StatusPageComponentGroupResponse] + """ + + return sync_detailed( + id=id, + client=client, + include=include, + ).parsed + + +async def asyncio_detailed( + id: str, + *, + client: AuthenticatedClient, + include: Union[Unset, str] = UNSET, +) -> Response[Union[ErrorsList, StatusPageComponentGroupResponse]]: + """Retrieves a status page component group + + Retrieves a status page component group + + Args: + id (str): + include (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[ErrorsList, StatusPageComponentGroupResponse]] + """ + + kwargs = _get_kwargs( + id=id, + include=include, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: str, + *, + client: AuthenticatedClient, + include: Union[Unset, str] = UNSET, +) -> Optional[Union[ErrorsList, StatusPageComponentGroupResponse]]: + """Retrieves a status page component group + + Retrieves a status page component group + + Args: + id (str): + include (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[ErrorsList, StatusPageComponentGroupResponse] + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + include=include, + ) + ).parsed diff --git a/rootly_sdk/api/status_page_component_groups/list_status_page_component_groups.py b/rootly_sdk/api/status_page_component_groups/list_status_page_component_groups.py new file mode 100644 index 00000000..682c67ef --- /dev/null +++ b/rootly_sdk/api/status_page_component_groups/list_status_page_component_groups.py @@ -0,0 +1,210 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.status_page_component_group_list import StatusPageComponentGroupList +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + status_page_id: str, + *, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["include"] = include + + params["page[number]"] = pagenumber + + params["page[size]"] = pagesize + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": f"/v1/status-pages/{status_page_id}/component-groups", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[StatusPageComponentGroupList]: + if response.status_code == 200: + response_200 = StatusPageComponentGroupList.from_dict(response.json()) + + return response_200 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[StatusPageComponentGroupList]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + status_page_id: str, + *, + client: AuthenticatedClient, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, +) -> Response[StatusPageComponentGroupList]: + """List status page component groups + + List status page component groups + + Args: + status_page_id (str): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[StatusPageComponentGroupList] + """ + + kwargs = _get_kwargs( + status_page_id=status_page_id, + include=include, + pagenumber=pagenumber, + pagesize=pagesize, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + status_page_id: str, + *, + client: AuthenticatedClient, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, +) -> Optional[StatusPageComponentGroupList]: + """List status page component groups + + List status page component groups + + Args: + status_page_id (str): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + StatusPageComponentGroupList + """ + + return sync_detailed( + status_page_id=status_page_id, + client=client, + include=include, + pagenumber=pagenumber, + pagesize=pagesize, + ).parsed + + +async def asyncio_detailed( + status_page_id: str, + *, + client: AuthenticatedClient, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, +) -> Response[StatusPageComponentGroupList]: + """List status page component groups + + List status page component groups + + Args: + status_page_id (str): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[StatusPageComponentGroupList] + """ + + kwargs = _get_kwargs( + status_page_id=status_page_id, + include=include, + pagenumber=pagenumber, + pagesize=pagesize, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + status_page_id: str, + *, + client: AuthenticatedClient, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, +) -> Optional[StatusPageComponentGroupList]: + """List status page component groups + + List status page component groups + + Args: + status_page_id (str): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + StatusPageComponentGroupList + """ + + return ( + await asyncio_detailed( + status_page_id=status_page_id, + client=client, + include=include, + pagenumber=pagenumber, + pagesize=pagesize, + ) + ).parsed diff --git a/rootly_sdk/api/status_page_component_groups/update_status_page_component_group.py b/rootly_sdk/api/status_page_component_groups/update_status_page_component_group.py new file mode 100644 index 00000000..3c59e569 --- /dev/null +++ b/rootly_sdk/api/status_page_component_groups/update_status_page_component_group.py @@ -0,0 +1,187 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.errors_list import ErrorsList +from ...models.status_page_component_group_response import StatusPageComponentGroupResponse +from ...models.update_status_page_component_group import UpdateStatusPageComponentGroup +from ...types import Response + + +def _get_kwargs( + id: str, + *, + body: UpdateStatusPageComponentGroup, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "put", + "url": f"/v1/component-groups/{id}", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/vnd.api+json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, StatusPageComponentGroupResponse]]: + if response.status_code == 200: + response_200 = StatusPageComponentGroupResponse.from_dict(response.json()) + + return response_200 + + if response.status_code == 422: + response_422 = ErrorsList.from_dict(response.json()) + + return response_422 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, StatusPageComponentGroupResponse]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: str, + *, + client: AuthenticatedClient, + body: UpdateStatusPageComponentGroup, +) -> Response[Union[ErrorsList, StatusPageComponentGroupResponse]]: + """Update a status page component group + + Update a status page component group + + Args: + id (str): + body (UpdateStatusPageComponentGroup): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[ErrorsList, StatusPageComponentGroupResponse]] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: str, + *, + client: AuthenticatedClient, + body: UpdateStatusPageComponentGroup, +) -> Optional[Union[ErrorsList, StatusPageComponentGroupResponse]]: + """Update a status page component group + + Update a status page component group + + Args: + id (str): + body (UpdateStatusPageComponentGroup): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[ErrorsList, StatusPageComponentGroupResponse] + """ + + return sync_detailed( + id=id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + id: str, + *, + client: AuthenticatedClient, + body: UpdateStatusPageComponentGroup, +) -> Response[Union[ErrorsList, StatusPageComponentGroupResponse]]: + """Update a status page component group + + Update a status page component group + + Args: + id (str): + body (UpdateStatusPageComponentGroup): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[ErrorsList, StatusPageComponentGroupResponse]] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: str, + *, + client: AuthenticatedClient, + body: UpdateStatusPageComponentGroup, +) -> Optional[Union[ErrorsList, StatusPageComponentGroupResponse]]: + """Update a status page component group + + Update a status page component group + + Args: + id (str): + body (UpdateStatusPageComponentGroup): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[ErrorsList, StatusPageComponentGroupResponse] + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + body=body, + ) + ).parsed diff --git a/rootly_sdk/api/status_page_components/__init__.py b/rootly_sdk/api/status_page_components/__init__.py new file mode 100644 index 00000000..2d7c0b23 --- /dev/null +++ b/rootly_sdk/api/status_page_components/__init__.py @@ -0,0 +1 @@ +"""Contains endpoint functions for accessing the API""" diff --git a/rootly_sdk/api/status_page_components/create_status_page_component.py b/rootly_sdk/api/status_page_components/create_status_page_component.py new file mode 100644 index 00000000..b39f72b4 --- /dev/null +++ b/rootly_sdk/api/status_page_components/create_status_page_component.py @@ -0,0 +1,192 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.errors_list import ErrorsList +from ...models.new_status_page_component import NewStatusPageComponent +from ...models.status_page_component_response import StatusPageComponentResponse +from ...types import Response + + +def _get_kwargs( + status_page_id: str, + *, + body: NewStatusPageComponent, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": f"/v1/status-pages/{status_page_id}/components", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/vnd.api+json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, StatusPageComponentResponse]]: + if response.status_code == 201: + response_201 = StatusPageComponentResponse.from_dict(response.json()) + + return response_201 + + if response.status_code == 401: + response_401 = ErrorsList.from_dict(response.json()) + + return response_401 + + if response.status_code == 422: + response_422 = ErrorsList.from_dict(response.json()) + + return response_422 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, StatusPageComponentResponse]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + status_page_id: str, + *, + client: AuthenticatedClient, + body: NewStatusPageComponent, +) -> Response[Union[ErrorsList, StatusPageComponentResponse]]: + """Creates a status page component + + Creates a new status page component from provided data + + Args: + status_page_id (str): + body (NewStatusPageComponent): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[ErrorsList, StatusPageComponentResponse]] + """ + + kwargs = _get_kwargs( + status_page_id=status_page_id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + status_page_id: str, + *, + client: AuthenticatedClient, + body: NewStatusPageComponent, +) -> Optional[Union[ErrorsList, StatusPageComponentResponse]]: + """Creates a status page component + + Creates a new status page component from provided data + + Args: + status_page_id (str): + body (NewStatusPageComponent): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[ErrorsList, StatusPageComponentResponse] + """ + + return sync_detailed( + status_page_id=status_page_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + status_page_id: str, + *, + client: AuthenticatedClient, + body: NewStatusPageComponent, +) -> Response[Union[ErrorsList, StatusPageComponentResponse]]: + """Creates a status page component + + Creates a new status page component from provided data + + Args: + status_page_id (str): + body (NewStatusPageComponent): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[ErrorsList, StatusPageComponentResponse]] + """ + + kwargs = _get_kwargs( + status_page_id=status_page_id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + status_page_id: str, + *, + client: AuthenticatedClient, + body: NewStatusPageComponent, +) -> Optional[Union[ErrorsList, StatusPageComponentResponse]]: + """Creates a status page component + + Creates a new status page component from provided data + + Args: + status_page_id (str): + body (NewStatusPageComponent): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[ErrorsList, StatusPageComponentResponse] + """ + + return ( + await asyncio_detailed( + status_page_id=status_page_id, + client=client, + body=body, + ) + ).parsed diff --git a/rootly_sdk/api/status_page_components/delete_status_page_component.py b/rootly_sdk/api/status_page_components/delete_status_page_component.py new file mode 100644 index 00000000..5c9f3f1c --- /dev/null +++ b/rootly_sdk/api/status_page_components/delete_status_page_component.py @@ -0,0 +1,98 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...types import Response + + +def _get_kwargs( + id: str, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "delete", + "url": f"/v1/components/{id}", + } + + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: + if response.status_code == 200: + return None + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: str, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """Delete a status page component + + Delete a status page component + + Args: + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +async def asyncio_detailed( + id: str, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """Delete a status page component + + Delete a status page component + + Args: + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) diff --git a/rootly_sdk/api/status_page_components/get_status_page_component.py b/rootly_sdk/api/status_page_components/get_status_page_component.py new file mode 100644 index 00000000..11a48038 --- /dev/null +++ b/rootly_sdk/api/status_page_components/get_status_page_component.py @@ -0,0 +1,186 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.errors_list import ErrorsList +from ...models.status_page_component_response import StatusPageComponentResponse +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + id: str, + *, + include: Union[Unset, str] = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["include"] = include + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": f"/v1/components/{id}", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, StatusPageComponentResponse]]: + if response.status_code == 200: + response_200 = StatusPageComponentResponse.from_dict(response.json()) + + return response_200 + + if response.status_code == 404: + response_404 = ErrorsList.from_dict(response.json()) + + return response_404 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, StatusPageComponentResponse]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: str, + *, + client: AuthenticatedClient, + include: Union[Unset, str] = UNSET, +) -> Response[Union[ErrorsList, StatusPageComponentResponse]]: + """Retrieves a status page component + + Retrieves a status page component + + Args: + id (str): + include (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[ErrorsList, StatusPageComponentResponse]] + """ + + kwargs = _get_kwargs( + id=id, + include=include, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: str, + *, + client: AuthenticatedClient, + include: Union[Unset, str] = UNSET, +) -> Optional[Union[ErrorsList, StatusPageComponentResponse]]: + """Retrieves a status page component + + Retrieves a status page component + + Args: + id (str): + include (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[ErrorsList, StatusPageComponentResponse] + """ + + return sync_detailed( + id=id, + client=client, + include=include, + ).parsed + + +async def asyncio_detailed( + id: str, + *, + client: AuthenticatedClient, + include: Union[Unset, str] = UNSET, +) -> Response[Union[ErrorsList, StatusPageComponentResponse]]: + """Retrieves a status page component + + Retrieves a status page component + + Args: + id (str): + include (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[ErrorsList, StatusPageComponentResponse]] + """ + + kwargs = _get_kwargs( + id=id, + include=include, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: str, + *, + client: AuthenticatedClient, + include: Union[Unset, str] = UNSET, +) -> Optional[Union[ErrorsList, StatusPageComponentResponse]]: + """Retrieves a status page component + + Retrieves a status page component + + Args: + id (str): + include (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[ErrorsList, StatusPageComponentResponse] + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + include=include, + ) + ).parsed diff --git a/rootly_sdk/api/status_page_components/list_status_page_components.py b/rootly_sdk/api/status_page_components/list_status_page_components.py new file mode 100644 index 00000000..7a1bc2e2 --- /dev/null +++ b/rootly_sdk/api/status_page_components/list_status_page_components.py @@ -0,0 +1,210 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.status_page_component_list import StatusPageComponentList +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + status_page_id: str, + *, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["include"] = include + + params["page[number]"] = pagenumber + + params["page[size]"] = pagesize + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": f"/v1/status-pages/{status_page_id}/components", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[StatusPageComponentList]: + if response.status_code == 200: + response_200 = StatusPageComponentList.from_dict(response.json()) + + return response_200 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[StatusPageComponentList]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + status_page_id: str, + *, + client: AuthenticatedClient, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, +) -> Response[StatusPageComponentList]: + """List status page components + + List status page components + + Args: + status_page_id (str): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[StatusPageComponentList] + """ + + kwargs = _get_kwargs( + status_page_id=status_page_id, + include=include, + pagenumber=pagenumber, + pagesize=pagesize, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + status_page_id: str, + *, + client: AuthenticatedClient, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, +) -> Optional[StatusPageComponentList]: + """List status page components + + List status page components + + Args: + status_page_id (str): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + StatusPageComponentList + """ + + return sync_detailed( + status_page_id=status_page_id, + client=client, + include=include, + pagenumber=pagenumber, + pagesize=pagesize, + ).parsed + + +async def asyncio_detailed( + status_page_id: str, + *, + client: AuthenticatedClient, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, +) -> Response[StatusPageComponentList]: + """List status page components + + List status page components + + Args: + status_page_id (str): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[StatusPageComponentList] + """ + + kwargs = _get_kwargs( + status_page_id=status_page_id, + include=include, + pagenumber=pagenumber, + pagesize=pagesize, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + status_page_id: str, + *, + client: AuthenticatedClient, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, +) -> Optional[StatusPageComponentList]: + """List status page components + + List status page components + + Args: + status_page_id (str): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + StatusPageComponentList + """ + + return ( + await asyncio_detailed( + status_page_id=status_page_id, + client=client, + include=include, + pagenumber=pagenumber, + pagesize=pagesize, + ) + ).parsed diff --git a/rootly_sdk/api/status_page_components/update_status_page_component.py b/rootly_sdk/api/status_page_components/update_status_page_component.py new file mode 100644 index 00000000..542a8c34 --- /dev/null +++ b/rootly_sdk/api/status_page_components/update_status_page_component.py @@ -0,0 +1,187 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.errors_list import ErrorsList +from ...models.status_page_component_response import StatusPageComponentResponse +from ...models.update_status_page_component import UpdateStatusPageComponent +from ...types import Response + + +def _get_kwargs( + id: str, + *, + body: UpdateStatusPageComponent, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "put", + "url": f"/v1/components/{id}", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/vnd.api+json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, StatusPageComponentResponse]]: + if response.status_code == 200: + response_200 = StatusPageComponentResponse.from_dict(response.json()) + + return response_200 + + if response.status_code == 422: + response_422 = ErrorsList.from_dict(response.json()) + + return response_422 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, StatusPageComponentResponse]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: str, + *, + client: AuthenticatedClient, + body: UpdateStatusPageComponent, +) -> Response[Union[ErrorsList, StatusPageComponentResponse]]: + """Update a status page component + + Update a status page component + + Args: + id (str): + body (UpdateStatusPageComponent): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[ErrorsList, StatusPageComponentResponse]] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: str, + *, + client: AuthenticatedClient, + body: UpdateStatusPageComponent, +) -> Optional[Union[ErrorsList, StatusPageComponentResponse]]: + """Update a status page component + + Update a status page component + + Args: + id (str): + body (UpdateStatusPageComponent): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[ErrorsList, StatusPageComponentResponse] + """ + + return sync_detailed( + id=id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + id: str, + *, + client: AuthenticatedClient, + body: UpdateStatusPageComponent, +) -> Response[Union[ErrorsList, StatusPageComponentResponse]]: + """Update a status page component + + Update a status page component + + Args: + id (str): + body (UpdateStatusPageComponent): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[ErrorsList, StatusPageComponentResponse]] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: str, + *, + client: AuthenticatedClient, + body: UpdateStatusPageComponent, +) -> Optional[Union[ErrorsList, StatusPageComponentResponse]]: + """Update a status page component + + Update a status page component + + Args: + id (str): + body (UpdateStatusPageComponent): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[ErrorsList, StatusPageComponentResponse] + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + body=body, + ) + ).parsed diff --git a/rootly_sdk/api/status_page_templates/create_status_page_template.py b/rootly_sdk/api/status_page_templates/create_status_page_template.py index 38428024..fda3490b 100644 --- a/rootly_sdk/api/status_page_templates/create_status_page_template.py +++ b/rootly_sdk/api/status_page_templates/create_status_page_template.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/status-pages/{status_page_id}/templates".format( - status_page_id=quote(str(status_page_id), safe=""), - ), + "url": f"/v1/status-pages/{status_page_id}/templates", } _kwargs["json"] = body.to_dict() @@ -35,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | StatusPageTemplateResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, StatusPageTemplateResponse]]: if response.status_code == 201: response_201 = StatusPageTemplateResponse.from_dict(response.json()) @@ -59,8 +56,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | StatusPageTemplateResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, StatusPageTemplateResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -74,7 +71,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: StatusPageTemplate, -) -> Response[ErrorsList | StatusPageTemplateResponse]: +) -> Response[Union[ErrorsList, StatusPageTemplateResponse]]: """Creates a status page template Creates a new template from provided data @@ -88,7 +85,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | StatusPageTemplateResponse] + Response[Union[ErrorsList, StatusPageTemplateResponse]] """ kwargs = _get_kwargs( @@ -108,7 +105,7 @@ def sync( *, client: AuthenticatedClient, body: StatusPageTemplate, -) -> ErrorsList | StatusPageTemplateResponse | None: +) -> Optional[Union[ErrorsList, StatusPageTemplateResponse]]: """Creates a status page template Creates a new template from provided data @@ -122,7 +119,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | StatusPageTemplateResponse + Union[ErrorsList, StatusPageTemplateResponse] """ return sync_detailed( @@ -137,7 +134,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: StatusPageTemplate, -) -> Response[ErrorsList | StatusPageTemplateResponse]: +) -> Response[Union[ErrorsList, StatusPageTemplateResponse]]: """Creates a status page template Creates a new template from provided data @@ -151,7 +148,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | StatusPageTemplateResponse] + Response[Union[ErrorsList, StatusPageTemplateResponse]] """ kwargs = _get_kwargs( @@ -169,7 +166,7 @@ async def asyncio( *, client: AuthenticatedClient, body: StatusPageTemplate, -) -> ErrorsList | StatusPageTemplateResponse | None: +) -> Optional[Union[ErrorsList, StatusPageTemplateResponse]]: """Creates a status page template Creates a new template from provided data @@ -183,7 +180,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | StatusPageTemplateResponse + Union[ErrorsList, StatusPageTemplateResponse] """ return ( diff --git a/rootly_sdk/api/status_page_templates/delete_status_page_template.py b/rootly_sdk/api/status_page_templates/delete_status_page_template.py index 0fccfa58..2d5d6b79 100644 --- a/rootly_sdk/api/status_page_templates/delete_status_page_template.py +++ b/rootly_sdk/api/status_page_templates/delete_status_page_template.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/templates/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/templates/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | StatusPageTemplateResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, StatusPageTemplateResponse]]: if response.status_code == 200: response_200 = StatusPageTemplateResponse.from_dict(response.json()) @@ -45,8 +41,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | StatusPageTemplateResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, StatusPageTemplateResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | StatusPageTemplateResponse]: +) -> Response[Union[ErrorsList, StatusPageTemplateResponse]]: """Delete a incident event Delete a specific template event by id @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | StatusPageTemplateResponse] + Response[Union[ErrorsList, StatusPageTemplateResponse]] """ kwargs = _get_kwargs( @@ -90,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | StatusPageTemplateResponse | None: +) -> Optional[Union[ErrorsList, StatusPageTemplateResponse]]: """Delete a incident event Delete a specific template event by id @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | StatusPageTemplateResponse + Union[ErrorsList, StatusPageTemplateResponse] """ return sync_detailed( @@ -116,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | StatusPageTemplateResponse]: +) -> Response[Union[ErrorsList, StatusPageTemplateResponse]]: """Delete a incident event Delete a specific template event by id @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | StatusPageTemplateResponse] + Response[Union[ErrorsList, StatusPageTemplateResponse]] """ kwargs = _get_kwargs( @@ -145,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | StatusPageTemplateResponse | None: +) -> Optional[Union[ErrorsList, StatusPageTemplateResponse]]: """Delete a incident event Delete a specific template event by id @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | StatusPageTemplateResponse + Union[ErrorsList, StatusPageTemplateResponse] """ return ( diff --git a/rootly_sdk/api/status_page_templates/get_status_page_template.py b/rootly_sdk/api/status_page_templates/get_status_page_template.py index cd9c534c..6d0d5660 100644 --- a/rootly_sdk/api/status_page_templates/get_status_page_template.py +++ b/rootly_sdk/api/status_page_templates/get_status_page_template.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/templates/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/templates/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | StatusPageTemplateResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, StatusPageTemplateResponse]]: if response.status_code == 200: response_200 = StatusPageTemplateResponse.from_dict(response.json()) @@ -45,8 +41,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | StatusPageTemplateResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, StatusPageTemplateResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | StatusPageTemplateResponse]: +) -> Response[Union[ErrorsList, StatusPageTemplateResponse]]: """Retrieves a status page template Retrieves a specific status_page_template by id @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | StatusPageTemplateResponse] + Response[Union[ErrorsList, StatusPageTemplateResponse]] """ kwargs = _get_kwargs( @@ -90,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | StatusPageTemplateResponse | None: +) -> Optional[Union[ErrorsList, StatusPageTemplateResponse]]: """Retrieves a status page template Retrieves a specific status_page_template by id @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | StatusPageTemplateResponse + Union[ErrorsList, StatusPageTemplateResponse] """ return sync_detailed( @@ -116,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | StatusPageTemplateResponse]: +) -> Response[Union[ErrorsList, StatusPageTemplateResponse]]: """Retrieves a status page template Retrieves a specific status_page_template by id @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | StatusPageTemplateResponse] + Response[Union[ErrorsList, StatusPageTemplateResponse]] """ kwargs = _get_kwargs( @@ -145,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | StatusPageTemplateResponse | None: +) -> Optional[Union[ErrorsList, StatusPageTemplateResponse]]: """Retrieves a status page template Retrieves a specific status_page_template by id @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | StatusPageTemplateResponse + Union[ErrorsList, StatusPageTemplateResponse] """ return ( diff --git a/rootly_sdk/api/status_page_templates/list_status_page_templates.py b/rootly_sdk/api/status_page_templates/list_status_page_templates.py index 806aef61..1f72d4f0 100644 --- a/rootly_sdk/api/status_page_templates/list_status_page_templates.py +++ b/rootly_sdk/api/status_page_templates/list_status_page_templates.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -13,11 +12,10 @@ def _get_kwargs( status_page_id: str, *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -30,16 +28,16 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/status-pages/{status_page_id}/templates".format( - status_page_id=quote(str(status_page_id), safe=""), - ), + "url": f"/v1/status-pages/{status_page_id}/templates", "params": params, } return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> StatusPageTemplateList | None: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[StatusPageTemplateList]: if response.status_code == 200: response_200 = StatusPageTemplateList.from_dict(response.json()) @@ -52,7 +50,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[StatusPageTemplateList]: return Response( status_code=HTTPStatus(response.status_code), @@ -66,9 +64,9 @@ def sync_detailed( status_page_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, ) -> Response[StatusPageTemplateList]: """List status page templates @@ -76,9 +74,9 @@ def sync_detailed( Args: status_page_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -106,19 +104,19 @@ def sync( status_page_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, -) -> StatusPageTemplateList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, +) -> Optional[StatusPageTemplateList]: """List status page templates List status page templates Args: status_page_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -141,9 +139,9 @@ async def asyncio_detailed( status_page_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, ) -> Response[StatusPageTemplateList]: """List status page templates @@ -151,9 +149,9 @@ async def asyncio_detailed( Args: status_page_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -179,19 +177,19 @@ async def asyncio( status_page_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, -) -> StatusPageTemplateList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, +) -> Optional[StatusPageTemplateList]: """List status page templates List status page templates Args: status_page_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/status_page_templates/update_status_page_template.py b/rootly_sdk/api/status_page_templates/update_status_page_template.py index e8f68a20..09bed928 100644 --- a/rootly_sdk/api/status_page_templates/update_status_page_template.py +++ b/rootly_sdk/api/status_page_templates/update_status_page_template.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/templates/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/templates/{id}", } _kwargs["json"] = body.to_dict() @@ -35,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | StatusPageTemplateResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, StatusPageTemplateResponse]]: if response.status_code == 200: response_200 = StatusPageTemplateResponse.from_dict(response.json()) @@ -54,8 +51,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | StatusPageTemplateResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, StatusPageTemplateResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: StatusPageTemplate, -) -> Response[ErrorsList | StatusPageTemplateResponse]: +) -> Response[Union[ErrorsList, StatusPageTemplateResponse]]: """Update status page template Update a specific template event by id @@ -83,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | StatusPageTemplateResponse] + Response[Union[ErrorsList, StatusPageTemplateResponse]] """ kwargs = _get_kwargs( @@ -103,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: StatusPageTemplate, -) -> ErrorsList | StatusPageTemplateResponse | None: +) -> Optional[Union[ErrorsList, StatusPageTemplateResponse]]: """Update status page template Update a specific template event by id @@ -117,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | StatusPageTemplateResponse + Union[ErrorsList, StatusPageTemplateResponse] """ return sync_detailed( @@ -132,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: StatusPageTemplate, -) -> Response[ErrorsList | StatusPageTemplateResponse]: +) -> Response[Union[ErrorsList, StatusPageTemplateResponse]]: """Update status page template Update a specific template event by id @@ -146,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | StatusPageTemplateResponse] + Response[Union[ErrorsList, StatusPageTemplateResponse]] """ kwargs = _get_kwargs( @@ -164,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: StatusPageTemplate, -) -> ErrorsList | StatusPageTemplateResponse | None: +) -> Optional[Union[ErrorsList, StatusPageTemplateResponse]]: """Update status page template Update a specific template event by id @@ -178,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | StatusPageTemplateResponse + Union[ErrorsList, StatusPageTemplateResponse] """ return ( diff --git a/rootly_sdk/api/status_pages/create_status_page.py b/rootly_sdk/api/status_pages/create_status_page.py index 499bcdb8..a46de930 100644 --- a/rootly_sdk/api/status_pages/create_status_page.py +++ b/rootly_sdk/api/status_pages/create_status_page.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | StatusPageResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, StatusPageResponse]]: if response.status_code == 201: response_201 = StatusPageResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | StatusPageResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, StatusPageResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +69,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewStatusPage, -) -> Response[ErrorsList | StatusPageResponse]: +) -> Response[Union[ErrorsList, StatusPageResponse]]: """Creates a status page Creates a new status page from provided data @@ -82,7 +82,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | StatusPageResponse] + Response[Union[ErrorsList, StatusPageResponse]] """ kwargs = _get_kwargs( @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: NewStatusPage, -) -> ErrorsList | StatusPageResponse | None: +) -> Optional[Union[ErrorsList, StatusPageResponse]]: """Creates a status page Creates a new status page from provided data @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | StatusPageResponse + Union[ErrorsList, StatusPageResponse] """ return sync_detailed( @@ -126,7 +126,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewStatusPage, -) -> Response[ErrorsList | StatusPageResponse]: +) -> Response[Union[ErrorsList, StatusPageResponse]]: """Creates a status page Creates a new status page from provided data @@ -139,7 +139,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | StatusPageResponse] + Response[Union[ErrorsList, StatusPageResponse]] """ kwargs = _get_kwargs( @@ -155,7 +155,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewStatusPage, -) -> ErrorsList | StatusPageResponse | None: +) -> Optional[Union[ErrorsList, StatusPageResponse]]: """Creates a status page Creates a new status page from provided data @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | StatusPageResponse + Union[ErrorsList, StatusPageResponse] """ return ( diff --git a/rootly_sdk/api/status_pages/delete_status_page.py b/rootly_sdk/api/status_pages/delete_status_page.py index fcb4150f..b55f6bb0 100644 --- a/rootly_sdk/api/status_pages/delete_status_page.py +++ b/rootly_sdk/api/status_pages/delete_status_page.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union from uuid import UUID import httpx @@ -13,22 +12,19 @@ def _get_kwargs( - id: str | UUID, + id: Union[UUID, str], ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/status-pages/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/status-pages/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | StatusPageResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, StatusPageResponse]]: if response.status_code == 200: response_200 = StatusPageResponse.from_dict(response.json()) @@ -46,8 +42,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | StatusPageResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, StatusPageResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -57,23 +53,23 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Response[ErrorsList | StatusPageResponse]: +) -> Response[Union[ErrorsList, StatusPageResponse]]: """Delete a status page Delete a specific status page by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | StatusPageResponse] + Response[Union[ErrorsList, StatusPageResponse]] """ kwargs = _get_kwargs( @@ -88,23 +84,23 @@ def sync_detailed( def sync( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> ErrorsList | StatusPageResponse | None: +) -> Optional[Union[ErrorsList, StatusPageResponse]]: """Delete a status page Delete a specific status page by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | StatusPageResponse + Union[ErrorsList, StatusPageResponse] """ return sync_detailed( @@ -114,23 +110,23 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Response[ErrorsList | StatusPageResponse]: +) -> Response[Union[ErrorsList, StatusPageResponse]]: """Delete a status page Delete a specific status page by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | StatusPageResponse] + Response[Union[ErrorsList, StatusPageResponse]] """ kwargs = _get_kwargs( @@ -143,23 +139,23 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> ErrorsList | StatusPageResponse | None: +) -> Optional[Union[ErrorsList, StatusPageResponse]]: """Delete a status page Delete a specific status page by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | StatusPageResponse + Union[ErrorsList, StatusPageResponse] """ return ( diff --git a/rootly_sdk/api/status_pages/get_status_page.py b/rootly_sdk/api/status_pages/get_status_page.py index d48c36a9..905bb823 100644 --- a/rootly_sdk/api/status_pages/get_status_page.py +++ b/rootly_sdk/api/status_pages/get_status_page.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union from uuid import UUID import httpx @@ -13,22 +12,19 @@ def _get_kwargs( - id: str | UUID, + id: Union[UUID, str], ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/status-pages/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/status-pages/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | StatusPageResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, StatusPageResponse]]: if response.status_code == 200: response_200 = StatusPageResponse.from_dict(response.json()) @@ -46,8 +42,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | StatusPageResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, StatusPageResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -57,23 +53,23 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Response[ErrorsList | StatusPageResponse]: +) -> Response[Union[ErrorsList, StatusPageResponse]]: """Retrieves a status page Retrieves a specific status page by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | StatusPageResponse] + Response[Union[ErrorsList, StatusPageResponse]] """ kwargs = _get_kwargs( @@ -88,23 +84,23 @@ def sync_detailed( def sync( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> ErrorsList | StatusPageResponse | None: +) -> Optional[Union[ErrorsList, StatusPageResponse]]: """Retrieves a status page Retrieves a specific status page by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | StatusPageResponse + Union[ErrorsList, StatusPageResponse] """ return sync_detailed( @@ -114,23 +110,23 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Response[ErrorsList | StatusPageResponse]: +) -> Response[Union[ErrorsList, StatusPageResponse]]: """Retrieves a status page Retrieves a specific status page by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | StatusPageResponse] + Response[Union[ErrorsList, StatusPageResponse]] """ kwargs = _get_kwargs( @@ -143,23 +139,23 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> ErrorsList | StatusPageResponse | None: +) -> Optional[Union[ErrorsList, StatusPageResponse]]: """Retrieves a status page Retrieves a specific status page by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | StatusPageResponse + Union[ErrorsList, StatusPageResponse] """ return ( diff --git a/rootly_sdk/api/status_pages/list_status_pages.py b/rootly_sdk/api/status_pages/list_status_pages.py index 1e11a52a..50a54de7 100644 --- a/rootly_sdk/api/status_pages/list_status_pages.py +++ b/rootly_sdk/api/status_pages/list_status_pages.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -11,27 +11,26 @@ def _get_kwargs( *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, + filterslugeq: Union[Unset, str] = UNSET, + filterslugnot_eq: Union[Unset, str] = UNSET, + filterslugin: Union[Unset, str] = UNSET, + filterslugnot_in: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -83,7 +82,9 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> StatusPageList | None: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[StatusPageList]: if response.status_code == 200: response_200 = StatusPageList.from_dict(response.json()) @@ -95,7 +96,9 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[StatusPageList]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[StatusPageList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -107,50 +110,50 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, + filterslugeq: Union[Unset, str] = UNSET, + filterslugnot_eq: Union[Unset, str] = UNSET, + filterslugin: Union[Unset, str] = UNSET, + filterslugnot_in: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, ) -> Response[StatusPageList]: """List status pages List status pages Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterslug (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -192,50 +195,50 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, -) -> StatusPageList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, + filterslugeq: Union[Unset, str] = UNSET, + filterslugnot_eq: Union[Unset, str] = UNSET, + filterslugin: Union[Unset, str] = UNSET, + filterslugnot_in: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, +) -> Optional[StatusPageList]: """List status pages List status pages Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterslug (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -272,50 +275,50 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, + filterslugeq: Union[Unset, str] = UNSET, + filterslugnot_eq: Union[Unset, str] = UNSET, + filterslugin: Union[Unset, str] = UNSET, + filterslugnot_in: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, ) -> Response[StatusPageList]: """List status pages List status pages Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterslug (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -355,50 +358,50 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, -) -> StatusPageList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, + filterslugeq: Union[Unset, str] = UNSET, + filterslugnot_eq: Union[Unset, str] = UNSET, + filterslugin: Union[Unset, str] = UNSET, + filterslugnot_in: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, +) -> Optional[StatusPageList]: """List status pages List status pages Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterslug (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/status_pages/update_status_page.py b/rootly_sdk/api/status_pages/update_status_page.py index a6136c7a..0a934e6d 100644 --- a/rootly_sdk/api/status_pages/update_status_page.py +++ b/rootly_sdk/api/status_pages/update_status_page.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union from uuid import UUID import httpx @@ -14,7 +13,7 @@ def _get_kwargs( - id: str | UUID, + id: Union[UUID, str], *, body: UpdateStatusPage, ) -> dict[str, Any]: @@ -22,9 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/status-pages/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/status-pages/{id}", } _kwargs["json"] = body.to_dict() @@ -36,8 +33,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | StatusPageResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, StatusPageResponse]]: if response.status_code == 200: response_200 = StatusPageResponse.from_dict(response.json()) @@ -60,8 +57,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | StatusPageResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, StatusPageResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -71,17 +68,17 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdateStatusPage, -) -> Response[ErrorsList | StatusPageResponse]: +) -> Response[Union[ErrorsList, StatusPageResponse]]: """Update a status page Update a specific status page by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateStatusPage): Raises: @@ -89,7 +86,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | StatusPageResponse] + Response[Union[ErrorsList, StatusPageResponse]] """ kwargs = _get_kwargs( @@ -105,17 +102,17 @@ def sync_detailed( def sync( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdateStatusPage, -) -> ErrorsList | StatusPageResponse | None: +) -> Optional[Union[ErrorsList, StatusPageResponse]]: """Update a status page Update a specific status page by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateStatusPage): Raises: @@ -123,7 +120,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | StatusPageResponse + Union[ErrorsList, StatusPageResponse] """ return sync_detailed( @@ -134,17 +131,17 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdateStatusPage, -) -> Response[ErrorsList | StatusPageResponse]: +) -> Response[Union[ErrorsList, StatusPageResponse]]: """Update a status page Update a specific status page by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateStatusPage): Raises: @@ -152,7 +149,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | StatusPageResponse] + Response[Union[ErrorsList, StatusPageResponse]] """ kwargs = _get_kwargs( @@ -166,17 +163,17 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdateStatusPage, -) -> ErrorsList | StatusPageResponse | None: +) -> Optional[Union[ErrorsList, StatusPageResponse]]: """Update a status page Update a specific status page by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateStatusPage): Raises: @@ -184,7 +181,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | StatusPageResponse + Union[ErrorsList, StatusPageResponse] """ return ( diff --git a/rootly_sdk/api/statuses/get_status.py b/rootly_sdk/api/statuses/get_status.py index 185a8694..4d7251eb 100644 --- a/rootly_sdk/api/statuses/get_status.py +++ b/rootly_sdk/api/statuses/get_status.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union from uuid import UUID import httpx @@ -13,22 +12,19 @@ def _get_kwargs( - id: str | UUID, + id: Union[UUID, str], ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/statuses/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/statuses/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | StatusResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, StatusResponse]]: if response.status_code == 200: response_200 = StatusResponse.from_dict(response.json()) @@ -46,8 +42,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | StatusResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, StatusResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -57,23 +53,23 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Response[ErrorsList | StatusResponse]: +) -> Response[Union[ErrorsList, StatusResponse]]: """Retrieves a Status Retrieves a specific Status by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | StatusResponse] + Response[Union[ErrorsList, StatusResponse]] """ kwargs = _get_kwargs( @@ -88,23 +84,23 @@ def sync_detailed( def sync( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> ErrorsList | StatusResponse | None: +) -> Optional[Union[ErrorsList, StatusResponse]]: """Retrieves a Status Retrieves a specific Status by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | StatusResponse + Union[ErrorsList, StatusResponse] """ return sync_detailed( @@ -114,23 +110,23 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Response[ErrorsList | StatusResponse]: +) -> Response[Union[ErrorsList, StatusResponse]]: """Retrieves a Status Retrieves a specific Status by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | StatusResponse] + Response[Union[ErrorsList, StatusResponse]] """ kwargs = _get_kwargs( @@ -143,23 +139,23 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> ErrorsList | StatusResponse | None: +) -> Optional[Union[ErrorsList, StatusResponse]]: """Retrieves a Status Retrieves a specific Status by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | StatusResponse + Union[ErrorsList, StatusResponse] """ return ( diff --git a/rootly_sdk/api/statuses/list_statuses.py b/rootly_sdk/api/statuses/list_statuses.py index d7ddd61a..5134f93d 100644 --- a/rootly_sdk/api/statuses/list_statuses.py +++ b/rootly_sdk/api/statuses/list_statuses.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -12,18 +12,17 @@ def _get_kwargs( *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterenabled: bool | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterenabled: Union[Unset, bool] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -58,8 +57,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | StatusList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, StatusList]]: if response.status_code == 200: response_200 = StatusList.from_dict(response.json()) @@ -77,8 +76,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | StatusList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, StatusList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -90,39 +89,39 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterenabled: bool | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, -) -> Response[ErrorsList | StatusList]: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterenabled: Union[Unset, bool] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, +) -> Response[Union[ErrorsList, StatusList]]: """List Statuses List Statuses Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterenabled (bool | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterenabled (Union[Unset, bool]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | StatusList] + Response[Union[ErrorsList, StatusList]] """ kwargs = _get_kwargs( @@ -148,39 +147,39 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterenabled: bool | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, -) -> ErrorsList | StatusList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterenabled: Union[Unset, bool] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, +) -> Optional[Union[ErrorsList, StatusList]]: """List Statuses List Statuses Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterenabled (bool | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterenabled (Union[Unset, bool]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | StatusList + Union[ErrorsList, StatusList] """ return sync_detailed( @@ -201,39 +200,39 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterenabled: bool | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, -) -> Response[ErrorsList | StatusList]: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterenabled: Union[Unset, bool] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, +) -> Response[Union[ErrorsList, StatusList]]: """List Statuses List Statuses Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterenabled (bool | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterenabled (Union[Unset, bool]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | StatusList] + Response[Union[ErrorsList, StatusList]] """ kwargs = _get_kwargs( @@ -257,39 +256,39 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterenabled: bool | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, -) -> ErrorsList | StatusList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterenabled: Union[Unset, bool] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, +) -> Optional[Union[ErrorsList, StatusList]]: """List Statuses List Statuses Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterenabled (bool | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterenabled (Union[Unset, bool]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | StatusList + Union[ErrorsList, StatusList] """ return ( diff --git a/rootly_sdk/api/sub_statuses/create_sub_status.py b/rootly_sdk/api/sub_statuses/create_sub_status.py index 47b85e50..3f2cc6e3 100644 --- a/rootly_sdk/api/sub_statuses/create_sub_status.py +++ b/rootly_sdk/api/sub_statuses/create_sub_status.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | SubStatusResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, SubStatusResponse]]: if response.status_code == 201: response_201 = SubStatusResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | SubStatusResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, SubStatusResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +69,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewSubStatus, -) -> Response[ErrorsList | SubStatusResponse]: +) -> Response[Union[ErrorsList, SubStatusResponse]]: """Creates a Sub-Status Creates a new Sub-Status from provided data @@ -82,7 +82,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | SubStatusResponse] + Response[Union[ErrorsList, SubStatusResponse]] """ kwargs = _get_kwargs( @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: NewSubStatus, -) -> ErrorsList | SubStatusResponse | None: +) -> Optional[Union[ErrorsList, SubStatusResponse]]: """Creates a Sub-Status Creates a new Sub-Status from provided data @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | SubStatusResponse + Union[ErrorsList, SubStatusResponse] """ return sync_detailed( @@ -126,7 +126,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewSubStatus, -) -> Response[ErrorsList | SubStatusResponse]: +) -> Response[Union[ErrorsList, SubStatusResponse]]: """Creates a Sub-Status Creates a new Sub-Status from provided data @@ -139,7 +139,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | SubStatusResponse] + Response[Union[ErrorsList, SubStatusResponse]] """ kwargs = _get_kwargs( @@ -155,7 +155,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewSubStatus, -) -> ErrorsList | SubStatusResponse | None: +) -> Optional[Union[ErrorsList, SubStatusResponse]]: """Creates a Sub-Status Creates a new Sub-Status from provided data @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | SubStatusResponse + Union[ErrorsList, SubStatusResponse] """ return ( diff --git a/rootly_sdk/api/sub_statuses/delete_sub_status.py b/rootly_sdk/api/sub_statuses/delete_sub_status.py index 4e323dfb..30da1496 100644 --- a/rootly_sdk/api/sub_statuses/delete_sub_status.py +++ b/rootly_sdk/api/sub_statuses/delete_sub_status.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union from uuid import UUID import httpx @@ -13,22 +12,19 @@ def _get_kwargs( - id: str | UUID, + id: Union[UUID, str], ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/sub_statuses/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/sub_statuses/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | SubStatusResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, SubStatusResponse]]: if response.status_code == 200: response_200 = SubStatusResponse.from_dict(response.json()) @@ -46,8 +42,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | SubStatusResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, SubStatusResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -57,23 +53,23 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Response[ErrorsList | SubStatusResponse]: +) -> Response[Union[ErrorsList, SubStatusResponse]]: """Delete a Sub-Status Delete a specific Sub-Status by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | SubStatusResponse] + Response[Union[ErrorsList, SubStatusResponse]] """ kwargs = _get_kwargs( @@ -88,23 +84,23 @@ def sync_detailed( def sync( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> ErrorsList | SubStatusResponse | None: +) -> Optional[Union[ErrorsList, SubStatusResponse]]: """Delete a Sub-Status Delete a specific Sub-Status by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | SubStatusResponse + Union[ErrorsList, SubStatusResponse] """ return sync_detailed( @@ -114,23 +110,23 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Response[ErrorsList | SubStatusResponse]: +) -> Response[Union[ErrorsList, SubStatusResponse]]: """Delete a Sub-Status Delete a specific Sub-Status by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | SubStatusResponse] + Response[Union[ErrorsList, SubStatusResponse]] """ kwargs = _get_kwargs( @@ -143,23 +139,23 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> ErrorsList | SubStatusResponse | None: +) -> Optional[Union[ErrorsList, SubStatusResponse]]: """Delete a Sub-Status Delete a specific Sub-Status by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | SubStatusResponse + Union[ErrorsList, SubStatusResponse] """ return ( diff --git a/rootly_sdk/api/sub_statuses/get_sub_status.py b/rootly_sdk/api/sub_statuses/get_sub_status.py index 74ea1a88..51fe6569 100644 --- a/rootly_sdk/api/sub_statuses/get_sub_status.py +++ b/rootly_sdk/api/sub_statuses/get_sub_status.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union from uuid import UUID import httpx @@ -13,22 +12,19 @@ def _get_kwargs( - id: str | UUID, + id: Union[UUID, str], ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/sub_statuses/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/sub_statuses/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | SubStatusResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, SubStatusResponse]]: if response.status_code == 200: response_200 = SubStatusResponse.from_dict(response.json()) @@ -46,8 +42,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | SubStatusResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, SubStatusResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -57,23 +53,23 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Response[ErrorsList | SubStatusResponse]: +) -> Response[Union[ErrorsList, SubStatusResponse]]: """Retrieves a Sub-Status Retrieves a specific Sub-Status by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | SubStatusResponse] + Response[Union[ErrorsList, SubStatusResponse]] """ kwargs = _get_kwargs( @@ -88,23 +84,23 @@ def sync_detailed( def sync( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> ErrorsList | SubStatusResponse | None: +) -> Optional[Union[ErrorsList, SubStatusResponse]]: """Retrieves a Sub-Status Retrieves a specific Sub-Status by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | SubStatusResponse + Union[ErrorsList, SubStatusResponse] """ return sync_detailed( @@ -114,23 +110,23 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Response[ErrorsList | SubStatusResponse]: +) -> Response[Union[ErrorsList, SubStatusResponse]]: """Retrieves a Sub-Status Retrieves a specific Sub-Status by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | SubStatusResponse] + Response[Union[ErrorsList, SubStatusResponse]] """ kwargs = _get_kwargs( @@ -143,23 +139,23 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> ErrorsList | SubStatusResponse | None: +) -> Optional[Union[ErrorsList, SubStatusResponse]]: """Retrieves a Sub-Status Retrieves a specific Sub-Status by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | SubStatusResponse + Union[ErrorsList, SubStatusResponse] """ return ( diff --git a/rootly_sdk/api/sub_statuses/list_sub_statuses.py b/rootly_sdk/api/sub_statuses/list_sub_statuses.py index ecbe33ee..97be7c66 100644 --- a/rootly_sdk/api/sub_statuses/list_sub_statuses.py +++ b/rootly_sdk/api/sub_statuses/list_sub_statuses.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -11,18 +11,17 @@ def _get_kwargs( *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterparent_status: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterparent_status: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -56,7 +55,7 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> SubStatusList | None: +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[SubStatusList]: if response.status_code == 200: response_200 = SubStatusList.from_dict(response.json()) @@ -68,7 +67,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[SubStatusList]: +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[SubStatusList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -80,32 +79,32 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterparent_status: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterparent_status: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, ) -> Response[SubStatusList]: """List Sub-Statuses List Sub-Statuses Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterparent_status (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterparent_status (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -138,32 +137,32 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterparent_status: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, -) -> SubStatusList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterparent_status: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, +) -> Optional[SubStatusList]: """List Sub-Statuses List Sub-Statuses Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterparent_status (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterparent_status (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -191,32 +190,32 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterparent_status: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterparent_status: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, ) -> Response[SubStatusList]: """List Sub-Statuses List Sub-Statuses Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterparent_status (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterparent_status (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -247,32 +246,32 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterparent_status: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, -) -> SubStatusList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterparent_status: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, +) -> Optional[SubStatusList]: """List Sub-Statuses List Sub-Statuses Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterparent_status (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterparent_status (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/sub_statuses/update_sub_status.py b/rootly_sdk/api/sub_statuses/update_sub_status.py index 290e2864..0df47965 100644 --- a/rootly_sdk/api/sub_statuses/update_sub_status.py +++ b/rootly_sdk/api/sub_statuses/update_sub_status.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union from uuid import UUID import httpx @@ -14,7 +13,7 @@ def _get_kwargs( - id: str | UUID, + id: Union[UUID, str], *, body: UpdateSubStatus, ) -> dict[str, Any]: @@ -22,9 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/sub_statuses/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/sub_statuses/{id}", } _kwargs["json"] = body.to_dict() @@ -36,8 +33,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | SubStatusResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, SubStatusResponse]]: if response.status_code == 200: response_200 = SubStatusResponse.from_dict(response.json()) @@ -55,8 +52,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | SubStatusResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, SubStatusResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,17 +63,17 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdateSubStatus, -) -> Response[ErrorsList | SubStatusResponse]: +) -> Response[Union[ErrorsList, SubStatusResponse]]: """Update a Sub-Status Update a specific Sub-Status by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateSubStatus): Raises: @@ -84,7 +81,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | SubStatusResponse] + Response[Union[ErrorsList, SubStatusResponse]] """ kwargs = _get_kwargs( @@ -100,17 +97,17 @@ def sync_detailed( def sync( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdateSubStatus, -) -> ErrorsList | SubStatusResponse | None: +) -> Optional[Union[ErrorsList, SubStatusResponse]]: """Update a Sub-Status Update a specific Sub-Status by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateSubStatus): Raises: @@ -118,7 +115,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | SubStatusResponse + Union[ErrorsList, SubStatusResponse] """ return sync_detailed( @@ -129,17 +126,17 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdateSubStatus, -) -> Response[ErrorsList | SubStatusResponse]: +) -> Response[Union[ErrorsList, SubStatusResponse]]: """Update a Sub-Status Update a specific Sub-Status by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateSubStatus): Raises: @@ -147,7 +144,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | SubStatusResponse] + Response[Union[ErrorsList, SubStatusResponse]] """ kwargs = _get_kwargs( @@ -161,17 +158,17 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdateSubStatus, -) -> ErrorsList | SubStatusResponse | None: +) -> Optional[Union[ErrorsList, SubStatusResponse]]: """Update a Sub-Status Update a specific Sub-Status by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateSubStatus): Raises: @@ -179,7 +176,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | SubStatusResponse + Union[ErrorsList, SubStatusResponse] """ return ( diff --git a/rootly_sdk/api/teams/bulk_delete_groups.py b/rootly_sdk/api/teams/bulk_delete_groups.py index dc3ee765..fec43db8 100644 --- a/rootly_sdk/api/teams/bulk_delete_groups.py +++ b/rootly_sdk/api/teams/bulk_delete_groups.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -14,7 +14,7 @@ def _get_kwargs( *, - body: BulkDestroyTeamsType0 | BulkDestroyTeamsType1, + body: Union["BulkDestroyTeamsType0", "BulkDestroyTeamsType1"], ) -> dict[str, Any]: headers: dict[str, Any] = {} @@ -23,6 +23,7 @@ def _get_kwargs( "url": "/v1/teams/bulk_delete", } + _kwargs["json"]: dict[str, Any] if isinstance(body, BulkDestroyTeamsType0): _kwargs["json"] = body.to_dict() else: @@ -35,8 +36,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> BulkDestroyTeamsResponse | BulkDestroyTeamsResponse | ErrorsList | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[BulkDestroyTeamsResponse, ErrorsList, Union["BulkDestroyTeamsResponse", "ErrorsList"]]]: if response.status_code == 200: response_200 = BulkDestroyTeamsResponse.from_dict(response.json()) @@ -49,14 +50,14 @@ def _parse_response( if response.status_code == 422: - def _parse_response_422(data: object) -> BulkDestroyTeamsResponse | ErrorsList: + def _parse_response_422(data: object) -> Union["BulkDestroyTeamsResponse", "ErrorsList"]: try: if not isinstance(data, dict): raise TypeError() response_422_type_0 = ErrorsList.from_dict(data) return response_422_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass if not isinstance(data, dict): raise TypeError() @@ -75,8 +76,8 @@ def _parse_response_422(data: object) -> BulkDestroyTeamsResponse | ErrorsList: def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[BulkDestroyTeamsResponse | BulkDestroyTeamsResponse | ErrorsList | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[BulkDestroyTeamsResponse, ErrorsList, Union["BulkDestroyTeamsResponse", "ErrorsList"]]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -88,23 +89,23 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - body: BulkDestroyTeamsType0 | BulkDestroyTeamsType1, -) -> Response[BulkDestroyTeamsResponse | BulkDestroyTeamsResponse | ErrorsList | ErrorsList]: + body: Union["BulkDestroyTeamsType0", "BulkDestroyTeamsType1"], +) -> Response[Union[BulkDestroyTeamsResponse, ErrorsList, Union["BulkDestroyTeamsResponse", "ErrorsList"]]]: """Bulk delete Teams Delete teams by external_id list, or prune by managed_by source. Two mutually exclusive modes. Args: - body (BulkDestroyTeamsType0 | BulkDestroyTeamsType1): Two mutually exclusive modes. Pass - exactly one of: external_ids (delete specific records) or managed_by (prune all managed - records not in keep set). + body (Union['BulkDestroyTeamsType0', 'BulkDestroyTeamsType1']): Two mutually exclusive + modes. Pass exactly one of: external_ids (delete specific records) or managed_by (prune + all managed records not in keep set). Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[BulkDestroyTeamsResponse | BulkDestroyTeamsResponse | ErrorsList | ErrorsList] + Response[Union[BulkDestroyTeamsResponse, ErrorsList, Union['BulkDestroyTeamsResponse', 'ErrorsList']]] """ kwargs = _get_kwargs( @@ -121,23 +122,23 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - body: BulkDestroyTeamsType0 | BulkDestroyTeamsType1, -) -> BulkDestroyTeamsResponse | BulkDestroyTeamsResponse | ErrorsList | ErrorsList | None: + body: Union["BulkDestroyTeamsType0", "BulkDestroyTeamsType1"], +) -> Optional[Union[BulkDestroyTeamsResponse, ErrorsList, Union["BulkDestroyTeamsResponse", "ErrorsList"]]]: """Bulk delete Teams Delete teams by external_id list, or prune by managed_by source. Two mutually exclusive modes. Args: - body (BulkDestroyTeamsType0 | BulkDestroyTeamsType1): Two mutually exclusive modes. Pass - exactly one of: external_ids (delete specific records) or managed_by (prune all managed - records not in keep set). + body (Union['BulkDestroyTeamsType0', 'BulkDestroyTeamsType1']): Two mutually exclusive + modes. Pass exactly one of: external_ids (delete specific records) or managed_by (prune + all managed records not in keep set). Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - BulkDestroyTeamsResponse | BulkDestroyTeamsResponse | ErrorsList | ErrorsList + Union[BulkDestroyTeamsResponse, ErrorsList, Union['BulkDestroyTeamsResponse', 'ErrorsList']] """ return sync_detailed( @@ -149,23 +150,23 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - body: BulkDestroyTeamsType0 | BulkDestroyTeamsType1, -) -> Response[BulkDestroyTeamsResponse | BulkDestroyTeamsResponse | ErrorsList | ErrorsList]: + body: Union["BulkDestroyTeamsType0", "BulkDestroyTeamsType1"], +) -> Response[Union[BulkDestroyTeamsResponse, ErrorsList, Union["BulkDestroyTeamsResponse", "ErrorsList"]]]: """Bulk delete Teams Delete teams by external_id list, or prune by managed_by source. Two mutually exclusive modes. Args: - body (BulkDestroyTeamsType0 | BulkDestroyTeamsType1): Two mutually exclusive modes. Pass - exactly one of: external_ids (delete specific records) or managed_by (prune all managed - records not in keep set). + body (Union['BulkDestroyTeamsType0', 'BulkDestroyTeamsType1']): Two mutually exclusive + modes. Pass exactly one of: external_ids (delete specific records) or managed_by (prune + all managed records not in keep set). Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[BulkDestroyTeamsResponse | BulkDestroyTeamsResponse | ErrorsList | ErrorsList] + Response[Union[BulkDestroyTeamsResponse, ErrorsList, Union['BulkDestroyTeamsResponse', 'ErrorsList']]] """ kwargs = _get_kwargs( @@ -180,23 +181,23 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - body: BulkDestroyTeamsType0 | BulkDestroyTeamsType1, -) -> BulkDestroyTeamsResponse | BulkDestroyTeamsResponse | ErrorsList | ErrorsList | None: + body: Union["BulkDestroyTeamsType0", "BulkDestroyTeamsType1"], +) -> Optional[Union[BulkDestroyTeamsResponse, ErrorsList, Union["BulkDestroyTeamsResponse", "ErrorsList"]]]: """Bulk delete Teams Delete teams by external_id list, or prune by managed_by source. Two mutually exclusive modes. Args: - body (BulkDestroyTeamsType0 | BulkDestroyTeamsType1): Two mutually exclusive modes. Pass - exactly one of: external_ids (delete specific records) or managed_by (prune all managed - records not in keep set). + body (Union['BulkDestroyTeamsType0', 'BulkDestroyTeamsType1']): Two mutually exclusive + modes. Pass exactly one of: external_ids (delete specific records) or managed_by (prune + all managed records not in keep set). Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - BulkDestroyTeamsResponse | BulkDestroyTeamsResponse | ErrorsList | ErrorsList + Union[BulkDestroyTeamsResponse, ErrorsList, Union['BulkDestroyTeamsResponse', 'ErrorsList']] """ return ( diff --git a/rootly_sdk/api/teams/bulk_upsert_groups.py b/rootly_sdk/api/teams/bulk_upsert_groups.py index 406c76f5..1850921e 100644 --- a/rootly_sdk/api/teams/bulk_upsert_groups.py +++ b/rootly_sdk/api/teams/bulk_upsert_groups.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> BulkUpsertTeamsError | ErrorsList | BulkUpsertTeamsResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[BulkUpsertTeamsResponse, ErrorsList, Union["BulkUpsertTeamsError", "ErrorsList"]]]: if response.status_code == 200: response_200 = BulkUpsertTeamsResponse.from_dict(response.json()) @@ -46,14 +46,14 @@ def _parse_response( if response.status_code == 422: - def _parse_response_422(data: object) -> BulkUpsertTeamsError | ErrorsList: + def _parse_response_422(data: object) -> Union["BulkUpsertTeamsError", "ErrorsList"]: try: if not isinstance(data, dict): raise TypeError() response_422_type_0 = ErrorsList.from_dict(data) return response_422_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass if not isinstance(data, dict): raise TypeError() @@ -72,8 +72,8 @@ def _parse_response_422(data: object) -> BulkUpsertTeamsError | ErrorsList: def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[BulkUpsertTeamsError | ErrorsList | BulkUpsertTeamsResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[BulkUpsertTeamsResponse, ErrorsList, Union["BulkUpsertTeamsError", "ErrorsList"]]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -86,7 +86,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: BulkUpsertTeams, -) -> Response[BulkUpsertTeamsError | ErrorsList | BulkUpsertTeamsResponse | ErrorsList]: +) -> Response[Union[BulkUpsertTeamsResponse, ErrorsList, Union["BulkUpsertTeamsError", "ErrorsList"]]]: """Bulk upsert Teams Create or update multiple teams by external_id. Only attributes present in the payload are written @@ -103,7 +103,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[BulkUpsertTeamsError | ErrorsList | BulkUpsertTeamsResponse | ErrorsList] + Response[Union[BulkUpsertTeamsResponse, ErrorsList, Union['BulkUpsertTeamsError', 'ErrorsList']]] """ kwargs = _get_kwargs( @@ -121,7 +121,7 @@ def sync( *, client: AuthenticatedClient, body: BulkUpsertTeams, -) -> BulkUpsertTeamsError | ErrorsList | BulkUpsertTeamsResponse | ErrorsList | None: +) -> Optional[Union[BulkUpsertTeamsResponse, ErrorsList, Union["BulkUpsertTeamsError", "ErrorsList"]]]: """Bulk upsert Teams Create or update multiple teams by external_id. Only attributes present in the payload are written @@ -138,7 +138,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - BulkUpsertTeamsError | ErrorsList | BulkUpsertTeamsResponse | ErrorsList + Union[BulkUpsertTeamsResponse, ErrorsList, Union['BulkUpsertTeamsError', 'ErrorsList']] """ return sync_detailed( @@ -151,7 +151,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: BulkUpsertTeams, -) -> Response[BulkUpsertTeamsError | ErrorsList | BulkUpsertTeamsResponse | ErrorsList]: +) -> Response[Union[BulkUpsertTeamsResponse, ErrorsList, Union["BulkUpsertTeamsError", "ErrorsList"]]]: """Bulk upsert Teams Create or update multiple teams by external_id. Only attributes present in the payload are written @@ -168,7 +168,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[BulkUpsertTeamsError | ErrorsList | BulkUpsertTeamsResponse | ErrorsList] + Response[Union[BulkUpsertTeamsResponse, ErrorsList, Union['BulkUpsertTeamsError', 'ErrorsList']]] """ kwargs = _get_kwargs( @@ -184,7 +184,7 @@ async def asyncio( *, client: AuthenticatedClient, body: BulkUpsertTeams, -) -> BulkUpsertTeamsError | ErrorsList | BulkUpsertTeamsResponse | ErrorsList | None: +) -> Optional[Union[BulkUpsertTeamsResponse, ErrorsList, Union["BulkUpsertTeamsError", "ErrorsList"]]]: """Bulk upsert Teams Create or update multiple teams by external_id. Only attributes present in the payload are written @@ -201,7 +201,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - BulkUpsertTeamsError | ErrorsList | BulkUpsertTeamsResponse | ErrorsList + Union[BulkUpsertTeamsResponse, ErrorsList, Union['BulkUpsertTeamsError', 'ErrorsList']] """ return ( diff --git a/rootly_sdk/api/teams/create_group_catalog_property.py b/rootly_sdk/api/teams/create_group_catalog_property.py index c3a7a4ef..b089a497 100644 --- a/rootly_sdk/api/teams/create_group_catalog_property.py +++ b/rootly_sdk/api/teams/create_group_catalog_property.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> CatalogPropertyResponse | ErrorsList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[CatalogPropertyResponse, ErrorsList]]: if response.status_code == 201: response_201 = CatalogPropertyResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[CatalogPropertyResponse | ErrorsList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[CatalogPropertyResponse, ErrorsList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +69,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewCatalogProperty, -) -> Response[CatalogPropertyResponse | ErrorsList]: +) -> Response[Union[CatalogPropertyResponse, ErrorsList]]: """Creates a Catalog Property Creates a new Catalog Property from provided data @@ -82,7 +82,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CatalogPropertyResponse | ErrorsList] + Response[Union[CatalogPropertyResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: NewCatalogProperty, -) -> CatalogPropertyResponse | ErrorsList | None: +) -> Optional[Union[CatalogPropertyResponse, ErrorsList]]: """Creates a Catalog Property Creates a new Catalog Property from provided data @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CatalogPropertyResponse | ErrorsList + Union[CatalogPropertyResponse, ErrorsList] """ return sync_detailed( @@ -126,7 +126,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewCatalogProperty, -) -> Response[CatalogPropertyResponse | ErrorsList]: +) -> Response[Union[CatalogPropertyResponse, ErrorsList]]: """Creates a Catalog Property Creates a new Catalog Property from provided data @@ -139,7 +139,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CatalogPropertyResponse | ErrorsList] + Response[Union[CatalogPropertyResponse, ErrorsList]] """ kwargs = _get_kwargs( @@ -155,7 +155,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewCatalogProperty, -) -> CatalogPropertyResponse | ErrorsList | None: +) -> Optional[Union[CatalogPropertyResponse, ErrorsList]]: """Creates a Catalog Property Creates a new Catalog Property from provided data @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CatalogPropertyResponse | ErrorsList + Union[CatalogPropertyResponse, ErrorsList] """ return ( diff --git a/rootly_sdk/api/teams/create_team.py b/rootly_sdk/api/teams/create_team.py index aa00b3db..d4f48e06 100644 --- a/rootly_sdk/api/teams/create_team.py +++ b/rootly_sdk/api/teams/create_team.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | TeamResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, TeamResponse]]: if response.status_code == 201: response_201 = TeamResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | TeamResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, TeamResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +69,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewTeam, -) -> Response[ErrorsList | TeamResponse]: +) -> Response[Union[ErrorsList, TeamResponse]]: """Creates a team Creates a new team from provided data @@ -82,7 +82,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | TeamResponse] + Response[Union[ErrorsList, TeamResponse]] """ kwargs = _get_kwargs( @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: NewTeam, -) -> ErrorsList | TeamResponse | None: +) -> Optional[Union[ErrorsList, TeamResponse]]: """Creates a team Creates a new team from provided data @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | TeamResponse + Union[ErrorsList, TeamResponse] """ return sync_detailed( @@ -126,7 +126,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewTeam, -) -> Response[ErrorsList | TeamResponse]: +) -> Response[Union[ErrorsList, TeamResponse]]: """Creates a team Creates a new team from provided data @@ -139,7 +139,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | TeamResponse] + Response[Union[ErrorsList, TeamResponse]] """ kwargs = _get_kwargs( @@ -155,7 +155,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewTeam, -) -> ErrorsList | TeamResponse | None: +) -> Optional[Union[ErrorsList, TeamResponse]]: """Creates a team Creates a new team from provided data @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | TeamResponse + Union[ErrorsList, TeamResponse] """ return ( diff --git a/rootly_sdk/api/teams/delete_team.py b/rootly_sdk/api/teams/delete_team.py index bd6221ce..365021ed 100644 --- a/rootly_sdk/api/teams/delete_team.py +++ b/rootly_sdk/api/teams/delete_team.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union from uuid import UUID import httpx @@ -13,22 +12,19 @@ def _get_kwargs( - id: str | UUID, + id: Union[UUID, str], ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/teams/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/teams/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | TeamResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, TeamResponse]]: if response.status_code == 200: response_200 = TeamResponse.from_dict(response.json()) @@ -46,8 +42,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | TeamResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, TeamResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -57,23 +53,23 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Response[ErrorsList | TeamResponse]: +) -> Response[Union[ErrorsList, TeamResponse]]: """Delete a team Delete a specific team by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | TeamResponse] + Response[Union[ErrorsList, TeamResponse]] """ kwargs = _get_kwargs( @@ -88,23 +84,23 @@ def sync_detailed( def sync( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> ErrorsList | TeamResponse | None: +) -> Optional[Union[ErrorsList, TeamResponse]]: """Delete a team Delete a specific team by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | TeamResponse + Union[ErrorsList, TeamResponse] """ return sync_detailed( @@ -114,23 +110,23 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Response[ErrorsList | TeamResponse]: +) -> Response[Union[ErrorsList, TeamResponse]]: """Delete a team Delete a specific team by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | TeamResponse] + Response[Union[ErrorsList, TeamResponse]] """ kwargs = _get_kwargs( @@ -143,23 +139,23 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> ErrorsList | TeamResponse | None: +) -> Optional[Union[ErrorsList, TeamResponse]]: """Delete a team Delete a specific team by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | TeamResponse + Union[ErrorsList, TeamResponse] """ return ( diff --git a/rootly_sdk/api/teams/get_team.py b/rootly_sdk/api/teams/get_team.py index 3c4c049d..a679e777 100644 --- a/rootly_sdk/api/teams/get_team.py +++ b/rootly_sdk/api/teams/get_team.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union from uuid import UUID import httpx @@ -14,14 +13,13 @@ def _get_kwargs( - id: str | UUID, + id: Union[UUID, str], *, - include: GetTeamInclude | Unset = UNSET, + include: Union[Unset, GetTeamInclude] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} - json_include: str | Unset = UNSET + json_include: Union[Unset, str] = UNSET if not isinstance(include, Unset): json_include = include @@ -31,9 +29,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/teams/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/teams/{id}", "params": params, } @@ -41,8 +37,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | TeamResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, TeamResponse]]: if response.status_code == 200: response_200 = TeamResponse.from_dict(response.json()) @@ -60,8 +56,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | TeamResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, TeamResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -71,25 +67,25 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, - include: GetTeamInclude | Unset = UNSET, -) -> Response[ErrorsList | TeamResponse]: + include: Union[Unset, GetTeamInclude] = UNSET, +) -> Response[Union[ErrorsList, TeamResponse]]: """Retrieves a team Retrieves a specific team by id Args: - id (str | UUID): - include (GetTeamInclude | Unset): + id (Union[UUID, str]): + include (Union[Unset, GetTeamInclude]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | TeamResponse] + Response[Union[ErrorsList, TeamResponse]] """ kwargs = _get_kwargs( @@ -105,25 +101,25 @@ def sync_detailed( def sync( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, - include: GetTeamInclude | Unset = UNSET, -) -> ErrorsList | TeamResponse | None: + include: Union[Unset, GetTeamInclude] = UNSET, +) -> Optional[Union[ErrorsList, TeamResponse]]: """Retrieves a team Retrieves a specific team by id Args: - id (str | UUID): - include (GetTeamInclude | Unset): + id (Union[UUID, str]): + include (Union[Unset, GetTeamInclude]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | TeamResponse + Union[ErrorsList, TeamResponse] """ return sync_detailed( @@ -134,25 +130,25 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, - include: GetTeamInclude | Unset = UNSET, -) -> Response[ErrorsList | TeamResponse]: + include: Union[Unset, GetTeamInclude] = UNSET, +) -> Response[Union[ErrorsList, TeamResponse]]: """Retrieves a team Retrieves a specific team by id Args: - id (str | UUID): - include (GetTeamInclude | Unset): + id (Union[UUID, str]): + include (Union[Unset, GetTeamInclude]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | TeamResponse] + Response[Union[ErrorsList, TeamResponse]] """ kwargs = _get_kwargs( @@ -166,25 +162,25 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, - include: GetTeamInclude | Unset = UNSET, -) -> ErrorsList | TeamResponse | None: + include: Union[Unset, GetTeamInclude] = UNSET, +) -> Optional[Union[ErrorsList, TeamResponse]]: """Retrieves a team Retrieves a specific team by id Args: - id (str | UUID): - include (GetTeamInclude | Unset): + id (Union[UUID, str]): + include (Union[Unset, GetTeamInclude]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | TeamResponse + Union[ErrorsList, TeamResponse] """ return ( diff --git a/rootly_sdk/api/teams/get_team_incidents_chart.py b/rootly_sdk/api/teams/get_team_incidents_chart.py index 7f173bd8..8659d987 100644 --- a/rootly_sdk/api/teams/get_team_incidents_chart.py +++ b/rootly_sdk/api/teams/get_team_incidents_chart.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -16,7 +15,6 @@ def _get_kwargs( *, period: str, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["period"] = period @@ -25,9 +23,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/teams/{id}/incidents_chart".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/teams/{id}/incidents_chart", "params": params, } @@ -35,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | IncidentsChartResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, IncidentsChartResponse]]: if response.status_code == 200: response_200 = IncidentsChartResponse.from_dict(response.json()) @@ -54,8 +50,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | IncidentsChartResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, IncidentsChartResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +65,7 @@ def sync_detailed( *, client: AuthenticatedClient, period: str, -) -> Response[ErrorsList | IncidentsChartResponse]: +) -> Response[Union[ErrorsList, IncidentsChartResponse]]: """Get team incidents chart Get team incidents chart @@ -83,7 +79,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentsChartResponse] + Response[Union[ErrorsList, IncidentsChartResponse]] """ kwargs = _get_kwargs( @@ -103,7 +99,7 @@ def sync( *, client: AuthenticatedClient, period: str, -) -> ErrorsList | IncidentsChartResponse | None: +) -> Optional[Union[ErrorsList, IncidentsChartResponse]]: """Get team incidents chart Get team incidents chart @@ -117,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentsChartResponse + Union[ErrorsList, IncidentsChartResponse] """ return sync_detailed( @@ -132,7 +128,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, period: str, -) -> Response[ErrorsList | IncidentsChartResponse]: +) -> Response[Union[ErrorsList, IncidentsChartResponse]]: """Get team incidents chart Get team incidents chart @@ -146,7 +142,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | IncidentsChartResponse] + Response[Union[ErrorsList, IncidentsChartResponse]] """ kwargs = _get_kwargs( @@ -164,7 +160,7 @@ async def asyncio( *, client: AuthenticatedClient, period: str, -) -> ErrorsList | IncidentsChartResponse | None: +) -> Optional[Union[ErrorsList, IncidentsChartResponse]]: """Get team incidents chart Get team incidents chart @@ -178,7 +174,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | IncidentsChartResponse + Union[ErrorsList, IncidentsChartResponse] """ return ( diff --git a/rootly_sdk/api/teams/list_group_catalog_properties.py b/rootly_sdk/api/teams/list_group_catalog_properties.py index 59d899d2..5f27521e 100644 --- a/rootly_sdk/api/teams/list_group_catalog_properties.py +++ b/rootly_sdk/api/teams/list_group_catalog_properties.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -17,28 +17,27 @@ def _get_kwargs( *, - include: ListGroupCatalogPropertiesInclude | Unset = UNSET, - sort: ListGroupCatalogPropertiesSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Union[Unset, ListGroupCatalogPropertiesInclude] = UNSET, + sort: Union[Unset, ListGroupCatalogPropertiesSort] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterkind: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} - json_include: str | Unset = UNSET + json_include: Union[Unset, str] = UNSET if not isinstance(include, Unset): json_include = include params["include"] = json_include - json_sort: str | Unset = UNSET + json_sort: Union[Unset, str] = UNSET if not isinstance(sort, Unset): json_sort = sort @@ -73,7 +72,9 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> CatalogPropertyList | None: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[CatalogPropertyList]: if response.status_code == 200: response_200 = CatalogPropertyList.from_dict(response.json()) @@ -85,7 +86,9 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[CatalogPropertyList]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[CatalogPropertyList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -97,34 +100,34 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - include: ListGroupCatalogPropertiesInclude | Unset = UNSET, - sort: ListGroupCatalogPropertiesSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Union[Unset, ListGroupCatalogPropertiesInclude] = UNSET, + sort: Union[Unset, ListGroupCatalogPropertiesSort] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterkind: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, ) -> Response[CatalogPropertyList]: """List Catalog Properties List Group Catalog Properties Args: - include (ListGroupCatalogPropertiesInclude | Unset): - sort (ListGroupCatalogPropertiesSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterkind (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, ListGroupCatalogPropertiesInclude]): + sort (Union[Unset, ListGroupCatalogPropertiesSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterkind (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -158,34 +161,34 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: ListGroupCatalogPropertiesInclude | Unset = UNSET, - sort: ListGroupCatalogPropertiesSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, -) -> CatalogPropertyList | None: + include: Union[Unset, ListGroupCatalogPropertiesInclude] = UNSET, + sort: Union[Unset, ListGroupCatalogPropertiesSort] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterkind: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, +) -> Optional[CatalogPropertyList]: """List Catalog Properties List Group Catalog Properties Args: - include (ListGroupCatalogPropertiesInclude | Unset): - sort (ListGroupCatalogPropertiesSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterkind (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, ListGroupCatalogPropertiesInclude]): + sort (Union[Unset, ListGroupCatalogPropertiesSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterkind (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -214,34 +217,34 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: ListGroupCatalogPropertiesInclude | Unset = UNSET, - sort: ListGroupCatalogPropertiesSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Union[Unset, ListGroupCatalogPropertiesInclude] = UNSET, + sort: Union[Unset, ListGroupCatalogPropertiesSort] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterkind: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, ) -> Response[CatalogPropertyList]: """List Catalog Properties List Group Catalog Properties Args: - include (ListGroupCatalogPropertiesInclude | Unset): - sort (ListGroupCatalogPropertiesSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterkind (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, ListGroupCatalogPropertiesInclude]): + sort (Union[Unset, ListGroupCatalogPropertiesSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterkind (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -273,34 +276,34 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: ListGroupCatalogPropertiesInclude | Unset = UNSET, - sort: ListGroupCatalogPropertiesSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, -) -> CatalogPropertyList | None: + include: Union[Unset, ListGroupCatalogPropertiesInclude] = UNSET, + sort: Union[Unset, ListGroupCatalogPropertiesSort] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterkind: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, +) -> Optional[CatalogPropertyList]: """List Catalog Properties List Group Catalog Properties Args: - include (ListGroupCatalogPropertiesInclude | Unset): - sort (ListGroupCatalogPropertiesSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterkind (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, ListGroupCatalogPropertiesInclude]): + sort (Union[Unset, ListGroupCatalogPropertiesSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterkind (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/teams/list_teams.py b/rootly_sdk/api/teams/list_teams.py index 8ae9cdb6..e8cef2da 100644 --- a/rootly_sdk/api/teams/list_teams.py +++ b/rootly_sdk/api/teams/list_teams.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -12,49 +12,48 @@ def _get_kwargs( *, - include: ListTeamsInclude | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterbackstage_id: str | Unset = UNSET, - filtercortex_id: str | Unset = UNSET, - filteropslevel_id: str | Unset = UNSET, - filterexternal_id: str | Unset = UNSET, - filtercolor: str | Unset = UNSET, - filteralert_broadcast_enabled: bool | Unset = UNSET, - filterincident_broadcast_enabled: bool | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filtercoloreq: str | Unset = UNSET, - filtercolornot_eq: str | Unset = UNSET, - filtercolorin: str | Unset = UNSET, - filtercolornot_in: str | Unset = UNSET, - filteralert_broadcast_enabledeq: str | Unset = UNSET, - filteralert_broadcast_enablednot_eq: str | Unset = UNSET, - filteralert_broadcast_enabledin: str | Unset = UNSET, - filteralert_broadcast_enablednot_in: str | Unset = UNSET, - filterincident_broadcast_enabledeq: str | Unset = UNSET, - filterincident_broadcast_enablednot_eq: str | Unset = UNSET, - filterincident_broadcast_enabledin: str | Unset = UNSET, - filterincident_broadcast_enablednot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Union[Unset, ListTeamsInclude] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterbackstage_id: Union[Unset, str] = UNSET, + filtercortex_id: Union[Unset, str] = UNSET, + filteropslevel_id: Union[Unset, str] = UNSET, + filterexternal_id: Union[Unset, str] = UNSET, + filtercolor: Union[Unset, str] = UNSET, + filteralert_broadcast_enabled: Union[Unset, bool] = UNSET, + filterincident_broadcast_enabled: Union[Unset, bool] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filterslugeq: Union[Unset, str] = UNSET, + filterslugnot_eq: Union[Unset, str] = UNSET, + filterslugin: Union[Unset, str] = UNSET, + filterslugnot_in: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, + filtercoloreq: Union[Unset, str] = UNSET, + filtercolornot_eq: Union[Unset, str] = UNSET, + filtercolorin: Union[Unset, str] = UNSET, + filtercolornot_in: Union[Unset, str] = UNSET, + filteralert_broadcast_enabledeq: Union[Unset, str] = UNSET, + filteralert_broadcast_enablednot_eq: Union[Unset, str] = UNSET, + filteralert_broadcast_enabledin: Union[Unset, str] = UNSET, + filteralert_broadcast_enablednot_in: Union[Unset, str] = UNSET, + filterincident_broadcast_enabledeq: Union[Unset, str] = UNSET, + filterincident_broadcast_enablednot_eq: Union[Unset, str] = UNSET, + filterincident_broadcast_enabledin: Union[Unset, str] = UNSET, + filterincident_broadcast_enablednot_in: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} - json_include: str | Unset = UNSET + json_include: Union[Unset, str] = UNSET if not isinstance(include, Unset): json_include = include @@ -145,7 +144,7 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> TeamList | None: +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[TeamList]: if response.status_code == 200: response_200 = TeamList.from_dict(response.json()) @@ -157,7 +156,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[TeamList]: +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[TeamList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -169,88 +168,88 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - include: ListTeamsInclude | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterbackstage_id: str | Unset = UNSET, - filtercortex_id: str | Unset = UNSET, - filteropslevel_id: str | Unset = UNSET, - filterexternal_id: str | Unset = UNSET, - filtercolor: str | Unset = UNSET, - filteralert_broadcast_enabled: bool | Unset = UNSET, - filterincident_broadcast_enabled: bool | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filtercoloreq: str | Unset = UNSET, - filtercolornot_eq: str | Unset = UNSET, - filtercolorin: str | Unset = UNSET, - filtercolornot_in: str | Unset = UNSET, - filteralert_broadcast_enabledeq: str | Unset = UNSET, - filteralert_broadcast_enablednot_eq: str | Unset = UNSET, - filteralert_broadcast_enabledin: str | Unset = UNSET, - filteralert_broadcast_enablednot_in: str | Unset = UNSET, - filterincident_broadcast_enabledeq: str | Unset = UNSET, - filterincident_broadcast_enablednot_eq: str | Unset = UNSET, - filterincident_broadcast_enabledin: str | Unset = UNSET, - filterincident_broadcast_enablednot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Union[Unset, ListTeamsInclude] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterbackstage_id: Union[Unset, str] = UNSET, + filtercortex_id: Union[Unset, str] = UNSET, + filteropslevel_id: Union[Unset, str] = UNSET, + filterexternal_id: Union[Unset, str] = UNSET, + filtercolor: Union[Unset, str] = UNSET, + filteralert_broadcast_enabled: Union[Unset, bool] = UNSET, + filterincident_broadcast_enabled: Union[Unset, bool] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filterslugeq: Union[Unset, str] = UNSET, + filterslugnot_eq: Union[Unset, str] = UNSET, + filterslugin: Union[Unset, str] = UNSET, + filterslugnot_in: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, + filtercoloreq: Union[Unset, str] = UNSET, + filtercolornot_eq: Union[Unset, str] = UNSET, + filtercolorin: Union[Unset, str] = UNSET, + filtercolornot_in: Union[Unset, str] = UNSET, + filteralert_broadcast_enabledeq: Union[Unset, str] = UNSET, + filteralert_broadcast_enablednot_eq: Union[Unset, str] = UNSET, + filteralert_broadcast_enabledin: Union[Unset, str] = UNSET, + filteralert_broadcast_enablednot_in: Union[Unset, str] = UNSET, + filterincident_broadcast_enabledeq: Union[Unset, str] = UNSET, + filterincident_broadcast_enablednot_eq: Union[Unset, str] = UNSET, + filterincident_broadcast_enabledin: Union[Unset, str] = UNSET, + filterincident_broadcast_enablednot_in: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, ) -> Response[TeamList]: """List teams List teams Args: - include (ListTeamsInclude | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterbackstage_id (str | Unset): - filtercortex_id (str | Unset): - filteropslevel_id (str | Unset): - filterexternal_id (str | Unset): - filtercolor (str | Unset): - filteralert_broadcast_enabled (bool | Unset): - filterincident_broadcast_enabled (bool | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filtercoloreq (str | Unset): - filtercolornot_eq (str | Unset): - filtercolorin (str | Unset): - filtercolornot_in (str | Unset): - filteralert_broadcast_enabledeq (str | Unset): - filteralert_broadcast_enablednot_eq (str | Unset): - filteralert_broadcast_enabledin (str | Unset): - filteralert_broadcast_enablednot_in (str | Unset): - filterincident_broadcast_enabledeq (str | Unset): - filterincident_broadcast_enablednot_eq (str | Unset): - filterincident_broadcast_enabledin (str | Unset): - filterincident_broadcast_enablednot_in (str | Unset): - sort (str | Unset): + include (Union[Unset, ListTeamsInclude]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterbackstage_id (Union[Unset, str]): + filtercortex_id (Union[Unset, str]): + filteropslevel_id (Union[Unset, str]): + filterexternal_id (Union[Unset, str]): + filtercolor (Union[Unset, str]): + filteralert_broadcast_enabled (Union[Unset, bool]): + filterincident_broadcast_enabled (Union[Unset, bool]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filtercoloreq (Union[Unset, str]): + filtercolornot_eq (Union[Unset, str]): + filtercolorin (Union[Unset, str]): + filtercolornot_in (Union[Unset, str]): + filteralert_broadcast_enabledeq (Union[Unset, str]): + filteralert_broadcast_enablednot_eq (Union[Unset, str]): + filteralert_broadcast_enabledin (Union[Unset, str]): + filteralert_broadcast_enablednot_in (Union[Unset, str]): + filterincident_broadcast_enabledeq (Union[Unset, str]): + filterincident_broadcast_enablednot_eq (Union[Unset, str]): + filterincident_broadcast_enabledin (Union[Unset, str]): + filterincident_broadcast_enablednot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -311,88 +310,88 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: ListTeamsInclude | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterbackstage_id: str | Unset = UNSET, - filtercortex_id: str | Unset = UNSET, - filteropslevel_id: str | Unset = UNSET, - filterexternal_id: str | Unset = UNSET, - filtercolor: str | Unset = UNSET, - filteralert_broadcast_enabled: bool | Unset = UNSET, - filterincident_broadcast_enabled: bool | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filtercoloreq: str | Unset = UNSET, - filtercolornot_eq: str | Unset = UNSET, - filtercolorin: str | Unset = UNSET, - filtercolornot_in: str | Unset = UNSET, - filteralert_broadcast_enabledeq: str | Unset = UNSET, - filteralert_broadcast_enablednot_eq: str | Unset = UNSET, - filteralert_broadcast_enabledin: str | Unset = UNSET, - filteralert_broadcast_enablednot_in: str | Unset = UNSET, - filterincident_broadcast_enabledeq: str | Unset = UNSET, - filterincident_broadcast_enablednot_eq: str | Unset = UNSET, - filterincident_broadcast_enabledin: str | Unset = UNSET, - filterincident_broadcast_enablednot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, -) -> TeamList | None: + include: Union[Unset, ListTeamsInclude] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterbackstage_id: Union[Unset, str] = UNSET, + filtercortex_id: Union[Unset, str] = UNSET, + filteropslevel_id: Union[Unset, str] = UNSET, + filterexternal_id: Union[Unset, str] = UNSET, + filtercolor: Union[Unset, str] = UNSET, + filteralert_broadcast_enabled: Union[Unset, bool] = UNSET, + filterincident_broadcast_enabled: Union[Unset, bool] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filterslugeq: Union[Unset, str] = UNSET, + filterslugnot_eq: Union[Unset, str] = UNSET, + filterslugin: Union[Unset, str] = UNSET, + filterslugnot_in: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, + filtercoloreq: Union[Unset, str] = UNSET, + filtercolornot_eq: Union[Unset, str] = UNSET, + filtercolorin: Union[Unset, str] = UNSET, + filtercolornot_in: Union[Unset, str] = UNSET, + filteralert_broadcast_enabledeq: Union[Unset, str] = UNSET, + filteralert_broadcast_enablednot_eq: Union[Unset, str] = UNSET, + filteralert_broadcast_enabledin: Union[Unset, str] = UNSET, + filteralert_broadcast_enablednot_in: Union[Unset, str] = UNSET, + filterincident_broadcast_enabledeq: Union[Unset, str] = UNSET, + filterincident_broadcast_enablednot_eq: Union[Unset, str] = UNSET, + filterincident_broadcast_enabledin: Union[Unset, str] = UNSET, + filterincident_broadcast_enablednot_in: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, +) -> Optional[TeamList]: """List teams List teams Args: - include (ListTeamsInclude | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterbackstage_id (str | Unset): - filtercortex_id (str | Unset): - filteropslevel_id (str | Unset): - filterexternal_id (str | Unset): - filtercolor (str | Unset): - filteralert_broadcast_enabled (bool | Unset): - filterincident_broadcast_enabled (bool | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filtercoloreq (str | Unset): - filtercolornot_eq (str | Unset): - filtercolorin (str | Unset): - filtercolornot_in (str | Unset): - filteralert_broadcast_enabledeq (str | Unset): - filteralert_broadcast_enablednot_eq (str | Unset): - filteralert_broadcast_enabledin (str | Unset): - filteralert_broadcast_enablednot_in (str | Unset): - filterincident_broadcast_enabledeq (str | Unset): - filterincident_broadcast_enablednot_eq (str | Unset): - filterincident_broadcast_enabledin (str | Unset): - filterincident_broadcast_enablednot_in (str | Unset): - sort (str | Unset): + include (Union[Unset, ListTeamsInclude]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterbackstage_id (Union[Unset, str]): + filtercortex_id (Union[Unset, str]): + filteropslevel_id (Union[Unset, str]): + filterexternal_id (Union[Unset, str]): + filtercolor (Union[Unset, str]): + filteralert_broadcast_enabled (Union[Unset, bool]): + filterincident_broadcast_enabled (Union[Unset, bool]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filtercoloreq (Union[Unset, str]): + filtercolornot_eq (Union[Unset, str]): + filtercolorin (Union[Unset, str]): + filtercolornot_in (Union[Unset, str]): + filteralert_broadcast_enabledeq (Union[Unset, str]): + filteralert_broadcast_enablednot_eq (Union[Unset, str]): + filteralert_broadcast_enabledin (Union[Unset, str]): + filteralert_broadcast_enablednot_in (Union[Unset, str]): + filterincident_broadcast_enabledeq (Union[Unset, str]): + filterincident_broadcast_enablednot_eq (Union[Unset, str]): + filterincident_broadcast_enabledin (Union[Unset, str]): + filterincident_broadcast_enablednot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -448,88 +447,88 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: ListTeamsInclude | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterbackstage_id: str | Unset = UNSET, - filtercortex_id: str | Unset = UNSET, - filteropslevel_id: str | Unset = UNSET, - filterexternal_id: str | Unset = UNSET, - filtercolor: str | Unset = UNSET, - filteralert_broadcast_enabled: bool | Unset = UNSET, - filterincident_broadcast_enabled: bool | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filtercoloreq: str | Unset = UNSET, - filtercolornot_eq: str | Unset = UNSET, - filtercolorin: str | Unset = UNSET, - filtercolornot_in: str | Unset = UNSET, - filteralert_broadcast_enabledeq: str | Unset = UNSET, - filteralert_broadcast_enablednot_eq: str | Unset = UNSET, - filteralert_broadcast_enabledin: str | Unset = UNSET, - filteralert_broadcast_enablednot_in: str | Unset = UNSET, - filterincident_broadcast_enabledeq: str | Unset = UNSET, - filterincident_broadcast_enablednot_eq: str | Unset = UNSET, - filterincident_broadcast_enabledin: str | Unset = UNSET, - filterincident_broadcast_enablednot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, + include: Union[Unset, ListTeamsInclude] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterbackstage_id: Union[Unset, str] = UNSET, + filtercortex_id: Union[Unset, str] = UNSET, + filteropslevel_id: Union[Unset, str] = UNSET, + filterexternal_id: Union[Unset, str] = UNSET, + filtercolor: Union[Unset, str] = UNSET, + filteralert_broadcast_enabled: Union[Unset, bool] = UNSET, + filterincident_broadcast_enabled: Union[Unset, bool] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filterslugeq: Union[Unset, str] = UNSET, + filterslugnot_eq: Union[Unset, str] = UNSET, + filterslugin: Union[Unset, str] = UNSET, + filterslugnot_in: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, + filtercoloreq: Union[Unset, str] = UNSET, + filtercolornot_eq: Union[Unset, str] = UNSET, + filtercolorin: Union[Unset, str] = UNSET, + filtercolornot_in: Union[Unset, str] = UNSET, + filteralert_broadcast_enabledeq: Union[Unset, str] = UNSET, + filteralert_broadcast_enablednot_eq: Union[Unset, str] = UNSET, + filteralert_broadcast_enabledin: Union[Unset, str] = UNSET, + filteralert_broadcast_enablednot_in: Union[Unset, str] = UNSET, + filterincident_broadcast_enabledeq: Union[Unset, str] = UNSET, + filterincident_broadcast_enablednot_eq: Union[Unset, str] = UNSET, + filterincident_broadcast_enabledin: Union[Unset, str] = UNSET, + filterincident_broadcast_enablednot_in: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, ) -> Response[TeamList]: """List teams List teams Args: - include (ListTeamsInclude | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterbackstage_id (str | Unset): - filtercortex_id (str | Unset): - filteropslevel_id (str | Unset): - filterexternal_id (str | Unset): - filtercolor (str | Unset): - filteralert_broadcast_enabled (bool | Unset): - filterincident_broadcast_enabled (bool | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filtercoloreq (str | Unset): - filtercolornot_eq (str | Unset): - filtercolorin (str | Unset): - filtercolornot_in (str | Unset): - filteralert_broadcast_enabledeq (str | Unset): - filteralert_broadcast_enablednot_eq (str | Unset): - filteralert_broadcast_enabledin (str | Unset): - filteralert_broadcast_enablednot_in (str | Unset): - filterincident_broadcast_enabledeq (str | Unset): - filterincident_broadcast_enablednot_eq (str | Unset): - filterincident_broadcast_enabledin (str | Unset): - filterincident_broadcast_enablednot_in (str | Unset): - sort (str | Unset): + include (Union[Unset, ListTeamsInclude]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterbackstage_id (Union[Unset, str]): + filtercortex_id (Union[Unset, str]): + filteropslevel_id (Union[Unset, str]): + filterexternal_id (Union[Unset, str]): + filtercolor (Union[Unset, str]): + filteralert_broadcast_enabled (Union[Unset, bool]): + filterincident_broadcast_enabled (Union[Unset, bool]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filtercoloreq (Union[Unset, str]): + filtercolornot_eq (Union[Unset, str]): + filtercolorin (Union[Unset, str]): + filtercolornot_in (Union[Unset, str]): + filteralert_broadcast_enabledeq (Union[Unset, str]): + filteralert_broadcast_enablednot_eq (Union[Unset, str]): + filteralert_broadcast_enabledin (Union[Unset, str]): + filteralert_broadcast_enablednot_in (Union[Unset, str]): + filterincident_broadcast_enabledeq (Union[Unset, str]): + filterincident_broadcast_enablednot_eq (Union[Unset, str]): + filterincident_broadcast_enabledin (Union[Unset, str]): + filterincident_broadcast_enablednot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -588,88 +587,88 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: ListTeamsInclude | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterbackstage_id: str | Unset = UNSET, - filtercortex_id: str | Unset = UNSET, - filteropslevel_id: str | Unset = UNSET, - filterexternal_id: str | Unset = UNSET, - filtercolor: str | Unset = UNSET, - filteralert_broadcast_enabled: bool | Unset = UNSET, - filterincident_broadcast_enabled: bool | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filtercoloreq: str | Unset = UNSET, - filtercolornot_eq: str | Unset = UNSET, - filtercolorin: str | Unset = UNSET, - filtercolornot_in: str | Unset = UNSET, - filteralert_broadcast_enabledeq: str | Unset = UNSET, - filteralert_broadcast_enablednot_eq: str | Unset = UNSET, - filteralert_broadcast_enabledin: str | Unset = UNSET, - filteralert_broadcast_enablednot_in: str | Unset = UNSET, - filterincident_broadcast_enabledeq: str | Unset = UNSET, - filterincident_broadcast_enablednot_eq: str | Unset = UNSET, - filterincident_broadcast_enabledin: str | Unset = UNSET, - filterincident_broadcast_enablednot_in: str | Unset = UNSET, - sort: str | Unset = UNSET, -) -> TeamList | None: + include: Union[Unset, ListTeamsInclude] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterbackstage_id: Union[Unset, str] = UNSET, + filtercortex_id: Union[Unset, str] = UNSET, + filteropslevel_id: Union[Unset, str] = UNSET, + filterexternal_id: Union[Unset, str] = UNSET, + filtercolor: Union[Unset, str] = UNSET, + filteralert_broadcast_enabled: Union[Unset, bool] = UNSET, + filterincident_broadcast_enabled: Union[Unset, bool] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filterslugeq: Union[Unset, str] = UNSET, + filterslugnot_eq: Union[Unset, str] = UNSET, + filterslugin: Union[Unset, str] = UNSET, + filterslugnot_in: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, + filtercoloreq: Union[Unset, str] = UNSET, + filtercolornot_eq: Union[Unset, str] = UNSET, + filtercolorin: Union[Unset, str] = UNSET, + filtercolornot_in: Union[Unset, str] = UNSET, + filteralert_broadcast_enabledeq: Union[Unset, str] = UNSET, + filteralert_broadcast_enablednot_eq: Union[Unset, str] = UNSET, + filteralert_broadcast_enabledin: Union[Unset, str] = UNSET, + filteralert_broadcast_enablednot_in: Union[Unset, str] = UNSET, + filterincident_broadcast_enabledeq: Union[Unset, str] = UNSET, + filterincident_broadcast_enablednot_eq: Union[Unset, str] = UNSET, + filterincident_broadcast_enabledin: Union[Unset, str] = UNSET, + filterincident_broadcast_enablednot_in: Union[Unset, str] = UNSET, + sort: Union[Unset, str] = UNSET, +) -> Optional[TeamList]: """List teams List teams Args: - include (ListTeamsInclude | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filterslug (str | Unset): - filtername (str | Unset): - filterbackstage_id (str | Unset): - filtercortex_id (str | Unset): - filteropslevel_id (str | Unset): - filterexternal_id (str | Unset): - filtercolor (str | Unset): - filteralert_broadcast_enabled (bool | Unset): - filterincident_broadcast_enabled (bool | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filtercoloreq (str | Unset): - filtercolornot_eq (str | Unset): - filtercolorin (str | Unset): - filtercolornot_in (str | Unset): - filteralert_broadcast_enabledeq (str | Unset): - filteralert_broadcast_enablednot_eq (str | Unset): - filteralert_broadcast_enabledin (str | Unset): - filteralert_broadcast_enablednot_in (str | Unset): - filterincident_broadcast_enabledeq (str | Unset): - filterincident_broadcast_enablednot_eq (str | Unset): - filterincident_broadcast_enabledin (str | Unset): - filterincident_broadcast_enablednot_in (str | Unset): - sort (str | Unset): + include (Union[Unset, ListTeamsInclude]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): + filterbackstage_id (Union[Unset, str]): + filtercortex_id (Union[Unset, str]): + filteropslevel_id (Union[Unset, str]): + filterexternal_id (Union[Unset, str]): + filtercolor (Union[Unset, str]): + filteralert_broadcast_enabled (Union[Unset, bool]): + filterincident_broadcast_enabled (Union[Unset, bool]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filtercoloreq (Union[Unset, str]): + filtercolornot_eq (Union[Unset, str]): + filtercolorin (Union[Unset, str]): + filtercolornot_in (Union[Unset, str]): + filteralert_broadcast_enabledeq (Union[Unset, str]): + filteralert_broadcast_enablednot_eq (Union[Unset, str]): + filteralert_broadcast_enabledin (Union[Unset, str]): + filteralert_broadcast_enablednot_in (Union[Unset, str]): + filterincident_broadcast_enabledeq (Union[Unset, str]): + filterincident_broadcast_enablednot_eq (Union[Unset, str]): + filterincident_broadcast_enabledin (Union[Unset, str]): + filterincident_broadcast_enablednot_in (Union[Unset, str]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/teams/update_team.py b/rootly_sdk/api/teams/update_team.py index b555e950..590299b0 100644 --- a/rootly_sdk/api/teams/update_team.py +++ b/rootly_sdk/api/teams/update_team.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union from uuid import UUID import httpx @@ -14,7 +13,7 @@ def _get_kwargs( - id: str | UUID, + id: Union[UUID, str], *, body: UpdateTeam, ) -> dict[str, Any]: @@ -22,9 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/teams/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/teams/{id}", } _kwargs["json"] = body.to_dict() @@ -36,8 +33,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | TeamResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, TeamResponse]]: if response.status_code == 200: response_200 = TeamResponse.from_dict(response.json()) @@ -55,8 +52,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | TeamResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, TeamResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,17 +63,17 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdateTeam, -) -> Response[ErrorsList | TeamResponse]: +) -> Response[Union[ErrorsList, TeamResponse]]: """Update a team Update a specific team by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateTeam): Raises: @@ -84,7 +81,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | TeamResponse] + Response[Union[ErrorsList, TeamResponse]] """ kwargs = _get_kwargs( @@ -100,17 +97,17 @@ def sync_detailed( def sync( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdateTeam, -) -> ErrorsList | TeamResponse | None: +) -> Optional[Union[ErrorsList, TeamResponse]]: """Update a team Update a specific team by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateTeam): Raises: @@ -118,7 +115,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | TeamResponse + Union[ErrorsList, TeamResponse] """ return sync_detailed( @@ -129,17 +126,17 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdateTeam, -) -> Response[ErrorsList | TeamResponse]: +) -> Response[Union[ErrorsList, TeamResponse]]: """Update a team Update a specific team by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateTeam): Raises: @@ -147,7 +144,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | TeamResponse] + Response[Union[ErrorsList, TeamResponse]] """ kwargs = _get_kwargs( @@ -161,17 +158,17 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdateTeam, -) -> ErrorsList | TeamResponse | None: +) -> Optional[Union[ErrorsList, TeamResponse]]: """Update a team Update a specific team by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateTeam): Raises: @@ -179,7 +176,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | TeamResponse + Union[ErrorsList, TeamResponse] """ return ( diff --git a/rootly_sdk/api/user_email_addresses/create_user_email_address.py b/rootly_sdk/api/user_email_addresses/create_user_email_address.py index 74446851..0f5a7e2b 100644 --- a/rootly_sdk/api/user_email_addresses/create_user_email_address.py +++ b/rootly_sdk/api/user_email_addresses/create_user_email_address.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/users/{user_id}/email_addresses".format( - user_id=quote(str(user_id), safe=""), - ), + "url": f"/v1/users/{user_id}/email_addresses", } _kwargs["json"] = body.to_dict() @@ -35,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | UserEmailAddressResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, UserEmailAddressResponse]]: if response.status_code == 201: response_201 = UserEmailAddressResponse.from_dict(response.json()) @@ -64,8 +61,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | UserEmailAddressResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, UserEmailAddressResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -79,7 +76,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewUserEmailAddress, -) -> Response[ErrorsList | UserEmailAddressResponse]: +) -> Response[Union[ErrorsList, UserEmailAddressResponse]]: """Creates a user email address Creates a new user email address from provided data @@ -93,7 +90,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | UserEmailAddressResponse] + Response[Union[ErrorsList, UserEmailAddressResponse]] """ kwargs = _get_kwargs( @@ -113,7 +110,7 @@ def sync( *, client: AuthenticatedClient, body: NewUserEmailAddress, -) -> ErrorsList | UserEmailAddressResponse | None: +) -> Optional[Union[ErrorsList, UserEmailAddressResponse]]: """Creates a user email address Creates a new user email address from provided data @@ -127,7 +124,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | UserEmailAddressResponse + Union[ErrorsList, UserEmailAddressResponse] """ return sync_detailed( @@ -142,7 +139,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewUserEmailAddress, -) -> Response[ErrorsList | UserEmailAddressResponse]: +) -> Response[Union[ErrorsList, UserEmailAddressResponse]]: """Creates a user email address Creates a new user email address from provided data @@ -156,7 +153,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | UserEmailAddressResponse] + Response[Union[ErrorsList, UserEmailAddressResponse]] """ kwargs = _get_kwargs( @@ -174,7 +171,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewUserEmailAddress, -) -> ErrorsList | UserEmailAddressResponse | None: +) -> Optional[Union[ErrorsList, UserEmailAddressResponse]]: """Creates a user email address Creates a new user email address from provided data @@ -188,7 +185,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | UserEmailAddressResponse + Union[ErrorsList, UserEmailAddressResponse] """ return ( diff --git a/rootly_sdk/api/user_email_addresses/delete_user_email_address.py b/rootly_sdk/api/user_email_addresses/delete_user_email_address.py index 48fb3366..afad9ca2 100644 --- a/rootly_sdk/api/user_email_addresses/delete_user_email_address.py +++ b/rootly_sdk/api/user_email_addresses/delete_user_email_address.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/email_addresses/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/email_addresses/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | UserEmailAddressResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, UserEmailAddressResponse]]: if response.status_code == 200: response_200 = UserEmailAddressResponse.from_dict(response.json()) @@ -50,8 +46,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | UserEmailAddressResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, UserEmailAddressResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -64,7 +60,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | UserEmailAddressResponse]: +) -> Response[Union[ErrorsList, UserEmailAddressResponse]]: """Delete user email address Deletes a user email address @@ -77,7 +73,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | UserEmailAddressResponse] + Response[Union[ErrorsList, UserEmailAddressResponse]] """ kwargs = _get_kwargs( @@ -95,7 +91,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | UserEmailAddressResponse | None: +) -> Optional[Union[ErrorsList, UserEmailAddressResponse]]: """Delete user email address Deletes a user email address @@ -108,7 +104,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | UserEmailAddressResponse + Union[ErrorsList, UserEmailAddressResponse] """ return sync_detailed( @@ -121,7 +117,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | UserEmailAddressResponse]: +) -> Response[Union[ErrorsList, UserEmailAddressResponse]]: """Delete user email address Deletes a user email address @@ -134,7 +130,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | UserEmailAddressResponse] + Response[Union[ErrorsList, UserEmailAddressResponse]] """ kwargs = _get_kwargs( @@ -150,7 +146,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | UserEmailAddressResponse | None: +) -> Optional[Union[ErrorsList, UserEmailAddressResponse]]: """Delete user email address Deletes a user email address @@ -163,7 +159,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | UserEmailAddressResponse + Union[ErrorsList, UserEmailAddressResponse] """ return ( diff --git a/rootly_sdk/api/user_email_addresses/get_user_email_addresses.py b/rootly_sdk/api/user_email_addresses/get_user_email_addresses.py index 1787502c..f3a4dc5a 100644 --- a/rootly_sdk/api/user_email_addresses/get_user_email_addresses.py +++ b/rootly_sdk/api/user_email_addresses/get_user_email_addresses.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( user_id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/users/{user_id}/email_addresses".format( - user_id=quote(str(user_id), safe=""), - ), + "url": f"/v1/users/{user_id}/email_addresses", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | UserEmailAddressList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, UserEmailAddressList]]: if response.status_code == 200: response_200 = UserEmailAddressList.from_dict(response.json()) @@ -50,8 +46,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | UserEmailAddressList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, UserEmailAddressList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -64,7 +60,7 @@ def sync_detailed( user_id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | UserEmailAddressList]: +) -> Response[Union[ErrorsList, UserEmailAddressList]]: """Retrieves user email addresses Retrieves all email addresses for the specified user @@ -77,7 +73,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | UserEmailAddressList] + Response[Union[ErrorsList, UserEmailAddressList]] """ kwargs = _get_kwargs( @@ -95,7 +91,7 @@ def sync( user_id: str, *, client: AuthenticatedClient, -) -> ErrorsList | UserEmailAddressList | None: +) -> Optional[Union[ErrorsList, UserEmailAddressList]]: """Retrieves user email addresses Retrieves all email addresses for the specified user @@ -108,7 +104,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | UserEmailAddressList + Union[ErrorsList, UserEmailAddressList] """ return sync_detailed( @@ -121,7 +117,7 @@ async def asyncio_detailed( user_id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | UserEmailAddressList]: +) -> Response[Union[ErrorsList, UserEmailAddressList]]: """Retrieves user email addresses Retrieves all email addresses for the specified user @@ -134,7 +130,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | UserEmailAddressList] + Response[Union[ErrorsList, UserEmailAddressList]] """ kwargs = _get_kwargs( @@ -150,7 +146,7 @@ async def asyncio( user_id: str, *, client: AuthenticatedClient, -) -> ErrorsList | UserEmailAddressList | None: +) -> Optional[Union[ErrorsList, UserEmailAddressList]]: """Retrieves user email addresses Retrieves all email addresses for the specified user @@ -163,7 +159,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | UserEmailAddressList + Union[ErrorsList, UserEmailAddressList] """ return ( diff --git a/rootly_sdk/api/user_email_addresses/resend_user_email_address_verification.py b/rootly_sdk/api/user_email_addresses/resend_user_email_address_verification.py index f2cffd4b..6e85b335 100644 --- a/rootly_sdk/api/user_email_addresses/resend_user_email_address_verification.py +++ b/rootly_sdk/api/user_email_addresses/resend_user_email_address_verification.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/email_addresses/{id}/resend_verification".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/email_addresses/{id}/resend_verification", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | UserEmailAddressResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, UserEmailAddressResponse]]: if response.status_code == 200: response_200 = UserEmailAddressResponse.from_dict(response.json()) @@ -50,8 +46,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | UserEmailAddressResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, UserEmailAddressResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -64,7 +60,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | UserEmailAddressResponse]: +) -> Response[Union[ErrorsList, UserEmailAddressResponse]]: """Resends verification email Resends verification email for an email address @@ -77,7 +73,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | UserEmailAddressResponse] + Response[Union[ErrorsList, UserEmailAddressResponse]] """ kwargs = _get_kwargs( @@ -95,7 +91,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | UserEmailAddressResponse | None: +) -> Optional[Union[ErrorsList, UserEmailAddressResponse]]: """Resends verification email Resends verification email for an email address @@ -108,7 +104,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | UserEmailAddressResponse + Union[ErrorsList, UserEmailAddressResponse] """ return sync_detailed( @@ -121,7 +117,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | UserEmailAddressResponse]: +) -> Response[Union[ErrorsList, UserEmailAddressResponse]]: """Resends verification email Resends verification email for an email address @@ -134,7 +130,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | UserEmailAddressResponse] + Response[Union[ErrorsList, UserEmailAddressResponse]] """ kwargs = _get_kwargs( @@ -150,7 +146,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | UserEmailAddressResponse | None: +) -> Optional[Union[ErrorsList, UserEmailAddressResponse]]: """Resends verification email Resends verification email for an email address @@ -163,7 +159,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | UserEmailAddressResponse + Union[ErrorsList, UserEmailAddressResponse] """ return ( diff --git a/rootly_sdk/api/user_email_addresses/show_user_email_address.py b/rootly_sdk/api/user_email_addresses/show_user_email_address.py index 7d07adf5..e2e9e680 100644 --- a/rootly_sdk/api/user_email_addresses/show_user_email_address.py +++ b/rootly_sdk/api/user_email_addresses/show_user_email_address.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/email_addresses/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/email_addresses/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | UserEmailAddressResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, UserEmailAddressResponse]]: if response.status_code == 200: response_200 = UserEmailAddressResponse.from_dict(response.json()) @@ -50,8 +46,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | UserEmailAddressResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, UserEmailAddressResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -64,7 +60,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | UserEmailAddressResponse]: +) -> Response[Union[ErrorsList, UserEmailAddressResponse]]: """Show user email address Retrieves a specific user email address @@ -77,7 +73,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | UserEmailAddressResponse] + Response[Union[ErrorsList, UserEmailAddressResponse]] """ kwargs = _get_kwargs( @@ -95,7 +91,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | UserEmailAddressResponse | None: +) -> Optional[Union[ErrorsList, UserEmailAddressResponse]]: """Show user email address Retrieves a specific user email address @@ -108,7 +104,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | UserEmailAddressResponse + Union[ErrorsList, UserEmailAddressResponse] """ return sync_detailed( @@ -121,7 +117,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | UserEmailAddressResponse]: +) -> Response[Union[ErrorsList, UserEmailAddressResponse]]: """Show user email address Retrieves a specific user email address @@ -134,7 +130,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | UserEmailAddressResponse] + Response[Union[ErrorsList, UserEmailAddressResponse]] """ kwargs = _get_kwargs( @@ -150,7 +146,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | UserEmailAddressResponse | None: +) -> Optional[Union[ErrorsList, UserEmailAddressResponse]]: """Show user email address Retrieves a specific user email address @@ -163,7 +159,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | UserEmailAddressResponse + Union[ErrorsList, UserEmailAddressResponse] """ return ( diff --git a/rootly_sdk/api/user_email_addresses/update_user_email_address.py b/rootly_sdk/api/user_email_addresses/update_user_email_address.py index 2c5e414d..de27a6ad 100644 --- a/rootly_sdk/api/user_email_addresses/update_user_email_address.py +++ b/rootly_sdk/api/user_email_addresses/update_user_email_address.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/email_addresses/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/email_addresses/{id}", } _kwargs["json"] = body.to_dict() @@ -35,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | UserEmailAddressResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, UserEmailAddressResponse]]: if response.status_code == 200: response_200 = UserEmailAddressResponse.from_dict(response.json()) @@ -64,8 +61,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | UserEmailAddressResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, UserEmailAddressResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -79,7 +76,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateUserEmailAddress, -) -> Response[ErrorsList | UserEmailAddressResponse]: +) -> Response[Union[ErrorsList, UserEmailAddressResponse]]: """Update user email address Updates a user email address @@ -93,7 +90,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | UserEmailAddressResponse] + Response[Union[ErrorsList, UserEmailAddressResponse]] """ kwargs = _get_kwargs( @@ -113,7 +110,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateUserEmailAddress, -) -> ErrorsList | UserEmailAddressResponse | None: +) -> Optional[Union[ErrorsList, UserEmailAddressResponse]]: """Update user email address Updates a user email address @@ -127,7 +124,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | UserEmailAddressResponse + Union[ErrorsList, UserEmailAddressResponse] """ return sync_detailed( @@ -142,7 +139,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateUserEmailAddress, -) -> Response[ErrorsList | UserEmailAddressResponse]: +) -> Response[Union[ErrorsList, UserEmailAddressResponse]]: """Update user email address Updates a user email address @@ -156,7 +153,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | UserEmailAddressResponse] + Response[Union[ErrorsList, UserEmailAddressResponse]] """ kwargs = _get_kwargs( @@ -174,7 +171,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateUserEmailAddress, -) -> ErrorsList | UserEmailAddressResponse | None: +) -> Optional[Union[ErrorsList, UserEmailAddressResponse]]: """Update user email address Updates a user email address @@ -188,7 +185,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | UserEmailAddressResponse + Union[ErrorsList, UserEmailAddressResponse] """ return ( diff --git a/rootly_sdk/api/user_email_addresses/verify_user_email_address.py b/rootly_sdk/api/user_email_addresses/verify_user_email_address.py index 87d89043..7fe99ebd 100644 --- a/rootly_sdk/api/user_email_addresses/verify_user_email_address.py +++ b/rootly_sdk/api/user_email_addresses/verify_user_email_address.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -16,7 +15,6 @@ def _get_kwargs( *, token: str, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["token"] = token @@ -25,9 +23,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/email_addresses/{id}/verify".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/email_addresses/{id}/verify", "params": params, } @@ -35,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | UserEmailAddressResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, UserEmailAddressResponse]]: if response.status_code == 200: response_200 = UserEmailAddressResponse.from_dict(response.json()) @@ -59,8 +55,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | UserEmailAddressResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, UserEmailAddressResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -74,7 +70,7 @@ def sync_detailed( *, client: AuthenticatedClient, token: str, -) -> Response[ErrorsList | UserEmailAddressResponse]: +) -> Response[Union[ErrorsList, UserEmailAddressResponse]]: """Verifies an email address with token Verifies an email address using a verification token @@ -88,7 +84,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | UserEmailAddressResponse] + Response[Union[ErrorsList, UserEmailAddressResponse]] """ kwargs = _get_kwargs( @@ -108,7 +104,7 @@ def sync( *, client: AuthenticatedClient, token: str, -) -> ErrorsList | UserEmailAddressResponse | None: +) -> Optional[Union[ErrorsList, UserEmailAddressResponse]]: """Verifies an email address with token Verifies an email address using a verification token @@ -122,7 +118,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | UserEmailAddressResponse + Union[ErrorsList, UserEmailAddressResponse] """ return sync_detailed( @@ -137,7 +133,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, token: str, -) -> Response[ErrorsList | UserEmailAddressResponse]: +) -> Response[Union[ErrorsList, UserEmailAddressResponse]]: """Verifies an email address with token Verifies an email address using a verification token @@ -151,7 +147,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | UserEmailAddressResponse] + Response[Union[ErrorsList, UserEmailAddressResponse]] """ kwargs = _get_kwargs( @@ -169,7 +165,7 @@ async def asyncio( *, client: AuthenticatedClient, token: str, -) -> ErrorsList | UserEmailAddressResponse | None: +) -> Optional[Union[ErrorsList, UserEmailAddressResponse]]: """Verifies an email address with token Verifies an email address using a verification token @@ -183,7 +179,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | UserEmailAddressResponse + Union[ErrorsList, UserEmailAddressResponse] """ return ( diff --git a/rootly_sdk/api/user_notification_rules/create_user_notification_rule.py b/rootly_sdk/api/user_notification_rules/create_user_notification_rule.py index 38aa6b53..9852ef02 100644 --- a/rootly_sdk/api/user_notification_rules/create_user_notification_rule.py +++ b/rootly_sdk/api/user_notification_rules/create_user_notification_rule.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/users/{user_id}/notification_rules".format( - user_id=quote(str(user_id), safe=""), - ), + "url": f"/v1/users/{user_id}/notification_rules", } _kwargs["json"] = body.to_dict() @@ -35,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | UserNotificationRuleResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, UserNotificationRuleResponse]]: if response.status_code == 201: response_201 = UserNotificationRuleResponse.from_dict(response.json()) @@ -59,8 +56,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | UserNotificationRuleResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, UserNotificationRuleResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -74,7 +71,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewUserNotificationRule, -) -> Response[ErrorsList | UserNotificationRuleResponse]: +) -> Response[Union[ErrorsList, UserNotificationRuleResponse]]: """Creates an user notification rule Creates a new user notification rule from provided data @@ -88,7 +85,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | UserNotificationRuleResponse] + Response[Union[ErrorsList, UserNotificationRuleResponse]] """ kwargs = _get_kwargs( @@ -108,7 +105,7 @@ def sync( *, client: AuthenticatedClient, body: NewUserNotificationRule, -) -> ErrorsList | UserNotificationRuleResponse | None: +) -> Optional[Union[ErrorsList, UserNotificationRuleResponse]]: """Creates an user notification rule Creates a new user notification rule from provided data @@ -122,7 +119,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | UserNotificationRuleResponse + Union[ErrorsList, UserNotificationRuleResponse] """ return sync_detailed( @@ -137,7 +134,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewUserNotificationRule, -) -> Response[ErrorsList | UserNotificationRuleResponse]: +) -> Response[Union[ErrorsList, UserNotificationRuleResponse]]: """Creates an user notification rule Creates a new user notification rule from provided data @@ -151,7 +148,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | UserNotificationRuleResponse] + Response[Union[ErrorsList, UserNotificationRuleResponse]] """ kwargs = _get_kwargs( @@ -169,7 +166,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewUserNotificationRule, -) -> ErrorsList | UserNotificationRuleResponse | None: +) -> Optional[Union[ErrorsList, UserNotificationRuleResponse]]: """Creates an user notification rule Creates a new user notification rule from provided data @@ -183,7 +180,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | UserNotificationRuleResponse + Union[ErrorsList, UserNotificationRuleResponse] """ return ( diff --git a/rootly_sdk/api/user_notification_rules/delete_user_notification_rule.py b/rootly_sdk/api/user_notification_rules/delete_user_notification_rule.py index 45a0a726..7fc24fab 100644 --- a/rootly_sdk/api/user_notification_rules/delete_user_notification_rule.py +++ b/rootly_sdk/api/user_notification_rules/delete_user_notification_rule.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/notification_rules/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/notification_rules/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | UserNotificationRuleResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, UserNotificationRuleResponse]]: if response.status_code == 200: response_200 = UserNotificationRuleResponse.from_dict(response.json()) @@ -45,8 +41,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | UserNotificationRuleResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, UserNotificationRuleResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | UserNotificationRuleResponse]: +) -> Response[Union[ErrorsList, UserNotificationRuleResponse]]: """Delete an user notification rule Delete a specific user notification rule by id @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | UserNotificationRuleResponse] + Response[Union[ErrorsList, UserNotificationRuleResponse]] """ kwargs = _get_kwargs( @@ -90,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | UserNotificationRuleResponse | None: +) -> Optional[Union[ErrorsList, UserNotificationRuleResponse]]: """Delete an user notification rule Delete a specific user notification rule by id @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | UserNotificationRuleResponse + Union[ErrorsList, UserNotificationRuleResponse] """ return sync_detailed( @@ -116,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | UserNotificationRuleResponse]: +) -> Response[Union[ErrorsList, UserNotificationRuleResponse]]: """Delete an user notification rule Delete a specific user notification rule by id @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | UserNotificationRuleResponse] + Response[Union[ErrorsList, UserNotificationRuleResponse]] """ kwargs = _get_kwargs( @@ -145,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | UserNotificationRuleResponse | None: +) -> Optional[Union[ErrorsList, UserNotificationRuleResponse]]: """Delete an user notification rule Delete a specific user notification rule by id @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | UserNotificationRuleResponse + Union[ErrorsList, UserNotificationRuleResponse] """ return ( diff --git a/rootly_sdk/api/user_notification_rules/get_user_notification_rule.py b/rootly_sdk/api/user_notification_rules/get_user_notification_rule.py index 1c214c69..c42708ed 100644 --- a/rootly_sdk/api/user_notification_rules/get_user_notification_rule.py +++ b/rootly_sdk/api/user_notification_rules/get_user_notification_rule.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/notification_rules/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/notification_rules/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | UserNotificationRuleResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, UserNotificationRuleResponse]]: if response.status_code == 200: response_200 = UserNotificationRuleResponse.from_dict(response.json()) @@ -45,8 +41,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | UserNotificationRuleResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, UserNotificationRuleResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | UserNotificationRuleResponse]: +) -> Response[Union[ErrorsList, UserNotificationRuleResponse]]: """Retrieves an user notification rule Retrieves a specific user notification rule by id @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | UserNotificationRuleResponse] + Response[Union[ErrorsList, UserNotificationRuleResponse]] """ kwargs = _get_kwargs( @@ -90,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | UserNotificationRuleResponse | None: +) -> Optional[Union[ErrorsList, UserNotificationRuleResponse]]: """Retrieves an user notification rule Retrieves a specific user notification rule by id @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | UserNotificationRuleResponse + Union[ErrorsList, UserNotificationRuleResponse] """ return sync_detailed( @@ -116,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | UserNotificationRuleResponse]: +) -> Response[Union[ErrorsList, UserNotificationRuleResponse]]: """Retrieves an user notification rule Retrieves a specific user notification rule by id @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | UserNotificationRuleResponse] + Response[Union[ErrorsList, UserNotificationRuleResponse]] """ kwargs = _get_kwargs( @@ -145,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | UserNotificationRuleResponse | None: +) -> Optional[Union[ErrorsList, UserNotificationRuleResponse]]: """Retrieves an user notification rule Retrieves a specific user notification rule by id @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | UserNotificationRuleResponse + Union[ErrorsList, UserNotificationRuleResponse] """ return ( diff --git a/rootly_sdk/api/user_notification_rules/list_user_notification_rules.py b/rootly_sdk/api/user_notification_rules/list_user_notification_rules.py index 839b2ca9..b1e1c3a2 100644 --- a/rootly_sdk/api/user_notification_rules/list_user_notification_rules.py +++ b/rootly_sdk/api/user_notification_rules/list_user_notification_rules.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -13,12 +12,11 @@ def _get_kwargs( user_id: str, *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - sort: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + sort: Union[Unset, str] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -33,9 +31,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/users/{user_id}/notification_rules".format( - user_id=quote(str(user_id), safe=""), - ), + "url": f"/v1/users/{user_id}/notification_rules", "params": params, } @@ -43,8 +39,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> UserNotificationRuleList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[UserNotificationRuleList]: if response.status_code == 200: response_200 = UserNotificationRuleList.from_dict(response.json()) @@ -57,7 +53,7 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[UserNotificationRuleList]: return Response( status_code=HTTPStatus(response.status_code), @@ -71,10 +67,10 @@ def sync_detailed( user_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - sort: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + sort: Union[Unset, str] = UNSET, ) -> Response[UserNotificationRuleList]: """List user notification rules @@ -82,10 +78,10 @@ def sync_detailed( Args: user_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -114,21 +110,21 @@ def sync( user_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - sort: str | Unset = UNSET, -) -> UserNotificationRuleList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + sort: Union[Unset, str] = UNSET, +) -> Optional[UserNotificationRuleList]: """List user notification rules List user notification rules Args: user_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -152,10 +148,10 @@ async def asyncio_detailed( user_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - sort: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + sort: Union[Unset, str] = UNSET, ) -> Response[UserNotificationRuleList]: """List user notification rules @@ -163,10 +159,10 @@ async def asyncio_detailed( Args: user_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -193,21 +189,21 @@ async def asyncio( user_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - sort: str | Unset = UNSET, -) -> UserNotificationRuleList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + sort: Union[Unset, str] = UNSET, +) -> Optional[UserNotificationRuleList]: """List user notification rules List user notification rules Args: user_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - sort (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + sort (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/user_notification_rules/update_user_notification_rule.py b/rootly_sdk/api/user_notification_rules/update_user_notification_rule.py index 39e99b2b..26a2f4e2 100644 --- a/rootly_sdk/api/user_notification_rules/update_user_notification_rule.py +++ b/rootly_sdk/api/user_notification_rules/update_user_notification_rule.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/notification_rules/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/notification_rules/{id}", } _kwargs["json"] = body.to_dict() @@ -35,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | UserNotificationRuleResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, UserNotificationRuleResponse]]: if response.status_code == 200: response_200 = UserNotificationRuleResponse.from_dict(response.json()) @@ -54,8 +51,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | UserNotificationRuleResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, UserNotificationRuleResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateUserNotificationRule, -) -> Response[ErrorsList | UserNotificationRuleResponse]: +) -> Response[Union[ErrorsList, UserNotificationRuleResponse]]: """Update an user notification rule Update a specific user notification rule by id @@ -83,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | UserNotificationRuleResponse] + Response[Union[ErrorsList, UserNotificationRuleResponse]] """ kwargs = _get_kwargs( @@ -103,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateUserNotificationRule, -) -> ErrorsList | UserNotificationRuleResponse | None: +) -> Optional[Union[ErrorsList, UserNotificationRuleResponse]]: """Update an user notification rule Update a specific user notification rule by id @@ -117,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | UserNotificationRuleResponse + Union[ErrorsList, UserNotificationRuleResponse] """ return sync_detailed( @@ -132,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateUserNotificationRule, -) -> Response[ErrorsList | UserNotificationRuleResponse]: +) -> Response[Union[ErrorsList, UserNotificationRuleResponse]]: """Update an user notification rule Update a specific user notification rule by id @@ -146,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | UserNotificationRuleResponse] + Response[Union[ErrorsList, UserNotificationRuleResponse]] """ kwargs = _get_kwargs( @@ -164,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateUserNotificationRule, -) -> ErrorsList | UserNotificationRuleResponse | None: +) -> Optional[Union[ErrorsList, UserNotificationRuleResponse]]: """Update an user notification rule Update a specific user notification rule by id @@ -178,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | UserNotificationRuleResponse + Union[ErrorsList, UserNotificationRuleResponse] """ return ( diff --git a/rootly_sdk/api/user_phone_numbers/create_user_phone_number.py b/rootly_sdk/api/user_phone_numbers/create_user_phone_number.py index 4e6fc622..f70fcda9 100644 --- a/rootly_sdk/api/user_phone_numbers/create_user_phone_number.py +++ b/rootly_sdk/api/user_phone_numbers/create_user_phone_number.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/users/{user_id}/phone_numbers".format( - user_id=quote(str(user_id), safe=""), - ), + "url": f"/v1/users/{user_id}/phone_numbers", } _kwargs["json"] = body.to_dict() @@ -35,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | UserPhoneNumberResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, UserPhoneNumberResponse]]: if response.status_code == 201: response_201 = UserPhoneNumberResponse.from_dict(response.json()) @@ -64,8 +61,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | UserPhoneNumberResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, UserPhoneNumberResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -79,7 +76,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewUserPhoneNumber, -) -> Response[ErrorsList | UserPhoneNumberResponse]: +) -> Response[Union[ErrorsList, UserPhoneNumberResponse]]: """Creates a user phone number Creates a new user phone number from provided data @@ -93,7 +90,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | UserPhoneNumberResponse] + Response[Union[ErrorsList, UserPhoneNumberResponse]] """ kwargs = _get_kwargs( @@ -113,7 +110,7 @@ def sync( *, client: AuthenticatedClient, body: NewUserPhoneNumber, -) -> ErrorsList | UserPhoneNumberResponse | None: +) -> Optional[Union[ErrorsList, UserPhoneNumberResponse]]: """Creates a user phone number Creates a new user phone number from provided data @@ -127,7 +124,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | UserPhoneNumberResponse + Union[ErrorsList, UserPhoneNumberResponse] """ return sync_detailed( @@ -142,7 +139,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewUserPhoneNumber, -) -> Response[ErrorsList | UserPhoneNumberResponse]: +) -> Response[Union[ErrorsList, UserPhoneNumberResponse]]: """Creates a user phone number Creates a new user phone number from provided data @@ -156,7 +153,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | UserPhoneNumberResponse] + Response[Union[ErrorsList, UserPhoneNumberResponse]] """ kwargs = _get_kwargs( @@ -174,7 +171,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewUserPhoneNumber, -) -> ErrorsList | UserPhoneNumberResponse | None: +) -> Optional[Union[ErrorsList, UserPhoneNumberResponse]]: """Creates a user phone number Creates a new user phone number from provided data @@ -188,7 +185,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | UserPhoneNumberResponse + Union[ErrorsList, UserPhoneNumberResponse] """ return ( diff --git a/rootly_sdk/api/user_phone_numbers/delete_user_phone_number.py b/rootly_sdk/api/user_phone_numbers/delete_user_phone_number.py index 0b556c98..1126603d 100644 --- a/rootly_sdk/api/user_phone_numbers/delete_user_phone_number.py +++ b/rootly_sdk/api/user_phone_numbers/delete_user_phone_number.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/phone_numbers/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/phone_numbers/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | UserPhoneNumberResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, UserPhoneNumberResponse]]: if response.status_code == 200: response_200 = UserPhoneNumberResponse.from_dict(response.json()) @@ -55,8 +51,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | UserPhoneNumberResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, UserPhoneNumberResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +65,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | UserPhoneNumberResponse]: +) -> Response[Union[ErrorsList, UserPhoneNumberResponse]]: """Delete user phone number Deletes a user phone number @@ -82,7 +78,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | UserPhoneNumberResponse] + Response[Union[ErrorsList, UserPhoneNumberResponse]] """ kwargs = _get_kwargs( @@ -100,7 +96,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | UserPhoneNumberResponse | None: +) -> Optional[Union[ErrorsList, UserPhoneNumberResponse]]: """Delete user phone number Deletes a user phone number @@ -113,7 +109,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | UserPhoneNumberResponse + Union[ErrorsList, UserPhoneNumberResponse] """ return sync_detailed( @@ -126,7 +122,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | UserPhoneNumberResponse]: +) -> Response[Union[ErrorsList, UserPhoneNumberResponse]]: """Delete user phone number Deletes a user phone number @@ -139,7 +135,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | UserPhoneNumberResponse] + Response[Union[ErrorsList, UserPhoneNumberResponse]] """ kwargs = _get_kwargs( @@ -155,7 +151,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | UserPhoneNumberResponse | None: +) -> Optional[Union[ErrorsList, UserPhoneNumberResponse]]: """Delete user phone number Deletes a user phone number @@ -168,7 +164,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | UserPhoneNumberResponse + Union[ErrorsList, UserPhoneNumberResponse] """ return ( diff --git a/rootly_sdk/api/user_phone_numbers/get_user_phone_numbers.py b/rootly_sdk/api/user_phone_numbers/get_user_phone_numbers.py index 7e8d2f71..5bc2b4ce 100644 --- a/rootly_sdk/api/user_phone_numbers/get_user_phone_numbers.py +++ b/rootly_sdk/api/user_phone_numbers/get_user_phone_numbers.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( user_id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/users/{user_id}/phone_numbers".format( - user_id=quote(str(user_id), safe=""), - ), + "url": f"/v1/users/{user_id}/phone_numbers", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | UserPhoneNumberList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, UserPhoneNumberList]]: if response.status_code == 200: response_200 = UserPhoneNumberList.from_dict(response.json()) @@ -50,8 +46,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | UserPhoneNumberList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, UserPhoneNumberList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -64,7 +60,7 @@ def sync_detailed( user_id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | UserPhoneNumberList]: +) -> Response[Union[ErrorsList, UserPhoneNumberList]]: """Retrieves user phone numbers Retrieves all phone numbers for the specified user @@ -77,7 +73,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | UserPhoneNumberList] + Response[Union[ErrorsList, UserPhoneNumberList]] """ kwargs = _get_kwargs( @@ -95,7 +91,7 @@ def sync( user_id: str, *, client: AuthenticatedClient, -) -> ErrorsList | UserPhoneNumberList | None: +) -> Optional[Union[ErrorsList, UserPhoneNumberList]]: """Retrieves user phone numbers Retrieves all phone numbers for the specified user @@ -108,7 +104,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | UserPhoneNumberList + Union[ErrorsList, UserPhoneNumberList] """ return sync_detailed( @@ -121,7 +117,7 @@ async def asyncio_detailed( user_id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | UserPhoneNumberList]: +) -> Response[Union[ErrorsList, UserPhoneNumberList]]: """Retrieves user phone numbers Retrieves all phone numbers for the specified user @@ -134,7 +130,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | UserPhoneNumberList] + Response[Union[ErrorsList, UserPhoneNumberList]] """ kwargs = _get_kwargs( @@ -150,7 +146,7 @@ async def asyncio( user_id: str, *, client: AuthenticatedClient, -) -> ErrorsList | UserPhoneNumberList | None: +) -> Optional[Union[ErrorsList, UserPhoneNumberList]]: """Retrieves user phone numbers Retrieves all phone numbers for the specified user @@ -163,7 +159,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | UserPhoneNumberList + Union[ErrorsList, UserPhoneNumberList] """ return ( diff --git a/rootly_sdk/api/user_phone_numbers/show_user_phone_number.py b/rootly_sdk/api/user_phone_numbers/show_user_phone_number.py index 6cfafbed..770751c3 100644 --- a/rootly_sdk/api/user_phone_numbers/show_user_phone_number.py +++ b/rootly_sdk/api/user_phone_numbers/show_user_phone_number.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/phone_numbers/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/phone_numbers/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | UserPhoneNumberResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, UserPhoneNumberResponse]]: if response.status_code == 200: response_200 = UserPhoneNumberResponse.from_dict(response.json()) @@ -50,8 +46,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | UserPhoneNumberResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, UserPhoneNumberResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -64,7 +60,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | UserPhoneNumberResponse]: +) -> Response[Union[ErrorsList, UserPhoneNumberResponse]]: """Show user phone number Retrieves a specific user phone number @@ -77,7 +73,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | UserPhoneNumberResponse] + Response[Union[ErrorsList, UserPhoneNumberResponse]] """ kwargs = _get_kwargs( @@ -95,7 +91,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | UserPhoneNumberResponse | None: +) -> Optional[Union[ErrorsList, UserPhoneNumberResponse]]: """Show user phone number Retrieves a specific user phone number @@ -108,7 +104,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | UserPhoneNumberResponse + Union[ErrorsList, UserPhoneNumberResponse] """ return sync_detailed( @@ -121,7 +117,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | UserPhoneNumberResponse]: +) -> Response[Union[ErrorsList, UserPhoneNumberResponse]]: """Show user phone number Retrieves a specific user phone number @@ -134,7 +130,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | UserPhoneNumberResponse] + Response[Union[ErrorsList, UserPhoneNumberResponse]] """ kwargs = _get_kwargs( @@ -150,7 +146,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | UserPhoneNumberResponse | None: +) -> Optional[Union[ErrorsList, UserPhoneNumberResponse]]: """Show user phone number Retrieves a specific user phone number @@ -163,7 +159,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | UserPhoneNumberResponse + Union[ErrorsList, UserPhoneNumberResponse] """ return ( diff --git a/rootly_sdk/api/user_phone_numbers/update_user_phone_number.py b/rootly_sdk/api/user_phone_numbers/update_user_phone_number.py index 6dcffd23..b9302312 100644 --- a/rootly_sdk/api/user_phone_numbers/update_user_phone_number.py +++ b/rootly_sdk/api/user_phone_numbers/update_user_phone_number.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/phone_numbers/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/phone_numbers/{id}", } _kwargs["json"] = body.to_dict() @@ -35,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | UserPhoneNumberResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, UserPhoneNumberResponse]]: if response.status_code == 200: response_200 = UserPhoneNumberResponse.from_dict(response.json()) @@ -64,8 +61,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | UserPhoneNumberResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, UserPhoneNumberResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -79,7 +76,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateUserPhoneNumber, -) -> Response[ErrorsList | UserPhoneNumberResponse]: +) -> Response[Union[ErrorsList, UserPhoneNumberResponse]]: """Update user phone number Updates a user phone number @@ -93,7 +90,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | UserPhoneNumberResponse] + Response[Union[ErrorsList, UserPhoneNumberResponse]] """ kwargs = _get_kwargs( @@ -113,7 +110,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateUserPhoneNumber, -) -> ErrorsList | UserPhoneNumberResponse | None: +) -> Optional[Union[ErrorsList, UserPhoneNumberResponse]]: """Update user phone number Updates a user phone number @@ -127,7 +124,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | UserPhoneNumberResponse + Union[ErrorsList, UserPhoneNumberResponse] """ return sync_detailed( @@ -142,7 +139,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateUserPhoneNumber, -) -> Response[ErrorsList | UserPhoneNumberResponse]: +) -> Response[Union[ErrorsList, UserPhoneNumberResponse]]: """Update user phone number Updates a user phone number @@ -156,7 +153,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | UserPhoneNumberResponse] + Response[Union[ErrorsList, UserPhoneNumberResponse]] """ kwargs = _get_kwargs( @@ -174,7 +171,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateUserPhoneNumber, -) -> ErrorsList | UserPhoneNumberResponse | None: +) -> Optional[Union[ErrorsList, UserPhoneNumberResponse]]: """Update user phone number Updates a user phone number @@ -188,7 +185,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | UserPhoneNumberResponse + Union[ErrorsList, UserPhoneNumberResponse] """ return ( diff --git a/rootly_sdk/api/users/delete_user.py b/rootly_sdk/api/users/delete_user.py index e0be4b19..81465710 100644 --- a/rootly_sdk/api/users/delete_user.py +++ b/rootly_sdk/api/users/delete_user.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/users/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/users/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | UserResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, UserResponse]]: if response.status_code == 200: response_200 = UserResponse.from_dict(response.json()) @@ -45,8 +41,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | UserResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, UserResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | UserResponse]: +) -> Response[Union[ErrorsList, UserResponse]]: """Delete an user Delete a specific user by id @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | UserResponse] + Response[Union[ErrorsList, UserResponse]] """ kwargs = _get_kwargs( @@ -90,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | UserResponse | None: +) -> Optional[Union[ErrorsList, UserResponse]]: """Delete an user Delete a specific user by id @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | UserResponse + Union[ErrorsList, UserResponse] """ return sync_detailed( @@ -116,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | UserResponse]: +) -> Response[Union[ErrorsList, UserResponse]]: """Delete an user Delete a specific user by id @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | UserResponse] + Response[Union[ErrorsList, UserResponse]] """ kwargs = _get_kwargs( @@ -145,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | UserResponse | None: +) -> Optional[Union[ErrorsList, UserResponse]]: """Delete an user Delete a specific user by id @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | UserResponse + Union[ErrorsList, UserResponse] """ return ( diff --git a/rootly_sdk/api/users/get_current_user.py b/rootly_sdk/api/users/get_current_user.py index 054c8451..d121d249 100644 --- a/rootly_sdk/api/users/get_current_user.py +++ b/rootly_sdk/api/users/get_current_user.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -11,7 +11,6 @@ def _get_kwargs() -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", "url": "/v1/users/me", @@ -21,8 +20,8 @@ def _get_kwargs() -> dict[str, Any]: def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | UserResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, UserResponse]]: if response.status_code == 200: response_200 = UserResponse.from_dict(response.json()) @@ -40,8 +39,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | UserResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, UserResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -53,7 +52,7 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, -) -> Response[ErrorsList | UserResponse]: +) -> Response[Union[ErrorsList, UserResponse]]: """Get current user Get current user @@ -63,7 +62,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | UserResponse] + Response[Union[ErrorsList, UserResponse]] """ kwargs = _get_kwargs() @@ -78,7 +77,7 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, -) -> ErrorsList | UserResponse | None: +) -> Optional[Union[ErrorsList, UserResponse]]: """Get current user Get current user @@ -88,7 +87,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | UserResponse + Union[ErrorsList, UserResponse] """ return sync_detailed( @@ -99,7 +98,7 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, -) -> Response[ErrorsList | UserResponse]: +) -> Response[Union[ErrorsList, UserResponse]]: """Get current user Get current user @@ -109,7 +108,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | UserResponse] + Response[Union[ErrorsList, UserResponse]] """ kwargs = _get_kwargs() @@ -122,7 +121,7 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, -) -> ErrorsList | UserResponse | None: +) -> Optional[Union[ErrorsList, UserResponse]]: """Get current user Get current user @@ -132,7 +131,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | UserResponse + Union[ErrorsList, UserResponse] """ return ( diff --git a/rootly_sdk/api/users/get_user.py b/rootly_sdk/api/users/get_user.py index 7000acf4..ae91581a 100644 --- a/rootly_sdk/api/users/get_user.py +++ b/rootly_sdk/api/users/get_user.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -15,12 +14,11 @@ def _get_kwargs( id: str, *, - include: GetUserInclude | Unset = UNSET, + include: Union[Unset, GetUserInclude] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} - json_include: str | Unset = UNSET + json_include: Union[Unset, str] = UNSET if not isinstance(include, Unset): json_include = include @@ -30,9 +28,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/users/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/users/{id}", "params": params, } @@ -40,8 +36,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | UserResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, UserResponse]]: if response.status_code == 200: response_200 = UserResponse.from_dict(response.json()) @@ -59,8 +55,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | UserResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, UserResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -73,22 +69,22 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, - include: GetUserInclude | Unset = UNSET, -) -> Response[ErrorsList | UserResponse]: + include: Union[Unset, GetUserInclude] = UNSET, +) -> Response[Union[ErrorsList, UserResponse]]: """Retrieves an user Retrieves a specific user by id Args: id (str): - include (GetUserInclude | Unset): + include (Union[Unset, GetUserInclude]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | UserResponse] + Response[Union[ErrorsList, UserResponse]] """ kwargs = _get_kwargs( @@ -107,22 +103,22 @@ def sync( id: str, *, client: AuthenticatedClient, - include: GetUserInclude | Unset = UNSET, -) -> ErrorsList | UserResponse | None: + include: Union[Unset, GetUserInclude] = UNSET, +) -> Optional[Union[ErrorsList, UserResponse]]: """Retrieves an user Retrieves a specific user by id Args: id (str): - include (GetUserInclude | Unset): + include (Union[Unset, GetUserInclude]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | UserResponse + Union[ErrorsList, UserResponse] """ return sync_detailed( @@ -136,22 +132,22 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, - include: GetUserInclude | Unset = UNSET, -) -> Response[ErrorsList | UserResponse]: + include: Union[Unset, GetUserInclude] = UNSET, +) -> Response[Union[ErrorsList, UserResponse]]: """Retrieves an user Retrieves a specific user by id Args: id (str): - include (GetUserInclude | Unset): + include (Union[Unset, GetUserInclude]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | UserResponse] + Response[Union[ErrorsList, UserResponse]] """ kwargs = _get_kwargs( @@ -168,22 +164,22 @@ async def asyncio( id: str, *, client: AuthenticatedClient, - include: GetUserInclude | Unset = UNSET, -) -> ErrorsList | UserResponse | None: + include: Union[Unset, GetUserInclude] = UNSET, +) -> Optional[Union[ErrorsList, UserResponse]]: """Retrieves an user Retrieves a specific user by id Args: id (str): - include (GetUserInclude | Unset): + include (Union[Unset, GetUserInclude]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | UserResponse + Union[ErrorsList, UserResponse] """ return ( diff --git a/rootly_sdk/api/users/list_users.py b/rootly_sdk/api/users/list_users.py index 7ef32a0b..60b82cf1 100644 --- a/rootly_sdk/api/users/list_users.py +++ b/rootly_sdk/api/users/list_users.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -14,18 +14,17 @@ def _get_kwargs( *, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filteremail: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: ListUsersSort | Unset = UNSET, - include: ListUsersInclude | Unset = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filteremail: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + sort: Union[Unset, ListUsersSort] = UNSET, + include: Union[Unset, ListUsersInclude] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["page[number]"] = pagenumber @@ -44,13 +43,13 @@ def _get_kwargs( params["filter[created_at][lte]"] = filtercreated_atlte - json_sort: str | Unset = UNSET + json_sort: Union[Unset, str] = UNSET if not isinstance(sort, Unset): json_sort = sort params["sort"] = json_sort - json_include: str | Unset = UNSET + json_include: Union[Unset, str] = UNSET if not isinstance(include, Unset): json_include = include @@ -67,7 +66,9 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> ErrorsList | UserList | None: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, UserList]]: if response.status_code == 200: response_200 = UserList.from_dict(response.json()) @@ -85,8 +86,8 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | UserList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, UserList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -98,39 +99,39 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filteremail: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: ListUsersSort | Unset = UNSET, - include: ListUsersInclude | Unset = UNSET, -) -> Response[ErrorsList | UserList]: + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filteremail: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + sort: Union[Unset, ListUsersSort] = UNSET, + include: Union[Unset, ListUsersInclude] = UNSET, +) -> Response[Union[ErrorsList, UserList]]: """List users List users Args: - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filteremail (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - sort (ListUsersSort | Unset): - include (ListUsersInclude | Unset): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filteremail (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + sort (Union[Unset, ListUsersSort]): + include (Union[Unset, ListUsersInclude]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | UserList] + Response[Union[ErrorsList, UserList]] """ kwargs = _get_kwargs( @@ -156,39 +157,39 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filteremail: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: ListUsersSort | Unset = UNSET, - include: ListUsersInclude | Unset = UNSET, -) -> ErrorsList | UserList | None: + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filteremail: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + sort: Union[Unset, ListUsersSort] = UNSET, + include: Union[Unset, ListUsersInclude] = UNSET, +) -> Optional[Union[ErrorsList, UserList]]: """List users List users Args: - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filteremail (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - sort (ListUsersSort | Unset): - include (ListUsersInclude | Unset): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filteremail (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + sort (Union[Unset, ListUsersSort]): + include (Union[Unset, ListUsersInclude]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | UserList + Union[ErrorsList, UserList] """ return sync_detailed( @@ -209,39 +210,39 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filteremail: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: ListUsersSort | Unset = UNSET, - include: ListUsersInclude | Unset = UNSET, -) -> Response[ErrorsList | UserList]: + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filteremail: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + sort: Union[Unset, ListUsersSort] = UNSET, + include: Union[Unset, ListUsersInclude] = UNSET, +) -> Response[Union[ErrorsList, UserList]]: """List users List users Args: - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filteremail (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - sort (ListUsersSort | Unset): - include (ListUsersInclude | Unset): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filteremail (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + sort (Union[Unset, ListUsersSort]): + include (Union[Unset, ListUsersInclude]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | UserList] + Response[Union[ErrorsList, UserList]] """ kwargs = _get_kwargs( @@ -265,39 +266,39 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filteremail: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - sort: ListUsersSort | Unset = UNSET, - include: ListUsersInclude | Unset = UNSET, -) -> ErrorsList | UserList | None: + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filteremail: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + sort: Union[Unset, ListUsersSort] = UNSET, + include: Union[Unset, ListUsersInclude] = UNSET, +) -> Optional[Union[ErrorsList, UserList]]: """List users List users Args: - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filteremail (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - sort (ListUsersSort | Unset): - include (ListUsersInclude | Unset): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filteremail (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + sort (Union[Unset, ListUsersSort]): + include (Union[Unset, ListUsersInclude]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | UserList + Union[ErrorsList, UserList] """ return ( diff --git a/rootly_sdk/api/users/update_user.py b/rootly_sdk/api/users/update_user.py index 40ac5b44..993c9597 100644 --- a/rootly_sdk/api/users/update_user.py +++ b/rootly_sdk/api/users/update_user.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -9,25 +8,22 @@ from ...models.errors_list import ErrorsList from ...models.update_user import UpdateUser from ...models.user_response import UserResponse -from ...types import UNSET, Response, Unset +from ...types import Response def _get_kwargs( id: str, *, - body: UpdateUser | Unset = UNSET, + body: UpdateUser, ) -> dict[str, Any]: headers: dict[str, Any] = {} _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/users/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/users/{id}", } - if not isinstance(body, Unset): - _kwargs["json"] = body.to_dict() + _kwargs["json"] = body.to_dict() headers["Content-Type"] = "application/vnd.api+json" @@ -36,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | UserResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, UserResponse]]: if response.status_code == 200: response_200 = UserResponse.from_dict(response.json()) @@ -55,8 +51,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | UserResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, UserResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,22 +65,22 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, - body: UpdateUser | Unset = UNSET, -) -> Response[ErrorsList | UserResponse]: + body: UpdateUser, +) -> Response[Union[ErrorsList, UserResponse]]: """Update a user Update a specific user by id Args: id (str): - body (UpdateUser | Unset): + body (UpdateUser): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | UserResponse] + Response[Union[ErrorsList, UserResponse]] """ kwargs = _get_kwargs( @@ -103,22 +99,22 @@ def sync( id: str, *, client: AuthenticatedClient, - body: UpdateUser | Unset = UNSET, -) -> ErrorsList | UserResponse | None: + body: UpdateUser, +) -> Optional[Union[ErrorsList, UserResponse]]: """Update a user Update a specific user by id Args: id (str): - body (UpdateUser | Unset): + body (UpdateUser): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | UserResponse + Union[ErrorsList, UserResponse] """ return sync_detailed( @@ -132,22 +128,22 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, - body: UpdateUser | Unset = UNSET, -) -> Response[ErrorsList | UserResponse]: + body: UpdateUser, +) -> Response[Union[ErrorsList, UserResponse]]: """Update a user Update a specific user by id Args: id (str): - body (UpdateUser | Unset): + body (UpdateUser): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | UserResponse] + Response[Union[ErrorsList, UserResponse]] """ kwargs = _get_kwargs( @@ -164,22 +160,22 @@ async def asyncio( id: str, *, client: AuthenticatedClient, - body: UpdateUser | Unset = UNSET, -) -> ErrorsList | UserResponse | None: + body: UpdateUser, +) -> Optional[Union[ErrorsList, UserResponse]]: """Update a user Update a specific user by id Args: id (str): - body (UpdateUser | Unset): + body (UpdateUser): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | UserResponse + Union[ErrorsList, UserResponse] """ return ( diff --git a/rootly_sdk/api/verified_domains/__init__.py b/rootly_sdk/api/verified_domains/__init__.py new file mode 100644 index 00000000..2d7c0b23 --- /dev/null +++ b/rootly_sdk/api/verified_domains/__init__.py @@ -0,0 +1 @@ +"""Contains endpoint functions for accessing the API""" diff --git a/rootly_sdk/api/verified_domains/delete_v1_verified_domains_id.py b/rootly_sdk/api/verified_domains/delete_v1_verified_domains_id.py new file mode 100644 index 00000000..511b079e --- /dev/null +++ b/rootly_sdk/api/verified_domains/delete_v1_verified_domains_id.py @@ -0,0 +1,151 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.verified_domain_response import VerifiedDomainResponse +from ...types import Response + + +def _get_kwargs( + id: str, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "delete", + "url": f"/v1/verified_domains/{id}", + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[VerifiedDomainResponse]: + if response.status_code == 200: + response_200 = VerifiedDomainResponse.from_dict(response.json()) + + return response_200 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[VerifiedDomainResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: str, + *, + client: AuthenticatedClient, +) -> Response[VerifiedDomainResponse]: + """Delete a verified domain + + Args: + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[VerifiedDomainResponse] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: str, + *, + client: AuthenticatedClient, +) -> Optional[VerifiedDomainResponse]: + """Delete a verified domain + + Args: + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + VerifiedDomainResponse + """ + + return sync_detailed( + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + id: str, + *, + client: AuthenticatedClient, +) -> Response[VerifiedDomainResponse]: + """Delete a verified domain + + Args: + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[VerifiedDomainResponse] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: str, + *, + client: AuthenticatedClient, +) -> Optional[VerifiedDomainResponse]: + """Delete a verified domain + + Args: + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + VerifiedDomainResponse + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + ) + ).parsed diff --git a/rootly_sdk/api/verified_domains/get_v1_verified_domains.py b/rootly_sdk/api/verified_domains/get_v1_verified_domains.py new file mode 100644 index 00000000..ac994498 --- /dev/null +++ b/rootly_sdk/api/verified_domains/get_v1_verified_domains.py @@ -0,0 +1,174 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.verified_domain_list import VerifiedDomainList +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["page[number]"] = pagenumber + + params["page[size]"] = pagesize + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/v1/verified_domains", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[VerifiedDomainList]: + if response.status_code == 200: + response_200 = VerifiedDomainList.from_dict(response.json()) + + return response_200 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[VerifiedDomainList]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, +) -> Response[VerifiedDomainList]: + """List verified domains + + Args: + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[VerifiedDomainList] + """ + + kwargs = _get_kwargs( + pagenumber=pagenumber, + pagesize=pagesize, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, +) -> Optional[VerifiedDomainList]: + """List verified domains + + Args: + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + VerifiedDomainList + """ + + return sync_detailed( + client=client, + pagenumber=pagenumber, + pagesize=pagesize, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, +) -> Response[VerifiedDomainList]: + """List verified domains + + Args: + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[VerifiedDomainList] + """ + + kwargs = _get_kwargs( + pagenumber=pagenumber, + pagesize=pagesize, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, +) -> Optional[VerifiedDomainList]: + """List verified domains + + Args: + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + VerifiedDomainList + """ + + return ( + await asyncio_detailed( + client=client, + pagenumber=pagenumber, + pagesize=pagesize, + ) + ).parsed diff --git a/rootly_sdk/api/verified_domains/get_v1_verified_domains_id.py b/rootly_sdk/api/verified_domains/get_v1_verified_domains_id.py new file mode 100644 index 00000000..ae232e85 --- /dev/null +++ b/rootly_sdk/api/verified_domains/get_v1_verified_domains_id.py @@ -0,0 +1,151 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.verified_domain_response import VerifiedDomainResponse +from ...types import Response + + +def _get_kwargs( + id: str, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "get", + "url": f"/v1/verified_domains/{id}", + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[VerifiedDomainResponse]: + if response.status_code == 200: + response_200 = VerifiedDomainResponse.from_dict(response.json()) + + return response_200 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[VerifiedDomainResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: str, + *, + client: AuthenticatedClient, +) -> Response[VerifiedDomainResponse]: + """Show a verified domain + + Args: + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[VerifiedDomainResponse] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: str, + *, + client: AuthenticatedClient, +) -> Optional[VerifiedDomainResponse]: + """Show a verified domain + + Args: + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + VerifiedDomainResponse + """ + + return sync_detailed( + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + id: str, + *, + client: AuthenticatedClient, +) -> Response[VerifiedDomainResponse]: + """Show a verified domain + + Args: + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[VerifiedDomainResponse] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: str, + *, + client: AuthenticatedClient, +) -> Optional[VerifiedDomainResponse]: + """Show a verified domain + + Args: + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + VerifiedDomainResponse + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + ) + ).parsed diff --git a/rootly_sdk/api/verified_domains/post_v1_verified_domains.py b/rootly_sdk/api/verified_domains/post_v1_verified_domains.py new file mode 100644 index 00000000..6b9081cd --- /dev/null +++ b/rootly_sdk/api/verified_domains/post_v1_verified_domains.py @@ -0,0 +1,160 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.new_verified_domain import NewVerifiedDomain +from ...models.verified_domain_response import VerifiedDomainResponse +from ...types import Response + + +def _get_kwargs( + *, + body: NewVerifiedDomain, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/v1/verified_domains", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/vnd.api+json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[VerifiedDomainResponse]: + if response.status_code == 201: + response_201 = VerifiedDomainResponse.from_dict(response.json()) + + return response_201 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[VerifiedDomainResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: NewVerifiedDomain, +) -> Response[VerifiedDomainResponse]: + """Create a verified domain + + Args: + body (NewVerifiedDomain): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[VerifiedDomainResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: NewVerifiedDomain, +) -> Optional[VerifiedDomainResponse]: + """Create a verified domain + + Args: + body (NewVerifiedDomain): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + VerifiedDomainResponse + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: NewVerifiedDomain, +) -> Response[VerifiedDomainResponse]: + """Create a verified domain + + Args: + body (NewVerifiedDomain): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[VerifiedDomainResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: NewVerifiedDomain, +) -> Optional[VerifiedDomainResponse]: + """Create a verified domain + + Args: + body (NewVerifiedDomain): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + VerifiedDomainResponse + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/rootly_sdk/api/webhooks_deliveries/deliver_webhooks_delivery.py b/rootly_sdk/api/webhooks_deliveries/deliver_webhooks_delivery.py index 4e61f403..673d0491 100644 --- a/rootly_sdk/api/webhooks_deliveries/deliver_webhooks_delivery.py +++ b/rootly_sdk/api/webhooks_deliveries/deliver_webhooks_delivery.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -13,20 +12,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/webhooks/deliveries/{id}/deliver".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/webhooks/deliveries/{id}/deliver", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> WebhooksDeliveryResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[WebhooksDeliveryResponse]: if response.status_code == 200: response_200 = WebhooksDeliveryResponse.from_dict(response.json()) @@ -39,7 +35,7 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[WebhooksDeliveryResponse]: return Response( status_code=HTTPStatus(response.status_code), @@ -84,7 +80,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> WebhooksDeliveryResponse | None: +) -> Optional[WebhooksDeliveryResponse]: """Retries a webhook delivery Retries a webhook delivery @@ -139,7 +135,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> WebhooksDeliveryResponse | None: +) -> Optional[WebhooksDeliveryResponse]: """Retries a webhook delivery Retries a webhook delivery diff --git a/rootly_sdk/api/webhooks_deliveries/get_webhooks_delivery.py b/rootly_sdk/api/webhooks_deliveries/get_webhooks_delivery.py index 6bcff9b9..3584d435 100644 --- a/rootly_sdk/api/webhooks_deliveries/get_webhooks_delivery.py +++ b/rootly_sdk/api/webhooks_deliveries/get_webhooks_delivery.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/webhooks/deliveries/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/webhooks/deliveries/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | WebhooksDeliveryResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, WebhooksDeliveryResponse]]: if response.status_code == 200: response_200 = WebhooksDeliveryResponse.from_dict(response.json()) @@ -45,8 +41,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | WebhooksDeliveryResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, WebhooksDeliveryResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | WebhooksDeliveryResponse]: +) -> Response[Union[ErrorsList, WebhooksDeliveryResponse]]: """Retrieves a webhook delivery Retrieves a specific webhook delivery by id @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WebhooksDeliveryResponse] + Response[Union[ErrorsList, WebhooksDeliveryResponse]] """ kwargs = _get_kwargs( @@ -90,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | WebhooksDeliveryResponse | None: +) -> Optional[Union[ErrorsList, WebhooksDeliveryResponse]]: """Retrieves a webhook delivery Retrieves a specific webhook delivery by id @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WebhooksDeliveryResponse + Union[ErrorsList, WebhooksDeliveryResponse] """ return sync_detailed( @@ -116,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | WebhooksDeliveryResponse]: +) -> Response[Union[ErrorsList, WebhooksDeliveryResponse]]: """Retrieves a webhook delivery Retrieves a specific webhook delivery by id @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WebhooksDeliveryResponse] + Response[Union[ErrorsList, WebhooksDeliveryResponse]] """ kwargs = _get_kwargs( @@ -145,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | WebhooksDeliveryResponse | None: +) -> Optional[Union[ErrorsList, WebhooksDeliveryResponse]]: """Retrieves a webhook delivery Retrieves a specific webhook delivery by id @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WebhooksDeliveryResponse + Union[ErrorsList, WebhooksDeliveryResponse] """ return ( diff --git a/rootly_sdk/api/webhooks_deliveries/list_webhooks_deliveries.py b/rootly_sdk/api/webhooks_deliveries/list_webhooks_deliveries.py index a333135e..9324b350 100644 --- a/rootly_sdk/api/webhooks_deliveries/list_webhooks_deliveries.py +++ b/rootly_sdk/api/webhooks_deliveries/list_webhooks_deliveries.py @@ -1,11 +1,12 @@ +import datetime from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx from ... import errors from ...client import AuthenticatedClient, Client +from ...models.errors_list import ErrorsList from ...models.webhooks_delivery_list import WebhooksDeliveryList from ...types import UNSET, Response, Unset @@ -13,11 +14,19 @@ def _get_kwargs( endpoint_id: str, *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterstatus: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, datetime.datetime] = UNSET, + filtercreated_atgte: Union[Unset, datetime.datetime] = UNSET, + filtercreated_atlt: Union[Unset, datetime.datetime] = UNSET, + filtercreated_atlte: Union[Unset, datetime.datetime] = UNSET, + filterdelivered_atgt: Union[Unset, datetime.datetime] = UNSET, + filterdelivered_atgte: Union[Unset, datetime.datetime] = UNSET, + filterdelivered_atlt: Union[Unset, datetime.datetime] = UNSET, + filterdelivered_atlte: Union[Unset, datetime.datetime] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -26,25 +35,72 @@ def _get_kwargs( params["page[size]"] = pagesize + params["filter[status]"] = filterstatus + + json_filtercreated_atgt: Union[Unset, str] = UNSET + if not isinstance(filtercreated_atgt, Unset): + json_filtercreated_atgt = filtercreated_atgt.isoformat() + params["filter[created_at][gt]"] = json_filtercreated_atgt + + json_filtercreated_atgte: Union[Unset, str] = UNSET + if not isinstance(filtercreated_atgte, Unset): + json_filtercreated_atgte = filtercreated_atgte.isoformat() + params["filter[created_at][gte]"] = json_filtercreated_atgte + + json_filtercreated_atlt: Union[Unset, str] = UNSET + if not isinstance(filtercreated_atlt, Unset): + json_filtercreated_atlt = filtercreated_atlt.isoformat() + params["filter[created_at][lt]"] = json_filtercreated_atlt + + json_filtercreated_atlte: Union[Unset, str] = UNSET + if not isinstance(filtercreated_atlte, Unset): + json_filtercreated_atlte = filtercreated_atlte.isoformat() + params["filter[created_at][lte]"] = json_filtercreated_atlte + + json_filterdelivered_atgt: Union[Unset, str] = UNSET + if not isinstance(filterdelivered_atgt, Unset): + json_filterdelivered_atgt = filterdelivered_atgt.isoformat() + params["filter[delivered_at][gt]"] = json_filterdelivered_atgt + + json_filterdelivered_atgte: Union[Unset, str] = UNSET + if not isinstance(filterdelivered_atgte, Unset): + json_filterdelivered_atgte = filterdelivered_atgte.isoformat() + params["filter[delivered_at][gte]"] = json_filterdelivered_atgte + + json_filterdelivered_atlt: Union[Unset, str] = UNSET + if not isinstance(filterdelivered_atlt, Unset): + json_filterdelivered_atlt = filterdelivered_atlt.isoformat() + params["filter[delivered_at][lt]"] = json_filterdelivered_atlt + + json_filterdelivered_atlte: Union[Unset, str] = UNSET + if not isinstance(filterdelivered_atlte, Unset): + json_filterdelivered_atlte = filterdelivered_atlte.isoformat() + params["filter[delivered_at][lte]"] = json_filterdelivered_atlte + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/webhooks/endpoints/{endpoint_id}/deliveries".format( - endpoint_id=quote(str(endpoint_id), safe=""), - ), + "url": f"/v1/webhooks/endpoints/{endpoint_id}/deliveries", "params": params, } return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> WebhooksDeliveryList | None: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, WebhooksDeliveryList]]: if response.status_code == 200: response_200 = WebhooksDeliveryList.from_dict(response.json()) return response_200 + if response.status_code == 400: + response_400 = ErrorsList.from_dict(response.json()) + + return response_400 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -52,8 +108,8 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[WebhooksDeliveryList]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, WebhooksDeliveryList]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,26 +122,44 @@ def sync_detailed( endpoint_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, -) -> Response[WebhooksDeliveryList]: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterstatus: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, datetime.datetime] = UNSET, + filtercreated_atgte: Union[Unset, datetime.datetime] = UNSET, + filtercreated_atlt: Union[Unset, datetime.datetime] = UNSET, + filtercreated_atlte: Union[Unset, datetime.datetime] = UNSET, + filterdelivered_atgt: Union[Unset, datetime.datetime] = UNSET, + filterdelivered_atgte: Union[Unset, datetime.datetime] = UNSET, + filterdelivered_atlt: Union[Unset, datetime.datetime] = UNSET, + filterdelivered_atlte: Union[Unset, datetime.datetime] = UNSET, +) -> Response[Union[ErrorsList, WebhooksDeliveryList]]: """List webhook deliveries List webhook deliveries for given endpoint Args: endpoint_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterstatus (Union[Unset, str]): + filtercreated_atgt (Union[Unset, datetime.datetime]): + filtercreated_atgte (Union[Unset, datetime.datetime]): + filtercreated_atlt (Union[Unset, datetime.datetime]): + filtercreated_atlte (Union[Unset, datetime.datetime]): + filterdelivered_atgt (Union[Unset, datetime.datetime]): + filterdelivered_atgte (Union[Unset, datetime.datetime]): + filterdelivered_atlt (Union[Unset, datetime.datetime]): + filterdelivered_atlte (Union[Unset, datetime.datetime]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[WebhooksDeliveryList] + Response[Union[ErrorsList, WebhooksDeliveryList]] """ kwargs = _get_kwargs( @@ -93,6 +167,15 @@ def sync_detailed( include=include, pagenumber=pagenumber, pagesize=pagesize, + filterstatus=filterstatus, + filtercreated_atgt=filtercreated_atgt, + filtercreated_atgte=filtercreated_atgte, + filtercreated_atlt=filtercreated_atlt, + filtercreated_atlte=filtercreated_atlte, + filterdelivered_atgt=filterdelivered_atgt, + filterdelivered_atgte=filterdelivered_atgte, + filterdelivered_atlt=filterdelivered_atlt, + filterdelivered_atlte=filterdelivered_atlte, ) response = client.get_httpx_client().request( @@ -106,26 +189,44 @@ def sync( endpoint_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, -) -> WebhooksDeliveryList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterstatus: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, datetime.datetime] = UNSET, + filtercreated_atgte: Union[Unset, datetime.datetime] = UNSET, + filtercreated_atlt: Union[Unset, datetime.datetime] = UNSET, + filtercreated_atlte: Union[Unset, datetime.datetime] = UNSET, + filterdelivered_atgt: Union[Unset, datetime.datetime] = UNSET, + filterdelivered_atgte: Union[Unset, datetime.datetime] = UNSET, + filterdelivered_atlt: Union[Unset, datetime.datetime] = UNSET, + filterdelivered_atlte: Union[Unset, datetime.datetime] = UNSET, +) -> Optional[Union[ErrorsList, WebhooksDeliveryList]]: """List webhook deliveries List webhook deliveries for given endpoint Args: endpoint_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterstatus (Union[Unset, str]): + filtercreated_atgt (Union[Unset, datetime.datetime]): + filtercreated_atgte (Union[Unset, datetime.datetime]): + filtercreated_atlt (Union[Unset, datetime.datetime]): + filtercreated_atlte (Union[Unset, datetime.datetime]): + filterdelivered_atgt (Union[Unset, datetime.datetime]): + filterdelivered_atgte (Union[Unset, datetime.datetime]): + filterdelivered_atlt (Union[Unset, datetime.datetime]): + filterdelivered_atlte (Union[Unset, datetime.datetime]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - WebhooksDeliveryList + Union[ErrorsList, WebhooksDeliveryList] """ return sync_detailed( @@ -134,6 +235,15 @@ def sync( include=include, pagenumber=pagenumber, pagesize=pagesize, + filterstatus=filterstatus, + filtercreated_atgt=filtercreated_atgt, + filtercreated_atgte=filtercreated_atgte, + filtercreated_atlt=filtercreated_atlt, + filtercreated_atlte=filtercreated_atlte, + filterdelivered_atgt=filterdelivered_atgt, + filterdelivered_atgte=filterdelivered_atgte, + filterdelivered_atlt=filterdelivered_atlt, + filterdelivered_atlte=filterdelivered_atlte, ).parsed @@ -141,26 +251,44 @@ async def asyncio_detailed( endpoint_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, -) -> Response[WebhooksDeliveryList]: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterstatus: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, datetime.datetime] = UNSET, + filtercreated_atgte: Union[Unset, datetime.datetime] = UNSET, + filtercreated_atlt: Union[Unset, datetime.datetime] = UNSET, + filtercreated_atlte: Union[Unset, datetime.datetime] = UNSET, + filterdelivered_atgt: Union[Unset, datetime.datetime] = UNSET, + filterdelivered_atgte: Union[Unset, datetime.datetime] = UNSET, + filterdelivered_atlt: Union[Unset, datetime.datetime] = UNSET, + filterdelivered_atlte: Union[Unset, datetime.datetime] = UNSET, +) -> Response[Union[ErrorsList, WebhooksDeliveryList]]: """List webhook deliveries List webhook deliveries for given endpoint Args: endpoint_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterstatus (Union[Unset, str]): + filtercreated_atgt (Union[Unset, datetime.datetime]): + filtercreated_atgte (Union[Unset, datetime.datetime]): + filtercreated_atlt (Union[Unset, datetime.datetime]): + filtercreated_atlte (Union[Unset, datetime.datetime]): + filterdelivered_atgt (Union[Unset, datetime.datetime]): + filterdelivered_atgte (Union[Unset, datetime.datetime]): + filterdelivered_atlt (Union[Unset, datetime.datetime]): + filterdelivered_atlte (Union[Unset, datetime.datetime]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[WebhooksDeliveryList] + Response[Union[ErrorsList, WebhooksDeliveryList]] """ kwargs = _get_kwargs( @@ -168,6 +296,15 @@ async def asyncio_detailed( include=include, pagenumber=pagenumber, pagesize=pagesize, + filterstatus=filterstatus, + filtercreated_atgt=filtercreated_atgt, + filtercreated_atgte=filtercreated_atgte, + filtercreated_atlt=filtercreated_atlt, + filtercreated_atlte=filtercreated_atlte, + filterdelivered_atgt=filterdelivered_atgt, + filterdelivered_atgte=filterdelivered_atgte, + filterdelivered_atlt=filterdelivered_atlt, + filterdelivered_atlte=filterdelivered_atlte, ) response = await client.get_async_httpx_client().request(**kwargs) @@ -179,26 +316,44 @@ async def asyncio( endpoint_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, -) -> WebhooksDeliveryList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterstatus: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, datetime.datetime] = UNSET, + filtercreated_atgte: Union[Unset, datetime.datetime] = UNSET, + filtercreated_atlt: Union[Unset, datetime.datetime] = UNSET, + filtercreated_atlte: Union[Unset, datetime.datetime] = UNSET, + filterdelivered_atgt: Union[Unset, datetime.datetime] = UNSET, + filterdelivered_atgte: Union[Unset, datetime.datetime] = UNSET, + filterdelivered_atlt: Union[Unset, datetime.datetime] = UNSET, + filterdelivered_atlte: Union[Unset, datetime.datetime] = UNSET, +) -> Optional[Union[ErrorsList, WebhooksDeliveryList]]: """List webhook deliveries List webhook deliveries for given endpoint Args: endpoint_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterstatus (Union[Unset, str]): + filtercreated_atgt (Union[Unset, datetime.datetime]): + filtercreated_atgte (Union[Unset, datetime.datetime]): + filtercreated_atlt (Union[Unset, datetime.datetime]): + filtercreated_atlte (Union[Unset, datetime.datetime]): + filterdelivered_atgt (Union[Unset, datetime.datetime]): + filterdelivered_atgte (Union[Unset, datetime.datetime]): + filterdelivered_atlt (Union[Unset, datetime.datetime]): + filterdelivered_atlte (Union[Unset, datetime.datetime]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - WebhooksDeliveryList + Union[ErrorsList, WebhooksDeliveryList] """ return ( @@ -208,5 +363,14 @@ async def asyncio( include=include, pagenumber=pagenumber, pagesize=pagesize, + filterstatus=filterstatus, + filtercreated_atgt=filtercreated_atgt, + filtercreated_atgte=filtercreated_atgte, + filtercreated_atlt=filtercreated_atlt, + filtercreated_atlte=filtercreated_atlte, + filterdelivered_atgt=filterdelivered_atgt, + filterdelivered_atgte=filterdelivered_atgte, + filterdelivered_atlt=filterdelivered_atlt, + filterdelivered_atlte=filterdelivered_atlte, ) ).parsed diff --git a/rootly_sdk/api/webhooks_endpoints/create_webhooks_endpoint.py b/rootly_sdk/api/webhooks_endpoints/create_webhooks_endpoint.py index cbe5aec3..5d081f71 100644 --- a/rootly_sdk/api/webhooks_endpoints/create_webhooks_endpoint.py +++ b/rootly_sdk/api/webhooks_endpoints/create_webhooks_endpoint.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | WebhooksEndpointResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, WebhooksEndpointResponse]]: if response.status_code == 201: response_201 = WebhooksEndpointResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | WebhooksEndpointResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, WebhooksEndpointResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +69,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewWebhooksEndpoint, -) -> Response[ErrorsList | WebhooksEndpointResponse]: +) -> Response[Union[ErrorsList, WebhooksEndpointResponse]]: """Creates a webhook endpoint Creates a new webhook endpoint from provided data @@ -82,7 +82,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WebhooksEndpointResponse] + Response[Union[ErrorsList, WebhooksEndpointResponse]] """ kwargs = _get_kwargs( @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: NewWebhooksEndpoint, -) -> ErrorsList | WebhooksEndpointResponse | None: +) -> Optional[Union[ErrorsList, WebhooksEndpointResponse]]: """Creates a webhook endpoint Creates a new webhook endpoint from provided data @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WebhooksEndpointResponse + Union[ErrorsList, WebhooksEndpointResponse] """ return sync_detailed( @@ -126,7 +126,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewWebhooksEndpoint, -) -> Response[ErrorsList | WebhooksEndpointResponse]: +) -> Response[Union[ErrorsList, WebhooksEndpointResponse]]: """Creates a webhook endpoint Creates a new webhook endpoint from provided data @@ -139,7 +139,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WebhooksEndpointResponse] + Response[Union[ErrorsList, WebhooksEndpointResponse]] """ kwargs = _get_kwargs( @@ -155,7 +155,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewWebhooksEndpoint, -) -> ErrorsList | WebhooksEndpointResponse | None: +) -> Optional[Union[ErrorsList, WebhooksEndpointResponse]]: """Creates a webhook endpoint Creates a new webhook endpoint from provided data @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WebhooksEndpointResponse + Union[ErrorsList, WebhooksEndpointResponse] """ return ( diff --git a/rootly_sdk/api/webhooks_endpoints/delete_webhooks_endpoint.py b/rootly_sdk/api/webhooks_endpoints/delete_webhooks_endpoint.py index 080d170b..2c766231 100644 --- a/rootly_sdk/api/webhooks_endpoints/delete_webhooks_endpoint.py +++ b/rootly_sdk/api/webhooks_endpoints/delete_webhooks_endpoint.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/webhooks/endpoints/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/webhooks/endpoints/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | WebhooksEndpointResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, WebhooksEndpointResponse]]: if response.status_code == 200: response_200 = WebhooksEndpointResponse.from_dict(response.json()) @@ -45,8 +41,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | WebhooksEndpointResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, WebhooksEndpointResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | WebhooksEndpointResponse]: +) -> Response[Union[ErrorsList, WebhooksEndpointResponse]]: """Delete a webhook endpoint Delete a specific webhook endpoint by id @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WebhooksEndpointResponse] + Response[Union[ErrorsList, WebhooksEndpointResponse]] """ kwargs = _get_kwargs( @@ -90,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | WebhooksEndpointResponse | None: +) -> Optional[Union[ErrorsList, WebhooksEndpointResponse]]: """Delete a webhook endpoint Delete a specific webhook endpoint by id @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WebhooksEndpointResponse + Union[ErrorsList, WebhooksEndpointResponse] """ return sync_detailed( @@ -116,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | WebhooksEndpointResponse]: +) -> Response[Union[ErrorsList, WebhooksEndpointResponse]]: """Delete a webhook endpoint Delete a specific webhook endpoint by id @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WebhooksEndpointResponse] + Response[Union[ErrorsList, WebhooksEndpointResponse]] """ kwargs = _get_kwargs( @@ -145,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | WebhooksEndpointResponse | None: +) -> Optional[Union[ErrorsList, WebhooksEndpointResponse]]: """Delete a webhook endpoint Delete a specific webhook endpoint by id @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WebhooksEndpointResponse + Union[ErrorsList, WebhooksEndpointResponse] """ return ( diff --git a/rootly_sdk/api/webhooks_endpoints/get_webhooks_endpoint.py b/rootly_sdk/api/webhooks_endpoints/get_webhooks_endpoint.py index 548a6545..6df73b81 100644 --- a/rootly_sdk/api/webhooks_endpoints/get_webhooks_endpoint.py +++ b/rootly_sdk/api/webhooks_endpoints/get_webhooks_endpoint.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/webhooks/endpoints/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/webhooks/endpoints/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | WebhooksEndpointResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, WebhooksEndpointResponse]]: if response.status_code == 200: response_200 = WebhooksEndpointResponse.from_dict(response.json()) @@ -45,8 +41,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | WebhooksEndpointResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, WebhooksEndpointResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | WebhooksEndpointResponse]: +) -> Response[Union[ErrorsList, WebhooksEndpointResponse]]: """Retrieves a webhook endpoint Retrieves a specific webhook endpoint by id @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WebhooksEndpointResponse] + Response[Union[ErrorsList, WebhooksEndpointResponse]] """ kwargs = _get_kwargs( @@ -90,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | WebhooksEndpointResponse | None: +) -> Optional[Union[ErrorsList, WebhooksEndpointResponse]]: """Retrieves a webhook endpoint Retrieves a specific webhook endpoint by id @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WebhooksEndpointResponse + Union[ErrorsList, WebhooksEndpointResponse] """ return sync_detailed( @@ -116,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | WebhooksEndpointResponse]: +) -> Response[Union[ErrorsList, WebhooksEndpointResponse]]: """Retrieves a webhook endpoint Retrieves a specific webhook endpoint by id @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WebhooksEndpointResponse] + Response[Union[ErrorsList, WebhooksEndpointResponse]] """ kwargs = _get_kwargs( @@ -145,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | WebhooksEndpointResponse | None: +) -> Optional[Union[ErrorsList, WebhooksEndpointResponse]]: """Retrieves a webhook endpoint Retrieves a specific webhook endpoint by id @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WebhooksEndpointResponse + Union[ErrorsList, WebhooksEndpointResponse] """ return ( diff --git a/rootly_sdk/api/webhooks_endpoints/list_webhooks_endpoints.py b/rootly_sdk/api/webhooks_endpoints/list_webhooks_endpoints.py index 6db925f4..4d467067 100644 --- a/rootly_sdk/api/webhooks_endpoints/list_webhooks_endpoints.py +++ b/rootly_sdk/api/webhooks_endpoints/list_webhooks_endpoints.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -11,13 +11,12 @@ def _get_kwargs( *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -41,7 +40,9 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> WebhooksEndpointList | None: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[WebhooksEndpointList]: if response.status_code == 200: response_200 = WebhooksEndpointList.from_dict(response.json()) @@ -54,7 +55,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[WebhooksEndpointList]: return Response( status_code=HTTPStatus(response.status_code), @@ -67,22 +68,22 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, ) -> Response[WebhooksEndpointList]: """List webhook endpoints List webhook endpoints Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterslug (str | Unset): - filtername (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -110,22 +111,22 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, -) -> WebhooksEndpointList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, +) -> Optional[WebhooksEndpointList]: """List webhook endpoints List webhook endpoints Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterslug (str | Unset): - filtername (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -148,22 +149,22 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, ) -> Response[WebhooksEndpointList]: """List webhook endpoints List webhook endpoints Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterslug (str | Unset): - filtername (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -189,22 +190,22 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtername: str | Unset = UNSET, -) -> WebhooksEndpointList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, +) -> Optional[WebhooksEndpointList]: """List webhook endpoints List webhook endpoints Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filterslug (str | Unset): - filtername (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filterslug (Union[Unset, str]): + filtername (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/webhooks_endpoints/update_webhooks_endpoint.py b/rootly_sdk/api/webhooks_endpoints/update_webhooks_endpoint.py index e1d1f110..fdecbe74 100644 --- a/rootly_sdk/api/webhooks_endpoints/update_webhooks_endpoint.py +++ b/rootly_sdk/api/webhooks_endpoints/update_webhooks_endpoint.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/webhooks/endpoints/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/webhooks/endpoints/{id}", } _kwargs["json"] = body.to_dict() @@ -35,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | WebhooksEndpointResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, WebhooksEndpointResponse]]: if response.status_code == 200: response_200 = WebhooksEndpointResponse.from_dict(response.json()) @@ -54,8 +51,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | WebhooksEndpointResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, WebhooksEndpointResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateWebhooksEndpoint, -) -> Response[ErrorsList | WebhooksEndpointResponse]: +) -> Response[Union[ErrorsList, WebhooksEndpointResponse]]: """Update a webhook endpoint Update a specific webhook endpoint by id @@ -83,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WebhooksEndpointResponse] + Response[Union[ErrorsList, WebhooksEndpointResponse]] """ kwargs = _get_kwargs( @@ -103,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateWebhooksEndpoint, -) -> ErrorsList | WebhooksEndpointResponse | None: +) -> Optional[Union[ErrorsList, WebhooksEndpointResponse]]: """Update a webhook endpoint Update a specific webhook endpoint by id @@ -117,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WebhooksEndpointResponse + Union[ErrorsList, WebhooksEndpointResponse] """ return sync_detailed( @@ -132,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateWebhooksEndpoint, -) -> Response[ErrorsList | WebhooksEndpointResponse]: +) -> Response[Union[ErrorsList, WebhooksEndpointResponse]]: """Update a webhook endpoint Update a specific webhook endpoint by id @@ -146,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WebhooksEndpointResponse] + Response[Union[ErrorsList, WebhooksEndpointResponse]] """ kwargs = _get_kwargs( @@ -164,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateWebhooksEndpoint, -) -> ErrorsList | WebhooksEndpointResponse | None: +) -> Optional[Union[ErrorsList, WebhooksEndpointResponse]]: """Update a webhook endpoint Update a specific webhook endpoint by id @@ -178,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WebhooksEndpointResponse + Union[ErrorsList, WebhooksEndpointResponse] """ return ( diff --git a/rootly_sdk/api/workflow_action_item_form_field_conditions/create_workflow_action_item_form_field_condition.py b/rootly_sdk/api/workflow_action_item_form_field_conditions/create_workflow_action_item_form_field_condition.py index 6f1732ff..ad28f48f 100644 --- a/rootly_sdk/api/workflow_action_item_form_field_conditions/create_workflow_action_item_form_field_condition.py +++ b/rootly_sdk/api/workflow_action_item_form_field_conditions/create_workflow_action_item_form_field_condition.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any, cast -from urllib.parse import quote +from typing import Any, Optional, Union, cast import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/workflows/{workflow_id}/action_item_form_field_conditions".format( - workflow_id=quote(str(workflow_id), safe=""), - ), + "url": f"/v1/workflows/{workflow_id}/action_item_form_field_conditions", } _kwargs["json"] = body.to_dict() @@ -35,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Any | ErrorsList | WorkflowActionItemFormFieldConditionResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorsList, WorkflowActionItemFormFieldConditionResponse]]: if response.status_code == 201: response_201 = WorkflowActionItemFormFieldConditionResponse.from_dict(response.json()) @@ -63,8 +60,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[Any | ErrorsList | WorkflowActionItemFormFieldConditionResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorsList, WorkflowActionItemFormFieldConditionResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -78,7 +75,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewWorkflowActionItemFormFieldCondition, -) -> Response[Any | ErrorsList | WorkflowActionItemFormFieldConditionResponse]: +) -> Response[Union[Any, ErrorsList, WorkflowActionItemFormFieldConditionResponse]]: """Creates a workflow action item form field condition Creates a new workflow action item form field condition from provided data @@ -92,7 +89,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | ErrorsList | WorkflowActionItemFormFieldConditionResponse] + Response[Union[Any, ErrorsList, WorkflowActionItemFormFieldConditionResponse]] """ kwargs = _get_kwargs( @@ -112,7 +109,7 @@ def sync( *, client: AuthenticatedClient, body: NewWorkflowActionItemFormFieldCondition, -) -> Any | ErrorsList | WorkflowActionItemFormFieldConditionResponse | None: +) -> Optional[Union[Any, ErrorsList, WorkflowActionItemFormFieldConditionResponse]]: """Creates a workflow action item form field condition Creates a new workflow action item form field condition from provided data @@ -126,7 +123,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | ErrorsList | WorkflowActionItemFormFieldConditionResponse + Union[Any, ErrorsList, WorkflowActionItemFormFieldConditionResponse] """ return sync_detailed( @@ -141,7 +138,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewWorkflowActionItemFormFieldCondition, -) -> Response[Any | ErrorsList | WorkflowActionItemFormFieldConditionResponse]: +) -> Response[Union[Any, ErrorsList, WorkflowActionItemFormFieldConditionResponse]]: """Creates a workflow action item form field condition Creates a new workflow action item form field condition from provided data @@ -155,7 +152,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | ErrorsList | WorkflowActionItemFormFieldConditionResponse] + Response[Union[Any, ErrorsList, WorkflowActionItemFormFieldConditionResponse]] """ kwargs = _get_kwargs( @@ -173,7 +170,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewWorkflowActionItemFormFieldCondition, -) -> Any | ErrorsList | WorkflowActionItemFormFieldConditionResponse | None: +) -> Optional[Union[Any, ErrorsList, WorkflowActionItemFormFieldConditionResponse]]: """Creates a workflow action item form field condition Creates a new workflow action item form field condition from provided data @@ -187,7 +184,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | ErrorsList | WorkflowActionItemFormFieldConditionResponse + Union[Any, ErrorsList, WorkflowActionItemFormFieldConditionResponse] """ return ( diff --git a/rootly_sdk/api/workflow_action_item_form_field_conditions/delete_workflow_action_item_form_field_condition.py b/rootly_sdk/api/workflow_action_item_form_field_conditions/delete_workflow_action_item_form_field_condition.py index fac3f287..6be46910 100644 --- a/rootly_sdk/api/workflow_action_item_form_field_conditions/delete_workflow_action_item_form_field_condition.py +++ b/rootly_sdk/api/workflow_action_item_form_field_conditions/delete_workflow_action_item_form_field_condition.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/workflow_action_item_form_field_conditions/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/workflow_action_item_form_field_conditions/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | WorkflowActionItemFormFieldConditionResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, WorkflowActionItemFormFieldConditionResponse]]: if response.status_code == 200: response_200 = WorkflowActionItemFormFieldConditionResponse.from_dict(response.json()) @@ -45,8 +41,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | WorkflowActionItemFormFieldConditionResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, WorkflowActionItemFormFieldConditionResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | WorkflowActionItemFormFieldConditionResponse]: +) -> Response[Union[ErrorsList, WorkflowActionItemFormFieldConditionResponse]]: """Delete a workflow action item form field condition Delete a specific workflow action item form field condition by id @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WorkflowActionItemFormFieldConditionResponse] + Response[Union[ErrorsList, WorkflowActionItemFormFieldConditionResponse]] """ kwargs = _get_kwargs( @@ -90,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | WorkflowActionItemFormFieldConditionResponse | None: +) -> Optional[Union[ErrorsList, WorkflowActionItemFormFieldConditionResponse]]: """Delete a workflow action item form field condition Delete a specific workflow action item form field condition by id @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WorkflowActionItemFormFieldConditionResponse + Union[ErrorsList, WorkflowActionItemFormFieldConditionResponse] """ return sync_detailed( @@ -116,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | WorkflowActionItemFormFieldConditionResponse]: +) -> Response[Union[ErrorsList, WorkflowActionItemFormFieldConditionResponse]]: """Delete a workflow action item form field condition Delete a specific workflow action item form field condition by id @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WorkflowActionItemFormFieldConditionResponse] + Response[Union[ErrorsList, WorkflowActionItemFormFieldConditionResponse]] """ kwargs = _get_kwargs( @@ -145,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | WorkflowActionItemFormFieldConditionResponse | None: +) -> Optional[Union[ErrorsList, WorkflowActionItemFormFieldConditionResponse]]: """Delete a workflow action item form field condition Delete a specific workflow action item form field condition by id @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WorkflowActionItemFormFieldConditionResponse + Union[ErrorsList, WorkflowActionItemFormFieldConditionResponse] """ return ( diff --git a/rootly_sdk/api/workflow_action_item_form_field_conditions/get_workflow_action_item_form_field_condition.py b/rootly_sdk/api/workflow_action_item_form_field_conditions/get_workflow_action_item_form_field_condition.py index b9d2d505..a4b2b77b 100644 --- a/rootly_sdk/api/workflow_action_item_form_field_conditions/get_workflow_action_item_form_field_condition.py +++ b/rootly_sdk/api/workflow_action_item_form_field_conditions/get_workflow_action_item_form_field_condition.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/workflow_action_item_form_field_conditions/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/workflow_action_item_form_field_conditions/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | WorkflowActionItemFormFieldConditionResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, WorkflowActionItemFormFieldConditionResponse]]: if response.status_code == 200: response_200 = WorkflowActionItemFormFieldConditionResponse.from_dict(response.json()) @@ -45,8 +41,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | WorkflowActionItemFormFieldConditionResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, WorkflowActionItemFormFieldConditionResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | WorkflowActionItemFormFieldConditionResponse]: +) -> Response[Union[ErrorsList, WorkflowActionItemFormFieldConditionResponse]]: """Retrieves a workflow action item form field condition Retrieves a specific workflow action item form field condition by id @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WorkflowActionItemFormFieldConditionResponse] + Response[Union[ErrorsList, WorkflowActionItemFormFieldConditionResponse]] """ kwargs = _get_kwargs( @@ -90,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | WorkflowActionItemFormFieldConditionResponse | None: +) -> Optional[Union[ErrorsList, WorkflowActionItemFormFieldConditionResponse]]: """Retrieves a workflow action item form field condition Retrieves a specific workflow action item form field condition by id @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WorkflowActionItemFormFieldConditionResponse + Union[ErrorsList, WorkflowActionItemFormFieldConditionResponse] """ return sync_detailed( @@ -116,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | WorkflowActionItemFormFieldConditionResponse]: +) -> Response[Union[ErrorsList, WorkflowActionItemFormFieldConditionResponse]]: """Retrieves a workflow action item form field condition Retrieves a specific workflow action item form field condition by id @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WorkflowActionItemFormFieldConditionResponse] + Response[Union[ErrorsList, WorkflowActionItemFormFieldConditionResponse]] """ kwargs = _get_kwargs( @@ -145,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | WorkflowActionItemFormFieldConditionResponse | None: +) -> Optional[Union[ErrorsList, WorkflowActionItemFormFieldConditionResponse]]: """Retrieves a workflow action item form field condition Retrieves a specific workflow action item form field condition by id @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WorkflowActionItemFormFieldConditionResponse + Union[ErrorsList, WorkflowActionItemFormFieldConditionResponse] """ return ( diff --git a/rootly_sdk/api/workflow_action_item_form_field_conditions/list_workflow_action_item_form_field_conditions.py b/rootly_sdk/api/workflow_action_item_form_field_conditions/list_workflow_action_item_form_field_conditions.py index f1e23abb..e9709332 100644 --- a/rootly_sdk/api/workflow_action_item_form_field_conditions/list_workflow_action_item_form_field_conditions.py +++ b/rootly_sdk/api/workflow_action_item_form_field_conditions/list_workflow_action_item_form_field_conditions.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -13,11 +12,10 @@ def _get_kwargs( workflow_id: str, *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -30,9 +28,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/workflows/{workflow_id}/action_item_form_field_conditions".format( - workflow_id=quote(str(workflow_id), safe=""), - ), + "url": f"/v1/workflows/{workflow_id}/action_item_form_field_conditions", "params": params, } @@ -40,8 +36,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> WorkflowActionItemFormFieldConditionList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[WorkflowActionItemFormFieldConditionList]: if response.status_code == 200: response_200 = WorkflowActionItemFormFieldConditionList.from_dict(response.json()) @@ -54,7 +50,7 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[WorkflowActionItemFormFieldConditionList]: return Response( status_code=HTTPStatus(response.status_code), @@ -68,9 +64,9 @@ def sync_detailed( workflow_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, ) -> Response[WorkflowActionItemFormFieldConditionList]: """List workflow action item form field conditions @@ -78,9 +74,9 @@ def sync_detailed( Args: workflow_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -108,19 +104,19 @@ def sync( workflow_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, -) -> WorkflowActionItemFormFieldConditionList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, +) -> Optional[WorkflowActionItemFormFieldConditionList]: """List workflow action item form field conditions List workflow action item form field conditions Args: workflow_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -143,9 +139,9 @@ async def asyncio_detailed( workflow_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, ) -> Response[WorkflowActionItemFormFieldConditionList]: """List workflow action item form field conditions @@ -153,9 +149,9 @@ async def asyncio_detailed( Args: workflow_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -181,19 +177,19 @@ async def asyncio( workflow_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, -) -> WorkflowActionItemFormFieldConditionList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, +) -> Optional[WorkflowActionItemFormFieldConditionList]: """List workflow action item form field conditions List workflow action item form field conditions Args: workflow_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/workflow_action_item_form_field_conditions/update_workflow_action_item_form_field_condition.py b/rootly_sdk/api/workflow_action_item_form_field_conditions/update_workflow_action_item_form_field_condition.py index d85c85c9..85690d2a 100644 --- a/rootly_sdk/api/workflow_action_item_form_field_conditions/update_workflow_action_item_form_field_condition.py +++ b/rootly_sdk/api/workflow_action_item_form_field_conditions/update_workflow_action_item_form_field_condition.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/workflow_action_item_form_field_conditions/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/workflow_action_item_form_field_conditions/{id}", } _kwargs["json"] = body.to_dict() @@ -35,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | WorkflowActionItemFormFieldConditionResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, WorkflowActionItemFormFieldConditionResponse]]: if response.status_code == 200: response_200 = WorkflowActionItemFormFieldConditionResponse.from_dict(response.json()) @@ -54,8 +51,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | WorkflowActionItemFormFieldConditionResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, WorkflowActionItemFormFieldConditionResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateWorkflowActionItemFormFieldCondition, -) -> Response[ErrorsList | WorkflowActionItemFormFieldConditionResponse]: +) -> Response[Union[ErrorsList, WorkflowActionItemFormFieldConditionResponse]]: """Update a workflow action item form field condition Update a specific workflow action item form field condition by id @@ -83,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WorkflowActionItemFormFieldConditionResponse] + Response[Union[ErrorsList, WorkflowActionItemFormFieldConditionResponse]] """ kwargs = _get_kwargs( @@ -103,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateWorkflowActionItemFormFieldCondition, -) -> ErrorsList | WorkflowActionItemFormFieldConditionResponse | None: +) -> Optional[Union[ErrorsList, WorkflowActionItemFormFieldConditionResponse]]: """Update a workflow action item form field condition Update a specific workflow action item form field condition by id @@ -117,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WorkflowActionItemFormFieldConditionResponse + Union[ErrorsList, WorkflowActionItemFormFieldConditionResponse] """ return sync_detailed( @@ -132,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateWorkflowActionItemFormFieldCondition, -) -> Response[ErrorsList | WorkflowActionItemFormFieldConditionResponse]: +) -> Response[Union[ErrorsList, WorkflowActionItemFormFieldConditionResponse]]: """Update a workflow action item form field condition Update a specific workflow action item form field condition by id @@ -146,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WorkflowActionItemFormFieldConditionResponse] + Response[Union[ErrorsList, WorkflowActionItemFormFieldConditionResponse]] """ kwargs = _get_kwargs( @@ -164,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateWorkflowActionItemFormFieldCondition, -) -> ErrorsList | WorkflowActionItemFormFieldConditionResponse | None: +) -> Optional[Union[ErrorsList, WorkflowActionItemFormFieldConditionResponse]]: """Update a workflow action item form field condition Update a specific workflow action item form field condition by id @@ -178,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WorkflowActionItemFormFieldConditionResponse + Union[ErrorsList, WorkflowActionItemFormFieldConditionResponse] """ return ( diff --git a/rootly_sdk/api/workflow_form_field_conditions/create_workflow_form_field_condition.py b/rootly_sdk/api/workflow_form_field_conditions/create_workflow_form_field_condition.py index 66473fdd..0fb0bba0 100644 --- a/rootly_sdk/api/workflow_form_field_conditions/create_workflow_form_field_condition.py +++ b/rootly_sdk/api/workflow_form_field_conditions/create_workflow_form_field_condition.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/workflows/{workflow_id}/form_field_conditions".format( - workflow_id=quote(str(workflow_id), safe=""), - ), + "url": f"/v1/workflows/{workflow_id}/form_field_conditions", } _kwargs["json"] = body.to_dict() @@ -35,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | WorkflowFormFieldConditionResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, WorkflowFormFieldConditionResponse]]: if response.status_code == 201: response_201 = WorkflowFormFieldConditionResponse.from_dict(response.json()) @@ -47,6 +44,11 @@ def _parse_response( return response_401 + if response.status_code == 422: + response_422 = ErrorsList.from_dict(response.json()) + + return response_422 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -54,8 +56,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | WorkflowFormFieldConditionResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, WorkflowFormFieldConditionResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +71,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewWorkflowFormFieldCondition, -) -> Response[ErrorsList | WorkflowFormFieldConditionResponse]: +) -> Response[Union[ErrorsList, WorkflowFormFieldConditionResponse]]: """Creates a workflow form field condition Creates a new workflow form field condition from provided data @@ -83,7 +85,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WorkflowFormFieldConditionResponse] + Response[Union[ErrorsList, WorkflowFormFieldConditionResponse]] """ kwargs = _get_kwargs( @@ -103,7 +105,7 @@ def sync( *, client: AuthenticatedClient, body: NewWorkflowFormFieldCondition, -) -> ErrorsList | WorkflowFormFieldConditionResponse | None: +) -> Optional[Union[ErrorsList, WorkflowFormFieldConditionResponse]]: """Creates a workflow form field condition Creates a new workflow form field condition from provided data @@ -117,7 +119,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WorkflowFormFieldConditionResponse + Union[ErrorsList, WorkflowFormFieldConditionResponse] """ return sync_detailed( @@ -132,7 +134,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewWorkflowFormFieldCondition, -) -> Response[ErrorsList | WorkflowFormFieldConditionResponse]: +) -> Response[Union[ErrorsList, WorkflowFormFieldConditionResponse]]: """Creates a workflow form field condition Creates a new workflow form field condition from provided data @@ -146,7 +148,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WorkflowFormFieldConditionResponse] + Response[Union[ErrorsList, WorkflowFormFieldConditionResponse]] """ kwargs = _get_kwargs( @@ -164,7 +166,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewWorkflowFormFieldCondition, -) -> ErrorsList | WorkflowFormFieldConditionResponse | None: +) -> Optional[Union[ErrorsList, WorkflowFormFieldConditionResponse]]: """Creates a workflow form field condition Creates a new workflow form field condition from provided data @@ -178,7 +180,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WorkflowFormFieldConditionResponse + Union[ErrorsList, WorkflowFormFieldConditionResponse] """ return ( diff --git a/rootly_sdk/api/workflow_form_field_conditions/delete_workflow_form_field_condition.py b/rootly_sdk/api/workflow_form_field_conditions/delete_workflow_form_field_condition.py index c0bdb34a..cfd84c05 100644 --- a/rootly_sdk/api/workflow_form_field_conditions/delete_workflow_form_field_condition.py +++ b/rootly_sdk/api/workflow_form_field_conditions/delete_workflow_form_field_condition.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/workflow_form_field_conditions/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/workflow_form_field_conditions/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | WorkflowFormFieldConditionResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, WorkflowFormFieldConditionResponse]]: if response.status_code == 200: response_200 = WorkflowFormFieldConditionResponse.from_dict(response.json()) @@ -45,8 +41,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | WorkflowFormFieldConditionResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, WorkflowFormFieldConditionResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | WorkflowFormFieldConditionResponse]: +) -> Response[Union[ErrorsList, WorkflowFormFieldConditionResponse]]: """Delete a workflow_form field condition Delete a specific workflow form field condition by id @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WorkflowFormFieldConditionResponse] + Response[Union[ErrorsList, WorkflowFormFieldConditionResponse]] """ kwargs = _get_kwargs( @@ -90,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | WorkflowFormFieldConditionResponse | None: +) -> Optional[Union[ErrorsList, WorkflowFormFieldConditionResponse]]: """Delete a workflow_form field condition Delete a specific workflow form field condition by id @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WorkflowFormFieldConditionResponse + Union[ErrorsList, WorkflowFormFieldConditionResponse] """ return sync_detailed( @@ -116,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | WorkflowFormFieldConditionResponse]: +) -> Response[Union[ErrorsList, WorkflowFormFieldConditionResponse]]: """Delete a workflow_form field condition Delete a specific workflow form field condition by id @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WorkflowFormFieldConditionResponse] + Response[Union[ErrorsList, WorkflowFormFieldConditionResponse]] """ kwargs = _get_kwargs( @@ -145,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | WorkflowFormFieldConditionResponse | None: +) -> Optional[Union[ErrorsList, WorkflowFormFieldConditionResponse]]: """Delete a workflow_form field condition Delete a specific workflow form field condition by id @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WorkflowFormFieldConditionResponse + Union[ErrorsList, WorkflowFormFieldConditionResponse] """ return ( diff --git a/rootly_sdk/api/workflow_form_field_conditions/get_workflow_form_field_condition.py b/rootly_sdk/api/workflow_form_field_conditions/get_workflow_form_field_condition.py index 9e3dbac4..c8bfb3a8 100644 --- a/rootly_sdk/api/workflow_form_field_conditions/get_workflow_form_field_condition.py +++ b/rootly_sdk/api/workflow_form_field_conditions/get_workflow_form_field_condition.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/workflow_form_field_conditions/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/workflow_form_field_conditions/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | WorkflowFormFieldConditionResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, WorkflowFormFieldConditionResponse]]: if response.status_code == 200: response_200 = WorkflowFormFieldConditionResponse.from_dict(response.json()) @@ -45,8 +41,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | WorkflowFormFieldConditionResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, WorkflowFormFieldConditionResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | WorkflowFormFieldConditionResponse]: +) -> Response[Union[ErrorsList, WorkflowFormFieldConditionResponse]]: """Retrieves a workflow form field condition Retrieves a specific workflow form field condition by id @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WorkflowFormFieldConditionResponse] + Response[Union[ErrorsList, WorkflowFormFieldConditionResponse]] """ kwargs = _get_kwargs( @@ -90,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | WorkflowFormFieldConditionResponse | None: +) -> Optional[Union[ErrorsList, WorkflowFormFieldConditionResponse]]: """Retrieves a workflow form field condition Retrieves a specific workflow form field condition by id @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WorkflowFormFieldConditionResponse + Union[ErrorsList, WorkflowFormFieldConditionResponse] """ return sync_detailed( @@ -116,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | WorkflowFormFieldConditionResponse]: +) -> Response[Union[ErrorsList, WorkflowFormFieldConditionResponse]]: """Retrieves a workflow form field condition Retrieves a specific workflow form field condition by id @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WorkflowFormFieldConditionResponse] + Response[Union[ErrorsList, WorkflowFormFieldConditionResponse]] """ kwargs = _get_kwargs( @@ -145,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | WorkflowFormFieldConditionResponse | None: +) -> Optional[Union[ErrorsList, WorkflowFormFieldConditionResponse]]: """Retrieves a workflow form field condition Retrieves a specific workflow form field condition by id @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WorkflowFormFieldConditionResponse + Union[ErrorsList, WorkflowFormFieldConditionResponse] """ return ( diff --git a/rootly_sdk/api/workflow_form_field_conditions/list_workflow_form_field_conditions.py b/rootly_sdk/api/workflow_form_field_conditions/list_workflow_form_field_conditions.py index 2bca4f9a..300596a1 100644 --- a/rootly_sdk/api/workflow_form_field_conditions/list_workflow_form_field_conditions.py +++ b/rootly_sdk/api/workflow_form_field_conditions/list_workflow_form_field_conditions.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -13,11 +12,10 @@ def _get_kwargs( workflow_id: str, *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -30,9 +28,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/workflows/{workflow_id}/form_field_conditions".format( - workflow_id=quote(str(workflow_id), safe=""), - ), + "url": f"/v1/workflows/{workflow_id}/form_field_conditions", "params": params, } @@ -40,8 +36,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> WorkflowFormFieldConditionList | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[WorkflowFormFieldConditionList]: if response.status_code == 200: response_200 = WorkflowFormFieldConditionList.from_dict(response.json()) @@ -54,7 +50,7 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[WorkflowFormFieldConditionList]: return Response( status_code=HTTPStatus(response.status_code), @@ -68,9 +64,9 @@ def sync_detailed( workflow_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, ) -> Response[WorkflowFormFieldConditionList]: """List workflow form field conditions @@ -78,9 +74,9 @@ def sync_detailed( Args: workflow_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -108,19 +104,19 @@ def sync( workflow_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, -) -> WorkflowFormFieldConditionList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, +) -> Optional[WorkflowFormFieldConditionList]: """List workflow form field conditions List workflow form field conditions Args: workflow_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -143,9 +139,9 @@ async def asyncio_detailed( workflow_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, ) -> Response[WorkflowFormFieldConditionList]: """List workflow form field conditions @@ -153,9 +149,9 @@ async def asyncio_detailed( Args: workflow_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -181,19 +177,19 @@ async def asyncio( workflow_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, -) -> WorkflowFormFieldConditionList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, +) -> Optional[WorkflowFormFieldConditionList]: """List workflow form field conditions List workflow form field conditions Args: workflow_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/workflow_form_field_conditions/update_workflow_form_field_condition.py b/rootly_sdk/api/workflow_form_field_conditions/update_workflow_form_field_condition.py index 0ba30270..a790687b 100644 --- a/rootly_sdk/api/workflow_form_field_conditions/update_workflow_form_field_condition.py +++ b/rootly_sdk/api/workflow_form_field_conditions/update_workflow_form_field_condition.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/workflow_form_field_conditions/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/workflow_form_field_conditions/{id}", } _kwargs["json"] = body.to_dict() @@ -35,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | WorkflowFormFieldConditionResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, WorkflowFormFieldConditionResponse]]: if response.status_code == 200: response_200 = WorkflowFormFieldConditionResponse.from_dict(response.json()) @@ -47,6 +44,11 @@ def _parse_response( return response_404 + if response.status_code == 422: + response_422 = ErrorsList.from_dict(response.json()) + + return response_422 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -54,8 +56,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | WorkflowFormFieldConditionResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, WorkflowFormFieldConditionResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +71,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateWorkflowFormFieldCondition, -) -> Response[ErrorsList | WorkflowFormFieldConditionResponse]: +) -> Response[Union[ErrorsList, WorkflowFormFieldConditionResponse]]: """Update a workflow form field condition Update a specific workflow form field condition by id @@ -83,7 +85,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WorkflowFormFieldConditionResponse] + Response[Union[ErrorsList, WorkflowFormFieldConditionResponse]] """ kwargs = _get_kwargs( @@ -103,7 +105,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateWorkflowFormFieldCondition, -) -> ErrorsList | WorkflowFormFieldConditionResponse | None: +) -> Optional[Union[ErrorsList, WorkflowFormFieldConditionResponse]]: """Update a workflow form field condition Update a specific workflow form field condition by id @@ -117,7 +119,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WorkflowFormFieldConditionResponse + Union[ErrorsList, WorkflowFormFieldConditionResponse] """ return sync_detailed( @@ -132,7 +134,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateWorkflowFormFieldCondition, -) -> Response[ErrorsList | WorkflowFormFieldConditionResponse]: +) -> Response[Union[ErrorsList, WorkflowFormFieldConditionResponse]]: """Update a workflow form field condition Update a specific workflow form field condition by id @@ -146,7 +148,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WorkflowFormFieldConditionResponse] + Response[Union[ErrorsList, WorkflowFormFieldConditionResponse]] """ kwargs = _get_kwargs( @@ -164,7 +166,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateWorkflowFormFieldCondition, -) -> ErrorsList | WorkflowFormFieldConditionResponse | None: +) -> Optional[Union[ErrorsList, WorkflowFormFieldConditionResponse]]: """Update a workflow form field condition Update a specific workflow form field condition by id @@ -178,7 +180,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WorkflowFormFieldConditionResponse + Union[ErrorsList, WorkflowFormFieldConditionResponse] """ return ( diff --git a/rootly_sdk/api/workflow_groups/create_workflow_group.py b/rootly_sdk/api/workflow_groups/create_workflow_group.py index 33784b56..8ce6df94 100644 --- a/rootly_sdk/api/workflow_groups/create_workflow_group.py +++ b/rootly_sdk/api/workflow_groups/create_workflow_group.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | WorkflowGroupResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, WorkflowGroupResponse]]: if response.status_code == 201: response_201 = WorkflowGroupResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | WorkflowGroupResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, WorkflowGroupResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +69,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewWorkflowGroup, -) -> Response[ErrorsList | WorkflowGroupResponse]: +) -> Response[Union[ErrorsList, WorkflowGroupResponse]]: """Creates a workflow group Creates a new workflow group from provided data @@ -82,7 +82,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WorkflowGroupResponse] + Response[Union[ErrorsList, WorkflowGroupResponse]] """ kwargs = _get_kwargs( @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: NewWorkflowGroup, -) -> ErrorsList | WorkflowGroupResponse | None: +) -> Optional[Union[ErrorsList, WorkflowGroupResponse]]: """Creates a workflow group Creates a new workflow group from provided data @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WorkflowGroupResponse + Union[ErrorsList, WorkflowGroupResponse] """ return sync_detailed( @@ -126,7 +126,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewWorkflowGroup, -) -> Response[ErrorsList | WorkflowGroupResponse]: +) -> Response[Union[ErrorsList, WorkflowGroupResponse]]: """Creates a workflow group Creates a new workflow group from provided data @@ -139,7 +139,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WorkflowGroupResponse] + Response[Union[ErrorsList, WorkflowGroupResponse]] """ kwargs = _get_kwargs( @@ -155,7 +155,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewWorkflowGroup, -) -> ErrorsList | WorkflowGroupResponse | None: +) -> Optional[Union[ErrorsList, WorkflowGroupResponse]]: """Creates a workflow group Creates a new workflow group from provided data @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WorkflowGroupResponse + Union[ErrorsList, WorkflowGroupResponse] """ return ( diff --git a/rootly_sdk/api/workflow_groups/delete_workflow_group.py b/rootly_sdk/api/workflow_groups/delete_workflow_group.py index 46a16891..9364610e 100644 --- a/rootly_sdk/api/workflow_groups/delete_workflow_group.py +++ b/rootly_sdk/api/workflow_groups/delete_workflow_group.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/workflow_groups/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/workflow_groups/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | WorkflowGroupResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, WorkflowGroupResponse]]: if response.status_code == 200: response_200 = WorkflowGroupResponse.from_dict(response.json()) @@ -45,8 +41,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | WorkflowGroupResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, WorkflowGroupResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | WorkflowGroupResponse]: +) -> Response[Union[ErrorsList, WorkflowGroupResponse]]: """Delete a workflow_group Delete a specific workflow group by id @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WorkflowGroupResponse] + Response[Union[ErrorsList, WorkflowGroupResponse]] """ kwargs = _get_kwargs( @@ -90,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | WorkflowGroupResponse | None: +) -> Optional[Union[ErrorsList, WorkflowGroupResponse]]: """Delete a workflow_group Delete a specific workflow group by id @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WorkflowGroupResponse + Union[ErrorsList, WorkflowGroupResponse] """ return sync_detailed( @@ -116,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | WorkflowGroupResponse]: +) -> Response[Union[ErrorsList, WorkflowGroupResponse]]: """Delete a workflow_group Delete a specific workflow group by id @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WorkflowGroupResponse] + Response[Union[ErrorsList, WorkflowGroupResponse]] """ kwargs = _get_kwargs( @@ -145,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | WorkflowGroupResponse | None: +) -> Optional[Union[ErrorsList, WorkflowGroupResponse]]: """Delete a workflow_group Delete a specific workflow group by id @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WorkflowGroupResponse + Union[ErrorsList, WorkflowGroupResponse] """ return ( diff --git a/rootly_sdk/api/workflow_groups/get_workflow_group.py b/rootly_sdk/api/workflow_groups/get_workflow_group.py index 2484f46b..8065dccd 100644 --- a/rootly_sdk/api/workflow_groups/get_workflow_group.py +++ b/rootly_sdk/api/workflow_groups/get_workflow_group.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/workflow_groups/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/workflow_groups/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | WorkflowGroupResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, WorkflowGroupResponse]]: if response.status_code == 200: response_200 = WorkflowGroupResponse.from_dict(response.json()) @@ -45,8 +41,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | WorkflowGroupResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, WorkflowGroupResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | WorkflowGroupResponse]: +) -> Response[Union[ErrorsList, WorkflowGroupResponse]]: """Retrieves a workflow group Retrieves a specific workflow group by id @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WorkflowGroupResponse] + Response[Union[ErrorsList, WorkflowGroupResponse]] """ kwargs = _get_kwargs( @@ -90,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | WorkflowGroupResponse | None: +) -> Optional[Union[ErrorsList, WorkflowGroupResponse]]: """Retrieves a workflow group Retrieves a specific workflow group by id @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WorkflowGroupResponse + Union[ErrorsList, WorkflowGroupResponse] """ return sync_detailed( @@ -116,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | WorkflowGroupResponse]: +) -> Response[Union[ErrorsList, WorkflowGroupResponse]]: """Retrieves a workflow group Retrieves a specific workflow group by id @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WorkflowGroupResponse] + Response[Union[ErrorsList, WorkflowGroupResponse]] """ kwargs = _get_kwargs( @@ -145,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | WorkflowGroupResponse | None: +) -> Optional[Union[ErrorsList, WorkflowGroupResponse]]: """Retrieves a workflow group Retrieves a specific workflow group by id @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WorkflowGroupResponse + Union[ErrorsList, WorkflowGroupResponse] """ return ( diff --git a/rootly_sdk/api/workflow_groups/list_workflow_groups.py b/rootly_sdk/api/workflow_groups/list_workflow_groups.py index 4a20aac8..3eeb518b 100644 --- a/rootly_sdk/api/workflow_groups/list_workflow_groups.py +++ b/rootly_sdk/api/workflow_groups/list_workflow_groups.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -11,17 +11,16 @@ def _get_kwargs( *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filterexpanded: bool | Unset = UNSET, - filterposition: int | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filterkind: Union[Unset, str] = UNSET, + filterexpanded: Union[Unset, bool] = UNSET, + filterposition: Union[Unset, int] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -53,7 +52,9 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> WorkflowGroupList | None: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[WorkflowGroupList]: if response.status_code == 200: response_200 = WorkflowGroupList.from_dict(response.json()) @@ -65,7 +66,9 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[WorkflowGroupList]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[WorkflowGroupList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -77,30 +80,30 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filterexpanded: bool | Unset = UNSET, - filterposition: int | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filterkind: Union[Unset, str] = UNSET, + filterexpanded: Union[Unset, bool] = UNSET, + filterposition: Union[Unset, int] = UNSET, ) -> Response[WorkflowGroupList]: """List workflow groups List workflow groups Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterslug (str | Unset): - filterkind (str | Unset): - filterexpanded (bool | Unset): - filterposition (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterslug (Union[Unset, str]): + filterkind (Union[Unset, str]): + filterexpanded (Union[Unset, bool]): + filterposition (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -132,30 +135,30 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filterexpanded: bool | Unset = UNSET, - filterposition: int | Unset = UNSET, -) -> WorkflowGroupList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filterkind: Union[Unset, str] = UNSET, + filterexpanded: Union[Unset, bool] = UNSET, + filterposition: Union[Unset, int] = UNSET, +) -> Optional[WorkflowGroupList]: """List workflow groups List workflow groups Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterslug (str | Unset): - filterkind (str | Unset): - filterexpanded (bool | Unset): - filterposition (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterslug (Union[Unset, str]): + filterkind (Union[Unset, str]): + filterexpanded (Union[Unset, bool]): + filterposition (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -182,30 +185,30 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filterexpanded: bool | Unset = UNSET, - filterposition: int | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filterkind: Union[Unset, str] = UNSET, + filterexpanded: Union[Unset, bool] = UNSET, + filterposition: Union[Unset, int] = UNSET, ) -> Response[WorkflowGroupList]: """List workflow groups List workflow groups Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterslug (str | Unset): - filterkind (str | Unset): - filterexpanded (bool | Unset): - filterposition (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterslug (Union[Unset, str]): + filterkind (Union[Unset, str]): + filterexpanded (Union[Unset, bool]): + filterposition (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -235,30 +238,30 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filterkind: str | Unset = UNSET, - filterexpanded: bool | Unset = UNSET, - filterposition: int | Unset = UNSET, -) -> WorkflowGroupList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filterkind: Union[Unset, str] = UNSET, + filterexpanded: Union[Unset, bool] = UNSET, + filterposition: Union[Unset, int] = UNSET, +) -> Optional[WorkflowGroupList]: """List workflow groups List workflow groups Args: - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterslug (str | Unset): - filterkind (str | Unset): - filterexpanded (bool | Unset): - filterposition (int | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterslug (Union[Unset, str]): + filterkind (Union[Unset, str]): + filterexpanded (Union[Unset, bool]): + filterposition (Union[Unset, int]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/workflow_groups/update_workflow_group.py b/rootly_sdk/api/workflow_groups/update_workflow_group.py index f1922d9a..6c4606e7 100644 --- a/rootly_sdk/api/workflow_groups/update_workflow_group.py +++ b/rootly_sdk/api/workflow_groups/update_workflow_group.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/workflow_groups/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/workflow_groups/{id}", } _kwargs["json"] = body.to_dict() @@ -35,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | WorkflowGroupResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, WorkflowGroupResponse]]: if response.status_code == 200: response_200 = WorkflowGroupResponse.from_dict(response.json()) @@ -54,8 +51,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | WorkflowGroupResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, WorkflowGroupResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateWorkflowGroup, -) -> Response[ErrorsList | WorkflowGroupResponse]: +) -> Response[Union[ErrorsList, WorkflowGroupResponse]]: """Update a workflow group Update a specific workflow group by id @@ -83,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WorkflowGroupResponse] + Response[Union[ErrorsList, WorkflowGroupResponse]] """ kwargs = _get_kwargs( @@ -103,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateWorkflowGroup, -) -> ErrorsList | WorkflowGroupResponse | None: +) -> Optional[Union[ErrorsList, WorkflowGroupResponse]]: """Update a workflow group Update a specific workflow group by id @@ -117,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WorkflowGroupResponse + Union[ErrorsList, WorkflowGroupResponse] """ return sync_detailed( @@ -132,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateWorkflowGroup, -) -> Response[ErrorsList | WorkflowGroupResponse]: +) -> Response[Union[ErrorsList, WorkflowGroupResponse]]: """Update a workflow group Update a specific workflow group by id @@ -146,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WorkflowGroupResponse] + Response[Union[ErrorsList, WorkflowGroupResponse]] """ kwargs = _get_kwargs( @@ -164,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateWorkflowGroup, -) -> ErrorsList | WorkflowGroupResponse | None: +) -> Optional[Union[ErrorsList, WorkflowGroupResponse]]: """Update a workflow group Update a specific workflow group by id @@ -178,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WorkflowGroupResponse + Union[ErrorsList, WorkflowGroupResponse] """ return ( diff --git a/rootly_sdk/api/workflow_runs/create_workflow_run.py b/rootly_sdk/api/workflow_runs/create_workflow_run.py index 70d53a0f..d0fa2847 100644 --- a/rootly_sdk/api/workflow_runs/create_workflow_run.py +++ b/rootly_sdk/api/workflow_runs/create_workflow_run.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/workflows/{workflow_id}/workflow_runs".format( - workflow_id=quote(str(workflow_id), safe=""), - ), + "url": f"/v1/workflows/{workflow_id}/workflow_runs", } _kwargs["json"] = body.to_dict() @@ -35,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | WorkflowRunResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, WorkflowRunResponse]]: if response.status_code == 201: response_201 = WorkflowRunResponse.from_dict(response.json()) @@ -59,8 +56,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | WorkflowRunResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, WorkflowRunResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -74,7 +71,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewWorkflowRun, -) -> Response[ErrorsList | WorkflowRunResponse]: +) -> Response[Union[ErrorsList, WorkflowRunResponse]]: """Creates a workflow run Creates a new workflow run from provided data @@ -88,7 +85,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WorkflowRunResponse] + Response[Union[ErrorsList, WorkflowRunResponse]] """ kwargs = _get_kwargs( @@ -108,7 +105,7 @@ def sync( *, client: AuthenticatedClient, body: NewWorkflowRun, -) -> ErrorsList | WorkflowRunResponse | None: +) -> Optional[Union[ErrorsList, WorkflowRunResponse]]: """Creates a workflow run Creates a new workflow run from provided data @@ -122,7 +119,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WorkflowRunResponse + Union[ErrorsList, WorkflowRunResponse] """ return sync_detailed( @@ -137,7 +134,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewWorkflowRun, -) -> Response[ErrorsList | WorkflowRunResponse]: +) -> Response[Union[ErrorsList, WorkflowRunResponse]]: """Creates a workflow run Creates a new workflow run from provided data @@ -151,7 +148,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WorkflowRunResponse] + Response[Union[ErrorsList, WorkflowRunResponse]] """ kwargs = _get_kwargs( @@ -169,7 +166,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewWorkflowRun, -) -> ErrorsList | WorkflowRunResponse | None: +) -> Optional[Union[ErrorsList, WorkflowRunResponse]]: """Creates a workflow run Creates a new workflow run from provided data @@ -183,7 +180,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WorkflowRunResponse + Union[ErrorsList, WorkflowRunResponse] """ return ( diff --git a/rootly_sdk/api/workflow_runs/list_workflow_runs.py b/rootly_sdk/api/workflow_runs/list_workflow_runs.py index 236adc68..c4901d66 100644 --- a/rootly_sdk/api/workflow_runs/list_workflow_runs.py +++ b/rootly_sdk/api/workflow_runs/list_workflow_runs.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,18 +13,17 @@ def _get_kwargs( workflow_id: str, *, - include: ListWorkflowRunsInclude | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Union[Unset, ListWorkflowRunsInclude] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} - json_include: str | Unset = UNSET + json_include: Union[Unset, str] = UNSET if not isinstance(include, Unset): json_include = include @@ -47,16 +45,16 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/workflows/{workflow_id}/workflow_runs".format( - workflow_id=quote(str(workflow_id), safe=""), - ), + "url": f"/v1/workflows/{workflow_id}/workflow_runs", "params": params, } return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> WorkflowRunsList | None: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[WorkflowRunsList]: if response.status_code == 200: response_200 = WorkflowRunsList.from_dict(response.json()) @@ -68,7 +66,9 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[WorkflowRunsList]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[WorkflowRunsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -81,13 +81,13 @@ def sync_detailed( workflow_id: str, *, client: AuthenticatedClient, - include: ListWorkflowRunsInclude | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Union[Unset, ListWorkflowRunsInclude] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, ) -> Response[WorkflowRunsList]: """List workflow runs @@ -95,13 +95,13 @@ def sync_detailed( Args: workflow_id (str): - include (ListWorkflowRunsInclude | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, ListWorkflowRunsInclude]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -133,27 +133,27 @@ def sync( workflow_id: str, *, client: AuthenticatedClient, - include: ListWorkflowRunsInclude | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, -) -> WorkflowRunsList | None: + include: Union[Unset, ListWorkflowRunsInclude] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, +) -> Optional[WorkflowRunsList]: """List workflow runs List workflow runs Args: workflow_id (str): - include (ListWorkflowRunsInclude | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, ListWorkflowRunsInclude]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -180,13 +180,13 @@ async def asyncio_detailed( workflow_id: str, *, client: AuthenticatedClient, - include: ListWorkflowRunsInclude | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, + include: Union[Unset, ListWorkflowRunsInclude] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, ) -> Response[WorkflowRunsList]: """List workflow runs @@ -194,13 +194,13 @@ async def asyncio_detailed( Args: workflow_id (str): - include (ListWorkflowRunsInclude | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, ListWorkflowRunsInclude]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -230,27 +230,27 @@ async def asyncio( workflow_id: str, *, client: AuthenticatedClient, - include: ListWorkflowRunsInclude | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, -) -> WorkflowRunsList | None: + include: Union[Unset, ListWorkflowRunsInclude] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, +) -> Optional[WorkflowRunsList]: """List workflow runs List workflow runs Args: workflow_id (str): - include (ListWorkflowRunsInclude | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): + include (Union[Unset, ListWorkflowRunsInclude]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/workflow_tasks/create_workflow_task.py b/rootly_sdk/api/workflow_tasks/create_workflow_task.py index cc51608f..b103f8e1 100644 --- a/rootly_sdk/api/workflow_tasks/create_workflow_task.py +++ b/rootly_sdk/api/workflow_tasks/create_workflow_task.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/workflows/{workflow_id}/workflow_tasks".format( - workflow_id=quote(str(workflow_id), safe=""), - ), + "url": f"/v1/workflows/{workflow_id}/workflow_tasks", } _kwargs["json"] = body.to_dict() @@ -35,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | WorkflowTaskResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, WorkflowTaskResponse]]: if response.status_code == 201: response_201 = WorkflowTaskResponse.from_dict(response.json()) @@ -54,8 +51,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | WorkflowTaskResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, WorkflowTaskResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewWorkflowTask, -) -> Response[ErrorsList | WorkflowTaskResponse]: +) -> Response[Union[ErrorsList, WorkflowTaskResponse]]: """Creates a workflow task Creates a new workflow task from provided data @@ -83,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WorkflowTaskResponse] + Response[Union[ErrorsList, WorkflowTaskResponse]] """ kwargs = _get_kwargs( @@ -103,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: NewWorkflowTask, -) -> ErrorsList | WorkflowTaskResponse | None: +) -> Optional[Union[ErrorsList, WorkflowTaskResponse]]: """Creates a workflow task Creates a new workflow task from provided data @@ -117,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WorkflowTaskResponse + Union[ErrorsList, WorkflowTaskResponse] """ return sync_detailed( @@ -132,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewWorkflowTask, -) -> Response[ErrorsList | WorkflowTaskResponse]: +) -> Response[Union[ErrorsList, WorkflowTaskResponse]]: """Creates a workflow task Creates a new workflow task from provided data @@ -146,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WorkflowTaskResponse] + Response[Union[ErrorsList, WorkflowTaskResponse]] """ kwargs = _get_kwargs( @@ -164,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewWorkflowTask, -) -> ErrorsList | WorkflowTaskResponse | None: +) -> Optional[Union[ErrorsList, WorkflowTaskResponse]]: """Creates a workflow task Creates a new workflow task from provided data @@ -178,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WorkflowTaskResponse + Union[ErrorsList, WorkflowTaskResponse] """ return ( diff --git a/rootly_sdk/api/workflow_tasks/delete_workflow_task.py b/rootly_sdk/api/workflow_tasks/delete_workflow_task.py index 5c119fa1..29a1c38d 100644 --- a/rootly_sdk/api/workflow_tasks/delete_workflow_task.py +++ b/rootly_sdk/api/workflow_tasks/delete_workflow_task.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/workflow_tasks/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/workflow_tasks/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | WorkflowTaskResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, WorkflowTaskResponse]]: if response.status_code == 200: response_200 = WorkflowTaskResponse.from_dict(response.json()) @@ -45,8 +41,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | WorkflowTaskResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, WorkflowTaskResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | WorkflowTaskResponse]: +) -> Response[Union[ErrorsList, WorkflowTaskResponse]]: """Delete a workflow task Delete a specific workflow task by id @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WorkflowTaskResponse] + Response[Union[ErrorsList, WorkflowTaskResponse]] """ kwargs = _get_kwargs( @@ -90,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | WorkflowTaskResponse | None: +) -> Optional[Union[ErrorsList, WorkflowTaskResponse]]: """Delete a workflow task Delete a specific workflow task by id @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WorkflowTaskResponse + Union[ErrorsList, WorkflowTaskResponse] """ return sync_detailed( @@ -116,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | WorkflowTaskResponse]: +) -> Response[Union[ErrorsList, WorkflowTaskResponse]]: """Delete a workflow task Delete a specific workflow task by id @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WorkflowTaskResponse] + Response[Union[ErrorsList, WorkflowTaskResponse]] """ kwargs = _get_kwargs( @@ -145,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | WorkflowTaskResponse | None: +) -> Optional[Union[ErrorsList, WorkflowTaskResponse]]: """Delete a workflow task Delete a specific workflow task by id @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WorkflowTaskResponse + Union[ErrorsList, WorkflowTaskResponse] """ return ( diff --git a/rootly_sdk/api/workflow_tasks/get_workflow_task.py b/rootly_sdk/api/workflow_tasks/get_workflow_task.py index d2ceba25..31506850 100644 --- a/rootly_sdk/api/workflow_tasks/get_workflow_task.py +++ b/rootly_sdk/api/workflow_tasks/get_workflow_task.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -14,20 +13,17 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/workflow_tasks/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/workflow_tasks/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | WorkflowTaskResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, WorkflowTaskResponse]]: if response.status_code == 200: response_200 = WorkflowTaskResponse.from_dict(response.json()) @@ -45,8 +41,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | WorkflowTaskResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, WorkflowTaskResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | WorkflowTaskResponse]: +) -> Response[Union[ErrorsList, WorkflowTaskResponse]]: """Retrieves a workflow task Retrieves a specific workflow_task by id @@ -72,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WorkflowTaskResponse] + Response[Union[ErrorsList, WorkflowTaskResponse]] """ kwargs = _get_kwargs( @@ -90,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | WorkflowTaskResponse | None: +) -> Optional[Union[ErrorsList, WorkflowTaskResponse]]: """Retrieves a workflow task Retrieves a specific workflow_task by id @@ -103,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WorkflowTaskResponse + Union[ErrorsList, WorkflowTaskResponse] """ return sync_detailed( @@ -116,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[ErrorsList | WorkflowTaskResponse]: +) -> Response[Union[ErrorsList, WorkflowTaskResponse]]: """Retrieves a workflow task Retrieves a specific workflow_task by id @@ -129,7 +125,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WorkflowTaskResponse] + Response[Union[ErrorsList, WorkflowTaskResponse]] """ kwargs = _get_kwargs( @@ -145,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> ErrorsList | WorkflowTaskResponse | None: +) -> Optional[Union[ErrorsList, WorkflowTaskResponse]]: """Retrieves a workflow task Retrieves a specific workflow_task by id @@ -158,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WorkflowTaskResponse + Union[ErrorsList, WorkflowTaskResponse] """ return ( diff --git a/rootly_sdk/api/workflow_tasks/list_workflow_tasks.py b/rootly_sdk/api/workflow_tasks/list_workflow_tasks.py index cc404c3a..c0a8a272 100644 --- a/rootly_sdk/api/workflow_tasks/list_workflow_tasks.py +++ b/rootly_sdk/api/workflow_tasks/list_workflow_tasks.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -13,22 +12,21 @@ def _get_kwargs( workflow_id: str, *, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, + filterslugeq: Union[Unset, str] = UNSET, + filterslugnot_eq: Union[Unset, str] = UNSET, + filterslugin: Union[Unset, str] = UNSET, + filterslugnot_in: Union[Unset, str] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} params["include"] = include @@ -63,16 +61,16 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/workflows/{workflow_id}/workflow_tasks".format( - workflow_id=quote(str(workflow_id), safe=""), - ), + "url": f"/v1/workflows/{workflow_id}/workflow_tasks", "params": params, } return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> WorkflowTaskList | None: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[WorkflowTaskList]: if response.status_code == 200: response_200 = WorkflowTaskList.from_dict(response.json()) @@ -84,7 +82,9 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[WorkflowTaskList]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[WorkflowTaskList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -97,20 +97,20 @@ def sync_detailed( workflow_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, + filterslugeq: Union[Unset, str] = UNSET, + filterslugnot_eq: Union[Unset, str] = UNSET, + filterslugin: Union[Unset, str] = UNSET, + filterslugnot_in: Union[Unset, str] = UNSET, ) -> Response[WorkflowTaskList]: """List workflow tasks @@ -118,20 +118,20 @@ def sync_detailed( Args: workflow_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterslug (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterslug (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -170,41 +170,41 @@ def sync( workflow_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, -) -> WorkflowTaskList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, + filterslugeq: Union[Unset, str] = UNSET, + filterslugnot_eq: Union[Unset, str] = UNSET, + filterslugin: Union[Unset, str] = UNSET, + filterslugnot_in: Union[Unset, str] = UNSET, +) -> Optional[WorkflowTaskList]: """List workflow tasks List workflow tasks Args: workflow_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterslug (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterslug (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -238,20 +238,20 @@ async def asyncio_detailed( workflow_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, + filterslugeq: Union[Unset, str] = UNSET, + filterslugnot_eq: Union[Unset, str] = UNSET, + filterslugin: Union[Unset, str] = UNSET, + filterslugnot_in: Union[Unset, str] = UNSET, ) -> Response[WorkflowTaskList]: """List workflow tasks @@ -259,20 +259,20 @@ async def asyncio_detailed( Args: workflow_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterslug (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterslug (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -309,41 +309,41 @@ async def asyncio( workflow_id: str, *, client: AuthenticatedClient, - include: str | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, -) -> WorkflowTaskList | None: + include: Union[Unset, str] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, + filterslugeq: Union[Unset, str] = UNSET, + filterslugnot_eq: Union[Unset, str] = UNSET, + filterslugin: Union[Unset, str] = UNSET, + filterslugnot_in: Union[Unset, str] = UNSET, +) -> Optional[WorkflowTaskList]: """List workflow tasks List workflow tasks Args: workflow_id (str): - include (str | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterslug (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): + include (Union[Unset, str]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterslug (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/workflow_tasks/update_workflow_task.py b/rootly_sdk/api/workflow_tasks/update_workflow_task.py index 3b045b86..30afc39d 100644 --- a/rootly_sdk/api/workflow_tasks/update_workflow_task.py +++ b/rootly_sdk/api/workflow_tasks/update_workflow_task.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union import httpx @@ -21,9 +20,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/workflow_tasks/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/workflow_tasks/{id}", } _kwargs["json"] = body.to_dict() @@ -35,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | WorkflowTaskResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, WorkflowTaskResponse]]: if response.status_code == 200: response_200 = WorkflowTaskResponse.from_dict(response.json()) @@ -54,8 +51,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | WorkflowTaskResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, WorkflowTaskResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateWorkflowTask, -) -> Response[ErrorsList | WorkflowTaskResponse]: +) -> Response[Union[ErrorsList, WorkflowTaskResponse]]: """Update a workflow task Update a specific workflow task by id @@ -83,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WorkflowTaskResponse] + Response[Union[ErrorsList, WorkflowTaskResponse]] """ kwargs = _get_kwargs( @@ -103,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateWorkflowTask, -) -> ErrorsList | WorkflowTaskResponse | None: +) -> Optional[Union[ErrorsList, WorkflowTaskResponse]]: """Update a workflow task Update a specific workflow task by id @@ -117,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WorkflowTaskResponse + Union[ErrorsList, WorkflowTaskResponse] """ return sync_detailed( @@ -132,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateWorkflowTask, -) -> Response[ErrorsList | WorkflowTaskResponse]: +) -> Response[Union[ErrorsList, WorkflowTaskResponse]]: """Update a workflow task Update a specific workflow task by id @@ -146,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WorkflowTaskResponse] + Response[Union[ErrorsList, WorkflowTaskResponse]] """ kwargs = _get_kwargs( @@ -164,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateWorkflowTask, -) -> ErrorsList | WorkflowTaskResponse | None: +) -> Optional[Union[ErrorsList, WorkflowTaskResponse]]: """Update a workflow task Update a specific workflow task by id @@ -178,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WorkflowTaskResponse + Union[ErrorsList, WorkflowTaskResponse] """ return ( diff --git a/rootly_sdk/api/workflows/create_workflow.py b/rootly_sdk/api/workflows/create_workflow.py index 2db8a745..f59f2d54 100644 --- a/rootly_sdk/api/workflows/create_workflow.py +++ b/rootly_sdk/api/workflows/create_workflow.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | WorkflowResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, WorkflowResponse]]: if response.status_code == 201: response_201 = WorkflowResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | WorkflowResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, WorkflowResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +69,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewWorkflow, -) -> Response[ErrorsList | WorkflowResponse]: +) -> Response[Union[ErrorsList, WorkflowResponse]]: """Creates a workflow Creates a new workflow from provided data @@ -82,7 +82,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WorkflowResponse] + Response[Union[ErrorsList, WorkflowResponse]] """ kwargs = _get_kwargs( @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: NewWorkflow, -) -> ErrorsList | WorkflowResponse | None: +) -> Optional[Union[ErrorsList, WorkflowResponse]]: """Creates a workflow Creates a new workflow from provided data @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WorkflowResponse + Union[ErrorsList, WorkflowResponse] """ return sync_detailed( @@ -126,7 +126,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewWorkflow, -) -> Response[ErrorsList | WorkflowResponse]: +) -> Response[Union[ErrorsList, WorkflowResponse]]: """Creates a workflow Creates a new workflow from provided data @@ -139,7 +139,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WorkflowResponse] + Response[Union[ErrorsList, WorkflowResponse]] """ kwargs = _get_kwargs( @@ -155,7 +155,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewWorkflow, -) -> ErrorsList | WorkflowResponse | None: +) -> Optional[Union[ErrorsList, WorkflowResponse]]: """Creates a workflow Creates a new workflow from provided data @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WorkflowResponse + Union[ErrorsList, WorkflowResponse] """ return ( diff --git a/rootly_sdk/api/workflows/delete_workflow.py b/rootly_sdk/api/workflows/delete_workflow.py index c407da66..999d347b 100644 --- a/rootly_sdk/api/workflows/delete_workflow.py +++ b/rootly_sdk/api/workflows/delete_workflow.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union from uuid import UUID import httpx @@ -13,22 +12,19 @@ def _get_kwargs( - id: str | UUID, + id: Union[UUID, str], ) -> dict[str, Any]: - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/v1/workflows/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/workflows/{id}", } return _kwargs def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | WorkflowResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, WorkflowResponse]]: if response.status_code == 200: response_200 = WorkflowResponse.from_dict(response.json()) @@ -46,8 +42,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | WorkflowResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, WorkflowResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -57,23 +53,23 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Response[ErrorsList | WorkflowResponse]: +) -> Response[Union[ErrorsList, WorkflowResponse]]: """Delete a workflow Delete a specific workflow by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WorkflowResponse] + Response[Union[ErrorsList, WorkflowResponse]] """ kwargs = _get_kwargs( @@ -88,23 +84,23 @@ def sync_detailed( def sync( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> ErrorsList | WorkflowResponse | None: +) -> Optional[Union[ErrorsList, WorkflowResponse]]: """Delete a workflow Delete a specific workflow by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WorkflowResponse + Union[ErrorsList, WorkflowResponse] """ return sync_detailed( @@ -114,23 +110,23 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> Response[ErrorsList | WorkflowResponse]: +) -> Response[Union[ErrorsList, WorkflowResponse]]: """Delete a workflow Delete a specific workflow by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WorkflowResponse] + Response[Union[ErrorsList, WorkflowResponse]] """ kwargs = _get_kwargs( @@ -143,23 +139,23 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, -) -> ErrorsList | WorkflowResponse | None: +) -> Optional[Union[ErrorsList, WorkflowResponse]]: """Delete a workflow Delete a specific workflow by id Args: - id (str | UUID): + id (Union[UUID, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WorkflowResponse + Union[ErrorsList, WorkflowResponse] """ return ( diff --git a/rootly_sdk/api/workflows/get_workflow.py b/rootly_sdk/api/workflows/get_workflow.py index 905edf81..19cbb099 100644 --- a/rootly_sdk/api/workflows/get_workflow.py +++ b/rootly_sdk/api/workflows/get_workflow.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union from uuid import UUID import httpx @@ -14,14 +13,13 @@ def _get_kwargs( - id: str | UUID, + id: Union[UUID, str], *, - include: GetWorkflowInclude | Unset = UNSET, + include: Union[Unset, GetWorkflowInclude] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} - json_include: str | Unset = UNSET + json_include: Union[Unset, str] = UNSET if not isinstance(include, Unset): json_include = include @@ -31,9 +29,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/workflows/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/workflows/{id}", "params": params, } @@ -41,8 +37,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | WorkflowResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, WorkflowResponse]]: if response.status_code == 200: response_200 = WorkflowResponse.from_dict(response.json()) @@ -60,8 +56,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | WorkflowResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, WorkflowResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -71,25 +67,25 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, - include: GetWorkflowInclude | Unset = UNSET, -) -> Response[ErrorsList | WorkflowResponse]: + include: Union[Unset, GetWorkflowInclude] = UNSET, +) -> Response[Union[ErrorsList, WorkflowResponse]]: """Retrieves a workflow Retrieves a specific workflow by id Args: - id (str | UUID): - include (GetWorkflowInclude | Unset): + id (Union[UUID, str]): + include (Union[Unset, GetWorkflowInclude]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WorkflowResponse] + Response[Union[ErrorsList, WorkflowResponse]] """ kwargs = _get_kwargs( @@ -105,25 +101,25 @@ def sync_detailed( def sync( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, - include: GetWorkflowInclude | Unset = UNSET, -) -> ErrorsList | WorkflowResponse | None: + include: Union[Unset, GetWorkflowInclude] = UNSET, +) -> Optional[Union[ErrorsList, WorkflowResponse]]: """Retrieves a workflow Retrieves a specific workflow by id Args: - id (str | UUID): - include (GetWorkflowInclude | Unset): + id (Union[UUID, str]): + include (Union[Unset, GetWorkflowInclude]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WorkflowResponse + Union[ErrorsList, WorkflowResponse] """ return sync_detailed( @@ -134,25 +130,25 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, - include: GetWorkflowInclude | Unset = UNSET, -) -> Response[ErrorsList | WorkflowResponse]: + include: Union[Unset, GetWorkflowInclude] = UNSET, +) -> Response[Union[ErrorsList, WorkflowResponse]]: """Retrieves a workflow Retrieves a specific workflow by id Args: - id (str | UUID): - include (GetWorkflowInclude | Unset): + id (Union[UUID, str]): + include (Union[Unset, GetWorkflowInclude]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WorkflowResponse] + Response[Union[ErrorsList, WorkflowResponse]] """ kwargs = _get_kwargs( @@ -166,25 +162,25 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, - include: GetWorkflowInclude | Unset = UNSET, -) -> ErrorsList | WorkflowResponse | None: + include: Union[Unset, GetWorkflowInclude] = UNSET, +) -> Optional[Union[ErrorsList, WorkflowResponse]]: """Retrieves a workflow Retrieves a specific workflow by id Args: - id (str | UUID): - include (GetWorkflowInclude | Unset): + id (Union[UUID, str]): + include (Union[Unset, GetWorkflowInclude]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WorkflowResponse + Union[ErrorsList, WorkflowResponse] """ return ( diff --git a/rootly_sdk/api/workflows/list_workflows.py b/rootly_sdk/api/workflows/list_workflows.py index 8b9f0bb3..5dc4125b 100644 --- a/rootly_sdk/api/workflows/list_workflows.py +++ b/rootly_sdk/api/workflows/list_workflows.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, Optional, Union import httpx @@ -13,36 +13,35 @@ def _get_kwargs( *, - include: ListWorkflowsInclude | Unset = UNSET, - sort: ListWorkflowsSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, + include: Union[Unset, ListWorkflowsInclude] = UNSET, + sort: Union[Unset, ListWorkflowsSort] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filterslugeq: Union[Unset, str] = UNSET, + filterslugnot_eq: Union[Unset, str] = UNSET, + filterslugin: Union[Unset, str] = UNSET, + filterslugnot_in: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} - json_include: str | Unset = UNSET + json_include: Union[Unset, str] = UNSET if not isinstance(include, Unset): json_include = include params["include"] = json_include - json_sort: str | Unset = UNSET + json_sort: Union[Unset, str] = UNSET if not isinstance(sort, Unset): json_sort = sort @@ -93,7 +92,7 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> WorkflowList | None: +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[WorkflowList]: if response.status_code == 200: response_200 = WorkflowList.from_dict(response.json()) @@ -105,7 +104,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[WorkflowList]: +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[WorkflowList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -117,50 +116,50 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - include: ListWorkflowsInclude | Unset = UNSET, - sort: ListWorkflowsSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, + include: Union[Unset, ListWorkflowsInclude] = UNSET, + sort: Union[Unset, ListWorkflowsSort] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filterslugeq: Union[Unset, str] = UNSET, + filterslugnot_eq: Union[Unset, str] = UNSET, + filterslugin: Union[Unset, str] = UNSET, + filterslugnot_in: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, ) -> Response[WorkflowList]: """List workflows List workflows Args: - include (ListWorkflowsInclude | Unset): - sort (ListWorkflowsSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterslug (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): + include (Union[Unset, ListWorkflowsInclude]): + sort (Union[Unset, ListWorkflowsSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -202,50 +201,50 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: ListWorkflowsInclude | Unset = UNSET, - sort: ListWorkflowsSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, -) -> WorkflowList | None: + include: Union[Unset, ListWorkflowsInclude] = UNSET, + sort: Union[Unset, ListWorkflowsSort] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filterslugeq: Union[Unset, str] = UNSET, + filterslugnot_eq: Union[Unset, str] = UNSET, + filterslugin: Union[Unset, str] = UNSET, + filterslugnot_in: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, +) -> Optional[WorkflowList]: """List workflows List workflows Args: - include (ListWorkflowsInclude | Unset): - sort (ListWorkflowsSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterslug (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): + include (Union[Unset, ListWorkflowsInclude]): + sort (Union[Unset, ListWorkflowsSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -282,50 +281,50 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: ListWorkflowsInclude | Unset = UNSET, - sort: ListWorkflowsSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, + include: Union[Unset, ListWorkflowsInclude] = UNSET, + sort: Union[Unset, ListWorkflowsSort] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filterslugeq: Union[Unset, str] = UNSET, + filterslugnot_eq: Union[Unset, str] = UNSET, + filterslugin: Union[Unset, str] = UNSET, + filterslugnot_in: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, ) -> Response[WorkflowList]: """List workflows List workflows Args: - include (ListWorkflowsInclude | Unset): - sort (ListWorkflowsSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterslug (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): + include (Union[Unset, ListWorkflowsInclude]): + sort (Union[Unset, ListWorkflowsSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -365,50 +364,50 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: ListWorkflowsInclude | Unset = UNSET, - sort: ListWorkflowsSort | Unset = UNSET, - pagenumber: int | Unset = UNSET, - pagesize: int | Unset = UNSET, - filtersearch: str | Unset = UNSET, - filtername: str | Unset = UNSET, - filterslug: str | Unset = UNSET, - filtercreated_atgt: str | Unset = UNSET, - filtercreated_atgte: str | Unset = UNSET, - filtercreated_atlt: str | Unset = UNSET, - filtercreated_atlte: str | Unset = UNSET, - filterslugeq: str | Unset = UNSET, - filterslugnot_eq: str | Unset = UNSET, - filterslugin: str | Unset = UNSET, - filterslugnot_in: str | Unset = UNSET, - filternameeq: str | Unset = UNSET, - filternamenot_eq: str | Unset = UNSET, - filternamein: str | Unset = UNSET, - filternamenot_in: str | Unset = UNSET, -) -> WorkflowList | None: + include: Union[Unset, ListWorkflowsInclude] = UNSET, + sort: Union[Unset, ListWorkflowsSort] = UNSET, + pagenumber: Union[Unset, int] = UNSET, + pagesize: Union[Unset, int] = UNSET, + filtersearch: Union[Unset, str] = UNSET, + filtername: Union[Unset, str] = UNSET, + filterslug: Union[Unset, str] = UNSET, + filtercreated_atgt: Union[Unset, str] = UNSET, + filtercreated_atgte: Union[Unset, str] = UNSET, + filtercreated_atlt: Union[Unset, str] = UNSET, + filtercreated_atlte: Union[Unset, str] = UNSET, + filterslugeq: Union[Unset, str] = UNSET, + filterslugnot_eq: Union[Unset, str] = UNSET, + filterslugin: Union[Unset, str] = UNSET, + filterslugnot_in: Union[Unset, str] = UNSET, + filternameeq: Union[Unset, str] = UNSET, + filternamenot_eq: Union[Unset, str] = UNSET, + filternamein: Union[Unset, str] = UNSET, + filternamenot_in: Union[Unset, str] = UNSET, +) -> Optional[WorkflowList]: """List workflows List workflows Args: - include (ListWorkflowsInclude | Unset): - sort (ListWorkflowsSort | Unset): - pagenumber (int | Unset): - pagesize (int | Unset): - filtersearch (str | Unset): - filtername (str | Unset): - filterslug (str | Unset): - filtercreated_atgt (str | Unset): - filtercreated_atgte (str | Unset): - filtercreated_atlt (str | Unset): - filtercreated_atlte (str | Unset): - filterslugeq (str | Unset): - filterslugnot_eq (str | Unset): - filterslugin (str | Unset): - filterslugnot_in (str | Unset): - filternameeq (str | Unset): - filternamenot_eq (str | Unset): - filternamein (str | Unset): - filternamenot_in (str | Unset): + include (Union[Unset, ListWorkflowsInclude]): + sort (Union[Unset, ListWorkflowsSort]): + pagenumber (Union[Unset, int]): + pagesize (Union[Unset, int]): + filtersearch (Union[Unset, str]): + filtername (Union[Unset, str]): + filterslug (Union[Unset, str]): + filtercreated_atgt (Union[Unset, str]): + filtercreated_atgte (Union[Unset, str]): + filtercreated_atlt (Union[Unset, str]): + filtercreated_atlte (Union[Unset, str]): + filterslugeq (Union[Unset, str]): + filterslugnot_eq (Union[Unset, str]): + filterslugin (Union[Unset, str]): + filterslugnot_in (Union[Unset, str]): + filternameeq (Union[Unset, str]): + filternamenot_eq (Union[Unset, str]): + filternamein (Union[Unset, str]): + filternamenot_in (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/rootly_sdk/api/workflows/update_workflow.py b/rootly_sdk/api/workflows/update_workflow.py index aa48bba6..15bc0bc5 100644 --- a/rootly_sdk/api/workflows/update_workflow.py +++ b/rootly_sdk/api/workflows/update_workflow.py @@ -1,6 +1,5 @@ from http import HTTPStatus -from typing import Any -from urllib.parse import quote +from typing import Any, Optional, Union from uuid import UUID import httpx @@ -14,7 +13,7 @@ def _get_kwargs( - id: str | UUID, + id: Union[UUID, str], *, body: UpdateWorkflow, ) -> dict[str, Any]: @@ -22,9 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/v1/workflows/{id}".format( - id=quote(str(id), safe=""), - ), + "url": f"/v1/workflows/{id}", } _kwargs["json"] = body.to_dict() @@ -36,8 +33,8 @@ def _get_kwargs( def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorsList | WorkflowResponse | None: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ErrorsList, WorkflowResponse]]: if response.status_code == 200: response_200 = WorkflowResponse.from_dict(response.json()) @@ -60,8 +57,8 @@ def _parse_response( def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorsList | WorkflowResponse]: + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ErrorsList, WorkflowResponse]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -71,17 +68,17 @@ def _build_response( def sync_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdateWorkflow, -) -> Response[ErrorsList | WorkflowResponse]: +) -> Response[Union[ErrorsList, WorkflowResponse]]: """Update a workflow Update a specific workflow by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateWorkflow): Raises: @@ -89,7 +86,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WorkflowResponse] + Response[Union[ErrorsList, WorkflowResponse]] """ kwargs = _get_kwargs( @@ -105,17 +102,17 @@ def sync_detailed( def sync( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdateWorkflow, -) -> ErrorsList | WorkflowResponse | None: +) -> Optional[Union[ErrorsList, WorkflowResponse]]: """Update a workflow Update a specific workflow by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateWorkflow): Raises: @@ -123,7 +120,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WorkflowResponse + Union[ErrorsList, WorkflowResponse] """ return sync_detailed( @@ -134,17 +131,17 @@ def sync( async def asyncio_detailed( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdateWorkflow, -) -> Response[ErrorsList | WorkflowResponse]: +) -> Response[Union[ErrorsList, WorkflowResponse]]: """Update a workflow Update a specific workflow by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateWorkflow): Raises: @@ -152,7 +149,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorsList | WorkflowResponse] + Response[Union[ErrorsList, WorkflowResponse]] """ kwargs = _get_kwargs( @@ -166,17 +163,17 @@ async def asyncio_detailed( async def asyncio( - id: str | UUID, + id: Union[UUID, str], *, client: AuthenticatedClient, body: UpdateWorkflow, -) -> ErrorsList | WorkflowResponse | None: +) -> Optional[Union[ErrorsList, WorkflowResponse]]: """Update a workflow Update a specific workflow by id Args: - id (str | UUID): + id (Union[UUID, str]): body (UpdateWorkflow): Raises: @@ -184,7 +181,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorsList | WorkflowResponse + Union[ErrorsList, WorkflowResponse] """ return ( diff --git a/rootly_sdk/client.py b/rootly_sdk/client.py index 1b7055ab..e80446f1 100644 --- a/rootly_sdk/client.py +++ b/rootly_sdk/client.py @@ -1,5 +1,5 @@ import ssl -from typing import Any +from typing import Any, Optional, Union import httpx from attrs import define, evolve, field @@ -38,12 +38,12 @@ class Client: _base_url: str = field(alias="base_url") _cookies: dict[str, str] = field(factory=dict, kw_only=True, alias="cookies") _headers: dict[str, str] = field(factory=dict, kw_only=True, alias="headers") - _timeout: httpx.Timeout | None = field(default=None, kw_only=True, alias="timeout") - _verify_ssl: str | bool | ssl.SSLContext = field(default=True, kw_only=True, alias="verify_ssl") + _timeout: Optional[httpx.Timeout] = field(default=None, kw_only=True, alias="timeout") + _verify_ssl: Union[str, bool, ssl.SSLContext] = field(default=True, kw_only=True, alias="verify_ssl") _follow_redirects: bool = field(default=False, kw_only=True, alias="follow_redirects") _httpx_args: dict[str, Any] = field(factory=dict, kw_only=True, alias="httpx_args") - _client: httpx.Client | None = field(default=None, init=False) - _async_client: httpx.AsyncClient | None = field(default=None, init=False) + _client: Optional[httpx.Client] = field(default=None, init=False) + _async_client: Optional[httpx.AsyncClient] = field(default=None, init=False) def with_headers(self, headers: dict[str, str]) -> "Client": """Get a new client matching this one with additional headers""" @@ -62,7 +62,7 @@ def with_cookies(self, cookies: dict[str, str]) -> "Client": return evolve(self, cookies={**self._cookies, **cookies}) def with_timeout(self, timeout: httpx.Timeout) -> "Client": - """Get a new client matching this one with a new timeout configuration""" + """Get a new client matching this one with a new timeout (in seconds)""" if self._client is not None: self._client.timeout = timeout if self._async_client is not None: @@ -101,7 +101,7 @@ def __exit__(self, *args: Any, **kwargs: Any) -> None: self.get_httpx_client().__exit__(*args, **kwargs) def set_async_httpx_client(self, async_client: httpx.AsyncClient) -> "Client": - """Manually set the underlying httpx.AsyncClient + """Manually the underlying httpx.AsyncClient **NOTE**: This will override any other settings on the client, including cookies, headers, and timeout. """ @@ -168,12 +168,12 @@ class AuthenticatedClient: _base_url: str = field(alias="base_url") _cookies: dict[str, str] = field(factory=dict, kw_only=True, alias="cookies") _headers: dict[str, str] = field(factory=dict, kw_only=True, alias="headers") - _timeout: httpx.Timeout | None = field(default=None, kw_only=True, alias="timeout") - _verify_ssl: str | bool | ssl.SSLContext = field(default=True, kw_only=True, alias="verify_ssl") + _timeout: Optional[httpx.Timeout] = field(default=None, kw_only=True, alias="timeout") + _verify_ssl: Union[str, bool, ssl.SSLContext] = field(default=True, kw_only=True, alias="verify_ssl") _follow_redirects: bool = field(default=False, kw_only=True, alias="follow_redirects") _httpx_args: dict[str, Any] = field(factory=dict, kw_only=True, alias="httpx_args") - _client: httpx.Client | None = field(default=None, init=False) - _async_client: httpx.AsyncClient | None = field(default=None, init=False) + _client: Optional[httpx.Client] = field(default=None, init=False) + _async_client: Optional[httpx.AsyncClient] = field(default=None, init=False) token: str prefix: str = "Bearer" @@ -196,7 +196,7 @@ def with_cookies(self, cookies: dict[str, str]) -> "AuthenticatedClient": return evolve(self, cookies={**self._cookies, **cookies}) def with_timeout(self, timeout: httpx.Timeout) -> "AuthenticatedClient": - """Get a new client matching this one with a new timeout configuration""" + """Get a new client matching this one with a new timeout (in seconds)""" if self._client is not None: self._client.timeout = timeout if self._async_client is not None: @@ -236,7 +236,7 @@ def __exit__(self, *args: Any, **kwargs: Any) -> None: self.get_httpx_client().__exit__(*args, **kwargs) def set_async_httpx_client(self, async_client: httpx.AsyncClient) -> "AuthenticatedClient": - """Manually set the underlying httpx.AsyncClient + """Manually the underlying httpx.AsyncClient **NOTE**: This will override any other settings on the client, including cookies, headers, and timeout. """ diff --git a/rootly_sdk/models/__init__.py b/rootly_sdk/models/__init__.py index 52d5e241..171285a1 100644 --- a/rootly_sdk/models/__init__.py +++ b/rootly_sdk/models/__init__.py @@ -158,6 +158,17 @@ from .alert_response import AlertResponse from .alert_response_data import AlertResponseData from .alert_response_data_type import AlertResponseDataType +from .alert_retrigger_rule import AlertRetriggerRule +from .alert_retrigger_rule_conditions_item import AlertRetriggerRuleConditionsItem +from .alert_retrigger_rule_conditions_item_kind import AlertRetriggerRuleConditionsItemKind +from .alert_retrigger_rule_conditions_item_operator import AlertRetriggerRuleConditionsItemOperator +from .alert_retrigger_rule_list import AlertRetriggerRuleList +from .alert_retrigger_rule_list_data_item import AlertRetriggerRuleListDataItem +from .alert_retrigger_rule_list_data_item_type import AlertRetriggerRuleListDataItemType +from .alert_retrigger_rule_match_mode import AlertRetriggerRuleMatchMode +from .alert_retrigger_rule_response import AlertRetriggerRuleResponse +from .alert_retrigger_rule_response_data import AlertRetriggerRuleResponseData +from .alert_retrigger_rule_response_data_type import AlertRetriggerRuleResponseDataType from .alert_route import AlertRoute from .alert_route_list import AlertRouteList from .alert_route_list_data_item import AlertRouteListDataItem @@ -330,6 +341,12 @@ AttachDatadogDashboardsTaskParamsPostToSlackChannelsItem, ) from .attach_datadog_dashboards_task_params_task_type import AttachDatadogDashboardsTaskParamsTaskType +from .attach_retrospective_pdf_to_freshservice_ticket_task_params import ( + AttachRetrospectivePdfToFreshserviceTicketTaskParams, +) +from .attach_retrospective_pdf_to_freshservice_ticket_task_params_task_type import ( + AttachRetrospectivePdfToFreshserviceTicketTaskParamsTaskType, +) from .attach_retrospective_pdf_to_jira_issue_task_params import AttachRetrospectivePdfToJiraIssueTaskParams from .attach_retrospective_pdf_to_jira_issue_task_params_integration import ( AttachRetrospectivePdfToJiraIssueTaskParamsIntegration, @@ -361,15 +378,15 @@ from .auto_assign_role_pagerduty_task_params_type_1_escalation_policy import ( AutoAssignRolePagerdutyTaskParamsType1EscalationPolicy, ) -from .auto_assign_role_rootly_task_params import AutoAssignRoleRootlyTaskParams -from .auto_assign_role_rootly_task_params_escalation_policy_target import ( - AutoAssignRoleRootlyTaskParamsEscalationPolicyTarget, +from .auto_assign_role_rootly_task_params_type_0_escalation_policy_target import ( + AutoAssignRoleRootlyTaskParamsType0EscalationPolicyTarget, +) +from .auto_assign_role_rootly_task_params_type_1_service_target import AutoAssignRoleRootlyTaskParamsType1ServiceTarget +from .auto_assign_role_rootly_task_params_type_2_user_target import AutoAssignRoleRootlyTaskParamsType2UserTarget +from .auto_assign_role_rootly_task_params_type_3_group_target import AutoAssignRoleRootlyTaskParamsType3GroupTarget +from .auto_assign_role_rootly_task_params_type_4_schedule_target import ( + AutoAssignRoleRootlyTaskParamsType4ScheduleTarget, ) -from .auto_assign_role_rootly_task_params_group_target import AutoAssignRoleRootlyTaskParamsGroupTarget -from .auto_assign_role_rootly_task_params_schedule_target import AutoAssignRoleRootlyTaskParamsScheduleTarget -from .auto_assign_role_rootly_task_params_service_target import AutoAssignRoleRootlyTaskParamsServiceTarget -from .auto_assign_role_rootly_task_params_task_type import AutoAssignRoleRootlyTaskParamsTaskType -from .auto_assign_role_rootly_task_params_user_target import AutoAssignRoleRootlyTaskParamsUserTarget from .auto_assign_role_victor_ops_task_params import AutoAssignRoleVictorOpsTaskParams from .auto_assign_role_victor_ops_task_params_task_type import AutoAssignRoleVictorOpsTaskParamsTaskType from .auto_assign_role_victor_ops_task_params_team import AutoAssignRoleVictorOpsTaskParamsTeam @@ -627,6 +644,7 @@ from .create_asana_task_task_params_task_type import CreateAsanaTaskTaskParamsTaskType from .create_asana_task_task_params_workspace import CreateAsanaTaskTaskParamsWorkspace from .create_clickup_task_task_params import CreateClickupTaskTaskParams +from .create_clickup_task_task_params_list import CreateClickupTaskTaskParamsList from .create_clickup_task_task_params_priority import CreateClickupTaskTaskParamsPriority from .create_clickup_task_task_params_task_type import CreateClickupTaskTaskParamsTaskType from .create_coda_page_task_params import CreateCodaPageTaskParams @@ -868,6 +886,7 @@ from .custom_field_option_response_data import CustomFieldOptionResponseData from .custom_field_option_response_data_type import CustomFieldOptionResponseDataType from .custom_field_required_type_0_item import CustomFieldRequiredType0Item +from .custom_field_resource_type import CustomFieldResourceType from .custom_field_response import CustomFieldResponse from .custom_field_response_data import CustomFieldResponseData from .custom_field_response_data_type import CustomFieldResponseDataType @@ -984,6 +1003,12 @@ from .escalation_policy_level_notification_target_params_item_type_0_type import ( EscalationPolicyLevelNotificationTargetParamsItemType0Type, ) +from .escalation_policy_level_paging_strategy_configuration_repeats_mode import ( + EscalationPolicyLevelPagingStrategyConfigurationRepeatsMode, +) +from .escalation_policy_level_paging_strategy_configuration_rotation_scope import ( + EscalationPolicyLevelPagingStrategyConfigurationRotationScope, +) from .escalation_policy_level_paging_strategy_configuration_schedule_strategy import ( EscalationPolicyLevelPagingStrategyConfigurationScheduleStrategy, ) @@ -1121,6 +1146,7 @@ from .form_field_position_response import FormFieldPositionResponse from .form_field_position_response_data import FormFieldPositionResponseData from .form_field_position_response_data_type import FormFieldPositionResponseDataType +from .form_field_resource_type import FormFieldResourceType from .form_field_response import FormFieldResponse from .form_field_response_data import FormFieldResponseData from .form_field_response_data_type import FormFieldResponseDataType @@ -1338,6 +1364,10 @@ from .incident_status_page_event_response_data import IncidentStatusPageEventResponseData from .incident_status_page_event_response_data_type import IncidentStatusPageEventResponseDataType from .incident_status_page_event_status import IncidentStatusPageEventStatus +from .incident_status_page_event_status_page_components_item import IncidentStatusPageEventStatusPageComponentsItem +from .incident_status_page_event_status_page_components_item_status import ( + IncidentStatusPageEventStatusPageComponentsItemStatus, +) from .incident_sub_status import IncidentSubStatus from .incident_sub_status_list import IncidentSubStatusList from .incident_sub_status_list_data_item import IncidentSubStatusListDataItem @@ -1600,6 +1630,19 @@ from .new_alert_group_data_attributes_targets_item import NewAlertGroupDataAttributesTargetsItem from .new_alert_group_data_attributes_targets_item_target_type import NewAlertGroupDataAttributesTargetsItemTargetType from .new_alert_group_data_type import NewAlertGroupDataType +from .new_alert_retrigger_rule import NewAlertRetriggerRule +from .new_alert_retrigger_rule_data import NewAlertRetriggerRuleData +from .new_alert_retrigger_rule_data_attributes import NewAlertRetriggerRuleDataAttributes +from .new_alert_retrigger_rule_data_attributes_conditions_item import NewAlertRetriggerRuleDataAttributesConditionsItem +from .new_alert_retrigger_rule_data_attributes_conditions_item_kind import ( + NewAlertRetriggerRuleDataAttributesConditionsItemKind, +) +from .new_alert_retrigger_rule_data_attributes_conditions_item_operator import ( + NewAlertRetriggerRuleDataAttributesConditionsItemOperator, +) +from .new_alert_retrigger_rule_data_attributes_match_mode import NewAlertRetriggerRuleDataAttributesMatchMode +from .new_alert_retrigger_rule_data_attributes_timeout_minutes import NewAlertRetriggerRuleDataAttributesTimeoutMinutes +from .new_alert_retrigger_rule_data_type import NewAlertRetriggerRuleDataType from .new_alert_route import NewAlertRoute from .new_alert_route_data import NewAlertRouteData from .new_alert_route_data_attributes import NewAlertRouteDataAttributes @@ -1914,6 +1957,12 @@ from .new_escalation_policy_level_data_attributes_notification_target_params_item_type_0_type import ( NewEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0Type, ) +from .new_escalation_policy_level_data_attributes_paging_strategy_configuration_repeats_mode import ( + NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRepeatsMode, +) +from .new_escalation_policy_level_data_attributes_paging_strategy_configuration_rotation_scope import ( + NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRotationScope, +) from .new_escalation_policy_level_data_attributes_paging_strategy_configuration_schedule_strategy import ( NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationScheduleStrategy, ) @@ -2160,6 +2209,12 @@ from .new_incident_status_page_event_data import NewIncidentStatusPageEventData from .new_incident_status_page_event_data_attributes import NewIncidentStatusPageEventDataAttributes from .new_incident_status_page_event_data_attributes_status import NewIncidentStatusPageEventDataAttributesStatus +from .new_incident_status_page_event_data_attributes_status_page_components_type_0_item import ( + NewIncidentStatusPageEventDataAttributesStatusPageComponentsType0Item, +) +from .new_incident_status_page_event_data_attributes_status_page_components_type_0_item_status import ( + NewIncidentStatusPageEventDataAttributesStatusPageComponentsType0ItemStatus, +) from .new_incident_status_page_event_data_type import NewIncidentStatusPageEventDataType from .new_incident_sub_status import NewIncidentSubStatus from .new_incident_sub_status_data import NewIncidentSubStatusData @@ -2479,6 +2534,19 @@ ) from .new_sla_data_type import NewSlaDataType from .new_status_page import NewStatusPage +from .new_status_page_announcement import NewStatusPageAnnouncement +from .new_status_page_announcement_data import NewStatusPageAnnouncementData +from .new_status_page_announcement_data_attributes import NewStatusPageAnnouncementDataAttributes +from .new_status_page_announcement_data_type import NewStatusPageAnnouncementDataType +from .new_status_page_component import NewStatusPageComponent +from .new_status_page_component_data import NewStatusPageComponentData +from .new_status_page_component_data_attributes import NewStatusPageComponentDataAttributes +from .new_status_page_component_data_attributes_source_type import NewStatusPageComponentDataAttributesSourceType +from .new_status_page_component_data_type import NewStatusPageComponentDataType +from .new_status_page_component_group import NewStatusPageComponentGroup +from .new_status_page_component_group_data import NewStatusPageComponentGroupData +from .new_status_page_component_group_data_attributes import NewStatusPageComponentGroupDataAttributes +from .new_status_page_component_group_data_type import NewStatusPageComponentGroupDataType from .new_status_page_data import NewStatusPageData from .new_status_page_data_attributes import NewStatusPageDataAttributes from .new_status_page_data_attributes_authentication_method import NewStatusPageDataAttributesAuthenticationMethod @@ -2526,6 +2594,10 @@ from .new_user_phone_number_data import NewUserPhoneNumberData from .new_user_phone_number_data_attributes import NewUserPhoneNumberDataAttributes from .new_user_phone_number_data_type import NewUserPhoneNumberDataType +from .new_verified_domain import NewVerifiedDomain +from .new_verified_domain_data import NewVerifiedDomainData +from .new_verified_domain_data_attributes import NewVerifiedDomainDataAttributes +from .new_verified_domain_data_type import NewVerifiedDomainDataType from .new_webhooks_endpoint import NewWebhooksEndpoint from .new_webhooks_endpoint_data import NewWebhooksEndpointData from .new_webhooks_endpoint_data_attributes import NewWebhooksEndpointDataAttributes @@ -3157,8 +3229,30 @@ from .status_list_data_item import StatusListDataItem from .status_list_data_item_type import StatusListDataItemType from .status_page import StatusPage +from .status_page_announcement import StatusPageAnnouncement +from .status_page_announcement_list import StatusPageAnnouncementList +from .status_page_announcement_list_data_item import StatusPageAnnouncementListDataItem +from .status_page_announcement_list_data_item_type import StatusPageAnnouncementListDataItemType +from .status_page_announcement_response import StatusPageAnnouncementResponse +from .status_page_announcement_response_data import StatusPageAnnouncementResponseData +from .status_page_announcement_response_data_type import StatusPageAnnouncementResponseDataType from .status_page_authentication_method import StatusPageAuthenticationMethod from .status_page_cname_records_type_0 import StatusPageCnameRecordsType0 +from .status_page_component import StatusPageComponent +from .status_page_component_group import StatusPageComponentGroup +from .status_page_component_group_list import StatusPageComponentGroupList +from .status_page_component_group_list_data_item import StatusPageComponentGroupListDataItem +from .status_page_component_group_list_data_item_type import StatusPageComponentGroupListDataItemType +from .status_page_component_group_response import StatusPageComponentGroupResponse +from .status_page_component_group_response_data import StatusPageComponentGroupResponseData +from .status_page_component_group_response_data_type import StatusPageComponentGroupResponseDataType +from .status_page_component_list import StatusPageComponentList +from .status_page_component_list_data_item import StatusPageComponentListDataItem +from .status_page_component_list_data_item_type import StatusPageComponentListDataItemType +from .status_page_component_response import StatusPageComponentResponse +from .status_page_component_response_data import StatusPageComponentResponseData +from .status_page_component_response_data_type import StatusPageComponentResponseDataType +from .status_page_component_status import StatusPageComponentStatus from .status_page_list import StatusPageList from .status_page_list_data_item import StatusPageListDataItem from .status_page_list_data_item_type import StatusPageListDataItemType @@ -3265,6 +3359,23 @@ UpdateAlertGroupDataAttributesTargetsItemTargetType, ) from .update_alert_group_data_type import UpdateAlertGroupDataType +from .update_alert_retrigger_rule import UpdateAlertRetriggerRule +from .update_alert_retrigger_rule_data import UpdateAlertRetriggerRuleData +from .update_alert_retrigger_rule_data_attributes import UpdateAlertRetriggerRuleDataAttributes +from .update_alert_retrigger_rule_data_attributes_conditions_item import ( + UpdateAlertRetriggerRuleDataAttributesConditionsItem, +) +from .update_alert_retrigger_rule_data_attributes_conditions_item_kind import ( + UpdateAlertRetriggerRuleDataAttributesConditionsItemKind, +) +from .update_alert_retrigger_rule_data_attributes_conditions_item_operator import ( + UpdateAlertRetriggerRuleDataAttributesConditionsItemOperator, +) +from .update_alert_retrigger_rule_data_attributes_match_mode import UpdateAlertRetriggerRuleDataAttributesMatchMode +from .update_alert_retrigger_rule_data_attributes_timeout_minutes import ( + UpdateAlertRetriggerRuleDataAttributesTimeoutMinutes, +) +from .update_alert_retrigger_rule_data_type import UpdateAlertRetriggerRuleDataType from .update_alert_route import UpdateAlertRoute from .update_alert_route_data import UpdateAlertRouteData from .update_alert_route_data_attributes import UpdateAlertRouteDataAttributes @@ -3608,6 +3719,12 @@ from .update_escalation_policy_level_data_attributes_notification_target_params_item_type_0_type import ( UpdateEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0Type, ) +from .update_escalation_policy_level_data_attributes_paging_strategy_configuration_repeats_mode import ( + UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRepeatsMode, +) +from .update_escalation_policy_level_data_attributes_paging_strategy_configuration_rotation_scope import ( + UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRotationScope, +) from .update_escalation_policy_level_data_attributes_paging_strategy_configuration_schedule_strategy import ( UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationScheduleStrategy, ) @@ -4436,6 +4553,18 @@ from .update_slack_channel_topic_task_params_channel import UpdateSlackChannelTopicTaskParamsChannel from .update_slack_channel_topic_task_params_task_type import UpdateSlackChannelTopicTaskParamsTaskType from .update_status_page import UpdateStatusPage +from .update_status_page_announcement import UpdateStatusPageAnnouncement +from .update_status_page_announcement_data import UpdateStatusPageAnnouncementData +from .update_status_page_announcement_data_attributes import UpdateStatusPageAnnouncementDataAttributes +from .update_status_page_announcement_data_type import UpdateStatusPageAnnouncementDataType +from .update_status_page_component import UpdateStatusPageComponent +from .update_status_page_component_data import UpdateStatusPageComponentData +from .update_status_page_component_data_attributes import UpdateStatusPageComponentDataAttributes +from .update_status_page_component_data_type import UpdateStatusPageComponentDataType +from .update_status_page_component_group import UpdateStatusPageComponentGroup +from .update_status_page_component_group_data import UpdateStatusPageComponentGroupData +from .update_status_page_component_group_data_attributes import UpdateStatusPageComponentGroupDataAttributes +from .update_status_page_component_group_data_type import UpdateStatusPageComponentGroupDataType from .update_status_page_data import UpdateStatusPageData from .update_status_page_data_attributes import UpdateStatusPageDataAttributes from .update_status_page_data_attributes_authentication_method import UpdateStatusPageDataAttributesAuthenticationMethod @@ -4590,6 +4719,15 @@ from .user_response import UserResponse from .user_response_data import UserResponseData from .user_response_data_type import UserResponseDataType +from .verified_domain import VerifiedDomain +from .verified_domain_list import VerifiedDomainList +from .verified_domain_list_data_item import VerifiedDomainListDataItem +from .verified_domain_list_data_item_type import VerifiedDomainListDataItemType +from .verified_domain_response import VerifiedDomainResponse +from .verified_domain_response_data import VerifiedDomainResponseData +from .verified_domain_response_data_type import VerifiedDomainResponseDataType +from .verified_domain_source import VerifiedDomainSource +from .verified_domain_verification_status import VerifiedDomainVerificationStatus from .verify_phone_number_request import VerifyPhoneNumberRequest from .webhooks_delivery import WebhooksDelivery from .webhooks_delivery_list import WebhooksDeliveryList @@ -4598,6 +4736,7 @@ from .webhooks_delivery_response import WebhooksDeliveryResponse from .webhooks_delivery_response_data import WebhooksDeliveryResponseData from .webhooks_delivery_response_data_type import WebhooksDeliveryResponseDataType +from .webhooks_delivery_status import WebhooksDeliveryStatus from .webhooks_endpoint import WebhooksEndpoint from .webhooks_endpoint_custom_headers_item import WebhooksEndpointCustomHeadersItem from .webhooks_endpoint_event_types_item import WebhooksEndpointEventTypesItem @@ -4794,6 +4933,17 @@ "AlertResponse", "AlertResponseData", "AlertResponseDataType", + "AlertRetriggerRule", + "AlertRetriggerRuleConditionsItem", + "AlertRetriggerRuleConditionsItemKind", + "AlertRetriggerRuleConditionsItemOperator", + "AlertRetriggerRuleList", + "AlertRetriggerRuleListDataItem", + "AlertRetriggerRuleListDataItemType", + "AlertRetriggerRuleMatchMode", + "AlertRetriggerRuleResponse", + "AlertRetriggerRuleResponseData", + "AlertRetriggerRuleResponseDataType", "AlertRoute", "AlertRouteList", "AlertRouteListDataItem", @@ -4916,6 +5066,8 @@ "AttachDatadogDashboardsTaskParamsDashboardsItem", "AttachDatadogDashboardsTaskParamsPostToSlackChannelsItem", "AttachDatadogDashboardsTaskParamsTaskType", + "AttachRetrospectivePdfToFreshserviceTicketTaskParams", + "AttachRetrospectivePdfToFreshserviceTicketTaskParamsTaskType", "AttachRetrospectivePdfToJiraIssueTaskParams", "AttachRetrospectivePdfToJiraIssueTaskParamsIntegration", "AttachRetrospectivePdfToJiraIssueTaskParamsTaskType", @@ -4941,13 +5093,11 @@ "AutoAssignRoleOpsgenieTaskParamsTaskType", "AutoAssignRolePagerdutyTaskParamsType0Schedule", "AutoAssignRolePagerdutyTaskParamsType1EscalationPolicy", - "AutoAssignRoleRootlyTaskParams", - "AutoAssignRoleRootlyTaskParamsEscalationPolicyTarget", - "AutoAssignRoleRootlyTaskParamsGroupTarget", - "AutoAssignRoleRootlyTaskParamsScheduleTarget", - "AutoAssignRoleRootlyTaskParamsServiceTarget", - "AutoAssignRoleRootlyTaskParamsTaskType", - "AutoAssignRoleRootlyTaskParamsUserTarget", + "AutoAssignRoleRootlyTaskParamsType0EscalationPolicyTarget", + "AutoAssignRoleRootlyTaskParamsType1ServiceTarget", + "AutoAssignRoleRootlyTaskParamsType2UserTarget", + "AutoAssignRoleRootlyTaskParamsType3GroupTarget", + "AutoAssignRoleRootlyTaskParamsType4ScheduleTarget", "AutoAssignRoleVictorOpsTaskParams", "AutoAssignRoleVictorOpsTaskParamsTaskType", "AutoAssignRoleVictorOpsTaskParamsTeam", @@ -5171,6 +5321,7 @@ "CreateAsanaTaskTaskParamsTaskType", "CreateAsanaTaskTaskParamsWorkspace", "CreateClickupTaskTaskParams", + "CreateClickupTaskTaskParamsList", "CreateClickupTaskTaskParamsPriority", "CreateClickupTaskTaskParamsTaskType", "CreateCodaPageTaskParams", @@ -5382,6 +5533,7 @@ "CustomFieldOptionResponseData", "CustomFieldOptionResponseDataType", "CustomFieldRequiredType0Item", + "CustomFieldResourceType", "CustomFieldResponse", "CustomFieldResponseData", "CustomFieldResponseDataType", @@ -5474,6 +5626,8 @@ "EscalationPolicyLevelNotificationTargetParamsItemType0", "EscalationPolicyLevelNotificationTargetParamsItemType0TeamMembers", "EscalationPolicyLevelNotificationTargetParamsItemType0Type", + "EscalationPolicyLevelPagingStrategyConfigurationRepeatsMode", + "EscalationPolicyLevelPagingStrategyConfigurationRotationScope", "EscalationPolicyLevelPagingStrategyConfigurationScheduleStrategy", "EscalationPolicyLevelPagingStrategyConfigurationStrategy", "EscalationPolicyLevelResponse", @@ -5603,6 +5757,7 @@ "FormFieldPositionResponse", "FormFieldPositionResponseData", "FormFieldPositionResponseDataType", + "FormFieldResourceType", "FormFieldResponse", "FormFieldResponseData", "FormFieldResponseDataType", @@ -5817,6 +5972,8 @@ "IncidentStatusPageEventResponseData", "IncidentStatusPageEventResponseDataType", "IncidentStatusPageEventStatus", + "IncidentStatusPageEventStatusPageComponentsItem", + "IncidentStatusPageEventStatusPageComponentsItemStatus", "IncidentSubStatus", "IncidentSubStatusList", "IncidentSubStatusListDataItem", @@ -6030,6 +6187,15 @@ "NewAlertGroupDataAttributesTargetsItem", "NewAlertGroupDataAttributesTargetsItemTargetType", "NewAlertGroupDataType", + "NewAlertRetriggerRule", + "NewAlertRetriggerRuleData", + "NewAlertRetriggerRuleDataAttributes", + "NewAlertRetriggerRuleDataAttributesConditionsItem", + "NewAlertRetriggerRuleDataAttributesConditionsItemKind", + "NewAlertRetriggerRuleDataAttributesConditionsItemOperator", + "NewAlertRetriggerRuleDataAttributesMatchMode", + "NewAlertRetriggerRuleDataAttributesTimeoutMinutes", + "NewAlertRetriggerRuleDataType", "NewAlertRoute", "NewAlertRouteData", "NewAlertRouteDataAttributes", @@ -6228,6 +6394,8 @@ "NewEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0", "NewEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0TeamMembers", "NewEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0Type", + "NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRepeatsMode", + "NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRotationScope", "NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationScheduleStrategy", "NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationStrategy", "NewEscalationPolicyLevelDataType", @@ -6390,6 +6558,8 @@ "NewIncidentStatusPageEventData", "NewIncidentStatusPageEventDataAttributes", "NewIncidentStatusPageEventDataAttributesStatus", + "NewIncidentStatusPageEventDataAttributesStatusPageComponentsType0Item", + "NewIncidentStatusPageEventDataAttributesStatusPageComponentsType0ItemStatus", "NewIncidentStatusPageEventDataType", "NewIncidentSubStatus", "NewIncidentSubStatusData", @@ -6605,6 +6775,19 @@ "NewSlaDataAttributesNotificationConfigurationsItemOffsetType", "NewSlaDataType", "NewStatusPage", + "NewStatusPageAnnouncement", + "NewStatusPageAnnouncementData", + "NewStatusPageAnnouncementDataAttributes", + "NewStatusPageAnnouncementDataType", + "NewStatusPageComponent", + "NewStatusPageComponentData", + "NewStatusPageComponentDataAttributes", + "NewStatusPageComponentDataAttributesSourceType", + "NewStatusPageComponentDataType", + "NewStatusPageComponentGroup", + "NewStatusPageComponentGroupData", + "NewStatusPageComponentGroupDataAttributes", + "NewStatusPageComponentGroupDataType", "NewStatusPageData", "NewStatusPageDataAttributes", "NewStatusPageDataAttributesAuthenticationMethod", @@ -6646,6 +6829,10 @@ "NewUserPhoneNumberData", "NewUserPhoneNumberDataAttributes", "NewUserPhoneNumberDataType", + "NewVerifiedDomain", + "NewVerifiedDomainData", + "NewVerifiedDomainDataAttributes", + "NewVerifiedDomainDataType", "NewWebhooksEndpoint", "NewWebhooksEndpointData", "NewWebhooksEndpointDataAttributes", @@ -7177,8 +7364,30 @@ "StatusListDataItem", "StatusListDataItemType", "StatusPage", + "StatusPageAnnouncement", + "StatusPageAnnouncementList", + "StatusPageAnnouncementListDataItem", + "StatusPageAnnouncementListDataItemType", + "StatusPageAnnouncementResponse", + "StatusPageAnnouncementResponseData", + "StatusPageAnnouncementResponseDataType", "StatusPageAuthenticationMethod", "StatusPageCnameRecordsType0", + "StatusPageComponent", + "StatusPageComponentGroup", + "StatusPageComponentGroupList", + "StatusPageComponentGroupListDataItem", + "StatusPageComponentGroupListDataItemType", + "StatusPageComponentGroupResponse", + "StatusPageComponentGroupResponseData", + "StatusPageComponentGroupResponseDataType", + "StatusPageComponentList", + "StatusPageComponentListDataItem", + "StatusPageComponentListDataItemType", + "StatusPageComponentResponse", + "StatusPageComponentResponseData", + "StatusPageComponentResponseDataType", + "StatusPageComponentStatus", "StatusPageList", "StatusPageListDataItem", "StatusPageListDataItemType", @@ -7275,6 +7484,15 @@ "UpdateAlertGroupDataAttributesTargetsItem", "UpdateAlertGroupDataAttributesTargetsItemTargetType", "UpdateAlertGroupDataType", + "UpdateAlertRetriggerRule", + "UpdateAlertRetriggerRuleData", + "UpdateAlertRetriggerRuleDataAttributes", + "UpdateAlertRetriggerRuleDataAttributesConditionsItem", + "UpdateAlertRetriggerRuleDataAttributesConditionsItemKind", + "UpdateAlertRetriggerRuleDataAttributesConditionsItemOperator", + "UpdateAlertRetriggerRuleDataAttributesMatchMode", + "UpdateAlertRetriggerRuleDataAttributesTimeoutMinutes", + "UpdateAlertRetriggerRuleDataType", "UpdateAlertRoute", "UpdateAlertRouteData", "UpdateAlertRouteDataAttributes", @@ -7498,6 +7716,8 @@ "UpdateEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0", "UpdateEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0TeamMembers", "UpdateEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0Type", + "UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRepeatsMode", + "UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRotationScope", "UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationScheduleStrategy", "UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationStrategy", "UpdateEscalationPolicyLevelDataType", @@ -8002,6 +8222,18 @@ "UpdateSlaDataAttributesNotificationConfigurationsItemOffsetType", "UpdateSlaDataType", "UpdateStatusPage", + "UpdateStatusPageAnnouncement", + "UpdateStatusPageAnnouncementData", + "UpdateStatusPageAnnouncementDataAttributes", + "UpdateStatusPageAnnouncementDataType", + "UpdateStatusPageComponent", + "UpdateStatusPageComponentData", + "UpdateStatusPageComponentDataAttributes", + "UpdateStatusPageComponentDataType", + "UpdateStatusPageComponentGroup", + "UpdateStatusPageComponentGroupData", + "UpdateStatusPageComponentGroupDataAttributes", + "UpdateStatusPageComponentGroupDataType", "UpdateStatusPageData", "UpdateStatusPageDataAttributes", "UpdateStatusPageDataAttributesAuthenticationMethod", @@ -8130,6 +8362,15 @@ "UserResponse", "UserResponseData", "UserResponseDataType", + "VerifiedDomain", + "VerifiedDomainList", + "VerifiedDomainListDataItem", + "VerifiedDomainListDataItemType", + "VerifiedDomainResponse", + "VerifiedDomainResponseData", + "VerifiedDomainResponseDataType", + "VerifiedDomainSource", + "VerifiedDomainVerificationStatus", "VerifyPhoneNumberRequest", "WebhooksDelivery", "WebhooksDeliveryList", @@ -8138,6 +8379,7 @@ "WebhooksDeliveryResponse", "WebhooksDeliveryResponseData", "WebhooksDeliveryResponseDataType", + "WebhooksDeliveryStatus", "WebhooksEndpoint", "WebhooksEndpointCustomHeadersItem", "WebhooksEndpointEventTypesItem", diff --git a/rootly_sdk/models/action_item_trigger_params.py b/rootly_sdk/models/action_item_trigger_params.py index 21a6b5c3..878b8f0a 100644 --- a/rootly_sdk/models/action_item_trigger_params.py +++ b/rootly_sdk/models/action_item_trigger_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -140,249 +138,256 @@ class ActionItemTriggerParams: """ Attributes: trigger_type (ActionItemTriggerParamsTriggerType): - triggers (list[str] | Unset): - incident_visibilities (list[bool] | Unset): - incident_kinds (list[ActionItemTriggerParamsIncidentKindsItem] | Unset): - incident_statuses (list[ActionItemTriggerParamsIncidentStatusesItem] | Unset): - incident_inactivity_duration (None | str | Unset): ex. 10 min, 1h, 3 days, 2 weeks - incident_condition (ActionItemTriggerParamsIncidentCondition | Unset): Default: 'ALL'. - incident_condition_visibility (ActionItemTriggerParamsIncidentConditionVisibility | Unset): Default: 'ANY'. - incident_condition_kind (ActionItemTriggerParamsIncidentConditionKind | Unset): Default: 'IS'. - incident_condition_status (ActionItemTriggerParamsIncidentConditionStatus | Unset): Default: 'ANY'. - incident_condition_sub_status (ActionItemTriggerParamsIncidentConditionSubStatus | Unset): Default: 'ANY'. - incident_condition_environment (ActionItemTriggerParamsIncidentConditionEnvironment | Unset): Default: 'ANY'. - incident_condition_severity (ActionItemTriggerParamsIncidentConditionSeverity | Unset): Default: 'ANY'. - incident_condition_incident_type (ActionItemTriggerParamsIncidentConditionIncidentType | Unset): Default: + triggers (Union[Unset, list[str]]): + incident_visibilities (Union[Unset, list[bool]]): + incident_kinds (Union[Unset, list[ActionItemTriggerParamsIncidentKindsItem]]): + incident_statuses (Union[Unset, list[ActionItemTriggerParamsIncidentStatusesItem]]): + incident_inactivity_duration (Union[None, Unset, str]): ex. 10 min, 1h, 3 days, 2 weeks + incident_condition (Union[Unset, ActionItemTriggerParamsIncidentCondition]): Default: 'ALL'. + incident_condition_visibility (Union[Unset, ActionItemTriggerParamsIncidentConditionVisibility]): Default: 'ANY'. - incident_condition_incident_roles (ActionItemTriggerParamsIncidentConditionIncidentRoles | Unset): Default: + incident_condition_kind (Union[Unset, ActionItemTriggerParamsIncidentConditionKind]): Default: 'IS'. + incident_condition_status (Union[Unset, ActionItemTriggerParamsIncidentConditionStatus]): Default: 'ANY'. + incident_condition_sub_status (Union[Unset, ActionItemTriggerParamsIncidentConditionSubStatus]): Default: 'ANY'. - incident_condition_service (ActionItemTriggerParamsIncidentConditionService | Unset): Default: 'ANY'. - incident_condition_functionality (ActionItemTriggerParamsIncidentConditionFunctionality | Unset): Default: + incident_condition_environment (Union[Unset, ActionItemTriggerParamsIncidentConditionEnvironment]): Default: 'ANY'. - incident_condition_group (ActionItemTriggerParamsIncidentConditionGroup | Unset): Default: 'ANY'. - incident_condition_label (ActionItemTriggerParamsIncidentConditionLabel | Unset): Default: 'ANY'. - incident_condition_label_use_regexp (bool | Unset): Default: False. - incident_labels (list[str] | Unset): - incident_condition_summary (ActionItemTriggerParamsIncidentConditionSummary | Unset): - incident_condition_started_at (ActionItemTriggerParamsIncidentConditionStartedAt | Unset): - incident_condition_detected_at (ActionItemTriggerParamsIncidentConditionDetectedAt | Unset): - incident_condition_acknowledged_at (ActionItemTriggerParamsIncidentConditionAcknowledgedAt | Unset): - incident_condition_mitigated_at (ActionItemTriggerParamsIncidentConditionMitigatedAt | Unset): - incident_condition_resolved_at (ActionItemTriggerParamsIncidentConditionResolvedAt | Unset): - incident_conditional_inactivity (ActionItemTriggerParamsIncidentConditionalInactivity | Unset): - incident_action_item_condition (ActionItemTriggerParamsIncidentActionItemCondition | Unset): - incident_action_item_condition_kind (ActionItemTriggerParamsIncidentActionItemConditionKind | Unset): Default: + incident_condition_severity (Union[Unset, ActionItemTriggerParamsIncidentConditionSeverity]): Default: 'ANY'. + incident_condition_incident_type (Union[Unset, ActionItemTriggerParamsIncidentConditionIncidentType]): Default: 'ANY'. - incident_action_item_kinds (list[ActionItemTriggerParamsIncidentActionItemKindsItem] | Unset): - incident_action_item_condition_status (ActionItemTriggerParamsIncidentActionItemConditionStatus | Unset): + incident_condition_incident_roles (Union[Unset, ActionItemTriggerParamsIncidentConditionIncidentRoles]): + Default: 'ANY'. + incident_condition_service (Union[Unset, ActionItemTriggerParamsIncidentConditionService]): Default: 'ANY'. + incident_condition_functionality (Union[Unset, ActionItemTriggerParamsIncidentConditionFunctionality]): + Default: 'ANY'. + incident_condition_group (Union[Unset, ActionItemTriggerParamsIncidentConditionGroup]): Default: 'ANY'. + incident_condition_label (Union[Unset, ActionItemTriggerParamsIncidentConditionLabel]): Default: 'ANY'. + incident_condition_label_use_regexp (Union[Unset, bool]): Default: False. + incident_labels (Union[Unset, list[str]]): + incident_condition_summary (Union[Unset, ActionItemTriggerParamsIncidentConditionSummary]): + incident_condition_started_at (Union[Unset, ActionItemTriggerParamsIncidentConditionStartedAt]): + incident_condition_detected_at (Union[Unset, ActionItemTriggerParamsIncidentConditionDetectedAt]): + incident_condition_acknowledged_at (Union[Unset, ActionItemTriggerParamsIncidentConditionAcknowledgedAt]): + incident_condition_mitigated_at (Union[Unset, ActionItemTriggerParamsIncidentConditionMitigatedAt]): + incident_condition_resolved_at (Union[Unset, ActionItemTriggerParamsIncidentConditionResolvedAt]): + incident_conditional_inactivity (Union[Unset, ActionItemTriggerParamsIncidentConditionalInactivity]): + incident_action_item_condition (Union[Unset, ActionItemTriggerParamsIncidentActionItemCondition]): + incident_action_item_condition_kind (Union[Unset, ActionItemTriggerParamsIncidentActionItemConditionKind]): Default: 'ANY'. - incident_action_item_statuses (list[ActionItemTriggerParamsIncidentActionItemStatusesItem] | Unset): - incident_action_item_condition_priority (ActionItemTriggerParamsIncidentActionItemConditionPriority | Unset): + incident_action_item_kinds (Union[Unset, list[ActionItemTriggerParamsIncidentActionItemKindsItem]]): + incident_action_item_condition_status (Union[Unset, ActionItemTriggerParamsIncidentActionItemConditionStatus]): Default: 'ANY'. - incident_action_item_priorities (list[ActionItemTriggerParamsIncidentActionItemPrioritiesItem] | Unset): - incident_action_item_condition_group (ActionItemTriggerParamsIncidentActionItemConditionGroup | Unset): + incident_action_item_statuses (Union[Unset, list[ActionItemTriggerParamsIncidentActionItemStatusesItem]]): + incident_action_item_condition_priority (Union[Unset, + ActionItemTriggerParamsIncidentActionItemConditionPriority]): Default: 'ANY'. + incident_action_item_priorities (Union[Unset, list[ActionItemTriggerParamsIncidentActionItemPrioritiesItem]]): + incident_action_item_condition_group (Union[Unset, ActionItemTriggerParamsIncidentActionItemConditionGroup]): Default: 'ANY'. - incident_action_item_group_ids (list[str] | Unset): + incident_action_item_group_ids (Union[Unset, list[str]]): """ trigger_type: ActionItemTriggerParamsTriggerType - triggers: list[str] | Unset = UNSET - incident_visibilities: list[bool] | Unset = UNSET - incident_kinds: list[ActionItemTriggerParamsIncidentKindsItem] | Unset = UNSET - incident_statuses: list[ActionItemTriggerParamsIncidentStatusesItem] | Unset = UNSET - incident_inactivity_duration: None | str | Unset = UNSET - incident_condition: ActionItemTriggerParamsIncidentCondition | Unset = "ALL" - incident_condition_visibility: ActionItemTriggerParamsIncidentConditionVisibility | Unset = "ANY" - incident_condition_kind: ActionItemTriggerParamsIncidentConditionKind | Unset = "IS" - incident_condition_status: ActionItemTriggerParamsIncidentConditionStatus | Unset = "ANY" - incident_condition_sub_status: ActionItemTriggerParamsIncidentConditionSubStatus | Unset = "ANY" - incident_condition_environment: ActionItemTriggerParamsIncidentConditionEnvironment | Unset = "ANY" - incident_condition_severity: ActionItemTriggerParamsIncidentConditionSeverity | Unset = "ANY" - incident_condition_incident_type: ActionItemTriggerParamsIncidentConditionIncidentType | Unset = "ANY" - incident_condition_incident_roles: ActionItemTriggerParamsIncidentConditionIncidentRoles | Unset = "ANY" - incident_condition_service: ActionItemTriggerParamsIncidentConditionService | Unset = "ANY" - incident_condition_functionality: ActionItemTriggerParamsIncidentConditionFunctionality | Unset = "ANY" - incident_condition_group: ActionItemTriggerParamsIncidentConditionGroup | Unset = "ANY" - incident_condition_label: ActionItemTriggerParamsIncidentConditionLabel | Unset = "ANY" - incident_condition_label_use_regexp: bool | Unset = False - incident_labels: list[str] | Unset = UNSET - incident_condition_summary: ActionItemTriggerParamsIncidentConditionSummary | Unset = UNSET - incident_condition_started_at: ActionItemTriggerParamsIncidentConditionStartedAt | Unset = UNSET - incident_condition_detected_at: ActionItemTriggerParamsIncidentConditionDetectedAt | Unset = UNSET - incident_condition_acknowledged_at: ActionItemTriggerParamsIncidentConditionAcknowledgedAt | Unset = UNSET - incident_condition_mitigated_at: ActionItemTriggerParamsIncidentConditionMitigatedAt | Unset = UNSET - incident_condition_resolved_at: ActionItemTriggerParamsIncidentConditionResolvedAt | Unset = UNSET - incident_conditional_inactivity: ActionItemTriggerParamsIncidentConditionalInactivity | Unset = UNSET - incident_action_item_condition: ActionItemTriggerParamsIncidentActionItemCondition | Unset = UNSET - incident_action_item_condition_kind: ActionItemTriggerParamsIncidentActionItemConditionKind | Unset = "ANY" - incident_action_item_kinds: list[ActionItemTriggerParamsIncidentActionItemKindsItem] | Unset = UNSET - incident_action_item_condition_status: ActionItemTriggerParamsIncidentActionItemConditionStatus | Unset = "ANY" - incident_action_item_statuses: list[ActionItemTriggerParamsIncidentActionItemStatusesItem] | Unset = UNSET - incident_action_item_condition_priority: ActionItemTriggerParamsIncidentActionItemConditionPriority | Unset = "ANY" - incident_action_item_priorities: list[ActionItemTriggerParamsIncidentActionItemPrioritiesItem] | Unset = UNSET - incident_action_item_condition_group: ActionItemTriggerParamsIncidentActionItemConditionGroup | Unset = "ANY" - incident_action_item_group_ids: list[str] | Unset = UNSET + triggers: Union[Unset, list[str]] = UNSET + incident_visibilities: Union[Unset, list[bool]] = UNSET + incident_kinds: Union[Unset, list[ActionItemTriggerParamsIncidentKindsItem]] = UNSET + incident_statuses: Union[Unset, list[ActionItemTriggerParamsIncidentStatusesItem]] = UNSET + incident_inactivity_duration: Union[None, Unset, str] = UNSET + incident_condition: Union[Unset, ActionItemTriggerParamsIncidentCondition] = "ALL" + incident_condition_visibility: Union[Unset, ActionItemTriggerParamsIncidentConditionVisibility] = "ANY" + incident_condition_kind: Union[Unset, ActionItemTriggerParamsIncidentConditionKind] = "IS" + incident_condition_status: Union[Unset, ActionItemTriggerParamsIncidentConditionStatus] = "ANY" + incident_condition_sub_status: Union[Unset, ActionItemTriggerParamsIncidentConditionSubStatus] = "ANY" + incident_condition_environment: Union[Unset, ActionItemTriggerParamsIncidentConditionEnvironment] = "ANY" + incident_condition_severity: Union[Unset, ActionItemTriggerParamsIncidentConditionSeverity] = "ANY" + incident_condition_incident_type: Union[Unset, ActionItemTriggerParamsIncidentConditionIncidentType] = "ANY" + incident_condition_incident_roles: Union[Unset, ActionItemTriggerParamsIncidentConditionIncidentRoles] = "ANY" + incident_condition_service: Union[Unset, ActionItemTriggerParamsIncidentConditionService] = "ANY" + incident_condition_functionality: Union[Unset, ActionItemTriggerParamsIncidentConditionFunctionality] = "ANY" + incident_condition_group: Union[Unset, ActionItemTriggerParamsIncidentConditionGroup] = "ANY" + incident_condition_label: Union[Unset, ActionItemTriggerParamsIncidentConditionLabel] = "ANY" + incident_condition_label_use_regexp: Union[Unset, bool] = False + incident_labels: Union[Unset, list[str]] = UNSET + incident_condition_summary: Union[Unset, ActionItemTriggerParamsIncidentConditionSummary] = UNSET + incident_condition_started_at: Union[Unset, ActionItemTriggerParamsIncidentConditionStartedAt] = UNSET + incident_condition_detected_at: Union[Unset, ActionItemTriggerParamsIncidentConditionDetectedAt] = UNSET + incident_condition_acknowledged_at: Union[Unset, ActionItemTriggerParamsIncidentConditionAcknowledgedAt] = UNSET + incident_condition_mitigated_at: Union[Unset, ActionItemTriggerParamsIncidentConditionMitigatedAt] = UNSET + incident_condition_resolved_at: Union[Unset, ActionItemTriggerParamsIncidentConditionResolvedAt] = UNSET + incident_conditional_inactivity: Union[Unset, ActionItemTriggerParamsIncidentConditionalInactivity] = UNSET + incident_action_item_condition: Union[Unset, ActionItemTriggerParamsIncidentActionItemCondition] = UNSET + incident_action_item_condition_kind: Union[Unset, ActionItemTriggerParamsIncidentActionItemConditionKind] = "ANY" + incident_action_item_kinds: Union[Unset, list[ActionItemTriggerParamsIncidentActionItemKindsItem]] = UNSET + incident_action_item_condition_status: Union[Unset, ActionItemTriggerParamsIncidentActionItemConditionStatus] = ( + "ANY" + ) + incident_action_item_statuses: Union[Unset, list[ActionItemTriggerParamsIncidentActionItemStatusesItem]] = UNSET + incident_action_item_condition_priority: Union[ + Unset, ActionItemTriggerParamsIncidentActionItemConditionPriority + ] = "ANY" + incident_action_item_priorities: Union[Unset, list[ActionItemTriggerParamsIncidentActionItemPrioritiesItem]] = UNSET + incident_action_item_condition_group: Union[Unset, ActionItemTriggerParamsIncidentActionItemConditionGroup] = "ANY" + incident_action_item_group_ids: Union[Unset, list[str]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: trigger_type: str = self.trigger_type - triggers: list[str] | Unset = UNSET + triggers: Union[Unset, list[str]] = UNSET if not isinstance(self.triggers, Unset): triggers = self.triggers - incident_visibilities: list[bool] | Unset = UNSET + incident_visibilities: Union[Unset, list[bool]] = UNSET if not isinstance(self.incident_visibilities, Unset): incident_visibilities = self.incident_visibilities - incident_kinds: list[str] | Unset = UNSET + incident_kinds: Union[Unset, list[str]] = UNSET if not isinstance(self.incident_kinds, Unset): incident_kinds = [] for incident_kinds_item_data in self.incident_kinds: incident_kinds_item: str = incident_kinds_item_data incident_kinds.append(incident_kinds_item) - incident_statuses: list[str] | Unset = UNSET + incident_statuses: Union[Unset, list[str]] = UNSET if not isinstance(self.incident_statuses, Unset): incident_statuses = [] for incident_statuses_item_data in self.incident_statuses: incident_statuses_item: str = incident_statuses_item_data incident_statuses.append(incident_statuses_item) - incident_inactivity_duration: None | str | Unset + incident_inactivity_duration: Union[None, Unset, str] if isinstance(self.incident_inactivity_duration, Unset): incident_inactivity_duration = UNSET else: incident_inactivity_duration = self.incident_inactivity_duration - incident_condition: str | Unset = UNSET + incident_condition: Union[Unset, str] = UNSET if not isinstance(self.incident_condition, Unset): incident_condition = self.incident_condition - incident_condition_visibility: str | Unset = UNSET + incident_condition_visibility: Union[Unset, str] = UNSET if not isinstance(self.incident_condition_visibility, Unset): incident_condition_visibility = self.incident_condition_visibility - incident_condition_kind: str | Unset = UNSET + incident_condition_kind: Union[Unset, str] = UNSET if not isinstance(self.incident_condition_kind, Unset): incident_condition_kind = self.incident_condition_kind - incident_condition_status: str | Unset = UNSET + incident_condition_status: Union[Unset, str] = UNSET if not isinstance(self.incident_condition_status, Unset): incident_condition_status = self.incident_condition_status - incident_condition_sub_status: str | Unset = UNSET + incident_condition_sub_status: Union[Unset, str] = UNSET if not isinstance(self.incident_condition_sub_status, Unset): incident_condition_sub_status = self.incident_condition_sub_status - incident_condition_environment: str | Unset = UNSET + incident_condition_environment: Union[Unset, str] = UNSET if not isinstance(self.incident_condition_environment, Unset): incident_condition_environment = self.incident_condition_environment - incident_condition_severity: str | Unset = UNSET + incident_condition_severity: Union[Unset, str] = UNSET if not isinstance(self.incident_condition_severity, Unset): incident_condition_severity = self.incident_condition_severity - incident_condition_incident_type: str | Unset = UNSET + incident_condition_incident_type: Union[Unset, str] = UNSET if not isinstance(self.incident_condition_incident_type, Unset): incident_condition_incident_type = self.incident_condition_incident_type - incident_condition_incident_roles: str | Unset = UNSET + incident_condition_incident_roles: Union[Unset, str] = UNSET if not isinstance(self.incident_condition_incident_roles, Unset): incident_condition_incident_roles = self.incident_condition_incident_roles - incident_condition_service: str | Unset = UNSET + incident_condition_service: Union[Unset, str] = UNSET if not isinstance(self.incident_condition_service, Unset): incident_condition_service = self.incident_condition_service - incident_condition_functionality: str | Unset = UNSET + incident_condition_functionality: Union[Unset, str] = UNSET if not isinstance(self.incident_condition_functionality, Unset): incident_condition_functionality = self.incident_condition_functionality - incident_condition_group: str | Unset = UNSET + incident_condition_group: Union[Unset, str] = UNSET if not isinstance(self.incident_condition_group, Unset): incident_condition_group = self.incident_condition_group - incident_condition_label: str | Unset = UNSET + incident_condition_label: Union[Unset, str] = UNSET if not isinstance(self.incident_condition_label, Unset): incident_condition_label = self.incident_condition_label incident_condition_label_use_regexp = self.incident_condition_label_use_regexp - incident_labels: list[str] | Unset = UNSET + incident_labels: Union[Unset, list[str]] = UNSET if not isinstance(self.incident_labels, Unset): incident_labels = self.incident_labels - incident_condition_summary: str | Unset = UNSET + incident_condition_summary: Union[Unset, str] = UNSET if not isinstance(self.incident_condition_summary, Unset): incident_condition_summary = self.incident_condition_summary - incident_condition_started_at: str | Unset = UNSET + incident_condition_started_at: Union[Unset, str] = UNSET if not isinstance(self.incident_condition_started_at, Unset): incident_condition_started_at = self.incident_condition_started_at - incident_condition_detected_at: str | Unset = UNSET + incident_condition_detected_at: Union[Unset, str] = UNSET if not isinstance(self.incident_condition_detected_at, Unset): incident_condition_detected_at = self.incident_condition_detected_at - incident_condition_acknowledged_at: str | Unset = UNSET + incident_condition_acknowledged_at: Union[Unset, str] = UNSET if not isinstance(self.incident_condition_acknowledged_at, Unset): incident_condition_acknowledged_at = self.incident_condition_acknowledged_at - incident_condition_mitigated_at: str | Unset = UNSET + incident_condition_mitigated_at: Union[Unset, str] = UNSET if not isinstance(self.incident_condition_mitigated_at, Unset): incident_condition_mitigated_at = self.incident_condition_mitigated_at - incident_condition_resolved_at: str | Unset = UNSET + incident_condition_resolved_at: Union[Unset, str] = UNSET if not isinstance(self.incident_condition_resolved_at, Unset): incident_condition_resolved_at = self.incident_condition_resolved_at - incident_conditional_inactivity: str | Unset = UNSET + incident_conditional_inactivity: Union[Unset, str] = UNSET if not isinstance(self.incident_conditional_inactivity, Unset): incident_conditional_inactivity = self.incident_conditional_inactivity - incident_action_item_condition: str | Unset = UNSET + incident_action_item_condition: Union[Unset, str] = UNSET if not isinstance(self.incident_action_item_condition, Unset): incident_action_item_condition = self.incident_action_item_condition - incident_action_item_condition_kind: str | Unset = UNSET + incident_action_item_condition_kind: Union[Unset, str] = UNSET if not isinstance(self.incident_action_item_condition_kind, Unset): incident_action_item_condition_kind = self.incident_action_item_condition_kind - incident_action_item_kinds: list[str] | Unset = UNSET + incident_action_item_kinds: Union[Unset, list[str]] = UNSET if not isinstance(self.incident_action_item_kinds, Unset): incident_action_item_kinds = [] for incident_action_item_kinds_item_data in self.incident_action_item_kinds: incident_action_item_kinds_item: str = incident_action_item_kinds_item_data incident_action_item_kinds.append(incident_action_item_kinds_item) - incident_action_item_condition_status: str | Unset = UNSET + incident_action_item_condition_status: Union[Unset, str] = UNSET if not isinstance(self.incident_action_item_condition_status, Unset): incident_action_item_condition_status = self.incident_action_item_condition_status - incident_action_item_statuses: list[str] | Unset = UNSET + incident_action_item_statuses: Union[Unset, list[str]] = UNSET if not isinstance(self.incident_action_item_statuses, Unset): incident_action_item_statuses = [] for incident_action_item_statuses_item_data in self.incident_action_item_statuses: incident_action_item_statuses_item: str = incident_action_item_statuses_item_data incident_action_item_statuses.append(incident_action_item_statuses_item) - incident_action_item_condition_priority: str | Unset = UNSET + incident_action_item_condition_priority: Union[Unset, str] = UNSET if not isinstance(self.incident_action_item_condition_priority, Unset): incident_action_item_condition_priority = self.incident_action_item_condition_priority - incident_action_item_priorities: list[str] | Unset = UNSET + incident_action_item_priorities: Union[Unset, list[str]] = UNSET if not isinstance(self.incident_action_item_priorities, Unset): incident_action_item_priorities = [] for incident_action_item_priorities_item_data in self.incident_action_item_priorities: incident_action_item_priorities_item: str = incident_action_item_priorities_item_data incident_action_item_priorities.append(incident_action_item_priorities_item) - incident_action_item_condition_group: str | Unset = UNSET + incident_action_item_condition_group: Union[Unset, str] = UNSET if not isinstance(self.incident_action_item_condition_group, Unset): incident_action_item_condition_group = self.incident_action_item_condition_group - incident_action_item_group_ids: list[str] | Unset = UNSET + incident_action_item_group_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.incident_action_item_group_ids, Unset): incident_action_item_group_ids = self.incident_action_item_group_ids @@ -477,44 +482,40 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: incident_visibilities = cast(list[bool], d.pop("incident_visibilities", UNSET)) + incident_kinds = [] _incident_kinds = d.pop("incident_kinds", UNSET) - incident_kinds: list[ActionItemTriggerParamsIncidentKindsItem] | Unset = UNSET - if _incident_kinds is not UNSET: - incident_kinds = [] - for incident_kinds_item_data in _incident_kinds: - incident_kinds_item = check_action_item_trigger_params_incident_kinds_item(incident_kinds_item_data) + for incident_kinds_item_data in _incident_kinds or []: + incident_kinds_item = check_action_item_trigger_params_incident_kinds_item(incident_kinds_item_data) - incident_kinds.append(incident_kinds_item) + incident_kinds.append(incident_kinds_item) + incident_statuses = [] _incident_statuses = d.pop("incident_statuses", UNSET) - incident_statuses: list[ActionItemTriggerParamsIncidentStatusesItem] | Unset = UNSET - if _incident_statuses is not UNSET: - incident_statuses = [] - for incident_statuses_item_data in _incident_statuses: - incident_statuses_item = check_action_item_trigger_params_incident_statuses_item( - incident_statuses_item_data - ) + for incident_statuses_item_data in _incident_statuses or []: + incident_statuses_item = check_action_item_trigger_params_incident_statuses_item( + incident_statuses_item_data + ) - incident_statuses.append(incident_statuses_item) + incident_statuses.append(incident_statuses_item) - def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: + def _parse_incident_inactivity_duration(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) incident_inactivity_duration = _parse_incident_inactivity_duration(d.pop("incident_inactivity_duration", UNSET)) _incident_condition = d.pop("incident_condition", UNSET) - incident_condition: ActionItemTriggerParamsIncidentCondition | Unset + incident_condition: Union[Unset, ActionItemTriggerParamsIncidentCondition] if isinstance(_incident_condition, Unset): incident_condition = UNSET else: incident_condition = check_action_item_trigger_params_incident_condition(_incident_condition) _incident_condition_visibility = d.pop("incident_condition_visibility", UNSET) - incident_condition_visibility: ActionItemTriggerParamsIncidentConditionVisibility | Unset + incident_condition_visibility: Union[Unset, ActionItemTriggerParamsIncidentConditionVisibility] if isinstance(_incident_condition_visibility, Unset): incident_condition_visibility = UNSET else: @@ -523,14 +524,14 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_condition_kind = d.pop("incident_condition_kind", UNSET) - incident_condition_kind: ActionItemTriggerParamsIncidentConditionKind | Unset + incident_condition_kind: Union[Unset, ActionItemTriggerParamsIncidentConditionKind] if isinstance(_incident_condition_kind, Unset): incident_condition_kind = UNSET else: incident_condition_kind = check_action_item_trigger_params_incident_condition_kind(_incident_condition_kind) _incident_condition_status = d.pop("incident_condition_status", UNSET) - incident_condition_status: ActionItemTriggerParamsIncidentConditionStatus | Unset + incident_condition_status: Union[Unset, ActionItemTriggerParamsIncidentConditionStatus] if isinstance(_incident_condition_status, Unset): incident_condition_status = UNSET else: @@ -539,7 +540,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_condition_sub_status = d.pop("incident_condition_sub_status", UNSET) - incident_condition_sub_status: ActionItemTriggerParamsIncidentConditionSubStatus | Unset + incident_condition_sub_status: Union[Unset, ActionItemTriggerParamsIncidentConditionSubStatus] if isinstance(_incident_condition_sub_status, Unset): incident_condition_sub_status = UNSET else: @@ -548,7 +549,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_condition_environment = d.pop("incident_condition_environment", UNSET) - incident_condition_environment: ActionItemTriggerParamsIncidentConditionEnvironment | Unset + incident_condition_environment: Union[Unset, ActionItemTriggerParamsIncidentConditionEnvironment] if isinstance(_incident_condition_environment, Unset): incident_condition_environment = UNSET else: @@ -557,7 +558,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_condition_severity = d.pop("incident_condition_severity", UNSET) - incident_condition_severity: ActionItemTriggerParamsIncidentConditionSeverity | Unset + incident_condition_severity: Union[Unset, ActionItemTriggerParamsIncidentConditionSeverity] if isinstance(_incident_condition_severity, Unset): incident_condition_severity = UNSET else: @@ -566,7 +567,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_condition_incident_type = d.pop("incident_condition_incident_type", UNSET) - incident_condition_incident_type: ActionItemTriggerParamsIncidentConditionIncidentType | Unset + incident_condition_incident_type: Union[Unset, ActionItemTriggerParamsIncidentConditionIncidentType] if isinstance(_incident_condition_incident_type, Unset): incident_condition_incident_type = UNSET else: @@ -575,7 +576,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_condition_incident_roles = d.pop("incident_condition_incident_roles", UNSET) - incident_condition_incident_roles: ActionItemTriggerParamsIncidentConditionIncidentRoles | Unset + incident_condition_incident_roles: Union[Unset, ActionItemTriggerParamsIncidentConditionIncidentRoles] if isinstance(_incident_condition_incident_roles, Unset): incident_condition_incident_roles = UNSET else: @@ -584,7 +585,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_condition_service = d.pop("incident_condition_service", UNSET) - incident_condition_service: ActionItemTriggerParamsIncidentConditionService | Unset + incident_condition_service: Union[Unset, ActionItemTriggerParamsIncidentConditionService] if isinstance(_incident_condition_service, Unset): incident_condition_service = UNSET else: @@ -593,7 +594,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_condition_functionality = d.pop("incident_condition_functionality", UNSET) - incident_condition_functionality: ActionItemTriggerParamsIncidentConditionFunctionality | Unset + incident_condition_functionality: Union[Unset, ActionItemTriggerParamsIncidentConditionFunctionality] if isinstance(_incident_condition_functionality, Unset): incident_condition_functionality = UNSET else: @@ -602,7 +603,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_condition_group = d.pop("incident_condition_group", UNSET) - incident_condition_group: ActionItemTriggerParamsIncidentConditionGroup | Unset + incident_condition_group: Union[Unset, ActionItemTriggerParamsIncidentConditionGroup] if isinstance(_incident_condition_group, Unset): incident_condition_group = UNSET else: @@ -611,7 +612,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_condition_label = d.pop("incident_condition_label", UNSET) - incident_condition_label: ActionItemTriggerParamsIncidentConditionLabel | Unset + incident_condition_label: Union[Unset, ActionItemTriggerParamsIncidentConditionLabel] if isinstance(_incident_condition_label, Unset): incident_condition_label = UNSET else: @@ -624,7 +625,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: incident_labels = cast(list[str], d.pop("incident_labels", UNSET)) _incident_condition_summary = d.pop("incident_condition_summary", UNSET) - incident_condition_summary: ActionItemTriggerParamsIncidentConditionSummary | Unset + incident_condition_summary: Union[Unset, ActionItemTriggerParamsIncidentConditionSummary] if isinstance(_incident_condition_summary, Unset): incident_condition_summary = UNSET else: @@ -633,7 +634,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_condition_started_at = d.pop("incident_condition_started_at", UNSET) - incident_condition_started_at: ActionItemTriggerParamsIncidentConditionStartedAt | Unset + incident_condition_started_at: Union[Unset, ActionItemTriggerParamsIncidentConditionStartedAt] if isinstance(_incident_condition_started_at, Unset): incident_condition_started_at = UNSET else: @@ -642,7 +643,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_condition_detected_at = d.pop("incident_condition_detected_at", UNSET) - incident_condition_detected_at: ActionItemTriggerParamsIncidentConditionDetectedAt | Unset + incident_condition_detected_at: Union[Unset, ActionItemTriggerParamsIncidentConditionDetectedAt] if isinstance(_incident_condition_detected_at, Unset): incident_condition_detected_at = UNSET else: @@ -651,7 +652,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_condition_acknowledged_at = d.pop("incident_condition_acknowledged_at", UNSET) - incident_condition_acknowledged_at: ActionItemTriggerParamsIncidentConditionAcknowledgedAt | Unset + incident_condition_acknowledged_at: Union[Unset, ActionItemTriggerParamsIncidentConditionAcknowledgedAt] if isinstance(_incident_condition_acknowledged_at, Unset): incident_condition_acknowledged_at = UNSET else: @@ -660,7 +661,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_condition_mitigated_at = d.pop("incident_condition_mitigated_at", UNSET) - incident_condition_mitigated_at: ActionItemTriggerParamsIncidentConditionMitigatedAt | Unset + incident_condition_mitigated_at: Union[Unset, ActionItemTriggerParamsIncidentConditionMitigatedAt] if isinstance(_incident_condition_mitigated_at, Unset): incident_condition_mitigated_at = UNSET else: @@ -669,7 +670,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_condition_resolved_at = d.pop("incident_condition_resolved_at", UNSET) - incident_condition_resolved_at: ActionItemTriggerParamsIncidentConditionResolvedAt | Unset + incident_condition_resolved_at: Union[Unset, ActionItemTriggerParamsIncidentConditionResolvedAt] if isinstance(_incident_condition_resolved_at, Unset): incident_condition_resolved_at = UNSET else: @@ -678,7 +679,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_conditional_inactivity = d.pop("incident_conditional_inactivity", UNSET) - incident_conditional_inactivity: ActionItemTriggerParamsIncidentConditionalInactivity | Unset + incident_conditional_inactivity: Union[Unset, ActionItemTriggerParamsIncidentConditionalInactivity] if isinstance(_incident_conditional_inactivity, Unset): incident_conditional_inactivity = UNSET else: @@ -687,7 +688,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_action_item_condition = d.pop("incident_action_item_condition", UNSET) - incident_action_item_condition: ActionItemTriggerParamsIncidentActionItemCondition | Unset + incident_action_item_condition: Union[Unset, ActionItemTriggerParamsIncidentActionItemCondition] if isinstance(_incident_action_item_condition, Unset): incident_action_item_condition = UNSET else: @@ -696,7 +697,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_action_item_condition_kind = d.pop("incident_action_item_condition_kind", UNSET) - incident_action_item_condition_kind: ActionItemTriggerParamsIncidentActionItemConditionKind | Unset + incident_action_item_condition_kind: Union[Unset, ActionItemTriggerParamsIncidentActionItemConditionKind] if isinstance(_incident_action_item_condition_kind, Unset): incident_action_item_condition_kind = UNSET else: @@ -704,19 +705,17 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: _incident_action_item_condition_kind ) + incident_action_item_kinds = [] _incident_action_item_kinds = d.pop("incident_action_item_kinds", UNSET) - incident_action_item_kinds: list[ActionItemTriggerParamsIncidentActionItemKindsItem] | Unset = UNSET - if _incident_action_item_kinds is not UNSET: - incident_action_item_kinds = [] - for incident_action_item_kinds_item_data in _incident_action_item_kinds: - incident_action_item_kinds_item = check_action_item_trigger_params_incident_action_item_kinds_item( - incident_action_item_kinds_item_data - ) + for incident_action_item_kinds_item_data in _incident_action_item_kinds or []: + incident_action_item_kinds_item = check_action_item_trigger_params_incident_action_item_kinds_item( + incident_action_item_kinds_item_data + ) - incident_action_item_kinds.append(incident_action_item_kinds_item) + incident_action_item_kinds.append(incident_action_item_kinds_item) _incident_action_item_condition_status = d.pop("incident_action_item_condition_status", UNSET) - incident_action_item_condition_status: ActionItemTriggerParamsIncidentActionItemConditionStatus | Unset + incident_action_item_condition_status: Union[Unset, ActionItemTriggerParamsIncidentActionItemConditionStatus] if isinstance(_incident_action_item_condition_status, Unset): incident_action_item_condition_status = UNSET else: @@ -726,21 +725,19 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) ) + incident_action_item_statuses = [] _incident_action_item_statuses = d.pop("incident_action_item_statuses", UNSET) - incident_action_item_statuses: list[ActionItemTriggerParamsIncidentActionItemStatusesItem] | Unset = UNSET - if _incident_action_item_statuses is not UNSET: - incident_action_item_statuses = [] - for incident_action_item_statuses_item_data in _incident_action_item_statuses: - incident_action_item_statuses_item = ( - check_action_item_trigger_params_incident_action_item_statuses_item( - incident_action_item_statuses_item_data - ) - ) + for incident_action_item_statuses_item_data in _incident_action_item_statuses or []: + incident_action_item_statuses_item = check_action_item_trigger_params_incident_action_item_statuses_item( + incident_action_item_statuses_item_data + ) - incident_action_item_statuses.append(incident_action_item_statuses_item) + incident_action_item_statuses.append(incident_action_item_statuses_item) _incident_action_item_condition_priority = d.pop("incident_action_item_condition_priority", UNSET) - incident_action_item_condition_priority: ActionItemTriggerParamsIncidentActionItemConditionPriority | Unset + incident_action_item_condition_priority: Union[ + Unset, ActionItemTriggerParamsIncidentActionItemConditionPriority + ] if isinstance(_incident_action_item_condition_priority, Unset): incident_action_item_condition_priority = UNSET else: @@ -750,21 +747,19 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) ) + incident_action_item_priorities = [] _incident_action_item_priorities = d.pop("incident_action_item_priorities", UNSET) - incident_action_item_priorities: list[ActionItemTriggerParamsIncidentActionItemPrioritiesItem] | Unset = UNSET - if _incident_action_item_priorities is not UNSET: - incident_action_item_priorities = [] - for incident_action_item_priorities_item_data in _incident_action_item_priorities: - incident_action_item_priorities_item = ( - check_action_item_trigger_params_incident_action_item_priorities_item( - incident_action_item_priorities_item_data - ) + for incident_action_item_priorities_item_data in _incident_action_item_priorities or []: + incident_action_item_priorities_item = ( + check_action_item_trigger_params_incident_action_item_priorities_item( + incident_action_item_priorities_item_data ) + ) - incident_action_item_priorities.append(incident_action_item_priorities_item) + incident_action_item_priorities.append(incident_action_item_priorities_item) _incident_action_item_condition_group = d.pop("incident_action_item_condition_group", UNSET) - incident_action_item_condition_group: ActionItemTriggerParamsIncidentActionItemConditionGroup | Unset + incident_action_item_condition_group: Union[Unset, ActionItemTriggerParamsIncidentActionItemConditionGroup] if isinstance(_incident_action_item_condition_group, Unset): incident_action_item_condition_group = UNSET else: diff --git a/rootly_sdk/models/add_action_item_task_params.py b/rootly_sdk/models/add_action_item_task_params.py index 5d141312..fa8b7d4d 100644 --- a/rootly_sdk/models/add_action_item_task_params.py +++ b/rootly_sdk/models/add_action_item_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -41,55 +39,55 @@ class AddActionItemTaskParams: priority (AddActionItemTaskParamsPriority): The action item priority summary (str): The action item summary status (AddActionItemTaskParamsStatus): The action item status - task_type (AddActionItemTaskParamsTaskType | Unset): - attribute_to_query_by (AddActionItemTaskParamsAttributeToQueryBy | Unset): Attribute of the Incident to match - against - query_value (None | str | Unset): Value that attribute_to_query_by to uses to match against - incident_role_id (str | Unset): The role id this action item is associated with - assigned_to_user_id (str | Unset): [DEPRECATED] Use assigned_to_user attribute instead. The user id this action - item is assigned to - assigned_to_user (AddActionItemTaskParamsAssignedToUser | Unset): The user this action item is assigned to - kind (str | Unset): The action item kind - description (str | Unset): The action item description - post_to_incident_timeline (bool | Unset): - custom_fields_mapping (None | str | Unset): Custom field mappings. Can contain liquid markup and need to be + task_type (Union[Unset, AddActionItemTaskParamsTaskType]): + attribute_to_query_by (Union[Unset, AddActionItemTaskParamsAttributeToQueryBy]): Attribute of the Incident to + match against + query_value (Union[None, Unset, str]): Value that attribute_to_query_by to uses to match against + incident_role_id (Union[Unset, str]): The role id this action item is associated with + assigned_to_user_id (Union[Unset, str]): [DEPRECATED] Use assigned_to_user attribute instead. The user id this + action item is assigned to + assigned_to_user (Union[Unset, AddActionItemTaskParamsAssignedToUser]): The user this action item is assigned + to + kind (Union[Unset, str]): The action item kind + description (Union[Unset, str]): The action item description + post_to_incident_timeline (Union[Unset, bool]): + custom_fields_mapping (Union[None, Unset, str]): Custom field mappings. Can contain liquid markup and need to be valid JSON - post_to_slack_channels (list[AddActionItemTaskParamsPostToSlackChannelsItem] | Unset): + post_to_slack_channels (Union[Unset, list['AddActionItemTaskParamsPostToSlackChannelsItem']]): """ priority: AddActionItemTaskParamsPriority summary: str status: AddActionItemTaskParamsStatus - task_type: AddActionItemTaskParamsTaskType | Unset = UNSET - attribute_to_query_by: AddActionItemTaskParamsAttributeToQueryBy | Unset = UNSET - query_value: None | str | Unset = UNSET - incident_role_id: str | Unset = UNSET - assigned_to_user_id: str | Unset = UNSET - assigned_to_user: AddActionItemTaskParamsAssignedToUser | Unset = UNSET - kind: str | Unset = UNSET - description: str | Unset = UNSET - post_to_incident_timeline: bool | Unset = UNSET - custom_fields_mapping: None | str | Unset = UNSET - post_to_slack_channels: list[AddActionItemTaskParamsPostToSlackChannelsItem] | Unset = UNSET + task_type: Union[Unset, AddActionItemTaskParamsTaskType] = UNSET + attribute_to_query_by: Union[Unset, AddActionItemTaskParamsAttributeToQueryBy] = UNSET + query_value: Union[None, Unset, str] = UNSET + incident_role_id: Union[Unset, str] = UNSET + assigned_to_user_id: Union[Unset, str] = UNSET + assigned_to_user: Union[Unset, "AddActionItemTaskParamsAssignedToUser"] = UNSET + kind: Union[Unset, str] = UNSET + description: Union[Unset, str] = UNSET + post_to_incident_timeline: Union[Unset, bool] = UNSET + custom_fields_mapping: Union[None, Unset, str] = UNSET + post_to_slack_channels: Union[Unset, list["AddActionItemTaskParamsPostToSlackChannelsItem"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - priority: str = self.priority summary = self.summary status: str = self.status - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - attribute_to_query_by: str | Unset = UNSET + attribute_to_query_by: Union[Unset, str] = UNSET if not isinstance(self.attribute_to_query_by, Unset): attribute_to_query_by = self.attribute_to_query_by - query_value: None | str | Unset + query_value: Union[None, Unset, str] if isinstance(self.query_value, Unset): query_value = UNSET else: @@ -99,7 +97,7 @@ def to_dict(self) -> dict[str, Any]: assigned_to_user_id = self.assigned_to_user_id - assigned_to_user: dict[str, Any] | Unset = UNSET + assigned_to_user: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.assigned_to_user, Unset): assigned_to_user = self.assigned_to_user.to_dict() @@ -109,13 +107,13 @@ def to_dict(self) -> dict[str, Any]: post_to_incident_timeline = self.post_to_incident_timeline - custom_fields_mapping: None | str | Unset + custom_fields_mapping: Union[None, Unset, str] if isinstance(self.custom_fields_mapping, Unset): custom_fields_mapping = UNSET else: custom_fields_mapping = self.custom_fields_mapping - post_to_slack_channels: list[dict[str, Any]] | Unset = UNSET + post_to_slack_channels: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.post_to_slack_channels, Unset): post_to_slack_channels = [] for post_to_slack_channels_item_data in self.post_to_slack_channels: @@ -171,25 +169,25 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: status = check_add_action_item_task_params_status(d.pop("status")) _task_type = d.pop("task_type", UNSET) - task_type: AddActionItemTaskParamsTaskType | Unset + task_type: Union[Unset, AddActionItemTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: task_type = check_add_action_item_task_params_task_type(_task_type) _attribute_to_query_by = d.pop("attribute_to_query_by", UNSET) - attribute_to_query_by: AddActionItemTaskParamsAttributeToQueryBy | Unset + attribute_to_query_by: Union[Unset, AddActionItemTaskParamsAttributeToQueryBy] if isinstance(_attribute_to_query_by, Unset): attribute_to_query_by = UNSET else: attribute_to_query_by = check_add_action_item_task_params_attribute_to_query_by(_attribute_to_query_by) - def _parse_query_value(data: object) -> None | str | Unset: + def _parse_query_value(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) query_value = _parse_query_value(d.pop("query_value", UNSET)) @@ -198,7 +196,7 @@ def _parse_query_value(data: object) -> None | str | Unset: assigned_to_user_id = d.pop("assigned_to_user_id", UNSET) _assigned_to_user = d.pop("assigned_to_user", UNSET) - assigned_to_user: AddActionItemTaskParamsAssignedToUser | Unset + assigned_to_user: Union[Unset, AddActionItemTaskParamsAssignedToUser] if isinstance(_assigned_to_user, Unset): assigned_to_user = UNSET else: @@ -210,25 +208,23 @@ def _parse_query_value(data: object) -> None | str | Unset: post_to_incident_timeline = d.pop("post_to_incident_timeline", UNSET) - def _parse_custom_fields_mapping(data: object) -> None | str | Unset: + def _parse_custom_fields_mapping(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) custom_fields_mapping = _parse_custom_fields_mapping(d.pop("custom_fields_mapping", UNSET)) + post_to_slack_channels = [] _post_to_slack_channels = d.pop("post_to_slack_channels", UNSET) - post_to_slack_channels: list[AddActionItemTaskParamsPostToSlackChannelsItem] | Unset = UNSET - if _post_to_slack_channels is not UNSET: - post_to_slack_channels = [] - for post_to_slack_channels_item_data in _post_to_slack_channels: - post_to_slack_channels_item = AddActionItemTaskParamsPostToSlackChannelsItem.from_dict( - post_to_slack_channels_item_data - ) + for post_to_slack_channels_item_data in _post_to_slack_channels or []: + post_to_slack_channels_item = AddActionItemTaskParamsPostToSlackChannelsItem.from_dict( + post_to_slack_channels_item_data + ) - post_to_slack_channels.append(post_to_slack_channels_item) + post_to_slack_channels.append(post_to_slack_channels_item) add_action_item_task_params = cls( priority=priority, diff --git a/rootly_sdk/models/add_action_item_task_params_assigned_to_user.py b/rootly_sdk/models/add_action_item_task_params_assigned_to_user.py index 8d65de98..efda1d60 100644 --- a/rootly_sdk/models/add_action_item_task_params_assigned_to_user.py +++ b/rootly_sdk/models/add_action_item_task_params_assigned_to_user.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,12 +14,12 @@ class AddActionItemTaskParamsAssignedToUser: """The user this action item is assigned to Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/add_action_item_task_params_post_to_slack_channels_item.py b/rootly_sdk/models/add_action_item_task_params_post_to_slack_channels_item.py index 2f32e287..d3e2ed64 100644 --- a/rootly_sdk/models/add_action_item_task_params_post_to_slack_channels_item.py +++ b/rootly_sdk/models/add_action_item_task_params_post_to_slack_channels_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class AddActionItemTaskParamsPostToSlackChannelsItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/add_microsoft_teams_chat_tab_task_params.py b/rootly_sdk/models/add_microsoft_teams_chat_tab_task_params.py index 97e5faf6..699bb122 100644 --- a/rootly_sdk/models/add_microsoft_teams_chat_tab_task_params.py +++ b/rootly_sdk/models/add_microsoft_teams_chat_tab_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -26,24 +24,23 @@ class AddMicrosoftTeamsChatTabTaskParams: chat (AddMicrosoftTeamsChatTabTaskParamsChat): title (str): The tab title link (str): The tab link - task_type (AddMicrosoftTeamsChatTabTaskParamsTaskType | Unset): + task_type (Union[Unset, AddMicrosoftTeamsChatTabTaskParamsTaskType]): """ - chat: AddMicrosoftTeamsChatTabTaskParamsChat + chat: "AddMicrosoftTeamsChatTabTaskParamsChat" title: str link: str - task_type: AddMicrosoftTeamsChatTabTaskParamsTaskType | Unset = UNSET + task_type: Union[Unset, AddMicrosoftTeamsChatTabTaskParamsTaskType] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - chat = self.chat.to_dict() title = self.title link = self.link - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -73,7 +70,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: link = d.pop("link") _task_type = d.pop("task_type", UNSET) - task_type: AddMicrosoftTeamsChatTabTaskParamsTaskType | Unset + task_type: Union[Unset, AddMicrosoftTeamsChatTabTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/add_microsoft_teams_chat_tab_task_params_chat.py b/rootly_sdk/models/add_microsoft_teams_chat_tab_task_params_chat.py index 8d82e503..01b9e8b4 100644 --- a/rootly_sdk/models/add_microsoft_teams_chat_tab_task_params_chat.py +++ b/rootly_sdk/models/add_microsoft_teams_chat_tab_task_params_chat.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class AddMicrosoftTeamsChatTabTaskParamsChat: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/add_microsoft_teams_tab_task_params_type_0.py b/rootly_sdk/models/add_microsoft_teams_tab_task_params_type_0.py index b641221f..f7b9192a 100644 --- a/rootly_sdk/models/add_microsoft_teams_tab_task_params_type_0.py +++ b/rootly_sdk/models/add_microsoft_teams_tab_task_params_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/add_microsoft_teams_tab_task_params_type_1.py b/rootly_sdk/models/add_microsoft_teams_tab_task_params_type_1.py index d3997e1b..d8eb83a4 100644 --- a/rootly_sdk/models/add_microsoft_teams_tab_task_params_type_1.py +++ b/rootly_sdk/models/add_microsoft_teams_tab_task_params_type_1.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/add_role_task_params.py b/rootly_sdk/models/add_role_task_params.py index c00fb3ce..2aa322e6 100644 --- a/rootly_sdk/models/add_role_task_params.py +++ b/rootly_sdk/models/add_role_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,29 +19,28 @@ class AddRoleTaskParams: """ Attributes: incident_role_id (str): The role id to add to the incident - task_type (AddRoleTaskParamsTaskType | Unset): - assigned_to_user_id (str | Unset): [DEPRECATED] Use assigned_to_user attribute instead. The user id this role is - assigned to - assigned_to_user (AddRoleTaskParamsAssignedToUser | Unset): The user this role is assigned to + task_type (Union[Unset, AddRoleTaskParamsTaskType]): + assigned_to_user_id (Union[Unset, str]): [DEPRECATED] Use assigned_to_user attribute instead. The user id this + role is assigned to + assigned_to_user (Union[Unset, AddRoleTaskParamsAssignedToUser]): The user this role is assigned to """ incident_role_id: str - task_type: AddRoleTaskParamsTaskType | Unset = UNSET - assigned_to_user_id: str | Unset = UNSET - assigned_to_user: AddRoleTaskParamsAssignedToUser | Unset = UNSET + task_type: Union[Unset, AddRoleTaskParamsTaskType] = UNSET + assigned_to_user_id: Union[Unset, str] = UNSET + assigned_to_user: Union[Unset, "AddRoleTaskParamsAssignedToUser"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - incident_role_id = self.incident_role_id - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type assigned_to_user_id = self.assigned_to_user_id - assigned_to_user: dict[str, Any] | Unset = UNSET + assigned_to_user: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.assigned_to_user, Unset): assigned_to_user = self.assigned_to_user.to_dict() @@ -71,7 +68,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: incident_role_id = d.pop("incident_role_id") _task_type = d.pop("task_type", UNSET) - task_type: AddRoleTaskParamsTaskType | Unset + task_type: Union[Unset, AddRoleTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: @@ -80,7 +77,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: assigned_to_user_id = d.pop("assigned_to_user_id", UNSET) _assigned_to_user = d.pop("assigned_to_user", UNSET) - assigned_to_user: AddRoleTaskParamsAssignedToUser | Unset + assigned_to_user: Union[Unset, AddRoleTaskParamsAssignedToUser] if isinstance(_assigned_to_user, Unset): assigned_to_user = UNSET else: diff --git a/rootly_sdk/models/add_role_task_params_assigned_to_user.py b/rootly_sdk/models/add_role_task_params_assigned_to_user.py index 2c165799..773c88a5 100644 --- a/rootly_sdk/models/add_role_task_params_assigned_to_user.py +++ b/rootly_sdk/models/add_role_task_params_assigned_to_user.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,12 +14,12 @@ class AddRoleTaskParamsAssignedToUser: """The user this role is assigned to Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/add_slack_bookmark_task_params_type_0.py b/rootly_sdk/models/add_slack_bookmark_task_params_type_0.py index e256010f..0f43cd35 100644 --- a/rootly_sdk/models/add_slack_bookmark_task_params_type_0.py +++ b/rootly_sdk/models/add_slack_bookmark_task_params_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/add_slack_bookmark_task_params_type_1.py b/rootly_sdk/models/add_slack_bookmark_task_params_type_1.py index 051110dd..17fb508b 100644 --- a/rootly_sdk/models/add_slack_bookmark_task_params_type_1.py +++ b/rootly_sdk/models/add_slack_bookmark_task_params_type_1.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/add_subscribers.py b/rootly_sdk/models/add_subscribers.py index 50590e8b..8c8f6c2d 100644 --- a/rootly_sdk/models/add_subscribers.py +++ b/rootly_sdk/models/add_subscribers.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class AddSubscribers: data (AddSubscribersData): """ - data: AddSubscribersData + data: "AddSubscribersData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/add_subscribers_data.py b/rootly_sdk/models/add_subscribers_data.py index 07e1b77d..e3a5017b 100644 --- a/rootly_sdk/models/add_subscribers_data.py +++ b/rootly_sdk/models/add_subscribers_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class AddSubscribersData: """ type_: AddSubscribersDataType - attributes: AddSubscribersDataAttributes + attributes: "AddSubscribersDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/add_subscribers_data_attributes.py b/rootly_sdk/models/add_subscribers_data_attributes.py index 7f819592..2b72bf7a 100644 --- a/rootly_sdk/models/add_subscribers_data_attributes.py +++ b/rootly_sdk/models/add_subscribers_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -14,16 +12,16 @@ class AddSubscribersDataAttributes: """ Attributes: - user_ids (list[str] | None | Unset): IDs of users you wish to add to list of subscribers for this incident - remove_users_with_no_private_incident_access (bool | None | Unset): Users without read permissions for private - incidents will be removed from the subscriber list of this incident Default: False. + user_ids (Union[None, Unset, list[str]]): IDs of users you wish to add to list of subscribers for this incident + remove_users_with_no_private_incident_access (Union[None, Unset, bool]): Users without read permissions for + private incidents will be removed from the subscriber list of this incident Default: False. """ - user_ids: list[str] | None | Unset = UNSET - remove_users_with_no_private_incident_access: bool | None | Unset = False + user_ids: Union[None, Unset, list[str]] = UNSET + remove_users_with_no_private_incident_access: Union[None, Unset, bool] = False def to_dict(self) -> dict[str, Any]: - user_ids: list[str] | None | Unset + user_ids: Union[None, Unset, list[str]] if isinstance(self.user_ids, Unset): user_ids = UNSET elif isinstance(self.user_ids, list): @@ -32,7 +30,7 @@ def to_dict(self) -> dict[str, Any]: else: user_ids = self.user_ids - remove_users_with_no_private_incident_access: bool | None | Unset + remove_users_with_no_private_incident_access: Union[None, Unset, bool] if isinstance(self.remove_users_with_no_private_incident_access, Unset): remove_users_with_no_private_incident_access = UNSET else: @@ -52,7 +50,7 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_user_ids(data: object) -> list[str] | None | Unset: + def _parse_user_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -63,18 +61,18 @@ def _parse_user_ids(data: object) -> list[str] | None | Unset: user_ids_type_0 = cast(list[str], data) return user_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) user_ids = _parse_user_ids(d.pop("user_ids", UNSET)) - def _parse_remove_users_with_no_private_incident_access(data: object) -> bool | None | Unset: + def _parse_remove_users_with_no_private_incident_access(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) remove_users_with_no_private_incident_access = _parse_remove_users_with_no_private_incident_access( d.pop("remove_users_with_no_private_incident_access", UNSET) diff --git a/rootly_sdk/models/add_team_task_params.py b/rootly_sdk/models/add_team_task_params.py index 20b40bd2..158d9c1f 100644 --- a/rootly_sdk/models/add_team_task_params.py +++ b/rootly_sdk/models/add_team_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,17 +15,17 @@ class AddTeamTaskParams: """ Attributes: group_id (str): The team id - task_type (AddTeamTaskParamsTaskType | Unset): + task_type (Union[Unset, AddTeamTaskParamsTaskType]): """ group_id: str - task_type: AddTeamTaskParamsTaskType | Unset = UNSET + task_type: Union[Unset, AddTeamTaskParamsTaskType] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: group_id = self.group_id - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -49,7 +47,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: group_id = d.pop("group_id") _task_type = d.pop("task_type", UNSET) - task_type: AddTeamTaskParamsTaskType | Unset + task_type: Union[Unset, AddTeamTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/add_to_timeline_task_params.py b/rootly_sdk/models/add_to_timeline_task_params.py index d94652d3..d435c175 100644 --- a/rootly_sdk/models/add_to_timeline_task_params.py +++ b/rootly_sdk/models/add_to_timeline_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -26,28 +24,27 @@ class AddToTimelineTaskParams: """ Attributes: event (str): The timeline event description - task_type (AddToTimelineTaskParamsTaskType | Unset): - url (str | Unset): A URL for the timeline event - post_to_slack_channels (list[AddToTimelineTaskParamsPostToSlackChannelsItem] | Unset): + task_type (Union[Unset, AddToTimelineTaskParamsTaskType]): + url (Union[Unset, str]): A URL for the timeline event + post_to_slack_channels (Union[Unset, list['AddToTimelineTaskParamsPostToSlackChannelsItem']]): """ event: str - task_type: AddToTimelineTaskParamsTaskType | Unset = UNSET - url: str | Unset = UNSET - post_to_slack_channels: list[AddToTimelineTaskParamsPostToSlackChannelsItem] | Unset = UNSET + task_type: Union[Unset, AddToTimelineTaskParamsTaskType] = UNSET + url: Union[Unset, str] = UNSET + post_to_slack_channels: Union[Unset, list["AddToTimelineTaskParamsPostToSlackChannelsItem"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - event = self.event - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type url = self.url - post_to_slack_channels: list[dict[str, Any]] | Unset = UNSET + post_to_slack_channels: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.post_to_slack_channels, Unset): post_to_slack_channels = [] for post_to_slack_channels_item_data in self.post_to_slack_channels: @@ -80,7 +77,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: event = d.pop("event") _task_type = d.pop("task_type", UNSET) - task_type: AddToTimelineTaskParamsTaskType | Unset + task_type: Union[Unset, AddToTimelineTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: @@ -88,16 +85,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: url = d.pop("url", UNSET) + post_to_slack_channels = [] _post_to_slack_channels = d.pop("post_to_slack_channels", UNSET) - post_to_slack_channels: list[AddToTimelineTaskParamsPostToSlackChannelsItem] | Unset = UNSET - if _post_to_slack_channels is not UNSET: - post_to_slack_channels = [] - for post_to_slack_channels_item_data in _post_to_slack_channels: - post_to_slack_channels_item = AddToTimelineTaskParamsPostToSlackChannelsItem.from_dict( - post_to_slack_channels_item_data - ) + for post_to_slack_channels_item_data in _post_to_slack_channels or []: + post_to_slack_channels_item = AddToTimelineTaskParamsPostToSlackChannelsItem.from_dict( + post_to_slack_channels_item_data + ) - post_to_slack_channels.append(post_to_slack_channels_item) + post_to_slack_channels.append(post_to_slack_channels_item) add_to_timeline_task_params = cls( event=event, diff --git a/rootly_sdk/models/add_to_timeline_task_params_post_to_slack_channels_item.py b/rootly_sdk/models/add_to_timeline_task_params_post_to_slack_channels_item.py index a0238cd6..66a75d0f 100644 --- a/rootly_sdk/models/add_to_timeline_task_params_post_to_slack_channels_item.py +++ b/rootly_sdk/models/add_to_timeline_task_params_post_to_slack_channels_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class AddToTimelineTaskParamsPostToSlackChannelsItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/ai_chat_response.py b/rootly_sdk/models/ai_chat_response.py index d4a4d120..c420fe43 100644 --- a/rootly_sdk/models/ai_chat_response.py +++ b/rootly_sdk/models/ai_chat_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,18 +19,17 @@ class AiChatResponse: """ Attributes: data (AiChatResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: AiChatResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "AiChatResponseData" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = AiChatResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) ai_chat_response = cls( data=data, diff --git a/rootly_sdk/models/ai_chat_response_data.py b/rootly_sdk/models/ai_chat_response_data.py index 9a4718a5..5b4dbe46 100644 --- a/rootly_sdk/models/ai_chat_response_data.py +++ b/rootly_sdk/models/ai_chat_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar from uuid import UUID @@ -27,11 +25,10 @@ class AiChatResponseData: id: UUID type_: AiChatResponseDataType - attributes: AiChatResponseDataAttributes + attributes: "AiChatResponseDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = str(self.id) type_: str = self.type_ diff --git a/rootly_sdk/models/ai_chat_response_data_attributes.py b/rootly_sdk/models/ai_chat_response_data_attributes.py index 67c0577f..16734ad6 100644 --- a/rootly_sdk/models/ai_chat_response_data_attributes.py +++ b/rootly_sdk/models/ai_chat_response_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from uuid import UUID from attrs import define as _attrs_define @@ -21,25 +19,25 @@ class AiChatResponseDataAttributes: """ Attributes: session_id (UUID): AI chat session UUID - reply (None | str | Unset): Assistant reply text - status (AiChatResponseDataAttributesStatus | Unset): Response status (present when user input is required) + reply (Union[None, Unset, str]): Assistant reply text + status (Union[Unset, AiChatResponseDataAttributesStatus]): Response status (present when user input is required) """ session_id: UUID - reply: None | str | Unset = UNSET - status: AiChatResponseDataAttributesStatus | Unset = UNSET + reply: Union[None, Unset, str] = UNSET + status: Union[Unset, AiChatResponseDataAttributesStatus] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: session_id = str(self.session_id) - reply: None | str | Unset + reply: Union[None, Unset, str] if isinstance(self.reply, Unset): reply = UNSET else: reply = self.reply - status: str | Unset = UNSET + status: Union[Unset, str] = UNSET if not isinstance(self.status, Unset): status = self.status @@ -62,17 +60,17 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) session_id = UUID(d.pop("session_id")) - def _parse_reply(data: object) -> None | str | Unset: + def _parse_reply(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) reply = _parse_reply(d.pop("reply", UNSET)) _status = d.pop("status", UNSET) - status: AiChatResponseDataAttributesStatus | Unset + status: Union[Unset, AiChatResponseDataAttributesStatus] if isinstance(_status, Unset): status = UNSET else: diff --git a/rootly_sdk/models/ai_chat_session_message.py b/rootly_sdk/models/ai_chat_session_message.py index 272ca8ed..710a10ad 100644 --- a/rootly_sdk/models/ai_chat_session_message.py +++ b/rootly_sdk/models/ai_chat_session_message.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import datetime from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/ai_chat_session_message_list.py b/rootly_sdk/models/ai_chat_session_message_list.py index 7d5486bd..01c7bd82 100644 --- a/rootly_sdk/models/ai_chat_session_message_list.py +++ b/rootly_sdk/models/ai_chat_session_message_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -20,22 +18,21 @@ class AiChatSessionMessageList: """ Attributes: - messages (list[AiChatSessionMessage]): - meta (AiChatSessionMessageListMeta | Unset): + messages (list['AiChatSessionMessage']): + meta (Union[Unset, AiChatSessionMessageListMeta]): """ - messages: list[AiChatSessionMessage] - meta: AiChatSessionMessageListMeta | Unset = UNSET + messages: list["AiChatSessionMessage"] + meta: Union[Unset, "AiChatSessionMessageListMeta"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - messages = [] for messages_item_data in self.messages: messages_item = messages_item_data.to_dict() messages.append(messages_item) - meta: dict[str, Any] | Unset = UNSET + meta: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.meta, Unset): meta = self.meta.to_dict() @@ -65,7 +62,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: messages.append(messages_item) _meta = d.pop("meta", UNSET) - meta: AiChatSessionMessageListMeta | Unset + meta: Union[Unset, AiChatSessionMessageListMeta] if isinstance(_meta, Unset): meta = UNSET else: diff --git a/rootly_sdk/models/ai_chat_session_message_list_meta.py b/rootly_sdk/models/ai_chat_session_message_list_meta.py index 6d3a6dd3..c338c5d4 100644 --- a/rootly_sdk/models/ai_chat_session_message_list_meta.py +++ b/rootly_sdk/models/ai_chat_session_message_list_meta.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,7 +14,6 @@ class AiChatSessionMessageListMeta: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) diff --git a/rootly_sdk/models/alert.py b/rootly_sdk/models/alert.py index db843d35..3c3ad56b 100644 --- a/rootly_sdk/models/alert.py +++ b/rootly_sdk/models/alert.py @@ -1,8 +1,6 @@ -from __future__ import annotations - import datetime from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -39,44 +37,46 @@ class Alert: summary (str): The summary of the alert created_at (str): Date of creation updated_at (str): Date of last update - noise (AlertNoise | Unset): Whether the alert is marked as noise - status (AlertStatus | Unset): The status of the alert - description (None | str | Unset): The description of the alert - services (list[Service] | Unset): Services attached to the alert - groups (list[Team] | Unset): Groups attached to the alert - functionalities (list[Functionality] | Unset): Functionalities attached to the alert - environments (list[Environment] | Unset): Environments attached to the alert - service_ids (list[str] | None | Unset): The Service IDs to attach to the alert. If your organization has On-Call - enabled and your notification target is a Service. This field will be automatically set for you. - group_ids (list[str] | None | Unset): The Group IDs to attach to the alert. If your organization has On-Call - enabled and your notification target is a Group. This field will be automatically set for you. - functionality_ids (list[str] | None | Unset): The Functionality IDs to attach to the alert - environment_ids (list[str] | None | Unset): The Environment IDs to attach to the alert - external_id (None | str | Unset): External ID - external_url (None | str | Unset): External Url - alert_urgency_id (None | str | Unset): The ID of the alert urgency - alert_urgency (AlertUrgency | Unset): - group_leader_alert_id (None | str | Unset): The ID of the group leader alert - is_group_leader_alert (bool | None | Unset): Whether the alert is a group leader alert - labels (list[AlertLabelsItemType0 | None] | Unset): - data (AlertDataType0 | None | Unset): Additional data - notification_target_type (AlertNotificationTargetType | Unset): Only available for organizations with Rootly On- - Call enabled. Can be one of Group, Service, EscalationPolicy, Functionality, User. - notification_target_id (None | str | Unset): Only available for organizations with Rootly On-Call enabled. The - identifier of the notification target object. - deduplication_key (None | str | Unset): Alerts sharing the same deduplication key are treated as a single alert. - alert_field_values (list[AlertAlertFieldValuesType0Item] | None | Unset): Custom alert field values associated - with the alert. Only present when the enable_alert_fields feature flag is enabled for the team. - responders (list[UserFlatResponse] | None | Unset): Users who responded to the alert. Included on all non-list - responses (show, create, update, resolve, etc.); on list responses only when `include=responders` is requested. - notified_users (list[User] | None | Unset): Users who were notified about the alert. Included on all non-list - responses (show, create, update, resolve, etc.); on list responses only when `include=notified_users` is + noise (Union[Unset, AlertNoise]): Whether the alert is marked as noise + status (Union[Unset, AlertStatus]): The status of the alert + description (Union[None, Unset, str]): The description of the alert + services (Union[Unset, list['Service']]): Services attached to the alert + groups (Union[Unset, list['Team']]): Groups attached to the alert + functionalities (Union[Unset, list['Functionality']]): Functionalities attached to the alert + environments (Union[Unset, list['Environment']]): Environments attached to the alert + service_ids (Union[None, Unset, list[str]]): The Service IDs to attach to the alert. If your organization has + On-Call enabled and your notification target is a Service. This field will be automatically set for you. + group_ids (Union[None, Unset, list[str]]): The Group IDs to attach to the alert. If your organization has On- + Call enabled and your notification target is a Group. This field will be automatically set for you. + functionality_ids (Union[None, Unset, list[str]]): The Functionality IDs to attach to the alert + environment_ids (Union[None, Unset, list[str]]): The Environment IDs to attach to the alert + external_id (Union[None, Unset, str]): External ID + external_url (Union[None, Unset, str]): External Url + alert_urgency_id (Union[None, Unset, str]): The ID of the alert urgency + alert_urgency (Union[Unset, AlertUrgency]): + group_leader_alert_id (Union[None, Unset, str]): The ID of the group leader alert + is_group_leader_alert (Union[None, Unset, bool]): Whether the alert is a group leader alert + labels (Union[Unset, list[Union['AlertLabelsItemType0', None]]]): + data (Union['AlertDataType0', None, Unset]): Additional data + notification_target_type (Union[Unset, AlertNotificationTargetType]): Only available for organizations with + Rootly On-Call enabled. Can be one of Group, Service, EscalationPolicy, Functionality, User. + notification_target_id (Union[None, Unset, str]): Only available for organizations with Rootly On-Call enabled. + The identifier of the notification target object. + deduplication_key (Union[None, Unset, str]): Alerts sharing the same deduplication key are treated as a single + alert. + alert_field_values (Union[None, Unset, list['AlertAlertFieldValuesType0Item']]): Custom alert field values + associated with the alert. Only present when the enable_alert_fields feature flag is enabled for the team. + responders (Union[None, Unset, list['UserFlatResponse']]): Users who responded to the alert. Included on all + non-list responses (show, create, update, resolve, etc.); on list responses only when `include=responders` is + requested. + notified_users (Union[None, Unset, list['User']]): Users who were notified about the alert. Included on all non- + list responses (show, create, update, resolve, etc.); on list responses only when `include=notified_users` is requested. - alerting_targets (list[AlertAlertingTargetsType0Item] | None | Unset): Alerting targets associated with the - alert. Only present when advanced routing is enabled for the team. - url (str | Unset): The Rootly dashboard URL for the alert - started_at (datetime.datetime | None | Unset): When the alert started - ended_at (datetime.datetime | None | Unset): When the alert ended + alerting_targets (Union[None, Unset, list['AlertAlertingTargetsType0Item']]): Alerting targets associated with + the alert. Only present when advanced routing is enabled for the team. + url (Union[Unset, str]): The Rootly dashboard URL for the alert + started_at (Union[None, Unset, datetime.datetime]): When the alert started + ended_at (Union[None, Unset, datetime.datetime]): When the alert ended """ short_id: str @@ -84,35 +84,35 @@ class Alert: summary: str created_at: str updated_at: str - noise: AlertNoise | Unset = UNSET - status: AlertStatus | Unset = UNSET - description: None | str | Unset = UNSET - services: list[Service] | Unset = UNSET - groups: list[Team] | Unset = UNSET - functionalities: list[Functionality] | Unset = UNSET - environments: list[Environment] | Unset = UNSET - service_ids: list[str] | None | Unset = UNSET - group_ids: list[str] | None | Unset = UNSET - functionality_ids: list[str] | None | Unset = UNSET - environment_ids: list[str] | None | Unset = UNSET - external_id: None | str | Unset = UNSET - external_url: None | str | Unset = UNSET - alert_urgency_id: None | str | Unset = UNSET - alert_urgency: AlertUrgency | Unset = UNSET - group_leader_alert_id: None | str | Unset = UNSET - is_group_leader_alert: bool | None | Unset = UNSET - labels: list[AlertLabelsItemType0 | None] | Unset = UNSET - data: AlertDataType0 | None | Unset = UNSET - notification_target_type: AlertNotificationTargetType | Unset = UNSET - notification_target_id: None | str | Unset = UNSET - deduplication_key: None | str | Unset = UNSET - alert_field_values: list[AlertAlertFieldValuesType0Item] | None | Unset = UNSET - responders: list[UserFlatResponse] | None | Unset = UNSET - notified_users: list[User] | None | Unset = UNSET - alerting_targets: list[AlertAlertingTargetsType0Item] | None | Unset = UNSET - url: str | Unset = UNSET - started_at: datetime.datetime | None | Unset = UNSET - ended_at: datetime.datetime | None | Unset = UNSET + noise: Union[Unset, AlertNoise] = UNSET + status: Union[Unset, AlertStatus] = UNSET + description: Union[None, Unset, str] = UNSET + services: Union[Unset, list["Service"]] = UNSET + groups: Union[Unset, list["Team"]] = UNSET + functionalities: Union[Unset, list["Functionality"]] = UNSET + environments: Union[Unset, list["Environment"]] = UNSET + service_ids: Union[None, Unset, list[str]] = UNSET + group_ids: Union[None, Unset, list[str]] = UNSET + functionality_ids: Union[None, Unset, list[str]] = UNSET + environment_ids: Union[None, Unset, list[str]] = UNSET + external_id: Union[None, Unset, str] = UNSET + external_url: Union[None, Unset, str] = UNSET + alert_urgency_id: Union[None, Unset, str] = UNSET + alert_urgency: Union[Unset, "AlertUrgency"] = UNSET + group_leader_alert_id: Union[None, Unset, str] = UNSET + is_group_leader_alert: Union[None, Unset, bool] = UNSET + labels: Union[Unset, list[Union["AlertLabelsItemType0", None]]] = UNSET + data: Union["AlertDataType0", None, Unset] = UNSET + notification_target_type: Union[Unset, AlertNotificationTargetType] = UNSET + notification_target_id: Union[None, Unset, str] = UNSET + deduplication_key: Union[None, Unset, str] = UNSET + alert_field_values: Union[None, Unset, list["AlertAlertFieldValuesType0Item"]] = UNSET + responders: Union[None, Unset, list["UserFlatResponse"]] = UNSET + notified_users: Union[None, Unset, list["User"]] = UNSET + alerting_targets: Union[None, Unset, list["AlertAlertingTargetsType0Item"]] = UNSET + url: Union[Unset, str] = UNSET + started_at: Union[None, Unset, datetime.datetime] = UNSET + ended_at: Union[None, Unset, datetime.datetime] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -129,49 +129,49 @@ def to_dict(self) -> dict[str, Any]: updated_at = self.updated_at - noise: str | Unset = UNSET + noise: Union[Unset, str] = UNSET if not isinstance(self.noise, Unset): noise = self.noise - status: str | Unset = UNSET + status: Union[Unset, str] = UNSET if not isinstance(self.status, Unset): status = self.status - description: None | str | Unset + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: description = self.description - services: list[dict[str, Any]] | Unset = UNSET + services: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.services, Unset): services = [] for services_item_data in self.services: services_item = services_item_data.to_dict() services.append(services_item) - groups: list[dict[str, Any]] | Unset = UNSET + groups: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.groups, Unset): groups = [] for groups_item_data in self.groups: groups_item = groups_item_data.to_dict() groups.append(groups_item) - functionalities: list[dict[str, Any]] | Unset = UNSET + functionalities: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.functionalities, Unset): functionalities = [] for functionalities_item_data in self.functionalities: functionalities_item = functionalities_item_data.to_dict() functionalities.append(functionalities_item) - environments: list[dict[str, Any]] | Unset = UNSET + environments: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.environments, Unset): environments = [] for environments_item_data in self.environments: environments_item = environments_item_data.to_dict() environments.append(environments_item) - service_ids: list[str] | None | Unset + service_ids: Union[None, Unset, list[str]] if isinstance(self.service_ids, Unset): service_ids = UNSET elif isinstance(self.service_ids, list): @@ -180,7 +180,7 @@ def to_dict(self) -> dict[str, Any]: else: service_ids = self.service_ids - group_ids: list[str] | None | Unset + group_ids: Union[None, Unset, list[str]] if isinstance(self.group_ids, Unset): group_ids = UNSET elif isinstance(self.group_ids, list): @@ -189,7 +189,7 @@ def to_dict(self) -> dict[str, Any]: else: group_ids = self.group_ids - functionality_ids: list[str] | None | Unset + functionality_ids: Union[None, Unset, list[str]] if isinstance(self.functionality_ids, Unset): functionality_ids = UNSET elif isinstance(self.functionality_ids, list): @@ -198,7 +198,7 @@ def to_dict(self) -> dict[str, Any]: else: functionality_ids = self.functionality_ids - environment_ids: list[str] | None | Unset + environment_ids: Union[None, Unset, list[str]] if isinstance(self.environment_ids, Unset): environment_ids = UNSET elif isinstance(self.environment_ids, list): @@ -207,52 +207,52 @@ def to_dict(self) -> dict[str, Any]: else: environment_ids = self.environment_ids - external_id: None | str | Unset + external_id: Union[None, Unset, str] if isinstance(self.external_id, Unset): external_id = UNSET else: external_id = self.external_id - external_url: None | str | Unset + external_url: Union[None, Unset, str] if isinstance(self.external_url, Unset): external_url = UNSET else: external_url = self.external_url - alert_urgency_id: None | str | Unset + alert_urgency_id: Union[None, Unset, str] if isinstance(self.alert_urgency_id, Unset): alert_urgency_id = UNSET else: alert_urgency_id = self.alert_urgency_id - alert_urgency: dict[str, Any] | Unset = UNSET + alert_urgency: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.alert_urgency, Unset): alert_urgency = self.alert_urgency.to_dict() - group_leader_alert_id: None | str | Unset + group_leader_alert_id: Union[None, Unset, str] if isinstance(self.group_leader_alert_id, Unset): group_leader_alert_id = UNSET else: group_leader_alert_id = self.group_leader_alert_id - is_group_leader_alert: bool | None | Unset + is_group_leader_alert: Union[None, Unset, bool] if isinstance(self.is_group_leader_alert, Unset): is_group_leader_alert = UNSET else: is_group_leader_alert = self.is_group_leader_alert - labels: list[dict[str, Any] | None] | Unset = UNSET + labels: Union[Unset, list[Union[None, dict[str, Any]]]] = UNSET if not isinstance(self.labels, Unset): labels = [] for labels_item_data in self.labels: - labels_item: dict[str, Any] | None + labels_item: Union[None, dict[str, Any]] if isinstance(labels_item_data, AlertLabelsItemType0): labels_item = labels_item_data.to_dict() else: labels_item = labels_item_data labels.append(labels_item) - data: dict[str, Any] | None | Unset + data: Union[None, Unset, dict[str, Any]] if isinstance(self.data, Unset): data = UNSET elif isinstance(self.data, AlertDataType0): @@ -260,23 +260,23 @@ def to_dict(self) -> dict[str, Any]: else: data = self.data - notification_target_type: str | Unset = UNSET + notification_target_type: Union[Unset, str] = UNSET if not isinstance(self.notification_target_type, Unset): notification_target_type = self.notification_target_type - notification_target_id: None | str | Unset + notification_target_id: Union[None, Unset, str] if isinstance(self.notification_target_id, Unset): notification_target_id = UNSET else: notification_target_id = self.notification_target_id - deduplication_key: None | str | Unset + deduplication_key: Union[None, Unset, str] if isinstance(self.deduplication_key, Unset): deduplication_key = UNSET else: deduplication_key = self.deduplication_key - alert_field_values: list[dict[str, Any]] | None | Unset + alert_field_values: Union[None, Unset, list[dict[str, Any]]] if isinstance(self.alert_field_values, Unset): alert_field_values = UNSET elif isinstance(self.alert_field_values, list): @@ -288,7 +288,7 @@ def to_dict(self) -> dict[str, Any]: else: alert_field_values = self.alert_field_values - responders: list[dict[str, Any]] | None | Unset + responders: Union[None, Unset, list[dict[str, Any]]] if isinstance(self.responders, Unset): responders = UNSET elif isinstance(self.responders, list): @@ -300,7 +300,7 @@ def to_dict(self) -> dict[str, Any]: else: responders = self.responders - notified_users: list[dict[str, Any]] | None | Unset + notified_users: Union[None, Unset, list[dict[str, Any]]] if isinstance(self.notified_users, Unset): notified_users = UNSET elif isinstance(self.notified_users, list): @@ -312,7 +312,7 @@ def to_dict(self) -> dict[str, Any]: else: notified_users = self.notified_users - alerting_targets: list[dict[str, Any]] | None | Unset + alerting_targets: Union[None, Unset, list[dict[str, Any]]] if isinstance(self.alerting_targets, Unset): alerting_targets = UNSET elif isinstance(self.alerting_targets, list): @@ -326,7 +326,7 @@ def to_dict(self) -> dict[str, Any]: url = self.url - started_at: None | str | Unset + started_at: Union[None, Unset, str] if isinstance(self.started_at, Unset): started_at = UNSET elif isinstance(self.started_at, datetime.datetime): @@ -334,7 +334,7 @@ def to_dict(self) -> dict[str, Any]: else: started_at = self.started_at - ended_at: None | str | Unset + ended_at: Union[None, Unset, str] if isinstance(self.ended_at, Unset): ended_at = UNSET elif isinstance(self.ended_at, datetime.datetime): @@ -440,65 +440,57 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: updated_at = d.pop("updated_at") _noise = d.pop("noise", UNSET) - noise: AlertNoise | Unset + noise: Union[Unset, AlertNoise] if isinstance(_noise, Unset): noise = UNSET else: noise = check_alert_noise(_noise) _status = d.pop("status", UNSET) - status: AlertStatus | Unset + status: Union[Unset, AlertStatus] if isinstance(_status, Unset): status = UNSET else: status = check_alert_status(_status) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) + services = [] _services = d.pop("services", UNSET) - services: list[Service] | Unset = UNSET - if _services is not UNSET: - services = [] - for services_item_data in _services: - services_item = Service.from_dict(services_item_data) + for services_item_data in _services or []: + services_item = Service.from_dict(services_item_data) - services.append(services_item) + services.append(services_item) + groups = [] _groups = d.pop("groups", UNSET) - groups: list[Team] | Unset = UNSET - if _groups is not UNSET: - groups = [] - for groups_item_data in _groups: - groups_item = Team.from_dict(groups_item_data) + for groups_item_data in _groups or []: + groups_item = Team.from_dict(groups_item_data) - groups.append(groups_item) + groups.append(groups_item) + functionalities = [] _functionalities = d.pop("functionalities", UNSET) - functionalities: list[Functionality] | Unset = UNSET - if _functionalities is not UNSET: - functionalities = [] - for functionalities_item_data in _functionalities: - functionalities_item = Functionality.from_dict(functionalities_item_data) + for functionalities_item_data in _functionalities or []: + functionalities_item = Functionality.from_dict(functionalities_item_data) - functionalities.append(functionalities_item) + functionalities.append(functionalities_item) + environments = [] _environments = d.pop("environments", UNSET) - environments: list[Environment] | Unset = UNSET - if _environments is not UNSET: - environments = [] - for environments_item_data in _environments: - environments_item = Environment.from_dict(environments_item_data) + for environments_item_data in _environments or []: + environments_item = Environment.from_dict(environments_item_data) - environments.append(environments_item) + environments.append(environments_item) - def _parse_service_ids(data: object) -> list[str] | None | Unset: + def _parse_service_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -509,13 +501,13 @@ def _parse_service_ids(data: object) -> list[str] | None | Unset: service_ids_type_0 = cast(list[str], data) return service_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) service_ids = _parse_service_ids(d.pop("service_ids", UNSET)) - def _parse_group_ids(data: object) -> list[str] | None | Unset: + def _parse_group_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -526,13 +518,13 @@ def _parse_group_ids(data: object) -> list[str] | None | Unset: group_ids_type_0 = cast(list[str], data) return group_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) group_ids = _parse_group_ids(d.pop("group_ids", UNSET)) - def _parse_functionality_ids(data: object) -> list[str] | None | Unset: + def _parse_functionality_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -543,13 +535,13 @@ def _parse_functionality_ids(data: object) -> list[str] | None | Unset: functionality_ids_type_0 = cast(list[str], data) return functionality_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) functionality_ids = _parse_functionality_ids(d.pop("functionality_ids", UNSET)) - def _parse_environment_ids(data: object) -> list[str] | None | Unset: + def _parse_environment_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -560,88 +552,86 @@ def _parse_environment_ids(data: object) -> list[str] | None | Unset: environment_ids_type_0 = cast(list[str], data) return environment_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) environment_ids = _parse_environment_ids(d.pop("environment_ids", UNSET)) - def _parse_external_id(data: object) -> None | str | Unset: + def _parse_external_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) external_id = _parse_external_id(d.pop("external_id", UNSET)) - def _parse_external_url(data: object) -> None | str | Unset: + def _parse_external_url(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) external_url = _parse_external_url(d.pop("external_url", UNSET)) - def _parse_alert_urgency_id(data: object) -> None | str | Unset: + def _parse_alert_urgency_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) alert_urgency_id = _parse_alert_urgency_id(d.pop("alert_urgency_id", UNSET)) _alert_urgency = d.pop("alert_urgency", UNSET) - alert_urgency: AlertUrgency | Unset + alert_urgency: Union[Unset, AlertUrgency] if isinstance(_alert_urgency, Unset): alert_urgency = UNSET else: alert_urgency = AlertUrgency.from_dict(_alert_urgency) - def _parse_group_leader_alert_id(data: object) -> None | str | Unset: + def _parse_group_leader_alert_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) group_leader_alert_id = _parse_group_leader_alert_id(d.pop("group_leader_alert_id", UNSET)) - def _parse_is_group_leader_alert(data: object) -> bool | None | Unset: + def _parse_is_group_leader_alert(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) is_group_leader_alert = _parse_is_group_leader_alert(d.pop("is_group_leader_alert", UNSET)) + labels = [] _labels = d.pop("labels", UNSET) - labels: list[AlertLabelsItemType0 | None] | Unset = UNSET - if _labels is not UNSET: - labels = [] - for labels_item_data in _labels: + for labels_item_data in _labels or []: - def _parse_labels_item(data: object) -> AlertLabelsItemType0 | None: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - labels_item_type_0 = AlertLabelsItemType0.from_dict(data) + def _parse_labels_item(data: object) -> Union["AlertLabelsItemType0", None]: + if data is None: + return data + try: + if not isinstance(data, dict): + raise TypeError() + labels_item_type_0 = AlertLabelsItemType0.from_dict(data) - return labels_item_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(AlertLabelsItemType0 | None, data) + return labels_item_type_0 + except: # noqa: E722 + pass + return cast(Union["AlertLabelsItemType0", None], data) - labels_item = _parse_labels_item(labels_item_data) + labels_item = _parse_labels_item(labels_item_data) - labels.append(labels_item) + labels.append(labels_item) - def _parse_data(data: object) -> AlertDataType0 | None | Unset: + def _parse_data(data: object) -> Union["AlertDataType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -652,38 +642,38 @@ def _parse_data(data: object) -> AlertDataType0 | None | Unset: data_type_0 = AlertDataType0.from_dict(data) return data_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(AlertDataType0 | None | Unset, data) + return cast(Union["AlertDataType0", None, Unset], data) data = _parse_data(d.pop("data", UNSET)) _notification_target_type = d.pop("notification_target_type", UNSET) - notification_target_type: AlertNotificationTargetType | Unset + notification_target_type: Union[Unset, AlertNotificationTargetType] if isinstance(_notification_target_type, Unset): notification_target_type = UNSET else: notification_target_type = check_alert_notification_target_type(_notification_target_type) - def _parse_notification_target_id(data: object) -> None | str | Unset: + def _parse_notification_target_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) notification_target_id = _parse_notification_target_id(d.pop("notification_target_id", UNSET)) - def _parse_deduplication_key(data: object) -> None | str | Unset: + def _parse_deduplication_key(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) deduplication_key = _parse_deduplication_key(d.pop("deduplication_key", UNSET)) - def _parse_alert_field_values(data: object) -> list[AlertAlertFieldValuesType0Item] | None | Unset: + def _parse_alert_field_values(data: object) -> Union[None, Unset, list["AlertAlertFieldValuesType0Item"]]: if data is None: return data if isinstance(data, Unset): @@ -701,13 +691,13 @@ def _parse_alert_field_values(data: object) -> list[AlertAlertFieldValuesType0It alert_field_values_type_0.append(alert_field_values_type_0_item) return alert_field_values_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[AlertAlertFieldValuesType0Item] | None | Unset, data) + return cast(Union[None, Unset, list["AlertAlertFieldValuesType0Item"]], data) alert_field_values = _parse_alert_field_values(d.pop("alert_field_values", UNSET)) - def _parse_responders(data: object) -> list[UserFlatResponse] | None | Unset: + def _parse_responders(data: object) -> Union[None, Unset, list["UserFlatResponse"]]: if data is None: return data if isinstance(data, Unset): @@ -723,13 +713,13 @@ def _parse_responders(data: object) -> list[UserFlatResponse] | None | Unset: responders_type_0.append(responders_type_0_item) return responders_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[UserFlatResponse] | None | Unset, data) + return cast(Union[None, Unset, list["UserFlatResponse"]], data) responders = _parse_responders(d.pop("responders", UNSET)) - def _parse_notified_users(data: object) -> list[User] | None | Unset: + def _parse_notified_users(data: object) -> Union[None, Unset, list["User"]]: if data is None: return data if isinstance(data, Unset): @@ -745,13 +735,13 @@ def _parse_notified_users(data: object) -> list[User] | None | Unset: notified_users_type_0.append(notified_users_type_0_item) return notified_users_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[User] | None | Unset, data) + return cast(Union[None, Unset, list["User"]], data) notified_users = _parse_notified_users(d.pop("notified_users", UNSET)) - def _parse_alerting_targets(data: object) -> list[AlertAlertingTargetsType0Item] | None | Unset: + def _parse_alerting_targets(data: object) -> Union[None, Unset, list["AlertAlertingTargetsType0Item"]]: if data is None: return data if isinstance(data, Unset): @@ -769,15 +759,15 @@ def _parse_alerting_targets(data: object) -> list[AlertAlertingTargetsType0Item] alerting_targets_type_0.append(alerting_targets_type_0_item) return alerting_targets_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[AlertAlertingTargetsType0Item] | None | Unset, data) + return cast(Union[None, Unset, list["AlertAlertingTargetsType0Item"]], data) alerting_targets = _parse_alerting_targets(d.pop("alerting_targets", UNSET)) url = d.pop("url", UNSET) - def _parse_started_at(data: object) -> datetime.datetime | None | Unset: + def _parse_started_at(data: object) -> Union[None, Unset, datetime.datetime]: if data is None: return data if isinstance(data, Unset): @@ -788,13 +778,13 @@ def _parse_started_at(data: object) -> datetime.datetime | None | Unset: started_at_type_0 = isoparse(data) return started_at_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(datetime.datetime | None | Unset, data) + return cast(Union[None, Unset, datetime.datetime], data) started_at = _parse_started_at(d.pop("started_at", UNSET)) - def _parse_ended_at(data: object) -> datetime.datetime | None | Unset: + def _parse_ended_at(data: object) -> Union[None, Unset, datetime.datetime]: if data is None: return data if isinstance(data, Unset): @@ -805,9 +795,9 @@ def _parse_ended_at(data: object) -> datetime.datetime | None | Unset: ended_at_type_0 = isoparse(data) return ended_at_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(datetime.datetime | None | Unset, data) + return cast(Union[None, Unset, datetime.datetime], data) ended_at = _parse_ended_at(d.pop("ended_at", UNSET)) diff --git a/rootly_sdk/models/alert_alert_field_values_type_0_item.py b/rootly_sdk/models/alert_alert_field_values_type_0_item.py index 2be2c603..1e14bd36 100644 --- a/rootly_sdk/models/alert_alert_field_values_type_0_item.py +++ b/rootly_sdk/models/alert_alert_field_values_type_0_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/alert_alerting_targets_type_0_item.py b/rootly_sdk/models/alert_alerting_targets_type_0_item.py index 2ed599cc..056c6203 100644 --- a/rootly_sdk/models/alert_alerting_targets_type_0_item.py +++ b/rootly_sdk/models/alert_alerting_targets_type_0_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/alert_data_type_0.py b/rootly_sdk/models/alert_data_type_0.py index ce1e2630..a1daf88d 100644 --- a/rootly_sdk/models/alert_data_type_0.py +++ b/rootly_sdk/models/alert_data_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,7 +14,6 @@ class AlertDataType0: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) diff --git a/rootly_sdk/models/alert_event.py b/rootly_sdk/models/alert_event.py index 66639594..d01b5629 100644 --- a/rootly_sdk/models/alert_event.py +++ b/rootly_sdk/models/alert_event.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -31,17 +29,17 @@ class AlertEvent: source (str): created_at (str): updated_at (str): - user_id (int | None | Unset): Author of the note. - details (None | str | Unset): Note message. - user (AlertEventUser | Unset): - incident (AlertEventIncidentType0 | None | Unset): - schedule (AlertEventScheduleType0 | None | Unset): - escalation_level (int | None | Unset): - escalation_target_type (None | str | Unset): e.g. EscalationPolicy, User. - escalation_target (AlertEventEscalationTargetType0 | None | Unset): JSON:API-wrapped escalation target (User or - EscalationPolicy). - slack_channel (SlackChannel | Unset): - incident_ids (list[str] | None | Unset): + user_id (Union[None, Unset, int]): Author of the note. + details (Union[None, Unset, str]): Note message. + user (Union[Unset, AlertEventUser]): + incident (Union['AlertEventIncidentType0', None, Unset]): + schedule (Union['AlertEventScheduleType0', None, Unset]): + escalation_level (Union[None, Unset, int]): + escalation_target_type (Union[None, Unset, str]): e.g. EscalationPolicy, User. + escalation_target (Union['AlertEventEscalationTargetType0', None, Unset]): JSON:API-wrapped escalation target + (User or EscalationPolicy). + slack_channel (Union[Unset, SlackChannel]): + incident_ids (Union[None, Unset, list[str]]): """ alert_id: str @@ -50,16 +48,16 @@ class AlertEvent: source: str created_at: str updated_at: str - user_id: int | None | Unset = UNSET - details: None | str | Unset = UNSET - user: AlertEventUser | Unset = UNSET - incident: AlertEventIncidentType0 | None | Unset = UNSET - schedule: AlertEventScheduleType0 | None | Unset = UNSET - escalation_level: int | None | Unset = UNSET - escalation_target_type: None | str | Unset = UNSET - escalation_target: AlertEventEscalationTargetType0 | None | Unset = UNSET - slack_channel: SlackChannel | Unset = UNSET - incident_ids: list[str] | None | Unset = UNSET + user_id: Union[None, Unset, int] = UNSET + details: Union[None, Unset, str] = UNSET + user: Union[Unset, "AlertEventUser"] = UNSET + incident: Union["AlertEventIncidentType0", None, Unset] = UNSET + schedule: Union["AlertEventScheduleType0", None, Unset] = UNSET + escalation_level: Union[None, Unset, int] = UNSET + escalation_target_type: Union[None, Unset, str] = UNSET + escalation_target: Union["AlertEventEscalationTargetType0", None, Unset] = UNSET + slack_channel: Union[Unset, "SlackChannel"] = UNSET + incident_ids: Union[None, Unset, list[str]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -79,23 +77,23 @@ def to_dict(self) -> dict[str, Any]: updated_at = self.updated_at - user_id: int | None | Unset + user_id: Union[None, Unset, int] if isinstance(self.user_id, Unset): user_id = UNSET else: user_id = self.user_id - details: None | str | Unset + details: Union[None, Unset, str] if isinstance(self.details, Unset): details = UNSET else: details = self.details - user: dict[str, Any] | Unset = UNSET + user: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.user, Unset): user = self.user.to_dict() - incident: dict[str, Any] | None | Unset + incident: Union[None, Unset, dict[str, Any]] if isinstance(self.incident, Unset): incident = UNSET elif isinstance(self.incident, AlertEventIncidentType0): @@ -103,7 +101,7 @@ def to_dict(self) -> dict[str, Any]: else: incident = self.incident - schedule: dict[str, Any] | None | Unset + schedule: Union[None, Unset, dict[str, Any]] if isinstance(self.schedule, Unset): schedule = UNSET elif isinstance(self.schedule, AlertEventScheduleType0): @@ -111,19 +109,19 @@ def to_dict(self) -> dict[str, Any]: else: schedule = self.schedule - escalation_level: int | None | Unset + escalation_level: Union[None, Unset, int] if isinstance(self.escalation_level, Unset): escalation_level = UNSET else: escalation_level = self.escalation_level - escalation_target_type: None | str | Unset + escalation_target_type: Union[None, Unset, str] if isinstance(self.escalation_target_type, Unset): escalation_target_type = UNSET else: escalation_target_type = self.escalation_target_type - escalation_target: dict[str, Any] | None | Unset + escalation_target: Union[None, Unset, dict[str, Any]] if isinstance(self.escalation_target, Unset): escalation_target = UNSET elif isinstance(self.escalation_target, AlertEventEscalationTargetType0): @@ -131,11 +129,11 @@ def to_dict(self) -> dict[str, Any]: else: escalation_target = self.escalation_target - slack_channel: dict[str, Any] | Unset = UNSET + slack_channel: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.slack_channel, Unset): slack_channel = self.slack_channel.to_dict() - incident_ids: list[str] | None | Unset + incident_ids: Union[None, Unset, list[str]] if isinstance(self.incident_ids, Unset): incident_ids = UNSET elif isinstance(self.incident_ids, list): @@ -200,32 +198,32 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: updated_at = d.pop("updated_at") - def _parse_user_id(data: object) -> int | None | Unset: + def _parse_user_id(data: object) -> Union[None, Unset, int]: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(Union[None, Unset, int], data) user_id = _parse_user_id(d.pop("user_id", UNSET)) - def _parse_details(data: object) -> None | str | Unset: + def _parse_details(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) details = _parse_details(d.pop("details", UNSET)) _user = d.pop("user", UNSET) - user: AlertEventUser | Unset + user: Union[Unset, AlertEventUser] if isinstance(_user, Unset): user = UNSET else: user = AlertEventUser.from_dict(_user) - def _parse_incident(data: object) -> AlertEventIncidentType0 | None | Unset: + def _parse_incident(data: object) -> Union["AlertEventIncidentType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -236,13 +234,13 @@ def _parse_incident(data: object) -> AlertEventIncidentType0 | None | Unset: incident_type_0 = AlertEventIncidentType0.from_dict(data) return incident_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(AlertEventIncidentType0 | None | Unset, data) + return cast(Union["AlertEventIncidentType0", None, Unset], data) incident = _parse_incident(d.pop("incident", UNSET)) - def _parse_schedule(data: object) -> AlertEventScheduleType0 | None | Unset: + def _parse_schedule(data: object) -> Union["AlertEventScheduleType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -253,31 +251,31 @@ def _parse_schedule(data: object) -> AlertEventScheduleType0 | None | Unset: schedule_type_0 = AlertEventScheduleType0.from_dict(data) return schedule_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(AlertEventScheduleType0 | None | Unset, data) + return cast(Union["AlertEventScheduleType0", None, Unset], data) schedule = _parse_schedule(d.pop("schedule", UNSET)) - def _parse_escalation_level(data: object) -> int | None | Unset: + def _parse_escalation_level(data: object) -> Union[None, Unset, int]: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(Union[None, Unset, int], data) escalation_level = _parse_escalation_level(d.pop("escalation_level", UNSET)) - def _parse_escalation_target_type(data: object) -> None | str | Unset: + def _parse_escalation_target_type(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) escalation_target_type = _parse_escalation_target_type(d.pop("escalation_target_type", UNSET)) - def _parse_escalation_target(data: object) -> AlertEventEscalationTargetType0 | None | Unset: + def _parse_escalation_target(data: object) -> Union["AlertEventEscalationTargetType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -288,20 +286,20 @@ def _parse_escalation_target(data: object) -> AlertEventEscalationTargetType0 | escalation_target_type_0 = AlertEventEscalationTargetType0.from_dict(data) return escalation_target_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(AlertEventEscalationTargetType0 | None | Unset, data) + return cast(Union["AlertEventEscalationTargetType0", None, Unset], data) escalation_target = _parse_escalation_target(d.pop("escalation_target", UNSET)) _slack_channel = d.pop("slack_channel", UNSET) - slack_channel: SlackChannel | Unset + slack_channel: Union[Unset, SlackChannel] if isinstance(_slack_channel, Unset): slack_channel = UNSET else: slack_channel = SlackChannel.from_dict(_slack_channel) - def _parse_incident_ids(data: object) -> list[str] | None | Unset: + def _parse_incident_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -312,9 +310,9 @@ def _parse_incident_ids(data: object) -> list[str] | None | Unset: incident_ids_type_0 = cast(list[str], data) return incident_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) incident_ids = _parse_incident_ids(d.pop("incident_ids", UNSET)) diff --git a/rootly_sdk/models/alert_event_action.py b/rootly_sdk/models/alert_event_action.py index ed9276ab..4bd1983e 100644 --- a/rootly_sdk/models/alert_event_action.py +++ b/rootly_sdk/models/alert_event_action.py @@ -1,12 +1,14 @@ from typing import Literal, cast AlertEventAction = Literal[ + "ack_timeout_retriggered", "acknowledged", "added", "answered", "attached", "call_lifecycle", "called", + "cleared", "created", "deferred", "emailed", @@ -25,6 +27,7 @@ "paged", "removed", "resolved", + "retrigger_suppressed", "retriggered", "skipped", "slacked", @@ -35,12 +38,14 @@ ] ALERT_EVENT_ACTION_VALUES: set[AlertEventAction] = { + "ack_timeout_retriggered", "acknowledged", "added", "answered", "attached", "call_lifecycle", "called", + "cleared", "created", "deferred", "emailed", @@ -59,6 +64,7 @@ "paged", "removed", "resolved", + "retrigger_suppressed", "retriggered", "skipped", "slacked", diff --git a/rootly_sdk/models/alert_event_escalation_target_type_0.py b/rootly_sdk/models/alert_event_escalation_target_type_0.py index 5d706e96..5cff5b9b 100644 --- a/rootly_sdk/models/alert_event_escalation_target_type_0.py +++ b/rootly_sdk/models/alert_event_escalation_target_type_0.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -20,15 +18,14 @@ class AlertEventEscalationTargetType0: """JSON:API-wrapped escalation target (User or EscalationPolicy). Attributes: - data (AlertEventEscalationTargetType0Data | Unset): + data (Union[Unset, AlertEventEscalationTargetType0Data]): """ - data: AlertEventEscalationTargetType0Data | Unset = UNSET + data: Union[Unset, "AlertEventEscalationTargetType0Data"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - - data: dict[str, Any] | Unset = UNSET + data: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.data, Unset): data = self.data.to_dict() @@ -46,7 +43,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _data = d.pop("data", UNSET) - data: AlertEventEscalationTargetType0Data | Unset + data: Union[Unset, AlertEventEscalationTargetType0Data] if isinstance(_data, Unset): data = UNSET else: diff --git a/rootly_sdk/models/alert_event_escalation_target_type_0_data.py b/rootly_sdk/models/alert_event_escalation_target_type_0_data.py index 70c7da0d..562a35c8 100644 --- a/rootly_sdk/models/alert_event_escalation_target_type_0_data.py +++ b/rootly_sdk/models/alert_event_escalation_target_type_0_data.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,23 +19,22 @@ class AlertEventEscalationTargetType0Data: """ Attributes: - id (str | Unset): - type_ (str | Unset): e.g. users, escalation_policies. - attributes (AlertEventEscalationTargetType0DataAttributes | Unset): + id (Union[Unset, str]): + type_ (Union[Unset, str]): e.g. users, escalation_policies. + attributes (Union[Unset, AlertEventEscalationTargetType0DataAttributes]): """ - id: str | Unset = UNSET - type_: str | Unset = UNSET - attributes: AlertEventEscalationTargetType0DataAttributes | Unset = UNSET + id: Union[Unset, str] = UNSET + type_: Union[Unset, str] = UNSET + attributes: Union[Unset, "AlertEventEscalationTargetType0DataAttributes"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_ = self.type_ - attributes: dict[str, Any] | Unset = UNSET + attributes: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.attributes, Unset): attributes = self.attributes.to_dict() @@ -65,7 +62,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: type_ = d.pop("type", UNSET) _attributes = d.pop("attributes", UNSET) - attributes: AlertEventEscalationTargetType0DataAttributes | Unset + attributes: Union[Unset, AlertEventEscalationTargetType0DataAttributes] if isinstance(_attributes, Unset): attributes = UNSET else: diff --git a/rootly_sdk/models/alert_event_escalation_target_type_0_data_attributes.py b/rootly_sdk/models/alert_event_escalation_target_type_0_data_attributes.py index dc65c652..26c8be3a 100644 --- a/rootly_sdk/models/alert_event_escalation_target_type_0_data_attributes.py +++ b/rootly_sdk/models/alert_event_escalation_target_type_0_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,7 +14,6 @@ class AlertEventEscalationTargetType0DataAttributes: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) diff --git a/rootly_sdk/models/alert_event_feed_list.py b/rootly_sdk/models/alert_event_feed_list.py index bf831ccd..9ecde4c6 100644 --- a/rootly_sdk/models/alert_event_feed_list.py +++ b/rootly_sdk/models/alert_event_feed_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,21 +20,20 @@ class AlertEventFeedList: """ Attributes: - data (list[AlertEventFeedListDataItem]): + data (list['AlertEventFeedListDataItem']): meta (AlertEventFeedMeta): Cursor-pagination meta. `total_count` and `total_pages` are nullable because the feed does not run a COUNT query. - links (Links | Unset): - included (list[JsonapiIncludedResource] | Unset): + links (Union[Unset, Links]): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[AlertEventFeedListDataItem] - meta: AlertEventFeedMeta - links: Links | Unset = UNSET - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["AlertEventFeedListDataItem"] + meta: "AlertEventFeedMeta" + links: Union[Unset, "Links"] = UNSET + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -44,11 +41,11 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - links: dict[str, Any] | Unset = UNSET + links: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.links, Unset): links = self.links.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -88,20 +85,18 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = AlertEventFeedMeta.from_dict(d.pop("meta")) _links = d.pop("links", UNSET) - links: Links | Unset + links: Union[Unset, Links] if isinstance(_links, Unset): links = UNSET else: links = Links.from_dict(_links) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) alert_event_feed_list = cls( data=data, diff --git a/rootly_sdk/models/alert_event_feed_list_data_item.py b/rootly_sdk/models/alert_event_feed_list_data_item.py index acf7a370..7016830c 100644 --- a/rootly_sdk/models/alert_event_feed_list_data_item.py +++ b/rootly_sdk/models/alert_event_feed_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class AlertEventFeedListDataItem: id: str type_: AlertEventFeedListDataItemType - attributes: AlertEvent + attributes: "AlertEvent" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/alert_event_feed_meta.py b/rootly_sdk/models/alert_event_feed_meta.py index cde271b6..871a38db 100644 --- a/rootly_sdk/models/alert_event_feed_meta.py +++ b/rootly_sdk/models/alert_event_feed_meta.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,51 +14,51 @@ class AlertEventFeedMeta: """Cursor-pagination meta. `total_count` and `total_pages` are nullable because the feed does not run a COUNT query. Attributes: - next_cursor (None | str): Pass as `page[after]` on the next request to fetch the following page. - current_page (int | None | Unset): - next_page (int | None | Unset): - prev_page (int | None | Unset): - total_count (int | None | Unset): - total_pages (int | None | Unset): + next_cursor (Union[None, str]): Pass as `page[after]` on the next request to fetch the following page. + current_page (Union[None, Unset, int]): + next_page (Union[None, Unset, int]): + prev_page (Union[None, Unset, int]): + total_count (Union[None, Unset, int]): + total_pages (Union[None, Unset, int]): """ - next_cursor: None | str - current_page: int | None | Unset = UNSET - next_page: int | None | Unset = UNSET - prev_page: int | None | Unset = UNSET - total_count: int | None | Unset = UNSET - total_pages: int | None | Unset = UNSET + next_cursor: Union[None, str] + current_page: Union[None, Unset, int] = UNSET + next_page: Union[None, Unset, int] = UNSET + prev_page: Union[None, Unset, int] = UNSET + total_count: Union[None, Unset, int] = UNSET + total_pages: Union[None, Unset, int] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - next_cursor: None | str + next_cursor: Union[None, str] next_cursor = self.next_cursor - current_page: int | None | Unset + current_page: Union[None, Unset, int] if isinstance(self.current_page, Unset): current_page = UNSET else: current_page = self.current_page - next_page: int | None | Unset + next_page: Union[None, Unset, int] if isinstance(self.next_page, Unset): next_page = UNSET else: next_page = self.next_page - prev_page: int | None | Unset + prev_page: Union[None, Unset, int] if isinstance(self.prev_page, Unset): prev_page = UNSET else: prev_page = self.prev_page - total_count: int | None | Unset + total_count: Union[None, Unset, int] if isinstance(self.total_count, Unset): total_count = UNSET else: total_count = self.total_count - total_pages: int | None | Unset + total_pages: Union[None, Unset, int] if isinstance(self.total_pages, Unset): total_pages = UNSET else: @@ -90,55 +88,55 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_next_cursor(data: object) -> None | str: + def _parse_next_cursor(data: object) -> Union[None, str]: if data is None: return data - return cast(None | str, data) + return cast(Union[None, str], data) next_cursor = _parse_next_cursor(d.pop("next_cursor")) - def _parse_current_page(data: object) -> int | None | Unset: + def _parse_current_page(data: object) -> Union[None, Unset, int]: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(Union[None, Unset, int], data) current_page = _parse_current_page(d.pop("current_page", UNSET)) - def _parse_next_page(data: object) -> int | None | Unset: + def _parse_next_page(data: object) -> Union[None, Unset, int]: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(Union[None, Unset, int], data) next_page = _parse_next_page(d.pop("next_page", UNSET)) - def _parse_prev_page(data: object) -> int | None | Unset: + def _parse_prev_page(data: object) -> Union[None, Unset, int]: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(Union[None, Unset, int], data) prev_page = _parse_prev_page(d.pop("prev_page", UNSET)) - def _parse_total_count(data: object) -> int | None | Unset: + def _parse_total_count(data: object) -> Union[None, Unset, int]: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(Union[None, Unset, int], data) total_count = _parse_total_count(d.pop("total_count", UNSET)) - def _parse_total_pages(data: object) -> int | None | Unset: + def _parse_total_pages(data: object) -> Union[None, Unset, int]: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(Union[None, Unset, int], data) total_pages = _parse_total_pages(d.pop("total_pages", UNSET)) diff --git a/rootly_sdk/models/alert_event_incident_type_0.py b/rootly_sdk/models/alert_event_incident_type_0.py index 902f09f6..2bb19750 100644 --- a/rootly_sdk/models/alert_event_incident_type_0.py +++ b/rootly_sdk/models/alert_event_incident_type_0.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,40 +13,40 @@ class AlertEventIncidentType0: """ Attributes: - id (str | Unset): - sequential_id (int | None | Unset): - title (str | Unset): - slug (str | Unset): - kind (str | Unset): - status (str | Unset): - private (bool | Unset): - description (None | str | Unset): - started_at (None | str | Unset): - duration (int | None | Unset): Duration in seconds. - url (str | Unset): - created_at (str | Unset): - updated_at (str | Unset): + id (Union[Unset, str]): + sequential_id (Union[None, Unset, int]): + title (Union[Unset, str]): + slug (Union[Unset, str]): + kind (Union[Unset, str]): + status (Union[Unset, str]): + private (Union[Unset, bool]): + description (Union[None, Unset, str]): + started_at (Union[None, Unset, str]): + duration (Union[None, Unset, int]): Duration in seconds. + url (Union[Unset, str]): + created_at (Union[Unset, str]): + updated_at (Union[Unset, str]): """ - id: str | Unset = UNSET - sequential_id: int | None | Unset = UNSET - title: str | Unset = UNSET - slug: str | Unset = UNSET - kind: str | Unset = UNSET - status: str | Unset = UNSET - private: bool | Unset = UNSET - description: None | str | Unset = UNSET - started_at: None | str | Unset = UNSET - duration: int | None | Unset = UNSET - url: str | Unset = UNSET - created_at: str | Unset = UNSET - updated_at: str | Unset = UNSET + id: Union[Unset, str] = UNSET + sequential_id: Union[None, Unset, int] = UNSET + title: Union[Unset, str] = UNSET + slug: Union[Unset, str] = UNSET + kind: Union[Unset, str] = UNSET + status: Union[Unset, str] = UNSET + private: Union[Unset, bool] = UNSET + description: Union[None, Unset, str] = UNSET + started_at: Union[None, Unset, str] = UNSET + duration: Union[None, Unset, int] = UNSET + url: Union[Unset, str] = UNSET + created_at: Union[Unset, str] = UNSET + updated_at: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: id = self.id - sequential_id: int | None | Unset + sequential_id: Union[None, Unset, int] if isinstance(self.sequential_id, Unset): sequential_id = UNSET else: @@ -64,19 +62,19 @@ def to_dict(self) -> dict[str, Any]: private = self.private - description: None | str | Unset + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: description = self.description - started_at: None | str | Unset + started_at: Union[None, Unset, str] if isinstance(self.started_at, Unset): started_at = UNSET else: started_at = self.started_at - duration: int | None | Unset + duration: Union[None, Unset, int] if isinstance(self.duration, Unset): duration = UNSET else: @@ -125,12 +123,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) id = d.pop("id", UNSET) - def _parse_sequential_id(data: object) -> int | None | Unset: + def _parse_sequential_id(data: object) -> Union[None, Unset, int]: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(Union[None, Unset, int], data) sequential_id = _parse_sequential_id(d.pop("sequential_id", UNSET)) @@ -144,30 +142,30 @@ def _parse_sequential_id(data: object) -> int | None | Unset: private = d.pop("private", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) - def _parse_started_at(data: object) -> None | str | Unset: + def _parse_started_at(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) started_at = _parse_started_at(d.pop("started_at", UNSET)) - def _parse_duration(data: object) -> int | None | Unset: + def _parse_duration(data: object) -> Union[None, Unset, int]: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(Union[None, Unset, int], data) duration = _parse_duration(d.pop("duration", UNSET)) diff --git a/rootly_sdk/models/alert_event_list.py b/rootly_sdk/models/alert_event_list.py index 796c0bfd..4570a8ec 100644 --- a/rootly_sdk/models/alert_event_list.py +++ b/rootly_sdk/models/alert_event_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,20 +20,19 @@ class AlertEventList: """ Attributes: - data (list[AlertEventListDataItem]): + data (list['AlertEventListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[AlertEventListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["AlertEventListDataItem"] + links: "Links" + meta: "Meta" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) alert_event_list = cls( data=data, diff --git a/rootly_sdk/models/alert_event_list_data_item.py b/rootly_sdk/models/alert_event_list_data_item.py index 3691da9b..9228289f 100644 --- a/rootly_sdk/models/alert_event_list_data_item.py +++ b/rootly_sdk/models/alert_event_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class AlertEventListDataItem: id: str type_: AlertEventListDataItemType - attributes: AlertEvent + attributes: "AlertEvent" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/alert_event_response.py b/rootly_sdk/models/alert_event_response.py index 95a9e35b..a50f0426 100644 --- a/rootly_sdk/models/alert_event_response.py +++ b/rootly_sdk/models/alert_event_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,18 +19,17 @@ class AlertEventResponse: """ Attributes: data (AlertEventResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: AlertEventResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "AlertEventResponseData" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = AlertEventResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) alert_event_response = cls( data=data, diff --git a/rootly_sdk/models/alert_event_response_data.py b/rootly_sdk/models/alert_event_response_data.py index 5fddf97f..7bb109dc 100644 --- a/rootly_sdk/models/alert_event_response_data.py +++ b/rootly_sdk/models/alert_event_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class AlertEventResponseData: id: str type_: AlertEventResponseDataType - attributes: AlertEvent + attributes: "AlertEvent" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/alert_event_schedule_type_0.py b/rootly_sdk/models/alert_event_schedule_type_0.py index fb8c5b4c..a65b967e 100644 --- a/rootly_sdk/models/alert_event_schedule_type_0.py +++ b/rootly_sdk/models/alert_event_schedule_type_0.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,35 +19,34 @@ class AlertEventScheduleType0: """ Attributes: - id (str | Unset): - name (str | Unset): - description (None | str | Unset): - escalation_policies (list[AlertEventScheduleType0EscalationPoliciesItem] | Unset): - created_at (str | Unset): - updated_at (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): + description (Union[None, Unset, str]): + escalation_policies (Union[Unset, list['AlertEventScheduleType0EscalationPoliciesItem']]): + created_at (Union[Unset, str]): + updated_at (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET - description: None | str | Unset = UNSET - escalation_policies: list[AlertEventScheduleType0EscalationPoliciesItem] | Unset = UNSET - created_at: str | Unset = UNSET - updated_at: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET + description: Union[None, Unset, str] = UNSET + escalation_policies: Union[Unset, list["AlertEventScheduleType0EscalationPoliciesItem"]] = UNSET + created_at: Union[Unset, str] = UNSET + updated_at: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id name = self.name - description: None | str | Unset + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: description = self.description - escalation_policies: list[dict[str, Any]] | Unset = UNSET + escalation_policies: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.escalation_policies, Unset): escalation_policies = [] for escalation_policies_item_data in self.escalation_policies: @@ -89,25 +86,23 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name = d.pop("name", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) + escalation_policies = [] _escalation_policies = d.pop("escalation_policies", UNSET) - escalation_policies: list[AlertEventScheduleType0EscalationPoliciesItem] | Unset = UNSET - if _escalation_policies is not UNSET: - escalation_policies = [] - for escalation_policies_item_data in _escalation_policies: - escalation_policies_item = AlertEventScheduleType0EscalationPoliciesItem.from_dict( - escalation_policies_item_data - ) + for escalation_policies_item_data in _escalation_policies or []: + escalation_policies_item = AlertEventScheduleType0EscalationPoliciesItem.from_dict( + escalation_policies_item_data + ) - escalation_policies.append(escalation_policies_item) + escalation_policies.append(escalation_policies_item) created_at = d.pop("created_at", UNSET) diff --git a/rootly_sdk/models/alert_event_schedule_type_0_escalation_policies_item.py b/rootly_sdk/models/alert_event_schedule_type_0_escalation_policies_item.py index 3f33fcf9..7a3b3551 100644 --- a/rootly_sdk/models/alert_event_schedule_type_0_escalation_policies_item.py +++ b/rootly_sdk/models/alert_event_schedule_type_0_escalation_policies_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,16 +13,16 @@ class AlertEventScheduleType0EscalationPoliciesItem: """ Attributes: - id (str | Unset): - name (str | Unset): - created_at (str | Unset): - updated_at (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): + created_at (Union[Unset, str]): + updated_at (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET - created_at: str | Unset = UNSET - updated_at: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET + created_at: Union[Unset, str] = UNSET + updated_at: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/alert_event_user.py b/rootly_sdk/models/alert_event_user.py index d299cff7..2ccae8c8 100644 --- a/rootly_sdk/models/alert_event_user.py +++ b/rootly_sdk/models/alert_event_user.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -20,11 +18,11 @@ class AlertEventUser: email (str): created_at (str): updated_at (str): - first_name (None | str | Unset): - last_name (None | str | Unset): - preferred_name (None | str | Unset): - full_name (None | str | Unset): - time_zone (None | str | Unset): + first_name (Union[None, Unset, str]): + last_name (Union[None, Unset, str]): + preferred_name (Union[None, Unset, str]): + full_name (Union[None, Unset, str]): + time_zone (Union[None, Unset, str]): """ id: int @@ -32,11 +30,11 @@ class AlertEventUser: email: str created_at: str updated_at: str - first_name: None | str | Unset = UNSET - last_name: None | str | Unset = UNSET - preferred_name: None | str | Unset = UNSET - full_name: None | str | Unset = UNSET - time_zone: None | str | Unset = UNSET + first_name: Union[None, Unset, str] = UNSET + last_name: Union[None, Unset, str] = UNSET + preferred_name: Union[None, Unset, str] = UNSET + full_name: Union[None, Unset, str] = UNSET + time_zone: Union[None, Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -50,31 +48,31 @@ def to_dict(self) -> dict[str, Any]: updated_at = self.updated_at - first_name: None | str | Unset + first_name: Union[None, Unset, str] if isinstance(self.first_name, Unset): first_name = UNSET else: first_name = self.first_name - last_name: None | str | Unset + last_name: Union[None, Unset, str] if isinstance(self.last_name, Unset): last_name = UNSET else: last_name = self.last_name - preferred_name: None | str | Unset + preferred_name: Union[None, Unset, str] if isinstance(self.preferred_name, Unset): preferred_name = UNSET else: preferred_name = self.preferred_name - full_name: None | str | Unset + full_name: Union[None, Unset, str] if isinstance(self.full_name, Unset): full_name = UNSET else: full_name = self.full_name - time_zone: None | str | Unset + time_zone: Union[None, Unset, str] if isinstance(self.time_zone, Unset): time_zone = UNSET else: @@ -117,48 +115,48 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: updated_at = d.pop("updated_at") - def _parse_first_name(data: object) -> None | str | Unset: + def _parse_first_name(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) first_name = _parse_first_name(d.pop("first_name", UNSET)) - def _parse_last_name(data: object) -> None | str | Unset: + def _parse_last_name(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) last_name = _parse_last_name(d.pop("last_name", UNSET)) - def _parse_preferred_name(data: object) -> None | str | Unset: + def _parse_preferred_name(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) preferred_name = _parse_preferred_name(d.pop("preferred_name", UNSET)) - def _parse_full_name(data: object) -> None | str | Unset: + def _parse_full_name(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) full_name = _parse_full_name(d.pop("full_name", UNSET)) - def _parse_time_zone(data: object) -> None | str | Unset: + def _parse_time_zone(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) time_zone = _parse_time_zone(d.pop("time_zone", UNSET)) diff --git a/rootly_sdk/models/alert_field.py b/rootly_sdk/models/alert_field.py index 57d6df37..ed5413df 100644 --- a/rootly_sdk/models/alert_field.py +++ b/rootly_sdk/models/alert_field.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,14 +17,14 @@ class AlertField: kind (str): The kind of alert field created_at (str): Date of creation updated_at (str): Date of last update - slug (str | Unset): The slug of the alert field + slug (Union[Unset, str]): The slug of the alert field """ name: str kind: str created_at: str updated_at: str - slug: str | Unset = UNSET + slug: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/alert_field_list.py b/rootly_sdk/models/alert_field_list.py index 24964325..9bdbf254 100644 --- a/rootly_sdk/models/alert_field_list.py +++ b/rootly_sdk/models/alert_field_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,20 +20,19 @@ class AlertFieldList: """ Attributes: - data (list[AlertFieldListDataItem]): + data (list['AlertFieldListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[AlertFieldListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["AlertFieldListDataItem"] + links: "Links" + meta: "Meta" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) alert_field_list = cls( data=data, diff --git a/rootly_sdk/models/alert_field_list_data_item.py b/rootly_sdk/models/alert_field_list_data_item.py index 86f5e2a0..f1b8c603 100644 --- a/rootly_sdk/models/alert_field_list_data_item.py +++ b/rootly_sdk/models/alert_field_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class AlertFieldListDataItem: id: str type_: AlertFieldListDataItemType - attributes: AlertField + attributes: "AlertField" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/alert_field_response.py b/rootly_sdk/models/alert_field_response.py index 17f1725b..19183d6c 100644 --- a/rootly_sdk/models/alert_field_response.py +++ b/rootly_sdk/models/alert_field_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,18 +19,17 @@ class AlertFieldResponse: """ Attributes: data (AlertFieldResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: AlertFieldResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "AlertFieldResponseData" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = AlertFieldResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) alert_field_response = cls( data=data, diff --git a/rootly_sdk/models/alert_field_response_data.py b/rootly_sdk/models/alert_field_response_data.py index ab7e7923..b8e455db 100644 --- a/rootly_sdk/models/alert_field_response_data.py +++ b/rootly_sdk/models/alert_field_response_data.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,16 +20,15 @@ class AlertFieldResponseData: Attributes: type_ (AlertFieldResponseDataType): attributes (AlertField): - id (str | Unset): The ID of the alert field + id (Union[Unset, str]): The ID of the alert field """ type_: AlertFieldResponseDataType - attributes: AlertField - id: str | Unset = UNSET + attributes: "AlertField" + id: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/alert_group.py b/rootly_sdk/models/alert_group.py index 9a198b9c..4aac20b1 100644 --- a/rootly_sdk/models/alert_group.py +++ b/rootly_sdk/models/alert_group.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,43 +20,42 @@ class AlertGroup: """ Attributes: name (str): The name of the alert group - description (None | str): The description of the alert group + description (Union[None, str]): The description of the alert group condition_type (str): Grouping condition for the alert group time_window (int): Time window for the alert grouping created_at (str): Date of creation updated_at (str): Date of last update - deleted_at (None | str): Date or deletion - slug (str | Unset): The slug of the alert group - group_by_alert_title (bool | Unset): [DEPRECATED] Whether the alerts are grouped by title or not. This field is - deprecated. Please use the `conditions` field with advanced alert grouping instead. - group_by_alert_urgency (bool | Unset): [DEPRECATED] Whether the alerts are grouped by urgency or not. This field - is deprecated. Please use the `conditions` field with advanced alert grouping instead. - targets (list[AlertGroupTargetsItem] | Unset): - attributes (list[AlertGroupAttributesItem] | Unset): This field is deprecated. Please use the `conditions` field - instead, `attributes` will be removed in the future. - conditions (list[AlertGroupConditionsItem] | Unset): The conditions for the alert group + deleted_at (Union[None, str]): Date or deletion + slug (Union[Unset, str]): The slug of the alert group + group_by_alert_title (Union[Unset, bool]): [DEPRECATED] Whether the alerts are grouped by title or not. This + field is deprecated. Please use the `conditions` field with advanced alert grouping instead. + group_by_alert_urgency (Union[Unset, bool]): [DEPRECATED] Whether the alerts are grouped by urgency or not. This + field is deprecated. Please use the `conditions` field with advanced alert grouping instead. + targets (Union[Unset, list['AlertGroupTargetsItem']]): + attributes (Union[Unset, list['AlertGroupAttributesItem']]): This field is deprecated. Please use the + `conditions` field instead, `attributes` will be removed in the future. + conditions (Union[Unset, list['AlertGroupConditionsItem']]): The conditions for the alert group """ name: str - description: None | str + description: Union[None, str] condition_type: str time_window: int created_at: str updated_at: str - deleted_at: None | str - slug: str | Unset = UNSET - group_by_alert_title: bool | Unset = UNSET - group_by_alert_urgency: bool | Unset = UNSET - targets: list[AlertGroupTargetsItem] | Unset = UNSET - attributes: list[AlertGroupAttributesItem] | Unset = UNSET - conditions: list[AlertGroupConditionsItem] | Unset = UNSET + deleted_at: Union[None, str] + slug: Union[Unset, str] = UNSET + group_by_alert_title: Union[Unset, bool] = UNSET + group_by_alert_urgency: Union[Unset, bool] = UNSET + targets: Union[Unset, list["AlertGroupTargetsItem"]] = UNSET + attributes: Union[Unset, list["AlertGroupAttributesItem"]] = UNSET + conditions: Union[Unset, list["AlertGroupConditionsItem"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - name = self.name - description: None | str + description: Union[None, str] description = self.description condition_type = self.condition_type @@ -69,7 +66,7 @@ def to_dict(self) -> dict[str, Any]: updated_at = self.updated_at - deleted_at: None | str + deleted_at: Union[None, str] deleted_at = self.deleted_at slug = self.slug @@ -78,21 +75,21 @@ def to_dict(self) -> dict[str, Any]: group_by_alert_urgency = self.group_by_alert_urgency - targets: list[dict[str, Any]] | Unset = UNSET + targets: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.targets, Unset): targets = [] for targets_item_data in self.targets: targets_item = targets_item_data.to_dict() targets.append(targets_item) - attributes: list[dict[str, Any]] | Unset = UNSET + attributes: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.attributes, Unset): attributes = [] for attributes_item_data in self.attributes: attributes_item = attributes_item_data.to_dict() attributes.append(attributes_item) - conditions: list[dict[str, Any]] | Unset = UNSET + conditions: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.conditions, Unset): conditions = [] for conditions_item_data in self.conditions: @@ -136,10 +133,10 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name") - def _parse_description(data: object) -> None | str: + def _parse_description(data: object) -> Union[None, str]: if data is None: return data - return cast(None | str, data) + return cast(Union[None, str], data) description = _parse_description(d.pop("description")) @@ -151,10 +148,10 @@ def _parse_description(data: object) -> None | str: updated_at = d.pop("updated_at") - def _parse_deleted_at(data: object) -> None | str: + def _parse_deleted_at(data: object) -> Union[None, str]: if data is None: return data - return cast(None | str, data) + return cast(Union[None, str], data) deleted_at = _parse_deleted_at(d.pop("deleted_at")) @@ -164,32 +161,26 @@ def _parse_deleted_at(data: object) -> None | str: group_by_alert_urgency = d.pop("group_by_alert_urgency", UNSET) + targets = [] _targets = d.pop("targets", UNSET) - targets: list[AlertGroupTargetsItem] | Unset = UNSET - if _targets is not UNSET: - targets = [] - for targets_item_data in _targets: - targets_item = AlertGroupTargetsItem.from_dict(targets_item_data) + for targets_item_data in _targets or []: + targets_item = AlertGroupTargetsItem.from_dict(targets_item_data) - targets.append(targets_item) + targets.append(targets_item) + attributes = [] _attributes = d.pop("attributes", UNSET) - attributes: list[AlertGroupAttributesItem] | Unset = UNSET - if _attributes is not UNSET: - attributes = [] - for attributes_item_data in _attributes: - attributes_item = AlertGroupAttributesItem.from_dict(attributes_item_data) + for attributes_item_data in _attributes or []: + attributes_item = AlertGroupAttributesItem.from_dict(attributes_item_data) - attributes.append(attributes_item) + attributes.append(attributes_item) + conditions = [] _conditions = d.pop("conditions", UNSET) - conditions: list[AlertGroupConditionsItem] | Unset = UNSET - if _conditions is not UNSET: - conditions = [] - for conditions_item_data in _conditions: - conditions_item = AlertGroupConditionsItem.from_dict(conditions_item_data) + for conditions_item_data in _conditions or []: + conditions_item = AlertGroupConditionsItem.from_dict(conditions_item_data) - conditions.append(conditions_item) + conditions.append(conditions_item) alert_group = cls( name=name, diff --git a/rootly_sdk/models/alert_group_attributes_item.py b/rootly_sdk/models/alert_group_attributes_item.py index 574f2129..5a12e82e 100644 --- a/rootly_sdk/models/alert_group_attributes_item.py +++ b/rootly_sdk/models/alert_group_attributes_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,10 +13,10 @@ class AlertGroupAttributesItem: """ Attributes: - json_path (str | Unset): The JSON path to the value to group by. + json_path (Union[Unset, str]): The JSON path to the value to group by. """ - json_path: str | Unset = UNSET + json_path: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/alert_group_conditions_item.py b/rootly_sdk/models/alert_group_conditions_item.py index 7a2c80f7..09ffad5a 100644 --- a/rootly_sdk/models/alert_group_conditions_item.py +++ b/rootly_sdk/models/alert_group_conditions_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -34,32 +32,32 @@ class AlertGroupConditionsItem: property_field_type (AlertGroupConditionsItemPropertyFieldType): The type of the property field property_field_condition_type (AlertGroupConditionsItemPropertyFieldConditionType): The condition type of the property field - property_field_name (None | str | Unset): The name of the property field. If the property field type is selected - as 'attribute', then the allowed property field names are 'summary' (for Title), 'description', 'alert_urgency' - and 'external_url' (for Alert Source URL). If the property field type is selected as 'payload', then the - property field name should be supplied in JSON Path syntax. - property_field_value (None | str | Unset): The value of the property field. Can be null if the property field - condition type is 'is_one_of' or 'is_not_one_of' - property_field_values (list[str] | Unset): The values of the property field. Used if the property field + property_field_name (Union[None, Unset, str]): The name of the property field. If the property field type is + selected as 'attribute', then the allowed property field names are 'summary' (for Title), 'description', + 'alert_urgency' and 'external_url' (for Alert Source URL). If the property field type is selected as 'payload', + then the property field name should be supplied in JSON Path syntax. + property_field_value (Union[None, Unset, str]): The value of the property field. Can be null if the property + field condition type is 'is_one_of' or 'is_not_one_of' + property_field_values (Union[Unset, list[str]]): The values of the property field. Used if the property field condition type is 'is_one_of' or 'is_not_one_of' except for when property field name is 'alert_urgency' - values (list[AlertGroupConditionsItemValuesItemType0 | None] | Unset): - alert_urgency_ids (list[str] | None | Unset): The Alert Urgency IDs to check in the condition. Only need to be - set when the property field type is 'attribute', the property field name is 'alert_urgency' and the property + values (Union[Unset, list[Union['AlertGroupConditionsItemValuesItemType0', None]]]): + alert_urgency_ids (Union[None, Unset, list[str]]): The Alert Urgency IDs to check in the condition. Only need to + be set when the property field type is 'attribute', the property field name is 'alert_urgency' and the property field condition type is 'is_one_of' or 'is_not_one_of' - conditionable_type (AlertGroupConditionsItemConditionableType | Unset): The type of the conditionable - conditionable_id (None | str | Unset): The ID of the conditionable. If conditionable_type is AlertField, this is - the ID of the alert field. + conditionable_type (Union[Unset, AlertGroupConditionsItemConditionableType]): The type of the conditionable + conditionable_id (Union[None, Unset, str]): The ID of the conditionable. If conditionable_type is AlertField, + this is the ID of the alert field. """ property_field_type: AlertGroupConditionsItemPropertyFieldType property_field_condition_type: AlertGroupConditionsItemPropertyFieldConditionType - property_field_name: None | str | Unset = UNSET - property_field_value: None | str | Unset = UNSET - property_field_values: list[str] | Unset = UNSET - values: list[AlertGroupConditionsItemValuesItemType0 | None] | Unset = UNSET - alert_urgency_ids: list[str] | None | Unset = UNSET - conditionable_type: AlertGroupConditionsItemConditionableType | Unset = UNSET - conditionable_id: None | str | Unset = UNSET + property_field_name: Union[None, Unset, str] = UNSET + property_field_value: Union[None, Unset, str] = UNSET + property_field_values: Union[Unset, list[str]] = UNSET + values: Union[Unset, list[Union["AlertGroupConditionsItemValuesItemType0", None]]] = UNSET + alert_urgency_ids: Union[None, Unset, list[str]] = UNSET + conditionable_type: Union[Unset, AlertGroupConditionsItemConditionableType] = UNSET + conditionable_id: Union[None, Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -69,34 +67,34 @@ def to_dict(self) -> dict[str, Any]: property_field_condition_type: str = self.property_field_condition_type - property_field_name: None | str | Unset + property_field_name: Union[None, Unset, str] if isinstance(self.property_field_name, Unset): property_field_name = UNSET else: property_field_name = self.property_field_name - property_field_value: None | str | Unset + property_field_value: Union[None, Unset, str] if isinstance(self.property_field_value, Unset): property_field_value = UNSET else: property_field_value = self.property_field_value - property_field_values: list[str] | Unset = UNSET + property_field_values: Union[Unset, list[str]] = UNSET if not isinstance(self.property_field_values, Unset): property_field_values = self.property_field_values - values: list[dict[str, Any] | None] | Unset = UNSET + values: Union[Unset, list[Union[None, dict[str, Any]]]] = UNSET if not isinstance(self.values, Unset): values = [] for values_item_data in self.values: - values_item: dict[str, Any] | None + values_item: Union[None, dict[str, Any]] if isinstance(values_item_data, AlertGroupConditionsItemValuesItemType0): values_item = values_item_data.to_dict() else: values_item = values_item_data values.append(values_item) - alert_urgency_ids: list[str] | None | Unset + alert_urgency_ids: Union[None, Unset, list[str]] if isinstance(self.alert_urgency_ids, Unset): alert_urgency_ids = UNSET elif isinstance(self.alert_urgency_ids, list): @@ -105,11 +103,11 @@ def to_dict(self) -> dict[str, Any]: else: alert_urgency_ids = self.alert_urgency_ids - conditionable_type: str | Unset = UNSET + conditionable_type: Union[Unset, str] = UNSET if not isinstance(self.conditionable_type, Unset): conditionable_type = self.conditionable_type - conditionable_id: None | str | Unset + conditionable_id: Union[None, Unset, str] if isinstance(self.conditionable_id, Unset): conditionable_id = UNSET else: @@ -151,50 +149,48 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d.pop("property_field_condition_type") ) - def _parse_property_field_name(data: object) -> None | str | Unset: + def _parse_property_field_name(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) property_field_name = _parse_property_field_name(d.pop("property_field_name", UNSET)) - def _parse_property_field_value(data: object) -> None | str | Unset: + def _parse_property_field_value(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) property_field_value = _parse_property_field_value(d.pop("property_field_value", UNSET)) property_field_values = cast(list[str], d.pop("property_field_values", UNSET)) + values = [] _values = d.pop("values", UNSET) - values: list[AlertGroupConditionsItemValuesItemType0 | None] | Unset = UNSET - if _values is not UNSET: - values = [] - for values_item_data in _values: + for values_item_data in _values or []: - def _parse_values_item(data: object) -> AlertGroupConditionsItemValuesItemType0 | None: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - values_item_type_0 = AlertGroupConditionsItemValuesItemType0.from_dict(data) + def _parse_values_item(data: object) -> Union["AlertGroupConditionsItemValuesItemType0", None]: + if data is None: + return data + try: + if not isinstance(data, dict): + raise TypeError() + values_item_type_0 = AlertGroupConditionsItemValuesItemType0.from_dict(data) - return values_item_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(AlertGroupConditionsItemValuesItemType0 | None, data) + return values_item_type_0 + except: # noqa: E722 + pass + return cast(Union["AlertGroupConditionsItemValuesItemType0", None], data) - values_item = _parse_values_item(values_item_data) + values_item = _parse_values_item(values_item_data) - values.append(values_item) + values.append(values_item) - def _parse_alert_urgency_ids(data: object) -> list[str] | None | Unset: + def _parse_alert_urgency_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -205,25 +201,25 @@ def _parse_alert_urgency_ids(data: object) -> list[str] | None | Unset: alert_urgency_ids_type_0 = cast(list[str], data) return alert_urgency_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) alert_urgency_ids = _parse_alert_urgency_ids(d.pop("alert_urgency_ids", UNSET)) _conditionable_type = d.pop("conditionable_type", UNSET) - conditionable_type: AlertGroupConditionsItemConditionableType | Unset + conditionable_type: Union[Unset, AlertGroupConditionsItemConditionableType] if isinstance(_conditionable_type, Unset): conditionable_type = UNSET else: conditionable_type = check_alert_group_conditions_item_conditionable_type(_conditionable_type) - def _parse_conditionable_id(data: object) -> None | str | Unset: + def _parse_conditionable_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) conditionable_id = _parse_conditionable_id(d.pop("conditionable_id", UNSET)) diff --git a/rootly_sdk/models/alert_group_conditions_item_values_item_type_0.py b/rootly_sdk/models/alert_group_conditions_item_values_item_type_0.py index a2bb4948..23ed1e3a 100644 --- a/rootly_sdk/models/alert_group_conditions_item_values_item_type_0.py +++ b/rootly_sdk/models/alert_group_conditions_item_values_item_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/alert_group_list.py b/rootly_sdk/models/alert_group_list.py index bbf287d9..666271b7 100644 --- a/rootly_sdk/models/alert_group_list.py +++ b/rootly_sdk/models/alert_group_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -20,22 +18,21 @@ class AlertGroupList: """ Attributes: - data (list[AlertGroupListDataItem]): - included (list[JsonapiIncludedResource] | Unset): + data (list['AlertGroupListDataItem']): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[AlertGroupListDataItem] - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["AlertGroupListDataItem"] + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() data.append(data_item) - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -67,14 +64,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data.append(data_item) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) alert_group_list = cls( data=data, diff --git a/rootly_sdk/models/alert_group_list_data_item.py b/rootly_sdk/models/alert_group_list_data_item.py index 47de586a..f526ed60 100644 --- a/rootly_sdk/models/alert_group_list_data_item.py +++ b/rootly_sdk/models/alert_group_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class AlertGroupListDataItem: id: str type_: AlertGroupListDataItemType - attributes: AlertGroup + attributes: "AlertGroup" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/alert_group_response.py b/rootly_sdk/models/alert_group_response.py index 5c9c2520..052d2fe5 100644 --- a/rootly_sdk/models/alert_group_response.py +++ b/rootly_sdk/models/alert_group_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,18 +19,17 @@ class AlertGroupResponse: """ Attributes: data (AlertGroupResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: AlertGroupResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "AlertGroupResponseData" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = AlertGroupResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) alert_group_response = cls( data=data, diff --git a/rootly_sdk/models/alert_group_response_data.py b/rootly_sdk/models/alert_group_response_data.py index 8d3b3d49..96a04949 100644 --- a/rootly_sdk/models/alert_group_response_data.py +++ b/rootly_sdk/models/alert_group_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class AlertGroupResponseData: id: str type_: AlertGroupResponseDataType - attributes: AlertGroup + attributes: "AlertGroup" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/alert_group_targets_item.py b/rootly_sdk/models/alert_group_targets_item.py index 1d7557d3..8083603f 100644 --- a/rootly_sdk/models/alert_group_targets_item.py +++ b/rootly_sdk/models/alert_group_targets_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar from uuid import UUID diff --git a/rootly_sdk/models/alert_labels_item_type_0.py b/rootly_sdk/models/alert_labels_item_type_0.py index 432ad1f0..5c38de65 100644 --- a/rootly_sdk/models/alert_labels_item_type_0.py +++ b/rootly_sdk/models/alert_labels_item_type_0.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -14,17 +12,17 @@ class AlertLabelsItemType0: """ Attributes: key (str): Key of the tag - value (bool | float | str): Value of the tag + value (Union[bool, float, str]): Value of the tag """ key: str - value: bool | float | str + value: Union[bool, float, str] additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: key = self.key - value: bool | float | str + value: Union[bool, float, str] value = self.value field_dict: dict[str, Any] = {} @@ -43,8 +41,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) key = d.pop("key") - def _parse_value(data: object) -> bool | float | str: - return cast(bool | float | str, data) + def _parse_value(data: object) -> Union[bool, float, str]: + return cast(Union[bool, float, str], data) value = _parse_value(d.pop("value")) diff --git a/rootly_sdk/models/alert_list.py b/rootly_sdk/models/alert_list.py index e56e45f3..e1fb545e 100644 --- a/rootly_sdk/models/alert_list.py +++ b/rootly_sdk/models/alert_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,20 +20,19 @@ class AlertList: """ Attributes: - data (list[AlertListDataItem]): + data (list['AlertListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[AlertListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["AlertListDataItem"] + links: "Links" + meta: "Meta" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) alert_list = cls( data=data, diff --git a/rootly_sdk/models/alert_list_data_item.py b/rootly_sdk/models/alert_list_data_item.py index 4f9d74d7..ad55285d 100644 --- a/rootly_sdk/models/alert_list_data_item.py +++ b/rootly_sdk/models/alert_list_data_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,17 +21,16 @@ class AlertListDataItem: id (str): Unique ID of the alert type_ (AlertListDataItemType): attributes (Alert): - source (str | Unset): The source of the alert + source (Union[Unset, str]): The source of the alert """ id: str type_: AlertListDataItemType - attributes: Alert - source: str | Unset = UNSET + attributes: "Alert" + source: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/alert_response.py b/rootly_sdk/models/alert_response.py index f165c1b4..1b7500b5 100644 --- a/rootly_sdk/models/alert_response.py +++ b/rootly_sdk/models/alert_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,18 +19,17 @@ class AlertResponse: """ Attributes: data (AlertResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: AlertResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "AlertResponseData" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = AlertResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) alert_response = cls( data=data, diff --git a/rootly_sdk/models/alert_response_data.py b/rootly_sdk/models/alert_response_data.py index c5700bfe..2f8d1f1f 100644 --- a/rootly_sdk/models/alert_response_data.py +++ b/rootly_sdk/models/alert_response_data.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,17 +21,16 @@ class AlertResponseData: id (str): Unique ID of the alert type_ (AlertResponseDataType): attributes (Alert): - source (str | Unset): The source of the alert + source (Union[Unset, str]): The source of the alert """ id: str type_: AlertResponseDataType - attributes: Alert - source: str | Unset = UNSET + attributes: "Alert" + source: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/alert_retrigger_rule.py b/rootly_sdk/models/alert_retrigger_rule.py new file mode 100644 index 00000000..7eee14c3 --- /dev/null +++ b/rootly_sdk/models/alert_retrigger_rule.py @@ -0,0 +1,165 @@ +import datetime +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field +from dateutil.parser import isoparse + +from ..models.alert_retrigger_rule_match_mode import AlertRetriggerRuleMatchMode, check_alert_retrigger_rule_match_mode +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.alert_retrigger_rule_conditions_item import AlertRetriggerRuleConditionsItem + + +T = TypeVar("T", bound="AlertRetriggerRule") + + +@_attrs_define +class AlertRetriggerRule: + """ + Attributes: + name (Union[Unset, str]): A human-readable name for the rule + match_mode (Union[Unset, AlertRetriggerRuleMatchMode]): Whether all or any of the conditions must match + timeout_minutes (Union[None, Unset, int]): Minutes after acknowledgment to re-trigger. Null means never re- + trigger. + position (Union[Unset, int]): The position of the rule for ordering evaluation + conditions (Union[Unset, list['AlertRetriggerRuleConditionsItem']]): The conditions for the rule + created_at (Union[Unset, datetime.datetime]): + updated_at (Union[Unset, datetime.datetime]): + """ + + name: Union[Unset, str] = UNSET + match_mode: Union[Unset, AlertRetriggerRuleMatchMode] = UNSET + timeout_minutes: Union[None, Unset, int] = UNSET + position: Union[Unset, int] = UNSET + conditions: Union[Unset, list["AlertRetriggerRuleConditionsItem"]] = UNSET + created_at: Union[Unset, datetime.datetime] = UNSET + updated_at: Union[Unset, datetime.datetime] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + name = self.name + + match_mode: Union[Unset, str] = UNSET + if not isinstance(self.match_mode, Unset): + match_mode = self.match_mode + + timeout_minutes: Union[None, Unset, int] + if isinstance(self.timeout_minutes, Unset): + timeout_minutes = UNSET + else: + timeout_minutes = self.timeout_minutes + + position = self.position + + conditions: Union[Unset, list[dict[str, Any]]] = UNSET + if not isinstance(self.conditions, Unset): + conditions = [] + for conditions_item_data in self.conditions: + conditions_item = conditions_item_data.to_dict() + conditions.append(conditions_item) + + created_at: Union[Unset, str] = UNSET + if not isinstance(self.created_at, Unset): + created_at = self.created_at.isoformat() + + updated_at: Union[Unset, str] = UNSET + if not isinstance(self.updated_at, Unset): + updated_at = self.updated_at.isoformat() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if name is not UNSET: + field_dict["name"] = name + if match_mode is not UNSET: + field_dict["match_mode"] = match_mode + if timeout_minutes is not UNSET: + field_dict["timeout_minutes"] = timeout_minutes + if position is not UNSET: + field_dict["position"] = position + if conditions is not UNSET: + field_dict["conditions"] = conditions + if created_at is not UNSET: + field_dict["created_at"] = created_at + if updated_at is not UNSET: + field_dict["updated_at"] = updated_at + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.alert_retrigger_rule_conditions_item import AlertRetriggerRuleConditionsItem + + d = dict(src_dict) + name = d.pop("name", UNSET) + + _match_mode = d.pop("match_mode", UNSET) + match_mode: Union[Unset, AlertRetriggerRuleMatchMode] + if isinstance(_match_mode, Unset): + match_mode = UNSET + else: + match_mode = check_alert_retrigger_rule_match_mode(_match_mode) + + def _parse_timeout_minutes(data: object) -> Union[None, Unset, int]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, int], data) + + timeout_minutes = _parse_timeout_minutes(d.pop("timeout_minutes", UNSET)) + + position = d.pop("position", UNSET) + + conditions = [] + _conditions = d.pop("conditions", UNSET) + for conditions_item_data in _conditions or []: + conditions_item = AlertRetriggerRuleConditionsItem.from_dict(conditions_item_data) + + conditions.append(conditions_item) + + _created_at = d.pop("created_at", UNSET) + created_at: Union[Unset, datetime.datetime] + if isinstance(_created_at, Unset): + created_at = UNSET + else: + created_at = isoparse(_created_at) + + _updated_at = d.pop("updated_at", UNSET) + updated_at: Union[Unset, datetime.datetime] + if isinstance(_updated_at, Unset): + updated_at = UNSET + else: + updated_at = isoparse(_updated_at) + + alert_retrigger_rule = cls( + name=name, + match_mode=match_mode, + timeout_minutes=timeout_minutes, + position=position, + conditions=conditions, + created_at=created_at, + updated_at=updated_at, + ) + + alert_retrigger_rule.additional_properties = d + return alert_retrigger_rule + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/rootly_sdk/models/alert_retrigger_rule_conditions_item.py b/rootly_sdk/models/alert_retrigger_rule_conditions_item.py new file mode 100644 index 00000000..f4561edd --- /dev/null +++ b/rootly_sdk/models/alert_retrigger_rule_conditions_item.py @@ -0,0 +1,130 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, Union, cast +from uuid import UUID + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.alert_retrigger_rule_conditions_item_kind import ( + AlertRetriggerRuleConditionsItemKind, + check_alert_retrigger_rule_conditions_item_kind, +) +from ..models.alert_retrigger_rule_conditions_item_operator import ( + AlertRetriggerRuleConditionsItemOperator, + check_alert_retrigger_rule_conditions_item_operator, +) +from ..types import UNSET, Unset + +T = TypeVar("T", bound="AlertRetriggerRuleConditionsItem") + + +@_attrs_define +class AlertRetriggerRuleConditionsItem: + """ + Attributes: + id (UUID): Unique ID of the condition + kind (AlertRetriggerRuleConditionsItemKind): The operand the condition matches on. Native operands (urgency, + source, service, group) match by record; alert_field/payload match a field value. + operator (AlertRetriggerRuleConditionsItemOperator): How the operand is compared. Native operands support + is_one_of/is_not_one_of/is_set/is_not_set; alert_field/payload additionally support the string/regex operators. + record_ids (Union[Unset, list[UUID]]): For urgency/service/group/source conditions: the IDs of the matched + records (AlertUrgency, Service, Group, or Alerts::Source). + values (Union[Unset, list[str]]): For source conditions: non-integration source aliases (e.g. manual, api). For + alert_field/payload conditions: the values to compare against. + property_field_name (Union[Unset, str]): For alert_field conditions: the alert field id. For payload conditions: + a JSON Path (e.g. $.priority). + """ + + id: UUID + kind: AlertRetriggerRuleConditionsItemKind + operator: AlertRetriggerRuleConditionsItemOperator + record_ids: Union[Unset, list[UUID]] = UNSET + values: Union[Unset, list[str]] = UNSET + property_field_name: Union[Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = str(self.id) + + kind: str = self.kind + + operator: str = self.operator + + record_ids: Union[Unset, list[str]] = UNSET + if not isinstance(self.record_ids, Unset): + record_ids = [] + for record_ids_item_data in self.record_ids: + record_ids_item = str(record_ids_item_data) + record_ids.append(record_ids_item) + + values: Union[Unset, list[str]] = UNSET + if not isinstance(self.values, Unset): + values = self.values + + property_field_name = self.property_field_name + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "kind": kind, + "operator": operator, + } + ) + if record_ids is not UNSET: + field_dict["record_ids"] = record_ids + if values is not UNSET: + field_dict["values"] = values + if property_field_name is not UNSET: + field_dict["property_field_name"] = property_field_name + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = UUID(d.pop("id")) + + kind = check_alert_retrigger_rule_conditions_item_kind(d.pop("kind")) + + operator = check_alert_retrigger_rule_conditions_item_operator(d.pop("operator")) + + record_ids = [] + _record_ids = d.pop("record_ids", UNSET) + for record_ids_item_data in _record_ids or []: + record_ids_item = UUID(record_ids_item_data) + + record_ids.append(record_ids_item) + + values = cast(list[str], d.pop("values", UNSET)) + + property_field_name = d.pop("property_field_name", UNSET) + + alert_retrigger_rule_conditions_item = cls( + id=id, + kind=kind, + operator=operator, + record_ids=record_ids, + values=values, + property_field_name=property_field_name, + ) + + alert_retrigger_rule_conditions_item.additional_properties = d + return alert_retrigger_rule_conditions_item + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/rootly_sdk/models/alert_retrigger_rule_conditions_item_kind.py b/rootly_sdk/models/alert_retrigger_rule_conditions_item_kind.py new file mode 100644 index 00000000..825d2d16 --- /dev/null +++ b/rootly_sdk/models/alert_retrigger_rule_conditions_item_kind.py @@ -0,0 +1,20 @@ +from typing import Literal, cast + +AlertRetriggerRuleConditionsItemKind = Literal["alert_field", "group", "payload", "service", "source", "urgency"] + +ALERT_RETRIGGER_RULE_CONDITIONS_ITEM_KIND_VALUES: set[AlertRetriggerRuleConditionsItemKind] = { + "alert_field", + "group", + "payload", + "service", + "source", + "urgency", +} + + +def check_alert_retrigger_rule_conditions_item_kind(value: str | None) -> AlertRetriggerRuleConditionsItemKind | None: + if value is None: + return None + if value in ALERT_RETRIGGER_RULE_CONDITIONS_ITEM_KIND_VALUES: + return cast(AlertRetriggerRuleConditionsItemKind, value) + raise TypeError(f"Unexpected value {value!r}. Expected one of {ALERT_RETRIGGER_RULE_CONDITIONS_ITEM_KIND_VALUES!r}") diff --git a/rootly_sdk/models/alert_retrigger_rule_conditions_item_operator.py b/rootly_sdk/models/alert_retrigger_rule_conditions_item_operator.py new file mode 100644 index 00000000..a51de929 --- /dev/null +++ b/rootly_sdk/models/alert_retrigger_rule_conditions_item_operator.py @@ -0,0 +1,37 @@ +from typing import Literal, cast + +AlertRetriggerRuleConditionsItemOperator = Literal[ + "contains", + "does_not_contain", + "ends_with", + "is_not_one_of", + "is_not_set", + "is_one_of", + "is_set", + "matches_regex", + "starts_with", +] + +ALERT_RETRIGGER_RULE_CONDITIONS_ITEM_OPERATOR_VALUES: set[AlertRetriggerRuleConditionsItemOperator] = { + "contains", + "does_not_contain", + "ends_with", + "is_not_one_of", + "is_not_set", + "is_one_of", + "is_set", + "matches_regex", + "starts_with", +} + + +def check_alert_retrigger_rule_conditions_item_operator( + value: str | None, +) -> AlertRetriggerRuleConditionsItemOperator | None: + if value is None: + return None + if value in ALERT_RETRIGGER_RULE_CONDITIONS_ITEM_OPERATOR_VALUES: + return cast(AlertRetriggerRuleConditionsItemOperator, value) + raise TypeError( + f"Unexpected value {value!r}. Expected one of {ALERT_RETRIGGER_RULE_CONDITIONS_ITEM_OPERATOR_VALUES!r}" + ) diff --git a/rootly_sdk/models/alert_retrigger_rule_list.py b/rootly_sdk/models/alert_retrigger_rule_list.py new file mode 100644 index 00000000..df1c8a23 --- /dev/null +++ b/rootly_sdk/models/alert_retrigger_rule_list.py @@ -0,0 +1,116 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.alert_retrigger_rule_list_data_item import AlertRetriggerRuleListDataItem + from ..models.jsonapi_included_resource import JsonapiIncludedResource + from ..models.links import Links + from ..models.meta import Meta + + +T = TypeVar("T", bound="AlertRetriggerRuleList") + + +@_attrs_define +class AlertRetriggerRuleList: + """ + Attributes: + data (list['AlertRetriggerRuleListDataItem']): + links (Links): + meta (Meta): + included (Union[Unset, list['JsonapiIncludedResource']]): + """ + + data: list["AlertRetriggerRuleListDataItem"] + links: "Links" + meta: "Meta" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + data = [] + for data_item_data in self.data: + data_item = data_item_data.to_dict() + data.append(data_item) + + links = self.links.to_dict() + + meta = self.meta.to_dict() + + included: Union[Unset, list[dict[str, Any]]] = UNSET + if not isinstance(self.included, Unset): + included = [] + for included_item_data in self.included: + included_item = included_item_data.to_dict() + included.append(included_item) + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "data": data, + "links": links, + "meta": meta, + } + ) + if included is not UNSET: + field_dict["included"] = included + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.alert_retrigger_rule_list_data_item import AlertRetriggerRuleListDataItem + from ..models.jsonapi_included_resource import JsonapiIncludedResource + from ..models.links import Links + from ..models.meta import Meta + + d = dict(src_dict) + data = [] + _data = d.pop("data") + for data_item_data in _data: + data_item = AlertRetriggerRuleListDataItem.from_dict(data_item_data) + + data.append(data_item) + + links = Links.from_dict(d.pop("links")) + + meta = Meta.from_dict(d.pop("meta")) + + included = [] + _included = d.pop("included", UNSET) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) + + included.append(included_item) + + alert_retrigger_rule_list = cls( + data=data, + links=links, + meta=meta, + included=included, + ) + + alert_retrigger_rule_list.additional_properties = d + return alert_retrigger_rule_list + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/rootly_sdk/models/alert_retrigger_rule_list_data_item.py b/rootly_sdk/models/alert_retrigger_rule_list_data_item.py new file mode 100644 index 00000000..b20f69d9 --- /dev/null +++ b/rootly_sdk/models/alert_retrigger_rule_list_data_item.py @@ -0,0 +1,86 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.alert_retrigger_rule_list_data_item_type import ( + AlertRetriggerRuleListDataItemType, + check_alert_retrigger_rule_list_data_item_type, +) + +if TYPE_CHECKING: + from ..models.alert_retrigger_rule import AlertRetriggerRule + + +T = TypeVar("T", bound="AlertRetriggerRuleListDataItem") + + +@_attrs_define +class AlertRetriggerRuleListDataItem: + """ + Attributes: + id (str): Unique ID of the alert_retrigger_rule + type_ (AlertRetriggerRuleListDataItemType): + attributes (AlertRetriggerRule): + """ + + id: str + type_: AlertRetriggerRuleListDataItemType + attributes: "AlertRetriggerRule" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + type_: str = self.type_ + + attributes = self.attributes.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "type": type_, + "attributes": attributes, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.alert_retrigger_rule import AlertRetriggerRule + + d = dict(src_dict) + id = d.pop("id") + + type_ = check_alert_retrigger_rule_list_data_item_type(d.pop("type")) + + attributes = AlertRetriggerRule.from_dict(d.pop("attributes")) + + alert_retrigger_rule_list_data_item = cls( + id=id, + type_=type_, + attributes=attributes, + ) + + alert_retrigger_rule_list_data_item.additional_properties = d + return alert_retrigger_rule_list_data_item + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/rootly_sdk/models/alert_retrigger_rule_list_data_item_type.py b/rootly_sdk/models/alert_retrigger_rule_list_data_item_type.py new file mode 100644 index 00000000..805d51ee --- /dev/null +++ b/rootly_sdk/models/alert_retrigger_rule_list_data_item_type.py @@ -0,0 +1,15 @@ +from typing import Literal, cast + +AlertRetriggerRuleListDataItemType = Literal["alert_retrigger_rules"] + +ALERT_RETRIGGER_RULE_LIST_DATA_ITEM_TYPE_VALUES: set[AlertRetriggerRuleListDataItemType] = { + "alert_retrigger_rules", +} + + +def check_alert_retrigger_rule_list_data_item_type(value: str | None) -> AlertRetriggerRuleListDataItemType | None: + if value is None: + return None + if value in ALERT_RETRIGGER_RULE_LIST_DATA_ITEM_TYPE_VALUES: + return cast(AlertRetriggerRuleListDataItemType, value) + raise TypeError(f"Unexpected value {value!r}. Expected one of {ALERT_RETRIGGER_RULE_LIST_DATA_ITEM_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/alert_retrigger_rule_match_mode.py b/rootly_sdk/models/alert_retrigger_rule_match_mode.py new file mode 100644 index 00000000..8ffc5c25 --- /dev/null +++ b/rootly_sdk/models/alert_retrigger_rule_match_mode.py @@ -0,0 +1,16 @@ +from typing import Literal, cast + +AlertRetriggerRuleMatchMode = Literal["match-all-rules", "match-any-rule"] + +ALERT_RETRIGGER_RULE_MATCH_MODE_VALUES: set[AlertRetriggerRuleMatchMode] = { + "match-all-rules", + "match-any-rule", +} + + +def check_alert_retrigger_rule_match_mode(value: str | None) -> AlertRetriggerRuleMatchMode | None: + if value is None: + return None + if value in ALERT_RETRIGGER_RULE_MATCH_MODE_VALUES: + return cast(AlertRetriggerRuleMatchMode, value) + raise TypeError(f"Unexpected value {value!r}. Expected one of {ALERT_RETRIGGER_RULE_MATCH_MODE_VALUES!r}") diff --git a/rootly_sdk/models/alert_retrigger_rule_response.py b/rootly_sdk/models/alert_retrigger_rule_response.py new file mode 100644 index 00000000..b9f5cb52 --- /dev/null +++ b/rootly_sdk/models/alert_retrigger_rule_response.py @@ -0,0 +1,88 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.alert_retrigger_rule_response_data import AlertRetriggerRuleResponseData + from ..models.jsonapi_included_resource import JsonapiIncludedResource + + +T = TypeVar("T", bound="AlertRetriggerRuleResponse") + + +@_attrs_define +class AlertRetriggerRuleResponse: + """ + Attributes: + data (AlertRetriggerRuleResponseData): + included (Union[Unset, list['JsonapiIncludedResource']]): + """ + + data: "AlertRetriggerRuleResponseData" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + data = self.data.to_dict() + + included: Union[Unset, list[dict[str, Any]]] = UNSET + if not isinstance(self.included, Unset): + included = [] + for included_item_data in self.included: + included_item = included_item_data.to_dict() + included.append(included_item) + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "data": data, + } + ) + if included is not UNSET: + field_dict["included"] = included + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.alert_retrigger_rule_response_data import AlertRetriggerRuleResponseData + from ..models.jsonapi_included_resource import JsonapiIncludedResource + + d = dict(src_dict) + data = AlertRetriggerRuleResponseData.from_dict(d.pop("data")) + + included = [] + _included = d.pop("included", UNSET) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) + + included.append(included_item) + + alert_retrigger_rule_response = cls( + data=data, + included=included, + ) + + alert_retrigger_rule_response.additional_properties = d + return alert_retrigger_rule_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/rootly_sdk/models/alert_retrigger_rule_response_data.py b/rootly_sdk/models/alert_retrigger_rule_response_data.py new file mode 100644 index 00000000..64c9f063 --- /dev/null +++ b/rootly_sdk/models/alert_retrigger_rule_response_data.py @@ -0,0 +1,86 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.alert_retrigger_rule_response_data_type import ( + AlertRetriggerRuleResponseDataType, + check_alert_retrigger_rule_response_data_type, +) + +if TYPE_CHECKING: + from ..models.alert_retrigger_rule import AlertRetriggerRule + + +T = TypeVar("T", bound="AlertRetriggerRuleResponseData") + + +@_attrs_define +class AlertRetriggerRuleResponseData: + """ + Attributes: + id (str): Unique ID of the alert_retrigger_rule + type_ (AlertRetriggerRuleResponseDataType): + attributes (AlertRetriggerRule): + """ + + id: str + type_: AlertRetriggerRuleResponseDataType + attributes: "AlertRetriggerRule" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + type_: str = self.type_ + + attributes = self.attributes.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "type": type_, + "attributes": attributes, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.alert_retrigger_rule import AlertRetriggerRule + + d = dict(src_dict) + id = d.pop("id") + + type_ = check_alert_retrigger_rule_response_data_type(d.pop("type")) + + attributes = AlertRetriggerRule.from_dict(d.pop("attributes")) + + alert_retrigger_rule_response_data = cls( + id=id, + type_=type_, + attributes=attributes, + ) + + alert_retrigger_rule_response_data.additional_properties = d + return alert_retrigger_rule_response_data + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/rootly_sdk/models/alert_retrigger_rule_response_data_type.py b/rootly_sdk/models/alert_retrigger_rule_response_data_type.py new file mode 100644 index 00000000..83e34750 --- /dev/null +++ b/rootly_sdk/models/alert_retrigger_rule_response_data_type.py @@ -0,0 +1,15 @@ +from typing import Literal, cast + +AlertRetriggerRuleResponseDataType = Literal["alert_retrigger_rules"] + +ALERT_RETRIGGER_RULE_RESPONSE_DATA_TYPE_VALUES: set[AlertRetriggerRuleResponseDataType] = { + "alert_retrigger_rules", +} + + +def check_alert_retrigger_rule_response_data_type(value: str | None) -> AlertRetriggerRuleResponseDataType | None: + if value is None: + return None + if value in ALERT_RETRIGGER_RULE_RESPONSE_DATA_TYPE_VALUES: + return cast(AlertRetriggerRuleResponseDataType, value) + raise TypeError(f"Unexpected value {value!r}. Expected one of {ALERT_RETRIGGER_RULE_RESPONSE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/alert_route.py b/rootly_sdk/models/alert_route.py index abfbd781..1b8ffc5d 100644 --- a/rootly_sdk/models/alert_route.py +++ b/rootly_sdk/models/alert_route.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from uuid import UUID from attrs import define as _attrs_define @@ -22,20 +20,19 @@ class AlertRoute: Attributes: name (str): The name of the alert route alerts_source_ids (list[UUID]): - enabled (bool | Unset): Whether the alert route is enabled - owning_team_ids (list[UUID] | Unset): - rules (list[AlertRouteRulesItem] | Unset): + enabled (Union[Unset, bool]): Whether the alert route is enabled + owning_team_ids (Union[Unset, list[UUID]]): + rules (Union[Unset, list['AlertRouteRulesItem']]): """ name: str alerts_source_ids: list[UUID] - enabled: bool | Unset = UNSET - owning_team_ids: list[UUID] | Unset = UNSET - rules: list[AlertRouteRulesItem] | Unset = UNSET + enabled: Union[Unset, bool] = UNSET + owning_team_ids: Union[Unset, list[UUID]] = UNSET + rules: Union[Unset, list["AlertRouteRulesItem"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - name = self.name alerts_source_ids = [] @@ -45,14 +42,14 @@ def to_dict(self) -> dict[str, Any]: enabled = self.enabled - owning_team_ids: list[str] | Unset = UNSET + owning_team_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.owning_team_ids, Unset): owning_team_ids = [] for owning_team_ids_item_data in self.owning_team_ids: owning_team_ids_item = str(owning_team_ids_item_data) owning_team_ids.append(owning_team_ids_item) - rules: list[dict[str, Any]] | Unset = UNSET + rules: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.rules, Unset): rules = [] for rules_item_data in self.rules: @@ -92,23 +89,19 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: enabled = d.pop("enabled", UNSET) + owning_team_ids = [] _owning_team_ids = d.pop("owning_team_ids", UNSET) - owning_team_ids: list[UUID] | Unset = UNSET - if _owning_team_ids is not UNSET: - owning_team_ids = [] - for owning_team_ids_item_data in _owning_team_ids: - owning_team_ids_item = UUID(owning_team_ids_item_data) + for owning_team_ids_item_data in _owning_team_ids or []: + owning_team_ids_item = UUID(owning_team_ids_item_data) - owning_team_ids.append(owning_team_ids_item) + owning_team_ids.append(owning_team_ids_item) + rules = [] _rules = d.pop("rules", UNSET) - rules: list[AlertRouteRulesItem] | Unset = UNSET - if _rules is not UNSET: - rules = [] - for rules_item_data in _rules: - rules_item = AlertRouteRulesItem.from_dict(rules_item_data) + for rules_item_data in _rules or []: + rules_item = AlertRouteRulesItem.from_dict(rules_item_data) - rules.append(rules_item) + rules.append(rules_item) alert_route = cls( name=name, diff --git a/rootly_sdk/models/alert_route_list.py b/rootly_sdk/models/alert_route_list.py index c6276ba7..ccae9fd3 100644 --- a/rootly_sdk/models/alert_route_list.py +++ b/rootly_sdk/models/alert_route_list.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,18 +17,17 @@ class AlertRouteList: """ Attributes: - data (list[AlertRouteListDataItem]): + data (list['AlertRouteListDataItem']): links (Links): meta (Meta): """ - data: list[AlertRouteListDataItem] - links: Links - meta: Meta + data: list["AlertRouteListDataItem"] + links: "Links" + meta: "Meta" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() diff --git a/rootly_sdk/models/alert_route_list_data_item.py b/rootly_sdk/models/alert_route_list_data_item.py index 4ec22e8a..ba77f29a 100644 --- a/rootly_sdk/models/alert_route_list_data_item.py +++ b/rootly_sdk/models/alert_route_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class AlertRouteListDataItem: id: str type_: AlertRouteListDataItemType - attributes: AlertRoute + attributes: "AlertRoute" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/alert_route_response.py b/rootly_sdk/models/alert_route_response.py index 53657a71..21c9cd2d 100644 --- a/rootly_sdk/models/alert_route_response.py +++ b/rootly_sdk/models/alert_route_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class AlertRouteResponse: data (AlertRouteResponseData): """ - data: AlertRouteResponseData + data: "AlertRouteResponseData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/alert_route_response_data.py b/rootly_sdk/models/alert_route_response_data.py index 4bf1cb69..b94232f9 100644 --- a/rootly_sdk/models/alert_route_response_data.py +++ b/rootly_sdk/models/alert_route_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class AlertRouteResponseData: id: str type_: AlertRouteResponseDataType - attributes: AlertRoute + attributes: "AlertRoute" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/alert_route_rules_item.py b/rootly_sdk/models/alert_route_rules_item.py index 7764fdcb..64a3cb20 100644 --- a/rootly_sdk/models/alert_route_rules_item.py +++ b/rootly_sdk/models/alert_route_rules_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,21 +19,20 @@ class AlertRouteRulesItem: """ Attributes: name (str): The name of the alert routing rule - destinations (list[AlertRouteRulesItemDestinationsItem]): - condition_groups (list[AlertRouteRulesItemConditionGroupsItem]): - position (int | Unset): The position of the alert routing rule for ordering evaluation - fallback_rule (bool | Unset): Whether this is a fallback rule Default: False. + destinations (list['AlertRouteRulesItemDestinationsItem']): + condition_groups (list['AlertRouteRulesItemConditionGroupsItem']): + position (Union[Unset, int]): The position of the alert routing rule for ordering evaluation + fallback_rule (Union[Unset, bool]): Whether this is a fallback rule Default: False. """ name: str - destinations: list[AlertRouteRulesItemDestinationsItem] - condition_groups: list[AlertRouteRulesItemConditionGroupsItem] - position: int | Unset = UNSET - fallback_rule: bool | Unset = False + destinations: list["AlertRouteRulesItemDestinationsItem"] + condition_groups: list["AlertRouteRulesItemConditionGroupsItem"] + position: Union[Unset, int] = UNSET + fallback_rule: Union[Unset, bool] = False additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - name = self.name destinations = [] diff --git a/rootly_sdk/models/alert_route_rules_item_condition_groups_item.py b/rootly_sdk/models/alert_route_rules_item_condition_groups_item.py index 45faaf7b..294a000e 100644 --- a/rootly_sdk/models/alert_route_rules_item_condition_groups_item.py +++ b/rootly_sdk/models/alert_route_rules_item_condition_groups_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,16 +19,15 @@ class AlertRouteRulesItemConditionGroupsItem: """ Attributes: - conditions (list[AlertRouteRulesItemConditionGroupsItemConditionsItem]): - position (int | Unset): The position of the condition group + conditions (list['AlertRouteRulesItemConditionGroupsItemConditionsItem']): + position (Union[Unset, int]): The position of the condition group """ - conditions: list[AlertRouteRulesItemConditionGroupsItemConditionsItem] - position: int | Unset = UNSET + conditions: list["AlertRouteRulesItemConditionGroupsItemConditionsItem"] + position: Union[Unset, int] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - conditions = [] for conditions_item_data in self.conditions: conditions_item = conditions_item_data.to_dict() diff --git a/rootly_sdk/models/alert_route_rules_item_condition_groups_item_conditions_item.py b/rootly_sdk/models/alert_route_rules_item_condition_groups_item_conditions_item.py index 413dfacc..762078a4 100644 --- a/rootly_sdk/models/alert_route_rules_item_condition_groups_item_conditions_item.py +++ b/rootly_sdk/models/alert_route_rules_item_condition_groups_item_conditions_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from uuid import UUID from attrs import define as _attrs_define @@ -30,23 +28,23 @@ class AlertRouteRulesItemConditionGroupsItemConditionsItem: Attributes: property_field_condition_type (AlertRouteRulesItemConditionGroupsItemConditionsItemPropertyFieldConditionType): property_field_type (AlertRouteRulesItemConditionGroupsItemConditionsItemPropertyFieldType): - property_field_name (str | Unset): The name of the property field - property_field_value (None | str | Unset): The value of the property field - property_field_values (list[str] | None | Unset): - alert_urgency_ids (list[str] | None | Unset): The Alert Urgency IDs to check in the condition - conditionable_type (AlertRouteRulesItemConditionGroupsItemConditionsItemConditionableType | Unset): The type of - the conditionable - conditionable_id (None | Unset | UUID): The ID of the conditionable + property_field_name (Union[Unset, str]): The name of the property field + property_field_value (Union[None, Unset, str]): The value of the property field + property_field_values (Union[None, Unset, list[str]]): + alert_urgency_ids (Union[None, Unset, list[str]]): The Alert Urgency IDs to check in the condition + conditionable_type (Union[Unset, AlertRouteRulesItemConditionGroupsItemConditionsItemConditionableType]): The + type of the conditionable + conditionable_id (Union[None, UUID, Unset]): The ID of the conditionable """ property_field_condition_type: AlertRouteRulesItemConditionGroupsItemConditionsItemPropertyFieldConditionType property_field_type: AlertRouteRulesItemConditionGroupsItemConditionsItemPropertyFieldType - property_field_name: str | Unset = UNSET - property_field_value: None | str | Unset = UNSET - property_field_values: list[str] | None | Unset = UNSET - alert_urgency_ids: list[str] | None | Unset = UNSET - conditionable_type: AlertRouteRulesItemConditionGroupsItemConditionsItemConditionableType | Unset = UNSET - conditionable_id: None | Unset | UUID = UNSET + property_field_name: Union[Unset, str] = UNSET + property_field_value: Union[None, Unset, str] = UNSET + property_field_values: Union[None, Unset, list[str]] = UNSET + alert_urgency_ids: Union[None, Unset, list[str]] = UNSET + conditionable_type: Union[Unset, AlertRouteRulesItemConditionGroupsItemConditionsItemConditionableType] = UNSET + conditionable_id: Union[None, UUID, Unset] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -56,13 +54,13 @@ def to_dict(self) -> dict[str, Any]: property_field_name = self.property_field_name - property_field_value: None | str | Unset + property_field_value: Union[None, Unset, str] if isinstance(self.property_field_value, Unset): property_field_value = UNSET else: property_field_value = self.property_field_value - property_field_values: list[str] | None | Unset + property_field_values: Union[None, Unset, list[str]] if isinstance(self.property_field_values, Unset): property_field_values = UNSET elif isinstance(self.property_field_values, list): @@ -71,7 +69,7 @@ def to_dict(self) -> dict[str, Any]: else: property_field_values = self.property_field_values - alert_urgency_ids: list[str] | None | Unset + alert_urgency_ids: Union[None, Unset, list[str]] if isinstance(self.alert_urgency_ids, Unset): alert_urgency_ids = UNSET elif isinstance(self.alert_urgency_ids, list): @@ -80,11 +78,11 @@ def to_dict(self) -> dict[str, Any]: else: alert_urgency_ids = self.alert_urgency_ids - conditionable_type: str | Unset = UNSET + conditionable_type: Union[Unset, str] = UNSET if not isinstance(self.conditionable_type, Unset): conditionable_type = self.conditionable_type - conditionable_id: None | str | Unset + conditionable_id: Union[None, Unset, str] if isinstance(self.conditionable_id, Unset): conditionable_id = UNSET elif isinstance(self.conditionable_id, UUID): @@ -130,16 +128,16 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: property_field_name = d.pop("property_field_name", UNSET) - def _parse_property_field_value(data: object) -> None | str | Unset: + def _parse_property_field_value(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) property_field_value = _parse_property_field_value(d.pop("property_field_value", UNSET)) - def _parse_property_field_values(data: object) -> list[str] | None | Unset: + def _parse_property_field_values(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -150,13 +148,13 @@ def _parse_property_field_values(data: object) -> list[str] | None | Unset: property_field_values_type_0 = cast(list[str], data) return property_field_values_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) property_field_values = _parse_property_field_values(d.pop("property_field_values", UNSET)) - def _parse_alert_urgency_ids(data: object) -> list[str] | None | Unset: + def _parse_alert_urgency_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -167,14 +165,14 @@ def _parse_alert_urgency_ids(data: object) -> list[str] | None | Unset: alert_urgency_ids_type_0 = cast(list[str], data) return alert_urgency_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) alert_urgency_ids = _parse_alert_urgency_ids(d.pop("alert_urgency_ids", UNSET)) _conditionable_type = d.pop("conditionable_type", UNSET) - conditionable_type: AlertRouteRulesItemConditionGroupsItemConditionsItemConditionableType | Unset + conditionable_type: Union[Unset, AlertRouteRulesItemConditionGroupsItemConditionsItemConditionableType] if isinstance(_conditionable_type, Unset): conditionable_type = UNSET else: @@ -182,7 +180,7 @@ def _parse_alert_urgency_ids(data: object) -> list[str] | None | Unset: _conditionable_type ) - def _parse_conditionable_id(data: object) -> None | Unset | UUID: + def _parse_conditionable_id(data: object) -> Union[None, UUID, Unset]: if data is None: return data if isinstance(data, Unset): @@ -193,9 +191,9 @@ def _parse_conditionable_id(data: object) -> None | Unset | UUID: conditionable_id_type_0 = UUID(data) return conditionable_id_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(None | Unset | UUID, data) + return cast(Union[None, UUID, Unset], data) conditionable_id = _parse_conditionable_id(d.pop("conditionable_id", UNSET)) diff --git a/rootly_sdk/models/alert_route_rules_item_destinations_item.py b/rootly_sdk/models/alert_route_rules_item_destinations_item.py index 303e9070..58e62a68 100644 --- a/rootly_sdk/models/alert_route_rules_item_destinations_item.py +++ b/rootly_sdk/models/alert_route_rules_item_destinations_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar from uuid import UUID diff --git a/rootly_sdk/models/alert_routing_rule.py b/rootly_sdk/models/alert_routing_rule.py index 1ca607b9..03551da2 100644 --- a/rootly_sdk/models/alert_routing_rule.py +++ b/rootly_sdk/models/alert_routing_rule.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from uuid import UUID from attrs import define as _attrs_define @@ -33,10 +31,11 @@ class AlertRoutingRule: condition_type (AlertRoutingRuleConditionType): The type of condition for the alert routing rule created_at (str): Date of creation updated_at (str): Date of last update - conditions (list[AlertRoutingRuleConditionsItem] | Unset): The conditions for the alert routing rule - destination (AlertRoutingRuleDestinationType0 | None | Unset): The destinations for the alert routing rule - condition_groups (list[AlertRoutingRuleConditionGroupsItem] | Unset): The condition groups for the alert routing + conditions (Union[Unset, list['AlertRoutingRuleConditionsItem']]): The conditions for the alert routing rule + destination (Union['AlertRoutingRuleDestinationType0', None, Unset]): The destinations for the alert routing rule + condition_groups (Union[Unset, list['AlertRoutingRuleConditionGroupsItem']]): The condition groups for the alert + routing rule """ name: str @@ -46,9 +45,9 @@ class AlertRoutingRule: condition_type: AlertRoutingRuleConditionType created_at: str updated_at: str - conditions: list[AlertRoutingRuleConditionsItem] | Unset = UNSET - destination: AlertRoutingRuleDestinationType0 | None | Unset = UNSET - condition_groups: list[AlertRoutingRuleConditionGroupsItem] | Unset = UNSET + conditions: Union[Unset, list["AlertRoutingRuleConditionsItem"]] = UNSET + destination: Union["AlertRoutingRuleDestinationType0", None, Unset] = UNSET + condition_groups: Union[Unset, list["AlertRoutingRuleConditionGroupsItem"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -68,14 +67,14 @@ def to_dict(self) -> dict[str, Any]: updated_at = self.updated_at - conditions: list[dict[str, Any]] | Unset = UNSET + conditions: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.conditions, Unset): conditions = [] for conditions_item_data in self.conditions: conditions_item = conditions_item_data.to_dict() conditions.append(conditions_item) - destination: dict[str, Any] | None | Unset + destination: Union[None, Unset, dict[str, Any]] if isinstance(self.destination, Unset): destination = UNSET elif isinstance(self.destination, AlertRoutingRuleDestinationType0): @@ -83,7 +82,7 @@ def to_dict(self) -> dict[str, Any]: else: destination = self.destination - condition_groups: list[dict[str, Any]] | Unset = UNSET + condition_groups: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.condition_groups, Unset): condition_groups = [] for condition_groups_item_data in self.condition_groups: @@ -133,16 +132,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: updated_at = d.pop("updated_at") + conditions = [] _conditions = d.pop("conditions", UNSET) - conditions: list[AlertRoutingRuleConditionsItem] | Unset = UNSET - if _conditions is not UNSET: - conditions = [] - for conditions_item_data in _conditions: - conditions_item = AlertRoutingRuleConditionsItem.from_dict(conditions_item_data) + for conditions_item_data in _conditions or []: + conditions_item = AlertRoutingRuleConditionsItem.from_dict(conditions_item_data) - conditions.append(conditions_item) + conditions.append(conditions_item) - def _parse_destination(data: object) -> AlertRoutingRuleDestinationType0 | None | Unset: + def _parse_destination(data: object) -> Union["AlertRoutingRuleDestinationType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -153,20 +150,18 @@ def _parse_destination(data: object) -> AlertRoutingRuleDestinationType0 | None destination_type_0 = AlertRoutingRuleDestinationType0.from_dict(data) return destination_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(AlertRoutingRuleDestinationType0 | None | Unset, data) + return cast(Union["AlertRoutingRuleDestinationType0", None, Unset], data) destination = _parse_destination(d.pop("destination", UNSET)) + condition_groups = [] _condition_groups = d.pop("condition_groups", UNSET) - condition_groups: list[AlertRoutingRuleConditionGroupsItem] | Unset = UNSET - if _condition_groups is not UNSET: - condition_groups = [] - for condition_groups_item_data in _condition_groups: - condition_groups_item = AlertRoutingRuleConditionGroupsItem.from_dict(condition_groups_item_data) + for condition_groups_item_data in _condition_groups or []: + condition_groups_item = AlertRoutingRuleConditionGroupsItem.from_dict(condition_groups_item_data) - condition_groups.append(condition_groups_item) + condition_groups.append(condition_groups_item) alert_routing_rule = cls( name=name, diff --git a/rootly_sdk/models/alert_routing_rule_condition.py b/rootly_sdk/models/alert_routing_rule_condition.py index 0ab961a3..a3540287 100644 --- a/rootly_sdk/models/alert_routing_rule_condition.py +++ b/rootly_sdk/models/alert_routing_rule_condition.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from uuid import UUID from attrs import define as _attrs_define @@ -29,25 +27,25 @@ class AlertRoutingRuleCondition: property_field_name (str): The name of the property field property_field_condition_type (AlertRoutingRuleConditionPropertyFieldConditionType): The condition type of the property field - id (UUID | Unset): Unique ID of the condition - property_field_value (None | str | Unset): The value of the property field - property_field_values (list[str] | None | Unset): The values of the property field - conditionable_id (None | Unset | UUID): The ID of the conditionable object - conditionable_type (None | str | Unset): The type of the conditionable object - created_at (str | Unset): Date of creation - updated_at (str | Unset): Date of last update + id (Union[Unset, UUID]): Unique ID of the condition + property_field_value (Union[None, Unset, str]): The value of the property field + property_field_values (Union[None, Unset, list[str]]): The values of the property field + conditionable_id (Union[None, UUID, Unset]): The ID of the conditionable object + conditionable_type (Union[None, Unset, str]): The type of the conditionable object + created_at (Union[Unset, str]): Date of creation + updated_at (Union[Unset, str]): Date of last update """ property_field_type: AlertRoutingRuleConditionPropertyFieldType property_field_name: str property_field_condition_type: AlertRoutingRuleConditionPropertyFieldConditionType - id: UUID | Unset = UNSET - property_field_value: None | str | Unset = UNSET - property_field_values: list[str] | None | Unset = UNSET - conditionable_id: None | Unset | UUID = UNSET - conditionable_type: None | str | Unset = UNSET - created_at: str | Unset = UNSET - updated_at: str | Unset = UNSET + id: Union[Unset, UUID] = UNSET + property_field_value: Union[None, Unset, str] = UNSET + property_field_values: Union[None, Unset, list[str]] = UNSET + conditionable_id: Union[None, UUID, Unset] = UNSET + conditionable_type: Union[None, Unset, str] = UNSET + created_at: Union[Unset, str] = UNSET + updated_at: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -57,17 +55,17 @@ def to_dict(self) -> dict[str, Any]: property_field_condition_type: str = self.property_field_condition_type - id: str | Unset = UNSET + id: Union[Unset, str] = UNSET if not isinstance(self.id, Unset): id = str(self.id) - property_field_value: None | str | Unset + property_field_value: Union[None, Unset, str] if isinstance(self.property_field_value, Unset): property_field_value = UNSET else: property_field_value = self.property_field_value - property_field_values: list[str] | None | Unset + property_field_values: Union[None, Unset, list[str]] if isinstance(self.property_field_values, Unset): property_field_values = UNSET elif isinstance(self.property_field_values, list): @@ -76,7 +74,7 @@ def to_dict(self) -> dict[str, Any]: else: property_field_values = self.property_field_values - conditionable_id: None | str | Unset + conditionable_id: Union[None, Unset, str] if isinstance(self.conditionable_id, Unset): conditionable_id = UNSET elif isinstance(self.conditionable_id, UUID): @@ -84,7 +82,7 @@ def to_dict(self) -> dict[str, Any]: else: conditionable_id = self.conditionable_id - conditionable_type: None | str | Unset + conditionable_type: Union[None, Unset, str] if isinstance(self.conditionable_type, Unset): conditionable_type = UNSET else: @@ -132,22 +130,22 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: ) _id = d.pop("id", UNSET) - id: UUID | Unset + id: Union[Unset, UUID] if isinstance(_id, Unset): id = UNSET else: id = UUID(_id) - def _parse_property_field_value(data: object) -> None | str | Unset: + def _parse_property_field_value(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) property_field_value = _parse_property_field_value(d.pop("property_field_value", UNSET)) - def _parse_property_field_values(data: object) -> list[str] | None | Unset: + def _parse_property_field_values(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -158,13 +156,13 @@ def _parse_property_field_values(data: object) -> list[str] | None | Unset: property_field_values_type_0 = cast(list[str], data) return property_field_values_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) property_field_values = _parse_property_field_values(d.pop("property_field_values", UNSET)) - def _parse_conditionable_id(data: object) -> None | Unset | UUID: + def _parse_conditionable_id(data: object) -> Union[None, UUID, Unset]: if data is None: return data if isinstance(data, Unset): @@ -175,18 +173,18 @@ def _parse_conditionable_id(data: object) -> None | Unset | UUID: conditionable_id_type_0 = UUID(data) return conditionable_id_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(None | Unset | UUID, data) + return cast(Union[None, UUID, Unset], data) conditionable_id = _parse_conditionable_id(d.pop("conditionable_id", UNSET)) - def _parse_conditionable_type(data: object) -> None | str | Unset: + def _parse_conditionable_type(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) conditionable_type = _parse_conditionable_type(d.pop("conditionable_type", UNSET)) diff --git a/rootly_sdk/models/alert_routing_rule_condition_group.py b/rootly_sdk/models/alert_routing_rule_condition_group.py index 56abd818..7c3df35d 100644 --- a/rootly_sdk/models/alert_routing_rule_condition_group.py +++ b/rootly_sdk/models/alert_routing_rule_condition_group.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from uuid import UUID from attrs import define as _attrs_define @@ -22,28 +20,27 @@ class AlertRoutingRuleConditionGroup: Attributes: position (int): The position of the condition group for ordering - id (UUID | Unset): Unique ID of the condition group - conditions (list[AlertRoutingRuleCondition] | Unset): The conditions within this group - created_at (str | Unset): Date of creation - updated_at (str | Unset): Date of last update + id (Union[Unset, UUID]): Unique ID of the condition group + conditions (Union[Unset, list['AlertRoutingRuleCondition']]): The conditions within this group + created_at (Union[Unset, str]): Date of creation + updated_at (Union[Unset, str]): Date of last update """ position: int - id: UUID | Unset = UNSET - conditions: list[AlertRoutingRuleCondition] | Unset = UNSET - created_at: str | Unset = UNSET - updated_at: str | Unset = UNSET + id: Union[Unset, UUID] = UNSET + conditions: Union[Unset, list["AlertRoutingRuleCondition"]] = UNSET + created_at: Union[Unset, str] = UNSET + updated_at: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - position = self.position - id: str | Unset = UNSET + id: Union[Unset, str] = UNSET if not isinstance(self.id, Unset): id = str(self.id) - conditions: list[dict[str, Any]] | Unset = UNSET + conditions: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.conditions, Unset): conditions = [] for conditions_item_data in self.conditions: @@ -80,20 +77,18 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: position = d.pop("position") _id = d.pop("id", UNSET) - id: UUID | Unset + id: Union[Unset, UUID] if isinstance(_id, Unset): id = UNSET else: id = UUID(_id) + conditions = [] _conditions = d.pop("conditions", UNSET) - conditions: list[AlertRoutingRuleCondition] | Unset = UNSET - if _conditions is not UNSET: - conditions = [] - for conditions_item_data in _conditions: - conditions_item = AlertRoutingRuleCondition.from_dict(conditions_item_data) + for conditions_item_data in _conditions or []: + conditions_item = AlertRoutingRuleCondition.from_dict(conditions_item_data) - conditions.append(conditions_item) + conditions.append(conditions_item) created_at = d.pop("created_at", UNSET) diff --git a/rootly_sdk/models/alert_routing_rule_condition_groups_item.py b/rootly_sdk/models/alert_routing_rule_condition_groups_item.py index 72ea94ca..31699f1d 100644 --- a/rootly_sdk/models/alert_routing_rule_condition_groups_item.py +++ b/rootly_sdk/models/alert_routing_rule_condition_groups_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from uuid import UUID from attrs import define as _attrs_define @@ -23,28 +21,28 @@ class AlertRoutingRuleConditionGroupsItem: """ Attributes: position (int): The position of the condition group for ordering - id (UUID | Unset): Unique ID of the condition group - conditions (list[AlertRoutingRuleConditionGroupsItemConditionsItem] | Unset): The conditions within this group - created_at (str | Unset): Date of creation - updated_at (str | Unset): Date of last update + id (Union[Unset, UUID]): Unique ID of the condition group + conditions (Union[Unset, list['AlertRoutingRuleConditionGroupsItemConditionsItem']]): The conditions within this + group + created_at (Union[Unset, str]): Date of creation + updated_at (Union[Unset, str]): Date of last update """ position: int - id: UUID | Unset = UNSET - conditions: list[AlertRoutingRuleConditionGroupsItemConditionsItem] | Unset = UNSET - created_at: str | Unset = UNSET - updated_at: str | Unset = UNSET + id: Union[Unset, UUID] = UNSET + conditions: Union[Unset, list["AlertRoutingRuleConditionGroupsItemConditionsItem"]] = UNSET + created_at: Union[Unset, str] = UNSET + updated_at: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - position = self.position - id: str | Unset = UNSET + id: Union[Unset, str] = UNSET if not isinstance(self.id, Unset): id = str(self.id) - conditions: list[dict[str, Any]] | Unset = UNSET + conditions: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.conditions, Unset): conditions = [] for conditions_item_data in self.conditions: @@ -83,20 +81,18 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: position = d.pop("position") _id = d.pop("id", UNSET) - id: UUID | Unset + id: Union[Unset, UUID] if isinstance(_id, Unset): id = UNSET else: id = UUID(_id) + conditions = [] _conditions = d.pop("conditions", UNSET) - conditions: list[AlertRoutingRuleConditionGroupsItemConditionsItem] | Unset = UNSET - if _conditions is not UNSET: - conditions = [] - for conditions_item_data in _conditions: - conditions_item = AlertRoutingRuleConditionGroupsItemConditionsItem.from_dict(conditions_item_data) + for conditions_item_data in _conditions or []: + conditions_item = AlertRoutingRuleConditionGroupsItemConditionsItem.from_dict(conditions_item_data) - conditions.append(conditions_item) + conditions.append(conditions_item) created_at = d.pop("created_at", UNSET) diff --git a/rootly_sdk/models/alert_routing_rule_condition_groups_item_conditions_item.py b/rootly_sdk/models/alert_routing_rule_condition_groups_item_conditions_item.py index 93399246..a9ef4f07 100644 --- a/rootly_sdk/models/alert_routing_rule_condition_groups_item_conditions_item.py +++ b/rootly_sdk/models/alert_routing_rule_condition_groups_item_conditions_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from uuid import UUID from attrs import define as _attrs_define @@ -29,25 +27,25 @@ class AlertRoutingRuleConditionGroupsItemConditionsItem: property_field_name (str): The name of the property field property_field_condition_type (AlertRoutingRuleConditionGroupsItemConditionsItemPropertyFieldConditionType): The condition type of the property field - id (UUID | Unset): Unique ID of the condition - property_field_value (None | str | Unset): The value of the property field - property_field_values (list[str] | None | Unset): The values of the property field - conditionable_id (None | Unset | UUID): The ID of the conditionable object - conditionable_type (None | str | Unset): The type of the conditionable object - created_at (str | Unset): Date of creation - updated_at (str | Unset): Date of last update + id (Union[Unset, UUID]): Unique ID of the condition + property_field_value (Union[None, Unset, str]): The value of the property field + property_field_values (Union[None, Unset, list[str]]): The values of the property field + conditionable_id (Union[None, UUID, Unset]): The ID of the conditionable object + conditionable_type (Union[None, Unset, str]): The type of the conditionable object + created_at (Union[Unset, str]): Date of creation + updated_at (Union[Unset, str]): Date of last update """ property_field_type: AlertRoutingRuleConditionGroupsItemConditionsItemPropertyFieldType property_field_name: str property_field_condition_type: AlertRoutingRuleConditionGroupsItemConditionsItemPropertyFieldConditionType - id: UUID | Unset = UNSET - property_field_value: None | str | Unset = UNSET - property_field_values: list[str] | None | Unset = UNSET - conditionable_id: None | Unset | UUID = UNSET - conditionable_type: None | str | Unset = UNSET - created_at: str | Unset = UNSET - updated_at: str | Unset = UNSET + id: Union[Unset, UUID] = UNSET + property_field_value: Union[None, Unset, str] = UNSET + property_field_values: Union[None, Unset, list[str]] = UNSET + conditionable_id: Union[None, UUID, Unset] = UNSET + conditionable_type: Union[None, Unset, str] = UNSET + created_at: Union[Unset, str] = UNSET + updated_at: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -57,17 +55,17 @@ def to_dict(self) -> dict[str, Any]: property_field_condition_type: str = self.property_field_condition_type - id: str | Unset = UNSET + id: Union[Unset, str] = UNSET if not isinstance(self.id, Unset): id = str(self.id) - property_field_value: None | str | Unset + property_field_value: Union[None, Unset, str] if isinstance(self.property_field_value, Unset): property_field_value = UNSET else: property_field_value = self.property_field_value - property_field_values: list[str] | None | Unset + property_field_values: Union[None, Unset, list[str]] if isinstance(self.property_field_values, Unset): property_field_values = UNSET elif isinstance(self.property_field_values, list): @@ -76,7 +74,7 @@ def to_dict(self) -> dict[str, Any]: else: property_field_values = self.property_field_values - conditionable_id: None | str | Unset + conditionable_id: Union[None, Unset, str] if isinstance(self.conditionable_id, Unset): conditionable_id = UNSET elif isinstance(self.conditionable_id, UUID): @@ -84,7 +82,7 @@ def to_dict(self) -> dict[str, Any]: else: conditionable_id = self.conditionable_id - conditionable_type: None | str | Unset + conditionable_type: Union[None, Unset, str] if isinstance(self.conditionable_type, Unset): conditionable_type = UNSET else: @@ -136,22 +134,22 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: ) _id = d.pop("id", UNSET) - id: UUID | Unset + id: Union[Unset, UUID] if isinstance(_id, Unset): id = UNSET else: id = UUID(_id) - def _parse_property_field_value(data: object) -> None | str | Unset: + def _parse_property_field_value(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) property_field_value = _parse_property_field_value(d.pop("property_field_value", UNSET)) - def _parse_property_field_values(data: object) -> list[str] | None | Unset: + def _parse_property_field_values(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -162,13 +160,13 @@ def _parse_property_field_values(data: object) -> list[str] | None | Unset: property_field_values_type_0 = cast(list[str], data) return property_field_values_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) property_field_values = _parse_property_field_values(d.pop("property_field_values", UNSET)) - def _parse_conditionable_id(data: object) -> None | Unset | UUID: + def _parse_conditionable_id(data: object) -> Union[None, UUID, Unset]: if data is None: return data if isinstance(data, Unset): @@ -179,18 +177,18 @@ def _parse_conditionable_id(data: object) -> None | Unset | UUID: conditionable_id_type_0 = UUID(data) return conditionable_id_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(None | Unset | UUID, data) + return cast(Union[None, UUID, Unset], data) conditionable_id = _parse_conditionable_id(d.pop("conditionable_id", UNSET)) - def _parse_conditionable_type(data: object) -> None | str | Unset: + def _parse_conditionable_type(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) conditionable_type = _parse_conditionable_type(d.pop("conditionable_type", UNSET)) diff --git a/rootly_sdk/models/alert_routing_rule_conditions_item.py b/rootly_sdk/models/alert_routing_rule_conditions_item.py index 7d65f2f1..cbec1e60 100644 --- a/rootly_sdk/models/alert_routing_rule_conditions_item.py +++ b/rootly_sdk/models/alert_routing_rule_conditions_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -30,17 +28,17 @@ class AlertRoutingRuleConditionsItem: field name should be supplied in JSON Path syntax. property_field_condition_type (AlertRoutingRuleConditionsItemPropertyFieldConditionType): The condition type of the property field - property_field_value (None | str | Unset): The value of the property field. Can be null if the property field - condition type is 'is_one_of' or 'is_not_one_of' - property_field_values (list[str] | Unset): The values of the property field. Used if the property field + property_field_value (Union[None, Unset, str]): The value of the property field. Can be null if the property + field condition type is 'is_one_of' or 'is_not_one_of' + property_field_values (Union[Unset, list[str]]): The values of the property field. Used if the property field condition type is 'is_one_of' or 'is_not_one_of' except for when property field name is 'alert_urgency' """ property_field_type: AlertRoutingRuleConditionsItemPropertyFieldType property_field_name: str property_field_condition_type: AlertRoutingRuleConditionsItemPropertyFieldConditionType - property_field_value: None | str | Unset = UNSET - property_field_values: list[str] | Unset = UNSET + property_field_value: Union[None, Unset, str] = UNSET + property_field_values: Union[Unset, list[str]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -50,13 +48,13 @@ def to_dict(self) -> dict[str, Any]: property_field_condition_type: str = self.property_field_condition_type - property_field_value: None | str | Unset + property_field_value: Union[None, Unset, str] if isinstance(self.property_field_value, Unset): property_field_value = UNSET else: property_field_value = self.property_field_value - property_field_values: list[str] | Unset = UNSET + property_field_values: Union[Unset, list[str]] = UNSET if not isinstance(self.property_field_values, Unset): property_field_values = self.property_field_values @@ -87,12 +85,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d.pop("property_field_condition_type") ) - def _parse_property_field_value(data: object) -> None | str | Unset: + def _parse_property_field_value(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) property_field_value = _parse_property_field_value(d.pop("property_field_value", UNSET)) diff --git a/rootly_sdk/models/alert_routing_rule_destination_type_0.py b/rootly_sdk/models/alert_routing_rule_destination_type_0.py index e628187c..80f5de82 100644 --- a/rootly_sdk/models/alert_routing_rule_destination_type_0.py +++ b/rootly_sdk/models/alert_routing_rule_destination_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar from uuid import UUID diff --git a/rootly_sdk/models/alert_routing_rule_list.py b/rootly_sdk/models/alert_routing_rule_list.py index 3c3aaa42..638bff98 100644 --- a/rootly_sdk/models/alert_routing_rule_list.py +++ b/rootly_sdk/models/alert_routing_rule_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,20 +20,19 @@ class AlertRoutingRuleList: """ Attributes: - data (list[AlertRoutingRuleListDataItem]): + data (list['AlertRoutingRuleListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[AlertRoutingRuleListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["AlertRoutingRuleListDataItem"] + links: "Links" + meta: "Meta" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) alert_routing_rule_list = cls( data=data, diff --git a/rootly_sdk/models/alert_routing_rule_list_data_item.py b/rootly_sdk/models/alert_routing_rule_list_data_item.py index 7245f458..343f7c40 100644 --- a/rootly_sdk/models/alert_routing_rule_list_data_item.py +++ b/rootly_sdk/models/alert_routing_rule_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class AlertRoutingRuleListDataItem: id: str type_: AlertRoutingRuleListDataItemType - attributes: AlertRoutingRule + attributes: "AlertRoutingRule" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/alert_routing_rule_response.py b/rootly_sdk/models/alert_routing_rule_response.py index f10281d6..ccc3afd4 100644 --- a/rootly_sdk/models/alert_routing_rule_response.py +++ b/rootly_sdk/models/alert_routing_rule_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,18 +19,17 @@ class AlertRoutingRuleResponse: """ Attributes: data (AlertRoutingRuleResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: AlertRoutingRuleResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "AlertRoutingRuleResponseData" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = AlertRoutingRuleResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) alert_routing_rule_response = cls( data=data, diff --git a/rootly_sdk/models/alert_routing_rule_response_data.py b/rootly_sdk/models/alert_routing_rule_response_data.py index bf0c7fc4..87bc9619 100644 --- a/rootly_sdk/models/alert_routing_rule_response_data.py +++ b/rootly_sdk/models/alert_routing_rule_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class AlertRoutingRuleResponseData: id: str type_: AlertRoutingRuleResponseDataType - attributes: AlertRoutingRule + attributes: "AlertRoutingRule" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/alert_routing_rule_target_type_0.py b/rootly_sdk/models/alert_routing_rule_target_type_0.py index 2c3c2e4a..62218fda 100644 --- a/rootly_sdk/models/alert_routing_rule_target_type_0.py +++ b/rootly_sdk/models/alert_routing_rule_target_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar from uuid import UUID diff --git a/rootly_sdk/models/alert_trigger_params.py b/rootly_sdk/models/alert_trigger_params.py index 6d99afd0..46873879 100644 --- a/rootly_sdk/models/alert_trigger_params.py +++ b/rootly_sdk/models/alert_trigger_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from uuid import UUID from attrs import define as _attrs_define @@ -54,129 +52,128 @@ class AlertTriggerParams: """ Attributes: trigger_type (AlertTriggerParamsTriggerType): - triggers (list[AlertTriggerParamsTriggersItem] | Unset): - alert_condition (AlertTriggerParamsAlertCondition | Unset): - alert_condition_source (AlertTriggerParamsAlertConditionSource | Unset): Default: 'ANY'. - alert_condition_source_use_regexp (bool | Unset): Default: False. - alert_sources (list[str] | Unset): - alert_condition_label (AlertTriggerParamsAlertConditionLabel | Unset): Default: 'ANY'. - alert_condition_label_use_regexp (bool | Unset): Default: False. - alert_condition_status (AlertTriggerParamsAlertConditionStatus | Unset): Default: 'ANY'. - alert_condition_status_use_regexp (bool | Unset): Default: False. - alert_statuses (list[str] | Unset): - alert_labels (list[str] | Unset): - alert_condition_urgency (AlertTriggerParamsAlertConditionUrgency | Unset): Default: 'ANY'. - alert_urgency_ids (list[UUID] | Unset): - alert_condition_payload (AlertTriggerParamsAlertConditionPayload | Unset): Default: 'ANY'. - alert_condition_payload_use_regexp (bool | Unset): Default: False. - alert_payload (list[str] | Unset): - alert_query_payload (None | str | Unset): You can use jsonpath syntax. eg: $.incident.teams[*] - alert_field_conditions (list[AlertTriggerParamsAlertFieldConditionsItem] | Unset): - alert_payload_conditions (AlertTriggerParamsAlertPayloadConditions | Unset): + triggers (Union[Unset, list[AlertTriggerParamsTriggersItem]]): + alert_condition (Union[Unset, AlertTriggerParamsAlertCondition]): + alert_condition_source (Union[Unset, AlertTriggerParamsAlertConditionSource]): Default: 'ANY'. + alert_condition_source_use_regexp (Union[Unset, bool]): Default: False. + alert_sources (Union[Unset, list[str]]): + alert_condition_label (Union[Unset, AlertTriggerParamsAlertConditionLabel]): Default: 'ANY'. + alert_condition_label_use_regexp (Union[Unset, bool]): Default: False. + alert_condition_status (Union[Unset, AlertTriggerParamsAlertConditionStatus]): Default: 'ANY'. + alert_condition_status_use_regexp (Union[Unset, bool]): Default: False. + alert_statuses (Union[Unset, list[str]]): + alert_labels (Union[Unset, list[str]]): + alert_condition_urgency (Union[Unset, AlertTriggerParamsAlertConditionUrgency]): Default: 'ANY'. + alert_urgency_ids (Union[Unset, list[UUID]]): + alert_condition_payload (Union[Unset, AlertTriggerParamsAlertConditionPayload]): Default: 'ANY'. + alert_condition_payload_use_regexp (Union[Unset, bool]): Default: False. + alert_payload (Union[Unset, list[str]]): + alert_query_payload (Union[None, Unset, str]): You can use jsonpath syntax. eg: $.incident.teams[*] + alert_field_conditions (Union[Unset, list['AlertTriggerParamsAlertFieldConditionsItem']]): + alert_payload_conditions (Union[Unset, AlertTriggerParamsAlertPayloadConditions]): """ trigger_type: AlertTriggerParamsTriggerType - triggers: list[AlertTriggerParamsTriggersItem] | Unset = UNSET - alert_condition: AlertTriggerParamsAlertCondition | Unset = UNSET - alert_condition_source: AlertTriggerParamsAlertConditionSource | Unset = "ANY" - alert_condition_source_use_regexp: bool | Unset = False - alert_sources: list[str] | Unset = UNSET - alert_condition_label: AlertTriggerParamsAlertConditionLabel | Unset = "ANY" - alert_condition_label_use_regexp: bool | Unset = False - alert_condition_status: AlertTriggerParamsAlertConditionStatus | Unset = "ANY" - alert_condition_status_use_regexp: bool | Unset = False - alert_statuses: list[str] | Unset = UNSET - alert_labels: list[str] | Unset = UNSET - alert_condition_urgency: AlertTriggerParamsAlertConditionUrgency | Unset = "ANY" - alert_urgency_ids: list[UUID] | Unset = UNSET - alert_condition_payload: AlertTriggerParamsAlertConditionPayload | Unset = "ANY" - alert_condition_payload_use_regexp: bool | Unset = False - alert_payload: list[str] | Unset = UNSET - alert_query_payload: None | str | Unset = UNSET - alert_field_conditions: list[AlertTriggerParamsAlertFieldConditionsItem] | Unset = UNSET - alert_payload_conditions: AlertTriggerParamsAlertPayloadConditions | Unset = UNSET + triggers: Union[Unset, list[AlertTriggerParamsTriggersItem]] = UNSET + alert_condition: Union[Unset, AlertTriggerParamsAlertCondition] = UNSET + alert_condition_source: Union[Unset, AlertTriggerParamsAlertConditionSource] = "ANY" + alert_condition_source_use_regexp: Union[Unset, bool] = False + alert_sources: Union[Unset, list[str]] = UNSET + alert_condition_label: Union[Unset, AlertTriggerParamsAlertConditionLabel] = "ANY" + alert_condition_label_use_regexp: Union[Unset, bool] = False + alert_condition_status: Union[Unset, AlertTriggerParamsAlertConditionStatus] = "ANY" + alert_condition_status_use_regexp: Union[Unset, bool] = False + alert_statuses: Union[Unset, list[str]] = UNSET + alert_labels: Union[Unset, list[str]] = UNSET + alert_condition_urgency: Union[Unset, AlertTriggerParamsAlertConditionUrgency] = "ANY" + alert_urgency_ids: Union[Unset, list[UUID]] = UNSET + alert_condition_payload: Union[Unset, AlertTriggerParamsAlertConditionPayload] = "ANY" + alert_condition_payload_use_regexp: Union[Unset, bool] = False + alert_payload: Union[Unset, list[str]] = UNSET + alert_query_payload: Union[None, Unset, str] = UNSET + alert_field_conditions: Union[Unset, list["AlertTriggerParamsAlertFieldConditionsItem"]] = UNSET + alert_payload_conditions: Union[Unset, "AlertTriggerParamsAlertPayloadConditions"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - trigger_type: str = self.trigger_type - triggers: list[str] | Unset = UNSET + triggers: Union[Unset, list[str]] = UNSET if not isinstance(self.triggers, Unset): triggers = [] for triggers_item_data in self.triggers: triggers_item: str = triggers_item_data triggers.append(triggers_item) - alert_condition: str | Unset = UNSET + alert_condition: Union[Unset, str] = UNSET if not isinstance(self.alert_condition, Unset): alert_condition = self.alert_condition - alert_condition_source: str | Unset = UNSET + alert_condition_source: Union[Unset, str] = UNSET if not isinstance(self.alert_condition_source, Unset): alert_condition_source = self.alert_condition_source alert_condition_source_use_regexp = self.alert_condition_source_use_regexp - alert_sources: list[str] | Unset = UNSET + alert_sources: Union[Unset, list[str]] = UNSET if not isinstance(self.alert_sources, Unset): alert_sources = self.alert_sources - alert_condition_label: str | Unset = UNSET + alert_condition_label: Union[Unset, str] = UNSET if not isinstance(self.alert_condition_label, Unset): alert_condition_label = self.alert_condition_label alert_condition_label_use_regexp = self.alert_condition_label_use_regexp - alert_condition_status: str | Unset = UNSET + alert_condition_status: Union[Unset, str] = UNSET if not isinstance(self.alert_condition_status, Unset): alert_condition_status = self.alert_condition_status alert_condition_status_use_regexp = self.alert_condition_status_use_regexp - alert_statuses: list[str] | Unset = UNSET + alert_statuses: Union[Unset, list[str]] = UNSET if not isinstance(self.alert_statuses, Unset): alert_statuses = self.alert_statuses - alert_labels: list[str] | Unset = UNSET + alert_labels: Union[Unset, list[str]] = UNSET if not isinstance(self.alert_labels, Unset): alert_labels = self.alert_labels - alert_condition_urgency: str | Unset = UNSET + alert_condition_urgency: Union[Unset, str] = UNSET if not isinstance(self.alert_condition_urgency, Unset): alert_condition_urgency = self.alert_condition_urgency - alert_urgency_ids: list[str] | Unset = UNSET + alert_urgency_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.alert_urgency_ids, Unset): alert_urgency_ids = [] for alert_urgency_ids_item_data in self.alert_urgency_ids: alert_urgency_ids_item = str(alert_urgency_ids_item_data) alert_urgency_ids.append(alert_urgency_ids_item) - alert_condition_payload: str | Unset = UNSET + alert_condition_payload: Union[Unset, str] = UNSET if not isinstance(self.alert_condition_payload, Unset): alert_condition_payload = self.alert_condition_payload alert_condition_payload_use_regexp = self.alert_condition_payload_use_regexp - alert_payload: list[str] | Unset = UNSET + alert_payload: Union[Unset, list[str]] = UNSET if not isinstance(self.alert_payload, Unset): alert_payload = self.alert_payload - alert_query_payload: None | str | Unset + alert_query_payload: Union[None, Unset, str] if isinstance(self.alert_query_payload, Unset): alert_query_payload = UNSET else: alert_query_payload = self.alert_query_payload - alert_field_conditions: list[dict[str, Any]] | Unset = UNSET + alert_field_conditions: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.alert_field_conditions, Unset): alert_field_conditions = [] for alert_field_conditions_item_data in self.alert_field_conditions: alert_field_conditions_item = alert_field_conditions_item_data.to_dict() alert_field_conditions.append(alert_field_conditions_item) - alert_payload_conditions: dict[str, Any] | Unset = UNSET + alert_payload_conditions: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.alert_payload_conditions, Unset): alert_payload_conditions = self.alert_payload_conditions.to_dict() @@ -236,24 +233,22 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) trigger_type = check_alert_trigger_params_trigger_type(d.pop("trigger_type")) + triggers = [] _triggers = d.pop("triggers", UNSET) - triggers: list[AlertTriggerParamsTriggersItem] | Unset = UNSET - if _triggers is not UNSET: - triggers = [] - for triggers_item_data in _triggers: - triggers_item = check_alert_trigger_params_triggers_item(triggers_item_data) + for triggers_item_data in _triggers or []: + triggers_item = check_alert_trigger_params_triggers_item(triggers_item_data) - triggers.append(triggers_item) + triggers.append(triggers_item) _alert_condition = d.pop("alert_condition", UNSET) - alert_condition: AlertTriggerParamsAlertCondition | Unset + alert_condition: Union[Unset, AlertTriggerParamsAlertCondition] if isinstance(_alert_condition, Unset): alert_condition = UNSET else: alert_condition = check_alert_trigger_params_alert_condition(_alert_condition) _alert_condition_source = d.pop("alert_condition_source", UNSET) - alert_condition_source: AlertTriggerParamsAlertConditionSource | Unset + alert_condition_source: Union[Unset, AlertTriggerParamsAlertConditionSource] if isinstance(_alert_condition_source, Unset): alert_condition_source = UNSET else: @@ -264,7 +259,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: alert_sources = cast(list[str], d.pop("alert_sources", UNSET)) _alert_condition_label = d.pop("alert_condition_label", UNSET) - alert_condition_label: AlertTriggerParamsAlertConditionLabel | Unset + alert_condition_label: Union[Unset, AlertTriggerParamsAlertConditionLabel] if isinstance(_alert_condition_label, Unset): alert_condition_label = UNSET else: @@ -273,7 +268,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: alert_condition_label_use_regexp = d.pop("alert_condition_label_use_regexp", UNSET) _alert_condition_status = d.pop("alert_condition_status", UNSET) - alert_condition_status: AlertTriggerParamsAlertConditionStatus | Unset + alert_condition_status: Union[Unset, AlertTriggerParamsAlertConditionStatus] if isinstance(_alert_condition_status, Unset): alert_condition_status = UNSET else: @@ -286,23 +281,21 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: alert_labels = cast(list[str], d.pop("alert_labels", UNSET)) _alert_condition_urgency = d.pop("alert_condition_urgency", UNSET) - alert_condition_urgency: AlertTriggerParamsAlertConditionUrgency | Unset + alert_condition_urgency: Union[Unset, AlertTriggerParamsAlertConditionUrgency] if isinstance(_alert_condition_urgency, Unset): alert_condition_urgency = UNSET else: alert_condition_urgency = check_alert_trigger_params_alert_condition_urgency(_alert_condition_urgency) + alert_urgency_ids = [] _alert_urgency_ids = d.pop("alert_urgency_ids", UNSET) - alert_urgency_ids: list[UUID] | Unset = UNSET - if _alert_urgency_ids is not UNSET: - alert_urgency_ids = [] - for alert_urgency_ids_item_data in _alert_urgency_ids: - alert_urgency_ids_item = UUID(alert_urgency_ids_item_data) + for alert_urgency_ids_item_data in _alert_urgency_ids or []: + alert_urgency_ids_item = UUID(alert_urgency_ids_item_data) - alert_urgency_ids.append(alert_urgency_ids_item) + alert_urgency_ids.append(alert_urgency_ids_item) _alert_condition_payload = d.pop("alert_condition_payload", UNSET) - alert_condition_payload: AlertTriggerParamsAlertConditionPayload | Unset + alert_condition_payload: Union[Unset, AlertTriggerParamsAlertConditionPayload] if isinstance(_alert_condition_payload, Unset): alert_condition_payload = UNSET else: @@ -312,28 +305,26 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: alert_payload = cast(list[str], d.pop("alert_payload", UNSET)) - def _parse_alert_query_payload(data: object) -> None | str | Unset: + def _parse_alert_query_payload(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) alert_query_payload = _parse_alert_query_payload(d.pop("alert_query_payload", UNSET)) + alert_field_conditions = [] _alert_field_conditions = d.pop("alert_field_conditions", UNSET) - alert_field_conditions: list[AlertTriggerParamsAlertFieldConditionsItem] | Unset = UNSET - if _alert_field_conditions is not UNSET: - alert_field_conditions = [] - for alert_field_conditions_item_data in _alert_field_conditions: - alert_field_conditions_item = AlertTriggerParamsAlertFieldConditionsItem.from_dict( - alert_field_conditions_item_data - ) + for alert_field_conditions_item_data in _alert_field_conditions or []: + alert_field_conditions_item = AlertTriggerParamsAlertFieldConditionsItem.from_dict( + alert_field_conditions_item_data + ) - alert_field_conditions.append(alert_field_conditions_item) + alert_field_conditions.append(alert_field_conditions_item) _alert_payload_conditions = d.pop("alert_payload_conditions", UNSET) - alert_payload_conditions: AlertTriggerParamsAlertPayloadConditions | Unset + alert_payload_conditions: Union[Unset, AlertTriggerParamsAlertPayloadConditions] if isinstance(_alert_payload_conditions, Unset): alert_payload_conditions = UNSET else: diff --git a/rootly_sdk/models/alert_trigger_params_alert_field_conditions_item.py b/rootly_sdk/models/alert_trigger_params_alert_field_conditions_item.py index 56455b09..222116fa 100644 --- a/rootly_sdk/models/alert_trigger_params_alert_field_conditions_item.py +++ b/rootly_sdk/models/alert_trigger_params_alert_field_conditions_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,12 +19,12 @@ class AlertTriggerParamsAlertFieldConditionsItem: Attributes: alert_field_id (str): condition_type (AlertTriggerParamsAlertFieldConditionsItemConditionType): - values (list[str] | Unset): + values (Union[Unset, list[str]]): """ alert_field_id: str condition_type: AlertTriggerParamsAlertFieldConditionsItemConditionType - values: list[str] | Unset = UNSET + values: Union[Unset, list[str]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -34,7 +32,7 @@ def to_dict(self) -> dict[str, Any]: condition_type: str = self.condition_type - values: list[str] | Unset = UNSET + values: Union[Unset, list[str]] = UNSET if not isinstance(self.values, Unset): values = self.values diff --git a/rootly_sdk/models/alert_trigger_params_alert_payload_conditions.py b/rootly_sdk/models/alert_trigger_params_alert_payload_conditions.py index a8a3fc50..a3302aa4 100644 --- a/rootly_sdk/models/alert_trigger_params_alert_payload_conditions.py +++ b/rootly_sdk/models/alert_trigger_params_alert_payload_conditions.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -25,21 +23,20 @@ class AlertTriggerParamsAlertPayloadConditions: """ Attributes: - logic (AlertTriggerParamsAlertPayloadConditionsLogic | Unset): - conditions (list[AlertTriggerParamsAlertPayloadConditionsConditionsItem] | Unset): + logic (Union[Unset, AlertTriggerParamsAlertPayloadConditionsLogic]): + conditions (Union[Unset, list['AlertTriggerParamsAlertPayloadConditionsConditionsItem']]): """ - logic: AlertTriggerParamsAlertPayloadConditionsLogic | Unset = UNSET - conditions: list[AlertTriggerParamsAlertPayloadConditionsConditionsItem] | Unset = UNSET + logic: Union[Unset, AlertTriggerParamsAlertPayloadConditionsLogic] = UNSET + conditions: Union[Unset, list["AlertTriggerParamsAlertPayloadConditionsConditionsItem"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - - logic: str | Unset = UNSET + logic: Union[Unset, str] = UNSET if not isinstance(self.logic, Unset): logic = self.logic - conditions: list[dict[str, Any]] | Unset = UNSET + conditions: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.conditions, Unset): conditions = [] for conditions_item_data in self.conditions: @@ -64,20 +61,18 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _logic = d.pop("logic", UNSET) - logic: AlertTriggerParamsAlertPayloadConditionsLogic | Unset + logic: Union[Unset, AlertTriggerParamsAlertPayloadConditionsLogic] if isinstance(_logic, Unset): logic = UNSET else: logic = check_alert_trigger_params_alert_payload_conditions_logic(_logic) + conditions = [] _conditions = d.pop("conditions", UNSET) - conditions: list[AlertTriggerParamsAlertPayloadConditionsConditionsItem] | Unset = UNSET - if _conditions is not UNSET: - conditions = [] - for conditions_item_data in _conditions: - conditions_item = AlertTriggerParamsAlertPayloadConditionsConditionsItem.from_dict(conditions_item_data) + for conditions_item_data in _conditions or []: + conditions_item = AlertTriggerParamsAlertPayloadConditionsConditionsItem.from_dict(conditions_item_data) - conditions.append(conditions_item) + conditions.append(conditions_item) alert_trigger_params_alert_payload_conditions = cls( logic=logic, diff --git a/rootly_sdk/models/alert_trigger_params_alert_payload_conditions_conditions_item.py b/rootly_sdk/models/alert_trigger_params_alert_payload_conditions_conditions_item.py index 6a9ea7fd..7e5cd5dd 100644 --- a/rootly_sdk/models/alert_trigger_params_alert_payload_conditions_conditions_item.py +++ b/rootly_sdk/models/alert_trigger_params_alert_payload_conditions_conditions_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,14 +19,14 @@ class AlertTriggerParamsAlertPayloadConditionsConditionsItem: Attributes: query (str): operator (AlertTriggerParamsAlertPayloadConditionsConditionsItemOperator): - values (list[str] | Unset): - use_regexp (bool | Unset): + values (Union[Unset, list[str]]): + use_regexp (Union[Unset, bool]): """ query: str operator: AlertTriggerParamsAlertPayloadConditionsConditionsItemOperator - values: list[str] | Unset = UNSET - use_regexp: bool | Unset = UNSET + values: Union[Unset, list[str]] = UNSET + use_regexp: Union[Unset, bool] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -36,7 +34,7 @@ def to_dict(self) -> dict[str, Any]: operator: str = self.operator - values: list[str] | Unset = UNSET + values: Union[Unset, list[str]] = UNSET if not isinstance(self.values, Unset): values = self.values diff --git a/rootly_sdk/models/alert_urgency.py b/rootly_sdk/models/alert_urgency.py index 3921a818..fe2a2546 100644 --- a/rootly_sdk/models/alert_urgency.py +++ b/rootly_sdk/models/alert_urgency.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -20,11 +18,13 @@ class AlertUrgency: position (int): Position of the alert urgency created_at (str): Date of creation updated_at (str): Date of last update - id (str | Unset): Unique ID of the alert urgency - urgency (None | str | Unset): The urgency level - color (None | str | Unset): The color associated with this urgency level - team_id (int | Unset): The ID of the team this urgency belongs to - deleted_at (None | str | Unset): Date of deletion + id (Union[Unset, str]): Unique ID of the alert urgency + retrigger_timeout_minutes (Union[None, Unset, int]): Re-trigger acknowledged alerts of this urgency after N + minutes; null inherits the workspace default, negative = never. + urgency (Union[None, Unset, str]): The urgency level + color (Union[None, Unset, str]): The color associated with this urgency level + team_id (Union[Unset, int]): The ID of the team this urgency belongs to + deleted_at (Union[None, Unset, str]): Date of deletion """ name: str @@ -32,11 +32,12 @@ class AlertUrgency: position: int created_at: str updated_at: str - id: str | Unset = UNSET - urgency: None | str | Unset = UNSET - color: None | str | Unset = UNSET - team_id: int | Unset = UNSET - deleted_at: None | str | Unset = UNSET + id: Union[Unset, str] = UNSET + retrigger_timeout_minutes: Union[None, Unset, int] = UNSET + urgency: Union[None, Unset, str] = UNSET + color: Union[None, Unset, str] = UNSET + team_id: Union[Unset, int] = UNSET + deleted_at: Union[None, Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -52,13 +53,19 @@ def to_dict(self) -> dict[str, Any]: id = self.id - urgency: None | str | Unset + retrigger_timeout_minutes: Union[None, Unset, int] + if isinstance(self.retrigger_timeout_minutes, Unset): + retrigger_timeout_minutes = UNSET + else: + retrigger_timeout_minutes = self.retrigger_timeout_minutes + + urgency: Union[None, Unset, str] if isinstance(self.urgency, Unset): urgency = UNSET else: urgency = self.urgency - color: None | str | Unset + color: Union[None, Unset, str] if isinstance(self.color, Unset): color = UNSET else: @@ -66,7 +73,7 @@ def to_dict(self) -> dict[str, Any]: team_id = self.team_id - deleted_at: None | str | Unset + deleted_at: Union[None, Unset, str] if isinstance(self.deleted_at, Unset): deleted_at = UNSET else: @@ -85,6 +92,8 @@ def to_dict(self) -> dict[str, Any]: ) if id is not UNSET: field_dict["id"] = id + if retrigger_timeout_minutes is not UNSET: + field_dict["retrigger_timeout_minutes"] = retrigger_timeout_minutes if urgency is not UNSET: field_dict["urgency"] = urgency if color is not UNSET: @@ -111,32 +120,41 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: id = d.pop("id", UNSET) - def _parse_urgency(data: object) -> None | str | Unset: + def _parse_retrigger_timeout_minutes(data: object) -> Union[None, Unset, int]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, int], data) + + retrigger_timeout_minutes = _parse_retrigger_timeout_minutes(d.pop("retrigger_timeout_minutes", UNSET)) + + def _parse_urgency(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) urgency = _parse_urgency(d.pop("urgency", UNSET)) - def _parse_color(data: object) -> None | str | Unset: + def _parse_color(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) color = _parse_color(d.pop("color", UNSET)) team_id = d.pop("team_id", UNSET) - def _parse_deleted_at(data: object) -> None | str | Unset: + def _parse_deleted_at(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) deleted_at = _parse_deleted_at(d.pop("deleted_at", UNSET)) @@ -147,6 +165,7 @@ def _parse_deleted_at(data: object) -> None | str | Unset: created_at=created_at, updated_at=updated_at, id=id, + retrigger_timeout_minutes=retrigger_timeout_minutes, urgency=urgency, color=color, team_id=team_id, diff --git a/rootly_sdk/models/alert_urgency_list.py b/rootly_sdk/models/alert_urgency_list.py index 385c12fd..16897a58 100644 --- a/rootly_sdk/models/alert_urgency_list.py +++ b/rootly_sdk/models/alert_urgency_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,20 +20,19 @@ class AlertUrgencyList: """ Attributes: - data (list[AlertUrgencyListDataItem]): + data (list['AlertUrgencyListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[AlertUrgencyListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["AlertUrgencyListDataItem"] + links: "Links" + meta: "Meta" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) alert_urgency_list = cls( data=data, diff --git a/rootly_sdk/models/alert_urgency_list_data_item.py b/rootly_sdk/models/alert_urgency_list_data_item.py index 9fd99c3a..aa0ff94f 100644 --- a/rootly_sdk/models/alert_urgency_list_data_item.py +++ b/rootly_sdk/models/alert_urgency_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class AlertUrgencyListDataItem: id: str type_: AlertUrgencyListDataItemType - attributes: AlertUrgency + attributes: "AlertUrgency" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/alert_urgency_response.py b/rootly_sdk/models/alert_urgency_response.py index 6e59691a..cc8615df 100644 --- a/rootly_sdk/models/alert_urgency_response.py +++ b/rootly_sdk/models/alert_urgency_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,18 +19,17 @@ class AlertUrgencyResponse: """ Attributes: data (AlertUrgencyResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: AlertUrgencyResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "AlertUrgencyResponseData" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = AlertUrgencyResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) alert_urgency_response = cls( data=data, diff --git a/rootly_sdk/models/alert_urgency_response_data.py b/rootly_sdk/models/alert_urgency_response_data.py index e2a938c7..c013d891 100644 --- a/rootly_sdk/models/alert_urgency_response_data.py +++ b/rootly_sdk/models/alert_urgency_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class AlertUrgencyResponseData: id: str type_: AlertUrgencyResponseDataType - attributes: AlertUrgency + attributes: "AlertUrgency" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/alerts_source.py b/rootly_sdk/models/alerts_source.py index 13b79b88..f27b6380 100644 --- a/rootly_sdk/models/alerts_source.py +++ b/rootly_sdk/models/alerts_source.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -36,30 +34,32 @@ class AlertsSource: secret (str): The secret used to authenticate non-email alert sources created_at (str): Date of creation updated_at (str): Date of last update - enabled (bool | Unset): Whether the alert source is enabled. Disabled sources do not create alerts from incoming - events. - source_type (AlertsSourceSourceType | Unset): The alert source type - alert_urgency_id (str | Unset): ID for the default alert urgency assigned to this alert source - deduplicate_alerts_by_key (bool | Unset): Toggle alert deduplication using deduplication key. If enabled, + enabled (Union[Unset, bool]): Whether the alert source is enabled. Disabled sources do not create alerts from + incoming events. + source_type (Union[Unset, AlertsSourceSourceType]): The alert source type + alert_urgency_id (Union[Unset, str]): ID for the default alert urgency assigned to this alert source + deduplicate_alerts_by_key (Union[Unset, bool]): Toggle alert deduplication using deduplication key. If enabled, deduplication_key_kind and deduplication_key_path are required. - deduplication_key_kind (AlertsSourceDeduplicationKeyKind | Unset): Kind of deduplication key. - deduplication_key_path (None | str | Unset): Path to deduplication key. This is a JSON Path to extract the + deduplication_key_kind (Union[Unset, AlertsSourceDeduplicationKeyKind]): Kind of deduplication key. + deduplication_key_path (Union[None, Unset, str]): Path to deduplication key. This is a JSON Path to extract the deduplication key from the request body. - deduplication_key_regexp (None | str | Unset): Regular expression to extract key from value found at key path. - owner_group_ids (list[str] | Unset): List of team IDs that will own the alert source - alert_template_attributes (AlertsSourceAlertTemplateAttributesType0 | None | Unset): - alert_source_urgency_rules_attributes (list[AlertsSourceAlertSourceUrgencyRulesAttributesItem] | Unset): List of - rules that define the conditions under which the alert urgency will be set automatically based on the alert - payload - sourceable_attributes (AlertsSourceSourceableAttributesType0 | None | Unset): Provide additional attributes for - generic_webhook alerts source - resolution_rule_attributes (AlertsSourceResolutionRuleAttributesType0 | None | Unset): Provide additional + deduplication_key_regexp (Union[None, Unset, str]): Regular expression to extract key from value found at key + path. + owner_group_ids (Union[Unset, list[str]]): List of team IDs that will own the alert source + alert_template_attributes (Union['AlertsSourceAlertTemplateAttributesType0', None, Unset]): + alert_source_urgency_rules_attributes (Union[Unset, list['AlertsSourceAlertSourceUrgencyRulesAttributesItem']]): + List of rules that define the conditions under which the alert urgency will be set automatically based on the + alert payload + sourceable_attributes (Union['AlertsSourceSourceableAttributesType0', None, Unset]): Provide additional + attributes for the underlying source. `auto_resolve`, `resolve_state` and `field_mappings_attributes` apply to + generic_webhook sources; `accept_threaded_emails` applies to email sources. + resolution_rule_attributes (Union['AlertsSourceResolutionRuleAttributesType0', None, Unset]): Provide additional attributes for email alerts source - alert_source_fields_attributes (list[AlertsSourceAlertSourceFieldsAttributesItem] | Unset): List of alert fields - to be added to the alert source. Note: This attribute requires the alert field feature to be enabled on your - account. Contact Rootly customer support if you need assistance with this feature. - email (None | str | Unset): The email generated for email alert sources - webhook_endpoint (None | str | Unset): The webhook URL generated for non-email alert sources + alert_source_fields_attributes (Union[Unset, list['AlertsSourceAlertSourceFieldsAttributesItem']]): List of + alert fields to be added to the alert source. Note: This attribute requires the alert field feature to be + enabled on your account. Contact Rootly customer support if you need assistance with this feature. + email (Union[None, Unset, str]): The email generated for email alert sources + webhook_endpoint (Union[None, Unset, str]): The webhook URL generated for non-email alert sources """ name: str @@ -67,21 +67,23 @@ class AlertsSource: secret: str created_at: str updated_at: str - enabled: bool | Unset = UNSET - source_type: AlertsSourceSourceType | Unset = UNSET - alert_urgency_id: str | Unset = UNSET - deduplicate_alerts_by_key: bool | Unset = UNSET - deduplication_key_kind: AlertsSourceDeduplicationKeyKind | Unset = UNSET - deduplication_key_path: None | str | Unset = UNSET - deduplication_key_regexp: None | str | Unset = UNSET - owner_group_ids: list[str] | Unset = UNSET - alert_template_attributes: AlertsSourceAlertTemplateAttributesType0 | None | Unset = UNSET - alert_source_urgency_rules_attributes: list[AlertsSourceAlertSourceUrgencyRulesAttributesItem] | Unset = UNSET - sourceable_attributes: AlertsSourceSourceableAttributesType0 | None | Unset = UNSET - resolution_rule_attributes: AlertsSourceResolutionRuleAttributesType0 | None | Unset = UNSET - alert_source_fields_attributes: list[AlertsSourceAlertSourceFieldsAttributesItem] | Unset = UNSET - email: None | str | Unset = UNSET - webhook_endpoint: None | str | Unset = UNSET + enabled: Union[Unset, bool] = UNSET + source_type: Union[Unset, AlertsSourceSourceType] = UNSET + alert_urgency_id: Union[Unset, str] = UNSET + deduplicate_alerts_by_key: Union[Unset, bool] = UNSET + deduplication_key_kind: Union[Unset, AlertsSourceDeduplicationKeyKind] = UNSET + deduplication_key_path: Union[None, Unset, str] = UNSET + deduplication_key_regexp: Union[None, Unset, str] = UNSET + owner_group_ids: Union[Unset, list[str]] = UNSET + alert_template_attributes: Union["AlertsSourceAlertTemplateAttributesType0", None, Unset] = UNSET + alert_source_urgency_rules_attributes: Union[Unset, list["AlertsSourceAlertSourceUrgencyRulesAttributesItem"]] = ( + UNSET + ) + sourceable_attributes: Union["AlertsSourceSourceableAttributesType0", None, Unset] = UNSET + resolution_rule_attributes: Union["AlertsSourceResolutionRuleAttributesType0", None, Unset] = UNSET + alert_source_fields_attributes: Union[Unset, list["AlertsSourceAlertSourceFieldsAttributesItem"]] = UNSET + email: Union[None, Unset, str] = UNSET + webhook_endpoint: Union[None, Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -101,7 +103,7 @@ def to_dict(self) -> dict[str, Any]: enabled = self.enabled - source_type: str | Unset = UNSET + source_type: Union[Unset, str] = UNSET if not isinstance(self.source_type, Unset): source_type = self.source_type @@ -109,27 +111,27 @@ def to_dict(self) -> dict[str, Any]: deduplicate_alerts_by_key = self.deduplicate_alerts_by_key - deduplication_key_kind: str | Unset = UNSET + deduplication_key_kind: Union[Unset, str] = UNSET if not isinstance(self.deduplication_key_kind, Unset): deduplication_key_kind = self.deduplication_key_kind - deduplication_key_path: None | str | Unset + deduplication_key_path: Union[None, Unset, str] if isinstance(self.deduplication_key_path, Unset): deduplication_key_path = UNSET else: deduplication_key_path = self.deduplication_key_path - deduplication_key_regexp: None | str | Unset + deduplication_key_regexp: Union[None, Unset, str] if isinstance(self.deduplication_key_regexp, Unset): deduplication_key_regexp = UNSET else: deduplication_key_regexp = self.deduplication_key_regexp - owner_group_ids: list[str] | Unset = UNSET + owner_group_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.owner_group_ids, Unset): owner_group_ids = self.owner_group_ids - alert_template_attributes: dict[str, Any] | None | Unset + alert_template_attributes: Union[None, Unset, dict[str, Any]] if isinstance(self.alert_template_attributes, Unset): alert_template_attributes = UNSET elif isinstance(self.alert_template_attributes, AlertsSourceAlertTemplateAttributesType0): @@ -137,14 +139,14 @@ def to_dict(self) -> dict[str, Any]: else: alert_template_attributes = self.alert_template_attributes - alert_source_urgency_rules_attributes: list[dict[str, Any]] | Unset = UNSET + alert_source_urgency_rules_attributes: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.alert_source_urgency_rules_attributes, Unset): alert_source_urgency_rules_attributes = [] for alert_source_urgency_rules_attributes_item_data in self.alert_source_urgency_rules_attributes: alert_source_urgency_rules_attributes_item = alert_source_urgency_rules_attributes_item_data.to_dict() alert_source_urgency_rules_attributes.append(alert_source_urgency_rules_attributes_item) - sourceable_attributes: dict[str, Any] | None | Unset + sourceable_attributes: Union[None, Unset, dict[str, Any]] if isinstance(self.sourceable_attributes, Unset): sourceable_attributes = UNSET elif isinstance(self.sourceable_attributes, AlertsSourceSourceableAttributesType0): @@ -152,7 +154,7 @@ def to_dict(self) -> dict[str, Any]: else: sourceable_attributes = self.sourceable_attributes - resolution_rule_attributes: dict[str, Any] | None | Unset + resolution_rule_attributes: Union[None, Unset, dict[str, Any]] if isinstance(self.resolution_rule_attributes, Unset): resolution_rule_attributes = UNSET elif isinstance(self.resolution_rule_attributes, AlertsSourceResolutionRuleAttributesType0): @@ -160,20 +162,20 @@ def to_dict(self) -> dict[str, Any]: else: resolution_rule_attributes = self.resolution_rule_attributes - alert_source_fields_attributes: list[dict[str, Any]] | Unset = UNSET + alert_source_fields_attributes: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.alert_source_fields_attributes, Unset): alert_source_fields_attributes = [] for alert_source_fields_attributes_item_data in self.alert_source_fields_attributes: alert_source_fields_attributes_item = alert_source_fields_attributes_item_data.to_dict() alert_source_fields_attributes.append(alert_source_fields_attributes_item) - email: None | str | Unset + email: Union[None, Unset, str] if isinstance(self.email, Unset): email = UNSET else: email = self.email - webhook_endpoint: None | str | Unset + webhook_endpoint: Union[None, Unset, str] if isinstance(self.webhook_endpoint, Unset): webhook_endpoint = UNSET else: @@ -249,7 +251,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: enabled = d.pop("enabled", UNSET) _source_type = d.pop("source_type", UNSET) - source_type: AlertsSourceSourceType | Unset + source_type: Union[Unset, AlertsSourceSourceType] if isinstance(_source_type, Unset): source_type = UNSET else: @@ -260,33 +262,35 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: deduplicate_alerts_by_key = d.pop("deduplicate_alerts_by_key", UNSET) _deduplication_key_kind = d.pop("deduplication_key_kind", UNSET) - deduplication_key_kind: AlertsSourceDeduplicationKeyKind | Unset + deduplication_key_kind: Union[Unset, AlertsSourceDeduplicationKeyKind] if isinstance(_deduplication_key_kind, Unset): deduplication_key_kind = UNSET else: deduplication_key_kind = check_alerts_source_deduplication_key_kind(_deduplication_key_kind) - def _parse_deduplication_key_path(data: object) -> None | str | Unset: + def _parse_deduplication_key_path(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) deduplication_key_path = _parse_deduplication_key_path(d.pop("deduplication_key_path", UNSET)) - def _parse_deduplication_key_regexp(data: object) -> None | str | Unset: + def _parse_deduplication_key_regexp(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) deduplication_key_regexp = _parse_deduplication_key_regexp(d.pop("deduplication_key_regexp", UNSET)) owner_group_ids = cast(list[str], d.pop("owner_group_ids", UNSET)) - def _parse_alert_template_attributes(data: object) -> AlertsSourceAlertTemplateAttributesType0 | None | Unset: + def _parse_alert_template_attributes( + data: object, + ) -> Union["AlertsSourceAlertTemplateAttributesType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -297,26 +301,22 @@ def _parse_alert_template_attributes(data: object) -> AlertsSourceAlertTemplateA alert_template_attributes_type_0 = AlertsSourceAlertTemplateAttributesType0.from_dict(data) return alert_template_attributes_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(AlertsSourceAlertTemplateAttributesType0 | None | Unset, data) + return cast(Union["AlertsSourceAlertTemplateAttributesType0", None, Unset], data) alert_template_attributes = _parse_alert_template_attributes(d.pop("alert_template_attributes", UNSET)) + alert_source_urgency_rules_attributes = [] _alert_source_urgency_rules_attributes = d.pop("alert_source_urgency_rules_attributes", UNSET) - alert_source_urgency_rules_attributes: list[AlertsSourceAlertSourceUrgencyRulesAttributesItem] | Unset = UNSET - if _alert_source_urgency_rules_attributes is not UNSET: - alert_source_urgency_rules_attributes = [] - for alert_source_urgency_rules_attributes_item_data in _alert_source_urgency_rules_attributes: - alert_source_urgency_rules_attributes_item = ( - AlertsSourceAlertSourceUrgencyRulesAttributesItem.from_dict( - alert_source_urgency_rules_attributes_item_data - ) - ) + for alert_source_urgency_rules_attributes_item_data in _alert_source_urgency_rules_attributes or []: + alert_source_urgency_rules_attributes_item = AlertsSourceAlertSourceUrgencyRulesAttributesItem.from_dict( + alert_source_urgency_rules_attributes_item_data + ) - alert_source_urgency_rules_attributes.append(alert_source_urgency_rules_attributes_item) + alert_source_urgency_rules_attributes.append(alert_source_urgency_rules_attributes_item) - def _parse_sourceable_attributes(data: object) -> AlertsSourceSourceableAttributesType0 | None | Unset: + def _parse_sourceable_attributes(data: object) -> Union["AlertsSourceSourceableAttributesType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -327,13 +327,15 @@ def _parse_sourceable_attributes(data: object) -> AlertsSourceSourceableAttribut sourceable_attributes_type_0 = AlertsSourceSourceableAttributesType0.from_dict(data) return sourceable_attributes_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(AlertsSourceSourceableAttributesType0 | None | Unset, data) + return cast(Union["AlertsSourceSourceableAttributesType0", None, Unset], data) sourceable_attributes = _parse_sourceable_attributes(d.pop("sourceable_attributes", UNSET)) - def _parse_resolution_rule_attributes(data: object) -> AlertsSourceResolutionRuleAttributesType0 | None | Unset: + def _parse_resolution_rule_attributes( + data: object, + ) -> Union["AlertsSourceResolutionRuleAttributesType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -344,38 +346,36 @@ def _parse_resolution_rule_attributes(data: object) -> AlertsSourceResolutionRul resolution_rule_attributes_type_0 = AlertsSourceResolutionRuleAttributesType0.from_dict(data) return resolution_rule_attributes_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(AlertsSourceResolutionRuleAttributesType0 | None | Unset, data) + return cast(Union["AlertsSourceResolutionRuleAttributesType0", None, Unset], data) resolution_rule_attributes = _parse_resolution_rule_attributes(d.pop("resolution_rule_attributes", UNSET)) + alert_source_fields_attributes = [] _alert_source_fields_attributes = d.pop("alert_source_fields_attributes", UNSET) - alert_source_fields_attributes: list[AlertsSourceAlertSourceFieldsAttributesItem] | Unset = UNSET - if _alert_source_fields_attributes is not UNSET: - alert_source_fields_attributes = [] - for alert_source_fields_attributes_item_data in _alert_source_fields_attributes: - alert_source_fields_attributes_item = AlertsSourceAlertSourceFieldsAttributesItem.from_dict( - alert_source_fields_attributes_item_data - ) + for alert_source_fields_attributes_item_data in _alert_source_fields_attributes or []: + alert_source_fields_attributes_item = AlertsSourceAlertSourceFieldsAttributesItem.from_dict( + alert_source_fields_attributes_item_data + ) - alert_source_fields_attributes.append(alert_source_fields_attributes_item) + alert_source_fields_attributes.append(alert_source_fields_attributes_item) - def _parse_email(data: object) -> None | str | Unset: + def _parse_email(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) email = _parse_email(d.pop("email", UNSET)) - def _parse_webhook_endpoint(data: object) -> None | str | Unset: + def _parse_webhook_endpoint(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) webhook_endpoint = _parse_webhook_endpoint(d.pop("webhook_endpoint", UNSET)) diff --git a/rootly_sdk/models/alerts_source_alert_source_fields_attributes_item.py b/rootly_sdk/models/alerts_source_alert_source_fields_attributes_item.py index a9f3276f..a8cb412b 100644 --- a/rootly_sdk/models/alerts_source_alert_source_fields_attributes_item.py +++ b/rootly_sdk/models/alerts_source_alert_source_fields_attributes_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,19 +13,19 @@ class AlertsSourceAlertSourceFieldsAttributesItem: """ Attributes: - alert_field_id (str | Unset): The ID of the alert field - template_body (None | str | Unset): Liquid expression to extract a specific value from the alert's payload for - evaluation + alert_field_id (Union[Unset, str]): The ID of the alert field + template_body (Union[None, Unset, str]): Liquid expression to extract a specific value from the alert's payload + for evaluation """ - alert_field_id: str | Unset = UNSET - template_body: None | str | Unset = UNSET + alert_field_id: Union[Unset, str] = UNSET + template_body: Union[None, Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: alert_field_id = self.alert_field_id - template_body: None | str | Unset + template_body: Union[None, Unset, str] if isinstance(self.template_body, Unset): template_body = UNSET else: @@ -48,12 +46,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) alert_field_id = d.pop("alert_field_id", UNSET) - def _parse_template_body(data: object) -> None | str | Unset: + def _parse_template_body(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) template_body = _parse_template_body(d.pop("template_body", UNSET)) diff --git a/rootly_sdk/models/alerts_source_alert_source_urgency_rules_attributes_item.py b/rootly_sdk/models/alerts_source_alert_source_urgency_rules_attributes_item.py index f3cb5e0c..33d15b76 100644 --- a/rootly_sdk/models/alerts_source_alert_source_urgency_rules_attributes_item.py +++ b/rootly_sdk/models/alerts_source_alert_source_urgency_rules_attributes_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -27,53 +25,53 @@ class AlertsSourceAlertSourceUrgencyRulesAttributesItem: """ Attributes: - json_path (None | str | Unset): JSON path expression to extract a specific value from the alert's payload for - evaluation - operator (AlertsSourceAlertSourceUrgencyRulesAttributesItemOperator | Unset): Comparison operator used to + json_path (Union[None, Unset, str]): JSON path expression to extract a specific value from the alert's payload + for evaluation + operator (Union[Unset, AlertsSourceAlertSourceUrgencyRulesAttributesItemOperator]): Comparison operator used to evaluate the extracted value against the specified condition - value (str | Unset): Value that the extracted payload data is compared to using the specified operator to + value (Union[Unset, str]): Value that the extracted payload data is compared to using the specified operator to determine a match - conditionable_type (AlertsSourceAlertSourceUrgencyRulesAttributesItemConditionableType | Unset): The type of the - conditionable - conditionable_id (None | str | Unset): The ID of the conditionable. If conditionable_type is AlertField, this is - the ID of the alert field. - kind (AlertsSourceAlertSourceUrgencyRulesAttributesItemKind | Unset): The kind of the conditionable - alert_urgency_id (str | Unset): The ID of the alert urgency + conditionable_type (Union[Unset, AlertsSourceAlertSourceUrgencyRulesAttributesItemConditionableType]): The type + of the conditionable + conditionable_id (Union[None, Unset, str]): The ID of the conditionable. If conditionable_type is AlertField, + this is the ID of the alert field. + kind (Union[Unset, AlertsSourceAlertSourceUrgencyRulesAttributesItemKind]): The kind of the conditionable + alert_urgency_id (Union[Unset, str]): The ID of the alert urgency """ - json_path: None | str | Unset = UNSET - operator: AlertsSourceAlertSourceUrgencyRulesAttributesItemOperator | Unset = UNSET - value: str | Unset = UNSET - conditionable_type: AlertsSourceAlertSourceUrgencyRulesAttributesItemConditionableType | Unset = UNSET - conditionable_id: None | str | Unset = UNSET - kind: AlertsSourceAlertSourceUrgencyRulesAttributesItemKind | Unset = UNSET - alert_urgency_id: str | Unset = UNSET + json_path: Union[None, Unset, str] = UNSET + operator: Union[Unset, AlertsSourceAlertSourceUrgencyRulesAttributesItemOperator] = UNSET + value: Union[Unset, str] = UNSET + conditionable_type: Union[Unset, AlertsSourceAlertSourceUrgencyRulesAttributesItemConditionableType] = UNSET + conditionable_id: Union[None, Unset, str] = UNSET + kind: Union[Unset, AlertsSourceAlertSourceUrgencyRulesAttributesItemKind] = UNSET + alert_urgency_id: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - json_path: None | str | Unset + json_path: Union[None, Unset, str] if isinstance(self.json_path, Unset): json_path = UNSET else: json_path = self.json_path - operator: str | Unset = UNSET + operator: Union[Unset, str] = UNSET if not isinstance(self.operator, Unset): operator = self.operator value = self.value - conditionable_type: str | Unset = UNSET + conditionable_type: Union[Unset, str] = UNSET if not isinstance(self.conditionable_type, Unset): conditionable_type = self.conditionable_type - conditionable_id: None | str | Unset + conditionable_id: Union[None, Unset, str] if isinstance(self.conditionable_id, Unset): conditionable_id = UNSET else: conditionable_id = self.conditionable_id - kind: str | Unset = UNSET + kind: Union[Unset, str] = UNSET if not isinstance(self.kind, Unset): kind = self.kind @@ -103,17 +101,17 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_json_path(data: object) -> None | str | Unset: + def _parse_json_path(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) json_path = _parse_json_path(d.pop("json_path", UNSET)) _operator = d.pop("operator", UNSET) - operator: AlertsSourceAlertSourceUrgencyRulesAttributesItemOperator | Unset + operator: Union[Unset, AlertsSourceAlertSourceUrgencyRulesAttributesItemOperator] if isinstance(_operator, Unset): operator = UNSET else: @@ -122,7 +120,7 @@ def _parse_json_path(data: object) -> None | str | Unset: value = d.pop("value", UNSET) _conditionable_type = d.pop("conditionable_type", UNSET) - conditionable_type: AlertsSourceAlertSourceUrgencyRulesAttributesItemConditionableType | Unset + conditionable_type: Union[Unset, AlertsSourceAlertSourceUrgencyRulesAttributesItemConditionableType] if isinstance(_conditionable_type, Unset): conditionable_type = UNSET else: @@ -130,17 +128,17 @@ def _parse_json_path(data: object) -> None | str | Unset: _conditionable_type ) - def _parse_conditionable_id(data: object) -> None | str | Unset: + def _parse_conditionable_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) conditionable_id = _parse_conditionable_id(d.pop("conditionable_id", UNSET)) _kind = d.pop("kind", UNSET) - kind: AlertsSourceAlertSourceUrgencyRulesAttributesItemKind | Unset + kind: Union[Unset, AlertsSourceAlertSourceUrgencyRulesAttributesItemKind] if isinstance(_kind, Unset): kind = UNSET else: diff --git a/rootly_sdk/models/alerts_source_alert_template_attributes_type_0.py b/rootly_sdk/models/alerts_source_alert_template_attributes_type_0.py index 139bdfa8..aecbe7a0 100644 --- a/rootly_sdk/models/alerts_source_alert_template_attributes_type_0.py +++ b/rootly_sdk/models/alerts_source_alert_template_attributes_type_0.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,30 +13,30 @@ class AlertsSourceAlertTemplateAttributesType0: """ Attributes: - title (None | str | Unset): The alert title. - description (None | str | Unset): The alert description. - external_url (None | str | Unset): The alert URL. + title (Union[None, Unset, str]): The alert title. + description (Union[None, Unset, str]): The alert description. + external_url (Union[None, Unset, str]): The alert URL. """ - title: None | str | Unset = UNSET - description: None | str | Unset = UNSET - external_url: None | str | Unset = UNSET + title: Union[None, Unset, str] = UNSET + description: Union[None, Unset, str] = UNSET + external_url: Union[None, Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - title: None | str | Unset + title: Union[None, Unset, str] if isinstance(self.title, Unset): title = UNSET else: title = self.title - description: None | str | Unset + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: description = self.description - external_url: None | str | Unset + external_url: Union[None, Unset, str] if isinstance(self.external_url, Unset): external_url = UNSET else: @@ -60,30 +58,30 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_title(data: object) -> None | str | Unset: + def _parse_title(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) title = _parse_title(d.pop("title", UNSET)) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) - def _parse_external_url(data: object) -> None | str | Unset: + def _parse_external_url(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) external_url = _parse_external_url(d.pop("external_url", UNSET)) diff --git a/rootly_sdk/models/alerts_source_list.py b/rootly_sdk/models/alerts_source_list.py index 922a66a7..8e42181b 100644 --- a/rootly_sdk/models/alerts_source_list.py +++ b/rootly_sdk/models/alerts_source_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,20 +20,19 @@ class AlertsSourceList: """ Attributes: - data (list[AlertsSourceListDataItem]): + data (list['AlertsSourceListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[AlertsSourceListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["AlertsSourceListDataItem"] + links: "Links" + meta: "Meta" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) alerts_source_list = cls( data=data, diff --git a/rootly_sdk/models/alerts_source_list_data_item.py b/rootly_sdk/models/alerts_source_list_data_item.py index 697c5bc3..5650b90d 100644 --- a/rootly_sdk/models/alerts_source_list_data_item.py +++ b/rootly_sdk/models/alerts_source_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class AlertsSourceListDataItem: id: str type_: AlertsSourceListDataItemType - attributes: AlertsSource + attributes: "AlertsSource" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/alerts_source_resolution_rule_attributes_type_0.py b/rootly_sdk/models/alerts_source_resolution_rule_attributes_type_0.py index efa3dec0..73e32aab 100644 --- a/rootly_sdk/models/alerts_source_resolution_rule_attributes_type_0.py +++ b/rootly_sdk/models/alerts_source_resolution_rule_attributes_type_0.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -34,68 +32,69 @@ class AlertsSourceResolutionRuleAttributesType0: """Provide additional attributes for email alerts source Attributes: - enabled (bool | Unset): Set this to true to enable the auto resolution rule - condition_type (AlertsSourceResolutionRuleAttributesType0ConditionType | Unset): The type of condition to + enabled (Union[Unset, bool]): Set this to true to enable the auto resolution rule + condition_type (Union[Unset, AlertsSourceResolutionRuleAttributesType0ConditionType]): The type of condition to evaluate to apply auto resolution rule - identifier_matchable_type (AlertsSourceResolutionRuleAttributesType0IdentifierMatchableType | Unset): The type - of the identifier matchable - identifier_matchable_id (None | str | Unset): The ID of the identifier matchable. If identifier_matchable_type - is AlertField, this is the ID of the alert field. - identifier_reference_kind (AlertsSourceResolutionRuleAttributesType0IdentifierReferenceKind | Unset): The kind - of the identifier reference - identifier_json_path (None | str | Unset): JSON path expression to extract unique alert identifier used to match - triggered alerts with resolving alerts - identifier_value_regex (None | str | Unset): Regex group to further specify the part of the string used as a - unique identifier - conditions_attributes (list[AlertsSourceResolutionRuleAttributesType0ConditionsAttributesItem] | Unset): List of - conditions to evaluate for auto resolution + identifier_matchable_type (Union[Unset, AlertsSourceResolutionRuleAttributesType0IdentifierMatchableType]): The + type of the identifier matchable + identifier_matchable_id (Union[None, Unset, str]): The ID of the identifier matchable. If + identifier_matchable_type is AlertField, this is the ID of the alert field. + identifier_reference_kind (Union[Unset, AlertsSourceResolutionRuleAttributesType0IdentifierReferenceKind]): The + kind of the identifier reference + identifier_json_path (Union[None, Unset, str]): JSON path expression to extract unique alert identifier used to + match triggered alerts with resolving alerts + identifier_value_regex (Union[None, Unset, str]): Regex group to further specify the part of the string used as + a unique identifier + conditions_attributes (Union[Unset, list['AlertsSourceResolutionRuleAttributesType0ConditionsAttributesItem']]): + List of conditions to evaluate for auto resolution """ - enabled: bool | Unset = UNSET - condition_type: AlertsSourceResolutionRuleAttributesType0ConditionType | Unset = UNSET - identifier_matchable_type: AlertsSourceResolutionRuleAttributesType0IdentifierMatchableType | Unset = UNSET - identifier_matchable_id: None | str | Unset = UNSET - identifier_reference_kind: AlertsSourceResolutionRuleAttributesType0IdentifierReferenceKind | Unset = UNSET - identifier_json_path: None | str | Unset = UNSET - identifier_value_regex: None | str | Unset = UNSET - conditions_attributes: list[AlertsSourceResolutionRuleAttributesType0ConditionsAttributesItem] | Unset = UNSET + enabled: Union[Unset, bool] = UNSET + condition_type: Union[Unset, AlertsSourceResolutionRuleAttributesType0ConditionType] = UNSET + identifier_matchable_type: Union[Unset, AlertsSourceResolutionRuleAttributesType0IdentifierMatchableType] = UNSET + identifier_matchable_id: Union[None, Unset, str] = UNSET + identifier_reference_kind: Union[Unset, AlertsSourceResolutionRuleAttributesType0IdentifierReferenceKind] = UNSET + identifier_json_path: Union[None, Unset, str] = UNSET + identifier_value_regex: Union[None, Unset, str] = UNSET + conditions_attributes: Union[Unset, list["AlertsSourceResolutionRuleAttributesType0ConditionsAttributesItem"]] = ( + UNSET + ) additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - enabled = self.enabled - condition_type: str | Unset = UNSET + condition_type: Union[Unset, str] = UNSET if not isinstance(self.condition_type, Unset): condition_type = self.condition_type - identifier_matchable_type: str | Unset = UNSET + identifier_matchable_type: Union[Unset, str] = UNSET if not isinstance(self.identifier_matchable_type, Unset): identifier_matchable_type = self.identifier_matchable_type - identifier_matchable_id: None | str | Unset + identifier_matchable_id: Union[None, Unset, str] if isinstance(self.identifier_matchable_id, Unset): identifier_matchable_id = UNSET else: identifier_matchable_id = self.identifier_matchable_id - identifier_reference_kind: str | Unset = UNSET + identifier_reference_kind: Union[Unset, str] = UNSET if not isinstance(self.identifier_reference_kind, Unset): identifier_reference_kind = self.identifier_reference_kind - identifier_json_path: None | str | Unset + identifier_json_path: Union[None, Unset, str] if isinstance(self.identifier_json_path, Unset): identifier_json_path = UNSET else: identifier_json_path = self.identifier_json_path - identifier_value_regex: None | str | Unset + identifier_value_regex: Union[None, Unset, str] if isinstance(self.identifier_value_regex, Unset): identifier_value_regex = UNSET else: identifier_value_regex = self.identifier_value_regex - conditions_attributes: list[dict[str, Any]] | Unset = UNSET + conditions_attributes: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.conditions_attributes, Unset): conditions_attributes = [] for conditions_attributes_item_data in self.conditions_attributes: @@ -134,14 +133,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: enabled = d.pop("enabled", UNSET) _condition_type = d.pop("condition_type", UNSET) - condition_type: AlertsSourceResolutionRuleAttributesType0ConditionType | Unset + condition_type: Union[Unset, AlertsSourceResolutionRuleAttributesType0ConditionType] if isinstance(_condition_type, Unset): condition_type = UNSET else: condition_type = check_alerts_source_resolution_rule_attributes_type_0_condition_type(_condition_type) _identifier_matchable_type = d.pop("identifier_matchable_type", UNSET) - identifier_matchable_type: AlertsSourceResolutionRuleAttributesType0IdentifierMatchableType | Unset + identifier_matchable_type: Union[Unset, AlertsSourceResolutionRuleAttributesType0IdentifierMatchableType] if isinstance(_identifier_matchable_type, Unset): identifier_matchable_type = UNSET else: @@ -149,17 +148,17 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: _identifier_matchable_type ) - def _parse_identifier_matchable_id(data: object) -> None | str | Unset: + def _parse_identifier_matchable_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) identifier_matchable_id = _parse_identifier_matchable_id(d.pop("identifier_matchable_id", UNSET)) _identifier_reference_kind = d.pop("identifier_reference_kind", UNSET) - identifier_reference_kind: AlertsSourceResolutionRuleAttributesType0IdentifierReferenceKind | Unset + identifier_reference_kind: Union[Unset, AlertsSourceResolutionRuleAttributesType0IdentifierReferenceKind] if isinstance(_identifier_reference_kind, Unset): identifier_reference_kind = UNSET else: @@ -167,36 +166,32 @@ def _parse_identifier_matchable_id(data: object) -> None | str | Unset: _identifier_reference_kind ) - def _parse_identifier_json_path(data: object) -> None | str | Unset: + def _parse_identifier_json_path(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) identifier_json_path = _parse_identifier_json_path(d.pop("identifier_json_path", UNSET)) - def _parse_identifier_value_regex(data: object) -> None | str | Unset: + def _parse_identifier_value_regex(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) identifier_value_regex = _parse_identifier_value_regex(d.pop("identifier_value_regex", UNSET)) + conditions_attributes = [] _conditions_attributes = d.pop("conditions_attributes", UNSET) - conditions_attributes: list[AlertsSourceResolutionRuleAttributesType0ConditionsAttributesItem] | Unset = UNSET - if _conditions_attributes is not UNSET: - conditions_attributes = [] - for conditions_attributes_item_data in _conditions_attributes: - conditions_attributes_item = ( - AlertsSourceResolutionRuleAttributesType0ConditionsAttributesItem.from_dict( - conditions_attributes_item_data - ) - ) + for conditions_attributes_item_data in _conditions_attributes or []: + conditions_attributes_item = AlertsSourceResolutionRuleAttributesType0ConditionsAttributesItem.from_dict( + conditions_attributes_item_data + ) - conditions_attributes.append(conditions_attributes_item) + conditions_attributes.append(conditions_attributes_item) alerts_source_resolution_rule_attributes_type_0 = cls( enabled=enabled, diff --git a/rootly_sdk/models/alerts_source_resolution_rule_attributes_type_0_conditions_attributes_item.py b/rootly_sdk/models/alerts_source_resolution_rule_attributes_type_0_conditions_attributes_item.py index ccc2ade1..a79fa572 100644 --- a/rootly_sdk/models/alerts_source_resolution_rule_attributes_type_0_conditions_attributes_item.py +++ b/rootly_sdk/models/alerts_source_resolution_rule_attributes_type_0_conditions_attributes_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -27,54 +25,55 @@ class AlertsSourceResolutionRuleAttributesType0ConditionsAttributesItem: """ Attributes: - field (None | str | Unset): JSON path expression to extract a specific value from the alert's payload for + field (Union[None, Unset, str]): JSON path expression to extract a specific value from the alert's payload for evaluation - operator (AlertsSourceResolutionRuleAttributesType0ConditionsAttributesItemOperator | Unset): Comparison + operator (Union[Unset, AlertsSourceResolutionRuleAttributesType0ConditionsAttributesItemOperator]): Comparison operator used to evaluate the extracted value against the specified condition - value (str | Unset): Value that the extracted payload data is compared to using the specified operator to + value (Union[Unset, str]): Value that the extracted payload data is compared to using the specified operator to determine a match - conditionable_type (AlertsSourceResolutionRuleAttributesType0ConditionsAttributesItemConditionableType | Unset): - The type of the conditionable - conditionable_id (None | str | Unset): The ID of the conditionable. If conditionable_type is AlertField, this is - the ID of the alert field. - kind (AlertsSourceResolutionRuleAttributesType0ConditionsAttributesItemKind | Unset): The kind of the + conditionable_type (Union[Unset, + AlertsSourceResolutionRuleAttributesType0ConditionsAttributesItemConditionableType]): The type of the + conditionable + conditionable_id (Union[None, Unset, str]): The ID of the conditionable. If conditionable_type is AlertField, + this is the ID of the alert field. + kind (Union[Unset, AlertsSourceResolutionRuleAttributesType0ConditionsAttributesItemKind]): The kind of the conditionable """ - field: None | str | Unset = UNSET - operator: AlertsSourceResolutionRuleAttributesType0ConditionsAttributesItemOperator | Unset = UNSET - value: str | Unset = UNSET - conditionable_type: AlertsSourceResolutionRuleAttributesType0ConditionsAttributesItemConditionableType | Unset = ( - UNSET - ) - conditionable_id: None | str | Unset = UNSET - kind: AlertsSourceResolutionRuleAttributesType0ConditionsAttributesItemKind | Unset = UNSET + field: Union[None, Unset, str] = UNSET + operator: Union[Unset, AlertsSourceResolutionRuleAttributesType0ConditionsAttributesItemOperator] = UNSET + value: Union[Unset, str] = UNSET + conditionable_type: Union[ + Unset, AlertsSourceResolutionRuleAttributesType0ConditionsAttributesItemConditionableType + ] = UNSET + conditionable_id: Union[None, Unset, str] = UNSET + kind: Union[Unset, AlertsSourceResolutionRuleAttributesType0ConditionsAttributesItemKind] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - field: None | str | Unset + field: Union[None, Unset, str] if isinstance(self.field, Unset): field = UNSET else: field = self.field - operator: str | Unset = UNSET + operator: Union[Unset, str] = UNSET if not isinstance(self.operator, Unset): operator = self.operator value = self.value - conditionable_type: str | Unset = UNSET + conditionable_type: Union[Unset, str] = UNSET if not isinstance(self.conditionable_type, Unset): conditionable_type = self.conditionable_type - conditionable_id: None | str | Unset + conditionable_id: Union[None, Unset, str] if isinstance(self.conditionable_id, Unset): conditionable_id = UNSET else: conditionable_id = self.conditionable_id - kind: str | Unset = UNSET + kind: Union[Unset, str] = UNSET if not isinstance(self.kind, Unset): kind = self.kind @@ -100,17 +99,17 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_field(data: object) -> None | str | Unset: + def _parse_field(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) field = _parse_field(d.pop("field", UNSET)) _operator = d.pop("operator", UNSET) - operator: AlertsSourceResolutionRuleAttributesType0ConditionsAttributesItemOperator | Unset + operator: Union[Unset, AlertsSourceResolutionRuleAttributesType0ConditionsAttributesItemOperator] if isinstance(_operator, Unset): operator = UNSET else: @@ -121,7 +120,9 @@ def _parse_field(data: object) -> None | str | Unset: value = d.pop("value", UNSET) _conditionable_type = d.pop("conditionable_type", UNSET) - conditionable_type: AlertsSourceResolutionRuleAttributesType0ConditionsAttributesItemConditionableType | Unset + conditionable_type: Union[ + Unset, AlertsSourceResolutionRuleAttributesType0ConditionsAttributesItemConditionableType + ] if isinstance(_conditionable_type, Unset): conditionable_type = UNSET else: @@ -131,17 +132,17 @@ def _parse_field(data: object) -> None | str | Unset: ) ) - def _parse_conditionable_id(data: object) -> None | str | Unset: + def _parse_conditionable_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) conditionable_id = _parse_conditionable_id(d.pop("conditionable_id", UNSET)) _kind = d.pop("kind", UNSET) - kind: AlertsSourceResolutionRuleAttributesType0ConditionsAttributesItemKind | Unset + kind: Union[Unset, AlertsSourceResolutionRuleAttributesType0ConditionsAttributesItemKind] if isinstance(_kind, Unset): kind = UNSET else: diff --git a/rootly_sdk/models/alerts_source_response.py b/rootly_sdk/models/alerts_source_response.py index e90b0d90..7938c6f0 100644 --- a/rootly_sdk/models/alerts_source_response.py +++ b/rootly_sdk/models/alerts_source_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,18 +19,17 @@ class AlertsSourceResponse: """ Attributes: data (AlertsSourceResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: AlertsSourceResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "AlertsSourceResponseData" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = AlertsSourceResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) alerts_source_response = cls( data=data, diff --git a/rootly_sdk/models/alerts_source_response_data.py b/rootly_sdk/models/alerts_source_response_data.py index 848030dc..1c8f6d20 100644 --- a/rootly_sdk/models/alerts_source_response_data.py +++ b/rootly_sdk/models/alerts_source_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class AlertsSourceResponseData: id: str type_: AlertsSourceResponseDataType - attributes: AlertsSource + attributes: "AlertsSource" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/alerts_source_sourceable_attributes_type_0.py b/rootly_sdk/models/alerts_source_sourceable_attributes_type_0.py index e7714a10..f7bdf054 100644 --- a/rootly_sdk/models/alerts_source_sourceable_attributes_type_0.py +++ b/rootly_sdk/models/alerts_source_sourceable_attributes_type_0.py @@ -1,7 +1,6 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from uuid import UUID from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,29 +18,38 @@ @_attrs_define class AlertsSourceSourceableAttributesType0: - """Provide additional attributes for generic_webhook alerts source - - Attributes: - auto_resolve (bool | Unset): Set this to true to auto-resolve alerts based on field_mappings_attributes - conditions - resolve_state (None | str | Unset): This value is matched with the value extracted from alerts payload using - JSON path in field_mappings_attributes - accept_threaded_emails (bool | Unset): Set this to false to reject threaded emails - field_mappings_attributes (list[AlertsSourceSourceableAttributesType0FieldMappingsAttributesItem] | Unset): - Specify rules to auto resolve alerts + """Provide additional attributes for the underlying source. `auto_resolve`, `resolve_state` and + `field_mappings_attributes` apply to generic_webhook sources; `accept_threaded_emails` applies to email sources. + + Attributes: + id (Union[Unset, UUID]): Unique ID of the underlying source. Read-only; it is resolved from the alert source + itself on update. + auto_resolve (Union[Unset, bool]): Set this to true to auto-resolve alerts based on field_mappings_attributes + conditions + resolve_state (Union[None, Unset, str]): This value is matched with the value extracted from alerts payload + using JSON path in field_mappings_attributes + accept_threaded_emails (Union[Unset, bool]): Set this to false to reject threaded emails + field_mappings_attributes (Union[Unset, + list['AlertsSourceSourceableAttributesType0FieldMappingsAttributesItem']]): Specify rules to auto resolve alerts """ - auto_resolve: bool | Unset = UNSET - resolve_state: None | str | Unset = UNSET - accept_threaded_emails: bool | Unset = UNSET - field_mappings_attributes: list[AlertsSourceSourceableAttributesType0FieldMappingsAttributesItem] | Unset = UNSET + id: Union[Unset, UUID] = UNSET + auto_resolve: Union[Unset, bool] = UNSET + resolve_state: Union[None, Unset, str] = UNSET + accept_threaded_emails: Union[Unset, bool] = UNSET + field_mappings_attributes: Union[ + Unset, list["AlertsSourceSourceableAttributesType0FieldMappingsAttributesItem"] + ] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + id: Union[Unset, str] = UNSET + if not isinstance(self.id, Unset): + id = str(self.id) auto_resolve = self.auto_resolve - resolve_state: None | str | Unset + resolve_state: Union[None, Unset, str] if isinstance(self.resolve_state, Unset): resolve_state = UNSET else: @@ -49,7 +57,7 @@ def to_dict(self) -> dict[str, Any]: accept_threaded_emails = self.accept_threaded_emails - field_mappings_attributes: list[dict[str, Any]] | Unset = UNSET + field_mappings_attributes: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.field_mappings_attributes, Unset): field_mappings_attributes = [] for field_mappings_attributes_item_data in self.field_mappings_attributes: @@ -59,6 +67,8 @@ def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update({}) + if id is not UNSET: + field_dict["id"] = id if auto_resolve is not UNSET: field_dict["auto_resolve"] = auto_resolve if resolve_state is not UNSET: @@ -77,35 +87,37 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: ) d = dict(src_dict) + _id = d.pop("id", UNSET) + id: Union[Unset, UUID] + if isinstance(_id, Unset): + id = UNSET + else: + id = UUID(_id) + auto_resolve = d.pop("auto_resolve", UNSET) - def _parse_resolve_state(data: object) -> None | str | Unset: + def _parse_resolve_state(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) resolve_state = _parse_resolve_state(d.pop("resolve_state", UNSET)) accept_threaded_emails = d.pop("accept_threaded_emails", UNSET) + field_mappings_attributes = [] _field_mappings_attributes = d.pop("field_mappings_attributes", UNSET) - field_mappings_attributes: list[AlertsSourceSourceableAttributesType0FieldMappingsAttributesItem] | Unset = ( - UNSET - ) - if _field_mappings_attributes is not UNSET: - field_mappings_attributes = [] - for field_mappings_attributes_item_data in _field_mappings_attributes: - field_mappings_attributes_item = ( - AlertsSourceSourceableAttributesType0FieldMappingsAttributesItem.from_dict( - field_mappings_attributes_item_data - ) - ) + for field_mappings_attributes_item_data in _field_mappings_attributes or []: + field_mappings_attributes_item = AlertsSourceSourceableAttributesType0FieldMappingsAttributesItem.from_dict( + field_mappings_attributes_item_data + ) - field_mappings_attributes.append(field_mappings_attributes_item) + field_mappings_attributes.append(field_mappings_attributes_item) alerts_source_sourceable_attributes_type_0 = cls( + id=id, auto_resolve=auto_resolve, resolve_state=resolve_state, accept_threaded_emails=accept_threaded_emails, diff --git a/rootly_sdk/models/alerts_source_sourceable_attributes_type_0_field_mappings_attributes_item.py b/rootly_sdk/models/alerts_source_sourceable_attributes_type_0_field_mappings_attributes_item.py index af6141fc..6f68a4b5 100644 --- a/rootly_sdk/models/alerts_source_sourceable_attributes_type_0_field_mappings_attributes_item.py +++ b/rootly_sdk/models/alerts_source_sourceable_attributes_type_0_field_mappings_attributes_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,19 +17,19 @@ class AlertsSourceSourceableAttributesType0FieldMappingsAttributesItem: """ Attributes: - field (AlertsSourceSourceableAttributesType0FieldMappingsAttributesItemField | Unset): Select the field on which - the condition to be evaluated - json_path (str | Unset): JSON path expression to extract a specific value from the alert's payload for + field (Union[Unset, AlertsSourceSourceableAttributesType0FieldMappingsAttributesItemField]): Select the field on + which the condition to be evaluated + json_path (Union[Unset, str]): JSON path expression to extract a specific value from the alert's payload for evaluation. For `notification_target_id` only: if your account has opted in to Dynamic Notification Targets, this may also be a Liquid template that resolves to a notification target id at routing time. """ - field: AlertsSourceSourceableAttributesType0FieldMappingsAttributesItemField | Unset = UNSET - json_path: str | Unset = UNSET + field: Union[Unset, AlertsSourceSourceableAttributesType0FieldMappingsAttributesItemField] = UNSET + json_path: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - field: str | Unset = UNSET + field: Union[Unset, str] = UNSET if not isinstance(self.field, Unset): field = self.field @@ -51,7 +49,7 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _field = d.pop("field", UNSET) - field: AlertsSourceSourceableAttributesType0FieldMappingsAttributesItemField | Unset + field: Union[Unset, AlertsSourceSourceableAttributesType0FieldMappingsAttributesItemField] if isinstance(_field, Unset): field = UNSET else: diff --git a/rootly_sdk/models/api_key.py b/rootly_sdk/models/api_key.py index c58d6d6b..c523ec66 100644 --- a/rootly_sdk/models/api_key.py +++ b/rootly_sdk/models/api_key.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -20,24 +18,24 @@ class ApiKey: kind (ApiKeyKind): The kind of the API key created_at (str): Date of creation updated_at (str): Date of last update - description (None | str | Unset): A description of the API key - role_id (None | str | Unset): The role ID - on_call_role_id (None | str | Unset): The on-call role ID - expires_at (None | str | Unset): Expiration date - last_used_at (None | str | Unset): Date of last use - grace_period_ends_at (None | str | Unset): Grace period end date + description (Union[None, Unset, str]): A description of the API key + role_id (Union[None, Unset, str]): The role ID + on_call_role_id (Union[None, Unset, str]): The on-call role ID + expires_at (Union[None, Unset, str]): Expiration date + last_used_at (Union[None, Unset, str]): Date of last use + grace_period_ends_at (Union[None, Unset, str]): Grace period end date """ name: str kind: ApiKeyKind created_at: str updated_at: str - description: None | str | Unset = UNSET - role_id: None | str | Unset = UNSET - on_call_role_id: None | str | Unset = UNSET - expires_at: None | str | Unset = UNSET - last_used_at: None | str | Unset = UNSET - grace_period_ends_at: None | str | Unset = UNSET + description: Union[None, Unset, str] = UNSET + role_id: Union[None, Unset, str] = UNSET + on_call_role_id: Union[None, Unset, str] = UNSET + expires_at: Union[None, Unset, str] = UNSET + last_used_at: Union[None, Unset, str] = UNSET + grace_period_ends_at: Union[None, Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -49,37 +47,37 @@ def to_dict(self) -> dict[str, Any]: updated_at = self.updated_at - description: None | str | Unset + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: description = self.description - role_id: None | str | Unset + role_id: Union[None, Unset, str] if isinstance(self.role_id, Unset): role_id = UNSET else: role_id = self.role_id - on_call_role_id: None | str | Unset + on_call_role_id: Union[None, Unset, str] if isinstance(self.on_call_role_id, Unset): on_call_role_id = UNSET else: on_call_role_id = self.on_call_role_id - expires_at: None | str | Unset + expires_at: Union[None, Unset, str] if isinstance(self.expires_at, Unset): expires_at = UNSET else: expires_at = self.expires_at - last_used_at: None | str | Unset + last_used_at: Union[None, Unset, str] if isinstance(self.last_used_at, Unset): last_used_at = UNSET else: last_used_at = self.last_used_at - grace_period_ends_at: None | str | Unset + grace_period_ends_at: Union[None, Unset, str] if isinstance(self.grace_period_ends_at, Unset): grace_period_ends_at = UNSET else: @@ -121,57 +119,57 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: updated_at = d.pop("updated_at") - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) - def _parse_role_id(data: object) -> None | str | Unset: + def _parse_role_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) role_id = _parse_role_id(d.pop("role_id", UNSET)) - def _parse_on_call_role_id(data: object) -> None | str | Unset: + def _parse_on_call_role_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) on_call_role_id = _parse_on_call_role_id(d.pop("on_call_role_id", UNSET)) - def _parse_expires_at(data: object) -> None | str | Unset: + def _parse_expires_at(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) expires_at = _parse_expires_at(d.pop("expires_at", UNSET)) - def _parse_last_used_at(data: object) -> None | str | Unset: + def _parse_last_used_at(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) last_used_at = _parse_last_used_at(d.pop("last_used_at", UNSET)) - def _parse_grace_period_ends_at(data: object) -> None | str | Unset: + def _parse_grace_period_ends_at(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) grace_period_ends_at = _parse_grace_period_ends_at(d.pop("grace_period_ends_at", UNSET)) diff --git a/rootly_sdk/models/api_key_list.py b/rootly_sdk/models/api_key_list.py index ec533508..56537d28 100644 --- a/rootly_sdk/models/api_key_list.py +++ b/rootly_sdk/models/api_key_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,20 +20,19 @@ class ApiKeyList: """ Attributes: - data (list[ApiKeyListDataItem]): + data (list['ApiKeyListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[ApiKeyListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["ApiKeyListDataItem"] + links: "Links" + meta: "Meta" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) api_key_list = cls( data=data, diff --git a/rootly_sdk/models/api_key_list_data_item.py b/rootly_sdk/models/api_key_list_data_item.py index 805cc948..e34eec4d 100644 --- a/rootly_sdk/models/api_key_list_data_item.py +++ b/rootly_sdk/models/api_key_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class ApiKeyListDataItem: id: str type_: ApiKeyListDataItemType - attributes: ApiKey + attributes: "ApiKey" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/api_key_response.py b/rootly_sdk/models/api_key_response.py index 73e001f3..b9c73373 100644 --- a/rootly_sdk/models/api_key_response.py +++ b/rootly_sdk/models/api_key_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,18 +19,17 @@ class ApiKeyResponse: """ Attributes: data (ApiKeyResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: ApiKeyResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "ApiKeyResponseData" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = ApiKeyResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) api_key_response = cls( data=data, diff --git a/rootly_sdk/models/api_key_response_data.py b/rootly_sdk/models/api_key_response_data.py index ecc665d2..651f44fd 100644 --- a/rootly_sdk/models/api_key_response_data.py +++ b/rootly_sdk/models/api_key_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class ApiKeyResponseData: id: str type_: ApiKeyResponseDataType - attributes: ApiKey + attributes: "ApiKey" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/api_key_with_token_response.py b/rootly_sdk/models/api_key_with_token_response.py index 1d29d480..fab90172 100644 --- a/rootly_sdk/models/api_key_with_token_response.py +++ b/rootly_sdk/models/api_key_with_token_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,18 +19,17 @@ class ApiKeyWithTokenResponse: """ Attributes: data (ApiKeyWithTokenResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: ApiKeyWithTokenResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "ApiKeyWithTokenResponseData" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = ApiKeyWithTokenResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) api_key_with_token_response = cls( data=data, diff --git a/rootly_sdk/models/api_key_with_token_response_data.py b/rootly_sdk/models/api_key_with_token_response_data.py index 3df6e4e5..1b87d1ac 100644 --- a/rootly_sdk/models/api_key_with_token_response_data.py +++ b/rootly_sdk/models/api_key_with_token_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class ApiKeyWithTokenResponseData: id: str type_: ApiKeyWithTokenResponseDataType - attributes: ApiKeyWithTokenResponseDataAttributes + attributes: "ApiKeyWithTokenResponseDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/api_key_with_token_response_data_attributes.py b/rootly_sdk/models/api_key_with_token_response_data_attributes.py index 31d30f84..35f13582 100644 --- a/rootly_sdk/models/api_key_with_token_response_data_attributes.py +++ b/rootly_sdk/models/api_key_with_token_response_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,12 +19,12 @@ class ApiKeyWithTokenResponseDataAttributes: created_at (str): Date of creation updated_at (str): Date of last update token (str): The API key token (only shown once) - description (None | str | Unset): A description of the API key - role_id (None | str | Unset): The role ID - on_call_role_id (None | str | Unset): The on-call role ID - expires_at (None | str | Unset): Expiration date - last_used_at (None | str | Unset): Date of last use - grace_period_ends_at (None | str | Unset): Grace period end date + description (Union[None, Unset, str]): A description of the API key + role_id (Union[None, Unset, str]): The role ID + on_call_role_id (Union[None, Unset, str]): The on-call role ID + expires_at (Union[None, Unset, str]): Expiration date + last_used_at (Union[None, Unset, str]): Date of last use + grace_period_ends_at (Union[None, Unset, str]): Grace period end date """ name: str @@ -34,12 +32,12 @@ class ApiKeyWithTokenResponseDataAttributes: created_at: str updated_at: str token: str - description: None | str | Unset = UNSET - role_id: None | str | Unset = UNSET - on_call_role_id: None | str | Unset = UNSET - expires_at: None | str | Unset = UNSET - last_used_at: None | str | Unset = UNSET - grace_period_ends_at: None | str | Unset = UNSET + description: Union[None, Unset, str] = UNSET + role_id: Union[None, Unset, str] = UNSET + on_call_role_id: Union[None, Unset, str] = UNSET + expires_at: Union[None, Unset, str] = UNSET + last_used_at: Union[None, Unset, str] = UNSET + grace_period_ends_at: Union[None, Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -53,37 +51,37 @@ def to_dict(self) -> dict[str, Any]: token = self.token - description: None | str | Unset + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: description = self.description - role_id: None | str | Unset + role_id: Union[None, Unset, str] if isinstance(self.role_id, Unset): role_id = UNSET else: role_id = self.role_id - on_call_role_id: None | str | Unset + on_call_role_id: Union[None, Unset, str] if isinstance(self.on_call_role_id, Unset): on_call_role_id = UNSET else: on_call_role_id = self.on_call_role_id - expires_at: None | str | Unset + expires_at: Union[None, Unset, str] if isinstance(self.expires_at, Unset): expires_at = UNSET else: expires_at = self.expires_at - last_used_at: None | str | Unset + last_used_at: Union[None, Unset, str] if isinstance(self.last_used_at, Unset): last_used_at = UNSET else: last_used_at = self.last_used_at - grace_period_ends_at: None | str | Unset + grace_period_ends_at: Union[None, Unset, str] if isinstance(self.grace_period_ends_at, Unset): grace_period_ends_at = UNSET else: @@ -128,57 +126,57 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: token = d.pop("token") - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) - def _parse_role_id(data: object) -> None | str | Unset: + def _parse_role_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) role_id = _parse_role_id(d.pop("role_id", UNSET)) - def _parse_on_call_role_id(data: object) -> None | str | Unset: + def _parse_on_call_role_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) on_call_role_id = _parse_on_call_role_id(d.pop("on_call_role_id", UNSET)) - def _parse_expires_at(data: object) -> None | str | Unset: + def _parse_expires_at(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) expires_at = _parse_expires_at(d.pop("expires_at", UNSET)) - def _parse_last_used_at(data: object) -> None | str | Unset: + def _parse_last_used_at(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) last_used_at = _parse_last_used_at(d.pop("last_used_at", UNSET)) - def _parse_grace_period_ends_at(data: object) -> None | str | Unset: + def _parse_grace_period_ends_at(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) grace_period_ends_at = _parse_grace_period_ends_at(d.pop("grace_period_ends_at", UNSET)) diff --git a/rootly_sdk/models/archive_google_chat_spaces_task_params.py b/rootly_sdk/models/archive_google_chat_spaces_task_params.py index 2389e17f..79ec0c65 100644 --- a/rootly_sdk/models/archive_google_chat_spaces_task_params.py +++ b/rootly_sdk/models/archive_google_chat_spaces_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,22 +21,21 @@ class ArchiveGoogleChatSpacesTaskParams: """ Attributes: - spaces (list[ArchiveGoogleChatSpacesTaskParamsSpacesItem]): - task_type (ArchiveGoogleChatSpacesTaskParamsTaskType | Unset): + spaces (list['ArchiveGoogleChatSpacesTaskParamsSpacesItem']): + task_type (Union[Unset, ArchiveGoogleChatSpacesTaskParamsTaskType]): """ - spaces: list[ArchiveGoogleChatSpacesTaskParamsSpacesItem] - task_type: ArchiveGoogleChatSpacesTaskParamsTaskType | Unset = UNSET + spaces: list["ArchiveGoogleChatSpacesTaskParamsSpacesItem"] + task_type: Union[Unset, ArchiveGoogleChatSpacesTaskParamsTaskType] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - spaces = [] for spaces_item_data in self.spaces: spaces_item = spaces_item_data.to_dict() spaces.append(spaces_item) - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -69,7 +66,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: spaces.append(spaces_item) _task_type = d.pop("task_type", UNSET) - task_type: ArchiveGoogleChatSpacesTaskParamsTaskType | Unset + task_type: Union[Unset, ArchiveGoogleChatSpacesTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/archive_google_chat_spaces_task_params_spaces_item.py b/rootly_sdk/models/archive_google_chat_spaces_task_params_spaces_item.py index ae50ba42..12587f1f 100644 --- a/rootly_sdk/models/archive_google_chat_spaces_task_params_spaces_item.py +++ b/rootly_sdk/models/archive_google_chat_spaces_task_params_spaces_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class ArchiveGoogleChatSpacesTaskParamsSpacesItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/archive_microsoft_teams_channels_task_params.py b/rootly_sdk/models/archive_microsoft_teams_channels_task_params.py index 5187f9fd..43bd0dd3 100644 --- a/rootly_sdk/models/archive_microsoft_teams_channels_task_params.py +++ b/rootly_sdk/models/archive_microsoft_teams_channels_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -27,17 +25,16 @@ class ArchiveMicrosoftTeamsChannelsTaskParams: """ Attributes: team (ArchiveMicrosoftTeamsChannelsTaskParamsTeam): - channels (list[ArchiveMicrosoftTeamsChannelsTaskParamsChannelsItem]): - task_type (ArchiveMicrosoftTeamsChannelsTaskParamsTaskType | Unset): + channels (list['ArchiveMicrosoftTeamsChannelsTaskParamsChannelsItem']): + task_type (Union[Unset, ArchiveMicrosoftTeamsChannelsTaskParamsTaskType]): """ - team: ArchiveMicrosoftTeamsChannelsTaskParamsTeam - channels: list[ArchiveMicrosoftTeamsChannelsTaskParamsChannelsItem] - task_type: ArchiveMicrosoftTeamsChannelsTaskParamsTaskType | Unset = UNSET + team: "ArchiveMicrosoftTeamsChannelsTaskParamsTeam" + channels: list["ArchiveMicrosoftTeamsChannelsTaskParamsChannelsItem"] + task_type: Union[Unset, ArchiveMicrosoftTeamsChannelsTaskParamsTaskType] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - team = self.team.to_dict() channels = [] @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: channels_item = channels_item_data.to_dict() channels.append(channels_item) - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -82,7 +79,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: channels.append(channels_item) _task_type = d.pop("task_type", UNSET) - task_type: ArchiveMicrosoftTeamsChannelsTaskParamsTaskType | Unset + task_type: Union[Unset, ArchiveMicrosoftTeamsChannelsTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/archive_microsoft_teams_channels_task_params_channels_item.py b/rootly_sdk/models/archive_microsoft_teams_channels_task_params_channels_item.py index bf1a0ca0..69fe8347 100644 --- a/rootly_sdk/models/archive_microsoft_teams_channels_task_params_channels_item.py +++ b/rootly_sdk/models/archive_microsoft_teams_channels_task_params_channels_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class ArchiveMicrosoftTeamsChannelsTaskParamsChannelsItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/archive_microsoft_teams_channels_task_params_team.py b/rootly_sdk/models/archive_microsoft_teams_channels_task_params_team.py index 2bc1aa10..c0d28df1 100644 --- a/rootly_sdk/models/archive_microsoft_teams_channels_task_params_team.py +++ b/rootly_sdk/models/archive_microsoft_teams_channels_task_params_team.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class ArchiveMicrosoftTeamsChannelsTaskParamsTeam: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/archive_slack_channels_task_params.py b/rootly_sdk/models/archive_slack_channels_task_params.py index a808ecd2..6523b66c 100644 --- a/rootly_sdk/models/archive_slack_channels_task_params.py +++ b/rootly_sdk/models/archive_slack_channels_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,22 +21,21 @@ class ArchiveSlackChannelsTaskParams: """ Attributes: - channels (list[ArchiveSlackChannelsTaskParamsChannelsItem]): - task_type (ArchiveSlackChannelsTaskParamsTaskType | Unset): + channels (list['ArchiveSlackChannelsTaskParamsChannelsItem']): + task_type (Union[Unset, ArchiveSlackChannelsTaskParamsTaskType]): """ - channels: list[ArchiveSlackChannelsTaskParamsChannelsItem] - task_type: ArchiveSlackChannelsTaskParamsTaskType | Unset = UNSET + channels: list["ArchiveSlackChannelsTaskParamsChannelsItem"] + task_type: Union[Unset, ArchiveSlackChannelsTaskParamsTaskType] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - channels = [] for channels_item_data in self.channels: channels_item = channels_item_data.to_dict() channels.append(channels_item) - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -67,7 +64,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: channels.append(channels_item) _task_type = d.pop("task_type", UNSET) - task_type: ArchiveSlackChannelsTaskParamsTaskType | Unset + task_type: Union[Unset, ArchiveSlackChannelsTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/archive_slack_channels_task_params_channels_item.py b/rootly_sdk/models/archive_slack_channels_task_params_channels_item.py index dc246e77..aff89e32 100644 --- a/rootly_sdk/models/archive_slack_channels_task_params_channels_item.py +++ b/rootly_sdk/models/archive_slack_channels_task_params_channels_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class ArchiveSlackChannelsTaskParamsChannelsItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/assign_role_to_user.py b/rootly_sdk/models/assign_role_to_user.py index 947a8507..e28725e6 100644 --- a/rootly_sdk/models/assign_role_to_user.py +++ b/rootly_sdk/models/assign_role_to_user.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class AssignRoleToUser: data (AssignRoleToUserData): """ - data: AssignRoleToUserData + data: "AssignRoleToUserData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/assign_role_to_user_data.py b/rootly_sdk/models/assign_role_to_user_data.py index 461a07ed..7586cd3f 100644 --- a/rootly_sdk/models/assign_role_to_user_data.py +++ b/rootly_sdk/models/assign_role_to_user_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class AssignRoleToUserData: """ type_: AssignRoleToUserDataType - attributes: AssignRoleToUserDataAttributes + attributes: "AssignRoleToUserDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/assign_role_to_user_data_attributes.py b/rootly_sdk/models/assign_role_to_user_data_attributes.py index 466f8a92..5a8c512e 100644 --- a/rootly_sdk/models/assign_role_to_user_data_attributes.py +++ b/rootly_sdk/models/assign_role_to_user_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define @@ -14,12 +12,12 @@ class AssignRoleToUserDataAttributes: """ Attributes: - user_id (str | Unset): ID of user you wish to assign this incident - incident_role_id (str | Unset): ID of the incident role + user_id (Union[Unset, str]): ID of user you wish to assign this incident + incident_role_id (Union[Unset, str]): ID of the incident role """ - user_id: str | Unset = UNSET - incident_role_id: str | Unset = UNSET + user_id: Union[Unset, str] = UNSET + incident_role_id: Union[Unset, str] = UNSET def to_dict(self) -> dict[str, Any]: user_id = self.user_id diff --git a/rootly_sdk/models/attach_alert.py b/rootly_sdk/models/attach_alert.py index 39dc5313..556ace8e 100644 --- a/rootly_sdk/models/attach_alert.py +++ b/rootly_sdk/models/attach_alert.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class AttachAlert: data (AttachAlertData): """ - data: AttachAlertData + data: "AttachAlertData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/attach_alert_data.py b/rootly_sdk/models/attach_alert_data.py index 347f3b33..2fc46472 100644 --- a/rootly_sdk/models/attach_alert_data.py +++ b/rootly_sdk/models/attach_alert_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class AttachAlertData: """ type_: AttachAlertDataType - attributes: AttachAlertDataAttributes + attributes: "AttachAlertDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/attach_alert_data_attributes.py b/rootly_sdk/models/attach_alert_data_attributes.py index 6e524c81..02c1000d 100644 --- a/rootly_sdk/models/attach_alert_data_attributes.py +++ b/rootly_sdk/models/attach_alert_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -12,13 +10,13 @@ class AttachAlertDataAttributes: """ Attributes: - alert_ids (list[str] | None): Alert Id to attach to the incident + alert_ids (Union[None, list[str]]): Alert Id to attach to the incident """ - alert_ids: list[str] | None + alert_ids: Union[None, list[str]] def to_dict(self) -> dict[str, Any]: - alert_ids: list[str] | None + alert_ids: Union[None, list[str]] if isinstance(self.alert_ids, list): alert_ids = self.alert_ids @@ -39,7 +37,7 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_alert_ids(data: object) -> list[str] | None: + def _parse_alert_ids(data: object) -> Union[None, list[str]]: if data is None: return data try: @@ -48,9 +46,9 @@ def _parse_alert_ids(data: object) -> list[str] | None: alert_ids_type_0 = cast(list[str], data) return alert_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None, data) + return cast(Union[None, list[str]], data) alert_ids = _parse_alert_ids(d.pop("alert_ids")) diff --git a/rootly_sdk/models/attach_datadog_dashboards_task_params.py b/rootly_sdk/models/attach_datadog_dashboards_task_params.py index d40d148b..7c874b07 100644 --- a/rootly_sdk/models/attach_datadog_dashboards_task_params.py +++ b/rootly_sdk/models/attach_datadog_dashboards_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -28,32 +26,31 @@ class AttachDatadogDashboardsTaskParams: """ Attributes: - dashboards (list[AttachDatadogDashboardsTaskParamsDashboardsItem]): - task_type (AttachDatadogDashboardsTaskParamsTaskType | Unset): - post_to_incident_timeline (bool | Unset): - post_to_slack_channels (list[AttachDatadogDashboardsTaskParamsPostToSlackChannelsItem] | Unset): + dashboards (list['AttachDatadogDashboardsTaskParamsDashboardsItem']): + task_type (Union[Unset, AttachDatadogDashboardsTaskParamsTaskType]): + post_to_incident_timeline (Union[Unset, bool]): + post_to_slack_channels (Union[Unset, list['AttachDatadogDashboardsTaskParamsPostToSlackChannelsItem']]): """ - dashboards: list[AttachDatadogDashboardsTaskParamsDashboardsItem] - task_type: AttachDatadogDashboardsTaskParamsTaskType | Unset = UNSET - post_to_incident_timeline: bool | Unset = UNSET - post_to_slack_channels: list[AttachDatadogDashboardsTaskParamsPostToSlackChannelsItem] | Unset = UNSET + dashboards: list["AttachDatadogDashboardsTaskParamsDashboardsItem"] + task_type: Union[Unset, AttachDatadogDashboardsTaskParamsTaskType] = UNSET + post_to_incident_timeline: Union[Unset, bool] = UNSET + post_to_slack_channels: Union[Unset, list["AttachDatadogDashboardsTaskParamsPostToSlackChannelsItem"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - dashboards = [] for dashboards_item_data in self.dashboards: dashboards_item = dashboards_item_data.to_dict() dashboards.append(dashboards_item) - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type post_to_incident_timeline = self.post_to_incident_timeline - post_to_slack_channels: list[dict[str, Any]] | Unset = UNSET + post_to_slack_channels: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.post_to_slack_channels, Unset): post_to_slack_channels = [] for post_to_slack_channels_item_data in self.post_to_slack_channels: @@ -94,7 +91,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: dashboards.append(dashboards_item) _task_type = d.pop("task_type", UNSET) - task_type: AttachDatadogDashboardsTaskParamsTaskType | Unset + task_type: Union[Unset, AttachDatadogDashboardsTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: @@ -102,16 +99,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: post_to_incident_timeline = d.pop("post_to_incident_timeline", UNSET) + post_to_slack_channels = [] _post_to_slack_channels = d.pop("post_to_slack_channels", UNSET) - post_to_slack_channels: list[AttachDatadogDashboardsTaskParamsPostToSlackChannelsItem] | Unset = UNSET - if _post_to_slack_channels is not UNSET: - post_to_slack_channels = [] - for post_to_slack_channels_item_data in _post_to_slack_channels: - post_to_slack_channels_item = AttachDatadogDashboardsTaskParamsPostToSlackChannelsItem.from_dict( - post_to_slack_channels_item_data - ) + for post_to_slack_channels_item_data in _post_to_slack_channels or []: + post_to_slack_channels_item = AttachDatadogDashboardsTaskParamsPostToSlackChannelsItem.from_dict( + post_to_slack_channels_item_data + ) - post_to_slack_channels.append(post_to_slack_channels_item) + post_to_slack_channels.append(post_to_slack_channels_item) attach_datadog_dashboards_task_params = cls( dashboards=dashboards, diff --git a/rootly_sdk/models/attach_datadog_dashboards_task_params_dashboards_item.py b/rootly_sdk/models/attach_datadog_dashboards_task_params_dashboards_item.py index 5930e6f9..690ccc5d 100644 --- a/rootly_sdk/models/attach_datadog_dashboards_task_params_dashboards_item.py +++ b/rootly_sdk/models/attach_datadog_dashboards_task_params_dashboards_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class AttachDatadogDashboardsTaskParamsDashboardsItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/attach_datadog_dashboards_task_params_post_to_slack_channels_item.py b/rootly_sdk/models/attach_datadog_dashboards_task_params_post_to_slack_channels_item.py index 8436f266..53c9bad1 100644 --- a/rootly_sdk/models/attach_datadog_dashboards_task_params_post_to_slack_channels_item.py +++ b/rootly_sdk/models/attach_datadog_dashboards_task_params_post_to_slack_channels_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class AttachDatadogDashboardsTaskParamsPostToSlackChannelsItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/attach_retrospective_pdf_to_freshservice_ticket_task_params.py b/rootly_sdk/models/attach_retrospective_pdf_to_freshservice_ticket_task_params.py new file mode 100644 index 00000000..c80b4ce2 --- /dev/null +++ b/rootly_sdk/models/attach_retrospective_pdf_to_freshservice_ticket_task_params.py @@ -0,0 +1,90 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.attach_retrospective_pdf_to_freshservice_ticket_task_params_task_type import ( + AttachRetrospectivePdfToFreshserviceTicketTaskParamsTaskType, + check_attach_retrospective_pdf_to_freshservice_ticket_task_params_task_type, +) +from ..types import UNSET, Unset + +T = TypeVar("T", bound="AttachRetrospectivePdfToFreshserviceTicketTaskParams") + + +@_attrs_define +class AttachRetrospectivePdfToFreshserviceTicketTaskParams: + """ + Attributes: + ticket_id (str): The Freshservice ticket id + task_type (Union[Unset, AttachRetrospectivePdfToFreshserviceTicketTaskParamsTaskType]): + filename (Union[Unset, str]): The attachment filename + """ + + ticket_id: str + task_type: Union[Unset, AttachRetrospectivePdfToFreshserviceTicketTaskParamsTaskType] = UNSET + filename: Union[Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + ticket_id = self.ticket_id + + task_type: Union[Unset, str] = UNSET + if not isinstance(self.task_type, Unset): + task_type = self.task_type + + filename = self.filename + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "ticket_id": ticket_id, + } + ) + if task_type is not UNSET: + field_dict["task_type"] = task_type + if filename is not UNSET: + field_dict["filename"] = filename + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + ticket_id = d.pop("ticket_id") + + _task_type = d.pop("task_type", UNSET) + task_type: Union[Unset, AttachRetrospectivePdfToFreshserviceTicketTaskParamsTaskType] + if isinstance(_task_type, Unset): + task_type = UNSET + else: + task_type = check_attach_retrospective_pdf_to_freshservice_ticket_task_params_task_type(_task_type) + + filename = d.pop("filename", UNSET) + + attach_retrospective_pdf_to_freshservice_ticket_task_params = cls( + ticket_id=ticket_id, + task_type=task_type, + filename=filename, + ) + + attach_retrospective_pdf_to_freshservice_ticket_task_params.additional_properties = d + return attach_retrospective_pdf_to_freshservice_ticket_task_params + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/rootly_sdk/models/attach_retrospective_pdf_to_freshservice_ticket_task_params_task_type.py b/rootly_sdk/models/attach_retrospective_pdf_to_freshservice_ticket_task_params_task_type.py new file mode 100644 index 00000000..dda7dcb5 --- /dev/null +++ b/rootly_sdk/models/attach_retrospective_pdf_to_freshservice_ticket_task_params_task_type.py @@ -0,0 +1,23 @@ +from typing import Literal, cast + +AttachRetrospectivePdfToFreshserviceTicketTaskParamsTaskType = Literal[ + "attach_retrospective_pdf_to_freshservice_ticket" +] + +ATTACH_RETROSPECTIVE_PDF_TO_FRESHSERVICE_TICKET_TASK_PARAMS_TASK_TYPE_VALUES: set[ + AttachRetrospectivePdfToFreshserviceTicketTaskParamsTaskType +] = { + "attach_retrospective_pdf_to_freshservice_ticket", +} + + +def check_attach_retrospective_pdf_to_freshservice_ticket_task_params_task_type( + value: str | None, +) -> AttachRetrospectivePdfToFreshserviceTicketTaskParamsTaskType | None: + if value is None: + return None + if value in ATTACH_RETROSPECTIVE_PDF_TO_FRESHSERVICE_TICKET_TASK_PARAMS_TASK_TYPE_VALUES: + return cast(AttachRetrospectivePdfToFreshserviceTicketTaskParamsTaskType, value) + raise TypeError( + f"Unexpected value {value!r}. Expected one of {ATTACH_RETROSPECTIVE_PDF_TO_FRESHSERVICE_TICKET_TASK_PARAMS_TASK_TYPE_VALUES!r}" + ) diff --git a/rootly_sdk/models/attach_retrospective_pdf_to_jira_issue_task_params.py b/rootly_sdk/models/attach_retrospective_pdf_to_jira_issue_task_params.py index 64c10013..63d006ec 100644 --- a/rootly_sdk/models/attach_retrospective_pdf_to_jira_issue_task_params.py +++ b/rootly_sdk/models/attach_retrospective_pdf_to_jira_issue_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -26,27 +24,26 @@ class AttachRetrospectivePdfToJiraIssueTaskParams: """ Attributes: issue_id (str): The issue id - task_type (AttachRetrospectivePdfToJiraIssueTaskParamsTaskType | Unset): - integration (AttachRetrospectivePdfToJiraIssueTaskParamsIntegration | Unset): Specify integration id if you have - more than one Jira instance - filename (str | Unset): The attachment filename + task_type (Union[Unset, AttachRetrospectivePdfToJiraIssueTaskParamsTaskType]): + integration (Union[Unset, AttachRetrospectivePdfToJiraIssueTaskParamsIntegration]): Specify integration id if + you have more than one Jira instance + filename (Union[Unset, str]): The attachment filename """ issue_id: str - task_type: AttachRetrospectivePdfToJiraIssueTaskParamsTaskType | Unset = UNSET - integration: AttachRetrospectivePdfToJiraIssueTaskParamsIntegration | Unset = UNSET - filename: str | Unset = UNSET + task_type: Union[Unset, AttachRetrospectivePdfToJiraIssueTaskParamsTaskType] = UNSET + integration: Union[Unset, "AttachRetrospectivePdfToJiraIssueTaskParamsIntegration"] = UNSET + filename: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - issue_id = self.issue_id - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - integration: dict[str, Any] | Unset = UNSET + integration: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.integration, Unset): integration = self.integration.to_dict() @@ -78,14 +75,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: issue_id = d.pop("issue_id") _task_type = d.pop("task_type", UNSET) - task_type: AttachRetrospectivePdfToJiraIssueTaskParamsTaskType | Unset + task_type: Union[Unset, AttachRetrospectivePdfToJiraIssueTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: task_type = check_attach_retrospective_pdf_to_jira_issue_task_params_task_type(_task_type) _integration = d.pop("integration", UNSET) - integration: AttachRetrospectivePdfToJiraIssueTaskParamsIntegration | Unset + integration: Union[Unset, AttachRetrospectivePdfToJiraIssueTaskParamsIntegration] if isinstance(_integration, Unset): integration = UNSET else: diff --git a/rootly_sdk/models/attach_retrospective_pdf_to_jira_issue_task_params_integration.py b/rootly_sdk/models/attach_retrospective_pdf_to_jira_issue_task_params_integration.py index 8041a47a..92deaba2 100644 --- a/rootly_sdk/models/attach_retrospective_pdf_to_jira_issue_task_params_integration.py +++ b/rootly_sdk/models/attach_retrospective_pdf_to_jira_issue_task_params_integration.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,12 +14,12 @@ class AttachRetrospectivePdfToJiraIssueTaskParamsIntegration: """Specify integration id if you have more than one Jira instance Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/audit.py b/rootly_sdk/models/audit.py index 1efaa9d8..a5c31508 100644 --- a/rootly_sdk/models/audit.py +++ b/rootly_sdk/models/audit.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,38 +21,38 @@ class Audit: Attributes: event (str): Describes the action that was taken. created_at (str): Date of creation - item_type (AuditItemType | Unset): Describes the object in which the action was taken on - item_type_display (None | str | Unset): Human-friendly display name for the item type - object_ (AuditObjectType0 | None | Unset): The object in which the action was taken on - object_changes (AuditObjectChangesType0 | None | Unset): The changes that occurred on the object - user_id (int | None | Unset): The ID of who took action on the object. Together with whodunnit_type can be used - to find the user - user_name (None | str | Unset): Display name of the user who performed the action - user_email (None | str | Unset): Email address of the user who performed the action - ip_address (None | str | Unset): IP address of the client that performed the action - user_agent (None | str | Unset): User-Agent header of the client that performed the action - request_id (None | str | Unset): Unique request ID (UUID) for the HTTP request that triggered the action - session_id (None | str | Unset): SHA-256 fingerprint of the web session for correlating multiple actions within - the same browser session - item_id (None | str | Unset): ID of the affected object - id (int | None | Unset): ID of audit + item_type (Union[Unset, AuditItemType]): Describes the object in which the action was taken on + item_type_display (Union[None, Unset, str]): Human-friendly display name for the item type + object_ (Union['AuditObjectType0', None, Unset]): The object in which the action was taken on + object_changes (Union['AuditObjectChangesType0', None, Unset]): The changes that occurred on the object + user_id (Union[None, Unset, int]): The ID of who took action on the object. Together with whodunnit_type can be + used to find the user + user_name (Union[None, Unset, str]): Display name of the user who performed the action + user_email (Union[None, Unset, str]): Email address of the user who performed the action + ip_address (Union[None, Unset, str]): IP address of the client that performed the action + user_agent (Union[None, Unset, str]): User-Agent header of the client that performed the action + request_id (Union[None, Unset, str]): Unique request ID (UUID) for the HTTP request that triggered the action + session_id (Union[None, Unset, str]): SHA-256 fingerprint of the web session for correlating multiple actions + within the same browser session + item_id (Union[None, Unset, str]): ID of the affected object + id (Union[None, Unset, int]): ID of audit """ event: str created_at: str - item_type: AuditItemType | Unset = UNSET - item_type_display: None | str | Unset = UNSET - object_: AuditObjectType0 | None | Unset = UNSET - object_changes: AuditObjectChangesType0 | None | Unset = UNSET - user_id: int | None | Unset = UNSET - user_name: None | str | Unset = UNSET - user_email: None | str | Unset = UNSET - ip_address: None | str | Unset = UNSET - user_agent: None | str | Unset = UNSET - request_id: None | str | Unset = UNSET - session_id: None | str | Unset = UNSET - item_id: None | str | Unset = UNSET - id: int | None | Unset = UNSET + item_type: Union[Unset, AuditItemType] = UNSET + item_type_display: Union[None, Unset, str] = UNSET + object_: Union["AuditObjectType0", None, Unset] = UNSET + object_changes: Union["AuditObjectChangesType0", None, Unset] = UNSET + user_id: Union[None, Unset, int] = UNSET + user_name: Union[None, Unset, str] = UNSET + user_email: Union[None, Unset, str] = UNSET + ip_address: Union[None, Unset, str] = UNSET + user_agent: Union[None, Unset, str] = UNSET + request_id: Union[None, Unset, str] = UNSET + session_id: Union[None, Unset, str] = UNSET + item_id: Union[None, Unset, str] = UNSET + id: Union[None, Unset, int] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -65,17 +63,17 @@ def to_dict(self) -> dict[str, Any]: created_at = self.created_at - item_type: str | Unset = UNSET + item_type: Union[Unset, str] = UNSET if not isinstance(self.item_type, Unset): item_type = self.item_type - item_type_display: None | str | Unset + item_type_display: Union[None, Unset, str] if isinstance(self.item_type_display, Unset): item_type_display = UNSET else: item_type_display = self.item_type_display - object_: dict[str, Any] | None | Unset + object_: Union[None, Unset, dict[str, Any]] if isinstance(self.object_, Unset): object_ = UNSET elif isinstance(self.object_, AuditObjectType0): @@ -83,7 +81,7 @@ def to_dict(self) -> dict[str, Any]: else: object_ = self.object_ - object_changes: dict[str, Any] | None | Unset + object_changes: Union[None, Unset, dict[str, Any]] if isinstance(self.object_changes, Unset): object_changes = UNSET elif isinstance(self.object_changes, AuditObjectChangesType0): @@ -91,55 +89,55 @@ def to_dict(self) -> dict[str, Any]: else: object_changes = self.object_changes - user_id: int | None | Unset + user_id: Union[None, Unset, int] if isinstance(self.user_id, Unset): user_id = UNSET else: user_id = self.user_id - user_name: None | str | Unset + user_name: Union[None, Unset, str] if isinstance(self.user_name, Unset): user_name = UNSET else: user_name = self.user_name - user_email: None | str | Unset + user_email: Union[None, Unset, str] if isinstance(self.user_email, Unset): user_email = UNSET else: user_email = self.user_email - ip_address: None | str | Unset + ip_address: Union[None, Unset, str] if isinstance(self.ip_address, Unset): ip_address = UNSET else: ip_address = self.ip_address - user_agent: None | str | Unset + user_agent: Union[None, Unset, str] if isinstance(self.user_agent, Unset): user_agent = UNSET else: user_agent = self.user_agent - request_id: None | str | Unset + request_id: Union[None, Unset, str] if isinstance(self.request_id, Unset): request_id = UNSET else: request_id = self.request_id - session_id: None | str | Unset + session_id: Union[None, Unset, str] if isinstance(self.session_id, Unset): session_id = UNSET else: session_id = self.session_id - item_id: None | str | Unset + item_id: Union[None, Unset, str] if isinstance(self.item_id, Unset): item_id = UNSET else: item_id = self.item_id - id: int | None | Unset + id: Union[None, Unset, int] if isinstance(self.id, Unset): id = UNSET else: @@ -193,22 +191,22 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: created_at = d.pop("created_at") _item_type = d.pop("item_type", UNSET) - item_type: AuditItemType | Unset + item_type: Union[Unset, AuditItemType] if isinstance(_item_type, Unset): item_type = UNSET else: item_type = check_audit_item_type(_item_type) - def _parse_item_type_display(data: object) -> None | str | Unset: + def _parse_item_type_display(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) item_type_display = _parse_item_type_display(d.pop("item_type_display", UNSET)) - def _parse_object_(data: object) -> AuditObjectType0 | None | Unset: + def _parse_object_(data: object) -> Union["AuditObjectType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -219,13 +217,13 @@ def _parse_object_(data: object) -> AuditObjectType0 | None | Unset: object_type_0 = AuditObjectType0.from_dict(data) return object_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(AuditObjectType0 | None | Unset, data) + return cast(Union["AuditObjectType0", None, Unset], data) object_ = _parse_object_(d.pop("object", UNSET)) - def _parse_object_changes(data: object) -> AuditObjectChangesType0 | None | Unset: + def _parse_object_changes(data: object) -> Union["AuditObjectChangesType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -236,90 +234,90 @@ def _parse_object_changes(data: object) -> AuditObjectChangesType0 | None | Unse object_changes_type_0 = AuditObjectChangesType0.from_dict(data) return object_changes_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(AuditObjectChangesType0 | None | Unset, data) + return cast(Union["AuditObjectChangesType0", None, Unset], data) object_changes = _parse_object_changes(d.pop("object_changes", UNSET)) - def _parse_user_id(data: object) -> int | None | Unset: + def _parse_user_id(data: object) -> Union[None, Unset, int]: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(Union[None, Unset, int], data) user_id = _parse_user_id(d.pop("user_id", UNSET)) - def _parse_user_name(data: object) -> None | str | Unset: + def _parse_user_name(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) user_name = _parse_user_name(d.pop("user_name", UNSET)) - def _parse_user_email(data: object) -> None | str | Unset: + def _parse_user_email(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) user_email = _parse_user_email(d.pop("user_email", UNSET)) - def _parse_ip_address(data: object) -> None | str | Unset: + def _parse_ip_address(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) ip_address = _parse_ip_address(d.pop("ip_address", UNSET)) - def _parse_user_agent(data: object) -> None | str | Unset: + def _parse_user_agent(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) user_agent = _parse_user_agent(d.pop("user_agent", UNSET)) - def _parse_request_id(data: object) -> None | str | Unset: + def _parse_request_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) request_id = _parse_request_id(d.pop("request_id", UNSET)) - def _parse_session_id(data: object) -> None | str | Unset: + def _parse_session_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) session_id = _parse_session_id(d.pop("session_id", UNSET)) - def _parse_item_id(data: object) -> None | str | Unset: + def _parse_item_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) item_id = _parse_item_id(d.pop("item_id", UNSET)) - def _parse_id(data: object) -> int | None | Unset: + def _parse_id(data: object) -> Union[None, Unset, int]: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(Union[None, Unset, int], data) id = _parse_id(d.pop("id", UNSET)) diff --git a/rootly_sdk/models/audit_object_changes_type_0.py b/rootly_sdk/models/audit_object_changes_type_0.py index adacb420..c26c297b 100644 --- a/rootly_sdk/models/audit_object_changes_type_0.py +++ b/rootly_sdk/models/audit_object_changes_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,7 +14,6 @@ class AuditObjectChangesType0: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) diff --git a/rootly_sdk/models/audit_object_type_0.py b/rootly_sdk/models/audit_object_type_0.py index 2a1a35a1..66c54325 100644 --- a/rootly_sdk/models/audit_object_type_0.py +++ b/rootly_sdk/models/audit_object_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,7 +14,6 @@ class AuditObjectType0: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) diff --git a/rootly_sdk/models/audits_list.py b/rootly_sdk/models/audits_list.py index 85729264..9b1c234d 100644 --- a/rootly_sdk/models/audits_list.py +++ b/rootly_sdk/models/audits_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,20 +20,19 @@ class AuditsList: """ Attributes: - data (list[AuditsListDataItem]): + data (list['AuditsListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[AuditsListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["AuditsListDataItem"] + links: "Links" + meta: "Meta" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) audits_list = cls( data=data, diff --git a/rootly_sdk/models/audits_list_data_item.py b/rootly_sdk/models/audits_list_data_item.py index 4056d5dd..94b30791 100644 --- a/rootly_sdk/models/audits_list_data_item.py +++ b/rootly_sdk/models/audits_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class AuditsListDataItem: id: str type_: AuditsListDataItemType - attributes: Audit + attributes: "Audit" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/authorization.py b/rootly_sdk/models/authorization.py index 62b21259..8e600ea8 100644 --- a/rootly_sdk/models/authorization.py +++ b/rootly_sdk/models/authorization.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/authorization_list.py b/rootly_sdk/models/authorization_list.py index a3e81667..d003cf14 100644 --- a/rootly_sdk/models/authorization_list.py +++ b/rootly_sdk/models/authorization_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,20 +20,19 @@ class AuthorizationList: """ Attributes: - data (list[AuthorizationListDataItem]): + data (list['AuthorizationListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[AuthorizationListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["AuthorizationListDataItem"] + links: "Links" + meta: "Meta" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) authorization_list = cls( data=data, diff --git a/rootly_sdk/models/authorization_list_data_item.py b/rootly_sdk/models/authorization_list_data_item.py index bbd20e83..254bb294 100644 --- a/rootly_sdk/models/authorization_list_data_item.py +++ b/rootly_sdk/models/authorization_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class AuthorizationListDataItem: id: str type_: AuthorizationListDataItemType - attributes: Authorization + attributes: "Authorization" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/authorization_response.py b/rootly_sdk/models/authorization_response.py index 8ac40ff2..a49c86fe 100644 --- a/rootly_sdk/models/authorization_response.py +++ b/rootly_sdk/models/authorization_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,18 +19,17 @@ class AuthorizationResponse: """ Attributes: data (AuthorizationResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: AuthorizationResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "AuthorizationResponseData" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = AuthorizationResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) authorization_response = cls( data=data, diff --git a/rootly_sdk/models/authorization_response_data.py b/rootly_sdk/models/authorization_response_data.py index 16703d12..0b141026 100644 --- a/rootly_sdk/models/authorization_response_data.py +++ b/rootly_sdk/models/authorization_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class AuthorizationResponseData: id: str type_: AuthorizationResponseDataType - attributes: Authorization + attributes: "Authorization" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/auto_assign_role_opsgenie_task_params.py b/rootly_sdk/models/auto_assign_role_opsgenie_task_params.py index ab61baa7..cb11e3aa 100644 --- a/rootly_sdk/models/auto_assign_role_opsgenie_task_params.py +++ b/rootly_sdk/models/auto_assign_role_opsgenie_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -25,21 +23,20 @@ class AutoAssignRoleOpsgenieTaskParams: Attributes: incident_role_id (str): The role id schedule (AutoAssignRoleOpsgenieTaskParamsSchedule): - task_type (AutoAssignRoleOpsgenieTaskParamsTaskType | Unset): + task_type (Union[Unset, AutoAssignRoleOpsgenieTaskParamsTaskType]): """ incident_role_id: str - schedule: AutoAssignRoleOpsgenieTaskParamsSchedule - task_type: AutoAssignRoleOpsgenieTaskParamsTaskType | Unset = UNSET + schedule: "AutoAssignRoleOpsgenieTaskParamsSchedule" + task_type: Union[Unset, AutoAssignRoleOpsgenieTaskParamsTaskType] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - incident_role_id = self.incident_role_id schedule = self.schedule.to_dict() - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -66,7 +63,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: schedule = AutoAssignRoleOpsgenieTaskParamsSchedule.from_dict(d.pop("schedule")) _task_type = d.pop("task_type", UNSET) - task_type: AutoAssignRoleOpsgenieTaskParamsTaskType | Unset + task_type: Union[Unset, AutoAssignRoleOpsgenieTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/auto_assign_role_opsgenie_task_params_schedule.py b/rootly_sdk/models/auto_assign_role_opsgenie_task_params_schedule.py index d9929206..c5d5fbb2 100644 --- a/rootly_sdk/models/auto_assign_role_opsgenie_task_params_schedule.py +++ b/rootly_sdk/models/auto_assign_role_opsgenie_task_params_schedule.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class AutoAssignRoleOpsgenieTaskParamsSchedule: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/auto_assign_role_pagerduty_task_params_type_0_schedule.py b/rootly_sdk/models/auto_assign_role_pagerduty_task_params_type_0_schedule.py index cd35eaf2..9d5ae5c1 100644 --- a/rootly_sdk/models/auto_assign_role_pagerduty_task_params_type_0_schedule.py +++ b/rootly_sdk/models/auto_assign_role_pagerduty_task_params_type_0_schedule.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class AutoAssignRolePagerdutyTaskParamsType0Schedule: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/auto_assign_role_pagerduty_task_params_type_1_escalation_policy.py b/rootly_sdk/models/auto_assign_role_pagerduty_task_params_type_1_escalation_policy.py index 3ef911c2..33870a7e 100644 --- a/rootly_sdk/models/auto_assign_role_pagerduty_task_params_type_1_escalation_policy.py +++ b/rootly_sdk/models/auto_assign_role_pagerduty_task_params_type_1_escalation_policy.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class AutoAssignRolePagerdutyTaskParamsType1EscalationPolicy: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/auto_assign_role_rootly_task_params.py b/rootly_sdk/models/auto_assign_role_rootly_task_params.py deleted file mode 100644 index 865859ae..00000000 --- a/rootly_sdk/models/auto_assign_role_rootly_task_params.py +++ /dev/null @@ -1,190 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..models.auto_assign_role_rootly_task_params_task_type import ( - AutoAssignRoleRootlyTaskParamsTaskType, - check_auto_assign_role_rootly_task_params_task_type, -) -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.auto_assign_role_rootly_task_params_escalation_policy_target import ( - AutoAssignRoleRootlyTaskParamsEscalationPolicyTarget, - ) - from ..models.auto_assign_role_rootly_task_params_group_target import AutoAssignRoleRootlyTaskParamsGroupTarget - from ..models.auto_assign_role_rootly_task_params_schedule_target import ( - AutoAssignRoleRootlyTaskParamsScheduleTarget, - ) - from ..models.auto_assign_role_rootly_task_params_service_target import AutoAssignRoleRootlyTaskParamsServiceTarget - from ..models.auto_assign_role_rootly_task_params_user_target import AutoAssignRoleRootlyTaskParamsUserTarget - - -T = TypeVar("T", bound="AutoAssignRoleRootlyTaskParams") - - -@_attrs_define -class AutoAssignRoleRootlyTaskParams: - """ - Attributes: - incident_role_id (str): The role id - task_type (AutoAssignRoleRootlyTaskParamsTaskType | Unset): - escalation_policy_target (AutoAssignRoleRootlyTaskParamsEscalationPolicyTarget | Unset): - service_target (AutoAssignRoleRootlyTaskParamsServiceTarget | Unset): - user_target (AutoAssignRoleRootlyTaskParamsUserTarget | Unset): - group_target (AutoAssignRoleRootlyTaskParamsGroupTarget | Unset): - schedule_target (AutoAssignRoleRootlyTaskParamsScheduleTarget | Unset): - """ - - incident_role_id: str - task_type: AutoAssignRoleRootlyTaskParamsTaskType | Unset = UNSET - escalation_policy_target: AutoAssignRoleRootlyTaskParamsEscalationPolicyTarget | Unset = UNSET - service_target: AutoAssignRoleRootlyTaskParamsServiceTarget | Unset = UNSET - user_target: AutoAssignRoleRootlyTaskParamsUserTarget | Unset = UNSET - group_target: AutoAssignRoleRootlyTaskParamsGroupTarget | Unset = UNSET - schedule_target: AutoAssignRoleRootlyTaskParamsScheduleTarget | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - incident_role_id = self.incident_role_id - - task_type: str | Unset = UNSET - if not isinstance(self.task_type, Unset): - task_type = self.task_type - - escalation_policy_target: dict[str, Any] | Unset = UNSET - if not isinstance(self.escalation_policy_target, Unset): - escalation_policy_target = self.escalation_policy_target.to_dict() - - service_target: dict[str, Any] | Unset = UNSET - if not isinstance(self.service_target, Unset): - service_target = self.service_target.to_dict() - - user_target: dict[str, Any] | Unset = UNSET - if not isinstance(self.user_target, Unset): - user_target = self.user_target.to_dict() - - group_target: dict[str, Any] | Unset = UNSET - if not isinstance(self.group_target, Unset): - group_target = self.group_target.to_dict() - - schedule_target: dict[str, Any] | Unset = UNSET - if not isinstance(self.schedule_target, Unset): - schedule_target = self.schedule_target.to_dict() - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "incident_role_id": incident_role_id, - } - ) - if task_type is not UNSET: - field_dict["task_type"] = task_type - if escalation_policy_target is not UNSET: - field_dict["escalation_policy_target"] = escalation_policy_target - if service_target is not UNSET: - field_dict["service_target"] = service_target - if user_target is not UNSET: - field_dict["user_target"] = user_target - if group_target is not UNSET: - field_dict["group_target"] = group_target - if schedule_target is not UNSET: - field_dict["schedule_target"] = schedule_target - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.auto_assign_role_rootly_task_params_escalation_policy_target import ( - AutoAssignRoleRootlyTaskParamsEscalationPolicyTarget, - ) - from ..models.auto_assign_role_rootly_task_params_group_target import AutoAssignRoleRootlyTaskParamsGroupTarget - from ..models.auto_assign_role_rootly_task_params_schedule_target import ( - AutoAssignRoleRootlyTaskParamsScheduleTarget, - ) - from ..models.auto_assign_role_rootly_task_params_service_target import ( - AutoAssignRoleRootlyTaskParamsServiceTarget, - ) - from ..models.auto_assign_role_rootly_task_params_user_target import AutoAssignRoleRootlyTaskParamsUserTarget - - d = dict(src_dict) - incident_role_id = d.pop("incident_role_id") - - _task_type = d.pop("task_type", UNSET) - task_type: AutoAssignRoleRootlyTaskParamsTaskType | Unset - if isinstance(_task_type, Unset): - task_type = UNSET - else: - task_type = check_auto_assign_role_rootly_task_params_task_type(_task_type) - - _escalation_policy_target = d.pop("escalation_policy_target", UNSET) - escalation_policy_target: AutoAssignRoleRootlyTaskParamsEscalationPolicyTarget | Unset - if isinstance(_escalation_policy_target, Unset): - escalation_policy_target = UNSET - else: - escalation_policy_target = AutoAssignRoleRootlyTaskParamsEscalationPolicyTarget.from_dict( - _escalation_policy_target - ) - - _service_target = d.pop("service_target", UNSET) - service_target: AutoAssignRoleRootlyTaskParamsServiceTarget | Unset - if isinstance(_service_target, Unset): - service_target = UNSET - else: - service_target = AutoAssignRoleRootlyTaskParamsServiceTarget.from_dict(_service_target) - - _user_target = d.pop("user_target", UNSET) - user_target: AutoAssignRoleRootlyTaskParamsUserTarget | Unset - if isinstance(_user_target, Unset): - user_target = UNSET - else: - user_target = AutoAssignRoleRootlyTaskParamsUserTarget.from_dict(_user_target) - - _group_target = d.pop("group_target", UNSET) - group_target: AutoAssignRoleRootlyTaskParamsGroupTarget | Unset - if isinstance(_group_target, Unset): - group_target = UNSET - else: - group_target = AutoAssignRoleRootlyTaskParamsGroupTarget.from_dict(_group_target) - - _schedule_target = d.pop("schedule_target", UNSET) - schedule_target: AutoAssignRoleRootlyTaskParamsScheduleTarget | Unset - if isinstance(_schedule_target, Unset): - schedule_target = UNSET - else: - schedule_target = AutoAssignRoleRootlyTaskParamsScheduleTarget.from_dict(_schedule_target) - - auto_assign_role_rootly_task_params = cls( - incident_role_id=incident_role_id, - task_type=task_type, - escalation_policy_target=escalation_policy_target, - service_target=service_target, - user_target=user_target, - group_target=group_target, - schedule_target=schedule_target, - ) - - auto_assign_role_rootly_task_params.additional_properties = d - return auto_assign_role_rootly_task_params - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/rootly_sdk/models/auto_assign_role_rootly_task_params_task_type.py b/rootly_sdk/models/auto_assign_role_rootly_task_params_task_type.py deleted file mode 100644 index 5c0e317f..00000000 --- a/rootly_sdk/models/auto_assign_role_rootly_task_params_task_type.py +++ /dev/null @@ -1,19 +0,0 @@ -from typing import Literal, cast - -AutoAssignRoleRootlyTaskParamsTaskType = Literal["auto_assign_role_rootly"] - -AUTO_ASSIGN_ROLE_ROOTLY_TASK_PARAMS_TASK_TYPE_VALUES: set[AutoAssignRoleRootlyTaskParamsTaskType] = { - "auto_assign_role_rootly", -} - - -def check_auto_assign_role_rootly_task_params_task_type( - value: str | None, -) -> AutoAssignRoleRootlyTaskParamsTaskType | None: - if value is None: - return None - if value in AUTO_ASSIGN_ROLE_ROOTLY_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(AutoAssignRoleRootlyTaskParamsTaskType, value) - raise TypeError( - f"Unexpected value {value!r}. Expected one of {AUTO_ASSIGN_ROLE_ROOTLY_TASK_PARAMS_TASK_TYPE_VALUES!r}" - ) diff --git a/rootly_sdk/models/auto_assign_role_rootly_task_params_escalation_policy_target.py b/rootly_sdk/models/auto_assign_role_rootly_task_params_type_0_escalation_policy_target.py similarity index 70% rename from rootly_sdk/models/auto_assign_role_rootly_task_params_escalation_policy_target.py rename to rootly_sdk/models/auto_assign_role_rootly_task_params_type_0_escalation_policy_target.py index 4f2dc0fb..328eb935 100644 --- a/rootly_sdk/models/auto_assign_role_rootly_task_params_escalation_policy_target.py +++ b/rootly_sdk/models/auto_assign_role_rootly_task_params_type_0_escalation_policy_target.py @@ -1,26 +1,24 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field from ..types import UNSET, Unset -T = TypeVar("T", bound="AutoAssignRoleRootlyTaskParamsEscalationPolicyTarget") +T = TypeVar("T", bound="AutoAssignRoleRootlyTaskParamsType0EscalationPolicyTarget") @_attrs_define -class AutoAssignRoleRootlyTaskParamsEscalationPolicyTarget: +class AutoAssignRoleRootlyTaskParamsType0EscalationPolicyTarget: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -45,13 +43,13 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name = d.pop("name", UNSET) - auto_assign_role_rootly_task_params_escalation_policy_target = cls( + auto_assign_role_rootly_task_params_type_0_escalation_policy_target = cls( id=id, name=name, ) - auto_assign_role_rootly_task_params_escalation_policy_target.additional_properties = d - return auto_assign_role_rootly_task_params_escalation_policy_target + auto_assign_role_rootly_task_params_type_0_escalation_policy_target.additional_properties = d + return auto_assign_role_rootly_task_params_type_0_escalation_policy_target @property def additional_keys(self) -> list[str]: diff --git a/rootly_sdk/models/auto_assign_role_rootly_task_params_schedule_target.py b/rootly_sdk/models/auto_assign_role_rootly_task_params_type_1_service_target.py similarity index 71% rename from rootly_sdk/models/auto_assign_role_rootly_task_params_schedule_target.py rename to rootly_sdk/models/auto_assign_role_rootly_task_params_type_1_service_target.py index 1f6e3338..b32ca81a 100644 --- a/rootly_sdk/models/auto_assign_role_rootly_task_params_schedule_target.py +++ b/rootly_sdk/models/auto_assign_role_rootly_task_params_type_1_service_target.py @@ -1,26 +1,24 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field from ..types import UNSET, Unset -T = TypeVar("T", bound="AutoAssignRoleRootlyTaskParamsScheduleTarget") +T = TypeVar("T", bound="AutoAssignRoleRootlyTaskParamsType1ServiceTarget") @_attrs_define -class AutoAssignRoleRootlyTaskParamsScheduleTarget: +class AutoAssignRoleRootlyTaskParamsType1ServiceTarget: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -45,13 +43,13 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name = d.pop("name", UNSET) - auto_assign_role_rootly_task_params_schedule_target = cls( + auto_assign_role_rootly_task_params_type_1_service_target = cls( id=id, name=name, ) - auto_assign_role_rootly_task_params_schedule_target.additional_properties = d - return auto_assign_role_rootly_task_params_schedule_target + auto_assign_role_rootly_task_params_type_1_service_target.additional_properties = d + return auto_assign_role_rootly_task_params_type_1_service_target @property def additional_keys(self) -> list[str]: diff --git a/rootly_sdk/models/auto_assign_role_rootly_task_params_service_target.py b/rootly_sdk/models/auto_assign_role_rootly_task_params_type_2_user_target.py similarity index 72% rename from rootly_sdk/models/auto_assign_role_rootly_task_params_service_target.py rename to rootly_sdk/models/auto_assign_role_rootly_task_params_type_2_user_target.py index e8908713..d9158122 100644 --- a/rootly_sdk/models/auto_assign_role_rootly_task_params_service_target.py +++ b/rootly_sdk/models/auto_assign_role_rootly_task_params_type_2_user_target.py @@ -1,26 +1,24 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field from ..types import UNSET, Unset -T = TypeVar("T", bound="AutoAssignRoleRootlyTaskParamsServiceTarget") +T = TypeVar("T", bound="AutoAssignRoleRootlyTaskParamsType2UserTarget") @_attrs_define -class AutoAssignRoleRootlyTaskParamsServiceTarget: +class AutoAssignRoleRootlyTaskParamsType2UserTarget: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -45,13 +43,13 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name = d.pop("name", UNSET) - auto_assign_role_rootly_task_params_service_target = cls( + auto_assign_role_rootly_task_params_type_2_user_target = cls( id=id, name=name, ) - auto_assign_role_rootly_task_params_service_target.additional_properties = d - return auto_assign_role_rootly_task_params_service_target + auto_assign_role_rootly_task_params_type_2_user_target.additional_properties = d + return auto_assign_role_rootly_task_params_type_2_user_target @property def additional_keys(self) -> list[str]: diff --git a/rootly_sdk/models/auto_assign_role_rootly_task_params_group_target.py b/rootly_sdk/models/auto_assign_role_rootly_task_params_type_3_group_target.py similarity index 72% rename from rootly_sdk/models/auto_assign_role_rootly_task_params_group_target.py rename to rootly_sdk/models/auto_assign_role_rootly_task_params_type_3_group_target.py index f8147e20..59787f53 100644 --- a/rootly_sdk/models/auto_assign_role_rootly_task_params_group_target.py +++ b/rootly_sdk/models/auto_assign_role_rootly_task_params_type_3_group_target.py @@ -1,26 +1,24 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field from ..types import UNSET, Unset -T = TypeVar("T", bound="AutoAssignRoleRootlyTaskParamsGroupTarget") +T = TypeVar("T", bound="AutoAssignRoleRootlyTaskParamsType3GroupTarget") @_attrs_define -class AutoAssignRoleRootlyTaskParamsGroupTarget: +class AutoAssignRoleRootlyTaskParamsType3GroupTarget: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -45,13 +43,13 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name = d.pop("name", UNSET) - auto_assign_role_rootly_task_params_group_target = cls( + auto_assign_role_rootly_task_params_type_3_group_target = cls( id=id, name=name, ) - auto_assign_role_rootly_task_params_group_target.additional_properties = d - return auto_assign_role_rootly_task_params_group_target + auto_assign_role_rootly_task_params_type_3_group_target.additional_properties = d + return auto_assign_role_rootly_task_params_type_3_group_target @property def additional_keys(self) -> list[str]: diff --git a/rootly_sdk/models/auto_assign_role_rootly_task_params_type_4_schedule_target.py b/rootly_sdk/models/auto_assign_role_rootly_task_params_type_4_schedule_target.py new file mode 100644 index 00000000..118daeb3 --- /dev/null +++ b/rootly_sdk/models/auto_assign_role_rootly_task_params_type_4_schedule_target.py @@ -0,0 +1,68 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="AutoAssignRoleRootlyTaskParamsType4ScheduleTarget") + + +@_attrs_define +class AutoAssignRoleRootlyTaskParamsType4ScheduleTarget: + """ + Attributes: + id (Union[Unset, str]): + name (Union[Unset, str]): + """ + + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + name = self.name + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if id is not UNSET: + field_dict["id"] = id + if name is not UNSET: + field_dict["name"] = name + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id", UNSET) + + name = d.pop("name", UNSET) + + auto_assign_role_rootly_task_params_type_4_schedule_target = cls( + id=id, + name=name, + ) + + auto_assign_role_rootly_task_params_type_4_schedule_target.additional_properties = d + return auto_assign_role_rootly_task_params_type_4_schedule_target + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/rootly_sdk/models/auto_assign_role_victor_ops_task_params.py b/rootly_sdk/models/auto_assign_role_victor_ops_task_params.py index 74213134..891f9496 100644 --- a/rootly_sdk/models/auto_assign_role_victor_ops_task_params.py +++ b/rootly_sdk/models/auto_assign_role_victor_ops_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -25,21 +23,20 @@ class AutoAssignRoleVictorOpsTaskParams: Attributes: incident_role_id (str): The role id team (AutoAssignRoleVictorOpsTaskParamsTeam): - task_type (AutoAssignRoleVictorOpsTaskParamsTaskType | Unset): + task_type (Union[Unset, AutoAssignRoleVictorOpsTaskParamsTaskType]): """ incident_role_id: str - team: AutoAssignRoleVictorOpsTaskParamsTeam - task_type: AutoAssignRoleVictorOpsTaskParamsTaskType | Unset = UNSET + team: "AutoAssignRoleVictorOpsTaskParamsTeam" + task_type: Union[Unset, AutoAssignRoleVictorOpsTaskParamsTaskType] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - incident_role_id = self.incident_role_id team = self.team.to_dict() - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -66,7 +63,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: team = AutoAssignRoleVictorOpsTaskParamsTeam.from_dict(d.pop("team")) _task_type = d.pop("task_type", UNSET) - task_type: AutoAssignRoleVictorOpsTaskParamsTaskType | Unset + task_type: Union[Unset, AutoAssignRoleVictorOpsTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/auto_assign_role_victor_ops_task_params_team.py b/rootly_sdk/models/auto_assign_role_victor_ops_task_params_team.py index aca48451..0a4ccc60 100644 --- a/rootly_sdk/models/auto_assign_role_victor_ops_task_params_team.py +++ b/rootly_sdk/models/auto_assign_role_victor_ops_task_params_team.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class AutoAssignRoleVictorOpsTaskParamsTeam: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/bulk_destroy_catalog_entities_response.py b/rootly_sdk/models/bulk_destroy_catalog_entities_response.py index e78840fa..06225dc0 100644 --- a/rootly_sdk/models/bulk_destroy_catalog_entities_response.py +++ b/rootly_sdk/models/bulk_destroy_catalog_entities_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,15 +17,14 @@ class BulkDestroyCatalogEntitiesResponse: """ Attributes: - data (BulkDestroyCatalogEntitiesResponseData | Unset): + data (Union[Unset, BulkDestroyCatalogEntitiesResponseData]): """ - data: BulkDestroyCatalogEntitiesResponseData | Unset = UNSET + data: Union[Unset, "BulkDestroyCatalogEntitiesResponseData"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - - data: dict[str, Any] | Unset = UNSET + data: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.data, Unset): data = self.data.to_dict() @@ -45,7 +42,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _data = d.pop("data", UNSET) - data: BulkDestroyCatalogEntitiesResponseData | Unset + data: Union[Unset, BulkDestroyCatalogEntitiesResponseData] if isinstance(_data, Unset): data = UNSET else: diff --git a/rootly_sdk/models/bulk_destroy_catalog_entities_response_data.py b/rootly_sdk/models/bulk_destroy_catalog_entities_response_data.py index 100418a0..df606e58 100644 --- a/rootly_sdk/models/bulk_destroy_catalog_entities_response_data.py +++ b/rootly_sdk/models/bulk_destroy_catalog_entities_response_data.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,28 +13,28 @@ class BulkDestroyCatalogEntitiesResponseData: """ Attributes: - deleted_external_ids (list[str] | Unset): External IDs that were successfully deleted - failed_external_ids (list[str] | Unset): External IDs whose deletion the record itself blocked (e.g. minimum-one - guard, restrict associations). Records the caller is not authorized to destroy are NOT listed here. - not_found_external_ids (list[str] | Unset): External IDs that were not found or not accessible to the caller - (external_ids mode only) + deleted_external_ids (Union[Unset, list[str]]): External IDs that were successfully deleted + failed_external_ids (Union[Unset, list[str]]): External IDs whose deletion the record itself blocked (e.g. + minimum-one guard, restrict associations). Records the caller is not authorized to destroy are NOT listed here. + not_found_external_ids (Union[Unset, list[str]]): External IDs that were not found or not accessible to the + caller (external_ids mode only) """ - deleted_external_ids: list[str] | Unset = UNSET - failed_external_ids: list[str] | Unset = UNSET - not_found_external_ids: list[str] | Unset = UNSET + deleted_external_ids: Union[Unset, list[str]] = UNSET + failed_external_ids: Union[Unset, list[str]] = UNSET + not_found_external_ids: Union[Unset, list[str]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - deleted_external_ids: list[str] | Unset = UNSET + deleted_external_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.deleted_external_ids, Unset): deleted_external_ids = self.deleted_external_ids - failed_external_ids: list[str] | Unset = UNSET + failed_external_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.failed_external_ids, Unset): failed_external_ids = self.failed_external_ids - not_found_external_ids: list[str] | Unset = UNSET + not_found_external_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.not_found_external_ids, Unset): not_found_external_ids = self.not_found_external_ids diff --git a/rootly_sdk/models/bulk_destroy_catalog_entities_type_0.py b/rootly_sdk/models/bulk_destroy_catalog_entities_type_0.py index aa0318b3..c480370e 100644 --- a/rootly_sdk/models/bulk_destroy_catalog_entities_type_0.py +++ b/rootly_sdk/models/bulk_destroy_catalog_entities_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast diff --git a/rootly_sdk/models/bulk_destroy_catalog_entities_type_1.py b/rootly_sdk/models/bulk_destroy_catalog_entities_type_1.py index 82423407..4c183bd5 100644 --- a/rootly_sdk/models/bulk_destroy_catalog_entities_type_1.py +++ b/rootly_sdk/models/bulk_destroy_catalog_entities_type_1.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -20,16 +18,16 @@ class BulkDestroyCatalogEntitiesType1: Attributes: managed_by (BulkDestroyCatalogEntitiesType1ManagedBy): Delete all entities with this managed_by value (web/admin_web not allowed). - keep_external_ids (list[str] | Unset): Entities with these external_ids are preserved. + keep_external_ids (Union[Unset, list[str]]): Entities with these external_ids are preserved. """ managed_by: BulkDestroyCatalogEntitiesType1ManagedBy - keep_external_ids: list[str] | Unset = UNSET + keep_external_ids: Union[Unset, list[str]] = UNSET def to_dict(self) -> dict[str, Any]: managed_by: str = self.managed_by - keep_external_ids: list[str] | Unset = UNSET + keep_external_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.keep_external_ids, Unset): keep_external_ids = self.keep_external_ids diff --git a/rootly_sdk/models/bulk_destroy_environments_response.py b/rootly_sdk/models/bulk_destroy_environments_response.py index b10deeef..b3475244 100644 --- a/rootly_sdk/models/bulk_destroy_environments_response.py +++ b/rootly_sdk/models/bulk_destroy_environments_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,15 +17,14 @@ class BulkDestroyEnvironmentsResponse: """ Attributes: - data (BulkDestroyEnvironmentsResponseData | Unset): + data (Union[Unset, BulkDestroyEnvironmentsResponseData]): """ - data: BulkDestroyEnvironmentsResponseData | Unset = UNSET + data: Union[Unset, "BulkDestroyEnvironmentsResponseData"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - - data: dict[str, Any] | Unset = UNSET + data: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.data, Unset): data = self.data.to_dict() @@ -45,7 +42,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _data = d.pop("data", UNSET) - data: BulkDestroyEnvironmentsResponseData | Unset + data: Union[Unset, BulkDestroyEnvironmentsResponseData] if isinstance(_data, Unset): data = UNSET else: diff --git a/rootly_sdk/models/bulk_destroy_environments_response_data.py b/rootly_sdk/models/bulk_destroy_environments_response_data.py index 64ba34fd..b23b194a 100644 --- a/rootly_sdk/models/bulk_destroy_environments_response_data.py +++ b/rootly_sdk/models/bulk_destroy_environments_response_data.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,28 +13,28 @@ class BulkDestroyEnvironmentsResponseData: """ Attributes: - deleted_external_ids (list[str] | Unset): External IDs that were successfully deleted - failed_external_ids (list[str] | Unset): External IDs whose deletion the record itself blocked (e.g. minimum-one - guard, restrict associations). Records the caller is not authorized to destroy are NOT listed here. - not_found_external_ids (list[str] | Unset): External IDs that were not found or not accessible to the caller - (external_ids mode only) + deleted_external_ids (Union[Unset, list[str]]): External IDs that were successfully deleted + failed_external_ids (Union[Unset, list[str]]): External IDs whose deletion the record itself blocked (e.g. + minimum-one guard, restrict associations). Records the caller is not authorized to destroy are NOT listed here. + not_found_external_ids (Union[Unset, list[str]]): External IDs that were not found or not accessible to the + caller (external_ids mode only) """ - deleted_external_ids: list[str] | Unset = UNSET - failed_external_ids: list[str] | Unset = UNSET - not_found_external_ids: list[str] | Unset = UNSET + deleted_external_ids: Union[Unset, list[str]] = UNSET + failed_external_ids: Union[Unset, list[str]] = UNSET + not_found_external_ids: Union[Unset, list[str]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - deleted_external_ids: list[str] | Unset = UNSET + deleted_external_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.deleted_external_ids, Unset): deleted_external_ids = self.deleted_external_ids - failed_external_ids: list[str] | Unset = UNSET + failed_external_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.failed_external_ids, Unset): failed_external_ids = self.failed_external_ids - not_found_external_ids: list[str] | Unset = UNSET + not_found_external_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.not_found_external_ids, Unset): not_found_external_ids = self.not_found_external_ids diff --git a/rootly_sdk/models/bulk_destroy_environments_type_0.py b/rootly_sdk/models/bulk_destroy_environments_type_0.py index f214081d..a7abe6a2 100644 --- a/rootly_sdk/models/bulk_destroy_environments_type_0.py +++ b/rootly_sdk/models/bulk_destroy_environments_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast diff --git a/rootly_sdk/models/bulk_destroy_environments_type_1.py b/rootly_sdk/models/bulk_destroy_environments_type_1.py index ce96f4b6..5d19873a 100644 --- a/rootly_sdk/models/bulk_destroy_environments_type_1.py +++ b/rootly_sdk/models/bulk_destroy_environments_type_1.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -20,16 +18,16 @@ class BulkDestroyEnvironmentsType1: Attributes: managed_by (BulkDestroyEnvironmentsType1ManagedBy): Delete all records with this managed_by value (web/admin_web not allowed). - keep_external_ids (list[str] | Unset): Records with these external_ids are preserved. + keep_external_ids (Union[Unset, list[str]]): Records with these external_ids are preserved. """ managed_by: BulkDestroyEnvironmentsType1ManagedBy - keep_external_ids: list[str] | Unset = UNSET + keep_external_ids: Union[Unset, list[str]] = UNSET def to_dict(self) -> dict[str, Any]: managed_by: str = self.managed_by - keep_external_ids: list[str] | Unset = UNSET + keep_external_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.keep_external_ids, Unset): keep_external_ids = self.keep_external_ids diff --git a/rootly_sdk/models/bulk_destroy_functionalities_response.py b/rootly_sdk/models/bulk_destroy_functionalities_response.py index 07bfc6d7..38a37676 100644 --- a/rootly_sdk/models/bulk_destroy_functionalities_response.py +++ b/rootly_sdk/models/bulk_destroy_functionalities_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,15 +17,14 @@ class BulkDestroyFunctionalitiesResponse: """ Attributes: - data (BulkDestroyFunctionalitiesResponseData | Unset): + data (Union[Unset, BulkDestroyFunctionalitiesResponseData]): """ - data: BulkDestroyFunctionalitiesResponseData | Unset = UNSET + data: Union[Unset, "BulkDestroyFunctionalitiesResponseData"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - - data: dict[str, Any] | Unset = UNSET + data: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.data, Unset): data = self.data.to_dict() @@ -45,7 +42,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _data = d.pop("data", UNSET) - data: BulkDestroyFunctionalitiesResponseData | Unset + data: Union[Unset, BulkDestroyFunctionalitiesResponseData] if isinstance(_data, Unset): data = UNSET else: diff --git a/rootly_sdk/models/bulk_destroy_functionalities_response_data.py b/rootly_sdk/models/bulk_destroy_functionalities_response_data.py index 09696126..e8b6710d 100644 --- a/rootly_sdk/models/bulk_destroy_functionalities_response_data.py +++ b/rootly_sdk/models/bulk_destroy_functionalities_response_data.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,28 +13,28 @@ class BulkDestroyFunctionalitiesResponseData: """ Attributes: - deleted_external_ids (list[str] | Unset): External IDs that were successfully deleted - failed_external_ids (list[str] | Unset): External IDs whose deletion the record itself blocked (e.g. minimum-one - guard, restrict associations). Records the caller is not authorized to destroy are NOT listed here. - not_found_external_ids (list[str] | Unset): External IDs that were not found or not accessible to the caller - (external_ids mode only) + deleted_external_ids (Union[Unset, list[str]]): External IDs that were successfully deleted + failed_external_ids (Union[Unset, list[str]]): External IDs whose deletion the record itself blocked (e.g. + minimum-one guard, restrict associations). Records the caller is not authorized to destroy are NOT listed here. + not_found_external_ids (Union[Unset, list[str]]): External IDs that were not found or not accessible to the + caller (external_ids mode only) """ - deleted_external_ids: list[str] | Unset = UNSET - failed_external_ids: list[str] | Unset = UNSET - not_found_external_ids: list[str] | Unset = UNSET + deleted_external_ids: Union[Unset, list[str]] = UNSET + failed_external_ids: Union[Unset, list[str]] = UNSET + not_found_external_ids: Union[Unset, list[str]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - deleted_external_ids: list[str] | Unset = UNSET + deleted_external_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.deleted_external_ids, Unset): deleted_external_ids = self.deleted_external_ids - failed_external_ids: list[str] | Unset = UNSET + failed_external_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.failed_external_ids, Unset): failed_external_ids = self.failed_external_ids - not_found_external_ids: list[str] | Unset = UNSET + not_found_external_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.not_found_external_ids, Unset): not_found_external_ids = self.not_found_external_ids diff --git a/rootly_sdk/models/bulk_destroy_functionalities_type_0.py b/rootly_sdk/models/bulk_destroy_functionalities_type_0.py index 3d848f82..c7275e20 100644 --- a/rootly_sdk/models/bulk_destroy_functionalities_type_0.py +++ b/rootly_sdk/models/bulk_destroy_functionalities_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast diff --git a/rootly_sdk/models/bulk_destroy_functionalities_type_1.py b/rootly_sdk/models/bulk_destroy_functionalities_type_1.py index f26f768a..10205358 100644 --- a/rootly_sdk/models/bulk_destroy_functionalities_type_1.py +++ b/rootly_sdk/models/bulk_destroy_functionalities_type_1.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -20,16 +18,16 @@ class BulkDestroyFunctionalitiesType1: Attributes: managed_by (BulkDestroyFunctionalitiesType1ManagedBy): Delete all records with this managed_by value (web/admin_web not allowed). - keep_external_ids (list[str] | Unset): Records with these external_ids are preserved. + keep_external_ids (Union[Unset, list[str]]): Records with these external_ids are preserved. """ managed_by: BulkDestroyFunctionalitiesType1ManagedBy - keep_external_ids: list[str] | Unset = UNSET + keep_external_ids: Union[Unset, list[str]] = UNSET def to_dict(self) -> dict[str, Any]: managed_by: str = self.managed_by - keep_external_ids: list[str] | Unset = UNSET + keep_external_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.keep_external_ids, Unset): keep_external_ids = self.keep_external_ids diff --git a/rootly_sdk/models/bulk_destroy_services_response.py b/rootly_sdk/models/bulk_destroy_services_response.py index 74550d05..b9348c07 100644 --- a/rootly_sdk/models/bulk_destroy_services_response.py +++ b/rootly_sdk/models/bulk_destroy_services_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,15 +17,14 @@ class BulkDestroyServicesResponse: """ Attributes: - data (BulkDestroyServicesResponseData | Unset): + data (Union[Unset, BulkDestroyServicesResponseData]): """ - data: BulkDestroyServicesResponseData | Unset = UNSET + data: Union[Unset, "BulkDestroyServicesResponseData"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - - data: dict[str, Any] | Unset = UNSET + data: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.data, Unset): data = self.data.to_dict() @@ -45,7 +42,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _data = d.pop("data", UNSET) - data: BulkDestroyServicesResponseData | Unset + data: Union[Unset, BulkDestroyServicesResponseData] if isinstance(_data, Unset): data = UNSET else: diff --git a/rootly_sdk/models/bulk_destroy_services_response_data.py b/rootly_sdk/models/bulk_destroy_services_response_data.py index f1a02711..70a59148 100644 --- a/rootly_sdk/models/bulk_destroy_services_response_data.py +++ b/rootly_sdk/models/bulk_destroy_services_response_data.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,28 +13,28 @@ class BulkDestroyServicesResponseData: """ Attributes: - deleted_external_ids (list[str] | Unset): External IDs that were successfully deleted - failed_external_ids (list[str] | Unset): External IDs whose deletion the record itself blocked (e.g. minimum-one - guard, restrict associations). Records the caller is not authorized to destroy are NOT listed here. - not_found_external_ids (list[str] | Unset): External IDs that were not found or not accessible to the caller - (external_ids mode only) + deleted_external_ids (Union[Unset, list[str]]): External IDs that were successfully deleted + failed_external_ids (Union[Unset, list[str]]): External IDs whose deletion the record itself blocked (e.g. + minimum-one guard, restrict associations). Records the caller is not authorized to destroy are NOT listed here. + not_found_external_ids (Union[Unset, list[str]]): External IDs that were not found or not accessible to the + caller (external_ids mode only) """ - deleted_external_ids: list[str] | Unset = UNSET - failed_external_ids: list[str] | Unset = UNSET - not_found_external_ids: list[str] | Unset = UNSET + deleted_external_ids: Union[Unset, list[str]] = UNSET + failed_external_ids: Union[Unset, list[str]] = UNSET + not_found_external_ids: Union[Unset, list[str]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - deleted_external_ids: list[str] | Unset = UNSET + deleted_external_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.deleted_external_ids, Unset): deleted_external_ids = self.deleted_external_ids - failed_external_ids: list[str] | Unset = UNSET + failed_external_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.failed_external_ids, Unset): failed_external_ids = self.failed_external_ids - not_found_external_ids: list[str] | Unset = UNSET + not_found_external_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.not_found_external_ids, Unset): not_found_external_ids = self.not_found_external_ids diff --git a/rootly_sdk/models/bulk_destroy_services_type_0.py b/rootly_sdk/models/bulk_destroy_services_type_0.py index 1c0b2be3..ab09b1c8 100644 --- a/rootly_sdk/models/bulk_destroy_services_type_0.py +++ b/rootly_sdk/models/bulk_destroy_services_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast diff --git a/rootly_sdk/models/bulk_destroy_services_type_1.py b/rootly_sdk/models/bulk_destroy_services_type_1.py index 30af9e88..59c00e42 100644 --- a/rootly_sdk/models/bulk_destroy_services_type_1.py +++ b/rootly_sdk/models/bulk_destroy_services_type_1.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -20,16 +18,16 @@ class BulkDestroyServicesType1: Attributes: managed_by (BulkDestroyServicesType1ManagedBy): Delete all records with this managed_by value (web/admin_web not allowed). - keep_external_ids (list[str] | Unset): Records with these external_ids are preserved. + keep_external_ids (Union[Unset, list[str]]): Records with these external_ids are preserved. """ managed_by: BulkDestroyServicesType1ManagedBy - keep_external_ids: list[str] | Unset = UNSET + keep_external_ids: Union[Unset, list[str]] = UNSET def to_dict(self) -> dict[str, Any]: managed_by: str = self.managed_by - keep_external_ids: list[str] | Unset = UNSET + keep_external_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.keep_external_ids, Unset): keep_external_ids = self.keep_external_ids diff --git a/rootly_sdk/models/bulk_destroy_teams_response.py b/rootly_sdk/models/bulk_destroy_teams_response.py index d84b0f6d..87765807 100644 --- a/rootly_sdk/models/bulk_destroy_teams_response.py +++ b/rootly_sdk/models/bulk_destroy_teams_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,15 +17,14 @@ class BulkDestroyTeamsResponse: """ Attributes: - data (BulkDestroyTeamsResponseData | Unset): + data (Union[Unset, BulkDestroyTeamsResponseData]): """ - data: BulkDestroyTeamsResponseData | Unset = UNSET + data: Union[Unset, "BulkDestroyTeamsResponseData"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - - data: dict[str, Any] | Unset = UNSET + data: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.data, Unset): data = self.data.to_dict() @@ -45,7 +42,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _data = d.pop("data", UNSET) - data: BulkDestroyTeamsResponseData | Unset + data: Union[Unset, BulkDestroyTeamsResponseData] if isinstance(_data, Unset): data = UNSET else: diff --git a/rootly_sdk/models/bulk_destroy_teams_response_data.py b/rootly_sdk/models/bulk_destroy_teams_response_data.py index c4e2e3fc..cf1bdc7c 100644 --- a/rootly_sdk/models/bulk_destroy_teams_response_data.py +++ b/rootly_sdk/models/bulk_destroy_teams_response_data.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,28 +13,28 @@ class BulkDestroyTeamsResponseData: """ Attributes: - deleted_external_ids (list[str] | Unset): External IDs that were successfully deleted - failed_external_ids (list[str] | Unset): External IDs whose deletion the record itself blocked (e.g. minimum-one - guard, restrict associations). Records the caller is not authorized to destroy are NOT listed here. - not_found_external_ids (list[str] | Unset): External IDs that were not found or not accessible to the caller - (external_ids mode only) + deleted_external_ids (Union[Unset, list[str]]): External IDs that were successfully deleted + failed_external_ids (Union[Unset, list[str]]): External IDs whose deletion the record itself blocked (e.g. + minimum-one guard, restrict associations). Records the caller is not authorized to destroy are NOT listed here. + not_found_external_ids (Union[Unset, list[str]]): External IDs that were not found or not accessible to the + caller (external_ids mode only) """ - deleted_external_ids: list[str] | Unset = UNSET - failed_external_ids: list[str] | Unset = UNSET - not_found_external_ids: list[str] | Unset = UNSET + deleted_external_ids: Union[Unset, list[str]] = UNSET + failed_external_ids: Union[Unset, list[str]] = UNSET + not_found_external_ids: Union[Unset, list[str]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - deleted_external_ids: list[str] | Unset = UNSET + deleted_external_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.deleted_external_ids, Unset): deleted_external_ids = self.deleted_external_ids - failed_external_ids: list[str] | Unset = UNSET + failed_external_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.failed_external_ids, Unset): failed_external_ids = self.failed_external_ids - not_found_external_ids: list[str] | Unset = UNSET + not_found_external_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.not_found_external_ids, Unset): not_found_external_ids = self.not_found_external_ids diff --git a/rootly_sdk/models/bulk_destroy_teams_type_0.py b/rootly_sdk/models/bulk_destroy_teams_type_0.py index 3e2eb0d5..f88ab8c8 100644 --- a/rootly_sdk/models/bulk_destroy_teams_type_0.py +++ b/rootly_sdk/models/bulk_destroy_teams_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast diff --git a/rootly_sdk/models/bulk_destroy_teams_type_1.py b/rootly_sdk/models/bulk_destroy_teams_type_1.py index 881d654b..669bc888 100644 --- a/rootly_sdk/models/bulk_destroy_teams_type_1.py +++ b/rootly_sdk/models/bulk_destroy_teams_type_1.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -20,16 +18,16 @@ class BulkDestroyTeamsType1: Attributes: managed_by (BulkDestroyTeamsType1ManagedBy): Delete all records with this managed_by value (web/admin_web not allowed). - keep_external_ids (list[str] | Unset): Records with these external_ids are preserved. + keep_external_ids (Union[Unset, list[str]]): Records with these external_ids are preserved. """ managed_by: BulkDestroyTeamsType1ManagedBy - keep_external_ids: list[str] | Unset = UNSET + keep_external_ids: Union[Unset, list[str]] = UNSET def to_dict(self) -> dict[str, Any]: managed_by: str = self.managed_by - keep_external_ids: list[str] | Unset = UNSET + keep_external_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.keep_external_ids, Unset): keep_external_ids = self.keep_external_ids diff --git a/rootly_sdk/models/bulk_upsert_catalog_entities.py b/rootly_sdk/models/bulk_upsert_catalog_entities.py index d6d87d56..316e8eda 100644 --- a/rootly_sdk/models/bulk_upsert_catalog_entities.py +++ b/rootly_sdk/models/bulk_upsert_catalog_entities.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -17,15 +15,14 @@ class BulkUpsertCatalogEntities: """ Attributes: - entities (list[BulkUpsertCatalogEntitiesEntitiesItem]): Array of catalog entities to upsert. Each must have an + entities (list['BulkUpsertCatalogEntitiesEntitiesItem']): Array of catalog entities to upsert. Each must have an external_id. Max 100 per request. external_ids must be unique within a batch. """ - entities: list[BulkUpsertCatalogEntitiesEntitiesItem] + entities: list["BulkUpsertCatalogEntitiesEntitiesItem"] additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - entities = [] for entities_item_data in self.entities: entities_item = entities_item_data.to_dict() diff --git a/rootly_sdk/models/bulk_upsert_catalog_entities_entities_item.py b/rootly_sdk/models/bulk_upsert_catalog_entities_entities_item.py index 941d1738..5631b154 100644 --- a/rootly_sdk/models/bulk_upsert_catalog_entities_entities_item.py +++ b/rootly_sdk/models/bulk_upsert_catalog_entities_entities_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,40 +20,47 @@ class BulkUpsertCatalogEntitiesEntitiesItem: """ Attributes: external_id (str): External identifier used as the upsert key. Must be unique within the catalog. - name (str | Unset): Required for new entities. Optional for updates (managed-fields: omitted attributes are - preserved). - description (None | str | Unset): - backstage_id (None | str | Unset): - fields (list[BulkUpsertCatalogEntitiesEntitiesItemFieldsItem] | Unset): Property values for this entity. Only - mentioned fields are written; unmentioned fields are preserved. + name (Union[Unset, str]): Required for new entities. Optional for updates (managed-fields: omitted attributes + are preserved). + description (Union[None, Unset, str]): + public_description (Union[None, Unset, str]): + backstage_id (Union[None, Unset, str]): + fields (Union[Unset, list['BulkUpsertCatalogEntitiesEntitiesItemFieldsItem']]): Property values for this entity. + Only mentioned fields are written; unmentioned fields are preserved. """ external_id: str - name: str | Unset = UNSET - description: None | str | Unset = UNSET - backstage_id: None | str | Unset = UNSET - fields: list[BulkUpsertCatalogEntitiesEntitiesItemFieldsItem] | Unset = UNSET + name: Union[Unset, str] = UNSET + description: Union[None, Unset, str] = UNSET + public_description: Union[None, Unset, str] = UNSET + backstage_id: Union[None, Unset, str] = UNSET + fields: Union[Unset, list["BulkUpsertCatalogEntitiesEntitiesItemFieldsItem"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - external_id = self.external_id name = self.name - description: None | str | Unset + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: description = self.description - backstage_id: None | str | Unset + public_description: Union[None, Unset, str] + if isinstance(self.public_description, Unset): + public_description = UNSET + else: + public_description = self.public_description + + backstage_id: Union[None, Unset, str] if isinstance(self.backstage_id, Unset): backstage_id = UNSET else: backstage_id = self.backstage_id - fields: list[dict[str, Any]] | Unset = UNSET + fields: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.fields, Unset): fields = [] for fields_item_data in self.fields: @@ -73,6 +78,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["name"] = name if description is not UNSET: field_dict["description"] = description + if public_description is not UNSET: + field_dict["public_description"] = public_description if backstage_id is not UNSET: field_dict["backstage_id"] = backstage_id if fields is not UNSET: @@ -91,37 +98,45 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name = d.pop("name", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) - def _parse_backstage_id(data: object) -> None | str | Unset: + def _parse_public_description(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + public_description = _parse_public_description(d.pop("public_description", UNSET)) + + def _parse_backstage_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) backstage_id = _parse_backstage_id(d.pop("backstage_id", UNSET)) + fields = [] _fields = d.pop("fields", UNSET) - fields: list[BulkUpsertCatalogEntitiesEntitiesItemFieldsItem] | Unset = UNSET - if _fields is not UNSET: - fields = [] - for fields_item_data in _fields: - fields_item = BulkUpsertCatalogEntitiesEntitiesItemFieldsItem.from_dict(fields_item_data) + for fields_item_data in _fields or []: + fields_item = BulkUpsertCatalogEntitiesEntitiesItemFieldsItem.from_dict(fields_item_data) - fields.append(fields_item) + fields.append(fields_item) bulk_upsert_catalog_entities_entities_item = cls( external_id=external_id, name=name, description=description, + public_description=public_description, backstage_id=backstage_id, fields=fields, ) diff --git a/rootly_sdk/models/bulk_upsert_catalog_entities_entities_item_fields_item.py b/rootly_sdk/models/bulk_upsert_catalog_entities_entities_item_fields_item.py index 4ee249c4..4ebdd271 100644 --- a/rootly_sdk/models/bulk_upsert_catalog_entities_entities_item_fields_item.py +++ b/rootly_sdk/models/bulk_upsert_catalog_entities_entities_item_fields_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,14 +15,14 @@ class BulkUpsertCatalogEntitiesEntitiesItemFieldsItem: Attributes: value (str): The value for this field - catalog_field_id (str | Unset): UUID, slug, or external_id of the catalog field (required if catalog_property_id - is absent) - catalog_property_id (str | Unset): Alias for catalog_field_id (required if catalog_field_id is absent) + catalog_field_id (Union[Unset, str]): UUID, slug, or external_id of the catalog field (required if + catalog_property_id is absent) + catalog_property_id (Union[Unset, str]): Alias for catalog_field_id (required if catalog_field_id is absent) """ value: str - catalog_field_id: str | Unset = UNSET - catalog_property_id: str | Unset = UNSET + catalog_field_id: Union[Unset, str] = UNSET + catalog_property_id: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/bulk_upsert_catalog_entities_error.py b/rootly_sdk/models/bulk_upsert_catalog_entities_error.py index ef8ea3cd..e7351d05 100644 --- a/rootly_sdk/models/bulk_upsert_catalog_entities_error.py +++ b/rootly_sdk/models/bulk_upsert_catalog_entities_error.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -17,14 +15,13 @@ class BulkUpsertCatalogEntitiesError: """ Attributes: - errors (list[BulkUpsertCatalogEntitiesErrorErrorsItem]): + errors (list['BulkUpsertCatalogEntitiesErrorErrorsItem']): """ - errors: list[BulkUpsertCatalogEntitiesErrorErrorsItem] + errors: list["BulkUpsertCatalogEntitiesErrorErrorsItem"] additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - errors = [] for errors_item_data in self.errors: errors_item = errors_item_data.to_dict() diff --git a/rootly_sdk/models/bulk_upsert_catalog_entities_error_errors_item.py b/rootly_sdk/models/bulk_upsert_catalog_entities_error_errors_item.py index 996410a2..4b7c5c28 100644 --- a/rootly_sdk/models/bulk_upsert_catalog_entities_error_errors_item.py +++ b/rootly_sdk/models/bulk_upsert_catalog_entities_error_errors_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast diff --git a/rootly_sdk/models/bulk_upsert_catalog_entities_response.py b/rootly_sdk/models/bulk_upsert_catalog_entities_response.py index 41ada9ec..8f66215a 100644 --- a/rootly_sdk/models/bulk_upsert_catalog_entities_response.py +++ b/rootly_sdk/models/bulk_upsert_catalog_entities_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,15 +17,14 @@ class BulkUpsertCatalogEntitiesResponse: """ Attributes: - data (list[BulkUpsertCatalogEntitiesResponseDataItem] | Unset): + data (Union[Unset, list['BulkUpsertCatalogEntitiesResponseDataItem']]): """ - data: list[BulkUpsertCatalogEntitiesResponseDataItem] | Unset = UNSET + data: Union[Unset, list["BulkUpsertCatalogEntitiesResponseDataItem"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - - data: list[dict[str, Any]] | Unset = UNSET + data: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.data, Unset): data = [] for data_item_data in self.data: @@ -47,14 +44,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: from ..models.bulk_upsert_catalog_entities_response_data_item import BulkUpsertCatalogEntitiesResponseDataItem d = dict(src_dict) + data = [] _data = d.pop("data", UNSET) - data: list[BulkUpsertCatalogEntitiesResponseDataItem] | Unset = UNSET - if _data is not UNSET: - data = [] - for data_item_data in _data: - data_item = BulkUpsertCatalogEntitiesResponseDataItem.from_dict(data_item_data) + for data_item_data in _data or []: + data_item = BulkUpsertCatalogEntitiesResponseDataItem.from_dict(data_item_data) - data.append(data_item) + data.append(data_item) bulk_upsert_catalog_entities_response = cls( data=data, diff --git a/rootly_sdk/models/bulk_upsert_catalog_entities_response_data_item.py b/rootly_sdk/models/bulk_upsert_catalog_entities_response_data_item.py index 17df9577..86d5fe46 100644 --- a/rootly_sdk/models/bulk_upsert_catalog_entities_response_data_item.py +++ b/rootly_sdk/models/bulk_upsert_catalog_entities_response_data_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,25 +21,24 @@ class BulkUpsertCatalogEntitiesResponseDataItem: """ Attributes: - id (str | Unset): - type_ (BulkUpsertCatalogEntitiesResponseDataItemType | Unset): - attributes (CatalogEntity | Unset): + id (Union[Unset, str]): + type_ (Union[Unset, BulkUpsertCatalogEntitiesResponseDataItemType]): + attributes (Union[Unset, CatalogEntity]): """ - id: str | Unset = UNSET - type_: BulkUpsertCatalogEntitiesResponseDataItemType | Unset = UNSET - attributes: CatalogEntity | Unset = UNSET + id: Union[Unset, str] = UNSET + type_: Union[Unset, BulkUpsertCatalogEntitiesResponseDataItemType] = UNSET + attributes: Union[Unset, "CatalogEntity"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id - type_: str | Unset = UNSET + type_: Union[Unset, str] = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ - attributes: dict[str, Any] | Unset = UNSET + attributes: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.attributes, Unset): attributes = self.attributes.to_dict() @@ -65,14 +62,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: id = d.pop("id", UNSET) _type_ = d.pop("type", UNSET) - type_: BulkUpsertCatalogEntitiesResponseDataItemType | Unset + type_: Union[Unset, BulkUpsertCatalogEntitiesResponseDataItemType] if isinstance(_type_, Unset): type_ = UNSET else: type_ = check_bulk_upsert_catalog_entities_response_data_item_type(_type_) _attributes = d.pop("attributes", UNSET) - attributes: CatalogEntity | Unset + attributes: Union[Unset, CatalogEntity] if isinstance(_attributes, Unset): attributes = UNSET else: diff --git a/rootly_sdk/models/bulk_upsert_environments.py b/rootly_sdk/models/bulk_upsert_environments.py index 8b79a7f4..92088a23 100644 --- a/rootly_sdk/models/bulk_upsert_environments.py +++ b/rootly_sdk/models/bulk_upsert_environments.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -17,15 +15,14 @@ class BulkUpsertEnvironments: """ Attributes: - entities (list[BulkUpsertEnvironmentsEntitiesItem]): Environments to upsert, matched by external_id. Max 100 per - request; external_ids unique within a batch. Only attributes present are written (managed-fields semantics). + entities (list['BulkUpsertEnvironmentsEntitiesItem']): Environments to upsert, matched by external_id. Max 100 + per request; external_ids unique within a batch. Only attributes present are written (managed-fields semantics). """ - entities: list[BulkUpsertEnvironmentsEntitiesItem] + entities: list["BulkUpsertEnvironmentsEntitiesItem"] additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - entities = [] for entities_item_data in self.entities: entities_item = entities_item_data.to_dict() diff --git a/rootly_sdk/models/bulk_upsert_environments_entities_item.py b/rootly_sdk/models/bulk_upsert_environments_entities_item.py index fc203929..4f9a7720 100644 --- a/rootly_sdk/models/bulk_upsert_environments_entities_item.py +++ b/rootly_sdk/models/bulk_upsert_environments_entities_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -20,49 +18,56 @@ class BulkUpsertEnvironmentsEntitiesItem: """ Attributes: external_id (str): External identifier used as the upsert key. Unique per team. - name (str | Unset): Required for new records. Optional for updates. - description (None | str | Unset): - color (None | str | Unset): - position (int | None | Unset): - notify_emails (list[str] | None | Unset): - fields (list[BulkUpsertEnvironmentsEntitiesItemFieldsItem] | Unset): Catalog property values (merge semantics: - only mentioned fields written). + name (Union[Unset, str]): Required for new records. Optional for updates. + description (Union[None, Unset, str]): + public_description (Union[None, Unset, str]): + color (Union[None, Unset, str]): + position (Union[None, Unset, int]): + notify_emails (Union[None, Unset, list[str]]): + fields (Union[Unset, list['BulkUpsertEnvironmentsEntitiesItemFieldsItem']]): Catalog property values (merge + semantics: only mentioned fields written). """ external_id: str - name: str | Unset = UNSET - description: None | str | Unset = UNSET - color: None | str | Unset = UNSET - position: int | None | Unset = UNSET - notify_emails: list[str] | None | Unset = UNSET - fields: list[BulkUpsertEnvironmentsEntitiesItemFieldsItem] | Unset = UNSET + name: Union[Unset, str] = UNSET + description: Union[None, Unset, str] = UNSET + public_description: Union[None, Unset, str] = UNSET + color: Union[None, Unset, str] = UNSET + position: Union[None, Unset, int] = UNSET + notify_emails: Union[None, Unset, list[str]] = UNSET + fields: Union[Unset, list["BulkUpsertEnvironmentsEntitiesItemFieldsItem"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - external_id = self.external_id name = self.name - description: None | str | Unset + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: description = self.description - color: None | str | Unset + public_description: Union[None, Unset, str] + if isinstance(self.public_description, Unset): + public_description = UNSET + else: + public_description = self.public_description + + color: Union[None, Unset, str] if isinstance(self.color, Unset): color = UNSET else: color = self.color - position: int | None | Unset + position: Union[None, Unset, int] if isinstance(self.position, Unset): position = UNSET else: position = self.position - notify_emails: list[str] | None | Unset + notify_emails: Union[None, Unset, list[str]] if isinstance(self.notify_emails, Unset): notify_emails = UNSET elif isinstance(self.notify_emails, list): @@ -71,7 +76,7 @@ def to_dict(self) -> dict[str, Any]: else: notify_emails = self.notify_emails - fields: list[dict[str, Any]] | Unset = UNSET + fields: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.fields, Unset): fields = [] for fields_item_data in self.fields: @@ -89,6 +94,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["name"] = name if description is not UNSET: field_dict["description"] = description + if public_description is not UNSET: + field_dict["public_description"] = public_description if color is not UNSET: field_dict["color"] = color if position is not UNSET: @@ -111,34 +118,43 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name = d.pop("name", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) - def _parse_color(data: object) -> None | str | Unset: + def _parse_public_description(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + public_description = _parse_public_description(d.pop("public_description", UNSET)) + + def _parse_color(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) color = _parse_color(d.pop("color", UNSET)) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> Union[None, Unset, int]: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(Union[None, Unset, int], data) position = _parse_position(d.pop("position", UNSET)) - def _parse_notify_emails(data: object) -> list[str] | None | Unset: + def _parse_notify_emails(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -149,25 +165,24 @@ def _parse_notify_emails(data: object) -> list[str] | None | Unset: notify_emails_type_0 = cast(list[str], data) return notify_emails_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) notify_emails = _parse_notify_emails(d.pop("notify_emails", UNSET)) + fields = [] _fields = d.pop("fields", UNSET) - fields: list[BulkUpsertEnvironmentsEntitiesItemFieldsItem] | Unset = UNSET - if _fields is not UNSET: - fields = [] - for fields_item_data in _fields: - fields_item = BulkUpsertEnvironmentsEntitiesItemFieldsItem.from_dict(fields_item_data) + for fields_item_data in _fields or []: + fields_item = BulkUpsertEnvironmentsEntitiesItemFieldsItem.from_dict(fields_item_data) - fields.append(fields_item) + fields.append(fields_item) bulk_upsert_environments_entities_item = cls( external_id=external_id, name=name, description=description, + public_description=public_description, color=color, position=position, notify_emails=notify_emails, diff --git a/rootly_sdk/models/bulk_upsert_environments_entities_item_fields_item.py b/rootly_sdk/models/bulk_upsert_environments_entities_item_fields_item.py index a2fb5f0b..96227631 100644 --- a/rootly_sdk/models/bulk_upsert_environments_entities_item_fields_item.py +++ b/rootly_sdk/models/bulk_upsert_environments_entities_item_fields_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,14 +15,14 @@ class BulkUpsertEnvironmentsEntitiesItemFieldsItem: Attributes: value (str): The value for this field - catalog_field_id (str | Unset): UUID, slug, or external_id of the catalog field (required if catalog_property_id - is absent) - catalog_property_id (str | Unset): Alias for catalog_field_id (required if catalog_field_id is absent) + catalog_field_id (Union[Unset, str]): UUID, slug, or external_id of the catalog field (required if + catalog_property_id is absent) + catalog_property_id (Union[Unset, str]): Alias for catalog_field_id (required if catalog_field_id is absent) """ value: str - catalog_field_id: str | Unset = UNSET - catalog_property_id: str | Unset = UNSET + catalog_field_id: Union[Unset, str] = UNSET + catalog_property_id: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/bulk_upsert_environments_error.py b/rootly_sdk/models/bulk_upsert_environments_error.py index 38e7490e..638ed9a8 100644 --- a/rootly_sdk/models/bulk_upsert_environments_error.py +++ b/rootly_sdk/models/bulk_upsert_environments_error.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -17,14 +15,13 @@ class BulkUpsertEnvironmentsError: """ Attributes: - errors (list[BulkUpsertEnvironmentsErrorErrorsItem]): + errors (list['BulkUpsertEnvironmentsErrorErrorsItem']): """ - errors: list[BulkUpsertEnvironmentsErrorErrorsItem] + errors: list["BulkUpsertEnvironmentsErrorErrorsItem"] additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - errors = [] for errors_item_data in self.errors: errors_item = errors_item_data.to_dict() diff --git a/rootly_sdk/models/bulk_upsert_environments_error_errors_item.py b/rootly_sdk/models/bulk_upsert_environments_error_errors_item.py index 39c9c7b2..073c968e 100644 --- a/rootly_sdk/models/bulk_upsert_environments_error_errors_item.py +++ b/rootly_sdk/models/bulk_upsert_environments_error_errors_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast diff --git a/rootly_sdk/models/bulk_upsert_environments_response.py b/rootly_sdk/models/bulk_upsert_environments_response.py index 3e7032dc..ac71f655 100644 --- a/rootly_sdk/models/bulk_upsert_environments_response.py +++ b/rootly_sdk/models/bulk_upsert_environments_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,15 +17,14 @@ class BulkUpsertEnvironmentsResponse: """ Attributes: - data (list[BulkUpsertEnvironmentsResponseDataItem] | Unset): + data (Union[Unset, list['BulkUpsertEnvironmentsResponseDataItem']]): """ - data: list[BulkUpsertEnvironmentsResponseDataItem] | Unset = UNSET + data: Union[Unset, list["BulkUpsertEnvironmentsResponseDataItem"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - - data: list[dict[str, Any]] | Unset = UNSET + data: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.data, Unset): data = [] for data_item_data in self.data: @@ -47,14 +44,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: from ..models.bulk_upsert_environments_response_data_item import BulkUpsertEnvironmentsResponseDataItem d = dict(src_dict) + data = [] _data = d.pop("data", UNSET) - data: list[BulkUpsertEnvironmentsResponseDataItem] | Unset = UNSET - if _data is not UNSET: - data = [] - for data_item_data in _data: - data_item = BulkUpsertEnvironmentsResponseDataItem.from_dict(data_item_data) + for data_item_data in _data or []: + data_item = BulkUpsertEnvironmentsResponseDataItem.from_dict(data_item_data) - data.append(data_item) + data.append(data_item) bulk_upsert_environments_response = cls( data=data, diff --git a/rootly_sdk/models/bulk_upsert_environments_response_data_item.py b/rootly_sdk/models/bulk_upsert_environments_response_data_item.py index 57f2a594..609e4e4e 100644 --- a/rootly_sdk/models/bulk_upsert_environments_response_data_item.py +++ b/rootly_sdk/models/bulk_upsert_environments_response_data_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,25 +21,24 @@ class BulkUpsertEnvironmentsResponseDataItem: """ Attributes: - id (str | Unset): - type_ (BulkUpsertEnvironmentsResponseDataItemType | Unset): - attributes (Environment | Unset): + id (Union[Unset, str]): + type_ (Union[Unset, BulkUpsertEnvironmentsResponseDataItemType]): + attributes (Union[Unset, Environment]): """ - id: str | Unset = UNSET - type_: BulkUpsertEnvironmentsResponseDataItemType | Unset = UNSET - attributes: Environment | Unset = UNSET + id: Union[Unset, str] = UNSET + type_: Union[Unset, BulkUpsertEnvironmentsResponseDataItemType] = UNSET + attributes: Union[Unset, "Environment"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id - type_: str | Unset = UNSET + type_: Union[Unset, str] = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ - attributes: dict[str, Any] | Unset = UNSET + attributes: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.attributes, Unset): attributes = self.attributes.to_dict() @@ -65,14 +62,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: id = d.pop("id", UNSET) _type_ = d.pop("type", UNSET) - type_: BulkUpsertEnvironmentsResponseDataItemType | Unset + type_: Union[Unset, BulkUpsertEnvironmentsResponseDataItemType] if isinstance(_type_, Unset): type_ = UNSET else: type_ = check_bulk_upsert_environments_response_data_item_type(_type_) _attributes = d.pop("attributes", UNSET) - attributes: Environment | Unset + attributes: Union[Unset, Environment] if isinstance(_attributes, Unset): attributes = UNSET else: diff --git a/rootly_sdk/models/bulk_upsert_functionalities.py b/rootly_sdk/models/bulk_upsert_functionalities.py index 31332a66..256663a4 100644 --- a/rootly_sdk/models/bulk_upsert_functionalities.py +++ b/rootly_sdk/models/bulk_upsert_functionalities.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -17,16 +15,15 @@ class BulkUpsertFunctionalities: """ Attributes: - entities (list[BulkUpsertFunctionalitiesEntitiesItem]): Functionalities to upsert, matched by external_id. Max + entities (list['BulkUpsertFunctionalitiesEntitiesItem']): Functionalities to upsert, matched by external_id. Max 100 per request; external_ids unique within a batch. Only attributes present are written (managed-fields semantics). """ - entities: list[BulkUpsertFunctionalitiesEntitiesItem] + entities: list["BulkUpsertFunctionalitiesEntitiesItem"] additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - entities = [] for entities_item_data in self.entities: entities_item = entities_item_data.to_dict() diff --git a/rootly_sdk/models/bulk_upsert_functionalities_entities_item.py b/rootly_sdk/models/bulk_upsert_functionalities_entities_item.py index e0dc2dec..d9997474 100644 --- a/rootly_sdk/models/bulk_upsert_functionalities_entities_item.py +++ b/rootly_sdk/models/bulk_upsert_functionalities_entities_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,87 +20,86 @@ class BulkUpsertFunctionalitiesEntitiesItem: """ Attributes: external_id (str): External identifier used as the upsert key. Unique per team. - name (str | Unset): Required for new records. Optional for updates. - description (None | str | Unset): - public_description (None | str | Unset): - color (None | str | Unset): - position (int | None | Unset): - show_uptime (bool | None | Unset): - show_uptime_last_days (int | None | Unset): - notify_emails (list[str] | None | Unset): - pagerduty_id (None | str | Unset): - opsgenie_id (None | str | Unset): - opsgenie_team_id (None | str | Unset): - backstage_id (None | str | Unset): - cortex_id (None | str | Unset): - opslevel_id (None | str | Unset): - service_now_ci_sys_id (None | str | Unset): - fields (list[BulkUpsertFunctionalitiesEntitiesItemFieldsItem] | Unset): Catalog property values (merge + name (Union[Unset, str]): Required for new records. Optional for updates. + description (Union[None, Unset, str]): + public_description (Union[None, Unset, str]): + color (Union[None, Unset, str]): + position (Union[None, Unset, int]): + show_uptime (Union[None, Unset, bool]): + show_uptime_last_days (Union[None, Unset, int]): + notify_emails (Union[None, Unset, list[str]]): + pagerduty_id (Union[None, Unset, str]): + opsgenie_id (Union[None, Unset, str]): + opsgenie_team_id (Union[None, Unset, str]): + backstage_id (Union[None, Unset, str]): + cortex_id (Union[None, Unset, str]): + opslevel_id (Union[None, Unset, str]): + service_now_ci_sys_id (Union[None, Unset, str]): + fields (Union[Unset, list['BulkUpsertFunctionalitiesEntitiesItemFieldsItem']]): Catalog property values (merge semantics: only mentioned fields written). """ external_id: str - name: str | Unset = UNSET - description: None | str | Unset = UNSET - public_description: None | str | Unset = UNSET - color: None | str | Unset = UNSET - position: int | None | Unset = UNSET - show_uptime: bool | None | Unset = UNSET - show_uptime_last_days: int | None | Unset = UNSET - notify_emails: list[str] | None | Unset = UNSET - pagerduty_id: None | str | Unset = UNSET - opsgenie_id: None | str | Unset = UNSET - opsgenie_team_id: None | str | Unset = UNSET - backstage_id: None | str | Unset = UNSET - cortex_id: None | str | Unset = UNSET - opslevel_id: None | str | Unset = UNSET - service_now_ci_sys_id: None | str | Unset = UNSET - fields: list[BulkUpsertFunctionalitiesEntitiesItemFieldsItem] | Unset = UNSET + name: Union[Unset, str] = UNSET + description: Union[None, Unset, str] = UNSET + public_description: Union[None, Unset, str] = UNSET + color: Union[None, Unset, str] = UNSET + position: Union[None, Unset, int] = UNSET + show_uptime: Union[None, Unset, bool] = UNSET + show_uptime_last_days: Union[None, Unset, int] = UNSET + notify_emails: Union[None, Unset, list[str]] = UNSET + pagerduty_id: Union[None, Unset, str] = UNSET + opsgenie_id: Union[None, Unset, str] = UNSET + opsgenie_team_id: Union[None, Unset, str] = UNSET + backstage_id: Union[None, Unset, str] = UNSET + cortex_id: Union[None, Unset, str] = UNSET + opslevel_id: Union[None, Unset, str] = UNSET + service_now_ci_sys_id: Union[None, Unset, str] = UNSET + fields: Union[Unset, list["BulkUpsertFunctionalitiesEntitiesItemFieldsItem"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - external_id = self.external_id name = self.name - description: None | str | Unset + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: description = self.description - public_description: None | str | Unset + public_description: Union[None, Unset, str] if isinstance(self.public_description, Unset): public_description = UNSET else: public_description = self.public_description - color: None | str | Unset + color: Union[None, Unset, str] if isinstance(self.color, Unset): color = UNSET else: color = self.color - position: int | None | Unset + position: Union[None, Unset, int] if isinstance(self.position, Unset): position = UNSET else: position = self.position - show_uptime: bool | None | Unset + show_uptime: Union[None, Unset, bool] if isinstance(self.show_uptime, Unset): show_uptime = UNSET else: show_uptime = self.show_uptime - show_uptime_last_days: int | None | Unset + show_uptime_last_days: Union[None, Unset, int] if isinstance(self.show_uptime_last_days, Unset): show_uptime_last_days = UNSET else: show_uptime_last_days = self.show_uptime_last_days - notify_emails: list[str] | None | Unset + notify_emails: Union[None, Unset, list[str]] if isinstance(self.notify_emails, Unset): notify_emails = UNSET elif isinstance(self.notify_emails, list): @@ -111,49 +108,49 @@ def to_dict(self) -> dict[str, Any]: else: notify_emails = self.notify_emails - pagerduty_id: None | str | Unset + pagerduty_id: Union[None, Unset, str] if isinstance(self.pagerduty_id, Unset): pagerduty_id = UNSET else: pagerduty_id = self.pagerduty_id - opsgenie_id: None | str | Unset + opsgenie_id: Union[None, Unset, str] if isinstance(self.opsgenie_id, Unset): opsgenie_id = UNSET else: opsgenie_id = self.opsgenie_id - opsgenie_team_id: None | str | Unset + opsgenie_team_id: Union[None, Unset, str] if isinstance(self.opsgenie_team_id, Unset): opsgenie_team_id = UNSET else: opsgenie_team_id = self.opsgenie_team_id - backstage_id: None | str | Unset + backstage_id: Union[None, Unset, str] if isinstance(self.backstage_id, Unset): backstage_id = UNSET else: backstage_id = self.backstage_id - cortex_id: None | str | Unset + cortex_id: Union[None, Unset, str] if isinstance(self.cortex_id, Unset): cortex_id = UNSET else: cortex_id = self.cortex_id - opslevel_id: None | str | Unset + opslevel_id: Union[None, Unset, str] if isinstance(self.opslevel_id, Unset): opslevel_id = UNSET else: opslevel_id = self.opslevel_id - service_now_ci_sys_id: None | str | Unset + service_now_ci_sys_id: Union[None, Unset, str] if isinstance(self.service_now_ci_sys_id, Unset): service_now_ci_sys_id = UNSET else: service_now_ci_sys_id = self.service_now_ci_sys_id - fields: list[dict[str, Any]] | Unset = UNSET + fields: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.fields, Unset): fields = [] for fields_item_data in self.fields: @@ -213,61 +210,61 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name = d.pop("name", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) - def _parse_public_description(data: object) -> None | str | Unset: + def _parse_public_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) public_description = _parse_public_description(d.pop("public_description", UNSET)) - def _parse_color(data: object) -> None | str | Unset: + def _parse_color(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) color = _parse_color(d.pop("color", UNSET)) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> Union[None, Unset, int]: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(Union[None, Unset, int], data) position = _parse_position(d.pop("position", UNSET)) - def _parse_show_uptime(data: object) -> bool | None | Unset: + def _parse_show_uptime(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) show_uptime = _parse_show_uptime(d.pop("show_uptime", UNSET)) - def _parse_show_uptime_last_days(data: object) -> int | None | Unset: + def _parse_show_uptime_last_days(data: object) -> Union[None, Unset, int]: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(Union[None, Unset, int], data) show_uptime_last_days = _parse_show_uptime_last_days(d.pop("show_uptime_last_days", UNSET)) - def _parse_notify_emails(data: object) -> list[str] | None | Unset: + def _parse_notify_emails(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -278,83 +275,81 @@ def _parse_notify_emails(data: object) -> list[str] | None | Unset: notify_emails_type_0 = cast(list[str], data) return notify_emails_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) notify_emails = _parse_notify_emails(d.pop("notify_emails", UNSET)) - def _parse_pagerduty_id(data: object) -> None | str | Unset: + def _parse_pagerduty_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) pagerduty_id = _parse_pagerduty_id(d.pop("pagerduty_id", UNSET)) - def _parse_opsgenie_id(data: object) -> None | str | Unset: + def _parse_opsgenie_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) opsgenie_id = _parse_opsgenie_id(d.pop("opsgenie_id", UNSET)) - def _parse_opsgenie_team_id(data: object) -> None | str | Unset: + def _parse_opsgenie_team_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) opsgenie_team_id = _parse_opsgenie_team_id(d.pop("opsgenie_team_id", UNSET)) - def _parse_backstage_id(data: object) -> None | str | Unset: + def _parse_backstage_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) backstage_id = _parse_backstage_id(d.pop("backstage_id", UNSET)) - def _parse_cortex_id(data: object) -> None | str | Unset: + def _parse_cortex_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) cortex_id = _parse_cortex_id(d.pop("cortex_id", UNSET)) - def _parse_opslevel_id(data: object) -> None | str | Unset: + def _parse_opslevel_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) opslevel_id = _parse_opslevel_id(d.pop("opslevel_id", UNSET)) - def _parse_service_now_ci_sys_id(data: object) -> None | str | Unset: + def _parse_service_now_ci_sys_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) service_now_ci_sys_id = _parse_service_now_ci_sys_id(d.pop("service_now_ci_sys_id", UNSET)) + fields = [] _fields = d.pop("fields", UNSET) - fields: list[BulkUpsertFunctionalitiesEntitiesItemFieldsItem] | Unset = UNSET - if _fields is not UNSET: - fields = [] - for fields_item_data in _fields: - fields_item = BulkUpsertFunctionalitiesEntitiesItemFieldsItem.from_dict(fields_item_data) + for fields_item_data in _fields or []: + fields_item = BulkUpsertFunctionalitiesEntitiesItemFieldsItem.from_dict(fields_item_data) - fields.append(fields_item) + fields.append(fields_item) bulk_upsert_functionalities_entities_item = cls( external_id=external_id, diff --git a/rootly_sdk/models/bulk_upsert_functionalities_entities_item_fields_item.py b/rootly_sdk/models/bulk_upsert_functionalities_entities_item_fields_item.py index f56126ce..e059981a 100644 --- a/rootly_sdk/models/bulk_upsert_functionalities_entities_item_fields_item.py +++ b/rootly_sdk/models/bulk_upsert_functionalities_entities_item_fields_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,14 +15,14 @@ class BulkUpsertFunctionalitiesEntitiesItemFieldsItem: Attributes: value (str): The value for this field - catalog_field_id (str | Unset): UUID, slug, or external_id of the catalog field (required if catalog_property_id - is absent) - catalog_property_id (str | Unset): Alias for catalog_field_id (required if catalog_field_id is absent) + catalog_field_id (Union[Unset, str]): UUID, slug, or external_id of the catalog field (required if + catalog_property_id is absent) + catalog_property_id (Union[Unset, str]): Alias for catalog_field_id (required if catalog_field_id is absent) """ value: str - catalog_field_id: str | Unset = UNSET - catalog_property_id: str | Unset = UNSET + catalog_field_id: Union[Unset, str] = UNSET + catalog_property_id: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/bulk_upsert_functionalities_error.py b/rootly_sdk/models/bulk_upsert_functionalities_error.py index 2c93c715..ae9f29c3 100644 --- a/rootly_sdk/models/bulk_upsert_functionalities_error.py +++ b/rootly_sdk/models/bulk_upsert_functionalities_error.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -17,14 +15,13 @@ class BulkUpsertFunctionalitiesError: """ Attributes: - errors (list[BulkUpsertFunctionalitiesErrorErrorsItem]): + errors (list['BulkUpsertFunctionalitiesErrorErrorsItem']): """ - errors: list[BulkUpsertFunctionalitiesErrorErrorsItem] + errors: list["BulkUpsertFunctionalitiesErrorErrorsItem"] additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - errors = [] for errors_item_data in self.errors: errors_item = errors_item_data.to_dict() diff --git a/rootly_sdk/models/bulk_upsert_functionalities_error_errors_item.py b/rootly_sdk/models/bulk_upsert_functionalities_error_errors_item.py index 8ae7ae2e..10981217 100644 --- a/rootly_sdk/models/bulk_upsert_functionalities_error_errors_item.py +++ b/rootly_sdk/models/bulk_upsert_functionalities_error_errors_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast diff --git a/rootly_sdk/models/bulk_upsert_functionalities_response.py b/rootly_sdk/models/bulk_upsert_functionalities_response.py index 1318338b..1b1d4b58 100644 --- a/rootly_sdk/models/bulk_upsert_functionalities_response.py +++ b/rootly_sdk/models/bulk_upsert_functionalities_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,15 +17,14 @@ class BulkUpsertFunctionalitiesResponse: """ Attributes: - data (list[BulkUpsertFunctionalitiesResponseDataItem] | Unset): + data (Union[Unset, list['BulkUpsertFunctionalitiesResponseDataItem']]): """ - data: list[BulkUpsertFunctionalitiesResponseDataItem] | Unset = UNSET + data: Union[Unset, list["BulkUpsertFunctionalitiesResponseDataItem"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - - data: list[dict[str, Any]] | Unset = UNSET + data: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.data, Unset): data = [] for data_item_data in self.data: @@ -47,14 +44,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: from ..models.bulk_upsert_functionalities_response_data_item import BulkUpsertFunctionalitiesResponseDataItem d = dict(src_dict) + data = [] _data = d.pop("data", UNSET) - data: list[BulkUpsertFunctionalitiesResponseDataItem] | Unset = UNSET - if _data is not UNSET: - data = [] - for data_item_data in _data: - data_item = BulkUpsertFunctionalitiesResponseDataItem.from_dict(data_item_data) + for data_item_data in _data or []: + data_item = BulkUpsertFunctionalitiesResponseDataItem.from_dict(data_item_data) - data.append(data_item) + data.append(data_item) bulk_upsert_functionalities_response = cls( data=data, diff --git a/rootly_sdk/models/bulk_upsert_functionalities_response_data_item.py b/rootly_sdk/models/bulk_upsert_functionalities_response_data_item.py index a96ca1af..58ce35bf 100644 --- a/rootly_sdk/models/bulk_upsert_functionalities_response_data_item.py +++ b/rootly_sdk/models/bulk_upsert_functionalities_response_data_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,25 +21,24 @@ class BulkUpsertFunctionalitiesResponseDataItem: """ Attributes: - id (str | Unset): - type_ (BulkUpsertFunctionalitiesResponseDataItemType | Unset): - attributes (Functionality | Unset): + id (Union[Unset, str]): + type_ (Union[Unset, BulkUpsertFunctionalitiesResponseDataItemType]): + attributes (Union[Unset, Functionality]): """ - id: str | Unset = UNSET - type_: BulkUpsertFunctionalitiesResponseDataItemType | Unset = UNSET - attributes: Functionality | Unset = UNSET + id: Union[Unset, str] = UNSET + type_: Union[Unset, BulkUpsertFunctionalitiesResponseDataItemType] = UNSET + attributes: Union[Unset, "Functionality"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id - type_: str | Unset = UNSET + type_: Union[Unset, str] = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ - attributes: dict[str, Any] | Unset = UNSET + attributes: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.attributes, Unset): attributes = self.attributes.to_dict() @@ -65,14 +62,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: id = d.pop("id", UNSET) _type_ = d.pop("type", UNSET) - type_: BulkUpsertFunctionalitiesResponseDataItemType | Unset + type_: Union[Unset, BulkUpsertFunctionalitiesResponseDataItemType] if isinstance(_type_, Unset): type_ = UNSET else: type_ = check_bulk_upsert_functionalities_response_data_item_type(_type_) _attributes = d.pop("attributes", UNSET) - attributes: Functionality | Unset + attributes: Union[Unset, Functionality] if isinstance(_attributes, Unset): attributes = UNSET else: diff --git a/rootly_sdk/models/bulk_upsert_services.py b/rootly_sdk/models/bulk_upsert_services.py index e027c8be..7efff1ad 100644 --- a/rootly_sdk/models/bulk_upsert_services.py +++ b/rootly_sdk/models/bulk_upsert_services.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -17,15 +15,14 @@ class BulkUpsertServices: """ Attributes: - entities (list[BulkUpsertServicesEntitiesItem]): Services to upsert, matched by external_id. Max 100 per + entities (list['BulkUpsertServicesEntitiesItem']): Services to upsert, matched by external_id. Max 100 per request; external_ids unique within a batch. Only attributes present are written (managed-fields semantics). """ - entities: list[BulkUpsertServicesEntitiesItem] + entities: list["BulkUpsertServicesEntitiesItem"] additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - entities = [] for entities_item_data in self.entities: entities_item = entities_item_data.to_dict() diff --git a/rootly_sdk/models/bulk_upsert_services_entities_item.py b/rootly_sdk/models/bulk_upsert_services_entities_item.py index 9c8d36e8..19f054af 100644 --- a/rootly_sdk/models/bulk_upsert_services_entities_item.py +++ b/rootly_sdk/models/bulk_upsert_services_entities_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -20,171 +18,170 @@ class BulkUpsertServicesEntitiesItem: """ Attributes: external_id (str): External identifier used as the upsert key. Unique per team. - name (str | Unset): Required for new records. Optional for updates. - description (None | str | Unset): - public_description (None | str | Unset): - color (None | str | Unset): - position (int | None | Unset): - show_uptime (bool | None | Unset): - show_uptime_last_days (int | None | Unset): - github_repository_name (None | str | Unset): - github_repository_branch (None | str | Unset): - gitlab_repository_name (None | str | Unset): - gitlab_repository_branch (None | str | Unset): - kubernetes_deployment_name (None | str | Unset): - pagerduty_id (None | str | Unset): - opsgenie_id (None | str | Unset): - opsgenie_team_id (None | str | Unset): - cortex_id (None | str | Unset): - opslevel_id (None | str | Unset): - backstage_id (None | str | Unset): - service_now_ci_sys_id (None | str | Unset): - notify_emails (list[str] | None | Unset): - alerts_email_enabled (bool | None | Unset): - fields (list[BulkUpsertServicesEntitiesItemFieldsItem] | Unset): Catalog property values (merge semantics: only - mentioned fields written). + name (Union[Unset, str]): Required for new records. Optional for updates. + description (Union[None, Unset, str]): + public_description (Union[None, Unset, str]): + color (Union[None, Unset, str]): + position (Union[None, Unset, int]): + show_uptime (Union[None, Unset, bool]): + show_uptime_last_days (Union[None, Unset, int]): + github_repository_name (Union[None, Unset, str]): + github_repository_branch (Union[None, Unset, str]): + gitlab_repository_name (Union[None, Unset, str]): + gitlab_repository_branch (Union[None, Unset, str]): + kubernetes_deployment_name (Union[None, Unset, str]): + pagerduty_id (Union[None, Unset, str]): + opsgenie_id (Union[None, Unset, str]): + opsgenie_team_id (Union[None, Unset, str]): + cortex_id (Union[None, Unset, str]): + opslevel_id (Union[None, Unset, str]): + backstage_id (Union[None, Unset, str]): + service_now_ci_sys_id (Union[None, Unset, str]): + notify_emails (Union[None, Unset, list[str]]): + alerts_email_enabled (Union[None, Unset, bool]): + fields (Union[Unset, list['BulkUpsertServicesEntitiesItemFieldsItem']]): Catalog property values (merge + semantics: only mentioned fields written). """ external_id: str - name: str | Unset = UNSET - description: None | str | Unset = UNSET - public_description: None | str | Unset = UNSET - color: None | str | Unset = UNSET - position: int | None | Unset = UNSET - show_uptime: bool | None | Unset = UNSET - show_uptime_last_days: int | None | Unset = UNSET - github_repository_name: None | str | Unset = UNSET - github_repository_branch: None | str | Unset = UNSET - gitlab_repository_name: None | str | Unset = UNSET - gitlab_repository_branch: None | str | Unset = UNSET - kubernetes_deployment_name: None | str | Unset = UNSET - pagerduty_id: None | str | Unset = UNSET - opsgenie_id: None | str | Unset = UNSET - opsgenie_team_id: None | str | Unset = UNSET - cortex_id: None | str | Unset = UNSET - opslevel_id: None | str | Unset = UNSET - backstage_id: None | str | Unset = UNSET - service_now_ci_sys_id: None | str | Unset = UNSET - notify_emails: list[str] | None | Unset = UNSET - alerts_email_enabled: bool | None | Unset = UNSET - fields: list[BulkUpsertServicesEntitiesItemFieldsItem] | Unset = UNSET + name: Union[Unset, str] = UNSET + description: Union[None, Unset, str] = UNSET + public_description: Union[None, Unset, str] = UNSET + color: Union[None, Unset, str] = UNSET + position: Union[None, Unset, int] = UNSET + show_uptime: Union[None, Unset, bool] = UNSET + show_uptime_last_days: Union[None, Unset, int] = UNSET + github_repository_name: Union[None, Unset, str] = UNSET + github_repository_branch: Union[None, Unset, str] = UNSET + gitlab_repository_name: Union[None, Unset, str] = UNSET + gitlab_repository_branch: Union[None, Unset, str] = UNSET + kubernetes_deployment_name: Union[None, Unset, str] = UNSET + pagerduty_id: Union[None, Unset, str] = UNSET + opsgenie_id: Union[None, Unset, str] = UNSET + opsgenie_team_id: Union[None, Unset, str] = UNSET + cortex_id: Union[None, Unset, str] = UNSET + opslevel_id: Union[None, Unset, str] = UNSET + backstage_id: Union[None, Unset, str] = UNSET + service_now_ci_sys_id: Union[None, Unset, str] = UNSET + notify_emails: Union[None, Unset, list[str]] = UNSET + alerts_email_enabled: Union[None, Unset, bool] = UNSET + fields: Union[Unset, list["BulkUpsertServicesEntitiesItemFieldsItem"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - external_id = self.external_id name = self.name - description: None | str | Unset + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: description = self.description - public_description: None | str | Unset + public_description: Union[None, Unset, str] if isinstance(self.public_description, Unset): public_description = UNSET else: public_description = self.public_description - color: None | str | Unset + color: Union[None, Unset, str] if isinstance(self.color, Unset): color = UNSET else: color = self.color - position: int | None | Unset + position: Union[None, Unset, int] if isinstance(self.position, Unset): position = UNSET else: position = self.position - show_uptime: bool | None | Unset + show_uptime: Union[None, Unset, bool] if isinstance(self.show_uptime, Unset): show_uptime = UNSET else: show_uptime = self.show_uptime - show_uptime_last_days: int | None | Unset + show_uptime_last_days: Union[None, Unset, int] if isinstance(self.show_uptime_last_days, Unset): show_uptime_last_days = UNSET else: show_uptime_last_days = self.show_uptime_last_days - github_repository_name: None | str | Unset + github_repository_name: Union[None, Unset, str] if isinstance(self.github_repository_name, Unset): github_repository_name = UNSET else: github_repository_name = self.github_repository_name - github_repository_branch: None | str | Unset + github_repository_branch: Union[None, Unset, str] if isinstance(self.github_repository_branch, Unset): github_repository_branch = UNSET else: github_repository_branch = self.github_repository_branch - gitlab_repository_name: None | str | Unset + gitlab_repository_name: Union[None, Unset, str] if isinstance(self.gitlab_repository_name, Unset): gitlab_repository_name = UNSET else: gitlab_repository_name = self.gitlab_repository_name - gitlab_repository_branch: None | str | Unset + gitlab_repository_branch: Union[None, Unset, str] if isinstance(self.gitlab_repository_branch, Unset): gitlab_repository_branch = UNSET else: gitlab_repository_branch = self.gitlab_repository_branch - kubernetes_deployment_name: None | str | Unset + kubernetes_deployment_name: Union[None, Unset, str] if isinstance(self.kubernetes_deployment_name, Unset): kubernetes_deployment_name = UNSET else: kubernetes_deployment_name = self.kubernetes_deployment_name - pagerduty_id: None | str | Unset + pagerduty_id: Union[None, Unset, str] if isinstance(self.pagerduty_id, Unset): pagerduty_id = UNSET else: pagerduty_id = self.pagerduty_id - opsgenie_id: None | str | Unset + opsgenie_id: Union[None, Unset, str] if isinstance(self.opsgenie_id, Unset): opsgenie_id = UNSET else: opsgenie_id = self.opsgenie_id - opsgenie_team_id: None | str | Unset + opsgenie_team_id: Union[None, Unset, str] if isinstance(self.opsgenie_team_id, Unset): opsgenie_team_id = UNSET else: opsgenie_team_id = self.opsgenie_team_id - cortex_id: None | str | Unset + cortex_id: Union[None, Unset, str] if isinstance(self.cortex_id, Unset): cortex_id = UNSET else: cortex_id = self.cortex_id - opslevel_id: None | str | Unset + opslevel_id: Union[None, Unset, str] if isinstance(self.opslevel_id, Unset): opslevel_id = UNSET else: opslevel_id = self.opslevel_id - backstage_id: None | str | Unset + backstage_id: Union[None, Unset, str] if isinstance(self.backstage_id, Unset): backstage_id = UNSET else: backstage_id = self.backstage_id - service_now_ci_sys_id: None | str | Unset + service_now_ci_sys_id: Union[None, Unset, str] if isinstance(self.service_now_ci_sys_id, Unset): service_now_ci_sys_id = UNSET else: service_now_ci_sys_id = self.service_now_ci_sys_id - notify_emails: list[str] | None | Unset + notify_emails: Union[None, Unset, list[str]] if isinstance(self.notify_emails, Unset): notify_emails = UNSET elif isinstance(self.notify_emails, list): @@ -193,13 +190,13 @@ def to_dict(self) -> dict[str, Any]: else: notify_emails = self.notify_emails - alerts_email_enabled: bool | None | Unset + alerts_email_enabled: Union[None, Unset, bool] if isinstance(self.alerts_email_enabled, Unset): alerts_email_enabled = UNSET else: alerts_email_enabled = self.alerts_email_enabled - fields: list[dict[str, Any]] | Unset = UNSET + fields: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.fields, Unset): fields = [] for fields_item_data in self.fields: @@ -269,169 +266,169 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name = d.pop("name", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) - def _parse_public_description(data: object) -> None | str | Unset: + def _parse_public_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) public_description = _parse_public_description(d.pop("public_description", UNSET)) - def _parse_color(data: object) -> None | str | Unset: + def _parse_color(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) color = _parse_color(d.pop("color", UNSET)) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> Union[None, Unset, int]: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(Union[None, Unset, int], data) position = _parse_position(d.pop("position", UNSET)) - def _parse_show_uptime(data: object) -> bool | None | Unset: + def _parse_show_uptime(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) show_uptime = _parse_show_uptime(d.pop("show_uptime", UNSET)) - def _parse_show_uptime_last_days(data: object) -> int | None | Unset: + def _parse_show_uptime_last_days(data: object) -> Union[None, Unset, int]: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(Union[None, Unset, int], data) show_uptime_last_days = _parse_show_uptime_last_days(d.pop("show_uptime_last_days", UNSET)) - def _parse_github_repository_name(data: object) -> None | str | Unset: + def _parse_github_repository_name(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) github_repository_name = _parse_github_repository_name(d.pop("github_repository_name", UNSET)) - def _parse_github_repository_branch(data: object) -> None | str | Unset: + def _parse_github_repository_branch(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) github_repository_branch = _parse_github_repository_branch(d.pop("github_repository_branch", UNSET)) - def _parse_gitlab_repository_name(data: object) -> None | str | Unset: + def _parse_gitlab_repository_name(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) gitlab_repository_name = _parse_gitlab_repository_name(d.pop("gitlab_repository_name", UNSET)) - def _parse_gitlab_repository_branch(data: object) -> None | str | Unset: + def _parse_gitlab_repository_branch(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) gitlab_repository_branch = _parse_gitlab_repository_branch(d.pop("gitlab_repository_branch", UNSET)) - def _parse_kubernetes_deployment_name(data: object) -> None | str | Unset: + def _parse_kubernetes_deployment_name(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) kubernetes_deployment_name = _parse_kubernetes_deployment_name(d.pop("kubernetes_deployment_name", UNSET)) - def _parse_pagerduty_id(data: object) -> None | str | Unset: + def _parse_pagerduty_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) pagerduty_id = _parse_pagerduty_id(d.pop("pagerduty_id", UNSET)) - def _parse_opsgenie_id(data: object) -> None | str | Unset: + def _parse_opsgenie_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) opsgenie_id = _parse_opsgenie_id(d.pop("opsgenie_id", UNSET)) - def _parse_opsgenie_team_id(data: object) -> None | str | Unset: + def _parse_opsgenie_team_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) opsgenie_team_id = _parse_opsgenie_team_id(d.pop("opsgenie_team_id", UNSET)) - def _parse_cortex_id(data: object) -> None | str | Unset: + def _parse_cortex_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) cortex_id = _parse_cortex_id(d.pop("cortex_id", UNSET)) - def _parse_opslevel_id(data: object) -> None | str | Unset: + def _parse_opslevel_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) opslevel_id = _parse_opslevel_id(d.pop("opslevel_id", UNSET)) - def _parse_backstage_id(data: object) -> None | str | Unset: + def _parse_backstage_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) backstage_id = _parse_backstage_id(d.pop("backstage_id", UNSET)) - def _parse_service_now_ci_sys_id(data: object) -> None | str | Unset: + def _parse_service_now_ci_sys_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) service_now_ci_sys_id = _parse_service_now_ci_sys_id(d.pop("service_now_ci_sys_id", UNSET)) - def _parse_notify_emails(data: object) -> list[str] | None | Unset: + def _parse_notify_emails(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -442,29 +439,27 @@ def _parse_notify_emails(data: object) -> list[str] | None | Unset: notify_emails_type_0 = cast(list[str], data) return notify_emails_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) notify_emails = _parse_notify_emails(d.pop("notify_emails", UNSET)) - def _parse_alerts_email_enabled(data: object) -> bool | None | Unset: + def _parse_alerts_email_enabled(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) alerts_email_enabled = _parse_alerts_email_enabled(d.pop("alerts_email_enabled", UNSET)) + fields = [] _fields = d.pop("fields", UNSET) - fields: list[BulkUpsertServicesEntitiesItemFieldsItem] | Unset = UNSET - if _fields is not UNSET: - fields = [] - for fields_item_data in _fields: - fields_item = BulkUpsertServicesEntitiesItemFieldsItem.from_dict(fields_item_data) + for fields_item_data in _fields or []: + fields_item = BulkUpsertServicesEntitiesItemFieldsItem.from_dict(fields_item_data) - fields.append(fields_item) + fields.append(fields_item) bulk_upsert_services_entities_item = cls( external_id=external_id, diff --git a/rootly_sdk/models/bulk_upsert_services_entities_item_fields_item.py b/rootly_sdk/models/bulk_upsert_services_entities_item_fields_item.py index 1c8f31dc..dbbdeafa 100644 --- a/rootly_sdk/models/bulk_upsert_services_entities_item_fields_item.py +++ b/rootly_sdk/models/bulk_upsert_services_entities_item_fields_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,14 +15,14 @@ class BulkUpsertServicesEntitiesItemFieldsItem: Attributes: value (str): The value for this field - catalog_field_id (str | Unset): UUID, slug, or external_id of the catalog field (required if catalog_property_id - is absent) - catalog_property_id (str | Unset): Alias for catalog_field_id (required if catalog_field_id is absent) + catalog_field_id (Union[Unset, str]): UUID, slug, or external_id of the catalog field (required if + catalog_property_id is absent) + catalog_property_id (Union[Unset, str]): Alias for catalog_field_id (required if catalog_field_id is absent) """ value: str - catalog_field_id: str | Unset = UNSET - catalog_property_id: str | Unset = UNSET + catalog_field_id: Union[Unset, str] = UNSET + catalog_property_id: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/bulk_upsert_services_error.py b/rootly_sdk/models/bulk_upsert_services_error.py index 2c96bf7d..36ae7c13 100644 --- a/rootly_sdk/models/bulk_upsert_services_error.py +++ b/rootly_sdk/models/bulk_upsert_services_error.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -17,14 +15,13 @@ class BulkUpsertServicesError: """ Attributes: - errors (list[BulkUpsertServicesErrorErrorsItem]): + errors (list['BulkUpsertServicesErrorErrorsItem']): """ - errors: list[BulkUpsertServicesErrorErrorsItem] + errors: list["BulkUpsertServicesErrorErrorsItem"] additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - errors = [] for errors_item_data in self.errors: errors_item = errors_item_data.to_dict() diff --git a/rootly_sdk/models/bulk_upsert_services_error_errors_item.py b/rootly_sdk/models/bulk_upsert_services_error_errors_item.py index 8fb6bac4..51a76f78 100644 --- a/rootly_sdk/models/bulk_upsert_services_error_errors_item.py +++ b/rootly_sdk/models/bulk_upsert_services_error_errors_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast diff --git a/rootly_sdk/models/bulk_upsert_services_response.py b/rootly_sdk/models/bulk_upsert_services_response.py index 60959ba7..3f6293f5 100644 --- a/rootly_sdk/models/bulk_upsert_services_response.py +++ b/rootly_sdk/models/bulk_upsert_services_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,15 +17,14 @@ class BulkUpsertServicesResponse: """ Attributes: - data (list[BulkUpsertServicesResponseDataItem] | Unset): + data (Union[Unset, list['BulkUpsertServicesResponseDataItem']]): """ - data: list[BulkUpsertServicesResponseDataItem] | Unset = UNSET + data: Union[Unset, list["BulkUpsertServicesResponseDataItem"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - - data: list[dict[str, Any]] | Unset = UNSET + data: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.data, Unset): data = [] for data_item_data in self.data: @@ -47,14 +44,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: from ..models.bulk_upsert_services_response_data_item import BulkUpsertServicesResponseDataItem d = dict(src_dict) + data = [] _data = d.pop("data", UNSET) - data: list[BulkUpsertServicesResponseDataItem] | Unset = UNSET - if _data is not UNSET: - data = [] - for data_item_data in _data: - data_item = BulkUpsertServicesResponseDataItem.from_dict(data_item_data) + for data_item_data in _data or []: + data_item = BulkUpsertServicesResponseDataItem.from_dict(data_item_data) - data.append(data_item) + data.append(data_item) bulk_upsert_services_response = cls( data=data, diff --git a/rootly_sdk/models/bulk_upsert_services_response_data_item.py b/rootly_sdk/models/bulk_upsert_services_response_data_item.py index a57b5d08..3f24ee16 100644 --- a/rootly_sdk/models/bulk_upsert_services_response_data_item.py +++ b/rootly_sdk/models/bulk_upsert_services_response_data_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,25 +21,24 @@ class BulkUpsertServicesResponseDataItem: """ Attributes: - id (str | Unset): - type_ (BulkUpsertServicesResponseDataItemType | Unset): - attributes (Service | Unset): + id (Union[Unset, str]): + type_ (Union[Unset, BulkUpsertServicesResponseDataItemType]): + attributes (Union[Unset, Service]): """ - id: str | Unset = UNSET - type_: BulkUpsertServicesResponseDataItemType | Unset = UNSET - attributes: Service | Unset = UNSET + id: Union[Unset, str] = UNSET + type_: Union[Unset, BulkUpsertServicesResponseDataItemType] = UNSET + attributes: Union[Unset, "Service"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id - type_: str | Unset = UNSET + type_: Union[Unset, str] = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ - attributes: dict[str, Any] | Unset = UNSET + attributes: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.attributes, Unset): attributes = self.attributes.to_dict() @@ -65,14 +62,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: id = d.pop("id", UNSET) _type_ = d.pop("type", UNSET) - type_: BulkUpsertServicesResponseDataItemType | Unset + type_: Union[Unset, BulkUpsertServicesResponseDataItemType] if isinstance(_type_, Unset): type_ = UNSET else: type_ = check_bulk_upsert_services_response_data_item_type(_type_) _attributes = d.pop("attributes", UNSET) - attributes: Service | Unset + attributes: Union[Unset, Service] if isinstance(_attributes, Unset): attributes = UNSET else: diff --git a/rootly_sdk/models/bulk_upsert_teams.py b/rootly_sdk/models/bulk_upsert_teams.py index 8495037f..ba93015c 100644 --- a/rootly_sdk/models/bulk_upsert_teams.py +++ b/rootly_sdk/models/bulk_upsert_teams.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -17,15 +15,14 @@ class BulkUpsertTeams: """ Attributes: - entities (list[BulkUpsertTeamsEntitiesItem]): Teams to upsert, matched by external_id. Max 100 per request; + entities (list['BulkUpsertTeamsEntitiesItem']): Teams to upsert, matched by external_id. Max 100 per request; external_ids unique within a batch. Only attributes present are written (managed-fields semantics). """ - entities: list[BulkUpsertTeamsEntitiesItem] + entities: list["BulkUpsertTeamsEntitiesItem"] additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - entities = [] for entities_item_data in self.entities: entities_item = entities_item_data.to_dict() diff --git a/rootly_sdk/models/bulk_upsert_teams_entities_item.py b/rootly_sdk/models/bulk_upsert_teams_entities_item.py index 2f881903..d0edba81 100644 --- a/rootly_sdk/models/bulk_upsert_teams_entities_item.py +++ b/rootly_sdk/models/bulk_upsert_teams_entities_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -20,69 +18,76 @@ class BulkUpsertTeamsEntitiesItem: """ Attributes: external_id (str): External identifier used as the upsert key. Unique per team. - name (str | Unset): Required for new records. Optional for updates. - description (None | str | Unset): - color (None | str | Unset): - position (int | None | Unset): - notify_emails (list[str] | None | Unset): - pagerduty_id (None | str | Unset): - pagerduty_service_id (None | str | Unset): - opsgenie_id (None | str | Unset): - victor_ops_id (None | str | Unset): - pagertree_id (None | str | Unset): - backstage_id (None | str | Unset): - cortex_id (None | str | Unset): - opslevel_id (None | str | Unset): - service_now_ci_sys_id (None | str | Unset): - alerts_email_enabled (bool | None | Unset): - fields (list[BulkUpsertTeamsEntitiesItemFieldsItem] | Unset): Catalog property values (merge semantics: only - mentioned fields written). + name (Union[Unset, str]): Required for new records. Optional for updates. + description (Union[None, Unset, str]): + public_description (Union[None, Unset, str]): + color (Union[None, Unset, str]): + position (Union[None, Unset, int]): + notify_emails (Union[None, Unset, list[str]]): + pagerduty_id (Union[None, Unset, str]): + pagerduty_service_id (Union[None, Unset, str]): + opsgenie_id (Union[None, Unset, str]): + victor_ops_id (Union[None, Unset, str]): + pagertree_id (Union[None, Unset, str]): + backstage_id (Union[None, Unset, str]): + cortex_id (Union[None, Unset, str]): + opslevel_id (Union[None, Unset, str]): + service_now_ci_sys_id (Union[None, Unset, str]): + alerts_email_enabled (Union[None, Unset, bool]): + fields (Union[Unset, list['BulkUpsertTeamsEntitiesItemFieldsItem']]): Catalog property values (merge semantics: + only mentioned fields written). """ external_id: str - name: str | Unset = UNSET - description: None | str | Unset = UNSET - color: None | str | Unset = UNSET - position: int | None | Unset = UNSET - notify_emails: list[str] | None | Unset = UNSET - pagerduty_id: None | str | Unset = UNSET - pagerduty_service_id: None | str | Unset = UNSET - opsgenie_id: None | str | Unset = UNSET - victor_ops_id: None | str | Unset = UNSET - pagertree_id: None | str | Unset = UNSET - backstage_id: None | str | Unset = UNSET - cortex_id: None | str | Unset = UNSET - opslevel_id: None | str | Unset = UNSET - service_now_ci_sys_id: None | str | Unset = UNSET - alerts_email_enabled: bool | None | Unset = UNSET - fields: list[BulkUpsertTeamsEntitiesItemFieldsItem] | Unset = UNSET + name: Union[Unset, str] = UNSET + description: Union[None, Unset, str] = UNSET + public_description: Union[None, Unset, str] = UNSET + color: Union[None, Unset, str] = UNSET + position: Union[None, Unset, int] = UNSET + notify_emails: Union[None, Unset, list[str]] = UNSET + pagerduty_id: Union[None, Unset, str] = UNSET + pagerduty_service_id: Union[None, Unset, str] = UNSET + opsgenie_id: Union[None, Unset, str] = UNSET + victor_ops_id: Union[None, Unset, str] = UNSET + pagertree_id: Union[None, Unset, str] = UNSET + backstage_id: Union[None, Unset, str] = UNSET + cortex_id: Union[None, Unset, str] = UNSET + opslevel_id: Union[None, Unset, str] = UNSET + service_now_ci_sys_id: Union[None, Unset, str] = UNSET + alerts_email_enabled: Union[None, Unset, bool] = UNSET + fields: Union[Unset, list["BulkUpsertTeamsEntitiesItemFieldsItem"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - external_id = self.external_id name = self.name - description: None | str | Unset + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: description = self.description - color: None | str | Unset + public_description: Union[None, Unset, str] + if isinstance(self.public_description, Unset): + public_description = UNSET + else: + public_description = self.public_description + + color: Union[None, Unset, str] if isinstance(self.color, Unset): color = UNSET else: color = self.color - position: int | None | Unset + position: Union[None, Unset, int] if isinstance(self.position, Unset): position = UNSET else: position = self.position - notify_emails: list[str] | None | Unset + notify_emails: Union[None, Unset, list[str]] if isinstance(self.notify_emails, Unset): notify_emails = UNSET elif isinstance(self.notify_emails, list): @@ -91,67 +96,67 @@ def to_dict(self) -> dict[str, Any]: else: notify_emails = self.notify_emails - pagerduty_id: None | str | Unset + pagerduty_id: Union[None, Unset, str] if isinstance(self.pagerduty_id, Unset): pagerduty_id = UNSET else: pagerduty_id = self.pagerduty_id - pagerduty_service_id: None | str | Unset + pagerduty_service_id: Union[None, Unset, str] if isinstance(self.pagerduty_service_id, Unset): pagerduty_service_id = UNSET else: pagerduty_service_id = self.pagerduty_service_id - opsgenie_id: None | str | Unset + opsgenie_id: Union[None, Unset, str] if isinstance(self.opsgenie_id, Unset): opsgenie_id = UNSET else: opsgenie_id = self.opsgenie_id - victor_ops_id: None | str | Unset + victor_ops_id: Union[None, Unset, str] if isinstance(self.victor_ops_id, Unset): victor_ops_id = UNSET else: victor_ops_id = self.victor_ops_id - pagertree_id: None | str | Unset + pagertree_id: Union[None, Unset, str] if isinstance(self.pagertree_id, Unset): pagertree_id = UNSET else: pagertree_id = self.pagertree_id - backstage_id: None | str | Unset + backstage_id: Union[None, Unset, str] if isinstance(self.backstage_id, Unset): backstage_id = UNSET else: backstage_id = self.backstage_id - cortex_id: None | str | Unset + cortex_id: Union[None, Unset, str] if isinstance(self.cortex_id, Unset): cortex_id = UNSET else: cortex_id = self.cortex_id - opslevel_id: None | str | Unset + opslevel_id: Union[None, Unset, str] if isinstance(self.opslevel_id, Unset): opslevel_id = UNSET else: opslevel_id = self.opslevel_id - service_now_ci_sys_id: None | str | Unset + service_now_ci_sys_id: Union[None, Unset, str] if isinstance(self.service_now_ci_sys_id, Unset): service_now_ci_sys_id = UNSET else: service_now_ci_sys_id = self.service_now_ci_sys_id - alerts_email_enabled: bool | None | Unset + alerts_email_enabled: Union[None, Unset, bool] if isinstance(self.alerts_email_enabled, Unset): alerts_email_enabled = UNSET else: alerts_email_enabled = self.alerts_email_enabled - fields: list[dict[str, Any]] | Unset = UNSET + fields: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.fields, Unset): fields = [] for fields_item_data in self.fields: @@ -169,6 +174,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["name"] = name if description is not UNSET: field_dict["description"] = description + if public_description is not UNSET: + field_dict["public_description"] = public_description if color is not UNSET: field_dict["color"] = color if position is not UNSET: @@ -209,34 +216,43 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name = d.pop("name", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) - def _parse_color(data: object) -> None | str | Unset: + def _parse_public_description(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + public_description = _parse_public_description(d.pop("public_description", UNSET)) + + def _parse_color(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) color = _parse_color(d.pop("color", UNSET)) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> Union[None, Unset, int]: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(Union[None, Unset, int], data) position = _parse_position(d.pop("position", UNSET)) - def _parse_notify_emails(data: object) -> list[str] | None | Unset: + def _parse_notify_emails(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -247,115 +263,114 @@ def _parse_notify_emails(data: object) -> list[str] | None | Unset: notify_emails_type_0 = cast(list[str], data) return notify_emails_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) notify_emails = _parse_notify_emails(d.pop("notify_emails", UNSET)) - def _parse_pagerduty_id(data: object) -> None | str | Unset: + def _parse_pagerduty_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) pagerduty_id = _parse_pagerduty_id(d.pop("pagerduty_id", UNSET)) - def _parse_pagerduty_service_id(data: object) -> None | str | Unset: + def _parse_pagerduty_service_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) pagerduty_service_id = _parse_pagerduty_service_id(d.pop("pagerduty_service_id", UNSET)) - def _parse_opsgenie_id(data: object) -> None | str | Unset: + def _parse_opsgenie_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) opsgenie_id = _parse_opsgenie_id(d.pop("opsgenie_id", UNSET)) - def _parse_victor_ops_id(data: object) -> None | str | Unset: + def _parse_victor_ops_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) victor_ops_id = _parse_victor_ops_id(d.pop("victor_ops_id", UNSET)) - def _parse_pagertree_id(data: object) -> None | str | Unset: + def _parse_pagertree_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) pagertree_id = _parse_pagertree_id(d.pop("pagertree_id", UNSET)) - def _parse_backstage_id(data: object) -> None | str | Unset: + def _parse_backstage_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) backstage_id = _parse_backstage_id(d.pop("backstage_id", UNSET)) - def _parse_cortex_id(data: object) -> None | str | Unset: + def _parse_cortex_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) cortex_id = _parse_cortex_id(d.pop("cortex_id", UNSET)) - def _parse_opslevel_id(data: object) -> None | str | Unset: + def _parse_opslevel_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) opslevel_id = _parse_opslevel_id(d.pop("opslevel_id", UNSET)) - def _parse_service_now_ci_sys_id(data: object) -> None | str | Unset: + def _parse_service_now_ci_sys_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) service_now_ci_sys_id = _parse_service_now_ci_sys_id(d.pop("service_now_ci_sys_id", UNSET)) - def _parse_alerts_email_enabled(data: object) -> bool | None | Unset: + def _parse_alerts_email_enabled(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) alerts_email_enabled = _parse_alerts_email_enabled(d.pop("alerts_email_enabled", UNSET)) + fields = [] _fields = d.pop("fields", UNSET) - fields: list[BulkUpsertTeamsEntitiesItemFieldsItem] | Unset = UNSET - if _fields is not UNSET: - fields = [] - for fields_item_data in _fields: - fields_item = BulkUpsertTeamsEntitiesItemFieldsItem.from_dict(fields_item_data) + for fields_item_data in _fields or []: + fields_item = BulkUpsertTeamsEntitiesItemFieldsItem.from_dict(fields_item_data) - fields.append(fields_item) + fields.append(fields_item) bulk_upsert_teams_entities_item = cls( external_id=external_id, name=name, description=description, + public_description=public_description, color=color, position=position, notify_emails=notify_emails, diff --git a/rootly_sdk/models/bulk_upsert_teams_entities_item_fields_item.py b/rootly_sdk/models/bulk_upsert_teams_entities_item_fields_item.py index 72057a8f..eb48ec31 100644 --- a/rootly_sdk/models/bulk_upsert_teams_entities_item_fields_item.py +++ b/rootly_sdk/models/bulk_upsert_teams_entities_item_fields_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,14 +15,14 @@ class BulkUpsertTeamsEntitiesItemFieldsItem: Attributes: value (str): The value for this field - catalog_field_id (str | Unset): UUID, slug, or external_id of the catalog field (required if catalog_property_id - is absent) - catalog_property_id (str | Unset): Alias for catalog_field_id (required if catalog_field_id is absent) + catalog_field_id (Union[Unset, str]): UUID, slug, or external_id of the catalog field (required if + catalog_property_id is absent) + catalog_property_id (Union[Unset, str]): Alias for catalog_field_id (required if catalog_field_id is absent) """ value: str - catalog_field_id: str | Unset = UNSET - catalog_property_id: str | Unset = UNSET + catalog_field_id: Union[Unset, str] = UNSET + catalog_property_id: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/bulk_upsert_teams_error.py b/rootly_sdk/models/bulk_upsert_teams_error.py index 1c23d188..220ce856 100644 --- a/rootly_sdk/models/bulk_upsert_teams_error.py +++ b/rootly_sdk/models/bulk_upsert_teams_error.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -17,14 +15,13 @@ class BulkUpsertTeamsError: """ Attributes: - errors (list[BulkUpsertTeamsErrorErrorsItem]): + errors (list['BulkUpsertTeamsErrorErrorsItem']): """ - errors: list[BulkUpsertTeamsErrorErrorsItem] + errors: list["BulkUpsertTeamsErrorErrorsItem"] additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - errors = [] for errors_item_data in self.errors: errors_item = errors_item_data.to_dict() diff --git a/rootly_sdk/models/bulk_upsert_teams_error_errors_item.py b/rootly_sdk/models/bulk_upsert_teams_error_errors_item.py index bb7cffdc..76cc68ba 100644 --- a/rootly_sdk/models/bulk_upsert_teams_error_errors_item.py +++ b/rootly_sdk/models/bulk_upsert_teams_error_errors_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast diff --git a/rootly_sdk/models/bulk_upsert_teams_response.py b/rootly_sdk/models/bulk_upsert_teams_response.py index 6080b412..bab6ab21 100644 --- a/rootly_sdk/models/bulk_upsert_teams_response.py +++ b/rootly_sdk/models/bulk_upsert_teams_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,15 +17,14 @@ class BulkUpsertTeamsResponse: """ Attributes: - data (list[BulkUpsertTeamsResponseDataItem] | Unset): + data (Union[Unset, list['BulkUpsertTeamsResponseDataItem']]): """ - data: list[BulkUpsertTeamsResponseDataItem] | Unset = UNSET + data: Union[Unset, list["BulkUpsertTeamsResponseDataItem"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - - data: list[dict[str, Any]] | Unset = UNSET + data: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.data, Unset): data = [] for data_item_data in self.data: @@ -47,14 +44,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: from ..models.bulk_upsert_teams_response_data_item import BulkUpsertTeamsResponseDataItem d = dict(src_dict) + data = [] _data = d.pop("data", UNSET) - data: list[BulkUpsertTeamsResponseDataItem] | Unset = UNSET - if _data is not UNSET: - data = [] - for data_item_data in _data: - data_item = BulkUpsertTeamsResponseDataItem.from_dict(data_item_data) + for data_item_data in _data or []: + data_item = BulkUpsertTeamsResponseDataItem.from_dict(data_item_data) - data.append(data_item) + data.append(data_item) bulk_upsert_teams_response = cls( data=data, diff --git a/rootly_sdk/models/bulk_upsert_teams_response_data_item.py b/rootly_sdk/models/bulk_upsert_teams_response_data_item.py index 16ccb481..9b30ac3f 100644 --- a/rootly_sdk/models/bulk_upsert_teams_response_data_item.py +++ b/rootly_sdk/models/bulk_upsert_teams_response_data_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,25 +21,24 @@ class BulkUpsertTeamsResponseDataItem: """ Attributes: - id (str | Unset): - type_ (BulkUpsertTeamsResponseDataItemType | Unset): - attributes (Team | Unset): + id (Union[Unset, str]): + type_ (Union[Unset, BulkUpsertTeamsResponseDataItemType]): + attributes (Union[Unset, Team]): """ - id: str | Unset = UNSET - type_: BulkUpsertTeamsResponseDataItemType | Unset = UNSET - attributes: Team | Unset = UNSET + id: Union[Unset, str] = UNSET + type_: Union[Unset, BulkUpsertTeamsResponseDataItemType] = UNSET + attributes: Union[Unset, "Team"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id - type_: str | Unset = UNSET + type_: Union[Unset, str] = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ - attributes: dict[str, Any] | Unset = UNSET + attributes: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.attributes, Unset): attributes = self.attributes.to_dict() @@ -65,14 +62,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: id = d.pop("id", UNSET) _type_ = d.pop("type", UNSET) - type_: BulkUpsertTeamsResponseDataItemType | Unset + type_: Union[Unset, BulkUpsertTeamsResponseDataItemType] if isinstance(_type_, Unset): type_ = UNSET else: type_ = check_bulk_upsert_teams_response_data_item_type(_type_) _attributes = d.pop("attributes", UNSET) - attributes: Team | Unset + attributes: Union[Unset, Team] if isinstance(_attributes, Unset): attributes = UNSET else: diff --git a/rootly_sdk/models/call_people_task_params.py b/rootly_sdk/models/call_people_task_params.py index c5cebec4..86d89d56 100644 --- a/rootly_sdk/models/call_people_task_params.py +++ b/rootly_sdk/models/call_people_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,13 +20,13 @@ class CallPeopleTaskParams: phone_numbers (list[str]): name (str): The name content (str): The message to be read by text-to-voice - task_type (CallPeopleTaskParamsTaskType | Unset): + task_type (Union[Unset, CallPeopleTaskParamsTaskType]): """ phone_numbers: list[str] name: str content: str - task_type: CallPeopleTaskParamsTaskType | Unset = UNSET + task_type: Union[Unset, CallPeopleTaskParamsTaskType] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -38,7 +36,7 @@ def to_dict(self) -> dict[str, Any]: content = self.content - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -66,7 +64,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: content = d.pop("content") _task_type = d.pop("task_type", UNSET) - task_type: CallPeopleTaskParamsTaskType | Unset + task_type: Union[Unset, CallPeopleTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/cancel_incident.py b/rootly_sdk/models/cancel_incident.py index d8a65df4..452891a0 100644 --- a/rootly_sdk/models/cancel_incident.py +++ b/rootly_sdk/models/cancel_incident.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class CancelIncident: data (CancelIncidentData): """ - data: CancelIncidentData + data: "CancelIncidentData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/cancel_incident_data.py b/rootly_sdk/models/cancel_incident_data.py index 3e06852a..f93f0b30 100644 --- a/rootly_sdk/models/cancel_incident_data.py +++ b/rootly_sdk/models/cancel_incident_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class CancelIncidentData: """ type_: CancelIncidentDataType - attributes: CancelIncidentDataAttributes + attributes: "CancelIncidentDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/cancel_incident_data_attributes.py b/rootly_sdk/models/cancel_incident_data_attributes.py index c3362192..90b9253c 100644 --- a/rootly_sdk/models/cancel_incident_data_attributes.py +++ b/rootly_sdk/models/cancel_incident_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -14,13 +12,13 @@ class CancelIncidentDataAttributes: """ Attributes: - cancellation_message (None | str | Unset): Why was the incident cancelled? + cancellation_message (Union[None, Unset, str]): Why was the incident cancelled? """ - cancellation_message: None | str | Unset = UNSET + cancellation_message: Union[None, Unset, str] = UNSET def to_dict(self) -> dict[str, Any]: - cancellation_message: None | str | Unset + cancellation_message: Union[None, Unset, str] if isinstance(self.cancellation_message, Unset): cancellation_message = UNSET else: @@ -38,12 +36,12 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_cancellation_message(data: object) -> None | str | Unset: + def _parse_cancellation_message(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) cancellation_message = _parse_cancellation_message(d.pop("cancellation_message", UNSET)) diff --git a/rootly_sdk/models/catalog.py b/rootly_sdk/models/catalog.py index 97470165..60f6a364 100644 --- a/rootly_sdk/models/catalog.py +++ b/rootly_sdk/models/catalog.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,22 +17,24 @@ class Catalog: Attributes: name (str): icon (CatalogIcon): - position (int | None): Default position of the catalog when displayed in a list. + position (Union[None, int]): Default position of the catalog when displayed in a list. created_at (str): updated_at (str): - description (None | str | Unset): - external_id (None | str | Unset): An external identifier for this catalog. Must be unique within the team. - managed_by (CatalogManagedBy | Unset): Which source manages this resource (read-only). + slug (Union[Unset, str]): The slug of the catalog. Derived from `name`. + description (Union[None, Unset, str]): + external_id (Union[None, Unset, str]): An external identifier for this catalog. Must be unique within the team. + managed_by (Union[Unset, CatalogManagedBy]): Which source manages this resource (read-only). """ name: str icon: CatalogIcon - position: int | None + position: Union[None, int] created_at: str updated_at: str - description: None | str | Unset = UNSET - external_id: None | str | Unset = UNSET - managed_by: CatalogManagedBy | Unset = UNSET + slug: Union[Unset, str] = UNSET + description: Union[None, Unset, str] = UNSET + external_id: Union[None, Unset, str] = UNSET + managed_by: Union[Unset, CatalogManagedBy] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,26 +42,28 @@ def to_dict(self) -> dict[str, Any]: icon: str = self.icon - position: int | None + position: Union[None, int] position = self.position created_at = self.created_at updated_at = self.updated_at - description: None | str | Unset + slug = self.slug + + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: description = self.description - external_id: None | str | Unset + external_id: Union[None, Unset, str] if isinstance(self.external_id, Unset): external_id = UNSET else: external_id = self.external_id - managed_by: str | Unset = UNSET + managed_by: Union[Unset, str] = UNSET if not isinstance(self.managed_by, Unset): managed_by = self.managed_by @@ -76,6 +78,8 @@ def to_dict(self) -> dict[str, Any]: "updated_at": updated_at, } ) + if slug is not UNSET: + field_dict["slug"] = slug if description is not UNSET: field_dict["description"] = description if external_id is not UNSET: @@ -92,10 +96,10 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: icon = check_catalog_icon(d.pop("icon")) - def _parse_position(data: object) -> int | None: + def _parse_position(data: object) -> Union[None, int]: if data is None: return data - return cast(int | None, data) + return cast(Union[None, int], data) position = _parse_position(d.pop("position")) @@ -103,26 +107,28 @@ def _parse_position(data: object) -> int | None: updated_at = d.pop("updated_at") - def _parse_description(data: object) -> None | str | Unset: + slug = d.pop("slug", UNSET) + + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) - def _parse_external_id(data: object) -> None | str | Unset: + def _parse_external_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) external_id = _parse_external_id(d.pop("external_id", UNSET)) _managed_by = d.pop("managed_by", UNSET) - managed_by: CatalogManagedBy | Unset + managed_by: Union[Unset, CatalogManagedBy] if isinstance(_managed_by, Unset): managed_by = UNSET else: @@ -134,6 +140,7 @@ def _parse_external_id(data: object) -> None | str | Unset: position=position, created_at=created_at, updated_at=updated_at, + slug=slug, description=description, external_id=external_id, managed_by=managed_by, diff --git a/rootly_sdk/models/catalog_checklist_template.py b/rootly_sdk/models/catalog_checklist_template.py index 44046997..524f01ad 100644 --- a/rootly_sdk/models/catalog_checklist_template.py +++ b/rootly_sdk/models/catalog_checklist_template.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -34,10 +32,10 @@ class CatalogChecklistTemplate: scope_id (str): The scope ID created_at (str): Date of creation updated_at (str): Date of last update - slug (str | Unset): The slug of the checklist template - description (None | str | Unset): The description of the checklist template - fields (list[CatalogChecklistTemplateFieldsType0Item] | None | Unset): Template fields in position order - owners (list[CatalogChecklistTemplateOwnersType0Item] | None | Unset): Template owners + slug (Union[Unset, str]): The slug of the checklist template + description (Union[None, Unset, str]): The description of the checklist template + fields (Union[None, Unset, list['CatalogChecklistTemplateFieldsType0Item']]): Template fields in position order + owners (Union[None, Unset, list['CatalogChecklistTemplateOwnersType0Item']]): Template owners """ name: str @@ -46,14 +44,13 @@ class CatalogChecklistTemplate: scope_id: str created_at: str updated_at: str - slug: str | Unset = UNSET - description: None | str | Unset = UNSET - fields: list[CatalogChecklistTemplateFieldsType0Item] | None | Unset = UNSET - owners: list[CatalogChecklistTemplateOwnersType0Item] | None | Unset = UNSET + slug: Union[Unset, str] = UNSET + description: Union[None, Unset, str] = UNSET + fields: Union[None, Unset, list["CatalogChecklistTemplateFieldsType0Item"]] = UNSET + owners: Union[None, Unset, list["CatalogChecklistTemplateOwnersType0Item"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - name = self.name catalog_type: str = self.catalog_type @@ -68,13 +65,13 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - description: None | str | Unset + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: description = self.description - fields: list[dict[str, Any]] | None | Unset + fields: Union[None, Unset, list[dict[str, Any]]] if isinstance(self.fields, Unset): fields = UNSET elif isinstance(self.fields, list): @@ -86,7 +83,7 @@ def to_dict(self) -> dict[str, Any]: else: fields = self.fields - owners: list[dict[str, Any]] | None | Unset + owners: Union[None, Unset, list[dict[str, Any]]] if isinstance(self.owners, Unset): owners = UNSET elif isinstance(self.owners, list): @@ -141,16 +138,16 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: slug = d.pop("slug", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) - def _parse_fields(data: object) -> list[CatalogChecklistTemplateFieldsType0Item] | None | Unset: + def _parse_fields(data: object) -> Union[None, Unset, list["CatalogChecklistTemplateFieldsType0Item"]]: if data is None: return data if isinstance(data, Unset): @@ -166,13 +163,13 @@ def _parse_fields(data: object) -> list[CatalogChecklistTemplateFieldsType0Item] fields_type_0.append(fields_type_0_item) return fields_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[CatalogChecklistTemplateFieldsType0Item] | None | Unset, data) + return cast(Union[None, Unset, list["CatalogChecklistTemplateFieldsType0Item"]], data) fields = _parse_fields(d.pop("fields", UNSET)) - def _parse_owners(data: object) -> list[CatalogChecklistTemplateOwnersType0Item] | None | Unset: + def _parse_owners(data: object) -> Union[None, Unset, list["CatalogChecklistTemplateOwnersType0Item"]]: if data is None: return data if isinstance(data, Unset): @@ -188,9 +185,9 @@ def _parse_owners(data: object) -> list[CatalogChecklistTemplateOwnersType0Item] owners_type_0.append(owners_type_0_item) return owners_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[CatalogChecklistTemplateOwnersType0Item] | None | Unset, data) + return cast(Union[None, Unset, list["CatalogChecklistTemplateOwnersType0Item"]], data) owners = _parse_owners(d.pop("owners", UNSET)) diff --git a/rootly_sdk/models/catalog_checklist_template_fields_type_0_item.py b/rootly_sdk/models/catalog_checklist_template_fields_type_0_item.py index c2eaf173..b39a45e9 100644 --- a/rootly_sdk/models/catalog_checklist_template_fields_type_0_item.py +++ b/rootly_sdk/models/catalog_checklist_template_fields_type_0_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,24 +17,24 @@ class CatalogChecklistTemplateFieldsType0Item: """ Attributes: - field_source (CatalogChecklistTemplateFieldsType0ItemFieldSource | Unset): Source of the field - field_key (str | Unset): Key identifying the field - catalog_property_id (None | str | Unset): ID of the catalog property for custom fields + field_source (Union[Unset, CatalogChecklistTemplateFieldsType0ItemFieldSource]): Source of the field + field_key (Union[Unset, str]): Key identifying the field + catalog_property_id (Union[None, Unset, str]): ID of the catalog property for custom fields """ - field_source: CatalogChecklistTemplateFieldsType0ItemFieldSource | Unset = UNSET - field_key: str | Unset = UNSET - catalog_property_id: None | str | Unset = UNSET + field_source: Union[Unset, CatalogChecklistTemplateFieldsType0ItemFieldSource] = UNSET + field_key: Union[Unset, str] = UNSET + catalog_property_id: Union[None, Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - field_source: str | Unset = UNSET + field_source: Union[Unset, str] = UNSET if not isinstance(self.field_source, Unset): field_source = self.field_source field_key = self.field_key - catalog_property_id: None | str | Unset + catalog_property_id: Union[None, Unset, str] if isinstance(self.catalog_property_id, Unset): catalog_property_id = UNSET else: @@ -58,7 +56,7 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _field_source = d.pop("field_source", UNSET) - field_source: CatalogChecklistTemplateFieldsType0ItemFieldSource | Unset + field_source: Union[Unset, CatalogChecklistTemplateFieldsType0ItemFieldSource] if isinstance(_field_source, Unset): field_source = UNSET else: @@ -66,12 +64,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: field_key = d.pop("field_key", UNSET) - def _parse_catalog_property_id(data: object) -> None | str | Unset: + def _parse_catalog_property_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) catalog_property_id = _parse_catalog_property_id(d.pop("catalog_property_id", UNSET)) diff --git a/rootly_sdk/models/catalog_checklist_template_list.py b/rootly_sdk/models/catalog_checklist_template_list.py index c0f7ee80..ad2edc12 100644 --- a/rootly_sdk/models/catalog_checklist_template_list.py +++ b/rootly_sdk/models/catalog_checklist_template_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,34 +20,33 @@ class CatalogChecklistTemplateList: """ Attributes: - data (list[CatalogChecklistTemplateListDataItem]): - links (Links | Unset): - meta (Meta | Unset): - included (list[JsonapiIncludedResource] | Unset): + data (list['CatalogChecklistTemplateListDataItem']): + links (Union[Unset, Links]): + meta (Union[Unset, Meta]): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[CatalogChecklistTemplateListDataItem] - links: Links | Unset = UNSET - meta: Meta | Unset = UNSET - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["CatalogChecklistTemplateListDataItem"] + links: Union[Unset, "Links"] = UNSET + meta: Union[Unset, "Meta"] = UNSET + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() data.append(data_item) - links: dict[str, Any] | Unset = UNSET + links: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.links, Unset): links = self.links.to_dict() - meta: dict[str, Any] | Unset = UNSET + meta: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.meta, Unset): meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -88,27 +85,25 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data.append(data_item) _links = d.pop("links", UNSET) - links: Links | Unset + links: Union[Unset, Links] if isinstance(_links, Unset): links = UNSET else: links = Links.from_dict(_links) _meta = d.pop("meta", UNSET) - meta: Meta | Unset + meta: Union[Unset, Meta] if isinstance(_meta, Unset): meta = UNSET else: meta = Meta.from_dict(_meta) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) catalog_checklist_template_list = cls( data=data, diff --git a/rootly_sdk/models/catalog_checklist_template_list_data_item.py b/rootly_sdk/models/catalog_checklist_template_list_data_item.py index be31006e..d69abd27 100644 --- a/rootly_sdk/models/catalog_checklist_template_list_data_item.py +++ b/rootly_sdk/models/catalog_checklist_template_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class CatalogChecklistTemplateListDataItem: id: str type_: CatalogChecklistTemplateListDataItemType - attributes: CatalogChecklistTemplate + attributes: "CatalogChecklistTemplate" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/catalog_checklist_template_owners_type_0_item.py b/rootly_sdk/models/catalog_checklist_template_owners_type_0_item.py index 23e30f42..aed5bb12 100644 --- a/rootly_sdk/models/catalog_checklist_template_owners_type_0_item.py +++ b/rootly_sdk/models/catalog_checklist_template_owners_type_0_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,18 +17,18 @@ class CatalogChecklistTemplateOwnersType0Item: """ Attributes: - id (str | Unset): User ID for user owners, or field key for field owners - type_ (CatalogChecklistTemplateOwnersType0ItemType | Unset): Type of owner + id (Union[Unset, str]): User ID for user owners, or field key for field owners + type_ (Union[Unset, CatalogChecklistTemplateOwnersType0ItemType]): Type of owner """ - id: str | Unset = UNSET - type_: CatalogChecklistTemplateOwnersType0ItemType | Unset = UNSET + id: Union[Unset, str] = UNSET + type_: Union[Unset, CatalogChecklistTemplateOwnersType0ItemType] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: id = self.id - type_: str | Unset = UNSET + type_: Union[Unset, str] = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ @@ -50,7 +48,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: id = d.pop("id", UNSET) _type_ = d.pop("type", UNSET) - type_: CatalogChecklistTemplateOwnersType0ItemType | Unset + type_: Union[Unset, CatalogChecklistTemplateOwnersType0ItemType] if isinstance(_type_, Unset): type_ = UNSET else: diff --git a/rootly_sdk/models/catalog_checklist_template_response.py b/rootly_sdk/models/catalog_checklist_template_response.py index c86b6fd4..3cf42b9f 100644 --- a/rootly_sdk/models/catalog_checklist_template_response.py +++ b/rootly_sdk/models/catalog_checklist_template_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,18 +19,17 @@ class CatalogChecklistTemplateResponse: """ Attributes: data (CatalogChecklistTemplateResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: CatalogChecklistTemplateResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "CatalogChecklistTemplateResponseData" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = CatalogChecklistTemplateResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) catalog_checklist_template_response = cls( data=data, diff --git a/rootly_sdk/models/catalog_checklist_template_response_data.py b/rootly_sdk/models/catalog_checklist_template_response_data.py index 777c5a27..8227aea1 100644 --- a/rootly_sdk/models/catalog_checklist_template_response_data.py +++ b/rootly_sdk/models/catalog_checklist_template_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class CatalogChecklistTemplateResponseData: id: str type_: CatalogChecklistTemplateResponseDataType - attributes: CatalogChecklistTemplate + attributes: "CatalogChecklistTemplate" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/catalog_entity.py b/rootly_sdk/models/catalog_entity.py index abd0a3b3..6a42a642 100644 --- a/rootly_sdk/models/catalog_entity.py +++ b/rootly_sdk/models/catalog_entity.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,62 +19,73 @@ class CatalogEntity: """ Attributes: name (str): - position (int | None): Default position of the item when displayed in a list. + position (Union[None, int]): Default position of the item when displayed in a list. created_at (str): updated_at (str): - description (None | str | Unset): - backstage_id (None | str | Unset): The Backstage entity ID this catalog entity is linked to. - external_id (None | str | Unset): An external identifier for this catalog entity. Must be unique within the + slug (Union[Unset, str]): The slug of the catalog entity. Derived from `name`. + description (Union[None, Unset, str]): + public_description (Union[None, Unset, str]): The status page description of the catalog entity + backstage_id (Union[None, Unset, str]): The Backstage entity ID this catalog entity is linked to. + external_id (Union[None, Unset, str]): An external identifier for this catalog entity. Must be unique within the catalog. - managed_by (CatalogEntityManagedBy | Unset): Which source manages this resource (read-only). - properties (list[CatalogEntityPropertiesItem] | Unset): Array of property values for this catalog entity + managed_by (Union[Unset, CatalogEntityManagedBy]): Which source manages this resource (read-only). + properties (Union[Unset, list['CatalogEntityPropertiesItem']]): Array of property values for this catalog entity """ name: str - position: int | None + position: Union[None, int] created_at: str updated_at: str - description: None | str | Unset = UNSET - backstage_id: None | str | Unset = UNSET - external_id: None | str | Unset = UNSET - managed_by: CatalogEntityManagedBy | Unset = UNSET - properties: list[CatalogEntityPropertiesItem] | Unset = UNSET + slug: Union[Unset, str] = UNSET + description: Union[None, Unset, str] = UNSET + public_description: Union[None, Unset, str] = UNSET + backstage_id: Union[None, Unset, str] = UNSET + external_id: Union[None, Unset, str] = UNSET + managed_by: Union[Unset, CatalogEntityManagedBy] = UNSET + properties: Union[Unset, list["CatalogEntityPropertiesItem"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - name = self.name - position: int | None + position: Union[None, int] position = self.position created_at = self.created_at updated_at = self.updated_at - description: None | str | Unset + slug = self.slug + + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: description = self.description - backstage_id: None | str | Unset + public_description: Union[None, Unset, str] + if isinstance(self.public_description, Unset): + public_description = UNSET + else: + public_description = self.public_description + + backstage_id: Union[None, Unset, str] if isinstance(self.backstage_id, Unset): backstage_id = UNSET else: backstage_id = self.backstage_id - external_id: None | str | Unset + external_id: Union[None, Unset, str] if isinstance(self.external_id, Unset): external_id = UNSET else: external_id = self.external_id - managed_by: str | Unset = UNSET + managed_by: Union[Unset, str] = UNSET if not isinstance(self.managed_by, Unset): managed_by = self.managed_by - properties: list[dict[str, Any]] | Unset = UNSET + properties: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.properties, Unset): properties = [] for properties_item_data in self.properties: @@ -93,8 +102,12 @@ def to_dict(self) -> dict[str, Any]: "updated_at": updated_at, } ) + if slug is not UNSET: + field_dict["slug"] = slug if description is not UNSET: field_dict["description"] = description + if public_description is not UNSET: + field_dict["public_description"] = public_description if backstage_id is not UNSET: field_dict["backstage_id"] = backstage_id if external_id is not UNSET: @@ -113,10 +126,10 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name") - def _parse_position(data: object) -> int | None: + def _parse_position(data: object) -> Union[None, int]: if data is None: return data - return cast(int | None, data) + return cast(Union[None, int], data) position = _parse_position(d.pop("position")) @@ -124,55 +137,66 @@ def _parse_position(data: object) -> int | None: updated_at = d.pop("updated_at") - def _parse_description(data: object) -> None | str | Unset: + slug = d.pop("slug", UNSET) + + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) - def _parse_backstage_id(data: object) -> None | str | Unset: + def _parse_public_description(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + public_description = _parse_public_description(d.pop("public_description", UNSET)) + + def _parse_backstage_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) backstage_id = _parse_backstage_id(d.pop("backstage_id", UNSET)) - def _parse_external_id(data: object) -> None | str | Unset: + def _parse_external_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) external_id = _parse_external_id(d.pop("external_id", UNSET)) _managed_by = d.pop("managed_by", UNSET) - managed_by: CatalogEntityManagedBy | Unset + managed_by: Union[Unset, CatalogEntityManagedBy] if isinstance(_managed_by, Unset): managed_by = UNSET else: managed_by = check_catalog_entity_managed_by(_managed_by) + properties = [] _properties = d.pop("properties", UNSET) - properties: list[CatalogEntityPropertiesItem] | Unset = UNSET - if _properties is not UNSET: - properties = [] - for properties_item_data in _properties: - properties_item = CatalogEntityPropertiesItem.from_dict(properties_item_data) + for properties_item_data in _properties or []: + properties_item = CatalogEntityPropertiesItem.from_dict(properties_item_data) - properties.append(properties_item) + properties.append(properties_item) catalog_entity = cls( name=name, position=position, created_at=created_at, updated_at=updated_at, + slug=slug, description=description, + public_description=public_description, backstage_id=backstage_id, external_id=external_id, managed_by=managed_by, diff --git a/rootly_sdk/models/catalog_entity_checklist.py b/rootly_sdk/models/catalog_entity_checklist.py index 24f345bc..ac0893ca 100644 --- a/rootly_sdk/models/catalog_entity_checklist.py +++ b/rootly_sdk/models/catalog_entity_checklist.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -35,11 +33,11 @@ class CatalogEntityChecklist: status (CatalogEntityChecklistStatus): The status of the checklist created_at (str): Date of creation updated_at (str): Date of last update - started_at (None | str | Unset): When the checklist was started - completed_at (None | str | Unset): When the checklist was completed - completed_by_user_id (None | str | Unset): The ID of the user who completed the checklist - checklist_fields (list[CatalogEntityChecklistChecklistFieldsType0Item] | None | Unset): Checklist fields - checklist_owners (list[CatalogEntityChecklistChecklistOwnersType0Item] | None | Unset): Checklist owners + started_at (Union[None, Unset, str]): When the checklist was started + completed_at (Union[None, Unset, str]): When the checklist was completed + completed_by_user_id (Union[None, Unset, str]): The ID of the user who completed the checklist + checklist_fields (Union[None, Unset, list['CatalogEntityChecklistChecklistFieldsType0Item']]): Checklist fields + checklist_owners (Union[None, Unset, list['CatalogEntityChecklistChecklistOwnersType0Item']]): Checklist owners """ catalog_checklist_template_id: str @@ -48,15 +46,14 @@ class CatalogEntityChecklist: status: CatalogEntityChecklistStatus created_at: str updated_at: str - started_at: None | str | Unset = UNSET - completed_at: None | str | Unset = UNSET - completed_by_user_id: None | str | Unset = UNSET - checklist_fields: list[CatalogEntityChecklistChecklistFieldsType0Item] | None | Unset = UNSET - checklist_owners: list[CatalogEntityChecklistChecklistOwnersType0Item] | None | Unset = UNSET + started_at: Union[None, Unset, str] = UNSET + completed_at: Union[None, Unset, str] = UNSET + completed_by_user_id: Union[None, Unset, str] = UNSET + checklist_fields: Union[None, Unset, list["CatalogEntityChecklistChecklistFieldsType0Item"]] = UNSET + checklist_owners: Union[None, Unset, list["CatalogEntityChecklistChecklistOwnersType0Item"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - catalog_checklist_template_id = self.catalog_checklist_template_id auditable_type: str = self.auditable_type @@ -69,25 +66,25 @@ def to_dict(self) -> dict[str, Any]: updated_at = self.updated_at - started_at: None | str | Unset + started_at: Union[None, Unset, str] if isinstance(self.started_at, Unset): started_at = UNSET else: started_at = self.started_at - completed_at: None | str | Unset + completed_at: Union[None, Unset, str] if isinstance(self.completed_at, Unset): completed_at = UNSET else: completed_at = self.completed_at - completed_by_user_id: None | str | Unset + completed_by_user_id: Union[None, Unset, str] if isinstance(self.completed_by_user_id, Unset): completed_by_user_id = UNSET else: completed_by_user_id = self.completed_by_user_id - checklist_fields: list[dict[str, Any]] | None | Unset + checklist_fields: Union[None, Unset, list[dict[str, Any]]] if isinstance(self.checklist_fields, Unset): checklist_fields = UNSET elif isinstance(self.checklist_fields, list): @@ -99,7 +96,7 @@ def to_dict(self) -> dict[str, Any]: else: checklist_fields = self.checklist_fields - checklist_owners: list[dict[str, Any]] | None | Unset + checklist_owners: Union[None, Unset, list[dict[str, Any]]] if isinstance(self.checklist_owners, Unset): checklist_owners = UNSET elif isinstance(self.checklist_owners, list): @@ -158,36 +155,36 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: updated_at = d.pop("updated_at") - def _parse_started_at(data: object) -> None | str | Unset: + def _parse_started_at(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) started_at = _parse_started_at(d.pop("started_at", UNSET)) - def _parse_completed_at(data: object) -> None | str | Unset: + def _parse_completed_at(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) completed_at = _parse_completed_at(d.pop("completed_at", UNSET)) - def _parse_completed_by_user_id(data: object) -> None | str | Unset: + def _parse_completed_by_user_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) completed_by_user_id = _parse_completed_by_user_id(d.pop("completed_by_user_id", UNSET)) def _parse_checklist_fields( data: object, - ) -> list[CatalogEntityChecklistChecklistFieldsType0Item] | None | Unset: + ) -> Union[None, Unset, list["CatalogEntityChecklistChecklistFieldsType0Item"]]: if data is None: return data if isinstance(data, Unset): @@ -205,15 +202,15 @@ def _parse_checklist_fields( checklist_fields_type_0.append(checklist_fields_type_0_item) return checklist_fields_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[CatalogEntityChecklistChecklistFieldsType0Item] | None | Unset, data) + return cast(Union[None, Unset, list["CatalogEntityChecklistChecklistFieldsType0Item"]], data) checklist_fields = _parse_checklist_fields(d.pop("checklist_fields", UNSET)) def _parse_checklist_owners( data: object, - ) -> list[CatalogEntityChecklistChecklistOwnersType0Item] | None | Unset: + ) -> Union[None, Unset, list["CatalogEntityChecklistChecklistOwnersType0Item"]]: if data is None: return data if isinstance(data, Unset): @@ -231,9 +228,9 @@ def _parse_checklist_owners( checklist_owners_type_0.append(checklist_owners_type_0_item) return checklist_owners_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[CatalogEntityChecklistChecklistOwnersType0Item] | None | Unset, data) + return cast(Union[None, Unset, list["CatalogEntityChecklistChecklistOwnersType0Item"]], data) checklist_owners = _parse_checklist_owners(d.pop("checklist_owners", UNSET)) diff --git a/rootly_sdk/models/catalog_entity_checklist_checklist_fields_type_0_item.py b/rootly_sdk/models/catalog_entity_checklist_checklist_fields_type_0_item.py index 6543fd4e..95b68fd3 100644 --- a/rootly_sdk/models/catalog_entity_checklist_checklist_fields_type_0_item.py +++ b/rootly_sdk/models/catalog_entity_checklist_checklist_fields_type_0_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,15 +19,14 @@ class CatalogEntityChecklistChecklistFieldsType0Item: """ Attributes: - data (CatalogEntityChecklistChecklistFieldsType0ItemData | Unset): + data (Union[Unset, CatalogEntityChecklistChecklistFieldsType0ItemData]): """ - data: CatalogEntityChecklistChecklistFieldsType0ItemData | Unset = UNSET + data: Union[Unset, "CatalogEntityChecklistChecklistFieldsType0ItemData"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - - data: dict[str, Any] | Unset = UNSET + data: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.data, Unset): data = self.data.to_dict() @@ -49,7 +46,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _data = d.pop("data", UNSET) - data: CatalogEntityChecklistChecklistFieldsType0ItemData | Unset + data: Union[Unset, CatalogEntityChecklistChecklistFieldsType0ItemData] if isinstance(_data, Unset): data = UNSET else: diff --git a/rootly_sdk/models/catalog_entity_checklist_checklist_fields_type_0_item_data.py b/rootly_sdk/models/catalog_entity_checklist_checklist_fields_type_0_item_data.py index 577b41b2..0aabf9ca 100644 --- a/rootly_sdk/models/catalog_entity_checklist_checklist_fields_type_0_item_data.py +++ b/rootly_sdk/models/catalog_entity_checklist_checklist_fields_type_0_item_data.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -25,25 +23,24 @@ class CatalogEntityChecklistChecklistFieldsType0ItemData: """ Attributes: - id (str | Unset): ID of the checklist field - type_ (CatalogEntityChecklistChecklistFieldsType0ItemDataType | Unset): - attributes (CatalogEntityChecklistChecklistFieldsType0ItemDataAttributes | Unset): + id (Union[Unset, str]): ID of the checklist field + type_ (Union[Unset, CatalogEntityChecklistChecklistFieldsType0ItemDataType]): + attributes (Union[Unset, CatalogEntityChecklistChecklistFieldsType0ItemDataAttributes]): """ - id: str | Unset = UNSET - type_: CatalogEntityChecklistChecklistFieldsType0ItemDataType | Unset = UNSET - attributes: CatalogEntityChecklistChecklistFieldsType0ItemDataAttributes | Unset = UNSET + id: Union[Unset, str] = UNSET + type_: Union[Unset, CatalogEntityChecklistChecklistFieldsType0ItemDataType] = UNSET + attributes: Union[Unset, "CatalogEntityChecklistChecklistFieldsType0ItemDataAttributes"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id - type_: str | Unset = UNSET + type_: Union[Unset, str] = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ - attributes: dict[str, Any] | Unset = UNSET + attributes: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.attributes, Unset): attributes = self.attributes.to_dict() @@ -69,14 +66,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: id = d.pop("id", UNSET) _type_ = d.pop("type", UNSET) - type_: CatalogEntityChecklistChecklistFieldsType0ItemDataType | Unset + type_: Union[Unset, CatalogEntityChecklistChecklistFieldsType0ItemDataType] if isinstance(_type_, Unset): type_ = UNSET else: type_ = check_catalog_entity_checklist_checklist_fields_type_0_item_data_type(_type_) _attributes = d.pop("attributes", UNSET) - attributes: CatalogEntityChecklistChecklistFieldsType0ItemDataAttributes | Unset + attributes: Union[Unset, CatalogEntityChecklistChecklistFieldsType0ItemDataAttributes] if isinstance(_attributes, Unset): attributes = UNSET else: diff --git a/rootly_sdk/models/catalog_entity_checklist_checklist_fields_type_0_item_data_attributes.py b/rootly_sdk/models/catalog_entity_checklist_checklist_fields_type_0_item_data_attributes.py index 21f60c2e..d9a99bb0 100644 --- a/rootly_sdk/models/catalog_entity_checklist_checklist_fields_type_0_item_data_attributes.py +++ b/rootly_sdk/models/catalog_entity_checklist_checklist_fields_type_0_item_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,29 +19,29 @@ class CatalogEntityChecklistChecklistFieldsType0ItemDataAttributes: """ Attributes: - catalog_entity_checklist_id (str | Unset): The ID of the parent checklist - catalog_checklist_template_field_id (None | str | Unset): The ID of the template field - field_key (str | Unset): The field key - checked (bool | Unset): Whether the field is checked - value_snapshot (CatalogEntityChecklistChecklistFieldsType0ItemDataAttributesValueSnapshotType0 | None | Unset): - The value snapshot at time of checking - completed_by_user_id (None | str | Unset): The ID of the user who checked the field - completed_at (None | str | Unset): When the field was checked - created_at (str | Unset): Date of creation - updated_at (str | Unset): Date of last update + catalog_entity_checklist_id (Union[Unset, str]): The ID of the parent checklist + catalog_checklist_template_field_id (Union[None, Unset, str]): The ID of the template field + field_key (Union[Unset, str]): The field key + checked (Union[Unset, bool]): Whether the field is checked + value_snapshot (Union['CatalogEntityChecklistChecklistFieldsType0ItemDataAttributesValueSnapshotType0', None, + Unset]): The value snapshot at time of checking + completed_by_user_id (Union[None, Unset, str]): The ID of the user who checked the field + completed_at (Union[None, Unset, str]): When the field was checked + created_at (Union[Unset, str]): Date of creation + updated_at (Union[Unset, str]): Date of last update """ - catalog_entity_checklist_id: str | Unset = UNSET - catalog_checklist_template_field_id: None | str | Unset = UNSET - field_key: str | Unset = UNSET - checked: bool | Unset = UNSET - value_snapshot: CatalogEntityChecklistChecklistFieldsType0ItemDataAttributesValueSnapshotType0 | None | Unset = ( - UNSET - ) - completed_by_user_id: None | str | Unset = UNSET - completed_at: None | str | Unset = UNSET - created_at: str | Unset = UNSET - updated_at: str | Unset = UNSET + catalog_entity_checklist_id: Union[Unset, str] = UNSET + catalog_checklist_template_field_id: Union[None, Unset, str] = UNSET + field_key: Union[Unset, str] = UNSET + checked: Union[Unset, bool] = UNSET + value_snapshot: Union[ + "CatalogEntityChecklistChecklistFieldsType0ItemDataAttributesValueSnapshotType0", None, Unset + ] = UNSET + completed_by_user_id: Union[None, Unset, str] = UNSET + completed_at: Union[None, Unset, str] = UNSET + created_at: Union[Unset, str] = UNSET + updated_at: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -53,7 +51,7 @@ def to_dict(self) -> dict[str, Any]: catalog_entity_checklist_id = self.catalog_entity_checklist_id - catalog_checklist_template_field_id: None | str | Unset + catalog_checklist_template_field_id: Union[None, Unset, str] if isinstance(self.catalog_checklist_template_field_id, Unset): catalog_checklist_template_field_id = UNSET else: @@ -63,7 +61,7 @@ def to_dict(self) -> dict[str, Any]: checked = self.checked - value_snapshot: dict[str, Any] | None | Unset + value_snapshot: Union[None, Unset, dict[str, Any]] if isinstance(self.value_snapshot, Unset): value_snapshot = UNSET elif isinstance( @@ -73,13 +71,13 @@ def to_dict(self) -> dict[str, Any]: else: value_snapshot = self.value_snapshot - completed_by_user_id: None | str | Unset + completed_by_user_id: Union[None, Unset, str] if isinstance(self.completed_by_user_id, Unset): completed_by_user_id = UNSET else: completed_by_user_id = self.completed_by_user_id - completed_at: None | str | Unset + completed_at: Union[None, Unset, str] if isinstance(self.completed_at, Unset): completed_at = UNSET else: @@ -122,12 +120,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) catalog_entity_checklist_id = d.pop("catalog_entity_checklist_id", UNSET) - def _parse_catalog_checklist_template_field_id(data: object) -> None | str | Unset: + def _parse_catalog_checklist_template_field_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) catalog_checklist_template_field_id = _parse_catalog_checklist_template_field_id( d.pop("catalog_checklist_template_field_id", UNSET) @@ -139,7 +137,7 @@ def _parse_catalog_checklist_template_field_id(data: object) -> None | str | Uns def _parse_value_snapshot( data: object, - ) -> CatalogEntityChecklistChecklistFieldsType0ItemDataAttributesValueSnapshotType0 | None | Unset: + ) -> Union["CatalogEntityChecklistChecklistFieldsType0ItemDataAttributesValueSnapshotType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -152,29 +150,30 @@ def _parse_value_snapshot( ) return value_snapshot_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass return cast( - CatalogEntityChecklistChecklistFieldsType0ItemDataAttributesValueSnapshotType0 | None | Unset, data + Union["CatalogEntityChecklistChecklistFieldsType0ItemDataAttributesValueSnapshotType0", None, Unset], + data, ) value_snapshot = _parse_value_snapshot(d.pop("value_snapshot", UNSET)) - def _parse_completed_by_user_id(data: object) -> None | str | Unset: + def _parse_completed_by_user_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) completed_by_user_id = _parse_completed_by_user_id(d.pop("completed_by_user_id", UNSET)) - def _parse_completed_at(data: object) -> None | str | Unset: + def _parse_completed_at(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) completed_at = _parse_completed_at(d.pop("completed_at", UNSET)) diff --git a/rootly_sdk/models/catalog_entity_checklist_checklist_fields_type_0_item_data_attributes_value_snapshot_type_0.py b/rootly_sdk/models/catalog_entity_checklist_checklist_fields_type_0_item_data_attributes_value_snapshot_type_0.py index c0b25867..b853f651 100644 --- a/rootly_sdk/models/catalog_entity_checklist_checklist_fields_type_0_item_data_attributes_value_snapshot_type_0.py +++ b/rootly_sdk/models/catalog_entity_checklist_checklist_fields_type_0_item_data_attributes_value_snapshot_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,7 +14,6 @@ class CatalogEntityChecklistChecklistFieldsType0ItemDataAttributesValueSnapshotT additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) diff --git a/rootly_sdk/models/catalog_entity_checklist_checklist_owners_type_0_item.py b/rootly_sdk/models/catalog_entity_checklist_checklist_owners_type_0_item.py index a0e411bc..92dbc718 100644 --- a/rootly_sdk/models/catalog_entity_checklist_checklist_owners_type_0_item.py +++ b/rootly_sdk/models/catalog_entity_checklist_checklist_owners_type_0_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,15 +19,14 @@ class CatalogEntityChecklistChecklistOwnersType0Item: """ Attributes: - data (CatalogEntityChecklistChecklistOwnersType0ItemData | Unset): + data (Union[Unset, CatalogEntityChecklistChecklistOwnersType0ItemData]): """ - data: CatalogEntityChecklistChecklistOwnersType0ItemData | Unset = UNSET + data: Union[Unset, "CatalogEntityChecklistChecklistOwnersType0ItemData"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - - data: dict[str, Any] | Unset = UNSET + data: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.data, Unset): data = self.data.to_dict() @@ -49,7 +46,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _data = d.pop("data", UNSET) - data: CatalogEntityChecklistChecklistOwnersType0ItemData | Unset + data: Union[Unset, CatalogEntityChecklistChecklistOwnersType0ItemData] if isinstance(_data, Unset): data = UNSET else: diff --git a/rootly_sdk/models/catalog_entity_checklist_checklist_owners_type_0_item_data.py b/rootly_sdk/models/catalog_entity_checklist_checklist_owners_type_0_item_data.py index b2e34423..8ae555a4 100644 --- a/rootly_sdk/models/catalog_entity_checklist_checklist_owners_type_0_item_data.py +++ b/rootly_sdk/models/catalog_entity_checklist_checklist_owners_type_0_item_data.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -25,25 +23,24 @@ class CatalogEntityChecklistChecklistOwnersType0ItemData: """ Attributes: - id (str | Unset): ID of the checklist owner - type_ (CatalogEntityChecklistChecklistOwnersType0ItemDataType | Unset): - attributes (CatalogEntityChecklistChecklistOwnersType0ItemDataAttributes | Unset): + id (Union[Unset, str]): ID of the checklist owner + type_ (Union[Unset, CatalogEntityChecklistChecklistOwnersType0ItemDataType]): + attributes (Union[Unset, CatalogEntityChecklistChecklistOwnersType0ItemDataAttributes]): """ - id: str | Unset = UNSET - type_: CatalogEntityChecklistChecklistOwnersType0ItemDataType | Unset = UNSET - attributes: CatalogEntityChecklistChecklistOwnersType0ItemDataAttributes | Unset = UNSET + id: Union[Unset, str] = UNSET + type_: Union[Unset, CatalogEntityChecklistChecklistOwnersType0ItemDataType] = UNSET + attributes: Union[Unset, "CatalogEntityChecklistChecklistOwnersType0ItemDataAttributes"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id - type_: str | Unset = UNSET + type_: Union[Unset, str] = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ - attributes: dict[str, Any] | Unset = UNSET + attributes: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.attributes, Unset): attributes = self.attributes.to_dict() @@ -69,14 +66,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: id = d.pop("id", UNSET) _type_ = d.pop("type", UNSET) - type_: CatalogEntityChecklistChecklistOwnersType0ItemDataType | Unset + type_: Union[Unset, CatalogEntityChecklistChecklistOwnersType0ItemDataType] if isinstance(_type_, Unset): type_ = UNSET else: type_ = check_catalog_entity_checklist_checklist_owners_type_0_item_data_type(_type_) _attributes = d.pop("attributes", UNSET) - attributes: CatalogEntityChecklistChecklistOwnersType0ItemDataAttributes | Unset + attributes: Union[Unset, CatalogEntityChecklistChecklistOwnersType0ItemDataAttributes] if isinstance(_attributes, Unset): attributes = UNSET else: diff --git a/rootly_sdk/models/catalog_entity_checklist_checklist_owners_type_0_item_data_attributes.py b/rootly_sdk/models/catalog_entity_checklist_checklist_owners_type_0_item_data_attributes.py index 923596d6..cd63986f 100644 --- a/rootly_sdk/models/catalog_entity_checklist_checklist_owners_type_0_item_data_attributes.py +++ b/rootly_sdk/models/catalog_entity_checklist_checklist_owners_type_0_item_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,16 +13,16 @@ class CatalogEntityChecklistChecklistOwnersType0ItemDataAttributes: """ Attributes: - catalog_entity_checklist_id (str | Unset): The ID of the parent checklist - owner_user_id (str | Unset): The ID of the owner user - created_at (str | Unset): Date of creation - updated_at (str | Unset): Date of last update + catalog_entity_checklist_id (Union[Unset, str]): The ID of the parent checklist + owner_user_id (Union[Unset, str]): The ID of the owner user + created_at (Union[Unset, str]): Date of creation + updated_at (Union[Unset, str]): Date of last update """ - catalog_entity_checklist_id: str | Unset = UNSET - owner_user_id: str | Unset = UNSET - created_at: str | Unset = UNSET - updated_at: str | Unset = UNSET + catalog_entity_checklist_id: Union[Unset, str] = UNSET + owner_user_id: Union[Unset, str] = UNSET + created_at: Union[Unset, str] = UNSET + updated_at: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/catalog_entity_checklist_list.py b/rootly_sdk/models/catalog_entity_checklist_list.py index 2eaf2854..576541bb 100644 --- a/rootly_sdk/models/catalog_entity_checklist_list.py +++ b/rootly_sdk/models/catalog_entity_checklist_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,34 +20,33 @@ class CatalogEntityChecklistList: """ Attributes: - data (list[CatalogEntityChecklistListDataItem]): - links (Links | Unset): - meta (Meta | Unset): - included (list[JsonapiIncludedResource] | Unset): + data (list['CatalogEntityChecklistListDataItem']): + links (Union[Unset, Links]): + meta (Union[Unset, Meta]): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[CatalogEntityChecklistListDataItem] - links: Links | Unset = UNSET - meta: Meta | Unset = UNSET - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["CatalogEntityChecklistListDataItem"] + links: Union[Unset, "Links"] = UNSET + meta: Union[Unset, "Meta"] = UNSET + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() data.append(data_item) - links: dict[str, Any] | Unset = UNSET + links: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.links, Unset): links = self.links.to_dict() - meta: dict[str, Any] | Unset = UNSET + meta: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.meta, Unset): meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -88,27 +85,25 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data.append(data_item) _links = d.pop("links", UNSET) - links: Links | Unset + links: Union[Unset, Links] if isinstance(_links, Unset): links = UNSET else: links = Links.from_dict(_links) _meta = d.pop("meta", UNSET) - meta: Meta | Unset + meta: Union[Unset, Meta] if isinstance(_meta, Unset): meta = UNSET else: meta = Meta.from_dict(_meta) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) catalog_entity_checklist_list = cls( data=data, diff --git a/rootly_sdk/models/catalog_entity_checklist_list_data_item.py b/rootly_sdk/models/catalog_entity_checklist_list_data_item.py index 4e904d00..32e91060 100644 --- a/rootly_sdk/models/catalog_entity_checklist_list_data_item.py +++ b/rootly_sdk/models/catalog_entity_checklist_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class CatalogEntityChecklistListDataItem: id: str type_: CatalogEntityChecklistListDataItemType - attributes: CatalogEntityChecklist + attributes: "CatalogEntityChecklist" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/catalog_entity_checklist_response.py b/rootly_sdk/models/catalog_entity_checklist_response.py index 649544ff..48bdb586 100644 --- a/rootly_sdk/models/catalog_entity_checklist_response.py +++ b/rootly_sdk/models/catalog_entity_checklist_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,18 +19,17 @@ class CatalogEntityChecklistResponse: """ Attributes: data (CatalogEntityChecklistResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: CatalogEntityChecklistResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "CatalogEntityChecklistResponseData" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = CatalogEntityChecklistResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) catalog_entity_checklist_response = cls( data=data, diff --git a/rootly_sdk/models/catalog_entity_checklist_response_data.py b/rootly_sdk/models/catalog_entity_checklist_response_data.py index 0f7379b9..d04912a0 100644 --- a/rootly_sdk/models/catalog_entity_checklist_response_data.py +++ b/rootly_sdk/models/catalog_entity_checklist_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class CatalogEntityChecklistResponseData: id: str type_: CatalogEntityChecklistResponseDataType - attributes: CatalogEntityChecklist + attributes: "CatalogEntityChecklist" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/catalog_entity_list.py b/rootly_sdk/models/catalog_entity_list.py index 25ebef55..1c9c6c94 100644 --- a/rootly_sdk/models/catalog_entity_list.py +++ b/rootly_sdk/models/catalog_entity_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,20 +20,19 @@ class CatalogEntityList: """ Attributes: - data (list[CatalogEntityListDataItem]): + data (list['CatalogEntityListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[CatalogEntityListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["CatalogEntityListDataItem"] + links: "Links" + meta: "Meta" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) catalog_entity_list = cls( data=data, diff --git a/rootly_sdk/models/catalog_entity_list_data_item.py b/rootly_sdk/models/catalog_entity_list_data_item.py index d6635a40..e71d7885 100644 --- a/rootly_sdk/models/catalog_entity_list_data_item.py +++ b/rootly_sdk/models/catalog_entity_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class CatalogEntityListDataItem: id: str type_: CatalogEntityListDataItemType - attributes: CatalogEntity + attributes: "CatalogEntity" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/catalog_entity_properties_item.py b/rootly_sdk/models/catalog_entity_properties_item.py index a96d631a..4209688b 100644 --- a/rootly_sdk/models/catalog_entity_properties_item.py +++ b/rootly_sdk/models/catalog_entity_properties_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/catalog_entity_property.py b/rootly_sdk/models/catalog_entity_property.py index 36c57257..28079807 100644 --- a/rootly_sdk/models/catalog_entity_property.py +++ b/rootly_sdk/models/catalog_entity_property.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/catalog_entity_property_list.py b/rootly_sdk/models/catalog_entity_property_list.py index ee46c1ca..48a7dd06 100644 --- a/rootly_sdk/models/catalog_entity_property_list.py +++ b/rootly_sdk/models/catalog_entity_property_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -24,20 +22,19 @@ class CatalogEntityPropertyList: endpoints (teams, services, functionalities, incident_types, causes, environments) to retrieve field values instead. Attributes: - data (list[CatalogEntityPropertyListDataItem]): + data (list['CatalogEntityPropertyListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[CatalogEntityPropertyListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["CatalogEntityPropertyListDataItem"] + links: "Links" + meta: "Meta" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -47,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -87,14 +84,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) catalog_entity_property_list = cls( data=data, diff --git a/rootly_sdk/models/catalog_entity_property_list_data_item.py b/rootly_sdk/models/catalog_entity_property_list_data_item.py index 076db434..5296266a 100644 --- a/rootly_sdk/models/catalog_entity_property_list_data_item.py +++ b/rootly_sdk/models/catalog_entity_property_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -31,11 +29,10 @@ class CatalogEntityPropertyListDataItem: id: str type_: CatalogEntityPropertyListDataItemType - attributes: CatalogEntityProperty + attributes: "CatalogEntityProperty" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/catalog_entity_property_response.py b/rootly_sdk/models/catalog_entity_property_response.py index dcc92f35..f7e5a75f 100644 --- a/rootly_sdk/models/catalog_entity_property_response.py +++ b/rootly_sdk/models/catalog_entity_property_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,18 +21,17 @@ class CatalogEntityPropertyResponse: Attributes: data (CatalogEntityPropertyResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: CatalogEntityPropertyResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "CatalogEntityPropertyResponseData" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -61,14 +58,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = CatalogEntityPropertyResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) catalog_entity_property_response = cls( data=data, diff --git a/rootly_sdk/models/catalog_entity_property_response_data.py b/rootly_sdk/models/catalog_entity_property_response_data.py index 498e31c9..2eadd03a 100644 --- a/rootly_sdk/models/catalog_entity_property_response_data.py +++ b/rootly_sdk/models/catalog_entity_property_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -31,11 +29,10 @@ class CatalogEntityPropertyResponseData: id: str type_: CatalogEntityPropertyResponseDataType - attributes: CatalogEntityProperty + attributes: "CatalogEntityProperty" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/catalog_entity_response.py b/rootly_sdk/models/catalog_entity_response.py index d4021d60..2ff78524 100644 --- a/rootly_sdk/models/catalog_entity_response.py +++ b/rootly_sdk/models/catalog_entity_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,18 +19,17 @@ class CatalogEntityResponse: """ Attributes: data (CatalogEntityResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: CatalogEntityResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "CatalogEntityResponseData" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = CatalogEntityResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) catalog_entity_response = cls( data=data, diff --git a/rootly_sdk/models/catalog_entity_response_data.py b/rootly_sdk/models/catalog_entity_response_data.py index c94fce28..de40e5fb 100644 --- a/rootly_sdk/models/catalog_entity_response_data.py +++ b/rootly_sdk/models/catalog_entity_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class CatalogEntityResponseData: id: str type_: CatalogEntityResponseDataType - attributes: CatalogEntity + attributes: "CatalogEntity" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/catalog_field.py b/rootly_sdk/models/catalog_field.py index ec19027e..a69f88e2 100644 --- a/rootly_sdk/models/catalog_field.py +++ b/rootly_sdk/models/catalog_field.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -18,39 +16,39 @@ class CatalogField: """ Attributes: - catalog_id (None | str): + catalog_id (Union[None, str]): name (str): kind (CatalogFieldKind): multiple (bool): Whether the attribute accepts multiple values. - position (int | None): Default position of the item when displayed in a list. + position (Union[None, int]): Default position of the item when displayed in a list. created_at (str): updated_at (str): - slug (str | Unset): - kind_catalog_id (None | str | Unset): Restricts values to items of specified catalog. - required (bool | Unset): Whether the field is required. - catalog_type (CatalogFieldCatalogType | Unset): The type of catalog the field belongs to. - external_id (None | str | Unset): An external identifier for this catalog field. Must be unique within the + slug (Union[Unset, str]): + kind_catalog_id (Union[None, Unset, str]): Restricts values to items of specified catalog. + required (Union[Unset, bool]): Whether the field is required. + catalog_type (Union[Unset, CatalogFieldCatalogType]): The type of catalog the field belongs to. + external_id (Union[None, Unset, str]): An external identifier for this catalog field. Must be unique within the scope. - managed_by (CatalogFieldManagedBy | Unset): Which source manages this resource (read-only). + managed_by (Union[Unset, CatalogFieldManagedBy]): Which source manages this resource (read-only). """ - catalog_id: None | str + catalog_id: Union[None, str] name: str kind: CatalogFieldKind multiple: bool - position: int | None + position: Union[None, int] created_at: str updated_at: str - slug: str | Unset = UNSET - kind_catalog_id: None | str | Unset = UNSET - required: bool | Unset = UNSET - catalog_type: CatalogFieldCatalogType | Unset = UNSET - external_id: None | str | Unset = UNSET - managed_by: CatalogFieldManagedBy | Unset = UNSET + slug: Union[Unset, str] = UNSET + kind_catalog_id: Union[None, Unset, str] = UNSET + required: Union[Unset, bool] = UNSET + catalog_type: Union[Unset, CatalogFieldCatalogType] = UNSET + external_id: Union[None, Unset, str] = UNSET + managed_by: Union[Unset, CatalogFieldManagedBy] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - catalog_id: None | str + catalog_id: Union[None, str] catalog_id = self.catalog_id name = self.name @@ -59,7 +57,7 @@ def to_dict(self) -> dict[str, Any]: multiple = self.multiple - position: int | None + position: Union[None, int] position = self.position created_at = self.created_at @@ -68,7 +66,7 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - kind_catalog_id: None | str | Unset + kind_catalog_id: Union[None, Unset, str] if isinstance(self.kind_catalog_id, Unset): kind_catalog_id = UNSET else: @@ -76,17 +74,17 @@ def to_dict(self) -> dict[str, Any]: required = self.required - catalog_type: str | Unset = UNSET + catalog_type: Union[Unset, str] = UNSET if not isinstance(self.catalog_type, Unset): catalog_type = self.catalog_type - external_id: None | str | Unset + external_id: Union[None, Unset, str] if isinstance(self.external_id, Unset): external_id = UNSET else: external_id = self.external_id - managed_by: str | Unset = UNSET + managed_by: Union[Unset, str] = UNSET if not isinstance(self.managed_by, Unset): managed_by = self.managed_by @@ -122,10 +120,10 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_catalog_id(data: object) -> None | str: + def _parse_catalog_id(data: object) -> Union[None, str]: if data is None: return data - return cast(None | str, data) + return cast(Union[None, str], data) catalog_id = _parse_catalog_id(d.pop("catalog_id")) @@ -135,10 +133,10 @@ def _parse_catalog_id(data: object) -> None | str: multiple = d.pop("multiple") - def _parse_position(data: object) -> int | None: + def _parse_position(data: object) -> Union[None, int]: if data is None: return data - return cast(int | None, data) + return cast(Union[None, int], data) position = _parse_position(d.pop("position")) @@ -148,35 +146,35 @@ def _parse_position(data: object) -> int | None: slug = d.pop("slug", UNSET) - def _parse_kind_catalog_id(data: object) -> None | str | Unset: + def _parse_kind_catalog_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) kind_catalog_id = _parse_kind_catalog_id(d.pop("kind_catalog_id", UNSET)) required = d.pop("required", UNSET) _catalog_type = d.pop("catalog_type", UNSET) - catalog_type: CatalogFieldCatalogType | Unset + catalog_type: Union[Unset, CatalogFieldCatalogType] if isinstance(_catalog_type, Unset): catalog_type = UNSET else: catalog_type = check_catalog_field_catalog_type(_catalog_type) - def _parse_external_id(data: object) -> None | str | Unset: + def _parse_external_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) external_id = _parse_external_id(d.pop("external_id", UNSET)) _managed_by = d.pop("managed_by", UNSET) - managed_by: CatalogFieldManagedBy | Unset + managed_by: Union[Unset, CatalogFieldManagedBy] if isinstance(_managed_by, Unset): managed_by = UNSET else: diff --git a/rootly_sdk/models/catalog_field_list.py b/rootly_sdk/models/catalog_field_list.py index 701ad0c1..aee4306e 100644 --- a/rootly_sdk/models/catalog_field_list.py +++ b/rootly_sdk/models/catalog_field_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,20 +20,19 @@ class CatalogFieldList: """ Attributes: - data (list[CatalogFieldListDataItem]): + data (list['CatalogFieldListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[CatalogFieldListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["CatalogFieldListDataItem"] + links: "Links" + meta: "Meta" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) catalog_field_list = cls( data=data, diff --git a/rootly_sdk/models/catalog_field_list_data_item.py b/rootly_sdk/models/catalog_field_list_data_item.py index 682398fe..744cc909 100644 --- a/rootly_sdk/models/catalog_field_list_data_item.py +++ b/rootly_sdk/models/catalog_field_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class CatalogFieldListDataItem: id: str type_: CatalogFieldListDataItemType - attributes: CatalogField + attributes: "CatalogField" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/catalog_field_response.py b/rootly_sdk/models/catalog_field_response.py index 28027488..bdf07e64 100644 --- a/rootly_sdk/models/catalog_field_response.py +++ b/rootly_sdk/models/catalog_field_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,18 +19,17 @@ class CatalogFieldResponse: """ Attributes: data (CatalogFieldResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: CatalogFieldResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "CatalogFieldResponseData" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = CatalogFieldResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) catalog_field_response = cls( data=data, diff --git a/rootly_sdk/models/catalog_field_response_data.py b/rootly_sdk/models/catalog_field_response_data.py index 8e7af968..21e16252 100644 --- a/rootly_sdk/models/catalog_field_response_data.py +++ b/rootly_sdk/models/catalog_field_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class CatalogFieldResponseData: id: str type_: CatalogFieldResponseDataType - attributes: CatalogField + attributes: "CatalogField" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/catalog_list.py b/rootly_sdk/models/catalog_list.py index b08d4e29..a66b7913 100644 --- a/rootly_sdk/models/catalog_list.py +++ b/rootly_sdk/models/catalog_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,20 +20,19 @@ class CatalogList: """ Attributes: - data (list[CatalogListDataItem]): + data (list['CatalogListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[CatalogListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["CatalogListDataItem"] + links: "Links" + meta: "Meta" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) catalog_list = cls( data=data, diff --git a/rootly_sdk/models/catalog_list_data_item.py b/rootly_sdk/models/catalog_list_data_item.py index b571539d..7c497c89 100644 --- a/rootly_sdk/models/catalog_list_data_item.py +++ b/rootly_sdk/models/catalog_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class CatalogListDataItem: id: str type_: CatalogListDataItemType - attributes: Catalog + attributes: "Catalog" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/catalog_property.py b/rootly_sdk/models/catalog_property.py index 290c5655..497241cd 100644 --- a/rootly_sdk/models/catalog_property.py +++ b/rootly_sdk/models/catalog_property.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -18,39 +16,39 @@ class CatalogProperty: """ Attributes: - catalog_id (None | str): + catalog_id (Union[None, str]): name (str): kind (CatalogPropertyKind): multiple (bool): Whether the attribute accepts multiple values. - position (int | None): Default position of the item when displayed in a list. + position (Union[None, int]): Default position of the item when displayed in a list. created_at (str): updated_at (str): - slug (str | Unset): - kind_catalog_id (None | str | Unset): Restricts values to items of specified catalog. - required (bool | Unset): Whether the property is required. - catalog_type (CatalogPropertyCatalogType | Unset): The type of catalog the property belongs to. - external_id (None | str | Unset): An external identifier for this catalog property. Must be unique within the - scope. - managed_by (CatalogPropertyManagedBy | Unset): Which source manages this resource (read-only). + slug (Union[Unset, str]): + kind_catalog_id (Union[None, Unset, str]): Restricts values to items of specified catalog. + required (Union[Unset, bool]): Whether the property is required. + catalog_type (Union[Unset, CatalogPropertyCatalogType]): The type of catalog the property belongs to. + external_id (Union[None, Unset, str]): An external identifier for this catalog property. Must be unique within + the scope. + managed_by (Union[Unset, CatalogPropertyManagedBy]): Which source manages this resource (read-only). """ - catalog_id: None | str + catalog_id: Union[None, str] name: str kind: CatalogPropertyKind multiple: bool - position: int | None + position: Union[None, int] created_at: str updated_at: str - slug: str | Unset = UNSET - kind_catalog_id: None | str | Unset = UNSET - required: bool | Unset = UNSET - catalog_type: CatalogPropertyCatalogType | Unset = UNSET - external_id: None | str | Unset = UNSET - managed_by: CatalogPropertyManagedBy | Unset = UNSET + slug: Union[Unset, str] = UNSET + kind_catalog_id: Union[None, Unset, str] = UNSET + required: Union[Unset, bool] = UNSET + catalog_type: Union[Unset, CatalogPropertyCatalogType] = UNSET + external_id: Union[None, Unset, str] = UNSET + managed_by: Union[Unset, CatalogPropertyManagedBy] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - catalog_id: None | str + catalog_id: Union[None, str] catalog_id = self.catalog_id name = self.name @@ -59,7 +57,7 @@ def to_dict(self) -> dict[str, Any]: multiple = self.multiple - position: int | None + position: Union[None, int] position = self.position created_at = self.created_at @@ -68,7 +66,7 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - kind_catalog_id: None | str | Unset + kind_catalog_id: Union[None, Unset, str] if isinstance(self.kind_catalog_id, Unset): kind_catalog_id = UNSET else: @@ -76,17 +74,17 @@ def to_dict(self) -> dict[str, Any]: required = self.required - catalog_type: str | Unset = UNSET + catalog_type: Union[Unset, str] = UNSET if not isinstance(self.catalog_type, Unset): catalog_type = self.catalog_type - external_id: None | str | Unset + external_id: Union[None, Unset, str] if isinstance(self.external_id, Unset): external_id = UNSET else: external_id = self.external_id - managed_by: str | Unset = UNSET + managed_by: Union[Unset, str] = UNSET if not isinstance(self.managed_by, Unset): managed_by = self.managed_by @@ -122,10 +120,10 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_catalog_id(data: object) -> None | str: + def _parse_catalog_id(data: object) -> Union[None, str]: if data is None: return data - return cast(None | str, data) + return cast(Union[None, str], data) catalog_id = _parse_catalog_id(d.pop("catalog_id")) @@ -135,10 +133,10 @@ def _parse_catalog_id(data: object) -> None | str: multiple = d.pop("multiple") - def _parse_position(data: object) -> int | None: + def _parse_position(data: object) -> Union[None, int]: if data is None: return data - return cast(int | None, data) + return cast(Union[None, int], data) position = _parse_position(d.pop("position")) @@ -148,35 +146,35 @@ def _parse_position(data: object) -> int | None: slug = d.pop("slug", UNSET) - def _parse_kind_catalog_id(data: object) -> None | str | Unset: + def _parse_kind_catalog_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) kind_catalog_id = _parse_kind_catalog_id(d.pop("kind_catalog_id", UNSET)) required = d.pop("required", UNSET) _catalog_type = d.pop("catalog_type", UNSET) - catalog_type: CatalogPropertyCatalogType | Unset + catalog_type: Union[Unset, CatalogPropertyCatalogType] if isinstance(_catalog_type, Unset): catalog_type = UNSET else: catalog_type = check_catalog_property_catalog_type(_catalog_type) - def _parse_external_id(data: object) -> None | str | Unset: + def _parse_external_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) external_id = _parse_external_id(d.pop("external_id", UNSET)) _managed_by = d.pop("managed_by", UNSET) - managed_by: CatalogPropertyManagedBy | Unset + managed_by: Union[Unset, CatalogPropertyManagedBy] if isinstance(_managed_by, Unset): managed_by = UNSET else: diff --git a/rootly_sdk/models/catalog_property_list.py b/rootly_sdk/models/catalog_property_list.py index 599d86d9..0888e714 100644 --- a/rootly_sdk/models/catalog_property_list.py +++ b/rootly_sdk/models/catalog_property_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,20 +20,19 @@ class CatalogPropertyList: """ Attributes: - data (list[CatalogPropertyListDataItem]): + data (list['CatalogPropertyListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[CatalogPropertyListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["CatalogPropertyListDataItem"] + links: "Links" + meta: "Meta" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) catalog_property_list = cls( data=data, diff --git a/rootly_sdk/models/catalog_property_list_data_item.py b/rootly_sdk/models/catalog_property_list_data_item.py index 30b3a4f7..4bd69137 100644 --- a/rootly_sdk/models/catalog_property_list_data_item.py +++ b/rootly_sdk/models/catalog_property_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class CatalogPropertyListDataItem: id: str type_: CatalogPropertyListDataItemType - attributes: CatalogProperty + attributes: "CatalogProperty" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/catalog_property_response.py b/rootly_sdk/models/catalog_property_response.py index 9487ea12..4db32d00 100644 --- a/rootly_sdk/models/catalog_property_response.py +++ b/rootly_sdk/models/catalog_property_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,18 +19,17 @@ class CatalogPropertyResponse: """ Attributes: data (CatalogPropertyResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: CatalogPropertyResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "CatalogPropertyResponseData" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = CatalogPropertyResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) catalog_property_response = cls( data=data, diff --git a/rootly_sdk/models/catalog_property_response_data.py b/rootly_sdk/models/catalog_property_response_data.py index 97cf9c33..9899d562 100644 --- a/rootly_sdk/models/catalog_property_response_data.py +++ b/rootly_sdk/models/catalog_property_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class CatalogPropertyResponseData: id: str type_: CatalogPropertyResponseDataType - attributes: CatalogProperty + attributes: "CatalogProperty" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/catalog_response.py b/rootly_sdk/models/catalog_response.py index 803acfef..bd17dcd5 100644 --- a/rootly_sdk/models/catalog_response.py +++ b/rootly_sdk/models/catalog_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,18 +19,17 @@ class CatalogResponse: """ Attributes: data (CatalogResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: CatalogResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "CatalogResponseData" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = CatalogResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) catalog_response = cls( data=data, diff --git a/rootly_sdk/models/catalog_response_data.py b/rootly_sdk/models/catalog_response_data.py index 3043dcd1..84cb45e7 100644 --- a/rootly_sdk/models/catalog_response_data.py +++ b/rootly_sdk/models/catalog_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class CatalogResponseData: id: str type_: CatalogResponseDataType - attributes: Catalog + attributes: "Catalog" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/cause.py b/rootly_sdk/models/cause.py index 0f7cc7b6..8d0e9f10 100644 --- a/rootly_sdk/models/cause.py +++ b/rootly_sdk/models/cause.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,23 +20,24 @@ class Cause: name (str): The name of the cause created_at (str): Date of creation updated_at (str): Date of last update - slug (str | Unset): The slug of the cause - description (None | str | Unset): The description of the cause - position (int | None | Unset): Position of the cause - properties (list[CausePropertiesItem] | Unset): Array of property values for this cause. + slug (Union[Unset, str]): The slug of the cause + description (Union[None, Unset, str]): The description of the cause + public_description (Union[None, Unset, str]): The status page description of the cause + position (Union[None, Unset, int]): Position of the cause + properties (Union[Unset, list['CausePropertiesItem']]): Array of property values for this cause. """ name: str created_at: str updated_at: str - slug: str | Unset = UNSET - description: None | str | Unset = UNSET - position: int | None | Unset = UNSET - properties: list[CausePropertiesItem] | Unset = UNSET + slug: Union[Unset, str] = UNSET + description: Union[None, Unset, str] = UNSET + public_description: Union[None, Unset, str] = UNSET + position: Union[None, Unset, int] = UNSET + properties: Union[Unset, list["CausePropertiesItem"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - name = self.name created_at = self.created_at @@ -47,19 +46,25 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - description: None | str | Unset + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: description = self.description - position: int | None | Unset + public_description: Union[None, Unset, str] + if isinstance(self.public_description, Unset): + public_description = UNSET + else: + public_description = self.public_description + + position: Union[None, Unset, int] if isinstance(self.position, Unset): position = UNSET else: position = self.position - properties: list[dict[str, Any]] | Unset = UNSET + properties: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.properties, Unset): properties = [] for properties_item_data in self.properties: @@ -79,6 +84,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["slug"] = slug if description is not UNSET: field_dict["description"] = description + if public_description is not UNSET: + field_dict["public_description"] = public_description if position is not UNSET: field_dict["position"] = position if properties is not UNSET: @@ -99,32 +106,39 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: slug = d.pop("slug", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) - def _parse_position(data: object) -> int | None | Unset: + def _parse_public_description(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + public_description = _parse_public_description(d.pop("public_description", UNSET)) + + def _parse_position(data: object) -> Union[None, Unset, int]: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(Union[None, Unset, int], data) position = _parse_position(d.pop("position", UNSET)) + properties = [] _properties = d.pop("properties", UNSET) - properties: list[CausePropertiesItem] | Unset = UNSET - if _properties is not UNSET: - properties = [] - for properties_item_data in _properties: - properties_item = CausePropertiesItem.from_dict(properties_item_data) + for properties_item_data in _properties or []: + properties_item = CausePropertiesItem.from_dict(properties_item_data) - properties.append(properties_item) + properties.append(properties_item) cause = cls( name=name, @@ -132,6 +146,7 @@ def _parse_position(data: object) -> int | None | Unset: updated_at=updated_at, slug=slug, description=description, + public_description=public_description, position=position, properties=properties, ) diff --git a/rootly_sdk/models/cause_list.py b/rootly_sdk/models/cause_list.py index 09bf20ee..91cf4159 100644 --- a/rootly_sdk/models/cause_list.py +++ b/rootly_sdk/models/cause_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,20 +20,19 @@ class CauseList: """ Attributes: - data (list[CauseListDataItem]): + data (list['CauseListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[CauseListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["CauseListDataItem"] + links: "Links" + meta: "Meta" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) cause_list = cls( data=data, diff --git a/rootly_sdk/models/cause_list_data_item.py b/rootly_sdk/models/cause_list_data_item.py index ab260383..be1f6faa 100644 --- a/rootly_sdk/models/cause_list_data_item.py +++ b/rootly_sdk/models/cause_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class CauseListDataItem: id: str type_: CauseListDataItemType - attributes: Cause + attributes: "Cause" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/cause_properties_item.py b/rootly_sdk/models/cause_properties_item.py index ada1e890..ab1a6e50 100644 --- a/rootly_sdk/models/cause_properties_item.py +++ b/rootly_sdk/models/cause_properties_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/cause_response.py b/rootly_sdk/models/cause_response.py index 5b7f1b42..dadded01 100644 --- a/rootly_sdk/models/cause_response.py +++ b/rootly_sdk/models/cause_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,18 +19,17 @@ class CauseResponse: """ Attributes: data (CauseResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: CauseResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "CauseResponseData" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = CauseResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) cause_response = cls( data=data, diff --git a/rootly_sdk/models/cause_response_data.py b/rootly_sdk/models/cause_response_data.py index 26df2bb4..474e138f 100644 --- a/rootly_sdk/models/cause_response_data.py +++ b/rootly_sdk/models/cause_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class CauseResponseData: id: str type_: CauseResponseDataType - attributes: Cause + attributes: "Cause" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/change_google_chat_space_privacy_task_params.py b/rootly_sdk/models/change_google_chat_space_privacy_task_params.py index b38539dc..dbae8087 100644 --- a/rootly_sdk/models/change_google_chat_space_privacy_task_params.py +++ b/rootly_sdk/models/change_google_chat_space_privacy_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -24,25 +22,24 @@ class ChangeGoogleChatSpacePrivacyTaskParams: """ Attributes: space (ChangeGoogleChatSpacePrivacyTaskParamsSpace): - task_type (ChangeGoogleChatSpacePrivacyTaskParamsTaskType | Unset): - audience (None | str | Unset): Target audience resource name (e.g. audiences/default). Leave blank to make + task_type (Union[Unset, ChangeGoogleChatSpacePrivacyTaskParamsTaskType]): + audience (Union[None, Unset, str]): Target audience resource name (e.g. audiences/default). Leave blank to make private. """ - space: ChangeGoogleChatSpacePrivacyTaskParamsSpace - task_type: ChangeGoogleChatSpacePrivacyTaskParamsTaskType | Unset = UNSET - audience: None | str | Unset = UNSET + space: "ChangeGoogleChatSpacePrivacyTaskParamsSpace" + task_type: Union[Unset, ChangeGoogleChatSpacePrivacyTaskParamsTaskType] = UNSET + audience: Union[None, Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - space = self.space.to_dict() - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - audience: None | str | Unset + audience: Union[None, Unset, str] if isinstance(self.audience, Unset): audience = UNSET else: @@ -72,18 +69,18 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: space = ChangeGoogleChatSpacePrivacyTaskParamsSpace.from_dict(d.pop("space")) _task_type = d.pop("task_type", UNSET) - task_type: ChangeGoogleChatSpacePrivacyTaskParamsTaskType | Unset + task_type: Union[Unset, ChangeGoogleChatSpacePrivacyTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: task_type = check_change_google_chat_space_privacy_task_params_task_type(_task_type) - def _parse_audience(data: object) -> None | str | Unset: + def _parse_audience(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) audience = _parse_audience(d.pop("audience", UNSET)) diff --git a/rootly_sdk/models/change_google_chat_space_privacy_task_params_space.py b/rootly_sdk/models/change_google_chat_space_privacy_task_params_space.py index cf4c0984..b756ca5d 100644 --- a/rootly_sdk/models/change_google_chat_space_privacy_task_params_space.py +++ b/rootly_sdk/models/change_google_chat_space_privacy_task_params_space.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class ChangeGoogleChatSpacePrivacyTaskParamsSpace: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/change_slack_channel_privacy_task_params.py b/rootly_sdk/models/change_slack_channel_privacy_task_params.py index 58c10e84..3570c17a 100644 --- a/rootly_sdk/models/change_slack_channel_privacy_task_params.py +++ b/rootly_sdk/models/change_slack_channel_privacy_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,21 +27,20 @@ class ChangeSlackChannelPrivacyTaskParams: Attributes: channel (ChangeSlackChannelPrivacyTaskParamsChannel): privacy (ChangeSlackChannelPrivacyTaskParamsPrivacy): - task_type (ChangeSlackChannelPrivacyTaskParamsTaskType | Unset): + task_type (Union[Unset, ChangeSlackChannelPrivacyTaskParamsTaskType]): """ - channel: ChangeSlackChannelPrivacyTaskParamsChannel + channel: "ChangeSlackChannelPrivacyTaskParamsChannel" privacy: ChangeSlackChannelPrivacyTaskParamsPrivacy - task_type: ChangeSlackChannelPrivacyTaskParamsTaskType | Unset = UNSET + task_type: Union[Unset, ChangeSlackChannelPrivacyTaskParamsTaskType] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - channel = self.channel.to_dict() privacy: str = self.privacy - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -70,7 +67,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: privacy = check_change_slack_channel_privacy_task_params_privacy(d.pop("privacy")) _task_type = d.pop("task_type", UNSET) - task_type: ChangeSlackChannelPrivacyTaskParamsTaskType | Unset + task_type: Union[Unset, ChangeSlackChannelPrivacyTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/change_slack_channel_privacy_task_params_channel.py b/rootly_sdk/models/change_slack_channel_privacy_task_params_channel.py index 1dd7d904..4f4c08c3 100644 --- a/rootly_sdk/models/change_slack_channel_privacy_task_params_channel.py +++ b/rootly_sdk/models/change_slack_channel_privacy_task_params_channel.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class ChangeSlackChannelPrivacyTaskParamsChannel: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/communications_group.py b/rootly_sdk/models/communications_group.py index a6028858..0ea7ef03 100644 --- a/rootly_sdk/models/communications_group.py +++ b/rootly_sdk/models/communications_group.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -36,14 +34,14 @@ class CommunicationsGroup: email_channel (bool): Email channel enabled created_at (str): Date of creation updated_at (str): Date of last update - slug (str | Unset): The slug of the communications group - description (None | str | Unset): The description of the communications group - communication_group_conditions (list[CommunicationsGroupCommunicationGroupConditionsType0Item] | None | Unset): - Group conditions attributes - member_ids (list[int] | None | Unset): Array of member user IDs - slack_channel_ids (list[str] | None | Unset): Array of Slack channel IDs - communication_external_group_members (list[CommunicationsGroupCommunicationExternalGroupMembersType0Item] | None - | Unset): External group members + slug (Union[Unset, str]): The slug of the communications group + description (Union[None, Unset, str]): The description of the communications group + communication_group_conditions (Union[None, Unset, + list['CommunicationsGroupCommunicationGroupConditionsType0Item']]): Group conditions attributes + member_ids (Union[None, Unset, list[int]]): Array of member user IDs + slack_channel_ids (Union[None, Unset, list[str]]): Array of Slack channel IDs + communication_external_group_members (Union[None, Unset, + list['CommunicationsGroupCommunicationExternalGroupMembersType0Item']]): External group members """ name: str @@ -54,20 +52,19 @@ class CommunicationsGroup: email_channel: bool created_at: str updated_at: str - slug: str | Unset = UNSET - description: None | str | Unset = UNSET - communication_group_conditions: list[CommunicationsGroupCommunicationGroupConditionsType0Item] | None | Unset = ( - UNSET - ) - member_ids: list[int] | None | Unset = UNSET - slack_channel_ids: list[str] | None | Unset = UNSET - communication_external_group_members: ( - list[CommunicationsGroupCommunicationExternalGroupMembersType0Item] | None | Unset - ) = UNSET + slug: Union[Unset, str] = UNSET + description: Union[None, Unset, str] = UNSET + communication_group_conditions: Union[ + None, Unset, list["CommunicationsGroupCommunicationGroupConditionsType0Item"] + ] = UNSET + member_ids: Union[None, Unset, list[int]] = UNSET + slack_channel_ids: Union[None, Unset, list[str]] = UNSET + communication_external_group_members: Union[ + None, Unset, list["CommunicationsGroupCommunicationExternalGroupMembersType0Item"] + ] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - name = self.name communication_type_id = self.communication_type_id @@ -86,13 +83,13 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - description: None | str | Unset + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: description = self.description - communication_group_conditions: list[dict[str, Any]] | None | Unset + communication_group_conditions: Union[None, Unset, list[dict[str, Any]]] if isinstance(self.communication_group_conditions, Unset): communication_group_conditions = UNSET elif isinstance(self.communication_group_conditions, list): @@ -104,7 +101,7 @@ def to_dict(self) -> dict[str, Any]: else: communication_group_conditions = self.communication_group_conditions - member_ids: list[int] | None | Unset + member_ids: Union[None, Unset, list[int]] if isinstance(self.member_ids, Unset): member_ids = UNSET elif isinstance(self.member_ids, list): @@ -113,7 +110,7 @@ def to_dict(self) -> dict[str, Any]: else: member_ids = self.member_ids - slack_channel_ids: list[str] | None | Unset + slack_channel_ids: Union[None, Unset, list[str]] if isinstance(self.slack_channel_ids, Unset): slack_channel_ids = UNSET elif isinstance(self.slack_channel_ids, list): @@ -122,7 +119,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_channel_ids = self.slack_channel_ids - communication_external_group_members: list[dict[str, Any]] | None | Unset + communication_external_group_members: Union[None, Unset, list[dict[str, Any]]] if isinstance(self.communication_external_group_members, Unset): communication_external_group_members = UNSET elif isinstance(self.communication_external_group_members, list): @@ -193,18 +190,18 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: slug = d.pop("slug", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) def _parse_communication_group_conditions( data: object, - ) -> list[CommunicationsGroupCommunicationGroupConditionsType0Item] | None | Unset: + ) -> Union[None, Unset, list["CommunicationsGroupCommunicationGroupConditionsType0Item"]]: if data is None: return data if isinstance(data, Unset): @@ -224,15 +221,15 @@ def _parse_communication_group_conditions( communication_group_conditions_type_0.append(communication_group_conditions_type_0_item) return communication_group_conditions_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[CommunicationsGroupCommunicationGroupConditionsType0Item] | None | Unset, data) + return cast(Union[None, Unset, list["CommunicationsGroupCommunicationGroupConditionsType0Item"]], data) communication_group_conditions = _parse_communication_group_conditions( d.pop("communication_group_conditions", UNSET) ) - def _parse_member_ids(data: object) -> list[int] | None | Unset: + def _parse_member_ids(data: object) -> Union[None, Unset, list[int]]: if data is None: return data if isinstance(data, Unset): @@ -243,13 +240,13 @@ def _parse_member_ids(data: object) -> list[int] | None | Unset: member_ids_type_0 = cast(list[int], data) return member_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[int] | None | Unset, data) + return cast(Union[None, Unset, list[int]], data) member_ids = _parse_member_ids(d.pop("member_ids", UNSET)) - def _parse_slack_channel_ids(data: object) -> list[str] | None | Unset: + def _parse_slack_channel_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -260,15 +257,15 @@ def _parse_slack_channel_ids(data: object) -> list[str] | None | Unset: slack_channel_ids_type_0 = cast(list[str], data) return slack_channel_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) slack_channel_ids = _parse_slack_channel_ids(d.pop("slack_channel_ids", UNSET)) def _parse_communication_external_group_members( data: object, - ) -> list[CommunicationsGroupCommunicationExternalGroupMembersType0Item] | None | Unset: + ) -> Union[None, Unset, list["CommunicationsGroupCommunicationExternalGroupMembersType0Item"]]: if data is None: return data if isinstance(data, Unset): @@ -290,9 +287,9 @@ def _parse_communication_external_group_members( communication_external_group_members_type_0.append(communication_external_group_members_type_0_item) return communication_external_group_members_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[CommunicationsGroupCommunicationExternalGroupMembersType0Item] | None | Unset, data) + return cast(Union[None, Unset, list["CommunicationsGroupCommunicationExternalGroupMembersType0Item"]], data) communication_external_group_members = _parse_communication_external_group_members( d.pop("communication_external_group_members", UNSET) diff --git a/rootly_sdk/models/communications_group_communication_external_group_members_type_0_item.py b/rootly_sdk/models/communications_group_communication_external_group_members_type_0_item.py index 7edf9df3..17a38c3f 100644 --- a/rootly_sdk/models/communications_group_communication_external_group_members_type_0_item.py +++ b/rootly_sdk/models/communications_group_communication_external_group_members_type_0_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,16 +13,16 @@ class CommunicationsGroupCommunicationExternalGroupMembersType0Item: """ Attributes: - id (str | Unset): ID of the external group member - name (str | Unset): Name of the external member - email (str | Unset): Email of the external member - phone_number (str | Unset): Phone number of the external member + id (Union[Unset, str]): ID of the external group member + name (Union[Unset, str]): Name of the external member + email (Union[Unset, str]): Email of the external member + phone_number (Union[Unset, str]): Phone number of the external member """ - id: str | Unset = UNSET - name: str | Unset = UNSET - email: str | Unset = UNSET - phone_number: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET + email: Union[Unset, str] = UNSET + phone_number: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/communications_group_communication_group_conditions_type_0_item.py b/rootly_sdk/models/communications_group_communication_group_conditions_type_0_item.py index 8f0cfd6e..ca010751 100644 --- a/rootly_sdk/models/communications_group_communication_group_conditions_type_0_item.py +++ b/rootly_sdk/models/communications_group_communication_group_conditions_type_0_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,28 +17,29 @@ class CommunicationsGroupCommunicationGroupConditionsType0Item: """ Attributes: - property_type (CommunicationsGroupCommunicationGroupConditionsType0ItemPropertyType | Unset): Property type - service_ids (list[str] | None | Unset): Array of service IDs - severity_ids (list[str] | None | Unset): Array of severity IDs - functionality_ids (list[str] | None | Unset): Array of functionality IDs - group_ids (list[str] | None | Unset): Array of group IDs - incident_type_ids (list[str] | None | Unset): Array of incident type IDs + property_type (Union[Unset, CommunicationsGroupCommunicationGroupConditionsType0ItemPropertyType]): Property + type + service_ids (Union[None, Unset, list[str]]): Array of service IDs + severity_ids (Union[None, Unset, list[str]]): Array of severity IDs + functionality_ids (Union[None, Unset, list[str]]): Array of functionality IDs + group_ids (Union[None, Unset, list[str]]): Array of group IDs + incident_type_ids (Union[None, Unset, list[str]]): Array of incident type IDs """ - property_type: CommunicationsGroupCommunicationGroupConditionsType0ItemPropertyType | Unset = UNSET - service_ids: list[str] | None | Unset = UNSET - severity_ids: list[str] | None | Unset = UNSET - functionality_ids: list[str] | None | Unset = UNSET - group_ids: list[str] | None | Unset = UNSET - incident_type_ids: list[str] | None | Unset = UNSET + property_type: Union[Unset, CommunicationsGroupCommunicationGroupConditionsType0ItemPropertyType] = UNSET + service_ids: Union[None, Unset, list[str]] = UNSET + severity_ids: Union[None, Unset, list[str]] = UNSET + functionality_ids: Union[None, Unset, list[str]] = UNSET + group_ids: Union[None, Unset, list[str]] = UNSET + incident_type_ids: Union[None, Unset, list[str]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - property_type: str | Unset = UNSET + property_type: Union[Unset, str] = UNSET if not isinstance(self.property_type, Unset): property_type = self.property_type - service_ids: list[str] | None | Unset + service_ids: Union[None, Unset, list[str]] if isinstance(self.service_ids, Unset): service_ids = UNSET elif isinstance(self.service_ids, list): @@ -49,7 +48,7 @@ def to_dict(self) -> dict[str, Any]: else: service_ids = self.service_ids - severity_ids: list[str] | None | Unset + severity_ids: Union[None, Unset, list[str]] if isinstance(self.severity_ids, Unset): severity_ids = UNSET elif isinstance(self.severity_ids, list): @@ -58,7 +57,7 @@ def to_dict(self) -> dict[str, Any]: else: severity_ids = self.severity_ids - functionality_ids: list[str] | None | Unset + functionality_ids: Union[None, Unset, list[str]] if isinstance(self.functionality_ids, Unset): functionality_ids = UNSET elif isinstance(self.functionality_ids, list): @@ -67,7 +66,7 @@ def to_dict(self) -> dict[str, Any]: else: functionality_ids = self.functionality_ids - group_ids: list[str] | None | Unset + group_ids: Union[None, Unset, list[str]] if isinstance(self.group_ids, Unset): group_ids = UNSET elif isinstance(self.group_ids, list): @@ -76,7 +75,7 @@ def to_dict(self) -> dict[str, Any]: else: group_ids = self.group_ids - incident_type_ids: list[str] | None | Unset + incident_type_ids: Union[None, Unset, list[str]] if isinstance(self.incident_type_ids, Unset): incident_type_ids = UNSET elif isinstance(self.incident_type_ids, list): @@ -107,7 +106,7 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _property_type = d.pop("property_type", UNSET) - property_type: CommunicationsGroupCommunicationGroupConditionsType0ItemPropertyType | Unset + property_type: Union[Unset, CommunicationsGroupCommunicationGroupConditionsType0ItemPropertyType] if isinstance(_property_type, Unset): property_type = UNSET else: @@ -115,7 +114,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: _property_type ) - def _parse_service_ids(data: object) -> list[str] | None | Unset: + def _parse_service_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -126,13 +125,13 @@ def _parse_service_ids(data: object) -> list[str] | None | Unset: service_ids_type_0 = cast(list[str], data) return service_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) service_ids = _parse_service_ids(d.pop("service_ids", UNSET)) - def _parse_severity_ids(data: object) -> list[str] | None | Unset: + def _parse_severity_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -143,13 +142,13 @@ def _parse_severity_ids(data: object) -> list[str] | None | Unset: severity_ids_type_0 = cast(list[str], data) return severity_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) severity_ids = _parse_severity_ids(d.pop("severity_ids", UNSET)) - def _parse_functionality_ids(data: object) -> list[str] | None | Unset: + def _parse_functionality_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -160,13 +159,13 @@ def _parse_functionality_ids(data: object) -> list[str] | None | Unset: functionality_ids_type_0 = cast(list[str], data) return functionality_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) functionality_ids = _parse_functionality_ids(d.pop("functionality_ids", UNSET)) - def _parse_group_ids(data: object) -> list[str] | None | Unset: + def _parse_group_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -177,13 +176,13 @@ def _parse_group_ids(data: object) -> list[str] | None | Unset: group_ids_type_0 = cast(list[str], data) return group_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) group_ids = _parse_group_ids(d.pop("group_ids", UNSET)) - def _parse_incident_type_ids(data: object) -> list[str] | None | Unset: + def _parse_incident_type_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -194,9 +193,9 @@ def _parse_incident_type_ids(data: object) -> list[str] | None | Unset: incident_type_ids_type_0 = cast(list[str], data) return incident_type_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) incident_type_ids = _parse_incident_type_ids(d.pop("incident_type_ids", UNSET)) diff --git a/rootly_sdk/models/communications_group_response.py b/rootly_sdk/models/communications_group_response.py index b5a5b73d..315560df 100644 --- a/rootly_sdk/models/communications_group_response.py +++ b/rootly_sdk/models/communications_group_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,18 +19,17 @@ class CommunicationsGroupResponse: """ Attributes: data (CommunicationsGroupResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: CommunicationsGroupResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "CommunicationsGroupResponseData" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = CommunicationsGroupResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) communications_group_response = cls( data=data, diff --git a/rootly_sdk/models/communications_group_response_data.py b/rootly_sdk/models/communications_group_response_data.py index 348403a7..c2a3a20f 100644 --- a/rootly_sdk/models/communications_group_response_data.py +++ b/rootly_sdk/models/communications_group_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class CommunicationsGroupResponseData: id: str type_: CommunicationsGroupResponseDataType - attributes: CommunicationsGroup + attributes: "CommunicationsGroup" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/communications_groups_response.py b/rootly_sdk/models/communications_groups_response.py index 073a891b..c1168002 100644 --- a/rootly_sdk/models/communications_groups_response.py +++ b/rootly_sdk/models/communications_groups_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,34 +20,33 @@ class CommunicationsGroupsResponse: """ Attributes: - data (list[CommunicationsGroupsResponseDataItem]): - links (Links | Unset): - meta (Meta | Unset): - included (list[JsonapiIncludedResource] | Unset): + data (list['CommunicationsGroupsResponseDataItem']): + links (Union[Unset, Links]): + meta (Union[Unset, Meta]): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[CommunicationsGroupsResponseDataItem] - links: Links | Unset = UNSET - meta: Meta | Unset = UNSET - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["CommunicationsGroupsResponseDataItem"] + links: Union[Unset, "Links"] = UNSET + meta: Union[Unset, "Meta"] = UNSET + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() data.append(data_item) - links: dict[str, Any] | Unset = UNSET + links: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.links, Unset): links = self.links.to_dict() - meta: dict[str, Any] | Unset = UNSET + meta: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.meta, Unset): meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -88,27 +85,25 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data.append(data_item) _links = d.pop("links", UNSET) - links: Links | Unset + links: Union[Unset, Links] if isinstance(_links, Unset): links = UNSET else: links = Links.from_dict(_links) _meta = d.pop("meta", UNSET) - meta: Meta | Unset + meta: Union[Unset, Meta] if isinstance(_meta, Unset): meta = UNSET else: meta = Meta.from_dict(_meta) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) communications_groups_response = cls( data=data, diff --git a/rootly_sdk/models/communications_groups_response_data_item.py b/rootly_sdk/models/communications_groups_response_data_item.py index 9aa6b3cd..137cf52e 100644 --- a/rootly_sdk/models/communications_groups_response_data_item.py +++ b/rootly_sdk/models/communications_groups_response_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class CommunicationsGroupsResponseDataItem: id: str type_: CommunicationsGroupsResponseDataItemType - attributes: CommunicationsGroup + attributes: "CommunicationsGroup" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/communications_stage.py b/rootly_sdk/models/communications_stage.py index a32faca1..382def07 100644 --- a/rootly_sdk/models/communications_stage.py +++ b/rootly_sdk/models/communications_stage.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,25 +14,25 @@ class CommunicationsStage: """ Attributes: name (str): The name of the communications stage - position (int | None): Position of the communications stage + position (Union[None, int]): Position of the communications stage created_at (str): Date of creation updated_at (str): Date of last update - slug (str | Unset): The slug of the communications stage - description (None | str | Unset): The description of the communications stage + slug (Union[Unset, str]): The slug of the communications stage + description (Union[None, Unset, str]): The description of the communications stage """ name: str - position: int | None + position: Union[None, int] created_at: str updated_at: str - slug: str | Unset = UNSET - description: None | str | Unset = UNSET + slug: Union[Unset, str] = UNSET + description: Union[None, Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: name = self.name - position: int | None + position: Union[None, int] position = self.position created_at = self.created_at @@ -43,7 +41,7 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - description: None | str | Unset + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: @@ -71,10 +69,10 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name") - def _parse_position(data: object) -> int | None: + def _parse_position(data: object) -> Union[None, int]: if data is None: return data - return cast(int | None, data) + return cast(Union[None, int], data) position = _parse_position(d.pop("position")) @@ -84,12 +82,12 @@ def _parse_position(data: object) -> int | None: slug = d.pop("slug", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) diff --git a/rootly_sdk/models/communications_stage_response.py b/rootly_sdk/models/communications_stage_response.py index 4fd84073..5516fdae 100644 --- a/rootly_sdk/models/communications_stage_response.py +++ b/rootly_sdk/models/communications_stage_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,18 +19,17 @@ class CommunicationsStageResponse: """ Attributes: data (CommunicationsStageResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: CommunicationsStageResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "CommunicationsStageResponseData" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = CommunicationsStageResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) communications_stage_response = cls( data=data, diff --git a/rootly_sdk/models/communications_stage_response_data.py b/rootly_sdk/models/communications_stage_response_data.py index 740ecf53..e1c9d1b4 100644 --- a/rootly_sdk/models/communications_stage_response_data.py +++ b/rootly_sdk/models/communications_stage_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class CommunicationsStageResponseData: id: str type_: CommunicationsStageResponseDataType - attributes: CommunicationsStage + attributes: "CommunicationsStage" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/communications_stages_response.py b/rootly_sdk/models/communications_stages_response.py index bc18ddc2..4ac096f5 100644 --- a/rootly_sdk/models/communications_stages_response.py +++ b/rootly_sdk/models/communications_stages_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,34 +20,33 @@ class CommunicationsStagesResponse: """ Attributes: - data (list[CommunicationsStagesResponseDataItem]): - links (Links | Unset): - meta (Meta | Unset): - included (list[JsonapiIncludedResource] | Unset): + data (list['CommunicationsStagesResponseDataItem']): + links (Union[Unset, Links]): + meta (Union[Unset, Meta]): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[CommunicationsStagesResponseDataItem] - links: Links | Unset = UNSET - meta: Meta | Unset = UNSET - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["CommunicationsStagesResponseDataItem"] + links: Union[Unset, "Links"] = UNSET + meta: Union[Unset, "Meta"] = UNSET + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() data.append(data_item) - links: dict[str, Any] | Unset = UNSET + links: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.links, Unset): links = self.links.to_dict() - meta: dict[str, Any] | Unset = UNSET + meta: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.meta, Unset): meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -88,27 +85,25 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data.append(data_item) _links = d.pop("links", UNSET) - links: Links | Unset + links: Union[Unset, Links] if isinstance(_links, Unset): links = UNSET else: links = Links.from_dict(_links) _meta = d.pop("meta", UNSET) - meta: Meta | Unset + meta: Union[Unset, Meta] if isinstance(_meta, Unset): meta = UNSET else: meta = Meta.from_dict(_meta) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) communications_stages_response = cls( data=data, diff --git a/rootly_sdk/models/communications_stages_response_data_item.py b/rootly_sdk/models/communications_stages_response_data_item.py index 08d91cc3..97a69037 100644 --- a/rootly_sdk/models/communications_stages_response_data_item.py +++ b/rootly_sdk/models/communications_stages_response_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class CommunicationsStagesResponseDataItem: id: str type_: CommunicationsStagesResponseDataItemType - attributes: CommunicationsStage + attributes: "CommunicationsStage" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/communications_template.py b/rootly_sdk/models/communications_template.py index 6e9b9007..9e24305c 100644 --- a/rootly_sdk/models/communications_template.py +++ b/rootly_sdk/models/communications_template.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,35 +21,34 @@ class CommunicationsTemplate: """ Attributes: name (str): The name of the communications template - position (int | None): Position of the communications template + position (Union[None, int]): Position of the communications template created_at (str): Date of creation updated_at (str): Date of last update - slug (str | Unset): The slug of the communications template - description (None | str | Unset): The description of the communications template - communication_type_id (str | Unset): The communication type ID - communication_template_stages (list[CommunicationsTemplateCommunicationTemplateStagesType0Item] | None | Unset): - Communication template stages - communication_type (CommunicationsTemplateCommunicationType | Unset): + slug (Union[Unset, str]): The slug of the communications template + description (Union[None, Unset, str]): The description of the communications template + communication_type_id (Union[Unset, str]): The communication type ID + communication_template_stages (Union[None, Unset, + list['CommunicationsTemplateCommunicationTemplateStagesType0Item']]): Communication template stages + communication_type (Union[Unset, CommunicationsTemplateCommunicationType]): """ name: str - position: int | None + position: Union[None, int] created_at: str updated_at: str - slug: str | Unset = UNSET - description: None | str | Unset = UNSET - communication_type_id: str | Unset = UNSET - communication_template_stages: list[CommunicationsTemplateCommunicationTemplateStagesType0Item] | None | Unset = ( - UNSET - ) - communication_type: CommunicationsTemplateCommunicationType | Unset = UNSET + slug: Union[Unset, str] = UNSET + description: Union[None, Unset, str] = UNSET + communication_type_id: Union[Unset, str] = UNSET + communication_template_stages: Union[ + None, Unset, list["CommunicationsTemplateCommunicationTemplateStagesType0Item"] + ] = UNSET + communication_type: Union[Unset, "CommunicationsTemplateCommunicationType"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - name = self.name - position: int | None + position: Union[None, int] position = self.position created_at = self.created_at @@ -60,7 +57,7 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - description: None | str | Unset + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: @@ -68,7 +65,7 @@ def to_dict(self) -> dict[str, Any]: communication_type_id = self.communication_type_id - communication_template_stages: list[dict[str, Any]] | None | Unset + communication_template_stages: Union[None, Unset, list[dict[str, Any]]] if isinstance(self.communication_template_stages, Unset): communication_template_stages = UNSET elif isinstance(self.communication_template_stages, list): @@ -80,7 +77,7 @@ def to_dict(self) -> dict[str, Any]: else: communication_template_stages = self.communication_template_stages - communication_type: dict[str, Any] | Unset = UNSET + communication_type: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.communication_type, Unset): communication_type = self.communication_type.to_dict() @@ -117,10 +114,10 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name") - def _parse_position(data: object) -> int | None: + def _parse_position(data: object) -> Union[None, int]: if data is None: return data - return cast(int | None, data) + return cast(Union[None, int], data) position = _parse_position(d.pop("position")) @@ -130,12 +127,12 @@ def _parse_position(data: object) -> int | None: slug = d.pop("slug", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) @@ -143,7 +140,7 @@ def _parse_description(data: object) -> None | str | Unset: def _parse_communication_template_stages( data: object, - ) -> list[CommunicationsTemplateCommunicationTemplateStagesType0Item] | None | Unset: + ) -> Union[None, Unset, list["CommunicationsTemplateCommunicationTemplateStagesType0Item"]]: if data is None: return data if isinstance(data, Unset): @@ -163,16 +160,16 @@ def _parse_communication_template_stages( communication_template_stages_type_0.append(communication_template_stages_type_0_item) return communication_template_stages_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[CommunicationsTemplateCommunicationTemplateStagesType0Item] | None | Unset, data) + return cast(Union[None, Unset, list["CommunicationsTemplateCommunicationTemplateStagesType0Item"]], data) communication_template_stages = _parse_communication_template_stages( d.pop("communication_template_stages", UNSET) ) _communication_type = d.pop("communication_type", UNSET) - communication_type: CommunicationsTemplateCommunicationType | Unset + communication_type: Union[Unset, CommunicationsTemplateCommunicationType] if isinstance(_communication_type, Unset): communication_type = UNSET else: diff --git a/rootly_sdk/models/communications_template_communication_template_stages_type_0_item.py b/rootly_sdk/models/communications_template_communication_template_stages_type_0_item.py index 1d8c4f18..634f7c75 100644 --- a/rootly_sdk/models/communications_template_communication_template_stages_type_0_item.py +++ b/rootly_sdk/models/communications_template_communication_template_stages_type_0_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,15 +19,14 @@ class CommunicationsTemplateCommunicationTemplateStagesType0Item: """ Attributes: - data (CommunicationsTemplateCommunicationTemplateStagesType0ItemData | Unset): + data (Union[Unset, CommunicationsTemplateCommunicationTemplateStagesType0ItemData]): """ - data: CommunicationsTemplateCommunicationTemplateStagesType0ItemData | Unset = UNSET + data: Union[Unset, "CommunicationsTemplateCommunicationTemplateStagesType0ItemData"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - - data: dict[str, Any] | Unset = UNSET + data: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.data, Unset): data = self.data.to_dict() @@ -49,7 +46,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _data = d.pop("data", UNSET) - data: CommunicationsTemplateCommunicationTemplateStagesType0ItemData | Unset + data: Union[Unset, CommunicationsTemplateCommunicationTemplateStagesType0ItemData] if isinstance(_data, Unset): data = UNSET else: diff --git a/rootly_sdk/models/communications_template_communication_template_stages_type_0_item_data.py b/rootly_sdk/models/communications_template_communication_template_stages_type_0_item_data.py index 0999ec29..2fb45e5e 100644 --- a/rootly_sdk/models/communications_template_communication_template_stages_type_0_item_data.py +++ b/rootly_sdk/models/communications_template_communication_template_stages_type_0_item_data.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -25,25 +23,24 @@ class CommunicationsTemplateCommunicationTemplateStagesType0ItemData: """ Attributes: - id (str | Unset): ID of the communication template stage - type_ (CommunicationsTemplateCommunicationTemplateStagesType0ItemDataType | Unset): - attributes (CommunicationsTemplateCommunicationTemplateStagesType0ItemDataAttributes | Unset): + id (Union[Unset, str]): ID of the communication template stage + type_ (Union[Unset, CommunicationsTemplateCommunicationTemplateStagesType0ItemDataType]): + attributes (Union[Unset, CommunicationsTemplateCommunicationTemplateStagesType0ItemDataAttributes]): """ - id: str | Unset = UNSET - type_: CommunicationsTemplateCommunicationTemplateStagesType0ItemDataType | Unset = UNSET - attributes: CommunicationsTemplateCommunicationTemplateStagesType0ItemDataAttributes | Unset = UNSET + id: Union[Unset, str] = UNSET + type_: Union[Unset, CommunicationsTemplateCommunicationTemplateStagesType0ItemDataType] = UNSET + attributes: Union[Unset, "CommunicationsTemplateCommunicationTemplateStagesType0ItemDataAttributes"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id - type_: str | Unset = UNSET + type_: Union[Unset, str] = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ - attributes: dict[str, Any] | Unset = UNSET + attributes: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.attributes, Unset): attributes = self.attributes.to_dict() @@ -69,14 +66,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: id = d.pop("id", UNSET) _type_ = d.pop("type", UNSET) - type_: CommunicationsTemplateCommunicationTemplateStagesType0ItemDataType | Unset + type_: Union[Unset, CommunicationsTemplateCommunicationTemplateStagesType0ItemDataType] if isinstance(_type_, Unset): type_ = UNSET else: type_ = check_communications_template_communication_template_stages_type_0_item_data_type(_type_) _attributes = d.pop("attributes", UNSET) - attributes: CommunicationsTemplateCommunicationTemplateStagesType0ItemDataAttributes | Unset + attributes: Union[Unset, CommunicationsTemplateCommunicationTemplateStagesType0ItemDataAttributes] if isinstance(_attributes, Unset): attributes = UNSET else: diff --git a/rootly_sdk/models/communications_template_communication_template_stages_type_0_item_data_attributes.py b/rootly_sdk/models/communications_template_communication_template_stages_type_0_item_data_attributes.py index 1d91175b..fd0747c1 100644 --- a/rootly_sdk/models/communications_template_communication_template_stages_type_0_item_data_attributes.py +++ b/rootly_sdk/models/communications_template_communication_template_stages_type_0_item_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -24,53 +22,52 @@ class CommunicationsTemplateCommunicationTemplateStagesType0ItemDataAttributes: """ Attributes: - email_body (None | str | Unset): Email body for the stage - email_subject (None | str | Unset): Email subject for the stage - slack_content (None | str | Unset): Slack content for the stage - sms_content (None | str | Unset): SMS content for the stage - created_at (str | Unset): Date of creation - updated_at (str | Unset): Date of last update - communication_stage (CommunicationsTemplateCommunicationTemplateStagesType0ItemDataAttributesCommunicationStage - | Unset): - communication_template - (CommunicationsTemplateCommunicationTemplateStagesType0ItemDataAttributesCommunicationTemplate | Unset): + email_body (Union[None, Unset, str]): Email body for the stage + email_subject (Union[None, Unset, str]): Email subject for the stage + slack_content (Union[None, Unset, str]): Slack content for the stage + sms_content (Union[None, Unset, str]): SMS content for the stage + created_at (Union[Unset, str]): Date of creation + updated_at (Union[Unset, str]): Date of last update + communication_stage (Union[Unset, + CommunicationsTemplateCommunicationTemplateStagesType0ItemDataAttributesCommunicationStage]): + communication_template (Union[Unset, + CommunicationsTemplateCommunicationTemplateStagesType0ItemDataAttributesCommunicationTemplate]): """ - email_body: None | str | Unset = UNSET - email_subject: None | str | Unset = UNSET - slack_content: None | str | Unset = UNSET - sms_content: None | str | Unset = UNSET - created_at: str | Unset = UNSET - updated_at: str | Unset = UNSET - communication_stage: ( - CommunicationsTemplateCommunicationTemplateStagesType0ItemDataAttributesCommunicationStage | Unset - ) = UNSET - communication_template: ( - CommunicationsTemplateCommunicationTemplateStagesType0ItemDataAttributesCommunicationTemplate | Unset - ) = UNSET + email_body: Union[None, Unset, str] = UNSET + email_subject: Union[None, Unset, str] = UNSET + slack_content: Union[None, Unset, str] = UNSET + sms_content: Union[None, Unset, str] = UNSET + created_at: Union[Unset, str] = UNSET + updated_at: Union[Unset, str] = UNSET + communication_stage: Union[ + Unset, "CommunicationsTemplateCommunicationTemplateStagesType0ItemDataAttributesCommunicationStage" + ] = UNSET + communication_template: Union[ + Unset, "CommunicationsTemplateCommunicationTemplateStagesType0ItemDataAttributesCommunicationTemplate" + ] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - - email_body: None | str | Unset + email_body: Union[None, Unset, str] if isinstance(self.email_body, Unset): email_body = UNSET else: email_body = self.email_body - email_subject: None | str | Unset + email_subject: Union[None, Unset, str] if isinstance(self.email_subject, Unset): email_subject = UNSET else: email_subject = self.email_subject - slack_content: None | str | Unset + slack_content: Union[None, Unset, str] if isinstance(self.slack_content, Unset): slack_content = UNSET else: slack_content = self.slack_content - sms_content: None | str | Unset + sms_content: Union[None, Unset, str] if isinstance(self.sms_content, Unset): sms_content = UNSET else: @@ -80,11 +77,11 @@ def to_dict(self) -> dict[str, Any]: updated_at = self.updated_at - communication_stage: dict[str, Any] | Unset = UNSET + communication_stage: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.communication_stage, Unset): communication_stage = self.communication_stage.to_dict() - communication_template: dict[str, Any] | Unset = UNSET + communication_template: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.communication_template, Unset): communication_template = self.communication_template.to_dict() @@ -121,39 +118,39 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_email_body(data: object) -> None | str | Unset: + def _parse_email_body(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) email_body = _parse_email_body(d.pop("email_body", UNSET)) - def _parse_email_subject(data: object) -> None | str | Unset: + def _parse_email_subject(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) email_subject = _parse_email_subject(d.pop("email_subject", UNSET)) - def _parse_slack_content(data: object) -> None | str | Unset: + def _parse_slack_content(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) slack_content = _parse_slack_content(d.pop("slack_content", UNSET)) - def _parse_sms_content(data: object) -> None | str | Unset: + def _parse_sms_content(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) sms_content = _parse_sms_content(d.pop("sms_content", UNSET)) @@ -162,9 +159,9 @@ def _parse_sms_content(data: object) -> None | str | Unset: updated_at = d.pop("updated_at", UNSET) _communication_stage = d.pop("communication_stage", UNSET) - communication_stage: ( - CommunicationsTemplateCommunicationTemplateStagesType0ItemDataAttributesCommunicationStage | Unset - ) + communication_stage: Union[ + Unset, CommunicationsTemplateCommunicationTemplateStagesType0ItemDataAttributesCommunicationStage + ] if isinstance(_communication_stage, Unset): communication_stage = UNSET else: @@ -175,9 +172,9 @@ def _parse_sms_content(data: object) -> None | str | Unset: ) _communication_template = d.pop("communication_template", UNSET) - communication_template: ( - CommunicationsTemplateCommunicationTemplateStagesType0ItemDataAttributesCommunicationTemplate | Unset - ) + communication_template: Union[ + Unset, CommunicationsTemplateCommunicationTemplateStagesType0ItemDataAttributesCommunicationTemplate + ] if isinstance(_communication_template, Unset): communication_template = UNSET else: diff --git a/rootly_sdk/models/communications_template_communication_template_stages_type_0_item_data_attributes_communication_stage.py b/rootly_sdk/models/communications_template_communication_template_stages_type_0_item_data_attributes_communication_stage.py index 9d3a2edc..f2358dc8 100644 --- a/rootly_sdk/models/communications_template_communication_template_stages_type_0_item_data_attributes_communication_stage.py +++ b/rootly_sdk/models/communications_template_communication_template_stages_type_0_item_data_attributes_communication_stage.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class CommunicationsTemplateCommunicationTemplateStagesType0ItemDataAttributesCommunicationStage: """ Attributes: - id (str | Unset): The communication stage ID - name (str | Unset): The communication stage name + id (Union[Unset, str]): The communication stage ID + name (Union[Unset, str]): The communication stage name """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/communications_template_communication_template_stages_type_0_item_data_attributes_communication_template.py b/rootly_sdk/models/communications_template_communication_template_stages_type_0_item_data_attributes_communication_template.py index b490ec24..85785e5a 100644 --- a/rootly_sdk/models/communications_template_communication_template_stages_type_0_item_data_attributes_communication_template.py +++ b/rootly_sdk/models/communications_template_communication_template_stages_type_0_item_data_attributes_communication_template.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class CommunicationsTemplateCommunicationTemplateStagesType0ItemDataAttributesCommunicationTemplate: """ Attributes: - id (str | Unset): The communication template ID - name (str | Unset): The communication template name + id (Union[Unset, str]): The communication template ID + name (Union[Unset, str]): The communication template name """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/communications_template_communication_type.py b/rootly_sdk/models/communications_template_communication_type.py index c4b73f8c..378fbce7 100644 --- a/rootly_sdk/models/communications_template_communication_type.py +++ b/rootly_sdk/models/communications_template_communication_type.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class CommunicationsTemplateCommunicationType: """ Attributes: - id (str | Unset): ID of the communication type - name (str | Unset): Name of the communication type + id (Union[Unset, str]): ID of the communication type + name (Union[Unset, str]): Name of the communication type """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/communications_template_response.py b/rootly_sdk/models/communications_template_response.py index ad97411a..25b39d3b 100644 --- a/rootly_sdk/models/communications_template_response.py +++ b/rootly_sdk/models/communications_template_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,18 +19,17 @@ class CommunicationsTemplateResponse: """ Attributes: data (CommunicationsTemplateResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: CommunicationsTemplateResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "CommunicationsTemplateResponseData" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = CommunicationsTemplateResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) communications_template_response = cls( data=data, diff --git a/rootly_sdk/models/communications_template_response_data.py b/rootly_sdk/models/communications_template_response_data.py index a5f60679..26697651 100644 --- a/rootly_sdk/models/communications_template_response_data.py +++ b/rootly_sdk/models/communications_template_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class CommunicationsTemplateResponseData: id: str type_: CommunicationsTemplateResponseDataType - attributes: CommunicationsTemplate + attributes: "CommunicationsTemplate" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/communications_templates_response.py b/rootly_sdk/models/communications_templates_response.py index c8d4f769..2752f2ac 100644 --- a/rootly_sdk/models/communications_templates_response.py +++ b/rootly_sdk/models/communications_templates_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,34 +20,33 @@ class CommunicationsTemplatesResponse: """ Attributes: - data (list[CommunicationsTemplatesResponseDataItem]): - links (Links | Unset): - meta (Meta | Unset): - included (list[JsonapiIncludedResource] | Unset): + data (list['CommunicationsTemplatesResponseDataItem']): + links (Union[Unset, Links]): + meta (Union[Unset, Meta]): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[CommunicationsTemplatesResponseDataItem] - links: Links | Unset = UNSET - meta: Meta | Unset = UNSET - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["CommunicationsTemplatesResponseDataItem"] + links: Union[Unset, "Links"] = UNSET + meta: Union[Unset, "Meta"] = UNSET + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() data.append(data_item) - links: dict[str, Any] | Unset = UNSET + links: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.links, Unset): links = self.links.to_dict() - meta: dict[str, Any] | Unset = UNSET + meta: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.meta, Unset): meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -88,27 +85,25 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data.append(data_item) _links = d.pop("links", UNSET) - links: Links | Unset + links: Union[Unset, Links] if isinstance(_links, Unset): links = UNSET else: links = Links.from_dict(_links) _meta = d.pop("meta", UNSET) - meta: Meta | Unset + meta: Union[Unset, Meta] if isinstance(_meta, Unset): meta = UNSET else: meta = Meta.from_dict(_meta) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) communications_templates_response = cls( data=data, diff --git a/rootly_sdk/models/communications_templates_response_data_item.py b/rootly_sdk/models/communications_templates_response_data_item.py index 1c42e544..f3bcaee6 100644 --- a/rootly_sdk/models/communications_templates_response_data_item.py +++ b/rootly_sdk/models/communications_templates_response_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class CommunicationsTemplatesResponseDataItem: id: str type_: CommunicationsTemplatesResponseDataItemType - attributes: CommunicationsTemplate + attributes: "CommunicationsTemplate" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/communications_type.py b/rootly_sdk/models/communications_type.py index 0323e1ec..a88f17ed 100644 --- a/rootly_sdk/models/communications_type.py +++ b/rootly_sdk/models/communications_type.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,27 +14,27 @@ class CommunicationsType: """ Attributes: name (str): The name of the communications type - color (None | str): The color of the communications type + color (Union[None, str]): The color of the communications type position (int): Position of the communications type created_at (str): Date of creation updated_at (str): Date of last update - slug (str | Unset): The slug of the communications type - description (None | str | Unset): The description of the communications type + slug (Union[Unset, str]): The slug of the communications type + description (Union[None, Unset, str]): The description of the communications type """ name: str - color: None | str + color: Union[None, str] position: int created_at: str updated_at: str - slug: str | Unset = UNSET - description: None | str | Unset = UNSET + slug: Union[Unset, str] = UNSET + description: Union[None, Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: name = self.name - color: None | str + color: Union[None, str] color = self.color position = self.position @@ -47,7 +45,7 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - description: None | str | Unset + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: @@ -76,10 +74,10 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name") - def _parse_color(data: object) -> None | str: + def _parse_color(data: object) -> Union[None, str]: if data is None: return data - return cast(None | str, data) + return cast(Union[None, str], data) color = _parse_color(d.pop("color")) @@ -91,12 +89,12 @@ def _parse_color(data: object) -> None | str: slug = d.pop("slug", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) diff --git a/rootly_sdk/models/communications_type_response.py b/rootly_sdk/models/communications_type_response.py index 87a0439a..6d66bbd1 100644 --- a/rootly_sdk/models/communications_type_response.py +++ b/rootly_sdk/models/communications_type_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,18 +19,17 @@ class CommunicationsTypeResponse: """ Attributes: data (CommunicationsTypeResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: CommunicationsTypeResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "CommunicationsTypeResponseData" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = CommunicationsTypeResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) communications_type_response = cls( data=data, diff --git a/rootly_sdk/models/communications_type_response_data.py b/rootly_sdk/models/communications_type_response_data.py index f37e6746..9d97ff64 100644 --- a/rootly_sdk/models/communications_type_response_data.py +++ b/rootly_sdk/models/communications_type_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class CommunicationsTypeResponseData: id: str type_: CommunicationsTypeResponseDataType - attributes: CommunicationsType + attributes: "CommunicationsType" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/communications_types_response.py b/rootly_sdk/models/communications_types_response.py index adbf3c58..90e27b65 100644 --- a/rootly_sdk/models/communications_types_response.py +++ b/rootly_sdk/models/communications_types_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,34 +20,33 @@ class CommunicationsTypesResponse: """ Attributes: - data (list[CommunicationsTypesResponseDataItem]): - links (Links | Unset): - meta (Meta | Unset): - included (list[JsonapiIncludedResource] | Unset): + data (list['CommunicationsTypesResponseDataItem']): + links (Union[Unset, Links]): + meta (Union[Unset, Meta]): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[CommunicationsTypesResponseDataItem] - links: Links | Unset = UNSET - meta: Meta | Unset = UNSET - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["CommunicationsTypesResponseDataItem"] + links: Union[Unset, "Links"] = UNSET + meta: Union[Unset, "Meta"] = UNSET + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() data.append(data_item) - links: dict[str, Any] | Unset = UNSET + links: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.links, Unset): links = self.links.to_dict() - meta: dict[str, Any] | Unset = UNSET + meta: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.meta, Unset): meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -88,27 +85,25 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data.append(data_item) _links = d.pop("links", UNSET) - links: Links | Unset + links: Union[Unset, Links] if isinstance(_links, Unset): links = UNSET else: links = Links.from_dict(_links) _meta = d.pop("meta", UNSET) - meta: Meta | Unset + meta: Union[Unset, Meta] if isinstance(_meta, Unset): meta = UNSET else: meta = Meta.from_dict(_meta) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) communications_types_response = cls( data=data, diff --git a/rootly_sdk/models/communications_types_response_data_item.py b/rootly_sdk/models/communications_types_response_data_item.py index 21bd7214..ad9a0474 100644 --- a/rootly_sdk/models/communications_types_response_data_item.py +++ b/rootly_sdk/models/communications_types_response_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class CommunicationsTypesResponseDataItem: id: str type_: CommunicationsTypesResponseDataItemType - attributes: CommunicationsType + attributes: "CommunicationsType" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/create_airtable_table_record_task_params.py b/rootly_sdk/models/create_airtable_table_record_task_params.py index 61670f3d..785636ba 100644 --- a/rootly_sdk/models/create_airtable_table_record_task_params.py +++ b/rootly_sdk/models/create_airtable_table_record_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -26,28 +24,27 @@ class CreateAirtableTableRecordTaskParams: Attributes: base (CreateAirtableTableRecordTaskParamsBase): table (CreateAirtableTableRecordTaskParamsTable): - task_type (CreateAirtableTableRecordTaskParamsTaskType | Unset): - custom_fields_mapping (None | str | Unset): Custom field mappings. Can contain liquid markup and need to be + task_type (Union[Unset, CreateAirtableTableRecordTaskParamsTaskType]): + custom_fields_mapping (Union[None, Unset, str]): Custom field mappings. Can contain liquid markup and need to be valid JSON """ - base: CreateAirtableTableRecordTaskParamsBase - table: CreateAirtableTableRecordTaskParamsTable - task_type: CreateAirtableTableRecordTaskParamsTaskType | Unset = UNSET - custom_fields_mapping: None | str | Unset = UNSET + base: "CreateAirtableTableRecordTaskParamsBase" + table: "CreateAirtableTableRecordTaskParamsTable" + task_type: Union[Unset, CreateAirtableTableRecordTaskParamsTaskType] = UNSET + custom_fields_mapping: Union[None, Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - base = self.base.to_dict() table = self.table.to_dict() - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - custom_fields_mapping: None | str | Unset + custom_fields_mapping: Union[None, Unset, str] if isinstance(self.custom_fields_mapping, Unset): custom_fields_mapping = UNSET else: @@ -79,18 +76,18 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: table = CreateAirtableTableRecordTaskParamsTable.from_dict(d.pop("table")) _task_type = d.pop("task_type", UNSET) - task_type: CreateAirtableTableRecordTaskParamsTaskType | Unset + task_type: Union[Unset, CreateAirtableTableRecordTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: task_type = check_create_airtable_table_record_task_params_task_type(_task_type) - def _parse_custom_fields_mapping(data: object) -> None | str | Unset: + def _parse_custom_fields_mapping(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) custom_fields_mapping = _parse_custom_fields_mapping(d.pop("custom_fields_mapping", UNSET)) diff --git a/rootly_sdk/models/create_airtable_table_record_task_params_base.py b/rootly_sdk/models/create_airtable_table_record_task_params_base.py index f8402d23..8b2ad465 100644 --- a/rootly_sdk/models/create_airtable_table_record_task_params_base.py +++ b/rootly_sdk/models/create_airtable_table_record_task_params_base.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class CreateAirtableTableRecordTaskParamsBase: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_airtable_table_record_task_params_table.py b/rootly_sdk/models/create_airtable_table_record_task_params_table.py index dc5d3a10..81734370 100644 --- a/rootly_sdk/models/create_airtable_table_record_task_params_table.py +++ b/rootly_sdk/models/create_airtable_table_record_task_params_table.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class CreateAirtableTableRecordTaskParamsTable: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_anthropic_chat_completion_task_params.py b/rootly_sdk/models/create_anthropic_chat_completion_task_params.py index fe2527e4..f8d4ea44 100644 --- a/rootly_sdk/models/create_anthropic_chat_completion_task_params.py +++ b/rootly_sdk/models/create_anthropic_chat_completion_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -25,28 +23,31 @@ class CreateAnthropicChatCompletionTaskParams: Attributes: model (CreateAnthropicChatCompletionTaskParamsModel): The Anthropic model. eg: claude-3-5-sonnet-20241022 prompt (str): The prompt to send to Anthropic - task_type (CreateAnthropicChatCompletionTaskParamsTaskType | Unset): - system_prompt (str | Unset): The system prompt to send to Anthropic (optional) + task_type (Union[Unset, CreateAnthropicChatCompletionTaskParamsTaskType]): + system_prompt (Union[Unset, str]): The system prompt to send to Anthropic (optional) + max_tokens (Union[Unset, int]): Maximum number of tokens to generate. Defaults to 4000 when omitted """ - model: CreateAnthropicChatCompletionTaskParamsModel + model: "CreateAnthropicChatCompletionTaskParamsModel" prompt: str - task_type: CreateAnthropicChatCompletionTaskParamsTaskType | Unset = UNSET - system_prompt: str | Unset = UNSET + task_type: Union[Unset, CreateAnthropicChatCompletionTaskParamsTaskType] = UNSET + system_prompt: Union[Unset, str] = UNSET + max_tokens: Union[Unset, int] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - model = self.model.to_dict() prompt = self.prompt - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type system_prompt = self.system_prompt + max_tokens = self.max_tokens + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update( @@ -59,6 +60,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["task_type"] = task_type if system_prompt is not UNSET: field_dict["system_prompt"] = system_prompt + if max_tokens is not UNSET: + field_dict["max_tokens"] = max_tokens return field_dict @@ -74,7 +77,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: prompt = d.pop("prompt") _task_type = d.pop("task_type", UNSET) - task_type: CreateAnthropicChatCompletionTaskParamsTaskType | Unset + task_type: Union[Unset, CreateAnthropicChatCompletionTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: @@ -82,11 +85,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: system_prompt = d.pop("system_prompt", UNSET) + max_tokens = d.pop("max_tokens", UNSET) + create_anthropic_chat_completion_task_params = cls( model=model, prompt=prompt, task_type=task_type, system_prompt=system_prompt, + max_tokens=max_tokens, ) create_anthropic_chat_completion_task_params.additional_properties = d diff --git a/rootly_sdk/models/create_anthropic_chat_completion_task_params_model.py b/rootly_sdk/models/create_anthropic_chat_completion_task_params_model.py index 0d5723dd..9e0ee37b 100644 --- a/rootly_sdk/models/create_anthropic_chat_completion_task_params_model.py +++ b/rootly_sdk/models/create_anthropic_chat_completion_task_params_model.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,12 +14,12 @@ class CreateAnthropicChatCompletionTaskParamsModel: """The Anthropic model. eg: claude-3-5-sonnet-20241022 Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_asana_subtask_task_params.py b/rootly_sdk/models/create_asana_subtask_task_params.py index 3c379f45..8169a7a5 100644 --- a/rootly_sdk/models/create_asana_subtask_task_params.py +++ b/rootly_sdk/models/create_asana_subtask_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -30,37 +28,36 @@ class CreateAsanaSubtaskTaskParams: parent_task_id (str): The parent task id title (str): The subtask title completion (CreateAsanaSubtaskTaskParamsCompletion): - task_type (CreateAsanaSubtaskTaskParamsTaskType | Unset): - notes (str | Unset): - assign_user_email (str | Unset): The assigned user's email - due_date (str | Unset): The due date - custom_fields_mapping (None | str | Unset): Custom field mappings. Can contain liquid markup and need to be + task_type (Union[Unset, CreateAsanaSubtaskTaskParamsTaskType]): + notes (Union[Unset, str]): + assign_user_email (Union[Unset, str]): The assigned user's email + due_date (Union[Unset, str]): The due date + custom_fields_mapping (Union[None, Unset, str]): Custom field mappings. Can contain liquid markup and need to be valid JSON - dependency_direction (CreateAsanaSubtaskTaskParamsDependencyDirection | Unset): Default: 'blocking'. - dependent_task_ids (list[str] | None | Unset): Dependent task ids. Supports liquid syntax + dependency_direction (Union[Unset, CreateAsanaSubtaskTaskParamsDependencyDirection]): Default: 'blocking'. + dependent_task_ids (Union[None, Unset, list[str]]): Dependent task ids. Supports liquid syntax """ parent_task_id: str title: str - completion: CreateAsanaSubtaskTaskParamsCompletion - task_type: CreateAsanaSubtaskTaskParamsTaskType | Unset = UNSET - notes: str | Unset = UNSET - assign_user_email: str | Unset = UNSET - due_date: str | Unset = UNSET - custom_fields_mapping: None | str | Unset = UNSET - dependency_direction: CreateAsanaSubtaskTaskParamsDependencyDirection | Unset = "blocking" - dependent_task_ids: list[str] | None | Unset = UNSET + completion: "CreateAsanaSubtaskTaskParamsCompletion" + task_type: Union[Unset, CreateAsanaSubtaskTaskParamsTaskType] = UNSET + notes: Union[Unset, str] = UNSET + assign_user_email: Union[Unset, str] = UNSET + due_date: Union[Unset, str] = UNSET + custom_fields_mapping: Union[None, Unset, str] = UNSET + dependency_direction: Union[Unset, CreateAsanaSubtaskTaskParamsDependencyDirection] = "blocking" + dependent_task_ids: Union[None, Unset, list[str]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - parent_task_id = self.parent_task_id title = self.title completion = self.completion.to_dict() - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -70,17 +67,17 @@ def to_dict(self) -> dict[str, Any]: due_date = self.due_date - custom_fields_mapping: None | str | Unset + custom_fields_mapping: Union[None, Unset, str] if isinstance(self.custom_fields_mapping, Unset): custom_fields_mapping = UNSET else: custom_fields_mapping = self.custom_fields_mapping - dependency_direction: str | Unset = UNSET + dependency_direction: Union[Unset, str] = UNSET if not isinstance(self.dependency_direction, Unset): dependency_direction = self.dependency_direction - dependent_task_ids: list[str] | None | Unset + dependent_task_ids: Union[None, Unset, list[str]] if isinstance(self.dependent_task_ids, Unset): dependent_task_ids = UNSET elif isinstance(self.dependent_task_ids, list): @@ -127,7 +124,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: completion = CreateAsanaSubtaskTaskParamsCompletion.from_dict(d.pop("completion")) _task_type = d.pop("task_type", UNSET) - task_type: CreateAsanaSubtaskTaskParamsTaskType | Unset + task_type: Union[Unset, CreateAsanaSubtaskTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: @@ -139,23 +136,23 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: due_date = d.pop("due_date", UNSET) - def _parse_custom_fields_mapping(data: object) -> None | str | Unset: + def _parse_custom_fields_mapping(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) custom_fields_mapping = _parse_custom_fields_mapping(d.pop("custom_fields_mapping", UNSET)) _dependency_direction = d.pop("dependency_direction", UNSET) - dependency_direction: CreateAsanaSubtaskTaskParamsDependencyDirection | Unset + dependency_direction: Union[Unset, CreateAsanaSubtaskTaskParamsDependencyDirection] if isinstance(_dependency_direction, Unset): dependency_direction = UNSET else: dependency_direction = check_create_asana_subtask_task_params_dependency_direction(_dependency_direction) - def _parse_dependent_task_ids(data: object) -> list[str] | None | Unset: + def _parse_dependent_task_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -166,9 +163,9 @@ def _parse_dependent_task_ids(data: object) -> list[str] | None | Unset: dependent_task_ids_type_0 = cast(list[str], data) return dependent_task_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) dependent_task_ids = _parse_dependent_task_ids(d.pop("dependent_task_ids", UNSET)) diff --git a/rootly_sdk/models/create_asana_subtask_task_params_completion.py b/rootly_sdk/models/create_asana_subtask_task_params_completion.py index 1bd94c1d..0bc64c50 100644 --- a/rootly_sdk/models/create_asana_subtask_task_params_completion.py +++ b/rootly_sdk/models/create_asana_subtask_task_params_completion.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class CreateAsanaSubtaskTaskParamsCompletion: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_asana_task_task_params.py b/rootly_sdk/models/create_asana_task_task_params.py index 173324ea..75072a50 100644 --- a/rootly_sdk/models/create_asana_task_task_params.py +++ b/rootly_sdk/models/create_asana_task_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -30,34 +28,33 @@ class CreateAsanaTaskTaskParams: """ Attributes: workspace (CreateAsanaTaskTaskParamsWorkspace): - projects (list[CreateAsanaTaskTaskParamsProjectsItem]): + projects (list['CreateAsanaTaskTaskParamsProjectsItem']): title (str): The task title completion (CreateAsanaTaskTaskParamsCompletion): - task_type (CreateAsanaTaskTaskParamsTaskType | Unset): - notes (str | Unset): - assign_user_email (str | Unset): The assigned user's email - due_date (str | Unset): The due date - custom_fields_mapping (None | str | Unset): Custom field mappings. Can contain liquid markup and need to be + task_type (Union[Unset, CreateAsanaTaskTaskParamsTaskType]): + notes (Union[Unset, str]): + assign_user_email (Union[Unset, str]): The assigned user's email + due_date (Union[Unset, str]): The due date + custom_fields_mapping (Union[None, Unset, str]): Custom field mappings. Can contain liquid markup and need to be valid JSON - dependency_direction (CreateAsanaTaskTaskParamsDependencyDirection | Unset): Default: 'blocking'. - dependent_task_ids (list[str] | None | Unset): Dependent task ids. Supports liquid syntax + dependency_direction (Union[Unset, CreateAsanaTaskTaskParamsDependencyDirection]): Default: 'blocking'. + dependent_task_ids (Union[None, Unset, list[str]]): Dependent task ids. Supports liquid syntax """ - workspace: CreateAsanaTaskTaskParamsWorkspace - projects: list[CreateAsanaTaskTaskParamsProjectsItem] + workspace: "CreateAsanaTaskTaskParamsWorkspace" + projects: list["CreateAsanaTaskTaskParamsProjectsItem"] title: str - completion: CreateAsanaTaskTaskParamsCompletion - task_type: CreateAsanaTaskTaskParamsTaskType | Unset = UNSET - notes: str | Unset = UNSET - assign_user_email: str | Unset = UNSET - due_date: str | Unset = UNSET - custom_fields_mapping: None | str | Unset = UNSET - dependency_direction: CreateAsanaTaskTaskParamsDependencyDirection | Unset = "blocking" - dependent_task_ids: list[str] | None | Unset = UNSET + completion: "CreateAsanaTaskTaskParamsCompletion" + task_type: Union[Unset, CreateAsanaTaskTaskParamsTaskType] = UNSET + notes: Union[Unset, str] = UNSET + assign_user_email: Union[Unset, str] = UNSET + due_date: Union[Unset, str] = UNSET + custom_fields_mapping: Union[None, Unset, str] = UNSET + dependency_direction: Union[Unset, CreateAsanaTaskTaskParamsDependencyDirection] = "blocking" + dependent_task_ids: Union[None, Unset, list[str]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - workspace = self.workspace.to_dict() projects = [] @@ -69,7 +66,7 @@ def to_dict(self) -> dict[str, Any]: completion = self.completion.to_dict() - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -79,17 +76,17 @@ def to_dict(self) -> dict[str, Any]: due_date = self.due_date - custom_fields_mapping: None | str | Unset + custom_fields_mapping: Union[None, Unset, str] if isinstance(self.custom_fields_mapping, Unset): custom_fields_mapping = UNSET else: custom_fields_mapping = self.custom_fields_mapping - dependency_direction: str | Unset = UNSET + dependency_direction: Union[Unset, str] = UNSET if not isinstance(self.dependency_direction, Unset): dependency_direction = self.dependency_direction - dependent_task_ids: list[str] | None | Unset + dependent_task_ids: Union[None, Unset, list[str]] if isinstance(self.dependent_task_ids, Unset): dependent_task_ids = UNSET elif isinstance(self.dependent_task_ids, list): @@ -146,7 +143,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: completion = CreateAsanaTaskTaskParamsCompletion.from_dict(d.pop("completion")) _task_type = d.pop("task_type", UNSET) - task_type: CreateAsanaTaskTaskParamsTaskType | Unset + task_type: Union[Unset, CreateAsanaTaskTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: @@ -158,23 +155,23 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: due_date = d.pop("due_date", UNSET) - def _parse_custom_fields_mapping(data: object) -> None | str | Unset: + def _parse_custom_fields_mapping(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) custom_fields_mapping = _parse_custom_fields_mapping(d.pop("custom_fields_mapping", UNSET)) _dependency_direction = d.pop("dependency_direction", UNSET) - dependency_direction: CreateAsanaTaskTaskParamsDependencyDirection | Unset + dependency_direction: Union[Unset, CreateAsanaTaskTaskParamsDependencyDirection] if isinstance(_dependency_direction, Unset): dependency_direction = UNSET else: dependency_direction = check_create_asana_task_task_params_dependency_direction(_dependency_direction) - def _parse_dependent_task_ids(data: object) -> list[str] | None | Unset: + def _parse_dependent_task_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -185,9 +182,9 @@ def _parse_dependent_task_ids(data: object) -> list[str] | None | Unset: dependent_task_ids_type_0 = cast(list[str], data) return dependent_task_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) dependent_task_ids = _parse_dependent_task_ids(d.pop("dependent_task_ids", UNSET)) diff --git a/rootly_sdk/models/create_asana_task_task_params_completion.py b/rootly_sdk/models/create_asana_task_task_params_completion.py index 11ef1e82..4eb25b2e 100644 --- a/rootly_sdk/models/create_asana_task_task_params_completion.py +++ b/rootly_sdk/models/create_asana_task_task_params_completion.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class CreateAsanaTaskTaskParamsCompletion: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_asana_task_task_params_projects_item.py b/rootly_sdk/models/create_asana_task_task_params_projects_item.py index 41cafec6..5f2be515 100644 --- a/rootly_sdk/models/create_asana_task_task_params_projects_item.py +++ b/rootly_sdk/models/create_asana_task_task_params_projects_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class CreateAsanaTaskTaskParamsProjectsItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_asana_task_task_params_workspace.py b/rootly_sdk/models/create_asana_task_task_params_workspace.py index 4359c902..093f7965 100644 --- a/rootly_sdk/models/create_asana_task_task_params_workspace.py +++ b/rootly_sdk/models/create_asana_task_task_params_workspace.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class CreateAsanaTaskTaskParamsWorkspace: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_clickup_task_task_params.py b/rootly_sdk/models/create_clickup_task_task_params.py index 9231249b..0492b38a 100644 --- a/rootly_sdk/models/create_clickup_task_task_params.py +++ b/rootly_sdk/models/create_clickup_task_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -13,6 +11,7 @@ from ..types import UNSET, Unset if TYPE_CHECKING: + from ..models.create_clickup_task_task_params_list import CreateClickupTaskTaskParamsList from ..models.create_clickup_task_task_params_priority import CreateClickupTaskTaskParamsPriority @@ -24,32 +23,35 @@ class CreateClickupTaskTaskParams: """ Attributes: title (str): The task title - task_type (CreateClickupTaskTaskParamsTaskType | Unset): - description (str | Unset): The task description - tags (str | Unset): The task tags - priority (CreateClickupTaskTaskParamsPriority | Unset): The priority id and display name - due_date (str | Unset): The due date - custom_fields_mapping (None | str | Unset): Custom field mappings. Can contain liquid markup and need to be + list_ (CreateClickupTaskTaskParamsList): + task_type (Union[Unset, CreateClickupTaskTaskParamsTaskType]): + description (Union[Unset, str]): The task description + tags (Union[Unset, str]): The task tags + priority (Union[Unset, CreateClickupTaskTaskParamsPriority]): The priority id and display name + due_date (Union[Unset, str]): The due date + custom_fields_mapping (Union[None, Unset, str]): Custom field mappings. Can contain liquid markup and need to be valid JSON - task_payload (None | str | Unset): Additional ClickUp task attributes. Will be merged into whatever was + task_payload (Union[None, Unset, str]): Additional ClickUp task attributes. Will be merged into whatever was specified in this tasks current parameters. Can contain liquid markup and need to be valid JSON """ title: str - task_type: CreateClickupTaskTaskParamsTaskType | Unset = UNSET - description: str | Unset = UNSET - tags: str | Unset = UNSET - priority: CreateClickupTaskTaskParamsPriority | Unset = UNSET - due_date: str | Unset = UNSET - custom_fields_mapping: None | str | Unset = UNSET - task_payload: None | str | Unset = UNSET + list_: "CreateClickupTaskTaskParamsList" + task_type: Union[Unset, CreateClickupTaskTaskParamsTaskType] = UNSET + description: Union[Unset, str] = UNSET + tags: Union[Unset, str] = UNSET + priority: Union[Unset, "CreateClickupTaskTaskParamsPriority"] = UNSET + due_date: Union[Unset, str] = UNSET + custom_fields_mapping: Union[None, Unset, str] = UNSET + task_payload: Union[None, Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - title = self.title - task_type: str | Unset = UNSET + list_ = self.list_.to_dict() + + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -57,19 +59,19 @@ def to_dict(self) -> dict[str, Any]: tags = self.tags - priority: dict[str, Any] | Unset = UNSET + priority: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.priority, Unset): priority = self.priority.to_dict() due_date = self.due_date - custom_fields_mapping: None | str | Unset + custom_fields_mapping: Union[None, Unset, str] if isinstance(self.custom_fields_mapping, Unset): custom_fields_mapping = UNSET else: custom_fields_mapping = self.custom_fields_mapping - task_payload: None | str | Unset + task_payload: Union[None, Unset, str] if isinstance(self.task_payload, Unset): task_payload = UNSET else: @@ -80,6 +82,7 @@ def to_dict(self) -> dict[str, Any]: field_dict.update( { "title": title, + "list": list_, } ) if task_type is not UNSET: @@ -101,13 +104,16 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.create_clickup_task_task_params_list import CreateClickupTaskTaskParamsList from ..models.create_clickup_task_task_params_priority import CreateClickupTaskTaskParamsPriority d = dict(src_dict) title = d.pop("title") + list_ = CreateClickupTaskTaskParamsList.from_dict(d.pop("list")) + _task_type = d.pop("task_type", UNSET) - task_type: CreateClickupTaskTaskParamsTaskType | Unset + task_type: Union[Unset, CreateClickupTaskTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: @@ -118,7 +124,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: tags = d.pop("tags", UNSET) _priority = d.pop("priority", UNSET) - priority: CreateClickupTaskTaskParamsPriority | Unset + priority: Union[Unset, CreateClickupTaskTaskParamsPriority] if isinstance(_priority, Unset): priority = UNSET else: @@ -126,26 +132,27 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: due_date = d.pop("due_date", UNSET) - def _parse_custom_fields_mapping(data: object) -> None | str | Unset: + def _parse_custom_fields_mapping(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) custom_fields_mapping = _parse_custom_fields_mapping(d.pop("custom_fields_mapping", UNSET)) - def _parse_task_payload(data: object) -> None | str | Unset: + def _parse_task_payload(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) task_payload = _parse_task_payload(d.pop("task_payload", UNSET)) create_clickup_task_task_params = cls( title=title, + list_=list_, task_type=task_type, description=description, tags=tags, diff --git a/rootly_sdk/models/auto_assign_role_rootly_task_params_user_target.py b/rootly_sdk/models/create_clickup_task_task_params_list.py similarity index 73% rename from rootly_sdk/models/auto_assign_role_rootly_task_params_user_target.py rename to rootly_sdk/models/create_clickup_task_task_params_list.py index e0a79a33..3209c0d3 100644 --- a/rootly_sdk/models/auto_assign_role_rootly_task_params_user_target.py +++ b/rootly_sdk/models/create_clickup_task_task_params_list.py @@ -1,26 +1,24 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field from ..types import UNSET, Unset -T = TypeVar("T", bound="AutoAssignRoleRootlyTaskParamsUserTarget") +T = TypeVar("T", bound="CreateClickupTaskTaskParamsList") @_attrs_define -class AutoAssignRoleRootlyTaskParamsUserTarget: +class CreateClickupTaskTaskParamsList: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -45,13 +43,13 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name = d.pop("name", UNSET) - auto_assign_role_rootly_task_params_user_target = cls( + create_clickup_task_task_params_list = cls( id=id, name=name, ) - auto_assign_role_rootly_task_params_user_target.additional_properties = d - return auto_assign_role_rootly_task_params_user_target + create_clickup_task_task_params_list.additional_properties = d + return create_clickup_task_task_params_list @property def additional_keys(self) -> list[str]: diff --git a/rootly_sdk/models/create_clickup_task_task_params_priority.py b/rootly_sdk/models/create_clickup_task_task_params_priority.py index 34e2271a..b3be24f2 100644 --- a/rootly_sdk/models/create_clickup_task_task_params_priority.py +++ b/rootly_sdk/models/create_clickup_task_task_params_priority.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,12 +14,12 @@ class CreateClickupTaskTaskParamsPriority: """The priority id and display name Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_coda_page_task_params.py b/rootly_sdk/models/create_coda_page_task_params.py index 4d8fb030..ce57ae23 100644 --- a/rootly_sdk/models/create_coda_page_task_params.py +++ b/rootly_sdk/models/create_coda_page_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -25,32 +23,31 @@ class CreateCodaPageTaskParams: """ Attributes: title (str): The Coda page title - task_type (CreateCodaPageTaskParamsTaskType | Unset): - post_mortem_template_id (str | Unset): Retrospective template to use when creating page, if desired - mark_post_mortem_as_published (bool | Unset): Default: True. - subtitle (str | Unset): The Coda page subtitle - content (str | Unset): The Coda page content - template (CreateCodaPageTaskParamsTemplate | Unset): - folder_id (str | Unset): The Coda folder id - doc (CreateCodaPageTaskParamsDoc | Unset): The Coda doc object with id and name + task_type (Union[Unset, CreateCodaPageTaskParamsTaskType]): + post_mortem_template_id (Union[Unset, str]): Retrospective template to use when creating page, if desired + mark_post_mortem_as_published (Union[Unset, bool]): Default: True. + subtitle (Union[Unset, str]): The Coda page subtitle + content (Union[Unset, str]): The Coda page content + template (Union[Unset, CreateCodaPageTaskParamsTemplate]): + folder_id (Union[Unset, str]): The Coda folder id + doc (Union[Unset, CreateCodaPageTaskParamsDoc]): The Coda doc object with id and name """ title: str - task_type: CreateCodaPageTaskParamsTaskType | Unset = UNSET - post_mortem_template_id: str | Unset = UNSET - mark_post_mortem_as_published: bool | Unset = True - subtitle: str | Unset = UNSET - content: str | Unset = UNSET - template: CreateCodaPageTaskParamsTemplate | Unset = UNSET - folder_id: str | Unset = UNSET - doc: CreateCodaPageTaskParamsDoc | Unset = UNSET + task_type: Union[Unset, CreateCodaPageTaskParamsTaskType] = UNSET + post_mortem_template_id: Union[Unset, str] = UNSET + mark_post_mortem_as_published: Union[Unset, bool] = True + subtitle: Union[Unset, str] = UNSET + content: Union[Unset, str] = UNSET + template: Union[Unset, "CreateCodaPageTaskParamsTemplate"] = UNSET + folder_id: Union[Unset, str] = UNSET + doc: Union[Unset, "CreateCodaPageTaskParamsDoc"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - title = self.title - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -62,13 +59,13 @@ def to_dict(self) -> dict[str, Any]: content = self.content - template: dict[str, Any] | Unset = UNSET + template: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.template, Unset): template = self.template.to_dict() folder_id = self.folder_id - doc: dict[str, Any] | Unset = UNSET + doc: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.doc, Unset): doc = self.doc.to_dict() @@ -107,7 +104,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: title = d.pop("title") _task_type = d.pop("task_type", UNSET) - task_type: CreateCodaPageTaskParamsTaskType | Unset + task_type: Union[Unset, CreateCodaPageTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: @@ -122,7 +119,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: content = d.pop("content", UNSET) _template = d.pop("template", UNSET) - template: CreateCodaPageTaskParamsTemplate | Unset + template: Union[Unset, CreateCodaPageTaskParamsTemplate] if isinstance(_template, Unset): template = UNSET else: @@ -131,7 +128,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: folder_id = d.pop("folder_id", UNSET) _doc = d.pop("doc", UNSET) - doc: CreateCodaPageTaskParamsDoc | Unset + doc: Union[Unset, CreateCodaPageTaskParamsDoc] if isinstance(_doc, Unset): doc = UNSET else: diff --git a/rootly_sdk/models/create_coda_page_task_params_doc.py b/rootly_sdk/models/create_coda_page_task_params_doc.py index ea0354bb..91641cb7 100644 --- a/rootly_sdk/models/create_coda_page_task_params_doc.py +++ b/rootly_sdk/models/create_coda_page_task_params_doc.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,12 +14,12 @@ class CreateCodaPageTaskParamsDoc: """The Coda doc object with id and name Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_coda_page_task_params_template.py b/rootly_sdk/models/create_coda_page_task_params_template.py index b2b94318..9e8ee330 100644 --- a/rootly_sdk/models/create_coda_page_task_params_template.py +++ b/rootly_sdk/models/create_coda_page_task_params_template.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class CreateCodaPageTaskParamsTemplate: """ Attributes: - id (str | Unset): Combined doc_id/page_id in format 'doc_id/page_id' - name (str | Unset): + id (Union[Unset, str]): Combined doc_id/page_id in format 'doc_id/page_id' + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_confluence_page_task_params.py b/rootly_sdk/models/create_confluence_page_task_params.py index f1cb980e..d0fb2267 100644 --- a/rootly_sdk/models/create_confluence_page_task_params.py +++ b/rootly_sdk/models/create_confluence_page_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -28,52 +26,53 @@ class CreateConfluencePageTaskParams: Attributes: space (CreateConfluencePageTaskParamsSpace): title (str): The page title - task_type (CreateConfluencePageTaskParamsTaskType | Unset): - integration (CreateConfluencePageTaskParamsIntegration | Unset): Specify integration id if you have more than - one Confluence instance - ancestor (CreateConfluencePageTaskParamsAncestor | Unset): - template (CreateConfluencePageTaskParamsTemplate | Unset): - content (str | Unset): The page content - post_mortem_template_id (str | Unset): The Retrospective template to use - mark_post_mortem_as_published (bool | Unset): Default: True. - include_overview (bool | Unset): Default: True. - include_timeline (bool | Unset): Default: True. - create_as_live_doc (bool | Unset): Default: False. + task_type (Union[Unset, CreateConfluencePageTaskParamsTaskType]): + integration (Union[Unset, CreateConfluencePageTaskParamsIntegration]): Specify integration id if you have more + than one Confluence instance + ancestor (Union[Unset, CreateConfluencePageTaskParamsAncestor]): + template (Union[Unset, CreateConfluencePageTaskParamsTemplate]): + content (Union[Unset, str]): The page content + post_mortem_template_id (Union[Unset, str]): The Retrospective template to use + mark_post_mortem_as_published (Union[Unset, bool]): Default: True. + include_overview (Union[Unset, bool]): Default: True. + include_timeline (Union[Unset, bool]): Default: True. + include_follow_ups (Union[Unset, bool]): Default: True. + create_as_live_doc (Union[Unset, bool]): Default: False. """ - space: CreateConfluencePageTaskParamsSpace + space: "CreateConfluencePageTaskParamsSpace" title: str - task_type: CreateConfluencePageTaskParamsTaskType | Unset = UNSET - integration: CreateConfluencePageTaskParamsIntegration | Unset = UNSET - ancestor: CreateConfluencePageTaskParamsAncestor | Unset = UNSET - template: CreateConfluencePageTaskParamsTemplate | Unset = UNSET - content: str | Unset = UNSET - post_mortem_template_id: str | Unset = UNSET - mark_post_mortem_as_published: bool | Unset = True - include_overview: bool | Unset = True - include_timeline: bool | Unset = True - create_as_live_doc: bool | Unset = False + task_type: Union[Unset, CreateConfluencePageTaskParamsTaskType] = UNSET + integration: Union[Unset, "CreateConfluencePageTaskParamsIntegration"] = UNSET + ancestor: Union[Unset, "CreateConfluencePageTaskParamsAncestor"] = UNSET + template: Union[Unset, "CreateConfluencePageTaskParamsTemplate"] = UNSET + content: Union[Unset, str] = UNSET + post_mortem_template_id: Union[Unset, str] = UNSET + mark_post_mortem_as_published: Union[Unset, bool] = True + include_overview: Union[Unset, bool] = True + include_timeline: Union[Unset, bool] = True + include_follow_ups: Union[Unset, bool] = True + create_as_live_doc: Union[Unset, bool] = False additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - space = self.space.to_dict() title = self.title - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - integration: dict[str, Any] | Unset = UNSET + integration: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.integration, Unset): integration = self.integration.to_dict() - ancestor: dict[str, Any] | Unset = UNSET + ancestor: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.ancestor, Unset): ancestor = self.ancestor.to_dict() - template: dict[str, Any] | Unset = UNSET + template: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.template, Unset): template = self.template.to_dict() @@ -87,6 +86,8 @@ def to_dict(self) -> dict[str, Any]: include_timeline = self.include_timeline + include_follow_ups = self.include_follow_ups + create_as_live_doc = self.create_as_live_doc field_dict: dict[str, Any] = {} @@ -115,6 +116,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["include_overview"] = include_overview if include_timeline is not UNSET: field_dict["include_timeline"] = include_timeline + if include_follow_ups is not UNSET: + field_dict["include_follow_ups"] = include_follow_ups if create_as_live_doc is not UNSET: field_dict["create_as_live_doc"] = create_as_live_doc @@ -133,28 +136,28 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: title = d.pop("title") _task_type = d.pop("task_type", UNSET) - task_type: CreateConfluencePageTaskParamsTaskType | Unset + task_type: Union[Unset, CreateConfluencePageTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: task_type = check_create_confluence_page_task_params_task_type(_task_type) _integration = d.pop("integration", UNSET) - integration: CreateConfluencePageTaskParamsIntegration | Unset + integration: Union[Unset, CreateConfluencePageTaskParamsIntegration] if isinstance(_integration, Unset): integration = UNSET else: integration = CreateConfluencePageTaskParamsIntegration.from_dict(_integration) _ancestor = d.pop("ancestor", UNSET) - ancestor: CreateConfluencePageTaskParamsAncestor | Unset + ancestor: Union[Unset, CreateConfluencePageTaskParamsAncestor] if isinstance(_ancestor, Unset): ancestor = UNSET else: ancestor = CreateConfluencePageTaskParamsAncestor.from_dict(_ancestor) _template = d.pop("template", UNSET) - template: CreateConfluencePageTaskParamsTemplate | Unset + template: Union[Unset, CreateConfluencePageTaskParamsTemplate] if isinstance(_template, Unset): template = UNSET else: @@ -170,6 +173,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: include_timeline = d.pop("include_timeline", UNSET) + include_follow_ups = d.pop("include_follow_ups", UNSET) + create_as_live_doc = d.pop("create_as_live_doc", UNSET) create_confluence_page_task_params = cls( @@ -184,6 +189,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: mark_post_mortem_as_published=mark_post_mortem_as_published, include_overview=include_overview, include_timeline=include_timeline, + include_follow_ups=include_follow_ups, create_as_live_doc=create_as_live_doc, ) diff --git a/rootly_sdk/models/create_confluence_page_task_params_ancestor.py b/rootly_sdk/models/create_confluence_page_task_params_ancestor.py index 2ce7713b..260cb027 100644 --- a/rootly_sdk/models/create_confluence_page_task_params_ancestor.py +++ b/rootly_sdk/models/create_confluence_page_task_params_ancestor.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class CreateConfluencePageTaskParamsAncestor: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_confluence_page_task_params_integration.py b/rootly_sdk/models/create_confluence_page_task_params_integration.py index 8414aaf5..e95f48a5 100644 --- a/rootly_sdk/models/create_confluence_page_task_params_integration.py +++ b/rootly_sdk/models/create_confluence_page_task_params_integration.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,12 +14,12 @@ class CreateConfluencePageTaskParamsIntegration: """Specify integration id if you have more than one Confluence instance Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_confluence_page_task_params_space.py b/rootly_sdk/models/create_confluence_page_task_params_space.py index a5ac23bd..7f25fa03 100644 --- a/rootly_sdk/models/create_confluence_page_task_params_space.py +++ b/rootly_sdk/models/create_confluence_page_task_params_space.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class CreateConfluencePageTaskParamsSpace: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_confluence_page_task_params_template.py b/rootly_sdk/models/create_confluence_page_task_params_template.py index 3c78e534..d64e94b4 100644 --- a/rootly_sdk/models/create_confluence_page_task_params_template.py +++ b/rootly_sdk/models/create_confluence_page_task_params_template.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class CreateConfluencePageTaskParamsTemplate: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_datadog_notebook_task_params.py b/rootly_sdk/models/create_datadog_notebook_task_params.py index 02c1c0ae..0d7cce7b 100644 --- a/rootly_sdk/models/create_datadog_notebook_task_params.py +++ b/rootly_sdk/models/create_datadog_notebook_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,29 +27,28 @@ class CreateDatadogNotebookTaskParams: Attributes: title (str): The notebook title kind (CreateDatadogNotebookTaskParamsKind): The notebook kind - task_type (CreateDatadogNotebookTaskParamsTaskType | Unset): - post_mortem_template_id (str | Unset): Retrospective template to use when creating notebook, if desired - mark_post_mortem_as_published (bool | Unset): Default: True. - template (CreateDatadogNotebookTaskParamsTemplate | Unset): - content (str | Unset): The notebook content + task_type (Union[Unset, CreateDatadogNotebookTaskParamsTaskType]): + post_mortem_template_id (Union[Unset, str]): Retrospective template to use when creating notebook, if desired + mark_post_mortem_as_published (Union[Unset, bool]): Default: True. + template (Union[Unset, CreateDatadogNotebookTaskParamsTemplate]): + content (Union[Unset, str]): The notebook content """ title: str kind: CreateDatadogNotebookTaskParamsKind - task_type: CreateDatadogNotebookTaskParamsTaskType | Unset = UNSET - post_mortem_template_id: str | Unset = UNSET - mark_post_mortem_as_published: bool | Unset = True - template: CreateDatadogNotebookTaskParamsTemplate | Unset = UNSET - content: str | Unset = UNSET + task_type: Union[Unset, CreateDatadogNotebookTaskParamsTaskType] = UNSET + post_mortem_template_id: Union[Unset, str] = UNSET + mark_post_mortem_as_published: Union[Unset, bool] = True + template: Union[Unset, "CreateDatadogNotebookTaskParamsTemplate"] = UNSET + content: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - title = self.title kind: str = self.kind - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -59,7 +56,7 @@ def to_dict(self) -> dict[str, Any]: mark_post_mortem_as_published = self.mark_post_mortem_as_published - template: dict[str, Any] | Unset = UNSET + template: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.template, Unset): template = self.template.to_dict() @@ -96,7 +93,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: kind = check_create_datadog_notebook_task_params_kind(d.pop("kind")) _task_type = d.pop("task_type", UNSET) - task_type: CreateDatadogNotebookTaskParamsTaskType | Unset + task_type: Union[Unset, CreateDatadogNotebookTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: @@ -107,7 +104,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: mark_post_mortem_as_published = d.pop("mark_post_mortem_as_published", UNSET) _template = d.pop("template", UNSET) - template: CreateDatadogNotebookTaskParamsTemplate | Unset + template: Union[Unset, CreateDatadogNotebookTaskParamsTemplate] if isinstance(_template, Unset): template = UNSET else: diff --git a/rootly_sdk/models/create_datadog_notebook_task_params_template.py b/rootly_sdk/models/create_datadog_notebook_task_params_template.py index 1ba885b5..c955dc8d 100644 --- a/rootly_sdk/models/create_datadog_notebook_task_params_template.py +++ b/rootly_sdk/models/create_datadog_notebook_task_params_template.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class CreateDatadogNotebookTaskParamsTemplate: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_dropbox_paper_page_task_params.py b/rootly_sdk/models/create_dropbox_paper_page_task_params.py index 415cf46f..c64407e9 100644 --- a/rootly_sdk/models/create_dropbox_paper_page_task_params.py +++ b/rootly_sdk/models/create_dropbox_paper_page_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -27,28 +25,27 @@ class CreateDropboxPaperPageTaskParams: """ Attributes: title (str): The page task title - task_type (CreateDropboxPaperPageTaskParamsTaskType | Unset): - post_mortem_template_id (str | Unset): Retrospective template to use when creating page task, if desired - mark_post_mortem_as_published (bool | Unset): Default: True. - content (str | Unset): The page content - namespace (CreateDropboxPaperPageTaskParamsNamespace | Unset): - parent_folder (CreateDropboxPaperPageTaskParamsParentFolder | Unset): + task_type (Union[Unset, CreateDropboxPaperPageTaskParamsTaskType]): + post_mortem_template_id (Union[Unset, str]): Retrospective template to use when creating page task, if desired + mark_post_mortem_as_published (Union[Unset, bool]): Default: True. + content (Union[Unset, str]): The page content + namespace (Union[Unset, CreateDropboxPaperPageTaskParamsNamespace]): + parent_folder (Union[Unset, CreateDropboxPaperPageTaskParamsParentFolder]): """ title: str - task_type: CreateDropboxPaperPageTaskParamsTaskType | Unset = UNSET - post_mortem_template_id: str | Unset = UNSET - mark_post_mortem_as_published: bool | Unset = True - content: str | Unset = UNSET - namespace: CreateDropboxPaperPageTaskParamsNamespace | Unset = UNSET - parent_folder: CreateDropboxPaperPageTaskParamsParentFolder | Unset = UNSET + task_type: Union[Unset, CreateDropboxPaperPageTaskParamsTaskType] = UNSET + post_mortem_template_id: Union[Unset, str] = UNSET + mark_post_mortem_as_published: Union[Unset, bool] = True + content: Union[Unset, str] = UNSET + namespace: Union[Unset, "CreateDropboxPaperPageTaskParamsNamespace"] = UNSET + parent_folder: Union[Unset, "CreateDropboxPaperPageTaskParamsParentFolder"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - title = self.title - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -58,11 +55,11 @@ def to_dict(self) -> dict[str, Any]: content = self.content - namespace: dict[str, Any] | Unset = UNSET + namespace: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.namespace, Unset): namespace = self.namespace.to_dict() - parent_folder: dict[str, Any] | Unset = UNSET + parent_folder: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.parent_folder, Unset): parent_folder = self.parent_folder.to_dict() @@ -99,7 +96,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: title = d.pop("title") _task_type = d.pop("task_type", UNSET) - task_type: CreateDropboxPaperPageTaskParamsTaskType | Unset + task_type: Union[Unset, CreateDropboxPaperPageTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: @@ -112,14 +109,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: content = d.pop("content", UNSET) _namespace = d.pop("namespace", UNSET) - namespace: CreateDropboxPaperPageTaskParamsNamespace | Unset + namespace: Union[Unset, CreateDropboxPaperPageTaskParamsNamespace] if isinstance(_namespace, Unset): namespace = UNSET else: namespace = CreateDropboxPaperPageTaskParamsNamespace.from_dict(_namespace) _parent_folder = d.pop("parent_folder", UNSET) - parent_folder: CreateDropboxPaperPageTaskParamsParentFolder | Unset + parent_folder: Union[Unset, CreateDropboxPaperPageTaskParamsParentFolder] if isinstance(_parent_folder, Unset): parent_folder = UNSET else: diff --git a/rootly_sdk/models/create_dropbox_paper_page_task_params_namespace.py b/rootly_sdk/models/create_dropbox_paper_page_task_params_namespace.py index 9a83f04b..dee14108 100644 --- a/rootly_sdk/models/create_dropbox_paper_page_task_params_namespace.py +++ b/rootly_sdk/models/create_dropbox_paper_page_task_params_namespace.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class CreateDropboxPaperPageTaskParamsNamespace: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_dropbox_paper_page_task_params_parent_folder.py b/rootly_sdk/models/create_dropbox_paper_page_task_params_parent_folder.py index 5c31099d..a0895b3d 100644 --- a/rootly_sdk/models/create_dropbox_paper_page_task_params_parent_folder.py +++ b/rootly_sdk/models/create_dropbox_paper_page_task_params_parent_folder.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class CreateDropboxPaperPageTaskParamsParentFolder: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_edge_connector_action_body.py b/rootly_sdk/models/create_edge_connector_action_body.py index 72e8c61c..b5e797c2 100644 --- a/rootly_sdk/models/create_edge_connector_action_body.py +++ b/rootly_sdk/models/create_edge_connector_action_body.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,15 +17,14 @@ class CreateEdgeConnectorActionBody: """ Attributes: - action (CreateEdgeConnectorActionBodyAction | Unset): + action (Union[Unset, CreateEdgeConnectorActionBodyAction]): """ - action: CreateEdgeConnectorActionBodyAction | Unset = UNSET + action: Union[Unset, "CreateEdgeConnectorActionBodyAction"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - - action: dict[str, Any] | Unset = UNSET + action: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.action, Unset): action = self.action.to_dict() @@ -45,7 +42,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _action = d.pop("action", UNSET) - action: CreateEdgeConnectorActionBodyAction | Unset + action: Union[Unset, CreateEdgeConnectorActionBodyAction] if isinstance(_action, Unset): action = UNSET else: diff --git a/rootly_sdk/models/create_edge_connector_action_body_action.py b/rootly_sdk/models/create_edge_connector_action_body_action.py index f8fedce0..9d221d36 100644 --- a/rootly_sdk/models/create_edge_connector_action_body_action.py +++ b/rootly_sdk/models/create_edge_connector_action_body_action.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -25,21 +23,20 @@ class CreateEdgeConnectorActionBodyAction: Attributes: name (str): Action name action_type (CreateEdgeConnectorActionBodyActionActionType): Action type - metadata (CreateEdgeConnectorActionBodyActionMetadata | Unset): + metadata (Union[Unset, CreateEdgeConnectorActionBodyActionMetadata]): """ name: str action_type: CreateEdgeConnectorActionBodyActionActionType - metadata: CreateEdgeConnectorActionBodyActionMetadata | Unset = UNSET + metadata: Union[Unset, "CreateEdgeConnectorActionBodyActionMetadata"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - name = self.name action_type: str = self.action_type - metadata: dict[str, Any] | Unset = UNSET + metadata: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.metadata, Unset): metadata = self.metadata.to_dict() @@ -68,7 +65,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: action_type = check_create_edge_connector_action_body_action_action_type(d.pop("action_type")) _metadata = d.pop("metadata", UNSET) - metadata: CreateEdgeConnectorActionBodyActionMetadata | Unset + metadata: Union[Unset, CreateEdgeConnectorActionBodyActionMetadata] if isinstance(_metadata, Unset): metadata = UNSET else: diff --git a/rootly_sdk/models/create_edge_connector_action_body_action_metadata.py b/rootly_sdk/models/create_edge_connector_action_body_action_metadata.py index 46132686..6bd6a469 100644 --- a/rootly_sdk/models/create_edge_connector_action_body_action_metadata.py +++ b/rootly_sdk/models/create_edge_connector_action_body_action_metadata.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,23 +19,22 @@ class CreateEdgeConnectorActionBodyActionMetadata: """ Attributes: - description (str | Unset): - timeout (int | Unset): - parameters (list[CreateEdgeConnectorActionBodyActionMetadataParametersItem] | Unset): + description (Union[Unset, str]): + timeout (Union[Unset, int]): + parameters (Union[Unset, list['CreateEdgeConnectorActionBodyActionMetadataParametersItem']]): """ - description: str | Unset = UNSET - timeout: int | Unset = UNSET - parameters: list[CreateEdgeConnectorActionBodyActionMetadataParametersItem] | Unset = UNSET + description: Union[Unset, str] = UNSET + timeout: Union[Unset, int] = UNSET + parameters: Union[Unset, list["CreateEdgeConnectorActionBodyActionMetadataParametersItem"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - description = self.description timeout = self.timeout - parameters: list[dict[str, Any]] | Unset = UNSET + parameters: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.parameters, Unset): parameters = [] for parameters_item_data in self.parameters: @@ -67,16 +64,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: timeout = d.pop("timeout", UNSET) + parameters = [] _parameters = d.pop("parameters", UNSET) - parameters: list[CreateEdgeConnectorActionBodyActionMetadataParametersItem] | Unset = UNSET - if _parameters is not UNSET: - parameters = [] - for parameters_item_data in _parameters: - parameters_item = CreateEdgeConnectorActionBodyActionMetadataParametersItem.from_dict( - parameters_item_data - ) + for parameters_item_data in _parameters or []: + parameters_item = CreateEdgeConnectorActionBodyActionMetadataParametersItem.from_dict(parameters_item_data) - parameters.append(parameters_item) + parameters.append(parameters_item) create_edge_connector_action_body_action_metadata = cls( description=description, diff --git a/rootly_sdk/models/create_edge_connector_action_body_action_metadata_parameters_item.py b/rootly_sdk/models/create_edge_connector_action_body_action_metadata_parameters_item.py index f6694bc1..888285ba 100644 --- a/rootly_sdk/models/create_edge_connector_action_body_action_metadata_parameters_item.py +++ b/rootly_sdk/models/create_edge_connector_action_body_action_metadata_parameters_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,24 +17,24 @@ class CreateEdgeConnectorActionBodyActionMetadataParametersItem: """ Attributes: - name (str | Unset): - type_ (CreateEdgeConnectorActionBodyActionMetadataParametersItemType | Unset): - required (bool | Unset): - description (str | Unset): - options (list[str] | Unset): + name (Union[Unset, str]): + type_ (Union[Unset, CreateEdgeConnectorActionBodyActionMetadataParametersItemType]): + required (Union[Unset, bool]): + description (Union[Unset, str]): + options (Union[Unset, list[str]]): """ - name: str | Unset = UNSET - type_: CreateEdgeConnectorActionBodyActionMetadataParametersItemType | Unset = UNSET - required: bool | Unset = UNSET - description: str | Unset = UNSET - options: list[str] | Unset = UNSET + name: Union[Unset, str] = UNSET + type_: Union[Unset, CreateEdgeConnectorActionBodyActionMetadataParametersItemType] = UNSET + required: Union[Unset, bool] = UNSET + description: Union[Unset, str] = UNSET + options: Union[Unset, list[str]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: name = self.name - type_: str | Unset = UNSET + type_: Union[Unset, str] = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ @@ -44,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: description = self.description - options: list[str] | Unset = UNSET + options: Union[Unset, list[str]] = UNSET if not isinstance(self.options, Unset): options = self.options @@ -70,7 +68,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name = d.pop("name", UNSET) _type_ = d.pop("type", UNSET) - type_: CreateEdgeConnectorActionBodyActionMetadataParametersItemType | Unset + type_: Union[Unset, CreateEdgeConnectorActionBodyActionMetadataParametersItemType] if isinstance(_type_, Unset): type_ = UNSET else: diff --git a/rootly_sdk/models/create_edge_connector_body.py b/rootly_sdk/models/create_edge_connector_body.py index 26b01395..d0719ab5 100644 --- a/rootly_sdk/models/create_edge_connector_body.py +++ b/rootly_sdk/models/create_edge_connector_body.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class CreateEdgeConnectorBody: data (CreateEdgeConnectorBodyData): """ - data: CreateEdgeConnectorBodyData + data: "CreateEdgeConnectorBodyData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/create_edge_connector_body_data.py b/rootly_sdk/models/create_edge_connector_body_data.py index a9d31183..744f7e51 100644 --- a/rootly_sdk/models/create_edge_connector_body_data.py +++ b/rootly_sdk/models/create_edge_connector_body_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class CreateEdgeConnectorBodyData: """ type_: CreateEdgeConnectorBodyDataType - attributes: CreateEdgeConnectorBodyDataAttributes + attributes: "CreateEdgeConnectorBodyDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/create_edge_connector_body_data_attributes.py b/rootly_sdk/models/create_edge_connector_body_data_attributes.py index 5731ed4c..9a08b8f0 100644 --- a/rootly_sdk/models/create_edge_connector_body_data_attributes.py +++ b/rootly_sdk/models/create_edge_connector_body_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -24,35 +22,34 @@ class CreateEdgeConnectorBodyDataAttributes: """ Attributes: name (str): Connector name - description (str | Unset): Connector description - status (CreateEdgeConnectorBodyDataAttributesStatus | Unset): Connector status - subscriptions (list[str] | Unset): Array of event types to subscribe to - filters (CreateEdgeConnectorBodyDataAttributesFilters | Unset): Event filters. OR within dimension, AND across - dimensions. + description (Union[Unset, str]): Connector description + status (Union[Unset, CreateEdgeConnectorBodyDataAttributesStatus]): Connector status + subscriptions (Union[Unset, list[str]]): Array of event types to subscribe to + filters (Union[Unset, CreateEdgeConnectorBodyDataAttributesFilters]): Event filters. OR within dimension, AND + across dimensions. """ name: str - description: str | Unset = UNSET - status: CreateEdgeConnectorBodyDataAttributesStatus | Unset = UNSET - subscriptions: list[str] | Unset = UNSET - filters: CreateEdgeConnectorBodyDataAttributesFilters | Unset = UNSET + description: Union[Unset, str] = UNSET + status: Union[Unset, CreateEdgeConnectorBodyDataAttributesStatus] = UNSET + subscriptions: Union[Unset, list[str]] = UNSET + filters: Union[Unset, "CreateEdgeConnectorBodyDataAttributesFilters"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - name = self.name description = self.description - status: str | Unset = UNSET + status: Union[Unset, str] = UNSET if not isinstance(self.status, Unset): status = self.status - subscriptions: list[str] | Unset = UNSET + subscriptions: Union[Unset, list[str]] = UNSET if not isinstance(self.subscriptions, Unset): subscriptions = self.subscriptions - filters: dict[str, Any] | Unset = UNSET + filters: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.filters, Unset): filters = self.filters.to_dict() @@ -86,7 +83,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: description = d.pop("description", UNSET) _status = d.pop("status", UNSET) - status: CreateEdgeConnectorBodyDataAttributesStatus | Unset + status: Union[Unset, CreateEdgeConnectorBodyDataAttributesStatus] if isinstance(_status, Unset): status = UNSET else: @@ -95,7 +92,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: subscriptions = cast(list[str], d.pop("subscriptions", UNSET)) _filters = d.pop("filters", UNSET) - filters: CreateEdgeConnectorBodyDataAttributesFilters | Unset + filters: Union[Unset, CreateEdgeConnectorBodyDataAttributesFilters] if isinstance(_filters, Unset): filters = UNSET else: diff --git a/rootly_sdk/models/create_edge_connector_body_data_attributes_filters.py b/rootly_sdk/models/create_edge_connector_body_data_attributes_filters.py index 14497423..aa4ee100 100644 --- a/rootly_sdk/models/create_edge_connector_body_data_attributes_filters.py +++ b/rootly_sdk/models/create_edge_connector_body_data_attributes_filters.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -15,31 +13,31 @@ class CreateEdgeConnectorBodyDataAttributesFilters: """Event filters. OR within dimension, AND across dimensions. Attributes: - group_ids (list[str] | Unset): Filter by group UUIDs - service_ids (list[str] | Unset): Filter by service UUIDs - environment_ids (list[str] | Unset): Filter by environment UUIDs - functionality_ids (list[str] | Unset): Filter by functionality UUIDs + group_ids (Union[Unset, list[str]]): Filter by group UUIDs + service_ids (Union[Unset, list[str]]): Filter by service UUIDs + environment_ids (Union[Unset, list[str]]): Filter by environment UUIDs + functionality_ids (Union[Unset, list[str]]): Filter by functionality UUIDs """ - group_ids: list[str] | Unset = UNSET - service_ids: list[str] | Unset = UNSET - environment_ids: list[str] | Unset = UNSET - functionality_ids: list[str] | Unset = UNSET + group_ids: Union[Unset, list[str]] = UNSET + service_ids: Union[Unset, list[str]] = UNSET + environment_ids: Union[Unset, list[str]] = UNSET + functionality_ids: Union[Unset, list[str]] = UNSET def to_dict(self) -> dict[str, Any]: - group_ids: list[str] | Unset = UNSET + group_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.group_ids, Unset): group_ids = self.group_ids - service_ids: list[str] | Unset = UNSET + service_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.service_ids, Unset): service_ids = self.service_ids - environment_ids: list[str] | Unset = UNSET + environment_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.environment_ids, Unset): environment_ids = self.environment_ids - functionality_ids: list[str] | Unset = UNSET + functionality_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.functionality_ids, Unset): functionality_ids = self.functionality_ids diff --git a/rootly_sdk/models/create_github_issue_task_params.py b/rootly_sdk/models/create_github_issue_task_params.py index 26f28b7a..089c633e 100644 --- a/rootly_sdk/models/create_github_issue_task_params.py +++ b/rootly_sdk/models/create_github_issue_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -27,55 +25,54 @@ class CreateGithubIssueTaskParams: Attributes: title (str): The issue title repository (CreateGithubIssueTaskParamsRepository): - task_type (CreateGithubIssueTaskParamsTaskType | Unset): - body (str | Unset): The issue body - labels (list[CreateGithubIssueTaskParamsLabelsItem] | Unset): The issue labels - issue_type (CreateGithubIssueTaskParamsIssueType | Unset): The issue type - parent_issue_number (None | str | Unset): The parent issue number for sub-issue linking - custom_fields_mapping (None | str | Unset): Custom field mappings. Can contain liquid markup and need to be + task_type (Union[Unset, CreateGithubIssueTaskParamsTaskType]): + body (Union[Unset, str]): The issue body + labels (Union[Unset, list['CreateGithubIssueTaskParamsLabelsItem']]): The issue labels + issue_type (Union[Unset, CreateGithubIssueTaskParamsIssueType]): The issue type + parent_issue_number (Union[None, Unset, str]): The parent issue number for sub-issue linking + custom_fields_mapping (Union[None, Unset, str]): Custom field mappings. Can contain liquid markup and need to be valid JSON """ title: str - repository: CreateGithubIssueTaskParamsRepository - task_type: CreateGithubIssueTaskParamsTaskType | Unset = UNSET - body: str | Unset = UNSET - labels: list[CreateGithubIssueTaskParamsLabelsItem] | Unset = UNSET - issue_type: CreateGithubIssueTaskParamsIssueType | Unset = UNSET - parent_issue_number: None | str | Unset = UNSET - custom_fields_mapping: None | str | Unset = UNSET + repository: "CreateGithubIssueTaskParamsRepository" + task_type: Union[Unset, CreateGithubIssueTaskParamsTaskType] = UNSET + body: Union[Unset, str] = UNSET + labels: Union[Unset, list["CreateGithubIssueTaskParamsLabelsItem"]] = UNSET + issue_type: Union[Unset, "CreateGithubIssueTaskParamsIssueType"] = UNSET + parent_issue_number: Union[None, Unset, str] = UNSET + custom_fields_mapping: Union[None, Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - title = self.title repository = self.repository.to_dict() - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type body = self.body - labels: list[dict[str, Any]] | Unset = UNSET + labels: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.labels, Unset): labels = [] for labels_item_data in self.labels: labels_item = labels_item_data.to_dict() labels.append(labels_item) - issue_type: dict[str, Any] | Unset = UNSET + issue_type: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.issue_type, Unset): issue_type = self.issue_type.to_dict() - parent_issue_number: None | str | Unset + parent_issue_number: Union[None, Unset, str] if isinstance(self.parent_issue_number, Unset): parent_issue_number = UNSET else: parent_issue_number = self.parent_issue_number - custom_fields_mapping: None | str | Unset + custom_fields_mapping: Union[None, Unset, str] if isinstance(self.custom_fields_mapping, Unset): custom_fields_mapping = UNSET else: @@ -116,7 +113,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: repository = CreateGithubIssueTaskParamsRepository.from_dict(d.pop("repository")) _task_type = d.pop("task_type", UNSET) - task_type: CreateGithubIssueTaskParamsTaskType | Unset + task_type: Union[Unset, CreateGithubIssueTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: @@ -124,37 +121,35 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: body = d.pop("body", UNSET) + labels = [] _labels = d.pop("labels", UNSET) - labels: list[CreateGithubIssueTaskParamsLabelsItem] | Unset = UNSET - if _labels is not UNSET: - labels = [] - for labels_item_data in _labels: - labels_item = CreateGithubIssueTaskParamsLabelsItem.from_dict(labels_item_data) + for labels_item_data in _labels or []: + labels_item = CreateGithubIssueTaskParamsLabelsItem.from_dict(labels_item_data) - labels.append(labels_item) + labels.append(labels_item) _issue_type = d.pop("issue_type", UNSET) - issue_type: CreateGithubIssueTaskParamsIssueType | Unset + issue_type: Union[Unset, CreateGithubIssueTaskParamsIssueType] if isinstance(_issue_type, Unset): issue_type = UNSET else: issue_type = CreateGithubIssueTaskParamsIssueType.from_dict(_issue_type) - def _parse_parent_issue_number(data: object) -> None | str | Unset: + def _parse_parent_issue_number(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) parent_issue_number = _parse_parent_issue_number(d.pop("parent_issue_number", UNSET)) - def _parse_custom_fields_mapping(data: object) -> None | str | Unset: + def _parse_custom_fields_mapping(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) custom_fields_mapping = _parse_custom_fields_mapping(d.pop("custom_fields_mapping", UNSET)) diff --git a/rootly_sdk/models/create_github_issue_task_params_issue_type.py b/rootly_sdk/models/create_github_issue_task_params_issue_type.py index 8dcdb1a0..d8204cb0 100644 --- a/rootly_sdk/models/create_github_issue_task_params_issue_type.py +++ b/rootly_sdk/models/create_github_issue_task_params_issue_type.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,12 +14,12 @@ class CreateGithubIssueTaskParamsIssueType: """The issue type Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_github_issue_task_params_labels_item.py b/rootly_sdk/models/create_github_issue_task_params_labels_item.py index ae8e2abb..46565784 100644 --- a/rootly_sdk/models/create_github_issue_task_params_labels_item.py +++ b/rootly_sdk/models/create_github_issue_task_params_labels_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class CreateGithubIssueTaskParamsLabelsItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_github_issue_task_params_repository.py b/rootly_sdk/models/create_github_issue_task_params_repository.py index a46c14d5..40a514c9 100644 --- a/rootly_sdk/models/create_github_issue_task_params_repository.py +++ b/rootly_sdk/models/create_github_issue_task_params_repository.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class CreateGithubIssueTaskParamsRepository: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_gitlab_issue_task_params.py b/rootly_sdk/models/create_gitlab_issue_task_params.py index f8d4741b..2d11062e 100644 --- a/rootly_sdk/models/create_gitlab_issue_task_params.py +++ b/rootly_sdk/models/create_gitlab_issue_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -27,38 +25,35 @@ class CreateGitlabIssueTaskParams: """ Attributes: + issue_type (CreateGitlabIssueTaskParamsIssueType): The issue type title (str): The issue title repository (CreateGitlabIssueTaskParamsRepository): - task_type (CreateGitlabIssueTaskParamsTaskType | Unset): - issue_type (CreateGitlabIssueTaskParamsIssueType | Unset): The issue type - description (str | Unset): The issue description - labels (str | Unset): The issue labels - due_date (str | Unset): The due date + task_type (Union[Unset, CreateGitlabIssueTaskParamsTaskType]): + description (Union[Unset, str]): The issue description + labels (Union[Unset, str]): The issue labels + due_date (Union[Unset, str]): The due date """ + issue_type: CreateGitlabIssueTaskParamsIssueType title: str - repository: CreateGitlabIssueTaskParamsRepository - task_type: CreateGitlabIssueTaskParamsTaskType | Unset = UNSET - issue_type: CreateGitlabIssueTaskParamsIssueType | Unset = UNSET - description: str | Unset = UNSET - labels: str | Unset = UNSET - due_date: str | Unset = UNSET + repository: "CreateGitlabIssueTaskParamsRepository" + task_type: Union[Unset, CreateGitlabIssueTaskParamsTaskType] = UNSET + description: Union[Unset, str] = UNSET + labels: Union[Unset, str] = UNSET + due_date: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + issue_type: str = self.issue_type title = self.title repository = self.repository.to_dict() - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - issue_type: str | Unset = UNSET - if not isinstance(self.issue_type, Unset): - issue_type = self.issue_type - description = self.description labels = self.labels @@ -69,14 +64,13 @@ def to_dict(self) -> dict[str, Any]: field_dict.update(self.additional_properties) field_dict.update( { + "issue_type": issue_type, "title": title, "repository": repository, } ) if task_type is not UNSET: field_dict["task_type"] = task_type - if issue_type is not UNSET: - field_dict["issue_type"] = issue_type if description is not UNSET: field_dict["description"] = description if labels is not UNSET: @@ -91,24 +85,19 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: from ..models.create_gitlab_issue_task_params_repository import CreateGitlabIssueTaskParamsRepository d = dict(src_dict) + issue_type = check_create_gitlab_issue_task_params_issue_type(d.pop("issue_type")) + title = d.pop("title") repository = CreateGitlabIssueTaskParamsRepository.from_dict(d.pop("repository")) _task_type = d.pop("task_type", UNSET) - task_type: CreateGitlabIssueTaskParamsTaskType | Unset + task_type: Union[Unset, CreateGitlabIssueTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: task_type = check_create_gitlab_issue_task_params_task_type(_task_type) - _issue_type = d.pop("issue_type", UNSET) - issue_type: CreateGitlabIssueTaskParamsIssueType | Unset - if isinstance(_issue_type, Unset): - issue_type = UNSET - else: - issue_type = check_create_gitlab_issue_task_params_issue_type(_issue_type) - description = d.pop("description", UNSET) labels = d.pop("labels", UNSET) @@ -116,10 +105,10 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: due_date = d.pop("due_date", UNSET) create_gitlab_issue_task_params = cls( + issue_type=issue_type, title=title, repository=repository, task_type=task_type, - issue_type=issue_type, description=description, labels=labels, due_date=due_date, diff --git a/rootly_sdk/models/create_gitlab_issue_task_params_repository.py b/rootly_sdk/models/create_gitlab_issue_task_params_repository.py index 4193b887..06470840 100644 --- a/rootly_sdk/models/create_gitlab_issue_task_params_repository.py +++ b/rootly_sdk/models/create_gitlab_issue_task_params_repository.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class CreateGitlabIssueTaskParamsRepository: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_go_to_meeting_task_params.py b/rootly_sdk/models/create_go_to_meeting_task_params.py index e2ffda6c..3189143e 100644 --- a/rootly_sdk/models/create_go_to_meeting_task_params.py +++ b/rootly_sdk/models/create_go_to_meeting_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -30,34 +28,34 @@ class CreateGoToMeetingTaskParams: """ Attributes: subject (str): The meeting subject - task_type (CreateGoToMeetingTaskParamsTaskType | Unset): - conference_call_info (CreateGoToMeetingTaskParamsConferenceCallInfo | Unset): Default: 'voip'. Example: voip. - password_required (bool | None | Unset): - post_to_incident_timeline (bool | Unset): - post_to_slack_channels (list[CreateGoToMeetingTaskParamsPostToSlackChannelsItem] | Unset): + task_type (Union[Unset, CreateGoToMeetingTaskParamsTaskType]): + conference_call_info (Union[Unset, CreateGoToMeetingTaskParamsConferenceCallInfo]): Default: 'voip'. Example: + voip. + password_required (Union[None, Unset, bool]): + post_to_incident_timeline (Union[Unset, bool]): + post_to_slack_channels (Union[Unset, list['CreateGoToMeetingTaskParamsPostToSlackChannelsItem']]): """ subject: str - task_type: CreateGoToMeetingTaskParamsTaskType | Unset = UNSET - conference_call_info: CreateGoToMeetingTaskParamsConferenceCallInfo | Unset = "voip" - password_required: bool | None | Unset = UNSET - post_to_incident_timeline: bool | Unset = UNSET - post_to_slack_channels: list[CreateGoToMeetingTaskParamsPostToSlackChannelsItem] | Unset = UNSET + task_type: Union[Unset, CreateGoToMeetingTaskParamsTaskType] = UNSET + conference_call_info: Union[Unset, CreateGoToMeetingTaskParamsConferenceCallInfo] = "voip" + password_required: Union[None, Unset, bool] = UNSET + post_to_incident_timeline: Union[Unset, bool] = UNSET + post_to_slack_channels: Union[Unset, list["CreateGoToMeetingTaskParamsPostToSlackChannelsItem"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - subject = self.subject - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - conference_call_info: str | Unset = UNSET + conference_call_info: Union[Unset, str] = UNSET if not isinstance(self.conference_call_info, Unset): conference_call_info = self.conference_call_info - password_required: bool | None | Unset + password_required: Union[None, Unset, bool] if isinstance(self.password_required, Unset): password_required = UNSET else: @@ -65,7 +63,7 @@ def to_dict(self) -> dict[str, Any]: post_to_incident_timeline = self.post_to_incident_timeline - post_to_slack_channels: list[dict[str, Any]] | Unset = UNSET + post_to_slack_channels: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.post_to_slack_channels, Unset): post_to_slack_channels = [] for post_to_slack_channels_item_data in self.post_to_slack_channels: @@ -102,40 +100,38 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: subject = d.pop("subject") _task_type = d.pop("task_type", UNSET) - task_type: CreateGoToMeetingTaskParamsTaskType | Unset + task_type: Union[Unset, CreateGoToMeetingTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: task_type = check_create_go_to_meeting_task_params_task_type(_task_type) _conference_call_info = d.pop("conference_call_info", UNSET) - conference_call_info: CreateGoToMeetingTaskParamsConferenceCallInfo | Unset + conference_call_info: Union[Unset, CreateGoToMeetingTaskParamsConferenceCallInfo] if isinstance(_conference_call_info, Unset): conference_call_info = UNSET else: conference_call_info = check_create_go_to_meeting_task_params_conference_call_info(_conference_call_info) - def _parse_password_required(data: object) -> bool | None | Unset: + def _parse_password_required(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) password_required = _parse_password_required(d.pop("password_required", UNSET)) post_to_incident_timeline = d.pop("post_to_incident_timeline", UNSET) + post_to_slack_channels = [] _post_to_slack_channels = d.pop("post_to_slack_channels", UNSET) - post_to_slack_channels: list[CreateGoToMeetingTaskParamsPostToSlackChannelsItem] | Unset = UNSET - if _post_to_slack_channels is not UNSET: - post_to_slack_channels = [] - for post_to_slack_channels_item_data in _post_to_slack_channels: - post_to_slack_channels_item = CreateGoToMeetingTaskParamsPostToSlackChannelsItem.from_dict( - post_to_slack_channels_item_data - ) + for post_to_slack_channels_item_data in _post_to_slack_channels or []: + post_to_slack_channels_item = CreateGoToMeetingTaskParamsPostToSlackChannelsItem.from_dict( + post_to_slack_channels_item_data + ) - post_to_slack_channels.append(post_to_slack_channels_item) + post_to_slack_channels.append(post_to_slack_channels_item) create_go_to_meeting_task_params = cls( subject=subject, diff --git a/rootly_sdk/models/create_go_to_meeting_task_params_post_to_slack_channels_item.py b/rootly_sdk/models/create_go_to_meeting_task_params_post_to_slack_channels_item.py index f666dea2..b1c4aa2d 100644 --- a/rootly_sdk/models/create_go_to_meeting_task_params_post_to_slack_channels_item.py +++ b/rootly_sdk/models/create_go_to_meeting_task_params_post_to_slack_channels_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class CreateGoToMeetingTaskParamsPostToSlackChannelsItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_google_calendar_event_task_params.py b/rootly_sdk/models/create_google_calendar_event_task_params.py index 0ea08aee..58677e57 100644 --- a/rootly_sdk/models/create_google_calendar_event_task_params.py +++ b/rootly_sdk/models/create_google_calendar_event_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -34,19 +32,19 @@ class CreateGoogleCalendarEventTaskParams: meeting_duration (str): Meeting duration in format like '1 hour', '30 minutes' Example: 1 hour. summary (str): The event summary description (str): The event description - task_type (CreateGoogleCalendarEventTaskParamsTaskType | Unset): - attendees (list[str] | Unset): Emails of attendees - time_zone (None | str | Unset): A valid IANA time zone name. - calendar_id (None | str | Unset): Default: 'primary'. - send_updates (bool | Unset): Send an email to the attendees notifying them of the event - can_guests_modify_event (bool | Unset): - can_guests_see_other_guests (bool | Unset): - can_guests_invite_others (bool | Unset): - exclude_weekends (bool | Unset): - conference_solution_key (CreateGoogleCalendarEventTaskParamsConferenceSolutionKey | Unset): Sets the video + task_type (Union[Unset, CreateGoogleCalendarEventTaskParamsTaskType]): + attendees (Union[Unset, list[str]]): Emails of attendees + time_zone (Union[None, Unset, str]): A valid IANA time zone name. + calendar_id (Union[None, Unset, str]): Default: 'primary'. + send_updates (Union[Unset, bool]): Send an email to the attendees notifying them of the event + can_guests_modify_event (Union[Unset, bool]): + can_guests_see_other_guests (Union[Unset, bool]): + can_guests_invite_others (Union[Unset, bool]): + exclude_weekends (Union[Unset, bool]): + conference_solution_key (Union[Unset, CreateGoogleCalendarEventTaskParamsConferenceSolutionKey]): Sets the video conference type attached to the meeting - post_to_incident_timeline (bool | Unset): - post_to_slack_channels (list[CreateGoogleCalendarEventTaskParamsPostToSlackChannelsItem] | Unset): + post_to_incident_timeline (Union[Unset, bool]): + post_to_slack_channels (Union[Unset, list['CreateGoogleCalendarEventTaskParamsPostToSlackChannelsItem']]): """ days_until_meeting: int @@ -54,22 +52,21 @@ class CreateGoogleCalendarEventTaskParams: meeting_duration: str summary: str description: str - task_type: CreateGoogleCalendarEventTaskParamsTaskType | Unset = UNSET - attendees: list[str] | Unset = UNSET - time_zone: None | str | Unset = UNSET - calendar_id: None | str | Unset = "primary" - send_updates: bool | Unset = UNSET - can_guests_modify_event: bool | Unset = UNSET - can_guests_see_other_guests: bool | Unset = UNSET - can_guests_invite_others: bool | Unset = UNSET - exclude_weekends: bool | Unset = UNSET - conference_solution_key: CreateGoogleCalendarEventTaskParamsConferenceSolutionKey | Unset = UNSET - post_to_incident_timeline: bool | Unset = UNSET - post_to_slack_channels: list[CreateGoogleCalendarEventTaskParamsPostToSlackChannelsItem] | Unset = UNSET + task_type: Union[Unset, CreateGoogleCalendarEventTaskParamsTaskType] = UNSET + attendees: Union[Unset, list[str]] = UNSET + time_zone: Union[None, Unset, str] = UNSET + calendar_id: Union[None, Unset, str] = "primary" + send_updates: Union[Unset, bool] = UNSET + can_guests_modify_event: Union[Unset, bool] = UNSET + can_guests_see_other_guests: Union[Unset, bool] = UNSET + can_guests_invite_others: Union[Unset, bool] = UNSET + exclude_weekends: Union[Unset, bool] = UNSET + conference_solution_key: Union[Unset, CreateGoogleCalendarEventTaskParamsConferenceSolutionKey] = UNSET + post_to_incident_timeline: Union[Unset, bool] = UNSET + post_to_slack_channels: Union[Unset, list["CreateGoogleCalendarEventTaskParamsPostToSlackChannelsItem"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - days_until_meeting = self.days_until_meeting time_of_meeting = self.time_of_meeting @@ -80,21 +77,21 @@ def to_dict(self) -> dict[str, Any]: description = self.description - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - attendees: list[str] | Unset = UNSET + attendees: Union[Unset, list[str]] = UNSET if not isinstance(self.attendees, Unset): attendees = self.attendees - time_zone: None | str | Unset + time_zone: Union[None, Unset, str] if isinstance(self.time_zone, Unset): time_zone = UNSET else: time_zone = self.time_zone - calendar_id: None | str | Unset + calendar_id: Union[None, Unset, str] if isinstance(self.calendar_id, Unset): calendar_id = UNSET else: @@ -110,13 +107,13 @@ def to_dict(self) -> dict[str, Any]: exclude_weekends = self.exclude_weekends - conference_solution_key: str | Unset = UNSET + conference_solution_key: Union[Unset, str] = UNSET if not isinstance(self.conference_solution_key, Unset): conference_solution_key = self.conference_solution_key post_to_incident_timeline = self.post_to_incident_timeline - post_to_slack_channels: list[dict[str, Any]] | Unset = UNSET + post_to_slack_channels: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.post_to_slack_channels, Unset): post_to_slack_channels = [] for post_to_slack_channels_item_data in self.post_to_slack_channels: @@ -179,7 +176,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: description = d.pop("description") _task_type = d.pop("task_type", UNSET) - task_type: CreateGoogleCalendarEventTaskParamsTaskType | Unset + task_type: Union[Unset, CreateGoogleCalendarEventTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: @@ -187,21 +184,21 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attendees = cast(list[str], d.pop("attendees", UNSET)) - def _parse_time_zone(data: object) -> None | str | Unset: + def _parse_time_zone(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) time_zone = _parse_time_zone(d.pop("time_zone", UNSET)) - def _parse_calendar_id(data: object) -> None | str | Unset: + def _parse_calendar_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) calendar_id = _parse_calendar_id(d.pop("calendar_id", UNSET)) @@ -216,7 +213,7 @@ def _parse_calendar_id(data: object) -> None | str | Unset: exclude_weekends = d.pop("exclude_weekends", UNSET) _conference_solution_key = d.pop("conference_solution_key", UNSET) - conference_solution_key: CreateGoogleCalendarEventTaskParamsConferenceSolutionKey | Unset + conference_solution_key: Union[Unset, CreateGoogleCalendarEventTaskParamsConferenceSolutionKey] if isinstance(_conference_solution_key, Unset): conference_solution_key = UNSET else: @@ -226,16 +223,14 @@ def _parse_calendar_id(data: object) -> None | str | Unset: post_to_incident_timeline = d.pop("post_to_incident_timeline", UNSET) + post_to_slack_channels = [] _post_to_slack_channels = d.pop("post_to_slack_channels", UNSET) - post_to_slack_channels: list[CreateGoogleCalendarEventTaskParamsPostToSlackChannelsItem] | Unset = UNSET - if _post_to_slack_channels is not UNSET: - post_to_slack_channels = [] - for post_to_slack_channels_item_data in _post_to_slack_channels: - post_to_slack_channels_item = CreateGoogleCalendarEventTaskParamsPostToSlackChannelsItem.from_dict( - post_to_slack_channels_item_data - ) + for post_to_slack_channels_item_data in _post_to_slack_channels or []: + post_to_slack_channels_item = CreateGoogleCalendarEventTaskParamsPostToSlackChannelsItem.from_dict( + post_to_slack_channels_item_data + ) - post_to_slack_channels.append(post_to_slack_channels_item) + post_to_slack_channels.append(post_to_slack_channels_item) create_google_calendar_event_task_params = cls( days_until_meeting=days_until_meeting, diff --git a/rootly_sdk/models/create_google_calendar_event_task_params_post_to_slack_channels_item.py b/rootly_sdk/models/create_google_calendar_event_task_params_post_to_slack_channels_item.py index 0720c337..a6c051b5 100644 --- a/rootly_sdk/models/create_google_calendar_event_task_params_post_to_slack_channels_item.py +++ b/rootly_sdk/models/create_google_calendar_event_task_params_post_to_slack_channels_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class CreateGoogleCalendarEventTaskParamsPostToSlackChannelsItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_google_chat_space_task_params.py b/rootly_sdk/models/create_google_chat_space_task_params.py index ff6a09f3..e6379ff2 100644 --- a/rootly_sdk/models/create_google_chat_space_task_params.py +++ b/rootly_sdk/models/create_google_chat_space_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -20,21 +18,22 @@ class CreateGoogleChatSpaceTaskParams: """ Attributes: title (str): - task_type (CreateGoogleChatSpaceTaskParamsTaskType | Unset): - description (str | Unset): - audience (str | Unset): Target audience resource name (e.g. audiences/default). Leave blank for private space. + task_type (Union[Unset, CreateGoogleChatSpaceTaskParamsTaskType]): + description (Union[Unset, str]): + audience (Union[Unset, str]): Target audience resource name (e.g. audiences/default). Leave blank for private + space. """ title: str - task_type: CreateGoogleChatSpaceTaskParamsTaskType | Unset = UNSET - description: str | Unset = UNSET - audience: str | Unset = UNSET + task_type: Union[Unset, CreateGoogleChatSpaceTaskParamsTaskType] = UNSET + description: Union[Unset, str] = UNSET + audience: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: title = self.title - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -64,7 +63,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: title = d.pop("title") _task_type = d.pop("task_type", UNSET) - task_type: CreateGoogleChatSpaceTaskParamsTaskType | Unset + task_type: Union[Unset, CreateGoogleChatSpaceTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/create_google_docs_page_task_params.py b/rootly_sdk/models/create_google_docs_page_task_params.py index 3b931d6f..e43a917f 100644 --- a/rootly_sdk/models/create_google_docs_page_task_params.py +++ b/rootly_sdk/models/create_google_docs_page_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -25,36 +23,37 @@ class CreateGoogleDocsPageTaskParams: """ Attributes: title (str): The page title - task_type (CreateGoogleDocsPageTaskParamsTaskType | Unset): - post_mortem_template_id (str | Unset): Retrospective template to use when creating page, if desired - mark_post_mortem_as_published (bool | Unset): Default: True. - drive (CreateGoogleDocsPageTaskParamsDrive | Unset): - parent_folder (CreateGoogleDocsPageTaskParamsParentFolder | Unset): - content (str | Unset): The page content - template_id (str | Unset): The Google Doc file ID to use as a template - permissions (str | Unset): Page permissions JSON - include_overview (bool | Unset): Default: True. - include_timeline (bool | Unset): Default: True. + task_type (Union[Unset, CreateGoogleDocsPageTaskParamsTaskType]): + post_mortem_template_id (Union[Unset, str]): Retrospective template to use when creating page, if desired + mark_post_mortem_as_published (Union[Unset, bool]): Default: True. + drive (Union[Unset, CreateGoogleDocsPageTaskParamsDrive]): + parent_folder (Union[Unset, CreateGoogleDocsPageTaskParamsParentFolder]): + content (Union[Unset, str]): The page content + template_id (Union[Unset, str]): The Google Doc file ID to use as a template + permissions (Union[Unset, str]): Page permissions JSON + include_overview (Union[Unset, bool]): Default: True. + include_timeline (Union[Unset, bool]): Default: True. + include_follow_ups (Union[Unset, bool]): Default: True. """ title: str - task_type: CreateGoogleDocsPageTaskParamsTaskType | Unset = UNSET - post_mortem_template_id: str | Unset = UNSET - mark_post_mortem_as_published: bool | Unset = True - drive: CreateGoogleDocsPageTaskParamsDrive | Unset = UNSET - parent_folder: CreateGoogleDocsPageTaskParamsParentFolder | Unset = UNSET - content: str | Unset = UNSET - template_id: str | Unset = UNSET - permissions: str | Unset = UNSET - include_overview: bool | Unset = True - include_timeline: bool | Unset = True + task_type: Union[Unset, CreateGoogleDocsPageTaskParamsTaskType] = UNSET + post_mortem_template_id: Union[Unset, str] = UNSET + mark_post_mortem_as_published: Union[Unset, bool] = True + drive: Union[Unset, "CreateGoogleDocsPageTaskParamsDrive"] = UNSET + parent_folder: Union[Unset, "CreateGoogleDocsPageTaskParamsParentFolder"] = UNSET + content: Union[Unset, str] = UNSET + template_id: Union[Unset, str] = UNSET + permissions: Union[Unset, str] = UNSET + include_overview: Union[Unset, bool] = True + include_timeline: Union[Unset, bool] = True + include_follow_ups: Union[Unset, bool] = True additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - title = self.title - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -62,11 +61,11 @@ def to_dict(self) -> dict[str, Any]: mark_post_mortem_as_published = self.mark_post_mortem_as_published - drive: dict[str, Any] | Unset = UNSET + drive: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.drive, Unset): drive = self.drive.to_dict() - parent_folder: dict[str, Any] | Unset = UNSET + parent_folder: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.parent_folder, Unset): parent_folder = self.parent_folder.to_dict() @@ -80,6 +79,8 @@ def to_dict(self) -> dict[str, Any]: include_timeline = self.include_timeline + include_follow_ups = self.include_follow_ups + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update( @@ -107,6 +108,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["include_overview"] = include_overview if include_timeline is not UNSET: field_dict["include_timeline"] = include_timeline + if include_follow_ups is not UNSET: + field_dict["include_follow_ups"] = include_follow_ups return field_dict @@ -121,7 +124,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: title = d.pop("title") _task_type = d.pop("task_type", UNSET) - task_type: CreateGoogleDocsPageTaskParamsTaskType | Unset + task_type: Union[Unset, CreateGoogleDocsPageTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: @@ -132,14 +135,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: mark_post_mortem_as_published = d.pop("mark_post_mortem_as_published", UNSET) _drive = d.pop("drive", UNSET) - drive: CreateGoogleDocsPageTaskParamsDrive | Unset + drive: Union[Unset, CreateGoogleDocsPageTaskParamsDrive] if isinstance(_drive, Unset): drive = UNSET else: drive = CreateGoogleDocsPageTaskParamsDrive.from_dict(_drive) _parent_folder = d.pop("parent_folder", UNSET) - parent_folder: CreateGoogleDocsPageTaskParamsParentFolder | Unset + parent_folder: Union[Unset, CreateGoogleDocsPageTaskParamsParentFolder] if isinstance(_parent_folder, Unset): parent_folder = UNSET else: @@ -155,6 +158,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: include_timeline = d.pop("include_timeline", UNSET) + include_follow_ups = d.pop("include_follow_ups", UNSET) + create_google_docs_page_task_params = cls( title=title, task_type=task_type, @@ -167,6 +172,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: permissions=permissions, include_overview=include_overview, include_timeline=include_timeline, + include_follow_ups=include_follow_ups, ) create_google_docs_page_task_params.additional_properties = d diff --git a/rootly_sdk/models/create_google_docs_page_task_params_drive.py b/rootly_sdk/models/create_google_docs_page_task_params_drive.py index ed347ba9..fe74cbcf 100644 --- a/rootly_sdk/models/create_google_docs_page_task_params_drive.py +++ b/rootly_sdk/models/create_google_docs_page_task_params_drive.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class CreateGoogleDocsPageTaskParamsDrive: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_google_docs_page_task_params_parent_folder.py b/rootly_sdk/models/create_google_docs_page_task_params_parent_folder.py index 0f00ca78..b0429645 100644 --- a/rootly_sdk/models/create_google_docs_page_task_params_parent_folder.py +++ b/rootly_sdk/models/create_google_docs_page_task_params_parent_folder.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class CreateGoogleDocsPageTaskParamsParentFolder: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_google_docs_permissions_task_params.py b/rootly_sdk/models/create_google_docs_permissions_task_params.py index f685b609..3cc2443a 100644 --- a/rootly_sdk/models/create_google_docs_permissions_task_params.py +++ b/rootly_sdk/models/create_google_docs_permissions_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,16 +19,16 @@ class CreateGoogleDocsPermissionsTaskParams: Attributes: file_id (str): The Google Doc file ID permissions (str): Page permissions JSON - task_type (CreateGoogleDocsPermissionsTaskParamsTaskType | Unset): - send_notification_email (bool | Unset): - email_message (None | str | Unset): Email message notification + task_type (Union[Unset, CreateGoogleDocsPermissionsTaskParamsTaskType]): + send_notification_email (Union[Unset, bool]): + email_message (Union[None, Unset, str]): Email message notification """ file_id: str permissions: str - task_type: CreateGoogleDocsPermissionsTaskParamsTaskType | Unset = UNSET - send_notification_email: bool | Unset = UNSET - email_message: None | str | Unset = UNSET + task_type: Union[Unset, CreateGoogleDocsPermissionsTaskParamsTaskType] = UNSET + send_notification_email: Union[Unset, bool] = UNSET + email_message: Union[None, Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -38,13 +36,13 @@ def to_dict(self) -> dict[str, Any]: permissions = self.permissions - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type send_notification_email = self.send_notification_email - email_message: None | str | Unset + email_message: Union[None, Unset, str] if isinstance(self.email_message, Unset): email_message = UNSET else: @@ -75,7 +73,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: permissions = d.pop("permissions") _task_type = d.pop("task_type", UNSET) - task_type: CreateGoogleDocsPermissionsTaskParamsTaskType | Unset + task_type: Union[Unset, CreateGoogleDocsPermissionsTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: @@ -83,12 +81,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: send_notification_email = d.pop("send_notification_email", UNSET) - def _parse_email_message(data: object) -> None | str | Unset: + def _parse_email_message(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) email_message = _parse_email_message(d.pop("email_message", UNSET)) diff --git a/rootly_sdk/models/create_google_gemini_chat_completion_task_params.py b/rootly_sdk/models/create_google_gemini_chat_completion_task_params.py index ad8a81b6..10cbd8a5 100644 --- a/rootly_sdk/models/create_google_gemini_chat_completion_task_params.py +++ b/rootly_sdk/models/create_google_gemini_chat_completion_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -27,23 +25,22 @@ class CreateGoogleGeminiChatCompletionTaskParams: Attributes: model (CreateGoogleGeminiChatCompletionTaskParamsModel): The Gemini model. eg: gemini-2.0-flash prompt (str): The prompt to send to Gemini - task_type (CreateGoogleGeminiChatCompletionTaskParamsTaskType | Unset): - system_prompt (str | Unset): The system prompt to send to Gemini (optional) + task_type (Union[Unset, CreateGoogleGeminiChatCompletionTaskParamsTaskType]): + system_prompt (Union[Unset, str]): The system prompt to send to Gemini (optional) """ - model: CreateGoogleGeminiChatCompletionTaskParamsModel + model: "CreateGoogleGeminiChatCompletionTaskParamsModel" prompt: str - task_type: CreateGoogleGeminiChatCompletionTaskParamsTaskType | Unset = UNSET - system_prompt: str | Unset = UNSET + task_type: Union[Unset, CreateGoogleGeminiChatCompletionTaskParamsTaskType] = UNSET + system_prompt: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - model = self.model.to_dict() prompt = self.prompt - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -76,7 +73,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: prompt = d.pop("prompt") _task_type = d.pop("task_type", UNSET) - task_type: CreateGoogleGeminiChatCompletionTaskParamsTaskType | Unset + task_type: Union[Unset, CreateGoogleGeminiChatCompletionTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/create_google_gemini_chat_completion_task_params_model.py b/rootly_sdk/models/create_google_gemini_chat_completion_task_params_model.py index 9eb379c8..d01d44fe 100644 --- a/rootly_sdk/models/create_google_gemini_chat_completion_task_params_model.py +++ b/rootly_sdk/models/create_google_gemini_chat_completion_task_params_model.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,12 +14,12 @@ class CreateGoogleGeminiChatCompletionTaskParamsModel: """The Gemini model. eg: gemini-2.0-flash Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_google_meeting_task_params.py b/rootly_sdk/models/create_google_meeting_task_params.py index 2bf70afb..0a98bfc4 100644 --- a/rootly_sdk/models/create_google_meeting_task_params.py +++ b/rootly_sdk/models/create_google_meeting_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -33,54 +31,53 @@ class CreateGoogleMeetingTaskParams: """ Attributes: - summary (None | str): [DEPRECATED] The meeting summary - description (None | str): [DEPRECATED] The meeting description - task_type (CreateGoogleMeetingTaskParamsTaskType | Unset): - conference_solution_key (CreateGoogleMeetingTaskParamsConferenceSolutionKey | Unset): [DEPRECATED] Sets the - video conference type attached to the meeting - record_meeting (bool | Unset): Rootly AI will record the meeting and automatically generate a transcript and - summary from your meeting - recording_mode (CreateGoogleMeetingTaskParamsRecordingMode | Unset): The video layout for the bot's recording - (e.g. speaker_view, gallery_view, gallery_view_v2, audio_only) - post_to_incident_timeline (bool | Unset): - post_to_slack_channels (list[CreateGoogleMeetingTaskParamsPostToSlackChannelsItem] | Unset): + summary (Union[None, str]): [DEPRECATED] The meeting summary + description (Union[None, str]): [DEPRECATED] The meeting description + task_type (Union[Unset, CreateGoogleMeetingTaskParamsTaskType]): + conference_solution_key (Union[Unset, CreateGoogleMeetingTaskParamsConferenceSolutionKey]): [DEPRECATED] Sets + the video conference type attached to the meeting + record_meeting (Union[Unset, bool]): Rootly AI will record the meeting and automatically generate a transcript + and summary from your meeting + recording_mode (Union[Unset, CreateGoogleMeetingTaskParamsRecordingMode]): The video layout for the bot's + recording (e.g. speaker_view, gallery_view, gallery_view_v2, audio_only) + post_to_incident_timeline (Union[Unset, bool]): + post_to_slack_channels (Union[Unset, list['CreateGoogleMeetingTaskParamsPostToSlackChannelsItem']]): """ - summary: None | str - description: None | str - task_type: CreateGoogleMeetingTaskParamsTaskType | Unset = UNSET - conference_solution_key: CreateGoogleMeetingTaskParamsConferenceSolutionKey | Unset = UNSET - record_meeting: bool | Unset = UNSET - recording_mode: CreateGoogleMeetingTaskParamsRecordingMode | Unset = UNSET - post_to_incident_timeline: bool | Unset = UNSET - post_to_slack_channels: list[CreateGoogleMeetingTaskParamsPostToSlackChannelsItem] | Unset = UNSET + summary: Union[None, str] + description: Union[None, str] + task_type: Union[Unset, CreateGoogleMeetingTaskParamsTaskType] = UNSET + conference_solution_key: Union[Unset, CreateGoogleMeetingTaskParamsConferenceSolutionKey] = UNSET + record_meeting: Union[Unset, bool] = UNSET + recording_mode: Union[Unset, CreateGoogleMeetingTaskParamsRecordingMode] = UNSET + post_to_incident_timeline: Union[Unset, bool] = UNSET + post_to_slack_channels: Union[Unset, list["CreateGoogleMeetingTaskParamsPostToSlackChannelsItem"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - - summary: None | str + summary: Union[None, str] summary = self.summary - description: None | str + description: Union[None, str] description = self.description - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - conference_solution_key: str | Unset = UNSET + conference_solution_key: Union[Unset, str] = UNSET if not isinstance(self.conference_solution_key, Unset): conference_solution_key = self.conference_solution_key record_meeting = self.record_meeting - recording_mode: str | Unset = UNSET + recording_mode: Union[Unset, str] = UNSET if not isinstance(self.recording_mode, Unset): recording_mode = self.recording_mode post_to_incident_timeline = self.post_to_incident_timeline - post_to_slack_channels: list[dict[str, Any]] | Unset = UNSET + post_to_slack_channels: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.post_to_slack_channels, Unset): post_to_slack_channels = [] for post_to_slack_channels_item_data in self.post_to_slack_channels: @@ -118,29 +115,29 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_summary(data: object) -> None | str: + def _parse_summary(data: object) -> Union[None, str]: if data is None: return data - return cast(None | str, data) + return cast(Union[None, str], data) summary = _parse_summary(d.pop("summary")) - def _parse_description(data: object) -> None | str: + def _parse_description(data: object) -> Union[None, str]: if data is None: return data - return cast(None | str, data) + return cast(Union[None, str], data) description = _parse_description(d.pop("description")) _task_type = d.pop("task_type", UNSET) - task_type: CreateGoogleMeetingTaskParamsTaskType | Unset + task_type: Union[Unset, CreateGoogleMeetingTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: task_type = check_create_google_meeting_task_params_task_type(_task_type) _conference_solution_key = d.pop("conference_solution_key", UNSET) - conference_solution_key: CreateGoogleMeetingTaskParamsConferenceSolutionKey | Unset + conference_solution_key: Union[Unset, CreateGoogleMeetingTaskParamsConferenceSolutionKey] if isinstance(_conference_solution_key, Unset): conference_solution_key = UNSET else: @@ -151,7 +148,7 @@ def _parse_description(data: object) -> None | str: record_meeting = d.pop("record_meeting", UNSET) _recording_mode = d.pop("recording_mode", UNSET) - recording_mode: CreateGoogleMeetingTaskParamsRecordingMode | Unset + recording_mode: Union[Unset, CreateGoogleMeetingTaskParamsRecordingMode] if isinstance(_recording_mode, Unset): recording_mode = UNSET else: @@ -159,16 +156,14 @@ def _parse_description(data: object) -> None | str: post_to_incident_timeline = d.pop("post_to_incident_timeline", UNSET) + post_to_slack_channels = [] _post_to_slack_channels = d.pop("post_to_slack_channels", UNSET) - post_to_slack_channels: list[CreateGoogleMeetingTaskParamsPostToSlackChannelsItem] | Unset = UNSET - if _post_to_slack_channels is not UNSET: - post_to_slack_channels = [] - for post_to_slack_channels_item_data in _post_to_slack_channels: - post_to_slack_channels_item = CreateGoogleMeetingTaskParamsPostToSlackChannelsItem.from_dict( - post_to_slack_channels_item_data - ) + for post_to_slack_channels_item_data in _post_to_slack_channels or []: + post_to_slack_channels_item = CreateGoogleMeetingTaskParamsPostToSlackChannelsItem.from_dict( + post_to_slack_channels_item_data + ) - post_to_slack_channels.append(post_to_slack_channels_item) + post_to_slack_channels.append(post_to_slack_channels_item) create_google_meeting_task_params = cls( summary=summary, diff --git a/rootly_sdk/models/create_google_meeting_task_params_post_to_slack_channels_item.py b/rootly_sdk/models/create_google_meeting_task_params_post_to_slack_channels_item.py index 091a9f63..93046341 100644 --- a/rootly_sdk/models/create_google_meeting_task_params_post_to_slack_channels_item.py +++ b/rootly_sdk/models/create_google_meeting_task_params_post_to_slack_channels_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class CreateGoogleMeetingTaskParamsPostToSlackChannelsItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_incident_postmortem_task_params.py b/rootly_sdk/models/create_incident_postmortem_task_params.py index 8c8d0253..0f10917e 100644 --- a/rootly_sdk/models/create_incident_postmortem_task_params.py +++ b/rootly_sdk/models/create_incident_postmortem_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -27,16 +25,16 @@ class CreateIncidentPostmortemTaskParams: Attributes: incident_id (str): UUID of the incident that needs a retrospective title (str): The retrospective title - task_type (CreateIncidentPostmortemTaskParamsTaskType | Unset): - status (None | str | Unset): - template (CreateIncidentPostmortemTaskParamsTemplateType0 | None | Unset): Retrospective template to use + task_type (Union[Unset, CreateIncidentPostmortemTaskParamsTaskType]): + status (Union[None, Unset, str]): + template (Union['CreateIncidentPostmortemTaskParamsTemplateType0', None, Unset]): Retrospective template to use """ incident_id: str title: str - task_type: CreateIncidentPostmortemTaskParamsTaskType | Unset = UNSET - status: None | str | Unset = UNSET - template: CreateIncidentPostmortemTaskParamsTemplateType0 | None | Unset = UNSET + task_type: Union[Unset, CreateIncidentPostmortemTaskParamsTaskType] = UNSET + status: Union[None, Unset, str] = UNSET + template: Union["CreateIncidentPostmortemTaskParamsTemplateType0", None, Unset] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -48,17 +46,17 @@ def to_dict(self) -> dict[str, Any]: title = self.title - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - status: None | str | Unset + status: Union[None, Unset, str] if isinstance(self.status, Unset): status = UNSET else: status = self.status - template: dict[str, Any] | None | Unset + template: Union[None, Unset, dict[str, Any]] if isinstance(self.template, Unset): template = UNSET elif isinstance(self.template, CreateIncidentPostmortemTaskParamsTemplateType0): @@ -95,22 +93,22 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: title = d.pop("title") _task_type = d.pop("task_type", UNSET) - task_type: CreateIncidentPostmortemTaskParamsTaskType | Unset + task_type: Union[Unset, CreateIncidentPostmortemTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: task_type = check_create_incident_postmortem_task_params_task_type(_task_type) - def _parse_status(data: object) -> None | str | Unset: + def _parse_status(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) status = _parse_status(d.pop("status", UNSET)) - def _parse_template(data: object) -> CreateIncidentPostmortemTaskParamsTemplateType0 | None | Unset: + def _parse_template(data: object) -> Union["CreateIncidentPostmortemTaskParamsTemplateType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -121,9 +119,9 @@ def _parse_template(data: object) -> CreateIncidentPostmortemTaskParamsTemplateT template_type_0 = CreateIncidentPostmortemTaskParamsTemplateType0.from_dict(data) return template_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(CreateIncidentPostmortemTaskParamsTemplateType0 | None | Unset, data) + return cast(Union["CreateIncidentPostmortemTaskParamsTemplateType0", None, Unset], data) template = _parse_template(d.pop("template", UNSET)) diff --git a/rootly_sdk/models/create_incident_postmortem_task_params_template_type_0.py b/rootly_sdk/models/create_incident_postmortem_task_params_template_type_0.py index 5baec603..ea02ecab 100644 --- a/rootly_sdk/models/create_incident_postmortem_task_params_template_type_0.py +++ b/rootly_sdk/models/create_incident_postmortem_task_params_template_type_0.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,12 +14,12 @@ class CreateIncidentPostmortemTaskParamsTemplateType0: """Retrospective template to use Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_incident_task_params.py b/rootly_sdk/models/create_incident_task_params.py index 0431e24c..6a1905b5 100644 --- a/rootly_sdk/models/create_incident_task_params.py +++ b/rootly_sdk/models/create_incident_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -20,36 +18,36 @@ class CreateIncidentTaskParams: """ Attributes: title (str): The incident title - task_type (CreateIncidentTaskParamsTaskType | Unset): - summary (str | Unset): The incident summary - severity_id (str | Unset): - incident_type_ids (list[str] | Unset): - service_ids (list[str] | Unset): Array of service UUIDs - functionality_ids (list[str] | Unset): Array of functionality UUIDs - environment_ids (list[str] | Unset): - group_ids (list[str] | Unset): Array of group/team UUIDs - private (bool | Unset): - custom_fields_mapping (None | str | Unset): Custom field mappings. Can contain liquid markup and need to be + task_type (Union[Unset, CreateIncidentTaskParamsTaskType]): + summary (Union[Unset, str]): The incident summary + severity_id (Union[Unset, str]): + incident_type_ids (Union[Unset, list[str]]): + service_ids (Union[Unset, list[str]]): Array of service UUIDs + functionality_ids (Union[Unset, list[str]]): Array of functionality UUIDs + environment_ids (Union[Unset, list[str]]): + group_ids (Union[Unset, list[str]]): Array of group/team UUIDs + private (Union[Unset, bool]): + custom_fields_mapping (Union[None, Unset, str]): Custom field mappings. Can contain liquid markup and need to be valid JSON. Use 'services', 'functionalities', or 'groups' keys with arrays of names/slugs for name/slug lookup """ title: str - task_type: CreateIncidentTaskParamsTaskType | Unset = UNSET - summary: str | Unset = UNSET - severity_id: str | Unset = UNSET - incident_type_ids: list[str] | Unset = UNSET - service_ids: list[str] | Unset = UNSET - functionality_ids: list[str] | Unset = UNSET - environment_ids: list[str] | Unset = UNSET - group_ids: list[str] | Unset = UNSET - private: bool | Unset = UNSET - custom_fields_mapping: None | str | Unset = UNSET + task_type: Union[Unset, CreateIncidentTaskParamsTaskType] = UNSET + summary: Union[Unset, str] = UNSET + severity_id: Union[Unset, str] = UNSET + incident_type_ids: Union[Unset, list[str]] = UNSET + service_ids: Union[Unset, list[str]] = UNSET + functionality_ids: Union[Unset, list[str]] = UNSET + environment_ids: Union[Unset, list[str]] = UNSET + group_ids: Union[Unset, list[str]] = UNSET + private: Union[Unset, bool] = UNSET + custom_fields_mapping: Union[None, Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: title = self.title - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -57,29 +55,29 @@ def to_dict(self) -> dict[str, Any]: severity_id = self.severity_id - incident_type_ids: list[str] | Unset = UNSET + incident_type_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.incident_type_ids, Unset): incident_type_ids = self.incident_type_ids - service_ids: list[str] | Unset = UNSET + service_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.service_ids, Unset): service_ids = self.service_ids - functionality_ids: list[str] | Unset = UNSET + functionality_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.functionality_ids, Unset): functionality_ids = self.functionality_ids - environment_ids: list[str] | Unset = UNSET + environment_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.environment_ids, Unset): environment_ids = self.environment_ids - group_ids: list[str] | Unset = UNSET + group_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.group_ids, Unset): group_ids = self.group_ids private = self.private - custom_fields_mapping: None | str | Unset + custom_fields_mapping: Union[None, Unset, str] if isinstance(self.custom_fields_mapping, Unset): custom_fields_mapping = UNSET else: @@ -121,7 +119,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: title = d.pop("title") _task_type = d.pop("task_type", UNSET) - task_type: CreateIncidentTaskParamsTaskType | Unset + task_type: Union[Unset, CreateIncidentTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: @@ -143,12 +141,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: private = d.pop("private", UNSET) - def _parse_custom_fields_mapping(data: object) -> None | str | Unset: + def _parse_custom_fields_mapping(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) custom_fields_mapping = _parse_custom_fields_mapping(d.pop("custom_fields_mapping", UNSET)) diff --git a/rootly_sdk/models/create_jira_issue_task_params.py b/rootly_sdk/models/create_jira_issue_task_params.py index 83f02914..155c217a 100644 --- a/rootly_sdk/models/create_jira_issue_task_params.py +++ b/rootly_sdk/models/create_jira_issue_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,50 +27,55 @@ class CreateJiraIssueTaskParams: title (str): The issue title project_key (str): The project key issue_type (CreateJiraIssueTaskParamsIssueType): The issue type id and display name - task_type (CreateJiraIssueTaskParamsTaskType | Unset): - integration (CreateJiraIssueTaskParamsIntegration | Unset): Specify integration id if you have more than one - Jira instance - description (str | Unset): The issue description - labels (str | Unset): The issue labels - assign_user_email (str | Unset): The assigned user's email - reporter_user_email (str | Unset): The reporter user's email - due_date (str | Unset): The due date - priority (CreateJiraIssueTaskParamsPriority | Unset): The priority id and display name - status (CreateJiraIssueTaskParamsStatus | Unset): The status id and display name - custom_fields_mapping (None | str | Unset): Custom field mappings. Can contain liquid markup and need to be + task_type (Union[Unset, CreateJiraIssueTaskParamsTaskType]): + integration (Union[Unset, CreateJiraIssueTaskParamsIntegration]): Specify integration id if you have more than + one Jira instance + description (Union[Unset, str]): The issue description + labels (Union[Unset, str]): The issue labels + assign_user_email (Union[Unset, str]): The assigned user's email + reporter_user_email (Union[Unset, str]): The reporter user's email + due_date (Union[Unset, str]): The due date + priority (Union[Unset, CreateJiraIssueTaskParamsPriority]): The priority id and display name + status (Union[Unset, CreateJiraIssueTaskParamsStatus]): The status id and display name + custom_fields_mapping (Union[None, Unset, str]): Custom field mappings. Can contain liquid markup and need to be valid JSON - update_payload (None | str | Unset): Update payload. Can contain liquid markup and need to be valid JSON + update_payload (Union[None, Unset, str]): Update payload. Can contain liquid markup and need to be valid JSON + retry_count (Union[Unset, int]): Number of times to retry on rate-limit (HTTP 429) responses (0-4). 0 disables + retry. Default: 0. Example: 3. + retry_wait_time (Union[Unset, int]): Seconds to wait before each retry (1-15). Retry-After header is honored + when present and <= 90s, taking the larger of retry_wait_time and the header value. Default: 1. Example: 2. """ title: str project_key: str - issue_type: CreateJiraIssueTaskParamsIssueType - task_type: CreateJiraIssueTaskParamsTaskType | Unset = UNSET - integration: CreateJiraIssueTaskParamsIntegration | Unset = UNSET - description: str | Unset = UNSET - labels: str | Unset = UNSET - assign_user_email: str | Unset = UNSET - reporter_user_email: str | Unset = UNSET - due_date: str | Unset = UNSET - priority: CreateJiraIssueTaskParamsPriority | Unset = UNSET - status: CreateJiraIssueTaskParamsStatus | Unset = UNSET - custom_fields_mapping: None | str | Unset = UNSET - update_payload: None | str | Unset = UNSET + issue_type: "CreateJiraIssueTaskParamsIssueType" + task_type: Union[Unset, CreateJiraIssueTaskParamsTaskType] = UNSET + integration: Union[Unset, "CreateJiraIssueTaskParamsIntegration"] = UNSET + description: Union[Unset, str] = UNSET + labels: Union[Unset, str] = UNSET + assign_user_email: Union[Unset, str] = UNSET + reporter_user_email: Union[Unset, str] = UNSET + due_date: Union[Unset, str] = UNSET + priority: Union[Unset, "CreateJiraIssueTaskParamsPriority"] = UNSET + status: Union[Unset, "CreateJiraIssueTaskParamsStatus"] = UNSET + custom_fields_mapping: Union[None, Unset, str] = UNSET + update_payload: Union[None, Unset, str] = UNSET + retry_count: Union[Unset, int] = 0 + retry_wait_time: Union[Unset, int] = 1 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - title = self.title project_key = self.project_key issue_type = self.issue_type.to_dict() - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - integration: dict[str, Any] | Unset = UNSET + integration: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.integration, Unset): integration = self.integration.to_dict() @@ -86,26 +89,30 @@ def to_dict(self) -> dict[str, Any]: due_date = self.due_date - priority: dict[str, Any] | Unset = UNSET + priority: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.priority, Unset): priority = self.priority.to_dict() - status: dict[str, Any] | Unset = UNSET + status: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.status, Unset): status = self.status.to_dict() - custom_fields_mapping: None | str | Unset + custom_fields_mapping: Union[None, Unset, str] if isinstance(self.custom_fields_mapping, Unset): custom_fields_mapping = UNSET else: custom_fields_mapping = self.custom_fields_mapping - update_payload: None | str | Unset + update_payload: Union[None, Unset, str] if isinstance(self.update_payload, Unset): update_payload = UNSET else: update_payload = self.update_payload + retry_count = self.retry_count + + retry_wait_time = self.retry_wait_time + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update( @@ -137,6 +144,10 @@ def to_dict(self) -> dict[str, Any]: field_dict["custom_fields_mapping"] = custom_fields_mapping if update_payload is not UNSET: field_dict["update_payload"] = update_payload + if retry_count is not UNSET: + field_dict["retry_count"] = retry_count + if retry_wait_time is not UNSET: + field_dict["retry_wait_time"] = retry_wait_time return field_dict @@ -155,14 +166,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: issue_type = CreateJiraIssueTaskParamsIssueType.from_dict(d.pop("issue_type")) _task_type = d.pop("task_type", UNSET) - task_type: CreateJiraIssueTaskParamsTaskType | Unset + task_type: Union[Unset, CreateJiraIssueTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: task_type = check_create_jira_issue_task_params_task_type(_task_type) _integration = d.pop("integration", UNSET) - integration: CreateJiraIssueTaskParamsIntegration | Unset + integration: Union[Unset, CreateJiraIssueTaskParamsIntegration] if isinstance(_integration, Unset): integration = UNSET else: @@ -179,37 +190,41 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: due_date = d.pop("due_date", UNSET) _priority = d.pop("priority", UNSET) - priority: CreateJiraIssueTaskParamsPriority | Unset + priority: Union[Unset, CreateJiraIssueTaskParamsPriority] if isinstance(_priority, Unset): priority = UNSET else: priority = CreateJiraIssueTaskParamsPriority.from_dict(_priority) _status = d.pop("status", UNSET) - status: CreateJiraIssueTaskParamsStatus | Unset + status: Union[Unset, CreateJiraIssueTaskParamsStatus] if isinstance(_status, Unset): status = UNSET else: status = CreateJiraIssueTaskParamsStatus.from_dict(_status) - def _parse_custom_fields_mapping(data: object) -> None | str | Unset: + def _parse_custom_fields_mapping(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) custom_fields_mapping = _parse_custom_fields_mapping(d.pop("custom_fields_mapping", UNSET)) - def _parse_update_payload(data: object) -> None | str | Unset: + def _parse_update_payload(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) update_payload = _parse_update_payload(d.pop("update_payload", UNSET)) + retry_count = d.pop("retry_count", UNSET) + + retry_wait_time = d.pop("retry_wait_time", UNSET) + create_jira_issue_task_params = cls( title=title, project_key=project_key, @@ -225,6 +240,8 @@ def _parse_update_payload(data: object) -> None | str | Unset: status=status, custom_fields_mapping=custom_fields_mapping, update_payload=update_payload, + retry_count=retry_count, + retry_wait_time=retry_wait_time, ) create_jira_issue_task_params.additional_properties = d diff --git a/rootly_sdk/models/create_jira_issue_task_params_integration.py b/rootly_sdk/models/create_jira_issue_task_params_integration.py index 9537af66..c4ae4e9e 100644 --- a/rootly_sdk/models/create_jira_issue_task_params_integration.py +++ b/rootly_sdk/models/create_jira_issue_task_params_integration.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,12 +14,12 @@ class CreateJiraIssueTaskParamsIntegration: """Specify integration id if you have more than one Jira instance Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_jira_issue_task_params_issue_type.py b/rootly_sdk/models/create_jira_issue_task_params_issue_type.py index c774aed2..4b72a799 100644 --- a/rootly_sdk/models/create_jira_issue_task_params_issue_type.py +++ b/rootly_sdk/models/create_jira_issue_task_params_issue_type.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,12 +14,12 @@ class CreateJiraIssueTaskParamsIssueType: """The issue type id and display name Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_jira_issue_task_params_priority.py b/rootly_sdk/models/create_jira_issue_task_params_priority.py index cca943f4..7cebbff3 100644 --- a/rootly_sdk/models/create_jira_issue_task_params_priority.py +++ b/rootly_sdk/models/create_jira_issue_task_params_priority.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,12 +14,12 @@ class CreateJiraIssueTaskParamsPriority: """The priority id and display name Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_jira_issue_task_params_status.py b/rootly_sdk/models/create_jira_issue_task_params_status.py index 719aa1ff..4073c439 100644 --- a/rootly_sdk/models/create_jira_issue_task_params_status.py +++ b/rootly_sdk/models/create_jira_issue_task_params_status.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,12 +14,12 @@ class CreateJiraIssueTaskParamsStatus: """The status id and display name Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_jira_subtask_task_params.py b/rootly_sdk/models/create_jira_subtask_task_params.py index f94a8ba6..e93a9a9c 100644 --- a/rootly_sdk/models/create_jira_subtask_task_params.py +++ b/rootly_sdk/models/create_jira_subtask_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -30,40 +28,45 @@ class CreateJiraSubtaskTaskParams: parent_issue_id (str): The parent issue title (str): The issue title subtask_issue_type (CreateJiraSubtaskTaskParamsSubtaskIssueType): The issue type id and display name - task_type (CreateJiraSubtaskTaskParamsTaskType | Unset): - integration (CreateJiraSubtaskTaskParamsIntegration | Unset): Specify integration id if you have more than one - Jira instance - description (str | Unset): The issue description - labels (str | Unset): The issue labels - due_date (str | Unset): The due date - assign_user_email (str | Unset): The assigned user's email - reporter_user_email (str | Unset): The reporter user's email - priority (CreateJiraSubtaskTaskParamsPriority | Unset): The priority id and display name - status (CreateJiraSubtaskTaskParamsStatus | Unset): The status id and display name - custom_fields_mapping (None | str | Unset): Custom field mappings. Can contain liquid markup and need to be + task_type (Union[Unset, CreateJiraSubtaskTaskParamsTaskType]): + integration (Union[Unset, CreateJiraSubtaskTaskParamsIntegration]): Specify integration id if you have more than + one Jira instance + description (Union[Unset, str]): The issue description + labels (Union[Unset, str]): The issue labels + due_date (Union[Unset, str]): The due date + assign_user_email (Union[Unset, str]): The assigned user's email + reporter_user_email (Union[Unset, str]): The reporter user's email + priority (Union[Unset, CreateJiraSubtaskTaskParamsPriority]): The priority id and display name + status (Union[Unset, CreateJiraSubtaskTaskParamsStatus]): The status id and display name + custom_fields_mapping (Union[None, Unset, str]): Custom field mappings. Can contain liquid markup and need to be valid JSON - update_payload (None | str | Unset): Update payload. Can contain liquid markup and need to be valid JSON + update_payload (Union[None, Unset, str]): Update payload. Can contain liquid markup and need to be valid JSON + retry_count (Union[Unset, int]): Number of times to retry on rate-limit (HTTP 429) responses (0-4). 0 disables + retry. Default: 0. Example: 3. + retry_wait_time (Union[Unset, int]): Seconds to wait before each retry (1-15). Retry-After header is honored + when present and <= 90s, taking the larger of retry_wait_time and the header value. Default: 1. Example: 2. """ project_key: str parent_issue_id: str title: str - subtask_issue_type: CreateJiraSubtaskTaskParamsSubtaskIssueType - task_type: CreateJiraSubtaskTaskParamsTaskType | Unset = UNSET - integration: CreateJiraSubtaskTaskParamsIntegration | Unset = UNSET - description: str | Unset = UNSET - labels: str | Unset = UNSET - due_date: str | Unset = UNSET - assign_user_email: str | Unset = UNSET - reporter_user_email: str | Unset = UNSET - priority: CreateJiraSubtaskTaskParamsPriority | Unset = UNSET - status: CreateJiraSubtaskTaskParamsStatus | Unset = UNSET - custom_fields_mapping: None | str | Unset = UNSET - update_payload: None | str | Unset = UNSET + subtask_issue_type: "CreateJiraSubtaskTaskParamsSubtaskIssueType" + task_type: Union[Unset, CreateJiraSubtaskTaskParamsTaskType] = UNSET + integration: Union[Unset, "CreateJiraSubtaskTaskParamsIntegration"] = UNSET + description: Union[Unset, str] = UNSET + labels: Union[Unset, str] = UNSET + due_date: Union[Unset, str] = UNSET + assign_user_email: Union[Unset, str] = UNSET + reporter_user_email: Union[Unset, str] = UNSET + priority: Union[Unset, "CreateJiraSubtaskTaskParamsPriority"] = UNSET + status: Union[Unset, "CreateJiraSubtaskTaskParamsStatus"] = UNSET + custom_fields_mapping: Union[None, Unset, str] = UNSET + update_payload: Union[None, Unset, str] = UNSET + retry_count: Union[Unset, int] = 0 + retry_wait_time: Union[Unset, int] = 1 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - project_key = self.project_key parent_issue_id = self.parent_issue_id @@ -72,11 +75,11 @@ def to_dict(self) -> dict[str, Any]: subtask_issue_type = self.subtask_issue_type.to_dict() - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - integration: dict[str, Any] | Unset = UNSET + integration: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.integration, Unset): integration = self.integration.to_dict() @@ -90,26 +93,30 @@ def to_dict(self) -> dict[str, Any]: reporter_user_email = self.reporter_user_email - priority: dict[str, Any] | Unset = UNSET + priority: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.priority, Unset): priority = self.priority.to_dict() - status: dict[str, Any] | Unset = UNSET + status: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.status, Unset): status = self.status.to_dict() - custom_fields_mapping: None | str | Unset + custom_fields_mapping: Union[None, Unset, str] if isinstance(self.custom_fields_mapping, Unset): custom_fields_mapping = UNSET else: custom_fields_mapping = self.custom_fields_mapping - update_payload: None | str | Unset + update_payload: Union[None, Unset, str] if isinstance(self.update_payload, Unset): update_payload = UNSET else: update_payload = self.update_payload + retry_count = self.retry_count + + retry_wait_time = self.retry_wait_time + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update( @@ -142,6 +149,10 @@ def to_dict(self) -> dict[str, Any]: field_dict["custom_fields_mapping"] = custom_fields_mapping if update_payload is not UNSET: field_dict["update_payload"] = update_payload + if retry_count is not UNSET: + field_dict["retry_count"] = retry_count + if retry_wait_time is not UNSET: + field_dict["retry_wait_time"] = retry_wait_time return field_dict @@ -164,14 +175,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: subtask_issue_type = CreateJiraSubtaskTaskParamsSubtaskIssueType.from_dict(d.pop("subtask_issue_type")) _task_type = d.pop("task_type", UNSET) - task_type: CreateJiraSubtaskTaskParamsTaskType | Unset + task_type: Union[Unset, CreateJiraSubtaskTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: task_type = check_create_jira_subtask_task_params_task_type(_task_type) _integration = d.pop("integration", UNSET) - integration: CreateJiraSubtaskTaskParamsIntegration | Unset + integration: Union[Unset, CreateJiraSubtaskTaskParamsIntegration] if isinstance(_integration, Unset): integration = UNSET else: @@ -188,37 +199,41 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: reporter_user_email = d.pop("reporter_user_email", UNSET) _priority = d.pop("priority", UNSET) - priority: CreateJiraSubtaskTaskParamsPriority | Unset + priority: Union[Unset, CreateJiraSubtaskTaskParamsPriority] if isinstance(_priority, Unset): priority = UNSET else: priority = CreateJiraSubtaskTaskParamsPriority.from_dict(_priority) _status = d.pop("status", UNSET) - status: CreateJiraSubtaskTaskParamsStatus | Unset + status: Union[Unset, CreateJiraSubtaskTaskParamsStatus] if isinstance(_status, Unset): status = UNSET else: status = CreateJiraSubtaskTaskParamsStatus.from_dict(_status) - def _parse_custom_fields_mapping(data: object) -> None | str | Unset: + def _parse_custom_fields_mapping(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) custom_fields_mapping = _parse_custom_fields_mapping(d.pop("custom_fields_mapping", UNSET)) - def _parse_update_payload(data: object) -> None | str | Unset: + def _parse_update_payload(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) update_payload = _parse_update_payload(d.pop("update_payload", UNSET)) + retry_count = d.pop("retry_count", UNSET) + + retry_wait_time = d.pop("retry_wait_time", UNSET) + create_jira_subtask_task_params = cls( project_key=project_key, parent_issue_id=parent_issue_id, @@ -235,6 +250,8 @@ def _parse_update_payload(data: object) -> None | str | Unset: status=status, custom_fields_mapping=custom_fields_mapping, update_payload=update_payload, + retry_count=retry_count, + retry_wait_time=retry_wait_time, ) create_jira_subtask_task_params.additional_properties = d diff --git a/rootly_sdk/models/create_jira_subtask_task_params_integration.py b/rootly_sdk/models/create_jira_subtask_task_params_integration.py index 7ce38be3..31d747de 100644 --- a/rootly_sdk/models/create_jira_subtask_task_params_integration.py +++ b/rootly_sdk/models/create_jira_subtask_task_params_integration.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,12 +14,12 @@ class CreateJiraSubtaskTaskParamsIntegration: """Specify integration id if you have more than one Jira instance Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_jira_subtask_task_params_priority.py b/rootly_sdk/models/create_jira_subtask_task_params_priority.py index d6f31b38..8ce96950 100644 --- a/rootly_sdk/models/create_jira_subtask_task_params_priority.py +++ b/rootly_sdk/models/create_jira_subtask_task_params_priority.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,12 +14,12 @@ class CreateJiraSubtaskTaskParamsPriority: """The priority id and display name Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_jira_subtask_task_params_status.py b/rootly_sdk/models/create_jira_subtask_task_params_status.py index 5c9cbdd1..25c26cd9 100644 --- a/rootly_sdk/models/create_jira_subtask_task_params_status.py +++ b/rootly_sdk/models/create_jira_subtask_task_params_status.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,12 +14,12 @@ class CreateJiraSubtaskTaskParamsStatus: """The status id and display name Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_jira_subtask_task_params_subtask_issue_type.py b/rootly_sdk/models/create_jira_subtask_task_params_subtask_issue_type.py index a99b33ac..58b554b6 100644 --- a/rootly_sdk/models/create_jira_subtask_task_params_subtask_issue_type.py +++ b/rootly_sdk/models/create_jira_subtask_task_params_subtask_issue_type.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,12 +14,12 @@ class CreateJiraSubtaskTaskParamsSubtaskIssueType: """The issue type id and display name Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_jsmops_alert_task_params.py b/rootly_sdk/models/create_jsmops_alert_task_params.py index 5fa7699e..4691f33d 100644 --- a/rootly_sdk/models/create_jsmops_alert_task_params.py +++ b/rootly_sdk/models/create_jsmops_alert_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -31,75 +29,74 @@ class CreateJsmopsAlertTaskParams: """ Attributes: message (str): Message of the alert - task_type (CreateJsmopsAlertTaskParamsTaskType | Unset): - description (None | str | Unset): Description field of the alert that is generally used to provide a detailed - information about the alert - teams (list[CreateJsmopsAlertTaskParamsTeamsItem] | Unset): - users (list[CreateJsmopsAlertTaskParamsUsersItem] | Unset): - schedules (list[CreateJsmopsAlertTaskParamsSchedulesItem] | Unset): - escalations (list[CreateJsmopsAlertTaskParamsEscalationsItem] | Unset): - priority (CreateJsmopsAlertTaskParamsPriority | Unset): Default: 'P3'. - details (None | str | Unset): Details payload. Can contain liquid markup and need to be valid JSON + task_type (Union[Unset, CreateJsmopsAlertTaskParamsTaskType]): + description (Union[None, Unset, str]): Description field of the alert that is generally used to provide a + detailed information about the alert + teams (Union[Unset, list['CreateJsmopsAlertTaskParamsTeamsItem']]): + users (Union[Unset, list['CreateJsmopsAlertTaskParamsUsersItem']]): + schedules (Union[Unset, list['CreateJsmopsAlertTaskParamsSchedulesItem']]): + escalations (Union[Unset, list['CreateJsmopsAlertTaskParamsEscalationsItem']]): + priority (Union[Unset, CreateJsmopsAlertTaskParamsPriority]): Default: 'P3'. + details (Union[None, Unset, str]): Details payload. Can contain liquid markup and need to be valid JSON """ message: str - task_type: CreateJsmopsAlertTaskParamsTaskType | Unset = UNSET - description: None | str | Unset = UNSET - teams: list[CreateJsmopsAlertTaskParamsTeamsItem] | Unset = UNSET - users: list[CreateJsmopsAlertTaskParamsUsersItem] | Unset = UNSET - schedules: list[CreateJsmopsAlertTaskParamsSchedulesItem] | Unset = UNSET - escalations: list[CreateJsmopsAlertTaskParamsEscalationsItem] | Unset = UNSET - priority: CreateJsmopsAlertTaskParamsPriority | Unset = "P3" - details: None | str | Unset = UNSET + task_type: Union[Unset, CreateJsmopsAlertTaskParamsTaskType] = UNSET + description: Union[None, Unset, str] = UNSET + teams: Union[Unset, list["CreateJsmopsAlertTaskParamsTeamsItem"]] = UNSET + users: Union[Unset, list["CreateJsmopsAlertTaskParamsUsersItem"]] = UNSET + schedules: Union[Unset, list["CreateJsmopsAlertTaskParamsSchedulesItem"]] = UNSET + escalations: Union[Unset, list["CreateJsmopsAlertTaskParamsEscalationsItem"]] = UNSET + priority: Union[Unset, CreateJsmopsAlertTaskParamsPriority] = "P3" + details: Union[None, Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - message = self.message - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - description: None | str | Unset + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: description = self.description - teams: list[dict[str, Any]] | Unset = UNSET + teams: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.teams, Unset): teams = [] for teams_item_data in self.teams: teams_item = teams_item_data.to_dict() teams.append(teams_item) - users: list[dict[str, Any]] | Unset = UNSET + users: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.users, Unset): users = [] for users_item_data in self.users: users_item = users_item_data.to_dict() users.append(users_item) - schedules: list[dict[str, Any]] | Unset = UNSET + schedules: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.schedules, Unset): schedules = [] for schedules_item_data in self.schedules: schedules_item = schedules_item_data.to_dict() schedules.append(schedules_item) - escalations: list[dict[str, Any]] | Unset = UNSET + escalations: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.escalations, Unset): escalations = [] for escalations_item_data in self.escalations: escalations_item = escalations_item_data.to_dict() escalations.append(escalations_item) - priority: str | Unset = UNSET + priority: Union[Unset, str] = UNSET if not isinstance(self.priority, Unset): priority = self.priority - details: None | str | Unset + details: Union[None, Unset, str] if isinstance(self.details, Unset): details = UNSET else: @@ -142,70 +139,62 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: message = d.pop("message") _task_type = d.pop("task_type", UNSET) - task_type: CreateJsmopsAlertTaskParamsTaskType | Unset + task_type: Union[Unset, CreateJsmopsAlertTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: task_type = check_create_jsmops_alert_task_params_task_type(_task_type) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) + teams = [] _teams = d.pop("teams", UNSET) - teams: list[CreateJsmopsAlertTaskParamsTeamsItem] | Unset = UNSET - if _teams is not UNSET: - teams = [] - for teams_item_data in _teams: - teams_item = CreateJsmopsAlertTaskParamsTeamsItem.from_dict(teams_item_data) + for teams_item_data in _teams or []: + teams_item = CreateJsmopsAlertTaskParamsTeamsItem.from_dict(teams_item_data) - teams.append(teams_item) + teams.append(teams_item) + users = [] _users = d.pop("users", UNSET) - users: list[CreateJsmopsAlertTaskParamsUsersItem] | Unset = UNSET - if _users is not UNSET: - users = [] - for users_item_data in _users: - users_item = CreateJsmopsAlertTaskParamsUsersItem.from_dict(users_item_data) + for users_item_data in _users or []: + users_item = CreateJsmopsAlertTaskParamsUsersItem.from_dict(users_item_data) - users.append(users_item) + users.append(users_item) + schedules = [] _schedules = d.pop("schedules", UNSET) - schedules: list[CreateJsmopsAlertTaskParamsSchedulesItem] | Unset = UNSET - if _schedules is not UNSET: - schedules = [] - for schedules_item_data in _schedules: - schedules_item = CreateJsmopsAlertTaskParamsSchedulesItem.from_dict(schedules_item_data) + for schedules_item_data in _schedules or []: + schedules_item = CreateJsmopsAlertTaskParamsSchedulesItem.from_dict(schedules_item_data) - schedules.append(schedules_item) + schedules.append(schedules_item) + escalations = [] _escalations = d.pop("escalations", UNSET) - escalations: list[CreateJsmopsAlertTaskParamsEscalationsItem] | Unset = UNSET - if _escalations is not UNSET: - escalations = [] - for escalations_item_data in _escalations: - escalations_item = CreateJsmopsAlertTaskParamsEscalationsItem.from_dict(escalations_item_data) + for escalations_item_data in _escalations or []: + escalations_item = CreateJsmopsAlertTaskParamsEscalationsItem.from_dict(escalations_item_data) - escalations.append(escalations_item) + escalations.append(escalations_item) _priority = d.pop("priority", UNSET) - priority: CreateJsmopsAlertTaskParamsPriority | Unset + priority: Union[Unset, CreateJsmopsAlertTaskParamsPriority] if isinstance(_priority, Unset): priority = UNSET else: priority = check_create_jsmops_alert_task_params_priority(_priority) - def _parse_details(data: object) -> None | str | Unset: + def _parse_details(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) details = _parse_details(d.pop("details", UNSET)) diff --git a/rootly_sdk/models/create_jsmops_alert_task_params_escalations_item.py b/rootly_sdk/models/create_jsmops_alert_task_params_escalations_item.py index 933c82bf..3c5ad133 100644 --- a/rootly_sdk/models/create_jsmops_alert_task_params_escalations_item.py +++ b/rootly_sdk/models/create_jsmops_alert_task_params_escalations_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class CreateJsmopsAlertTaskParamsEscalationsItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_jsmops_alert_task_params_schedules_item.py b/rootly_sdk/models/create_jsmops_alert_task_params_schedules_item.py index 0ab25c3f..581d3df3 100644 --- a/rootly_sdk/models/create_jsmops_alert_task_params_schedules_item.py +++ b/rootly_sdk/models/create_jsmops_alert_task_params_schedules_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class CreateJsmopsAlertTaskParamsSchedulesItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_jsmops_alert_task_params_teams_item.py b/rootly_sdk/models/create_jsmops_alert_task_params_teams_item.py index 802141da..090f0f22 100644 --- a/rootly_sdk/models/create_jsmops_alert_task_params_teams_item.py +++ b/rootly_sdk/models/create_jsmops_alert_task_params_teams_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class CreateJsmopsAlertTaskParamsTeamsItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_jsmops_alert_task_params_users_item.py b/rootly_sdk/models/create_jsmops_alert_task_params_users_item.py index 92d7c0a2..4a9952ac 100644 --- a/rootly_sdk/models/create_jsmops_alert_task_params_users_item.py +++ b/rootly_sdk/models/create_jsmops_alert_task_params_users_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class CreateJsmopsAlertTaskParamsUsersItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_linear_issue_comment_task_params.py b/rootly_sdk/models/create_linear_issue_comment_task_params.py index 7bd6f8ce..dc3ba833 100644 --- a/rootly_sdk/models/create_linear_issue_comment_task_params.py +++ b/rootly_sdk/models/create_linear_issue_comment_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,12 +19,12 @@ class CreateLinearIssueCommentTaskParams: Attributes: issue_id (str): The issue id body (str): The issue description - task_type (CreateLinearIssueCommentTaskParamsTaskType | Unset): + task_type (Union[Unset, CreateLinearIssueCommentTaskParamsTaskType]): """ issue_id: str body: str - task_type: CreateLinearIssueCommentTaskParamsTaskType | Unset = UNSET + task_type: Union[Unset, CreateLinearIssueCommentTaskParamsTaskType] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -34,7 +32,7 @@ def to_dict(self) -> dict[str, Any]: body = self.body - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -59,7 +57,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: body = d.pop("body") _task_type = d.pop("task_type", UNSET) - task_type: CreateLinearIssueCommentTaskParamsTaskType | Unset + task_type: Union[Unset, CreateLinearIssueCommentTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/create_linear_issue_task_params.py b/rootly_sdk/models/create_linear_issue_task_params.py index df69a9e7..4e93228b 100644 --- a/rootly_sdk/models/create_linear_issue_task_params.py +++ b/rootly_sdk/models/create_linear_issue_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -30,60 +28,59 @@ class CreateLinearIssueTaskParams: title (str): The issue title team (CreateLinearIssueTaskParamsTeam): The team id and display name state (CreateLinearIssueTaskParamsState): The state id and display name - task_type (CreateLinearIssueTaskParamsTaskType | Unset): - description (str | Unset): The issue description - project (CreateLinearIssueTaskParamsProject | Unset): The project id and display name - labels (list[CreateLinearIssueTaskParamsLabelsItem] | Unset): - priority (CreateLinearIssueTaskParamsPriority | Unset): The priority id and display name - assign_user_email (str | Unset): The assigned user's email - custom_fields_mapping (None | str | Unset): Custom field mappings. Can contain liquid markup and need to be + task_type (Union[Unset, CreateLinearIssueTaskParamsTaskType]): + description (Union[Unset, str]): The issue description + project (Union[Unset, CreateLinearIssueTaskParamsProject]): The project id and display name + labels (Union[Unset, list['CreateLinearIssueTaskParamsLabelsItem']]): + priority (Union[Unset, CreateLinearIssueTaskParamsPriority]): The priority id and display name + assign_user_email (Union[Unset, str]): The assigned user's email + custom_fields_mapping (Union[None, Unset, str]): Custom field mappings. Can contain liquid markup and need to be valid JSON """ title: str - team: CreateLinearIssueTaskParamsTeam - state: CreateLinearIssueTaskParamsState - task_type: CreateLinearIssueTaskParamsTaskType | Unset = UNSET - description: str | Unset = UNSET - project: CreateLinearIssueTaskParamsProject | Unset = UNSET - labels: list[CreateLinearIssueTaskParamsLabelsItem] | Unset = UNSET - priority: CreateLinearIssueTaskParamsPriority | Unset = UNSET - assign_user_email: str | Unset = UNSET - custom_fields_mapping: None | str | Unset = UNSET + team: "CreateLinearIssueTaskParamsTeam" + state: "CreateLinearIssueTaskParamsState" + task_type: Union[Unset, CreateLinearIssueTaskParamsTaskType] = UNSET + description: Union[Unset, str] = UNSET + project: Union[Unset, "CreateLinearIssueTaskParamsProject"] = UNSET + labels: Union[Unset, list["CreateLinearIssueTaskParamsLabelsItem"]] = UNSET + priority: Union[Unset, "CreateLinearIssueTaskParamsPriority"] = UNSET + assign_user_email: Union[Unset, str] = UNSET + custom_fields_mapping: Union[None, Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - title = self.title team = self.team.to_dict() state = self.state.to_dict() - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type description = self.description - project: dict[str, Any] | Unset = UNSET + project: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.project, Unset): project = self.project.to_dict() - labels: list[dict[str, Any]] | Unset = UNSET + labels: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.labels, Unset): labels = [] for labels_item_data in self.labels: labels_item = labels_item_data.to_dict() labels.append(labels_item) - priority: dict[str, Any] | Unset = UNSET + priority: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.priority, Unset): priority = self.priority.to_dict() assign_user_email = self.assign_user_email - custom_fields_mapping: None | str | Unset + custom_fields_mapping: Union[None, Unset, str] if isinstance(self.custom_fields_mapping, Unset): custom_fields_mapping = UNSET else: @@ -131,7 +128,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: state = CreateLinearIssueTaskParamsState.from_dict(d.pop("state")) _task_type = d.pop("task_type", UNSET) - task_type: CreateLinearIssueTaskParamsTaskType | Unset + task_type: Union[Unset, CreateLinearIssueTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: @@ -140,23 +137,21 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: description = d.pop("description", UNSET) _project = d.pop("project", UNSET) - project: CreateLinearIssueTaskParamsProject | Unset + project: Union[Unset, CreateLinearIssueTaskParamsProject] if isinstance(_project, Unset): project = UNSET else: project = CreateLinearIssueTaskParamsProject.from_dict(_project) + labels = [] _labels = d.pop("labels", UNSET) - labels: list[CreateLinearIssueTaskParamsLabelsItem] | Unset = UNSET - if _labels is not UNSET: - labels = [] - for labels_item_data in _labels: - labels_item = CreateLinearIssueTaskParamsLabelsItem.from_dict(labels_item_data) + for labels_item_data in _labels or []: + labels_item = CreateLinearIssueTaskParamsLabelsItem.from_dict(labels_item_data) - labels.append(labels_item) + labels.append(labels_item) _priority = d.pop("priority", UNSET) - priority: CreateLinearIssueTaskParamsPriority | Unset + priority: Union[Unset, CreateLinearIssueTaskParamsPriority] if isinstance(_priority, Unset): priority = UNSET else: @@ -164,12 +159,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: assign_user_email = d.pop("assign_user_email", UNSET) - def _parse_custom_fields_mapping(data: object) -> None | str | Unset: + def _parse_custom_fields_mapping(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) custom_fields_mapping = _parse_custom_fields_mapping(d.pop("custom_fields_mapping", UNSET)) diff --git a/rootly_sdk/models/create_linear_issue_task_params_labels_item.py b/rootly_sdk/models/create_linear_issue_task_params_labels_item.py index d2c67738..def23341 100644 --- a/rootly_sdk/models/create_linear_issue_task_params_labels_item.py +++ b/rootly_sdk/models/create_linear_issue_task_params_labels_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class CreateLinearIssueTaskParamsLabelsItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_linear_issue_task_params_priority.py b/rootly_sdk/models/create_linear_issue_task_params_priority.py index d281895e..39e12e13 100644 --- a/rootly_sdk/models/create_linear_issue_task_params_priority.py +++ b/rootly_sdk/models/create_linear_issue_task_params_priority.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,12 +14,12 @@ class CreateLinearIssueTaskParamsPriority: """The priority id and display name Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_linear_issue_task_params_project.py b/rootly_sdk/models/create_linear_issue_task_params_project.py index 02bf0115..b96fedf1 100644 --- a/rootly_sdk/models/create_linear_issue_task_params_project.py +++ b/rootly_sdk/models/create_linear_issue_task_params_project.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,12 +14,12 @@ class CreateLinearIssueTaskParamsProject: """The project id and display name Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_linear_issue_task_params_state.py b/rootly_sdk/models/create_linear_issue_task_params_state.py index 4bbea5fa..7100aca7 100644 --- a/rootly_sdk/models/create_linear_issue_task_params_state.py +++ b/rootly_sdk/models/create_linear_issue_task_params_state.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,12 +14,12 @@ class CreateLinearIssueTaskParamsState: """The state id and display name Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_linear_issue_task_params_team.py b/rootly_sdk/models/create_linear_issue_task_params_team.py index 6a4aaa55..7919b34e 100644 --- a/rootly_sdk/models/create_linear_issue_task_params_team.py +++ b/rootly_sdk/models/create_linear_issue_task_params_team.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,12 +14,12 @@ class CreateLinearIssueTaskParamsTeam: """The team id and display name Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_linear_subtask_issue_task_params.py b/rootly_sdk/models/create_linear_subtask_issue_task_params.py index aa6a3465..05447c8e 100644 --- a/rootly_sdk/models/create_linear_subtask_issue_task_params.py +++ b/rootly_sdk/models/create_linear_subtask_issue_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -30,45 +28,44 @@ class CreateLinearSubtaskIssueTaskParams: parent_issue_id (str): The parent issue title (str): The issue title state (CreateLinearSubtaskIssueTaskParamsState): The state id and display name - task_type (CreateLinearSubtaskIssueTaskParamsTaskType | Unset): - description (str | Unset): The issue description - priority (CreateLinearSubtaskIssueTaskParamsPriority | Unset): The priority id and display name - labels (list[CreateLinearSubtaskIssueTaskParamsLabelsItem] | Unset): - assign_user_email (str | Unset): The assigned user's email - custom_fields_mapping (None | str | Unset): Custom field mappings. Can contain liquid markup and need to be + task_type (Union[Unset, CreateLinearSubtaskIssueTaskParamsTaskType]): + description (Union[Unset, str]): The issue description + priority (Union[Unset, CreateLinearSubtaskIssueTaskParamsPriority]): The priority id and display name + labels (Union[Unset, list['CreateLinearSubtaskIssueTaskParamsLabelsItem']]): + assign_user_email (Union[Unset, str]): The assigned user's email + custom_fields_mapping (Union[None, Unset, str]): Custom field mappings. Can contain liquid markup and need to be valid JSON """ parent_issue_id: str title: str - state: CreateLinearSubtaskIssueTaskParamsState - task_type: CreateLinearSubtaskIssueTaskParamsTaskType | Unset = UNSET - description: str | Unset = UNSET - priority: CreateLinearSubtaskIssueTaskParamsPriority | Unset = UNSET - labels: list[CreateLinearSubtaskIssueTaskParamsLabelsItem] | Unset = UNSET - assign_user_email: str | Unset = UNSET - custom_fields_mapping: None | str | Unset = UNSET + state: "CreateLinearSubtaskIssueTaskParamsState" + task_type: Union[Unset, CreateLinearSubtaskIssueTaskParamsTaskType] = UNSET + description: Union[Unset, str] = UNSET + priority: Union[Unset, "CreateLinearSubtaskIssueTaskParamsPriority"] = UNSET + labels: Union[Unset, list["CreateLinearSubtaskIssueTaskParamsLabelsItem"]] = UNSET + assign_user_email: Union[Unset, str] = UNSET + custom_fields_mapping: Union[None, Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - parent_issue_id = self.parent_issue_id title = self.title state = self.state.to_dict() - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type description = self.description - priority: dict[str, Any] | Unset = UNSET + priority: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.priority, Unset): priority = self.priority.to_dict() - labels: list[dict[str, Any]] | Unset = UNSET + labels: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.labels, Unset): labels = [] for labels_item_data in self.labels: @@ -77,7 +74,7 @@ def to_dict(self) -> dict[str, Any]: assign_user_email = self.assign_user_email - custom_fields_mapping: None | str | Unset + custom_fields_mapping: Union[None, Unset, str] if isinstance(self.custom_fields_mapping, Unset): custom_fields_mapping = UNSET else: @@ -123,7 +120,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: state = CreateLinearSubtaskIssueTaskParamsState.from_dict(d.pop("state")) _task_type = d.pop("task_type", UNSET) - task_type: CreateLinearSubtaskIssueTaskParamsTaskType | Unset + task_type: Union[Unset, CreateLinearSubtaskIssueTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: @@ -132,29 +129,27 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: description = d.pop("description", UNSET) _priority = d.pop("priority", UNSET) - priority: CreateLinearSubtaskIssueTaskParamsPriority | Unset + priority: Union[Unset, CreateLinearSubtaskIssueTaskParamsPriority] if isinstance(_priority, Unset): priority = UNSET else: priority = CreateLinearSubtaskIssueTaskParamsPriority.from_dict(_priority) + labels = [] _labels = d.pop("labels", UNSET) - labels: list[CreateLinearSubtaskIssueTaskParamsLabelsItem] | Unset = UNSET - if _labels is not UNSET: - labels = [] - for labels_item_data in _labels: - labels_item = CreateLinearSubtaskIssueTaskParamsLabelsItem.from_dict(labels_item_data) + for labels_item_data in _labels or []: + labels_item = CreateLinearSubtaskIssueTaskParamsLabelsItem.from_dict(labels_item_data) - labels.append(labels_item) + labels.append(labels_item) assign_user_email = d.pop("assign_user_email", UNSET) - def _parse_custom_fields_mapping(data: object) -> None | str | Unset: + def _parse_custom_fields_mapping(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) custom_fields_mapping = _parse_custom_fields_mapping(d.pop("custom_fields_mapping", UNSET)) diff --git a/rootly_sdk/models/create_linear_subtask_issue_task_params_labels_item.py b/rootly_sdk/models/create_linear_subtask_issue_task_params_labels_item.py index ca04ec13..b57b3fd8 100644 --- a/rootly_sdk/models/create_linear_subtask_issue_task_params_labels_item.py +++ b/rootly_sdk/models/create_linear_subtask_issue_task_params_labels_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class CreateLinearSubtaskIssueTaskParamsLabelsItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_linear_subtask_issue_task_params_priority.py b/rootly_sdk/models/create_linear_subtask_issue_task_params_priority.py index d605d101..f11c1e30 100644 --- a/rootly_sdk/models/create_linear_subtask_issue_task_params_priority.py +++ b/rootly_sdk/models/create_linear_subtask_issue_task_params_priority.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,12 +14,12 @@ class CreateLinearSubtaskIssueTaskParamsPriority: """The priority id and display name Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_linear_subtask_issue_task_params_state.py b/rootly_sdk/models/create_linear_subtask_issue_task_params_state.py index 8c1e27be..08f53201 100644 --- a/rootly_sdk/models/create_linear_subtask_issue_task_params_state.py +++ b/rootly_sdk/models/create_linear_subtask_issue_task_params_state.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,12 +14,12 @@ class CreateLinearSubtaskIssueTaskParamsState: """The state id and display name Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_microsoft_teams_channel_task_params.py b/rootly_sdk/models/create_microsoft_teams_channel_task_params.py index a52cb327..1d098e85 100644 --- a/rootly_sdk/models/create_microsoft_teams_channel_task_params.py +++ b/rootly_sdk/models/create_microsoft_teams_channel_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,31 +27,30 @@ class CreateMicrosoftTeamsChannelTaskParams: Attributes: team (CreateMicrosoftTeamsChannelTaskParamsTeam): title (str): Microsoft Team channel title - task_type (CreateMicrosoftTeamsChannelTaskParamsTaskType | Unset): - description (str | Unset): Microsoft Team channel description - private (CreateMicrosoftTeamsChannelTaskParamsPrivate | Unset): Default: 'auto'. + task_type (Union[Unset, CreateMicrosoftTeamsChannelTaskParamsTaskType]): + description (Union[Unset, str]): Microsoft Team channel description + private (Union[Unset, CreateMicrosoftTeamsChannelTaskParamsPrivate]): Default: 'auto'. """ - team: CreateMicrosoftTeamsChannelTaskParamsTeam + team: "CreateMicrosoftTeamsChannelTaskParamsTeam" title: str - task_type: CreateMicrosoftTeamsChannelTaskParamsTaskType | Unset = UNSET - description: str | Unset = UNSET - private: CreateMicrosoftTeamsChannelTaskParamsPrivate | Unset = "auto" + task_type: Union[Unset, CreateMicrosoftTeamsChannelTaskParamsTaskType] = UNSET + description: Union[Unset, str] = UNSET + private: Union[Unset, CreateMicrosoftTeamsChannelTaskParamsPrivate] = "auto" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - team = self.team.to_dict() title = self.title - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type description = self.description - private: str | Unset = UNSET + private: Union[Unset, str] = UNSET if not isinstance(self.private, Unset): private = self.private @@ -84,7 +81,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: title = d.pop("title") _task_type = d.pop("task_type", UNSET) - task_type: CreateMicrosoftTeamsChannelTaskParamsTaskType | Unset + task_type: Union[Unset, CreateMicrosoftTeamsChannelTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: @@ -93,7 +90,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: description = d.pop("description", UNSET) _private = d.pop("private", UNSET) - private: CreateMicrosoftTeamsChannelTaskParamsPrivate | Unset + private: Union[Unset, CreateMicrosoftTeamsChannelTaskParamsPrivate] if isinstance(_private, Unset): private = UNSET else: diff --git a/rootly_sdk/models/create_microsoft_teams_channel_task_params_team.py b/rootly_sdk/models/create_microsoft_teams_channel_task_params_team.py index 3d7128e5..5d60d238 100644 --- a/rootly_sdk/models/create_microsoft_teams_channel_task_params_team.py +++ b/rootly_sdk/models/create_microsoft_teams_channel_task_params_team.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class CreateMicrosoftTeamsChannelTaskParamsTeam: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_microsoft_teams_chat_task_params.py b/rootly_sdk/models/create_microsoft_teams_chat_task_params.py index 28cf2434..dc41facf 100644 --- a/rootly_sdk/models/create_microsoft_teams_chat_task_params.py +++ b/rootly_sdk/models/create_microsoft_teams_chat_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,36 +27,35 @@ class CreateMicrosoftTeamsChatTaskParams: """ Attributes: - members (list[CreateMicrosoftTeamsChatTaskParamsMembersItem]): Array of members to include in the chat - task_type (CreateMicrosoftTeamsChatTaskParamsTaskType | Unset): - topic (None | str | Unset): Chat topic (only for group chats) - chat_type (CreateMicrosoftTeamsChatTaskParamsChatType | Unset): Type of chat to create Default: 'group'. + members (list['CreateMicrosoftTeamsChatTaskParamsMembersItem']): Array of members to include in the chat + task_type (Union[Unset, CreateMicrosoftTeamsChatTaskParamsTaskType]): + topic (Union[None, Unset, str]): Chat topic (only for group chats) + chat_type (Union[Unset, CreateMicrosoftTeamsChatTaskParamsChatType]): Type of chat to create Default: 'group'. """ - members: list[CreateMicrosoftTeamsChatTaskParamsMembersItem] - task_type: CreateMicrosoftTeamsChatTaskParamsTaskType | Unset = UNSET - topic: None | str | Unset = UNSET - chat_type: CreateMicrosoftTeamsChatTaskParamsChatType | Unset = "group" + members: list["CreateMicrosoftTeamsChatTaskParamsMembersItem"] + task_type: Union[Unset, CreateMicrosoftTeamsChatTaskParamsTaskType] = UNSET + topic: Union[None, Unset, str] = UNSET + chat_type: Union[Unset, CreateMicrosoftTeamsChatTaskParamsChatType] = "group" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - members = [] for members_item_data in self.members: members_item = members_item_data.to_dict() members.append(members_item) - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - topic: None | str | Unset + topic: Union[None, Unset, str] if isinstance(self.topic, Unset): topic = UNSET else: topic = self.topic - chat_type: str | Unset = UNSET + chat_type: Union[Unset, str] = UNSET if not isinstance(self.chat_type, Unset): chat_type = self.chat_type @@ -93,23 +90,23 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: members.append(members_item) _task_type = d.pop("task_type", UNSET) - task_type: CreateMicrosoftTeamsChatTaskParamsTaskType | Unset + task_type: Union[Unset, CreateMicrosoftTeamsChatTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: task_type = check_create_microsoft_teams_chat_task_params_task_type(_task_type) - def _parse_topic(data: object) -> None | str | Unset: + def _parse_topic(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) topic = _parse_topic(d.pop("topic", UNSET)) _chat_type = d.pop("chat_type", UNSET) - chat_type: CreateMicrosoftTeamsChatTaskParamsChatType | Unset + chat_type: Union[Unset, CreateMicrosoftTeamsChatTaskParamsChatType] if isinstance(_chat_type, Unset): chat_type = UNSET else: diff --git a/rootly_sdk/models/create_microsoft_teams_chat_task_params_members_item.py b/rootly_sdk/models/create_microsoft_teams_chat_task_params_members_item.py index 714d243e..2211ee50 100644 --- a/rootly_sdk/models/create_microsoft_teams_chat_task_params_members_item.py +++ b/rootly_sdk/models/create_microsoft_teams_chat_task_params_members_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class CreateMicrosoftTeamsChatTaskParamsMembersItem: """ Attributes: - email (str | Unset): - name (str | Unset): + email (Union[Unset, str]): + name (Union[Unset, str]): """ - email: str | Unset = UNSET - name: str | Unset = UNSET + email: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_microsoft_teams_meeting_task_params.py b/rootly_sdk/models/create_microsoft_teams_meeting_task_params.py index 02fb935f..71a9130a 100644 --- a/rootly_sdk/models/create_microsoft_teams_meeting_task_params.py +++ b/rootly_sdk/models/create_microsoft_teams_meeting_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -31,43 +29,42 @@ class CreateMicrosoftTeamsMeetingTaskParams: Attributes: name (str): The meeting name subject (str): The meeting subject - task_type (CreateMicrosoftTeamsMeetingTaskParamsTaskType | Unset): - record_meeting (bool | Unset): Rootly AI will record the meeting and automatically generate a transcript and - summary from your meeting - recording_mode (CreateMicrosoftTeamsMeetingTaskParamsRecordingMode | Unset): The video layout for the bot's - recording (e.g. speaker_view, gallery_view, gallery_view_v2, audio_only) - post_to_incident_timeline (bool | Unset): - post_to_slack_channels (list[CreateMicrosoftTeamsMeetingTaskParamsPostToSlackChannelsItem] | Unset): + task_type (Union[Unset, CreateMicrosoftTeamsMeetingTaskParamsTaskType]): + record_meeting (Union[Unset, bool]): Rootly AI will record the meeting and automatically generate a transcript + and summary from your meeting + recording_mode (Union[Unset, CreateMicrosoftTeamsMeetingTaskParamsRecordingMode]): The video layout for the + bot's recording (e.g. speaker_view, gallery_view, gallery_view_v2, audio_only) + post_to_incident_timeline (Union[Unset, bool]): + post_to_slack_channels (Union[Unset, list['CreateMicrosoftTeamsMeetingTaskParamsPostToSlackChannelsItem']]): """ name: str subject: str - task_type: CreateMicrosoftTeamsMeetingTaskParamsTaskType | Unset = UNSET - record_meeting: bool | Unset = UNSET - recording_mode: CreateMicrosoftTeamsMeetingTaskParamsRecordingMode | Unset = UNSET - post_to_incident_timeline: bool | Unset = UNSET - post_to_slack_channels: list[CreateMicrosoftTeamsMeetingTaskParamsPostToSlackChannelsItem] | Unset = UNSET + task_type: Union[Unset, CreateMicrosoftTeamsMeetingTaskParamsTaskType] = UNSET + record_meeting: Union[Unset, bool] = UNSET + recording_mode: Union[Unset, CreateMicrosoftTeamsMeetingTaskParamsRecordingMode] = UNSET + post_to_incident_timeline: Union[Unset, bool] = UNSET + post_to_slack_channels: Union[Unset, list["CreateMicrosoftTeamsMeetingTaskParamsPostToSlackChannelsItem"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - name = self.name subject = self.subject - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type record_meeting = self.record_meeting - recording_mode: str | Unset = UNSET + recording_mode: Union[Unset, str] = UNSET if not isinstance(self.recording_mode, Unset): recording_mode = self.recording_mode post_to_incident_timeline = self.post_to_incident_timeline - post_to_slack_channels: list[dict[str, Any]] | Unset = UNSET + post_to_slack_channels: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.post_to_slack_channels, Unset): post_to_slack_channels = [] for post_to_slack_channels_item_data in self.post_to_slack_channels: @@ -107,7 +104,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: subject = d.pop("subject") _task_type = d.pop("task_type", UNSET) - task_type: CreateMicrosoftTeamsMeetingTaskParamsTaskType | Unset + task_type: Union[Unset, CreateMicrosoftTeamsMeetingTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: @@ -116,7 +113,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: record_meeting = d.pop("record_meeting", UNSET) _recording_mode = d.pop("recording_mode", UNSET) - recording_mode: CreateMicrosoftTeamsMeetingTaskParamsRecordingMode | Unset + recording_mode: Union[Unset, CreateMicrosoftTeamsMeetingTaskParamsRecordingMode] if isinstance(_recording_mode, Unset): recording_mode = UNSET else: @@ -124,16 +121,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: post_to_incident_timeline = d.pop("post_to_incident_timeline", UNSET) + post_to_slack_channels = [] _post_to_slack_channels = d.pop("post_to_slack_channels", UNSET) - post_to_slack_channels: list[CreateMicrosoftTeamsMeetingTaskParamsPostToSlackChannelsItem] | Unset = UNSET - if _post_to_slack_channels is not UNSET: - post_to_slack_channels = [] - for post_to_slack_channels_item_data in _post_to_slack_channels: - post_to_slack_channels_item = CreateMicrosoftTeamsMeetingTaskParamsPostToSlackChannelsItem.from_dict( - post_to_slack_channels_item_data - ) + for post_to_slack_channels_item_data in _post_to_slack_channels or []: + post_to_slack_channels_item = CreateMicrosoftTeamsMeetingTaskParamsPostToSlackChannelsItem.from_dict( + post_to_slack_channels_item_data + ) - post_to_slack_channels.append(post_to_slack_channels_item) + post_to_slack_channels.append(post_to_slack_channels_item) create_microsoft_teams_meeting_task_params = cls( name=name, diff --git a/rootly_sdk/models/create_microsoft_teams_meeting_task_params_post_to_slack_channels_item.py b/rootly_sdk/models/create_microsoft_teams_meeting_task_params_post_to_slack_channels_item.py index dc99a191..6b90499a 100644 --- a/rootly_sdk/models/create_microsoft_teams_meeting_task_params_post_to_slack_channels_item.py +++ b/rootly_sdk/models/create_microsoft_teams_meeting_task_params_post_to_slack_channels_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class CreateMicrosoftTeamsMeetingTaskParamsPostToSlackChannelsItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_mistral_chat_completion_task_params.py b/rootly_sdk/models/create_mistral_chat_completion_task_params.py index 2747acd8..3217bb2a 100644 --- a/rootly_sdk/models/create_mistral_chat_completion_task_params.py +++ b/rootly_sdk/models/create_mistral_chat_completion_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -25,29 +23,28 @@ class CreateMistralChatCompletionTaskParams: Attributes: model (CreateMistralChatCompletionTaskParamsModel): The Mistral model. eg: mistral-large-latest prompt (str): The prompt to send to Mistral - task_type (CreateMistralChatCompletionTaskParamsTaskType | Unset): - system_prompt (str | Unset): The system prompt to send to Mistral (optional) - temperature (float | Unset): Sampling temperature (0.0-1.5). Higher values make output more random. - max_tokens (int | Unset): Maximum number of tokens to generate - top_p (float | Unset): Nucleus sampling parameter (0.0-1.0) + task_type (Union[Unset, CreateMistralChatCompletionTaskParamsTaskType]): + system_prompt (Union[Unset, str]): The system prompt to send to Mistral (optional) + temperature (Union[Unset, float]): Sampling temperature (0.0-1.5). Higher values make output more random. + max_tokens (Union[Unset, int]): Maximum number of tokens to generate + top_p (Union[Unset, float]): Nucleus sampling parameter (0.0-1.0) """ - model: CreateMistralChatCompletionTaskParamsModel + model: "CreateMistralChatCompletionTaskParamsModel" prompt: str - task_type: CreateMistralChatCompletionTaskParamsTaskType | Unset = UNSET - system_prompt: str | Unset = UNSET - temperature: float | Unset = UNSET - max_tokens: int | Unset = UNSET - top_p: float | Unset = UNSET + task_type: Union[Unset, CreateMistralChatCompletionTaskParamsTaskType] = UNSET + system_prompt: Union[Unset, str] = UNSET + temperature: Union[Unset, float] = UNSET + max_tokens: Union[Unset, int] = UNSET + top_p: Union[Unset, float] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - model = self.model.to_dict() prompt = self.prompt - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -90,7 +87,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: prompt = d.pop("prompt") _task_type = d.pop("task_type", UNSET) - task_type: CreateMistralChatCompletionTaskParamsTaskType | Unset + task_type: Union[Unset, CreateMistralChatCompletionTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/create_mistral_chat_completion_task_params_model.py b/rootly_sdk/models/create_mistral_chat_completion_task_params_model.py index 7cda8fef..e9e03abc 100644 --- a/rootly_sdk/models/create_mistral_chat_completion_task_params_model.py +++ b/rootly_sdk/models/create_mistral_chat_completion_task_params_model.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,12 +14,12 @@ class CreateMistralChatCompletionTaskParamsModel: """The Mistral model. eg: mistral-large-latest Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_motion_task_task_params.py b/rootly_sdk/models/create_motion_task_task_params.py index f266e09a..992e8b54 100644 --- a/rootly_sdk/models/create_motion_task_task_params.py +++ b/rootly_sdk/models/create_motion_task_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -28,53 +26,50 @@ class CreateMotionTaskTaskParams: Attributes: workspace (CreateMotionTaskTaskParamsWorkspace): title (str): The task title - task_type (CreateMotionTaskTaskParamsTaskType | Unset): - project (CreateMotionTaskTaskParamsProject | Unset): - status (CreateMotionTaskTaskParamsStatus | Unset): - description (str | Unset): The task description - labels (list[str] | Unset): - priority (CreateMotionTaskTaskParamsPriority | Unset): The priority id and display name - duration (str | Unset): The duration. Eg. "NONE", "REMINDER", or a integer greater than 0. - due_date (str | Unset): The due date + task_type (Union[Unset, CreateMotionTaskTaskParamsTaskType]): + project (Union[Unset, CreateMotionTaskTaskParamsProject]): + status (Union[Unset, CreateMotionTaskTaskParamsStatus]): + description (Union[Unset, str]): The task description + labels (Union[Unset, str]): The task labels + priority (Union[Unset, CreateMotionTaskTaskParamsPriority]): The priority id and display name + duration (Union[Unset, str]): The duration. Eg. "NONE", "REMINDER", or a integer greater than 0. + due_date (Union[Unset, str]): The due date """ - workspace: CreateMotionTaskTaskParamsWorkspace + workspace: "CreateMotionTaskTaskParamsWorkspace" title: str - task_type: CreateMotionTaskTaskParamsTaskType | Unset = UNSET - project: CreateMotionTaskTaskParamsProject | Unset = UNSET - status: CreateMotionTaskTaskParamsStatus | Unset = UNSET - description: str | Unset = UNSET - labels: list[str] | Unset = UNSET - priority: CreateMotionTaskTaskParamsPriority | Unset = UNSET - duration: str | Unset = UNSET - due_date: str | Unset = UNSET + task_type: Union[Unset, CreateMotionTaskTaskParamsTaskType] = UNSET + project: Union[Unset, "CreateMotionTaskTaskParamsProject"] = UNSET + status: Union[Unset, "CreateMotionTaskTaskParamsStatus"] = UNSET + description: Union[Unset, str] = UNSET + labels: Union[Unset, str] = UNSET + priority: Union[Unset, "CreateMotionTaskTaskParamsPriority"] = UNSET + duration: Union[Unset, str] = UNSET + due_date: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - workspace = self.workspace.to_dict() title = self.title - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - project: dict[str, Any] | Unset = UNSET + project: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.project, Unset): project = self.project.to_dict() - status: dict[str, Any] | Unset = UNSET + status: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.status, Unset): status = self.status.to_dict() description = self.description - labels: list[str] | Unset = UNSET - if not isinstance(self.labels, Unset): - labels = self.labels + labels = self.labels - priority: dict[str, Any] | Unset = UNSET + priority: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.priority, Unset): priority = self.priority.to_dict() @@ -122,21 +117,21 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: title = d.pop("title") _task_type = d.pop("task_type", UNSET) - task_type: CreateMotionTaskTaskParamsTaskType | Unset + task_type: Union[Unset, CreateMotionTaskTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: task_type = check_create_motion_task_task_params_task_type(_task_type) _project = d.pop("project", UNSET) - project: CreateMotionTaskTaskParamsProject | Unset + project: Union[Unset, CreateMotionTaskTaskParamsProject] if isinstance(_project, Unset): project = UNSET else: project = CreateMotionTaskTaskParamsProject.from_dict(_project) _status = d.pop("status", UNSET) - status: CreateMotionTaskTaskParamsStatus | Unset + status: Union[Unset, CreateMotionTaskTaskParamsStatus] if isinstance(_status, Unset): status = UNSET else: @@ -144,10 +139,10 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: description = d.pop("description", UNSET) - labels = cast(list[str], d.pop("labels", UNSET)) + labels = d.pop("labels", UNSET) _priority = d.pop("priority", UNSET) - priority: CreateMotionTaskTaskParamsPriority | Unset + priority: Union[Unset, CreateMotionTaskTaskParamsPriority] if isinstance(_priority, Unset): priority = UNSET else: diff --git a/rootly_sdk/models/create_motion_task_task_params_priority.py b/rootly_sdk/models/create_motion_task_task_params_priority.py index 493c01f5..802f2a1a 100644 --- a/rootly_sdk/models/create_motion_task_task_params_priority.py +++ b/rootly_sdk/models/create_motion_task_task_params_priority.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,12 +14,12 @@ class CreateMotionTaskTaskParamsPriority: """The priority id and display name Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_motion_task_task_params_project.py b/rootly_sdk/models/create_motion_task_task_params_project.py index 4843b381..28dc0adb 100644 --- a/rootly_sdk/models/create_motion_task_task_params_project.py +++ b/rootly_sdk/models/create_motion_task_task_params_project.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class CreateMotionTaskTaskParamsProject: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_motion_task_task_params_status.py b/rootly_sdk/models/create_motion_task_task_params_status.py index 97abb0ea..01eab0bf 100644 --- a/rootly_sdk/models/create_motion_task_task_params_status.py +++ b/rootly_sdk/models/create_motion_task_task_params_status.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class CreateMotionTaskTaskParamsStatus: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_motion_task_task_params_workspace.py b/rootly_sdk/models/create_motion_task_task_params_workspace.py index 13cf3220..c63d7b3f 100644 --- a/rootly_sdk/models/create_motion_task_task_params_workspace.py +++ b/rootly_sdk/models/create_motion_task_task_params_workspace.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class CreateMotionTaskTaskParamsWorkspace: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_notion_page_task_params.py b/rootly_sdk/models/create_notion_page_task_params.py index aa2d8930..2251c907 100644 --- a/rootly_sdk/models/create_notion_page_task_params.py +++ b/rootly_sdk/models/create_notion_page_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -25,32 +23,31 @@ class CreateNotionPageTaskParams: Attributes: title (str): The Notion page title parent_page (CreateNotionPageTaskParamsParentPage): The parent page id and display name - task_type (CreateNotionPageTaskParamsTaskType | Unset): - post_mortem_template_id (str | Unset): Retrospective template to use when creating page task, if desired - content (str | Unset): Custom page content with liquid templating support. When provided, only this content will - be rendered (no default sections) - mark_post_mortem_as_published (bool | Unset): Default: True. - show_timeline_as_table (bool | Unset): - show_action_items_as_table (bool | Unset): + task_type (Union[Unset, CreateNotionPageTaskParamsTaskType]): + post_mortem_template_id (Union[Unset, str]): Retrospective template to use when creating page task, if desired + content (Union[Unset, str]): Custom page content with liquid templating support. When provided, only this + content will be rendered (no default sections) + mark_post_mortem_as_published (Union[Unset, bool]): Default: True. + show_timeline_as_table (Union[Unset, bool]): + show_action_items_as_table (Union[Unset, bool]): """ title: str - parent_page: CreateNotionPageTaskParamsParentPage - task_type: CreateNotionPageTaskParamsTaskType | Unset = UNSET - post_mortem_template_id: str | Unset = UNSET - content: str | Unset = UNSET - mark_post_mortem_as_published: bool | Unset = True - show_timeline_as_table: bool | Unset = UNSET - show_action_items_as_table: bool | Unset = UNSET + parent_page: "CreateNotionPageTaskParamsParentPage" + task_type: Union[Unset, CreateNotionPageTaskParamsTaskType] = UNSET + post_mortem_template_id: Union[Unset, str] = UNSET + content: Union[Unset, str] = UNSET + mark_post_mortem_as_published: Union[Unset, bool] = True + show_timeline_as_table: Union[Unset, bool] = UNSET + show_action_items_as_table: Union[Unset, bool] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - title = self.title parent_page = self.parent_page.to_dict() - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -97,7 +94,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: parent_page = CreateNotionPageTaskParamsParentPage.from_dict(d.pop("parent_page")) _task_type = d.pop("task_type", UNSET) - task_type: CreateNotionPageTaskParamsTaskType | Unset + task_type: Union[Unset, CreateNotionPageTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/create_notion_page_task_params_parent_page.py b/rootly_sdk/models/create_notion_page_task_params_parent_page.py index 08a6d60c..94cbc541 100644 --- a/rootly_sdk/models/create_notion_page_task_params_parent_page.py +++ b/rootly_sdk/models/create_notion_page_task_params_parent_page.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,12 +14,12 @@ class CreateNotionPageTaskParamsParentPage: """The parent page id and display name Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_openai_chat_completion_task_params.py b/rootly_sdk/models/create_openai_chat_completion_task_params.py index fbe1281e..06ae1f54 100644 --- a/rootly_sdk/models/create_openai_chat_completion_task_params.py +++ b/rootly_sdk/models/create_openai_chat_completion_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -33,35 +31,34 @@ class CreateOpenaiChatCompletionTaskParams: Attributes: model (CreateOpenaiChatCompletionTaskParamsModel): The OpenAI model. eg: gpt-5-nano prompt (str): The prompt to send to OpenAI - task_type (CreateOpenaiChatCompletionTaskParamsTaskType | Unset): - system_prompt (str | Unset): The system prompt to send to OpenAI (optional) - temperature (float | Unset): Controls randomness in the response. Higher values make output more random - max_tokens (int | Unset): Maximum number of tokens to generate in the response - top_p (float | Unset): Controls diversity via nucleus sampling. Lower values make output more focused - reasoning_effort (CreateOpenaiChatCompletionTaskParamsReasoningEffort | Unset): Constrains effort on reasoning - for GPT-5 and o-series models - reasoning_summary (CreateOpenaiChatCompletionTaskParamsReasoningSummary | Unset): Summary of the reasoning + task_type (Union[Unset, CreateOpenaiChatCompletionTaskParamsTaskType]): + system_prompt (Union[Unset, str]): The system prompt to send to OpenAI (optional) + temperature (Union[Unset, float]): Controls randomness in the response. Higher values make output more random + max_tokens (Union[Unset, int]): Maximum number of tokens to generate in the response + top_p (Union[Unset, float]): Controls diversity via nucleus sampling. Lower values make output more focused + reasoning_effort (Union[Unset, CreateOpenaiChatCompletionTaskParamsReasoningEffort]): Constrains effort on + reasoning for GPT-5 and o-series models + reasoning_summary (Union[Unset, CreateOpenaiChatCompletionTaskParamsReasoningSummary]): Summary of the reasoning performed by the model for GPT-5 and o-series models """ - model: CreateOpenaiChatCompletionTaskParamsModel + model: "CreateOpenaiChatCompletionTaskParamsModel" prompt: str - task_type: CreateOpenaiChatCompletionTaskParamsTaskType | Unset = UNSET - system_prompt: str | Unset = UNSET - temperature: float | Unset = UNSET - max_tokens: int | Unset = UNSET - top_p: float | Unset = UNSET - reasoning_effort: CreateOpenaiChatCompletionTaskParamsReasoningEffort | Unset = UNSET - reasoning_summary: CreateOpenaiChatCompletionTaskParamsReasoningSummary | Unset = UNSET + task_type: Union[Unset, CreateOpenaiChatCompletionTaskParamsTaskType] = UNSET + system_prompt: Union[Unset, str] = UNSET + temperature: Union[Unset, float] = UNSET + max_tokens: Union[Unset, int] = UNSET + top_p: Union[Unset, float] = UNSET + reasoning_effort: Union[Unset, CreateOpenaiChatCompletionTaskParamsReasoningEffort] = UNSET + reasoning_summary: Union[Unset, CreateOpenaiChatCompletionTaskParamsReasoningSummary] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - model = self.model.to_dict() prompt = self.prompt - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -73,11 +70,11 @@ def to_dict(self) -> dict[str, Any]: top_p = self.top_p - reasoning_effort: str | Unset = UNSET + reasoning_effort: Union[Unset, str] = UNSET if not isinstance(self.reasoning_effort, Unset): reasoning_effort = self.reasoning_effort - reasoning_summary: str | Unset = UNSET + reasoning_summary: Union[Unset, str] = UNSET if not isinstance(self.reasoning_summary, Unset): reasoning_summary = self.reasoning_summary @@ -116,7 +113,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: prompt = d.pop("prompt") _task_type = d.pop("task_type", UNSET) - task_type: CreateOpenaiChatCompletionTaskParamsTaskType | Unset + task_type: Union[Unset, CreateOpenaiChatCompletionTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: @@ -131,14 +128,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: top_p = d.pop("top_p", UNSET) _reasoning_effort = d.pop("reasoning_effort", UNSET) - reasoning_effort: CreateOpenaiChatCompletionTaskParamsReasoningEffort | Unset + reasoning_effort: Union[Unset, CreateOpenaiChatCompletionTaskParamsReasoningEffort] if isinstance(_reasoning_effort, Unset): reasoning_effort = UNSET else: reasoning_effort = check_create_openai_chat_completion_task_params_reasoning_effort(_reasoning_effort) _reasoning_summary = d.pop("reasoning_summary", UNSET) - reasoning_summary: CreateOpenaiChatCompletionTaskParamsReasoningSummary | Unset + reasoning_summary: Union[Unset, CreateOpenaiChatCompletionTaskParamsReasoningSummary] if isinstance(_reasoning_summary, Unset): reasoning_summary = UNSET else: diff --git a/rootly_sdk/models/create_openai_chat_completion_task_params_model.py b/rootly_sdk/models/create_openai_chat_completion_task_params_model.py index 927f4f61..4ed783a7 100644 --- a/rootly_sdk/models/create_openai_chat_completion_task_params_model.py +++ b/rootly_sdk/models/create_openai_chat_completion_task_params_model.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,12 +14,12 @@ class CreateOpenaiChatCompletionTaskParamsModel: """The OpenAI model. eg: gpt-5-nano Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_opsgenie_alert_task_params.py b/rootly_sdk/models/create_opsgenie_alert_task_params.py index b1e7967b..52c552b3 100644 --- a/rootly_sdk/models/create_opsgenie_alert_task_params.py +++ b/rootly_sdk/models/create_opsgenie_alert_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -31,71 +29,70 @@ class CreateOpsgenieAlertTaskParams: """ Attributes: message (str): Message of the alert - task_type (CreateOpsgenieAlertTaskParamsTaskType | Unset): - description (str | Unset): Description field of the alert that is generally used to provide a detailed + task_type (Union[Unset, CreateOpsgenieAlertTaskParamsTaskType]): + description (Union[Unset, str]): Description field of the alert that is generally used to provide a detailed information about the alert - teams (list[CreateOpsgenieAlertTaskParamsTeamsItem] | Unset): - users (list[CreateOpsgenieAlertTaskParamsUsersItem] | Unset): - schedules (list[CreateOpsgenieAlertTaskParamsSchedulesItem] | Unset): - escalations (list[CreateOpsgenieAlertTaskParamsEscalationsItem] | Unset): - priority (CreateOpsgenieAlertTaskParamsPriority | Unset): Default: 'P1'. - details (None | str | Unset): Details payload. Can contain liquid markup and need to be valid JSON + teams (Union[Unset, list['CreateOpsgenieAlertTaskParamsTeamsItem']]): + users (Union[Unset, list['CreateOpsgenieAlertTaskParamsUsersItem']]): + schedules (Union[Unset, list['CreateOpsgenieAlertTaskParamsSchedulesItem']]): + escalations (Union[Unset, list['CreateOpsgenieAlertTaskParamsEscalationsItem']]): + priority (Union[Unset, CreateOpsgenieAlertTaskParamsPriority]): Default: 'P1'. + details (Union[None, Unset, str]): Details payload. Can contain liquid markup and need to be valid JSON """ message: str - task_type: CreateOpsgenieAlertTaskParamsTaskType | Unset = UNSET - description: str | Unset = UNSET - teams: list[CreateOpsgenieAlertTaskParamsTeamsItem] | Unset = UNSET - users: list[CreateOpsgenieAlertTaskParamsUsersItem] | Unset = UNSET - schedules: list[CreateOpsgenieAlertTaskParamsSchedulesItem] | Unset = UNSET - escalations: list[CreateOpsgenieAlertTaskParamsEscalationsItem] | Unset = UNSET - priority: CreateOpsgenieAlertTaskParamsPriority | Unset = "P1" - details: None | str | Unset = UNSET + task_type: Union[Unset, CreateOpsgenieAlertTaskParamsTaskType] = UNSET + description: Union[Unset, str] = UNSET + teams: Union[Unset, list["CreateOpsgenieAlertTaskParamsTeamsItem"]] = UNSET + users: Union[Unset, list["CreateOpsgenieAlertTaskParamsUsersItem"]] = UNSET + schedules: Union[Unset, list["CreateOpsgenieAlertTaskParamsSchedulesItem"]] = UNSET + escalations: Union[Unset, list["CreateOpsgenieAlertTaskParamsEscalationsItem"]] = UNSET + priority: Union[Unset, CreateOpsgenieAlertTaskParamsPriority] = "P1" + details: Union[None, Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - message = self.message - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type description = self.description - teams: list[dict[str, Any]] | Unset = UNSET + teams: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.teams, Unset): teams = [] for teams_item_data in self.teams: teams_item = teams_item_data.to_dict() teams.append(teams_item) - users: list[dict[str, Any]] | Unset = UNSET + users: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.users, Unset): users = [] for users_item_data in self.users: users_item = users_item_data.to_dict() users.append(users_item) - schedules: list[dict[str, Any]] | Unset = UNSET + schedules: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.schedules, Unset): schedules = [] for schedules_item_data in self.schedules: schedules_item = schedules_item_data.to_dict() schedules.append(schedules_item) - escalations: list[dict[str, Any]] | Unset = UNSET + escalations: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.escalations, Unset): escalations = [] for escalations_item_data in self.escalations: escalations_item = escalations_item_data.to_dict() escalations.append(escalations_item) - priority: str | Unset = UNSET + priority: Union[Unset, str] = UNSET if not isinstance(self.priority, Unset): priority = self.priority - details: None | str | Unset + details: Union[None, Unset, str] if isinstance(self.details, Unset): details = UNSET else: @@ -140,7 +137,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: message = d.pop("message") _task_type = d.pop("task_type", UNSET) - task_type: CreateOpsgenieAlertTaskParamsTaskType | Unset + task_type: Union[Unset, CreateOpsgenieAlertTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: @@ -148,55 +145,47 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: description = d.pop("description", UNSET) + teams = [] _teams = d.pop("teams", UNSET) - teams: list[CreateOpsgenieAlertTaskParamsTeamsItem] | Unset = UNSET - if _teams is not UNSET: - teams = [] - for teams_item_data in _teams: - teams_item = CreateOpsgenieAlertTaskParamsTeamsItem.from_dict(teams_item_data) + for teams_item_data in _teams or []: + teams_item = CreateOpsgenieAlertTaskParamsTeamsItem.from_dict(teams_item_data) - teams.append(teams_item) + teams.append(teams_item) + users = [] _users = d.pop("users", UNSET) - users: list[CreateOpsgenieAlertTaskParamsUsersItem] | Unset = UNSET - if _users is not UNSET: - users = [] - for users_item_data in _users: - users_item = CreateOpsgenieAlertTaskParamsUsersItem.from_dict(users_item_data) + for users_item_data in _users or []: + users_item = CreateOpsgenieAlertTaskParamsUsersItem.from_dict(users_item_data) - users.append(users_item) + users.append(users_item) + schedules = [] _schedules = d.pop("schedules", UNSET) - schedules: list[CreateOpsgenieAlertTaskParamsSchedulesItem] | Unset = UNSET - if _schedules is not UNSET: - schedules = [] - for schedules_item_data in _schedules: - schedules_item = CreateOpsgenieAlertTaskParamsSchedulesItem.from_dict(schedules_item_data) + for schedules_item_data in _schedules or []: + schedules_item = CreateOpsgenieAlertTaskParamsSchedulesItem.from_dict(schedules_item_data) - schedules.append(schedules_item) + schedules.append(schedules_item) + escalations = [] _escalations = d.pop("escalations", UNSET) - escalations: list[CreateOpsgenieAlertTaskParamsEscalationsItem] | Unset = UNSET - if _escalations is not UNSET: - escalations = [] - for escalations_item_data in _escalations: - escalations_item = CreateOpsgenieAlertTaskParamsEscalationsItem.from_dict(escalations_item_data) + for escalations_item_data in _escalations or []: + escalations_item = CreateOpsgenieAlertTaskParamsEscalationsItem.from_dict(escalations_item_data) - escalations.append(escalations_item) + escalations.append(escalations_item) _priority = d.pop("priority", UNSET) - priority: CreateOpsgenieAlertTaskParamsPriority | Unset + priority: Union[Unset, CreateOpsgenieAlertTaskParamsPriority] if isinstance(_priority, Unset): priority = UNSET else: priority = check_create_opsgenie_alert_task_params_priority(_priority) - def _parse_details(data: object) -> None | str | Unset: + def _parse_details(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) details = _parse_details(d.pop("details", UNSET)) diff --git a/rootly_sdk/models/create_opsgenie_alert_task_params_escalations_item.py b/rootly_sdk/models/create_opsgenie_alert_task_params_escalations_item.py index 57756e03..039e5b7e 100644 --- a/rootly_sdk/models/create_opsgenie_alert_task_params_escalations_item.py +++ b/rootly_sdk/models/create_opsgenie_alert_task_params_escalations_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class CreateOpsgenieAlertTaskParamsEscalationsItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_opsgenie_alert_task_params_schedules_item.py b/rootly_sdk/models/create_opsgenie_alert_task_params_schedules_item.py index 47a772c1..1f0e7574 100644 --- a/rootly_sdk/models/create_opsgenie_alert_task_params_schedules_item.py +++ b/rootly_sdk/models/create_opsgenie_alert_task_params_schedules_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class CreateOpsgenieAlertTaskParamsSchedulesItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_opsgenie_alert_task_params_teams_item.py b/rootly_sdk/models/create_opsgenie_alert_task_params_teams_item.py index 4a3bbc40..f12aab5d 100644 --- a/rootly_sdk/models/create_opsgenie_alert_task_params_teams_item.py +++ b/rootly_sdk/models/create_opsgenie_alert_task_params_teams_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class CreateOpsgenieAlertTaskParamsTeamsItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_opsgenie_alert_task_params_users_item.py b/rootly_sdk/models/create_opsgenie_alert_task_params_users_item.py index 940b0635..b5f34b33 100644 --- a/rootly_sdk/models/create_opsgenie_alert_task_params_users_item.py +++ b/rootly_sdk/models/create_opsgenie_alert_task_params_users_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class CreateOpsgenieAlertTaskParamsUsersItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_outlook_event_task_params.py b/rootly_sdk/models/create_outlook_event_task_params.py index a5bcdd67..3967e085 100644 --- a/rootly_sdk/models/create_outlook_event_task_params.py +++ b/rootly_sdk/models/create_outlook_event_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -32,32 +30,31 @@ class CreateOutlookEventTaskParams: meeting_duration (str): Meeting duration in format like '1 hour', '30 minutes' Example: 1 hour. summary (str): The event summary description (str): The event description - task_type (CreateOutlookEventTaskParamsTaskType | Unset): - attendees (list[str] | Unset): Emails of attendees - time_zone (None | str | Unset): A valid IANA time zone name. - exclude_weekends (bool | Unset): - enable_online_meeting (bool | Unset): Enable Microsoft Teams online meeting - post_to_incident_timeline (bool | Unset): - post_to_slack_channels (list[CreateOutlookEventTaskParamsPostToSlackChannelsItem] | Unset): + task_type (Union[Unset, CreateOutlookEventTaskParamsTaskType]): + attendees (Union[Unset, list[str]]): Emails of attendees + time_zone (Union[None, Unset, str]): A valid IANA time zone name. + exclude_weekends (Union[Unset, bool]): + enable_online_meeting (Union[Unset, bool]): Enable Microsoft Teams online meeting + post_to_incident_timeline (Union[Unset, bool]): + post_to_slack_channels (Union[Unset, list['CreateOutlookEventTaskParamsPostToSlackChannelsItem']]): """ - calendar: CreateOutlookEventTaskParamsCalendar + calendar: "CreateOutlookEventTaskParamsCalendar" days_until_meeting: int time_of_meeting: str meeting_duration: str summary: str description: str - task_type: CreateOutlookEventTaskParamsTaskType | Unset = UNSET - attendees: list[str] | Unset = UNSET - time_zone: None | str | Unset = UNSET - exclude_weekends: bool | Unset = UNSET - enable_online_meeting: bool | Unset = UNSET - post_to_incident_timeline: bool | Unset = UNSET - post_to_slack_channels: list[CreateOutlookEventTaskParamsPostToSlackChannelsItem] | Unset = UNSET + task_type: Union[Unset, CreateOutlookEventTaskParamsTaskType] = UNSET + attendees: Union[Unset, list[str]] = UNSET + time_zone: Union[None, Unset, str] = UNSET + exclude_weekends: Union[Unset, bool] = UNSET + enable_online_meeting: Union[Unset, bool] = UNSET + post_to_incident_timeline: Union[Unset, bool] = UNSET + post_to_slack_channels: Union[Unset, list["CreateOutlookEventTaskParamsPostToSlackChannelsItem"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - calendar = self.calendar.to_dict() days_until_meeting = self.days_until_meeting @@ -70,15 +67,15 @@ def to_dict(self) -> dict[str, Any]: description = self.description - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - attendees: list[str] | Unset = UNSET + attendees: Union[Unset, list[str]] = UNSET if not isinstance(self.attendees, Unset): attendees = self.attendees - time_zone: None | str | Unset + time_zone: Union[None, Unset, str] if isinstance(self.time_zone, Unset): time_zone = UNSET else: @@ -90,7 +87,7 @@ def to_dict(self) -> dict[str, Any]: post_to_incident_timeline = self.post_to_incident_timeline - post_to_slack_channels: list[dict[str, Any]] | Unset = UNSET + post_to_slack_channels: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.post_to_slack_channels, Unset): post_to_slack_channels = [] for post_to_slack_channels_item_data in self.post_to_slack_channels: @@ -147,7 +144,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: description = d.pop("description") _task_type = d.pop("task_type", UNSET) - task_type: CreateOutlookEventTaskParamsTaskType | Unset + task_type: Union[Unset, CreateOutlookEventTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: @@ -155,12 +152,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attendees = cast(list[str], d.pop("attendees", UNSET)) - def _parse_time_zone(data: object) -> None | str | Unset: + def _parse_time_zone(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) time_zone = _parse_time_zone(d.pop("time_zone", UNSET)) @@ -170,16 +167,14 @@ def _parse_time_zone(data: object) -> None | str | Unset: post_to_incident_timeline = d.pop("post_to_incident_timeline", UNSET) + post_to_slack_channels = [] _post_to_slack_channels = d.pop("post_to_slack_channels", UNSET) - post_to_slack_channels: list[CreateOutlookEventTaskParamsPostToSlackChannelsItem] | Unset = UNSET - if _post_to_slack_channels is not UNSET: - post_to_slack_channels = [] - for post_to_slack_channels_item_data in _post_to_slack_channels: - post_to_slack_channels_item = CreateOutlookEventTaskParamsPostToSlackChannelsItem.from_dict( - post_to_slack_channels_item_data - ) + for post_to_slack_channels_item_data in _post_to_slack_channels or []: + post_to_slack_channels_item = CreateOutlookEventTaskParamsPostToSlackChannelsItem.from_dict( + post_to_slack_channels_item_data + ) - post_to_slack_channels.append(post_to_slack_channels_item) + post_to_slack_channels.append(post_to_slack_channels_item) create_outlook_event_task_params = cls( calendar=calendar, diff --git a/rootly_sdk/models/create_outlook_event_task_params_calendar.py b/rootly_sdk/models/create_outlook_event_task_params_calendar.py index 887dfaf4..84144b9f 100644 --- a/rootly_sdk/models/create_outlook_event_task_params_calendar.py +++ b/rootly_sdk/models/create_outlook_event_task_params_calendar.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class CreateOutlookEventTaskParamsCalendar: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_outlook_event_task_params_post_to_slack_channels_item.py b/rootly_sdk/models/create_outlook_event_task_params_post_to_slack_channels_item.py index fefe788e..a539cdc3 100644 --- a/rootly_sdk/models/create_outlook_event_task_params_post_to_slack_channels_item.py +++ b/rootly_sdk/models/create_outlook_event_task_params_post_to_slack_channels_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class CreateOutlookEventTaskParamsPostToSlackChannelsItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_pagerduty_status_update_task_params.py b/rootly_sdk/models/create_pagerduty_status_update_task_params.py index f40fb4aa..f4ec2669 100644 --- a/rootly_sdk/models/create_pagerduty_status_update_task_params.py +++ b/rootly_sdk/models/create_pagerduty_status_update_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,12 +19,12 @@ class CreatePagerdutyStatusUpdateTaskParams: Attributes: pagerduty_incident_id (str): PagerDuty incident id message (str): A message outlining the incident's resolution in PagerDuty - task_type (CreatePagerdutyStatusUpdateTaskParamsTaskType | Unset): + task_type (Union[Unset, CreatePagerdutyStatusUpdateTaskParamsTaskType]): """ pagerduty_incident_id: str message: str - task_type: CreatePagerdutyStatusUpdateTaskParamsTaskType | Unset = UNSET + task_type: Union[Unset, CreatePagerdutyStatusUpdateTaskParamsTaskType] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -34,7 +32,7 @@ def to_dict(self) -> dict[str, Any]: message = self.message - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -59,7 +57,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: message = d.pop("message") _task_type = d.pop("task_type", UNSET) - task_type: CreatePagerdutyStatusUpdateTaskParamsTaskType | Unset + task_type: Union[Unset, CreatePagerdutyStatusUpdateTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/create_pagertree_alert_task_params.py b/rootly_sdk/models/create_pagertree_alert_task_params.py index 599a1b7b..32595c67 100644 --- a/rootly_sdk/models/create_pagertree_alert_task_params.py +++ b/rootly_sdk/models/create_pagertree_alert_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -32,29 +30,28 @@ class CreatePagertreeAlertTaskParams: """ Attributes: - task_type (CreatePagertreeAlertTaskParamsTaskType | Unset): - title (str | Unset): Title of alert as text - description (str | Unset): Description of alert as text - urgency (CreatePagertreeAlertTaskParamsUrgency | Unset): - severity (CreatePagertreeAlertTaskParamsSeverity | Unset): - teams (list[CreatePagertreeAlertTaskParamsTeamsItem] | Unset): - users (list[CreatePagertreeAlertTaskParamsUsersItem] | Unset): - incident (bool | Unset): Setting to true makes an alert a Pagertree incident + task_type (Union[Unset, CreatePagertreeAlertTaskParamsTaskType]): + title (Union[Unset, str]): Title of alert as text + description (Union[Unset, str]): Description of alert as text + urgency (Union[Unset, CreatePagertreeAlertTaskParamsUrgency]): + severity (Union[Unset, CreatePagertreeAlertTaskParamsSeverity]): + teams (Union[Unset, list['CreatePagertreeAlertTaskParamsTeamsItem']]): + users (Union[Unset, list['CreatePagertreeAlertTaskParamsUsersItem']]): + incident (Union[Unset, bool]): Setting to true makes an alert a Pagertree incident """ - task_type: CreatePagertreeAlertTaskParamsTaskType | Unset = UNSET - title: str | Unset = UNSET - description: str | Unset = UNSET - urgency: CreatePagertreeAlertTaskParamsUrgency | Unset = UNSET - severity: CreatePagertreeAlertTaskParamsSeverity | Unset = UNSET - teams: list[CreatePagertreeAlertTaskParamsTeamsItem] | Unset = UNSET - users: list[CreatePagertreeAlertTaskParamsUsersItem] | Unset = UNSET - incident: bool | Unset = UNSET + task_type: Union[Unset, CreatePagertreeAlertTaskParamsTaskType] = UNSET + title: Union[Unset, str] = UNSET + description: Union[Unset, str] = UNSET + urgency: Union[Unset, CreatePagertreeAlertTaskParamsUrgency] = UNSET + severity: Union[Unset, CreatePagertreeAlertTaskParamsSeverity] = UNSET + teams: Union[Unset, list["CreatePagertreeAlertTaskParamsTeamsItem"]] = UNSET + users: Union[Unset, list["CreatePagertreeAlertTaskParamsUsersItem"]] = UNSET + incident: Union[Unset, bool] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -62,22 +59,22 @@ def to_dict(self) -> dict[str, Any]: description = self.description - urgency: str | Unset = UNSET + urgency: Union[Unset, str] = UNSET if not isinstance(self.urgency, Unset): urgency = self.urgency - severity: str | Unset = UNSET + severity: Union[Unset, str] = UNSET if not isinstance(self.severity, Unset): severity = self.severity - teams: list[dict[str, Any]] | Unset = UNSET + teams: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.teams, Unset): teams = [] for teams_item_data in self.teams: teams_item = teams_item_data.to_dict() teams.append(teams_item) - users: list[dict[str, Any]] | Unset = UNSET + users: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.users, Unset): users = [] for users_item_data in self.users: @@ -115,7 +112,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _task_type = d.pop("task_type", UNSET) - task_type: CreatePagertreeAlertTaskParamsTaskType | Unset + task_type: Union[Unset, CreatePagertreeAlertTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: @@ -126,36 +123,32 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: description = d.pop("description", UNSET) _urgency = d.pop("urgency", UNSET) - urgency: CreatePagertreeAlertTaskParamsUrgency | Unset + urgency: Union[Unset, CreatePagertreeAlertTaskParamsUrgency] if isinstance(_urgency, Unset): urgency = UNSET else: urgency = check_create_pagertree_alert_task_params_urgency(_urgency) _severity = d.pop("severity", UNSET) - severity: CreatePagertreeAlertTaskParamsSeverity | Unset + severity: Union[Unset, CreatePagertreeAlertTaskParamsSeverity] if isinstance(_severity, Unset): severity = UNSET else: severity = check_create_pagertree_alert_task_params_severity(_severity) + teams = [] _teams = d.pop("teams", UNSET) - teams: list[CreatePagertreeAlertTaskParamsTeamsItem] | Unset = UNSET - if _teams is not UNSET: - teams = [] - for teams_item_data in _teams: - teams_item = CreatePagertreeAlertTaskParamsTeamsItem.from_dict(teams_item_data) + for teams_item_data in _teams or []: + teams_item = CreatePagertreeAlertTaskParamsTeamsItem.from_dict(teams_item_data) - teams.append(teams_item) + teams.append(teams_item) + users = [] _users = d.pop("users", UNSET) - users: list[CreatePagertreeAlertTaskParamsUsersItem] | Unset = UNSET - if _users is not UNSET: - users = [] - for users_item_data in _users: - users_item = CreatePagertreeAlertTaskParamsUsersItem.from_dict(users_item_data) + for users_item_data in _users or []: + users_item = CreatePagertreeAlertTaskParamsUsersItem.from_dict(users_item_data) - users.append(users_item) + users.append(users_item) incident = d.pop("incident", UNSET) diff --git a/rootly_sdk/models/create_pagertree_alert_task_params_teams_item.py b/rootly_sdk/models/create_pagertree_alert_task_params_teams_item.py index 5d81a118..3189b6cd 100644 --- a/rootly_sdk/models/create_pagertree_alert_task_params_teams_item.py +++ b/rootly_sdk/models/create_pagertree_alert_task_params_teams_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class CreatePagertreeAlertTaskParamsTeamsItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_pagertree_alert_task_params_users_item.py b/rootly_sdk/models/create_pagertree_alert_task_params_users_item.py index bfe6bbb0..7c7a2f1b 100644 --- a/rootly_sdk/models/create_pagertree_alert_task_params_users_item.py +++ b/rootly_sdk/models/create_pagertree_alert_task_params_users_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class CreatePagertreeAlertTaskParamsUsersItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_quip_page_task_params.py b/rootly_sdk/models/create_quip_page_task_params.py index 9265d881..29637d36 100644 --- a/rootly_sdk/models/create_quip_page_task_params.py +++ b/rootly_sdk/models/create_quip_page_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -20,27 +18,27 @@ class CreateQuipPageTaskParams: """ Attributes: title (str): The page title - task_type (CreateQuipPageTaskParamsTaskType | Unset): - post_mortem_template_id (str | Unset): Retrospective template to use when creating page, if desired - parent_folder_id (str | Unset): The parent folder id - content (str | Unset): The page content - template_id (str | Unset): The Quip file ID to use as a template - mark_post_mortem_as_published (bool | Unset): Default: True. + task_type (Union[Unset, CreateQuipPageTaskParamsTaskType]): + post_mortem_template_id (Union[Unset, str]): Retrospective template to use when creating page, if desired + parent_folder_id (Union[Unset, str]): The parent folder id + content (Union[Unset, str]): The page content + template_id (Union[Unset, str]): The Quip file ID to use as a template + mark_post_mortem_as_published (Union[Unset, bool]): Default: True. """ title: str - task_type: CreateQuipPageTaskParamsTaskType | Unset = UNSET - post_mortem_template_id: str | Unset = UNSET - parent_folder_id: str | Unset = UNSET - content: str | Unset = UNSET - template_id: str | Unset = UNSET - mark_post_mortem_as_published: bool | Unset = True + task_type: Union[Unset, CreateQuipPageTaskParamsTaskType] = UNSET + post_mortem_template_id: Union[Unset, str] = UNSET + parent_folder_id: Union[Unset, str] = UNSET + content: Union[Unset, str] = UNSET + template_id: Union[Unset, str] = UNSET + mark_post_mortem_as_published: Union[Unset, bool] = True additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: title = self.title - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -82,7 +80,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: title = d.pop("title") _task_type = d.pop("task_type", UNSET) - task_type: CreateQuipPageTaskParamsTaskType | Unset + task_type: Union[Unset, CreateQuipPageTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/create_service_now_incident_task_params.py b/rootly_sdk/models/create_service_now_incident_task_params.py index 0f10232b..883e4058 100644 --- a/rootly_sdk/models/create_service_now_incident_task_params.py +++ b/rootly_sdk/models/create_service_now_incident_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -25,41 +23,40 @@ class CreateServiceNowIncidentTaskParams: """ Attributes: title (str): The incident title - task_type (CreateServiceNowIncidentTaskParamsTaskType | Unset): - description (str | Unset): The incident description - priority (CreateServiceNowIncidentTaskParamsPriority | Unset): The priority id and display name - completion (CreateServiceNowIncidentTaskParamsCompletion | Unset): The completion id and display name - custom_fields_mapping (None | str | Unset): Custom field mappings. Can contain liquid markup and need to be + task_type (Union[Unset, CreateServiceNowIncidentTaskParamsTaskType]): + description (Union[Unset, str]): The incident description + priority (Union[Unset, CreateServiceNowIncidentTaskParamsPriority]): The priority id and display name + completion (Union[Unset, CreateServiceNowIncidentTaskParamsCompletion]): The completion id and display name + custom_fields_mapping (Union[None, Unset, str]): Custom field mappings. Can contain liquid markup and need to be valid JSON """ title: str - task_type: CreateServiceNowIncidentTaskParamsTaskType | Unset = UNSET - description: str | Unset = UNSET - priority: CreateServiceNowIncidentTaskParamsPriority | Unset = UNSET - completion: CreateServiceNowIncidentTaskParamsCompletion | Unset = UNSET - custom_fields_mapping: None | str | Unset = UNSET + task_type: Union[Unset, CreateServiceNowIncidentTaskParamsTaskType] = UNSET + description: Union[Unset, str] = UNSET + priority: Union[Unset, "CreateServiceNowIncidentTaskParamsPriority"] = UNSET + completion: Union[Unset, "CreateServiceNowIncidentTaskParamsCompletion"] = UNSET + custom_fields_mapping: Union[None, Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - title = self.title - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type description = self.description - priority: dict[str, Any] | Unset = UNSET + priority: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.priority, Unset): priority = self.priority.to_dict() - completion: dict[str, Any] | Unset = UNSET + completion: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.completion, Unset): completion = self.completion.to_dict() - custom_fields_mapping: None | str | Unset + custom_fields_mapping: Union[None, Unset, str] if isinstance(self.custom_fields_mapping, Unset): custom_fields_mapping = UNSET else: @@ -96,7 +93,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: title = d.pop("title") _task_type = d.pop("task_type", UNSET) - task_type: CreateServiceNowIncidentTaskParamsTaskType | Unset + task_type: Union[Unset, CreateServiceNowIncidentTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: @@ -105,25 +102,25 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: description = d.pop("description", UNSET) _priority = d.pop("priority", UNSET) - priority: CreateServiceNowIncidentTaskParamsPriority | Unset + priority: Union[Unset, CreateServiceNowIncidentTaskParamsPriority] if isinstance(_priority, Unset): priority = UNSET else: priority = CreateServiceNowIncidentTaskParamsPriority.from_dict(_priority) _completion = d.pop("completion", UNSET) - completion: CreateServiceNowIncidentTaskParamsCompletion | Unset + completion: Union[Unset, CreateServiceNowIncidentTaskParamsCompletion] if isinstance(_completion, Unset): completion = UNSET else: completion = CreateServiceNowIncidentTaskParamsCompletion.from_dict(_completion) - def _parse_custom_fields_mapping(data: object) -> None | str | Unset: + def _parse_custom_fields_mapping(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) custom_fields_mapping = _parse_custom_fields_mapping(d.pop("custom_fields_mapping", UNSET)) diff --git a/rootly_sdk/models/create_service_now_incident_task_params_completion.py b/rootly_sdk/models/create_service_now_incident_task_params_completion.py index 550f0f18..428f06c1 100644 --- a/rootly_sdk/models/create_service_now_incident_task_params_completion.py +++ b/rootly_sdk/models/create_service_now_incident_task_params_completion.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,12 +14,12 @@ class CreateServiceNowIncidentTaskParamsCompletion: """The completion id and display name Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_service_now_incident_task_params_priority.py b/rootly_sdk/models/create_service_now_incident_task_params_priority.py index 186be050..ec2ef5ab 100644 --- a/rootly_sdk/models/create_service_now_incident_task_params_priority.py +++ b/rootly_sdk/models/create_service_now_incident_task_params_priority.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,12 +14,12 @@ class CreateServiceNowIncidentTaskParamsPriority: """The priority id and display name Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_sharepoint_page_task_params.py b/rootly_sdk/models/create_sharepoint_page_task_params.py index f76d8f61..2bac4432 100644 --- a/rootly_sdk/models/create_sharepoint_page_task_params.py +++ b/rootly_sdk/models/create_sharepoint_page_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -28,34 +26,33 @@ class CreateSharepointPageTaskParams: title (str): The page title site (CreateSharepointPageTaskParamsSite): drive (CreateSharepointPageTaskParamsDrive): - task_type (CreateSharepointPageTaskParamsTaskType | Unset): - post_mortem_template_id (str | Unset): Retrospective template to use when creating page, if desired - mark_post_mortem_as_published (bool | Unset): Default: True. - parent_folder (CreateSharepointPageTaskParamsParentFolder | Unset): - content (str | Unset): The page content - template_id (str | Unset): The SharePoint file ID to use as a template + task_type (Union[Unset, CreateSharepointPageTaskParamsTaskType]): + post_mortem_template_id (Union[Unset, str]): Retrospective template to use when creating page, if desired + mark_post_mortem_as_published (Union[Unset, bool]): Default: True. + parent_folder (Union[Unset, CreateSharepointPageTaskParamsParentFolder]): + content (Union[Unset, str]): The page content + template_id (Union[Unset, str]): The SharePoint file ID to use as a template """ title: str - site: CreateSharepointPageTaskParamsSite - drive: CreateSharepointPageTaskParamsDrive - task_type: CreateSharepointPageTaskParamsTaskType | Unset = UNSET - post_mortem_template_id: str | Unset = UNSET - mark_post_mortem_as_published: bool | Unset = True - parent_folder: CreateSharepointPageTaskParamsParentFolder | Unset = UNSET - content: str | Unset = UNSET - template_id: str | Unset = UNSET + site: "CreateSharepointPageTaskParamsSite" + drive: "CreateSharepointPageTaskParamsDrive" + task_type: Union[Unset, CreateSharepointPageTaskParamsTaskType] = UNSET + post_mortem_template_id: Union[Unset, str] = UNSET + mark_post_mortem_as_published: Union[Unset, bool] = True + parent_folder: Union[Unset, "CreateSharepointPageTaskParamsParentFolder"] = UNSET + content: Union[Unset, str] = UNSET + template_id: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - title = self.title site = self.site.to_dict() drive = self.drive.to_dict() - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -63,7 +60,7 @@ def to_dict(self) -> dict[str, Any]: mark_post_mortem_as_published = self.mark_post_mortem_as_published - parent_folder: dict[str, Any] | Unset = UNSET + parent_folder: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.parent_folder, Unset): parent_folder = self.parent_folder.to_dict() @@ -109,7 +106,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: drive = CreateSharepointPageTaskParamsDrive.from_dict(d.pop("drive")) _task_type = d.pop("task_type", UNSET) - task_type: CreateSharepointPageTaskParamsTaskType | Unset + task_type: Union[Unset, CreateSharepointPageTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: @@ -120,7 +117,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: mark_post_mortem_as_published = d.pop("mark_post_mortem_as_published", UNSET) _parent_folder = d.pop("parent_folder", UNSET) - parent_folder: CreateSharepointPageTaskParamsParentFolder | Unset + parent_folder: Union[Unset, CreateSharepointPageTaskParamsParentFolder] if isinstance(_parent_folder, Unset): parent_folder = UNSET else: diff --git a/rootly_sdk/models/create_sharepoint_page_task_params_drive.py b/rootly_sdk/models/create_sharepoint_page_task_params_drive.py index cbf15f10..7bb221d5 100644 --- a/rootly_sdk/models/create_sharepoint_page_task_params_drive.py +++ b/rootly_sdk/models/create_sharepoint_page_task_params_drive.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class CreateSharepointPageTaskParamsDrive: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_sharepoint_page_task_params_parent_folder.py b/rootly_sdk/models/create_sharepoint_page_task_params_parent_folder.py index 16f35526..37a5e992 100644 --- a/rootly_sdk/models/create_sharepoint_page_task_params_parent_folder.py +++ b/rootly_sdk/models/create_sharepoint_page_task_params_parent_folder.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class CreateSharepointPageTaskParamsParentFolder: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_sharepoint_page_task_params_site.py b/rootly_sdk/models/create_sharepoint_page_task_params_site.py index 638cc4f0..7c12c695 100644 --- a/rootly_sdk/models/create_sharepoint_page_task_params_site.py +++ b/rootly_sdk/models/create_sharepoint_page_task_params_site.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class CreateSharepointPageTaskParamsSite: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_shortcut_story_task_params_type_0_project.py b/rootly_sdk/models/create_shortcut_story_task_params_type_0_project.py index 1f749fa3..d93e7f41 100644 --- a/rootly_sdk/models/create_shortcut_story_task_params_type_0_project.py +++ b/rootly_sdk/models/create_shortcut_story_task_params_type_0_project.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class CreateShortcutStoryTaskParamsType0Project: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_shortcut_story_task_params_type_1_workflow_state.py b/rootly_sdk/models/create_shortcut_story_task_params_type_1_workflow_state.py index cf311fb3..595d71a9 100644 --- a/rootly_sdk/models/create_shortcut_story_task_params_type_1_workflow_state.py +++ b/rootly_sdk/models/create_shortcut_story_task_params_type_1_workflow_state.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class CreateShortcutStoryTaskParamsType1WorkflowState: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_shortcut_task_task_params.py b/rootly_sdk/models/create_shortcut_task_task_params.py index 2b27b227..43779b59 100644 --- a/rootly_sdk/models/create_shortcut_task_task_params.py +++ b/rootly_sdk/models/create_shortcut_task_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -26,24 +24,23 @@ class CreateShortcutTaskTaskParams: parent_story_id (str): The parent story description (str): The task description completion (CreateShortcutTaskTaskParamsCompletion): The completion id and display name - task_type (CreateShortcutTaskTaskParamsTaskType | Unset): + task_type (Union[Unset, CreateShortcutTaskTaskParamsTaskType]): """ parent_story_id: str description: str - completion: CreateShortcutTaskTaskParamsCompletion - task_type: CreateShortcutTaskTaskParamsTaskType | Unset = UNSET + completion: "CreateShortcutTaskTaskParamsCompletion" + task_type: Union[Unset, CreateShortcutTaskTaskParamsTaskType] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - parent_story_id = self.parent_story_id description = self.description completion = self.completion.to_dict() - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -73,7 +70,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: completion = CreateShortcutTaskTaskParamsCompletion.from_dict(d.pop("completion")) _task_type = d.pop("task_type", UNSET) - task_type: CreateShortcutTaskTaskParamsTaskType | Unset + task_type: Union[Unset, CreateShortcutTaskTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/create_shortcut_task_task_params_completion.py b/rootly_sdk/models/create_shortcut_task_task_params_completion.py index 01333610..806ecc67 100644 --- a/rootly_sdk/models/create_shortcut_task_task_params_completion.py +++ b/rootly_sdk/models/create_shortcut_task_task_params_completion.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,12 +14,12 @@ class CreateShortcutTaskTaskParamsCompletion: """The completion id and display name Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_slack_channel_task_params.py b/rootly_sdk/models/create_slack_channel_task_params.py index 4587c12a..580266f5 100644 --- a/rootly_sdk/models/create_slack_channel_task_params.py +++ b/rootly_sdk/models/create_slack_channel_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,27 +27,26 @@ class CreateSlackChannelTaskParams: Attributes: workspace (CreateSlackChannelTaskParamsWorkspace): title (str): Slack channel title - task_type (CreateSlackChannelTaskParamsTaskType | Unset): - private (CreateSlackChannelTaskParamsPrivate | Unset): Default: 'auto'. + task_type (Union[Unset, CreateSlackChannelTaskParamsTaskType]): + private (Union[Unset, CreateSlackChannelTaskParamsPrivate]): Default: 'auto'. """ - workspace: CreateSlackChannelTaskParamsWorkspace + workspace: "CreateSlackChannelTaskParamsWorkspace" title: str - task_type: CreateSlackChannelTaskParamsTaskType | Unset = UNSET - private: CreateSlackChannelTaskParamsPrivate | Unset = "auto" + task_type: Union[Unset, CreateSlackChannelTaskParamsTaskType] = UNSET + private: Union[Unset, CreateSlackChannelTaskParamsPrivate] = "auto" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - workspace = self.workspace.to_dict() title = self.title - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - private: str | Unset = UNSET + private: Union[Unset, str] = UNSET if not isinstance(self.private, Unset): private = self.private @@ -78,14 +75,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: title = d.pop("title") _task_type = d.pop("task_type", UNSET) - task_type: CreateSlackChannelTaskParamsTaskType | Unset + task_type: Union[Unset, CreateSlackChannelTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: task_type = check_create_slack_channel_task_params_task_type(_task_type) _private = d.pop("private", UNSET) - private: CreateSlackChannelTaskParamsPrivate | Unset + private: Union[Unset, CreateSlackChannelTaskParamsPrivate] if isinstance(_private, Unset): private = UNSET else: diff --git a/rootly_sdk/models/create_slack_channel_task_params_workspace.py b/rootly_sdk/models/create_slack_channel_task_params_workspace.py index 6c6f4e33..7c2b77b9 100644 --- a/rootly_sdk/models/create_slack_channel_task_params_workspace.py +++ b/rootly_sdk/models/create_slack_channel_task_params_workspace.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class CreateSlackChannelTaskParamsWorkspace: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_sub_incident_task_params.py b/rootly_sdk/models/create_sub_incident_task_params.py index 0f2a0359..134914ca 100644 --- a/rootly_sdk/models/create_sub_incident_task_params.py +++ b/rootly_sdk/models/create_sub_incident_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -20,19 +18,19 @@ class CreateSubIncidentTaskParams: """ Attributes: title (str): The sub incident title - task_type (CreateSubIncidentTaskParamsTaskType | Unset): - summary (str | Unset): The sub incident summary + task_type (Union[Unset, CreateSubIncidentTaskParamsTaskType]): + summary (Union[Unset, str]): The sub incident summary """ title: str - task_type: CreateSubIncidentTaskParamsTaskType | Unset = UNSET - summary: str | Unset = UNSET + task_type: Union[Unset, CreateSubIncidentTaskParamsTaskType] = UNSET + summary: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: title = self.title - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -58,7 +56,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: title = d.pop("title") _task_type = d.pop("task_type", UNSET) - task_type: CreateSubIncidentTaskParamsTaskType | Unset + task_type: Union[Unset, CreateSubIncidentTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/create_trello_card_task_params.py b/rootly_sdk/models/create_trello_card_task_params.py index b1d2e73f..35c65013 100644 --- a/rootly_sdk/models/create_trello_card_task_params.py +++ b/rootly_sdk/models/create_trello_card_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,32 +27,31 @@ class CreateTrelloCardTaskParams: title (str): The card title board (CreateTrelloCardTaskParamsBoard): The board id and display name list_ (CreateTrelloCardTaskParamsList): The list id and display name - task_type (CreateTrelloCardTaskParamsTaskType | Unset): - description (str | Unset): The card description - due_date (str | Unset): The due date - labels (list[CreateTrelloCardTaskParamsLabelsItem] | Unset): - archivation (CreateTrelloCardTaskParamsArchivation | Unset): The archivation id and display name + task_type (Union[Unset, CreateTrelloCardTaskParamsTaskType]): + description (Union[Unset, str]): The card description + due_date (Union[Unset, str]): The due date + labels (Union[Unset, list['CreateTrelloCardTaskParamsLabelsItem']]): + archivation (Union[Unset, CreateTrelloCardTaskParamsArchivation]): The archivation id and display name """ title: str - board: CreateTrelloCardTaskParamsBoard - list_: CreateTrelloCardTaskParamsList - task_type: CreateTrelloCardTaskParamsTaskType | Unset = UNSET - description: str | Unset = UNSET - due_date: str | Unset = UNSET - labels: list[CreateTrelloCardTaskParamsLabelsItem] | Unset = UNSET - archivation: CreateTrelloCardTaskParamsArchivation | Unset = UNSET + board: "CreateTrelloCardTaskParamsBoard" + list_: "CreateTrelloCardTaskParamsList" + task_type: Union[Unset, CreateTrelloCardTaskParamsTaskType] = UNSET + description: Union[Unset, str] = UNSET + due_date: Union[Unset, str] = UNSET + labels: Union[Unset, list["CreateTrelloCardTaskParamsLabelsItem"]] = UNSET + archivation: Union[Unset, "CreateTrelloCardTaskParamsArchivation"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - title = self.title board = self.board.to_dict() list_ = self.list_.to_dict() - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -62,14 +59,14 @@ def to_dict(self) -> dict[str, Any]: due_date = self.due_date - labels: list[dict[str, Any]] | Unset = UNSET + labels: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.labels, Unset): labels = [] for labels_item_data in self.labels: labels_item = labels_item_data.to_dict() labels.append(labels_item) - archivation: dict[str, Any] | Unset = UNSET + archivation: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.archivation, Unset): archivation = self.archivation.to_dict() @@ -110,7 +107,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: list_ = CreateTrelloCardTaskParamsList.from_dict(d.pop("list")) _task_type = d.pop("task_type", UNSET) - task_type: CreateTrelloCardTaskParamsTaskType | Unset + task_type: Union[Unset, CreateTrelloCardTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: @@ -120,17 +117,15 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: due_date = d.pop("due_date", UNSET) + labels = [] _labels = d.pop("labels", UNSET) - labels: list[CreateTrelloCardTaskParamsLabelsItem] | Unset = UNSET - if _labels is not UNSET: - labels = [] - for labels_item_data in _labels: - labels_item = CreateTrelloCardTaskParamsLabelsItem.from_dict(labels_item_data) + for labels_item_data in _labels or []: + labels_item = CreateTrelloCardTaskParamsLabelsItem.from_dict(labels_item_data) - labels.append(labels_item) + labels.append(labels_item) _archivation = d.pop("archivation", UNSET) - archivation: CreateTrelloCardTaskParamsArchivation | Unset + archivation: Union[Unset, CreateTrelloCardTaskParamsArchivation] if isinstance(_archivation, Unset): archivation = UNSET else: diff --git a/rootly_sdk/models/create_trello_card_task_params_archivation.py b/rootly_sdk/models/create_trello_card_task_params_archivation.py index 156c86c7..b432154f 100644 --- a/rootly_sdk/models/create_trello_card_task_params_archivation.py +++ b/rootly_sdk/models/create_trello_card_task_params_archivation.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,12 +14,12 @@ class CreateTrelloCardTaskParamsArchivation: """The archivation id and display name Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_trello_card_task_params_board.py b/rootly_sdk/models/create_trello_card_task_params_board.py index 358d9808..2b2855d3 100644 --- a/rootly_sdk/models/create_trello_card_task_params_board.py +++ b/rootly_sdk/models/create_trello_card_task_params_board.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,12 +14,12 @@ class CreateTrelloCardTaskParamsBoard: """The board id and display name Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_trello_card_task_params_labels_item.py b/rootly_sdk/models/create_trello_card_task_params_labels_item.py index 42ad31bb..4ec632a9 100644 --- a/rootly_sdk/models/create_trello_card_task_params_labels_item.py +++ b/rootly_sdk/models/create_trello_card_task_params_labels_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class CreateTrelloCardTaskParamsLabelsItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_trello_card_task_params_list.py b/rootly_sdk/models/create_trello_card_task_params_list.py index 6c584b6b..0d1e2083 100644 --- a/rootly_sdk/models/create_trello_card_task_params_list.py +++ b/rootly_sdk/models/create_trello_card_task_params_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,12 +14,12 @@ class CreateTrelloCardTaskParamsList: """The list id and display name Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_watsonx_chat_completion_task_params.py b/rootly_sdk/models/create_watsonx_chat_completion_task_params.py index 0524c92d..5d22b575 100644 --- a/rootly_sdk/models/create_watsonx_chat_completion_task_params.py +++ b/rootly_sdk/models/create_watsonx_chat_completion_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -26,26 +24,25 @@ class CreateWatsonxChatCompletionTaskParams: model (CreateWatsonxChatCompletionTaskParamsModel): The WatsonX model. eg: ibm/granite-3-b8b-instruct prompt (str): The prompt to send to WatsonX project_id (str): - task_type (CreateWatsonxChatCompletionTaskParamsTaskType | Unset): - system_prompt (str | Unset): The system prompt to send to WatsonX (optional) + task_type (Union[Unset, CreateWatsonxChatCompletionTaskParamsTaskType]): + system_prompt (Union[Unset, str]): The system prompt to send to WatsonX (optional) """ - model: CreateWatsonxChatCompletionTaskParamsModel + model: "CreateWatsonxChatCompletionTaskParamsModel" prompt: str project_id: str - task_type: CreateWatsonxChatCompletionTaskParamsTaskType | Unset = UNSET - system_prompt: str | Unset = UNSET + task_type: Union[Unset, CreateWatsonxChatCompletionTaskParamsTaskType] = UNSET + system_prompt: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - model = self.model.to_dict() prompt = self.prompt project_id = self.project_id - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -79,7 +76,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: project_id = d.pop("project_id") _task_type = d.pop("task_type", UNSET) - task_type: CreateWatsonxChatCompletionTaskParamsTaskType | Unset + task_type: Union[Unset, CreateWatsonxChatCompletionTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/create_watsonx_chat_completion_task_params_model.py b/rootly_sdk/models/create_watsonx_chat_completion_task_params_model.py index e26a08fb..63f60c8d 100644 --- a/rootly_sdk/models/create_watsonx_chat_completion_task_params_model.py +++ b/rootly_sdk/models/create_watsonx_chat_completion_task_params_model.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,12 +14,12 @@ class CreateWatsonxChatCompletionTaskParamsModel: """The WatsonX model. eg: ibm/granite-3-b8b-instruct Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_webex_meeting_task_params.py b/rootly_sdk/models/create_webex_meeting_task_params.py index 20afbca5..7ee581d4 100644 --- a/rootly_sdk/models/create_webex_meeting_task_params.py +++ b/rootly_sdk/models/create_webex_meeting_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -30,30 +28,29 @@ class CreateWebexMeetingTaskParams: """ Attributes: topic (str): The meeting topic - task_type (CreateWebexMeetingTaskParamsTaskType | Unset): - password (str | Unset): The meeting password - record_meeting (bool | Unset): Rootly AI will record the meeting and automatically generate a transcript and - summary from your meeting - recording_mode (CreateWebexMeetingTaskParamsRecordingMode | Unset): The video layout for the bot's recording - (e.g. speaker_view, gallery_view, gallery_view_v2, audio_only) - post_to_incident_timeline (bool | Unset): - post_to_slack_channels (list[CreateWebexMeetingTaskParamsPostToSlackChannelsItem] | Unset): + task_type (Union[Unset, CreateWebexMeetingTaskParamsTaskType]): + password (Union[Unset, str]): The meeting password + record_meeting (Union[Unset, bool]): Rootly AI will record the meeting and automatically generate a transcript + and summary from your meeting + recording_mode (Union[Unset, CreateWebexMeetingTaskParamsRecordingMode]): The video layout for the bot's + recording (e.g. speaker_view, gallery_view, gallery_view_v2, audio_only) + post_to_incident_timeline (Union[Unset, bool]): + post_to_slack_channels (Union[Unset, list['CreateWebexMeetingTaskParamsPostToSlackChannelsItem']]): """ topic: str - task_type: CreateWebexMeetingTaskParamsTaskType | Unset = UNSET - password: str | Unset = UNSET - record_meeting: bool | Unset = UNSET - recording_mode: CreateWebexMeetingTaskParamsRecordingMode | Unset = UNSET - post_to_incident_timeline: bool | Unset = UNSET - post_to_slack_channels: list[CreateWebexMeetingTaskParamsPostToSlackChannelsItem] | Unset = UNSET + task_type: Union[Unset, CreateWebexMeetingTaskParamsTaskType] = UNSET + password: Union[Unset, str] = UNSET + record_meeting: Union[Unset, bool] = UNSET + recording_mode: Union[Unset, CreateWebexMeetingTaskParamsRecordingMode] = UNSET + post_to_incident_timeline: Union[Unset, bool] = UNSET + post_to_slack_channels: Union[Unset, list["CreateWebexMeetingTaskParamsPostToSlackChannelsItem"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - topic = self.topic - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -61,13 +58,13 @@ def to_dict(self) -> dict[str, Any]: record_meeting = self.record_meeting - recording_mode: str | Unset = UNSET + recording_mode: Union[Unset, str] = UNSET if not isinstance(self.recording_mode, Unset): recording_mode = self.recording_mode post_to_incident_timeline = self.post_to_incident_timeline - post_to_slack_channels: list[dict[str, Any]] | Unset = UNSET + post_to_slack_channels: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.post_to_slack_channels, Unset): post_to_slack_channels = [] for post_to_slack_channels_item_data in self.post_to_slack_channels: @@ -106,7 +103,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: topic = d.pop("topic") _task_type = d.pop("task_type", UNSET) - task_type: CreateWebexMeetingTaskParamsTaskType | Unset + task_type: Union[Unset, CreateWebexMeetingTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: @@ -117,7 +114,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: record_meeting = d.pop("record_meeting", UNSET) _recording_mode = d.pop("recording_mode", UNSET) - recording_mode: CreateWebexMeetingTaskParamsRecordingMode | Unset + recording_mode: Union[Unset, CreateWebexMeetingTaskParamsRecordingMode] if isinstance(_recording_mode, Unset): recording_mode = UNSET else: @@ -125,16 +122,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: post_to_incident_timeline = d.pop("post_to_incident_timeline", UNSET) + post_to_slack_channels = [] _post_to_slack_channels = d.pop("post_to_slack_channels", UNSET) - post_to_slack_channels: list[CreateWebexMeetingTaskParamsPostToSlackChannelsItem] | Unset = UNSET - if _post_to_slack_channels is not UNSET: - post_to_slack_channels = [] - for post_to_slack_channels_item_data in _post_to_slack_channels: - post_to_slack_channels_item = CreateWebexMeetingTaskParamsPostToSlackChannelsItem.from_dict( - post_to_slack_channels_item_data - ) + for post_to_slack_channels_item_data in _post_to_slack_channels or []: + post_to_slack_channels_item = CreateWebexMeetingTaskParamsPostToSlackChannelsItem.from_dict( + post_to_slack_channels_item_data + ) - post_to_slack_channels.append(post_to_slack_channels_item) + post_to_slack_channels.append(post_to_slack_channels_item) create_webex_meeting_task_params = cls( topic=topic, diff --git a/rootly_sdk/models/create_webex_meeting_task_params_post_to_slack_channels_item.py b/rootly_sdk/models/create_webex_meeting_task_params_post_to_slack_channels_item.py index 6e3cd47d..e96647db 100644 --- a/rootly_sdk/models/create_webex_meeting_task_params_post_to_slack_channels_item.py +++ b/rootly_sdk/models/create_webex_meeting_task_params_post_to_slack_channels_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class CreateWebexMeetingTaskParamsPostToSlackChannelsItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_zendesk_jira_link_task_params.py b/rootly_sdk/models/create_zendesk_jira_link_task_params.py index 79171b39..7df7dbae 100644 --- a/rootly_sdk/models/create_zendesk_jira_link_task_params.py +++ b/rootly_sdk/models/create_zendesk_jira_link_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,13 +20,13 @@ class CreateZendeskJiraLinkTaskParams: jira_issue_id (str): Jira Issue Id. jira_issue_key (str): Jira Issue Key. zendesk_ticket_id (str): Zendesk Ticket Id. - task_type (CreateZendeskJiraLinkTaskParamsTaskType | Unset): + task_type (Union[Unset, CreateZendeskJiraLinkTaskParamsTaskType]): """ jira_issue_id: str jira_issue_key: str zendesk_ticket_id: str - task_type: CreateZendeskJiraLinkTaskParamsTaskType | Unset = UNSET + task_type: Union[Unset, CreateZendeskJiraLinkTaskParamsTaskType] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -38,7 +36,7 @@ def to_dict(self) -> dict[str, Any]: zendesk_ticket_id = self.zendesk_ticket_id - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -66,7 +64,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: zendesk_ticket_id = d.pop("zendesk_ticket_id") _task_type = d.pop("task_type", UNSET) - task_type: CreateZendeskJiraLinkTaskParamsTaskType | Unset + task_type: Union[Unset, CreateZendeskJiraLinkTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/create_zendesk_ticket_task_params.py b/rootly_sdk/models/create_zendesk_ticket_task_params.py index ecf79ca3..c452b886 100644 --- a/rootly_sdk/models/create_zendesk_ticket_task_params.py +++ b/rootly_sdk/models/create_zendesk_ticket_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -30,35 +28,34 @@ class CreateZendeskTicketTaskParams: Attributes: kind (CreateZendeskTicketTaskParamsKind): subject (str): The ticket subject - task_type (CreateZendeskTicketTaskParamsTaskType | Unset): - comment (str | Unset): The ticket comment - tags (str | Unset): The ticket tags - priority (CreateZendeskTicketTaskParamsPriority | Unset): The priority id and display name - completion (CreateZendeskTicketTaskParamsCompletion | Unset): The completion id and display name - custom_fields_mapping (None | str | Unset): Custom field mappings. Can contain liquid markup and need to be + task_type (Union[Unset, CreateZendeskTicketTaskParamsTaskType]): + comment (Union[Unset, str]): The ticket comment + tags (Union[Unset, str]): The ticket tags + priority (Union[Unset, CreateZendeskTicketTaskParamsPriority]): The priority id and display name + completion (Union[Unset, CreateZendeskTicketTaskParamsCompletion]): The completion id and display name + custom_fields_mapping (Union[None, Unset, str]): Custom field mappings. Can contain liquid markup and need to be valid JSON - ticket_payload (None | str | Unset): Additional Zendesk ticket attributes. Will be merged into whatever was + ticket_payload (Union[None, Unset, str]): Additional Zendesk ticket attributes. Will be merged into whatever was specified in this tasks current parameters. Can contain liquid markup and need to be valid JSON """ kind: CreateZendeskTicketTaskParamsKind subject: str - task_type: CreateZendeskTicketTaskParamsTaskType | Unset = UNSET - comment: str | Unset = UNSET - tags: str | Unset = UNSET - priority: CreateZendeskTicketTaskParamsPriority | Unset = UNSET - completion: CreateZendeskTicketTaskParamsCompletion | Unset = UNSET - custom_fields_mapping: None | str | Unset = UNSET - ticket_payload: None | str | Unset = UNSET + task_type: Union[Unset, CreateZendeskTicketTaskParamsTaskType] = UNSET + comment: Union[Unset, str] = UNSET + tags: Union[Unset, str] = UNSET + priority: Union[Unset, "CreateZendeskTicketTaskParamsPriority"] = UNSET + completion: Union[Unset, "CreateZendeskTicketTaskParamsCompletion"] = UNSET + custom_fields_mapping: Union[None, Unset, str] = UNSET + ticket_payload: Union[None, Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - kind: str = self.kind subject = self.subject - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -66,21 +63,21 @@ def to_dict(self) -> dict[str, Any]: tags = self.tags - priority: dict[str, Any] | Unset = UNSET + priority: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.priority, Unset): priority = self.priority.to_dict() - completion: dict[str, Any] | Unset = UNSET + completion: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.completion, Unset): completion = self.completion.to_dict() - custom_fields_mapping: None | str | Unset + custom_fields_mapping: Union[None, Unset, str] if isinstance(self.custom_fields_mapping, Unset): custom_fields_mapping = UNSET else: custom_fields_mapping = self.custom_fields_mapping - ticket_payload: None | str | Unset + ticket_payload: Union[None, Unset, str] if isinstance(self.ticket_payload, Unset): ticket_payload = UNSET else: @@ -122,7 +119,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: subject = d.pop("subject") _task_type = d.pop("task_type", UNSET) - task_type: CreateZendeskTicketTaskParamsTaskType | Unset + task_type: Union[Unset, CreateZendeskTicketTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: @@ -133,34 +130,34 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: tags = d.pop("tags", UNSET) _priority = d.pop("priority", UNSET) - priority: CreateZendeskTicketTaskParamsPriority | Unset + priority: Union[Unset, CreateZendeskTicketTaskParamsPriority] if isinstance(_priority, Unset): priority = UNSET else: priority = CreateZendeskTicketTaskParamsPriority.from_dict(_priority) _completion = d.pop("completion", UNSET) - completion: CreateZendeskTicketTaskParamsCompletion | Unset + completion: Union[Unset, CreateZendeskTicketTaskParamsCompletion] if isinstance(_completion, Unset): completion = UNSET else: completion = CreateZendeskTicketTaskParamsCompletion.from_dict(_completion) - def _parse_custom_fields_mapping(data: object) -> None | str | Unset: + def _parse_custom_fields_mapping(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) custom_fields_mapping = _parse_custom_fields_mapping(d.pop("custom_fields_mapping", UNSET)) - def _parse_ticket_payload(data: object) -> None | str | Unset: + def _parse_ticket_payload(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) ticket_payload = _parse_ticket_payload(d.pop("ticket_payload", UNSET)) diff --git a/rootly_sdk/models/create_zendesk_ticket_task_params_completion.py b/rootly_sdk/models/create_zendesk_ticket_task_params_completion.py index 2554ba85..ee0dad0a 100644 --- a/rootly_sdk/models/create_zendesk_ticket_task_params_completion.py +++ b/rootly_sdk/models/create_zendesk_ticket_task_params_completion.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,12 +14,12 @@ class CreateZendeskTicketTaskParamsCompletion: """The completion id and display name Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_zendesk_ticket_task_params_priority.py b/rootly_sdk/models/create_zendesk_ticket_task_params_priority.py index 8a7902cb..93013f35 100644 --- a/rootly_sdk/models/create_zendesk_ticket_task_params_priority.py +++ b/rootly_sdk/models/create_zendesk_ticket_task_params_priority.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,12 +14,12 @@ class CreateZendeskTicketTaskParamsPriority: """The priority id and display name Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_zoom_meeting_task_params.py b/rootly_sdk/models/create_zoom_meeting_task_params.py index 835f6ef5..90a36924 100644 --- a/rootly_sdk/models/create_zoom_meeting_task_params.py +++ b/rootly_sdk/models/create_zoom_meeting_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -34,39 +32,38 @@ class CreateZoomMeetingTaskParams: """ Attributes: topic (str): The meeting topic - task_type (CreateZoomMeetingTaskParamsTaskType | Unset): - password (str | Unset): The meeting password - create_as_email (str | Unset): The email to use if creating as email - alternative_hosts (list[str] | Unset): - auto_recording (CreateZoomMeetingTaskParamsAutoRecording | Unset): Default: 'none'. - record_meeting (bool | Unset): Rootly AI will record the meeting and automatically generate a transcript and - summary from your meeting - recording_mode (CreateZoomMeetingTaskParamsRecordingMode | Unset): The video layout for the bot's recording - (e.g. speaker_view, gallery_view, gallery_view_v2, audio_only) - enable_zoom_bot_auto_join (bool | Unset): Allow the Rootly bot to start recording without waiting for host + task_type (Union[Unset, CreateZoomMeetingTaskParamsTaskType]): + password (Union[Unset, str]): The meeting password + create_as_email (Union[Unset, str]): The email to use if creating as email + alternative_hosts (Union[Unset, list[str]]): + auto_recording (Union[Unset, CreateZoomMeetingTaskParamsAutoRecording]): Default: 'none'. + record_meeting (Union[Unset, bool]): Rootly AI will record the meeting and automatically generate a transcript + and summary from your meeting + recording_mode (Union[Unset, CreateZoomMeetingTaskParamsRecordingMode]): The video layout for the bot's + recording (e.g. speaker_view, gallery_view, gallery_view_v2, audio_only) + enable_zoom_bot_auto_join (Union[Unset, bool]): Allow the Rootly bot to start recording without waiting for host approval - post_to_incident_timeline (bool | Unset): - post_to_slack_channels (list[CreateZoomMeetingTaskParamsPostToSlackChannelsItem] | Unset): + post_to_incident_timeline (Union[Unset, bool]): + post_to_slack_channels (Union[Unset, list['CreateZoomMeetingTaskParamsPostToSlackChannelsItem']]): """ topic: str - task_type: CreateZoomMeetingTaskParamsTaskType | Unset = UNSET - password: str | Unset = UNSET - create_as_email: str | Unset = UNSET - alternative_hosts: list[str] | Unset = UNSET - auto_recording: CreateZoomMeetingTaskParamsAutoRecording | Unset = "none" - record_meeting: bool | Unset = UNSET - recording_mode: CreateZoomMeetingTaskParamsRecordingMode | Unset = UNSET - enable_zoom_bot_auto_join: bool | Unset = UNSET - post_to_incident_timeline: bool | Unset = UNSET - post_to_slack_channels: list[CreateZoomMeetingTaskParamsPostToSlackChannelsItem] | Unset = UNSET + task_type: Union[Unset, CreateZoomMeetingTaskParamsTaskType] = UNSET + password: Union[Unset, str] = UNSET + create_as_email: Union[Unset, str] = UNSET + alternative_hosts: Union[Unset, list[str]] = UNSET + auto_recording: Union[Unset, CreateZoomMeetingTaskParamsAutoRecording] = "none" + record_meeting: Union[Unset, bool] = UNSET + recording_mode: Union[Unset, CreateZoomMeetingTaskParamsRecordingMode] = UNSET + enable_zoom_bot_auto_join: Union[Unset, bool] = UNSET + post_to_incident_timeline: Union[Unset, bool] = UNSET + post_to_slack_channels: Union[Unset, list["CreateZoomMeetingTaskParamsPostToSlackChannelsItem"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - topic = self.topic - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -74,17 +71,17 @@ def to_dict(self) -> dict[str, Any]: create_as_email = self.create_as_email - alternative_hosts: list[str] | Unset = UNSET + alternative_hosts: Union[Unset, list[str]] = UNSET if not isinstance(self.alternative_hosts, Unset): alternative_hosts = self.alternative_hosts - auto_recording: str | Unset = UNSET + auto_recording: Union[Unset, str] = UNSET if not isinstance(self.auto_recording, Unset): auto_recording = self.auto_recording record_meeting = self.record_meeting - recording_mode: str | Unset = UNSET + recording_mode: Union[Unset, str] = UNSET if not isinstance(self.recording_mode, Unset): recording_mode = self.recording_mode @@ -92,7 +89,7 @@ def to_dict(self) -> dict[str, Any]: post_to_incident_timeline = self.post_to_incident_timeline - post_to_slack_channels: list[dict[str, Any]] | Unset = UNSET + post_to_slack_channels: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.post_to_slack_channels, Unset): post_to_slack_channels = [] for post_to_slack_channels_item_data in self.post_to_slack_channels: @@ -139,7 +136,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: topic = d.pop("topic") _task_type = d.pop("task_type", UNSET) - task_type: CreateZoomMeetingTaskParamsTaskType | Unset + task_type: Union[Unset, CreateZoomMeetingTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: @@ -152,7 +149,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: alternative_hosts = cast(list[str], d.pop("alternative_hosts", UNSET)) _auto_recording = d.pop("auto_recording", UNSET) - auto_recording: CreateZoomMeetingTaskParamsAutoRecording | Unset + auto_recording: Union[Unset, CreateZoomMeetingTaskParamsAutoRecording] if isinstance(_auto_recording, Unset): auto_recording = UNSET else: @@ -161,7 +158,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: record_meeting = d.pop("record_meeting", UNSET) _recording_mode = d.pop("recording_mode", UNSET) - recording_mode: CreateZoomMeetingTaskParamsRecordingMode | Unset + recording_mode: Union[Unset, CreateZoomMeetingTaskParamsRecordingMode] if isinstance(_recording_mode, Unset): recording_mode = UNSET else: @@ -171,16 +168,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: post_to_incident_timeline = d.pop("post_to_incident_timeline", UNSET) + post_to_slack_channels = [] _post_to_slack_channels = d.pop("post_to_slack_channels", UNSET) - post_to_slack_channels: list[CreateZoomMeetingTaskParamsPostToSlackChannelsItem] | Unset = UNSET - if _post_to_slack_channels is not UNSET: - post_to_slack_channels = [] - for post_to_slack_channels_item_data in _post_to_slack_channels: - post_to_slack_channels_item = CreateZoomMeetingTaskParamsPostToSlackChannelsItem.from_dict( - post_to_slack_channels_item_data - ) + for post_to_slack_channels_item_data in _post_to_slack_channels or []: + post_to_slack_channels_item = CreateZoomMeetingTaskParamsPostToSlackChannelsItem.from_dict( + post_to_slack_channels_item_data + ) - post_to_slack_channels.append(post_to_slack_channels_item) + post_to_slack_channels.append(post_to_slack_channels_item) create_zoom_meeting_task_params = cls( topic=topic, diff --git a/rootly_sdk/models/create_zoom_meeting_task_params_post_to_slack_channels_item.py b/rootly_sdk/models/create_zoom_meeting_task_params_post_to_slack_channels_item.py index 7a669f7c..c9c207da 100644 --- a/rootly_sdk/models/create_zoom_meeting_task_params_post_to_slack_channels_item.py +++ b/rootly_sdk/models/create_zoom_meeting_task_params_post_to_slack_channels_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class CreateZoomMeetingTaskParamsPostToSlackChannelsItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/custom_field.py b/rootly_sdk/models/custom_field.py index b4fbada2..540808c2 100644 --- a/rootly_sdk/models/custom_field.py +++ b/rootly_sdk/models/custom_field.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -10,6 +8,7 @@ CustomFieldRequiredType0Item, check_custom_field_required_type_0_item, ) +from ..models.custom_field_resource_type import CustomFieldResourceType, check_custom_field_resource_type from ..models.custom_field_shown_item import CustomFieldShownItem, check_custom_field_shown_item from ..types import UNSET, Unset @@ -22,28 +21,30 @@ class CustomField: Attributes: label (str): The name of the custom_field shown (list[CustomFieldShownItem]): - required (list[CustomFieldRequiredType0Item] | None): + required (Union[None, list[CustomFieldRequiredType0Item]]): position (int): The position of the custom_field created_at (str): Date of creation updated_at (str): Date of last update - kind (str | Unset): The kind of the custom_field - enabled (bool | Unset): Whether the custom_field is enabled - slug (str | Unset): The slug of the custom_field - description (None | str | Unset): The description of the custom_field - default (None | str | Unset): The default value for text field kinds + kind (Union[Unset, str]): The kind of the custom_field + enabled (Union[Unset, bool]): Whether the custom_field is enabled + slug (Union[Unset, str]): The slug of the custom_field + resource_type (Union[Unset, CustomFieldResourceType]): The resource type this field belongs to + description (Union[None, Unset, str]): The description of the custom_field + default (Union[None, Unset, str]): The default value for text field kinds """ label: str shown: list[CustomFieldShownItem] - required: list[CustomFieldRequiredType0Item] | None + required: Union[None, list[CustomFieldRequiredType0Item]] position: int created_at: str updated_at: str - kind: str | Unset = UNSET - enabled: bool | Unset = UNSET - slug: str | Unset = UNSET - description: None | str | Unset = UNSET - default: None | str | Unset = UNSET + kind: Union[Unset, str] = UNSET + enabled: Union[Unset, bool] = UNSET + slug: Union[Unset, str] = UNSET + resource_type: Union[Unset, CustomFieldResourceType] = UNSET + description: Union[None, Unset, str] = UNSET + default: Union[None, Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -54,7 +55,7 @@ def to_dict(self) -> dict[str, Any]: shown_item: str = shown_item_data shown.append(shown_item) - required: list[str] | None + required: Union[None, list[str]] if isinstance(self.required, list): required = [] for required_type_0_item_data in self.required: @@ -76,13 +77,17 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - description: None | str | Unset + resource_type: Union[Unset, str] = UNSET + if not isinstance(self.resource_type, Unset): + resource_type = self.resource_type + + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: description = self.description - default: None | str | Unset + default: Union[None, Unset, str] if isinstance(self.default, Unset): default = UNSET else: @@ -106,6 +111,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["enabled"] = enabled if slug is not UNSET: field_dict["slug"] = slug + if resource_type is not UNSET: + field_dict["resource_type"] = resource_type if description is not UNSET: field_dict["description"] = description if default is not UNSET: @@ -125,7 +132,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: shown.append(shown_item) - def _parse_required(data: object) -> list[CustomFieldRequiredType0Item] | None: + def _parse_required(data: object) -> Union[None, list[CustomFieldRequiredType0Item]]: if data is None: return data try: @@ -139,9 +146,9 @@ def _parse_required(data: object) -> list[CustomFieldRequiredType0Item] | None: required_type_0.append(required_type_0_item) return required_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[CustomFieldRequiredType0Item] | None, data) + return cast(Union[None, list[CustomFieldRequiredType0Item]], data) required = _parse_required(d.pop("required")) @@ -157,21 +164,28 @@ def _parse_required(data: object) -> list[CustomFieldRequiredType0Item] | None: slug = d.pop("slug", UNSET) - def _parse_description(data: object) -> None | str | Unset: + _resource_type = d.pop("resource_type", UNSET) + resource_type: Union[Unset, CustomFieldResourceType] + if isinstance(_resource_type, Unset): + resource_type = UNSET + else: + resource_type = check_custom_field_resource_type(_resource_type) + + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) - def _parse_default(data: object) -> None | str | Unset: + def _parse_default(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) default = _parse_default(d.pop("default", UNSET)) @@ -185,6 +199,7 @@ def _parse_default(data: object) -> None | str | Unset: kind=kind, enabled=enabled, slug=slug, + resource_type=resource_type, description=description, default=default, ) diff --git a/rootly_sdk/models/custom_field_list.py b/rootly_sdk/models/custom_field_list.py index fe97544e..45ec18a8 100644 --- a/rootly_sdk/models/custom_field_list.py +++ b/rootly_sdk/models/custom_field_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,20 +20,19 @@ class CustomFieldList: """ Attributes: - data (list[CustomFieldListDataItem]): + data (list['CustomFieldListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[CustomFieldListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["CustomFieldListDataItem"] + links: "Links" + meta: "Meta" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) custom_field_list = cls( data=data, diff --git a/rootly_sdk/models/custom_field_list_data_item.py b/rootly_sdk/models/custom_field_list_data_item.py index fffd241a..608b0c38 100644 --- a/rootly_sdk/models/custom_field_list_data_item.py +++ b/rootly_sdk/models/custom_field_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class CustomFieldListDataItem: id: str type_: CustomFieldListDataItemType - attributes: CustomField + attributes: "CustomField" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/custom_field_option.py b/rootly_sdk/models/custom_field_option.py index 74f9d516..5e03e83d 100644 --- a/rootly_sdk/models/custom_field_option.py +++ b/rootly_sdk/models/custom_field_option.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -20,8 +18,8 @@ class CustomFieldOption: position (int): The position of the custom_field_option created_at (str): Date of creation updated_at (str): Date of last update - custom_field_id (int | Unset): The ID of the parent custom field - default (bool | Unset): + custom_field_id (Union[Unset, int]): The ID of the parent custom field + default (Union[Unset, bool]): """ value: str @@ -29,8 +27,8 @@ class CustomFieldOption: position: int created_at: str updated_at: str - custom_field_id: int | Unset = UNSET - default: bool | Unset = UNSET + custom_field_id: Union[Unset, int] = UNSET + default: Union[Unset, bool] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/custom_field_option_list.py b/rootly_sdk/models/custom_field_option_list.py index 8a317936..253ea8a4 100644 --- a/rootly_sdk/models/custom_field_option_list.py +++ b/rootly_sdk/models/custom_field_option_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,20 +20,19 @@ class CustomFieldOptionList: """ Attributes: - data (list[CustomFieldOptionListDataItem]): + data (list['CustomFieldOptionListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[CustomFieldOptionListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["CustomFieldOptionListDataItem"] + links: "Links" + meta: "Meta" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) custom_field_option_list = cls( data=data, diff --git a/rootly_sdk/models/custom_field_option_list_data_item.py b/rootly_sdk/models/custom_field_option_list_data_item.py index a4f0144a..1807c6b6 100644 --- a/rootly_sdk/models/custom_field_option_list_data_item.py +++ b/rootly_sdk/models/custom_field_option_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class CustomFieldOptionListDataItem: id: str type_: CustomFieldOptionListDataItemType - attributes: CustomFieldOption + attributes: "CustomFieldOption" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/custom_field_option_response.py b/rootly_sdk/models/custom_field_option_response.py index 88160965..b40ffc86 100644 --- a/rootly_sdk/models/custom_field_option_response.py +++ b/rootly_sdk/models/custom_field_option_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,18 +19,17 @@ class CustomFieldOptionResponse: """ Attributes: data (CustomFieldOptionResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: CustomFieldOptionResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "CustomFieldOptionResponseData" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = CustomFieldOptionResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) custom_field_option_response = cls( data=data, diff --git a/rootly_sdk/models/custom_field_option_response_data.py b/rootly_sdk/models/custom_field_option_response_data.py index d715f128..93ea8892 100644 --- a/rootly_sdk/models/custom_field_option_response_data.py +++ b/rootly_sdk/models/custom_field_option_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class CustomFieldOptionResponseData: id: str type_: CustomFieldOptionResponseDataType - attributes: CustomFieldOption + attributes: "CustomFieldOption" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/custom_field_resource_type.py b/rootly_sdk/models/custom_field_resource_type.py new file mode 100644 index 00000000..b3fab9ba --- /dev/null +++ b/rootly_sdk/models/custom_field_resource_type.py @@ -0,0 +1,16 @@ +from typing import Literal, cast + +CustomFieldResourceType = Literal["incident", "problem"] + +CUSTOM_FIELD_RESOURCE_TYPE_VALUES: set[CustomFieldResourceType] = { + "incident", + "problem", +} + + +def check_custom_field_resource_type(value: str | None) -> CustomFieldResourceType | None: + if value is None: + return None + if value in CUSTOM_FIELD_RESOURCE_TYPE_VALUES: + return cast(CustomFieldResourceType, value) + raise TypeError(f"Unexpected value {value!r}. Expected one of {CUSTOM_FIELD_RESOURCE_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/custom_field_response.py b/rootly_sdk/models/custom_field_response.py index 502d3f37..6b255031 100644 --- a/rootly_sdk/models/custom_field_response.py +++ b/rootly_sdk/models/custom_field_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,18 +19,17 @@ class CustomFieldResponse: """ Attributes: data (CustomFieldResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: CustomFieldResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "CustomFieldResponseData" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = CustomFieldResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) custom_field_response = cls( data=data, diff --git a/rootly_sdk/models/custom_field_response_data.py b/rootly_sdk/models/custom_field_response_data.py index 54454627..a33f5985 100644 --- a/rootly_sdk/models/custom_field_response_data.py +++ b/rootly_sdk/models/custom_field_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class CustomFieldResponseData: id: str type_: CustomFieldResponseDataType - attributes: CustomField + attributes: "CustomField" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/custom_form.py b/rootly_sdk/models/custom_form.py index 78ee24bb..c4f1c8dc 100644 --- a/rootly_sdk/models/custom_form.py +++ b/rootly_sdk/models/custom_form.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -20,9 +18,9 @@ class CustomForm: command (str): The Slack command used to trigger this form. created_at (str): Date of creation. updated_at (str): Date of last update. - slug (str | Unset): The custom form slug. Add this to form_field.shown or form_field.required to associate form - fields with custom forms. - description (None | str | Unset): + slug (Union[Unset, str]): The custom form slug. Add this to form_field.shown or form_field.required to associate + form fields with custom forms. + description (Union[None, Unset, str]): """ name: str @@ -30,8 +28,8 @@ class CustomForm: command: str created_at: str updated_at: str - slug: str | Unset = UNSET - description: None | str | Unset = UNSET + slug: Union[Unset, str] = UNSET + description: Union[None, Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -47,7 +45,7 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - description: None | str | Unset + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: @@ -86,12 +84,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: slug = d.pop("slug", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) diff --git a/rootly_sdk/models/custom_form_list.py b/rootly_sdk/models/custom_form_list.py index 8c429938..63cbed22 100644 --- a/rootly_sdk/models/custom_form_list.py +++ b/rootly_sdk/models/custom_form_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,20 +20,19 @@ class CustomFormList: """ Attributes: - data (list[CustomFormListDataItem]): + data (list['CustomFormListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[CustomFormListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["CustomFormListDataItem"] + links: "Links" + meta: "Meta" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) custom_form_list = cls( data=data, diff --git a/rootly_sdk/models/custom_form_list_data_item.py b/rootly_sdk/models/custom_form_list_data_item.py index 3aba2bac..3f36ae0d 100644 --- a/rootly_sdk/models/custom_form_list_data_item.py +++ b/rootly_sdk/models/custom_form_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class CustomFormListDataItem: id: str type_: CustomFormListDataItemType - attributes: CustomForm + attributes: "CustomForm" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/custom_form_response.py b/rootly_sdk/models/custom_form_response.py index f1bfe51b..1ec19f52 100644 --- a/rootly_sdk/models/custom_form_response.py +++ b/rootly_sdk/models/custom_form_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,18 +19,17 @@ class CustomFormResponse: """ Attributes: data (CustomFormResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: CustomFormResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "CustomFormResponseData" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = CustomFormResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) custom_form_response = cls( data=data, diff --git a/rootly_sdk/models/custom_form_response_data.py b/rootly_sdk/models/custom_form_response_data.py index 3ea9ebe9..ae29c003 100644 --- a/rootly_sdk/models/custom_form_response_data.py +++ b/rootly_sdk/models/custom_form_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class CustomFormResponseData: id: str type_: CustomFormResponseDataType - attributes: CustomForm + attributes: "CustomForm" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/dashboard.py b/rootly_sdk/models/dashboard.py index f83fc0c9..c7faeb2b 100644 --- a/rootly_sdk/models/dashboard.py +++ b/rootly_sdk/models/dashboard.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -20,31 +18,31 @@ class Dashboard: name (str): The name of the dashboard owner (DashboardOwner): The owner type of the dashboard public (bool): Whether the dashboard is public - team_id (int | Unset): The dashboard team - user_id (int | None | Unset): The dashboard user owner if owner is of type user - description (None | str | Unset): The description of the dashboard - range_ (None | str | Unset): The date range for dashboard panel data - period (None | str | Unset): The grouping period for dashboard panel data - auto_refresh (bool | Unset): Whether the dashboard auto-updates the UI with new data. - color (DashboardColor | Unset): The hex color of the dashboard - icon (str | Unset): The emoji icon of the dashboard - created_at (str | Unset): Date of creation - updated_at (str | Unset): Date of last update + team_id (Union[Unset, int]): The dashboard team + user_id (Union[None, Unset, int]): The dashboard user owner if owner is of type user + description (Union[None, Unset, str]): The description of the dashboard + range_ (Union[None, Unset, str]): The date range for dashboard panel data + period (Union[None, Unset, str]): The grouping period for dashboard panel data + auto_refresh (Union[Unset, bool]): Whether the dashboard auto-updates the UI with new data. + color (Union[Unset, DashboardColor]): The hex color of the dashboard + icon (Union[Unset, str]): The emoji icon of the dashboard + created_at (Union[Unset, str]): Date of creation + updated_at (Union[Unset, str]): Date of last update """ name: str owner: DashboardOwner public: bool - team_id: int | Unset = UNSET - user_id: int | None | Unset = UNSET - description: None | str | Unset = UNSET - range_: None | str | Unset = UNSET - period: None | str | Unset = UNSET - auto_refresh: bool | Unset = UNSET - color: DashboardColor | Unset = UNSET - icon: str | Unset = UNSET - created_at: str | Unset = UNSET - updated_at: str | Unset = UNSET + team_id: Union[Unset, int] = UNSET + user_id: Union[None, Unset, int] = UNSET + description: Union[None, Unset, str] = UNSET + range_: Union[None, Unset, str] = UNSET + period: Union[None, Unset, str] = UNSET + auto_refresh: Union[Unset, bool] = UNSET + color: Union[Unset, DashboardColor] = UNSET + icon: Union[Unset, str] = UNSET + created_at: Union[Unset, str] = UNSET + updated_at: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -56,25 +54,25 @@ def to_dict(self) -> dict[str, Any]: team_id = self.team_id - user_id: int | None | Unset + user_id: Union[None, Unset, int] if isinstance(self.user_id, Unset): user_id = UNSET else: user_id = self.user_id - description: None | str | Unset + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: description = self.description - range_: None | str | Unset + range_: Union[None, Unset, str] if isinstance(self.range_, Unset): range_ = UNSET else: range_ = self.range_ - period: None | str | Unset + period: Union[None, Unset, str] if isinstance(self.period, Unset): period = UNSET else: @@ -82,7 +80,7 @@ def to_dict(self) -> dict[str, Any]: auto_refresh = self.auto_refresh - color: str | Unset = UNSET + color: Union[Unset, str] = UNSET if not isinstance(self.color, Unset): color = self.color @@ -135,46 +133,46 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: team_id = d.pop("team_id", UNSET) - def _parse_user_id(data: object) -> int | None | Unset: + def _parse_user_id(data: object) -> Union[None, Unset, int]: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(Union[None, Unset, int], data) user_id = _parse_user_id(d.pop("user_id", UNSET)) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) - def _parse_range_(data: object) -> None | str | Unset: + def _parse_range_(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) range_ = _parse_range_(d.pop("range", UNSET)) - def _parse_period(data: object) -> None | str | Unset: + def _parse_period(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) period = _parse_period(d.pop("period", UNSET)) auto_refresh = d.pop("auto_refresh", UNSET) _color = d.pop("color", UNSET) - color: DashboardColor | Unset + color: Union[Unset, DashboardColor] if isinstance(_color, Unset): color = UNSET else: diff --git a/rootly_sdk/models/dashboard_list.py b/rootly_sdk/models/dashboard_list.py index 265ba250..baa91216 100644 --- a/rootly_sdk/models/dashboard_list.py +++ b/rootly_sdk/models/dashboard_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,20 +20,19 @@ class DashboardList: """ Attributes: - data (list[DashboardListDataItem]): + data (list['DashboardListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[DashboardListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["DashboardListDataItem"] + links: "Links" + meta: "Meta" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) dashboard_list = cls( data=data, diff --git a/rootly_sdk/models/dashboard_list_data_item.py b/rootly_sdk/models/dashboard_list_data_item.py index 8950eaf7..86d1b13b 100644 --- a/rootly_sdk/models/dashboard_list_data_item.py +++ b/rootly_sdk/models/dashboard_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class DashboardListDataItem: id: str type_: DashboardListDataItemType - attributes: Dashboard + attributes: "Dashboard" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/dashboard_panel.py b/rootly_sdk/models/dashboard_panel.py index 4cd0dbe5..c0a4c63f 100644 --- a/rootly_sdk/models/dashboard_panel.py +++ b/rootly_sdk/models/dashboard_panel.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,17 +20,17 @@ class DashboardPanel: """ Attributes: params (DashboardPanelParams): - dashboard_id (str | Unset): The panel dashboard - name (None | str | Unset): The name of the dashboard_panel - position (DashboardPanelPositionType0 | None | Unset): - data (list[DashboardPanelDataItem] | Unset): + dashboard_id (Union[Unset, str]): The panel dashboard + name (Union[None, Unset, str]): The name of the dashboard_panel + position (Union['DashboardPanelPositionType0', None, Unset]): + data (Union[Unset, list['DashboardPanelDataItem']]): """ - params: DashboardPanelParams - dashboard_id: str | Unset = UNSET - name: None | str | Unset = UNSET - position: DashboardPanelPositionType0 | None | Unset = UNSET - data: list[DashboardPanelDataItem] | Unset = UNSET + params: "DashboardPanelParams" + dashboard_id: Union[Unset, str] = UNSET + name: Union[None, Unset, str] = UNSET + position: Union["DashboardPanelPositionType0", None, Unset] = UNSET + data: Union[Unset, list["DashboardPanelDataItem"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,13 +40,13 @@ def to_dict(self) -> dict[str, Any]: dashboard_id = self.dashboard_id - name: None | str | Unset + name: Union[None, Unset, str] if isinstance(self.name, Unset): name = UNSET else: name = self.name - position: dict[str, Any] | None | Unset + position: Union[None, Unset, dict[str, Any]] if isinstance(self.position, Unset): position = UNSET elif isinstance(self.position, DashboardPanelPositionType0): @@ -56,7 +54,7 @@ def to_dict(self) -> dict[str, Any]: else: position = self.position - data: list[dict[str, Any]] | Unset = UNSET + data: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.data, Unset): data = [] for data_item_data in self.data: @@ -92,16 +90,16 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: dashboard_id = d.pop("dashboard_id", UNSET) - def _parse_name(data: object) -> None | str | Unset: + def _parse_name(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) name = _parse_name(d.pop("name", UNSET)) - def _parse_position(data: object) -> DashboardPanelPositionType0 | None | Unset: + def _parse_position(data: object) -> Union["DashboardPanelPositionType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -112,20 +110,18 @@ def _parse_position(data: object) -> DashboardPanelPositionType0 | None | Unset: position_type_0 = DashboardPanelPositionType0.from_dict(data) return position_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(DashboardPanelPositionType0 | None | Unset, data) + return cast(Union["DashboardPanelPositionType0", None, Unset], data) position = _parse_position(d.pop("position", UNSET)) + data = [] _data = d.pop("data", UNSET) - data: list[DashboardPanelDataItem] | Unset = UNSET - if _data is not UNSET: - data = [] - for data_item_data in _data: - data_item = DashboardPanelDataItem.from_dict(data_item_data) + for data_item_data in _data or []: + data_item = DashboardPanelDataItem.from_dict(data_item_data) - data.append(data_item) + data.append(data_item) dashboard_panel = cls( params=params, diff --git a/rootly_sdk/models/dashboard_panel_data_item.py b/rootly_sdk/models/dashboard_panel_data_item.py index 3e9c8030..67ba809f 100644 --- a/rootly_sdk/models/dashboard_panel_data_item.py +++ b/rootly_sdk/models/dashboard_panel_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,7 +14,6 @@ class DashboardPanelDataItem: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) diff --git a/rootly_sdk/models/dashboard_panel_list.py b/rootly_sdk/models/dashboard_panel_list.py index bde2df38..57e81259 100644 --- a/rootly_sdk/models/dashboard_panel_list.py +++ b/rootly_sdk/models/dashboard_panel_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,20 +20,19 @@ class DashboardPanelList: """ Attributes: - data (list[DashboardPanelListDataItem]): + data (list['DashboardPanelListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[DashboardPanelListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["DashboardPanelListDataItem"] + links: "Links" + meta: "Meta" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) dashboard_panel_list = cls( data=data, diff --git a/rootly_sdk/models/dashboard_panel_list_data_item.py b/rootly_sdk/models/dashboard_panel_list_data_item.py index bd1dc5f7..e773636f 100644 --- a/rootly_sdk/models/dashboard_panel_list_data_item.py +++ b/rootly_sdk/models/dashboard_panel_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class DashboardPanelListDataItem: id: str type_: DashboardPanelListDataItemType - attributes: DashboardPanel + attributes: "DashboardPanel" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/dashboard_panel_params.py b/rootly_sdk/models/dashboard_panel_params.py index 66aed2da..13056bab 100644 --- a/rootly_sdk/models/dashboard_panel_params.py +++ b/rootly_sdk/models/dashboard_panel_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,43 +20,42 @@ class DashboardPanelParams: """ Attributes: - display (DashboardPanelParamsDisplay | Unset): - description (str | Unset): - table_fields (list[str] | Unset): - legend (DashboardPanelParamsLegend | Unset): - datalabels (DashboardPanelParamsDatalabels | Unset): - datasets (list[DashboardPanelParamsDatasetsItem] | Unset): + display (Union[Unset, DashboardPanelParamsDisplay]): + description (Union[Unset, str]): + table_fields (Union[Unset, list[str]]): + legend (Union[Unset, DashboardPanelParamsLegend]): + datalabels (Union[Unset, DashboardPanelParamsDatalabels]): + datasets (Union[Unset, list['DashboardPanelParamsDatasetsItem']]): """ - display: DashboardPanelParamsDisplay | Unset = UNSET - description: str | Unset = UNSET - table_fields: list[str] | Unset = UNSET - legend: DashboardPanelParamsLegend | Unset = UNSET - datalabels: DashboardPanelParamsDatalabels | Unset = UNSET - datasets: list[DashboardPanelParamsDatasetsItem] | Unset = UNSET + display: Union[Unset, DashboardPanelParamsDisplay] = UNSET + description: Union[Unset, str] = UNSET + table_fields: Union[Unset, list[str]] = UNSET + legend: Union[Unset, "DashboardPanelParamsLegend"] = UNSET + datalabels: Union[Unset, "DashboardPanelParamsDatalabels"] = UNSET + datasets: Union[Unset, list["DashboardPanelParamsDatasetsItem"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - - display: str | Unset = UNSET + display: Union[Unset, str] = UNSET if not isinstance(self.display, Unset): display = self.display description = self.description - table_fields: list[str] | Unset = UNSET + table_fields: Union[Unset, list[str]] = UNSET if not isinstance(self.table_fields, Unset): table_fields = self.table_fields - legend: dict[str, Any] | Unset = UNSET + legend: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.legend, Unset): legend = self.legend.to_dict() - datalabels: dict[str, Any] | Unset = UNSET + datalabels: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.datalabels, Unset): datalabels = self.datalabels.to_dict() - datasets: list[dict[str, Any]] | Unset = UNSET + datasets: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.datasets, Unset): datasets = [] for datasets_item_data in self.datasets: @@ -91,7 +88,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _display = d.pop("display", UNSET) - display: DashboardPanelParamsDisplay | Unset + display: Union[Unset, DashboardPanelParamsDisplay] if isinstance(_display, Unset): display = UNSET else: @@ -102,27 +99,25 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: table_fields = cast(list[str], d.pop("table_fields", UNSET)) _legend = d.pop("legend", UNSET) - legend: DashboardPanelParamsLegend | Unset + legend: Union[Unset, DashboardPanelParamsLegend] if isinstance(_legend, Unset): legend = UNSET else: legend = DashboardPanelParamsLegend.from_dict(_legend) _datalabels = d.pop("datalabels", UNSET) - datalabels: DashboardPanelParamsDatalabels | Unset + datalabels: Union[Unset, DashboardPanelParamsDatalabels] if isinstance(_datalabels, Unset): datalabels = UNSET else: datalabels = DashboardPanelParamsDatalabels.from_dict(_datalabels) + datasets = [] _datasets = d.pop("datasets", UNSET) - datasets: list[DashboardPanelParamsDatasetsItem] | Unset = UNSET - if _datasets is not UNSET: - datasets = [] - for datasets_item_data in _datasets: - datasets_item = DashboardPanelParamsDatasetsItem.from_dict(datasets_item_data) + for datasets_item_data in _datasets or []: + datasets_item = DashboardPanelParamsDatasetsItem.from_dict(datasets_item_data) - datasets.append(datasets_item) + datasets.append(datasets_item) dashboard_panel_params = cls( display=display, diff --git a/rootly_sdk/models/dashboard_panel_params_datalabels.py b/rootly_sdk/models/dashboard_panel_params_datalabels.py index be9de80e..6a1dc92e 100644 --- a/rootly_sdk/models/dashboard_panel_params_datalabels.py +++ b/rootly_sdk/models/dashboard_panel_params_datalabels.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,10 +13,10 @@ class DashboardPanelParamsDatalabels: """ Attributes: - enabled (bool | Unset): + enabled (Union[Unset, bool]): """ - enabled: bool | Unset = UNSET + enabled: Union[Unset, bool] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/dashboard_panel_params_datasets_item.py b/rootly_sdk/models/dashboard_panel_params_datasets_item.py index 21e85bab..452418c4 100644 --- a/rootly_sdk/models/dashboard_panel_params_datasets_item.py +++ b/rootly_sdk/models/dashboard_panel_params_datasets_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,18 +27,18 @@ class DashboardPanelParamsDatasetsItem: """ Attributes: - name (None | str | Unset): - collection (DashboardPanelParamsDatasetsItemCollection | Unset): - filter_ (list[DashboardPanelParamsDatasetsItemFilterItem] | Unset): - group_by (DashboardPanelParamsDatasetsItemGroupByType1Type0 | None | str | Unset): - aggregate (DashboardPanelParamsDatasetsItemAggregateType0 | None | Unset): + name (Union[None, Unset, str]): + collection (Union[Unset, DashboardPanelParamsDatasetsItemCollection]): + filter_ (Union[Unset, list['DashboardPanelParamsDatasetsItemFilterItem']]): + group_by (Union['DashboardPanelParamsDatasetsItemGroupByType1Type0', None, Unset, str]): + aggregate (Union['DashboardPanelParamsDatasetsItemAggregateType0', None, Unset]): """ - name: None | str | Unset = UNSET - collection: DashboardPanelParamsDatasetsItemCollection | Unset = UNSET - filter_: list[DashboardPanelParamsDatasetsItemFilterItem] | Unset = UNSET - group_by: DashboardPanelParamsDatasetsItemGroupByType1Type0 | None | str | Unset = UNSET - aggregate: DashboardPanelParamsDatasetsItemAggregateType0 | None | Unset = UNSET + name: Union[None, Unset, str] = UNSET + collection: Union[Unset, DashboardPanelParamsDatasetsItemCollection] = UNSET + filter_: Union[Unset, list["DashboardPanelParamsDatasetsItemFilterItem"]] = UNSET + group_by: Union["DashboardPanelParamsDatasetsItemGroupByType1Type0", None, Unset, str] = UNSET + aggregate: Union["DashboardPanelParamsDatasetsItemAggregateType0", None, Unset] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -51,24 +49,24 @@ def to_dict(self) -> dict[str, Any]: DashboardPanelParamsDatasetsItemGroupByType1Type0, ) - name: None | str | Unset + name: Union[None, Unset, str] if isinstance(self.name, Unset): name = UNSET else: name = self.name - collection: str | Unset = UNSET + collection: Union[Unset, str] = UNSET if not isinstance(self.collection, Unset): collection = self.collection - filter_: list[dict[str, Any]] | Unset = UNSET + filter_: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.filter_, Unset): filter_ = [] for filter_item_data in self.filter_: filter_item = filter_item_data.to_dict() filter_.append(filter_item) - group_by: dict[str, Any] | None | str | Unset + group_by: Union[None, Unset, dict[str, Any], str] if isinstance(self.group_by, Unset): group_by = UNSET elif isinstance(self.group_by, DashboardPanelParamsDatasetsItemGroupByType1Type0): @@ -76,7 +74,7 @@ def to_dict(self) -> dict[str, Any]: else: group_by = self.group_by - aggregate: dict[str, Any] | None | Unset + aggregate: Union[None, Unset, dict[str, Any]] if isinstance(self.aggregate, Unset): aggregate = UNSET elif isinstance(self.aggregate, DashboardPanelParamsDatasetsItemAggregateType0): @@ -112,32 +110,32 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_name(data: object) -> None | str | Unset: + def _parse_name(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) name = _parse_name(d.pop("name", UNSET)) _collection = d.pop("collection", UNSET) - collection: DashboardPanelParamsDatasetsItemCollection | Unset + collection: Union[Unset, DashboardPanelParamsDatasetsItemCollection] if isinstance(_collection, Unset): collection = UNSET else: collection = check_dashboard_panel_params_datasets_item_collection(_collection) + filter_ = [] _filter_ = d.pop("filter", UNSET) - filter_: list[DashboardPanelParamsDatasetsItemFilterItem] | Unset = UNSET - if _filter_ is not UNSET: - filter_ = [] - for filter_item_data in _filter_: - filter_item = DashboardPanelParamsDatasetsItemFilterItem.from_dict(filter_item_data) + for filter_item_data in _filter_ or []: + filter_item = DashboardPanelParamsDatasetsItemFilterItem.from_dict(filter_item_data) - filter_.append(filter_item) + filter_.append(filter_item) - def _parse_group_by(data: object) -> DashboardPanelParamsDatasetsItemGroupByType1Type0 | None | str | Unset: + def _parse_group_by( + data: object, + ) -> Union["DashboardPanelParamsDatasetsItemGroupByType1Type0", None, Unset, str]: if data is None: return data if isinstance(data, Unset): @@ -148,13 +146,13 @@ def _parse_group_by(data: object) -> DashboardPanelParamsDatasetsItemGroupByType group_by_type_1_type_0 = DashboardPanelParamsDatasetsItemGroupByType1Type0.from_dict(data) return group_by_type_1_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(DashboardPanelParamsDatasetsItemGroupByType1Type0 | None | str | Unset, data) + return cast(Union["DashboardPanelParamsDatasetsItemGroupByType1Type0", None, Unset, str], data) group_by = _parse_group_by(d.pop("group_by", UNSET)) - def _parse_aggregate(data: object) -> DashboardPanelParamsDatasetsItemAggregateType0 | None | Unset: + def _parse_aggregate(data: object) -> Union["DashboardPanelParamsDatasetsItemAggregateType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -165,9 +163,9 @@ def _parse_aggregate(data: object) -> DashboardPanelParamsDatasetsItemAggregateT aggregate_type_0 = DashboardPanelParamsDatasetsItemAggregateType0.from_dict(data) return aggregate_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(DashboardPanelParamsDatasetsItemAggregateType0 | None | Unset, data) + return cast(Union["DashboardPanelParamsDatasetsItemAggregateType0", None, Unset], data) aggregate = _parse_aggregate(d.pop("aggregate", UNSET)) diff --git a/rootly_sdk/models/dashboard_panel_params_datasets_item_aggregate_type_0.py b/rootly_sdk/models/dashboard_panel_params_datasets_item_aggregate_type_0.py index 1c0d2a95..6d86cc2f 100644 --- a/rootly_sdk/models/dashboard_panel_params_datasets_item_aggregate_type_0.py +++ b/rootly_sdk/models/dashboard_panel_params_datasets_item_aggregate_type_0.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,28 +17,28 @@ class DashboardPanelParamsDatasetsItemAggregateType0: """ Attributes: - operation (DashboardPanelParamsDatasetsItemAggregateType0Operation | Unset): - key (None | str | Unset): - cumulative (bool | None | Unset): + operation (Union[Unset, DashboardPanelParamsDatasetsItemAggregateType0Operation]): + key (Union[None, Unset, str]): + cumulative (Union[None, Unset, bool]): """ - operation: DashboardPanelParamsDatasetsItemAggregateType0Operation | Unset = UNSET - key: None | str | Unset = UNSET - cumulative: bool | None | Unset = UNSET + operation: Union[Unset, DashboardPanelParamsDatasetsItemAggregateType0Operation] = UNSET + key: Union[None, Unset, str] = UNSET + cumulative: Union[None, Unset, bool] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - operation: str | Unset = UNSET + operation: Union[Unset, str] = UNSET if not isinstance(self.operation, Unset): operation = self.operation - key: None | str | Unset + key: Union[None, Unset, str] if isinstance(self.key, Unset): key = UNSET else: key = self.key - cumulative: bool | None | Unset + cumulative: Union[None, Unset, bool] if isinstance(self.cumulative, Unset): cumulative = UNSET else: @@ -62,27 +60,27 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _operation = d.pop("operation", UNSET) - operation: DashboardPanelParamsDatasetsItemAggregateType0Operation | Unset + operation: Union[Unset, DashboardPanelParamsDatasetsItemAggregateType0Operation] if isinstance(_operation, Unset): operation = UNSET else: operation = check_dashboard_panel_params_datasets_item_aggregate_type_0_operation(_operation) - def _parse_key(data: object) -> None | str | Unset: + def _parse_key(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) key = _parse_key(d.pop("key", UNSET)) - def _parse_cumulative(data: object) -> bool | None | Unset: + def _parse_cumulative(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) cumulative = _parse_cumulative(d.pop("cumulative", UNSET)) diff --git a/rootly_sdk/models/dashboard_panel_params_datasets_item_filter_item.py b/rootly_sdk/models/dashboard_panel_params_datasets_item_filter_item.py index 1eaceebe..6a9aa89c 100644 --- a/rootly_sdk/models/dashboard_panel_params_datasets_item_filter_item.py +++ b/rootly_sdk/models/dashboard_panel_params_datasets_item_filter_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -25,21 +23,20 @@ class DashboardPanelParamsDatasetsItemFilterItem: """ Attributes: - operation (DashboardPanelParamsDatasetsItemFilterItemOperation | Unset): - rules (list[DashboardPanelParamsDatasetsItemFilterItemRulesItem] | Unset): + operation (Union[Unset, DashboardPanelParamsDatasetsItemFilterItemOperation]): + rules (Union[Unset, list['DashboardPanelParamsDatasetsItemFilterItemRulesItem']]): """ - operation: DashboardPanelParamsDatasetsItemFilterItemOperation | Unset = UNSET - rules: list[DashboardPanelParamsDatasetsItemFilterItemRulesItem] | Unset = UNSET + operation: Union[Unset, DashboardPanelParamsDatasetsItemFilterItemOperation] = UNSET + rules: Union[Unset, list["DashboardPanelParamsDatasetsItemFilterItemRulesItem"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - - operation: str | Unset = UNSET + operation: Union[Unset, str] = UNSET if not isinstance(self.operation, Unset): operation = self.operation - rules: list[dict[str, Any]] | Unset = UNSET + rules: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.rules, Unset): rules = [] for rules_item_data in self.rules: @@ -64,20 +61,18 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _operation = d.pop("operation", UNSET) - operation: DashboardPanelParamsDatasetsItemFilterItemOperation | Unset + operation: Union[Unset, DashboardPanelParamsDatasetsItemFilterItemOperation] if isinstance(_operation, Unset): operation = UNSET else: operation = check_dashboard_panel_params_datasets_item_filter_item_operation(_operation) + rules = [] _rules = d.pop("rules", UNSET) - rules: list[DashboardPanelParamsDatasetsItemFilterItemRulesItem] | Unset = UNSET - if _rules is not UNSET: - rules = [] - for rules_item_data in _rules: - rules_item = DashboardPanelParamsDatasetsItemFilterItemRulesItem.from_dict(rules_item_data) + for rules_item_data in _rules or []: + rules_item = DashboardPanelParamsDatasetsItemFilterItemRulesItem.from_dict(rules_item_data) - rules.append(rules_item) + rules.append(rules_item) dashboard_panel_params_datasets_item_filter_item = cls( operation=operation, diff --git a/rootly_sdk/models/dashboard_panel_params_datasets_item_filter_item_rules_item.py b/rootly_sdk/models/dashboard_panel_params_datasets_item_filter_item_rules_item.py index 8358c43c..60055ad7 100644 --- a/rootly_sdk/models/dashboard_panel_params_datasets_item_filter_item_rules_item.py +++ b/rootly_sdk/models/dashboard_panel_params_datasets_item_filter_item_rules_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,24 +21,24 @@ class DashboardPanelParamsDatasetsItemFilterItemRulesItem: """ Attributes: - operation (DashboardPanelParamsDatasetsItemFilterItemRulesItemOperation | Unset): - condition (DashboardPanelParamsDatasetsItemFilterItemRulesItemCondition | Unset): - key (str | Unset): - value (str | Unset): + operation (Union[Unset, DashboardPanelParamsDatasetsItemFilterItemRulesItemOperation]): + condition (Union[Unset, DashboardPanelParamsDatasetsItemFilterItemRulesItemCondition]): + key (Union[Unset, str]): + value (Union[Unset, str]): """ - operation: DashboardPanelParamsDatasetsItemFilterItemRulesItemOperation | Unset = UNSET - condition: DashboardPanelParamsDatasetsItemFilterItemRulesItemCondition | Unset = UNSET - key: str | Unset = UNSET - value: str | Unset = UNSET + operation: Union[Unset, DashboardPanelParamsDatasetsItemFilterItemRulesItemOperation] = UNSET + condition: Union[Unset, DashboardPanelParamsDatasetsItemFilterItemRulesItemCondition] = UNSET + key: Union[Unset, str] = UNSET + value: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - operation: str | Unset = UNSET + operation: Union[Unset, str] = UNSET if not isinstance(self.operation, Unset): operation = self.operation - condition: str | Unset = UNSET + condition: Union[Unset, str] = UNSET if not isinstance(self.condition, Unset): condition = self.condition @@ -66,14 +64,14 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _operation = d.pop("operation", UNSET) - operation: DashboardPanelParamsDatasetsItemFilterItemRulesItemOperation | Unset + operation: Union[Unset, DashboardPanelParamsDatasetsItemFilterItemRulesItemOperation] if isinstance(_operation, Unset): operation = UNSET else: operation = check_dashboard_panel_params_datasets_item_filter_item_rules_item_operation(_operation) _condition = d.pop("condition", UNSET) - condition: DashboardPanelParamsDatasetsItemFilterItemRulesItemCondition | Unset + condition: Union[Unset, DashboardPanelParamsDatasetsItemFilterItemRulesItemCondition] if isinstance(_condition, Unset): condition = UNSET else: diff --git a/rootly_sdk/models/dashboard_panel_params_datasets_item_group_by_type_1_type_0.py b/rootly_sdk/models/dashboard_panel_params_datasets_item_group_by_type_1_type_0.py index 2bbe0ace..cbafb095 100644 --- a/rootly_sdk/models/dashboard_panel_params_datasets_item_group_by_type_1_type_0.py +++ b/rootly_sdk/models/dashboard_panel_params_datasets_item_group_by_type_1_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/dashboard_panel_params_legend.py b/rootly_sdk/models/dashboard_panel_params_legend.py index e39a194f..04c082b3 100644 --- a/rootly_sdk/models/dashboard_panel_params_legend.py +++ b/rootly_sdk/models/dashboard_panel_params_legend.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,14 +17,14 @@ class DashboardPanelParamsLegend: """ Attributes: - groups (DashboardPanelParamsLegendGroups | Unset): Default: 'all'. + groups (Union[Unset, DashboardPanelParamsLegendGroups]): Default: 'all'. """ - groups: DashboardPanelParamsLegendGroups | Unset = "all" + groups: Union[Unset, DashboardPanelParamsLegendGroups] = "all" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - groups: str | Unset = UNSET + groups: Union[Unset, str] = UNSET if not isinstance(self.groups, Unset): groups = self.groups @@ -42,7 +40,7 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _groups = d.pop("groups", UNSET) - groups: DashboardPanelParamsLegendGroups | Unset + groups: Union[Unset, DashboardPanelParamsLegendGroups] if isinstance(_groups, Unset): groups = UNSET else: diff --git a/rootly_sdk/models/dashboard_panel_position_type_0.py b/rootly_sdk/models/dashboard_panel_position_type_0.py index f64f7720..29f03cc9 100644 --- a/rootly_sdk/models/dashboard_panel_position_type_0.py +++ b/rootly_sdk/models/dashboard_panel_position_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/dashboard_panel_response.py b/rootly_sdk/models/dashboard_panel_response.py index 53b175e2..00d625cc 100644 --- a/rootly_sdk/models/dashboard_panel_response.py +++ b/rootly_sdk/models/dashboard_panel_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,18 +19,17 @@ class DashboardPanelResponse: """ Attributes: data (DashboardPanelResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: DashboardPanelResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "DashboardPanelResponseData" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = DashboardPanelResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) dashboard_panel_response = cls( data=data, diff --git a/rootly_sdk/models/dashboard_panel_response_data.py b/rootly_sdk/models/dashboard_panel_response_data.py index 17f3d2bc..f60ca138 100644 --- a/rootly_sdk/models/dashboard_panel_response_data.py +++ b/rootly_sdk/models/dashboard_panel_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class DashboardPanelResponseData: id: str type_: DashboardPanelResponseDataType - attributes: DashboardPanel + attributes: "DashboardPanel" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/dashboard_response.py b/rootly_sdk/models/dashboard_response.py index 8ccf9235..6f2b96b4 100644 --- a/rootly_sdk/models/dashboard_response.py +++ b/rootly_sdk/models/dashboard_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,18 +19,17 @@ class DashboardResponse: """ Attributes: data (DashboardResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: DashboardResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "DashboardResponseData" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = DashboardResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) dashboard_response = cls( data=data, diff --git a/rootly_sdk/models/dashboard_response_data.py b/rootly_sdk/models/dashboard_response_data.py index 2ba914b5..cf64ee80 100644 --- a/rootly_sdk/models/dashboard_response_data.py +++ b/rootly_sdk/models/dashboard_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class DashboardResponseData: id: str type_: DashboardResponseDataType - attributes: Dashboard + attributes: "Dashboard" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/delete_alert_route_response_200.py b/rootly_sdk/models/delete_alert_route_response_200.py index dfee77b3..0e0b800e 100644 --- a/rootly_sdk/models/delete_alert_route_response_200.py +++ b/rootly_sdk/models/delete_alert_route_response_200.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,15 +17,14 @@ class DeleteAlertRouteResponse200: """ Attributes: - data (DeleteAlertRouteResponse200Data | Unset): + data (Union[Unset, DeleteAlertRouteResponse200Data]): """ - data: DeleteAlertRouteResponse200Data | Unset = UNSET + data: Union[Unset, "DeleteAlertRouteResponse200Data"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - - data: dict[str, Any] | Unset = UNSET + data: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.data, Unset): data = self.data.to_dict() @@ -45,7 +42,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _data = d.pop("data", UNSET) - data: DeleteAlertRouteResponse200Data | Unset + data: Union[Unset, DeleteAlertRouteResponse200Data] if isinstance(_data, Unset): data = UNSET else: diff --git a/rootly_sdk/models/delete_alert_route_response_200_data.py b/rootly_sdk/models/delete_alert_route_response_200_data.py index 95d7b221..cb14105c 100644 --- a/rootly_sdk/models/delete_alert_route_response_200_data.py +++ b/rootly_sdk/models/delete_alert_route_response_200_data.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,23 +17,22 @@ class DeleteAlertRouteResponse200Data: """ Attributes: - id (str | Unset): - type_ (str | Unset): - attributes (DeleteAlertRouteResponse200DataAttributes | Unset): + id (Union[Unset, str]): + type_ (Union[Unset, str]): + attributes (Union[Unset, DeleteAlertRouteResponse200DataAttributes]): """ - id: str | Unset = UNSET - type_: str | Unset = UNSET - attributes: DeleteAlertRouteResponse200DataAttributes | Unset = UNSET + id: Union[Unset, str] = UNSET + type_: Union[Unset, str] = UNSET + attributes: Union[Unset, "DeleteAlertRouteResponse200DataAttributes"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_ = self.type_ - attributes: dict[str, Any] | Unset = UNSET + attributes: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.attributes, Unset): attributes = self.attributes.to_dict() @@ -61,7 +58,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: type_ = d.pop("type", UNSET) _attributes = d.pop("attributes", UNSET) - attributes: DeleteAlertRouteResponse200DataAttributes | Unset + attributes: Union[Unset, DeleteAlertRouteResponse200DataAttributes] if isinstance(_attributes, Unset): attributes = UNSET else: diff --git a/rootly_sdk/models/delete_alert_route_response_200_data_attributes.py b/rootly_sdk/models/delete_alert_route_response_200_data_attributes.py index a811a57e..20ef8390 100644 --- a/rootly_sdk/models/delete_alert_route_response_200_data_attributes.py +++ b/rootly_sdk/models/delete_alert_route_response_200_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,10 +13,10 @@ class DeleteAlertRouteResponse200DataAttributes: """ Attributes: - deleted (bool | Unset): + deleted (Union[Unset, bool]): """ - deleted: bool | Unset = UNSET + deleted: Union[Unset, bool] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/duplicate_incident.py b/rootly_sdk/models/duplicate_incident.py index 55260f94..f750b447 100644 --- a/rootly_sdk/models/duplicate_incident.py +++ b/rootly_sdk/models/duplicate_incident.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class DuplicateIncident: data (DuplicateIncidentData): """ - data: DuplicateIncidentData + data: "DuplicateIncidentData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/duplicate_incident_data.py b/rootly_sdk/models/duplicate_incident_data.py index 8b075bd7..aab0a6cb 100644 --- a/rootly_sdk/models/duplicate_incident_data.py +++ b/rootly_sdk/models/duplicate_incident_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class DuplicateIncidentData: """ type_: DuplicateIncidentDataType - attributes: DuplicateIncidentDataAttributes + attributes: "DuplicateIncidentDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/duplicate_incident_data_attributes.py b/rootly_sdk/models/duplicate_incident_data_attributes.py index 61946c43..feb76a0d 100644 --- a/rootly_sdk/models/duplicate_incident_data_attributes.py +++ b/rootly_sdk/models/duplicate_incident_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -14,25 +12,25 @@ class DuplicateIncidentDataAttributes: """ Attributes: - duplicate_incident_id (str | Unset): - auto_cancel_incident (bool | None | Unset): Default: True. - reason_for_cancellation (None | str | Unset): Why was the incident cancelled? + duplicate_incident_id (Union[Unset, str]): + auto_cancel_incident (Union[None, Unset, bool]): Default: True. + reason_for_cancellation (Union[None, Unset, str]): Why was the incident cancelled? """ - duplicate_incident_id: str | Unset = UNSET - auto_cancel_incident: bool | None | Unset = True - reason_for_cancellation: None | str | Unset = UNSET + duplicate_incident_id: Union[Unset, str] = UNSET + auto_cancel_incident: Union[None, Unset, bool] = True + reason_for_cancellation: Union[None, Unset, str] = UNSET def to_dict(self) -> dict[str, Any]: duplicate_incident_id = self.duplicate_incident_id - auto_cancel_incident: bool | None | Unset + auto_cancel_incident: Union[None, Unset, bool] if isinstance(self.auto_cancel_incident, Unset): auto_cancel_incident = UNSET else: auto_cancel_incident = self.auto_cancel_incident - reason_for_cancellation: None | str | Unset + reason_for_cancellation: Union[None, Unset, str] if isinstance(self.reason_for_cancellation, Unset): reason_for_cancellation = UNSET else: @@ -55,21 +53,21 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) duplicate_incident_id = d.pop("duplicate_incident_id", UNSET) - def _parse_auto_cancel_incident(data: object) -> bool | None | Unset: + def _parse_auto_cancel_incident(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) auto_cancel_incident = _parse_auto_cancel_incident(d.pop("auto_cancel_incident", UNSET)) - def _parse_reason_for_cancellation(data: object) -> None | str | Unset: + def _parse_reason_for_cancellation(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) reason_for_cancellation = _parse_reason_for_cancellation(d.pop("reason_for_cancellation", UNSET)) diff --git a/rootly_sdk/models/edge_connector.py b/rootly_sdk/models/edge_connector.py index 09054d23..d58e562c 100644 --- a/rootly_sdk/models/edge_connector.py +++ b/rootly_sdk/models/edge_connector.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class EdgeConnector: data (EdgeConnectorData): """ - data: EdgeConnectorData + data: "EdgeConnectorData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/edge_connector_action.py b/rootly_sdk/models/edge_connector_action.py index 4480e034..9876c156 100644 --- a/rootly_sdk/models/edge_connector_action.py +++ b/rootly_sdk/models/edge_connector_action.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class EdgeConnectorAction: data (EdgeConnectorActionData): """ - data: EdgeConnectorActionData + data: "EdgeConnectorActionData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/edge_connector_action_data.py b/rootly_sdk/models/edge_connector_action_data.py index e87a97a7..591a761b 100644 --- a/rootly_sdk/models/edge_connector_action_data.py +++ b/rootly_sdk/models/edge_connector_action_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar from uuid import UUID @@ -27,11 +25,10 @@ class EdgeConnectorActionData: type_: EdgeConnectorActionDataType id: UUID - attributes: EdgeConnectorActionDataAttributes + attributes: "EdgeConnectorActionDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ id = str(self.id) diff --git a/rootly_sdk/models/edge_connector_action_data_attributes.py b/rootly_sdk/models/edge_connector_action_data_attributes.py index 6c67eee5..32bfb0ff 100644 --- a/rootly_sdk/models/edge_connector_action_data_attributes.py +++ b/rootly_sdk/models/edge_connector_action_data_attributes.py @@ -1,8 +1,6 @@ -from __future__ import annotations - import datetime from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -33,53 +31,53 @@ class EdgeConnectorActionDataAttributes: Attributes: name (str): Action name action_type (EdgeConnectorActionDataAttributesActionType): Action type - slug (str | Unset): Action slug - icon (EdgeConnectorActionDataAttributesIcon | Unset): Action icon - description (None | str | Unset): Action description - timeout (int | None | Unset): Timeout in seconds - parameters (list[EdgeConnectorActionDataAttributesParametersType0Item] | None | Unset): Parameter definitions - last_executed_at (datetime.datetime | None | Unset): - created_at (datetime.datetime | Unset): - updated_at (datetime.datetime | Unset): + slug (Union[Unset, str]): Action slug + icon (Union[Unset, EdgeConnectorActionDataAttributesIcon]): Action icon + description (Union[None, Unset, str]): Action description + timeout (Union[None, Unset, int]): Timeout in seconds + parameters (Union[None, Unset, list['EdgeConnectorActionDataAttributesParametersType0Item']]): Parameter + definitions + last_executed_at (Union[None, Unset, datetime.datetime]): + created_at (Union[Unset, datetime.datetime]): + updated_at (Union[Unset, datetime.datetime]): """ name: str action_type: EdgeConnectorActionDataAttributesActionType - slug: str | Unset = UNSET - icon: EdgeConnectorActionDataAttributesIcon | Unset = UNSET - description: None | str | Unset = UNSET - timeout: int | None | Unset = UNSET - parameters: list[EdgeConnectorActionDataAttributesParametersType0Item] | None | Unset = UNSET - last_executed_at: datetime.datetime | None | Unset = UNSET - created_at: datetime.datetime | Unset = UNSET - updated_at: datetime.datetime | Unset = UNSET + slug: Union[Unset, str] = UNSET + icon: Union[Unset, EdgeConnectorActionDataAttributesIcon] = UNSET + description: Union[None, Unset, str] = UNSET + timeout: Union[None, Unset, int] = UNSET + parameters: Union[None, Unset, list["EdgeConnectorActionDataAttributesParametersType0Item"]] = UNSET + last_executed_at: Union[None, Unset, datetime.datetime] = UNSET + created_at: Union[Unset, datetime.datetime] = UNSET + updated_at: Union[Unset, datetime.datetime] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - name = self.name action_type: str = self.action_type slug = self.slug - icon: str | Unset = UNSET + icon: Union[Unset, str] = UNSET if not isinstance(self.icon, Unset): icon = self.icon - description: None | str | Unset + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: description = self.description - timeout: int | None | Unset + timeout: Union[None, Unset, int] if isinstance(self.timeout, Unset): timeout = UNSET else: timeout = self.timeout - parameters: list[dict[str, Any]] | None | Unset + parameters: Union[None, Unset, list[dict[str, Any]]] if isinstance(self.parameters, Unset): parameters = UNSET elif isinstance(self.parameters, list): @@ -91,7 +89,7 @@ def to_dict(self) -> dict[str, Any]: else: parameters = self.parameters - last_executed_at: None | str | Unset + last_executed_at: Union[None, Unset, str] if isinstance(self.last_executed_at, Unset): last_executed_at = UNSET elif isinstance(self.last_executed_at, datetime.datetime): @@ -99,11 +97,11 @@ def to_dict(self) -> dict[str, Any]: else: last_executed_at = self.last_executed_at - created_at: str | Unset = UNSET + created_at: Union[Unset, str] = UNSET if not isinstance(self.created_at, Unset): created_at = self.created_at.isoformat() - updated_at: str | Unset = UNSET + updated_at: Union[Unset, str] = UNSET if not isinstance(self.updated_at, Unset): updated_at = self.updated_at.isoformat() @@ -148,33 +146,33 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: slug = d.pop("slug", UNSET) _icon = d.pop("icon", UNSET) - icon: EdgeConnectorActionDataAttributesIcon | Unset + icon: Union[Unset, EdgeConnectorActionDataAttributesIcon] if isinstance(_icon, Unset): icon = UNSET else: icon = check_edge_connector_action_data_attributes_icon(_icon) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) - def _parse_timeout(data: object) -> int | None | Unset: + def _parse_timeout(data: object) -> Union[None, Unset, int]: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(Union[None, Unset, int], data) timeout = _parse_timeout(d.pop("timeout", UNSET)) def _parse_parameters( data: object, - ) -> list[EdgeConnectorActionDataAttributesParametersType0Item] | None | Unset: + ) -> Union[None, Unset, list["EdgeConnectorActionDataAttributesParametersType0Item"]]: if data is None: return data if isinstance(data, Unset): @@ -192,13 +190,13 @@ def _parse_parameters( parameters_type_0.append(parameters_type_0_item) return parameters_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[EdgeConnectorActionDataAttributesParametersType0Item] | None | Unset, data) + return cast(Union[None, Unset, list["EdgeConnectorActionDataAttributesParametersType0Item"]], data) parameters = _parse_parameters(d.pop("parameters", UNSET)) - def _parse_last_executed_at(data: object) -> datetime.datetime | None | Unset: + def _parse_last_executed_at(data: object) -> Union[None, Unset, datetime.datetime]: if data is None: return data if isinstance(data, Unset): @@ -209,21 +207,21 @@ def _parse_last_executed_at(data: object) -> datetime.datetime | None | Unset: last_executed_at_type_0 = isoparse(data) return last_executed_at_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(datetime.datetime | None | Unset, data) + return cast(Union[None, Unset, datetime.datetime], data) last_executed_at = _parse_last_executed_at(d.pop("last_executed_at", UNSET)) _created_at = d.pop("created_at", UNSET) - created_at: datetime.datetime | Unset + created_at: Union[Unset, datetime.datetime] if isinstance(_created_at, Unset): created_at = UNSET else: created_at = isoparse(_created_at) _updated_at = d.pop("updated_at", UNSET) - updated_at: datetime.datetime | Unset + updated_at: Union[Unset, datetime.datetime] if isinstance(_updated_at, Unset): updated_at = UNSET else: diff --git a/rootly_sdk/models/edge_connector_action_data_attributes_parameters_type_0_item.py b/rootly_sdk/models/edge_connector_action_data_attributes_parameters_type_0_item.py index b7212cb9..b50cdd6e 100644 --- a/rootly_sdk/models/edge_connector_action_data_attributes_parameters_type_0_item.py +++ b/rootly_sdk/models/edge_connector_action_data_attributes_parameters_type_0_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,44 +17,44 @@ class EdgeConnectorActionDataAttributesParametersType0Item: """ Attributes: - name (str | Unset): - type_ (EdgeConnectorActionDataAttributesParametersType0ItemType | Unset): - required (bool | Unset): - description (None | str | Unset): - default (None | str | Unset): Default value (any type) - options (list[str] | None | Unset): + name (Union[Unset, str]): + type_ (Union[Unset, EdgeConnectorActionDataAttributesParametersType0ItemType]): + required (Union[Unset, bool]): + description (Union[None, Unset, str]): + default (Union[None, Unset, str]): Default value (any type) + options (Union[None, Unset, list[str]]): """ - name: str | Unset = UNSET - type_: EdgeConnectorActionDataAttributesParametersType0ItemType | Unset = UNSET - required: bool | Unset = UNSET - description: None | str | Unset = UNSET - default: None | str | Unset = UNSET - options: list[str] | None | Unset = UNSET + name: Union[Unset, str] = UNSET + type_: Union[Unset, EdgeConnectorActionDataAttributesParametersType0ItemType] = UNSET + required: Union[Unset, bool] = UNSET + description: Union[None, Unset, str] = UNSET + default: Union[None, Unset, str] = UNSET + options: Union[None, Unset, list[str]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: name = self.name - type_: str | Unset = UNSET + type_: Union[Unset, str] = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ required = self.required - description: None | str | Unset + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: description = self.description - default: None | str | Unset + default: Union[None, Unset, str] if isinstance(self.default, Unset): default = UNSET else: default = self.default - options: list[str] | None | Unset + options: Union[None, Unset, list[str]] if isinstance(self.options, Unset): options = UNSET elif isinstance(self.options, list): @@ -89,7 +87,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name = d.pop("name", UNSET) _type_ = d.pop("type", UNSET) - type_: EdgeConnectorActionDataAttributesParametersType0ItemType | Unset + type_: Union[Unset, EdgeConnectorActionDataAttributesParametersType0ItemType] if isinstance(_type_, Unset): type_ = UNSET else: @@ -97,25 +95,25 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: required = d.pop("required", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) - def _parse_default(data: object) -> None | str | Unset: + def _parse_default(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) default = _parse_default(d.pop("default", UNSET)) - def _parse_options(data: object) -> list[str] | None | Unset: + def _parse_options(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -126,9 +124,9 @@ def _parse_options(data: object) -> list[str] | None | Unset: options_type_0 = cast(list[str], data) return options_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) options = _parse_options(d.pop("options", UNSET)) diff --git a/rootly_sdk/models/edge_connector_data.py b/rootly_sdk/models/edge_connector_data.py index 1264673c..be9d7e20 100644 --- a/rootly_sdk/models/edge_connector_data.py +++ b/rootly_sdk/models/edge_connector_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar from uuid import UUID @@ -27,11 +25,10 @@ class EdgeConnectorData: type_: EdgeConnectorDataType id: UUID - attributes: EdgeConnectorDataAttributes + attributes: "EdgeConnectorDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ id = str(self.id) diff --git a/rootly_sdk/models/edge_connector_data_attributes.py b/rootly_sdk/models/edge_connector_data_attributes.py index 8281a4d4..91e8ba9c 100644 --- a/rootly_sdk/models/edge_connector_data_attributes.py +++ b/rootly_sdk/models/edge_connector_data_attributes.py @@ -1,8 +1,6 @@ -from __future__ import annotations - import datetime from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,32 +21,32 @@ class EdgeConnectorDataAttributes: Attributes: name (str): Connector name status (EdgeConnectorDataAttributesStatus): Connector status - description (None | str | Unset): Connector description - subscriptions (list[str] | Unset): Array of event types to subscribe to - last_poll_at (datetime.datetime | None | Unset): Last time connector polled - online (bool | Unset): Whether connector is currently online - deliveries_count (int | Unset): Total number of deliveries - deliveries_queued_count (int | Unset): Number of queued deliveries - deliveries_running_count (int | Unset): Number of running deliveries - deliveries_completed_count (int | Unset): Number of completed deliveries - deliveries_failed_count (int | Unset): Number of failed deliveries - created_at (datetime.datetime | Unset): - updated_at (datetime.datetime | Unset): + description (Union[None, Unset, str]): Connector description + subscriptions (Union[Unset, list[str]]): Array of event types to subscribe to + last_poll_at (Union[None, Unset, datetime.datetime]): Last time connector polled + online (Union[Unset, bool]): Whether connector is currently online + deliveries_count (Union[Unset, int]): Total number of deliveries + deliveries_queued_count (Union[Unset, int]): Number of queued deliveries + deliveries_running_count (Union[Unset, int]): Number of running deliveries + deliveries_completed_count (Union[Unset, int]): Number of completed deliveries + deliveries_failed_count (Union[Unset, int]): Number of failed deliveries + created_at (Union[Unset, datetime.datetime]): + updated_at (Union[Unset, datetime.datetime]): """ name: str status: EdgeConnectorDataAttributesStatus - description: None | str | Unset = UNSET - subscriptions: list[str] | Unset = UNSET - last_poll_at: datetime.datetime | None | Unset = UNSET - online: bool | Unset = UNSET - deliveries_count: int | Unset = UNSET - deliveries_queued_count: int | Unset = UNSET - deliveries_running_count: int | Unset = UNSET - deliveries_completed_count: int | Unset = UNSET - deliveries_failed_count: int | Unset = UNSET - created_at: datetime.datetime | Unset = UNSET - updated_at: datetime.datetime | Unset = UNSET + description: Union[None, Unset, str] = UNSET + subscriptions: Union[Unset, list[str]] = UNSET + last_poll_at: Union[None, Unset, datetime.datetime] = UNSET + online: Union[Unset, bool] = UNSET + deliveries_count: Union[Unset, int] = UNSET + deliveries_queued_count: Union[Unset, int] = UNSET + deliveries_running_count: Union[Unset, int] = UNSET + deliveries_completed_count: Union[Unset, int] = UNSET + deliveries_failed_count: Union[Unset, int] = UNSET + created_at: Union[Unset, datetime.datetime] = UNSET + updated_at: Union[Unset, datetime.datetime] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -56,17 +54,17 @@ def to_dict(self) -> dict[str, Any]: status: str = self.status - description: None | str | Unset + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: description = self.description - subscriptions: list[str] | Unset = UNSET + subscriptions: Union[Unset, list[str]] = UNSET if not isinstance(self.subscriptions, Unset): subscriptions = self.subscriptions - last_poll_at: None | str | Unset + last_poll_at: Union[None, Unset, str] if isinstance(self.last_poll_at, Unset): last_poll_at = UNSET elif isinstance(self.last_poll_at, datetime.datetime): @@ -86,11 +84,11 @@ def to_dict(self) -> dict[str, Any]: deliveries_failed_count = self.deliveries_failed_count - created_at: str | Unset = UNSET + created_at: Union[Unset, str] = UNSET if not isinstance(self.created_at, Unset): created_at = self.created_at.isoformat() - updated_at: str | Unset = UNSET + updated_at: Union[Unset, str] = UNSET if not isinstance(self.updated_at, Unset): updated_at = self.updated_at.isoformat() @@ -134,18 +132,18 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: status = check_edge_connector_data_attributes_status(d.pop("status")) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) subscriptions = cast(list[str], d.pop("subscriptions", UNSET)) - def _parse_last_poll_at(data: object) -> datetime.datetime | None | Unset: + def _parse_last_poll_at(data: object) -> Union[None, Unset, datetime.datetime]: if data is None: return data if isinstance(data, Unset): @@ -156,9 +154,9 @@ def _parse_last_poll_at(data: object) -> datetime.datetime | None | Unset: last_poll_at_type_0 = isoparse(data) return last_poll_at_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(datetime.datetime | None | Unset, data) + return cast(Union[None, Unset, datetime.datetime], data) last_poll_at = _parse_last_poll_at(d.pop("last_poll_at", UNSET)) @@ -175,14 +173,14 @@ def _parse_last_poll_at(data: object) -> datetime.datetime | None | Unset: deliveries_failed_count = d.pop("deliveries_failed_count", UNSET) _created_at = d.pop("created_at", UNSET) - created_at: datetime.datetime | Unset + created_at: Union[Unset, datetime.datetime] if isinstance(_created_at, Unset): created_at = UNSET else: created_at = isoparse(_created_at) _updated_at = d.pop("updated_at", UNSET) - updated_at: datetime.datetime | Unset + updated_at: Union[Unset, datetime.datetime] if isinstance(_updated_at, Unset): updated_at = UNSET else: diff --git a/rootly_sdk/models/environment.py b/rootly_sdk/models/environment.py index 652d2359..88ebfe56 100644 --- a/rootly_sdk/models/environment.py +++ b/rootly_sdk/models/environment.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -25,38 +23,40 @@ class Environment: name (str): The name of the environment created_at (str): Date of creation updated_at (str): Date of last update - slug (str | Unset): The slug of the environment - managed_by (EnvironmentManagedBy | Unset): How this environment is managed (provenance): web, api, terraform, - etc. Read-only. - external_id (None | str | Unset): The external id associated to this environment - description (None | str | Unset): The description of the environment - notify_emails (list[str] | None | Unset): Emails attached to the environment - color (None | str | Unset): The hex color of the environment - position (int | None | Unset): Position of the environment - slack_channels (list[EnvironmentSlackChannelsType0Item] | None | Unset): Slack Channels associated with this - environment - slack_aliases (list[EnvironmentSlackAliasesType0Item] | None | Unset): Slack Aliases associated with this + slug (Union[Unset, str]): The slug of the environment + managed_by (Union[Unset, EnvironmentManagedBy]): How this environment is managed (provenance): web, api, + terraform, etc. Read-only. + external_id (Union[None, Unset, str]): The external id associated to this environment + description (Union[None, Unset, str]): The description of the environment + public_description (Union[None, Unset, str]): The status page description of the environment + notify_emails (Union[None, Unset, list[str]]): Emails attached to the environment + color (Union[None, Unset, str]): The hex color of the environment + position (Union[None, Unset, int]): Position of the environment + slack_channels (Union[None, Unset, list['EnvironmentSlackChannelsType0Item']]): Slack Channels associated with + this environment + slack_aliases (Union[None, Unset, list['EnvironmentSlackAliasesType0Item']]): Slack Aliases associated with this environment - properties (list[EnvironmentPropertiesType0Item] | None | Unset): Array of property values for this environment. + properties (Union[None, Unset, list['EnvironmentPropertiesType0Item']]): Array of property values for this + environment. """ name: str created_at: str updated_at: str - slug: str | Unset = UNSET - managed_by: EnvironmentManagedBy | Unset = UNSET - external_id: None | str | Unset = UNSET - description: None | str | Unset = UNSET - notify_emails: list[str] | None | Unset = UNSET - color: None | str | Unset = UNSET - position: int | None | Unset = UNSET - slack_channels: list[EnvironmentSlackChannelsType0Item] | None | Unset = UNSET - slack_aliases: list[EnvironmentSlackAliasesType0Item] | None | Unset = UNSET - properties: list[EnvironmentPropertiesType0Item] | None | Unset = UNSET + slug: Union[Unset, str] = UNSET + managed_by: Union[Unset, EnvironmentManagedBy] = UNSET + external_id: Union[None, Unset, str] = UNSET + description: Union[None, Unset, str] = UNSET + public_description: Union[None, Unset, str] = UNSET + notify_emails: Union[None, Unset, list[str]] = UNSET + color: Union[None, Unset, str] = UNSET + position: Union[None, Unset, int] = UNSET + slack_channels: Union[None, Unset, list["EnvironmentSlackChannelsType0Item"]] = UNSET + slack_aliases: Union[None, Unset, list["EnvironmentSlackAliasesType0Item"]] = UNSET + properties: Union[None, Unset, list["EnvironmentPropertiesType0Item"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - name = self.name created_at = self.created_at @@ -65,23 +65,29 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - managed_by: str | Unset = UNSET + managed_by: Union[Unset, str] = UNSET if not isinstance(self.managed_by, Unset): managed_by = self.managed_by - external_id: None | str | Unset + external_id: Union[None, Unset, str] if isinstance(self.external_id, Unset): external_id = UNSET else: external_id = self.external_id - description: None | str | Unset + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: description = self.description - notify_emails: list[str] | None | Unset + public_description: Union[None, Unset, str] + if isinstance(self.public_description, Unset): + public_description = UNSET + else: + public_description = self.public_description + + notify_emails: Union[None, Unset, list[str]] if isinstance(self.notify_emails, Unset): notify_emails = UNSET elif isinstance(self.notify_emails, list): @@ -90,19 +96,19 @@ def to_dict(self) -> dict[str, Any]: else: notify_emails = self.notify_emails - color: None | str | Unset + color: Union[None, Unset, str] if isinstance(self.color, Unset): color = UNSET else: color = self.color - position: int | None | Unset + position: Union[None, Unset, int] if isinstance(self.position, Unset): position = UNSET else: position = self.position - slack_channels: list[dict[str, Any]] | None | Unset + slack_channels: Union[None, Unset, list[dict[str, Any]]] if isinstance(self.slack_channels, Unset): slack_channels = UNSET elif isinstance(self.slack_channels, list): @@ -114,7 +120,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_channels = self.slack_channels - slack_aliases: list[dict[str, Any]] | None | Unset + slack_aliases: Union[None, Unset, list[dict[str, Any]]] if isinstance(self.slack_aliases, Unset): slack_aliases = UNSET elif isinstance(self.slack_aliases, list): @@ -126,7 +132,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_aliases = self.slack_aliases - properties: list[dict[str, Any]] | None | Unset + properties: Union[None, Unset, list[dict[str, Any]]] if isinstance(self.properties, Unset): properties = UNSET elif isinstance(self.properties, list): @@ -155,6 +161,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["external_id"] = external_id if description is not UNSET: field_dict["description"] = description + if public_description is not UNSET: + field_dict["public_description"] = public_description if notify_emails is not UNSET: field_dict["notify_emails"] = notify_emails if color is not UNSET: @@ -186,31 +194,40 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: slug = d.pop("slug", UNSET) _managed_by = d.pop("managed_by", UNSET) - managed_by: EnvironmentManagedBy | Unset + managed_by: Union[Unset, EnvironmentManagedBy] if isinstance(_managed_by, Unset): managed_by = UNSET else: managed_by = check_environment_managed_by(_managed_by) - def _parse_external_id(data: object) -> None | str | Unset: + def _parse_external_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) external_id = _parse_external_id(d.pop("external_id", UNSET)) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) - def _parse_notify_emails(data: object) -> list[str] | None | Unset: + def _parse_public_description(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + public_description = _parse_public_description(d.pop("public_description", UNSET)) + + def _parse_notify_emails(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -221,31 +238,31 @@ def _parse_notify_emails(data: object) -> list[str] | None | Unset: notify_emails_type_0 = cast(list[str], data) return notify_emails_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) notify_emails = _parse_notify_emails(d.pop("notify_emails", UNSET)) - def _parse_color(data: object) -> None | str | Unset: + def _parse_color(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) color = _parse_color(d.pop("color", UNSET)) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> Union[None, Unset, int]: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(Union[None, Unset, int], data) position = _parse_position(d.pop("position", UNSET)) - def _parse_slack_channels(data: object) -> list[EnvironmentSlackChannelsType0Item] | None | Unset: + def _parse_slack_channels(data: object) -> Union[None, Unset, list["EnvironmentSlackChannelsType0Item"]]: if data is None: return data if isinstance(data, Unset): @@ -263,13 +280,13 @@ def _parse_slack_channels(data: object) -> list[EnvironmentSlackChannelsType0Ite slack_channels_type_0.append(slack_channels_type_0_item) return slack_channels_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[EnvironmentSlackChannelsType0Item] | None | Unset, data) + return cast(Union[None, Unset, list["EnvironmentSlackChannelsType0Item"]], data) slack_channels = _parse_slack_channels(d.pop("slack_channels", UNSET)) - def _parse_slack_aliases(data: object) -> list[EnvironmentSlackAliasesType0Item] | None | Unset: + def _parse_slack_aliases(data: object) -> Union[None, Unset, list["EnvironmentSlackAliasesType0Item"]]: if data is None: return data if isinstance(data, Unset): @@ -287,13 +304,13 @@ def _parse_slack_aliases(data: object) -> list[EnvironmentSlackAliasesType0Item] slack_aliases_type_0.append(slack_aliases_type_0_item) return slack_aliases_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[EnvironmentSlackAliasesType0Item] | None | Unset, data) + return cast(Union[None, Unset, list["EnvironmentSlackAliasesType0Item"]], data) slack_aliases = _parse_slack_aliases(d.pop("slack_aliases", UNSET)) - def _parse_properties(data: object) -> list[EnvironmentPropertiesType0Item] | None | Unset: + def _parse_properties(data: object) -> Union[None, Unset, list["EnvironmentPropertiesType0Item"]]: if data is None: return data if isinstance(data, Unset): @@ -309,9 +326,9 @@ def _parse_properties(data: object) -> list[EnvironmentPropertiesType0Item] | No properties_type_0.append(properties_type_0_item) return properties_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[EnvironmentPropertiesType0Item] | None | Unset, data) + return cast(Union[None, Unset, list["EnvironmentPropertiesType0Item"]], data) properties = _parse_properties(d.pop("properties", UNSET)) @@ -323,6 +340,7 @@ def _parse_properties(data: object) -> list[EnvironmentPropertiesType0Item] | No managed_by=managed_by, external_id=external_id, description=description, + public_description=public_description, notify_emails=notify_emails, color=color, position=position, diff --git a/rootly_sdk/models/environment_list.py b/rootly_sdk/models/environment_list.py index 28818d4b..7d8c1875 100644 --- a/rootly_sdk/models/environment_list.py +++ b/rootly_sdk/models/environment_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,20 +20,19 @@ class EnvironmentList: """ Attributes: - data (list[EnvironmentListDataItem]): + data (list['EnvironmentListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[EnvironmentListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["EnvironmentListDataItem"] + links: "Links" + meta: "Meta" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) environment_list = cls( data=data, diff --git a/rootly_sdk/models/environment_list_data_item.py b/rootly_sdk/models/environment_list_data_item.py index 9cd8698e..b139edc2 100644 --- a/rootly_sdk/models/environment_list_data_item.py +++ b/rootly_sdk/models/environment_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class EnvironmentListDataItem: id: str type_: EnvironmentListDataItemType - attributes: Environment + attributes: "Environment" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/environment_properties_type_0_item.py b/rootly_sdk/models/environment_properties_type_0_item.py index 1e6c007a..a45b603f 100644 --- a/rootly_sdk/models/environment_properties_type_0_item.py +++ b/rootly_sdk/models/environment_properties_type_0_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/environment_response.py b/rootly_sdk/models/environment_response.py index 9bc22e2b..400f7207 100644 --- a/rootly_sdk/models/environment_response.py +++ b/rootly_sdk/models/environment_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,18 +19,17 @@ class EnvironmentResponse: """ Attributes: data (EnvironmentResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: EnvironmentResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "EnvironmentResponseData" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = EnvironmentResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) environment_response = cls( data=data, diff --git a/rootly_sdk/models/environment_response_data.py b/rootly_sdk/models/environment_response_data.py index b2a242c7..96dfb328 100644 --- a/rootly_sdk/models/environment_response_data.py +++ b/rootly_sdk/models/environment_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class EnvironmentResponseData: id: str type_: EnvironmentResponseDataType - attributes: Environment + attributes: "Environment" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/environment_slack_aliases_type_0_item.py b/rootly_sdk/models/environment_slack_aliases_type_0_item.py index 35b6c464..01439b1b 100644 --- a/rootly_sdk/models/environment_slack_aliases_type_0_item.py +++ b/rootly_sdk/models/environment_slack_aliases_type_0_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/environment_slack_channels_type_0_item.py b/rootly_sdk/models/environment_slack_channels_type_0_item.py index aab61759..9d2d54a7 100644 --- a/rootly_sdk/models/environment_slack_channels_type_0_item.py +++ b/rootly_sdk/models/environment_slack_channels_type_0_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/errors_list.py b/rootly_sdk/models/errors_list.py index 51274091..ae2486d0 100644 --- a/rootly_sdk/models/errors_list.py +++ b/rootly_sdk/models/errors_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,15 +17,14 @@ class ErrorsList: """ Attributes: - errors (list[ErrorsListErrorsItem] | Unset): + errors (Union[Unset, list['ErrorsListErrorsItem']]): """ - errors: list[ErrorsListErrorsItem] | Unset = UNSET + errors: Union[Unset, list["ErrorsListErrorsItem"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - - errors: list[dict[str, Any]] | Unset = UNSET + errors: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.errors, Unset): errors = [] for errors_item_data in self.errors: @@ -47,14 +44,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: from ..models.errors_list_errors_item import ErrorsListErrorsItem d = dict(src_dict) + errors = [] _errors = d.pop("errors", UNSET) - errors: list[ErrorsListErrorsItem] | Unset = UNSET - if _errors is not UNSET: - errors = [] - for errors_item_data in _errors: - errors_item = ErrorsListErrorsItem.from_dict(errors_item_data) + for errors_item_data in _errors or []: + errors_item = ErrorsListErrorsItem.from_dict(errors_item_data) - errors.append(errors_item) + errors.append(errors_item) errors_list = cls( errors=errors, diff --git a/rootly_sdk/models/errors_list_errors_item.py b/rootly_sdk/models/errors_list_errors_item.py index 55c41afb..23fd669d 100644 --- a/rootly_sdk/models/errors_list_errors_item.py +++ b/rootly_sdk/models/errors_list_errors_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,14 +15,14 @@ class ErrorsListErrorsItem: Attributes: title (str): status (str): - code (None | str | Unset): - detail (None | str | Unset): + code (Union[None, Unset, str]): + detail (Union[None, Unset, str]): """ title: str status: str - code: None | str | Unset = UNSET - detail: None | str | Unset = UNSET + code: Union[None, Unset, str] = UNSET + detail: Union[None, Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -32,13 +30,13 @@ def to_dict(self) -> dict[str, Any]: status = self.status - code: None | str | Unset + code: Union[None, Unset, str] if isinstance(self.code, Unset): code = UNSET else: code = self.code - detail: None | str | Unset + detail: Union[None, Unset, str] if isinstance(self.detail, Unset): detail = UNSET else: @@ -66,21 +64,21 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: status = d.pop("status") - def _parse_code(data: object) -> None | str | Unset: + def _parse_code(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) code = _parse_code(d.pop("code", UNSET)) - def _parse_detail(data: object) -> None | str | Unset: + def _parse_detail(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) detail = _parse_detail(d.pop("detail", UNSET)) diff --git a/rootly_sdk/models/escalate_alert.py b/rootly_sdk/models/escalate_alert.py index ecd3882d..4db6ccb0 100644 --- a/rootly_sdk/models/escalate_alert.py +++ b/rootly_sdk/models/escalate_alert.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,15 +17,14 @@ class EscalateAlert: """ Attributes: - data (EscalateAlertData | Unset): + data (Union[Unset, EscalateAlertData]): """ - data: EscalateAlertData | Unset = UNSET + data: Union[Unset, "EscalateAlertData"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - - data: dict[str, Any] | Unset = UNSET + data: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.data, Unset): data = self.data.to_dict() @@ -45,7 +42,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _data = d.pop("data", UNSET) - data: EscalateAlertData | Unset + data: Union[Unset, EscalateAlertData] if isinstance(_data, Unset): data = UNSET else: diff --git a/rootly_sdk/models/escalate_alert_data.py b/rootly_sdk/models/escalate_alert_data.py index beb705bc..a1cfa223 100644 --- a/rootly_sdk/models/escalate_alert_data.py +++ b/rootly_sdk/models/escalate_alert_data.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -20,21 +18,20 @@ class EscalateAlertData: """ Attributes: - type_ (EscalateAlertDataType | Unset): - attributes (EscalateAlertDataAttributes | Unset): + type_ (Union[Unset, EscalateAlertDataType]): + attributes (Union[Unset, EscalateAlertDataAttributes]): """ - type_: EscalateAlertDataType | Unset = UNSET - attributes: EscalateAlertDataAttributes | Unset = UNSET + type_: Union[Unset, EscalateAlertDataType] = UNSET + attributes: Union[Unset, "EscalateAlertDataAttributes"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - - type_: str | Unset = UNSET + type_: Union[Unset, str] = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ - attributes: dict[str, Any] | Unset = UNSET + attributes: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.attributes, Unset): attributes = self.attributes.to_dict() @@ -54,14 +51,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _type_ = d.pop("type", UNSET) - type_: EscalateAlertDataType | Unset + type_: Union[Unset, EscalateAlertDataType] if isinstance(_type_, Unset): type_ = UNSET else: type_ = check_escalate_alert_data_type(_type_) _attributes = d.pop("attributes", UNSET) - attributes: EscalateAlertDataAttributes | Unset + attributes: Union[Unset, EscalateAlertDataAttributes] if isinstance(_attributes, Unset): attributes = UNSET else: diff --git a/rootly_sdk/models/escalate_alert_data_attributes.py b/rootly_sdk/models/escalate_alert_data_attributes.py index b22f75ee..e99366d0 100644 --- a/rootly_sdk/models/escalate_alert_data_attributes.py +++ b/rootly_sdk/models/escalate_alert_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define @@ -14,14 +12,15 @@ class EscalateAlertDataAttributes: """ Attributes: - escalation_policy_id (str | Unset): The ID of the escalation policy to escalate to. If omitted, uses the alert's - current escalation policy from metadata. Required for resolved alerts whose metadata may have been cleared. - escalation_policy_level (int | Unset): The escalation policy level to escalate to. If omitted, defaults to the - next level (same EP) or level 1 (different EP). + escalation_policy_id (Union[Unset, str]): The ID of the escalation policy to escalate to. If omitted, uses the + alert's current escalation policy from metadata. Required for resolved alerts whose metadata may have been + cleared. + escalation_policy_level (Union[Unset, int]): The escalation policy level to escalate to. If omitted, defaults to + the next level (same EP) or level 1 (different EP). """ - escalation_policy_id: str | Unset = UNSET - escalation_policy_level: int | Unset = UNSET + escalation_policy_id: Union[Unset, str] = UNSET + escalation_policy_level: Union[Unset, int] = UNSET def to_dict(self) -> dict[str, Any]: escalation_policy_id = self.escalation_policy_id diff --git a/rootly_sdk/models/escalation_policy.py b/rootly_sdk/models/escalation_policy.py index 222eaa40..ad114b37 100644 --- a/rootly_sdk/models/escalation_policy.py +++ b/rootly_sdk/models/escalation_policy.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,25 +20,25 @@ class EscalationPolicy: name (str): The name of the escalation policy repeat_count (int): The number of times this policy will be executed until someone acknowledges the alert created_by_user_id (int): User who created the escalation policy - description (None | str | Unset): The description of the escalation policy - last_updated_by_user_id (int | Unset): User who updated the escalation policy - group_ids (list[str] | Unset): Associated groups (alerting the group will trigger escalation policy) - service_ids (list[str] | Unset): Associated services (alerting the service will trigger escalation policy) - business_hours (EscalationPolicyBusinessHoursType0 | None | Unset): - created_at (str | Unset): Date of creation - updated_at (str | Unset): Date of last update + description (Union[None, Unset, str]): The description of the escalation policy + last_updated_by_user_id (Union[Unset, int]): User who updated the escalation policy + group_ids (Union[Unset, list[str]]): Associated groups (alerting the group will trigger escalation policy) + service_ids (Union[Unset, list[str]]): Associated services (alerting the service will trigger escalation policy) + business_hours (Union['EscalationPolicyBusinessHoursType0', None, Unset]): + created_at (Union[Unset, str]): Date of creation + updated_at (Union[Unset, str]): Date of last update """ name: str repeat_count: int created_by_user_id: int - description: None | str | Unset = UNSET - last_updated_by_user_id: int | Unset = UNSET - group_ids: list[str] | Unset = UNSET - service_ids: list[str] | Unset = UNSET - business_hours: EscalationPolicyBusinessHoursType0 | None | Unset = UNSET - created_at: str | Unset = UNSET - updated_at: str | Unset = UNSET + description: Union[None, Unset, str] = UNSET + last_updated_by_user_id: Union[Unset, int] = UNSET + group_ids: Union[Unset, list[str]] = UNSET + service_ids: Union[Unset, list[str]] = UNSET + business_hours: Union["EscalationPolicyBusinessHoursType0", None, Unset] = UNSET + created_at: Union[Unset, str] = UNSET + updated_at: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -52,7 +50,7 @@ def to_dict(self) -> dict[str, Any]: created_by_user_id = self.created_by_user_id - description: None | str | Unset + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: @@ -60,15 +58,15 @@ def to_dict(self) -> dict[str, Any]: last_updated_by_user_id = self.last_updated_by_user_id - group_ids: list[str] | Unset = UNSET + group_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.group_ids, Unset): group_ids = self.group_ids - service_ids: list[str] | Unset = UNSET + service_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.service_ids, Unset): service_ids = self.service_ids - business_hours: dict[str, Any] | None | Unset + business_hours: Union[None, Unset, dict[str, Any]] if isinstance(self.business_hours, Unset): business_hours = UNSET elif isinstance(self.business_hours, EscalationPolicyBusinessHoursType0): @@ -117,12 +115,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: created_by_user_id = d.pop("created_by_user_id") - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) @@ -132,7 +130,7 @@ def _parse_description(data: object) -> None | str | Unset: service_ids = cast(list[str], d.pop("service_ids", UNSET)) - def _parse_business_hours(data: object) -> EscalationPolicyBusinessHoursType0 | None | Unset: + def _parse_business_hours(data: object) -> Union["EscalationPolicyBusinessHoursType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -143,9 +141,9 @@ def _parse_business_hours(data: object) -> EscalationPolicyBusinessHoursType0 | business_hours_type_0 = EscalationPolicyBusinessHoursType0.from_dict(data) return business_hours_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(EscalationPolicyBusinessHoursType0 | None | Unset, data) + return cast(Union["EscalationPolicyBusinessHoursType0", None, Unset], data) business_hours = _parse_business_hours(d.pop("business_hours", UNSET)) diff --git a/rootly_sdk/models/escalation_policy_business_hours_type_0.py b/rootly_sdk/models/escalation_policy_business_hours_type_0.py index 2312ee81..21d025cb 100644 --- a/rootly_sdk/models/escalation_policy_business_hours_type_0.py +++ b/rootly_sdk/models/escalation_policy_business_hours_type_0.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,24 +21,24 @@ class EscalationPolicyBusinessHoursType0: """ Attributes: - time_zone (EscalationPolicyBusinessHoursType0TimeZone | Unset): Time zone for business hours - days (list[EscalationPolicyBusinessHoursType0DaysType0Item] | None | Unset): Business days - start_time (None | str | Unset): Start time for business hours (HH:MM) - end_time (None | str | Unset): End time for business hours (HH:MM) + time_zone (Union[Unset, EscalationPolicyBusinessHoursType0TimeZone]): Time zone for business hours + days (Union[None, Unset, list[EscalationPolicyBusinessHoursType0DaysType0Item]]): Business days + start_time (Union[None, Unset, str]): Start time for business hours (HH:MM) + end_time (Union[None, Unset, str]): End time for business hours (HH:MM) """ - time_zone: EscalationPolicyBusinessHoursType0TimeZone | Unset = UNSET - days: list[EscalationPolicyBusinessHoursType0DaysType0Item] | None | Unset = UNSET - start_time: None | str | Unset = UNSET - end_time: None | str | Unset = UNSET + time_zone: Union[Unset, EscalationPolicyBusinessHoursType0TimeZone] = UNSET + days: Union[None, Unset, list[EscalationPolicyBusinessHoursType0DaysType0Item]] = UNSET + start_time: Union[None, Unset, str] = UNSET + end_time: Union[None, Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - time_zone: str | Unset = UNSET + time_zone: Union[Unset, str] = UNSET if not isinstance(self.time_zone, Unset): time_zone = self.time_zone - days: list[str] | None | Unset + days: Union[None, Unset, list[str]] if isinstance(self.days, Unset): days = UNSET elif isinstance(self.days, list): @@ -52,13 +50,13 @@ def to_dict(self) -> dict[str, Any]: else: days = self.days - start_time: None | str | Unset + start_time: Union[None, Unset, str] if isinstance(self.start_time, Unset): start_time = UNSET else: start_time = self.start_time - end_time: None | str | Unset + end_time: Union[None, Unset, str] if isinstance(self.end_time, Unset): end_time = UNSET else: @@ -82,13 +80,13 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _time_zone = d.pop("time_zone", UNSET) - time_zone: EscalationPolicyBusinessHoursType0TimeZone | Unset + time_zone: Union[Unset, EscalationPolicyBusinessHoursType0TimeZone] if isinstance(_time_zone, Unset): time_zone = UNSET else: time_zone = check_escalation_policy_business_hours_type_0_time_zone(_time_zone) - def _parse_days(data: object) -> list[EscalationPolicyBusinessHoursType0DaysType0Item] | None | Unset: + def _parse_days(data: object) -> Union[None, Unset, list[EscalationPolicyBusinessHoursType0DaysType0Item]]: if data is None: return data if isinstance(data, Unset): @@ -106,27 +104,27 @@ def _parse_days(data: object) -> list[EscalationPolicyBusinessHoursType0DaysType days_type_0.append(days_type_0_item) return days_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[EscalationPolicyBusinessHoursType0DaysType0Item] | None | Unset, data) + return cast(Union[None, Unset, list[EscalationPolicyBusinessHoursType0DaysType0Item]], data) days = _parse_days(d.pop("days", UNSET)) - def _parse_start_time(data: object) -> None | str | Unset: + def _parse_start_time(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) start_time = _parse_start_time(d.pop("start_time", UNSET)) - def _parse_end_time(data: object) -> None | str | Unset: + def _parse_end_time(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) end_time = _parse_end_time(d.pop("end_time", UNSET)) diff --git a/rootly_sdk/models/escalation_policy_level.py b/rootly_sdk/models/escalation_policy_level.py index 71d1397a..9acbada9 100644 --- a/rootly_sdk/models/escalation_policy_level.py +++ b/rootly_sdk/models/escalation_policy_level.py @@ -1,11 +1,17 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field +from ..models.escalation_policy_level_paging_strategy_configuration_repeats_mode import ( + EscalationPolicyLevelPagingStrategyConfigurationRepeatsMode, + check_escalation_policy_level_paging_strategy_configuration_repeats_mode, +) +from ..models.escalation_policy_level_paging_strategy_configuration_rotation_scope import ( + EscalationPolicyLevelPagingStrategyConfigurationRotationScope, + check_escalation_policy_level_paging_strategy_configuration_rotation_scope, +) from ..models.escalation_policy_level_paging_strategy_configuration_schedule_strategy import ( EscalationPolicyLevelPagingStrategyConfigurationScheduleStrategy, check_escalation_policy_level_paging_strategy_configuration_schedule_strategy, @@ -32,29 +38,49 @@ class EscalationPolicyLevel: escalation_policy_id (str): The ID of the escalation policy delay (int): Delay before notifying targets in the next Escalation Level. position (int): Position of the escalation policy level - notification_target_params (list[EscalationPolicyLevelNotificationTargetParamsItemType0 | None]): Escalation - level's notification targets - escalation_policy_path_id (None | str | Unset): The ID of the dynamic escalation policy path the level will + notification_target_params (list[Union['EscalationPolicyLevelNotificationTargetParamsItemType0', None]]): + Escalation level's notification targets + escalation_policy_path_id (Union[None, Unset, str]): The ID of the dynamic escalation policy path the level will belong to. If nothing is specified it will add the level to your default path. - paging_strategy_configuration_strategy (EscalationPolicyLevelPagingStrategyConfigurationStrategy | Unset): + paging_strategy_configuration_strategy (Union[Unset, EscalationPolicyLevelPagingStrategyConfigurationStrategy]): Default: 'default'. - paging_strategy_configuration_schedule_strategy - (EscalationPolicyLevelPagingStrategyConfigurationScheduleStrategy | Unset): Default: 'on_call_only'. - created_at (str | Unset): Date of creation - updated_at (str | Unset): Date of last update + paging_strategy_configuration_schedule_strategy (Union[Unset, + EscalationPolicyLevelPagingStrategyConfigurationScheduleStrategy]): Default: 'on_call_only'. + paging_strategy_configuration_repeats (Union[None, Unset, int]): Number of times to rotate through the roster + (cycle-based round robin). + paging_strategy_configuration_repeats_mode (Union[Unset, + EscalationPolicyLevelPagingStrategyConfigurationRepeatsMode]): Controls how repeats are interpreted: 'users' + pages exactly N users, 'all' pages everyone once. + paging_strategy_configuration_rotation_scope (Union[Unset, + EscalationPolicyLevelPagingStrategyConfigurationRotationScope]): Scope of rotation ordering: active rotation + members only, or entire schedule. + paging_strategy_configuration_page_users_count (Union[None, Unset, int]): Number of users to page at a time + (cycle-based round robin). + created_at (Union[Unset, str]): Date of creation + updated_at (Union[Unset, str]): Date of last update """ escalation_policy_id: str delay: int position: int - notification_target_params: list[EscalationPolicyLevelNotificationTargetParamsItemType0 | None] - escalation_policy_path_id: None | str | Unset = UNSET - paging_strategy_configuration_strategy: EscalationPolicyLevelPagingStrategyConfigurationStrategy | Unset = "default" - paging_strategy_configuration_schedule_strategy: ( - EscalationPolicyLevelPagingStrategyConfigurationScheduleStrategy | Unset - ) = "on_call_only" - created_at: str | Unset = UNSET - updated_at: str | Unset = UNSET + notification_target_params: list[Union["EscalationPolicyLevelNotificationTargetParamsItemType0", None]] + escalation_policy_path_id: Union[None, Unset, str] = UNSET + paging_strategy_configuration_strategy: Union[Unset, EscalationPolicyLevelPagingStrategyConfigurationStrategy] = ( + "default" + ) + paging_strategy_configuration_schedule_strategy: Union[ + Unset, EscalationPolicyLevelPagingStrategyConfigurationScheduleStrategy + ] = "on_call_only" + paging_strategy_configuration_repeats: Union[None, Unset, int] = UNSET + paging_strategy_configuration_repeats_mode: Union[ + Unset, EscalationPolicyLevelPagingStrategyConfigurationRepeatsMode + ] = UNSET + paging_strategy_configuration_rotation_scope: Union[ + Unset, EscalationPolicyLevelPagingStrategyConfigurationRotationScope + ] = UNSET + paging_strategy_configuration_page_users_count: Union[None, Unset, int] = UNSET + created_at: Union[Unset, str] = UNSET + updated_at: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -70,27 +96,47 @@ def to_dict(self) -> dict[str, Any]: notification_target_params = [] for notification_target_params_item_data in self.notification_target_params: - notification_target_params_item: dict[str, Any] | None + notification_target_params_item: Union[None, dict[str, Any]] if isinstance(notification_target_params_item_data, EscalationPolicyLevelNotificationTargetParamsItemType0): notification_target_params_item = notification_target_params_item_data.to_dict() else: notification_target_params_item = notification_target_params_item_data notification_target_params.append(notification_target_params_item) - escalation_policy_path_id: None | str | Unset + escalation_policy_path_id: Union[None, Unset, str] if isinstance(self.escalation_policy_path_id, Unset): escalation_policy_path_id = UNSET else: escalation_policy_path_id = self.escalation_policy_path_id - paging_strategy_configuration_strategy: str | Unset = UNSET + paging_strategy_configuration_strategy: Union[Unset, str] = UNSET if not isinstance(self.paging_strategy_configuration_strategy, Unset): paging_strategy_configuration_strategy = self.paging_strategy_configuration_strategy - paging_strategy_configuration_schedule_strategy: str | Unset = UNSET + paging_strategy_configuration_schedule_strategy: Union[Unset, str] = UNSET if not isinstance(self.paging_strategy_configuration_schedule_strategy, Unset): paging_strategy_configuration_schedule_strategy = self.paging_strategy_configuration_schedule_strategy + paging_strategy_configuration_repeats: Union[None, Unset, int] + if isinstance(self.paging_strategy_configuration_repeats, Unset): + paging_strategy_configuration_repeats = UNSET + else: + paging_strategy_configuration_repeats = self.paging_strategy_configuration_repeats + + paging_strategy_configuration_repeats_mode: Union[Unset, str] = UNSET + if not isinstance(self.paging_strategy_configuration_repeats_mode, Unset): + paging_strategy_configuration_repeats_mode = self.paging_strategy_configuration_repeats_mode + + paging_strategy_configuration_rotation_scope: Union[Unset, str] = UNSET + if not isinstance(self.paging_strategy_configuration_rotation_scope, Unset): + paging_strategy_configuration_rotation_scope = self.paging_strategy_configuration_rotation_scope + + paging_strategy_configuration_page_users_count: Union[None, Unset, int] + if isinstance(self.paging_strategy_configuration_page_users_count, Unset): + paging_strategy_configuration_page_users_count = UNSET + else: + paging_strategy_configuration_page_users_count = self.paging_strategy_configuration_page_users_count + created_at = self.created_at updated_at = self.updated_at @@ -113,6 +159,16 @@ def to_dict(self) -> dict[str, Any]: field_dict["paging_strategy_configuration_schedule_strategy"] = ( paging_strategy_configuration_schedule_strategy ) + if paging_strategy_configuration_repeats is not UNSET: + field_dict["paging_strategy_configuration_repeats"] = paging_strategy_configuration_repeats + if paging_strategy_configuration_repeats_mode is not UNSET: + field_dict["paging_strategy_configuration_repeats_mode"] = paging_strategy_configuration_repeats_mode + if paging_strategy_configuration_rotation_scope is not UNSET: + field_dict["paging_strategy_configuration_rotation_scope"] = paging_strategy_configuration_rotation_scope + if paging_strategy_configuration_page_users_count is not UNSET: + field_dict["paging_strategy_configuration_page_users_count"] = ( + paging_strategy_configuration_page_users_count + ) if created_at is not UNSET: field_dict["created_at"] = created_at if updated_at is not UNSET: @@ -139,7 +195,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: def _parse_notification_target_params_item( data: object, - ) -> EscalationPolicyLevelNotificationTargetParamsItemType0 | None: + ) -> Union["EscalationPolicyLevelNotificationTargetParamsItemType0", None]: if data is None: return data try: @@ -150,9 +206,9 @@ def _parse_notification_target_params_item( ) return notification_target_params_item_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(EscalationPolicyLevelNotificationTargetParamsItemType0 | None, data) + return cast(Union["EscalationPolicyLevelNotificationTargetParamsItemType0", None], data) notification_target_params_item = _parse_notification_target_params_item( notification_target_params_item_data @@ -160,17 +216,17 @@ def _parse_notification_target_params_item( notification_target_params.append(notification_target_params_item) - def _parse_escalation_policy_path_id(data: object) -> None | str | Unset: + def _parse_escalation_policy_path_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) escalation_policy_path_id = _parse_escalation_policy_path_id(d.pop("escalation_policy_path_id", UNSET)) _paging_strategy_configuration_strategy = d.pop("paging_strategy_configuration_strategy", UNSET) - paging_strategy_configuration_strategy: EscalationPolicyLevelPagingStrategyConfigurationStrategy | Unset + paging_strategy_configuration_strategy: Union[Unset, EscalationPolicyLevelPagingStrategyConfigurationStrategy] if isinstance(_paging_strategy_configuration_strategy, Unset): paging_strategy_configuration_strategy = UNSET else: @@ -183,9 +239,9 @@ def _parse_escalation_policy_path_id(data: object) -> None | str | Unset: _paging_strategy_configuration_schedule_strategy = d.pop( "paging_strategy_configuration_schedule_strategy", UNSET ) - paging_strategy_configuration_schedule_strategy: ( - EscalationPolicyLevelPagingStrategyConfigurationScheduleStrategy | Unset - ) + paging_strategy_configuration_schedule_strategy: Union[ + Unset, EscalationPolicyLevelPagingStrategyConfigurationScheduleStrategy + ] if isinstance(_paging_strategy_configuration_schedule_strategy, Unset): paging_strategy_configuration_schedule_strategy = UNSET else: @@ -195,6 +251,54 @@ def _parse_escalation_policy_path_id(data: object) -> None | str | Unset: ) ) + def _parse_paging_strategy_configuration_repeats(data: object) -> Union[None, Unset, int]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, int], data) + + paging_strategy_configuration_repeats = _parse_paging_strategy_configuration_repeats( + d.pop("paging_strategy_configuration_repeats", UNSET) + ) + + _paging_strategy_configuration_repeats_mode = d.pop("paging_strategy_configuration_repeats_mode", UNSET) + paging_strategy_configuration_repeats_mode: Union[ + Unset, EscalationPolicyLevelPagingStrategyConfigurationRepeatsMode + ] + if isinstance(_paging_strategy_configuration_repeats_mode, Unset): + paging_strategy_configuration_repeats_mode = UNSET + else: + paging_strategy_configuration_repeats_mode = ( + check_escalation_policy_level_paging_strategy_configuration_repeats_mode( + _paging_strategy_configuration_repeats_mode + ) + ) + + _paging_strategy_configuration_rotation_scope = d.pop("paging_strategy_configuration_rotation_scope", UNSET) + paging_strategy_configuration_rotation_scope: Union[ + Unset, EscalationPolicyLevelPagingStrategyConfigurationRotationScope + ] + if isinstance(_paging_strategy_configuration_rotation_scope, Unset): + paging_strategy_configuration_rotation_scope = UNSET + else: + paging_strategy_configuration_rotation_scope = ( + check_escalation_policy_level_paging_strategy_configuration_rotation_scope( + _paging_strategy_configuration_rotation_scope + ) + ) + + def _parse_paging_strategy_configuration_page_users_count(data: object) -> Union[None, Unset, int]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, int], data) + + paging_strategy_configuration_page_users_count = _parse_paging_strategy_configuration_page_users_count( + d.pop("paging_strategy_configuration_page_users_count", UNSET) + ) + created_at = d.pop("created_at", UNSET) updated_at = d.pop("updated_at", UNSET) @@ -207,6 +311,10 @@ def _parse_escalation_policy_path_id(data: object) -> None | str | Unset: escalation_policy_path_id=escalation_policy_path_id, paging_strategy_configuration_strategy=paging_strategy_configuration_strategy, paging_strategy_configuration_schedule_strategy=paging_strategy_configuration_schedule_strategy, + paging_strategy_configuration_repeats=paging_strategy_configuration_repeats, + paging_strategy_configuration_repeats_mode=paging_strategy_configuration_repeats_mode, + paging_strategy_configuration_rotation_scope=paging_strategy_configuration_rotation_scope, + paging_strategy_configuration_page_users_count=paging_strategy_configuration_page_users_count, created_at=created_at, updated_at=updated_at, ) diff --git a/rootly_sdk/models/escalation_policy_level_list.py b/rootly_sdk/models/escalation_policy_level_list.py index 98857100..df9ea619 100644 --- a/rootly_sdk/models/escalation_policy_level_list.py +++ b/rootly_sdk/models/escalation_policy_level_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,20 +20,19 @@ class EscalationPolicyLevelList: """ Attributes: - data (list[EscalationPolicyLevelListDataItem]): + data (list['EscalationPolicyLevelListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[EscalationPolicyLevelListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["EscalationPolicyLevelListDataItem"] + links: "Links" + meta: "Meta" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) escalation_policy_level_list = cls( data=data, diff --git a/rootly_sdk/models/escalation_policy_level_list_data_item.py b/rootly_sdk/models/escalation_policy_level_list_data_item.py index 5f8d975f..478e845f 100644 --- a/rootly_sdk/models/escalation_policy_level_list_data_item.py +++ b/rootly_sdk/models/escalation_policy_level_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -22,11 +20,10 @@ class EscalationPolicyLevelListDataItem: """ id: str - attributes: EscalationPolicyLevel + attributes: "EscalationPolicyLevel" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/escalation_policy_level_notification_target_params_item_type_0.py b/rootly_sdk/models/escalation_policy_level_notification_target_params_item_type_0.py index da88f065..93e7b5a0 100644 --- a/rootly_sdk/models/escalation_policy_level_notification_target_params_item_type_0.py +++ b/rootly_sdk/models/escalation_policy_level_notification_target_params_item_type_0.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -25,13 +23,13 @@ class EscalationPolicyLevelNotificationTargetParamsItemType0: Attributes: id (str): The ID of notification target type_ (EscalationPolicyLevelNotificationTargetParamsItemType0Type): The type of the notification target - team_members (EscalationPolicyLevelNotificationTargetParamsItemType0TeamMembers | Unset): For targets with + team_members (Union[Unset, EscalationPolicyLevelNotificationTargetParamsItemType0TeamMembers]): For targets with type=team, controls whether to notify admins, all team members, or escalate to team EP. """ id: str type_: EscalationPolicyLevelNotificationTargetParamsItemType0Type - team_members: EscalationPolicyLevelNotificationTargetParamsItemType0TeamMembers | Unset = UNSET + team_members: Union[Unset, EscalationPolicyLevelNotificationTargetParamsItemType0TeamMembers] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -39,7 +37,7 @@ def to_dict(self) -> dict[str, Any]: type_: str = self.type_ - team_members: str | Unset = UNSET + team_members: Union[Unset, str] = UNSET if not isinstance(self.team_members, Unset): team_members = self.team_members @@ -64,7 +62,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: type_ = check_escalation_policy_level_notification_target_params_item_type_0_type(d.pop("type")) _team_members = d.pop("team_members", UNSET) - team_members: EscalationPolicyLevelNotificationTargetParamsItemType0TeamMembers | Unset + team_members: Union[Unset, EscalationPolicyLevelNotificationTargetParamsItemType0TeamMembers] if isinstance(_team_members, Unset): team_members = UNSET else: diff --git a/rootly_sdk/models/escalation_policy_level_paging_strategy_configuration_repeats_mode.py b/rootly_sdk/models/escalation_policy_level_paging_strategy_configuration_repeats_mode.py new file mode 100644 index 00000000..a488a4c5 --- /dev/null +++ b/rootly_sdk/models/escalation_policy_level_paging_strategy_configuration_repeats_mode.py @@ -0,0 +1,22 @@ +from typing import Literal, cast + +EscalationPolicyLevelPagingStrategyConfigurationRepeatsMode = Literal["all", "users"] + +ESCALATION_POLICY_LEVEL_PAGING_STRATEGY_CONFIGURATION_REPEATS_MODE_VALUES: set[ + EscalationPolicyLevelPagingStrategyConfigurationRepeatsMode +] = { + "all", + "users", +} + + +def check_escalation_policy_level_paging_strategy_configuration_repeats_mode( + value: str | None, +) -> EscalationPolicyLevelPagingStrategyConfigurationRepeatsMode | None: + if value is None: + return None + if value in ESCALATION_POLICY_LEVEL_PAGING_STRATEGY_CONFIGURATION_REPEATS_MODE_VALUES: + return cast(EscalationPolicyLevelPagingStrategyConfigurationRepeatsMode, value) + raise TypeError( + f"Unexpected value {value!r}. Expected one of {ESCALATION_POLICY_LEVEL_PAGING_STRATEGY_CONFIGURATION_REPEATS_MODE_VALUES!r}" + ) diff --git a/rootly_sdk/models/escalation_policy_level_paging_strategy_configuration_rotation_scope.py b/rootly_sdk/models/escalation_policy_level_paging_strategy_configuration_rotation_scope.py new file mode 100644 index 00000000..bb018dc6 --- /dev/null +++ b/rootly_sdk/models/escalation_policy_level_paging_strategy_configuration_rotation_scope.py @@ -0,0 +1,22 @@ +from typing import Literal, cast + +EscalationPolicyLevelPagingStrategyConfigurationRotationScope = Literal["active_rotation", "entire_schedule"] + +ESCALATION_POLICY_LEVEL_PAGING_STRATEGY_CONFIGURATION_ROTATION_SCOPE_VALUES: set[ + EscalationPolicyLevelPagingStrategyConfigurationRotationScope +] = { + "active_rotation", + "entire_schedule", +} + + +def check_escalation_policy_level_paging_strategy_configuration_rotation_scope( + value: str | None, +) -> EscalationPolicyLevelPagingStrategyConfigurationRotationScope | None: + if value is None: + return None + if value in ESCALATION_POLICY_LEVEL_PAGING_STRATEGY_CONFIGURATION_ROTATION_SCOPE_VALUES: + return cast(EscalationPolicyLevelPagingStrategyConfigurationRotationScope, value) + raise TypeError( + f"Unexpected value {value!r}. Expected one of {ESCALATION_POLICY_LEVEL_PAGING_STRATEGY_CONFIGURATION_ROTATION_SCOPE_VALUES!r}" + ) diff --git a/rootly_sdk/models/escalation_policy_level_response.py b/rootly_sdk/models/escalation_policy_level_response.py index 262024a3..845a27b3 100644 --- a/rootly_sdk/models/escalation_policy_level_response.py +++ b/rootly_sdk/models/escalation_policy_level_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,18 +19,17 @@ class EscalationPolicyLevelResponse: """ Attributes: data (EscalationPolicyLevelResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: EscalationPolicyLevelResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "EscalationPolicyLevelResponseData" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = EscalationPolicyLevelResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) escalation_policy_level_response = cls( data=data, diff --git a/rootly_sdk/models/escalation_policy_level_response_data.py b/rootly_sdk/models/escalation_policy_level_response_data.py index 34e59feb..f952ff87 100644 --- a/rootly_sdk/models/escalation_policy_level_response_data.py +++ b/rootly_sdk/models/escalation_policy_level_response_data.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -25,21 +23,20 @@ class EscalationPolicyLevelResponseData: Attributes: id (str): Unique ID of the escalation policy level attributes (EscalationPolicyLevel): - type_ (EscalationPolicyLevelResponseDataType | Unset): + type_ (Union[Unset, EscalationPolicyLevelResponseDataType]): """ id: str - attributes: EscalationPolicyLevel - type_: EscalationPolicyLevelResponseDataType | Unset = UNSET + attributes: "EscalationPolicyLevel" + type_: Union[Unset, EscalationPolicyLevelResponseDataType] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id attributes = self.attributes.to_dict() - type_: str | Unset = UNSET + type_: Union[Unset, str] = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ @@ -66,7 +63,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = EscalationPolicyLevel.from_dict(d.pop("attributes")) _type_ = d.pop("type", UNSET) - type_: EscalationPolicyLevelResponseDataType | Unset + type_: Union[Unset, EscalationPolicyLevelResponseDataType] if isinstance(_type_, Unset): type_ = UNSET else: diff --git a/rootly_sdk/models/escalation_policy_list.py b/rootly_sdk/models/escalation_policy_list.py index 98fe7348..9dc1fac7 100644 --- a/rootly_sdk/models/escalation_policy_list.py +++ b/rootly_sdk/models/escalation_policy_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,20 +20,19 @@ class EscalationPolicyList: """ Attributes: - data (list[EscalationPolicyListDataItem]): + data (list['EscalationPolicyListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[EscalationPolicyListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["EscalationPolicyListDataItem"] + links: "Links" + meta: "Meta" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) escalation_policy_list = cls( data=data, diff --git a/rootly_sdk/models/escalation_policy_list_data_item.py b/rootly_sdk/models/escalation_policy_list_data_item.py index 36be2375..e9ef02d6 100644 --- a/rootly_sdk/models/escalation_policy_list_data_item.py +++ b/rootly_sdk/models/escalation_policy_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class EscalationPolicyListDataItem: id: str type_: EscalationPolicyListDataItemType - attributes: EscalationPolicy + attributes: "EscalationPolicy" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/escalation_policy_path.py b/rootly_sdk/models/escalation_policy_path.py index def4ef06..05626e4d 100644 --- a/rootly_sdk/models/escalation_policy_path.py +++ b/rootly_sdk/models/escalation_policy_path.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -63,81 +61,87 @@ class EscalationPolicyPath: default (bool): Whether this escalation path is the default path notification_type (str): Notification rule type escalation_policy_id (str): The ID of the escalation policy - repeat (bool | None): Whether this path should be repeated until someone acknowledges the alert - repeat_count (int | None): The number of times this path will be executed until someone acknowledges the alert - path_type (EscalationPolicyPathPathType | Unset): The type of escalation path - after_deferral_behavior (EscalationPolicyPathAfterDeferralBehavior | Unset): What happens after a deferral path - finishes - after_deferral_path_id (None | str | Unset): The escalation path to execute after this deferral path when + repeat (Union[None, bool]): Whether this path should be repeated until someone acknowledges the alert + repeat_count (Union[None, int]): The number of times this path will be executed until someone acknowledges the + alert + path_type (Union[Unset, EscalationPolicyPathPathType]): The type of escalation path + after_deferral_behavior (Union[Unset, EscalationPolicyPathAfterDeferralBehavior]): What happens after a deferral + path finishes + after_deferral_path_id (Union[None, Unset, str]): The escalation path to execute after this deferral path when after_deferral_behavior is execute_path - match_mode (EscalationPolicyPathMatchMode | Unset): How path rules are matched. - position (int | Unset): The position of this path in the paths for this EP. - initial_delay (int | Unset): Initial delay for escalation path in minutes. Maximum 1 week (10080). - created_at (str | Unset): Date of creation - updated_at (str | Unset): Date of last update - rules (list[EscalationPolicyPathRulesItemType0 | EscalationPolicyPathRulesItemType1 | - EscalationPolicyPathRulesItemType2 | EscalationPolicyPathRulesItemType3 | EscalationPolicyPathRulesItemType4 | - EscalationPolicyPathRulesItemType5 | EscalationPolicyPathRulesItemType6 | EscalationPolicyPathRulesItemType7 | - EscalationPolicyPathRulesItemType8Type0 | EscalationPolicyPathRulesItemType8Type1 | - EscalationPolicyPathRulesItemType8Type2 | EscalationPolicyPathRulesItemType8Type3 | - EscalationPolicyPathRulesItemType8Type4 | EscalationPolicyPathRulesItemType8Type5 | - EscalationPolicyPathRulesItemType8Type6 | EscalationPolicyPathRulesItemType8Type7 | - EscalationPolicyPathRulesItemType9Type0 | EscalationPolicyPathRulesItemType9Type1 | - EscalationPolicyPathRulesItemType9Type2 | EscalationPolicyPathRulesItemType9Type3 | - EscalationPolicyPathRulesItemType9Type4 | EscalationPolicyPathRulesItemType9Type5 | - EscalationPolicyPathRulesItemType9Type6 | EscalationPolicyPathRulesItemType9Type7] | Unset): Escalation path - rules - time_restriction_time_zone (EscalationPolicyPathTimeRestrictionTimeZone | Unset): Time zone used for time + match_mode (Union[Unset, EscalationPolicyPathMatchMode]): How path rules are matched. + position (Union[Unset, int]): The position of this path in the paths for this EP. + initial_delay (Union[Unset, int]): Initial delay for escalation path in minutes. Maximum 1 week (10080). + retrigger_timeout_minutes (Union[None, Unset, int]): Re-trigger acknowledged alerts on this path after N + minutes; null inherits the urgency/workspace default, negative = never. + created_at (Union[Unset, str]): Date of creation + updated_at (Union[Unset, str]): Date of last update + rules (Union[Unset, list[Union['EscalationPolicyPathRulesItemType0', 'EscalationPolicyPathRulesItemType1', + 'EscalationPolicyPathRulesItemType2', 'EscalationPolicyPathRulesItemType3', + 'EscalationPolicyPathRulesItemType4', 'EscalationPolicyPathRulesItemType5', + 'EscalationPolicyPathRulesItemType6', 'EscalationPolicyPathRulesItemType7', + 'EscalationPolicyPathRulesItemType8Type0', 'EscalationPolicyPathRulesItemType8Type1', + 'EscalationPolicyPathRulesItemType8Type2', 'EscalationPolicyPathRulesItemType8Type3', + 'EscalationPolicyPathRulesItemType8Type4', 'EscalationPolicyPathRulesItemType8Type5', + 'EscalationPolicyPathRulesItemType8Type6', 'EscalationPolicyPathRulesItemType8Type7', + 'EscalationPolicyPathRulesItemType9Type0', 'EscalationPolicyPathRulesItemType9Type1', + 'EscalationPolicyPathRulesItemType9Type2', 'EscalationPolicyPathRulesItemType9Type3', + 'EscalationPolicyPathRulesItemType9Type4', 'EscalationPolicyPathRulesItemType9Type5', + 'EscalationPolicyPathRulesItemType9Type6', 'EscalationPolicyPathRulesItemType9Type7']]]): Escalation path rules + time_restriction_time_zone (Union[Unset, EscalationPolicyPathTimeRestrictionTimeZone]): Time zone used for time restrictions. - time_restrictions (list[EscalationPolicyPathTimeRestrictionsItem] | Unset): If time restrictions are set, alerts - will follow this path when they arrive within the specified time ranges and meet the rules. + time_restrictions (Union[Unset, list['EscalationPolicyPathTimeRestrictionsItem']]): If time restrictions are + set, alerts will follow this path when they arrive within the specified time ranges and meet the rules. """ name: str default: bool notification_type: str escalation_policy_id: str - repeat: bool | None - repeat_count: int | None - path_type: EscalationPolicyPathPathType | Unset = UNSET - after_deferral_behavior: EscalationPolicyPathAfterDeferralBehavior | Unset = UNSET - after_deferral_path_id: None | str | Unset = UNSET - match_mode: EscalationPolicyPathMatchMode | Unset = UNSET - position: int | Unset = UNSET - initial_delay: int | Unset = UNSET - created_at: str | Unset = UNSET - updated_at: str | Unset = UNSET - rules: ( + repeat: Union[None, bool] + repeat_count: Union[None, int] + path_type: Union[Unset, EscalationPolicyPathPathType] = UNSET + after_deferral_behavior: Union[Unset, EscalationPolicyPathAfterDeferralBehavior] = UNSET + after_deferral_path_id: Union[None, Unset, str] = UNSET + match_mode: Union[Unset, EscalationPolicyPathMatchMode] = UNSET + position: Union[Unset, int] = UNSET + initial_delay: Union[Unset, int] = UNSET + retrigger_timeout_minutes: Union[None, Unset, int] = UNSET + created_at: Union[Unset, str] = UNSET + updated_at: Union[Unset, str] = UNSET + rules: Union[ + Unset, list[ - EscalationPolicyPathRulesItemType0 - | EscalationPolicyPathRulesItemType1 - | EscalationPolicyPathRulesItemType2 - | EscalationPolicyPathRulesItemType3 - | EscalationPolicyPathRulesItemType4 - | EscalationPolicyPathRulesItemType5 - | EscalationPolicyPathRulesItemType6 - | EscalationPolicyPathRulesItemType7 - | EscalationPolicyPathRulesItemType8Type0 - | EscalationPolicyPathRulesItemType8Type1 - | EscalationPolicyPathRulesItemType8Type2 - | EscalationPolicyPathRulesItemType8Type3 - | EscalationPolicyPathRulesItemType8Type4 - | EscalationPolicyPathRulesItemType8Type5 - | EscalationPolicyPathRulesItemType8Type6 - | EscalationPolicyPathRulesItemType8Type7 - | EscalationPolicyPathRulesItemType9Type0 - | EscalationPolicyPathRulesItemType9Type1 - | EscalationPolicyPathRulesItemType9Type2 - | EscalationPolicyPathRulesItemType9Type3 - | EscalationPolicyPathRulesItemType9Type4 - | EscalationPolicyPathRulesItemType9Type5 - | EscalationPolicyPathRulesItemType9Type6 - | EscalationPolicyPathRulesItemType9Type7 - ] - | Unset - ) = UNSET - time_restriction_time_zone: EscalationPolicyPathTimeRestrictionTimeZone | Unset = UNSET - time_restrictions: list[EscalationPolicyPathTimeRestrictionsItem] | Unset = UNSET + Union[ + "EscalationPolicyPathRulesItemType0", + "EscalationPolicyPathRulesItemType1", + "EscalationPolicyPathRulesItemType2", + "EscalationPolicyPathRulesItemType3", + "EscalationPolicyPathRulesItemType4", + "EscalationPolicyPathRulesItemType5", + "EscalationPolicyPathRulesItemType6", + "EscalationPolicyPathRulesItemType7", + "EscalationPolicyPathRulesItemType8Type0", + "EscalationPolicyPathRulesItemType8Type1", + "EscalationPolicyPathRulesItemType8Type2", + "EscalationPolicyPathRulesItemType8Type3", + "EscalationPolicyPathRulesItemType8Type4", + "EscalationPolicyPathRulesItemType8Type5", + "EscalationPolicyPathRulesItemType8Type6", + "EscalationPolicyPathRulesItemType8Type7", + "EscalationPolicyPathRulesItemType9Type0", + "EscalationPolicyPathRulesItemType9Type1", + "EscalationPolicyPathRulesItemType9Type2", + "EscalationPolicyPathRulesItemType9Type3", + "EscalationPolicyPathRulesItemType9Type4", + "EscalationPolicyPathRulesItemType9Type5", + "EscalationPolicyPathRulesItemType9Type6", + "EscalationPolicyPathRulesItemType9Type7", + ] + ], + ] = UNSET + time_restriction_time_zone: Union[Unset, EscalationPolicyPathTimeRestrictionTimeZone] = UNSET + time_restrictions: Union[Unset, list["EscalationPolicyPathTimeRestrictionsItem"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -173,27 +177,27 @@ def to_dict(self) -> dict[str, Any]: escalation_policy_id = self.escalation_policy_id - repeat: bool | None + repeat: Union[None, bool] repeat = self.repeat - repeat_count: int | None + repeat_count: Union[None, int] repeat_count = self.repeat_count - path_type: str | Unset = UNSET + path_type: Union[Unset, str] = UNSET if not isinstance(self.path_type, Unset): path_type = self.path_type - after_deferral_behavior: str | Unset = UNSET + after_deferral_behavior: Union[Unset, str] = UNSET if not isinstance(self.after_deferral_behavior, Unset): after_deferral_behavior = self.after_deferral_behavior - after_deferral_path_id: None | str | Unset + after_deferral_path_id: Union[None, Unset, str] if isinstance(self.after_deferral_path_id, Unset): after_deferral_path_id = UNSET else: after_deferral_path_id = self.after_deferral_path_id - match_mode: str | Unset = UNSET + match_mode: Union[Unset, str] = UNSET if not isinstance(self.match_mode, Unset): match_mode = self.match_mode @@ -201,11 +205,17 @@ def to_dict(self) -> dict[str, Any]: initial_delay = self.initial_delay + retrigger_timeout_minutes: Union[None, Unset, int] + if isinstance(self.retrigger_timeout_minutes, Unset): + retrigger_timeout_minutes = UNSET + else: + retrigger_timeout_minutes = self.retrigger_timeout_minutes + created_at = self.created_at updated_at = self.updated_at - rules: list[dict[str, Any]] | Unset = UNSET + rules: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.rules, Unset): rules = [] for rules_item_data in self.rules: @@ -261,11 +271,11 @@ def to_dict(self) -> dict[str, Any]: rules.append(rules_item) - time_restriction_time_zone: str | Unset = UNSET + time_restriction_time_zone: Union[Unset, str] = UNSET if not isinstance(self.time_restriction_time_zone, Unset): time_restriction_time_zone = self.time_restriction_time_zone - time_restrictions: list[dict[str, Any]] | Unset = UNSET + time_restrictions: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.time_restrictions, Unset): time_restrictions = [] for time_restrictions_item_data in self.time_restrictions: @@ -296,6 +306,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["position"] = position if initial_delay is not UNSET: field_dict["initial_delay"] = initial_delay + if retrigger_timeout_minutes is not UNSET: + field_dict["retrigger_timeout_minutes"] = retrigger_timeout_minutes if created_at is not UNSET: field_dict["created_at"] = created_at if updated_at is not UNSET: @@ -346,45 +358,45 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: escalation_policy_id = d.pop("escalation_policy_id") - def _parse_repeat(data: object) -> bool | None: + def _parse_repeat(data: object) -> Union[None, bool]: if data is None: return data - return cast(bool | None, data) + return cast(Union[None, bool], data) repeat = _parse_repeat(d.pop("repeat")) - def _parse_repeat_count(data: object) -> int | None: + def _parse_repeat_count(data: object) -> Union[None, int]: if data is None: return data - return cast(int | None, data) + return cast(Union[None, int], data) repeat_count = _parse_repeat_count(d.pop("repeat_count")) _path_type = d.pop("path_type", UNSET) - path_type: EscalationPolicyPathPathType | Unset + path_type: Union[Unset, EscalationPolicyPathPathType] if isinstance(_path_type, Unset): path_type = UNSET else: path_type = check_escalation_policy_path_path_type(_path_type) _after_deferral_behavior = d.pop("after_deferral_behavior", UNSET) - after_deferral_behavior: EscalationPolicyPathAfterDeferralBehavior | Unset + after_deferral_behavior: Union[Unset, EscalationPolicyPathAfterDeferralBehavior] if isinstance(_after_deferral_behavior, Unset): after_deferral_behavior = UNSET else: after_deferral_behavior = check_escalation_policy_path_after_deferral_behavior(_after_deferral_behavior) - def _parse_after_deferral_path_id(data: object) -> None | str | Unset: + def _parse_after_deferral_path_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) after_deferral_path_id = _parse_after_deferral_path_id(d.pop("after_deferral_path_id", UNSET)) _match_mode = d.pop("match_mode", UNSET) - match_mode: EscalationPolicyPathMatchMode | Unset + match_mode: Union[Unset, EscalationPolicyPathMatchMode] if isinstance(_match_mode, Unset): match_mode = UNSET else: @@ -394,268 +406,247 @@ def _parse_after_deferral_path_id(data: object) -> None | str | Unset: initial_delay = d.pop("initial_delay", UNSET) + def _parse_retrigger_timeout_minutes(data: object) -> Union[None, Unset, int]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, int], data) + + retrigger_timeout_minutes = _parse_retrigger_timeout_minutes(d.pop("retrigger_timeout_minutes", UNSET)) + created_at = d.pop("created_at", UNSET) updated_at = d.pop("updated_at", UNSET) + rules = [] _rules = d.pop("rules", UNSET) - rules: ( - list[ - EscalationPolicyPathRulesItemType0 - | EscalationPolicyPathRulesItemType1 - | EscalationPolicyPathRulesItemType2 - | EscalationPolicyPathRulesItemType3 - | EscalationPolicyPathRulesItemType4 - | EscalationPolicyPathRulesItemType5 - | EscalationPolicyPathRulesItemType6 - | EscalationPolicyPathRulesItemType7 - | EscalationPolicyPathRulesItemType8Type0 - | EscalationPolicyPathRulesItemType8Type1 - | EscalationPolicyPathRulesItemType8Type2 - | EscalationPolicyPathRulesItemType8Type3 - | EscalationPolicyPathRulesItemType8Type4 - | EscalationPolicyPathRulesItemType8Type5 - | EscalationPolicyPathRulesItemType8Type6 - | EscalationPolicyPathRulesItemType8Type7 - | EscalationPolicyPathRulesItemType9Type0 - | EscalationPolicyPathRulesItemType9Type1 - | EscalationPolicyPathRulesItemType9Type2 - | EscalationPolicyPathRulesItemType9Type3 - | EscalationPolicyPathRulesItemType9Type4 - | EscalationPolicyPathRulesItemType9Type5 - | EscalationPolicyPathRulesItemType9Type6 - | EscalationPolicyPathRulesItemType9Type7 - ] - | Unset - ) = UNSET - if _rules is not UNSET: - rules = [] - for rules_item_data in _rules: - - def _parse_rules_item( - data: object, - ) -> ( - EscalationPolicyPathRulesItemType0 - | EscalationPolicyPathRulesItemType1 - | EscalationPolicyPathRulesItemType2 - | EscalationPolicyPathRulesItemType3 - | EscalationPolicyPathRulesItemType4 - | EscalationPolicyPathRulesItemType5 - | EscalationPolicyPathRulesItemType6 - | EscalationPolicyPathRulesItemType7 - | EscalationPolicyPathRulesItemType8Type0 - | EscalationPolicyPathRulesItemType8Type1 - | EscalationPolicyPathRulesItemType8Type2 - | EscalationPolicyPathRulesItemType8Type3 - | EscalationPolicyPathRulesItemType8Type4 - | EscalationPolicyPathRulesItemType8Type5 - | EscalationPolicyPathRulesItemType8Type6 - | EscalationPolicyPathRulesItemType8Type7 - | EscalationPolicyPathRulesItemType9Type0 - | EscalationPolicyPathRulesItemType9Type1 - | EscalationPolicyPathRulesItemType9Type2 - | EscalationPolicyPathRulesItemType9Type3 - | EscalationPolicyPathRulesItemType9Type4 - | EscalationPolicyPathRulesItemType9Type5 - | EscalationPolicyPathRulesItemType9Type6 - | EscalationPolicyPathRulesItemType9Type7 - ): - try: - if not isinstance(data, dict): - raise TypeError() - rules_item_type_0 = EscalationPolicyPathRulesItemType0.from_dict(data) - - return rules_item_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - rules_item_type_1 = EscalationPolicyPathRulesItemType1.from_dict(data) - - return rules_item_type_1 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - rules_item_type_2 = EscalationPolicyPathRulesItemType2.from_dict(data) - - return rules_item_type_2 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - rules_item_type_3 = EscalationPolicyPathRulesItemType3.from_dict(data) - - return rules_item_type_3 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - rules_item_type_4 = EscalationPolicyPathRulesItemType4.from_dict(data) - - return rules_item_type_4 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - rules_item_type_5 = EscalationPolicyPathRulesItemType5.from_dict(data) - - return rules_item_type_5 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - rules_item_type_6 = EscalationPolicyPathRulesItemType6.from_dict(data) - - return rules_item_type_6 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - rules_item_type_7 = EscalationPolicyPathRulesItemType7.from_dict(data) - - return rules_item_type_7 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - rules_item_type_8_type_0 = EscalationPolicyPathRulesItemType8Type0.from_dict(data) - - return rules_item_type_8_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - rules_item_type_8_type_1 = EscalationPolicyPathRulesItemType8Type1.from_dict(data) - - return rules_item_type_8_type_1 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - rules_item_type_8_type_2 = EscalationPolicyPathRulesItemType8Type2.from_dict(data) - - return rules_item_type_8_type_2 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - rules_item_type_8_type_3 = EscalationPolicyPathRulesItemType8Type3.from_dict(data) - - return rules_item_type_8_type_3 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - rules_item_type_8_type_4 = EscalationPolicyPathRulesItemType8Type4.from_dict(data) - - return rules_item_type_8_type_4 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - rules_item_type_8_type_5 = EscalationPolicyPathRulesItemType8Type5.from_dict(data) - - return rules_item_type_8_type_5 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - rules_item_type_8_type_6 = EscalationPolicyPathRulesItemType8Type6.from_dict(data) - - return rules_item_type_8_type_6 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - rules_item_type_8_type_7 = EscalationPolicyPathRulesItemType8Type7.from_dict(data) - - return rules_item_type_8_type_7 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - rules_item_type_9_type_0 = EscalationPolicyPathRulesItemType9Type0.from_dict(data) - - return rules_item_type_9_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - rules_item_type_9_type_1 = EscalationPolicyPathRulesItemType9Type1.from_dict(data) - - return rules_item_type_9_type_1 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - rules_item_type_9_type_2 = EscalationPolicyPathRulesItemType9Type2.from_dict(data) - - return rules_item_type_9_type_2 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - rules_item_type_9_type_3 = EscalationPolicyPathRulesItemType9Type3.from_dict(data) - - return rules_item_type_9_type_3 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - rules_item_type_9_type_4 = EscalationPolicyPathRulesItemType9Type4.from_dict(data) - - return rules_item_type_9_type_4 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - rules_item_type_9_type_5 = EscalationPolicyPathRulesItemType9Type5.from_dict(data) - - return rules_item_type_9_type_5 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - rules_item_type_9_type_6 = EscalationPolicyPathRulesItemType9Type6.from_dict(data) - - return rules_item_type_9_type_6 - except (TypeError, ValueError, AttributeError, KeyError): - pass + for rules_item_data in _rules or []: + + def _parse_rules_item( + data: object, + ) -> Union[ + "EscalationPolicyPathRulesItemType0", + "EscalationPolicyPathRulesItemType1", + "EscalationPolicyPathRulesItemType2", + "EscalationPolicyPathRulesItemType3", + "EscalationPolicyPathRulesItemType4", + "EscalationPolicyPathRulesItemType5", + "EscalationPolicyPathRulesItemType6", + "EscalationPolicyPathRulesItemType7", + "EscalationPolicyPathRulesItemType8Type0", + "EscalationPolicyPathRulesItemType8Type1", + "EscalationPolicyPathRulesItemType8Type2", + "EscalationPolicyPathRulesItemType8Type3", + "EscalationPolicyPathRulesItemType8Type4", + "EscalationPolicyPathRulesItemType8Type5", + "EscalationPolicyPathRulesItemType8Type6", + "EscalationPolicyPathRulesItemType8Type7", + "EscalationPolicyPathRulesItemType9Type0", + "EscalationPolicyPathRulesItemType9Type1", + "EscalationPolicyPathRulesItemType9Type2", + "EscalationPolicyPathRulesItemType9Type3", + "EscalationPolicyPathRulesItemType9Type4", + "EscalationPolicyPathRulesItemType9Type5", + "EscalationPolicyPathRulesItemType9Type6", + "EscalationPolicyPathRulesItemType9Type7", + ]: + try: if not isinstance(data, dict): raise TypeError() - rules_item_type_9_type_7 = EscalationPolicyPathRulesItemType9Type7.from_dict(data) + rules_item_type_0 = EscalationPolicyPathRulesItemType0.from_dict(data) - return rules_item_type_9_type_7 + return rules_item_type_0 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + rules_item_type_1 = EscalationPolicyPathRulesItemType1.from_dict(data) + + return rules_item_type_1 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + rules_item_type_2 = EscalationPolicyPathRulesItemType2.from_dict(data) - rules_item = _parse_rules_item(rules_item_data) + return rules_item_type_2 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + rules_item_type_3 = EscalationPolicyPathRulesItemType3.from_dict(data) - rules.append(rules_item) + return rules_item_type_3 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + rules_item_type_4 = EscalationPolicyPathRulesItemType4.from_dict(data) + + return rules_item_type_4 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + rules_item_type_5 = EscalationPolicyPathRulesItemType5.from_dict(data) + + return rules_item_type_5 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + rules_item_type_6 = EscalationPolicyPathRulesItemType6.from_dict(data) + + return rules_item_type_6 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + rules_item_type_7 = EscalationPolicyPathRulesItemType7.from_dict(data) + + return rules_item_type_7 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + rules_item_type_8_type_0 = EscalationPolicyPathRulesItemType8Type0.from_dict(data) + + return rules_item_type_8_type_0 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + rules_item_type_8_type_1 = EscalationPolicyPathRulesItemType8Type1.from_dict(data) + + return rules_item_type_8_type_1 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + rules_item_type_8_type_2 = EscalationPolicyPathRulesItemType8Type2.from_dict(data) + + return rules_item_type_8_type_2 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + rules_item_type_8_type_3 = EscalationPolicyPathRulesItemType8Type3.from_dict(data) + + return rules_item_type_8_type_3 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + rules_item_type_8_type_4 = EscalationPolicyPathRulesItemType8Type4.from_dict(data) + + return rules_item_type_8_type_4 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + rules_item_type_8_type_5 = EscalationPolicyPathRulesItemType8Type5.from_dict(data) + + return rules_item_type_8_type_5 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + rules_item_type_8_type_6 = EscalationPolicyPathRulesItemType8Type6.from_dict(data) + + return rules_item_type_8_type_6 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + rules_item_type_8_type_7 = EscalationPolicyPathRulesItemType8Type7.from_dict(data) + + return rules_item_type_8_type_7 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + rules_item_type_9_type_0 = EscalationPolicyPathRulesItemType9Type0.from_dict(data) + + return rules_item_type_9_type_0 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + rules_item_type_9_type_1 = EscalationPolicyPathRulesItemType9Type1.from_dict(data) + + return rules_item_type_9_type_1 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + rules_item_type_9_type_2 = EscalationPolicyPathRulesItemType9Type2.from_dict(data) + + return rules_item_type_9_type_2 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + rules_item_type_9_type_3 = EscalationPolicyPathRulesItemType9Type3.from_dict(data) + + return rules_item_type_9_type_3 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + rules_item_type_9_type_4 = EscalationPolicyPathRulesItemType9Type4.from_dict(data) + + return rules_item_type_9_type_4 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + rules_item_type_9_type_5 = EscalationPolicyPathRulesItemType9Type5.from_dict(data) + + return rules_item_type_9_type_5 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + rules_item_type_9_type_6 = EscalationPolicyPathRulesItemType9Type6.from_dict(data) + + return rules_item_type_9_type_6 + except: # noqa: E722 + pass + if not isinstance(data, dict): + raise TypeError() + rules_item_type_9_type_7 = EscalationPolicyPathRulesItemType9Type7.from_dict(data) + + return rules_item_type_9_type_7 + + rules_item = _parse_rules_item(rules_item_data) + + rules.append(rules_item) _time_restriction_time_zone = d.pop("time_restriction_time_zone", UNSET) - time_restriction_time_zone: EscalationPolicyPathTimeRestrictionTimeZone | Unset + time_restriction_time_zone: Union[Unset, EscalationPolicyPathTimeRestrictionTimeZone] if isinstance(_time_restriction_time_zone, Unset): time_restriction_time_zone = UNSET else: @@ -663,14 +654,12 @@ def _parse_rules_item( _time_restriction_time_zone ) + time_restrictions = [] _time_restrictions = d.pop("time_restrictions", UNSET) - time_restrictions: list[EscalationPolicyPathTimeRestrictionsItem] | Unset = UNSET - if _time_restrictions is not UNSET: - time_restrictions = [] - for time_restrictions_item_data in _time_restrictions: - time_restrictions_item = EscalationPolicyPathTimeRestrictionsItem.from_dict(time_restrictions_item_data) + for time_restrictions_item_data in _time_restrictions or []: + time_restrictions_item = EscalationPolicyPathTimeRestrictionsItem.from_dict(time_restrictions_item_data) - time_restrictions.append(time_restrictions_item) + time_restrictions.append(time_restrictions_item) escalation_policy_path = cls( name=name, @@ -685,6 +674,7 @@ def _parse_rules_item( match_mode=match_mode, position=position, initial_delay=initial_delay, + retrigger_timeout_minutes=retrigger_timeout_minutes, created_at=created_at, updated_at=updated_at, rules=rules, diff --git a/rootly_sdk/models/escalation_policy_path_list.py b/rootly_sdk/models/escalation_policy_path_list.py index 3c07f135..d54509fd 100644 --- a/rootly_sdk/models/escalation_policy_path_list.py +++ b/rootly_sdk/models/escalation_policy_path_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,20 +20,19 @@ class EscalationPolicyPathList: """ Attributes: - data (list[EscalationPolicyPathListDataItem]): + data (list['EscalationPolicyPathListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[EscalationPolicyPathListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["EscalationPolicyPathListDataItem"] + links: "Links" + meta: "Meta" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) escalation_policy_path_list = cls( data=data, diff --git a/rootly_sdk/models/escalation_policy_path_list_data_item.py b/rootly_sdk/models/escalation_policy_path_list_data_item.py index bcb35aac..5807ada6 100644 --- a/rootly_sdk/models/escalation_policy_path_list_data_item.py +++ b/rootly_sdk/models/escalation_policy_path_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -22,11 +20,10 @@ class EscalationPolicyPathListDataItem: """ id: str - attributes: EscalationPolicyPath + attributes: "EscalationPolicyPath" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/escalation_policy_path_response.py b/rootly_sdk/models/escalation_policy_path_response.py index 0983a792..faaab210 100644 --- a/rootly_sdk/models/escalation_policy_path_response.py +++ b/rootly_sdk/models/escalation_policy_path_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,18 +19,17 @@ class EscalationPolicyPathResponse: """ Attributes: data (EscalationPolicyPathResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: EscalationPolicyPathResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "EscalationPolicyPathResponseData" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = EscalationPolicyPathResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) escalation_policy_path_response = cls( data=data, diff --git a/rootly_sdk/models/escalation_policy_path_response_data.py b/rootly_sdk/models/escalation_policy_path_response_data.py index 0b318cc3..1417198b 100644 --- a/rootly_sdk/models/escalation_policy_path_response_data.py +++ b/rootly_sdk/models/escalation_policy_path_response_data.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -25,21 +23,20 @@ class EscalationPolicyPathResponseData: Attributes: id (str): Unique ID of the escalation policy path attributes (EscalationPolicyPath): - type_ (EscalationPolicyPathResponseDataType | Unset): + type_ (Union[Unset, EscalationPolicyPathResponseDataType]): """ id: str - attributes: EscalationPolicyPath - type_: EscalationPolicyPathResponseDataType | Unset = UNSET + attributes: "EscalationPolicyPath" + type_: Union[Unset, EscalationPolicyPathResponseDataType] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id attributes = self.attributes.to_dict() - type_: str | Unset = UNSET + type_: Union[Unset, str] = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ @@ -66,7 +63,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = EscalationPolicyPath.from_dict(d.pop("attributes")) _type_ = d.pop("type", UNSET) - type_: EscalationPolicyPathResponseDataType | Unset + type_: Union[Unset, EscalationPolicyPathResponseDataType] if isinstance(_type_, Unset): type_ = UNSET else: diff --git a/rootly_sdk/models/escalation_policy_path_rules_item_type_0.py b/rootly_sdk/models/escalation_policy_path_rules_item_type_0.py index f01cb69c..7ed1d883 100644 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_0.py +++ b/rootly_sdk/models/escalation_policy_path_rules_item_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast diff --git a/rootly_sdk/models/escalation_policy_path_rules_item_type_1.py b/rootly_sdk/models/escalation_policy_path_rules_item_type_1.py index cebe2ca3..a9321684 100644 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_1.py +++ b/rootly_sdk/models/escalation_policy_path_rules_item_type_1.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/escalation_policy_path_rules_item_type_2.py b/rootly_sdk/models/escalation_policy_path_rules_item_type_2.py index 6c37de59..341a688b 100644 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_2.py +++ b/rootly_sdk/models/escalation_policy_path_rules_item_type_2.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -26,15 +24,15 @@ class EscalationPolicyPathRulesItemType2: rule_type (EscalationPolicyPathRulesItemType2RuleType): The type of the escalation path rule json_path (str): JSON path to extract value from payload operator (EscalationPolicyPathRulesItemType2Operator): How JSON path value should be matched - value (None | str | Unset): Value with which JSON path value should be matched - values (list[str] | Unset): Values to match against (for is_one_of / is_not_one_of operators) + value (Union[None, Unset, str]): Value with which JSON path value should be matched + values (Union[Unset, list[str]]): Values to match against (for is_one_of / is_not_one_of operators) """ rule_type: EscalationPolicyPathRulesItemType2RuleType json_path: str operator: EscalationPolicyPathRulesItemType2Operator - value: None | str | Unset = UNSET - values: list[str] | Unset = UNSET + value: Union[None, Unset, str] = UNSET + values: Union[Unset, list[str]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -44,13 +42,13 @@ def to_dict(self) -> dict[str, Any]: operator: str = self.operator - value: None | str | Unset + value: Union[None, Unset, str] if isinstance(self.value, Unset): value = UNSET else: value = self.value - values: list[str] | Unset = UNSET + values: Union[Unset, list[str]] = UNSET if not isinstance(self.values, Unset): values = self.values @@ -79,12 +77,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: operator = check_escalation_policy_path_rules_item_type_2_operator(d.pop("operator")) - def _parse_value(data: object) -> None | str | Unset: + def _parse_value(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) value = _parse_value(d.pop("value", UNSET)) diff --git a/rootly_sdk/models/escalation_policy_path_rules_item_type_3.py b/rootly_sdk/models/escalation_policy_path_rules_item_type_3.py index 7696e1e7..2774cb75 100644 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_3.py +++ b/rootly_sdk/models/escalation_policy_path_rules_item_type_3.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -27,14 +25,14 @@ class EscalationPolicyPathRulesItemType3: fieldable_type (str): The type of the fieldable (e.g., AlertField) fieldable_id (str): The ID of the alert field operator (EscalationPolicyPathRulesItemType3Operator): How the alert field value should be matched - values (list[str] | Unset): Values to match against + values (Union[Unset, list[str]]): Values to match against """ rule_type: EscalationPolicyPathRulesItemType3RuleType fieldable_type: str fieldable_id: str operator: EscalationPolicyPathRulesItemType3Operator - values: list[str] | Unset = UNSET + values: Union[Unset, list[str]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -46,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: operator: str = self.operator - values: list[str] | Unset = UNSET + values: Union[Unset, list[str]] = UNSET if not isinstance(self.values, Unset): values = self.values diff --git a/rootly_sdk/models/escalation_policy_path_rules_item_type_4.py b/rootly_sdk/models/escalation_policy_path_rules_item_type_4.py index 0b343c49..823b3a31 100644 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_4.py +++ b/rootly_sdk/models/escalation_policy_path_rules_item_type_4.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast diff --git a/rootly_sdk/models/escalation_policy_path_rules_item_type_5.py b/rootly_sdk/models/escalation_policy_path_rules_item_type_5.py index e0cca146..c03dd7a2 100644 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_5.py +++ b/rootly_sdk/models/escalation_policy_path_rules_item_type_5.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -30,17 +28,16 @@ class EscalationPolicyPathRulesItemType5: Attributes: rule_type (EscalationPolicyPathRulesItemType5RuleType): The type of the escalation path rule time_zone (EscalationPolicyPathRulesItemType5TimeZone): Time zone for the deferral window - time_blocks (list[EscalationPolicyPathRulesItemType5TimeBlocksItem]): Time windows during which alerts are + time_blocks (list['EscalationPolicyPathRulesItemType5TimeBlocksItem']): Time windows during which alerts are deferred """ rule_type: EscalationPolicyPathRulesItemType5RuleType time_zone: EscalationPolicyPathRulesItemType5TimeZone - time_blocks: list[EscalationPolicyPathRulesItemType5TimeBlocksItem] + time_blocks: list["EscalationPolicyPathRulesItemType5TimeBlocksItem"] additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - rule_type: str = self.rule_type time_zone: str = self.time_zone diff --git a/rootly_sdk/models/escalation_policy_path_rules_item_type_5_time_blocks_item.py b/rootly_sdk/models/escalation_policy_path_rules_item_type_5_time_blocks_item.py index 2c596cc9..8a295592 100644 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_5_time_blocks_item.py +++ b/rootly_sdk/models/escalation_policy_path_rules_item_type_5_time_blocks_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,30 +13,30 @@ class EscalationPolicyPathRulesItemType5TimeBlocksItem: """ Attributes: - monday (bool | Unset): Default: False. - tuesday (bool | Unset): Default: False. - wednesday (bool | Unset): Default: False. - thursday (bool | Unset): Default: False. - friday (bool | Unset): Default: False. - saturday (bool | Unset): Default: False. - sunday (bool | Unset): Default: False. - start_time (str | Unset): Formatted as HH:MM - end_time (str | Unset): Formatted as HH:MM - all_day (bool | Unset): Default: False. - position (int | None | Unset): + monday (Union[Unset, bool]): Default: False. + tuesday (Union[Unset, bool]): Default: False. + wednesday (Union[Unset, bool]): Default: False. + thursday (Union[Unset, bool]): Default: False. + friday (Union[Unset, bool]): Default: False. + saturday (Union[Unset, bool]): Default: False. + sunday (Union[Unset, bool]): Default: False. + start_time (Union[Unset, str]): Formatted as HH:MM + end_time (Union[Unset, str]): Formatted as HH:MM + all_day (Union[Unset, bool]): Default: False. + position (Union[None, Unset, int]): """ - monday: bool | Unset = False - tuesday: bool | Unset = False - wednesday: bool | Unset = False - thursday: bool | Unset = False - friday: bool | Unset = False - saturday: bool | Unset = False - sunday: bool | Unset = False - start_time: str | Unset = UNSET - end_time: str | Unset = UNSET - all_day: bool | Unset = False - position: int | None | Unset = UNSET + monday: Union[Unset, bool] = False + tuesday: Union[Unset, bool] = False + wednesday: Union[Unset, bool] = False + thursday: Union[Unset, bool] = False + friday: Union[Unset, bool] = False + saturday: Union[Unset, bool] = False + sunday: Union[Unset, bool] = False + start_time: Union[Unset, str] = UNSET + end_time: Union[Unset, str] = UNSET + all_day: Union[Unset, bool] = False + position: Union[None, Unset, int] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -62,7 +60,7 @@ def to_dict(self) -> dict[str, Any]: all_day = self.all_day - position: int | None | Unset + position: Union[None, Unset, int] if isinstance(self.position, Unset): position = UNSET else: @@ -119,12 +117,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: all_day = d.pop("all_day", UNSET) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> Union[None, Unset, int]: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(Union[None, Unset, int], data) position = _parse_position(d.pop("position", UNSET)) diff --git a/rootly_sdk/models/escalation_policy_path_rules_item_type_6.py b/rootly_sdk/models/escalation_policy_path_rules_item_type_6.py index 5b56175d..35414457 100644 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_6.py +++ b/rootly_sdk/models/escalation_policy_path_rules_item_type_6.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast diff --git a/rootly_sdk/models/escalation_policy_path_rules_item_type_7.py b/rootly_sdk/models/escalation_policy_path_rules_item_type_7.py index 76be2bb0..6f9b7ce2 100644 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_7.py +++ b/rootly_sdk/models/escalation_policy_path_rules_item_type_7.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_0.py b/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_0.py index cac3b5ab..89172353 100644 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_0.py +++ b/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast diff --git a/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_1.py b/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_1.py index c58ca2b9..74b34e0a 100644 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_1.py +++ b/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_1.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_2.py b/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_2.py index 1f0b82f7..34fc5c39 100644 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_2.py +++ b/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_2.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -26,15 +24,15 @@ class EscalationPolicyPathRulesItemType8Type2: rule_type (EscalationPolicyPathRulesItemType8Type2RuleType): The type of the escalation path rule json_path (str): JSON path to extract value from payload operator (EscalationPolicyPathRulesItemType8Type2Operator): How JSON path value should be matched - value (None | str | Unset): Value with which JSON path value should be matched - values (list[str] | Unset): Values to match against (for is_one_of / is_not_one_of operators) + value (Union[None, Unset, str]): Value with which JSON path value should be matched + values (Union[Unset, list[str]]): Values to match against (for is_one_of / is_not_one_of operators) """ rule_type: EscalationPolicyPathRulesItemType8Type2RuleType json_path: str operator: EscalationPolicyPathRulesItemType8Type2Operator - value: None | str | Unset = UNSET - values: list[str] | Unset = UNSET + value: Union[None, Unset, str] = UNSET + values: Union[Unset, list[str]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -44,13 +42,13 @@ def to_dict(self) -> dict[str, Any]: operator: str = self.operator - value: None | str | Unset + value: Union[None, Unset, str] if isinstance(self.value, Unset): value = UNSET else: value = self.value - values: list[str] | Unset = UNSET + values: Union[Unset, list[str]] = UNSET if not isinstance(self.values, Unset): values = self.values @@ -79,12 +77,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: operator = check_escalation_policy_path_rules_item_type_8_type_2_operator(d.pop("operator")) - def _parse_value(data: object) -> None | str | Unset: + def _parse_value(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) value = _parse_value(d.pop("value", UNSET)) diff --git a/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_3.py b/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_3.py index 2081dba4..6641c227 100644 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_3.py +++ b/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_3.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -27,14 +25,14 @@ class EscalationPolicyPathRulesItemType8Type3: fieldable_type (str): The type of the fieldable (e.g., AlertField) fieldable_id (str): The ID of the alert field operator (EscalationPolicyPathRulesItemType8Type3Operator): How the alert field value should be matched - values (list[str] | Unset): Values to match against + values (Union[Unset, list[str]]): Values to match against """ rule_type: EscalationPolicyPathRulesItemType8Type3RuleType fieldable_type: str fieldable_id: str operator: EscalationPolicyPathRulesItemType8Type3Operator - values: list[str] | Unset = UNSET + values: Union[Unset, list[str]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -46,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: operator: str = self.operator - values: list[str] | Unset = UNSET + values: Union[Unset, list[str]] = UNSET if not isinstance(self.values, Unset): values = self.values diff --git a/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_4.py b/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_4.py index ffbf6f87..8821029c 100644 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_4.py +++ b/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_4.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast diff --git a/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_5.py b/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_5.py index 1143016f..01145569 100644 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_5.py +++ b/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_5.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -30,17 +28,16 @@ class EscalationPolicyPathRulesItemType8Type5: Attributes: rule_type (EscalationPolicyPathRulesItemType8Type5RuleType): The type of the escalation path rule time_zone (EscalationPolicyPathRulesItemType8Type5TimeZone): Time zone for the deferral window - time_blocks (list[EscalationPolicyPathRulesItemType8Type5TimeBlocksItem]): Time windows during which alerts are - deferred + time_blocks (list['EscalationPolicyPathRulesItemType8Type5TimeBlocksItem']): Time windows during which alerts + are deferred """ rule_type: EscalationPolicyPathRulesItemType8Type5RuleType time_zone: EscalationPolicyPathRulesItemType8Type5TimeZone - time_blocks: list[EscalationPolicyPathRulesItemType8Type5TimeBlocksItem] + time_blocks: list["EscalationPolicyPathRulesItemType8Type5TimeBlocksItem"] additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - rule_type: str = self.rule_type time_zone: str = self.time_zone diff --git a/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_5_time_blocks_item.py b/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_5_time_blocks_item.py index 78acd66d..71fc93b1 100644 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_5_time_blocks_item.py +++ b/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_5_time_blocks_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,30 +13,30 @@ class EscalationPolicyPathRulesItemType8Type5TimeBlocksItem: """ Attributes: - monday (bool | Unset): Default: False. - tuesday (bool | Unset): Default: False. - wednesday (bool | Unset): Default: False. - thursday (bool | Unset): Default: False. - friday (bool | Unset): Default: False. - saturday (bool | Unset): Default: False. - sunday (bool | Unset): Default: False. - start_time (str | Unset): Formatted as HH:MM - end_time (str | Unset): Formatted as HH:MM - all_day (bool | Unset): Default: False. - position (int | None | Unset): + monday (Union[Unset, bool]): Default: False. + tuesday (Union[Unset, bool]): Default: False. + wednesday (Union[Unset, bool]): Default: False. + thursday (Union[Unset, bool]): Default: False. + friday (Union[Unset, bool]): Default: False. + saturday (Union[Unset, bool]): Default: False. + sunday (Union[Unset, bool]): Default: False. + start_time (Union[Unset, str]): Formatted as HH:MM + end_time (Union[Unset, str]): Formatted as HH:MM + all_day (Union[Unset, bool]): Default: False. + position (Union[None, Unset, int]): """ - monday: bool | Unset = False - tuesday: bool | Unset = False - wednesday: bool | Unset = False - thursday: bool | Unset = False - friday: bool | Unset = False - saturday: bool | Unset = False - sunday: bool | Unset = False - start_time: str | Unset = UNSET - end_time: str | Unset = UNSET - all_day: bool | Unset = False - position: int | None | Unset = UNSET + monday: Union[Unset, bool] = False + tuesday: Union[Unset, bool] = False + wednesday: Union[Unset, bool] = False + thursday: Union[Unset, bool] = False + friday: Union[Unset, bool] = False + saturday: Union[Unset, bool] = False + sunday: Union[Unset, bool] = False + start_time: Union[Unset, str] = UNSET + end_time: Union[Unset, str] = UNSET + all_day: Union[Unset, bool] = False + position: Union[None, Unset, int] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -62,7 +60,7 @@ def to_dict(self) -> dict[str, Any]: all_day = self.all_day - position: int | None | Unset + position: Union[None, Unset, int] if isinstance(self.position, Unset): position = UNSET else: @@ -119,12 +117,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: all_day = d.pop("all_day", UNSET) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> Union[None, Unset, int]: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(Union[None, Unset, int], data) position = _parse_position(d.pop("position", UNSET)) diff --git a/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_6.py b/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_6.py index c83904aa..24acc55b 100644 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_6.py +++ b/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_6.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast diff --git a/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_7.py b/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_7.py index 435bdc44..757912d8 100644 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_7.py +++ b/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_7.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_0.py b/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_0.py index ec39d280..aba4b2e1 100644 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_0.py +++ b/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast diff --git a/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_1.py b/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_1.py index 6ba315ef..90b2784d 100644 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_1.py +++ b/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_1.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_2.py b/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_2.py index 97d1442c..39b9fb39 100644 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_2.py +++ b/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_2.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -26,15 +24,15 @@ class EscalationPolicyPathRulesItemType9Type2: rule_type (EscalationPolicyPathRulesItemType9Type2RuleType): The type of the escalation path rule json_path (str): JSON path to extract value from payload operator (EscalationPolicyPathRulesItemType9Type2Operator): How JSON path value should be matched - value (None | str | Unset): Value with which JSON path value should be matched - values (list[str] | Unset): Values to match against (for is_one_of / is_not_one_of operators) + value (Union[None, Unset, str]): Value with which JSON path value should be matched + values (Union[Unset, list[str]]): Values to match against (for is_one_of / is_not_one_of operators) """ rule_type: EscalationPolicyPathRulesItemType9Type2RuleType json_path: str operator: EscalationPolicyPathRulesItemType9Type2Operator - value: None | str | Unset = UNSET - values: list[str] | Unset = UNSET + value: Union[None, Unset, str] = UNSET + values: Union[Unset, list[str]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -44,13 +42,13 @@ def to_dict(self) -> dict[str, Any]: operator: str = self.operator - value: None | str | Unset + value: Union[None, Unset, str] if isinstance(self.value, Unset): value = UNSET else: value = self.value - values: list[str] | Unset = UNSET + values: Union[Unset, list[str]] = UNSET if not isinstance(self.values, Unset): values = self.values @@ -79,12 +77,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: operator = check_escalation_policy_path_rules_item_type_9_type_2_operator(d.pop("operator")) - def _parse_value(data: object) -> None | str | Unset: + def _parse_value(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) value = _parse_value(d.pop("value", UNSET)) diff --git a/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_3.py b/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_3.py index 6c5863b1..da1b85d9 100644 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_3.py +++ b/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_3.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -27,14 +25,14 @@ class EscalationPolicyPathRulesItemType9Type3: fieldable_type (str): The type of the fieldable (e.g., AlertField) fieldable_id (str): The ID of the alert field operator (EscalationPolicyPathRulesItemType9Type3Operator): How the alert field value should be matched - values (list[str] | Unset): Values to match against + values (Union[Unset, list[str]]): Values to match against """ rule_type: EscalationPolicyPathRulesItemType9Type3RuleType fieldable_type: str fieldable_id: str operator: EscalationPolicyPathRulesItemType9Type3Operator - values: list[str] | Unset = UNSET + values: Union[Unset, list[str]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -46,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: operator: str = self.operator - values: list[str] | Unset = UNSET + values: Union[Unset, list[str]] = UNSET if not isinstance(self.values, Unset): values = self.values diff --git a/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_4.py b/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_4.py index d20cd9a4..8b8719df 100644 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_4.py +++ b/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_4.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast diff --git a/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_5.py b/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_5.py index 69651641..43f7ef47 100644 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_5.py +++ b/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_5.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -30,17 +28,16 @@ class EscalationPolicyPathRulesItemType9Type5: Attributes: rule_type (EscalationPolicyPathRulesItemType9Type5RuleType): The type of the escalation path rule time_zone (EscalationPolicyPathRulesItemType9Type5TimeZone): Time zone for the deferral window - time_blocks (list[EscalationPolicyPathRulesItemType9Type5TimeBlocksItem]): Time windows during which alerts are - deferred + time_blocks (list['EscalationPolicyPathRulesItemType9Type5TimeBlocksItem']): Time windows during which alerts + are deferred """ rule_type: EscalationPolicyPathRulesItemType9Type5RuleType time_zone: EscalationPolicyPathRulesItemType9Type5TimeZone - time_blocks: list[EscalationPolicyPathRulesItemType9Type5TimeBlocksItem] + time_blocks: list["EscalationPolicyPathRulesItemType9Type5TimeBlocksItem"] additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - rule_type: str = self.rule_type time_zone: str = self.time_zone diff --git a/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_5_time_blocks_item.py b/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_5_time_blocks_item.py index 6b32dea9..179c7129 100644 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_5_time_blocks_item.py +++ b/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_5_time_blocks_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,30 +13,30 @@ class EscalationPolicyPathRulesItemType9Type5TimeBlocksItem: """ Attributes: - monday (bool | Unset): Default: False. - tuesday (bool | Unset): Default: False. - wednesday (bool | Unset): Default: False. - thursday (bool | Unset): Default: False. - friday (bool | Unset): Default: False. - saturday (bool | Unset): Default: False. - sunday (bool | Unset): Default: False. - start_time (str | Unset): Formatted as HH:MM - end_time (str | Unset): Formatted as HH:MM - all_day (bool | Unset): Default: False. - position (int | None | Unset): + monday (Union[Unset, bool]): Default: False. + tuesday (Union[Unset, bool]): Default: False. + wednesday (Union[Unset, bool]): Default: False. + thursday (Union[Unset, bool]): Default: False. + friday (Union[Unset, bool]): Default: False. + saturday (Union[Unset, bool]): Default: False. + sunday (Union[Unset, bool]): Default: False. + start_time (Union[Unset, str]): Formatted as HH:MM + end_time (Union[Unset, str]): Formatted as HH:MM + all_day (Union[Unset, bool]): Default: False. + position (Union[None, Unset, int]): """ - monday: bool | Unset = False - tuesday: bool | Unset = False - wednesday: bool | Unset = False - thursday: bool | Unset = False - friday: bool | Unset = False - saturday: bool | Unset = False - sunday: bool | Unset = False - start_time: str | Unset = UNSET - end_time: str | Unset = UNSET - all_day: bool | Unset = False - position: int | None | Unset = UNSET + monday: Union[Unset, bool] = False + tuesday: Union[Unset, bool] = False + wednesday: Union[Unset, bool] = False + thursday: Union[Unset, bool] = False + friday: Union[Unset, bool] = False + saturday: Union[Unset, bool] = False + sunday: Union[Unset, bool] = False + start_time: Union[Unset, str] = UNSET + end_time: Union[Unset, str] = UNSET + all_day: Union[Unset, bool] = False + position: Union[None, Unset, int] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -62,7 +60,7 @@ def to_dict(self) -> dict[str, Any]: all_day = self.all_day - position: int | None | Unset + position: Union[None, Unset, int] if isinstance(self.position, Unset): position = UNSET else: @@ -119,12 +117,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: all_day = d.pop("all_day", UNSET) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> Union[None, Unset, int]: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(Union[None, Unset, int], data) position = _parse_position(d.pop("position", UNSET)) diff --git a/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_6.py b/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_6.py index ac30f0d9..0c836e8c 100644 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_6.py +++ b/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_6.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast diff --git a/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_7.py b/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_7.py index c66bd1f0..6fe8e16b 100644 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_7.py +++ b/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_7.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/escalation_policy_path_time_restrictions_item.py b/rootly_sdk/models/escalation_policy_path_time_restrictions_item.py index b5f130f6..a5c85c16 100644 --- a/rootly_sdk/models/escalation_policy_path_time_restrictions_item.py +++ b/rootly_sdk/models/escalation_policy_path_time_restrictions_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,26 +21,26 @@ class EscalationPolicyPathTimeRestrictionsItem: """ Attributes: - start_day (EscalationPolicyPathTimeRestrictionsItemStartDay | Unset): - start_time (str | Unset): Formatted as HH:MM - end_day (EscalationPolicyPathTimeRestrictionsItemEndDay | Unset): - end_time (str | Unset): Formatted as HH:MM + start_day (Union[Unset, EscalationPolicyPathTimeRestrictionsItemStartDay]): + start_time (Union[Unset, str]): Formatted as HH:MM + end_day (Union[Unset, EscalationPolicyPathTimeRestrictionsItemEndDay]): + end_time (Union[Unset, str]): Formatted as HH:MM """ - start_day: EscalationPolicyPathTimeRestrictionsItemStartDay | Unset = UNSET - start_time: str | Unset = UNSET - end_day: EscalationPolicyPathTimeRestrictionsItemEndDay | Unset = UNSET - end_time: str | Unset = UNSET + start_day: Union[Unset, EscalationPolicyPathTimeRestrictionsItemStartDay] = UNSET + start_time: Union[Unset, str] = UNSET + end_day: Union[Unset, EscalationPolicyPathTimeRestrictionsItemEndDay] = UNSET + end_time: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - start_day: str | Unset = UNSET + start_day: Union[Unset, str] = UNSET if not isinstance(self.start_day, Unset): start_day = self.start_day start_time = self.start_time - end_day: str | Unset = UNSET + end_day: Union[Unset, str] = UNSET if not isinstance(self.end_day, Unset): end_day = self.end_day @@ -66,7 +64,7 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _start_day = d.pop("start_day", UNSET) - start_day: EscalationPolicyPathTimeRestrictionsItemStartDay | Unset + start_day: Union[Unset, EscalationPolicyPathTimeRestrictionsItemStartDay] if isinstance(_start_day, Unset): start_day = UNSET else: @@ -75,7 +73,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: start_time = d.pop("start_time", UNSET) _end_day = d.pop("end_day", UNSET) - end_day: EscalationPolicyPathTimeRestrictionsItemEndDay | Unset + end_day: Union[Unset, EscalationPolicyPathTimeRestrictionsItemEndDay] if isinstance(_end_day, Unset): end_day = UNSET else: diff --git a/rootly_sdk/models/escalation_policy_response.py b/rootly_sdk/models/escalation_policy_response.py index 75a58333..c7c3f21c 100644 --- a/rootly_sdk/models/escalation_policy_response.py +++ b/rootly_sdk/models/escalation_policy_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,18 +19,17 @@ class EscalationPolicyResponse: """ Attributes: data (EscalationPolicyResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: EscalationPolicyResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "EscalationPolicyResponseData" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = EscalationPolicyResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) escalation_policy_response = cls( data=data, diff --git a/rootly_sdk/models/escalation_policy_response_data.py b/rootly_sdk/models/escalation_policy_response_data.py index 04dc48e4..1155c119 100644 --- a/rootly_sdk/models/escalation_policy_response_data.py +++ b/rootly_sdk/models/escalation_policy_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class EscalationPolicyResponseData: id: str type_: EscalationPolicyResponseDataType - attributes: EscalationPolicy + attributes: "EscalationPolicy" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/form_field.py b/rootly_sdk/models/form_field.py index 37eb897e..88fbe7c6 100644 --- a/rootly_sdk/models/form_field.py +++ b/rootly_sdk/models/form_field.py @@ -1,13 +1,12 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field from ..models.form_field_input_kind import FormFieldInputKind, check_form_field_input_kind from ..models.form_field_kind import FormFieldKind, check_form_field_kind +from ..models.form_field_resource_type import FormFieldResourceType, check_form_field_resource_type from ..models.form_field_value_kind import FormFieldValueKind, check_form_field_value_kind from ..types import UNSET, Unset @@ -27,12 +26,13 @@ class FormField: default_values (list[str]): created_at (str): Date of creation updated_at (str): Date of last update - value_kind_catalog_id (None | str | Unset): The ID of the catalog used when value_kind is `catalog_entity` - slug (str | Unset): The slug of the form field - description (None | str | Unset): The description of the form field - show_on_incident_details (bool | Unset): Whether the form field is shown on the incident details panel - enabled (bool | Unset): Whether the form field is enabled - auto_set_by_catalog_property_id (None | str | Unset): Catalog property ID to auto-set this form field. Only + value_kind_catalog_id (Union[None, Unset, str]): The ID of the catalog used when value_kind is `catalog_entity` + slug (Union[Unset, str]): The slug of the form field + resource_type (Union[Unset, FormFieldResourceType]): The resource type this field belongs to + description (Union[None, Unset, str]): The description of the form field + show_on_incident_details (Union[Unset, bool]): Whether the form field is shown on the incident details panel + enabled (Union[Unset, bool]): Whether the form field is enabled + auto_set_by_catalog_property_id (Union[None, Unset, str]): Catalog property ID to auto-set this form field. Only reference-kind catalog properties are supported. """ @@ -45,12 +45,13 @@ class FormField: default_values: list[str] created_at: str updated_at: str - value_kind_catalog_id: None | str | Unset = UNSET - slug: str | Unset = UNSET - description: None | str | Unset = UNSET - show_on_incident_details: bool | Unset = UNSET - enabled: bool | Unset = UNSET - auto_set_by_catalog_property_id: None | str | Unset = UNSET + value_kind_catalog_id: Union[None, Unset, str] = UNSET + slug: Union[Unset, str] = UNSET + resource_type: Union[Unset, FormFieldResourceType] = UNSET + description: Union[None, Unset, str] = UNSET + show_on_incident_details: Union[Unset, bool] = UNSET + enabled: Union[Unset, bool] = UNSET + auto_set_by_catalog_property_id: Union[None, Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -72,7 +73,7 @@ def to_dict(self) -> dict[str, Any]: updated_at = self.updated_at - value_kind_catalog_id: None | str | Unset + value_kind_catalog_id: Union[None, Unset, str] if isinstance(self.value_kind_catalog_id, Unset): value_kind_catalog_id = UNSET else: @@ -80,7 +81,11 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - description: None | str | Unset + resource_type: Union[Unset, str] = UNSET + if not isinstance(self.resource_type, Unset): + resource_type = self.resource_type + + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: @@ -90,7 +95,7 @@ def to_dict(self) -> dict[str, Any]: enabled = self.enabled - auto_set_by_catalog_property_id: None | str | Unset + auto_set_by_catalog_property_id: Union[None, Unset, str] if isinstance(self.auto_set_by_catalog_property_id, Unset): auto_set_by_catalog_property_id = UNSET else: @@ -115,6 +120,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["value_kind_catalog_id"] = value_kind_catalog_id if slug is not UNSET: field_dict["slug"] = slug + if resource_type is not UNSET: + field_dict["resource_type"] = resource_type if description is not UNSET: field_dict["description"] = description if show_on_incident_details is not UNSET: @@ -147,23 +154,30 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: updated_at = d.pop("updated_at") - def _parse_value_kind_catalog_id(data: object) -> None | str | Unset: + def _parse_value_kind_catalog_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) value_kind_catalog_id = _parse_value_kind_catalog_id(d.pop("value_kind_catalog_id", UNSET)) slug = d.pop("slug", UNSET) - def _parse_description(data: object) -> None | str | Unset: + _resource_type = d.pop("resource_type", UNSET) + resource_type: Union[Unset, FormFieldResourceType] + if isinstance(_resource_type, Unset): + resource_type = UNSET + else: + resource_type = check_form_field_resource_type(_resource_type) + + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) @@ -171,12 +185,12 @@ def _parse_description(data: object) -> None | str | Unset: enabled = d.pop("enabled", UNSET) - def _parse_auto_set_by_catalog_property_id(data: object) -> None | str | Unset: + def _parse_auto_set_by_catalog_property_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) auto_set_by_catalog_property_id = _parse_auto_set_by_catalog_property_id( d.pop("auto_set_by_catalog_property_id", UNSET) @@ -194,6 +208,7 @@ def _parse_auto_set_by_catalog_property_id(data: object) -> None | str | Unset: updated_at=updated_at, value_kind_catalog_id=value_kind_catalog_id, slug=slug, + resource_type=resource_type, description=description, show_on_incident_details=show_on_incident_details, enabled=enabled, diff --git a/rootly_sdk/models/form_field_list.py b/rootly_sdk/models/form_field_list.py index 2011c3b9..d9ce56cc 100644 --- a/rootly_sdk/models/form_field_list.py +++ b/rootly_sdk/models/form_field_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,20 +20,19 @@ class FormFieldList: """ Attributes: - data (list[FormFieldListDataItem]): + data (list['FormFieldListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[FormFieldListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["FormFieldListDataItem"] + links: "Links" + meta: "Meta" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) form_field_list = cls( data=data, diff --git a/rootly_sdk/models/form_field_list_data_item.py b/rootly_sdk/models/form_field_list_data_item.py index e25163e5..f29da629 100644 --- a/rootly_sdk/models/form_field_list_data_item.py +++ b/rootly_sdk/models/form_field_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class FormFieldListDataItem: id: str type_: FormFieldListDataItemType - attributes: FormField + attributes: "FormField" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/form_field_option.py b/rootly_sdk/models/form_field_option.py index c26efcd3..9b5587c7 100644 --- a/rootly_sdk/models/form_field_option.py +++ b/rootly_sdk/models/form_field_option.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -20,9 +18,9 @@ class FormFieldOption: position (int): The position of the form field option created_at (str): Date of creation updated_at (str): Date of last update - id (str | Unset): Unique ID of the form field option - form_field_id (str | Unset): The ID of the parent custom field - default (bool | Unset): + id (Union[Unset, str]): Unique ID of the form field option + form_field_id (Union[Unset, str]): The ID of the parent custom field + default (Union[Unset, bool]): """ value: str @@ -30,9 +28,9 @@ class FormFieldOption: position: int created_at: str updated_at: str - id: str | Unset = UNSET - form_field_id: str | Unset = UNSET - default: bool | Unset = UNSET + id: Union[Unset, str] = UNSET + form_field_id: Union[Unset, str] = UNSET + default: Union[Unset, bool] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/form_field_option_list.py b/rootly_sdk/models/form_field_option_list.py index e790315c..a7fad052 100644 --- a/rootly_sdk/models/form_field_option_list.py +++ b/rootly_sdk/models/form_field_option_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,20 +20,19 @@ class FormFieldOptionList: """ Attributes: - data (list[FormFieldOptionListDataItem]): + data (list['FormFieldOptionListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[FormFieldOptionListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["FormFieldOptionListDataItem"] + links: "Links" + meta: "Meta" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) form_field_option_list = cls( data=data, diff --git a/rootly_sdk/models/form_field_option_list_data_item.py b/rootly_sdk/models/form_field_option_list_data_item.py index cd8c8f3b..581c2720 100644 --- a/rootly_sdk/models/form_field_option_list_data_item.py +++ b/rootly_sdk/models/form_field_option_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class FormFieldOptionListDataItem: id: str type_: FormFieldOptionListDataItemType - attributes: FormFieldOption + attributes: "FormFieldOption" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/form_field_option_response.py b/rootly_sdk/models/form_field_option_response.py index a4531c97..d5626af5 100644 --- a/rootly_sdk/models/form_field_option_response.py +++ b/rootly_sdk/models/form_field_option_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,18 +19,17 @@ class FormFieldOptionResponse: """ Attributes: data (FormFieldOptionResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: FormFieldOptionResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "FormFieldOptionResponseData" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = FormFieldOptionResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) form_field_option_response = cls( data=data, diff --git a/rootly_sdk/models/form_field_option_response_data.py b/rootly_sdk/models/form_field_option_response_data.py index e9ccf686..0711113b 100644 --- a/rootly_sdk/models/form_field_option_response_data.py +++ b/rootly_sdk/models/form_field_option_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class FormFieldOptionResponseData: id: str type_: FormFieldOptionResponseDataType - attributes: FormFieldOption + attributes: "FormFieldOption" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/form_field_placement.py b/rootly_sdk/models/form_field_placement.py index e9a20d4d..0ea3e48f 100644 --- a/rootly_sdk/models/form_field_placement.py +++ b/rootly_sdk/models/form_field_placement.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -24,15 +22,16 @@ class FormFieldPlacement: """ Attributes: form_field_id (str): The form field that is placed. - form_set_id (str): The form set this field is placed in. + form_set_id (str): The form set this field is placed in. The form set must have the same `resource_type` as the + form field, otherwise the request is rejected with 422. form (str): The form this field is placed on. position (int): The position of the field placement. required (bool): Whether the field is unconditionally required on this form. - required_operator (FormFieldPlacementRequiredOperator | Unset): Logical operator when evaluating multiple + required_operator (Union[Unset, FormFieldPlacementRequiredOperator]): Logical operator when evaluating multiple form_field_placement_conditions with conditioned=required - placement_operator (FormFieldPlacementPlacementOperator | Unset): Logical operator when evaluating multiple - form_field_placement_conditions with conditioned=placement - non_editable (bool | Unset): Whether the field is read-only and cannot be edited by users. + placement_operator (Union[Unset, FormFieldPlacementPlacementOperator]): Logical operator when evaluating + multiple form_field_placement_conditions with conditioned=placement + non_editable (Union[Unset, bool]): Whether the field is read-only and cannot be edited by users. """ form_field_id: str @@ -40,9 +39,9 @@ class FormFieldPlacement: form: str position: int required: bool - required_operator: FormFieldPlacementRequiredOperator | Unset = UNSET - placement_operator: FormFieldPlacementPlacementOperator | Unset = UNSET - non_editable: bool | Unset = UNSET + required_operator: Union[Unset, FormFieldPlacementRequiredOperator] = UNSET + placement_operator: Union[Unset, FormFieldPlacementPlacementOperator] = UNSET + non_editable: Union[Unset, bool] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -56,11 +55,11 @@ def to_dict(self) -> dict[str, Any]: required = self.required - required_operator: str | Unset = UNSET + required_operator: Union[Unset, str] = UNSET if not isinstance(self.required_operator, Unset): required_operator = self.required_operator - placement_operator: str | Unset = UNSET + placement_operator: Union[Unset, str] = UNSET if not isinstance(self.placement_operator, Unset): placement_operator = self.placement_operator @@ -100,14 +99,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: required = d.pop("required") _required_operator = d.pop("required_operator", UNSET) - required_operator: FormFieldPlacementRequiredOperator | Unset + required_operator: Union[Unset, FormFieldPlacementRequiredOperator] if isinstance(_required_operator, Unset): required_operator = UNSET else: required_operator = check_form_field_placement_required_operator(_required_operator) _placement_operator = d.pop("placement_operator", UNSET) - placement_operator: FormFieldPlacementPlacementOperator | Unset + placement_operator: Union[Unset, FormFieldPlacementPlacementOperator] if isinstance(_placement_operator, Unset): placement_operator = UNSET else: diff --git a/rootly_sdk/models/form_field_placement_condition.py b/rootly_sdk/models/form_field_placement_condition.py index 727f0372..304d4790 100644 --- a/rootly_sdk/models/form_field_placement_condition.py +++ b/rootly_sdk/models/form_field_placement_condition.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast diff --git a/rootly_sdk/models/form_field_placement_condition_list.py b/rootly_sdk/models/form_field_placement_condition_list.py index 94fe706f..e1af6e80 100644 --- a/rootly_sdk/models/form_field_placement_condition_list.py +++ b/rootly_sdk/models/form_field_placement_condition_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,20 +20,19 @@ class FormFieldPlacementConditionList: """ Attributes: - data (list[FormFieldPlacementConditionListDataItem]): + data (list['FormFieldPlacementConditionListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[FormFieldPlacementConditionListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["FormFieldPlacementConditionListDataItem"] + links: "Links" + meta: "Meta" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) form_field_placement_condition_list = cls( data=data, diff --git a/rootly_sdk/models/form_field_placement_condition_list_data_item.py b/rootly_sdk/models/form_field_placement_condition_list_data_item.py index 5f15820c..ce1f7db9 100644 --- a/rootly_sdk/models/form_field_placement_condition_list_data_item.py +++ b/rootly_sdk/models/form_field_placement_condition_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class FormFieldPlacementConditionListDataItem: id: str type_: FormFieldPlacementConditionListDataItemType - attributes: FormFieldPlacementCondition + attributes: "FormFieldPlacementCondition" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/form_field_placement_condition_response.py b/rootly_sdk/models/form_field_placement_condition_response.py index c374c385..fade16d6 100644 --- a/rootly_sdk/models/form_field_placement_condition_response.py +++ b/rootly_sdk/models/form_field_placement_condition_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,18 +19,17 @@ class FormFieldPlacementConditionResponse: """ Attributes: data (FormFieldPlacementConditionResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: FormFieldPlacementConditionResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "FormFieldPlacementConditionResponseData" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = FormFieldPlacementConditionResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) form_field_placement_condition_response = cls( data=data, diff --git a/rootly_sdk/models/form_field_placement_condition_response_data.py b/rootly_sdk/models/form_field_placement_condition_response_data.py index 61facbc0..1ffe68e9 100644 --- a/rootly_sdk/models/form_field_placement_condition_response_data.py +++ b/rootly_sdk/models/form_field_placement_condition_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class FormFieldPlacementConditionResponseData: id: str type_: FormFieldPlacementConditionResponseDataType - attributes: FormFieldPlacementCondition + attributes: "FormFieldPlacementCondition" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/form_field_placement_list.py b/rootly_sdk/models/form_field_placement_list.py index 3e82fdde..3c124396 100644 --- a/rootly_sdk/models/form_field_placement_list.py +++ b/rootly_sdk/models/form_field_placement_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,20 +20,19 @@ class FormFieldPlacementList: """ Attributes: - data (list[FormFieldPlacementListDataItem]): + data (list['FormFieldPlacementListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[FormFieldPlacementListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["FormFieldPlacementListDataItem"] + links: "Links" + meta: "Meta" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) form_field_placement_list = cls( data=data, diff --git a/rootly_sdk/models/form_field_placement_list_data_item.py b/rootly_sdk/models/form_field_placement_list_data_item.py index fb27515a..d9bb45af 100644 --- a/rootly_sdk/models/form_field_placement_list_data_item.py +++ b/rootly_sdk/models/form_field_placement_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class FormFieldPlacementListDataItem: id: str type_: FormFieldPlacementListDataItemType - attributes: FormFieldPlacement + attributes: "FormFieldPlacement" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/form_field_placement_response.py b/rootly_sdk/models/form_field_placement_response.py index e1366e5f..91b6be49 100644 --- a/rootly_sdk/models/form_field_placement_response.py +++ b/rootly_sdk/models/form_field_placement_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,18 +19,17 @@ class FormFieldPlacementResponse: """ Attributes: data (FormFieldPlacementResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: FormFieldPlacementResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "FormFieldPlacementResponseData" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = FormFieldPlacementResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) form_field_placement_response = cls( data=data, diff --git a/rootly_sdk/models/form_field_placement_response_data.py b/rootly_sdk/models/form_field_placement_response_data.py index c36d8782..8e7330b2 100644 --- a/rootly_sdk/models/form_field_placement_response_data.py +++ b/rootly_sdk/models/form_field_placement_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class FormFieldPlacementResponseData: id: str type_: FormFieldPlacementResponseDataType - attributes: FormFieldPlacement + attributes: "FormFieldPlacement" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/form_field_position.py b/rootly_sdk/models/form_field_position.py index 88003c9f..4531afd2 100644 --- a/rootly_sdk/models/form_field_position.py +++ b/rootly_sdk/models/form_field_position.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/form_field_position_form.py b/rootly_sdk/models/form_field_position_form.py index 8b1043f4..8e148b0f 100644 --- a/rootly_sdk/models/form_field_position_form.py +++ b/rootly_sdk/models/form_field_position_form.py @@ -8,6 +8,7 @@ "slack_incident_resolution_form", "slack_new_incident_form", "slack_scheduled_incident_form", + "slack_task_form", "slack_update_incident_form", "slack_update_incident_status_form", "slack_update_scheduled_incident_form", @@ -18,6 +19,7 @@ "web_incident_resolution_form", "web_new_incident_form", "web_scheduled_incident_form", + "web_task_form", "web_update_incident_form", "web_update_scheduled_incident_form", ] @@ -30,6 +32,7 @@ "slack_incident_resolution_form", "slack_new_incident_form", "slack_scheduled_incident_form", + "slack_task_form", "slack_update_incident_form", "slack_update_incident_status_form", "slack_update_scheduled_incident_form", @@ -40,6 +43,7 @@ "web_incident_resolution_form", "web_new_incident_form", "web_scheduled_incident_form", + "web_task_form", "web_update_incident_form", "web_update_scheduled_incident_form", } diff --git a/rootly_sdk/models/form_field_position_list.py b/rootly_sdk/models/form_field_position_list.py index 6acf4d07..b88186e0 100644 --- a/rootly_sdk/models/form_field_position_list.py +++ b/rootly_sdk/models/form_field_position_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,20 +20,19 @@ class FormFieldPositionList: """ Attributes: - data (list[FormFieldPositionListDataItem]): + data (list['FormFieldPositionListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[FormFieldPositionListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["FormFieldPositionListDataItem"] + links: "Links" + meta: "Meta" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) form_field_position_list = cls( data=data, diff --git a/rootly_sdk/models/form_field_position_list_data_item.py b/rootly_sdk/models/form_field_position_list_data_item.py index e0c0a026..9678c8c9 100644 --- a/rootly_sdk/models/form_field_position_list_data_item.py +++ b/rootly_sdk/models/form_field_position_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class FormFieldPositionListDataItem: id: str type_: FormFieldPositionListDataItemType - attributes: FormFieldPosition + attributes: "FormFieldPosition" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/form_field_position_response.py b/rootly_sdk/models/form_field_position_response.py index 5fbc79a2..c29d22b0 100644 --- a/rootly_sdk/models/form_field_position_response.py +++ b/rootly_sdk/models/form_field_position_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,18 +19,17 @@ class FormFieldPositionResponse: """ Attributes: data (FormFieldPositionResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: FormFieldPositionResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "FormFieldPositionResponseData" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = FormFieldPositionResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) form_field_position_response = cls( data=data, diff --git a/rootly_sdk/models/form_field_position_response_data.py b/rootly_sdk/models/form_field_position_response_data.py index d1e206d9..6bb51c2d 100644 --- a/rootly_sdk/models/form_field_position_response_data.py +++ b/rootly_sdk/models/form_field_position_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class FormFieldPositionResponseData: id: str type_: FormFieldPositionResponseDataType - attributes: FormFieldPosition + attributes: "FormFieldPosition" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/form_field_resource_type.py b/rootly_sdk/models/form_field_resource_type.py new file mode 100644 index 00000000..241d6b76 --- /dev/null +++ b/rootly_sdk/models/form_field_resource_type.py @@ -0,0 +1,16 @@ +from typing import Literal, cast + +FormFieldResourceType = Literal["incident", "problem"] + +FORM_FIELD_RESOURCE_TYPE_VALUES: set[FormFieldResourceType] = { + "incident", + "problem", +} + + +def check_form_field_resource_type(value: str | None) -> FormFieldResourceType | None: + if value is None: + return None + if value in FORM_FIELD_RESOURCE_TYPE_VALUES: + return cast(FormFieldResourceType, value) + raise TypeError(f"Unexpected value {value!r}. Expected one of {FORM_FIELD_RESOURCE_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/form_field_response.py b/rootly_sdk/models/form_field_response.py index f84e4bb3..3a5e0c31 100644 --- a/rootly_sdk/models/form_field_response.py +++ b/rootly_sdk/models/form_field_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,18 +19,17 @@ class FormFieldResponse: """ Attributes: data (FormFieldResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: FormFieldResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "FormFieldResponseData" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = FormFieldResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) form_field_response = cls( data=data, diff --git a/rootly_sdk/models/form_field_response_data.py b/rootly_sdk/models/form_field_response_data.py index 00a95f7a..78ddd119 100644 --- a/rootly_sdk/models/form_field_response_data.py +++ b/rootly_sdk/models/form_field_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class FormFieldResponseData: id: str type_: FormFieldResponseDataType - attributes: FormField + attributes: "FormField" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/form_set.py b/rootly_sdk/models/form_set.py index 4800d2d5..06a2c575 100644 --- a/rootly_sdk/models/form_set.py +++ b/rootly_sdk/models/form_set.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,10 +21,11 @@ class FormSet: `web_scheduled_incident_form`, `web_update_scheduled_incident_form`, `slack_new_incident_form`, `slack_update_incident_form`, `slack_update_incident_status_form`, `slack_incident_mitigation_form`, `slack_incident_resolution_form`, `slack_incident_cancellation_form`, `slack_scheduled_incident_form`, - `slack_update_scheduled_incident_form`, `google_chat_new_incident_form`, `google_chat_update_incident_form` + `slack_update_scheduled_incident_form`, `google_chat_new_incident_form`, `google_chat_update_incident_form`, + `microsoft_teams_new_incident_form` created_at (str): Date of creation updated_at (str): Date of last update - slug (str | Unset): The slug of the form set + slug (Union[Unset, str]): The slug of the form set """ name: str @@ -34,7 +33,7 @@ class FormSet: forms: list[str] created_at: str updated_at: str - slug: str | Unset = UNSET + slug: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/form_set_condition.py b/rootly_sdk/models/form_set_condition.py index 571f0ed8..e7bc4fd2 100644 --- a/rootly_sdk/models/form_set_condition.py +++ b/rootly_sdk/models/form_set_condition.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast diff --git a/rootly_sdk/models/form_set_condition_list.py b/rootly_sdk/models/form_set_condition_list.py index 427a6913..47b4c827 100644 --- a/rootly_sdk/models/form_set_condition_list.py +++ b/rootly_sdk/models/form_set_condition_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,20 +20,19 @@ class FormSetConditionList: """ Attributes: - data (list[FormSetConditionListDataItem]): + data (list['FormSetConditionListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[FormSetConditionListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["FormSetConditionListDataItem"] + links: "Links" + meta: "Meta" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) form_set_condition_list = cls( data=data, diff --git a/rootly_sdk/models/form_set_condition_list_data_item.py b/rootly_sdk/models/form_set_condition_list_data_item.py index 4e33ff01..01a1392e 100644 --- a/rootly_sdk/models/form_set_condition_list_data_item.py +++ b/rootly_sdk/models/form_set_condition_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class FormSetConditionListDataItem: id: str type_: FormSetConditionListDataItemType - attributes: FormSetCondition + attributes: "FormSetCondition" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/form_set_condition_response.py b/rootly_sdk/models/form_set_condition_response.py index d2e7b00a..5fe98304 100644 --- a/rootly_sdk/models/form_set_condition_response.py +++ b/rootly_sdk/models/form_set_condition_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,18 +19,17 @@ class FormSetConditionResponse: """ Attributes: data (FormSetConditionResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: FormSetConditionResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "FormSetConditionResponseData" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = FormSetConditionResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) form_set_condition_response = cls( data=data, diff --git a/rootly_sdk/models/form_set_condition_response_data.py b/rootly_sdk/models/form_set_condition_response_data.py index 37053a7c..6e721c80 100644 --- a/rootly_sdk/models/form_set_condition_response_data.py +++ b/rootly_sdk/models/form_set_condition_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class FormSetConditionResponseData: id: str type_: FormSetConditionResponseDataType - attributes: FormSetCondition + attributes: "FormSetCondition" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/form_set_list.py b/rootly_sdk/models/form_set_list.py index 451c198c..772d6ca0 100644 --- a/rootly_sdk/models/form_set_list.py +++ b/rootly_sdk/models/form_set_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,20 +20,19 @@ class FormSetList: """ Attributes: - data (list[FormSetListDataItem]): + data (list['FormSetListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[FormSetListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["FormSetListDataItem"] + links: "Links" + meta: "Meta" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) form_set_list = cls( data=data, diff --git a/rootly_sdk/models/form_set_list_data_item.py b/rootly_sdk/models/form_set_list_data_item.py index 21ac0f95..783ebe8c 100644 --- a/rootly_sdk/models/form_set_list_data_item.py +++ b/rootly_sdk/models/form_set_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class FormSetListDataItem: id: str type_: FormSetListDataItemType - attributes: FormSet + attributes: "FormSet" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/form_set_response.py b/rootly_sdk/models/form_set_response.py index a8cd8b95..06b688d9 100644 --- a/rootly_sdk/models/form_set_response.py +++ b/rootly_sdk/models/form_set_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,18 +19,17 @@ class FormSetResponse: """ Attributes: data (FormSetResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: FormSetResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "FormSetResponseData" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = FormSetResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) form_set_response = cls( data=data, diff --git a/rootly_sdk/models/form_set_response_data.py b/rootly_sdk/models/form_set_response_data.py index 9c7d1e8e..3e6f4e46 100644 --- a/rootly_sdk/models/form_set_response_data.py +++ b/rootly_sdk/models/form_set_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class FormSetResponseData: id: str type_: FormSetResponseDataType - attributes: FormSet + attributes: "FormSet" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/functionality.py b/rootly_sdk/models/functionality.py index 5c5f97c0..2930af54 100644 --- a/rootly_sdk/models/functionality.py +++ b/rootly_sdk/models/functionality.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -25,64 +23,63 @@ class Functionality: name (str): The name of the functionality created_at (str): Date of creation updated_at (str): Date of last update - slug (str | Unset): The slug of the functionality - managed_by (FunctionalityManagedBy | Unset): How this functionality is managed (provenance): web, api, + slug (Union[Unset, str]): The slug of the functionality + managed_by (Union[Unset, FunctionalityManagedBy]): How this functionality is managed (provenance): web, api, terraform, etc. Read-only. - description (None | str | Unset): The description of the functionality - public_description (None | str | Unset): The public description of the functionality - notify_emails (list[str] | None | Unset): Emails attached to the functionality - color (None | str | Unset): The hex color of the functionality - backstage_id (None | str | Unset): The Backstage entity id associated to this functionality. eg: + description (Union[None, Unset, str]): The description of the functionality + public_description (Union[None, Unset, str]): The status page description of the functionality + notify_emails (Union[None, Unset, list[str]]): Emails attached to the functionality + color (Union[None, Unset, str]): The hex color of the functionality + backstage_id (Union[None, Unset, str]): The Backstage entity id associated to this functionality. eg: :namespace/:kind/:entity_name - external_id (None | str | Unset): The external id associated to this functionality - pagerduty_id (None | str | Unset): The PagerDuty service id associated to this functionality - opsgenie_id (None | str | Unset): The Opsgenie service id associated to this functionality - opsgenie_team_id (None | str | Unset): The Opsgenie team id associated to this functionality - cortex_id (None | str | Unset): The Cortex group id associated to this functionality - service_now_ci_sys_id (None | str | Unset): The Service Now CI sys id associated to this functionality - position (int | None | Unset): Position of the functionality - environment_ids (list[str] | None | Unset): Environments associated with this functionality - service_ids (list[str] | None | Unset): Services associated with this functionality - owner_group_ids (list[str] | None | Unset): Owner Teams associated with this functionality - owner_user_ids (list[int] | None | Unset): Owner Users associated with this functionality - escalation_policy_id (None | str | Unset): The escalation policy id of the functionality - slack_channels (list[FunctionalitySlackChannelsType0Item] | None | Unset): Slack Channels associated with this - functionality - slack_aliases (list[FunctionalitySlackAliasesType0Item] | None | Unset): Slack Aliases associated with this - functionality - properties (list[FunctionalityPropertiesType0Item] | None | Unset): Array of property values for this + external_id (Union[None, Unset, str]): The external id associated to this functionality + pagerduty_id (Union[None, Unset, str]): The PagerDuty service id associated to this functionality + opsgenie_id (Union[None, Unset, str]): The Opsgenie service id associated to this functionality + opsgenie_team_id (Union[None, Unset, str]): The Opsgenie team id associated to this functionality + cortex_id (Union[None, Unset, str]): The Cortex group id associated to this functionality + service_now_ci_sys_id (Union[None, Unset, str]): The Service Now CI sys id associated to this functionality + position (Union[None, Unset, int]): Position of the functionality + environment_ids (Union[None, Unset, list[str]]): Environments associated with this functionality + service_ids (Union[None, Unset, list[str]]): Services associated with this functionality + owner_group_ids (Union[None, Unset, list[str]]): Owner Teams associated with this functionality + owner_user_ids (Union[None, Unset, list[int]]): Owner Users associated with this functionality + escalation_policy_id (Union[None, Unset, str]): The escalation policy id of the functionality + slack_channels (Union[None, Unset, list['FunctionalitySlackChannelsType0Item']]): Slack Channels associated with + this functionality + slack_aliases (Union[None, Unset, list['FunctionalitySlackAliasesType0Item']]): Slack Aliases associated with + this functionality + properties (Union[None, Unset, list['FunctionalityPropertiesType0Item']]): Array of property values for this functionality. """ name: str created_at: str updated_at: str - slug: str | Unset = UNSET - managed_by: FunctionalityManagedBy | Unset = UNSET - description: None | str | Unset = UNSET - public_description: None | str | Unset = UNSET - notify_emails: list[str] | None | Unset = UNSET - color: None | str | Unset = UNSET - backstage_id: None | str | Unset = UNSET - external_id: None | str | Unset = UNSET - pagerduty_id: None | str | Unset = UNSET - opsgenie_id: None | str | Unset = UNSET - opsgenie_team_id: None | str | Unset = UNSET - cortex_id: None | str | Unset = UNSET - service_now_ci_sys_id: None | str | Unset = UNSET - position: int | None | Unset = UNSET - environment_ids: list[str] | None | Unset = UNSET - service_ids: list[str] | None | Unset = UNSET - owner_group_ids: list[str] | None | Unset = UNSET - owner_user_ids: list[int] | None | Unset = UNSET - escalation_policy_id: None | str | Unset = UNSET - slack_channels: list[FunctionalitySlackChannelsType0Item] | None | Unset = UNSET - slack_aliases: list[FunctionalitySlackAliasesType0Item] | None | Unset = UNSET - properties: list[FunctionalityPropertiesType0Item] | None | Unset = UNSET + slug: Union[Unset, str] = UNSET + managed_by: Union[Unset, FunctionalityManagedBy] = UNSET + description: Union[None, Unset, str] = UNSET + public_description: Union[None, Unset, str] = UNSET + notify_emails: Union[None, Unset, list[str]] = UNSET + color: Union[None, Unset, str] = UNSET + backstage_id: Union[None, Unset, str] = UNSET + external_id: Union[None, Unset, str] = UNSET + pagerduty_id: Union[None, Unset, str] = UNSET + opsgenie_id: Union[None, Unset, str] = UNSET + opsgenie_team_id: Union[None, Unset, str] = UNSET + cortex_id: Union[None, Unset, str] = UNSET + service_now_ci_sys_id: Union[None, Unset, str] = UNSET + position: Union[None, Unset, int] = UNSET + environment_ids: Union[None, Unset, list[str]] = UNSET + service_ids: Union[None, Unset, list[str]] = UNSET + owner_group_ids: Union[None, Unset, list[str]] = UNSET + owner_user_ids: Union[None, Unset, list[int]] = UNSET + escalation_policy_id: Union[None, Unset, str] = UNSET + slack_channels: Union[None, Unset, list["FunctionalitySlackChannelsType0Item"]] = UNSET + slack_aliases: Union[None, Unset, list["FunctionalitySlackAliasesType0Item"]] = UNSET + properties: Union[None, Unset, list["FunctionalityPropertiesType0Item"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - name = self.name created_at = self.created_at @@ -91,23 +88,23 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - managed_by: str | Unset = UNSET + managed_by: Union[Unset, str] = UNSET if not isinstance(self.managed_by, Unset): managed_by = self.managed_by - description: None | str | Unset + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: description = self.description - public_description: None | str | Unset + public_description: Union[None, Unset, str] if isinstance(self.public_description, Unset): public_description = UNSET else: public_description = self.public_description - notify_emails: list[str] | None | Unset + notify_emails: Union[None, Unset, list[str]] if isinstance(self.notify_emails, Unset): notify_emails = UNSET elif isinstance(self.notify_emails, list): @@ -116,61 +113,61 @@ def to_dict(self) -> dict[str, Any]: else: notify_emails = self.notify_emails - color: None | str | Unset + color: Union[None, Unset, str] if isinstance(self.color, Unset): color = UNSET else: color = self.color - backstage_id: None | str | Unset + backstage_id: Union[None, Unset, str] if isinstance(self.backstage_id, Unset): backstage_id = UNSET else: backstage_id = self.backstage_id - external_id: None | str | Unset + external_id: Union[None, Unset, str] if isinstance(self.external_id, Unset): external_id = UNSET else: external_id = self.external_id - pagerduty_id: None | str | Unset + pagerduty_id: Union[None, Unset, str] if isinstance(self.pagerduty_id, Unset): pagerduty_id = UNSET else: pagerduty_id = self.pagerduty_id - opsgenie_id: None | str | Unset + opsgenie_id: Union[None, Unset, str] if isinstance(self.opsgenie_id, Unset): opsgenie_id = UNSET else: opsgenie_id = self.opsgenie_id - opsgenie_team_id: None | str | Unset + opsgenie_team_id: Union[None, Unset, str] if isinstance(self.opsgenie_team_id, Unset): opsgenie_team_id = UNSET else: opsgenie_team_id = self.opsgenie_team_id - cortex_id: None | str | Unset + cortex_id: Union[None, Unset, str] if isinstance(self.cortex_id, Unset): cortex_id = UNSET else: cortex_id = self.cortex_id - service_now_ci_sys_id: None | str | Unset + service_now_ci_sys_id: Union[None, Unset, str] if isinstance(self.service_now_ci_sys_id, Unset): service_now_ci_sys_id = UNSET else: service_now_ci_sys_id = self.service_now_ci_sys_id - position: int | None | Unset + position: Union[None, Unset, int] if isinstance(self.position, Unset): position = UNSET else: position = self.position - environment_ids: list[str] | None | Unset + environment_ids: Union[None, Unset, list[str]] if isinstance(self.environment_ids, Unset): environment_ids = UNSET elif isinstance(self.environment_ids, list): @@ -179,7 +176,7 @@ def to_dict(self) -> dict[str, Any]: else: environment_ids = self.environment_ids - service_ids: list[str] | None | Unset + service_ids: Union[None, Unset, list[str]] if isinstance(self.service_ids, Unset): service_ids = UNSET elif isinstance(self.service_ids, list): @@ -188,7 +185,7 @@ def to_dict(self) -> dict[str, Any]: else: service_ids = self.service_ids - owner_group_ids: list[str] | None | Unset + owner_group_ids: Union[None, Unset, list[str]] if isinstance(self.owner_group_ids, Unset): owner_group_ids = UNSET elif isinstance(self.owner_group_ids, list): @@ -197,7 +194,7 @@ def to_dict(self) -> dict[str, Any]: else: owner_group_ids = self.owner_group_ids - owner_user_ids: list[int] | None | Unset + owner_user_ids: Union[None, Unset, list[int]] if isinstance(self.owner_user_ids, Unset): owner_user_ids = UNSET elif isinstance(self.owner_user_ids, list): @@ -206,13 +203,13 @@ def to_dict(self) -> dict[str, Any]: else: owner_user_ids = self.owner_user_ids - escalation_policy_id: None | str | Unset + escalation_policy_id: Union[None, Unset, str] if isinstance(self.escalation_policy_id, Unset): escalation_policy_id = UNSET else: escalation_policy_id = self.escalation_policy_id - slack_channels: list[dict[str, Any]] | None | Unset + slack_channels: Union[None, Unset, list[dict[str, Any]]] if isinstance(self.slack_channels, Unset): slack_channels = UNSET elif isinstance(self.slack_channels, list): @@ -224,7 +221,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_channels = self.slack_channels - slack_aliases: list[dict[str, Any]] | None | Unset + slack_aliases: Union[None, Unset, list[dict[str, Any]]] if isinstance(self.slack_aliases, Unset): slack_aliases = UNSET elif isinstance(self.slack_aliases, list): @@ -236,7 +233,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_aliases = self.slack_aliases - properties: list[dict[str, Any]] | None | Unset + properties: Union[None, Unset, list[dict[str, Any]]] if isinstance(self.properties, Unset): properties = UNSET elif isinstance(self.properties, list): @@ -320,31 +317,31 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: slug = d.pop("slug", UNSET) _managed_by = d.pop("managed_by", UNSET) - managed_by: FunctionalityManagedBy | Unset + managed_by: Union[Unset, FunctionalityManagedBy] if isinstance(_managed_by, Unset): managed_by = UNSET else: managed_by = check_functionality_managed_by(_managed_by) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) - def _parse_public_description(data: object) -> None | str | Unset: + def _parse_public_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) public_description = _parse_public_description(d.pop("public_description", UNSET)) - def _parse_notify_emails(data: object) -> list[str] | None | Unset: + def _parse_notify_emails(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -355,94 +352,94 @@ def _parse_notify_emails(data: object) -> list[str] | None | Unset: notify_emails_type_0 = cast(list[str], data) return notify_emails_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) notify_emails = _parse_notify_emails(d.pop("notify_emails", UNSET)) - def _parse_color(data: object) -> None | str | Unset: + def _parse_color(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) color = _parse_color(d.pop("color", UNSET)) - def _parse_backstage_id(data: object) -> None | str | Unset: + def _parse_backstage_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) backstage_id = _parse_backstage_id(d.pop("backstage_id", UNSET)) - def _parse_external_id(data: object) -> None | str | Unset: + def _parse_external_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) external_id = _parse_external_id(d.pop("external_id", UNSET)) - def _parse_pagerduty_id(data: object) -> None | str | Unset: + def _parse_pagerduty_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) pagerduty_id = _parse_pagerduty_id(d.pop("pagerduty_id", UNSET)) - def _parse_opsgenie_id(data: object) -> None | str | Unset: + def _parse_opsgenie_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) opsgenie_id = _parse_opsgenie_id(d.pop("opsgenie_id", UNSET)) - def _parse_opsgenie_team_id(data: object) -> None | str | Unset: + def _parse_opsgenie_team_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) opsgenie_team_id = _parse_opsgenie_team_id(d.pop("opsgenie_team_id", UNSET)) - def _parse_cortex_id(data: object) -> None | str | Unset: + def _parse_cortex_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) cortex_id = _parse_cortex_id(d.pop("cortex_id", UNSET)) - def _parse_service_now_ci_sys_id(data: object) -> None | str | Unset: + def _parse_service_now_ci_sys_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) service_now_ci_sys_id = _parse_service_now_ci_sys_id(d.pop("service_now_ci_sys_id", UNSET)) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> Union[None, Unset, int]: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(Union[None, Unset, int], data) position = _parse_position(d.pop("position", UNSET)) - def _parse_environment_ids(data: object) -> list[str] | None | Unset: + def _parse_environment_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -453,13 +450,13 @@ def _parse_environment_ids(data: object) -> list[str] | None | Unset: environment_ids_type_0 = cast(list[str], data) return environment_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) environment_ids = _parse_environment_ids(d.pop("environment_ids", UNSET)) - def _parse_service_ids(data: object) -> list[str] | None | Unset: + def _parse_service_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -470,13 +467,13 @@ def _parse_service_ids(data: object) -> list[str] | None | Unset: service_ids_type_0 = cast(list[str], data) return service_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) service_ids = _parse_service_ids(d.pop("service_ids", UNSET)) - def _parse_owner_group_ids(data: object) -> list[str] | None | Unset: + def _parse_owner_group_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -487,13 +484,13 @@ def _parse_owner_group_ids(data: object) -> list[str] | None | Unset: owner_group_ids_type_0 = cast(list[str], data) return owner_group_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) owner_group_ids = _parse_owner_group_ids(d.pop("owner_group_ids", UNSET)) - def _parse_owner_user_ids(data: object) -> list[int] | None | Unset: + def _parse_owner_user_ids(data: object) -> Union[None, Unset, list[int]]: if data is None: return data if isinstance(data, Unset): @@ -504,22 +501,22 @@ def _parse_owner_user_ids(data: object) -> list[int] | None | Unset: owner_user_ids_type_0 = cast(list[int], data) return owner_user_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[int] | None | Unset, data) + return cast(Union[None, Unset, list[int]], data) owner_user_ids = _parse_owner_user_ids(d.pop("owner_user_ids", UNSET)) - def _parse_escalation_policy_id(data: object) -> None | str | Unset: + def _parse_escalation_policy_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) escalation_policy_id = _parse_escalation_policy_id(d.pop("escalation_policy_id", UNSET)) - def _parse_slack_channels(data: object) -> list[FunctionalitySlackChannelsType0Item] | None | Unset: + def _parse_slack_channels(data: object) -> Union[None, Unset, list["FunctionalitySlackChannelsType0Item"]]: if data is None: return data if isinstance(data, Unset): @@ -537,13 +534,13 @@ def _parse_slack_channels(data: object) -> list[FunctionalitySlackChannelsType0I slack_channels_type_0.append(slack_channels_type_0_item) return slack_channels_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[FunctionalitySlackChannelsType0Item] | None | Unset, data) + return cast(Union[None, Unset, list["FunctionalitySlackChannelsType0Item"]], data) slack_channels = _parse_slack_channels(d.pop("slack_channels", UNSET)) - def _parse_slack_aliases(data: object) -> list[FunctionalitySlackAliasesType0Item] | None | Unset: + def _parse_slack_aliases(data: object) -> Union[None, Unset, list["FunctionalitySlackAliasesType0Item"]]: if data is None: return data if isinstance(data, Unset): @@ -561,13 +558,13 @@ def _parse_slack_aliases(data: object) -> list[FunctionalitySlackAliasesType0Ite slack_aliases_type_0.append(slack_aliases_type_0_item) return slack_aliases_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[FunctionalitySlackAliasesType0Item] | None | Unset, data) + return cast(Union[None, Unset, list["FunctionalitySlackAliasesType0Item"]], data) slack_aliases = _parse_slack_aliases(d.pop("slack_aliases", UNSET)) - def _parse_properties(data: object) -> list[FunctionalityPropertiesType0Item] | None | Unset: + def _parse_properties(data: object) -> Union[None, Unset, list["FunctionalityPropertiesType0Item"]]: if data is None: return data if isinstance(data, Unset): @@ -583,9 +580,9 @@ def _parse_properties(data: object) -> list[FunctionalityPropertiesType0Item] | properties_type_0.append(properties_type_0_item) return properties_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[FunctionalityPropertiesType0Item] | None | Unset, data) + return cast(Union[None, Unset, list["FunctionalityPropertiesType0Item"]], data) properties = _parse_properties(d.pop("properties", UNSET)) diff --git a/rootly_sdk/models/functionality_list.py b/rootly_sdk/models/functionality_list.py index fbc1c27f..a9092a9e 100644 --- a/rootly_sdk/models/functionality_list.py +++ b/rootly_sdk/models/functionality_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,20 +20,19 @@ class FunctionalityList: """ Attributes: - data (list[FunctionalityListDataItem]): + data (list['FunctionalityListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[FunctionalityListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["FunctionalityListDataItem"] + links: "Links" + meta: "Meta" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) functionality_list = cls( data=data, diff --git a/rootly_sdk/models/functionality_list_data_item.py b/rootly_sdk/models/functionality_list_data_item.py index df02f6b2..891c5842 100644 --- a/rootly_sdk/models/functionality_list_data_item.py +++ b/rootly_sdk/models/functionality_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class FunctionalityListDataItem: id: str type_: FunctionalityListDataItemType - attributes: Functionality + attributes: "Functionality" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/functionality_properties_type_0_item.py b/rootly_sdk/models/functionality_properties_type_0_item.py index 6bcb6048..bb12ff07 100644 --- a/rootly_sdk/models/functionality_properties_type_0_item.py +++ b/rootly_sdk/models/functionality_properties_type_0_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/functionality_response.py b/rootly_sdk/models/functionality_response.py index 87433a01..43017ba7 100644 --- a/rootly_sdk/models/functionality_response.py +++ b/rootly_sdk/models/functionality_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,18 +19,17 @@ class FunctionalityResponse: """ Attributes: data (FunctionalityResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: FunctionalityResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "FunctionalityResponseData" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = FunctionalityResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) functionality_response = cls( data=data, diff --git a/rootly_sdk/models/functionality_response_data.py b/rootly_sdk/models/functionality_response_data.py index cd1b0087..1248604a 100644 --- a/rootly_sdk/models/functionality_response_data.py +++ b/rootly_sdk/models/functionality_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class FunctionalityResponseData: id: str type_: FunctionalityResponseDataType - attributes: Functionality + attributes: "Functionality" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/functionality_slack_aliases_type_0_item.py b/rootly_sdk/models/functionality_slack_aliases_type_0_item.py index d9afc31f..63a4d598 100644 --- a/rootly_sdk/models/functionality_slack_aliases_type_0_item.py +++ b/rootly_sdk/models/functionality_slack_aliases_type_0_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/functionality_slack_channels_type_0_item.py b/rootly_sdk/models/functionality_slack_channels_type_0_item.py index f2ee6b04..50b4ae69 100644 --- a/rootly_sdk/models/functionality_slack_channels_type_0_item.py +++ b/rootly_sdk/models/functionality_slack_channels_type_0_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/get_alerts_task_params.py b/rootly_sdk/models/get_alerts_task_params.py index ed386b43..37821b7f 100644 --- a/rootly_sdk/models/get_alerts_task_params.py +++ b/rootly_sdk/models/get_alerts_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -26,53 +24,52 @@ class GetAlertsTaskParams: Attributes: past_duration (str): How far back to fetch commits (in format '1 minute', '30 days', '3 months', etc.) Example: 1 hour. - task_type (GetAlertsTaskParamsTaskType | Unset): - service_ids (list[str] | Unset): - environment_ids (list[str] | Unset): - labels (list[str] | Unset): - sources (list[str] | Unset): - services_impacted_by_incident (bool | Unset): - environments_impacted_by_incident (bool | Unset): - post_to_incident_timeline (bool | Unset): - post_to_slack_channels (list[GetAlertsTaskParamsPostToSlackChannelsItem] | Unset): - parent_message_thread_task (GetAlertsTaskParamsParentMessageThreadTask | Unset): A hash where [id] is the task - id of the parent task that sent a message, and [name] is the name of the parent task + task_type (Union[Unset, GetAlertsTaskParamsTaskType]): + service_ids (Union[Unset, list[str]]): + environment_ids (Union[Unset, list[str]]): + labels (Union[Unset, list[str]]): + sources (Union[Unset, list[str]]): + services_impacted_by_incident (Union[Unset, bool]): + environments_impacted_by_incident (Union[Unset, bool]): + post_to_incident_timeline (Union[Unset, bool]): + post_to_slack_channels (Union[Unset, list['GetAlertsTaskParamsPostToSlackChannelsItem']]): + parent_message_thread_task (Union[Unset, GetAlertsTaskParamsParentMessageThreadTask]): A hash where [id] is the + task id of the parent task that sent a message, and [name] is the name of the parent task """ past_duration: str - task_type: GetAlertsTaskParamsTaskType | Unset = UNSET - service_ids: list[str] | Unset = UNSET - environment_ids: list[str] | Unset = UNSET - labels: list[str] | Unset = UNSET - sources: list[str] | Unset = UNSET - services_impacted_by_incident: bool | Unset = UNSET - environments_impacted_by_incident: bool | Unset = UNSET - post_to_incident_timeline: bool | Unset = UNSET - post_to_slack_channels: list[GetAlertsTaskParamsPostToSlackChannelsItem] | Unset = UNSET - parent_message_thread_task: GetAlertsTaskParamsParentMessageThreadTask | Unset = UNSET + task_type: Union[Unset, GetAlertsTaskParamsTaskType] = UNSET + service_ids: Union[Unset, list[str]] = UNSET + environment_ids: Union[Unset, list[str]] = UNSET + labels: Union[Unset, list[str]] = UNSET + sources: Union[Unset, list[str]] = UNSET + services_impacted_by_incident: Union[Unset, bool] = UNSET + environments_impacted_by_incident: Union[Unset, bool] = UNSET + post_to_incident_timeline: Union[Unset, bool] = UNSET + post_to_slack_channels: Union[Unset, list["GetAlertsTaskParamsPostToSlackChannelsItem"]] = UNSET + parent_message_thread_task: Union[Unset, "GetAlertsTaskParamsParentMessageThreadTask"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - past_duration = self.past_duration - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - service_ids: list[str] | Unset = UNSET + service_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.service_ids, Unset): service_ids = self.service_ids - environment_ids: list[str] | Unset = UNSET + environment_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.environment_ids, Unset): environment_ids = self.environment_ids - labels: list[str] | Unset = UNSET + labels: Union[Unset, list[str]] = UNSET if not isinstance(self.labels, Unset): labels = self.labels - sources: list[str] | Unset = UNSET + sources: Union[Unset, list[str]] = UNSET if not isinstance(self.sources, Unset): sources = self.sources @@ -82,14 +79,14 @@ def to_dict(self) -> dict[str, Any]: post_to_incident_timeline = self.post_to_incident_timeline - post_to_slack_channels: list[dict[str, Any]] | Unset = UNSET + post_to_slack_channels: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.post_to_slack_channels, Unset): post_to_slack_channels = [] for post_to_slack_channels_item_data in self.post_to_slack_channels: post_to_slack_channels_item = post_to_slack_channels_item_data.to_dict() post_to_slack_channels.append(post_to_slack_channels_item) - parent_message_thread_task: dict[str, Any] | Unset = UNSET + parent_message_thread_task: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.parent_message_thread_task, Unset): parent_message_thread_task = self.parent_message_thread_task.to_dict() @@ -136,7 +133,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: past_duration = d.pop("past_duration") _task_type = d.pop("task_type", UNSET) - task_type: GetAlertsTaskParamsTaskType | Unset + task_type: Union[Unset, GetAlertsTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: @@ -156,19 +153,17 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: post_to_incident_timeline = d.pop("post_to_incident_timeline", UNSET) + post_to_slack_channels = [] _post_to_slack_channels = d.pop("post_to_slack_channels", UNSET) - post_to_slack_channels: list[GetAlertsTaskParamsPostToSlackChannelsItem] | Unset = UNSET - if _post_to_slack_channels is not UNSET: - post_to_slack_channels = [] - for post_to_slack_channels_item_data in _post_to_slack_channels: - post_to_slack_channels_item = GetAlertsTaskParamsPostToSlackChannelsItem.from_dict( - post_to_slack_channels_item_data - ) + for post_to_slack_channels_item_data in _post_to_slack_channels or []: + post_to_slack_channels_item = GetAlertsTaskParamsPostToSlackChannelsItem.from_dict( + post_to_slack_channels_item_data + ) - post_to_slack_channels.append(post_to_slack_channels_item) + post_to_slack_channels.append(post_to_slack_channels_item) _parent_message_thread_task = d.pop("parent_message_thread_task", UNSET) - parent_message_thread_task: GetAlertsTaskParamsParentMessageThreadTask | Unset + parent_message_thread_task: Union[Unset, GetAlertsTaskParamsParentMessageThreadTask] if isinstance(_parent_message_thread_task, Unset): parent_message_thread_task = UNSET else: diff --git a/rootly_sdk/models/get_alerts_task_params_parent_message_thread_task.py b/rootly_sdk/models/get_alerts_task_params_parent_message_thread_task.py index 1f009e1e..5f0736a3 100644 --- a/rootly_sdk/models/get_alerts_task_params_parent_message_thread_task.py +++ b/rootly_sdk/models/get_alerts_task_params_parent_message_thread_task.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,12 +14,12 @@ class GetAlertsTaskParamsParentMessageThreadTask: """A hash where [id] is the task id of the parent task that sent a message, and [name] is the name of the parent task Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/get_alerts_task_params_post_to_slack_channels_item.py b/rootly_sdk/models/get_alerts_task_params_post_to_slack_channels_item.py index e4d3b93b..e8f32ca9 100644 --- a/rootly_sdk/models/get_alerts_task_params_post_to_slack_channels_item.py +++ b/rootly_sdk/models/get_alerts_task_params_post_to_slack_channels_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class GetAlertsTaskParamsPostToSlackChannelsItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/get_github_commits_task_params_type_0.py b/rootly_sdk/models/get_github_commits_task_params_type_0.py index 06c5ef0e..30772304 100644 --- a/rootly_sdk/models/get_github_commits_task_params_type_0.py +++ b/rootly_sdk/models/get_github_commits_task_params_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast diff --git a/rootly_sdk/models/get_github_commits_task_params_type_1.py b/rootly_sdk/models/get_github_commits_task_params_type_1.py index 76dedc3e..8d483d51 100644 --- a/rootly_sdk/models/get_github_commits_task_params_type_1.py +++ b/rootly_sdk/models/get_github_commits_task_params_type_1.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast diff --git a/rootly_sdk/models/get_gitlab_commits_task_params_type_0.py b/rootly_sdk/models/get_gitlab_commits_task_params_type_0.py index b4ead582..8063d061 100644 --- a/rootly_sdk/models/get_gitlab_commits_task_params_type_0.py +++ b/rootly_sdk/models/get_gitlab_commits_task_params_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast diff --git a/rootly_sdk/models/get_gitlab_commits_task_params_type_1.py b/rootly_sdk/models/get_gitlab_commits_task_params_type_1.py index dac35eb7..842037ca 100644 --- a/rootly_sdk/models/get_gitlab_commits_task_params_type_1.py +++ b/rootly_sdk/models/get_gitlab_commits_task_params_type_1.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast diff --git a/rootly_sdk/models/get_pulses_task_params.py b/rootly_sdk/models/get_pulses_task_params.py index 9587716c..3a943691 100644 --- a/rootly_sdk/models/get_pulses_task_params.py +++ b/rootly_sdk/models/get_pulses_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -26,59 +24,58 @@ class GetPulsesTaskParams: Attributes: past_duration (str): How far back to fetch commits (in format '1 minute', '30 days', '3 months', etc.) Example: 1 hour. - task_type (GetPulsesTaskParamsTaskType | Unset): - service_ids (list[str] | Unset): - environment_ids (list[str] | Unset): - labels (list[str] | Unset): - refs (list[str] | Unset): - sources (list[str] | Unset): - services_impacted_by_incident (bool | Unset): - environments_impacted_by_incident (bool | Unset): - post_to_incident_timeline (bool | Unset): - post_to_slack_channels (list[GetPulsesTaskParamsPostToSlackChannelsItem] | Unset): - parent_message_thread_task (GetPulsesTaskParamsParentMessageThreadTask | Unset): A hash where [id] is the task - id of the parent task that sent a message, and [name] is the name of the parent task + task_type (Union[Unset, GetPulsesTaskParamsTaskType]): + service_ids (Union[Unset, list[str]]): + environment_ids (Union[Unset, list[str]]): + labels (Union[Unset, list[str]]): + refs (Union[Unset, list[str]]): + sources (Union[Unset, list[str]]): + services_impacted_by_incident (Union[Unset, bool]): + environments_impacted_by_incident (Union[Unset, bool]): + post_to_incident_timeline (Union[Unset, bool]): + post_to_slack_channels (Union[Unset, list['GetPulsesTaskParamsPostToSlackChannelsItem']]): + parent_message_thread_task (Union[Unset, GetPulsesTaskParamsParentMessageThreadTask]): A hash where [id] is the + task id of the parent task that sent a message, and [name] is the name of the parent task """ past_duration: str - task_type: GetPulsesTaskParamsTaskType | Unset = UNSET - service_ids: list[str] | Unset = UNSET - environment_ids: list[str] | Unset = UNSET - labels: list[str] | Unset = UNSET - refs: list[str] | Unset = UNSET - sources: list[str] | Unset = UNSET - services_impacted_by_incident: bool | Unset = UNSET - environments_impacted_by_incident: bool | Unset = UNSET - post_to_incident_timeline: bool | Unset = UNSET - post_to_slack_channels: list[GetPulsesTaskParamsPostToSlackChannelsItem] | Unset = UNSET - parent_message_thread_task: GetPulsesTaskParamsParentMessageThreadTask | Unset = UNSET + task_type: Union[Unset, GetPulsesTaskParamsTaskType] = UNSET + service_ids: Union[Unset, list[str]] = UNSET + environment_ids: Union[Unset, list[str]] = UNSET + labels: Union[Unset, list[str]] = UNSET + refs: Union[Unset, list[str]] = UNSET + sources: Union[Unset, list[str]] = UNSET + services_impacted_by_incident: Union[Unset, bool] = UNSET + environments_impacted_by_incident: Union[Unset, bool] = UNSET + post_to_incident_timeline: Union[Unset, bool] = UNSET + post_to_slack_channels: Union[Unset, list["GetPulsesTaskParamsPostToSlackChannelsItem"]] = UNSET + parent_message_thread_task: Union[Unset, "GetPulsesTaskParamsParentMessageThreadTask"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - past_duration = self.past_duration - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - service_ids: list[str] | Unset = UNSET + service_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.service_ids, Unset): service_ids = self.service_ids - environment_ids: list[str] | Unset = UNSET + environment_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.environment_ids, Unset): environment_ids = self.environment_ids - labels: list[str] | Unset = UNSET + labels: Union[Unset, list[str]] = UNSET if not isinstance(self.labels, Unset): labels = self.labels - refs: list[str] | Unset = UNSET + refs: Union[Unset, list[str]] = UNSET if not isinstance(self.refs, Unset): refs = self.refs - sources: list[str] | Unset = UNSET + sources: Union[Unset, list[str]] = UNSET if not isinstance(self.sources, Unset): sources = self.sources @@ -88,14 +85,14 @@ def to_dict(self) -> dict[str, Any]: post_to_incident_timeline = self.post_to_incident_timeline - post_to_slack_channels: list[dict[str, Any]] | Unset = UNSET + post_to_slack_channels: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.post_to_slack_channels, Unset): post_to_slack_channels = [] for post_to_slack_channels_item_data in self.post_to_slack_channels: post_to_slack_channels_item = post_to_slack_channels_item_data.to_dict() post_to_slack_channels.append(post_to_slack_channels_item) - parent_message_thread_task: dict[str, Any] | Unset = UNSET + parent_message_thread_task: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.parent_message_thread_task, Unset): parent_message_thread_task = self.parent_message_thread_task.to_dict() @@ -144,7 +141,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: past_duration = d.pop("past_duration") _task_type = d.pop("task_type", UNSET) - task_type: GetPulsesTaskParamsTaskType | Unset + task_type: Union[Unset, GetPulsesTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: @@ -166,19 +163,17 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: post_to_incident_timeline = d.pop("post_to_incident_timeline", UNSET) + post_to_slack_channels = [] _post_to_slack_channels = d.pop("post_to_slack_channels", UNSET) - post_to_slack_channels: list[GetPulsesTaskParamsPostToSlackChannelsItem] | Unset = UNSET - if _post_to_slack_channels is not UNSET: - post_to_slack_channels = [] - for post_to_slack_channels_item_data in _post_to_slack_channels: - post_to_slack_channels_item = GetPulsesTaskParamsPostToSlackChannelsItem.from_dict( - post_to_slack_channels_item_data - ) + for post_to_slack_channels_item_data in _post_to_slack_channels or []: + post_to_slack_channels_item = GetPulsesTaskParamsPostToSlackChannelsItem.from_dict( + post_to_slack_channels_item_data + ) - post_to_slack_channels.append(post_to_slack_channels_item) + post_to_slack_channels.append(post_to_slack_channels_item) _parent_message_thread_task = d.pop("parent_message_thread_task", UNSET) - parent_message_thread_task: GetPulsesTaskParamsParentMessageThreadTask | Unset + parent_message_thread_task: Union[Unset, GetPulsesTaskParamsParentMessageThreadTask] if isinstance(_parent_message_thread_task, Unset): parent_message_thread_task = UNSET else: diff --git a/rootly_sdk/models/get_pulses_task_params_parent_message_thread_task.py b/rootly_sdk/models/get_pulses_task_params_parent_message_thread_task.py index 217e26b1..7903abb8 100644 --- a/rootly_sdk/models/get_pulses_task_params_parent_message_thread_task.py +++ b/rootly_sdk/models/get_pulses_task_params_parent_message_thread_task.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,12 +14,12 @@ class GetPulsesTaskParamsParentMessageThreadTask: """A hash where [id] is the task id of the parent task that sent a message, and [name] is the name of the parent task Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/get_pulses_task_params_post_to_slack_channels_item.py b/rootly_sdk/models/get_pulses_task_params_post_to_slack_channels_item.py index 022888dc..c9f3b6da 100644 --- a/rootly_sdk/models/get_pulses_task_params_post_to_slack_channels_item.py +++ b/rootly_sdk/models/get_pulses_task_params_post_to_slack_channels_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class GetPulsesTaskParamsPostToSlackChannelsItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/heartbeat.py b/rootly_sdk/models/heartbeat.py index 43738654..e1d52ac2 100644 --- a/rootly_sdk/models/heartbeat.py +++ b/rootly_sdk/models/heartbeat.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -33,14 +31,15 @@ class Heartbeat: email_address (str): Email address to receive heartbeat pings. created_at (str): Date of creation updated_at (str): Date of last update - description (None | str | Unset): The description of the heartbeat - alert_description (None | str | Unset): Description of alerts triggered when heartbeat expires. - alert_urgency_id (None | str | Unset): Urgency of alerts triggered when heartbeat expires. - owner_group_ids (list[str] | Unset): List of team IDs that own this heartbeat - ping_url (None | str | Unset): URL to receive heartbeat pings. - secret (None | str | Unset): Secret used as bearer token when pinging heartbeat. - last_pinged_at (None | str | Unset): When the heartbeat was last pinged. - expires_at (None | str | Unset): When heartbeat expires + description (Union[None, Unset, str]): The description of the heartbeat + alert_description (Union[None, Unset, str]): Description of alerts triggered when heartbeat expires. + alert_urgency_id (Union[None, Unset, str]): Urgency of alerts triggered when heartbeat expires. + owner_group_ids (Union[Unset, list[str]]): List of team IDs that own this heartbeat + ping_url (Union[None, Unset, str]): URL to receive heartbeat pings. + secret (Union[None, Unset, str]): Secret used as bearer token when pinging heartbeat. + last_pinged_at (Union[None, Unset, str]): Last persisted heartbeat ping timestamp. Accepted pings may be + coalesced for up to 30 seconds. + expires_at (Union[None, Unset, str]): Persisted expiry deadline, including up to 30 seconds of coalescing grace. """ name: str @@ -54,14 +53,14 @@ class Heartbeat: email_address: str created_at: str updated_at: str - description: None | str | Unset = UNSET - alert_description: None | str | Unset = UNSET - alert_urgency_id: None | str | Unset = UNSET - owner_group_ids: list[str] | Unset = UNSET - ping_url: None | str | Unset = UNSET - secret: None | str | Unset = UNSET - last_pinged_at: None | str | Unset = UNSET - expires_at: None | str | Unset = UNSET + description: Union[None, Unset, str] = UNSET + alert_description: Union[None, Unset, str] = UNSET + alert_urgency_id: Union[None, Unset, str] = UNSET + owner_group_ids: Union[Unset, list[str]] = UNSET + ping_url: Union[None, Unset, str] = UNSET + secret: Union[None, Unset, str] = UNSET + last_pinged_at: Union[None, Unset, str] = UNSET + expires_at: Union[None, Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -87,47 +86,47 @@ def to_dict(self) -> dict[str, Any]: updated_at = self.updated_at - description: None | str | Unset + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: description = self.description - alert_description: None | str | Unset + alert_description: Union[None, Unset, str] if isinstance(self.alert_description, Unset): alert_description = UNSET else: alert_description = self.alert_description - alert_urgency_id: None | str | Unset + alert_urgency_id: Union[None, Unset, str] if isinstance(self.alert_urgency_id, Unset): alert_urgency_id = UNSET else: alert_urgency_id = self.alert_urgency_id - owner_group_ids: list[str] | Unset = UNSET + owner_group_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.owner_group_ids, Unset): owner_group_ids = self.owner_group_ids - ping_url: None | str | Unset + ping_url: Union[None, Unset, str] if isinstance(self.ping_url, Unset): ping_url = UNSET else: ping_url = self.ping_url - secret: None | str | Unset + secret: Union[None, Unset, str] if isinstance(self.secret, Unset): secret = UNSET else: secret = self.secret - last_pinged_at: None | str | Unset + last_pinged_at: Union[None, Unset, str] if isinstance(self.last_pinged_at, Unset): last_pinged_at = UNSET else: last_pinged_at = self.last_pinged_at - expires_at: None | str | Unset + expires_at: Union[None, Unset, str] if isinstance(self.expires_at, Unset): expires_at = UNSET else: @@ -194,68 +193,68 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: updated_at = d.pop("updated_at") - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) - def _parse_alert_description(data: object) -> None | str | Unset: + def _parse_alert_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) alert_description = _parse_alert_description(d.pop("alert_description", UNSET)) - def _parse_alert_urgency_id(data: object) -> None | str | Unset: + def _parse_alert_urgency_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) alert_urgency_id = _parse_alert_urgency_id(d.pop("alert_urgency_id", UNSET)) owner_group_ids = cast(list[str], d.pop("owner_group_ids", UNSET)) - def _parse_ping_url(data: object) -> None | str | Unset: + def _parse_ping_url(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) ping_url = _parse_ping_url(d.pop("ping_url", UNSET)) - def _parse_secret(data: object) -> None | str | Unset: + def _parse_secret(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) secret = _parse_secret(d.pop("secret", UNSET)) - def _parse_last_pinged_at(data: object) -> None | str | Unset: + def _parse_last_pinged_at(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) last_pinged_at = _parse_last_pinged_at(d.pop("last_pinged_at", UNSET)) - def _parse_expires_at(data: object) -> None | str | Unset: + def _parse_expires_at(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) expires_at = _parse_expires_at(d.pop("expires_at", UNSET)) diff --git a/rootly_sdk/models/heartbeat_list.py b/rootly_sdk/models/heartbeat_list.py index 1253d2f0..f21016c6 100644 --- a/rootly_sdk/models/heartbeat_list.py +++ b/rootly_sdk/models/heartbeat_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,20 +20,19 @@ class HeartbeatList: """ Attributes: - data (list[HeartbeatListDataItem]): + data (list['HeartbeatListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[HeartbeatListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["HeartbeatListDataItem"] + links: "Links" + meta: "Meta" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) heartbeat_list = cls( data=data, diff --git a/rootly_sdk/models/heartbeat_list_data_item.py b/rootly_sdk/models/heartbeat_list_data_item.py index 05cec67e..dbcb529f 100644 --- a/rootly_sdk/models/heartbeat_list_data_item.py +++ b/rootly_sdk/models/heartbeat_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class HeartbeatListDataItem: id: str type_: HeartbeatListDataItemType - attributes: Heartbeat + attributes: "Heartbeat" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/heartbeat_response.py b/rootly_sdk/models/heartbeat_response.py index 46bc93e1..bcaca387 100644 --- a/rootly_sdk/models/heartbeat_response.py +++ b/rootly_sdk/models/heartbeat_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,18 +19,17 @@ class HeartbeatResponse: """ Attributes: data (HeartbeatResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: HeartbeatResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "HeartbeatResponseData" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = HeartbeatResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) heartbeat_response = cls( data=data, diff --git a/rootly_sdk/models/heartbeat_response_data.py b/rootly_sdk/models/heartbeat_response_data.py index 59c3a427..a8cdd593 100644 --- a/rootly_sdk/models/heartbeat_response_data.py +++ b/rootly_sdk/models/heartbeat_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class HeartbeatResponseData: id: str type_: HeartbeatResponseDataType - attributes: Heartbeat + attributes: "Heartbeat" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/http_client_task_params.py b/rootly_sdk/models/http_client_task_params.py index 69e1619d..24a105e0 100644 --- a/rootly_sdk/models/http_client_task_params.py +++ b/rootly_sdk/models/http_client_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -27,43 +25,42 @@ class HttpClientTaskParams: url (str): URL endpoint Example: https://example.com/foo.json. succeed_on_status (str): HTTP status code expected. Can be a regular expression. Eg: 200, 200|203, 20[0-3] Example: 200. - task_type (HttpClientTaskParamsTaskType | Unset): - headers (str | Unset): JSON map of HTTP headers - params (str | Unset): JSON map of HTTP query parameters - body (str | Unset): HTTP body - event_url (str | Unset): - event_message (str | Unset): - method (HttpClientTaskParamsMethod | Unset): HTTP method Default: 'GET'. - post_to_incident_timeline (bool | Unset): - post_to_slack_channels (list[HttpClientTaskParamsPostToSlackChannelsItem] | Unset): - retry_count (int | Unset): Number of times to retry on HTTP 429 responses (0-4). 0 disables retry. Default: 0. - Example: 3. - retry_wait_time (int | Unset): Seconds to wait before each retry (1-15). Retry-After header is honored when - present and <= 90s, taking the larger of retry_wait_time and the header value. Default: 1. Example: 2. + task_type (Union[Unset, HttpClientTaskParamsTaskType]): + headers (Union[Unset, str]): JSON map of HTTP headers + params (Union[Unset, str]): JSON map of HTTP query parameters + body (Union[Unset, str]): HTTP body + event_url (Union[Unset, str]): + event_message (Union[Unset, str]): + method (Union[Unset, HttpClientTaskParamsMethod]): HTTP method Default: 'GET'. + post_to_incident_timeline (Union[Unset, bool]): + post_to_slack_channels (Union[Unset, list['HttpClientTaskParamsPostToSlackChannelsItem']]): + retry_count (Union[Unset, int]): Number of times to retry on HTTP 429 responses (0-4). 0 disables retry. + Default: 0. Example: 3. + retry_wait_time (Union[Unset, int]): Seconds to wait before each retry (1-15). Retry-After header is honored + when present and <= 90s, taking the larger of retry_wait_time and the header value. Default: 1. Example: 2. """ url: str succeed_on_status: str - task_type: HttpClientTaskParamsTaskType | Unset = UNSET - headers: str | Unset = UNSET - params: str | Unset = UNSET - body: str | Unset = UNSET - event_url: str | Unset = UNSET - event_message: str | Unset = UNSET - method: HttpClientTaskParamsMethod | Unset = "GET" - post_to_incident_timeline: bool | Unset = UNSET - post_to_slack_channels: list[HttpClientTaskParamsPostToSlackChannelsItem] | Unset = UNSET - retry_count: int | Unset = 0 - retry_wait_time: int | Unset = 1 + task_type: Union[Unset, HttpClientTaskParamsTaskType] = UNSET + headers: Union[Unset, str] = UNSET + params: Union[Unset, str] = UNSET + body: Union[Unset, str] = UNSET + event_url: Union[Unset, str] = UNSET + event_message: Union[Unset, str] = UNSET + method: Union[Unset, HttpClientTaskParamsMethod] = "GET" + post_to_incident_timeline: Union[Unset, bool] = UNSET + post_to_slack_channels: Union[Unset, list["HttpClientTaskParamsPostToSlackChannelsItem"]] = UNSET + retry_count: Union[Unset, int] = 0 + retry_wait_time: Union[Unset, int] = 1 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - url = self.url succeed_on_status = self.succeed_on_status - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -77,13 +74,13 @@ def to_dict(self) -> dict[str, Any]: event_message = self.event_message - method: str | Unset = UNSET + method: Union[Unset, str] = UNSET if not isinstance(self.method, Unset): method = self.method post_to_incident_timeline = self.post_to_incident_timeline - post_to_slack_channels: list[dict[str, Any]] | Unset = UNSET + post_to_slack_channels: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.post_to_slack_channels, Unset): post_to_slack_channels = [] for post_to_slack_channels_item_data in self.post_to_slack_channels: @@ -139,7 +136,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: succeed_on_status = d.pop("succeed_on_status") _task_type = d.pop("task_type", UNSET) - task_type: HttpClientTaskParamsTaskType | Unset + task_type: Union[Unset, HttpClientTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: @@ -156,7 +153,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: event_message = d.pop("event_message", UNSET) _method = d.pop("method", UNSET) - method: HttpClientTaskParamsMethod | Unset + method: Union[Unset, HttpClientTaskParamsMethod] if isinstance(_method, Unset): method = UNSET else: @@ -164,16 +161,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: post_to_incident_timeline = d.pop("post_to_incident_timeline", UNSET) + post_to_slack_channels = [] _post_to_slack_channels = d.pop("post_to_slack_channels", UNSET) - post_to_slack_channels: list[HttpClientTaskParamsPostToSlackChannelsItem] | Unset = UNSET - if _post_to_slack_channels is not UNSET: - post_to_slack_channels = [] - for post_to_slack_channels_item_data in _post_to_slack_channels: - post_to_slack_channels_item = HttpClientTaskParamsPostToSlackChannelsItem.from_dict( - post_to_slack_channels_item_data - ) + for post_to_slack_channels_item_data in _post_to_slack_channels or []: + post_to_slack_channels_item = HttpClientTaskParamsPostToSlackChannelsItem.from_dict( + post_to_slack_channels_item_data + ) - post_to_slack_channels.append(post_to_slack_channels_item) + post_to_slack_channels.append(post_to_slack_channels_item) retry_count = d.pop("retry_count", UNSET) diff --git a/rootly_sdk/models/http_client_task_params_post_to_slack_channels_item.py b/rootly_sdk/models/http_client_task_params_post_to_slack_channels_item.py index 642bc030..5e6b391a 100644 --- a/rootly_sdk/models/http_client_task_params_post_to_slack_channels_item.py +++ b/rootly_sdk/models/http_client_task_params_post_to_slack_channels_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class HttpClientTaskParamsPostToSlackChannelsItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/import_meeting_recording.py b/rootly_sdk/models/import_meeting_recording.py index fb318d24..2535268a 100644 --- a/rootly_sdk/models/import_meeting_recording.py +++ b/rootly_sdk/models/import_meeting_recording.py @@ -1,8 +1,6 @@ -from __future__ import annotations - import datetime from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from uuid import UUID from attrs import define as _attrs_define @@ -26,17 +24,17 @@ class ImportMeetingRecording: source (ImportMeetingRecordingSource): Import source (currently only "recall_desktop_sdk") recall_recording_id (UUID): External recording UUID (required when source is recall_desktop_sdk) platform (ImportMeetingRecordingPlatform): Meeting platform - started_at (datetime.datetime | None | Unset): When the recording started - ended_at (datetime.datetime | None | Unset): When the recording ended - meeting_url (None | str | Unset): Original meeting URL + started_at (Union[None, Unset, datetime.datetime]): When the recording started + ended_at (Union[None, Unset, datetime.datetime]): When the recording ended + meeting_url (Union[None, Unset, str]): Original meeting URL """ source: ImportMeetingRecordingSource recall_recording_id: UUID platform: ImportMeetingRecordingPlatform - started_at: datetime.datetime | None | Unset = UNSET - ended_at: datetime.datetime | None | Unset = UNSET - meeting_url: None | str | Unset = UNSET + started_at: Union[None, Unset, datetime.datetime] = UNSET + ended_at: Union[None, Unset, datetime.datetime] = UNSET + meeting_url: Union[None, Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -46,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: platform: str = self.platform - started_at: None | str | Unset + started_at: Union[None, Unset, str] if isinstance(self.started_at, Unset): started_at = UNSET elif isinstance(self.started_at, datetime.datetime): @@ -54,7 +52,7 @@ def to_dict(self) -> dict[str, Any]: else: started_at = self.started_at - ended_at: None | str | Unset + ended_at: Union[None, Unset, str] if isinstance(self.ended_at, Unset): ended_at = UNSET elif isinstance(self.ended_at, datetime.datetime): @@ -62,7 +60,7 @@ def to_dict(self) -> dict[str, Any]: else: ended_at = self.ended_at - meeting_url: None | str | Unset + meeting_url: Union[None, Unset, str] if isinstance(self.meeting_url, Unset): meeting_url = UNSET else: @@ -95,7 +93,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: platform = check_import_meeting_recording_platform(d.pop("platform")) - def _parse_started_at(data: object) -> datetime.datetime | None | Unset: + def _parse_started_at(data: object) -> Union[None, Unset, datetime.datetime]: if data is None: return data if isinstance(data, Unset): @@ -106,13 +104,13 @@ def _parse_started_at(data: object) -> datetime.datetime | None | Unset: started_at_type_0 = isoparse(data) return started_at_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(datetime.datetime | None | Unset, data) + return cast(Union[None, Unset, datetime.datetime], data) started_at = _parse_started_at(d.pop("started_at", UNSET)) - def _parse_ended_at(data: object) -> datetime.datetime | None | Unset: + def _parse_ended_at(data: object) -> Union[None, Unset, datetime.datetime]: if data is None: return data if isinstance(data, Unset): @@ -123,18 +121,18 @@ def _parse_ended_at(data: object) -> datetime.datetime | None | Unset: ended_at_type_0 = isoparse(data) return ended_at_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(datetime.datetime | None | Unset, data) + return cast(Union[None, Unset, datetime.datetime], data) ended_at = _parse_ended_at(d.pop("ended_at", UNSET)) - def _parse_meeting_url(data: object) -> None | str | Unset: + def _parse_meeting_url(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) meeting_url = _parse_meeting_url(d.pop("meeting_url", UNSET)) diff --git a/rootly_sdk/models/in_triage_incident.py b/rootly_sdk/models/in_triage_incident.py index bd1a66ca..e6689084 100644 --- a/rootly_sdk/models/in_triage_incident.py +++ b/rootly_sdk/models/in_triage_incident.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class InTriageIncident: data (InTriageIncidentData): """ - data: InTriageIncidentData + data: "InTriageIncidentData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/in_triage_incident_data.py b/rootly_sdk/models/in_triage_incident_data.py index 7b9e4f40..3ff763ca 100644 --- a/rootly_sdk/models/in_triage_incident_data.py +++ b/rootly_sdk/models/in_triage_incident_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/incident.py b/rootly_sdk/models/incident.py index 408a7e53..af66f397 100644 --- a/rootly_sdk/models/incident.py +++ b/rootly_sdk/models/incident.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -42,279 +40,281 @@ class Incident: title (str): The title of the incident created_at (str): Date of creation updated_at (str): Date of last update - id (str | Unset): Unique ID of the incident - sequential_id (int | Unset): Sequential ID of the incident - kind (str | Unset): The kind of the incident - slug (str | Unset): The slug of the incident - parent_incident_id (None | str | Unset): ID of parent incident - duplicate_incident_id (None | str | Unset): ID of duplicated incident - summary (None | str | Unset): The summary of the incident - private (bool | Unset): The visibility of the incident Default: False. - source (None | str | Unset): The source of the incident - status (None | str | Unset): The status of the incident - url (None | str | Unset): The url to the incident - short_url (None | str | Unset): The short url to the incident - public_title (None | str | Unset): The public title of the incident - user (IncidentUserType0 | None | Unset): The user who created the incident - severity (SeverityResponse | Unset): - environments (list[EnvironmentResponse] | None | Unset): The Environments of the incident - incident_types (list[IncidentTypeResponse] | None | Unset): The Incident Types of the incident - services (list[ServiceResponse] | None | Unset): The Services of the incident - functionalities (list[FunctionalityResponse] | None | Unset): The Functionalities of the incident - groups (list[TeamResponse] | None | Unset): The Teams of to the incident - labels (IncidentLabelsType0 | None | Unset): Labels to attach to the incidents. eg: {"platform":"osx", + id (Union[Unset, str]): Unique ID of the incident + sequential_id (Union[Unset, int]): Sequential ID of the incident + kind (Union[Unset, str]): The kind of the incident + slug (Union[Unset, str]): The slug of the incident + parent_incident_id (Union[None, Unset, str]): ID of parent incident + duplicate_incident_id (Union[None, Unset, str]): ID of duplicated incident + summary (Union[None, Unset, str]): The summary of the incident + private (Union[Unset, bool]): The visibility of the incident Default: False. + source (Union[None, Unset, str]): The source of the incident + status (Union[None, Unset, str]): The status of the incident + url (Union[None, Unset, str]): The url to the incident + short_url (Union[None, Unset, str]): The short url to the incident + public_title (Union[None, Unset, str]): The public title of the incident + user (Union['IncidentUserType0', None, Unset]): The user who created the incident + severity (Union[Unset, SeverityResponse]): + environments (Union[None, Unset, list['EnvironmentResponse']]): The Environments of the incident + incident_types (Union[None, Unset, list['IncidentTypeResponse']]): The Incident Types of the incident + services (Union[None, Unset, list['ServiceResponse']]): The Services of the incident + functionalities (Union[None, Unset, list['FunctionalityResponse']]): The Functionalities of the incident + groups (Union[None, Unset, list['TeamResponse']]): The Teams of to the incident + labels (Union['IncidentLabelsType0', None, Unset]): Labels to attach to the incidents. eg: {"platform":"osx", "version": "1.29"} - slack_channel_id (None | str | Unset): Slack channel id - slack_channel_name (None | str | Unset): Slack channel name - slack_channel_url (None | str | Unset): Slack channel url - slack_channel_short_url (None | str | Unset): Slack channel short url - slack_channel_deep_link (None | str | Unset): Slack channel deep link - slack_channel_archived (bool | None | Unset): Whether the Slack channel is archived - slack_last_message_ts (None | str | Unset): Timestamp of last Slack message - zoom_meeting_id (None | str | Unset): Zoom meeting ID - zoom_meeting_start_url (None | str | Unset): Zoom meeting start URL - zoom_meeting_join_url (None | str | Unset): Zoom meeting join URL - zoom_meeting_password (None | str | Unset): Zoom meeting password - zoom_meeting_pstn_password (None | str | Unset): Zoom meeting PSTN password - zoom_meeting_h323_password (None | str | Unset): Zoom meeting H323 password - zoom_meeting_global_dial_in_numbers (list[IncidentZoomMeetingGlobalDialInNumbersType0Item] | None | Unset): Zoom - meeting global dial-in numbers - google_drive_id (None | str | Unset): Google Drive document ID - google_drive_parent_id (None | str | Unset): Google Drive parent folder ID - google_drive_url (None | str | Unset): Google Drive URL - google_meeting_id (None | str | Unset): Google meeting ID - google_meeting_url (None | str | Unset): Google meeting URL - microsoft_teams_meeting_id (None | str | Unset): Microsoft Teams meeting ID - microsoft_teams_meeting_url (None | str | Unset): Microsoft Teams meeting URL - microsoft_teams_channel_id (None | str | Unset): Microsoft Teams channel ID - microsoft_teams_channel_name (None | str | Unset): Microsoft Teams channel name - microsoft_teams_channel_url (None | str | Unset): Microsoft Teams channel URL - microsoft_teams_channel_short_url (None | str | Unset): Microsoft Teams channel short URL - microsoft_teams_chat_id (None | str | Unset): Microsoft Teams chat ID - microsoft_teams_chat_url (None | str | Unset): Microsoft Teams chat URL - microsoft_teams_team_id (None | str | Unset): Microsoft Teams team ID - google_chat_space_id (None | str | Unset): Google Chat space ID - google_chat_space_name (None | str | Unset): Google Chat space name - google_chat_space_url (None | str | Unset): Google Chat space URL - google_chat_space_short_url (None | str | Unset): Google Chat space short URL - google_chat_space_archived (bool | None | Unset): Whether the Google Chat space is archived - google_chat_space_domain_id (None | str | Unset): Google Chat space domain ID - webex_meeting_id (None | str | Unset): Webex meeting ID - webex_meeting_url (None | str | Unset): Webex meeting URL - jira_issue_key (None | str | Unset): Jira issue key - jira_issue_id (None | str | Unset): Jira issue ID - jira_issue_url (None | str | Unset): Jira issue URL - github_issue_id (None | str | Unset): GitHub issue ID - github_issue_url (None | str | Unset): GitHub issue URL - gitlab_issue_id (None | str | Unset): GitLab issue ID - gitlab_issue_url (None | str | Unset): GitLab issue URL - asana_task_id (None | str | Unset): Asana task ID - asana_task_url (None | str | Unset): Asana task URL - linear_issue_id (None | str | Unset): Linear issue ID - linear_issue_url (None | str | Unset): Linear issue URL - trello_card_id (None | str | Unset): Trello card ID - trello_card_url (None | str | Unset): Trello card URL - zendesk_ticket_id (None | str | Unset): Zendesk ticket ID - zendesk_ticket_url (None | str | Unset): Zendesk ticket URL - pagerduty_incident_id (None | str | Unset): PagerDuty incident ID - pagerduty_incident_number (None | str | Unset): PagerDuty incident number - pagerduty_incident_url (None | str | Unset): PagerDuty incident URL - opsgenie_incident_id (None | str | Unset): Opsgenie incident ID - opsgenie_incident_url (None | str | Unset): Opsgenie incident URL - opsgenie_alert_id (None | str | Unset): Opsgenie alert ID - opsgenie_alert_url (None | str | Unset): Opsgenie alert URL - service_now_incident_id (None | str | Unset): ServiceNow incident ID - service_now_incident_key (None | str | Unset): ServiceNow incident key - service_now_incident_url (None | str | Unset): ServiceNow incident URL - mattermost_channel_id (None | str | Unset): Mattermost channel ID - mattermost_channel_name (None | str | Unset): Mattermost channel name - mattermost_channel_url (None | str | Unset): Mattermost channel URL - confluence_page_id (None | str | Unset): Confluence page ID - confluence_page_url (None | str | Unset): Confluence page URL - datadog_notebook_id (None | str | Unset): Datadog notebook ID - datadog_notebook_url (None | str | Unset): Datadog notebook URL - shortcut_story_id (None | str | Unset): Shortcut story ID - shortcut_story_url (None | str | Unset): Shortcut story URL - shortcut_task_id (None | str | Unset): Shortcut task ID - shortcut_task_url (None | str | Unset): Shortcut task URL - motion_task_id (None | str | Unset): Motion task ID - motion_task_url (None | str | Unset): Motion task URL - clickup_task_id (None | str | Unset): ClickUp task ID - clickup_task_url (None | str | Unset): ClickUp task URL - victor_ops_incident_id (None | str | Unset): VictorOps incident ID - victor_ops_incident_url (None | str | Unset): VictorOps incident URL - quip_page_id (None | str | Unset): Quip page ID - quip_page_url (None | str | Unset): Quip page URL - sharepoint_page_id (None | str | Unset): SharePoint page ID - sharepoint_page_url (None | str | Unset): SharePoint page URL - airtable_base_key (None | str | Unset): Airtable base key - airtable_table_name (None | str | Unset): Airtable table name - airtable_record_id (None | str | Unset): Airtable record ID - airtable_record_url (None | str | Unset): Airtable record URL - freshservice_ticket_id (None | str | Unset): Freshservice ticket ID - freshservice_ticket_url (None | str | Unset): Freshservice ticket URL - freshservice_task_id (None | str | Unset): Freshservice task ID - freshservice_task_url (None | str | Unset): Freshservice task URL - mitigation_message (None | str | Unset): How was the incident mitigated? - resolution_message (None | str | Unset): How was the incident resolved? - cancellation_message (None | str | Unset): Why was the incident cancelled? - scheduled_for (None | str | Unset): Date of when the maintenance begins - scheduled_until (None | str | Unset): Date of when the maintenance ends - muted_service_ids (list[str] | None | Unset): The Service IDs to mute alerts for during maintenance. Alerts for - these services will still be triggered and attached to the incident, but won't page responders. - retrospective_progress_status (IncidentRetrospectiveProgressStatus | Unset): The status of the retrospective - progress - in_triage_by (IncidentInTriageByType0 | None | Unset): The user who triaged the incident - started_by (IncidentStartedByType0 | None | Unset): The user who started the incident - mitigated_by (IncidentMitigatedByType0 | None | Unset): The user who mitigated the incident - resolved_by (IncidentResolvedByType0 | None | Unset): The user who resolved the incident - closed_by (IncidentClosedByType0 | None | Unset): The user who closed the incident - cancelled_by (IncidentCancelledByType0 | None | Unset): The user who cancelled the incident - in_triage_at (None | str | Unset): Date of triage - started_at (None | str | Unset): Date of start - detected_at (None | str | Unset): Date of detection - acknowledged_at (None | str | Unset): Date of acknowledgment - mitigated_at (None | str | Unset): Date of mitigation - resolved_at (None | str | Unset): Date of resolution - closed_at (None | str | Unset): Date of closure - cancelled_at (None | str | Unset): Date of cancellation + slack_channel_id (Union[None, Unset, str]): Slack channel id + slack_channel_name (Union[None, Unset, str]): Slack channel name + slack_channel_url (Union[None, Unset, str]): Slack channel url + slack_channel_short_url (Union[None, Unset, str]): Slack channel short url + slack_channel_deep_link (Union[None, Unset, str]): Slack channel deep link + slack_channel_archived (Union[None, Unset, bool]): Whether the Slack channel is archived + slack_last_message_ts (Union[None, Unset, str]): Timestamp of last Slack message + zoom_meeting_id (Union[None, Unset, str]): Zoom meeting ID + zoom_meeting_start_url (Union[None, Unset, str]): Zoom meeting start URL + zoom_meeting_join_url (Union[None, Unset, str]): Zoom meeting join URL + zoom_meeting_password (Union[None, Unset, str]): Zoom meeting password + zoom_meeting_pstn_password (Union[None, Unset, str]): Zoom meeting PSTN password + zoom_meeting_h323_password (Union[None, Unset, str]): Zoom meeting H323 password + zoom_meeting_global_dial_in_numbers (Union[None, Unset, + list['IncidentZoomMeetingGlobalDialInNumbersType0Item']]): Zoom meeting global dial-in numbers + google_drive_id (Union[None, Unset, str]): Google Drive document ID + google_drive_parent_id (Union[None, Unset, str]): Google Drive parent folder ID + google_drive_url (Union[None, Unset, str]): Google Drive URL + google_meeting_id (Union[None, Unset, str]): Google meeting ID + google_meeting_url (Union[None, Unset, str]): Google meeting URL + microsoft_teams_meeting_id (Union[None, Unset, str]): Microsoft Teams meeting ID + microsoft_teams_meeting_url (Union[None, Unset, str]): Microsoft Teams meeting URL + microsoft_teams_channel_id (Union[None, Unset, str]): Microsoft Teams channel ID + microsoft_teams_channel_name (Union[None, Unset, str]): Microsoft Teams channel name + microsoft_teams_channel_url (Union[None, Unset, str]): Microsoft Teams channel URL + microsoft_teams_channel_short_url (Union[None, Unset, str]): Microsoft Teams channel short URL + microsoft_teams_chat_id (Union[None, Unset, str]): Microsoft Teams chat ID + microsoft_teams_chat_url (Union[None, Unset, str]): Microsoft Teams chat URL + microsoft_teams_team_id (Union[None, Unset, str]): Microsoft Teams team ID + google_chat_space_id (Union[None, Unset, str]): Google Chat space ID + google_chat_space_name (Union[None, Unset, str]): Google Chat space name + google_chat_space_url (Union[None, Unset, str]): Google Chat space URL + google_chat_space_short_url (Union[None, Unset, str]): Google Chat space short URL + google_chat_space_archived (Union[None, Unset, bool]): Whether the Google Chat space is archived + google_chat_space_domain_id (Union[None, Unset, str]): Google Chat space domain ID + webex_meeting_id (Union[None, Unset, str]): Webex meeting ID + webex_meeting_url (Union[None, Unset, str]): Webex meeting URL + jira_issue_key (Union[None, Unset, str]): Jira issue key + jira_issue_id (Union[None, Unset, str]): Jira issue ID + jira_issue_url (Union[None, Unset, str]): Jira issue URL + github_issue_id (Union[None, Unset, str]): GitHub issue ID + github_issue_url (Union[None, Unset, str]): GitHub issue URL + gitlab_issue_id (Union[None, Unset, str]): GitLab issue ID + gitlab_issue_url (Union[None, Unset, str]): GitLab issue URL + asana_task_id (Union[None, Unset, str]): Asana task ID + asana_task_url (Union[None, Unset, str]): Asana task URL + linear_issue_id (Union[None, Unset, str]): Linear issue ID + linear_issue_url (Union[None, Unset, str]): Linear issue URL + trello_card_id (Union[None, Unset, str]): Trello card ID + trello_card_url (Union[None, Unset, str]): Trello card URL + zendesk_ticket_id (Union[None, Unset, str]): Zendesk ticket ID + zendesk_ticket_url (Union[None, Unset, str]): Zendesk ticket URL + pagerduty_incident_id (Union[None, Unset, str]): PagerDuty incident ID + pagerduty_incident_number (Union[None, Unset, str]): PagerDuty incident number + pagerduty_incident_url (Union[None, Unset, str]): PagerDuty incident URL + opsgenie_incident_id (Union[None, Unset, str]): Opsgenie incident ID + opsgenie_incident_url (Union[None, Unset, str]): Opsgenie incident URL + opsgenie_alert_id (Union[None, Unset, str]): Opsgenie alert ID + opsgenie_alert_url (Union[None, Unset, str]): Opsgenie alert URL + service_now_incident_id (Union[None, Unset, str]): ServiceNow incident ID + service_now_incident_key (Union[None, Unset, str]): ServiceNow incident key + service_now_incident_url (Union[None, Unset, str]): ServiceNow incident URL + mattermost_channel_id (Union[None, Unset, str]): Mattermost channel ID + mattermost_channel_name (Union[None, Unset, str]): Mattermost channel name + mattermost_channel_url (Union[None, Unset, str]): Mattermost channel URL + confluence_page_id (Union[None, Unset, str]): Confluence page ID + confluence_page_url (Union[None, Unset, str]): Confluence page URL + datadog_notebook_id (Union[None, Unset, str]): Datadog notebook ID + datadog_notebook_url (Union[None, Unset, str]): Datadog notebook URL + shortcut_story_id (Union[None, Unset, str]): Shortcut story ID + shortcut_story_url (Union[None, Unset, str]): Shortcut story URL + shortcut_task_id (Union[None, Unset, str]): Shortcut task ID + shortcut_task_url (Union[None, Unset, str]): Shortcut task URL + motion_task_id (Union[None, Unset, str]): Motion task ID + motion_task_url (Union[None, Unset, str]): Motion task URL + clickup_task_id (Union[None, Unset, str]): ClickUp task ID + clickup_task_url (Union[None, Unset, str]): ClickUp task URL + victor_ops_incident_id (Union[None, Unset, str]): VictorOps incident ID + victor_ops_incident_url (Union[None, Unset, str]): VictorOps incident URL + quip_page_id (Union[None, Unset, str]): Quip page ID + quip_page_url (Union[None, Unset, str]): Quip page URL + sharepoint_page_id (Union[None, Unset, str]): SharePoint page ID + sharepoint_page_url (Union[None, Unset, str]): SharePoint page URL + airtable_base_key (Union[None, Unset, str]): Airtable base key + airtable_table_name (Union[None, Unset, str]): Airtable table name + airtable_record_id (Union[None, Unset, str]): Airtable record ID + airtable_record_url (Union[None, Unset, str]): Airtable record URL + freshservice_ticket_id (Union[None, Unset, str]): Freshservice ticket ID + freshservice_ticket_url (Union[None, Unset, str]): Freshservice ticket URL + freshservice_task_id (Union[None, Unset, str]): Freshservice task ID + freshservice_task_url (Union[None, Unset, str]): Freshservice task URL + mitigation_message (Union[None, Unset, str]): How was the incident mitigated? + resolution_message (Union[None, Unset, str]): How was the incident resolved? + cancellation_message (Union[None, Unset, str]): Why was the incident cancelled? + scheduled_for (Union[None, Unset, str]): Date of when the maintenance begins + scheduled_until (Union[None, Unset, str]): Date of when the maintenance ends + muted_service_ids (Union[None, Unset, list[str]]): The Service IDs to mute alerts for during maintenance. Alerts + for these services will still be triggered and attached to the incident, but won't page responders. + retrospective_progress_status (Union[Unset, IncidentRetrospectiveProgressStatus]): The status of the + retrospective progress + in_triage_by (Union['IncidentInTriageByType0', None, Unset]): The user who triaged the incident + started_by (Union['IncidentStartedByType0', None, Unset]): The user who started the incident + mitigated_by (Union['IncidentMitigatedByType0', None, Unset]): The user who mitigated the incident + resolved_by (Union['IncidentResolvedByType0', None, Unset]): The user who resolved the incident + closed_by (Union['IncidentClosedByType0', None, Unset]): The user who closed the incident + cancelled_by (Union['IncidentCancelledByType0', None, Unset]): The user who cancelled the incident + in_triage_at (Union[None, Unset, str]): Date of triage + started_at (Union[None, Unset, str]): Date of start + detected_at (Union[None, Unset, str]): Date of detection + acknowledged_at (Union[None, Unset, str]): Date of acknowledgment + mitigated_at (Union[None, Unset, str]): Date of mitigation + resolved_at (Union[None, Unset, str]): Date of resolution + closed_at (Union[None, Unset, str]): Date of closure + cancelled_at (Union[None, Unset, str]): Date of cancellation """ title: str created_at: str updated_at: str - id: str | Unset = UNSET - sequential_id: int | Unset = UNSET - kind: str | Unset = UNSET - slug: str | Unset = UNSET - parent_incident_id: None | str | Unset = UNSET - duplicate_incident_id: None | str | Unset = UNSET - summary: None | str | Unset = UNSET - private: bool | Unset = False - source: None | str | Unset = UNSET - status: None | str | Unset = UNSET - url: None | str | Unset = UNSET - short_url: None | str | Unset = UNSET - public_title: None | str | Unset = UNSET - user: IncidentUserType0 | None | Unset = UNSET - severity: SeverityResponse | Unset = UNSET - environments: list[EnvironmentResponse] | None | Unset = UNSET - incident_types: list[IncidentTypeResponse] | None | Unset = UNSET - services: list[ServiceResponse] | None | Unset = UNSET - functionalities: list[FunctionalityResponse] | None | Unset = UNSET - groups: list[TeamResponse] | None | Unset = UNSET - labels: IncidentLabelsType0 | None | Unset = UNSET - slack_channel_id: None | str | Unset = UNSET - slack_channel_name: None | str | Unset = UNSET - slack_channel_url: None | str | Unset = UNSET - slack_channel_short_url: None | str | Unset = UNSET - slack_channel_deep_link: None | str | Unset = UNSET - slack_channel_archived: bool | None | Unset = UNSET - slack_last_message_ts: None | str | Unset = UNSET - zoom_meeting_id: None | str | Unset = UNSET - zoom_meeting_start_url: None | str | Unset = UNSET - zoom_meeting_join_url: None | str | Unset = UNSET - zoom_meeting_password: None | str | Unset = UNSET - zoom_meeting_pstn_password: None | str | Unset = UNSET - zoom_meeting_h323_password: None | str | Unset = UNSET - zoom_meeting_global_dial_in_numbers: list[IncidentZoomMeetingGlobalDialInNumbersType0Item] | None | Unset = UNSET - google_drive_id: None | str | Unset = UNSET - google_drive_parent_id: None | str | Unset = UNSET - google_drive_url: None | str | Unset = UNSET - google_meeting_id: None | str | Unset = UNSET - google_meeting_url: None | str | Unset = UNSET - microsoft_teams_meeting_id: None | str | Unset = UNSET - microsoft_teams_meeting_url: None | str | Unset = UNSET - microsoft_teams_channel_id: None | str | Unset = UNSET - microsoft_teams_channel_name: None | str | Unset = UNSET - microsoft_teams_channel_url: None | str | Unset = UNSET - microsoft_teams_channel_short_url: None | str | Unset = UNSET - microsoft_teams_chat_id: None | str | Unset = UNSET - microsoft_teams_chat_url: None | str | Unset = UNSET - microsoft_teams_team_id: None | str | Unset = UNSET - google_chat_space_id: None | str | Unset = UNSET - google_chat_space_name: None | str | Unset = UNSET - google_chat_space_url: None | str | Unset = UNSET - google_chat_space_short_url: None | str | Unset = UNSET - google_chat_space_archived: bool | None | Unset = UNSET - google_chat_space_domain_id: None | str | Unset = UNSET - webex_meeting_id: None | str | Unset = UNSET - webex_meeting_url: None | str | Unset = UNSET - jira_issue_key: None | str | Unset = UNSET - jira_issue_id: None | str | Unset = UNSET - jira_issue_url: None | str | Unset = UNSET - github_issue_id: None | str | Unset = UNSET - github_issue_url: None | str | Unset = UNSET - gitlab_issue_id: None | str | Unset = UNSET - gitlab_issue_url: None | str | Unset = UNSET - asana_task_id: None | str | Unset = UNSET - asana_task_url: None | str | Unset = UNSET - linear_issue_id: None | str | Unset = UNSET - linear_issue_url: None | str | Unset = UNSET - trello_card_id: None | str | Unset = UNSET - trello_card_url: None | str | Unset = UNSET - zendesk_ticket_id: None | str | Unset = UNSET - zendesk_ticket_url: None | str | Unset = UNSET - pagerduty_incident_id: None | str | Unset = UNSET - pagerduty_incident_number: None | str | Unset = UNSET - pagerduty_incident_url: None | str | Unset = UNSET - opsgenie_incident_id: None | str | Unset = UNSET - opsgenie_incident_url: None | str | Unset = UNSET - opsgenie_alert_id: None | str | Unset = UNSET - opsgenie_alert_url: None | str | Unset = UNSET - service_now_incident_id: None | str | Unset = UNSET - service_now_incident_key: None | str | Unset = UNSET - service_now_incident_url: None | str | Unset = UNSET - mattermost_channel_id: None | str | Unset = UNSET - mattermost_channel_name: None | str | Unset = UNSET - mattermost_channel_url: None | str | Unset = UNSET - confluence_page_id: None | str | Unset = UNSET - confluence_page_url: None | str | Unset = UNSET - datadog_notebook_id: None | str | Unset = UNSET - datadog_notebook_url: None | str | Unset = UNSET - shortcut_story_id: None | str | Unset = UNSET - shortcut_story_url: None | str | Unset = UNSET - shortcut_task_id: None | str | Unset = UNSET - shortcut_task_url: None | str | Unset = UNSET - motion_task_id: None | str | Unset = UNSET - motion_task_url: None | str | Unset = UNSET - clickup_task_id: None | str | Unset = UNSET - clickup_task_url: None | str | Unset = UNSET - victor_ops_incident_id: None | str | Unset = UNSET - victor_ops_incident_url: None | str | Unset = UNSET - quip_page_id: None | str | Unset = UNSET - quip_page_url: None | str | Unset = UNSET - sharepoint_page_id: None | str | Unset = UNSET - sharepoint_page_url: None | str | Unset = UNSET - airtable_base_key: None | str | Unset = UNSET - airtable_table_name: None | str | Unset = UNSET - airtable_record_id: None | str | Unset = UNSET - airtable_record_url: None | str | Unset = UNSET - freshservice_ticket_id: None | str | Unset = UNSET - freshservice_ticket_url: None | str | Unset = UNSET - freshservice_task_id: None | str | Unset = UNSET - freshservice_task_url: None | str | Unset = UNSET - mitigation_message: None | str | Unset = UNSET - resolution_message: None | str | Unset = UNSET - cancellation_message: None | str | Unset = UNSET - scheduled_for: None | str | Unset = UNSET - scheduled_until: None | str | Unset = UNSET - muted_service_ids: list[str] | None | Unset = UNSET - retrospective_progress_status: IncidentRetrospectiveProgressStatus | Unset = UNSET - in_triage_by: IncidentInTriageByType0 | None | Unset = UNSET - started_by: IncidentStartedByType0 | None | Unset = UNSET - mitigated_by: IncidentMitigatedByType0 | None | Unset = UNSET - resolved_by: IncidentResolvedByType0 | None | Unset = UNSET - closed_by: IncidentClosedByType0 | None | Unset = UNSET - cancelled_by: IncidentCancelledByType0 | None | Unset = UNSET - in_triage_at: None | str | Unset = UNSET - started_at: None | str | Unset = UNSET - detected_at: None | str | Unset = UNSET - acknowledged_at: None | str | Unset = UNSET - mitigated_at: None | str | Unset = UNSET - resolved_at: None | str | Unset = UNSET - closed_at: None | str | Unset = UNSET - cancelled_at: None | str | Unset = UNSET + id: Union[Unset, str] = UNSET + sequential_id: Union[Unset, int] = UNSET + kind: Union[Unset, str] = UNSET + slug: Union[Unset, str] = UNSET + parent_incident_id: Union[None, Unset, str] = UNSET + duplicate_incident_id: Union[None, Unset, str] = UNSET + summary: Union[None, Unset, str] = UNSET + private: Union[Unset, bool] = False + source: Union[None, Unset, str] = UNSET + status: Union[None, Unset, str] = UNSET + url: Union[None, Unset, str] = UNSET + short_url: Union[None, Unset, str] = UNSET + public_title: Union[None, Unset, str] = UNSET + user: Union["IncidentUserType0", None, Unset] = UNSET + severity: Union[Unset, "SeverityResponse"] = UNSET + environments: Union[None, Unset, list["EnvironmentResponse"]] = UNSET + incident_types: Union[None, Unset, list["IncidentTypeResponse"]] = UNSET + services: Union[None, Unset, list["ServiceResponse"]] = UNSET + functionalities: Union[None, Unset, list["FunctionalityResponse"]] = UNSET + groups: Union[None, Unset, list["TeamResponse"]] = UNSET + labels: Union["IncidentLabelsType0", None, Unset] = UNSET + slack_channel_id: Union[None, Unset, str] = UNSET + slack_channel_name: Union[None, Unset, str] = UNSET + slack_channel_url: Union[None, Unset, str] = UNSET + slack_channel_short_url: Union[None, Unset, str] = UNSET + slack_channel_deep_link: Union[None, Unset, str] = UNSET + slack_channel_archived: Union[None, Unset, bool] = UNSET + slack_last_message_ts: Union[None, Unset, str] = UNSET + zoom_meeting_id: Union[None, Unset, str] = UNSET + zoom_meeting_start_url: Union[None, Unset, str] = UNSET + zoom_meeting_join_url: Union[None, Unset, str] = UNSET + zoom_meeting_password: Union[None, Unset, str] = UNSET + zoom_meeting_pstn_password: Union[None, Unset, str] = UNSET + zoom_meeting_h323_password: Union[None, Unset, str] = UNSET + zoom_meeting_global_dial_in_numbers: Union[None, Unset, list["IncidentZoomMeetingGlobalDialInNumbersType0Item"]] = ( + UNSET + ) + google_drive_id: Union[None, Unset, str] = UNSET + google_drive_parent_id: Union[None, Unset, str] = UNSET + google_drive_url: Union[None, Unset, str] = UNSET + google_meeting_id: Union[None, Unset, str] = UNSET + google_meeting_url: Union[None, Unset, str] = UNSET + microsoft_teams_meeting_id: Union[None, Unset, str] = UNSET + microsoft_teams_meeting_url: Union[None, Unset, str] = UNSET + microsoft_teams_channel_id: Union[None, Unset, str] = UNSET + microsoft_teams_channel_name: Union[None, Unset, str] = UNSET + microsoft_teams_channel_url: Union[None, Unset, str] = UNSET + microsoft_teams_channel_short_url: Union[None, Unset, str] = UNSET + microsoft_teams_chat_id: Union[None, Unset, str] = UNSET + microsoft_teams_chat_url: Union[None, Unset, str] = UNSET + microsoft_teams_team_id: Union[None, Unset, str] = UNSET + google_chat_space_id: Union[None, Unset, str] = UNSET + google_chat_space_name: Union[None, Unset, str] = UNSET + google_chat_space_url: Union[None, Unset, str] = UNSET + google_chat_space_short_url: Union[None, Unset, str] = UNSET + google_chat_space_archived: Union[None, Unset, bool] = UNSET + google_chat_space_domain_id: Union[None, Unset, str] = UNSET + webex_meeting_id: Union[None, Unset, str] = UNSET + webex_meeting_url: Union[None, Unset, str] = UNSET + jira_issue_key: Union[None, Unset, str] = UNSET + jira_issue_id: Union[None, Unset, str] = UNSET + jira_issue_url: Union[None, Unset, str] = UNSET + github_issue_id: Union[None, Unset, str] = UNSET + github_issue_url: Union[None, Unset, str] = UNSET + gitlab_issue_id: Union[None, Unset, str] = UNSET + gitlab_issue_url: Union[None, Unset, str] = UNSET + asana_task_id: Union[None, Unset, str] = UNSET + asana_task_url: Union[None, Unset, str] = UNSET + linear_issue_id: Union[None, Unset, str] = UNSET + linear_issue_url: Union[None, Unset, str] = UNSET + trello_card_id: Union[None, Unset, str] = UNSET + trello_card_url: Union[None, Unset, str] = UNSET + zendesk_ticket_id: Union[None, Unset, str] = UNSET + zendesk_ticket_url: Union[None, Unset, str] = UNSET + pagerduty_incident_id: Union[None, Unset, str] = UNSET + pagerduty_incident_number: Union[None, Unset, str] = UNSET + pagerduty_incident_url: Union[None, Unset, str] = UNSET + opsgenie_incident_id: Union[None, Unset, str] = UNSET + opsgenie_incident_url: Union[None, Unset, str] = UNSET + opsgenie_alert_id: Union[None, Unset, str] = UNSET + opsgenie_alert_url: Union[None, Unset, str] = UNSET + service_now_incident_id: Union[None, Unset, str] = UNSET + service_now_incident_key: Union[None, Unset, str] = UNSET + service_now_incident_url: Union[None, Unset, str] = UNSET + mattermost_channel_id: Union[None, Unset, str] = UNSET + mattermost_channel_name: Union[None, Unset, str] = UNSET + mattermost_channel_url: Union[None, Unset, str] = UNSET + confluence_page_id: Union[None, Unset, str] = UNSET + confluence_page_url: Union[None, Unset, str] = UNSET + datadog_notebook_id: Union[None, Unset, str] = UNSET + datadog_notebook_url: Union[None, Unset, str] = UNSET + shortcut_story_id: Union[None, Unset, str] = UNSET + shortcut_story_url: Union[None, Unset, str] = UNSET + shortcut_task_id: Union[None, Unset, str] = UNSET + shortcut_task_url: Union[None, Unset, str] = UNSET + motion_task_id: Union[None, Unset, str] = UNSET + motion_task_url: Union[None, Unset, str] = UNSET + clickup_task_id: Union[None, Unset, str] = UNSET + clickup_task_url: Union[None, Unset, str] = UNSET + victor_ops_incident_id: Union[None, Unset, str] = UNSET + victor_ops_incident_url: Union[None, Unset, str] = UNSET + quip_page_id: Union[None, Unset, str] = UNSET + quip_page_url: Union[None, Unset, str] = UNSET + sharepoint_page_id: Union[None, Unset, str] = UNSET + sharepoint_page_url: Union[None, Unset, str] = UNSET + airtable_base_key: Union[None, Unset, str] = UNSET + airtable_table_name: Union[None, Unset, str] = UNSET + airtable_record_id: Union[None, Unset, str] = UNSET + airtable_record_url: Union[None, Unset, str] = UNSET + freshservice_ticket_id: Union[None, Unset, str] = UNSET + freshservice_ticket_url: Union[None, Unset, str] = UNSET + freshservice_task_id: Union[None, Unset, str] = UNSET + freshservice_task_url: Union[None, Unset, str] = UNSET + mitigation_message: Union[None, Unset, str] = UNSET + resolution_message: Union[None, Unset, str] = UNSET + cancellation_message: Union[None, Unset, str] = UNSET + scheduled_for: Union[None, Unset, str] = UNSET + scheduled_until: Union[None, Unset, str] = UNSET + muted_service_ids: Union[None, Unset, list[str]] = UNSET + retrospective_progress_status: Union[Unset, IncidentRetrospectiveProgressStatus] = UNSET + in_triage_by: Union["IncidentInTriageByType0", None, Unset] = UNSET + started_by: Union["IncidentStartedByType0", None, Unset] = UNSET + mitigated_by: Union["IncidentMitigatedByType0", None, Unset] = UNSET + resolved_by: Union["IncidentResolvedByType0", None, Unset] = UNSET + closed_by: Union["IncidentClosedByType0", None, Unset] = UNSET + cancelled_by: Union["IncidentCancelledByType0", None, Unset] = UNSET + in_triage_at: Union[None, Unset, str] = UNSET + started_at: Union[None, Unset, str] = UNSET + detected_at: Union[None, Unset, str] = UNSET + acknowledged_at: Union[None, Unset, str] = UNSET + mitigated_at: Union[None, Unset, str] = UNSET + resolved_at: Union[None, Unset, str] = UNSET + closed_at: Union[None, Unset, str] = UNSET + cancelled_at: Union[None, Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -341,19 +341,19 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - parent_incident_id: None | str | Unset + parent_incident_id: Union[None, Unset, str] if isinstance(self.parent_incident_id, Unset): parent_incident_id = UNSET else: parent_incident_id = self.parent_incident_id - duplicate_incident_id: None | str | Unset + duplicate_incident_id: Union[None, Unset, str] if isinstance(self.duplicate_incident_id, Unset): duplicate_incident_id = UNSET else: duplicate_incident_id = self.duplicate_incident_id - summary: None | str | Unset + summary: Union[None, Unset, str] if isinstance(self.summary, Unset): summary = UNSET else: @@ -361,37 +361,37 @@ def to_dict(self) -> dict[str, Any]: private = self.private - source: None | str | Unset + source: Union[None, Unset, str] if isinstance(self.source, Unset): source = UNSET else: source = self.source - status: None | str | Unset + status: Union[None, Unset, str] if isinstance(self.status, Unset): status = UNSET else: status = self.status - url: None | str | Unset + url: Union[None, Unset, str] if isinstance(self.url, Unset): url = UNSET else: url = self.url - short_url: None | str | Unset + short_url: Union[None, Unset, str] if isinstance(self.short_url, Unset): short_url = UNSET else: short_url = self.short_url - public_title: None | str | Unset + public_title: Union[None, Unset, str] if isinstance(self.public_title, Unset): public_title = UNSET else: public_title = self.public_title - user: dict[str, Any] | None | Unset + user: Union[None, Unset, dict[str, Any]] if isinstance(self.user, Unset): user = UNSET elif isinstance(self.user, IncidentUserType0): @@ -399,11 +399,11 @@ def to_dict(self) -> dict[str, Any]: else: user = self.user - severity: dict[str, Any] | Unset = UNSET + severity: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.severity, Unset): severity = self.severity.to_dict() - environments: list[dict[str, Any]] | None | Unset + environments: Union[None, Unset, list[dict[str, Any]]] if isinstance(self.environments, Unset): environments = UNSET elif isinstance(self.environments, list): @@ -415,7 +415,7 @@ def to_dict(self) -> dict[str, Any]: else: environments = self.environments - incident_types: list[dict[str, Any]] | None | Unset + incident_types: Union[None, Unset, list[dict[str, Any]]] if isinstance(self.incident_types, Unset): incident_types = UNSET elif isinstance(self.incident_types, list): @@ -427,7 +427,7 @@ def to_dict(self) -> dict[str, Any]: else: incident_types = self.incident_types - services: list[dict[str, Any]] | None | Unset + services: Union[None, Unset, list[dict[str, Any]]] if isinstance(self.services, Unset): services = UNSET elif isinstance(self.services, list): @@ -439,7 +439,7 @@ def to_dict(self) -> dict[str, Any]: else: services = self.services - functionalities: list[dict[str, Any]] | None | Unset + functionalities: Union[None, Unset, list[dict[str, Any]]] if isinstance(self.functionalities, Unset): functionalities = UNSET elif isinstance(self.functionalities, list): @@ -451,7 +451,7 @@ def to_dict(self) -> dict[str, Any]: else: functionalities = self.functionalities - groups: list[dict[str, Any]] | None | Unset + groups: Union[None, Unset, list[dict[str, Any]]] if isinstance(self.groups, Unset): groups = UNSET elif isinstance(self.groups, list): @@ -463,7 +463,7 @@ def to_dict(self) -> dict[str, Any]: else: groups = self.groups - labels: dict[str, Any] | None | Unset + labels: Union[None, Unset, dict[str, Any]] if isinstance(self.labels, Unset): labels = UNSET elif isinstance(self.labels, IncidentLabelsType0): @@ -471,85 +471,85 @@ def to_dict(self) -> dict[str, Any]: else: labels = self.labels - slack_channel_id: None | str | Unset + slack_channel_id: Union[None, Unset, str] if isinstance(self.slack_channel_id, Unset): slack_channel_id = UNSET else: slack_channel_id = self.slack_channel_id - slack_channel_name: None | str | Unset + slack_channel_name: Union[None, Unset, str] if isinstance(self.slack_channel_name, Unset): slack_channel_name = UNSET else: slack_channel_name = self.slack_channel_name - slack_channel_url: None | str | Unset + slack_channel_url: Union[None, Unset, str] if isinstance(self.slack_channel_url, Unset): slack_channel_url = UNSET else: slack_channel_url = self.slack_channel_url - slack_channel_short_url: None | str | Unset + slack_channel_short_url: Union[None, Unset, str] if isinstance(self.slack_channel_short_url, Unset): slack_channel_short_url = UNSET else: slack_channel_short_url = self.slack_channel_short_url - slack_channel_deep_link: None | str | Unset + slack_channel_deep_link: Union[None, Unset, str] if isinstance(self.slack_channel_deep_link, Unset): slack_channel_deep_link = UNSET else: slack_channel_deep_link = self.slack_channel_deep_link - slack_channel_archived: bool | None | Unset + slack_channel_archived: Union[None, Unset, bool] if isinstance(self.slack_channel_archived, Unset): slack_channel_archived = UNSET else: slack_channel_archived = self.slack_channel_archived - slack_last_message_ts: None | str | Unset + slack_last_message_ts: Union[None, Unset, str] if isinstance(self.slack_last_message_ts, Unset): slack_last_message_ts = UNSET else: slack_last_message_ts = self.slack_last_message_ts - zoom_meeting_id: None | str | Unset + zoom_meeting_id: Union[None, Unset, str] if isinstance(self.zoom_meeting_id, Unset): zoom_meeting_id = UNSET else: zoom_meeting_id = self.zoom_meeting_id - zoom_meeting_start_url: None | str | Unset + zoom_meeting_start_url: Union[None, Unset, str] if isinstance(self.zoom_meeting_start_url, Unset): zoom_meeting_start_url = UNSET else: zoom_meeting_start_url = self.zoom_meeting_start_url - zoom_meeting_join_url: None | str | Unset + zoom_meeting_join_url: Union[None, Unset, str] if isinstance(self.zoom_meeting_join_url, Unset): zoom_meeting_join_url = UNSET else: zoom_meeting_join_url = self.zoom_meeting_join_url - zoom_meeting_password: None | str | Unset + zoom_meeting_password: Union[None, Unset, str] if isinstance(self.zoom_meeting_password, Unset): zoom_meeting_password = UNSET else: zoom_meeting_password = self.zoom_meeting_password - zoom_meeting_pstn_password: None | str | Unset + zoom_meeting_pstn_password: Union[None, Unset, str] if isinstance(self.zoom_meeting_pstn_password, Unset): zoom_meeting_pstn_password = UNSET else: zoom_meeting_pstn_password = self.zoom_meeting_pstn_password - zoom_meeting_h323_password: None | str | Unset + zoom_meeting_h323_password: Union[None, Unset, str] if isinstance(self.zoom_meeting_h323_password, Unset): zoom_meeting_h323_password = UNSET else: zoom_meeting_h323_password = self.zoom_meeting_h323_password - zoom_meeting_global_dial_in_numbers: list[dict[str, Any]] | None | Unset + zoom_meeting_global_dial_in_numbers: Union[None, Unset, list[dict[str, Any]]] if isinstance(self.zoom_meeting_global_dial_in_numbers, Unset): zoom_meeting_global_dial_in_numbers = UNSET elif isinstance(self.zoom_meeting_global_dial_in_numbers, list): @@ -563,493 +563,493 @@ def to_dict(self) -> dict[str, Any]: else: zoom_meeting_global_dial_in_numbers = self.zoom_meeting_global_dial_in_numbers - google_drive_id: None | str | Unset + google_drive_id: Union[None, Unset, str] if isinstance(self.google_drive_id, Unset): google_drive_id = UNSET else: google_drive_id = self.google_drive_id - google_drive_parent_id: None | str | Unset + google_drive_parent_id: Union[None, Unset, str] if isinstance(self.google_drive_parent_id, Unset): google_drive_parent_id = UNSET else: google_drive_parent_id = self.google_drive_parent_id - google_drive_url: None | str | Unset + google_drive_url: Union[None, Unset, str] if isinstance(self.google_drive_url, Unset): google_drive_url = UNSET else: google_drive_url = self.google_drive_url - google_meeting_id: None | str | Unset + google_meeting_id: Union[None, Unset, str] if isinstance(self.google_meeting_id, Unset): google_meeting_id = UNSET else: google_meeting_id = self.google_meeting_id - google_meeting_url: None | str | Unset + google_meeting_url: Union[None, Unset, str] if isinstance(self.google_meeting_url, Unset): google_meeting_url = UNSET else: google_meeting_url = self.google_meeting_url - microsoft_teams_meeting_id: None | str | Unset + microsoft_teams_meeting_id: Union[None, Unset, str] if isinstance(self.microsoft_teams_meeting_id, Unset): microsoft_teams_meeting_id = UNSET else: microsoft_teams_meeting_id = self.microsoft_teams_meeting_id - microsoft_teams_meeting_url: None | str | Unset + microsoft_teams_meeting_url: Union[None, Unset, str] if isinstance(self.microsoft_teams_meeting_url, Unset): microsoft_teams_meeting_url = UNSET else: microsoft_teams_meeting_url = self.microsoft_teams_meeting_url - microsoft_teams_channel_id: None | str | Unset + microsoft_teams_channel_id: Union[None, Unset, str] if isinstance(self.microsoft_teams_channel_id, Unset): microsoft_teams_channel_id = UNSET else: microsoft_teams_channel_id = self.microsoft_teams_channel_id - microsoft_teams_channel_name: None | str | Unset + microsoft_teams_channel_name: Union[None, Unset, str] if isinstance(self.microsoft_teams_channel_name, Unset): microsoft_teams_channel_name = UNSET else: microsoft_teams_channel_name = self.microsoft_teams_channel_name - microsoft_teams_channel_url: None | str | Unset + microsoft_teams_channel_url: Union[None, Unset, str] if isinstance(self.microsoft_teams_channel_url, Unset): microsoft_teams_channel_url = UNSET else: microsoft_teams_channel_url = self.microsoft_teams_channel_url - microsoft_teams_channel_short_url: None | str | Unset + microsoft_teams_channel_short_url: Union[None, Unset, str] if isinstance(self.microsoft_teams_channel_short_url, Unset): microsoft_teams_channel_short_url = UNSET else: microsoft_teams_channel_short_url = self.microsoft_teams_channel_short_url - microsoft_teams_chat_id: None | str | Unset + microsoft_teams_chat_id: Union[None, Unset, str] if isinstance(self.microsoft_teams_chat_id, Unset): microsoft_teams_chat_id = UNSET else: microsoft_teams_chat_id = self.microsoft_teams_chat_id - microsoft_teams_chat_url: None | str | Unset + microsoft_teams_chat_url: Union[None, Unset, str] if isinstance(self.microsoft_teams_chat_url, Unset): microsoft_teams_chat_url = UNSET else: microsoft_teams_chat_url = self.microsoft_teams_chat_url - microsoft_teams_team_id: None | str | Unset + microsoft_teams_team_id: Union[None, Unset, str] if isinstance(self.microsoft_teams_team_id, Unset): microsoft_teams_team_id = UNSET else: microsoft_teams_team_id = self.microsoft_teams_team_id - google_chat_space_id: None | str | Unset + google_chat_space_id: Union[None, Unset, str] if isinstance(self.google_chat_space_id, Unset): google_chat_space_id = UNSET else: google_chat_space_id = self.google_chat_space_id - google_chat_space_name: None | str | Unset + google_chat_space_name: Union[None, Unset, str] if isinstance(self.google_chat_space_name, Unset): google_chat_space_name = UNSET else: google_chat_space_name = self.google_chat_space_name - google_chat_space_url: None | str | Unset + google_chat_space_url: Union[None, Unset, str] if isinstance(self.google_chat_space_url, Unset): google_chat_space_url = UNSET else: google_chat_space_url = self.google_chat_space_url - google_chat_space_short_url: None | str | Unset + google_chat_space_short_url: Union[None, Unset, str] if isinstance(self.google_chat_space_short_url, Unset): google_chat_space_short_url = UNSET else: google_chat_space_short_url = self.google_chat_space_short_url - google_chat_space_archived: bool | None | Unset + google_chat_space_archived: Union[None, Unset, bool] if isinstance(self.google_chat_space_archived, Unset): google_chat_space_archived = UNSET else: google_chat_space_archived = self.google_chat_space_archived - google_chat_space_domain_id: None | str | Unset + google_chat_space_domain_id: Union[None, Unset, str] if isinstance(self.google_chat_space_domain_id, Unset): google_chat_space_domain_id = UNSET else: google_chat_space_domain_id = self.google_chat_space_domain_id - webex_meeting_id: None | str | Unset + webex_meeting_id: Union[None, Unset, str] if isinstance(self.webex_meeting_id, Unset): webex_meeting_id = UNSET else: webex_meeting_id = self.webex_meeting_id - webex_meeting_url: None | str | Unset + webex_meeting_url: Union[None, Unset, str] if isinstance(self.webex_meeting_url, Unset): webex_meeting_url = UNSET else: webex_meeting_url = self.webex_meeting_url - jira_issue_key: None | str | Unset + jira_issue_key: Union[None, Unset, str] if isinstance(self.jira_issue_key, Unset): jira_issue_key = UNSET else: jira_issue_key = self.jira_issue_key - jira_issue_id: None | str | Unset + jira_issue_id: Union[None, Unset, str] if isinstance(self.jira_issue_id, Unset): jira_issue_id = UNSET else: jira_issue_id = self.jira_issue_id - jira_issue_url: None | str | Unset + jira_issue_url: Union[None, Unset, str] if isinstance(self.jira_issue_url, Unset): jira_issue_url = UNSET else: jira_issue_url = self.jira_issue_url - github_issue_id: None | str | Unset + github_issue_id: Union[None, Unset, str] if isinstance(self.github_issue_id, Unset): github_issue_id = UNSET else: github_issue_id = self.github_issue_id - github_issue_url: None | str | Unset + github_issue_url: Union[None, Unset, str] if isinstance(self.github_issue_url, Unset): github_issue_url = UNSET else: github_issue_url = self.github_issue_url - gitlab_issue_id: None | str | Unset + gitlab_issue_id: Union[None, Unset, str] if isinstance(self.gitlab_issue_id, Unset): gitlab_issue_id = UNSET else: gitlab_issue_id = self.gitlab_issue_id - gitlab_issue_url: None | str | Unset + gitlab_issue_url: Union[None, Unset, str] if isinstance(self.gitlab_issue_url, Unset): gitlab_issue_url = UNSET else: gitlab_issue_url = self.gitlab_issue_url - asana_task_id: None | str | Unset + asana_task_id: Union[None, Unset, str] if isinstance(self.asana_task_id, Unset): asana_task_id = UNSET else: asana_task_id = self.asana_task_id - asana_task_url: None | str | Unset + asana_task_url: Union[None, Unset, str] if isinstance(self.asana_task_url, Unset): asana_task_url = UNSET else: asana_task_url = self.asana_task_url - linear_issue_id: None | str | Unset + linear_issue_id: Union[None, Unset, str] if isinstance(self.linear_issue_id, Unset): linear_issue_id = UNSET else: linear_issue_id = self.linear_issue_id - linear_issue_url: None | str | Unset + linear_issue_url: Union[None, Unset, str] if isinstance(self.linear_issue_url, Unset): linear_issue_url = UNSET else: linear_issue_url = self.linear_issue_url - trello_card_id: None | str | Unset + trello_card_id: Union[None, Unset, str] if isinstance(self.trello_card_id, Unset): trello_card_id = UNSET else: trello_card_id = self.trello_card_id - trello_card_url: None | str | Unset + trello_card_url: Union[None, Unset, str] if isinstance(self.trello_card_url, Unset): trello_card_url = UNSET else: trello_card_url = self.trello_card_url - zendesk_ticket_id: None | str | Unset + zendesk_ticket_id: Union[None, Unset, str] if isinstance(self.zendesk_ticket_id, Unset): zendesk_ticket_id = UNSET else: zendesk_ticket_id = self.zendesk_ticket_id - zendesk_ticket_url: None | str | Unset + zendesk_ticket_url: Union[None, Unset, str] if isinstance(self.zendesk_ticket_url, Unset): zendesk_ticket_url = UNSET else: zendesk_ticket_url = self.zendesk_ticket_url - pagerduty_incident_id: None | str | Unset + pagerduty_incident_id: Union[None, Unset, str] if isinstance(self.pagerduty_incident_id, Unset): pagerduty_incident_id = UNSET else: pagerduty_incident_id = self.pagerduty_incident_id - pagerduty_incident_number: None | str | Unset + pagerduty_incident_number: Union[None, Unset, str] if isinstance(self.pagerduty_incident_number, Unset): pagerduty_incident_number = UNSET else: pagerduty_incident_number = self.pagerduty_incident_number - pagerduty_incident_url: None | str | Unset + pagerduty_incident_url: Union[None, Unset, str] if isinstance(self.pagerduty_incident_url, Unset): pagerduty_incident_url = UNSET else: pagerduty_incident_url = self.pagerduty_incident_url - opsgenie_incident_id: None | str | Unset + opsgenie_incident_id: Union[None, Unset, str] if isinstance(self.opsgenie_incident_id, Unset): opsgenie_incident_id = UNSET else: opsgenie_incident_id = self.opsgenie_incident_id - opsgenie_incident_url: None | str | Unset + opsgenie_incident_url: Union[None, Unset, str] if isinstance(self.opsgenie_incident_url, Unset): opsgenie_incident_url = UNSET else: opsgenie_incident_url = self.opsgenie_incident_url - opsgenie_alert_id: None | str | Unset + opsgenie_alert_id: Union[None, Unset, str] if isinstance(self.opsgenie_alert_id, Unset): opsgenie_alert_id = UNSET else: opsgenie_alert_id = self.opsgenie_alert_id - opsgenie_alert_url: None | str | Unset + opsgenie_alert_url: Union[None, Unset, str] if isinstance(self.opsgenie_alert_url, Unset): opsgenie_alert_url = UNSET else: opsgenie_alert_url = self.opsgenie_alert_url - service_now_incident_id: None | str | Unset + service_now_incident_id: Union[None, Unset, str] if isinstance(self.service_now_incident_id, Unset): service_now_incident_id = UNSET else: service_now_incident_id = self.service_now_incident_id - service_now_incident_key: None | str | Unset + service_now_incident_key: Union[None, Unset, str] if isinstance(self.service_now_incident_key, Unset): service_now_incident_key = UNSET else: service_now_incident_key = self.service_now_incident_key - service_now_incident_url: None | str | Unset + service_now_incident_url: Union[None, Unset, str] if isinstance(self.service_now_incident_url, Unset): service_now_incident_url = UNSET else: service_now_incident_url = self.service_now_incident_url - mattermost_channel_id: None | str | Unset + mattermost_channel_id: Union[None, Unset, str] if isinstance(self.mattermost_channel_id, Unset): mattermost_channel_id = UNSET else: mattermost_channel_id = self.mattermost_channel_id - mattermost_channel_name: None | str | Unset + mattermost_channel_name: Union[None, Unset, str] if isinstance(self.mattermost_channel_name, Unset): mattermost_channel_name = UNSET else: mattermost_channel_name = self.mattermost_channel_name - mattermost_channel_url: None | str | Unset + mattermost_channel_url: Union[None, Unset, str] if isinstance(self.mattermost_channel_url, Unset): mattermost_channel_url = UNSET else: mattermost_channel_url = self.mattermost_channel_url - confluence_page_id: None | str | Unset + confluence_page_id: Union[None, Unset, str] if isinstance(self.confluence_page_id, Unset): confluence_page_id = UNSET else: confluence_page_id = self.confluence_page_id - confluence_page_url: None | str | Unset + confluence_page_url: Union[None, Unset, str] if isinstance(self.confluence_page_url, Unset): confluence_page_url = UNSET else: confluence_page_url = self.confluence_page_url - datadog_notebook_id: None | str | Unset + datadog_notebook_id: Union[None, Unset, str] if isinstance(self.datadog_notebook_id, Unset): datadog_notebook_id = UNSET else: datadog_notebook_id = self.datadog_notebook_id - datadog_notebook_url: None | str | Unset + datadog_notebook_url: Union[None, Unset, str] if isinstance(self.datadog_notebook_url, Unset): datadog_notebook_url = UNSET else: datadog_notebook_url = self.datadog_notebook_url - shortcut_story_id: None | str | Unset + shortcut_story_id: Union[None, Unset, str] if isinstance(self.shortcut_story_id, Unset): shortcut_story_id = UNSET else: shortcut_story_id = self.shortcut_story_id - shortcut_story_url: None | str | Unset + shortcut_story_url: Union[None, Unset, str] if isinstance(self.shortcut_story_url, Unset): shortcut_story_url = UNSET else: shortcut_story_url = self.shortcut_story_url - shortcut_task_id: None | str | Unset + shortcut_task_id: Union[None, Unset, str] if isinstance(self.shortcut_task_id, Unset): shortcut_task_id = UNSET else: shortcut_task_id = self.shortcut_task_id - shortcut_task_url: None | str | Unset + shortcut_task_url: Union[None, Unset, str] if isinstance(self.shortcut_task_url, Unset): shortcut_task_url = UNSET else: shortcut_task_url = self.shortcut_task_url - motion_task_id: None | str | Unset + motion_task_id: Union[None, Unset, str] if isinstance(self.motion_task_id, Unset): motion_task_id = UNSET else: motion_task_id = self.motion_task_id - motion_task_url: None | str | Unset + motion_task_url: Union[None, Unset, str] if isinstance(self.motion_task_url, Unset): motion_task_url = UNSET else: motion_task_url = self.motion_task_url - clickup_task_id: None | str | Unset + clickup_task_id: Union[None, Unset, str] if isinstance(self.clickup_task_id, Unset): clickup_task_id = UNSET else: clickup_task_id = self.clickup_task_id - clickup_task_url: None | str | Unset + clickup_task_url: Union[None, Unset, str] if isinstance(self.clickup_task_url, Unset): clickup_task_url = UNSET else: clickup_task_url = self.clickup_task_url - victor_ops_incident_id: None | str | Unset + victor_ops_incident_id: Union[None, Unset, str] if isinstance(self.victor_ops_incident_id, Unset): victor_ops_incident_id = UNSET else: victor_ops_incident_id = self.victor_ops_incident_id - victor_ops_incident_url: None | str | Unset + victor_ops_incident_url: Union[None, Unset, str] if isinstance(self.victor_ops_incident_url, Unset): victor_ops_incident_url = UNSET else: victor_ops_incident_url = self.victor_ops_incident_url - quip_page_id: None | str | Unset + quip_page_id: Union[None, Unset, str] if isinstance(self.quip_page_id, Unset): quip_page_id = UNSET else: quip_page_id = self.quip_page_id - quip_page_url: None | str | Unset + quip_page_url: Union[None, Unset, str] if isinstance(self.quip_page_url, Unset): quip_page_url = UNSET else: quip_page_url = self.quip_page_url - sharepoint_page_id: None | str | Unset + sharepoint_page_id: Union[None, Unset, str] if isinstance(self.sharepoint_page_id, Unset): sharepoint_page_id = UNSET else: sharepoint_page_id = self.sharepoint_page_id - sharepoint_page_url: None | str | Unset + sharepoint_page_url: Union[None, Unset, str] if isinstance(self.sharepoint_page_url, Unset): sharepoint_page_url = UNSET else: sharepoint_page_url = self.sharepoint_page_url - airtable_base_key: None | str | Unset + airtable_base_key: Union[None, Unset, str] if isinstance(self.airtable_base_key, Unset): airtable_base_key = UNSET else: airtable_base_key = self.airtable_base_key - airtable_table_name: None | str | Unset + airtable_table_name: Union[None, Unset, str] if isinstance(self.airtable_table_name, Unset): airtable_table_name = UNSET else: airtable_table_name = self.airtable_table_name - airtable_record_id: None | str | Unset + airtable_record_id: Union[None, Unset, str] if isinstance(self.airtable_record_id, Unset): airtable_record_id = UNSET else: airtable_record_id = self.airtable_record_id - airtable_record_url: None | str | Unset + airtable_record_url: Union[None, Unset, str] if isinstance(self.airtable_record_url, Unset): airtable_record_url = UNSET else: airtable_record_url = self.airtable_record_url - freshservice_ticket_id: None | str | Unset + freshservice_ticket_id: Union[None, Unset, str] if isinstance(self.freshservice_ticket_id, Unset): freshservice_ticket_id = UNSET else: freshservice_ticket_id = self.freshservice_ticket_id - freshservice_ticket_url: None | str | Unset + freshservice_ticket_url: Union[None, Unset, str] if isinstance(self.freshservice_ticket_url, Unset): freshservice_ticket_url = UNSET else: freshservice_ticket_url = self.freshservice_ticket_url - freshservice_task_id: None | str | Unset + freshservice_task_id: Union[None, Unset, str] if isinstance(self.freshservice_task_id, Unset): freshservice_task_id = UNSET else: freshservice_task_id = self.freshservice_task_id - freshservice_task_url: None | str | Unset + freshservice_task_url: Union[None, Unset, str] if isinstance(self.freshservice_task_url, Unset): freshservice_task_url = UNSET else: freshservice_task_url = self.freshservice_task_url - mitigation_message: None | str | Unset + mitigation_message: Union[None, Unset, str] if isinstance(self.mitigation_message, Unset): mitigation_message = UNSET else: mitigation_message = self.mitigation_message - resolution_message: None | str | Unset + resolution_message: Union[None, Unset, str] if isinstance(self.resolution_message, Unset): resolution_message = UNSET else: resolution_message = self.resolution_message - cancellation_message: None | str | Unset + cancellation_message: Union[None, Unset, str] if isinstance(self.cancellation_message, Unset): cancellation_message = UNSET else: cancellation_message = self.cancellation_message - scheduled_for: None | str | Unset + scheduled_for: Union[None, Unset, str] if isinstance(self.scheduled_for, Unset): scheduled_for = UNSET else: scheduled_for = self.scheduled_for - scheduled_until: None | str | Unset + scheduled_until: Union[None, Unset, str] if isinstance(self.scheduled_until, Unset): scheduled_until = UNSET else: scheduled_until = self.scheduled_until - muted_service_ids: list[str] | None | Unset + muted_service_ids: Union[None, Unset, list[str]] if isinstance(self.muted_service_ids, Unset): muted_service_ids = UNSET elif isinstance(self.muted_service_ids, list): @@ -1058,11 +1058,11 @@ def to_dict(self) -> dict[str, Any]: else: muted_service_ids = self.muted_service_ids - retrospective_progress_status: str | Unset = UNSET + retrospective_progress_status: Union[Unset, str] = UNSET if not isinstance(self.retrospective_progress_status, Unset): retrospective_progress_status = self.retrospective_progress_status - in_triage_by: dict[str, Any] | None | Unset + in_triage_by: Union[None, Unset, dict[str, Any]] if isinstance(self.in_triage_by, Unset): in_triage_by = UNSET elif isinstance(self.in_triage_by, IncidentInTriageByType0): @@ -1070,7 +1070,7 @@ def to_dict(self) -> dict[str, Any]: else: in_triage_by = self.in_triage_by - started_by: dict[str, Any] | None | Unset + started_by: Union[None, Unset, dict[str, Any]] if isinstance(self.started_by, Unset): started_by = UNSET elif isinstance(self.started_by, IncidentStartedByType0): @@ -1078,7 +1078,7 @@ def to_dict(self) -> dict[str, Any]: else: started_by = self.started_by - mitigated_by: dict[str, Any] | None | Unset + mitigated_by: Union[None, Unset, dict[str, Any]] if isinstance(self.mitigated_by, Unset): mitigated_by = UNSET elif isinstance(self.mitigated_by, IncidentMitigatedByType0): @@ -1086,7 +1086,7 @@ def to_dict(self) -> dict[str, Any]: else: mitigated_by = self.mitigated_by - resolved_by: dict[str, Any] | None | Unset + resolved_by: Union[None, Unset, dict[str, Any]] if isinstance(self.resolved_by, Unset): resolved_by = UNSET elif isinstance(self.resolved_by, IncidentResolvedByType0): @@ -1094,7 +1094,7 @@ def to_dict(self) -> dict[str, Any]: else: resolved_by = self.resolved_by - closed_by: dict[str, Any] | None | Unset + closed_by: Union[None, Unset, dict[str, Any]] if isinstance(self.closed_by, Unset): closed_by = UNSET elif isinstance(self.closed_by, IncidentClosedByType0): @@ -1102,7 +1102,7 @@ def to_dict(self) -> dict[str, Any]: else: closed_by = self.closed_by - cancelled_by: dict[str, Any] | None | Unset + cancelled_by: Union[None, Unset, dict[str, Any]] if isinstance(self.cancelled_by, Unset): cancelled_by = UNSET elif isinstance(self.cancelled_by, IncidentCancelledByType0): @@ -1110,49 +1110,49 @@ def to_dict(self) -> dict[str, Any]: else: cancelled_by = self.cancelled_by - in_triage_at: None | str | Unset + in_triage_at: Union[None, Unset, str] if isinstance(self.in_triage_at, Unset): in_triage_at = UNSET else: in_triage_at = self.in_triage_at - started_at: None | str | Unset + started_at: Union[None, Unset, str] if isinstance(self.started_at, Unset): started_at = UNSET else: started_at = self.started_at - detected_at: None | str | Unset + detected_at: Union[None, Unset, str] if isinstance(self.detected_at, Unset): detected_at = UNSET else: detected_at = self.detected_at - acknowledged_at: None | str | Unset + acknowledged_at: Union[None, Unset, str] if isinstance(self.acknowledged_at, Unset): acknowledged_at = UNSET else: acknowledged_at = self.acknowledged_at - mitigated_at: None | str | Unset + mitigated_at: Union[None, Unset, str] if isinstance(self.mitigated_at, Unset): mitigated_at = UNSET else: mitigated_at = self.mitigated_at - resolved_at: None | str | Unset + resolved_at: Union[None, Unset, str] if isinstance(self.resolved_at, Unset): resolved_at = UNSET else: resolved_at = self.resolved_at - closed_at: None | str | Unset + closed_at: Union[None, Unset, str] if isinstance(self.closed_at, Unset): closed_at = UNSET else: closed_at = self.closed_at - cancelled_at: None | str | Unset + cancelled_at: Union[None, Unset, str] if isinstance(self.cancelled_at, Unset): cancelled_at = UNSET else: @@ -1469,81 +1469,81 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: slug = d.pop("slug", UNSET) - def _parse_parent_incident_id(data: object) -> None | str | Unset: + def _parse_parent_incident_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) parent_incident_id = _parse_parent_incident_id(d.pop("parent_incident_id", UNSET)) - def _parse_duplicate_incident_id(data: object) -> None | str | Unset: + def _parse_duplicate_incident_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) duplicate_incident_id = _parse_duplicate_incident_id(d.pop("duplicate_incident_id", UNSET)) - def _parse_summary(data: object) -> None | str | Unset: + def _parse_summary(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) summary = _parse_summary(d.pop("summary", UNSET)) private = d.pop("private", UNSET) - def _parse_source(data: object) -> None | str | Unset: + def _parse_source(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) source = _parse_source(d.pop("source", UNSET)) - def _parse_status(data: object) -> None | str | Unset: + def _parse_status(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) status = _parse_status(d.pop("status", UNSET)) - def _parse_url(data: object) -> None | str | Unset: + def _parse_url(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) url = _parse_url(d.pop("url", UNSET)) - def _parse_short_url(data: object) -> None | str | Unset: + def _parse_short_url(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) short_url = _parse_short_url(d.pop("short_url", UNSET)) - def _parse_public_title(data: object) -> None | str | Unset: + def _parse_public_title(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) public_title = _parse_public_title(d.pop("public_title", UNSET)) - def _parse_user(data: object) -> IncidentUserType0 | None | Unset: + def _parse_user(data: object) -> Union["IncidentUserType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -1554,20 +1554,20 @@ def _parse_user(data: object) -> IncidentUserType0 | None | Unset: user_type_0 = IncidentUserType0.from_dict(data) return user_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(IncidentUserType0 | None | Unset, data) + return cast(Union["IncidentUserType0", None, Unset], data) user = _parse_user(d.pop("user", UNSET)) _severity = d.pop("severity", UNSET) - severity: SeverityResponse | Unset + severity: Union[Unset, SeverityResponse] if isinstance(_severity, Unset): severity = UNSET else: severity = SeverityResponse.from_dict(_severity) - def _parse_environments(data: object) -> list[EnvironmentResponse] | None | Unset: + def _parse_environments(data: object) -> Union[None, Unset, list["EnvironmentResponse"]]: if data is None: return data if isinstance(data, Unset): @@ -1583,13 +1583,13 @@ def _parse_environments(data: object) -> list[EnvironmentResponse] | None | Unse environments_type_0.append(environments_type_0_item) return environments_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[EnvironmentResponse] | None | Unset, data) + return cast(Union[None, Unset, list["EnvironmentResponse"]], data) environments = _parse_environments(d.pop("environments", UNSET)) - def _parse_incident_types(data: object) -> list[IncidentTypeResponse] | None | Unset: + def _parse_incident_types(data: object) -> Union[None, Unset, list["IncidentTypeResponse"]]: if data is None: return data if isinstance(data, Unset): @@ -1605,13 +1605,13 @@ def _parse_incident_types(data: object) -> list[IncidentTypeResponse] | None | U incident_types_type_0.append(incident_types_type_0_item) return incident_types_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[IncidentTypeResponse] | None | Unset, data) + return cast(Union[None, Unset, list["IncidentTypeResponse"]], data) incident_types = _parse_incident_types(d.pop("incident_types", UNSET)) - def _parse_services(data: object) -> list[ServiceResponse] | None | Unset: + def _parse_services(data: object) -> Union[None, Unset, list["ServiceResponse"]]: if data is None: return data if isinstance(data, Unset): @@ -1627,13 +1627,13 @@ def _parse_services(data: object) -> list[ServiceResponse] | None | Unset: services_type_0.append(services_type_0_item) return services_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[ServiceResponse] | None | Unset, data) + return cast(Union[None, Unset, list["ServiceResponse"]], data) services = _parse_services(d.pop("services", UNSET)) - def _parse_functionalities(data: object) -> list[FunctionalityResponse] | None | Unset: + def _parse_functionalities(data: object) -> Union[None, Unset, list["FunctionalityResponse"]]: if data is None: return data if isinstance(data, Unset): @@ -1649,13 +1649,13 @@ def _parse_functionalities(data: object) -> list[FunctionalityResponse] | None | functionalities_type_0.append(functionalities_type_0_item) return functionalities_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[FunctionalityResponse] | None | Unset, data) + return cast(Union[None, Unset, list["FunctionalityResponse"]], data) functionalities = _parse_functionalities(d.pop("functionalities", UNSET)) - def _parse_groups(data: object) -> list[TeamResponse] | None | Unset: + def _parse_groups(data: object) -> Union[None, Unset, list["TeamResponse"]]: if data is None: return data if isinstance(data, Unset): @@ -1671,13 +1671,13 @@ def _parse_groups(data: object) -> list[TeamResponse] | None | Unset: groups_type_0.append(groups_type_0_item) return groups_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[TeamResponse] | None | Unset, data) + return cast(Union[None, Unset, list["TeamResponse"]], data) groups = _parse_groups(d.pop("groups", UNSET)) - def _parse_labels(data: object) -> IncidentLabelsType0 | None | Unset: + def _parse_labels(data: object) -> Union["IncidentLabelsType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -1688,132 +1688,132 @@ def _parse_labels(data: object) -> IncidentLabelsType0 | None | Unset: labels_type_0 = IncidentLabelsType0.from_dict(data) return labels_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(IncidentLabelsType0 | None | Unset, data) + return cast(Union["IncidentLabelsType0", None, Unset], data) labels = _parse_labels(d.pop("labels", UNSET)) - def _parse_slack_channel_id(data: object) -> None | str | Unset: + def _parse_slack_channel_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) slack_channel_id = _parse_slack_channel_id(d.pop("slack_channel_id", UNSET)) - def _parse_slack_channel_name(data: object) -> None | str | Unset: + def _parse_slack_channel_name(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) slack_channel_name = _parse_slack_channel_name(d.pop("slack_channel_name", UNSET)) - def _parse_slack_channel_url(data: object) -> None | str | Unset: + def _parse_slack_channel_url(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) slack_channel_url = _parse_slack_channel_url(d.pop("slack_channel_url", UNSET)) - def _parse_slack_channel_short_url(data: object) -> None | str | Unset: + def _parse_slack_channel_short_url(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) slack_channel_short_url = _parse_slack_channel_short_url(d.pop("slack_channel_short_url", UNSET)) - def _parse_slack_channel_deep_link(data: object) -> None | str | Unset: + def _parse_slack_channel_deep_link(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) slack_channel_deep_link = _parse_slack_channel_deep_link(d.pop("slack_channel_deep_link", UNSET)) - def _parse_slack_channel_archived(data: object) -> bool | None | Unset: + def _parse_slack_channel_archived(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) slack_channel_archived = _parse_slack_channel_archived(d.pop("slack_channel_archived", UNSET)) - def _parse_slack_last_message_ts(data: object) -> None | str | Unset: + def _parse_slack_last_message_ts(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) slack_last_message_ts = _parse_slack_last_message_ts(d.pop("slack_last_message_ts", UNSET)) - def _parse_zoom_meeting_id(data: object) -> None | str | Unset: + def _parse_zoom_meeting_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) zoom_meeting_id = _parse_zoom_meeting_id(d.pop("zoom_meeting_id", UNSET)) - def _parse_zoom_meeting_start_url(data: object) -> None | str | Unset: + def _parse_zoom_meeting_start_url(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) zoom_meeting_start_url = _parse_zoom_meeting_start_url(d.pop("zoom_meeting_start_url", UNSET)) - def _parse_zoom_meeting_join_url(data: object) -> None | str | Unset: + def _parse_zoom_meeting_join_url(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) zoom_meeting_join_url = _parse_zoom_meeting_join_url(d.pop("zoom_meeting_join_url", UNSET)) - def _parse_zoom_meeting_password(data: object) -> None | str | Unset: + def _parse_zoom_meeting_password(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) zoom_meeting_password = _parse_zoom_meeting_password(d.pop("zoom_meeting_password", UNSET)) - def _parse_zoom_meeting_pstn_password(data: object) -> None | str | Unset: + def _parse_zoom_meeting_pstn_password(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) zoom_meeting_pstn_password = _parse_zoom_meeting_pstn_password(d.pop("zoom_meeting_pstn_password", UNSET)) - def _parse_zoom_meeting_h323_password(data: object) -> None | str | Unset: + def _parse_zoom_meeting_h323_password(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) zoom_meeting_h323_password = _parse_zoom_meeting_h323_password(d.pop("zoom_meeting_h323_password", UNSET)) def _parse_zoom_meeting_global_dial_in_numbers( data: object, - ) -> list[IncidentZoomMeetingGlobalDialInNumbersType0Item] | None | Unset: + ) -> Union[None, Unset, list["IncidentZoomMeetingGlobalDialInNumbersType0Item"]]: if data is None: return data if isinstance(data, Unset): @@ -1833,746 +1833,746 @@ def _parse_zoom_meeting_global_dial_in_numbers( zoom_meeting_global_dial_in_numbers_type_0.append(zoom_meeting_global_dial_in_numbers_type_0_item) return zoom_meeting_global_dial_in_numbers_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[IncidentZoomMeetingGlobalDialInNumbersType0Item] | None | Unset, data) + return cast(Union[None, Unset, list["IncidentZoomMeetingGlobalDialInNumbersType0Item"]], data) zoom_meeting_global_dial_in_numbers = _parse_zoom_meeting_global_dial_in_numbers( d.pop("zoom_meeting_global_dial_in_numbers", UNSET) ) - def _parse_google_drive_id(data: object) -> None | str | Unset: + def _parse_google_drive_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) google_drive_id = _parse_google_drive_id(d.pop("google_drive_id", UNSET)) - def _parse_google_drive_parent_id(data: object) -> None | str | Unset: + def _parse_google_drive_parent_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) google_drive_parent_id = _parse_google_drive_parent_id(d.pop("google_drive_parent_id", UNSET)) - def _parse_google_drive_url(data: object) -> None | str | Unset: + def _parse_google_drive_url(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) google_drive_url = _parse_google_drive_url(d.pop("google_drive_url", UNSET)) - def _parse_google_meeting_id(data: object) -> None | str | Unset: + def _parse_google_meeting_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) google_meeting_id = _parse_google_meeting_id(d.pop("google_meeting_id", UNSET)) - def _parse_google_meeting_url(data: object) -> None | str | Unset: + def _parse_google_meeting_url(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) google_meeting_url = _parse_google_meeting_url(d.pop("google_meeting_url", UNSET)) - def _parse_microsoft_teams_meeting_id(data: object) -> None | str | Unset: + def _parse_microsoft_teams_meeting_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) microsoft_teams_meeting_id = _parse_microsoft_teams_meeting_id(d.pop("microsoft_teams_meeting_id", UNSET)) - def _parse_microsoft_teams_meeting_url(data: object) -> None | str | Unset: + def _parse_microsoft_teams_meeting_url(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) microsoft_teams_meeting_url = _parse_microsoft_teams_meeting_url(d.pop("microsoft_teams_meeting_url", UNSET)) - def _parse_microsoft_teams_channel_id(data: object) -> None | str | Unset: + def _parse_microsoft_teams_channel_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) microsoft_teams_channel_id = _parse_microsoft_teams_channel_id(d.pop("microsoft_teams_channel_id", UNSET)) - def _parse_microsoft_teams_channel_name(data: object) -> None | str | Unset: + def _parse_microsoft_teams_channel_name(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) microsoft_teams_channel_name = _parse_microsoft_teams_channel_name(d.pop("microsoft_teams_channel_name", UNSET)) - def _parse_microsoft_teams_channel_url(data: object) -> None | str | Unset: + def _parse_microsoft_teams_channel_url(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) microsoft_teams_channel_url = _parse_microsoft_teams_channel_url(d.pop("microsoft_teams_channel_url", UNSET)) - def _parse_microsoft_teams_channel_short_url(data: object) -> None | str | Unset: + def _parse_microsoft_teams_channel_short_url(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) microsoft_teams_channel_short_url = _parse_microsoft_teams_channel_short_url( d.pop("microsoft_teams_channel_short_url", UNSET) ) - def _parse_microsoft_teams_chat_id(data: object) -> None | str | Unset: + def _parse_microsoft_teams_chat_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) microsoft_teams_chat_id = _parse_microsoft_teams_chat_id(d.pop("microsoft_teams_chat_id", UNSET)) - def _parse_microsoft_teams_chat_url(data: object) -> None | str | Unset: + def _parse_microsoft_teams_chat_url(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) microsoft_teams_chat_url = _parse_microsoft_teams_chat_url(d.pop("microsoft_teams_chat_url", UNSET)) - def _parse_microsoft_teams_team_id(data: object) -> None | str | Unset: + def _parse_microsoft_teams_team_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) microsoft_teams_team_id = _parse_microsoft_teams_team_id(d.pop("microsoft_teams_team_id", UNSET)) - def _parse_google_chat_space_id(data: object) -> None | str | Unset: + def _parse_google_chat_space_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) google_chat_space_id = _parse_google_chat_space_id(d.pop("google_chat_space_id", UNSET)) - def _parse_google_chat_space_name(data: object) -> None | str | Unset: + def _parse_google_chat_space_name(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) google_chat_space_name = _parse_google_chat_space_name(d.pop("google_chat_space_name", UNSET)) - def _parse_google_chat_space_url(data: object) -> None | str | Unset: + def _parse_google_chat_space_url(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) google_chat_space_url = _parse_google_chat_space_url(d.pop("google_chat_space_url", UNSET)) - def _parse_google_chat_space_short_url(data: object) -> None | str | Unset: + def _parse_google_chat_space_short_url(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) google_chat_space_short_url = _parse_google_chat_space_short_url(d.pop("google_chat_space_short_url", UNSET)) - def _parse_google_chat_space_archived(data: object) -> bool | None | Unset: + def _parse_google_chat_space_archived(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) google_chat_space_archived = _parse_google_chat_space_archived(d.pop("google_chat_space_archived", UNSET)) - def _parse_google_chat_space_domain_id(data: object) -> None | str | Unset: + def _parse_google_chat_space_domain_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) google_chat_space_domain_id = _parse_google_chat_space_domain_id(d.pop("google_chat_space_domain_id", UNSET)) - def _parse_webex_meeting_id(data: object) -> None | str | Unset: + def _parse_webex_meeting_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) webex_meeting_id = _parse_webex_meeting_id(d.pop("webex_meeting_id", UNSET)) - def _parse_webex_meeting_url(data: object) -> None | str | Unset: + def _parse_webex_meeting_url(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) webex_meeting_url = _parse_webex_meeting_url(d.pop("webex_meeting_url", UNSET)) - def _parse_jira_issue_key(data: object) -> None | str | Unset: + def _parse_jira_issue_key(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) jira_issue_key = _parse_jira_issue_key(d.pop("jira_issue_key", UNSET)) - def _parse_jira_issue_id(data: object) -> None | str | Unset: + def _parse_jira_issue_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) jira_issue_id = _parse_jira_issue_id(d.pop("jira_issue_id", UNSET)) - def _parse_jira_issue_url(data: object) -> None | str | Unset: + def _parse_jira_issue_url(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) jira_issue_url = _parse_jira_issue_url(d.pop("jira_issue_url", UNSET)) - def _parse_github_issue_id(data: object) -> None | str | Unset: + def _parse_github_issue_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) github_issue_id = _parse_github_issue_id(d.pop("github_issue_id", UNSET)) - def _parse_github_issue_url(data: object) -> None | str | Unset: + def _parse_github_issue_url(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) github_issue_url = _parse_github_issue_url(d.pop("github_issue_url", UNSET)) - def _parse_gitlab_issue_id(data: object) -> None | str | Unset: + def _parse_gitlab_issue_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) gitlab_issue_id = _parse_gitlab_issue_id(d.pop("gitlab_issue_id", UNSET)) - def _parse_gitlab_issue_url(data: object) -> None | str | Unset: + def _parse_gitlab_issue_url(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) gitlab_issue_url = _parse_gitlab_issue_url(d.pop("gitlab_issue_url", UNSET)) - def _parse_asana_task_id(data: object) -> None | str | Unset: + def _parse_asana_task_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) asana_task_id = _parse_asana_task_id(d.pop("asana_task_id", UNSET)) - def _parse_asana_task_url(data: object) -> None | str | Unset: + def _parse_asana_task_url(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) asana_task_url = _parse_asana_task_url(d.pop("asana_task_url", UNSET)) - def _parse_linear_issue_id(data: object) -> None | str | Unset: + def _parse_linear_issue_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) linear_issue_id = _parse_linear_issue_id(d.pop("linear_issue_id", UNSET)) - def _parse_linear_issue_url(data: object) -> None | str | Unset: + def _parse_linear_issue_url(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) linear_issue_url = _parse_linear_issue_url(d.pop("linear_issue_url", UNSET)) - def _parse_trello_card_id(data: object) -> None | str | Unset: + def _parse_trello_card_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) trello_card_id = _parse_trello_card_id(d.pop("trello_card_id", UNSET)) - def _parse_trello_card_url(data: object) -> None | str | Unset: + def _parse_trello_card_url(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) trello_card_url = _parse_trello_card_url(d.pop("trello_card_url", UNSET)) - def _parse_zendesk_ticket_id(data: object) -> None | str | Unset: + def _parse_zendesk_ticket_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) zendesk_ticket_id = _parse_zendesk_ticket_id(d.pop("zendesk_ticket_id", UNSET)) - def _parse_zendesk_ticket_url(data: object) -> None | str | Unset: + def _parse_zendesk_ticket_url(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) zendesk_ticket_url = _parse_zendesk_ticket_url(d.pop("zendesk_ticket_url", UNSET)) - def _parse_pagerduty_incident_id(data: object) -> None | str | Unset: + def _parse_pagerduty_incident_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) pagerduty_incident_id = _parse_pagerduty_incident_id(d.pop("pagerduty_incident_id", UNSET)) - def _parse_pagerduty_incident_number(data: object) -> None | str | Unset: + def _parse_pagerduty_incident_number(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) pagerduty_incident_number = _parse_pagerduty_incident_number(d.pop("pagerduty_incident_number", UNSET)) - def _parse_pagerduty_incident_url(data: object) -> None | str | Unset: + def _parse_pagerduty_incident_url(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) pagerduty_incident_url = _parse_pagerduty_incident_url(d.pop("pagerduty_incident_url", UNSET)) - def _parse_opsgenie_incident_id(data: object) -> None | str | Unset: + def _parse_opsgenie_incident_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) opsgenie_incident_id = _parse_opsgenie_incident_id(d.pop("opsgenie_incident_id", UNSET)) - def _parse_opsgenie_incident_url(data: object) -> None | str | Unset: + def _parse_opsgenie_incident_url(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) opsgenie_incident_url = _parse_opsgenie_incident_url(d.pop("opsgenie_incident_url", UNSET)) - def _parse_opsgenie_alert_id(data: object) -> None | str | Unset: + def _parse_opsgenie_alert_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) opsgenie_alert_id = _parse_opsgenie_alert_id(d.pop("opsgenie_alert_id", UNSET)) - def _parse_opsgenie_alert_url(data: object) -> None | str | Unset: + def _parse_opsgenie_alert_url(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) opsgenie_alert_url = _parse_opsgenie_alert_url(d.pop("opsgenie_alert_url", UNSET)) - def _parse_service_now_incident_id(data: object) -> None | str | Unset: + def _parse_service_now_incident_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) service_now_incident_id = _parse_service_now_incident_id(d.pop("service_now_incident_id", UNSET)) - def _parse_service_now_incident_key(data: object) -> None | str | Unset: + def _parse_service_now_incident_key(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) service_now_incident_key = _parse_service_now_incident_key(d.pop("service_now_incident_key", UNSET)) - def _parse_service_now_incident_url(data: object) -> None | str | Unset: + def _parse_service_now_incident_url(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) service_now_incident_url = _parse_service_now_incident_url(d.pop("service_now_incident_url", UNSET)) - def _parse_mattermost_channel_id(data: object) -> None | str | Unset: + def _parse_mattermost_channel_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) mattermost_channel_id = _parse_mattermost_channel_id(d.pop("mattermost_channel_id", UNSET)) - def _parse_mattermost_channel_name(data: object) -> None | str | Unset: + def _parse_mattermost_channel_name(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) mattermost_channel_name = _parse_mattermost_channel_name(d.pop("mattermost_channel_name", UNSET)) - def _parse_mattermost_channel_url(data: object) -> None | str | Unset: + def _parse_mattermost_channel_url(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) mattermost_channel_url = _parse_mattermost_channel_url(d.pop("mattermost_channel_url", UNSET)) - def _parse_confluence_page_id(data: object) -> None | str | Unset: + def _parse_confluence_page_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) confluence_page_id = _parse_confluence_page_id(d.pop("confluence_page_id", UNSET)) - def _parse_confluence_page_url(data: object) -> None | str | Unset: + def _parse_confluence_page_url(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) confluence_page_url = _parse_confluence_page_url(d.pop("confluence_page_url", UNSET)) - def _parse_datadog_notebook_id(data: object) -> None | str | Unset: + def _parse_datadog_notebook_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) datadog_notebook_id = _parse_datadog_notebook_id(d.pop("datadog_notebook_id", UNSET)) - def _parse_datadog_notebook_url(data: object) -> None | str | Unset: + def _parse_datadog_notebook_url(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) datadog_notebook_url = _parse_datadog_notebook_url(d.pop("datadog_notebook_url", UNSET)) - def _parse_shortcut_story_id(data: object) -> None | str | Unset: + def _parse_shortcut_story_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) shortcut_story_id = _parse_shortcut_story_id(d.pop("shortcut_story_id", UNSET)) - def _parse_shortcut_story_url(data: object) -> None | str | Unset: + def _parse_shortcut_story_url(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) shortcut_story_url = _parse_shortcut_story_url(d.pop("shortcut_story_url", UNSET)) - def _parse_shortcut_task_id(data: object) -> None | str | Unset: + def _parse_shortcut_task_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) shortcut_task_id = _parse_shortcut_task_id(d.pop("shortcut_task_id", UNSET)) - def _parse_shortcut_task_url(data: object) -> None | str | Unset: + def _parse_shortcut_task_url(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) shortcut_task_url = _parse_shortcut_task_url(d.pop("shortcut_task_url", UNSET)) - def _parse_motion_task_id(data: object) -> None | str | Unset: + def _parse_motion_task_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) motion_task_id = _parse_motion_task_id(d.pop("motion_task_id", UNSET)) - def _parse_motion_task_url(data: object) -> None | str | Unset: + def _parse_motion_task_url(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) motion_task_url = _parse_motion_task_url(d.pop("motion_task_url", UNSET)) - def _parse_clickup_task_id(data: object) -> None | str | Unset: + def _parse_clickup_task_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) clickup_task_id = _parse_clickup_task_id(d.pop("clickup_task_id", UNSET)) - def _parse_clickup_task_url(data: object) -> None | str | Unset: + def _parse_clickup_task_url(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) clickup_task_url = _parse_clickup_task_url(d.pop("clickup_task_url", UNSET)) - def _parse_victor_ops_incident_id(data: object) -> None | str | Unset: + def _parse_victor_ops_incident_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) victor_ops_incident_id = _parse_victor_ops_incident_id(d.pop("victor_ops_incident_id", UNSET)) - def _parse_victor_ops_incident_url(data: object) -> None | str | Unset: + def _parse_victor_ops_incident_url(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) victor_ops_incident_url = _parse_victor_ops_incident_url(d.pop("victor_ops_incident_url", UNSET)) - def _parse_quip_page_id(data: object) -> None | str | Unset: + def _parse_quip_page_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) quip_page_id = _parse_quip_page_id(d.pop("quip_page_id", UNSET)) - def _parse_quip_page_url(data: object) -> None | str | Unset: + def _parse_quip_page_url(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) quip_page_url = _parse_quip_page_url(d.pop("quip_page_url", UNSET)) - def _parse_sharepoint_page_id(data: object) -> None | str | Unset: + def _parse_sharepoint_page_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) sharepoint_page_id = _parse_sharepoint_page_id(d.pop("sharepoint_page_id", UNSET)) - def _parse_sharepoint_page_url(data: object) -> None | str | Unset: + def _parse_sharepoint_page_url(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) sharepoint_page_url = _parse_sharepoint_page_url(d.pop("sharepoint_page_url", UNSET)) - def _parse_airtable_base_key(data: object) -> None | str | Unset: + def _parse_airtable_base_key(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) airtable_base_key = _parse_airtable_base_key(d.pop("airtable_base_key", UNSET)) - def _parse_airtable_table_name(data: object) -> None | str | Unset: + def _parse_airtable_table_name(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) airtable_table_name = _parse_airtable_table_name(d.pop("airtable_table_name", UNSET)) - def _parse_airtable_record_id(data: object) -> None | str | Unset: + def _parse_airtable_record_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) airtable_record_id = _parse_airtable_record_id(d.pop("airtable_record_id", UNSET)) - def _parse_airtable_record_url(data: object) -> None | str | Unset: + def _parse_airtable_record_url(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) airtable_record_url = _parse_airtable_record_url(d.pop("airtable_record_url", UNSET)) - def _parse_freshservice_ticket_id(data: object) -> None | str | Unset: + def _parse_freshservice_ticket_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) freshservice_ticket_id = _parse_freshservice_ticket_id(d.pop("freshservice_ticket_id", UNSET)) - def _parse_freshservice_ticket_url(data: object) -> None | str | Unset: + def _parse_freshservice_ticket_url(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) freshservice_ticket_url = _parse_freshservice_ticket_url(d.pop("freshservice_ticket_url", UNSET)) - def _parse_freshservice_task_id(data: object) -> None | str | Unset: + def _parse_freshservice_task_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) freshservice_task_id = _parse_freshservice_task_id(d.pop("freshservice_task_id", UNSET)) - def _parse_freshservice_task_url(data: object) -> None | str | Unset: + def _parse_freshservice_task_url(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) freshservice_task_url = _parse_freshservice_task_url(d.pop("freshservice_task_url", UNSET)) - def _parse_mitigation_message(data: object) -> None | str | Unset: + def _parse_mitigation_message(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) mitigation_message = _parse_mitigation_message(d.pop("mitigation_message", UNSET)) - def _parse_resolution_message(data: object) -> None | str | Unset: + def _parse_resolution_message(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) resolution_message = _parse_resolution_message(d.pop("resolution_message", UNSET)) - def _parse_cancellation_message(data: object) -> None | str | Unset: + def _parse_cancellation_message(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) cancellation_message = _parse_cancellation_message(d.pop("cancellation_message", UNSET)) - def _parse_scheduled_for(data: object) -> None | str | Unset: + def _parse_scheduled_for(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) scheduled_for = _parse_scheduled_for(d.pop("scheduled_for", UNSET)) - def _parse_scheduled_until(data: object) -> None | str | Unset: + def _parse_scheduled_until(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) scheduled_until = _parse_scheduled_until(d.pop("scheduled_until", UNSET)) - def _parse_muted_service_ids(data: object) -> list[str] | None | Unset: + def _parse_muted_service_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -2583,20 +2583,20 @@ def _parse_muted_service_ids(data: object) -> list[str] | None | Unset: muted_service_ids_type_0 = cast(list[str], data) return muted_service_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) muted_service_ids = _parse_muted_service_ids(d.pop("muted_service_ids", UNSET)) _retrospective_progress_status = d.pop("retrospective_progress_status", UNSET) - retrospective_progress_status: IncidentRetrospectiveProgressStatus | Unset + retrospective_progress_status: Union[Unset, IncidentRetrospectiveProgressStatus] if isinstance(_retrospective_progress_status, Unset): retrospective_progress_status = UNSET else: retrospective_progress_status = check_incident_retrospective_progress_status(_retrospective_progress_status) - def _parse_in_triage_by(data: object) -> IncidentInTriageByType0 | None | Unset: + def _parse_in_triage_by(data: object) -> Union["IncidentInTriageByType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -2607,13 +2607,13 @@ def _parse_in_triage_by(data: object) -> IncidentInTriageByType0 | None | Unset: in_triage_by_type_0 = IncidentInTriageByType0.from_dict(data) return in_triage_by_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(IncidentInTriageByType0 | None | Unset, data) + return cast(Union["IncidentInTriageByType0", None, Unset], data) in_triage_by = _parse_in_triage_by(d.pop("in_triage_by", UNSET)) - def _parse_started_by(data: object) -> IncidentStartedByType0 | None | Unset: + def _parse_started_by(data: object) -> Union["IncidentStartedByType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -2624,13 +2624,13 @@ def _parse_started_by(data: object) -> IncidentStartedByType0 | None | Unset: started_by_type_0 = IncidentStartedByType0.from_dict(data) return started_by_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(IncidentStartedByType0 | None | Unset, data) + return cast(Union["IncidentStartedByType0", None, Unset], data) started_by = _parse_started_by(d.pop("started_by", UNSET)) - def _parse_mitigated_by(data: object) -> IncidentMitigatedByType0 | None | Unset: + def _parse_mitigated_by(data: object) -> Union["IncidentMitigatedByType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -2641,13 +2641,13 @@ def _parse_mitigated_by(data: object) -> IncidentMitigatedByType0 | None | Unset mitigated_by_type_0 = IncidentMitigatedByType0.from_dict(data) return mitigated_by_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(IncidentMitigatedByType0 | None | Unset, data) + return cast(Union["IncidentMitigatedByType0", None, Unset], data) mitigated_by = _parse_mitigated_by(d.pop("mitigated_by", UNSET)) - def _parse_resolved_by(data: object) -> IncidentResolvedByType0 | None | Unset: + def _parse_resolved_by(data: object) -> Union["IncidentResolvedByType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -2658,13 +2658,13 @@ def _parse_resolved_by(data: object) -> IncidentResolvedByType0 | None | Unset: resolved_by_type_0 = IncidentResolvedByType0.from_dict(data) return resolved_by_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(IncidentResolvedByType0 | None | Unset, data) + return cast(Union["IncidentResolvedByType0", None, Unset], data) resolved_by = _parse_resolved_by(d.pop("resolved_by", UNSET)) - def _parse_closed_by(data: object) -> IncidentClosedByType0 | None | Unset: + def _parse_closed_by(data: object) -> Union["IncidentClosedByType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -2675,13 +2675,13 @@ def _parse_closed_by(data: object) -> IncidentClosedByType0 | None | Unset: closed_by_type_0 = IncidentClosedByType0.from_dict(data) return closed_by_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(IncidentClosedByType0 | None | Unset, data) + return cast(Union["IncidentClosedByType0", None, Unset], data) closed_by = _parse_closed_by(d.pop("closed_by", UNSET)) - def _parse_cancelled_by(data: object) -> IncidentCancelledByType0 | None | Unset: + def _parse_cancelled_by(data: object) -> Union["IncidentCancelledByType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -2692,81 +2692,81 @@ def _parse_cancelled_by(data: object) -> IncidentCancelledByType0 | None | Unset cancelled_by_type_0 = IncidentCancelledByType0.from_dict(data) return cancelled_by_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(IncidentCancelledByType0 | None | Unset, data) + return cast(Union["IncidentCancelledByType0", None, Unset], data) cancelled_by = _parse_cancelled_by(d.pop("cancelled_by", UNSET)) - def _parse_in_triage_at(data: object) -> None | str | Unset: + def _parse_in_triage_at(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) in_triage_at = _parse_in_triage_at(d.pop("in_triage_at", UNSET)) - def _parse_started_at(data: object) -> None | str | Unset: + def _parse_started_at(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) started_at = _parse_started_at(d.pop("started_at", UNSET)) - def _parse_detected_at(data: object) -> None | str | Unset: + def _parse_detected_at(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) detected_at = _parse_detected_at(d.pop("detected_at", UNSET)) - def _parse_acknowledged_at(data: object) -> None | str | Unset: + def _parse_acknowledged_at(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) acknowledged_at = _parse_acknowledged_at(d.pop("acknowledged_at", UNSET)) - def _parse_mitigated_at(data: object) -> None | str | Unset: + def _parse_mitigated_at(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) mitigated_at = _parse_mitigated_at(d.pop("mitigated_at", UNSET)) - def _parse_resolved_at(data: object) -> None | str | Unset: + def _parse_resolved_at(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) resolved_at = _parse_resolved_at(d.pop("resolved_at", UNSET)) - def _parse_closed_at(data: object) -> None | str | Unset: + def _parse_closed_at(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) closed_at = _parse_closed_at(d.pop("closed_at", UNSET)) - def _parse_cancelled_at(data: object) -> None | str | Unset: + def _parse_cancelled_at(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) cancelled_at = _parse_cancelled_at(d.pop("cancelled_at", UNSET)) diff --git a/rootly_sdk/models/incident_action_item.py b/rootly_sdk/models/incident_action_item.py index ded60de4..332f70c7 100644 --- a/rootly_sdk/models/incident_action_item.py +++ b/rootly_sdk/models/incident_action_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -25,60 +23,59 @@ class IncidentActionItem: summary (str): The summary of the action item created_at (str): Date of creation updated_at (str): Date of last update - description (None | str | Unset): The description of incident action item - kind (IncidentActionItemKind | Unset): The kind of the action item - assigned_to (UserFlatResponse | Unset): Flat user attributes as returned by UserFlatSerializer (no nested + description (Union[None, Unset, str]): The description of incident action item + kind (Union[Unset, IncidentActionItemKind]): The kind of the action item + assigned_to (Union[Unset, UserFlatResponse]): Flat user attributes as returned by UserFlatSerializer (no nested associations) - assigned_to_group_ids (list[str] | None | Unset): IDs of groups you wish to assign this action item - priority (IncidentActionItemPriority | Unset): The priority of the action item - status (IncidentActionItemStatus | Unset): The status of the action item - due_date (None | str | Unset): The due date of the action item - jira_issue_id (None | str | Unset): The Jira issue ID. - jira_issue_key (None | str | Unset): The Jira issue key. - jira_issue_url (None | str | Unset): The Jira issue URL. - created_by (UserFlatResponse | Unset): Flat user attributes as returned by UserFlatSerializer (no nested + assigned_to_group_ids (Union[None, Unset, list[str]]): IDs of groups you wish to assign this action item + priority (Union[Unset, IncidentActionItemPriority]): The priority of the action item + status (Union[Unset, IncidentActionItemStatus]): The status of the action item + due_date (Union[None, Unset, str]): The due date of the action item + jira_issue_id (Union[None, Unset, str]): The Jira issue ID. + jira_issue_key (Union[None, Unset, str]): The Jira issue key. + jira_issue_url (Union[None, Unset, str]): The Jira issue URL. + created_by (Union[Unset, UserFlatResponse]): Flat user attributes as returned by UserFlatSerializer (no nested associations) """ summary: str created_at: str updated_at: str - description: None | str | Unset = UNSET - kind: IncidentActionItemKind | Unset = UNSET - assigned_to: UserFlatResponse | Unset = UNSET - assigned_to_group_ids: list[str] | None | Unset = UNSET - priority: IncidentActionItemPriority | Unset = UNSET - status: IncidentActionItemStatus | Unset = UNSET - due_date: None | str | Unset = UNSET - jira_issue_id: None | str | Unset = UNSET - jira_issue_key: None | str | Unset = UNSET - jira_issue_url: None | str | Unset = UNSET - created_by: UserFlatResponse | Unset = UNSET + description: Union[None, Unset, str] = UNSET + kind: Union[Unset, IncidentActionItemKind] = UNSET + assigned_to: Union[Unset, "UserFlatResponse"] = UNSET + assigned_to_group_ids: Union[None, Unset, list[str]] = UNSET + priority: Union[Unset, IncidentActionItemPriority] = UNSET + status: Union[Unset, IncidentActionItemStatus] = UNSET + due_date: Union[None, Unset, str] = UNSET + jira_issue_id: Union[None, Unset, str] = UNSET + jira_issue_key: Union[None, Unset, str] = UNSET + jira_issue_url: Union[None, Unset, str] = UNSET + created_by: Union[Unset, "UserFlatResponse"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - summary = self.summary created_at = self.created_at updated_at = self.updated_at - description: None | str | Unset + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: description = self.description - kind: str | Unset = UNSET + kind: Union[Unset, str] = UNSET if not isinstance(self.kind, Unset): kind = self.kind - assigned_to: dict[str, Any] | Unset = UNSET + assigned_to: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.assigned_to, Unset): assigned_to = self.assigned_to.to_dict() - assigned_to_group_ids: list[str] | None | Unset + assigned_to_group_ids: Union[None, Unset, list[str]] if isinstance(self.assigned_to_group_ids, Unset): assigned_to_group_ids = UNSET elif isinstance(self.assigned_to_group_ids, list): @@ -87,39 +84,39 @@ def to_dict(self) -> dict[str, Any]: else: assigned_to_group_ids = self.assigned_to_group_ids - priority: str | Unset = UNSET + priority: Union[Unset, str] = UNSET if not isinstance(self.priority, Unset): priority = self.priority - status: str | Unset = UNSET + status: Union[Unset, str] = UNSET if not isinstance(self.status, Unset): status = self.status - due_date: None | str | Unset + due_date: Union[None, Unset, str] if isinstance(self.due_date, Unset): due_date = UNSET else: due_date = self.due_date - jira_issue_id: None | str | Unset + jira_issue_id: Union[None, Unset, str] if isinstance(self.jira_issue_id, Unset): jira_issue_id = UNSET else: jira_issue_id = self.jira_issue_id - jira_issue_key: None | str | Unset + jira_issue_key: Union[None, Unset, str] if isinstance(self.jira_issue_key, Unset): jira_issue_key = UNSET else: jira_issue_key = self.jira_issue_key - jira_issue_url: None | str | Unset + jira_issue_url: Union[None, Unset, str] if isinstance(self.jira_issue_url, Unset): jira_issue_url = UNSET else: jira_issue_url = self.jira_issue_url - created_by: dict[str, Any] | Unset = UNSET + created_by: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.created_by, Unset): created_by = self.created_by.to_dict() @@ -168,30 +165,30 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: updated_at = d.pop("updated_at") - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) _kind = d.pop("kind", UNSET) - kind: IncidentActionItemKind | Unset + kind: Union[Unset, IncidentActionItemKind] if isinstance(_kind, Unset): kind = UNSET else: kind = check_incident_action_item_kind(_kind) _assigned_to = d.pop("assigned_to", UNSET) - assigned_to: UserFlatResponse | Unset + assigned_to: Union[Unset, UserFlatResponse] if isinstance(_assigned_to, Unset): assigned_to = UNSET else: assigned_to = UserFlatResponse.from_dict(_assigned_to) - def _parse_assigned_to_group_ids(data: object) -> list[str] | None | Unset: + def _parse_assigned_to_group_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -202,64 +199,64 @@ def _parse_assigned_to_group_ids(data: object) -> list[str] | None | Unset: assigned_to_group_ids_type_0 = cast(list[str], data) return assigned_to_group_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) assigned_to_group_ids = _parse_assigned_to_group_ids(d.pop("assigned_to_group_ids", UNSET)) _priority = d.pop("priority", UNSET) - priority: IncidentActionItemPriority | Unset + priority: Union[Unset, IncidentActionItemPriority] if isinstance(_priority, Unset): priority = UNSET else: priority = check_incident_action_item_priority(_priority) _status = d.pop("status", UNSET) - status: IncidentActionItemStatus | Unset + status: Union[Unset, IncidentActionItemStatus] if isinstance(_status, Unset): status = UNSET else: status = check_incident_action_item_status(_status) - def _parse_due_date(data: object) -> None | str | Unset: + def _parse_due_date(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) due_date = _parse_due_date(d.pop("due_date", UNSET)) - def _parse_jira_issue_id(data: object) -> None | str | Unset: + def _parse_jira_issue_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) jira_issue_id = _parse_jira_issue_id(d.pop("jira_issue_id", UNSET)) - def _parse_jira_issue_key(data: object) -> None | str | Unset: + def _parse_jira_issue_key(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) jira_issue_key = _parse_jira_issue_key(d.pop("jira_issue_key", UNSET)) - def _parse_jira_issue_url(data: object) -> None | str | Unset: + def _parse_jira_issue_url(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) jira_issue_url = _parse_jira_issue_url(d.pop("jira_issue_url", UNSET)) _created_by = d.pop("created_by", UNSET) - created_by: UserFlatResponse | Unset + created_by: Union[Unset, UserFlatResponse] if isinstance(_created_by, Unset): created_by = UNSET else: diff --git a/rootly_sdk/models/incident_action_item_list.py b/rootly_sdk/models/incident_action_item_list.py index 05633372..69503bcb 100644 --- a/rootly_sdk/models/incident_action_item_list.py +++ b/rootly_sdk/models/incident_action_item_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,20 +20,19 @@ class IncidentActionItemList: """ Attributes: - data (list[IncidentActionItemListDataItem]): + data (list['IncidentActionItemListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[IncidentActionItemListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["IncidentActionItemListDataItem"] + links: "Links" + meta: "Meta" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) incident_action_item_list = cls( data=data, diff --git a/rootly_sdk/models/incident_action_item_list_data_item.py b/rootly_sdk/models/incident_action_item_list_data_item.py index ce06e3de..99e97c67 100644 --- a/rootly_sdk/models/incident_action_item_list_data_item.py +++ b/rootly_sdk/models/incident_action_item_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class IncidentActionItemListDataItem: id: str type_: IncidentActionItemListDataItemType - attributes: IncidentActionItem + attributes: "IncidentActionItem" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/incident_action_item_response.py b/rootly_sdk/models/incident_action_item_response.py index 02edb2d1..be2da360 100644 --- a/rootly_sdk/models/incident_action_item_response.py +++ b/rootly_sdk/models/incident_action_item_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,18 +19,17 @@ class IncidentActionItemResponse: """ Attributes: data (IncidentActionItemResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: IncidentActionItemResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "IncidentActionItemResponseData" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = IncidentActionItemResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) incident_action_item_response = cls( data=data, diff --git a/rootly_sdk/models/incident_action_item_response_data.py b/rootly_sdk/models/incident_action_item_response_data.py index 6a0ef40e..c21de0b4 100644 --- a/rootly_sdk/models/incident_action_item_response_data.py +++ b/rootly_sdk/models/incident_action_item_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class IncidentActionItemResponseData: id: str type_: IncidentActionItemResponseDataType - attributes: IncidentActionItem + attributes: "IncidentActionItem" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/incident_cancelled_by_type_0.py b/rootly_sdk/models/incident_cancelled_by_type_0.py index 0e7a89aa..12d1b454 100644 --- a/rootly_sdk/models/incident_cancelled_by_type_0.py +++ b/rootly_sdk/models/incident_cancelled_by_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,7 +14,6 @@ class IncidentCancelledByType0: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) diff --git a/rootly_sdk/models/incident_closed_by_type_0.py b/rootly_sdk/models/incident_closed_by_type_0.py index 27fb3bfc..71d3c34a 100644 --- a/rootly_sdk/models/incident_closed_by_type_0.py +++ b/rootly_sdk/models/incident_closed_by_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,7 +14,6 @@ class IncidentClosedByType0: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) diff --git a/rootly_sdk/models/incident_custom_field_selection.py b/rootly_sdk/models/incident_custom_field_selection.py index 8fb65665..5002b00e 100644 --- a/rootly_sdk/models/incident_custom_field_selection.py +++ b/rootly_sdk/models/incident_custom_field_selection.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,20 +13,20 @@ class IncidentCustomFieldSelection: """ Attributes: - value (None | str): The value of the incident_custom_field_selection + value (Union[None, str]): The value of the incident_custom_field_selection selected_option_ids (list[int]): - incident_id (str | Unset): - custom_field_id (int | Unset): + incident_id (Union[Unset, str]): + custom_field_id (Union[Unset, int]): """ - value: None | str + value: Union[None, str] selected_option_ids: list[int] - incident_id: str | Unset = UNSET - custom_field_id: int | Unset = UNSET + incident_id: Union[Unset, str] = UNSET + custom_field_id: Union[Unset, int] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - value: None | str + value: Union[None, str] value = self.value selected_option_ids = self.selected_option_ids @@ -56,10 +54,10 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_value(data: object) -> None | str: + def _parse_value(data: object) -> Union[None, str]: if data is None: return data - return cast(None | str, data) + return cast(Union[None, str], data) value = _parse_value(d.pop("value")) diff --git a/rootly_sdk/models/incident_custom_field_selection_list.py b/rootly_sdk/models/incident_custom_field_selection_list.py index da3943db..91616131 100644 --- a/rootly_sdk/models/incident_custom_field_selection_list.py +++ b/rootly_sdk/models/incident_custom_field_selection_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,20 +20,19 @@ class IncidentCustomFieldSelectionList: """ Attributes: - data (list[IncidentCustomFieldSelectionListDataItem]): + data (list['IncidentCustomFieldSelectionListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[IncidentCustomFieldSelectionListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["IncidentCustomFieldSelectionListDataItem"] + links: "Links" + meta: "Meta" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) incident_custom_field_selection_list = cls( data=data, diff --git a/rootly_sdk/models/incident_custom_field_selection_list_data_item.py b/rootly_sdk/models/incident_custom_field_selection_list_data_item.py index 699bb419..33a38024 100644 --- a/rootly_sdk/models/incident_custom_field_selection_list_data_item.py +++ b/rootly_sdk/models/incident_custom_field_selection_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class IncidentCustomFieldSelectionListDataItem: id: str type_: IncidentCustomFieldSelectionListDataItemType - attributes: IncidentCustomFieldSelection + attributes: "IncidentCustomFieldSelection" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/incident_custom_field_selection_response.py b/rootly_sdk/models/incident_custom_field_selection_response.py index 2f0b51f0..1660f39d 100644 --- a/rootly_sdk/models/incident_custom_field_selection_response.py +++ b/rootly_sdk/models/incident_custom_field_selection_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,18 +19,17 @@ class IncidentCustomFieldSelectionResponse: """ Attributes: data (IncidentCustomFieldSelectionResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: IncidentCustomFieldSelectionResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "IncidentCustomFieldSelectionResponseData" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = IncidentCustomFieldSelectionResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) incident_custom_field_selection_response = cls( data=data, diff --git a/rootly_sdk/models/incident_custom_field_selection_response_data.py b/rootly_sdk/models/incident_custom_field_selection_response_data.py index 7648082d..9ef29384 100644 --- a/rootly_sdk/models/incident_custom_field_selection_response_data.py +++ b/rootly_sdk/models/incident_custom_field_selection_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class IncidentCustomFieldSelectionResponseData: id: str type_: IncidentCustomFieldSelectionResponseDataType - attributes: IncidentCustomFieldSelection + attributes: "IncidentCustomFieldSelection" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/incident_event.py b/rootly_sdk/models/incident_event.py index 0f1d3de6..389298bb 100644 --- a/rootly_sdk/models/incident_event.py +++ b/rootly_sdk/models/incident_event.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -20,14 +18,14 @@ class IncidentEvent: occurred_at (str): Date of occurence created_at (str): Date of creation updated_at (str): Date of last update - visibility (IncidentEventVisibility | Unset): The visibility of the incident action item + visibility (Union[Unset, IncidentEventVisibility]): The visibility of the incident action item """ event: str occurred_at: str created_at: str updated_at: str - visibility: IncidentEventVisibility | Unset = UNSET + visibility: Union[Unset, IncidentEventVisibility] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -39,7 +37,7 @@ def to_dict(self) -> dict[str, Any]: updated_at = self.updated_at - visibility: str | Unset = UNSET + visibility: Union[Unset, str] = UNSET if not isinstance(self.visibility, Unset): visibility = self.visibility @@ -70,7 +68,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: updated_at = d.pop("updated_at") _visibility = d.pop("visibility", UNSET) - visibility: IncidentEventVisibility | Unset + visibility: Union[Unset, IncidentEventVisibility] if isinstance(_visibility, Unset): visibility = UNSET else: diff --git a/rootly_sdk/models/incident_event_functionality.py b/rootly_sdk/models/incident_event_functionality.py index 2283fbd7..9bbee28a 100644 --- a/rootly_sdk/models/incident_event_functionality.py +++ b/rootly_sdk/models/incident_event_functionality.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/incident_event_functionality_list.py b/rootly_sdk/models/incident_event_functionality_list.py index eb338790..775ed9ae 100644 --- a/rootly_sdk/models/incident_event_functionality_list.py +++ b/rootly_sdk/models/incident_event_functionality_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,20 +20,19 @@ class IncidentEventFunctionalityList: """ Attributes: - data (list[IncidentEventFunctionalityListDataItem]): + data (list['IncidentEventFunctionalityListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[IncidentEventFunctionalityListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["IncidentEventFunctionalityListDataItem"] + links: "Links" + meta: "Meta" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) incident_event_functionality_list = cls( data=data, diff --git a/rootly_sdk/models/incident_event_functionality_list_data_item.py b/rootly_sdk/models/incident_event_functionality_list_data_item.py index 3c9b49cc..aaa8b50f 100644 --- a/rootly_sdk/models/incident_event_functionality_list_data_item.py +++ b/rootly_sdk/models/incident_event_functionality_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class IncidentEventFunctionalityListDataItem: id: str type_: IncidentEventFunctionalityListDataItemType - attributes: IncidentEventFunctionality + attributes: "IncidentEventFunctionality" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/incident_event_functionality_response.py b/rootly_sdk/models/incident_event_functionality_response.py index 6f00656f..7b0c7e98 100644 --- a/rootly_sdk/models/incident_event_functionality_response.py +++ b/rootly_sdk/models/incident_event_functionality_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,18 +19,17 @@ class IncidentEventFunctionalityResponse: """ Attributes: data (IncidentEventFunctionalityResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: IncidentEventFunctionalityResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "IncidentEventFunctionalityResponseData" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = IncidentEventFunctionalityResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) incident_event_functionality_response = cls( data=data, diff --git a/rootly_sdk/models/incident_event_functionality_response_data.py b/rootly_sdk/models/incident_event_functionality_response_data.py index 76ca707a..41215a06 100644 --- a/rootly_sdk/models/incident_event_functionality_response_data.py +++ b/rootly_sdk/models/incident_event_functionality_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class IncidentEventFunctionalityResponseData: id: str type_: IncidentEventFunctionalityResponseDataType - attributes: IncidentEventFunctionality + attributes: "IncidentEventFunctionality" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/incident_event_list.py b/rootly_sdk/models/incident_event_list.py index 10bdd165..59b0ab96 100644 --- a/rootly_sdk/models/incident_event_list.py +++ b/rootly_sdk/models/incident_event_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,20 +20,19 @@ class IncidentEventList: """ Attributes: - data (list[IncidentEventListDataItem]): + data (list['IncidentEventListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[IncidentEventListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["IncidentEventListDataItem"] + links: "Links" + meta: "Meta" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) incident_event_list = cls( data=data, diff --git a/rootly_sdk/models/incident_event_list_data_item.py b/rootly_sdk/models/incident_event_list_data_item.py index 40a5cfc6..c895c45b 100644 --- a/rootly_sdk/models/incident_event_list_data_item.py +++ b/rootly_sdk/models/incident_event_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class IncidentEventListDataItem: id: str type_: IncidentEventListDataItemType - attributes: IncidentEvent + attributes: "IncidentEvent" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/incident_event_response.py b/rootly_sdk/models/incident_event_response.py index 13afb6a3..b63254b8 100644 --- a/rootly_sdk/models/incident_event_response.py +++ b/rootly_sdk/models/incident_event_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,18 +19,17 @@ class IncidentEventResponse: """ Attributes: data (IncidentEventResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: IncidentEventResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "IncidentEventResponseData" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = IncidentEventResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) incident_event_response = cls( data=data, diff --git a/rootly_sdk/models/incident_event_response_data.py b/rootly_sdk/models/incident_event_response_data.py index e276e0a7..0f415f3f 100644 --- a/rootly_sdk/models/incident_event_response_data.py +++ b/rootly_sdk/models/incident_event_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class IncidentEventResponseData: id: str type_: IncidentEventResponseDataType - attributes: IncidentEvent + attributes: "IncidentEvent" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/incident_event_service.py b/rootly_sdk/models/incident_event_service.py index 1353bf73..163037e9 100644 --- a/rootly_sdk/models/incident_event_service.py +++ b/rootly_sdk/models/incident_event_service.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/incident_event_service_list.py b/rootly_sdk/models/incident_event_service_list.py index d23a4196..d618b50c 100644 --- a/rootly_sdk/models/incident_event_service_list.py +++ b/rootly_sdk/models/incident_event_service_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,20 +20,19 @@ class IncidentEventServiceList: """ Attributes: - data (list[IncidentEventServiceListDataItem]): + data (list['IncidentEventServiceListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[IncidentEventServiceListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["IncidentEventServiceListDataItem"] + links: "Links" + meta: "Meta" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) incident_event_service_list = cls( data=data, diff --git a/rootly_sdk/models/incident_event_service_list_data_item.py b/rootly_sdk/models/incident_event_service_list_data_item.py index ac443528..64783455 100644 --- a/rootly_sdk/models/incident_event_service_list_data_item.py +++ b/rootly_sdk/models/incident_event_service_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class IncidentEventServiceListDataItem: id: str type_: IncidentEventServiceListDataItemType - attributes: IncidentEventService + attributes: "IncidentEventService" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/incident_event_service_response.py b/rootly_sdk/models/incident_event_service_response.py index ddb7faf7..594a3460 100644 --- a/rootly_sdk/models/incident_event_service_response.py +++ b/rootly_sdk/models/incident_event_service_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,18 +19,17 @@ class IncidentEventServiceResponse: """ Attributes: data (IncidentEventServiceResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: IncidentEventServiceResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "IncidentEventServiceResponseData" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = IncidentEventServiceResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) incident_event_service_response = cls( data=data, diff --git a/rootly_sdk/models/incident_event_service_response_data.py b/rootly_sdk/models/incident_event_service_response_data.py index f1c45109..c684683c 100644 --- a/rootly_sdk/models/incident_event_service_response_data.py +++ b/rootly_sdk/models/incident_event_service_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class IncidentEventServiceResponseData: id: str type_: IncidentEventServiceResponseDataType - attributes: IncidentEventService + attributes: "IncidentEventService" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/incident_feedback.py b/rootly_sdk/models/incident_feedback.py index 4ea237d8..f047ab5e 100644 --- a/rootly_sdk/models/incident_feedback.py +++ b/rootly_sdk/models/incident_feedback.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/incident_feedback_list.py b/rootly_sdk/models/incident_feedback_list.py index 06f51a82..2c6a03ae 100644 --- a/rootly_sdk/models/incident_feedback_list.py +++ b/rootly_sdk/models/incident_feedback_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,20 +20,19 @@ class IncidentFeedbackList: """ Attributes: - data (list[IncidentFeedbackListDataItem]): + data (list['IncidentFeedbackListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[IncidentFeedbackListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["IncidentFeedbackListDataItem"] + links: "Links" + meta: "Meta" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) incident_feedback_list = cls( data=data, diff --git a/rootly_sdk/models/incident_feedback_list_data_item.py b/rootly_sdk/models/incident_feedback_list_data_item.py index 90c09921..f1be8b2d 100644 --- a/rootly_sdk/models/incident_feedback_list_data_item.py +++ b/rootly_sdk/models/incident_feedback_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class IncidentFeedbackListDataItem: id: str type_: IncidentFeedbackListDataItemType - attributes: IncidentFeedback + attributes: "IncidentFeedback" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/incident_feedback_response.py b/rootly_sdk/models/incident_feedback_response.py index 11592806..ba7e01cf 100644 --- a/rootly_sdk/models/incident_feedback_response.py +++ b/rootly_sdk/models/incident_feedback_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,18 +19,17 @@ class IncidentFeedbackResponse: """ Attributes: data (IncidentFeedbackResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: IncidentFeedbackResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "IncidentFeedbackResponseData" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = IncidentFeedbackResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) incident_feedback_response = cls( data=data, diff --git a/rootly_sdk/models/incident_feedback_response_data.py b/rootly_sdk/models/incident_feedback_response_data.py index a152326c..59b31f61 100644 --- a/rootly_sdk/models/incident_feedback_response_data.py +++ b/rootly_sdk/models/incident_feedback_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class IncidentFeedbackResponseData: id: str type_: IncidentFeedbackResponseDataType - attributes: IncidentFeedback + attributes: "IncidentFeedback" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/incident_form_field_selection.py b/rootly_sdk/models/incident_form_field_selection.py index 546b0afb..2fa61a86 100644 --- a/rootly_sdk/models/incident_form_field_selection.py +++ b/rootly_sdk/models/incident_form_field_selection.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,30 +15,30 @@ class IncidentFormFieldSelection: Attributes: incident_id (str): form_field_id (str): The custom field for this selection - value (None | str | Unset): The selected value for text kind custom fields - selected_catalog_entity_ids (list[str] | Unset): - selected_group_ids (list[str] | Unset): - selected_option_ids (list[str] | Unset): - selected_service_ids (list[str] | Unset): - selected_functionality_ids (list[str] | Unset): - selected_user_ids (list[int] | Unset): - selected_environment_ids (list[str] | Unset): - selected_cause_ids (list[str] | Unset): - selected_incident_type_ids (list[str] | Unset): + value (Union[None, Unset, str]): The selected value for text kind custom fields + selected_catalog_entity_ids (Union[Unset, list[str]]): + selected_group_ids (Union[Unset, list[str]]): + selected_option_ids (Union[Unset, list[str]]): + selected_service_ids (Union[Unset, list[str]]): + selected_functionality_ids (Union[Unset, list[str]]): + selected_user_ids (Union[Unset, list[int]]): + selected_environment_ids (Union[Unset, list[str]]): + selected_cause_ids (Union[Unset, list[str]]): + selected_incident_type_ids (Union[Unset, list[str]]): """ incident_id: str form_field_id: str - value: None | str | Unset = UNSET - selected_catalog_entity_ids: list[str] | Unset = UNSET - selected_group_ids: list[str] | Unset = UNSET - selected_option_ids: list[str] | Unset = UNSET - selected_service_ids: list[str] | Unset = UNSET - selected_functionality_ids: list[str] | Unset = UNSET - selected_user_ids: list[int] | Unset = UNSET - selected_environment_ids: list[str] | Unset = UNSET - selected_cause_ids: list[str] | Unset = UNSET - selected_incident_type_ids: list[str] | Unset = UNSET + value: Union[None, Unset, str] = UNSET + selected_catalog_entity_ids: Union[Unset, list[str]] = UNSET + selected_group_ids: Union[Unset, list[str]] = UNSET + selected_option_ids: Union[Unset, list[str]] = UNSET + selected_service_ids: Union[Unset, list[str]] = UNSET + selected_functionality_ids: Union[Unset, list[str]] = UNSET + selected_user_ids: Union[Unset, list[int]] = UNSET + selected_environment_ids: Union[Unset, list[str]] = UNSET + selected_cause_ids: Union[Unset, list[str]] = UNSET + selected_incident_type_ids: Union[Unset, list[str]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -48,45 +46,45 @@ def to_dict(self) -> dict[str, Any]: form_field_id = self.form_field_id - value: None | str | Unset + value: Union[None, Unset, str] if isinstance(self.value, Unset): value = UNSET else: value = self.value - selected_catalog_entity_ids: list[str] | Unset = UNSET + selected_catalog_entity_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.selected_catalog_entity_ids, Unset): selected_catalog_entity_ids = self.selected_catalog_entity_ids - selected_group_ids: list[str] | Unset = UNSET + selected_group_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.selected_group_ids, Unset): selected_group_ids = self.selected_group_ids - selected_option_ids: list[str] | Unset = UNSET + selected_option_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.selected_option_ids, Unset): selected_option_ids = self.selected_option_ids - selected_service_ids: list[str] | Unset = UNSET + selected_service_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.selected_service_ids, Unset): selected_service_ids = self.selected_service_ids - selected_functionality_ids: list[str] | Unset = UNSET + selected_functionality_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.selected_functionality_ids, Unset): selected_functionality_ids = self.selected_functionality_ids - selected_user_ids: list[int] | Unset = UNSET + selected_user_ids: Union[Unset, list[int]] = UNSET if not isinstance(self.selected_user_ids, Unset): selected_user_ids = self.selected_user_ids - selected_environment_ids: list[str] | Unset = UNSET + selected_environment_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.selected_environment_ids, Unset): selected_environment_ids = self.selected_environment_ids - selected_cause_ids: list[str] | Unset = UNSET + selected_cause_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.selected_cause_ids, Unset): selected_cause_ids = self.selected_cause_ids - selected_incident_type_ids: list[str] | Unset = UNSET + selected_incident_type_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.selected_incident_type_ids, Unset): selected_incident_type_ids = self.selected_incident_type_ids @@ -128,12 +126,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: form_field_id = d.pop("form_field_id") - def _parse_value(data: object) -> None | str | Unset: + def _parse_value(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) value = _parse_value(d.pop("value", UNSET)) diff --git a/rootly_sdk/models/incident_form_field_selection_list.py b/rootly_sdk/models/incident_form_field_selection_list.py index 01551dd3..5bd0fc8c 100644 --- a/rootly_sdk/models/incident_form_field_selection_list.py +++ b/rootly_sdk/models/incident_form_field_selection_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,20 +20,19 @@ class IncidentFormFieldSelectionList: """ Attributes: - data (list[IncidentFormFieldSelectionListDataItem]): + data (list['IncidentFormFieldSelectionListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[IncidentFormFieldSelectionListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["IncidentFormFieldSelectionListDataItem"] + links: "Links" + meta: "Meta" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) incident_form_field_selection_list = cls( data=data, diff --git a/rootly_sdk/models/incident_form_field_selection_list_data_item.py b/rootly_sdk/models/incident_form_field_selection_list_data_item.py index 009d5fca..2de7ef35 100644 --- a/rootly_sdk/models/incident_form_field_selection_list_data_item.py +++ b/rootly_sdk/models/incident_form_field_selection_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class IncidentFormFieldSelectionListDataItem: id: str type_: IncidentFormFieldSelectionListDataItemType - attributes: IncidentFormFieldSelection + attributes: "IncidentFormFieldSelection" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/incident_form_field_selection_response.py b/rootly_sdk/models/incident_form_field_selection_response.py index ee4c86c0..45575848 100644 --- a/rootly_sdk/models/incident_form_field_selection_response.py +++ b/rootly_sdk/models/incident_form_field_selection_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,18 +19,17 @@ class IncidentFormFieldSelectionResponse: """ Attributes: data (IncidentFormFieldSelectionResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: IncidentFormFieldSelectionResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "IncidentFormFieldSelectionResponseData" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = IncidentFormFieldSelectionResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) incident_form_field_selection_response = cls( data=data, diff --git a/rootly_sdk/models/incident_form_field_selection_response_data.py b/rootly_sdk/models/incident_form_field_selection_response_data.py index 0054ff14..b10a39c7 100644 --- a/rootly_sdk/models/incident_form_field_selection_response_data.py +++ b/rootly_sdk/models/incident_form_field_selection_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class IncidentFormFieldSelectionResponseData: id: str type_: IncidentFormFieldSelectionResponseDataType - attributes: IncidentFormFieldSelection + attributes: "IncidentFormFieldSelection" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/incident_in_triage_by_type_0.py b/rootly_sdk/models/incident_in_triage_by_type_0.py index d9e70a76..5882e668 100644 --- a/rootly_sdk/models/incident_in_triage_by_type_0.py +++ b/rootly_sdk/models/incident_in_triage_by_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,7 +14,6 @@ class IncidentInTriageByType0: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) diff --git a/rootly_sdk/models/incident_labels_type_0.py b/rootly_sdk/models/incident_labels_type_0.py index 44337a9d..8d2f88e9 100644 --- a/rootly_sdk/models/incident_labels_type_0.py +++ b/rootly_sdk/models/incident_labels_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,7 +14,6 @@ class IncidentLabelsType0: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) diff --git a/rootly_sdk/models/incident_list.py b/rootly_sdk/models/incident_list.py index f5784afc..61e13bb1 100644 --- a/rootly_sdk/models/incident_list.py +++ b/rootly_sdk/models/incident_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,20 +20,19 @@ class IncidentList: """ Attributes: - data (list[IncidentListDataItem]): + data (list['IncidentListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[IncidentListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["IncidentListDataItem"] + links: "Links" + meta: "Meta" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) incident_list = cls( data=data, diff --git a/rootly_sdk/models/incident_list_data_item.py b/rootly_sdk/models/incident_list_data_item.py index 51547f46..babda31a 100644 --- a/rootly_sdk/models/incident_list_data_item.py +++ b/rootly_sdk/models/incident_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class IncidentListDataItem: id: str type_: IncidentListDataItemType - attributes: Incident + attributes: "Incident" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/incident_mitigated_by_type_0.py b/rootly_sdk/models/incident_mitigated_by_type_0.py index cb9cdf55..78045edb 100644 --- a/rootly_sdk/models/incident_mitigated_by_type_0.py +++ b/rootly_sdk/models/incident_mitigated_by_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,7 +14,6 @@ class IncidentMitigatedByType0: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) diff --git a/rootly_sdk/models/incident_permission_set.py b/rootly_sdk/models/incident_permission_set.py index ea4d766a..2c549ea8 100644 --- a/rootly_sdk/models/incident_permission_set.py +++ b/rootly_sdk/models/incident_permission_set.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -26,19 +24,19 @@ class IncidentPermissionSet: name (str): The incident permission set name. created_at (str): updated_at (str): - slug (str | Unset): The incident permission set slug. - description (None | str | Unset): The incident permission set description. - private_incident_permissions (list[IncidentPermissionSetPrivateIncidentPermissionsItem] | Unset): - public_incident_permissions (list[IncidentPermissionSetPublicIncidentPermissionsItem] | Unset): + slug (Union[Unset, str]): The incident permission set slug. + description (Union[None, Unset, str]): The incident permission set description. + private_incident_permissions (Union[Unset, list[IncidentPermissionSetPrivateIncidentPermissionsItem]]): + public_incident_permissions (Union[Unset, list[IncidentPermissionSetPublicIncidentPermissionsItem]]): """ name: str created_at: str updated_at: str - slug: str | Unset = UNSET - description: None | str | Unset = UNSET - private_incident_permissions: list[IncidentPermissionSetPrivateIncidentPermissionsItem] | Unset = UNSET - public_incident_permissions: list[IncidentPermissionSetPublicIncidentPermissionsItem] | Unset = UNSET + slug: Union[Unset, str] = UNSET + description: Union[None, Unset, str] = UNSET + private_incident_permissions: Union[Unset, list[IncidentPermissionSetPrivateIncidentPermissionsItem]] = UNSET + public_incident_permissions: Union[Unset, list[IncidentPermissionSetPublicIncidentPermissionsItem]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -50,20 +48,20 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - description: None | str | Unset + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: description = self.description - private_incident_permissions: list[str] | Unset = UNSET + private_incident_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.private_incident_permissions, Unset): private_incident_permissions = [] for private_incident_permissions_item_data in self.private_incident_permissions: private_incident_permissions_item: str = private_incident_permissions_item_data private_incident_permissions.append(private_incident_permissions_item) - public_incident_permissions: list[str] | Unset = UNSET + public_incident_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.public_incident_permissions, Unset): public_incident_permissions = [] for public_incident_permissions_item_data in self.public_incident_permissions: @@ -101,36 +99,32 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: slug = d.pop("slug", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) + private_incident_permissions = [] _private_incident_permissions = d.pop("private_incident_permissions", UNSET) - private_incident_permissions: list[IncidentPermissionSetPrivateIncidentPermissionsItem] | Unset = UNSET - if _private_incident_permissions is not UNSET: - private_incident_permissions = [] - for private_incident_permissions_item_data in _private_incident_permissions: - private_incident_permissions_item = check_incident_permission_set_private_incident_permissions_item( - private_incident_permissions_item_data - ) + for private_incident_permissions_item_data in _private_incident_permissions or []: + private_incident_permissions_item = check_incident_permission_set_private_incident_permissions_item( + private_incident_permissions_item_data + ) - private_incident_permissions.append(private_incident_permissions_item) + private_incident_permissions.append(private_incident_permissions_item) + public_incident_permissions = [] _public_incident_permissions = d.pop("public_incident_permissions", UNSET) - public_incident_permissions: list[IncidentPermissionSetPublicIncidentPermissionsItem] | Unset = UNSET - if _public_incident_permissions is not UNSET: - public_incident_permissions = [] - for public_incident_permissions_item_data in _public_incident_permissions: - public_incident_permissions_item = check_incident_permission_set_public_incident_permissions_item( - public_incident_permissions_item_data - ) + for public_incident_permissions_item_data in _public_incident_permissions or []: + public_incident_permissions_item = check_incident_permission_set_public_incident_permissions_item( + public_incident_permissions_item_data + ) - public_incident_permissions.append(public_incident_permissions_item) + public_incident_permissions.append(public_incident_permissions_item) incident_permission_set = cls( name=name, diff --git a/rootly_sdk/models/incident_permission_set_boolean.py b/rootly_sdk/models/incident_permission_set_boolean.py index 681230c8..25f42881 100644 --- a/rootly_sdk/models/incident_permission_set_boolean.py +++ b/rootly_sdk/models/incident_permission_set_boolean.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,17 +20,17 @@ class IncidentPermissionSetBoolean: kind (IncidentPermissionSetBooleanKind): created_at (str): updated_at (str): - incident_permission_set_id (str | Unset): - private (bool | Unset): - enabled (bool | Unset): + incident_permission_set_id (Union[Unset, str]): + private (Union[Unset, bool]): + enabled (Union[Unset, bool]): """ kind: IncidentPermissionSetBooleanKind created_at: str updated_at: str - incident_permission_set_id: str | Unset = UNSET - private: bool | Unset = UNSET - enabled: bool | Unset = UNSET + incident_permission_set_id: Union[Unset, str] = UNSET + private: Union[Unset, bool] = UNSET + enabled: Union[Unset, bool] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/incident_permission_set_boolean_list.py b/rootly_sdk/models/incident_permission_set_boolean_list.py index 311b960e..bf0e1697 100644 --- a/rootly_sdk/models/incident_permission_set_boolean_list.py +++ b/rootly_sdk/models/incident_permission_set_boolean_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,20 +20,19 @@ class IncidentPermissionSetBooleanList: """ Attributes: - data (list[IncidentPermissionSetBooleanListDataItem]): + data (list['IncidentPermissionSetBooleanListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[IncidentPermissionSetBooleanListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["IncidentPermissionSetBooleanListDataItem"] + links: "Links" + meta: "Meta" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) incident_permission_set_boolean_list = cls( data=data, diff --git a/rootly_sdk/models/incident_permission_set_boolean_list_data_item.py b/rootly_sdk/models/incident_permission_set_boolean_list_data_item.py index 9297d83e..89085db4 100644 --- a/rootly_sdk/models/incident_permission_set_boolean_list_data_item.py +++ b/rootly_sdk/models/incident_permission_set_boolean_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class IncidentPermissionSetBooleanListDataItem: id: str type_: IncidentPermissionSetBooleanListDataItemType - attributes: IncidentPermissionSetBoolean + attributes: "IncidentPermissionSetBoolean" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/incident_permission_set_boolean_response.py b/rootly_sdk/models/incident_permission_set_boolean_response.py index ec8e91de..42264ffd 100644 --- a/rootly_sdk/models/incident_permission_set_boolean_response.py +++ b/rootly_sdk/models/incident_permission_set_boolean_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,18 +19,17 @@ class IncidentPermissionSetBooleanResponse: """ Attributes: data (IncidentPermissionSetBooleanResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: IncidentPermissionSetBooleanResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "IncidentPermissionSetBooleanResponseData" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = IncidentPermissionSetBooleanResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) incident_permission_set_boolean_response = cls( data=data, diff --git a/rootly_sdk/models/incident_permission_set_boolean_response_data.py b/rootly_sdk/models/incident_permission_set_boolean_response_data.py index 1c20c8e0..a1e629fc 100644 --- a/rootly_sdk/models/incident_permission_set_boolean_response_data.py +++ b/rootly_sdk/models/incident_permission_set_boolean_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class IncidentPermissionSetBooleanResponseData: id: str type_: IncidentPermissionSetBooleanResponseDataType - attributes: IncidentPermissionSetBoolean + attributes: "IncidentPermissionSetBoolean" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/incident_permission_set_list.py b/rootly_sdk/models/incident_permission_set_list.py index 4330dfc6..93150071 100644 --- a/rootly_sdk/models/incident_permission_set_list.py +++ b/rootly_sdk/models/incident_permission_set_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,20 +20,19 @@ class IncidentPermissionSetList: """ Attributes: - data (list[IncidentPermissionSetListDataItem]): + data (list['IncidentPermissionSetListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[IncidentPermissionSetListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["IncidentPermissionSetListDataItem"] + links: "Links" + meta: "Meta" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) incident_permission_set_list = cls( data=data, diff --git a/rootly_sdk/models/incident_permission_set_list_data_item.py b/rootly_sdk/models/incident_permission_set_list_data_item.py index 33f81a19..f6498f4d 100644 --- a/rootly_sdk/models/incident_permission_set_list_data_item.py +++ b/rootly_sdk/models/incident_permission_set_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class IncidentPermissionSetListDataItem: id: str type_: IncidentPermissionSetListDataItemType - attributes: IncidentPermissionSet + attributes: "IncidentPermissionSet" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/incident_permission_set_resource.py b/rootly_sdk/models/incident_permission_set_resource.py index 301cd270..9831ac62 100644 --- a/rootly_sdk/models/incident_permission_set_resource.py +++ b/rootly_sdk/models/incident_permission_set_resource.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,18 +21,18 @@ class IncidentPermissionSetResource: kind (IncidentPermissionSetResourceKind): created_at (str): updated_at (str): - private (bool | Unset): - resource_id (str | Unset): - resource_type (str | Unset): + private (Union[Unset, bool]): + resource_id (Union[Unset, str]): + resource_type (Union[Unset, str]): """ incident_permission_set_id: str kind: IncidentPermissionSetResourceKind created_at: str updated_at: str - private: bool | Unset = UNSET - resource_id: str | Unset = UNSET - resource_type: str | Unset = UNSET + private: Union[Unset, bool] = UNSET + resource_id: Union[Unset, str] = UNSET + resource_type: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/incident_permission_set_resource_list.py b/rootly_sdk/models/incident_permission_set_resource_list.py index 870d831f..3f818b66 100644 --- a/rootly_sdk/models/incident_permission_set_resource_list.py +++ b/rootly_sdk/models/incident_permission_set_resource_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,20 +20,19 @@ class IncidentPermissionSetResourceList: """ Attributes: - data (list[IncidentPermissionSetResourceListDataItem]): + data (list['IncidentPermissionSetResourceListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[IncidentPermissionSetResourceListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["IncidentPermissionSetResourceListDataItem"] + links: "Links" + meta: "Meta" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) incident_permission_set_resource_list = cls( data=data, diff --git a/rootly_sdk/models/incident_permission_set_resource_list_data_item.py b/rootly_sdk/models/incident_permission_set_resource_list_data_item.py index 83bca676..118d6aa1 100644 --- a/rootly_sdk/models/incident_permission_set_resource_list_data_item.py +++ b/rootly_sdk/models/incident_permission_set_resource_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class IncidentPermissionSetResourceListDataItem: id: str type_: IncidentPermissionSetResourceListDataItemType - attributes: IncidentPermissionSetResource + attributes: "IncidentPermissionSetResource" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/incident_permission_set_resource_response.py b/rootly_sdk/models/incident_permission_set_resource_response.py index 6808e8b3..4fffb208 100644 --- a/rootly_sdk/models/incident_permission_set_resource_response.py +++ b/rootly_sdk/models/incident_permission_set_resource_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,18 +19,17 @@ class IncidentPermissionSetResourceResponse: """ Attributes: data (IncidentPermissionSetResourceResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: IncidentPermissionSetResourceResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "IncidentPermissionSetResourceResponseData" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = IncidentPermissionSetResourceResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) incident_permission_set_resource_response = cls( data=data, diff --git a/rootly_sdk/models/incident_permission_set_resource_response_data.py b/rootly_sdk/models/incident_permission_set_resource_response_data.py index 8e10e6a6..4120859c 100644 --- a/rootly_sdk/models/incident_permission_set_resource_response_data.py +++ b/rootly_sdk/models/incident_permission_set_resource_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class IncidentPermissionSetResourceResponseData: id: str type_: IncidentPermissionSetResourceResponseDataType - attributes: IncidentPermissionSetResource + attributes: "IncidentPermissionSetResource" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/incident_permission_set_response.py b/rootly_sdk/models/incident_permission_set_response.py index ea4b325f..5ca5aa1a 100644 --- a/rootly_sdk/models/incident_permission_set_response.py +++ b/rootly_sdk/models/incident_permission_set_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,18 +19,17 @@ class IncidentPermissionSetResponse: """ Attributes: data (IncidentPermissionSetResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: IncidentPermissionSetResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "IncidentPermissionSetResponseData" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = IncidentPermissionSetResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) incident_permission_set_response = cls( data=data, diff --git a/rootly_sdk/models/incident_permission_set_response_data.py b/rootly_sdk/models/incident_permission_set_response_data.py index d4248f2c..239d598f 100644 --- a/rootly_sdk/models/incident_permission_set_response_data.py +++ b/rootly_sdk/models/incident_permission_set_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class IncidentPermissionSetResponseData: id: str type_: IncidentPermissionSetResponseDataType - attributes: IncidentPermissionSet + attributes: "IncidentPermissionSet" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/incident_post_mortem.py b/rootly_sdk/models/incident_post_mortem.py index b3798e39..9f1e7134 100644 --- a/rootly_sdk/models/incident_post_mortem.py +++ b/rootly_sdk/models/incident_post_mortem.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,44 +21,44 @@ class IncidentPostMortem: title (str): The title of the incident retrospective created_at (str): Date of creation updated_at (str): Date of last update - content (None | str | Unset): The content of the incident retrospective (Only if internal) - status (IncidentPostMortemStatus | Unset): The status of the incident retrospective - started_at (None | str | Unset): Date of started at - mitigated_at (None | str | Unset): Date of mitigation - resolved_at (None | str | Unset): Date of resolution - show_timeline (bool | Unset): Show events timeline of the incident retrospective - show_timeline_trail (bool | Unset): Show trail events in the timeline of the incident retrospective - show_timeline_genius (bool | Unset): Show workflow events in the timeline of the incident retrospective - show_timeline_tasks (bool | Unset): Show tasks in the timeline of the incident retrospective - show_timeline_action_items (bool | Unset): Show action items in the timeline of the incident retrospective - show_timeline_order (IncidentPostMortemShowTimelineOrder | Unset): The order of the incident retrospective + content (Union[None, Unset, str]): The content of the incident retrospective (Only if internal) + status (Union[Unset, IncidentPostMortemStatus]): The status of the incident retrospective + started_at (Union[None, Unset, str]): Date of started at + mitigated_at (Union[None, Unset, str]): Date of mitigation + resolved_at (Union[None, Unset, str]): Date of resolution + show_timeline (Union[Unset, bool]): Show events timeline of the incident retrospective + show_timeline_trail (Union[Unset, bool]): Show trail events in the timeline of the incident retrospective + show_timeline_genius (Union[Unset, bool]): Show workflow events in the timeline of the incident retrospective + show_timeline_tasks (Union[Unset, bool]): Show tasks in the timeline of the incident retrospective + show_timeline_action_items (Union[Unset, bool]): Show action items in the timeline of the incident retrospective + show_timeline_order (Union[Unset, IncidentPostMortemShowTimelineOrder]): The order of the incident retrospective timeline Default: 'desc'. - show_services_impacted (bool | Unset): Show functionalities impacted of the incident retrospective - show_functionalities_impacted (bool | Unset): Show services impacted of the incident retrospective - show_groups_impacted (bool | Unset): Show groups impacted of the incident retrospective - show_alerts_attached (bool | Unset): Show alerts attached to the incident - url (str | Unset): The url to the incident retrospective + show_services_impacted (Union[Unset, bool]): Show functionalities impacted of the incident retrospective + show_functionalities_impacted (Union[Unset, bool]): Show services impacted of the incident retrospective + show_groups_impacted (Union[Unset, bool]): Show groups impacted of the incident retrospective + show_alerts_attached (Union[Unset, bool]): Show alerts attached to the incident + url (Union[Unset, str]): The url to the incident retrospective """ title: str created_at: str updated_at: str - content: None | str | Unset = UNSET - status: IncidentPostMortemStatus | Unset = UNSET - started_at: None | str | Unset = UNSET - mitigated_at: None | str | Unset = UNSET - resolved_at: None | str | Unset = UNSET - show_timeline: bool | Unset = UNSET - show_timeline_trail: bool | Unset = UNSET - show_timeline_genius: bool | Unset = UNSET - show_timeline_tasks: bool | Unset = UNSET - show_timeline_action_items: bool | Unset = UNSET - show_timeline_order: IncidentPostMortemShowTimelineOrder | Unset = "desc" - show_services_impacted: bool | Unset = UNSET - show_functionalities_impacted: bool | Unset = UNSET - show_groups_impacted: bool | Unset = UNSET - show_alerts_attached: bool | Unset = UNSET - url: str | Unset = UNSET + content: Union[None, Unset, str] = UNSET + status: Union[Unset, IncidentPostMortemStatus] = UNSET + started_at: Union[None, Unset, str] = UNSET + mitigated_at: Union[None, Unset, str] = UNSET + resolved_at: Union[None, Unset, str] = UNSET + show_timeline: Union[Unset, bool] = UNSET + show_timeline_trail: Union[Unset, bool] = UNSET + show_timeline_genius: Union[Unset, bool] = UNSET + show_timeline_tasks: Union[Unset, bool] = UNSET + show_timeline_action_items: Union[Unset, bool] = UNSET + show_timeline_order: Union[Unset, IncidentPostMortemShowTimelineOrder] = "desc" + show_services_impacted: Union[Unset, bool] = UNSET + show_functionalities_impacted: Union[Unset, bool] = UNSET + show_groups_impacted: Union[Unset, bool] = UNSET + show_alerts_attached: Union[Unset, bool] = UNSET + url: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -70,29 +68,29 @@ def to_dict(self) -> dict[str, Any]: updated_at = self.updated_at - content: None | str | Unset + content: Union[None, Unset, str] if isinstance(self.content, Unset): content = UNSET else: content = self.content - status: str | Unset = UNSET + status: Union[Unset, str] = UNSET if not isinstance(self.status, Unset): status = self.status - started_at: None | str | Unset + started_at: Union[None, Unset, str] if isinstance(self.started_at, Unset): started_at = UNSET else: started_at = self.started_at - mitigated_at: None | str | Unset + mitigated_at: Union[None, Unset, str] if isinstance(self.mitigated_at, Unset): mitigated_at = UNSET else: mitigated_at = self.mitigated_at - resolved_at: None | str | Unset + resolved_at: Union[None, Unset, str] if isinstance(self.resolved_at, Unset): resolved_at = UNSET else: @@ -108,7 +106,7 @@ def to_dict(self) -> dict[str, Any]: show_timeline_action_items = self.show_timeline_action_items - show_timeline_order: str | Unset = UNSET + show_timeline_order: Union[Unset, str] = UNSET if not isinstance(self.show_timeline_order, Unset): show_timeline_order = self.show_timeline_order @@ -175,46 +173,46 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: updated_at = d.pop("updated_at") - def _parse_content(data: object) -> None | str | Unset: + def _parse_content(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) content = _parse_content(d.pop("content", UNSET)) _status = d.pop("status", UNSET) - status: IncidentPostMortemStatus | Unset + status: Union[Unset, IncidentPostMortemStatus] if isinstance(_status, Unset): status = UNSET else: status = check_incident_post_mortem_status(_status) - def _parse_started_at(data: object) -> None | str | Unset: + def _parse_started_at(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) started_at = _parse_started_at(d.pop("started_at", UNSET)) - def _parse_mitigated_at(data: object) -> None | str | Unset: + def _parse_mitigated_at(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) mitigated_at = _parse_mitigated_at(d.pop("mitigated_at", UNSET)) - def _parse_resolved_at(data: object) -> None | str | Unset: + def _parse_resolved_at(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) resolved_at = _parse_resolved_at(d.pop("resolved_at", UNSET)) @@ -229,7 +227,7 @@ def _parse_resolved_at(data: object) -> None | str | Unset: show_timeline_action_items = d.pop("show_timeline_action_items", UNSET) _show_timeline_order = d.pop("show_timeline_order", UNSET) - show_timeline_order: IncidentPostMortemShowTimelineOrder | Unset + show_timeline_order: Union[Unset, IncidentPostMortemShowTimelineOrder] if isinstance(_show_timeline_order, Unset): show_timeline_order = UNSET else: diff --git a/rootly_sdk/models/incident_post_mortem_list.py b/rootly_sdk/models/incident_post_mortem_list.py index 0fdca1ee..e52082cc 100644 --- a/rootly_sdk/models/incident_post_mortem_list.py +++ b/rootly_sdk/models/incident_post_mortem_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,20 +20,19 @@ class IncidentPostMortemList: """ Attributes: - data (list[IncidentPostMortemListDataItem]): + data (list['IncidentPostMortemListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[IncidentPostMortemListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["IncidentPostMortemListDataItem"] + links: "Links" + meta: "Meta" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) incident_post_mortem_list = cls( data=data, diff --git a/rootly_sdk/models/incident_post_mortem_list_data_item.py b/rootly_sdk/models/incident_post_mortem_list_data_item.py index 55d07674..83ac4c56 100644 --- a/rootly_sdk/models/incident_post_mortem_list_data_item.py +++ b/rootly_sdk/models/incident_post_mortem_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class IncidentPostMortemListDataItem: id: str type_: IncidentPostMortemListDataItemType - attributes: IncidentPostMortem + attributes: "IncidentPostMortem" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/incident_post_mortem_response.py b/rootly_sdk/models/incident_post_mortem_response.py index c76380cb..56ff66c1 100644 --- a/rootly_sdk/models/incident_post_mortem_response.py +++ b/rootly_sdk/models/incident_post_mortem_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,18 +19,17 @@ class IncidentPostMortemResponse: """ Attributes: data (IncidentPostMortemResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: IncidentPostMortemResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "IncidentPostMortemResponseData" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = IncidentPostMortemResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) incident_post_mortem_response = cls( data=data, diff --git a/rootly_sdk/models/incident_post_mortem_response_data.py b/rootly_sdk/models/incident_post_mortem_response_data.py index 0fb9cf28..c32b822e 100644 --- a/rootly_sdk/models/incident_post_mortem_response_data.py +++ b/rootly_sdk/models/incident_post_mortem_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class IncidentPostMortemResponseData: id: str type_: IncidentPostMortemResponseDataType - attributes: IncidentPostMortem + attributes: "IncidentPostMortem" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/incident_resolved_by_type_0.py b/rootly_sdk/models/incident_resolved_by_type_0.py index 053c1026..6b8abbc3 100644 --- a/rootly_sdk/models/incident_resolved_by_type_0.py +++ b/rootly_sdk/models/incident_resolved_by_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,7 +14,6 @@ class IncidentResolvedByType0: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) diff --git a/rootly_sdk/models/incident_response.py b/rootly_sdk/models/incident_response.py index b865456f..9badb2d6 100644 --- a/rootly_sdk/models/incident_response.py +++ b/rootly_sdk/models/incident_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,18 +19,17 @@ class IncidentResponse: """ Attributes: data (IncidentResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: IncidentResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "IncidentResponseData" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = IncidentResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) incident_response = cls( data=data, diff --git a/rootly_sdk/models/incident_response_data.py b/rootly_sdk/models/incident_response_data.py index 99133947..e36fbd3f 100644 --- a/rootly_sdk/models/incident_response_data.py +++ b/rootly_sdk/models/incident_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class IncidentResponseData: id: str type_: IncidentResponseDataType - attributes: Incident + attributes: "Incident" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/incident_retrospective_step.py b/rootly_sdk/models/incident_retrospective_step.py index 96dca873..42814112 100644 --- a/rootly_sdk/models/incident_retrospective_step.py +++ b/rootly_sdk/models/incident_retrospective_step.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -24,12 +22,12 @@ class IncidentRetrospectiveStep: title (str): The name of the step created_at (str): Date of creation updated_at (str): Date of last update - description (None | str | Unset): The description of the step - status (IncidentRetrospectiveStepStatus | Unset): Status of the incident retrospective step - kind (None | str | Unset): Due date - due_date (None | str | Unset): Due date - position (int | Unset): Position of the step - skippable (bool | Unset): Is the step skippable? + description (Union[None, Unset, str]): The description of the step + status (Union[Unset, IncidentRetrospectiveStepStatus]): Status of the incident retrospective step + kind (Union[None, Unset, str]): Due date + due_date (Union[None, Unset, str]): Due date + position (Union[Unset, int]): Position of the step + skippable (Union[Unset, bool]): Is the step skippable? """ retrospective_step_id: str @@ -37,12 +35,12 @@ class IncidentRetrospectiveStep: title: str created_at: str updated_at: str - description: None | str | Unset = UNSET - status: IncidentRetrospectiveStepStatus | Unset = UNSET - kind: None | str | Unset = UNSET - due_date: None | str | Unset = UNSET - position: int | Unset = UNSET - skippable: bool | Unset = UNSET + description: Union[None, Unset, str] = UNSET + status: Union[Unset, IncidentRetrospectiveStepStatus] = UNSET + kind: Union[None, Unset, str] = UNSET + due_date: Union[None, Unset, str] = UNSET + position: Union[Unset, int] = UNSET + skippable: Union[Unset, bool] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -56,23 +54,23 @@ def to_dict(self) -> dict[str, Any]: updated_at = self.updated_at - description: None | str | Unset + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: description = self.description - status: str | Unset = UNSET + status: Union[Unset, str] = UNSET if not isinstance(self.status, Unset): status = self.status - kind: None | str | Unset + kind: Union[None, Unset, str] if isinstance(self.kind, Unset): kind = UNSET else: kind = self.kind - due_date: None | str | Unset + due_date: Union[None, Unset, str] if isinstance(self.due_date, Unset): due_date = UNSET else: @@ -121,37 +119,37 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: updated_at = d.pop("updated_at") - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) _status = d.pop("status", UNSET) - status: IncidentRetrospectiveStepStatus | Unset + status: Union[Unset, IncidentRetrospectiveStepStatus] if isinstance(_status, Unset): status = UNSET else: status = check_incident_retrospective_step_status(_status) - def _parse_kind(data: object) -> None | str | Unset: + def _parse_kind(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) kind = _parse_kind(d.pop("kind", UNSET)) - def _parse_due_date(data: object) -> None | str | Unset: + def _parse_due_date(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) due_date = _parse_due_date(d.pop("due_date", UNSET)) diff --git a/rootly_sdk/models/incident_retrospective_step_response.py b/rootly_sdk/models/incident_retrospective_step_response.py index 1459b399..820bea09 100644 --- a/rootly_sdk/models/incident_retrospective_step_response.py +++ b/rootly_sdk/models/incident_retrospective_step_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,18 +19,17 @@ class IncidentRetrospectiveStepResponse: """ Attributes: data (IncidentRetrospectiveStepResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: IncidentRetrospectiveStepResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "IncidentRetrospectiveStepResponseData" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = IncidentRetrospectiveStepResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) incident_retrospective_step_response = cls( data=data, diff --git a/rootly_sdk/models/incident_retrospective_step_response_data.py b/rootly_sdk/models/incident_retrospective_step_response_data.py index d8ffeff7..c231054b 100644 --- a/rootly_sdk/models/incident_retrospective_step_response_data.py +++ b/rootly_sdk/models/incident_retrospective_step_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class IncidentRetrospectiveStepResponseData: id: str type_: IncidentRetrospectiveStepResponseDataType - attributes: IncidentRetrospectiveStep + attributes: "IncidentRetrospectiveStep" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/incident_role.py b/rootly_sdk/models/incident_role.py index 9aa66312..5c3d680b 100644 --- a/rootly_sdk/models/incident_role.py +++ b/rootly_sdk/models/incident_role.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -18,25 +16,25 @@ class IncidentRole: name (str): The name of the incident role created_at (str): Date of creation updated_at (str): Date of last update - slug (str | Unset): The slug of the incident role - summary (None | str | Unset): The summary of the incident role - description (None | str | Unset): The description of the incident role - position (int | None | Unset): Position of the incident role - optional (bool | Unset): - enabled (bool | Unset): - allow_multi_user_assignment (bool | Unset): + slug (Union[Unset, str]): The slug of the incident role + summary (Union[None, Unset, str]): The summary of the incident role + description (Union[None, Unset, str]): The description of the incident role + position (Union[None, Unset, int]): Position of the incident role + optional (Union[Unset, bool]): + enabled (Union[Unset, bool]): + allow_multi_user_assignment (Union[Unset, bool]): """ name: str created_at: str updated_at: str - slug: str | Unset = UNSET - summary: None | str | Unset = UNSET - description: None | str | Unset = UNSET - position: int | None | Unset = UNSET - optional: bool | Unset = UNSET - enabled: bool | Unset = UNSET - allow_multi_user_assignment: bool | Unset = UNSET + slug: Union[Unset, str] = UNSET + summary: Union[None, Unset, str] = UNSET + description: Union[None, Unset, str] = UNSET + position: Union[None, Unset, int] = UNSET + optional: Union[Unset, bool] = UNSET + enabled: Union[Unset, bool] = UNSET + allow_multi_user_assignment: Union[Unset, bool] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -48,19 +46,19 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - summary: None | str | Unset + summary: Union[None, Unset, str] if isinstance(self.summary, Unset): summary = UNSET else: summary = self.summary - description: None | str | Unset + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: description = self.description - position: int | None | Unset + position: Union[None, Unset, int] if isinstance(self.position, Unset): position = UNSET else: @@ -109,30 +107,30 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: slug = d.pop("slug", UNSET) - def _parse_summary(data: object) -> None | str | Unset: + def _parse_summary(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) summary = _parse_summary(d.pop("summary", UNSET)) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> Union[None, Unset, int]: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(Union[None, Unset, int], data) position = _parse_position(d.pop("position", UNSET)) diff --git a/rootly_sdk/models/incident_role_list.py b/rootly_sdk/models/incident_role_list.py index 22dc9520..3c85074f 100644 --- a/rootly_sdk/models/incident_role_list.py +++ b/rootly_sdk/models/incident_role_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,20 +20,19 @@ class IncidentRoleList: """ Attributes: - data (list[IncidentRoleListDataItem]): + data (list['IncidentRoleListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[IncidentRoleListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["IncidentRoleListDataItem"] + links: "Links" + meta: "Meta" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) incident_role_list = cls( data=data, diff --git a/rootly_sdk/models/incident_role_list_data_item.py b/rootly_sdk/models/incident_role_list_data_item.py index 4ac3dd10..c736b804 100644 --- a/rootly_sdk/models/incident_role_list_data_item.py +++ b/rootly_sdk/models/incident_role_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class IncidentRoleListDataItem: id: str type_: IncidentRoleListDataItemType - attributes: IncidentRole + attributes: "IncidentRole" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/incident_role_response.py b/rootly_sdk/models/incident_role_response.py index 03c42298..d6be3898 100644 --- a/rootly_sdk/models/incident_role_response.py +++ b/rootly_sdk/models/incident_role_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,18 +19,17 @@ class IncidentRoleResponse: """ Attributes: data (IncidentRoleResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: IncidentRoleResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "IncidentRoleResponseData" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = IncidentRoleResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) incident_role_response = cls( data=data, diff --git a/rootly_sdk/models/incident_role_response_data.py b/rootly_sdk/models/incident_role_response_data.py index 94d09f13..9b1a5e16 100644 --- a/rootly_sdk/models/incident_role_response_data.py +++ b/rootly_sdk/models/incident_role_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class IncidentRoleResponseData: id: str type_: IncidentRoleResponseDataType - attributes: IncidentRole + attributes: "IncidentRole" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/incident_role_task.py b/rootly_sdk/models/incident_role_task.py index 5d7c3c97..2a87f93d 100644 --- a/rootly_sdk/models/incident_role_task.py +++ b/rootly_sdk/models/incident_role_task.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,17 +17,17 @@ class IncidentRoleTask: task (str): The task of the incident task created_at (str): Date of creation updated_at (str): Date of last update - incident_role_id (str | Unset): - description (None | str | Unset): The description of incident task - priority (IncidentRoleTaskPriority | Unset): The priority of the incident task + incident_role_id (Union[Unset, str]): + description (Union[None, Unset, str]): The description of incident task + priority (Union[Unset, IncidentRoleTaskPriority]): The priority of the incident task """ task: str created_at: str updated_at: str - incident_role_id: str | Unset = UNSET - description: None | str | Unset = UNSET - priority: IncidentRoleTaskPriority | Unset = UNSET + incident_role_id: Union[Unset, str] = UNSET + description: Union[None, Unset, str] = UNSET + priority: Union[Unset, IncidentRoleTaskPriority] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -41,13 +39,13 @@ def to_dict(self) -> dict[str, Any]: incident_role_id = self.incident_role_id - description: None | str | Unset + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: description = self.description - priority: str | Unset = UNSET + priority: Union[Unset, str] = UNSET if not isinstance(self.priority, Unset): priority = self.priority @@ -80,17 +78,17 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: incident_role_id = d.pop("incident_role_id", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) _priority = d.pop("priority", UNSET) - priority: IncidentRoleTaskPriority | Unset + priority: Union[Unset, IncidentRoleTaskPriority] if isinstance(_priority, Unset): priority = UNSET else: diff --git a/rootly_sdk/models/incident_role_task_list.py b/rootly_sdk/models/incident_role_task_list.py index 5ef2cf2e..c5d25b74 100644 --- a/rootly_sdk/models/incident_role_task_list.py +++ b/rootly_sdk/models/incident_role_task_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,20 +20,19 @@ class IncidentRoleTaskList: """ Attributes: - data (list[IncidentRoleTaskListDataItem]): + data (list['IncidentRoleTaskListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[IncidentRoleTaskListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["IncidentRoleTaskListDataItem"] + links: "Links" + meta: "Meta" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) incident_role_task_list = cls( data=data, diff --git a/rootly_sdk/models/incident_role_task_list_data_item.py b/rootly_sdk/models/incident_role_task_list_data_item.py index 1821b7a9..708c5a06 100644 --- a/rootly_sdk/models/incident_role_task_list_data_item.py +++ b/rootly_sdk/models/incident_role_task_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class IncidentRoleTaskListDataItem: id: str type_: IncidentRoleTaskListDataItemType - attributes: IncidentRoleTask + attributes: "IncidentRoleTask" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/incident_role_task_response.py b/rootly_sdk/models/incident_role_task_response.py index b92385ae..660c1d91 100644 --- a/rootly_sdk/models/incident_role_task_response.py +++ b/rootly_sdk/models/incident_role_task_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,18 +19,17 @@ class IncidentRoleTaskResponse: """ Attributes: data (IncidentRoleTaskResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: IncidentRoleTaskResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "IncidentRoleTaskResponseData" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = IncidentRoleTaskResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) incident_role_task_response = cls( data=data, diff --git a/rootly_sdk/models/incident_role_task_response_data.py b/rootly_sdk/models/incident_role_task_response_data.py index 7720f509..7fd228aa 100644 --- a/rootly_sdk/models/incident_role_task_response_data.py +++ b/rootly_sdk/models/incident_role_task_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class IncidentRoleTaskResponseData: id: str type_: IncidentRoleTaskResponseDataType - attributes: IncidentRoleTask + attributes: "IncidentRoleTask" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/incident_started_by_type_0.py b/rootly_sdk/models/incident_started_by_type_0.py index 241e922c..5189979b 100644 --- a/rootly_sdk/models/incident_started_by_type_0.py +++ b/rootly_sdk/models/incident_started_by_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,7 +14,6 @@ class IncidentStartedByType0: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) diff --git a/rootly_sdk/models/incident_status_page_event.py b/rootly_sdk/models/incident_status_page_event.py index 77bff120..3f1a49d5 100644 --- a/rootly_sdk/models/incident_status_page_event.py +++ b/rootly_sdk/models/incident_status_page_event.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -12,6 +10,12 @@ ) from ..types import UNSET, Unset +if TYPE_CHECKING: + from ..models.incident_status_page_event_status_page_components_item import ( + IncidentStatusPageEventStatusPageComponentsItem, + ) + + T = TypeVar("T", bound="IncidentStatusPageEvent") @@ -23,20 +27,23 @@ class IncidentStatusPageEvent: started_at (str): Date of start created_at (str): Date of creation updated_at (str): Date of last update - status_page_id (str | Unset): Unique ID of the status page you wish to post the event to - status (IncidentStatusPageEventStatus | Unset): The status of the incident event - notify_subscribers (bool | Unset): Notify all status pages subscribers - should_tweet (bool | Unset): For Statuspage.io integrated pages auto publishes a tweet for your update + status_page_id (Union[Unset, str]): Unique ID of the status page you wish to post the event to + status (Union[Unset, IncidentStatusPageEventStatus]): The status of the incident event + notify_subscribers (Union[Unset, bool]): Notify all status pages subscribers + should_tweet (Union[Unset, bool]): For Statuspage.io integrated pages auto publishes a tweet for your update + status_page_components (Union[Unset, list['IncidentStatusPageEventStatusPageComponentsItem']]): Affected status + page components recorded on the event and their statuses """ event: str started_at: str created_at: str updated_at: str - status_page_id: str | Unset = UNSET - status: IncidentStatusPageEventStatus | Unset = UNSET - notify_subscribers: bool | Unset = UNSET - should_tweet: bool | Unset = UNSET + status_page_id: Union[Unset, str] = UNSET + status: Union[Unset, IncidentStatusPageEventStatus] = UNSET + notify_subscribers: Union[Unset, bool] = UNSET + should_tweet: Union[Unset, bool] = UNSET + status_page_components: Union[Unset, list["IncidentStatusPageEventStatusPageComponentsItem"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -50,7 +57,7 @@ def to_dict(self) -> dict[str, Any]: status_page_id = self.status_page_id - status: str | Unset = UNSET + status: Union[Unset, str] = UNSET if not isinstance(self.status, Unset): status = self.status @@ -58,6 +65,13 @@ def to_dict(self) -> dict[str, Any]: should_tweet = self.should_tweet + status_page_components: Union[Unset, list[dict[str, Any]]] = UNSET + if not isinstance(self.status_page_components, Unset): + status_page_components = [] + for status_page_components_item_data in self.status_page_components: + status_page_components_item = status_page_components_item_data.to_dict() + status_page_components.append(status_page_components_item) + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update( @@ -76,11 +90,17 @@ def to_dict(self) -> dict[str, Any]: field_dict["notify_subscribers"] = notify_subscribers if should_tweet is not UNSET: field_dict["should_tweet"] = should_tweet + if status_page_components is not UNSET: + field_dict["status_page_components"] = status_page_components return field_dict @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.incident_status_page_event_status_page_components_item import ( + IncidentStatusPageEventStatusPageComponentsItem, + ) + d = dict(src_dict) event = d.pop("event") @@ -93,7 +113,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: status_page_id = d.pop("status_page_id", UNSET) _status = d.pop("status", UNSET) - status: IncidentStatusPageEventStatus | Unset + status: Union[Unset, IncidentStatusPageEventStatus] if isinstance(_status, Unset): status = UNSET else: @@ -103,6 +123,15 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: should_tweet = d.pop("should_tweet", UNSET) + status_page_components = [] + _status_page_components = d.pop("status_page_components", UNSET) + for status_page_components_item_data in _status_page_components or []: + status_page_components_item = IncidentStatusPageEventStatusPageComponentsItem.from_dict( + status_page_components_item_data + ) + + status_page_components.append(status_page_components_item) + incident_status_page_event = cls( event=event, started_at=started_at, @@ -112,6 +141,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: status=status, notify_subscribers=notify_subscribers, should_tweet=should_tweet, + status_page_components=status_page_components, ) incident_status_page_event.additional_properties = d diff --git a/rootly_sdk/models/incident_status_page_event_list.py b/rootly_sdk/models/incident_status_page_event_list.py index d5b6e98d..c3935dc9 100644 --- a/rootly_sdk/models/incident_status_page_event_list.py +++ b/rootly_sdk/models/incident_status_page_event_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,20 +20,19 @@ class IncidentStatusPageEventList: """ Attributes: - data (list[IncidentStatusPageEventListDataItem]): + data (list['IncidentStatusPageEventListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[IncidentStatusPageEventListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["IncidentStatusPageEventListDataItem"] + links: "Links" + meta: "Meta" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) incident_status_page_event_list = cls( data=data, diff --git a/rootly_sdk/models/incident_status_page_event_list_data_item.py b/rootly_sdk/models/incident_status_page_event_list_data_item.py index 3174294c..6187375a 100644 --- a/rootly_sdk/models/incident_status_page_event_list_data_item.py +++ b/rootly_sdk/models/incident_status_page_event_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class IncidentStatusPageEventListDataItem: id: str type_: IncidentStatusPageEventListDataItemType - attributes: IncidentStatusPageEvent + attributes: "IncidentStatusPageEvent" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/incident_status_page_event_response.py b/rootly_sdk/models/incident_status_page_event_response.py index 314ed314..7818f4f9 100644 --- a/rootly_sdk/models/incident_status_page_event_response.py +++ b/rootly_sdk/models/incident_status_page_event_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,18 +19,17 @@ class IncidentStatusPageEventResponse: """ Attributes: data (IncidentStatusPageEventResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: IncidentStatusPageEventResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "IncidentStatusPageEventResponseData" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = IncidentStatusPageEventResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) incident_status_page_event_response = cls( data=data, diff --git a/rootly_sdk/models/incident_status_page_event_response_data.py b/rootly_sdk/models/incident_status_page_event_response_data.py index a0374d05..2a860a98 100644 --- a/rootly_sdk/models/incident_status_page_event_response_data.py +++ b/rootly_sdk/models/incident_status_page_event_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class IncidentStatusPageEventResponseData: id: str type_: IncidentStatusPageEventResponseDataType - attributes: IncidentStatusPageEvent + attributes: "IncidentStatusPageEvent" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/incident_status_page_event_status_page_components_item.py b/rootly_sdk/models/incident_status_page_event_status_page_components_item.py new file mode 100644 index 00000000..28a43416 --- /dev/null +++ b/rootly_sdk/models/incident_status_page_event_status_page_components_item.py @@ -0,0 +1,82 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.incident_status_page_event_status_page_components_item_status import ( + IncidentStatusPageEventStatusPageComponentsItemStatus, + check_incident_status_page_event_status_page_components_item_status, +) +from ..types import UNSET, Unset + +T = TypeVar("T", bound="IncidentStatusPageEventStatusPageComponentsItem") + + +@_attrs_define +class IncidentStatusPageEventStatusPageComponentsItem: + """ + Attributes: + status_page_component_id (str): Unique ID of a component on the event's status page + status (Union[Unset, IncidentStatusPageEventStatusPageComponentsItemStatus]): The status recorded for the + component + """ + + status_page_component_id: str + status: Union[Unset, IncidentStatusPageEventStatusPageComponentsItemStatus] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + status_page_component_id = self.status_page_component_id + + status: Union[Unset, str] = UNSET + if not isinstance(self.status, Unset): + status = self.status + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "status_page_component_id": status_page_component_id, + } + ) + if status is not UNSET: + field_dict["status"] = status + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + status_page_component_id = d.pop("status_page_component_id") + + _status = d.pop("status", UNSET) + status: Union[Unset, IncidentStatusPageEventStatusPageComponentsItemStatus] + if isinstance(_status, Unset): + status = UNSET + else: + status = check_incident_status_page_event_status_page_components_item_status(_status) + + incident_status_page_event_status_page_components_item = cls( + status_page_component_id=status_page_component_id, + status=status, + ) + + incident_status_page_event_status_page_components_item.additional_properties = d + return incident_status_page_event_status_page_components_item + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/rootly_sdk/models/incident_status_page_event_status_page_components_item_status.py b/rootly_sdk/models/incident_status_page_event_status_page_components_item_status.py new file mode 100644 index 00000000..7013b60f --- /dev/null +++ b/rootly_sdk/models/incident_status_page_event_status_page_components_item_status.py @@ -0,0 +1,26 @@ +from typing import Literal, cast + +IncidentStatusPageEventStatusPageComponentsItemStatus = Literal[ + "degraded_performance", "major_outage", "operational", "partial_outage" +] + +INCIDENT_STATUS_PAGE_EVENT_STATUS_PAGE_COMPONENTS_ITEM_STATUS_VALUES: set[ + IncidentStatusPageEventStatusPageComponentsItemStatus +] = { + "degraded_performance", + "major_outage", + "operational", + "partial_outage", +} + + +def check_incident_status_page_event_status_page_components_item_status( + value: str | None, +) -> IncidentStatusPageEventStatusPageComponentsItemStatus | None: + if value is None: + return None + if value in INCIDENT_STATUS_PAGE_EVENT_STATUS_PAGE_COMPONENTS_ITEM_STATUS_VALUES: + return cast(IncidentStatusPageEventStatusPageComponentsItemStatus, value) + raise TypeError( + f"Unexpected value {value!r}. Expected one of {INCIDENT_STATUS_PAGE_EVENT_STATUS_PAGE_COMPONENTS_ITEM_STATUS_VALUES!r}" + ) diff --git a/rootly_sdk/models/incident_sub_status.py b/rootly_sdk/models/incident_sub_status.py index 5fa71a29..20c90209 100644 --- a/rootly_sdk/models/incident_sub_status.py +++ b/rootly_sdk/models/incident_sub_status.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -20,13 +18,13 @@ class IncidentSubStatus: sub_status_id attribute. This endpoint is for modifying the timestamp of when an incident's sub-status was assigned. assigned_at (str): - assigned_by_user_id (int | None | Unset): + assigned_by_user_id (Union[None, Unset, int]): """ incident_id: str sub_status_id: str assigned_at: str - assigned_by_user_id: int | None | Unset = UNSET + assigned_by_user_id: Union[None, Unset, int] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -36,7 +34,7 @@ def to_dict(self) -> dict[str, Any]: assigned_at = self.assigned_at - assigned_by_user_id: int | None | Unset + assigned_by_user_id: Union[None, Unset, int] if isinstance(self.assigned_by_user_id, Unset): assigned_by_user_id = UNSET else: @@ -65,12 +63,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: assigned_at = d.pop("assigned_at") - def _parse_assigned_by_user_id(data: object) -> int | None | Unset: + def _parse_assigned_by_user_id(data: object) -> Union[None, Unset, int]: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(Union[None, Unset, int], data) assigned_by_user_id = _parse_assigned_by_user_id(d.pop("assigned_by_user_id", UNSET)) diff --git a/rootly_sdk/models/incident_sub_status_list.py b/rootly_sdk/models/incident_sub_status_list.py index f699265c..397436be 100644 --- a/rootly_sdk/models/incident_sub_status_list.py +++ b/rootly_sdk/models/incident_sub_status_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,20 +20,19 @@ class IncidentSubStatusList: """ Attributes: - data (list[IncidentSubStatusListDataItem]): + data (list['IncidentSubStatusListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[IncidentSubStatusListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["IncidentSubStatusListDataItem"] + links: "Links" + meta: "Meta" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) incident_sub_status_list = cls( data=data, diff --git a/rootly_sdk/models/incident_sub_status_list_data_item.py b/rootly_sdk/models/incident_sub_status_list_data_item.py index 322e748c..bfb54b09 100644 --- a/rootly_sdk/models/incident_sub_status_list_data_item.py +++ b/rootly_sdk/models/incident_sub_status_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class IncidentSubStatusListDataItem: id: str type_: IncidentSubStatusListDataItemType - attributes: IncidentSubStatus + attributes: "IncidentSubStatus" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/incident_sub_status_response.py b/rootly_sdk/models/incident_sub_status_response.py index 5e8bf711..844091af 100644 --- a/rootly_sdk/models/incident_sub_status_response.py +++ b/rootly_sdk/models/incident_sub_status_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,18 +19,17 @@ class IncidentSubStatusResponse: """ Attributes: data (IncidentSubStatusResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: IncidentSubStatusResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "IncidentSubStatusResponseData" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = IncidentSubStatusResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) incident_sub_status_response = cls( data=data, diff --git a/rootly_sdk/models/incident_sub_status_response_data.py b/rootly_sdk/models/incident_sub_status_response_data.py index 7d2e2559..c6afd0ca 100644 --- a/rootly_sdk/models/incident_sub_status_response_data.py +++ b/rootly_sdk/models/incident_sub_status_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class IncidentSubStatusResponseData: id: str type_: IncidentSubStatusResponseDataType - attributes: IncidentSubStatus + attributes: "IncidentSubStatus" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/incident_trigger_params.py b/rootly_sdk/models/incident_trigger_params.py index 25c3c93b..7e468bc3 100644 --- a/rootly_sdk/models/incident_trigger_params.py +++ b/rootly_sdk/models/incident_trigger_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -116,193 +114,196 @@ class IncidentTriggerParams: """ Attributes: trigger_type (IncidentTriggerParamsTriggerType): - triggers (list[str] | Unset): - incident_visibilities (list[bool] | Unset): - incident_kinds (list[IncidentTriggerParamsIncidentKindsItem] | Unset): - incident_statuses (list[IncidentTriggerParamsIncidentStatusesItem] | Unset): - incident_inactivity_duration (None | str | Unset): ex. 10 min, 1h, 3 days, 2 weeks - incident_condition (IncidentTriggerParamsIncidentCondition | Unset): Default: 'ALL'. - incident_condition_visibility (IncidentTriggerParamsIncidentConditionVisibility | Unset): Default: 'ANY'. - incident_condition_kind (IncidentTriggerParamsIncidentConditionKind | Unset): Default: 'IS'. - incident_condition_status (IncidentTriggerParamsIncidentConditionStatus | Unset): Default: 'ANY'. - incident_condition_sub_status (IncidentTriggerParamsIncidentConditionSubStatus | Unset): Default: 'ANY'. - incident_condition_environment (IncidentTriggerParamsIncidentConditionEnvironment | Unset): Default: 'ANY'. - incident_condition_severity (IncidentTriggerParamsIncidentConditionSeverity | Unset): Default: 'ANY'. - incident_condition_incident_type (IncidentTriggerParamsIncidentConditionIncidentType | Unset): Default: 'ANY'. - incident_condition_incident_roles (IncidentTriggerParamsIncidentConditionIncidentRoles | Unset): Default: + triggers (Union[Unset, list[str]]): + incident_visibilities (Union[Unset, list[bool]]): + incident_kinds (Union[Unset, list[IncidentTriggerParamsIncidentKindsItem]]): + incident_statuses (Union[Unset, list[IncidentTriggerParamsIncidentStatusesItem]]): + incident_inactivity_duration (Union[None, Unset, str]): ex. 10 min, 1h, 3 days, 2 weeks + incident_condition (Union[Unset, IncidentTriggerParamsIncidentCondition]): Default: 'ALL'. + incident_condition_visibility (Union[Unset, IncidentTriggerParamsIncidentConditionVisibility]): Default: 'ANY'. + incident_condition_kind (Union[Unset, IncidentTriggerParamsIncidentConditionKind]): Default: 'IS'. + incident_condition_status (Union[Unset, IncidentTriggerParamsIncidentConditionStatus]): Default: 'ANY'. + incident_condition_sub_status (Union[Unset, IncidentTriggerParamsIncidentConditionSubStatus]): Default: 'ANY'. + incident_condition_environment (Union[Unset, IncidentTriggerParamsIncidentConditionEnvironment]): Default: + 'ANY'. + incident_condition_severity (Union[Unset, IncidentTriggerParamsIncidentConditionSeverity]): Default: 'ANY'. + incident_condition_incident_type (Union[Unset, IncidentTriggerParamsIncidentConditionIncidentType]): Default: + 'ANY'. + incident_condition_incident_roles (Union[Unset, IncidentTriggerParamsIncidentConditionIncidentRoles]): Default: + 'ANY'. + incident_condition_service (Union[Unset, IncidentTriggerParamsIncidentConditionService]): Default: 'ANY'. + incident_condition_functionality (Union[Unset, IncidentTriggerParamsIncidentConditionFunctionality]): Default: 'ANY'. - incident_condition_service (IncidentTriggerParamsIncidentConditionService | Unset): Default: 'ANY'. - incident_condition_functionality (IncidentTriggerParamsIncidentConditionFunctionality | Unset): Default: 'ANY'. - incident_condition_group (IncidentTriggerParamsIncidentConditionGroup | Unset): Default: 'ANY'. - incident_condition_cause (IncidentTriggerParamsIncidentConditionCause | Unset): Default: 'ANY'. - incident_condition_label (IncidentTriggerParamsIncidentConditionLabel | Unset): Default: 'ANY'. - incident_condition_label_use_regexp (bool | Unset): Default: False. - incident_labels (list[str] | Unset): - incident_post_mortem_condition_cause (IncidentTriggerParamsIncidentPostMortemConditionCause | Unset): + incident_condition_group (Union[Unset, IncidentTriggerParamsIncidentConditionGroup]): Default: 'ANY'. + incident_condition_cause (Union[Unset, IncidentTriggerParamsIncidentConditionCause]): Default: 'ANY'. + incident_condition_label (Union[Unset, IncidentTriggerParamsIncidentConditionLabel]): Default: 'ANY'. + incident_condition_label_use_regexp (Union[Unset, bool]): Default: False. + incident_labels (Union[Unset, list[str]]): + incident_post_mortem_condition_cause (Union[Unset, IncidentTriggerParamsIncidentPostMortemConditionCause]): [DEPRECATED] Use incident_condition_cause instead Default: 'ANY'. - incident_condition_summary (IncidentTriggerParamsIncidentConditionSummary | Unset): - incident_condition_started_at (IncidentTriggerParamsIncidentConditionStartedAt | Unset): - incident_condition_detected_at (IncidentTriggerParamsIncidentConditionDetectedAt | Unset): - incident_condition_acknowledged_at (IncidentTriggerParamsIncidentConditionAcknowledgedAt | Unset): - incident_condition_mitigated_at (IncidentTriggerParamsIncidentConditionMitigatedAt | Unset): - incident_condition_resolved_at (IncidentTriggerParamsIncidentConditionResolvedAt | Unset): - incident_conditional_inactivity (IncidentTriggerParamsIncidentConditionalInactivity | Unset): + incident_condition_summary (Union[Unset, IncidentTriggerParamsIncidentConditionSummary]): + incident_condition_started_at (Union[Unset, IncidentTriggerParamsIncidentConditionStartedAt]): + incident_condition_detected_at (Union[Unset, IncidentTriggerParamsIncidentConditionDetectedAt]): + incident_condition_acknowledged_at (Union[Unset, IncidentTriggerParamsIncidentConditionAcknowledgedAt]): + incident_condition_mitigated_at (Union[Unset, IncidentTriggerParamsIncidentConditionMitigatedAt]): + incident_condition_resolved_at (Union[Unset, IncidentTriggerParamsIncidentConditionResolvedAt]): + incident_conditional_inactivity (Union[Unset, IncidentTriggerParamsIncidentConditionalInactivity]): """ trigger_type: IncidentTriggerParamsTriggerType - triggers: list[str] | Unset = UNSET - incident_visibilities: list[bool] | Unset = UNSET - incident_kinds: list[IncidentTriggerParamsIncidentKindsItem] | Unset = UNSET - incident_statuses: list[IncidentTriggerParamsIncidentStatusesItem] | Unset = UNSET - incident_inactivity_duration: None | str | Unset = UNSET - incident_condition: IncidentTriggerParamsIncidentCondition | Unset = "ALL" - incident_condition_visibility: IncidentTriggerParamsIncidentConditionVisibility | Unset = "ANY" - incident_condition_kind: IncidentTriggerParamsIncidentConditionKind | Unset = "IS" - incident_condition_status: IncidentTriggerParamsIncidentConditionStatus | Unset = "ANY" - incident_condition_sub_status: IncidentTriggerParamsIncidentConditionSubStatus | Unset = "ANY" - incident_condition_environment: IncidentTriggerParamsIncidentConditionEnvironment | Unset = "ANY" - incident_condition_severity: IncidentTriggerParamsIncidentConditionSeverity | Unset = "ANY" - incident_condition_incident_type: IncidentTriggerParamsIncidentConditionIncidentType | Unset = "ANY" - incident_condition_incident_roles: IncidentTriggerParamsIncidentConditionIncidentRoles | Unset = "ANY" - incident_condition_service: IncidentTriggerParamsIncidentConditionService | Unset = "ANY" - incident_condition_functionality: IncidentTriggerParamsIncidentConditionFunctionality | Unset = "ANY" - incident_condition_group: IncidentTriggerParamsIncidentConditionGroup | Unset = "ANY" - incident_condition_cause: IncidentTriggerParamsIncidentConditionCause | Unset = "ANY" - incident_condition_label: IncidentTriggerParamsIncidentConditionLabel | Unset = "ANY" - incident_condition_label_use_regexp: bool | Unset = False - incident_labels: list[str] | Unset = UNSET - incident_post_mortem_condition_cause: IncidentTriggerParamsIncidentPostMortemConditionCause | Unset = "ANY" - incident_condition_summary: IncidentTriggerParamsIncidentConditionSummary | Unset = UNSET - incident_condition_started_at: IncidentTriggerParamsIncidentConditionStartedAt | Unset = UNSET - incident_condition_detected_at: IncidentTriggerParamsIncidentConditionDetectedAt | Unset = UNSET - incident_condition_acknowledged_at: IncidentTriggerParamsIncidentConditionAcknowledgedAt | Unset = UNSET - incident_condition_mitigated_at: IncidentTriggerParamsIncidentConditionMitigatedAt | Unset = UNSET - incident_condition_resolved_at: IncidentTriggerParamsIncidentConditionResolvedAt | Unset = UNSET - incident_conditional_inactivity: IncidentTriggerParamsIncidentConditionalInactivity | Unset = UNSET + triggers: Union[Unset, list[str]] = UNSET + incident_visibilities: Union[Unset, list[bool]] = UNSET + incident_kinds: Union[Unset, list[IncidentTriggerParamsIncidentKindsItem]] = UNSET + incident_statuses: Union[Unset, list[IncidentTriggerParamsIncidentStatusesItem]] = UNSET + incident_inactivity_duration: Union[None, Unset, str] = UNSET + incident_condition: Union[Unset, IncidentTriggerParamsIncidentCondition] = "ALL" + incident_condition_visibility: Union[Unset, IncidentTriggerParamsIncidentConditionVisibility] = "ANY" + incident_condition_kind: Union[Unset, IncidentTriggerParamsIncidentConditionKind] = "IS" + incident_condition_status: Union[Unset, IncidentTriggerParamsIncidentConditionStatus] = "ANY" + incident_condition_sub_status: Union[Unset, IncidentTriggerParamsIncidentConditionSubStatus] = "ANY" + incident_condition_environment: Union[Unset, IncidentTriggerParamsIncidentConditionEnvironment] = "ANY" + incident_condition_severity: Union[Unset, IncidentTriggerParamsIncidentConditionSeverity] = "ANY" + incident_condition_incident_type: Union[Unset, IncidentTriggerParamsIncidentConditionIncidentType] = "ANY" + incident_condition_incident_roles: Union[Unset, IncidentTriggerParamsIncidentConditionIncidentRoles] = "ANY" + incident_condition_service: Union[Unset, IncidentTriggerParamsIncidentConditionService] = "ANY" + incident_condition_functionality: Union[Unset, IncidentTriggerParamsIncidentConditionFunctionality] = "ANY" + incident_condition_group: Union[Unset, IncidentTriggerParamsIncidentConditionGroup] = "ANY" + incident_condition_cause: Union[Unset, IncidentTriggerParamsIncidentConditionCause] = "ANY" + incident_condition_label: Union[Unset, IncidentTriggerParamsIncidentConditionLabel] = "ANY" + incident_condition_label_use_regexp: Union[Unset, bool] = False + incident_labels: Union[Unset, list[str]] = UNSET + incident_post_mortem_condition_cause: Union[Unset, IncidentTriggerParamsIncidentPostMortemConditionCause] = "ANY" + incident_condition_summary: Union[Unset, IncidentTriggerParamsIncidentConditionSummary] = UNSET + incident_condition_started_at: Union[Unset, IncidentTriggerParamsIncidentConditionStartedAt] = UNSET + incident_condition_detected_at: Union[Unset, IncidentTriggerParamsIncidentConditionDetectedAt] = UNSET + incident_condition_acknowledged_at: Union[Unset, IncidentTriggerParamsIncidentConditionAcknowledgedAt] = UNSET + incident_condition_mitigated_at: Union[Unset, IncidentTriggerParamsIncidentConditionMitigatedAt] = UNSET + incident_condition_resolved_at: Union[Unset, IncidentTriggerParamsIncidentConditionResolvedAt] = UNSET + incident_conditional_inactivity: Union[Unset, IncidentTriggerParamsIncidentConditionalInactivity] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: trigger_type: str = self.trigger_type - triggers: list[str] | Unset = UNSET + triggers: Union[Unset, list[str]] = UNSET if not isinstance(self.triggers, Unset): triggers = self.triggers - incident_visibilities: list[bool] | Unset = UNSET + incident_visibilities: Union[Unset, list[bool]] = UNSET if not isinstance(self.incident_visibilities, Unset): incident_visibilities = self.incident_visibilities - incident_kinds: list[str] | Unset = UNSET + incident_kinds: Union[Unset, list[str]] = UNSET if not isinstance(self.incident_kinds, Unset): incident_kinds = [] for incident_kinds_item_data in self.incident_kinds: incident_kinds_item: str = incident_kinds_item_data incident_kinds.append(incident_kinds_item) - incident_statuses: list[str] | Unset = UNSET + incident_statuses: Union[Unset, list[str]] = UNSET if not isinstance(self.incident_statuses, Unset): incident_statuses = [] for incident_statuses_item_data in self.incident_statuses: incident_statuses_item: str = incident_statuses_item_data incident_statuses.append(incident_statuses_item) - incident_inactivity_duration: None | str | Unset + incident_inactivity_duration: Union[None, Unset, str] if isinstance(self.incident_inactivity_duration, Unset): incident_inactivity_duration = UNSET else: incident_inactivity_duration = self.incident_inactivity_duration - incident_condition: str | Unset = UNSET + incident_condition: Union[Unset, str] = UNSET if not isinstance(self.incident_condition, Unset): incident_condition = self.incident_condition - incident_condition_visibility: str | Unset = UNSET + incident_condition_visibility: Union[Unset, str] = UNSET if not isinstance(self.incident_condition_visibility, Unset): incident_condition_visibility = self.incident_condition_visibility - incident_condition_kind: str | Unset = UNSET + incident_condition_kind: Union[Unset, str] = UNSET if not isinstance(self.incident_condition_kind, Unset): incident_condition_kind = self.incident_condition_kind - incident_condition_status: str | Unset = UNSET + incident_condition_status: Union[Unset, str] = UNSET if not isinstance(self.incident_condition_status, Unset): incident_condition_status = self.incident_condition_status - incident_condition_sub_status: str | Unset = UNSET + incident_condition_sub_status: Union[Unset, str] = UNSET if not isinstance(self.incident_condition_sub_status, Unset): incident_condition_sub_status = self.incident_condition_sub_status - incident_condition_environment: str | Unset = UNSET + incident_condition_environment: Union[Unset, str] = UNSET if not isinstance(self.incident_condition_environment, Unset): incident_condition_environment = self.incident_condition_environment - incident_condition_severity: str | Unset = UNSET + incident_condition_severity: Union[Unset, str] = UNSET if not isinstance(self.incident_condition_severity, Unset): incident_condition_severity = self.incident_condition_severity - incident_condition_incident_type: str | Unset = UNSET + incident_condition_incident_type: Union[Unset, str] = UNSET if not isinstance(self.incident_condition_incident_type, Unset): incident_condition_incident_type = self.incident_condition_incident_type - incident_condition_incident_roles: str | Unset = UNSET + incident_condition_incident_roles: Union[Unset, str] = UNSET if not isinstance(self.incident_condition_incident_roles, Unset): incident_condition_incident_roles = self.incident_condition_incident_roles - incident_condition_service: str | Unset = UNSET + incident_condition_service: Union[Unset, str] = UNSET if not isinstance(self.incident_condition_service, Unset): incident_condition_service = self.incident_condition_service - incident_condition_functionality: str | Unset = UNSET + incident_condition_functionality: Union[Unset, str] = UNSET if not isinstance(self.incident_condition_functionality, Unset): incident_condition_functionality = self.incident_condition_functionality - incident_condition_group: str | Unset = UNSET + incident_condition_group: Union[Unset, str] = UNSET if not isinstance(self.incident_condition_group, Unset): incident_condition_group = self.incident_condition_group - incident_condition_cause: str | Unset = UNSET + incident_condition_cause: Union[Unset, str] = UNSET if not isinstance(self.incident_condition_cause, Unset): incident_condition_cause = self.incident_condition_cause - incident_condition_label: str | Unset = UNSET + incident_condition_label: Union[Unset, str] = UNSET if not isinstance(self.incident_condition_label, Unset): incident_condition_label = self.incident_condition_label incident_condition_label_use_regexp = self.incident_condition_label_use_regexp - incident_labels: list[str] | Unset = UNSET + incident_labels: Union[Unset, list[str]] = UNSET if not isinstance(self.incident_labels, Unset): incident_labels = self.incident_labels - incident_post_mortem_condition_cause: str | Unset = UNSET + incident_post_mortem_condition_cause: Union[Unset, str] = UNSET if not isinstance(self.incident_post_mortem_condition_cause, Unset): incident_post_mortem_condition_cause = self.incident_post_mortem_condition_cause - incident_condition_summary: str | Unset = UNSET + incident_condition_summary: Union[Unset, str] = UNSET if not isinstance(self.incident_condition_summary, Unset): incident_condition_summary = self.incident_condition_summary - incident_condition_started_at: str | Unset = UNSET + incident_condition_started_at: Union[Unset, str] = UNSET if not isinstance(self.incident_condition_started_at, Unset): incident_condition_started_at = self.incident_condition_started_at - incident_condition_detected_at: str | Unset = UNSET + incident_condition_detected_at: Union[Unset, str] = UNSET if not isinstance(self.incident_condition_detected_at, Unset): incident_condition_detected_at = self.incident_condition_detected_at - incident_condition_acknowledged_at: str | Unset = UNSET + incident_condition_acknowledged_at: Union[Unset, str] = UNSET if not isinstance(self.incident_condition_acknowledged_at, Unset): incident_condition_acknowledged_at = self.incident_condition_acknowledged_at - incident_condition_mitigated_at: str | Unset = UNSET + incident_condition_mitigated_at: Union[Unset, str] = UNSET if not isinstance(self.incident_condition_mitigated_at, Unset): incident_condition_mitigated_at = self.incident_condition_mitigated_at - incident_condition_resolved_at: str | Unset = UNSET + incident_condition_resolved_at: Union[Unset, str] = UNSET if not isinstance(self.incident_condition_resolved_at, Unset): incident_condition_resolved_at = self.incident_condition_resolved_at - incident_conditional_inactivity: str | Unset = UNSET + incident_conditional_inactivity: Union[Unset, str] = UNSET if not isinstance(self.incident_conditional_inactivity, Unset): incident_conditional_inactivity = self.incident_conditional_inactivity @@ -383,44 +384,38 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: incident_visibilities = cast(list[bool], d.pop("incident_visibilities", UNSET)) + incident_kinds = [] _incident_kinds = d.pop("incident_kinds", UNSET) - incident_kinds: list[IncidentTriggerParamsIncidentKindsItem] | Unset = UNSET - if _incident_kinds is not UNSET: - incident_kinds = [] - for incident_kinds_item_data in _incident_kinds: - incident_kinds_item = check_incident_trigger_params_incident_kinds_item(incident_kinds_item_data) + for incident_kinds_item_data in _incident_kinds or []: + incident_kinds_item = check_incident_trigger_params_incident_kinds_item(incident_kinds_item_data) - incident_kinds.append(incident_kinds_item) + incident_kinds.append(incident_kinds_item) + incident_statuses = [] _incident_statuses = d.pop("incident_statuses", UNSET) - incident_statuses: list[IncidentTriggerParamsIncidentStatusesItem] | Unset = UNSET - if _incident_statuses is not UNSET: - incident_statuses = [] - for incident_statuses_item_data in _incident_statuses: - incident_statuses_item = check_incident_trigger_params_incident_statuses_item( - incident_statuses_item_data - ) + for incident_statuses_item_data in _incident_statuses or []: + incident_statuses_item = check_incident_trigger_params_incident_statuses_item(incident_statuses_item_data) - incident_statuses.append(incident_statuses_item) + incident_statuses.append(incident_statuses_item) - def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: + def _parse_incident_inactivity_duration(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) incident_inactivity_duration = _parse_incident_inactivity_duration(d.pop("incident_inactivity_duration", UNSET)) _incident_condition = d.pop("incident_condition", UNSET) - incident_condition: IncidentTriggerParamsIncidentCondition | Unset + incident_condition: Union[Unset, IncidentTriggerParamsIncidentCondition] if isinstance(_incident_condition, Unset): incident_condition = UNSET else: incident_condition = check_incident_trigger_params_incident_condition(_incident_condition) _incident_condition_visibility = d.pop("incident_condition_visibility", UNSET) - incident_condition_visibility: IncidentTriggerParamsIncidentConditionVisibility | Unset + incident_condition_visibility: Union[Unset, IncidentTriggerParamsIncidentConditionVisibility] if isinstance(_incident_condition_visibility, Unset): incident_condition_visibility = UNSET else: @@ -429,14 +424,14 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_condition_kind = d.pop("incident_condition_kind", UNSET) - incident_condition_kind: IncidentTriggerParamsIncidentConditionKind | Unset + incident_condition_kind: Union[Unset, IncidentTriggerParamsIncidentConditionKind] if isinstance(_incident_condition_kind, Unset): incident_condition_kind = UNSET else: incident_condition_kind = check_incident_trigger_params_incident_condition_kind(_incident_condition_kind) _incident_condition_status = d.pop("incident_condition_status", UNSET) - incident_condition_status: IncidentTriggerParamsIncidentConditionStatus | Unset + incident_condition_status: Union[Unset, IncidentTriggerParamsIncidentConditionStatus] if isinstance(_incident_condition_status, Unset): incident_condition_status = UNSET else: @@ -445,7 +440,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_condition_sub_status = d.pop("incident_condition_sub_status", UNSET) - incident_condition_sub_status: IncidentTriggerParamsIncidentConditionSubStatus | Unset + incident_condition_sub_status: Union[Unset, IncidentTriggerParamsIncidentConditionSubStatus] if isinstance(_incident_condition_sub_status, Unset): incident_condition_sub_status = UNSET else: @@ -454,7 +449,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_condition_environment = d.pop("incident_condition_environment", UNSET) - incident_condition_environment: IncidentTriggerParamsIncidentConditionEnvironment | Unset + incident_condition_environment: Union[Unset, IncidentTriggerParamsIncidentConditionEnvironment] if isinstance(_incident_condition_environment, Unset): incident_condition_environment = UNSET else: @@ -463,7 +458,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_condition_severity = d.pop("incident_condition_severity", UNSET) - incident_condition_severity: IncidentTriggerParamsIncidentConditionSeverity | Unset + incident_condition_severity: Union[Unset, IncidentTriggerParamsIncidentConditionSeverity] if isinstance(_incident_condition_severity, Unset): incident_condition_severity = UNSET else: @@ -472,7 +467,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_condition_incident_type = d.pop("incident_condition_incident_type", UNSET) - incident_condition_incident_type: IncidentTriggerParamsIncidentConditionIncidentType | Unset + incident_condition_incident_type: Union[Unset, IncidentTriggerParamsIncidentConditionIncidentType] if isinstance(_incident_condition_incident_type, Unset): incident_condition_incident_type = UNSET else: @@ -481,7 +476,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_condition_incident_roles = d.pop("incident_condition_incident_roles", UNSET) - incident_condition_incident_roles: IncidentTriggerParamsIncidentConditionIncidentRoles | Unset + incident_condition_incident_roles: Union[Unset, IncidentTriggerParamsIncidentConditionIncidentRoles] if isinstance(_incident_condition_incident_roles, Unset): incident_condition_incident_roles = UNSET else: @@ -490,7 +485,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_condition_service = d.pop("incident_condition_service", UNSET) - incident_condition_service: IncidentTriggerParamsIncidentConditionService | Unset + incident_condition_service: Union[Unset, IncidentTriggerParamsIncidentConditionService] if isinstance(_incident_condition_service, Unset): incident_condition_service = UNSET else: @@ -499,7 +494,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_condition_functionality = d.pop("incident_condition_functionality", UNSET) - incident_condition_functionality: IncidentTriggerParamsIncidentConditionFunctionality | Unset + incident_condition_functionality: Union[Unset, IncidentTriggerParamsIncidentConditionFunctionality] if isinstance(_incident_condition_functionality, Unset): incident_condition_functionality = UNSET else: @@ -508,21 +503,21 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_condition_group = d.pop("incident_condition_group", UNSET) - incident_condition_group: IncidentTriggerParamsIncidentConditionGroup | Unset + incident_condition_group: Union[Unset, IncidentTriggerParamsIncidentConditionGroup] if isinstance(_incident_condition_group, Unset): incident_condition_group = UNSET else: incident_condition_group = check_incident_trigger_params_incident_condition_group(_incident_condition_group) _incident_condition_cause = d.pop("incident_condition_cause", UNSET) - incident_condition_cause: IncidentTriggerParamsIncidentConditionCause | Unset + incident_condition_cause: Union[Unset, IncidentTriggerParamsIncidentConditionCause] if isinstance(_incident_condition_cause, Unset): incident_condition_cause = UNSET else: incident_condition_cause = check_incident_trigger_params_incident_condition_cause(_incident_condition_cause) _incident_condition_label = d.pop("incident_condition_label", UNSET) - incident_condition_label: IncidentTriggerParamsIncidentConditionLabel | Unset + incident_condition_label: Union[Unset, IncidentTriggerParamsIncidentConditionLabel] if isinstance(_incident_condition_label, Unset): incident_condition_label = UNSET else: @@ -533,7 +528,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: incident_labels = cast(list[str], d.pop("incident_labels", UNSET)) _incident_post_mortem_condition_cause = d.pop("incident_post_mortem_condition_cause", UNSET) - incident_post_mortem_condition_cause: IncidentTriggerParamsIncidentPostMortemConditionCause | Unset + incident_post_mortem_condition_cause: Union[Unset, IncidentTriggerParamsIncidentPostMortemConditionCause] if isinstance(_incident_post_mortem_condition_cause, Unset): incident_post_mortem_condition_cause = UNSET else: @@ -542,7 +537,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_condition_summary = d.pop("incident_condition_summary", UNSET) - incident_condition_summary: IncidentTriggerParamsIncidentConditionSummary | Unset + incident_condition_summary: Union[Unset, IncidentTriggerParamsIncidentConditionSummary] if isinstance(_incident_condition_summary, Unset): incident_condition_summary = UNSET else: @@ -551,7 +546,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_condition_started_at = d.pop("incident_condition_started_at", UNSET) - incident_condition_started_at: IncidentTriggerParamsIncidentConditionStartedAt | Unset + incident_condition_started_at: Union[Unset, IncidentTriggerParamsIncidentConditionStartedAt] if isinstance(_incident_condition_started_at, Unset): incident_condition_started_at = UNSET else: @@ -560,7 +555,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_condition_detected_at = d.pop("incident_condition_detected_at", UNSET) - incident_condition_detected_at: IncidentTriggerParamsIncidentConditionDetectedAt | Unset + incident_condition_detected_at: Union[Unset, IncidentTriggerParamsIncidentConditionDetectedAt] if isinstance(_incident_condition_detected_at, Unset): incident_condition_detected_at = UNSET else: @@ -569,7 +564,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_condition_acknowledged_at = d.pop("incident_condition_acknowledged_at", UNSET) - incident_condition_acknowledged_at: IncidentTriggerParamsIncidentConditionAcknowledgedAt | Unset + incident_condition_acknowledged_at: Union[Unset, IncidentTriggerParamsIncidentConditionAcknowledgedAt] if isinstance(_incident_condition_acknowledged_at, Unset): incident_condition_acknowledged_at = UNSET else: @@ -578,7 +573,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_condition_mitigated_at = d.pop("incident_condition_mitigated_at", UNSET) - incident_condition_mitigated_at: IncidentTriggerParamsIncidentConditionMitigatedAt | Unset + incident_condition_mitigated_at: Union[Unset, IncidentTriggerParamsIncidentConditionMitigatedAt] if isinstance(_incident_condition_mitigated_at, Unset): incident_condition_mitigated_at = UNSET else: @@ -587,7 +582,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_condition_resolved_at = d.pop("incident_condition_resolved_at", UNSET) - incident_condition_resolved_at: IncidentTriggerParamsIncidentConditionResolvedAt | Unset + incident_condition_resolved_at: Union[Unset, IncidentTriggerParamsIncidentConditionResolvedAt] if isinstance(_incident_condition_resolved_at, Unset): incident_condition_resolved_at = UNSET else: @@ -596,7 +591,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_conditional_inactivity = d.pop("incident_conditional_inactivity", UNSET) - incident_conditional_inactivity: IncidentTriggerParamsIncidentConditionalInactivity | Unset + incident_conditional_inactivity: Union[Unset, IncidentTriggerParamsIncidentConditionalInactivity] if isinstance(_incident_conditional_inactivity, Unset): incident_conditional_inactivity = UNSET else: diff --git a/rootly_sdk/models/incident_type.py b/rootly_sdk/models/incident_type.py index b0f8f6fe..3e89c51e 100644 --- a/rootly_sdk/models/incident_type.py +++ b/rootly_sdk/models/incident_type.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -24,33 +22,34 @@ class IncidentType: name (str): The name of the incident type created_at (str): Date of creation updated_at (str): Date of last update - slug (str | Unset): The slug of the incident type - description (None | str | Unset): The description of the incident type - color (None | str | Unset): The hex color of the incident type - position (int | None | Unset): Position of the incident type - notify_emails (list[str] | None | Unset): Emails to attach to the incident type - slack_channels (list[IncidentTypeSlackChannelsType0Item] | None | Unset): Slack Channels associated with this - incident type - slack_aliases (list[IncidentTypeSlackAliasesType0Item] | None | Unset): Slack Aliases associated with this - incident type - properties (list[IncidentTypePropertiesItem] | Unset): Array of property values for this incident type. + slug (Union[Unset, str]): The slug of the incident type + description (Union[None, Unset, str]): The description of the incident type + public_description (Union[None, Unset, str]): The status page description of the incident type + color (Union[None, Unset, str]): The hex color of the incident type + position (Union[None, Unset, int]): Position of the incident type + notify_emails (Union[None, Unset, list[str]]): Emails to attach to the incident type + slack_channels (Union[None, Unset, list['IncidentTypeSlackChannelsType0Item']]): Slack Channels associated with + this incident type + slack_aliases (Union[None, Unset, list['IncidentTypeSlackAliasesType0Item']]): Slack Aliases associated with + this incident type + properties (Union[Unset, list['IncidentTypePropertiesItem']]): Array of property values for this incident type. """ name: str created_at: str updated_at: str - slug: str | Unset = UNSET - description: None | str | Unset = UNSET - color: None | str | Unset = UNSET - position: int | None | Unset = UNSET - notify_emails: list[str] | None | Unset = UNSET - slack_channels: list[IncidentTypeSlackChannelsType0Item] | None | Unset = UNSET - slack_aliases: list[IncidentTypeSlackAliasesType0Item] | None | Unset = UNSET - properties: list[IncidentTypePropertiesItem] | Unset = UNSET + slug: Union[Unset, str] = UNSET + description: Union[None, Unset, str] = UNSET + public_description: Union[None, Unset, str] = UNSET + color: Union[None, Unset, str] = UNSET + position: Union[None, Unset, int] = UNSET + notify_emails: Union[None, Unset, list[str]] = UNSET + slack_channels: Union[None, Unset, list["IncidentTypeSlackChannelsType0Item"]] = UNSET + slack_aliases: Union[None, Unset, list["IncidentTypeSlackAliasesType0Item"]] = UNSET + properties: Union[Unset, list["IncidentTypePropertiesItem"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - name = self.name created_at = self.created_at @@ -59,25 +58,31 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - description: None | str | Unset + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: description = self.description - color: None | str | Unset + public_description: Union[None, Unset, str] + if isinstance(self.public_description, Unset): + public_description = UNSET + else: + public_description = self.public_description + + color: Union[None, Unset, str] if isinstance(self.color, Unset): color = UNSET else: color = self.color - position: int | None | Unset + position: Union[None, Unset, int] if isinstance(self.position, Unset): position = UNSET else: position = self.position - notify_emails: list[str] | None | Unset + notify_emails: Union[None, Unset, list[str]] if isinstance(self.notify_emails, Unset): notify_emails = UNSET elif isinstance(self.notify_emails, list): @@ -86,7 +91,7 @@ def to_dict(self) -> dict[str, Any]: else: notify_emails = self.notify_emails - slack_channels: list[dict[str, Any]] | None | Unset + slack_channels: Union[None, Unset, list[dict[str, Any]]] if isinstance(self.slack_channels, Unset): slack_channels = UNSET elif isinstance(self.slack_channels, list): @@ -98,7 +103,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_channels = self.slack_channels - slack_aliases: list[dict[str, Any]] | None | Unset + slack_aliases: Union[None, Unset, list[dict[str, Any]]] if isinstance(self.slack_aliases, Unset): slack_aliases = UNSET elif isinstance(self.slack_aliases, list): @@ -110,7 +115,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_aliases = self.slack_aliases - properties: list[dict[str, Any]] | Unset = UNSET + properties: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.properties, Unset): properties = [] for properties_item_data in self.properties: @@ -130,6 +135,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["slug"] = slug if description is not UNSET: field_dict["description"] = description + if public_description is not UNSET: + field_dict["public_description"] = public_description if color is not UNSET: field_dict["color"] = color if position is not UNSET: @@ -160,34 +167,43 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: slug = d.pop("slug", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) - def _parse_color(data: object) -> None | str | Unset: + def _parse_public_description(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + public_description = _parse_public_description(d.pop("public_description", UNSET)) + + def _parse_color(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) color = _parse_color(d.pop("color", UNSET)) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> Union[None, Unset, int]: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(Union[None, Unset, int], data) position = _parse_position(d.pop("position", UNSET)) - def _parse_notify_emails(data: object) -> list[str] | None | Unset: + def _parse_notify_emails(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -198,13 +214,13 @@ def _parse_notify_emails(data: object) -> list[str] | None | Unset: notify_emails_type_0 = cast(list[str], data) return notify_emails_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) notify_emails = _parse_notify_emails(d.pop("notify_emails", UNSET)) - def _parse_slack_channels(data: object) -> list[IncidentTypeSlackChannelsType0Item] | None | Unset: + def _parse_slack_channels(data: object) -> Union[None, Unset, list["IncidentTypeSlackChannelsType0Item"]]: if data is None: return data if isinstance(data, Unset): @@ -222,13 +238,13 @@ def _parse_slack_channels(data: object) -> list[IncidentTypeSlackChannelsType0It slack_channels_type_0.append(slack_channels_type_0_item) return slack_channels_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[IncidentTypeSlackChannelsType0Item] | None | Unset, data) + return cast(Union[None, Unset, list["IncidentTypeSlackChannelsType0Item"]], data) slack_channels = _parse_slack_channels(d.pop("slack_channels", UNSET)) - def _parse_slack_aliases(data: object) -> list[IncidentTypeSlackAliasesType0Item] | None | Unset: + def _parse_slack_aliases(data: object) -> Union[None, Unset, list["IncidentTypeSlackAliasesType0Item"]]: if data is None: return data if isinstance(data, Unset): @@ -246,20 +262,18 @@ def _parse_slack_aliases(data: object) -> list[IncidentTypeSlackAliasesType0Item slack_aliases_type_0.append(slack_aliases_type_0_item) return slack_aliases_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[IncidentTypeSlackAliasesType0Item] | None | Unset, data) + return cast(Union[None, Unset, list["IncidentTypeSlackAliasesType0Item"]], data) slack_aliases = _parse_slack_aliases(d.pop("slack_aliases", UNSET)) + properties = [] _properties = d.pop("properties", UNSET) - properties: list[IncidentTypePropertiesItem] | Unset = UNSET - if _properties is not UNSET: - properties = [] - for properties_item_data in _properties: - properties_item = IncidentTypePropertiesItem.from_dict(properties_item_data) + for properties_item_data in _properties or []: + properties_item = IncidentTypePropertiesItem.from_dict(properties_item_data) - properties.append(properties_item) + properties.append(properties_item) incident_type = cls( name=name, @@ -267,6 +281,7 @@ def _parse_slack_aliases(data: object) -> list[IncidentTypeSlackAliasesType0Item updated_at=updated_at, slug=slug, description=description, + public_description=public_description, color=color, position=position, notify_emails=notify_emails, diff --git a/rootly_sdk/models/incident_type_list.py b/rootly_sdk/models/incident_type_list.py index 3fcfd517..bb4419bc 100644 --- a/rootly_sdk/models/incident_type_list.py +++ b/rootly_sdk/models/incident_type_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,20 +20,19 @@ class IncidentTypeList: """ Attributes: - data (list[IncidentTypeListDataItem]): + data (list['IncidentTypeListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[IncidentTypeListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["IncidentTypeListDataItem"] + links: "Links" + meta: "Meta" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) incident_type_list = cls( data=data, diff --git a/rootly_sdk/models/incident_type_list_data_item.py b/rootly_sdk/models/incident_type_list_data_item.py index bedeef51..ed31943b 100644 --- a/rootly_sdk/models/incident_type_list_data_item.py +++ b/rootly_sdk/models/incident_type_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class IncidentTypeListDataItem: id: str type_: IncidentTypeListDataItemType - attributes: IncidentType + attributes: "IncidentType" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/incident_type_properties_item.py b/rootly_sdk/models/incident_type_properties_item.py index 5bcab317..6c91d662 100644 --- a/rootly_sdk/models/incident_type_properties_item.py +++ b/rootly_sdk/models/incident_type_properties_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/incident_type_response.py b/rootly_sdk/models/incident_type_response.py index 8345322e..aa97ceaf 100644 --- a/rootly_sdk/models/incident_type_response.py +++ b/rootly_sdk/models/incident_type_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,18 +19,17 @@ class IncidentTypeResponse: """ Attributes: data (IncidentTypeResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: IncidentTypeResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "IncidentTypeResponseData" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = IncidentTypeResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) incident_type_response = cls( data=data, diff --git a/rootly_sdk/models/incident_type_response_data.py b/rootly_sdk/models/incident_type_response_data.py index 0467f19a..7b9f0ecb 100644 --- a/rootly_sdk/models/incident_type_response_data.py +++ b/rootly_sdk/models/incident_type_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class IncidentTypeResponseData: id: str type_: IncidentTypeResponseDataType - attributes: IncidentType + attributes: "IncidentType" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/incident_type_slack_aliases_type_0_item.py b/rootly_sdk/models/incident_type_slack_aliases_type_0_item.py index e60d5ce2..5aadf52e 100644 --- a/rootly_sdk/models/incident_type_slack_aliases_type_0_item.py +++ b/rootly_sdk/models/incident_type_slack_aliases_type_0_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/incident_type_slack_channels_type_0_item.py b/rootly_sdk/models/incident_type_slack_channels_type_0_item.py index b579c633..4db8b7e4 100644 --- a/rootly_sdk/models/incident_type_slack_channels_type_0_item.py +++ b/rootly_sdk/models/incident_type_slack_channels_type_0_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/incident_user_type_0.py b/rootly_sdk/models/incident_user_type_0.py index dce50314..efbc92a9 100644 --- a/rootly_sdk/models/incident_user_type_0.py +++ b/rootly_sdk/models/incident_user_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,7 +14,6 @@ class IncidentUserType0: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) diff --git a/rootly_sdk/models/incident_zoom_meeting_global_dial_in_numbers_type_0_item.py b/rootly_sdk/models/incident_zoom_meeting_global_dial_in_numbers_type_0_item.py index 3bfaac57..6415f035 100644 --- a/rootly_sdk/models/incident_zoom_meeting_global_dial_in_numbers_type_0_item.py +++ b/rootly_sdk/models/incident_zoom_meeting_global_dial_in_numbers_type_0_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,18 +13,18 @@ class IncidentZoomMeetingGlobalDialInNumbersType0Item: """ Attributes: - country (str | Unset): - country_name (str | Unset): - city (str | Unset): - number (str | Unset): - type_ (str | Unset): + country (Union[Unset, str]): + country_name (Union[Unset, str]): + city (Union[Unset, str]): + number (Union[Unset, str]): + type_ (Union[Unset, str]): """ - country: str | Unset = UNSET - country_name: str | Unset = UNSET - city: str | Unset = UNSET - number: str | Unset = UNSET - type_: str | Unset = UNSET + country: Union[Unset, str] = UNSET + country_name: Union[Unset, str] = UNSET + city: Union[Unset, str] = UNSET + number: Union[Unset, str] = UNSET + type_: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/incidents_chart_response.py b/rootly_sdk/models/incidents_chart_response.py index 95932b9f..becff146 100644 --- a/rootly_sdk/models/incidents_chart_response.py +++ b/rootly_sdk/models/incidents_chart_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class IncidentsChartResponse: data (IncidentsChartResponseData): """ - data: IncidentsChartResponseData + data: "IncidentsChartResponseData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/incidents_chart_response_data.py b/rootly_sdk/models/incidents_chart_response_data.py index 544d592e..35782e51 100644 --- a/rootly_sdk/models/incidents_chart_response_data.py +++ b/rootly_sdk/models/incidents_chart_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,7 +14,6 @@ class IncidentsChartResponseData: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) diff --git a/rootly_sdk/models/invite_to_google_chat_space_task_params.py b/rootly_sdk/models/invite_to_google_chat_space_task_params.py index ced72472..2f17c470 100644 --- a/rootly_sdk/models/invite_to_google_chat_space_task_params.py +++ b/rootly_sdk/models/invite_to_google_chat_space_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -25,21 +23,20 @@ class InviteToGoogleChatSpaceTaskParams: Attributes: space (InviteToGoogleChatSpaceTaskParamsSpace): emails (str): Comma separated list of emails to invite - task_type (InviteToGoogleChatSpaceTaskParamsTaskType | Unset): + task_type (Union[Unset, InviteToGoogleChatSpaceTaskParamsTaskType]): """ - space: InviteToGoogleChatSpaceTaskParamsSpace + space: "InviteToGoogleChatSpaceTaskParamsSpace" emails: str - task_type: InviteToGoogleChatSpaceTaskParamsTaskType | Unset = UNSET + task_type: Union[Unset, InviteToGoogleChatSpaceTaskParamsTaskType] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - space = self.space.to_dict() emails = self.emails - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -66,7 +63,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: emails = d.pop("emails") _task_type = d.pop("task_type", UNSET) - task_type: InviteToGoogleChatSpaceTaskParamsTaskType | Unset + task_type: Union[Unset, InviteToGoogleChatSpaceTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/invite_to_google_chat_space_task_params_space.py b/rootly_sdk/models/invite_to_google_chat_space_task_params_space.py index 90770cb9..121591c6 100644 --- a/rootly_sdk/models/invite_to_google_chat_space_task_params_space.py +++ b/rootly_sdk/models/invite_to_google_chat_space_task_params_space.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class InviteToGoogleChatSpaceTaskParamsSpace: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/invite_to_microsoft_teams_channel_rootly_task_params.py b/rootly_sdk/models/invite_to_microsoft_teams_channel_rootly_task_params.py index ef3f3b57..5583046e 100644 --- a/rootly_sdk/models/invite_to_microsoft_teams_channel_rootly_task_params.py +++ b/rootly_sdk/models/invite_to_microsoft_teams_channel_rootly_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -45,51 +43,52 @@ class InviteToMicrosoftTeamsChannelRootlyTaskParams: Attributes: team (InviteToMicrosoftTeamsChannelRootlyTaskParamsTeam): channel (InviteToMicrosoftTeamsChannelRootlyTaskParamsChannel): - task_type (InviteToMicrosoftTeamsChannelRootlyTaskParamsTaskType | Unset): - escalation_policy_target (InviteToMicrosoftTeamsChannelRootlyTaskParamsEscalationPolicyTarget | Unset): - service_target (InviteToMicrosoftTeamsChannelRootlyTaskParamsServiceTarget | Unset): - user_target (InviteToMicrosoftTeamsChannelRootlyTaskParamsUserTarget | Unset): - group_target (InviteToMicrosoftTeamsChannelRootlyTaskParamsGroupTarget | Unset): - schedule_target (InviteToMicrosoftTeamsChannelRootlyTaskParamsScheduleTarget | Unset): + task_type (Union[Unset, InviteToMicrosoftTeamsChannelRootlyTaskParamsTaskType]): + escalation_policy_target (Union[Unset, InviteToMicrosoftTeamsChannelRootlyTaskParamsEscalationPolicyTarget]): + service_target (Union[Unset, InviteToMicrosoftTeamsChannelRootlyTaskParamsServiceTarget]): + user_target (Union[Unset, InviteToMicrosoftTeamsChannelRootlyTaskParamsUserTarget]): + group_target (Union[Unset, InviteToMicrosoftTeamsChannelRootlyTaskParamsGroupTarget]): + schedule_target (Union[Unset, InviteToMicrosoftTeamsChannelRootlyTaskParamsScheduleTarget]): """ - team: InviteToMicrosoftTeamsChannelRootlyTaskParamsTeam - channel: InviteToMicrosoftTeamsChannelRootlyTaskParamsChannel - task_type: InviteToMicrosoftTeamsChannelRootlyTaskParamsTaskType | Unset = UNSET - escalation_policy_target: InviteToMicrosoftTeamsChannelRootlyTaskParamsEscalationPolicyTarget | Unset = UNSET - service_target: InviteToMicrosoftTeamsChannelRootlyTaskParamsServiceTarget | Unset = UNSET - user_target: InviteToMicrosoftTeamsChannelRootlyTaskParamsUserTarget | Unset = UNSET - group_target: InviteToMicrosoftTeamsChannelRootlyTaskParamsGroupTarget | Unset = UNSET - schedule_target: InviteToMicrosoftTeamsChannelRootlyTaskParamsScheduleTarget | Unset = UNSET + team: "InviteToMicrosoftTeamsChannelRootlyTaskParamsTeam" + channel: "InviteToMicrosoftTeamsChannelRootlyTaskParamsChannel" + task_type: Union[Unset, InviteToMicrosoftTeamsChannelRootlyTaskParamsTaskType] = UNSET + escalation_policy_target: Union[Unset, "InviteToMicrosoftTeamsChannelRootlyTaskParamsEscalationPolicyTarget"] = ( + UNSET + ) + service_target: Union[Unset, "InviteToMicrosoftTeamsChannelRootlyTaskParamsServiceTarget"] = UNSET + user_target: Union[Unset, "InviteToMicrosoftTeamsChannelRootlyTaskParamsUserTarget"] = UNSET + group_target: Union[Unset, "InviteToMicrosoftTeamsChannelRootlyTaskParamsGroupTarget"] = UNSET + schedule_target: Union[Unset, "InviteToMicrosoftTeamsChannelRootlyTaskParamsScheduleTarget"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - team = self.team.to_dict() channel = self.channel.to_dict() - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - escalation_policy_target: dict[str, Any] | Unset = UNSET + escalation_policy_target: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.escalation_policy_target, Unset): escalation_policy_target = self.escalation_policy_target.to_dict() - service_target: dict[str, Any] | Unset = UNSET + service_target: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.service_target, Unset): service_target = self.service_target.to_dict() - user_target: dict[str, Any] | Unset = UNSET + user_target: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.user_target, Unset): user_target = self.user_target.to_dict() - group_target: dict[str, Any] | Unset = UNSET + group_target: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.group_target, Unset): group_target = self.group_target.to_dict() - schedule_target: dict[str, Any] | Unset = UNSET + schedule_target: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.schedule_target, Unset): schedule_target = self.schedule_target.to_dict() @@ -146,14 +145,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: channel = InviteToMicrosoftTeamsChannelRootlyTaskParamsChannel.from_dict(d.pop("channel")) _task_type = d.pop("task_type", UNSET) - task_type: InviteToMicrosoftTeamsChannelRootlyTaskParamsTaskType | Unset + task_type: Union[Unset, InviteToMicrosoftTeamsChannelRootlyTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: task_type = check_invite_to_microsoft_teams_channel_rootly_task_params_task_type(_task_type) _escalation_policy_target = d.pop("escalation_policy_target", UNSET) - escalation_policy_target: InviteToMicrosoftTeamsChannelRootlyTaskParamsEscalationPolicyTarget | Unset + escalation_policy_target: Union[Unset, InviteToMicrosoftTeamsChannelRootlyTaskParamsEscalationPolicyTarget] if isinstance(_escalation_policy_target, Unset): escalation_policy_target = UNSET else: @@ -162,28 +161,28 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: ) _service_target = d.pop("service_target", UNSET) - service_target: InviteToMicrosoftTeamsChannelRootlyTaskParamsServiceTarget | Unset + service_target: Union[Unset, InviteToMicrosoftTeamsChannelRootlyTaskParamsServiceTarget] if isinstance(_service_target, Unset): service_target = UNSET else: service_target = InviteToMicrosoftTeamsChannelRootlyTaskParamsServiceTarget.from_dict(_service_target) _user_target = d.pop("user_target", UNSET) - user_target: InviteToMicrosoftTeamsChannelRootlyTaskParamsUserTarget | Unset + user_target: Union[Unset, InviteToMicrosoftTeamsChannelRootlyTaskParamsUserTarget] if isinstance(_user_target, Unset): user_target = UNSET else: user_target = InviteToMicrosoftTeamsChannelRootlyTaskParamsUserTarget.from_dict(_user_target) _group_target = d.pop("group_target", UNSET) - group_target: InviteToMicrosoftTeamsChannelRootlyTaskParamsGroupTarget | Unset + group_target: Union[Unset, InviteToMicrosoftTeamsChannelRootlyTaskParamsGroupTarget] if isinstance(_group_target, Unset): group_target = UNSET else: group_target = InviteToMicrosoftTeamsChannelRootlyTaskParamsGroupTarget.from_dict(_group_target) _schedule_target = d.pop("schedule_target", UNSET) - schedule_target: InviteToMicrosoftTeamsChannelRootlyTaskParamsScheduleTarget | Unset + schedule_target: Union[Unset, InviteToMicrosoftTeamsChannelRootlyTaskParamsScheduleTarget] if isinstance(_schedule_target, Unset): schedule_target = UNSET else: diff --git a/rootly_sdk/models/invite_to_microsoft_teams_channel_rootly_task_params_channel.py b/rootly_sdk/models/invite_to_microsoft_teams_channel_rootly_task_params_channel.py index 865e2e95..bfe76649 100644 --- a/rootly_sdk/models/invite_to_microsoft_teams_channel_rootly_task_params_channel.py +++ b/rootly_sdk/models/invite_to_microsoft_teams_channel_rootly_task_params_channel.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class InviteToMicrosoftTeamsChannelRootlyTaskParamsChannel: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/invite_to_microsoft_teams_channel_rootly_task_params_escalation_policy_target.py b/rootly_sdk/models/invite_to_microsoft_teams_channel_rootly_task_params_escalation_policy_target.py index 4ef5fc51..5af582a4 100644 --- a/rootly_sdk/models/invite_to_microsoft_teams_channel_rootly_task_params_escalation_policy_target.py +++ b/rootly_sdk/models/invite_to_microsoft_teams_channel_rootly_task_params_escalation_policy_target.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class InviteToMicrosoftTeamsChannelRootlyTaskParamsEscalationPolicyTarget: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/invite_to_microsoft_teams_channel_rootly_task_params_group_target.py b/rootly_sdk/models/invite_to_microsoft_teams_channel_rootly_task_params_group_target.py index 3c2a90e4..2635fcdf 100644 --- a/rootly_sdk/models/invite_to_microsoft_teams_channel_rootly_task_params_group_target.py +++ b/rootly_sdk/models/invite_to_microsoft_teams_channel_rootly_task_params_group_target.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class InviteToMicrosoftTeamsChannelRootlyTaskParamsGroupTarget: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/invite_to_microsoft_teams_channel_rootly_task_params_schedule_target.py b/rootly_sdk/models/invite_to_microsoft_teams_channel_rootly_task_params_schedule_target.py index 0616c5e2..221f1422 100644 --- a/rootly_sdk/models/invite_to_microsoft_teams_channel_rootly_task_params_schedule_target.py +++ b/rootly_sdk/models/invite_to_microsoft_teams_channel_rootly_task_params_schedule_target.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class InviteToMicrosoftTeamsChannelRootlyTaskParamsScheduleTarget: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/invite_to_microsoft_teams_channel_rootly_task_params_service_target.py b/rootly_sdk/models/invite_to_microsoft_teams_channel_rootly_task_params_service_target.py index 167fa3e6..1d82f146 100644 --- a/rootly_sdk/models/invite_to_microsoft_teams_channel_rootly_task_params_service_target.py +++ b/rootly_sdk/models/invite_to_microsoft_teams_channel_rootly_task_params_service_target.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class InviteToMicrosoftTeamsChannelRootlyTaskParamsServiceTarget: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/invite_to_microsoft_teams_channel_rootly_task_params_team.py b/rootly_sdk/models/invite_to_microsoft_teams_channel_rootly_task_params_team.py index f828e8a0..5f3bfd04 100644 --- a/rootly_sdk/models/invite_to_microsoft_teams_channel_rootly_task_params_team.py +++ b/rootly_sdk/models/invite_to_microsoft_teams_channel_rootly_task_params_team.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class InviteToMicrosoftTeamsChannelRootlyTaskParamsTeam: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/invite_to_microsoft_teams_channel_rootly_task_params_user_target.py b/rootly_sdk/models/invite_to_microsoft_teams_channel_rootly_task_params_user_target.py index ed58e7af..d33ced93 100644 --- a/rootly_sdk/models/invite_to_microsoft_teams_channel_rootly_task_params_user_target.py +++ b/rootly_sdk/models/invite_to_microsoft_teams_channel_rootly_task_params_user_target.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class InviteToMicrosoftTeamsChannelRootlyTaskParamsUserTarget: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/invite_to_microsoft_teams_channel_task_params.py b/rootly_sdk/models/invite_to_microsoft_teams_channel_task_params.py index ae59c5cf..59f2624e 100644 --- a/rootly_sdk/models/invite_to_microsoft_teams_channel_task_params.py +++ b/rootly_sdk/models/invite_to_microsoft_teams_channel_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -28,27 +26,26 @@ class InviteToMicrosoftTeamsChannelTaskParams: Attributes: channel (InviteToMicrosoftTeamsChannelTaskParamsChannel): emails (str): Comma separated list of emails to invite - task_type (InviteToMicrosoftTeamsChannelTaskParamsTaskType | Unset): - team (InviteToMicrosoftTeamsChannelTaskParamsTeam | Unset): + task_type (Union[Unset, InviteToMicrosoftTeamsChannelTaskParamsTaskType]): + team (Union[Unset, InviteToMicrosoftTeamsChannelTaskParamsTeam]): """ - channel: InviteToMicrosoftTeamsChannelTaskParamsChannel + channel: "InviteToMicrosoftTeamsChannelTaskParamsChannel" emails: str - task_type: InviteToMicrosoftTeamsChannelTaskParamsTaskType | Unset = UNSET - team: InviteToMicrosoftTeamsChannelTaskParamsTeam | Unset = UNSET + task_type: Union[Unset, InviteToMicrosoftTeamsChannelTaskParamsTaskType] = UNSET + team: Union[Unset, "InviteToMicrosoftTeamsChannelTaskParamsTeam"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - channel = self.channel.to_dict() emails = self.emails - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - team: dict[str, Any] | Unset = UNSET + team: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.team, Unset): team = self.team.to_dict() @@ -82,14 +79,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: emails = d.pop("emails") _task_type = d.pop("task_type", UNSET) - task_type: InviteToMicrosoftTeamsChannelTaskParamsTaskType | Unset + task_type: Union[Unset, InviteToMicrosoftTeamsChannelTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: task_type = check_invite_to_microsoft_teams_channel_task_params_task_type(_task_type) _team = d.pop("team", UNSET) - team: InviteToMicrosoftTeamsChannelTaskParamsTeam | Unset + team: Union[Unset, InviteToMicrosoftTeamsChannelTaskParamsTeam] if isinstance(_team, Unset): team = UNSET else: diff --git a/rootly_sdk/models/invite_to_microsoft_teams_channel_task_params_channel.py b/rootly_sdk/models/invite_to_microsoft_teams_channel_task_params_channel.py index 08fe1c78..4d55cec2 100644 --- a/rootly_sdk/models/invite_to_microsoft_teams_channel_task_params_channel.py +++ b/rootly_sdk/models/invite_to_microsoft_teams_channel_task_params_channel.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class InviteToMicrosoftTeamsChannelTaskParamsChannel: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/invite_to_microsoft_teams_channel_task_params_team.py b/rootly_sdk/models/invite_to_microsoft_teams_channel_task_params_team.py index 8e6139f7..3b0fa373 100644 --- a/rootly_sdk/models/invite_to_microsoft_teams_channel_task_params_team.py +++ b/rootly_sdk/models/invite_to_microsoft_teams_channel_task_params_team.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class InviteToMicrosoftTeamsChannelTaskParamsTeam: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/invite_to_slack_channel_opsgenie_task_params.py b/rootly_sdk/models/invite_to_slack_channel_opsgenie_task_params.py index 852ab3a2..df9f8677 100644 --- a/rootly_sdk/models/invite_to_slack_channel_opsgenie_task_params.py +++ b/rootly_sdk/models/invite_to_slack_channel_opsgenie_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -28,18 +26,17 @@ class InviteToSlackChannelOpsgenieTaskParams: """ Attributes: - channels (list[InviteToSlackChannelOpsgenieTaskParamsChannelsItem]): + channels (list['InviteToSlackChannelOpsgenieTaskParamsChannelsItem']): schedule (InviteToSlackChannelOpsgenieTaskParamsSchedule): - task_type (InviteToSlackChannelOpsgenieTaskParamsTaskType | Unset): + task_type (Union[Unset, InviteToSlackChannelOpsgenieTaskParamsTaskType]): """ - channels: list[InviteToSlackChannelOpsgenieTaskParamsChannelsItem] - schedule: InviteToSlackChannelOpsgenieTaskParamsSchedule - task_type: InviteToSlackChannelOpsgenieTaskParamsTaskType | Unset = UNSET + channels: list["InviteToSlackChannelOpsgenieTaskParamsChannelsItem"] + schedule: "InviteToSlackChannelOpsgenieTaskParamsSchedule" + task_type: Union[Unset, InviteToSlackChannelOpsgenieTaskParamsTaskType] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - channels = [] for channels_item_data in self.channels: channels_item = channels_item_data.to_dict() @@ -47,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: schedule = self.schedule.to_dict() - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -84,7 +81,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: schedule = InviteToSlackChannelOpsgenieTaskParamsSchedule.from_dict(d.pop("schedule")) _task_type = d.pop("task_type", UNSET) - task_type: InviteToSlackChannelOpsgenieTaskParamsTaskType | Unset + task_type: Union[Unset, InviteToSlackChannelOpsgenieTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/invite_to_slack_channel_opsgenie_task_params_channels_item.py b/rootly_sdk/models/invite_to_slack_channel_opsgenie_task_params_channels_item.py index 203b4beb..e55f3f03 100644 --- a/rootly_sdk/models/invite_to_slack_channel_opsgenie_task_params_channels_item.py +++ b/rootly_sdk/models/invite_to_slack_channel_opsgenie_task_params_channels_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class InviteToSlackChannelOpsgenieTaskParamsChannelsItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/invite_to_slack_channel_opsgenie_task_params_schedule.py b/rootly_sdk/models/invite_to_slack_channel_opsgenie_task_params_schedule.py index 395e06bf..39e7d1a6 100644 --- a/rootly_sdk/models/invite_to_slack_channel_opsgenie_task_params_schedule.py +++ b/rootly_sdk/models/invite_to_slack_channel_opsgenie_task_params_schedule.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class InviteToSlackChannelOpsgenieTaskParamsSchedule: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/invite_to_slack_channel_pagerduty_task_params_type_0_escalation_policy.py b/rootly_sdk/models/invite_to_slack_channel_pagerduty_task_params_type_0_escalation_policy.py index 3351841d..95548e6b 100644 --- a/rootly_sdk/models/invite_to_slack_channel_pagerduty_task_params_type_0_escalation_policy.py +++ b/rootly_sdk/models/invite_to_slack_channel_pagerduty_task_params_type_0_escalation_policy.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class InviteToSlackChannelPagerdutyTaskParamsType0EscalationPolicy: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/invite_to_slack_channel_pagerduty_task_params_type_1_schedule.py b/rootly_sdk/models/invite_to_slack_channel_pagerduty_task_params_type_1_schedule.py index 41e59cc3..d8db577c 100644 --- a/rootly_sdk/models/invite_to_slack_channel_pagerduty_task_params_type_1_schedule.py +++ b/rootly_sdk/models/invite_to_slack_channel_pagerduty_task_params_type_1_schedule.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class InviteToSlackChannelPagerdutyTaskParamsType1Schedule: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/invite_to_slack_channel_rootly_task_params.py b/rootly_sdk/models/invite_to_slack_channel_rootly_task_params.py index 37ac9795..a743a964 100644 --- a/rootly_sdk/models/invite_to_slack_channel_rootly_task_params.py +++ b/rootly_sdk/models/invite_to_slack_channel_rootly_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -40,52 +38,51 @@ class InviteToSlackChannelRootlyTaskParams: """ Attributes: - channels (list[InviteToSlackChannelRootlyTaskParamsChannelsItem]): - task_type (InviteToSlackChannelRootlyTaskParamsTaskType | Unset): - escalation_policy_target (InviteToSlackChannelRootlyTaskParamsEscalationPolicyTarget | Unset): - service_target (InviteToSlackChannelRootlyTaskParamsServiceTarget | Unset): - user_target (InviteToSlackChannelRootlyTaskParamsUserTarget | Unset): - group_target (InviteToSlackChannelRootlyTaskParamsGroupTarget | Unset): - schedule_target (InviteToSlackChannelRootlyTaskParamsScheduleTarget | Unset): + channels (list['InviteToSlackChannelRootlyTaskParamsChannelsItem']): + task_type (Union[Unset, InviteToSlackChannelRootlyTaskParamsTaskType]): + escalation_policy_target (Union[Unset, InviteToSlackChannelRootlyTaskParamsEscalationPolicyTarget]): + service_target (Union[Unset, InviteToSlackChannelRootlyTaskParamsServiceTarget]): + user_target (Union[Unset, InviteToSlackChannelRootlyTaskParamsUserTarget]): + group_target (Union[Unset, InviteToSlackChannelRootlyTaskParamsGroupTarget]): + schedule_target (Union[Unset, InviteToSlackChannelRootlyTaskParamsScheduleTarget]): """ - channels: list[InviteToSlackChannelRootlyTaskParamsChannelsItem] - task_type: InviteToSlackChannelRootlyTaskParamsTaskType | Unset = UNSET - escalation_policy_target: InviteToSlackChannelRootlyTaskParamsEscalationPolicyTarget | Unset = UNSET - service_target: InviteToSlackChannelRootlyTaskParamsServiceTarget | Unset = UNSET - user_target: InviteToSlackChannelRootlyTaskParamsUserTarget | Unset = UNSET - group_target: InviteToSlackChannelRootlyTaskParamsGroupTarget | Unset = UNSET - schedule_target: InviteToSlackChannelRootlyTaskParamsScheduleTarget | Unset = UNSET + channels: list["InviteToSlackChannelRootlyTaskParamsChannelsItem"] + task_type: Union[Unset, InviteToSlackChannelRootlyTaskParamsTaskType] = UNSET + escalation_policy_target: Union[Unset, "InviteToSlackChannelRootlyTaskParamsEscalationPolicyTarget"] = UNSET + service_target: Union[Unset, "InviteToSlackChannelRootlyTaskParamsServiceTarget"] = UNSET + user_target: Union[Unset, "InviteToSlackChannelRootlyTaskParamsUserTarget"] = UNSET + group_target: Union[Unset, "InviteToSlackChannelRootlyTaskParamsGroupTarget"] = UNSET + schedule_target: Union[Unset, "InviteToSlackChannelRootlyTaskParamsScheduleTarget"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - channels = [] for channels_item_data in self.channels: channels_item = channels_item_data.to_dict() channels.append(channels_item) - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - escalation_policy_target: dict[str, Any] | Unset = UNSET + escalation_policy_target: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.escalation_policy_target, Unset): escalation_policy_target = self.escalation_policy_target.to_dict() - service_target: dict[str, Any] | Unset = UNSET + service_target: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.service_target, Unset): service_target = self.service_target.to_dict() - user_target: dict[str, Any] | Unset = UNSET + user_target: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.user_target, Unset): user_target = self.user_target.to_dict() - group_target: dict[str, Any] | Unset = UNSET + group_target: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.group_target, Unset): group_target = self.group_target.to_dict() - schedule_target: dict[str, Any] | Unset = UNSET + schedule_target: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.schedule_target, Unset): schedule_target = self.schedule_target.to_dict() @@ -141,14 +138,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: channels.append(channels_item) _task_type = d.pop("task_type", UNSET) - task_type: InviteToSlackChannelRootlyTaskParamsTaskType | Unset + task_type: Union[Unset, InviteToSlackChannelRootlyTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: task_type = check_invite_to_slack_channel_rootly_task_params_task_type(_task_type) _escalation_policy_target = d.pop("escalation_policy_target", UNSET) - escalation_policy_target: InviteToSlackChannelRootlyTaskParamsEscalationPolicyTarget | Unset + escalation_policy_target: Union[Unset, InviteToSlackChannelRootlyTaskParamsEscalationPolicyTarget] if isinstance(_escalation_policy_target, Unset): escalation_policy_target = UNSET else: @@ -157,28 +154,28 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: ) _service_target = d.pop("service_target", UNSET) - service_target: InviteToSlackChannelRootlyTaskParamsServiceTarget | Unset + service_target: Union[Unset, InviteToSlackChannelRootlyTaskParamsServiceTarget] if isinstance(_service_target, Unset): service_target = UNSET else: service_target = InviteToSlackChannelRootlyTaskParamsServiceTarget.from_dict(_service_target) _user_target = d.pop("user_target", UNSET) - user_target: InviteToSlackChannelRootlyTaskParamsUserTarget | Unset + user_target: Union[Unset, InviteToSlackChannelRootlyTaskParamsUserTarget] if isinstance(_user_target, Unset): user_target = UNSET else: user_target = InviteToSlackChannelRootlyTaskParamsUserTarget.from_dict(_user_target) _group_target = d.pop("group_target", UNSET) - group_target: InviteToSlackChannelRootlyTaskParamsGroupTarget | Unset + group_target: Union[Unset, InviteToSlackChannelRootlyTaskParamsGroupTarget] if isinstance(_group_target, Unset): group_target = UNSET else: group_target = InviteToSlackChannelRootlyTaskParamsGroupTarget.from_dict(_group_target) _schedule_target = d.pop("schedule_target", UNSET) - schedule_target: InviteToSlackChannelRootlyTaskParamsScheduleTarget | Unset + schedule_target: Union[Unset, InviteToSlackChannelRootlyTaskParamsScheduleTarget] if isinstance(_schedule_target, Unset): schedule_target = UNSET else: diff --git a/rootly_sdk/models/invite_to_slack_channel_rootly_task_params_channels_item.py b/rootly_sdk/models/invite_to_slack_channel_rootly_task_params_channels_item.py index dc0a4aeb..7d494ebc 100644 --- a/rootly_sdk/models/invite_to_slack_channel_rootly_task_params_channels_item.py +++ b/rootly_sdk/models/invite_to_slack_channel_rootly_task_params_channels_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class InviteToSlackChannelRootlyTaskParamsChannelsItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/invite_to_slack_channel_rootly_task_params_escalation_policy_target.py b/rootly_sdk/models/invite_to_slack_channel_rootly_task_params_escalation_policy_target.py index c1ec962e..40e4f039 100644 --- a/rootly_sdk/models/invite_to_slack_channel_rootly_task_params_escalation_policy_target.py +++ b/rootly_sdk/models/invite_to_slack_channel_rootly_task_params_escalation_policy_target.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class InviteToSlackChannelRootlyTaskParamsEscalationPolicyTarget: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/invite_to_slack_channel_rootly_task_params_group_target.py b/rootly_sdk/models/invite_to_slack_channel_rootly_task_params_group_target.py index ddd9bad8..5b361f3a 100644 --- a/rootly_sdk/models/invite_to_slack_channel_rootly_task_params_group_target.py +++ b/rootly_sdk/models/invite_to_slack_channel_rootly_task_params_group_target.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class InviteToSlackChannelRootlyTaskParamsGroupTarget: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/invite_to_slack_channel_rootly_task_params_schedule_target.py b/rootly_sdk/models/invite_to_slack_channel_rootly_task_params_schedule_target.py index 66307c41..ed1a9069 100644 --- a/rootly_sdk/models/invite_to_slack_channel_rootly_task_params_schedule_target.py +++ b/rootly_sdk/models/invite_to_slack_channel_rootly_task_params_schedule_target.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class InviteToSlackChannelRootlyTaskParamsScheduleTarget: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/invite_to_slack_channel_rootly_task_params_service_target.py b/rootly_sdk/models/invite_to_slack_channel_rootly_task_params_service_target.py index 93a0ddb1..dc1ab327 100644 --- a/rootly_sdk/models/invite_to_slack_channel_rootly_task_params_service_target.py +++ b/rootly_sdk/models/invite_to_slack_channel_rootly_task_params_service_target.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class InviteToSlackChannelRootlyTaskParamsServiceTarget: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/invite_to_slack_channel_rootly_task_params_user_target.py b/rootly_sdk/models/invite_to_slack_channel_rootly_task_params_user_target.py index 6ba36eae..fbe2f84c 100644 --- a/rootly_sdk/models/invite_to_slack_channel_rootly_task_params_user_target.py +++ b/rootly_sdk/models/invite_to_slack_channel_rootly_task_params_user_target.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class InviteToSlackChannelRootlyTaskParamsUserTarget: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/invite_to_slack_channel_task_params_type_0_slack_users_item.py b/rootly_sdk/models/invite_to_slack_channel_task_params_type_0_slack_users_item.py index c0d9d99d..a5f2ca53 100644 --- a/rootly_sdk/models/invite_to_slack_channel_task_params_type_0_slack_users_item.py +++ b/rootly_sdk/models/invite_to_slack_channel_task_params_type_0_slack_users_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class InviteToSlackChannelTaskParamsType0SlackUsersItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/invite_to_slack_channel_task_params_type_1_slack_user_groups_item.py b/rootly_sdk/models/invite_to_slack_channel_task_params_type_1_slack_user_groups_item.py index 97ba21b9..6429f5f5 100644 --- a/rootly_sdk/models/invite_to_slack_channel_task_params_type_1_slack_user_groups_item.py +++ b/rootly_sdk/models/invite_to_slack_channel_task_params_type_1_slack_user_groups_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class InviteToSlackChannelTaskParamsType1SlackUserGroupsItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/invite_to_slack_channel_task_params_type_2.py b/rootly_sdk/models/invite_to_slack_channel_task_params_type_2.py index ce51bda3..01eb52a0 100644 --- a/rootly_sdk/models/invite_to_slack_channel_task_params_type_2.py +++ b/rootly_sdk/models/invite_to_slack_channel_task_params_type_2.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/invite_to_slack_channel_victor_ops_task_params.py b/rootly_sdk/models/invite_to_slack_channel_victor_ops_task_params.py index a8e85eaf..551f2556 100644 --- a/rootly_sdk/models/invite_to_slack_channel_victor_ops_task_params.py +++ b/rootly_sdk/models/invite_to_slack_channel_victor_ops_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -26,18 +24,17 @@ class InviteToSlackChannelVictorOpsTaskParams: """ Attributes: - channels (list[InviteToSlackChannelVictorOpsTaskParamsChannelsItem]): + channels (list['InviteToSlackChannelVictorOpsTaskParamsChannelsItem']): team (InviteToSlackChannelVictorOpsTaskParamsTeam): - task_type (InviteToSlackChannelVictorOpsTaskParamsTaskType | Unset): + task_type (Union[Unset, InviteToSlackChannelVictorOpsTaskParamsTaskType]): """ - channels: list[InviteToSlackChannelVictorOpsTaskParamsChannelsItem] - team: InviteToSlackChannelVictorOpsTaskParamsTeam - task_type: InviteToSlackChannelVictorOpsTaskParamsTaskType | Unset = UNSET + channels: list["InviteToSlackChannelVictorOpsTaskParamsChannelsItem"] + team: "InviteToSlackChannelVictorOpsTaskParamsTeam" + task_type: Union[Unset, InviteToSlackChannelVictorOpsTaskParamsTaskType] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - channels = [] for channels_item_data in self.channels: channels_item = channels_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: team = self.team.to_dict() - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -82,7 +79,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: team = InviteToSlackChannelVictorOpsTaskParamsTeam.from_dict(d.pop("team")) _task_type = d.pop("task_type", UNSET) - task_type: InviteToSlackChannelVictorOpsTaskParamsTaskType | Unset + task_type: Union[Unset, InviteToSlackChannelVictorOpsTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/invite_to_slack_channel_victor_ops_task_params_channels_item.py b/rootly_sdk/models/invite_to_slack_channel_victor_ops_task_params_channels_item.py index bb0cad1b..92b84c9d 100644 --- a/rootly_sdk/models/invite_to_slack_channel_victor_ops_task_params_channels_item.py +++ b/rootly_sdk/models/invite_to_slack_channel_victor_ops_task_params_channels_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class InviteToSlackChannelVictorOpsTaskParamsChannelsItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/invite_to_slack_channel_victor_ops_task_params_team.py b/rootly_sdk/models/invite_to_slack_channel_victor_ops_task_params_team.py index b00e5aa4..21056115 100644 --- a/rootly_sdk/models/invite_to_slack_channel_victor_ops_task_params_team.py +++ b/rootly_sdk/models/invite_to_slack_channel_victor_ops_task_params_team.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class InviteToSlackChannelVictorOpsTaskParamsTeam: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/ip_ranges.py b/rootly_sdk/models/ip_ranges.py index f959ae26..64c416d1 100644 --- a/rootly_sdk/models/ip_ranges.py +++ b/rootly_sdk/models/ip_ranges.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast diff --git a/rootly_sdk/models/ip_ranges_response.py b/rootly_sdk/models/ip_ranges_response.py index 6cd7d27e..23b3ad46 100644 --- a/rootly_sdk/models/ip_ranges_response.py +++ b/rootly_sdk/models/ip_ranges_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class IpRangesResponse: data (IpRangesResponseData): """ - data: IpRangesResponseData + data: "IpRangesResponseData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/ip_ranges_response_data.py b/rootly_sdk/models/ip_ranges_response_data.py index de55248c..815ecd72 100644 --- a/rootly_sdk/models/ip_ranges_response_data.py +++ b/rootly_sdk/models/ip_ranges_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class IpRangesResponseData: id: str type_: IpRangesResponseDataType - attributes: IpRanges + attributes: "IpRanges" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/jsonapi_included_resource.py b/rootly_sdk/models/jsonapi_included_resource.py index bb745c1d..ec33a94e 100644 --- a/rootly_sdk/models/jsonapi_included_resource.py +++ b/rootly_sdk/models/jsonapi_included_resource.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,27 +20,26 @@ class JsonapiIncludedResource: Attributes: id (str): type_ (str): - attributes (JsonapiIncludedResourceAttributes | Unset): - relationships (JsonapiIncludedResourceRelationships | Unset): + attributes (Union[Unset, JsonapiIncludedResourceAttributes]): + relationships (Union[Unset, JsonapiIncludedResourceRelationships]): """ id: str type_: str - attributes: JsonapiIncludedResourceAttributes | Unset = UNSET - relationships: JsonapiIncludedResourceRelationships | Unset = UNSET + attributes: Union[Unset, "JsonapiIncludedResourceAttributes"] = UNSET + relationships: Union[Unset, "JsonapiIncludedResourceRelationships"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_ = self.type_ - attributes: dict[str, Any] | Unset = UNSET + attributes: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.attributes, Unset): attributes = self.attributes.to_dict() - relationships: dict[str, Any] | Unset = UNSET + relationships: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.relationships, Unset): relationships = self.relationships.to_dict() @@ -72,14 +69,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: type_ = d.pop("type") _attributes = d.pop("attributes", UNSET) - attributes: JsonapiIncludedResourceAttributes | Unset + attributes: Union[Unset, JsonapiIncludedResourceAttributes] if isinstance(_attributes, Unset): attributes = UNSET else: attributes = JsonapiIncludedResourceAttributes.from_dict(_attributes) _relationships = d.pop("relationships", UNSET) - relationships: JsonapiIncludedResourceRelationships | Unset + relationships: Union[Unset, JsonapiIncludedResourceRelationships] if isinstance(_relationships, Unset): relationships = UNSET else: diff --git a/rootly_sdk/models/jsonapi_included_resource_attributes.py b/rootly_sdk/models/jsonapi_included_resource_attributes.py index 4941c7af..b80d55bd 100644 --- a/rootly_sdk/models/jsonapi_included_resource_attributes.py +++ b/rootly_sdk/models/jsonapi_included_resource_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,7 +14,6 @@ class JsonapiIncludedResourceAttributes: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) diff --git a/rootly_sdk/models/jsonapi_included_resource_relationships.py b/rootly_sdk/models/jsonapi_included_resource_relationships.py index 2ed1ed48..5d006566 100644 --- a/rootly_sdk/models/jsonapi_included_resource_relationships.py +++ b/rootly_sdk/models/jsonapi_included_resource_relationships.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,7 +14,6 @@ class JsonapiIncludedResourceRelationships: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) diff --git a/rootly_sdk/models/links.py b/rootly_sdk/models/links.py index 48bcff63..75915bf1 100644 --- a/rootly_sdk/models/links.py +++ b/rootly_sdk/models/links.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,16 +13,16 @@ class Links: Attributes: self_ (str): first (str): - prev (None | str): - next_ (None | str): - last (None | str): + prev (Union[None, str]): + next_ (Union[None, str]): + last (Union[None, str]): """ self_: str first: str - prev: None | str - next_: None | str - last: None | str + prev: Union[None, str] + next_: Union[None, str] + last: Union[None, str] additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -32,13 +30,13 @@ def to_dict(self) -> dict[str, Any]: first = self.first - prev: None | str + prev: Union[None, str] prev = self.prev - next_: None | str + next_: Union[None, str] next_ = self.next_ - last: None | str + last: Union[None, str] last = self.last field_dict: dict[str, Any] = {} @@ -62,24 +60,24 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: first = d.pop("first") - def _parse_prev(data: object) -> None | str: + def _parse_prev(data: object) -> Union[None, str]: if data is None: return data - return cast(None | str, data) + return cast(Union[None, str], data) prev = _parse_prev(d.pop("prev")) - def _parse_next_(data: object) -> None | str: + def _parse_next_(data: object) -> Union[None, str]: if data is None: return data - return cast(None | str, data) + return cast(Union[None, str], data) next_ = _parse_next_(d.pop("next")) - def _parse_last(data: object) -> None | str: + def _parse_last(data: object) -> Union[None, str]: if data is None: return data - return cast(None | str, data) + return cast(Union[None, str], data) last = _parse_last(d.pop("last")) diff --git a/rootly_sdk/models/list_alert_events_feed_filteraction.py b/rootly_sdk/models/list_alert_events_feed_filteraction.py index 3fdfb294..229f0c20 100644 --- a/rootly_sdk/models/list_alert_events_feed_filteraction.py +++ b/rootly_sdk/models/list_alert_events_feed_filteraction.py @@ -1,12 +1,14 @@ from typing import Literal, cast ListAlertEventsFeedFilteraction = Literal[ + "ack_timeout_retriggered", "acknowledged", "added", "answered", "attached", "call_lifecycle", "called", + "cleared", "created", "deferred", "emailed", @@ -25,6 +27,7 @@ "paged", "removed", "resolved", + "retrigger_suppressed", "retriggered", "skipped", "slacked", @@ -35,12 +38,14 @@ ] LIST_ALERT_EVENTS_FEED_FILTERACTION_VALUES: set[ListAlertEventsFeedFilteraction] = { + "ack_timeout_retriggered", "acknowledged", "added", "answered", "attached", "call_lifecycle", "called", + "cleared", "created", "deferred", "emailed", @@ -59,6 +64,7 @@ "paged", "removed", "resolved", + "retrigger_suppressed", "retriggered", "skipped", "slacked", diff --git a/rootly_sdk/models/live_call_router.py b/rootly_sdk/models/live_call_router.py index 199b49a8..affdc705 100644 --- a/rootly_sdk/models/live_call_router.py +++ b/rootly_sdk/models/live_call_router.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -30,80 +28,83 @@ class LiveCallRouter: name (str): The name of the live_call_router created_at (str): Date of creation updated_at (str): Date of last update - kind (LiveCallRouterKind | Unset): The kind of the live_call_router - enabled (bool | Unset): Whether the live_call_router is enabled - country_code (LiveCallRouterCountryCode | Unset): The country code of the live_call_router - phone_type (LiveCallRouterPhoneType | Unset): The phone type of the live_call_router - phone_number (str | Unset): You can select a phone number using + kind (Union[Unset, LiveCallRouterKind]): The kind of the live_call_router + enabled (Union[Unset, bool]): Whether the live_call_router is enabled + country_code (Union[Unset, LiveCallRouterCountryCode]): The country code of the live_call_router + phone_type (Union[Unset, LiveCallRouterPhoneType]): The phone type of the live_call_router + phone_number (Union[Unset, str]): You can select a phone number using [generate_phone_number](#//api/v1/live_call_routers/generate_phone_number) API and pass that phone number here to register - voicemail_greeting (str | Unset): The voicemail greeting of the live_call_router - caller_greeting (str | Unset): The caller greeting message of the live_call_router - unavailable_responder_message (None | str | Unset): The message played to the caller when a responder doesn't - answer and the call moves on to the next person in the escalation. Leave blank to use the default message. - waiting_music_url (LiveCallRouterWaitingMusicUrl | Unset): The waiting music URL of the live_call_router - sent_to_voicemail_delay (int | Unset): The delay (seconds) after which the caller in redirected to voicemail - should_redirect_to_voicemail_on_no_answer (bool | Unset): This prompts the caller to choose voicemail or connect - live - escalation_level_delay_in_seconds (int | Unset): This overrides the delay (seconds) in escalation levels - should_auto_resolve_alert_on_call_end (bool | Unset): This overrides the delay (seconds) in escalation levels - notify_via_sms (bool | Unset): Whether responders are also notified via SMS when this router pages them - notify_via_push_notification (bool | Unset): Whether responders are also notified via push notification when - this router pages them - informational_notification_message (None | str | Unset): Optional message included in the SMS/push notification. - Supports variables such as {{ alert.url }}, {{ alert.data.* }}, and {{ alert.alert_urgency.name }}. - alert_urgency_id (str | Unset): This is used in escalation paths to determine who to page - calling_tree_prompt (str | Unset): The audio instructions callers will hear when they call this number, + voicemail_greeting (Union[Unset, str]): The voicemail greeting of the live_call_router + caller_greeting (Union[Unset, str]): The caller greeting message of the live_call_router + unavailable_responder_message (Union[None, Unset, str]): The message played to the caller when a responder + doesn't answer and the call moves on to the next person in the escalation. Leave blank to use the default + message. + waiting_music_url (Union[Unset, LiveCallRouterWaitingMusicUrl]): The waiting music URL of the live_call_router + sent_to_voicemail_delay (Union[Unset, int]): The delay (seconds) after which the caller in redirected to + voicemail + should_redirect_to_voicemail_on_no_answer (Union[Unset, bool]): This prompts the caller to choose voicemail or + connect live + escalation_level_delay_in_seconds (Union[Unset, int]): This overrides the delay (seconds) in escalation levels + should_auto_resolve_alert_on_call_end (Union[Unset, bool]): This overrides the delay (seconds) in escalation + levels + notify_via_sms (Union[Unset, bool]): Whether responders are also notified via SMS when this router pages them + notify_via_push_notification (Union[Unset, bool]): Whether responders are also notified via push notification + when this router pages them + informational_notification_message (Union[None, Unset, str]): Optional message included in the SMS/push + notification. Supports variables such as {{ alert.url }}, {{ alert.data.* }}, and {{ alert.alert_urgency.name + }}. + alert_urgency_id (Union[Unset, str]): This is used in escalation paths to determine who to page + calling_tree_prompt (Union[Unset, str]): The audio instructions callers will hear when they call this number, prompting them to select from available options to route their call - paging_targets (list[LiveCallRouterPagingTargetsItem] | Unset): Paging targets that callers can select from when - this live call router is configured as a phone tree. - escalation_policy_trigger_params (LiveCallRouterEscalationPolicyTriggerParams | Unset): + paging_targets (Union[Unset, list['LiveCallRouterPagingTargetsItem']]): Paging targets that callers can select + from when this live call router is configured as a phone tree. + escalation_policy_trigger_params (Union[Unset, LiveCallRouterEscalationPolicyTriggerParams]): """ name: str created_at: str updated_at: str - kind: LiveCallRouterKind | Unset = UNSET - enabled: bool | Unset = UNSET - country_code: LiveCallRouterCountryCode | Unset = UNSET - phone_type: LiveCallRouterPhoneType | Unset = UNSET - phone_number: str | Unset = UNSET - voicemail_greeting: str | Unset = UNSET - caller_greeting: str | Unset = UNSET - unavailable_responder_message: None | str | Unset = UNSET - waiting_music_url: LiveCallRouterWaitingMusicUrl | Unset = UNSET - sent_to_voicemail_delay: int | Unset = UNSET - should_redirect_to_voicemail_on_no_answer: bool | Unset = UNSET - escalation_level_delay_in_seconds: int | Unset = UNSET - should_auto_resolve_alert_on_call_end: bool | Unset = UNSET - notify_via_sms: bool | Unset = UNSET - notify_via_push_notification: bool | Unset = UNSET - informational_notification_message: None | str | Unset = UNSET - alert_urgency_id: str | Unset = UNSET - calling_tree_prompt: str | Unset = UNSET - paging_targets: list[LiveCallRouterPagingTargetsItem] | Unset = UNSET - escalation_policy_trigger_params: LiveCallRouterEscalationPolicyTriggerParams | Unset = UNSET + kind: Union[Unset, LiveCallRouterKind] = UNSET + enabled: Union[Unset, bool] = UNSET + country_code: Union[Unset, LiveCallRouterCountryCode] = UNSET + phone_type: Union[Unset, LiveCallRouterPhoneType] = UNSET + phone_number: Union[Unset, str] = UNSET + voicemail_greeting: Union[Unset, str] = UNSET + caller_greeting: Union[Unset, str] = UNSET + unavailable_responder_message: Union[None, Unset, str] = UNSET + waiting_music_url: Union[Unset, LiveCallRouterWaitingMusicUrl] = UNSET + sent_to_voicemail_delay: Union[Unset, int] = UNSET + should_redirect_to_voicemail_on_no_answer: Union[Unset, bool] = UNSET + escalation_level_delay_in_seconds: Union[Unset, int] = UNSET + should_auto_resolve_alert_on_call_end: Union[Unset, bool] = UNSET + notify_via_sms: Union[Unset, bool] = UNSET + notify_via_push_notification: Union[Unset, bool] = UNSET + informational_notification_message: Union[None, Unset, str] = UNSET + alert_urgency_id: Union[Unset, str] = UNSET + calling_tree_prompt: Union[Unset, str] = UNSET + paging_targets: Union[Unset, list["LiveCallRouterPagingTargetsItem"]] = UNSET + escalation_policy_trigger_params: Union[Unset, "LiveCallRouterEscalationPolicyTriggerParams"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - name = self.name created_at = self.created_at updated_at = self.updated_at - kind: str | Unset = UNSET + kind: Union[Unset, str] = UNSET if not isinstance(self.kind, Unset): kind = self.kind enabled = self.enabled - country_code: str | Unset = UNSET + country_code: Union[Unset, str] = UNSET if not isinstance(self.country_code, Unset): country_code = self.country_code - phone_type: str | Unset = UNSET + phone_type: Union[Unset, str] = UNSET if not isinstance(self.phone_type, Unset): phone_type = self.phone_type @@ -113,13 +114,13 @@ def to_dict(self) -> dict[str, Any]: caller_greeting = self.caller_greeting - unavailable_responder_message: None | str | Unset + unavailable_responder_message: Union[None, Unset, str] if isinstance(self.unavailable_responder_message, Unset): unavailable_responder_message = UNSET else: unavailable_responder_message = self.unavailable_responder_message - waiting_music_url: str | Unset = UNSET + waiting_music_url: Union[Unset, str] = UNSET if not isinstance(self.waiting_music_url, Unset): waiting_music_url = self.waiting_music_url @@ -135,7 +136,7 @@ def to_dict(self) -> dict[str, Any]: notify_via_push_notification = self.notify_via_push_notification - informational_notification_message: None | str | Unset + informational_notification_message: Union[None, Unset, str] if isinstance(self.informational_notification_message, Unset): informational_notification_message = UNSET else: @@ -145,14 +146,14 @@ def to_dict(self) -> dict[str, Any]: calling_tree_prompt = self.calling_tree_prompt - paging_targets: list[dict[str, Any]] | Unset = UNSET + paging_targets: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.paging_targets, Unset): paging_targets = [] for paging_targets_item_data in self.paging_targets: paging_targets_item = paging_targets_item_data.to_dict() paging_targets.append(paging_targets_item) - escalation_policy_trigger_params: dict[str, Any] | Unset = UNSET + escalation_policy_trigger_params: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.escalation_policy_trigger_params, Unset): escalation_policy_trigger_params = self.escalation_policy_trigger_params.to_dict() @@ -223,7 +224,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: updated_at = d.pop("updated_at") _kind = d.pop("kind", UNSET) - kind: LiveCallRouterKind | Unset + kind: Union[Unset, LiveCallRouterKind] if isinstance(_kind, Unset): kind = UNSET else: @@ -232,14 +233,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: enabled = d.pop("enabled", UNSET) _country_code = d.pop("country_code", UNSET) - country_code: LiveCallRouterCountryCode | Unset + country_code: Union[Unset, LiveCallRouterCountryCode] if isinstance(_country_code, Unset): country_code = UNSET else: country_code = check_live_call_router_country_code(_country_code) _phone_type = d.pop("phone_type", UNSET) - phone_type: LiveCallRouterPhoneType | Unset + phone_type: Union[Unset, LiveCallRouterPhoneType] if isinstance(_phone_type, Unset): phone_type = UNSET else: @@ -251,19 +252,19 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: caller_greeting = d.pop("caller_greeting", UNSET) - def _parse_unavailable_responder_message(data: object) -> None | str | Unset: + def _parse_unavailable_responder_message(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) unavailable_responder_message = _parse_unavailable_responder_message( d.pop("unavailable_responder_message", UNSET) ) _waiting_music_url = d.pop("waiting_music_url", UNSET) - waiting_music_url: LiveCallRouterWaitingMusicUrl | Unset + waiting_music_url: Union[Unset, LiveCallRouterWaitingMusicUrl] if isinstance(_waiting_music_url, Unset): waiting_music_url = UNSET else: @@ -281,12 +282,12 @@ def _parse_unavailable_responder_message(data: object) -> None | str | Unset: notify_via_push_notification = d.pop("notify_via_push_notification", UNSET) - def _parse_informational_notification_message(data: object) -> None | str | Unset: + def _parse_informational_notification_message(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) informational_notification_message = _parse_informational_notification_message( d.pop("informational_notification_message", UNSET) @@ -296,17 +297,15 @@ def _parse_informational_notification_message(data: object) -> None | str | Unse calling_tree_prompt = d.pop("calling_tree_prompt", UNSET) + paging_targets = [] _paging_targets = d.pop("paging_targets", UNSET) - paging_targets: list[LiveCallRouterPagingTargetsItem] | Unset = UNSET - if _paging_targets is not UNSET: - paging_targets = [] - for paging_targets_item_data in _paging_targets: - paging_targets_item = LiveCallRouterPagingTargetsItem.from_dict(paging_targets_item_data) + for paging_targets_item_data in _paging_targets or []: + paging_targets_item = LiveCallRouterPagingTargetsItem.from_dict(paging_targets_item_data) - paging_targets.append(paging_targets_item) + paging_targets.append(paging_targets_item) _escalation_policy_trigger_params = d.pop("escalation_policy_trigger_params", UNSET) - escalation_policy_trigger_params: LiveCallRouterEscalationPolicyTriggerParams | Unset + escalation_policy_trigger_params: Union[Unset, LiveCallRouterEscalationPolicyTriggerParams] if isinstance(_escalation_policy_trigger_params, Unset): escalation_policy_trigger_params = UNSET else: diff --git a/rootly_sdk/models/live_call_router_escalation_policy_trigger_params.py b/rootly_sdk/models/live_call_router_escalation_policy_trigger_params.py index 4963b65f..7f74f656 100644 --- a/rootly_sdk/models/live_call_router_escalation_policy_trigger_params.py +++ b/rootly_sdk/models/live_call_router_escalation_policy_trigger_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/live_call_router_list.py b/rootly_sdk/models/live_call_router_list.py index 885ce198..02c7cbff 100644 --- a/rootly_sdk/models/live_call_router_list.py +++ b/rootly_sdk/models/live_call_router_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,20 +20,19 @@ class LiveCallRouterList: """ Attributes: - data (list[LiveCallRouterListDataItem]): + data (list['LiveCallRouterListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[LiveCallRouterListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["LiveCallRouterListDataItem"] + links: "Links" + meta: "Meta" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) live_call_router_list = cls( data=data, diff --git a/rootly_sdk/models/live_call_router_list_data_item.py b/rootly_sdk/models/live_call_router_list_data_item.py index e68c449c..cc64df7e 100644 --- a/rootly_sdk/models/live_call_router_list_data_item.py +++ b/rootly_sdk/models/live_call_router_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class LiveCallRouterListDataItem: id: str type_: LiveCallRouterListDataItemType - attributes: LiveCallRouter + attributes: "LiveCallRouter" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/live_call_router_paging_targets_item.py b/rootly_sdk/models/live_call_router_paging_targets_item.py index 33e6941c..9fdc04a4 100644 --- a/rootly_sdk/models/live_call_router_paging_targets_item.py +++ b/rootly_sdk/models/live_call_router_paging_targets_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/live_call_router_response.py b/rootly_sdk/models/live_call_router_response.py index e00de14c..e4063db1 100644 --- a/rootly_sdk/models/live_call_router_response.py +++ b/rootly_sdk/models/live_call_router_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,18 +19,17 @@ class LiveCallRouterResponse: """ Attributes: data (LiveCallRouterResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: LiveCallRouterResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "LiveCallRouterResponseData" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = LiveCallRouterResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) live_call_router_response = cls( data=data, diff --git a/rootly_sdk/models/live_call_router_response_data.py b/rootly_sdk/models/live_call_router_response_data.py index 135ae335..6f15f45b 100644 --- a/rootly_sdk/models/live_call_router_response_data.py +++ b/rootly_sdk/models/live_call_router_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class LiveCallRouterResponseData: id: str type_: LiveCallRouterResponseDataType - attributes: LiveCallRouter + attributes: "LiveCallRouter" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/meeting_recording.py b/rootly_sdk/models/meeting_recording.py index 8591364b..829dd35c 100644 --- a/rootly_sdk/models/meeting_recording.py +++ b/rootly_sdk/models/meeting_recording.py @@ -1,8 +1,6 @@ -from __future__ import annotations - import datetime from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -25,17 +23,17 @@ class MeetingRecording: status (MeetingRecordingStatus): Current recording lifecycle status created_at (datetime.datetime): When the recording session was created updated_at (datetime.datetime): When the recording session was last updated - started_at (datetime.datetime | None | Unset): When the bot started recording (null if bot never joined) - ended_at (datetime.datetime | None | Unset): When the recording ended - duration_minutes (float | None | Unset): Recording duration in minutes (null if not started) - speaker_count (int | Unset): Number of unique speakers detected in the transcript - word_count (int | Unset): Total word count across all transcript segments - transcript_summary (None | str | Unset): AI-generated summary of the meeting transcript (null if no transcript - or not yet analyzed) - title (None | str | Unset): Human-readable label for the recording session - meeting_url (None | str | Unset): Original meeting URL - video_url (None | str | Unset): Signed URL to stream/download the video recording - created_by (None | str | Unset): Source that created the recording (e.g. desktop_sdk, recall_bot) + started_at (Union[None, Unset, datetime.datetime]): When the bot started recording (null if bot never joined) + ended_at (Union[None, Unset, datetime.datetime]): When the recording ended + duration_minutes (Union[None, Unset, float]): Recording duration in minutes (null if not started) + speaker_count (Union[Unset, int]): Number of unique speakers detected in the transcript + word_count (Union[Unset, int]): Total word count across all transcript segments + transcript_summary (Union[None, Unset, str]): AI-generated summary of the meeting transcript (null if no + transcript or not yet analyzed) + title (Union[None, Unset, str]): Human-readable label for the recording session + meeting_url (Union[None, Unset, str]): Original meeting URL + video_url (Union[None, Unset, str]): Signed URL to stream/download the video recording + created_by (Union[None, Unset, str]): Source that created the recording (e.g. desktop_sdk, recall_bot) """ platform: MeetingRecordingPlatform @@ -43,16 +41,16 @@ class MeetingRecording: status: MeetingRecordingStatus created_at: datetime.datetime updated_at: datetime.datetime - started_at: datetime.datetime | None | Unset = UNSET - ended_at: datetime.datetime | None | Unset = UNSET - duration_minutes: float | None | Unset = UNSET - speaker_count: int | Unset = UNSET - word_count: int | Unset = UNSET - transcript_summary: None | str | Unset = UNSET - title: None | str | Unset = UNSET - meeting_url: None | str | Unset = UNSET - video_url: None | str | Unset = UNSET - created_by: None | str | Unset = UNSET + started_at: Union[None, Unset, datetime.datetime] = UNSET + ended_at: Union[None, Unset, datetime.datetime] = UNSET + duration_minutes: Union[None, Unset, float] = UNSET + speaker_count: Union[Unset, int] = UNSET + word_count: Union[Unset, int] = UNSET + transcript_summary: Union[None, Unset, str] = UNSET + title: Union[None, Unset, str] = UNSET + meeting_url: Union[None, Unset, str] = UNSET + video_url: Union[None, Unset, str] = UNSET + created_by: Union[None, Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -66,7 +64,7 @@ def to_dict(self) -> dict[str, Any]: updated_at = self.updated_at.isoformat() - started_at: None | str | Unset + started_at: Union[None, Unset, str] if isinstance(self.started_at, Unset): started_at = UNSET elif isinstance(self.started_at, datetime.datetime): @@ -74,7 +72,7 @@ def to_dict(self) -> dict[str, Any]: else: started_at = self.started_at - ended_at: None | str | Unset + ended_at: Union[None, Unset, str] if isinstance(self.ended_at, Unset): ended_at = UNSET elif isinstance(self.ended_at, datetime.datetime): @@ -82,7 +80,7 @@ def to_dict(self) -> dict[str, Any]: else: ended_at = self.ended_at - duration_minutes: float | None | Unset + duration_minutes: Union[None, Unset, float] if isinstance(self.duration_minutes, Unset): duration_minutes = UNSET else: @@ -92,31 +90,31 @@ def to_dict(self) -> dict[str, Any]: word_count = self.word_count - transcript_summary: None | str | Unset + transcript_summary: Union[None, Unset, str] if isinstance(self.transcript_summary, Unset): transcript_summary = UNSET else: transcript_summary = self.transcript_summary - title: None | str | Unset + title: Union[None, Unset, str] if isinstance(self.title, Unset): title = UNSET else: title = self.title - meeting_url: None | str | Unset + meeting_url: Union[None, Unset, str] if isinstance(self.meeting_url, Unset): meeting_url = UNSET else: meeting_url = self.meeting_url - video_url: None | str | Unset + video_url: Union[None, Unset, str] if isinstance(self.video_url, Unset): video_url = UNSET else: video_url = self.video_url - created_by: None | str | Unset + created_by: Union[None, Unset, str] if isinstance(self.created_by, Unset): created_by = UNSET else: @@ -169,7 +167,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: updated_at = isoparse(d.pop("updated_at")) - def _parse_started_at(data: object) -> datetime.datetime | None | Unset: + def _parse_started_at(data: object) -> Union[None, Unset, datetime.datetime]: if data is None: return data if isinstance(data, Unset): @@ -180,13 +178,13 @@ def _parse_started_at(data: object) -> datetime.datetime | None | Unset: started_at_type_0 = isoparse(data) return started_at_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(datetime.datetime | None | Unset, data) + return cast(Union[None, Unset, datetime.datetime], data) started_at = _parse_started_at(d.pop("started_at", UNSET)) - def _parse_ended_at(data: object) -> datetime.datetime | None | Unset: + def _parse_ended_at(data: object) -> Union[None, Unset, datetime.datetime]: if data is None: return data if isinstance(data, Unset): @@ -197,18 +195,18 @@ def _parse_ended_at(data: object) -> datetime.datetime | None | Unset: ended_at_type_0 = isoparse(data) return ended_at_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(datetime.datetime | None | Unset, data) + return cast(Union[None, Unset, datetime.datetime], data) ended_at = _parse_ended_at(d.pop("ended_at", UNSET)) - def _parse_duration_minutes(data: object) -> float | None | Unset: + def _parse_duration_minutes(data: object) -> Union[None, Unset, float]: if data is None: return data if isinstance(data, Unset): return data - return cast(float | None | Unset, data) + return cast(Union[None, Unset, float], data) duration_minutes = _parse_duration_minutes(d.pop("duration_minutes", UNSET)) @@ -216,48 +214,48 @@ def _parse_duration_minutes(data: object) -> float | None | Unset: word_count = d.pop("word_count", UNSET) - def _parse_transcript_summary(data: object) -> None | str | Unset: + def _parse_transcript_summary(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) transcript_summary = _parse_transcript_summary(d.pop("transcript_summary", UNSET)) - def _parse_title(data: object) -> None | str | Unset: + def _parse_title(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) title = _parse_title(d.pop("title", UNSET)) - def _parse_meeting_url(data: object) -> None | str | Unset: + def _parse_meeting_url(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) meeting_url = _parse_meeting_url(d.pop("meeting_url", UNSET)) - def _parse_video_url(data: object) -> None | str | Unset: + def _parse_video_url(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) video_url = _parse_video_url(d.pop("video_url", UNSET)) - def _parse_created_by(data: object) -> None | str | Unset: + def _parse_created_by(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) created_by = _parse_created_by(d.pop("created_by", UNSET)) diff --git a/rootly_sdk/models/meeting_recording_detail.py b/rootly_sdk/models/meeting_recording_detail.py index b736f728..4e6145fb 100644 --- a/rootly_sdk/models/meeting_recording_detail.py +++ b/rootly_sdk/models/meeting_recording_detail.py @@ -1,8 +1,6 @@ -from __future__ import annotations - import datetime from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -30,22 +28,22 @@ class MeetingRecordingDetail: status (MeetingRecordingStatus): Current recording lifecycle status created_at (datetime.datetime): When the recording session was created updated_at (datetime.datetime): When the recording session was last updated - started_at (datetime.datetime | None | Unset): When the bot started recording (null if bot never joined) - ended_at (datetime.datetime | None | Unset): When the recording ended - duration_minutes (float | None | Unset): Recording duration in minutes (null if not started) - speaker_count (int | Unset): Number of unique speakers detected in the transcript - word_count (int | Unset): Total word count across all transcript segments - transcript_summary (None | str | Unset): AI-generated summary of the meeting transcript (null if no transcript - or not yet analyzed) - title (None | str | Unset): Human-readable label for the recording session - meeting_url (None | str | Unset): Original meeting URL - video_url (None | str | Unset): Signed URL to stream/download the video recording - created_by (None | str | Unset): Source that created the recording (e.g. desktop_sdk, recall_bot) - transcript (list[MeetingRecordingTranscriptSegment] | MeetingRecordingDetailTranscriptType1 | Unset): Array of - speaker segments when populated, empty object when no transcript exists. - recall_upload_id (None | str | Unset): Recall upload identifier - recordable_id (None | str | Unset): UUID of the associated recordable (e.g. incident) - recordable_type (None | str | Unset): Type of the associated recordable (e.g. Incident) + started_at (Union[None, Unset, datetime.datetime]): When the bot started recording (null if bot never joined) + ended_at (Union[None, Unset, datetime.datetime]): When the recording ended + duration_minutes (Union[None, Unset, float]): Recording duration in minutes (null if not started) + speaker_count (Union[Unset, int]): Number of unique speakers detected in the transcript + word_count (Union[Unset, int]): Total word count across all transcript segments + transcript_summary (Union[None, Unset, str]): AI-generated summary of the meeting transcript (null if no + transcript or not yet analyzed) + title (Union[None, Unset, str]): Human-readable label for the recording session + meeting_url (Union[None, Unset, str]): Original meeting URL + video_url (Union[None, Unset, str]): Signed URL to stream/download the video recording + created_by (Union[None, Unset, str]): Source that created the recording (e.g. desktop_sdk, recall_bot) + transcript (Union['MeetingRecordingDetailTranscriptType1', Unset, list['MeetingRecordingTranscriptSegment']]): + Array of speaker segments when populated, empty object when no transcript exists. + recall_upload_id (Union[None, Unset, str]): Recall upload identifier + recordable_id (Union[None, Unset, str]): UUID of the associated recordable (e.g. incident) + recordable_type (Union[None, Unset, str]): Type of the associated recordable (e.g. Incident) """ platform: MeetingRecordingPlatform @@ -53,24 +51,23 @@ class MeetingRecordingDetail: status: MeetingRecordingStatus created_at: datetime.datetime updated_at: datetime.datetime - started_at: datetime.datetime | None | Unset = UNSET - ended_at: datetime.datetime | None | Unset = UNSET - duration_minutes: float | None | Unset = UNSET - speaker_count: int | Unset = UNSET - word_count: int | Unset = UNSET - transcript_summary: None | str | Unset = UNSET - title: None | str | Unset = UNSET - meeting_url: None | str | Unset = UNSET - video_url: None | str | Unset = UNSET - created_by: None | str | Unset = UNSET - transcript: list[MeetingRecordingTranscriptSegment] | MeetingRecordingDetailTranscriptType1 | Unset = UNSET - recall_upload_id: None | str | Unset = UNSET - recordable_id: None | str | Unset = UNSET - recordable_type: None | str | Unset = UNSET + started_at: Union[None, Unset, datetime.datetime] = UNSET + ended_at: Union[None, Unset, datetime.datetime] = UNSET + duration_minutes: Union[None, Unset, float] = UNSET + speaker_count: Union[Unset, int] = UNSET + word_count: Union[Unset, int] = UNSET + transcript_summary: Union[None, Unset, str] = UNSET + title: Union[None, Unset, str] = UNSET + meeting_url: Union[None, Unset, str] = UNSET + video_url: Union[None, Unset, str] = UNSET + created_by: Union[None, Unset, str] = UNSET + transcript: Union["MeetingRecordingDetailTranscriptType1", Unset, list["MeetingRecordingTranscriptSegment"]] = UNSET + recall_upload_id: Union[None, Unset, str] = UNSET + recordable_id: Union[None, Unset, str] = UNSET + recordable_type: Union[None, Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - platform: str = self.platform session_number = self.session_number @@ -81,7 +78,7 @@ def to_dict(self) -> dict[str, Any]: updated_at = self.updated_at.isoformat() - started_at: None | str | Unset + started_at: Union[None, Unset, str] if isinstance(self.started_at, Unset): started_at = UNSET elif isinstance(self.started_at, datetime.datetime): @@ -89,7 +86,7 @@ def to_dict(self) -> dict[str, Any]: else: started_at = self.started_at - ended_at: None | str | Unset + ended_at: Union[None, Unset, str] if isinstance(self.ended_at, Unset): ended_at = UNSET elif isinstance(self.ended_at, datetime.datetime): @@ -97,7 +94,7 @@ def to_dict(self) -> dict[str, Any]: else: ended_at = self.ended_at - duration_minutes: float | None | Unset + duration_minutes: Union[None, Unset, float] if isinstance(self.duration_minutes, Unset): duration_minutes = UNSET else: @@ -107,37 +104,37 @@ def to_dict(self) -> dict[str, Any]: word_count = self.word_count - transcript_summary: None | str | Unset + transcript_summary: Union[None, Unset, str] if isinstance(self.transcript_summary, Unset): transcript_summary = UNSET else: transcript_summary = self.transcript_summary - title: None | str | Unset + title: Union[None, Unset, str] if isinstance(self.title, Unset): title = UNSET else: title = self.title - meeting_url: None | str | Unset + meeting_url: Union[None, Unset, str] if isinstance(self.meeting_url, Unset): meeting_url = UNSET else: meeting_url = self.meeting_url - video_url: None | str | Unset + video_url: Union[None, Unset, str] if isinstance(self.video_url, Unset): video_url = UNSET else: video_url = self.video_url - created_by: None | str | Unset + created_by: Union[None, Unset, str] if isinstance(self.created_by, Unset): created_by = UNSET else: created_by = self.created_by - transcript: dict[str, Any] | list[dict[str, Any]] | Unset + transcript: Union[Unset, dict[str, Any], list[dict[str, Any]]] if isinstance(self.transcript, Unset): transcript = UNSET elif isinstance(self.transcript, list): @@ -149,19 +146,19 @@ def to_dict(self) -> dict[str, Any]: else: transcript = self.transcript.to_dict() - recall_upload_id: None | str | Unset + recall_upload_id: Union[None, Unset, str] if isinstance(self.recall_upload_id, Unset): recall_upload_id = UNSET else: recall_upload_id = self.recall_upload_id - recordable_id: None | str | Unset + recordable_id: Union[None, Unset, str] if isinstance(self.recordable_id, Unset): recordable_id = UNSET else: recordable_id = self.recordable_id - recordable_type: None | str | Unset + recordable_type: Union[None, Unset, str] if isinstance(self.recordable_type, Unset): recordable_type = UNSET else: @@ -225,7 +222,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: updated_at = isoparse(d.pop("updated_at")) - def _parse_started_at(data: object) -> datetime.datetime | None | Unset: + def _parse_started_at(data: object) -> Union[None, Unset, datetime.datetime]: if data is None: return data if isinstance(data, Unset): @@ -236,13 +233,13 @@ def _parse_started_at(data: object) -> datetime.datetime | None | Unset: started_at_type_0 = isoparse(data) return started_at_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(datetime.datetime | None | Unset, data) + return cast(Union[None, Unset, datetime.datetime], data) started_at = _parse_started_at(d.pop("started_at", UNSET)) - def _parse_ended_at(data: object) -> datetime.datetime | None | Unset: + def _parse_ended_at(data: object) -> Union[None, Unset, datetime.datetime]: if data is None: return data if isinstance(data, Unset): @@ -253,18 +250,18 @@ def _parse_ended_at(data: object) -> datetime.datetime | None | Unset: ended_at_type_0 = isoparse(data) return ended_at_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(datetime.datetime | None | Unset, data) + return cast(Union[None, Unset, datetime.datetime], data) ended_at = _parse_ended_at(d.pop("ended_at", UNSET)) - def _parse_duration_minutes(data: object) -> float | None | Unset: + def _parse_duration_minutes(data: object) -> Union[None, Unset, float]: if data is None: return data if isinstance(data, Unset): return data - return cast(float | None | Unset, data) + return cast(Union[None, Unset, float], data) duration_minutes = _parse_duration_minutes(d.pop("duration_minutes", UNSET)) @@ -272,54 +269,54 @@ def _parse_duration_minutes(data: object) -> float | None | Unset: word_count = d.pop("word_count", UNSET) - def _parse_transcript_summary(data: object) -> None | str | Unset: + def _parse_transcript_summary(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) transcript_summary = _parse_transcript_summary(d.pop("transcript_summary", UNSET)) - def _parse_title(data: object) -> None | str | Unset: + def _parse_title(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) title = _parse_title(d.pop("title", UNSET)) - def _parse_meeting_url(data: object) -> None | str | Unset: + def _parse_meeting_url(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) meeting_url = _parse_meeting_url(d.pop("meeting_url", UNSET)) - def _parse_video_url(data: object) -> None | str | Unset: + def _parse_video_url(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) video_url = _parse_video_url(d.pop("video_url", UNSET)) - def _parse_created_by(data: object) -> None | str | Unset: + def _parse_created_by(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) created_by = _parse_created_by(d.pop("created_by", UNSET)) def _parse_transcript( data: object, - ) -> list[MeetingRecordingTranscriptSegment] | MeetingRecordingDetailTranscriptType1 | Unset: + ) -> Union["MeetingRecordingDetailTranscriptType1", Unset, list["MeetingRecordingTranscriptSegment"]]: if isinstance(data, Unset): return data try: @@ -333,7 +330,7 @@ def _parse_transcript( transcript_type_0.append(transcript_type_0_item) return transcript_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass if not isinstance(data, dict): raise TypeError() @@ -343,30 +340,30 @@ def _parse_transcript( transcript = _parse_transcript(d.pop("transcript", UNSET)) - def _parse_recall_upload_id(data: object) -> None | str | Unset: + def _parse_recall_upload_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) recall_upload_id = _parse_recall_upload_id(d.pop("recall_upload_id", UNSET)) - def _parse_recordable_id(data: object) -> None | str | Unset: + def _parse_recordable_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) recordable_id = _parse_recordable_id(d.pop("recordable_id", UNSET)) - def _parse_recordable_type(data: object) -> None | str | Unset: + def _parse_recordable_type(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) recordable_type = _parse_recordable_type(d.pop("recordable_type", UNSET)) diff --git a/rootly_sdk/models/meeting_recording_detail_response.py b/rootly_sdk/models/meeting_recording_detail_response.py index 2aad46f9..8a11371b 100644 --- a/rootly_sdk/models/meeting_recording_detail_response.py +++ b/rootly_sdk/models/meeting_recording_detail_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class MeetingRecordingDetailResponse: data (MeetingRecordingDetailResponseData): """ - data: MeetingRecordingDetailResponseData + data: "MeetingRecordingDetailResponseData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/meeting_recording_detail_response_data.py b/rootly_sdk/models/meeting_recording_detail_response_data.py index c50dcff8..6b46c0ed 100644 --- a/rootly_sdk/models/meeting_recording_detail_response_data.py +++ b/rootly_sdk/models/meeting_recording_detail_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class MeetingRecordingDetailResponseData: id: str type_: MeetingRecordingDetailResponseDataType - attributes: MeetingRecordingDetail + attributes: "MeetingRecordingDetail" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/meeting_recording_detail_transcript_type_1.py b/rootly_sdk/models/meeting_recording_detail_transcript_type_1.py index 6faa6679..b2cff2e2 100644 --- a/rootly_sdk/models/meeting_recording_detail_transcript_type_1.py +++ b/rootly_sdk/models/meeting_recording_detail_transcript_type_1.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,7 +14,6 @@ class MeetingRecordingDetailTranscriptType1: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) diff --git a/rootly_sdk/models/meeting_recording_list.py b/rootly_sdk/models/meeting_recording_list.py index f60139eb..5683c11c 100644 --- a/rootly_sdk/models/meeting_recording_list.py +++ b/rootly_sdk/models/meeting_recording_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -20,22 +18,21 @@ class MeetingRecordingList: """ Attributes: - data (list[MeetingRecordingListDataItem]): - meta (Meta | Unset): + data (list['MeetingRecordingListDataItem']): + meta (Union[Unset, Meta]): """ - data: list[MeetingRecordingListDataItem] - meta: Meta | Unset = UNSET + data: list["MeetingRecordingListDataItem"] + meta: Union[Unset, "Meta"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() data.append(data_item) - meta: dict[str, Any] | Unset = UNSET + meta: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.meta, Unset): meta = self.meta.to_dict() @@ -65,7 +62,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data.append(data_item) _meta = d.pop("meta", UNSET) - meta: Meta | Unset + meta: Union[Unset, Meta] if isinstance(_meta, Unset): meta = UNSET else: diff --git a/rootly_sdk/models/meeting_recording_list_data_item.py b/rootly_sdk/models/meeting_recording_list_data_item.py index be50f1e5..397d1c86 100644 --- a/rootly_sdk/models/meeting_recording_list_data_item.py +++ b/rootly_sdk/models/meeting_recording_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class MeetingRecordingListDataItem: id: str type_: MeetingRecordingListDataItemType - attributes: MeetingRecording + attributes: "MeetingRecording" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/meeting_recording_response.py b/rootly_sdk/models/meeting_recording_response.py index eac483c2..89bdf8f6 100644 --- a/rootly_sdk/models/meeting_recording_response.py +++ b/rootly_sdk/models/meeting_recording_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class MeetingRecordingResponse: data (MeetingRecordingResponseData): """ - data: MeetingRecordingResponseData + data: "MeetingRecordingResponseData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/meeting_recording_response_data.py b/rootly_sdk/models/meeting_recording_response_data.py index bcfe346c..85ba6a2b 100644 --- a/rootly_sdk/models/meeting_recording_response_data.py +++ b/rootly_sdk/models/meeting_recording_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class MeetingRecordingResponseData: id: str type_: MeetingRecordingResponseDataType - attributes: MeetingRecording + attributes: "MeetingRecording" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/meeting_recording_transcript_segment.py b/rootly_sdk/models/meeting_recording_transcript_segment.py index 7335c4f7..4d968cb3 100644 --- a/rootly_sdk/models/meeting_recording_transcript_segment.py +++ b/rootly_sdk/models/meeting_recording_transcript_segment.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -18,15 +16,14 @@ class MeetingRecordingTranscriptSegment: """ Attributes: speaker (str): Speaker label (e.g. Speaker 1) - words (list[MeetingRecordingTranscriptWord]): Timestamped words spoken by this speaker + words (list['MeetingRecordingTranscriptWord']): Timestamped words spoken by this speaker """ speaker: str - words: list[MeetingRecordingTranscriptWord] + words: list["MeetingRecordingTranscriptWord"] additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - speaker = self.speaker words = [] diff --git a/rootly_sdk/models/meeting_recording_transcript_word.py b/rootly_sdk/models/meeting_recording_transcript_word.py index 83d7b63f..14465cae 100644 --- a/rootly_sdk/models/meeting_recording_transcript_word.py +++ b/rootly_sdk/models/meeting_recording_transcript_word.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,13 +14,13 @@ class MeetingRecordingTranscriptWord: """ Attributes: text (str): Transcribed word - start_timestamp (float | Unset): Start time in seconds from recording start - end_timestamp (float | Unset): End time in seconds from recording start + start_timestamp (Union[Unset, float]): Start time in seconds from recording start + end_timestamp (Union[Unset, float]): End time in seconds from recording start """ text: str - start_timestamp: float | Unset = UNSET - end_timestamp: float | Unset = UNSET + start_timestamp: Union[Unset, float] = UNSET + end_timestamp: Union[Unset, float] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/meta.py b/rootly_sdk/models/meta.py index 5612bb1e..ea619323 100644 --- a/rootly_sdk/models/meta.py +++ b/rootly_sdk/models/meta.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,37 +13,37 @@ class Meta: """ Attributes: - current_page (int | None): - next_page (int | None): - prev_page (int | None): + current_page (Union[None, int]): + next_page (Union[None, int]): + prev_page (Union[None, int]): total_count (int): total_pages (int): - next_cursor (None | str | Unset): + next_cursor (Union[None, Unset, str]): """ - current_page: int | None - next_page: int | None - prev_page: int | None + current_page: Union[None, int] + next_page: Union[None, int] + prev_page: Union[None, int] total_count: int total_pages: int - next_cursor: None | str | Unset = UNSET + next_cursor: Union[None, Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - current_page: int | None + current_page: Union[None, int] current_page = self.current_page - next_page: int | None + next_page: Union[None, int] next_page = self.next_page - prev_page: int | None + prev_page: Union[None, int] prev_page = self.prev_page total_count = self.total_count total_pages = self.total_pages - next_cursor: None | str | Unset + next_cursor: Union[None, Unset, str] if isinstance(self.next_cursor, Unset): next_cursor = UNSET else: @@ -71,24 +69,24 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_current_page(data: object) -> int | None: + def _parse_current_page(data: object) -> Union[None, int]: if data is None: return data - return cast(int | None, data) + return cast(Union[None, int], data) current_page = _parse_current_page(d.pop("current_page")) - def _parse_next_page(data: object) -> int | None: + def _parse_next_page(data: object) -> Union[None, int]: if data is None: return data - return cast(int | None, data) + return cast(Union[None, int], data) next_page = _parse_next_page(d.pop("next_page")) - def _parse_prev_page(data: object) -> int | None: + def _parse_prev_page(data: object) -> Union[None, int]: if data is None: return data - return cast(int | None, data) + return cast(Union[None, int], data) prev_page = _parse_prev_page(d.pop("prev_page")) @@ -96,12 +94,12 @@ def _parse_prev_page(data: object) -> int | None: total_pages = d.pop("total_pages") - def _parse_next_cursor(data: object) -> None | str | Unset: + def _parse_next_cursor(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) next_cursor = _parse_next_cursor(d.pop("next_cursor", UNSET)) diff --git a/rootly_sdk/models/mitigate_incident.py b/rootly_sdk/models/mitigate_incident.py index fe1ec922..618e5265 100644 --- a/rootly_sdk/models/mitigate_incident.py +++ b/rootly_sdk/models/mitigate_incident.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class MitigateIncident: data (MitigateIncidentData): """ - data: MitigateIncidentData + data: "MitigateIncidentData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/mitigate_incident_data.py b/rootly_sdk/models/mitigate_incident_data.py index d2daeb4a..2ba8ea98 100644 --- a/rootly_sdk/models/mitigate_incident_data.py +++ b/rootly_sdk/models/mitigate_incident_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class MitigateIncidentData: """ type_: MitigateIncidentDataType - attributes: MitigateIncidentDataAttributes + attributes: "MitigateIncidentDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/mitigate_incident_data_attributes.py b/rootly_sdk/models/mitigate_incident_data_attributes.py index 58606b79..b70dceba 100644 --- a/rootly_sdk/models/mitigate_incident_data_attributes.py +++ b/rootly_sdk/models/mitigate_incident_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -14,13 +12,13 @@ class MitigateIncidentDataAttributes: """ Attributes: - mitigation_message (None | str | Unset): How was the incident mitigated? + mitigation_message (Union[None, Unset, str]): How was the incident mitigated? """ - mitigation_message: None | str | Unset = UNSET + mitigation_message: Union[None, Unset, str] = UNSET def to_dict(self) -> dict[str, Any]: - mitigation_message: None | str | Unset + mitigation_message: Union[None, Unset, str] if isinstance(self.mitigation_message, Unset): mitigation_message = UNSET else: @@ -38,12 +36,12 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_mitigation_message(data: object) -> None | str | Unset: + def _parse_mitigation_message(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) mitigation_message = _parse_mitigation_message(d.pop("mitigation_message", UNSET)) diff --git a/rootly_sdk/models/new_alert.py b/rootly_sdk/models/new_alert.py index 092db12d..234e2282 100644 --- a/rootly_sdk/models/new_alert.py +++ b/rootly_sdk/models/new_alert.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewAlert: data (NewAlertData): """ - data: NewAlertData + data: "NewAlertData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_alert_data.py b/rootly_sdk/models/new_alert_data.py index 64f89fa6..1c0d27b1 100644 --- a/rootly_sdk/models/new_alert_data.py +++ b/rootly_sdk/models/new_alert_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class NewAlertData: """ type_: NewAlertDataType - attributes: NewAlertDataAttributes + attributes: "NewAlertDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_alert_data_attributes.py b/rootly_sdk/models/new_alert_data_attributes.py index 31ed11b4..59543ee6 100644 --- a/rootly_sdk/models/new_alert_data_attributes.py +++ b/rootly_sdk/models/new_alert_data_attributes.py @@ -1,8 +1,6 @@ -from __future__ import annotations - import datetime from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from dateutil.parser import isoparse @@ -37,64 +35,66 @@ class NewAlertDataAttributes: """ Attributes: summary (str): The summary of the alert - noise (NewAlertDataAttributesNoise | Unset): Whether the alert is marked as noise - source (str | Unset): Deprecated. Accepted for backwards compatibility; new clients should omit. Defaults to - `api`. - status (NewAlertDataAttributesStatus | Unset): Only available for organizations with Rootly On-Call enabled. Can - be one of open, triggered. - description (None | str | Unset): The description of the alert - service_ids (list[str] | None | Unset): The Service IDs to attach to the alert. If your organization has On-Call - enabled and your notification target is a Service. This field will be automatically set for you. - group_ids (list[str] | None | Unset): The Group IDs to attach to the alert. If your organization has On-Call - enabled and your notification target is a Group. This field will be automatically set for you. - functionality_ids (list[str] | None | Unset): The Functionality IDs to attach to the alert - environment_ids (list[str] | None | Unset): The Environment IDs to attach to the alert - started_at (datetime.datetime | None | Unset): Alert start datetime - ended_at (datetime.datetime | None | Unset): Alert end datetime - external_id (None | str | Unset): External ID - external_url (None | str | Unset): External Url - alert_urgency_id (None | str | Unset): The ID of the alert urgency - notification_target_type (NewAlertDataAttributesNotificationTargetType | Unset): Only available for + noise (Union[Unset, NewAlertDataAttributesNoise]): Whether the alert is marked as noise + source (Union[Unset, str]): Deprecated. Accepted for backwards compatibility; new clients should omit. Defaults + to `api`. + status (Union[Unset, NewAlertDataAttributesStatus]): Only available for organizations with Rootly On-Call + enabled. Can be one of open, triggered. + description (Union[None, Unset, str]): The description of the alert + service_ids (Union[None, Unset, list[str]]): The Service IDs to attach to the alert. If your organization has + On-Call enabled and your notification target is a Service. This field will be automatically set for you. + group_ids (Union[None, Unset, list[str]]): The Group IDs to attach to the alert. If your organization has On- + Call enabled and your notification target is a Group. This field will be automatically set for you. + functionality_ids (Union[None, Unset, list[str]]): The Functionality IDs to attach to the alert + environment_ids (Union[None, Unset, list[str]]): The Environment IDs to attach to the alert + started_at (Union[None, Unset, datetime.datetime]): Alert start datetime + ended_at (Union[None, Unset, datetime.datetime]): Alert end datetime + external_id (Union[None, Unset, str]): External ID + external_url (Union[None, Unset, str]): External Url + alert_urgency_id (Union[None, Unset, str]): The ID of the alert urgency + notification_target_type (Union[Unset, NewAlertDataAttributesNotificationTargetType]): Only available for organizations with Rootly On-Call enabled. Can be one of Group, Service, EscalationPolicy, Functionality, User. Please contact support if you encounter issues using `Functionality` as a notification target type. - notification_target_id (None | str | Unset): Only available for organizations with Rootly On-Call enabled. The - _identifier_ of the notification target object. - notification_targets (list[NewAlertDataAttributesNotificationTargetsType0Item] | None | Unset): Only available - for organizations with Rootly On-Call enabled. Page multiple destinations (any combination of Group, Service, - EscalationPolicy, Functionality, or User) in a single request. `Functionality` targets require the + notification_target_id (Union[None, Unset, str]): Only available for organizations with Rootly On-Call enabled. + The _identifier_ of the notification target object. + notification_targets (Union[None, Unset, list['NewAlertDataAttributesNotificationTargetsType0Item']]): Only + available for organizations with Rootly On-Call enabled. Page multiple destinations (any combination of Group, + Service, EscalationPolicy, Functionality, or User) in a single request. `Functionality` targets require the `enable_paging_functionalities` feature; a request that includes one while it is disabled is rejected. Applies to alert creation only. When provided, this takes precedence over the singular `notification_target_type` / `notification_target_id` fields. - labels (list[NewAlertDataAttributesLabelsItemType0 | None] | Unset): - data (NewAlertDataAttributesDataType0 | None | Unset): Additional data - deduplication_key (None | str | Unset): Alerts sharing the same deduplication key are treated as a single alert. - alert_field_values_attributes (list[NewAlertDataAttributesAlertFieldValuesAttributesItemType0 | None] | Unset): - Custom alert field values to create with the alert + labels (Union[Unset, list[Union['NewAlertDataAttributesLabelsItemType0', None]]]): + data (Union['NewAlertDataAttributesDataType0', None, Unset]): Additional data + deduplication_key (Union[None, Unset, str]): Alerts sharing the same deduplication key are treated as a single + alert. + alert_field_values_attributes (Union[Unset, + list[Union['NewAlertDataAttributesAlertFieldValuesAttributesItemType0', None]]]): Custom alert field values to + create with the alert """ summary: str - noise: NewAlertDataAttributesNoise | Unset = UNSET - source: str | Unset = UNSET - status: NewAlertDataAttributesStatus | Unset = UNSET - description: None | str | Unset = UNSET - service_ids: list[str] | None | Unset = UNSET - group_ids: list[str] | None | Unset = UNSET - functionality_ids: list[str] | None | Unset = UNSET - environment_ids: list[str] | None | Unset = UNSET - started_at: datetime.datetime | None | Unset = UNSET - ended_at: datetime.datetime | None | Unset = UNSET - external_id: None | str | Unset = UNSET - external_url: None | str | Unset = UNSET - alert_urgency_id: None | str | Unset = UNSET - notification_target_type: NewAlertDataAttributesNotificationTargetType | Unset = UNSET - notification_target_id: None | str | Unset = UNSET - notification_targets: list[NewAlertDataAttributesNotificationTargetsType0Item] | None | Unset = UNSET - labels: list[NewAlertDataAttributesLabelsItemType0 | None] | Unset = UNSET - data: NewAlertDataAttributesDataType0 | None | Unset = UNSET - deduplication_key: None | str | Unset = UNSET - alert_field_values_attributes: list[NewAlertDataAttributesAlertFieldValuesAttributesItemType0 | None] | Unset = ( - UNSET - ) + noise: Union[Unset, NewAlertDataAttributesNoise] = UNSET + source: Union[Unset, str] = UNSET + status: Union[Unset, NewAlertDataAttributesStatus] = UNSET + description: Union[None, Unset, str] = UNSET + service_ids: Union[None, Unset, list[str]] = UNSET + group_ids: Union[None, Unset, list[str]] = UNSET + functionality_ids: Union[None, Unset, list[str]] = UNSET + environment_ids: Union[None, Unset, list[str]] = UNSET + started_at: Union[None, Unset, datetime.datetime] = UNSET + ended_at: Union[None, Unset, datetime.datetime] = UNSET + external_id: Union[None, Unset, str] = UNSET + external_url: Union[None, Unset, str] = UNSET + alert_urgency_id: Union[None, Unset, str] = UNSET + notification_target_type: Union[Unset, NewAlertDataAttributesNotificationTargetType] = UNSET + notification_target_id: Union[None, Unset, str] = UNSET + notification_targets: Union[None, Unset, list["NewAlertDataAttributesNotificationTargetsType0Item"]] = UNSET + labels: Union[Unset, list[Union["NewAlertDataAttributesLabelsItemType0", None]]] = UNSET + data: Union["NewAlertDataAttributesDataType0", None, Unset] = UNSET + deduplication_key: Union[None, Unset, str] = UNSET + alert_field_values_attributes: Union[ + Unset, list[Union["NewAlertDataAttributesAlertFieldValuesAttributesItemType0", None]] + ] = UNSET def to_dict(self) -> dict[str, Any]: from ..models.new_alert_data_attributes_alert_field_values_attributes_item_type_0 import ( @@ -105,23 +105,23 @@ def to_dict(self) -> dict[str, Any]: summary = self.summary - noise: str | Unset = UNSET + noise: Union[Unset, str] = UNSET if not isinstance(self.noise, Unset): noise = self.noise source = self.source - status: str | Unset = UNSET + status: Union[Unset, str] = UNSET if not isinstance(self.status, Unset): status = self.status - description: None | str | Unset + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: description = self.description - service_ids: list[str] | None | Unset + service_ids: Union[None, Unset, list[str]] if isinstance(self.service_ids, Unset): service_ids = UNSET elif isinstance(self.service_ids, list): @@ -130,7 +130,7 @@ def to_dict(self) -> dict[str, Any]: else: service_ids = self.service_ids - group_ids: list[str] | None | Unset + group_ids: Union[None, Unset, list[str]] if isinstance(self.group_ids, Unset): group_ids = UNSET elif isinstance(self.group_ids, list): @@ -139,7 +139,7 @@ def to_dict(self) -> dict[str, Any]: else: group_ids = self.group_ids - functionality_ids: list[str] | None | Unset + functionality_ids: Union[None, Unset, list[str]] if isinstance(self.functionality_ids, Unset): functionality_ids = UNSET elif isinstance(self.functionality_ids, list): @@ -148,7 +148,7 @@ def to_dict(self) -> dict[str, Any]: else: functionality_ids = self.functionality_ids - environment_ids: list[str] | None | Unset + environment_ids: Union[None, Unset, list[str]] if isinstance(self.environment_ids, Unset): environment_ids = UNSET elif isinstance(self.environment_ids, list): @@ -157,7 +157,7 @@ def to_dict(self) -> dict[str, Any]: else: environment_ids = self.environment_ids - started_at: None | str | Unset + started_at: Union[None, Unset, str] if isinstance(self.started_at, Unset): started_at = UNSET elif isinstance(self.started_at, datetime.datetime): @@ -165,7 +165,7 @@ def to_dict(self) -> dict[str, Any]: else: started_at = self.started_at - ended_at: None | str | Unset + ended_at: Union[None, Unset, str] if isinstance(self.ended_at, Unset): ended_at = UNSET elif isinstance(self.ended_at, datetime.datetime): @@ -173,35 +173,35 @@ def to_dict(self) -> dict[str, Any]: else: ended_at = self.ended_at - external_id: None | str | Unset + external_id: Union[None, Unset, str] if isinstance(self.external_id, Unset): external_id = UNSET else: external_id = self.external_id - external_url: None | str | Unset + external_url: Union[None, Unset, str] if isinstance(self.external_url, Unset): external_url = UNSET else: external_url = self.external_url - alert_urgency_id: None | str | Unset + alert_urgency_id: Union[None, Unset, str] if isinstance(self.alert_urgency_id, Unset): alert_urgency_id = UNSET else: alert_urgency_id = self.alert_urgency_id - notification_target_type: str | Unset = UNSET + notification_target_type: Union[Unset, str] = UNSET if not isinstance(self.notification_target_type, Unset): notification_target_type = self.notification_target_type - notification_target_id: None | str | Unset + notification_target_id: Union[None, Unset, str] if isinstance(self.notification_target_id, Unset): notification_target_id = UNSET else: notification_target_id = self.notification_target_id - notification_targets: list[dict[str, Any]] | None | Unset + notification_targets: Union[None, Unset, list[dict[str, Any]]] if isinstance(self.notification_targets, Unset): notification_targets = UNSET elif isinstance(self.notification_targets, list): @@ -213,18 +213,18 @@ def to_dict(self) -> dict[str, Any]: else: notification_targets = self.notification_targets - labels: list[dict[str, Any] | None] | Unset = UNSET + labels: Union[Unset, list[Union[None, dict[str, Any]]]] = UNSET if not isinstance(self.labels, Unset): labels = [] for labels_item_data in self.labels: - labels_item: dict[str, Any] | None + labels_item: Union[None, dict[str, Any]] if isinstance(labels_item_data, NewAlertDataAttributesLabelsItemType0): labels_item = labels_item_data.to_dict() else: labels_item = labels_item_data labels.append(labels_item) - data: dict[str, Any] | None | Unset + data: Union[None, Unset, dict[str, Any]] if isinstance(self.data, Unset): data = UNSET elif isinstance(self.data, NewAlertDataAttributesDataType0): @@ -232,17 +232,17 @@ def to_dict(self) -> dict[str, Any]: else: data = self.data - deduplication_key: None | str | Unset + deduplication_key: Union[None, Unset, str] if isinstance(self.deduplication_key, Unset): deduplication_key = UNSET else: deduplication_key = self.deduplication_key - alert_field_values_attributes: list[dict[str, Any] | None] | Unset = UNSET + alert_field_values_attributes: Union[Unset, list[Union[None, dict[str, Any]]]] = UNSET if not isinstance(self.alert_field_values_attributes, Unset): alert_field_values_attributes = [] for alert_field_values_attributes_item_data in self.alert_field_values_attributes: - alert_field_values_attributes_item: dict[str, Any] | None + alert_field_values_attributes_item: Union[None, dict[str, Any]] if isinstance( alert_field_values_attributes_item_data, NewAlertDataAttributesAlertFieldValuesAttributesItemType0 ): @@ -316,7 +316,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: summary = d.pop("summary") _noise = d.pop("noise", UNSET) - noise: NewAlertDataAttributesNoise | Unset + noise: Union[Unset, NewAlertDataAttributesNoise] if isinstance(_noise, Unset): noise = UNSET else: @@ -325,22 +325,22 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: source = d.pop("source", UNSET) _status = d.pop("status", UNSET) - status: NewAlertDataAttributesStatus | Unset + status: Union[Unset, NewAlertDataAttributesStatus] if isinstance(_status, Unset): status = UNSET else: status = check_new_alert_data_attributes_status(_status) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) - def _parse_service_ids(data: object) -> list[str] | None | Unset: + def _parse_service_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -351,13 +351,13 @@ def _parse_service_ids(data: object) -> list[str] | None | Unset: service_ids_type_0 = cast(list[str], data) return service_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) service_ids = _parse_service_ids(d.pop("service_ids", UNSET)) - def _parse_group_ids(data: object) -> list[str] | None | Unset: + def _parse_group_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -368,13 +368,13 @@ def _parse_group_ids(data: object) -> list[str] | None | Unset: group_ids_type_0 = cast(list[str], data) return group_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) group_ids = _parse_group_ids(d.pop("group_ids", UNSET)) - def _parse_functionality_ids(data: object) -> list[str] | None | Unset: + def _parse_functionality_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -385,13 +385,13 @@ def _parse_functionality_ids(data: object) -> list[str] | None | Unset: functionality_ids_type_0 = cast(list[str], data) return functionality_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) functionality_ids = _parse_functionality_ids(d.pop("functionality_ids", UNSET)) - def _parse_environment_ids(data: object) -> list[str] | None | Unset: + def _parse_environment_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -402,13 +402,13 @@ def _parse_environment_ids(data: object) -> list[str] | None | Unset: environment_ids_type_0 = cast(list[str], data) return environment_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) environment_ids = _parse_environment_ids(d.pop("environment_ids", UNSET)) - def _parse_started_at(data: object) -> datetime.datetime | None | Unset: + def _parse_started_at(data: object) -> Union[None, Unset, datetime.datetime]: if data is None: return data if isinstance(data, Unset): @@ -419,13 +419,13 @@ def _parse_started_at(data: object) -> datetime.datetime | None | Unset: started_at_type_0 = isoparse(data) return started_at_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(datetime.datetime | None | Unset, data) + return cast(Union[None, Unset, datetime.datetime], data) started_at = _parse_started_at(d.pop("started_at", UNSET)) - def _parse_ended_at(data: object) -> datetime.datetime | None | Unset: + def _parse_ended_at(data: object) -> Union[None, Unset, datetime.datetime]: if data is None: return data if isinstance(data, Unset): @@ -436,41 +436,41 @@ def _parse_ended_at(data: object) -> datetime.datetime | None | Unset: ended_at_type_0 = isoparse(data) return ended_at_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(datetime.datetime | None | Unset, data) + return cast(Union[None, Unset, datetime.datetime], data) ended_at = _parse_ended_at(d.pop("ended_at", UNSET)) - def _parse_external_id(data: object) -> None | str | Unset: + def _parse_external_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) external_id = _parse_external_id(d.pop("external_id", UNSET)) - def _parse_external_url(data: object) -> None | str | Unset: + def _parse_external_url(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) external_url = _parse_external_url(d.pop("external_url", UNSET)) - def _parse_alert_urgency_id(data: object) -> None | str | Unset: + def _parse_alert_urgency_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) alert_urgency_id = _parse_alert_urgency_id(d.pop("alert_urgency_id", UNSET)) _notification_target_type = d.pop("notification_target_type", UNSET) - notification_target_type: NewAlertDataAttributesNotificationTargetType | Unset + notification_target_type: Union[Unset, NewAlertDataAttributesNotificationTargetType] if isinstance(_notification_target_type, Unset): notification_target_type = UNSET else: @@ -478,18 +478,18 @@ def _parse_alert_urgency_id(data: object) -> None | str | Unset: _notification_target_type ) - def _parse_notification_target_id(data: object) -> None | str | Unset: + def _parse_notification_target_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) notification_target_id = _parse_notification_target_id(d.pop("notification_target_id", UNSET)) def _parse_notification_targets( data: object, - ) -> list[NewAlertDataAttributesNotificationTargetsType0Item] | None | Unset: + ) -> Union[None, Unset, list["NewAlertDataAttributesNotificationTargetsType0Item"]]: if data is None: return data if isinstance(data, Unset): @@ -507,36 +507,34 @@ def _parse_notification_targets( notification_targets_type_0.append(notification_targets_type_0_item) return notification_targets_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[NewAlertDataAttributesNotificationTargetsType0Item] | None | Unset, data) + return cast(Union[None, Unset, list["NewAlertDataAttributesNotificationTargetsType0Item"]], data) notification_targets = _parse_notification_targets(d.pop("notification_targets", UNSET)) + labels = [] _labels = d.pop("labels", UNSET) - labels: list[NewAlertDataAttributesLabelsItemType0 | None] | Unset = UNSET - if _labels is not UNSET: - labels = [] - for labels_item_data in _labels: + for labels_item_data in _labels or []: - def _parse_labels_item(data: object) -> NewAlertDataAttributesLabelsItemType0 | None: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - labels_item_type_0 = NewAlertDataAttributesLabelsItemType0.from_dict(data) + def _parse_labels_item(data: object) -> Union["NewAlertDataAttributesLabelsItemType0", None]: + if data is None: + return data + try: + if not isinstance(data, dict): + raise TypeError() + labels_item_type_0 = NewAlertDataAttributesLabelsItemType0.from_dict(data) - return labels_item_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(NewAlertDataAttributesLabelsItemType0 | None, data) + return labels_item_type_0 + except: # noqa: E722 + pass + return cast(Union["NewAlertDataAttributesLabelsItemType0", None], data) - labels_item = _parse_labels_item(labels_item_data) + labels_item = _parse_labels_item(labels_item_data) - labels.append(labels_item) + labels.append(labels_item) - def _parse_data(data: object) -> NewAlertDataAttributesDataType0 | None | Unset: + def _parse_data(data: object) -> Union["NewAlertDataAttributesDataType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -547,51 +545,47 @@ def _parse_data(data: object) -> NewAlertDataAttributesDataType0 | None | Unset: data_type_0 = NewAlertDataAttributesDataType0.from_dict(data) return data_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(NewAlertDataAttributesDataType0 | None | Unset, data) + return cast(Union["NewAlertDataAttributesDataType0", None, Unset], data) data = _parse_data(d.pop("data", UNSET)) - def _parse_deduplication_key(data: object) -> None | str | Unset: + def _parse_deduplication_key(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) deduplication_key = _parse_deduplication_key(d.pop("deduplication_key", UNSET)) + alert_field_values_attributes = [] _alert_field_values_attributes = d.pop("alert_field_values_attributes", UNSET) - alert_field_values_attributes: ( - list[NewAlertDataAttributesAlertFieldValuesAttributesItemType0 | None] | Unset - ) = UNSET - if _alert_field_values_attributes is not UNSET: - alert_field_values_attributes = [] - for alert_field_values_attributes_item_data in _alert_field_values_attributes: - - def _parse_alert_field_values_attributes_item( - data: object, - ) -> NewAlertDataAttributesAlertFieldValuesAttributesItemType0 | None: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - alert_field_values_attributes_item_type_0 = ( - NewAlertDataAttributesAlertFieldValuesAttributesItemType0.from_dict(data) - ) - - return alert_field_values_attributes_item_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(NewAlertDataAttributesAlertFieldValuesAttributesItemType0 | None, data) - - alert_field_values_attributes_item = _parse_alert_field_values_attributes_item( - alert_field_values_attributes_item_data - ) + for alert_field_values_attributes_item_data in _alert_field_values_attributes or []: + + def _parse_alert_field_values_attributes_item( + data: object, + ) -> Union["NewAlertDataAttributesAlertFieldValuesAttributesItemType0", None]: + if data is None: + return data + try: + if not isinstance(data, dict): + raise TypeError() + alert_field_values_attributes_item_type_0 = ( + NewAlertDataAttributesAlertFieldValuesAttributesItemType0.from_dict(data) + ) - alert_field_values_attributes.append(alert_field_values_attributes_item) + return alert_field_values_attributes_item_type_0 + except: # noqa: E722 + pass + return cast(Union["NewAlertDataAttributesAlertFieldValuesAttributesItemType0", None], data) + + alert_field_values_attributes_item = _parse_alert_field_values_attributes_item( + alert_field_values_attributes_item_data + ) + + alert_field_values_attributes.append(alert_field_values_attributes_item) new_alert_data_attributes = cls( summary=summary, diff --git a/rootly_sdk/models/new_alert_data_attributes_alert_field_values_attributes_item_type_0.py b/rootly_sdk/models/new_alert_data_attributes_alert_field_values_attributes_item_type_0.py index d6390a5a..32034f4e 100644 --- a/rootly_sdk/models/new_alert_data_attributes_alert_field_values_attributes_item_type_0.py +++ b/rootly_sdk/models/new_alert_data_attributes_alert_field_values_attributes_item_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/new_alert_data_attributes_data_type_0.py b/rootly_sdk/models/new_alert_data_attributes_data_type_0.py index 407a47f0..dd2efbaf 100644 --- a/rootly_sdk/models/new_alert_data_attributes_data_type_0.py +++ b/rootly_sdk/models/new_alert_data_attributes_data_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,7 +14,6 @@ class NewAlertDataAttributesDataType0: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) diff --git a/rootly_sdk/models/new_alert_data_attributes_labels_item_type_0.py b/rootly_sdk/models/new_alert_data_attributes_labels_item_type_0.py index 024b581d..5599a981 100644 --- a/rootly_sdk/models/new_alert_data_attributes_labels_item_type_0.py +++ b/rootly_sdk/models/new_alert_data_attributes_labels_item_type_0.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -14,17 +12,17 @@ class NewAlertDataAttributesLabelsItemType0: """ Attributes: key (str): Key of the tag - value (bool | float | str): Value of the tag + value (Union[bool, float, str]): Value of the tag """ key: str - value: bool | float | str + value: Union[bool, float, str] additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: key = self.key - value: bool | float | str + value: Union[bool, float, str] value = self.value field_dict: dict[str, Any] = {} @@ -43,8 +41,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) key = d.pop("key") - def _parse_value(data: object) -> bool | float | str: - return cast(bool | float | str, data) + def _parse_value(data: object) -> Union[bool, float, str]: + return cast(Union[bool, float, str], data) value = _parse_value(d.pop("value")) diff --git a/rootly_sdk/models/new_alert_data_attributes_notification_targets_type_0_item.py b/rootly_sdk/models/new_alert_data_attributes_notification_targets_type_0_item.py index 2016715d..e36f7c7f 100644 --- a/rootly_sdk/models/new_alert_data_attributes_notification_targets_type_0_item.py +++ b/rootly_sdk/models/new_alert_data_attributes_notification_targets_type_0_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/new_alert_event.py b/rootly_sdk/models/new_alert_event.py index e8e54def..c838ecb9 100644 --- a/rootly_sdk/models/new_alert_event.py +++ b/rootly_sdk/models/new_alert_event.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewAlertEvent: data (NewAlertEventData): """ - data: NewAlertEventData + data: "NewAlertEventData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_alert_event_data.py b/rootly_sdk/models/new_alert_event_data.py index 1533615e..94a35a34 100644 --- a/rootly_sdk/models/new_alert_event_data.py +++ b/rootly_sdk/models/new_alert_event_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class NewAlertEventData: """ type_: NewAlertEventDataType - attributes: NewAlertEventDataAttributes + attributes: "NewAlertEventDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_alert_event_data_attributes.py b/rootly_sdk/models/new_alert_event_data_attributes.py index fa2ef336..fa2d9ae7 100644 --- a/rootly_sdk/models/new_alert_event_data_attributes.py +++ b/rootly_sdk/models/new_alert_event_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define @@ -20,12 +18,12 @@ class NewAlertEventDataAttributes: Attributes: kind (NewAlertEventDataAttributesKind): details (str): Note message. - user_id (int | Unset): Author of the note. + user_id (Union[Unset, int]): Author of the note. """ kind: NewAlertEventDataAttributesKind details: str - user_id: int | Unset = UNSET + user_id: Union[Unset, int] = UNSET def to_dict(self) -> dict[str, Any]: kind: str = self.kind diff --git a/rootly_sdk/models/new_alert_field.py b/rootly_sdk/models/new_alert_field.py index be0fa49a..8a07ae9c 100644 --- a/rootly_sdk/models/new_alert_field.py +++ b/rootly_sdk/models/new_alert_field.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewAlertField: data (NewAlertFieldData): """ - data: NewAlertFieldData + data: "NewAlertFieldData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_alert_field_data.py b/rootly_sdk/models/new_alert_field_data.py index 2be303ec..f1029426 100644 --- a/rootly_sdk/models/new_alert_field_data.py +++ b/rootly_sdk/models/new_alert_field_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class NewAlertFieldData: """ type_: NewAlertFieldDataType - attributes: NewAlertFieldDataAttributes + attributes: "NewAlertFieldDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_alert_field_data_attributes.py b/rootly_sdk/models/new_alert_field_data_attributes.py index d3021a24..86fe695d 100644 --- a/rootly_sdk/models/new_alert_field_data_attributes.py +++ b/rootly_sdk/models/new_alert_field_data_attributes.py @@ -1,10 +1,10 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define +from ..types import UNSET, Unset + T = TypeVar("T", bound="NewAlertFieldDataAttributes") @@ -13,13 +13,22 @@ class NewAlertFieldDataAttributes: """ Attributes: name (str): The name of the alert field + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. """ name: str + slug: Union[None, Unset, str] = UNSET def to_dict(self) -> dict[str, Any]: name = self.name + slug: Union[None, Unset, str] + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug + field_dict: dict[str, Any] = {} field_dict.update( @@ -27,6 +36,8 @@ def to_dict(self) -> dict[str, Any]: "name": name, } ) + if slug is not UNSET: + field_dict["slug"] = slug return field_dict @@ -35,8 +46,18 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name") + def _parse_slug(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + slug = _parse_slug(d.pop("slug", UNSET)) + new_alert_field_data_attributes = cls( name=name, + slug=slug, ) return new_alert_field_data_attributes diff --git a/rootly_sdk/models/new_alert_group.py b/rootly_sdk/models/new_alert_group.py index 8f3c7eaf..e61d1901 100644 --- a/rootly_sdk/models/new_alert_group.py +++ b/rootly_sdk/models/new_alert_group.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewAlertGroup: data (NewAlertGroupData): """ - data: NewAlertGroupData + data: "NewAlertGroupData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_alert_group_data.py b/rootly_sdk/models/new_alert_group_data.py index f11830f5..c0de3056 100644 --- a/rootly_sdk/models/new_alert_group_data.py +++ b/rootly_sdk/models/new_alert_group_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class NewAlertGroupData: """ type_: NewAlertGroupDataType - attributes: NewAlertGroupDataAttributes + attributes: "NewAlertGroupDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_alert_group_data_attributes.py b/rootly_sdk/models/new_alert_group_data_attributes.py index 7fe6b383..50241211 100644 --- a/rootly_sdk/models/new_alert_group_data_attributes.py +++ b/rootly_sdk/models/new_alert_group_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -33,37 +31,45 @@ class NewAlertGroupDataAttributes: """ Attributes: name (str): The name of the alert group - description (None | str | Unset): The description of the alert urgency - time_window (int | Unset): The length of time an Alert Group should stay open and accept new alerts - targets (list[NewAlertGroupDataAttributesTargetsItem] | Unset): - attributes (list[NewAlertGroupDataAttributesAttributesItem] | Unset): This field is deprecated. Please use the - `conditions` field instead, `attributes` will be removed in the future. - group_by_alert_title (NewAlertGroupDataAttributesGroupByAlertTitle | Unset): [DEPRECATED] Whether the alerts - should be grouped by titles. This field is deprecated. Please use the `conditions` field with advanced alert - grouping instead. - group_by_alert_urgency (NewAlertGroupDataAttributesGroupByAlertUrgency | Unset): [DEPRECATED] Whether the alerts - should be grouped by urgencies. This field is deprecated. Please use the `conditions` field with advanced alert - grouping instead. - condition_type (NewAlertGroupDataAttributesConditionType | Unset): Group alerts when ANY or ALL of the fields - are matching. - conditions (list[NewAlertGroupDataAttributesConditionsItem] | Unset): + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + description (Union[None, Unset, str]): The description of the alert urgency + time_window (Union[Unset, int]): The length of time an Alert Group should stay open and accept new alerts + targets (Union[Unset, list['NewAlertGroupDataAttributesTargetsItem']]): + attributes (Union[Unset, list['NewAlertGroupDataAttributesAttributesItem']]): This field is deprecated. Please + use the `conditions` field instead, `attributes` will be removed in the future. + group_by_alert_title (Union[Unset, NewAlertGroupDataAttributesGroupByAlertTitle]): [DEPRECATED] Whether the + alerts should be grouped by titles. This field is deprecated. Please use the `conditions` field with advanced + alert grouping instead. + group_by_alert_urgency (Union[Unset, NewAlertGroupDataAttributesGroupByAlertUrgency]): [DEPRECATED] Whether the + alerts should be grouped by urgencies. This field is deprecated. Please use the `conditions` field with advanced + alert grouping instead. + condition_type (Union[Unset, NewAlertGroupDataAttributesConditionType]): Group alerts when ANY or ALL of the + fields are matching. + conditions (Union[Unset, list['NewAlertGroupDataAttributesConditionsItem']]): """ name: str - description: None | str | Unset = UNSET - time_window: int | Unset = UNSET - targets: list[NewAlertGroupDataAttributesTargetsItem] | Unset = UNSET - attributes: list[NewAlertGroupDataAttributesAttributesItem] | Unset = UNSET - group_by_alert_title: NewAlertGroupDataAttributesGroupByAlertTitle | Unset = UNSET - group_by_alert_urgency: NewAlertGroupDataAttributesGroupByAlertUrgency | Unset = UNSET - condition_type: NewAlertGroupDataAttributesConditionType | Unset = UNSET - conditions: list[NewAlertGroupDataAttributesConditionsItem] | Unset = UNSET + slug: Union[None, Unset, str] = UNSET + description: Union[None, Unset, str] = UNSET + time_window: Union[Unset, int] = UNSET + targets: Union[Unset, list["NewAlertGroupDataAttributesTargetsItem"]] = UNSET + attributes: Union[Unset, list["NewAlertGroupDataAttributesAttributesItem"]] = UNSET + group_by_alert_title: Union[Unset, NewAlertGroupDataAttributesGroupByAlertTitle] = UNSET + group_by_alert_urgency: Union[Unset, NewAlertGroupDataAttributesGroupByAlertUrgency] = UNSET + condition_type: Union[Unset, NewAlertGroupDataAttributesConditionType] = UNSET + conditions: Union[Unset, list["NewAlertGroupDataAttributesConditionsItem"]] = UNSET def to_dict(self) -> dict[str, Any]: - name = self.name - description: None | str | Unset + slug: Union[None, Unset, str] + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug + + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: @@ -71,33 +77,33 @@ def to_dict(self) -> dict[str, Any]: time_window = self.time_window - targets: list[dict[str, Any]] | Unset = UNSET + targets: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.targets, Unset): targets = [] for targets_item_data in self.targets: targets_item = targets_item_data.to_dict() targets.append(targets_item) - attributes: list[dict[str, Any]] | Unset = UNSET + attributes: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.attributes, Unset): attributes = [] for attributes_item_data in self.attributes: attributes_item = attributes_item_data.to_dict() attributes.append(attributes_item) - group_by_alert_title: int | Unset = UNSET + group_by_alert_title: Union[Unset, int] = UNSET if not isinstance(self.group_by_alert_title, Unset): group_by_alert_title = self.group_by_alert_title - group_by_alert_urgency: int | Unset = UNSET + group_by_alert_urgency: Union[Unset, int] = UNSET if not isinstance(self.group_by_alert_urgency, Unset): group_by_alert_urgency = self.group_by_alert_urgency - condition_type: str | Unset = UNSET + condition_type: Union[Unset, str] = UNSET if not isinstance(self.condition_type, Unset): condition_type = self.condition_type - conditions: list[dict[str, Any]] | Unset = UNSET + conditions: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.conditions, Unset): conditions = [] for conditions_item_data in self.conditions: @@ -111,6 +117,8 @@ def to_dict(self) -> dict[str, Any]: "name": name, } ) + if slug is not UNSET: + field_dict["slug"] = slug if description is not UNSET: field_dict["description"] = description if time_window is not UNSET: @@ -139,44 +147,49 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name") - def _parse_description(data: object) -> None | str | Unset: + def _parse_slug(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + slug = _parse_slug(d.pop("slug", UNSET)) + + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) time_window = d.pop("time_window", UNSET) + targets = [] _targets = d.pop("targets", UNSET) - targets: list[NewAlertGroupDataAttributesTargetsItem] | Unset = UNSET - if _targets is not UNSET: - targets = [] - for targets_item_data in _targets: - targets_item = NewAlertGroupDataAttributesTargetsItem.from_dict(targets_item_data) + for targets_item_data in _targets or []: + targets_item = NewAlertGroupDataAttributesTargetsItem.from_dict(targets_item_data) - targets.append(targets_item) + targets.append(targets_item) + attributes = [] _attributes = d.pop("attributes", UNSET) - attributes: list[NewAlertGroupDataAttributesAttributesItem] | Unset = UNSET - if _attributes is not UNSET: - attributes = [] - for attributes_item_data in _attributes: - attributes_item = NewAlertGroupDataAttributesAttributesItem.from_dict(attributes_item_data) + for attributes_item_data in _attributes or []: + attributes_item = NewAlertGroupDataAttributesAttributesItem.from_dict(attributes_item_data) - attributes.append(attributes_item) + attributes.append(attributes_item) _group_by_alert_title = d.pop("group_by_alert_title", UNSET) - group_by_alert_title: NewAlertGroupDataAttributesGroupByAlertTitle | Unset + group_by_alert_title: Union[Unset, NewAlertGroupDataAttributesGroupByAlertTitle] if isinstance(_group_by_alert_title, Unset): group_by_alert_title = UNSET else: group_by_alert_title = check_new_alert_group_data_attributes_group_by_alert_title(_group_by_alert_title) _group_by_alert_urgency = d.pop("group_by_alert_urgency", UNSET) - group_by_alert_urgency: NewAlertGroupDataAttributesGroupByAlertUrgency | Unset + group_by_alert_urgency: Union[Unset, NewAlertGroupDataAttributesGroupByAlertUrgency] if isinstance(_group_by_alert_urgency, Unset): group_by_alert_urgency = UNSET else: @@ -185,23 +198,22 @@ def _parse_description(data: object) -> None | str | Unset: ) _condition_type = d.pop("condition_type", UNSET) - condition_type: NewAlertGroupDataAttributesConditionType | Unset + condition_type: Union[Unset, NewAlertGroupDataAttributesConditionType] if isinstance(_condition_type, Unset): condition_type = UNSET else: condition_type = check_new_alert_group_data_attributes_condition_type(_condition_type) + conditions = [] _conditions = d.pop("conditions", UNSET) - conditions: list[NewAlertGroupDataAttributesConditionsItem] | Unset = UNSET - if _conditions is not UNSET: - conditions = [] - for conditions_item_data in _conditions: - conditions_item = NewAlertGroupDataAttributesConditionsItem.from_dict(conditions_item_data) + for conditions_item_data in _conditions or []: + conditions_item = NewAlertGroupDataAttributesConditionsItem.from_dict(conditions_item_data) - conditions.append(conditions_item) + conditions.append(conditions_item) new_alert_group_data_attributes = cls( name=name, + slug=slug, description=description, time_window=time_window, targets=targets, diff --git a/rootly_sdk/models/new_alert_group_data_attributes_attributes_item.py b/rootly_sdk/models/new_alert_group_data_attributes_attributes_item.py index 32f2336b..f5f8d58b 100644 --- a/rootly_sdk/models/new_alert_group_data_attributes_attributes_item.py +++ b/rootly_sdk/models/new_alert_group_data_attributes_attributes_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,10 +13,10 @@ class NewAlertGroupDataAttributesAttributesItem: """ Attributes: - json_path (str | Unset): The JSON path to the value to group by. + json_path (Union[Unset, str]): The JSON path to the value to group by. """ - json_path: str | Unset = UNSET + json_path: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/new_alert_group_data_attributes_conditions_item.py b/rootly_sdk/models/new_alert_group_data_attributes_conditions_item.py index b4add325..8bc32b4a 100644 --- a/rootly_sdk/models/new_alert_group_data_attributes_conditions_item.py +++ b/rootly_sdk/models/new_alert_group_data_attributes_conditions_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -30,31 +28,32 @@ class NewAlertGroupDataAttributesConditionsItem: property_field_type (NewAlertGroupDataAttributesConditionsItemPropertyFieldType): The type of the property field property_field_condition_type (NewAlertGroupDataAttributesConditionsItemPropertyFieldConditionType): The condition type of the property field - property_field_name (str | Unset): The name of the property field. If the property field type is selected as - 'attribute', then the allowed property field names are 'summary' (for Title), 'description', 'alert_urgency' and - 'external_url' (for Alert Source URL). If the property field type is selected as 'payload', then the property - field name should be supplied in JSON Path syntax. - property_field_value (str | Unset): The value of the property field. Can be null if the property field condition - type is 'is_one_of' or 'is_not_one_of' - property_field_values (list[str] | Unset): The values of the property field. Need to be passed if the property - field condition type is 'is_one_of' or 'is_not_one_of' except for when property field name is 'alert_urgency' - alert_urgency_ids (list[str] | None | Unset): The Alert Urgency IDs to check in the condition. Only need to be - set when the property field type is 'attribute', the property field name is 'alert_urgency' and the property + property_field_name (Union[Unset, str]): The name of the property field. If the property field type is selected + as 'attribute', then the allowed property field names are 'summary' (for Title), 'description', 'alert_urgency' + and 'external_url' (for Alert Source URL). If the property field type is selected as 'payload', then the + property field name should be supplied in JSON Path syntax. + property_field_value (Union[Unset, str]): The value of the property field. Can be null if the property field + condition type is 'is_one_of' or 'is_not_one_of' + property_field_values (Union[Unset, list[str]]): The values of the property field. Need to be passed if the + property field condition type is 'is_one_of' or 'is_not_one_of' except for when property field name is + 'alert_urgency' + alert_urgency_ids (Union[None, Unset, list[str]]): The Alert Urgency IDs to check in the condition. Only need to + be set when the property field type is 'attribute', the property field name is 'alert_urgency' and the property field condition type is 'is_one_of' or 'is_not_one_of' - conditionable_type (NewAlertGroupDataAttributesConditionsItemConditionableType | Unset): The type of the + conditionable_type (Union[Unset, NewAlertGroupDataAttributesConditionsItemConditionableType]): The type of the conditionable - conditionable_id (str | Unset): The ID of the conditionable. If conditionable_type is AlertField, this is the ID - of the alert field. + conditionable_id (Union[Unset, str]): The ID of the conditionable. If conditionable_type is AlertField, this is + the ID of the alert field. """ property_field_type: NewAlertGroupDataAttributesConditionsItemPropertyFieldType property_field_condition_type: NewAlertGroupDataAttributesConditionsItemPropertyFieldConditionType - property_field_name: str | Unset = UNSET - property_field_value: str | Unset = UNSET - property_field_values: list[str] | Unset = UNSET - alert_urgency_ids: list[str] | None | Unset = UNSET - conditionable_type: NewAlertGroupDataAttributesConditionsItemConditionableType | Unset = UNSET - conditionable_id: str | Unset = UNSET + property_field_name: Union[Unset, str] = UNSET + property_field_value: Union[Unset, str] = UNSET + property_field_values: Union[Unset, list[str]] = UNSET + alert_urgency_ids: Union[None, Unset, list[str]] = UNSET + conditionable_type: Union[Unset, NewAlertGroupDataAttributesConditionsItemConditionableType] = UNSET + conditionable_id: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -66,11 +65,11 @@ def to_dict(self) -> dict[str, Any]: property_field_value = self.property_field_value - property_field_values: list[str] | Unset = UNSET + property_field_values: Union[Unset, list[str]] = UNSET if not isinstance(self.property_field_values, Unset): property_field_values = self.property_field_values - alert_urgency_ids: list[str] | None | Unset + alert_urgency_ids: Union[None, Unset, list[str]] if isinstance(self.alert_urgency_ids, Unset): alert_urgency_ids = UNSET elif isinstance(self.alert_urgency_ids, list): @@ -79,7 +78,7 @@ def to_dict(self) -> dict[str, Any]: else: alert_urgency_ids = self.alert_urgency_ids - conditionable_type: str | Unset = UNSET + conditionable_type: Union[Unset, str] = UNSET if not isinstance(self.conditionable_type, Unset): conditionable_type = self.conditionable_type @@ -127,7 +126,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: property_field_values = cast(list[str], d.pop("property_field_values", UNSET)) - def _parse_alert_urgency_ids(data: object) -> list[str] | None | Unset: + def _parse_alert_urgency_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -138,14 +137,14 @@ def _parse_alert_urgency_ids(data: object) -> list[str] | None | Unset: alert_urgency_ids_type_0 = cast(list[str], data) return alert_urgency_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) alert_urgency_ids = _parse_alert_urgency_ids(d.pop("alert_urgency_ids", UNSET)) _conditionable_type = d.pop("conditionable_type", UNSET) - conditionable_type: NewAlertGroupDataAttributesConditionsItemConditionableType | Unset + conditionable_type: Union[Unset, NewAlertGroupDataAttributesConditionsItemConditionableType] if isinstance(_conditionable_type, Unset): conditionable_type = UNSET else: diff --git a/rootly_sdk/models/new_alert_group_data_attributes_targets_item.py b/rootly_sdk/models/new_alert_group_data_attributes_targets_item.py index ecc8a286..03851493 100644 --- a/rootly_sdk/models/new_alert_group_data_attributes_targets_item.py +++ b/rootly_sdk/models/new_alert_group_data_attributes_targets_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar from uuid import UUID diff --git a/rootly_sdk/models/new_alert_retrigger_rule.py b/rootly_sdk/models/new_alert_retrigger_rule.py new file mode 100644 index 00000000..c62901d5 --- /dev/null +++ b/rootly_sdk/models/new_alert_retrigger_rule.py @@ -0,0 +1,65 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +if TYPE_CHECKING: + from ..models.new_alert_retrigger_rule_data import NewAlertRetriggerRuleData + + +T = TypeVar("T", bound="NewAlertRetriggerRule") + + +@_attrs_define +class NewAlertRetriggerRule: + """ + Attributes: + data (NewAlertRetriggerRuleData): + """ + + data: "NewAlertRetriggerRuleData" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "data": data, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.new_alert_retrigger_rule_data import NewAlertRetriggerRuleData + + d = dict(src_dict) + data = NewAlertRetriggerRuleData.from_dict(d.pop("data")) + + new_alert_retrigger_rule = cls( + data=data, + ) + + new_alert_retrigger_rule.additional_properties = d + return new_alert_retrigger_rule + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/rootly_sdk/models/new_alert_retrigger_rule_data.py b/rootly_sdk/models/new_alert_retrigger_rule_data.py new file mode 100644 index 00000000..9adebe16 --- /dev/null +++ b/rootly_sdk/models/new_alert_retrigger_rule_data.py @@ -0,0 +1,78 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.new_alert_retrigger_rule_data_type import ( + NewAlertRetriggerRuleDataType, + check_new_alert_retrigger_rule_data_type, +) + +if TYPE_CHECKING: + from ..models.new_alert_retrigger_rule_data_attributes import NewAlertRetriggerRuleDataAttributes + + +T = TypeVar("T", bound="NewAlertRetriggerRuleData") + + +@_attrs_define +class NewAlertRetriggerRuleData: + """ + Attributes: + type_ (NewAlertRetriggerRuleDataType): + attributes (NewAlertRetriggerRuleDataAttributes): + """ + + type_: NewAlertRetriggerRuleDataType + attributes: "NewAlertRetriggerRuleDataAttributes" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + type_: str = self.type_ + + attributes = self.attributes.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "type": type_, + "attributes": attributes, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.new_alert_retrigger_rule_data_attributes import NewAlertRetriggerRuleDataAttributes + + d = dict(src_dict) + type_ = check_new_alert_retrigger_rule_data_type(d.pop("type")) + + attributes = NewAlertRetriggerRuleDataAttributes.from_dict(d.pop("attributes")) + + new_alert_retrigger_rule_data = cls( + type_=type_, + attributes=attributes, + ) + + new_alert_retrigger_rule_data.additional_properties = d + return new_alert_retrigger_rule_data + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/rootly_sdk/models/new_alert_retrigger_rule_data_attributes.py b/rootly_sdk/models/new_alert_retrigger_rule_data_attributes.py new file mode 100644 index 00000000..886274a7 --- /dev/null +++ b/rootly_sdk/models/new_alert_retrigger_rule_data_attributes.py @@ -0,0 +1,124 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define + +from ..models.new_alert_retrigger_rule_data_attributes_match_mode import ( + NewAlertRetriggerRuleDataAttributesMatchMode, + check_new_alert_retrigger_rule_data_attributes_match_mode, +) +from ..models.new_alert_retrigger_rule_data_attributes_timeout_minutes import ( + NewAlertRetriggerRuleDataAttributesTimeoutMinutes, + check_new_alert_retrigger_rule_data_attributes_timeout_minutes, +) +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.new_alert_retrigger_rule_data_attributes_conditions_item import ( + NewAlertRetriggerRuleDataAttributesConditionsItem, + ) + + +T = TypeVar("T", bound="NewAlertRetriggerRuleDataAttributes") + + +@_attrs_define +class NewAlertRetriggerRuleDataAttributes: + """ + Attributes: + name (str): A human-readable name for the rule + match_mode (Union[Unset, NewAlertRetriggerRuleDataAttributesMatchMode]): Whether all or any of the conditions + must match + timeout_minutes (Union[Unset, NewAlertRetriggerRuleDataAttributesTimeoutMinutes]): Re-trigger the alert this + many minutes after acknowledgment. Null means never re-trigger. + position (Union[Unset, int]): The position of the rule; the first matching rule (by position) decides the + outcome + conditions (Union[Unset, list['NewAlertRetriggerRuleDataAttributesConditionsItem']]): The conditions that + determine which alerts this rule applies to. An empty array applies to every alert. + """ + + name: str + match_mode: Union[Unset, NewAlertRetriggerRuleDataAttributesMatchMode] = UNSET + timeout_minutes: Union[Unset, NewAlertRetriggerRuleDataAttributesTimeoutMinutes] = UNSET + position: Union[Unset, int] = UNSET + conditions: Union[Unset, list["NewAlertRetriggerRuleDataAttributesConditionsItem"]] = UNSET + + def to_dict(self) -> dict[str, Any]: + name = self.name + + match_mode: Union[Unset, str] = UNSET + if not isinstance(self.match_mode, Unset): + match_mode = self.match_mode + + timeout_minutes: Union[Unset, int] = UNSET + if not isinstance(self.timeout_minutes, Unset): + timeout_minutes = self.timeout_minutes + + position = self.position + + conditions: Union[Unset, list[dict[str, Any]]] = UNSET + if not isinstance(self.conditions, Unset): + conditions = [] + for conditions_item_data in self.conditions: + conditions_item = conditions_item_data.to_dict() + conditions.append(conditions_item) + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "name": name, + } + ) + if match_mode is not UNSET: + field_dict["match_mode"] = match_mode + if timeout_minutes is not UNSET: + field_dict["timeout_minutes"] = timeout_minutes + if position is not UNSET: + field_dict["position"] = position + if conditions is not UNSET: + field_dict["conditions"] = conditions + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.new_alert_retrigger_rule_data_attributes_conditions_item import ( + NewAlertRetriggerRuleDataAttributesConditionsItem, + ) + + d = dict(src_dict) + name = d.pop("name") + + _match_mode = d.pop("match_mode", UNSET) + match_mode: Union[Unset, NewAlertRetriggerRuleDataAttributesMatchMode] + if isinstance(_match_mode, Unset): + match_mode = UNSET + else: + match_mode = check_new_alert_retrigger_rule_data_attributes_match_mode(_match_mode) + + _timeout_minutes = d.pop("timeout_minutes", UNSET) + timeout_minutes: Union[Unset, NewAlertRetriggerRuleDataAttributesTimeoutMinutes] + if isinstance(_timeout_minutes, Unset): + timeout_minutes = UNSET + else: + timeout_minutes = check_new_alert_retrigger_rule_data_attributes_timeout_minutes(_timeout_minutes) + + position = d.pop("position", UNSET) + + conditions = [] + _conditions = d.pop("conditions", UNSET) + for conditions_item_data in _conditions or []: + conditions_item = NewAlertRetriggerRuleDataAttributesConditionsItem.from_dict(conditions_item_data) + + conditions.append(conditions_item) + + new_alert_retrigger_rule_data_attributes = cls( + name=name, + match_mode=match_mode, + timeout_minutes=timeout_minutes, + position=position, + conditions=conditions, + ) + + return new_alert_retrigger_rule_data_attributes diff --git a/rootly_sdk/models/new_alert_retrigger_rule_data_attributes_conditions_item.py b/rootly_sdk/models/new_alert_retrigger_rule_data_attributes_conditions_item.py new file mode 100644 index 00000000..41d09961 --- /dev/null +++ b/rootly_sdk/models/new_alert_retrigger_rule_data_attributes_conditions_item.py @@ -0,0 +1,123 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, Union, cast +from uuid import UUID + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.new_alert_retrigger_rule_data_attributes_conditions_item_kind import ( + NewAlertRetriggerRuleDataAttributesConditionsItemKind, + check_new_alert_retrigger_rule_data_attributes_conditions_item_kind, +) +from ..models.new_alert_retrigger_rule_data_attributes_conditions_item_operator import ( + NewAlertRetriggerRuleDataAttributesConditionsItemOperator, + check_new_alert_retrigger_rule_data_attributes_conditions_item_operator, +) +from ..types import UNSET, Unset + +T = TypeVar("T", bound="NewAlertRetriggerRuleDataAttributesConditionsItem") + + +@_attrs_define +class NewAlertRetriggerRuleDataAttributesConditionsItem: + """ + Attributes: + kind (NewAlertRetriggerRuleDataAttributesConditionsItemKind): The operand the condition matches on. Native + operands (urgency, source, service, group) match by record; alert_field/payload match a field value. + operator (NewAlertRetriggerRuleDataAttributesConditionsItemOperator): How the operand is compared. Native + operands support is_one_of/is_not_one_of/is_set/is_not_set; alert_field/payload additionally support the + string/regex operators. + record_ids (Union[Unset, list[UUID]]): For urgency/service/group/source conditions: the IDs of the matched + records (AlertUrgency, Service, Group, or Alerts::Source). + values (Union[Unset, list[str]]): For source conditions: non-integration source aliases (e.g. manual, api). For + alert_field/payload conditions: the values to compare against. + property_field_name (Union[Unset, str]): For alert_field conditions: the alert field id. For payload conditions: + a JSON Path (e.g. $.priority). + """ + + kind: NewAlertRetriggerRuleDataAttributesConditionsItemKind + operator: NewAlertRetriggerRuleDataAttributesConditionsItemOperator + record_ids: Union[Unset, list[UUID]] = UNSET + values: Union[Unset, list[str]] = UNSET + property_field_name: Union[Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + kind: str = self.kind + + operator: str = self.operator + + record_ids: Union[Unset, list[str]] = UNSET + if not isinstance(self.record_ids, Unset): + record_ids = [] + for record_ids_item_data in self.record_ids: + record_ids_item = str(record_ids_item_data) + record_ids.append(record_ids_item) + + values: Union[Unset, list[str]] = UNSET + if not isinstance(self.values, Unset): + values = self.values + + property_field_name = self.property_field_name + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "kind": kind, + "operator": operator, + } + ) + if record_ids is not UNSET: + field_dict["record_ids"] = record_ids + if values is not UNSET: + field_dict["values"] = values + if property_field_name is not UNSET: + field_dict["property_field_name"] = property_field_name + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + kind = check_new_alert_retrigger_rule_data_attributes_conditions_item_kind(d.pop("kind")) + + operator = check_new_alert_retrigger_rule_data_attributes_conditions_item_operator(d.pop("operator")) + + record_ids = [] + _record_ids = d.pop("record_ids", UNSET) + for record_ids_item_data in _record_ids or []: + record_ids_item = UUID(record_ids_item_data) + + record_ids.append(record_ids_item) + + values = cast(list[str], d.pop("values", UNSET)) + + property_field_name = d.pop("property_field_name", UNSET) + + new_alert_retrigger_rule_data_attributes_conditions_item = cls( + kind=kind, + operator=operator, + record_ids=record_ids, + values=values, + property_field_name=property_field_name, + ) + + new_alert_retrigger_rule_data_attributes_conditions_item.additional_properties = d + return new_alert_retrigger_rule_data_attributes_conditions_item + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/rootly_sdk/models/new_alert_retrigger_rule_data_attributes_conditions_item_kind.py b/rootly_sdk/models/new_alert_retrigger_rule_data_attributes_conditions_item_kind.py new file mode 100644 index 00000000..43e64777 --- /dev/null +++ b/rootly_sdk/models/new_alert_retrigger_rule_data_attributes_conditions_item_kind.py @@ -0,0 +1,28 @@ +from typing import Literal, cast + +NewAlertRetriggerRuleDataAttributesConditionsItemKind = Literal[ + "alert_field", "group", "payload", "service", "source", "urgency" +] + +NEW_ALERT_RETRIGGER_RULE_DATA_ATTRIBUTES_CONDITIONS_ITEM_KIND_VALUES: set[ + NewAlertRetriggerRuleDataAttributesConditionsItemKind +] = { + "alert_field", + "group", + "payload", + "service", + "source", + "urgency", +} + + +def check_new_alert_retrigger_rule_data_attributes_conditions_item_kind( + value: str | None, +) -> NewAlertRetriggerRuleDataAttributesConditionsItemKind | None: + if value is None: + return None + if value in NEW_ALERT_RETRIGGER_RULE_DATA_ATTRIBUTES_CONDITIONS_ITEM_KIND_VALUES: + return cast(NewAlertRetriggerRuleDataAttributesConditionsItemKind, value) + raise TypeError( + f"Unexpected value {value!r}. Expected one of {NEW_ALERT_RETRIGGER_RULE_DATA_ATTRIBUTES_CONDITIONS_ITEM_KIND_VALUES!r}" + ) diff --git a/rootly_sdk/models/new_alert_retrigger_rule_data_attributes_conditions_item_operator.py b/rootly_sdk/models/new_alert_retrigger_rule_data_attributes_conditions_item_operator.py new file mode 100644 index 00000000..8203628d --- /dev/null +++ b/rootly_sdk/models/new_alert_retrigger_rule_data_attributes_conditions_item_operator.py @@ -0,0 +1,39 @@ +from typing import Literal, cast + +NewAlertRetriggerRuleDataAttributesConditionsItemOperator = Literal[ + "contains", + "does_not_contain", + "ends_with", + "is_not_one_of", + "is_not_set", + "is_one_of", + "is_set", + "matches_regex", + "starts_with", +] + +NEW_ALERT_RETRIGGER_RULE_DATA_ATTRIBUTES_CONDITIONS_ITEM_OPERATOR_VALUES: set[ + NewAlertRetriggerRuleDataAttributesConditionsItemOperator +] = { + "contains", + "does_not_contain", + "ends_with", + "is_not_one_of", + "is_not_set", + "is_one_of", + "is_set", + "matches_regex", + "starts_with", +} + + +def check_new_alert_retrigger_rule_data_attributes_conditions_item_operator( + value: str | None, +) -> NewAlertRetriggerRuleDataAttributesConditionsItemOperator | None: + if value is None: + return None + if value in NEW_ALERT_RETRIGGER_RULE_DATA_ATTRIBUTES_CONDITIONS_ITEM_OPERATOR_VALUES: + return cast(NewAlertRetriggerRuleDataAttributesConditionsItemOperator, value) + raise TypeError( + f"Unexpected value {value!r}. Expected one of {NEW_ALERT_RETRIGGER_RULE_DATA_ATTRIBUTES_CONDITIONS_ITEM_OPERATOR_VALUES!r}" + ) diff --git a/rootly_sdk/models/new_alert_retrigger_rule_data_attributes_match_mode.py b/rootly_sdk/models/new_alert_retrigger_rule_data_attributes_match_mode.py new file mode 100644 index 00000000..893aa6d5 --- /dev/null +++ b/rootly_sdk/models/new_alert_retrigger_rule_data_attributes_match_mode.py @@ -0,0 +1,20 @@ +from typing import Literal, cast + +NewAlertRetriggerRuleDataAttributesMatchMode = Literal["match-all-rules", "match-any-rule"] + +NEW_ALERT_RETRIGGER_RULE_DATA_ATTRIBUTES_MATCH_MODE_VALUES: set[NewAlertRetriggerRuleDataAttributesMatchMode] = { + "match-all-rules", + "match-any-rule", +} + + +def check_new_alert_retrigger_rule_data_attributes_match_mode( + value: str | None, +) -> NewAlertRetriggerRuleDataAttributesMatchMode | None: + if value is None: + return None + if value in NEW_ALERT_RETRIGGER_RULE_DATA_ATTRIBUTES_MATCH_MODE_VALUES: + return cast(NewAlertRetriggerRuleDataAttributesMatchMode, value) + raise TypeError( + f"Unexpected value {value!r}. Expected one of {NEW_ALERT_RETRIGGER_RULE_DATA_ATTRIBUTES_MATCH_MODE_VALUES!r}" + ) diff --git a/rootly_sdk/models/new_alert_retrigger_rule_data_attributes_timeout_minutes.py b/rootly_sdk/models/new_alert_retrigger_rule_data_attributes_timeout_minutes.py new file mode 100644 index 00000000..3ae3d4fe --- /dev/null +++ b/rootly_sdk/models/new_alert_retrigger_rule_data_attributes_timeout_minutes.py @@ -0,0 +1,34 @@ +from typing import Literal, cast + +NewAlertRetriggerRuleDataAttributesTimeoutMinutes = Literal[ + 10, 20, 30, 40, 50, 60, 90, 120, 180, 240, 300, 360, 720, 1440 +] + +NEW_ALERT_RETRIGGER_RULE_DATA_ATTRIBUTES_TIMEOUT_MINUTES_VALUES: set[ + NewAlertRetriggerRuleDataAttributesTimeoutMinutes +] = { + 10, + 20, + 30, + 40, + 50, + 60, + 90, + 120, + 180, + 240, + 300, + 360, + 720, + 1440, +} + + +def check_new_alert_retrigger_rule_data_attributes_timeout_minutes( + value: int, +) -> NewAlertRetriggerRuleDataAttributesTimeoutMinutes: + if value in NEW_ALERT_RETRIGGER_RULE_DATA_ATTRIBUTES_TIMEOUT_MINUTES_VALUES: + return cast(NewAlertRetriggerRuleDataAttributesTimeoutMinutes, value) + raise TypeError( + f"Unexpected value {value!r}. Expected one of {NEW_ALERT_RETRIGGER_RULE_DATA_ATTRIBUTES_TIMEOUT_MINUTES_VALUES!r}" + ) diff --git a/rootly_sdk/models/new_alert_retrigger_rule_data_type.py b/rootly_sdk/models/new_alert_retrigger_rule_data_type.py new file mode 100644 index 00000000..66fa671d --- /dev/null +++ b/rootly_sdk/models/new_alert_retrigger_rule_data_type.py @@ -0,0 +1,15 @@ +from typing import Literal, cast + +NewAlertRetriggerRuleDataType = Literal["alert_retrigger_rules"] + +NEW_ALERT_RETRIGGER_RULE_DATA_TYPE_VALUES: set[NewAlertRetriggerRuleDataType] = { + "alert_retrigger_rules", +} + + +def check_new_alert_retrigger_rule_data_type(value: str | None) -> NewAlertRetriggerRuleDataType | None: + if value is None: + return None + if value in NEW_ALERT_RETRIGGER_RULE_DATA_TYPE_VALUES: + return cast(NewAlertRetriggerRuleDataType, value) + raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_ALERT_RETRIGGER_RULE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/new_alert_route.py b/rootly_sdk/models/new_alert_route.py index 12b360a5..19ca824c 100644 --- a/rootly_sdk/models/new_alert_route.py +++ b/rootly_sdk/models/new_alert_route.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,15 +17,14 @@ class NewAlertRoute: """ Attributes: - data (NewAlertRouteData | Unset): + data (Union[Unset, NewAlertRouteData]): """ - data: NewAlertRouteData | Unset = UNSET + data: Union[Unset, "NewAlertRouteData"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - - data: dict[str, Any] | Unset = UNSET + data: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.data, Unset): data = self.data.to_dict() @@ -45,7 +42,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _data = d.pop("data", UNSET) - data: NewAlertRouteData | Unset + data: Union[Unset, NewAlertRouteData] if isinstance(_data, Unset): data = UNSET else: diff --git a/rootly_sdk/models/new_alert_route_data.py b/rootly_sdk/models/new_alert_route_data.py index 45913777..e871ca08 100644 --- a/rootly_sdk/models/new_alert_route_data.py +++ b/rootly_sdk/models/new_alert_route_data.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -20,21 +18,20 @@ class NewAlertRouteData: """ Attributes: - type_ (NewAlertRouteDataType | Unset): - attributes (NewAlertRouteDataAttributes | Unset): + type_ (Union[Unset, NewAlertRouteDataType]): + attributes (Union[Unset, NewAlertRouteDataAttributes]): """ - type_: NewAlertRouteDataType | Unset = UNSET - attributes: NewAlertRouteDataAttributes | Unset = UNSET + type_: Union[Unset, NewAlertRouteDataType] = UNSET + attributes: Union[Unset, "NewAlertRouteDataAttributes"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - - type_: str | Unset = UNSET + type_: Union[Unset, str] = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ - attributes: dict[str, Any] | Unset = UNSET + attributes: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.attributes, Unset): attributes = self.attributes.to_dict() @@ -54,14 +51,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _type_ = d.pop("type", UNSET) - type_: NewAlertRouteDataType | Unset + type_: Union[Unset, NewAlertRouteDataType] if isinstance(_type_, Unset): type_ = UNSET else: type_ = check_new_alert_route_data_type(_type_) _attributes = d.pop("attributes", UNSET) - attributes: NewAlertRouteDataAttributes | Unset + attributes: Union[Unset, NewAlertRouteDataAttributes] if isinstance(_attributes, Unset): attributes = UNSET else: diff --git a/rootly_sdk/models/new_alert_route_data_attributes.py b/rootly_sdk/models/new_alert_route_data_attributes.py index a68d9865..d5d7ffc1 100644 --- a/rootly_sdk/models/new_alert_route_data_attributes.py +++ b/rootly_sdk/models/new_alert_route_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from uuid import UUID from attrs import define as _attrs_define @@ -22,20 +20,19 @@ class NewAlertRouteDataAttributes: Attributes: name (str): The name of the alert route alerts_source_ids (list[UUID]): - enabled (bool | Unset): Whether the alert route is enabled - owning_team_ids (list[UUID] | Unset): - rules (list[NewAlertRouteDataAttributesRulesItem] | Unset): + enabled (Union[Unset, bool]): Whether the alert route is enabled + owning_team_ids (Union[Unset, list[UUID]]): + rules (Union[Unset, list['NewAlertRouteDataAttributesRulesItem']]): """ name: str alerts_source_ids: list[UUID] - enabled: bool | Unset = UNSET - owning_team_ids: list[UUID] | Unset = UNSET - rules: list[NewAlertRouteDataAttributesRulesItem] | Unset = UNSET + enabled: Union[Unset, bool] = UNSET + owning_team_ids: Union[Unset, list[UUID]] = UNSET + rules: Union[Unset, list["NewAlertRouteDataAttributesRulesItem"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - name = self.name alerts_source_ids = [] @@ -45,14 +42,14 @@ def to_dict(self) -> dict[str, Any]: enabled = self.enabled - owning_team_ids: list[str] | Unset = UNSET + owning_team_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.owning_team_ids, Unset): owning_team_ids = [] for owning_team_ids_item_data in self.owning_team_ids: owning_team_ids_item = str(owning_team_ids_item_data) owning_team_ids.append(owning_team_ids_item) - rules: list[dict[str, Any]] | Unset = UNSET + rules: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.rules, Unset): rules = [] for rules_item_data in self.rules: @@ -92,23 +89,19 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: enabled = d.pop("enabled", UNSET) + owning_team_ids = [] _owning_team_ids = d.pop("owning_team_ids", UNSET) - owning_team_ids: list[UUID] | Unset = UNSET - if _owning_team_ids is not UNSET: - owning_team_ids = [] - for owning_team_ids_item_data in _owning_team_ids: - owning_team_ids_item = UUID(owning_team_ids_item_data) + for owning_team_ids_item_data in _owning_team_ids or []: + owning_team_ids_item = UUID(owning_team_ids_item_data) - owning_team_ids.append(owning_team_ids_item) + owning_team_ids.append(owning_team_ids_item) + rules = [] _rules = d.pop("rules", UNSET) - rules: list[NewAlertRouteDataAttributesRulesItem] | Unset = UNSET - if _rules is not UNSET: - rules = [] - for rules_item_data in _rules: - rules_item = NewAlertRouteDataAttributesRulesItem.from_dict(rules_item_data) + for rules_item_data in _rules or []: + rules_item = NewAlertRouteDataAttributesRulesItem.from_dict(rules_item_data) - rules.append(rules_item) + rules.append(rules_item) new_alert_route_data_attributes = cls( name=name, diff --git a/rootly_sdk/models/new_alert_route_data_attributes_rules_item.py b/rootly_sdk/models/new_alert_route_data_attributes_rules_item.py index 1c4d8b23..3d9ca0fa 100644 --- a/rootly_sdk/models/new_alert_route_data_attributes_rules_item.py +++ b/rootly_sdk/models/new_alert_route_data_attributes_rules_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -25,21 +23,20 @@ class NewAlertRouteDataAttributesRulesItem: """ Attributes: name (str): The name of the alert routing rule - destinations (list[NewAlertRouteDataAttributesRulesItemDestinationsItem]): - condition_groups (list[NewAlertRouteDataAttributesRulesItemConditionGroupsItem]): - position (int | Unset): The position of the alert routing rule for ordering evaluation - fallback_rule (bool | Unset): Whether this is a fallback rule Default: False. + destinations (list['NewAlertRouteDataAttributesRulesItemDestinationsItem']): + condition_groups (list['NewAlertRouteDataAttributesRulesItemConditionGroupsItem']): + position (Union[Unset, int]): The position of the alert routing rule for ordering evaluation + fallback_rule (Union[Unset, bool]): Whether this is a fallback rule Default: False. """ name: str - destinations: list[NewAlertRouteDataAttributesRulesItemDestinationsItem] - condition_groups: list[NewAlertRouteDataAttributesRulesItemConditionGroupsItem] - position: int | Unset = UNSET - fallback_rule: bool | Unset = False + destinations: list["NewAlertRouteDataAttributesRulesItemDestinationsItem"] + condition_groups: list["NewAlertRouteDataAttributesRulesItemConditionGroupsItem"] + position: Union[Unset, int] = UNSET + fallback_rule: Union[Unset, bool] = False additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - name = self.name destinations = [] diff --git a/rootly_sdk/models/new_alert_route_data_attributes_rules_item_condition_groups_item.py b/rootly_sdk/models/new_alert_route_data_attributes_rules_item_condition_groups_item.py index f5187e45..dfeb1d5f 100644 --- a/rootly_sdk/models/new_alert_route_data_attributes_rules_item_condition_groups_item.py +++ b/rootly_sdk/models/new_alert_route_data_attributes_rules_item_condition_groups_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,16 +19,15 @@ class NewAlertRouteDataAttributesRulesItemConditionGroupsItem: """ Attributes: - conditions (list[NewAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItem]): - position (int | Unset): The position of the condition group + conditions (list['NewAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItem']): + position (Union[Unset, int]): The position of the condition group """ - conditions: list[NewAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItem] - position: int | Unset = UNSET + conditions: list["NewAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItem"] + position: Union[Unset, int] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - conditions = [] for conditions_item_data in self.conditions: conditions_item = conditions_item_data.to_dict() diff --git a/rootly_sdk/models/new_alert_route_data_attributes_rules_item_condition_groups_item_conditions_item.py b/rootly_sdk/models/new_alert_route_data_attributes_rules_item_condition_groups_item_conditions_item.py index 22a91c83..919e1392 100644 --- a/rootly_sdk/models/new_alert_route_data_attributes_rules_item_condition_groups_item_conditions_item.py +++ b/rootly_sdk/models/new_alert_route_data_attributes_rules_item_condition_groups_item_conditions_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from uuid import UUID from attrs import define as _attrs_define @@ -31,27 +29,28 @@ class NewAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItem: property_field_condition_type (NewAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemPropertyFieldConditionType): property_field_type (NewAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemPropertyFieldType): - property_field_name (str | Unset): The name of the property field - property_field_value (None | str | Unset): The value of the property field - property_field_values (list[str] | None | Unset): - alert_urgency_ids (list[str] | None | Unset): The Alert Urgency IDs to check in the condition - conditionable_type (NewAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemConditionableType | - Unset): The type of the conditionable - conditionable_id (None | Unset | UUID): The ID of the conditionable + property_field_name (Union[Unset, str]): The name of the property field + property_field_value (Union[None, Unset, str]): The value of the property field + property_field_values (Union[None, Unset, list[str]]): + alert_urgency_ids (Union[None, Unset, list[str]]): The Alert Urgency IDs to check in the condition + conditionable_type (Union[Unset, + NewAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemConditionableType]): The type of the + conditionable + conditionable_id (Union[None, UUID, Unset]): The ID of the conditionable """ property_field_condition_type: ( NewAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemPropertyFieldConditionType ) property_field_type: NewAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemPropertyFieldType - property_field_name: str | Unset = UNSET - property_field_value: None | str | Unset = UNSET - property_field_values: list[str] | None | Unset = UNSET - alert_urgency_ids: list[str] | None | Unset = UNSET - conditionable_type: ( - NewAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemConditionableType | Unset - ) = UNSET - conditionable_id: None | Unset | UUID = UNSET + property_field_name: Union[Unset, str] = UNSET + property_field_value: Union[None, Unset, str] = UNSET + property_field_values: Union[None, Unset, list[str]] = UNSET + alert_urgency_ids: Union[None, Unset, list[str]] = UNSET + conditionable_type: Union[ + Unset, NewAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemConditionableType + ] = UNSET + conditionable_id: Union[None, UUID, Unset] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -61,13 +60,13 @@ def to_dict(self) -> dict[str, Any]: property_field_name = self.property_field_name - property_field_value: None | str | Unset + property_field_value: Union[None, Unset, str] if isinstance(self.property_field_value, Unset): property_field_value = UNSET else: property_field_value = self.property_field_value - property_field_values: list[str] | None | Unset + property_field_values: Union[None, Unset, list[str]] if isinstance(self.property_field_values, Unset): property_field_values = UNSET elif isinstance(self.property_field_values, list): @@ -76,7 +75,7 @@ def to_dict(self) -> dict[str, Any]: else: property_field_values = self.property_field_values - alert_urgency_ids: list[str] | None | Unset + alert_urgency_ids: Union[None, Unset, list[str]] if isinstance(self.alert_urgency_ids, Unset): alert_urgency_ids = UNSET elif isinstance(self.alert_urgency_ids, list): @@ -85,11 +84,11 @@ def to_dict(self) -> dict[str, Any]: else: alert_urgency_ids = self.alert_urgency_ids - conditionable_type: str | Unset = UNSET + conditionable_type: Union[Unset, str] = UNSET if not isinstance(self.conditionable_type, Unset): conditionable_type = self.conditionable_type - conditionable_id: None | str | Unset + conditionable_id: Union[None, Unset, str] if isinstance(self.conditionable_id, Unset): conditionable_id = UNSET elif isinstance(self.conditionable_id, UUID): @@ -135,16 +134,16 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: property_field_name = d.pop("property_field_name", UNSET) - def _parse_property_field_value(data: object) -> None | str | Unset: + def _parse_property_field_value(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) property_field_value = _parse_property_field_value(d.pop("property_field_value", UNSET)) - def _parse_property_field_values(data: object) -> list[str] | None | Unset: + def _parse_property_field_values(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -155,13 +154,13 @@ def _parse_property_field_values(data: object) -> list[str] | None | Unset: property_field_values_type_0 = cast(list[str], data) return property_field_values_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) property_field_values = _parse_property_field_values(d.pop("property_field_values", UNSET)) - def _parse_alert_urgency_ids(data: object) -> list[str] | None | Unset: + def _parse_alert_urgency_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -172,16 +171,16 @@ def _parse_alert_urgency_ids(data: object) -> list[str] | None | Unset: alert_urgency_ids_type_0 = cast(list[str], data) return alert_urgency_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) alert_urgency_ids = _parse_alert_urgency_ids(d.pop("alert_urgency_ids", UNSET)) _conditionable_type = d.pop("conditionable_type", UNSET) - conditionable_type: ( - NewAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemConditionableType | Unset - ) + conditionable_type: Union[ + Unset, NewAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemConditionableType + ] if isinstance(_conditionable_type, Unset): conditionable_type = UNSET else: @@ -189,7 +188,7 @@ def _parse_alert_urgency_ids(data: object) -> list[str] | None | Unset: _conditionable_type ) - def _parse_conditionable_id(data: object) -> None | Unset | UUID: + def _parse_conditionable_id(data: object) -> Union[None, UUID, Unset]: if data is None: return data if isinstance(data, Unset): @@ -200,9 +199,9 @@ def _parse_conditionable_id(data: object) -> None | Unset | UUID: conditionable_id_type_0 = UUID(data) return conditionable_id_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(None | Unset | UUID, data) + return cast(Union[None, UUID, Unset], data) conditionable_id = _parse_conditionable_id(d.pop("conditionable_id", UNSET)) diff --git a/rootly_sdk/models/new_alert_route_data_attributes_rules_item_destinations_item.py b/rootly_sdk/models/new_alert_route_data_attributes_rules_item_destinations_item.py index 988b84be..177f40d1 100644 --- a/rootly_sdk/models/new_alert_route_data_attributes_rules_item_destinations_item.py +++ b/rootly_sdk/models/new_alert_route_data_attributes_rules_item_destinations_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar from uuid import UUID diff --git a/rootly_sdk/models/new_alert_routing_rule.py b/rootly_sdk/models/new_alert_routing_rule.py index 99586182..2dd1368b 100644 --- a/rootly_sdk/models/new_alert_routing_rule.py +++ b/rootly_sdk/models/new_alert_routing_rule.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewAlertRoutingRule: data (NewAlertRoutingRuleData): """ - data: NewAlertRoutingRuleData + data: "NewAlertRoutingRuleData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_alert_routing_rule_data.py b/rootly_sdk/models/new_alert_routing_rule_data.py index 82389749..038cc9b0 100644 --- a/rootly_sdk/models/new_alert_routing_rule_data.py +++ b/rootly_sdk/models/new_alert_routing_rule_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class NewAlertRoutingRuleData: """ type_: NewAlertRoutingRuleDataType - attributes: NewAlertRoutingRuleDataAttributes + attributes: "NewAlertRoutingRuleDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_alert_routing_rule_data_attributes.py b/rootly_sdk/models/new_alert_routing_rule_data_attributes.py index 2fb376e7..68978b08 100644 --- a/rootly_sdk/models/new_alert_routing_rule_data_attributes.py +++ b/rootly_sdk/models/new_alert_routing_rule_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from uuid import UUID from attrs import define as _attrs_define @@ -29,27 +27,26 @@ class NewAlertRoutingRuleDataAttributes: name (str): The name of the alert routing rule alerts_source_id (UUID): The ID of the alerts source destination (NewAlertRoutingRuleDataAttributesDestination): - enabled (bool | Unset): Whether the alert routing rule is enabled - owning_team_ids (list[UUID] | Unset): The IDs of the teams which own the alert routing rule. If the user doesn't - have Alert Routing Create Permission in On-Call Roles, then this field is required and can contain Team IDs the - user is an admin of. - position (int | Unset): The position of the alert routing rule for ordering evaluation - condition_type (NewAlertRoutingRuleDataAttributesConditionType | Unset): The type of condition for the alert - routing rule - conditions (list[NewAlertRoutingRuleDataAttributesConditionsItem] | Unset): + enabled (Union[Unset, bool]): Whether the alert routing rule is enabled + owning_team_ids (Union[Unset, list[UUID]]): The IDs of the teams which own the alert routing rule. If the user + doesn't have Alert Routing Create Permission in On-Call Roles, then this field is required and can contain Team + IDs the user is an admin of. + position (Union[Unset, int]): The position of the alert routing rule for ordering evaluation + condition_type (Union[Unset, NewAlertRoutingRuleDataAttributesConditionType]): The type of condition for the + alert routing rule + conditions (Union[Unset, list['NewAlertRoutingRuleDataAttributesConditionsItem']]): """ name: str alerts_source_id: UUID - destination: NewAlertRoutingRuleDataAttributesDestination - enabled: bool | Unset = UNSET - owning_team_ids: list[UUID] | Unset = UNSET - position: int | Unset = UNSET - condition_type: NewAlertRoutingRuleDataAttributesConditionType | Unset = UNSET - conditions: list[NewAlertRoutingRuleDataAttributesConditionsItem] | Unset = UNSET + destination: "NewAlertRoutingRuleDataAttributesDestination" + enabled: Union[Unset, bool] = UNSET + owning_team_ids: Union[Unset, list[UUID]] = UNSET + position: Union[Unset, int] = UNSET + condition_type: Union[Unset, NewAlertRoutingRuleDataAttributesConditionType] = UNSET + conditions: Union[Unset, list["NewAlertRoutingRuleDataAttributesConditionsItem"]] = UNSET def to_dict(self) -> dict[str, Any]: - name = self.name alerts_source_id = str(self.alerts_source_id) @@ -58,7 +55,7 @@ def to_dict(self) -> dict[str, Any]: enabled = self.enabled - owning_team_ids: list[str] | Unset = UNSET + owning_team_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.owning_team_ids, Unset): owning_team_ids = [] for owning_team_ids_item_data in self.owning_team_ids: @@ -67,11 +64,11 @@ def to_dict(self) -> dict[str, Any]: position = self.position - condition_type: str | Unset = UNSET + condition_type: Union[Unset, str] = UNSET if not isinstance(self.condition_type, Unset): condition_type = self.condition_type - conditions: list[dict[str, Any]] | Unset = UNSET + conditions: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.conditions, Unset): conditions = [] for conditions_item_data in self.conditions: @@ -118,32 +115,28 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: enabled = d.pop("enabled", UNSET) + owning_team_ids = [] _owning_team_ids = d.pop("owning_team_ids", UNSET) - owning_team_ids: list[UUID] | Unset = UNSET - if _owning_team_ids is not UNSET: - owning_team_ids = [] - for owning_team_ids_item_data in _owning_team_ids: - owning_team_ids_item = UUID(owning_team_ids_item_data) + for owning_team_ids_item_data in _owning_team_ids or []: + owning_team_ids_item = UUID(owning_team_ids_item_data) - owning_team_ids.append(owning_team_ids_item) + owning_team_ids.append(owning_team_ids_item) position = d.pop("position", UNSET) _condition_type = d.pop("condition_type", UNSET) - condition_type: NewAlertRoutingRuleDataAttributesConditionType | Unset + condition_type: Union[Unset, NewAlertRoutingRuleDataAttributesConditionType] if isinstance(_condition_type, Unset): condition_type = UNSET else: condition_type = check_new_alert_routing_rule_data_attributes_condition_type(_condition_type) + conditions = [] _conditions = d.pop("conditions", UNSET) - conditions: list[NewAlertRoutingRuleDataAttributesConditionsItem] | Unset = UNSET - if _conditions is not UNSET: - conditions = [] - for conditions_item_data in _conditions: - conditions_item = NewAlertRoutingRuleDataAttributesConditionsItem.from_dict(conditions_item_data) + for conditions_item_data in _conditions or []: + conditions_item = NewAlertRoutingRuleDataAttributesConditionsItem.from_dict(conditions_item_data) - conditions.append(conditions_item) + conditions.append(conditions_item) new_alert_routing_rule_data_attributes = cls( name=name, diff --git a/rootly_sdk/models/new_alert_routing_rule_data_attributes_conditions_item.py b/rootly_sdk/models/new_alert_routing_rule_data_attributes_conditions_item.py index 8d4358b9..f91fa1c5 100644 --- a/rootly_sdk/models/new_alert_routing_rule_data_attributes_conditions_item.py +++ b/rootly_sdk/models/new_alert_routing_rule_data_attributes_conditions_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -31,17 +29,18 @@ class NewAlertRoutingRuleDataAttributesConditionsItem: field name should be supplied in JSON Path syntax. property_field_condition_type (NewAlertRoutingRuleDataAttributesConditionsItemPropertyFieldConditionType): The condition type of the property field - property_field_value (str | Unset): The value of the property field. Can be null if the property field condition - type is 'is_one_of' or 'is_not_one_of' - property_field_values (list[str] | Unset): The values of the property field. Need to be passed if the property - field condition type is 'is_one_of' or 'is_not_one_of' except for when property field name is 'alert_urgency' + property_field_value (Union[Unset, str]): The value of the property field. Can be null if the property field + condition type is 'is_one_of' or 'is_not_one_of' + property_field_values (Union[Unset, list[str]]): The values of the property field. Need to be passed if the + property field condition type is 'is_one_of' or 'is_not_one_of' except for when property field name is + 'alert_urgency' """ property_field_type: NewAlertRoutingRuleDataAttributesConditionsItemPropertyFieldType property_field_name: str property_field_condition_type: NewAlertRoutingRuleDataAttributesConditionsItemPropertyFieldConditionType - property_field_value: str | Unset = UNSET - property_field_values: list[str] | Unset = UNSET + property_field_value: Union[Unset, str] = UNSET + property_field_values: Union[Unset, list[str]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -53,7 +52,7 @@ def to_dict(self) -> dict[str, Any]: property_field_value = self.property_field_value - property_field_values: list[str] | Unset = UNSET + property_field_values: Union[Unset, list[str]] = UNSET if not isinstance(self.property_field_values, Unset): property_field_values = self.property_field_values diff --git a/rootly_sdk/models/new_alert_routing_rule_data_attributes_destination.py b/rootly_sdk/models/new_alert_routing_rule_data_attributes_destination.py index 09bebab5..9226af15 100644 --- a/rootly_sdk/models/new_alert_routing_rule_data_attributes_destination.py +++ b/rootly_sdk/models/new_alert_routing_rule_data_attributes_destination.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar from uuid import UUID diff --git a/rootly_sdk/models/new_alert_urgency.py b/rootly_sdk/models/new_alert_urgency.py index bb1f20c0..0e0e8d79 100644 --- a/rootly_sdk/models/new_alert_urgency.py +++ b/rootly_sdk/models/new_alert_urgency.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewAlertUrgency: data (NewAlertUrgencyData): """ - data: NewAlertUrgencyData + data: "NewAlertUrgencyData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_alert_urgency_data.py b/rootly_sdk/models/new_alert_urgency_data.py index bfef8677..345905e1 100644 --- a/rootly_sdk/models/new_alert_urgency_data.py +++ b/rootly_sdk/models/new_alert_urgency_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class NewAlertUrgencyData: """ type_: NewAlertUrgencyDataType - attributes: NewAlertUrgencyDataAttributes + attributes: "NewAlertUrgencyDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_alert_urgency_data_attributes.py b/rootly_sdk/models/new_alert_urgency_data_attributes.py index 9a51775d..acf399da 100644 --- a/rootly_sdk/models/new_alert_urgency_data_attributes.py +++ b/rootly_sdk/models/new_alert_urgency_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -16,24 +14,33 @@ class NewAlertUrgencyDataAttributes: Attributes: name (str): The name of the alert urgency description (str): The description of the alert urgency - position (int | None | Unset): Position of the alert urgency + position (Union[None, Unset, int]): Position of the alert urgency + retrigger_timeout_minutes (Union[None, Unset, int]): Re-trigger acknowledged alerts of this urgency after N + minutes; null inherits the workspace default, negative = never. """ name: str description: str - position: int | None | Unset = UNSET + position: Union[None, Unset, int] = UNSET + retrigger_timeout_minutes: Union[None, Unset, int] = UNSET def to_dict(self) -> dict[str, Any]: name = self.name description = self.description - position: int | None | Unset + position: Union[None, Unset, int] if isinstance(self.position, Unset): position = UNSET else: position = self.position + retrigger_timeout_minutes: Union[None, Unset, int] + if isinstance(self.retrigger_timeout_minutes, Unset): + retrigger_timeout_minutes = UNSET + else: + retrigger_timeout_minutes = self.retrigger_timeout_minutes + field_dict: dict[str, Any] = {} field_dict.update( @@ -44,6 +51,8 @@ def to_dict(self) -> dict[str, Any]: ) if position is not UNSET: field_dict["position"] = position + if retrigger_timeout_minutes is not UNSET: + field_dict["retrigger_timeout_minutes"] = retrigger_timeout_minutes return field_dict @@ -54,19 +63,29 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: description = d.pop("description") - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> Union[None, Unset, int]: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(Union[None, Unset, int], data) position = _parse_position(d.pop("position", UNSET)) + def _parse_retrigger_timeout_minutes(data: object) -> Union[None, Unset, int]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, int], data) + + retrigger_timeout_minutes = _parse_retrigger_timeout_minutes(d.pop("retrigger_timeout_minutes", UNSET)) + new_alert_urgency_data_attributes = cls( name=name, description=description, position=position, + retrigger_timeout_minutes=retrigger_timeout_minutes, ) return new_alert_urgency_data_attributes diff --git a/rootly_sdk/models/new_alerts_source.py b/rootly_sdk/models/new_alerts_source.py index f40df906..ecb9f870 100644 --- a/rootly_sdk/models/new_alerts_source.py +++ b/rootly_sdk/models/new_alerts_source.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewAlertsSource: data (NewAlertsSourceData): """ - data: NewAlertsSourceData + data: "NewAlertsSourceData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_alerts_source_data.py b/rootly_sdk/models/new_alerts_source_data.py index f5d4b12e..ab42b780 100644 --- a/rootly_sdk/models/new_alerts_source_data.py +++ b/rootly_sdk/models/new_alerts_source_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class NewAlertsSourceData: """ type_: NewAlertsSourceDataType - attributes: NewAlertsSourceDataAttributes + attributes: "NewAlertsSourceDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_alerts_source_data_attributes.py b/rootly_sdk/models/new_alerts_source_data_attributes.py index 1cec926d..12be6991 100644 --- a/rootly_sdk/models/new_alerts_source_data_attributes.py +++ b/rootly_sdk/models/new_alerts_source_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -41,46 +39,52 @@ class NewAlertsSourceDataAttributes: """ Attributes: name (str): The name of the alert source - enabled (bool | Unset): Whether the alert source is enabled. Disabled sources do not create alerts from incoming - events. - source_type (NewAlertsSourceDataAttributesSourceType | Unset): The alert source type - alert_urgency_id (str | Unset): ID for the default alert urgency assigned to this alert source - deduplicate_alerts_by_key (bool | Unset): Toggle alert deduplication using deduplication key. If enabled, + enabled (Union[Unset, bool]): Whether the alert source is enabled. Disabled sources do not create alerts from + incoming events. + source_type (Union[Unset, NewAlertsSourceDataAttributesSourceType]): The alert source type + alert_urgency_id (Union[Unset, str]): ID for the default alert urgency assigned to this alert source + deduplicate_alerts_by_key (Union[Unset, bool]): Toggle alert deduplication using deduplication key. If enabled, deduplication_key_kind and deduplication_key_path are required. - deduplication_key_kind (NewAlertsSourceDataAttributesDeduplicationKeyKind | Unset): Kind of deduplication key. - deduplication_key_path (None | str | Unset): Path to deduplication key. This is a JSON Path to extract the + deduplication_key_kind (Union[Unset, NewAlertsSourceDataAttributesDeduplicationKeyKind]): Kind of deduplication + key. + deduplication_key_path (Union[None, Unset, str]): Path to deduplication key. This is a JSON Path to extract the deduplication key from the request body. - deduplication_key_regexp (None | str | Unset): Regular expression to extract key from value found at key path. - owner_group_ids (list[str] | Unset): List of team IDs that will own the alert source - alert_template_attributes (NewAlertsSourceDataAttributesAlertTemplateAttributesType0 | None | Unset): - alert_source_urgency_rules_attributes (list[NewAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItem] - | Unset): List of rules that define the conditions under which the alert urgency will be set automatically based - on the alert payload - sourceable_attributes (NewAlertsSourceDataAttributesSourceableAttributesType0 | None | Unset): Provide - additional attributes for generic_webhook alerts source - resolution_rule_attributes (NewAlertsSourceDataAttributesResolutionRuleAttributesType0 | None | Unset): Provide - additional attributes for email alerts source - alert_source_fields_attributes (list[NewAlertsSourceDataAttributesAlertSourceFieldsAttributesItem] | Unset): - List of alert fields to be added to the alert source. Note: This attribute requires the alert field feature to - be enabled on your account. Contact Rootly customer support if you need assistance with this feature. + deduplication_key_regexp (Union[None, Unset, str]): Regular expression to extract key from value found at key + path. + owner_group_ids (Union[Unset, list[str]]): List of team IDs that will own the alert source + alert_template_attributes (Union['NewAlertsSourceDataAttributesAlertTemplateAttributesType0', None, Unset]): + alert_source_urgency_rules_attributes (Union[Unset, + list['NewAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItem']]): List of rules that define the + conditions under which the alert urgency will be set automatically based on the alert payload + sourceable_attributes (Union['NewAlertsSourceDataAttributesSourceableAttributesType0', None, Unset]): Provide + additional attributes for the underlying source. `auto_resolve`, `resolve_state` and `field_mappings_attributes` + apply to generic_webhook sources; `accept_threaded_emails` applies to email sources. + resolution_rule_attributes (Union['NewAlertsSourceDataAttributesResolutionRuleAttributesType0', None, Unset]): + Provide additional attributes for email alerts source + alert_source_fields_attributes (Union[Unset, + list['NewAlertsSourceDataAttributesAlertSourceFieldsAttributesItem']]): List of alert fields to be added to the + alert source. Note: This attribute requires the alert field feature to be enabled on your account. Contact + Rootly customer support if you need assistance with this feature. """ name: str - enabled: bool | Unset = UNSET - source_type: NewAlertsSourceDataAttributesSourceType | Unset = UNSET - alert_urgency_id: str | Unset = UNSET - deduplicate_alerts_by_key: bool | Unset = UNSET - deduplication_key_kind: NewAlertsSourceDataAttributesDeduplicationKeyKind | Unset = UNSET - deduplication_key_path: None | str | Unset = UNSET - deduplication_key_regexp: None | str | Unset = UNSET - owner_group_ids: list[str] | Unset = UNSET - alert_template_attributes: NewAlertsSourceDataAttributesAlertTemplateAttributesType0 | None | Unset = UNSET - alert_source_urgency_rules_attributes: ( - list[NewAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItem] | Unset - ) = UNSET - sourceable_attributes: NewAlertsSourceDataAttributesSourceableAttributesType0 | None | Unset = UNSET - resolution_rule_attributes: NewAlertsSourceDataAttributesResolutionRuleAttributesType0 | None | Unset = UNSET - alert_source_fields_attributes: list[NewAlertsSourceDataAttributesAlertSourceFieldsAttributesItem] | Unset = UNSET + enabled: Union[Unset, bool] = UNSET + source_type: Union[Unset, NewAlertsSourceDataAttributesSourceType] = UNSET + alert_urgency_id: Union[Unset, str] = UNSET + deduplicate_alerts_by_key: Union[Unset, bool] = UNSET + deduplication_key_kind: Union[Unset, NewAlertsSourceDataAttributesDeduplicationKeyKind] = UNSET + deduplication_key_path: Union[None, Unset, str] = UNSET + deduplication_key_regexp: Union[None, Unset, str] = UNSET + owner_group_ids: Union[Unset, list[str]] = UNSET + alert_template_attributes: Union["NewAlertsSourceDataAttributesAlertTemplateAttributesType0", None, Unset] = UNSET + alert_source_urgency_rules_attributes: Union[ + Unset, list["NewAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItem"] + ] = UNSET + sourceable_attributes: Union["NewAlertsSourceDataAttributesSourceableAttributesType0", None, Unset] = UNSET + resolution_rule_attributes: Union["NewAlertsSourceDataAttributesResolutionRuleAttributesType0", None, Unset] = UNSET + alert_source_fields_attributes: Union[ + Unset, list["NewAlertsSourceDataAttributesAlertSourceFieldsAttributesItem"] + ] = UNSET def to_dict(self) -> dict[str, Any]: from ..models.new_alerts_source_data_attributes_alert_template_attributes_type_0 import ( @@ -97,7 +101,7 @@ def to_dict(self) -> dict[str, Any]: enabled = self.enabled - source_type: str | Unset = UNSET + source_type: Union[Unset, str] = UNSET if not isinstance(self.source_type, Unset): source_type = self.source_type @@ -105,27 +109,27 @@ def to_dict(self) -> dict[str, Any]: deduplicate_alerts_by_key = self.deduplicate_alerts_by_key - deduplication_key_kind: str | Unset = UNSET + deduplication_key_kind: Union[Unset, str] = UNSET if not isinstance(self.deduplication_key_kind, Unset): deduplication_key_kind = self.deduplication_key_kind - deduplication_key_path: None | str | Unset + deduplication_key_path: Union[None, Unset, str] if isinstance(self.deduplication_key_path, Unset): deduplication_key_path = UNSET else: deduplication_key_path = self.deduplication_key_path - deduplication_key_regexp: None | str | Unset + deduplication_key_regexp: Union[None, Unset, str] if isinstance(self.deduplication_key_regexp, Unset): deduplication_key_regexp = UNSET else: deduplication_key_regexp = self.deduplication_key_regexp - owner_group_ids: list[str] | Unset = UNSET + owner_group_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.owner_group_ids, Unset): owner_group_ids = self.owner_group_ids - alert_template_attributes: dict[str, Any] | None | Unset + alert_template_attributes: Union[None, Unset, dict[str, Any]] if isinstance(self.alert_template_attributes, Unset): alert_template_attributes = UNSET elif isinstance(self.alert_template_attributes, NewAlertsSourceDataAttributesAlertTemplateAttributesType0): @@ -133,14 +137,14 @@ def to_dict(self) -> dict[str, Any]: else: alert_template_attributes = self.alert_template_attributes - alert_source_urgency_rules_attributes: list[dict[str, Any]] | Unset = UNSET + alert_source_urgency_rules_attributes: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.alert_source_urgency_rules_attributes, Unset): alert_source_urgency_rules_attributes = [] for alert_source_urgency_rules_attributes_item_data in self.alert_source_urgency_rules_attributes: alert_source_urgency_rules_attributes_item = alert_source_urgency_rules_attributes_item_data.to_dict() alert_source_urgency_rules_attributes.append(alert_source_urgency_rules_attributes_item) - sourceable_attributes: dict[str, Any] | None | Unset + sourceable_attributes: Union[None, Unset, dict[str, Any]] if isinstance(self.sourceable_attributes, Unset): sourceable_attributes = UNSET elif isinstance(self.sourceable_attributes, NewAlertsSourceDataAttributesSourceableAttributesType0): @@ -148,7 +152,7 @@ def to_dict(self) -> dict[str, Any]: else: sourceable_attributes = self.sourceable_attributes - resolution_rule_attributes: dict[str, Any] | None | Unset + resolution_rule_attributes: Union[None, Unset, dict[str, Any]] if isinstance(self.resolution_rule_attributes, Unset): resolution_rule_attributes = UNSET elif isinstance(self.resolution_rule_attributes, NewAlertsSourceDataAttributesResolutionRuleAttributesType0): @@ -156,7 +160,7 @@ def to_dict(self) -> dict[str, Any]: else: resolution_rule_attributes = self.resolution_rule_attributes - alert_source_fields_attributes: list[dict[str, Any]] | Unset = UNSET + alert_source_fields_attributes: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.alert_source_fields_attributes, Unset): alert_source_fields_attributes = [] for alert_source_fields_attributes_item_data in self.alert_source_fields_attributes: @@ -223,7 +227,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: enabled = d.pop("enabled", UNSET) _source_type = d.pop("source_type", UNSET) - source_type: NewAlertsSourceDataAttributesSourceType | Unset + source_type: Union[Unset, NewAlertsSourceDataAttributesSourceType] if isinstance(_source_type, Unset): source_type = UNSET else: @@ -234,7 +238,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: deduplicate_alerts_by_key = d.pop("deduplicate_alerts_by_key", UNSET) _deduplication_key_kind = d.pop("deduplication_key_kind", UNSET) - deduplication_key_kind: NewAlertsSourceDataAttributesDeduplicationKeyKind | Unset + deduplication_key_kind: Union[Unset, NewAlertsSourceDataAttributesDeduplicationKeyKind] if isinstance(_deduplication_key_kind, Unset): deduplication_key_kind = UNSET else: @@ -242,21 +246,21 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: _deduplication_key_kind ) - def _parse_deduplication_key_path(data: object) -> None | str | Unset: + def _parse_deduplication_key_path(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) deduplication_key_path = _parse_deduplication_key_path(d.pop("deduplication_key_path", UNSET)) - def _parse_deduplication_key_regexp(data: object) -> None | str | Unset: + def _parse_deduplication_key_regexp(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) deduplication_key_regexp = _parse_deduplication_key_regexp(d.pop("deduplication_key_regexp", UNSET)) @@ -264,7 +268,7 @@ def _parse_deduplication_key_regexp(data: object) -> None | str | Unset: def _parse_alert_template_attributes( data: object, - ) -> NewAlertsSourceDataAttributesAlertTemplateAttributesType0 | None | Unset: + ) -> Union["NewAlertsSourceDataAttributesAlertTemplateAttributesType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -277,30 +281,26 @@ def _parse_alert_template_attributes( ) return alert_template_attributes_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(NewAlertsSourceDataAttributesAlertTemplateAttributesType0 | None | Unset, data) + return cast(Union["NewAlertsSourceDataAttributesAlertTemplateAttributesType0", None, Unset], data) alert_template_attributes = _parse_alert_template_attributes(d.pop("alert_template_attributes", UNSET)) + alert_source_urgency_rules_attributes = [] _alert_source_urgency_rules_attributes = d.pop("alert_source_urgency_rules_attributes", UNSET) - alert_source_urgency_rules_attributes: ( - list[NewAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItem] | Unset - ) = UNSET - if _alert_source_urgency_rules_attributes is not UNSET: - alert_source_urgency_rules_attributes = [] - for alert_source_urgency_rules_attributes_item_data in _alert_source_urgency_rules_attributes: - alert_source_urgency_rules_attributes_item = ( - NewAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItem.from_dict( - alert_source_urgency_rules_attributes_item_data - ) + for alert_source_urgency_rules_attributes_item_data in _alert_source_urgency_rules_attributes or []: + alert_source_urgency_rules_attributes_item = ( + NewAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItem.from_dict( + alert_source_urgency_rules_attributes_item_data ) + ) - alert_source_urgency_rules_attributes.append(alert_source_urgency_rules_attributes_item) + alert_source_urgency_rules_attributes.append(alert_source_urgency_rules_attributes_item) def _parse_sourceable_attributes( data: object, - ) -> NewAlertsSourceDataAttributesSourceableAttributesType0 | None | Unset: + ) -> Union["NewAlertsSourceDataAttributesSourceableAttributesType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -311,15 +311,15 @@ def _parse_sourceable_attributes( sourceable_attributes_type_0 = NewAlertsSourceDataAttributesSourceableAttributesType0.from_dict(data) return sourceable_attributes_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(NewAlertsSourceDataAttributesSourceableAttributesType0 | None | Unset, data) + return cast(Union["NewAlertsSourceDataAttributesSourceableAttributesType0", None, Unset], data) sourceable_attributes = _parse_sourceable_attributes(d.pop("sourceable_attributes", UNSET)) def _parse_resolution_rule_attributes( data: object, - ) -> NewAlertsSourceDataAttributesResolutionRuleAttributesType0 | None | Unset: + ) -> Union["NewAlertsSourceDataAttributesResolutionRuleAttributesType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -332,26 +332,22 @@ def _parse_resolution_rule_attributes( ) return resolution_rule_attributes_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(NewAlertsSourceDataAttributesResolutionRuleAttributesType0 | None | Unset, data) + return cast(Union["NewAlertsSourceDataAttributesResolutionRuleAttributesType0", None, Unset], data) resolution_rule_attributes = _parse_resolution_rule_attributes(d.pop("resolution_rule_attributes", UNSET)) + alert_source_fields_attributes = [] _alert_source_fields_attributes = d.pop("alert_source_fields_attributes", UNSET) - alert_source_fields_attributes: list[NewAlertsSourceDataAttributesAlertSourceFieldsAttributesItem] | Unset = ( - UNSET - ) - if _alert_source_fields_attributes is not UNSET: - alert_source_fields_attributes = [] - for alert_source_fields_attributes_item_data in _alert_source_fields_attributes: - alert_source_fields_attributes_item = ( - NewAlertsSourceDataAttributesAlertSourceFieldsAttributesItem.from_dict( - alert_source_fields_attributes_item_data - ) + for alert_source_fields_attributes_item_data in _alert_source_fields_attributes or []: + alert_source_fields_attributes_item = ( + NewAlertsSourceDataAttributesAlertSourceFieldsAttributesItem.from_dict( + alert_source_fields_attributes_item_data ) + ) - alert_source_fields_attributes.append(alert_source_fields_attributes_item) + alert_source_fields_attributes.append(alert_source_fields_attributes_item) new_alerts_source_data_attributes = cls( name=name, diff --git a/rootly_sdk/models/new_alerts_source_data_attributes_alert_source_fields_attributes_item.py b/rootly_sdk/models/new_alerts_source_data_attributes_alert_source_fields_attributes_item.py index 7b99100f..ebf68c2b 100644 --- a/rootly_sdk/models/new_alerts_source_data_attributes_alert_source_fields_attributes_item.py +++ b/rootly_sdk/models/new_alerts_source_data_attributes_alert_source_fields_attributes_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,19 +13,19 @@ class NewAlertsSourceDataAttributesAlertSourceFieldsAttributesItem: """ Attributes: - alert_field_id (str | Unset): The ID of the alert field - template_body (None | str | Unset): Liquid expression to extract a specific value from the alert's payload for - evaluation + alert_field_id (Union[Unset, str]): The ID of the alert field + template_body (Union[None, Unset, str]): Liquid expression to extract a specific value from the alert's payload + for evaluation """ - alert_field_id: str | Unset = UNSET - template_body: None | str | Unset = UNSET + alert_field_id: Union[Unset, str] = UNSET + template_body: Union[None, Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: alert_field_id = self.alert_field_id - template_body: None | str | Unset + template_body: Union[None, Unset, str] if isinstance(self.template_body, Unset): template_body = UNSET else: @@ -48,12 +46,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) alert_field_id = d.pop("alert_field_id", UNSET) - def _parse_template_body(data: object) -> None | str | Unset: + def _parse_template_body(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) template_body = _parse_template_body(d.pop("template_body", UNSET)) diff --git a/rootly_sdk/models/new_alerts_source_data_attributes_alert_source_urgency_rules_attributes_item.py b/rootly_sdk/models/new_alerts_source_data_attributes_alert_source_urgency_rules_attributes_item.py index a410af64..761b4fe4 100644 --- a/rootly_sdk/models/new_alerts_source_data_attributes_alert_source_urgency_rules_attributes_item.py +++ b/rootly_sdk/models/new_alerts_source_data_attributes_alert_source_urgency_rules_attributes_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -27,56 +25,57 @@ class NewAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItem: """ Attributes: - json_path (None | str | Unset): JSON path expression to extract a specific value from the alert's payload for - evaluation - operator (NewAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemOperator | Unset): Comparison + json_path (Union[None, Unset, str]): JSON path expression to extract a specific value from the alert's payload + for evaluation + operator (Union[Unset, NewAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemOperator]): Comparison operator used to evaluate the extracted value against the specified condition - value (str | Unset): Value that the extracted payload data is compared to using the specified operator to + value (Union[Unset, str]): Value that the extracted payload data is compared to using the specified operator to determine a match - conditionable_type (NewAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemConditionableType | - Unset): The type of the conditionable - conditionable_id (None | str | Unset): The ID of the conditionable. If conditionable_type is AlertField, this is - the ID of the alert field. - kind (NewAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemKind | Unset): The kind of the + conditionable_type (Union[Unset, + NewAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemConditionableType]): The type of the + conditionable + conditionable_id (Union[None, Unset, str]): The ID of the conditionable. If conditionable_type is AlertField, + this is the ID of the alert field. + kind (Union[Unset, NewAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemKind]): The kind of the conditionable - alert_urgency_id (str | Unset): The ID of the alert urgency + alert_urgency_id (Union[Unset, str]): The ID of the alert urgency """ - json_path: None | str | Unset = UNSET - operator: NewAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemOperator | Unset = UNSET - value: str | Unset = UNSET - conditionable_type: NewAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemConditionableType | Unset = ( - UNSET - ) - conditionable_id: None | str | Unset = UNSET - kind: NewAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemKind | Unset = UNSET - alert_urgency_id: str | Unset = UNSET + json_path: Union[None, Unset, str] = UNSET + operator: Union[Unset, NewAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemOperator] = UNSET + value: Union[Unset, str] = UNSET + conditionable_type: Union[ + Unset, NewAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemConditionableType + ] = UNSET + conditionable_id: Union[None, Unset, str] = UNSET + kind: Union[Unset, NewAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemKind] = UNSET + alert_urgency_id: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - json_path: None | str | Unset + json_path: Union[None, Unset, str] if isinstance(self.json_path, Unset): json_path = UNSET else: json_path = self.json_path - operator: str | Unset = UNSET + operator: Union[Unset, str] = UNSET if not isinstance(self.operator, Unset): operator = self.operator value = self.value - conditionable_type: str | Unset = UNSET + conditionable_type: Union[Unset, str] = UNSET if not isinstance(self.conditionable_type, Unset): conditionable_type = self.conditionable_type - conditionable_id: None | str | Unset + conditionable_id: Union[None, Unset, str] if isinstance(self.conditionable_id, Unset): conditionable_id = UNSET else: conditionable_id = self.conditionable_id - kind: str | Unset = UNSET + kind: Union[Unset, str] = UNSET if not isinstance(self.kind, Unset): kind = self.kind @@ -106,17 +105,17 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_json_path(data: object) -> None | str | Unset: + def _parse_json_path(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) json_path = _parse_json_path(d.pop("json_path", UNSET)) _operator = d.pop("operator", UNSET) - operator: NewAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemOperator | Unset + operator: Union[Unset, NewAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemOperator] if isinstance(_operator, Unset): operator = UNSET else: @@ -127,7 +126,9 @@ def _parse_json_path(data: object) -> None | str | Unset: value = d.pop("value", UNSET) _conditionable_type = d.pop("conditionable_type", UNSET) - conditionable_type: NewAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemConditionableType | Unset + conditionable_type: Union[ + Unset, NewAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemConditionableType + ] if isinstance(_conditionable_type, Unset): conditionable_type = UNSET else: @@ -137,17 +138,17 @@ def _parse_json_path(data: object) -> None | str | Unset: ) ) - def _parse_conditionable_id(data: object) -> None | str | Unset: + def _parse_conditionable_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) conditionable_id = _parse_conditionable_id(d.pop("conditionable_id", UNSET)) _kind = d.pop("kind", UNSET) - kind: NewAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemKind | Unset + kind: Union[Unset, NewAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemKind] if isinstance(_kind, Unset): kind = UNSET else: diff --git a/rootly_sdk/models/new_alerts_source_data_attributes_alert_template_attributes_type_0.py b/rootly_sdk/models/new_alerts_source_data_attributes_alert_template_attributes_type_0.py index 7d672082..84b8f1f6 100644 --- a/rootly_sdk/models/new_alerts_source_data_attributes_alert_template_attributes_type_0.py +++ b/rootly_sdk/models/new_alerts_source_data_attributes_alert_template_attributes_type_0.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,30 +13,30 @@ class NewAlertsSourceDataAttributesAlertTemplateAttributesType0: """ Attributes: - title (None | str | Unset): The alert title. - description (None | str | Unset): The alert description. - external_url (None | str | Unset): The alert URL. + title (Union[None, Unset, str]): The alert title. + description (Union[None, Unset, str]): The alert description. + external_url (Union[None, Unset, str]): The alert URL. """ - title: None | str | Unset = UNSET - description: None | str | Unset = UNSET - external_url: None | str | Unset = UNSET + title: Union[None, Unset, str] = UNSET + description: Union[None, Unset, str] = UNSET + external_url: Union[None, Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - title: None | str | Unset + title: Union[None, Unset, str] if isinstance(self.title, Unset): title = UNSET else: title = self.title - description: None | str | Unset + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: description = self.description - external_url: None | str | Unset + external_url: Union[None, Unset, str] if isinstance(self.external_url, Unset): external_url = UNSET else: @@ -60,30 +58,30 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_title(data: object) -> None | str | Unset: + def _parse_title(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) title = _parse_title(d.pop("title", UNSET)) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) - def _parse_external_url(data: object) -> None | str | Unset: + def _parse_external_url(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) external_url = _parse_external_url(d.pop("external_url", UNSET)) diff --git a/rootly_sdk/models/new_alerts_source_data_attributes_resolution_rule_attributes_type_0.py b/rootly_sdk/models/new_alerts_source_data_attributes_resolution_rule_attributes_type_0.py index 7af8435b..e16dba6a 100644 --- a/rootly_sdk/models/new_alerts_source_data_attributes_resolution_rule_attributes_type_0.py +++ b/rootly_sdk/models/new_alerts_source_data_attributes_resolution_rule_attributes_type_0.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -34,74 +32,76 @@ class NewAlertsSourceDataAttributesResolutionRuleAttributesType0: """Provide additional attributes for email alerts source Attributes: - enabled (bool | Unset): Set this to true to enable the auto resolution rule - condition_type (NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionType | Unset): The type of - condition to evaluate to apply auto resolution rule - identifier_matchable_type (NewAlertsSourceDataAttributesResolutionRuleAttributesType0IdentifierMatchableType | - Unset): The type of the identifier matchable - identifier_matchable_id (None | str | Unset): The ID of the identifier matchable. If identifier_matchable_type - is AlertField, this is the ID of the alert field. - identifier_reference_kind (NewAlertsSourceDataAttributesResolutionRuleAttributesType0IdentifierReferenceKind | - Unset): The kind of the identifier reference - identifier_json_path (None | str | Unset): JSON path expression to extract unique alert identifier used to match - triggered alerts with resolving alerts - identifier_value_regex (None | str | Unset): Regex group to further specify the part of the string used as a - unique identifier - conditions_attributes (list[NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItem] - | Unset): List of conditions to evaluate for auto resolution + enabled (Union[Unset, bool]): Set this to true to enable the auto resolution rule + condition_type (Union[Unset, NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionType]): The type + of condition to evaluate to apply auto resolution rule + identifier_matchable_type (Union[Unset, + NewAlertsSourceDataAttributesResolutionRuleAttributesType0IdentifierMatchableType]): The type of the identifier + matchable + identifier_matchable_id (Union[None, Unset, str]): The ID of the identifier matchable. If + identifier_matchable_type is AlertField, this is the ID of the alert field. + identifier_reference_kind (Union[Unset, + NewAlertsSourceDataAttributesResolutionRuleAttributesType0IdentifierReferenceKind]): The kind of the identifier + reference + identifier_json_path (Union[None, Unset, str]): JSON path expression to extract unique alert identifier used to + match triggered alerts with resolving alerts + identifier_value_regex (Union[None, Unset, str]): Regex group to further specify the part of the string used as + a unique identifier + conditions_attributes (Union[Unset, + list['NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItem']]): List of conditions + to evaluate for auto resolution """ - enabled: bool | Unset = UNSET - condition_type: NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionType | Unset = UNSET - identifier_matchable_type: ( - NewAlertsSourceDataAttributesResolutionRuleAttributesType0IdentifierMatchableType | Unset - ) = UNSET - identifier_matchable_id: None | str | Unset = UNSET - identifier_reference_kind: ( - NewAlertsSourceDataAttributesResolutionRuleAttributesType0IdentifierReferenceKind | Unset - ) = UNSET - identifier_json_path: None | str | Unset = UNSET - identifier_value_regex: None | str | Unset = UNSET - conditions_attributes: ( - list[NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItem] | Unset - ) = UNSET + enabled: Union[Unset, bool] = UNSET + condition_type: Union[Unset, NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionType] = UNSET + identifier_matchable_type: Union[ + Unset, NewAlertsSourceDataAttributesResolutionRuleAttributesType0IdentifierMatchableType + ] = UNSET + identifier_matchable_id: Union[None, Unset, str] = UNSET + identifier_reference_kind: Union[ + Unset, NewAlertsSourceDataAttributesResolutionRuleAttributesType0IdentifierReferenceKind + ] = UNSET + identifier_json_path: Union[None, Unset, str] = UNSET + identifier_value_regex: Union[None, Unset, str] = UNSET + conditions_attributes: Union[ + Unset, list["NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItem"] + ] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - enabled = self.enabled - condition_type: str | Unset = UNSET + condition_type: Union[Unset, str] = UNSET if not isinstance(self.condition_type, Unset): condition_type = self.condition_type - identifier_matchable_type: str | Unset = UNSET + identifier_matchable_type: Union[Unset, str] = UNSET if not isinstance(self.identifier_matchable_type, Unset): identifier_matchable_type = self.identifier_matchable_type - identifier_matchable_id: None | str | Unset + identifier_matchable_id: Union[None, Unset, str] if isinstance(self.identifier_matchable_id, Unset): identifier_matchable_id = UNSET else: identifier_matchable_id = self.identifier_matchable_id - identifier_reference_kind: str | Unset = UNSET + identifier_reference_kind: Union[Unset, str] = UNSET if not isinstance(self.identifier_reference_kind, Unset): identifier_reference_kind = self.identifier_reference_kind - identifier_json_path: None | str | Unset + identifier_json_path: Union[None, Unset, str] if isinstance(self.identifier_json_path, Unset): identifier_json_path = UNSET else: identifier_json_path = self.identifier_json_path - identifier_value_regex: None | str | Unset + identifier_value_regex: Union[None, Unset, str] if isinstance(self.identifier_value_regex, Unset): identifier_value_regex = UNSET else: identifier_value_regex = self.identifier_value_regex - conditions_attributes: list[dict[str, Any]] | Unset = UNSET + conditions_attributes: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.conditions_attributes, Unset): conditions_attributes = [] for conditions_attributes_item_data in self.conditions_attributes: @@ -140,7 +140,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: enabled = d.pop("enabled", UNSET) _condition_type = d.pop("condition_type", UNSET) - condition_type: NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionType | Unset + condition_type: Union[Unset, NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionType] if isinstance(_condition_type, Unset): condition_type = UNSET else: @@ -149,9 +149,9 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: ) _identifier_matchable_type = d.pop("identifier_matchable_type", UNSET) - identifier_matchable_type: ( - NewAlertsSourceDataAttributesResolutionRuleAttributesType0IdentifierMatchableType | Unset - ) + identifier_matchable_type: Union[ + Unset, NewAlertsSourceDataAttributesResolutionRuleAttributesType0IdentifierMatchableType + ] if isinstance(_identifier_matchable_type, Unset): identifier_matchable_type = UNSET else: @@ -161,19 +161,19 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: ) ) - def _parse_identifier_matchable_id(data: object) -> None | str | Unset: + def _parse_identifier_matchable_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) identifier_matchable_id = _parse_identifier_matchable_id(d.pop("identifier_matchable_id", UNSET)) _identifier_reference_kind = d.pop("identifier_reference_kind", UNSET) - identifier_reference_kind: ( - NewAlertsSourceDataAttributesResolutionRuleAttributesType0IdentifierReferenceKind | Unset - ) + identifier_reference_kind: Union[ + Unset, NewAlertsSourceDataAttributesResolutionRuleAttributesType0IdentifierReferenceKind + ] if isinstance(_identifier_reference_kind, Unset): identifier_reference_kind = UNSET else: @@ -183,38 +183,34 @@ def _parse_identifier_matchable_id(data: object) -> None | str | Unset: ) ) - def _parse_identifier_json_path(data: object) -> None | str | Unset: + def _parse_identifier_json_path(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) identifier_json_path = _parse_identifier_json_path(d.pop("identifier_json_path", UNSET)) - def _parse_identifier_value_regex(data: object) -> None | str | Unset: + def _parse_identifier_value_regex(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) identifier_value_regex = _parse_identifier_value_regex(d.pop("identifier_value_regex", UNSET)) + conditions_attributes = [] _conditions_attributes = d.pop("conditions_attributes", UNSET) - conditions_attributes: ( - list[NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItem] | Unset - ) = UNSET - if _conditions_attributes is not UNSET: - conditions_attributes = [] - for conditions_attributes_item_data in _conditions_attributes: - conditions_attributes_item = ( - NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItem.from_dict( - conditions_attributes_item_data - ) + for conditions_attributes_item_data in _conditions_attributes or []: + conditions_attributes_item = ( + NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItem.from_dict( + conditions_attributes_item_data ) + ) - conditions_attributes.append(conditions_attributes_item) + conditions_attributes.append(conditions_attributes_item) new_alerts_source_data_attributes_resolution_rule_attributes_type_0 = cls( enabled=enabled, diff --git a/rootly_sdk/models/new_alerts_source_data_attributes_resolution_rule_attributes_type_0_conditions_attributes_item.py b/rootly_sdk/models/new_alerts_source_data_attributes_resolution_rule_attributes_type_0_conditions_attributes_item.py index a3163489..8088ee20 100644 --- a/rootly_sdk/models/new_alerts_source_data_attributes_resolution_rule_attributes_type_0_conditions_attributes_item.py +++ b/rootly_sdk/models/new_alerts_source_data_attributes_resolution_rule_attributes_type_0_conditions_attributes_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -27,55 +25,58 @@ class NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItem: """ Attributes: - field (None | str | Unset): JSON path expression to extract a specific value from the alert's payload for + field (Union[None, Unset, str]): JSON path expression to extract a specific value from the alert's payload for evaluation - operator (NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemOperator | Unset): - Comparison operator used to evaluate the extracted value against the specified condition - value (str | Unset): Value that the extracted payload data is compared to using the specified operator to + operator (Union[Unset, + NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemOperator]): Comparison + operator used to evaluate the extracted value against the specified condition + value (Union[Unset, str]): Value that the extracted payload data is compared to using the specified operator to determine a match - conditionable_type - (NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemConditionableType | Unset): - The type of the conditionable - conditionable_id (None | str | Unset): The ID of the conditionable. If conditionable_type is AlertField, this is - the ID of the alert field. - kind (NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemKind | Unset): The kind + conditionable_type (Union[Unset, + NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemConditionableType]): The type of the conditionable + conditionable_id (Union[None, Unset, str]): The ID of the conditionable. If conditionable_type is AlertField, + this is the ID of the alert field. + kind (Union[Unset, NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemKind]): The + kind of the conditionable """ - field: None | str | Unset = UNSET - operator: NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemOperator | Unset = UNSET - value: str | Unset = UNSET - conditionable_type: ( - NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemConditionableType | Unset - ) = UNSET - conditionable_id: None | str | Unset = UNSET - kind: NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemKind | Unset = UNSET + field: Union[None, Unset, str] = UNSET + operator: Union[ + Unset, NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemOperator + ] = UNSET + value: Union[Unset, str] = UNSET + conditionable_type: Union[ + Unset, NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemConditionableType + ] = UNSET + conditionable_id: Union[None, Unset, str] = UNSET + kind: Union[Unset, NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemKind] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - field: None | str | Unset + field: Union[None, Unset, str] if isinstance(self.field, Unset): field = UNSET else: field = self.field - operator: str | Unset = UNSET + operator: Union[Unset, str] = UNSET if not isinstance(self.operator, Unset): operator = self.operator value = self.value - conditionable_type: str | Unset = UNSET + conditionable_type: Union[Unset, str] = UNSET if not isinstance(self.conditionable_type, Unset): conditionable_type = self.conditionable_type - conditionable_id: None | str | Unset + conditionable_id: Union[None, Unset, str] if isinstance(self.conditionable_id, Unset): conditionable_id = UNSET else: conditionable_id = self.conditionable_id - kind: str | Unset = UNSET + kind: Union[Unset, str] = UNSET if not isinstance(self.kind, Unset): kind = self.kind @@ -101,17 +102,19 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_field(data: object) -> None | str | Unset: + def _parse_field(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) field = _parse_field(d.pop("field", UNSET)) _operator = d.pop("operator", UNSET) - operator: NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemOperator | Unset + operator: Union[ + Unset, NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemOperator + ] if isinstance(_operator, Unset): operator = UNSET else: @@ -122,9 +125,9 @@ def _parse_field(data: object) -> None | str | Unset: value = d.pop("value", UNSET) _conditionable_type = d.pop("conditionable_type", UNSET) - conditionable_type: ( - NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemConditionableType | Unset - ) + conditionable_type: Union[ + Unset, NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemConditionableType + ] if isinstance(_conditionable_type, Unset): conditionable_type = UNSET else: @@ -132,17 +135,17 @@ def _parse_field(data: object) -> None | str | Unset: _conditionable_type ) - def _parse_conditionable_id(data: object) -> None | str | Unset: + def _parse_conditionable_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) conditionable_id = _parse_conditionable_id(d.pop("conditionable_id", UNSET)) _kind = d.pop("kind", UNSET) - kind: NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemKind | Unset + kind: Union[Unset, NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemKind] if isinstance(_kind, Unset): kind = UNSET else: diff --git a/rootly_sdk/models/new_alerts_source_data_attributes_sourceable_attributes_type_0.py b/rootly_sdk/models/new_alerts_source_data_attributes_sourceable_attributes_type_0.py index 07b1013b..c02891bc 100644 --- a/rootly_sdk/models/new_alerts_source_data_attributes_sourceable_attributes_type_0.py +++ b/rootly_sdk/models/new_alerts_source_data_attributes_sourceable_attributes_type_0.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,32 +17,32 @@ @_attrs_define class NewAlertsSourceDataAttributesSourceableAttributesType0: - """Provide additional attributes for generic_webhook alerts source - - Attributes: - auto_resolve (bool | Unset): Set this to true to auto-resolve alerts based on field_mappings_attributes - conditions - resolve_state (None | str | Unset): This value is matched with the value extracted from alerts payload using - JSON path in field_mappings_attributes - accept_threaded_emails (bool | Unset): Set this to false to reject threaded emails - field_mappings_attributes - (list[NewAlertsSourceDataAttributesSourceableAttributesType0FieldMappingsAttributesItem] | Unset): Specify rules - to auto resolve alerts + """Provide additional attributes for the underlying source. `auto_resolve`, `resolve_state` and + `field_mappings_attributes` apply to generic_webhook sources; `accept_threaded_emails` applies to email sources. + + Attributes: + auto_resolve (Union[Unset, bool]): Set this to true to auto-resolve alerts based on field_mappings_attributes + conditions + resolve_state (Union[None, Unset, str]): This value is matched with the value extracted from alerts payload + using JSON path in field_mappings_attributes + accept_threaded_emails (Union[Unset, bool]): Set this to false to reject threaded emails + field_mappings_attributes (Union[Unset, + list['NewAlertsSourceDataAttributesSourceableAttributesType0FieldMappingsAttributesItem']]): Specify rules to + auto resolve alerts """ - auto_resolve: bool | Unset = UNSET - resolve_state: None | str | Unset = UNSET - accept_threaded_emails: bool | Unset = UNSET - field_mappings_attributes: ( - list[NewAlertsSourceDataAttributesSourceableAttributesType0FieldMappingsAttributesItem] | Unset - ) = UNSET + auto_resolve: Union[Unset, bool] = UNSET + resolve_state: Union[None, Unset, str] = UNSET + accept_threaded_emails: Union[Unset, bool] = UNSET + field_mappings_attributes: Union[ + Unset, list["NewAlertsSourceDataAttributesSourceableAttributesType0FieldMappingsAttributesItem"] + ] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - auto_resolve = self.auto_resolve - resolve_state: None | str | Unset + resolve_state: Union[None, Unset, str] if isinstance(self.resolve_state, Unset): resolve_state = UNSET else: @@ -52,7 +50,7 @@ def to_dict(self) -> dict[str, Any]: accept_threaded_emails = self.accept_threaded_emails - field_mappings_attributes: list[dict[str, Any]] | Unset = UNSET + field_mappings_attributes: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.field_mappings_attributes, Unset): field_mappings_attributes = [] for field_mappings_attributes_item_data in self.field_mappings_attributes: @@ -82,31 +80,27 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) auto_resolve = d.pop("auto_resolve", UNSET) - def _parse_resolve_state(data: object) -> None | str | Unset: + def _parse_resolve_state(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) resolve_state = _parse_resolve_state(d.pop("resolve_state", UNSET)) accept_threaded_emails = d.pop("accept_threaded_emails", UNSET) + field_mappings_attributes = [] _field_mappings_attributes = d.pop("field_mappings_attributes", UNSET) - field_mappings_attributes: ( - list[NewAlertsSourceDataAttributesSourceableAttributesType0FieldMappingsAttributesItem] | Unset - ) = UNSET - if _field_mappings_attributes is not UNSET: - field_mappings_attributes = [] - for field_mappings_attributes_item_data in _field_mappings_attributes: - field_mappings_attributes_item = ( - NewAlertsSourceDataAttributesSourceableAttributesType0FieldMappingsAttributesItem.from_dict( - field_mappings_attributes_item_data - ) + for field_mappings_attributes_item_data in _field_mappings_attributes or []: + field_mappings_attributes_item = ( + NewAlertsSourceDataAttributesSourceableAttributesType0FieldMappingsAttributesItem.from_dict( + field_mappings_attributes_item_data ) + ) - field_mappings_attributes.append(field_mappings_attributes_item) + field_mappings_attributes.append(field_mappings_attributes_item) new_alerts_source_data_attributes_sourceable_attributes_type_0 = cls( auto_resolve=auto_resolve, diff --git a/rootly_sdk/models/new_alerts_source_data_attributes_sourceable_attributes_type_0_field_mappings_attributes_item.py b/rootly_sdk/models/new_alerts_source_data_attributes_sourceable_attributes_type_0_field_mappings_attributes_item.py index 680df17a..986ab601 100644 --- a/rootly_sdk/models/new_alerts_source_data_attributes_sourceable_attributes_type_0_field_mappings_attributes_item.py +++ b/rootly_sdk/models/new_alerts_source_data_attributes_sourceable_attributes_type_0_field_mappings_attributes_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,19 +17,19 @@ class NewAlertsSourceDataAttributesSourceableAttributesType0FieldMappingsAttributesItem: """ Attributes: - field (NewAlertsSourceDataAttributesSourceableAttributesType0FieldMappingsAttributesItemField | Unset): Select - the field on which the condition to be evaluated - json_path (str | Unset): JSON path expression to extract a specific value from the alert's payload for + field (Union[Unset, NewAlertsSourceDataAttributesSourceableAttributesType0FieldMappingsAttributesItemField]): + Select the field on which the condition to be evaluated + json_path (Union[Unset, str]): JSON path expression to extract a specific value from the alert's payload for evaluation. For `notification_target_id` only: if your account has opted in to Dynamic Notification Targets, this may also be a Liquid template that resolves to a notification target id at routing time. """ - field: NewAlertsSourceDataAttributesSourceableAttributesType0FieldMappingsAttributesItemField | Unset = UNSET - json_path: str | Unset = UNSET + field: Union[Unset, NewAlertsSourceDataAttributesSourceableAttributesType0FieldMappingsAttributesItemField] = UNSET + json_path: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - field: str | Unset = UNSET + field: Union[Unset, str] = UNSET if not isinstance(self.field, Unset): field = self.field @@ -51,7 +49,7 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _field = d.pop("field", UNSET) - field: NewAlertsSourceDataAttributesSourceableAttributesType0FieldMappingsAttributesItemField | Unset + field: Union[Unset, NewAlertsSourceDataAttributesSourceableAttributesType0FieldMappingsAttributesItemField] if isinstance(_field, Unset): field = UNSET else: diff --git a/rootly_sdk/models/new_api_key.py b/rootly_sdk/models/new_api_key.py index 76000ed8..90819273 100644 --- a/rootly_sdk/models/new_api_key.py +++ b/rootly_sdk/models/new_api_key.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewApiKey: data (NewApiKeyData): """ - data: NewApiKeyData + data: "NewApiKeyData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_api_key_data.py b/rootly_sdk/models/new_api_key_data.py index f8653689..dd7533a0 100644 --- a/rootly_sdk/models/new_api_key_data.py +++ b/rootly_sdk/models/new_api_key_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class NewApiKeyData: """ type_: NewApiKeyDataType - attributes: NewApiKeyDataAttributes + attributes: "NewApiKeyDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_api_key_data_attributes.py b/rootly_sdk/models/new_api_key_data_attributes.py index 8c211349..c4edb3e5 100644 --- a/rootly_sdk/models/new_api_key_data_attributes.py +++ b/rootly_sdk/models/new_api_key_data_attributes.py @@ -1,8 +1,6 @@ -from __future__ import annotations - import datetime from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from dateutil.parser import isoparse @@ -23,19 +21,19 @@ class NewApiKeyDataAttributes: name (str): The name of the API key kind (NewApiKeyDataAttributesKind): The kind of the API key expires_at (datetime.datetime): The expiration date of the API key (ISO 8601) - description (None | str | Unset): A description of the API key - group_id (None | str | Unset): The group (team) ID. Required when kind is 'team'. - role_id (None | str | Unset): The role ID for organization API keys - on_call_role_id (None | str | Unset): The on-call role ID for organization API keys + description (Union[None, Unset, str]): A description of the API key + group_id (Union[None, Unset, str]): The group (team) ID. Required when kind is 'team'. + role_id (Union[None, Unset, str]): The role ID for organization API keys + on_call_role_id (Union[None, Unset, str]): The on-call role ID for organization API keys """ name: str kind: NewApiKeyDataAttributesKind expires_at: datetime.datetime - description: None | str | Unset = UNSET - group_id: None | str | Unset = UNSET - role_id: None | str | Unset = UNSET - on_call_role_id: None | str | Unset = UNSET + description: Union[None, Unset, str] = UNSET + group_id: Union[None, Unset, str] = UNSET + role_id: Union[None, Unset, str] = UNSET + on_call_role_id: Union[None, Unset, str] = UNSET def to_dict(self) -> dict[str, Any]: name = self.name @@ -44,25 +42,25 @@ def to_dict(self) -> dict[str, Any]: expires_at = self.expires_at.isoformat() - description: None | str | Unset + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: description = self.description - group_id: None | str | Unset + group_id: Union[None, Unset, str] if isinstance(self.group_id, Unset): group_id = UNSET else: group_id = self.group_id - role_id: None | str | Unset + role_id: Union[None, Unset, str] if isinstance(self.role_id, Unset): role_id = UNSET else: role_id = self.role_id - on_call_role_id: None | str | Unset + on_call_role_id: Union[None, Unset, str] if isinstance(self.on_call_role_id, Unset): on_call_role_id = UNSET else: @@ -97,39 +95,39 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: expires_at = isoparse(d.pop("expires_at")) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) - def _parse_group_id(data: object) -> None | str | Unset: + def _parse_group_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) group_id = _parse_group_id(d.pop("group_id", UNSET)) - def _parse_role_id(data: object) -> None | str | Unset: + def _parse_role_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) role_id = _parse_role_id(d.pop("role_id", UNSET)) - def _parse_on_call_role_id(data: object) -> None | str | Unset: + def _parse_on_call_role_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) on_call_role_id = _parse_on_call_role_id(d.pop("on_call_role_id", UNSET)) diff --git a/rootly_sdk/models/new_authorization.py b/rootly_sdk/models/new_authorization.py index 2e9cf0c3..8aa7035b 100644 --- a/rootly_sdk/models/new_authorization.py +++ b/rootly_sdk/models/new_authorization.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewAuthorization: data (NewAuthorizationData): """ - data: NewAuthorizationData + data: "NewAuthorizationData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_authorization_data.py b/rootly_sdk/models/new_authorization_data.py index 31b084d8..b92c08f5 100644 --- a/rootly_sdk/models/new_authorization_data.py +++ b/rootly_sdk/models/new_authorization_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class NewAuthorizationData: """ type_: NewAuthorizationDataType - attributes: NewAuthorizationDataAttributes + attributes: "NewAuthorizationDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_authorization_data_attributes.py b/rootly_sdk/models/new_authorization_data_attributes.py index b0ef4f6f..937caafc 100644 --- a/rootly_sdk/models/new_authorization_data_attributes.py +++ b/rootly_sdk/models/new_authorization_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/new_catalog.py b/rootly_sdk/models/new_catalog.py index 237fa872..48c41be3 100644 --- a/rootly_sdk/models/new_catalog.py +++ b/rootly_sdk/models/new_catalog.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewCatalog: data (NewCatalogData): """ - data: NewCatalogData + data: "NewCatalogData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_catalog_checklist_template.py b/rootly_sdk/models/new_catalog_checklist_template.py index 76099d53..a2365553 100644 --- a/rootly_sdk/models/new_catalog_checklist_template.py +++ b/rootly_sdk/models/new_catalog_checklist_template.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewCatalogChecklistTemplate: data (NewCatalogChecklistTemplateData): """ - data: NewCatalogChecklistTemplateData + data: "NewCatalogChecklistTemplateData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_catalog_checklist_template_data.py b/rootly_sdk/models/new_catalog_checklist_template_data.py index 46881d35..9bc4435b 100644 --- a/rootly_sdk/models/new_catalog_checklist_template_data.py +++ b/rootly_sdk/models/new_catalog_checklist_template_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class NewCatalogChecklistTemplateData: """ type_: NewCatalogChecklistTemplateDataType - attributes: NewCatalogChecklistTemplateDataAttributes + attributes: "NewCatalogChecklistTemplateDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_catalog_checklist_template_data_attributes.py b/rootly_sdk/models/new_catalog_checklist_template_data_attributes.py index 1d8669c8..3e08421f 100644 --- a/rootly_sdk/models/new_catalog_checklist_template_data_attributes.py +++ b/rootly_sdk/models/new_catalog_checklist_template_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -37,27 +35,33 @@ class NewCatalogChecklistTemplateDataAttributes: name (str): The name of the checklist template catalog_type (NewCatalogChecklistTemplateDataAttributesCatalogType): The catalog type scope_type (NewCatalogChecklistTemplateDataAttributesScopeType): The scope type - description (None | str | Unset): The description of the checklist template - scope_id (str | Unset): The scope ID (team or catalog UUID) - fields (list[NewCatalogChecklistTemplateDataAttributesBuiltinField | - NewCatalogChecklistTemplateDataAttributesCustomField] | None | Unset): Template fields. Position is determined - by array order. - owners (list[NewCatalogChecklistTemplateDataAttributesOwnersType0Item] | None | Unset): Template owners + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + description (Union[None, Unset, str]): The description of the checklist template + scope_id (Union[Unset, str]): The scope ID (team or catalog UUID) + fields (Union[None, Unset, list[Union['NewCatalogChecklistTemplateDataAttributesBuiltinField', + 'NewCatalogChecklistTemplateDataAttributesCustomField']]]): Template fields. Position is determined by array + order. + owners (Union[None, Unset, list['NewCatalogChecklistTemplateDataAttributesOwnersType0Item']]): Template owners """ name: str catalog_type: NewCatalogChecklistTemplateDataAttributesCatalogType scope_type: NewCatalogChecklistTemplateDataAttributesScopeType - description: None | str | Unset = UNSET - scope_id: str | Unset = UNSET - fields: ( + slug: Union[None, Unset, str] = UNSET + description: Union[None, Unset, str] = UNSET + scope_id: Union[Unset, str] = UNSET + fields: Union[ + None, + Unset, list[ - NewCatalogChecklistTemplateDataAttributesBuiltinField | NewCatalogChecklistTemplateDataAttributesCustomField - ] - | None - | Unset - ) = UNSET - owners: list[NewCatalogChecklistTemplateDataAttributesOwnersType0Item] | None | Unset = UNSET + Union[ + "NewCatalogChecklistTemplateDataAttributesBuiltinField", + "NewCatalogChecklistTemplateDataAttributesCustomField", + ] + ], + ] = UNSET + owners: Union[None, Unset, list["NewCatalogChecklistTemplateDataAttributesOwnersType0Item"]] = UNSET def to_dict(self) -> dict[str, Any]: from ..models.new_catalog_checklist_template_data_attributes_builtin_field import ( @@ -70,7 +74,13 @@ def to_dict(self) -> dict[str, Any]: scope_type: str = self.scope_type - description: None | str | Unset + slug: Union[None, Unset, str] + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug + + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: @@ -78,7 +88,7 @@ def to_dict(self) -> dict[str, Any]: scope_id = self.scope_id - fields: list[dict[str, Any]] | None | Unset + fields: Union[None, Unset, list[dict[str, Any]]] if isinstance(self.fields, Unset): fields = UNSET elif isinstance(self.fields, list): @@ -95,7 +105,7 @@ def to_dict(self) -> dict[str, Any]: else: fields = self.fields - owners: list[dict[str, Any]] | None | Unset + owners: Union[None, Unset, list[dict[str, Any]]] if isinstance(self.owners, Unset): owners = UNSET elif isinstance(self.owners, list): @@ -116,6 +126,8 @@ def to_dict(self) -> dict[str, Any]: "scope_type": scope_type, } ) + if slug is not UNSET: + field_dict["slug"] = slug if description is not UNSET: field_dict["description"] = description if scope_id is not UNSET: @@ -146,12 +158,21 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: scope_type = check_new_catalog_checklist_template_data_attributes_scope_type(d.pop("scope_type")) - def _parse_description(data: object) -> None | str | Unset: + def _parse_slug(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) + + slug = _parse_slug(d.pop("slug", UNSET)) + + def _parse_description(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) @@ -159,14 +180,16 @@ def _parse_description(data: object) -> None | str | Unset: def _parse_fields( data: object, - ) -> ( + ) -> Union[ + None, + Unset, list[ - NewCatalogChecklistTemplateDataAttributesBuiltinField - | NewCatalogChecklistTemplateDataAttributesCustomField - ] - | None - | Unset - ): + Union[ + "NewCatalogChecklistTemplateDataAttributesBuiltinField", + "NewCatalogChecklistTemplateDataAttributesCustomField", + ] + ], + ]: if data is None: return data if isinstance(data, Unset): @@ -180,10 +203,10 @@ def _parse_fields( def _parse_fields_type_0_item( data: object, - ) -> ( - NewCatalogChecklistTemplateDataAttributesBuiltinField - | NewCatalogChecklistTemplateDataAttributesCustomField - ): + ) -> Union[ + "NewCatalogChecklistTemplateDataAttributesBuiltinField", + "NewCatalogChecklistTemplateDataAttributesCustomField", + ]: try: if not isinstance(data, dict): raise TypeError() @@ -192,7 +215,7 @@ def _parse_fields_type_0_item( ) return fields_type_0_item_builtin_field - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass if not isinstance(data, dict): raise TypeError() @@ -207,15 +230,19 @@ def _parse_fields_type_0_item( fields_type_0.append(fields_type_0_item) return fields_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass return cast( - list[ - NewCatalogChecklistTemplateDataAttributesBuiltinField - | NewCatalogChecklistTemplateDataAttributesCustomField - ] - | None - | Unset, + Union[ + None, + Unset, + list[ + Union[ + "NewCatalogChecklistTemplateDataAttributesBuiltinField", + "NewCatalogChecklistTemplateDataAttributesCustomField", + ] + ], + ], data, ) @@ -223,7 +250,7 @@ def _parse_fields_type_0_item( def _parse_owners( data: object, - ) -> list[NewCatalogChecklistTemplateDataAttributesOwnersType0Item] | None | Unset: + ) -> Union[None, Unset, list["NewCatalogChecklistTemplateDataAttributesOwnersType0Item"]]: if data is None: return data if isinstance(data, Unset): @@ -241,9 +268,9 @@ def _parse_owners( owners_type_0.append(owners_type_0_item) return owners_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[NewCatalogChecklistTemplateDataAttributesOwnersType0Item] | None | Unset, data) + return cast(Union[None, Unset, list["NewCatalogChecklistTemplateDataAttributesOwnersType0Item"]], data) owners = _parse_owners(d.pop("owners", UNSET)) @@ -251,6 +278,7 @@ def _parse_owners( name=name, catalog_type=catalog_type, scope_type=scope_type, + slug=slug, description=description, scope_id=scope_id, fields=fields, diff --git a/rootly_sdk/models/new_catalog_checklist_template_data_attributes_builtin_field.py b/rootly_sdk/models/new_catalog_checklist_template_data_attributes_builtin_field.py index 59cbd408..53735573 100644 --- a/rootly_sdk/models/new_catalog_checklist_template_data_attributes_builtin_field.py +++ b/rootly_sdk/models/new_catalog_checklist_template_data_attributes_builtin_field.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/new_catalog_checklist_template_data_attributes_custom_field.py b/rootly_sdk/models/new_catalog_checklist_template_data_attributes_custom_field.py index 4c8ca431..f950f201 100644 --- a/rootly_sdk/models/new_catalog_checklist_template_data_attributes_custom_field.py +++ b/rootly_sdk/models/new_catalog_checklist_template_data_attributes_custom_field.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,12 +19,12 @@ class NewCatalogChecklistTemplateDataAttributesCustomField: Attributes: field_source (NewCatalogChecklistTemplateDataAttributesCustomFieldFieldSource): catalog_property_id (str): ID of the catalog property - field_key (str | Unset): Ignored for custom fields (auto-derived from catalog property) + field_key (Union[Unset, str]): Ignored for custom fields (auto-derived from catalog property) """ field_source: NewCatalogChecklistTemplateDataAttributesCustomFieldFieldSource catalog_property_id: str - field_key: str | Unset = UNSET + field_key: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/new_catalog_checklist_template_data_attributes_owners_type_0_item.py b/rootly_sdk/models/new_catalog_checklist_template_data_attributes_owners_type_0_item.py index 36a28929..834411cf 100644 --- a/rootly_sdk/models/new_catalog_checklist_template_data_attributes_owners_type_0_item.py +++ b/rootly_sdk/models/new_catalog_checklist_template_data_attributes_owners_type_0_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/new_catalog_data.py b/rootly_sdk/models/new_catalog_data.py index cdb82389..47f0b5c0 100644 --- a/rootly_sdk/models/new_catalog_data.py +++ b/rootly_sdk/models/new_catalog_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class NewCatalogData: """ type_: NewCatalogDataType - attributes: NewCatalogDataAttributes + attributes: "NewCatalogDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_catalog_data_attributes.py b/rootly_sdk/models/new_catalog_data_attributes.py index ec3d19f4..3b37f2a6 100644 --- a/rootly_sdk/models/new_catalog_data_attributes.py +++ b/rootly_sdk/models/new_catalog_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -19,38 +17,47 @@ class NewCatalogDataAttributes: """ Attributes: name (str): - description (None | str | Unset): - icon (NewCatalogDataAttributesIcon | Unset): - position (int | None | Unset): Default position of the catalog when displayed in a list. - external_id (None | str | Unset): An external identifier for this catalog. Must be unique within the team. + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + description (Union[None, Unset, str]): + icon (Union[Unset, NewCatalogDataAttributesIcon]): + position (Union[None, Unset, int]): Default position of the catalog when displayed in a list. + external_id (Union[None, Unset, str]): An external identifier for this catalog. Must be unique within the team. """ name: str - description: None | str | Unset = UNSET - icon: NewCatalogDataAttributesIcon | Unset = UNSET - position: int | None | Unset = UNSET - external_id: None | str | Unset = UNSET + slug: Union[None, Unset, str] = UNSET + description: Union[None, Unset, str] = UNSET + icon: Union[Unset, NewCatalogDataAttributesIcon] = UNSET + position: Union[None, Unset, int] = UNSET + external_id: Union[None, Unset, str] = UNSET def to_dict(self) -> dict[str, Any]: name = self.name - description: None | str | Unset + slug: Union[None, Unset, str] + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug + + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: description = self.description - icon: str | Unset = UNSET + icon: Union[Unset, str] = UNSET if not isinstance(self.icon, Unset): icon = self.icon - position: int | None | Unset + position: Union[None, Unset, int] if isinstance(self.position, Unset): position = UNSET else: position = self.position - external_id: None | str | Unset + external_id: Union[None, Unset, str] if isinstance(self.external_id, Unset): external_id = UNSET else: @@ -63,6 +70,8 @@ def to_dict(self) -> dict[str, Any]: "name": name, } ) + if slug is not UNSET: + field_dict["slug"] = slug if description is not UNSET: field_dict["description"] = description if icon is not UNSET: @@ -79,42 +88,52 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name") - def _parse_description(data: object) -> None | str | Unset: + def _parse_slug(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + slug = _parse_slug(d.pop("slug", UNSET)) + + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) _icon = d.pop("icon", UNSET) - icon: NewCatalogDataAttributesIcon | Unset + icon: Union[Unset, NewCatalogDataAttributesIcon] if isinstance(_icon, Unset): icon = UNSET else: icon = check_new_catalog_data_attributes_icon(_icon) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> Union[None, Unset, int]: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(Union[None, Unset, int], data) position = _parse_position(d.pop("position", UNSET)) - def _parse_external_id(data: object) -> None | str | Unset: + def _parse_external_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) external_id = _parse_external_id(d.pop("external_id", UNSET)) new_catalog_data_attributes = cls( name=name, + slug=slug, description=description, icon=icon, position=position, diff --git a/rootly_sdk/models/new_catalog_entity.py b/rootly_sdk/models/new_catalog_entity.py index e69bd8cd..54f5b515 100644 --- a/rootly_sdk/models/new_catalog_entity.py +++ b/rootly_sdk/models/new_catalog_entity.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewCatalogEntity: data (NewCatalogEntityData): """ - data: NewCatalogEntityData + data: "NewCatalogEntityData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_catalog_entity_data.py b/rootly_sdk/models/new_catalog_entity_data.py index 86bda241..1b84bedf 100644 --- a/rootly_sdk/models/new_catalog_entity_data.py +++ b/rootly_sdk/models/new_catalog_entity_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class NewCatalogEntityData: """ type_: NewCatalogEntityDataType - attributes: NewCatalogEntityDataAttributes + attributes: "NewCatalogEntityDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_catalog_entity_data_attributes.py b/rootly_sdk/models/new_catalog_entity_data_attributes.py index 1afb06cc..347f9041 100644 --- a/rootly_sdk/models/new_catalog_entity_data_attributes.py +++ b/rootly_sdk/models/new_catalog_entity_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -19,51 +17,67 @@ class NewCatalogEntityDataAttributes: """ Attributes: name (str): - description (None | str | Unset): - position (int | None | Unset): Default position of the item when displayed in a list. - backstage_id (None | str | Unset): The Backstage entity ID this catalog entity is linked to. - external_id (None | str | Unset): An external identifier for this catalog entity. Must be unique within the + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + description (Union[None, Unset, str]): + public_description (Union[None, Unset, str]): The status page description of the catalog entity + position (Union[None, Unset, int]): Default position of the item when displayed in a list. + backstage_id (Union[None, Unset, str]): The Backstage entity ID this catalog entity is linked to. + external_id (Union[None, Unset, str]): An external identifier for this catalog entity. Must be unique within the catalog. - properties (list[NewCatalogEntityDataAttributesPropertiesItem] | Unset): Array of property values for this - catalog entity + properties (Union[Unset, list['NewCatalogEntityDataAttributesPropertiesItem']]): Array of property values for + this catalog entity """ name: str - description: None | str | Unset = UNSET - position: int | None | Unset = UNSET - backstage_id: None | str | Unset = UNSET - external_id: None | str | Unset = UNSET - properties: list[NewCatalogEntityDataAttributesPropertiesItem] | Unset = UNSET + slug: Union[None, Unset, str] = UNSET + description: Union[None, Unset, str] = UNSET + public_description: Union[None, Unset, str] = UNSET + position: Union[None, Unset, int] = UNSET + backstage_id: Union[None, Unset, str] = UNSET + external_id: Union[None, Unset, str] = UNSET + properties: Union[Unset, list["NewCatalogEntityDataAttributesPropertiesItem"]] = UNSET def to_dict(self) -> dict[str, Any]: - name = self.name - description: None | str | Unset + slug: Union[None, Unset, str] + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug + + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: description = self.description - position: int | None | Unset + public_description: Union[None, Unset, str] + if isinstance(self.public_description, Unset): + public_description = UNSET + else: + public_description = self.public_description + + position: Union[None, Unset, int] if isinstance(self.position, Unset): position = UNSET else: position = self.position - backstage_id: None | str | Unset + backstage_id: Union[None, Unset, str] if isinstance(self.backstage_id, Unset): backstage_id = UNSET else: backstage_id = self.backstage_id - external_id: None | str | Unset + external_id: Union[None, Unset, str] if isinstance(self.external_id, Unset): external_id = UNSET else: external_id = self.external_id - properties: list[dict[str, Any]] | Unset = UNSET + properties: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.properties, Unset): properties = [] for properties_item_data in self.properties: @@ -77,8 +91,12 @@ def to_dict(self) -> dict[str, Any]: "name": name, } ) + if slug is not UNSET: + field_dict["slug"] = slug if description is not UNSET: field_dict["description"] = description + if public_description is not UNSET: + field_dict["public_description"] = public_description if position is not UNSET: field_dict["position"] = position if backstage_id is not UNSET: @@ -99,54 +117,72 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name") - def _parse_description(data: object) -> None | str | Unset: + def _parse_slug(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + slug = _parse_slug(d.pop("slug", UNSET)) + + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) - def _parse_position(data: object) -> int | None | Unset: + def _parse_public_description(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + public_description = _parse_public_description(d.pop("public_description", UNSET)) + + def _parse_position(data: object) -> Union[None, Unset, int]: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(Union[None, Unset, int], data) position = _parse_position(d.pop("position", UNSET)) - def _parse_backstage_id(data: object) -> None | str | Unset: + def _parse_backstage_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) backstage_id = _parse_backstage_id(d.pop("backstage_id", UNSET)) - def _parse_external_id(data: object) -> None | str | Unset: + def _parse_external_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) external_id = _parse_external_id(d.pop("external_id", UNSET)) + properties = [] _properties = d.pop("properties", UNSET) - properties: list[NewCatalogEntityDataAttributesPropertiesItem] | Unset = UNSET - if _properties is not UNSET: - properties = [] - for properties_item_data in _properties: - properties_item = NewCatalogEntityDataAttributesPropertiesItem.from_dict(properties_item_data) + for properties_item_data in _properties or []: + properties_item = NewCatalogEntityDataAttributesPropertiesItem.from_dict(properties_item_data) - properties.append(properties_item) + properties.append(properties_item) new_catalog_entity_data_attributes = cls( name=name, + slug=slug, description=description, + public_description=public_description, position=position, backstage_id=backstage_id, external_id=external_id, diff --git a/rootly_sdk/models/new_catalog_entity_data_attributes_properties_item.py b/rootly_sdk/models/new_catalog_entity_data_attributes_properties_item.py index f5636592..16aab728 100644 --- a/rootly_sdk/models/new_catalog_entity_data_attributes_properties_item.py +++ b/rootly_sdk/models/new_catalog_entity_data_attributes_properties_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/new_catalog_entity_property.py b/rootly_sdk/models/new_catalog_entity_property.py index 3f7f8636..8e004ed0 100644 --- a/rootly_sdk/models/new_catalog_entity_property.py +++ b/rootly_sdk/models/new_catalog_entity_property.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -22,11 +20,10 @@ class NewCatalogEntityProperty: data (NewCatalogEntityPropertyData): """ - data: NewCatalogEntityPropertyData + data: "NewCatalogEntityPropertyData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_catalog_entity_property_data.py b/rootly_sdk/models/new_catalog_entity_property_data.py index 81053936..a0ad259e 100644 --- a/rootly_sdk/models/new_catalog_entity_property_data.py +++ b/rootly_sdk/models/new_catalog_entity_property_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class NewCatalogEntityPropertyData: """ type_: NewCatalogEntityPropertyDataType - attributes: NewCatalogEntityPropertyDataAttributes + attributes: "NewCatalogEntityPropertyDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_catalog_entity_property_data_attributes.py b/rootly_sdk/models/new_catalog_entity_property_data_attributes.py index b1521147..31cc6588 100644 --- a/rootly_sdk/models/new_catalog_entity_property_data_attributes.py +++ b/rootly_sdk/models/new_catalog_entity_property_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define @@ -22,13 +20,13 @@ class NewCatalogEntityPropertyDataAttributes: catalog_field_id (str): key (NewCatalogEntityPropertyDataAttributesKey): value (str): - catalog_entity_id (str | Unset): + catalog_entity_id (Union[Unset, str]): """ catalog_field_id: str key: NewCatalogEntityPropertyDataAttributesKey value: str - catalog_entity_id: str | Unset = UNSET + catalog_entity_id: Union[Unset, str] = UNSET def to_dict(self) -> dict[str, Any]: catalog_field_id = self.catalog_field_id diff --git a/rootly_sdk/models/new_catalog_field.py b/rootly_sdk/models/new_catalog_field.py index e036da74..ab48fe98 100644 --- a/rootly_sdk/models/new_catalog_field.py +++ b/rootly_sdk/models/new_catalog_field.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,11 +19,10 @@ class NewCatalogField: data (NewCatalogFieldData): """ - data: NewCatalogFieldData + data: "NewCatalogFieldData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_catalog_field_data.py b/rootly_sdk/models/new_catalog_field_data.py index 221de699..2ae4472c 100644 --- a/rootly_sdk/models/new_catalog_field_data.py +++ b/rootly_sdk/models/new_catalog_field_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class NewCatalogFieldData: """ type_: NewCatalogFieldDataType - attributes: NewCatalogFieldDataAttributes + attributes: "NewCatalogFieldDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_catalog_field_data_attributes.py b/rootly_sdk/models/new_catalog_field_data_attributes.py index 2de16529..7b1f73fe 100644 --- a/rootly_sdk/models/new_catalog_field_data_attributes.py +++ b/rootly_sdk/models/new_catalog_field_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -24,30 +22,39 @@ class NewCatalogFieldDataAttributes: Attributes: name (str): kind (NewCatalogFieldDataAttributesKind): - kind_catalog_id (None | str | Unset): Restricts values to items of specified catalog. - multiple (bool | Unset): Whether the attribute accepts multiple values. - position (int | None | Unset): Default position of the item when displayed in a list. - required (bool | Unset): Whether the field is required. - catalog_type (NewCatalogFieldDataAttributesCatalogType | Unset): The type of catalog the field belongs to. - external_id (None | str | Unset): An external identifier for this catalog field. Must be unique within the + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + kind_catalog_id (Union[None, Unset, str]): Restricts values to items of specified catalog. + multiple (Union[Unset, bool]): Whether the attribute accepts multiple values. + position (Union[None, Unset, int]): Default position of the item when displayed in a list. + required (Union[Unset, bool]): Whether the field is required. + catalog_type (Union[Unset, NewCatalogFieldDataAttributesCatalogType]): The type of catalog the field belongs to. + external_id (Union[None, Unset, str]): An external identifier for this catalog field. Must be unique within the scope. """ name: str kind: NewCatalogFieldDataAttributesKind - kind_catalog_id: None | str | Unset = UNSET - multiple: bool | Unset = UNSET - position: int | None | Unset = UNSET - required: bool | Unset = UNSET - catalog_type: NewCatalogFieldDataAttributesCatalogType | Unset = UNSET - external_id: None | str | Unset = UNSET + slug: Union[None, Unset, str] = UNSET + kind_catalog_id: Union[None, Unset, str] = UNSET + multiple: Union[Unset, bool] = UNSET + position: Union[None, Unset, int] = UNSET + required: Union[Unset, bool] = UNSET + catalog_type: Union[Unset, NewCatalogFieldDataAttributesCatalogType] = UNSET + external_id: Union[None, Unset, str] = UNSET def to_dict(self) -> dict[str, Any]: name = self.name kind: str = self.kind - kind_catalog_id: None | str | Unset + slug: Union[None, Unset, str] + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug + + kind_catalog_id: Union[None, Unset, str] if isinstance(self.kind_catalog_id, Unset): kind_catalog_id = UNSET else: @@ -55,7 +62,7 @@ def to_dict(self) -> dict[str, Any]: multiple = self.multiple - position: int | None | Unset + position: Union[None, Unset, int] if isinstance(self.position, Unset): position = UNSET else: @@ -63,11 +70,11 @@ def to_dict(self) -> dict[str, Any]: required = self.required - catalog_type: str | Unset = UNSET + catalog_type: Union[Unset, str] = UNSET if not isinstance(self.catalog_type, Unset): catalog_type = self.catalog_type - external_id: None | str | Unset + external_id: Union[None, Unset, str] if isinstance(self.external_id, Unset): external_id = UNSET else: @@ -81,6 +88,8 @@ def to_dict(self) -> dict[str, Any]: "kind": kind, } ) + if slug is not UNSET: + field_dict["slug"] = slug if kind_catalog_id is not UNSET: field_dict["kind_catalog_id"] = kind_catalog_id if multiple is not UNSET: @@ -103,47 +112,57 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: kind = check_new_catalog_field_data_attributes_kind(d.pop("kind")) - def _parse_kind_catalog_id(data: object) -> None | str | Unset: + def _parse_slug(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + slug = _parse_slug(d.pop("slug", UNSET)) + + def _parse_kind_catalog_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) kind_catalog_id = _parse_kind_catalog_id(d.pop("kind_catalog_id", UNSET)) multiple = d.pop("multiple", UNSET) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> Union[None, Unset, int]: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(Union[None, Unset, int], data) position = _parse_position(d.pop("position", UNSET)) required = d.pop("required", UNSET) _catalog_type = d.pop("catalog_type", UNSET) - catalog_type: NewCatalogFieldDataAttributesCatalogType | Unset + catalog_type: Union[Unset, NewCatalogFieldDataAttributesCatalogType] if isinstance(_catalog_type, Unset): catalog_type = UNSET else: catalog_type = check_new_catalog_field_data_attributes_catalog_type(_catalog_type) - def _parse_external_id(data: object) -> None | str | Unset: + def _parse_external_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) external_id = _parse_external_id(d.pop("external_id", UNSET)) new_catalog_field_data_attributes = cls( name=name, kind=kind, + slug=slug, kind_catalog_id=kind_catalog_id, multiple=multiple, position=position, diff --git a/rootly_sdk/models/new_catalog_property.py b/rootly_sdk/models/new_catalog_property.py index 2afbc8a2..10681fc0 100644 --- a/rootly_sdk/models/new_catalog_property.py +++ b/rootly_sdk/models/new_catalog_property.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,11 +19,10 @@ class NewCatalogProperty: data (NewCatalogPropertyData): """ - data: NewCatalogPropertyData + data: "NewCatalogPropertyData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_catalog_property_data.py b/rootly_sdk/models/new_catalog_property_data.py index 8e4df1f6..b578a161 100644 --- a/rootly_sdk/models/new_catalog_property_data.py +++ b/rootly_sdk/models/new_catalog_property_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class NewCatalogPropertyData: """ type_: NewCatalogPropertyDataType - attributes: NewCatalogPropertyDataAttributes + attributes: "NewCatalogPropertyDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_catalog_property_data_attributes.py b/rootly_sdk/models/new_catalog_property_data_attributes.py index 3a4d155c..e7a0eb78 100644 --- a/rootly_sdk/models/new_catalog_property_data_attributes.py +++ b/rootly_sdk/models/new_catalog_property_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -24,30 +22,40 @@ class NewCatalogPropertyDataAttributes: Attributes: name (str): kind (NewCatalogPropertyDataAttributesKind): - kind_catalog_id (None | str | Unset): Restricts values to items of specified catalog. - multiple (bool | Unset): Whether the attribute accepts multiple values. - position (int | None | Unset): Default position of the item when displayed in a list. - required (bool | Unset): Whether the property is required. - catalog_type (NewCatalogPropertyDataAttributesCatalogType | Unset): The type of catalog the property belongs to. - external_id (None | str | Unset): An external identifier for this catalog property. Must be unique within the - scope. + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + kind_catalog_id (Union[None, Unset, str]): Restricts values to items of specified catalog. + multiple (Union[Unset, bool]): Whether the attribute accepts multiple values. + position (Union[None, Unset, int]): Default position of the item when displayed in a list. + required (Union[Unset, bool]): Whether the property is required. + catalog_type (Union[Unset, NewCatalogPropertyDataAttributesCatalogType]): The type of catalog the property + belongs to. + external_id (Union[None, Unset, str]): An external identifier for this catalog property. Must be unique within + the scope. """ name: str kind: NewCatalogPropertyDataAttributesKind - kind_catalog_id: None | str | Unset = UNSET - multiple: bool | Unset = UNSET - position: int | None | Unset = UNSET - required: bool | Unset = UNSET - catalog_type: NewCatalogPropertyDataAttributesCatalogType | Unset = UNSET - external_id: None | str | Unset = UNSET + slug: Union[None, Unset, str] = UNSET + kind_catalog_id: Union[None, Unset, str] = UNSET + multiple: Union[Unset, bool] = UNSET + position: Union[None, Unset, int] = UNSET + required: Union[Unset, bool] = UNSET + catalog_type: Union[Unset, NewCatalogPropertyDataAttributesCatalogType] = UNSET + external_id: Union[None, Unset, str] = UNSET def to_dict(self) -> dict[str, Any]: name = self.name kind: str = self.kind - kind_catalog_id: None | str | Unset + slug: Union[None, Unset, str] + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug + + kind_catalog_id: Union[None, Unset, str] if isinstance(self.kind_catalog_id, Unset): kind_catalog_id = UNSET else: @@ -55,7 +63,7 @@ def to_dict(self) -> dict[str, Any]: multiple = self.multiple - position: int | None | Unset + position: Union[None, Unset, int] if isinstance(self.position, Unset): position = UNSET else: @@ -63,11 +71,11 @@ def to_dict(self) -> dict[str, Any]: required = self.required - catalog_type: str | Unset = UNSET + catalog_type: Union[Unset, str] = UNSET if not isinstance(self.catalog_type, Unset): catalog_type = self.catalog_type - external_id: None | str | Unset + external_id: Union[None, Unset, str] if isinstance(self.external_id, Unset): external_id = UNSET else: @@ -81,6 +89,8 @@ def to_dict(self) -> dict[str, Any]: "kind": kind, } ) + if slug is not UNSET: + field_dict["slug"] = slug if kind_catalog_id is not UNSET: field_dict["kind_catalog_id"] = kind_catalog_id if multiple is not UNSET: @@ -103,47 +113,57 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: kind = check_new_catalog_property_data_attributes_kind(d.pop("kind")) - def _parse_kind_catalog_id(data: object) -> None | str | Unset: + def _parse_slug(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + slug = _parse_slug(d.pop("slug", UNSET)) + + def _parse_kind_catalog_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) kind_catalog_id = _parse_kind_catalog_id(d.pop("kind_catalog_id", UNSET)) multiple = d.pop("multiple", UNSET) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> Union[None, Unset, int]: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(Union[None, Unset, int], data) position = _parse_position(d.pop("position", UNSET)) required = d.pop("required", UNSET) _catalog_type = d.pop("catalog_type", UNSET) - catalog_type: NewCatalogPropertyDataAttributesCatalogType | Unset + catalog_type: Union[Unset, NewCatalogPropertyDataAttributesCatalogType] if isinstance(_catalog_type, Unset): catalog_type = UNSET else: catalog_type = check_new_catalog_property_data_attributes_catalog_type(_catalog_type) - def _parse_external_id(data: object) -> None | str | Unset: + def _parse_external_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) external_id = _parse_external_id(d.pop("external_id", UNSET)) new_catalog_property_data_attributes = cls( name=name, kind=kind, + slug=slug, kind_catalog_id=kind_catalog_id, multiple=multiple, position=position, diff --git a/rootly_sdk/models/new_cause.py b/rootly_sdk/models/new_cause.py index d00de96f..ba1af3e7 100644 --- a/rootly_sdk/models/new_cause.py +++ b/rootly_sdk/models/new_cause.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewCause: data (NewCauseData): """ - data: NewCauseData + data: "NewCauseData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_cause_data.py b/rootly_sdk/models/new_cause_data.py index bbe9ae91..2a5015be 100644 --- a/rootly_sdk/models/new_cause_data.py +++ b/rootly_sdk/models/new_cause_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class NewCauseData: """ type_: NewCauseDataType - attributes: NewCauseDataAttributes + attributes: "NewCauseDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_cause_data_attributes.py b/rootly_sdk/models/new_cause_data_attributes.py index 449fdadd..e2970a15 100644 --- a/rootly_sdk/models/new_cause_data_attributes.py +++ b/rootly_sdk/models/new_cause_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -19,33 +17,50 @@ class NewCauseDataAttributes: """ Attributes: name (str): The name of the cause - description (None | str | Unset): The description of the cause - position (int | None | Unset): Position of the cause - properties (list[NewCauseDataAttributesPropertiesItem] | Unset): Array of property values for this cause. + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + description (Union[None, Unset, str]): The description of the cause + public_description (Union[None, Unset, str]): The status page description of the cause + position (Union[None, Unset, int]): Position of the cause + properties (Union[Unset, list['NewCauseDataAttributesPropertiesItem']]): Array of property values for this + cause. """ name: str - description: None | str | Unset = UNSET - position: int | None | Unset = UNSET - properties: list[NewCauseDataAttributesPropertiesItem] | Unset = UNSET + slug: Union[None, Unset, str] = UNSET + description: Union[None, Unset, str] = UNSET + public_description: Union[None, Unset, str] = UNSET + position: Union[None, Unset, int] = UNSET + properties: Union[Unset, list["NewCauseDataAttributesPropertiesItem"]] = UNSET def to_dict(self) -> dict[str, Any]: - name = self.name - description: None | str | Unset + slug: Union[None, Unset, str] + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug + + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: description = self.description - position: int | None | Unset + public_description: Union[None, Unset, str] + if isinstance(self.public_description, Unset): + public_description = UNSET + else: + public_description = self.public_description + + position: Union[None, Unset, int] if isinstance(self.position, Unset): position = UNSET else: position = self.position - properties: list[dict[str, Any]] | Unset = UNSET + properties: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.properties, Unset): properties = [] for properties_item_data in self.properties: @@ -59,8 +74,12 @@ def to_dict(self) -> dict[str, Any]: "name": name, } ) + if slug is not UNSET: + field_dict["slug"] = slug if description is not UNSET: field_dict["description"] = description + if public_description is not UNSET: + field_dict["public_description"] = public_description if position is not UNSET: field_dict["position"] = position if properties is not UNSET: @@ -75,36 +94,54 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name") - def _parse_description(data: object) -> None | str | Unset: + def _parse_slug(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + slug = _parse_slug(d.pop("slug", UNSET)) + + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) - def _parse_position(data: object) -> int | None | Unset: + def _parse_public_description(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + public_description = _parse_public_description(d.pop("public_description", UNSET)) + + def _parse_position(data: object) -> Union[None, Unset, int]: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(Union[None, Unset, int], data) position = _parse_position(d.pop("position", UNSET)) + properties = [] _properties = d.pop("properties", UNSET) - properties: list[NewCauseDataAttributesPropertiesItem] | Unset = UNSET - if _properties is not UNSET: - properties = [] - for properties_item_data in _properties: - properties_item = NewCauseDataAttributesPropertiesItem.from_dict(properties_item_data) + for properties_item_data in _properties or []: + properties_item = NewCauseDataAttributesPropertiesItem.from_dict(properties_item_data) - properties.append(properties_item) + properties.append(properties_item) new_cause_data_attributes = cls( name=name, + slug=slug, description=description, + public_description=public_description, position=position, properties=properties, ) diff --git a/rootly_sdk/models/new_cause_data_attributes_properties_item.py b/rootly_sdk/models/new_cause_data_attributes_properties_item.py index da071245..bf8741fb 100644 --- a/rootly_sdk/models/new_cause_data_attributes_properties_item.py +++ b/rootly_sdk/models/new_cause_data_attributes_properties_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/new_communications_group.py b/rootly_sdk/models/new_communications_group.py index 5f9e95a9..c59f5362 100644 --- a/rootly_sdk/models/new_communications_group.py +++ b/rootly_sdk/models/new_communications_group.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewCommunicationsGroup: data (NewCommunicationsGroupData): """ - data: NewCommunicationsGroupData + data: "NewCommunicationsGroupData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_communications_group_data.py b/rootly_sdk/models/new_communications_group_data.py index fb3b0193..ef36edb1 100644 --- a/rootly_sdk/models/new_communications_group_data.py +++ b/rootly_sdk/models/new_communications_group_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class NewCommunicationsGroupData: """ type_: NewCommunicationsGroupDataType - attributes: NewCommunicationsGroupDataAttributes + attributes: "NewCommunicationsGroupDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_communications_group_data_attributes.py b/rootly_sdk/models/new_communications_group_data_attributes.py index e156f4be..95462b5e 100644 --- a/rootly_sdk/models/new_communications_group_data_attributes.py +++ b/rootly_sdk/models/new_communications_group_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -29,71 +27,70 @@ class NewCommunicationsGroupDataAttributes: Attributes: name (str): The name of the communications group communication_type_id (str): The communication type ID - description (None | str | Unset): The description of the communications group - is_private (bool | None | Unset): Whether the group is private - condition_type (NewCommunicationsGroupDataAttributesConditionType | Unset): Condition type - sms_channel (bool | None | Unset): SMS channel enabled - email_channel (bool | None | Unset): Email channel enabled - member_ids (list[int] | None | Unset): Array of member user IDs - slack_channel_ids (list[str] | None | Unset): Array of Slack channel IDs - communication_group_conditions (list[NewCommunicationsGroupDataAttributesCommunicationGroupConditionsType0Item] - | None | Unset): Group conditions attributes - communication_external_group_members - (list[NewCommunicationsGroupDataAttributesCommunicationExternalGroupMembersType0Item] | None | Unset): External - group members attributes + description (Union[None, Unset, str]): The description of the communications group + is_private (Union[None, Unset, bool]): Whether the group is private + condition_type (Union[Unset, NewCommunicationsGroupDataAttributesConditionType]): Condition type + sms_channel (Union[None, Unset, bool]): SMS channel enabled + email_channel (Union[None, Unset, bool]): Email channel enabled + member_ids (Union[None, Unset, list[int]]): Array of member user IDs + slack_channel_ids (Union[None, Unset, list[str]]): Array of Slack channel IDs + communication_group_conditions (Union[None, Unset, + list['NewCommunicationsGroupDataAttributesCommunicationGroupConditionsType0Item']]): Group conditions attributes + communication_external_group_members (Union[None, Unset, + list['NewCommunicationsGroupDataAttributesCommunicationExternalGroupMembersType0Item']]): External group members + attributes """ name: str communication_type_id: str - description: None | str | Unset = UNSET - is_private: bool | None | Unset = UNSET - condition_type: NewCommunicationsGroupDataAttributesConditionType | Unset = UNSET - sms_channel: bool | None | Unset = UNSET - email_channel: bool | None | Unset = UNSET - member_ids: list[int] | None | Unset = UNSET - slack_channel_ids: list[str] | None | Unset = UNSET - communication_group_conditions: ( - list[NewCommunicationsGroupDataAttributesCommunicationGroupConditionsType0Item] | None | Unset - ) = UNSET - communication_external_group_members: ( - list[NewCommunicationsGroupDataAttributesCommunicationExternalGroupMembersType0Item] | None | Unset - ) = UNSET + description: Union[None, Unset, str] = UNSET + is_private: Union[None, Unset, bool] = UNSET + condition_type: Union[Unset, NewCommunicationsGroupDataAttributesConditionType] = UNSET + sms_channel: Union[None, Unset, bool] = UNSET + email_channel: Union[None, Unset, bool] = UNSET + member_ids: Union[None, Unset, list[int]] = UNSET + slack_channel_ids: Union[None, Unset, list[str]] = UNSET + communication_group_conditions: Union[ + None, Unset, list["NewCommunicationsGroupDataAttributesCommunicationGroupConditionsType0Item"] + ] = UNSET + communication_external_group_members: Union[ + None, Unset, list["NewCommunicationsGroupDataAttributesCommunicationExternalGroupMembersType0Item"] + ] = UNSET def to_dict(self) -> dict[str, Any]: - name = self.name communication_type_id = self.communication_type_id - description: None | str | Unset + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: description = self.description - is_private: bool | None | Unset + is_private: Union[None, Unset, bool] if isinstance(self.is_private, Unset): is_private = UNSET else: is_private = self.is_private - condition_type: str | Unset = UNSET + condition_type: Union[Unset, str] = UNSET if not isinstance(self.condition_type, Unset): condition_type = self.condition_type - sms_channel: bool | None | Unset + sms_channel: Union[None, Unset, bool] if isinstance(self.sms_channel, Unset): sms_channel = UNSET else: sms_channel = self.sms_channel - email_channel: bool | None | Unset + email_channel: Union[None, Unset, bool] if isinstance(self.email_channel, Unset): email_channel = UNSET else: email_channel = self.email_channel - member_ids: list[int] | None | Unset + member_ids: Union[None, Unset, list[int]] if isinstance(self.member_ids, Unset): member_ids = UNSET elif isinstance(self.member_ids, list): @@ -102,7 +99,7 @@ def to_dict(self) -> dict[str, Any]: else: member_ids = self.member_ids - slack_channel_ids: list[str] | None | Unset + slack_channel_ids: Union[None, Unset, list[str]] if isinstance(self.slack_channel_ids, Unset): slack_channel_ids = UNSET elif isinstance(self.slack_channel_ids, list): @@ -111,7 +108,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_channel_ids = self.slack_channel_ids - communication_group_conditions: list[dict[str, Any]] | None | Unset + communication_group_conditions: Union[None, Unset, list[dict[str, Any]]] if isinstance(self.communication_group_conditions, Unset): communication_group_conditions = UNSET elif isinstance(self.communication_group_conditions, list): @@ -123,7 +120,7 @@ def to_dict(self) -> dict[str, Any]: else: communication_group_conditions = self.communication_group_conditions - communication_external_group_members: list[dict[str, Any]] | None | Unset + communication_external_group_members: Union[None, Unset, list[dict[str, Any]]] if isinstance(self.communication_external_group_members, Unset): communication_external_group_members = UNSET elif isinstance(self.communication_external_group_members, list): @@ -180,50 +177,50 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: communication_type_id = d.pop("communication_type_id") - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) - def _parse_is_private(data: object) -> bool | None | Unset: + def _parse_is_private(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) is_private = _parse_is_private(d.pop("is_private", UNSET)) _condition_type = d.pop("condition_type", UNSET) - condition_type: NewCommunicationsGroupDataAttributesConditionType | Unset + condition_type: Union[Unset, NewCommunicationsGroupDataAttributesConditionType] if isinstance(_condition_type, Unset): condition_type = UNSET else: condition_type = check_new_communications_group_data_attributes_condition_type(_condition_type) - def _parse_sms_channel(data: object) -> bool | None | Unset: + def _parse_sms_channel(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) sms_channel = _parse_sms_channel(d.pop("sms_channel", UNSET)) - def _parse_email_channel(data: object) -> bool | None | Unset: + def _parse_email_channel(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) email_channel = _parse_email_channel(d.pop("email_channel", UNSET)) - def _parse_member_ids(data: object) -> list[int] | None | Unset: + def _parse_member_ids(data: object) -> Union[None, Unset, list[int]]: if data is None: return data if isinstance(data, Unset): @@ -234,13 +231,13 @@ def _parse_member_ids(data: object) -> list[int] | None | Unset: member_ids_type_0 = cast(list[int], data) return member_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[int] | None | Unset, data) + return cast(Union[None, Unset, list[int]], data) member_ids = _parse_member_ids(d.pop("member_ids", UNSET)) - def _parse_slack_channel_ids(data: object) -> list[str] | None | Unset: + def _parse_slack_channel_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -251,15 +248,15 @@ def _parse_slack_channel_ids(data: object) -> list[str] | None | Unset: slack_channel_ids_type_0 = cast(list[str], data) return slack_channel_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) slack_channel_ids = _parse_slack_channel_ids(d.pop("slack_channel_ids", UNSET)) def _parse_communication_group_conditions( data: object, - ) -> list[NewCommunicationsGroupDataAttributesCommunicationGroupConditionsType0Item] | None | Unset: + ) -> Union[None, Unset, list["NewCommunicationsGroupDataAttributesCommunicationGroupConditionsType0Item"]]: if data is None: return data if isinstance(data, Unset): @@ -279,10 +276,11 @@ def _parse_communication_group_conditions( communication_group_conditions_type_0.append(communication_group_conditions_type_0_item) return communication_group_conditions_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass return cast( - list[NewCommunicationsGroupDataAttributesCommunicationGroupConditionsType0Item] | None | Unset, data + Union[None, Unset, list["NewCommunicationsGroupDataAttributesCommunicationGroupConditionsType0Item"]], + data, ) communication_group_conditions = _parse_communication_group_conditions( @@ -291,7 +289,7 @@ def _parse_communication_group_conditions( def _parse_communication_external_group_members( data: object, - ) -> list[NewCommunicationsGroupDataAttributesCommunicationExternalGroupMembersType0Item] | None | Unset: + ) -> Union[None, Unset, list["NewCommunicationsGroupDataAttributesCommunicationExternalGroupMembersType0Item"]]: if data is None: return data if isinstance(data, Unset): @@ -313,10 +311,12 @@ def _parse_communication_external_group_members( communication_external_group_members_type_0.append(communication_external_group_members_type_0_item) return communication_external_group_members_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass return cast( - list[NewCommunicationsGroupDataAttributesCommunicationExternalGroupMembersType0Item] | None | Unset, + Union[ + None, Unset, list["NewCommunicationsGroupDataAttributesCommunicationExternalGroupMembersType0Item"] + ], data, ) diff --git a/rootly_sdk/models/new_communications_group_data_attributes_communication_external_group_members_type_0_item.py b/rootly_sdk/models/new_communications_group_data_attributes_communication_external_group_members_type_0_item.py index 4cb512ee..ad18565e 100644 --- a/rootly_sdk/models/new_communications_group_data_attributes_communication_external_group_members_type_0_item.py +++ b/rootly_sdk/models/new_communications_group_data_attributes_communication_external_group_members_type_0_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,14 +13,14 @@ class NewCommunicationsGroupDataAttributesCommunicationExternalGroupMembersType0Item: """ Attributes: - name (str | Unset): Name of the external member - email (str | Unset): Email of the external member - phone_number (str | Unset): Phone number of the external member + name (Union[Unset, str]): Name of the external member + email (Union[Unset, str]): Email of the external member + phone_number (Union[Unset, str]): Phone number of the external member """ - name: str | Unset = UNSET - email: str | Unset = UNSET - phone_number: str | Unset = UNSET + name: Union[Unset, str] = UNSET + email: Union[Unset, str] = UNSET + phone_number: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/new_communications_group_data_attributes_communication_group_conditions_type_0_item.py b/rootly_sdk/models/new_communications_group_data_attributes_communication_group_conditions_type_0_item.py index 06d190a0..5adb07cb 100644 --- a/rootly_sdk/models/new_communications_group_data_attributes_communication_group_conditions_type_0_item.py +++ b/rootly_sdk/models/new_communications_group_data_attributes_communication_group_conditions_type_0_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,29 +17,31 @@ class NewCommunicationsGroupDataAttributesCommunicationGroupConditionsType0Item: """ Attributes: - property_type (NewCommunicationsGroupDataAttributesCommunicationGroupConditionsType0ItemPropertyType | Unset): - Property type - service_ids (list[str] | None | Unset): Array of service IDs - severity_ids (list[str] | None | Unset): Array of severity IDs - functionality_ids (list[str] | None | Unset): Array of functionality IDs - group_ids (list[str] | None | Unset): Array of group IDs - incident_type_ids (list[str] | None | Unset): Array of incident type IDs + property_type (Union[Unset, + NewCommunicationsGroupDataAttributesCommunicationGroupConditionsType0ItemPropertyType]): Property type + service_ids (Union[None, Unset, list[str]]): Array of service IDs + severity_ids (Union[None, Unset, list[str]]): Array of severity IDs + functionality_ids (Union[None, Unset, list[str]]): Array of functionality IDs + group_ids (Union[None, Unset, list[str]]): Array of group IDs + incident_type_ids (Union[None, Unset, list[str]]): Array of incident type IDs """ - property_type: NewCommunicationsGroupDataAttributesCommunicationGroupConditionsType0ItemPropertyType | Unset = UNSET - service_ids: list[str] | None | Unset = UNSET - severity_ids: list[str] | None | Unset = UNSET - functionality_ids: list[str] | None | Unset = UNSET - group_ids: list[str] | None | Unset = UNSET - incident_type_ids: list[str] | None | Unset = UNSET + property_type: Union[ + Unset, NewCommunicationsGroupDataAttributesCommunicationGroupConditionsType0ItemPropertyType + ] = UNSET + service_ids: Union[None, Unset, list[str]] = UNSET + severity_ids: Union[None, Unset, list[str]] = UNSET + functionality_ids: Union[None, Unset, list[str]] = UNSET + group_ids: Union[None, Unset, list[str]] = UNSET + incident_type_ids: Union[None, Unset, list[str]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - property_type: str | Unset = UNSET + property_type: Union[Unset, str] = UNSET if not isinstance(self.property_type, Unset): property_type = self.property_type - service_ids: list[str] | None | Unset + service_ids: Union[None, Unset, list[str]] if isinstance(self.service_ids, Unset): service_ids = UNSET elif isinstance(self.service_ids, list): @@ -50,7 +50,7 @@ def to_dict(self) -> dict[str, Any]: else: service_ids = self.service_ids - severity_ids: list[str] | None | Unset + severity_ids: Union[None, Unset, list[str]] if isinstance(self.severity_ids, Unset): severity_ids = UNSET elif isinstance(self.severity_ids, list): @@ -59,7 +59,7 @@ def to_dict(self) -> dict[str, Any]: else: severity_ids = self.severity_ids - functionality_ids: list[str] | None | Unset + functionality_ids: Union[None, Unset, list[str]] if isinstance(self.functionality_ids, Unset): functionality_ids = UNSET elif isinstance(self.functionality_ids, list): @@ -68,7 +68,7 @@ def to_dict(self) -> dict[str, Any]: else: functionality_ids = self.functionality_ids - group_ids: list[str] | None | Unset + group_ids: Union[None, Unset, list[str]] if isinstance(self.group_ids, Unset): group_ids = UNSET elif isinstance(self.group_ids, list): @@ -77,7 +77,7 @@ def to_dict(self) -> dict[str, Any]: else: group_ids = self.group_ids - incident_type_ids: list[str] | None | Unset + incident_type_ids: Union[None, Unset, list[str]] if isinstance(self.incident_type_ids, Unset): incident_type_ids = UNSET elif isinstance(self.incident_type_ids, list): @@ -108,7 +108,9 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _property_type = d.pop("property_type", UNSET) - property_type: NewCommunicationsGroupDataAttributesCommunicationGroupConditionsType0ItemPropertyType | Unset + property_type: Union[ + Unset, NewCommunicationsGroupDataAttributesCommunicationGroupConditionsType0ItemPropertyType + ] if isinstance(_property_type, Unset): property_type = UNSET else: @@ -118,7 +120,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: ) ) - def _parse_service_ids(data: object) -> list[str] | None | Unset: + def _parse_service_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -129,13 +131,13 @@ def _parse_service_ids(data: object) -> list[str] | None | Unset: service_ids_type_0 = cast(list[str], data) return service_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) service_ids = _parse_service_ids(d.pop("service_ids", UNSET)) - def _parse_severity_ids(data: object) -> list[str] | None | Unset: + def _parse_severity_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -146,13 +148,13 @@ def _parse_severity_ids(data: object) -> list[str] | None | Unset: severity_ids_type_0 = cast(list[str], data) return severity_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) severity_ids = _parse_severity_ids(d.pop("severity_ids", UNSET)) - def _parse_functionality_ids(data: object) -> list[str] | None | Unset: + def _parse_functionality_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -163,13 +165,13 @@ def _parse_functionality_ids(data: object) -> list[str] | None | Unset: functionality_ids_type_0 = cast(list[str], data) return functionality_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) functionality_ids = _parse_functionality_ids(d.pop("functionality_ids", UNSET)) - def _parse_group_ids(data: object) -> list[str] | None | Unset: + def _parse_group_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -180,13 +182,13 @@ def _parse_group_ids(data: object) -> list[str] | None | Unset: group_ids_type_0 = cast(list[str], data) return group_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) group_ids = _parse_group_ids(d.pop("group_ids", UNSET)) - def _parse_incident_type_ids(data: object) -> list[str] | None | Unset: + def _parse_incident_type_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -197,9 +199,9 @@ def _parse_incident_type_ids(data: object) -> list[str] | None | Unset: incident_type_ids_type_0 = cast(list[str], data) return incident_type_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) incident_type_ids = _parse_incident_type_ids(d.pop("incident_type_ids", UNSET)) diff --git a/rootly_sdk/models/new_communications_stage.py b/rootly_sdk/models/new_communications_stage.py index d57d331d..255f3d6e 100644 --- a/rootly_sdk/models/new_communications_stage.py +++ b/rootly_sdk/models/new_communications_stage.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewCommunicationsStage: data (NewCommunicationsStageData): """ - data: NewCommunicationsStageData + data: "NewCommunicationsStageData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_communications_stage_data.py b/rootly_sdk/models/new_communications_stage_data.py index 9f3d231c..7b63efc0 100644 --- a/rootly_sdk/models/new_communications_stage_data.py +++ b/rootly_sdk/models/new_communications_stage_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class NewCommunicationsStageData: """ type_: NewCommunicationsStageDataType - attributes: NewCommunicationsStageDataAttributes + attributes: "NewCommunicationsStageDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_communications_stage_data_attributes.py b/rootly_sdk/models/new_communications_stage_data_attributes.py index 625f18e7..14e2fcdf 100644 --- a/rootly_sdk/models/new_communications_stage_data_attributes.py +++ b/rootly_sdk/models/new_communications_stage_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -15,24 +13,33 @@ class NewCommunicationsStageDataAttributes: """ Attributes: name (str): The name of the communications stage - description (None | str | Unset): The description of the communications stage - position (int | None | Unset): Position of the communications stage + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + description (Union[None, Unset, str]): The description of the communications stage + position (Union[None, Unset, int]): Position of the communications stage """ name: str - description: None | str | Unset = UNSET - position: int | None | Unset = UNSET + slug: Union[None, Unset, str] = UNSET + description: Union[None, Unset, str] = UNSET + position: Union[None, Unset, int] = UNSET def to_dict(self) -> dict[str, Any]: name = self.name - description: None | str | Unset + slug: Union[None, Unset, str] + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug + + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: description = self.description - position: int | None | Unset + position: Union[None, Unset, int] if isinstance(self.position, Unset): position = UNSET else: @@ -45,6 +52,8 @@ def to_dict(self) -> dict[str, Any]: "name": name, } ) + if slug is not UNSET: + field_dict["slug"] = slug if description is not UNSET: field_dict["description"] = description if position is not UNSET: @@ -57,26 +66,36 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name") - def _parse_description(data: object) -> None | str | Unset: + def _parse_slug(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + slug = _parse_slug(d.pop("slug", UNSET)) + + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> Union[None, Unset, int]: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(Union[None, Unset, int], data) position = _parse_position(d.pop("position", UNSET)) new_communications_stage_data_attributes = cls( name=name, + slug=slug, description=description, position=position, ) diff --git a/rootly_sdk/models/new_communications_template.py b/rootly_sdk/models/new_communications_template.py index 006dea09..9736c747 100644 --- a/rootly_sdk/models/new_communications_template.py +++ b/rootly_sdk/models/new_communications_template.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewCommunicationsTemplate: data (NewCommunicationsTemplateData): """ - data: NewCommunicationsTemplateData + data: "NewCommunicationsTemplateData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_communications_template_data.py b/rootly_sdk/models/new_communications_template_data.py index 086a413b..d82c8d18 100644 --- a/rootly_sdk/models/new_communications_template_data.py +++ b/rootly_sdk/models/new_communications_template_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class NewCommunicationsTemplateData: """ type_: NewCommunicationsTemplateDataType - attributes: NewCommunicationsTemplateDataAttributes + attributes: "NewCommunicationsTemplateDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_communications_template_data_attributes.py b/rootly_sdk/models/new_communications_template_data_attributes.py index e555a355..3d97aef7 100644 --- a/rootly_sdk/models/new_communications_template_data_attributes.py +++ b/rootly_sdk/models/new_communications_template_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -22,40 +20,39 @@ class NewCommunicationsTemplateDataAttributes: Attributes: name (str): The name of the communications template communication_type_id (str): The communication type ID - description (None | str | Unset): The description of the communications template - position (int | None | Unset): Position of the communications template - communication_template_stages_attributes - (list[NewCommunicationsTemplateDataAttributesCommunicationTemplateStagesAttributesType0Item] | None | Unset): - Template stages attributes + description (Union[None, Unset, str]): The description of the communications template + position (Union[None, Unset, int]): Position of the communications template + communication_template_stages_attributes (Union[None, Unset, + list['NewCommunicationsTemplateDataAttributesCommunicationTemplateStagesAttributesType0Item']]): Template stages + attributes """ name: str communication_type_id: str - description: None | str | Unset = UNSET - position: int | None | Unset = UNSET - communication_template_stages_attributes: ( - list[NewCommunicationsTemplateDataAttributesCommunicationTemplateStagesAttributesType0Item] | None | Unset - ) = UNSET + description: Union[None, Unset, str] = UNSET + position: Union[None, Unset, int] = UNSET + communication_template_stages_attributes: Union[ + None, Unset, list["NewCommunicationsTemplateDataAttributesCommunicationTemplateStagesAttributesType0Item"] + ] = UNSET def to_dict(self) -> dict[str, Any]: - name = self.name communication_type_id = self.communication_type_id - description: None | str | Unset + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: description = self.description - position: int | None | Unset + position: Union[None, Unset, int] if isinstance(self.position, Unset): position = UNSET else: position = self.position - communication_template_stages_attributes: list[dict[str, Any]] | None | Unset + communication_template_stages_attributes: Union[None, Unset, list[dict[str, Any]]] if isinstance(self.communication_template_stages_attributes, Unset): communication_template_stages_attributes = UNSET elif isinstance(self.communication_template_stages_attributes, list): @@ -99,27 +96,29 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: communication_type_id = d.pop("communication_type_id") - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> Union[None, Unset, int]: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(Union[None, Unset, int], data) position = _parse_position(d.pop("position", UNSET)) def _parse_communication_template_stages_attributes( data: object, - ) -> list[NewCommunicationsTemplateDataAttributesCommunicationTemplateStagesAttributesType0Item] | None | Unset: + ) -> Union[ + None, Unset, list["NewCommunicationsTemplateDataAttributesCommunicationTemplateStagesAttributesType0Item"] + ]: if data is None: return data if isinstance(data, Unset): @@ -143,12 +142,14 @@ def _parse_communication_template_stages_attributes( ) return communication_template_stages_attributes_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass return cast( - list[NewCommunicationsTemplateDataAttributesCommunicationTemplateStagesAttributesType0Item] - | None - | Unset, + Union[ + None, + Unset, + list["NewCommunicationsTemplateDataAttributesCommunicationTemplateStagesAttributesType0Item"], + ], data, ) diff --git a/rootly_sdk/models/new_communications_template_data_attributes_communication_template_stages_attributes_type_0_item.py b/rootly_sdk/models/new_communications_template_data_attributes_communication_template_stages_attributes_type_0_item.py index 07f47a09..748dc958 100644 --- a/rootly_sdk/models/new_communications_template_data_attributes_communication_template_stages_attributes_type_0_item.py +++ b/rootly_sdk/models/new_communications_template_data_attributes_communication_template_stages_attributes_type_0_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,42 +13,42 @@ class NewCommunicationsTemplateDataAttributesCommunicationTemplateStagesAttributesType0Item: """ Attributes: - communication_stage_id (str | Unset): The communication stage ID - sms_content (None | str | Unset): SMS content for the stage - email_subject (None | str | Unset): Email subject for the stage - email_body (None | str | Unset): Email body for the stage - slack_content (None | str | Unset): Slack content for the stage + communication_stage_id (Union[Unset, str]): The communication stage ID + sms_content (Union[None, Unset, str]): SMS content for the stage + email_subject (Union[None, Unset, str]): Email subject for the stage + email_body (Union[None, Unset, str]): Email body for the stage + slack_content (Union[None, Unset, str]): Slack content for the stage """ - communication_stage_id: str | Unset = UNSET - sms_content: None | str | Unset = UNSET - email_subject: None | str | Unset = UNSET - email_body: None | str | Unset = UNSET - slack_content: None | str | Unset = UNSET + communication_stage_id: Union[Unset, str] = UNSET + sms_content: Union[None, Unset, str] = UNSET + email_subject: Union[None, Unset, str] = UNSET + email_body: Union[None, Unset, str] = UNSET + slack_content: Union[None, Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: communication_stage_id = self.communication_stage_id - sms_content: None | str | Unset + sms_content: Union[None, Unset, str] if isinstance(self.sms_content, Unset): sms_content = UNSET else: sms_content = self.sms_content - email_subject: None | str | Unset + email_subject: Union[None, Unset, str] if isinstance(self.email_subject, Unset): email_subject = UNSET else: email_subject = self.email_subject - email_body: None | str | Unset + email_body: Union[None, Unset, str] if isinstance(self.email_body, Unset): email_body = UNSET else: email_body = self.email_body - slack_content: None | str | Unset + slack_content: Union[None, Unset, str] if isinstance(self.slack_content, Unset): slack_content = UNSET else: @@ -77,39 +75,39 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) communication_stage_id = d.pop("communication_stage_id", UNSET) - def _parse_sms_content(data: object) -> None | str | Unset: + def _parse_sms_content(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) sms_content = _parse_sms_content(d.pop("sms_content", UNSET)) - def _parse_email_subject(data: object) -> None | str | Unset: + def _parse_email_subject(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) email_subject = _parse_email_subject(d.pop("email_subject", UNSET)) - def _parse_email_body(data: object) -> None | str | Unset: + def _parse_email_body(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) email_body = _parse_email_body(d.pop("email_body", UNSET)) - def _parse_slack_content(data: object) -> None | str | Unset: + def _parse_slack_content(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) slack_content = _parse_slack_content(d.pop("slack_content", UNSET)) diff --git a/rootly_sdk/models/new_communications_type.py b/rootly_sdk/models/new_communications_type.py index 473d00ca..13a637a3 100644 --- a/rootly_sdk/models/new_communications_type.py +++ b/rootly_sdk/models/new_communications_type.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewCommunicationsType: data (NewCommunicationsTypeData): """ - data: NewCommunicationsTypeData + data: "NewCommunicationsTypeData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_communications_type_data.py b/rootly_sdk/models/new_communications_type_data.py index 709dcbfd..b3f273d1 100644 --- a/rootly_sdk/models/new_communications_type_data.py +++ b/rootly_sdk/models/new_communications_type_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class NewCommunicationsTypeData: """ type_: NewCommunicationsTypeDataType - attributes: NewCommunicationsTypeDataAttributes + attributes: "NewCommunicationsTypeDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_communications_type_data_attributes.py b/rootly_sdk/models/new_communications_type_data_attributes.py index 3d65eda4..4e0cb79d 100644 --- a/rootly_sdk/models/new_communications_type_data_attributes.py +++ b/rootly_sdk/models/new_communications_type_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -15,29 +13,38 @@ class NewCommunicationsTypeDataAttributes: """ Attributes: name (str): The name of the communications type - color (None | str): The color of the communications type - description (None | str | Unset): The description of the communications type - position (int | None | Unset): Position of the communications type + color (Union[None, str]): The color of the communications type + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + description (Union[None, Unset, str]): The description of the communications type + position (Union[None, Unset, int]): Position of the communications type """ name: str - color: None | str - description: None | str | Unset = UNSET - position: int | None | Unset = UNSET + color: Union[None, str] + slug: Union[None, Unset, str] = UNSET + description: Union[None, Unset, str] = UNSET + position: Union[None, Unset, int] = UNSET def to_dict(self) -> dict[str, Any]: name = self.name - color: None | str + color: Union[None, str] color = self.color - description: None | str | Unset + slug: Union[None, Unset, str] + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug + + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: description = self.description - position: int | None | Unset + position: Union[None, Unset, int] if isinstance(self.position, Unset): position = UNSET else: @@ -51,6 +58,8 @@ def to_dict(self) -> dict[str, Any]: "color": color, } ) + if slug is not UNSET: + field_dict["slug"] = slug if description is not UNSET: field_dict["description"] = description if position is not UNSET: @@ -63,34 +72,44 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name") - def _parse_color(data: object) -> None | str: + def _parse_color(data: object) -> Union[None, str]: if data is None: return data - return cast(None | str, data) + return cast(Union[None, str], data) color = _parse_color(d.pop("color")) - def _parse_description(data: object) -> None | str | Unset: + def _parse_slug(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + slug = _parse_slug(d.pop("slug", UNSET)) + + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> Union[None, Unset, int]: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(Union[None, Unset, int], data) position = _parse_position(d.pop("position", UNSET)) new_communications_type_data_attributes = cls( name=name, color=color, + slug=slug, description=description, position=position, ) diff --git a/rootly_sdk/models/new_custom_field.py b/rootly_sdk/models/new_custom_field.py index eedfff24..4e234541 100644 --- a/rootly_sdk/models/new_custom_field.py +++ b/rootly_sdk/models/new_custom_field.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewCustomField: data (NewCustomFieldData): """ - data: NewCustomFieldData + data: "NewCustomFieldData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_custom_field_data.py b/rootly_sdk/models/new_custom_field_data.py index 16d37a7b..4d28f75f 100644 --- a/rootly_sdk/models/new_custom_field_data.py +++ b/rootly_sdk/models/new_custom_field_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class NewCustomFieldData: """ type_: NewCustomFieldDataType - attributes: NewCustomFieldDataAttributes + attributes: "NewCustomFieldDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_custom_field_data_attributes.py b/rootly_sdk/models/new_custom_field_data_attributes.py index f91d2f06..303d3003 100644 --- a/rootly_sdk/models/new_custom_field_data_attributes.py +++ b/rootly_sdk/models/new_custom_field_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -23,37 +21,37 @@ class NewCustomFieldDataAttributes: """ Attributes: label (str): The name of the custom_field - description (None | str | Unset): The description of the custom_field - shown (list[NewCustomFieldDataAttributesShownItem] | Unset): - required (list[NewCustomFieldDataAttributesRequiredType0Item] | None | Unset): - default (None | str | Unset): The default value for text field kinds - position (int | Unset): The position of the custom_field + description (Union[None, Unset, str]): The description of the custom_field + shown (Union[Unset, list[NewCustomFieldDataAttributesShownItem]]): + required (Union[None, Unset, list[NewCustomFieldDataAttributesRequiredType0Item]]): + default (Union[None, Unset, str]): The default value for text field kinds + position (Union[Unset, int]): The position of the custom_field """ label: str - description: None | str | Unset = UNSET - shown: list[NewCustomFieldDataAttributesShownItem] | Unset = UNSET - required: list[NewCustomFieldDataAttributesRequiredType0Item] | None | Unset = UNSET - default: None | str | Unset = UNSET - position: int | Unset = UNSET + description: Union[None, Unset, str] = UNSET + shown: Union[Unset, list[NewCustomFieldDataAttributesShownItem]] = UNSET + required: Union[None, Unset, list[NewCustomFieldDataAttributesRequiredType0Item]] = UNSET + default: Union[None, Unset, str] = UNSET + position: Union[Unset, int] = UNSET def to_dict(self) -> dict[str, Any]: label = self.label - description: None | str | Unset + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: description = self.description - shown: list[str] | Unset = UNSET + shown: Union[Unset, list[str]] = UNSET if not isinstance(self.shown, Unset): shown = [] for shown_item_data in self.shown: shown_item: str = shown_item_data shown.append(shown_item) - required: list[str] | None | Unset + required: Union[None, Unset, list[str]] if isinstance(self.required, Unset): required = UNSET elif isinstance(self.required, list): @@ -65,7 +63,7 @@ def to_dict(self) -> dict[str, Any]: else: required = self.required - default: None | str | Unset + default: Union[None, Unset, str] if isinstance(self.default, Unset): default = UNSET else: @@ -98,25 +96,23 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) label = d.pop("label") - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) + shown = [] _shown = d.pop("shown", UNSET) - shown: list[NewCustomFieldDataAttributesShownItem] | Unset = UNSET - if _shown is not UNSET: - shown = [] - for shown_item_data in _shown: - shown_item = check_new_custom_field_data_attributes_shown_item(shown_item_data) + for shown_item_data in _shown or []: + shown_item = check_new_custom_field_data_attributes_shown_item(shown_item_data) - shown.append(shown_item) + shown.append(shown_item) - def _parse_required(data: object) -> list[NewCustomFieldDataAttributesRequiredType0Item] | None | Unset: + def _parse_required(data: object) -> Union[None, Unset, list[NewCustomFieldDataAttributesRequiredType0Item]]: if data is None: return data if isinstance(data, Unset): @@ -134,18 +130,18 @@ def _parse_required(data: object) -> list[NewCustomFieldDataAttributesRequiredTy required_type_0.append(required_type_0_item) return required_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[NewCustomFieldDataAttributesRequiredType0Item] | None | Unset, data) + return cast(Union[None, Unset, list[NewCustomFieldDataAttributesRequiredType0Item]], data) required = _parse_required(d.pop("required", UNSET)) - def _parse_default(data: object) -> None | str | Unset: + def _parse_default(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) default = _parse_default(d.pop("default", UNSET)) diff --git a/rootly_sdk/models/new_custom_field_option.py b/rootly_sdk/models/new_custom_field_option.py index 430c0138..21bc5210 100644 --- a/rootly_sdk/models/new_custom_field_option.py +++ b/rootly_sdk/models/new_custom_field_option.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewCustomFieldOption: data (NewCustomFieldOptionData): """ - data: NewCustomFieldOptionData + data: "NewCustomFieldOptionData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_custom_field_option_data.py b/rootly_sdk/models/new_custom_field_option_data.py index 559f0951..44112638 100644 --- a/rootly_sdk/models/new_custom_field_option_data.py +++ b/rootly_sdk/models/new_custom_field_option_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class NewCustomFieldOptionData: """ type_: NewCustomFieldOptionDataType - attributes: NewCustomFieldOptionDataAttributes + attributes: "NewCustomFieldOptionDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_custom_field_option_data_attributes.py b/rootly_sdk/models/new_custom_field_option_data_attributes.py index 327dadf0..b02253d4 100644 --- a/rootly_sdk/models/new_custom_field_option_data_attributes.py +++ b/rootly_sdk/models/new_custom_field_option_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define @@ -15,15 +13,15 @@ class NewCustomFieldOptionDataAttributes: """ Attributes: value (str): The value of the custom_field_option - color (str | Unset): The hex color of the custom_field_option - default (bool | Unset): - position (int | Unset): The position of the custom_field_option + color (Union[Unset, str]): The hex color of the custom_field_option + default (Union[Unset, bool]): + position (Union[Unset, int]): The position of the custom_field_option """ value: str - color: str | Unset = UNSET - default: bool | Unset = UNSET - position: int | Unset = UNSET + color: Union[Unset, str] = UNSET + default: Union[Unset, bool] = UNSET + position: Union[Unset, int] = UNSET def to_dict(self) -> dict[str, Any]: value = self.value diff --git a/rootly_sdk/models/new_custom_form.py b/rootly_sdk/models/new_custom_form.py index c3bb94a5..b4884ddc 100644 --- a/rootly_sdk/models/new_custom_form.py +++ b/rootly_sdk/models/new_custom_form.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewCustomForm: data (NewCustomFormData): """ - data: NewCustomFormData + data: "NewCustomFormData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_custom_form_data.py b/rootly_sdk/models/new_custom_form_data.py index 10b2b5b9..e4300fab 100644 --- a/rootly_sdk/models/new_custom_form_data.py +++ b/rootly_sdk/models/new_custom_form_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class NewCustomFormData: """ type_: NewCustomFormDataType - attributes: NewCustomFormDataAttributes + attributes: "NewCustomFormDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_custom_form_data_attributes.py b/rootly_sdk/models/new_custom_form_data_attributes.py index 747cac35..fba6ae44 100644 --- a/rootly_sdk/models/new_custom_form_data_attributes.py +++ b/rootly_sdk/models/new_custom_form_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -16,21 +14,30 @@ class NewCustomFormDataAttributes: Attributes: name (str): The name of the custom form. command (str): The Slack command used to trigger this form. - description (None | str | Unset): - enabled (bool | Unset): + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + description (Union[None, Unset, str]): + enabled (Union[Unset, bool]): """ name: str command: str - description: None | str | Unset = UNSET - enabled: bool | Unset = UNSET + slug: Union[None, Unset, str] = UNSET + description: Union[None, Unset, str] = UNSET + enabled: Union[Unset, bool] = UNSET def to_dict(self) -> dict[str, Any]: name = self.name command = self.command - description: None | str | Unset + slug: Union[None, Unset, str] + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug + + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: @@ -46,6 +53,8 @@ def to_dict(self) -> dict[str, Any]: "command": command, } ) + if slug is not UNSET: + field_dict["slug"] = slug if description is not UNSET: field_dict["description"] = description if enabled is not UNSET: @@ -60,12 +69,21 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: command = d.pop("command") - def _parse_description(data: object) -> None | str | Unset: + def _parse_slug(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + slug = _parse_slug(d.pop("slug", UNSET)) + + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) @@ -74,6 +92,7 @@ def _parse_description(data: object) -> None | str | Unset: new_custom_form_data_attributes = cls( name=name, command=command, + slug=slug, description=description, enabled=enabled, ) diff --git a/rootly_sdk/models/new_dashboard.py b/rootly_sdk/models/new_dashboard.py index 6248ee11..83310749 100644 --- a/rootly_sdk/models/new_dashboard.py +++ b/rootly_sdk/models/new_dashboard.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewDashboard: data (NewDashboardData): """ - data: NewDashboardData + data: "NewDashboardData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_dashboard_data.py b/rootly_sdk/models/new_dashboard_data.py index c0551ebc..36644464 100644 --- a/rootly_sdk/models/new_dashboard_data.py +++ b/rootly_sdk/models/new_dashboard_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class NewDashboardData: """ type_: NewDashboardDataType - attributes: NewDashboardDataAttributes + attributes: "NewDashboardDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_dashboard_data_attributes.py b/rootly_sdk/models/new_dashboard_data_attributes.py index 95617d9a..0d84864f 100644 --- a/rootly_sdk/models/new_dashboard_data_attributes.py +++ b/rootly_sdk/models/new_dashboard_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -28,31 +26,31 @@ class NewDashboardDataAttributes: Attributes: name (str): The name of the dashboard owner (NewDashboardDataAttributesOwner): The owner type of the dashboard - description (None | str | Unset): The description of the dashboard - public (bool | Unset): Whether the dashboard is public - range_ (None | str | Unset): The date range for dashboard panel data - auto_refresh (bool | Unset): Whether the dashboard auto-updates the UI with new data. - color (NewDashboardDataAttributesColor | Unset): The hex color of the dashboard - icon (str | Unset): The emoji icon of the dashboard - period (NewDashboardDataAttributesPeriod | Unset): The grouping period for dashboard panel data + description (Union[None, Unset, str]): The description of the dashboard + public (Union[Unset, bool]): Whether the dashboard is public + range_ (Union[None, Unset, str]): The date range for dashboard panel data + auto_refresh (Union[Unset, bool]): Whether the dashboard auto-updates the UI with new data. + color (Union[Unset, NewDashboardDataAttributesColor]): The hex color of the dashboard + icon (Union[Unset, str]): The emoji icon of the dashboard + period (Union[Unset, NewDashboardDataAttributesPeriod]): The grouping period for dashboard panel data """ name: str owner: NewDashboardDataAttributesOwner - description: None | str | Unset = UNSET - public: bool | Unset = UNSET - range_: None | str | Unset = UNSET - auto_refresh: bool | Unset = UNSET - color: NewDashboardDataAttributesColor | Unset = UNSET - icon: str | Unset = UNSET - period: NewDashboardDataAttributesPeriod | Unset = UNSET + description: Union[None, Unset, str] = UNSET + public: Union[Unset, bool] = UNSET + range_: Union[None, Unset, str] = UNSET + auto_refresh: Union[Unset, bool] = UNSET + color: Union[Unset, NewDashboardDataAttributesColor] = UNSET + icon: Union[Unset, str] = UNSET + period: Union[Unset, NewDashboardDataAttributesPeriod] = UNSET def to_dict(self) -> dict[str, Any]: name = self.name owner: str = self.owner - description: None | str | Unset + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: @@ -60,7 +58,7 @@ def to_dict(self) -> dict[str, Any]: public = self.public - range_: None | str | Unset + range_: Union[None, Unset, str] if isinstance(self.range_, Unset): range_ = UNSET else: @@ -68,13 +66,13 @@ def to_dict(self) -> dict[str, Any]: auto_refresh = self.auto_refresh - color: str | Unset = UNSET + color: Union[Unset, str] = UNSET if not isinstance(self.color, Unset): color = self.color icon = self.icon - period: str | Unset = UNSET + period: Union[Unset, str] = UNSET if not isinstance(self.period, Unset): period = self.period @@ -110,30 +108,30 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: owner = check_new_dashboard_data_attributes_owner(d.pop("owner")) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) public = d.pop("public", UNSET) - def _parse_range_(data: object) -> None | str | Unset: + def _parse_range_(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) range_ = _parse_range_(d.pop("range", UNSET)) auto_refresh = d.pop("auto_refresh", UNSET) _color = d.pop("color", UNSET) - color: NewDashboardDataAttributesColor | Unset + color: Union[Unset, NewDashboardDataAttributesColor] if isinstance(_color, Unset): color = UNSET else: @@ -142,7 +140,7 @@ def _parse_range_(data: object) -> None | str | Unset: icon = d.pop("icon", UNSET) _period = d.pop("period", UNSET) - period: NewDashboardDataAttributesPeriod | Unset + period: Union[Unset, NewDashboardDataAttributesPeriod] if isinstance(_period, Unset): period = UNSET else: diff --git a/rootly_sdk/models/new_dashboard_panel.py b/rootly_sdk/models/new_dashboard_panel.py index 0a030c43..1d97f0c7 100644 --- a/rootly_sdk/models/new_dashboard_panel.py +++ b/rootly_sdk/models/new_dashboard_panel.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewDashboardPanel: data (NewDashboardPanelData): """ - data: NewDashboardPanelData + data: "NewDashboardPanelData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_dashboard_panel_data.py b/rootly_sdk/models/new_dashboard_panel_data.py index 3cc44773..78a4f6cf 100644 --- a/rootly_sdk/models/new_dashboard_panel_data.py +++ b/rootly_sdk/models/new_dashboard_panel_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class NewDashboardPanelData: """ type_: NewDashboardPanelDataType - attributes: NewDashboardPanelDataAttributes + attributes: "NewDashboardPanelDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_dashboard_panel_data_attributes.py b/rootly_sdk/models/new_dashboard_panel_data_attributes.py index 3571d9eb..d81d40cb 100644 --- a/rootly_sdk/models/new_dashboard_panel_data_attributes.py +++ b/rootly_sdk/models/new_dashboard_panel_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -22,13 +20,13 @@ class NewDashboardPanelDataAttributes: """ Attributes: params (NewDashboardPanelDataAttributesParams): - name (None | str | Unset): The name of the dashboard_panel - position (NewDashboardPanelDataAttributesPositionType0 | None | Unset): + name (Union[None, Unset, str]): The name of the dashboard_panel + position (Union['NewDashboardPanelDataAttributesPositionType0', None, Unset]): """ - params: NewDashboardPanelDataAttributesParams - name: None | str | Unset = UNSET - position: NewDashboardPanelDataAttributesPositionType0 | None | Unset = UNSET + params: "NewDashboardPanelDataAttributesParams" + name: Union[None, Unset, str] = UNSET + position: Union["NewDashboardPanelDataAttributesPositionType0", None, Unset] = UNSET def to_dict(self) -> dict[str, Any]: from ..models.new_dashboard_panel_data_attributes_position_type_0 import ( @@ -37,13 +35,13 @@ def to_dict(self) -> dict[str, Any]: params = self.params.to_dict() - name: None | str | Unset + name: Union[None, Unset, str] if isinstance(self.name, Unset): name = UNSET else: name = self.name - position: dict[str, Any] | None | Unset + position: Union[None, Unset, dict[str, Any]] if isinstance(self.position, Unset): position = UNSET elif isinstance(self.position, NewDashboardPanelDataAttributesPositionType0): @@ -75,16 +73,16 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) params = NewDashboardPanelDataAttributesParams.from_dict(d.pop("params")) - def _parse_name(data: object) -> None | str | Unset: + def _parse_name(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) name = _parse_name(d.pop("name", UNSET)) - def _parse_position(data: object) -> NewDashboardPanelDataAttributesPositionType0 | None | Unset: + def _parse_position(data: object) -> Union["NewDashboardPanelDataAttributesPositionType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -95,9 +93,9 @@ def _parse_position(data: object) -> NewDashboardPanelDataAttributesPositionType position_type_0 = NewDashboardPanelDataAttributesPositionType0.from_dict(data) return position_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(NewDashboardPanelDataAttributesPositionType0 | None | Unset, data) + return cast(Union["NewDashboardPanelDataAttributesPositionType0", None, Unset], data) position = _parse_position(d.pop("position", UNSET)) diff --git a/rootly_sdk/models/new_dashboard_panel_data_attributes_params.py b/rootly_sdk/models/new_dashboard_panel_data_attributes_params.py index 299e8dc1..aadf6fd5 100644 --- a/rootly_sdk/models/new_dashboard_panel_data_attributes_params.py +++ b/rootly_sdk/models/new_dashboard_panel_data_attributes_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,43 +27,42 @@ class NewDashboardPanelDataAttributesParams: """ Attributes: - display (NewDashboardPanelDataAttributesParamsDisplay | Unset): - description (str | Unset): - table_fields (list[str] | Unset): - legend (NewDashboardPanelDataAttributesParamsLegend | Unset): - datalabels (NewDashboardPanelDataAttributesParamsDatalabels | Unset): - datasets (list[NewDashboardPanelDataAttributesParamsDatasetsItem] | Unset): + display (Union[Unset, NewDashboardPanelDataAttributesParamsDisplay]): + description (Union[Unset, str]): + table_fields (Union[Unset, list[str]]): + legend (Union[Unset, NewDashboardPanelDataAttributesParamsLegend]): + datalabels (Union[Unset, NewDashboardPanelDataAttributesParamsDatalabels]): + datasets (Union[Unset, list['NewDashboardPanelDataAttributesParamsDatasetsItem']]): """ - display: NewDashboardPanelDataAttributesParamsDisplay | Unset = UNSET - description: str | Unset = UNSET - table_fields: list[str] | Unset = UNSET - legend: NewDashboardPanelDataAttributesParamsLegend | Unset = UNSET - datalabels: NewDashboardPanelDataAttributesParamsDatalabels | Unset = UNSET - datasets: list[NewDashboardPanelDataAttributesParamsDatasetsItem] | Unset = UNSET + display: Union[Unset, NewDashboardPanelDataAttributesParamsDisplay] = UNSET + description: Union[Unset, str] = UNSET + table_fields: Union[Unset, list[str]] = UNSET + legend: Union[Unset, "NewDashboardPanelDataAttributesParamsLegend"] = UNSET + datalabels: Union[Unset, "NewDashboardPanelDataAttributesParamsDatalabels"] = UNSET + datasets: Union[Unset, list["NewDashboardPanelDataAttributesParamsDatasetsItem"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - - display: str | Unset = UNSET + display: Union[Unset, str] = UNSET if not isinstance(self.display, Unset): display = self.display description = self.description - table_fields: list[str] | Unset = UNSET + table_fields: Union[Unset, list[str]] = UNSET if not isinstance(self.table_fields, Unset): table_fields = self.table_fields - legend: dict[str, Any] | Unset = UNSET + legend: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.legend, Unset): legend = self.legend.to_dict() - datalabels: dict[str, Any] | Unset = UNSET + datalabels: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.datalabels, Unset): datalabels = self.datalabels.to_dict() - datasets: list[dict[str, Any]] | Unset = UNSET + datasets: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.datasets, Unset): datasets = [] for datasets_item_data in self.datasets: @@ -104,7 +101,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _display = d.pop("display", UNSET) - display: NewDashboardPanelDataAttributesParamsDisplay | Unset + display: Union[Unset, NewDashboardPanelDataAttributesParamsDisplay] if isinstance(_display, Unset): display = UNSET else: @@ -115,27 +112,25 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: table_fields = cast(list[str], d.pop("table_fields", UNSET)) _legend = d.pop("legend", UNSET) - legend: NewDashboardPanelDataAttributesParamsLegend | Unset + legend: Union[Unset, NewDashboardPanelDataAttributesParamsLegend] if isinstance(_legend, Unset): legend = UNSET else: legend = NewDashboardPanelDataAttributesParamsLegend.from_dict(_legend) _datalabels = d.pop("datalabels", UNSET) - datalabels: NewDashboardPanelDataAttributesParamsDatalabels | Unset + datalabels: Union[Unset, NewDashboardPanelDataAttributesParamsDatalabels] if isinstance(_datalabels, Unset): datalabels = UNSET else: datalabels = NewDashboardPanelDataAttributesParamsDatalabels.from_dict(_datalabels) + datasets = [] _datasets = d.pop("datasets", UNSET) - datasets: list[NewDashboardPanelDataAttributesParamsDatasetsItem] | Unset = UNSET - if _datasets is not UNSET: - datasets = [] - for datasets_item_data in _datasets: - datasets_item = NewDashboardPanelDataAttributesParamsDatasetsItem.from_dict(datasets_item_data) + for datasets_item_data in _datasets or []: + datasets_item = NewDashboardPanelDataAttributesParamsDatasetsItem.from_dict(datasets_item_data) - datasets.append(datasets_item) + datasets.append(datasets_item) new_dashboard_panel_data_attributes_params = cls( display=display, diff --git a/rootly_sdk/models/new_dashboard_panel_data_attributes_params_datalabels.py b/rootly_sdk/models/new_dashboard_panel_data_attributes_params_datalabels.py index adb508ca..3090bdc2 100644 --- a/rootly_sdk/models/new_dashboard_panel_data_attributes_params_datalabels.py +++ b/rootly_sdk/models/new_dashboard_panel_data_attributes_params_datalabels.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,10 +13,10 @@ class NewDashboardPanelDataAttributesParamsDatalabels: """ Attributes: - enabled (bool | Unset): + enabled (Union[Unset, bool]): """ - enabled: bool | Unset = UNSET + enabled: Union[Unset, bool] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/new_dashboard_panel_data_attributes_params_datasets_item.py b/rootly_sdk/models/new_dashboard_panel_data_attributes_params_datasets_item.py index 5e2ae7c9..1c35197c 100644 --- a/rootly_sdk/models/new_dashboard_panel_data_attributes_params_datasets_item.py +++ b/rootly_sdk/models/new_dashboard_panel_data_attributes_params_datasets_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -31,18 +29,18 @@ class NewDashboardPanelDataAttributesParamsDatasetsItem: """ Attributes: - name (None | str | Unset): - collection (NewDashboardPanelDataAttributesParamsDatasetsItemCollection | Unset): - filter_ (list[NewDashboardPanelDataAttributesParamsDatasetsItemFilterItem] | Unset): - group_by (NewDashboardPanelDataAttributesParamsDatasetsItemGroupByType1Type0 | None | str | Unset): - aggregate (NewDashboardPanelDataAttributesParamsDatasetsItemAggregateType0 | None | Unset): + name (Union[None, Unset, str]): + collection (Union[Unset, NewDashboardPanelDataAttributesParamsDatasetsItemCollection]): + filter_ (Union[Unset, list['NewDashboardPanelDataAttributesParamsDatasetsItemFilterItem']]): + group_by (Union['NewDashboardPanelDataAttributesParamsDatasetsItemGroupByType1Type0', None, Unset, str]): + aggregate (Union['NewDashboardPanelDataAttributesParamsDatasetsItemAggregateType0', None, Unset]): """ - name: None | str | Unset = UNSET - collection: NewDashboardPanelDataAttributesParamsDatasetsItemCollection | Unset = UNSET - filter_: list[NewDashboardPanelDataAttributesParamsDatasetsItemFilterItem] | Unset = UNSET - group_by: NewDashboardPanelDataAttributesParamsDatasetsItemGroupByType1Type0 | None | str | Unset = UNSET - aggregate: NewDashboardPanelDataAttributesParamsDatasetsItemAggregateType0 | None | Unset = UNSET + name: Union[None, Unset, str] = UNSET + collection: Union[Unset, NewDashboardPanelDataAttributesParamsDatasetsItemCollection] = UNSET + filter_: Union[Unset, list["NewDashboardPanelDataAttributesParamsDatasetsItemFilterItem"]] = UNSET + group_by: Union["NewDashboardPanelDataAttributesParamsDatasetsItemGroupByType1Type0", None, Unset, str] = UNSET + aggregate: Union["NewDashboardPanelDataAttributesParamsDatasetsItemAggregateType0", None, Unset] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -53,24 +51,24 @@ def to_dict(self) -> dict[str, Any]: NewDashboardPanelDataAttributesParamsDatasetsItemGroupByType1Type0, ) - name: None | str | Unset + name: Union[None, Unset, str] if isinstance(self.name, Unset): name = UNSET else: name = self.name - collection: str | Unset = UNSET + collection: Union[Unset, str] = UNSET if not isinstance(self.collection, Unset): collection = self.collection - filter_: list[dict[str, Any]] | Unset = UNSET + filter_: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.filter_, Unset): filter_ = [] for filter_item_data in self.filter_: filter_item = filter_item_data.to_dict() filter_.append(filter_item) - group_by: dict[str, Any] | None | str | Unset + group_by: Union[None, Unset, dict[str, Any], str] if isinstance(self.group_by, Unset): group_by = UNSET elif isinstance(self.group_by, NewDashboardPanelDataAttributesParamsDatasetsItemGroupByType1Type0): @@ -78,7 +76,7 @@ def to_dict(self) -> dict[str, Any]: else: group_by = self.group_by - aggregate: dict[str, Any] | None | Unset + aggregate: Union[None, Unset, dict[str, Any]] if isinstance(self.aggregate, Unset): aggregate = UNSET elif isinstance(self.aggregate, NewDashboardPanelDataAttributesParamsDatasetsItemAggregateType0): @@ -116,34 +114,32 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_name(data: object) -> None | str | Unset: + def _parse_name(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) name = _parse_name(d.pop("name", UNSET)) _collection = d.pop("collection", UNSET) - collection: NewDashboardPanelDataAttributesParamsDatasetsItemCollection | Unset + collection: Union[Unset, NewDashboardPanelDataAttributesParamsDatasetsItemCollection] if isinstance(_collection, Unset): collection = UNSET else: collection = check_new_dashboard_panel_data_attributes_params_datasets_item_collection(_collection) + filter_ = [] _filter_ = d.pop("filter", UNSET) - filter_: list[NewDashboardPanelDataAttributesParamsDatasetsItemFilterItem] | Unset = UNSET - if _filter_ is not UNSET: - filter_ = [] - for filter_item_data in _filter_: - filter_item = NewDashboardPanelDataAttributesParamsDatasetsItemFilterItem.from_dict(filter_item_data) + for filter_item_data in _filter_ or []: + filter_item = NewDashboardPanelDataAttributesParamsDatasetsItemFilterItem.from_dict(filter_item_data) - filter_.append(filter_item) + filter_.append(filter_item) def _parse_group_by( data: object, - ) -> NewDashboardPanelDataAttributesParamsDatasetsItemGroupByType1Type0 | None | str | Unset: + ) -> Union["NewDashboardPanelDataAttributesParamsDatasetsItemGroupByType1Type0", None, Unset, str]: if data is None: return data if isinstance(data, Unset): @@ -156,15 +152,17 @@ def _parse_group_by( ) return group_by_type_1_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(NewDashboardPanelDataAttributesParamsDatasetsItemGroupByType1Type0 | None | str | Unset, data) + return cast( + Union["NewDashboardPanelDataAttributesParamsDatasetsItemGroupByType1Type0", None, Unset, str], data + ) group_by = _parse_group_by(d.pop("group_by", UNSET)) def _parse_aggregate( data: object, - ) -> NewDashboardPanelDataAttributesParamsDatasetsItemAggregateType0 | None | Unset: + ) -> Union["NewDashboardPanelDataAttributesParamsDatasetsItemAggregateType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -175,9 +173,9 @@ def _parse_aggregate( aggregate_type_0 = NewDashboardPanelDataAttributesParamsDatasetsItemAggregateType0.from_dict(data) return aggregate_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(NewDashboardPanelDataAttributesParamsDatasetsItemAggregateType0 | None | Unset, data) + return cast(Union["NewDashboardPanelDataAttributesParamsDatasetsItemAggregateType0", None, Unset], data) aggregate = _parse_aggregate(d.pop("aggregate", UNSET)) diff --git a/rootly_sdk/models/new_dashboard_panel_data_attributes_params_datasets_item_aggregate_type_0.py b/rootly_sdk/models/new_dashboard_panel_data_attributes_params_datasets_item_aggregate_type_0.py index e3ed83f7..f54c1d15 100644 --- a/rootly_sdk/models/new_dashboard_panel_data_attributes_params_datasets_item_aggregate_type_0.py +++ b/rootly_sdk/models/new_dashboard_panel_data_attributes_params_datasets_item_aggregate_type_0.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,28 +17,28 @@ class NewDashboardPanelDataAttributesParamsDatasetsItemAggregateType0: """ Attributes: - operation (NewDashboardPanelDataAttributesParamsDatasetsItemAggregateType0Operation | Unset): - key (None | str | Unset): - cumulative (bool | None | Unset): + operation (Union[Unset, NewDashboardPanelDataAttributesParamsDatasetsItemAggregateType0Operation]): + key (Union[None, Unset, str]): + cumulative (Union[None, Unset, bool]): """ - operation: NewDashboardPanelDataAttributesParamsDatasetsItemAggregateType0Operation | Unset = UNSET - key: None | str | Unset = UNSET - cumulative: bool | None | Unset = UNSET + operation: Union[Unset, NewDashboardPanelDataAttributesParamsDatasetsItemAggregateType0Operation] = UNSET + key: Union[None, Unset, str] = UNSET + cumulative: Union[None, Unset, bool] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - operation: str | Unset = UNSET + operation: Union[Unset, str] = UNSET if not isinstance(self.operation, Unset): operation = self.operation - key: None | str | Unset + key: Union[None, Unset, str] if isinstance(self.key, Unset): key = UNSET else: key = self.key - cumulative: bool | None | Unset + cumulative: Union[None, Unset, bool] if isinstance(self.cumulative, Unset): cumulative = UNSET else: @@ -62,7 +60,7 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _operation = d.pop("operation", UNSET) - operation: NewDashboardPanelDataAttributesParamsDatasetsItemAggregateType0Operation | Unset + operation: Union[Unset, NewDashboardPanelDataAttributesParamsDatasetsItemAggregateType0Operation] if isinstance(_operation, Unset): operation = UNSET else: @@ -70,21 +68,21 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: _operation ) - def _parse_key(data: object) -> None | str | Unset: + def _parse_key(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) key = _parse_key(d.pop("key", UNSET)) - def _parse_cumulative(data: object) -> bool | None | Unset: + def _parse_cumulative(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) cumulative = _parse_cumulative(d.pop("cumulative", UNSET)) diff --git a/rootly_sdk/models/new_dashboard_panel_data_attributes_params_datasets_item_filter_item.py b/rootly_sdk/models/new_dashboard_panel_data_attributes_params_datasets_item_filter_item.py index 1a123cb7..2995d60d 100644 --- a/rootly_sdk/models/new_dashboard_panel_data_attributes_params_datasets_item_filter_item.py +++ b/rootly_sdk/models/new_dashboard_panel_data_attributes_params_datasets_item_filter_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -25,21 +23,20 @@ class NewDashboardPanelDataAttributesParamsDatasetsItemFilterItem: """ Attributes: - operation (NewDashboardPanelDataAttributesParamsDatasetsItemFilterItemOperation | Unset): - rules (list[NewDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItem] | Unset): + operation (Union[Unset, NewDashboardPanelDataAttributesParamsDatasetsItemFilterItemOperation]): + rules (Union[Unset, list['NewDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItem']]): """ - operation: NewDashboardPanelDataAttributesParamsDatasetsItemFilterItemOperation | Unset = UNSET - rules: list[NewDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItem] | Unset = UNSET + operation: Union[Unset, NewDashboardPanelDataAttributesParamsDatasetsItemFilterItemOperation] = UNSET + rules: Union[Unset, list["NewDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItem"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - - operation: str | Unset = UNSET + operation: Union[Unset, str] = UNSET if not isinstance(self.operation, Unset): operation = self.operation - rules: list[dict[str, Any]] | Unset = UNSET + rules: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.rules, Unset): rules = [] for rules_item_data in self.rules: @@ -64,22 +61,18 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _operation = d.pop("operation", UNSET) - operation: NewDashboardPanelDataAttributesParamsDatasetsItemFilterItemOperation | Unset + operation: Union[Unset, NewDashboardPanelDataAttributesParamsDatasetsItemFilterItemOperation] if isinstance(_operation, Unset): operation = UNSET else: operation = check_new_dashboard_panel_data_attributes_params_datasets_item_filter_item_operation(_operation) + rules = [] _rules = d.pop("rules", UNSET) - rules: list[NewDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItem] | Unset = UNSET - if _rules is not UNSET: - rules = [] - for rules_item_data in _rules: - rules_item = NewDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItem.from_dict( - rules_item_data - ) + for rules_item_data in _rules or []: + rules_item = NewDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItem.from_dict(rules_item_data) - rules.append(rules_item) + rules.append(rules_item) new_dashboard_panel_data_attributes_params_datasets_item_filter_item = cls( operation=operation, diff --git a/rootly_sdk/models/new_dashboard_panel_data_attributes_params_datasets_item_filter_item_rules_item.py b/rootly_sdk/models/new_dashboard_panel_data_attributes_params_datasets_item_filter_item_rules_item.py index 1e50dd93..c6659413 100644 --- a/rootly_sdk/models/new_dashboard_panel_data_attributes_params_datasets_item_filter_item_rules_item.py +++ b/rootly_sdk/models/new_dashboard_panel_data_attributes_params_datasets_item_filter_item_rules_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,24 +21,24 @@ class NewDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItem: """ Attributes: - operation (NewDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItemOperation | Unset): - condition (NewDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItemCondition | Unset): - key (str | Unset): - value (str | Unset): + operation (Union[Unset, NewDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItemOperation]): + condition (Union[Unset, NewDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItemCondition]): + key (Union[Unset, str]): + value (Union[Unset, str]): """ - operation: NewDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItemOperation | Unset = UNSET - condition: NewDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItemCondition | Unset = UNSET - key: str | Unset = UNSET - value: str | Unset = UNSET + operation: Union[Unset, NewDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItemOperation] = UNSET + condition: Union[Unset, NewDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItemCondition] = UNSET + key: Union[Unset, str] = UNSET + value: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - operation: str | Unset = UNSET + operation: Union[Unset, str] = UNSET if not isinstance(self.operation, Unset): operation = self.operation - condition: str | Unset = UNSET + condition: Union[Unset, str] = UNSET if not isinstance(self.condition, Unset): condition = self.condition @@ -66,7 +64,7 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _operation = d.pop("operation", UNSET) - operation: NewDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItemOperation | Unset + operation: Union[Unset, NewDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItemOperation] if isinstance(_operation, Unset): operation = UNSET else: @@ -75,7 +73,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: ) _condition = d.pop("condition", UNSET) - condition: NewDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItemCondition | Unset + condition: Union[Unset, NewDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItemCondition] if isinstance(_condition, Unset): condition = UNSET else: diff --git a/rootly_sdk/models/new_dashboard_panel_data_attributes_params_datasets_item_group_by_type_1_type_0.py b/rootly_sdk/models/new_dashboard_panel_data_attributes_params_datasets_item_group_by_type_1_type_0.py index 7119aaa4..baa6f0ba 100644 --- a/rootly_sdk/models/new_dashboard_panel_data_attributes_params_datasets_item_group_by_type_1_type_0.py +++ b/rootly_sdk/models/new_dashboard_panel_data_attributes_params_datasets_item_group_by_type_1_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/new_dashboard_panel_data_attributes_params_legend.py b/rootly_sdk/models/new_dashboard_panel_data_attributes_params_legend.py index 7628e602..45cfea4e 100644 --- a/rootly_sdk/models/new_dashboard_panel_data_attributes_params_legend.py +++ b/rootly_sdk/models/new_dashboard_panel_data_attributes_params_legend.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,14 +17,14 @@ class NewDashboardPanelDataAttributesParamsLegend: """ Attributes: - groups (NewDashboardPanelDataAttributesParamsLegendGroups | Unset): Default: 'all'. + groups (Union[Unset, NewDashboardPanelDataAttributesParamsLegendGroups]): Default: 'all'. """ - groups: NewDashboardPanelDataAttributesParamsLegendGroups | Unset = "all" + groups: Union[Unset, NewDashboardPanelDataAttributesParamsLegendGroups] = "all" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - groups: str | Unset = UNSET + groups: Union[Unset, str] = UNSET if not isinstance(self.groups, Unset): groups = self.groups @@ -42,7 +40,7 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _groups = d.pop("groups", UNSET) - groups: NewDashboardPanelDataAttributesParamsLegendGroups | Unset + groups: Union[Unset, NewDashboardPanelDataAttributesParamsLegendGroups] if isinstance(_groups, Unset): groups = UNSET else: diff --git a/rootly_sdk/models/new_dashboard_panel_data_attributes_position_type_0.py b/rootly_sdk/models/new_dashboard_panel_data_attributes_position_type_0.py index 4937e4d2..bc42d2ce 100644 --- a/rootly_sdk/models/new_dashboard_panel_data_attributes_position_type_0.py +++ b/rootly_sdk/models/new_dashboard_panel_data_attributes_position_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/new_edge_connector.py b/rootly_sdk/models/new_edge_connector.py index b0ec3196..c6ec30be 100644 --- a/rootly_sdk/models/new_edge_connector.py +++ b/rootly_sdk/models/new_edge_connector.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewEdgeConnector: edge_connector (NewEdgeConnectorEdgeConnector): """ - edge_connector: NewEdgeConnectorEdgeConnector + edge_connector: "NewEdgeConnectorEdgeConnector" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - edge_connector = self.edge_connector.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_edge_connector_action.py b/rootly_sdk/models/new_edge_connector_action.py index f8c7d5d8..3312bc3c 100644 --- a/rootly_sdk/models/new_edge_connector_action.py +++ b/rootly_sdk/models/new_edge_connector_action.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewEdgeConnectorAction: action (NewEdgeConnectorActionAction): """ - action: NewEdgeConnectorActionAction + action: "NewEdgeConnectorActionAction" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - action = self.action.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_edge_connector_action_action.py b/rootly_sdk/models/new_edge_connector_action_action.py index 942ab5ea..758e00ee 100644 --- a/rootly_sdk/models/new_edge_connector_action_action.py +++ b/rootly_sdk/models/new_edge_connector_action_action.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -25,21 +23,20 @@ class NewEdgeConnectorActionAction: Attributes: name (str): Action name action_type (NewEdgeConnectorActionActionActionType): Action type - metadata (NewEdgeConnectorActionActionMetadata | Unset): + metadata (Union[Unset, NewEdgeConnectorActionActionMetadata]): """ name: str action_type: NewEdgeConnectorActionActionActionType - metadata: NewEdgeConnectorActionActionMetadata | Unset = UNSET + metadata: Union[Unset, "NewEdgeConnectorActionActionMetadata"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - name = self.name action_type: str = self.action_type - metadata: dict[str, Any] | Unset = UNSET + metadata: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.metadata, Unset): metadata = self.metadata.to_dict() @@ -66,7 +63,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: action_type = check_new_edge_connector_action_action_action_type(d.pop("action_type")) _metadata = d.pop("metadata", UNSET) - metadata: NewEdgeConnectorActionActionMetadata | Unset + metadata: Union[Unset, NewEdgeConnectorActionActionMetadata] if isinstance(_metadata, Unset): metadata = UNSET else: diff --git a/rootly_sdk/models/new_edge_connector_action_action_metadata.py b/rootly_sdk/models/new_edge_connector_action_action_metadata.py index fe6cd145..fae24058 100644 --- a/rootly_sdk/models/new_edge_connector_action_action_metadata.py +++ b/rootly_sdk/models/new_edge_connector_action_action_metadata.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -25,37 +23,36 @@ class NewEdgeConnectorActionActionMetadata: """ Attributes: - description (None | str | Unset): - timeout (int | None | Unset): - icon (NewEdgeConnectorActionActionMetadataIcon | Unset): - parameters (list[NewEdgeConnectorActionActionMetadataParametersType0Item] | None | Unset): + description (Union[None, Unset, str]): + timeout (Union[None, Unset, int]): + icon (Union[Unset, NewEdgeConnectorActionActionMetadataIcon]): + parameters (Union[None, Unset, list['NewEdgeConnectorActionActionMetadataParametersType0Item']]): """ - description: None | str | Unset = UNSET - timeout: int | None | Unset = UNSET - icon: NewEdgeConnectorActionActionMetadataIcon | Unset = UNSET - parameters: list[NewEdgeConnectorActionActionMetadataParametersType0Item] | None | Unset = UNSET + description: Union[None, Unset, str] = UNSET + timeout: Union[None, Unset, int] = UNSET + icon: Union[Unset, NewEdgeConnectorActionActionMetadataIcon] = UNSET + parameters: Union[None, Unset, list["NewEdgeConnectorActionActionMetadataParametersType0Item"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - - description: None | str | Unset + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: description = self.description - timeout: int | None | Unset + timeout: Union[None, Unset, int] if isinstance(self.timeout, Unset): timeout = UNSET else: timeout = self.timeout - icon: str | Unset = UNSET + icon: Union[Unset, str] = UNSET if not isinstance(self.icon, Unset): icon = self.icon - parameters: list[dict[str, Any]] | None | Unset + parameters: Union[None, Unset, list[dict[str, Any]]] if isinstance(self.parameters, Unset): parameters = UNSET elif isinstance(self.parameters, list): @@ -89,26 +86,26 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) - def _parse_timeout(data: object) -> int | None | Unset: + def _parse_timeout(data: object) -> Union[None, Unset, int]: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(Union[None, Unset, int], data) timeout = _parse_timeout(d.pop("timeout", UNSET)) _icon = d.pop("icon", UNSET) - icon: NewEdgeConnectorActionActionMetadataIcon | Unset + icon: Union[Unset, NewEdgeConnectorActionActionMetadataIcon] if isinstance(_icon, Unset): icon = UNSET else: @@ -116,7 +113,7 @@ def _parse_timeout(data: object) -> int | None | Unset: def _parse_parameters( data: object, - ) -> list[NewEdgeConnectorActionActionMetadataParametersType0Item] | None | Unset: + ) -> Union[None, Unset, list["NewEdgeConnectorActionActionMetadataParametersType0Item"]]: if data is None: return data if isinstance(data, Unset): @@ -134,9 +131,9 @@ def _parse_parameters( parameters_type_0.append(parameters_type_0_item) return parameters_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[NewEdgeConnectorActionActionMetadataParametersType0Item] | None | Unset, data) + return cast(Union[None, Unset, list["NewEdgeConnectorActionActionMetadataParametersType0Item"]], data) parameters = _parse_parameters(d.pop("parameters", UNSET)) diff --git a/rootly_sdk/models/new_edge_connector_action_action_metadata_parameters_type_0_item.py b/rootly_sdk/models/new_edge_connector_action_action_metadata_parameters_type_0_item.py index 0cce53dd..e1ed3967 100644 --- a/rootly_sdk/models/new_edge_connector_action_action_metadata_parameters_type_0_item.py +++ b/rootly_sdk/models/new_edge_connector_action_action_metadata_parameters_type_0_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,44 +17,44 @@ class NewEdgeConnectorActionActionMetadataParametersType0Item: """ Attributes: - name (str | Unset): - type_ (NewEdgeConnectorActionActionMetadataParametersType0ItemType | Unset): - required (bool | Unset): - description (None | str | Unset): - default (None | str | Unset): Default value (any type) - options (list[str] | None | Unset): + name (Union[Unset, str]): + type_ (Union[Unset, NewEdgeConnectorActionActionMetadataParametersType0ItemType]): + required (Union[Unset, bool]): + description (Union[None, Unset, str]): + default (Union[None, Unset, str]): Default value (any type) + options (Union[None, Unset, list[str]]): """ - name: str | Unset = UNSET - type_: NewEdgeConnectorActionActionMetadataParametersType0ItemType | Unset = UNSET - required: bool | Unset = UNSET - description: None | str | Unset = UNSET - default: None | str | Unset = UNSET - options: list[str] | None | Unset = UNSET + name: Union[Unset, str] = UNSET + type_: Union[Unset, NewEdgeConnectorActionActionMetadataParametersType0ItemType] = UNSET + required: Union[Unset, bool] = UNSET + description: Union[None, Unset, str] = UNSET + default: Union[None, Unset, str] = UNSET + options: Union[None, Unset, list[str]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: name = self.name - type_: str | Unset = UNSET + type_: Union[Unset, str] = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ required = self.required - description: None | str | Unset + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: description = self.description - default: None | str | Unset + default: Union[None, Unset, str] if isinstance(self.default, Unset): default = UNSET else: default = self.default - options: list[str] | None | Unset + options: Union[None, Unset, list[str]] if isinstance(self.options, Unset): options = UNSET elif isinstance(self.options, list): @@ -89,7 +87,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name = d.pop("name", UNSET) _type_ = d.pop("type", UNSET) - type_: NewEdgeConnectorActionActionMetadataParametersType0ItemType | Unset + type_: Union[Unset, NewEdgeConnectorActionActionMetadataParametersType0ItemType] if isinstance(_type_, Unset): type_ = UNSET else: @@ -97,25 +95,25 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: required = d.pop("required", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) - def _parse_default(data: object) -> None | str | Unset: + def _parse_default(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) default = _parse_default(d.pop("default", UNSET)) - def _parse_options(data: object) -> list[str] | None | Unset: + def _parse_options(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -126,9 +124,9 @@ def _parse_options(data: object) -> list[str] | None | Unset: options_type_0 = cast(list[str], data) return options_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) options = _parse_options(d.pop("options", UNSET)) diff --git a/rootly_sdk/models/new_edge_connector_edge_connector.py b/rootly_sdk/models/new_edge_connector_edge_connector.py index c5d16dd9..92174a8c 100644 --- a/rootly_sdk/models/new_edge_connector_edge_connector.py +++ b/rootly_sdk/models/new_edge_connector_edge_connector.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -20,31 +18,31 @@ class NewEdgeConnectorEdgeConnector: """ Attributes: name (str): Connector name - description (None | str | Unset): Connector description - status (NewEdgeConnectorEdgeConnectorStatus | Unset): Connector status - subscriptions (list[str] | Unset): Array of event types to subscribe to + description (Union[None, Unset, str]): Connector description + status (Union[Unset, NewEdgeConnectorEdgeConnectorStatus]): Connector status + subscriptions (Union[Unset, list[str]]): Array of event types to subscribe to """ name: str - description: None | str | Unset = UNSET - status: NewEdgeConnectorEdgeConnectorStatus | Unset = UNSET - subscriptions: list[str] | Unset = UNSET + description: Union[None, Unset, str] = UNSET + status: Union[Unset, NewEdgeConnectorEdgeConnectorStatus] = UNSET + subscriptions: Union[Unset, list[str]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: name = self.name - description: None | str | Unset + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: description = self.description - status: str | Unset = UNSET + status: Union[Unset, str] = UNSET if not isinstance(self.status, Unset): status = self.status - subscriptions: list[str] | Unset = UNSET + subscriptions: Union[Unset, list[str]] = UNSET if not isinstance(self.subscriptions, Unset): subscriptions = self.subscriptions @@ -69,17 +67,17 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name") - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) _status = d.pop("status", UNSET) - status: NewEdgeConnectorEdgeConnectorStatus | Unset + status: Union[Unset, NewEdgeConnectorEdgeConnectorStatus] if isinstance(_status, Unset): status = UNSET else: diff --git a/rootly_sdk/models/new_environment.py b/rootly_sdk/models/new_environment.py index 8f807574..d79e5a31 100644 --- a/rootly_sdk/models/new_environment.py +++ b/rootly_sdk/models/new_environment.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewEnvironment: data (NewEnvironmentData): """ - data: NewEnvironmentData + data: "NewEnvironmentData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_environment_data.py b/rootly_sdk/models/new_environment_data.py index c4497ba1..4408f696 100644 --- a/rootly_sdk/models/new_environment_data.py +++ b/rootly_sdk/models/new_environment_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class NewEnvironmentData: """ type_: NewEnvironmentDataType - attributes: NewEnvironmentDataAttributes + attributes: "NewEnvironmentDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_environment_data_attributes.py b/rootly_sdk/models/new_environment_data_attributes.py index fe57fc2c..c893d272 100644 --- a/rootly_sdk/models/new_environment_data_attributes.py +++ b/rootly_sdk/models/new_environment_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -25,58 +23,74 @@ class NewEnvironmentDataAttributes: """ Attributes: name (str): The name of the environment - description (None | str | Unset): The description of the environment - color (None | str | Unset): The hex color of the environment - position (int | None | Unset): Position of the environment - external_id (None | str | Unset): The external id associated to this environment - notify_emails (list[str] | None | Unset): Emails to attach to the environment - slack_channels (list[NewEnvironmentDataAttributesSlackChannelsType0Item] | None | Unset): Slack Channels + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + description (Union[None, Unset, str]): The description of the environment + public_description (Union[None, Unset, str]): The status page description of the environment + color (Union[None, Unset, str]): The hex color of the environment + position (Union[None, Unset, int]): Position of the environment + external_id (Union[None, Unset, str]): The external id associated to this environment + notify_emails (Union[None, Unset, list[str]]): Emails to attach to the environment + slack_channels (Union[None, Unset, list['NewEnvironmentDataAttributesSlackChannelsType0Item']]): Slack Channels + associated with this environment + slack_aliases (Union[None, Unset, list['NewEnvironmentDataAttributesSlackAliasesType0Item']]): Slack Aliases associated with this environment - slack_aliases (list[NewEnvironmentDataAttributesSlackAliasesType0Item] | None | Unset): Slack Aliases associated - with this environment - properties (list[NewEnvironmentDataAttributesPropertiesItem] | Unset): Array of property values for this + properties (Union[Unset, list['NewEnvironmentDataAttributesPropertiesItem']]): Array of property values for this environment. """ name: str - description: None | str | Unset = UNSET - color: None | str | Unset = UNSET - position: int | None | Unset = UNSET - external_id: None | str | Unset = UNSET - notify_emails: list[str] | None | Unset = UNSET - slack_channels: list[NewEnvironmentDataAttributesSlackChannelsType0Item] | None | Unset = UNSET - slack_aliases: list[NewEnvironmentDataAttributesSlackAliasesType0Item] | None | Unset = UNSET - properties: list[NewEnvironmentDataAttributesPropertiesItem] | Unset = UNSET + slug: Union[None, Unset, str] = UNSET + description: Union[None, Unset, str] = UNSET + public_description: Union[None, Unset, str] = UNSET + color: Union[None, Unset, str] = UNSET + position: Union[None, Unset, int] = UNSET + external_id: Union[None, Unset, str] = UNSET + notify_emails: Union[None, Unset, list[str]] = UNSET + slack_channels: Union[None, Unset, list["NewEnvironmentDataAttributesSlackChannelsType0Item"]] = UNSET + slack_aliases: Union[None, Unset, list["NewEnvironmentDataAttributesSlackAliasesType0Item"]] = UNSET + properties: Union[Unset, list["NewEnvironmentDataAttributesPropertiesItem"]] = UNSET def to_dict(self) -> dict[str, Any]: - name = self.name - description: None | str | Unset + slug: Union[None, Unset, str] + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug + + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: description = self.description - color: None | str | Unset + public_description: Union[None, Unset, str] + if isinstance(self.public_description, Unset): + public_description = UNSET + else: + public_description = self.public_description + + color: Union[None, Unset, str] if isinstance(self.color, Unset): color = UNSET else: color = self.color - position: int | None | Unset + position: Union[None, Unset, int] if isinstance(self.position, Unset): position = UNSET else: position = self.position - external_id: None | str | Unset + external_id: Union[None, Unset, str] if isinstance(self.external_id, Unset): external_id = UNSET else: external_id = self.external_id - notify_emails: list[str] | None | Unset + notify_emails: Union[None, Unset, list[str]] if isinstance(self.notify_emails, Unset): notify_emails = UNSET elif isinstance(self.notify_emails, list): @@ -85,7 +99,7 @@ def to_dict(self) -> dict[str, Any]: else: notify_emails = self.notify_emails - slack_channels: list[dict[str, Any]] | None | Unset + slack_channels: Union[None, Unset, list[dict[str, Any]]] if isinstance(self.slack_channels, Unset): slack_channels = UNSET elif isinstance(self.slack_channels, list): @@ -97,7 +111,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_channels = self.slack_channels - slack_aliases: list[dict[str, Any]] | None | Unset + slack_aliases: Union[None, Unset, list[dict[str, Any]]] if isinstance(self.slack_aliases, Unset): slack_aliases = UNSET elif isinstance(self.slack_aliases, list): @@ -109,7 +123,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_aliases = self.slack_aliases - properties: list[dict[str, Any]] | Unset = UNSET + properties: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.properties, Unset): properties = [] for properties_item_data in self.properties: @@ -123,8 +137,12 @@ def to_dict(self) -> dict[str, Any]: "name": name, } ) + if slug is not UNSET: + field_dict["slug"] = slug if description is not UNSET: field_dict["description"] = description + if public_description is not UNSET: + field_dict["public_description"] = public_description if color is not UNSET: field_dict["color"] = color if position is not UNSET: @@ -155,43 +173,61 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name") - def _parse_description(data: object) -> None | str | Unset: + def _parse_slug(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) + + slug = _parse_slug(d.pop("slug", UNSET)) + + def _parse_description(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) - def _parse_color(data: object) -> None | str | Unset: + def _parse_public_description(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + public_description = _parse_public_description(d.pop("public_description", UNSET)) + + def _parse_color(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) color = _parse_color(d.pop("color", UNSET)) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> Union[None, Unset, int]: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(Union[None, Unset, int], data) position = _parse_position(d.pop("position", UNSET)) - def _parse_external_id(data: object) -> None | str | Unset: + def _parse_external_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) external_id = _parse_external_id(d.pop("external_id", UNSET)) - def _parse_notify_emails(data: object) -> list[str] | None | Unset: + def _parse_notify_emails(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -202,15 +238,15 @@ def _parse_notify_emails(data: object) -> list[str] | None | Unset: notify_emails_type_0 = cast(list[str], data) return notify_emails_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) notify_emails = _parse_notify_emails(d.pop("notify_emails", UNSET)) def _parse_slack_channels( data: object, - ) -> list[NewEnvironmentDataAttributesSlackChannelsType0Item] | None | Unset: + ) -> Union[None, Unset, list["NewEnvironmentDataAttributesSlackChannelsType0Item"]]: if data is None: return data if isinstance(data, Unset): @@ -228,15 +264,15 @@ def _parse_slack_channels( slack_channels_type_0.append(slack_channels_type_0_item) return slack_channels_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[NewEnvironmentDataAttributesSlackChannelsType0Item] | None | Unset, data) + return cast(Union[None, Unset, list["NewEnvironmentDataAttributesSlackChannelsType0Item"]], data) slack_channels = _parse_slack_channels(d.pop("slack_channels", UNSET)) def _parse_slack_aliases( data: object, - ) -> list[NewEnvironmentDataAttributesSlackAliasesType0Item] | None | Unset: + ) -> Union[None, Unset, list["NewEnvironmentDataAttributesSlackAliasesType0Item"]]: if data is None: return data if isinstance(data, Unset): @@ -254,24 +290,24 @@ def _parse_slack_aliases( slack_aliases_type_0.append(slack_aliases_type_0_item) return slack_aliases_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[NewEnvironmentDataAttributesSlackAliasesType0Item] | None | Unset, data) + return cast(Union[None, Unset, list["NewEnvironmentDataAttributesSlackAliasesType0Item"]], data) slack_aliases = _parse_slack_aliases(d.pop("slack_aliases", UNSET)) + properties = [] _properties = d.pop("properties", UNSET) - properties: list[NewEnvironmentDataAttributesPropertiesItem] | Unset = UNSET - if _properties is not UNSET: - properties = [] - for properties_item_data in _properties: - properties_item = NewEnvironmentDataAttributesPropertiesItem.from_dict(properties_item_data) + for properties_item_data in _properties or []: + properties_item = NewEnvironmentDataAttributesPropertiesItem.from_dict(properties_item_data) - properties.append(properties_item) + properties.append(properties_item) new_environment_data_attributes = cls( name=name, + slug=slug, description=description, + public_description=public_description, color=color, position=position, external_id=external_id, diff --git a/rootly_sdk/models/new_environment_data_attributes_properties_item.py b/rootly_sdk/models/new_environment_data_attributes_properties_item.py index 417ca4ce..1205e4d5 100644 --- a/rootly_sdk/models/new_environment_data_attributes_properties_item.py +++ b/rootly_sdk/models/new_environment_data_attributes_properties_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/new_environment_data_attributes_slack_aliases_type_0_item.py b/rootly_sdk/models/new_environment_data_attributes_slack_aliases_type_0_item.py index cc449822..c59113a3 100644 --- a/rootly_sdk/models/new_environment_data_attributes_slack_aliases_type_0_item.py +++ b/rootly_sdk/models/new_environment_data_attributes_slack_aliases_type_0_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/new_environment_data_attributes_slack_channels_type_0_item.py b/rootly_sdk/models/new_environment_data_attributes_slack_channels_type_0_item.py index 49ec61b3..fef9736b 100644 --- a/rootly_sdk/models/new_environment_data_attributes_slack_channels_type_0_item.py +++ b/rootly_sdk/models/new_environment_data_attributes_slack_channels_type_0_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/new_escalation_policy.py b/rootly_sdk/models/new_escalation_policy.py index eaf02f09..3145c93b 100644 --- a/rootly_sdk/models/new_escalation_policy.py +++ b/rootly_sdk/models/new_escalation_policy.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewEscalationPolicy: data (NewEscalationPolicyData): """ - data: NewEscalationPolicyData + data: "NewEscalationPolicyData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_escalation_policy_data.py b/rootly_sdk/models/new_escalation_policy_data.py index 63bf20fd..7abe00c2 100644 --- a/rootly_sdk/models/new_escalation_policy_data.py +++ b/rootly_sdk/models/new_escalation_policy_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class NewEscalationPolicyData: """ type_: NewEscalationPolicyDataType - attributes: NewEscalationPolicyDataAttributes + attributes: "NewEscalationPolicyDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_escalation_policy_data_attributes.py b/rootly_sdk/models/new_escalation_policy_data_attributes.py index ca904842..7f1317c8 100644 --- a/rootly_sdk/models/new_escalation_policy_data_attributes.py +++ b/rootly_sdk/models/new_escalation_policy_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -21,20 +19,20 @@ class NewEscalationPolicyDataAttributes: """ Attributes: name (str): The name of the escalation policy - description (None | str | Unset): The description of the escalation policy - repeat_count (int | Unset): The number of times this policy will be executed until someone acknowledges the - alert - group_ids (list[str] | Unset): Associated groups (alerting the group will trigger escalation policy) - service_ids (list[str] | Unset): Associated services (alerting the service will trigger escalation policy) - business_hours (NewEscalationPolicyDataAttributesBusinessHoursType0 | None | Unset): + description (Union[None, Unset, str]): The description of the escalation policy + repeat_count (Union[Unset, int]): The number of times this policy will be executed until someone acknowledges + the alert + group_ids (Union[Unset, list[str]]): Associated groups (alerting the group will trigger escalation policy) + service_ids (Union[Unset, list[str]]): Associated services (alerting the service will trigger escalation policy) + business_hours (Union['NewEscalationPolicyDataAttributesBusinessHoursType0', None, Unset]): """ name: str - description: None | str | Unset = UNSET - repeat_count: int | Unset = UNSET - group_ids: list[str] | Unset = UNSET - service_ids: list[str] | Unset = UNSET - business_hours: NewEscalationPolicyDataAttributesBusinessHoursType0 | None | Unset = UNSET + description: Union[None, Unset, str] = UNSET + repeat_count: Union[Unset, int] = UNSET + group_ids: Union[Unset, list[str]] = UNSET + service_ids: Union[Unset, list[str]] = UNSET + business_hours: Union["NewEscalationPolicyDataAttributesBusinessHoursType0", None, Unset] = UNSET def to_dict(self) -> dict[str, Any]: from ..models.new_escalation_policy_data_attributes_business_hours_type_0 import ( @@ -43,7 +41,7 @@ def to_dict(self) -> dict[str, Any]: name = self.name - description: None | str | Unset + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: @@ -51,15 +49,15 @@ def to_dict(self) -> dict[str, Any]: repeat_count = self.repeat_count - group_ids: list[str] | Unset = UNSET + group_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.group_ids, Unset): group_ids = self.group_ids - service_ids: list[str] | Unset = UNSET + service_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.service_ids, Unset): service_ids = self.service_ids - business_hours: dict[str, Any] | None | Unset + business_hours: Union[None, Unset, dict[str, Any]] if isinstance(self.business_hours, Unset): business_hours = UNSET elif isinstance(self.business_hours, NewEscalationPolicyDataAttributesBusinessHoursType0): @@ -96,12 +94,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name") - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) @@ -111,7 +109,9 @@ def _parse_description(data: object) -> None | str | Unset: service_ids = cast(list[str], d.pop("service_ids", UNSET)) - def _parse_business_hours(data: object) -> NewEscalationPolicyDataAttributesBusinessHoursType0 | None | Unset: + def _parse_business_hours( + data: object, + ) -> Union["NewEscalationPolicyDataAttributesBusinessHoursType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -122,9 +122,9 @@ def _parse_business_hours(data: object) -> NewEscalationPolicyDataAttributesBusi business_hours_type_0 = NewEscalationPolicyDataAttributesBusinessHoursType0.from_dict(data) return business_hours_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(NewEscalationPolicyDataAttributesBusinessHoursType0 | None | Unset, data) + return cast(Union["NewEscalationPolicyDataAttributesBusinessHoursType0", None, Unset], data) business_hours = _parse_business_hours(d.pop("business_hours", UNSET)) diff --git a/rootly_sdk/models/new_escalation_policy_data_attributes_business_hours_type_0.py b/rootly_sdk/models/new_escalation_policy_data_attributes_business_hours_type_0.py index 60b5e2e1..05ef0d16 100644 --- a/rootly_sdk/models/new_escalation_policy_data_attributes_business_hours_type_0.py +++ b/rootly_sdk/models/new_escalation_policy_data_attributes_business_hours_type_0.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,24 +21,25 @@ class NewEscalationPolicyDataAttributesBusinessHoursType0: """ Attributes: - time_zone (NewEscalationPolicyDataAttributesBusinessHoursType0TimeZone | Unset): Time zone for business hours - days (list[NewEscalationPolicyDataAttributesBusinessHoursType0DaysType0Item] | None | Unset): Business days - start_time (None | str | Unset): Start time for business hours (HH:MM) - end_time (None | str | Unset): End time for business hours (HH:MM) + time_zone (Union[Unset, NewEscalationPolicyDataAttributesBusinessHoursType0TimeZone]): Time zone for business + hours + days (Union[None, Unset, list[NewEscalationPolicyDataAttributesBusinessHoursType0DaysType0Item]]): Business days + start_time (Union[None, Unset, str]): Start time for business hours (HH:MM) + end_time (Union[None, Unset, str]): End time for business hours (HH:MM) """ - time_zone: NewEscalationPolicyDataAttributesBusinessHoursType0TimeZone | Unset = UNSET - days: list[NewEscalationPolicyDataAttributesBusinessHoursType0DaysType0Item] | None | Unset = UNSET - start_time: None | str | Unset = UNSET - end_time: None | str | Unset = UNSET + time_zone: Union[Unset, NewEscalationPolicyDataAttributesBusinessHoursType0TimeZone] = UNSET + days: Union[None, Unset, list[NewEscalationPolicyDataAttributesBusinessHoursType0DaysType0Item]] = UNSET + start_time: Union[None, Unset, str] = UNSET + end_time: Union[None, Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - time_zone: str | Unset = UNSET + time_zone: Union[Unset, str] = UNSET if not isinstance(self.time_zone, Unset): time_zone = self.time_zone - days: list[str] | None | Unset + days: Union[None, Unset, list[str]] if isinstance(self.days, Unset): days = UNSET elif isinstance(self.days, list): @@ -52,13 +51,13 @@ def to_dict(self) -> dict[str, Any]: else: days = self.days - start_time: None | str | Unset + start_time: Union[None, Unset, str] if isinstance(self.start_time, Unset): start_time = UNSET else: start_time = self.start_time - end_time: None | str | Unset + end_time: Union[None, Unset, str] if isinstance(self.end_time, Unset): end_time = UNSET else: @@ -82,7 +81,7 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _time_zone = d.pop("time_zone", UNSET) - time_zone: NewEscalationPolicyDataAttributesBusinessHoursType0TimeZone | Unset + time_zone: Union[Unset, NewEscalationPolicyDataAttributesBusinessHoursType0TimeZone] if isinstance(_time_zone, Unset): time_zone = UNSET else: @@ -90,7 +89,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: def _parse_days( data: object, - ) -> list[NewEscalationPolicyDataAttributesBusinessHoursType0DaysType0Item] | None | Unset: + ) -> Union[None, Unset, list[NewEscalationPolicyDataAttributesBusinessHoursType0DaysType0Item]]: if data is None: return data if isinstance(data, Unset): @@ -110,27 +109,29 @@ def _parse_days( days_type_0.append(days_type_0_item) return days_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[NewEscalationPolicyDataAttributesBusinessHoursType0DaysType0Item] | None | Unset, data) + return cast( + Union[None, Unset, list[NewEscalationPolicyDataAttributesBusinessHoursType0DaysType0Item]], data + ) days = _parse_days(d.pop("days", UNSET)) - def _parse_start_time(data: object) -> None | str | Unset: + def _parse_start_time(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) start_time = _parse_start_time(d.pop("start_time", UNSET)) - def _parse_end_time(data: object) -> None | str | Unset: + def _parse_end_time(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) end_time = _parse_end_time(d.pop("end_time", UNSET)) diff --git a/rootly_sdk/models/new_escalation_policy_level.py b/rootly_sdk/models/new_escalation_policy_level.py index 2470c8e6..29fe8142 100644 --- a/rootly_sdk/models/new_escalation_policy_level.py +++ b/rootly_sdk/models/new_escalation_policy_level.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewEscalationPolicyLevel: data (NewEscalationPolicyLevelData): """ - data: NewEscalationPolicyLevelData + data: "NewEscalationPolicyLevelData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_escalation_policy_level_data.py b/rootly_sdk/models/new_escalation_policy_level_data.py index f8b43279..519cc25e 100644 --- a/rootly_sdk/models/new_escalation_policy_level_data.py +++ b/rootly_sdk/models/new_escalation_policy_level_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class NewEscalationPolicyLevelData: """ type_: NewEscalationPolicyLevelDataType - attributes: NewEscalationPolicyLevelDataAttributes + attributes: "NewEscalationPolicyLevelDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_escalation_policy_level_data_attributes.py b/rootly_sdk/models/new_escalation_policy_level_data_attributes.py index 247dcb2b..b92c2f8e 100644 --- a/rootly_sdk/models/new_escalation_policy_level_data_attributes.py +++ b/rootly_sdk/models/new_escalation_policy_level_data_attributes.py @@ -1,10 +1,16 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define +from ..models.new_escalation_policy_level_data_attributes_paging_strategy_configuration_repeats_mode import ( + NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRepeatsMode, + check_new_escalation_policy_level_data_attributes_paging_strategy_configuration_repeats_mode, +) +from ..models.new_escalation_policy_level_data_attributes_paging_strategy_configuration_rotation_scope import ( + NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRotationScope, + check_new_escalation_policy_level_data_attributes_paging_strategy_configuration_rotation_scope, +) from ..models.new_escalation_policy_level_data_attributes_paging_strategy_configuration_schedule_strategy import ( NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationScheduleStrategy, check_new_escalation_policy_level_data_attributes_paging_strategy_configuration_schedule_strategy, @@ -29,28 +35,48 @@ class NewEscalationPolicyLevelDataAttributes: """ Attributes: position (int): Position of the escalation policy level - notification_target_params (list[NewEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0 | - None]): Escalation level's notification targets - delay (int | Unset): Delay before notifying targets in the next Escalation Level. - paging_strategy_configuration_strategy - (NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationStrategy | Unset): Default: 'default'. - paging_strategy_configuration_schedule_strategy - (NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationScheduleStrategy | Unset): Default: - 'on_call_only'. - escalation_policy_path_id (None | str | Unset): The ID of the dynamic escalation policy path the level will + notification_target_params + (list[Union['NewEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0', None]]): Escalation + level's notification targets + delay (Union[Unset, int]): Delay before notifying targets in the next Escalation Level. + paging_strategy_configuration_strategy (Union[Unset, + NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationStrategy]): Default: 'default'. + paging_strategy_configuration_schedule_strategy (Union[Unset, + NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationScheduleStrategy]): Default: 'on_call_only'. + paging_strategy_configuration_repeats (Union[None, Unset, int]): Number of times to rotate through the roster + (cycle-based round robin). + paging_strategy_configuration_repeats_mode (Union[Unset, + NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRepeatsMode]): Controls how repeats are + interpreted: 'users' pages exactly N users, 'all' pages everyone once. + paging_strategy_configuration_rotation_scope (Union[Unset, + NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRotationScope]): Scope of rotation ordering: + active rotation members only, or entire schedule. + paging_strategy_configuration_page_users_count (Union[None, Unset, int]): Number of users to page at a time + (cycle-based round robin). + escalation_policy_path_id (Union[None, Unset, str]): The ID of the dynamic escalation policy path the level will belong to. If nothing is specified it will add the level to your default path. """ position: int - notification_target_params: list[NewEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0 | None] - delay: int | Unset = UNSET - paging_strategy_configuration_strategy: ( - NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationStrategy | Unset - ) = "default" - paging_strategy_configuration_schedule_strategy: ( - NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationScheduleStrategy | Unset - ) = "on_call_only" - escalation_policy_path_id: None | str | Unset = UNSET + notification_target_params: list[ + Union["NewEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0", None] + ] + delay: Union[Unset, int] = UNSET + paging_strategy_configuration_strategy: Union[ + Unset, NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationStrategy + ] = "default" + paging_strategy_configuration_schedule_strategy: Union[ + Unset, NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationScheduleStrategy + ] = "on_call_only" + paging_strategy_configuration_repeats: Union[None, Unset, int] = UNSET + paging_strategy_configuration_repeats_mode: Union[ + Unset, NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRepeatsMode + ] = UNSET + paging_strategy_configuration_rotation_scope: Union[ + Unset, NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRotationScope + ] = UNSET + paging_strategy_configuration_page_users_count: Union[None, Unset, int] = UNSET + escalation_policy_path_id: Union[None, Unset, str] = UNSET def to_dict(self) -> dict[str, Any]: from ..models.new_escalation_policy_level_data_attributes_notification_target_params_item_type_0 import ( @@ -61,7 +87,7 @@ def to_dict(self) -> dict[str, Any]: notification_target_params = [] for notification_target_params_item_data in self.notification_target_params: - notification_target_params_item: dict[str, Any] | None + notification_target_params_item: Union[None, dict[str, Any]] if isinstance( notification_target_params_item_data, NewEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0, @@ -73,15 +99,35 @@ def to_dict(self) -> dict[str, Any]: delay = self.delay - paging_strategy_configuration_strategy: str | Unset = UNSET + paging_strategy_configuration_strategy: Union[Unset, str] = UNSET if not isinstance(self.paging_strategy_configuration_strategy, Unset): paging_strategy_configuration_strategy = self.paging_strategy_configuration_strategy - paging_strategy_configuration_schedule_strategy: str | Unset = UNSET + paging_strategy_configuration_schedule_strategy: Union[Unset, str] = UNSET if not isinstance(self.paging_strategy_configuration_schedule_strategy, Unset): paging_strategy_configuration_schedule_strategy = self.paging_strategy_configuration_schedule_strategy - escalation_policy_path_id: None | str | Unset + paging_strategy_configuration_repeats: Union[None, Unset, int] + if isinstance(self.paging_strategy_configuration_repeats, Unset): + paging_strategy_configuration_repeats = UNSET + else: + paging_strategy_configuration_repeats = self.paging_strategy_configuration_repeats + + paging_strategy_configuration_repeats_mode: Union[Unset, str] = UNSET + if not isinstance(self.paging_strategy_configuration_repeats_mode, Unset): + paging_strategy_configuration_repeats_mode = self.paging_strategy_configuration_repeats_mode + + paging_strategy_configuration_rotation_scope: Union[Unset, str] = UNSET + if not isinstance(self.paging_strategy_configuration_rotation_scope, Unset): + paging_strategy_configuration_rotation_scope = self.paging_strategy_configuration_rotation_scope + + paging_strategy_configuration_page_users_count: Union[None, Unset, int] + if isinstance(self.paging_strategy_configuration_page_users_count, Unset): + paging_strategy_configuration_page_users_count = UNSET + else: + paging_strategy_configuration_page_users_count = self.paging_strategy_configuration_page_users_count + + escalation_policy_path_id: Union[None, Unset, str] if isinstance(self.escalation_policy_path_id, Unset): escalation_policy_path_id = UNSET else: @@ -103,6 +149,16 @@ def to_dict(self) -> dict[str, Any]: field_dict["paging_strategy_configuration_schedule_strategy"] = ( paging_strategy_configuration_schedule_strategy ) + if paging_strategy_configuration_repeats is not UNSET: + field_dict["paging_strategy_configuration_repeats"] = paging_strategy_configuration_repeats + if paging_strategy_configuration_repeats_mode is not UNSET: + field_dict["paging_strategy_configuration_repeats_mode"] = paging_strategy_configuration_repeats_mode + if paging_strategy_configuration_rotation_scope is not UNSET: + field_dict["paging_strategy_configuration_rotation_scope"] = paging_strategy_configuration_rotation_scope + if paging_strategy_configuration_page_users_count is not UNSET: + field_dict["paging_strategy_configuration_page_users_count"] = ( + paging_strategy_configuration_page_users_count + ) if escalation_policy_path_id is not UNSET: field_dict["escalation_policy_path_id"] = escalation_policy_path_id @@ -123,7 +179,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: def _parse_notification_target_params_item( data: object, - ) -> NewEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0 | None: + ) -> Union["NewEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0", None]: if data is None: return data try: @@ -134,9 +190,11 @@ def _parse_notification_target_params_item( ) return notification_target_params_item_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(NewEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0 | None, data) + return cast( + Union["NewEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0", None], data + ) notification_target_params_item = _parse_notification_target_params_item( notification_target_params_item_data @@ -147,9 +205,9 @@ def _parse_notification_target_params_item( delay = d.pop("delay", UNSET) _paging_strategy_configuration_strategy = d.pop("paging_strategy_configuration_strategy", UNSET) - paging_strategy_configuration_strategy: ( - NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationStrategy | Unset - ) + paging_strategy_configuration_strategy: Union[ + Unset, NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationStrategy + ] if isinstance(_paging_strategy_configuration_strategy, Unset): paging_strategy_configuration_strategy = UNSET else: @@ -162,9 +220,9 @@ def _parse_notification_target_params_item( _paging_strategy_configuration_schedule_strategy = d.pop( "paging_strategy_configuration_schedule_strategy", UNSET ) - paging_strategy_configuration_schedule_strategy: ( - NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationScheduleStrategy | Unset - ) + paging_strategy_configuration_schedule_strategy: Union[ + Unset, NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationScheduleStrategy + ] if isinstance(_paging_strategy_configuration_schedule_strategy, Unset): paging_strategy_configuration_schedule_strategy = UNSET else: @@ -174,12 +232,60 @@ def _parse_notification_target_params_item( ) ) - def _parse_escalation_policy_path_id(data: object) -> None | str | Unset: + def _parse_paging_strategy_configuration_repeats(data: object) -> Union[None, Unset, int]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, int], data) + + paging_strategy_configuration_repeats = _parse_paging_strategy_configuration_repeats( + d.pop("paging_strategy_configuration_repeats", UNSET) + ) + + _paging_strategy_configuration_repeats_mode = d.pop("paging_strategy_configuration_repeats_mode", UNSET) + paging_strategy_configuration_repeats_mode: Union[ + Unset, NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRepeatsMode + ] + if isinstance(_paging_strategy_configuration_repeats_mode, Unset): + paging_strategy_configuration_repeats_mode = UNSET + else: + paging_strategy_configuration_repeats_mode = ( + check_new_escalation_policy_level_data_attributes_paging_strategy_configuration_repeats_mode( + _paging_strategy_configuration_repeats_mode + ) + ) + + _paging_strategy_configuration_rotation_scope = d.pop("paging_strategy_configuration_rotation_scope", UNSET) + paging_strategy_configuration_rotation_scope: Union[ + Unset, NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRotationScope + ] + if isinstance(_paging_strategy_configuration_rotation_scope, Unset): + paging_strategy_configuration_rotation_scope = UNSET + else: + paging_strategy_configuration_rotation_scope = ( + check_new_escalation_policy_level_data_attributes_paging_strategy_configuration_rotation_scope( + _paging_strategy_configuration_rotation_scope + ) + ) + + def _parse_paging_strategy_configuration_page_users_count(data: object) -> Union[None, Unset, int]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, int], data) + + paging_strategy_configuration_page_users_count = _parse_paging_strategy_configuration_page_users_count( + d.pop("paging_strategy_configuration_page_users_count", UNSET) + ) + + def _parse_escalation_policy_path_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) escalation_policy_path_id = _parse_escalation_policy_path_id(d.pop("escalation_policy_path_id", UNSET)) @@ -189,6 +295,10 @@ def _parse_escalation_policy_path_id(data: object) -> None | str | Unset: delay=delay, paging_strategy_configuration_strategy=paging_strategy_configuration_strategy, paging_strategy_configuration_schedule_strategy=paging_strategy_configuration_schedule_strategy, + paging_strategy_configuration_repeats=paging_strategy_configuration_repeats, + paging_strategy_configuration_repeats_mode=paging_strategy_configuration_repeats_mode, + paging_strategy_configuration_rotation_scope=paging_strategy_configuration_rotation_scope, + paging_strategy_configuration_page_users_count=paging_strategy_configuration_page_users_count, escalation_policy_path_id=escalation_policy_path_id, ) diff --git a/rootly_sdk/models/new_escalation_policy_level_data_attributes_notification_target_params_item_type_0.py b/rootly_sdk/models/new_escalation_policy_level_data_attributes_notification_target_params_item_type_0.py index 9609b665..7c1e735b 100644 --- a/rootly_sdk/models/new_escalation_policy_level_data_attributes_notification_target_params_item_type_0.py +++ b/rootly_sdk/models/new_escalation_policy_level_data_attributes_notification_target_params_item_type_0.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -27,13 +25,15 @@ class NewEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0: Microsoft Teams channel, then the Rootly channel UUID. type_ (NewEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0Type): The type of the notification target - team_members (NewEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0TeamMembers | Unset): For - targets with type=team, controls whether to notify admins, all team members, or escalate to team EP. + team_members (Union[Unset, NewEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0TeamMembers]): + For targets with type=team, controls whether to notify admins, all team members, or escalate to team EP. """ id: str type_: NewEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0Type - team_members: NewEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0TeamMembers | Unset = UNSET + team_members: Union[Unset, NewEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0TeamMembers] = ( + UNSET + ) additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -41,7 +41,7 @@ def to_dict(self) -> dict[str, Any]: type_: str = self.type_ - team_members: str | Unset = UNSET + team_members: Union[Unset, str] = UNSET if not isinstance(self.team_members, Unset): team_members = self.team_members @@ -68,7 +68,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: ) _team_members = d.pop("team_members", UNSET) - team_members: NewEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0TeamMembers | Unset + team_members: Union[Unset, NewEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0TeamMembers] if isinstance(_team_members, Unset): team_members = UNSET else: diff --git a/rootly_sdk/models/new_escalation_policy_level_data_attributes_paging_strategy_configuration_repeats_mode.py b/rootly_sdk/models/new_escalation_policy_level_data_attributes_paging_strategy_configuration_repeats_mode.py new file mode 100644 index 00000000..ebc1070f --- /dev/null +++ b/rootly_sdk/models/new_escalation_policy_level_data_attributes_paging_strategy_configuration_repeats_mode.py @@ -0,0 +1,22 @@ +from typing import Literal, cast + +NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRepeatsMode = Literal["all", "users"] + +NEW_ESCALATION_POLICY_LEVEL_DATA_ATTRIBUTES_PAGING_STRATEGY_CONFIGURATION_REPEATS_MODE_VALUES: set[ + NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRepeatsMode +] = { + "all", + "users", +} + + +def check_new_escalation_policy_level_data_attributes_paging_strategy_configuration_repeats_mode( + value: str | None, +) -> NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRepeatsMode | None: + if value is None: + return None + if value in NEW_ESCALATION_POLICY_LEVEL_DATA_ATTRIBUTES_PAGING_STRATEGY_CONFIGURATION_REPEATS_MODE_VALUES: + return cast(NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRepeatsMode, value) + raise TypeError( + f"Unexpected value {value!r}. Expected one of {NEW_ESCALATION_POLICY_LEVEL_DATA_ATTRIBUTES_PAGING_STRATEGY_CONFIGURATION_REPEATS_MODE_VALUES!r}" + ) diff --git a/rootly_sdk/models/new_escalation_policy_level_data_attributes_paging_strategy_configuration_rotation_scope.py b/rootly_sdk/models/new_escalation_policy_level_data_attributes_paging_strategy_configuration_rotation_scope.py new file mode 100644 index 00000000..622265ef --- /dev/null +++ b/rootly_sdk/models/new_escalation_policy_level_data_attributes_paging_strategy_configuration_rotation_scope.py @@ -0,0 +1,24 @@ +from typing import Literal, cast + +NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRotationScope = Literal[ + "active_rotation", "entire_schedule" +] + +NEW_ESCALATION_POLICY_LEVEL_DATA_ATTRIBUTES_PAGING_STRATEGY_CONFIGURATION_ROTATION_SCOPE_VALUES: set[ + NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRotationScope +] = { + "active_rotation", + "entire_schedule", +} + + +def check_new_escalation_policy_level_data_attributes_paging_strategy_configuration_rotation_scope( + value: str | None, +) -> NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRotationScope | None: + if value is None: + return None + if value in NEW_ESCALATION_POLICY_LEVEL_DATA_ATTRIBUTES_PAGING_STRATEGY_CONFIGURATION_ROTATION_SCOPE_VALUES: + return cast(NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRotationScope, value) + raise TypeError( + f"Unexpected value {value!r}. Expected one of {NEW_ESCALATION_POLICY_LEVEL_DATA_ATTRIBUTES_PAGING_STRATEGY_CONFIGURATION_ROTATION_SCOPE_VALUES!r}" + ) diff --git a/rootly_sdk/models/new_escalation_policy_path.py b/rootly_sdk/models/new_escalation_policy_path.py index 9af97aa7..44d4209f 100644 --- a/rootly_sdk/models/new_escalation_policy_path.py +++ b/rootly_sdk/models/new_escalation_policy_path.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewEscalationPolicyPath: data (NewEscalationPolicyPathData): """ - data: NewEscalationPolicyPathData + data: "NewEscalationPolicyPathData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_escalation_policy_path_data.py b/rootly_sdk/models/new_escalation_policy_path_data.py index e0b9e314..9dd2784d 100644 --- a/rootly_sdk/models/new_escalation_policy_path_data.py +++ b/rootly_sdk/models/new_escalation_policy_path_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class NewEscalationPolicyPathData: """ type_: NewEscalationPolicyPathDataType - attributes: NewEscalationPolicyPathDataAttributes + attributes: "NewEscalationPolicyPathDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_escalation_policy_path_data_attributes.py b/rootly_sdk/models/new_escalation_policy_path_data_attributes.py index d4d8fd4f..c106d139 100644 --- a/rootly_sdk/models/new_escalation_policy_path_data_attributes.py +++ b/rootly_sdk/models/new_escalation_policy_path_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -65,60 +63,65 @@ class NewEscalationPolicyPathDataAttributes: """ Attributes: name (str): The name of the escalation path - notification_type (NewEscalationPolicyPathDataAttributesNotificationType | Unset): Notification rule type to be - used Default: 'audible'. - path_type (NewEscalationPolicyPathDataAttributesPathType | Unset): The type of escalation path to create + notification_type (Union[Unset, NewEscalationPolicyPathDataAttributesNotificationType]): Notification rule type + to be used Default: 'audible'. + path_type (Union[Unset, NewEscalationPolicyPathDataAttributesPathType]): The type of escalation path to create Default: 'escalation'. - after_deferral_behavior (NewEscalationPolicyPathDataAttributesAfterDeferralBehavior | Unset): What happens after - a deferral path finishes. Required for deferral paths. - after_deferral_path_id (None | str | Unset): The escalation path to execute after this deferral path when + after_deferral_behavior (Union[Unset, NewEscalationPolicyPathDataAttributesAfterDeferralBehavior]): What happens + after a deferral path finishes. Required for deferral paths. + after_deferral_path_id (Union[None, Unset, str]): The escalation path to execute after this deferral path when after_deferral_behavior is execute_path. - default (bool | None | Unset): Whether this escalation path is the default path - match_mode (NewEscalationPolicyPathDataAttributesMatchMode | Unset): How path rules are matched. Default: + default (Union[None, Unset, bool]): Whether this escalation path is the default path + match_mode (Union[Unset, NewEscalationPolicyPathDataAttributesMatchMode]): How path rules are matched. Default: 'match-all-rules'. - position (int | Unset): The position of this path in the paths for this EP. - repeat (bool | None | Unset): Whether this path should be repeated until someone acknowledges the alert - repeat_count (int | None | Unset): The number of times this path will be executed until someone acknowledges the - alert - initial_delay (int | Unset): Initial delay for escalation path in minutes. Maximum 1 week (10080). - rules (list[NewEscalationPolicyPathDataAttributesRulesItemType0 | - NewEscalationPolicyPathDataAttributesRulesItemType1 | NewEscalationPolicyPathDataAttributesRulesItemType2 | - NewEscalationPolicyPathDataAttributesRulesItemType3 | NewEscalationPolicyPathDataAttributesRulesItemType4 | - NewEscalationPolicyPathDataAttributesRulesItemType5 | NewEscalationPolicyPathDataAttributesRulesItemType6 | - NewEscalationPolicyPathDataAttributesRulesItemType7] | Unset): Escalation path conditions - time_restriction_time_zone (NewEscalationPolicyPathDataAttributesTimeRestrictionTimeZone | Unset): Time zone - used for time restrictions. - time_restrictions (list[NewEscalationPolicyPathDataAttributesTimeRestrictionsItem] | Unset): If time + position (Union[Unset, int]): The position of this path in the paths for this EP. + repeat (Union[None, Unset, bool]): Whether this path should be repeated until someone acknowledges the alert + repeat_count (Union[None, Unset, int]): The number of times this path will be executed until someone + acknowledges the alert + initial_delay (Union[Unset, int]): Initial delay for escalation path in minutes. Maximum 1 week (10080). + retrigger_timeout_minutes (Union[None, Unset, int]): Re-trigger acknowledged alerts on this path after N + minutes; null inherits the urgency/workspace default, negative = never. + rules (Union[Unset, list[Union['NewEscalationPolicyPathDataAttributesRulesItemType0', + 'NewEscalationPolicyPathDataAttributesRulesItemType1', 'NewEscalationPolicyPathDataAttributesRulesItemType2', + 'NewEscalationPolicyPathDataAttributesRulesItemType3', 'NewEscalationPolicyPathDataAttributesRulesItemType4', + 'NewEscalationPolicyPathDataAttributesRulesItemType5', 'NewEscalationPolicyPathDataAttributesRulesItemType6', + 'NewEscalationPolicyPathDataAttributesRulesItemType7']]]): Escalation path conditions + time_restriction_time_zone (Union[Unset, NewEscalationPolicyPathDataAttributesTimeRestrictionTimeZone]): Time + zone used for time restrictions. + time_restrictions (Union[Unset, list['NewEscalationPolicyPathDataAttributesTimeRestrictionsItem']]): If time restrictions are set, alerts will follow this path when they arrive within the specified time ranges and meet the rules. """ name: str - notification_type: NewEscalationPolicyPathDataAttributesNotificationType | Unset = "audible" - path_type: NewEscalationPolicyPathDataAttributesPathType | Unset = "escalation" - after_deferral_behavior: NewEscalationPolicyPathDataAttributesAfterDeferralBehavior | Unset = UNSET - after_deferral_path_id: None | str | Unset = UNSET - default: bool | None | Unset = UNSET - match_mode: NewEscalationPolicyPathDataAttributesMatchMode | Unset = "match-all-rules" - position: int | Unset = UNSET - repeat: bool | None | Unset = UNSET - repeat_count: int | None | Unset = UNSET - initial_delay: int | Unset = UNSET - rules: ( + notification_type: Union[Unset, NewEscalationPolicyPathDataAttributesNotificationType] = "audible" + path_type: Union[Unset, NewEscalationPolicyPathDataAttributesPathType] = "escalation" + after_deferral_behavior: Union[Unset, NewEscalationPolicyPathDataAttributesAfterDeferralBehavior] = UNSET + after_deferral_path_id: Union[None, Unset, str] = UNSET + default: Union[None, Unset, bool] = UNSET + match_mode: Union[Unset, NewEscalationPolicyPathDataAttributesMatchMode] = "match-all-rules" + position: Union[Unset, int] = UNSET + repeat: Union[None, Unset, bool] = UNSET + repeat_count: Union[None, Unset, int] = UNSET + initial_delay: Union[Unset, int] = UNSET + retrigger_timeout_minutes: Union[None, Unset, int] = UNSET + rules: Union[ + Unset, list[ - NewEscalationPolicyPathDataAttributesRulesItemType0 - | NewEscalationPolicyPathDataAttributesRulesItemType1 - | NewEscalationPolicyPathDataAttributesRulesItemType2 - | NewEscalationPolicyPathDataAttributesRulesItemType3 - | NewEscalationPolicyPathDataAttributesRulesItemType4 - | NewEscalationPolicyPathDataAttributesRulesItemType5 - | NewEscalationPolicyPathDataAttributesRulesItemType6 - | NewEscalationPolicyPathDataAttributesRulesItemType7 - ] - | Unset - ) = UNSET - time_restriction_time_zone: NewEscalationPolicyPathDataAttributesTimeRestrictionTimeZone | Unset = UNSET - time_restrictions: list[NewEscalationPolicyPathDataAttributesTimeRestrictionsItem] | Unset = UNSET + Union[ + "NewEscalationPolicyPathDataAttributesRulesItemType0", + "NewEscalationPolicyPathDataAttributesRulesItemType1", + "NewEscalationPolicyPathDataAttributesRulesItemType2", + "NewEscalationPolicyPathDataAttributesRulesItemType3", + "NewEscalationPolicyPathDataAttributesRulesItemType4", + "NewEscalationPolicyPathDataAttributesRulesItemType5", + "NewEscalationPolicyPathDataAttributesRulesItemType6", + "NewEscalationPolicyPathDataAttributesRulesItemType7", + ] + ], + ] = UNSET + time_restriction_time_zone: Union[Unset, NewEscalationPolicyPathDataAttributesTimeRestrictionTimeZone] = UNSET + time_restrictions: Union[Unset, list["NewEscalationPolicyPathDataAttributesTimeRestrictionsItem"]] = UNSET def to_dict(self) -> dict[str, Any]: from ..models.new_escalation_policy_path_data_attributes_rules_item_type_0 import ( @@ -145,43 +148,43 @@ def to_dict(self) -> dict[str, Any]: name = self.name - notification_type: str | Unset = UNSET + notification_type: Union[Unset, str] = UNSET if not isinstance(self.notification_type, Unset): notification_type = self.notification_type - path_type: str | Unset = UNSET + path_type: Union[Unset, str] = UNSET if not isinstance(self.path_type, Unset): path_type = self.path_type - after_deferral_behavior: str | Unset = UNSET + after_deferral_behavior: Union[Unset, str] = UNSET if not isinstance(self.after_deferral_behavior, Unset): after_deferral_behavior = self.after_deferral_behavior - after_deferral_path_id: None | str | Unset + after_deferral_path_id: Union[None, Unset, str] if isinstance(self.after_deferral_path_id, Unset): after_deferral_path_id = UNSET else: after_deferral_path_id = self.after_deferral_path_id - default: bool | None | Unset + default: Union[None, Unset, bool] if isinstance(self.default, Unset): default = UNSET else: default = self.default - match_mode: str | Unset = UNSET + match_mode: Union[Unset, str] = UNSET if not isinstance(self.match_mode, Unset): match_mode = self.match_mode position = self.position - repeat: bool | None | Unset + repeat: Union[None, Unset, bool] if isinstance(self.repeat, Unset): repeat = UNSET else: repeat = self.repeat - repeat_count: int | None | Unset + repeat_count: Union[None, Unset, int] if isinstance(self.repeat_count, Unset): repeat_count = UNSET else: @@ -189,7 +192,13 @@ def to_dict(self) -> dict[str, Any]: initial_delay = self.initial_delay - rules: list[dict[str, Any]] | Unset = UNSET + retrigger_timeout_minutes: Union[None, Unset, int] + if isinstance(self.retrigger_timeout_minutes, Unset): + retrigger_timeout_minutes = UNSET + else: + retrigger_timeout_minutes = self.retrigger_timeout_minutes + + rules: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.rules, Unset): rules = [] for rules_item_data in self.rules: @@ -213,11 +222,11 @@ def to_dict(self) -> dict[str, Any]: rules.append(rules_item) - time_restriction_time_zone: str | Unset = UNSET + time_restriction_time_zone: Union[Unset, str] = UNSET if not isinstance(self.time_restriction_time_zone, Unset): time_restriction_time_zone = self.time_restriction_time_zone - time_restrictions: list[dict[str, Any]] | Unset = UNSET + time_restrictions: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.time_restrictions, Unset): time_restrictions = [] for time_restrictions_item_data in self.time_restrictions: @@ -251,6 +260,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["repeat_count"] = repeat_count if initial_delay is not UNSET: field_dict["initial_delay"] = initial_delay + if retrigger_timeout_minutes is not UNSET: + field_dict["retrigger_timeout_minutes"] = retrigger_timeout_minutes if rules is not UNSET: field_dict["rules"] = rules if time_restriction_time_zone is not UNSET: @@ -294,21 +305,21 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name = d.pop("name") _notification_type = d.pop("notification_type", UNSET) - notification_type: NewEscalationPolicyPathDataAttributesNotificationType | Unset + notification_type: Union[Unset, NewEscalationPolicyPathDataAttributesNotificationType] if isinstance(_notification_type, Unset): notification_type = UNSET else: notification_type = check_new_escalation_policy_path_data_attributes_notification_type(_notification_type) _path_type = d.pop("path_type", UNSET) - path_type: NewEscalationPolicyPathDataAttributesPathType | Unset + path_type: Union[Unset, NewEscalationPolicyPathDataAttributesPathType] if isinstance(_path_type, Unset): path_type = UNSET else: path_type = check_new_escalation_policy_path_data_attributes_path_type(_path_type) _after_deferral_behavior = d.pop("after_deferral_behavior", UNSET) - after_deferral_behavior: NewEscalationPolicyPathDataAttributesAfterDeferralBehavior | Unset + after_deferral_behavior: Union[Unset, NewEscalationPolicyPathDataAttributesAfterDeferralBehavior] if isinstance(_after_deferral_behavior, Unset): after_deferral_behavior = UNSET else: @@ -316,26 +327,26 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: _after_deferral_behavior ) - def _parse_after_deferral_path_id(data: object) -> None | str | Unset: + def _parse_after_deferral_path_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) after_deferral_path_id = _parse_after_deferral_path_id(d.pop("after_deferral_path_id", UNSET)) - def _parse_default(data: object) -> bool | None | Unset: + def _parse_default(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) default = _parse_default(d.pop("default", UNSET)) _match_mode = d.pop("match_mode", UNSET) - match_mode: NewEscalationPolicyPathDataAttributesMatchMode | Unset + match_mode: Union[Unset, NewEscalationPolicyPathDataAttributesMatchMode] if isinstance(_match_mode, Unset): match_mode = UNSET else: @@ -343,124 +354,119 @@ def _parse_default(data: object) -> bool | None | Unset: position = d.pop("position", UNSET) - def _parse_repeat(data: object) -> bool | None | Unset: + def _parse_repeat(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) repeat = _parse_repeat(d.pop("repeat", UNSET)) - def _parse_repeat_count(data: object) -> int | None | Unset: + def _parse_repeat_count(data: object) -> Union[None, Unset, int]: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(Union[None, Unset, int], data) repeat_count = _parse_repeat_count(d.pop("repeat_count", UNSET)) initial_delay = d.pop("initial_delay", UNSET) + def _parse_retrigger_timeout_minutes(data: object) -> Union[None, Unset, int]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, int], data) + + retrigger_timeout_minutes = _parse_retrigger_timeout_minutes(d.pop("retrigger_timeout_minutes", UNSET)) + + rules = [] _rules = d.pop("rules", UNSET) - rules: ( - list[ - NewEscalationPolicyPathDataAttributesRulesItemType0 - | NewEscalationPolicyPathDataAttributesRulesItemType1 - | NewEscalationPolicyPathDataAttributesRulesItemType2 - | NewEscalationPolicyPathDataAttributesRulesItemType3 - | NewEscalationPolicyPathDataAttributesRulesItemType4 - | NewEscalationPolicyPathDataAttributesRulesItemType5 - | NewEscalationPolicyPathDataAttributesRulesItemType6 - | NewEscalationPolicyPathDataAttributesRulesItemType7 - ] - | Unset - ) = UNSET - if _rules is not UNSET: - rules = [] - for rules_item_data in _rules: - - def _parse_rules_item( - data: object, - ) -> ( - NewEscalationPolicyPathDataAttributesRulesItemType0 - | NewEscalationPolicyPathDataAttributesRulesItemType1 - | NewEscalationPolicyPathDataAttributesRulesItemType2 - | NewEscalationPolicyPathDataAttributesRulesItemType3 - | NewEscalationPolicyPathDataAttributesRulesItemType4 - | NewEscalationPolicyPathDataAttributesRulesItemType5 - | NewEscalationPolicyPathDataAttributesRulesItemType6 - | NewEscalationPolicyPathDataAttributesRulesItemType7 - ): - try: - if not isinstance(data, dict): - raise TypeError() - rules_item_type_0 = NewEscalationPolicyPathDataAttributesRulesItemType0.from_dict(data) - - return rules_item_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - rules_item_type_1 = NewEscalationPolicyPathDataAttributesRulesItemType1.from_dict(data) - - return rules_item_type_1 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - rules_item_type_2 = NewEscalationPolicyPathDataAttributesRulesItemType2.from_dict(data) - - return rules_item_type_2 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - rules_item_type_3 = NewEscalationPolicyPathDataAttributesRulesItemType3.from_dict(data) - - return rules_item_type_3 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - rules_item_type_4 = NewEscalationPolicyPathDataAttributesRulesItemType4.from_dict(data) - - return rules_item_type_4 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - rules_item_type_5 = NewEscalationPolicyPathDataAttributesRulesItemType5.from_dict(data) - - return rules_item_type_5 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - rules_item_type_6 = NewEscalationPolicyPathDataAttributesRulesItemType6.from_dict(data) - - return rules_item_type_6 - except (TypeError, ValueError, AttributeError, KeyError): - pass + for rules_item_data in _rules or []: + + def _parse_rules_item( + data: object, + ) -> Union[ + "NewEscalationPolicyPathDataAttributesRulesItemType0", + "NewEscalationPolicyPathDataAttributesRulesItemType1", + "NewEscalationPolicyPathDataAttributesRulesItemType2", + "NewEscalationPolicyPathDataAttributesRulesItemType3", + "NewEscalationPolicyPathDataAttributesRulesItemType4", + "NewEscalationPolicyPathDataAttributesRulesItemType5", + "NewEscalationPolicyPathDataAttributesRulesItemType6", + "NewEscalationPolicyPathDataAttributesRulesItemType7", + ]: + try: if not isinstance(data, dict): raise TypeError() - rules_item_type_7 = NewEscalationPolicyPathDataAttributesRulesItemType7.from_dict(data) + rules_item_type_0 = NewEscalationPolicyPathDataAttributesRulesItemType0.from_dict(data) - return rules_item_type_7 + return rules_item_type_0 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + rules_item_type_1 = NewEscalationPolicyPathDataAttributesRulesItemType1.from_dict(data) - rules_item = _parse_rules_item(rules_item_data) + return rules_item_type_1 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + rules_item_type_2 = NewEscalationPolicyPathDataAttributesRulesItemType2.from_dict(data) - rules.append(rules_item) + return rules_item_type_2 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + rules_item_type_3 = NewEscalationPolicyPathDataAttributesRulesItemType3.from_dict(data) + + return rules_item_type_3 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + rules_item_type_4 = NewEscalationPolicyPathDataAttributesRulesItemType4.from_dict(data) + + return rules_item_type_4 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + rules_item_type_5 = NewEscalationPolicyPathDataAttributesRulesItemType5.from_dict(data) + + return rules_item_type_5 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + rules_item_type_6 = NewEscalationPolicyPathDataAttributesRulesItemType6.from_dict(data) + + return rules_item_type_6 + except: # noqa: E722 + pass + if not isinstance(data, dict): + raise TypeError() + rules_item_type_7 = NewEscalationPolicyPathDataAttributesRulesItemType7.from_dict(data) + + return rules_item_type_7 + + rules_item = _parse_rules_item(rules_item_data) + + rules.append(rules_item) _time_restriction_time_zone = d.pop("time_restriction_time_zone", UNSET) - time_restriction_time_zone: NewEscalationPolicyPathDataAttributesTimeRestrictionTimeZone | Unset + time_restriction_time_zone: Union[Unset, NewEscalationPolicyPathDataAttributesTimeRestrictionTimeZone] if isinstance(_time_restriction_time_zone, Unset): time_restriction_time_zone = UNSET else: @@ -468,16 +474,14 @@ def _parse_rules_item( _time_restriction_time_zone ) + time_restrictions = [] _time_restrictions = d.pop("time_restrictions", UNSET) - time_restrictions: list[NewEscalationPolicyPathDataAttributesTimeRestrictionsItem] | Unset = UNSET - if _time_restrictions is not UNSET: - time_restrictions = [] - for time_restrictions_item_data in _time_restrictions: - time_restrictions_item = NewEscalationPolicyPathDataAttributesTimeRestrictionsItem.from_dict( - time_restrictions_item_data - ) + for time_restrictions_item_data in _time_restrictions or []: + time_restrictions_item = NewEscalationPolicyPathDataAttributesTimeRestrictionsItem.from_dict( + time_restrictions_item_data + ) - time_restrictions.append(time_restrictions_item) + time_restrictions.append(time_restrictions_item) new_escalation_policy_path_data_attributes = cls( name=name, @@ -491,6 +495,7 @@ def _parse_rules_item( repeat=repeat, repeat_count=repeat_count, initial_delay=initial_delay, + retrigger_timeout_minutes=retrigger_timeout_minutes, rules=rules, time_restriction_time_zone=time_restriction_time_zone, time_restrictions=time_restrictions, diff --git a/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_0.py b/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_0.py index 7966b6c7..38c00a05 100644 --- a/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_0.py +++ b/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast diff --git a/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_1.py b/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_1.py index 0494dba8..d85a1090 100644 --- a/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_1.py +++ b/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_1.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_2.py b/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_2.py index c367486f..5f3acff9 100644 --- a/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_2.py +++ b/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_2.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -26,15 +24,15 @@ class NewEscalationPolicyPathDataAttributesRulesItemType2: rule_type (NewEscalationPolicyPathDataAttributesRulesItemType2RuleType): The type of the escalation path rule json_path (str): JSON path to extract value from payload operator (NewEscalationPolicyPathDataAttributesRulesItemType2Operator): How JSON path value should be matched - value (None | str | Unset): Value with which JSON path value should be matched - values (list[str] | Unset): Values to match against (for is_one_of / is_not_one_of operators) + value (Union[None, Unset, str]): Value with which JSON path value should be matched + values (Union[Unset, list[str]]): Values to match against (for is_one_of / is_not_one_of operators) """ rule_type: NewEscalationPolicyPathDataAttributesRulesItemType2RuleType json_path: str operator: NewEscalationPolicyPathDataAttributesRulesItemType2Operator - value: None | str | Unset = UNSET - values: list[str] | Unset = UNSET + value: Union[None, Unset, str] = UNSET + values: Union[Unset, list[str]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -44,13 +42,13 @@ def to_dict(self) -> dict[str, Any]: operator: str = self.operator - value: None | str | Unset + value: Union[None, Unset, str] if isinstance(self.value, Unset): value = UNSET else: value = self.value - values: list[str] | Unset = UNSET + values: Union[Unset, list[str]] = UNSET if not isinstance(self.values, Unset): values = self.values @@ -79,12 +77,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: operator = check_new_escalation_policy_path_data_attributes_rules_item_type_2_operator(d.pop("operator")) - def _parse_value(data: object) -> None | str | Unset: + def _parse_value(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) value = _parse_value(d.pop("value", UNSET)) diff --git a/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_3.py b/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_3.py index 2d43753c..6a34e20e 100644 --- a/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_3.py +++ b/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_3.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -28,14 +26,14 @@ class NewEscalationPolicyPathDataAttributesRulesItemType3: fieldable_id (str): The ID of the alert field operator (NewEscalationPolicyPathDataAttributesRulesItemType3Operator): How the alert field value should be matched - values (list[str] | Unset): Values to match against + values (Union[Unset, list[str]]): Values to match against """ rule_type: NewEscalationPolicyPathDataAttributesRulesItemType3RuleType fieldable_type: str fieldable_id: str operator: NewEscalationPolicyPathDataAttributesRulesItemType3Operator - values: list[str] | Unset = UNSET + values: Union[Unset, list[str]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -47,7 +45,7 @@ def to_dict(self) -> dict[str, Any]: operator: str = self.operator - values: list[str] | Unset = UNSET + values: Union[Unset, list[str]] = UNSET if not isinstance(self.values, Unset): values = self.values diff --git a/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_4.py b/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_4.py index 7af44d76..969d678c 100644 --- a/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_4.py +++ b/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_4.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast diff --git a/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_5.py b/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_5.py index cbb79731..fc7aeb81 100644 --- a/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_5.py +++ b/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_5.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -30,17 +28,16 @@ class NewEscalationPolicyPathDataAttributesRulesItemType5: Attributes: rule_type (NewEscalationPolicyPathDataAttributesRulesItemType5RuleType): The type of the escalation path rule time_zone (NewEscalationPolicyPathDataAttributesRulesItemType5TimeZone): Time zone for the deferral window - time_blocks (list[NewEscalationPolicyPathDataAttributesRulesItemType5TimeBlocksItem]): Time windows during which - alerts are deferred + time_blocks (list['NewEscalationPolicyPathDataAttributesRulesItemType5TimeBlocksItem']): Time windows during + which alerts are deferred """ rule_type: NewEscalationPolicyPathDataAttributesRulesItemType5RuleType time_zone: NewEscalationPolicyPathDataAttributesRulesItemType5TimeZone - time_blocks: list[NewEscalationPolicyPathDataAttributesRulesItemType5TimeBlocksItem] + time_blocks: list["NewEscalationPolicyPathDataAttributesRulesItemType5TimeBlocksItem"] additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - rule_type: str = self.rule_type time_zone: str = self.time_zone diff --git a/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_5_time_blocks_item.py b/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_5_time_blocks_item.py index 7f77f267..25997d60 100644 --- a/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_5_time_blocks_item.py +++ b/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_5_time_blocks_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,30 +13,30 @@ class NewEscalationPolicyPathDataAttributesRulesItemType5TimeBlocksItem: """ Attributes: - monday (bool | Unset): Default: False. - tuesday (bool | Unset): Default: False. - wednesday (bool | Unset): Default: False. - thursday (bool | Unset): Default: False. - friday (bool | Unset): Default: False. - saturday (bool | Unset): Default: False. - sunday (bool | Unset): Default: False. - start_time (str | Unset): Formatted as HH:MM - end_time (str | Unset): Formatted as HH:MM - all_day (bool | Unset): Default: False. - position (int | None | Unset): + monday (Union[Unset, bool]): Default: False. + tuesday (Union[Unset, bool]): Default: False. + wednesday (Union[Unset, bool]): Default: False. + thursday (Union[Unset, bool]): Default: False. + friday (Union[Unset, bool]): Default: False. + saturday (Union[Unset, bool]): Default: False. + sunday (Union[Unset, bool]): Default: False. + start_time (Union[Unset, str]): Formatted as HH:MM + end_time (Union[Unset, str]): Formatted as HH:MM + all_day (Union[Unset, bool]): Default: False. + position (Union[None, Unset, int]): """ - monday: bool | Unset = False - tuesday: bool | Unset = False - wednesday: bool | Unset = False - thursday: bool | Unset = False - friday: bool | Unset = False - saturday: bool | Unset = False - sunday: bool | Unset = False - start_time: str | Unset = UNSET - end_time: str | Unset = UNSET - all_day: bool | Unset = False - position: int | None | Unset = UNSET + monday: Union[Unset, bool] = False + tuesday: Union[Unset, bool] = False + wednesday: Union[Unset, bool] = False + thursday: Union[Unset, bool] = False + friday: Union[Unset, bool] = False + saturday: Union[Unset, bool] = False + sunday: Union[Unset, bool] = False + start_time: Union[Unset, str] = UNSET + end_time: Union[Unset, str] = UNSET + all_day: Union[Unset, bool] = False + position: Union[None, Unset, int] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -62,7 +60,7 @@ def to_dict(self) -> dict[str, Any]: all_day = self.all_day - position: int | None | Unset + position: Union[None, Unset, int] if isinstance(self.position, Unset): position = UNSET else: @@ -119,12 +117,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: all_day = d.pop("all_day", UNSET) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> Union[None, Unset, int]: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(Union[None, Unset, int], data) position = _parse_position(d.pop("position", UNSET)) diff --git a/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_6.py b/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_6.py index f96b8c64..f3774fac 100644 --- a/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_6.py +++ b/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_6.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast diff --git a/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_7.py b/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_7.py index 34200850..6aecf847 100644 --- a/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_7.py +++ b/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_7.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/new_escalation_policy_path_data_attributes_time_restrictions_item.py b/rootly_sdk/models/new_escalation_policy_path_data_attributes_time_restrictions_item.py index 6b6d14be..6f80bec8 100644 --- a/rootly_sdk/models/new_escalation_policy_path_data_attributes_time_restrictions_item.py +++ b/rootly_sdk/models/new_escalation_policy_path_data_attributes_time_restrictions_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/new_form_field.py b/rootly_sdk/models/new_form_field.py index b551a72f..478e6ca9 100644 --- a/rootly_sdk/models/new_form_field.py +++ b/rootly_sdk/models/new_form_field.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewFormField: data (NewFormFieldData): """ - data: NewFormFieldData + data: "NewFormFieldData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_form_field_data.py b/rootly_sdk/models/new_form_field_data.py index ed8569e0..029c332a 100644 --- a/rootly_sdk/models/new_form_field_data.py +++ b/rootly_sdk/models/new_form_field_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class NewFormFieldData: """ type_: NewFormFieldDataType - attributes: NewFormFieldDataAttributes + attributes: "NewFormFieldDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_form_field_data_attributes.py b/rootly_sdk/models/new_form_field_data_attributes.py index b33f425d..38f6c56b 100644 --- a/rootly_sdk/models/new_form_field_data_attributes.py +++ b/rootly_sdk/models/new_form_field_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -28,62 +26,71 @@ class NewFormFieldDataAttributes: Attributes: kind (NewFormFieldDataAttributesKind): The kind of the form field name (str): The name of the form field - input_kind (NewFormFieldDataAttributesInputKind | Unset): The input kind of the form field - value_kind (NewFormFieldDataAttributesValueKind | Unset): The value kind of the form field - value_kind_catalog_id (None | str | Unset): The ID of the catalog used when value_kind is `catalog_entity` - description (None | str | Unset): The description of the form field - shown (list[str] | Unset): - required (list[str] | Unset): - show_on_incident_details (bool | Unset): Whether the form field is shown on the incident details panel - enabled (bool | Unset): Whether the form field is enabled - default_values (list[str] | Unset): - auto_set_by_catalog_property_id (None | str | Unset): Catalog property ID to auto-set this form field. Only + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + input_kind (Union[Unset, NewFormFieldDataAttributesInputKind]): The input kind of the form field + value_kind (Union[Unset, NewFormFieldDataAttributesValueKind]): The value kind of the form field + value_kind_catalog_id (Union[None, Unset, str]): The ID of the catalog used when value_kind is `catalog_entity` + description (Union[None, Unset, str]): The description of the form field + shown (Union[Unset, list[str]]): + required (Union[Unset, list[str]]): + show_on_incident_details (Union[Unset, bool]): Whether the form field is shown on the incident details panel + enabled (Union[Unset, bool]): Whether the form field is enabled + default_values (Union[Unset, list[str]]): + auto_set_by_catalog_property_id (Union[None, Unset, str]): Catalog property ID to auto-set this form field. Only reference-kind catalog properties are supported. """ kind: NewFormFieldDataAttributesKind name: str - input_kind: NewFormFieldDataAttributesInputKind | Unset = UNSET - value_kind: NewFormFieldDataAttributesValueKind | Unset = UNSET - value_kind_catalog_id: None | str | Unset = UNSET - description: None | str | Unset = UNSET - shown: list[str] | Unset = UNSET - required: list[str] | Unset = UNSET - show_on_incident_details: bool | Unset = UNSET - enabled: bool | Unset = UNSET - default_values: list[str] | Unset = UNSET - auto_set_by_catalog_property_id: None | str | Unset = UNSET + slug: Union[None, Unset, str] = UNSET + input_kind: Union[Unset, NewFormFieldDataAttributesInputKind] = UNSET + value_kind: Union[Unset, NewFormFieldDataAttributesValueKind] = UNSET + value_kind_catalog_id: Union[None, Unset, str] = UNSET + description: Union[None, Unset, str] = UNSET + shown: Union[Unset, list[str]] = UNSET + required: Union[Unset, list[str]] = UNSET + show_on_incident_details: Union[Unset, bool] = UNSET + enabled: Union[Unset, bool] = UNSET + default_values: Union[Unset, list[str]] = UNSET + auto_set_by_catalog_property_id: Union[None, Unset, str] = UNSET def to_dict(self) -> dict[str, Any]: kind: str = self.kind name = self.name - input_kind: str | Unset = UNSET + slug: Union[None, Unset, str] + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug + + input_kind: Union[Unset, str] = UNSET if not isinstance(self.input_kind, Unset): input_kind = self.input_kind - value_kind: str | Unset = UNSET + value_kind: Union[Unset, str] = UNSET if not isinstance(self.value_kind, Unset): value_kind = self.value_kind - value_kind_catalog_id: None | str | Unset + value_kind_catalog_id: Union[None, Unset, str] if isinstance(self.value_kind_catalog_id, Unset): value_kind_catalog_id = UNSET else: value_kind_catalog_id = self.value_kind_catalog_id - description: None | str | Unset + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: description = self.description - shown: list[str] | Unset = UNSET + shown: Union[Unset, list[str]] = UNSET if not isinstance(self.shown, Unset): shown = self.shown - required: list[str] | Unset = UNSET + required: Union[Unset, list[str]] = UNSET if not isinstance(self.required, Unset): required = self.required @@ -91,11 +98,11 @@ def to_dict(self) -> dict[str, Any]: enabled = self.enabled - default_values: list[str] | Unset = UNSET + default_values: Union[Unset, list[str]] = UNSET if not isinstance(self.default_values, Unset): default_values = self.default_values - auto_set_by_catalog_property_id: None | str | Unset + auto_set_by_catalog_property_id: Union[None, Unset, str] if isinstance(self.auto_set_by_catalog_property_id, Unset): auto_set_by_catalog_property_id = UNSET else: @@ -109,6 +116,8 @@ def to_dict(self) -> dict[str, Any]: "name": name, } ) + if slug is not UNSET: + field_dict["slug"] = slug if input_kind is not UNSET: field_dict["input_kind"] = input_kind if value_kind is not UNSET: @@ -139,35 +148,44 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name = d.pop("name") + def _parse_slug(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + slug = _parse_slug(d.pop("slug", UNSET)) + _input_kind = d.pop("input_kind", UNSET) - input_kind: NewFormFieldDataAttributesInputKind | Unset + input_kind: Union[Unset, NewFormFieldDataAttributesInputKind] if isinstance(_input_kind, Unset): input_kind = UNSET else: input_kind = check_new_form_field_data_attributes_input_kind(_input_kind) _value_kind = d.pop("value_kind", UNSET) - value_kind: NewFormFieldDataAttributesValueKind | Unset + value_kind: Union[Unset, NewFormFieldDataAttributesValueKind] if isinstance(_value_kind, Unset): value_kind = UNSET else: value_kind = check_new_form_field_data_attributes_value_kind(_value_kind) - def _parse_value_kind_catalog_id(data: object) -> None | str | Unset: + def _parse_value_kind_catalog_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) value_kind_catalog_id = _parse_value_kind_catalog_id(d.pop("value_kind_catalog_id", UNSET)) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) @@ -181,12 +199,12 @@ def _parse_description(data: object) -> None | str | Unset: default_values = cast(list[str], d.pop("default_values", UNSET)) - def _parse_auto_set_by_catalog_property_id(data: object) -> None | str | Unset: + def _parse_auto_set_by_catalog_property_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) auto_set_by_catalog_property_id = _parse_auto_set_by_catalog_property_id( d.pop("auto_set_by_catalog_property_id", UNSET) @@ -195,6 +213,7 @@ def _parse_auto_set_by_catalog_property_id(data: object) -> None | str | Unset: new_form_field_data_attributes = cls( kind=kind, name=name, + slug=slug, input_kind=input_kind, value_kind=value_kind, value_kind_catalog_id=value_kind_catalog_id, diff --git a/rootly_sdk/models/new_form_field_option.py b/rootly_sdk/models/new_form_field_option.py index 250f489a..79703c57 100644 --- a/rootly_sdk/models/new_form_field_option.py +++ b/rootly_sdk/models/new_form_field_option.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewFormFieldOption: data (NewFormFieldOptionData): """ - data: NewFormFieldOptionData + data: "NewFormFieldOptionData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_form_field_option_data.py b/rootly_sdk/models/new_form_field_option_data.py index 0cfabe8d..2f424967 100644 --- a/rootly_sdk/models/new_form_field_option_data.py +++ b/rootly_sdk/models/new_form_field_option_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class NewFormFieldOptionData: """ type_: NewFormFieldOptionDataType - attributes: NewFormFieldOptionDataAttributes + attributes: "NewFormFieldOptionDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_form_field_option_data_attributes.py b/rootly_sdk/models/new_form_field_option_data_attributes.py index b9f918b7..c250076d 100644 --- a/rootly_sdk/models/new_form_field_option_data_attributes.py +++ b/rootly_sdk/models/new_form_field_option_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define @@ -16,16 +14,16 @@ class NewFormFieldOptionDataAttributes: Attributes: form_field_id (str): The ID of the form field value (str): The value of the form field option - color (str | Unset): The hex color of the form field option - default (bool | Unset): - position (int | Unset): The position of the form field option + color (Union[Unset, str]): The hex color of the form field option + default (Union[Unset, bool]): + position (Union[Unset, int]): The position of the form field option """ form_field_id: str value: str - color: str | Unset = UNSET - default: bool | Unset = UNSET - position: int | Unset = UNSET + color: Union[Unset, str] = UNSET + default: Union[Unset, bool] = UNSET + position: Union[Unset, int] = UNSET def to_dict(self) -> dict[str, Any]: form_field_id = self.form_field_id diff --git a/rootly_sdk/models/new_form_field_placement.py b/rootly_sdk/models/new_form_field_placement.py index 0319e261..3f1a430c 100644 --- a/rootly_sdk/models/new_form_field_placement.py +++ b/rootly_sdk/models/new_form_field_placement.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewFormFieldPlacement: data (NewFormFieldPlacementData): """ - data: NewFormFieldPlacementData + data: "NewFormFieldPlacementData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_form_field_placement_condition.py b/rootly_sdk/models/new_form_field_placement_condition.py index 622bd443..e70a15e2 100644 --- a/rootly_sdk/models/new_form_field_placement_condition.py +++ b/rootly_sdk/models/new_form_field_placement_condition.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewFormFieldPlacementCondition: data (NewFormFieldPlacementConditionData): """ - data: NewFormFieldPlacementConditionData + data: "NewFormFieldPlacementConditionData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_form_field_placement_condition_data.py b/rootly_sdk/models/new_form_field_placement_condition_data.py index 5e26d9a4..eb94f22a 100644 --- a/rootly_sdk/models/new_form_field_placement_condition_data.py +++ b/rootly_sdk/models/new_form_field_placement_condition_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class NewFormFieldPlacementConditionData: """ type_: NewFormFieldPlacementConditionDataType - attributes: NewFormFieldPlacementConditionDataAttributes + attributes: "NewFormFieldPlacementConditionDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_form_field_placement_condition_data_attributes.py b/rootly_sdk/models/new_form_field_placement_condition_data_attributes.py index eef1987c..cf410bed 100644 --- a/rootly_sdk/models/new_form_field_placement_condition_data_attributes.py +++ b/rootly_sdk/models/new_form_field_placement_condition_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -28,14 +26,14 @@ class NewFormFieldPlacementConditionDataAttributes: form_field_id (str): The condition field. comparison (NewFormFieldPlacementConditionDataAttributesComparison): The condition comparison. values (list[str]): The values for comparison. - position (int | Unset): The condition position. + position (Union[Unset, int]): The condition position. """ conditioned: NewFormFieldPlacementConditionDataAttributesConditioned form_field_id: str comparison: NewFormFieldPlacementConditionDataAttributesComparison values: list[str] - position: int | Unset = UNSET + position: Union[Unset, int] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/new_form_field_placement_data.py b/rootly_sdk/models/new_form_field_placement_data.py index 878cd08d..44210baf 100644 --- a/rootly_sdk/models/new_form_field_placement_data.py +++ b/rootly_sdk/models/new_form_field_placement_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class NewFormFieldPlacementData: """ type_: NewFormFieldPlacementDataType - attributes: NewFormFieldPlacementDataAttributes + attributes: "NewFormFieldPlacementDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_form_field_placement_data_attributes.py b/rootly_sdk/models/new_form_field_placement_data_attributes.py index a424cde9..63631e1e 100644 --- a/rootly_sdk/models/new_form_field_placement_data_attributes.py +++ b/rootly_sdk/models/new_form_field_placement_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,24 +21,25 @@ class NewFormFieldPlacementDataAttributes: """ Attributes: - form_set_id (str): The form set this field is placed in. + form_set_id (str): The form set this field is placed in. The form set must have the same `resource_type` as the + form field, otherwise the request is rejected with 422. form (str): The form this field is placed on. - position (int | Unset): The position of the field placement. - required (bool | Unset): Whether the field is unconditionally required on this form. - required_operator (NewFormFieldPlacementDataAttributesRequiredOperator | Unset): Logical operator when + position (Union[Unset, int]): The position of the field placement. + required (Union[Unset, bool]): Whether the field is unconditionally required on this form. + required_operator (Union[Unset, NewFormFieldPlacementDataAttributesRequiredOperator]): Logical operator when evaluating multiple form_field_placement_conditions with conditioned=required - placement_operator (NewFormFieldPlacementDataAttributesPlacementOperator | Unset): Logical operator when + placement_operator (Union[Unset, NewFormFieldPlacementDataAttributesPlacementOperator]): Logical operator when evaluating multiple form_field_placement_conditions with conditioned=placement - non_editable (bool | Unset): Whether the field is read-only and cannot be edited by users. + non_editable (Union[Unset, bool]): Whether the field is read-only and cannot be edited by users. """ form_set_id: str form: str - position: int | Unset = UNSET - required: bool | Unset = UNSET - required_operator: NewFormFieldPlacementDataAttributesRequiredOperator | Unset = UNSET - placement_operator: NewFormFieldPlacementDataAttributesPlacementOperator | Unset = UNSET - non_editable: bool | Unset = UNSET + position: Union[Unset, int] = UNSET + required: Union[Unset, bool] = UNSET + required_operator: Union[Unset, NewFormFieldPlacementDataAttributesRequiredOperator] = UNSET + placement_operator: Union[Unset, NewFormFieldPlacementDataAttributesPlacementOperator] = UNSET + non_editable: Union[Unset, bool] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -52,11 +51,11 @@ def to_dict(self) -> dict[str, Any]: required = self.required - required_operator: str | Unset = UNSET + required_operator: Union[Unset, str] = UNSET if not isinstance(self.required_operator, Unset): required_operator = self.required_operator - placement_operator: str | Unset = UNSET + placement_operator: Union[Unset, str] = UNSET if not isinstance(self.placement_operator, Unset): placement_operator = self.placement_operator @@ -95,14 +94,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: required = d.pop("required", UNSET) _required_operator = d.pop("required_operator", UNSET) - required_operator: NewFormFieldPlacementDataAttributesRequiredOperator | Unset + required_operator: Union[Unset, NewFormFieldPlacementDataAttributesRequiredOperator] if isinstance(_required_operator, Unset): required_operator = UNSET else: required_operator = check_new_form_field_placement_data_attributes_required_operator(_required_operator) _placement_operator = d.pop("placement_operator", UNSET) - placement_operator: NewFormFieldPlacementDataAttributesPlacementOperator | Unset + placement_operator: Union[Unset, NewFormFieldPlacementDataAttributesPlacementOperator] if isinstance(_placement_operator, Unset): placement_operator = UNSET else: diff --git a/rootly_sdk/models/new_form_field_position.py b/rootly_sdk/models/new_form_field_position.py index 23be155c..c876c3a3 100644 --- a/rootly_sdk/models/new_form_field_position.py +++ b/rootly_sdk/models/new_form_field_position.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewFormFieldPosition: data (NewFormFieldPositionData): """ - data: NewFormFieldPositionData + data: "NewFormFieldPositionData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_form_field_position_data.py b/rootly_sdk/models/new_form_field_position_data.py index 29c52e99..24542508 100644 --- a/rootly_sdk/models/new_form_field_position_data.py +++ b/rootly_sdk/models/new_form_field_position_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class NewFormFieldPositionData: """ type_: NewFormFieldPositionDataType - attributes: NewFormFieldPositionDataAttributes + attributes: "NewFormFieldPositionDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_form_field_position_data_attributes.py b/rootly_sdk/models/new_form_field_position_data_attributes.py index 8bbc0e05..d4037f7f 100644 --- a/rootly_sdk/models/new_form_field_position_data_attributes.py +++ b/rootly_sdk/models/new_form_field_position_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/new_form_field_position_data_attributes_form.py b/rootly_sdk/models/new_form_field_position_data_attributes_form.py index 7903b4c1..5b74b39c 100644 --- a/rootly_sdk/models/new_form_field_position_data_attributes_form.py +++ b/rootly_sdk/models/new_form_field_position_data_attributes_form.py @@ -8,6 +8,7 @@ "slack_incident_resolution_form", "slack_new_incident_form", "slack_scheduled_incident_form", + "slack_task_form", "slack_update_incident_form", "slack_update_incident_status_form", "slack_update_scheduled_incident_form", @@ -18,6 +19,7 @@ "web_incident_resolution_form", "web_new_incident_form", "web_scheduled_incident_form", + "web_task_form", "web_update_incident_form", "web_update_scheduled_incident_form", ] @@ -30,6 +32,7 @@ "slack_incident_resolution_form", "slack_new_incident_form", "slack_scheduled_incident_form", + "slack_task_form", "slack_update_incident_form", "slack_update_incident_status_form", "slack_update_scheduled_incident_form", @@ -40,6 +43,7 @@ "web_incident_resolution_form", "web_new_incident_form", "web_scheduled_incident_form", + "web_task_form", "web_update_incident_form", "web_update_scheduled_incident_form", } diff --git a/rootly_sdk/models/new_form_set.py b/rootly_sdk/models/new_form_set.py index e8de4c16..af5fe62b 100644 --- a/rootly_sdk/models/new_form_set.py +++ b/rootly_sdk/models/new_form_set.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewFormSet: data (NewFormSetData): """ - data: NewFormSetData + data: "NewFormSetData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_form_set_condition.py b/rootly_sdk/models/new_form_set_condition.py index 56277d51..1ca4d3cd 100644 --- a/rootly_sdk/models/new_form_set_condition.py +++ b/rootly_sdk/models/new_form_set_condition.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewFormSetCondition: data (NewFormSetConditionData): """ - data: NewFormSetConditionData + data: "NewFormSetConditionData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_form_set_condition_data.py b/rootly_sdk/models/new_form_set_condition_data.py index 7ddcc521..f5e62dc1 100644 --- a/rootly_sdk/models/new_form_set_condition_data.py +++ b/rootly_sdk/models/new_form_set_condition_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class NewFormSetConditionData: """ type_: NewFormSetConditionDataType - attributes: NewFormSetConditionDataAttributes + attributes: "NewFormSetConditionDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_form_set_condition_data_attributes.py b/rootly_sdk/models/new_form_set_condition_data_attributes.py index 072db657..50e8eb01 100644 --- a/rootly_sdk/models/new_form_set_condition_data_attributes.py +++ b/rootly_sdk/models/new_form_set_condition_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast diff --git a/rootly_sdk/models/new_form_set_data.py b/rootly_sdk/models/new_form_set_data.py index e6242641..5dd21340 100644 --- a/rootly_sdk/models/new_form_set_data.py +++ b/rootly_sdk/models/new_form_set_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class NewFormSetData: """ type_: NewFormSetDataType - attributes: NewFormSetDataAttributes + attributes: "NewFormSetDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_form_set_data_attributes.py b/rootly_sdk/models/new_form_set_data_attributes.py index 8d930d67..82df17ba 100644 --- a/rootly_sdk/models/new_form_set_data_attributes.py +++ b/rootly_sdk/models/new_form_set_data_attributes.py @@ -1,10 +1,10 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define +from ..types import UNSET, Unset + T = TypeVar("T", bound="NewFormSetDataAttributes") @@ -19,17 +19,27 @@ class NewFormSetDataAttributes: `web_scheduled_incident_form`, `web_update_scheduled_incident_form`, `slack_new_incident_form`, `slack_update_incident_form`, `slack_update_incident_status_form`, `slack_incident_mitigation_form`, `slack_incident_resolution_form`, `slack_incident_cancellation_form`, `slack_scheduled_incident_form`, - `slack_update_scheduled_incident_form`, `google_chat_new_incident_form`, `google_chat_update_incident_form` + `slack_update_scheduled_incident_form`, `google_chat_new_incident_form`, `google_chat_update_incident_form`, + `microsoft_teams_new_incident_form` + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. """ name: str forms: list[str] + slug: Union[None, Unset, str] = UNSET def to_dict(self) -> dict[str, Any]: name = self.name forms = self.forms + slug: Union[None, Unset, str] + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug + field_dict: dict[str, Any] = {} field_dict.update( @@ -38,6 +48,8 @@ def to_dict(self) -> dict[str, Any]: "forms": forms, } ) + if slug is not UNSET: + field_dict["slug"] = slug return field_dict @@ -48,9 +60,19 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: forms = cast(list[str], d.pop("forms")) + def _parse_slug(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + slug = _parse_slug(d.pop("slug", UNSET)) + new_form_set_data_attributes = cls( name=name, forms=forms, + slug=slug, ) return new_form_set_data_attributes diff --git a/rootly_sdk/models/new_functionality.py b/rootly_sdk/models/new_functionality.py index 1338aa78..ab4c8a72 100644 --- a/rootly_sdk/models/new_functionality.py +++ b/rootly_sdk/models/new_functionality.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewFunctionality: data (NewFunctionalityData): """ - data: NewFunctionalityData + data: "NewFunctionalityData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_functionality_data.py b/rootly_sdk/models/new_functionality_data.py index dd92c8a4..97c55928 100644 --- a/rootly_sdk/models/new_functionality_data.py +++ b/rootly_sdk/models/new_functionality_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class NewFunctionalityData: """ type_: NewFunctionalityDataType - attributes: NewFunctionalityDataAttributes + attributes: "NewFunctionalityDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_functionality_data_attributes.py b/rootly_sdk/models/new_functionality_data_attributes.py index 8459211c..be1a2755 100644 --- a/rootly_sdk/models/new_functionality_data_attributes.py +++ b/rootly_sdk/models/new_functionality_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -29,76 +27,84 @@ class NewFunctionalityDataAttributes: """ Attributes: name (str): The name of the functionality - description (None | str | Unset): The description of the functionality - public_description (None | str | Unset): The public description of the functionality - notify_emails (list[str] | None | Unset): Emails to attach to the functionality - color (None | str | Unset): The hex color of the functionality - position (int | None | Unset): Position of the functionality - backstage_id (None | str | Unset): The Backstage entity id associated to this functionality. eg: + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + description (Union[None, Unset, str]): The description of the functionality + public_description (Union[None, Unset, str]): The status page description of the functionality + notify_emails (Union[None, Unset, list[str]]): Emails to attach to the functionality + color (Union[None, Unset, str]): The hex color of the functionality + position (Union[None, Unset, int]): Position of the functionality + backstage_id (Union[None, Unset, str]): The Backstage entity id associated to this functionality. eg: :namespace/:kind/:entity_name - external_id (None | str | Unset): The external id associated to this functionality - pagerduty_id (None | str | Unset): The PagerDuty service id associated to this functionality - opsgenie_id (None | str | Unset): The Opsgenie service id associated to this functionality - opsgenie_team_id (None | str | Unset): The Opsgenie team id associated to this functionality - cortex_id (None | str | Unset): The Cortex group id associated to this functionality - service_now_ci_sys_id (None | str | Unset): The Service Now CI sys id associated to this functionality - show_uptime (bool | None | Unset): Show uptime - show_uptime_last_days (NewFunctionalityDataAttributesShowUptimeLastDays | Unset): Show uptime over x days + external_id (Union[None, Unset, str]): The external id associated to this functionality + pagerduty_id (Union[None, Unset, str]): The PagerDuty service id associated to this functionality + opsgenie_id (Union[None, Unset, str]): The Opsgenie service id associated to this functionality + opsgenie_team_id (Union[None, Unset, str]): The Opsgenie team id associated to this functionality + cortex_id (Union[None, Unset, str]): The Cortex group id associated to this functionality + service_now_ci_sys_id (Union[None, Unset, str]): The Service Now CI sys id associated to this functionality + show_uptime (Union[None, Unset, bool]): Show uptime + show_uptime_last_days (Union[Unset, NewFunctionalityDataAttributesShowUptimeLastDays]): Show uptime over x days Default: 60. - environment_ids (list[str] | None | Unset): Environments associated with this functionality - service_ids (list[str] | None | Unset): Services associated with this functionality - owner_group_ids (list[str] | None | Unset): Owner Teams associated with this functionality - owner_user_ids (list[int] | None | Unset): Owner Users associated with this functionality - escalation_policy_id (None | str | Unset): The escalation policy id of the functionality - slack_channels (list[NewFunctionalityDataAttributesSlackChannelsType0Item] | None | Unset): Slack Channels - associated with this functionality - slack_aliases (list[NewFunctionalityDataAttributesSlackAliasesType0Item] | None | Unset): Slack Aliases + environment_ids (Union[None, Unset, list[str]]): Environments associated with this functionality + service_ids (Union[None, Unset, list[str]]): Services associated with this functionality + owner_group_ids (Union[None, Unset, list[str]]): Owner Teams associated with this functionality + owner_user_ids (Union[None, Unset, list[int]]): Owner Users associated with this functionality + escalation_policy_id (Union[None, Unset, str]): The escalation policy id of the functionality + slack_channels (Union[None, Unset, list['NewFunctionalityDataAttributesSlackChannelsType0Item']]): Slack + Channels associated with this functionality + slack_aliases (Union[None, Unset, list['NewFunctionalityDataAttributesSlackAliasesType0Item']]): Slack Aliases associated with this functionality - properties (list[NewFunctionalityDataAttributesPropertiesItem] | Unset): Array of property values for this - functionality. + properties (Union[Unset, list['NewFunctionalityDataAttributesPropertiesItem']]): Array of property values for + this functionality. """ name: str - description: None | str | Unset = UNSET - public_description: None | str | Unset = UNSET - notify_emails: list[str] | None | Unset = UNSET - color: None | str | Unset = UNSET - position: int | None | Unset = UNSET - backstage_id: None | str | Unset = UNSET - external_id: None | str | Unset = UNSET - pagerduty_id: None | str | Unset = UNSET - opsgenie_id: None | str | Unset = UNSET - opsgenie_team_id: None | str | Unset = UNSET - cortex_id: None | str | Unset = UNSET - service_now_ci_sys_id: None | str | Unset = UNSET - show_uptime: bool | None | Unset = UNSET - show_uptime_last_days: NewFunctionalityDataAttributesShowUptimeLastDays | Unset = 60 - environment_ids: list[str] | None | Unset = UNSET - service_ids: list[str] | None | Unset = UNSET - owner_group_ids: list[str] | None | Unset = UNSET - owner_user_ids: list[int] | None | Unset = UNSET - escalation_policy_id: None | str | Unset = UNSET - slack_channels: list[NewFunctionalityDataAttributesSlackChannelsType0Item] | None | Unset = UNSET - slack_aliases: list[NewFunctionalityDataAttributesSlackAliasesType0Item] | None | Unset = UNSET - properties: list[NewFunctionalityDataAttributesPropertiesItem] | Unset = UNSET + slug: Union[None, Unset, str] = UNSET + description: Union[None, Unset, str] = UNSET + public_description: Union[None, Unset, str] = UNSET + notify_emails: Union[None, Unset, list[str]] = UNSET + color: Union[None, Unset, str] = UNSET + position: Union[None, Unset, int] = UNSET + backstage_id: Union[None, Unset, str] = UNSET + external_id: Union[None, Unset, str] = UNSET + pagerduty_id: Union[None, Unset, str] = UNSET + opsgenie_id: Union[None, Unset, str] = UNSET + opsgenie_team_id: Union[None, Unset, str] = UNSET + cortex_id: Union[None, Unset, str] = UNSET + service_now_ci_sys_id: Union[None, Unset, str] = UNSET + show_uptime: Union[None, Unset, bool] = UNSET + show_uptime_last_days: Union[Unset, NewFunctionalityDataAttributesShowUptimeLastDays] = 60 + environment_ids: Union[None, Unset, list[str]] = UNSET + service_ids: Union[None, Unset, list[str]] = UNSET + owner_group_ids: Union[None, Unset, list[str]] = UNSET + owner_user_ids: Union[None, Unset, list[int]] = UNSET + escalation_policy_id: Union[None, Unset, str] = UNSET + slack_channels: Union[None, Unset, list["NewFunctionalityDataAttributesSlackChannelsType0Item"]] = UNSET + slack_aliases: Union[None, Unset, list["NewFunctionalityDataAttributesSlackAliasesType0Item"]] = UNSET + properties: Union[Unset, list["NewFunctionalityDataAttributesPropertiesItem"]] = UNSET def to_dict(self) -> dict[str, Any]: - name = self.name - description: None | str | Unset + slug: Union[None, Unset, str] + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug + + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: description = self.description - public_description: None | str | Unset + public_description: Union[None, Unset, str] if isinstance(self.public_description, Unset): public_description = UNSET else: public_description = self.public_description - notify_emails: list[str] | None | Unset + notify_emails: Union[None, Unset, list[str]] if isinstance(self.notify_emails, Unset): notify_emails = UNSET elif isinstance(self.notify_emails, list): @@ -107,71 +113,71 @@ def to_dict(self) -> dict[str, Any]: else: notify_emails = self.notify_emails - color: None | str | Unset + color: Union[None, Unset, str] if isinstance(self.color, Unset): color = UNSET else: color = self.color - position: int | None | Unset + position: Union[None, Unset, int] if isinstance(self.position, Unset): position = UNSET else: position = self.position - backstage_id: None | str | Unset + backstage_id: Union[None, Unset, str] if isinstance(self.backstage_id, Unset): backstage_id = UNSET else: backstage_id = self.backstage_id - external_id: None | str | Unset + external_id: Union[None, Unset, str] if isinstance(self.external_id, Unset): external_id = UNSET else: external_id = self.external_id - pagerduty_id: None | str | Unset + pagerduty_id: Union[None, Unset, str] if isinstance(self.pagerduty_id, Unset): pagerduty_id = UNSET else: pagerduty_id = self.pagerduty_id - opsgenie_id: None | str | Unset + opsgenie_id: Union[None, Unset, str] if isinstance(self.opsgenie_id, Unset): opsgenie_id = UNSET else: opsgenie_id = self.opsgenie_id - opsgenie_team_id: None | str | Unset + opsgenie_team_id: Union[None, Unset, str] if isinstance(self.opsgenie_team_id, Unset): opsgenie_team_id = UNSET else: opsgenie_team_id = self.opsgenie_team_id - cortex_id: None | str | Unset + cortex_id: Union[None, Unset, str] if isinstance(self.cortex_id, Unset): cortex_id = UNSET else: cortex_id = self.cortex_id - service_now_ci_sys_id: None | str | Unset + service_now_ci_sys_id: Union[None, Unset, str] if isinstance(self.service_now_ci_sys_id, Unset): service_now_ci_sys_id = UNSET else: service_now_ci_sys_id = self.service_now_ci_sys_id - show_uptime: bool | None | Unset + show_uptime: Union[None, Unset, bool] if isinstance(self.show_uptime, Unset): show_uptime = UNSET else: show_uptime = self.show_uptime - show_uptime_last_days: int | Unset = UNSET + show_uptime_last_days: Union[Unset, int] = UNSET if not isinstance(self.show_uptime_last_days, Unset): show_uptime_last_days = self.show_uptime_last_days - environment_ids: list[str] | None | Unset + environment_ids: Union[None, Unset, list[str]] if isinstance(self.environment_ids, Unset): environment_ids = UNSET elif isinstance(self.environment_ids, list): @@ -180,7 +186,7 @@ def to_dict(self) -> dict[str, Any]: else: environment_ids = self.environment_ids - service_ids: list[str] | None | Unset + service_ids: Union[None, Unset, list[str]] if isinstance(self.service_ids, Unset): service_ids = UNSET elif isinstance(self.service_ids, list): @@ -189,7 +195,7 @@ def to_dict(self) -> dict[str, Any]: else: service_ids = self.service_ids - owner_group_ids: list[str] | None | Unset + owner_group_ids: Union[None, Unset, list[str]] if isinstance(self.owner_group_ids, Unset): owner_group_ids = UNSET elif isinstance(self.owner_group_ids, list): @@ -198,7 +204,7 @@ def to_dict(self) -> dict[str, Any]: else: owner_group_ids = self.owner_group_ids - owner_user_ids: list[int] | None | Unset + owner_user_ids: Union[None, Unset, list[int]] if isinstance(self.owner_user_ids, Unset): owner_user_ids = UNSET elif isinstance(self.owner_user_ids, list): @@ -207,13 +213,13 @@ def to_dict(self) -> dict[str, Any]: else: owner_user_ids = self.owner_user_ids - escalation_policy_id: None | str | Unset + escalation_policy_id: Union[None, Unset, str] if isinstance(self.escalation_policy_id, Unset): escalation_policy_id = UNSET else: escalation_policy_id = self.escalation_policy_id - slack_channels: list[dict[str, Any]] | None | Unset + slack_channels: Union[None, Unset, list[dict[str, Any]]] if isinstance(self.slack_channels, Unset): slack_channels = UNSET elif isinstance(self.slack_channels, list): @@ -225,7 +231,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_channels = self.slack_channels - slack_aliases: list[dict[str, Any]] | None | Unset + slack_aliases: Union[None, Unset, list[dict[str, Any]]] if isinstance(self.slack_aliases, Unset): slack_aliases = UNSET elif isinstance(self.slack_aliases, list): @@ -237,7 +243,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_aliases = self.slack_aliases - properties: list[dict[str, Any]] | Unset = UNSET + properties: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.properties, Unset): properties = [] for properties_item_data in self.properties: @@ -251,6 +257,8 @@ def to_dict(self) -> dict[str, Any]: "name": name, } ) + if slug is not UNSET: + field_dict["slug"] = slug if description is not UNSET: field_dict["description"] = description if public_description is not UNSET: @@ -313,25 +321,34 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name") - def _parse_description(data: object) -> None | str | Unset: + def _parse_slug(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) + + slug = _parse_slug(d.pop("slug", UNSET)) + + def _parse_description(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) - def _parse_public_description(data: object) -> None | str | Unset: + def _parse_public_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) public_description = _parse_public_description(d.pop("public_description", UNSET)) - def _parse_notify_emails(data: object) -> list[str] | None | Unset: + def _parse_notify_emails(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -342,104 +359,104 @@ def _parse_notify_emails(data: object) -> list[str] | None | Unset: notify_emails_type_0 = cast(list[str], data) return notify_emails_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) notify_emails = _parse_notify_emails(d.pop("notify_emails", UNSET)) - def _parse_color(data: object) -> None | str | Unset: + def _parse_color(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) color = _parse_color(d.pop("color", UNSET)) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> Union[None, Unset, int]: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(Union[None, Unset, int], data) position = _parse_position(d.pop("position", UNSET)) - def _parse_backstage_id(data: object) -> None | str | Unset: + def _parse_backstage_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) backstage_id = _parse_backstage_id(d.pop("backstage_id", UNSET)) - def _parse_external_id(data: object) -> None | str | Unset: + def _parse_external_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) external_id = _parse_external_id(d.pop("external_id", UNSET)) - def _parse_pagerduty_id(data: object) -> None | str | Unset: + def _parse_pagerduty_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) pagerduty_id = _parse_pagerduty_id(d.pop("pagerduty_id", UNSET)) - def _parse_opsgenie_id(data: object) -> None | str | Unset: + def _parse_opsgenie_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) opsgenie_id = _parse_opsgenie_id(d.pop("opsgenie_id", UNSET)) - def _parse_opsgenie_team_id(data: object) -> None | str | Unset: + def _parse_opsgenie_team_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) opsgenie_team_id = _parse_opsgenie_team_id(d.pop("opsgenie_team_id", UNSET)) - def _parse_cortex_id(data: object) -> None | str | Unset: + def _parse_cortex_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) cortex_id = _parse_cortex_id(d.pop("cortex_id", UNSET)) - def _parse_service_now_ci_sys_id(data: object) -> None | str | Unset: + def _parse_service_now_ci_sys_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) service_now_ci_sys_id = _parse_service_now_ci_sys_id(d.pop("service_now_ci_sys_id", UNSET)) - def _parse_show_uptime(data: object) -> bool | None | Unset: + def _parse_show_uptime(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) show_uptime = _parse_show_uptime(d.pop("show_uptime", UNSET)) _show_uptime_last_days = d.pop("show_uptime_last_days", UNSET) - show_uptime_last_days: NewFunctionalityDataAttributesShowUptimeLastDays | Unset + show_uptime_last_days: Union[Unset, NewFunctionalityDataAttributesShowUptimeLastDays] if isinstance(_show_uptime_last_days, Unset): show_uptime_last_days = UNSET else: @@ -447,7 +464,7 @@ def _parse_show_uptime(data: object) -> bool | None | Unset: _show_uptime_last_days ) - def _parse_environment_ids(data: object) -> list[str] | None | Unset: + def _parse_environment_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -458,13 +475,13 @@ def _parse_environment_ids(data: object) -> list[str] | None | Unset: environment_ids_type_0 = cast(list[str], data) return environment_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) environment_ids = _parse_environment_ids(d.pop("environment_ids", UNSET)) - def _parse_service_ids(data: object) -> list[str] | None | Unset: + def _parse_service_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -475,13 +492,13 @@ def _parse_service_ids(data: object) -> list[str] | None | Unset: service_ids_type_0 = cast(list[str], data) return service_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) service_ids = _parse_service_ids(d.pop("service_ids", UNSET)) - def _parse_owner_group_ids(data: object) -> list[str] | None | Unset: + def _parse_owner_group_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -492,13 +509,13 @@ def _parse_owner_group_ids(data: object) -> list[str] | None | Unset: owner_group_ids_type_0 = cast(list[str], data) return owner_group_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) owner_group_ids = _parse_owner_group_ids(d.pop("owner_group_ids", UNSET)) - def _parse_owner_user_ids(data: object) -> list[int] | None | Unset: + def _parse_owner_user_ids(data: object) -> Union[None, Unset, list[int]]: if data is None: return data if isinstance(data, Unset): @@ -509,24 +526,24 @@ def _parse_owner_user_ids(data: object) -> list[int] | None | Unset: owner_user_ids_type_0 = cast(list[int], data) return owner_user_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[int] | None | Unset, data) + return cast(Union[None, Unset, list[int]], data) owner_user_ids = _parse_owner_user_ids(d.pop("owner_user_ids", UNSET)) - def _parse_escalation_policy_id(data: object) -> None | str | Unset: + def _parse_escalation_policy_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) escalation_policy_id = _parse_escalation_policy_id(d.pop("escalation_policy_id", UNSET)) def _parse_slack_channels( data: object, - ) -> list[NewFunctionalityDataAttributesSlackChannelsType0Item] | None | Unset: + ) -> Union[None, Unset, list["NewFunctionalityDataAttributesSlackChannelsType0Item"]]: if data is None: return data if isinstance(data, Unset): @@ -544,15 +561,15 @@ def _parse_slack_channels( slack_channels_type_0.append(slack_channels_type_0_item) return slack_channels_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[NewFunctionalityDataAttributesSlackChannelsType0Item] | None | Unset, data) + return cast(Union[None, Unset, list["NewFunctionalityDataAttributesSlackChannelsType0Item"]], data) slack_channels = _parse_slack_channels(d.pop("slack_channels", UNSET)) def _parse_slack_aliases( data: object, - ) -> list[NewFunctionalityDataAttributesSlackAliasesType0Item] | None | Unset: + ) -> Union[None, Unset, list["NewFunctionalityDataAttributesSlackAliasesType0Item"]]: if data is None: return data if isinstance(data, Unset): @@ -570,23 +587,22 @@ def _parse_slack_aliases( slack_aliases_type_0.append(slack_aliases_type_0_item) return slack_aliases_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[NewFunctionalityDataAttributesSlackAliasesType0Item] | None | Unset, data) + return cast(Union[None, Unset, list["NewFunctionalityDataAttributesSlackAliasesType0Item"]], data) slack_aliases = _parse_slack_aliases(d.pop("slack_aliases", UNSET)) + properties = [] _properties = d.pop("properties", UNSET) - properties: list[NewFunctionalityDataAttributesPropertiesItem] | Unset = UNSET - if _properties is not UNSET: - properties = [] - for properties_item_data in _properties: - properties_item = NewFunctionalityDataAttributesPropertiesItem.from_dict(properties_item_data) + for properties_item_data in _properties or []: + properties_item = NewFunctionalityDataAttributesPropertiesItem.from_dict(properties_item_data) - properties.append(properties_item) + properties.append(properties_item) new_functionality_data_attributes = cls( name=name, + slug=slug, description=description, public_description=public_description, notify_emails=notify_emails, diff --git a/rootly_sdk/models/new_functionality_data_attributes_properties_item.py b/rootly_sdk/models/new_functionality_data_attributes_properties_item.py index b3518fb5..a1cca45b 100644 --- a/rootly_sdk/models/new_functionality_data_attributes_properties_item.py +++ b/rootly_sdk/models/new_functionality_data_attributes_properties_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/new_functionality_data_attributes_slack_aliases_type_0_item.py b/rootly_sdk/models/new_functionality_data_attributes_slack_aliases_type_0_item.py index ca6ead65..a304c3b3 100644 --- a/rootly_sdk/models/new_functionality_data_attributes_slack_aliases_type_0_item.py +++ b/rootly_sdk/models/new_functionality_data_attributes_slack_aliases_type_0_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/new_functionality_data_attributes_slack_channels_type_0_item.py b/rootly_sdk/models/new_functionality_data_attributes_slack_channels_type_0_item.py index 2d997f77..608aa018 100644 --- a/rootly_sdk/models/new_functionality_data_attributes_slack_channels_type_0_item.py +++ b/rootly_sdk/models/new_functionality_data_attributes_slack_channels_type_0_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/new_heartbeat.py b/rootly_sdk/models/new_heartbeat.py index 81b7f3aa..efd23daf 100644 --- a/rootly_sdk/models/new_heartbeat.py +++ b/rootly_sdk/models/new_heartbeat.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewHeartbeat: data (NewHeartbeatData): """ - data: NewHeartbeatData + data: "NewHeartbeatData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_heartbeat_data.py b/rootly_sdk/models/new_heartbeat_data.py index 0cc6923b..14046489 100644 --- a/rootly_sdk/models/new_heartbeat_data.py +++ b/rootly_sdk/models/new_heartbeat_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class NewHeartbeatData: """ type_: NewHeartbeatDataType - attributes: NewHeartbeatDataAttributes + attributes: "NewHeartbeatDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_heartbeat_data_attributes.py b/rootly_sdk/models/new_heartbeat_data_attributes.py index d53146f8..ba3d7419 100644 --- a/rootly_sdk/models/new_heartbeat_data_attributes.py +++ b/rootly_sdk/models/new_heartbeat_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -29,11 +27,11 @@ class NewHeartbeatDataAttributes: notification_target_id (str): notification_target_type (NewHeartbeatDataAttributesNotificationTargetType): The type of the notification target. Please contact support if you encounter issues using `Functionality` as a target type. - description (None | str | Unset): The description of the heartbeat - alert_description (None | str | Unset): Description of alerts triggered when heartbeat expires. - alert_urgency_id (None | str | Unset): Urgency of alerts triggered when heartbeat expires. - owner_group_ids (list[str] | Unset): List of team IDs that own this heartbeat - enabled (bool | Unset): Whether to trigger alerts when heartbeat is expired. + description (Union[None, Unset, str]): The description of the heartbeat + alert_description (Union[None, Unset, str]): Description of alerts triggered when heartbeat expires. + alert_urgency_id (Union[None, Unset, str]): Urgency of alerts triggered when heartbeat expires. + owner_group_ids (Union[Unset, list[str]]): List of team IDs that own this heartbeat + enabled (Union[Unset, bool]): Whether to trigger alerts when heartbeat is expired. """ name: str @@ -42,11 +40,11 @@ class NewHeartbeatDataAttributes: interval_unit: NewHeartbeatDataAttributesIntervalUnit notification_target_id: str notification_target_type: NewHeartbeatDataAttributesNotificationTargetType - description: None | str | Unset = UNSET - alert_description: None | str | Unset = UNSET - alert_urgency_id: None | str | Unset = UNSET - owner_group_ids: list[str] | Unset = UNSET - enabled: bool | Unset = UNSET + description: Union[None, Unset, str] = UNSET + alert_description: Union[None, Unset, str] = UNSET + alert_urgency_id: Union[None, Unset, str] = UNSET + owner_group_ids: Union[Unset, list[str]] = UNSET + enabled: Union[Unset, bool] = UNSET def to_dict(self) -> dict[str, Any]: name = self.name @@ -61,25 +59,25 @@ def to_dict(self) -> dict[str, Any]: notification_target_type: str = self.notification_target_type - description: None | str | Unset + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: description = self.description - alert_description: None | str | Unset + alert_description: Union[None, Unset, str] if isinstance(self.alert_description, Unset): alert_description = UNSET else: alert_description = self.alert_description - alert_urgency_id: None | str | Unset + alert_urgency_id: Union[None, Unset, str] if isinstance(self.alert_urgency_id, Unset): alert_urgency_id = UNSET else: alert_urgency_id = self.alert_urgency_id - owner_group_ids: list[str] | Unset = UNSET + owner_group_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.owner_group_ids, Unset): owner_group_ids = self.owner_group_ids @@ -127,30 +125,30 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d.pop("notification_target_type") ) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) - def _parse_alert_description(data: object) -> None | str | Unset: + def _parse_alert_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) alert_description = _parse_alert_description(d.pop("alert_description", UNSET)) - def _parse_alert_urgency_id(data: object) -> None | str | Unset: + def _parse_alert_urgency_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) alert_urgency_id = _parse_alert_urgency_id(d.pop("alert_urgency_id", UNSET)) diff --git a/rootly_sdk/models/new_incident.py b/rootly_sdk/models/new_incident.py index 04757579..9be29c67 100644 --- a/rootly_sdk/models/new_incident.py +++ b/rootly_sdk/models/new_incident.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewIncident: data (NewIncidentData): """ - data: NewIncidentData + data: "NewIncidentData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_incident_action_item.py b/rootly_sdk/models/new_incident_action_item.py index 849b7b39..004ae495 100644 --- a/rootly_sdk/models/new_incident_action_item.py +++ b/rootly_sdk/models/new_incident_action_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewIncidentActionItem: data (NewIncidentActionItemData): """ - data: NewIncidentActionItemData + data: "NewIncidentActionItemData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_incident_action_item_data.py b/rootly_sdk/models/new_incident_action_item_data.py index 7e266944..9ee79a63 100644 --- a/rootly_sdk/models/new_incident_action_item_data.py +++ b/rootly_sdk/models/new_incident_action_item_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class NewIncidentActionItemData: """ type_: NewIncidentActionItemDataType - attributes: NewIncidentActionItemDataAttributes + attributes: "NewIncidentActionItemDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_incident_action_item_data_attributes.py b/rootly_sdk/models/new_incident_action_item_data_attributes.py index 784b3739..aa64b82e 100644 --- a/rootly_sdk/models/new_incident_action_item_data_attributes.py +++ b/rootly_sdk/models/new_incident_action_item_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -33,91 +31,92 @@ class NewIncidentActionItemDataAttributes: """ Attributes: summary (str): The summary of the action item - description (None | str | Unset): The description of the action item - kind (NewIncidentActionItemDataAttributesKind | Unset): The kind of the action item - assigned_to_user_id (int | None | Unset): ID of user you wish to assign this action item - assigned_to_group_ids (list[str] | Unset): IDs of groups you wish to assign this action item - priority (NewIncidentActionItemDataAttributesPriority | Unset): The priority of the action item - status (NewIncidentActionItemDataAttributesStatus | Unset): The status of the action item - due_date (None | str | Unset): The due date of the action item - jira_issue_id (None | str | Unset): The Jira issue ID. - jira_issue_key (None | str | Unset): The Jira issue key. - jira_issue_url (None | str | Unset): The Jira issue URL. - form_field_selections (list[NewIncidentActionItemDataAttributesFormFieldSelectionsType0Item] | None | Unset): - Custom field values to set on the action item. Ignored unless custom fields for action items are enabled for the - organization. + description (Union[None, Unset, str]): The description of the action item + kind (Union[Unset, NewIncidentActionItemDataAttributesKind]): The kind of the action item + assigned_to_user_id (Union[None, Unset, int]): ID of user you wish to assign this action item + assigned_to_group_ids (Union[Unset, list[str]]): IDs of groups you wish to assign this action item + priority (Union[Unset, NewIncidentActionItemDataAttributesPriority]): The priority of the action item + status (Union[Unset, NewIncidentActionItemDataAttributesStatus]): The status of the action item + due_date (Union[None, Unset, str]): The due date of the action item + jira_issue_id (Union[None, Unset, str]): The Jira issue ID. + jira_issue_key (Union[None, Unset, str]): The Jira issue key. + jira_issue_url (Union[None, Unset, str]): The Jira issue URL. + form_field_selections (Union[None, Unset, + list['NewIncidentActionItemDataAttributesFormFieldSelectionsType0Item']]): Custom field values to set on the + action item. Ignored unless custom fields for action items are enabled for the organization. """ summary: str - description: None | str | Unset = UNSET - kind: NewIncidentActionItemDataAttributesKind | Unset = UNSET - assigned_to_user_id: int | None | Unset = UNSET - assigned_to_group_ids: list[str] | Unset = UNSET - priority: NewIncidentActionItemDataAttributesPriority | Unset = UNSET - status: NewIncidentActionItemDataAttributesStatus | Unset = UNSET - due_date: None | str | Unset = UNSET - jira_issue_id: None | str | Unset = UNSET - jira_issue_key: None | str | Unset = UNSET - jira_issue_url: None | str | Unset = UNSET - form_field_selections: list[NewIncidentActionItemDataAttributesFormFieldSelectionsType0Item] | None | Unset = UNSET + description: Union[None, Unset, str] = UNSET + kind: Union[Unset, NewIncidentActionItemDataAttributesKind] = UNSET + assigned_to_user_id: Union[None, Unset, int] = UNSET + assigned_to_group_ids: Union[Unset, list[str]] = UNSET + priority: Union[Unset, NewIncidentActionItemDataAttributesPriority] = UNSET + status: Union[Unset, NewIncidentActionItemDataAttributesStatus] = UNSET + due_date: Union[None, Unset, str] = UNSET + jira_issue_id: Union[None, Unset, str] = UNSET + jira_issue_key: Union[None, Unset, str] = UNSET + jira_issue_url: Union[None, Unset, str] = UNSET + form_field_selections: Union[ + None, Unset, list["NewIncidentActionItemDataAttributesFormFieldSelectionsType0Item"] + ] = UNSET def to_dict(self) -> dict[str, Any]: - summary = self.summary - description: None | str | Unset + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: description = self.description - kind: str | Unset = UNSET + kind: Union[Unset, str] = UNSET if not isinstance(self.kind, Unset): kind = self.kind - assigned_to_user_id: int | None | Unset + assigned_to_user_id: Union[None, Unset, int] if isinstance(self.assigned_to_user_id, Unset): assigned_to_user_id = UNSET else: assigned_to_user_id = self.assigned_to_user_id - assigned_to_group_ids: list[str] | Unset = UNSET + assigned_to_group_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.assigned_to_group_ids, Unset): assigned_to_group_ids = self.assigned_to_group_ids - priority: str | Unset = UNSET + priority: Union[Unset, str] = UNSET if not isinstance(self.priority, Unset): priority = self.priority - status: str | Unset = UNSET + status: Union[Unset, str] = UNSET if not isinstance(self.status, Unset): status = self.status - due_date: None | str | Unset + due_date: Union[None, Unset, str] if isinstance(self.due_date, Unset): due_date = UNSET else: due_date = self.due_date - jira_issue_id: None | str | Unset + jira_issue_id: Union[None, Unset, str] if isinstance(self.jira_issue_id, Unset): jira_issue_id = UNSET else: jira_issue_id = self.jira_issue_id - jira_issue_key: None | str | Unset + jira_issue_key: Union[None, Unset, str] if isinstance(self.jira_issue_key, Unset): jira_issue_key = UNSET else: jira_issue_key = self.jira_issue_key - jira_issue_url: None | str | Unset + jira_issue_url: Union[None, Unset, str] if isinstance(self.jira_issue_url, Unset): jira_issue_url = UNSET else: jira_issue_url = self.jira_issue_url - form_field_selections: list[dict[str, Any]] | None | Unset + form_field_selections: Union[None, Unset, list[dict[str, Any]]] if isinstance(self.form_field_selections, Unset): form_field_selections = UNSET elif isinstance(self.form_field_selections, list): @@ -170,86 +169,86 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) summary = d.pop("summary") - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) _kind = d.pop("kind", UNSET) - kind: NewIncidentActionItemDataAttributesKind | Unset + kind: Union[Unset, NewIncidentActionItemDataAttributesKind] if isinstance(_kind, Unset): kind = UNSET else: kind = check_new_incident_action_item_data_attributes_kind(_kind) - def _parse_assigned_to_user_id(data: object) -> int | None | Unset: + def _parse_assigned_to_user_id(data: object) -> Union[None, Unset, int]: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(Union[None, Unset, int], data) assigned_to_user_id = _parse_assigned_to_user_id(d.pop("assigned_to_user_id", UNSET)) assigned_to_group_ids = cast(list[str], d.pop("assigned_to_group_ids", UNSET)) _priority = d.pop("priority", UNSET) - priority: NewIncidentActionItemDataAttributesPriority | Unset + priority: Union[Unset, NewIncidentActionItemDataAttributesPriority] if isinstance(_priority, Unset): priority = UNSET else: priority = check_new_incident_action_item_data_attributes_priority(_priority) _status = d.pop("status", UNSET) - status: NewIncidentActionItemDataAttributesStatus | Unset + status: Union[Unset, NewIncidentActionItemDataAttributesStatus] if isinstance(_status, Unset): status = UNSET else: status = check_new_incident_action_item_data_attributes_status(_status) - def _parse_due_date(data: object) -> None | str | Unset: + def _parse_due_date(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) due_date = _parse_due_date(d.pop("due_date", UNSET)) - def _parse_jira_issue_id(data: object) -> None | str | Unset: + def _parse_jira_issue_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) jira_issue_id = _parse_jira_issue_id(d.pop("jira_issue_id", UNSET)) - def _parse_jira_issue_key(data: object) -> None | str | Unset: + def _parse_jira_issue_key(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) jira_issue_key = _parse_jira_issue_key(d.pop("jira_issue_key", UNSET)) - def _parse_jira_issue_url(data: object) -> None | str | Unset: + def _parse_jira_issue_url(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) jira_issue_url = _parse_jira_issue_url(d.pop("jira_issue_url", UNSET)) def _parse_form_field_selections( data: object, - ) -> list[NewIncidentActionItemDataAttributesFormFieldSelectionsType0Item] | None | Unset: + ) -> Union[None, Unset, list["NewIncidentActionItemDataAttributesFormFieldSelectionsType0Item"]]: if data is None: return data if isinstance(data, Unset): @@ -269,9 +268,11 @@ def _parse_form_field_selections( form_field_selections_type_0.append(form_field_selections_type_0_item) return form_field_selections_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[NewIncidentActionItemDataAttributesFormFieldSelectionsType0Item] | None | Unset, data) + return cast( + Union[None, Unset, list["NewIncidentActionItemDataAttributesFormFieldSelectionsType0Item"]], data + ) form_field_selections = _parse_form_field_selections(d.pop("form_field_selections", UNSET)) diff --git a/rootly_sdk/models/new_incident_action_item_data_attributes_form_field_selections_type_0_item.py b/rootly_sdk/models/new_incident_action_item_data_attributes_form_field_selections_type_0_item.py index f8730f92..e4ad6aab 100644 --- a/rootly_sdk/models/new_incident_action_item_data_attributes_form_field_selections_type_0_item.py +++ b/rootly_sdk/models/new_incident_action_item_data_attributes_form_field_selections_type_0_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -15,41 +13,42 @@ class NewIncidentActionItemDataAttributesFormFieldSelectionsType0Item: """ Attributes: form_field_id (str): ID of the custom field - id (str | Unset): ID of an existing selection. Required when updating or removing a field's existing value. - value (list[str] | None | str | Unset): Value for text, textarea, rich text, date, datetime, number, checkbox, - or tag fields - selected_option_ids (list[str] | Unset): IDs of the selected custom field options - selected_user_ids (list[int] | Unset): IDs of the selected users - selected_group_ids (list[str] | Unset): IDs of the selected teams - selected_service_ids (list[str] | Unset): IDs of the selected services - selected_functionality_ids (list[str] | Unset): IDs of the selected functionalities - selected_catalog_entity_ids (list[str] | Unset): IDs of the selected catalog entities - selected_environment_ids (list[str] | Unset): IDs of the selected environments - selected_cause_ids (list[str] | Unset): IDs of the selected causes - selected_incident_type_ids (list[str] | Unset): IDs of the selected incident types - field_destroy (bool | None | Unset): Set to true to remove the field's value from the action item + id (Union[Unset, str]): ID of an existing selection. Required when updating or removing a field's existing + value. + value (Union[None, Unset, list[str], str]): Value for text, textarea, rich text, date, datetime, number, + checkbox, or tag fields + selected_option_ids (Union[Unset, list[str]]): IDs of the selected custom field options + selected_user_ids (Union[Unset, list[int]]): IDs of the selected users + selected_group_ids (Union[Unset, list[str]]): IDs of the selected teams + selected_service_ids (Union[Unset, list[str]]): IDs of the selected services + selected_functionality_ids (Union[Unset, list[str]]): IDs of the selected functionalities + selected_catalog_entity_ids (Union[Unset, list[str]]): IDs of the selected catalog entities + selected_environment_ids (Union[Unset, list[str]]): IDs of the selected environments + selected_cause_ids (Union[Unset, list[str]]): IDs of the selected causes + selected_incident_type_ids (Union[Unset, list[str]]): IDs of the selected incident types + field_destroy (Union[None, Unset, bool]): Set to true to remove the field's value from the action item """ form_field_id: str - id: str | Unset = UNSET - value: list[str] | None | str | Unset = UNSET - selected_option_ids: list[str] | Unset = UNSET - selected_user_ids: list[int] | Unset = UNSET - selected_group_ids: list[str] | Unset = UNSET - selected_service_ids: list[str] | Unset = UNSET - selected_functionality_ids: list[str] | Unset = UNSET - selected_catalog_entity_ids: list[str] | Unset = UNSET - selected_environment_ids: list[str] | Unset = UNSET - selected_cause_ids: list[str] | Unset = UNSET - selected_incident_type_ids: list[str] | Unset = UNSET - field_destroy: bool | None | Unset = UNSET + id: Union[Unset, str] = UNSET + value: Union[None, Unset, list[str], str] = UNSET + selected_option_ids: Union[Unset, list[str]] = UNSET + selected_user_ids: Union[Unset, list[int]] = UNSET + selected_group_ids: Union[Unset, list[str]] = UNSET + selected_service_ids: Union[Unset, list[str]] = UNSET + selected_functionality_ids: Union[Unset, list[str]] = UNSET + selected_catalog_entity_ids: Union[Unset, list[str]] = UNSET + selected_environment_ids: Union[Unset, list[str]] = UNSET + selected_cause_ids: Union[Unset, list[str]] = UNSET + selected_incident_type_ids: Union[Unset, list[str]] = UNSET + field_destroy: Union[None, Unset, bool] = UNSET def to_dict(self) -> dict[str, Any]: form_field_id = self.form_field_id id = self.id - value: list[str] | None | str | Unset + value: Union[None, Unset, list[str], str] if isinstance(self.value, Unset): value = UNSET elif isinstance(self.value, list): @@ -58,43 +57,43 @@ def to_dict(self) -> dict[str, Any]: else: value = self.value - selected_option_ids: list[str] | Unset = UNSET + selected_option_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.selected_option_ids, Unset): selected_option_ids = self.selected_option_ids - selected_user_ids: list[int] | Unset = UNSET + selected_user_ids: Union[Unset, list[int]] = UNSET if not isinstance(self.selected_user_ids, Unset): selected_user_ids = self.selected_user_ids - selected_group_ids: list[str] | Unset = UNSET + selected_group_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.selected_group_ids, Unset): selected_group_ids = self.selected_group_ids - selected_service_ids: list[str] | Unset = UNSET + selected_service_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.selected_service_ids, Unset): selected_service_ids = self.selected_service_ids - selected_functionality_ids: list[str] | Unset = UNSET + selected_functionality_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.selected_functionality_ids, Unset): selected_functionality_ids = self.selected_functionality_ids - selected_catalog_entity_ids: list[str] | Unset = UNSET + selected_catalog_entity_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.selected_catalog_entity_ids, Unset): selected_catalog_entity_ids = self.selected_catalog_entity_ids - selected_environment_ids: list[str] | Unset = UNSET + selected_environment_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.selected_environment_ids, Unset): selected_environment_ids = self.selected_environment_ids - selected_cause_ids: list[str] | Unset = UNSET + selected_cause_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.selected_cause_ids, Unset): selected_cause_ids = self.selected_cause_ids - selected_incident_type_ids: list[str] | Unset = UNSET + selected_incident_type_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.selected_incident_type_ids, Unset): selected_incident_type_ids = self.selected_incident_type_ids - field_destroy: bool | None | Unset + field_destroy: Union[None, Unset, bool] if isinstance(self.field_destroy, Unset): field_destroy = UNSET else: @@ -141,7 +140,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: id = d.pop("id", UNSET) - def _parse_value(data: object) -> list[str] | None | str | Unset: + def _parse_value(data: object) -> Union[None, Unset, list[str], str]: if data is None: return data if isinstance(data, Unset): @@ -152,9 +151,9 @@ def _parse_value(data: object) -> list[str] | None | str | Unset: value_type_1 = cast(list[str], data) return value_type_1 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | str | Unset, data) + return cast(Union[None, Unset, list[str], str], data) value = _parse_value(d.pop("value", UNSET)) @@ -176,12 +175,12 @@ def _parse_value(data: object) -> list[str] | None | str | Unset: selected_incident_type_ids = cast(list[str], d.pop("selected_incident_type_ids", UNSET)) - def _parse_field_destroy(data: object) -> bool | None | Unset: + def _parse_field_destroy(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) field_destroy = _parse_field_destroy(d.pop("_destroy", UNSET)) diff --git a/rootly_sdk/models/new_incident_custom_field_selection.py b/rootly_sdk/models/new_incident_custom_field_selection.py index 2b9c1ab1..ed0e7abc 100644 --- a/rootly_sdk/models/new_incident_custom_field_selection.py +++ b/rootly_sdk/models/new_incident_custom_field_selection.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewIncidentCustomFieldSelection: data (NewIncidentCustomFieldSelectionData): """ - data: NewIncidentCustomFieldSelectionData + data: "NewIncidentCustomFieldSelectionData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_incident_custom_field_selection_data.py b/rootly_sdk/models/new_incident_custom_field_selection_data.py index d5151e61..a59f3532 100644 --- a/rootly_sdk/models/new_incident_custom_field_selection_data.py +++ b/rootly_sdk/models/new_incident_custom_field_selection_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class NewIncidentCustomFieldSelectionData: """ type_: NewIncidentCustomFieldSelectionDataType - attributes: NewIncidentCustomFieldSelectionDataAttributes + attributes: "NewIncidentCustomFieldSelectionDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_incident_custom_field_selection_data_attributes.py b/rootly_sdk/models/new_incident_custom_field_selection_data_attributes.py index 9d28b839..8d3e4709 100644 --- a/rootly_sdk/models/new_incident_custom_field_selection_data_attributes.py +++ b/rootly_sdk/models/new_incident_custom_field_selection_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -15,21 +13,21 @@ class NewIncidentCustomFieldSelectionDataAttributes: """ Attributes: custom_field_id (int): The custom field for this selection - value (None | str): The selected value for text kind custom fields - selected_option_ids (list[int] | Unset): + value (Union[None, str]): The selected value for text kind custom fields + selected_option_ids (Union[Unset, list[int]]): """ custom_field_id: int - value: None | str - selected_option_ids: list[int] | Unset = UNSET + value: Union[None, str] + selected_option_ids: Union[Unset, list[int]] = UNSET def to_dict(self) -> dict[str, Any]: custom_field_id = self.custom_field_id - value: None | str + value: Union[None, str] value = self.value - selected_option_ids: list[int] | Unset = UNSET + selected_option_ids: Union[Unset, list[int]] = UNSET if not isinstance(self.selected_option_ids, Unset): selected_option_ids = self.selected_option_ids @@ -51,10 +49,10 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) custom_field_id = d.pop("custom_field_id") - def _parse_value(data: object) -> None | str: + def _parse_value(data: object) -> Union[None, str]: if data is None: return data - return cast(None | str, data) + return cast(Union[None, str], data) value = _parse_value(d.pop("value")) diff --git a/rootly_sdk/models/new_incident_data.py b/rootly_sdk/models/new_incident_data.py index 34e87501..ebe1a219 100644 --- a/rootly_sdk/models/new_incident_data.py +++ b/rootly_sdk/models/new_incident_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class NewIncidentData: """ type_: NewIncidentDataType - attributes: NewIncidentDataAttributes + attributes: "NewIncidentDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_incident_data_attributes.py b/rootly_sdk/models/new_incident_data_attributes.py index 8a795611..f5d5a0f1 100644 --- a/rootly_sdk/models/new_incident_data_attributes.py +++ b/rootly_sdk/models/new_incident_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -26,149 +24,149 @@ class NewIncidentDataAttributes: """ Attributes: - title (None | str | Unset): The title of the incident. We will autogenerate one if null - kind (NewIncidentDataAttributesKind | Unset): The kind of the incident Default: 'normal'. - parent_incident_id (None | str | Unset): ID of parent incident - duplicate_incident_id (None | str | Unset): ID of duplicated incident - private (bool | None | Unset): Create an incident as private. Once an incident is made as private it cannot be - undone Default: False. - summary (None | str | Unset): The summary of the incident - user_id (None | str | Unset): User ID of the creator of the incident. Default to the user attached to the Api - Key - severity_id (None | str | Unset): The Severity ID to attach to the incident - public_title (None | str | Unset): The public title of the incident - alert_ids (list[str] | None | Unset): The Alert IDs to attach to the incident - environment_ids (list[str] | None | Unset): The Environment IDs to attach to the incident - incident_type_ids (list[str] | None | Unset): The Incident Type IDs to attach to the incident - service_ids (list[str] | None | Unset): The Service IDs to attach to the incident - functionality_ids (list[str] | None | Unset): The Functionality IDs to attach to the incident - group_ids (list[str] | None | Unset): The Team IDs to attach to the incident - cause_ids (list[str] | None | Unset): The Cause IDs to attach to the incident - muted_service_ids (list[str] | None | Unset): The Service IDs to mute alerts for during maintenance. Alerts for - these services will still be triggered and attached to the incident, but won't page responders. - labels (NewIncidentDataAttributesLabelsType0 | None | Unset): Labels to attach to the incidents. eg: + title (Union[None, Unset, str]): The title of the incident. We will autogenerate one if null + kind (Union[Unset, NewIncidentDataAttributesKind]): The kind of the incident Default: 'normal'. + parent_incident_id (Union[None, Unset, str]): ID of parent incident + duplicate_incident_id (Union[None, Unset, str]): ID of duplicated incident + private (Union[None, Unset, bool]): Create an incident as private. Once an incident is made as private it cannot + be undone Default: False. + summary (Union[None, Unset, str]): The summary of the incident + user_id (Union[None, Unset, str]): User ID of the creator of the incident. Default to the user attached to the + Api Key + severity_id (Union[None, Unset, str]): The Severity ID to attach to the incident + public_title (Union[None, Unset, str]): The public title of the incident + alert_ids (Union[None, Unset, list[str]]): The Alert IDs to attach to the incident + environment_ids (Union[None, Unset, list[str]]): The Environment IDs to attach to the incident + incident_type_ids (Union[None, Unset, list[str]]): The Incident Type IDs to attach to the incident + service_ids (Union[None, Unset, list[str]]): The Service IDs to attach to the incident + functionality_ids (Union[None, Unset, list[str]]): The Functionality IDs to attach to the incident + group_ids (Union[None, Unset, list[str]]): The Team IDs to attach to the incident + cause_ids (Union[None, Unset, list[str]]): The Cause IDs to attach to the incident + muted_service_ids (Union[None, Unset, list[str]]): The Service IDs to mute alerts for during maintenance. Alerts + for these services will still be triggered and attached to the incident, but won't page responders. + labels (Union['NewIncidentDataAttributesLabelsType0', None, Unset]): Labels to attach to the incidents. eg: {"platform":"osx", "version": "1.29"} - slack_channel_name (None | str | Unset): Slack channel name - slack_channel_id (None | str | Unset): Slack channel id - slack_channel_url (None | str | Unset): Slack channel url - slack_channel_archived (bool | None | Unset): Whether the Slack channel is archived - google_drive_parent_id (None | str | Unset): Google Drive parent folder ID - google_drive_url (None | str | Unset): Google Drive URL - jira_issue_key (None | str | Unset): Jira issue key - jira_issue_id (None | str | Unset): Jira issue ID - jira_issue_url (None | str | Unset): Jira issue URL - notify_emails (list[str] | None | Unset): Emails you want to notify - status (NewIncidentDataAttributesStatus | Unset): The status of the incident - url (str | Unset): The url to the incident - scheduled_for (None | str | Unset): Date of when the maintenance begins - scheduled_until (None | str | Unset): Date of when the maintenance ends - in_triage_at (None | str | Unset): Date of triage - started_at (None | str | Unset): Date of start - detected_at (None | str | Unset): Date of detection - acknowledged_at (None | str | Unset): Date of acknowledgment - mitigated_at (None | str | Unset): Date of mitigation - resolved_at (None | str | Unset): Date of resolution - closed_at (None | str | Unset): Date of closure - cancelled_at (None | str | Unset): Date of cancellation + slack_channel_name (Union[None, Unset, str]): Slack channel name + slack_channel_id (Union[None, Unset, str]): Slack channel id + slack_channel_url (Union[None, Unset, str]): Slack channel url + slack_channel_archived (Union[None, Unset, bool]): Whether the Slack channel is archived + google_drive_parent_id (Union[None, Unset, str]): Google Drive parent folder ID + google_drive_url (Union[None, Unset, str]): Google Drive URL + jira_issue_key (Union[None, Unset, str]): Jira issue key + jira_issue_id (Union[None, Unset, str]): Jira issue ID + jira_issue_url (Union[None, Unset, str]): Jira issue URL + notify_emails (Union[None, Unset, list[str]]): Emails you want to notify + status (Union[Unset, NewIncidentDataAttributesStatus]): The status of the incident + url (Union[Unset, str]): The url to the incident + scheduled_for (Union[None, Unset, str]): Date of when the maintenance begins + scheduled_until (Union[None, Unset, str]): Date of when the maintenance ends + in_triage_at (Union[None, Unset, str]): Date of triage + started_at (Union[None, Unset, str]): Date of start + detected_at (Union[None, Unset, str]): Date of detection + acknowledged_at (Union[None, Unset, str]): Date of acknowledgment + mitigated_at (Union[None, Unset, str]): Date of mitigation + resolved_at (Union[None, Unset, str]): Date of resolution + closed_at (Union[None, Unset, str]): Date of closure + cancelled_at (Union[None, Unset, str]): Date of cancellation """ - title: None | str | Unset = UNSET - kind: NewIncidentDataAttributesKind | Unset = "normal" - parent_incident_id: None | str | Unset = UNSET - duplicate_incident_id: None | str | Unset = UNSET - private: bool | None | Unset = False - summary: None | str | Unset = UNSET - user_id: None | str | Unset = UNSET - severity_id: None | str | Unset = UNSET - public_title: None | str | Unset = UNSET - alert_ids: list[str] | None | Unset = UNSET - environment_ids: list[str] | None | Unset = UNSET - incident_type_ids: list[str] | None | Unset = UNSET - service_ids: list[str] | None | Unset = UNSET - functionality_ids: list[str] | None | Unset = UNSET - group_ids: list[str] | None | Unset = UNSET - cause_ids: list[str] | None | Unset = UNSET - muted_service_ids: list[str] | None | Unset = UNSET - labels: NewIncidentDataAttributesLabelsType0 | None | Unset = UNSET - slack_channel_name: None | str | Unset = UNSET - slack_channel_id: None | str | Unset = UNSET - slack_channel_url: None | str | Unset = UNSET - slack_channel_archived: bool | None | Unset = UNSET - google_drive_parent_id: None | str | Unset = UNSET - google_drive_url: None | str | Unset = UNSET - jira_issue_key: None | str | Unset = UNSET - jira_issue_id: None | str | Unset = UNSET - jira_issue_url: None | str | Unset = UNSET - notify_emails: list[str] | None | Unset = UNSET - status: NewIncidentDataAttributesStatus | Unset = UNSET - url: str | Unset = UNSET - scheduled_for: None | str | Unset = UNSET - scheduled_until: None | str | Unset = UNSET - in_triage_at: None | str | Unset = UNSET - started_at: None | str | Unset = UNSET - detected_at: None | str | Unset = UNSET - acknowledged_at: None | str | Unset = UNSET - mitigated_at: None | str | Unset = UNSET - resolved_at: None | str | Unset = UNSET - closed_at: None | str | Unset = UNSET - cancelled_at: None | str | Unset = UNSET + title: Union[None, Unset, str] = UNSET + kind: Union[Unset, NewIncidentDataAttributesKind] = "normal" + parent_incident_id: Union[None, Unset, str] = UNSET + duplicate_incident_id: Union[None, Unset, str] = UNSET + private: Union[None, Unset, bool] = False + summary: Union[None, Unset, str] = UNSET + user_id: Union[None, Unset, str] = UNSET + severity_id: Union[None, Unset, str] = UNSET + public_title: Union[None, Unset, str] = UNSET + alert_ids: Union[None, Unset, list[str]] = UNSET + environment_ids: Union[None, Unset, list[str]] = UNSET + incident_type_ids: Union[None, Unset, list[str]] = UNSET + service_ids: Union[None, Unset, list[str]] = UNSET + functionality_ids: Union[None, Unset, list[str]] = UNSET + group_ids: Union[None, Unset, list[str]] = UNSET + cause_ids: Union[None, Unset, list[str]] = UNSET + muted_service_ids: Union[None, Unset, list[str]] = UNSET + labels: Union["NewIncidentDataAttributesLabelsType0", None, Unset] = UNSET + slack_channel_name: Union[None, Unset, str] = UNSET + slack_channel_id: Union[None, Unset, str] = UNSET + slack_channel_url: Union[None, Unset, str] = UNSET + slack_channel_archived: Union[None, Unset, bool] = UNSET + google_drive_parent_id: Union[None, Unset, str] = UNSET + google_drive_url: Union[None, Unset, str] = UNSET + jira_issue_key: Union[None, Unset, str] = UNSET + jira_issue_id: Union[None, Unset, str] = UNSET + jira_issue_url: Union[None, Unset, str] = UNSET + notify_emails: Union[None, Unset, list[str]] = UNSET + status: Union[Unset, NewIncidentDataAttributesStatus] = UNSET + url: Union[Unset, str] = UNSET + scheduled_for: Union[None, Unset, str] = UNSET + scheduled_until: Union[None, Unset, str] = UNSET + in_triage_at: Union[None, Unset, str] = UNSET + started_at: Union[None, Unset, str] = UNSET + detected_at: Union[None, Unset, str] = UNSET + acknowledged_at: Union[None, Unset, str] = UNSET + mitigated_at: Union[None, Unset, str] = UNSET + resolved_at: Union[None, Unset, str] = UNSET + closed_at: Union[None, Unset, str] = UNSET + cancelled_at: Union[None, Unset, str] = UNSET def to_dict(self) -> dict[str, Any]: from ..models.new_incident_data_attributes_labels_type_0 import NewIncidentDataAttributesLabelsType0 - title: None | str | Unset + title: Union[None, Unset, str] if isinstance(self.title, Unset): title = UNSET else: title = self.title - kind: str | Unset = UNSET + kind: Union[Unset, str] = UNSET if not isinstance(self.kind, Unset): kind = self.kind - parent_incident_id: None | str | Unset + parent_incident_id: Union[None, Unset, str] if isinstance(self.parent_incident_id, Unset): parent_incident_id = UNSET else: parent_incident_id = self.parent_incident_id - duplicate_incident_id: None | str | Unset + duplicate_incident_id: Union[None, Unset, str] if isinstance(self.duplicate_incident_id, Unset): duplicate_incident_id = UNSET else: duplicate_incident_id = self.duplicate_incident_id - private: bool | None | Unset + private: Union[None, Unset, bool] if isinstance(self.private, Unset): private = UNSET else: private = self.private - summary: None | str | Unset + summary: Union[None, Unset, str] if isinstance(self.summary, Unset): summary = UNSET else: summary = self.summary - user_id: None | str | Unset + user_id: Union[None, Unset, str] if isinstance(self.user_id, Unset): user_id = UNSET else: user_id = self.user_id - severity_id: None | str | Unset + severity_id: Union[None, Unset, str] if isinstance(self.severity_id, Unset): severity_id = UNSET else: severity_id = self.severity_id - public_title: None | str | Unset + public_title: Union[None, Unset, str] if isinstance(self.public_title, Unset): public_title = UNSET else: public_title = self.public_title - alert_ids: list[str] | None | Unset + alert_ids: Union[None, Unset, list[str]] if isinstance(self.alert_ids, Unset): alert_ids = UNSET elif isinstance(self.alert_ids, list): @@ -177,7 +175,7 @@ def to_dict(self) -> dict[str, Any]: else: alert_ids = self.alert_ids - environment_ids: list[str] | None | Unset + environment_ids: Union[None, Unset, list[str]] if isinstance(self.environment_ids, Unset): environment_ids = UNSET elif isinstance(self.environment_ids, list): @@ -186,7 +184,7 @@ def to_dict(self) -> dict[str, Any]: else: environment_ids = self.environment_ids - incident_type_ids: list[str] | None | Unset + incident_type_ids: Union[None, Unset, list[str]] if isinstance(self.incident_type_ids, Unset): incident_type_ids = UNSET elif isinstance(self.incident_type_ids, list): @@ -195,7 +193,7 @@ def to_dict(self) -> dict[str, Any]: else: incident_type_ids = self.incident_type_ids - service_ids: list[str] | None | Unset + service_ids: Union[None, Unset, list[str]] if isinstance(self.service_ids, Unset): service_ids = UNSET elif isinstance(self.service_ids, list): @@ -204,7 +202,7 @@ def to_dict(self) -> dict[str, Any]: else: service_ids = self.service_ids - functionality_ids: list[str] | None | Unset + functionality_ids: Union[None, Unset, list[str]] if isinstance(self.functionality_ids, Unset): functionality_ids = UNSET elif isinstance(self.functionality_ids, list): @@ -213,7 +211,7 @@ def to_dict(self) -> dict[str, Any]: else: functionality_ids = self.functionality_ids - group_ids: list[str] | None | Unset + group_ids: Union[None, Unset, list[str]] if isinstance(self.group_ids, Unset): group_ids = UNSET elif isinstance(self.group_ids, list): @@ -222,7 +220,7 @@ def to_dict(self) -> dict[str, Any]: else: group_ids = self.group_ids - cause_ids: list[str] | None | Unset + cause_ids: Union[None, Unset, list[str]] if isinstance(self.cause_ids, Unset): cause_ids = UNSET elif isinstance(self.cause_ids, list): @@ -231,7 +229,7 @@ def to_dict(self) -> dict[str, Any]: else: cause_ids = self.cause_ids - muted_service_ids: list[str] | None | Unset + muted_service_ids: Union[None, Unset, list[str]] if isinstance(self.muted_service_ids, Unset): muted_service_ids = UNSET elif isinstance(self.muted_service_ids, list): @@ -240,7 +238,7 @@ def to_dict(self) -> dict[str, Any]: else: muted_service_ids = self.muted_service_ids - labels: dict[str, Any] | None | Unset + labels: Union[None, Unset, dict[str, Any]] if isinstance(self.labels, Unset): labels = UNSET elif isinstance(self.labels, NewIncidentDataAttributesLabelsType0): @@ -248,61 +246,61 @@ def to_dict(self) -> dict[str, Any]: else: labels = self.labels - slack_channel_name: None | str | Unset + slack_channel_name: Union[None, Unset, str] if isinstance(self.slack_channel_name, Unset): slack_channel_name = UNSET else: slack_channel_name = self.slack_channel_name - slack_channel_id: None | str | Unset + slack_channel_id: Union[None, Unset, str] if isinstance(self.slack_channel_id, Unset): slack_channel_id = UNSET else: slack_channel_id = self.slack_channel_id - slack_channel_url: None | str | Unset + slack_channel_url: Union[None, Unset, str] if isinstance(self.slack_channel_url, Unset): slack_channel_url = UNSET else: slack_channel_url = self.slack_channel_url - slack_channel_archived: bool | None | Unset + slack_channel_archived: Union[None, Unset, bool] if isinstance(self.slack_channel_archived, Unset): slack_channel_archived = UNSET else: slack_channel_archived = self.slack_channel_archived - google_drive_parent_id: None | str | Unset + google_drive_parent_id: Union[None, Unset, str] if isinstance(self.google_drive_parent_id, Unset): google_drive_parent_id = UNSET else: google_drive_parent_id = self.google_drive_parent_id - google_drive_url: None | str | Unset + google_drive_url: Union[None, Unset, str] if isinstance(self.google_drive_url, Unset): google_drive_url = UNSET else: google_drive_url = self.google_drive_url - jira_issue_key: None | str | Unset + jira_issue_key: Union[None, Unset, str] if isinstance(self.jira_issue_key, Unset): jira_issue_key = UNSET else: jira_issue_key = self.jira_issue_key - jira_issue_id: None | str | Unset + jira_issue_id: Union[None, Unset, str] if isinstance(self.jira_issue_id, Unset): jira_issue_id = UNSET else: jira_issue_id = self.jira_issue_id - jira_issue_url: None | str | Unset + jira_issue_url: Union[None, Unset, str] if isinstance(self.jira_issue_url, Unset): jira_issue_url = UNSET else: jira_issue_url = self.jira_issue_url - notify_emails: list[str] | None | Unset + notify_emails: Union[None, Unset, list[str]] if isinstance(self.notify_emails, Unset): notify_emails = UNSET elif isinstance(self.notify_emails, list): @@ -311,67 +309,67 @@ def to_dict(self) -> dict[str, Any]: else: notify_emails = self.notify_emails - status: str | Unset = UNSET + status: Union[Unset, str] = UNSET if not isinstance(self.status, Unset): status = self.status url = self.url - scheduled_for: None | str | Unset + scheduled_for: Union[None, Unset, str] if isinstance(self.scheduled_for, Unset): scheduled_for = UNSET else: scheduled_for = self.scheduled_for - scheduled_until: None | str | Unset + scheduled_until: Union[None, Unset, str] if isinstance(self.scheduled_until, Unset): scheduled_until = UNSET else: scheduled_until = self.scheduled_until - in_triage_at: None | str | Unset + in_triage_at: Union[None, Unset, str] if isinstance(self.in_triage_at, Unset): in_triage_at = UNSET else: in_triage_at = self.in_triage_at - started_at: None | str | Unset + started_at: Union[None, Unset, str] if isinstance(self.started_at, Unset): started_at = UNSET else: started_at = self.started_at - detected_at: None | str | Unset + detected_at: Union[None, Unset, str] if isinstance(self.detected_at, Unset): detected_at = UNSET else: detected_at = self.detected_at - acknowledged_at: None | str | Unset + acknowledged_at: Union[None, Unset, str] if isinstance(self.acknowledged_at, Unset): acknowledged_at = UNSET else: acknowledged_at = self.acknowledged_at - mitigated_at: None | str | Unset + mitigated_at: Union[None, Unset, str] if isinstance(self.mitigated_at, Unset): mitigated_at = UNSET else: mitigated_at = self.mitigated_at - resolved_at: None | str | Unset + resolved_at: Union[None, Unset, str] if isinstance(self.resolved_at, Unset): resolved_at = UNSET else: resolved_at = self.resolved_at - closed_at: None | str | Unset + closed_at: Union[None, Unset, str] if isinstance(self.closed_at, Unset): closed_at = UNSET else: closed_at = self.closed_at - cancelled_at: None | str | Unset + cancelled_at: Union[None, Unset, str] if isinstance(self.cancelled_at, Unset): cancelled_at = UNSET else: @@ -469,86 +467,86 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_title(data: object) -> None | str | Unset: + def _parse_title(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) title = _parse_title(d.pop("title", UNSET)) _kind = d.pop("kind", UNSET) - kind: NewIncidentDataAttributesKind | Unset + kind: Union[Unset, NewIncidentDataAttributesKind] if isinstance(_kind, Unset): kind = UNSET else: kind = check_new_incident_data_attributes_kind(_kind) - def _parse_parent_incident_id(data: object) -> None | str | Unset: + def _parse_parent_incident_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) parent_incident_id = _parse_parent_incident_id(d.pop("parent_incident_id", UNSET)) - def _parse_duplicate_incident_id(data: object) -> None | str | Unset: + def _parse_duplicate_incident_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) duplicate_incident_id = _parse_duplicate_incident_id(d.pop("duplicate_incident_id", UNSET)) - def _parse_private(data: object) -> bool | None | Unset: + def _parse_private(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) private = _parse_private(d.pop("private", UNSET)) - def _parse_summary(data: object) -> None | str | Unset: + def _parse_summary(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) summary = _parse_summary(d.pop("summary", UNSET)) - def _parse_user_id(data: object) -> None | str | Unset: + def _parse_user_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) user_id = _parse_user_id(d.pop("user_id", UNSET)) - def _parse_severity_id(data: object) -> None | str | Unset: + def _parse_severity_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) severity_id = _parse_severity_id(d.pop("severity_id", UNSET)) - def _parse_public_title(data: object) -> None | str | Unset: + def _parse_public_title(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) public_title = _parse_public_title(d.pop("public_title", UNSET)) - def _parse_alert_ids(data: object) -> list[str] | None | Unset: + def _parse_alert_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -559,13 +557,13 @@ def _parse_alert_ids(data: object) -> list[str] | None | Unset: alert_ids_type_0 = cast(list[str], data) return alert_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) alert_ids = _parse_alert_ids(d.pop("alert_ids", UNSET)) - def _parse_environment_ids(data: object) -> list[str] | None | Unset: + def _parse_environment_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -576,13 +574,13 @@ def _parse_environment_ids(data: object) -> list[str] | None | Unset: environment_ids_type_0 = cast(list[str], data) return environment_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) environment_ids = _parse_environment_ids(d.pop("environment_ids", UNSET)) - def _parse_incident_type_ids(data: object) -> list[str] | None | Unset: + def _parse_incident_type_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -593,13 +591,13 @@ def _parse_incident_type_ids(data: object) -> list[str] | None | Unset: incident_type_ids_type_0 = cast(list[str], data) return incident_type_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) incident_type_ids = _parse_incident_type_ids(d.pop("incident_type_ids", UNSET)) - def _parse_service_ids(data: object) -> list[str] | None | Unset: + def _parse_service_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -610,13 +608,13 @@ def _parse_service_ids(data: object) -> list[str] | None | Unset: service_ids_type_0 = cast(list[str], data) return service_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) service_ids = _parse_service_ids(d.pop("service_ids", UNSET)) - def _parse_functionality_ids(data: object) -> list[str] | None | Unset: + def _parse_functionality_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -627,13 +625,13 @@ def _parse_functionality_ids(data: object) -> list[str] | None | Unset: functionality_ids_type_0 = cast(list[str], data) return functionality_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) functionality_ids = _parse_functionality_ids(d.pop("functionality_ids", UNSET)) - def _parse_group_ids(data: object) -> list[str] | None | Unset: + def _parse_group_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -644,13 +642,13 @@ def _parse_group_ids(data: object) -> list[str] | None | Unset: group_ids_type_0 = cast(list[str], data) return group_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) group_ids = _parse_group_ids(d.pop("group_ids", UNSET)) - def _parse_cause_ids(data: object) -> list[str] | None | Unset: + def _parse_cause_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -661,13 +659,13 @@ def _parse_cause_ids(data: object) -> list[str] | None | Unset: cause_ids_type_0 = cast(list[str], data) return cause_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) cause_ids = _parse_cause_ids(d.pop("cause_ids", UNSET)) - def _parse_muted_service_ids(data: object) -> list[str] | None | Unset: + def _parse_muted_service_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -678,13 +676,13 @@ def _parse_muted_service_ids(data: object) -> list[str] | None | Unset: muted_service_ids_type_0 = cast(list[str], data) return muted_service_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) muted_service_ids = _parse_muted_service_ids(d.pop("muted_service_ids", UNSET)) - def _parse_labels(data: object) -> NewIncidentDataAttributesLabelsType0 | None | Unset: + def _parse_labels(data: object) -> Union["NewIncidentDataAttributesLabelsType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -695,94 +693,94 @@ def _parse_labels(data: object) -> NewIncidentDataAttributesLabelsType0 | None | labels_type_0 = NewIncidentDataAttributesLabelsType0.from_dict(data) return labels_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(NewIncidentDataAttributesLabelsType0 | None | Unset, data) + return cast(Union["NewIncidentDataAttributesLabelsType0", None, Unset], data) labels = _parse_labels(d.pop("labels", UNSET)) - def _parse_slack_channel_name(data: object) -> None | str | Unset: + def _parse_slack_channel_name(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) slack_channel_name = _parse_slack_channel_name(d.pop("slack_channel_name", UNSET)) - def _parse_slack_channel_id(data: object) -> None | str | Unset: + def _parse_slack_channel_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) slack_channel_id = _parse_slack_channel_id(d.pop("slack_channel_id", UNSET)) - def _parse_slack_channel_url(data: object) -> None | str | Unset: + def _parse_slack_channel_url(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) slack_channel_url = _parse_slack_channel_url(d.pop("slack_channel_url", UNSET)) - def _parse_slack_channel_archived(data: object) -> bool | None | Unset: + def _parse_slack_channel_archived(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) slack_channel_archived = _parse_slack_channel_archived(d.pop("slack_channel_archived", UNSET)) - def _parse_google_drive_parent_id(data: object) -> None | str | Unset: + def _parse_google_drive_parent_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) google_drive_parent_id = _parse_google_drive_parent_id(d.pop("google_drive_parent_id", UNSET)) - def _parse_google_drive_url(data: object) -> None | str | Unset: + def _parse_google_drive_url(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) google_drive_url = _parse_google_drive_url(d.pop("google_drive_url", UNSET)) - def _parse_jira_issue_key(data: object) -> None | str | Unset: + def _parse_jira_issue_key(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) jira_issue_key = _parse_jira_issue_key(d.pop("jira_issue_key", UNSET)) - def _parse_jira_issue_id(data: object) -> None | str | Unset: + def _parse_jira_issue_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) jira_issue_id = _parse_jira_issue_id(d.pop("jira_issue_id", UNSET)) - def _parse_jira_issue_url(data: object) -> None | str | Unset: + def _parse_jira_issue_url(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) jira_issue_url = _parse_jira_issue_url(d.pop("jira_issue_url", UNSET)) - def _parse_notify_emails(data: object) -> list[str] | None | Unset: + def _parse_notify_emails(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -793,14 +791,14 @@ def _parse_notify_emails(data: object) -> list[str] | None | Unset: notify_emails_type_0 = cast(list[str], data) return notify_emails_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) notify_emails = _parse_notify_emails(d.pop("notify_emails", UNSET)) _status = d.pop("status", UNSET) - status: NewIncidentDataAttributesStatus | Unset + status: Union[Unset, NewIncidentDataAttributesStatus] if isinstance(_status, Unset): status = UNSET else: @@ -808,93 +806,93 @@ def _parse_notify_emails(data: object) -> list[str] | None | Unset: url = d.pop("url", UNSET) - def _parse_scheduled_for(data: object) -> None | str | Unset: + def _parse_scheduled_for(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) scheduled_for = _parse_scheduled_for(d.pop("scheduled_for", UNSET)) - def _parse_scheduled_until(data: object) -> None | str | Unset: + def _parse_scheduled_until(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) scheduled_until = _parse_scheduled_until(d.pop("scheduled_until", UNSET)) - def _parse_in_triage_at(data: object) -> None | str | Unset: + def _parse_in_triage_at(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) in_triage_at = _parse_in_triage_at(d.pop("in_triage_at", UNSET)) - def _parse_started_at(data: object) -> None | str | Unset: + def _parse_started_at(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) started_at = _parse_started_at(d.pop("started_at", UNSET)) - def _parse_detected_at(data: object) -> None | str | Unset: + def _parse_detected_at(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) detected_at = _parse_detected_at(d.pop("detected_at", UNSET)) - def _parse_acknowledged_at(data: object) -> None | str | Unset: + def _parse_acknowledged_at(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) acknowledged_at = _parse_acknowledged_at(d.pop("acknowledged_at", UNSET)) - def _parse_mitigated_at(data: object) -> None | str | Unset: + def _parse_mitigated_at(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) mitigated_at = _parse_mitigated_at(d.pop("mitigated_at", UNSET)) - def _parse_resolved_at(data: object) -> None | str | Unset: + def _parse_resolved_at(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) resolved_at = _parse_resolved_at(d.pop("resolved_at", UNSET)) - def _parse_closed_at(data: object) -> None | str | Unset: + def _parse_closed_at(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) closed_at = _parse_closed_at(d.pop("closed_at", UNSET)) - def _parse_cancelled_at(data: object) -> None | str | Unset: + def _parse_cancelled_at(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) cancelled_at = _parse_cancelled_at(d.pop("cancelled_at", UNSET)) diff --git a/rootly_sdk/models/new_incident_data_attributes_labels_type_0.py b/rootly_sdk/models/new_incident_data_attributes_labels_type_0.py index 5e4e81b3..538c971f 100644 --- a/rootly_sdk/models/new_incident_data_attributes_labels_type_0.py +++ b/rootly_sdk/models/new_incident_data_attributes_labels_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,7 +14,6 @@ class NewIncidentDataAttributesLabelsType0: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) diff --git a/rootly_sdk/models/new_incident_event.py b/rootly_sdk/models/new_incident_event.py index 423b6167..86de32cc 100644 --- a/rootly_sdk/models/new_incident_event.py +++ b/rootly_sdk/models/new_incident_event.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewIncidentEvent: data (NewIncidentEventData): """ - data: NewIncidentEventData + data: "NewIncidentEventData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_incident_event_data.py b/rootly_sdk/models/new_incident_event_data.py index 3c9d261d..6304f06d 100644 --- a/rootly_sdk/models/new_incident_event_data.py +++ b/rootly_sdk/models/new_incident_event_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class NewIncidentEventData: """ type_: NewIncidentEventDataType - attributes: NewIncidentEventDataAttributes + attributes: "NewIncidentEventDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_incident_event_data_attributes.py b/rootly_sdk/models/new_incident_event_data_attributes.py index c7702049..2d703729 100644 --- a/rootly_sdk/models/new_incident_event_data_attributes.py +++ b/rootly_sdk/models/new_incident_event_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define @@ -19,16 +17,16 @@ class NewIncidentEventDataAttributes: """ Attributes: event (str): The summary of the incident event - visibility (NewIncidentEventDataAttributesVisibility | Unset): The visibility of the incident action item + visibility (Union[Unset, NewIncidentEventDataAttributesVisibility]): The visibility of the incident action item """ event: str - visibility: NewIncidentEventDataAttributesVisibility | Unset = UNSET + visibility: Union[Unset, NewIncidentEventDataAttributesVisibility] = UNSET def to_dict(self) -> dict[str, Any]: event = self.event - visibility: str | Unset = UNSET + visibility: Union[Unset, str] = UNSET if not isinstance(self.visibility, Unset): visibility = self.visibility @@ -50,7 +48,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: event = d.pop("event") _visibility = d.pop("visibility", UNSET) - visibility: NewIncidentEventDataAttributesVisibility | Unset + visibility: Union[Unset, NewIncidentEventDataAttributesVisibility] if isinstance(_visibility, Unset): visibility = UNSET else: diff --git a/rootly_sdk/models/new_incident_event_functionality.py b/rootly_sdk/models/new_incident_event_functionality.py index 6d66318c..14bfcce4 100644 --- a/rootly_sdk/models/new_incident_event_functionality.py +++ b/rootly_sdk/models/new_incident_event_functionality.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewIncidentEventFunctionality: data (NewIncidentEventFunctionalityData): """ - data: NewIncidentEventFunctionalityData + data: "NewIncidentEventFunctionalityData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_incident_event_functionality_data.py b/rootly_sdk/models/new_incident_event_functionality_data.py index 3f7e2f4d..16c96a63 100644 --- a/rootly_sdk/models/new_incident_event_functionality_data.py +++ b/rootly_sdk/models/new_incident_event_functionality_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class NewIncidentEventFunctionalityData: """ type_: NewIncidentEventFunctionalityDataType - attributes: NewIncidentEventFunctionalityDataAttributes + attributes: "NewIncidentEventFunctionalityDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_incident_event_functionality_data_attributes.py b/rootly_sdk/models/new_incident_event_functionality_data_attributes.py index e14b6383..26cb7912 100644 --- a/rootly_sdk/models/new_incident_event_functionality_data_attributes.py +++ b/rootly_sdk/models/new_incident_event_functionality_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/new_incident_event_service.py b/rootly_sdk/models/new_incident_event_service.py index 95f67979..97f4925c 100644 --- a/rootly_sdk/models/new_incident_event_service.py +++ b/rootly_sdk/models/new_incident_event_service.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewIncidentEventService: data (NewIncidentEventServiceData): """ - data: NewIncidentEventServiceData + data: "NewIncidentEventServiceData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_incident_event_service_data.py b/rootly_sdk/models/new_incident_event_service_data.py index 72500c26..71e69bfd 100644 --- a/rootly_sdk/models/new_incident_event_service_data.py +++ b/rootly_sdk/models/new_incident_event_service_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class NewIncidentEventServiceData: """ type_: NewIncidentEventServiceDataType - attributes: NewIncidentEventServiceDataAttributes + attributes: "NewIncidentEventServiceDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_incident_event_service_data_attributes.py b/rootly_sdk/models/new_incident_event_service_data_attributes.py index 8e2c72b4..7e6413f0 100644 --- a/rootly_sdk/models/new_incident_event_service_data_attributes.py +++ b/rootly_sdk/models/new_incident_event_service_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/new_incident_feedback.py b/rootly_sdk/models/new_incident_feedback.py index d1a89314..93f6dcb0 100644 --- a/rootly_sdk/models/new_incident_feedback.py +++ b/rootly_sdk/models/new_incident_feedback.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewIncidentFeedback: data (NewIncidentFeedbackData): """ - data: NewIncidentFeedbackData + data: "NewIncidentFeedbackData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_incident_feedback_data.py b/rootly_sdk/models/new_incident_feedback_data.py index dbc9e5fe..dfb54c06 100644 --- a/rootly_sdk/models/new_incident_feedback_data.py +++ b/rootly_sdk/models/new_incident_feedback_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class NewIncidentFeedbackData: """ type_: NewIncidentFeedbackDataType - attributes: NewIncidentFeedbackDataAttributes + attributes: "NewIncidentFeedbackDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_incident_feedback_data_attributes.py b/rootly_sdk/models/new_incident_feedback_data_attributes.py index 0f7b6fec..c1691aa8 100644 --- a/rootly_sdk/models/new_incident_feedback_data_attributes.py +++ b/rootly_sdk/models/new_incident_feedback_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define @@ -20,12 +18,12 @@ class NewIncidentFeedbackDataAttributes: Attributes: feedback (str): The feedback of the incident feedback rating (NewIncidentFeedbackDataAttributesRating): The rating of the incident feedback - anonymous (bool | Unset): Is the feedback anonymous? + anonymous (Union[Unset, bool]): Is the feedback anonymous? """ feedback: str rating: NewIncidentFeedbackDataAttributesRating - anonymous: bool | Unset = UNSET + anonymous: Union[Unset, bool] = UNSET def to_dict(self) -> dict[str, Any]: feedback = self.feedback diff --git a/rootly_sdk/models/new_incident_form_field_selection.py b/rootly_sdk/models/new_incident_form_field_selection.py index 6510663e..c3af5a5d 100644 --- a/rootly_sdk/models/new_incident_form_field_selection.py +++ b/rootly_sdk/models/new_incident_form_field_selection.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewIncidentFormFieldSelection: data (NewIncidentFormFieldSelectionData): """ - data: NewIncidentFormFieldSelectionData + data: "NewIncidentFormFieldSelectionData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_incident_form_field_selection_data.py b/rootly_sdk/models/new_incident_form_field_selection_data.py index afba8396..5468b67e 100644 --- a/rootly_sdk/models/new_incident_form_field_selection_data.py +++ b/rootly_sdk/models/new_incident_form_field_selection_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class NewIncidentFormFieldSelectionData: """ type_: NewIncidentFormFieldSelectionDataType - attributes: NewIncidentFormFieldSelectionDataAttributes + attributes: "NewIncidentFormFieldSelectionDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_incident_form_field_selection_data_attributes.py b/rootly_sdk/models/new_incident_form_field_selection_data_attributes.py index 10a4cf9e..e7adc0fd 100644 --- a/rootly_sdk/models/new_incident_form_field_selection_data_attributes.py +++ b/rootly_sdk/models/new_incident_form_field_selection_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -16,75 +14,75 @@ class NewIncidentFormFieldSelectionDataAttributes: Attributes: incident_id (str): form_field_id (str): The custom field for this selection - value (None | str | Unset): The selected value for text kind custom fields - selected_catalog_entity_ids (list[str] | Unset): - selected_group_ids (list[str] | Unset): - selected_option_ids (list[str] | Unset): - selected_service_ids (list[str] | Unset): - selected_functionality_ids (list[str] | Unset): - selected_user_ids (list[int] | Unset): - selected_environment_ids (list[str] | Unset): - selected_cause_ids (list[str] | Unset): - selected_incident_type_ids (list[str] | Unset): + value (Union[None, Unset, str]): The selected value for text kind custom fields + selected_catalog_entity_ids (Union[Unset, list[str]]): + selected_group_ids (Union[Unset, list[str]]): + selected_option_ids (Union[Unset, list[str]]): + selected_service_ids (Union[Unset, list[str]]): + selected_functionality_ids (Union[Unset, list[str]]): + selected_user_ids (Union[Unset, list[int]]): + selected_environment_ids (Union[Unset, list[str]]): + selected_cause_ids (Union[Unset, list[str]]): + selected_incident_type_ids (Union[Unset, list[str]]): """ incident_id: str form_field_id: str - value: None | str | Unset = UNSET - selected_catalog_entity_ids: list[str] | Unset = UNSET - selected_group_ids: list[str] | Unset = UNSET - selected_option_ids: list[str] | Unset = UNSET - selected_service_ids: list[str] | Unset = UNSET - selected_functionality_ids: list[str] | Unset = UNSET - selected_user_ids: list[int] | Unset = UNSET - selected_environment_ids: list[str] | Unset = UNSET - selected_cause_ids: list[str] | Unset = UNSET - selected_incident_type_ids: list[str] | Unset = UNSET + value: Union[None, Unset, str] = UNSET + selected_catalog_entity_ids: Union[Unset, list[str]] = UNSET + selected_group_ids: Union[Unset, list[str]] = UNSET + selected_option_ids: Union[Unset, list[str]] = UNSET + selected_service_ids: Union[Unset, list[str]] = UNSET + selected_functionality_ids: Union[Unset, list[str]] = UNSET + selected_user_ids: Union[Unset, list[int]] = UNSET + selected_environment_ids: Union[Unset, list[str]] = UNSET + selected_cause_ids: Union[Unset, list[str]] = UNSET + selected_incident_type_ids: Union[Unset, list[str]] = UNSET def to_dict(self) -> dict[str, Any]: incident_id = self.incident_id form_field_id = self.form_field_id - value: None | str | Unset + value: Union[None, Unset, str] if isinstance(self.value, Unset): value = UNSET else: value = self.value - selected_catalog_entity_ids: list[str] | Unset = UNSET + selected_catalog_entity_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.selected_catalog_entity_ids, Unset): selected_catalog_entity_ids = self.selected_catalog_entity_ids - selected_group_ids: list[str] | Unset = UNSET + selected_group_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.selected_group_ids, Unset): selected_group_ids = self.selected_group_ids - selected_option_ids: list[str] | Unset = UNSET + selected_option_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.selected_option_ids, Unset): selected_option_ids = self.selected_option_ids - selected_service_ids: list[str] | Unset = UNSET + selected_service_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.selected_service_ids, Unset): selected_service_ids = self.selected_service_ids - selected_functionality_ids: list[str] | Unset = UNSET + selected_functionality_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.selected_functionality_ids, Unset): selected_functionality_ids = self.selected_functionality_ids - selected_user_ids: list[int] | Unset = UNSET + selected_user_ids: Union[Unset, list[int]] = UNSET if not isinstance(self.selected_user_ids, Unset): selected_user_ids = self.selected_user_ids - selected_environment_ids: list[str] | Unset = UNSET + selected_environment_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.selected_environment_ids, Unset): selected_environment_ids = self.selected_environment_ids - selected_cause_ids: list[str] | Unset = UNSET + selected_cause_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.selected_cause_ids, Unset): selected_cause_ids = self.selected_cause_ids - selected_incident_type_ids: list[str] | Unset = UNSET + selected_incident_type_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.selected_incident_type_ids, Unset): selected_incident_type_ids = self.selected_incident_type_ids @@ -126,12 +124,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: form_field_id = d.pop("form_field_id") - def _parse_value(data: object) -> None | str | Unset: + def _parse_value(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) value = _parse_value(d.pop("value", UNSET)) diff --git a/rootly_sdk/models/new_incident_permission_set.py b/rootly_sdk/models/new_incident_permission_set.py index ea88d5ab..a6e79085 100644 --- a/rootly_sdk/models/new_incident_permission_set.py +++ b/rootly_sdk/models/new_incident_permission_set.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewIncidentPermissionSet: data (NewIncidentPermissionSetData): """ - data: NewIncidentPermissionSetData + data: "NewIncidentPermissionSetData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_incident_permission_set_boolean.py b/rootly_sdk/models/new_incident_permission_set_boolean.py index 7fabf216..5cb940b0 100644 --- a/rootly_sdk/models/new_incident_permission_set_boolean.py +++ b/rootly_sdk/models/new_incident_permission_set_boolean.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewIncidentPermissionSetBoolean: data (NewIncidentPermissionSetBooleanData): """ - data: NewIncidentPermissionSetBooleanData + data: "NewIncidentPermissionSetBooleanData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_incident_permission_set_boolean_data.py b/rootly_sdk/models/new_incident_permission_set_boolean_data.py index f522dff8..616b4b97 100644 --- a/rootly_sdk/models/new_incident_permission_set_boolean_data.py +++ b/rootly_sdk/models/new_incident_permission_set_boolean_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class NewIncidentPermissionSetBooleanData: """ type_: NewIncidentPermissionSetBooleanDataType - attributes: NewIncidentPermissionSetBooleanDataAttributes + attributes: "NewIncidentPermissionSetBooleanDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_incident_permission_set_boolean_data_attributes.py b/rootly_sdk/models/new_incident_permission_set_boolean_data_attributes.py index 6b11f358..446e4fb2 100644 --- a/rootly_sdk/models/new_incident_permission_set_boolean_data_attributes.py +++ b/rootly_sdk/models/new_incident_permission_set_boolean_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define @@ -26,19 +24,18 @@ class NewIncidentPermissionSetBooleanDataAttributes: Attributes: incident_permission_set_id (str): kind (NewIncidentPermissionSetBooleanDataAttributesKind): - private (bool | Unset): - enabled (bool | Unset): - severity_params (NewIncidentPermissionSetBooleanDataAttributesSeverityParams | Unset): + private (Union[Unset, bool]): + enabled (Union[Unset, bool]): + severity_params (Union[Unset, NewIncidentPermissionSetBooleanDataAttributesSeverityParams]): """ incident_permission_set_id: str kind: NewIncidentPermissionSetBooleanDataAttributesKind - private: bool | Unset = UNSET - enabled: bool | Unset = UNSET - severity_params: NewIncidentPermissionSetBooleanDataAttributesSeverityParams | Unset = UNSET + private: Union[Unset, bool] = UNSET + enabled: Union[Unset, bool] = UNSET + severity_params: Union[Unset, "NewIncidentPermissionSetBooleanDataAttributesSeverityParams"] = UNSET def to_dict(self) -> dict[str, Any]: - incident_permission_set_id = self.incident_permission_set_id kind: str = self.kind @@ -47,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: enabled = self.enabled - severity_params: dict[str, Any] | Unset = UNSET + severity_params: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.severity_params, Unset): severity_params = self.severity_params.to_dict() @@ -84,7 +81,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: enabled = d.pop("enabled", UNSET) _severity_params = d.pop("severity_params", UNSET) - severity_params: NewIncidentPermissionSetBooleanDataAttributesSeverityParams | Unset + severity_params: Union[Unset, NewIncidentPermissionSetBooleanDataAttributesSeverityParams] if isinstance(_severity_params, Unset): severity_params = UNSET else: diff --git a/rootly_sdk/models/new_incident_permission_set_boolean_data_attributes_severity_params.py b/rootly_sdk/models/new_incident_permission_set_boolean_data_attributes_severity_params.py index 8785fea3..17f2f0de 100644 --- a/rootly_sdk/models/new_incident_permission_set_boolean_data_attributes_severity_params.py +++ b/rootly_sdk/models/new_incident_permission_set_boolean_data_attributes_severity_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,18 +13,18 @@ class NewIncidentPermissionSetBooleanDataAttributesSeverityParams: """ Attributes: - fully_enabled (bool | Unset): Whether permissions are enabled for any severity incident Default: True. - create_enabled (bool | Unset): Whether permissions are enabled when creating incident Default: False. - applies_to_unassigned (bool | Unset): Whether permissions are enabled for incident without severity Default: - True. - severity_ids (list[str] | None | Unset): Severity ids that determine if an incident is permitted based on + fully_enabled (Union[Unset, bool]): Whether permissions are enabled for any severity incident Default: True. + create_enabled (Union[Unset, bool]): Whether permissions are enabled when creating incident Default: False. + applies_to_unassigned (Union[Unset, bool]): Whether permissions are enabled for incident without severity + Default: True. + severity_ids (Union[None, Unset, list[str]]): Severity ids that determine if an incident is permitted based on matching severity """ - fully_enabled: bool | Unset = True - create_enabled: bool | Unset = False - applies_to_unassigned: bool | Unset = True - severity_ids: list[str] | None | Unset = UNSET + fully_enabled: Union[Unset, bool] = True + create_enabled: Union[Unset, bool] = False + applies_to_unassigned: Union[Unset, bool] = True + severity_ids: Union[None, Unset, list[str]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -36,7 +34,7 @@ def to_dict(self) -> dict[str, Any]: applies_to_unassigned = self.applies_to_unassigned - severity_ids: list[str] | None | Unset + severity_ids: Union[None, Unset, list[str]] if isinstance(self.severity_ids, Unset): severity_ids = UNSET elif isinstance(self.severity_ids, list): @@ -68,7 +66,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: applies_to_unassigned = d.pop("applies_to_unassigned", UNSET) - def _parse_severity_ids(data: object) -> list[str] | None | Unset: + def _parse_severity_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -79,9 +77,9 @@ def _parse_severity_ids(data: object) -> list[str] | None | Unset: severity_ids_type_0 = cast(list[str], data) return severity_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) severity_ids = _parse_severity_ids(d.pop("severity_ids", UNSET)) diff --git a/rootly_sdk/models/new_incident_permission_set_data.py b/rootly_sdk/models/new_incident_permission_set_data.py index fb6362a2..a4a36ed2 100644 --- a/rootly_sdk/models/new_incident_permission_set_data.py +++ b/rootly_sdk/models/new_incident_permission_set_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class NewIncidentPermissionSetData: """ type_: NewIncidentPermissionSetDataType - attributes: NewIncidentPermissionSetDataAttributes + attributes: "NewIncidentPermissionSetDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_incident_permission_set_data_attributes.py b/rootly_sdk/models/new_incident_permission_set_data_attributes.py index 6da0aeb4..5765511f 100644 --- a/rootly_sdk/models/new_incident_permission_set_data_attributes.py +++ b/rootly_sdk/models/new_incident_permission_set_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -23,38 +21,48 @@ class NewIncidentPermissionSetDataAttributes: """ Attributes: name (str): The incident permission set name. - description (None | str | Unset): The incident permission set description. - private_incident_permissions (list[NewIncidentPermissionSetDataAttributesPrivateIncidentPermissionsItem] | - Unset): - public_incident_permissions (list[NewIncidentPermissionSetDataAttributesPublicIncidentPermissionsItem] | Unset): + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + description (Union[None, Unset, str]): The incident permission set description. + private_incident_permissions (Union[Unset, + list[NewIncidentPermissionSetDataAttributesPrivateIncidentPermissionsItem]]): + public_incident_permissions (Union[Unset, + list[NewIncidentPermissionSetDataAttributesPublicIncidentPermissionsItem]]): """ name: str - description: None | str | Unset = UNSET - private_incident_permissions: list[NewIncidentPermissionSetDataAttributesPrivateIncidentPermissionsItem] | Unset = ( - UNSET - ) - public_incident_permissions: list[NewIncidentPermissionSetDataAttributesPublicIncidentPermissionsItem] | Unset = ( - UNSET - ) + slug: Union[None, Unset, str] = UNSET + description: Union[None, Unset, str] = UNSET + private_incident_permissions: Union[ + Unset, list[NewIncidentPermissionSetDataAttributesPrivateIncidentPermissionsItem] + ] = UNSET + public_incident_permissions: Union[ + Unset, list[NewIncidentPermissionSetDataAttributesPublicIncidentPermissionsItem] + ] = UNSET def to_dict(self) -> dict[str, Any]: name = self.name - description: None | str | Unset + slug: Union[None, Unset, str] + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug + + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: description = self.description - private_incident_permissions: list[str] | Unset = UNSET + private_incident_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.private_incident_permissions, Unset): private_incident_permissions = [] for private_incident_permissions_item_data in self.private_incident_permissions: private_incident_permissions_item: str = private_incident_permissions_item_data private_incident_permissions.append(private_incident_permissions_item) - public_incident_permissions: list[str] | Unset = UNSET + public_incident_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.public_incident_permissions, Unset): public_incident_permissions = [] for public_incident_permissions_item_data in self.public_incident_permissions: @@ -68,6 +76,8 @@ def to_dict(self) -> dict[str, Any]: "name": name, } ) + if slug is not UNSET: + field_dict["slug"] = slug if description is not UNSET: field_dict["description"] = description if private_incident_permissions is not UNSET: @@ -82,47 +92,49 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name") - def _parse_description(data: object) -> None | str | Unset: + def _parse_slug(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) + + slug = _parse_slug(d.pop("slug", UNSET)) + + def _parse_description(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) + private_incident_permissions = [] _private_incident_permissions = d.pop("private_incident_permissions", UNSET) - private_incident_permissions: ( - list[NewIncidentPermissionSetDataAttributesPrivateIncidentPermissionsItem] | Unset - ) = UNSET - if _private_incident_permissions is not UNSET: - private_incident_permissions = [] - for private_incident_permissions_item_data in _private_incident_permissions: - private_incident_permissions_item = ( - check_new_incident_permission_set_data_attributes_private_incident_permissions_item( - private_incident_permissions_item_data - ) + for private_incident_permissions_item_data in _private_incident_permissions or []: + private_incident_permissions_item = ( + check_new_incident_permission_set_data_attributes_private_incident_permissions_item( + private_incident_permissions_item_data ) + ) - private_incident_permissions.append(private_incident_permissions_item) + private_incident_permissions.append(private_incident_permissions_item) + public_incident_permissions = [] _public_incident_permissions = d.pop("public_incident_permissions", UNSET) - public_incident_permissions: ( - list[NewIncidentPermissionSetDataAttributesPublicIncidentPermissionsItem] | Unset - ) = UNSET - if _public_incident_permissions is not UNSET: - public_incident_permissions = [] - for public_incident_permissions_item_data in _public_incident_permissions: - public_incident_permissions_item = ( - check_new_incident_permission_set_data_attributes_public_incident_permissions_item( - public_incident_permissions_item_data - ) + for public_incident_permissions_item_data in _public_incident_permissions or []: + public_incident_permissions_item = ( + check_new_incident_permission_set_data_attributes_public_incident_permissions_item( + public_incident_permissions_item_data ) + ) - public_incident_permissions.append(public_incident_permissions_item) + public_incident_permissions.append(public_incident_permissions_item) new_incident_permission_set_data_attributes = cls( name=name, + slug=slug, description=description, private_incident_permissions=private_incident_permissions, public_incident_permissions=public_incident_permissions, diff --git a/rootly_sdk/models/new_incident_permission_set_resource.py b/rootly_sdk/models/new_incident_permission_set_resource.py index 409075ea..df9037a6 100644 --- a/rootly_sdk/models/new_incident_permission_set_resource.py +++ b/rootly_sdk/models/new_incident_permission_set_resource.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewIncidentPermissionSetResource: data (NewIncidentPermissionSetResourceData): """ - data: NewIncidentPermissionSetResourceData + data: "NewIncidentPermissionSetResourceData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_incident_permission_set_resource_data.py b/rootly_sdk/models/new_incident_permission_set_resource_data.py index 6e0dc6ca..e42e991f 100644 --- a/rootly_sdk/models/new_incident_permission_set_resource_data.py +++ b/rootly_sdk/models/new_incident_permission_set_resource_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class NewIncidentPermissionSetResourceData: """ type_: NewIncidentPermissionSetResourceDataType - attributes: NewIncidentPermissionSetResourceDataAttributes + attributes: "NewIncidentPermissionSetResourceDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_incident_permission_set_resource_data_attributes.py b/rootly_sdk/models/new_incident_permission_set_resource_data_attributes.py index 4ed0a0bf..82ff2824 100644 --- a/rootly_sdk/models/new_incident_permission_set_resource_data_attributes.py +++ b/rootly_sdk/models/new_incident_permission_set_resource_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define @@ -26,21 +24,20 @@ class NewIncidentPermissionSetResourceDataAttributes: Attributes: incident_permission_set_id (str): kind (NewIncidentPermissionSetResourceDataAttributesKind): - private (bool | Unset): - resource_id (str | Unset): - resource_type (str | Unset): - severity_params (NewIncidentPermissionSetResourceDataAttributesSeverityParams | Unset): + private (Union[Unset, bool]): + resource_id (Union[Unset, str]): + resource_type (Union[Unset, str]): + severity_params (Union[Unset, NewIncidentPermissionSetResourceDataAttributesSeverityParams]): """ incident_permission_set_id: str kind: NewIncidentPermissionSetResourceDataAttributesKind - private: bool | Unset = UNSET - resource_id: str | Unset = UNSET - resource_type: str | Unset = UNSET - severity_params: NewIncidentPermissionSetResourceDataAttributesSeverityParams | Unset = UNSET + private: Union[Unset, bool] = UNSET + resource_id: Union[Unset, str] = UNSET + resource_type: Union[Unset, str] = UNSET + severity_params: Union[Unset, "NewIncidentPermissionSetResourceDataAttributesSeverityParams"] = UNSET def to_dict(self) -> dict[str, Any]: - incident_permission_set_id = self.incident_permission_set_id kind: str = self.kind @@ -51,7 +48,7 @@ def to_dict(self) -> dict[str, Any]: resource_type = self.resource_type - severity_params: dict[str, Any] | Unset = UNSET + severity_params: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.severity_params, Unset): severity_params = self.severity_params.to_dict() @@ -92,7 +89,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: resource_type = d.pop("resource_type", UNSET) _severity_params = d.pop("severity_params", UNSET) - severity_params: NewIncidentPermissionSetResourceDataAttributesSeverityParams | Unset + severity_params: Union[Unset, NewIncidentPermissionSetResourceDataAttributesSeverityParams] if isinstance(_severity_params, Unset): severity_params = UNSET else: diff --git a/rootly_sdk/models/new_incident_permission_set_resource_data_attributes_severity_params.py b/rootly_sdk/models/new_incident_permission_set_resource_data_attributes_severity_params.py index c5db1e9f..72c8ef82 100644 --- a/rootly_sdk/models/new_incident_permission_set_resource_data_attributes_severity_params.py +++ b/rootly_sdk/models/new_incident_permission_set_resource_data_attributes_severity_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,18 +13,18 @@ class NewIncidentPermissionSetResourceDataAttributesSeverityParams: """ Attributes: - fully_enabled (bool | Unset): Whether permissions are enabled for any severity incident Default: True. - create_enabled (bool | Unset): Whether permissions are enabled when creating incident Default: False. - applies_to_unassigned (bool | Unset): Whether permissions are enabled for incident without severity Default: - True. - severity_ids (list[str] | None | Unset): Severity ids that determine if an incident is permitted based on + fully_enabled (Union[Unset, bool]): Whether permissions are enabled for any severity incident Default: True. + create_enabled (Union[Unset, bool]): Whether permissions are enabled when creating incident Default: False. + applies_to_unassigned (Union[Unset, bool]): Whether permissions are enabled for incident without severity + Default: True. + severity_ids (Union[None, Unset, list[str]]): Severity ids that determine if an incident is permitted based on matching severity """ - fully_enabled: bool | Unset = True - create_enabled: bool | Unset = False - applies_to_unassigned: bool | Unset = True - severity_ids: list[str] | None | Unset = UNSET + fully_enabled: Union[Unset, bool] = True + create_enabled: Union[Unset, bool] = False + applies_to_unassigned: Union[Unset, bool] = True + severity_ids: Union[None, Unset, list[str]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -36,7 +34,7 @@ def to_dict(self) -> dict[str, Any]: applies_to_unassigned = self.applies_to_unassigned - severity_ids: list[str] | None | Unset + severity_ids: Union[None, Unset, list[str]] if isinstance(self.severity_ids, Unset): severity_ids = UNSET elif isinstance(self.severity_ids, list): @@ -68,7 +66,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: applies_to_unassigned = d.pop("applies_to_unassigned", UNSET) - def _parse_severity_ids(data: object) -> list[str] | None | Unset: + def _parse_severity_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -79,9 +77,9 @@ def _parse_severity_ids(data: object) -> list[str] | None | Unset: severity_ids_type_0 = cast(list[str], data) return severity_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) severity_ids = _parse_severity_ids(d.pop("severity_ids", UNSET)) diff --git a/rootly_sdk/models/new_incident_role.py b/rootly_sdk/models/new_incident_role.py index 0904e87b..6638789a 100644 --- a/rootly_sdk/models/new_incident_role.py +++ b/rootly_sdk/models/new_incident_role.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewIncidentRole: data (NewIncidentRoleData): """ - data: NewIncidentRoleData + data: "NewIncidentRoleData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_incident_role_data.py b/rootly_sdk/models/new_incident_role_data.py index 1611d57e..b7be2d03 100644 --- a/rootly_sdk/models/new_incident_role_data.py +++ b/rootly_sdk/models/new_incident_role_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class NewIncidentRoleData: """ type_: NewIncidentRoleDataType - attributes: NewIncidentRoleDataAttributes + attributes: "NewIncidentRoleDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_incident_role_data_attributes.py b/rootly_sdk/models/new_incident_role_data_attributes.py index bdf3cc53..50825d41 100644 --- a/rootly_sdk/models/new_incident_role_data_attributes.py +++ b/rootly_sdk/models/new_incident_role_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -15,38 +13,47 @@ class NewIncidentRoleDataAttributes: """ Attributes: name (str): The name of the incident role - summary (None | str | Unset): The summary of the incident role - description (None | str | Unset): The description of the incident role - position (int | None | Unset): Position of the incident role - optional (bool | Unset): - enabled (bool | Unset): - allow_multi_user_assignment (bool | Unset): + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + summary (Union[None, Unset, str]): The summary of the incident role + description (Union[None, Unset, str]): The description of the incident role + position (Union[None, Unset, int]): Position of the incident role + optional (Union[Unset, bool]): + enabled (Union[Unset, bool]): + allow_multi_user_assignment (Union[Unset, bool]): """ name: str - summary: None | str | Unset = UNSET - description: None | str | Unset = UNSET - position: int | None | Unset = UNSET - optional: bool | Unset = UNSET - enabled: bool | Unset = UNSET - allow_multi_user_assignment: bool | Unset = UNSET + slug: Union[None, Unset, str] = UNSET + summary: Union[None, Unset, str] = UNSET + description: Union[None, Unset, str] = UNSET + position: Union[None, Unset, int] = UNSET + optional: Union[Unset, bool] = UNSET + enabled: Union[Unset, bool] = UNSET + allow_multi_user_assignment: Union[Unset, bool] = UNSET def to_dict(self) -> dict[str, Any]: name = self.name - summary: None | str | Unset + slug: Union[None, Unset, str] + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug + + summary: Union[None, Unset, str] if isinstance(self.summary, Unset): summary = UNSET else: summary = self.summary - description: None | str | Unset + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: description = self.description - position: int | None | Unset + position: Union[None, Unset, int] if isinstance(self.position, Unset): position = UNSET else: @@ -65,6 +72,8 @@ def to_dict(self) -> dict[str, Any]: "name": name, } ) + if slug is not UNSET: + field_dict["slug"] = slug if summary is not UNSET: field_dict["summary"] = summary if description is not UNSET: @@ -85,30 +94,39 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name") - def _parse_summary(data: object) -> None | str | Unset: + def _parse_slug(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + slug = _parse_slug(d.pop("slug", UNSET)) + + def _parse_summary(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) summary = _parse_summary(d.pop("summary", UNSET)) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> Union[None, Unset, int]: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(Union[None, Unset, int], data) position = _parse_position(d.pop("position", UNSET)) @@ -120,6 +138,7 @@ def _parse_position(data: object) -> int | None | Unset: new_incident_role_data_attributes = cls( name=name, + slug=slug, summary=summary, description=description, position=position, diff --git a/rootly_sdk/models/new_incident_role_task.py b/rootly_sdk/models/new_incident_role_task.py index b5513090..b9c26306 100644 --- a/rootly_sdk/models/new_incident_role_task.py +++ b/rootly_sdk/models/new_incident_role_task.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewIncidentRoleTask: data (NewIncidentRoleTaskData): """ - data: NewIncidentRoleTaskData + data: "NewIncidentRoleTaskData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_incident_role_task_data.py b/rootly_sdk/models/new_incident_role_task_data.py index 35bda731..47f96898 100644 --- a/rootly_sdk/models/new_incident_role_task_data.py +++ b/rootly_sdk/models/new_incident_role_task_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class NewIncidentRoleTaskData: """ type_: NewIncidentRoleTaskDataType - attributes: NewIncidentRoleTaskDataAttributes + attributes: "NewIncidentRoleTaskDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_incident_role_task_data_attributes.py b/rootly_sdk/models/new_incident_role_task_data_attributes.py index 9de0da86..b7b5b260 100644 --- a/rootly_sdk/models/new_incident_role_task_data_attributes.py +++ b/rootly_sdk/models/new_incident_role_task_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -19,28 +17,28 @@ class NewIncidentRoleTaskDataAttributes: """ Attributes: task (str): The task of the incident task - incident_role_id (str | Unset): - description (None | str | Unset): The description of the incident task - priority (NewIncidentRoleTaskDataAttributesPriority | Unset): The priority of the incident task + incident_role_id (Union[Unset, str]): + description (Union[None, Unset, str]): The description of the incident task + priority (Union[Unset, NewIncidentRoleTaskDataAttributesPriority]): The priority of the incident task """ task: str - incident_role_id: str | Unset = UNSET - description: None | str | Unset = UNSET - priority: NewIncidentRoleTaskDataAttributesPriority | Unset = UNSET + incident_role_id: Union[Unset, str] = UNSET + description: Union[None, Unset, str] = UNSET + priority: Union[Unset, NewIncidentRoleTaskDataAttributesPriority] = UNSET def to_dict(self) -> dict[str, Any]: task = self.task incident_role_id = self.incident_role_id - description: None | str | Unset + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: description = self.description - priority: str | Unset = UNSET + priority: Union[Unset, str] = UNSET if not isinstance(self.priority, Unset): priority = self.priority @@ -67,17 +65,17 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: incident_role_id = d.pop("incident_role_id", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) _priority = d.pop("priority", UNSET) - priority: NewIncidentRoleTaskDataAttributesPriority | Unset + priority: Union[Unset, NewIncidentRoleTaskDataAttributesPriority] if isinstance(_priority, Unset): priority = UNSET else: diff --git a/rootly_sdk/models/new_incident_status_page_event.py b/rootly_sdk/models/new_incident_status_page_event.py index 87aec609..084ae8e3 100644 --- a/rootly_sdk/models/new_incident_status_page_event.py +++ b/rootly_sdk/models/new_incident_status_page_event.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewIncidentStatusPageEvent: data (NewIncidentStatusPageEventData): """ - data: NewIncidentStatusPageEventData + data: "NewIncidentStatusPageEventData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_incident_status_page_event_data.py b/rootly_sdk/models/new_incident_status_page_event_data.py index 14e5a75a..2eb740df 100644 --- a/rootly_sdk/models/new_incident_status_page_event_data.py +++ b/rootly_sdk/models/new_incident_status_page_event_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class NewIncidentStatusPageEventData: """ type_: NewIncidentStatusPageEventDataType - attributes: NewIncidentStatusPageEventDataAttributes + attributes: "NewIncidentStatusPageEventDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_incident_status_page_event_data_attributes.py b/rootly_sdk/models/new_incident_status_page_event_data_attributes.py index 528e5f80..f1ecd25c 100644 --- a/rootly_sdk/models/new_incident_status_page_event_data_attributes.py +++ b/rootly_sdk/models/new_incident_status_page_event_data_attributes.py @@ -1,8 +1,6 @@ -from __future__ import annotations - import datetime from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from dateutil.parser import isoparse @@ -13,6 +11,12 @@ ) from ..types import UNSET, Unset +if TYPE_CHECKING: + from ..models.new_incident_status_page_event_data_attributes_status_page_components_type_0_item import ( + NewIncidentStatusPageEventDataAttributesStatusPageComponentsType0Item, + ) + + T = TypeVar("T", bound="NewIncidentStatusPageEventDataAttributes") @@ -21,43 +25,51 @@ class NewIncidentStatusPageEventDataAttributes: """ Attributes: event (str): The summary of the incident event - status_page_id (str | Unset): Unique ID of the status page you wish to post the event to - status (NewIncidentStatusPageEventDataAttributesStatus | Unset): The status of the incident event - notify_subscribers (bool | None | Unset): Notify all status pages subscribers Default: False. - should_tweet (bool | None | Unset): For Statuspage.io integrated pages auto publishes a tweet for your update - Default: False. - started_at (datetime.datetime | None | Unset): When the event started. Defaults to the time of creation. + status_page_id (Union[Unset, str]): Unique ID of the status page you wish to post the event to + status (Union[Unset, NewIncidentStatusPageEventDataAttributesStatus]): The status of the incident event + notify_subscribers (Union[None, Unset, bool]): Notify all status pages subscribers Default: False. + should_tweet (Union[None, Unset, bool]): For Statuspage.io integrated pages auto publishes a tweet for your + update Default: False. + started_at (Union[None, Unset, datetime.datetime]): When the event started. Defaults to the time of creation. + status_page_components (Union[None, Unset, + list['NewIncidentStatusPageEventDataAttributesStatusPageComponentsType0Item']]): Affected status page components + and their statuses. Requires the status-page-v3-phase-1 feature. Ignored for terminal event statuses (resolved, + completed), which clear component impact. A status is required per component except for scheduled maintenance + incidents. """ event: str - status_page_id: str | Unset = UNSET - status: NewIncidentStatusPageEventDataAttributesStatus | Unset = UNSET - notify_subscribers: bool | None | Unset = False - should_tweet: bool | None | Unset = False - started_at: datetime.datetime | None | Unset = UNSET + status_page_id: Union[Unset, str] = UNSET + status: Union[Unset, NewIncidentStatusPageEventDataAttributesStatus] = UNSET + notify_subscribers: Union[None, Unset, bool] = False + should_tweet: Union[None, Unset, bool] = False + started_at: Union[None, Unset, datetime.datetime] = UNSET + status_page_components: Union[ + None, Unset, list["NewIncidentStatusPageEventDataAttributesStatusPageComponentsType0Item"] + ] = UNSET def to_dict(self) -> dict[str, Any]: event = self.event status_page_id = self.status_page_id - status: str | Unset = UNSET + status: Union[Unset, str] = UNSET if not isinstance(self.status, Unset): status = self.status - notify_subscribers: bool | None | Unset + notify_subscribers: Union[None, Unset, bool] if isinstance(self.notify_subscribers, Unset): notify_subscribers = UNSET else: notify_subscribers = self.notify_subscribers - should_tweet: bool | None | Unset + should_tweet: Union[None, Unset, bool] if isinstance(self.should_tweet, Unset): should_tweet = UNSET else: should_tweet = self.should_tweet - started_at: None | str | Unset + started_at: Union[None, Unset, str] if isinstance(self.started_at, Unset): started_at = UNSET elif isinstance(self.started_at, datetime.datetime): @@ -65,6 +77,18 @@ def to_dict(self) -> dict[str, Any]: else: started_at = self.started_at + status_page_components: Union[None, Unset, list[dict[str, Any]]] + if isinstance(self.status_page_components, Unset): + status_page_components = UNSET + elif isinstance(self.status_page_components, list): + status_page_components = [] + for status_page_components_type_0_item_data in self.status_page_components: + status_page_components_type_0_item = status_page_components_type_0_item_data.to_dict() + status_page_components.append(status_page_components_type_0_item) + + else: + status_page_components = self.status_page_components + field_dict: dict[str, Any] = {} field_dict.update( @@ -82,42 +106,48 @@ def to_dict(self) -> dict[str, Any]: field_dict["should_tweet"] = should_tweet if started_at is not UNSET: field_dict["started_at"] = started_at + if status_page_components is not UNSET: + field_dict["status_page_components"] = status_page_components return field_dict @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.new_incident_status_page_event_data_attributes_status_page_components_type_0_item import ( + NewIncidentStatusPageEventDataAttributesStatusPageComponentsType0Item, + ) + d = dict(src_dict) event = d.pop("event") status_page_id = d.pop("status_page_id", UNSET) _status = d.pop("status", UNSET) - status: NewIncidentStatusPageEventDataAttributesStatus | Unset + status: Union[Unset, NewIncidentStatusPageEventDataAttributesStatus] if isinstance(_status, Unset): status = UNSET else: status = check_new_incident_status_page_event_data_attributes_status(_status) - def _parse_notify_subscribers(data: object) -> bool | None | Unset: + def _parse_notify_subscribers(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) notify_subscribers = _parse_notify_subscribers(d.pop("notify_subscribers", UNSET)) - def _parse_should_tweet(data: object) -> bool | None | Unset: + def _parse_should_tweet(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) should_tweet = _parse_should_tweet(d.pop("should_tweet", UNSET)) - def _parse_started_at(data: object) -> datetime.datetime | None | Unset: + def _parse_started_at(data: object) -> Union[None, Unset, datetime.datetime]: if data is None: return data if isinstance(data, Unset): @@ -128,12 +158,42 @@ def _parse_started_at(data: object) -> datetime.datetime | None | Unset: started_at_type_0 = isoparse(data) return started_at_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(datetime.datetime | None | Unset, data) + return cast(Union[None, Unset, datetime.datetime], data) started_at = _parse_started_at(d.pop("started_at", UNSET)) + def _parse_status_page_components( + data: object, + ) -> Union[None, Unset, list["NewIncidentStatusPageEventDataAttributesStatusPageComponentsType0Item"]]: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, list): + raise TypeError() + status_page_components_type_0 = [] + _status_page_components_type_0 = data + for status_page_components_type_0_item_data in _status_page_components_type_0: + status_page_components_type_0_item = ( + NewIncidentStatusPageEventDataAttributesStatusPageComponentsType0Item.from_dict( + status_page_components_type_0_item_data + ) + ) + + status_page_components_type_0.append(status_page_components_type_0_item) + + return status_page_components_type_0 + except: # noqa: E722 + pass + return cast( + Union[None, Unset, list["NewIncidentStatusPageEventDataAttributesStatusPageComponentsType0Item"]], data + ) + + status_page_components = _parse_status_page_components(d.pop("status_page_components", UNSET)) + new_incident_status_page_event_data_attributes = cls( event=event, status_page_id=status_page_id, @@ -141,6 +201,7 @@ def _parse_started_at(data: object) -> datetime.datetime | None | Unset: notify_subscribers=notify_subscribers, should_tweet=should_tweet, started_at=started_at, + status_page_components=status_page_components, ) return new_incident_status_page_event_data_attributes diff --git a/rootly_sdk/models/new_incident_status_page_event_data_attributes_status_page_components_type_0_item.py b/rootly_sdk/models/new_incident_status_page_event_data_attributes_status_page_components_type_0_item.py new file mode 100644 index 00000000..2f6a5959 --- /dev/null +++ b/rootly_sdk/models/new_incident_status_page_event_data_attributes_status_page_components_type_0_item.py @@ -0,0 +1,65 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, Union + +from attrs import define as _attrs_define + +from ..models.new_incident_status_page_event_data_attributes_status_page_components_type_0_item_status import ( + NewIncidentStatusPageEventDataAttributesStatusPageComponentsType0ItemStatus, + check_new_incident_status_page_event_data_attributes_status_page_components_type_0_item_status, +) +from ..types import UNSET, Unset + +T = TypeVar("T", bound="NewIncidentStatusPageEventDataAttributesStatusPageComponentsType0Item") + + +@_attrs_define +class NewIncidentStatusPageEventDataAttributesStatusPageComponentsType0Item: + """ + Attributes: + status_page_component_id (str): Unique ID of a component on the event's status page + status (Union[Unset, NewIncidentStatusPageEventDataAttributesStatusPageComponentsType0ItemStatus]): The status + to record for the component + """ + + status_page_component_id: str + status: Union[Unset, NewIncidentStatusPageEventDataAttributesStatusPageComponentsType0ItemStatus] = UNSET + + def to_dict(self) -> dict[str, Any]: + status_page_component_id = self.status_page_component_id + + status: Union[Unset, str] = UNSET + if not isinstance(self.status, Unset): + status = self.status + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "status_page_component_id": status_page_component_id, + } + ) + if status is not UNSET: + field_dict["status"] = status + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + status_page_component_id = d.pop("status_page_component_id") + + _status = d.pop("status", UNSET) + status: Union[Unset, NewIncidentStatusPageEventDataAttributesStatusPageComponentsType0ItemStatus] + if isinstance(_status, Unset): + status = UNSET + else: + status = check_new_incident_status_page_event_data_attributes_status_page_components_type_0_item_status( + _status + ) + + new_incident_status_page_event_data_attributes_status_page_components_type_0_item = cls( + status_page_component_id=status_page_component_id, + status=status, + ) + + return new_incident_status_page_event_data_attributes_status_page_components_type_0_item diff --git a/rootly_sdk/models/new_incident_status_page_event_data_attributes_status_page_components_type_0_item_status.py b/rootly_sdk/models/new_incident_status_page_event_data_attributes_status_page_components_type_0_item_status.py new file mode 100644 index 00000000..041e8b02 --- /dev/null +++ b/rootly_sdk/models/new_incident_status_page_event_data_attributes_status_page_components_type_0_item_status.py @@ -0,0 +1,26 @@ +from typing import Literal, cast + +NewIncidentStatusPageEventDataAttributesStatusPageComponentsType0ItemStatus = Literal[ + "degraded_performance", "major_outage", "operational", "partial_outage" +] + +NEW_INCIDENT_STATUS_PAGE_EVENT_DATA_ATTRIBUTES_STATUS_PAGE_COMPONENTS_TYPE_0_ITEM_STATUS_VALUES: set[ + NewIncidentStatusPageEventDataAttributesStatusPageComponentsType0ItemStatus +] = { + "degraded_performance", + "major_outage", + "operational", + "partial_outage", +} + + +def check_new_incident_status_page_event_data_attributes_status_page_components_type_0_item_status( + value: str | None, +) -> NewIncidentStatusPageEventDataAttributesStatusPageComponentsType0ItemStatus | None: + if value is None: + return None + if value in NEW_INCIDENT_STATUS_PAGE_EVENT_DATA_ATTRIBUTES_STATUS_PAGE_COMPONENTS_TYPE_0_ITEM_STATUS_VALUES: + return cast(NewIncidentStatusPageEventDataAttributesStatusPageComponentsType0ItemStatus, value) + raise TypeError( + f"Unexpected value {value!r}. Expected one of {NEW_INCIDENT_STATUS_PAGE_EVENT_DATA_ATTRIBUTES_STATUS_PAGE_COMPONENTS_TYPE_0_ITEM_STATUS_VALUES!r}" + ) diff --git a/rootly_sdk/models/new_incident_sub_status.py b/rootly_sdk/models/new_incident_sub_status.py index 6514f78e..8a1dd81b 100644 --- a/rootly_sdk/models/new_incident_sub_status.py +++ b/rootly_sdk/models/new_incident_sub_status.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewIncidentSubStatus: data (NewIncidentSubStatusData): """ - data: NewIncidentSubStatusData + data: "NewIncidentSubStatusData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_incident_sub_status_data.py b/rootly_sdk/models/new_incident_sub_status_data.py index 6124b0a8..7d41ff0f 100644 --- a/rootly_sdk/models/new_incident_sub_status_data.py +++ b/rootly_sdk/models/new_incident_sub_status_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class NewIncidentSubStatusData: """ type_: NewIncidentSubStatusDataType - attributes: NewIncidentSubStatusDataAttributes + attributes: "NewIncidentSubStatusDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_incident_sub_status_data_attributes.py b/rootly_sdk/models/new_incident_sub_status_data_attributes.py index b63d1823..03aadab4 100644 --- a/rootly_sdk/models/new_incident_sub_status_data_attributes.py +++ b/rootly_sdk/models/new_incident_sub_status_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -18,19 +16,19 @@ class NewIncidentSubStatusDataAttributes: sub_status_id attribute. This endpoint is for modifying the timestamp of when an incident's sub-status was assigned. assigned_at (str): - assigned_by_user_id (int | None | Unset): + assigned_by_user_id (Union[None, Unset, int]): """ sub_status_id: str assigned_at: str - assigned_by_user_id: int | None | Unset = UNSET + assigned_by_user_id: Union[None, Unset, int] = UNSET def to_dict(self) -> dict[str, Any]: sub_status_id = self.sub_status_id assigned_at = self.assigned_at - assigned_by_user_id: int | None | Unset + assigned_by_user_id: Union[None, Unset, int] if isinstance(self.assigned_by_user_id, Unset): assigned_by_user_id = UNSET else: @@ -56,12 +54,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: assigned_at = d.pop("assigned_at") - def _parse_assigned_by_user_id(data: object) -> int | None | Unset: + def _parse_assigned_by_user_id(data: object) -> Union[None, Unset, int]: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(Union[None, Unset, int], data) assigned_by_user_id = _parse_assigned_by_user_id(d.pop("assigned_by_user_id", UNSET)) diff --git a/rootly_sdk/models/new_incident_type.py b/rootly_sdk/models/new_incident_type.py index e92d9824..114709ac 100644 --- a/rootly_sdk/models/new_incident_type.py +++ b/rootly_sdk/models/new_incident_type.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewIncidentType: data (NewIncidentTypeData): """ - data: NewIncidentTypeData + data: "NewIncidentTypeData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_incident_type_data.py b/rootly_sdk/models/new_incident_type_data.py index 9409b7a5..59b64a71 100644 --- a/rootly_sdk/models/new_incident_type_data.py +++ b/rootly_sdk/models/new_incident_type_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class NewIncidentTypeData: """ type_: NewIncidentTypeDataType - attributes: NewIncidentTypeDataAttributes + attributes: "NewIncidentTypeDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_incident_type_data_attributes.py b/rootly_sdk/models/new_incident_type_data_attributes.py index 3c96c37c..20c1fffa 100644 --- a/rootly_sdk/models/new_incident_type_data_attributes.py +++ b/rootly_sdk/models/new_incident_type_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -25,50 +23,66 @@ class NewIncidentTypeDataAttributes: """ Attributes: name (str): The name of the incident type - description (None | str | Unset): The description of the incident type - color (None | str | Unset): The hex color of the incident type - position (int | None | Unset): Position of the incident type - notify_emails (list[str] | None | Unset): Emails to attach to the incident type - slack_channels (list[NewIncidentTypeDataAttributesSlackChannelsType0Item] | None | Unset): Slack Channels + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + description (Union[None, Unset, str]): The description of the incident type + public_description (Union[None, Unset, str]): The status page description of the incident type + color (Union[None, Unset, str]): The hex color of the incident type + position (Union[None, Unset, int]): Position of the incident type + notify_emails (Union[None, Unset, list[str]]): Emails to attach to the incident type + slack_channels (Union[None, Unset, list['NewIncidentTypeDataAttributesSlackChannelsType0Item']]): Slack Channels associated with this incident type - slack_aliases (list[NewIncidentTypeDataAttributesSlackAliasesType0Item] | None | Unset): Slack Aliases + slack_aliases (Union[None, Unset, list['NewIncidentTypeDataAttributesSlackAliasesType0Item']]): Slack Aliases associated with this incident type - properties (list[NewIncidentTypeDataAttributesPropertiesItem] | Unset): Array of property values for this - incident type. + properties (Union[Unset, list['NewIncidentTypeDataAttributesPropertiesItem']]): Array of property values for + this incident type. """ name: str - description: None | str | Unset = UNSET - color: None | str | Unset = UNSET - position: int | None | Unset = UNSET - notify_emails: list[str] | None | Unset = UNSET - slack_channels: list[NewIncidentTypeDataAttributesSlackChannelsType0Item] | None | Unset = UNSET - slack_aliases: list[NewIncidentTypeDataAttributesSlackAliasesType0Item] | None | Unset = UNSET - properties: list[NewIncidentTypeDataAttributesPropertiesItem] | Unset = UNSET + slug: Union[None, Unset, str] = UNSET + description: Union[None, Unset, str] = UNSET + public_description: Union[None, Unset, str] = UNSET + color: Union[None, Unset, str] = UNSET + position: Union[None, Unset, int] = UNSET + notify_emails: Union[None, Unset, list[str]] = UNSET + slack_channels: Union[None, Unset, list["NewIncidentTypeDataAttributesSlackChannelsType0Item"]] = UNSET + slack_aliases: Union[None, Unset, list["NewIncidentTypeDataAttributesSlackAliasesType0Item"]] = UNSET + properties: Union[Unset, list["NewIncidentTypeDataAttributesPropertiesItem"]] = UNSET def to_dict(self) -> dict[str, Any]: - name = self.name - description: None | str | Unset + slug: Union[None, Unset, str] + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug + + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: description = self.description - color: None | str | Unset + public_description: Union[None, Unset, str] + if isinstance(self.public_description, Unset): + public_description = UNSET + else: + public_description = self.public_description + + color: Union[None, Unset, str] if isinstance(self.color, Unset): color = UNSET else: color = self.color - position: int | None | Unset + position: Union[None, Unset, int] if isinstance(self.position, Unset): position = UNSET else: position = self.position - notify_emails: list[str] | None | Unset + notify_emails: Union[None, Unset, list[str]] if isinstance(self.notify_emails, Unset): notify_emails = UNSET elif isinstance(self.notify_emails, list): @@ -77,7 +91,7 @@ def to_dict(self) -> dict[str, Any]: else: notify_emails = self.notify_emails - slack_channels: list[dict[str, Any]] | None | Unset + slack_channels: Union[None, Unset, list[dict[str, Any]]] if isinstance(self.slack_channels, Unset): slack_channels = UNSET elif isinstance(self.slack_channels, list): @@ -89,7 +103,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_channels = self.slack_channels - slack_aliases: list[dict[str, Any]] | None | Unset + slack_aliases: Union[None, Unset, list[dict[str, Any]]] if isinstance(self.slack_aliases, Unset): slack_aliases = UNSET elif isinstance(self.slack_aliases, list): @@ -101,7 +115,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_aliases = self.slack_aliases - properties: list[dict[str, Any]] | Unset = UNSET + properties: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.properties, Unset): properties = [] for properties_item_data in self.properties: @@ -115,8 +129,12 @@ def to_dict(self) -> dict[str, Any]: "name": name, } ) + if slug is not UNSET: + field_dict["slug"] = slug if description is not UNSET: field_dict["description"] = description + if public_description is not UNSET: + field_dict["public_description"] = public_description if color is not UNSET: field_dict["color"] = color if position is not UNSET: @@ -147,34 +165,52 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name") - def _parse_description(data: object) -> None | str | Unset: + def _parse_slug(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + slug = _parse_slug(d.pop("slug", UNSET)) + + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) - def _parse_color(data: object) -> None | str | Unset: + def _parse_public_description(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + public_description = _parse_public_description(d.pop("public_description", UNSET)) + + def _parse_color(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) color = _parse_color(d.pop("color", UNSET)) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> Union[None, Unset, int]: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(Union[None, Unset, int], data) position = _parse_position(d.pop("position", UNSET)) - def _parse_notify_emails(data: object) -> list[str] | None | Unset: + def _parse_notify_emails(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -185,15 +221,15 @@ def _parse_notify_emails(data: object) -> list[str] | None | Unset: notify_emails_type_0 = cast(list[str], data) return notify_emails_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) notify_emails = _parse_notify_emails(d.pop("notify_emails", UNSET)) def _parse_slack_channels( data: object, - ) -> list[NewIncidentTypeDataAttributesSlackChannelsType0Item] | None | Unset: + ) -> Union[None, Unset, list["NewIncidentTypeDataAttributesSlackChannelsType0Item"]]: if data is None: return data if isinstance(data, Unset): @@ -211,15 +247,15 @@ def _parse_slack_channels( slack_channels_type_0.append(slack_channels_type_0_item) return slack_channels_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[NewIncidentTypeDataAttributesSlackChannelsType0Item] | None | Unset, data) + return cast(Union[None, Unset, list["NewIncidentTypeDataAttributesSlackChannelsType0Item"]], data) slack_channels = _parse_slack_channels(d.pop("slack_channels", UNSET)) def _parse_slack_aliases( data: object, - ) -> list[NewIncidentTypeDataAttributesSlackAliasesType0Item] | None | Unset: + ) -> Union[None, Unset, list["NewIncidentTypeDataAttributesSlackAliasesType0Item"]]: if data is None: return data if isinstance(data, Unset): @@ -237,24 +273,24 @@ def _parse_slack_aliases( slack_aliases_type_0.append(slack_aliases_type_0_item) return slack_aliases_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[NewIncidentTypeDataAttributesSlackAliasesType0Item] | None | Unset, data) + return cast(Union[None, Unset, list["NewIncidentTypeDataAttributesSlackAliasesType0Item"]], data) slack_aliases = _parse_slack_aliases(d.pop("slack_aliases", UNSET)) + properties = [] _properties = d.pop("properties", UNSET) - properties: list[NewIncidentTypeDataAttributesPropertiesItem] | Unset = UNSET - if _properties is not UNSET: - properties = [] - for properties_item_data in _properties: - properties_item = NewIncidentTypeDataAttributesPropertiesItem.from_dict(properties_item_data) + for properties_item_data in _properties or []: + properties_item = NewIncidentTypeDataAttributesPropertiesItem.from_dict(properties_item_data) - properties.append(properties_item) + properties.append(properties_item) new_incident_type_data_attributes = cls( name=name, + slug=slug, description=description, + public_description=public_description, color=color, position=position, notify_emails=notify_emails, diff --git a/rootly_sdk/models/new_incident_type_data_attributes_properties_item.py b/rootly_sdk/models/new_incident_type_data_attributes_properties_item.py index 5d2658eb..87ffc52a 100644 --- a/rootly_sdk/models/new_incident_type_data_attributes_properties_item.py +++ b/rootly_sdk/models/new_incident_type_data_attributes_properties_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/new_incident_type_data_attributes_slack_aliases_type_0_item.py b/rootly_sdk/models/new_incident_type_data_attributes_slack_aliases_type_0_item.py index 99bf6dd1..3bb39fbe 100644 --- a/rootly_sdk/models/new_incident_type_data_attributes_slack_aliases_type_0_item.py +++ b/rootly_sdk/models/new_incident_type_data_attributes_slack_aliases_type_0_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/new_incident_type_data_attributes_slack_channels_type_0_item.py b/rootly_sdk/models/new_incident_type_data_attributes_slack_channels_type_0_item.py index 722bc1fe..b7bde900 100644 --- a/rootly_sdk/models/new_incident_type_data_attributes_slack_channels_type_0_item.py +++ b/rootly_sdk/models/new_incident_type_data_attributes_slack_channels_type_0_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/new_live_call_router.py b/rootly_sdk/models/new_live_call_router.py index bafd6e61..6bc1a616 100644 --- a/rootly_sdk/models/new_live_call_router.py +++ b/rootly_sdk/models/new_live_call_router.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewLiveCallRouter: data (NewLiveCallRouterData): """ - data: NewLiveCallRouterData + data: "NewLiveCallRouterData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_live_call_router_data.py b/rootly_sdk/models/new_live_call_router_data.py index 26152d3d..db6aba36 100644 --- a/rootly_sdk/models/new_live_call_router_data.py +++ b/rootly_sdk/models/new_live_call_router_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class NewLiveCallRouterData: """ type_: NewLiveCallRouterDataType - attributes: NewLiveCallRouterDataAttributes + attributes: "NewLiveCallRouterDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_live_call_router_data_attributes.py b/rootly_sdk/models/new_live_call_router_data_attributes.py index ffd5bcf2..6ce57b42 100644 --- a/rootly_sdk/models/new_live_call_router_data_attributes.py +++ b/rootly_sdk/models/new_live_call_router_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -47,30 +45,34 @@ class NewLiveCallRouterDataAttributes: [generate_phone_number](#//api/v1/live_call_routers/generate_phone_number) API and pass that phone number here to register voicemail_greeting (str): The voicemail greeting of the live_call_router - paging_targets (list[NewLiveCallRouterDataAttributesPagingTargetsItem]): Paging targets that callers can select - from when this live call router is configured as a phone tree. - enabled (bool | Unset): Whether the live_call_router is enabled - caller_greeting (str | Unset): The caller greeting message of the live_call_router - unavailable_responder_message (None | str | Unset): The message played to the caller when a responder doesn't - answer and the call moves on to the next person in the escalation. Leave blank to use the default message. - waiting_music_url (NewLiveCallRouterDataAttributesWaitingMusicUrl | Unset): The waiting music URL of the + paging_targets (list['NewLiveCallRouterDataAttributesPagingTargetsItem']): Paging targets that callers can + select from when this live call router is configured as a phone tree. + enabled (Union[Unset, bool]): Whether the live_call_router is enabled + caller_greeting (Union[Unset, str]): The caller greeting message of the live_call_router + unavailable_responder_message (Union[None, Unset, str]): The message played to the caller when a responder + doesn't answer and the call moves on to the next person in the escalation. Leave blank to use the default + message. + waiting_music_url (Union[Unset, NewLiveCallRouterDataAttributesWaitingMusicUrl]): The waiting music URL of the live_call_router - sent_to_voicemail_delay (int | Unset): The delay (seconds) after which the caller in redirected to voicemail - should_redirect_to_voicemail_on_no_answer (bool | Unset): This prompts the caller to choose voicemail or connect - live - escalation_level_delay_in_seconds (int | Unset): This overrides the delay (seconds) in escalation levels - should_auto_resolve_alert_on_call_end (bool | Unset): This overrides the delay (seconds) in escalation levels - notify_via_sms (bool | Unset): Whether responders are also notified via SMS when this router pages them - notify_via_push_notification (bool | Unset): Whether responders are also notified via push notification when - this router pages them - informational_notification_message (None | str | Unset): Optional message included in the SMS/push notification. - Supports variables such as {{ alert.url }}, {{ alert.data.* }}, and {{ alert.alert_urgency.name }}. - alert_urgency_id (str | Unset): This is used in escalation paths to determine who to page - calling_tree_enabled (bool | Unset): Whether the live call router is configured as a phone tree, requiring + sent_to_voicemail_delay (Union[Unset, int]): The delay (seconds) after which the caller in redirected to + voicemail + should_redirect_to_voicemail_on_no_answer (Union[Unset, bool]): This prompts the caller to choose voicemail or + connect live + escalation_level_delay_in_seconds (Union[Unset, int]): This overrides the delay (seconds) in escalation levels + should_auto_resolve_alert_on_call_end (Union[Unset, bool]): This overrides the delay (seconds) in escalation + levels + notify_via_sms (Union[Unset, bool]): Whether responders are also notified via SMS when this router pages them + notify_via_push_notification (Union[Unset, bool]): Whether responders are also notified via push notification + when this router pages them + informational_notification_message (Union[None, Unset, str]): Optional message included in the SMS/push + notification. Supports variables such as {{ alert.url }}, {{ alert.data.* }}, and {{ alert.alert_urgency.name + }}. + alert_urgency_id (Union[Unset, str]): This is used in escalation paths to determine who to page + calling_tree_enabled (Union[Unset, bool]): Whether the live call router is configured as a phone tree, requiring callers to press a key before being connected - calling_tree_prompt (str | Unset): The audio instructions callers will hear when they call this number, + calling_tree_prompt (Union[Unset, str]): The audio instructions callers will hear when they call this number, prompting them to select from available options to route their call - escalation_policy_trigger_params (NewLiveCallRouterDataAttributesEscalationPolicyTriggerParams | Unset): + escalation_policy_trigger_params (Union[Unset, NewLiveCallRouterDataAttributesEscalationPolicyTriggerParams]): """ kind: NewLiveCallRouterDataAttributesKind @@ -79,25 +81,26 @@ class NewLiveCallRouterDataAttributes: phone_type: NewLiveCallRouterDataAttributesPhoneType phone_number: str voicemail_greeting: str - paging_targets: list[NewLiveCallRouterDataAttributesPagingTargetsItem] - enabled: bool | Unset = UNSET - caller_greeting: str | Unset = UNSET - unavailable_responder_message: None | str | Unset = UNSET - waiting_music_url: NewLiveCallRouterDataAttributesWaitingMusicUrl | Unset = UNSET - sent_to_voicemail_delay: int | Unset = UNSET - should_redirect_to_voicemail_on_no_answer: bool | Unset = UNSET - escalation_level_delay_in_seconds: int | Unset = UNSET - should_auto_resolve_alert_on_call_end: bool | Unset = UNSET - notify_via_sms: bool | Unset = UNSET - notify_via_push_notification: bool | Unset = UNSET - informational_notification_message: None | str | Unset = UNSET - alert_urgency_id: str | Unset = UNSET - calling_tree_enabled: bool | Unset = UNSET - calling_tree_prompt: str | Unset = UNSET - escalation_policy_trigger_params: NewLiveCallRouterDataAttributesEscalationPolicyTriggerParams | Unset = UNSET + paging_targets: list["NewLiveCallRouterDataAttributesPagingTargetsItem"] + enabled: Union[Unset, bool] = UNSET + caller_greeting: Union[Unset, str] = UNSET + unavailable_responder_message: Union[None, Unset, str] = UNSET + waiting_music_url: Union[Unset, NewLiveCallRouterDataAttributesWaitingMusicUrl] = UNSET + sent_to_voicemail_delay: Union[Unset, int] = UNSET + should_redirect_to_voicemail_on_no_answer: Union[Unset, bool] = UNSET + escalation_level_delay_in_seconds: Union[Unset, int] = UNSET + should_auto_resolve_alert_on_call_end: Union[Unset, bool] = UNSET + notify_via_sms: Union[Unset, bool] = UNSET + notify_via_push_notification: Union[Unset, bool] = UNSET + informational_notification_message: Union[None, Unset, str] = UNSET + alert_urgency_id: Union[Unset, str] = UNSET + calling_tree_enabled: Union[Unset, bool] = UNSET + calling_tree_prompt: Union[Unset, str] = UNSET + escalation_policy_trigger_params: Union[Unset, "NewLiveCallRouterDataAttributesEscalationPolicyTriggerParams"] = ( + UNSET + ) def to_dict(self) -> dict[str, Any]: - kind: str = self.kind name = self.name @@ -119,13 +122,13 @@ def to_dict(self) -> dict[str, Any]: caller_greeting = self.caller_greeting - unavailable_responder_message: None | str | Unset + unavailable_responder_message: Union[None, Unset, str] if isinstance(self.unavailable_responder_message, Unset): unavailable_responder_message = UNSET else: unavailable_responder_message = self.unavailable_responder_message - waiting_music_url: str | Unset = UNSET + waiting_music_url: Union[Unset, str] = UNSET if not isinstance(self.waiting_music_url, Unset): waiting_music_url = self.waiting_music_url @@ -141,7 +144,7 @@ def to_dict(self) -> dict[str, Any]: notify_via_push_notification = self.notify_via_push_notification - informational_notification_message: None | str | Unset + informational_notification_message: Union[None, Unset, str] if isinstance(self.informational_notification_message, Unset): informational_notification_message = UNSET else: @@ -153,7 +156,7 @@ def to_dict(self) -> dict[str, Any]: calling_tree_prompt = self.calling_tree_prompt - escalation_policy_trigger_params: dict[str, Any] | Unset = UNSET + escalation_policy_trigger_params: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.escalation_policy_trigger_params, Unset): escalation_policy_trigger_params = self.escalation_policy_trigger_params.to_dict() @@ -236,19 +239,19 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: caller_greeting = d.pop("caller_greeting", UNSET) - def _parse_unavailable_responder_message(data: object) -> None | str | Unset: + def _parse_unavailable_responder_message(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) unavailable_responder_message = _parse_unavailable_responder_message( d.pop("unavailable_responder_message", UNSET) ) _waiting_music_url = d.pop("waiting_music_url", UNSET) - waiting_music_url: NewLiveCallRouterDataAttributesWaitingMusicUrl | Unset + waiting_music_url: Union[Unset, NewLiveCallRouterDataAttributesWaitingMusicUrl] if isinstance(_waiting_music_url, Unset): waiting_music_url = UNSET else: @@ -266,12 +269,12 @@ def _parse_unavailable_responder_message(data: object) -> None | str | Unset: notify_via_push_notification = d.pop("notify_via_push_notification", UNSET) - def _parse_informational_notification_message(data: object) -> None | str | Unset: + def _parse_informational_notification_message(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) informational_notification_message = _parse_informational_notification_message( d.pop("informational_notification_message", UNSET) @@ -284,7 +287,7 @@ def _parse_informational_notification_message(data: object) -> None | str | Unse calling_tree_prompt = d.pop("calling_tree_prompt", UNSET) _escalation_policy_trigger_params = d.pop("escalation_policy_trigger_params", UNSET) - escalation_policy_trigger_params: NewLiveCallRouterDataAttributesEscalationPolicyTriggerParams | Unset + escalation_policy_trigger_params: Union[Unset, NewLiveCallRouterDataAttributesEscalationPolicyTriggerParams] if isinstance(_escalation_policy_trigger_params, Unset): escalation_policy_trigger_params = UNSET else: diff --git a/rootly_sdk/models/new_live_call_router_data_attributes_escalation_policy_trigger_params.py b/rootly_sdk/models/new_live_call_router_data_attributes_escalation_policy_trigger_params.py index 53411b43..c3c3136b 100644 --- a/rootly_sdk/models/new_live_call_router_data_attributes_escalation_policy_trigger_params.py +++ b/rootly_sdk/models/new_live_call_router_data_attributes_escalation_policy_trigger_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/new_live_call_router_data_attributes_paging_targets_item.py b/rootly_sdk/models/new_live_call_router_data_attributes_paging_targets_item.py index fbd27620..8993b484 100644 --- a/rootly_sdk/models/new_live_call_router_data_attributes_paging_targets_item.py +++ b/rootly_sdk/models/new_live_call_router_data_attributes_paging_targets_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/new_on_call_pay_report.py b/rootly_sdk/models/new_on_call_pay_report.py index dedd08a5..cdcb2e67 100644 --- a/rootly_sdk/models/new_on_call_pay_report.py +++ b/rootly_sdk/models/new_on_call_pay_report.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewOnCallPayReport: data (NewOnCallPayReportData): """ - data: NewOnCallPayReportData + data: "NewOnCallPayReportData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_on_call_pay_report_data.py b/rootly_sdk/models/new_on_call_pay_report_data.py index a50b78a5..84e4a7df 100644 --- a/rootly_sdk/models/new_on_call_pay_report_data.py +++ b/rootly_sdk/models/new_on_call_pay_report_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class NewOnCallPayReportData: """ type_: NewOnCallPayReportDataType - attributes: NewOnCallPayReportDataAttributes + attributes: "NewOnCallPayReportDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_on_call_pay_report_data_attributes.py b/rootly_sdk/models/new_on_call_pay_report_data_attributes.py index ee306056..d9212e3c 100644 --- a/rootly_sdk/models/new_on_call_pay_report_data_attributes.py +++ b/rootly_sdk/models/new_on_call_pay_report_data_attributes.py @@ -1,8 +1,6 @@ -from __future__ import annotations - import datetime from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from dateutil.parser import isoparse @@ -18,25 +16,25 @@ class NewOnCallPayReportDataAttributes: Attributes: start_date (datetime.date): The start date for the report period. end_date (datetime.date): The end date for the report period. - schedule_ids (list[str] | Unset): List of schedule UUIDs to scope the report. - time_zone (str | Unset): IANA timezone used to compute day and weekend boundaries. Defaults to the team's + schedule_ids (Union[Unset, list[str]]): List of schedule UUIDs to scope the report. + time_zone (Union[Unset, str]): IANA timezone used to compute day and weekend boundaries. Defaults to the team's timezone. - use_responders_time_zone (bool | Unset): When true, day and weekend boundaries are computed in each responder's - personal timezone instead of the report-wide timezone. + use_responders_time_zone (Union[Unset, bool]): When true, day and weekend boundaries are computed in each + responder's personal timezone instead of the report-wide timezone. """ start_date: datetime.date end_date: datetime.date - schedule_ids: list[str] | Unset = UNSET - time_zone: str | Unset = UNSET - use_responders_time_zone: bool | Unset = UNSET + schedule_ids: Union[Unset, list[str]] = UNSET + time_zone: Union[Unset, str] = UNSET + use_responders_time_zone: Union[Unset, bool] = UNSET def to_dict(self) -> dict[str, Any]: start_date = self.start_date.isoformat() end_date = self.end_date.isoformat() - schedule_ids: list[str] | Unset = UNSET + schedule_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.schedule_ids, Unset): schedule_ids = self.schedule_ids diff --git a/rootly_sdk/models/new_on_call_role.py b/rootly_sdk/models/new_on_call_role.py index da10105a..62976edf 100644 --- a/rootly_sdk/models/new_on_call_role.py +++ b/rootly_sdk/models/new_on_call_role.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewOnCallRole: data (NewOnCallRoleData): """ - data: NewOnCallRoleData + data: "NewOnCallRoleData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_on_call_role_data.py b/rootly_sdk/models/new_on_call_role_data.py index e48c91f9..05e59c36 100644 --- a/rootly_sdk/models/new_on_call_role_data.py +++ b/rootly_sdk/models/new_on_call_role_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class NewOnCallRoleData: """ type_: NewOnCallRoleDataType - attributes: NewOnCallRoleDataAttributes + attributes: "NewOnCallRoleDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_on_call_role_data_attributes.py b/rootly_sdk/models/new_on_call_role_data_attributes.py index 6b1abb86..28278864 100644 --- a/rootly_sdk/models/new_on_call_role_data_attributes.py +++ b/rootly_sdk/models/new_on_call_role_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -111,230 +109,248 @@ class NewOnCallRoleDataAttributes: """ Attributes: name (str): The role name. - system_role (str | Unset): The kind of role (user and custom type roles are only editable) Default: 'custom'. - alert_fields_permissions (list[NewOnCallRoleDataAttributesAlertFieldsPermissionsItem] | Unset): - alert_groups_permissions (list[NewOnCallRoleDataAttributesAlertGroupsPermissionsItem] | Unset): - alert_routing_rules_permissions (list[NewOnCallRoleDataAttributesAlertRoutingRulesPermissionsItem] | Unset): - on_call_readiness_report_permissions (list[NewOnCallRoleDataAttributesOnCallReadinessReportPermissionsItem] | - Unset): - on_call_roles_permissions (list[NewOnCallRoleDataAttributesOnCallRolesPermissionsItem] | Unset): - alert_sources_permissions (list[NewOnCallRoleDataAttributesAlertSourcesPermissionsItem] | Unset): - alert_urgency_permissions (list[NewOnCallRoleDataAttributesAlertUrgencyPermissionsItem] | Unset): - alerts_permissions (list[NewOnCallRoleDataAttributesAlertsPermissionsItem] | Unset): - api_keys_permissions (list[NewOnCallRoleDataAttributesApiKeysPermissionsItem] | Unset): - audits_permissions (list[NewOnCallRoleDataAttributesAuditsPermissionsItem] | Unset): - contacts_permissions (list[NewOnCallRoleDataAttributesContactsPermissionsItem] | Unset): - escalation_policies_permissions (list[NewOnCallRoleDataAttributesEscalationPoliciesPermissionsItem] | Unset): - groups_permissions (list[NewOnCallRoleDataAttributesGroupsPermissionsItem] | Unset): - heartbeats_permissions (list[NewOnCallRoleDataAttributesHeartbeatsPermissionsItem] | Unset): - integrations_permissions (list[NewOnCallRoleDataAttributesIntegrationsPermissionsItem] | Unset): - invitations_permissions (list[NewOnCallRoleDataAttributesInvitationsPermissionsItem] | Unset): - live_call_routing_permissions (list[NewOnCallRoleDataAttributesLiveCallRoutingPermissionsItem] | Unset): - schedule_override_permissions (list[NewOnCallRoleDataAttributesScheduleOverridePermissionsItem] | Unset): - schedules_permissions (list[NewOnCallRoleDataAttributesSchedulesPermissionsItem] | Unset): - services_permissions (list[NewOnCallRoleDataAttributesServicesPermissionsItem] | Unset): - functionalities_permissions (list[NewOnCallRoleDataAttributesFunctionalitiesPermissionsItem] | Unset): - webhooks_permissions (list[NewOnCallRoleDataAttributesWebhooksPermissionsItem] | Unset): - workflows_permissions (list[NewOnCallRoleDataAttributesWorkflowsPermissionsItem] | Unset): - catalogs_permissions (list[NewOnCallRoleDataAttributesCatalogsPermissionsItem] | Unset): + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + system_role (Union[Unset, str]): The kind of role (user and custom type roles are only editable) Default: + 'custom'. + alert_fields_permissions (Union[Unset, list[NewOnCallRoleDataAttributesAlertFieldsPermissionsItem]]): + alert_groups_permissions (Union[Unset, list[NewOnCallRoleDataAttributesAlertGroupsPermissionsItem]]): + alert_routing_rules_permissions (Union[Unset, + list[NewOnCallRoleDataAttributesAlertRoutingRulesPermissionsItem]]): + on_call_readiness_report_permissions (Union[Unset, + list[NewOnCallRoleDataAttributesOnCallReadinessReportPermissionsItem]]): + on_call_roles_permissions (Union[Unset, list[NewOnCallRoleDataAttributesOnCallRolesPermissionsItem]]): + alert_sources_permissions (Union[Unset, list[NewOnCallRoleDataAttributesAlertSourcesPermissionsItem]]): + alert_urgency_permissions (Union[Unset, list[NewOnCallRoleDataAttributesAlertUrgencyPermissionsItem]]): + alerts_permissions (Union[Unset, list[NewOnCallRoleDataAttributesAlertsPermissionsItem]]): + api_keys_permissions (Union[Unset, list[NewOnCallRoleDataAttributesApiKeysPermissionsItem]]): + audits_permissions (Union[Unset, list[NewOnCallRoleDataAttributesAuditsPermissionsItem]]): + contacts_permissions (Union[Unset, list[NewOnCallRoleDataAttributesContactsPermissionsItem]]): + escalation_policies_permissions (Union[Unset, + list[NewOnCallRoleDataAttributesEscalationPoliciesPermissionsItem]]): + groups_permissions (Union[Unset, list[NewOnCallRoleDataAttributesGroupsPermissionsItem]]): + heartbeats_permissions (Union[Unset, list[NewOnCallRoleDataAttributesHeartbeatsPermissionsItem]]): + integrations_permissions (Union[Unset, list[NewOnCallRoleDataAttributesIntegrationsPermissionsItem]]): + invitations_permissions (Union[Unset, list[NewOnCallRoleDataAttributesInvitationsPermissionsItem]]): + live_call_routing_permissions (Union[Unset, list[NewOnCallRoleDataAttributesLiveCallRoutingPermissionsItem]]): + schedule_override_permissions (Union[Unset, list[NewOnCallRoleDataAttributesScheduleOverridePermissionsItem]]): + schedules_permissions (Union[Unset, list[NewOnCallRoleDataAttributesSchedulesPermissionsItem]]): + services_permissions (Union[Unset, list[NewOnCallRoleDataAttributesServicesPermissionsItem]]): + functionalities_permissions (Union[Unset, list[NewOnCallRoleDataAttributesFunctionalitiesPermissionsItem]]): + webhooks_permissions (Union[Unset, list[NewOnCallRoleDataAttributesWebhooksPermissionsItem]]): + workflows_permissions (Union[Unset, list[NewOnCallRoleDataAttributesWorkflowsPermissionsItem]]): + catalogs_permissions (Union[Unset, list[NewOnCallRoleDataAttributesCatalogsPermissionsItem]]): """ name: str - system_role: str | Unset = "custom" - alert_fields_permissions: list[NewOnCallRoleDataAttributesAlertFieldsPermissionsItem] | Unset = UNSET - alert_groups_permissions: list[NewOnCallRoleDataAttributesAlertGroupsPermissionsItem] | Unset = UNSET - alert_routing_rules_permissions: list[NewOnCallRoleDataAttributesAlertRoutingRulesPermissionsItem] | Unset = UNSET - on_call_readiness_report_permissions: ( - list[NewOnCallRoleDataAttributesOnCallReadinessReportPermissionsItem] | Unset - ) = UNSET - on_call_roles_permissions: list[NewOnCallRoleDataAttributesOnCallRolesPermissionsItem] | Unset = UNSET - alert_sources_permissions: list[NewOnCallRoleDataAttributesAlertSourcesPermissionsItem] | Unset = UNSET - alert_urgency_permissions: list[NewOnCallRoleDataAttributesAlertUrgencyPermissionsItem] | Unset = UNSET - alerts_permissions: list[NewOnCallRoleDataAttributesAlertsPermissionsItem] | Unset = UNSET - api_keys_permissions: list[NewOnCallRoleDataAttributesApiKeysPermissionsItem] | Unset = UNSET - audits_permissions: list[NewOnCallRoleDataAttributesAuditsPermissionsItem] | Unset = UNSET - contacts_permissions: list[NewOnCallRoleDataAttributesContactsPermissionsItem] | Unset = UNSET - escalation_policies_permissions: list[NewOnCallRoleDataAttributesEscalationPoliciesPermissionsItem] | Unset = UNSET - groups_permissions: list[NewOnCallRoleDataAttributesGroupsPermissionsItem] | Unset = UNSET - heartbeats_permissions: list[NewOnCallRoleDataAttributesHeartbeatsPermissionsItem] | Unset = UNSET - integrations_permissions: list[NewOnCallRoleDataAttributesIntegrationsPermissionsItem] | Unset = UNSET - invitations_permissions: list[NewOnCallRoleDataAttributesInvitationsPermissionsItem] | Unset = UNSET - live_call_routing_permissions: list[NewOnCallRoleDataAttributesLiveCallRoutingPermissionsItem] | Unset = UNSET - schedule_override_permissions: list[NewOnCallRoleDataAttributesScheduleOverridePermissionsItem] | Unset = UNSET - schedules_permissions: list[NewOnCallRoleDataAttributesSchedulesPermissionsItem] | Unset = UNSET - services_permissions: list[NewOnCallRoleDataAttributesServicesPermissionsItem] | Unset = UNSET - functionalities_permissions: list[NewOnCallRoleDataAttributesFunctionalitiesPermissionsItem] | Unset = UNSET - webhooks_permissions: list[NewOnCallRoleDataAttributesWebhooksPermissionsItem] | Unset = UNSET - workflows_permissions: list[NewOnCallRoleDataAttributesWorkflowsPermissionsItem] | Unset = UNSET - catalogs_permissions: list[NewOnCallRoleDataAttributesCatalogsPermissionsItem] | Unset = UNSET + slug: Union[None, Unset, str] = UNSET + system_role: Union[Unset, str] = "custom" + alert_fields_permissions: Union[Unset, list[NewOnCallRoleDataAttributesAlertFieldsPermissionsItem]] = UNSET + alert_groups_permissions: Union[Unset, list[NewOnCallRoleDataAttributesAlertGroupsPermissionsItem]] = UNSET + alert_routing_rules_permissions: Union[Unset, list[NewOnCallRoleDataAttributesAlertRoutingRulesPermissionsItem]] = ( + UNSET + ) + on_call_readiness_report_permissions: Union[ + Unset, list[NewOnCallRoleDataAttributesOnCallReadinessReportPermissionsItem] + ] = UNSET + on_call_roles_permissions: Union[Unset, list[NewOnCallRoleDataAttributesOnCallRolesPermissionsItem]] = UNSET + alert_sources_permissions: Union[Unset, list[NewOnCallRoleDataAttributesAlertSourcesPermissionsItem]] = UNSET + alert_urgency_permissions: Union[Unset, list[NewOnCallRoleDataAttributesAlertUrgencyPermissionsItem]] = UNSET + alerts_permissions: Union[Unset, list[NewOnCallRoleDataAttributesAlertsPermissionsItem]] = UNSET + api_keys_permissions: Union[Unset, list[NewOnCallRoleDataAttributesApiKeysPermissionsItem]] = UNSET + audits_permissions: Union[Unset, list[NewOnCallRoleDataAttributesAuditsPermissionsItem]] = UNSET + contacts_permissions: Union[Unset, list[NewOnCallRoleDataAttributesContactsPermissionsItem]] = UNSET + escalation_policies_permissions: Union[ + Unset, list[NewOnCallRoleDataAttributesEscalationPoliciesPermissionsItem] + ] = UNSET + groups_permissions: Union[Unset, list[NewOnCallRoleDataAttributesGroupsPermissionsItem]] = UNSET + heartbeats_permissions: Union[Unset, list[NewOnCallRoleDataAttributesHeartbeatsPermissionsItem]] = UNSET + integrations_permissions: Union[Unset, list[NewOnCallRoleDataAttributesIntegrationsPermissionsItem]] = UNSET + invitations_permissions: Union[Unset, list[NewOnCallRoleDataAttributesInvitationsPermissionsItem]] = UNSET + live_call_routing_permissions: Union[Unset, list[NewOnCallRoleDataAttributesLiveCallRoutingPermissionsItem]] = UNSET + schedule_override_permissions: Union[Unset, list[NewOnCallRoleDataAttributesScheduleOverridePermissionsItem]] = ( + UNSET + ) + schedules_permissions: Union[Unset, list[NewOnCallRoleDataAttributesSchedulesPermissionsItem]] = UNSET + services_permissions: Union[Unset, list[NewOnCallRoleDataAttributesServicesPermissionsItem]] = UNSET + functionalities_permissions: Union[Unset, list[NewOnCallRoleDataAttributesFunctionalitiesPermissionsItem]] = UNSET + webhooks_permissions: Union[Unset, list[NewOnCallRoleDataAttributesWebhooksPermissionsItem]] = UNSET + workflows_permissions: Union[Unset, list[NewOnCallRoleDataAttributesWorkflowsPermissionsItem]] = UNSET + catalogs_permissions: Union[Unset, list[NewOnCallRoleDataAttributesCatalogsPermissionsItem]] = UNSET def to_dict(self) -> dict[str, Any]: name = self.name + slug: Union[None, Unset, str] + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug + system_role = self.system_role - alert_fields_permissions: list[str] | Unset = UNSET + alert_fields_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.alert_fields_permissions, Unset): alert_fields_permissions = [] for alert_fields_permissions_item_data in self.alert_fields_permissions: alert_fields_permissions_item: str = alert_fields_permissions_item_data alert_fields_permissions.append(alert_fields_permissions_item) - alert_groups_permissions: list[str] | Unset = UNSET + alert_groups_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.alert_groups_permissions, Unset): alert_groups_permissions = [] for alert_groups_permissions_item_data in self.alert_groups_permissions: alert_groups_permissions_item: str = alert_groups_permissions_item_data alert_groups_permissions.append(alert_groups_permissions_item) - alert_routing_rules_permissions: list[str] | Unset = UNSET + alert_routing_rules_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.alert_routing_rules_permissions, Unset): alert_routing_rules_permissions = [] for alert_routing_rules_permissions_item_data in self.alert_routing_rules_permissions: alert_routing_rules_permissions_item: str = alert_routing_rules_permissions_item_data alert_routing_rules_permissions.append(alert_routing_rules_permissions_item) - on_call_readiness_report_permissions: list[str] | Unset = UNSET + on_call_readiness_report_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.on_call_readiness_report_permissions, Unset): on_call_readiness_report_permissions = [] for on_call_readiness_report_permissions_item_data in self.on_call_readiness_report_permissions: on_call_readiness_report_permissions_item: str = on_call_readiness_report_permissions_item_data on_call_readiness_report_permissions.append(on_call_readiness_report_permissions_item) - on_call_roles_permissions: list[str] | Unset = UNSET + on_call_roles_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.on_call_roles_permissions, Unset): on_call_roles_permissions = [] for on_call_roles_permissions_item_data in self.on_call_roles_permissions: on_call_roles_permissions_item: str = on_call_roles_permissions_item_data on_call_roles_permissions.append(on_call_roles_permissions_item) - alert_sources_permissions: list[str] | Unset = UNSET + alert_sources_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.alert_sources_permissions, Unset): alert_sources_permissions = [] for alert_sources_permissions_item_data in self.alert_sources_permissions: alert_sources_permissions_item: str = alert_sources_permissions_item_data alert_sources_permissions.append(alert_sources_permissions_item) - alert_urgency_permissions: list[str] | Unset = UNSET + alert_urgency_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.alert_urgency_permissions, Unset): alert_urgency_permissions = [] for alert_urgency_permissions_item_data in self.alert_urgency_permissions: alert_urgency_permissions_item: str = alert_urgency_permissions_item_data alert_urgency_permissions.append(alert_urgency_permissions_item) - alerts_permissions: list[str] | Unset = UNSET + alerts_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.alerts_permissions, Unset): alerts_permissions = [] for alerts_permissions_item_data in self.alerts_permissions: alerts_permissions_item: str = alerts_permissions_item_data alerts_permissions.append(alerts_permissions_item) - api_keys_permissions: list[str] | Unset = UNSET + api_keys_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.api_keys_permissions, Unset): api_keys_permissions = [] for api_keys_permissions_item_data in self.api_keys_permissions: api_keys_permissions_item: str = api_keys_permissions_item_data api_keys_permissions.append(api_keys_permissions_item) - audits_permissions: list[str] | Unset = UNSET + audits_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.audits_permissions, Unset): audits_permissions = [] for audits_permissions_item_data in self.audits_permissions: audits_permissions_item: str = audits_permissions_item_data audits_permissions.append(audits_permissions_item) - contacts_permissions: list[str] | Unset = UNSET + contacts_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.contacts_permissions, Unset): contacts_permissions = [] for contacts_permissions_item_data in self.contacts_permissions: contacts_permissions_item: str = contacts_permissions_item_data contacts_permissions.append(contacts_permissions_item) - escalation_policies_permissions: list[str] | Unset = UNSET + escalation_policies_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.escalation_policies_permissions, Unset): escalation_policies_permissions = [] for escalation_policies_permissions_item_data in self.escalation_policies_permissions: escalation_policies_permissions_item: str = escalation_policies_permissions_item_data escalation_policies_permissions.append(escalation_policies_permissions_item) - groups_permissions: list[str] | Unset = UNSET + groups_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.groups_permissions, Unset): groups_permissions = [] for groups_permissions_item_data in self.groups_permissions: groups_permissions_item: str = groups_permissions_item_data groups_permissions.append(groups_permissions_item) - heartbeats_permissions: list[str] | Unset = UNSET + heartbeats_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.heartbeats_permissions, Unset): heartbeats_permissions = [] for heartbeats_permissions_item_data in self.heartbeats_permissions: heartbeats_permissions_item: str = heartbeats_permissions_item_data heartbeats_permissions.append(heartbeats_permissions_item) - integrations_permissions: list[str] | Unset = UNSET + integrations_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.integrations_permissions, Unset): integrations_permissions = [] for integrations_permissions_item_data in self.integrations_permissions: integrations_permissions_item: str = integrations_permissions_item_data integrations_permissions.append(integrations_permissions_item) - invitations_permissions: list[str] | Unset = UNSET + invitations_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.invitations_permissions, Unset): invitations_permissions = [] for invitations_permissions_item_data in self.invitations_permissions: invitations_permissions_item: str = invitations_permissions_item_data invitations_permissions.append(invitations_permissions_item) - live_call_routing_permissions: list[str] | Unset = UNSET + live_call_routing_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.live_call_routing_permissions, Unset): live_call_routing_permissions = [] for live_call_routing_permissions_item_data in self.live_call_routing_permissions: live_call_routing_permissions_item: str = live_call_routing_permissions_item_data live_call_routing_permissions.append(live_call_routing_permissions_item) - schedule_override_permissions: list[str] | Unset = UNSET + schedule_override_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.schedule_override_permissions, Unset): schedule_override_permissions = [] for schedule_override_permissions_item_data in self.schedule_override_permissions: schedule_override_permissions_item: str = schedule_override_permissions_item_data schedule_override_permissions.append(schedule_override_permissions_item) - schedules_permissions: list[str] | Unset = UNSET + schedules_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.schedules_permissions, Unset): schedules_permissions = [] for schedules_permissions_item_data in self.schedules_permissions: schedules_permissions_item: str = schedules_permissions_item_data schedules_permissions.append(schedules_permissions_item) - services_permissions: list[str] | Unset = UNSET + services_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.services_permissions, Unset): services_permissions = [] for services_permissions_item_data in self.services_permissions: services_permissions_item: str = services_permissions_item_data services_permissions.append(services_permissions_item) - functionalities_permissions: list[str] | Unset = UNSET + functionalities_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.functionalities_permissions, Unset): functionalities_permissions = [] for functionalities_permissions_item_data in self.functionalities_permissions: functionalities_permissions_item: str = functionalities_permissions_item_data functionalities_permissions.append(functionalities_permissions_item) - webhooks_permissions: list[str] | Unset = UNSET + webhooks_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.webhooks_permissions, Unset): webhooks_permissions = [] for webhooks_permissions_item_data in self.webhooks_permissions: webhooks_permissions_item: str = webhooks_permissions_item_data webhooks_permissions.append(webhooks_permissions_item) - workflows_permissions: list[str] | Unset = UNSET + workflows_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.workflows_permissions, Unset): workflows_permissions = [] for workflows_permissions_item_data in self.workflows_permissions: workflows_permissions_item: str = workflows_permissions_item_data workflows_permissions.append(workflows_permissions_item) - catalogs_permissions: list[str] | Unset = UNSET + catalogs_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.catalogs_permissions, Unset): catalogs_permissions = [] for catalogs_permissions_item_data in self.catalogs_permissions: @@ -348,6 +364,8 @@ def to_dict(self) -> dict[str, Any]: "name": name, } ) + if slug is not UNSET: + field_dict["slug"] = slug if system_role is not UNSET: field_dict["system_role"] = system_role if alert_fields_permissions is not UNSET: @@ -406,292 +424,246 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name") + def _parse_slug(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + slug = _parse_slug(d.pop("slug", UNSET)) + system_role = d.pop("system_role", UNSET) + alert_fields_permissions = [] _alert_fields_permissions = d.pop("alert_fields_permissions", UNSET) - alert_fields_permissions: list[NewOnCallRoleDataAttributesAlertFieldsPermissionsItem] | Unset = UNSET - if _alert_fields_permissions is not UNSET: - alert_fields_permissions = [] - for alert_fields_permissions_item_data in _alert_fields_permissions: - alert_fields_permissions_item = check_new_on_call_role_data_attributes_alert_fields_permissions_item( - alert_fields_permissions_item_data - ) + for alert_fields_permissions_item_data in _alert_fields_permissions or []: + alert_fields_permissions_item = check_new_on_call_role_data_attributes_alert_fields_permissions_item( + alert_fields_permissions_item_data + ) - alert_fields_permissions.append(alert_fields_permissions_item) + alert_fields_permissions.append(alert_fields_permissions_item) + alert_groups_permissions = [] _alert_groups_permissions = d.pop("alert_groups_permissions", UNSET) - alert_groups_permissions: list[NewOnCallRoleDataAttributesAlertGroupsPermissionsItem] | Unset = UNSET - if _alert_groups_permissions is not UNSET: - alert_groups_permissions = [] - for alert_groups_permissions_item_data in _alert_groups_permissions: - alert_groups_permissions_item = check_new_on_call_role_data_attributes_alert_groups_permissions_item( - alert_groups_permissions_item_data - ) + for alert_groups_permissions_item_data in _alert_groups_permissions or []: + alert_groups_permissions_item = check_new_on_call_role_data_attributes_alert_groups_permissions_item( + alert_groups_permissions_item_data + ) - alert_groups_permissions.append(alert_groups_permissions_item) + alert_groups_permissions.append(alert_groups_permissions_item) + alert_routing_rules_permissions = [] _alert_routing_rules_permissions = d.pop("alert_routing_rules_permissions", UNSET) - alert_routing_rules_permissions: list[NewOnCallRoleDataAttributesAlertRoutingRulesPermissionsItem] | Unset = ( - UNSET - ) - if _alert_routing_rules_permissions is not UNSET: - alert_routing_rules_permissions = [] - for alert_routing_rules_permissions_item_data in _alert_routing_rules_permissions: - alert_routing_rules_permissions_item = ( - check_new_on_call_role_data_attributes_alert_routing_rules_permissions_item( - alert_routing_rules_permissions_item_data - ) + for alert_routing_rules_permissions_item_data in _alert_routing_rules_permissions or []: + alert_routing_rules_permissions_item = ( + check_new_on_call_role_data_attributes_alert_routing_rules_permissions_item( + alert_routing_rules_permissions_item_data ) + ) - alert_routing_rules_permissions.append(alert_routing_rules_permissions_item) + alert_routing_rules_permissions.append(alert_routing_rules_permissions_item) + on_call_readiness_report_permissions = [] _on_call_readiness_report_permissions = d.pop("on_call_readiness_report_permissions", UNSET) - on_call_readiness_report_permissions: ( - list[NewOnCallRoleDataAttributesOnCallReadinessReportPermissionsItem] | Unset - ) = UNSET - if _on_call_readiness_report_permissions is not UNSET: - on_call_readiness_report_permissions = [] - for on_call_readiness_report_permissions_item_data in _on_call_readiness_report_permissions: - on_call_readiness_report_permissions_item = ( - check_new_on_call_role_data_attributes_on_call_readiness_report_permissions_item( - on_call_readiness_report_permissions_item_data - ) + for on_call_readiness_report_permissions_item_data in _on_call_readiness_report_permissions or []: + on_call_readiness_report_permissions_item = ( + check_new_on_call_role_data_attributes_on_call_readiness_report_permissions_item( + on_call_readiness_report_permissions_item_data ) + ) - on_call_readiness_report_permissions.append(on_call_readiness_report_permissions_item) + on_call_readiness_report_permissions.append(on_call_readiness_report_permissions_item) + on_call_roles_permissions = [] _on_call_roles_permissions = d.pop("on_call_roles_permissions", UNSET) - on_call_roles_permissions: list[NewOnCallRoleDataAttributesOnCallRolesPermissionsItem] | Unset = UNSET - if _on_call_roles_permissions is not UNSET: - on_call_roles_permissions = [] - for on_call_roles_permissions_item_data in _on_call_roles_permissions: - on_call_roles_permissions_item = check_new_on_call_role_data_attributes_on_call_roles_permissions_item( - on_call_roles_permissions_item_data - ) + for on_call_roles_permissions_item_data in _on_call_roles_permissions or []: + on_call_roles_permissions_item = check_new_on_call_role_data_attributes_on_call_roles_permissions_item( + on_call_roles_permissions_item_data + ) - on_call_roles_permissions.append(on_call_roles_permissions_item) + on_call_roles_permissions.append(on_call_roles_permissions_item) + alert_sources_permissions = [] _alert_sources_permissions = d.pop("alert_sources_permissions", UNSET) - alert_sources_permissions: list[NewOnCallRoleDataAttributesAlertSourcesPermissionsItem] | Unset = UNSET - if _alert_sources_permissions is not UNSET: - alert_sources_permissions = [] - for alert_sources_permissions_item_data in _alert_sources_permissions: - alert_sources_permissions_item = check_new_on_call_role_data_attributes_alert_sources_permissions_item( - alert_sources_permissions_item_data - ) + for alert_sources_permissions_item_data in _alert_sources_permissions or []: + alert_sources_permissions_item = check_new_on_call_role_data_attributes_alert_sources_permissions_item( + alert_sources_permissions_item_data + ) - alert_sources_permissions.append(alert_sources_permissions_item) + alert_sources_permissions.append(alert_sources_permissions_item) + alert_urgency_permissions = [] _alert_urgency_permissions = d.pop("alert_urgency_permissions", UNSET) - alert_urgency_permissions: list[NewOnCallRoleDataAttributesAlertUrgencyPermissionsItem] | Unset = UNSET - if _alert_urgency_permissions is not UNSET: - alert_urgency_permissions = [] - for alert_urgency_permissions_item_data in _alert_urgency_permissions: - alert_urgency_permissions_item = check_new_on_call_role_data_attributes_alert_urgency_permissions_item( - alert_urgency_permissions_item_data - ) + for alert_urgency_permissions_item_data in _alert_urgency_permissions or []: + alert_urgency_permissions_item = check_new_on_call_role_data_attributes_alert_urgency_permissions_item( + alert_urgency_permissions_item_data + ) - alert_urgency_permissions.append(alert_urgency_permissions_item) + alert_urgency_permissions.append(alert_urgency_permissions_item) + alerts_permissions = [] _alerts_permissions = d.pop("alerts_permissions", UNSET) - alerts_permissions: list[NewOnCallRoleDataAttributesAlertsPermissionsItem] | Unset = UNSET - if _alerts_permissions is not UNSET: - alerts_permissions = [] - for alerts_permissions_item_data in _alerts_permissions: - alerts_permissions_item = check_new_on_call_role_data_attributes_alerts_permissions_item( - alerts_permissions_item_data - ) + for alerts_permissions_item_data in _alerts_permissions or []: + alerts_permissions_item = check_new_on_call_role_data_attributes_alerts_permissions_item( + alerts_permissions_item_data + ) - alerts_permissions.append(alerts_permissions_item) + alerts_permissions.append(alerts_permissions_item) + api_keys_permissions = [] _api_keys_permissions = d.pop("api_keys_permissions", UNSET) - api_keys_permissions: list[NewOnCallRoleDataAttributesApiKeysPermissionsItem] | Unset = UNSET - if _api_keys_permissions is not UNSET: - api_keys_permissions = [] - for api_keys_permissions_item_data in _api_keys_permissions: - api_keys_permissions_item = check_new_on_call_role_data_attributes_api_keys_permissions_item( - api_keys_permissions_item_data - ) + for api_keys_permissions_item_data in _api_keys_permissions or []: + api_keys_permissions_item = check_new_on_call_role_data_attributes_api_keys_permissions_item( + api_keys_permissions_item_data + ) - api_keys_permissions.append(api_keys_permissions_item) + api_keys_permissions.append(api_keys_permissions_item) + audits_permissions = [] _audits_permissions = d.pop("audits_permissions", UNSET) - audits_permissions: list[NewOnCallRoleDataAttributesAuditsPermissionsItem] | Unset = UNSET - if _audits_permissions is not UNSET: - audits_permissions = [] - for audits_permissions_item_data in _audits_permissions: - audits_permissions_item = check_new_on_call_role_data_attributes_audits_permissions_item( - audits_permissions_item_data - ) + for audits_permissions_item_data in _audits_permissions or []: + audits_permissions_item = check_new_on_call_role_data_attributes_audits_permissions_item( + audits_permissions_item_data + ) - audits_permissions.append(audits_permissions_item) + audits_permissions.append(audits_permissions_item) + contacts_permissions = [] _contacts_permissions = d.pop("contacts_permissions", UNSET) - contacts_permissions: list[NewOnCallRoleDataAttributesContactsPermissionsItem] | Unset = UNSET - if _contacts_permissions is not UNSET: - contacts_permissions = [] - for contacts_permissions_item_data in _contacts_permissions: - contacts_permissions_item = check_new_on_call_role_data_attributes_contacts_permissions_item( - contacts_permissions_item_data - ) + for contacts_permissions_item_data in _contacts_permissions or []: + contacts_permissions_item = check_new_on_call_role_data_attributes_contacts_permissions_item( + contacts_permissions_item_data + ) - contacts_permissions.append(contacts_permissions_item) + contacts_permissions.append(contacts_permissions_item) + escalation_policies_permissions = [] _escalation_policies_permissions = d.pop("escalation_policies_permissions", UNSET) - escalation_policies_permissions: list[NewOnCallRoleDataAttributesEscalationPoliciesPermissionsItem] | Unset = ( - UNSET - ) - if _escalation_policies_permissions is not UNSET: - escalation_policies_permissions = [] - for escalation_policies_permissions_item_data in _escalation_policies_permissions: - escalation_policies_permissions_item = ( - check_new_on_call_role_data_attributes_escalation_policies_permissions_item( - escalation_policies_permissions_item_data - ) + for escalation_policies_permissions_item_data in _escalation_policies_permissions or []: + escalation_policies_permissions_item = ( + check_new_on_call_role_data_attributes_escalation_policies_permissions_item( + escalation_policies_permissions_item_data ) + ) - escalation_policies_permissions.append(escalation_policies_permissions_item) + escalation_policies_permissions.append(escalation_policies_permissions_item) + groups_permissions = [] _groups_permissions = d.pop("groups_permissions", UNSET) - groups_permissions: list[NewOnCallRoleDataAttributesGroupsPermissionsItem] | Unset = UNSET - if _groups_permissions is not UNSET: - groups_permissions = [] - for groups_permissions_item_data in _groups_permissions: - groups_permissions_item = check_new_on_call_role_data_attributes_groups_permissions_item( - groups_permissions_item_data - ) + for groups_permissions_item_data in _groups_permissions or []: + groups_permissions_item = check_new_on_call_role_data_attributes_groups_permissions_item( + groups_permissions_item_data + ) - groups_permissions.append(groups_permissions_item) + groups_permissions.append(groups_permissions_item) + heartbeats_permissions = [] _heartbeats_permissions = d.pop("heartbeats_permissions", UNSET) - heartbeats_permissions: list[NewOnCallRoleDataAttributesHeartbeatsPermissionsItem] | Unset = UNSET - if _heartbeats_permissions is not UNSET: - heartbeats_permissions = [] - for heartbeats_permissions_item_data in _heartbeats_permissions: - heartbeats_permissions_item = check_new_on_call_role_data_attributes_heartbeats_permissions_item( - heartbeats_permissions_item_data - ) + for heartbeats_permissions_item_data in _heartbeats_permissions or []: + heartbeats_permissions_item = check_new_on_call_role_data_attributes_heartbeats_permissions_item( + heartbeats_permissions_item_data + ) - heartbeats_permissions.append(heartbeats_permissions_item) + heartbeats_permissions.append(heartbeats_permissions_item) + integrations_permissions = [] _integrations_permissions = d.pop("integrations_permissions", UNSET) - integrations_permissions: list[NewOnCallRoleDataAttributesIntegrationsPermissionsItem] | Unset = UNSET - if _integrations_permissions is not UNSET: - integrations_permissions = [] - for integrations_permissions_item_data in _integrations_permissions: - integrations_permissions_item = check_new_on_call_role_data_attributes_integrations_permissions_item( - integrations_permissions_item_data - ) + for integrations_permissions_item_data in _integrations_permissions or []: + integrations_permissions_item = check_new_on_call_role_data_attributes_integrations_permissions_item( + integrations_permissions_item_data + ) - integrations_permissions.append(integrations_permissions_item) + integrations_permissions.append(integrations_permissions_item) + invitations_permissions = [] _invitations_permissions = d.pop("invitations_permissions", UNSET) - invitations_permissions: list[NewOnCallRoleDataAttributesInvitationsPermissionsItem] | Unset = UNSET - if _invitations_permissions is not UNSET: - invitations_permissions = [] - for invitations_permissions_item_data in _invitations_permissions: - invitations_permissions_item = check_new_on_call_role_data_attributes_invitations_permissions_item( - invitations_permissions_item_data - ) + for invitations_permissions_item_data in _invitations_permissions or []: + invitations_permissions_item = check_new_on_call_role_data_attributes_invitations_permissions_item( + invitations_permissions_item_data + ) - invitations_permissions.append(invitations_permissions_item) + invitations_permissions.append(invitations_permissions_item) + live_call_routing_permissions = [] _live_call_routing_permissions = d.pop("live_call_routing_permissions", UNSET) - live_call_routing_permissions: list[NewOnCallRoleDataAttributesLiveCallRoutingPermissionsItem] | Unset = UNSET - if _live_call_routing_permissions is not UNSET: - live_call_routing_permissions = [] - for live_call_routing_permissions_item_data in _live_call_routing_permissions: - live_call_routing_permissions_item = ( - check_new_on_call_role_data_attributes_live_call_routing_permissions_item( - live_call_routing_permissions_item_data - ) + for live_call_routing_permissions_item_data in _live_call_routing_permissions or []: + live_call_routing_permissions_item = ( + check_new_on_call_role_data_attributes_live_call_routing_permissions_item( + live_call_routing_permissions_item_data ) + ) - live_call_routing_permissions.append(live_call_routing_permissions_item) + live_call_routing_permissions.append(live_call_routing_permissions_item) + schedule_override_permissions = [] _schedule_override_permissions = d.pop("schedule_override_permissions", UNSET) - schedule_override_permissions: list[NewOnCallRoleDataAttributesScheduleOverridePermissionsItem] | Unset = UNSET - if _schedule_override_permissions is not UNSET: - schedule_override_permissions = [] - for schedule_override_permissions_item_data in _schedule_override_permissions: - schedule_override_permissions_item = ( - check_new_on_call_role_data_attributes_schedule_override_permissions_item( - schedule_override_permissions_item_data - ) + for schedule_override_permissions_item_data in _schedule_override_permissions or []: + schedule_override_permissions_item = ( + check_new_on_call_role_data_attributes_schedule_override_permissions_item( + schedule_override_permissions_item_data ) + ) - schedule_override_permissions.append(schedule_override_permissions_item) + schedule_override_permissions.append(schedule_override_permissions_item) + schedules_permissions = [] _schedules_permissions = d.pop("schedules_permissions", UNSET) - schedules_permissions: list[NewOnCallRoleDataAttributesSchedulesPermissionsItem] | Unset = UNSET - if _schedules_permissions is not UNSET: - schedules_permissions = [] - for schedules_permissions_item_data in _schedules_permissions: - schedules_permissions_item = check_new_on_call_role_data_attributes_schedules_permissions_item( - schedules_permissions_item_data - ) + for schedules_permissions_item_data in _schedules_permissions or []: + schedules_permissions_item = check_new_on_call_role_data_attributes_schedules_permissions_item( + schedules_permissions_item_data + ) - schedules_permissions.append(schedules_permissions_item) + schedules_permissions.append(schedules_permissions_item) + services_permissions = [] _services_permissions = d.pop("services_permissions", UNSET) - services_permissions: list[NewOnCallRoleDataAttributesServicesPermissionsItem] | Unset = UNSET - if _services_permissions is not UNSET: - services_permissions = [] - for services_permissions_item_data in _services_permissions: - services_permissions_item = check_new_on_call_role_data_attributes_services_permissions_item( - services_permissions_item_data - ) + for services_permissions_item_data in _services_permissions or []: + services_permissions_item = check_new_on_call_role_data_attributes_services_permissions_item( + services_permissions_item_data + ) - services_permissions.append(services_permissions_item) + services_permissions.append(services_permissions_item) + functionalities_permissions = [] _functionalities_permissions = d.pop("functionalities_permissions", UNSET) - functionalities_permissions: list[NewOnCallRoleDataAttributesFunctionalitiesPermissionsItem] | Unset = UNSET - if _functionalities_permissions is not UNSET: - functionalities_permissions = [] - for functionalities_permissions_item_data in _functionalities_permissions: - functionalities_permissions_item = ( - check_new_on_call_role_data_attributes_functionalities_permissions_item( - functionalities_permissions_item_data - ) - ) + for functionalities_permissions_item_data in _functionalities_permissions or []: + functionalities_permissions_item = check_new_on_call_role_data_attributes_functionalities_permissions_item( + functionalities_permissions_item_data + ) - functionalities_permissions.append(functionalities_permissions_item) + functionalities_permissions.append(functionalities_permissions_item) + webhooks_permissions = [] _webhooks_permissions = d.pop("webhooks_permissions", UNSET) - webhooks_permissions: list[NewOnCallRoleDataAttributesWebhooksPermissionsItem] | Unset = UNSET - if _webhooks_permissions is not UNSET: - webhooks_permissions = [] - for webhooks_permissions_item_data in _webhooks_permissions: - webhooks_permissions_item = check_new_on_call_role_data_attributes_webhooks_permissions_item( - webhooks_permissions_item_data - ) + for webhooks_permissions_item_data in _webhooks_permissions or []: + webhooks_permissions_item = check_new_on_call_role_data_attributes_webhooks_permissions_item( + webhooks_permissions_item_data + ) - webhooks_permissions.append(webhooks_permissions_item) + webhooks_permissions.append(webhooks_permissions_item) + workflows_permissions = [] _workflows_permissions = d.pop("workflows_permissions", UNSET) - workflows_permissions: list[NewOnCallRoleDataAttributesWorkflowsPermissionsItem] | Unset = UNSET - if _workflows_permissions is not UNSET: - workflows_permissions = [] - for workflows_permissions_item_data in _workflows_permissions: - workflows_permissions_item = check_new_on_call_role_data_attributes_workflows_permissions_item( - workflows_permissions_item_data - ) + for workflows_permissions_item_data in _workflows_permissions or []: + workflows_permissions_item = check_new_on_call_role_data_attributes_workflows_permissions_item( + workflows_permissions_item_data + ) - workflows_permissions.append(workflows_permissions_item) + workflows_permissions.append(workflows_permissions_item) + catalogs_permissions = [] _catalogs_permissions = d.pop("catalogs_permissions", UNSET) - catalogs_permissions: list[NewOnCallRoleDataAttributesCatalogsPermissionsItem] | Unset = UNSET - if _catalogs_permissions is not UNSET: - catalogs_permissions = [] - for catalogs_permissions_item_data in _catalogs_permissions: - catalogs_permissions_item = check_new_on_call_role_data_attributes_catalogs_permissions_item( - catalogs_permissions_item_data - ) + for catalogs_permissions_item_data in _catalogs_permissions or []: + catalogs_permissions_item = check_new_on_call_role_data_attributes_catalogs_permissions_item( + catalogs_permissions_item_data + ) - catalogs_permissions.append(catalogs_permissions_item) + catalogs_permissions.append(catalogs_permissions_item) new_on_call_role_data_attributes = cls( name=name, + slug=slug, system_role=system_role, alert_fields_permissions=alert_fields_permissions, alert_groups_permissions=alert_groups_permissions, diff --git a/rootly_sdk/models/new_on_call_shadow.py b/rootly_sdk/models/new_on_call_shadow.py index a4930c3e..789a48c4 100644 --- a/rootly_sdk/models/new_on_call_shadow.py +++ b/rootly_sdk/models/new_on_call_shadow.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewOnCallShadow: data (NewOnCallShadowData): """ - data: NewOnCallShadowData + data: "NewOnCallShadowData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_on_call_shadow_data.py b/rootly_sdk/models/new_on_call_shadow_data.py index 52139f94..50063cff 100644 --- a/rootly_sdk/models/new_on_call_shadow_data.py +++ b/rootly_sdk/models/new_on_call_shadow_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class NewOnCallShadowData: """ type_: NewOnCallShadowDataType - attributes: NewOnCallShadowDataAttributes + attributes: "NewOnCallShadowDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_on_call_shadow_data_attributes.py b/rootly_sdk/models/new_on_call_shadow_data_attributes.py index f0ea1c0b..038e3f86 100644 --- a/rootly_sdk/models/new_on_call_shadow_data_attributes.py +++ b/rootly_sdk/models/new_on_call_shadow_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import datetime from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/new_override_shift.py b/rootly_sdk/models/new_override_shift.py index b2a8ebc8..6ded75a5 100644 --- a/rootly_sdk/models/new_override_shift.py +++ b/rootly_sdk/models/new_override_shift.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewOverrideShift: data (NewOverrideShiftData): """ - data: NewOverrideShiftData + data: "NewOverrideShiftData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_override_shift_data.py b/rootly_sdk/models/new_override_shift_data.py index 8164aa47..725b9463 100644 --- a/rootly_sdk/models/new_override_shift_data.py +++ b/rootly_sdk/models/new_override_shift_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class NewOverrideShiftData: """ type_: NewOverrideShiftDataType - attributes: NewOverrideShiftDataAttributes + attributes: "NewOverrideShiftDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_override_shift_data_attributes.py b/rootly_sdk/models/new_override_shift_data_attributes.py index 028469d7..41ca3559 100644 --- a/rootly_sdk/models/new_override_shift_data_attributes.py +++ b/rootly_sdk/models/new_override_shift_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import datetime from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/new_playbook.py b/rootly_sdk/models/new_playbook.py index 2877e31f..67ea823c 100644 --- a/rootly_sdk/models/new_playbook.py +++ b/rootly_sdk/models/new_playbook.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewPlaybook: data (NewPlaybookData): """ - data: NewPlaybookData + data: "NewPlaybookData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_playbook_data.py b/rootly_sdk/models/new_playbook_data.py index 85e7114a..d1ca1d51 100644 --- a/rootly_sdk/models/new_playbook_data.py +++ b/rootly_sdk/models/new_playbook_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class NewPlaybookData: """ type_: NewPlaybookDataType - attributes: NewPlaybookDataAttributes + attributes: "NewPlaybookDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_playbook_data_attributes.py b/rootly_sdk/models/new_playbook_data_attributes.py index 5dae9c85..35ffc7a5 100644 --- a/rootly_sdk/models/new_playbook_data_attributes.py +++ b/rootly_sdk/models/new_playbook_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -15,42 +13,42 @@ class NewPlaybookDataAttributes: """ Attributes: title (str): The title of the playbook - summary (None | str | Unset): The summary of the playbook - external_url (None | str | Unset): The external url of the playbook - severity_ids (list[str] | None | Unset): The Severity IDs to attach to the incident - environment_ids (list[str] | None | Unset): The Environment IDs to attach to the incident - service_ids (list[str] | None | Unset): The Service IDs to attach to the incident - functionality_ids (list[str] | None | Unset): The Functionality IDs to attach to the incident - group_ids (list[str] | None | Unset): The Team IDs to attach to the incident - incident_type_ids (list[str] | None | Unset): The Incident Type IDs to attach to the incident + summary (Union[None, Unset, str]): The summary of the playbook + external_url (Union[None, Unset, str]): The external url of the playbook + severity_ids (Union[None, Unset, list[str]]): The Severity IDs to attach to the incident + environment_ids (Union[None, Unset, list[str]]): The Environment IDs to attach to the incident + service_ids (Union[None, Unset, list[str]]): The Service IDs to attach to the incident + functionality_ids (Union[None, Unset, list[str]]): The Functionality IDs to attach to the incident + group_ids (Union[None, Unset, list[str]]): The Team IDs to attach to the incident + incident_type_ids (Union[None, Unset, list[str]]): The Incident Type IDs to attach to the incident """ title: str - summary: None | str | Unset = UNSET - external_url: None | str | Unset = UNSET - severity_ids: list[str] | None | Unset = UNSET - environment_ids: list[str] | None | Unset = UNSET - service_ids: list[str] | None | Unset = UNSET - functionality_ids: list[str] | None | Unset = UNSET - group_ids: list[str] | None | Unset = UNSET - incident_type_ids: list[str] | None | Unset = UNSET + summary: Union[None, Unset, str] = UNSET + external_url: Union[None, Unset, str] = UNSET + severity_ids: Union[None, Unset, list[str]] = UNSET + environment_ids: Union[None, Unset, list[str]] = UNSET + service_ids: Union[None, Unset, list[str]] = UNSET + functionality_ids: Union[None, Unset, list[str]] = UNSET + group_ids: Union[None, Unset, list[str]] = UNSET + incident_type_ids: Union[None, Unset, list[str]] = UNSET def to_dict(self) -> dict[str, Any]: title = self.title - summary: None | str | Unset + summary: Union[None, Unset, str] if isinstance(self.summary, Unset): summary = UNSET else: summary = self.summary - external_url: None | str | Unset + external_url: Union[None, Unset, str] if isinstance(self.external_url, Unset): external_url = UNSET else: external_url = self.external_url - severity_ids: list[str] | None | Unset + severity_ids: Union[None, Unset, list[str]] if isinstance(self.severity_ids, Unset): severity_ids = UNSET elif isinstance(self.severity_ids, list): @@ -59,7 +57,7 @@ def to_dict(self) -> dict[str, Any]: else: severity_ids = self.severity_ids - environment_ids: list[str] | None | Unset + environment_ids: Union[None, Unset, list[str]] if isinstance(self.environment_ids, Unset): environment_ids = UNSET elif isinstance(self.environment_ids, list): @@ -68,7 +66,7 @@ def to_dict(self) -> dict[str, Any]: else: environment_ids = self.environment_ids - service_ids: list[str] | None | Unset + service_ids: Union[None, Unset, list[str]] if isinstance(self.service_ids, Unset): service_ids = UNSET elif isinstance(self.service_ids, list): @@ -77,7 +75,7 @@ def to_dict(self) -> dict[str, Any]: else: service_ids = self.service_ids - functionality_ids: list[str] | None | Unset + functionality_ids: Union[None, Unset, list[str]] if isinstance(self.functionality_ids, Unset): functionality_ids = UNSET elif isinstance(self.functionality_ids, list): @@ -86,7 +84,7 @@ def to_dict(self) -> dict[str, Any]: else: functionality_ids = self.functionality_ids - group_ids: list[str] | None | Unset + group_ids: Union[None, Unset, list[str]] if isinstance(self.group_ids, Unset): group_ids = UNSET elif isinstance(self.group_ids, list): @@ -95,7 +93,7 @@ def to_dict(self) -> dict[str, Any]: else: group_ids = self.group_ids - incident_type_ids: list[str] | None | Unset + incident_type_ids: Union[None, Unset, list[str]] if isinstance(self.incident_type_ids, Unset): incident_type_ids = UNSET elif isinstance(self.incident_type_ids, list): @@ -135,25 +133,25 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) title = d.pop("title") - def _parse_summary(data: object) -> None | str | Unset: + def _parse_summary(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) summary = _parse_summary(d.pop("summary", UNSET)) - def _parse_external_url(data: object) -> None | str | Unset: + def _parse_external_url(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) external_url = _parse_external_url(d.pop("external_url", UNSET)) - def _parse_severity_ids(data: object) -> list[str] | None | Unset: + def _parse_severity_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -164,13 +162,13 @@ def _parse_severity_ids(data: object) -> list[str] | None | Unset: severity_ids_type_0 = cast(list[str], data) return severity_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) severity_ids = _parse_severity_ids(d.pop("severity_ids", UNSET)) - def _parse_environment_ids(data: object) -> list[str] | None | Unset: + def _parse_environment_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -181,13 +179,13 @@ def _parse_environment_ids(data: object) -> list[str] | None | Unset: environment_ids_type_0 = cast(list[str], data) return environment_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) environment_ids = _parse_environment_ids(d.pop("environment_ids", UNSET)) - def _parse_service_ids(data: object) -> list[str] | None | Unset: + def _parse_service_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -198,13 +196,13 @@ def _parse_service_ids(data: object) -> list[str] | None | Unset: service_ids_type_0 = cast(list[str], data) return service_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) service_ids = _parse_service_ids(d.pop("service_ids", UNSET)) - def _parse_functionality_ids(data: object) -> list[str] | None | Unset: + def _parse_functionality_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -215,13 +213,13 @@ def _parse_functionality_ids(data: object) -> list[str] | None | Unset: functionality_ids_type_0 = cast(list[str], data) return functionality_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) functionality_ids = _parse_functionality_ids(d.pop("functionality_ids", UNSET)) - def _parse_group_ids(data: object) -> list[str] | None | Unset: + def _parse_group_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -232,13 +230,13 @@ def _parse_group_ids(data: object) -> list[str] | None | Unset: group_ids_type_0 = cast(list[str], data) return group_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) group_ids = _parse_group_ids(d.pop("group_ids", UNSET)) - def _parse_incident_type_ids(data: object) -> list[str] | None | Unset: + def _parse_incident_type_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -249,9 +247,9 @@ def _parse_incident_type_ids(data: object) -> list[str] | None | Unset: incident_type_ids_type_0 = cast(list[str], data) return incident_type_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) incident_type_ids = _parse_incident_type_ids(d.pop("incident_type_ids", UNSET)) diff --git a/rootly_sdk/models/new_playbook_task.py b/rootly_sdk/models/new_playbook_task.py index 2358ad45..b7f5a3d5 100644 --- a/rootly_sdk/models/new_playbook_task.py +++ b/rootly_sdk/models/new_playbook_task.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewPlaybookTask: data (NewPlaybookTaskData): """ - data: NewPlaybookTaskData + data: "NewPlaybookTaskData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_playbook_task_data.py b/rootly_sdk/models/new_playbook_task_data.py index 68af70e6..e9008bb8 100644 --- a/rootly_sdk/models/new_playbook_task_data.py +++ b/rootly_sdk/models/new_playbook_task_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class NewPlaybookTaskData: """ type_: NewPlaybookTaskDataType - attributes: NewPlaybookTaskDataAttributes + attributes: "NewPlaybookTaskDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_playbook_task_data_attributes.py b/rootly_sdk/models/new_playbook_task_data_attributes.py index 7888c99c..b659e577 100644 --- a/rootly_sdk/models/new_playbook_task_data_attributes.py +++ b/rootly_sdk/models/new_playbook_task_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -15,24 +13,24 @@ class NewPlaybookTaskDataAttributes: """ Attributes: task (str): The task of the task - description (None | str | Unset): The description of the task - position (int | None | Unset): The position of the task + description (Union[None, Unset, str]): The description of the task + position (Union[None, Unset, int]): The position of the task """ task: str - description: None | str | Unset = UNSET - position: int | None | Unset = UNSET + description: Union[None, Unset, str] = UNSET + position: Union[None, Unset, int] = UNSET def to_dict(self) -> dict[str, Any]: task = self.task - description: None | str | Unset + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: description = self.description - position: int | None | Unset + position: Union[None, Unset, int] if isinstance(self.position, Unset): position = UNSET else: @@ -57,21 +55,21 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) task = d.pop("task") - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> Union[None, Unset, int]: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(Union[None, Unset, int], data) position = _parse_position(d.pop("position", UNSET)) diff --git a/rootly_sdk/models/new_post_mortem_template.py b/rootly_sdk/models/new_post_mortem_template.py index 9e51b0d5..0c6828d4 100644 --- a/rootly_sdk/models/new_post_mortem_template.py +++ b/rootly_sdk/models/new_post_mortem_template.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewPostMortemTemplate: data (NewPostMortemTemplateData): """ - data: NewPostMortemTemplateData + data: "NewPostMortemTemplateData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_post_mortem_template_data.py b/rootly_sdk/models/new_post_mortem_template_data.py index 96041417..538680f1 100644 --- a/rootly_sdk/models/new_post_mortem_template_data.py +++ b/rootly_sdk/models/new_post_mortem_template_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class NewPostMortemTemplateData: """ type_: NewPostMortemTemplateDataType - attributes: NewPostMortemTemplateDataAttributes + attributes: "NewPostMortemTemplateDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_post_mortem_template_data_attributes.py b/rootly_sdk/models/new_post_mortem_template_data_attributes.py index a90a8526..a3c0927e 100644 --- a/rootly_sdk/models/new_post_mortem_template_data_attributes.py +++ b/rootly_sdk/models/new_post_mortem_template_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -19,21 +17,30 @@ class NewPostMortemTemplateDataAttributes: """ Attributes: name (str): The name of the postmortem template - default (bool | None | Unset): Default selected template when editing a postmortem - content (str | Unset): The postmortem template. Supports TipTap blocks (followup and timeline components), + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + default (Union[None, Unset, bool]): Default selected template when editing a postmortem + content (Union[Unset, str]): The postmortem template. Supports TipTap blocks (followup and timeline components), Liquid syntax, and HTML. Will be sanitized and applied to both content and content_html fields. - format_ (NewPostMortemTemplateDataAttributesFormat | Unset): The format of the input Default: 'html'. + format_ (Union[Unset, NewPostMortemTemplateDataAttributesFormat]): The format of the input Default: 'html'. """ name: str - default: bool | None | Unset = UNSET - content: str | Unset = UNSET - format_: NewPostMortemTemplateDataAttributesFormat | Unset = "html" + slug: Union[None, Unset, str] = UNSET + default: Union[None, Unset, bool] = UNSET + content: Union[Unset, str] = UNSET + format_: Union[Unset, NewPostMortemTemplateDataAttributesFormat] = "html" def to_dict(self) -> dict[str, Any]: name = self.name - default: bool | None | Unset + slug: Union[None, Unset, str] + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug + + default: Union[None, Unset, bool] if isinstance(self.default, Unset): default = UNSET else: @@ -41,7 +48,7 @@ def to_dict(self) -> dict[str, Any]: content = self.content - format_: str | Unset = UNSET + format_: Union[Unset, str] = UNSET if not isinstance(self.format_, Unset): format_ = self.format_ @@ -52,6 +59,8 @@ def to_dict(self) -> dict[str, Any]: "name": name, } ) + if slug is not UNSET: + field_dict["slug"] = slug if default is not UNSET: field_dict["default"] = default if content is not UNSET: @@ -66,19 +75,28 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name") - def _parse_default(data: object) -> bool | None | Unset: + def _parse_slug(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + slug = _parse_slug(d.pop("slug", UNSET)) + + def _parse_default(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) default = _parse_default(d.pop("default", UNSET)) content = d.pop("content", UNSET) _format_ = d.pop("format", UNSET) - format_: NewPostMortemTemplateDataAttributesFormat | Unset + format_: Union[Unset, NewPostMortemTemplateDataAttributesFormat] if isinstance(_format_, Unset): format_ = UNSET else: @@ -86,6 +104,7 @@ def _parse_default(data: object) -> bool | None | Unset: new_post_mortem_template_data_attributes = cls( name=name, + slug=slug, default=default, content=content, format_=format_, diff --git a/rootly_sdk/models/new_pulse.py b/rootly_sdk/models/new_pulse.py index b674db54..0d6e9db2 100644 --- a/rootly_sdk/models/new_pulse.py +++ b/rootly_sdk/models/new_pulse.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewPulse: data (NewPulseData): """ - data: NewPulseData + data: "NewPulseData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_pulse_data.py b/rootly_sdk/models/new_pulse_data.py index 7e407845..7d35da03 100644 --- a/rootly_sdk/models/new_pulse_data.py +++ b/rootly_sdk/models/new_pulse_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class NewPulseData: """ type_: NewPulseDataType - attributes: NewPulseDataAttributes + attributes: "NewPulseDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_pulse_data_attributes.py b/rootly_sdk/models/new_pulse_data_attributes.py index c16515c8..f15cf119 100644 --- a/rootly_sdk/models/new_pulse_data_attributes.py +++ b/rootly_sdk/models/new_pulse_data_attributes.py @@ -1,8 +1,6 @@ -from __future__ import annotations - import datetime from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from dateutil.parser import isoparse @@ -23,27 +21,27 @@ class NewPulseDataAttributes: """ Attributes: summary (str): The summary of the pulse - source (None | str | Unset): The source of the pulse (eg: k8s) - service_ids (list[str] | None | Unset): The Service IDs to attach to the pulse - environment_ids (list[str] | None | Unset): The Environment IDs to attach to the pulse - started_at (datetime.datetime | None | Unset): Pulse start datetime - ended_at (datetime.datetime | None | Unset): Pulse end datetime - external_url (None | str | Unset): The external url of the pulse - labels (list[NewPulseDataAttributesLabelsItemType0 | None] | Unset): - refs (list[NewPulseDataAttributesRefsItemType0 | None] | Unset): - data (NewPulseDataAttributesDataType0 | None | Unset): Additional data + source (Union[None, Unset, str]): The source of the pulse (eg: k8s) + service_ids (Union[None, Unset, list[str]]): The Service IDs to attach to the pulse + environment_ids (Union[None, Unset, list[str]]): The Environment IDs to attach to the pulse + started_at (Union[None, Unset, datetime.datetime]): Pulse start datetime + ended_at (Union[None, Unset, datetime.datetime]): Pulse end datetime + external_url (Union[None, Unset, str]): The external url of the pulse + labels (Union[Unset, list[Union['NewPulseDataAttributesLabelsItemType0', None]]]): + refs (Union[Unset, list[Union['NewPulseDataAttributesRefsItemType0', None]]]): + data (Union['NewPulseDataAttributesDataType0', None, Unset]): Additional data """ summary: str - source: None | str | Unset = UNSET - service_ids: list[str] | None | Unset = UNSET - environment_ids: list[str] | None | Unset = UNSET - started_at: datetime.datetime | None | Unset = UNSET - ended_at: datetime.datetime | None | Unset = UNSET - external_url: None | str | Unset = UNSET - labels: list[NewPulseDataAttributesLabelsItemType0 | None] | Unset = UNSET - refs: list[NewPulseDataAttributesRefsItemType0 | None] | Unset = UNSET - data: NewPulseDataAttributesDataType0 | None | Unset = UNSET + source: Union[None, Unset, str] = UNSET + service_ids: Union[None, Unset, list[str]] = UNSET + environment_ids: Union[None, Unset, list[str]] = UNSET + started_at: Union[None, Unset, datetime.datetime] = UNSET + ended_at: Union[None, Unset, datetime.datetime] = UNSET + external_url: Union[None, Unset, str] = UNSET + labels: Union[Unset, list[Union["NewPulseDataAttributesLabelsItemType0", None]]] = UNSET + refs: Union[Unset, list[Union["NewPulseDataAttributesRefsItemType0", None]]] = UNSET + data: Union["NewPulseDataAttributesDataType0", None, Unset] = UNSET def to_dict(self) -> dict[str, Any]: from ..models.new_pulse_data_attributes_data_type_0 import NewPulseDataAttributesDataType0 @@ -52,13 +50,13 @@ def to_dict(self) -> dict[str, Any]: summary = self.summary - source: None | str | Unset + source: Union[None, Unset, str] if isinstance(self.source, Unset): source = UNSET else: source = self.source - service_ids: list[str] | None | Unset + service_ids: Union[None, Unset, list[str]] if isinstance(self.service_ids, Unset): service_ids = UNSET elif isinstance(self.service_ids, list): @@ -67,7 +65,7 @@ def to_dict(self) -> dict[str, Any]: else: service_ids = self.service_ids - environment_ids: list[str] | None | Unset + environment_ids: Union[None, Unset, list[str]] if isinstance(self.environment_ids, Unset): environment_ids = UNSET elif isinstance(self.environment_ids, list): @@ -76,7 +74,7 @@ def to_dict(self) -> dict[str, Any]: else: environment_ids = self.environment_ids - started_at: None | str | Unset + started_at: Union[None, Unset, str] if isinstance(self.started_at, Unset): started_at = UNSET elif isinstance(self.started_at, datetime.datetime): @@ -84,7 +82,7 @@ def to_dict(self) -> dict[str, Any]: else: started_at = self.started_at - ended_at: None | str | Unset + ended_at: Union[None, Unset, str] if isinstance(self.ended_at, Unset): ended_at = UNSET elif isinstance(self.ended_at, datetime.datetime): @@ -92,35 +90,35 @@ def to_dict(self) -> dict[str, Any]: else: ended_at = self.ended_at - external_url: None | str | Unset + external_url: Union[None, Unset, str] if isinstance(self.external_url, Unset): external_url = UNSET else: external_url = self.external_url - labels: list[dict[str, Any] | None] | Unset = UNSET + labels: Union[Unset, list[Union[None, dict[str, Any]]]] = UNSET if not isinstance(self.labels, Unset): labels = [] for labels_item_data in self.labels: - labels_item: dict[str, Any] | None + labels_item: Union[None, dict[str, Any]] if isinstance(labels_item_data, NewPulseDataAttributesLabelsItemType0): labels_item = labels_item_data.to_dict() else: labels_item = labels_item_data labels.append(labels_item) - refs: list[dict[str, Any] | None] | Unset = UNSET + refs: Union[Unset, list[Union[None, dict[str, Any]]]] = UNSET if not isinstance(self.refs, Unset): refs = [] for refs_item_data in self.refs: - refs_item: dict[str, Any] | None + refs_item: Union[None, dict[str, Any]] if isinstance(refs_item_data, NewPulseDataAttributesRefsItemType0): refs_item = refs_item_data.to_dict() else: refs_item = refs_item_data refs.append(refs_item) - data: dict[str, Any] | None | Unset + data: Union[None, Unset, dict[str, Any]] if isinstance(self.data, Unset): data = UNSET elif isinstance(self.data, NewPulseDataAttributesDataType0): @@ -165,16 +163,16 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) summary = d.pop("summary") - def _parse_source(data: object) -> None | str | Unset: + def _parse_source(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) source = _parse_source(d.pop("source", UNSET)) - def _parse_service_ids(data: object) -> list[str] | None | Unset: + def _parse_service_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -185,13 +183,13 @@ def _parse_service_ids(data: object) -> list[str] | None | Unset: service_ids_type_0 = cast(list[str], data) return service_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) service_ids = _parse_service_ids(d.pop("service_ids", UNSET)) - def _parse_environment_ids(data: object) -> list[str] | None | Unset: + def _parse_environment_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -202,13 +200,13 @@ def _parse_environment_ids(data: object) -> list[str] | None | Unset: environment_ids_type_0 = cast(list[str], data) return environment_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) environment_ids = _parse_environment_ids(d.pop("environment_ids", UNSET)) - def _parse_started_at(data: object) -> datetime.datetime | None | Unset: + def _parse_started_at(data: object) -> Union[None, Unset, datetime.datetime]: if data is None: return data if isinstance(data, Unset): @@ -219,13 +217,13 @@ def _parse_started_at(data: object) -> datetime.datetime | None | Unset: started_at_type_0 = isoparse(data) return started_at_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(datetime.datetime | None | Unset, data) + return cast(Union[None, Unset, datetime.datetime], data) started_at = _parse_started_at(d.pop("started_at", UNSET)) - def _parse_ended_at(data: object) -> datetime.datetime | None | Unset: + def _parse_ended_at(data: object) -> Union[None, Unset, datetime.datetime]: if data is None: return data if isinstance(data, Unset): @@ -236,68 +234,64 @@ def _parse_ended_at(data: object) -> datetime.datetime | None | Unset: ended_at_type_0 = isoparse(data) return ended_at_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(datetime.datetime | None | Unset, data) + return cast(Union[None, Unset, datetime.datetime], data) ended_at = _parse_ended_at(d.pop("ended_at", UNSET)) - def _parse_external_url(data: object) -> None | str | Unset: + def _parse_external_url(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) external_url = _parse_external_url(d.pop("external_url", UNSET)) + labels = [] _labels = d.pop("labels", UNSET) - labels: list[NewPulseDataAttributesLabelsItemType0 | None] | Unset = UNSET - if _labels is not UNSET: - labels = [] - for labels_item_data in _labels: + for labels_item_data in _labels or []: - def _parse_labels_item(data: object) -> NewPulseDataAttributesLabelsItemType0 | None: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - labels_item_type_0 = NewPulseDataAttributesLabelsItemType0.from_dict(data) + def _parse_labels_item(data: object) -> Union["NewPulseDataAttributesLabelsItemType0", None]: + if data is None: + return data + try: + if not isinstance(data, dict): + raise TypeError() + labels_item_type_0 = NewPulseDataAttributesLabelsItemType0.from_dict(data) - return labels_item_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(NewPulseDataAttributesLabelsItemType0 | None, data) + return labels_item_type_0 + except: # noqa: E722 + pass + return cast(Union["NewPulseDataAttributesLabelsItemType0", None], data) - labels_item = _parse_labels_item(labels_item_data) + labels_item = _parse_labels_item(labels_item_data) - labels.append(labels_item) + labels.append(labels_item) + refs = [] _refs = d.pop("refs", UNSET) - refs: list[NewPulseDataAttributesRefsItemType0 | None] | Unset = UNSET - if _refs is not UNSET: - refs = [] - for refs_item_data in _refs: + for refs_item_data in _refs or []: - def _parse_refs_item(data: object) -> NewPulseDataAttributesRefsItemType0 | None: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - refs_item_type_0 = NewPulseDataAttributesRefsItemType0.from_dict(data) + def _parse_refs_item(data: object) -> Union["NewPulseDataAttributesRefsItemType0", None]: + if data is None: + return data + try: + if not isinstance(data, dict): + raise TypeError() + refs_item_type_0 = NewPulseDataAttributesRefsItemType0.from_dict(data) - return refs_item_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(NewPulseDataAttributesRefsItemType0 | None, data) + return refs_item_type_0 + except: # noqa: E722 + pass + return cast(Union["NewPulseDataAttributesRefsItemType0", None], data) - refs_item = _parse_refs_item(refs_item_data) + refs_item = _parse_refs_item(refs_item_data) - refs.append(refs_item) + refs.append(refs_item) - def _parse_data(data: object) -> NewPulseDataAttributesDataType0 | None | Unset: + def _parse_data(data: object) -> Union["NewPulseDataAttributesDataType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -308,9 +302,9 @@ def _parse_data(data: object) -> NewPulseDataAttributesDataType0 | None | Unset: data_type_0 = NewPulseDataAttributesDataType0.from_dict(data) return data_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(NewPulseDataAttributesDataType0 | None | Unset, data) + return cast(Union["NewPulseDataAttributesDataType0", None, Unset], data) data = _parse_data(d.pop("data", UNSET)) diff --git a/rootly_sdk/models/new_pulse_data_attributes_data_type_0.py b/rootly_sdk/models/new_pulse_data_attributes_data_type_0.py index 03734676..cbb26d78 100644 --- a/rootly_sdk/models/new_pulse_data_attributes_data_type_0.py +++ b/rootly_sdk/models/new_pulse_data_attributes_data_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,7 +14,6 @@ class NewPulseDataAttributesDataType0: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) diff --git a/rootly_sdk/models/new_pulse_data_attributes_labels_item_type_0.py b/rootly_sdk/models/new_pulse_data_attributes_labels_item_type_0.py index b85f9272..66fe8bd4 100644 --- a/rootly_sdk/models/new_pulse_data_attributes_labels_item_type_0.py +++ b/rootly_sdk/models/new_pulse_data_attributes_labels_item_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/new_pulse_data_attributes_refs_item_type_0.py b/rootly_sdk/models/new_pulse_data_attributes_refs_item_type_0.py index dafc0f72..100089af 100644 --- a/rootly_sdk/models/new_pulse_data_attributes_refs_item_type_0.py +++ b/rootly_sdk/models/new_pulse_data_attributes_refs_item_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/new_retrospective_process.py b/rootly_sdk/models/new_retrospective_process.py index b503747b..b24711b4 100644 --- a/rootly_sdk/models/new_retrospective_process.py +++ b/rootly_sdk/models/new_retrospective_process.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewRetrospectiveProcess: data (NewRetrospectiveProcessData): """ - data: NewRetrospectiveProcessData + data: "NewRetrospectiveProcessData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_retrospective_process_data.py b/rootly_sdk/models/new_retrospective_process_data.py index 0784fceb..d6925f7d 100644 --- a/rootly_sdk/models/new_retrospective_process_data.py +++ b/rootly_sdk/models/new_retrospective_process_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class NewRetrospectiveProcessData: """ type_: NewRetrospectiveProcessDataType - attributes: NewRetrospectiveProcessDataAttributes + attributes: "NewRetrospectiveProcessDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_retrospective_process_data_attributes.py b/rootly_sdk/models/new_retrospective_process_data_attributes.py index 49bfd3bf..6a809d77 100644 --- a/rootly_sdk/models/new_retrospective_process_data_attributes.py +++ b/rootly_sdk/models/new_retrospective_process_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -29,22 +27,22 @@ class NewRetrospectiveProcessDataAttributes: name (str): The name of the retrospective process copy_from (str): Retrospective process ID from which retrospective steps have to be copied. To use starter template for retrospective steps provide value: 'starter_template' - description (None | str | Unset): The description of the retrospective process + description (Union[None, Unset, str]): The description of the retrospective process retrospective_process_matching_criteria - (NewRetrospectiveProcessDataAttributesRetrospectiveProcessMatchingCriteriaType0 | - NewRetrospectiveProcessDataAttributesRetrospectiveProcessMatchingCriteriaType1 | - NewRetrospectiveProcessDataAttributesRetrospectiveProcessMatchingCriteriaType2 | Unset): + (Union['NewRetrospectiveProcessDataAttributesRetrospectiveProcessMatchingCriteriaType0', + 'NewRetrospectiveProcessDataAttributesRetrospectiveProcessMatchingCriteriaType1', + 'NewRetrospectiveProcessDataAttributesRetrospectiveProcessMatchingCriteriaType2', Unset]): """ name: str copy_from: str - description: None | str | Unset = UNSET - retrospective_process_matching_criteria: ( - NewRetrospectiveProcessDataAttributesRetrospectiveProcessMatchingCriteriaType0 - | NewRetrospectiveProcessDataAttributesRetrospectiveProcessMatchingCriteriaType1 - | NewRetrospectiveProcessDataAttributesRetrospectiveProcessMatchingCriteriaType2 - | Unset - ) = UNSET + description: Union[None, Unset, str] = UNSET + retrospective_process_matching_criteria: Union[ + "NewRetrospectiveProcessDataAttributesRetrospectiveProcessMatchingCriteriaType0", + "NewRetrospectiveProcessDataAttributesRetrospectiveProcessMatchingCriteriaType1", + "NewRetrospectiveProcessDataAttributesRetrospectiveProcessMatchingCriteriaType2", + Unset, + ] = UNSET def to_dict(self) -> dict[str, Any]: from ..models.new_retrospective_process_data_attributes_retrospective_process_matching_criteria_type_0 import ( @@ -58,13 +56,13 @@ def to_dict(self) -> dict[str, Any]: copy_from = self.copy_from - description: None | str | Unset + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: description = self.description - retrospective_process_matching_criteria: dict[str, Any] | Unset + retrospective_process_matching_criteria: Union[Unset, dict[str, Any]] if isinstance(self.retrospective_process_matching_criteria, Unset): retrospective_process_matching_criteria = UNSET elif isinstance( @@ -112,23 +110,23 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: copy_from = d.pop("copy_from") - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) def _parse_retrospective_process_matching_criteria( data: object, - ) -> ( - NewRetrospectiveProcessDataAttributesRetrospectiveProcessMatchingCriteriaType0 - | NewRetrospectiveProcessDataAttributesRetrospectiveProcessMatchingCriteriaType1 - | NewRetrospectiveProcessDataAttributesRetrospectiveProcessMatchingCriteriaType2 - | Unset - ): + ) -> Union[ + "NewRetrospectiveProcessDataAttributesRetrospectiveProcessMatchingCriteriaType0", + "NewRetrospectiveProcessDataAttributesRetrospectiveProcessMatchingCriteriaType1", + "NewRetrospectiveProcessDataAttributesRetrospectiveProcessMatchingCriteriaType2", + Unset, + ]: if isinstance(data, Unset): return data try: @@ -139,7 +137,7 @@ def _parse_retrospective_process_matching_criteria( ) return retrospective_process_matching_criteria_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -149,7 +147,7 @@ def _parse_retrospective_process_matching_criteria( ) return retrospective_process_matching_criteria_type_1 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass if not isinstance(data, dict): raise TypeError() diff --git a/rootly_sdk/models/new_retrospective_process_data_attributes_retrospective_process_matching_criteria_type_0.py b/rootly_sdk/models/new_retrospective_process_data_attributes_retrospective_process_matching_criteria_type_0.py index bb07129a..e4a84e85 100644 --- a/rootly_sdk/models/new_retrospective_process_data_attributes_retrospective_process_matching_criteria_type_0.py +++ b/rootly_sdk/models/new_retrospective_process_data_attributes_retrospective_process_matching_criteria_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast diff --git a/rootly_sdk/models/new_retrospective_process_data_attributes_retrospective_process_matching_criteria_type_1.py b/rootly_sdk/models/new_retrospective_process_data_attributes_retrospective_process_matching_criteria_type_1.py index 452c2da5..98eba687 100644 --- a/rootly_sdk/models/new_retrospective_process_data_attributes_retrospective_process_matching_criteria_type_1.py +++ b/rootly_sdk/models/new_retrospective_process_data_attributes_retrospective_process_matching_criteria_type_1.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast diff --git a/rootly_sdk/models/new_retrospective_process_data_attributes_retrospective_process_matching_criteria_type_2.py b/rootly_sdk/models/new_retrospective_process_data_attributes_retrospective_process_matching_criteria_type_2.py index 5645b537..1a35d6a4 100644 --- a/rootly_sdk/models/new_retrospective_process_data_attributes_retrospective_process_matching_criteria_type_2.py +++ b/rootly_sdk/models/new_retrospective_process_data_attributes_retrospective_process_matching_criteria_type_2.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast diff --git a/rootly_sdk/models/new_retrospective_process_group.py b/rootly_sdk/models/new_retrospective_process_group.py index 8af8a734..6aa11d4a 100644 --- a/rootly_sdk/models/new_retrospective_process_group.py +++ b/rootly_sdk/models/new_retrospective_process_group.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewRetrospectiveProcessGroup: data (NewRetrospectiveProcessGroupData): """ - data: NewRetrospectiveProcessGroupData + data: "NewRetrospectiveProcessGroupData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_retrospective_process_group_data.py b/rootly_sdk/models/new_retrospective_process_group_data.py index 10615645..25dcfe6d 100644 --- a/rootly_sdk/models/new_retrospective_process_group_data.py +++ b/rootly_sdk/models/new_retrospective_process_group_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class NewRetrospectiveProcessGroupData: """ type_: NewRetrospectiveProcessGroupDataType - attributes: NewRetrospectiveProcessGroupDataAttributes + attributes: "NewRetrospectiveProcessGroupDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_retrospective_process_group_data_attributes.py b/rootly_sdk/models/new_retrospective_process_group_data_attributes.py index a9d822d9..06bf8807 100644 --- a/rootly_sdk/models/new_retrospective_process_group_data_attributes.py +++ b/rootly_sdk/models/new_retrospective_process_group_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define @@ -15,11 +13,11 @@ class NewRetrospectiveProcessGroupDataAttributes: """ Attributes: sub_status_id (str): - position (int | Unset): + position (Union[Unset, int]): """ sub_status_id: str - position: int | Unset = UNSET + position: Union[Unset, int] = UNSET def to_dict(self) -> dict[str, Any]: sub_status_id = self.sub_status_id diff --git a/rootly_sdk/models/new_retrospective_process_group_step.py b/rootly_sdk/models/new_retrospective_process_group_step.py index b700bfc2..7ab02994 100644 --- a/rootly_sdk/models/new_retrospective_process_group_step.py +++ b/rootly_sdk/models/new_retrospective_process_group_step.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewRetrospectiveProcessGroupStep: data (NewRetrospectiveProcessGroupStepData): """ - data: NewRetrospectiveProcessGroupStepData + data: "NewRetrospectiveProcessGroupStepData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_retrospective_process_group_step_data.py b/rootly_sdk/models/new_retrospective_process_group_step_data.py index 7aeeb8b3..ca566165 100644 --- a/rootly_sdk/models/new_retrospective_process_group_step_data.py +++ b/rootly_sdk/models/new_retrospective_process_group_step_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class NewRetrospectiveProcessGroupStepData: """ type_: NewRetrospectiveProcessGroupStepDataType - attributes: NewRetrospectiveProcessGroupStepDataAttributes + attributes: "NewRetrospectiveProcessGroupStepDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_retrospective_process_group_step_data_attributes.py b/rootly_sdk/models/new_retrospective_process_group_step_data_attributes.py index 5374e922..6e0ec504 100644 --- a/rootly_sdk/models/new_retrospective_process_group_step_data_attributes.py +++ b/rootly_sdk/models/new_retrospective_process_group_step_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define @@ -15,11 +13,11 @@ class NewRetrospectiveProcessGroupStepDataAttributes: """ Attributes: retrospective_step_id (str): - position (int | Unset): + position (Union[Unset, int]): """ retrospective_step_id: str - position: int | Unset = UNSET + position: Union[Unset, int] = UNSET def to_dict(self) -> dict[str, Any]: retrospective_step_id = self.retrospective_step_id diff --git a/rootly_sdk/models/new_retrospective_step.py b/rootly_sdk/models/new_retrospective_step.py index f1f314d6..af77e064 100644 --- a/rootly_sdk/models/new_retrospective_step.py +++ b/rootly_sdk/models/new_retrospective_step.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewRetrospectiveStep: data (NewRetrospectiveStepData): """ - data: NewRetrospectiveStepData + data: "NewRetrospectiveStepData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_retrospective_step_data.py b/rootly_sdk/models/new_retrospective_step_data.py index 940e62ff..d15c1567 100644 --- a/rootly_sdk/models/new_retrospective_step_data.py +++ b/rootly_sdk/models/new_retrospective_step_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class NewRetrospectiveStepData: """ type_: NewRetrospectiveStepDataType - attributes: NewRetrospectiveStepDataAttributes + attributes: "NewRetrospectiveStepDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_retrospective_step_data_attributes.py b/rootly_sdk/models/new_retrospective_step_data_attributes.py index 3b6079ec..2519eb1e 100644 --- a/rootly_sdk/models/new_retrospective_step_data_attributes.py +++ b/rootly_sdk/models/new_retrospective_step_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -15,43 +13,52 @@ class NewRetrospectiveStepDataAttributes: """ Attributes: title (str): The name of the step - description (None | str | Unset): The description of the step - due_after_days (int | None | Unset): Due date in days - incident_role_id (None | str | Unset): Users assigned to the selected incident role will be the default owners - for this step - position (int | None | Unset): Position of the step - skippable (bool | Unset): Is the step skippable? + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `title`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + description (Union[None, Unset, str]): The description of the step + due_after_days (Union[None, Unset, int]): Due date in days + incident_role_id (Union[None, Unset, str]): Users assigned to the selected incident role will be the default + owners for this step + position (Union[None, Unset, int]): Position of the step + skippable (Union[Unset, bool]): Is the step skippable? """ title: str - description: None | str | Unset = UNSET - due_after_days: int | None | Unset = UNSET - incident_role_id: None | str | Unset = UNSET - position: int | None | Unset = UNSET - skippable: bool | Unset = UNSET + slug: Union[None, Unset, str] = UNSET + description: Union[None, Unset, str] = UNSET + due_after_days: Union[None, Unset, int] = UNSET + incident_role_id: Union[None, Unset, str] = UNSET + position: Union[None, Unset, int] = UNSET + skippable: Union[Unset, bool] = UNSET def to_dict(self) -> dict[str, Any]: title = self.title - description: None | str | Unset + slug: Union[None, Unset, str] + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug + + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: description = self.description - due_after_days: int | None | Unset + due_after_days: Union[None, Unset, int] if isinstance(self.due_after_days, Unset): due_after_days = UNSET else: due_after_days = self.due_after_days - incident_role_id: None | str | Unset + incident_role_id: Union[None, Unset, str] if isinstance(self.incident_role_id, Unset): incident_role_id = UNSET else: incident_role_id = self.incident_role_id - position: int | None | Unset + position: Union[None, Unset, int] if isinstance(self.position, Unset): position = UNSET else: @@ -66,6 +73,8 @@ def to_dict(self) -> dict[str, Any]: "title": title, } ) + if slug is not UNSET: + field_dict["slug"] = slug if description is not UNSET: field_dict["description"] = description if due_after_days is not UNSET: @@ -84,39 +93,48 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) title = d.pop("title") - def _parse_description(data: object) -> None | str | Unset: + def _parse_slug(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + slug = _parse_slug(d.pop("slug", UNSET)) + + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) - def _parse_due_after_days(data: object) -> int | None | Unset: + def _parse_due_after_days(data: object) -> Union[None, Unset, int]: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(Union[None, Unset, int], data) due_after_days = _parse_due_after_days(d.pop("due_after_days", UNSET)) - def _parse_incident_role_id(data: object) -> None | str | Unset: + def _parse_incident_role_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) incident_role_id = _parse_incident_role_id(d.pop("incident_role_id", UNSET)) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> Union[None, Unset, int]: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(Union[None, Unset, int], data) position = _parse_position(d.pop("position", UNSET)) @@ -124,6 +142,7 @@ def _parse_position(data: object) -> int | None | Unset: new_retrospective_step_data_attributes = cls( title=title, + slug=slug, description=description, due_after_days=due_after_days, incident_role_id=incident_role_id, diff --git a/rootly_sdk/models/new_role.py b/rootly_sdk/models/new_role.py index ec5324cb..d8bedece 100644 --- a/rootly_sdk/models/new_role.py +++ b/rootly_sdk/models/new_role.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewRole: data (NewRoleData): """ - data: NewRoleData + data: "NewRoleData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_role_data.py b/rootly_sdk/models/new_role_data.py index f591f76f..69f3ba5f 100644 --- a/rootly_sdk/models/new_role_data.py +++ b/rootly_sdk/models/new_role_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class NewRoleData: """ type_: NewRoleDataType - attributes: NewRoleDataAttributes + attributes: "NewRoleDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_role_data_attributes.py b/rootly_sdk/models/new_role_data_attributes.py index db2e7aa3..38534612 100644 --- a/rootly_sdk/models/new_role_data_attributes.py +++ b/rootly_sdk/models/new_role_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -147,312 +145,325 @@ class NewRoleDataAttributes: """ Attributes: name (str): The role name. - incident_permission_set_id (None | str | Unset): Associated incident permissions set. - alerts_permissions (list[NewRoleDataAttributesAlertsPermissionsItem] | Unset): - api_keys_permissions (list[NewRoleDataAttributesApiKeysPermissionsItem] | Unset): - audits_permissions (list[NewRoleDataAttributesAuditsPermissionsItem] | Unset): - billing_permissions (list[NewRoleDataAttributesBillingPermissionsItem] | Unset): - environments_permissions (list[NewRoleDataAttributesEnvironmentsPermissionsItem] | Unset): - form_fields_permissions (list[NewRoleDataAttributesFormFieldsPermissionsItem] | Unset): - functionalities_permissions (list[NewRoleDataAttributesFunctionalitiesPermissionsItem] | Unset): - groups_permissions (list[NewRoleDataAttributesGroupsPermissionsItem] | Unset): - incident_causes_permissions (list[NewRoleDataAttributesIncidentCausesPermissionsItem] | Unset): - incident_feedbacks_permissions (list[NewRoleDataAttributesIncidentFeedbacksPermissionsItem] | Unset): - incident_roles_permissions (list[NewRoleDataAttributesIncidentRolesPermissionsItem] | Unset): - incident_types_permissions (list[NewRoleDataAttributesIncidentTypesPermissionsItem] | Unset): - incidents_permissions (list[NewRoleDataAttributesIncidentsPermissionsItem] | Unset): - integrations_permissions (list[NewRoleDataAttributesIntegrationsPermissionsItem] | Unset): - invitations_permissions (list[NewRoleDataAttributesInvitationsPermissionsItem] | Unset): - playbooks_permissions (list[NewRoleDataAttributesPlaybooksPermissionsItem] | Unset): - private_incidents_permissions (list[NewRoleDataAttributesPrivateIncidentsPermissionsItem] | Unset): - pulses_permissions (list[NewRoleDataAttributesPulsesPermissionsItem] | Unset): - retrospective_permissions (list[NewRoleDataAttributesRetrospectivePermissionsItem] | Unset): - roles_permissions (list[NewRoleDataAttributesRolesPermissionsItem] | Unset): - secrets_permissions (list[NewRoleDataAttributesSecretsPermissionsItem] | Unset): - services_permissions (list[NewRoleDataAttributesServicesPermissionsItem] | Unset): - severities_permissions (list[NewRoleDataAttributesSeveritiesPermissionsItem] | Unset): - status_pages_permissions (list[NewRoleDataAttributesStatusPagesPermissionsItem] | Unset): - webhooks_permissions (list[NewRoleDataAttributesWebhooksPermissionsItem] | Unset): - workflows_permissions (list[NewRoleDataAttributesWorkflowsPermissionsItem] | Unset): - catalogs_permissions (list[NewRoleDataAttributesCatalogsPermissionsItem] | Unset): - sub_statuses_permissions (list[NewRoleDataAttributesSubStatusesPermissionsItem] | Unset): - edge_connector_permissions (list[NewRoleDataAttributesEdgeConnectorPermissionsItem] | Unset): - slas_permissions (list[NewRoleDataAttributesSlasPermissionsItem] | Unset): - paging_permissions (list[NewRoleDataAttributesPagingPermissionsItem] | Unset): - incident_communication_permissions (list[NewRoleDataAttributesIncidentCommunicationPermissionsItem] | Unset): - communication_permissions (list[NewRoleDataAttributesCommunicationPermissionsItem] | Unset): + slug (Union[None, Unset, str]): Deprecated. Custom role slugs remain accepted temporarily. Stop setting `slug`; + it will become read-only and be derived from `name` when this property is removed from the request schema in a + future version. + incident_permission_set_id (Union[None, Unset, str]): Associated incident permissions set. + alerts_permissions (Union[Unset, list[NewRoleDataAttributesAlertsPermissionsItem]]): + api_keys_permissions (Union[Unset, list[NewRoleDataAttributesApiKeysPermissionsItem]]): + audits_permissions (Union[Unset, list[NewRoleDataAttributesAuditsPermissionsItem]]): + billing_permissions (Union[Unset, list[NewRoleDataAttributesBillingPermissionsItem]]): + environments_permissions (Union[Unset, list[NewRoleDataAttributesEnvironmentsPermissionsItem]]): + form_fields_permissions (Union[Unset, list[NewRoleDataAttributesFormFieldsPermissionsItem]]): + functionalities_permissions (Union[Unset, list[NewRoleDataAttributesFunctionalitiesPermissionsItem]]): + groups_permissions (Union[Unset, list[NewRoleDataAttributesGroupsPermissionsItem]]): + incident_causes_permissions (Union[Unset, list[NewRoleDataAttributesIncidentCausesPermissionsItem]]): + incident_feedbacks_permissions (Union[Unset, list[NewRoleDataAttributesIncidentFeedbacksPermissionsItem]]): + incident_roles_permissions (Union[Unset, list[NewRoleDataAttributesIncidentRolesPermissionsItem]]): + incident_types_permissions (Union[Unset, list[NewRoleDataAttributesIncidentTypesPermissionsItem]]): + incidents_permissions (Union[Unset, list[NewRoleDataAttributesIncidentsPermissionsItem]]): + integrations_permissions (Union[Unset, list[NewRoleDataAttributesIntegrationsPermissionsItem]]): + invitations_permissions (Union[Unset, list[NewRoleDataAttributesInvitationsPermissionsItem]]): + playbooks_permissions (Union[Unset, list[NewRoleDataAttributesPlaybooksPermissionsItem]]): + private_incidents_permissions (Union[Unset, list[NewRoleDataAttributesPrivateIncidentsPermissionsItem]]): + pulses_permissions (Union[Unset, list[NewRoleDataAttributesPulsesPermissionsItem]]): + retrospective_permissions (Union[Unset, list[NewRoleDataAttributesRetrospectivePermissionsItem]]): + roles_permissions (Union[Unset, list[NewRoleDataAttributesRolesPermissionsItem]]): + secrets_permissions (Union[Unset, list[NewRoleDataAttributesSecretsPermissionsItem]]): + services_permissions (Union[Unset, list[NewRoleDataAttributesServicesPermissionsItem]]): + severities_permissions (Union[Unset, list[NewRoleDataAttributesSeveritiesPermissionsItem]]): + status_pages_permissions (Union[Unset, list[NewRoleDataAttributesStatusPagesPermissionsItem]]): + webhooks_permissions (Union[Unset, list[NewRoleDataAttributesWebhooksPermissionsItem]]): + workflows_permissions (Union[Unset, list[NewRoleDataAttributesWorkflowsPermissionsItem]]): + catalogs_permissions (Union[Unset, list[NewRoleDataAttributesCatalogsPermissionsItem]]): + sub_statuses_permissions (Union[Unset, list[NewRoleDataAttributesSubStatusesPermissionsItem]]): + edge_connector_permissions (Union[Unset, list[NewRoleDataAttributesEdgeConnectorPermissionsItem]]): + slas_permissions (Union[Unset, list[NewRoleDataAttributesSlasPermissionsItem]]): + paging_permissions (Union[Unset, list[NewRoleDataAttributesPagingPermissionsItem]]): + incident_communication_permissions (Union[Unset, + list[NewRoleDataAttributesIncidentCommunicationPermissionsItem]]): + communication_permissions (Union[Unset, list[NewRoleDataAttributesCommunicationPermissionsItem]]): """ name: str - incident_permission_set_id: None | str | Unset = UNSET - alerts_permissions: list[NewRoleDataAttributesAlertsPermissionsItem] | Unset = UNSET - api_keys_permissions: list[NewRoleDataAttributesApiKeysPermissionsItem] | Unset = UNSET - audits_permissions: list[NewRoleDataAttributesAuditsPermissionsItem] | Unset = UNSET - billing_permissions: list[NewRoleDataAttributesBillingPermissionsItem] | Unset = UNSET - environments_permissions: list[NewRoleDataAttributesEnvironmentsPermissionsItem] | Unset = UNSET - form_fields_permissions: list[NewRoleDataAttributesFormFieldsPermissionsItem] | Unset = UNSET - functionalities_permissions: list[NewRoleDataAttributesFunctionalitiesPermissionsItem] | Unset = UNSET - groups_permissions: list[NewRoleDataAttributesGroupsPermissionsItem] | Unset = UNSET - incident_causes_permissions: list[NewRoleDataAttributesIncidentCausesPermissionsItem] | Unset = UNSET - incident_feedbacks_permissions: list[NewRoleDataAttributesIncidentFeedbacksPermissionsItem] | Unset = UNSET - incident_roles_permissions: list[NewRoleDataAttributesIncidentRolesPermissionsItem] | Unset = UNSET - incident_types_permissions: list[NewRoleDataAttributesIncidentTypesPermissionsItem] | Unset = UNSET - incidents_permissions: list[NewRoleDataAttributesIncidentsPermissionsItem] | Unset = UNSET - integrations_permissions: list[NewRoleDataAttributesIntegrationsPermissionsItem] | Unset = UNSET - invitations_permissions: list[NewRoleDataAttributesInvitationsPermissionsItem] | Unset = UNSET - playbooks_permissions: list[NewRoleDataAttributesPlaybooksPermissionsItem] | Unset = UNSET - private_incidents_permissions: list[NewRoleDataAttributesPrivateIncidentsPermissionsItem] | Unset = UNSET - pulses_permissions: list[NewRoleDataAttributesPulsesPermissionsItem] | Unset = UNSET - retrospective_permissions: list[NewRoleDataAttributesRetrospectivePermissionsItem] | Unset = UNSET - roles_permissions: list[NewRoleDataAttributesRolesPermissionsItem] | Unset = UNSET - secrets_permissions: list[NewRoleDataAttributesSecretsPermissionsItem] | Unset = UNSET - services_permissions: list[NewRoleDataAttributesServicesPermissionsItem] | Unset = UNSET - severities_permissions: list[NewRoleDataAttributesSeveritiesPermissionsItem] | Unset = UNSET - status_pages_permissions: list[NewRoleDataAttributesStatusPagesPermissionsItem] | Unset = UNSET - webhooks_permissions: list[NewRoleDataAttributesWebhooksPermissionsItem] | Unset = UNSET - workflows_permissions: list[NewRoleDataAttributesWorkflowsPermissionsItem] | Unset = UNSET - catalogs_permissions: list[NewRoleDataAttributesCatalogsPermissionsItem] | Unset = UNSET - sub_statuses_permissions: list[NewRoleDataAttributesSubStatusesPermissionsItem] | Unset = UNSET - edge_connector_permissions: list[NewRoleDataAttributesEdgeConnectorPermissionsItem] | Unset = UNSET - slas_permissions: list[NewRoleDataAttributesSlasPermissionsItem] | Unset = UNSET - paging_permissions: list[NewRoleDataAttributesPagingPermissionsItem] | Unset = UNSET - incident_communication_permissions: list[NewRoleDataAttributesIncidentCommunicationPermissionsItem] | Unset = UNSET - communication_permissions: list[NewRoleDataAttributesCommunicationPermissionsItem] | Unset = UNSET + slug: Union[None, Unset, str] = UNSET + incident_permission_set_id: Union[None, Unset, str] = UNSET + alerts_permissions: Union[Unset, list[NewRoleDataAttributesAlertsPermissionsItem]] = UNSET + api_keys_permissions: Union[Unset, list[NewRoleDataAttributesApiKeysPermissionsItem]] = UNSET + audits_permissions: Union[Unset, list[NewRoleDataAttributesAuditsPermissionsItem]] = UNSET + billing_permissions: Union[Unset, list[NewRoleDataAttributesBillingPermissionsItem]] = UNSET + environments_permissions: Union[Unset, list[NewRoleDataAttributesEnvironmentsPermissionsItem]] = UNSET + form_fields_permissions: Union[Unset, list[NewRoleDataAttributesFormFieldsPermissionsItem]] = UNSET + functionalities_permissions: Union[Unset, list[NewRoleDataAttributesFunctionalitiesPermissionsItem]] = UNSET + groups_permissions: Union[Unset, list[NewRoleDataAttributesGroupsPermissionsItem]] = UNSET + incident_causes_permissions: Union[Unset, list[NewRoleDataAttributesIncidentCausesPermissionsItem]] = UNSET + incident_feedbacks_permissions: Union[Unset, list[NewRoleDataAttributesIncidentFeedbacksPermissionsItem]] = UNSET + incident_roles_permissions: Union[Unset, list[NewRoleDataAttributesIncidentRolesPermissionsItem]] = UNSET + incident_types_permissions: Union[Unset, list[NewRoleDataAttributesIncidentTypesPermissionsItem]] = UNSET + incidents_permissions: Union[Unset, list[NewRoleDataAttributesIncidentsPermissionsItem]] = UNSET + integrations_permissions: Union[Unset, list[NewRoleDataAttributesIntegrationsPermissionsItem]] = UNSET + invitations_permissions: Union[Unset, list[NewRoleDataAttributesInvitationsPermissionsItem]] = UNSET + playbooks_permissions: Union[Unset, list[NewRoleDataAttributesPlaybooksPermissionsItem]] = UNSET + private_incidents_permissions: Union[Unset, list[NewRoleDataAttributesPrivateIncidentsPermissionsItem]] = UNSET + pulses_permissions: Union[Unset, list[NewRoleDataAttributesPulsesPermissionsItem]] = UNSET + retrospective_permissions: Union[Unset, list[NewRoleDataAttributesRetrospectivePermissionsItem]] = UNSET + roles_permissions: Union[Unset, list[NewRoleDataAttributesRolesPermissionsItem]] = UNSET + secrets_permissions: Union[Unset, list[NewRoleDataAttributesSecretsPermissionsItem]] = UNSET + services_permissions: Union[Unset, list[NewRoleDataAttributesServicesPermissionsItem]] = UNSET + severities_permissions: Union[Unset, list[NewRoleDataAttributesSeveritiesPermissionsItem]] = UNSET + status_pages_permissions: Union[Unset, list[NewRoleDataAttributesStatusPagesPermissionsItem]] = UNSET + webhooks_permissions: Union[Unset, list[NewRoleDataAttributesWebhooksPermissionsItem]] = UNSET + workflows_permissions: Union[Unset, list[NewRoleDataAttributesWorkflowsPermissionsItem]] = UNSET + catalogs_permissions: Union[Unset, list[NewRoleDataAttributesCatalogsPermissionsItem]] = UNSET + sub_statuses_permissions: Union[Unset, list[NewRoleDataAttributesSubStatusesPermissionsItem]] = UNSET + edge_connector_permissions: Union[Unset, list[NewRoleDataAttributesEdgeConnectorPermissionsItem]] = UNSET + slas_permissions: Union[Unset, list[NewRoleDataAttributesSlasPermissionsItem]] = UNSET + paging_permissions: Union[Unset, list[NewRoleDataAttributesPagingPermissionsItem]] = UNSET + incident_communication_permissions: Union[ + Unset, list[NewRoleDataAttributesIncidentCommunicationPermissionsItem] + ] = UNSET + communication_permissions: Union[Unset, list[NewRoleDataAttributesCommunicationPermissionsItem]] = UNSET def to_dict(self) -> dict[str, Any]: name = self.name - incident_permission_set_id: None | str | Unset + slug: Union[None, Unset, str] + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug + + incident_permission_set_id: Union[None, Unset, str] if isinstance(self.incident_permission_set_id, Unset): incident_permission_set_id = UNSET else: incident_permission_set_id = self.incident_permission_set_id - alerts_permissions: list[str] | Unset = UNSET + alerts_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.alerts_permissions, Unset): alerts_permissions = [] for alerts_permissions_item_data in self.alerts_permissions: alerts_permissions_item: str = alerts_permissions_item_data alerts_permissions.append(alerts_permissions_item) - api_keys_permissions: list[str] | Unset = UNSET + api_keys_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.api_keys_permissions, Unset): api_keys_permissions = [] for api_keys_permissions_item_data in self.api_keys_permissions: api_keys_permissions_item: str = api_keys_permissions_item_data api_keys_permissions.append(api_keys_permissions_item) - audits_permissions: list[str] | Unset = UNSET + audits_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.audits_permissions, Unset): audits_permissions = [] for audits_permissions_item_data in self.audits_permissions: audits_permissions_item: str = audits_permissions_item_data audits_permissions.append(audits_permissions_item) - billing_permissions: list[str] | Unset = UNSET + billing_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.billing_permissions, Unset): billing_permissions = [] for billing_permissions_item_data in self.billing_permissions: billing_permissions_item: str = billing_permissions_item_data billing_permissions.append(billing_permissions_item) - environments_permissions: list[str] | Unset = UNSET + environments_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.environments_permissions, Unset): environments_permissions = [] for environments_permissions_item_data in self.environments_permissions: environments_permissions_item: str = environments_permissions_item_data environments_permissions.append(environments_permissions_item) - form_fields_permissions: list[str] | Unset = UNSET + form_fields_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.form_fields_permissions, Unset): form_fields_permissions = [] for form_fields_permissions_item_data in self.form_fields_permissions: form_fields_permissions_item: str = form_fields_permissions_item_data form_fields_permissions.append(form_fields_permissions_item) - functionalities_permissions: list[str] | Unset = UNSET + functionalities_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.functionalities_permissions, Unset): functionalities_permissions = [] for functionalities_permissions_item_data in self.functionalities_permissions: functionalities_permissions_item: str = functionalities_permissions_item_data functionalities_permissions.append(functionalities_permissions_item) - groups_permissions: list[str] | Unset = UNSET + groups_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.groups_permissions, Unset): groups_permissions = [] for groups_permissions_item_data in self.groups_permissions: groups_permissions_item: str = groups_permissions_item_data groups_permissions.append(groups_permissions_item) - incident_causes_permissions: list[str] | Unset = UNSET + incident_causes_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.incident_causes_permissions, Unset): incident_causes_permissions = [] for incident_causes_permissions_item_data in self.incident_causes_permissions: incident_causes_permissions_item: str = incident_causes_permissions_item_data incident_causes_permissions.append(incident_causes_permissions_item) - incident_feedbacks_permissions: list[str] | Unset = UNSET + incident_feedbacks_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.incident_feedbacks_permissions, Unset): incident_feedbacks_permissions = [] for incident_feedbacks_permissions_item_data in self.incident_feedbacks_permissions: incident_feedbacks_permissions_item: str = incident_feedbacks_permissions_item_data incident_feedbacks_permissions.append(incident_feedbacks_permissions_item) - incident_roles_permissions: list[str] | Unset = UNSET + incident_roles_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.incident_roles_permissions, Unset): incident_roles_permissions = [] for incident_roles_permissions_item_data in self.incident_roles_permissions: incident_roles_permissions_item: str = incident_roles_permissions_item_data incident_roles_permissions.append(incident_roles_permissions_item) - incident_types_permissions: list[str] | Unset = UNSET + incident_types_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.incident_types_permissions, Unset): incident_types_permissions = [] for incident_types_permissions_item_data in self.incident_types_permissions: incident_types_permissions_item: str = incident_types_permissions_item_data incident_types_permissions.append(incident_types_permissions_item) - incidents_permissions: list[str] | Unset = UNSET + incidents_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.incidents_permissions, Unset): incidents_permissions = [] for incidents_permissions_item_data in self.incidents_permissions: incidents_permissions_item: str = incidents_permissions_item_data incidents_permissions.append(incidents_permissions_item) - integrations_permissions: list[str] | Unset = UNSET + integrations_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.integrations_permissions, Unset): integrations_permissions = [] for integrations_permissions_item_data in self.integrations_permissions: integrations_permissions_item: str = integrations_permissions_item_data integrations_permissions.append(integrations_permissions_item) - invitations_permissions: list[str] | Unset = UNSET + invitations_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.invitations_permissions, Unset): invitations_permissions = [] for invitations_permissions_item_data in self.invitations_permissions: invitations_permissions_item: str = invitations_permissions_item_data invitations_permissions.append(invitations_permissions_item) - playbooks_permissions: list[str] | Unset = UNSET + playbooks_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.playbooks_permissions, Unset): playbooks_permissions = [] for playbooks_permissions_item_data in self.playbooks_permissions: playbooks_permissions_item: str = playbooks_permissions_item_data playbooks_permissions.append(playbooks_permissions_item) - private_incidents_permissions: list[str] | Unset = UNSET + private_incidents_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.private_incidents_permissions, Unset): private_incidents_permissions = [] for private_incidents_permissions_item_data in self.private_incidents_permissions: private_incidents_permissions_item: str = private_incidents_permissions_item_data private_incidents_permissions.append(private_incidents_permissions_item) - pulses_permissions: list[str] | Unset = UNSET + pulses_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.pulses_permissions, Unset): pulses_permissions = [] for pulses_permissions_item_data in self.pulses_permissions: pulses_permissions_item: str = pulses_permissions_item_data pulses_permissions.append(pulses_permissions_item) - retrospective_permissions: list[str] | Unset = UNSET + retrospective_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.retrospective_permissions, Unset): retrospective_permissions = [] for retrospective_permissions_item_data in self.retrospective_permissions: retrospective_permissions_item: str = retrospective_permissions_item_data retrospective_permissions.append(retrospective_permissions_item) - roles_permissions: list[str] | Unset = UNSET + roles_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.roles_permissions, Unset): roles_permissions = [] for roles_permissions_item_data in self.roles_permissions: roles_permissions_item: str = roles_permissions_item_data roles_permissions.append(roles_permissions_item) - secrets_permissions: list[str] | Unset = UNSET + secrets_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.secrets_permissions, Unset): secrets_permissions = [] for secrets_permissions_item_data in self.secrets_permissions: secrets_permissions_item: str = secrets_permissions_item_data secrets_permissions.append(secrets_permissions_item) - services_permissions: list[str] | Unset = UNSET + services_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.services_permissions, Unset): services_permissions = [] for services_permissions_item_data in self.services_permissions: services_permissions_item: str = services_permissions_item_data services_permissions.append(services_permissions_item) - severities_permissions: list[str] | Unset = UNSET + severities_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.severities_permissions, Unset): severities_permissions = [] for severities_permissions_item_data in self.severities_permissions: severities_permissions_item: str = severities_permissions_item_data severities_permissions.append(severities_permissions_item) - status_pages_permissions: list[str] | Unset = UNSET + status_pages_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.status_pages_permissions, Unset): status_pages_permissions = [] for status_pages_permissions_item_data in self.status_pages_permissions: status_pages_permissions_item: str = status_pages_permissions_item_data status_pages_permissions.append(status_pages_permissions_item) - webhooks_permissions: list[str] | Unset = UNSET + webhooks_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.webhooks_permissions, Unset): webhooks_permissions = [] for webhooks_permissions_item_data in self.webhooks_permissions: webhooks_permissions_item: str = webhooks_permissions_item_data webhooks_permissions.append(webhooks_permissions_item) - workflows_permissions: list[str] | Unset = UNSET + workflows_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.workflows_permissions, Unset): workflows_permissions = [] for workflows_permissions_item_data in self.workflows_permissions: workflows_permissions_item: str = workflows_permissions_item_data workflows_permissions.append(workflows_permissions_item) - catalogs_permissions: list[str] | Unset = UNSET + catalogs_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.catalogs_permissions, Unset): catalogs_permissions = [] for catalogs_permissions_item_data in self.catalogs_permissions: catalogs_permissions_item: str = catalogs_permissions_item_data catalogs_permissions.append(catalogs_permissions_item) - sub_statuses_permissions: list[str] | Unset = UNSET + sub_statuses_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.sub_statuses_permissions, Unset): sub_statuses_permissions = [] for sub_statuses_permissions_item_data in self.sub_statuses_permissions: sub_statuses_permissions_item: str = sub_statuses_permissions_item_data sub_statuses_permissions.append(sub_statuses_permissions_item) - edge_connector_permissions: list[str] | Unset = UNSET + edge_connector_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.edge_connector_permissions, Unset): edge_connector_permissions = [] for edge_connector_permissions_item_data in self.edge_connector_permissions: edge_connector_permissions_item: str = edge_connector_permissions_item_data edge_connector_permissions.append(edge_connector_permissions_item) - slas_permissions: list[str] | Unset = UNSET + slas_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.slas_permissions, Unset): slas_permissions = [] for slas_permissions_item_data in self.slas_permissions: slas_permissions_item: str = slas_permissions_item_data slas_permissions.append(slas_permissions_item) - paging_permissions: list[str] | Unset = UNSET + paging_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.paging_permissions, Unset): paging_permissions = [] for paging_permissions_item_data in self.paging_permissions: paging_permissions_item: str = paging_permissions_item_data paging_permissions.append(paging_permissions_item) - incident_communication_permissions: list[str] | Unset = UNSET + incident_communication_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.incident_communication_permissions, Unset): incident_communication_permissions = [] for incident_communication_permissions_item_data in self.incident_communication_permissions: incident_communication_permissions_item: str = incident_communication_permissions_item_data incident_communication_permissions.append(incident_communication_permissions_item) - communication_permissions: list[str] | Unset = UNSET + communication_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.communication_permissions, Unset): communication_permissions = [] for communication_permissions_item_data in self.communication_permissions: @@ -466,6 +477,8 @@ def to_dict(self) -> dict[str, Any]: "name": name, } ) + if slug is not UNSET: + field_dict["slug"] = slug if incident_permission_set_id is not UNSET: field_dict["incident_permission_set_id"] = incident_permission_set_id if alerts_permissions is not UNSET: @@ -542,384 +555,322 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name") - def _parse_incident_permission_set_id(data: object) -> None | str | Unset: + def _parse_slug(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + slug = _parse_slug(d.pop("slug", UNSET)) + + def _parse_incident_permission_set_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) incident_permission_set_id = _parse_incident_permission_set_id(d.pop("incident_permission_set_id", UNSET)) + alerts_permissions = [] _alerts_permissions = d.pop("alerts_permissions", UNSET) - alerts_permissions: list[NewRoleDataAttributesAlertsPermissionsItem] | Unset = UNSET - if _alerts_permissions is not UNSET: - alerts_permissions = [] - for alerts_permissions_item_data in _alerts_permissions: - alerts_permissions_item = check_new_role_data_attributes_alerts_permissions_item( - alerts_permissions_item_data - ) + for alerts_permissions_item_data in _alerts_permissions or []: + alerts_permissions_item = check_new_role_data_attributes_alerts_permissions_item( + alerts_permissions_item_data + ) - alerts_permissions.append(alerts_permissions_item) + alerts_permissions.append(alerts_permissions_item) + api_keys_permissions = [] _api_keys_permissions = d.pop("api_keys_permissions", UNSET) - api_keys_permissions: list[NewRoleDataAttributesApiKeysPermissionsItem] | Unset = UNSET - if _api_keys_permissions is not UNSET: - api_keys_permissions = [] - for api_keys_permissions_item_data in _api_keys_permissions: - api_keys_permissions_item = check_new_role_data_attributes_api_keys_permissions_item( - api_keys_permissions_item_data - ) + for api_keys_permissions_item_data in _api_keys_permissions or []: + api_keys_permissions_item = check_new_role_data_attributes_api_keys_permissions_item( + api_keys_permissions_item_data + ) - api_keys_permissions.append(api_keys_permissions_item) + api_keys_permissions.append(api_keys_permissions_item) + audits_permissions = [] _audits_permissions = d.pop("audits_permissions", UNSET) - audits_permissions: list[NewRoleDataAttributesAuditsPermissionsItem] | Unset = UNSET - if _audits_permissions is not UNSET: - audits_permissions = [] - for audits_permissions_item_data in _audits_permissions: - audits_permissions_item = check_new_role_data_attributes_audits_permissions_item( - audits_permissions_item_data - ) + for audits_permissions_item_data in _audits_permissions or []: + audits_permissions_item = check_new_role_data_attributes_audits_permissions_item( + audits_permissions_item_data + ) - audits_permissions.append(audits_permissions_item) + audits_permissions.append(audits_permissions_item) + billing_permissions = [] _billing_permissions = d.pop("billing_permissions", UNSET) - billing_permissions: list[NewRoleDataAttributesBillingPermissionsItem] | Unset = UNSET - if _billing_permissions is not UNSET: - billing_permissions = [] - for billing_permissions_item_data in _billing_permissions: - billing_permissions_item = check_new_role_data_attributes_billing_permissions_item( - billing_permissions_item_data - ) + for billing_permissions_item_data in _billing_permissions or []: + billing_permissions_item = check_new_role_data_attributes_billing_permissions_item( + billing_permissions_item_data + ) - billing_permissions.append(billing_permissions_item) + billing_permissions.append(billing_permissions_item) + environments_permissions = [] _environments_permissions = d.pop("environments_permissions", UNSET) - environments_permissions: list[NewRoleDataAttributesEnvironmentsPermissionsItem] | Unset = UNSET - if _environments_permissions is not UNSET: - environments_permissions = [] - for environments_permissions_item_data in _environments_permissions: - environments_permissions_item = check_new_role_data_attributes_environments_permissions_item( - environments_permissions_item_data - ) + for environments_permissions_item_data in _environments_permissions or []: + environments_permissions_item = check_new_role_data_attributes_environments_permissions_item( + environments_permissions_item_data + ) - environments_permissions.append(environments_permissions_item) + environments_permissions.append(environments_permissions_item) + form_fields_permissions = [] _form_fields_permissions = d.pop("form_fields_permissions", UNSET) - form_fields_permissions: list[NewRoleDataAttributesFormFieldsPermissionsItem] | Unset = UNSET - if _form_fields_permissions is not UNSET: - form_fields_permissions = [] - for form_fields_permissions_item_data in _form_fields_permissions: - form_fields_permissions_item = check_new_role_data_attributes_form_fields_permissions_item( - form_fields_permissions_item_data - ) + for form_fields_permissions_item_data in _form_fields_permissions or []: + form_fields_permissions_item = check_new_role_data_attributes_form_fields_permissions_item( + form_fields_permissions_item_data + ) - form_fields_permissions.append(form_fields_permissions_item) + form_fields_permissions.append(form_fields_permissions_item) + functionalities_permissions = [] _functionalities_permissions = d.pop("functionalities_permissions", UNSET) - functionalities_permissions: list[NewRoleDataAttributesFunctionalitiesPermissionsItem] | Unset = UNSET - if _functionalities_permissions is not UNSET: - functionalities_permissions = [] - for functionalities_permissions_item_data in _functionalities_permissions: - functionalities_permissions_item = check_new_role_data_attributes_functionalities_permissions_item( - functionalities_permissions_item_data - ) + for functionalities_permissions_item_data in _functionalities_permissions or []: + functionalities_permissions_item = check_new_role_data_attributes_functionalities_permissions_item( + functionalities_permissions_item_data + ) - functionalities_permissions.append(functionalities_permissions_item) + functionalities_permissions.append(functionalities_permissions_item) + groups_permissions = [] _groups_permissions = d.pop("groups_permissions", UNSET) - groups_permissions: list[NewRoleDataAttributesGroupsPermissionsItem] | Unset = UNSET - if _groups_permissions is not UNSET: - groups_permissions = [] - for groups_permissions_item_data in _groups_permissions: - groups_permissions_item = check_new_role_data_attributes_groups_permissions_item( - groups_permissions_item_data - ) + for groups_permissions_item_data in _groups_permissions or []: + groups_permissions_item = check_new_role_data_attributes_groups_permissions_item( + groups_permissions_item_data + ) - groups_permissions.append(groups_permissions_item) + groups_permissions.append(groups_permissions_item) + incident_causes_permissions = [] _incident_causes_permissions = d.pop("incident_causes_permissions", UNSET) - incident_causes_permissions: list[NewRoleDataAttributesIncidentCausesPermissionsItem] | Unset = UNSET - if _incident_causes_permissions is not UNSET: - incident_causes_permissions = [] - for incident_causes_permissions_item_data in _incident_causes_permissions: - incident_causes_permissions_item = check_new_role_data_attributes_incident_causes_permissions_item( - incident_causes_permissions_item_data - ) + for incident_causes_permissions_item_data in _incident_causes_permissions or []: + incident_causes_permissions_item = check_new_role_data_attributes_incident_causes_permissions_item( + incident_causes_permissions_item_data + ) - incident_causes_permissions.append(incident_causes_permissions_item) + incident_causes_permissions.append(incident_causes_permissions_item) + incident_feedbacks_permissions = [] _incident_feedbacks_permissions = d.pop("incident_feedbacks_permissions", UNSET) - incident_feedbacks_permissions: list[NewRoleDataAttributesIncidentFeedbacksPermissionsItem] | Unset = UNSET - if _incident_feedbacks_permissions is not UNSET: - incident_feedbacks_permissions = [] - for incident_feedbacks_permissions_item_data in _incident_feedbacks_permissions: - incident_feedbacks_permissions_item = ( - check_new_role_data_attributes_incident_feedbacks_permissions_item( - incident_feedbacks_permissions_item_data - ) - ) + for incident_feedbacks_permissions_item_data in _incident_feedbacks_permissions or []: + incident_feedbacks_permissions_item = check_new_role_data_attributes_incident_feedbacks_permissions_item( + incident_feedbacks_permissions_item_data + ) - incident_feedbacks_permissions.append(incident_feedbacks_permissions_item) + incident_feedbacks_permissions.append(incident_feedbacks_permissions_item) + incident_roles_permissions = [] _incident_roles_permissions = d.pop("incident_roles_permissions", UNSET) - incident_roles_permissions: list[NewRoleDataAttributesIncidentRolesPermissionsItem] | Unset = UNSET - if _incident_roles_permissions is not UNSET: - incident_roles_permissions = [] - for incident_roles_permissions_item_data in _incident_roles_permissions: - incident_roles_permissions_item = check_new_role_data_attributes_incident_roles_permissions_item( - incident_roles_permissions_item_data - ) + for incident_roles_permissions_item_data in _incident_roles_permissions or []: + incident_roles_permissions_item = check_new_role_data_attributes_incident_roles_permissions_item( + incident_roles_permissions_item_data + ) - incident_roles_permissions.append(incident_roles_permissions_item) + incident_roles_permissions.append(incident_roles_permissions_item) + incident_types_permissions = [] _incident_types_permissions = d.pop("incident_types_permissions", UNSET) - incident_types_permissions: list[NewRoleDataAttributesIncidentTypesPermissionsItem] | Unset = UNSET - if _incident_types_permissions is not UNSET: - incident_types_permissions = [] - for incident_types_permissions_item_data in _incident_types_permissions: - incident_types_permissions_item = check_new_role_data_attributes_incident_types_permissions_item( - incident_types_permissions_item_data - ) + for incident_types_permissions_item_data in _incident_types_permissions or []: + incident_types_permissions_item = check_new_role_data_attributes_incident_types_permissions_item( + incident_types_permissions_item_data + ) - incident_types_permissions.append(incident_types_permissions_item) + incident_types_permissions.append(incident_types_permissions_item) + incidents_permissions = [] _incidents_permissions = d.pop("incidents_permissions", UNSET) - incidents_permissions: list[NewRoleDataAttributesIncidentsPermissionsItem] | Unset = UNSET - if _incidents_permissions is not UNSET: - incidents_permissions = [] - for incidents_permissions_item_data in _incidents_permissions: - incidents_permissions_item = check_new_role_data_attributes_incidents_permissions_item( - incidents_permissions_item_data - ) + for incidents_permissions_item_data in _incidents_permissions or []: + incidents_permissions_item = check_new_role_data_attributes_incidents_permissions_item( + incidents_permissions_item_data + ) - incidents_permissions.append(incidents_permissions_item) + incidents_permissions.append(incidents_permissions_item) + integrations_permissions = [] _integrations_permissions = d.pop("integrations_permissions", UNSET) - integrations_permissions: list[NewRoleDataAttributesIntegrationsPermissionsItem] | Unset = UNSET - if _integrations_permissions is not UNSET: - integrations_permissions = [] - for integrations_permissions_item_data in _integrations_permissions: - integrations_permissions_item = check_new_role_data_attributes_integrations_permissions_item( - integrations_permissions_item_data - ) + for integrations_permissions_item_data in _integrations_permissions or []: + integrations_permissions_item = check_new_role_data_attributes_integrations_permissions_item( + integrations_permissions_item_data + ) - integrations_permissions.append(integrations_permissions_item) + integrations_permissions.append(integrations_permissions_item) + invitations_permissions = [] _invitations_permissions = d.pop("invitations_permissions", UNSET) - invitations_permissions: list[NewRoleDataAttributesInvitationsPermissionsItem] | Unset = UNSET - if _invitations_permissions is not UNSET: - invitations_permissions = [] - for invitations_permissions_item_data in _invitations_permissions: - invitations_permissions_item = check_new_role_data_attributes_invitations_permissions_item( - invitations_permissions_item_data - ) + for invitations_permissions_item_data in _invitations_permissions or []: + invitations_permissions_item = check_new_role_data_attributes_invitations_permissions_item( + invitations_permissions_item_data + ) - invitations_permissions.append(invitations_permissions_item) + invitations_permissions.append(invitations_permissions_item) + playbooks_permissions = [] _playbooks_permissions = d.pop("playbooks_permissions", UNSET) - playbooks_permissions: list[NewRoleDataAttributesPlaybooksPermissionsItem] | Unset = UNSET - if _playbooks_permissions is not UNSET: - playbooks_permissions = [] - for playbooks_permissions_item_data in _playbooks_permissions: - playbooks_permissions_item = check_new_role_data_attributes_playbooks_permissions_item( - playbooks_permissions_item_data - ) + for playbooks_permissions_item_data in _playbooks_permissions or []: + playbooks_permissions_item = check_new_role_data_attributes_playbooks_permissions_item( + playbooks_permissions_item_data + ) - playbooks_permissions.append(playbooks_permissions_item) + playbooks_permissions.append(playbooks_permissions_item) + private_incidents_permissions = [] _private_incidents_permissions = d.pop("private_incidents_permissions", UNSET) - private_incidents_permissions: list[NewRoleDataAttributesPrivateIncidentsPermissionsItem] | Unset = UNSET - if _private_incidents_permissions is not UNSET: - private_incidents_permissions = [] - for private_incidents_permissions_item_data in _private_incidents_permissions: - private_incidents_permissions_item = check_new_role_data_attributes_private_incidents_permissions_item( - private_incidents_permissions_item_data - ) + for private_incidents_permissions_item_data in _private_incidents_permissions or []: + private_incidents_permissions_item = check_new_role_data_attributes_private_incidents_permissions_item( + private_incidents_permissions_item_data + ) - private_incidents_permissions.append(private_incidents_permissions_item) + private_incidents_permissions.append(private_incidents_permissions_item) + pulses_permissions = [] _pulses_permissions = d.pop("pulses_permissions", UNSET) - pulses_permissions: list[NewRoleDataAttributesPulsesPermissionsItem] | Unset = UNSET - if _pulses_permissions is not UNSET: - pulses_permissions = [] - for pulses_permissions_item_data in _pulses_permissions: - pulses_permissions_item = check_new_role_data_attributes_pulses_permissions_item( - pulses_permissions_item_data - ) + for pulses_permissions_item_data in _pulses_permissions or []: + pulses_permissions_item = check_new_role_data_attributes_pulses_permissions_item( + pulses_permissions_item_data + ) - pulses_permissions.append(pulses_permissions_item) + pulses_permissions.append(pulses_permissions_item) + retrospective_permissions = [] _retrospective_permissions = d.pop("retrospective_permissions", UNSET) - retrospective_permissions: list[NewRoleDataAttributesRetrospectivePermissionsItem] | Unset = UNSET - if _retrospective_permissions is not UNSET: - retrospective_permissions = [] - for retrospective_permissions_item_data in _retrospective_permissions: - retrospective_permissions_item = check_new_role_data_attributes_retrospective_permissions_item( - retrospective_permissions_item_data - ) + for retrospective_permissions_item_data in _retrospective_permissions or []: + retrospective_permissions_item = check_new_role_data_attributes_retrospective_permissions_item( + retrospective_permissions_item_data + ) - retrospective_permissions.append(retrospective_permissions_item) + retrospective_permissions.append(retrospective_permissions_item) + roles_permissions = [] _roles_permissions = d.pop("roles_permissions", UNSET) - roles_permissions: list[NewRoleDataAttributesRolesPermissionsItem] | Unset = UNSET - if _roles_permissions is not UNSET: - roles_permissions = [] - for roles_permissions_item_data in _roles_permissions: - roles_permissions_item = check_new_role_data_attributes_roles_permissions_item( - roles_permissions_item_data - ) + for roles_permissions_item_data in _roles_permissions or []: + roles_permissions_item = check_new_role_data_attributes_roles_permissions_item(roles_permissions_item_data) - roles_permissions.append(roles_permissions_item) + roles_permissions.append(roles_permissions_item) + secrets_permissions = [] _secrets_permissions = d.pop("secrets_permissions", UNSET) - secrets_permissions: list[NewRoleDataAttributesSecretsPermissionsItem] | Unset = UNSET - if _secrets_permissions is not UNSET: - secrets_permissions = [] - for secrets_permissions_item_data in _secrets_permissions: - secrets_permissions_item = check_new_role_data_attributes_secrets_permissions_item( - secrets_permissions_item_data - ) + for secrets_permissions_item_data in _secrets_permissions or []: + secrets_permissions_item = check_new_role_data_attributes_secrets_permissions_item( + secrets_permissions_item_data + ) - secrets_permissions.append(secrets_permissions_item) + secrets_permissions.append(secrets_permissions_item) + services_permissions = [] _services_permissions = d.pop("services_permissions", UNSET) - services_permissions: list[NewRoleDataAttributesServicesPermissionsItem] | Unset = UNSET - if _services_permissions is not UNSET: - services_permissions = [] - for services_permissions_item_data in _services_permissions: - services_permissions_item = check_new_role_data_attributes_services_permissions_item( - services_permissions_item_data - ) + for services_permissions_item_data in _services_permissions or []: + services_permissions_item = check_new_role_data_attributes_services_permissions_item( + services_permissions_item_data + ) - services_permissions.append(services_permissions_item) + services_permissions.append(services_permissions_item) + severities_permissions = [] _severities_permissions = d.pop("severities_permissions", UNSET) - severities_permissions: list[NewRoleDataAttributesSeveritiesPermissionsItem] | Unset = UNSET - if _severities_permissions is not UNSET: - severities_permissions = [] - for severities_permissions_item_data in _severities_permissions: - severities_permissions_item = check_new_role_data_attributes_severities_permissions_item( - severities_permissions_item_data - ) + for severities_permissions_item_data in _severities_permissions or []: + severities_permissions_item = check_new_role_data_attributes_severities_permissions_item( + severities_permissions_item_data + ) - severities_permissions.append(severities_permissions_item) + severities_permissions.append(severities_permissions_item) + status_pages_permissions = [] _status_pages_permissions = d.pop("status_pages_permissions", UNSET) - status_pages_permissions: list[NewRoleDataAttributesStatusPagesPermissionsItem] | Unset = UNSET - if _status_pages_permissions is not UNSET: - status_pages_permissions = [] - for status_pages_permissions_item_data in _status_pages_permissions: - status_pages_permissions_item = check_new_role_data_attributes_status_pages_permissions_item( - status_pages_permissions_item_data - ) + for status_pages_permissions_item_data in _status_pages_permissions or []: + status_pages_permissions_item = check_new_role_data_attributes_status_pages_permissions_item( + status_pages_permissions_item_data + ) - status_pages_permissions.append(status_pages_permissions_item) + status_pages_permissions.append(status_pages_permissions_item) + webhooks_permissions = [] _webhooks_permissions = d.pop("webhooks_permissions", UNSET) - webhooks_permissions: list[NewRoleDataAttributesWebhooksPermissionsItem] | Unset = UNSET - if _webhooks_permissions is not UNSET: - webhooks_permissions = [] - for webhooks_permissions_item_data in _webhooks_permissions: - webhooks_permissions_item = check_new_role_data_attributes_webhooks_permissions_item( - webhooks_permissions_item_data - ) + for webhooks_permissions_item_data in _webhooks_permissions or []: + webhooks_permissions_item = check_new_role_data_attributes_webhooks_permissions_item( + webhooks_permissions_item_data + ) - webhooks_permissions.append(webhooks_permissions_item) + webhooks_permissions.append(webhooks_permissions_item) + workflows_permissions = [] _workflows_permissions = d.pop("workflows_permissions", UNSET) - workflows_permissions: list[NewRoleDataAttributesWorkflowsPermissionsItem] | Unset = UNSET - if _workflows_permissions is not UNSET: - workflows_permissions = [] - for workflows_permissions_item_data in _workflows_permissions: - workflows_permissions_item = check_new_role_data_attributes_workflows_permissions_item( - workflows_permissions_item_data - ) + for workflows_permissions_item_data in _workflows_permissions or []: + workflows_permissions_item = check_new_role_data_attributes_workflows_permissions_item( + workflows_permissions_item_data + ) - workflows_permissions.append(workflows_permissions_item) + workflows_permissions.append(workflows_permissions_item) + catalogs_permissions = [] _catalogs_permissions = d.pop("catalogs_permissions", UNSET) - catalogs_permissions: list[NewRoleDataAttributesCatalogsPermissionsItem] | Unset = UNSET - if _catalogs_permissions is not UNSET: - catalogs_permissions = [] - for catalogs_permissions_item_data in _catalogs_permissions: - catalogs_permissions_item = check_new_role_data_attributes_catalogs_permissions_item( - catalogs_permissions_item_data - ) + for catalogs_permissions_item_data in _catalogs_permissions or []: + catalogs_permissions_item = check_new_role_data_attributes_catalogs_permissions_item( + catalogs_permissions_item_data + ) - catalogs_permissions.append(catalogs_permissions_item) + catalogs_permissions.append(catalogs_permissions_item) + sub_statuses_permissions = [] _sub_statuses_permissions = d.pop("sub_statuses_permissions", UNSET) - sub_statuses_permissions: list[NewRoleDataAttributesSubStatusesPermissionsItem] | Unset = UNSET - if _sub_statuses_permissions is not UNSET: - sub_statuses_permissions = [] - for sub_statuses_permissions_item_data in _sub_statuses_permissions: - sub_statuses_permissions_item = check_new_role_data_attributes_sub_statuses_permissions_item( - sub_statuses_permissions_item_data - ) + for sub_statuses_permissions_item_data in _sub_statuses_permissions or []: + sub_statuses_permissions_item = check_new_role_data_attributes_sub_statuses_permissions_item( + sub_statuses_permissions_item_data + ) - sub_statuses_permissions.append(sub_statuses_permissions_item) + sub_statuses_permissions.append(sub_statuses_permissions_item) + edge_connector_permissions = [] _edge_connector_permissions = d.pop("edge_connector_permissions", UNSET) - edge_connector_permissions: list[NewRoleDataAttributesEdgeConnectorPermissionsItem] | Unset = UNSET - if _edge_connector_permissions is not UNSET: - edge_connector_permissions = [] - for edge_connector_permissions_item_data in _edge_connector_permissions: - edge_connector_permissions_item = check_new_role_data_attributes_edge_connector_permissions_item( - edge_connector_permissions_item_data - ) + for edge_connector_permissions_item_data in _edge_connector_permissions or []: + edge_connector_permissions_item = check_new_role_data_attributes_edge_connector_permissions_item( + edge_connector_permissions_item_data + ) - edge_connector_permissions.append(edge_connector_permissions_item) + edge_connector_permissions.append(edge_connector_permissions_item) + slas_permissions = [] _slas_permissions = d.pop("slas_permissions", UNSET) - slas_permissions: list[NewRoleDataAttributesSlasPermissionsItem] | Unset = UNSET - if _slas_permissions is not UNSET: - slas_permissions = [] - for slas_permissions_item_data in _slas_permissions: - slas_permissions_item = check_new_role_data_attributes_slas_permissions_item(slas_permissions_item_data) + for slas_permissions_item_data in _slas_permissions or []: + slas_permissions_item = check_new_role_data_attributes_slas_permissions_item(slas_permissions_item_data) - slas_permissions.append(slas_permissions_item) + slas_permissions.append(slas_permissions_item) + paging_permissions = [] _paging_permissions = d.pop("paging_permissions", UNSET) - paging_permissions: list[NewRoleDataAttributesPagingPermissionsItem] | Unset = UNSET - if _paging_permissions is not UNSET: - paging_permissions = [] - for paging_permissions_item_data in _paging_permissions: - paging_permissions_item = check_new_role_data_attributes_paging_permissions_item( - paging_permissions_item_data - ) + for paging_permissions_item_data in _paging_permissions or []: + paging_permissions_item = check_new_role_data_attributes_paging_permissions_item( + paging_permissions_item_data + ) - paging_permissions.append(paging_permissions_item) + paging_permissions.append(paging_permissions_item) + incident_communication_permissions = [] _incident_communication_permissions = d.pop("incident_communication_permissions", UNSET) - incident_communication_permissions: list[NewRoleDataAttributesIncidentCommunicationPermissionsItem] | Unset = ( - UNSET - ) - if _incident_communication_permissions is not UNSET: - incident_communication_permissions = [] - for incident_communication_permissions_item_data in _incident_communication_permissions: - incident_communication_permissions_item = ( - check_new_role_data_attributes_incident_communication_permissions_item( - incident_communication_permissions_item_data - ) + for incident_communication_permissions_item_data in _incident_communication_permissions or []: + incident_communication_permissions_item = ( + check_new_role_data_attributes_incident_communication_permissions_item( + incident_communication_permissions_item_data ) + ) - incident_communication_permissions.append(incident_communication_permissions_item) + incident_communication_permissions.append(incident_communication_permissions_item) + communication_permissions = [] _communication_permissions = d.pop("communication_permissions", UNSET) - communication_permissions: list[NewRoleDataAttributesCommunicationPermissionsItem] | Unset = UNSET - if _communication_permissions is not UNSET: - communication_permissions = [] - for communication_permissions_item_data in _communication_permissions: - communication_permissions_item = check_new_role_data_attributes_communication_permissions_item( - communication_permissions_item_data - ) + for communication_permissions_item_data in _communication_permissions or []: + communication_permissions_item = check_new_role_data_attributes_communication_permissions_item( + communication_permissions_item_data + ) - communication_permissions.append(communication_permissions_item) + communication_permissions.append(communication_permissions_item) new_role_data_attributes = cls( name=name, + slug=slug, incident_permission_set_id=incident_permission_set_id, alerts_permissions=alerts_permissions, api_keys_permissions=api_keys_permissions, diff --git a/rootly_sdk/models/new_schedule.py b/rootly_sdk/models/new_schedule.py index b82c394e..27b30e61 100644 --- a/rootly_sdk/models/new_schedule.py +++ b/rootly_sdk/models/new_schedule.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewSchedule: data (NewScheduleData): """ - data: NewScheduleData + data: "NewScheduleData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_schedule_data.py b/rootly_sdk/models/new_schedule_data.py index 04b89e20..099fc2e5 100644 --- a/rootly_sdk/models/new_schedule_data.py +++ b/rootly_sdk/models/new_schedule_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class NewScheduleData: """ type_: NewScheduleDataType - attributes: NewScheduleDataAttributes + attributes: "NewScheduleDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_schedule_data_attributes.py b/rootly_sdk/models/new_schedule_data_attributes.py index 9495aef6..3b17d640 100644 --- a/rootly_sdk/models/new_schedule_data_attributes.py +++ b/rootly_sdk/models/new_schedule_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -25,43 +23,43 @@ class NewScheduleDataAttributes: Attributes: name (str): The name of the schedule owner_user_id (int): ID of the owner of the schedule - description (None | str | Unset): The description of the schedule - all_time_coverage (bool | None | Unset): 24/7 coverage of the schedule - slack_user_group (NewScheduleDataAttributesSlackUserGroup | Unset): - slack_channel (NewScheduleDataAttributesSlackChannelType0 | None | Unset): - owner_group_ids (list[str] | Unset): Owning teams. - sync_linear_enabled (bool | None | Unset): Whether the schedule is synced with Linear - include_shadows_in_slack_notifications (bool | None | Unset): Whether shadow users are included in Slack + description (Union[None, Unset, str]): The description of the schedule + all_time_coverage (Union[None, Unset, bool]): 24/7 coverage of the schedule + slack_user_group (Union[Unset, NewScheduleDataAttributesSlackUserGroup]): + slack_channel (Union['NewScheduleDataAttributesSlackChannelType0', None, Unset]): + owner_group_ids (Union[Unset, list[str]]): Owning teams. + sync_linear_enabled (Union[None, Unset, bool]): Whether the schedule is synced with Linear + include_shadows_in_slack_notifications (Union[None, Unset, bool]): Whether shadow users are included in Slack notifications and user group syncing. Requires `slack_channel` to be set; otherwise this value is forced to false on save. - shift_start_notifications_enabled (bool | None | Unset): Whether shift-start notifications are enabled. Requires - `slack_channel` to be set; otherwise this value is forced to false on save. - shift_update_notifications_enabled (bool | None | Unset): Whether shift-update notifications are enabled. + shift_start_notifications_enabled (Union[None, Unset, bool]): Whether shift-start notifications are enabled. + Requires `slack_channel` to be set; otherwise this value is forced to false on save. + shift_update_notifications_enabled (Union[None, Unset, bool]): Whether shift-update notifications are enabled. Requires `slack_channel` to be set; otherwise this value is forced to false on save. - shift_report_enabled (bool | None | Unset): Whether the weekly shift summary report is enabled. Requires + shift_report_enabled (Union[None, Unset, bool]): Whether the weekly shift summary report is enabled. Requires `slack_channel` to be set; otherwise this value is forced to false on save. - shift_report_day_of_week (NewScheduleDataAttributesShiftReportDayOfWeek | Unset): Day of week the weekly shift - summary is sent - shift_report_time_of_day (None | str | Unset): Time of day the weekly shift summary is sent, in HH:MM 24-hour - format - shift_report_time_zone (None | str | Unset): IANA time zone used for the weekly shift summary + shift_report_day_of_week (Union[Unset, NewScheduleDataAttributesShiftReportDayOfWeek]): Day of week the weekly + shift summary is sent + shift_report_time_of_day (Union[None, Unset, str]): Time of day the weekly shift summary is sent, in HH:MM + 24-hour format + shift_report_time_zone (Union[None, Unset, str]): IANA time zone used for the weekly shift summary """ name: str owner_user_id: int - description: None | str | Unset = UNSET - all_time_coverage: bool | None | Unset = UNSET - slack_user_group: NewScheduleDataAttributesSlackUserGroup | Unset = UNSET - slack_channel: NewScheduleDataAttributesSlackChannelType0 | None | Unset = UNSET - owner_group_ids: list[str] | Unset = UNSET - sync_linear_enabled: bool | None | Unset = UNSET - include_shadows_in_slack_notifications: bool | None | Unset = UNSET - shift_start_notifications_enabled: bool | None | Unset = UNSET - shift_update_notifications_enabled: bool | None | Unset = UNSET - shift_report_enabled: bool | None | Unset = UNSET - shift_report_day_of_week: NewScheduleDataAttributesShiftReportDayOfWeek | Unset = UNSET - shift_report_time_of_day: None | str | Unset = UNSET - shift_report_time_zone: None | str | Unset = UNSET + description: Union[None, Unset, str] = UNSET + all_time_coverage: Union[None, Unset, bool] = UNSET + slack_user_group: Union[Unset, "NewScheduleDataAttributesSlackUserGroup"] = UNSET + slack_channel: Union["NewScheduleDataAttributesSlackChannelType0", None, Unset] = UNSET + owner_group_ids: Union[Unset, list[str]] = UNSET + sync_linear_enabled: Union[None, Unset, bool] = UNSET + include_shadows_in_slack_notifications: Union[None, Unset, bool] = UNSET + shift_start_notifications_enabled: Union[None, Unset, bool] = UNSET + shift_update_notifications_enabled: Union[None, Unset, bool] = UNSET + shift_report_enabled: Union[None, Unset, bool] = UNSET + shift_report_day_of_week: Union[Unset, NewScheduleDataAttributesShiftReportDayOfWeek] = UNSET + shift_report_time_of_day: Union[None, Unset, str] = UNSET + shift_report_time_zone: Union[None, Unset, str] = UNSET def to_dict(self) -> dict[str, Any]: from ..models.new_schedule_data_attributes_slack_channel_type_0 import ( @@ -72,23 +70,23 @@ def to_dict(self) -> dict[str, Any]: owner_user_id = self.owner_user_id - description: None | str | Unset + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: description = self.description - all_time_coverage: bool | None | Unset + all_time_coverage: Union[None, Unset, bool] if isinstance(self.all_time_coverage, Unset): all_time_coverage = UNSET else: all_time_coverage = self.all_time_coverage - slack_user_group: dict[str, Any] | Unset = UNSET + slack_user_group: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.slack_user_group, Unset): slack_user_group = self.slack_user_group.to_dict() - slack_channel: dict[str, Any] | None | Unset + slack_channel: Union[None, Unset, dict[str, Any]] if isinstance(self.slack_channel, Unset): slack_channel = UNSET elif isinstance(self.slack_channel, NewScheduleDataAttributesSlackChannelType0): @@ -96,51 +94,51 @@ def to_dict(self) -> dict[str, Any]: else: slack_channel = self.slack_channel - owner_group_ids: list[str] | Unset = UNSET + owner_group_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.owner_group_ids, Unset): owner_group_ids = self.owner_group_ids - sync_linear_enabled: bool | None | Unset + sync_linear_enabled: Union[None, Unset, bool] if isinstance(self.sync_linear_enabled, Unset): sync_linear_enabled = UNSET else: sync_linear_enabled = self.sync_linear_enabled - include_shadows_in_slack_notifications: bool | None | Unset + include_shadows_in_slack_notifications: Union[None, Unset, bool] if isinstance(self.include_shadows_in_slack_notifications, Unset): include_shadows_in_slack_notifications = UNSET else: include_shadows_in_slack_notifications = self.include_shadows_in_slack_notifications - shift_start_notifications_enabled: bool | None | Unset + shift_start_notifications_enabled: Union[None, Unset, bool] if isinstance(self.shift_start_notifications_enabled, Unset): shift_start_notifications_enabled = UNSET else: shift_start_notifications_enabled = self.shift_start_notifications_enabled - shift_update_notifications_enabled: bool | None | Unset + shift_update_notifications_enabled: Union[None, Unset, bool] if isinstance(self.shift_update_notifications_enabled, Unset): shift_update_notifications_enabled = UNSET else: shift_update_notifications_enabled = self.shift_update_notifications_enabled - shift_report_enabled: bool | None | Unset + shift_report_enabled: Union[None, Unset, bool] if isinstance(self.shift_report_enabled, Unset): shift_report_enabled = UNSET else: shift_report_enabled = self.shift_report_enabled - shift_report_day_of_week: str | Unset = UNSET + shift_report_day_of_week: Union[Unset, str] = UNSET if not isinstance(self.shift_report_day_of_week, Unset): shift_report_day_of_week = self.shift_report_day_of_week - shift_report_time_of_day: None | str | Unset + shift_report_time_of_day: Union[None, Unset, str] if isinstance(self.shift_report_time_of_day, Unset): shift_report_time_of_day = UNSET else: shift_report_time_of_day = self.shift_report_time_of_day - shift_report_time_zone: None | str | Unset + shift_report_time_zone: Union[None, Unset, str] if isinstance(self.shift_report_time_zone, Unset): shift_report_time_zone = UNSET else: @@ -195,32 +193,32 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: owner_user_id = d.pop("owner_user_id") - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) - def _parse_all_time_coverage(data: object) -> bool | None | Unset: + def _parse_all_time_coverage(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) all_time_coverage = _parse_all_time_coverage(d.pop("all_time_coverage", UNSET)) _slack_user_group = d.pop("slack_user_group", UNSET) - slack_user_group: NewScheduleDataAttributesSlackUserGroup | Unset + slack_user_group: Union[Unset, NewScheduleDataAttributesSlackUserGroup] if isinstance(_slack_user_group, Unset): slack_user_group = UNSET else: slack_user_group = NewScheduleDataAttributesSlackUserGroup.from_dict(_slack_user_group) - def _parse_slack_channel(data: object) -> NewScheduleDataAttributesSlackChannelType0 | None | Unset: + def _parse_slack_channel(data: object) -> Union["NewScheduleDataAttributesSlackChannelType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -231,67 +229,67 @@ def _parse_slack_channel(data: object) -> NewScheduleDataAttributesSlackChannelT slack_channel_type_0 = NewScheduleDataAttributesSlackChannelType0.from_dict(data) return slack_channel_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(NewScheduleDataAttributesSlackChannelType0 | None | Unset, data) + return cast(Union["NewScheduleDataAttributesSlackChannelType0", None, Unset], data) slack_channel = _parse_slack_channel(d.pop("slack_channel", UNSET)) owner_group_ids = cast(list[str], d.pop("owner_group_ids", UNSET)) - def _parse_sync_linear_enabled(data: object) -> bool | None | Unset: + def _parse_sync_linear_enabled(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) sync_linear_enabled = _parse_sync_linear_enabled(d.pop("sync_linear_enabled", UNSET)) - def _parse_include_shadows_in_slack_notifications(data: object) -> bool | None | Unset: + def _parse_include_shadows_in_slack_notifications(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) include_shadows_in_slack_notifications = _parse_include_shadows_in_slack_notifications( d.pop("include_shadows_in_slack_notifications", UNSET) ) - def _parse_shift_start_notifications_enabled(data: object) -> bool | None | Unset: + def _parse_shift_start_notifications_enabled(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) shift_start_notifications_enabled = _parse_shift_start_notifications_enabled( d.pop("shift_start_notifications_enabled", UNSET) ) - def _parse_shift_update_notifications_enabled(data: object) -> bool | None | Unset: + def _parse_shift_update_notifications_enabled(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) shift_update_notifications_enabled = _parse_shift_update_notifications_enabled( d.pop("shift_update_notifications_enabled", UNSET) ) - def _parse_shift_report_enabled(data: object) -> bool | None | Unset: + def _parse_shift_report_enabled(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) shift_report_enabled = _parse_shift_report_enabled(d.pop("shift_report_enabled", UNSET)) _shift_report_day_of_week = d.pop("shift_report_day_of_week", UNSET) - shift_report_day_of_week: NewScheduleDataAttributesShiftReportDayOfWeek | Unset + shift_report_day_of_week: Union[Unset, NewScheduleDataAttributesShiftReportDayOfWeek] if isinstance(_shift_report_day_of_week, Unset): shift_report_day_of_week = UNSET else: @@ -299,21 +297,21 @@ def _parse_shift_report_enabled(data: object) -> bool | None | Unset: _shift_report_day_of_week ) - def _parse_shift_report_time_of_day(data: object) -> None | str | Unset: + def _parse_shift_report_time_of_day(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) shift_report_time_of_day = _parse_shift_report_time_of_day(d.pop("shift_report_time_of_day", UNSET)) - def _parse_shift_report_time_zone(data: object) -> None | str | Unset: + def _parse_shift_report_time_zone(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) shift_report_time_zone = _parse_shift_report_time_zone(d.pop("shift_report_time_zone", UNSET)) diff --git a/rootly_sdk/models/new_schedule_data_attributes_slack_channel_type_0.py b/rootly_sdk/models/new_schedule_data_attributes_slack_channel_type_0.py index 7ba412f5..d4b97eb4 100644 --- a/rootly_sdk/models/new_schedule_data_attributes_slack_channel_type_0.py +++ b/rootly_sdk/models/new_schedule_data_attributes_slack_channel_type_0.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class NewScheduleDataAttributesSlackChannelType0: """ Attributes: - id (str | Unset): Slack channel ID - name (str | Unset): Slack channel name + id (Union[Unset, str]): Slack channel ID + name (Union[Unset, str]): Slack channel name """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/new_schedule_data_attributes_slack_user_group.py b/rootly_sdk/models/new_schedule_data_attributes_slack_user_group.py index 14467737..903d1c8b 100644 --- a/rootly_sdk/models/new_schedule_data_attributes_slack_user_group.py +++ b/rootly_sdk/models/new_schedule_data_attributes_slack_user_group.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class NewScheduleDataAttributesSlackUserGroup: """ Attributes: - id (str | Unset): Slack user group ID - name (str | Unset): Slack user group name + id (Union[Unset, str]): Slack user group ID + name (Union[Unset, str]): Slack user group name """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/new_schedule_rotation.py b/rootly_sdk/models/new_schedule_rotation.py index 8aee39c4..307e1325 100644 --- a/rootly_sdk/models/new_schedule_rotation.py +++ b/rootly_sdk/models/new_schedule_rotation.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewScheduleRotation: data (NewScheduleRotationData): """ - data: NewScheduleRotationData + data: "NewScheduleRotationData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_schedule_rotation_active_day.py b/rootly_sdk/models/new_schedule_rotation_active_day.py index 864d684e..d6df5007 100644 --- a/rootly_sdk/models/new_schedule_rotation_active_day.py +++ b/rootly_sdk/models/new_schedule_rotation_active_day.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewScheduleRotationActiveDay: data (NewScheduleRotationActiveDayData): """ - data: NewScheduleRotationActiveDayData + data: "NewScheduleRotationActiveDayData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_schedule_rotation_active_day_data.py b/rootly_sdk/models/new_schedule_rotation_active_day_data.py index 50b7ea10..1d357cf3 100644 --- a/rootly_sdk/models/new_schedule_rotation_active_day_data.py +++ b/rootly_sdk/models/new_schedule_rotation_active_day_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class NewScheduleRotationActiveDayData: """ type_: NewScheduleRotationActiveDayDataType - attributes: NewScheduleRotationActiveDayDataAttributes + attributes: "NewScheduleRotationActiveDayDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_schedule_rotation_active_day_data_attributes.py b/rootly_sdk/models/new_schedule_rotation_active_day_data_attributes.py index 5c90b1da..80542d68 100644 --- a/rootly_sdk/models/new_schedule_rotation_active_day_data_attributes.py +++ b/rootly_sdk/models/new_schedule_rotation_active_day_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -25,15 +23,14 @@ class NewScheduleRotationActiveDayDataAttributes: Attributes: day_name (NewScheduleRotationActiveDayDataAttributesDayName): Schedule rotation day name for which active times to be created - active_time_attributes (list[NewScheduleRotationActiveDayDataAttributesActiveTimeAttributesItem]): Schedule + active_time_attributes (list['NewScheduleRotationActiveDayDataAttributesActiveTimeAttributesItem']): Schedule rotation active times per day """ day_name: NewScheduleRotationActiveDayDataAttributesDayName - active_time_attributes: list[NewScheduleRotationActiveDayDataAttributesActiveTimeAttributesItem] + active_time_attributes: list["NewScheduleRotationActiveDayDataAttributesActiveTimeAttributesItem"] def to_dict(self) -> dict[str, Any]: - day_name: str = self.day_name active_time_attributes = [] diff --git a/rootly_sdk/models/new_schedule_rotation_active_day_data_attributes_active_time_attributes_item.py b/rootly_sdk/models/new_schedule_rotation_active_day_data_attributes_active_time_attributes_item.py index de2a9d11..5ed3f2be 100644 --- a/rootly_sdk/models/new_schedule_rotation_active_day_data_attributes_active_time_attributes_item.py +++ b/rootly_sdk/models/new_schedule_rotation_active_day_data_attributes_active_time_attributes_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class NewScheduleRotationActiveDayDataAttributesActiveTimeAttributesItem: """ Attributes: - start_time (str | Unset): Start time for schedule rotation active time - end_time (str | Unset): End time for schedule rotation active time + start_time (Union[Unset, str]): Start time for schedule rotation active time + end_time (Union[Unset, str]): End time for schedule rotation active time """ - start_time: str | Unset = UNSET - end_time: str | Unset = UNSET + start_time: Union[Unset, str] = UNSET + end_time: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/new_schedule_rotation_data.py b/rootly_sdk/models/new_schedule_rotation_data.py index 98a6852d..e505b64a 100644 --- a/rootly_sdk/models/new_schedule_rotation_data.py +++ b/rootly_sdk/models/new_schedule_rotation_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class NewScheduleRotationData: """ type_: NewScheduleRotationDataType - attributes: NewScheduleRotationDataAttributes + attributes: "NewScheduleRotationDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_schedule_rotation_data_attributes.py b/rootly_sdk/models/new_schedule_rotation_data_attributes.py index 58de8732..a4bbaa44 100644 --- a/rootly_sdk/models/new_schedule_rotation_data_attributes.py +++ b/rootly_sdk/models/new_schedule_rotation_data_attributes.py @@ -1,8 +1,6 @@ -from __future__ import annotations - import datetime from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from dateutil.parser import isoparse @@ -47,44 +45,45 @@ class NewScheduleRotationDataAttributes: Attributes: name (str): The name of the schedule rotation schedule_rotationable_type (NewScheduleRotationDataAttributesScheduleRotationableType): Schedule rotation type - schedule_rotationable_attributes (NewScheduleRotationDataAttributesScheduleRotationableAttributesType0 | - NewScheduleRotationDataAttributesScheduleRotationableAttributesType1 | - NewScheduleRotationDataAttributesScheduleRotationableAttributesType2 | - NewScheduleRotationDataAttributesScheduleRotationableAttributesType3): - position (int | Unset): Position of the schedule rotation - active_all_week (bool | Unset): Schedule rotation active all week? Default: True. - active_days (list[NewScheduleRotationDataAttributesActiveDaysItem] | Unset): - active_time_type (str | Unset): - active_time_attributes (list[NewScheduleRotationDataAttributesActiveTimeAttributesItem] | Unset): Schedule - rotation's active times - time_zone (str | Unset): A valid IANA time zone name. Default: 'Etc/UTC'. - start_time (datetime.datetime | None | Unset): RFC3339 date-time when rotation starts. Shifts will only be + schedule_rotationable_attributes (Union['NewScheduleRotationDataAttributesScheduleRotationableAttributesType0', + 'NewScheduleRotationDataAttributesScheduleRotationableAttributesType1', + 'NewScheduleRotationDataAttributesScheduleRotationableAttributesType2', + 'NewScheduleRotationDataAttributesScheduleRotationableAttributesType3']): + position (Union[Unset, int]): Position of the schedule rotation + active_all_week (Union[Unset, bool]): Schedule rotation active all week? Default: True. + active_days (Union[Unset, list[NewScheduleRotationDataAttributesActiveDaysItem]]): + active_time_type (Union[Unset, str]): + active_time_attributes (Union[Unset, list['NewScheduleRotationDataAttributesActiveTimeAttributesItem']]): + Schedule rotation's active times + time_zone (Union[Unset, str]): A valid IANA time zone name. Default: 'Etc/UTC'. + start_time (Union[None, Unset, datetime.datetime]): RFC3339 date-time when rotation starts. Shifts will only be created after this time. - end_time (datetime.datetime | None | Unset): RFC3339 date-time when rotation ends. Shifts will only be created - before this time. - schedule_rotation_members (list[NewScheduleRotationDataAttributesScheduleRotationMembersType0Item] | None | - Unset): You can only add schedule rotation members if your account has schedule nesting feature enabled + end_time (Union[None, Unset, datetime.datetime]): RFC3339 date-time when rotation ends. Shifts will only be + created before this time. + schedule_rotation_members (Union[None, Unset, + list['NewScheduleRotationDataAttributesScheduleRotationMembersType0Item']]): You can only add schedule rotation + members if your account has schedule nesting feature enabled """ name: str schedule_rotationable_type: NewScheduleRotationDataAttributesScheduleRotationableType - schedule_rotationable_attributes: ( - NewScheduleRotationDataAttributesScheduleRotationableAttributesType0 - | NewScheduleRotationDataAttributesScheduleRotationableAttributesType1 - | NewScheduleRotationDataAttributesScheduleRotationableAttributesType2 - | NewScheduleRotationDataAttributesScheduleRotationableAttributesType3 - ) - position: int | Unset = UNSET - active_all_week: bool | Unset = True - active_days: list[NewScheduleRotationDataAttributesActiveDaysItem] | Unset = UNSET - active_time_type: str | Unset = UNSET - active_time_attributes: list[NewScheduleRotationDataAttributesActiveTimeAttributesItem] | Unset = UNSET - time_zone: str | Unset = "Etc/UTC" - start_time: datetime.datetime | None | Unset = UNSET - end_time: datetime.datetime | None | Unset = UNSET - schedule_rotation_members: ( - list[NewScheduleRotationDataAttributesScheduleRotationMembersType0Item] | None | Unset - ) = UNSET + schedule_rotationable_attributes: Union[ + "NewScheduleRotationDataAttributesScheduleRotationableAttributesType0", + "NewScheduleRotationDataAttributesScheduleRotationableAttributesType1", + "NewScheduleRotationDataAttributesScheduleRotationableAttributesType2", + "NewScheduleRotationDataAttributesScheduleRotationableAttributesType3", + ] + position: Union[Unset, int] = UNSET + active_all_week: Union[Unset, bool] = True + active_days: Union[Unset, list[NewScheduleRotationDataAttributesActiveDaysItem]] = UNSET + active_time_type: Union[Unset, str] = UNSET + active_time_attributes: Union[Unset, list["NewScheduleRotationDataAttributesActiveTimeAttributesItem"]] = UNSET + time_zone: Union[Unset, str] = "Etc/UTC" + start_time: Union[None, Unset, datetime.datetime] = UNSET + end_time: Union[None, Unset, datetime.datetime] = UNSET + schedule_rotation_members: Union[ + None, Unset, list["NewScheduleRotationDataAttributesScheduleRotationMembersType0Item"] + ] = UNSET def to_dict(self) -> dict[str, Any]: from ..models.new_schedule_rotation_data_attributes_schedule_rotationable_attributes_type_0 import ( @@ -121,7 +120,7 @@ def to_dict(self) -> dict[str, Any]: active_all_week = self.active_all_week - active_days: list[str] | Unset = UNSET + active_days: Union[Unset, list[str]] = UNSET if not isinstance(self.active_days, Unset): active_days = [] for active_days_item_data in self.active_days: @@ -130,7 +129,7 @@ def to_dict(self) -> dict[str, Any]: active_time_type = self.active_time_type - active_time_attributes: list[dict[str, Any]] | Unset = UNSET + active_time_attributes: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.active_time_attributes, Unset): active_time_attributes = [] for active_time_attributes_item_data in self.active_time_attributes: @@ -139,7 +138,7 @@ def to_dict(self) -> dict[str, Any]: time_zone = self.time_zone - start_time: None | str | Unset + start_time: Union[None, Unset, str] if isinstance(self.start_time, Unset): start_time = UNSET elif isinstance(self.start_time, datetime.datetime): @@ -147,7 +146,7 @@ def to_dict(self) -> dict[str, Any]: else: start_time = self.start_time - end_time: None | str | Unset + end_time: Union[None, Unset, str] if isinstance(self.end_time, Unset): end_time = UNSET elif isinstance(self.end_time, datetime.datetime): @@ -155,7 +154,7 @@ def to_dict(self) -> dict[str, Any]: else: end_time = self.end_time - schedule_rotation_members: list[dict[str, Any]] | None | Unset + schedule_rotation_members: Union[None, Unset, list[dict[str, Any]]] if isinstance(self.schedule_rotation_members, Unset): schedule_rotation_members = UNSET elif isinstance(self.schedule_rotation_members, list): @@ -227,12 +226,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: def _parse_schedule_rotationable_attributes( data: object, - ) -> ( - NewScheduleRotationDataAttributesScheduleRotationableAttributesType0 - | NewScheduleRotationDataAttributesScheduleRotationableAttributesType1 - | NewScheduleRotationDataAttributesScheduleRotationableAttributesType2 - | NewScheduleRotationDataAttributesScheduleRotationableAttributesType3 - ): + ) -> Union[ + "NewScheduleRotationDataAttributesScheduleRotationableAttributesType0", + "NewScheduleRotationDataAttributesScheduleRotationableAttributesType1", + "NewScheduleRotationDataAttributesScheduleRotationableAttributesType2", + "NewScheduleRotationDataAttributesScheduleRotationableAttributesType3", + ]: try: if not isinstance(data, dict): raise TypeError() @@ -241,7 +240,7 @@ def _parse_schedule_rotationable_attributes( ) return schedule_rotationable_attributes_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -251,7 +250,7 @@ def _parse_schedule_rotationable_attributes( ) return schedule_rotationable_attributes_type_1 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -261,7 +260,7 @@ def _parse_schedule_rotationable_attributes( ) return schedule_rotationable_attributes_type_2 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass if not isinstance(data, dict): raise TypeError() @@ -279,31 +278,27 @@ def _parse_schedule_rotationable_attributes( active_all_week = d.pop("active_all_week", UNSET) + active_days = [] _active_days = d.pop("active_days", UNSET) - active_days: list[NewScheduleRotationDataAttributesActiveDaysItem] | Unset = UNSET - if _active_days is not UNSET: - active_days = [] - for active_days_item_data in _active_days: - active_days_item = check_new_schedule_rotation_data_attributes_active_days_item(active_days_item_data) + for active_days_item_data in _active_days or []: + active_days_item = check_new_schedule_rotation_data_attributes_active_days_item(active_days_item_data) - active_days.append(active_days_item) + active_days.append(active_days_item) active_time_type = d.pop("active_time_type", UNSET) + active_time_attributes = [] _active_time_attributes = d.pop("active_time_attributes", UNSET) - active_time_attributes: list[NewScheduleRotationDataAttributesActiveTimeAttributesItem] | Unset = UNSET - if _active_time_attributes is not UNSET: - active_time_attributes = [] - for active_time_attributes_item_data in _active_time_attributes: - active_time_attributes_item = NewScheduleRotationDataAttributesActiveTimeAttributesItem.from_dict( - active_time_attributes_item_data - ) + for active_time_attributes_item_data in _active_time_attributes or []: + active_time_attributes_item = NewScheduleRotationDataAttributesActiveTimeAttributesItem.from_dict( + active_time_attributes_item_data + ) - active_time_attributes.append(active_time_attributes_item) + active_time_attributes.append(active_time_attributes_item) time_zone = d.pop("time_zone", UNSET) - def _parse_start_time(data: object) -> datetime.datetime | None | Unset: + def _parse_start_time(data: object) -> Union[None, Unset, datetime.datetime]: if data is None: return data if isinstance(data, Unset): @@ -314,13 +309,13 @@ def _parse_start_time(data: object) -> datetime.datetime | None | Unset: start_time_type_0 = isoparse(data) return start_time_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(datetime.datetime | None | Unset, data) + return cast(Union[None, Unset, datetime.datetime], data) start_time = _parse_start_time(d.pop("start_time", UNSET)) - def _parse_end_time(data: object) -> datetime.datetime | None | Unset: + def _parse_end_time(data: object) -> Union[None, Unset, datetime.datetime]: if data is None: return data if isinstance(data, Unset): @@ -331,15 +326,15 @@ def _parse_end_time(data: object) -> datetime.datetime | None | Unset: end_time_type_0 = isoparse(data) return end_time_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(datetime.datetime | None | Unset, data) + return cast(Union[None, Unset, datetime.datetime], data) end_time = _parse_end_time(d.pop("end_time", UNSET)) def _parse_schedule_rotation_members( data: object, - ) -> list[NewScheduleRotationDataAttributesScheduleRotationMembersType0Item] | None | Unset: + ) -> Union[None, Unset, list["NewScheduleRotationDataAttributesScheduleRotationMembersType0Item"]]: if data is None: return data if isinstance(data, Unset): @@ -359,9 +354,11 @@ def _parse_schedule_rotation_members( schedule_rotation_members_type_0.append(schedule_rotation_members_type_0_item) return schedule_rotation_members_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[NewScheduleRotationDataAttributesScheduleRotationMembersType0Item] | None | Unset, data) + return cast( + Union[None, Unset, list["NewScheduleRotationDataAttributesScheduleRotationMembersType0Item"]], data + ) schedule_rotation_members = _parse_schedule_rotation_members(d.pop("schedule_rotation_members", UNSET)) diff --git a/rootly_sdk/models/new_schedule_rotation_data_attributes_active_time_attributes_item.py b/rootly_sdk/models/new_schedule_rotation_data_attributes_active_time_attributes_item.py index ea904017..537d6cc7 100644 --- a/rootly_sdk/models/new_schedule_rotation_data_attributes_active_time_attributes_item.py +++ b/rootly_sdk/models/new_schedule_rotation_data_attributes_active_time_attributes_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/new_schedule_rotation_data_attributes_schedule_rotation_members_type_0_item.py b/rootly_sdk/models/new_schedule_rotation_data_attributes_schedule_rotation_members_type_0_item.py index a92b1c18..b438d01b 100644 --- a/rootly_sdk/models/new_schedule_rotation_data_attributes_schedule_rotation_members_type_0_item.py +++ b/rootly_sdk/models/new_schedule_rotation_data_attributes_schedule_rotation_members_type_0_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,12 +19,12 @@ class NewScheduleRotationDataAttributesScheduleRotationMembersType0Item: Attributes: member_type (NewScheduleRotationDataAttributesScheduleRotationMembersType0ItemMemberType): Type of member member_id (str): ID of the member - position (int | Unset): Position of the member in rotation + position (Union[Unset, int]): Position of the member in rotation """ member_type: NewScheduleRotationDataAttributesScheduleRotationMembersType0ItemMemberType member_id: str - position: int | Unset = UNSET + position: Union[Unset, int] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/new_schedule_rotation_data_attributes_schedule_rotationable_attributes_type_0.py b/rootly_sdk/models/new_schedule_rotation_data_attributes_schedule_rotationable_attributes_type_0.py index 449f524c..eefc9fec 100644 --- a/rootly_sdk/models/new_schedule_rotation_data_attributes_schedule_rotationable_attributes_type_0.py +++ b/rootly_sdk/models/new_schedule_rotation_data_attributes_schedule_rotationable_attributes_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/new_schedule_rotation_data_attributes_schedule_rotationable_attributes_type_1.py b/rootly_sdk/models/new_schedule_rotation_data_attributes_schedule_rotationable_attributes_type_1.py index e9acdcbb..072117a6 100644 --- a/rootly_sdk/models/new_schedule_rotation_data_attributes_schedule_rotationable_attributes_type_1.py +++ b/rootly_sdk/models/new_schedule_rotation_data_attributes_schedule_rotationable_attributes_type_1.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/new_schedule_rotation_data_attributes_schedule_rotationable_attributes_type_2.py b/rootly_sdk/models/new_schedule_rotation_data_attributes_schedule_rotationable_attributes_type_2.py index 138831b9..a360a993 100644 --- a/rootly_sdk/models/new_schedule_rotation_data_attributes_schedule_rotationable_attributes_type_2.py +++ b/rootly_sdk/models/new_schedule_rotation_data_attributes_schedule_rotationable_attributes_type_2.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/new_schedule_rotation_data_attributes_schedule_rotationable_attributes_type_3.py b/rootly_sdk/models/new_schedule_rotation_data_attributes_schedule_rotationable_attributes_type_3.py index 2f076f7f..3aeaa7eb 100644 --- a/rootly_sdk/models/new_schedule_rotation_data_attributes_schedule_rotationable_attributes_type_3.py +++ b/rootly_sdk/models/new_schedule_rotation_data_attributes_schedule_rotationable_attributes_type_3.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/new_schedule_rotation_user.py b/rootly_sdk/models/new_schedule_rotation_user.py index a6ff2183..0f37ecad 100644 --- a/rootly_sdk/models/new_schedule_rotation_user.py +++ b/rootly_sdk/models/new_schedule_rotation_user.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,15 +17,14 @@ class NewScheduleRotationUser: """ Attributes: - data (NewScheduleRotationUserData | Unset): + data (Union[Unset, NewScheduleRotationUserData]): """ - data: NewScheduleRotationUserData | Unset = UNSET + data: Union[Unset, "NewScheduleRotationUserData"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - - data: dict[str, Any] | Unset = UNSET + data: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.data, Unset): data = self.data.to_dict() @@ -45,7 +42,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _data = d.pop("data", UNSET) - data: NewScheduleRotationUserData | Unset + data: Union[Unset, NewScheduleRotationUserData] if isinstance(_data, Unset): data = UNSET else: diff --git a/rootly_sdk/models/new_schedule_rotation_user_data.py b/rootly_sdk/models/new_schedule_rotation_user_data.py index e7939952..163d0d55 100644 --- a/rootly_sdk/models/new_schedule_rotation_user_data.py +++ b/rootly_sdk/models/new_schedule_rotation_user_data.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,21 +21,20 @@ class NewScheduleRotationUserData: """ Attributes: - type_ (NewScheduleRotationUserDataType | Unset): - attributes (NewScheduleRotationUserDataAttributes | Unset): + type_ (Union[Unset, NewScheduleRotationUserDataType]): + attributes (Union[Unset, NewScheduleRotationUserDataAttributes]): """ - type_: NewScheduleRotationUserDataType | Unset = UNSET - attributes: NewScheduleRotationUserDataAttributes | Unset = UNSET + type_: Union[Unset, NewScheduleRotationUserDataType] = UNSET + attributes: Union[Unset, "NewScheduleRotationUserDataAttributes"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - - type_: str | Unset = UNSET + type_: Union[Unset, str] = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ - attributes: dict[str, Any] | Unset = UNSET + attributes: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.attributes, Unset): attributes = self.attributes.to_dict() @@ -57,14 +54,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _type_ = d.pop("type", UNSET) - type_: NewScheduleRotationUserDataType | Unset + type_: Union[Unset, NewScheduleRotationUserDataType] if isinstance(_type_, Unset): type_ = UNSET else: type_ = check_new_schedule_rotation_user_data_type(_type_) _attributes = d.pop("attributes", UNSET) - attributes: NewScheduleRotationUserDataAttributes | Unset + attributes: Union[Unset, NewScheduleRotationUserDataAttributes] if isinstance(_attributes, Unset): attributes = UNSET else: diff --git a/rootly_sdk/models/new_schedule_rotation_user_data_attributes.py b/rootly_sdk/models/new_schedule_rotation_user_data_attributes.py index 0c5bb168..ed140dcd 100644 --- a/rootly_sdk/models/new_schedule_rotation_user_data_attributes.py +++ b/rootly_sdk/models/new_schedule_rotation_user_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define @@ -15,11 +13,11 @@ class NewScheduleRotationUserDataAttributes: """ Attributes: user_id (int): Schedule rotation user - position (int | Unset): Position of the user inside rotation + position (Union[Unset, int]): Position of the user inside rotation """ user_id: int - position: int | Unset = UNSET + position: Union[Unset, int] = UNSET def to_dict(self) -> dict[str, Any]: user_id = self.user_id diff --git a/rootly_sdk/models/new_secret.py b/rootly_sdk/models/new_secret.py index 159467a5..ce538bb4 100644 --- a/rootly_sdk/models/new_secret.py +++ b/rootly_sdk/models/new_secret.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewSecret: data (NewSecretData): """ - data: NewSecretData + data: "NewSecretData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_secret_data.py b/rootly_sdk/models/new_secret_data.py index 39ddaac2..8afbb5d3 100644 --- a/rootly_sdk/models/new_secret_data.py +++ b/rootly_sdk/models/new_secret_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class NewSecretData: """ type_: NewSecretDataType - attributes: NewSecretDataAttributes + attributes: "NewSecretDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_secret_data_attributes.py b/rootly_sdk/models/new_secret_data_attributes.py index 53d1dd68..f76cd353 100644 --- a/rootly_sdk/models/new_secret_data_attributes.py +++ b/rootly_sdk/models/new_secret_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -17,41 +15,41 @@ class NewSecretDataAttributes: Attributes: name (str): The name of the secret secret (str): The secret - kind (NewSecretDataAttributesKind | Unset): The kind of the secret - hashicorp_vault_mount (None | str | Unset): The HashiCorp Vault secret mount path Default: 'secret'. - hashicorp_vault_path (None | str | Unset): The HashiCorp Vault secret path - hashicorp_vault_version (None | str | Unset): The HashiCorp Vault secret version Default: '0'. + kind (Union[Unset, NewSecretDataAttributesKind]): The kind of the secret + hashicorp_vault_mount (Union[None, Unset, str]): The HashiCorp Vault secret mount path Default: 'secret'. + hashicorp_vault_path (Union[None, Unset, str]): The HashiCorp Vault secret path + hashicorp_vault_version (Union[None, Unset, str]): The HashiCorp Vault secret version Default: '0'. """ name: str secret: str - kind: NewSecretDataAttributesKind | Unset = UNSET - hashicorp_vault_mount: None | str | Unset = "secret" - hashicorp_vault_path: None | str | Unset = UNSET - hashicorp_vault_version: None | str | Unset = "0" + kind: Union[Unset, NewSecretDataAttributesKind] = UNSET + hashicorp_vault_mount: Union[None, Unset, str] = "secret" + hashicorp_vault_path: Union[None, Unset, str] = UNSET + hashicorp_vault_version: Union[None, Unset, str] = "0" def to_dict(self) -> dict[str, Any]: name = self.name secret = self.secret - kind: str | Unset = UNSET + kind: Union[Unset, str] = UNSET if not isinstance(self.kind, Unset): kind = self.kind - hashicorp_vault_mount: None | str | Unset + hashicorp_vault_mount: Union[None, Unset, str] if isinstance(self.hashicorp_vault_mount, Unset): hashicorp_vault_mount = UNSET else: hashicorp_vault_mount = self.hashicorp_vault_mount - hashicorp_vault_path: None | str | Unset + hashicorp_vault_path: Union[None, Unset, str] if isinstance(self.hashicorp_vault_path, Unset): hashicorp_vault_path = UNSET else: hashicorp_vault_path = self.hashicorp_vault_path - hashicorp_vault_version: None | str | Unset + hashicorp_vault_version: Union[None, Unset, str] if isinstance(self.hashicorp_vault_version, Unset): hashicorp_vault_version = UNSET else: @@ -84,36 +82,36 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: secret = d.pop("secret") _kind = d.pop("kind", UNSET) - kind: NewSecretDataAttributesKind | Unset + kind: Union[Unset, NewSecretDataAttributesKind] if isinstance(_kind, Unset): kind = UNSET else: kind = check_new_secret_data_attributes_kind(_kind) - def _parse_hashicorp_vault_mount(data: object) -> None | str | Unset: + def _parse_hashicorp_vault_mount(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) hashicorp_vault_mount = _parse_hashicorp_vault_mount(d.pop("hashicorp_vault_mount", UNSET)) - def _parse_hashicorp_vault_path(data: object) -> None | str | Unset: + def _parse_hashicorp_vault_path(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) hashicorp_vault_path = _parse_hashicorp_vault_path(d.pop("hashicorp_vault_path", UNSET)) - def _parse_hashicorp_vault_version(data: object) -> None | str | Unset: + def _parse_hashicorp_vault_version(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) hashicorp_vault_version = _parse_hashicorp_vault_version(d.pop("hashicorp_vault_version", UNSET)) diff --git a/rootly_sdk/models/new_service.py b/rootly_sdk/models/new_service.py index 85709594..6f97932c 100644 --- a/rootly_sdk/models/new_service.py +++ b/rootly_sdk/models/new_service.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewService: data (NewServiceData): """ - data: NewServiceData + data: "NewServiceData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_service_data.py b/rootly_sdk/models/new_service_data.py index bfa03fd3..2e7856bd 100644 --- a/rootly_sdk/models/new_service_data.py +++ b/rootly_sdk/models/new_service_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class NewServiceData: """ type_: NewServiceDataType - attributes: NewServiceDataAttributes + attributes: "NewServiceDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_service_data_attributes.py b/rootly_sdk/models/new_service_data_attributes.py index 2420ad46..5c6c8fbd 100644 --- a/rootly_sdk/models/new_service_data_attributes.py +++ b/rootly_sdk/models/new_service_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -35,83 +33,90 @@ class NewServiceDataAttributes: """ Attributes: name (str): The name of the service - description (None | str | Unset): The description of the service - public_description (None | str | Unset): The public description of the service - notify_emails (list[str] | None | Unset): Emails to attach to the service - color (None | str | Unset): The hex color of the service - position (int | None | Unset): Position of the service - show_uptime (bool | None | Unset): Show uptime - show_uptime_last_days (NewServiceDataAttributesShowUptimeLastDays | Unset): Show uptime over x days Default: 60. - backstage_id (None | str | Unset): The Backstage entity id associated to this service. eg: + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + description (Union[None, Unset, str]): The description of the service + public_description (Union[None, Unset, str]): The status page description of the service + notify_emails (Union[None, Unset, list[str]]): Emails to attach to the service + color (Union[None, Unset, str]): The hex color of the service + position (Union[None, Unset, int]): Position of the service + show_uptime (Union[None, Unset, bool]): Show uptime + show_uptime_last_days (Union[Unset, NewServiceDataAttributesShowUptimeLastDays]): Show uptime over x days + Default: 60. + backstage_id (Union[None, Unset, str]): The Backstage entity id associated to this service. eg: :namespace/:kind/:entity_name - pagerduty_id (None | str | Unset): The PagerDuty service id associated to this service - external_id (None | str | Unset): The external id associated to this service - opsgenie_id (None | str | Unset): The Opsgenie service id associated to this service - opsgenie_team_id (None | str | Unset): The Opsgenie team id associated to this service - cortex_id (None | str | Unset): The Cortex group id associated to this service - service_now_ci_sys_id (None | str | Unset): The Service Now CI sys id associated to this service - github_repository_name (None | str | Unset): The GitHub repository name associated to this service. eg: + pagerduty_id (Union[None, Unset, str]): The PagerDuty service id associated to this service + external_id (Union[None, Unset, str]): The external id associated to this service + opsgenie_id (Union[None, Unset, str]): The Opsgenie service id associated to this service + opsgenie_team_id (Union[None, Unset, str]): The Opsgenie team id associated to this service + cortex_id (Union[None, Unset, str]): The Cortex group id associated to this service + service_now_ci_sys_id (Union[None, Unset, str]): The Service Now CI sys id associated to this service + github_repository_name (Union[None, Unset, str]): The GitHub repository name associated to this service. eg: rootlyhq/my-service - github_repository_branch (None | str | Unset): The GitHub repository branch associated to this service. eg: main - gitlab_repository_name (None | str | Unset): The GitLab repository name associated to this service. eg: + github_repository_branch (Union[None, Unset, str]): The GitHub repository branch associated to this service. eg: + main + gitlab_repository_name (Union[None, Unset, str]): The GitLab repository name associated to this service. eg: rootlyhq/my-service - gitlab_repository_branch (None | str | Unset): The GitLab repository branch associated to this service. eg: main - environment_ids (list[str] | None | Unset): Environments associated with this service - service_ids (list[str] | None | Unset): Services dependent on this service - owner_group_ids (list[str] | None | Unset): Owner Teams associated with this service - owner_user_ids (list[int] | None | Unset): Owner Users associated with this service - kubernetes_deployment_name (None | str | Unset): The Kubernetes deployment name associated to this service. eg: - namespace/deployment-name - alerts_email_enabled (bool | None | Unset): Enable alerts through email - alert_urgency_id (None | str | Unset): The alert urgency id of the service - escalation_policy_id (None | str | Unset): The escalation policy id of the service - slack_channels (list[NewServiceDataAttributesSlackChannelsType0Item] | None | Unset): Slack Channels associated - with this service - slack_aliases (list[NewServiceDataAttributesSlackAliasesType0Item] | None | Unset): Slack Aliases associated - with this service - alert_broadcast_enabled (bool | None | Unset): Enable alerts to be broadcasted to a specific channel - alert_broadcast_channel (NewServiceDataAttributesAlertBroadcastChannelType0 | None | Unset): Slack channel to - broadcast alerts to - incident_broadcast_enabled (bool | None | Unset): Enable incidents to be broadcasted to a specific channel - incident_broadcast_channel (NewServiceDataAttributesIncidentBroadcastChannelType0 | None | Unset): Slack channel - to broadcast incidents to - properties (list[NewServiceDataAttributesPropertiesItem] | Unset): Array of property values for this service. + gitlab_repository_branch (Union[None, Unset, str]): The GitLab repository branch associated to this service. eg: + main + environment_ids (Union[None, Unset, list[str]]): Environments associated with this service + service_ids (Union[None, Unset, list[str]]): Services dependent on this service + owner_group_ids (Union[None, Unset, list[str]]): Owner Teams associated with this service + owner_user_ids (Union[None, Unset, list[int]]): Owner Users associated with this service + kubernetes_deployment_name (Union[None, Unset, str]): The Kubernetes deployment name associated to this service. + eg: namespace/deployment-name + alerts_email_enabled (Union[None, Unset, bool]): Enable alerts through email + alert_urgency_id (Union[None, Unset, str]): The alert urgency id of the service + escalation_policy_id (Union[None, Unset, str]): The escalation policy id of the service + slack_channels (Union[None, Unset, list['NewServiceDataAttributesSlackChannelsType0Item']]): Slack Channels + associated with this service + slack_aliases (Union[None, Unset, list['NewServiceDataAttributesSlackAliasesType0Item']]): Slack Aliases + associated with this service + alert_broadcast_enabled (Union[None, Unset, bool]): Enable alerts to be broadcasted to a specific channel + alert_broadcast_channel (Union['NewServiceDataAttributesAlertBroadcastChannelType0', None, Unset]): Slack + channel to broadcast alerts to + incident_broadcast_enabled (Union[None, Unset, bool]): Enable incidents to be broadcasted to a specific channel + incident_broadcast_channel (Union['NewServiceDataAttributesIncidentBroadcastChannelType0', None, Unset]): Slack + channel to broadcast incidents to + properties (Union[Unset, list['NewServiceDataAttributesPropertiesItem']]): Array of property values for this + service. """ name: str - description: None | str | Unset = UNSET - public_description: None | str | Unset = UNSET - notify_emails: list[str] | None | Unset = UNSET - color: None | str | Unset = UNSET - position: int | None | Unset = UNSET - show_uptime: bool | None | Unset = UNSET - show_uptime_last_days: NewServiceDataAttributesShowUptimeLastDays | Unset = 60 - backstage_id: None | str | Unset = UNSET - pagerduty_id: None | str | Unset = UNSET - external_id: None | str | Unset = UNSET - opsgenie_id: None | str | Unset = UNSET - opsgenie_team_id: None | str | Unset = UNSET - cortex_id: None | str | Unset = UNSET - service_now_ci_sys_id: None | str | Unset = UNSET - github_repository_name: None | str | Unset = UNSET - github_repository_branch: None | str | Unset = UNSET - gitlab_repository_name: None | str | Unset = UNSET - gitlab_repository_branch: None | str | Unset = UNSET - environment_ids: list[str] | None | Unset = UNSET - service_ids: list[str] | None | Unset = UNSET - owner_group_ids: list[str] | None | Unset = UNSET - owner_user_ids: list[int] | None | Unset = UNSET - kubernetes_deployment_name: None | str | Unset = UNSET - alerts_email_enabled: bool | None | Unset = UNSET - alert_urgency_id: None | str | Unset = UNSET - escalation_policy_id: None | str | Unset = UNSET - slack_channels: list[NewServiceDataAttributesSlackChannelsType0Item] | None | Unset = UNSET - slack_aliases: list[NewServiceDataAttributesSlackAliasesType0Item] | None | Unset = UNSET - alert_broadcast_enabled: bool | None | Unset = UNSET - alert_broadcast_channel: NewServiceDataAttributesAlertBroadcastChannelType0 | None | Unset = UNSET - incident_broadcast_enabled: bool | None | Unset = UNSET - incident_broadcast_channel: NewServiceDataAttributesIncidentBroadcastChannelType0 | None | Unset = UNSET - properties: list[NewServiceDataAttributesPropertiesItem] | Unset = UNSET + slug: Union[None, Unset, str] = UNSET + description: Union[None, Unset, str] = UNSET + public_description: Union[None, Unset, str] = UNSET + notify_emails: Union[None, Unset, list[str]] = UNSET + color: Union[None, Unset, str] = UNSET + position: Union[None, Unset, int] = UNSET + show_uptime: Union[None, Unset, bool] = UNSET + show_uptime_last_days: Union[Unset, NewServiceDataAttributesShowUptimeLastDays] = 60 + backstage_id: Union[None, Unset, str] = UNSET + pagerduty_id: Union[None, Unset, str] = UNSET + external_id: Union[None, Unset, str] = UNSET + opsgenie_id: Union[None, Unset, str] = UNSET + opsgenie_team_id: Union[None, Unset, str] = UNSET + cortex_id: Union[None, Unset, str] = UNSET + service_now_ci_sys_id: Union[None, Unset, str] = UNSET + github_repository_name: Union[None, Unset, str] = UNSET + github_repository_branch: Union[None, Unset, str] = UNSET + gitlab_repository_name: Union[None, Unset, str] = UNSET + gitlab_repository_branch: Union[None, Unset, str] = UNSET + environment_ids: Union[None, Unset, list[str]] = UNSET + service_ids: Union[None, Unset, list[str]] = UNSET + owner_group_ids: Union[None, Unset, list[str]] = UNSET + owner_user_ids: Union[None, Unset, list[int]] = UNSET + kubernetes_deployment_name: Union[None, Unset, str] = UNSET + alerts_email_enabled: Union[None, Unset, bool] = UNSET + alert_urgency_id: Union[None, Unset, str] = UNSET + escalation_policy_id: Union[None, Unset, str] = UNSET + slack_channels: Union[None, Unset, list["NewServiceDataAttributesSlackChannelsType0Item"]] = UNSET + slack_aliases: Union[None, Unset, list["NewServiceDataAttributesSlackAliasesType0Item"]] = UNSET + alert_broadcast_enabled: Union[None, Unset, bool] = UNSET + alert_broadcast_channel: Union["NewServiceDataAttributesAlertBroadcastChannelType0", None, Unset] = UNSET + incident_broadcast_enabled: Union[None, Unset, bool] = UNSET + incident_broadcast_channel: Union["NewServiceDataAttributesIncidentBroadcastChannelType0", None, Unset] = UNSET + properties: Union[Unset, list["NewServiceDataAttributesPropertiesItem"]] = UNSET def to_dict(self) -> dict[str, Any]: from ..models.new_service_data_attributes_alert_broadcast_channel_type_0 import ( @@ -123,19 +128,25 @@ def to_dict(self) -> dict[str, Any]: name = self.name - description: None | str | Unset + slug: Union[None, Unset, str] + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug + + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: description = self.description - public_description: None | str | Unset + public_description: Union[None, Unset, str] if isinstance(self.public_description, Unset): public_description = UNSET else: public_description = self.public_description - notify_emails: list[str] | None | Unset + notify_emails: Union[None, Unset, list[str]] if isinstance(self.notify_emails, Unset): notify_emails = UNSET elif isinstance(self.notify_emails, list): @@ -144,95 +155,95 @@ def to_dict(self) -> dict[str, Any]: else: notify_emails = self.notify_emails - color: None | str | Unset + color: Union[None, Unset, str] if isinstance(self.color, Unset): color = UNSET else: color = self.color - position: int | None | Unset + position: Union[None, Unset, int] if isinstance(self.position, Unset): position = UNSET else: position = self.position - show_uptime: bool | None | Unset + show_uptime: Union[None, Unset, bool] if isinstance(self.show_uptime, Unset): show_uptime = UNSET else: show_uptime = self.show_uptime - show_uptime_last_days: int | Unset = UNSET + show_uptime_last_days: Union[Unset, int] = UNSET if not isinstance(self.show_uptime_last_days, Unset): show_uptime_last_days = self.show_uptime_last_days - backstage_id: None | str | Unset + backstage_id: Union[None, Unset, str] if isinstance(self.backstage_id, Unset): backstage_id = UNSET else: backstage_id = self.backstage_id - pagerduty_id: None | str | Unset + pagerduty_id: Union[None, Unset, str] if isinstance(self.pagerduty_id, Unset): pagerduty_id = UNSET else: pagerduty_id = self.pagerduty_id - external_id: None | str | Unset + external_id: Union[None, Unset, str] if isinstance(self.external_id, Unset): external_id = UNSET else: external_id = self.external_id - opsgenie_id: None | str | Unset + opsgenie_id: Union[None, Unset, str] if isinstance(self.opsgenie_id, Unset): opsgenie_id = UNSET else: opsgenie_id = self.opsgenie_id - opsgenie_team_id: None | str | Unset + opsgenie_team_id: Union[None, Unset, str] if isinstance(self.opsgenie_team_id, Unset): opsgenie_team_id = UNSET else: opsgenie_team_id = self.opsgenie_team_id - cortex_id: None | str | Unset + cortex_id: Union[None, Unset, str] if isinstance(self.cortex_id, Unset): cortex_id = UNSET else: cortex_id = self.cortex_id - service_now_ci_sys_id: None | str | Unset + service_now_ci_sys_id: Union[None, Unset, str] if isinstance(self.service_now_ci_sys_id, Unset): service_now_ci_sys_id = UNSET else: service_now_ci_sys_id = self.service_now_ci_sys_id - github_repository_name: None | str | Unset + github_repository_name: Union[None, Unset, str] if isinstance(self.github_repository_name, Unset): github_repository_name = UNSET else: github_repository_name = self.github_repository_name - github_repository_branch: None | str | Unset + github_repository_branch: Union[None, Unset, str] if isinstance(self.github_repository_branch, Unset): github_repository_branch = UNSET else: github_repository_branch = self.github_repository_branch - gitlab_repository_name: None | str | Unset + gitlab_repository_name: Union[None, Unset, str] if isinstance(self.gitlab_repository_name, Unset): gitlab_repository_name = UNSET else: gitlab_repository_name = self.gitlab_repository_name - gitlab_repository_branch: None | str | Unset + gitlab_repository_branch: Union[None, Unset, str] if isinstance(self.gitlab_repository_branch, Unset): gitlab_repository_branch = UNSET else: gitlab_repository_branch = self.gitlab_repository_branch - environment_ids: list[str] | None | Unset + environment_ids: Union[None, Unset, list[str]] if isinstance(self.environment_ids, Unset): environment_ids = UNSET elif isinstance(self.environment_ids, list): @@ -241,7 +252,7 @@ def to_dict(self) -> dict[str, Any]: else: environment_ids = self.environment_ids - service_ids: list[str] | None | Unset + service_ids: Union[None, Unset, list[str]] if isinstance(self.service_ids, Unset): service_ids = UNSET elif isinstance(self.service_ids, list): @@ -250,7 +261,7 @@ def to_dict(self) -> dict[str, Any]: else: service_ids = self.service_ids - owner_group_ids: list[str] | None | Unset + owner_group_ids: Union[None, Unset, list[str]] if isinstance(self.owner_group_ids, Unset): owner_group_ids = UNSET elif isinstance(self.owner_group_ids, list): @@ -259,7 +270,7 @@ def to_dict(self) -> dict[str, Any]: else: owner_group_ids = self.owner_group_ids - owner_user_ids: list[int] | None | Unset + owner_user_ids: Union[None, Unset, list[int]] if isinstance(self.owner_user_ids, Unset): owner_user_ids = UNSET elif isinstance(self.owner_user_ids, list): @@ -268,31 +279,31 @@ def to_dict(self) -> dict[str, Any]: else: owner_user_ids = self.owner_user_ids - kubernetes_deployment_name: None | str | Unset + kubernetes_deployment_name: Union[None, Unset, str] if isinstance(self.kubernetes_deployment_name, Unset): kubernetes_deployment_name = UNSET else: kubernetes_deployment_name = self.kubernetes_deployment_name - alerts_email_enabled: bool | None | Unset + alerts_email_enabled: Union[None, Unset, bool] if isinstance(self.alerts_email_enabled, Unset): alerts_email_enabled = UNSET else: alerts_email_enabled = self.alerts_email_enabled - alert_urgency_id: None | str | Unset + alert_urgency_id: Union[None, Unset, str] if isinstance(self.alert_urgency_id, Unset): alert_urgency_id = UNSET else: alert_urgency_id = self.alert_urgency_id - escalation_policy_id: None | str | Unset + escalation_policy_id: Union[None, Unset, str] if isinstance(self.escalation_policy_id, Unset): escalation_policy_id = UNSET else: escalation_policy_id = self.escalation_policy_id - slack_channels: list[dict[str, Any]] | None | Unset + slack_channels: Union[None, Unset, list[dict[str, Any]]] if isinstance(self.slack_channels, Unset): slack_channels = UNSET elif isinstance(self.slack_channels, list): @@ -304,7 +315,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_channels = self.slack_channels - slack_aliases: list[dict[str, Any]] | None | Unset + slack_aliases: Union[None, Unset, list[dict[str, Any]]] if isinstance(self.slack_aliases, Unset): slack_aliases = UNSET elif isinstance(self.slack_aliases, list): @@ -316,13 +327,13 @@ def to_dict(self) -> dict[str, Any]: else: slack_aliases = self.slack_aliases - alert_broadcast_enabled: bool | None | Unset + alert_broadcast_enabled: Union[None, Unset, bool] if isinstance(self.alert_broadcast_enabled, Unset): alert_broadcast_enabled = UNSET else: alert_broadcast_enabled = self.alert_broadcast_enabled - alert_broadcast_channel: dict[str, Any] | None | Unset + alert_broadcast_channel: Union[None, Unset, dict[str, Any]] if isinstance(self.alert_broadcast_channel, Unset): alert_broadcast_channel = UNSET elif isinstance(self.alert_broadcast_channel, NewServiceDataAttributesAlertBroadcastChannelType0): @@ -330,13 +341,13 @@ def to_dict(self) -> dict[str, Any]: else: alert_broadcast_channel = self.alert_broadcast_channel - incident_broadcast_enabled: bool | None | Unset + incident_broadcast_enabled: Union[None, Unset, bool] if isinstance(self.incident_broadcast_enabled, Unset): incident_broadcast_enabled = UNSET else: incident_broadcast_enabled = self.incident_broadcast_enabled - incident_broadcast_channel: dict[str, Any] | None | Unset + incident_broadcast_channel: Union[None, Unset, dict[str, Any]] if isinstance(self.incident_broadcast_channel, Unset): incident_broadcast_channel = UNSET elif isinstance(self.incident_broadcast_channel, NewServiceDataAttributesIncidentBroadcastChannelType0): @@ -344,7 +355,7 @@ def to_dict(self) -> dict[str, Any]: else: incident_broadcast_channel = self.incident_broadcast_channel - properties: list[dict[str, Any]] | Unset = UNSET + properties: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.properties, Unset): properties = [] for properties_item_data in self.properties: @@ -358,6 +369,8 @@ def to_dict(self) -> dict[str, Any]: "name": name, } ) + if slug is not UNSET: + field_dict["slug"] = slug if description is not UNSET: field_dict["description"] = description if public_description is not UNSET: @@ -446,25 +459,34 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name") - def _parse_description(data: object) -> None | str | Unset: + def _parse_slug(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) + + slug = _parse_slug(d.pop("slug", UNSET)) + + def _parse_description(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) - def _parse_public_description(data: object) -> None | str | Unset: + def _parse_public_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) public_description = _parse_public_description(d.pop("public_description", UNSET)) - def _parse_notify_emails(data: object) -> list[str] | None | Unset: + def _parse_notify_emails(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -475,146 +497,146 @@ def _parse_notify_emails(data: object) -> list[str] | None | Unset: notify_emails_type_0 = cast(list[str], data) return notify_emails_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) notify_emails = _parse_notify_emails(d.pop("notify_emails", UNSET)) - def _parse_color(data: object) -> None | str | Unset: + def _parse_color(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) color = _parse_color(d.pop("color", UNSET)) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> Union[None, Unset, int]: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(Union[None, Unset, int], data) position = _parse_position(d.pop("position", UNSET)) - def _parse_show_uptime(data: object) -> bool | None | Unset: + def _parse_show_uptime(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) show_uptime = _parse_show_uptime(d.pop("show_uptime", UNSET)) _show_uptime_last_days = d.pop("show_uptime_last_days", UNSET) - show_uptime_last_days: NewServiceDataAttributesShowUptimeLastDays | Unset + show_uptime_last_days: Union[Unset, NewServiceDataAttributesShowUptimeLastDays] if isinstance(_show_uptime_last_days, Unset): show_uptime_last_days = UNSET else: show_uptime_last_days = check_new_service_data_attributes_show_uptime_last_days(_show_uptime_last_days) - def _parse_backstage_id(data: object) -> None | str | Unset: + def _parse_backstage_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) backstage_id = _parse_backstage_id(d.pop("backstage_id", UNSET)) - def _parse_pagerduty_id(data: object) -> None | str | Unset: + def _parse_pagerduty_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) pagerduty_id = _parse_pagerduty_id(d.pop("pagerduty_id", UNSET)) - def _parse_external_id(data: object) -> None | str | Unset: + def _parse_external_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) external_id = _parse_external_id(d.pop("external_id", UNSET)) - def _parse_opsgenie_id(data: object) -> None | str | Unset: + def _parse_opsgenie_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) opsgenie_id = _parse_opsgenie_id(d.pop("opsgenie_id", UNSET)) - def _parse_opsgenie_team_id(data: object) -> None | str | Unset: + def _parse_opsgenie_team_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) opsgenie_team_id = _parse_opsgenie_team_id(d.pop("opsgenie_team_id", UNSET)) - def _parse_cortex_id(data: object) -> None | str | Unset: + def _parse_cortex_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) cortex_id = _parse_cortex_id(d.pop("cortex_id", UNSET)) - def _parse_service_now_ci_sys_id(data: object) -> None | str | Unset: + def _parse_service_now_ci_sys_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) service_now_ci_sys_id = _parse_service_now_ci_sys_id(d.pop("service_now_ci_sys_id", UNSET)) - def _parse_github_repository_name(data: object) -> None | str | Unset: + def _parse_github_repository_name(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) github_repository_name = _parse_github_repository_name(d.pop("github_repository_name", UNSET)) - def _parse_github_repository_branch(data: object) -> None | str | Unset: + def _parse_github_repository_branch(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) github_repository_branch = _parse_github_repository_branch(d.pop("github_repository_branch", UNSET)) - def _parse_gitlab_repository_name(data: object) -> None | str | Unset: + def _parse_gitlab_repository_name(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) gitlab_repository_name = _parse_gitlab_repository_name(d.pop("gitlab_repository_name", UNSET)) - def _parse_gitlab_repository_branch(data: object) -> None | str | Unset: + def _parse_gitlab_repository_branch(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) gitlab_repository_branch = _parse_gitlab_repository_branch(d.pop("gitlab_repository_branch", UNSET)) - def _parse_environment_ids(data: object) -> list[str] | None | Unset: + def _parse_environment_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -625,13 +647,13 @@ def _parse_environment_ids(data: object) -> list[str] | None | Unset: environment_ids_type_0 = cast(list[str], data) return environment_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) environment_ids = _parse_environment_ids(d.pop("environment_ids", UNSET)) - def _parse_service_ids(data: object) -> list[str] | None | Unset: + def _parse_service_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -642,13 +664,13 @@ def _parse_service_ids(data: object) -> list[str] | None | Unset: service_ids_type_0 = cast(list[str], data) return service_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) service_ids = _parse_service_ids(d.pop("service_ids", UNSET)) - def _parse_owner_group_ids(data: object) -> list[str] | None | Unset: + def _parse_owner_group_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -659,13 +681,13 @@ def _parse_owner_group_ids(data: object) -> list[str] | None | Unset: owner_group_ids_type_0 = cast(list[str], data) return owner_group_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) owner_group_ids = _parse_owner_group_ids(d.pop("owner_group_ids", UNSET)) - def _parse_owner_user_ids(data: object) -> list[int] | None | Unset: + def _parse_owner_user_ids(data: object) -> Union[None, Unset, list[int]]: if data is None: return data if isinstance(data, Unset): @@ -676,49 +698,51 @@ def _parse_owner_user_ids(data: object) -> list[int] | None | Unset: owner_user_ids_type_0 = cast(list[int], data) return owner_user_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[int] | None | Unset, data) + return cast(Union[None, Unset, list[int]], data) owner_user_ids = _parse_owner_user_ids(d.pop("owner_user_ids", UNSET)) - def _parse_kubernetes_deployment_name(data: object) -> None | str | Unset: + def _parse_kubernetes_deployment_name(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) kubernetes_deployment_name = _parse_kubernetes_deployment_name(d.pop("kubernetes_deployment_name", UNSET)) - def _parse_alerts_email_enabled(data: object) -> bool | None | Unset: + def _parse_alerts_email_enabled(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) alerts_email_enabled = _parse_alerts_email_enabled(d.pop("alerts_email_enabled", UNSET)) - def _parse_alert_urgency_id(data: object) -> None | str | Unset: + def _parse_alert_urgency_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) alert_urgency_id = _parse_alert_urgency_id(d.pop("alert_urgency_id", UNSET)) - def _parse_escalation_policy_id(data: object) -> None | str | Unset: + def _parse_escalation_policy_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) escalation_policy_id = _parse_escalation_policy_id(d.pop("escalation_policy_id", UNSET)) - def _parse_slack_channels(data: object) -> list[NewServiceDataAttributesSlackChannelsType0Item] | None | Unset: + def _parse_slack_channels( + data: object, + ) -> Union[None, Unset, list["NewServiceDataAttributesSlackChannelsType0Item"]]: if data is None: return data if isinstance(data, Unset): @@ -736,13 +760,15 @@ def _parse_slack_channels(data: object) -> list[NewServiceDataAttributesSlackCha slack_channels_type_0.append(slack_channels_type_0_item) return slack_channels_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[NewServiceDataAttributesSlackChannelsType0Item] | None | Unset, data) + return cast(Union[None, Unset, list["NewServiceDataAttributesSlackChannelsType0Item"]], data) slack_channels = _parse_slack_channels(d.pop("slack_channels", UNSET)) - def _parse_slack_aliases(data: object) -> list[NewServiceDataAttributesSlackAliasesType0Item] | None | Unset: + def _parse_slack_aliases( + data: object, + ) -> Union[None, Unset, list["NewServiceDataAttributesSlackAliasesType0Item"]]: if data is None: return data if isinstance(data, Unset): @@ -760,24 +786,24 @@ def _parse_slack_aliases(data: object) -> list[NewServiceDataAttributesSlackAlia slack_aliases_type_0.append(slack_aliases_type_0_item) return slack_aliases_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[NewServiceDataAttributesSlackAliasesType0Item] | None | Unset, data) + return cast(Union[None, Unset, list["NewServiceDataAttributesSlackAliasesType0Item"]], data) slack_aliases = _parse_slack_aliases(d.pop("slack_aliases", UNSET)) - def _parse_alert_broadcast_enabled(data: object) -> bool | None | Unset: + def _parse_alert_broadcast_enabled(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) alert_broadcast_enabled = _parse_alert_broadcast_enabled(d.pop("alert_broadcast_enabled", UNSET)) def _parse_alert_broadcast_channel( data: object, - ) -> NewServiceDataAttributesAlertBroadcastChannelType0 | None | Unset: + ) -> Union["NewServiceDataAttributesAlertBroadcastChannelType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -788,24 +814,24 @@ def _parse_alert_broadcast_channel( alert_broadcast_channel_type_0 = NewServiceDataAttributesAlertBroadcastChannelType0.from_dict(data) return alert_broadcast_channel_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(NewServiceDataAttributesAlertBroadcastChannelType0 | None | Unset, data) + return cast(Union["NewServiceDataAttributesAlertBroadcastChannelType0", None, Unset], data) alert_broadcast_channel = _parse_alert_broadcast_channel(d.pop("alert_broadcast_channel", UNSET)) - def _parse_incident_broadcast_enabled(data: object) -> bool | None | Unset: + def _parse_incident_broadcast_enabled(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) incident_broadcast_enabled = _parse_incident_broadcast_enabled(d.pop("incident_broadcast_enabled", UNSET)) def _parse_incident_broadcast_channel( data: object, - ) -> NewServiceDataAttributesIncidentBroadcastChannelType0 | None | Unset: + ) -> Union["NewServiceDataAttributesIncidentBroadcastChannelType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -818,23 +844,22 @@ def _parse_incident_broadcast_channel( ) return incident_broadcast_channel_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(NewServiceDataAttributesIncidentBroadcastChannelType0 | None | Unset, data) + return cast(Union["NewServiceDataAttributesIncidentBroadcastChannelType0", None, Unset], data) incident_broadcast_channel = _parse_incident_broadcast_channel(d.pop("incident_broadcast_channel", UNSET)) + properties = [] _properties = d.pop("properties", UNSET) - properties: list[NewServiceDataAttributesPropertiesItem] | Unset = UNSET - if _properties is not UNSET: - properties = [] - for properties_item_data in _properties: - properties_item = NewServiceDataAttributesPropertiesItem.from_dict(properties_item_data) + for properties_item_data in _properties or []: + properties_item = NewServiceDataAttributesPropertiesItem.from_dict(properties_item_data) - properties.append(properties_item) + properties.append(properties_item) new_service_data_attributes = cls( name=name, + slug=slug, description=description, public_description=public_description, notify_emails=notify_emails, diff --git a/rootly_sdk/models/new_service_data_attributes_alert_broadcast_channel_type_0.py b/rootly_sdk/models/new_service_data_attributes_alert_broadcast_channel_type_0.py index 43dd3797..1917c613 100644 --- a/rootly_sdk/models/new_service_data_attributes_alert_broadcast_channel_type_0.py +++ b/rootly_sdk/models/new_service_data_attributes_alert_broadcast_channel_type_0.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,11 +15,11 @@ class NewServiceDataAttributesAlertBroadcastChannelType0: Attributes: id (str): Slack channel ID - name (str | Unset): Slack channel name + name (Union[Unset, str]): Slack channel name """ id: str - name: str | Unset = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/new_service_data_attributes_incident_broadcast_channel_type_0.py b/rootly_sdk/models/new_service_data_attributes_incident_broadcast_channel_type_0.py index 52b0f470..6c8f9fa1 100644 --- a/rootly_sdk/models/new_service_data_attributes_incident_broadcast_channel_type_0.py +++ b/rootly_sdk/models/new_service_data_attributes_incident_broadcast_channel_type_0.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,11 +15,11 @@ class NewServiceDataAttributesIncidentBroadcastChannelType0: Attributes: id (str): Slack channel ID - name (str | Unset): Slack channel name + name (Union[Unset, str]): Slack channel name """ id: str - name: str | Unset = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/new_service_data_attributes_properties_item.py b/rootly_sdk/models/new_service_data_attributes_properties_item.py index 3110be0d..571f9034 100644 --- a/rootly_sdk/models/new_service_data_attributes_properties_item.py +++ b/rootly_sdk/models/new_service_data_attributes_properties_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/new_service_data_attributes_slack_aliases_type_0_item.py b/rootly_sdk/models/new_service_data_attributes_slack_aliases_type_0_item.py index 279bbaa6..02f2f04f 100644 --- a/rootly_sdk/models/new_service_data_attributes_slack_aliases_type_0_item.py +++ b/rootly_sdk/models/new_service_data_attributes_slack_aliases_type_0_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/new_service_data_attributes_slack_channels_type_0_item.py b/rootly_sdk/models/new_service_data_attributes_slack_channels_type_0_item.py index f7b9709a..b5522a5b 100644 --- a/rootly_sdk/models/new_service_data_attributes_slack_channels_type_0_item.py +++ b/rootly_sdk/models/new_service_data_attributes_slack_channels_type_0_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/new_severity.py b/rootly_sdk/models/new_severity.py index 261efd5e..8d22df8c 100644 --- a/rootly_sdk/models/new_severity.py +++ b/rootly_sdk/models/new_severity.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewSeverity: data (NewSeverityData): """ - data: NewSeverityData + data: "NewSeverityData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_severity_data.py b/rootly_sdk/models/new_severity_data.py index b34b5cd8..6e2b73b3 100644 --- a/rootly_sdk/models/new_severity_data.py +++ b/rootly_sdk/models/new_severity_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class NewSeverityData: """ type_: NewSeverityDataType - attributes: NewSeverityDataAttributes + attributes: "NewSeverityDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_severity_data_attributes.py b/rootly_sdk/models/new_severity_data_attributes.py index f90fa798..21d72d6b 100644 --- a/rootly_sdk/models/new_severity_data_attributes.py +++ b/rootly_sdk/models/new_severity_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -28,53 +26,61 @@ class NewSeverityDataAttributes: """ Attributes: name (str): The name of the severity - description (None | str | Unset): The description of the severity - severity (NewSeverityDataAttributesSeverity | Unset): The severity of the severity - color (None | str | Unset): The hex color of the severity - position (int | None | Unset): Position of the severity - notify_emails (list[str] | None | Unset): Emails to attach to the severity - slack_channels (list[NewSeverityDataAttributesSlackChannelsType0Item] | None | Unset): Slack Channels associated - with this severity - slack_aliases (list[NewSeverityDataAttributesSlackAliasesType0Item] | None | Unset): Slack Aliases associated - with this severity + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + description (Union[None, Unset, str]): The description of the severity + severity (Union[Unset, NewSeverityDataAttributesSeverity]): The severity of the severity + color (Union[None, Unset, str]): The hex color of the severity + position (Union[None, Unset, int]): Position of the severity + notify_emails (Union[None, Unset, list[str]]): Emails to attach to the severity + slack_channels (Union[None, Unset, list['NewSeverityDataAttributesSlackChannelsType0Item']]): Slack Channels + associated with this severity + slack_aliases (Union[None, Unset, list['NewSeverityDataAttributesSlackAliasesType0Item']]): Slack Aliases + associated with this severity """ name: str - description: None | str | Unset = UNSET - severity: NewSeverityDataAttributesSeverity | Unset = UNSET - color: None | str | Unset = UNSET - position: int | None | Unset = UNSET - notify_emails: list[str] | None | Unset = UNSET - slack_channels: list[NewSeverityDataAttributesSlackChannelsType0Item] | None | Unset = UNSET - slack_aliases: list[NewSeverityDataAttributesSlackAliasesType0Item] | None | Unset = UNSET + slug: Union[None, Unset, str] = UNSET + description: Union[None, Unset, str] = UNSET + severity: Union[Unset, NewSeverityDataAttributesSeverity] = UNSET + color: Union[None, Unset, str] = UNSET + position: Union[None, Unset, int] = UNSET + notify_emails: Union[None, Unset, list[str]] = UNSET + slack_channels: Union[None, Unset, list["NewSeverityDataAttributesSlackChannelsType0Item"]] = UNSET + slack_aliases: Union[None, Unset, list["NewSeverityDataAttributesSlackAliasesType0Item"]] = UNSET def to_dict(self) -> dict[str, Any]: - name = self.name - description: None | str | Unset + slug: Union[None, Unset, str] + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug + + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: description = self.description - severity: str | Unset = UNSET + severity: Union[Unset, str] = UNSET if not isinstance(self.severity, Unset): severity = self.severity - color: None | str | Unset + color: Union[None, Unset, str] if isinstance(self.color, Unset): color = UNSET else: color = self.color - position: int | None | Unset + position: Union[None, Unset, int] if isinstance(self.position, Unset): position = UNSET else: position = self.position - notify_emails: list[str] | None | Unset + notify_emails: Union[None, Unset, list[str]] if isinstance(self.notify_emails, Unset): notify_emails = UNSET elif isinstance(self.notify_emails, list): @@ -83,7 +89,7 @@ def to_dict(self) -> dict[str, Any]: else: notify_emails = self.notify_emails - slack_channels: list[dict[str, Any]] | None | Unset + slack_channels: Union[None, Unset, list[dict[str, Any]]] if isinstance(self.slack_channels, Unset): slack_channels = UNSET elif isinstance(self.slack_channels, list): @@ -95,7 +101,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_channels = self.slack_channels - slack_aliases: list[dict[str, Any]] | None | Unset + slack_aliases: Union[None, Unset, list[dict[str, Any]]] if isinstance(self.slack_aliases, Unset): slack_aliases = UNSET elif isinstance(self.slack_aliases, list): @@ -114,6 +120,8 @@ def to_dict(self) -> dict[str, Any]: "name": name, } ) + if slug is not UNSET: + field_dict["slug"] = slug if description is not UNSET: field_dict["description"] = description if severity is not UNSET: @@ -143,41 +151,50 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name") - def _parse_description(data: object) -> None | str | Unset: + def _parse_slug(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + slug = _parse_slug(d.pop("slug", UNSET)) + + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) _severity = d.pop("severity", UNSET) - severity: NewSeverityDataAttributesSeverity | Unset + severity: Union[Unset, NewSeverityDataAttributesSeverity] if isinstance(_severity, Unset): severity = UNSET else: severity = check_new_severity_data_attributes_severity(_severity) - def _parse_color(data: object) -> None | str | Unset: + def _parse_color(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) color = _parse_color(d.pop("color", UNSET)) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> Union[None, Unset, int]: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(Union[None, Unset, int], data) position = _parse_position(d.pop("position", UNSET)) - def _parse_notify_emails(data: object) -> list[str] | None | Unset: + def _parse_notify_emails(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -188,13 +205,15 @@ def _parse_notify_emails(data: object) -> list[str] | None | Unset: notify_emails_type_0 = cast(list[str], data) return notify_emails_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) notify_emails = _parse_notify_emails(d.pop("notify_emails", UNSET)) - def _parse_slack_channels(data: object) -> list[NewSeverityDataAttributesSlackChannelsType0Item] | None | Unset: + def _parse_slack_channels( + data: object, + ) -> Union[None, Unset, list["NewSeverityDataAttributesSlackChannelsType0Item"]]: if data is None: return data if isinstance(data, Unset): @@ -212,13 +231,15 @@ def _parse_slack_channels(data: object) -> list[NewSeverityDataAttributesSlackCh slack_channels_type_0.append(slack_channels_type_0_item) return slack_channels_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[NewSeverityDataAttributesSlackChannelsType0Item] | None | Unset, data) + return cast(Union[None, Unset, list["NewSeverityDataAttributesSlackChannelsType0Item"]], data) slack_channels = _parse_slack_channels(d.pop("slack_channels", UNSET)) - def _parse_slack_aliases(data: object) -> list[NewSeverityDataAttributesSlackAliasesType0Item] | None | Unset: + def _parse_slack_aliases( + data: object, + ) -> Union[None, Unset, list["NewSeverityDataAttributesSlackAliasesType0Item"]]: if data is None: return data if isinstance(data, Unset): @@ -236,14 +257,15 @@ def _parse_slack_aliases(data: object) -> list[NewSeverityDataAttributesSlackAli slack_aliases_type_0.append(slack_aliases_type_0_item) return slack_aliases_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[NewSeverityDataAttributesSlackAliasesType0Item] | None | Unset, data) + return cast(Union[None, Unset, list["NewSeverityDataAttributesSlackAliasesType0Item"]], data) slack_aliases = _parse_slack_aliases(d.pop("slack_aliases", UNSET)) new_severity_data_attributes = cls( name=name, + slug=slug, description=description, severity=severity, color=color, diff --git a/rootly_sdk/models/new_severity_data_attributes_slack_aliases_type_0_item.py b/rootly_sdk/models/new_severity_data_attributes_slack_aliases_type_0_item.py index 67bf462e..67bd7916 100644 --- a/rootly_sdk/models/new_severity_data_attributes_slack_aliases_type_0_item.py +++ b/rootly_sdk/models/new_severity_data_attributes_slack_aliases_type_0_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/new_severity_data_attributes_slack_channels_type_0_item.py b/rootly_sdk/models/new_severity_data_attributes_slack_channels_type_0_item.py index eed8d124..430f8c3e 100644 --- a/rootly_sdk/models/new_severity_data_attributes_slack_channels_type_0_item.py +++ b/rootly_sdk/models/new_severity_data_attributes_slack_channels_type_0_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/new_shift_coverage_request.py b/rootly_sdk/models/new_shift_coverage_request.py index 310e914f..ce18a9a2 100644 --- a/rootly_sdk/models/new_shift_coverage_request.py +++ b/rootly_sdk/models/new_shift_coverage_request.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewShiftCoverageRequest: data (NewShiftCoverageRequestData): """ - data: NewShiftCoverageRequestData + data: "NewShiftCoverageRequestData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_shift_coverage_request_data.py b/rootly_sdk/models/new_shift_coverage_request_data.py index d5a821e9..7ddbed15 100644 --- a/rootly_sdk/models/new_shift_coverage_request_data.py +++ b/rootly_sdk/models/new_shift_coverage_request_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class NewShiftCoverageRequestData: """ type_: NewShiftCoverageRequestDataType - attributes: NewShiftCoverageRequestDataAttributes + attributes: "NewShiftCoverageRequestDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_shift_coverage_request_data_attributes.py b/rootly_sdk/models/new_shift_coverage_request_data_attributes.py index f709df3b..b5efc7fd 100644 --- a/rootly_sdk/models/new_shift_coverage_request_data_attributes.py +++ b/rootly_sdk/models/new_shift_coverage_request_data_attributes.py @@ -1,8 +1,6 @@ -from __future__ import annotations - import datetime from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from dateutil.parser import isoparse @@ -18,13 +16,13 @@ class NewShiftCoverageRequestDataAttributes: Attributes: starts_at (datetime.datetime): Start datetime of the time range to request coverage for ends_at (datetime.datetime): End datetime of the time range to request coverage for - user_id (int | Unset): Optional. Restrict coverage to shifts assigned to this user. When omitted, every shift - overlapping the time range is covered. + user_id (Union[Unset, int]): Optional. Restrict coverage to shifts assigned to this user. When omitted, every + shift overlapping the time range is covered. """ starts_at: datetime.datetime ends_at: datetime.datetime - user_id: int | Unset = UNSET + user_id: Union[Unset, int] = UNSET def to_dict(self) -> dict[str, Any]: starts_at = self.starts_at.isoformat() diff --git a/rootly_sdk/models/new_sla.py b/rootly_sdk/models/new_sla.py index d7e331d4..acdabbdb 100644 --- a/rootly_sdk/models/new_sla.py +++ b/rootly_sdk/models/new_sla.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewSla: data (NewSlaData): """ - data: NewSlaData + data: "NewSlaData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_sla_data.py b/rootly_sdk/models/new_sla_data.py index c1b1c15d..7b338eed 100644 --- a/rootly_sdk/models/new_sla_data.py +++ b/rootly_sdk/models/new_sla_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class NewSlaData: """ type_: NewSlaDataType - attributes: NewSlaDataAttributes + attributes: "NewSlaDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_sla_data_attributes.py b/rootly_sdk/models/new_sla_data_attributes.py index ad31ed6d..abf46f1c 100644 --- a/rootly_sdk/models/new_sla_data_attributes.py +++ b/rootly_sdk/models/new_sla_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from uuid import UUID from attrs import define as _attrs_define @@ -51,23 +49,26 @@ class NewSlaDataAttributes: deadline completion_deadline_parent_status (NewSlaDataAttributesCompletionDeadlineParentStatus): The incident parent status that triggers the completion deadline - description (None | str | Unset): A description of the SLA - position (int | None | Unset): Position of the SLA for ordering - condition_match_type (NewSlaDataAttributesConditionMatchType | Unset): Whether all or any conditions must match - manager_role_id (None | Unset | UUID): The ID of the incident role responsible for this SLA. Must provide either - manager_role_id or manager_user_id. - manager_user_id (int | None | Unset): The ID of the user responsible for this SLA. Must provide either + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + description (Union[None, Unset, str]): A description of the SLA + position (Union[None, Unset, int]): Position of the SLA for ordering + condition_match_type (Union[Unset, NewSlaDataAttributesConditionMatchType]): Whether all or any conditions must + match + manager_role_id (Union[None, UUID, Unset]): The ID of the incident role responsible for this SLA. Must provide + either manager_role_id or manager_user_id. + manager_user_id (Union[None, Unset, int]): The ID of the user responsible for this SLA. Must provide either manager_role_id or manager_user_id. - assignment_deadline_sub_status_id (None | Unset | UUID): Sub-status for the assignment deadline. Required when - custom lifecycle statuses are enabled on the team. - assignment_skip_weekends (bool | Unset): Whether to skip weekends when calculating the assignment deadline - completion_deadline_sub_status_id (None | Unset | UUID): Sub-status for the completion deadline. Required when - custom lifecycle statuses are enabled on the team. - completion_skip_weekends (bool | Unset): Whether to skip weekends when calculating the completion deadline - conditions (list[NewSlaDataAttributesConditionsItem] | Unset): Conditions that determine which incidents this - SLA applies to. Maximum 20. - notification_configurations (list[NewSlaDataAttributesNotificationConfigurationsItem] | Unset): Notification - timing configurations. Maximum 20. + assignment_deadline_sub_status_id (Union[None, UUID, Unset]): Sub-status for the assignment deadline. Required + when custom lifecycle statuses are enabled on the team. + assignment_skip_weekends (Union[Unset, bool]): Whether to skip weekends when calculating the assignment deadline + completion_deadline_sub_status_id (Union[None, UUID, Unset]): Sub-status for the completion deadline. Required + when custom lifecycle statuses are enabled on the team. + completion_skip_weekends (Union[Unset, bool]): Whether to skip weekends when calculating the completion deadline + conditions (Union[Unset, list['NewSlaDataAttributesConditionsItem']]): Conditions that determine which incidents + this SLA applies to. Maximum 20. + notification_configurations (Union[Unset, list['NewSlaDataAttributesNotificationConfigurationsItem']]): + Notification timing configurations. Maximum 20. """ name: str @@ -75,20 +76,20 @@ class NewSlaDataAttributes: assignment_deadline_parent_status: NewSlaDataAttributesAssignmentDeadlineParentStatus completion_deadline_days: NewSlaDataAttributesCompletionDeadlineDays completion_deadline_parent_status: NewSlaDataAttributesCompletionDeadlineParentStatus - description: None | str | Unset = UNSET - position: int | None | Unset = UNSET - condition_match_type: NewSlaDataAttributesConditionMatchType | Unset = UNSET - manager_role_id: None | Unset | UUID = UNSET - manager_user_id: int | None | Unset = UNSET - assignment_deadline_sub_status_id: None | Unset | UUID = UNSET - assignment_skip_weekends: bool | Unset = UNSET - completion_deadline_sub_status_id: None | Unset | UUID = UNSET - completion_skip_weekends: bool | Unset = UNSET - conditions: list[NewSlaDataAttributesConditionsItem] | Unset = UNSET - notification_configurations: list[NewSlaDataAttributesNotificationConfigurationsItem] | Unset = UNSET + slug: Union[None, Unset, str] = UNSET + description: Union[None, Unset, str] = UNSET + position: Union[None, Unset, int] = UNSET + condition_match_type: Union[Unset, NewSlaDataAttributesConditionMatchType] = UNSET + manager_role_id: Union[None, UUID, Unset] = UNSET + manager_user_id: Union[None, Unset, int] = UNSET + assignment_deadline_sub_status_id: Union[None, UUID, Unset] = UNSET + assignment_skip_weekends: Union[Unset, bool] = UNSET + completion_deadline_sub_status_id: Union[None, UUID, Unset] = UNSET + completion_skip_weekends: Union[Unset, bool] = UNSET + conditions: Union[Unset, list["NewSlaDataAttributesConditionsItem"]] = UNSET + notification_configurations: Union[Unset, list["NewSlaDataAttributesNotificationConfigurationsItem"]] = UNSET def to_dict(self) -> dict[str, Any]: - name = self.name assignment_deadline_days: int = self.assignment_deadline_days @@ -99,23 +100,29 @@ def to_dict(self) -> dict[str, Any]: completion_deadline_parent_status: str = self.completion_deadline_parent_status - description: None | str | Unset + slug: Union[None, Unset, str] + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug + + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: description = self.description - position: int | None | Unset + position: Union[None, Unset, int] if isinstance(self.position, Unset): position = UNSET else: position = self.position - condition_match_type: str | Unset = UNSET + condition_match_type: Union[Unset, str] = UNSET if not isinstance(self.condition_match_type, Unset): condition_match_type = self.condition_match_type - manager_role_id: None | str | Unset + manager_role_id: Union[None, Unset, str] if isinstance(self.manager_role_id, Unset): manager_role_id = UNSET elif isinstance(self.manager_role_id, UUID): @@ -123,13 +130,13 @@ def to_dict(self) -> dict[str, Any]: else: manager_role_id = self.manager_role_id - manager_user_id: int | None | Unset + manager_user_id: Union[None, Unset, int] if isinstance(self.manager_user_id, Unset): manager_user_id = UNSET else: manager_user_id = self.manager_user_id - assignment_deadline_sub_status_id: None | str | Unset + assignment_deadline_sub_status_id: Union[None, Unset, str] if isinstance(self.assignment_deadline_sub_status_id, Unset): assignment_deadline_sub_status_id = UNSET elif isinstance(self.assignment_deadline_sub_status_id, UUID): @@ -139,7 +146,7 @@ def to_dict(self) -> dict[str, Any]: assignment_skip_weekends = self.assignment_skip_weekends - completion_deadline_sub_status_id: None | str | Unset + completion_deadline_sub_status_id: Union[None, Unset, str] if isinstance(self.completion_deadline_sub_status_id, Unset): completion_deadline_sub_status_id = UNSET elif isinstance(self.completion_deadline_sub_status_id, UUID): @@ -149,14 +156,14 @@ def to_dict(self) -> dict[str, Any]: completion_skip_weekends = self.completion_skip_weekends - conditions: list[dict[str, Any]] | Unset = UNSET + conditions: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.conditions, Unset): conditions = [] for conditions_item_data in self.conditions: conditions_item = conditions_item_data.to_dict() conditions.append(conditions_item) - notification_configurations: list[dict[str, Any]] | Unset = UNSET + notification_configurations: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.notification_configurations, Unset): notification_configurations = [] for notification_configurations_item_data in self.notification_configurations: @@ -174,6 +181,8 @@ def to_dict(self) -> dict[str, Any]: "completion_deadline_parent_status": completion_deadline_parent_status, } ) + if slug is not UNSET: + field_dict["slug"] = slug if description is not UNSET: field_dict["description"] = description if position is not UNSET: @@ -225,32 +234,41 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d.pop("completion_deadline_parent_status") ) - def _parse_description(data: object) -> None | str | Unset: + def _parse_slug(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) + + slug = _parse_slug(d.pop("slug", UNSET)) + + def _parse_description(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> Union[None, Unset, int]: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(Union[None, Unset, int], data) position = _parse_position(d.pop("position", UNSET)) _condition_match_type = d.pop("condition_match_type", UNSET) - condition_match_type: NewSlaDataAttributesConditionMatchType | Unset + condition_match_type: Union[Unset, NewSlaDataAttributesConditionMatchType] if isinstance(_condition_match_type, Unset): condition_match_type = UNSET else: condition_match_type = check_new_sla_data_attributes_condition_match_type(_condition_match_type) - def _parse_manager_role_id(data: object) -> None | Unset | UUID: + def _parse_manager_role_id(data: object) -> Union[None, UUID, Unset]: if data is None: return data if isinstance(data, Unset): @@ -261,22 +279,22 @@ def _parse_manager_role_id(data: object) -> None | Unset | UUID: manager_role_id_type_0 = UUID(data) return manager_role_id_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(None | Unset | UUID, data) + return cast(Union[None, UUID, Unset], data) manager_role_id = _parse_manager_role_id(d.pop("manager_role_id", UNSET)) - def _parse_manager_user_id(data: object) -> int | None | Unset: + def _parse_manager_user_id(data: object) -> Union[None, Unset, int]: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(Union[None, Unset, int], data) manager_user_id = _parse_manager_user_id(d.pop("manager_user_id", UNSET)) - def _parse_assignment_deadline_sub_status_id(data: object) -> None | Unset | UUID: + def _parse_assignment_deadline_sub_status_id(data: object) -> Union[None, UUID, Unset]: if data is None: return data if isinstance(data, Unset): @@ -287,9 +305,9 @@ def _parse_assignment_deadline_sub_status_id(data: object) -> None | Unset | UUI assignment_deadline_sub_status_id_type_0 = UUID(data) return assignment_deadline_sub_status_id_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(None | Unset | UUID, data) + return cast(Union[None, UUID, Unset], data) assignment_deadline_sub_status_id = _parse_assignment_deadline_sub_status_id( d.pop("assignment_deadline_sub_status_id", UNSET) @@ -297,7 +315,7 @@ def _parse_assignment_deadline_sub_status_id(data: object) -> None | Unset | UUI assignment_skip_weekends = d.pop("assignment_skip_weekends", UNSET) - def _parse_completion_deadline_sub_status_id(data: object) -> None | Unset | UUID: + def _parse_completion_deadline_sub_status_id(data: object) -> Union[None, UUID, Unset]: if data is None: return data if isinstance(data, Unset): @@ -308,9 +326,9 @@ def _parse_completion_deadline_sub_status_id(data: object) -> None | Unset | UUI completion_deadline_sub_status_id_type_0 = UUID(data) return completion_deadline_sub_status_id_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(None | Unset | UUID, data) + return cast(Union[None, UUID, Unset], data) completion_deadline_sub_status_id = _parse_completion_deadline_sub_status_id( d.pop("completion_deadline_sub_status_id", UNSET) @@ -318,25 +336,21 @@ def _parse_completion_deadline_sub_status_id(data: object) -> None | Unset | UUI completion_skip_weekends = d.pop("completion_skip_weekends", UNSET) + conditions = [] _conditions = d.pop("conditions", UNSET) - conditions: list[NewSlaDataAttributesConditionsItem] | Unset = UNSET - if _conditions is not UNSET: - conditions = [] - for conditions_item_data in _conditions: - conditions_item = NewSlaDataAttributesConditionsItem.from_dict(conditions_item_data) + for conditions_item_data in _conditions or []: + conditions_item = NewSlaDataAttributesConditionsItem.from_dict(conditions_item_data) - conditions.append(conditions_item) + conditions.append(conditions_item) + notification_configurations = [] _notification_configurations = d.pop("notification_configurations", UNSET) - notification_configurations: list[NewSlaDataAttributesNotificationConfigurationsItem] | Unset = UNSET - if _notification_configurations is not UNSET: - notification_configurations = [] - for notification_configurations_item_data in _notification_configurations: - notification_configurations_item = NewSlaDataAttributesNotificationConfigurationsItem.from_dict( - notification_configurations_item_data - ) + for notification_configurations_item_data in _notification_configurations or []: + notification_configurations_item = NewSlaDataAttributesNotificationConfigurationsItem.from_dict( + notification_configurations_item_data + ) - notification_configurations.append(notification_configurations_item) + notification_configurations.append(notification_configurations_item) new_sla_data_attributes = cls( name=name, @@ -344,6 +358,7 @@ def _parse_completion_deadline_sub_status_id(data: object) -> None | Unset | UUI assignment_deadline_parent_status=assignment_deadline_parent_status, completion_deadline_days=completion_deadline_days, completion_deadline_parent_status=completion_deadline_parent_status, + slug=slug, description=description, position=position, condition_match_type=condition_match_type, diff --git a/rootly_sdk/models/new_sla_data_attributes_conditions_item.py b/rootly_sdk/models/new_sla_data_attributes_conditions_item.py index 12795ef1..624d1bef 100644 --- a/rootly_sdk/models/new_sla_data_attributes_conditions_item.py +++ b/rootly_sdk/models/new_sla_data_attributes_conditions_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from uuid import UUID from attrs import define as _attrs_define @@ -26,21 +24,21 @@ class NewSlaDataAttributesConditionsItem: Attributes: conditionable_type (NewSlaDataAttributesConditionsItemConditionableType): The type of condition operator (str): The comparison operator - property_ (NewSlaDataAttributesConditionsItemProperty | Unset): The property to evaluate (for built-in field - conditions). When the team has custom lifecycle statuses enabled, use 'sub_status' (with sub-status IDs as + property_ (Union[Unset, NewSlaDataAttributesConditionsItemProperty]): The property to evaluate (for built-in + field conditions). When the team has custom lifecycle statuses enabled, use 'sub_status' (with sub-status IDs as values); otherwise use 'status' (with parent status names). Sending the wrong one will return a validation error. - values (list[str] | None | Unset): The values to compare against - form_field_id (None | Unset | UUID): The ID of the form field (for custom field conditions) - position (int | Unset): The position of the condition for ordering + values (Union[None, Unset, list[str]]): The values to compare against + form_field_id (Union[None, UUID, Unset]): The ID of the form field (for custom field conditions) + position (Union[Unset, int]): The position of the condition for ordering """ conditionable_type: NewSlaDataAttributesConditionsItemConditionableType operator: str - property_: NewSlaDataAttributesConditionsItemProperty | Unset = UNSET - values: list[str] | None | Unset = UNSET - form_field_id: None | Unset | UUID = UNSET - position: int | Unset = UNSET + property_: Union[Unset, NewSlaDataAttributesConditionsItemProperty] = UNSET + values: Union[None, Unset, list[str]] = UNSET + form_field_id: Union[None, UUID, Unset] = UNSET + position: Union[Unset, int] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -48,11 +46,11 @@ def to_dict(self) -> dict[str, Any]: operator = self.operator - property_: str | Unset = UNSET + property_: Union[Unset, str] = UNSET if not isinstance(self.property_, Unset): property_ = self.property_ - values: list[str] | None | Unset + values: Union[None, Unset, list[str]] if isinstance(self.values, Unset): values = UNSET elif isinstance(self.values, list): @@ -61,7 +59,7 @@ def to_dict(self) -> dict[str, Any]: else: values = self.values - form_field_id: None | str | Unset + form_field_id: Union[None, Unset, str] if isinstance(self.form_field_id, Unset): form_field_id = UNSET elif isinstance(self.form_field_id, UUID): @@ -100,13 +98,13 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: operator = d.pop("operator") _property_ = d.pop("property", UNSET) - property_: NewSlaDataAttributesConditionsItemProperty | Unset + property_: Union[Unset, NewSlaDataAttributesConditionsItemProperty] if isinstance(_property_, Unset): property_ = UNSET else: property_ = check_new_sla_data_attributes_conditions_item_property(_property_) - def _parse_values(data: object) -> list[str] | None | Unset: + def _parse_values(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -117,13 +115,13 @@ def _parse_values(data: object) -> list[str] | None | Unset: values_type_0 = cast(list[str], data) return values_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) values = _parse_values(d.pop("values", UNSET)) - def _parse_form_field_id(data: object) -> None | Unset | UUID: + def _parse_form_field_id(data: object) -> Union[None, UUID, Unset]: if data is None: return data if isinstance(data, Unset): @@ -134,9 +132,9 @@ def _parse_form_field_id(data: object) -> None | Unset | UUID: form_field_id_type_0 = UUID(data) return form_field_id_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(None | Unset | UUID, data) + return cast(Union[None, UUID, Unset], data) form_field_id = _parse_form_field_id(d.pop("form_field_id", UNSET)) diff --git a/rootly_sdk/models/new_sla_data_attributes_notification_configurations_item.py b/rootly_sdk/models/new_sla_data_attributes_notification_configurations_item.py index 33589513..9a632e5d 100644 --- a/rootly_sdk/models/new_sla_data_attributes_notification_configurations_item.py +++ b/rootly_sdk/models/new_sla_data_attributes_notification_configurations_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/new_status_page.py b/rootly_sdk/models/new_status_page.py index f3db92c7..330e306b 100644 --- a/rootly_sdk/models/new_status_page.py +++ b/rootly_sdk/models/new_status_page.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewStatusPage: data (NewStatusPageData): """ - data: NewStatusPageData + data: "NewStatusPageData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_status_page_announcement.py b/rootly_sdk/models/new_status_page_announcement.py new file mode 100644 index 00000000..18bf2235 --- /dev/null +++ b/rootly_sdk/models/new_status_page_announcement.py @@ -0,0 +1,65 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +if TYPE_CHECKING: + from ..models.new_status_page_announcement_data import NewStatusPageAnnouncementData + + +T = TypeVar("T", bound="NewStatusPageAnnouncement") + + +@_attrs_define +class NewStatusPageAnnouncement: + """ + Attributes: + data (NewStatusPageAnnouncementData): + """ + + data: "NewStatusPageAnnouncementData" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "data": data, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.new_status_page_announcement_data import NewStatusPageAnnouncementData + + d = dict(src_dict) + data = NewStatusPageAnnouncementData.from_dict(d.pop("data")) + + new_status_page_announcement = cls( + data=data, + ) + + new_status_page_announcement.additional_properties = d + return new_status_page_announcement + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/rootly_sdk/models/new_status_page_announcement_data.py b/rootly_sdk/models/new_status_page_announcement_data.py new file mode 100644 index 00000000..643c78f1 --- /dev/null +++ b/rootly_sdk/models/new_status_page_announcement_data.py @@ -0,0 +1,78 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.new_status_page_announcement_data_type import ( + NewStatusPageAnnouncementDataType, + check_new_status_page_announcement_data_type, +) + +if TYPE_CHECKING: + from ..models.new_status_page_announcement_data_attributes import NewStatusPageAnnouncementDataAttributes + + +T = TypeVar("T", bound="NewStatusPageAnnouncementData") + + +@_attrs_define +class NewStatusPageAnnouncementData: + """ + Attributes: + type_ (NewStatusPageAnnouncementDataType): + attributes (NewStatusPageAnnouncementDataAttributes): + """ + + type_: NewStatusPageAnnouncementDataType + attributes: "NewStatusPageAnnouncementDataAttributes" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + type_: str = self.type_ + + attributes = self.attributes.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "type": type_, + "attributes": attributes, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.new_status_page_announcement_data_attributes import NewStatusPageAnnouncementDataAttributes + + d = dict(src_dict) + type_ = check_new_status_page_announcement_data_type(d.pop("type")) + + attributes = NewStatusPageAnnouncementDataAttributes.from_dict(d.pop("attributes")) + + new_status_page_announcement_data = cls( + type_=type_, + attributes=attributes, + ) + + new_status_page_announcement_data.additional_properties = d + return new_status_page_announcement_data + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/rootly_sdk/models/new_status_page_announcement_data_attributes.py b/rootly_sdk/models/new_status_page_announcement_data_attributes.py new file mode 100644 index 00000000..e96d8db6 --- /dev/null +++ b/rootly_sdk/models/new_status_page_announcement_data_attributes.py @@ -0,0 +1,60 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="NewStatusPageAnnouncementDataAttributes") + + +@_attrs_define +class NewStatusPageAnnouncementDataAttributes: + """ + Attributes: + title (str): Title of the announcement + body (str): Body of the announcement + notify_subscribers (Union[Unset, bool]): Controls if status page subscribers should be notified. Defaults to + true + """ + + title: str + body: str + notify_subscribers: Union[Unset, bool] = UNSET + + def to_dict(self) -> dict[str, Any]: + title = self.title + + body = self.body + + notify_subscribers = self.notify_subscribers + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "title": title, + "body": body, + } + ) + if notify_subscribers is not UNSET: + field_dict["notify_subscribers"] = notify_subscribers + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + title = d.pop("title") + + body = d.pop("body") + + notify_subscribers = d.pop("notify_subscribers", UNSET) + + new_status_page_announcement_data_attributes = cls( + title=title, + body=body, + notify_subscribers=notify_subscribers, + ) + + return new_status_page_announcement_data_attributes diff --git a/rootly_sdk/models/new_status_page_announcement_data_type.py b/rootly_sdk/models/new_status_page_announcement_data_type.py new file mode 100644 index 00000000..224ad0ca --- /dev/null +++ b/rootly_sdk/models/new_status_page_announcement_data_type.py @@ -0,0 +1,15 @@ +from typing import Literal, cast + +NewStatusPageAnnouncementDataType = Literal["status_page_announcements"] + +NEW_STATUS_PAGE_ANNOUNCEMENT_DATA_TYPE_VALUES: set[NewStatusPageAnnouncementDataType] = { + "status_page_announcements", +} + + +def check_new_status_page_announcement_data_type(value: str | None) -> NewStatusPageAnnouncementDataType | None: + if value is None: + return None + if value in NEW_STATUS_PAGE_ANNOUNCEMENT_DATA_TYPE_VALUES: + return cast(NewStatusPageAnnouncementDataType, value) + raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_STATUS_PAGE_ANNOUNCEMENT_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/new_status_page_component.py b/rootly_sdk/models/new_status_page_component.py new file mode 100644 index 00000000..f2b146f0 --- /dev/null +++ b/rootly_sdk/models/new_status_page_component.py @@ -0,0 +1,65 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +if TYPE_CHECKING: + from ..models.new_status_page_component_data import NewStatusPageComponentData + + +T = TypeVar("T", bound="NewStatusPageComponent") + + +@_attrs_define +class NewStatusPageComponent: + """ + Attributes: + data (NewStatusPageComponentData): + """ + + data: "NewStatusPageComponentData" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "data": data, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.new_status_page_component_data import NewStatusPageComponentData + + d = dict(src_dict) + data = NewStatusPageComponentData.from_dict(d.pop("data")) + + new_status_page_component = cls( + data=data, + ) + + new_status_page_component.additional_properties = d + return new_status_page_component + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/rootly_sdk/models/new_status_page_component_data.py b/rootly_sdk/models/new_status_page_component_data.py new file mode 100644 index 00000000..6729f0b0 --- /dev/null +++ b/rootly_sdk/models/new_status_page_component_data.py @@ -0,0 +1,78 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.new_status_page_component_data_type import ( + NewStatusPageComponentDataType, + check_new_status_page_component_data_type, +) + +if TYPE_CHECKING: + from ..models.new_status_page_component_data_attributes import NewStatusPageComponentDataAttributes + + +T = TypeVar("T", bound="NewStatusPageComponentData") + + +@_attrs_define +class NewStatusPageComponentData: + """ + Attributes: + type_ (NewStatusPageComponentDataType): + attributes (NewStatusPageComponentDataAttributes): + """ + + type_: NewStatusPageComponentDataType + attributes: "NewStatusPageComponentDataAttributes" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + type_: str = self.type_ + + attributes = self.attributes.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "type": type_, + "attributes": attributes, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.new_status_page_component_data_attributes import NewStatusPageComponentDataAttributes + + d = dict(src_dict) + type_ = check_new_status_page_component_data_type(d.pop("type")) + + attributes = NewStatusPageComponentDataAttributes.from_dict(d.pop("attributes")) + + new_status_page_component_data = cls( + type_=type_, + attributes=attributes, + ) + + new_status_page_component_data.additional_properties = d + return new_status_page_component_data + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/rootly_sdk/models/new_status_page_component_data_attributes.py b/rootly_sdk/models/new_status_page_component_data_attributes.py new file mode 100644 index 00000000..83afe3cd --- /dev/null +++ b/rootly_sdk/models/new_status_page_component_data_attributes.py @@ -0,0 +1,146 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, Union, cast + +from attrs import define as _attrs_define + +from ..models.new_status_page_component_data_attributes_source_type import ( + NewStatusPageComponentDataAttributesSourceType, + check_new_status_page_component_data_attributes_source_type, +) +from ..types import UNSET, Unset + +T = TypeVar("T", bound="NewStatusPageComponentDataAttributes") + + +@_attrs_define +class NewStatusPageComponentDataAttributes: + """ + Attributes: + name (Union[None, Unset, str]): Name of the component (required for ad-hoc components; derived from the source + for catalog-backed ones) + description (Union[None, Unset, str]): Description of the component (ad-hoc components only) + status_page_component_group_id (Union[None, Unset, str]): ID of the component group on the same status page + position (Union[Unset, int]): Position of the component (within its group, or on the page's top-level list when + ungrouped) + source_type (Union[Unset, NewStatusPageComponentDataAttributesSourceType]): Catalog source type backing the + component + source_id (Union[None, Unset, str]): ID of the catalog source backing the component + """ + + name: Union[None, Unset, str] = UNSET + description: Union[None, Unset, str] = UNSET + status_page_component_group_id: Union[None, Unset, str] = UNSET + position: Union[Unset, int] = UNSET + source_type: Union[Unset, NewStatusPageComponentDataAttributesSourceType] = UNSET + source_id: Union[None, Unset, str] = UNSET + + def to_dict(self) -> dict[str, Any]: + name: Union[None, Unset, str] + if isinstance(self.name, Unset): + name = UNSET + else: + name = self.name + + description: Union[None, Unset, str] + if isinstance(self.description, Unset): + description = UNSET + else: + description = self.description + + status_page_component_group_id: Union[None, Unset, str] + if isinstance(self.status_page_component_group_id, Unset): + status_page_component_group_id = UNSET + else: + status_page_component_group_id = self.status_page_component_group_id + + position = self.position + + source_type: Union[Unset, str] = UNSET + if not isinstance(self.source_type, Unset): + source_type = self.source_type + + source_id: Union[None, Unset, str] + if isinstance(self.source_id, Unset): + source_id = UNSET + else: + source_id = self.source_id + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if name is not UNSET: + field_dict["name"] = name + if description is not UNSET: + field_dict["description"] = description + if status_page_component_group_id is not UNSET: + field_dict["status_page_component_group_id"] = status_page_component_group_id + if position is not UNSET: + field_dict["position"] = position + if source_type is not UNSET: + field_dict["source_type"] = source_type + if source_id is not UNSET: + field_dict["source_id"] = source_id + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + + def _parse_name(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + name = _parse_name(d.pop("name", UNSET)) + + def _parse_description(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + description = _parse_description(d.pop("description", UNSET)) + + def _parse_status_page_component_group_id(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + status_page_component_group_id = _parse_status_page_component_group_id( + d.pop("status_page_component_group_id", UNSET) + ) + + position = d.pop("position", UNSET) + + _source_type = d.pop("source_type", UNSET) + source_type: Union[Unset, NewStatusPageComponentDataAttributesSourceType] + if isinstance(_source_type, Unset): + source_type = UNSET + else: + source_type = check_new_status_page_component_data_attributes_source_type(_source_type) + + def _parse_source_id(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + source_id = _parse_source_id(d.pop("source_id", UNSET)) + + new_status_page_component_data_attributes = cls( + name=name, + description=description, + status_page_component_group_id=status_page_component_group_id, + position=position, + source_type=source_type, + source_id=source_id, + ) + + return new_status_page_component_data_attributes diff --git a/rootly_sdk/models/new_status_page_component_data_attributes_source_type.py b/rootly_sdk/models/new_status_page_component_data_attributes_source_type.py new file mode 100644 index 00000000..fbe2cc82 --- /dev/null +++ b/rootly_sdk/models/new_status_page_component_data_attributes_source_type.py @@ -0,0 +1,20 @@ +from typing import Literal, cast + +NewStatusPageComponentDataAttributesSourceType = Literal["Functionality", "Service"] + +NEW_STATUS_PAGE_COMPONENT_DATA_ATTRIBUTES_SOURCE_TYPE_VALUES: set[NewStatusPageComponentDataAttributesSourceType] = { + "Functionality", + "Service", +} + + +def check_new_status_page_component_data_attributes_source_type( + value: str | None, +) -> NewStatusPageComponentDataAttributesSourceType | None: + if value is None: + return None + if value in NEW_STATUS_PAGE_COMPONENT_DATA_ATTRIBUTES_SOURCE_TYPE_VALUES: + return cast(NewStatusPageComponentDataAttributesSourceType, value) + raise TypeError( + f"Unexpected value {value!r}. Expected one of {NEW_STATUS_PAGE_COMPONENT_DATA_ATTRIBUTES_SOURCE_TYPE_VALUES!r}" + ) diff --git a/rootly_sdk/models/new_status_page_component_data_type.py b/rootly_sdk/models/new_status_page_component_data_type.py new file mode 100644 index 00000000..ce92419e --- /dev/null +++ b/rootly_sdk/models/new_status_page_component_data_type.py @@ -0,0 +1,15 @@ +from typing import Literal, cast + +NewStatusPageComponentDataType = Literal["status_page_components"] + +NEW_STATUS_PAGE_COMPONENT_DATA_TYPE_VALUES: set[NewStatusPageComponentDataType] = { + "status_page_components", +} + + +def check_new_status_page_component_data_type(value: str | None) -> NewStatusPageComponentDataType | None: + if value is None: + return None + if value in NEW_STATUS_PAGE_COMPONENT_DATA_TYPE_VALUES: + return cast(NewStatusPageComponentDataType, value) + raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_STATUS_PAGE_COMPONENT_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/new_status_page_component_group.py b/rootly_sdk/models/new_status_page_component_group.py new file mode 100644 index 00000000..a5e094f5 --- /dev/null +++ b/rootly_sdk/models/new_status_page_component_group.py @@ -0,0 +1,65 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +if TYPE_CHECKING: + from ..models.new_status_page_component_group_data import NewStatusPageComponentGroupData + + +T = TypeVar("T", bound="NewStatusPageComponentGroup") + + +@_attrs_define +class NewStatusPageComponentGroup: + """ + Attributes: + data (NewStatusPageComponentGroupData): + """ + + data: "NewStatusPageComponentGroupData" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "data": data, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.new_status_page_component_group_data import NewStatusPageComponentGroupData + + d = dict(src_dict) + data = NewStatusPageComponentGroupData.from_dict(d.pop("data")) + + new_status_page_component_group = cls( + data=data, + ) + + new_status_page_component_group.additional_properties = d + return new_status_page_component_group + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/rootly_sdk/models/new_status_page_component_group_data.py b/rootly_sdk/models/new_status_page_component_group_data.py new file mode 100644 index 00000000..75a9d81a --- /dev/null +++ b/rootly_sdk/models/new_status_page_component_group_data.py @@ -0,0 +1,78 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.new_status_page_component_group_data_type import ( + NewStatusPageComponentGroupDataType, + check_new_status_page_component_group_data_type, +) + +if TYPE_CHECKING: + from ..models.new_status_page_component_group_data_attributes import NewStatusPageComponentGroupDataAttributes + + +T = TypeVar("T", bound="NewStatusPageComponentGroupData") + + +@_attrs_define +class NewStatusPageComponentGroupData: + """ + Attributes: + type_ (NewStatusPageComponentGroupDataType): + attributes (NewStatusPageComponentGroupDataAttributes): + """ + + type_: NewStatusPageComponentGroupDataType + attributes: "NewStatusPageComponentGroupDataAttributes" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + type_: str = self.type_ + + attributes = self.attributes.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "type": type_, + "attributes": attributes, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.new_status_page_component_group_data_attributes import NewStatusPageComponentGroupDataAttributes + + d = dict(src_dict) + type_ = check_new_status_page_component_group_data_type(d.pop("type")) + + attributes = NewStatusPageComponentGroupDataAttributes.from_dict(d.pop("attributes")) + + new_status_page_component_group_data = cls( + type_=type_, + attributes=attributes, + ) + + new_status_page_component_group_data.additional_properties = d + return new_status_page_component_group_data + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/rootly_sdk/models/new_status_page_component_group_data_attributes.py b/rootly_sdk/models/new_status_page_component_group_data_attributes.py new file mode 100644 index 00000000..859f82f8 --- /dev/null +++ b/rootly_sdk/models/new_status_page_component_group_data_attributes.py @@ -0,0 +1,92 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, Union, cast + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="NewStatusPageComponentGroupDataAttributes") + + +@_attrs_define +class NewStatusPageComponentGroupDataAttributes: + """ + Attributes: + name (str): Name of the component group + description (Union[None, Unset, str]): Description of the component group + position (Union[Unset, int]): Position of the group on the status page's top-level list (shared with ungrouped + components) + collapsed_by_default (Union[None, Unset, bool]): Whether the group renders collapsed on the public page + """ + + name: str + description: Union[None, Unset, str] = UNSET + position: Union[Unset, int] = UNSET + collapsed_by_default: Union[None, Unset, bool] = UNSET + + def to_dict(self) -> dict[str, Any]: + name = self.name + + description: Union[None, Unset, str] + if isinstance(self.description, Unset): + description = UNSET + else: + description = self.description + + position = self.position + + collapsed_by_default: Union[None, Unset, bool] + if isinstance(self.collapsed_by_default, Unset): + collapsed_by_default = UNSET + else: + collapsed_by_default = self.collapsed_by_default + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "name": name, + } + ) + if description is not UNSET: + field_dict["description"] = description + if position is not UNSET: + field_dict["position"] = position + if collapsed_by_default is not UNSET: + field_dict["collapsed_by_default"] = collapsed_by_default + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + name = d.pop("name") + + def _parse_description(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + description = _parse_description(d.pop("description", UNSET)) + + position = d.pop("position", UNSET) + + def _parse_collapsed_by_default(data: object) -> Union[None, Unset, bool]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, bool], data) + + collapsed_by_default = _parse_collapsed_by_default(d.pop("collapsed_by_default", UNSET)) + + new_status_page_component_group_data_attributes = cls( + name=name, + description=description, + position=position, + collapsed_by_default=collapsed_by_default, + ) + + return new_status_page_component_group_data_attributes diff --git a/rootly_sdk/models/new_status_page_component_group_data_type.py b/rootly_sdk/models/new_status_page_component_group_data_type.py new file mode 100644 index 00000000..08c006f1 --- /dev/null +++ b/rootly_sdk/models/new_status_page_component_group_data_type.py @@ -0,0 +1,15 @@ +from typing import Literal, cast + +NewStatusPageComponentGroupDataType = Literal["status_page_component_groups"] + +NEW_STATUS_PAGE_COMPONENT_GROUP_DATA_TYPE_VALUES: set[NewStatusPageComponentGroupDataType] = { + "status_page_component_groups", +} + + +def check_new_status_page_component_group_data_type(value: str | None) -> NewStatusPageComponentGroupDataType | None: + if value is None: + return None + if value in NEW_STATUS_PAGE_COMPONENT_GROUP_DATA_TYPE_VALUES: + return cast(NewStatusPageComponentGroupDataType, value) + raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_STATUS_PAGE_COMPONENT_GROUP_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/new_status_page_data.py b/rootly_sdk/models/new_status_page_data.py index 5d400e07..42e919f0 100644 --- a/rootly_sdk/models/new_status_page_data.py +++ b/rootly_sdk/models/new_status_page_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class NewStatusPageData: """ type_: NewStatusPageDataType - attributes: NewStatusPageDataAttributes + attributes: "NewStatusPageDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_status_page_data_attributes.py b/rootly_sdk/models/new_status_page_data_attributes.py index a19825e4..dc6c5f99 100644 --- a/rootly_sdk/models/new_status_page_data_attributes.py +++ b/rootly_sdk/models/new_status_page_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -31,171 +29,180 @@ class NewStatusPageDataAttributes: """ Attributes: title (str): The title of the status page - public_title (None | str | Unset): The public title of the status page - description (None | str | Unset): The description of the status page - public_description (None | str | Unset): The public description of the status page - header_color (None | str | Unset): The color of the header. Eg. "#0061F2" - footer_color (None | str | Unset): The color of the footer. Eg. "#1F2F41" - allow_search_engine_index (bool | None | Unset): Allow search engines to include your public status page in + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `title`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + public_title (Union[None, Unset, str]): The public title of the status page + description (Union[None, Unset, str]): The description of the status page + public_description (Union[None, Unset, str]): The public description of the status page + header_color (Union[None, Unset, str]): The color of the header. Eg. "#0061F2" + footer_color (Union[None, Unset, str]): The color of the footer. Eg. "#1F2F41" + allow_search_engine_index (Union[None, Unset, bool]): Allow search engines to include your public status page in search results - show_uptime (bool | None | Unset): Show uptime - show_uptime_last_days (NewStatusPageDataAttributesShowUptimeLastDays | Unset): Show uptime over x days - success_message (None | str | Unset): Message showing when all components are operational - failure_message (None | str | Unset): Message showing when at least one component is not operational - authentication_method (NewStatusPageDataAttributesAuthenticationMethod | Unset): Authentication method Default: - 'none'. - authentication_enabled (bool | None | Unset): Enable authentication (deprecated - use authentication_method + show_uptime (Union[None, Unset, bool]): Show uptime + show_uptime_last_days (Union[Unset, NewStatusPageDataAttributesShowUptimeLastDays]): Show uptime over x days + success_message (Union[None, Unset, str]): Message showing when all components are operational + failure_message (Union[None, Unset, str]): Message showing when at least one component is not operational + authentication_method (Union[Unset, NewStatusPageDataAttributesAuthenticationMethod]): Authentication method + Default: 'none'. + authentication_enabled (Union[None, Unset, bool]): Enable authentication (deprecated - use authentication_method instead) Default: False. - authentication_password (None | str | Unset): Authentication password - saml_idp_sso_service_url (None | str | Unset): SAML IdP SSO service URL - saml_idp_slo_service_url (None | str | Unset): SAML IdP SLO service URL - saml_idp_cert (None | str | Unset): SAML IdP certificate - saml_name_identifier_format (NewStatusPageDataAttributesSamlNameIdentifierFormat | Unset): SAML name identifier - format - section_order (list[NewStatusPageDataAttributesSectionOrderType0Item] | None | Unset): Order of sections on the - status page - external_domain_names (list[str] | None | Unset): External domain names attached to the status page - website_url (None | str | Unset): Website URL - website_privacy_url (None | str | Unset): Website Privacy URL - website_support_url (None | str | Unset): Website Support URL - ga_tracking_id (None | str | Unset): Google Analytics tracking ID - time_zone (None | str | Unset): A valid IANA time zone name. Default: 'Etc/UTC'. - public (bool | None | Unset): Make the status page accessible to the public - service_ids (list[str] | Unset): Services attached to the status page - functionality_ids (list[str] | Unset): Functionalities attached to the status page - enabled (bool | None | Unset): Enabled / Disable the status page + authentication_password (Union[None, Unset, str]): Authentication password + saml_idp_sso_service_url (Union[None, Unset, str]): SAML IdP SSO service URL + saml_idp_slo_service_url (Union[None, Unset, str]): SAML IdP SLO service URL + saml_idp_cert (Union[None, Unset, str]): SAML IdP certificate + saml_name_identifier_format (Union[Unset, NewStatusPageDataAttributesSamlNameIdentifierFormat]): SAML name + identifier format + section_order (Union[None, Unset, list[NewStatusPageDataAttributesSectionOrderType0Item]]): Order of sections on + the status page + external_domain_names (Union[None, Unset, list[str]]): External domain names attached to the status page + website_url (Union[None, Unset, str]): Website URL + website_privacy_url (Union[None, Unset, str]): Website Privacy URL + website_support_url (Union[None, Unset, str]): Website Support URL + ga_tracking_id (Union[None, Unset, str]): Google Analytics tracking ID + time_zone (Union[None, Unset, str]): A valid IANA time zone name. Default: 'Etc/UTC'. + public (Union[None, Unset, bool]): Make the status page accessible to the public + service_ids (Union[Unset, list[str]]): Services attached to the status page + functionality_ids (Union[Unset, list[str]]): Functionalities attached to the status page + enabled (Union[None, Unset, bool]): Enabled / Disable the status page """ title: str - public_title: None | str | Unset = UNSET - description: None | str | Unset = UNSET - public_description: None | str | Unset = UNSET - header_color: None | str | Unset = UNSET - footer_color: None | str | Unset = UNSET - allow_search_engine_index: bool | None | Unset = UNSET - show_uptime: bool | None | Unset = UNSET - show_uptime_last_days: NewStatusPageDataAttributesShowUptimeLastDays | Unset = UNSET - success_message: None | str | Unset = UNSET - failure_message: None | str | Unset = UNSET - authentication_method: NewStatusPageDataAttributesAuthenticationMethod | Unset = "none" - authentication_enabled: bool | None | Unset = False - authentication_password: None | str | Unset = UNSET - saml_idp_sso_service_url: None | str | Unset = UNSET - saml_idp_slo_service_url: None | str | Unset = UNSET - saml_idp_cert: None | str | Unset = UNSET - saml_name_identifier_format: NewStatusPageDataAttributesSamlNameIdentifierFormat | Unset = UNSET - section_order: list[NewStatusPageDataAttributesSectionOrderType0Item] | None | Unset = UNSET - external_domain_names: list[str] | None | Unset = UNSET - website_url: None | str | Unset = UNSET - website_privacy_url: None | str | Unset = UNSET - website_support_url: None | str | Unset = UNSET - ga_tracking_id: None | str | Unset = UNSET - time_zone: None | str | Unset = "Etc/UTC" - public: bool | None | Unset = UNSET - service_ids: list[str] | Unset = UNSET - functionality_ids: list[str] | Unset = UNSET - enabled: bool | None | Unset = UNSET + slug: Union[None, Unset, str] = UNSET + public_title: Union[None, Unset, str] = UNSET + description: Union[None, Unset, str] = UNSET + public_description: Union[None, Unset, str] = UNSET + header_color: Union[None, Unset, str] = UNSET + footer_color: Union[None, Unset, str] = UNSET + allow_search_engine_index: Union[None, Unset, bool] = UNSET + show_uptime: Union[None, Unset, bool] = UNSET + show_uptime_last_days: Union[Unset, NewStatusPageDataAttributesShowUptimeLastDays] = UNSET + success_message: Union[None, Unset, str] = UNSET + failure_message: Union[None, Unset, str] = UNSET + authentication_method: Union[Unset, NewStatusPageDataAttributesAuthenticationMethod] = "none" + authentication_enabled: Union[None, Unset, bool] = False + authentication_password: Union[None, Unset, str] = UNSET + saml_idp_sso_service_url: Union[None, Unset, str] = UNSET + saml_idp_slo_service_url: Union[None, Unset, str] = UNSET + saml_idp_cert: Union[None, Unset, str] = UNSET + saml_name_identifier_format: Union[Unset, NewStatusPageDataAttributesSamlNameIdentifierFormat] = UNSET + section_order: Union[None, Unset, list[NewStatusPageDataAttributesSectionOrderType0Item]] = UNSET + external_domain_names: Union[None, Unset, list[str]] = UNSET + website_url: Union[None, Unset, str] = UNSET + website_privacy_url: Union[None, Unset, str] = UNSET + website_support_url: Union[None, Unset, str] = UNSET + ga_tracking_id: Union[None, Unset, str] = UNSET + time_zone: Union[None, Unset, str] = "Etc/UTC" + public: Union[None, Unset, bool] = UNSET + service_ids: Union[Unset, list[str]] = UNSET + functionality_ids: Union[Unset, list[str]] = UNSET + enabled: Union[None, Unset, bool] = UNSET def to_dict(self) -> dict[str, Any]: title = self.title - public_title: None | str | Unset + slug: Union[None, Unset, str] + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug + + public_title: Union[None, Unset, str] if isinstance(self.public_title, Unset): public_title = UNSET else: public_title = self.public_title - description: None | str | Unset + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: description = self.description - public_description: None | str | Unset + public_description: Union[None, Unset, str] if isinstance(self.public_description, Unset): public_description = UNSET else: public_description = self.public_description - header_color: None | str | Unset + header_color: Union[None, Unset, str] if isinstance(self.header_color, Unset): header_color = UNSET else: header_color = self.header_color - footer_color: None | str | Unset + footer_color: Union[None, Unset, str] if isinstance(self.footer_color, Unset): footer_color = UNSET else: footer_color = self.footer_color - allow_search_engine_index: bool | None | Unset + allow_search_engine_index: Union[None, Unset, bool] if isinstance(self.allow_search_engine_index, Unset): allow_search_engine_index = UNSET else: allow_search_engine_index = self.allow_search_engine_index - show_uptime: bool | None | Unset + show_uptime: Union[None, Unset, bool] if isinstance(self.show_uptime, Unset): show_uptime = UNSET else: show_uptime = self.show_uptime - show_uptime_last_days: int | Unset = UNSET + show_uptime_last_days: Union[Unset, int] = UNSET if not isinstance(self.show_uptime_last_days, Unset): show_uptime_last_days = self.show_uptime_last_days - success_message: None | str | Unset + success_message: Union[None, Unset, str] if isinstance(self.success_message, Unset): success_message = UNSET else: success_message = self.success_message - failure_message: None | str | Unset + failure_message: Union[None, Unset, str] if isinstance(self.failure_message, Unset): failure_message = UNSET else: failure_message = self.failure_message - authentication_method: str | Unset = UNSET + authentication_method: Union[Unset, str] = UNSET if not isinstance(self.authentication_method, Unset): authentication_method = self.authentication_method - authentication_enabled: bool | None | Unset + authentication_enabled: Union[None, Unset, bool] if isinstance(self.authentication_enabled, Unset): authentication_enabled = UNSET else: authentication_enabled = self.authentication_enabled - authentication_password: None | str | Unset + authentication_password: Union[None, Unset, str] if isinstance(self.authentication_password, Unset): authentication_password = UNSET else: authentication_password = self.authentication_password - saml_idp_sso_service_url: None | str | Unset + saml_idp_sso_service_url: Union[None, Unset, str] if isinstance(self.saml_idp_sso_service_url, Unset): saml_idp_sso_service_url = UNSET else: saml_idp_sso_service_url = self.saml_idp_sso_service_url - saml_idp_slo_service_url: None | str | Unset + saml_idp_slo_service_url: Union[None, Unset, str] if isinstance(self.saml_idp_slo_service_url, Unset): saml_idp_slo_service_url = UNSET else: saml_idp_slo_service_url = self.saml_idp_slo_service_url - saml_idp_cert: None | str | Unset + saml_idp_cert: Union[None, Unset, str] if isinstance(self.saml_idp_cert, Unset): saml_idp_cert = UNSET else: saml_idp_cert = self.saml_idp_cert - saml_name_identifier_format: str | Unset = UNSET + saml_name_identifier_format: Union[Unset, str] = UNSET if not isinstance(self.saml_name_identifier_format, Unset): saml_name_identifier_format = self.saml_name_identifier_format - section_order: list[str] | None | Unset + section_order: Union[None, Unset, list[str]] if isinstance(self.section_order, Unset): section_order = UNSET elif isinstance(self.section_order, list): @@ -207,7 +214,7 @@ def to_dict(self) -> dict[str, Any]: else: section_order = self.section_order - external_domain_names: list[str] | None | Unset + external_domain_names: Union[None, Unset, list[str]] if isinstance(self.external_domain_names, Unset): external_domain_names = UNSET elif isinstance(self.external_domain_names, list): @@ -216,51 +223,51 @@ def to_dict(self) -> dict[str, Any]: else: external_domain_names = self.external_domain_names - website_url: None | str | Unset + website_url: Union[None, Unset, str] if isinstance(self.website_url, Unset): website_url = UNSET else: website_url = self.website_url - website_privacy_url: None | str | Unset + website_privacy_url: Union[None, Unset, str] if isinstance(self.website_privacy_url, Unset): website_privacy_url = UNSET else: website_privacy_url = self.website_privacy_url - website_support_url: None | str | Unset + website_support_url: Union[None, Unset, str] if isinstance(self.website_support_url, Unset): website_support_url = UNSET else: website_support_url = self.website_support_url - ga_tracking_id: None | str | Unset + ga_tracking_id: Union[None, Unset, str] if isinstance(self.ga_tracking_id, Unset): ga_tracking_id = UNSET else: ga_tracking_id = self.ga_tracking_id - time_zone: None | str | Unset + time_zone: Union[None, Unset, str] if isinstance(self.time_zone, Unset): time_zone = UNSET else: time_zone = self.time_zone - public: bool | None | Unset + public: Union[None, Unset, bool] if isinstance(self.public, Unset): public = UNSET else: public = self.public - service_ids: list[str] | Unset = UNSET + service_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.service_ids, Unset): service_ids = self.service_ids - functionality_ids: list[str] | Unset = UNSET + functionality_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.functionality_ids, Unset): functionality_ids = self.functionality_ids - enabled: bool | None | Unset + enabled: Union[None, Unset, bool] if isinstance(self.enabled, Unset): enabled = UNSET else: @@ -273,6 +280,8 @@ def to_dict(self) -> dict[str, Any]: "title": title, } ) + if slug is not UNSET: + field_dict["slug"] = slug if public_title is not UNSET: field_dict["public_title"] = public_title if description is not UNSET: @@ -337,148 +346,157 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) title = d.pop("title") - def _parse_public_title(data: object) -> None | str | Unset: + def _parse_slug(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + slug = _parse_slug(d.pop("slug", UNSET)) + + def _parse_public_title(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) public_title = _parse_public_title(d.pop("public_title", UNSET)) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) - def _parse_public_description(data: object) -> None | str | Unset: + def _parse_public_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) public_description = _parse_public_description(d.pop("public_description", UNSET)) - def _parse_header_color(data: object) -> None | str | Unset: + def _parse_header_color(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) header_color = _parse_header_color(d.pop("header_color", UNSET)) - def _parse_footer_color(data: object) -> None | str | Unset: + def _parse_footer_color(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) footer_color = _parse_footer_color(d.pop("footer_color", UNSET)) - def _parse_allow_search_engine_index(data: object) -> bool | None | Unset: + def _parse_allow_search_engine_index(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) allow_search_engine_index = _parse_allow_search_engine_index(d.pop("allow_search_engine_index", UNSET)) - def _parse_show_uptime(data: object) -> bool | None | Unset: + def _parse_show_uptime(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) show_uptime = _parse_show_uptime(d.pop("show_uptime", UNSET)) _show_uptime_last_days = d.pop("show_uptime_last_days", UNSET) - show_uptime_last_days: NewStatusPageDataAttributesShowUptimeLastDays | Unset + show_uptime_last_days: Union[Unset, NewStatusPageDataAttributesShowUptimeLastDays] if isinstance(_show_uptime_last_days, Unset): show_uptime_last_days = UNSET else: show_uptime_last_days = check_new_status_page_data_attributes_show_uptime_last_days(_show_uptime_last_days) - def _parse_success_message(data: object) -> None | str | Unset: + def _parse_success_message(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) success_message = _parse_success_message(d.pop("success_message", UNSET)) - def _parse_failure_message(data: object) -> None | str | Unset: + def _parse_failure_message(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) failure_message = _parse_failure_message(d.pop("failure_message", UNSET)) _authentication_method = d.pop("authentication_method", UNSET) - authentication_method: NewStatusPageDataAttributesAuthenticationMethod | Unset + authentication_method: Union[Unset, NewStatusPageDataAttributesAuthenticationMethod] if isinstance(_authentication_method, Unset): authentication_method = UNSET else: authentication_method = check_new_status_page_data_attributes_authentication_method(_authentication_method) - def _parse_authentication_enabled(data: object) -> bool | None | Unset: + def _parse_authentication_enabled(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) authentication_enabled = _parse_authentication_enabled(d.pop("authentication_enabled", UNSET)) - def _parse_authentication_password(data: object) -> None | str | Unset: + def _parse_authentication_password(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) authentication_password = _parse_authentication_password(d.pop("authentication_password", UNSET)) - def _parse_saml_idp_sso_service_url(data: object) -> None | str | Unset: + def _parse_saml_idp_sso_service_url(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) saml_idp_sso_service_url = _parse_saml_idp_sso_service_url(d.pop("saml_idp_sso_service_url", UNSET)) - def _parse_saml_idp_slo_service_url(data: object) -> None | str | Unset: + def _parse_saml_idp_slo_service_url(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) saml_idp_slo_service_url = _parse_saml_idp_slo_service_url(d.pop("saml_idp_slo_service_url", UNSET)) - def _parse_saml_idp_cert(data: object) -> None | str | Unset: + def _parse_saml_idp_cert(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) saml_idp_cert = _parse_saml_idp_cert(d.pop("saml_idp_cert", UNSET)) _saml_name_identifier_format = d.pop("saml_name_identifier_format", UNSET) - saml_name_identifier_format: NewStatusPageDataAttributesSamlNameIdentifierFormat | Unset + saml_name_identifier_format: Union[Unset, NewStatusPageDataAttributesSamlNameIdentifierFormat] if isinstance(_saml_name_identifier_format, Unset): saml_name_identifier_format = UNSET else: @@ -486,7 +504,9 @@ def _parse_saml_idp_cert(data: object) -> None | str | Unset: _saml_name_identifier_format ) - def _parse_section_order(data: object) -> list[NewStatusPageDataAttributesSectionOrderType0Item] | None | Unset: + def _parse_section_order( + data: object, + ) -> Union[None, Unset, list[NewStatusPageDataAttributesSectionOrderType0Item]]: if data is None: return data if isinstance(data, Unset): @@ -504,13 +524,13 @@ def _parse_section_order(data: object) -> list[NewStatusPageDataAttributesSectio section_order_type_0.append(section_order_type_0_item) return section_order_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[NewStatusPageDataAttributesSectionOrderType0Item] | None | Unset, data) + return cast(Union[None, Unset, list[NewStatusPageDataAttributesSectionOrderType0Item]], data) section_order = _parse_section_order(d.pop("section_order", UNSET)) - def _parse_external_domain_names(data: object) -> list[str] | None | Unset: + def _parse_external_domain_names(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -521,63 +541,63 @@ def _parse_external_domain_names(data: object) -> list[str] | None | Unset: external_domain_names_type_0 = cast(list[str], data) return external_domain_names_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) external_domain_names = _parse_external_domain_names(d.pop("external_domain_names", UNSET)) - def _parse_website_url(data: object) -> None | str | Unset: + def _parse_website_url(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) website_url = _parse_website_url(d.pop("website_url", UNSET)) - def _parse_website_privacy_url(data: object) -> None | str | Unset: + def _parse_website_privacy_url(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) website_privacy_url = _parse_website_privacy_url(d.pop("website_privacy_url", UNSET)) - def _parse_website_support_url(data: object) -> None | str | Unset: + def _parse_website_support_url(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) website_support_url = _parse_website_support_url(d.pop("website_support_url", UNSET)) - def _parse_ga_tracking_id(data: object) -> None | str | Unset: + def _parse_ga_tracking_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) ga_tracking_id = _parse_ga_tracking_id(d.pop("ga_tracking_id", UNSET)) - def _parse_time_zone(data: object) -> None | str | Unset: + def _parse_time_zone(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) time_zone = _parse_time_zone(d.pop("time_zone", UNSET)) - def _parse_public(data: object) -> bool | None | Unset: + def _parse_public(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) public = _parse_public(d.pop("public", UNSET)) @@ -585,17 +605,18 @@ def _parse_public(data: object) -> bool | None | Unset: functionality_ids = cast(list[str], d.pop("functionality_ids", UNSET)) - def _parse_enabled(data: object) -> bool | None | Unset: + def _parse_enabled(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) enabled = _parse_enabled(d.pop("enabled", UNSET)) new_status_page_data_attributes = cls( title=title, + slug=slug, public_title=public_title, description=description, public_description=public_description, diff --git a/rootly_sdk/models/new_status_page_template.py b/rootly_sdk/models/new_status_page_template.py index be295a5d..2a888f80 100644 --- a/rootly_sdk/models/new_status_page_template.py +++ b/rootly_sdk/models/new_status_page_template.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewStatusPageTemplate: data (NewStatusPageTemplateData): """ - data: NewStatusPageTemplateData + data: "NewStatusPageTemplateData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_status_page_template_data.py b/rootly_sdk/models/new_status_page_template_data.py index a5f25d1c..fc999006 100644 --- a/rootly_sdk/models/new_status_page_template_data.py +++ b/rootly_sdk/models/new_status_page_template_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class NewStatusPageTemplateData: """ type_: NewStatusPageTemplateDataType - attributes: NewStatusPageTemplateDataAttributes + attributes: "NewStatusPageTemplateDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_status_page_template_data_attributes.py b/rootly_sdk/models/new_status_page_template_data_attributes.py index c6d188d0..dbe7cd40 100644 --- a/rootly_sdk/models/new_status_page_template_data_attributes.py +++ b/rootly_sdk/models/new_status_page_template_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -24,25 +22,25 @@ class NewStatusPageTemplateDataAttributes: Attributes: title (str): Title of the template body (str): Description of the event the template will populate - status_page_id (str | Unset): - update_title (None | str | Unset): Title that will be used for the status page update - update_status (NewStatusPageTemplateDataAttributesUpdateStatus | Unset): Status of the event the template will - populate - kind (NewStatusPageTemplateDataAttributesKind | Unset): The kind of the status page template - should_notify_subscribers (bool | None | Unset): Controls if incident subscribers should be notified - position (int | Unset): Position of the status page template - enabled (bool | None | Unset): Enable / Disable the status page template + status_page_id (Union[Unset, str]): + update_title (Union[None, Unset, str]): Title that will be used for the status page update + update_status (Union[Unset, NewStatusPageTemplateDataAttributesUpdateStatus]): Status of the event the template + will populate + kind (Union[Unset, NewStatusPageTemplateDataAttributesKind]): The kind of the status page template + should_notify_subscribers (Union[None, Unset, bool]): Controls if incident subscribers should be notified + position (Union[Unset, int]): Position of the status page template + enabled (Union[None, Unset, bool]): Enable / Disable the status page template """ title: str body: str - status_page_id: str | Unset = UNSET - update_title: None | str | Unset = UNSET - update_status: NewStatusPageTemplateDataAttributesUpdateStatus | Unset = UNSET - kind: NewStatusPageTemplateDataAttributesKind | Unset = UNSET - should_notify_subscribers: bool | None | Unset = UNSET - position: int | Unset = UNSET - enabled: bool | None | Unset = UNSET + status_page_id: Union[Unset, str] = UNSET + update_title: Union[None, Unset, str] = UNSET + update_status: Union[Unset, NewStatusPageTemplateDataAttributesUpdateStatus] = UNSET + kind: Union[Unset, NewStatusPageTemplateDataAttributesKind] = UNSET + should_notify_subscribers: Union[None, Unset, bool] = UNSET + position: Union[Unset, int] = UNSET + enabled: Union[None, Unset, bool] = UNSET def to_dict(self) -> dict[str, Any]: title = self.title @@ -51,21 +49,21 @@ def to_dict(self) -> dict[str, Any]: status_page_id = self.status_page_id - update_title: None | str | Unset + update_title: Union[None, Unset, str] if isinstance(self.update_title, Unset): update_title = UNSET else: update_title = self.update_title - update_status: str | Unset = UNSET + update_status: Union[Unset, str] = UNSET if not isinstance(self.update_status, Unset): update_status = self.update_status - kind: str | Unset = UNSET + kind: Union[Unset, str] = UNSET if not isinstance(self.kind, Unset): kind = self.kind - should_notify_subscribers: bool | None | Unset + should_notify_subscribers: Union[None, Unset, bool] if isinstance(self.should_notify_subscribers, Unset): should_notify_subscribers = UNSET else: @@ -73,7 +71,7 @@ def to_dict(self) -> dict[str, Any]: position = self.position - enabled: bool | None | Unset + enabled: Union[None, Unset, bool] if isinstance(self.enabled, Unset): enabled = UNSET else: @@ -113,46 +111,46 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: status_page_id = d.pop("status_page_id", UNSET) - def _parse_update_title(data: object) -> None | str | Unset: + def _parse_update_title(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) update_title = _parse_update_title(d.pop("update_title", UNSET)) _update_status = d.pop("update_status", UNSET) - update_status: NewStatusPageTemplateDataAttributesUpdateStatus | Unset + update_status: Union[Unset, NewStatusPageTemplateDataAttributesUpdateStatus] if isinstance(_update_status, Unset): update_status = UNSET else: update_status = check_new_status_page_template_data_attributes_update_status(_update_status) _kind = d.pop("kind", UNSET) - kind: NewStatusPageTemplateDataAttributesKind | Unset + kind: Union[Unset, NewStatusPageTemplateDataAttributesKind] if isinstance(_kind, Unset): kind = UNSET else: kind = check_new_status_page_template_data_attributes_kind(_kind) - def _parse_should_notify_subscribers(data: object) -> bool | None | Unset: + def _parse_should_notify_subscribers(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) should_notify_subscribers = _parse_should_notify_subscribers(d.pop("should_notify_subscribers", UNSET)) position = d.pop("position", UNSET) - def _parse_enabled(data: object) -> bool | None | Unset: + def _parse_enabled(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) enabled = _parse_enabled(d.pop("enabled", UNSET)) diff --git a/rootly_sdk/models/new_sub_status.py b/rootly_sdk/models/new_sub_status.py index 02753d5a..6baa6d72 100644 --- a/rootly_sdk/models/new_sub_status.py +++ b/rootly_sdk/models/new_sub_status.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewSubStatus: data (NewSubStatusData): """ - data: NewSubStatusData + data: "NewSubStatusData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_sub_status_data.py b/rootly_sdk/models/new_sub_status_data.py index fb4d42e9..b987a434 100644 --- a/rootly_sdk/models/new_sub_status_data.py +++ b/rootly_sdk/models/new_sub_status_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class NewSubStatusData: """ type_: NewSubStatusDataType - attributes: NewSubStatusDataAttributes + attributes: "NewSubStatusDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_sub_status_data_attributes.py b/rootly_sdk/models/new_sub_status_data_attributes.py index c228516b..76682939 100644 --- a/rootly_sdk/models/new_sub_status_data_attributes.py +++ b/rootly_sdk/models/new_sub_status_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -20,27 +18,36 @@ class NewSubStatusDataAttributes: Attributes: name (str): parent_status (NewSubStatusDataAttributesParentStatus): - description (None | str | Unset): - position (int | None | Unset): + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + description (Union[None, Unset, str]): + position (Union[None, Unset, int]): """ name: str parent_status: NewSubStatusDataAttributesParentStatus - description: None | str | Unset = UNSET - position: int | None | Unset = UNSET + slug: Union[None, Unset, str] = UNSET + description: Union[None, Unset, str] = UNSET + position: Union[None, Unset, int] = UNSET def to_dict(self) -> dict[str, Any]: name = self.name parent_status: str = self.parent_status - description: None | str | Unset + slug: Union[None, Unset, str] + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug + + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: description = self.description - position: int | None | Unset + position: Union[None, Unset, int] if isinstance(self.position, Unset): position = UNSET else: @@ -54,6 +61,8 @@ def to_dict(self) -> dict[str, Any]: "parent_status": parent_status, } ) + if slug is not UNSET: + field_dict["slug"] = slug if description is not UNSET: field_dict["description"] = description if position is not UNSET: @@ -68,27 +77,37 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: parent_status = check_new_sub_status_data_attributes_parent_status(d.pop("parent_status")) - def _parse_description(data: object) -> None | str | Unset: + def _parse_slug(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + slug = _parse_slug(d.pop("slug", UNSET)) + + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> Union[None, Unset, int]: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(Union[None, Unset, int], data) position = _parse_position(d.pop("position", UNSET)) new_sub_status_data_attributes = cls( name=name, parent_status=parent_status, + slug=slug, description=description, position=position, ) diff --git a/rootly_sdk/models/new_team.py b/rootly_sdk/models/new_team.py index cf16853b..5035166c 100644 --- a/rootly_sdk/models/new_team.py +++ b/rootly_sdk/models/new_team.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewTeam: data (NewTeamData): """ - data: NewTeamData + data: "NewTeamData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_team_data.py b/rootly_sdk/models/new_team_data.py index 91f45014..1d6c1900 100644 --- a/rootly_sdk/models/new_team_data.py +++ b/rootly_sdk/models/new_team_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class NewTeamData: """ type_: NewTeamDataType - attributes: NewTeamDataAttributes + attributes: "NewTeamDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_team_data_attributes.py b/rootly_sdk/models/new_team_data_attributes.py index a05a78f5..d177dd58 100644 --- a/rootly_sdk/models/new_team_data_attributes.py +++ b/rootly_sdk/models/new_team_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -31,71 +29,77 @@ class NewTeamDataAttributes: """ Attributes: name (str): The name of the team - description (None | str | Unset): The description of the team - notify_emails (list[str] | None | Unset): Emails to attach to the team - color (None | str | Unset): The hex color of the team - position (int | None | Unset): Position of the team - backstage_id (None | str | Unset): The Backstage entity id associated to this team. eg: + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + description (Union[None, Unset, str]): The description of the team + public_description (Union[None, Unset, str]): The status page description of the team + notify_emails (Union[None, Unset, list[str]]): Emails to attach to the team + color (Union[None, Unset, str]): The hex color of the team + position (Union[None, Unset, int]): Position of the team + backstage_id (Union[None, Unset, str]): The Backstage entity id associated to this team. eg: :namespace/:kind/:entity_name - external_id (None | str | Unset): The external id associated to this team - pagerduty_id (None | str | Unset): The PagerDuty group id associated to this team - pagerduty_service_id (None | str | Unset): The PagerDuty service id associated to this team - opsgenie_id (None | str | Unset): The Opsgenie group id associated to this team - opsgenie_team_id (None | str | Unset): The Opsgenie team id associated to this team - victor_ops_id (None | str | Unset): The VictorOps group id associated to this team - pagertree_id (None | str | Unset): The PagerTree group id associated to this team - cortex_id (None | str | Unset): The Cortex group id associated to this team - service_now_ci_sys_id (None | str | Unset): The Service Now CI sys id associated to this team - user_ids (list[int] | None | Unset): The user ids of the members of this team. - admin_ids (list[int] | None | Unset): The user ids of the admins of this team. These users must also be present - in user_ids attribute. - alerts_email_enabled (bool | None | Unset): Enable alerts through email - alert_urgency_id (None | str | Unset): The alert urgency id of the team - slack_channels (list[NewTeamDataAttributesSlackChannelsType0Item] | None | Unset): Slack Channels associated + external_id (Union[None, Unset, str]): The external id associated to this team + pagerduty_id (Union[None, Unset, str]): The PagerDuty group id associated to this team + pagerduty_service_id (Union[None, Unset, str]): The PagerDuty service id associated to this team + opsgenie_id (Union[None, Unset, str]): The Opsgenie group id associated to this team + opsgenie_team_id (Union[None, Unset, str]): The Opsgenie team id associated to this team + victor_ops_id (Union[None, Unset, str]): The VictorOps group id associated to this team + pagertree_id (Union[None, Unset, str]): The PagerTree group id associated to this team + cortex_id (Union[None, Unset, str]): The Cortex group id associated to this team + service_now_ci_sys_id (Union[None, Unset, str]): The Service Now CI sys id associated to this team + user_ids (Union[None, Unset, list[int]]): The user ids of the members of this team. + admin_ids (Union[None, Unset, list[int]]): The user ids of the admins of this team. These users must also be + present in user_ids attribute. + alerts_email_enabled (Union[None, Unset, bool]): Enable alerts through email + alert_urgency_id (Union[None, Unset, str]): The alert urgency id of the team + slack_channels (Union[None, Unset, list['NewTeamDataAttributesSlackChannelsType0Item']]): Slack Channels + associated with this team + slack_aliases (Union[None, Unset, list['NewTeamDataAttributesSlackAliasesType0Item']]): Slack Aliases associated with this team - slack_aliases (list[NewTeamDataAttributesSlackAliasesType0Item] | None | Unset): Slack Aliases associated with - this team - alert_broadcast_enabled (bool | None | Unset): Enable alerts to be broadcasted to a specific channel - alert_broadcast_channel (NewTeamDataAttributesAlertBroadcastChannelType0 | None | Unset): Slack channel to - broadcast alerts to - incident_broadcast_enabled (bool | None | Unset): Enable incidents to be broadcasted to a specific channel - incident_broadcast_channel (NewTeamDataAttributesIncidentBroadcastChannelType0 | None | Unset): Slack channel to - broadcast incidents to - auto_add_members_when_attached (bool | None | Unset): Auto add members to incident channel when team is attached - auto_add_members_scope (NewTeamDataAttributesAutoAddMembersScope | Unset): Visibility-scoped auto-add behavior. - Only present when the `enable_scoped_incident_channel_auto_add` feature flag is on for the organization. When - set, it overrides `auto_add_members_when_attached`. - properties (list[NewTeamDataAttributesPropertiesItem] | Unset): Array of property values for this team. + alert_broadcast_enabled (Union[None, Unset, bool]): Enable alerts to be broadcasted to a specific channel + alert_broadcast_channel (Union['NewTeamDataAttributesAlertBroadcastChannelType0', None, Unset]): Slack channel + to broadcast alerts to + incident_broadcast_enabled (Union[None, Unset, bool]): Enable incidents to be broadcasted to a specific channel + incident_broadcast_channel (Union['NewTeamDataAttributesIncidentBroadcastChannelType0', None, Unset]): Slack + channel to broadcast incidents to + auto_add_members_when_attached (Union[None, Unset, bool]): Auto add members to incident channel when team is + attached + auto_add_members_scope (Union[Unset, NewTeamDataAttributesAutoAddMembersScope]): Visibility-scoped auto-add + behavior. Only present when the `enable_scoped_incident_channel_auto_add` feature flag is on for the + organization. When set, it overrides `auto_add_members_when_attached`. + properties (Union[Unset, list['NewTeamDataAttributesPropertiesItem']]): Array of property values for this team. """ name: str - description: None | str | Unset = UNSET - notify_emails: list[str] | None | Unset = UNSET - color: None | str | Unset = UNSET - position: int | None | Unset = UNSET - backstage_id: None | str | Unset = UNSET - external_id: None | str | Unset = UNSET - pagerduty_id: None | str | Unset = UNSET - pagerduty_service_id: None | str | Unset = UNSET - opsgenie_id: None | str | Unset = UNSET - opsgenie_team_id: None | str | Unset = UNSET - victor_ops_id: None | str | Unset = UNSET - pagertree_id: None | str | Unset = UNSET - cortex_id: None | str | Unset = UNSET - service_now_ci_sys_id: None | str | Unset = UNSET - user_ids: list[int] | None | Unset = UNSET - admin_ids: list[int] | None | Unset = UNSET - alerts_email_enabled: bool | None | Unset = UNSET - alert_urgency_id: None | str | Unset = UNSET - slack_channels: list[NewTeamDataAttributesSlackChannelsType0Item] | None | Unset = UNSET - slack_aliases: list[NewTeamDataAttributesSlackAliasesType0Item] | None | Unset = UNSET - alert_broadcast_enabled: bool | None | Unset = UNSET - alert_broadcast_channel: NewTeamDataAttributesAlertBroadcastChannelType0 | None | Unset = UNSET - incident_broadcast_enabled: bool | None | Unset = UNSET - incident_broadcast_channel: NewTeamDataAttributesIncidentBroadcastChannelType0 | None | Unset = UNSET - auto_add_members_when_attached: bool | None | Unset = UNSET - auto_add_members_scope: NewTeamDataAttributesAutoAddMembersScope | Unset = UNSET - properties: list[NewTeamDataAttributesPropertiesItem] | Unset = UNSET + slug: Union[None, Unset, str] = UNSET + description: Union[None, Unset, str] = UNSET + public_description: Union[None, Unset, str] = UNSET + notify_emails: Union[None, Unset, list[str]] = UNSET + color: Union[None, Unset, str] = UNSET + position: Union[None, Unset, int] = UNSET + backstage_id: Union[None, Unset, str] = UNSET + external_id: Union[None, Unset, str] = UNSET + pagerduty_id: Union[None, Unset, str] = UNSET + pagerduty_service_id: Union[None, Unset, str] = UNSET + opsgenie_id: Union[None, Unset, str] = UNSET + opsgenie_team_id: Union[None, Unset, str] = UNSET + victor_ops_id: Union[None, Unset, str] = UNSET + pagertree_id: Union[None, Unset, str] = UNSET + cortex_id: Union[None, Unset, str] = UNSET + service_now_ci_sys_id: Union[None, Unset, str] = UNSET + user_ids: Union[None, Unset, list[int]] = UNSET + admin_ids: Union[None, Unset, list[int]] = UNSET + alerts_email_enabled: Union[None, Unset, bool] = UNSET + alert_urgency_id: Union[None, Unset, str] = UNSET + slack_channels: Union[None, Unset, list["NewTeamDataAttributesSlackChannelsType0Item"]] = UNSET + slack_aliases: Union[None, Unset, list["NewTeamDataAttributesSlackAliasesType0Item"]] = UNSET + alert_broadcast_enabled: Union[None, Unset, bool] = UNSET + alert_broadcast_channel: Union["NewTeamDataAttributesAlertBroadcastChannelType0", None, Unset] = UNSET + incident_broadcast_enabled: Union[None, Unset, bool] = UNSET + incident_broadcast_channel: Union["NewTeamDataAttributesIncidentBroadcastChannelType0", None, Unset] = UNSET + auto_add_members_when_attached: Union[None, Unset, bool] = UNSET + auto_add_members_scope: Union[Unset, NewTeamDataAttributesAutoAddMembersScope] = UNSET + properties: Union[Unset, list["NewTeamDataAttributesPropertiesItem"]] = UNSET def to_dict(self) -> dict[str, Any]: from ..models.new_team_data_attributes_alert_broadcast_channel_type_0 import ( @@ -107,13 +111,25 @@ def to_dict(self) -> dict[str, Any]: name = self.name - description: None | str | Unset + slug: Union[None, Unset, str] + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug + + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: description = self.description - notify_emails: list[str] | None | Unset + public_description: Union[None, Unset, str] + if isinstance(self.public_description, Unset): + public_description = UNSET + else: + public_description = self.public_description + + notify_emails: Union[None, Unset, list[str]] if isinstance(self.notify_emails, Unset): notify_emails = UNSET elif isinstance(self.notify_emails, list): @@ -122,79 +138,79 @@ def to_dict(self) -> dict[str, Any]: else: notify_emails = self.notify_emails - color: None | str | Unset + color: Union[None, Unset, str] if isinstance(self.color, Unset): color = UNSET else: color = self.color - position: int | None | Unset + position: Union[None, Unset, int] if isinstance(self.position, Unset): position = UNSET else: position = self.position - backstage_id: None | str | Unset + backstage_id: Union[None, Unset, str] if isinstance(self.backstage_id, Unset): backstage_id = UNSET else: backstage_id = self.backstage_id - external_id: None | str | Unset + external_id: Union[None, Unset, str] if isinstance(self.external_id, Unset): external_id = UNSET else: external_id = self.external_id - pagerduty_id: None | str | Unset + pagerduty_id: Union[None, Unset, str] if isinstance(self.pagerduty_id, Unset): pagerduty_id = UNSET else: pagerduty_id = self.pagerduty_id - pagerduty_service_id: None | str | Unset + pagerduty_service_id: Union[None, Unset, str] if isinstance(self.pagerduty_service_id, Unset): pagerduty_service_id = UNSET else: pagerduty_service_id = self.pagerduty_service_id - opsgenie_id: None | str | Unset + opsgenie_id: Union[None, Unset, str] if isinstance(self.opsgenie_id, Unset): opsgenie_id = UNSET else: opsgenie_id = self.opsgenie_id - opsgenie_team_id: None | str | Unset + opsgenie_team_id: Union[None, Unset, str] if isinstance(self.opsgenie_team_id, Unset): opsgenie_team_id = UNSET else: opsgenie_team_id = self.opsgenie_team_id - victor_ops_id: None | str | Unset + victor_ops_id: Union[None, Unset, str] if isinstance(self.victor_ops_id, Unset): victor_ops_id = UNSET else: victor_ops_id = self.victor_ops_id - pagertree_id: None | str | Unset + pagertree_id: Union[None, Unset, str] if isinstance(self.pagertree_id, Unset): pagertree_id = UNSET else: pagertree_id = self.pagertree_id - cortex_id: None | str | Unset + cortex_id: Union[None, Unset, str] if isinstance(self.cortex_id, Unset): cortex_id = UNSET else: cortex_id = self.cortex_id - service_now_ci_sys_id: None | str | Unset + service_now_ci_sys_id: Union[None, Unset, str] if isinstance(self.service_now_ci_sys_id, Unset): service_now_ci_sys_id = UNSET else: service_now_ci_sys_id = self.service_now_ci_sys_id - user_ids: list[int] | None | Unset + user_ids: Union[None, Unset, list[int]] if isinstance(self.user_ids, Unset): user_ids = UNSET elif isinstance(self.user_ids, list): @@ -203,7 +219,7 @@ def to_dict(self) -> dict[str, Any]: else: user_ids = self.user_ids - admin_ids: list[int] | None | Unset + admin_ids: Union[None, Unset, list[int]] if isinstance(self.admin_ids, Unset): admin_ids = UNSET elif isinstance(self.admin_ids, list): @@ -212,19 +228,19 @@ def to_dict(self) -> dict[str, Any]: else: admin_ids = self.admin_ids - alerts_email_enabled: bool | None | Unset + alerts_email_enabled: Union[None, Unset, bool] if isinstance(self.alerts_email_enabled, Unset): alerts_email_enabled = UNSET else: alerts_email_enabled = self.alerts_email_enabled - alert_urgency_id: None | str | Unset + alert_urgency_id: Union[None, Unset, str] if isinstance(self.alert_urgency_id, Unset): alert_urgency_id = UNSET else: alert_urgency_id = self.alert_urgency_id - slack_channels: list[dict[str, Any]] | None | Unset + slack_channels: Union[None, Unset, list[dict[str, Any]]] if isinstance(self.slack_channels, Unset): slack_channels = UNSET elif isinstance(self.slack_channels, list): @@ -236,7 +252,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_channels = self.slack_channels - slack_aliases: list[dict[str, Any]] | None | Unset + slack_aliases: Union[None, Unset, list[dict[str, Any]]] if isinstance(self.slack_aliases, Unset): slack_aliases = UNSET elif isinstance(self.slack_aliases, list): @@ -248,13 +264,13 @@ def to_dict(self) -> dict[str, Any]: else: slack_aliases = self.slack_aliases - alert_broadcast_enabled: bool | None | Unset + alert_broadcast_enabled: Union[None, Unset, bool] if isinstance(self.alert_broadcast_enabled, Unset): alert_broadcast_enabled = UNSET else: alert_broadcast_enabled = self.alert_broadcast_enabled - alert_broadcast_channel: dict[str, Any] | None | Unset + alert_broadcast_channel: Union[None, Unset, dict[str, Any]] if isinstance(self.alert_broadcast_channel, Unset): alert_broadcast_channel = UNSET elif isinstance(self.alert_broadcast_channel, NewTeamDataAttributesAlertBroadcastChannelType0): @@ -262,13 +278,13 @@ def to_dict(self) -> dict[str, Any]: else: alert_broadcast_channel = self.alert_broadcast_channel - incident_broadcast_enabled: bool | None | Unset + incident_broadcast_enabled: Union[None, Unset, bool] if isinstance(self.incident_broadcast_enabled, Unset): incident_broadcast_enabled = UNSET else: incident_broadcast_enabled = self.incident_broadcast_enabled - incident_broadcast_channel: dict[str, Any] | None | Unset + incident_broadcast_channel: Union[None, Unset, dict[str, Any]] if isinstance(self.incident_broadcast_channel, Unset): incident_broadcast_channel = UNSET elif isinstance(self.incident_broadcast_channel, NewTeamDataAttributesIncidentBroadcastChannelType0): @@ -276,17 +292,17 @@ def to_dict(self) -> dict[str, Any]: else: incident_broadcast_channel = self.incident_broadcast_channel - auto_add_members_when_attached: bool | None | Unset + auto_add_members_when_attached: Union[None, Unset, bool] if isinstance(self.auto_add_members_when_attached, Unset): auto_add_members_when_attached = UNSET else: auto_add_members_when_attached = self.auto_add_members_when_attached - auto_add_members_scope: str | Unset = UNSET + auto_add_members_scope: Union[Unset, str] = UNSET if not isinstance(self.auto_add_members_scope, Unset): auto_add_members_scope = self.auto_add_members_scope - properties: list[dict[str, Any]] | Unset = UNSET + properties: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.properties, Unset): properties = [] for properties_item_data in self.properties: @@ -300,8 +316,12 @@ def to_dict(self) -> dict[str, Any]: "name": name, } ) + if slug is not UNSET: + field_dict["slug"] = slug if description is not UNSET: field_dict["description"] = description + if public_description is not UNSET: + field_dict["public_description"] = public_description if notify_emails is not UNSET: field_dict["notify_emails"] = notify_emails if color is not UNSET: @@ -376,16 +396,34 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name") - def _parse_description(data: object) -> None | str | Unset: + def _parse_slug(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + slug = _parse_slug(d.pop("slug", UNSET)) + + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) - def _parse_notify_emails(data: object) -> list[str] | None | Unset: + def _parse_public_description(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + public_description = _parse_public_description(d.pop("public_description", UNSET)) + + def _parse_notify_emails(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -396,121 +434,121 @@ def _parse_notify_emails(data: object) -> list[str] | None | Unset: notify_emails_type_0 = cast(list[str], data) return notify_emails_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) notify_emails = _parse_notify_emails(d.pop("notify_emails", UNSET)) - def _parse_color(data: object) -> None | str | Unset: + def _parse_color(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) color = _parse_color(d.pop("color", UNSET)) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> Union[None, Unset, int]: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(Union[None, Unset, int], data) position = _parse_position(d.pop("position", UNSET)) - def _parse_backstage_id(data: object) -> None | str | Unset: + def _parse_backstage_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) backstage_id = _parse_backstage_id(d.pop("backstage_id", UNSET)) - def _parse_external_id(data: object) -> None | str | Unset: + def _parse_external_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) external_id = _parse_external_id(d.pop("external_id", UNSET)) - def _parse_pagerduty_id(data: object) -> None | str | Unset: + def _parse_pagerduty_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) pagerduty_id = _parse_pagerduty_id(d.pop("pagerduty_id", UNSET)) - def _parse_pagerduty_service_id(data: object) -> None | str | Unset: + def _parse_pagerduty_service_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) pagerduty_service_id = _parse_pagerduty_service_id(d.pop("pagerduty_service_id", UNSET)) - def _parse_opsgenie_id(data: object) -> None | str | Unset: + def _parse_opsgenie_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) opsgenie_id = _parse_opsgenie_id(d.pop("opsgenie_id", UNSET)) - def _parse_opsgenie_team_id(data: object) -> None | str | Unset: + def _parse_opsgenie_team_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) opsgenie_team_id = _parse_opsgenie_team_id(d.pop("opsgenie_team_id", UNSET)) - def _parse_victor_ops_id(data: object) -> None | str | Unset: + def _parse_victor_ops_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) victor_ops_id = _parse_victor_ops_id(d.pop("victor_ops_id", UNSET)) - def _parse_pagertree_id(data: object) -> None | str | Unset: + def _parse_pagertree_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) pagertree_id = _parse_pagertree_id(d.pop("pagertree_id", UNSET)) - def _parse_cortex_id(data: object) -> None | str | Unset: + def _parse_cortex_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) cortex_id = _parse_cortex_id(d.pop("cortex_id", UNSET)) - def _parse_service_now_ci_sys_id(data: object) -> None | str | Unset: + def _parse_service_now_ci_sys_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) service_now_ci_sys_id = _parse_service_now_ci_sys_id(d.pop("service_now_ci_sys_id", UNSET)) - def _parse_user_ids(data: object) -> list[int] | None | Unset: + def _parse_user_ids(data: object) -> Union[None, Unset, list[int]]: if data is None: return data if isinstance(data, Unset): @@ -521,13 +559,13 @@ def _parse_user_ids(data: object) -> list[int] | None | Unset: user_ids_type_0 = cast(list[int], data) return user_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[int] | None | Unset, data) + return cast(Union[None, Unset, list[int]], data) user_ids = _parse_user_ids(d.pop("user_ids", UNSET)) - def _parse_admin_ids(data: object) -> list[int] | None | Unset: + def _parse_admin_ids(data: object) -> Union[None, Unset, list[int]]: if data is None: return data if isinstance(data, Unset): @@ -538,31 +576,33 @@ def _parse_admin_ids(data: object) -> list[int] | None | Unset: admin_ids_type_0 = cast(list[int], data) return admin_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[int] | None | Unset, data) + return cast(Union[None, Unset, list[int]], data) admin_ids = _parse_admin_ids(d.pop("admin_ids", UNSET)) - def _parse_alerts_email_enabled(data: object) -> bool | None | Unset: + def _parse_alerts_email_enabled(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) alerts_email_enabled = _parse_alerts_email_enabled(d.pop("alerts_email_enabled", UNSET)) - def _parse_alert_urgency_id(data: object) -> None | str | Unset: + def _parse_alert_urgency_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) alert_urgency_id = _parse_alert_urgency_id(d.pop("alert_urgency_id", UNSET)) - def _parse_slack_channels(data: object) -> list[NewTeamDataAttributesSlackChannelsType0Item] | None | Unset: + def _parse_slack_channels( + data: object, + ) -> Union[None, Unset, list["NewTeamDataAttributesSlackChannelsType0Item"]]: if data is None: return data if isinstance(data, Unset): @@ -580,13 +620,15 @@ def _parse_slack_channels(data: object) -> list[NewTeamDataAttributesSlackChanne slack_channels_type_0.append(slack_channels_type_0_item) return slack_channels_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[NewTeamDataAttributesSlackChannelsType0Item] | None | Unset, data) + return cast(Union[None, Unset, list["NewTeamDataAttributesSlackChannelsType0Item"]], data) slack_channels = _parse_slack_channels(d.pop("slack_channels", UNSET)) - def _parse_slack_aliases(data: object) -> list[NewTeamDataAttributesSlackAliasesType0Item] | None | Unset: + def _parse_slack_aliases( + data: object, + ) -> Union[None, Unset, list["NewTeamDataAttributesSlackAliasesType0Item"]]: if data is None: return data if isinstance(data, Unset): @@ -604,24 +646,24 @@ def _parse_slack_aliases(data: object) -> list[NewTeamDataAttributesSlackAliases slack_aliases_type_0.append(slack_aliases_type_0_item) return slack_aliases_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[NewTeamDataAttributesSlackAliasesType0Item] | None | Unset, data) + return cast(Union[None, Unset, list["NewTeamDataAttributesSlackAliasesType0Item"]], data) slack_aliases = _parse_slack_aliases(d.pop("slack_aliases", UNSET)) - def _parse_alert_broadcast_enabled(data: object) -> bool | None | Unset: + def _parse_alert_broadcast_enabled(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) alert_broadcast_enabled = _parse_alert_broadcast_enabled(d.pop("alert_broadcast_enabled", UNSET)) def _parse_alert_broadcast_channel( data: object, - ) -> NewTeamDataAttributesAlertBroadcastChannelType0 | None | Unset: + ) -> Union["NewTeamDataAttributesAlertBroadcastChannelType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -632,24 +674,24 @@ def _parse_alert_broadcast_channel( alert_broadcast_channel_type_0 = NewTeamDataAttributesAlertBroadcastChannelType0.from_dict(data) return alert_broadcast_channel_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(NewTeamDataAttributesAlertBroadcastChannelType0 | None | Unset, data) + return cast(Union["NewTeamDataAttributesAlertBroadcastChannelType0", None, Unset], data) alert_broadcast_channel = _parse_alert_broadcast_channel(d.pop("alert_broadcast_channel", UNSET)) - def _parse_incident_broadcast_enabled(data: object) -> bool | None | Unset: + def _parse_incident_broadcast_enabled(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) incident_broadcast_enabled = _parse_incident_broadcast_enabled(d.pop("incident_broadcast_enabled", UNSET)) def _parse_incident_broadcast_channel( data: object, - ) -> NewTeamDataAttributesIncidentBroadcastChannelType0 | None | Unset: + ) -> Union["NewTeamDataAttributesIncidentBroadcastChannelType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -660,42 +702,42 @@ def _parse_incident_broadcast_channel( incident_broadcast_channel_type_0 = NewTeamDataAttributesIncidentBroadcastChannelType0.from_dict(data) return incident_broadcast_channel_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(NewTeamDataAttributesIncidentBroadcastChannelType0 | None | Unset, data) + return cast(Union["NewTeamDataAttributesIncidentBroadcastChannelType0", None, Unset], data) incident_broadcast_channel = _parse_incident_broadcast_channel(d.pop("incident_broadcast_channel", UNSET)) - def _parse_auto_add_members_when_attached(data: object) -> bool | None | Unset: + def _parse_auto_add_members_when_attached(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) auto_add_members_when_attached = _parse_auto_add_members_when_attached( d.pop("auto_add_members_when_attached", UNSET) ) _auto_add_members_scope = d.pop("auto_add_members_scope", UNSET) - auto_add_members_scope: NewTeamDataAttributesAutoAddMembersScope | Unset + auto_add_members_scope: Union[Unset, NewTeamDataAttributesAutoAddMembersScope] if isinstance(_auto_add_members_scope, Unset): auto_add_members_scope = UNSET else: auto_add_members_scope = check_new_team_data_attributes_auto_add_members_scope(_auto_add_members_scope) + properties = [] _properties = d.pop("properties", UNSET) - properties: list[NewTeamDataAttributesPropertiesItem] | Unset = UNSET - if _properties is not UNSET: - properties = [] - for properties_item_data in _properties: - properties_item = NewTeamDataAttributesPropertiesItem.from_dict(properties_item_data) + for properties_item_data in _properties or []: + properties_item = NewTeamDataAttributesPropertiesItem.from_dict(properties_item_data) - properties.append(properties_item) + properties.append(properties_item) new_team_data_attributes = cls( name=name, + slug=slug, description=description, + public_description=public_description, notify_emails=notify_emails, color=color, position=position, diff --git a/rootly_sdk/models/new_team_data_attributes_alert_broadcast_channel_type_0.py b/rootly_sdk/models/new_team_data_attributes_alert_broadcast_channel_type_0.py index 1450dc9d..131ecc3f 100644 --- a/rootly_sdk/models/new_team_data_attributes_alert_broadcast_channel_type_0.py +++ b/rootly_sdk/models/new_team_data_attributes_alert_broadcast_channel_type_0.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,11 +15,11 @@ class NewTeamDataAttributesAlertBroadcastChannelType0: Attributes: id (str): Slack channel ID - name (str | Unset): Slack channel name + name (Union[Unset, str]): Slack channel name """ id: str - name: str | Unset = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/new_team_data_attributes_incident_broadcast_channel_type_0.py b/rootly_sdk/models/new_team_data_attributes_incident_broadcast_channel_type_0.py index 6521da45..f7d6275e 100644 --- a/rootly_sdk/models/new_team_data_attributes_incident_broadcast_channel_type_0.py +++ b/rootly_sdk/models/new_team_data_attributes_incident_broadcast_channel_type_0.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,11 +15,11 @@ class NewTeamDataAttributesIncidentBroadcastChannelType0: Attributes: id (str): Slack channel ID - name (str | Unset): Slack channel name + name (Union[Unset, str]): Slack channel name """ id: str - name: str | Unset = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/new_team_data_attributes_properties_item.py b/rootly_sdk/models/new_team_data_attributes_properties_item.py index ec6700ba..65b76439 100644 --- a/rootly_sdk/models/new_team_data_attributes_properties_item.py +++ b/rootly_sdk/models/new_team_data_attributes_properties_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/new_team_data_attributes_slack_aliases_type_0_item.py b/rootly_sdk/models/new_team_data_attributes_slack_aliases_type_0_item.py index 716b07cb..7ed25ecd 100644 --- a/rootly_sdk/models/new_team_data_attributes_slack_aliases_type_0_item.py +++ b/rootly_sdk/models/new_team_data_attributes_slack_aliases_type_0_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/new_team_data_attributes_slack_channels_type_0_item.py b/rootly_sdk/models/new_team_data_attributes_slack_channels_type_0_item.py index 4d03a45f..0560b467 100644 --- a/rootly_sdk/models/new_team_data_attributes_slack_channels_type_0_item.py +++ b/rootly_sdk/models/new_team_data_attributes_slack_channels_type_0_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/new_user_email_address.py b/rootly_sdk/models/new_user_email_address.py index 44365818..4b1dfcd4 100644 --- a/rootly_sdk/models/new_user_email_address.py +++ b/rootly_sdk/models/new_user_email_address.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewUserEmailAddress: data (NewUserEmailAddressData): """ - data: NewUserEmailAddressData + data: "NewUserEmailAddressData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_user_email_address_data.py b/rootly_sdk/models/new_user_email_address_data.py index 39826d81..a05d8ba5 100644 --- a/rootly_sdk/models/new_user_email_address_data.py +++ b/rootly_sdk/models/new_user_email_address_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class NewUserEmailAddressData: """ type_: NewUserEmailAddressDataType - attributes: NewUserEmailAddressDataAttributes + attributes: "NewUserEmailAddressDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_user_email_address_data_attributes.py b/rootly_sdk/models/new_user_email_address_data_attributes.py index 8ff3d016..7e191759 100644 --- a/rootly_sdk/models/new_user_email_address_data_attributes.py +++ b/rootly_sdk/models/new_user_email_address_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/new_user_notification_rule.py b/rootly_sdk/models/new_user_notification_rule.py index 87bbb9bb..4e14b5ae 100644 --- a/rootly_sdk/models/new_user_notification_rule.py +++ b/rootly_sdk/models/new_user_notification_rule.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewUserNotificationRule: data (NewUserNotificationRuleData): """ - data: NewUserNotificationRuleData + data: "NewUserNotificationRuleData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_user_notification_rule_data.py b/rootly_sdk/models/new_user_notification_rule_data.py index 0fd914eb..67502591 100644 --- a/rootly_sdk/models/new_user_notification_rule_data.py +++ b/rootly_sdk/models/new_user_notification_rule_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class NewUserNotificationRuleData: """ type_: NewUserNotificationRuleDataType - attributes: NewUserNotificationRuleDataAttributes + attributes: "NewUserNotificationRuleDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_user_notification_rule_data_attributes.py b/rootly_sdk/models/new_user_notification_rule_data_attributes.py index 1139cb20..a885f0d2 100644 --- a/rootly_sdk/models/new_user_notification_rule_data_attributes.py +++ b/rootly_sdk/models/new_user_notification_rule_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -20,21 +18,21 @@ class NewUserNotificationRuleDataAttributes: Attributes: enabled_contact_types (list[NewUserNotificationRuleDataAttributesEnabledContactTypesItem]): Contact types for which notification needs to be enabled - delay (int | None | Unset): Delay after which rule gets triggered - position (int | None | Unset): Position of the rule - user_email_address_id (None | str | Unset): User email address to which notification to be sent - user_call_number_id (None | str | Unset): User phone number to which notification to be sent - user_sms_number_id (None | str | Unset): User sms number to which notification to be sent - user_device_id (None | str | Unset): User device to which notification to be sent + delay (Union[None, Unset, int]): Delay after which rule gets triggered + position (Union[None, Unset, int]): Position of the rule + user_email_address_id (Union[None, Unset, str]): User email address to which notification to be sent + user_call_number_id (Union[None, Unset, str]): User phone number to which notification to be sent + user_sms_number_id (Union[None, Unset, str]): User sms number to which notification to be sent + user_device_id (Union[None, Unset, str]): User device to which notification to be sent """ enabled_contact_types: list[NewUserNotificationRuleDataAttributesEnabledContactTypesItem] - delay: int | None | Unset = UNSET - position: int | None | Unset = UNSET - user_email_address_id: None | str | Unset = UNSET - user_call_number_id: None | str | Unset = UNSET - user_sms_number_id: None | str | Unset = UNSET - user_device_id: None | str | Unset = UNSET + delay: Union[None, Unset, int] = UNSET + position: Union[None, Unset, int] = UNSET + user_email_address_id: Union[None, Unset, str] = UNSET + user_call_number_id: Union[None, Unset, str] = UNSET + user_sms_number_id: Union[None, Unset, str] = UNSET + user_device_id: Union[None, Unset, str] = UNSET def to_dict(self) -> dict[str, Any]: enabled_contact_types = [] @@ -42,37 +40,37 @@ def to_dict(self) -> dict[str, Any]: enabled_contact_types_item: str = enabled_contact_types_item_data enabled_contact_types.append(enabled_contact_types_item) - delay: int | None | Unset + delay: Union[None, Unset, int] if isinstance(self.delay, Unset): delay = UNSET else: delay = self.delay - position: int | None | Unset + position: Union[None, Unset, int] if isinstance(self.position, Unset): position = UNSET else: position = self.position - user_email_address_id: None | str | Unset + user_email_address_id: Union[None, Unset, str] if isinstance(self.user_email_address_id, Unset): user_email_address_id = UNSET else: user_email_address_id = self.user_email_address_id - user_call_number_id: None | str | Unset + user_call_number_id: Union[None, Unset, str] if isinstance(self.user_call_number_id, Unset): user_call_number_id = UNSET else: user_call_number_id = self.user_call_number_id - user_sms_number_id: None | str | Unset + user_sms_number_id: Union[None, Unset, str] if isinstance(self.user_sms_number_id, Unset): user_sms_number_id = UNSET else: user_sms_number_id = self.user_sms_number_id - user_device_id: None | str | Unset + user_device_id: Union[None, Unset, str] if isinstance(self.user_device_id, Unset): user_device_id = UNSET else: @@ -112,57 +110,57 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: enabled_contact_types.append(enabled_contact_types_item) - def _parse_delay(data: object) -> int | None | Unset: + def _parse_delay(data: object) -> Union[None, Unset, int]: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(Union[None, Unset, int], data) delay = _parse_delay(d.pop("delay", UNSET)) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> Union[None, Unset, int]: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(Union[None, Unset, int], data) position = _parse_position(d.pop("position", UNSET)) - def _parse_user_email_address_id(data: object) -> None | str | Unset: + def _parse_user_email_address_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) user_email_address_id = _parse_user_email_address_id(d.pop("user_email_address_id", UNSET)) - def _parse_user_call_number_id(data: object) -> None | str | Unset: + def _parse_user_call_number_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) user_call_number_id = _parse_user_call_number_id(d.pop("user_call_number_id", UNSET)) - def _parse_user_sms_number_id(data: object) -> None | str | Unset: + def _parse_user_sms_number_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) user_sms_number_id = _parse_user_sms_number_id(d.pop("user_sms_number_id", UNSET)) - def _parse_user_device_id(data: object) -> None | str | Unset: + def _parse_user_device_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) user_device_id = _parse_user_device_id(d.pop("user_device_id", UNSET)) diff --git a/rootly_sdk/models/new_user_notification_rule_data_attributes_enabled_contact_types_item.py b/rootly_sdk/models/new_user_notification_rule_data_attributes_enabled_contact_types_item.py index fe523a7e..2083cdae 100644 --- a/rootly_sdk/models/new_user_notification_rule_data_attributes_enabled_contact_types_item.py +++ b/rootly_sdk/models/new_user_notification_rule_data_attributes_enabled_contact_types_item.py @@ -1,7 +1,7 @@ from typing import Literal, cast NewUserNotificationRuleDataAttributesEnabledContactTypesItem = Literal[ - "call", "device", "email", "google_chat", "non_critical_device", "slack", "sms" + "call", "device", "email", "google_chat", "microsoft_teams", "non_critical_device", "slack", "sms" ] NEW_USER_NOTIFICATION_RULE_DATA_ATTRIBUTES_ENABLED_CONTACT_TYPES_ITEM_VALUES: set[ @@ -11,6 +11,7 @@ "device", "email", "google_chat", + "microsoft_teams", "non_critical_device", "slack", "sms", diff --git a/rootly_sdk/models/new_user_phone_number.py b/rootly_sdk/models/new_user_phone_number.py index 77d68eb2..807f540a 100644 --- a/rootly_sdk/models/new_user_phone_number.py +++ b/rootly_sdk/models/new_user_phone_number.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewUserPhoneNumber: data (NewUserPhoneNumberData): """ - data: NewUserPhoneNumberData + data: "NewUserPhoneNumberData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_user_phone_number_data.py b/rootly_sdk/models/new_user_phone_number_data.py index e5bb6a12..84f944ed 100644 --- a/rootly_sdk/models/new_user_phone_number_data.py +++ b/rootly_sdk/models/new_user_phone_number_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class NewUserPhoneNumberData: """ type_: NewUserPhoneNumberDataType - attributes: NewUserPhoneNumberDataAttributes + attributes: "NewUserPhoneNumberDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_user_phone_number_data_attributes.py b/rootly_sdk/models/new_user_phone_number_data_attributes.py index 6e977204..b2c4f4c0 100644 --- a/rootly_sdk/models/new_user_phone_number_data_attributes.py +++ b/rootly_sdk/models/new_user_phone_number_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/new_verified_domain.py b/rootly_sdk/models/new_verified_domain.py new file mode 100644 index 00000000..a3a224e7 --- /dev/null +++ b/rootly_sdk/models/new_verified_domain.py @@ -0,0 +1,65 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +if TYPE_CHECKING: + from ..models.new_verified_domain_data import NewVerifiedDomainData + + +T = TypeVar("T", bound="NewVerifiedDomain") + + +@_attrs_define +class NewVerifiedDomain: + """ + Attributes: + data (NewVerifiedDomainData): + """ + + data: "NewVerifiedDomainData" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "data": data, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.new_verified_domain_data import NewVerifiedDomainData + + d = dict(src_dict) + data = NewVerifiedDomainData.from_dict(d.pop("data")) + + new_verified_domain = cls( + data=data, + ) + + new_verified_domain.additional_properties = d + return new_verified_domain + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/rootly_sdk/models/new_verified_domain_data.py b/rootly_sdk/models/new_verified_domain_data.py new file mode 100644 index 00000000..13bcf456 --- /dev/null +++ b/rootly_sdk/models/new_verified_domain_data.py @@ -0,0 +1,75 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.new_verified_domain_data_type import NewVerifiedDomainDataType, check_new_verified_domain_data_type + +if TYPE_CHECKING: + from ..models.new_verified_domain_data_attributes import NewVerifiedDomainDataAttributes + + +T = TypeVar("T", bound="NewVerifiedDomainData") + + +@_attrs_define +class NewVerifiedDomainData: + """ + Attributes: + type_ (NewVerifiedDomainDataType): + attributes (NewVerifiedDomainDataAttributes): + """ + + type_: NewVerifiedDomainDataType + attributes: "NewVerifiedDomainDataAttributes" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + type_: str = self.type_ + + attributes = self.attributes.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "type": type_, + "attributes": attributes, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.new_verified_domain_data_attributes import NewVerifiedDomainDataAttributes + + d = dict(src_dict) + type_ = check_new_verified_domain_data_type(d.pop("type")) + + attributes = NewVerifiedDomainDataAttributes.from_dict(d.pop("attributes")) + + new_verified_domain_data = cls( + type_=type_, + attributes=attributes, + ) + + new_verified_domain_data.additional_properties = d + return new_verified_domain_data + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/rootly_sdk/models/new_verified_domain_data_attributes.py b/rootly_sdk/models/new_verified_domain_data_attributes.py new file mode 100644 index 00000000..f5432ffa --- /dev/null +++ b/rootly_sdk/models/new_verified_domain_data_attributes.py @@ -0,0 +1,40 @@ +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +T = TypeVar("T", bound="NewVerifiedDomainDataAttributes") + + +@_attrs_define +class NewVerifiedDomainDataAttributes: + """ + Attributes: + domain (str): The domain to verify (e.g. acme.com) + """ + + domain: str + + def to_dict(self) -> dict[str, Any]: + domain = self.domain + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "domain": domain, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + domain = d.pop("domain") + + new_verified_domain_data_attributes = cls( + domain=domain, + ) + + return new_verified_domain_data_attributes diff --git a/rootly_sdk/models/new_verified_domain_data_type.py b/rootly_sdk/models/new_verified_domain_data_type.py new file mode 100644 index 00000000..9e43541d --- /dev/null +++ b/rootly_sdk/models/new_verified_domain_data_type.py @@ -0,0 +1,15 @@ +from typing import Literal, cast + +NewVerifiedDomainDataType = Literal["verified_domains"] + +NEW_VERIFIED_DOMAIN_DATA_TYPE_VALUES: set[NewVerifiedDomainDataType] = { + "verified_domains", +} + + +def check_new_verified_domain_data_type(value: str | None) -> NewVerifiedDomainDataType | None: + if value is None: + return None + if value in NEW_VERIFIED_DOMAIN_DATA_TYPE_VALUES: + return cast(NewVerifiedDomainDataType, value) + raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_VERIFIED_DOMAIN_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/new_webhooks_endpoint.py b/rootly_sdk/models/new_webhooks_endpoint.py index 086d10ce..8be7c839 100644 --- a/rootly_sdk/models/new_webhooks_endpoint.py +++ b/rootly_sdk/models/new_webhooks_endpoint.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewWebhooksEndpoint: data (NewWebhooksEndpointData): """ - data: NewWebhooksEndpointData + data: "NewWebhooksEndpointData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_webhooks_endpoint_data.py b/rootly_sdk/models/new_webhooks_endpoint_data.py index 08c54004..8022924d 100644 --- a/rootly_sdk/models/new_webhooks_endpoint_data.py +++ b/rootly_sdk/models/new_webhooks_endpoint_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class NewWebhooksEndpointData: """ type_: NewWebhooksEndpointDataType - attributes: NewWebhooksEndpointDataAttributes + attributes: "NewWebhooksEndpointDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_webhooks_endpoint_data_attributes.py b/rootly_sdk/models/new_webhooks_endpoint_data_attributes.py index ee615dde..f24cac89 100644 --- a/rootly_sdk/models/new_webhooks_endpoint_data_attributes.py +++ b/rootly_sdk/models/new_webhooks_endpoint_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -26,29 +24,37 @@ class NewWebhooksEndpointDataAttributes: Attributes: name (str): The name of the endpoint url (str): The URL of the endpoint. - secret (str | Unset): The webhook signing secret used to verify webhook requests. - event_types (list[NewWebhooksEndpointDataAttributesEventTypesItem] | Unset): - enabled (bool | Unset): - custom_headers (list[NewWebhooksEndpointDataAttributesCustomHeadersItem] | Unset): Custom HTTP headers sent with - each delivery. Max 10. Reserved names (Content-Type, X-Rootly-Signature, Host, etc.) are rejected. + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + secret (Union[Unset, str]): The webhook signing secret used to verify webhook requests. + event_types (Union[Unset, list[NewWebhooksEndpointDataAttributesEventTypesItem]]): + enabled (Union[Unset, bool]): + custom_headers (Union[Unset, list['NewWebhooksEndpointDataAttributesCustomHeadersItem']]): Custom HTTP headers + sent with each delivery. Max 10. Reserved names (Content-Type, X-Rootly-Signature, Host, etc.) are rejected. """ name: str url: str - secret: str | Unset = UNSET - event_types: list[NewWebhooksEndpointDataAttributesEventTypesItem] | Unset = UNSET - enabled: bool | Unset = UNSET - custom_headers: list[NewWebhooksEndpointDataAttributesCustomHeadersItem] | Unset = UNSET + slug: Union[None, Unset, str] = UNSET + secret: Union[Unset, str] = UNSET + event_types: Union[Unset, list[NewWebhooksEndpointDataAttributesEventTypesItem]] = UNSET + enabled: Union[Unset, bool] = UNSET + custom_headers: Union[Unset, list["NewWebhooksEndpointDataAttributesCustomHeadersItem"]] = UNSET def to_dict(self) -> dict[str, Any]: - name = self.name url = self.url + slug: Union[None, Unset, str] + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug + secret = self.secret - event_types: list[str] | Unset = UNSET + event_types: Union[Unset, list[str]] = UNSET if not isinstance(self.event_types, Unset): event_types = [] for event_types_item_data in self.event_types: @@ -57,7 +63,7 @@ def to_dict(self) -> dict[str, Any]: enabled = self.enabled - custom_headers: list[dict[str, Any]] | Unset = UNSET + custom_headers: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.custom_headers, Unset): custom_headers = [] for custom_headers_item_data in self.custom_headers: @@ -72,6 +78,8 @@ def to_dict(self) -> dict[str, Any]: "url": url, } ) + if slug is not UNSET: + field_dict["slug"] = slug if secret is not UNSET: field_dict["secret"] = secret if event_types is not UNSET: @@ -94,33 +102,37 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: url = d.pop("url") + def _parse_slug(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + slug = _parse_slug(d.pop("slug", UNSET)) + secret = d.pop("secret", UNSET) + event_types = [] _event_types = d.pop("event_types", UNSET) - event_types: list[NewWebhooksEndpointDataAttributesEventTypesItem] | Unset = UNSET - if _event_types is not UNSET: - event_types = [] - for event_types_item_data in _event_types: - event_types_item = check_new_webhooks_endpoint_data_attributes_event_types_item(event_types_item_data) + for event_types_item_data in _event_types or []: + event_types_item = check_new_webhooks_endpoint_data_attributes_event_types_item(event_types_item_data) - event_types.append(event_types_item) + event_types.append(event_types_item) enabled = d.pop("enabled", UNSET) + custom_headers = [] _custom_headers = d.pop("custom_headers", UNSET) - custom_headers: list[NewWebhooksEndpointDataAttributesCustomHeadersItem] | Unset = UNSET - if _custom_headers is not UNSET: - custom_headers = [] - for custom_headers_item_data in _custom_headers: - custom_headers_item = NewWebhooksEndpointDataAttributesCustomHeadersItem.from_dict( - custom_headers_item_data - ) + for custom_headers_item_data in _custom_headers or []: + custom_headers_item = NewWebhooksEndpointDataAttributesCustomHeadersItem.from_dict(custom_headers_item_data) - custom_headers.append(custom_headers_item) + custom_headers.append(custom_headers_item) new_webhooks_endpoint_data_attributes = cls( name=name, url=url, + slug=slug, secret=secret, event_types=event_types, enabled=enabled, diff --git a/rootly_sdk/models/new_webhooks_endpoint_data_attributes_custom_headers_item.py b/rootly_sdk/models/new_webhooks_endpoint_data_attributes_custom_headers_item.py index 3ffe6bda..cd0fc746 100644 --- a/rootly_sdk/models/new_webhooks_endpoint_data_attributes_custom_headers_item.py +++ b/rootly_sdk/models/new_webhooks_endpoint_data_attributes_custom_headers_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/new_webhooks_endpoint_data_attributes_event_types_item.py b/rootly_sdk/models/new_webhooks_endpoint_data_attributes_event_types_item.py index 0ba141cc..a0833ca6 100644 --- a/rootly_sdk/models/new_webhooks_endpoint_data_attributes_event_types_item.py +++ b/rootly_sdk/models/new_webhooks_endpoint_data_attributes_event_types_item.py @@ -2,6 +2,7 @@ NewWebhooksEndpointDataAttributesEventTypesItem = Literal[ "alert.created", + "alert.updated", "audit_log.created", "genius_workflow_run.canceled", "genius_workflow_run.completed", @@ -36,6 +37,7 @@ NEW_WEBHOOKS_ENDPOINT_DATA_ATTRIBUTES_EVENT_TYPES_ITEM_VALUES: set[NewWebhooksEndpointDataAttributesEventTypesItem] = { "alert.created", + "alert.updated", "audit_log.created", "genius_workflow_run.canceled", "genius_workflow_run.completed", diff --git a/rootly_sdk/models/new_workflow.py b/rootly_sdk/models/new_workflow.py index e499f14c..a81bad47 100644 --- a/rootly_sdk/models/new_workflow.py +++ b/rootly_sdk/models/new_workflow.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewWorkflow: data (NewWorkflowData): """ - data: NewWorkflowData + data: "NewWorkflowData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_workflow_action_item_form_field_condition.py b/rootly_sdk/models/new_workflow_action_item_form_field_condition.py index 9033a121..a7923dba 100644 --- a/rootly_sdk/models/new_workflow_action_item_form_field_condition.py +++ b/rootly_sdk/models/new_workflow_action_item_form_field_condition.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewWorkflowActionItemFormFieldCondition: data (NewWorkflowActionItemFormFieldConditionData): """ - data: NewWorkflowActionItemFormFieldConditionData + data: "NewWorkflowActionItemFormFieldConditionData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_workflow_action_item_form_field_condition_data.py b/rootly_sdk/models/new_workflow_action_item_form_field_condition_data.py index 5fc82e95..22ae4c1a 100644 --- a/rootly_sdk/models/new_workflow_action_item_form_field_condition_data.py +++ b/rootly_sdk/models/new_workflow_action_item_form_field_condition_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class NewWorkflowActionItemFormFieldConditionData: """ type_: NewWorkflowActionItemFormFieldConditionDataType - attributes: NewWorkflowActionItemFormFieldConditionDataAttributes + attributes: "NewWorkflowActionItemFormFieldConditionDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_workflow_action_item_form_field_condition_data_attributes.py b/rootly_sdk/models/new_workflow_action_item_form_field_condition_data_attributes.py index 9e6b01df..06d69d9d 100644 --- a/rootly_sdk/models/new_workflow_action_item_form_field_condition_data_attributes.py +++ b/rootly_sdk/models/new_workflow_action_item_form_field_condition_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -21,73 +19,73 @@ class NewWorkflowActionItemFormFieldConditionDataAttributes: form_field_id (str): The custom field for this condition action_item_condition (NewWorkflowActionItemFormFieldConditionDataAttributesActionItemCondition): The trigger condition Default: 'ANY'. - values (list[str] | Unset): - selected_catalog_entity_ids (list[str] | Unset): - selected_functionality_ids (list[str] | Unset): - selected_group_ids (list[str] | Unset): - selected_option_ids (list[str] | Unset): - selected_service_ids (list[str] | Unset): - selected_user_ids (list[int] | Unset): - selected_cause_ids (list[str] | Unset): - selected_environment_ids (list[str] | Unset): - selected_incident_type_ids (list[str] | Unset): + values (Union[Unset, list[str]]): + selected_catalog_entity_ids (Union[Unset, list[str]]): + selected_functionality_ids (Union[Unset, list[str]]): + selected_group_ids (Union[Unset, list[str]]): + selected_option_ids (Union[Unset, list[str]]): + selected_service_ids (Union[Unset, list[str]]): + selected_user_ids (Union[Unset, list[int]]): + selected_cause_ids (Union[Unset, list[str]]): + selected_environment_ids (Union[Unset, list[str]]): + selected_incident_type_ids (Union[Unset, list[str]]): """ form_field_id: str action_item_condition: NewWorkflowActionItemFormFieldConditionDataAttributesActionItemCondition = "ANY" - values: list[str] | Unset = UNSET - selected_catalog_entity_ids: list[str] | Unset = UNSET - selected_functionality_ids: list[str] | Unset = UNSET - selected_group_ids: list[str] | Unset = UNSET - selected_option_ids: list[str] | Unset = UNSET - selected_service_ids: list[str] | Unset = UNSET - selected_user_ids: list[int] | Unset = UNSET - selected_cause_ids: list[str] | Unset = UNSET - selected_environment_ids: list[str] | Unset = UNSET - selected_incident_type_ids: list[str] | Unset = UNSET + values: Union[Unset, list[str]] = UNSET + selected_catalog_entity_ids: Union[Unset, list[str]] = UNSET + selected_functionality_ids: Union[Unset, list[str]] = UNSET + selected_group_ids: Union[Unset, list[str]] = UNSET + selected_option_ids: Union[Unset, list[str]] = UNSET + selected_service_ids: Union[Unset, list[str]] = UNSET + selected_user_ids: Union[Unset, list[int]] = UNSET + selected_cause_ids: Union[Unset, list[str]] = UNSET + selected_environment_ids: Union[Unset, list[str]] = UNSET + selected_incident_type_ids: Union[Unset, list[str]] = UNSET def to_dict(self) -> dict[str, Any]: form_field_id = self.form_field_id action_item_condition: str = self.action_item_condition - values: list[str] | Unset = UNSET + values: Union[Unset, list[str]] = UNSET if not isinstance(self.values, Unset): values = self.values - selected_catalog_entity_ids: list[str] | Unset = UNSET + selected_catalog_entity_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.selected_catalog_entity_ids, Unset): selected_catalog_entity_ids = self.selected_catalog_entity_ids - selected_functionality_ids: list[str] | Unset = UNSET + selected_functionality_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.selected_functionality_ids, Unset): selected_functionality_ids = self.selected_functionality_ids - selected_group_ids: list[str] | Unset = UNSET + selected_group_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.selected_group_ids, Unset): selected_group_ids = self.selected_group_ids - selected_option_ids: list[str] | Unset = UNSET + selected_option_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.selected_option_ids, Unset): selected_option_ids = self.selected_option_ids - selected_service_ids: list[str] | Unset = UNSET + selected_service_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.selected_service_ids, Unset): selected_service_ids = self.selected_service_ids - selected_user_ids: list[int] | Unset = UNSET + selected_user_ids: Union[Unset, list[int]] = UNSET if not isinstance(self.selected_user_ids, Unset): selected_user_ids = self.selected_user_ids - selected_cause_ids: list[str] | Unset = UNSET + selected_cause_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.selected_cause_ids, Unset): selected_cause_ids = self.selected_cause_ids - selected_environment_ids: list[str] | Unset = UNSET + selected_environment_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.selected_environment_ids, Unset): selected_environment_ids = self.selected_environment_ids - selected_incident_type_ids: list[str] | Unset = UNSET + selected_incident_type_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.selected_incident_type_ids, Unset): selected_incident_type_ids = self.selected_incident_type_ids diff --git a/rootly_sdk/models/new_workflow_custom_field_selection.py b/rootly_sdk/models/new_workflow_custom_field_selection.py index 975e1d93..cd9250c3 100644 --- a/rootly_sdk/models/new_workflow_custom_field_selection.py +++ b/rootly_sdk/models/new_workflow_custom_field_selection.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewWorkflowCustomFieldSelection: data (NewWorkflowCustomFieldSelectionData): """ - data: NewWorkflowCustomFieldSelectionData + data: "NewWorkflowCustomFieldSelectionData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_workflow_custom_field_selection_data.py b/rootly_sdk/models/new_workflow_custom_field_selection_data.py index 7a299699..6c4e4d0b 100644 --- a/rootly_sdk/models/new_workflow_custom_field_selection_data.py +++ b/rootly_sdk/models/new_workflow_custom_field_selection_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class NewWorkflowCustomFieldSelectionData: """ type_: NewWorkflowCustomFieldSelectionDataType - attributes: NewWorkflowCustomFieldSelectionDataAttributes + attributes: "NewWorkflowCustomFieldSelectionDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_workflow_custom_field_selection_data_attributes.py b/rootly_sdk/models/new_workflow_custom_field_selection_data_attributes.py index fecb492e..5658825f 100644 --- a/rootly_sdk/models/new_workflow_custom_field_selection_data_attributes.py +++ b/rootly_sdk/models/new_workflow_custom_field_selection_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -21,16 +19,16 @@ class NewWorkflowCustomFieldSelectionDataAttributes: custom_field_id (int): The custom field for this selection incident_condition (NewWorkflowCustomFieldSelectionDataAttributesIncidentCondition): The trigger condition Default: 'ANY'. - workflow_id (str | Unset): The workflow for this selection - values (list[str] | Unset): - selected_option_ids (list[int] | Unset): + workflow_id (Union[Unset, str]): The workflow for this selection + values (Union[Unset, list[str]]): + selected_option_ids (Union[Unset, list[int]]): """ custom_field_id: int incident_condition: NewWorkflowCustomFieldSelectionDataAttributesIncidentCondition = "ANY" - workflow_id: str | Unset = UNSET - values: list[str] | Unset = UNSET - selected_option_ids: list[int] | Unset = UNSET + workflow_id: Union[Unset, str] = UNSET + values: Union[Unset, list[str]] = UNSET + selected_option_ids: Union[Unset, list[int]] = UNSET def to_dict(self) -> dict[str, Any]: custom_field_id = self.custom_field_id @@ -39,11 +37,11 @@ def to_dict(self) -> dict[str, Any]: workflow_id = self.workflow_id - values: list[str] | Unset = UNSET + values: Union[Unset, list[str]] = UNSET if not isinstance(self.values, Unset): values = self.values - selected_option_ids: list[int] | Unset = UNSET + selected_option_ids: Union[Unset, list[int]] = UNSET if not isinstance(self.selected_option_ids, Unset): selected_option_ids = self.selected_option_ids diff --git a/rootly_sdk/models/new_workflow_data.py b/rootly_sdk/models/new_workflow_data.py index 3cf1a8d0..e3514997 100644 --- a/rootly_sdk/models/new_workflow_data.py +++ b/rootly_sdk/models/new_workflow_data.py @@ -1,10 +1,7 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define -from attrs import field as _attrs_field from ..models.new_workflow_data_type import NewWorkflowDataType, check_new_workflow_data_type @@ -24,17 +21,15 @@ class NewWorkflowData: """ type_: NewWorkflowDataType - attributes: NewWorkflowDataAttributes - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: "NewWorkflowDataAttributes" def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, @@ -58,21 +53,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes=attributes, ) - new_workflow_data.additional_properties = d return new_workflow_data - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/rootly_sdk/models/new_workflow_data_attributes.py b/rootly_sdk/models/new_workflow_data_attributes.py index 8badb4d0..60aa3f04 100644 --- a/rootly_sdk/models/new_workflow_data_attributes.py +++ b/rootly_sdk/models/new_workflow_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -31,69 +29,72 @@ class NewWorkflowDataAttributes: """ Attributes: name (str): The title of the workflow - description (None | str | Unset): The description of the workflow - command (None | str | Unset): Workflow command - command_feedback_enabled (bool | None | Unset): This will notify you back when the workflow is starting - wait (None | str | Unset): Wait this duration before executing - priority (NewWorkflowDataAttributesPriority | Unset): Priority - repeat_every_duration (None | str | Unset): Repeat workflow every duration - repeat_condition_duration_since_first_run (None | str | Unset): The workflow will stop repeating if its runtime - since it's first workflow run exceeds the duration set in this field - repeat_condition_number_of_repeats (int | Unset): The workflow will stop repeating if the number of repeats - exceeds the value set in this field - continuously_repeat (bool | Unset): When continuously repeat is true, repeat workflows aren't automatically - stopped when conditions aren't met. This setting won't override your conditions set by + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + description (Union[None, Unset, str]): The description of the workflow + command (Union[None, Unset, str]): Workflow command + command_feedback_enabled (Union[None, Unset, bool]): This will notify you back when the workflow is starting + wait (Union[None, Unset, str]): Wait this duration before executing + priority (Union[Unset, NewWorkflowDataAttributesPriority]): Priority + repeat_every_duration (Union[None, Unset, str]): Repeat workflow every duration + repeat_condition_duration_since_first_run (Union[None, Unset, str]): The workflow will stop repeating if its + runtime since it's first workflow run exceeds the duration set in this field + repeat_condition_number_of_repeats (Union[Unset, int]): The workflow will stop repeating if the number of + repeats exceeds the value set in this field + continuously_repeat (Union[Unset, bool]): When continuously repeat is true, repeat workflows aren't + automatically stopped when conditions aren't met. This setting won't override your conditions set by repeat_condition_duration_since_first_run and repeat_condition_number_of_repeats parameters. - repeat_on (list[NewWorkflowDataAttributesRepeatOnItem] | Unset): - enabled (bool | Unset): - locked (bool | Unset): Restricts workflow edits to admins when turned on. Only admins can set this field. - position (int | Unset): The order which the workflow should run with other workflows. - workflow_group_id (None | str | Unset): The group this workflow belongs to. - trigger_params (ActionItemTriggerParams | AlertTriggerParams | IncidentTriggerParams | PulseTriggerParams | - SimpleTriggerParams | Unset): - environment_ids (list[str] | Unset): - severity_ids (list[str] | Unset): - incident_type_ids (list[str] | Unset): - incident_role_ids (list[str] | Unset): - service_ids (list[str] | Unset): - functionality_ids (list[str] | Unset): - group_ids (list[str] | Unset): - cause_ids (list[str] | Unset): - sub_status_ids (list[str] | Unset): + repeat_on (Union[Unset, list[NewWorkflowDataAttributesRepeatOnItem]]): + enabled (Union[Unset, bool]): + locked (Union[Unset, bool]): Restricts workflow edits to admins when turned on. Only admins can set this field. + position (Union[Unset, int]): The order which the workflow should run with other workflows. + workflow_group_id (Union[None, Unset, str]): The group this workflow belongs to. + trigger_params (Union['ActionItemTriggerParams', 'AlertTriggerParams', 'IncidentTriggerParams', + 'PulseTriggerParams', 'SimpleTriggerParams', Unset]): + environment_ids (Union[Unset, list[str]]): + severity_ids (Union[Unset, list[str]]): + incident_type_ids (Union[Unset, list[str]]): + incident_role_ids (Union[Unset, list[str]]): + service_ids (Union[Unset, list[str]]): + functionality_ids (Union[Unset, list[str]]): + group_ids (Union[Unset, list[str]]): + cause_ids (Union[Unset, list[str]]): + sub_status_ids (Union[Unset, list[str]]): """ name: str - description: None | str | Unset = UNSET - command: None | str | Unset = UNSET - command_feedback_enabled: bool | None | Unset = UNSET - wait: None | str | Unset = UNSET - priority: NewWorkflowDataAttributesPriority | Unset = UNSET - repeat_every_duration: None | str | Unset = UNSET - repeat_condition_duration_since_first_run: None | str | Unset = UNSET - repeat_condition_number_of_repeats: int | Unset = UNSET - continuously_repeat: bool | Unset = UNSET - repeat_on: list[NewWorkflowDataAttributesRepeatOnItem] | Unset = UNSET - enabled: bool | Unset = UNSET - locked: bool | Unset = UNSET - position: int | Unset = UNSET - workflow_group_id: None | str | Unset = UNSET - trigger_params: ( - ActionItemTriggerParams - | AlertTriggerParams - | IncidentTriggerParams - | PulseTriggerParams - | SimpleTriggerParams - | Unset - ) = UNSET - environment_ids: list[str] | Unset = UNSET - severity_ids: list[str] | Unset = UNSET - incident_type_ids: list[str] | Unset = UNSET - incident_role_ids: list[str] | Unset = UNSET - service_ids: list[str] | Unset = UNSET - functionality_ids: list[str] | Unset = UNSET - group_ids: list[str] | Unset = UNSET - cause_ids: list[str] | Unset = UNSET - sub_status_ids: list[str] | Unset = UNSET + slug: Union[None, Unset, str] = UNSET + description: Union[None, Unset, str] = UNSET + command: Union[None, Unset, str] = UNSET + command_feedback_enabled: Union[None, Unset, bool] = UNSET + wait: Union[None, Unset, str] = UNSET + priority: Union[Unset, NewWorkflowDataAttributesPriority] = UNSET + repeat_every_duration: Union[None, Unset, str] = UNSET + repeat_condition_duration_since_first_run: Union[None, Unset, str] = UNSET + repeat_condition_number_of_repeats: Union[Unset, int] = UNSET + continuously_repeat: Union[Unset, bool] = UNSET + repeat_on: Union[Unset, list[NewWorkflowDataAttributesRepeatOnItem]] = UNSET + enabled: Union[Unset, bool] = UNSET + locked: Union[Unset, bool] = UNSET + position: Union[Unset, int] = UNSET + workflow_group_id: Union[None, Unset, str] = UNSET + trigger_params: Union[ + "ActionItemTriggerParams", + "AlertTriggerParams", + "IncidentTriggerParams", + "PulseTriggerParams", + "SimpleTriggerParams", + Unset, + ] = UNSET + environment_ids: Union[Unset, list[str]] = UNSET + severity_ids: Union[Unset, list[str]] = UNSET + incident_type_ids: Union[Unset, list[str]] = UNSET + incident_role_ids: Union[Unset, list[str]] = UNSET + service_ids: Union[Unset, list[str]] = UNSET + functionality_ids: Union[Unset, list[str]] = UNSET + group_ids: Union[Unset, list[str]] = UNSET + cause_ids: Union[Unset, list[str]] = UNSET + sub_status_ids: Union[Unset, list[str]] = UNSET def to_dict(self) -> dict[str, Any]: from ..models.action_item_trigger_params import ActionItemTriggerParams @@ -103,41 +104,47 @@ def to_dict(self) -> dict[str, Any]: name = self.name - description: None | str | Unset + slug: Union[None, Unset, str] + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug + + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: description = self.description - command: None | str | Unset + command: Union[None, Unset, str] if isinstance(self.command, Unset): command = UNSET else: command = self.command - command_feedback_enabled: bool | None | Unset + command_feedback_enabled: Union[None, Unset, bool] if isinstance(self.command_feedback_enabled, Unset): command_feedback_enabled = UNSET else: command_feedback_enabled = self.command_feedback_enabled - wait: None | str | Unset + wait: Union[None, Unset, str] if isinstance(self.wait, Unset): wait = UNSET else: wait = self.wait - priority: str | Unset = UNSET + priority: Union[Unset, str] = UNSET if not isinstance(self.priority, Unset): priority = self.priority - repeat_every_duration: None | str | Unset + repeat_every_duration: Union[None, Unset, str] if isinstance(self.repeat_every_duration, Unset): repeat_every_duration = UNSET else: repeat_every_duration = self.repeat_every_duration - repeat_condition_duration_since_first_run: None | str | Unset + repeat_condition_duration_since_first_run: Union[None, Unset, str] if isinstance(self.repeat_condition_duration_since_first_run, Unset): repeat_condition_duration_since_first_run = UNSET else: @@ -147,7 +154,7 @@ def to_dict(self) -> dict[str, Any]: continuously_repeat = self.continuously_repeat - repeat_on: list[str] | Unset = UNSET + repeat_on: Union[Unset, list[str]] = UNSET if not isinstance(self.repeat_on, Unset): repeat_on = [] for repeat_on_item_data in self.repeat_on: @@ -160,13 +167,13 @@ def to_dict(self) -> dict[str, Any]: position = self.position - workflow_group_id: None | str | Unset + workflow_group_id: Union[None, Unset, str] if isinstance(self.workflow_group_id, Unset): workflow_group_id = UNSET else: workflow_group_id = self.workflow_group_id - trigger_params: dict[str, Any] | Unset + trigger_params: Union[Unset, dict[str, Any]] if isinstance(self.trigger_params, Unset): trigger_params = UNSET elif isinstance(self.trigger_params, IncidentTriggerParams): @@ -180,39 +187,39 @@ def to_dict(self) -> dict[str, Any]: else: trigger_params = self.trigger_params.to_dict() - environment_ids: list[str] | Unset = UNSET + environment_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.environment_ids, Unset): environment_ids = self.environment_ids - severity_ids: list[str] | Unset = UNSET + severity_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.severity_ids, Unset): severity_ids = self.severity_ids - incident_type_ids: list[str] | Unset = UNSET + incident_type_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.incident_type_ids, Unset): incident_type_ids = self.incident_type_ids - incident_role_ids: list[str] | Unset = UNSET + incident_role_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.incident_role_ids, Unset): incident_role_ids = self.incident_role_ids - service_ids: list[str] | Unset = UNSET + service_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.service_ids, Unset): service_ids = self.service_ids - functionality_ids: list[str] | Unset = UNSET + functionality_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.functionality_ids, Unset): functionality_ids = self.functionality_ids - group_ids: list[str] | Unset = UNSET + group_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.group_ids, Unset): group_ids = self.group_ids - cause_ids: list[str] | Unset = UNSET + cause_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.cause_ids, Unset): cause_ids = self.cause_ids - sub_status_ids: list[str] | Unset = UNSET + sub_status_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.sub_status_ids, Unset): sub_status_ids = self.sub_status_ids @@ -223,6 +230,8 @@ def to_dict(self) -> dict[str, Any]: "name": name, } ) + if slug is not UNSET: + field_dict["slug"] = slug if description is not UNSET: field_dict["description"] = description if command is not UNSET: @@ -285,64 +294,73 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name") - def _parse_description(data: object) -> None | str | Unset: + def _parse_slug(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) + + slug = _parse_slug(d.pop("slug", UNSET)) + + def _parse_description(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) - def _parse_command(data: object) -> None | str | Unset: + def _parse_command(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) command = _parse_command(d.pop("command", UNSET)) - def _parse_command_feedback_enabled(data: object) -> bool | None | Unset: + def _parse_command_feedback_enabled(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) command_feedback_enabled = _parse_command_feedback_enabled(d.pop("command_feedback_enabled", UNSET)) - def _parse_wait(data: object) -> None | str | Unset: + def _parse_wait(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) wait = _parse_wait(d.pop("wait", UNSET)) _priority = d.pop("priority", UNSET) - priority: NewWorkflowDataAttributesPriority | Unset + priority: Union[Unset, NewWorkflowDataAttributesPriority] if isinstance(_priority, Unset): priority = UNSET else: priority = check_new_workflow_data_attributes_priority(_priority) - def _parse_repeat_every_duration(data: object) -> None | str | Unset: + def _parse_repeat_every_duration(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) repeat_every_duration = _parse_repeat_every_duration(d.pop("repeat_every_duration", UNSET)) - def _parse_repeat_condition_duration_since_first_run(data: object) -> None | str | Unset: + def _parse_repeat_condition_duration_since_first_run(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) repeat_condition_duration_since_first_run = _parse_repeat_condition_duration_since_first_run( d.pop("repeat_condition_duration_since_first_run", UNSET) @@ -352,14 +370,12 @@ def _parse_repeat_condition_duration_since_first_run(data: object) -> None | str continuously_repeat = d.pop("continuously_repeat", UNSET) + repeat_on = [] _repeat_on = d.pop("repeat_on", UNSET) - repeat_on: list[NewWorkflowDataAttributesRepeatOnItem] | Unset = UNSET - if _repeat_on is not UNSET: - repeat_on = [] - for repeat_on_item_data in _repeat_on: - repeat_on_item = check_new_workflow_data_attributes_repeat_on_item(repeat_on_item_data) + for repeat_on_item_data in _repeat_on or []: + repeat_on_item = check_new_workflow_data_attributes_repeat_on_item(repeat_on_item_data) - repeat_on.append(repeat_on_item) + repeat_on.append(repeat_on_item) enabled = d.pop("enabled", UNSET) @@ -367,25 +383,25 @@ def _parse_repeat_condition_duration_since_first_run(data: object) -> None | str position = d.pop("position", UNSET) - def _parse_workflow_group_id(data: object) -> None | str | Unset: + def _parse_workflow_group_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) workflow_group_id = _parse_workflow_group_id(d.pop("workflow_group_id", UNSET)) def _parse_trigger_params( data: object, - ) -> ( - ActionItemTriggerParams - | AlertTriggerParams - | IncidentTriggerParams - | PulseTriggerParams - | SimpleTriggerParams - | Unset - ): + ) -> Union[ + "ActionItemTriggerParams", + "AlertTriggerParams", + "IncidentTriggerParams", + "PulseTriggerParams", + "SimpleTriggerParams", + Unset, + ]: if isinstance(data, Unset): return data try: @@ -394,7 +410,7 @@ def _parse_trigger_params( trigger_params_type_0 = IncidentTriggerParams.from_dict(data) return trigger_params_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -402,7 +418,7 @@ def _parse_trigger_params( trigger_params_type_1 = ActionItemTriggerParams.from_dict(data) return trigger_params_type_1 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -410,7 +426,7 @@ def _parse_trigger_params( trigger_params_type_2 = AlertTriggerParams.from_dict(data) return trigger_params_type_2 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -418,7 +434,7 @@ def _parse_trigger_params( trigger_params_type_3 = PulseTriggerParams.from_dict(data) return trigger_params_type_3 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass if not isinstance(data, dict): raise TypeError() @@ -448,6 +464,7 @@ def _parse_trigger_params( new_workflow_data_attributes = cls( name=name, + slug=slug, description=description, command=command, command_feedback_enabled=command_feedback_enabled, diff --git a/rootly_sdk/models/new_workflow_form_field_condition.py b/rootly_sdk/models/new_workflow_form_field_condition.py index ac32f11d..37f162dc 100644 --- a/rootly_sdk/models/new_workflow_form_field_condition.py +++ b/rootly_sdk/models/new_workflow_form_field_condition.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewWorkflowFormFieldCondition: data (NewWorkflowFormFieldConditionData): """ - data: NewWorkflowFormFieldConditionData + data: "NewWorkflowFormFieldConditionData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_workflow_form_field_condition_data.py b/rootly_sdk/models/new_workflow_form_field_condition_data.py index ccbc5b02..f5fef4a1 100644 --- a/rootly_sdk/models/new_workflow_form_field_condition_data.py +++ b/rootly_sdk/models/new_workflow_form_field_condition_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class NewWorkflowFormFieldConditionData: """ type_: NewWorkflowFormFieldConditionDataType - attributes: NewWorkflowFormFieldConditionDataAttributes + attributes: "NewWorkflowFormFieldConditionDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_workflow_form_field_condition_data_attributes.py b/rootly_sdk/models/new_workflow_form_field_condition_data_attributes.py index 5c662698..dc1dbdee 100644 --- a/rootly_sdk/models/new_workflow_form_field_condition_data_attributes.py +++ b/rootly_sdk/models/new_workflow_form_field_condition_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -21,32 +19,32 @@ class NewWorkflowFormFieldConditionDataAttributes: form_field_id (str): The custom field for this condition incident_condition (NewWorkflowFormFieldConditionDataAttributesIncidentCondition): The trigger condition Default: 'ANY'. - workflow_id (str | Unset): The workflow for this condition - values (list[str] | Unset): - selected_catalog_entity_ids (list[str] | Unset): - selected_functionality_ids (list[str] | Unset): - selected_group_ids (list[str] | Unset): - selected_option_ids (list[str] | Unset): - selected_service_ids (list[str] | Unset): - selected_user_ids (list[int] | Unset): - selected_cause_ids (list[str] | Unset): - selected_environment_ids (list[str] | Unset): - selected_incident_type_ids (list[str] | Unset): + workflow_id (Union[Unset, str]): The workflow for this condition + values (Union[Unset, list[str]]): + selected_catalog_entity_ids (Union[Unset, list[str]]): + selected_functionality_ids (Union[Unset, list[str]]): + selected_group_ids (Union[Unset, list[str]]): + selected_option_ids (Union[Unset, list[str]]): + selected_service_ids (Union[Unset, list[str]]): + selected_user_ids (Union[Unset, list[int]]): + selected_cause_ids (Union[Unset, list[str]]): + selected_environment_ids (Union[Unset, list[str]]): + selected_incident_type_ids (Union[Unset, list[str]]): """ form_field_id: str incident_condition: NewWorkflowFormFieldConditionDataAttributesIncidentCondition = "ANY" - workflow_id: str | Unset = UNSET - values: list[str] | Unset = UNSET - selected_catalog_entity_ids: list[str] | Unset = UNSET - selected_functionality_ids: list[str] | Unset = UNSET - selected_group_ids: list[str] | Unset = UNSET - selected_option_ids: list[str] | Unset = UNSET - selected_service_ids: list[str] | Unset = UNSET - selected_user_ids: list[int] | Unset = UNSET - selected_cause_ids: list[str] | Unset = UNSET - selected_environment_ids: list[str] | Unset = UNSET - selected_incident_type_ids: list[str] | Unset = UNSET + workflow_id: Union[Unset, str] = UNSET + values: Union[Unset, list[str]] = UNSET + selected_catalog_entity_ids: Union[Unset, list[str]] = UNSET + selected_functionality_ids: Union[Unset, list[str]] = UNSET + selected_group_ids: Union[Unset, list[str]] = UNSET + selected_option_ids: Union[Unset, list[str]] = UNSET + selected_service_ids: Union[Unset, list[str]] = UNSET + selected_user_ids: Union[Unset, list[int]] = UNSET + selected_cause_ids: Union[Unset, list[str]] = UNSET + selected_environment_ids: Union[Unset, list[str]] = UNSET + selected_incident_type_ids: Union[Unset, list[str]] = UNSET def to_dict(self) -> dict[str, Any]: form_field_id = self.form_field_id @@ -55,43 +53,43 @@ def to_dict(self) -> dict[str, Any]: workflow_id = self.workflow_id - values: list[str] | Unset = UNSET + values: Union[Unset, list[str]] = UNSET if not isinstance(self.values, Unset): values = self.values - selected_catalog_entity_ids: list[str] | Unset = UNSET + selected_catalog_entity_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.selected_catalog_entity_ids, Unset): selected_catalog_entity_ids = self.selected_catalog_entity_ids - selected_functionality_ids: list[str] | Unset = UNSET + selected_functionality_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.selected_functionality_ids, Unset): selected_functionality_ids = self.selected_functionality_ids - selected_group_ids: list[str] | Unset = UNSET + selected_group_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.selected_group_ids, Unset): selected_group_ids = self.selected_group_ids - selected_option_ids: list[str] | Unset = UNSET + selected_option_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.selected_option_ids, Unset): selected_option_ids = self.selected_option_ids - selected_service_ids: list[str] | Unset = UNSET + selected_service_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.selected_service_ids, Unset): selected_service_ids = self.selected_service_ids - selected_user_ids: list[int] | Unset = UNSET + selected_user_ids: Union[Unset, list[int]] = UNSET if not isinstance(self.selected_user_ids, Unset): selected_user_ids = self.selected_user_ids - selected_cause_ids: list[str] | Unset = UNSET + selected_cause_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.selected_cause_ids, Unset): selected_cause_ids = self.selected_cause_ids - selected_environment_ids: list[str] | Unset = UNSET + selected_environment_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.selected_environment_ids, Unset): selected_environment_ids = self.selected_environment_ids - selected_incident_type_ids: list[str] | Unset = UNSET + selected_incident_type_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.selected_incident_type_ids, Unset): selected_incident_type_ids = self.selected_incident_type_ids diff --git a/rootly_sdk/models/new_workflow_group.py b/rootly_sdk/models/new_workflow_group.py index cbe30f10..bbfbb047 100644 --- a/rootly_sdk/models/new_workflow_group.py +++ b/rootly_sdk/models/new_workflow_group.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewWorkflowGroup: data (NewWorkflowGroupData): """ - data: NewWorkflowGroupData + data: "NewWorkflowGroupData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_workflow_group_data.py b/rootly_sdk/models/new_workflow_group_data.py index 00fab324..5f6b9600 100644 --- a/rootly_sdk/models/new_workflow_group_data.py +++ b/rootly_sdk/models/new_workflow_group_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class NewWorkflowGroupData: """ type_: NewWorkflowGroupDataType - attributes: NewWorkflowGroupDataAttributes + attributes: "NewWorkflowGroupDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_workflow_group_data_attributes.py b/rootly_sdk/models/new_workflow_group_data_attributes.py index 29d5a22d..c95066e2 100644 --- a/rootly_sdk/models/new_workflow_group_data_attributes.py +++ b/rootly_sdk/models/new_workflow_group_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -20,29 +18,38 @@ class NewWorkflowGroupDataAttributes: """ Attributes: name (str): The name of the workflow group. - kind (NewWorkflowGroupDataAttributesKind | Unset): The kind of the workflow group - description (None | str | Unset): A description of the workflow group. - icon (str | Unset): An emoji icon displayed next to the workflow group. - expanded (bool | Unset): Whether the group is expanded or collapsed. - position (int | Unset): The position of the workflow group + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name` and `kind`; any submitted value is + ignored. This property will be removed from the request schema in a future version. + kind (Union[Unset, NewWorkflowGroupDataAttributesKind]): The kind of the workflow group + description (Union[None, Unset, str]): A description of the workflow group. + icon (Union[Unset, str]): An emoji icon displayed next to the workflow group. + expanded (Union[Unset, bool]): Whether the group is expanded or collapsed. + position (Union[Unset, int]): The position of the workflow group """ name: str - kind: NewWorkflowGroupDataAttributesKind | Unset = UNSET - description: None | str | Unset = UNSET - icon: str | Unset = UNSET - expanded: bool | Unset = UNSET - position: int | Unset = UNSET + slug: Union[None, Unset, str] = UNSET + kind: Union[Unset, NewWorkflowGroupDataAttributesKind] = UNSET + description: Union[None, Unset, str] = UNSET + icon: Union[Unset, str] = UNSET + expanded: Union[Unset, bool] = UNSET + position: Union[Unset, int] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: name = self.name - kind: str | Unset = UNSET + slug: Union[None, Unset, str] + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug + + kind: Union[Unset, str] = UNSET if not isinstance(self.kind, Unset): kind = self.kind - description: None | str | Unset + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: @@ -61,6 +68,8 @@ def to_dict(self) -> dict[str, Any]: "name": name, } ) + if slug is not UNSET: + field_dict["slug"] = slug if kind is not UNSET: field_dict["kind"] = kind if description is not UNSET: @@ -79,19 +88,28 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name") + def _parse_slug(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + slug = _parse_slug(d.pop("slug", UNSET)) + _kind = d.pop("kind", UNSET) - kind: NewWorkflowGroupDataAttributesKind | Unset + kind: Union[Unset, NewWorkflowGroupDataAttributesKind] if isinstance(_kind, Unset): kind = UNSET else: kind = check_new_workflow_group_data_attributes_kind(_kind) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) @@ -103,6 +121,7 @@ def _parse_description(data: object) -> None | str | Unset: new_workflow_group_data_attributes = cls( name=name, + slug=slug, kind=kind, description=description, icon=icon, diff --git a/rootly_sdk/models/new_workflow_run.py b/rootly_sdk/models/new_workflow_run.py index 489e4c89..877a070c 100644 --- a/rootly_sdk/models/new_workflow_run.py +++ b/rootly_sdk/models/new_workflow_run.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewWorkflowRun: data (NewWorkflowRunData): """ - data: NewWorkflowRunData + data: "NewWorkflowRunData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_workflow_run_data.py b/rootly_sdk/models/new_workflow_run_data.py index 6f30cb5c..3d35b9ab 100644 --- a/rootly_sdk/models/new_workflow_run_data.py +++ b/rootly_sdk/models/new_workflow_run_data.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -25,20 +23,20 @@ class NewWorkflowRunData: """ Attributes: type_ (NewWorkflowRunDataType): - attributes (NewWorkflowRunDataAttributesType0 | NewWorkflowRunDataAttributesType1 | - NewWorkflowRunDataAttributesType2 | NewWorkflowRunDataAttributesType3 | NewWorkflowRunDataAttributesType4 | - NewWorkflowRunDataAttributesType5): + attributes (Union['NewWorkflowRunDataAttributesType0', 'NewWorkflowRunDataAttributesType1', + 'NewWorkflowRunDataAttributesType2', 'NewWorkflowRunDataAttributesType3', 'NewWorkflowRunDataAttributesType4', + 'NewWorkflowRunDataAttributesType5']): """ type_: NewWorkflowRunDataType - attributes: ( - NewWorkflowRunDataAttributesType0 - | NewWorkflowRunDataAttributesType1 - | NewWorkflowRunDataAttributesType2 - | NewWorkflowRunDataAttributesType3 - | NewWorkflowRunDataAttributesType4 - | NewWorkflowRunDataAttributesType5 - ) + attributes: Union[ + "NewWorkflowRunDataAttributesType0", + "NewWorkflowRunDataAttributesType1", + "NewWorkflowRunDataAttributesType2", + "NewWorkflowRunDataAttributesType3", + "NewWorkflowRunDataAttributesType4", + "NewWorkflowRunDataAttributesType5", + ] additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -89,21 +87,21 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: def _parse_attributes( data: object, - ) -> ( - NewWorkflowRunDataAttributesType0 - | NewWorkflowRunDataAttributesType1 - | NewWorkflowRunDataAttributesType2 - | NewWorkflowRunDataAttributesType3 - | NewWorkflowRunDataAttributesType4 - | NewWorkflowRunDataAttributesType5 - ): + ) -> Union[ + "NewWorkflowRunDataAttributesType0", + "NewWorkflowRunDataAttributesType1", + "NewWorkflowRunDataAttributesType2", + "NewWorkflowRunDataAttributesType3", + "NewWorkflowRunDataAttributesType4", + "NewWorkflowRunDataAttributesType5", + ]: try: if not isinstance(data, dict): raise TypeError() attributes_type_0 = NewWorkflowRunDataAttributesType0.from_dict(data) return attributes_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -111,7 +109,7 @@ def _parse_attributes( attributes_type_1 = NewWorkflowRunDataAttributesType1.from_dict(data) return attributes_type_1 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -119,7 +117,7 @@ def _parse_attributes( attributes_type_2 = NewWorkflowRunDataAttributesType2.from_dict(data) return attributes_type_2 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -127,7 +125,7 @@ def _parse_attributes( attributes_type_3 = NewWorkflowRunDataAttributesType3.from_dict(data) return attributes_type_3 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -135,7 +133,7 @@ def _parse_attributes( attributes_type_4 = NewWorkflowRunDataAttributesType4.from_dict(data) return attributes_type_4 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass if not isinstance(data, dict): raise TypeError() diff --git a/rootly_sdk/models/new_workflow_run_data_attributes_type_0.py b/rootly_sdk/models/new_workflow_run_data_attributes_type_0.py index 75346b25..f02eb4ff 100644 --- a/rootly_sdk/models/new_workflow_run_data_attributes_type_0.py +++ b/rootly_sdk/models/new_workflow_run_data_attributes_type_0.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,33 +17,32 @@ class NewWorkflowRunDataAttributesType0: """ Attributes: - immediate (bool | None | Unset): If false, this will respect wait time configured on the workflow. Default: + immediate (Union[None, Unset, bool]): If false, this will respect wait time configured on the workflow. Default: True. - check_conditions (bool | None | Unset): If true, this will check conditions. If conditions are not satisfied the - run will not be created. Default: False. - context (NewWorkflowRunDataAttributesType0Context | Unset): + check_conditions (Union[None, Unset, bool]): If true, this will check conditions. If conditions are not + satisfied the run will not be created. Default: False. + context (Union[Unset, NewWorkflowRunDataAttributesType0Context]): """ - immediate: bool | None | Unset = True - check_conditions: bool | None | Unset = False - context: NewWorkflowRunDataAttributesType0Context | Unset = UNSET + immediate: Union[None, Unset, bool] = True + check_conditions: Union[None, Unset, bool] = False + context: Union[Unset, "NewWorkflowRunDataAttributesType0Context"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - - immediate: bool | None | Unset + immediate: Union[None, Unset, bool] if isinstance(self.immediate, Unset): immediate = UNSET else: immediate = self.immediate - check_conditions: bool | None | Unset + check_conditions: Union[None, Unset, bool] if isinstance(self.check_conditions, Unset): check_conditions = UNSET else: check_conditions = self.check_conditions - context: dict[str, Any] | Unset = UNSET + context: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.context, Unset): context = self.context.to_dict() @@ -67,26 +64,26 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_immediate(data: object) -> bool | None | Unset: + def _parse_immediate(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) immediate = _parse_immediate(d.pop("immediate", UNSET)) - def _parse_check_conditions(data: object) -> bool | None | Unset: + def _parse_check_conditions(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) check_conditions = _parse_check_conditions(d.pop("check_conditions", UNSET)) _context = d.pop("context", UNSET) - context: NewWorkflowRunDataAttributesType0Context | Unset + context: Union[Unset, NewWorkflowRunDataAttributesType0Context] if isinstance(_context, Unset): context = UNSET else: diff --git a/rootly_sdk/models/new_workflow_run_data_attributes_type_0_context.py b/rootly_sdk/models/new_workflow_run_data_attributes_type_0_context.py index 9bce16b4..14da9532 100644 --- a/rootly_sdk/models/new_workflow_run_data_attributes_type_0_context.py +++ b/rootly_sdk/models/new_workflow_run_data_attributes_type_0_context.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,7 +14,6 @@ class NewWorkflowRunDataAttributesType0Context: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) diff --git a/rootly_sdk/models/new_workflow_run_data_attributes_type_1.py b/rootly_sdk/models/new_workflow_run_data_attributes_type_1.py index 9bc7f2a1..0d8099a0 100644 --- a/rootly_sdk/models/new_workflow_run_data_attributes_type_1.py +++ b/rootly_sdk/models/new_workflow_run_data_attributes_type_1.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -20,35 +18,35 @@ class NewWorkflowRunDataAttributesType1: """ Attributes: incident_id (str): - immediate (bool | None | Unset): If false, this will respect wait time configured on the workflow Default: True. - check_conditions (bool | None | Unset): If true, this will check conditions. If conditions are not satisfied the - run will not be created Default: False. - context (NewWorkflowRunDataAttributesType1Context | Unset): + immediate (Union[None, Unset, bool]): If false, this will respect wait time configured on the workflow Default: + True. + check_conditions (Union[None, Unset, bool]): If true, this will check conditions. If conditions are not + satisfied the run will not be created Default: False. + context (Union[Unset, NewWorkflowRunDataAttributesType1Context]): """ incident_id: str - immediate: bool | None | Unset = True - check_conditions: bool | None | Unset = False - context: NewWorkflowRunDataAttributesType1Context | Unset = UNSET + immediate: Union[None, Unset, bool] = True + check_conditions: Union[None, Unset, bool] = False + context: Union[Unset, "NewWorkflowRunDataAttributesType1Context"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - incident_id = self.incident_id - immediate: bool | None | Unset + immediate: Union[None, Unset, bool] if isinstance(self.immediate, Unset): immediate = UNSET else: immediate = self.immediate - check_conditions: bool | None | Unset + check_conditions: Union[None, Unset, bool] if isinstance(self.check_conditions, Unset): check_conditions = UNSET else: check_conditions = self.check_conditions - context: dict[str, Any] | Unset = UNSET + context: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.context, Unset): context = self.context.to_dict() @@ -75,26 +73,26 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) incident_id = d.pop("incident_id") - def _parse_immediate(data: object) -> bool | None | Unset: + def _parse_immediate(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) immediate = _parse_immediate(d.pop("immediate", UNSET)) - def _parse_check_conditions(data: object) -> bool | None | Unset: + def _parse_check_conditions(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) check_conditions = _parse_check_conditions(d.pop("check_conditions", UNSET)) _context = d.pop("context", UNSET) - context: NewWorkflowRunDataAttributesType1Context | Unset + context: Union[Unset, NewWorkflowRunDataAttributesType1Context] if isinstance(_context, Unset): context = UNSET else: diff --git a/rootly_sdk/models/new_workflow_run_data_attributes_type_1_context.py b/rootly_sdk/models/new_workflow_run_data_attributes_type_1_context.py index 20304b26..eaaac054 100644 --- a/rootly_sdk/models/new_workflow_run_data_attributes_type_1_context.py +++ b/rootly_sdk/models/new_workflow_run_data_attributes_type_1_context.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,7 +14,6 @@ class NewWorkflowRunDataAttributesType1Context: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) diff --git a/rootly_sdk/models/new_workflow_run_data_attributes_type_2.py b/rootly_sdk/models/new_workflow_run_data_attributes_type_2.py index 7e8c4507..2a550f68 100644 --- a/rootly_sdk/models/new_workflow_run_data_attributes_type_2.py +++ b/rootly_sdk/models/new_workflow_run_data_attributes_type_2.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -20,35 +18,35 @@ class NewWorkflowRunDataAttributesType2: """ Attributes: post_mortem_id (str): - immediate (bool | None | Unset): If false, this will respect wait time configured on the workflow Default: True. - check_conditions (bool | None | Unset): If true, this will check conditions. If conditions are not satisfied the - run will not be created Default: False. - context (NewWorkflowRunDataAttributesType2Context | Unset): + immediate (Union[None, Unset, bool]): If false, this will respect wait time configured on the workflow Default: + True. + check_conditions (Union[None, Unset, bool]): If true, this will check conditions. If conditions are not + satisfied the run will not be created Default: False. + context (Union[Unset, NewWorkflowRunDataAttributesType2Context]): """ post_mortem_id: str - immediate: bool | None | Unset = True - check_conditions: bool | None | Unset = False - context: NewWorkflowRunDataAttributesType2Context | Unset = UNSET + immediate: Union[None, Unset, bool] = True + check_conditions: Union[None, Unset, bool] = False + context: Union[Unset, "NewWorkflowRunDataAttributesType2Context"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - post_mortem_id = self.post_mortem_id - immediate: bool | None | Unset + immediate: Union[None, Unset, bool] if isinstance(self.immediate, Unset): immediate = UNSET else: immediate = self.immediate - check_conditions: bool | None | Unset + check_conditions: Union[None, Unset, bool] if isinstance(self.check_conditions, Unset): check_conditions = UNSET else: check_conditions = self.check_conditions - context: dict[str, Any] | Unset = UNSET + context: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.context, Unset): context = self.context.to_dict() @@ -75,26 +73,26 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) post_mortem_id = d.pop("post_mortem_id") - def _parse_immediate(data: object) -> bool | None | Unset: + def _parse_immediate(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) immediate = _parse_immediate(d.pop("immediate", UNSET)) - def _parse_check_conditions(data: object) -> bool | None | Unset: + def _parse_check_conditions(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) check_conditions = _parse_check_conditions(d.pop("check_conditions", UNSET)) _context = d.pop("context", UNSET) - context: NewWorkflowRunDataAttributesType2Context | Unset + context: Union[Unset, NewWorkflowRunDataAttributesType2Context] if isinstance(_context, Unset): context = UNSET else: diff --git a/rootly_sdk/models/new_workflow_run_data_attributes_type_2_context.py b/rootly_sdk/models/new_workflow_run_data_attributes_type_2_context.py index 739fa7bc..70834bdd 100644 --- a/rootly_sdk/models/new_workflow_run_data_attributes_type_2_context.py +++ b/rootly_sdk/models/new_workflow_run_data_attributes_type_2_context.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,7 +14,6 @@ class NewWorkflowRunDataAttributesType2Context: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) diff --git a/rootly_sdk/models/new_workflow_run_data_attributes_type_3.py b/rootly_sdk/models/new_workflow_run_data_attributes_type_3.py index 4b82e605..cf3abb0d 100644 --- a/rootly_sdk/models/new_workflow_run_data_attributes_type_3.py +++ b/rootly_sdk/models/new_workflow_run_data_attributes_type_3.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -20,35 +18,35 @@ class NewWorkflowRunDataAttributesType3: """ Attributes: action_item_id (str): - immediate (bool | None | Unset): If false, this will respect wait time configured on the workflow Default: True. - check_conditions (bool | None | Unset): If true, this will check conditions. If conditions are not satisfied the - run will not be created Default: False. - context (NewWorkflowRunDataAttributesType3Context | Unset): + immediate (Union[None, Unset, bool]): If false, this will respect wait time configured on the workflow Default: + True. + check_conditions (Union[None, Unset, bool]): If true, this will check conditions. If conditions are not + satisfied the run will not be created Default: False. + context (Union[Unset, NewWorkflowRunDataAttributesType3Context]): """ action_item_id: str - immediate: bool | None | Unset = True - check_conditions: bool | None | Unset = False - context: NewWorkflowRunDataAttributesType3Context | Unset = UNSET + immediate: Union[None, Unset, bool] = True + check_conditions: Union[None, Unset, bool] = False + context: Union[Unset, "NewWorkflowRunDataAttributesType3Context"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - action_item_id = self.action_item_id - immediate: bool | None | Unset + immediate: Union[None, Unset, bool] if isinstance(self.immediate, Unset): immediate = UNSET else: immediate = self.immediate - check_conditions: bool | None | Unset + check_conditions: Union[None, Unset, bool] if isinstance(self.check_conditions, Unset): check_conditions = UNSET else: check_conditions = self.check_conditions - context: dict[str, Any] | Unset = UNSET + context: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.context, Unset): context = self.context.to_dict() @@ -75,26 +73,26 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) action_item_id = d.pop("action_item_id") - def _parse_immediate(data: object) -> bool | None | Unset: + def _parse_immediate(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) immediate = _parse_immediate(d.pop("immediate", UNSET)) - def _parse_check_conditions(data: object) -> bool | None | Unset: + def _parse_check_conditions(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) check_conditions = _parse_check_conditions(d.pop("check_conditions", UNSET)) _context = d.pop("context", UNSET) - context: NewWorkflowRunDataAttributesType3Context | Unset + context: Union[Unset, NewWorkflowRunDataAttributesType3Context] if isinstance(_context, Unset): context = UNSET else: diff --git a/rootly_sdk/models/new_workflow_run_data_attributes_type_3_context.py b/rootly_sdk/models/new_workflow_run_data_attributes_type_3_context.py index 25eabc0f..dd12425a 100644 --- a/rootly_sdk/models/new_workflow_run_data_attributes_type_3_context.py +++ b/rootly_sdk/models/new_workflow_run_data_attributes_type_3_context.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,7 +14,6 @@ class NewWorkflowRunDataAttributesType3Context: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) diff --git a/rootly_sdk/models/new_workflow_run_data_attributes_type_4.py b/rootly_sdk/models/new_workflow_run_data_attributes_type_4.py index b55b35af..e5ac19c1 100644 --- a/rootly_sdk/models/new_workflow_run_data_attributes_type_4.py +++ b/rootly_sdk/models/new_workflow_run_data_attributes_type_4.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -20,35 +18,35 @@ class NewWorkflowRunDataAttributesType4: """ Attributes: alert_id (str): - immediate (bool | None | Unset): If false, this will respect wait time configured on the workflow Default: True. - check_conditions (bool | None | Unset): If true, this will check conditions. If conditions are not satisfied the - run will not be created Default: False. - context (NewWorkflowRunDataAttributesType4Context | Unset): + immediate (Union[None, Unset, bool]): If false, this will respect wait time configured on the workflow Default: + True. + check_conditions (Union[None, Unset, bool]): If true, this will check conditions. If conditions are not + satisfied the run will not be created Default: False. + context (Union[Unset, NewWorkflowRunDataAttributesType4Context]): """ alert_id: str - immediate: bool | None | Unset = True - check_conditions: bool | None | Unset = False - context: NewWorkflowRunDataAttributesType4Context | Unset = UNSET + immediate: Union[None, Unset, bool] = True + check_conditions: Union[None, Unset, bool] = False + context: Union[Unset, "NewWorkflowRunDataAttributesType4Context"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - alert_id = self.alert_id - immediate: bool | None | Unset + immediate: Union[None, Unset, bool] if isinstance(self.immediate, Unset): immediate = UNSET else: immediate = self.immediate - check_conditions: bool | None | Unset + check_conditions: Union[None, Unset, bool] if isinstance(self.check_conditions, Unset): check_conditions = UNSET else: check_conditions = self.check_conditions - context: dict[str, Any] | Unset = UNSET + context: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.context, Unset): context = self.context.to_dict() @@ -75,26 +73,26 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) alert_id = d.pop("alert_id") - def _parse_immediate(data: object) -> bool | None | Unset: + def _parse_immediate(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) immediate = _parse_immediate(d.pop("immediate", UNSET)) - def _parse_check_conditions(data: object) -> bool | None | Unset: + def _parse_check_conditions(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) check_conditions = _parse_check_conditions(d.pop("check_conditions", UNSET)) _context = d.pop("context", UNSET) - context: NewWorkflowRunDataAttributesType4Context | Unset + context: Union[Unset, NewWorkflowRunDataAttributesType4Context] if isinstance(_context, Unset): context = UNSET else: diff --git a/rootly_sdk/models/new_workflow_run_data_attributes_type_4_context.py b/rootly_sdk/models/new_workflow_run_data_attributes_type_4_context.py index 8c969b82..c29a13ef 100644 --- a/rootly_sdk/models/new_workflow_run_data_attributes_type_4_context.py +++ b/rootly_sdk/models/new_workflow_run_data_attributes_type_4_context.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,7 +14,6 @@ class NewWorkflowRunDataAttributesType4Context: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) diff --git a/rootly_sdk/models/new_workflow_run_data_attributes_type_5.py b/rootly_sdk/models/new_workflow_run_data_attributes_type_5.py index 797c45f2..1e2b9a66 100644 --- a/rootly_sdk/models/new_workflow_run_data_attributes_type_5.py +++ b/rootly_sdk/models/new_workflow_run_data_attributes_type_5.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -20,35 +18,35 @@ class NewWorkflowRunDataAttributesType5: """ Attributes: pulse_id (str): - immediate (bool | None | Unset): If false, this will respect wait time configured on the workflow Default: True. - check_conditions (bool | None | Unset): If true, this will check conditions. If conditions are not satisfied the - run will not be created Default: False. - context (NewWorkflowRunDataAttributesType5Context | Unset): + immediate (Union[None, Unset, bool]): If false, this will respect wait time configured on the workflow Default: + True. + check_conditions (Union[None, Unset, bool]): If true, this will check conditions. If conditions are not + satisfied the run will not be created Default: False. + context (Union[Unset, NewWorkflowRunDataAttributesType5Context]): """ pulse_id: str - immediate: bool | None | Unset = True - check_conditions: bool | None | Unset = False - context: NewWorkflowRunDataAttributesType5Context | Unset = UNSET + immediate: Union[None, Unset, bool] = True + check_conditions: Union[None, Unset, bool] = False + context: Union[Unset, "NewWorkflowRunDataAttributesType5Context"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - pulse_id = self.pulse_id - immediate: bool | None | Unset + immediate: Union[None, Unset, bool] if isinstance(self.immediate, Unset): immediate = UNSET else: immediate = self.immediate - check_conditions: bool | None | Unset + check_conditions: Union[None, Unset, bool] if isinstance(self.check_conditions, Unset): check_conditions = UNSET else: check_conditions = self.check_conditions - context: dict[str, Any] | Unset = UNSET + context: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.context, Unset): context = self.context.to_dict() @@ -75,26 +73,26 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) pulse_id = d.pop("pulse_id") - def _parse_immediate(data: object) -> bool | None | Unset: + def _parse_immediate(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) immediate = _parse_immediate(d.pop("immediate", UNSET)) - def _parse_check_conditions(data: object) -> bool | None | Unset: + def _parse_check_conditions(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) check_conditions = _parse_check_conditions(d.pop("check_conditions", UNSET)) _context = d.pop("context", UNSET) - context: NewWorkflowRunDataAttributesType5Context | Unset + context: Union[Unset, NewWorkflowRunDataAttributesType5Context] if isinstance(_context, Unset): context = UNSET else: diff --git a/rootly_sdk/models/new_workflow_run_data_attributes_type_5_context.py b/rootly_sdk/models/new_workflow_run_data_attributes_type_5_context.py index 02e65077..d0be7a1e 100644 --- a/rootly_sdk/models/new_workflow_run_data_attributes_type_5_context.py +++ b/rootly_sdk/models/new_workflow_run_data_attributes_type_5_context.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,7 +14,6 @@ class NewWorkflowRunDataAttributesType5Context: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) diff --git a/rootly_sdk/models/new_workflow_task.py b/rootly_sdk/models/new_workflow_task.py index 0e065727..0d7f4bf9 100644 --- a/rootly_sdk/models/new_workflow_task.py +++ b/rootly_sdk/models/new_workflow_task.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class NewWorkflowTask: data (NewWorkflowTaskData): """ - data: NewWorkflowTaskData + data: "NewWorkflowTaskData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/new_workflow_task_data.py b/rootly_sdk/models/new_workflow_task_data.py index eab5be62..ac4a7123 100644 --- a/rootly_sdk/models/new_workflow_task_data.py +++ b/rootly_sdk/models/new_workflow_task_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class NewWorkflowTaskData: """ type_: NewWorkflowTaskDataType - attributes: NewWorkflowTaskDataAttributes + attributes: "NewWorkflowTaskDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/new_workflow_task_data_attributes.py b/rootly_sdk/models/new_workflow_task_data_attributes.py index a38f85cc..0918a4db 100644 --- a/rootly_sdk/models/new_workflow_task_data_attributes.py +++ b/rootly_sdk/models/new_workflow_task_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define @@ -21,11 +19,18 @@ from ..models.archive_microsoft_teams_channels_task_params import ArchiveMicrosoftTeamsChannelsTaskParams from ..models.archive_slack_channels_task_params import ArchiveSlackChannelsTaskParams from ..models.attach_datadog_dashboards_task_params import AttachDatadogDashboardsTaskParams + from ..models.attach_retrospective_pdf_to_freshservice_ticket_task_params import ( + AttachRetrospectivePdfToFreshserviceTicketTaskParams, + ) from ..models.attach_retrospective_pdf_to_jira_issue_task_params import AttachRetrospectivePdfToJiraIssueTaskParams from ..models.auto_assign_role_opsgenie_task_params import AutoAssignRoleOpsgenieTaskParams from ..models.auto_assign_role_pagerduty_task_params_type_0 import AutoAssignRolePagerdutyTaskParamsType0 from ..models.auto_assign_role_pagerduty_task_params_type_1 import AutoAssignRolePagerdutyTaskParamsType1 - from ..models.auto_assign_role_rootly_task_params import AutoAssignRoleRootlyTaskParams + from ..models.auto_assign_role_rootly_task_params_type_0 import AutoAssignRoleRootlyTaskParamsType0 + from ..models.auto_assign_role_rootly_task_params_type_1 import AutoAssignRoleRootlyTaskParamsType1 + from ..models.auto_assign_role_rootly_task_params_type_2 import AutoAssignRoleRootlyTaskParamsType2 + from ..models.auto_assign_role_rootly_task_params_type_3 import AutoAssignRoleRootlyTaskParamsType3 + from ..models.auto_assign_role_rootly_task_params_type_4 import AutoAssignRoleRootlyTaskParamsType4 from ..models.auto_assign_role_victor_ops_task_params import AutoAssignRoleVictorOpsTaskParams from ..models.call_people_task_params import CallPeopleTaskParams from ..models.change_google_chat_space_privacy_task_params import ChangeGoogleChatSpacePrivacyTaskParams @@ -188,236 +193,247 @@ class NewWorkflowTaskDataAttributes: """ Attributes: - task_params (AddActionItemTaskParams | AddMicrosoftTeamsChatTabTaskParams | AddMicrosoftTeamsTabTaskParamsType0 - | AddMicrosoftTeamsTabTaskParamsType1 | AddRoleTaskParams | AddSlackBookmarkTaskParamsType0 | - AddSlackBookmarkTaskParamsType1 | AddTeamTaskParams | AddToTimelineTaskParams | - ArchiveGoogleChatSpacesTaskParams | ArchiveMicrosoftTeamsChannelsTaskParams | ArchiveSlackChannelsTaskParams | - AttachDatadogDashboardsTaskParams | AttachRetrospectivePdfToJiraIssueTaskParams | - AutoAssignRoleOpsgenieTaskParams | AutoAssignRolePagerdutyTaskParamsType0 | - AutoAssignRolePagerdutyTaskParamsType1 | AutoAssignRoleRootlyTaskParams | AutoAssignRoleVictorOpsTaskParams | - CallPeopleTaskParams | ChangeGoogleChatSpacePrivacyTaskParams | ChangeSlackChannelPrivacyTaskParams | - CreateAirtableTableRecordTaskParams | CreateAnthropicChatCompletionTaskParams | CreateAsanaSubtaskTaskParams | - CreateAsanaTaskTaskParams | CreateClickupTaskTaskParams | CreateCodaPageTaskParams | - CreateConfluencePageTaskParams | CreateDatadogNotebookTaskParams | CreateDropboxPaperPageTaskParams | - CreateGithubIssueTaskParams | CreateGitlabIssueTaskParams | CreateGoogleCalendarEventTaskParams | - CreateGoogleChatSpaceTaskParams | CreateGoogleDocsPageTaskParams | CreateGoogleDocsPermissionsTaskParams | - CreateGoogleGeminiChatCompletionTaskParams | CreateGoogleMeetingTaskParams | CreateGoToMeetingTaskParams | - CreateIncidentPostmortemTaskParams | CreateIncidentTaskParams | CreateJiraIssueTaskParams | - CreateJiraSubtaskTaskParams | CreateJsmopsAlertTaskParams | CreateLinearIssueCommentTaskParams | - CreateLinearIssueTaskParams | CreateLinearSubtaskIssueTaskParams | CreateMicrosoftTeamsChannelTaskParams | - CreateMicrosoftTeamsChatTaskParams | CreateMicrosoftTeamsMeetingTaskParams | - CreateMistralChatCompletionTaskParams | CreateMotionTaskTaskParams | CreateNotionPageTaskParams | - CreateOpenaiChatCompletionTaskParams | CreateOpsgenieAlertTaskParams | CreateOutlookEventTaskParams | - CreatePagerdutyStatusUpdateTaskParams | CreatePagertreeAlertTaskParams | CreateQuipPageTaskParams | - CreateServiceNowIncidentTaskParams | CreateSharepointPageTaskParams | CreateShortcutStoryTaskParamsType0 | - CreateShortcutStoryTaskParamsType1 | CreateShortcutTaskTaskParams | CreateSlackChannelTaskParams | - CreateSubIncidentTaskParams | CreateTrelloCardTaskParams | CreateWatsonxChatCompletionTaskParams | - CreateWebexMeetingTaskParams | CreateZendeskJiraLinkTaskParams | CreateZendeskTicketTaskParams | - CreateZoomMeetingTaskParams | GetAlertsTaskParams | GetGithubCommitsTaskParamsType0 | - GetGithubCommitsTaskParamsType1 | GetGitlabCommitsTaskParamsType0 | GetGitlabCommitsTaskParamsType1 | - GetPulsesTaskParams | HttpClientTaskParams | InviteToGoogleChatSpaceTaskParams | - InviteToMicrosoftTeamsChannelRootlyTaskParams | InviteToMicrosoftTeamsChannelTaskParams | - InviteToSlackChannelOpsgenieTaskParams | InviteToSlackChannelPagerdutyTaskParamsType0 | - InviteToSlackChannelPagerdutyTaskParamsType1 | InviteToSlackChannelRootlyTaskParams | - InviteToSlackChannelTaskParamsType0 | InviteToSlackChannelTaskParamsType1 | InviteToSlackChannelTaskParamsType2 - | InviteToSlackChannelVictorOpsTaskParams | PageJsmopsOnCallRespondersTaskParams | - PageOpsgenieOnCallRespondersTaskParams | PagePagerdutyOnCallRespondersTaskParams | - PageRootlyOnCallRespondersTaskParams | PageVictorOpsOnCallRespondersTaskParamsType0 | - PageVictorOpsOnCallRespondersTaskParamsType1 | PrintTaskParams | PublishIncidentTaskParams | - RedisClientTaskParams | RemoveGoogleDocsPermissionsTaskParams | RenameGoogleChatSpaceTaskParams | - RenameMicrosoftTeamsChannelTaskParams | RenameSlackChannelTaskParams | RunCommandHerokuTaskParams | - SendDashboardReportTaskParams | SendEmailTaskParams | SendGoogleChatAttachmentsTaskParams | - SendGoogleChatMessageTaskParams | SendMicrosoftTeamsBlocksTaskParamsType0 | - SendMicrosoftTeamsChatMessageTaskParams | SendMicrosoftTeamsMessageTaskParamsType0 | - SendSlackBlocksTaskParamsType0 | SendSlackBlocksTaskParamsType1 | SendSlackBlocksTaskParamsType2 | - SendSlackMessageTaskParamsType0 | SendSlackMessageTaskParamsType1 | SendSlackMessageTaskParamsType2 | - SendSmsTaskParams | SendWhatsappMessageTaskParams | SnapshotDatadogGraphTaskParams | - SnapshotGrafanaDashboardTaskParams | SnapshotLookerLookTaskParams | SnapshotNewRelicGraphTaskParams | - TriggerWorkflowTaskParams | TweetTwitterMessageTaskParams | UpdateActionItemTaskParams | - UpdateAirtableTableRecordTaskParams | UpdateAsanaTaskTaskParams | UpdateAttachedAlertsTaskParams | - UpdateClickupTaskTaskParams | UpdateCodaPageTaskParams | UpdateConfluencePageTaskParams | - UpdateDatadogNotebookTaskParams | UpdateDropboxPaperPageTaskParams | UpdateGithubIssueTaskParams | - UpdateGitlabIssueTaskParams | UpdateGoogleCalendarEventTaskParams | UpdateGoogleChatSpaceDescriptionTaskParams | - UpdateGoogleDocsPageTaskParams | UpdateIncidentPostmortemTaskParams | UpdateIncidentStatusTimestampTaskParams | - UpdateIncidentTaskParams | UpdateJiraIssueTaskParams | UpdateLinearIssueTaskParams | UpdateMotionTaskTaskParams - | UpdateNotionPageTaskParams | UpdateOpsgenieAlertTaskParams | UpdateOpsgenieIncidentTaskParams | - UpdatePagerdutyIncidentTaskParams | UpdatePagertreeAlertTaskParams | UpdateQuipPageTaskParams | - UpdateServiceNowIncidentTaskParams | UpdateSharepointPageTaskParams | UpdateShortcutStoryTaskParams | - UpdateShortcutTaskTaskParams | UpdateSlackChannelTopicTaskParams | UpdateStatusTaskParams | - UpdateTrelloCardTaskParams | UpdateVictorOpsIncidentTaskParams | UpdateZendeskTicketTaskParams): - name (str | Unset): Name of the workflow task - position (int | Unset): The position of the workflow task - skip_on_failure (bool | Unset): Skip workflow task if any failures - enabled (bool | Unset): Enable/disable workflow task Default: True. + task_params (Union['AddActionItemTaskParams', 'AddMicrosoftTeamsChatTabTaskParams', + 'AddMicrosoftTeamsTabTaskParamsType0', 'AddMicrosoftTeamsTabTaskParamsType1', 'AddRoleTaskParams', + 'AddSlackBookmarkTaskParamsType0', 'AddSlackBookmarkTaskParamsType1', 'AddTeamTaskParams', + 'AddToTimelineTaskParams', 'ArchiveGoogleChatSpacesTaskParams', 'ArchiveMicrosoftTeamsChannelsTaskParams', + 'ArchiveSlackChannelsTaskParams', 'AttachDatadogDashboardsTaskParams', + 'AttachRetrospectivePdfToFreshserviceTicketTaskParams', 'AttachRetrospectivePdfToJiraIssueTaskParams', + 'AutoAssignRoleOpsgenieTaskParams', 'AutoAssignRolePagerdutyTaskParamsType0', + 'AutoAssignRolePagerdutyTaskParamsType1', 'AutoAssignRoleRootlyTaskParamsType0', + 'AutoAssignRoleRootlyTaskParamsType1', 'AutoAssignRoleRootlyTaskParamsType2', + 'AutoAssignRoleRootlyTaskParamsType3', 'AutoAssignRoleRootlyTaskParamsType4', + 'AutoAssignRoleVictorOpsTaskParams', 'CallPeopleTaskParams', 'ChangeGoogleChatSpacePrivacyTaskParams', + 'ChangeSlackChannelPrivacyTaskParams', 'CreateAirtableTableRecordTaskParams', + 'CreateAnthropicChatCompletionTaskParams', 'CreateAsanaSubtaskTaskParams', 'CreateAsanaTaskTaskParams', + 'CreateClickupTaskTaskParams', 'CreateCodaPageTaskParams', 'CreateConfluencePageTaskParams', + 'CreateDatadogNotebookTaskParams', 'CreateDropboxPaperPageTaskParams', 'CreateGithubIssueTaskParams', + 'CreateGitlabIssueTaskParams', 'CreateGoToMeetingTaskParams', 'CreateGoogleCalendarEventTaskParams', + 'CreateGoogleChatSpaceTaskParams', 'CreateGoogleDocsPageTaskParams', 'CreateGoogleDocsPermissionsTaskParams', + 'CreateGoogleGeminiChatCompletionTaskParams', 'CreateGoogleMeetingTaskParams', + 'CreateIncidentPostmortemTaskParams', 'CreateIncidentTaskParams', 'CreateJiraIssueTaskParams', + 'CreateJiraSubtaskTaskParams', 'CreateJsmopsAlertTaskParams', 'CreateLinearIssueCommentTaskParams', + 'CreateLinearIssueTaskParams', 'CreateLinearSubtaskIssueTaskParams', 'CreateMicrosoftTeamsChannelTaskParams', + 'CreateMicrosoftTeamsChatTaskParams', 'CreateMicrosoftTeamsMeetingTaskParams', + 'CreateMistralChatCompletionTaskParams', 'CreateMotionTaskTaskParams', 'CreateNotionPageTaskParams', + 'CreateOpenaiChatCompletionTaskParams', 'CreateOpsgenieAlertTaskParams', 'CreateOutlookEventTaskParams', + 'CreatePagerdutyStatusUpdateTaskParams', 'CreatePagertreeAlertTaskParams', 'CreateQuipPageTaskParams', + 'CreateServiceNowIncidentTaskParams', 'CreateSharepointPageTaskParams', 'CreateShortcutStoryTaskParamsType0', + 'CreateShortcutStoryTaskParamsType1', 'CreateShortcutTaskTaskParams', 'CreateSlackChannelTaskParams', + 'CreateSubIncidentTaskParams', 'CreateTrelloCardTaskParams', 'CreateWatsonxChatCompletionTaskParams', + 'CreateWebexMeetingTaskParams', 'CreateZendeskJiraLinkTaskParams', 'CreateZendeskTicketTaskParams', + 'CreateZoomMeetingTaskParams', 'GetAlertsTaskParams', 'GetGithubCommitsTaskParamsType0', + 'GetGithubCommitsTaskParamsType1', 'GetGitlabCommitsTaskParamsType0', 'GetGitlabCommitsTaskParamsType1', + 'GetPulsesTaskParams', 'HttpClientTaskParams', 'InviteToGoogleChatSpaceTaskParams', + 'InviteToMicrosoftTeamsChannelRootlyTaskParams', 'InviteToMicrosoftTeamsChannelTaskParams', + 'InviteToSlackChannelOpsgenieTaskParams', 'InviteToSlackChannelPagerdutyTaskParamsType0', + 'InviteToSlackChannelPagerdutyTaskParamsType1', 'InviteToSlackChannelRootlyTaskParams', + 'InviteToSlackChannelTaskParamsType0', 'InviteToSlackChannelTaskParamsType1', + 'InviteToSlackChannelTaskParamsType2', 'InviteToSlackChannelVictorOpsTaskParams', + 'PageJsmopsOnCallRespondersTaskParams', 'PageOpsgenieOnCallRespondersTaskParams', + 'PagePagerdutyOnCallRespondersTaskParams', 'PageRootlyOnCallRespondersTaskParams', + 'PageVictorOpsOnCallRespondersTaskParamsType0', 'PageVictorOpsOnCallRespondersTaskParamsType1', + 'PrintTaskParams', 'PublishIncidentTaskParams', 'RedisClientTaskParams', + 'RemoveGoogleDocsPermissionsTaskParams', 'RenameGoogleChatSpaceTaskParams', + 'RenameMicrosoftTeamsChannelTaskParams', 'RenameSlackChannelTaskParams', 'RunCommandHerokuTaskParams', + 'SendDashboardReportTaskParams', 'SendEmailTaskParams', 'SendGoogleChatAttachmentsTaskParams', + 'SendGoogleChatMessageTaskParams', 'SendMicrosoftTeamsBlocksTaskParamsType0', + 'SendMicrosoftTeamsChatMessageTaskParams', 'SendMicrosoftTeamsMessageTaskParamsType0', + 'SendSlackBlocksTaskParamsType0', 'SendSlackBlocksTaskParamsType1', 'SendSlackBlocksTaskParamsType2', + 'SendSlackMessageTaskParamsType0', 'SendSlackMessageTaskParamsType1', 'SendSlackMessageTaskParamsType2', + 'SendSmsTaskParams', 'SendWhatsappMessageTaskParams', 'SnapshotDatadogGraphTaskParams', + 'SnapshotGrafanaDashboardTaskParams', 'SnapshotLookerLookTaskParams', 'SnapshotNewRelicGraphTaskParams', + 'TriggerWorkflowTaskParams', 'TweetTwitterMessageTaskParams', 'UpdateActionItemTaskParams', + 'UpdateAirtableTableRecordTaskParams', 'UpdateAsanaTaskTaskParams', 'UpdateAttachedAlertsTaskParams', + 'UpdateClickupTaskTaskParams', 'UpdateCodaPageTaskParams', 'UpdateConfluencePageTaskParams', + 'UpdateDatadogNotebookTaskParams', 'UpdateDropboxPaperPageTaskParams', 'UpdateGithubIssueTaskParams', + 'UpdateGitlabIssueTaskParams', 'UpdateGoogleCalendarEventTaskParams', + 'UpdateGoogleChatSpaceDescriptionTaskParams', 'UpdateGoogleDocsPageTaskParams', + 'UpdateIncidentPostmortemTaskParams', 'UpdateIncidentStatusTimestampTaskParams', 'UpdateIncidentTaskParams', + 'UpdateJiraIssueTaskParams', 'UpdateLinearIssueTaskParams', 'UpdateMotionTaskTaskParams', + 'UpdateNotionPageTaskParams', 'UpdateOpsgenieAlertTaskParams', 'UpdateOpsgenieIncidentTaskParams', + 'UpdatePagerdutyIncidentTaskParams', 'UpdatePagertreeAlertTaskParams', 'UpdateQuipPageTaskParams', + 'UpdateServiceNowIncidentTaskParams', 'UpdateSharepointPageTaskParams', 'UpdateShortcutStoryTaskParams', + 'UpdateShortcutTaskTaskParams', 'UpdateSlackChannelTopicTaskParams', 'UpdateStatusTaskParams', + 'UpdateTrelloCardTaskParams', 'UpdateVictorOpsIncidentTaskParams', 'UpdateZendeskTicketTaskParams']): + name (Union[Unset, str]): Name of the workflow task + position (Union[Unset, int]): The position of the workflow task + skip_on_failure (Union[Unset, bool]): Skip workflow task if any failures + enabled (Union[Unset, bool]): Enable/disable workflow task Default: True. """ - task_params: ( - AddActionItemTaskParams - | AddMicrosoftTeamsChatTabTaskParams - | AddMicrosoftTeamsTabTaskParamsType0 - | AddMicrosoftTeamsTabTaskParamsType1 - | AddRoleTaskParams - | AddSlackBookmarkTaskParamsType0 - | AddSlackBookmarkTaskParamsType1 - | AddTeamTaskParams - | AddToTimelineTaskParams - | ArchiveGoogleChatSpacesTaskParams - | ArchiveMicrosoftTeamsChannelsTaskParams - | ArchiveSlackChannelsTaskParams - | AttachDatadogDashboardsTaskParams - | AttachRetrospectivePdfToJiraIssueTaskParams - | AutoAssignRoleOpsgenieTaskParams - | AutoAssignRolePagerdutyTaskParamsType0 - | AutoAssignRolePagerdutyTaskParamsType1 - | AutoAssignRoleRootlyTaskParams - | AutoAssignRoleVictorOpsTaskParams - | CallPeopleTaskParams - | ChangeGoogleChatSpacePrivacyTaskParams - | ChangeSlackChannelPrivacyTaskParams - | CreateAirtableTableRecordTaskParams - | CreateAnthropicChatCompletionTaskParams - | CreateAsanaSubtaskTaskParams - | CreateAsanaTaskTaskParams - | CreateClickupTaskTaskParams - | CreateCodaPageTaskParams - | CreateConfluencePageTaskParams - | CreateDatadogNotebookTaskParams - | CreateDropboxPaperPageTaskParams - | CreateGithubIssueTaskParams - | CreateGitlabIssueTaskParams - | CreateGoogleCalendarEventTaskParams - | CreateGoogleChatSpaceTaskParams - | CreateGoogleDocsPageTaskParams - | CreateGoogleDocsPermissionsTaskParams - | CreateGoogleGeminiChatCompletionTaskParams - | CreateGoogleMeetingTaskParams - | CreateGoToMeetingTaskParams - | CreateIncidentPostmortemTaskParams - | CreateIncidentTaskParams - | CreateJiraIssueTaskParams - | CreateJiraSubtaskTaskParams - | CreateJsmopsAlertTaskParams - | CreateLinearIssueCommentTaskParams - | CreateLinearIssueTaskParams - | CreateLinearSubtaskIssueTaskParams - | CreateMicrosoftTeamsChannelTaskParams - | CreateMicrosoftTeamsChatTaskParams - | CreateMicrosoftTeamsMeetingTaskParams - | CreateMistralChatCompletionTaskParams - | CreateMotionTaskTaskParams - | CreateNotionPageTaskParams - | CreateOpenaiChatCompletionTaskParams - | CreateOpsgenieAlertTaskParams - | CreateOutlookEventTaskParams - | CreatePagerdutyStatusUpdateTaskParams - | CreatePagertreeAlertTaskParams - | CreateQuipPageTaskParams - | CreateServiceNowIncidentTaskParams - | CreateSharepointPageTaskParams - | CreateShortcutStoryTaskParamsType0 - | CreateShortcutStoryTaskParamsType1 - | CreateShortcutTaskTaskParams - | CreateSlackChannelTaskParams - | CreateSubIncidentTaskParams - | CreateTrelloCardTaskParams - | CreateWatsonxChatCompletionTaskParams - | CreateWebexMeetingTaskParams - | CreateZendeskJiraLinkTaskParams - | CreateZendeskTicketTaskParams - | CreateZoomMeetingTaskParams - | GetAlertsTaskParams - | GetGithubCommitsTaskParamsType0 - | GetGithubCommitsTaskParamsType1 - | GetGitlabCommitsTaskParamsType0 - | GetGitlabCommitsTaskParamsType1 - | GetPulsesTaskParams - | HttpClientTaskParams - | InviteToGoogleChatSpaceTaskParams - | InviteToMicrosoftTeamsChannelRootlyTaskParams - | InviteToMicrosoftTeamsChannelTaskParams - | InviteToSlackChannelOpsgenieTaskParams - | InviteToSlackChannelPagerdutyTaskParamsType0 - | InviteToSlackChannelPagerdutyTaskParamsType1 - | InviteToSlackChannelRootlyTaskParams - | InviteToSlackChannelTaskParamsType0 - | InviteToSlackChannelTaskParamsType1 - | InviteToSlackChannelTaskParamsType2 - | InviteToSlackChannelVictorOpsTaskParams - | PageJsmopsOnCallRespondersTaskParams - | PageOpsgenieOnCallRespondersTaskParams - | PagePagerdutyOnCallRespondersTaskParams - | PageRootlyOnCallRespondersTaskParams - | PageVictorOpsOnCallRespondersTaskParamsType0 - | PageVictorOpsOnCallRespondersTaskParamsType1 - | PrintTaskParams - | PublishIncidentTaskParams - | RedisClientTaskParams - | RemoveGoogleDocsPermissionsTaskParams - | RenameGoogleChatSpaceTaskParams - | RenameMicrosoftTeamsChannelTaskParams - | RenameSlackChannelTaskParams - | RunCommandHerokuTaskParams - | SendDashboardReportTaskParams - | SendEmailTaskParams - | SendGoogleChatAttachmentsTaskParams - | SendGoogleChatMessageTaskParams - | SendMicrosoftTeamsBlocksTaskParamsType0 - | SendMicrosoftTeamsChatMessageTaskParams - | SendMicrosoftTeamsMessageTaskParamsType0 - | SendSlackBlocksTaskParamsType0 - | SendSlackBlocksTaskParamsType1 - | SendSlackBlocksTaskParamsType2 - | SendSlackMessageTaskParamsType0 - | SendSlackMessageTaskParamsType1 - | SendSlackMessageTaskParamsType2 - | SendSmsTaskParams - | SendWhatsappMessageTaskParams - | SnapshotDatadogGraphTaskParams - | SnapshotGrafanaDashboardTaskParams - | SnapshotLookerLookTaskParams - | SnapshotNewRelicGraphTaskParams - | TriggerWorkflowTaskParams - | TweetTwitterMessageTaskParams - | UpdateActionItemTaskParams - | UpdateAirtableTableRecordTaskParams - | UpdateAsanaTaskTaskParams - | UpdateAttachedAlertsTaskParams - | UpdateClickupTaskTaskParams - | UpdateCodaPageTaskParams - | UpdateConfluencePageTaskParams - | UpdateDatadogNotebookTaskParams - | UpdateDropboxPaperPageTaskParams - | UpdateGithubIssueTaskParams - | UpdateGitlabIssueTaskParams - | UpdateGoogleCalendarEventTaskParams - | UpdateGoogleChatSpaceDescriptionTaskParams - | UpdateGoogleDocsPageTaskParams - | UpdateIncidentPostmortemTaskParams - | UpdateIncidentStatusTimestampTaskParams - | UpdateIncidentTaskParams - | UpdateJiraIssueTaskParams - | UpdateLinearIssueTaskParams - | UpdateMotionTaskTaskParams - | UpdateNotionPageTaskParams - | UpdateOpsgenieAlertTaskParams - | UpdateOpsgenieIncidentTaskParams - | UpdatePagerdutyIncidentTaskParams - | UpdatePagertreeAlertTaskParams - | UpdateQuipPageTaskParams - | UpdateServiceNowIncidentTaskParams - | UpdateSharepointPageTaskParams - | UpdateShortcutStoryTaskParams - | UpdateShortcutTaskTaskParams - | UpdateSlackChannelTopicTaskParams - | UpdateStatusTaskParams - | UpdateTrelloCardTaskParams - | UpdateVictorOpsIncidentTaskParams - | UpdateZendeskTicketTaskParams - ) - name: str | Unset = UNSET - position: int | Unset = UNSET - skip_on_failure: bool | Unset = UNSET - enabled: bool | Unset = True + task_params: Union[ + "AddActionItemTaskParams", + "AddMicrosoftTeamsChatTabTaskParams", + "AddMicrosoftTeamsTabTaskParamsType0", + "AddMicrosoftTeamsTabTaskParamsType1", + "AddRoleTaskParams", + "AddSlackBookmarkTaskParamsType0", + "AddSlackBookmarkTaskParamsType1", + "AddTeamTaskParams", + "AddToTimelineTaskParams", + "ArchiveGoogleChatSpacesTaskParams", + "ArchiveMicrosoftTeamsChannelsTaskParams", + "ArchiveSlackChannelsTaskParams", + "AttachDatadogDashboardsTaskParams", + "AttachRetrospectivePdfToFreshserviceTicketTaskParams", + "AttachRetrospectivePdfToJiraIssueTaskParams", + "AutoAssignRoleOpsgenieTaskParams", + "AutoAssignRolePagerdutyTaskParamsType0", + "AutoAssignRolePagerdutyTaskParamsType1", + "AutoAssignRoleRootlyTaskParamsType0", + "AutoAssignRoleRootlyTaskParamsType1", + "AutoAssignRoleRootlyTaskParamsType2", + "AutoAssignRoleRootlyTaskParamsType3", + "AutoAssignRoleRootlyTaskParamsType4", + "AutoAssignRoleVictorOpsTaskParams", + "CallPeopleTaskParams", + "ChangeGoogleChatSpacePrivacyTaskParams", + "ChangeSlackChannelPrivacyTaskParams", + "CreateAirtableTableRecordTaskParams", + "CreateAnthropicChatCompletionTaskParams", + "CreateAsanaSubtaskTaskParams", + "CreateAsanaTaskTaskParams", + "CreateClickupTaskTaskParams", + "CreateCodaPageTaskParams", + "CreateConfluencePageTaskParams", + "CreateDatadogNotebookTaskParams", + "CreateDropboxPaperPageTaskParams", + "CreateGithubIssueTaskParams", + "CreateGitlabIssueTaskParams", + "CreateGoToMeetingTaskParams", + "CreateGoogleCalendarEventTaskParams", + "CreateGoogleChatSpaceTaskParams", + "CreateGoogleDocsPageTaskParams", + "CreateGoogleDocsPermissionsTaskParams", + "CreateGoogleGeminiChatCompletionTaskParams", + "CreateGoogleMeetingTaskParams", + "CreateIncidentPostmortemTaskParams", + "CreateIncidentTaskParams", + "CreateJiraIssueTaskParams", + "CreateJiraSubtaskTaskParams", + "CreateJsmopsAlertTaskParams", + "CreateLinearIssueCommentTaskParams", + "CreateLinearIssueTaskParams", + "CreateLinearSubtaskIssueTaskParams", + "CreateMicrosoftTeamsChannelTaskParams", + "CreateMicrosoftTeamsChatTaskParams", + "CreateMicrosoftTeamsMeetingTaskParams", + "CreateMistralChatCompletionTaskParams", + "CreateMotionTaskTaskParams", + "CreateNotionPageTaskParams", + "CreateOpenaiChatCompletionTaskParams", + "CreateOpsgenieAlertTaskParams", + "CreateOutlookEventTaskParams", + "CreatePagerdutyStatusUpdateTaskParams", + "CreatePagertreeAlertTaskParams", + "CreateQuipPageTaskParams", + "CreateServiceNowIncidentTaskParams", + "CreateSharepointPageTaskParams", + "CreateShortcutStoryTaskParamsType0", + "CreateShortcutStoryTaskParamsType1", + "CreateShortcutTaskTaskParams", + "CreateSlackChannelTaskParams", + "CreateSubIncidentTaskParams", + "CreateTrelloCardTaskParams", + "CreateWatsonxChatCompletionTaskParams", + "CreateWebexMeetingTaskParams", + "CreateZendeskJiraLinkTaskParams", + "CreateZendeskTicketTaskParams", + "CreateZoomMeetingTaskParams", + "GetAlertsTaskParams", + "GetGithubCommitsTaskParamsType0", + "GetGithubCommitsTaskParamsType1", + "GetGitlabCommitsTaskParamsType0", + "GetGitlabCommitsTaskParamsType1", + "GetPulsesTaskParams", + "HttpClientTaskParams", + "InviteToGoogleChatSpaceTaskParams", + "InviteToMicrosoftTeamsChannelRootlyTaskParams", + "InviteToMicrosoftTeamsChannelTaskParams", + "InviteToSlackChannelOpsgenieTaskParams", + "InviteToSlackChannelPagerdutyTaskParamsType0", + "InviteToSlackChannelPagerdutyTaskParamsType1", + "InviteToSlackChannelRootlyTaskParams", + "InviteToSlackChannelTaskParamsType0", + "InviteToSlackChannelTaskParamsType1", + "InviteToSlackChannelTaskParamsType2", + "InviteToSlackChannelVictorOpsTaskParams", + "PageJsmopsOnCallRespondersTaskParams", + "PageOpsgenieOnCallRespondersTaskParams", + "PagePagerdutyOnCallRespondersTaskParams", + "PageRootlyOnCallRespondersTaskParams", + "PageVictorOpsOnCallRespondersTaskParamsType0", + "PageVictorOpsOnCallRespondersTaskParamsType1", + "PrintTaskParams", + "PublishIncidentTaskParams", + "RedisClientTaskParams", + "RemoveGoogleDocsPermissionsTaskParams", + "RenameGoogleChatSpaceTaskParams", + "RenameMicrosoftTeamsChannelTaskParams", + "RenameSlackChannelTaskParams", + "RunCommandHerokuTaskParams", + "SendDashboardReportTaskParams", + "SendEmailTaskParams", + "SendGoogleChatAttachmentsTaskParams", + "SendGoogleChatMessageTaskParams", + "SendMicrosoftTeamsBlocksTaskParamsType0", + "SendMicrosoftTeamsChatMessageTaskParams", + "SendMicrosoftTeamsMessageTaskParamsType0", + "SendSlackBlocksTaskParamsType0", + "SendSlackBlocksTaskParamsType1", + "SendSlackBlocksTaskParamsType2", + "SendSlackMessageTaskParamsType0", + "SendSlackMessageTaskParamsType1", + "SendSlackMessageTaskParamsType2", + "SendSmsTaskParams", + "SendWhatsappMessageTaskParams", + "SnapshotDatadogGraphTaskParams", + "SnapshotGrafanaDashboardTaskParams", + "SnapshotLookerLookTaskParams", + "SnapshotNewRelicGraphTaskParams", + "TriggerWorkflowTaskParams", + "TweetTwitterMessageTaskParams", + "UpdateActionItemTaskParams", + "UpdateAirtableTableRecordTaskParams", + "UpdateAsanaTaskTaskParams", + "UpdateAttachedAlertsTaskParams", + "UpdateClickupTaskTaskParams", + "UpdateCodaPageTaskParams", + "UpdateConfluencePageTaskParams", + "UpdateDatadogNotebookTaskParams", + "UpdateDropboxPaperPageTaskParams", + "UpdateGithubIssueTaskParams", + "UpdateGitlabIssueTaskParams", + "UpdateGoogleCalendarEventTaskParams", + "UpdateGoogleChatSpaceDescriptionTaskParams", + "UpdateGoogleDocsPageTaskParams", + "UpdateIncidentPostmortemTaskParams", + "UpdateIncidentStatusTimestampTaskParams", + "UpdateIncidentTaskParams", + "UpdateJiraIssueTaskParams", + "UpdateLinearIssueTaskParams", + "UpdateMotionTaskTaskParams", + "UpdateNotionPageTaskParams", + "UpdateOpsgenieAlertTaskParams", + "UpdateOpsgenieIncidentTaskParams", + "UpdatePagerdutyIncidentTaskParams", + "UpdatePagertreeAlertTaskParams", + "UpdateQuipPageTaskParams", + "UpdateServiceNowIncidentTaskParams", + "UpdateSharepointPageTaskParams", + "UpdateShortcutStoryTaskParams", + "UpdateShortcutTaskTaskParams", + "UpdateSlackChannelTopicTaskParams", + "UpdateStatusTaskParams", + "UpdateTrelloCardTaskParams", + "UpdateVictorOpsIncidentTaskParams", + "UpdateZendeskTicketTaskParams", + ] + name: Union[Unset, str] = UNSET + position: Union[Unset, int] = UNSET + skip_on_failure: Union[Unset, bool] = UNSET + enabled: Union[Unset, bool] = True def to_dict(self) -> dict[str, Any]: from ..models.add_action_item_task_params import AddActionItemTaskParams @@ -433,13 +449,20 @@ def to_dict(self) -> dict[str, Any]: from ..models.archive_microsoft_teams_channels_task_params import ArchiveMicrosoftTeamsChannelsTaskParams from ..models.archive_slack_channels_task_params import ArchiveSlackChannelsTaskParams from ..models.attach_datadog_dashboards_task_params import AttachDatadogDashboardsTaskParams + from ..models.attach_retrospective_pdf_to_freshservice_ticket_task_params import ( + AttachRetrospectivePdfToFreshserviceTicketTaskParams, + ) from ..models.attach_retrospective_pdf_to_jira_issue_task_params import ( AttachRetrospectivePdfToJiraIssueTaskParams, ) from ..models.auto_assign_role_opsgenie_task_params import AutoAssignRoleOpsgenieTaskParams from ..models.auto_assign_role_pagerduty_task_params_type_0 import AutoAssignRolePagerdutyTaskParamsType0 from ..models.auto_assign_role_pagerduty_task_params_type_1 import AutoAssignRolePagerdutyTaskParamsType1 - from ..models.auto_assign_role_rootly_task_params import AutoAssignRoleRootlyTaskParams + from ..models.auto_assign_role_rootly_task_params_type_0 import AutoAssignRoleRootlyTaskParamsType0 + from ..models.auto_assign_role_rootly_task_params_type_1 import AutoAssignRoleRootlyTaskParamsType1 + from ..models.auto_assign_role_rootly_task_params_type_2 import AutoAssignRoleRootlyTaskParamsType2 + from ..models.auto_assign_role_rootly_task_params_type_3 import AutoAssignRoleRootlyTaskParamsType3 + from ..models.auto_assign_role_rootly_task_params_type_4 import AutoAssignRoleRootlyTaskParamsType4 from ..models.auto_assign_role_victor_ops_task_params import AutoAssignRoleVictorOpsTaskParams from ..models.call_people_task_params import CallPeopleTaskParams from ..models.change_google_chat_space_privacy_task_params import ChangeGoogleChatSpacePrivacyTaskParams @@ -614,7 +637,15 @@ def to_dict(self) -> dict[str, Any]: task_params = self.task_params.to_dict() elif isinstance(self.task_params, AutoAssignRoleOpsgenieTaskParams): task_params = self.task_params.to_dict() - elif isinstance(self.task_params, AutoAssignRoleRootlyTaskParams): + elif isinstance(self.task_params, AutoAssignRoleRootlyTaskParamsType0): + task_params = self.task_params.to_dict() + elif isinstance(self.task_params, AutoAssignRoleRootlyTaskParamsType1): + task_params = self.task_params.to_dict() + elif isinstance(self.task_params, AutoAssignRoleRootlyTaskParamsType2): + task_params = self.task_params.to_dict() + elif isinstance(self.task_params, AutoAssignRoleRootlyTaskParamsType3): + task_params = self.task_params.to_dict() + elif isinstance(self.task_params, AutoAssignRoleRootlyTaskParamsType4): task_params = self.task_params.to_dict() elif isinstance(self.task_params, AutoAssignRolePagerdutyTaskParamsType0): task_params = self.task_params.to_dict() @@ -686,6 +717,8 @@ def to_dict(self) -> dict[str, Any]: task_params = self.task_params.to_dict() elif isinstance(self.task_params, AttachRetrospectivePdfToJiraIssueTaskParams): task_params = self.task_params.to_dict() + elif isinstance(self.task_params, AttachRetrospectivePdfToFreshserviceTicketTaskParams): + task_params = self.task_params.to_dict() elif isinstance(self.task_params, CreateLinearIssueTaskParams): task_params = self.task_params.to_dict() elif isinstance(self.task_params, CreateLinearSubtaskIssueTaskParams): @@ -958,13 +991,20 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: from ..models.archive_microsoft_teams_channels_task_params import ArchiveMicrosoftTeamsChannelsTaskParams from ..models.archive_slack_channels_task_params import ArchiveSlackChannelsTaskParams from ..models.attach_datadog_dashboards_task_params import AttachDatadogDashboardsTaskParams + from ..models.attach_retrospective_pdf_to_freshservice_ticket_task_params import ( + AttachRetrospectivePdfToFreshserviceTicketTaskParams, + ) from ..models.attach_retrospective_pdf_to_jira_issue_task_params import ( AttachRetrospectivePdfToJiraIssueTaskParams, ) from ..models.auto_assign_role_opsgenie_task_params import AutoAssignRoleOpsgenieTaskParams from ..models.auto_assign_role_pagerduty_task_params_type_0 import AutoAssignRolePagerdutyTaskParamsType0 from ..models.auto_assign_role_pagerduty_task_params_type_1 import AutoAssignRolePagerdutyTaskParamsType1 - from ..models.auto_assign_role_rootly_task_params import AutoAssignRoleRootlyTaskParams + from ..models.auto_assign_role_rootly_task_params_type_0 import AutoAssignRoleRootlyTaskParamsType0 + from ..models.auto_assign_role_rootly_task_params_type_1 import AutoAssignRoleRootlyTaskParamsType1 + from ..models.auto_assign_role_rootly_task_params_type_2 import AutoAssignRoleRootlyTaskParamsType2 + from ..models.auto_assign_role_rootly_task_params_type_3 import AutoAssignRoleRootlyTaskParamsType3 + from ..models.auto_assign_role_rootly_task_params_type_4 import AutoAssignRoleRootlyTaskParamsType4 from ..models.auto_assign_role_victor_ops_task_params import AutoAssignRoleVictorOpsTaskParams from ..models.call_people_task_params import CallPeopleTaskParams from ..models.change_google_chat_space_privacy_task_params import ChangeGoogleChatSpacePrivacyTaskParams @@ -1123,176 +1163,181 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: def _parse_task_params( data: object, - ) -> ( - AddActionItemTaskParams - | AddMicrosoftTeamsChatTabTaskParams - | AddMicrosoftTeamsTabTaskParamsType0 - | AddMicrosoftTeamsTabTaskParamsType1 - | AddRoleTaskParams - | AddSlackBookmarkTaskParamsType0 - | AddSlackBookmarkTaskParamsType1 - | AddTeamTaskParams - | AddToTimelineTaskParams - | ArchiveGoogleChatSpacesTaskParams - | ArchiveMicrosoftTeamsChannelsTaskParams - | ArchiveSlackChannelsTaskParams - | AttachDatadogDashboardsTaskParams - | AttachRetrospectivePdfToJiraIssueTaskParams - | AutoAssignRoleOpsgenieTaskParams - | AutoAssignRolePagerdutyTaskParamsType0 - | AutoAssignRolePagerdutyTaskParamsType1 - | AutoAssignRoleRootlyTaskParams - | AutoAssignRoleVictorOpsTaskParams - | CallPeopleTaskParams - | ChangeGoogleChatSpacePrivacyTaskParams - | ChangeSlackChannelPrivacyTaskParams - | CreateAirtableTableRecordTaskParams - | CreateAnthropicChatCompletionTaskParams - | CreateAsanaSubtaskTaskParams - | CreateAsanaTaskTaskParams - | CreateClickupTaskTaskParams - | CreateCodaPageTaskParams - | CreateConfluencePageTaskParams - | CreateDatadogNotebookTaskParams - | CreateDropboxPaperPageTaskParams - | CreateGithubIssueTaskParams - | CreateGitlabIssueTaskParams - | CreateGoogleCalendarEventTaskParams - | CreateGoogleChatSpaceTaskParams - | CreateGoogleDocsPageTaskParams - | CreateGoogleDocsPermissionsTaskParams - | CreateGoogleGeminiChatCompletionTaskParams - | CreateGoogleMeetingTaskParams - | CreateGoToMeetingTaskParams - | CreateIncidentPostmortemTaskParams - | CreateIncidentTaskParams - | CreateJiraIssueTaskParams - | CreateJiraSubtaskTaskParams - | CreateJsmopsAlertTaskParams - | CreateLinearIssueCommentTaskParams - | CreateLinearIssueTaskParams - | CreateLinearSubtaskIssueTaskParams - | CreateMicrosoftTeamsChannelTaskParams - | CreateMicrosoftTeamsChatTaskParams - | CreateMicrosoftTeamsMeetingTaskParams - | CreateMistralChatCompletionTaskParams - | CreateMotionTaskTaskParams - | CreateNotionPageTaskParams - | CreateOpenaiChatCompletionTaskParams - | CreateOpsgenieAlertTaskParams - | CreateOutlookEventTaskParams - | CreatePagerdutyStatusUpdateTaskParams - | CreatePagertreeAlertTaskParams - | CreateQuipPageTaskParams - | CreateServiceNowIncidentTaskParams - | CreateSharepointPageTaskParams - | CreateShortcutStoryTaskParamsType0 - | CreateShortcutStoryTaskParamsType1 - | CreateShortcutTaskTaskParams - | CreateSlackChannelTaskParams - | CreateSubIncidentTaskParams - | CreateTrelloCardTaskParams - | CreateWatsonxChatCompletionTaskParams - | CreateWebexMeetingTaskParams - | CreateZendeskJiraLinkTaskParams - | CreateZendeskTicketTaskParams - | CreateZoomMeetingTaskParams - | GetAlertsTaskParams - | GetGithubCommitsTaskParamsType0 - | GetGithubCommitsTaskParamsType1 - | GetGitlabCommitsTaskParamsType0 - | GetGitlabCommitsTaskParamsType1 - | GetPulsesTaskParams - | HttpClientTaskParams - | InviteToGoogleChatSpaceTaskParams - | InviteToMicrosoftTeamsChannelRootlyTaskParams - | InviteToMicrosoftTeamsChannelTaskParams - | InviteToSlackChannelOpsgenieTaskParams - | InviteToSlackChannelPagerdutyTaskParamsType0 - | InviteToSlackChannelPagerdutyTaskParamsType1 - | InviteToSlackChannelRootlyTaskParams - | InviteToSlackChannelTaskParamsType0 - | InviteToSlackChannelTaskParamsType1 - | InviteToSlackChannelTaskParamsType2 - | InviteToSlackChannelVictorOpsTaskParams - | PageJsmopsOnCallRespondersTaskParams - | PageOpsgenieOnCallRespondersTaskParams - | PagePagerdutyOnCallRespondersTaskParams - | PageRootlyOnCallRespondersTaskParams - | PageVictorOpsOnCallRespondersTaskParamsType0 - | PageVictorOpsOnCallRespondersTaskParamsType1 - | PrintTaskParams - | PublishIncidentTaskParams - | RedisClientTaskParams - | RemoveGoogleDocsPermissionsTaskParams - | RenameGoogleChatSpaceTaskParams - | RenameMicrosoftTeamsChannelTaskParams - | RenameSlackChannelTaskParams - | RunCommandHerokuTaskParams - | SendDashboardReportTaskParams - | SendEmailTaskParams - | SendGoogleChatAttachmentsTaskParams - | SendGoogleChatMessageTaskParams - | SendMicrosoftTeamsBlocksTaskParamsType0 - | SendMicrosoftTeamsChatMessageTaskParams - | SendMicrosoftTeamsMessageTaskParamsType0 - | SendSlackBlocksTaskParamsType0 - | SendSlackBlocksTaskParamsType1 - | SendSlackBlocksTaskParamsType2 - | SendSlackMessageTaskParamsType0 - | SendSlackMessageTaskParamsType1 - | SendSlackMessageTaskParamsType2 - | SendSmsTaskParams - | SendWhatsappMessageTaskParams - | SnapshotDatadogGraphTaskParams - | SnapshotGrafanaDashboardTaskParams - | SnapshotLookerLookTaskParams - | SnapshotNewRelicGraphTaskParams - | TriggerWorkflowTaskParams - | TweetTwitterMessageTaskParams - | UpdateActionItemTaskParams - | UpdateAirtableTableRecordTaskParams - | UpdateAsanaTaskTaskParams - | UpdateAttachedAlertsTaskParams - | UpdateClickupTaskTaskParams - | UpdateCodaPageTaskParams - | UpdateConfluencePageTaskParams - | UpdateDatadogNotebookTaskParams - | UpdateDropboxPaperPageTaskParams - | UpdateGithubIssueTaskParams - | UpdateGitlabIssueTaskParams - | UpdateGoogleCalendarEventTaskParams - | UpdateGoogleChatSpaceDescriptionTaskParams - | UpdateGoogleDocsPageTaskParams - | UpdateIncidentPostmortemTaskParams - | UpdateIncidentStatusTimestampTaskParams - | UpdateIncidentTaskParams - | UpdateJiraIssueTaskParams - | UpdateLinearIssueTaskParams - | UpdateMotionTaskTaskParams - | UpdateNotionPageTaskParams - | UpdateOpsgenieAlertTaskParams - | UpdateOpsgenieIncidentTaskParams - | UpdatePagerdutyIncidentTaskParams - | UpdatePagertreeAlertTaskParams - | UpdateQuipPageTaskParams - | UpdateServiceNowIncidentTaskParams - | UpdateSharepointPageTaskParams - | UpdateShortcutStoryTaskParams - | UpdateShortcutTaskTaskParams - | UpdateSlackChannelTopicTaskParams - | UpdateStatusTaskParams - | UpdateTrelloCardTaskParams - | UpdateVictorOpsIncidentTaskParams - | UpdateZendeskTicketTaskParams - ): + ) -> Union[ + "AddActionItemTaskParams", + "AddMicrosoftTeamsChatTabTaskParams", + "AddMicrosoftTeamsTabTaskParamsType0", + "AddMicrosoftTeamsTabTaskParamsType1", + "AddRoleTaskParams", + "AddSlackBookmarkTaskParamsType0", + "AddSlackBookmarkTaskParamsType1", + "AddTeamTaskParams", + "AddToTimelineTaskParams", + "ArchiveGoogleChatSpacesTaskParams", + "ArchiveMicrosoftTeamsChannelsTaskParams", + "ArchiveSlackChannelsTaskParams", + "AttachDatadogDashboardsTaskParams", + "AttachRetrospectivePdfToFreshserviceTicketTaskParams", + "AttachRetrospectivePdfToJiraIssueTaskParams", + "AutoAssignRoleOpsgenieTaskParams", + "AutoAssignRolePagerdutyTaskParamsType0", + "AutoAssignRolePagerdutyTaskParamsType1", + "AutoAssignRoleRootlyTaskParamsType0", + "AutoAssignRoleRootlyTaskParamsType1", + "AutoAssignRoleRootlyTaskParamsType2", + "AutoAssignRoleRootlyTaskParamsType3", + "AutoAssignRoleRootlyTaskParamsType4", + "AutoAssignRoleVictorOpsTaskParams", + "CallPeopleTaskParams", + "ChangeGoogleChatSpacePrivacyTaskParams", + "ChangeSlackChannelPrivacyTaskParams", + "CreateAirtableTableRecordTaskParams", + "CreateAnthropicChatCompletionTaskParams", + "CreateAsanaSubtaskTaskParams", + "CreateAsanaTaskTaskParams", + "CreateClickupTaskTaskParams", + "CreateCodaPageTaskParams", + "CreateConfluencePageTaskParams", + "CreateDatadogNotebookTaskParams", + "CreateDropboxPaperPageTaskParams", + "CreateGithubIssueTaskParams", + "CreateGitlabIssueTaskParams", + "CreateGoToMeetingTaskParams", + "CreateGoogleCalendarEventTaskParams", + "CreateGoogleChatSpaceTaskParams", + "CreateGoogleDocsPageTaskParams", + "CreateGoogleDocsPermissionsTaskParams", + "CreateGoogleGeminiChatCompletionTaskParams", + "CreateGoogleMeetingTaskParams", + "CreateIncidentPostmortemTaskParams", + "CreateIncidentTaskParams", + "CreateJiraIssueTaskParams", + "CreateJiraSubtaskTaskParams", + "CreateJsmopsAlertTaskParams", + "CreateLinearIssueCommentTaskParams", + "CreateLinearIssueTaskParams", + "CreateLinearSubtaskIssueTaskParams", + "CreateMicrosoftTeamsChannelTaskParams", + "CreateMicrosoftTeamsChatTaskParams", + "CreateMicrosoftTeamsMeetingTaskParams", + "CreateMistralChatCompletionTaskParams", + "CreateMotionTaskTaskParams", + "CreateNotionPageTaskParams", + "CreateOpenaiChatCompletionTaskParams", + "CreateOpsgenieAlertTaskParams", + "CreateOutlookEventTaskParams", + "CreatePagerdutyStatusUpdateTaskParams", + "CreatePagertreeAlertTaskParams", + "CreateQuipPageTaskParams", + "CreateServiceNowIncidentTaskParams", + "CreateSharepointPageTaskParams", + "CreateShortcutStoryTaskParamsType0", + "CreateShortcutStoryTaskParamsType1", + "CreateShortcutTaskTaskParams", + "CreateSlackChannelTaskParams", + "CreateSubIncidentTaskParams", + "CreateTrelloCardTaskParams", + "CreateWatsonxChatCompletionTaskParams", + "CreateWebexMeetingTaskParams", + "CreateZendeskJiraLinkTaskParams", + "CreateZendeskTicketTaskParams", + "CreateZoomMeetingTaskParams", + "GetAlertsTaskParams", + "GetGithubCommitsTaskParamsType0", + "GetGithubCommitsTaskParamsType1", + "GetGitlabCommitsTaskParamsType0", + "GetGitlabCommitsTaskParamsType1", + "GetPulsesTaskParams", + "HttpClientTaskParams", + "InviteToGoogleChatSpaceTaskParams", + "InviteToMicrosoftTeamsChannelRootlyTaskParams", + "InviteToMicrosoftTeamsChannelTaskParams", + "InviteToSlackChannelOpsgenieTaskParams", + "InviteToSlackChannelPagerdutyTaskParamsType0", + "InviteToSlackChannelPagerdutyTaskParamsType1", + "InviteToSlackChannelRootlyTaskParams", + "InviteToSlackChannelTaskParamsType0", + "InviteToSlackChannelTaskParamsType1", + "InviteToSlackChannelTaskParamsType2", + "InviteToSlackChannelVictorOpsTaskParams", + "PageJsmopsOnCallRespondersTaskParams", + "PageOpsgenieOnCallRespondersTaskParams", + "PagePagerdutyOnCallRespondersTaskParams", + "PageRootlyOnCallRespondersTaskParams", + "PageVictorOpsOnCallRespondersTaskParamsType0", + "PageVictorOpsOnCallRespondersTaskParamsType1", + "PrintTaskParams", + "PublishIncidentTaskParams", + "RedisClientTaskParams", + "RemoveGoogleDocsPermissionsTaskParams", + "RenameGoogleChatSpaceTaskParams", + "RenameMicrosoftTeamsChannelTaskParams", + "RenameSlackChannelTaskParams", + "RunCommandHerokuTaskParams", + "SendDashboardReportTaskParams", + "SendEmailTaskParams", + "SendGoogleChatAttachmentsTaskParams", + "SendGoogleChatMessageTaskParams", + "SendMicrosoftTeamsBlocksTaskParamsType0", + "SendMicrosoftTeamsChatMessageTaskParams", + "SendMicrosoftTeamsMessageTaskParamsType0", + "SendSlackBlocksTaskParamsType0", + "SendSlackBlocksTaskParamsType1", + "SendSlackBlocksTaskParamsType2", + "SendSlackMessageTaskParamsType0", + "SendSlackMessageTaskParamsType1", + "SendSlackMessageTaskParamsType2", + "SendSmsTaskParams", + "SendWhatsappMessageTaskParams", + "SnapshotDatadogGraphTaskParams", + "SnapshotGrafanaDashboardTaskParams", + "SnapshotLookerLookTaskParams", + "SnapshotNewRelicGraphTaskParams", + "TriggerWorkflowTaskParams", + "TweetTwitterMessageTaskParams", + "UpdateActionItemTaskParams", + "UpdateAirtableTableRecordTaskParams", + "UpdateAsanaTaskTaskParams", + "UpdateAttachedAlertsTaskParams", + "UpdateClickupTaskTaskParams", + "UpdateCodaPageTaskParams", + "UpdateConfluencePageTaskParams", + "UpdateDatadogNotebookTaskParams", + "UpdateDropboxPaperPageTaskParams", + "UpdateGithubIssueTaskParams", + "UpdateGitlabIssueTaskParams", + "UpdateGoogleCalendarEventTaskParams", + "UpdateGoogleChatSpaceDescriptionTaskParams", + "UpdateGoogleDocsPageTaskParams", + "UpdateIncidentPostmortemTaskParams", + "UpdateIncidentStatusTimestampTaskParams", + "UpdateIncidentTaskParams", + "UpdateJiraIssueTaskParams", + "UpdateLinearIssueTaskParams", + "UpdateMotionTaskTaskParams", + "UpdateNotionPageTaskParams", + "UpdateOpsgenieAlertTaskParams", + "UpdateOpsgenieIncidentTaskParams", + "UpdatePagerdutyIncidentTaskParams", + "UpdatePagertreeAlertTaskParams", + "UpdateQuipPageTaskParams", + "UpdateServiceNowIncidentTaskParams", + "UpdateSharepointPageTaskParams", + "UpdateShortcutStoryTaskParams", + "UpdateShortcutTaskTaskParams", + "UpdateSlackChannelTopicTaskParams", + "UpdateStatusTaskParams", + "UpdateTrelloCardTaskParams", + "UpdateVictorOpsIncidentTaskParams", + "UpdateZendeskTicketTaskParams", + ]: try: if not isinstance(data, dict): raise TypeError() task_params_type_0 = AddActionItemTaskParams.from_dict(data) return task_params_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1300,7 +1345,7 @@ def _parse_task_params( task_params_type_1 = UpdateActionItemTaskParams.from_dict(data) return task_params_type_1 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1308,7 +1353,7 @@ def _parse_task_params( task_params_type_2 = AddRoleTaskParams.from_dict(data) return task_params_type_2 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1316,7 +1361,7 @@ def _parse_task_params( componentsschemasadd_slack_bookmark_task_params_type_0 = AddSlackBookmarkTaskParamsType0.from_dict(data) return componentsschemasadd_slack_bookmark_task_params_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1324,7 +1369,7 @@ def _parse_task_params( componentsschemasadd_slack_bookmark_task_params_type_1 = AddSlackBookmarkTaskParamsType1.from_dict(data) return componentsschemasadd_slack_bookmark_task_params_type_1 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1332,7 +1377,7 @@ def _parse_task_params( task_params_type_4 = AddTeamTaskParams.from_dict(data) return task_params_type_4 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1340,7 +1385,7 @@ def _parse_task_params( task_params_type_5 = AddToTimelineTaskParams.from_dict(data) return task_params_type_5 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1348,7 +1393,7 @@ def _parse_task_params( task_params_type_6 = ArchiveSlackChannelsTaskParams.from_dict(data) return task_params_type_6 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1356,7 +1401,7 @@ def _parse_task_params( task_params_type_7 = AttachDatadogDashboardsTaskParams.from_dict(data) return task_params_type_7 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1364,15 +1409,57 @@ def _parse_task_params( task_params_type_8 = AutoAssignRoleOpsgenieTaskParams.from_dict(data) return task_params_type_8 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + componentsschemasauto_assign_role_rootly_task_params_type_0 = ( + AutoAssignRoleRootlyTaskParamsType0.from_dict(data) + ) + + return componentsschemasauto_assign_role_rootly_task_params_type_0 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + componentsschemasauto_assign_role_rootly_task_params_type_1 = ( + AutoAssignRoleRootlyTaskParamsType1.from_dict(data) + ) + + return componentsschemasauto_assign_role_rootly_task_params_type_1 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + componentsschemasauto_assign_role_rootly_task_params_type_2 = ( + AutoAssignRoleRootlyTaskParamsType2.from_dict(data) + ) + + return componentsschemasauto_assign_role_rootly_task_params_type_2 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + componentsschemasauto_assign_role_rootly_task_params_type_3 = ( + AutoAssignRoleRootlyTaskParamsType3.from_dict(data) + ) + + return componentsschemasauto_assign_role_rootly_task_params_type_3 + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_9 = AutoAssignRoleRootlyTaskParams.from_dict(data) + componentsschemasauto_assign_role_rootly_task_params_type_4 = ( + AutoAssignRoleRootlyTaskParamsType4.from_dict(data) + ) - return task_params_type_9 - except (TypeError, ValueError, AttributeError, KeyError): + return componentsschemasauto_assign_role_rootly_task_params_type_4 + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1382,7 +1469,7 @@ def _parse_task_params( ) return componentsschemasauto_assign_role_pagerduty_task_params_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1392,7 +1479,7 @@ def _parse_task_params( ) return componentsschemasauto_assign_role_pagerduty_task_params_type_1 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1400,7 +1487,7 @@ def _parse_task_params( task_params_type_11 = UpdatePagerdutyIncidentTaskParams.from_dict(data) return task_params_type_11 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1408,7 +1495,7 @@ def _parse_task_params( task_params_type_12 = CreatePagerdutyStatusUpdateTaskParams.from_dict(data) return task_params_type_12 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1416,7 +1503,7 @@ def _parse_task_params( task_params_type_13 = CreatePagertreeAlertTaskParams.from_dict(data) return task_params_type_13 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1424,7 +1511,7 @@ def _parse_task_params( task_params_type_14 = UpdatePagertreeAlertTaskParams.from_dict(data) return task_params_type_14 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1432,7 +1519,7 @@ def _parse_task_params( task_params_type_15 = AutoAssignRoleVictorOpsTaskParams.from_dict(data) return task_params_type_15 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1440,7 +1527,7 @@ def _parse_task_params( task_params_type_16 = CallPeopleTaskParams.from_dict(data) return task_params_type_16 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1448,7 +1535,7 @@ def _parse_task_params( task_params_type_17 = CreateAirtableTableRecordTaskParams.from_dict(data) return task_params_type_17 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1456,7 +1543,7 @@ def _parse_task_params( task_params_type_18 = CreateAsanaSubtaskTaskParams.from_dict(data) return task_params_type_18 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1464,7 +1551,7 @@ def _parse_task_params( task_params_type_19 = CreateAsanaTaskTaskParams.from_dict(data) return task_params_type_19 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1472,7 +1559,7 @@ def _parse_task_params( task_params_type_20 = CreateConfluencePageTaskParams.from_dict(data) return task_params_type_20 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1480,7 +1567,7 @@ def _parse_task_params( task_params_type_21 = CreateDatadogNotebookTaskParams.from_dict(data) return task_params_type_21 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1488,7 +1575,7 @@ def _parse_task_params( task_params_type_22 = CreateCodaPageTaskParams.from_dict(data) return task_params_type_22 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1496,7 +1583,7 @@ def _parse_task_params( task_params_type_23 = CreateDropboxPaperPageTaskParams.from_dict(data) return task_params_type_23 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1504,7 +1591,7 @@ def _parse_task_params( task_params_type_24 = CreateGithubIssueTaskParams.from_dict(data) return task_params_type_24 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1512,7 +1599,7 @@ def _parse_task_params( task_params_type_25 = CreateGitlabIssueTaskParams.from_dict(data) return task_params_type_25 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1520,7 +1607,7 @@ def _parse_task_params( task_params_type_26 = CreateOutlookEventTaskParams.from_dict(data) return task_params_type_26 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1528,7 +1615,7 @@ def _parse_task_params( task_params_type_27 = CreateGoogleCalendarEventTaskParams.from_dict(data) return task_params_type_27 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1536,7 +1623,7 @@ def _parse_task_params( task_params_type_28 = UpdateGoogleDocsPageTaskParams.from_dict(data) return task_params_type_28 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1544,7 +1631,7 @@ def _parse_task_params( task_params_type_29 = UpdateCodaPageTaskParams.from_dict(data) return task_params_type_29 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1552,7 +1639,7 @@ def _parse_task_params( task_params_type_30 = UpdateGoogleCalendarEventTaskParams.from_dict(data) return task_params_type_30 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1560,7 +1647,7 @@ def _parse_task_params( task_params_type_31 = CreateSharepointPageTaskParams.from_dict(data) return task_params_type_31 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1568,7 +1655,7 @@ def _parse_task_params( task_params_type_32 = CreateGoogleDocsPageTaskParams.from_dict(data) return task_params_type_32 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1576,7 +1663,7 @@ def _parse_task_params( task_params_type_33 = CreateGoogleDocsPermissionsTaskParams.from_dict(data) return task_params_type_33 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1584,7 +1671,7 @@ def _parse_task_params( task_params_type_34 = RemoveGoogleDocsPermissionsTaskParams.from_dict(data) return task_params_type_34 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1592,7 +1679,7 @@ def _parse_task_params( task_params_type_35 = CreateQuipPageTaskParams.from_dict(data) return task_params_type_35 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1600,7 +1687,7 @@ def _parse_task_params( task_params_type_36 = CreateGoogleMeetingTaskParams.from_dict(data) return task_params_type_36 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1608,7 +1695,7 @@ def _parse_task_params( task_params_type_37 = CreateGoToMeetingTaskParams.from_dict(data) return task_params_type_37 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1616,7 +1703,7 @@ def _parse_task_params( task_params_type_38 = CreateIncidentTaskParams.from_dict(data) return task_params_type_38 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1624,7 +1711,7 @@ def _parse_task_params( task_params_type_39 = CreateSubIncidentTaskParams.from_dict(data) return task_params_type_39 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1632,7 +1719,7 @@ def _parse_task_params( task_params_type_40 = CreateIncidentPostmortemTaskParams.from_dict(data) return task_params_type_40 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1640,7 +1727,7 @@ def _parse_task_params( task_params_type_41 = CreateJiraIssueTaskParams.from_dict(data) return task_params_type_41 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1648,7 +1735,7 @@ def _parse_task_params( task_params_type_42 = CreateJiraSubtaskTaskParams.from_dict(data) return task_params_type_42 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1656,55 +1743,63 @@ def _parse_task_params( task_params_type_43 = AttachRetrospectivePdfToJiraIssueTaskParams.from_dict(data) return task_params_type_43 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_44 = CreateLinearIssueTaskParams.from_dict(data) + task_params_type_44 = AttachRetrospectivePdfToFreshserviceTicketTaskParams.from_dict(data) return task_params_type_44 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_45 = CreateLinearSubtaskIssueTaskParams.from_dict(data) + task_params_type_45 = CreateLinearIssueTaskParams.from_dict(data) return task_params_type_45 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_46 = CreateLinearIssueCommentTaskParams.from_dict(data) + task_params_type_46 = CreateLinearSubtaskIssueTaskParams.from_dict(data) return task_params_type_46 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_47 = CreateMicrosoftTeamsMeetingTaskParams.from_dict(data) + task_params_type_47 = CreateLinearIssueCommentTaskParams.from_dict(data) return task_params_type_47 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_48 = CreateMicrosoftTeamsChannelTaskParams.from_dict(data) + task_params_type_48 = CreateMicrosoftTeamsMeetingTaskParams.from_dict(data) return task_params_type_48 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_49 = CreateMicrosoftTeamsChatTaskParams.from_dict(data) + task_params_type_49 = CreateMicrosoftTeamsChannelTaskParams.from_dict(data) return task_params_type_49 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + task_params_type_50 = CreateMicrosoftTeamsChatTaskParams.from_dict(data) + + return task_params_type_50 + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1714,7 +1809,7 @@ def _parse_task_params( ) return componentsschemasadd_microsoft_teams_tab_task_params_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1724,111 +1819,111 @@ def _parse_task_params( ) return componentsschemasadd_microsoft_teams_tab_task_params_type_1 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_51 = AddMicrosoftTeamsChatTabTaskParams.from_dict(data) - - return task_params_type_51 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - task_params_type_52 = CreateGoogleChatSpaceTaskParams.from_dict(data) + task_params_type_52 = AddMicrosoftTeamsChatTabTaskParams.from_dict(data) return task_params_type_52 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_53 = SendGoogleChatMessageTaskParams.from_dict(data) + task_params_type_53 = CreateGoogleChatSpaceTaskParams.from_dict(data) return task_params_type_53 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_54 = SendGoogleChatAttachmentsTaskParams.from_dict(data) + task_params_type_54 = SendGoogleChatMessageTaskParams.from_dict(data) return task_params_type_54 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_55 = InviteToGoogleChatSpaceTaskParams.from_dict(data) + task_params_type_55 = SendGoogleChatAttachmentsTaskParams.from_dict(data) return task_params_type_55 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_56 = ArchiveGoogleChatSpacesTaskParams.from_dict(data) + task_params_type_56 = InviteToGoogleChatSpaceTaskParams.from_dict(data) return task_params_type_56 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_57 = RenameGoogleChatSpaceTaskParams.from_dict(data) + task_params_type_57 = ArchiveGoogleChatSpacesTaskParams.from_dict(data) return task_params_type_57 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_58 = UpdateGoogleChatSpaceDescriptionTaskParams.from_dict(data) + task_params_type_58 = RenameGoogleChatSpaceTaskParams.from_dict(data) return task_params_type_58 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_59 = ChangeGoogleChatSpacePrivacyTaskParams.from_dict(data) + task_params_type_59 = UpdateGoogleChatSpaceDescriptionTaskParams.from_dict(data) return task_params_type_59 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_60 = ArchiveMicrosoftTeamsChannelsTaskParams.from_dict(data) + task_params_type_60 = ChangeGoogleChatSpacePrivacyTaskParams.from_dict(data) return task_params_type_60 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_61 = RenameMicrosoftTeamsChannelTaskParams.from_dict(data) + task_params_type_61 = ArchiveMicrosoftTeamsChannelsTaskParams.from_dict(data) return task_params_type_61 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_62 = InviteToMicrosoftTeamsChannelTaskParams.from_dict(data) + task_params_type_62 = RenameMicrosoftTeamsChannelTaskParams.from_dict(data) return task_params_type_62 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_63 = CreateNotionPageTaskParams.from_dict(data) + task_params_type_63 = InviteToMicrosoftTeamsChannelTaskParams.from_dict(data) return task_params_type_63 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + task_params_type_64 = CreateNotionPageTaskParams.from_dict(data) + + return task_params_type_64 + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1838,15 +1933,15 @@ def _parse_task_params( ) return componentsschemassend_microsoft_teams_message_task_params_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_65 = SendMicrosoftTeamsChatMessageTaskParams.from_dict(data) + task_params_type_66 = SendMicrosoftTeamsChatMessageTaskParams.from_dict(data) - return task_params_type_65 - except (TypeError, ValueError, AttributeError, KeyError): + return task_params_type_66 + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1856,63 +1951,63 @@ def _parse_task_params( ) return componentsschemassend_microsoft_teams_blocks_task_params_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - task_params_type_67 = UpdateNotionPageTaskParams.from_dict(data) - - return task_params_type_67 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_68 = UpdateQuipPageTaskParams.from_dict(data) + task_params_type_68 = UpdateNotionPageTaskParams.from_dict(data) return task_params_type_68 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_69 = UpdateConfluencePageTaskParams.from_dict(data) + task_params_type_69 = UpdateQuipPageTaskParams.from_dict(data) return task_params_type_69 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_70 = UpdateSharepointPageTaskParams.from_dict(data) + task_params_type_70 = UpdateConfluencePageTaskParams.from_dict(data) return task_params_type_70 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_71 = UpdateDropboxPaperPageTaskParams.from_dict(data) + task_params_type_71 = UpdateSharepointPageTaskParams.from_dict(data) return task_params_type_71 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_72 = UpdateDatadogNotebookTaskParams.from_dict(data) + task_params_type_72 = UpdateDropboxPaperPageTaskParams.from_dict(data) return task_params_type_72 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_73 = CreateServiceNowIncidentTaskParams.from_dict(data) + task_params_type_73 = UpdateDatadogNotebookTaskParams.from_dict(data) return task_params_type_73 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + task_params_type_74 = CreateServiceNowIncidentTaskParams.from_dict(data) + + return task_params_type_74 + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1922,7 +2017,7 @@ def _parse_task_params( ) return componentsschemascreate_shortcut_story_task_params_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1932,71 +2027,71 @@ def _parse_task_params( ) return componentsschemascreate_shortcut_story_task_params_type_1 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - task_params_type_75 = CreateShortcutTaskTaskParams.from_dict(data) - - return task_params_type_75 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_76 = CreateTrelloCardTaskParams.from_dict(data) + task_params_type_76 = CreateShortcutTaskTaskParams.from_dict(data) return task_params_type_76 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_77 = CreateWebexMeetingTaskParams.from_dict(data) + task_params_type_77 = CreateTrelloCardTaskParams.from_dict(data) return task_params_type_77 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_78 = CreateZendeskTicketTaskParams.from_dict(data) + task_params_type_78 = CreateWebexMeetingTaskParams.from_dict(data) return task_params_type_78 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_79 = CreateZendeskJiraLinkTaskParams.from_dict(data) + task_params_type_79 = CreateZendeskTicketTaskParams.from_dict(data) return task_params_type_79 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_80 = CreateClickupTaskTaskParams.from_dict(data) + task_params_type_80 = CreateZendeskJiraLinkTaskParams.from_dict(data) return task_params_type_80 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_81 = CreateMotionTaskTaskParams.from_dict(data) + task_params_type_81 = CreateClickupTaskTaskParams.from_dict(data) return task_params_type_81 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_82 = CreateZoomMeetingTaskParams.from_dict(data) + task_params_type_82 = CreateMotionTaskTaskParams.from_dict(data) return task_params_type_82 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + task_params_type_83 = CreateZoomMeetingTaskParams.from_dict(data) + + return task_params_type_83 + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -2004,7 +2099,7 @@ def _parse_task_params( componentsschemasget_github_commits_task_params_type_0 = GetGithubCommitsTaskParamsType0.from_dict(data) return componentsschemasget_github_commits_task_params_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -2012,7 +2107,7 @@ def _parse_task_params( componentsschemasget_github_commits_task_params_type_1 = GetGithubCommitsTaskParamsType1.from_dict(data) return componentsschemasget_github_commits_task_params_type_1 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -2020,7 +2115,7 @@ def _parse_task_params( componentsschemasget_gitlab_commits_task_params_type_0 = GetGitlabCommitsTaskParamsType0.from_dict(data) return componentsschemasget_gitlab_commits_task_params_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -2028,55 +2123,55 @@ def _parse_task_params( componentsschemasget_gitlab_commits_task_params_type_1 = GetGitlabCommitsTaskParamsType1.from_dict(data) return componentsschemasget_gitlab_commits_task_params_type_1 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_85 = GetPulsesTaskParams.from_dict(data) - - return task_params_type_85 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - task_params_type_86 = GetAlertsTaskParams.from_dict(data) + task_params_type_86 = GetPulsesTaskParams.from_dict(data) return task_params_type_86 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_87 = HttpClientTaskParams.from_dict(data) + task_params_type_87 = GetAlertsTaskParams.from_dict(data) return task_params_type_87 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_88 = InviteToSlackChannelOpsgenieTaskParams.from_dict(data) + task_params_type_88 = HttpClientTaskParams.from_dict(data) return task_params_type_88 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_89 = InviteToSlackChannelRootlyTaskParams.from_dict(data) + task_params_type_89 = InviteToSlackChannelOpsgenieTaskParams.from_dict(data) return task_params_type_89 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_90 = InviteToMicrosoftTeamsChannelRootlyTaskParams.from_dict(data) + task_params_type_90 = InviteToSlackChannelRootlyTaskParams.from_dict(data) return task_params_type_90 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + task_params_type_91 = InviteToMicrosoftTeamsChannelRootlyTaskParams.from_dict(data) + + return task_params_type_91 + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -2086,7 +2181,7 @@ def _parse_task_params( ) return componentsschemasinvite_to_slack_channel_pagerduty_task_params_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -2096,7 +2191,7 @@ def _parse_task_params( ) return componentsschemasinvite_to_slack_channel_pagerduty_task_params_type_1 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -2106,7 +2201,7 @@ def _parse_task_params( ) return componentsschemasinvite_to_slack_channel_task_params_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -2116,7 +2211,7 @@ def _parse_task_params( ) return componentsschemasinvite_to_slack_channel_task_params_type_1 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -2126,79 +2221,79 @@ def _parse_task_params( ) return componentsschemasinvite_to_slack_channel_task_params_type_2 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_93 = InviteToSlackChannelVictorOpsTaskParams.from_dict(data) - - return task_params_type_93 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - task_params_type_94 = PageOpsgenieOnCallRespondersTaskParams.from_dict(data) + task_params_type_94 = InviteToSlackChannelVictorOpsTaskParams.from_dict(data) return task_params_type_94 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_95 = CreateOpsgenieAlertTaskParams.from_dict(data) + task_params_type_95 = PageOpsgenieOnCallRespondersTaskParams.from_dict(data) return task_params_type_95 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_96 = CreateJsmopsAlertTaskParams.from_dict(data) + task_params_type_96 = CreateOpsgenieAlertTaskParams.from_dict(data) return task_params_type_96 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_97 = PageJsmopsOnCallRespondersTaskParams.from_dict(data) + task_params_type_97 = CreateJsmopsAlertTaskParams.from_dict(data) return task_params_type_97 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_98 = UpdateOpsgenieAlertTaskParams.from_dict(data) + task_params_type_98 = PageJsmopsOnCallRespondersTaskParams.from_dict(data) return task_params_type_98 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_99 = UpdateOpsgenieIncidentTaskParams.from_dict(data) + task_params_type_99 = UpdateOpsgenieAlertTaskParams.from_dict(data) return task_params_type_99 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_100 = PageRootlyOnCallRespondersTaskParams.from_dict(data) + task_params_type_100 = UpdateOpsgenieIncidentTaskParams.from_dict(data) return task_params_type_100 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_101 = PagePagerdutyOnCallRespondersTaskParams.from_dict(data) + task_params_type_101 = PageRootlyOnCallRespondersTaskParams.from_dict(data) return task_params_type_101 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + task_params_type_102 = PagePagerdutyOnCallRespondersTaskParams.from_dict(data) + + return task_params_type_102 + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -2208,7 +2303,7 @@ def _parse_task_params( ) return componentsschemaspage_victor_ops_on_call_responders_task_params_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -2218,87 +2313,87 @@ def _parse_task_params( ) return componentsschemaspage_victor_ops_on_call_responders_task_params_type_1 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - task_params_type_103 = UpdateVictorOpsIncidentTaskParams.from_dict(data) - - return task_params_type_103 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_104 = PrintTaskParams.from_dict(data) + task_params_type_104 = UpdateVictorOpsIncidentTaskParams.from_dict(data) return task_params_type_104 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_105 = PublishIncidentTaskParams.from_dict(data) + task_params_type_105 = PrintTaskParams.from_dict(data) return task_params_type_105 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_106 = RedisClientTaskParams.from_dict(data) + task_params_type_106 = PublishIncidentTaskParams.from_dict(data) return task_params_type_106 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_107 = RenameSlackChannelTaskParams.from_dict(data) + task_params_type_107 = RedisClientTaskParams.from_dict(data) return task_params_type_107 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_108 = ChangeSlackChannelPrivacyTaskParams.from_dict(data) + task_params_type_108 = RenameSlackChannelTaskParams.from_dict(data) return task_params_type_108 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_109 = RunCommandHerokuTaskParams.from_dict(data) + task_params_type_109 = ChangeSlackChannelPrivacyTaskParams.from_dict(data) return task_params_type_109 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_110 = SendEmailTaskParams.from_dict(data) + task_params_type_110 = RunCommandHerokuTaskParams.from_dict(data) return task_params_type_110 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_111 = SendDashboardReportTaskParams.from_dict(data) + task_params_type_111 = SendEmailTaskParams.from_dict(data) return task_params_type_111 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_112 = CreateSlackChannelTaskParams.from_dict(data) + task_params_type_112 = SendDashboardReportTaskParams.from_dict(data) return task_params_type_112 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + task_params_type_113 = CreateSlackChannelTaskParams.from_dict(data) + + return task_params_type_113 + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -2306,7 +2401,7 @@ def _parse_task_params( componentsschemassend_slack_message_task_params_type_0 = SendSlackMessageTaskParamsType0.from_dict(data) return componentsschemassend_slack_message_task_params_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -2314,7 +2409,7 @@ def _parse_task_params( componentsschemassend_slack_message_task_params_type_1 = SendSlackMessageTaskParamsType1.from_dict(data) return componentsschemassend_slack_message_task_params_type_1 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -2322,223 +2417,223 @@ def _parse_task_params( componentsschemassend_slack_message_task_params_type_2 = SendSlackMessageTaskParamsType2.from_dict(data) return componentsschemassend_slack_message_task_params_type_2 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_114 = SendSmsTaskParams.from_dict(data) - - return task_params_type_114 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - task_params_type_115 = SendWhatsappMessageTaskParams.from_dict(data) + task_params_type_115 = SendSmsTaskParams.from_dict(data) return task_params_type_115 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_116 = SnapshotDatadogGraphTaskParams.from_dict(data) + task_params_type_116 = SendWhatsappMessageTaskParams.from_dict(data) return task_params_type_116 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_117 = SnapshotGrafanaDashboardTaskParams.from_dict(data) + task_params_type_117 = SnapshotDatadogGraphTaskParams.from_dict(data) return task_params_type_117 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_118 = SnapshotLookerLookTaskParams.from_dict(data) + task_params_type_118 = SnapshotGrafanaDashboardTaskParams.from_dict(data) return task_params_type_118 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_119 = SnapshotNewRelicGraphTaskParams.from_dict(data) + task_params_type_119 = SnapshotLookerLookTaskParams.from_dict(data) return task_params_type_119 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_120 = TweetTwitterMessageTaskParams.from_dict(data) + task_params_type_120 = SnapshotNewRelicGraphTaskParams.from_dict(data) return task_params_type_120 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_121 = UpdateAirtableTableRecordTaskParams.from_dict(data) + task_params_type_121 = TweetTwitterMessageTaskParams.from_dict(data) return task_params_type_121 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_122 = UpdateAsanaTaskTaskParams.from_dict(data) + task_params_type_122 = UpdateAirtableTableRecordTaskParams.from_dict(data) return task_params_type_122 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_123 = UpdateGithubIssueTaskParams.from_dict(data) + task_params_type_123 = UpdateAsanaTaskTaskParams.from_dict(data) return task_params_type_123 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_124 = UpdateGitlabIssueTaskParams.from_dict(data) + task_params_type_124 = UpdateGithubIssueTaskParams.from_dict(data) return task_params_type_124 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_125 = UpdateIncidentTaskParams.from_dict(data) + task_params_type_125 = UpdateGitlabIssueTaskParams.from_dict(data) return task_params_type_125 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_126 = UpdateIncidentPostmortemTaskParams.from_dict(data) + task_params_type_126 = UpdateIncidentTaskParams.from_dict(data) return task_params_type_126 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_127 = UpdateJiraIssueTaskParams.from_dict(data) + task_params_type_127 = UpdateIncidentPostmortemTaskParams.from_dict(data) return task_params_type_127 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_128 = UpdateLinearIssueTaskParams.from_dict(data) + task_params_type_128 = UpdateJiraIssueTaskParams.from_dict(data) return task_params_type_128 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_129 = UpdateServiceNowIncidentTaskParams.from_dict(data) + task_params_type_129 = UpdateLinearIssueTaskParams.from_dict(data) return task_params_type_129 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_130 = UpdateShortcutStoryTaskParams.from_dict(data) + task_params_type_130 = UpdateServiceNowIncidentTaskParams.from_dict(data) return task_params_type_130 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_131 = UpdateShortcutTaskTaskParams.from_dict(data) + task_params_type_131 = UpdateShortcutStoryTaskParams.from_dict(data) return task_params_type_131 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_132 = UpdateSlackChannelTopicTaskParams.from_dict(data) + task_params_type_132 = UpdateShortcutTaskTaskParams.from_dict(data) return task_params_type_132 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_133 = UpdateStatusTaskParams.from_dict(data) + task_params_type_133 = UpdateSlackChannelTopicTaskParams.from_dict(data) return task_params_type_133 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_134 = UpdateIncidentStatusTimestampTaskParams.from_dict(data) + task_params_type_134 = UpdateStatusTaskParams.from_dict(data) return task_params_type_134 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_135 = UpdateTrelloCardTaskParams.from_dict(data) + task_params_type_135 = UpdateIncidentStatusTimestampTaskParams.from_dict(data) return task_params_type_135 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_136 = UpdateClickupTaskTaskParams.from_dict(data) + task_params_type_136 = UpdateTrelloCardTaskParams.from_dict(data) return task_params_type_136 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_137 = UpdateMotionTaskTaskParams.from_dict(data) + task_params_type_137 = UpdateClickupTaskTaskParams.from_dict(data) return task_params_type_137 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_138 = UpdateZendeskTicketTaskParams.from_dict(data) + task_params_type_138 = UpdateMotionTaskTaskParams.from_dict(data) return task_params_type_138 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_139 = UpdateAttachedAlertsTaskParams.from_dict(data) + task_params_type_139 = UpdateZendeskTicketTaskParams.from_dict(data) return task_params_type_139 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_140 = TriggerWorkflowTaskParams.from_dict(data) + task_params_type_140 = UpdateAttachedAlertsTaskParams.from_dict(data) return task_params_type_140 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + task_params_type_141 = TriggerWorkflowTaskParams.from_dict(data) + + return task_params_type_141 + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -2546,7 +2641,7 @@ def _parse_task_params( componentsschemassend_slack_blocks_task_params_type_0 = SendSlackBlocksTaskParamsType0.from_dict(data) return componentsschemassend_slack_blocks_task_params_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -2554,7 +2649,7 @@ def _parse_task_params( componentsschemassend_slack_blocks_task_params_type_1 = SendSlackBlocksTaskParamsType1.from_dict(data) return componentsschemassend_slack_blocks_task_params_type_1 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -2562,45 +2657,45 @@ def _parse_task_params( componentsschemassend_slack_blocks_task_params_type_2 = SendSlackBlocksTaskParamsType2.from_dict(data) return componentsschemassend_slack_blocks_task_params_type_2 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_142 = CreateOpenaiChatCompletionTaskParams.from_dict(data) + task_params_type_143 = CreateOpenaiChatCompletionTaskParams.from_dict(data) - return task_params_type_142 - except (TypeError, ValueError, AttributeError, KeyError): + return task_params_type_143 + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_143 = CreateWatsonxChatCompletionTaskParams.from_dict(data) + task_params_type_144 = CreateWatsonxChatCompletionTaskParams.from_dict(data) - return task_params_type_143 - except (TypeError, ValueError, AttributeError, KeyError): + return task_params_type_144 + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_144 = CreateGoogleGeminiChatCompletionTaskParams.from_dict(data) + task_params_type_145 = CreateGoogleGeminiChatCompletionTaskParams.from_dict(data) - return task_params_type_144 - except (TypeError, ValueError, AttributeError, KeyError): + return task_params_type_145 + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_145 = CreateMistralChatCompletionTaskParams.from_dict(data) + task_params_type_146 = CreateMistralChatCompletionTaskParams.from_dict(data) - return task_params_type_145 - except (TypeError, ValueError, AttributeError, KeyError): + return task_params_type_146 + except: # noqa: E722 pass if not isinstance(data, dict): raise TypeError() - task_params_type_146 = CreateAnthropicChatCompletionTaskParams.from_dict(data) + task_params_type_147 = CreateAnthropicChatCompletionTaskParams.from_dict(data) - return task_params_type_146 + return task_params_type_147 task_params = _parse_task_params(d.pop("task_params")) diff --git a/rootly_sdk/models/on_call_pay_report.py b/rootly_sdk/models/on_call_pay_report.py index dad69a6f..385e790c 100644 --- a/rootly_sdk/models/on_call_pay_report.py +++ b/rootly_sdk/models/on_call_pay_report.py @@ -1,8 +1,6 @@ -from __future__ import annotations - import datetime from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -24,25 +22,25 @@ class OnCallPayReport: end_date (datetime.date): The end date of the report period. created_at (datetime.datetime): updated_at (datetime.datetime): - total_duration (int | Unset): Total on-call duration in seconds. - users_count (int | Unset): Number of users included in the report. - currency (str | Unset): The currency code for monetary values. - pay_type (OnCallPayReportPayType | Unset): The pay calculation type. - hourly_rate_cents (int | Unset): Hourly pay rate in cents. - daily_rate_cents (int | Unset): Daily pay rate in cents. - total_pay_cents (int | Unset): Total pay amount in cents. - include_shadow (bool | Unset): Whether shadow shifts are included. - show_individual_shift_data (bool | Unset): Whether individual shift data is shown. - has_single_rate (bool | Unset): Whether a single rate is applied to all users. - enabled_granular_time_breakdown (bool | Unset): Whether granular time breakdown is enabled. - last_generated_at (datetime.datetime | None | Unset): When the report was last generated. - time_zone (None | str | Unset): The IANA timezone used to compute day and weekend boundaries for this report. - Defaults to the team's timezone. - use_responders_time_zone (bool | Unset): When true, each responder's personal timezone is used for their pay - calculation; otherwise the report-wide time_zone is used. - csv_file_url (None | str | Unset): Download URL for the generated CSV report. Null until the report is + total_duration (Union[Unset, int]): Total on-call duration in seconds. + users_count (Union[Unset, int]): Number of users included in the report. + currency (Union[Unset, str]): The currency code for monetary values. + pay_type (Union[Unset, OnCallPayReportPayType]): The pay calculation type. + hourly_rate_cents (Union[Unset, int]): Hourly pay rate in cents. + daily_rate_cents (Union[Unset, int]): Daily pay rate in cents. + total_pay_cents (Union[Unset, int]): Total pay amount in cents. + include_shadow (Union[Unset, bool]): Whether shadow shifts are included. + show_individual_shift_data (Union[Unset, bool]): Whether individual shift data is shown. + has_single_rate (Union[Unset, bool]): Whether a single rate is applied to all users. + enabled_granular_time_breakdown (Union[Unset, bool]): Whether granular time breakdown is enabled. + last_generated_at (Union[None, Unset, datetime.datetime]): When the report was last generated. + time_zone (Union[None, Unset, str]): The IANA timezone used to compute day and weekend boundaries for this + report. Defaults to the team's timezone. + use_responders_time_zone (Union[Unset, bool]): When true, each responder's personal timezone is used for their + pay calculation; otherwise the report-wide time_zone is used. + csv_file_url (Union[None, Unset, str]): Download URL for the generated CSV report. Null until the report is generated. - xlsx_file_url (None | str | Unset): Download URL for the generated XLSX report. Null until the report is + xlsx_file_url (Union[None, Unset, str]): Download URL for the generated XLSX report. Null until the report is generated. """ @@ -51,22 +49,22 @@ class OnCallPayReport: end_date: datetime.date created_at: datetime.datetime updated_at: datetime.datetime - total_duration: int | Unset = UNSET - users_count: int | Unset = UNSET - currency: str | Unset = UNSET - pay_type: OnCallPayReportPayType | Unset = UNSET - hourly_rate_cents: int | Unset = UNSET - daily_rate_cents: int | Unset = UNSET - total_pay_cents: int | Unset = UNSET - include_shadow: bool | Unset = UNSET - show_individual_shift_data: bool | Unset = UNSET - has_single_rate: bool | Unset = UNSET - enabled_granular_time_breakdown: bool | Unset = UNSET - last_generated_at: datetime.datetime | None | Unset = UNSET - time_zone: None | str | Unset = UNSET - use_responders_time_zone: bool | Unset = UNSET - csv_file_url: None | str | Unset = UNSET - xlsx_file_url: None | str | Unset = UNSET + total_duration: Union[Unset, int] = UNSET + users_count: Union[Unset, int] = UNSET + currency: Union[Unset, str] = UNSET + pay_type: Union[Unset, OnCallPayReportPayType] = UNSET + hourly_rate_cents: Union[Unset, int] = UNSET + daily_rate_cents: Union[Unset, int] = UNSET + total_pay_cents: Union[Unset, int] = UNSET + include_shadow: Union[Unset, bool] = UNSET + show_individual_shift_data: Union[Unset, bool] = UNSET + has_single_rate: Union[Unset, bool] = UNSET + enabled_granular_time_breakdown: Union[Unset, bool] = UNSET + last_generated_at: Union[None, Unset, datetime.datetime] = UNSET + time_zone: Union[None, Unset, str] = UNSET + use_responders_time_zone: Union[Unset, bool] = UNSET + csv_file_url: Union[None, Unset, str] = UNSET + xlsx_file_url: Union[None, Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -86,7 +84,7 @@ def to_dict(self) -> dict[str, Any]: currency = self.currency - pay_type: str | Unset = UNSET + pay_type: Union[Unset, str] = UNSET if not isinstance(self.pay_type, Unset): pay_type = self.pay_type @@ -104,7 +102,7 @@ def to_dict(self) -> dict[str, Any]: enabled_granular_time_breakdown = self.enabled_granular_time_breakdown - last_generated_at: None | str | Unset + last_generated_at: Union[None, Unset, str] if isinstance(self.last_generated_at, Unset): last_generated_at = UNSET elif isinstance(self.last_generated_at, datetime.datetime): @@ -112,7 +110,7 @@ def to_dict(self) -> dict[str, Any]: else: last_generated_at = self.last_generated_at - time_zone: None | str | Unset + time_zone: Union[None, Unset, str] if isinstance(self.time_zone, Unset): time_zone = UNSET else: @@ -120,13 +118,13 @@ def to_dict(self) -> dict[str, Any]: use_responders_time_zone = self.use_responders_time_zone - csv_file_url: None | str | Unset + csv_file_url: Union[None, Unset, str] if isinstance(self.csv_file_url, Unset): csv_file_url = UNSET else: csv_file_url = self.csv_file_url - xlsx_file_url: None | str | Unset + xlsx_file_url: Union[None, Unset, str] if isinstance(self.xlsx_file_url, Unset): xlsx_file_url = UNSET else: @@ -198,7 +196,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: currency = d.pop("currency", UNSET) _pay_type = d.pop("pay_type", UNSET) - pay_type: OnCallPayReportPayType | Unset + pay_type: Union[Unset, OnCallPayReportPayType] if isinstance(_pay_type, Unset): pay_type = UNSET else: @@ -218,7 +216,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: enabled_granular_time_breakdown = d.pop("enabled_granular_time_breakdown", UNSET) - def _parse_last_generated_at(data: object) -> datetime.datetime | None | Unset: + def _parse_last_generated_at(data: object) -> Union[None, Unset, datetime.datetime]: if data is None: return data if isinstance(data, Unset): @@ -229,38 +227,38 @@ def _parse_last_generated_at(data: object) -> datetime.datetime | None | Unset: last_generated_at_type_0 = isoparse(data) return last_generated_at_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(datetime.datetime | None | Unset, data) + return cast(Union[None, Unset, datetime.datetime], data) last_generated_at = _parse_last_generated_at(d.pop("last_generated_at", UNSET)) - def _parse_time_zone(data: object) -> None | str | Unset: + def _parse_time_zone(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) time_zone = _parse_time_zone(d.pop("time_zone", UNSET)) use_responders_time_zone = d.pop("use_responders_time_zone", UNSET) - def _parse_csv_file_url(data: object) -> None | str | Unset: + def _parse_csv_file_url(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) csv_file_url = _parse_csv_file_url(d.pop("csv_file_url", UNSET)) - def _parse_xlsx_file_url(data: object) -> None | str | Unset: + def _parse_xlsx_file_url(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) xlsx_file_url = _parse_xlsx_file_url(d.pop("xlsx_file_url", UNSET)) diff --git a/rootly_sdk/models/on_call_pay_report_list.py b/rootly_sdk/models/on_call_pay_report_list.py index 8bf6f298..9e48be5a 100644 --- a/rootly_sdk/models/on_call_pay_report_list.py +++ b/rootly_sdk/models/on_call_pay_report_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,20 +20,19 @@ class OnCallPayReportList: """ Attributes: - data (list[OnCallPayReportListDataItem]): + data (list['OnCallPayReportListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[OnCallPayReportListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["OnCallPayReportListDataItem"] + links: "Links" + meta: "Meta" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) on_call_pay_report_list = cls( data=data, diff --git a/rootly_sdk/models/on_call_pay_report_list_data_item.py b/rootly_sdk/models/on_call_pay_report_list_data_item.py index 4de3e80b..69a34c09 100644 --- a/rootly_sdk/models/on_call_pay_report_list_data_item.py +++ b/rootly_sdk/models/on_call_pay_report_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class OnCallPayReportListDataItem: id: str type_: OnCallPayReportListDataItemType - attributes: OnCallPayReport + attributes: "OnCallPayReport" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/on_call_pay_report_response.py b/rootly_sdk/models/on_call_pay_report_response.py index 4094814e..428cb766 100644 --- a/rootly_sdk/models/on_call_pay_report_response.py +++ b/rootly_sdk/models/on_call_pay_report_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,18 +19,17 @@ class OnCallPayReportResponse: """ Attributes: data (OnCallPayReportResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: OnCallPayReportResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "OnCallPayReportResponseData" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = OnCallPayReportResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) on_call_pay_report_response = cls( data=data, diff --git a/rootly_sdk/models/on_call_pay_report_response_data.py b/rootly_sdk/models/on_call_pay_report_response_data.py index c072c414..292fb0ab 100644 --- a/rootly_sdk/models/on_call_pay_report_response_data.py +++ b/rootly_sdk/models/on_call_pay_report_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class OnCallPayReportResponseData: id: str type_: OnCallPayReportResponseDataType - attributes: OnCallPayReport + attributes: "OnCallPayReport" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/on_call_role.py b/rootly_sdk/models/on_call_role.py index 6f9fbc29..7e596bbc 100644 --- a/rootly_sdk/models/on_call_role.py +++ b/rootly_sdk/models/on_call_role.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -114,63 +112,63 @@ class OnCallRole: name (str): The role name. created_at (str): updated_at (str): - slug (str | Unset): The role slug. - system_role (str | Unset): The kind of role Default: 'custom'. - alert_sources_permissions (list[OnCallRoleAlertSourcesPermissionsItem] | Unset): - alert_urgency_permissions (list[OnCallRoleAlertUrgencyPermissionsItem] | Unset): - alert_fields_permissions (list[OnCallRoleAlertFieldsPermissionsItem] | Unset): - alert_groups_permissions (list[OnCallRoleAlertGroupsPermissionsItem] | Unset): - alert_routing_rules_permissions (list[OnCallRoleAlertRoutingRulesPermissionsItem] | Unset): - on_call_readiness_report_permissions (list[OnCallRoleOnCallReadinessReportPermissionsItem] | Unset): - on_call_roles_permissions (list[OnCallRoleOnCallRolesPermissionsItem] | Unset): - alerts_permissions (list[OnCallRoleAlertsPermissionsItem] | Unset): - api_keys_permissions (list[OnCallRoleApiKeysPermissionsItem] | Unset): - audits_permissions (list[OnCallRoleAuditsPermissionsItem] | Unset): - contacts_permissions (list[OnCallRoleContactsPermissionsItem] | Unset): - escalation_policies_permissions (list[OnCallRoleEscalationPoliciesPermissionsItem] | Unset): - groups_permissions (list[OnCallRoleGroupsPermissionsItem] | Unset): - heartbeats_permissions (list[OnCallRoleHeartbeatsPermissionsItem] | Unset): - integrations_permissions (list[OnCallRoleIntegrationsPermissionsItem] | Unset): - invitations_permissions (list[OnCallRoleInvitationsPermissionsItem] | Unset): - live_call_routing_permissions (list[OnCallRoleLiveCallRoutingPermissionsItem] | Unset): - schedule_override_permissions (list[OnCallRoleScheduleOverridePermissionsItem] | Unset): - schedules_permissions (list[OnCallRoleSchedulesPermissionsItem] | Unset): - services_permissions (list[OnCallRoleServicesPermissionsItem] | Unset): - functionalities_permissions (list[OnCallRoleFunctionalitiesPermissionsItem] | Unset): - webhooks_permissions (list[OnCallRoleWebhooksPermissionsItem] | Unset): - workflows_permissions (list[OnCallRoleWorkflowsPermissionsItem] | Unset): - catalogs_permissions (list[OnCallRoleCatalogsPermissionsItem] | Unset): + slug (Union[Unset, str]): The role slug. + system_role (Union[Unset, str]): The kind of role Default: 'custom'. + alert_sources_permissions (Union[Unset, list[OnCallRoleAlertSourcesPermissionsItem]]): + alert_urgency_permissions (Union[Unset, list[OnCallRoleAlertUrgencyPermissionsItem]]): + alert_fields_permissions (Union[Unset, list[OnCallRoleAlertFieldsPermissionsItem]]): + alert_groups_permissions (Union[Unset, list[OnCallRoleAlertGroupsPermissionsItem]]): + alert_routing_rules_permissions (Union[Unset, list[OnCallRoleAlertRoutingRulesPermissionsItem]]): + on_call_readiness_report_permissions (Union[Unset, list[OnCallRoleOnCallReadinessReportPermissionsItem]]): + on_call_roles_permissions (Union[Unset, list[OnCallRoleOnCallRolesPermissionsItem]]): + alerts_permissions (Union[Unset, list[OnCallRoleAlertsPermissionsItem]]): + api_keys_permissions (Union[Unset, list[OnCallRoleApiKeysPermissionsItem]]): + audits_permissions (Union[Unset, list[OnCallRoleAuditsPermissionsItem]]): + contacts_permissions (Union[Unset, list[OnCallRoleContactsPermissionsItem]]): + escalation_policies_permissions (Union[Unset, list[OnCallRoleEscalationPoliciesPermissionsItem]]): + groups_permissions (Union[Unset, list[OnCallRoleGroupsPermissionsItem]]): + heartbeats_permissions (Union[Unset, list[OnCallRoleHeartbeatsPermissionsItem]]): + integrations_permissions (Union[Unset, list[OnCallRoleIntegrationsPermissionsItem]]): + invitations_permissions (Union[Unset, list[OnCallRoleInvitationsPermissionsItem]]): + live_call_routing_permissions (Union[Unset, list[OnCallRoleLiveCallRoutingPermissionsItem]]): + schedule_override_permissions (Union[Unset, list[OnCallRoleScheduleOverridePermissionsItem]]): + schedules_permissions (Union[Unset, list[OnCallRoleSchedulesPermissionsItem]]): + services_permissions (Union[Unset, list[OnCallRoleServicesPermissionsItem]]): + functionalities_permissions (Union[Unset, list[OnCallRoleFunctionalitiesPermissionsItem]]): + webhooks_permissions (Union[Unset, list[OnCallRoleWebhooksPermissionsItem]]): + workflows_permissions (Union[Unset, list[OnCallRoleWorkflowsPermissionsItem]]): + catalogs_permissions (Union[Unset, list[OnCallRoleCatalogsPermissionsItem]]): """ name: str created_at: str updated_at: str - slug: str | Unset = UNSET - system_role: str | Unset = "custom" - alert_sources_permissions: list[OnCallRoleAlertSourcesPermissionsItem] | Unset = UNSET - alert_urgency_permissions: list[OnCallRoleAlertUrgencyPermissionsItem] | Unset = UNSET - alert_fields_permissions: list[OnCallRoleAlertFieldsPermissionsItem] | Unset = UNSET - alert_groups_permissions: list[OnCallRoleAlertGroupsPermissionsItem] | Unset = UNSET - alert_routing_rules_permissions: list[OnCallRoleAlertRoutingRulesPermissionsItem] | Unset = UNSET - on_call_readiness_report_permissions: list[OnCallRoleOnCallReadinessReportPermissionsItem] | Unset = UNSET - on_call_roles_permissions: list[OnCallRoleOnCallRolesPermissionsItem] | Unset = UNSET - alerts_permissions: list[OnCallRoleAlertsPermissionsItem] | Unset = UNSET - api_keys_permissions: list[OnCallRoleApiKeysPermissionsItem] | Unset = UNSET - audits_permissions: list[OnCallRoleAuditsPermissionsItem] | Unset = UNSET - contacts_permissions: list[OnCallRoleContactsPermissionsItem] | Unset = UNSET - escalation_policies_permissions: list[OnCallRoleEscalationPoliciesPermissionsItem] | Unset = UNSET - groups_permissions: list[OnCallRoleGroupsPermissionsItem] | Unset = UNSET - heartbeats_permissions: list[OnCallRoleHeartbeatsPermissionsItem] | Unset = UNSET - integrations_permissions: list[OnCallRoleIntegrationsPermissionsItem] | Unset = UNSET - invitations_permissions: list[OnCallRoleInvitationsPermissionsItem] | Unset = UNSET - live_call_routing_permissions: list[OnCallRoleLiveCallRoutingPermissionsItem] | Unset = UNSET - schedule_override_permissions: list[OnCallRoleScheduleOverridePermissionsItem] | Unset = UNSET - schedules_permissions: list[OnCallRoleSchedulesPermissionsItem] | Unset = UNSET - services_permissions: list[OnCallRoleServicesPermissionsItem] | Unset = UNSET - functionalities_permissions: list[OnCallRoleFunctionalitiesPermissionsItem] | Unset = UNSET - webhooks_permissions: list[OnCallRoleWebhooksPermissionsItem] | Unset = UNSET - workflows_permissions: list[OnCallRoleWorkflowsPermissionsItem] | Unset = UNSET - catalogs_permissions: list[OnCallRoleCatalogsPermissionsItem] | Unset = UNSET + slug: Union[Unset, str] = UNSET + system_role: Union[Unset, str] = "custom" + alert_sources_permissions: Union[Unset, list[OnCallRoleAlertSourcesPermissionsItem]] = UNSET + alert_urgency_permissions: Union[Unset, list[OnCallRoleAlertUrgencyPermissionsItem]] = UNSET + alert_fields_permissions: Union[Unset, list[OnCallRoleAlertFieldsPermissionsItem]] = UNSET + alert_groups_permissions: Union[Unset, list[OnCallRoleAlertGroupsPermissionsItem]] = UNSET + alert_routing_rules_permissions: Union[Unset, list[OnCallRoleAlertRoutingRulesPermissionsItem]] = UNSET + on_call_readiness_report_permissions: Union[Unset, list[OnCallRoleOnCallReadinessReportPermissionsItem]] = UNSET + on_call_roles_permissions: Union[Unset, list[OnCallRoleOnCallRolesPermissionsItem]] = UNSET + alerts_permissions: Union[Unset, list[OnCallRoleAlertsPermissionsItem]] = UNSET + api_keys_permissions: Union[Unset, list[OnCallRoleApiKeysPermissionsItem]] = UNSET + audits_permissions: Union[Unset, list[OnCallRoleAuditsPermissionsItem]] = UNSET + contacts_permissions: Union[Unset, list[OnCallRoleContactsPermissionsItem]] = UNSET + escalation_policies_permissions: Union[Unset, list[OnCallRoleEscalationPoliciesPermissionsItem]] = UNSET + groups_permissions: Union[Unset, list[OnCallRoleGroupsPermissionsItem]] = UNSET + heartbeats_permissions: Union[Unset, list[OnCallRoleHeartbeatsPermissionsItem]] = UNSET + integrations_permissions: Union[Unset, list[OnCallRoleIntegrationsPermissionsItem]] = UNSET + invitations_permissions: Union[Unset, list[OnCallRoleInvitationsPermissionsItem]] = UNSET + live_call_routing_permissions: Union[Unset, list[OnCallRoleLiveCallRoutingPermissionsItem]] = UNSET + schedule_override_permissions: Union[Unset, list[OnCallRoleScheduleOverridePermissionsItem]] = UNSET + schedules_permissions: Union[Unset, list[OnCallRoleSchedulesPermissionsItem]] = UNSET + services_permissions: Union[Unset, list[OnCallRoleServicesPermissionsItem]] = UNSET + functionalities_permissions: Union[Unset, list[OnCallRoleFunctionalitiesPermissionsItem]] = UNSET + webhooks_permissions: Union[Unset, list[OnCallRoleWebhooksPermissionsItem]] = UNSET + workflows_permissions: Union[Unset, list[OnCallRoleWorkflowsPermissionsItem]] = UNSET + catalogs_permissions: Union[Unset, list[OnCallRoleCatalogsPermissionsItem]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -184,168 +182,168 @@ def to_dict(self) -> dict[str, Any]: system_role = self.system_role - alert_sources_permissions: list[str] | Unset = UNSET + alert_sources_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.alert_sources_permissions, Unset): alert_sources_permissions = [] for alert_sources_permissions_item_data in self.alert_sources_permissions: alert_sources_permissions_item: str = alert_sources_permissions_item_data alert_sources_permissions.append(alert_sources_permissions_item) - alert_urgency_permissions: list[str] | Unset = UNSET + alert_urgency_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.alert_urgency_permissions, Unset): alert_urgency_permissions = [] for alert_urgency_permissions_item_data in self.alert_urgency_permissions: alert_urgency_permissions_item: str = alert_urgency_permissions_item_data alert_urgency_permissions.append(alert_urgency_permissions_item) - alert_fields_permissions: list[str] | Unset = UNSET + alert_fields_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.alert_fields_permissions, Unset): alert_fields_permissions = [] for alert_fields_permissions_item_data in self.alert_fields_permissions: alert_fields_permissions_item: str = alert_fields_permissions_item_data alert_fields_permissions.append(alert_fields_permissions_item) - alert_groups_permissions: list[str] | Unset = UNSET + alert_groups_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.alert_groups_permissions, Unset): alert_groups_permissions = [] for alert_groups_permissions_item_data in self.alert_groups_permissions: alert_groups_permissions_item: str = alert_groups_permissions_item_data alert_groups_permissions.append(alert_groups_permissions_item) - alert_routing_rules_permissions: list[str] | Unset = UNSET + alert_routing_rules_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.alert_routing_rules_permissions, Unset): alert_routing_rules_permissions = [] for alert_routing_rules_permissions_item_data in self.alert_routing_rules_permissions: alert_routing_rules_permissions_item: str = alert_routing_rules_permissions_item_data alert_routing_rules_permissions.append(alert_routing_rules_permissions_item) - on_call_readiness_report_permissions: list[str] | Unset = UNSET + on_call_readiness_report_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.on_call_readiness_report_permissions, Unset): on_call_readiness_report_permissions = [] for on_call_readiness_report_permissions_item_data in self.on_call_readiness_report_permissions: on_call_readiness_report_permissions_item: str = on_call_readiness_report_permissions_item_data on_call_readiness_report_permissions.append(on_call_readiness_report_permissions_item) - on_call_roles_permissions: list[str] | Unset = UNSET + on_call_roles_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.on_call_roles_permissions, Unset): on_call_roles_permissions = [] for on_call_roles_permissions_item_data in self.on_call_roles_permissions: on_call_roles_permissions_item: str = on_call_roles_permissions_item_data on_call_roles_permissions.append(on_call_roles_permissions_item) - alerts_permissions: list[str] | Unset = UNSET + alerts_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.alerts_permissions, Unset): alerts_permissions = [] for alerts_permissions_item_data in self.alerts_permissions: alerts_permissions_item: str = alerts_permissions_item_data alerts_permissions.append(alerts_permissions_item) - api_keys_permissions: list[str] | Unset = UNSET + api_keys_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.api_keys_permissions, Unset): api_keys_permissions = [] for api_keys_permissions_item_data in self.api_keys_permissions: api_keys_permissions_item: str = api_keys_permissions_item_data api_keys_permissions.append(api_keys_permissions_item) - audits_permissions: list[str] | Unset = UNSET + audits_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.audits_permissions, Unset): audits_permissions = [] for audits_permissions_item_data in self.audits_permissions: audits_permissions_item: str = audits_permissions_item_data audits_permissions.append(audits_permissions_item) - contacts_permissions: list[str] | Unset = UNSET + contacts_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.contacts_permissions, Unset): contacts_permissions = [] for contacts_permissions_item_data in self.contacts_permissions: contacts_permissions_item: str = contacts_permissions_item_data contacts_permissions.append(contacts_permissions_item) - escalation_policies_permissions: list[str] | Unset = UNSET + escalation_policies_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.escalation_policies_permissions, Unset): escalation_policies_permissions = [] for escalation_policies_permissions_item_data in self.escalation_policies_permissions: escalation_policies_permissions_item: str = escalation_policies_permissions_item_data escalation_policies_permissions.append(escalation_policies_permissions_item) - groups_permissions: list[str] | Unset = UNSET + groups_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.groups_permissions, Unset): groups_permissions = [] for groups_permissions_item_data in self.groups_permissions: groups_permissions_item: str = groups_permissions_item_data groups_permissions.append(groups_permissions_item) - heartbeats_permissions: list[str] | Unset = UNSET + heartbeats_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.heartbeats_permissions, Unset): heartbeats_permissions = [] for heartbeats_permissions_item_data in self.heartbeats_permissions: heartbeats_permissions_item: str = heartbeats_permissions_item_data heartbeats_permissions.append(heartbeats_permissions_item) - integrations_permissions: list[str] | Unset = UNSET + integrations_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.integrations_permissions, Unset): integrations_permissions = [] for integrations_permissions_item_data in self.integrations_permissions: integrations_permissions_item: str = integrations_permissions_item_data integrations_permissions.append(integrations_permissions_item) - invitations_permissions: list[str] | Unset = UNSET + invitations_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.invitations_permissions, Unset): invitations_permissions = [] for invitations_permissions_item_data in self.invitations_permissions: invitations_permissions_item: str = invitations_permissions_item_data invitations_permissions.append(invitations_permissions_item) - live_call_routing_permissions: list[str] | Unset = UNSET + live_call_routing_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.live_call_routing_permissions, Unset): live_call_routing_permissions = [] for live_call_routing_permissions_item_data in self.live_call_routing_permissions: live_call_routing_permissions_item: str = live_call_routing_permissions_item_data live_call_routing_permissions.append(live_call_routing_permissions_item) - schedule_override_permissions: list[str] | Unset = UNSET + schedule_override_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.schedule_override_permissions, Unset): schedule_override_permissions = [] for schedule_override_permissions_item_data in self.schedule_override_permissions: schedule_override_permissions_item: str = schedule_override_permissions_item_data schedule_override_permissions.append(schedule_override_permissions_item) - schedules_permissions: list[str] | Unset = UNSET + schedules_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.schedules_permissions, Unset): schedules_permissions = [] for schedules_permissions_item_data in self.schedules_permissions: schedules_permissions_item: str = schedules_permissions_item_data schedules_permissions.append(schedules_permissions_item) - services_permissions: list[str] | Unset = UNSET + services_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.services_permissions, Unset): services_permissions = [] for services_permissions_item_data in self.services_permissions: services_permissions_item: str = services_permissions_item_data services_permissions.append(services_permissions_item) - functionalities_permissions: list[str] | Unset = UNSET + functionalities_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.functionalities_permissions, Unset): functionalities_permissions = [] for functionalities_permissions_item_data in self.functionalities_permissions: functionalities_permissions_item: str = functionalities_permissions_item_data functionalities_permissions.append(functionalities_permissions_item) - webhooks_permissions: list[str] | Unset = UNSET + webhooks_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.webhooks_permissions, Unset): webhooks_permissions = [] for webhooks_permissions_item_data in self.webhooks_permissions: webhooks_permissions_item: str = webhooks_permissions_item_data webhooks_permissions.append(webhooks_permissions_item) - workflows_permissions: list[str] | Unset = UNSET + workflows_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.workflows_permissions, Unset): workflows_permissions = [] for workflows_permissions_item_data in self.workflows_permissions: workflows_permissions_item: str = workflows_permissions_item_data workflows_permissions.append(workflows_permissions_item) - catalogs_permissions: list[str] | Unset = UNSET + catalogs_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.catalogs_permissions, Unset): catalogs_permissions = [] for catalogs_permissions_item_data in self.catalogs_permissions: @@ -429,255 +427,201 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: system_role = d.pop("system_role", UNSET) + alert_sources_permissions = [] _alert_sources_permissions = d.pop("alert_sources_permissions", UNSET) - alert_sources_permissions: list[OnCallRoleAlertSourcesPermissionsItem] | Unset = UNSET - if _alert_sources_permissions is not UNSET: - alert_sources_permissions = [] - for alert_sources_permissions_item_data in _alert_sources_permissions: - alert_sources_permissions_item = check_on_call_role_alert_sources_permissions_item( - alert_sources_permissions_item_data - ) + for alert_sources_permissions_item_data in _alert_sources_permissions or []: + alert_sources_permissions_item = check_on_call_role_alert_sources_permissions_item( + alert_sources_permissions_item_data + ) - alert_sources_permissions.append(alert_sources_permissions_item) + alert_sources_permissions.append(alert_sources_permissions_item) + alert_urgency_permissions = [] _alert_urgency_permissions = d.pop("alert_urgency_permissions", UNSET) - alert_urgency_permissions: list[OnCallRoleAlertUrgencyPermissionsItem] | Unset = UNSET - if _alert_urgency_permissions is not UNSET: - alert_urgency_permissions = [] - for alert_urgency_permissions_item_data in _alert_urgency_permissions: - alert_urgency_permissions_item = check_on_call_role_alert_urgency_permissions_item( - alert_urgency_permissions_item_data - ) + for alert_urgency_permissions_item_data in _alert_urgency_permissions or []: + alert_urgency_permissions_item = check_on_call_role_alert_urgency_permissions_item( + alert_urgency_permissions_item_data + ) - alert_urgency_permissions.append(alert_urgency_permissions_item) + alert_urgency_permissions.append(alert_urgency_permissions_item) + alert_fields_permissions = [] _alert_fields_permissions = d.pop("alert_fields_permissions", UNSET) - alert_fields_permissions: list[OnCallRoleAlertFieldsPermissionsItem] | Unset = UNSET - if _alert_fields_permissions is not UNSET: - alert_fields_permissions = [] - for alert_fields_permissions_item_data in _alert_fields_permissions: - alert_fields_permissions_item = check_on_call_role_alert_fields_permissions_item( - alert_fields_permissions_item_data - ) + for alert_fields_permissions_item_data in _alert_fields_permissions or []: + alert_fields_permissions_item = check_on_call_role_alert_fields_permissions_item( + alert_fields_permissions_item_data + ) - alert_fields_permissions.append(alert_fields_permissions_item) + alert_fields_permissions.append(alert_fields_permissions_item) + alert_groups_permissions = [] _alert_groups_permissions = d.pop("alert_groups_permissions", UNSET) - alert_groups_permissions: list[OnCallRoleAlertGroupsPermissionsItem] | Unset = UNSET - if _alert_groups_permissions is not UNSET: - alert_groups_permissions = [] - for alert_groups_permissions_item_data in _alert_groups_permissions: - alert_groups_permissions_item = check_on_call_role_alert_groups_permissions_item( - alert_groups_permissions_item_data - ) + for alert_groups_permissions_item_data in _alert_groups_permissions or []: + alert_groups_permissions_item = check_on_call_role_alert_groups_permissions_item( + alert_groups_permissions_item_data + ) - alert_groups_permissions.append(alert_groups_permissions_item) + alert_groups_permissions.append(alert_groups_permissions_item) + alert_routing_rules_permissions = [] _alert_routing_rules_permissions = d.pop("alert_routing_rules_permissions", UNSET) - alert_routing_rules_permissions: list[OnCallRoleAlertRoutingRulesPermissionsItem] | Unset = UNSET - if _alert_routing_rules_permissions is not UNSET: - alert_routing_rules_permissions = [] - for alert_routing_rules_permissions_item_data in _alert_routing_rules_permissions: - alert_routing_rules_permissions_item = check_on_call_role_alert_routing_rules_permissions_item( - alert_routing_rules_permissions_item_data - ) + for alert_routing_rules_permissions_item_data in _alert_routing_rules_permissions or []: + alert_routing_rules_permissions_item = check_on_call_role_alert_routing_rules_permissions_item( + alert_routing_rules_permissions_item_data + ) - alert_routing_rules_permissions.append(alert_routing_rules_permissions_item) + alert_routing_rules_permissions.append(alert_routing_rules_permissions_item) + on_call_readiness_report_permissions = [] _on_call_readiness_report_permissions = d.pop("on_call_readiness_report_permissions", UNSET) - on_call_readiness_report_permissions: list[OnCallRoleOnCallReadinessReportPermissionsItem] | Unset = UNSET - if _on_call_readiness_report_permissions is not UNSET: - on_call_readiness_report_permissions = [] - for on_call_readiness_report_permissions_item_data in _on_call_readiness_report_permissions: - on_call_readiness_report_permissions_item = ( - check_on_call_role_on_call_readiness_report_permissions_item( - on_call_readiness_report_permissions_item_data - ) - ) + for on_call_readiness_report_permissions_item_data in _on_call_readiness_report_permissions or []: + on_call_readiness_report_permissions_item = check_on_call_role_on_call_readiness_report_permissions_item( + on_call_readiness_report_permissions_item_data + ) - on_call_readiness_report_permissions.append(on_call_readiness_report_permissions_item) + on_call_readiness_report_permissions.append(on_call_readiness_report_permissions_item) + on_call_roles_permissions = [] _on_call_roles_permissions = d.pop("on_call_roles_permissions", UNSET) - on_call_roles_permissions: list[OnCallRoleOnCallRolesPermissionsItem] | Unset = UNSET - if _on_call_roles_permissions is not UNSET: - on_call_roles_permissions = [] - for on_call_roles_permissions_item_data in _on_call_roles_permissions: - on_call_roles_permissions_item = check_on_call_role_on_call_roles_permissions_item( - on_call_roles_permissions_item_data - ) + for on_call_roles_permissions_item_data in _on_call_roles_permissions or []: + on_call_roles_permissions_item = check_on_call_role_on_call_roles_permissions_item( + on_call_roles_permissions_item_data + ) - on_call_roles_permissions.append(on_call_roles_permissions_item) + on_call_roles_permissions.append(on_call_roles_permissions_item) + alerts_permissions = [] _alerts_permissions = d.pop("alerts_permissions", UNSET) - alerts_permissions: list[OnCallRoleAlertsPermissionsItem] | Unset = UNSET - if _alerts_permissions is not UNSET: - alerts_permissions = [] - for alerts_permissions_item_data in _alerts_permissions: - alerts_permissions_item = check_on_call_role_alerts_permissions_item(alerts_permissions_item_data) + for alerts_permissions_item_data in _alerts_permissions or []: + alerts_permissions_item = check_on_call_role_alerts_permissions_item(alerts_permissions_item_data) - alerts_permissions.append(alerts_permissions_item) + alerts_permissions.append(alerts_permissions_item) + api_keys_permissions = [] _api_keys_permissions = d.pop("api_keys_permissions", UNSET) - api_keys_permissions: list[OnCallRoleApiKeysPermissionsItem] | Unset = UNSET - if _api_keys_permissions is not UNSET: - api_keys_permissions = [] - for api_keys_permissions_item_data in _api_keys_permissions: - api_keys_permissions_item = check_on_call_role_api_keys_permissions_item(api_keys_permissions_item_data) + for api_keys_permissions_item_data in _api_keys_permissions or []: + api_keys_permissions_item = check_on_call_role_api_keys_permissions_item(api_keys_permissions_item_data) - api_keys_permissions.append(api_keys_permissions_item) + api_keys_permissions.append(api_keys_permissions_item) + audits_permissions = [] _audits_permissions = d.pop("audits_permissions", UNSET) - audits_permissions: list[OnCallRoleAuditsPermissionsItem] | Unset = UNSET - if _audits_permissions is not UNSET: - audits_permissions = [] - for audits_permissions_item_data in _audits_permissions: - audits_permissions_item = check_on_call_role_audits_permissions_item(audits_permissions_item_data) + for audits_permissions_item_data in _audits_permissions or []: + audits_permissions_item = check_on_call_role_audits_permissions_item(audits_permissions_item_data) - audits_permissions.append(audits_permissions_item) + audits_permissions.append(audits_permissions_item) + contacts_permissions = [] _contacts_permissions = d.pop("contacts_permissions", UNSET) - contacts_permissions: list[OnCallRoleContactsPermissionsItem] | Unset = UNSET - if _contacts_permissions is not UNSET: - contacts_permissions = [] - for contacts_permissions_item_data in _contacts_permissions: - contacts_permissions_item = check_on_call_role_contacts_permissions_item(contacts_permissions_item_data) + for contacts_permissions_item_data in _contacts_permissions or []: + contacts_permissions_item = check_on_call_role_contacts_permissions_item(contacts_permissions_item_data) - contacts_permissions.append(contacts_permissions_item) + contacts_permissions.append(contacts_permissions_item) + escalation_policies_permissions = [] _escalation_policies_permissions = d.pop("escalation_policies_permissions", UNSET) - escalation_policies_permissions: list[OnCallRoleEscalationPoliciesPermissionsItem] | Unset = UNSET - if _escalation_policies_permissions is not UNSET: - escalation_policies_permissions = [] - for escalation_policies_permissions_item_data in _escalation_policies_permissions: - escalation_policies_permissions_item = check_on_call_role_escalation_policies_permissions_item( - escalation_policies_permissions_item_data - ) + for escalation_policies_permissions_item_data in _escalation_policies_permissions or []: + escalation_policies_permissions_item = check_on_call_role_escalation_policies_permissions_item( + escalation_policies_permissions_item_data + ) - escalation_policies_permissions.append(escalation_policies_permissions_item) + escalation_policies_permissions.append(escalation_policies_permissions_item) + groups_permissions = [] _groups_permissions = d.pop("groups_permissions", UNSET) - groups_permissions: list[OnCallRoleGroupsPermissionsItem] | Unset = UNSET - if _groups_permissions is not UNSET: - groups_permissions = [] - for groups_permissions_item_data in _groups_permissions: - groups_permissions_item = check_on_call_role_groups_permissions_item(groups_permissions_item_data) + for groups_permissions_item_data in _groups_permissions or []: + groups_permissions_item = check_on_call_role_groups_permissions_item(groups_permissions_item_data) - groups_permissions.append(groups_permissions_item) + groups_permissions.append(groups_permissions_item) + heartbeats_permissions = [] _heartbeats_permissions = d.pop("heartbeats_permissions", UNSET) - heartbeats_permissions: list[OnCallRoleHeartbeatsPermissionsItem] | Unset = UNSET - if _heartbeats_permissions is not UNSET: - heartbeats_permissions = [] - for heartbeats_permissions_item_data in _heartbeats_permissions: - heartbeats_permissions_item = check_on_call_role_heartbeats_permissions_item( - heartbeats_permissions_item_data - ) + for heartbeats_permissions_item_data in _heartbeats_permissions or []: + heartbeats_permissions_item = check_on_call_role_heartbeats_permissions_item( + heartbeats_permissions_item_data + ) - heartbeats_permissions.append(heartbeats_permissions_item) + heartbeats_permissions.append(heartbeats_permissions_item) + integrations_permissions = [] _integrations_permissions = d.pop("integrations_permissions", UNSET) - integrations_permissions: list[OnCallRoleIntegrationsPermissionsItem] | Unset = UNSET - if _integrations_permissions is not UNSET: - integrations_permissions = [] - for integrations_permissions_item_data in _integrations_permissions: - integrations_permissions_item = check_on_call_role_integrations_permissions_item( - integrations_permissions_item_data - ) + for integrations_permissions_item_data in _integrations_permissions or []: + integrations_permissions_item = check_on_call_role_integrations_permissions_item( + integrations_permissions_item_data + ) - integrations_permissions.append(integrations_permissions_item) + integrations_permissions.append(integrations_permissions_item) + invitations_permissions = [] _invitations_permissions = d.pop("invitations_permissions", UNSET) - invitations_permissions: list[OnCallRoleInvitationsPermissionsItem] | Unset = UNSET - if _invitations_permissions is not UNSET: - invitations_permissions = [] - for invitations_permissions_item_data in _invitations_permissions: - invitations_permissions_item = check_on_call_role_invitations_permissions_item( - invitations_permissions_item_data - ) + for invitations_permissions_item_data in _invitations_permissions or []: + invitations_permissions_item = check_on_call_role_invitations_permissions_item( + invitations_permissions_item_data + ) - invitations_permissions.append(invitations_permissions_item) + invitations_permissions.append(invitations_permissions_item) + live_call_routing_permissions = [] _live_call_routing_permissions = d.pop("live_call_routing_permissions", UNSET) - live_call_routing_permissions: list[OnCallRoleLiveCallRoutingPermissionsItem] | Unset = UNSET - if _live_call_routing_permissions is not UNSET: - live_call_routing_permissions = [] - for live_call_routing_permissions_item_data in _live_call_routing_permissions: - live_call_routing_permissions_item = check_on_call_role_live_call_routing_permissions_item( - live_call_routing_permissions_item_data - ) + for live_call_routing_permissions_item_data in _live_call_routing_permissions or []: + live_call_routing_permissions_item = check_on_call_role_live_call_routing_permissions_item( + live_call_routing_permissions_item_data + ) - live_call_routing_permissions.append(live_call_routing_permissions_item) + live_call_routing_permissions.append(live_call_routing_permissions_item) + schedule_override_permissions = [] _schedule_override_permissions = d.pop("schedule_override_permissions", UNSET) - schedule_override_permissions: list[OnCallRoleScheduleOverridePermissionsItem] | Unset = UNSET - if _schedule_override_permissions is not UNSET: - schedule_override_permissions = [] - for schedule_override_permissions_item_data in _schedule_override_permissions: - schedule_override_permissions_item = check_on_call_role_schedule_override_permissions_item( - schedule_override_permissions_item_data - ) + for schedule_override_permissions_item_data in _schedule_override_permissions or []: + schedule_override_permissions_item = check_on_call_role_schedule_override_permissions_item( + schedule_override_permissions_item_data + ) - schedule_override_permissions.append(schedule_override_permissions_item) + schedule_override_permissions.append(schedule_override_permissions_item) + schedules_permissions = [] _schedules_permissions = d.pop("schedules_permissions", UNSET) - schedules_permissions: list[OnCallRoleSchedulesPermissionsItem] | Unset = UNSET - if _schedules_permissions is not UNSET: - schedules_permissions = [] - for schedules_permissions_item_data in _schedules_permissions: - schedules_permissions_item = check_on_call_role_schedules_permissions_item( - schedules_permissions_item_data - ) + for schedules_permissions_item_data in _schedules_permissions or []: + schedules_permissions_item = check_on_call_role_schedules_permissions_item(schedules_permissions_item_data) - schedules_permissions.append(schedules_permissions_item) + schedules_permissions.append(schedules_permissions_item) + services_permissions = [] _services_permissions = d.pop("services_permissions", UNSET) - services_permissions: list[OnCallRoleServicesPermissionsItem] | Unset = UNSET - if _services_permissions is not UNSET: - services_permissions = [] - for services_permissions_item_data in _services_permissions: - services_permissions_item = check_on_call_role_services_permissions_item(services_permissions_item_data) + for services_permissions_item_data in _services_permissions or []: + services_permissions_item = check_on_call_role_services_permissions_item(services_permissions_item_data) - services_permissions.append(services_permissions_item) + services_permissions.append(services_permissions_item) + functionalities_permissions = [] _functionalities_permissions = d.pop("functionalities_permissions", UNSET) - functionalities_permissions: list[OnCallRoleFunctionalitiesPermissionsItem] | Unset = UNSET - if _functionalities_permissions is not UNSET: - functionalities_permissions = [] - for functionalities_permissions_item_data in _functionalities_permissions: - functionalities_permissions_item = check_on_call_role_functionalities_permissions_item( - functionalities_permissions_item_data - ) + for functionalities_permissions_item_data in _functionalities_permissions or []: + functionalities_permissions_item = check_on_call_role_functionalities_permissions_item( + functionalities_permissions_item_data + ) - functionalities_permissions.append(functionalities_permissions_item) + functionalities_permissions.append(functionalities_permissions_item) + webhooks_permissions = [] _webhooks_permissions = d.pop("webhooks_permissions", UNSET) - webhooks_permissions: list[OnCallRoleWebhooksPermissionsItem] | Unset = UNSET - if _webhooks_permissions is not UNSET: - webhooks_permissions = [] - for webhooks_permissions_item_data in _webhooks_permissions: - webhooks_permissions_item = check_on_call_role_webhooks_permissions_item(webhooks_permissions_item_data) + for webhooks_permissions_item_data in _webhooks_permissions or []: + webhooks_permissions_item = check_on_call_role_webhooks_permissions_item(webhooks_permissions_item_data) - webhooks_permissions.append(webhooks_permissions_item) + webhooks_permissions.append(webhooks_permissions_item) + workflows_permissions = [] _workflows_permissions = d.pop("workflows_permissions", UNSET) - workflows_permissions: list[OnCallRoleWorkflowsPermissionsItem] | Unset = UNSET - if _workflows_permissions is not UNSET: - workflows_permissions = [] - for workflows_permissions_item_data in _workflows_permissions: - workflows_permissions_item = check_on_call_role_workflows_permissions_item( - workflows_permissions_item_data - ) + for workflows_permissions_item_data in _workflows_permissions or []: + workflows_permissions_item = check_on_call_role_workflows_permissions_item(workflows_permissions_item_data) - workflows_permissions.append(workflows_permissions_item) + workflows_permissions.append(workflows_permissions_item) + catalogs_permissions = [] _catalogs_permissions = d.pop("catalogs_permissions", UNSET) - catalogs_permissions: list[OnCallRoleCatalogsPermissionsItem] | Unset = UNSET - if _catalogs_permissions is not UNSET: - catalogs_permissions = [] - for catalogs_permissions_item_data in _catalogs_permissions: - catalogs_permissions_item = check_on_call_role_catalogs_permissions_item(catalogs_permissions_item_data) + for catalogs_permissions_item_data in _catalogs_permissions or []: + catalogs_permissions_item = check_on_call_role_catalogs_permissions_item(catalogs_permissions_item_data) - catalogs_permissions.append(catalogs_permissions_item) + catalogs_permissions.append(catalogs_permissions_item) on_call_role = cls( name=name, diff --git a/rootly_sdk/models/on_call_role_list.py b/rootly_sdk/models/on_call_role_list.py index ae3d3942..473c4983 100644 --- a/rootly_sdk/models/on_call_role_list.py +++ b/rootly_sdk/models/on_call_role_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,20 +20,19 @@ class OnCallRoleList: """ Attributes: - data (list[OnCallRoleListDataItem]): + data (list['OnCallRoleListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[OnCallRoleListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["OnCallRoleListDataItem"] + links: "Links" + meta: "Meta" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) on_call_role_list = cls( data=data, diff --git a/rootly_sdk/models/on_call_role_list_data_item.py b/rootly_sdk/models/on_call_role_list_data_item.py index 2de264b6..615a062e 100644 --- a/rootly_sdk/models/on_call_role_list_data_item.py +++ b/rootly_sdk/models/on_call_role_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class OnCallRoleListDataItem: id: str type_: OnCallRoleListDataItemType - attributes: OnCallRole + attributes: "OnCallRole" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/on_call_role_relationship.py b/rootly_sdk/models/on_call_role_relationship.py index b1385f6f..72d980db 100644 --- a/rootly_sdk/models/on_call_role_relationship.py +++ b/rootly_sdk/models/on_call_role_relationship.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,16 +17,16 @@ class OnCallRoleRelationship: """ Attributes: - data (None | OnCallRoleRelationshipDataType0 | Unset): + data (Union['OnCallRoleRelationshipDataType0', None, Unset]): """ - data: None | OnCallRoleRelationshipDataType0 | Unset = UNSET + data: Union["OnCallRoleRelationshipDataType0", None, Unset] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: from ..models.on_call_role_relationship_data_type_0 import OnCallRoleRelationshipDataType0 - data: dict[str, Any] | None | Unset + data: Union[None, Unset, dict[str, Any]] if isinstance(self.data, Unset): data = UNSET elif isinstance(self.data, OnCallRoleRelationshipDataType0): @@ -50,7 +48,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_data(data: object) -> None | OnCallRoleRelationshipDataType0 | Unset: + def _parse_data(data: object) -> Union["OnCallRoleRelationshipDataType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -61,9 +59,9 @@ def _parse_data(data: object) -> None | OnCallRoleRelationshipDataType0 | Unset: data_type_0 = OnCallRoleRelationshipDataType0.from_dict(data) return data_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(None | OnCallRoleRelationshipDataType0 | Unset, data) + return cast(Union["OnCallRoleRelationshipDataType0", None, Unset], data) data = _parse_data(d.pop("data", UNSET)) diff --git a/rootly_sdk/models/on_call_role_relationship_data_type_0.py b/rootly_sdk/models/on_call_role_relationship_data_type_0.py index 20a1e8a6..2ade575d 100644 --- a/rootly_sdk/models/on_call_role_relationship_data_type_0.py +++ b/rootly_sdk/models/on_call_role_relationship_data_type_0.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,18 +17,18 @@ class OnCallRoleRelationshipDataType0: """ Attributes: - id (str | Unset): - type_ (OnCallRoleRelationshipDataType0Type | Unset): + id (Union[Unset, str]): + type_ (Union[Unset, OnCallRoleRelationshipDataType0Type]): """ - id: str | Unset = UNSET - type_: OnCallRoleRelationshipDataType0Type | Unset = UNSET + id: Union[Unset, str] = UNSET + type_: Union[Unset, OnCallRoleRelationshipDataType0Type] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: id = self.id - type_: str | Unset = UNSET + type_: Union[Unset, str] = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ @@ -50,7 +48,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: id = d.pop("id", UNSET) _type_ = d.pop("type", UNSET) - type_: OnCallRoleRelationshipDataType0Type | Unset + type_: Union[Unset, OnCallRoleRelationshipDataType0Type] if isinstance(_type_, Unset): type_ = UNSET else: diff --git a/rootly_sdk/models/on_call_role_response.py b/rootly_sdk/models/on_call_role_response.py index f6ba050c..6920d5d2 100644 --- a/rootly_sdk/models/on_call_role_response.py +++ b/rootly_sdk/models/on_call_role_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,18 +19,17 @@ class OnCallRoleResponse: """ Attributes: data (OnCallRoleResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: OnCallRoleResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "OnCallRoleResponseData" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = OnCallRoleResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) on_call_role_response = cls( data=data, diff --git a/rootly_sdk/models/on_call_role_response_data.py b/rootly_sdk/models/on_call_role_response_data.py index 6a49a2a1..805a5a45 100644 --- a/rootly_sdk/models/on_call_role_response_data.py +++ b/rootly_sdk/models/on_call_role_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class OnCallRoleResponseData: id: str type_: OnCallRoleResponseDataType - attributes: OnCallRole + attributes: "OnCallRole" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/on_call_shadow.py b/rootly_sdk/models/on_call_shadow.py index c04b4ed3..6148cde7 100644 --- a/rootly_sdk/models/on_call_shadow.py +++ b/rootly_sdk/models/on_call_shadow.py @@ -1,8 +1,6 @@ -from __future__ import annotations - import datetime from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -24,8 +22,8 @@ class OnCallShadow: shadow_user_id (int): Which user the shadow shift belongs to. starts_at (datetime.datetime): Start datetime of shadow shift ends_at (datetime.datetime): End datetime for shadow shift - created_at (str | Unset): Date of creation - updated_at (str | Unset): Date of last update + created_at (Union[Unset, str]): Date of creation + updated_at (Union[Unset, str]): Date of last update """ schedule_id: str @@ -34,8 +32,8 @@ class OnCallShadow: shadow_user_id: int starts_at: datetime.datetime ends_at: datetime.datetime - created_at: str | Unset = UNSET - updated_at: str | Unset = UNSET + created_at: Union[Unset, str] = UNSET + updated_at: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/on_call_shadow_response.py b/rootly_sdk/models/on_call_shadow_response.py index e9e20b04..1931bdbd 100644 --- a/rootly_sdk/models/on_call_shadow_response.py +++ b/rootly_sdk/models/on_call_shadow_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,18 +19,17 @@ class OnCallShadowResponse: """ Attributes: data (OnCallShadowResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: OnCallShadowResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "OnCallShadowResponseData" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = OnCallShadowResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) on_call_shadow_response = cls( data=data, diff --git a/rootly_sdk/models/on_call_shadow_response_data.py b/rootly_sdk/models/on_call_shadow_response_data.py index b0b5e603..8306a936 100644 --- a/rootly_sdk/models/on_call_shadow_response_data.py +++ b/rootly_sdk/models/on_call_shadow_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class OnCallShadowResponseData: id: str type_: OnCallShadowResponseDataType - attributes: OnCallShadow + attributes: "OnCallShadow" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/on_call_shadows_list.py b/rootly_sdk/models/on_call_shadows_list.py index cd3e8af6..b3e47d71 100644 --- a/rootly_sdk/models/on_call_shadows_list.py +++ b/rootly_sdk/models/on_call_shadows_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,20 +20,19 @@ class OnCallShadowsList: """ Attributes: - data (list[OnCallShadowsListDataItem]): + data (list['OnCallShadowsListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[OnCallShadowsListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["OnCallShadowsListDataItem"] + links: "Links" + meta: "Meta" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) on_call_shadows_list = cls( data=data, diff --git a/rootly_sdk/models/on_call_shadows_list_data_item.py b/rootly_sdk/models/on_call_shadows_list_data_item.py index ce854fcf..57322935 100644 --- a/rootly_sdk/models/on_call_shadows_list_data_item.py +++ b/rootly_sdk/models/on_call_shadows_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class OnCallShadowsListDataItem: id: str type_: OnCallShadowsListDataItemType - attributes: OnCallShadow + attributes: "OnCallShadow" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/oncall.py b/rootly_sdk/models/oncall.py index 7e3fac08..75746f3c 100644 --- a/rootly_sdk/models/oncall.py +++ b/rootly_sdk/models/oncall.py @@ -1,8 +1,6 @@ -from __future__ import annotations - import datetime from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,13 +21,14 @@ class Oncall: user_id (int): ID of the on-call user starts_at (datetime.datetime): Start datetime of the on-call shift ends_at (datetime.datetime): End datetime of the on-call shift - escalation_policy_path_id (None | str | Unset): ID of the escalation policy path - escalation_policy_path_name (None | str | Unset): Name of the escalation policy path - notification_type (OncallNotificationType | Unset): Notification type of the escalation path (audible or quiet) - is_default_path (bool | None | Unset): Whether this is the default escalation path - escalation_level (int | Unset): Level within the escalation policy - schedule_id (None | str | Unset): ID of the schedule - schedule_name (None | str | Unset): Name of the schedule + escalation_policy_path_id (Union[None, Unset, str]): ID of the escalation policy path + escalation_policy_path_name (Union[None, Unset, str]): Name of the escalation policy path + notification_type (Union[Unset, OncallNotificationType]): Notification type of the escalation path (audible or + quiet) + is_default_path (Union[None, Unset, bool]): Whether this is the default escalation path + escalation_level (Union[Unset, int]): Level within the escalation policy + schedule_id (Union[None, Unset, str]): ID of the schedule + schedule_name (Union[None, Unset, str]): Name of the schedule """ escalation_policy_id: str @@ -37,13 +36,13 @@ class Oncall: user_id: int starts_at: datetime.datetime ends_at: datetime.datetime - escalation_policy_path_id: None | str | Unset = UNSET - escalation_policy_path_name: None | str | Unset = UNSET - notification_type: OncallNotificationType | Unset = UNSET - is_default_path: bool | None | Unset = UNSET - escalation_level: int | Unset = UNSET - schedule_id: None | str | Unset = UNSET - schedule_name: None | str | Unset = UNSET + escalation_policy_path_id: Union[None, Unset, str] = UNSET + escalation_policy_path_name: Union[None, Unset, str] = UNSET + notification_type: Union[Unset, OncallNotificationType] = UNSET + is_default_path: Union[None, Unset, bool] = UNSET + escalation_level: Union[Unset, int] = UNSET + schedule_id: Union[None, Unset, str] = UNSET + schedule_name: Union[None, Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -57,23 +56,23 @@ def to_dict(self) -> dict[str, Any]: ends_at = self.ends_at.isoformat() - escalation_policy_path_id: None | str | Unset + escalation_policy_path_id: Union[None, Unset, str] if isinstance(self.escalation_policy_path_id, Unset): escalation_policy_path_id = UNSET else: escalation_policy_path_id = self.escalation_policy_path_id - escalation_policy_path_name: None | str | Unset + escalation_policy_path_name: Union[None, Unset, str] if isinstance(self.escalation_policy_path_name, Unset): escalation_policy_path_name = UNSET else: escalation_policy_path_name = self.escalation_policy_path_name - notification_type: str | Unset = UNSET + notification_type: Union[Unset, str] = UNSET if not isinstance(self.notification_type, Unset): notification_type = self.notification_type - is_default_path: bool | None | Unset + is_default_path: Union[None, Unset, bool] if isinstance(self.is_default_path, Unset): is_default_path = UNSET else: @@ -81,13 +80,13 @@ def to_dict(self) -> dict[str, Any]: escalation_level = self.escalation_level - schedule_id: None | str | Unset + schedule_id: Union[None, Unset, str] if isinstance(self.schedule_id, Unset): schedule_id = UNSET else: schedule_id = self.schedule_id - schedule_name: None | str | Unset + schedule_name: Union[None, Unset, str] if isinstance(self.schedule_name, Unset): schedule_name = UNSET else: @@ -134,57 +133,57 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: ends_at = isoparse(d.pop("ends_at")) - def _parse_escalation_policy_path_id(data: object) -> None | str | Unset: + def _parse_escalation_policy_path_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) escalation_policy_path_id = _parse_escalation_policy_path_id(d.pop("escalation_policy_path_id", UNSET)) - def _parse_escalation_policy_path_name(data: object) -> None | str | Unset: + def _parse_escalation_policy_path_name(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) escalation_policy_path_name = _parse_escalation_policy_path_name(d.pop("escalation_policy_path_name", UNSET)) _notification_type = d.pop("notification_type", UNSET) - notification_type: OncallNotificationType | Unset + notification_type: Union[Unset, OncallNotificationType] if isinstance(_notification_type, Unset): notification_type = UNSET else: notification_type = check_oncall_notification_type(_notification_type) - def _parse_is_default_path(data: object) -> bool | None | Unset: + def _parse_is_default_path(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) is_default_path = _parse_is_default_path(d.pop("is_default_path", UNSET)) escalation_level = d.pop("escalation_level", UNSET) - def _parse_schedule_id(data: object) -> None | str | Unset: + def _parse_schedule_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) schedule_id = _parse_schedule_id(d.pop("schedule_id", UNSET)) - def _parse_schedule_name(data: object) -> None | str | Unset: + def _parse_schedule_name(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) schedule_name = _parse_schedule_name(d.pop("schedule_name", UNSET)) diff --git a/rootly_sdk/models/oncall_list.py b/rootly_sdk/models/oncall_list.py index 30e12715..4401d2e6 100644 --- a/rootly_sdk/models/oncall_list.py +++ b/rootly_sdk/models/oncall_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -20,22 +18,21 @@ class OncallList: """ Attributes: - data (list[OncallListDataItem]): - included (list[JsonapiIncludedResource] | Unset): + data (list['OncallListDataItem']): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[OncallListDataItem] - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["OncallListDataItem"] + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() data.append(data_item) - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -67,14 +64,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data.append(data_item) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) oncall_list = cls( data=data, diff --git a/rootly_sdk/models/oncall_list_data_item.py b/rootly_sdk/models/oncall_list_data_item.py index b1860ed4..47296e95 100644 --- a/rootly_sdk/models/oncall_list_data_item.py +++ b/rootly_sdk/models/oncall_list_data_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -24,24 +22,23 @@ class OncallListDataItem: id (str): Unique ID of the on-call entry type_ (OncallListDataItemType): attributes (Oncall): - relationships (OncallRelationships | Unset): + relationships (Union[Unset, OncallRelationships]): """ id: str type_: OncallListDataItemType - attributes: Oncall - relationships: OncallRelationships | Unset = UNSET + attributes: "Oncall" + relationships: Union[Unset, "OncallRelationships"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ attributes = self.attributes.to_dict() - relationships: dict[str, Any] | Unset = UNSET + relationships: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.relationships, Unset): relationships = self.relationships.to_dict() @@ -72,7 +69,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = Oncall.from_dict(d.pop("attributes")) _relationships = d.pop("relationships", UNSET) - relationships: OncallRelationships | Unset + relationships: Union[Unset, OncallRelationships] if isinstance(_relationships, Unset): relationships = UNSET else: diff --git a/rootly_sdk/models/oncall_relationships.py b/rootly_sdk/models/oncall_relationships.py index c31f0763..9ce3782b 100644 --- a/rootly_sdk/models/oncall_relationships.py +++ b/rootly_sdk/models/oncall_relationships.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,27 +19,26 @@ class OncallRelationships: """ Attributes: - user (OncallRelationshipsUser | Unset): - schedule (OncallRelationshipsSchedule | Unset): - escalation_policy (OncallRelationshipsEscalationPolicy | Unset): + user (Union[Unset, OncallRelationshipsUser]): + schedule (Union[Unset, OncallRelationshipsSchedule]): + escalation_policy (Union[Unset, OncallRelationshipsEscalationPolicy]): """ - user: OncallRelationshipsUser | Unset = UNSET - schedule: OncallRelationshipsSchedule | Unset = UNSET - escalation_policy: OncallRelationshipsEscalationPolicy | Unset = UNSET + user: Union[Unset, "OncallRelationshipsUser"] = UNSET + schedule: Union[Unset, "OncallRelationshipsSchedule"] = UNSET + escalation_policy: Union[Unset, "OncallRelationshipsEscalationPolicy"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - - user: dict[str, Any] | Unset = UNSET + user: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.user, Unset): user = self.user.to_dict() - schedule: dict[str, Any] | Unset = UNSET + schedule: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.schedule, Unset): schedule = self.schedule.to_dict() - escalation_policy: dict[str, Any] | Unset = UNSET + escalation_policy: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.escalation_policy, Unset): escalation_policy = self.escalation_policy.to_dict() @@ -65,21 +62,21 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _user = d.pop("user", UNSET) - user: OncallRelationshipsUser | Unset + user: Union[Unset, OncallRelationshipsUser] if isinstance(_user, Unset): user = UNSET else: user = OncallRelationshipsUser.from_dict(_user) _schedule = d.pop("schedule", UNSET) - schedule: OncallRelationshipsSchedule | Unset + schedule: Union[Unset, OncallRelationshipsSchedule] if isinstance(_schedule, Unset): schedule = UNSET else: schedule = OncallRelationshipsSchedule.from_dict(_schedule) _escalation_policy = d.pop("escalation_policy", UNSET) - escalation_policy: OncallRelationshipsEscalationPolicy | Unset + escalation_policy: Union[Unset, OncallRelationshipsEscalationPolicy] if isinstance(_escalation_policy, Unset): escalation_policy = UNSET else: diff --git a/rootly_sdk/models/oncall_relationships_escalation_policy.py b/rootly_sdk/models/oncall_relationships_escalation_policy.py index 6d5b37df..d780c90c 100644 --- a/rootly_sdk/models/oncall_relationships_escalation_policy.py +++ b/rootly_sdk/models/oncall_relationships_escalation_policy.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,10 +17,10 @@ class OncallRelationshipsEscalationPolicy: """ Attributes: - data (None | OncallRelationshipsEscalationPolicyDataType0 | Unset): + data (Union['OncallRelationshipsEscalationPolicyDataType0', None, Unset]): """ - data: None | OncallRelationshipsEscalationPolicyDataType0 | Unset = UNSET + data: Union["OncallRelationshipsEscalationPolicyDataType0", None, Unset] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -30,7 +28,7 @@ def to_dict(self) -> dict[str, Any]: OncallRelationshipsEscalationPolicyDataType0, ) - data: dict[str, Any] | None | Unset + data: Union[None, Unset, dict[str, Any]] if isinstance(self.data, Unset): data = UNSET elif isinstance(self.data, OncallRelationshipsEscalationPolicyDataType0): @@ -54,7 +52,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_data(data: object) -> None | OncallRelationshipsEscalationPolicyDataType0 | Unset: + def _parse_data(data: object) -> Union["OncallRelationshipsEscalationPolicyDataType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -65,9 +63,9 @@ def _parse_data(data: object) -> None | OncallRelationshipsEscalationPolicyDataT data_type_0 = OncallRelationshipsEscalationPolicyDataType0.from_dict(data) return data_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(None | OncallRelationshipsEscalationPolicyDataType0 | Unset, data) + return cast(Union["OncallRelationshipsEscalationPolicyDataType0", None, Unset], data) data = _parse_data(d.pop("data", UNSET)) diff --git a/rootly_sdk/models/oncall_relationships_escalation_policy_data_type_0.py b/rootly_sdk/models/oncall_relationships_escalation_policy_data_type_0.py index 5f4db389..2107f220 100644 --- a/rootly_sdk/models/oncall_relationships_escalation_policy_data_type_0.py +++ b/rootly_sdk/models/oncall_relationships_escalation_policy_data_type_0.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,18 +17,18 @@ class OncallRelationshipsEscalationPolicyDataType0: """ Attributes: - id (str | Unset): - type_ (OncallRelationshipsEscalationPolicyDataType0Type | Unset): + id (Union[Unset, str]): + type_ (Union[Unset, OncallRelationshipsEscalationPolicyDataType0Type]): """ - id: str | Unset = UNSET - type_: OncallRelationshipsEscalationPolicyDataType0Type | Unset = UNSET + id: Union[Unset, str] = UNSET + type_: Union[Unset, OncallRelationshipsEscalationPolicyDataType0Type] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: id = self.id - type_: str | Unset = UNSET + type_: Union[Unset, str] = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ @@ -50,7 +48,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: id = d.pop("id", UNSET) _type_ = d.pop("type", UNSET) - type_: OncallRelationshipsEscalationPolicyDataType0Type | Unset + type_: Union[Unset, OncallRelationshipsEscalationPolicyDataType0Type] if isinstance(_type_, Unset): type_ = UNSET else: diff --git a/rootly_sdk/models/oncall_relationships_schedule.py b/rootly_sdk/models/oncall_relationships_schedule.py index e09c49b7..05330719 100644 --- a/rootly_sdk/models/oncall_relationships_schedule.py +++ b/rootly_sdk/models/oncall_relationships_schedule.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,16 +17,16 @@ class OncallRelationshipsSchedule: """ Attributes: - data (None | OncallRelationshipsScheduleDataType0 | Unset): + data (Union['OncallRelationshipsScheduleDataType0', None, Unset]): """ - data: None | OncallRelationshipsScheduleDataType0 | Unset = UNSET + data: Union["OncallRelationshipsScheduleDataType0", None, Unset] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: from ..models.oncall_relationships_schedule_data_type_0 import OncallRelationshipsScheduleDataType0 - data: dict[str, Any] | None | Unset + data: Union[None, Unset, dict[str, Any]] if isinstance(self.data, Unset): data = UNSET elif isinstance(self.data, OncallRelationshipsScheduleDataType0): @@ -50,7 +48,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_data(data: object) -> None | OncallRelationshipsScheduleDataType0 | Unset: + def _parse_data(data: object) -> Union["OncallRelationshipsScheduleDataType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -61,9 +59,9 @@ def _parse_data(data: object) -> None | OncallRelationshipsScheduleDataType0 | U data_type_0 = OncallRelationshipsScheduleDataType0.from_dict(data) return data_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(None | OncallRelationshipsScheduleDataType0 | Unset, data) + return cast(Union["OncallRelationshipsScheduleDataType0", None, Unset], data) data = _parse_data(d.pop("data", UNSET)) diff --git a/rootly_sdk/models/oncall_relationships_schedule_data_type_0.py b/rootly_sdk/models/oncall_relationships_schedule_data_type_0.py index c9919c8a..583ee769 100644 --- a/rootly_sdk/models/oncall_relationships_schedule_data_type_0.py +++ b/rootly_sdk/models/oncall_relationships_schedule_data_type_0.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,18 +17,18 @@ class OncallRelationshipsScheduleDataType0: """ Attributes: - id (str | Unset): - type_ (OncallRelationshipsScheduleDataType0Type | Unset): + id (Union[Unset, str]): + type_ (Union[Unset, OncallRelationshipsScheduleDataType0Type]): """ - id: str | Unset = UNSET - type_: OncallRelationshipsScheduleDataType0Type | Unset = UNSET + id: Union[Unset, str] = UNSET + type_: Union[Unset, OncallRelationshipsScheduleDataType0Type] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: id = self.id - type_: str | Unset = UNSET + type_: Union[Unset, str] = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ @@ -50,7 +48,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: id = d.pop("id", UNSET) _type_ = d.pop("type", UNSET) - type_: OncallRelationshipsScheduleDataType0Type | Unset + type_: Union[Unset, OncallRelationshipsScheduleDataType0Type] if isinstance(_type_, Unset): type_ = UNSET else: diff --git a/rootly_sdk/models/oncall_relationships_user.py b/rootly_sdk/models/oncall_relationships_user.py index 6c35d047..726ebef2 100644 --- a/rootly_sdk/models/oncall_relationships_user.py +++ b/rootly_sdk/models/oncall_relationships_user.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,16 +17,16 @@ class OncallRelationshipsUser: """ Attributes: - data (None | OncallRelationshipsUserDataType0 | Unset): + data (Union['OncallRelationshipsUserDataType0', None, Unset]): """ - data: None | OncallRelationshipsUserDataType0 | Unset = UNSET + data: Union["OncallRelationshipsUserDataType0", None, Unset] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: from ..models.oncall_relationships_user_data_type_0 import OncallRelationshipsUserDataType0 - data: dict[str, Any] | None | Unset + data: Union[None, Unset, dict[str, Any]] if isinstance(self.data, Unset): data = UNSET elif isinstance(self.data, OncallRelationshipsUserDataType0): @@ -50,7 +48,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_data(data: object) -> None | OncallRelationshipsUserDataType0 | Unset: + def _parse_data(data: object) -> Union["OncallRelationshipsUserDataType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -61,9 +59,9 @@ def _parse_data(data: object) -> None | OncallRelationshipsUserDataType0 | Unset data_type_0 = OncallRelationshipsUserDataType0.from_dict(data) return data_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(None | OncallRelationshipsUserDataType0 | Unset, data) + return cast(Union["OncallRelationshipsUserDataType0", None, Unset], data) data = _parse_data(d.pop("data", UNSET)) diff --git a/rootly_sdk/models/oncall_relationships_user_data_type_0.py b/rootly_sdk/models/oncall_relationships_user_data_type_0.py index 0554b0fc..a3797b4b 100644 --- a/rootly_sdk/models/oncall_relationships_user_data_type_0.py +++ b/rootly_sdk/models/oncall_relationships_user_data_type_0.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,18 +17,18 @@ class OncallRelationshipsUserDataType0: """ Attributes: - id (str | Unset): - type_ (OncallRelationshipsUserDataType0Type | Unset): + id (Union[Unset, str]): + type_ (Union[Unset, OncallRelationshipsUserDataType0Type]): """ - id: str | Unset = UNSET - type_: OncallRelationshipsUserDataType0Type | Unset = UNSET + id: Union[Unset, str] = UNSET + type_: Union[Unset, OncallRelationshipsUserDataType0Type] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: id = self.id - type_: str | Unset = UNSET + type_: Union[Unset, str] = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ @@ -50,7 +48,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: id = d.pop("id", UNSET) _type_ = d.pop("type", UNSET) - type_: OncallRelationshipsUserDataType0Type | Unset + type_: Union[Unset, OncallRelationshipsUserDataType0Type] if isinstance(_type_, Unset): type_ = UNSET else: diff --git a/rootly_sdk/models/override_shift.py b/rootly_sdk/models/override_shift.py index 287ca8fe..b7e1b33f 100644 --- a/rootly_sdk/models/override_shift.py +++ b/rootly_sdk/models/override_shift.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,34 +19,33 @@ class OverrideShift: """ Attributes: schedule_id (str): ID of schedule - rotation_id (None | str): ID of rotation + rotation_id (Union[None, str]): ID of rotation starts_at (str): Start datetime of shift ends_at (str): End datetime of shift is_override (bool): Denotes shift is an override shift - created_at (str | Unset): Date of creation - updated_at (str | Unset): Date of last update - shift_override (ShiftOverrideResponse | Unset): - user_id (int | Unset): Override shift user - user (UserResponse | Unset): + created_at (Union[Unset, str]): Date of creation + updated_at (Union[Unset, str]): Date of last update + shift_override (Union[Unset, ShiftOverrideResponse]): + user_id (Union[Unset, int]): Override shift user + user (Union[Unset, UserResponse]): """ schedule_id: str - rotation_id: None | str + rotation_id: Union[None, str] starts_at: str ends_at: str is_override: bool - created_at: str | Unset = UNSET - updated_at: str | Unset = UNSET - shift_override: ShiftOverrideResponse | Unset = UNSET - user_id: int | Unset = UNSET - user: UserResponse | Unset = UNSET + created_at: Union[Unset, str] = UNSET + updated_at: Union[Unset, str] = UNSET + shift_override: Union[Unset, "ShiftOverrideResponse"] = UNSET + user_id: Union[Unset, int] = UNSET + user: Union[Unset, "UserResponse"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - schedule_id = self.schedule_id - rotation_id: None | str + rotation_id: Union[None, str] rotation_id = self.rotation_id starts_at = self.starts_at @@ -61,13 +58,13 @@ def to_dict(self) -> dict[str, Any]: updated_at = self.updated_at - shift_override: dict[str, Any] | Unset = UNSET + shift_override: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.shift_override, Unset): shift_override = self.shift_override.to_dict() user_id = self.user_id - user: dict[str, Any] | Unset = UNSET + user: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.user, Unset): user = self.user.to_dict() @@ -103,10 +100,10 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) schedule_id = d.pop("schedule_id") - def _parse_rotation_id(data: object) -> None | str: + def _parse_rotation_id(data: object) -> Union[None, str]: if data is None: return data - return cast(None | str, data) + return cast(Union[None, str], data) rotation_id = _parse_rotation_id(d.pop("rotation_id")) @@ -121,7 +118,7 @@ def _parse_rotation_id(data: object) -> None | str: updated_at = d.pop("updated_at", UNSET) _shift_override = d.pop("shift_override", UNSET) - shift_override: ShiftOverrideResponse | Unset + shift_override: Union[Unset, ShiftOverrideResponse] if isinstance(_shift_override, Unset): shift_override = UNSET else: @@ -130,7 +127,7 @@ def _parse_rotation_id(data: object) -> None | str: user_id = d.pop("user_id", UNSET) _user = d.pop("user", UNSET) - user: UserResponse | Unset + user: Union[Unset, UserResponse] if isinstance(_user, Unset): user = UNSET else: diff --git a/rootly_sdk/models/override_shift_list.py b/rootly_sdk/models/override_shift_list.py index d589839b..96713f10 100644 --- a/rootly_sdk/models/override_shift_list.py +++ b/rootly_sdk/models/override_shift_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,20 +20,19 @@ class OverrideShiftList: """ Attributes: - data (list[OverrideShiftListDataItem]): + data (list['OverrideShiftListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[OverrideShiftListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["OverrideShiftListDataItem"] + links: "Links" + meta: "Meta" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) override_shift_list = cls( data=data, diff --git a/rootly_sdk/models/override_shift_list_data_item.py b/rootly_sdk/models/override_shift_list_data_item.py index 391a89d5..6549f203 100644 --- a/rootly_sdk/models/override_shift_list_data_item.py +++ b/rootly_sdk/models/override_shift_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class OverrideShiftListDataItem: id: str type_: OverrideShiftListDataItemType - attributes: OverrideShift + attributes: "OverrideShift" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/override_shift_response.py b/rootly_sdk/models/override_shift_response.py index 9c0c2d7b..44131cb3 100644 --- a/rootly_sdk/models/override_shift_response.py +++ b/rootly_sdk/models/override_shift_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,18 +19,17 @@ class OverrideShiftResponse: """ Attributes: data (OverrideShiftResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: OverrideShiftResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "OverrideShiftResponseData" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = OverrideShiftResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) override_shift_response = cls( data=data, diff --git a/rootly_sdk/models/override_shift_response_data.py b/rootly_sdk/models/override_shift_response_data.py index 3b051c10..751fe8ca 100644 --- a/rootly_sdk/models/override_shift_response_data.py +++ b/rootly_sdk/models/override_shift_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class OverrideShiftResponseData: id: str type_: OverrideShiftResponseDataType - attributes: OverrideShift + attributes: "OverrideShift" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/page_jsmops_on_call_responders_task_params.py b/rootly_sdk/models/page_jsmops_on_call_responders_task_params.py index 916d1784..e02b9715 100644 --- a/rootly_sdk/models/page_jsmops_on_call_responders_task_params.py +++ b/rootly_sdk/models/page_jsmops_on_call_responders_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -32,32 +30,31 @@ class PageJsmopsOnCallRespondersTaskParams: """ Attributes: - task_type (PageJsmopsOnCallRespondersTaskParamsTaskType | Unset): - title (None | str | Unset): Incident title. - message (str | Unset): Message of the incident - description (str | Unset): Description field of the incident that is generally used to provide a detailed + task_type (Union[Unset, PageJsmopsOnCallRespondersTaskParamsTaskType]): + title (Union[None, Unset, str]): Incident title. + message (Union[Unset, str]): Message of the incident + description (Union[Unset, str]): Description field of the incident that is generally used to provide a detailed information about the incident - teams (list[PageJsmopsOnCallRespondersTaskParamsTeamsItem] | Unset): - users (list[PageJsmopsOnCallRespondersTaskParamsUsersItem] | Unset): - priority (PageJsmopsOnCallRespondersTaskParamsPriority | Unset): Default: 'P3'. + teams (Union[Unset, list['PageJsmopsOnCallRespondersTaskParamsTeamsItem']]): + users (Union[Unset, list['PageJsmopsOnCallRespondersTaskParamsUsersItem']]): + priority (Union[Unset, PageJsmopsOnCallRespondersTaskParamsPriority]): Default: 'P3'. """ - task_type: PageJsmopsOnCallRespondersTaskParamsTaskType | Unset = UNSET - title: None | str | Unset = UNSET - message: str | Unset = UNSET - description: str | Unset = UNSET - teams: list[PageJsmopsOnCallRespondersTaskParamsTeamsItem] | Unset = UNSET - users: list[PageJsmopsOnCallRespondersTaskParamsUsersItem] | Unset = UNSET - priority: PageJsmopsOnCallRespondersTaskParamsPriority | Unset = "P3" + task_type: Union[Unset, PageJsmopsOnCallRespondersTaskParamsTaskType] = UNSET + title: Union[None, Unset, str] = UNSET + message: Union[Unset, str] = UNSET + description: Union[Unset, str] = UNSET + teams: Union[Unset, list["PageJsmopsOnCallRespondersTaskParamsTeamsItem"]] = UNSET + users: Union[Unset, list["PageJsmopsOnCallRespondersTaskParamsUsersItem"]] = UNSET + priority: Union[Unset, PageJsmopsOnCallRespondersTaskParamsPriority] = "P3" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - title: None | str | Unset + title: Union[None, Unset, str] if isinstance(self.title, Unset): title = UNSET else: @@ -67,21 +64,21 @@ def to_dict(self) -> dict[str, Any]: description = self.description - teams: list[dict[str, Any]] | Unset = UNSET + teams: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.teams, Unset): teams = [] for teams_item_data in self.teams: teams_item = teams_item_data.to_dict() teams.append(teams_item) - users: list[dict[str, Any]] | Unset = UNSET + users: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.users, Unset): users = [] for users_item_data in self.users: users_item = users_item_data.to_dict() users.append(users_item) - priority: str | Unset = UNSET + priority: Union[Unset, str] = UNSET if not isinstance(self.priority, Unset): priority = self.priority @@ -116,18 +113,18 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _task_type = d.pop("task_type", UNSET) - task_type: PageJsmopsOnCallRespondersTaskParamsTaskType | Unset + task_type: Union[Unset, PageJsmopsOnCallRespondersTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: task_type = check_page_jsmops_on_call_responders_task_params_task_type(_task_type) - def _parse_title(data: object) -> None | str | Unset: + def _parse_title(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) title = _parse_title(d.pop("title", UNSET)) @@ -135,26 +132,22 @@ def _parse_title(data: object) -> None | str | Unset: description = d.pop("description", UNSET) + teams = [] _teams = d.pop("teams", UNSET) - teams: list[PageJsmopsOnCallRespondersTaskParamsTeamsItem] | Unset = UNSET - if _teams is not UNSET: - teams = [] - for teams_item_data in _teams: - teams_item = PageJsmopsOnCallRespondersTaskParamsTeamsItem.from_dict(teams_item_data) + for teams_item_data in _teams or []: + teams_item = PageJsmopsOnCallRespondersTaskParamsTeamsItem.from_dict(teams_item_data) - teams.append(teams_item) + teams.append(teams_item) + users = [] _users = d.pop("users", UNSET) - users: list[PageJsmopsOnCallRespondersTaskParamsUsersItem] | Unset = UNSET - if _users is not UNSET: - users = [] - for users_item_data in _users: - users_item = PageJsmopsOnCallRespondersTaskParamsUsersItem.from_dict(users_item_data) + for users_item_data in _users or []: + users_item = PageJsmopsOnCallRespondersTaskParamsUsersItem.from_dict(users_item_data) - users.append(users_item) + users.append(users_item) _priority = d.pop("priority", UNSET) - priority: PageJsmopsOnCallRespondersTaskParamsPriority | Unset + priority: Union[Unset, PageJsmopsOnCallRespondersTaskParamsPriority] if isinstance(_priority, Unset): priority = UNSET else: diff --git a/rootly_sdk/models/page_jsmops_on_call_responders_task_params_teams_item.py b/rootly_sdk/models/page_jsmops_on_call_responders_task_params_teams_item.py index 9dee4774..74fcc7a2 100644 --- a/rootly_sdk/models/page_jsmops_on_call_responders_task_params_teams_item.py +++ b/rootly_sdk/models/page_jsmops_on_call_responders_task_params_teams_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class PageJsmopsOnCallRespondersTaskParamsTeamsItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/page_jsmops_on_call_responders_task_params_users_item.py b/rootly_sdk/models/page_jsmops_on_call_responders_task_params_users_item.py index 24aa7ba3..1ed78255 100644 --- a/rootly_sdk/models/page_jsmops_on_call_responders_task_params_users_item.py +++ b/rootly_sdk/models/page_jsmops_on_call_responders_task_params_users_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class PageJsmopsOnCallRespondersTaskParamsUsersItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/page_opsgenie_on_call_responders_task_params.py b/rootly_sdk/models/page_opsgenie_on_call_responders_task_params.py index a278eb46..9fd85ab0 100644 --- a/rootly_sdk/models/page_opsgenie_on_call_responders_task_params.py +++ b/rootly_sdk/models/page_opsgenie_on_call_responders_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -32,32 +30,31 @@ class PageOpsgenieOnCallRespondersTaskParams: """ Attributes: - task_type (PageOpsgenieOnCallRespondersTaskParamsTaskType | Unset): - title (None | str | Unset): Incident title. - message (str | Unset): Message of the incident - description (str | Unset): Description field of the incident that is generally used to provide a detailed + task_type (Union[Unset, PageOpsgenieOnCallRespondersTaskParamsTaskType]): + title (Union[None, Unset, str]): Incident title. + message (Union[Unset, str]): Message of the incident + description (Union[Unset, str]): Description field of the incident that is generally used to provide a detailed information about the incident - teams (list[PageOpsgenieOnCallRespondersTaskParamsTeamsItem] | Unset): - users (list[PageOpsgenieOnCallRespondersTaskParamsUsersItem] | Unset): - priority (PageOpsgenieOnCallRespondersTaskParamsPriority | Unset): Default: 'P1'. + teams (Union[Unset, list['PageOpsgenieOnCallRespondersTaskParamsTeamsItem']]): + users (Union[Unset, list['PageOpsgenieOnCallRespondersTaskParamsUsersItem']]): + priority (Union[Unset, PageOpsgenieOnCallRespondersTaskParamsPriority]): Default: 'P1'. """ - task_type: PageOpsgenieOnCallRespondersTaskParamsTaskType | Unset = UNSET - title: None | str | Unset = UNSET - message: str | Unset = UNSET - description: str | Unset = UNSET - teams: list[PageOpsgenieOnCallRespondersTaskParamsTeamsItem] | Unset = UNSET - users: list[PageOpsgenieOnCallRespondersTaskParamsUsersItem] | Unset = UNSET - priority: PageOpsgenieOnCallRespondersTaskParamsPriority | Unset = "P1" + task_type: Union[Unset, PageOpsgenieOnCallRespondersTaskParamsTaskType] = UNSET + title: Union[None, Unset, str] = UNSET + message: Union[Unset, str] = UNSET + description: Union[Unset, str] = UNSET + teams: Union[Unset, list["PageOpsgenieOnCallRespondersTaskParamsTeamsItem"]] = UNSET + users: Union[Unset, list["PageOpsgenieOnCallRespondersTaskParamsUsersItem"]] = UNSET + priority: Union[Unset, PageOpsgenieOnCallRespondersTaskParamsPriority] = "P1" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - title: None | str | Unset + title: Union[None, Unset, str] if isinstance(self.title, Unset): title = UNSET else: @@ -67,21 +64,21 @@ def to_dict(self) -> dict[str, Any]: description = self.description - teams: list[dict[str, Any]] | Unset = UNSET + teams: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.teams, Unset): teams = [] for teams_item_data in self.teams: teams_item = teams_item_data.to_dict() teams.append(teams_item) - users: list[dict[str, Any]] | Unset = UNSET + users: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.users, Unset): users = [] for users_item_data in self.users: users_item = users_item_data.to_dict() users.append(users_item) - priority: str | Unset = UNSET + priority: Union[Unset, str] = UNSET if not isinstance(self.priority, Unset): priority = self.priority @@ -116,18 +113,18 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _task_type = d.pop("task_type", UNSET) - task_type: PageOpsgenieOnCallRespondersTaskParamsTaskType | Unset + task_type: Union[Unset, PageOpsgenieOnCallRespondersTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: task_type = check_page_opsgenie_on_call_responders_task_params_task_type(_task_type) - def _parse_title(data: object) -> None | str | Unset: + def _parse_title(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) title = _parse_title(d.pop("title", UNSET)) @@ -135,26 +132,22 @@ def _parse_title(data: object) -> None | str | Unset: description = d.pop("description", UNSET) + teams = [] _teams = d.pop("teams", UNSET) - teams: list[PageOpsgenieOnCallRespondersTaskParamsTeamsItem] | Unset = UNSET - if _teams is not UNSET: - teams = [] - for teams_item_data in _teams: - teams_item = PageOpsgenieOnCallRespondersTaskParamsTeamsItem.from_dict(teams_item_data) + for teams_item_data in _teams or []: + teams_item = PageOpsgenieOnCallRespondersTaskParamsTeamsItem.from_dict(teams_item_data) - teams.append(teams_item) + teams.append(teams_item) + users = [] _users = d.pop("users", UNSET) - users: list[PageOpsgenieOnCallRespondersTaskParamsUsersItem] | Unset = UNSET - if _users is not UNSET: - users = [] - for users_item_data in _users: - users_item = PageOpsgenieOnCallRespondersTaskParamsUsersItem.from_dict(users_item_data) + for users_item_data in _users or []: + users_item = PageOpsgenieOnCallRespondersTaskParamsUsersItem.from_dict(users_item_data) - users.append(users_item) + users.append(users_item) _priority = d.pop("priority", UNSET) - priority: PageOpsgenieOnCallRespondersTaskParamsPriority | Unset + priority: Union[Unset, PageOpsgenieOnCallRespondersTaskParamsPriority] if isinstance(_priority, Unset): priority = UNSET else: diff --git a/rootly_sdk/models/page_opsgenie_on_call_responders_task_params_teams_item.py b/rootly_sdk/models/page_opsgenie_on_call_responders_task_params_teams_item.py index 50c3593a..9a4555d7 100644 --- a/rootly_sdk/models/page_opsgenie_on_call_responders_task_params_teams_item.py +++ b/rootly_sdk/models/page_opsgenie_on_call_responders_task_params_teams_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class PageOpsgenieOnCallRespondersTaskParamsTeamsItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/page_opsgenie_on_call_responders_task_params_users_item.py b/rootly_sdk/models/page_opsgenie_on_call_responders_task_params_users_item.py index 9c55df3e..a0cde509 100644 --- a/rootly_sdk/models/page_opsgenie_on_call_responders_task_params_users_item.py +++ b/rootly_sdk/models/page_opsgenie_on_call_responders_task_params_users_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class PageOpsgenieOnCallRespondersTaskParamsUsersItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/page_pagerduty_on_call_responders_task_params.py b/rootly_sdk/models/page_pagerduty_on_call_responders_task_params.py index cd792d21..3f8661ed 100644 --- a/rootly_sdk/models/page_pagerduty_on_call_responders_task_params.py +++ b/rootly_sdk/models/page_pagerduty_on_call_responders_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -36,54 +34,53 @@ class PagePagerdutyOnCallRespondersTaskParams: """ Attributes: service (PagePagerdutyOnCallRespondersTaskParamsService): - task_type (PagePagerdutyOnCallRespondersTaskParamsTaskType | Unset): - escalation_policies (list[PagePagerdutyOnCallRespondersTaskParamsEscalationPoliciesItem] | Unset): - users (list[PagePagerdutyOnCallRespondersTaskParamsUsersItem] | Unset): - title (None | str | Unset): Incident title. - message (str | Unset): - urgency (PagePagerdutyOnCallRespondersTaskParamsUrgency | Unset): Default: 'high'. - priority (str | Unset): PagerDuty incident priority, selecting auto will let Rootly auto map our incident + task_type (Union[Unset, PagePagerdutyOnCallRespondersTaskParamsTaskType]): + escalation_policies (Union[Unset, list['PagePagerdutyOnCallRespondersTaskParamsEscalationPoliciesItem']]): + users (Union[Unset, list['PagePagerdutyOnCallRespondersTaskParamsUsersItem']]): + title (Union[None, Unset, str]): Incident title. + message (Union[Unset, str]): + urgency (Union[Unset, PagePagerdutyOnCallRespondersTaskParamsUrgency]): Default: 'high'. + priority (Union[Unset, str]): PagerDuty incident priority, selecting auto will let Rootly auto map our incident severity - create_new_incident_on_conflict (bool | Unset): Rootly only supports linking to a single PagerDuty incident. If - this feature is disabled Rootly will add responders from any additional pages to the existing PagerDuty incident - that is linked to the Rootly incident. If enabled, Rootly will create a new PagerDuty incident that is not - linked to any Rootly incidents Default: False. + create_new_incident_on_conflict (Union[Unset, bool]): Rootly only supports linking to a single PagerDuty + incident. If this feature is disabled Rootly will add responders from any additional pages to the existing + PagerDuty incident that is linked to the Rootly incident. If enabled, Rootly will create a new PagerDuty + incident that is not linked to any Rootly incidents Default: False. """ - service: PagePagerdutyOnCallRespondersTaskParamsService - task_type: PagePagerdutyOnCallRespondersTaskParamsTaskType | Unset = UNSET - escalation_policies: list[PagePagerdutyOnCallRespondersTaskParamsEscalationPoliciesItem] | Unset = UNSET - users: list[PagePagerdutyOnCallRespondersTaskParamsUsersItem] | Unset = UNSET - title: None | str | Unset = UNSET - message: str | Unset = UNSET - urgency: PagePagerdutyOnCallRespondersTaskParamsUrgency | Unset = "high" - priority: str | Unset = UNSET - create_new_incident_on_conflict: bool | Unset = False + service: "PagePagerdutyOnCallRespondersTaskParamsService" + task_type: Union[Unset, PagePagerdutyOnCallRespondersTaskParamsTaskType] = UNSET + escalation_policies: Union[Unset, list["PagePagerdutyOnCallRespondersTaskParamsEscalationPoliciesItem"]] = UNSET + users: Union[Unset, list["PagePagerdutyOnCallRespondersTaskParamsUsersItem"]] = UNSET + title: Union[None, Unset, str] = UNSET + message: Union[Unset, str] = UNSET + urgency: Union[Unset, PagePagerdutyOnCallRespondersTaskParamsUrgency] = "high" + priority: Union[Unset, str] = UNSET + create_new_incident_on_conflict: Union[Unset, bool] = False additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - service = self.service.to_dict() - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - escalation_policies: list[dict[str, Any]] | Unset = UNSET + escalation_policies: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.escalation_policies, Unset): escalation_policies = [] for escalation_policies_item_data in self.escalation_policies: escalation_policies_item = escalation_policies_item_data.to_dict() escalation_policies.append(escalation_policies_item) - users: list[dict[str, Any]] | Unset = UNSET + users: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.users, Unset): users = [] for users_item_data in self.users: users_item = users_item_data.to_dict() users.append(users_item) - title: None | str | Unset + title: Union[None, Unset, str] if isinstance(self.title, Unset): title = UNSET else: @@ -91,7 +88,7 @@ def to_dict(self) -> dict[str, Any]: message = self.message - urgency: str | Unset = UNSET + urgency: Union[Unset, str] = UNSET if not isinstance(self.urgency, Unset): urgency = self.urgency @@ -141,45 +138,41 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: service = PagePagerdutyOnCallRespondersTaskParamsService.from_dict(d.pop("service")) _task_type = d.pop("task_type", UNSET) - task_type: PagePagerdutyOnCallRespondersTaskParamsTaskType | Unset + task_type: Union[Unset, PagePagerdutyOnCallRespondersTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: task_type = check_page_pagerduty_on_call_responders_task_params_task_type(_task_type) + escalation_policies = [] _escalation_policies = d.pop("escalation_policies", UNSET) - escalation_policies: list[PagePagerdutyOnCallRespondersTaskParamsEscalationPoliciesItem] | Unset = UNSET - if _escalation_policies is not UNSET: - escalation_policies = [] - for escalation_policies_item_data in _escalation_policies: - escalation_policies_item = PagePagerdutyOnCallRespondersTaskParamsEscalationPoliciesItem.from_dict( - escalation_policies_item_data - ) + for escalation_policies_item_data in _escalation_policies or []: + escalation_policies_item = PagePagerdutyOnCallRespondersTaskParamsEscalationPoliciesItem.from_dict( + escalation_policies_item_data + ) - escalation_policies.append(escalation_policies_item) + escalation_policies.append(escalation_policies_item) + users = [] _users = d.pop("users", UNSET) - users: list[PagePagerdutyOnCallRespondersTaskParamsUsersItem] | Unset = UNSET - if _users is not UNSET: - users = [] - for users_item_data in _users: - users_item = PagePagerdutyOnCallRespondersTaskParamsUsersItem.from_dict(users_item_data) + for users_item_data in _users or []: + users_item = PagePagerdutyOnCallRespondersTaskParamsUsersItem.from_dict(users_item_data) - users.append(users_item) + users.append(users_item) - def _parse_title(data: object) -> None | str | Unset: + def _parse_title(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) title = _parse_title(d.pop("title", UNSET)) message = d.pop("message", UNSET) _urgency = d.pop("urgency", UNSET) - urgency: PagePagerdutyOnCallRespondersTaskParamsUrgency | Unset + urgency: Union[Unset, PagePagerdutyOnCallRespondersTaskParamsUrgency] if isinstance(_urgency, Unset): urgency = UNSET else: diff --git a/rootly_sdk/models/page_pagerduty_on_call_responders_task_params_escalation_policies_item.py b/rootly_sdk/models/page_pagerduty_on_call_responders_task_params_escalation_policies_item.py index 2d743482..467a5ccf 100644 --- a/rootly_sdk/models/page_pagerduty_on_call_responders_task_params_escalation_policies_item.py +++ b/rootly_sdk/models/page_pagerduty_on_call_responders_task_params_escalation_policies_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class PagePagerdutyOnCallRespondersTaskParamsEscalationPoliciesItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/page_pagerduty_on_call_responders_task_params_service.py b/rootly_sdk/models/page_pagerduty_on_call_responders_task_params_service.py index 5d7c2c8e..476c5091 100644 --- a/rootly_sdk/models/page_pagerduty_on_call_responders_task_params_service.py +++ b/rootly_sdk/models/page_pagerduty_on_call_responders_task_params_service.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class PagePagerdutyOnCallRespondersTaskParamsService: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/page_pagerduty_on_call_responders_task_params_users_item.py b/rootly_sdk/models/page_pagerduty_on_call_responders_task_params_users_item.py index bd0237ac..b58945c3 100644 --- a/rootly_sdk/models/page_pagerduty_on_call_responders_task_params_users_item.py +++ b/rootly_sdk/models/page_pagerduty_on_call_responders_task_params_users_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class PagePagerdutyOnCallRespondersTaskParamsUsersItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/page_rootly_on_call_responders_task_params.py b/rootly_sdk/models/page_rootly_on_call_responders_task_params.py index e35e7ba7..1cbec64b 100644 --- a/rootly_sdk/models/page_rootly_on_call_responders_task_params.py +++ b/rootly_sdk/models/page_rootly_on_call_responders_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -39,58 +37,57 @@ class PageRootlyOnCallRespondersTaskParams: Attributes: alert_urgency_id (str): Alert urgency ID summary (str): Alert title - task_type (PageRootlyOnCallRespondersTaskParamsTaskType | Unset): - escalation_policy_target (PageRootlyOnCallRespondersTaskParamsEscalationPolicyTarget | Unset): - service_target (PageRootlyOnCallRespondersTaskParamsServiceTarget | Unset): - user_target (PageRootlyOnCallRespondersTaskParamsUserTarget | Unset): - group_target (PageRootlyOnCallRespondersTaskParamsGroupTarget | Unset): - functionality_target (PageRootlyOnCallRespondersTaskParamsFunctionalityTarget | Unset): - description (str | Unset): Alert description - escalation_note (str | Unset): - create_new_alert (bool | Unset): When true, always create a new alert instead of re-paging the alert that + task_type (Union[Unset, PageRootlyOnCallRespondersTaskParamsTaskType]): + escalation_policy_target (Union[Unset, PageRootlyOnCallRespondersTaskParamsEscalationPolicyTarget]): + service_target (Union[Unset, PageRootlyOnCallRespondersTaskParamsServiceTarget]): + user_target (Union[Unset, PageRootlyOnCallRespondersTaskParamsUserTarget]): + group_target (Union[Unset, PageRootlyOnCallRespondersTaskParamsGroupTarget]): + functionality_target (Union[Unset, PageRootlyOnCallRespondersTaskParamsFunctionalityTarget]): + description (Union[Unset, str]): Alert description + escalation_note (Union[Unset, str]): + create_new_alert (Union[Unset, bool]): When true, always create a new alert instead of re-paging the alert that triggered the workflow Default: False. """ alert_urgency_id: str summary: str - task_type: PageRootlyOnCallRespondersTaskParamsTaskType | Unset = UNSET - escalation_policy_target: PageRootlyOnCallRespondersTaskParamsEscalationPolicyTarget | Unset = UNSET - service_target: PageRootlyOnCallRespondersTaskParamsServiceTarget | Unset = UNSET - user_target: PageRootlyOnCallRespondersTaskParamsUserTarget | Unset = UNSET - group_target: PageRootlyOnCallRespondersTaskParamsGroupTarget | Unset = UNSET - functionality_target: PageRootlyOnCallRespondersTaskParamsFunctionalityTarget | Unset = UNSET - description: str | Unset = UNSET - escalation_note: str | Unset = UNSET - create_new_alert: bool | Unset = False + task_type: Union[Unset, PageRootlyOnCallRespondersTaskParamsTaskType] = UNSET + escalation_policy_target: Union[Unset, "PageRootlyOnCallRespondersTaskParamsEscalationPolicyTarget"] = UNSET + service_target: Union[Unset, "PageRootlyOnCallRespondersTaskParamsServiceTarget"] = UNSET + user_target: Union[Unset, "PageRootlyOnCallRespondersTaskParamsUserTarget"] = UNSET + group_target: Union[Unset, "PageRootlyOnCallRespondersTaskParamsGroupTarget"] = UNSET + functionality_target: Union[Unset, "PageRootlyOnCallRespondersTaskParamsFunctionalityTarget"] = UNSET + description: Union[Unset, str] = UNSET + escalation_note: Union[Unset, str] = UNSET + create_new_alert: Union[Unset, bool] = False additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - alert_urgency_id = self.alert_urgency_id summary = self.summary - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - escalation_policy_target: dict[str, Any] | Unset = UNSET + escalation_policy_target: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.escalation_policy_target, Unset): escalation_policy_target = self.escalation_policy_target.to_dict() - service_target: dict[str, Any] | Unset = UNSET + service_target: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.service_target, Unset): service_target = self.service_target.to_dict() - user_target: dict[str, Any] | Unset = UNSET + user_target: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.user_target, Unset): user_target = self.user_target.to_dict() - group_target: dict[str, Any] | Unset = UNSET + group_target: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.group_target, Unset): group_target = self.group_target.to_dict() - functionality_target: dict[str, Any] | Unset = UNSET + functionality_target: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.functionality_target, Unset): functionality_target = self.functionality_target.to_dict() @@ -153,14 +150,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: summary = d.pop("summary") _task_type = d.pop("task_type", UNSET) - task_type: PageRootlyOnCallRespondersTaskParamsTaskType | Unset + task_type: Union[Unset, PageRootlyOnCallRespondersTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: task_type = check_page_rootly_on_call_responders_task_params_task_type(_task_type) _escalation_policy_target = d.pop("escalation_policy_target", UNSET) - escalation_policy_target: PageRootlyOnCallRespondersTaskParamsEscalationPolicyTarget | Unset + escalation_policy_target: Union[Unset, PageRootlyOnCallRespondersTaskParamsEscalationPolicyTarget] if isinstance(_escalation_policy_target, Unset): escalation_policy_target = UNSET else: @@ -169,28 +166,28 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: ) _service_target = d.pop("service_target", UNSET) - service_target: PageRootlyOnCallRespondersTaskParamsServiceTarget | Unset + service_target: Union[Unset, PageRootlyOnCallRespondersTaskParamsServiceTarget] if isinstance(_service_target, Unset): service_target = UNSET else: service_target = PageRootlyOnCallRespondersTaskParamsServiceTarget.from_dict(_service_target) _user_target = d.pop("user_target", UNSET) - user_target: PageRootlyOnCallRespondersTaskParamsUserTarget | Unset + user_target: Union[Unset, PageRootlyOnCallRespondersTaskParamsUserTarget] if isinstance(_user_target, Unset): user_target = UNSET else: user_target = PageRootlyOnCallRespondersTaskParamsUserTarget.from_dict(_user_target) _group_target = d.pop("group_target", UNSET) - group_target: PageRootlyOnCallRespondersTaskParamsGroupTarget | Unset + group_target: Union[Unset, PageRootlyOnCallRespondersTaskParamsGroupTarget] if isinstance(_group_target, Unset): group_target = UNSET else: group_target = PageRootlyOnCallRespondersTaskParamsGroupTarget.from_dict(_group_target) _functionality_target = d.pop("functionality_target", UNSET) - functionality_target: PageRootlyOnCallRespondersTaskParamsFunctionalityTarget | Unset + functionality_target: Union[Unset, PageRootlyOnCallRespondersTaskParamsFunctionalityTarget] if isinstance(_functionality_target, Unset): functionality_target = UNSET else: diff --git a/rootly_sdk/models/page_rootly_on_call_responders_task_params_escalation_policy_target.py b/rootly_sdk/models/page_rootly_on_call_responders_task_params_escalation_policy_target.py index 3120e18c..db502e6d 100644 --- a/rootly_sdk/models/page_rootly_on_call_responders_task_params_escalation_policy_target.py +++ b/rootly_sdk/models/page_rootly_on_call_responders_task_params_escalation_policy_target.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class PageRootlyOnCallRespondersTaskParamsEscalationPolicyTarget: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/page_rootly_on_call_responders_task_params_functionality_target.py b/rootly_sdk/models/page_rootly_on_call_responders_task_params_functionality_target.py index 9d0b0fcf..cc5b98fe 100644 --- a/rootly_sdk/models/page_rootly_on_call_responders_task_params_functionality_target.py +++ b/rootly_sdk/models/page_rootly_on_call_responders_task_params_functionality_target.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class PageRootlyOnCallRespondersTaskParamsFunctionalityTarget: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/page_rootly_on_call_responders_task_params_group_target.py b/rootly_sdk/models/page_rootly_on_call_responders_task_params_group_target.py index e66c01e4..06fbf368 100644 --- a/rootly_sdk/models/page_rootly_on_call_responders_task_params_group_target.py +++ b/rootly_sdk/models/page_rootly_on_call_responders_task_params_group_target.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class PageRootlyOnCallRespondersTaskParamsGroupTarget: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/page_rootly_on_call_responders_task_params_service_target.py b/rootly_sdk/models/page_rootly_on_call_responders_task_params_service_target.py index 8bdb97c4..520cbee4 100644 --- a/rootly_sdk/models/page_rootly_on_call_responders_task_params_service_target.py +++ b/rootly_sdk/models/page_rootly_on_call_responders_task_params_service_target.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class PageRootlyOnCallRespondersTaskParamsServiceTarget: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/page_rootly_on_call_responders_task_params_user_target.py b/rootly_sdk/models/page_rootly_on_call_responders_task_params_user_target.py index 5dd0f4fe..04a462a5 100644 --- a/rootly_sdk/models/page_rootly_on_call_responders_task_params_user_target.py +++ b/rootly_sdk/models/page_rootly_on_call_responders_task_params_user_target.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class PageRootlyOnCallRespondersTaskParamsUserTarget: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/page_victor_ops_on_call_responders_task_params_type_0_users_item.py b/rootly_sdk/models/page_victor_ops_on_call_responders_task_params_type_0_users_item.py index 941d2835..755d03c9 100644 --- a/rootly_sdk/models/page_victor_ops_on_call_responders_task_params_type_0_users_item.py +++ b/rootly_sdk/models/page_victor_ops_on_call_responders_task_params_type_0_users_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class PageVictorOpsOnCallRespondersTaskParamsType0UsersItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/page_victor_ops_on_call_responders_task_params_type_1_escalation_policies_item.py b/rootly_sdk/models/page_victor_ops_on_call_responders_task_params_type_1_escalation_policies_item.py index 5848af71..87fee989 100644 --- a/rootly_sdk/models/page_victor_ops_on_call_responders_task_params_type_1_escalation_policies_item.py +++ b/rootly_sdk/models/page_victor_ops_on_call_responders_task_params_type_1_escalation_policies_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class PageVictorOpsOnCallRespondersTaskParamsType1EscalationPoliciesItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/patch_alert_route.py b/rootly_sdk/models/patch_alert_route.py index ad87d4c5..2c80e136 100644 --- a/rootly_sdk/models/patch_alert_route.py +++ b/rootly_sdk/models/patch_alert_route.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class PatchAlertRoute: data (PatchAlertRouteData): """ - data: PatchAlertRouteData + data: "PatchAlertRouteData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/patch_alert_route_data.py b/rootly_sdk/models/patch_alert_route_data.py index 334bec3e..78df219c 100644 --- a/rootly_sdk/models/patch_alert_route_data.py +++ b/rootly_sdk/models/patch_alert_route_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class PatchAlertRouteData: """ type_: PatchAlertRouteDataType - attributes: PatchAlertRouteDataAttributes + attributes: "PatchAlertRouteDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/patch_alert_route_data_attributes.py b/rootly_sdk/models/patch_alert_route_data_attributes.py index 04d8dd16..21b83a0f 100644 --- a/rootly_sdk/models/patch_alert_route_data_attributes.py +++ b/rootly_sdk/models/patch_alert_route_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from uuid import UUID from attrs import define as _attrs_define @@ -19,40 +17,39 @@ class PatchAlertRouteDataAttributes: """ Attributes: - name (str | Unset): The name of the alert route - enabled (bool | Unset): Whether the alert route is enabled - alerts_source_ids (list[UUID] | Unset): - owning_team_ids (list[UUID] | Unset): - rules (list[PatchAlertRouteDataAttributesRulesItem] | Unset): + name (Union[Unset, str]): The name of the alert route + enabled (Union[Unset, bool]): Whether the alert route is enabled + alerts_source_ids (Union[Unset, list[UUID]]): + owning_team_ids (Union[Unset, list[UUID]]): + rules (Union[Unset, list['PatchAlertRouteDataAttributesRulesItem']]): """ - name: str | Unset = UNSET - enabled: bool | Unset = UNSET - alerts_source_ids: list[UUID] | Unset = UNSET - owning_team_ids: list[UUID] | Unset = UNSET - rules: list[PatchAlertRouteDataAttributesRulesItem] | Unset = UNSET + name: Union[Unset, str] = UNSET + enabled: Union[Unset, bool] = UNSET + alerts_source_ids: Union[Unset, list[UUID]] = UNSET + owning_team_ids: Union[Unset, list[UUID]] = UNSET + rules: Union[Unset, list["PatchAlertRouteDataAttributesRulesItem"]] = UNSET def to_dict(self) -> dict[str, Any]: - name = self.name enabled = self.enabled - alerts_source_ids: list[str] | Unset = UNSET + alerts_source_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.alerts_source_ids, Unset): alerts_source_ids = [] for alerts_source_ids_item_data in self.alerts_source_ids: alerts_source_ids_item = str(alerts_source_ids_item_data) alerts_source_ids.append(alerts_source_ids_item) - owning_team_ids: list[str] | Unset = UNSET + owning_team_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.owning_team_ids, Unset): owning_team_ids = [] for owning_team_ids_item_data in self.owning_team_ids: owning_team_ids_item = str(owning_team_ids_item_data) owning_team_ids.append(owning_team_ids_item) - rules: list[dict[str, Any]] | Unset = UNSET + rules: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.rules, Unset): rules = [] for rules_item_data in self.rules: @@ -84,32 +81,26 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: enabled = d.pop("enabled", UNSET) + alerts_source_ids = [] _alerts_source_ids = d.pop("alerts_source_ids", UNSET) - alerts_source_ids: list[UUID] | Unset = UNSET - if _alerts_source_ids is not UNSET: - alerts_source_ids = [] - for alerts_source_ids_item_data in _alerts_source_ids: - alerts_source_ids_item = UUID(alerts_source_ids_item_data) + for alerts_source_ids_item_data in _alerts_source_ids or []: + alerts_source_ids_item = UUID(alerts_source_ids_item_data) - alerts_source_ids.append(alerts_source_ids_item) + alerts_source_ids.append(alerts_source_ids_item) + owning_team_ids = [] _owning_team_ids = d.pop("owning_team_ids", UNSET) - owning_team_ids: list[UUID] | Unset = UNSET - if _owning_team_ids is not UNSET: - owning_team_ids = [] - for owning_team_ids_item_data in _owning_team_ids: - owning_team_ids_item = UUID(owning_team_ids_item_data) + for owning_team_ids_item_data in _owning_team_ids or []: + owning_team_ids_item = UUID(owning_team_ids_item_data) - owning_team_ids.append(owning_team_ids_item) + owning_team_ids.append(owning_team_ids_item) + rules = [] _rules = d.pop("rules", UNSET) - rules: list[PatchAlertRouteDataAttributesRulesItem] | Unset = UNSET - if _rules is not UNSET: - rules = [] - for rules_item_data in _rules: - rules_item = PatchAlertRouteDataAttributesRulesItem.from_dict(rules_item_data) + for rules_item_data in _rules or []: + rules_item = PatchAlertRouteDataAttributesRulesItem.from_dict(rules_item_data) - rules.append(rules_item) + rules.append(rules_item) patch_alert_route_data_attributes = cls( name=name, diff --git a/rootly_sdk/models/patch_alert_route_data_attributes_rules_item.py b/rootly_sdk/models/patch_alert_route_data_attributes_rules_item.py index 83f9eba3..2d1a67a8 100644 --- a/rootly_sdk/models/patch_alert_route_data_attributes_rules_item.py +++ b/rootly_sdk/models/patch_alert_route_data_attributes_rules_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from uuid import UUID from attrs import define as _attrs_define @@ -25,27 +23,26 @@ class PatchAlertRouteDataAttributesRulesItem: """ Attributes: - id (UUID | Unset): The ID of the alert routing rule. Required for updating or deleting existing rules. - field_destroy (bool | Unset): Set to true to delete this rule. When true, only the id field is required. - name (str | Unset): The name of the alert routing rule - position (int | Unset): The position of the alert routing rule for ordering evaluation - fallback_rule (bool | Unset): Whether this is a fallback rule Default: False. - destinations (list[PatchAlertRouteDataAttributesRulesItemDestinationsItem] | Unset): - condition_groups (list[PatchAlertRouteDataAttributesRulesItemConditionGroupsItem] | Unset): + id (Union[Unset, UUID]): The ID of the alert routing rule. Required for updating or deleting existing rules. + field_destroy (Union[Unset, bool]): Set to true to delete this rule. When true, only the id field is required. + name (Union[Unset, str]): The name of the alert routing rule + position (Union[Unset, int]): The position of the alert routing rule for ordering evaluation + fallback_rule (Union[Unset, bool]): Whether this is a fallback rule Default: False. + destinations (Union[Unset, list['PatchAlertRouteDataAttributesRulesItemDestinationsItem']]): + condition_groups (Union[Unset, list['PatchAlertRouteDataAttributesRulesItemConditionGroupsItem']]): """ - id: UUID | Unset = UNSET - field_destroy: bool | Unset = UNSET - name: str | Unset = UNSET - position: int | Unset = UNSET - fallback_rule: bool | Unset = False - destinations: list[PatchAlertRouteDataAttributesRulesItemDestinationsItem] | Unset = UNSET - condition_groups: list[PatchAlertRouteDataAttributesRulesItemConditionGroupsItem] | Unset = UNSET + id: Union[Unset, UUID] = UNSET + field_destroy: Union[Unset, bool] = UNSET + name: Union[Unset, str] = UNSET + position: Union[Unset, int] = UNSET + fallback_rule: Union[Unset, bool] = False + destinations: Union[Unset, list["PatchAlertRouteDataAttributesRulesItemDestinationsItem"]] = UNSET + condition_groups: Union[Unset, list["PatchAlertRouteDataAttributesRulesItemConditionGroupsItem"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - - id: str | Unset = UNSET + id: Union[Unset, str] = UNSET if not isinstance(self.id, Unset): id = str(self.id) @@ -57,14 +54,14 @@ def to_dict(self) -> dict[str, Any]: fallback_rule = self.fallback_rule - destinations: list[dict[str, Any]] | Unset = UNSET + destinations: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.destinations, Unset): destinations = [] for destinations_item_data in self.destinations: destinations_item = destinations_item_data.to_dict() destinations.append(destinations_item) - condition_groups: list[dict[str, Any]] | Unset = UNSET + condition_groups: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.condition_groups, Unset): condition_groups = [] for condition_groups_item_data in self.condition_groups: @@ -102,7 +99,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _id = d.pop("id", UNSET) - id: UUID | Unset + id: Union[Unset, UUID] if isinstance(_id, Unset): id = UNSET else: @@ -116,27 +113,21 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: fallback_rule = d.pop("fallback_rule", UNSET) + destinations = [] _destinations = d.pop("destinations", UNSET) - destinations: list[PatchAlertRouteDataAttributesRulesItemDestinationsItem] | Unset = UNSET - if _destinations is not UNSET: - destinations = [] - for destinations_item_data in _destinations: - destinations_item = PatchAlertRouteDataAttributesRulesItemDestinationsItem.from_dict( - destinations_item_data - ) + for destinations_item_data in _destinations or []: + destinations_item = PatchAlertRouteDataAttributesRulesItemDestinationsItem.from_dict(destinations_item_data) - destinations.append(destinations_item) + destinations.append(destinations_item) + condition_groups = [] _condition_groups = d.pop("condition_groups", UNSET) - condition_groups: list[PatchAlertRouteDataAttributesRulesItemConditionGroupsItem] | Unset = UNSET - if _condition_groups is not UNSET: - condition_groups = [] - for condition_groups_item_data in _condition_groups: - condition_groups_item = PatchAlertRouteDataAttributesRulesItemConditionGroupsItem.from_dict( - condition_groups_item_data - ) + for condition_groups_item_data in _condition_groups or []: + condition_groups_item = PatchAlertRouteDataAttributesRulesItemConditionGroupsItem.from_dict( + condition_groups_item_data + ) - condition_groups.append(condition_groups_item) + condition_groups.append(condition_groups_item) patch_alert_route_data_attributes_rules_item = cls( id=id, diff --git a/rootly_sdk/models/patch_alert_route_data_attributes_rules_item_condition_groups_item.py b/rootly_sdk/models/patch_alert_route_data_attributes_rules_item_condition_groups_item.py index dde7d127..2257b8c1 100644 --- a/rootly_sdk/models/patch_alert_route_data_attributes_rules_item_condition_groups_item.py +++ b/rootly_sdk/models/patch_alert_route_data_attributes_rules_item_condition_groups_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from uuid import UUID from attrs import define as _attrs_define @@ -22,21 +20,21 @@ class PatchAlertRouteDataAttributesRulesItemConditionGroupsItem: """ Attributes: - id (UUID | Unset): The ID of the condition group. Required for updating or deleting existing condition groups. - field_destroy (bool | Unset): Set to true to delete this condition group - position (int | Unset): The position of the condition group - conditions (list[PatchAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItem] | Unset): + id (Union[Unset, UUID]): The ID of the condition group. Required for updating or deleting existing condition + groups. + field_destroy (Union[Unset, bool]): Set to true to delete this condition group + position (Union[Unset, int]): The position of the condition group + conditions (Union[Unset, list['PatchAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItem']]): """ - id: UUID | Unset = UNSET - field_destroy: bool | Unset = UNSET - position: int | Unset = UNSET - conditions: list[PatchAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItem] | Unset = UNSET + id: Union[Unset, UUID] = UNSET + field_destroy: Union[Unset, bool] = UNSET + position: Union[Unset, int] = UNSET + conditions: Union[Unset, list["PatchAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItem"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - - id: str | Unset = UNSET + id: Union[Unset, str] = UNSET if not isinstance(self.id, Unset): id = str(self.id) @@ -44,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: position = self.position - conditions: list[dict[str, Any]] | Unset = UNSET + conditions: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.conditions, Unset): conditions = [] for conditions_item_data in self.conditions: @@ -73,7 +71,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _id = d.pop("id", UNSET) - id: UUID | Unset + id: Union[Unset, UUID] if isinstance(_id, Unset): id = UNSET else: @@ -83,16 +81,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: position = d.pop("position", UNSET) + conditions = [] _conditions = d.pop("conditions", UNSET) - conditions: list[PatchAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItem] | Unset = UNSET - if _conditions is not UNSET: - conditions = [] - for conditions_item_data in _conditions: - conditions_item = PatchAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItem.from_dict( - conditions_item_data - ) + for conditions_item_data in _conditions or []: + conditions_item = PatchAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItem.from_dict( + conditions_item_data + ) - conditions.append(conditions_item) + conditions.append(conditions_item) patch_alert_route_data_attributes_rules_item_condition_groups_item = cls( id=id, diff --git a/rootly_sdk/models/patch_alert_route_data_attributes_rules_item_condition_groups_item_conditions_item.py b/rootly_sdk/models/patch_alert_route_data_attributes_rules_item_condition_groups_item_conditions_item.py index d9b6fcc0..a196441c 100644 --- a/rootly_sdk/models/patch_alert_route_data_attributes_rules_item_condition_groups_item_conditions_item.py +++ b/rootly_sdk/models/patch_alert_route_data_attributes_rules_item_condition_groups_item_conditions_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from uuid import UUID from attrs import define as _attrs_define @@ -28,63 +26,64 @@ class PatchAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItem: """ Attributes: - id (UUID | Unset): The ID of the condition. Required for updating or deleting existing conditions. - field_destroy (bool | Unset): Set to true to delete this condition - property_field_condition_type - (PatchAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemPropertyFieldConditionType | Unset): - property_field_name (str | Unset): The name of the property field - property_field_type (PatchAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemPropertyFieldType | - Unset): - property_field_value (None | str | Unset): The value of the property field - property_field_values (list[str] | None | Unset): - alert_urgency_ids (list[str] | None | Unset): The Alert Urgency IDs to check in the condition - conditionable_type (PatchAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemConditionableType | - Unset): The type of the conditionable - conditionable_id (None | Unset | UUID): The ID of the conditionable + id (Union[Unset, UUID]): The ID of the condition. Required for updating or deleting existing conditions. + field_destroy (Union[Unset, bool]): Set to true to delete this condition + property_field_condition_type (Union[Unset, + PatchAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemPropertyFieldConditionType]): + property_field_name (Union[Unset, str]): The name of the property field + property_field_type (Union[Unset, + PatchAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemPropertyFieldType]): + property_field_value (Union[None, Unset, str]): The value of the property field + property_field_values (Union[None, Unset, list[str]]): + alert_urgency_ids (Union[None, Unset, list[str]]): The Alert Urgency IDs to check in the condition + conditionable_type (Union[Unset, + PatchAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemConditionableType]): The type of the + conditionable + conditionable_id (Union[None, UUID, Unset]): The ID of the conditionable """ - id: UUID | Unset = UNSET - field_destroy: bool | Unset = UNSET - property_field_condition_type: ( - PatchAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemPropertyFieldConditionType | Unset - ) = UNSET - property_field_name: str | Unset = UNSET - property_field_type: ( - PatchAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemPropertyFieldType | Unset - ) = UNSET - property_field_value: None | str | Unset = UNSET - property_field_values: list[str] | None | Unset = UNSET - alert_urgency_ids: list[str] | None | Unset = UNSET - conditionable_type: ( - PatchAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemConditionableType | Unset - ) = UNSET - conditionable_id: None | Unset | UUID = UNSET + id: Union[Unset, UUID] = UNSET + field_destroy: Union[Unset, bool] = UNSET + property_field_condition_type: Union[ + Unset, PatchAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemPropertyFieldConditionType + ] = UNSET + property_field_name: Union[Unset, str] = UNSET + property_field_type: Union[ + Unset, PatchAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemPropertyFieldType + ] = UNSET + property_field_value: Union[None, Unset, str] = UNSET + property_field_values: Union[None, Unset, list[str]] = UNSET + alert_urgency_ids: Union[None, Unset, list[str]] = UNSET + conditionable_type: Union[ + Unset, PatchAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemConditionableType + ] = UNSET + conditionable_id: Union[None, UUID, Unset] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id: str | Unset = UNSET + id: Union[Unset, str] = UNSET if not isinstance(self.id, Unset): id = str(self.id) field_destroy = self.field_destroy - property_field_condition_type: str | Unset = UNSET + property_field_condition_type: Union[Unset, str] = UNSET if not isinstance(self.property_field_condition_type, Unset): property_field_condition_type = self.property_field_condition_type property_field_name = self.property_field_name - property_field_type: str | Unset = UNSET + property_field_type: Union[Unset, str] = UNSET if not isinstance(self.property_field_type, Unset): property_field_type = self.property_field_type - property_field_value: None | str | Unset + property_field_value: Union[None, Unset, str] if isinstance(self.property_field_value, Unset): property_field_value = UNSET else: property_field_value = self.property_field_value - property_field_values: list[str] | None | Unset + property_field_values: Union[None, Unset, list[str]] if isinstance(self.property_field_values, Unset): property_field_values = UNSET elif isinstance(self.property_field_values, list): @@ -93,7 +92,7 @@ def to_dict(self) -> dict[str, Any]: else: property_field_values = self.property_field_values - alert_urgency_ids: list[str] | None | Unset + alert_urgency_ids: Union[None, Unset, list[str]] if isinstance(self.alert_urgency_ids, Unset): alert_urgency_ids = UNSET elif isinstance(self.alert_urgency_ids, list): @@ -102,11 +101,11 @@ def to_dict(self) -> dict[str, Any]: else: alert_urgency_ids = self.alert_urgency_ids - conditionable_type: str | Unset = UNSET + conditionable_type: Union[Unset, str] = UNSET if not isinstance(self.conditionable_type, Unset): conditionable_type = self.conditionable_type - conditionable_id: None | str | Unset + conditionable_id: Union[None, Unset, str] if isinstance(self.conditionable_id, Unset): conditionable_id = UNSET elif isinstance(self.conditionable_id, UUID): @@ -144,7 +143,7 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _id = d.pop("id", UNSET) - id: UUID | Unset + id: Union[Unset, UUID] if isinstance(_id, Unset): id = UNSET else: @@ -153,9 +152,9 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: field_destroy = d.pop("_destroy", UNSET) _property_field_condition_type = d.pop("property_field_condition_type", UNSET) - property_field_condition_type: ( - PatchAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemPropertyFieldConditionType | Unset - ) + property_field_condition_type: Union[ + Unset, PatchAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemPropertyFieldConditionType + ] if isinstance(_property_field_condition_type, Unset): property_field_condition_type = UNSET else: @@ -166,9 +165,9 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: property_field_name = d.pop("property_field_name", UNSET) _property_field_type = d.pop("property_field_type", UNSET) - property_field_type: ( - PatchAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemPropertyFieldType | Unset - ) + property_field_type: Union[ + Unset, PatchAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemPropertyFieldType + ] if isinstance(_property_field_type, Unset): property_field_type = UNSET else: @@ -176,16 +175,16 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: _property_field_type ) - def _parse_property_field_value(data: object) -> None | str | Unset: + def _parse_property_field_value(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) property_field_value = _parse_property_field_value(d.pop("property_field_value", UNSET)) - def _parse_property_field_values(data: object) -> list[str] | None | Unset: + def _parse_property_field_values(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -196,13 +195,13 @@ def _parse_property_field_values(data: object) -> list[str] | None | Unset: property_field_values_type_0 = cast(list[str], data) return property_field_values_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) property_field_values = _parse_property_field_values(d.pop("property_field_values", UNSET)) - def _parse_alert_urgency_ids(data: object) -> list[str] | None | Unset: + def _parse_alert_urgency_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -213,16 +212,16 @@ def _parse_alert_urgency_ids(data: object) -> list[str] | None | Unset: alert_urgency_ids_type_0 = cast(list[str], data) return alert_urgency_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) alert_urgency_ids = _parse_alert_urgency_ids(d.pop("alert_urgency_ids", UNSET)) _conditionable_type = d.pop("conditionable_type", UNSET) - conditionable_type: ( - PatchAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemConditionableType | Unset - ) + conditionable_type: Union[ + Unset, PatchAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemConditionableType + ] if isinstance(_conditionable_type, Unset): conditionable_type = UNSET else: @@ -230,7 +229,7 @@ def _parse_alert_urgency_ids(data: object) -> list[str] | None | Unset: _conditionable_type ) - def _parse_conditionable_id(data: object) -> None | Unset | UUID: + def _parse_conditionable_id(data: object) -> Union[None, UUID, Unset]: if data is None: return data if isinstance(data, Unset): @@ -241,9 +240,9 @@ def _parse_conditionable_id(data: object) -> None | Unset | UUID: conditionable_id_type_0 = UUID(data) return conditionable_id_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(None | Unset | UUID, data) + return cast(Union[None, UUID, Unset], data) conditionable_id = _parse_conditionable_id(d.pop("conditionable_id", UNSET)) diff --git a/rootly_sdk/models/patch_alert_route_data_attributes_rules_item_destinations_item.py b/rootly_sdk/models/patch_alert_route_data_attributes_rules_item_destinations_item.py index 237f4198..cf1045da 100644 --- a/rootly_sdk/models/patch_alert_route_data_attributes_rules_item_destinations_item.py +++ b/rootly_sdk/models/patch_alert_route_data_attributes_rules_item_destinations_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from uuid import UUID from attrs import define as _attrs_define @@ -20,31 +18,31 @@ class PatchAlertRouteDataAttributesRulesItemDestinationsItem: """ Attributes: - id (UUID | Unset): The ID of the destination. Required for updating or deleting existing destinations. - field_destroy (bool | Unset): Set to true to delete this destination - target_type (PatchAlertRouteDataAttributesRulesItemDestinationsItemTargetType | Unset): The type of the target. - Please contact support if you encounter issues using `Functionality` as a target type. - target_id (UUID | Unset): The ID of the target + id (Union[Unset, UUID]): The ID of the destination. Required for updating or deleting existing destinations. + field_destroy (Union[Unset, bool]): Set to true to delete this destination + target_type (Union[Unset, PatchAlertRouteDataAttributesRulesItemDestinationsItemTargetType]): The type of the + target. Please contact support if you encounter issues using `Functionality` as a target type. + target_id (Union[Unset, UUID]): The ID of the target """ - id: UUID | Unset = UNSET - field_destroy: bool | Unset = UNSET - target_type: PatchAlertRouteDataAttributesRulesItemDestinationsItemTargetType | Unset = UNSET - target_id: UUID | Unset = UNSET + id: Union[Unset, UUID] = UNSET + field_destroy: Union[Unset, bool] = UNSET + target_type: Union[Unset, PatchAlertRouteDataAttributesRulesItemDestinationsItemTargetType] = UNSET + target_id: Union[Unset, UUID] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id: str | Unset = UNSET + id: Union[Unset, str] = UNSET if not isinstance(self.id, Unset): id = str(self.id) field_destroy = self.field_destroy - target_type: str | Unset = UNSET + target_type: Union[Unset, str] = UNSET if not isinstance(self.target_type, Unset): target_type = self.target_type - target_id: str | Unset = UNSET + target_id: Union[Unset, str] = UNSET if not isinstance(self.target_id, Unset): target_id = str(self.target_id) @@ -66,7 +64,7 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _id = d.pop("id", UNSET) - id: UUID | Unset + id: Union[Unset, UUID] if isinstance(_id, Unset): id = UNSET else: @@ -75,14 +73,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: field_destroy = d.pop("_destroy", UNSET) _target_type = d.pop("target_type", UNSET) - target_type: PatchAlertRouteDataAttributesRulesItemDestinationsItemTargetType | Unset + target_type: Union[Unset, PatchAlertRouteDataAttributesRulesItemDestinationsItemTargetType] if isinstance(_target_type, Unset): target_type = UNSET else: target_type = check_patch_alert_route_data_attributes_rules_item_destinations_item_target_type(_target_type) _target_id = d.pop("target_id", UNSET) - target_id: UUID | Unset + target_id: Union[Unset, UUID] if isinstance(_target_id, Unset): target_id = UNSET else: diff --git a/rootly_sdk/models/phone_verification_response.py b/rootly_sdk/models/phone_verification_response.py index 636cfa5a..dfc508cd 100644 --- a/rootly_sdk/models/phone_verification_response.py +++ b/rootly_sdk/models/phone_verification_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class PhoneVerificationResponse: """ Attributes: - message (str | Unset): Success message - error (str | Unset): Error message + message (Union[Unset, str]): Success message + error (Union[Unset, str]): Error message """ - message: str | Unset = UNSET - error: str | Unset = UNSET + message: Union[Unset, str] = UNSET + error: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/playbook.py b/rootly_sdk/models/playbook.py index cc9126ef..c2ff44fd 100644 --- a/rootly_sdk/models/playbook.py +++ b/rootly_sdk/models/playbook.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -18,27 +16,27 @@ class Playbook: title (str): The title of the playbook created_at (str): Date of creation updated_at (str): Date of last update - summary (None | str | Unset): The summary of the playbook - external_url (None | str | Unset): The external url of the playbook - severity_ids (list[str] | None | Unset): The Severity IDs to attach to the incident - environment_ids (list[str] | None | Unset): The Environment IDs to attach to the incident - functionality_ids (list[str] | None | Unset): The Functionality IDs to attach to the incident - service_ids (list[str] | None | Unset): The Service IDs to attach to the incident - group_ids (list[str] | None | Unset): The Team IDs to attach to the incident - incident_type_ids (list[str] | None | Unset): The Incident Type IDs to attach to the incident + summary (Union[None, Unset, str]): The summary of the playbook + external_url (Union[None, Unset, str]): The external url of the playbook + severity_ids (Union[None, Unset, list[str]]): The Severity IDs to attach to the incident + environment_ids (Union[None, Unset, list[str]]): The Environment IDs to attach to the incident + functionality_ids (Union[None, Unset, list[str]]): The Functionality IDs to attach to the incident + service_ids (Union[None, Unset, list[str]]): The Service IDs to attach to the incident + group_ids (Union[None, Unset, list[str]]): The Team IDs to attach to the incident + incident_type_ids (Union[None, Unset, list[str]]): The Incident Type IDs to attach to the incident """ title: str created_at: str updated_at: str - summary: None | str | Unset = UNSET - external_url: None | str | Unset = UNSET - severity_ids: list[str] | None | Unset = UNSET - environment_ids: list[str] | None | Unset = UNSET - functionality_ids: list[str] | None | Unset = UNSET - service_ids: list[str] | None | Unset = UNSET - group_ids: list[str] | None | Unset = UNSET - incident_type_ids: list[str] | None | Unset = UNSET + summary: Union[None, Unset, str] = UNSET + external_url: Union[None, Unset, str] = UNSET + severity_ids: Union[None, Unset, list[str]] = UNSET + environment_ids: Union[None, Unset, list[str]] = UNSET + functionality_ids: Union[None, Unset, list[str]] = UNSET + service_ids: Union[None, Unset, list[str]] = UNSET + group_ids: Union[None, Unset, list[str]] = UNSET + incident_type_ids: Union[None, Unset, list[str]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -48,19 +46,19 @@ def to_dict(self) -> dict[str, Any]: updated_at = self.updated_at - summary: None | str | Unset + summary: Union[None, Unset, str] if isinstance(self.summary, Unset): summary = UNSET else: summary = self.summary - external_url: None | str | Unset + external_url: Union[None, Unset, str] if isinstance(self.external_url, Unset): external_url = UNSET else: external_url = self.external_url - severity_ids: list[str] | None | Unset + severity_ids: Union[None, Unset, list[str]] if isinstance(self.severity_ids, Unset): severity_ids = UNSET elif isinstance(self.severity_ids, list): @@ -69,7 +67,7 @@ def to_dict(self) -> dict[str, Any]: else: severity_ids = self.severity_ids - environment_ids: list[str] | None | Unset + environment_ids: Union[None, Unset, list[str]] if isinstance(self.environment_ids, Unset): environment_ids = UNSET elif isinstance(self.environment_ids, list): @@ -78,7 +76,7 @@ def to_dict(self) -> dict[str, Any]: else: environment_ids = self.environment_ids - functionality_ids: list[str] | None | Unset + functionality_ids: Union[None, Unset, list[str]] if isinstance(self.functionality_ids, Unset): functionality_ids = UNSET elif isinstance(self.functionality_ids, list): @@ -87,7 +85,7 @@ def to_dict(self) -> dict[str, Any]: else: functionality_ids = self.functionality_ids - service_ids: list[str] | None | Unset + service_ids: Union[None, Unset, list[str]] if isinstance(self.service_ids, Unset): service_ids = UNSET elif isinstance(self.service_ids, list): @@ -96,7 +94,7 @@ def to_dict(self) -> dict[str, Any]: else: service_ids = self.service_ids - group_ids: list[str] | None | Unset + group_ids: Union[None, Unset, list[str]] if isinstance(self.group_ids, Unset): group_ids = UNSET elif isinstance(self.group_ids, list): @@ -105,7 +103,7 @@ def to_dict(self) -> dict[str, Any]: else: group_ids = self.group_ids - incident_type_ids: list[str] | None | Unset + incident_type_ids: Union[None, Unset, list[str]] if isinstance(self.incident_type_ids, Unset): incident_type_ids = UNSET elif isinstance(self.incident_type_ids, list): @@ -151,25 +149,25 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: updated_at = d.pop("updated_at") - def _parse_summary(data: object) -> None | str | Unset: + def _parse_summary(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) summary = _parse_summary(d.pop("summary", UNSET)) - def _parse_external_url(data: object) -> None | str | Unset: + def _parse_external_url(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) external_url = _parse_external_url(d.pop("external_url", UNSET)) - def _parse_severity_ids(data: object) -> list[str] | None | Unset: + def _parse_severity_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -180,13 +178,13 @@ def _parse_severity_ids(data: object) -> list[str] | None | Unset: severity_ids_type_0 = cast(list[str], data) return severity_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) severity_ids = _parse_severity_ids(d.pop("severity_ids", UNSET)) - def _parse_environment_ids(data: object) -> list[str] | None | Unset: + def _parse_environment_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -197,13 +195,13 @@ def _parse_environment_ids(data: object) -> list[str] | None | Unset: environment_ids_type_0 = cast(list[str], data) return environment_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) environment_ids = _parse_environment_ids(d.pop("environment_ids", UNSET)) - def _parse_functionality_ids(data: object) -> list[str] | None | Unset: + def _parse_functionality_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -214,13 +212,13 @@ def _parse_functionality_ids(data: object) -> list[str] | None | Unset: functionality_ids_type_0 = cast(list[str], data) return functionality_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) functionality_ids = _parse_functionality_ids(d.pop("functionality_ids", UNSET)) - def _parse_service_ids(data: object) -> list[str] | None | Unset: + def _parse_service_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -231,13 +229,13 @@ def _parse_service_ids(data: object) -> list[str] | None | Unset: service_ids_type_0 = cast(list[str], data) return service_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) service_ids = _parse_service_ids(d.pop("service_ids", UNSET)) - def _parse_group_ids(data: object) -> list[str] | None | Unset: + def _parse_group_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -248,13 +246,13 @@ def _parse_group_ids(data: object) -> list[str] | None | Unset: group_ids_type_0 = cast(list[str], data) return group_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) group_ids = _parse_group_ids(d.pop("group_ids", UNSET)) - def _parse_incident_type_ids(data: object) -> list[str] | None | Unset: + def _parse_incident_type_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -265,9 +263,9 @@ def _parse_incident_type_ids(data: object) -> list[str] | None | Unset: incident_type_ids_type_0 = cast(list[str], data) return incident_type_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) incident_type_ids = _parse_incident_type_ids(d.pop("incident_type_ids", UNSET)) diff --git a/rootly_sdk/models/playbook_list.py b/rootly_sdk/models/playbook_list.py index 41883360..6ac76719 100644 --- a/rootly_sdk/models/playbook_list.py +++ b/rootly_sdk/models/playbook_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,20 +20,19 @@ class PlaybookList: """ Attributes: - data (list[PlaybookListDataItem]): + data (list['PlaybookListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[PlaybookListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["PlaybookListDataItem"] + links: "Links" + meta: "Meta" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) playbook_list = cls( data=data, diff --git a/rootly_sdk/models/playbook_list_data_item.py b/rootly_sdk/models/playbook_list_data_item.py index 90c8ddde..049aef9b 100644 --- a/rootly_sdk/models/playbook_list_data_item.py +++ b/rootly_sdk/models/playbook_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class PlaybookListDataItem: id: str type_: PlaybookListDataItemType - attributes: Playbook + attributes: "Playbook" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/playbook_response.py b/rootly_sdk/models/playbook_response.py index 09e9cb31..09ddbadf 100644 --- a/rootly_sdk/models/playbook_response.py +++ b/rootly_sdk/models/playbook_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,18 +19,17 @@ class PlaybookResponse: """ Attributes: data (PlaybookResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: PlaybookResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "PlaybookResponseData" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = PlaybookResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) playbook_response = cls( data=data, diff --git a/rootly_sdk/models/playbook_response_data.py b/rootly_sdk/models/playbook_response_data.py index 8c844e20..4ef6997f 100644 --- a/rootly_sdk/models/playbook_response_data.py +++ b/rootly_sdk/models/playbook_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class PlaybookResponseData: id: str type_: PlaybookResponseDataType - attributes: Playbook + attributes: "Playbook" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/playbook_task.py b/rootly_sdk/models/playbook_task.py index 401f39aa..92ded9d0 100644 --- a/rootly_sdk/models/playbook_task.py +++ b/rootly_sdk/models/playbook_task.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -18,17 +16,17 @@ class PlaybookTask: task (str): The task of the task created_at (str): Date of creation updated_at (str): Date of last update - playbook_id (str | Unset): - description (None | str | Unset): The description of task - position (int | None | Unset): The position of the task + playbook_id (Union[Unset, str]): + description (Union[None, Unset, str]): The description of task + position (Union[None, Unset, int]): The position of the task """ task: str created_at: str updated_at: str - playbook_id: str | Unset = UNSET - description: None | str | Unset = UNSET - position: int | None | Unset = UNSET + playbook_id: Union[Unset, str] = UNSET + description: Union[None, Unset, str] = UNSET + position: Union[None, Unset, int] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -40,13 +38,13 @@ def to_dict(self) -> dict[str, Any]: playbook_id = self.playbook_id - description: None | str | Unset + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: description = self.description - position: int | None | Unset + position: Union[None, Unset, int] if isinstance(self.position, Unset): position = UNSET else: @@ -81,21 +79,21 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: playbook_id = d.pop("playbook_id", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> Union[None, Unset, int]: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(Union[None, Unset, int], data) position = _parse_position(d.pop("position", UNSET)) diff --git a/rootly_sdk/models/playbook_task_list.py b/rootly_sdk/models/playbook_task_list.py index da771781..9ccef753 100644 --- a/rootly_sdk/models/playbook_task_list.py +++ b/rootly_sdk/models/playbook_task_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,20 +20,19 @@ class PlaybookTaskList: """ Attributes: - data (list[PlaybookTaskListDataItem]): + data (list['PlaybookTaskListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[PlaybookTaskListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["PlaybookTaskListDataItem"] + links: "Links" + meta: "Meta" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) playbook_task_list = cls( data=data, diff --git a/rootly_sdk/models/playbook_task_list_data_item.py b/rootly_sdk/models/playbook_task_list_data_item.py index 6a1a8b7e..8a7fac55 100644 --- a/rootly_sdk/models/playbook_task_list_data_item.py +++ b/rootly_sdk/models/playbook_task_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class PlaybookTaskListDataItem: id: str type_: PlaybookTaskListDataItemType - attributes: PlaybookTask + attributes: "PlaybookTask" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/playbook_task_response.py b/rootly_sdk/models/playbook_task_response.py index cfa83e2b..6ac98183 100644 --- a/rootly_sdk/models/playbook_task_response.py +++ b/rootly_sdk/models/playbook_task_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,18 +19,17 @@ class PlaybookTaskResponse: """ Attributes: data (PlaybookTaskResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: PlaybookTaskResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "PlaybookTaskResponseData" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = PlaybookTaskResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) playbook_task_response = cls( data=data, diff --git a/rootly_sdk/models/playbook_task_response_data.py b/rootly_sdk/models/playbook_task_response_data.py index 8dda77d8..7ec717a0 100644 --- a/rootly_sdk/models/playbook_task_response_data.py +++ b/rootly_sdk/models/playbook_task_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class PlaybookTaskResponseData: id: str type_: PlaybookTaskResponseDataType - attributes: PlaybookTask + attributes: "PlaybookTask" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/post_mortem_template.py b/rootly_sdk/models/post_mortem_template.py index 175b93d9..568536a6 100644 --- a/rootly_sdk/models/post_mortem_template.py +++ b/rootly_sdk/models/post_mortem_template.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,24 +21,25 @@ class PostMortemTemplate: name (str): The name of the postmortem template created_at (str): Date of creation updated_at (str): Date of last update - slug (str | Unset): The slugified name of the postmortem template - default (bool | None | Unset): Default selected template when editing a postmortem - content (str | Unset): The postmortem template. Liquid syntax and markdown are supported - content_html (None | str | Unset): The postmortem template in HTML format with TipTap blocks support. Supports - followup and timeline components. Liquid syntax is supported. - content_json (None | PostMortemTemplateContentJsonType0 | Unset): The postmortem template in TipTap JSON format - format_ (PostMortemTemplateFormat | Unset): The format of the input + slug (Union[Unset, str]): The slugified name of the postmortem template + default (Union[None, Unset, bool]): Default selected template when editing a postmortem + content (Union[Unset, str]): The postmortem template. Liquid syntax and markdown are supported + content_html (Union[None, Unset, str]): The postmortem template in HTML format with TipTap blocks support. + Supports followup and timeline components. Liquid syntax is supported. + content_json (Union['PostMortemTemplateContentJsonType0', None, Unset]): The postmortem template in TipTap JSON + format + format_ (Union[Unset, PostMortemTemplateFormat]): The format of the input """ name: str created_at: str updated_at: str - slug: str | Unset = UNSET - default: bool | None | Unset = UNSET - content: str | Unset = UNSET - content_html: None | str | Unset = UNSET - content_json: None | PostMortemTemplateContentJsonType0 | Unset = UNSET - format_: PostMortemTemplateFormat | Unset = UNSET + slug: Union[Unset, str] = UNSET + default: Union[None, Unset, bool] = UNSET + content: Union[Unset, str] = UNSET + content_html: Union[None, Unset, str] = UNSET + content_json: Union["PostMortemTemplateContentJsonType0", None, Unset] = UNSET + format_: Union[Unset, PostMortemTemplateFormat] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -54,7 +53,7 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - default: bool | None | Unset + default: Union[None, Unset, bool] if isinstance(self.default, Unset): default = UNSET else: @@ -62,13 +61,13 @@ def to_dict(self) -> dict[str, Any]: content = self.content - content_html: None | str | Unset + content_html: Union[None, Unset, str] if isinstance(self.content_html, Unset): content_html = UNSET else: content_html = self.content_html - content_json: dict[str, Any] | None | Unset + content_json: Union[None, Unset, dict[str, Any]] if isinstance(self.content_json, Unset): content_json = UNSET elif isinstance(self.content_json, PostMortemTemplateContentJsonType0): @@ -76,7 +75,7 @@ def to_dict(self) -> dict[str, Any]: else: content_json = self.content_json - format_: str | Unset = UNSET + format_: Union[Unset, str] = UNSET if not isinstance(self.format_, Unset): format_ = self.format_ @@ -117,27 +116,27 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: slug = d.pop("slug", UNSET) - def _parse_default(data: object) -> bool | None | Unset: + def _parse_default(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) default = _parse_default(d.pop("default", UNSET)) content = d.pop("content", UNSET) - def _parse_content_html(data: object) -> None | str | Unset: + def _parse_content_html(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) content_html = _parse_content_html(d.pop("content_html", UNSET)) - def _parse_content_json(data: object) -> None | PostMortemTemplateContentJsonType0 | Unset: + def _parse_content_json(data: object) -> Union["PostMortemTemplateContentJsonType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -148,14 +147,14 @@ def _parse_content_json(data: object) -> None | PostMortemTemplateContentJsonTyp content_json_type_0 = PostMortemTemplateContentJsonType0.from_dict(data) return content_json_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(None | PostMortemTemplateContentJsonType0 | Unset, data) + return cast(Union["PostMortemTemplateContentJsonType0", None, Unset], data) content_json = _parse_content_json(d.pop("content_json", UNSET)) _format_ = d.pop("format", UNSET) - format_: PostMortemTemplateFormat | Unset + format_: Union[Unset, PostMortemTemplateFormat] if isinstance(_format_, Unset): format_ = UNSET else: diff --git a/rootly_sdk/models/post_mortem_template_content_json_type_0.py b/rootly_sdk/models/post_mortem_template_content_json_type_0.py index 0375e77a..0670aad3 100644 --- a/rootly_sdk/models/post_mortem_template_content_json_type_0.py +++ b/rootly_sdk/models/post_mortem_template_content_json_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,7 +14,6 @@ class PostMortemTemplateContentJsonType0: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) diff --git a/rootly_sdk/models/post_mortem_template_list.py b/rootly_sdk/models/post_mortem_template_list.py index f855b333..954c2436 100644 --- a/rootly_sdk/models/post_mortem_template_list.py +++ b/rootly_sdk/models/post_mortem_template_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,20 +20,19 @@ class PostMortemTemplateList: """ Attributes: - data (list[PostMortemTemplateListDataItem]): + data (list['PostMortemTemplateListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[PostMortemTemplateListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["PostMortemTemplateListDataItem"] + links: "Links" + meta: "Meta" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) post_mortem_template_list = cls( data=data, diff --git a/rootly_sdk/models/post_mortem_template_list_data_item.py b/rootly_sdk/models/post_mortem_template_list_data_item.py index 18004832..7bd5a785 100644 --- a/rootly_sdk/models/post_mortem_template_list_data_item.py +++ b/rootly_sdk/models/post_mortem_template_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class PostMortemTemplateListDataItem: id: str type_: PostMortemTemplateListDataItemType - attributes: PostMortemTemplate + attributes: "PostMortemTemplate" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/post_mortem_template_response.py b/rootly_sdk/models/post_mortem_template_response.py index 19995e60..7cb5b4db 100644 --- a/rootly_sdk/models/post_mortem_template_response.py +++ b/rootly_sdk/models/post_mortem_template_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,18 +19,17 @@ class PostMortemTemplateResponse: """ Attributes: data (PostMortemTemplateResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: PostMortemTemplateResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "PostMortemTemplateResponseData" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = PostMortemTemplateResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) post_mortem_template_response = cls( data=data, diff --git a/rootly_sdk/models/post_mortem_template_response_data.py b/rootly_sdk/models/post_mortem_template_response_data.py index 839a4498..c9c97e69 100644 --- a/rootly_sdk/models/post_mortem_template_response_data.py +++ b/rootly_sdk/models/post_mortem_template_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class PostMortemTemplateResponseData: id: str type_: PostMortemTemplateResponseDataType - attributes: PostMortemTemplate + attributes: "PostMortemTemplate" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/post_mortem_trigger_params.py b/rootly_sdk/models/post_mortem_trigger_params.py index a045bbe9..5e90bbe2 100644 --- a/rootly_sdk/models/post_mortem_trigger_params.py +++ b/rootly_sdk/models/post_mortem_trigger_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -128,214 +126,219 @@ class PostMortemTriggerParams: """ Attributes: trigger_type (PostMortemTriggerParamsTriggerType): - triggers (list[str] | Unset): - incident_visibilities (list[bool] | Unset): - incident_kinds (list[PostMortemTriggerParamsIncidentKindsItem] | Unset): - incident_statuses (list[PostMortemTriggerParamsIncidentStatusesItem] | Unset): - incident_inactivity_duration (None | str | Unset): ex. 10 min, 1h, 3 days, 2 weeks - incident_condition (PostMortemTriggerParamsIncidentCondition | Unset): Default: 'ALL'. - incident_condition_visibility (PostMortemTriggerParamsIncidentConditionVisibility | Unset): Default: 'ANY'. - incident_condition_kind (PostMortemTriggerParamsIncidentConditionKind | Unset): Default: 'IS'. - incident_condition_status (PostMortemTriggerParamsIncidentConditionStatus | Unset): Default: 'ANY'. - incident_condition_sub_status (PostMortemTriggerParamsIncidentConditionSubStatus | Unset): Default: 'ANY'. - incident_condition_environment (PostMortemTriggerParamsIncidentConditionEnvironment | Unset): Default: 'ANY'. - incident_condition_severity (PostMortemTriggerParamsIncidentConditionSeverity | Unset): Default: 'ANY'. - incident_condition_incident_type (PostMortemTriggerParamsIncidentConditionIncidentType | Unset): Default: + triggers (Union[Unset, list[str]]): + incident_visibilities (Union[Unset, list[bool]]): + incident_kinds (Union[Unset, list[PostMortemTriggerParamsIncidentKindsItem]]): + incident_statuses (Union[Unset, list[PostMortemTriggerParamsIncidentStatusesItem]]): + incident_inactivity_duration (Union[None, Unset, str]): ex. 10 min, 1h, 3 days, 2 weeks + incident_condition (Union[Unset, PostMortemTriggerParamsIncidentCondition]): Default: 'ALL'. + incident_condition_visibility (Union[Unset, PostMortemTriggerParamsIncidentConditionVisibility]): Default: + 'ANY'. + incident_condition_kind (Union[Unset, PostMortemTriggerParamsIncidentConditionKind]): Default: 'IS'. + incident_condition_status (Union[Unset, PostMortemTriggerParamsIncidentConditionStatus]): Default: 'ANY'. + incident_condition_sub_status (Union[Unset, PostMortemTriggerParamsIncidentConditionSubStatus]): Default: 'ANY'. - incident_condition_incident_roles (PostMortemTriggerParamsIncidentConditionIncidentRoles | Unset): Default: + incident_condition_environment (Union[Unset, PostMortemTriggerParamsIncidentConditionEnvironment]): Default: 'ANY'. - incident_condition_service (PostMortemTriggerParamsIncidentConditionService | Unset): Default: 'ANY'. - incident_condition_functionality (PostMortemTriggerParamsIncidentConditionFunctionality | Unset): Default: + incident_condition_severity (Union[Unset, PostMortemTriggerParamsIncidentConditionSeverity]): Default: 'ANY'. + incident_condition_incident_type (Union[Unset, PostMortemTriggerParamsIncidentConditionIncidentType]): Default: 'ANY'. - incident_condition_group (PostMortemTriggerParamsIncidentConditionGroup | Unset): Default: 'ANY'. - incident_condition_cause (PostMortemTriggerParamsIncidentConditionCause | Unset): Default: 'ANY'. - incident_condition_label (PostMortemTriggerParamsIncidentConditionLabel | Unset): Default: 'ANY'. - incident_condition_label_use_regexp (bool | Unset): Default: False. - incident_labels (list[str] | Unset): - incident_post_mortem_condition_cause (PostMortemTriggerParamsIncidentPostMortemConditionCause | Unset): + incident_condition_incident_roles (Union[Unset, PostMortemTriggerParamsIncidentConditionIncidentRoles]): + Default: 'ANY'. + incident_condition_service (Union[Unset, PostMortemTriggerParamsIncidentConditionService]): Default: 'ANY'. + incident_condition_functionality (Union[Unset, PostMortemTriggerParamsIncidentConditionFunctionality]): + Default: 'ANY'. + incident_condition_group (Union[Unset, PostMortemTriggerParamsIncidentConditionGroup]): Default: 'ANY'. + incident_condition_cause (Union[Unset, PostMortemTriggerParamsIncidentConditionCause]): Default: 'ANY'. + incident_condition_label (Union[Unset, PostMortemTriggerParamsIncidentConditionLabel]): Default: 'ANY'. + incident_condition_label_use_regexp (Union[Unset, bool]): Default: False. + incident_labels (Union[Unset, list[str]]): + incident_post_mortem_condition_cause (Union[Unset, PostMortemTriggerParamsIncidentPostMortemConditionCause]): [DEPRECATED] Use incident_condition_cause instead Default: 'ANY'. - incident_condition_summary (PostMortemTriggerParamsIncidentConditionSummary | Unset): - incident_condition_started_at (PostMortemTriggerParamsIncidentConditionStartedAt | Unset): - incident_condition_detected_at (PostMortemTriggerParamsIncidentConditionDetectedAt | Unset): - incident_condition_acknowledged_at (PostMortemTriggerParamsIncidentConditionAcknowledgedAt | Unset): - incident_condition_mitigated_at (PostMortemTriggerParamsIncidentConditionMitigatedAt | Unset): - incident_condition_resolved_at (PostMortemTriggerParamsIncidentConditionResolvedAt | Unset): - incident_conditional_inactivity (PostMortemTriggerParamsIncidentConditionalInactivity | Unset): - incident_post_mortem_condition (PostMortemTriggerParamsIncidentPostMortemCondition | Unset): - incident_post_mortem_condition_status (PostMortemTriggerParamsIncidentPostMortemConditionStatus | Unset): + incident_condition_summary (Union[Unset, PostMortemTriggerParamsIncidentConditionSummary]): + incident_condition_started_at (Union[Unset, PostMortemTriggerParamsIncidentConditionStartedAt]): + incident_condition_detected_at (Union[Unset, PostMortemTriggerParamsIncidentConditionDetectedAt]): + incident_condition_acknowledged_at (Union[Unset, PostMortemTriggerParamsIncidentConditionAcknowledgedAt]): + incident_condition_mitigated_at (Union[Unset, PostMortemTriggerParamsIncidentConditionMitigatedAt]): + incident_condition_resolved_at (Union[Unset, PostMortemTriggerParamsIncidentConditionResolvedAt]): + incident_conditional_inactivity (Union[Unset, PostMortemTriggerParamsIncidentConditionalInactivity]): + incident_post_mortem_condition (Union[Unset, PostMortemTriggerParamsIncidentPostMortemCondition]): + incident_post_mortem_condition_status (Union[Unset, PostMortemTriggerParamsIncidentPostMortemConditionStatus]): Default: 'ANY'. - incident_post_mortem_statuses (list[PostMortemTriggerParamsIncidentPostMortemStatusesItem] | Unset): + incident_post_mortem_statuses (Union[Unset, list[PostMortemTriggerParamsIncidentPostMortemStatusesItem]]): """ trigger_type: PostMortemTriggerParamsTriggerType - triggers: list[str] | Unset = UNSET - incident_visibilities: list[bool] | Unset = UNSET - incident_kinds: list[PostMortemTriggerParamsIncidentKindsItem] | Unset = UNSET - incident_statuses: list[PostMortemTriggerParamsIncidentStatusesItem] | Unset = UNSET - incident_inactivity_duration: None | str | Unset = UNSET - incident_condition: PostMortemTriggerParamsIncidentCondition | Unset = "ALL" - incident_condition_visibility: PostMortemTriggerParamsIncidentConditionVisibility | Unset = "ANY" - incident_condition_kind: PostMortemTriggerParamsIncidentConditionKind | Unset = "IS" - incident_condition_status: PostMortemTriggerParamsIncidentConditionStatus | Unset = "ANY" - incident_condition_sub_status: PostMortemTriggerParamsIncidentConditionSubStatus | Unset = "ANY" - incident_condition_environment: PostMortemTriggerParamsIncidentConditionEnvironment | Unset = "ANY" - incident_condition_severity: PostMortemTriggerParamsIncidentConditionSeverity | Unset = "ANY" - incident_condition_incident_type: PostMortemTriggerParamsIncidentConditionIncidentType | Unset = "ANY" - incident_condition_incident_roles: PostMortemTriggerParamsIncidentConditionIncidentRoles | Unset = "ANY" - incident_condition_service: PostMortemTriggerParamsIncidentConditionService | Unset = "ANY" - incident_condition_functionality: PostMortemTriggerParamsIncidentConditionFunctionality | Unset = "ANY" - incident_condition_group: PostMortemTriggerParamsIncidentConditionGroup | Unset = "ANY" - incident_condition_cause: PostMortemTriggerParamsIncidentConditionCause | Unset = "ANY" - incident_condition_label: PostMortemTriggerParamsIncidentConditionLabel | Unset = "ANY" - incident_condition_label_use_regexp: bool | Unset = False - incident_labels: list[str] | Unset = UNSET - incident_post_mortem_condition_cause: PostMortemTriggerParamsIncidentPostMortemConditionCause | Unset = "ANY" - incident_condition_summary: PostMortemTriggerParamsIncidentConditionSummary | Unset = UNSET - incident_condition_started_at: PostMortemTriggerParamsIncidentConditionStartedAt | Unset = UNSET - incident_condition_detected_at: PostMortemTriggerParamsIncidentConditionDetectedAt | Unset = UNSET - incident_condition_acknowledged_at: PostMortemTriggerParamsIncidentConditionAcknowledgedAt | Unset = UNSET - incident_condition_mitigated_at: PostMortemTriggerParamsIncidentConditionMitigatedAt | Unset = UNSET - incident_condition_resolved_at: PostMortemTriggerParamsIncidentConditionResolvedAt | Unset = UNSET - incident_conditional_inactivity: PostMortemTriggerParamsIncidentConditionalInactivity | Unset = UNSET - incident_post_mortem_condition: PostMortemTriggerParamsIncidentPostMortemCondition | Unset = UNSET - incident_post_mortem_condition_status: PostMortemTriggerParamsIncidentPostMortemConditionStatus | Unset = "ANY" - incident_post_mortem_statuses: list[PostMortemTriggerParamsIncidentPostMortemStatusesItem] | Unset = UNSET + triggers: Union[Unset, list[str]] = UNSET + incident_visibilities: Union[Unset, list[bool]] = UNSET + incident_kinds: Union[Unset, list[PostMortemTriggerParamsIncidentKindsItem]] = UNSET + incident_statuses: Union[Unset, list[PostMortemTriggerParamsIncidentStatusesItem]] = UNSET + incident_inactivity_duration: Union[None, Unset, str] = UNSET + incident_condition: Union[Unset, PostMortemTriggerParamsIncidentCondition] = "ALL" + incident_condition_visibility: Union[Unset, PostMortemTriggerParamsIncidentConditionVisibility] = "ANY" + incident_condition_kind: Union[Unset, PostMortemTriggerParamsIncidentConditionKind] = "IS" + incident_condition_status: Union[Unset, PostMortemTriggerParamsIncidentConditionStatus] = "ANY" + incident_condition_sub_status: Union[Unset, PostMortemTriggerParamsIncidentConditionSubStatus] = "ANY" + incident_condition_environment: Union[Unset, PostMortemTriggerParamsIncidentConditionEnvironment] = "ANY" + incident_condition_severity: Union[Unset, PostMortemTriggerParamsIncidentConditionSeverity] = "ANY" + incident_condition_incident_type: Union[Unset, PostMortemTriggerParamsIncidentConditionIncidentType] = "ANY" + incident_condition_incident_roles: Union[Unset, PostMortemTriggerParamsIncidentConditionIncidentRoles] = "ANY" + incident_condition_service: Union[Unset, PostMortemTriggerParamsIncidentConditionService] = "ANY" + incident_condition_functionality: Union[Unset, PostMortemTriggerParamsIncidentConditionFunctionality] = "ANY" + incident_condition_group: Union[Unset, PostMortemTriggerParamsIncidentConditionGroup] = "ANY" + incident_condition_cause: Union[Unset, PostMortemTriggerParamsIncidentConditionCause] = "ANY" + incident_condition_label: Union[Unset, PostMortemTriggerParamsIncidentConditionLabel] = "ANY" + incident_condition_label_use_regexp: Union[Unset, bool] = False + incident_labels: Union[Unset, list[str]] = UNSET + incident_post_mortem_condition_cause: Union[Unset, PostMortemTriggerParamsIncidentPostMortemConditionCause] = "ANY" + incident_condition_summary: Union[Unset, PostMortemTriggerParamsIncidentConditionSummary] = UNSET + incident_condition_started_at: Union[Unset, PostMortemTriggerParamsIncidentConditionStartedAt] = UNSET + incident_condition_detected_at: Union[Unset, PostMortemTriggerParamsIncidentConditionDetectedAt] = UNSET + incident_condition_acknowledged_at: Union[Unset, PostMortemTriggerParamsIncidentConditionAcknowledgedAt] = UNSET + incident_condition_mitigated_at: Union[Unset, PostMortemTriggerParamsIncidentConditionMitigatedAt] = UNSET + incident_condition_resolved_at: Union[Unset, PostMortemTriggerParamsIncidentConditionResolvedAt] = UNSET + incident_conditional_inactivity: Union[Unset, PostMortemTriggerParamsIncidentConditionalInactivity] = UNSET + incident_post_mortem_condition: Union[Unset, PostMortemTriggerParamsIncidentPostMortemCondition] = UNSET + incident_post_mortem_condition_status: Union[Unset, PostMortemTriggerParamsIncidentPostMortemConditionStatus] = ( + "ANY" + ) + incident_post_mortem_statuses: Union[Unset, list[PostMortemTriggerParamsIncidentPostMortemStatusesItem]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: trigger_type: str = self.trigger_type - triggers: list[str] | Unset = UNSET + triggers: Union[Unset, list[str]] = UNSET if not isinstance(self.triggers, Unset): triggers = self.triggers - incident_visibilities: list[bool] | Unset = UNSET + incident_visibilities: Union[Unset, list[bool]] = UNSET if not isinstance(self.incident_visibilities, Unset): incident_visibilities = self.incident_visibilities - incident_kinds: list[str] | Unset = UNSET + incident_kinds: Union[Unset, list[str]] = UNSET if not isinstance(self.incident_kinds, Unset): incident_kinds = [] for incident_kinds_item_data in self.incident_kinds: incident_kinds_item: str = incident_kinds_item_data incident_kinds.append(incident_kinds_item) - incident_statuses: list[str] | Unset = UNSET + incident_statuses: Union[Unset, list[str]] = UNSET if not isinstance(self.incident_statuses, Unset): incident_statuses = [] for incident_statuses_item_data in self.incident_statuses: incident_statuses_item: str = incident_statuses_item_data incident_statuses.append(incident_statuses_item) - incident_inactivity_duration: None | str | Unset + incident_inactivity_duration: Union[None, Unset, str] if isinstance(self.incident_inactivity_duration, Unset): incident_inactivity_duration = UNSET else: incident_inactivity_duration = self.incident_inactivity_duration - incident_condition: str | Unset = UNSET + incident_condition: Union[Unset, str] = UNSET if not isinstance(self.incident_condition, Unset): incident_condition = self.incident_condition - incident_condition_visibility: str | Unset = UNSET + incident_condition_visibility: Union[Unset, str] = UNSET if not isinstance(self.incident_condition_visibility, Unset): incident_condition_visibility = self.incident_condition_visibility - incident_condition_kind: str | Unset = UNSET + incident_condition_kind: Union[Unset, str] = UNSET if not isinstance(self.incident_condition_kind, Unset): incident_condition_kind = self.incident_condition_kind - incident_condition_status: str | Unset = UNSET + incident_condition_status: Union[Unset, str] = UNSET if not isinstance(self.incident_condition_status, Unset): incident_condition_status = self.incident_condition_status - incident_condition_sub_status: str | Unset = UNSET + incident_condition_sub_status: Union[Unset, str] = UNSET if not isinstance(self.incident_condition_sub_status, Unset): incident_condition_sub_status = self.incident_condition_sub_status - incident_condition_environment: str | Unset = UNSET + incident_condition_environment: Union[Unset, str] = UNSET if not isinstance(self.incident_condition_environment, Unset): incident_condition_environment = self.incident_condition_environment - incident_condition_severity: str | Unset = UNSET + incident_condition_severity: Union[Unset, str] = UNSET if not isinstance(self.incident_condition_severity, Unset): incident_condition_severity = self.incident_condition_severity - incident_condition_incident_type: str | Unset = UNSET + incident_condition_incident_type: Union[Unset, str] = UNSET if not isinstance(self.incident_condition_incident_type, Unset): incident_condition_incident_type = self.incident_condition_incident_type - incident_condition_incident_roles: str | Unset = UNSET + incident_condition_incident_roles: Union[Unset, str] = UNSET if not isinstance(self.incident_condition_incident_roles, Unset): incident_condition_incident_roles = self.incident_condition_incident_roles - incident_condition_service: str | Unset = UNSET + incident_condition_service: Union[Unset, str] = UNSET if not isinstance(self.incident_condition_service, Unset): incident_condition_service = self.incident_condition_service - incident_condition_functionality: str | Unset = UNSET + incident_condition_functionality: Union[Unset, str] = UNSET if not isinstance(self.incident_condition_functionality, Unset): incident_condition_functionality = self.incident_condition_functionality - incident_condition_group: str | Unset = UNSET + incident_condition_group: Union[Unset, str] = UNSET if not isinstance(self.incident_condition_group, Unset): incident_condition_group = self.incident_condition_group - incident_condition_cause: str | Unset = UNSET + incident_condition_cause: Union[Unset, str] = UNSET if not isinstance(self.incident_condition_cause, Unset): incident_condition_cause = self.incident_condition_cause - incident_condition_label: str | Unset = UNSET + incident_condition_label: Union[Unset, str] = UNSET if not isinstance(self.incident_condition_label, Unset): incident_condition_label = self.incident_condition_label incident_condition_label_use_regexp = self.incident_condition_label_use_regexp - incident_labels: list[str] | Unset = UNSET + incident_labels: Union[Unset, list[str]] = UNSET if not isinstance(self.incident_labels, Unset): incident_labels = self.incident_labels - incident_post_mortem_condition_cause: str | Unset = UNSET + incident_post_mortem_condition_cause: Union[Unset, str] = UNSET if not isinstance(self.incident_post_mortem_condition_cause, Unset): incident_post_mortem_condition_cause = self.incident_post_mortem_condition_cause - incident_condition_summary: str | Unset = UNSET + incident_condition_summary: Union[Unset, str] = UNSET if not isinstance(self.incident_condition_summary, Unset): incident_condition_summary = self.incident_condition_summary - incident_condition_started_at: str | Unset = UNSET + incident_condition_started_at: Union[Unset, str] = UNSET if not isinstance(self.incident_condition_started_at, Unset): incident_condition_started_at = self.incident_condition_started_at - incident_condition_detected_at: str | Unset = UNSET + incident_condition_detected_at: Union[Unset, str] = UNSET if not isinstance(self.incident_condition_detected_at, Unset): incident_condition_detected_at = self.incident_condition_detected_at - incident_condition_acknowledged_at: str | Unset = UNSET + incident_condition_acknowledged_at: Union[Unset, str] = UNSET if not isinstance(self.incident_condition_acknowledged_at, Unset): incident_condition_acknowledged_at = self.incident_condition_acknowledged_at - incident_condition_mitigated_at: str | Unset = UNSET + incident_condition_mitigated_at: Union[Unset, str] = UNSET if not isinstance(self.incident_condition_mitigated_at, Unset): incident_condition_mitigated_at = self.incident_condition_mitigated_at - incident_condition_resolved_at: str | Unset = UNSET + incident_condition_resolved_at: Union[Unset, str] = UNSET if not isinstance(self.incident_condition_resolved_at, Unset): incident_condition_resolved_at = self.incident_condition_resolved_at - incident_conditional_inactivity: str | Unset = UNSET + incident_conditional_inactivity: Union[Unset, str] = UNSET if not isinstance(self.incident_conditional_inactivity, Unset): incident_conditional_inactivity = self.incident_conditional_inactivity - incident_post_mortem_condition: str | Unset = UNSET + incident_post_mortem_condition: Union[Unset, str] = UNSET if not isinstance(self.incident_post_mortem_condition, Unset): incident_post_mortem_condition = self.incident_post_mortem_condition - incident_post_mortem_condition_status: str | Unset = UNSET + incident_post_mortem_condition_status: Union[Unset, str] = UNSET if not isinstance(self.incident_post_mortem_condition_status, Unset): incident_post_mortem_condition_status = self.incident_post_mortem_condition_status - incident_post_mortem_statuses: list[str] | Unset = UNSET + incident_post_mortem_statuses: Union[Unset, list[str]] = UNSET if not isinstance(self.incident_post_mortem_statuses, Unset): incident_post_mortem_statuses = [] for incident_post_mortem_statuses_item_data in self.incident_post_mortem_statuses: @@ -425,44 +428,40 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: incident_visibilities = cast(list[bool], d.pop("incident_visibilities", UNSET)) + incident_kinds = [] _incident_kinds = d.pop("incident_kinds", UNSET) - incident_kinds: list[PostMortemTriggerParamsIncidentKindsItem] | Unset = UNSET - if _incident_kinds is not UNSET: - incident_kinds = [] - for incident_kinds_item_data in _incident_kinds: - incident_kinds_item = check_post_mortem_trigger_params_incident_kinds_item(incident_kinds_item_data) + for incident_kinds_item_data in _incident_kinds or []: + incident_kinds_item = check_post_mortem_trigger_params_incident_kinds_item(incident_kinds_item_data) - incident_kinds.append(incident_kinds_item) + incident_kinds.append(incident_kinds_item) + incident_statuses = [] _incident_statuses = d.pop("incident_statuses", UNSET) - incident_statuses: list[PostMortemTriggerParamsIncidentStatusesItem] | Unset = UNSET - if _incident_statuses is not UNSET: - incident_statuses = [] - for incident_statuses_item_data in _incident_statuses: - incident_statuses_item = check_post_mortem_trigger_params_incident_statuses_item( - incident_statuses_item_data - ) + for incident_statuses_item_data in _incident_statuses or []: + incident_statuses_item = check_post_mortem_trigger_params_incident_statuses_item( + incident_statuses_item_data + ) - incident_statuses.append(incident_statuses_item) + incident_statuses.append(incident_statuses_item) - def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: + def _parse_incident_inactivity_duration(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) incident_inactivity_duration = _parse_incident_inactivity_duration(d.pop("incident_inactivity_duration", UNSET)) _incident_condition = d.pop("incident_condition", UNSET) - incident_condition: PostMortemTriggerParamsIncidentCondition | Unset + incident_condition: Union[Unset, PostMortemTriggerParamsIncidentCondition] if isinstance(_incident_condition, Unset): incident_condition = UNSET else: incident_condition = check_post_mortem_trigger_params_incident_condition(_incident_condition) _incident_condition_visibility = d.pop("incident_condition_visibility", UNSET) - incident_condition_visibility: PostMortemTriggerParamsIncidentConditionVisibility | Unset + incident_condition_visibility: Union[Unset, PostMortemTriggerParamsIncidentConditionVisibility] if isinstance(_incident_condition_visibility, Unset): incident_condition_visibility = UNSET else: @@ -471,14 +470,14 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_condition_kind = d.pop("incident_condition_kind", UNSET) - incident_condition_kind: PostMortemTriggerParamsIncidentConditionKind | Unset + incident_condition_kind: Union[Unset, PostMortemTriggerParamsIncidentConditionKind] if isinstance(_incident_condition_kind, Unset): incident_condition_kind = UNSET else: incident_condition_kind = check_post_mortem_trigger_params_incident_condition_kind(_incident_condition_kind) _incident_condition_status = d.pop("incident_condition_status", UNSET) - incident_condition_status: PostMortemTriggerParamsIncidentConditionStatus | Unset + incident_condition_status: Union[Unset, PostMortemTriggerParamsIncidentConditionStatus] if isinstance(_incident_condition_status, Unset): incident_condition_status = UNSET else: @@ -487,7 +486,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_condition_sub_status = d.pop("incident_condition_sub_status", UNSET) - incident_condition_sub_status: PostMortemTriggerParamsIncidentConditionSubStatus | Unset + incident_condition_sub_status: Union[Unset, PostMortemTriggerParamsIncidentConditionSubStatus] if isinstance(_incident_condition_sub_status, Unset): incident_condition_sub_status = UNSET else: @@ -496,7 +495,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_condition_environment = d.pop("incident_condition_environment", UNSET) - incident_condition_environment: PostMortemTriggerParamsIncidentConditionEnvironment | Unset + incident_condition_environment: Union[Unset, PostMortemTriggerParamsIncidentConditionEnvironment] if isinstance(_incident_condition_environment, Unset): incident_condition_environment = UNSET else: @@ -505,7 +504,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_condition_severity = d.pop("incident_condition_severity", UNSET) - incident_condition_severity: PostMortemTriggerParamsIncidentConditionSeverity | Unset + incident_condition_severity: Union[Unset, PostMortemTriggerParamsIncidentConditionSeverity] if isinstance(_incident_condition_severity, Unset): incident_condition_severity = UNSET else: @@ -514,7 +513,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_condition_incident_type = d.pop("incident_condition_incident_type", UNSET) - incident_condition_incident_type: PostMortemTriggerParamsIncidentConditionIncidentType | Unset + incident_condition_incident_type: Union[Unset, PostMortemTriggerParamsIncidentConditionIncidentType] if isinstance(_incident_condition_incident_type, Unset): incident_condition_incident_type = UNSET else: @@ -523,7 +522,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_condition_incident_roles = d.pop("incident_condition_incident_roles", UNSET) - incident_condition_incident_roles: PostMortemTriggerParamsIncidentConditionIncidentRoles | Unset + incident_condition_incident_roles: Union[Unset, PostMortemTriggerParamsIncidentConditionIncidentRoles] if isinstance(_incident_condition_incident_roles, Unset): incident_condition_incident_roles = UNSET else: @@ -532,7 +531,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_condition_service = d.pop("incident_condition_service", UNSET) - incident_condition_service: PostMortemTriggerParamsIncidentConditionService | Unset + incident_condition_service: Union[Unset, PostMortemTriggerParamsIncidentConditionService] if isinstance(_incident_condition_service, Unset): incident_condition_service = UNSET else: @@ -541,7 +540,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_condition_functionality = d.pop("incident_condition_functionality", UNSET) - incident_condition_functionality: PostMortemTriggerParamsIncidentConditionFunctionality | Unset + incident_condition_functionality: Union[Unset, PostMortemTriggerParamsIncidentConditionFunctionality] if isinstance(_incident_condition_functionality, Unset): incident_condition_functionality = UNSET else: @@ -550,7 +549,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_condition_group = d.pop("incident_condition_group", UNSET) - incident_condition_group: PostMortemTriggerParamsIncidentConditionGroup | Unset + incident_condition_group: Union[Unset, PostMortemTriggerParamsIncidentConditionGroup] if isinstance(_incident_condition_group, Unset): incident_condition_group = UNSET else: @@ -559,7 +558,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_condition_cause = d.pop("incident_condition_cause", UNSET) - incident_condition_cause: PostMortemTriggerParamsIncidentConditionCause | Unset + incident_condition_cause: Union[Unset, PostMortemTriggerParamsIncidentConditionCause] if isinstance(_incident_condition_cause, Unset): incident_condition_cause = UNSET else: @@ -568,7 +567,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_condition_label = d.pop("incident_condition_label", UNSET) - incident_condition_label: PostMortemTriggerParamsIncidentConditionLabel | Unset + incident_condition_label: Union[Unset, PostMortemTriggerParamsIncidentConditionLabel] if isinstance(_incident_condition_label, Unset): incident_condition_label = UNSET else: @@ -581,7 +580,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: incident_labels = cast(list[str], d.pop("incident_labels", UNSET)) _incident_post_mortem_condition_cause = d.pop("incident_post_mortem_condition_cause", UNSET) - incident_post_mortem_condition_cause: PostMortemTriggerParamsIncidentPostMortemConditionCause | Unset + incident_post_mortem_condition_cause: Union[Unset, PostMortemTriggerParamsIncidentPostMortemConditionCause] if isinstance(_incident_post_mortem_condition_cause, Unset): incident_post_mortem_condition_cause = UNSET else: @@ -592,7 +591,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_condition_summary = d.pop("incident_condition_summary", UNSET) - incident_condition_summary: PostMortemTriggerParamsIncidentConditionSummary | Unset + incident_condition_summary: Union[Unset, PostMortemTriggerParamsIncidentConditionSummary] if isinstance(_incident_condition_summary, Unset): incident_condition_summary = UNSET else: @@ -601,7 +600,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_condition_started_at = d.pop("incident_condition_started_at", UNSET) - incident_condition_started_at: PostMortemTriggerParamsIncidentConditionStartedAt | Unset + incident_condition_started_at: Union[Unset, PostMortemTriggerParamsIncidentConditionStartedAt] if isinstance(_incident_condition_started_at, Unset): incident_condition_started_at = UNSET else: @@ -610,7 +609,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_condition_detected_at = d.pop("incident_condition_detected_at", UNSET) - incident_condition_detected_at: PostMortemTriggerParamsIncidentConditionDetectedAt | Unset + incident_condition_detected_at: Union[Unset, PostMortemTriggerParamsIncidentConditionDetectedAt] if isinstance(_incident_condition_detected_at, Unset): incident_condition_detected_at = UNSET else: @@ -619,7 +618,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_condition_acknowledged_at = d.pop("incident_condition_acknowledged_at", UNSET) - incident_condition_acknowledged_at: PostMortemTriggerParamsIncidentConditionAcknowledgedAt | Unset + incident_condition_acknowledged_at: Union[Unset, PostMortemTriggerParamsIncidentConditionAcknowledgedAt] if isinstance(_incident_condition_acknowledged_at, Unset): incident_condition_acknowledged_at = UNSET else: @@ -628,7 +627,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_condition_mitigated_at = d.pop("incident_condition_mitigated_at", UNSET) - incident_condition_mitigated_at: PostMortemTriggerParamsIncidentConditionMitigatedAt | Unset + incident_condition_mitigated_at: Union[Unset, PostMortemTriggerParamsIncidentConditionMitigatedAt] if isinstance(_incident_condition_mitigated_at, Unset): incident_condition_mitigated_at = UNSET else: @@ -637,7 +636,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_condition_resolved_at = d.pop("incident_condition_resolved_at", UNSET) - incident_condition_resolved_at: PostMortemTriggerParamsIncidentConditionResolvedAt | Unset + incident_condition_resolved_at: Union[Unset, PostMortemTriggerParamsIncidentConditionResolvedAt] if isinstance(_incident_condition_resolved_at, Unset): incident_condition_resolved_at = UNSET else: @@ -646,7 +645,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_conditional_inactivity = d.pop("incident_conditional_inactivity", UNSET) - incident_conditional_inactivity: PostMortemTriggerParamsIncidentConditionalInactivity | Unset + incident_conditional_inactivity: Union[Unset, PostMortemTriggerParamsIncidentConditionalInactivity] if isinstance(_incident_conditional_inactivity, Unset): incident_conditional_inactivity = UNSET else: @@ -655,7 +654,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_post_mortem_condition = d.pop("incident_post_mortem_condition", UNSET) - incident_post_mortem_condition: PostMortemTriggerParamsIncidentPostMortemCondition | Unset + incident_post_mortem_condition: Union[Unset, PostMortemTriggerParamsIncidentPostMortemCondition] if isinstance(_incident_post_mortem_condition, Unset): incident_post_mortem_condition = UNSET else: @@ -664,7 +663,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) _incident_post_mortem_condition_status = d.pop("incident_post_mortem_condition_status", UNSET) - incident_post_mortem_condition_status: PostMortemTriggerParamsIncidentPostMortemConditionStatus | Unset + incident_post_mortem_condition_status: Union[Unset, PostMortemTriggerParamsIncidentPostMortemConditionStatus] if isinstance(_incident_post_mortem_condition_status, Unset): incident_post_mortem_condition_status = UNSET else: @@ -674,18 +673,14 @@ def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: ) ) + incident_post_mortem_statuses = [] _incident_post_mortem_statuses = d.pop("incident_post_mortem_statuses", UNSET) - incident_post_mortem_statuses: list[PostMortemTriggerParamsIncidentPostMortemStatusesItem] | Unset = UNSET - if _incident_post_mortem_statuses is not UNSET: - incident_post_mortem_statuses = [] - for incident_post_mortem_statuses_item_data in _incident_post_mortem_statuses: - incident_post_mortem_statuses_item = ( - check_post_mortem_trigger_params_incident_post_mortem_statuses_item( - incident_post_mortem_statuses_item_data - ) - ) + for incident_post_mortem_statuses_item_data in _incident_post_mortem_statuses or []: + incident_post_mortem_statuses_item = check_post_mortem_trigger_params_incident_post_mortem_statuses_item( + incident_post_mortem_statuses_item_data + ) - incident_post_mortem_statuses.append(incident_post_mortem_statuses_item) + incident_post_mortem_statuses.append(incident_post_mortem_statuses_item) post_mortem_trigger_params = cls( trigger_type=trigger_type, diff --git a/rootly_sdk/models/print_task_params.py b/rootly_sdk/models/print_task_params.py index caf8f707..e83aed48 100644 --- a/rootly_sdk/models/print_task_params.py +++ b/rootly_sdk/models/print_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,17 +15,17 @@ class PrintTaskParams: """ Attributes: message (str): The message to print - task_type (PrintTaskParamsTaskType | Unset): + task_type (Union[Unset, PrintTaskParamsTaskType]): """ message: str - task_type: PrintTaskParamsTaskType | Unset = UNSET + task_type: Union[Unset, PrintTaskParamsTaskType] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: message = self.message - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -49,7 +47,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: message = d.pop("message") _task_type = d.pop("task_type", UNSET) - task_type: PrintTaskParamsTaskType | Unset + task_type: Union[Unset, PrintTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/publish_incident_task_params.py b/rootly_sdk/models/publish_incident_task_params.py index 62a95e4c..60caa06c 100644 --- a/rootly_sdk/models/publish_incident_task_params.py +++ b/rootly_sdk/models/publish_incident_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -32,31 +30,34 @@ class PublishIncidentTaskParams: public_title (str): status (PublishIncidentTaskParamsStatus): Default: 'resolved'. status_page_id (str): - task_type (PublishIncidentTaskParamsTaskType | Unset): - event (str | Unset): Incident event description - notify_subscribers (bool | Unset): When true notifies subscribers of the status page by email/text Default: - False. - should_tweet (bool | Unset): For Statuspage.io integrated pages auto publishes a tweet for your update Default: - False. - status_page_template (PublishIncidentTaskParamsStatusPageTemplate | Unset): - integration_payload (None | str | Unset): Additional API Payload you can pass to statuspage.io for example. Can - contain liquid markup and need to be valid JSON + task_type (Union[Unset, PublishIncidentTaskParamsTaskType]): + event (Union[Unset, str]): Incident event description + notify_subscribers (Union[Unset, bool]): When true notifies subscribers of the status page by email/text + Default: False. + should_tweet (Union[Unset, bool]): For Statuspage.io integrated pages auto publishes a tweet for your update + Default: False. + status_page_template (Union[Unset, PublishIncidentTaskParamsStatusPageTemplate]): + status_page_ids (Union[Unset, list[str]]): Publishes the update to every listed status page (requires the + status-page-v3-limited-bulk-publish feature). When set, it takes precedence over status_page_id and the first + entry becomes status_page_id. + integration_payload (Union[None, Unset, str]): Additional API Payload you can pass to statuspage.io for example. + Can contain liquid markup and need to be valid JSON """ - incident: PublishIncidentTaskParamsIncident + incident: "PublishIncidentTaskParamsIncident" public_title: str status_page_id: str status: PublishIncidentTaskParamsStatus = "resolved" - task_type: PublishIncidentTaskParamsTaskType | Unset = UNSET - event: str | Unset = UNSET - notify_subscribers: bool | Unset = False - should_tweet: bool | Unset = False - status_page_template: PublishIncidentTaskParamsStatusPageTemplate | Unset = UNSET - integration_payload: None | str | Unset = UNSET + task_type: Union[Unset, PublishIncidentTaskParamsTaskType] = UNSET + event: Union[Unset, str] = UNSET + notify_subscribers: Union[Unset, bool] = False + should_tweet: Union[Unset, bool] = False + status_page_template: Union[Unset, "PublishIncidentTaskParamsStatusPageTemplate"] = UNSET + status_page_ids: Union[Unset, list[str]] = UNSET + integration_payload: Union[None, Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - incident = self.incident.to_dict() public_title = self.public_title @@ -65,7 +66,7 @@ def to_dict(self) -> dict[str, Any]: status_page_id = self.status_page_id - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -75,11 +76,15 @@ def to_dict(self) -> dict[str, Any]: should_tweet = self.should_tweet - status_page_template: dict[str, Any] | Unset = UNSET + status_page_template: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.status_page_template, Unset): status_page_template = self.status_page_template.to_dict() - integration_payload: None | str | Unset + status_page_ids: Union[Unset, list[str]] = UNSET + if not isinstance(self.status_page_ids, Unset): + status_page_ids = self.status_page_ids + + integration_payload: Union[None, Unset, str] if isinstance(self.integration_payload, Unset): integration_payload = UNSET else: @@ -105,6 +110,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["should_tweet"] = should_tweet if status_page_template is not UNSET: field_dict["status_page_template"] = status_page_template + if status_page_ids is not UNSET: + field_dict["status_page_ids"] = status_page_ids if integration_payload is not UNSET: field_dict["integration_payload"] = integration_payload @@ -127,7 +134,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: status_page_id = d.pop("status_page_id") _task_type = d.pop("task_type", UNSET) - task_type: PublishIncidentTaskParamsTaskType | Unset + task_type: Union[Unset, PublishIncidentTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: @@ -140,18 +147,20 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: should_tweet = d.pop("should_tweet", UNSET) _status_page_template = d.pop("status_page_template", UNSET) - status_page_template: PublishIncidentTaskParamsStatusPageTemplate | Unset + status_page_template: Union[Unset, PublishIncidentTaskParamsStatusPageTemplate] if isinstance(_status_page_template, Unset): status_page_template = UNSET else: status_page_template = PublishIncidentTaskParamsStatusPageTemplate.from_dict(_status_page_template) - def _parse_integration_payload(data: object) -> None | str | Unset: + status_page_ids = cast(list[str], d.pop("status_page_ids", UNSET)) + + def _parse_integration_payload(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) integration_payload = _parse_integration_payload(d.pop("integration_payload", UNSET)) @@ -165,6 +174,7 @@ def _parse_integration_payload(data: object) -> None | str | Unset: notify_subscribers=notify_subscribers, should_tweet=should_tweet, status_page_template=status_page_template, + status_page_ids=status_page_ids, integration_payload=integration_payload, ) diff --git a/rootly_sdk/models/publish_incident_task_params_incident.py b/rootly_sdk/models/publish_incident_task_params_incident.py index 2b20e7ca..7ce4ad55 100644 --- a/rootly_sdk/models/publish_incident_task_params_incident.py +++ b/rootly_sdk/models/publish_incident_task_params_incident.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class PublishIncidentTaskParamsIncident: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/publish_incident_task_params_status_page_template.py b/rootly_sdk/models/publish_incident_task_params_status_page_template.py index 05bd965f..734a2e7f 100644 --- a/rootly_sdk/models/publish_incident_task_params_status_page_template.py +++ b/rootly_sdk/models/publish_incident_task_params_status_page_template.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class PublishIncidentTaskParamsStatusPageTemplate: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/pulse.py b/rootly_sdk/models/pulse.py index d5f9b38b..0755c3dd 100644 --- a/rootly_sdk/models/pulse.py +++ b/rootly_sdk/models/pulse.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -26,25 +24,25 @@ class Pulse: summary (str): The summary of the pulse created_at (str): Date of creation updated_at (str): Date of last update - source (None | str | Unset): The source of the pulse (eg: k8s) - services (list[Service] | Unset): Services attached to the pulse - environments (list[Environment] | Unset): Environments attached to the pulse - external_url (None | str | Unset): The external url of the pulse - labels (list[None | PulseLabelsItemType0] | Unset): - refs (list[None | PulseRefsItemType0] | Unset): - data (None | PulseDataType0 | Unset): Additional data + source (Union[None, Unset, str]): The source of the pulse (eg: k8s) + services (Union[Unset, list['Service']]): Services attached to the pulse + environments (Union[Unset, list['Environment']]): Environments attached to the pulse + external_url (Union[None, Unset, str]): The external url of the pulse + labels (Union[Unset, list[Union['PulseLabelsItemType0', None]]]): + refs (Union[Unset, list[Union['PulseRefsItemType0', None]]]): + data (Union['PulseDataType0', None, Unset]): Additional data """ summary: str created_at: str updated_at: str - source: None | str | Unset = UNSET - services: list[Service] | Unset = UNSET - environments: list[Environment] | Unset = UNSET - external_url: None | str | Unset = UNSET - labels: list[None | PulseLabelsItemType0] | Unset = UNSET - refs: list[None | PulseRefsItemType0] | Unset = UNSET - data: None | PulseDataType0 | Unset = UNSET + source: Union[None, Unset, str] = UNSET + services: Union[Unset, list["Service"]] = UNSET + environments: Union[Unset, list["Environment"]] = UNSET + external_url: Union[None, Unset, str] = UNSET + labels: Union[Unset, list[Union["PulseLabelsItemType0", None]]] = UNSET + refs: Union[Unset, list[Union["PulseRefsItemType0", None]]] = UNSET + data: Union["PulseDataType0", None, Unset] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -58,55 +56,55 @@ def to_dict(self) -> dict[str, Any]: updated_at = self.updated_at - source: None | str | Unset + source: Union[None, Unset, str] if isinstance(self.source, Unset): source = UNSET else: source = self.source - services: list[dict[str, Any]] | Unset = UNSET + services: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.services, Unset): services = [] for services_item_data in self.services: services_item = services_item_data.to_dict() services.append(services_item) - environments: list[dict[str, Any]] | Unset = UNSET + environments: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.environments, Unset): environments = [] for environments_item_data in self.environments: environments_item = environments_item_data.to_dict() environments.append(environments_item) - external_url: None | str | Unset + external_url: Union[None, Unset, str] if isinstance(self.external_url, Unset): external_url = UNSET else: external_url = self.external_url - labels: list[dict[str, Any] | None] | Unset = UNSET + labels: Union[Unset, list[Union[None, dict[str, Any]]]] = UNSET if not isinstance(self.labels, Unset): labels = [] for labels_item_data in self.labels: - labels_item: dict[str, Any] | None + labels_item: Union[None, dict[str, Any]] if isinstance(labels_item_data, PulseLabelsItemType0): labels_item = labels_item_data.to_dict() else: labels_item = labels_item_data labels.append(labels_item) - refs: list[dict[str, Any] | None] | Unset = UNSET + refs: Union[Unset, list[Union[None, dict[str, Any]]]] = UNSET if not isinstance(self.refs, Unset): refs = [] for refs_item_data in self.refs: - refs_item: dict[str, Any] | None + refs_item: Union[None, dict[str, Any]] if isinstance(refs_item_data, PulseRefsItemType0): refs_item = refs_item_data.to_dict() else: refs_item = refs_item_data refs.append(refs_item) - data: dict[str, Any] | None | Unset + data: Union[None, Unset, dict[str, Any]] if isinstance(self.data, Unset): data = UNSET elif isinstance(self.data, PulseDataType0): @@ -155,89 +153,81 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: updated_at = d.pop("updated_at") - def _parse_source(data: object) -> None | str | Unset: + def _parse_source(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) source = _parse_source(d.pop("source", UNSET)) + services = [] _services = d.pop("services", UNSET) - services: list[Service] | Unset = UNSET - if _services is not UNSET: - services = [] - for services_item_data in _services: - services_item = Service.from_dict(services_item_data) + for services_item_data in _services or []: + services_item = Service.from_dict(services_item_data) - services.append(services_item) + services.append(services_item) + environments = [] _environments = d.pop("environments", UNSET) - environments: list[Environment] | Unset = UNSET - if _environments is not UNSET: - environments = [] - for environments_item_data in _environments: - environments_item = Environment.from_dict(environments_item_data) + for environments_item_data in _environments or []: + environments_item = Environment.from_dict(environments_item_data) - environments.append(environments_item) + environments.append(environments_item) - def _parse_external_url(data: object) -> None | str | Unset: + def _parse_external_url(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) external_url = _parse_external_url(d.pop("external_url", UNSET)) + labels = [] _labels = d.pop("labels", UNSET) - labels: list[None | PulseLabelsItemType0] | Unset = UNSET - if _labels is not UNSET: - labels = [] - for labels_item_data in _labels: + for labels_item_data in _labels or []: - def _parse_labels_item(data: object) -> None | PulseLabelsItemType0: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - labels_item_type_0 = PulseLabelsItemType0.from_dict(data) + def _parse_labels_item(data: object) -> Union["PulseLabelsItemType0", None]: + if data is None: + return data + try: + if not isinstance(data, dict): + raise TypeError() + labels_item_type_0 = PulseLabelsItemType0.from_dict(data) - return labels_item_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | PulseLabelsItemType0, data) + return labels_item_type_0 + except: # noqa: E722 + pass + return cast(Union["PulseLabelsItemType0", None], data) - labels_item = _parse_labels_item(labels_item_data) + labels_item = _parse_labels_item(labels_item_data) - labels.append(labels_item) + labels.append(labels_item) + refs = [] _refs = d.pop("refs", UNSET) - refs: list[None | PulseRefsItemType0] | Unset = UNSET - if _refs is not UNSET: - refs = [] - for refs_item_data in _refs: + for refs_item_data in _refs or []: - def _parse_refs_item(data: object) -> None | PulseRefsItemType0: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - refs_item_type_0 = PulseRefsItemType0.from_dict(data) + def _parse_refs_item(data: object) -> Union["PulseRefsItemType0", None]: + if data is None: + return data + try: + if not isinstance(data, dict): + raise TypeError() + refs_item_type_0 = PulseRefsItemType0.from_dict(data) - return refs_item_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | PulseRefsItemType0, data) + return refs_item_type_0 + except: # noqa: E722 + pass + return cast(Union["PulseRefsItemType0", None], data) - refs_item = _parse_refs_item(refs_item_data) + refs_item = _parse_refs_item(refs_item_data) - refs.append(refs_item) + refs.append(refs_item) - def _parse_data(data: object) -> None | PulseDataType0 | Unset: + def _parse_data(data: object) -> Union["PulseDataType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -248,9 +238,9 @@ def _parse_data(data: object) -> None | PulseDataType0 | Unset: data_type_0 = PulseDataType0.from_dict(data) return data_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(None | PulseDataType0 | Unset, data) + return cast(Union["PulseDataType0", None, Unset], data) data = _parse_data(d.pop("data", UNSET)) diff --git a/rootly_sdk/models/pulse_data_type_0.py b/rootly_sdk/models/pulse_data_type_0.py index afcb2bbc..341057a8 100644 --- a/rootly_sdk/models/pulse_data_type_0.py +++ b/rootly_sdk/models/pulse_data_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,7 +14,6 @@ class PulseDataType0: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) diff --git a/rootly_sdk/models/pulse_labels_item_type_0.py b/rootly_sdk/models/pulse_labels_item_type_0.py index ff7e4e81..6636720d 100644 --- a/rootly_sdk/models/pulse_labels_item_type_0.py +++ b/rootly_sdk/models/pulse_labels_item_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/pulse_list.py b/rootly_sdk/models/pulse_list.py index 39a986bc..b6cdfb55 100644 --- a/rootly_sdk/models/pulse_list.py +++ b/rootly_sdk/models/pulse_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,20 +20,19 @@ class PulseList: """ Attributes: - data (list[PulseListDataItem]): + data (list['PulseListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[PulseListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["PulseListDataItem"] + links: "Links" + meta: "Meta" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) pulse_list = cls( data=data, diff --git a/rootly_sdk/models/pulse_list_data_item.py b/rootly_sdk/models/pulse_list_data_item.py index 2b770f8e..50c07fba 100644 --- a/rootly_sdk/models/pulse_list_data_item.py +++ b/rootly_sdk/models/pulse_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class PulseListDataItem: id: str type_: PulseListDataItemType - attributes: Pulse + attributes: "Pulse" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/pulse_refs_item_type_0.py b/rootly_sdk/models/pulse_refs_item_type_0.py index c65c8b53..7a101f7f 100644 --- a/rootly_sdk/models/pulse_refs_item_type_0.py +++ b/rootly_sdk/models/pulse_refs_item_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/pulse_response.py b/rootly_sdk/models/pulse_response.py index 6268b8b5..175dc3d1 100644 --- a/rootly_sdk/models/pulse_response.py +++ b/rootly_sdk/models/pulse_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,18 +19,17 @@ class PulseResponse: """ Attributes: data (PulseResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: PulseResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "PulseResponseData" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = PulseResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) pulse_response = cls( data=data, diff --git a/rootly_sdk/models/pulse_response_data.py b/rootly_sdk/models/pulse_response_data.py index 6efc7c8f..7b7d58cc 100644 --- a/rootly_sdk/models/pulse_response_data.py +++ b/rootly_sdk/models/pulse_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class PulseResponseData: id: str type_: PulseResponseDataType - attributes: Pulse + attributes: "Pulse" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/pulse_trigger_params.py b/rootly_sdk/models/pulse_trigger_params.py index 138e75d9..9d2eee3f 100644 --- a/rootly_sdk/models/pulse_trigger_params.py +++ b/rootly_sdk/models/pulse_trigger_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -40,80 +38,80 @@ class PulseTriggerParams: """ Attributes: trigger_type (PulseTriggerParamsTriggerType): - triggers (list[PulseTriggerParamsTriggersItem] | Unset): - pulse_condition (PulseTriggerParamsPulseCondition | Unset): - pulse_condition_source (PulseTriggerParamsPulseConditionSource | Unset): Default: 'ANY'. - pulse_condition_source_use_regexp (bool | Unset): Default: False. - pulse_sources (list[str] | Unset): - pulse_condition_label (PulseTriggerParamsPulseConditionLabel | Unset): Default: 'ANY'. - pulse_condition_label_use_regexp (bool | Unset): Default: False. - pulse_labels (list[str] | Unset): - pulse_condition_payload (PulseTriggerParamsPulseConditionPayload | Unset): Default: 'ANY'. - pulse_condition_payload_use_regexp (bool | Unset): Default: False. - pulse_payload (list[str] | Unset): - pulse_query_payload (None | str | Unset): You can use jsonpath syntax. eg: $.incident.teams[*] + triggers (Union[Unset, list[PulseTriggerParamsTriggersItem]]): + pulse_condition (Union[Unset, PulseTriggerParamsPulseCondition]): + pulse_condition_source (Union[Unset, PulseTriggerParamsPulseConditionSource]): Default: 'ANY'. + pulse_condition_source_use_regexp (Union[Unset, bool]): Default: False. + pulse_sources (Union[Unset, list[str]]): + pulse_condition_label (Union[Unset, PulseTriggerParamsPulseConditionLabel]): Default: 'ANY'. + pulse_condition_label_use_regexp (Union[Unset, bool]): Default: False. + pulse_labels (Union[Unset, list[str]]): + pulse_condition_payload (Union[Unset, PulseTriggerParamsPulseConditionPayload]): Default: 'ANY'. + pulse_condition_payload_use_regexp (Union[Unset, bool]): Default: False. + pulse_payload (Union[Unset, list[str]]): + pulse_query_payload (Union[None, Unset, str]): You can use jsonpath syntax. eg: $.incident.teams[*] """ trigger_type: PulseTriggerParamsTriggerType - triggers: list[PulseTriggerParamsTriggersItem] | Unset = UNSET - pulse_condition: PulseTriggerParamsPulseCondition | Unset = UNSET - pulse_condition_source: PulseTriggerParamsPulseConditionSource | Unset = "ANY" - pulse_condition_source_use_regexp: bool | Unset = False - pulse_sources: list[str] | Unset = UNSET - pulse_condition_label: PulseTriggerParamsPulseConditionLabel | Unset = "ANY" - pulse_condition_label_use_regexp: bool | Unset = False - pulse_labels: list[str] | Unset = UNSET - pulse_condition_payload: PulseTriggerParamsPulseConditionPayload | Unset = "ANY" - pulse_condition_payload_use_regexp: bool | Unset = False - pulse_payload: list[str] | Unset = UNSET - pulse_query_payload: None | str | Unset = UNSET + triggers: Union[Unset, list[PulseTriggerParamsTriggersItem]] = UNSET + pulse_condition: Union[Unset, PulseTriggerParamsPulseCondition] = UNSET + pulse_condition_source: Union[Unset, PulseTriggerParamsPulseConditionSource] = "ANY" + pulse_condition_source_use_regexp: Union[Unset, bool] = False + pulse_sources: Union[Unset, list[str]] = UNSET + pulse_condition_label: Union[Unset, PulseTriggerParamsPulseConditionLabel] = "ANY" + pulse_condition_label_use_regexp: Union[Unset, bool] = False + pulse_labels: Union[Unset, list[str]] = UNSET + pulse_condition_payload: Union[Unset, PulseTriggerParamsPulseConditionPayload] = "ANY" + pulse_condition_payload_use_regexp: Union[Unset, bool] = False + pulse_payload: Union[Unset, list[str]] = UNSET + pulse_query_payload: Union[None, Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: trigger_type: str = self.trigger_type - triggers: list[str] | Unset = UNSET + triggers: Union[Unset, list[str]] = UNSET if not isinstance(self.triggers, Unset): triggers = [] for triggers_item_data in self.triggers: triggers_item: str = triggers_item_data triggers.append(triggers_item) - pulse_condition: str | Unset = UNSET + pulse_condition: Union[Unset, str] = UNSET if not isinstance(self.pulse_condition, Unset): pulse_condition = self.pulse_condition - pulse_condition_source: str | Unset = UNSET + pulse_condition_source: Union[Unset, str] = UNSET if not isinstance(self.pulse_condition_source, Unset): pulse_condition_source = self.pulse_condition_source pulse_condition_source_use_regexp = self.pulse_condition_source_use_regexp - pulse_sources: list[str] | Unset = UNSET + pulse_sources: Union[Unset, list[str]] = UNSET if not isinstance(self.pulse_sources, Unset): pulse_sources = self.pulse_sources - pulse_condition_label: str | Unset = UNSET + pulse_condition_label: Union[Unset, str] = UNSET if not isinstance(self.pulse_condition_label, Unset): pulse_condition_label = self.pulse_condition_label pulse_condition_label_use_regexp = self.pulse_condition_label_use_regexp - pulse_labels: list[str] | Unset = UNSET + pulse_labels: Union[Unset, list[str]] = UNSET if not isinstance(self.pulse_labels, Unset): pulse_labels = self.pulse_labels - pulse_condition_payload: str | Unset = UNSET + pulse_condition_payload: Union[Unset, str] = UNSET if not isinstance(self.pulse_condition_payload, Unset): pulse_condition_payload = self.pulse_condition_payload pulse_condition_payload_use_regexp = self.pulse_condition_payload_use_regexp - pulse_payload: list[str] | Unset = UNSET + pulse_payload: Union[Unset, list[str]] = UNSET if not isinstance(self.pulse_payload, Unset): pulse_payload = self.pulse_payload - pulse_query_payload: None | str | Unset + pulse_query_payload: Union[None, Unset, str] if isinstance(self.pulse_query_payload, Unset): pulse_query_payload = UNSET else: @@ -158,24 +156,22 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) trigger_type = check_pulse_trigger_params_trigger_type(d.pop("trigger_type")) + triggers = [] _triggers = d.pop("triggers", UNSET) - triggers: list[PulseTriggerParamsTriggersItem] | Unset = UNSET - if _triggers is not UNSET: - triggers = [] - for triggers_item_data in _triggers: - triggers_item = check_pulse_trigger_params_triggers_item(triggers_item_data) + for triggers_item_data in _triggers or []: + triggers_item = check_pulse_trigger_params_triggers_item(triggers_item_data) - triggers.append(triggers_item) + triggers.append(triggers_item) _pulse_condition = d.pop("pulse_condition", UNSET) - pulse_condition: PulseTriggerParamsPulseCondition | Unset + pulse_condition: Union[Unset, PulseTriggerParamsPulseCondition] if isinstance(_pulse_condition, Unset): pulse_condition = UNSET else: pulse_condition = check_pulse_trigger_params_pulse_condition(_pulse_condition) _pulse_condition_source = d.pop("pulse_condition_source", UNSET) - pulse_condition_source: PulseTriggerParamsPulseConditionSource | Unset + pulse_condition_source: Union[Unset, PulseTriggerParamsPulseConditionSource] if isinstance(_pulse_condition_source, Unset): pulse_condition_source = UNSET else: @@ -186,7 +182,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: pulse_sources = cast(list[str], d.pop("pulse_sources", UNSET)) _pulse_condition_label = d.pop("pulse_condition_label", UNSET) - pulse_condition_label: PulseTriggerParamsPulseConditionLabel | Unset + pulse_condition_label: Union[Unset, PulseTriggerParamsPulseConditionLabel] if isinstance(_pulse_condition_label, Unset): pulse_condition_label = UNSET else: @@ -197,7 +193,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: pulse_labels = cast(list[str], d.pop("pulse_labels", UNSET)) _pulse_condition_payload = d.pop("pulse_condition_payload", UNSET) - pulse_condition_payload: PulseTriggerParamsPulseConditionPayload | Unset + pulse_condition_payload: Union[Unset, PulseTriggerParamsPulseConditionPayload] if isinstance(_pulse_condition_payload, Unset): pulse_condition_payload = UNSET else: @@ -207,12 +203,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: pulse_payload = cast(list[str], d.pop("pulse_payload", UNSET)) - def _parse_pulse_query_payload(data: object) -> None | str | Unset: + def _parse_pulse_query_payload(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) pulse_query_payload = _parse_pulse_query_payload(d.pop("pulse_query_payload", UNSET)) diff --git a/rootly_sdk/models/receipt.py b/rootly_sdk/models/receipt.py index 1e6442b7..7c947c92 100644 --- a/rootly_sdk/models/receipt.py +++ b/rootly_sdk/models/receipt.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -18,21 +16,21 @@ class Receipt: """ Attributes: state (ReceiptState): Delivery state of the receipt. - reason (ReceiptReason | Unset): Reason a receipt failed. Present when state is failed. - resource_type (str | Unset): Type of the referenced resource (present when set). - resource_id (str | Unset): ID of the referenced resource (present when set). + reason (Union[Unset, ReceiptReason]): Reason a receipt failed. Present when state is failed. + resource_type (Union[Unset, str]): Type of the referenced resource (present when set). + resource_id (Union[Unset, str]): ID of the referenced resource (present when set). """ state: ReceiptState - reason: ReceiptReason | Unset = UNSET - resource_type: str | Unset = UNSET - resource_id: str | Unset = UNSET + reason: Union[Unset, ReceiptReason] = UNSET + resource_type: Union[Unset, str] = UNSET + resource_id: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: state: str = self.state - reason: str | Unset = UNSET + reason: Union[Unset, str] = UNSET if not isinstance(self.reason, Unset): reason = self.reason @@ -62,7 +60,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: state = check_receipt_state(d.pop("state")) _reason = d.pop("reason", UNSET) - reason: ReceiptReason | Unset + reason: Union[Unset, ReceiptReason] if isinstance(_reason, Unset): reason = UNSET else: diff --git a/rootly_sdk/models/redis_client_task_params.py b/rootly_sdk/models/redis_client_task_params.py index 4d4b9aab..735dcd1c 100644 --- a/rootly_sdk/models/redis_client_task_params.py +++ b/rootly_sdk/models/redis_client_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -27,29 +25,28 @@ class RedisClientTaskParams: Attributes: url (str): Example: redis://redis-12345.c1.us-east-1-2.ec2.cloud.redislabs.com:12345. commands (str): - task_type (RedisClientTaskParamsTaskType | Unset): - event_url (str | Unset): - event_message (str | Unset): - post_to_incident_timeline (bool | Unset): - post_to_slack_channels (list[RedisClientTaskParamsPostToSlackChannelsItem] | Unset): + task_type (Union[Unset, RedisClientTaskParamsTaskType]): + event_url (Union[Unset, str]): + event_message (Union[Unset, str]): + post_to_incident_timeline (Union[Unset, bool]): + post_to_slack_channels (Union[Unset, list['RedisClientTaskParamsPostToSlackChannelsItem']]): """ url: str commands: str - task_type: RedisClientTaskParamsTaskType | Unset = UNSET - event_url: str | Unset = UNSET - event_message: str | Unset = UNSET - post_to_incident_timeline: bool | Unset = UNSET - post_to_slack_channels: list[RedisClientTaskParamsPostToSlackChannelsItem] | Unset = UNSET + task_type: Union[Unset, RedisClientTaskParamsTaskType] = UNSET + event_url: Union[Unset, str] = UNSET + event_message: Union[Unset, str] = UNSET + post_to_incident_timeline: Union[Unset, bool] = UNSET + post_to_slack_channels: Union[Unset, list["RedisClientTaskParamsPostToSlackChannelsItem"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - url = self.url commands = self.commands - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -59,7 +56,7 @@ def to_dict(self) -> dict[str, Any]: post_to_incident_timeline = self.post_to_incident_timeline - post_to_slack_channels: list[dict[str, Any]] | Unset = UNSET + post_to_slack_channels: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.post_to_slack_channels, Unset): post_to_slack_channels = [] for post_to_slack_channels_item_data in self.post_to_slack_channels: @@ -99,7 +96,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: commands = d.pop("commands") _task_type = d.pop("task_type", UNSET) - task_type: RedisClientTaskParamsTaskType | Unset + task_type: Union[Unset, RedisClientTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: @@ -111,16 +108,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: post_to_incident_timeline = d.pop("post_to_incident_timeline", UNSET) + post_to_slack_channels = [] _post_to_slack_channels = d.pop("post_to_slack_channels", UNSET) - post_to_slack_channels: list[RedisClientTaskParamsPostToSlackChannelsItem] | Unset = UNSET - if _post_to_slack_channels is not UNSET: - post_to_slack_channels = [] - for post_to_slack_channels_item_data in _post_to_slack_channels: - post_to_slack_channels_item = RedisClientTaskParamsPostToSlackChannelsItem.from_dict( - post_to_slack_channels_item_data - ) + for post_to_slack_channels_item_data in _post_to_slack_channels or []: + post_to_slack_channels_item = RedisClientTaskParamsPostToSlackChannelsItem.from_dict( + post_to_slack_channels_item_data + ) - post_to_slack_channels.append(post_to_slack_channels_item) + post_to_slack_channels.append(post_to_slack_channels_item) redis_client_task_params = cls( url=url, diff --git a/rootly_sdk/models/redis_client_task_params_post_to_slack_channels_item.py b/rootly_sdk/models/redis_client_task_params_post_to_slack_channels_item.py index f9bb82cb..653b0d57 100644 --- a/rootly_sdk/models/redis_client_task_params_post_to_slack_channels_item.py +++ b/rootly_sdk/models/redis_client_task_params_post_to_slack_channels_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class RedisClientTaskParamsPostToSlackChannelsItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/remove_google_docs_permissions_task_params.py b/rootly_sdk/models/remove_google_docs_permissions_task_params.py index 4caa857f..24cec19a 100644 --- a/rootly_sdk/models/remove_google_docs_permissions_task_params.py +++ b/rootly_sdk/models/remove_google_docs_permissions_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -26,13 +24,13 @@ class RemoveGoogleDocsPermissionsTaskParams: file_id (str): The Google Doc file ID attribute_to_query_by (RemoveGoogleDocsPermissionsTaskParamsAttributeToQueryBy): Default: 'email_address'. value (str): - task_type (RemoveGoogleDocsPermissionsTaskParamsTaskType | Unset): + task_type (Union[Unset, RemoveGoogleDocsPermissionsTaskParamsTaskType]): """ file_id: str value: str attribute_to_query_by: RemoveGoogleDocsPermissionsTaskParamsAttributeToQueryBy = "email_address" - task_type: RemoveGoogleDocsPermissionsTaskParamsTaskType | Unset = UNSET + task_type: Union[Unset, RemoveGoogleDocsPermissionsTaskParamsTaskType] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +40,7 @@ def to_dict(self) -> dict[str, Any]: value = self.value - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -72,7 +70,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: value = d.pop("value") _task_type = d.pop("task_type", UNSET) - task_type: RemoveGoogleDocsPermissionsTaskParamsTaskType | Unset + task_type: Union[Unset, RemoveGoogleDocsPermissionsTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/remove_subscribers.py b/rootly_sdk/models/remove_subscribers.py index 84417031..39d25586 100644 --- a/rootly_sdk/models/remove_subscribers.py +++ b/rootly_sdk/models/remove_subscribers.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class RemoveSubscribers: data (RemoveSubscribersData): """ - data: RemoveSubscribersData + data: "RemoveSubscribersData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/remove_subscribers_data.py b/rootly_sdk/models/remove_subscribers_data.py index 0b101a4c..5f04e403 100644 --- a/rootly_sdk/models/remove_subscribers_data.py +++ b/rootly_sdk/models/remove_subscribers_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class RemoveSubscribersData: """ type_: RemoveSubscribersDataType - attributes: RemoveSubscribersDataAttributes + attributes: "RemoveSubscribersDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/remove_subscribers_data_attributes.py b/rootly_sdk/models/remove_subscribers_data_attributes.py index a2b72357..40408536 100644 --- a/rootly_sdk/models/remove_subscribers_data_attributes.py +++ b/rootly_sdk/models/remove_subscribers_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -14,17 +12,17 @@ class RemoveSubscribersDataAttributes: """ Attributes: - user_ids (list[str] | None | Unset): IDs of users you wish to remove from the list of subscribers for this + user_ids (Union[None, Unset, list[str]]): IDs of users you wish to remove from the list of subscribers for this incident - remove_users_with_no_private_incident_access (bool | None | Unset): Users without read permissions for private - incidents will be removed from the subscriber list of this incident Default: False. + remove_users_with_no_private_incident_access (Union[None, Unset, bool]): Users without read permissions for + private incidents will be removed from the subscriber list of this incident Default: False. """ - user_ids: list[str] | None | Unset = UNSET - remove_users_with_no_private_incident_access: bool | None | Unset = False + user_ids: Union[None, Unset, list[str]] = UNSET + remove_users_with_no_private_incident_access: Union[None, Unset, bool] = False def to_dict(self) -> dict[str, Any]: - user_ids: list[str] | None | Unset + user_ids: Union[None, Unset, list[str]] if isinstance(self.user_ids, Unset): user_ids = UNSET elif isinstance(self.user_ids, list): @@ -33,7 +31,7 @@ def to_dict(self) -> dict[str, Any]: else: user_ids = self.user_ids - remove_users_with_no_private_incident_access: bool | None | Unset + remove_users_with_no_private_incident_access: Union[None, Unset, bool] if isinstance(self.remove_users_with_no_private_incident_access, Unset): remove_users_with_no_private_incident_access = UNSET else: @@ -53,7 +51,7 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_user_ids(data: object) -> list[str] | None | Unset: + def _parse_user_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -64,18 +62,18 @@ def _parse_user_ids(data: object) -> list[str] | None | Unset: user_ids_type_0 = cast(list[str], data) return user_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) user_ids = _parse_user_ids(d.pop("user_ids", UNSET)) - def _parse_remove_users_with_no_private_incident_access(data: object) -> bool | None | Unset: + def _parse_remove_users_with_no_private_incident_access(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) remove_users_with_no_private_incident_access = _parse_remove_users_with_no_private_incident_access( d.pop("remove_users_with_no_private_incident_access", UNSET) diff --git a/rootly_sdk/models/rename_google_chat_space_task_params.py b/rootly_sdk/models/rename_google_chat_space_task_params.py index d1b918ec..c2925c80 100644 --- a/rootly_sdk/models/rename_google_chat_space_task_params.py +++ b/rootly_sdk/models/rename_google_chat_space_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -25,21 +23,20 @@ class RenameGoogleChatSpaceTaskParams: Attributes: space (RenameGoogleChatSpaceTaskParamsSpace): title (str): - task_type (RenameGoogleChatSpaceTaskParamsTaskType | Unset): + task_type (Union[Unset, RenameGoogleChatSpaceTaskParamsTaskType]): """ - space: RenameGoogleChatSpaceTaskParamsSpace + space: "RenameGoogleChatSpaceTaskParamsSpace" title: str - task_type: RenameGoogleChatSpaceTaskParamsTaskType | Unset = UNSET + task_type: Union[Unset, RenameGoogleChatSpaceTaskParamsTaskType] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - space = self.space.to_dict() title = self.title - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -66,7 +63,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: title = d.pop("title") _task_type = d.pop("task_type", UNSET) - task_type: RenameGoogleChatSpaceTaskParamsTaskType | Unset + task_type: Union[Unset, RenameGoogleChatSpaceTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/rename_google_chat_space_task_params_space.py b/rootly_sdk/models/rename_google_chat_space_task_params_space.py index 5b28cfb2..64d818a9 100644 --- a/rootly_sdk/models/rename_google_chat_space_task_params_space.py +++ b/rootly_sdk/models/rename_google_chat_space_task_params_space.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class RenameGoogleChatSpaceTaskParamsSpace: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/rename_microsoft_teams_channel_task_params.py b/rootly_sdk/models/rename_microsoft_teams_channel_task_params.py index c11439a6..69d52b46 100644 --- a/rootly_sdk/models/rename_microsoft_teams_channel_task_params.py +++ b/rootly_sdk/models/rename_microsoft_teams_channel_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -27,24 +25,23 @@ class RenameMicrosoftTeamsChannelTaskParams: team (RenameMicrosoftTeamsChannelTaskParamsTeam): channel (RenameMicrosoftTeamsChannelTaskParamsChannel): title (str): - task_type (RenameMicrosoftTeamsChannelTaskParamsTaskType | Unset): + task_type (Union[Unset, RenameMicrosoftTeamsChannelTaskParamsTaskType]): """ - team: RenameMicrosoftTeamsChannelTaskParamsTeam - channel: RenameMicrosoftTeamsChannelTaskParamsChannel + team: "RenameMicrosoftTeamsChannelTaskParamsTeam" + channel: "RenameMicrosoftTeamsChannelTaskParamsChannel" title: str - task_type: RenameMicrosoftTeamsChannelTaskParamsTaskType | Unset = UNSET + task_type: Union[Unset, RenameMicrosoftTeamsChannelTaskParamsTaskType] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - team = self.team.to_dict() channel = self.channel.to_dict() title = self.title - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -77,7 +74,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: title = d.pop("title") _task_type = d.pop("task_type", UNSET) - task_type: RenameMicrosoftTeamsChannelTaskParamsTaskType | Unset + task_type: Union[Unset, RenameMicrosoftTeamsChannelTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/rename_microsoft_teams_channel_task_params_channel.py b/rootly_sdk/models/rename_microsoft_teams_channel_task_params_channel.py index adc80c16..47416216 100644 --- a/rootly_sdk/models/rename_microsoft_teams_channel_task_params_channel.py +++ b/rootly_sdk/models/rename_microsoft_teams_channel_task_params_channel.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class RenameMicrosoftTeamsChannelTaskParamsChannel: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/rename_microsoft_teams_channel_task_params_team.py b/rootly_sdk/models/rename_microsoft_teams_channel_task_params_team.py index 45eda40c..fa57019d 100644 --- a/rootly_sdk/models/rename_microsoft_teams_channel_task_params_team.py +++ b/rootly_sdk/models/rename_microsoft_teams_channel_task_params_team.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class RenameMicrosoftTeamsChannelTaskParamsTeam: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/rename_slack_channel_task_params.py b/rootly_sdk/models/rename_slack_channel_task_params.py index 1f7b3787..453acd53 100644 --- a/rootly_sdk/models/rename_slack_channel_task_params.py +++ b/rootly_sdk/models/rename_slack_channel_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -25,21 +23,20 @@ class RenameSlackChannelTaskParams: Attributes: channel (RenameSlackChannelTaskParamsChannel): title (str): - task_type (RenameSlackChannelTaskParamsTaskType | Unset): + task_type (Union[Unset, RenameSlackChannelTaskParamsTaskType]): """ - channel: RenameSlackChannelTaskParamsChannel + channel: "RenameSlackChannelTaskParamsChannel" title: str - task_type: RenameSlackChannelTaskParamsTaskType | Unset = UNSET + task_type: Union[Unset, RenameSlackChannelTaskParamsTaskType] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - channel = self.channel.to_dict() title = self.title - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -66,7 +63,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: title = d.pop("title") _task_type = d.pop("task_type", UNSET) - task_type: RenameSlackChannelTaskParamsTaskType | Unset + task_type: Union[Unset, RenameSlackChannelTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/rename_slack_channel_task_params_channel.py b/rootly_sdk/models/rename_slack_channel_task_params_channel.py index e2cc7d5f..8588e3dd 100644 --- a/rootly_sdk/models/rename_slack_channel_task_params_channel.py +++ b/rootly_sdk/models/rename_slack_channel_task_params_channel.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class RenameSlackChannelTaskParamsChannel: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/resolve_alert.py b/rootly_sdk/models/resolve_alert.py index 5ceee88f..102c0d5a 100644 --- a/rootly_sdk/models/resolve_alert.py +++ b/rootly_sdk/models/resolve_alert.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,15 +17,14 @@ class ResolveAlert: """ Attributes: - data (ResolveAlertData | Unset): + data (Union[Unset, ResolveAlertData]): """ - data: ResolveAlertData | Unset = UNSET + data: Union[Unset, "ResolveAlertData"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - - data: dict[str, Any] | Unset = UNSET + data: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.data, Unset): data = self.data.to_dict() @@ -45,7 +42,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _data = d.pop("data", UNSET) - data: ResolveAlertData | Unset + data: Union[Unset, ResolveAlertData] if isinstance(_data, Unset): data = UNSET else: diff --git a/rootly_sdk/models/resolve_alert_data.py b/rootly_sdk/models/resolve_alert_data.py index 52f09fcf..acb87f35 100644 --- a/rootly_sdk/models/resolve_alert_data.py +++ b/rootly_sdk/models/resolve_alert_data.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -20,21 +18,20 @@ class ResolveAlertData: """ Attributes: - type_ (ResolveAlertDataType | Unset): - attributes (ResolveAlertDataAttributes | Unset): + type_ (Union[Unset, ResolveAlertDataType]): + attributes (Union[Unset, ResolveAlertDataAttributes]): """ - type_: ResolveAlertDataType | Unset = UNSET - attributes: ResolveAlertDataAttributes | Unset = UNSET + type_: Union[Unset, ResolveAlertDataType] = UNSET + attributes: Union[Unset, "ResolveAlertDataAttributes"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - - type_: str | Unset = UNSET + type_: Union[Unset, str] = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ - attributes: dict[str, Any] | Unset = UNSET + attributes: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.attributes, Unset): attributes = self.attributes.to_dict() @@ -54,14 +51,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _type_ = d.pop("type", UNSET) - type_: ResolveAlertDataType | Unset + type_: Union[Unset, ResolveAlertDataType] if isinstance(_type_, Unset): type_ = UNSET else: type_ = check_resolve_alert_data_type(_type_) _attributes = d.pop("attributes", UNSET) - attributes: ResolveAlertDataAttributes | Unset + attributes: Union[Unset, ResolveAlertDataAttributes] if isinstance(_attributes, Unset): attributes = UNSET else: diff --git a/rootly_sdk/models/resolve_alert_data_attributes.py b/rootly_sdk/models/resolve_alert_data_attributes.py index 145979dc..22a9497b 100644 --- a/rootly_sdk/models/resolve_alert_data_attributes.py +++ b/rootly_sdk/models/resolve_alert_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -14,21 +12,21 @@ class ResolveAlertDataAttributes: """ Attributes: - resolution_message (None | str | Unset): How was the alert resolved? - resolve_related_incidents (bool | None | Unset): Resolve all associated incidents + resolution_message (Union[None, Unset, str]): How was the alert resolved? + resolve_related_incidents (Union[None, Unset, bool]): Resolve all associated incidents """ - resolution_message: None | str | Unset = UNSET - resolve_related_incidents: bool | None | Unset = UNSET + resolution_message: Union[None, Unset, str] = UNSET + resolve_related_incidents: Union[None, Unset, bool] = UNSET def to_dict(self) -> dict[str, Any]: - resolution_message: None | str | Unset + resolution_message: Union[None, Unset, str] if isinstance(self.resolution_message, Unset): resolution_message = UNSET else: resolution_message = self.resolution_message - resolve_related_incidents: bool | None | Unset + resolve_related_incidents: Union[None, Unset, bool] if isinstance(self.resolve_related_incidents, Unset): resolve_related_incidents = UNSET else: @@ -48,21 +46,21 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_resolution_message(data: object) -> None | str | Unset: + def _parse_resolution_message(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) resolution_message = _parse_resolution_message(d.pop("resolution_message", UNSET)) - def _parse_resolve_related_incidents(data: object) -> bool | None | Unset: + def _parse_resolve_related_incidents(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) resolve_related_incidents = _parse_resolve_related_incidents(d.pop("resolve_related_incidents", UNSET)) diff --git a/rootly_sdk/models/resolve_incident.py b/rootly_sdk/models/resolve_incident.py index 3b7dca45..dd2a87be 100644 --- a/rootly_sdk/models/resolve_incident.py +++ b/rootly_sdk/models/resolve_incident.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class ResolveIncident: data (ResolveIncidentData): """ - data: ResolveIncidentData + data: "ResolveIncidentData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/resolve_incident_data.py b/rootly_sdk/models/resolve_incident_data.py index 2a3d672f..7f814f56 100644 --- a/rootly_sdk/models/resolve_incident_data.py +++ b/rootly_sdk/models/resolve_incident_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class ResolveIncidentData: """ type_: ResolveIncidentDataType - attributes: ResolveIncidentDataAttributes + attributes: "ResolveIncidentDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/resolve_incident_data_attributes.py b/rootly_sdk/models/resolve_incident_data_attributes.py index f692c9d9..5497d44c 100644 --- a/rootly_sdk/models/resolve_incident_data_attributes.py +++ b/rootly_sdk/models/resolve_incident_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -14,13 +12,13 @@ class ResolveIncidentDataAttributes: """ Attributes: - resolution_message (None | str | Unset): How was the incident resolved? + resolution_message (Union[None, Unset, str]): How was the incident resolved? """ - resolution_message: None | str | Unset = UNSET + resolution_message: Union[None, Unset, str] = UNSET def to_dict(self) -> dict[str, Any]: - resolution_message: None | str | Unset + resolution_message: Union[None, Unset, str] if isinstance(self.resolution_message, Unset): resolution_message = UNSET else: @@ -38,12 +36,12 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_resolution_message(data: object) -> None | str | Unset: + def _parse_resolution_message(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) resolution_message = _parse_resolution_message(d.pop("resolution_message", UNSET)) diff --git a/rootly_sdk/models/restart_incident.py b/rootly_sdk/models/restart_incident.py index 491f2a4a..6ad06f78 100644 --- a/rootly_sdk/models/restart_incident.py +++ b/rootly_sdk/models/restart_incident.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class RestartIncident: data (RestartIncidentData): """ - data: RestartIncidentData + data: "RestartIncidentData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/restart_incident_data.py b/rootly_sdk/models/restart_incident_data.py index 0be77f7c..2c5becde 100644 --- a/rootly_sdk/models/restart_incident_data.py +++ b/rootly_sdk/models/restart_incident_data.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,18 +19,17 @@ class RestartIncidentData: """ Attributes: type_ (RestartIncidentDataType): - attributes (RestartIncidentDataAttributes | Unset): + attributes (Union[Unset, RestartIncidentDataAttributes]): """ type_: RestartIncidentDataType - attributes: RestartIncidentDataAttributes | Unset = UNSET + attributes: Union[Unset, "RestartIncidentDataAttributes"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ - attributes: dict[str, Any] | Unset = UNSET + attributes: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.attributes, Unset): attributes = self.attributes.to_dict() @@ -56,7 +53,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: type_ = check_restart_incident_data_type(d.pop("type")) _attributes = d.pop("attributes", UNSET) - attributes: RestartIncidentDataAttributes | Unset + attributes: Union[Unset, RestartIncidentDataAttributes] if isinstance(_attributes, Unset): attributes = UNSET else: diff --git a/rootly_sdk/models/restart_incident_data_attributes.py b/rootly_sdk/models/restart_incident_data_attributes.py index 3d95b753..17cdc6f5 100644 --- a/rootly_sdk/models/restart_incident_data_attributes.py +++ b/rootly_sdk/models/restart_incident_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -13,7 +11,6 @@ class RestartIncidentDataAttributes: """ """ def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} return field_dict diff --git a/rootly_sdk/models/retrospective_configuration.py b/rootly_sdk/models/retrospective_configuration.py index f2ccd845..a1a1c02c 100644 --- a/rootly_sdk/models/retrospective_configuration.py +++ b/rootly_sdk/models/retrospective_configuration.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,28 +17,29 @@ class RetrospectiveConfiguration: """ Attributes: - kind (RetrospectiveConfigurationKind | Unset): The kind of the configuration. - severity_ids (list[str] | None | Unset): The Severity IDs to attach to the retrospective configuration - group_ids (list[str] | None | Unset): The Team IDs to attach to the retrospective configuration - incident_type_ids (list[str] | None | Unset): The Incident Type IDs to attach to the retrospective configuration - created_at (str | Unset): Date of creation - updated_at (str | Unset): Date of last update + kind (Union[Unset, RetrospectiveConfigurationKind]): The kind of the configuration. + severity_ids (Union[None, Unset, list[str]]): The Severity IDs to attach to the retrospective configuration + group_ids (Union[None, Unset, list[str]]): The Team IDs to attach to the retrospective configuration + incident_type_ids (Union[None, Unset, list[str]]): The Incident Type IDs to attach to the retrospective + configuration + created_at (Union[Unset, str]): Date of creation + updated_at (Union[Unset, str]): Date of last update """ - kind: RetrospectiveConfigurationKind | Unset = UNSET - severity_ids: list[str] | None | Unset = UNSET - group_ids: list[str] | None | Unset = UNSET - incident_type_ids: list[str] | None | Unset = UNSET - created_at: str | Unset = UNSET - updated_at: str | Unset = UNSET + kind: Union[Unset, RetrospectiveConfigurationKind] = UNSET + severity_ids: Union[None, Unset, list[str]] = UNSET + group_ids: Union[None, Unset, list[str]] = UNSET + incident_type_ids: Union[None, Unset, list[str]] = UNSET + created_at: Union[Unset, str] = UNSET + updated_at: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - kind: str | Unset = UNSET + kind: Union[Unset, str] = UNSET if not isinstance(self.kind, Unset): kind = self.kind - severity_ids: list[str] | None | Unset + severity_ids: Union[None, Unset, list[str]] if isinstance(self.severity_ids, Unset): severity_ids = UNSET elif isinstance(self.severity_ids, list): @@ -49,7 +48,7 @@ def to_dict(self) -> dict[str, Any]: else: severity_ids = self.severity_ids - group_ids: list[str] | None | Unset + group_ids: Union[None, Unset, list[str]] if isinstance(self.group_ids, Unset): group_ids = UNSET elif isinstance(self.group_ids, list): @@ -58,7 +57,7 @@ def to_dict(self) -> dict[str, Any]: else: group_ids = self.group_ids - incident_type_ids: list[str] | None | Unset + incident_type_ids: Union[None, Unset, list[str]] if isinstance(self.incident_type_ids, Unset): incident_type_ids = UNSET elif isinstance(self.incident_type_ids, list): @@ -93,13 +92,13 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _kind = d.pop("kind", UNSET) - kind: RetrospectiveConfigurationKind | Unset + kind: Union[Unset, RetrospectiveConfigurationKind] if isinstance(_kind, Unset): kind = UNSET else: kind = check_retrospective_configuration_kind(_kind) - def _parse_severity_ids(data: object) -> list[str] | None | Unset: + def _parse_severity_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -110,13 +109,13 @@ def _parse_severity_ids(data: object) -> list[str] | None | Unset: severity_ids_type_0 = cast(list[str], data) return severity_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) severity_ids = _parse_severity_ids(d.pop("severity_ids", UNSET)) - def _parse_group_ids(data: object) -> list[str] | None | Unset: + def _parse_group_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -127,13 +126,13 @@ def _parse_group_ids(data: object) -> list[str] | None | Unset: group_ids_type_0 = cast(list[str], data) return group_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) group_ids = _parse_group_ids(d.pop("group_ids", UNSET)) - def _parse_incident_type_ids(data: object) -> list[str] | None | Unset: + def _parse_incident_type_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -144,9 +143,9 @@ def _parse_incident_type_ids(data: object) -> list[str] | None | Unset: incident_type_ids_type_0 = cast(list[str], data) return incident_type_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) incident_type_ids = _parse_incident_type_ids(d.pop("incident_type_ids", UNSET)) diff --git a/rootly_sdk/models/retrospective_configuration_list.py b/rootly_sdk/models/retrospective_configuration_list.py index 729d9b07..2cb1305c 100644 --- a/rootly_sdk/models/retrospective_configuration_list.py +++ b/rootly_sdk/models/retrospective_configuration_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -20,22 +18,21 @@ class RetrospectiveConfigurationList: """ Attributes: - data (list[RetrospectiveConfigurationListDataItem]): - included (list[JsonapiIncludedResource] | Unset): + data (list['RetrospectiveConfigurationListDataItem']): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[RetrospectiveConfigurationListDataItem] - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["RetrospectiveConfigurationListDataItem"] + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() data.append(data_item) - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -67,14 +64,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data.append(data_item) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) retrospective_configuration_list = cls( data=data, diff --git a/rootly_sdk/models/retrospective_configuration_list_data_item.py b/rootly_sdk/models/retrospective_configuration_list_data_item.py index fc365e1b..c3f88c45 100644 --- a/rootly_sdk/models/retrospective_configuration_list_data_item.py +++ b/rootly_sdk/models/retrospective_configuration_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class RetrospectiveConfigurationListDataItem: id: str type_: RetrospectiveConfigurationListDataItemType - attributes: RetrospectiveConfiguration + attributes: "RetrospectiveConfiguration" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/retrospective_configuration_response.py b/rootly_sdk/models/retrospective_configuration_response.py index bd588e56..d6cb05cc 100644 --- a/rootly_sdk/models/retrospective_configuration_response.py +++ b/rootly_sdk/models/retrospective_configuration_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,18 +19,17 @@ class RetrospectiveConfigurationResponse: """ Attributes: data (RetrospectiveConfigurationResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: RetrospectiveConfigurationResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "RetrospectiveConfigurationResponseData" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = RetrospectiveConfigurationResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) retrospective_configuration_response = cls( data=data, diff --git a/rootly_sdk/models/retrospective_configuration_response_data.py b/rootly_sdk/models/retrospective_configuration_response_data.py index 0de247d5..fc3eeec0 100644 --- a/rootly_sdk/models/retrospective_configuration_response_data.py +++ b/rootly_sdk/models/retrospective_configuration_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class RetrospectiveConfigurationResponseData: id: str type_: RetrospectiveConfigurationResponseDataType - attributes: RetrospectiveConfiguration + attributes: "RetrospectiveConfiguration" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/retrospective_process.py b/rootly_sdk/models/retrospective_process.py index 05b0511d..7ff00a97 100644 --- a/rootly_sdk/models/retrospective_process.py +++ b/rootly_sdk/models/retrospective_process.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -27,29 +25,29 @@ class RetrospectiveProcess: """ Attributes: - name (str | Unset): The name of the retrospective process - description (None | str | Unset): The description of the retrospective process - is_default (bool | None | Unset): Indicates the default process that Rootly created. This will be used as a + name (Union[Unset, str]): The name of the retrospective process + description (Union[None, Unset, str]): The description of the retrospective process + is_default (Union[None, Unset, bool]): Indicates the default process that Rootly created. This will be used as a fallback if no processes match the incident's conditions. The default process cannot have conditions and cannot be changed. - created_at (str | Unset): Date of creation - updated_at (str | Unset): Date of last update - retrospective_process_matching_criteria (RetrospectiveProcessRetrospectiveProcessMatchingCriteriaType0 | - RetrospectiveProcessRetrospectiveProcessMatchingCriteriaType1 | - RetrospectiveProcessRetrospectiveProcessMatchingCriteriaType2 | Unset): + created_at (Union[Unset, str]): Date of creation + updated_at (Union[Unset, str]): Date of last update + retrospective_process_matching_criteria (Union['RetrospectiveProcessRetrospectiveProcessMatchingCriteriaType0', + 'RetrospectiveProcessRetrospectiveProcessMatchingCriteriaType1', + 'RetrospectiveProcessRetrospectiveProcessMatchingCriteriaType2', Unset]): """ - name: str | Unset = UNSET - description: None | str | Unset = UNSET - is_default: bool | None | Unset = UNSET - created_at: str | Unset = UNSET - updated_at: str | Unset = UNSET - retrospective_process_matching_criteria: ( - RetrospectiveProcessRetrospectiveProcessMatchingCriteriaType0 - | RetrospectiveProcessRetrospectiveProcessMatchingCriteriaType1 - | RetrospectiveProcessRetrospectiveProcessMatchingCriteriaType2 - | Unset - ) = UNSET + name: Union[Unset, str] = UNSET + description: Union[None, Unset, str] = UNSET + is_default: Union[None, Unset, bool] = UNSET + created_at: Union[Unset, str] = UNSET + updated_at: Union[Unset, str] = UNSET + retrospective_process_matching_criteria: Union[ + "RetrospectiveProcessRetrospectiveProcessMatchingCriteriaType0", + "RetrospectiveProcessRetrospectiveProcessMatchingCriteriaType1", + "RetrospectiveProcessRetrospectiveProcessMatchingCriteriaType2", + Unset, + ] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -62,13 +60,13 @@ def to_dict(self) -> dict[str, Any]: name = self.name - description: None | str | Unset + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: description = self.description - is_default: bool | None | Unset + is_default: Union[None, Unset, bool] if isinstance(self.is_default, Unset): is_default = UNSET else: @@ -78,7 +76,7 @@ def to_dict(self) -> dict[str, Any]: updated_at = self.updated_at - retrospective_process_matching_criteria: dict[str, Any] | Unset + retrospective_process_matching_criteria: Union[Unset, dict[str, Any]] if isinstance(self.retrospective_process_matching_criteria, Unset): retrospective_process_matching_criteria = UNSET elif isinstance( @@ -125,21 +123,21 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) - def _parse_is_default(data: object) -> bool | None | Unset: + def _parse_is_default(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) is_default = _parse_is_default(d.pop("is_default", UNSET)) @@ -149,12 +147,12 @@ def _parse_is_default(data: object) -> bool | None | Unset: def _parse_retrospective_process_matching_criteria( data: object, - ) -> ( - RetrospectiveProcessRetrospectiveProcessMatchingCriteriaType0 - | RetrospectiveProcessRetrospectiveProcessMatchingCriteriaType1 - | RetrospectiveProcessRetrospectiveProcessMatchingCriteriaType2 - | Unset - ): + ) -> Union[ + "RetrospectiveProcessRetrospectiveProcessMatchingCriteriaType0", + "RetrospectiveProcessRetrospectiveProcessMatchingCriteriaType1", + "RetrospectiveProcessRetrospectiveProcessMatchingCriteriaType2", + Unset, + ]: if isinstance(data, Unset): return data try: @@ -165,7 +163,7 @@ def _parse_retrospective_process_matching_criteria( ) return retrospective_process_matching_criteria_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -175,7 +173,7 @@ def _parse_retrospective_process_matching_criteria( ) return retrospective_process_matching_criteria_type_1 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass if not isinstance(data, dict): raise TypeError() diff --git a/rootly_sdk/models/retrospective_process_group.py b/rootly_sdk/models/retrospective_process_group.py index c6214add..bd6c59c6 100644 --- a/rootly_sdk/models/retrospective_process_group.py +++ b/rootly_sdk/models/retrospective_process_group.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/retrospective_process_group_list.py b/rootly_sdk/models/retrospective_process_group_list.py index c61ee6a9..a91aea8b 100644 --- a/rootly_sdk/models/retrospective_process_group_list.py +++ b/rootly_sdk/models/retrospective_process_group_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,20 +20,19 @@ class RetrospectiveProcessGroupList: """ Attributes: - data (list[RetrospectiveProcessGroupListDataItem]): + data (list['RetrospectiveProcessGroupListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[RetrospectiveProcessGroupListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["RetrospectiveProcessGroupListDataItem"] + links: "Links" + meta: "Meta" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) retrospective_process_group_list = cls( data=data, diff --git a/rootly_sdk/models/retrospective_process_group_list_data_item.py b/rootly_sdk/models/retrospective_process_group_list_data_item.py index 019912a5..001161de 100644 --- a/rootly_sdk/models/retrospective_process_group_list_data_item.py +++ b/rootly_sdk/models/retrospective_process_group_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class RetrospectiveProcessGroupListDataItem: id: str type_: RetrospectiveProcessGroupListDataItemType - attributes: RetrospectiveProcessGroup + attributes: "RetrospectiveProcessGroup" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/retrospective_process_group_response.py b/rootly_sdk/models/retrospective_process_group_response.py index 0b29d413..c1584891 100644 --- a/rootly_sdk/models/retrospective_process_group_response.py +++ b/rootly_sdk/models/retrospective_process_group_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,18 +19,17 @@ class RetrospectiveProcessGroupResponse: """ Attributes: data (RetrospectiveProcessGroupResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: RetrospectiveProcessGroupResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "RetrospectiveProcessGroupResponseData" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = RetrospectiveProcessGroupResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) retrospective_process_group_response = cls( data=data, diff --git a/rootly_sdk/models/retrospective_process_group_response_data.py b/rootly_sdk/models/retrospective_process_group_response_data.py index ea3a5523..728a7c2d 100644 --- a/rootly_sdk/models/retrospective_process_group_response_data.py +++ b/rootly_sdk/models/retrospective_process_group_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class RetrospectiveProcessGroupResponseData: id: str type_: RetrospectiveProcessGroupResponseDataType - attributes: RetrospectiveProcessGroup + attributes: "RetrospectiveProcessGroup" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/retrospective_process_group_step.py b/rootly_sdk/models/retrospective_process_group_step.py index d03eeab7..c1e006cd 100644 --- a/rootly_sdk/models/retrospective_process_group_step.py +++ b/rootly_sdk/models/retrospective_process_group_step.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/retrospective_process_group_step_list.py b/rootly_sdk/models/retrospective_process_group_step_list.py index 555ec62f..61db9bed 100644 --- a/rootly_sdk/models/retrospective_process_group_step_list.py +++ b/rootly_sdk/models/retrospective_process_group_step_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,20 +20,19 @@ class RetrospectiveProcessGroupStepList: """ Attributes: - data (list[RetrospectiveProcessGroupStepListDataItem]): + data (list['RetrospectiveProcessGroupStepListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[RetrospectiveProcessGroupStepListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["RetrospectiveProcessGroupStepListDataItem"] + links: "Links" + meta: "Meta" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) retrospective_process_group_step_list = cls( data=data, diff --git a/rootly_sdk/models/retrospective_process_group_step_list_data_item.py b/rootly_sdk/models/retrospective_process_group_step_list_data_item.py index ebf584e3..760eb209 100644 --- a/rootly_sdk/models/retrospective_process_group_step_list_data_item.py +++ b/rootly_sdk/models/retrospective_process_group_step_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class RetrospectiveProcessGroupStepListDataItem: id: str type_: RetrospectiveProcessGroupStepListDataItemType - attributes: RetrospectiveProcessGroupStep + attributes: "RetrospectiveProcessGroupStep" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/retrospective_process_group_step_response.py b/rootly_sdk/models/retrospective_process_group_step_response.py index 857efd29..951cf308 100644 --- a/rootly_sdk/models/retrospective_process_group_step_response.py +++ b/rootly_sdk/models/retrospective_process_group_step_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,18 +19,17 @@ class RetrospectiveProcessGroupStepResponse: """ Attributes: data (RetrospectiveProcessGroupStepResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: RetrospectiveProcessGroupStepResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "RetrospectiveProcessGroupStepResponseData" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = RetrospectiveProcessGroupStepResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) retrospective_process_group_step_response = cls( data=data, diff --git a/rootly_sdk/models/retrospective_process_group_step_response_data.py b/rootly_sdk/models/retrospective_process_group_step_response_data.py index 22381d50..9cc6a8ce 100644 --- a/rootly_sdk/models/retrospective_process_group_step_response_data.py +++ b/rootly_sdk/models/retrospective_process_group_step_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class RetrospectiveProcessGroupStepResponseData: id: str type_: RetrospectiveProcessGroupStepResponseDataType - attributes: RetrospectiveProcessGroupStep + attributes: "RetrospectiveProcessGroupStep" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/retrospective_process_list.py b/rootly_sdk/models/retrospective_process_list.py index 5afa0273..f04181ec 100644 --- a/rootly_sdk/models/retrospective_process_list.py +++ b/rootly_sdk/models/retrospective_process_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,20 +20,19 @@ class RetrospectiveProcessList: """ Attributes: - data (list[RetrospectiveProcessListDataItem]): + data (list['RetrospectiveProcessListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[RetrospectiveProcessListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["RetrospectiveProcessListDataItem"] + links: "Links" + meta: "Meta" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) retrospective_process_list = cls( data=data, diff --git a/rootly_sdk/models/retrospective_process_list_data_item.py b/rootly_sdk/models/retrospective_process_list_data_item.py index 2d5f8fd7..0689a834 100644 --- a/rootly_sdk/models/retrospective_process_list_data_item.py +++ b/rootly_sdk/models/retrospective_process_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class RetrospectiveProcessListDataItem: id: str type_: RetrospectiveProcessListDataItemType - attributes: RetrospectiveProcess + attributes: "RetrospectiveProcess" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/retrospective_process_response.py b/rootly_sdk/models/retrospective_process_response.py index 0ee37bf2..11f9ebae 100644 --- a/rootly_sdk/models/retrospective_process_response.py +++ b/rootly_sdk/models/retrospective_process_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,18 +19,17 @@ class RetrospectiveProcessResponse: """ Attributes: data (RetrospectiveProcessResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: RetrospectiveProcessResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "RetrospectiveProcessResponseData" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = RetrospectiveProcessResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) retrospective_process_response = cls( data=data, diff --git a/rootly_sdk/models/retrospective_process_response_data.py b/rootly_sdk/models/retrospective_process_response_data.py index de0061c5..63527e2b 100644 --- a/rootly_sdk/models/retrospective_process_response_data.py +++ b/rootly_sdk/models/retrospective_process_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class RetrospectiveProcessResponseData: id: str type_: RetrospectiveProcessResponseDataType - attributes: RetrospectiveProcess + attributes: "RetrospectiveProcess" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/retrospective_process_retrospective_process_matching_criteria_type_0.py b/rootly_sdk/models/retrospective_process_retrospective_process_matching_criteria_type_0.py index dc946fab..c5264651 100644 --- a/rootly_sdk/models/retrospective_process_retrospective_process_matching_criteria_type_0.py +++ b/rootly_sdk/models/retrospective_process_retrospective_process_matching_criteria_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast diff --git a/rootly_sdk/models/retrospective_process_retrospective_process_matching_criteria_type_1.py b/rootly_sdk/models/retrospective_process_retrospective_process_matching_criteria_type_1.py index 07a6c5da..5ad34cd0 100644 --- a/rootly_sdk/models/retrospective_process_retrospective_process_matching_criteria_type_1.py +++ b/rootly_sdk/models/retrospective_process_retrospective_process_matching_criteria_type_1.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast diff --git a/rootly_sdk/models/retrospective_process_retrospective_process_matching_criteria_type_2.py b/rootly_sdk/models/retrospective_process_retrospective_process_matching_criteria_type_2.py index 4243efab..a1080736 100644 --- a/rootly_sdk/models/retrospective_process_retrospective_process_matching_criteria_type_2.py +++ b/rootly_sdk/models/retrospective_process_retrospective_process_matching_criteria_type_2.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast diff --git a/rootly_sdk/models/retrospective_step.py b/rootly_sdk/models/retrospective_step.py index 2f2c7941..7676bb7c 100644 --- a/rootly_sdk/models/retrospective_step.py +++ b/rootly_sdk/models/retrospective_step.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,25 +17,25 @@ class RetrospectiveStep: title (str): The name of the step created_at (str): Date of creation updated_at (str): Date of last update - slug (str | Unset): The slug of the step - description (None | str | Unset): The description of the step - incident_role_id (None | str | Unset): Users assigned to the selected incident role will be the default owners - for this step - due_after_days (int | None | Unset): Due date in days - position (int | Unset): Position of the step - skippable (bool | Unset): Is the step skippable? + slug (Union[Unset, str]): The slug of the step + description (Union[None, Unset, str]): The description of the step + incident_role_id (Union[None, Unset, str]): Users assigned to the selected incident role will be the default + owners for this step + due_after_days (Union[None, Unset, int]): Due date in days + position (Union[Unset, int]): Position of the step + skippable (Union[Unset, bool]): Is the step skippable? """ retrospective_process_id: str title: str created_at: str updated_at: str - slug: str | Unset = UNSET - description: None | str | Unset = UNSET - incident_role_id: None | str | Unset = UNSET - due_after_days: int | None | Unset = UNSET - position: int | Unset = UNSET - skippable: bool | Unset = UNSET + slug: Union[Unset, str] = UNSET + description: Union[None, Unset, str] = UNSET + incident_role_id: Union[None, Unset, str] = UNSET + due_after_days: Union[None, Unset, int] = UNSET + position: Union[Unset, int] = UNSET + skippable: Union[Unset, bool] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -51,19 +49,19 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - description: None | str | Unset + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: description = self.description - incident_role_id: None | str | Unset + incident_role_id: Union[None, Unset, str] if isinstance(self.incident_role_id, Unset): incident_role_id = UNSET else: incident_role_id = self.incident_role_id - due_after_days: int | None | Unset + due_after_days: Union[None, Unset, int] if isinstance(self.due_after_days, Unset): due_after_days = UNSET else: @@ -111,30 +109,30 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: slug = d.pop("slug", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) - def _parse_incident_role_id(data: object) -> None | str | Unset: + def _parse_incident_role_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) incident_role_id = _parse_incident_role_id(d.pop("incident_role_id", UNSET)) - def _parse_due_after_days(data: object) -> int | None | Unset: + def _parse_due_after_days(data: object) -> Union[None, Unset, int]: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(Union[None, Unset, int], data) due_after_days = _parse_due_after_days(d.pop("due_after_days", UNSET)) diff --git a/rootly_sdk/models/retrospective_step_list.py b/rootly_sdk/models/retrospective_step_list.py index 217ff699..e1abc33f 100644 --- a/rootly_sdk/models/retrospective_step_list.py +++ b/rootly_sdk/models/retrospective_step_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,20 +20,19 @@ class RetrospectiveStepList: """ Attributes: - data (list[RetrospectiveStepListDataItem]): + data (list['RetrospectiveStepListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[RetrospectiveStepListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["RetrospectiveStepListDataItem"] + links: "Links" + meta: "Meta" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) retrospective_step_list = cls( data=data, diff --git a/rootly_sdk/models/retrospective_step_list_data_item.py b/rootly_sdk/models/retrospective_step_list_data_item.py index 8b3f2ac7..160e4e85 100644 --- a/rootly_sdk/models/retrospective_step_list_data_item.py +++ b/rootly_sdk/models/retrospective_step_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class RetrospectiveStepListDataItem: id: str type_: RetrospectiveStepListDataItemType - attributes: RetrospectiveStep + attributes: "RetrospectiveStep" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/retrospective_step_response.py b/rootly_sdk/models/retrospective_step_response.py index be53a1f7..6c65072a 100644 --- a/rootly_sdk/models/retrospective_step_response.py +++ b/rootly_sdk/models/retrospective_step_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,18 +19,17 @@ class RetrospectiveStepResponse: """ Attributes: data (RetrospectiveStepResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: RetrospectiveStepResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "RetrospectiveStepResponseData" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = RetrospectiveStepResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) retrospective_step_response = cls( data=data, diff --git a/rootly_sdk/models/retrospective_step_response_data.py b/rootly_sdk/models/retrospective_step_response_data.py index 61cc6489..28e0e5b4 100644 --- a/rootly_sdk/models/retrospective_step_response_data.py +++ b/rootly_sdk/models/retrospective_step_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class RetrospectiveStepResponseData: id: str type_: RetrospectiveStepResponseDataType - attributes: RetrospectiveStep + attributes: "RetrospectiveStep" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/role.py b/rootly_sdk/models/role.py index 58edeedd..c7fb2ce2 100644 --- a/rootly_sdk/models/role.py +++ b/rootly_sdk/models/role.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -102,85 +100,85 @@ class Role: name (str): The role name. created_at (str): updated_at (str): - slug (str | Unset): The role slug. - incident_permission_set_id (None | str | Unset): Associated incident permissions set. - is_deletable (bool | Unset): Whether the role can be deleted. - is_editable (bool | Unset): Whether the role can be edited. - alerts_permissions (list[RoleAlertsPermissionsItem] | Unset): - api_keys_permissions (list[RoleApiKeysPermissionsItem] | Unset): - audits_permissions (list[RoleAuditsPermissionsItem] | Unset): - billing_permissions (list[RoleBillingPermissionsItem] | Unset): - environments_permissions (list[RoleEnvironmentsPermissionsItem] | Unset): - form_fields_permissions (list[RoleFormFieldsPermissionsItem] | Unset): - functionalities_permissions (list[RoleFunctionalitiesPermissionsItem] | Unset): - groups_permissions (list[RoleGroupsPermissionsItem] | Unset): - incident_causes_permissions (list[RoleIncidentCausesPermissionsItem] | Unset): - incident_feedbacks_permissions (list[RoleIncidentFeedbacksPermissionsItem] | Unset): - incident_roles_permissions (list[RoleIncidentRolesPermissionsItem] | Unset): - incident_types_permissions (list[RoleIncidentTypesPermissionsItem] | Unset): - incidents_permissions (list[RoleIncidentsPermissionsItem] | Unset): - integrations_permissions (list[RoleIntegrationsPermissionsItem] | Unset): - invitations_permissions (list[RoleInvitationsPermissionsItem] | Unset): - playbooks_permissions (list[RolePlaybooksPermissionsItem] | Unset): - private_incidents_permissions (list[RolePrivateIncidentsPermissionsItem] | Unset): - pulses_permissions (list[RolePulsesPermissionsItem] | Unset): - retrospective_permissions (list[RoleRetrospectivePermissionsItem] | Unset): - roles_permissions (list[RoleRolesPermissionsItem] | Unset): - secrets_permissions (list[RoleSecretsPermissionsItem] | Unset): - services_permissions (list[RoleServicesPermissionsItem] | Unset): - severities_permissions (list[RoleSeveritiesPermissionsItem] | Unset): - status_pages_permissions (list[RoleStatusPagesPermissionsItem] | Unset): - webhooks_permissions (list[RoleWebhooksPermissionsItem] | Unset): - workflows_permissions (list[RoleWorkflowsPermissionsItem] | Unset): - catalogs_permissions (list[RoleCatalogsPermissionsItem] | Unset): - sub_statuses_permissions (list[RoleSubStatusesPermissionsItem] | Unset): - edge_connector_permissions (list[RoleEdgeConnectorPermissionsItem] | Unset): - slas_permissions (list[RoleSlasPermissionsItem] | Unset): - paging_permissions (list[RolePagingPermissionsItem] | Unset): - incident_communication_permissions (list[RoleIncidentCommunicationPermissionsItem] | Unset): - communication_permissions (list[RoleCommunicationPermissionsItem] | Unset): + slug (Union[Unset, str]): The role slug. + incident_permission_set_id (Union[None, Unset, str]): Associated incident permissions set. + is_deletable (Union[Unset, bool]): Whether the role can be deleted. + is_editable (Union[Unset, bool]): Whether the role can be edited. + alerts_permissions (Union[Unset, list[RoleAlertsPermissionsItem]]): + api_keys_permissions (Union[Unset, list[RoleApiKeysPermissionsItem]]): + audits_permissions (Union[Unset, list[RoleAuditsPermissionsItem]]): + billing_permissions (Union[Unset, list[RoleBillingPermissionsItem]]): + environments_permissions (Union[Unset, list[RoleEnvironmentsPermissionsItem]]): + form_fields_permissions (Union[Unset, list[RoleFormFieldsPermissionsItem]]): + functionalities_permissions (Union[Unset, list[RoleFunctionalitiesPermissionsItem]]): + groups_permissions (Union[Unset, list[RoleGroupsPermissionsItem]]): + incident_causes_permissions (Union[Unset, list[RoleIncidentCausesPermissionsItem]]): + incident_feedbacks_permissions (Union[Unset, list[RoleIncidentFeedbacksPermissionsItem]]): + incident_roles_permissions (Union[Unset, list[RoleIncidentRolesPermissionsItem]]): + incident_types_permissions (Union[Unset, list[RoleIncidentTypesPermissionsItem]]): + incidents_permissions (Union[Unset, list[RoleIncidentsPermissionsItem]]): + integrations_permissions (Union[Unset, list[RoleIntegrationsPermissionsItem]]): + invitations_permissions (Union[Unset, list[RoleInvitationsPermissionsItem]]): + playbooks_permissions (Union[Unset, list[RolePlaybooksPermissionsItem]]): + private_incidents_permissions (Union[Unset, list[RolePrivateIncidentsPermissionsItem]]): + pulses_permissions (Union[Unset, list[RolePulsesPermissionsItem]]): + retrospective_permissions (Union[Unset, list[RoleRetrospectivePermissionsItem]]): + roles_permissions (Union[Unset, list[RoleRolesPermissionsItem]]): + secrets_permissions (Union[Unset, list[RoleSecretsPermissionsItem]]): + services_permissions (Union[Unset, list[RoleServicesPermissionsItem]]): + severities_permissions (Union[Unset, list[RoleSeveritiesPermissionsItem]]): + status_pages_permissions (Union[Unset, list[RoleStatusPagesPermissionsItem]]): + webhooks_permissions (Union[Unset, list[RoleWebhooksPermissionsItem]]): + workflows_permissions (Union[Unset, list[RoleWorkflowsPermissionsItem]]): + catalogs_permissions (Union[Unset, list[RoleCatalogsPermissionsItem]]): + sub_statuses_permissions (Union[Unset, list[RoleSubStatusesPermissionsItem]]): + edge_connector_permissions (Union[Unset, list[RoleEdgeConnectorPermissionsItem]]): + slas_permissions (Union[Unset, list[RoleSlasPermissionsItem]]): + paging_permissions (Union[Unset, list[RolePagingPermissionsItem]]): + incident_communication_permissions (Union[Unset, list[RoleIncidentCommunicationPermissionsItem]]): + communication_permissions (Union[Unset, list[RoleCommunicationPermissionsItem]]): """ name: str created_at: str updated_at: str - slug: str | Unset = UNSET - incident_permission_set_id: None | str | Unset = UNSET - is_deletable: bool | Unset = UNSET - is_editable: bool | Unset = UNSET - alerts_permissions: list[RoleAlertsPermissionsItem] | Unset = UNSET - api_keys_permissions: list[RoleApiKeysPermissionsItem] | Unset = UNSET - audits_permissions: list[RoleAuditsPermissionsItem] | Unset = UNSET - billing_permissions: list[RoleBillingPermissionsItem] | Unset = UNSET - environments_permissions: list[RoleEnvironmentsPermissionsItem] | Unset = UNSET - form_fields_permissions: list[RoleFormFieldsPermissionsItem] | Unset = UNSET - functionalities_permissions: list[RoleFunctionalitiesPermissionsItem] | Unset = UNSET - groups_permissions: list[RoleGroupsPermissionsItem] | Unset = UNSET - incident_causes_permissions: list[RoleIncidentCausesPermissionsItem] | Unset = UNSET - incident_feedbacks_permissions: list[RoleIncidentFeedbacksPermissionsItem] | Unset = UNSET - incident_roles_permissions: list[RoleIncidentRolesPermissionsItem] | Unset = UNSET - incident_types_permissions: list[RoleIncidentTypesPermissionsItem] | Unset = UNSET - incidents_permissions: list[RoleIncidentsPermissionsItem] | Unset = UNSET - integrations_permissions: list[RoleIntegrationsPermissionsItem] | Unset = UNSET - invitations_permissions: list[RoleInvitationsPermissionsItem] | Unset = UNSET - playbooks_permissions: list[RolePlaybooksPermissionsItem] | Unset = UNSET - private_incidents_permissions: list[RolePrivateIncidentsPermissionsItem] | Unset = UNSET - pulses_permissions: list[RolePulsesPermissionsItem] | Unset = UNSET - retrospective_permissions: list[RoleRetrospectivePermissionsItem] | Unset = UNSET - roles_permissions: list[RoleRolesPermissionsItem] | Unset = UNSET - secrets_permissions: list[RoleSecretsPermissionsItem] | Unset = UNSET - services_permissions: list[RoleServicesPermissionsItem] | Unset = UNSET - severities_permissions: list[RoleSeveritiesPermissionsItem] | Unset = UNSET - status_pages_permissions: list[RoleStatusPagesPermissionsItem] | Unset = UNSET - webhooks_permissions: list[RoleWebhooksPermissionsItem] | Unset = UNSET - workflows_permissions: list[RoleWorkflowsPermissionsItem] | Unset = UNSET - catalogs_permissions: list[RoleCatalogsPermissionsItem] | Unset = UNSET - sub_statuses_permissions: list[RoleSubStatusesPermissionsItem] | Unset = UNSET - edge_connector_permissions: list[RoleEdgeConnectorPermissionsItem] | Unset = UNSET - slas_permissions: list[RoleSlasPermissionsItem] | Unset = UNSET - paging_permissions: list[RolePagingPermissionsItem] | Unset = UNSET - incident_communication_permissions: list[RoleIncidentCommunicationPermissionsItem] | Unset = UNSET - communication_permissions: list[RoleCommunicationPermissionsItem] | Unset = UNSET + slug: Union[Unset, str] = UNSET + incident_permission_set_id: Union[None, Unset, str] = UNSET + is_deletable: Union[Unset, bool] = UNSET + is_editable: Union[Unset, bool] = UNSET + alerts_permissions: Union[Unset, list[RoleAlertsPermissionsItem]] = UNSET + api_keys_permissions: Union[Unset, list[RoleApiKeysPermissionsItem]] = UNSET + audits_permissions: Union[Unset, list[RoleAuditsPermissionsItem]] = UNSET + billing_permissions: Union[Unset, list[RoleBillingPermissionsItem]] = UNSET + environments_permissions: Union[Unset, list[RoleEnvironmentsPermissionsItem]] = UNSET + form_fields_permissions: Union[Unset, list[RoleFormFieldsPermissionsItem]] = UNSET + functionalities_permissions: Union[Unset, list[RoleFunctionalitiesPermissionsItem]] = UNSET + groups_permissions: Union[Unset, list[RoleGroupsPermissionsItem]] = UNSET + incident_causes_permissions: Union[Unset, list[RoleIncidentCausesPermissionsItem]] = UNSET + incident_feedbacks_permissions: Union[Unset, list[RoleIncidentFeedbacksPermissionsItem]] = UNSET + incident_roles_permissions: Union[Unset, list[RoleIncidentRolesPermissionsItem]] = UNSET + incident_types_permissions: Union[Unset, list[RoleIncidentTypesPermissionsItem]] = UNSET + incidents_permissions: Union[Unset, list[RoleIncidentsPermissionsItem]] = UNSET + integrations_permissions: Union[Unset, list[RoleIntegrationsPermissionsItem]] = UNSET + invitations_permissions: Union[Unset, list[RoleInvitationsPermissionsItem]] = UNSET + playbooks_permissions: Union[Unset, list[RolePlaybooksPermissionsItem]] = UNSET + private_incidents_permissions: Union[Unset, list[RolePrivateIncidentsPermissionsItem]] = UNSET + pulses_permissions: Union[Unset, list[RolePulsesPermissionsItem]] = UNSET + retrospective_permissions: Union[Unset, list[RoleRetrospectivePermissionsItem]] = UNSET + roles_permissions: Union[Unset, list[RoleRolesPermissionsItem]] = UNSET + secrets_permissions: Union[Unset, list[RoleSecretsPermissionsItem]] = UNSET + services_permissions: Union[Unset, list[RoleServicesPermissionsItem]] = UNSET + severities_permissions: Union[Unset, list[RoleSeveritiesPermissionsItem]] = UNSET + status_pages_permissions: Union[Unset, list[RoleStatusPagesPermissionsItem]] = UNSET + webhooks_permissions: Union[Unset, list[RoleWebhooksPermissionsItem]] = UNSET + workflows_permissions: Union[Unset, list[RoleWorkflowsPermissionsItem]] = UNSET + catalogs_permissions: Union[Unset, list[RoleCatalogsPermissionsItem]] = UNSET + sub_statuses_permissions: Union[Unset, list[RoleSubStatusesPermissionsItem]] = UNSET + edge_connector_permissions: Union[Unset, list[RoleEdgeConnectorPermissionsItem]] = UNSET + slas_permissions: Union[Unset, list[RoleSlasPermissionsItem]] = UNSET + paging_permissions: Union[Unset, list[RolePagingPermissionsItem]] = UNSET + incident_communication_permissions: Union[Unset, list[RoleIncidentCommunicationPermissionsItem]] = UNSET + communication_permissions: Union[Unset, list[RoleCommunicationPermissionsItem]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -192,7 +190,7 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - incident_permission_set_id: None | str | Unset + incident_permission_set_id: Union[None, Unset, str] if isinstance(self.incident_permission_set_id, Unset): incident_permission_set_id = UNSET else: @@ -202,231 +200,231 @@ def to_dict(self) -> dict[str, Any]: is_editable = self.is_editable - alerts_permissions: list[str] | Unset = UNSET + alerts_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.alerts_permissions, Unset): alerts_permissions = [] for alerts_permissions_item_data in self.alerts_permissions: alerts_permissions_item: str = alerts_permissions_item_data alerts_permissions.append(alerts_permissions_item) - api_keys_permissions: list[str] | Unset = UNSET + api_keys_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.api_keys_permissions, Unset): api_keys_permissions = [] for api_keys_permissions_item_data in self.api_keys_permissions: api_keys_permissions_item: str = api_keys_permissions_item_data api_keys_permissions.append(api_keys_permissions_item) - audits_permissions: list[str] | Unset = UNSET + audits_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.audits_permissions, Unset): audits_permissions = [] for audits_permissions_item_data in self.audits_permissions: audits_permissions_item: str = audits_permissions_item_data audits_permissions.append(audits_permissions_item) - billing_permissions: list[str] | Unset = UNSET + billing_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.billing_permissions, Unset): billing_permissions = [] for billing_permissions_item_data in self.billing_permissions: billing_permissions_item: str = billing_permissions_item_data billing_permissions.append(billing_permissions_item) - environments_permissions: list[str] | Unset = UNSET + environments_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.environments_permissions, Unset): environments_permissions = [] for environments_permissions_item_data in self.environments_permissions: environments_permissions_item: str = environments_permissions_item_data environments_permissions.append(environments_permissions_item) - form_fields_permissions: list[str] | Unset = UNSET + form_fields_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.form_fields_permissions, Unset): form_fields_permissions = [] for form_fields_permissions_item_data in self.form_fields_permissions: form_fields_permissions_item: str = form_fields_permissions_item_data form_fields_permissions.append(form_fields_permissions_item) - functionalities_permissions: list[str] | Unset = UNSET + functionalities_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.functionalities_permissions, Unset): functionalities_permissions = [] for functionalities_permissions_item_data in self.functionalities_permissions: functionalities_permissions_item: str = functionalities_permissions_item_data functionalities_permissions.append(functionalities_permissions_item) - groups_permissions: list[str] | Unset = UNSET + groups_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.groups_permissions, Unset): groups_permissions = [] for groups_permissions_item_data in self.groups_permissions: groups_permissions_item: str = groups_permissions_item_data groups_permissions.append(groups_permissions_item) - incident_causes_permissions: list[str] | Unset = UNSET + incident_causes_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.incident_causes_permissions, Unset): incident_causes_permissions = [] for incident_causes_permissions_item_data in self.incident_causes_permissions: incident_causes_permissions_item: str = incident_causes_permissions_item_data incident_causes_permissions.append(incident_causes_permissions_item) - incident_feedbacks_permissions: list[str] | Unset = UNSET + incident_feedbacks_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.incident_feedbacks_permissions, Unset): incident_feedbacks_permissions = [] for incident_feedbacks_permissions_item_data in self.incident_feedbacks_permissions: incident_feedbacks_permissions_item: str = incident_feedbacks_permissions_item_data incident_feedbacks_permissions.append(incident_feedbacks_permissions_item) - incident_roles_permissions: list[str] | Unset = UNSET + incident_roles_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.incident_roles_permissions, Unset): incident_roles_permissions = [] for incident_roles_permissions_item_data in self.incident_roles_permissions: incident_roles_permissions_item: str = incident_roles_permissions_item_data incident_roles_permissions.append(incident_roles_permissions_item) - incident_types_permissions: list[str] | Unset = UNSET + incident_types_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.incident_types_permissions, Unset): incident_types_permissions = [] for incident_types_permissions_item_data in self.incident_types_permissions: incident_types_permissions_item: str = incident_types_permissions_item_data incident_types_permissions.append(incident_types_permissions_item) - incidents_permissions: list[str] | Unset = UNSET + incidents_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.incidents_permissions, Unset): incidents_permissions = [] for incidents_permissions_item_data in self.incidents_permissions: incidents_permissions_item: str = incidents_permissions_item_data incidents_permissions.append(incidents_permissions_item) - integrations_permissions: list[str] | Unset = UNSET + integrations_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.integrations_permissions, Unset): integrations_permissions = [] for integrations_permissions_item_data in self.integrations_permissions: integrations_permissions_item: str = integrations_permissions_item_data integrations_permissions.append(integrations_permissions_item) - invitations_permissions: list[str] | Unset = UNSET + invitations_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.invitations_permissions, Unset): invitations_permissions = [] for invitations_permissions_item_data in self.invitations_permissions: invitations_permissions_item: str = invitations_permissions_item_data invitations_permissions.append(invitations_permissions_item) - playbooks_permissions: list[str] | Unset = UNSET + playbooks_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.playbooks_permissions, Unset): playbooks_permissions = [] for playbooks_permissions_item_data in self.playbooks_permissions: playbooks_permissions_item: str = playbooks_permissions_item_data playbooks_permissions.append(playbooks_permissions_item) - private_incidents_permissions: list[str] | Unset = UNSET + private_incidents_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.private_incidents_permissions, Unset): private_incidents_permissions = [] for private_incidents_permissions_item_data in self.private_incidents_permissions: private_incidents_permissions_item: str = private_incidents_permissions_item_data private_incidents_permissions.append(private_incidents_permissions_item) - pulses_permissions: list[str] | Unset = UNSET + pulses_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.pulses_permissions, Unset): pulses_permissions = [] for pulses_permissions_item_data in self.pulses_permissions: pulses_permissions_item: str = pulses_permissions_item_data pulses_permissions.append(pulses_permissions_item) - retrospective_permissions: list[str] | Unset = UNSET + retrospective_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.retrospective_permissions, Unset): retrospective_permissions = [] for retrospective_permissions_item_data in self.retrospective_permissions: retrospective_permissions_item: str = retrospective_permissions_item_data retrospective_permissions.append(retrospective_permissions_item) - roles_permissions: list[str] | Unset = UNSET + roles_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.roles_permissions, Unset): roles_permissions = [] for roles_permissions_item_data in self.roles_permissions: roles_permissions_item: str = roles_permissions_item_data roles_permissions.append(roles_permissions_item) - secrets_permissions: list[str] | Unset = UNSET + secrets_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.secrets_permissions, Unset): secrets_permissions = [] for secrets_permissions_item_data in self.secrets_permissions: secrets_permissions_item: str = secrets_permissions_item_data secrets_permissions.append(secrets_permissions_item) - services_permissions: list[str] | Unset = UNSET + services_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.services_permissions, Unset): services_permissions = [] for services_permissions_item_data in self.services_permissions: services_permissions_item: str = services_permissions_item_data services_permissions.append(services_permissions_item) - severities_permissions: list[str] | Unset = UNSET + severities_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.severities_permissions, Unset): severities_permissions = [] for severities_permissions_item_data in self.severities_permissions: severities_permissions_item: str = severities_permissions_item_data severities_permissions.append(severities_permissions_item) - status_pages_permissions: list[str] | Unset = UNSET + status_pages_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.status_pages_permissions, Unset): status_pages_permissions = [] for status_pages_permissions_item_data in self.status_pages_permissions: status_pages_permissions_item: str = status_pages_permissions_item_data status_pages_permissions.append(status_pages_permissions_item) - webhooks_permissions: list[str] | Unset = UNSET + webhooks_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.webhooks_permissions, Unset): webhooks_permissions = [] for webhooks_permissions_item_data in self.webhooks_permissions: webhooks_permissions_item: str = webhooks_permissions_item_data webhooks_permissions.append(webhooks_permissions_item) - workflows_permissions: list[str] | Unset = UNSET + workflows_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.workflows_permissions, Unset): workflows_permissions = [] for workflows_permissions_item_data in self.workflows_permissions: workflows_permissions_item: str = workflows_permissions_item_data workflows_permissions.append(workflows_permissions_item) - catalogs_permissions: list[str] | Unset = UNSET + catalogs_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.catalogs_permissions, Unset): catalogs_permissions = [] for catalogs_permissions_item_data in self.catalogs_permissions: catalogs_permissions_item: str = catalogs_permissions_item_data catalogs_permissions.append(catalogs_permissions_item) - sub_statuses_permissions: list[str] | Unset = UNSET + sub_statuses_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.sub_statuses_permissions, Unset): sub_statuses_permissions = [] for sub_statuses_permissions_item_data in self.sub_statuses_permissions: sub_statuses_permissions_item: str = sub_statuses_permissions_item_data sub_statuses_permissions.append(sub_statuses_permissions_item) - edge_connector_permissions: list[str] | Unset = UNSET + edge_connector_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.edge_connector_permissions, Unset): edge_connector_permissions = [] for edge_connector_permissions_item_data in self.edge_connector_permissions: edge_connector_permissions_item: str = edge_connector_permissions_item_data edge_connector_permissions.append(edge_connector_permissions_item) - slas_permissions: list[str] | Unset = UNSET + slas_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.slas_permissions, Unset): slas_permissions = [] for slas_permissions_item_data in self.slas_permissions: slas_permissions_item: str = slas_permissions_item_data slas_permissions.append(slas_permissions_item) - paging_permissions: list[str] | Unset = UNSET + paging_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.paging_permissions, Unset): paging_permissions = [] for paging_permissions_item_data in self.paging_permissions: paging_permissions_item: str = paging_permissions_item_data paging_permissions.append(paging_permissions_item) - incident_communication_permissions: list[str] | Unset = UNSET + incident_communication_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.incident_communication_permissions, Unset): incident_communication_permissions = [] for incident_communication_permissions_item_data in self.incident_communication_permissions: incident_communication_permissions_item: str = incident_communication_permissions_item_data incident_communication_permissions.append(incident_communication_permissions_item) - communication_permissions: list[str] | Unset = UNSET + communication_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.communication_permissions, Unset): communication_permissions = [] for communication_permissions_item_data in self.communication_permissions: @@ -530,12 +528,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: slug = d.pop("slug", UNSET) - def _parse_incident_permission_set_id(data: object) -> None | str | Unset: + def _parse_incident_permission_set_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) incident_permission_set_id = _parse_incident_permission_set_id(d.pop("incident_permission_set_id", UNSET)) @@ -543,334 +541,256 @@ def _parse_incident_permission_set_id(data: object) -> None | str | Unset: is_editable = d.pop("is_editable", UNSET) + alerts_permissions = [] _alerts_permissions = d.pop("alerts_permissions", UNSET) - alerts_permissions: list[RoleAlertsPermissionsItem] | Unset = UNSET - if _alerts_permissions is not UNSET: - alerts_permissions = [] - for alerts_permissions_item_data in _alerts_permissions: - alerts_permissions_item = check_role_alerts_permissions_item(alerts_permissions_item_data) + for alerts_permissions_item_data in _alerts_permissions or []: + alerts_permissions_item = check_role_alerts_permissions_item(alerts_permissions_item_data) - alerts_permissions.append(alerts_permissions_item) + alerts_permissions.append(alerts_permissions_item) + api_keys_permissions = [] _api_keys_permissions = d.pop("api_keys_permissions", UNSET) - api_keys_permissions: list[RoleApiKeysPermissionsItem] | Unset = UNSET - if _api_keys_permissions is not UNSET: - api_keys_permissions = [] - for api_keys_permissions_item_data in _api_keys_permissions: - api_keys_permissions_item = check_role_api_keys_permissions_item(api_keys_permissions_item_data) + for api_keys_permissions_item_data in _api_keys_permissions or []: + api_keys_permissions_item = check_role_api_keys_permissions_item(api_keys_permissions_item_data) - api_keys_permissions.append(api_keys_permissions_item) + api_keys_permissions.append(api_keys_permissions_item) + audits_permissions = [] _audits_permissions = d.pop("audits_permissions", UNSET) - audits_permissions: list[RoleAuditsPermissionsItem] | Unset = UNSET - if _audits_permissions is not UNSET: - audits_permissions = [] - for audits_permissions_item_data in _audits_permissions: - audits_permissions_item = check_role_audits_permissions_item(audits_permissions_item_data) + for audits_permissions_item_data in _audits_permissions or []: + audits_permissions_item = check_role_audits_permissions_item(audits_permissions_item_data) - audits_permissions.append(audits_permissions_item) + audits_permissions.append(audits_permissions_item) + billing_permissions = [] _billing_permissions = d.pop("billing_permissions", UNSET) - billing_permissions: list[RoleBillingPermissionsItem] | Unset = UNSET - if _billing_permissions is not UNSET: - billing_permissions = [] - for billing_permissions_item_data in _billing_permissions: - billing_permissions_item = check_role_billing_permissions_item(billing_permissions_item_data) + for billing_permissions_item_data in _billing_permissions or []: + billing_permissions_item = check_role_billing_permissions_item(billing_permissions_item_data) - billing_permissions.append(billing_permissions_item) + billing_permissions.append(billing_permissions_item) + environments_permissions = [] _environments_permissions = d.pop("environments_permissions", UNSET) - environments_permissions: list[RoleEnvironmentsPermissionsItem] | Unset = UNSET - if _environments_permissions is not UNSET: - environments_permissions = [] - for environments_permissions_item_data in _environments_permissions: - environments_permissions_item = check_role_environments_permissions_item( - environments_permissions_item_data - ) + for environments_permissions_item_data in _environments_permissions or []: + environments_permissions_item = check_role_environments_permissions_item(environments_permissions_item_data) - environments_permissions.append(environments_permissions_item) + environments_permissions.append(environments_permissions_item) + form_fields_permissions = [] _form_fields_permissions = d.pop("form_fields_permissions", UNSET) - form_fields_permissions: list[RoleFormFieldsPermissionsItem] | Unset = UNSET - if _form_fields_permissions is not UNSET: - form_fields_permissions = [] - for form_fields_permissions_item_data in _form_fields_permissions: - form_fields_permissions_item = check_role_form_fields_permissions_item( - form_fields_permissions_item_data - ) + for form_fields_permissions_item_data in _form_fields_permissions or []: + form_fields_permissions_item = check_role_form_fields_permissions_item(form_fields_permissions_item_data) - form_fields_permissions.append(form_fields_permissions_item) + form_fields_permissions.append(form_fields_permissions_item) + functionalities_permissions = [] _functionalities_permissions = d.pop("functionalities_permissions", UNSET) - functionalities_permissions: list[RoleFunctionalitiesPermissionsItem] | Unset = UNSET - if _functionalities_permissions is not UNSET: - functionalities_permissions = [] - for functionalities_permissions_item_data in _functionalities_permissions: - functionalities_permissions_item = check_role_functionalities_permissions_item( - functionalities_permissions_item_data - ) + for functionalities_permissions_item_data in _functionalities_permissions or []: + functionalities_permissions_item = check_role_functionalities_permissions_item( + functionalities_permissions_item_data + ) - functionalities_permissions.append(functionalities_permissions_item) + functionalities_permissions.append(functionalities_permissions_item) + groups_permissions = [] _groups_permissions = d.pop("groups_permissions", UNSET) - groups_permissions: list[RoleGroupsPermissionsItem] | Unset = UNSET - if _groups_permissions is not UNSET: - groups_permissions = [] - for groups_permissions_item_data in _groups_permissions: - groups_permissions_item = check_role_groups_permissions_item(groups_permissions_item_data) + for groups_permissions_item_data in _groups_permissions or []: + groups_permissions_item = check_role_groups_permissions_item(groups_permissions_item_data) - groups_permissions.append(groups_permissions_item) + groups_permissions.append(groups_permissions_item) + incident_causes_permissions = [] _incident_causes_permissions = d.pop("incident_causes_permissions", UNSET) - incident_causes_permissions: list[RoleIncidentCausesPermissionsItem] | Unset = UNSET - if _incident_causes_permissions is not UNSET: - incident_causes_permissions = [] - for incident_causes_permissions_item_data in _incident_causes_permissions: - incident_causes_permissions_item = check_role_incident_causes_permissions_item( - incident_causes_permissions_item_data - ) + for incident_causes_permissions_item_data in _incident_causes_permissions or []: + incident_causes_permissions_item = check_role_incident_causes_permissions_item( + incident_causes_permissions_item_data + ) - incident_causes_permissions.append(incident_causes_permissions_item) + incident_causes_permissions.append(incident_causes_permissions_item) + incident_feedbacks_permissions = [] _incident_feedbacks_permissions = d.pop("incident_feedbacks_permissions", UNSET) - incident_feedbacks_permissions: list[RoleIncidentFeedbacksPermissionsItem] | Unset = UNSET - if _incident_feedbacks_permissions is not UNSET: - incident_feedbacks_permissions = [] - for incident_feedbacks_permissions_item_data in _incident_feedbacks_permissions: - incident_feedbacks_permissions_item = check_role_incident_feedbacks_permissions_item( - incident_feedbacks_permissions_item_data - ) + for incident_feedbacks_permissions_item_data in _incident_feedbacks_permissions or []: + incident_feedbacks_permissions_item = check_role_incident_feedbacks_permissions_item( + incident_feedbacks_permissions_item_data + ) - incident_feedbacks_permissions.append(incident_feedbacks_permissions_item) + incident_feedbacks_permissions.append(incident_feedbacks_permissions_item) + incident_roles_permissions = [] _incident_roles_permissions = d.pop("incident_roles_permissions", UNSET) - incident_roles_permissions: list[RoleIncidentRolesPermissionsItem] | Unset = UNSET - if _incident_roles_permissions is not UNSET: - incident_roles_permissions = [] - for incident_roles_permissions_item_data in _incident_roles_permissions: - incident_roles_permissions_item = check_role_incident_roles_permissions_item( - incident_roles_permissions_item_data - ) + for incident_roles_permissions_item_data in _incident_roles_permissions or []: + incident_roles_permissions_item = check_role_incident_roles_permissions_item( + incident_roles_permissions_item_data + ) - incident_roles_permissions.append(incident_roles_permissions_item) + incident_roles_permissions.append(incident_roles_permissions_item) + incident_types_permissions = [] _incident_types_permissions = d.pop("incident_types_permissions", UNSET) - incident_types_permissions: list[RoleIncidentTypesPermissionsItem] | Unset = UNSET - if _incident_types_permissions is not UNSET: - incident_types_permissions = [] - for incident_types_permissions_item_data in _incident_types_permissions: - incident_types_permissions_item = check_role_incident_types_permissions_item( - incident_types_permissions_item_data - ) + for incident_types_permissions_item_data in _incident_types_permissions or []: + incident_types_permissions_item = check_role_incident_types_permissions_item( + incident_types_permissions_item_data + ) - incident_types_permissions.append(incident_types_permissions_item) + incident_types_permissions.append(incident_types_permissions_item) + incidents_permissions = [] _incidents_permissions = d.pop("incidents_permissions", UNSET) - incidents_permissions: list[RoleIncidentsPermissionsItem] | Unset = UNSET - if _incidents_permissions is not UNSET: - incidents_permissions = [] - for incidents_permissions_item_data in _incidents_permissions: - incidents_permissions_item = check_role_incidents_permissions_item(incidents_permissions_item_data) + for incidents_permissions_item_data in _incidents_permissions or []: + incidents_permissions_item = check_role_incidents_permissions_item(incidents_permissions_item_data) - incidents_permissions.append(incidents_permissions_item) + incidents_permissions.append(incidents_permissions_item) + integrations_permissions = [] _integrations_permissions = d.pop("integrations_permissions", UNSET) - integrations_permissions: list[RoleIntegrationsPermissionsItem] | Unset = UNSET - if _integrations_permissions is not UNSET: - integrations_permissions = [] - for integrations_permissions_item_data in _integrations_permissions: - integrations_permissions_item = check_role_integrations_permissions_item( - integrations_permissions_item_data - ) + for integrations_permissions_item_data in _integrations_permissions or []: + integrations_permissions_item = check_role_integrations_permissions_item(integrations_permissions_item_data) - integrations_permissions.append(integrations_permissions_item) + integrations_permissions.append(integrations_permissions_item) + invitations_permissions = [] _invitations_permissions = d.pop("invitations_permissions", UNSET) - invitations_permissions: list[RoleInvitationsPermissionsItem] | Unset = UNSET - if _invitations_permissions is not UNSET: - invitations_permissions = [] - for invitations_permissions_item_data in _invitations_permissions: - invitations_permissions_item = check_role_invitations_permissions_item( - invitations_permissions_item_data - ) + for invitations_permissions_item_data in _invitations_permissions or []: + invitations_permissions_item = check_role_invitations_permissions_item(invitations_permissions_item_data) - invitations_permissions.append(invitations_permissions_item) + invitations_permissions.append(invitations_permissions_item) + playbooks_permissions = [] _playbooks_permissions = d.pop("playbooks_permissions", UNSET) - playbooks_permissions: list[RolePlaybooksPermissionsItem] | Unset = UNSET - if _playbooks_permissions is not UNSET: - playbooks_permissions = [] - for playbooks_permissions_item_data in _playbooks_permissions: - playbooks_permissions_item = check_role_playbooks_permissions_item(playbooks_permissions_item_data) + for playbooks_permissions_item_data in _playbooks_permissions or []: + playbooks_permissions_item = check_role_playbooks_permissions_item(playbooks_permissions_item_data) - playbooks_permissions.append(playbooks_permissions_item) + playbooks_permissions.append(playbooks_permissions_item) + private_incidents_permissions = [] _private_incidents_permissions = d.pop("private_incidents_permissions", UNSET) - private_incidents_permissions: list[RolePrivateIncidentsPermissionsItem] | Unset = UNSET - if _private_incidents_permissions is not UNSET: - private_incidents_permissions = [] - for private_incidents_permissions_item_data in _private_incidents_permissions: - private_incidents_permissions_item = check_role_private_incidents_permissions_item( - private_incidents_permissions_item_data - ) + for private_incidents_permissions_item_data in _private_incidents_permissions or []: + private_incidents_permissions_item = check_role_private_incidents_permissions_item( + private_incidents_permissions_item_data + ) - private_incidents_permissions.append(private_incidents_permissions_item) + private_incidents_permissions.append(private_incidents_permissions_item) + pulses_permissions = [] _pulses_permissions = d.pop("pulses_permissions", UNSET) - pulses_permissions: list[RolePulsesPermissionsItem] | Unset = UNSET - if _pulses_permissions is not UNSET: - pulses_permissions = [] - for pulses_permissions_item_data in _pulses_permissions: - pulses_permissions_item = check_role_pulses_permissions_item(pulses_permissions_item_data) + for pulses_permissions_item_data in _pulses_permissions or []: + pulses_permissions_item = check_role_pulses_permissions_item(pulses_permissions_item_data) - pulses_permissions.append(pulses_permissions_item) + pulses_permissions.append(pulses_permissions_item) + retrospective_permissions = [] _retrospective_permissions = d.pop("retrospective_permissions", UNSET) - retrospective_permissions: list[RoleRetrospectivePermissionsItem] | Unset = UNSET - if _retrospective_permissions is not UNSET: - retrospective_permissions = [] - for retrospective_permissions_item_data in _retrospective_permissions: - retrospective_permissions_item = check_role_retrospective_permissions_item( - retrospective_permissions_item_data - ) + for retrospective_permissions_item_data in _retrospective_permissions or []: + retrospective_permissions_item = check_role_retrospective_permissions_item( + retrospective_permissions_item_data + ) - retrospective_permissions.append(retrospective_permissions_item) + retrospective_permissions.append(retrospective_permissions_item) + roles_permissions = [] _roles_permissions = d.pop("roles_permissions", UNSET) - roles_permissions: list[RoleRolesPermissionsItem] | Unset = UNSET - if _roles_permissions is not UNSET: - roles_permissions = [] - for roles_permissions_item_data in _roles_permissions: - roles_permissions_item = check_role_roles_permissions_item(roles_permissions_item_data) + for roles_permissions_item_data in _roles_permissions or []: + roles_permissions_item = check_role_roles_permissions_item(roles_permissions_item_data) - roles_permissions.append(roles_permissions_item) + roles_permissions.append(roles_permissions_item) + secrets_permissions = [] _secrets_permissions = d.pop("secrets_permissions", UNSET) - secrets_permissions: list[RoleSecretsPermissionsItem] | Unset = UNSET - if _secrets_permissions is not UNSET: - secrets_permissions = [] - for secrets_permissions_item_data in _secrets_permissions: - secrets_permissions_item = check_role_secrets_permissions_item(secrets_permissions_item_data) + for secrets_permissions_item_data in _secrets_permissions or []: + secrets_permissions_item = check_role_secrets_permissions_item(secrets_permissions_item_data) - secrets_permissions.append(secrets_permissions_item) + secrets_permissions.append(secrets_permissions_item) + services_permissions = [] _services_permissions = d.pop("services_permissions", UNSET) - services_permissions: list[RoleServicesPermissionsItem] | Unset = UNSET - if _services_permissions is not UNSET: - services_permissions = [] - for services_permissions_item_data in _services_permissions: - services_permissions_item = check_role_services_permissions_item(services_permissions_item_data) + for services_permissions_item_data in _services_permissions or []: + services_permissions_item = check_role_services_permissions_item(services_permissions_item_data) - services_permissions.append(services_permissions_item) + services_permissions.append(services_permissions_item) + severities_permissions = [] _severities_permissions = d.pop("severities_permissions", UNSET) - severities_permissions: list[RoleSeveritiesPermissionsItem] | Unset = UNSET - if _severities_permissions is not UNSET: - severities_permissions = [] - for severities_permissions_item_data in _severities_permissions: - severities_permissions_item = check_role_severities_permissions_item(severities_permissions_item_data) + for severities_permissions_item_data in _severities_permissions or []: + severities_permissions_item = check_role_severities_permissions_item(severities_permissions_item_data) - severities_permissions.append(severities_permissions_item) + severities_permissions.append(severities_permissions_item) + status_pages_permissions = [] _status_pages_permissions = d.pop("status_pages_permissions", UNSET) - status_pages_permissions: list[RoleStatusPagesPermissionsItem] | Unset = UNSET - if _status_pages_permissions is not UNSET: - status_pages_permissions = [] - for status_pages_permissions_item_data in _status_pages_permissions: - status_pages_permissions_item = check_role_status_pages_permissions_item( - status_pages_permissions_item_data - ) + for status_pages_permissions_item_data in _status_pages_permissions or []: + status_pages_permissions_item = check_role_status_pages_permissions_item(status_pages_permissions_item_data) - status_pages_permissions.append(status_pages_permissions_item) + status_pages_permissions.append(status_pages_permissions_item) + webhooks_permissions = [] _webhooks_permissions = d.pop("webhooks_permissions", UNSET) - webhooks_permissions: list[RoleWebhooksPermissionsItem] | Unset = UNSET - if _webhooks_permissions is not UNSET: - webhooks_permissions = [] - for webhooks_permissions_item_data in _webhooks_permissions: - webhooks_permissions_item = check_role_webhooks_permissions_item(webhooks_permissions_item_data) + for webhooks_permissions_item_data in _webhooks_permissions or []: + webhooks_permissions_item = check_role_webhooks_permissions_item(webhooks_permissions_item_data) - webhooks_permissions.append(webhooks_permissions_item) + webhooks_permissions.append(webhooks_permissions_item) + workflows_permissions = [] _workflows_permissions = d.pop("workflows_permissions", UNSET) - workflows_permissions: list[RoleWorkflowsPermissionsItem] | Unset = UNSET - if _workflows_permissions is not UNSET: - workflows_permissions = [] - for workflows_permissions_item_data in _workflows_permissions: - workflows_permissions_item = check_role_workflows_permissions_item(workflows_permissions_item_data) + for workflows_permissions_item_data in _workflows_permissions or []: + workflows_permissions_item = check_role_workflows_permissions_item(workflows_permissions_item_data) - workflows_permissions.append(workflows_permissions_item) + workflows_permissions.append(workflows_permissions_item) + catalogs_permissions = [] _catalogs_permissions = d.pop("catalogs_permissions", UNSET) - catalogs_permissions: list[RoleCatalogsPermissionsItem] | Unset = UNSET - if _catalogs_permissions is not UNSET: - catalogs_permissions = [] - for catalogs_permissions_item_data in _catalogs_permissions: - catalogs_permissions_item = check_role_catalogs_permissions_item(catalogs_permissions_item_data) + for catalogs_permissions_item_data in _catalogs_permissions or []: + catalogs_permissions_item = check_role_catalogs_permissions_item(catalogs_permissions_item_data) - catalogs_permissions.append(catalogs_permissions_item) + catalogs_permissions.append(catalogs_permissions_item) + sub_statuses_permissions = [] _sub_statuses_permissions = d.pop("sub_statuses_permissions", UNSET) - sub_statuses_permissions: list[RoleSubStatusesPermissionsItem] | Unset = UNSET - if _sub_statuses_permissions is not UNSET: - sub_statuses_permissions = [] - for sub_statuses_permissions_item_data in _sub_statuses_permissions: - sub_statuses_permissions_item = check_role_sub_statuses_permissions_item( - sub_statuses_permissions_item_data - ) + for sub_statuses_permissions_item_data in _sub_statuses_permissions or []: + sub_statuses_permissions_item = check_role_sub_statuses_permissions_item(sub_statuses_permissions_item_data) - sub_statuses_permissions.append(sub_statuses_permissions_item) + sub_statuses_permissions.append(sub_statuses_permissions_item) + edge_connector_permissions = [] _edge_connector_permissions = d.pop("edge_connector_permissions", UNSET) - edge_connector_permissions: list[RoleEdgeConnectorPermissionsItem] | Unset = UNSET - if _edge_connector_permissions is not UNSET: - edge_connector_permissions = [] - for edge_connector_permissions_item_data in _edge_connector_permissions: - edge_connector_permissions_item = check_role_edge_connector_permissions_item( - edge_connector_permissions_item_data - ) + for edge_connector_permissions_item_data in _edge_connector_permissions or []: + edge_connector_permissions_item = check_role_edge_connector_permissions_item( + edge_connector_permissions_item_data + ) - edge_connector_permissions.append(edge_connector_permissions_item) + edge_connector_permissions.append(edge_connector_permissions_item) + slas_permissions = [] _slas_permissions = d.pop("slas_permissions", UNSET) - slas_permissions: list[RoleSlasPermissionsItem] | Unset = UNSET - if _slas_permissions is not UNSET: - slas_permissions = [] - for slas_permissions_item_data in _slas_permissions: - slas_permissions_item = check_role_slas_permissions_item(slas_permissions_item_data) + for slas_permissions_item_data in _slas_permissions or []: + slas_permissions_item = check_role_slas_permissions_item(slas_permissions_item_data) - slas_permissions.append(slas_permissions_item) + slas_permissions.append(slas_permissions_item) + paging_permissions = [] _paging_permissions = d.pop("paging_permissions", UNSET) - paging_permissions: list[RolePagingPermissionsItem] | Unset = UNSET - if _paging_permissions is not UNSET: - paging_permissions = [] - for paging_permissions_item_data in _paging_permissions: - paging_permissions_item = check_role_paging_permissions_item(paging_permissions_item_data) + for paging_permissions_item_data in _paging_permissions or []: + paging_permissions_item = check_role_paging_permissions_item(paging_permissions_item_data) - paging_permissions.append(paging_permissions_item) + paging_permissions.append(paging_permissions_item) + incident_communication_permissions = [] _incident_communication_permissions = d.pop("incident_communication_permissions", UNSET) - incident_communication_permissions: list[RoleIncidentCommunicationPermissionsItem] | Unset = UNSET - if _incident_communication_permissions is not UNSET: - incident_communication_permissions = [] - for incident_communication_permissions_item_data in _incident_communication_permissions: - incident_communication_permissions_item = check_role_incident_communication_permissions_item( - incident_communication_permissions_item_data - ) + for incident_communication_permissions_item_data in _incident_communication_permissions or []: + incident_communication_permissions_item = check_role_incident_communication_permissions_item( + incident_communication_permissions_item_data + ) - incident_communication_permissions.append(incident_communication_permissions_item) + incident_communication_permissions.append(incident_communication_permissions_item) + communication_permissions = [] _communication_permissions = d.pop("communication_permissions", UNSET) - communication_permissions: list[RoleCommunicationPermissionsItem] | Unset = UNSET - if _communication_permissions is not UNSET: - communication_permissions = [] - for communication_permissions_item_data in _communication_permissions: - communication_permissions_item = check_role_communication_permissions_item( - communication_permissions_item_data - ) + for communication_permissions_item_data in _communication_permissions or []: + communication_permissions_item = check_role_communication_permissions_item( + communication_permissions_item_data + ) - communication_permissions.append(communication_permissions_item) + communication_permissions.append(communication_permissions_item) role = cls( name=name, diff --git a/rootly_sdk/models/role_list.py b/rootly_sdk/models/role_list.py index 84c2a73f..dc988965 100644 --- a/rootly_sdk/models/role_list.py +++ b/rootly_sdk/models/role_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,20 +20,19 @@ class RoleList: """ Attributes: - data (list[RoleListDataItem]): + data (list['RoleListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[RoleListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["RoleListDataItem"] + links: "Links" + meta: "Meta" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) role_list = cls( data=data, diff --git a/rootly_sdk/models/role_list_data_item.py b/rootly_sdk/models/role_list_data_item.py index 71ba6db3..438b2303 100644 --- a/rootly_sdk/models/role_list_data_item.py +++ b/rootly_sdk/models/role_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class RoleListDataItem: id: str type_: RoleListDataItemType - attributes: Role + attributes: "Role" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/role_relationship.py b/rootly_sdk/models/role_relationship.py index a8a730e0..416aeb1a 100644 --- a/rootly_sdk/models/role_relationship.py +++ b/rootly_sdk/models/role_relationship.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,16 +17,16 @@ class RoleRelationship: """ Attributes: - data (None | RoleRelationshipDataType0 | Unset): + data (Union['RoleRelationshipDataType0', None, Unset]): """ - data: None | RoleRelationshipDataType0 | Unset = UNSET + data: Union["RoleRelationshipDataType0", None, Unset] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: from ..models.role_relationship_data_type_0 import RoleRelationshipDataType0 - data: dict[str, Any] | None | Unset + data: Union[None, Unset, dict[str, Any]] if isinstance(self.data, Unset): data = UNSET elif isinstance(self.data, RoleRelationshipDataType0): @@ -50,7 +48,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_data(data: object) -> None | RoleRelationshipDataType0 | Unset: + def _parse_data(data: object) -> Union["RoleRelationshipDataType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -61,9 +59,9 @@ def _parse_data(data: object) -> None | RoleRelationshipDataType0 | Unset: data_type_0 = RoleRelationshipDataType0.from_dict(data) return data_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(None | RoleRelationshipDataType0 | Unset, data) + return cast(Union["RoleRelationshipDataType0", None, Unset], data) data = _parse_data(d.pop("data", UNSET)) diff --git a/rootly_sdk/models/role_relationship_data_type_0.py b/rootly_sdk/models/role_relationship_data_type_0.py index 6a7576ec..0b449301 100644 --- a/rootly_sdk/models/role_relationship_data_type_0.py +++ b/rootly_sdk/models/role_relationship_data_type_0.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,18 +17,18 @@ class RoleRelationshipDataType0: """ Attributes: - id (str | Unset): - type_ (RoleRelationshipDataType0Type | Unset): + id (Union[Unset, str]): + type_ (Union[Unset, RoleRelationshipDataType0Type]): """ - id: str | Unset = UNSET - type_: RoleRelationshipDataType0Type | Unset = UNSET + id: Union[Unset, str] = UNSET + type_: Union[Unset, RoleRelationshipDataType0Type] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: id = self.id - type_: str | Unset = UNSET + type_: Union[Unset, str] = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ @@ -50,7 +48,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: id = d.pop("id", UNSET) _type_ = d.pop("type", UNSET) - type_: RoleRelationshipDataType0Type | Unset + type_: Union[Unset, RoleRelationshipDataType0Type] if isinstance(_type_, Unset): type_ = UNSET else: diff --git a/rootly_sdk/models/role_response.py b/rootly_sdk/models/role_response.py index a8768453..1cfdcb50 100644 --- a/rootly_sdk/models/role_response.py +++ b/rootly_sdk/models/role_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,18 +19,17 @@ class RoleResponse: """ Attributes: data (RoleResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: RoleResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "RoleResponseData" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = RoleResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) role_response = cls( data=data, diff --git a/rootly_sdk/models/role_response_data.py b/rootly_sdk/models/role_response_data.py index a238ec70..d1400829 100644 --- a/rootly_sdk/models/role_response_data.py +++ b/rootly_sdk/models/role_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class RoleResponseData: id: str type_: RoleResponseDataType - attributes: Role + attributes: "Role" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/rotate_api_key.py b/rootly_sdk/models/rotate_api_key.py index 1b5e928b..3b4d42ab 100644 --- a/rootly_sdk/models/rotate_api_key.py +++ b/rootly_sdk/models/rotate_api_key.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class RotateApiKey: data (RotateApiKeyData): """ - data: RotateApiKeyData + data: "RotateApiKeyData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/rotate_api_key_data.py b/rootly_sdk/models/rotate_api_key_data.py index be73db86..c5409b88 100644 --- a/rootly_sdk/models/rotate_api_key_data.py +++ b/rootly_sdk/models/rotate_api_key_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class RotateApiKeyData: """ type_: RotateApiKeyDataType - attributes: RotateApiKeyDataAttributes + attributes: "RotateApiKeyDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/rotate_api_key_data_attributes.py b/rootly_sdk/models/rotate_api_key_data_attributes.py index a65b88c0..f7f599a9 100644 --- a/rootly_sdk/models/rotate_api_key_data_attributes.py +++ b/rootly_sdk/models/rotate_api_key_data_attributes.py @@ -1,8 +1,6 @@ -from __future__ import annotations - import datetime from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from dateutil.parser import isoparse @@ -16,16 +14,16 @@ class RotateApiKeyDataAttributes: """ Attributes: - expires_at (datetime.datetime | None | Unset): The new expiration date after rotation (ISO 8601) - grace_period_minutes (int | Unset): How many minutes to keep the old token valid. Only applies when the grace - period feature is enabled for your organization. Defaults to 30. Default: 30. + expires_at (Union[None, Unset, datetime.datetime]): The new expiration date after rotation (ISO 8601) + grace_period_minutes (Union[Unset, int]): How many minutes to keep the old token valid. Only applies when the + grace period feature is enabled for your organization. Defaults to 30. Default: 30. """ - expires_at: datetime.datetime | None | Unset = UNSET - grace_period_minutes: int | Unset = 30 + expires_at: Union[None, Unset, datetime.datetime] = UNSET + grace_period_minutes: Union[Unset, int] = 30 def to_dict(self) -> dict[str, Any]: - expires_at: None | str | Unset + expires_at: Union[None, Unset, str] if isinstance(self.expires_at, Unset): expires_at = UNSET elif isinstance(self.expires_at, datetime.datetime): @@ -49,7 +47,7 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_expires_at(data: object) -> datetime.datetime | None | Unset: + def _parse_expires_at(data: object) -> Union[None, Unset, datetime.datetime]: if data is None: return data if isinstance(data, Unset): @@ -60,9 +58,9 @@ def _parse_expires_at(data: object) -> datetime.datetime | None | Unset: expires_at_type_0 = isoparse(data) return expires_at_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(datetime.datetime | None | Unset, data) + return cast(Union[None, Unset, datetime.datetime], data) expires_at = _parse_expires_at(d.pop("expires_at", UNSET)) diff --git a/rootly_sdk/models/run_command_heroku_task_params.py b/rootly_sdk/models/run_command_heroku_task_params.py index cfc9232e..22a205b9 100644 --- a/rootly_sdk/models/run_command_heroku_task_params.py +++ b/rootly_sdk/models/run_command_heroku_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -32,34 +30,33 @@ class RunCommandHerokuTaskParams: command (str): app_name (str): size (RunCommandHerokuTaskParamsSize): - task_type (RunCommandHerokuTaskParamsTaskType | Unset): - post_to_incident_timeline (bool | Unset): - post_to_slack_channels (list[RunCommandHerokuTaskParamsPostToSlackChannelsItem] | Unset): + task_type (Union[Unset, RunCommandHerokuTaskParamsTaskType]): + post_to_incident_timeline (Union[Unset, bool]): + post_to_slack_channels (Union[Unset, list['RunCommandHerokuTaskParamsPostToSlackChannelsItem']]): """ command: str app_name: str size: RunCommandHerokuTaskParamsSize - task_type: RunCommandHerokuTaskParamsTaskType | Unset = UNSET - post_to_incident_timeline: bool | Unset = UNSET - post_to_slack_channels: list[RunCommandHerokuTaskParamsPostToSlackChannelsItem] | Unset = UNSET + task_type: Union[Unset, RunCommandHerokuTaskParamsTaskType] = UNSET + post_to_incident_timeline: Union[Unset, bool] = UNSET + post_to_slack_channels: Union[Unset, list["RunCommandHerokuTaskParamsPostToSlackChannelsItem"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - command = self.command app_name = self.app_name size: str = self.size - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type post_to_incident_timeline = self.post_to_incident_timeline - post_to_slack_channels: list[dict[str, Any]] | Unset = UNSET + post_to_slack_channels: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.post_to_slack_channels, Unset): post_to_slack_channels = [] for post_to_slack_channels_item_data in self.post_to_slack_channels: @@ -98,7 +95,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: size = check_run_command_heroku_task_params_size(d.pop("size")) _task_type = d.pop("task_type", UNSET) - task_type: RunCommandHerokuTaskParamsTaskType | Unset + task_type: Union[Unset, RunCommandHerokuTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: @@ -106,16 +103,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: post_to_incident_timeline = d.pop("post_to_incident_timeline", UNSET) + post_to_slack_channels = [] _post_to_slack_channels = d.pop("post_to_slack_channels", UNSET) - post_to_slack_channels: list[RunCommandHerokuTaskParamsPostToSlackChannelsItem] | Unset = UNSET - if _post_to_slack_channels is not UNSET: - post_to_slack_channels = [] - for post_to_slack_channels_item_data in _post_to_slack_channels: - post_to_slack_channels_item = RunCommandHerokuTaskParamsPostToSlackChannelsItem.from_dict( - post_to_slack_channels_item_data - ) + for post_to_slack_channels_item_data in _post_to_slack_channels or []: + post_to_slack_channels_item = RunCommandHerokuTaskParamsPostToSlackChannelsItem.from_dict( + post_to_slack_channels_item_data + ) - post_to_slack_channels.append(post_to_slack_channels_item) + post_to_slack_channels.append(post_to_slack_channels_item) run_command_heroku_task_params = cls( command=command, diff --git a/rootly_sdk/models/run_command_heroku_task_params_post_to_slack_channels_item.py b/rootly_sdk/models/run_command_heroku_task_params_post_to_slack_channels_item.py index 034627af..9f903c50 100644 --- a/rootly_sdk/models/run_command_heroku_task_params_post_to_slack_channels_item.py +++ b/rootly_sdk/models/run_command_heroku_task_params_post_to_slack_channels_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class RunCommandHerokuTaskParamsPostToSlackChannelsItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/schedule.py b/rootly_sdk/models/schedule.py index a876f69e..baadb11e 100644 --- a/rootly_sdk/models/schedule.py +++ b/rootly_sdk/models/schedule.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -28,42 +26,45 @@ class Schedule: owner_user_id (int): ID of user assigned as owner of the schedule created_at (str): Date of creation updated_at (str): Date of last update - description (None | str | Unset): The description of the schedule - all_time_coverage (bool | None | Unset): 24/7 coverage of the schedule - slack_user_group (None | ScheduleSlackUserGroupType0 | Unset): Synced slack group of the schedule - slack_channel (None | ScheduleSlackChannelType0 | Unset): Synced slack channel of the schedule - owner_group_ids (list[str] | Unset): Owning teams. - sync_linear_enabled (bool | Unset): Whether the schedule is synced with Linear - include_shadows_in_slack_notifications (bool | Unset): Whether shadow users are included in Slack notifications - and user group syncing. Requires `slack_channel` to be set; otherwise this value is forced to false on save. - shift_start_notifications_enabled (bool | Unset): Whether shift-start notifications are enabled. Requires - `slack_channel` to be set; otherwise this value is forced to false on save. - shift_update_notifications_enabled (bool | Unset): Whether shift-update notifications are enabled. Requires + description (Union[None, Unset, str]): The description of the schedule + all_time_coverage (Union[None, Unset, bool]): 24/7 coverage of the schedule + slack_user_group (Union['ScheduleSlackUserGroupType0', None, Unset]): Synced slack group of the schedule + slack_channel (Union['ScheduleSlackChannelType0', None, Unset]): Synced slack channel of the schedule + owner_group_ids (Union[Unset, list[str]]): Owning teams. + sync_linear_enabled (Union[Unset, bool]): Whether the schedule is synced with Linear + include_shadows_in_slack_notifications (Union[Unset, bool]): Whether shadow users are included in Slack + notifications and user group syncing. Requires `slack_channel` to be set; otherwise this value is forced to + false on save. + shift_start_notifications_enabled (Union[Unset, bool]): Whether shift-start notifications are enabled. Requires `slack_channel` to be set; otherwise this value is forced to false on save. - shift_report_enabled (bool | Unset): Whether the weekly shift summary report is enabled. Requires + shift_update_notifications_enabled (Union[Unset, bool]): Whether shift-update notifications are enabled. + Requires `slack_channel` to be set; otherwise this value is forced to false on save. + shift_report_enabled (Union[Unset, bool]): Whether the weekly shift summary report is enabled. Requires `slack_channel` to be set; otherwise this value is forced to false on save. - shift_report_day_of_week (ScheduleShiftReportDayOfWeek | Unset): Day of week the weekly shift summary is sent - shift_report_time_of_day (str | Unset): Time of day the weekly shift summary is sent, in HH:MM 24-hour format - shift_report_time_zone (str | Unset): IANA time zone used for the weekly shift summary + shift_report_day_of_week (Union[Unset, ScheduleShiftReportDayOfWeek]): Day of week the weekly shift summary is + sent + shift_report_time_of_day (Union[Unset, str]): Time of day the weekly shift summary is sent, in HH:MM 24-hour + format + shift_report_time_zone (Union[Unset, str]): IANA time zone used for the weekly shift summary """ name: str owner_user_id: int created_at: str updated_at: str - description: None | str | Unset = UNSET - all_time_coverage: bool | None | Unset = UNSET - slack_user_group: None | ScheduleSlackUserGroupType0 | Unset = UNSET - slack_channel: None | ScheduleSlackChannelType0 | Unset = UNSET - owner_group_ids: list[str] | Unset = UNSET - sync_linear_enabled: bool | Unset = UNSET - include_shadows_in_slack_notifications: bool | Unset = UNSET - shift_start_notifications_enabled: bool | Unset = UNSET - shift_update_notifications_enabled: bool | Unset = UNSET - shift_report_enabled: bool | Unset = UNSET - shift_report_day_of_week: ScheduleShiftReportDayOfWeek | Unset = UNSET - shift_report_time_of_day: str | Unset = UNSET - shift_report_time_zone: str | Unset = UNSET + description: Union[None, Unset, str] = UNSET + all_time_coverage: Union[None, Unset, bool] = UNSET + slack_user_group: Union["ScheduleSlackUserGroupType0", None, Unset] = UNSET + slack_channel: Union["ScheduleSlackChannelType0", None, Unset] = UNSET + owner_group_ids: Union[Unset, list[str]] = UNSET + sync_linear_enabled: Union[Unset, bool] = UNSET + include_shadows_in_slack_notifications: Union[Unset, bool] = UNSET + shift_start_notifications_enabled: Union[Unset, bool] = UNSET + shift_update_notifications_enabled: Union[Unset, bool] = UNSET + shift_report_enabled: Union[Unset, bool] = UNSET + shift_report_day_of_week: Union[Unset, ScheduleShiftReportDayOfWeek] = UNSET + shift_report_time_of_day: Union[Unset, str] = UNSET + shift_report_time_zone: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -78,19 +79,19 @@ def to_dict(self) -> dict[str, Any]: updated_at = self.updated_at - description: None | str | Unset + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: description = self.description - all_time_coverage: bool | None | Unset + all_time_coverage: Union[None, Unset, bool] if isinstance(self.all_time_coverage, Unset): all_time_coverage = UNSET else: all_time_coverage = self.all_time_coverage - slack_user_group: dict[str, Any] | None | Unset + slack_user_group: Union[None, Unset, dict[str, Any]] if isinstance(self.slack_user_group, Unset): slack_user_group = UNSET elif isinstance(self.slack_user_group, ScheduleSlackUserGroupType0): @@ -98,7 +99,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_user_group = self.slack_user_group - slack_channel: dict[str, Any] | None | Unset + slack_channel: Union[None, Unset, dict[str, Any]] if isinstance(self.slack_channel, Unset): slack_channel = UNSET elif isinstance(self.slack_channel, ScheduleSlackChannelType0): @@ -106,7 +107,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_channel = self.slack_channel - owner_group_ids: list[str] | Unset = UNSET + owner_group_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.owner_group_ids, Unset): owner_group_ids = self.owner_group_ids @@ -120,7 +121,7 @@ def to_dict(self) -> dict[str, Any]: shift_report_enabled = self.shift_report_enabled - shift_report_day_of_week: str | Unset = UNSET + shift_report_day_of_week: Union[Unset, str] = UNSET if not isinstance(self.shift_report_day_of_week, Unset): shift_report_day_of_week = self.shift_report_day_of_week @@ -181,25 +182,25 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: updated_at = d.pop("updated_at") - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) - def _parse_all_time_coverage(data: object) -> bool | None | Unset: + def _parse_all_time_coverage(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) all_time_coverage = _parse_all_time_coverage(d.pop("all_time_coverage", UNSET)) - def _parse_slack_user_group(data: object) -> None | ScheduleSlackUserGroupType0 | Unset: + def _parse_slack_user_group(data: object) -> Union["ScheduleSlackUserGroupType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -210,13 +211,13 @@ def _parse_slack_user_group(data: object) -> None | ScheduleSlackUserGroupType0 slack_user_group_type_0 = ScheduleSlackUserGroupType0.from_dict(data) return slack_user_group_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(None | ScheduleSlackUserGroupType0 | Unset, data) + return cast(Union["ScheduleSlackUserGroupType0", None, Unset], data) slack_user_group = _parse_slack_user_group(d.pop("slack_user_group", UNSET)) - def _parse_slack_channel(data: object) -> None | ScheduleSlackChannelType0 | Unset: + def _parse_slack_channel(data: object) -> Union["ScheduleSlackChannelType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -227,9 +228,9 @@ def _parse_slack_channel(data: object) -> None | ScheduleSlackChannelType0 | Uns slack_channel_type_0 = ScheduleSlackChannelType0.from_dict(data) return slack_channel_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(None | ScheduleSlackChannelType0 | Unset, data) + return cast(Union["ScheduleSlackChannelType0", None, Unset], data) slack_channel = _parse_slack_channel(d.pop("slack_channel", UNSET)) @@ -246,7 +247,7 @@ def _parse_slack_channel(data: object) -> None | ScheduleSlackChannelType0 | Uns shift_report_enabled = d.pop("shift_report_enabled", UNSET) _shift_report_day_of_week = d.pop("shift_report_day_of_week", UNSET) - shift_report_day_of_week: ScheduleShiftReportDayOfWeek | Unset + shift_report_day_of_week: Union[Unset, ScheduleShiftReportDayOfWeek] if isinstance(_shift_report_day_of_week, Unset): shift_report_day_of_week = UNSET else: diff --git a/rootly_sdk/models/schedule_list.py b/rootly_sdk/models/schedule_list.py index 1565c112..ae508220 100644 --- a/rootly_sdk/models/schedule_list.py +++ b/rootly_sdk/models/schedule_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,20 +20,19 @@ class ScheduleList: """ Attributes: - data (list[ScheduleListDataItem]): + data (list['ScheduleListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[ScheduleListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["ScheduleListDataItem"] + links: "Links" + meta: "Meta" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) schedule_list = cls( data=data, diff --git a/rootly_sdk/models/schedule_list_data_item.py b/rootly_sdk/models/schedule_list_data_item.py index 9e0cb37f..dee5f4d0 100644 --- a/rootly_sdk/models/schedule_list_data_item.py +++ b/rootly_sdk/models/schedule_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class ScheduleListDataItem: id: str type_: ScheduleListDataItemType - attributes: Schedule + attributes: "Schedule" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/schedule_response.py b/rootly_sdk/models/schedule_response.py index 35a66c8e..c637bfbd 100644 --- a/rootly_sdk/models/schedule_response.py +++ b/rootly_sdk/models/schedule_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,18 +19,17 @@ class ScheduleResponse: """ Attributes: data (ScheduleResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: ScheduleResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "ScheduleResponseData" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = ScheduleResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) schedule_response = cls( data=data, diff --git a/rootly_sdk/models/schedule_response_data.py b/rootly_sdk/models/schedule_response_data.py index 523ab23b..4b483ed5 100644 --- a/rootly_sdk/models/schedule_response_data.py +++ b/rootly_sdk/models/schedule_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class ScheduleResponseData: id: str type_: ScheduleResponseDataType - attributes: Schedule + attributes: "Schedule" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/schedule_rotation.py b/rootly_sdk/models/schedule_rotation.py index 18d78321..933d5e27 100644 --- a/rootly_sdk/models/schedule_rotation.py +++ b/rootly_sdk/models/schedule_rotation.py @@ -1,8 +1,6 @@ -from __future__ import annotations - import datetime from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -44,39 +42,39 @@ class ScheduleRotation: schedule_id (str): The ID of parent schedule name (str): The name of the schedule rotation schedule_rotationable_type (ScheduleRotationScheduleRotationableType): Schedule rotation type - schedule_rotationable_attributes (ScheduleRotationScheduleRotationableAttributesType0 | - ScheduleRotationScheduleRotationableAttributesType1 | ScheduleRotationScheduleRotationableAttributesType2 | - ScheduleRotationScheduleRotationableAttributesType3): - position (int | Unset): Position of the schedule rotation - active_all_week (bool | Unset): Schedule rotation active all week? Default: True. - active_days (list[ScheduleRotationActiveDaysItem] | Unset): - active_time_type (str | Unset): - active_time_attributes (list[ScheduleRotationActiveTimeAttributesItem] | Unset): Schedule rotation's active - times - time_zone (str | Unset): A valid IANA time zone name. Default: 'Etc/UTC'. - start_time (datetime.datetime | None | Unset): RFC3339 date-time when rotation starts. Shifts will only be + schedule_rotationable_attributes (Union['ScheduleRotationScheduleRotationableAttributesType0', + 'ScheduleRotationScheduleRotationableAttributesType1', 'ScheduleRotationScheduleRotationableAttributesType2', + 'ScheduleRotationScheduleRotationableAttributesType3']): + position (Union[Unset, int]): Position of the schedule rotation + active_all_week (Union[Unset, bool]): Schedule rotation active all week? Default: True. + active_days (Union[Unset, list[ScheduleRotationActiveDaysItem]]): + active_time_type (Union[Unset, str]): + active_time_attributes (Union[Unset, list['ScheduleRotationActiveTimeAttributesItem']]): Schedule rotation's + active times + time_zone (Union[Unset, str]): A valid IANA time zone name. Default: 'Etc/UTC'. + start_time (Union[None, Unset, datetime.datetime]): RFC3339 date-time when rotation starts. Shifts will only be created after this time. - end_time (datetime.datetime | None | Unset): RFC3339 date-time when rotation ends. Shifts will only be created - before this time. + end_time (Union[None, Unset, datetime.datetime]): RFC3339 date-time when rotation ends. Shifts will only be + created before this time. """ schedule_id: str name: str schedule_rotationable_type: ScheduleRotationScheduleRotationableType - schedule_rotationable_attributes: ( - ScheduleRotationScheduleRotationableAttributesType0 - | ScheduleRotationScheduleRotationableAttributesType1 - | ScheduleRotationScheduleRotationableAttributesType2 - | ScheduleRotationScheduleRotationableAttributesType3 - ) - position: int | Unset = UNSET - active_all_week: bool | Unset = True - active_days: list[ScheduleRotationActiveDaysItem] | Unset = UNSET - active_time_type: str | Unset = UNSET - active_time_attributes: list[ScheduleRotationActiveTimeAttributesItem] | Unset = UNSET - time_zone: str | Unset = "Etc/UTC" - start_time: datetime.datetime | None | Unset = UNSET - end_time: datetime.datetime | None | Unset = UNSET + schedule_rotationable_attributes: Union[ + "ScheduleRotationScheduleRotationableAttributesType0", + "ScheduleRotationScheduleRotationableAttributesType1", + "ScheduleRotationScheduleRotationableAttributesType2", + "ScheduleRotationScheduleRotationableAttributesType3", + ] + position: Union[Unset, int] = UNSET + active_all_week: Union[Unset, bool] = True + active_days: Union[Unset, list[ScheduleRotationActiveDaysItem]] = UNSET + active_time_type: Union[Unset, str] = UNSET + active_time_attributes: Union[Unset, list["ScheduleRotationActiveTimeAttributesItem"]] = UNSET + time_zone: Union[Unset, str] = "Etc/UTC" + start_time: Union[None, Unset, datetime.datetime] = UNSET + end_time: Union[None, Unset, datetime.datetime] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -110,7 +108,7 @@ def to_dict(self) -> dict[str, Any]: active_all_week = self.active_all_week - active_days: list[str] | Unset = UNSET + active_days: Union[Unset, list[str]] = UNSET if not isinstance(self.active_days, Unset): active_days = [] for active_days_item_data in self.active_days: @@ -119,7 +117,7 @@ def to_dict(self) -> dict[str, Any]: active_time_type = self.active_time_type - active_time_attributes: list[dict[str, Any]] | Unset = UNSET + active_time_attributes: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.active_time_attributes, Unset): active_time_attributes = [] for active_time_attributes_item_data in self.active_time_attributes: @@ -128,7 +126,7 @@ def to_dict(self) -> dict[str, Any]: time_zone = self.time_zone - start_time: None | str | Unset + start_time: Union[None, Unset, str] if isinstance(self.start_time, Unset): start_time = UNSET elif isinstance(self.start_time, datetime.datetime): @@ -136,7 +134,7 @@ def to_dict(self) -> dict[str, Any]: else: start_time = self.start_time - end_time: None | str | Unset + end_time: Union[None, Unset, str] if isinstance(self.end_time, Unset): end_time = UNSET elif isinstance(self.end_time, datetime.datetime): @@ -200,12 +198,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: def _parse_schedule_rotationable_attributes( data: object, - ) -> ( - ScheduleRotationScheduleRotationableAttributesType0 - | ScheduleRotationScheduleRotationableAttributesType1 - | ScheduleRotationScheduleRotationableAttributesType2 - | ScheduleRotationScheduleRotationableAttributesType3 - ): + ) -> Union[ + "ScheduleRotationScheduleRotationableAttributesType0", + "ScheduleRotationScheduleRotationableAttributesType1", + "ScheduleRotationScheduleRotationableAttributesType2", + "ScheduleRotationScheduleRotationableAttributesType3", + ]: try: if not isinstance(data, dict): raise TypeError() @@ -214,7 +212,7 @@ def _parse_schedule_rotationable_attributes( ) return schedule_rotationable_attributes_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -224,7 +222,7 @@ def _parse_schedule_rotationable_attributes( ) return schedule_rotationable_attributes_type_1 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -234,7 +232,7 @@ def _parse_schedule_rotationable_attributes( ) return schedule_rotationable_attributes_type_2 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass if not isinstance(data, dict): raise TypeError() @@ -252,31 +250,27 @@ def _parse_schedule_rotationable_attributes( active_all_week = d.pop("active_all_week", UNSET) + active_days = [] _active_days = d.pop("active_days", UNSET) - active_days: list[ScheduleRotationActiveDaysItem] | Unset = UNSET - if _active_days is not UNSET: - active_days = [] - for active_days_item_data in _active_days: - active_days_item = check_schedule_rotation_active_days_item(active_days_item_data) + for active_days_item_data in _active_days or []: + active_days_item = check_schedule_rotation_active_days_item(active_days_item_data) - active_days.append(active_days_item) + active_days.append(active_days_item) active_time_type = d.pop("active_time_type", UNSET) + active_time_attributes = [] _active_time_attributes = d.pop("active_time_attributes", UNSET) - active_time_attributes: list[ScheduleRotationActiveTimeAttributesItem] | Unset = UNSET - if _active_time_attributes is not UNSET: - active_time_attributes = [] - for active_time_attributes_item_data in _active_time_attributes: - active_time_attributes_item = ScheduleRotationActiveTimeAttributesItem.from_dict( - active_time_attributes_item_data - ) + for active_time_attributes_item_data in _active_time_attributes or []: + active_time_attributes_item = ScheduleRotationActiveTimeAttributesItem.from_dict( + active_time_attributes_item_data + ) - active_time_attributes.append(active_time_attributes_item) + active_time_attributes.append(active_time_attributes_item) time_zone = d.pop("time_zone", UNSET) - def _parse_start_time(data: object) -> datetime.datetime | None | Unset: + def _parse_start_time(data: object) -> Union[None, Unset, datetime.datetime]: if data is None: return data if isinstance(data, Unset): @@ -287,13 +281,13 @@ def _parse_start_time(data: object) -> datetime.datetime | None | Unset: start_time_type_0 = isoparse(data) return start_time_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(datetime.datetime | None | Unset, data) + return cast(Union[None, Unset, datetime.datetime], data) start_time = _parse_start_time(d.pop("start_time", UNSET)) - def _parse_end_time(data: object) -> datetime.datetime | None | Unset: + def _parse_end_time(data: object) -> Union[None, Unset, datetime.datetime]: if data is None: return data if isinstance(data, Unset): @@ -304,9 +298,9 @@ def _parse_end_time(data: object) -> datetime.datetime | None | Unset: end_time_type_0 = isoparse(data) return end_time_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(datetime.datetime | None | Unset, data) + return cast(Union[None, Unset, datetime.datetime], data) end_time = _parse_end_time(d.pop("end_time", UNSET)) diff --git a/rootly_sdk/models/schedule_rotation_active_day.py b/rootly_sdk/models/schedule_rotation_active_day.py index 1410cc1e..f3b1c891 100644 --- a/rootly_sdk/models/schedule_rotation_active_day.py +++ b/rootly_sdk/models/schedule_rotation_active_day.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,21 +24,20 @@ class ScheduleRotationActiveDay: Attributes: schedule_rotation_id (str): day_name (ScheduleRotationActiveDayDayName): Schedule rotation day name for which active times to be created - active_time_attributes (list[ScheduleRotationActiveDayActiveTimeAttributesItem]): Schedule rotation active times - per day + active_time_attributes (list['ScheduleRotationActiveDayActiveTimeAttributesItem']): Schedule rotation active + times per day created_at (str): Date of creation updated_at (str): Date of last update """ schedule_rotation_id: str day_name: ScheduleRotationActiveDayDayName - active_time_attributes: list[ScheduleRotationActiveDayActiveTimeAttributesItem] + active_time_attributes: list["ScheduleRotationActiveDayActiveTimeAttributesItem"] created_at: str updated_at: str additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - schedule_rotation_id = self.schedule_rotation_id day_name: str = self.day_name diff --git a/rootly_sdk/models/schedule_rotation_active_day_active_time_attributes_item.py b/rootly_sdk/models/schedule_rotation_active_day_active_time_attributes_item.py index 8407725b..55fc8ea7 100644 --- a/rootly_sdk/models/schedule_rotation_active_day_active_time_attributes_item.py +++ b/rootly_sdk/models/schedule_rotation_active_day_active_time_attributes_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class ScheduleRotationActiveDayActiveTimeAttributesItem: """ Attributes: - start_time (str | Unset): Start time for schedule rotation active time - end_time (str | Unset): End time for schedule rotation active time + start_time (Union[Unset, str]): Start time for schedule rotation active time + end_time (Union[Unset, str]): End time for schedule rotation active time """ - start_time: str | Unset = UNSET - end_time: str | Unset = UNSET + start_time: Union[Unset, str] = UNSET + end_time: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/schedule_rotation_active_day_list.py b/rootly_sdk/models/schedule_rotation_active_day_list.py index f359204a..f3da6279 100644 --- a/rootly_sdk/models/schedule_rotation_active_day_list.py +++ b/rootly_sdk/models/schedule_rotation_active_day_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,20 +20,19 @@ class ScheduleRotationActiveDayList: """ Attributes: - data (list[ScheduleRotationActiveDayListDataItem]): + data (list['ScheduleRotationActiveDayListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[ScheduleRotationActiveDayListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["ScheduleRotationActiveDayListDataItem"] + links: "Links" + meta: "Meta" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) schedule_rotation_active_day_list = cls( data=data, diff --git a/rootly_sdk/models/schedule_rotation_active_day_list_data_item.py b/rootly_sdk/models/schedule_rotation_active_day_list_data_item.py index 4b9438f4..e5f8d111 100644 --- a/rootly_sdk/models/schedule_rotation_active_day_list_data_item.py +++ b/rootly_sdk/models/schedule_rotation_active_day_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class ScheduleRotationActiveDayListDataItem: id: str type_: ScheduleRotationActiveDayListDataItemType - attributes: ScheduleRotationActiveDay + attributes: "ScheduleRotationActiveDay" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/schedule_rotation_active_day_response.py b/rootly_sdk/models/schedule_rotation_active_day_response.py index bd8158a0..51843698 100644 --- a/rootly_sdk/models/schedule_rotation_active_day_response.py +++ b/rootly_sdk/models/schedule_rotation_active_day_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -20,21 +18,20 @@ class ScheduleRotationActiveDayResponse: """ Attributes: - data (ScheduleRotationActiveDayResponseData | Unset): - included (list[JsonapiIncludedResource] | Unset): + data (Union[Unset, ScheduleRotationActiveDayResponseData]): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: ScheduleRotationActiveDayResponseData | Unset = UNSET - included: list[JsonapiIncludedResource] | Unset = UNSET + data: Union[Unset, "ScheduleRotationActiveDayResponseData"] = UNSET + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - - data: dict[str, Any] | Unset = UNSET + data: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.data, Unset): data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -58,20 +55,18 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _data = d.pop("data", UNSET) - data: ScheduleRotationActiveDayResponseData | Unset + data: Union[Unset, ScheduleRotationActiveDayResponseData] if isinstance(_data, Unset): data = UNSET else: data = ScheduleRotationActiveDayResponseData.from_dict(_data) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) schedule_rotation_active_day_response = cls( data=data, diff --git a/rootly_sdk/models/schedule_rotation_active_day_response_data.py b/rootly_sdk/models/schedule_rotation_active_day_response_data.py index c24c7a76..db954886 100644 --- a/rootly_sdk/models/schedule_rotation_active_day_response_data.py +++ b/rootly_sdk/models/schedule_rotation_active_day_response_data.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,25 +21,24 @@ class ScheduleRotationActiveDayResponseData: """ Attributes: - id (str | Unset): Unique ID of the schedule rotation active time - type_ (ScheduleRotationActiveDayResponseDataType | Unset): - attributes (ScheduleRotationActiveDay | Unset): + id (Union[Unset, str]): Unique ID of the schedule rotation active time + type_ (Union[Unset, ScheduleRotationActiveDayResponseDataType]): + attributes (Union[Unset, ScheduleRotationActiveDay]): """ - id: str | Unset = UNSET - type_: ScheduleRotationActiveDayResponseDataType | Unset = UNSET - attributes: ScheduleRotationActiveDay | Unset = UNSET + id: Union[Unset, str] = UNSET + type_: Union[Unset, ScheduleRotationActiveDayResponseDataType] = UNSET + attributes: Union[Unset, "ScheduleRotationActiveDay"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id - type_: str | Unset = UNSET + type_: Union[Unset, str] = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ - attributes: dict[str, Any] | Unset = UNSET + attributes: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.attributes, Unset): attributes = self.attributes.to_dict() @@ -65,14 +62,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: id = d.pop("id", UNSET) _type_ = d.pop("type", UNSET) - type_: ScheduleRotationActiveDayResponseDataType | Unset + type_: Union[Unset, ScheduleRotationActiveDayResponseDataType] if isinstance(_type_, Unset): type_ = UNSET else: type_ = check_schedule_rotation_active_day_response_data_type(_type_) _attributes = d.pop("attributes", UNSET) - attributes: ScheduleRotationActiveDay | Unset + attributes: Union[Unset, ScheduleRotationActiveDay] if isinstance(_attributes, Unset): attributes = UNSET else: diff --git a/rootly_sdk/models/schedule_rotation_active_time_attributes_item.py b/rootly_sdk/models/schedule_rotation_active_time_attributes_item.py index f61260d2..0133b6f5 100644 --- a/rootly_sdk/models/schedule_rotation_active_time_attributes_item.py +++ b/rootly_sdk/models/schedule_rotation_active_time_attributes_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/schedule_rotation_list.py b/rootly_sdk/models/schedule_rotation_list.py index 9881f2ff..66443d0c 100644 --- a/rootly_sdk/models/schedule_rotation_list.py +++ b/rootly_sdk/models/schedule_rotation_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,20 +20,19 @@ class ScheduleRotationList: """ Attributes: - data (list[ScheduleRotationListDataItem]): + data (list['ScheduleRotationListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[ScheduleRotationListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["ScheduleRotationListDataItem"] + links: "Links" + meta: "Meta" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) schedule_rotation_list = cls( data=data, diff --git a/rootly_sdk/models/schedule_rotation_list_data_item.py b/rootly_sdk/models/schedule_rotation_list_data_item.py index 032ca96c..c61c5b9c 100644 --- a/rootly_sdk/models/schedule_rotation_list_data_item.py +++ b/rootly_sdk/models/schedule_rotation_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class ScheduleRotationListDataItem: id: str type_: ScheduleRotationListDataItemType - attributes: ScheduleRotation + attributes: "ScheduleRotation" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/schedule_rotation_response.py b/rootly_sdk/models/schedule_rotation_response.py index 651e9a21..8fa1e883 100644 --- a/rootly_sdk/models/schedule_rotation_response.py +++ b/rootly_sdk/models/schedule_rotation_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,18 +19,17 @@ class ScheduleRotationResponse: """ Attributes: data (ScheduleRotationResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: ScheduleRotationResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "ScheduleRotationResponseData" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = ScheduleRotationResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) schedule_rotation_response = cls( data=data, diff --git a/rootly_sdk/models/schedule_rotation_response_data.py b/rootly_sdk/models/schedule_rotation_response_data.py index 4e1354bb..885266b5 100644 --- a/rootly_sdk/models/schedule_rotation_response_data.py +++ b/rootly_sdk/models/schedule_rotation_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class ScheduleRotationResponseData: id: str type_: ScheduleRotationResponseDataType - attributes: ScheduleRotation + attributes: "ScheduleRotation" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/schedule_rotation_schedule_rotationable_attributes_type_0.py b/rootly_sdk/models/schedule_rotation_schedule_rotationable_attributes_type_0.py index 2cd22b53..6835c072 100644 --- a/rootly_sdk/models/schedule_rotation_schedule_rotationable_attributes_type_0.py +++ b/rootly_sdk/models/schedule_rotation_schedule_rotationable_attributes_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/schedule_rotation_schedule_rotationable_attributes_type_1.py b/rootly_sdk/models/schedule_rotation_schedule_rotationable_attributes_type_1.py index c36e9741..e03a3206 100644 --- a/rootly_sdk/models/schedule_rotation_schedule_rotationable_attributes_type_1.py +++ b/rootly_sdk/models/schedule_rotation_schedule_rotationable_attributes_type_1.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/schedule_rotation_schedule_rotationable_attributes_type_2.py b/rootly_sdk/models/schedule_rotation_schedule_rotationable_attributes_type_2.py index 01e31b7b..b58fca4b 100644 --- a/rootly_sdk/models/schedule_rotation_schedule_rotationable_attributes_type_2.py +++ b/rootly_sdk/models/schedule_rotation_schedule_rotationable_attributes_type_2.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/schedule_rotation_schedule_rotationable_attributes_type_3.py b/rootly_sdk/models/schedule_rotation_schedule_rotationable_attributes_type_3.py index 4134c043..78bf3791 100644 --- a/rootly_sdk/models/schedule_rotation_schedule_rotationable_attributes_type_3.py +++ b/rootly_sdk/models/schedule_rotation_schedule_rotationable_attributes_type_3.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/schedule_rotation_user.py b/rootly_sdk/models/schedule_rotation_user.py index 77738f7a..eb4942e9 100644 --- a/rootly_sdk/models/schedule_rotation_user.py +++ b/rootly_sdk/models/schedule_rotation_user.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/schedule_rotation_user_list.py b/rootly_sdk/models/schedule_rotation_user_list.py index 8eadaa63..b1aaec64 100644 --- a/rootly_sdk/models/schedule_rotation_user_list.py +++ b/rootly_sdk/models/schedule_rotation_user_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,20 +20,19 @@ class ScheduleRotationUserList: """ Attributes: - data (list[ScheduleRotationUserListDataItem]): + data (list['ScheduleRotationUserListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[ScheduleRotationUserListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["ScheduleRotationUserListDataItem"] + links: "Links" + meta: "Meta" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) schedule_rotation_user_list = cls( data=data, diff --git a/rootly_sdk/models/schedule_rotation_user_list_data_item.py b/rootly_sdk/models/schedule_rotation_user_list_data_item.py index 08da3d88..654de35e 100644 --- a/rootly_sdk/models/schedule_rotation_user_list_data_item.py +++ b/rootly_sdk/models/schedule_rotation_user_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class ScheduleRotationUserListDataItem: id: str type_: ScheduleRotationUserListDataItemType - attributes: ScheduleRotationUser + attributes: "ScheduleRotationUser" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/schedule_rotation_user_response.py b/rootly_sdk/models/schedule_rotation_user_response.py index a77b9c0b..4980425e 100644 --- a/rootly_sdk/models/schedule_rotation_user_response.py +++ b/rootly_sdk/models/schedule_rotation_user_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,18 +19,17 @@ class ScheduleRotationUserResponse: """ Attributes: data (ScheduleRotationUserResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: ScheduleRotationUserResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "ScheduleRotationUserResponseData" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = ScheduleRotationUserResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) schedule_rotation_user_response = cls( data=data, diff --git a/rootly_sdk/models/schedule_rotation_user_response_data.py b/rootly_sdk/models/schedule_rotation_user_response_data.py index c13bc9a8..f406ddaf 100644 --- a/rootly_sdk/models/schedule_rotation_user_response_data.py +++ b/rootly_sdk/models/schedule_rotation_user_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class ScheduleRotationUserResponseData: id: str type_: ScheduleRotationUserResponseDataType - attributes: ScheduleRotationUser + attributes: "ScheduleRotationUser" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/schedule_slack_channel_type_0.py b/rootly_sdk/models/schedule_slack_channel_type_0.py index eb26f635..20f0bbb2 100644 --- a/rootly_sdk/models/schedule_slack_channel_type_0.py +++ b/rootly_sdk/models/schedule_slack_channel_type_0.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,12 +14,12 @@ class ScheduleSlackChannelType0: """Synced slack channel of the schedule Attributes: - id (str | Unset): Slack channel ID - name (str | Unset): Slack channel name + id (Union[Unset, str]): Slack channel ID + name (Union[Unset, str]): Slack channel name """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/schedule_slack_user_group_type_0.py b/rootly_sdk/models/schedule_slack_user_group_type_0.py index ac2adf75..de8cbb15 100644 --- a/rootly_sdk/models/schedule_slack_user_group_type_0.py +++ b/rootly_sdk/models/schedule_slack_user_group_type_0.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,12 +14,12 @@ class ScheduleSlackUserGroupType0: """Synced slack group of the schedule Attributes: - id (str | Unset): Slack user group ID - name (str | Unset): Slack user group name + id (Union[Unset, str]): Slack user group ID + name (Union[Unset, str]): Slack user group name """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/secret.py b/rootly_sdk/models/secret.py index 19dae479..d0e57e2a 100644 --- a/rootly_sdk/models/secret.py +++ b/rootly_sdk/models/secret.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -18,19 +16,19 @@ class Secret: name (str): The name of the secret created_at (str): Date of creation updated_at (str): Date of last update - secret (str | Unset): The redacted secret - hashicorp_vault_mount (str | Unset): The HashiCorp Vault secret mount path - hashicorp_vault_path (None | str | Unset): The HashiCorp Vault secret path - hashicorp_vault_version (int | Unset): The HashiCorp Vault secret version + secret (Union[Unset, str]): The redacted secret + hashicorp_vault_mount (Union[Unset, str]): The HashiCorp Vault secret mount path + hashicorp_vault_path (Union[None, Unset, str]): The HashiCorp Vault secret path + hashicorp_vault_version (Union[Unset, int]): The HashiCorp Vault secret version """ name: str created_at: str updated_at: str - secret: str | Unset = UNSET - hashicorp_vault_mount: str | Unset = UNSET - hashicorp_vault_path: None | str | Unset = UNSET - hashicorp_vault_version: int | Unset = UNSET + secret: Union[Unset, str] = UNSET + hashicorp_vault_mount: Union[Unset, str] = UNSET + hashicorp_vault_path: Union[None, Unset, str] = UNSET + hashicorp_vault_version: Union[Unset, int] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -44,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: hashicorp_vault_mount = self.hashicorp_vault_mount - hashicorp_vault_path: None | str | Unset + hashicorp_vault_path: Union[None, Unset, str] if isinstance(self.hashicorp_vault_path, Unset): hashicorp_vault_path = UNSET else: @@ -85,12 +83,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: hashicorp_vault_mount = d.pop("hashicorp_vault_mount", UNSET) - def _parse_hashicorp_vault_path(data: object) -> None | str | Unset: + def _parse_hashicorp_vault_path(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) hashicorp_vault_path = _parse_hashicorp_vault_path(d.pop("hashicorp_vault_path", UNSET)) diff --git a/rootly_sdk/models/secret_list.py b/rootly_sdk/models/secret_list.py index 702a4e5a..d5c71667 100644 --- a/rootly_sdk/models/secret_list.py +++ b/rootly_sdk/models/secret_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,28 +19,27 @@ class SecretList: """ Attributes: - data (list[SecretListDataItem]): - links (Links | Unset): - meta (Meta | Unset): + data (list['SecretListDataItem']): + links (Union[Unset, Links]): + meta (Union[Unset, Meta]): """ - data: list[SecretListDataItem] - links: Links | Unset = UNSET - meta: Meta | Unset = UNSET + data: list["SecretListDataItem"] + links: Union[Unset, "Links"] = UNSET + meta: Union[Unset, "Meta"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() data.append(data_item) - links: dict[str, Any] | Unset = UNSET + links: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.links, Unset): links = self.links.to_dict() - meta: dict[str, Any] | Unset = UNSET + meta: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.meta, Unset): meta = self.meta.to_dict() @@ -75,14 +72,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data.append(data_item) _links = d.pop("links", UNSET) - links: Links | Unset + links: Union[Unset, Links] if isinstance(_links, Unset): links = UNSET else: links = Links.from_dict(_links) _meta = d.pop("meta", UNSET) - meta: Meta | Unset + meta: Union[Unset, Meta] if isinstance(_meta, Unset): meta = UNSET else: diff --git a/rootly_sdk/models/secret_list_data_item.py b/rootly_sdk/models/secret_list_data_item.py index 31a72676..87fbca70 100644 --- a/rootly_sdk/models/secret_list_data_item.py +++ b/rootly_sdk/models/secret_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class SecretListDataItem: id: str type_: SecretListDataItemType - attributes: Secret + attributes: "Secret" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/secret_response.py b/rootly_sdk/models/secret_response.py index 841888e2..d6359e52 100644 --- a/rootly_sdk/models/secret_response.py +++ b/rootly_sdk/models/secret_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class SecretResponse: data (SecretResponseData): """ - data: SecretResponseData + data: "SecretResponseData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/secret_response_data.py b/rootly_sdk/models/secret_response_data.py index e7b5504d..2c776f8e 100644 --- a/rootly_sdk/models/secret_response_data.py +++ b/rootly_sdk/models/secret_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class SecretResponseData: id: str type_: SecretResponseDataType - attributes: Secret + attributes: "Secret" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/send_dashboard_report_task_params.py b/rootly_sdk/models/send_dashboard_report_task_params.py index ee77ed07..4cf9ceb6 100644 --- a/rootly_sdk/models/send_dashboard_report_task_params.py +++ b/rootly_sdk/models/send_dashboard_report_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,20 +20,20 @@ class SendDashboardReportTaskParams: dashboard_ids (list[str]): to (list[str]): subject (str): The subject - body (None | str): The email body - task_type (SendDashboardReportTaskParamsTaskType | Unset): - from_ (str | Unset): The from email address. Need to use SMTP integration if different than rootly.com Default: - 'Rootly '. - preheader (None | str | Unset): The preheader + body (Union[None, str]): The email body + task_type (Union[Unset, SendDashboardReportTaskParamsTaskType]): + from_ (Union[Unset, str]): The from email address. Need to use SMTP integration if different than rootly.com + Default: 'Rootly '. + preheader (Union[None, Unset, str]): The preheader """ dashboard_ids: list[str] to: list[str] subject: str - body: None | str - task_type: SendDashboardReportTaskParamsTaskType | Unset = UNSET - from_: str | Unset = "Rootly " - preheader: None | str | Unset = UNSET + body: Union[None, str] + task_type: Union[Unset, SendDashboardReportTaskParamsTaskType] = UNSET + from_: Union[Unset, str] = "Rootly " + preheader: Union[None, Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -45,16 +43,16 @@ def to_dict(self) -> dict[str, Any]: subject = self.subject - body: None | str + body: Union[None, str] body = self.body - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type from_ = self.from_ - preheader: None | str | Unset + preheader: Union[None, Unset, str] if isinstance(self.preheader, Unset): preheader = UNSET else: @@ -88,15 +86,15 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: subject = d.pop("subject") - def _parse_body(data: object) -> None | str: + def _parse_body(data: object) -> Union[None, str]: if data is None: return data - return cast(None | str, data) + return cast(Union[None, str], data) body = _parse_body(d.pop("body")) _task_type = d.pop("task_type", UNSET) - task_type: SendDashboardReportTaskParamsTaskType | Unset + task_type: Union[Unset, SendDashboardReportTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: @@ -104,12 +102,12 @@ def _parse_body(data: object) -> None | str: from_ = d.pop("from", UNSET) - def _parse_preheader(data: object) -> None | str | Unset: + def _parse_preheader(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) preheader = _parse_preheader(d.pop("preheader", UNSET)) diff --git a/rootly_sdk/models/send_email_task_params.py b/rootly_sdk/models/send_email_task_params.py index 6e1d8cfc..b9f93c42 100644 --- a/rootly_sdk/models/send_email_task_params.py +++ b/rootly_sdk/models/send_email_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,29 +19,29 @@ class SendEmailTaskParams: Attributes: to (list[str]): subject (str): The subject - body (None | str): The email body - task_type (SendEmailTaskParamsTaskType | Unset): - from_ (str | Unset): The from email address. Need to use SMTP integration if different than rootly.com Default: - 'Rootly '. - cc (list[str] | Unset): - bcc (list[str] | Unset): - preheader (None | str | Unset): The preheader - include_header (bool | Unset): - include_footer (bool | Unset): - custom_logo_url (None | str | Unset): URL to your custom email logo + body (Union[None, str]): The email body + task_type (Union[Unset, SendEmailTaskParamsTaskType]): + from_ (Union[Unset, str]): The from email address. Need to use SMTP integration if different than rootly.com + Default: 'Rootly '. + cc (Union[Unset, list[str]]): + bcc (Union[Unset, list[str]]): + preheader (Union[None, Unset, str]): The preheader + include_header (Union[Unset, bool]): + include_footer (Union[Unset, bool]): + custom_logo_url (Union[None, Unset, str]): URL to your custom email logo """ to: list[str] subject: str - body: None | str - task_type: SendEmailTaskParamsTaskType | Unset = UNSET - from_: str | Unset = "Rootly " - cc: list[str] | Unset = UNSET - bcc: list[str] | Unset = UNSET - preheader: None | str | Unset = UNSET - include_header: bool | Unset = UNSET - include_footer: bool | Unset = UNSET - custom_logo_url: None | str | Unset = UNSET + body: Union[None, str] + task_type: Union[Unset, SendEmailTaskParamsTaskType] = UNSET + from_: Union[Unset, str] = "Rootly " + cc: Union[Unset, list[str]] = UNSET + bcc: Union[Unset, list[str]] = UNSET + preheader: Union[None, Unset, str] = UNSET + include_header: Union[Unset, bool] = UNSET + include_footer: Union[Unset, bool] = UNSET + custom_logo_url: Union[None, Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -51,24 +49,24 @@ def to_dict(self) -> dict[str, Any]: subject = self.subject - body: None | str + body: Union[None, str] body = self.body - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type from_ = self.from_ - cc: list[str] | Unset = UNSET + cc: Union[Unset, list[str]] = UNSET if not isinstance(self.cc, Unset): cc = self.cc - bcc: list[str] | Unset = UNSET + bcc: Union[Unset, list[str]] = UNSET if not isinstance(self.bcc, Unset): bcc = self.bcc - preheader: None | str | Unset + preheader: Union[None, Unset, str] if isinstance(self.preheader, Unset): preheader = UNSET else: @@ -78,7 +76,7 @@ def to_dict(self) -> dict[str, Any]: include_footer = self.include_footer - custom_logo_url: None | str | Unset + custom_logo_url: Union[None, Unset, str] if isinstance(self.custom_logo_url, Unset): custom_logo_url = UNSET else: @@ -119,15 +117,15 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: subject = d.pop("subject") - def _parse_body(data: object) -> None | str: + def _parse_body(data: object) -> Union[None, str]: if data is None: return data - return cast(None | str, data) + return cast(Union[None, str], data) body = _parse_body(d.pop("body")) _task_type = d.pop("task_type", UNSET) - task_type: SendEmailTaskParamsTaskType | Unset + task_type: Union[Unset, SendEmailTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: @@ -139,12 +137,12 @@ def _parse_body(data: object) -> None | str: bcc = cast(list[str], d.pop("bcc", UNSET)) - def _parse_preheader(data: object) -> None | str | Unset: + def _parse_preheader(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) preheader = _parse_preheader(d.pop("preheader", UNSET)) @@ -152,12 +150,12 @@ def _parse_preheader(data: object) -> None | str | Unset: include_footer = d.pop("include_footer", UNSET) - def _parse_custom_logo_url(data: object) -> None | str | Unset: + def _parse_custom_logo_url(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) custom_logo_url = _parse_custom_logo_url(d.pop("custom_logo_url", UNSET)) diff --git a/rootly_sdk/models/send_google_chat_attachments_task_params.py b/rootly_sdk/models/send_google_chat_attachments_task_params.py index dd445380..6e5fadff 100644 --- a/rootly_sdk/models/send_google_chat_attachments_task_params.py +++ b/rootly_sdk/models/send_google_chat_attachments_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -25,18 +23,17 @@ class SendGoogleChatAttachmentsTaskParams: """ Attributes: - spaces (list[SendGoogleChatAttachmentsTaskParamsSpacesItem]): + spaces (list['SendGoogleChatAttachmentsTaskParamsSpacesItem']): attachments (str): - task_type (SendGoogleChatAttachmentsTaskParamsTaskType | Unset): + task_type (Union[Unset, SendGoogleChatAttachmentsTaskParamsTaskType]): """ - spaces: list[SendGoogleChatAttachmentsTaskParamsSpacesItem] + spaces: list["SendGoogleChatAttachmentsTaskParamsSpacesItem"] attachments: str - task_type: SendGoogleChatAttachmentsTaskParamsTaskType | Unset = UNSET + task_type: Union[Unset, SendGoogleChatAttachmentsTaskParamsTaskType] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - spaces = [] for spaces_item_data in self.spaces: spaces_item = spaces_item_data.to_dict() @@ -44,7 +41,7 @@ def to_dict(self) -> dict[str, Any]: attachments = self.attachments - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -78,7 +75,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attachments = d.pop("attachments") _task_type = d.pop("task_type", UNSET) - task_type: SendGoogleChatAttachmentsTaskParamsTaskType | Unset + task_type: Union[Unset, SendGoogleChatAttachmentsTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/send_google_chat_attachments_task_params_spaces_item.py b/rootly_sdk/models/send_google_chat_attachments_task_params_spaces_item.py index 0b80e5f7..10b0636d 100644 --- a/rootly_sdk/models/send_google_chat_attachments_task_params_spaces_item.py +++ b/rootly_sdk/models/send_google_chat_attachments_task_params_spaces_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class SendGoogleChatAttachmentsTaskParamsSpacesItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/send_google_chat_message_task_params.py b/rootly_sdk/models/send_google_chat_message_task_params.py index db4a5839..bdce55c2 100644 --- a/rootly_sdk/models/send_google_chat_message_task_params.py +++ b/rootly_sdk/models/send_google_chat_message_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,21 +21,20 @@ class SendGoogleChatMessageTaskParams: """ Attributes: - spaces (list[SendGoogleChatMessageTaskParamsSpacesItem]): + spaces (list['SendGoogleChatMessageTaskParamsSpacesItem']): text (str): - task_type (SendGoogleChatMessageTaskParamsTaskType | Unset): - thread_key (None | str | Unset): Thread key to reply within a thread. Messages with the same thread key are + task_type (Union[Unset, SendGoogleChatMessageTaskParamsTaskType]): + thread_key (Union[None, Unset, str]): Thread key to reply within a thread. Messages with the same thread key are grouped together """ - spaces: list[SendGoogleChatMessageTaskParamsSpacesItem] + spaces: list["SendGoogleChatMessageTaskParamsSpacesItem"] text: str - task_type: SendGoogleChatMessageTaskParamsTaskType | Unset = UNSET - thread_key: None | str | Unset = UNSET + task_type: Union[Unset, SendGoogleChatMessageTaskParamsTaskType] = UNSET + thread_key: Union[None, Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - spaces = [] for spaces_item_data in self.spaces: spaces_item = spaces_item_data.to_dict() @@ -45,11 +42,11 @@ def to_dict(self) -> dict[str, Any]: text = self.text - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - thread_key: None | str | Unset + thread_key: Union[None, Unset, str] if isinstance(self.thread_key, Unset): thread_key = UNSET else: @@ -85,18 +82,18 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: text = d.pop("text") _task_type = d.pop("task_type", UNSET) - task_type: SendGoogleChatMessageTaskParamsTaskType | Unset + task_type: Union[Unset, SendGoogleChatMessageTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: task_type = check_send_google_chat_message_task_params_task_type(_task_type) - def _parse_thread_key(data: object) -> None | str | Unset: + def _parse_thread_key(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) thread_key = _parse_thread_key(d.pop("thread_key", UNSET)) diff --git a/rootly_sdk/models/send_google_chat_message_task_params_spaces_item.py b/rootly_sdk/models/send_google_chat_message_task_params_spaces_item.py index 71a9a418..a817fef4 100644 --- a/rootly_sdk/models/send_google_chat_message_task_params_spaces_item.py +++ b/rootly_sdk/models/send_google_chat_message_task_params_spaces_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class SendGoogleChatMessageTaskParamsSpacesItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/send_microsoft_teams_blocks_task_params_type_0_channels_item.py b/rootly_sdk/models/send_microsoft_teams_blocks_task_params_type_0_channels_item.py index 6aa1da64..db62f598 100644 --- a/rootly_sdk/models/send_microsoft_teams_blocks_task_params_type_0_channels_item.py +++ b/rootly_sdk/models/send_microsoft_teams_blocks_task_params_type_0_channels_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class SendMicrosoftTeamsBlocksTaskParamsType0ChannelsItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/send_microsoft_teams_chat_message_task_params.py b/rootly_sdk/models/send_microsoft_teams_chat_message_task_params.py index 9fe2be40..0cec2355 100644 --- a/rootly_sdk/models/send_microsoft_teams_chat_message_task_params.py +++ b/rootly_sdk/models/send_microsoft_teams_chat_message_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -25,18 +23,17 @@ class SendMicrosoftTeamsChatMessageTaskParams: """ Attributes: - chats (list[SendMicrosoftTeamsChatMessageTaskParamsChatsItem]): + chats (list['SendMicrosoftTeamsChatMessageTaskParamsChatsItem']): text (str): The message text - task_type (SendMicrosoftTeamsChatMessageTaskParamsTaskType | Unset): + task_type (Union[Unset, SendMicrosoftTeamsChatMessageTaskParamsTaskType]): """ - chats: list[SendMicrosoftTeamsChatMessageTaskParamsChatsItem] + chats: list["SendMicrosoftTeamsChatMessageTaskParamsChatsItem"] text: str - task_type: SendMicrosoftTeamsChatMessageTaskParamsTaskType | Unset = UNSET + task_type: Union[Unset, SendMicrosoftTeamsChatMessageTaskParamsTaskType] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - chats = [] for chats_item_data in self.chats: chats_item = chats_item_data.to_dict() @@ -44,7 +41,7 @@ def to_dict(self) -> dict[str, Any]: text = self.text - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -78,7 +75,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: text = d.pop("text") _task_type = d.pop("task_type", UNSET) - task_type: SendMicrosoftTeamsChatMessageTaskParamsTaskType | Unset + task_type: Union[Unset, SendMicrosoftTeamsChatMessageTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/send_microsoft_teams_chat_message_task_params_chats_item.py b/rootly_sdk/models/send_microsoft_teams_chat_message_task_params_chats_item.py index b5eb86bf..a31722c3 100644 --- a/rootly_sdk/models/send_microsoft_teams_chat_message_task_params_chats_item.py +++ b/rootly_sdk/models/send_microsoft_teams_chat_message_task_params_chats_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class SendMicrosoftTeamsChatMessageTaskParamsChatsItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/send_microsoft_teams_message_task_params_type_0_channels_item.py b/rootly_sdk/models/send_microsoft_teams_message_task_params_type_0_channels_item.py index 62d56aa3..561a2dc7 100644 --- a/rootly_sdk/models/send_microsoft_teams_message_task_params_type_0_channels_item.py +++ b/rootly_sdk/models/send_microsoft_teams_message_task_params_type_0_channels_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class SendMicrosoftTeamsMessageTaskParamsType0ChannelsItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/send_slack_blocks_task_params_type_0_channels_item.py b/rootly_sdk/models/send_slack_blocks_task_params_type_0_channels_item.py index 1d13245f..ef88c493 100644 --- a/rootly_sdk/models/send_slack_blocks_task_params_type_0_channels_item.py +++ b/rootly_sdk/models/send_slack_blocks_task_params_type_0_channels_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class SendSlackBlocksTaskParamsType0ChannelsItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/send_slack_blocks_task_params_type_1_slack_users_item.py b/rootly_sdk/models/send_slack_blocks_task_params_type_1_slack_users_item.py index fb401ba9..61aa3c92 100644 --- a/rootly_sdk/models/send_slack_blocks_task_params_type_1_slack_users_item.py +++ b/rootly_sdk/models/send_slack_blocks_task_params_type_1_slack_users_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class SendSlackBlocksTaskParamsType1SlackUsersItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/send_slack_blocks_task_params_type_2_slack_user_groups_item.py b/rootly_sdk/models/send_slack_blocks_task_params_type_2_slack_user_groups_item.py index 54a82d43..dcd96927 100644 --- a/rootly_sdk/models/send_slack_blocks_task_params_type_2_slack_user_groups_item.py +++ b/rootly_sdk/models/send_slack_blocks_task_params_type_2_slack_user_groups_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class SendSlackBlocksTaskParamsType2SlackUserGroupsItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/send_slack_message_task_params_type_0_channels_item.py b/rootly_sdk/models/send_slack_message_task_params_type_0_channels_item.py index 07a0fed2..ed7932a4 100644 --- a/rootly_sdk/models/send_slack_message_task_params_type_0_channels_item.py +++ b/rootly_sdk/models/send_slack_message_task_params_type_0_channels_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class SendSlackMessageTaskParamsType0ChannelsItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/send_slack_message_task_params_type_1_slack_users_item.py b/rootly_sdk/models/send_slack_message_task_params_type_1_slack_users_item.py index 7aa7cd68..72f117d9 100644 --- a/rootly_sdk/models/send_slack_message_task_params_type_1_slack_users_item.py +++ b/rootly_sdk/models/send_slack_message_task_params_type_1_slack_users_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class SendSlackMessageTaskParamsType1SlackUsersItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/send_slack_message_task_params_type_2_slack_user_groups_item.py b/rootly_sdk/models/send_slack_message_task_params_type_2_slack_user_groups_item.py index 8a055aa3..5577122a 100644 --- a/rootly_sdk/models/send_slack_message_task_params_type_2_slack_user_groups_item.py +++ b/rootly_sdk/models/send_slack_message_task_params_type_2_slack_user_groups_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class SendSlackMessageTaskParamsType2SlackUserGroupsItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/send_sms_task_params.py b/rootly_sdk/models/send_sms_task_params.py index 188935ea..71105076 100644 --- a/rootly_sdk/models/send_sms_task_params.py +++ b/rootly_sdk/models/send_sms_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,13 +17,13 @@ class SendSmsTaskParams: phone_numbers (list[str]): name (str): The name content (str): The SMS message - task_type (SendSmsTaskParamsTaskType | Unset): + task_type (Union[Unset, SendSmsTaskParamsTaskType]): """ phone_numbers: list[str] name: str content: str - task_type: SendSmsTaskParamsTaskType | Unset = UNSET + task_type: Union[Unset, SendSmsTaskParamsTaskType] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -35,7 +33,7 @@ def to_dict(self) -> dict[str, Any]: content = self.content - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -63,7 +61,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: content = d.pop("content") _task_type = d.pop("task_type", UNSET) - task_type: SendSmsTaskParamsTaskType | Unset + task_type: Union[Unset, SendSmsTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/send_whatsapp_message_task_params.py b/rootly_sdk/models/send_whatsapp_message_task_params.py index ba3492e7..49e21a94 100644 --- a/rootly_sdk/models/send_whatsapp_message_task_params.py +++ b/rootly_sdk/models/send_whatsapp_message_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,13 +20,13 @@ class SendWhatsappMessageTaskParams: phone_numbers (list[str]): name (str): The name content (str): The WhatsApp message - task_type (SendWhatsappMessageTaskParamsTaskType | Unset): + task_type (Union[Unset, SendWhatsappMessageTaskParamsTaskType]): """ phone_numbers: list[str] name: str content: str - task_type: SendWhatsappMessageTaskParamsTaskType | Unset = UNSET + task_type: Union[Unset, SendWhatsappMessageTaskParamsTaskType] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -38,7 +36,7 @@ def to_dict(self) -> dict[str, Any]: content = self.content - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -66,7 +64,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: content = d.pop("content") _task_type = d.pop("task_type", UNSET) - task_type: SendWhatsappMessageTaskParamsTaskType | Unset + task_type: Union[Unset, SendWhatsappMessageTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/service.py b/rootly_sdk/models/service.py index 78237e7e..4ecb2e63 100644 --- a/rootly_sdk/models/service.py +++ b/rootly_sdk/models/service.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -27,83 +25,88 @@ class Service: name (str): The name of the service created_at (str): Date of creation updated_at (str): Date of last update - slug (str | Unset): The slug of the service - managed_by (ServiceManagedBy | Unset): How this service is managed (provenance): web, api, terraform, etc. Read- - only. - description (None | str | Unset): The description of the service - public_description (None | str | Unset): The public description of the service - notify_emails (list[str] | None | Unset): Emails attached to the service - color (None | str | Unset): The hex color of the service - position (int | None | Unset): Position of the service - backstage_id (None | str | Unset): The Backstage entity id associated to this service. eg: + slug (Union[Unset, str]): The slug of the service + managed_by (Union[Unset, ServiceManagedBy]): How this service is managed (provenance): web, api, terraform, etc. + Read-only. + description (Union[None, Unset, str]): The description of the service + public_description (Union[None, Unset, str]): The status page description of the service + notify_emails (Union[None, Unset, list[str]]): Emails attached to the service + color (Union[None, Unset, str]): The hex color of the service + position (Union[None, Unset, int]): Position of the service + backstage_id (Union[None, Unset, str]): The Backstage entity id associated to this service. eg: :namespace/:kind/:entity_name - external_id (None | str | Unset): The external id associated to this service - pagerduty_id (None | str | Unset): The PagerDuty service id associated to this service - opsgenie_id (None | str | Unset): The Opsgenie service id associated to this service - cortex_id (None | str | Unset): The Cortex group id associated to this service - service_now_ci_sys_id (None | str | Unset): The Service Now CI sys id associated to this service - github_repository_name (None | str | Unset): The GitHub repository name associated to this service. eg: + external_id (Union[None, Unset, str]): The external id associated to this service + pagerduty_id (Union[None, Unset, str]): The PagerDuty service id associated to this service + opsgenie_id (Union[None, Unset, str]): The Opsgenie service id associated to this service + cortex_id (Union[None, Unset, str]): The Cortex group id associated to this service + service_now_ci_sys_id (Union[None, Unset, str]): The Service Now CI sys id associated to this service + github_repository_name (Union[None, Unset, str]): The GitHub repository name associated to this service. eg: rootlyhq/my-service - github_repository_branch (None | str | Unset): The GitHub repository branch associated to this service. eg: main - gitlab_repository_name (None | str | Unset): The GitLab repository name associated to this service. eg: + github_repository_branch (Union[None, Unset, str]): The GitHub repository branch associated to this service. eg: + main + gitlab_repository_name (Union[None, Unset, str]): The GitLab repository name associated to this service. eg: rootlyhq/my-service - gitlab_repository_branch (None | str | Unset): The GitLab repository branch associated to this service. eg: main - kubernetes_deployment_name (None | str | Unset): The Kubernetes deployment name associated to this service. eg: - namespace/deployment-name - environment_ids (list[str] | None | Unset): Environments associated with this service - service_ids (list[str] | None | Unset): Services dependent on this service - owner_group_ids (list[str] | None | Unset): Owner Teams associated with this service - owner_user_ids (list[int] | None | Unset): Owner Users associated with this service - alert_urgency_id (None | str | Unset): The alert urgency id of the service - escalation_policy_id (None | str | Unset): The escalation policy id of the service - alerts_email_enabled (bool | None | Unset): Enable alerts through email - alerts_email_address (None | str | Unset): Email generated to send alerts to - slack_channels (list[ServiceSlackChannelsType0Item] | None | Unset): Slack Channels associated with this service - slack_aliases (list[ServiceSlackAliasesType0Item] | None | Unset): Slack Aliases associated with this service - alert_broadcast_enabled (bool | None | Unset): Enable alerts to be broadcasted to a specific channel - alert_broadcast_channel (None | ServiceAlertBroadcastChannelType0 | Unset): Slack channel to broadcast alerts to - incident_broadcast_enabled (bool | None | Unset): Enable incidents to be broadcasted to a specific channel - incident_broadcast_channel (None | ServiceIncidentBroadcastChannelType0 | Unset): Slack channel to broadcast - incidents to - properties (list[ServicePropertiesType0Item] | None | Unset): Array of property values for this service. + gitlab_repository_branch (Union[None, Unset, str]): The GitLab repository branch associated to this service. eg: + main + kubernetes_deployment_name (Union[None, Unset, str]): The Kubernetes deployment name associated to this service. + eg: namespace/deployment-name + environment_ids (Union[None, Unset, list[str]]): Environments associated with this service + service_ids (Union[None, Unset, list[str]]): Services dependent on this service + owner_group_ids (Union[None, Unset, list[str]]): Owner Teams associated with this service + owner_user_ids (Union[None, Unset, list[int]]): Owner Users associated with this service + alert_urgency_id (Union[None, Unset, str]): The alert urgency id of the service + escalation_policy_id (Union[None, Unset, str]): The escalation policy id of the service + alerts_email_enabled (Union[None, Unset, bool]): Enable alerts through email + alerts_email_address (Union[None, Unset, str]): Email generated to send alerts to + slack_channels (Union[None, Unset, list['ServiceSlackChannelsType0Item']]): Slack Channels associated with this + service + slack_aliases (Union[None, Unset, list['ServiceSlackAliasesType0Item']]): Slack Aliases associated with this + service + alert_broadcast_enabled (Union[None, Unset, bool]): Enable alerts to be broadcasted to a specific channel + alert_broadcast_channel (Union['ServiceAlertBroadcastChannelType0', None, Unset]): Slack channel to broadcast + alerts to + incident_broadcast_enabled (Union[None, Unset, bool]): Enable incidents to be broadcasted to a specific channel + incident_broadcast_channel (Union['ServiceIncidentBroadcastChannelType0', None, Unset]): Slack channel to + broadcast incidents to + properties (Union[None, Unset, list['ServicePropertiesType0Item']]): Array of property values for this service. """ name: str created_at: str updated_at: str - slug: str | Unset = UNSET - managed_by: ServiceManagedBy | Unset = UNSET - description: None | str | Unset = UNSET - public_description: None | str | Unset = UNSET - notify_emails: list[str] | None | Unset = UNSET - color: None | str | Unset = UNSET - position: int | None | Unset = UNSET - backstage_id: None | str | Unset = UNSET - external_id: None | str | Unset = UNSET - pagerduty_id: None | str | Unset = UNSET - opsgenie_id: None | str | Unset = UNSET - cortex_id: None | str | Unset = UNSET - service_now_ci_sys_id: None | str | Unset = UNSET - github_repository_name: None | str | Unset = UNSET - github_repository_branch: None | str | Unset = UNSET - gitlab_repository_name: None | str | Unset = UNSET - gitlab_repository_branch: None | str | Unset = UNSET - kubernetes_deployment_name: None | str | Unset = UNSET - environment_ids: list[str] | None | Unset = UNSET - service_ids: list[str] | None | Unset = UNSET - owner_group_ids: list[str] | None | Unset = UNSET - owner_user_ids: list[int] | None | Unset = UNSET - alert_urgency_id: None | str | Unset = UNSET - escalation_policy_id: None | str | Unset = UNSET - alerts_email_enabled: bool | None | Unset = UNSET - alerts_email_address: None | str | Unset = UNSET - slack_channels: list[ServiceSlackChannelsType0Item] | None | Unset = UNSET - slack_aliases: list[ServiceSlackAliasesType0Item] | None | Unset = UNSET - alert_broadcast_enabled: bool | None | Unset = UNSET - alert_broadcast_channel: None | ServiceAlertBroadcastChannelType0 | Unset = UNSET - incident_broadcast_enabled: bool | None | Unset = UNSET - incident_broadcast_channel: None | ServiceIncidentBroadcastChannelType0 | Unset = UNSET - properties: list[ServicePropertiesType0Item] | None | Unset = UNSET + slug: Union[Unset, str] = UNSET + managed_by: Union[Unset, ServiceManagedBy] = UNSET + description: Union[None, Unset, str] = UNSET + public_description: Union[None, Unset, str] = UNSET + notify_emails: Union[None, Unset, list[str]] = UNSET + color: Union[None, Unset, str] = UNSET + position: Union[None, Unset, int] = UNSET + backstage_id: Union[None, Unset, str] = UNSET + external_id: Union[None, Unset, str] = UNSET + pagerduty_id: Union[None, Unset, str] = UNSET + opsgenie_id: Union[None, Unset, str] = UNSET + cortex_id: Union[None, Unset, str] = UNSET + service_now_ci_sys_id: Union[None, Unset, str] = UNSET + github_repository_name: Union[None, Unset, str] = UNSET + github_repository_branch: Union[None, Unset, str] = UNSET + gitlab_repository_name: Union[None, Unset, str] = UNSET + gitlab_repository_branch: Union[None, Unset, str] = UNSET + kubernetes_deployment_name: Union[None, Unset, str] = UNSET + environment_ids: Union[None, Unset, list[str]] = UNSET + service_ids: Union[None, Unset, list[str]] = UNSET + owner_group_ids: Union[None, Unset, list[str]] = UNSET + owner_user_ids: Union[None, Unset, list[int]] = UNSET + alert_urgency_id: Union[None, Unset, str] = UNSET + escalation_policy_id: Union[None, Unset, str] = UNSET + alerts_email_enabled: Union[None, Unset, bool] = UNSET + alerts_email_address: Union[None, Unset, str] = UNSET + slack_channels: Union[None, Unset, list["ServiceSlackChannelsType0Item"]] = UNSET + slack_aliases: Union[None, Unset, list["ServiceSlackAliasesType0Item"]] = UNSET + alert_broadcast_enabled: Union[None, Unset, bool] = UNSET + alert_broadcast_channel: Union["ServiceAlertBroadcastChannelType0", None, Unset] = UNSET + incident_broadcast_enabled: Union[None, Unset, bool] = UNSET + incident_broadcast_channel: Union["ServiceIncidentBroadcastChannelType0", None, Unset] = UNSET + properties: Union[None, Unset, list["ServicePropertiesType0Item"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -118,23 +121,23 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - managed_by: str | Unset = UNSET + managed_by: Union[Unset, str] = UNSET if not isinstance(self.managed_by, Unset): managed_by = self.managed_by - description: None | str | Unset + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: description = self.description - public_description: None | str | Unset + public_description: Union[None, Unset, str] if isinstance(self.public_description, Unset): public_description = UNSET else: public_description = self.public_description - notify_emails: list[str] | None | Unset + notify_emails: Union[None, Unset, list[str]] if isinstance(self.notify_emails, Unset): notify_emails = UNSET elif isinstance(self.notify_emails, list): @@ -143,85 +146,85 @@ def to_dict(self) -> dict[str, Any]: else: notify_emails = self.notify_emails - color: None | str | Unset + color: Union[None, Unset, str] if isinstance(self.color, Unset): color = UNSET else: color = self.color - position: int | None | Unset + position: Union[None, Unset, int] if isinstance(self.position, Unset): position = UNSET else: position = self.position - backstage_id: None | str | Unset + backstage_id: Union[None, Unset, str] if isinstance(self.backstage_id, Unset): backstage_id = UNSET else: backstage_id = self.backstage_id - external_id: None | str | Unset + external_id: Union[None, Unset, str] if isinstance(self.external_id, Unset): external_id = UNSET else: external_id = self.external_id - pagerduty_id: None | str | Unset + pagerduty_id: Union[None, Unset, str] if isinstance(self.pagerduty_id, Unset): pagerduty_id = UNSET else: pagerduty_id = self.pagerduty_id - opsgenie_id: None | str | Unset + opsgenie_id: Union[None, Unset, str] if isinstance(self.opsgenie_id, Unset): opsgenie_id = UNSET else: opsgenie_id = self.opsgenie_id - cortex_id: None | str | Unset + cortex_id: Union[None, Unset, str] if isinstance(self.cortex_id, Unset): cortex_id = UNSET else: cortex_id = self.cortex_id - service_now_ci_sys_id: None | str | Unset + service_now_ci_sys_id: Union[None, Unset, str] if isinstance(self.service_now_ci_sys_id, Unset): service_now_ci_sys_id = UNSET else: service_now_ci_sys_id = self.service_now_ci_sys_id - github_repository_name: None | str | Unset + github_repository_name: Union[None, Unset, str] if isinstance(self.github_repository_name, Unset): github_repository_name = UNSET else: github_repository_name = self.github_repository_name - github_repository_branch: None | str | Unset + github_repository_branch: Union[None, Unset, str] if isinstance(self.github_repository_branch, Unset): github_repository_branch = UNSET else: github_repository_branch = self.github_repository_branch - gitlab_repository_name: None | str | Unset + gitlab_repository_name: Union[None, Unset, str] if isinstance(self.gitlab_repository_name, Unset): gitlab_repository_name = UNSET else: gitlab_repository_name = self.gitlab_repository_name - gitlab_repository_branch: None | str | Unset + gitlab_repository_branch: Union[None, Unset, str] if isinstance(self.gitlab_repository_branch, Unset): gitlab_repository_branch = UNSET else: gitlab_repository_branch = self.gitlab_repository_branch - kubernetes_deployment_name: None | str | Unset + kubernetes_deployment_name: Union[None, Unset, str] if isinstance(self.kubernetes_deployment_name, Unset): kubernetes_deployment_name = UNSET else: kubernetes_deployment_name = self.kubernetes_deployment_name - environment_ids: list[str] | None | Unset + environment_ids: Union[None, Unset, list[str]] if isinstance(self.environment_ids, Unset): environment_ids = UNSET elif isinstance(self.environment_ids, list): @@ -230,7 +233,7 @@ def to_dict(self) -> dict[str, Any]: else: environment_ids = self.environment_ids - service_ids: list[str] | None | Unset + service_ids: Union[None, Unset, list[str]] if isinstance(self.service_ids, Unset): service_ids = UNSET elif isinstance(self.service_ids, list): @@ -239,7 +242,7 @@ def to_dict(self) -> dict[str, Any]: else: service_ids = self.service_ids - owner_group_ids: list[str] | None | Unset + owner_group_ids: Union[None, Unset, list[str]] if isinstance(self.owner_group_ids, Unset): owner_group_ids = UNSET elif isinstance(self.owner_group_ids, list): @@ -248,7 +251,7 @@ def to_dict(self) -> dict[str, Any]: else: owner_group_ids = self.owner_group_ids - owner_user_ids: list[int] | None | Unset + owner_user_ids: Union[None, Unset, list[int]] if isinstance(self.owner_user_ids, Unset): owner_user_ids = UNSET elif isinstance(self.owner_user_ids, list): @@ -257,31 +260,31 @@ def to_dict(self) -> dict[str, Any]: else: owner_user_ids = self.owner_user_ids - alert_urgency_id: None | str | Unset + alert_urgency_id: Union[None, Unset, str] if isinstance(self.alert_urgency_id, Unset): alert_urgency_id = UNSET else: alert_urgency_id = self.alert_urgency_id - escalation_policy_id: None | str | Unset + escalation_policy_id: Union[None, Unset, str] if isinstance(self.escalation_policy_id, Unset): escalation_policy_id = UNSET else: escalation_policy_id = self.escalation_policy_id - alerts_email_enabled: bool | None | Unset + alerts_email_enabled: Union[None, Unset, bool] if isinstance(self.alerts_email_enabled, Unset): alerts_email_enabled = UNSET else: alerts_email_enabled = self.alerts_email_enabled - alerts_email_address: None | str | Unset + alerts_email_address: Union[None, Unset, str] if isinstance(self.alerts_email_address, Unset): alerts_email_address = UNSET else: alerts_email_address = self.alerts_email_address - slack_channels: list[dict[str, Any]] | None | Unset + slack_channels: Union[None, Unset, list[dict[str, Any]]] if isinstance(self.slack_channels, Unset): slack_channels = UNSET elif isinstance(self.slack_channels, list): @@ -293,7 +296,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_channels = self.slack_channels - slack_aliases: list[dict[str, Any]] | None | Unset + slack_aliases: Union[None, Unset, list[dict[str, Any]]] if isinstance(self.slack_aliases, Unset): slack_aliases = UNSET elif isinstance(self.slack_aliases, list): @@ -305,13 +308,13 @@ def to_dict(self) -> dict[str, Any]: else: slack_aliases = self.slack_aliases - alert_broadcast_enabled: bool | None | Unset + alert_broadcast_enabled: Union[None, Unset, bool] if isinstance(self.alert_broadcast_enabled, Unset): alert_broadcast_enabled = UNSET else: alert_broadcast_enabled = self.alert_broadcast_enabled - alert_broadcast_channel: dict[str, Any] | None | Unset + alert_broadcast_channel: Union[None, Unset, dict[str, Any]] if isinstance(self.alert_broadcast_channel, Unset): alert_broadcast_channel = UNSET elif isinstance(self.alert_broadcast_channel, ServiceAlertBroadcastChannelType0): @@ -319,13 +322,13 @@ def to_dict(self) -> dict[str, Any]: else: alert_broadcast_channel = self.alert_broadcast_channel - incident_broadcast_enabled: bool | None | Unset + incident_broadcast_enabled: Union[None, Unset, bool] if isinstance(self.incident_broadcast_enabled, Unset): incident_broadcast_enabled = UNSET else: incident_broadcast_enabled = self.incident_broadcast_enabled - incident_broadcast_channel: dict[str, Any] | None | Unset + incident_broadcast_channel: Union[None, Unset, dict[str, Any]] if isinstance(self.incident_broadcast_channel, Unset): incident_broadcast_channel = UNSET elif isinstance(self.incident_broadcast_channel, ServiceIncidentBroadcastChannelType0): @@ -333,7 +336,7 @@ def to_dict(self) -> dict[str, Any]: else: incident_broadcast_channel = self.incident_broadcast_channel - properties: list[dict[str, Any]] | None | Unset + properties: Union[None, Unset, list[dict[str, Any]]] if isinstance(self.properties, Unset): properties = UNSET elif isinstance(self.properties, list): @@ -441,31 +444,31 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: slug = d.pop("slug", UNSET) _managed_by = d.pop("managed_by", UNSET) - managed_by: ServiceManagedBy | Unset + managed_by: Union[Unset, ServiceManagedBy] if isinstance(_managed_by, Unset): managed_by = UNSET else: managed_by = check_service_managed_by(_managed_by) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) - def _parse_public_description(data: object) -> None | str | Unset: + def _parse_public_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) public_description = _parse_public_description(d.pop("public_description", UNSET)) - def _parse_notify_emails(data: object) -> list[str] | None | Unset: + def _parse_notify_emails(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -476,130 +479,130 @@ def _parse_notify_emails(data: object) -> list[str] | None | Unset: notify_emails_type_0 = cast(list[str], data) return notify_emails_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) notify_emails = _parse_notify_emails(d.pop("notify_emails", UNSET)) - def _parse_color(data: object) -> None | str | Unset: + def _parse_color(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) color = _parse_color(d.pop("color", UNSET)) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> Union[None, Unset, int]: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(Union[None, Unset, int], data) position = _parse_position(d.pop("position", UNSET)) - def _parse_backstage_id(data: object) -> None | str | Unset: + def _parse_backstage_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) backstage_id = _parse_backstage_id(d.pop("backstage_id", UNSET)) - def _parse_external_id(data: object) -> None | str | Unset: + def _parse_external_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) external_id = _parse_external_id(d.pop("external_id", UNSET)) - def _parse_pagerduty_id(data: object) -> None | str | Unset: + def _parse_pagerduty_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) pagerduty_id = _parse_pagerduty_id(d.pop("pagerduty_id", UNSET)) - def _parse_opsgenie_id(data: object) -> None | str | Unset: + def _parse_opsgenie_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) opsgenie_id = _parse_opsgenie_id(d.pop("opsgenie_id", UNSET)) - def _parse_cortex_id(data: object) -> None | str | Unset: + def _parse_cortex_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) cortex_id = _parse_cortex_id(d.pop("cortex_id", UNSET)) - def _parse_service_now_ci_sys_id(data: object) -> None | str | Unset: + def _parse_service_now_ci_sys_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) service_now_ci_sys_id = _parse_service_now_ci_sys_id(d.pop("service_now_ci_sys_id", UNSET)) - def _parse_github_repository_name(data: object) -> None | str | Unset: + def _parse_github_repository_name(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) github_repository_name = _parse_github_repository_name(d.pop("github_repository_name", UNSET)) - def _parse_github_repository_branch(data: object) -> None | str | Unset: + def _parse_github_repository_branch(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) github_repository_branch = _parse_github_repository_branch(d.pop("github_repository_branch", UNSET)) - def _parse_gitlab_repository_name(data: object) -> None | str | Unset: + def _parse_gitlab_repository_name(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) gitlab_repository_name = _parse_gitlab_repository_name(d.pop("gitlab_repository_name", UNSET)) - def _parse_gitlab_repository_branch(data: object) -> None | str | Unset: + def _parse_gitlab_repository_branch(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) gitlab_repository_branch = _parse_gitlab_repository_branch(d.pop("gitlab_repository_branch", UNSET)) - def _parse_kubernetes_deployment_name(data: object) -> None | str | Unset: + def _parse_kubernetes_deployment_name(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) kubernetes_deployment_name = _parse_kubernetes_deployment_name(d.pop("kubernetes_deployment_name", UNSET)) - def _parse_environment_ids(data: object) -> list[str] | None | Unset: + def _parse_environment_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -610,13 +613,13 @@ def _parse_environment_ids(data: object) -> list[str] | None | Unset: environment_ids_type_0 = cast(list[str], data) return environment_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) environment_ids = _parse_environment_ids(d.pop("environment_ids", UNSET)) - def _parse_service_ids(data: object) -> list[str] | None | Unset: + def _parse_service_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -627,13 +630,13 @@ def _parse_service_ids(data: object) -> list[str] | None | Unset: service_ids_type_0 = cast(list[str], data) return service_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) service_ids = _parse_service_ids(d.pop("service_ids", UNSET)) - def _parse_owner_group_ids(data: object) -> list[str] | None | Unset: + def _parse_owner_group_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -644,13 +647,13 @@ def _parse_owner_group_ids(data: object) -> list[str] | None | Unset: owner_group_ids_type_0 = cast(list[str], data) return owner_group_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) owner_group_ids = _parse_owner_group_ids(d.pop("owner_group_ids", UNSET)) - def _parse_owner_user_ids(data: object) -> list[int] | None | Unset: + def _parse_owner_user_ids(data: object) -> Union[None, Unset, list[int]]: if data is None: return data if isinstance(data, Unset): @@ -661,49 +664,49 @@ def _parse_owner_user_ids(data: object) -> list[int] | None | Unset: owner_user_ids_type_0 = cast(list[int], data) return owner_user_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[int] | None | Unset, data) + return cast(Union[None, Unset, list[int]], data) owner_user_ids = _parse_owner_user_ids(d.pop("owner_user_ids", UNSET)) - def _parse_alert_urgency_id(data: object) -> None | str | Unset: + def _parse_alert_urgency_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) alert_urgency_id = _parse_alert_urgency_id(d.pop("alert_urgency_id", UNSET)) - def _parse_escalation_policy_id(data: object) -> None | str | Unset: + def _parse_escalation_policy_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) escalation_policy_id = _parse_escalation_policy_id(d.pop("escalation_policy_id", UNSET)) - def _parse_alerts_email_enabled(data: object) -> bool | None | Unset: + def _parse_alerts_email_enabled(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) alerts_email_enabled = _parse_alerts_email_enabled(d.pop("alerts_email_enabled", UNSET)) - def _parse_alerts_email_address(data: object) -> None | str | Unset: + def _parse_alerts_email_address(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) alerts_email_address = _parse_alerts_email_address(d.pop("alerts_email_address", UNSET)) - def _parse_slack_channels(data: object) -> list[ServiceSlackChannelsType0Item] | None | Unset: + def _parse_slack_channels(data: object) -> Union[None, Unset, list["ServiceSlackChannelsType0Item"]]: if data is None: return data if isinstance(data, Unset): @@ -721,13 +724,13 @@ def _parse_slack_channels(data: object) -> list[ServiceSlackChannelsType0Item] | slack_channels_type_0.append(slack_channels_type_0_item) return slack_channels_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[ServiceSlackChannelsType0Item] | None | Unset, data) + return cast(Union[None, Unset, list["ServiceSlackChannelsType0Item"]], data) slack_channels = _parse_slack_channels(d.pop("slack_channels", UNSET)) - def _parse_slack_aliases(data: object) -> list[ServiceSlackAliasesType0Item] | None | Unset: + def _parse_slack_aliases(data: object) -> Union[None, Unset, list["ServiceSlackAliasesType0Item"]]: if data is None: return data if isinstance(data, Unset): @@ -743,22 +746,22 @@ def _parse_slack_aliases(data: object) -> list[ServiceSlackAliasesType0Item] | N slack_aliases_type_0.append(slack_aliases_type_0_item) return slack_aliases_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[ServiceSlackAliasesType0Item] | None | Unset, data) + return cast(Union[None, Unset, list["ServiceSlackAliasesType0Item"]], data) slack_aliases = _parse_slack_aliases(d.pop("slack_aliases", UNSET)) - def _parse_alert_broadcast_enabled(data: object) -> bool | None | Unset: + def _parse_alert_broadcast_enabled(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) alert_broadcast_enabled = _parse_alert_broadcast_enabled(d.pop("alert_broadcast_enabled", UNSET)) - def _parse_alert_broadcast_channel(data: object) -> None | ServiceAlertBroadcastChannelType0 | Unset: + def _parse_alert_broadcast_channel(data: object) -> Union["ServiceAlertBroadcastChannelType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -769,22 +772,24 @@ def _parse_alert_broadcast_channel(data: object) -> None | ServiceAlertBroadcast alert_broadcast_channel_type_0 = ServiceAlertBroadcastChannelType0.from_dict(data) return alert_broadcast_channel_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(None | ServiceAlertBroadcastChannelType0 | Unset, data) + return cast(Union["ServiceAlertBroadcastChannelType0", None, Unset], data) alert_broadcast_channel = _parse_alert_broadcast_channel(d.pop("alert_broadcast_channel", UNSET)) - def _parse_incident_broadcast_enabled(data: object) -> bool | None | Unset: + def _parse_incident_broadcast_enabled(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) incident_broadcast_enabled = _parse_incident_broadcast_enabled(d.pop("incident_broadcast_enabled", UNSET)) - def _parse_incident_broadcast_channel(data: object) -> None | ServiceIncidentBroadcastChannelType0 | Unset: + def _parse_incident_broadcast_channel( + data: object, + ) -> Union["ServiceIncidentBroadcastChannelType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -795,13 +800,13 @@ def _parse_incident_broadcast_channel(data: object) -> None | ServiceIncidentBro incident_broadcast_channel_type_0 = ServiceIncidentBroadcastChannelType0.from_dict(data) return incident_broadcast_channel_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(None | ServiceIncidentBroadcastChannelType0 | Unset, data) + return cast(Union["ServiceIncidentBroadcastChannelType0", None, Unset], data) incident_broadcast_channel = _parse_incident_broadcast_channel(d.pop("incident_broadcast_channel", UNSET)) - def _parse_properties(data: object) -> list[ServicePropertiesType0Item] | None | Unset: + def _parse_properties(data: object) -> Union[None, Unset, list["ServicePropertiesType0Item"]]: if data is None: return data if isinstance(data, Unset): @@ -817,9 +822,9 @@ def _parse_properties(data: object) -> list[ServicePropertiesType0Item] | None | properties_type_0.append(properties_type_0_item) return properties_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[ServicePropertiesType0Item] | None | Unset, data) + return cast(Union[None, Unset, list["ServicePropertiesType0Item"]], data) properties = _parse_properties(d.pop("properties", UNSET)) diff --git a/rootly_sdk/models/service_alert_broadcast_channel_type_0.py b/rootly_sdk/models/service_alert_broadcast_channel_type_0.py index 352191db..b3122a4d 100644 --- a/rootly_sdk/models/service_alert_broadcast_channel_type_0.py +++ b/rootly_sdk/models/service_alert_broadcast_channel_type_0.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,12 +14,12 @@ class ServiceAlertBroadcastChannelType0: """Slack channel to broadcast alerts to Attributes: - id (str | Unset): Slack channel ID - name (str | Unset): Slack channel name + id (Union[Unset, str]): Slack channel ID + name (Union[Unset, str]): Slack channel name """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/service_incident_broadcast_channel_type_0.py b/rootly_sdk/models/service_incident_broadcast_channel_type_0.py index d5173bde..329e92e3 100644 --- a/rootly_sdk/models/service_incident_broadcast_channel_type_0.py +++ b/rootly_sdk/models/service_incident_broadcast_channel_type_0.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,12 +14,12 @@ class ServiceIncidentBroadcastChannelType0: """Slack channel to broadcast incidents to Attributes: - id (str | Unset): Slack channel ID - name (str | Unset): Slack channel name + id (Union[Unset, str]): Slack channel ID + name (Union[Unset, str]): Slack channel name """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/service_list.py b/rootly_sdk/models/service_list.py index b5abbabc..83a5874d 100644 --- a/rootly_sdk/models/service_list.py +++ b/rootly_sdk/models/service_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,20 +20,19 @@ class ServiceList: """ Attributes: - data (list[ServiceListDataItem]): + data (list['ServiceListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[ServiceListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["ServiceListDataItem"] + links: "Links" + meta: "Meta" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) service_list = cls( data=data, diff --git a/rootly_sdk/models/service_list_data_item.py b/rootly_sdk/models/service_list_data_item.py index 9134e55d..07946659 100644 --- a/rootly_sdk/models/service_list_data_item.py +++ b/rootly_sdk/models/service_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class ServiceListDataItem: id: str type_: ServiceListDataItemType - attributes: Service + attributes: "Service" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/service_properties_type_0_item.py b/rootly_sdk/models/service_properties_type_0_item.py index ca3eadbd..c674b2b6 100644 --- a/rootly_sdk/models/service_properties_type_0_item.py +++ b/rootly_sdk/models/service_properties_type_0_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/service_response.py b/rootly_sdk/models/service_response.py index 3309f183..a35d3ee1 100644 --- a/rootly_sdk/models/service_response.py +++ b/rootly_sdk/models/service_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,18 +19,17 @@ class ServiceResponse: """ Attributes: data (ServiceResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: ServiceResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "ServiceResponseData" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = ServiceResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) service_response = cls( data=data, diff --git a/rootly_sdk/models/service_response_data.py b/rootly_sdk/models/service_response_data.py index 0ebacacd..a94a16d4 100644 --- a/rootly_sdk/models/service_response_data.py +++ b/rootly_sdk/models/service_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class ServiceResponseData: id: str type_: ServiceResponseDataType - attributes: Service + attributes: "Service" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/service_slack_aliases_type_0_item.py b/rootly_sdk/models/service_slack_aliases_type_0_item.py index 9349bda9..e4b5ebfb 100644 --- a/rootly_sdk/models/service_slack_aliases_type_0_item.py +++ b/rootly_sdk/models/service_slack_aliases_type_0_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/service_slack_channels_type_0_item.py b/rootly_sdk/models/service_slack_channels_type_0_item.py index a86a7471..0a61b094 100644 --- a/rootly_sdk/models/service_slack_channels_type_0_item.py +++ b/rootly_sdk/models/service_slack_channels_type_0_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/severity.py b/rootly_sdk/models/severity.py index 7e2ec960..2ddcf16f 100644 --- a/rootly_sdk/models/severity.py +++ b/rootly_sdk/models/severity.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -24,32 +22,32 @@ class Severity: name (str): The name of the severity created_at (str): Date of creation updated_at (str): Date of last update - slug (str | Unset): The slug of the severity - description (None | str | Unset): The description of the severity - severity (SeveritySeverity | Unset): The severity of the severity - color (None | str | Unset): The hex color of the severity - position (int | None | Unset): Position of the severity - notify_emails (list[str] | None | Unset): Emails to attach to the severity - slack_channels (list[SeveritySlackChannelsType0Item] | None | Unset): Slack Channels associated with this + slug (Union[Unset, str]): The slug of the severity + description (Union[None, Unset, str]): The description of the severity + severity (Union[Unset, SeveritySeverity]): The severity of the severity + color (Union[None, Unset, str]): The hex color of the severity + position (Union[None, Unset, int]): Position of the severity + notify_emails (Union[None, Unset, list[str]]): Emails to attach to the severity + slack_channels (Union[None, Unset, list['SeveritySlackChannelsType0Item']]): Slack Channels associated with this + severity + slack_aliases (Union[None, Unset, list['SeveritySlackAliasesType0Item']]): Slack Aliases associated with this severity - slack_aliases (list[SeveritySlackAliasesType0Item] | None | Unset): Slack Aliases associated with this severity """ name: str created_at: str updated_at: str - slug: str | Unset = UNSET - description: None | str | Unset = UNSET - severity: SeveritySeverity | Unset = UNSET - color: None | str | Unset = UNSET - position: int | None | Unset = UNSET - notify_emails: list[str] | None | Unset = UNSET - slack_channels: list[SeveritySlackChannelsType0Item] | None | Unset = UNSET - slack_aliases: list[SeveritySlackAliasesType0Item] | None | Unset = UNSET + slug: Union[Unset, str] = UNSET + description: Union[None, Unset, str] = UNSET + severity: Union[Unset, SeveritySeverity] = UNSET + color: Union[None, Unset, str] = UNSET + position: Union[None, Unset, int] = UNSET + notify_emails: Union[None, Unset, list[str]] = UNSET + slack_channels: Union[None, Unset, list["SeveritySlackChannelsType0Item"]] = UNSET + slack_aliases: Union[None, Unset, list["SeveritySlackAliasesType0Item"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - name = self.name created_at = self.created_at @@ -58,29 +56,29 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - description: None | str | Unset + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: description = self.description - severity: str | Unset = UNSET + severity: Union[Unset, str] = UNSET if not isinstance(self.severity, Unset): severity = self.severity - color: None | str | Unset + color: Union[None, Unset, str] if isinstance(self.color, Unset): color = UNSET else: color = self.color - position: int | None | Unset + position: Union[None, Unset, int] if isinstance(self.position, Unset): position = UNSET else: position = self.position - notify_emails: list[str] | None | Unset + notify_emails: Union[None, Unset, list[str]] if isinstance(self.notify_emails, Unset): notify_emails = UNSET elif isinstance(self.notify_emails, list): @@ -89,7 +87,7 @@ def to_dict(self) -> dict[str, Any]: else: notify_emails = self.notify_emails - slack_channels: list[dict[str, Any]] | None | Unset + slack_channels: Union[None, Unset, list[dict[str, Any]]] if isinstance(self.slack_channels, Unset): slack_channels = UNSET elif isinstance(self.slack_channels, list): @@ -101,7 +99,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_channels = self.slack_channels - slack_aliases: list[dict[str, Any]] | None | Unset + slack_aliases: Union[None, Unset, list[dict[str, Any]]] if isinstance(self.slack_aliases, Unset): slack_aliases = UNSET elif isinstance(self.slack_aliases, list): @@ -155,41 +153,41 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: slug = d.pop("slug", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) _severity = d.pop("severity", UNSET) - severity: SeveritySeverity | Unset + severity: Union[Unset, SeveritySeverity] if isinstance(_severity, Unset): severity = UNSET else: severity = check_severity_severity(_severity) - def _parse_color(data: object) -> None | str | Unset: + def _parse_color(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) color = _parse_color(d.pop("color", UNSET)) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> Union[None, Unset, int]: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(Union[None, Unset, int], data) position = _parse_position(d.pop("position", UNSET)) - def _parse_notify_emails(data: object) -> list[str] | None | Unset: + def _parse_notify_emails(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -200,13 +198,13 @@ def _parse_notify_emails(data: object) -> list[str] | None | Unset: notify_emails_type_0 = cast(list[str], data) return notify_emails_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) notify_emails = _parse_notify_emails(d.pop("notify_emails", UNSET)) - def _parse_slack_channels(data: object) -> list[SeveritySlackChannelsType0Item] | None | Unset: + def _parse_slack_channels(data: object) -> Union[None, Unset, list["SeveritySlackChannelsType0Item"]]: if data is None: return data if isinstance(data, Unset): @@ -224,13 +222,13 @@ def _parse_slack_channels(data: object) -> list[SeveritySlackChannelsType0Item] slack_channels_type_0.append(slack_channels_type_0_item) return slack_channels_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[SeveritySlackChannelsType0Item] | None | Unset, data) + return cast(Union[None, Unset, list["SeveritySlackChannelsType0Item"]], data) slack_channels = _parse_slack_channels(d.pop("slack_channels", UNSET)) - def _parse_slack_aliases(data: object) -> list[SeveritySlackAliasesType0Item] | None | Unset: + def _parse_slack_aliases(data: object) -> Union[None, Unset, list["SeveritySlackAliasesType0Item"]]: if data is None: return data if isinstance(data, Unset): @@ -246,9 +244,9 @@ def _parse_slack_aliases(data: object) -> list[SeveritySlackAliasesType0Item] | slack_aliases_type_0.append(slack_aliases_type_0_item) return slack_aliases_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[SeveritySlackAliasesType0Item] | None | Unset, data) + return cast(Union[None, Unset, list["SeveritySlackAliasesType0Item"]], data) slack_aliases = _parse_slack_aliases(d.pop("slack_aliases", UNSET)) diff --git a/rootly_sdk/models/severity_list.py b/rootly_sdk/models/severity_list.py index fbde9c29..9b35bde0 100644 --- a/rootly_sdk/models/severity_list.py +++ b/rootly_sdk/models/severity_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,20 +20,19 @@ class SeverityList: """ Attributes: - data (list[SeverityListDataItem]): + data (list['SeverityListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[SeverityListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["SeverityListDataItem"] + links: "Links" + meta: "Meta" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) severity_list = cls( data=data, diff --git a/rootly_sdk/models/severity_list_data_item.py b/rootly_sdk/models/severity_list_data_item.py index c720e231..75581779 100644 --- a/rootly_sdk/models/severity_list_data_item.py +++ b/rootly_sdk/models/severity_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class SeverityListDataItem: id: str type_: SeverityListDataItemType - attributes: Severity + attributes: "Severity" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/severity_response.py b/rootly_sdk/models/severity_response.py index 46d0252d..7c4877c7 100644 --- a/rootly_sdk/models/severity_response.py +++ b/rootly_sdk/models/severity_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,18 +19,17 @@ class SeverityResponse: """ Attributes: data (SeverityResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: SeverityResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "SeverityResponseData" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = SeverityResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) severity_response = cls( data=data, diff --git a/rootly_sdk/models/severity_response_data.py b/rootly_sdk/models/severity_response_data.py index 9382039a..45ad1467 100644 --- a/rootly_sdk/models/severity_response_data.py +++ b/rootly_sdk/models/severity_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class SeverityResponseData: id: str type_: SeverityResponseDataType - attributes: Severity + attributes: "Severity" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/severity_slack_aliases_type_0_item.py b/rootly_sdk/models/severity_slack_aliases_type_0_item.py index d7ac6e2f..62f76e97 100644 --- a/rootly_sdk/models/severity_slack_aliases_type_0_item.py +++ b/rootly_sdk/models/severity_slack_aliases_type_0_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/severity_slack_channels_type_0_item.py b/rootly_sdk/models/severity_slack_channels_type_0_item.py index 6412d29a..38119176 100644 --- a/rootly_sdk/models/severity_slack_channels_type_0_item.py +++ b/rootly_sdk/models/severity_slack_channels_type_0_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/shift.py b/rootly_sdk/models/shift.py index 2243e08f..bdffa207 100644 --- a/rootly_sdk/models/shift.py +++ b/rootly_sdk/models/shift.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,27 +14,27 @@ class Shift: """ Attributes: schedule_id (str): ID of schedule - rotation_id (None | str): ID of rotation + rotation_id (Union[None, str]): ID of rotation starts_at (str): Start datetime of shift ends_at (str): End datetime of shift is_override (bool): Denotes shift is an override shift is_shadow (bool): Denotes shift is a shadow shift - user_id (int | None | Unset): ID of user on shift + user_id (Union[None, Unset, int]): ID of user on shift """ schedule_id: str - rotation_id: None | str + rotation_id: Union[None, str] starts_at: str ends_at: str is_override: bool is_shadow: bool - user_id: int | None | Unset = UNSET + user_id: Union[None, Unset, int] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: schedule_id = self.schedule_id - rotation_id: None | str + rotation_id: Union[None, str] rotation_id = self.rotation_id starts_at = self.starts_at @@ -47,7 +45,7 @@ def to_dict(self) -> dict[str, Any]: is_shadow = self.is_shadow - user_id: int | None | Unset + user_id: Union[None, Unset, int] if isinstance(self.user_id, Unset): user_id = UNSET else: @@ -75,10 +73,10 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) schedule_id = d.pop("schedule_id") - def _parse_rotation_id(data: object) -> None | str: + def _parse_rotation_id(data: object) -> Union[None, str]: if data is None: return data - return cast(None | str, data) + return cast(Union[None, str], data) rotation_id = _parse_rotation_id(d.pop("rotation_id")) @@ -90,12 +88,12 @@ def _parse_rotation_id(data: object) -> None | str: is_shadow = d.pop("is_shadow") - def _parse_user_id(data: object) -> int | None | Unset: + def _parse_user_id(data: object) -> Union[None, Unset, int]: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(Union[None, Unset, int], data) user_id = _parse_user_id(d.pop("user_id", UNSET)) diff --git a/rootly_sdk/models/shift_coverage_request.py b/rootly_sdk/models/shift_coverage_request.py index 88ab9880..17460e8d 100644 --- a/rootly_sdk/models/shift_coverage_request.py +++ b/rootly_sdk/models/shift_coverage_request.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -27,12 +25,12 @@ class ShiftCoverageRequest: created_by_user_id (int): ID of the user who created the coverage request starts_at (str): Start datetime of the coverage request ends_at (str): End datetime of the coverage request - created_at (str | Unset): Date of creation - updated_at (str | Unset): Date of last update - schedule (ScheduleResponse | Unset): - shift (Shift | Unset): - original_shift_user (UserResponse | Unset): - created_by_user (UserResponse | Unset): + created_at (Union[Unset, str]): Date of creation + updated_at (Union[Unset, str]): Date of last update + schedule (Union[Unset, ScheduleResponse]): + shift (Union[Unset, Shift]): + original_shift_user (Union[Unset, UserResponse]): + created_by_user (Union[Unset, UserResponse]): """ schedule_id: str @@ -41,16 +39,15 @@ class ShiftCoverageRequest: created_by_user_id: int starts_at: str ends_at: str - created_at: str | Unset = UNSET - updated_at: str | Unset = UNSET - schedule: ScheduleResponse | Unset = UNSET - shift: Shift | Unset = UNSET - original_shift_user: UserResponse | Unset = UNSET - created_by_user: UserResponse | Unset = UNSET + created_at: Union[Unset, str] = UNSET + updated_at: Union[Unset, str] = UNSET + schedule: Union[Unset, "ScheduleResponse"] = UNSET + shift: Union[Unset, "Shift"] = UNSET + original_shift_user: Union[Unset, "UserResponse"] = UNSET + created_by_user: Union[Unset, "UserResponse"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - schedule_id = self.schedule_id shift_id = self.shift_id @@ -67,19 +64,19 @@ def to_dict(self) -> dict[str, Any]: updated_at = self.updated_at - schedule: dict[str, Any] | Unset = UNSET + schedule: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.schedule, Unset): schedule = self.schedule.to_dict() - shift: dict[str, Any] | Unset = UNSET + shift: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.shift, Unset): shift = self.shift.to_dict() - original_shift_user: dict[str, Any] | Unset = UNSET + original_shift_user: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.original_shift_user, Unset): original_shift_user = self.original_shift_user.to_dict() - created_by_user: dict[str, Any] | Unset = UNSET + created_by_user: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.created_by_user, Unset): created_by_user = self.created_by_user.to_dict() @@ -134,28 +131,28 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: updated_at = d.pop("updated_at", UNSET) _schedule = d.pop("schedule", UNSET) - schedule: ScheduleResponse | Unset + schedule: Union[Unset, ScheduleResponse] if isinstance(_schedule, Unset): schedule = UNSET else: schedule = ScheduleResponse.from_dict(_schedule) _shift = d.pop("shift", UNSET) - shift: Shift | Unset + shift: Union[Unset, Shift] if isinstance(_shift, Unset): shift = UNSET else: shift = Shift.from_dict(_shift) _original_shift_user = d.pop("original_shift_user", UNSET) - original_shift_user: UserResponse | Unset + original_shift_user: Union[Unset, UserResponse] if isinstance(_original_shift_user, Unset): original_shift_user = UNSET else: original_shift_user = UserResponse.from_dict(_original_shift_user) _created_by_user = d.pop("created_by_user", UNSET) - created_by_user: UserResponse | Unset + created_by_user: Union[Unset, UserResponse] if isinstance(_created_by_user, Unset): created_by_user = UNSET else: diff --git a/rootly_sdk/models/shift_coverage_request_list.py b/rootly_sdk/models/shift_coverage_request_list.py index 59327bd2..7b83fa4a 100644 --- a/rootly_sdk/models/shift_coverage_request_list.py +++ b/rootly_sdk/models/shift_coverage_request_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,34 +20,33 @@ class ShiftCoverageRequestList: """ Attributes: - data (list[ShiftCoverageRequestListDataItem]): - links (Links | Unset): - meta (Meta | Unset): - included (list[JsonapiIncludedResource] | Unset): + data (list['ShiftCoverageRequestListDataItem']): + links (Union[Unset, Links]): + meta (Union[Unset, Meta]): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[ShiftCoverageRequestListDataItem] - links: Links | Unset = UNSET - meta: Meta | Unset = UNSET - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["ShiftCoverageRequestListDataItem"] + links: Union[Unset, "Links"] = UNSET + meta: Union[Unset, "Meta"] = UNSET + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() data.append(data_item) - links: dict[str, Any] | Unset = UNSET + links: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.links, Unset): links = self.links.to_dict() - meta: dict[str, Any] | Unset = UNSET + meta: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.meta, Unset): meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -88,27 +85,25 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data.append(data_item) _links = d.pop("links", UNSET) - links: Links | Unset + links: Union[Unset, Links] if isinstance(_links, Unset): links = UNSET else: links = Links.from_dict(_links) _meta = d.pop("meta", UNSET) - meta: Meta | Unset + meta: Union[Unset, Meta] if isinstance(_meta, Unset): meta = UNSET else: meta = Meta.from_dict(_meta) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) shift_coverage_request_list = cls( data=data, diff --git a/rootly_sdk/models/shift_coverage_request_list_data_item.py b/rootly_sdk/models/shift_coverage_request_list_data_item.py index a7c95baa..a919ad5e 100644 --- a/rootly_sdk/models/shift_coverage_request_list_data_item.py +++ b/rootly_sdk/models/shift_coverage_request_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class ShiftCoverageRequestListDataItem: id: str type_: ShiftCoverageRequestListDataItemType - attributes: ShiftCoverageRequest + attributes: "ShiftCoverageRequest" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/shift_coverage_request_response.py b/rootly_sdk/models/shift_coverage_request_response.py index 8157d142..9af3f855 100644 --- a/rootly_sdk/models/shift_coverage_request_response.py +++ b/rootly_sdk/models/shift_coverage_request_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,18 +19,17 @@ class ShiftCoverageRequestResponse: """ Attributes: data (ShiftCoverageRequestResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: ShiftCoverageRequestResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "ShiftCoverageRequestResponseData" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = ShiftCoverageRequestResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) shift_coverage_request_response = cls( data=data, diff --git a/rootly_sdk/models/shift_coverage_request_response_data.py b/rootly_sdk/models/shift_coverage_request_response_data.py index e81cffef..367166f5 100644 --- a/rootly_sdk/models/shift_coverage_request_response_data.py +++ b/rootly_sdk/models/shift_coverage_request_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class ShiftCoverageRequestResponseData: id: str type_: ShiftCoverageRequestResponseDataType - attributes: ShiftCoverageRequest + attributes: "ShiftCoverageRequest" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/shift_list.py b/rootly_sdk/models/shift_list.py index 211abcdd..de3b755d 100644 --- a/rootly_sdk/models/shift_list.py +++ b/rootly_sdk/models/shift_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,28 +19,27 @@ class ShiftList: """ Attributes: - data (list[ShiftListDataItem]): - meta (Meta | Unset): - included (list[JsonapiIncludedResource] | Unset): + data (list['ShiftListDataItem']): + meta (Union[Unset, Meta]): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[ShiftListDataItem] - meta: Meta | Unset = UNSET - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["ShiftListDataItem"] + meta: Union[Unset, "Meta"] = UNSET + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() data.append(data_item) - meta: dict[str, Any] | Unset = UNSET + meta: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.meta, Unset): meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -78,20 +75,18 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data.append(data_item) _meta = d.pop("meta", UNSET) - meta: Meta | Unset + meta: Union[Unset, Meta] if isinstance(_meta, Unset): meta = UNSET else: meta = Meta.from_dict(_meta) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) shift_list = cls( data=data, diff --git a/rootly_sdk/models/shift_list_data_item.py b/rootly_sdk/models/shift_list_data_item.py index fb83466c..01605618 100644 --- a/rootly_sdk/models/shift_list_data_item.py +++ b/rootly_sdk/models/shift_list_data_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -24,24 +22,23 @@ class ShiftListDataItem: id (str): Unique ID of the shift type_ (ShiftListDataItemType): attributes (Shift): - relationships (ShiftRelationships | Unset): + relationships (Union[Unset, ShiftRelationships]): """ id: str type_: ShiftListDataItemType - attributes: Shift - relationships: ShiftRelationships | Unset = UNSET + attributes: "Shift" + relationships: Union[Unset, "ShiftRelationships"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ attributes = self.attributes.to_dict() - relationships: dict[str, Any] | Unset = UNSET + relationships: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.relationships, Unset): relationships = self.relationships.to_dict() @@ -72,7 +69,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = Shift.from_dict(d.pop("attributes")) _relationships = d.pop("relationships", UNSET) - relationships: ShiftRelationships | Unset + relationships: Union[Unset, ShiftRelationships] if isinstance(_relationships, Unset): relationships = UNSET else: diff --git a/rootly_sdk/models/shift_override.py b/rootly_sdk/models/shift_override.py index b96b91fe..96131f40 100644 --- a/rootly_sdk/models/shift_override.py +++ b/rootly_sdk/models/shift_override.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,14 +15,14 @@ class ShiftOverride: Attributes: shift_id (str): ID of shift created_by_user_id (int): User who created the override - created_at (str | Unset): Date of creation - updated_at (str | Unset): Date of last update + created_at (Union[Unset, str]): Date of creation + updated_at (Union[Unset, str]): Date of last update """ shift_id: str created_by_user_id: int - created_at: str | Unset = UNSET - updated_at: str | Unset = UNSET + created_at: Union[Unset, str] = UNSET + updated_at: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/shift_override_response.py b/rootly_sdk/models/shift_override_response.py index ee694604..170701b7 100644 --- a/rootly_sdk/models/shift_override_response.py +++ b/rootly_sdk/models/shift_override_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,18 +19,17 @@ class ShiftOverrideResponse: """ Attributes: data (ShiftOverrideResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: ShiftOverrideResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "ShiftOverrideResponseData" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = ShiftOverrideResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) shift_override_response = cls( data=data, diff --git a/rootly_sdk/models/shift_override_response_data.py b/rootly_sdk/models/shift_override_response_data.py index c49176ef..30c2fcd8 100644 --- a/rootly_sdk/models/shift_override_response_data.py +++ b/rootly_sdk/models/shift_override_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class ShiftOverrideResponseData: id: str type_: ShiftOverrideResponseDataType - attributes: ShiftOverride + attributes: "ShiftOverride" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/shift_relationships.py b/rootly_sdk/models/shift_relationships.py index bd1f2776..bf4234f8 100644 --- a/rootly_sdk/models/shift_relationships.py +++ b/rootly_sdk/models/shift_relationships.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,27 +19,26 @@ class ShiftRelationships: """ Attributes: - shift_override (ShiftRelationshipsShiftOverride | Unset): - user (ShiftRelationshipsUser | Unset): - assignee (ShiftRelationshipsAssignee | Unset): Assignee can be either a User or Schedule + shift_override (Union[Unset, ShiftRelationshipsShiftOverride]): + user (Union[Unset, ShiftRelationshipsUser]): + assignee (Union[Unset, ShiftRelationshipsAssignee]): Assignee can be either a User or Schedule """ - shift_override: ShiftRelationshipsShiftOverride | Unset = UNSET - user: ShiftRelationshipsUser | Unset = UNSET - assignee: ShiftRelationshipsAssignee | Unset = UNSET + shift_override: Union[Unset, "ShiftRelationshipsShiftOverride"] = UNSET + user: Union[Unset, "ShiftRelationshipsUser"] = UNSET + assignee: Union[Unset, "ShiftRelationshipsAssignee"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - - shift_override: dict[str, Any] | Unset = UNSET + shift_override: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.shift_override, Unset): shift_override = self.shift_override.to_dict() - user: dict[str, Any] | Unset = UNSET + user: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.user, Unset): user = self.user.to_dict() - assignee: dict[str, Any] | Unset = UNSET + assignee: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.assignee, Unset): assignee = self.assignee.to_dict() @@ -65,21 +62,21 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _shift_override = d.pop("shift_override", UNSET) - shift_override: ShiftRelationshipsShiftOverride | Unset + shift_override: Union[Unset, ShiftRelationshipsShiftOverride] if isinstance(_shift_override, Unset): shift_override = UNSET else: shift_override = ShiftRelationshipsShiftOverride.from_dict(_shift_override) _user = d.pop("user", UNSET) - user: ShiftRelationshipsUser | Unset + user: Union[Unset, ShiftRelationshipsUser] if isinstance(_user, Unset): user = UNSET else: user = ShiftRelationshipsUser.from_dict(_user) _assignee = d.pop("assignee", UNSET) - assignee: ShiftRelationshipsAssignee | Unset + assignee: Union[Unset, ShiftRelationshipsAssignee] if isinstance(_assignee, Unset): assignee = UNSET else: diff --git a/rootly_sdk/models/shift_relationships_assignee.py b/rootly_sdk/models/shift_relationships_assignee.py index 8c75aa9a..30a885f0 100644 --- a/rootly_sdk/models/shift_relationships_assignee.py +++ b/rootly_sdk/models/shift_relationships_assignee.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -20,16 +18,16 @@ class ShiftRelationshipsAssignee: """Assignee can be either a User or Schedule Attributes: - data (None | ShiftRelationshipsAssigneeDataType0 | Unset): + data (Union['ShiftRelationshipsAssigneeDataType0', None, Unset]): """ - data: None | ShiftRelationshipsAssigneeDataType0 | Unset = UNSET + data: Union["ShiftRelationshipsAssigneeDataType0", None, Unset] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: from ..models.shift_relationships_assignee_data_type_0 import ShiftRelationshipsAssigneeDataType0 - data: dict[str, Any] | None | Unset + data: Union[None, Unset, dict[str, Any]] if isinstance(self.data, Unset): data = UNSET elif isinstance(self.data, ShiftRelationshipsAssigneeDataType0): @@ -51,7 +49,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_data(data: object) -> None | ShiftRelationshipsAssigneeDataType0 | Unset: + def _parse_data(data: object) -> Union["ShiftRelationshipsAssigneeDataType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -62,9 +60,9 @@ def _parse_data(data: object) -> None | ShiftRelationshipsAssigneeDataType0 | Un data_type_0 = ShiftRelationshipsAssigneeDataType0.from_dict(data) return data_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(None | ShiftRelationshipsAssigneeDataType0 | Unset, data) + return cast(Union["ShiftRelationshipsAssigneeDataType0", None, Unset], data) data = _parse_data(d.pop("data", UNSET)) diff --git a/rootly_sdk/models/shift_relationships_assignee_data_type_0.py b/rootly_sdk/models/shift_relationships_assignee_data_type_0.py index 6d1a4577..378c8a6b 100644 --- a/rootly_sdk/models/shift_relationships_assignee_data_type_0.py +++ b/rootly_sdk/models/shift_relationships_assignee_data_type_0.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class ShiftRelationshipsAssigneeDataType0: """ Attributes: - id (str | Unset): - type_ (str | Unset): + id (Union[Unset, str]): + type_ (Union[Unset, str]): """ - id: str | Unset = UNSET - type_: str | Unset = UNSET + id: Union[Unset, str] = UNSET + type_: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/shift_relationships_shift_override.py b/rootly_sdk/models/shift_relationships_shift_override.py index 843e25e3..e070c6bb 100644 --- a/rootly_sdk/models/shift_relationships_shift_override.py +++ b/rootly_sdk/models/shift_relationships_shift_override.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,16 +17,16 @@ class ShiftRelationshipsShiftOverride: """ Attributes: - data (None | ShiftRelationshipsShiftOverrideDataType0 | Unset): + data (Union['ShiftRelationshipsShiftOverrideDataType0', None, Unset]): """ - data: None | ShiftRelationshipsShiftOverrideDataType0 | Unset = UNSET + data: Union["ShiftRelationshipsShiftOverrideDataType0", None, Unset] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: from ..models.shift_relationships_shift_override_data_type_0 import ShiftRelationshipsShiftOverrideDataType0 - data: dict[str, Any] | None | Unset + data: Union[None, Unset, dict[str, Any]] if isinstance(self.data, Unset): data = UNSET elif isinstance(self.data, ShiftRelationshipsShiftOverrideDataType0): @@ -50,7 +48,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_data(data: object) -> None | ShiftRelationshipsShiftOverrideDataType0 | Unset: + def _parse_data(data: object) -> Union["ShiftRelationshipsShiftOverrideDataType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -61,9 +59,9 @@ def _parse_data(data: object) -> None | ShiftRelationshipsShiftOverrideDataType0 data_type_0 = ShiftRelationshipsShiftOverrideDataType0.from_dict(data) return data_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(None | ShiftRelationshipsShiftOverrideDataType0 | Unset, data) + return cast(Union["ShiftRelationshipsShiftOverrideDataType0", None, Unset], data) data = _parse_data(d.pop("data", UNSET)) diff --git a/rootly_sdk/models/shift_relationships_shift_override_data_type_0.py b/rootly_sdk/models/shift_relationships_shift_override_data_type_0.py index d5650162..d9ecf6b6 100644 --- a/rootly_sdk/models/shift_relationships_shift_override_data_type_0.py +++ b/rootly_sdk/models/shift_relationships_shift_override_data_type_0.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,18 +17,18 @@ class ShiftRelationshipsShiftOverrideDataType0: """ Attributes: - id (str | Unset): - type_ (ShiftRelationshipsShiftOverrideDataType0Type | Unset): + id (Union[Unset, str]): + type_ (Union[Unset, ShiftRelationshipsShiftOverrideDataType0Type]): """ - id: str | Unset = UNSET - type_: ShiftRelationshipsShiftOverrideDataType0Type | Unset = UNSET + id: Union[Unset, str] = UNSET + type_: Union[Unset, ShiftRelationshipsShiftOverrideDataType0Type] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: id = self.id - type_: str | Unset = UNSET + type_: Union[Unset, str] = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ @@ -50,7 +48,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: id = d.pop("id", UNSET) _type_ = d.pop("type", UNSET) - type_: ShiftRelationshipsShiftOverrideDataType0Type | Unset + type_: Union[Unset, ShiftRelationshipsShiftOverrideDataType0Type] if isinstance(_type_, Unset): type_ = UNSET else: diff --git a/rootly_sdk/models/shift_relationships_user.py b/rootly_sdk/models/shift_relationships_user.py index 0e550589..69e23839 100644 --- a/rootly_sdk/models/shift_relationships_user.py +++ b/rootly_sdk/models/shift_relationships_user.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,16 +17,16 @@ class ShiftRelationshipsUser: """ Attributes: - data (None | ShiftRelationshipsUserDataType0 | Unset): + data (Union['ShiftRelationshipsUserDataType0', None, Unset]): """ - data: None | ShiftRelationshipsUserDataType0 | Unset = UNSET + data: Union["ShiftRelationshipsUserDataType0", None, Unset] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: from ..models.shift_relationships_user_data_type_0 import ShiftRelationshipsUserDataType0 - data: dict[str, Any] | None | Unset + data: Union[None, Unset, dict[str, Any]] if isinstance(self.data, Unset): data = UNSET elif isinstance(self.data, ShiftRelationshipsUserDataType0): @@ -50,7 +48,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_data(data: object) -> None | ShiftRelationshipsUserDataType0 | Unset: + def _parse_data(data: object) -> Union["ShiftRelationshipsUserDataType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -61,9 +59,9 @@ def _parse_data(data: object) -> None | ShiftRelationshipsUserDataType0 | Unset: data_type_0 = ShiftRelationshipsUserDataType0.from_dict(data) return data_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(None | ShiftRelationshipsUserDataType0 | Unset, data) + return cast(Union["ShiftRelationshipsUserDataType0", None, Unset], data) data = _parse_data(d.pop("data", UNSET)) diff --git a/rootly_sdk/models/shift_relationships_user_data_type_0.py b/rootly_sdk/models/shift_relationships_user_data_type_0.py index edc4b248..39d6ebf6 100644 --- a/rootly_sdk/models/shift_relationships_user_data_type_0.py +++ b/rootly_sdk/models/shift_relationships_user_data_type_0.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,18 +17,18 @@ class ShiftRelationshipsUserDataType0: """ Attributes: - id (str | Unset): - type_ (ShiftRelationshipsUserDataType0Type | Unset): + id (Union[Unset, str]): + type_ (Union[Unset, ShiftRelationshipsUserDataType0Type]): """ - id: str | Unset = UNSET - type_: ShiftRelationshipsUserDataType0Type | Unset = UNSET + id: Union[Unset, str] = UNSET + type_: Union[Unset, ShiftRelationshipsUserDataType0Type] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: id = self.id - type_: str | Unset = UNSET + type_: Union[Unset, str] = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ @@ -50,7 +48,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: id = d.pop("id", UNSET) _type_ = d.pop("type", UNSET) - type_: ShiftRelationshipsUserDataType0Type | Unset + type_: Union[Unset, ShiftRelationshipsUserDataType0Type] if isinstance(_type_, Unset): type_ = UNSET else: diff --git a/rootly_sdk/models/simple_trigger_params.py b/rootly_sdk/models/simple_trigger_params.py index 75b0f282..dbe827df 100644 --- a/rootly_sdk/models/simple_trigger_params.py +++ b/rootly_sdk/models/simple_trigger_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -24,17 +22,17 @@ class SimpleTriggerParams: """ Attributes: trigger_type (SimpleTriggerParamsTriggerType): - triggers (list[SimpleTriggerParamsTriggersItem] | Unset): + triggers (Union[Unset, list[SimpleTriggerParamsTriggersItem]]): """ trigger_type: SimpleTriggerParamsTriggerType - triggers: list[SimpleTriggerParamsTriggersItem] | Unset = UNSET + triggers: Union[Unset, list[SimpleTriggerParamsTriggersItem]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: trigger_type: str = self.trigger_type - triggers: list[str] | Unset = UNSET + triggers: Union[Unset, list[str]] = UNSET if not isinstance(self.triggers, Unset): triggers = [] for triggers_item_data in self.triggers: @@ -58,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) trigger_type = check_simple_trigger_params_trigger_type(d.pop("trigger_type")) + triggers = [] _triggers = d.pop("triggers", UNSET) - triggers: list[SimpleTriggerParamsTriggersItem] | Unset = UNSET - if _triggers is not UNSET: - triggers = [] - for triggers_item_data in _triggers: - triggers_item = check_simple_trigger_params_triggers_item(triggers_item_data) + for triggers_item_data in _triggers or []: + triggers_item = check_simple_trigger_params_triggers_item(triggers_item_data) - triggers.append(triggers_item) + triggers.append(triggers_item) simple_trigger_params = cls( trigger_type=trigger_type, diff --git a/rootly_sdk/models/sla.py b/rootly_sdk/models/sla.py index cd69fc88..370aff94 100644 --- a/rootly_sdk/models/sla.py +++ b/rootly_sdk/models/sla.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from uuid import UUID from attrs import define as _attrs_define @@ -31,22 +29,23 @@ class Sla: completion_deadline_parent_status (str): The incident parent status that triggers the completion deadline created_at (str): Date of creation updated_at (str): Date of last update - slug (str | Unset): The slug of the SLA - description (None | str | Unset): A description of the SLA - position (int | Unset): Position of the SLA for ordering - entity_type (SlaEntityType | Unset): The entity type this SLA applies to - manager_role_id (None | Unset | UUID): The ID of the manager incident role. Exactly one of `manager_role_id` or - `manager_user_id` must be provided. - manager_user_id (int | None | Unset): The ID of the manager user. Exactly one of `manager_role_id` or + slug (Union[Unset, str]): The slug of the SLA + description (Union[None, Unset, str]): A description of the SLA + position (Union[Unset, int]): Position of the SLA for ordering + entity_type (Union[Unset, SlaEntityType]): The entity type this SLA applies to + manager_role_id (Union[None, UUID, Unset]): The ID of the manager incident role. Exactly one of + `manager_role_id` or `manager_user_id` must be provided. + manager_user_id (Union[None, Unset, int]): The ID of the manager user. Exactly one of `manager_role_id` or `manager_user_id` must be provided. - assignment_deadline_sub_status_id (None | Unset | UUID): Sub-status for the assignment deadline. Required when - custom lifecycle statuses are enabled on the team. - assignment_skip_weekends (bool | Unset): Whether to skip weekends when calculating the assignment deadline - completion_deadline_sub_status_id (None | Unset | UUID): Sub-status for the completion deadline. Required when - custom lifecycle statuses are enabled on the team. - completion_skip_weekends (bool | Unset): Whether to skip weekends when calculating the completion deadline - conditions (list[SlaConditionsItem] | Unset): Conditions that determine which incidents this SLA applies to - notification_configurations (list[SlaNotificationConfigurationsItem] | Unset): Notification timing + assignment_deadline_sub_status_id (Union[None, UUID, Unset]): Sub-status for the assignment deadline. Required + when custom lifecycle statuses are enabled on the team. + assignment_skip_weekends (Union[Unset, bool]): Whether to skip weekends when calculating the assignment deadline + completion_deadline_sub_status_id (Union[None, UUID, Unset]): Sub-status for the completion deadline. Required + when custom lifecycle statuses are enabled on the team. + completion_skip_weekends (Union[Unset, bool]): Whether to skip weekends when calculating the completion deadline + conditions (Union[Unset, list['SlaConditionsItem']]): Conditions that determine which incidents this SLA applies + to + notification_configurations (Union[Unset, list['SlaNotificationConfigurationsItem']]): Notification timing configurations """ @@ -58,22 +57,21 @@ class Sla: completion_deadline_parent_status: str created_at: str updated_at: str - slug: str | Unset = UNSET - description: None | str | Unset = UNSET - position: int | Unset = UNSET - entity_type: SlaEntityType | Unset = UNSET - manager_role_id: None | Unset | UUID = UNSET - manager_user_id: int | None | Unset = UNSET - assignment_deadline_sub_status_id: None | Unset | UUID = UNSET - assignment_skip_weekends: bool | Unset = UNSET - completion_deadline_sub_status_id: None | Unset | UUID = UNSET - completion_skip_weekends: bool | Unset = UNSET - conditions: list[SlaConditionsItem] | Unset = UNSET - notification_configurations: list[SlaNotificationConfigurationsItem] | Unset = UNSET + slug: Union[Unset, str] = UNSET + description: Union[None, Unset, str] = UNSET + position: Union[Unset, int] = UNSET + entity_type: Union[Unset, SlaEntityType] = UNSET + manager_role_id: Union[None, UUID, Unset] = UNSET + manager_user_id: Union[None, Unset, int] = UNSET + assignment_deadline_sub_status_id: Union[None, UUID, Unset] = UNSET + assignment_skip_weekends: Union[Unset, bool] = UNSET + completion_deadline_sub_status_id: Union[None, UUID, Unset] = UNSET + completion_skip_weekends: Union[Unset, bool] = UNSET + conditions: Union[Unset, list["SlaConditionsItem"]] = UNSET + notification_configurations: Union[Unset, list["SlaNotificationConfigurationsItem"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - name = self.name condition_match_type: str = self.condition_match_type @@ -92,7 +90,7 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - description: None | str | Unset + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: @@ -100,11 +98,11 @@ def to_dict(self) -> dict[str, Any]: position = self.position - entity_type: str | Unset = UNSET + entity_type: Union[Unset, str] = UNSET if not isinstance(self.entity_type, Unset): entity_type = self.entity_type - manager_role_id: None | str | Unset + manager_role_id: Union[None, Unset, str] if isinstance(self.manager_role_id, Unset): manager_role_id = UNSET elif isinstance(self.manager_role_id, UUID): @@ -112,13 +110,13 @@ def to_dict(self) -> dict[str, Any]: else: manager_role_id = self.manager_role_id - manager_user_id: int | None | Unset + manager_user_id: Union[None, Unset, int] if isinstance(self.manager_user_id, Unset): manager_user_id = UNSET else: manager_user_id = self.manager_user_id - assignment_deadline_sub_status_id: None | str | Unset + assignment_deadline_sub_status_id: Union[None, Unset, str] if isinstance(self.assignment_deadline_sub_status_id, Unset): assignment_deadline_sub_status_id = UNSET elif isinstance(self.assignment_deadline_sub_status_id, UUID): @@ -128,7 +126,7 @@ def to_dict(self) -> dict[str, Any]: assignment_skip_weekends = self.assignment_skip_weekends - completion_deadline_sub_status_id: None | str | Unset + completion_deadline_sub_status_id: Union[None, Unset, str] if isinstance(self.completion_deadline_sub_status_id, Unset): completion_deadline_sub_status_id = UNSET elif isinstance(self.completion_deadline_sub_status_id, UUID): @@ -138,14 +136,14 @@ def to_dict(self) -> dict[str, Any]: completion_skip_weekends = self.completion_skip_weekends - conditions: list[dict[str, Any]] | Unset = UNSET + conditions: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.conditions, Unset): conditions = [] for conditions_item_data in self.conditions: conditions_item = conditions_item_data.to_dict() conditions.append(conditions_item) - notification_configurations: list[dict[str, Any]] | Unset = UNSET + notification_configurations: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.notification_configurations, Unset): notification_configurations = [] for notification_configurations_item_data in self.notification_configurations: @@ -217,25 +215,25 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: slug = d.pop("slug", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) position = d.pop("position", UNSET) _entity_type = d.pop("entity_type", UNSET) - entity_type: SlaEntityType | Unset + entity_type: Union[Unset, SlaEntityType] if isinstance(_entity_type, Unset): entity_type = UNSET else: entity_type = check_sla_entity_type(_entity_type) - def _parse_manager_role_id(data: object) -> None | Unset | UUID: + def _parse_manager_role_id(data: object) -> Union[None, UUID, Unset]: if data is None: return data if isinstance(data, Unset): @@ -246,22 +244,22 @@ def _parse_manager_role_id(data: object) -> None | Unset | UUID: manager_role_id_type_0 = UUID(data) return manager_role_id_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(None | Unset | UUID, data) + return cast(Union[None, UUID, Unset], data) manager_role_id = _parse_manager_role_id(d.pop("manager_role_id", UNSET)) - def _parse_manager_user_id(data: object) -> int | None | Unset: + def _parse_manager_user_id(data: object) -> Union[None, Unset, int]: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(Union[None, Unset, int], data) manager_user_id = _parse_manager_user_id(d.pop("manager_user_id", UNSET)) - def _parse_assignment_deadline_sub_status_id(data: object) -> None | Unset | UUID: + def _parse_assignment_deadline_sub_status_id(data: object) -> Union[None, UUID, Unset]: if data is None: return data if isinstance(data, Unset): @@ -272,9 +270,9 @@ def _parse_assignment_deadline_sub_status_id(data: object) -> None | Unset | UUI assignment_deadline_sub_status_id_type_0 = UUID(data) return assignment_deadline_sub_status_id_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(None | Unset | UUID, data) + return cast(Union[None, UUID, Unset], data) assignment_deadline_sub_status_id = _parse_assignment_deadline_sub_status_id( d.pop("assignment_deadline_sub_status_id", UNSET) @@ -282,7 +280,7 @@ def _parse_assignment_deadline_sub_status_id(data: object) -> None | Unset | UUI assignment_skip_weekends = d.pop("assignment_skip_weekends", UNSET) - def _parse_completion_deadline_sub_status_id(data: object) -> None | Unset | UUID: + def _parse_completion_deadline_sub_status_id(data: object) -> Union[None, UUID, Unset]: if data is None: return data if isinstance(data, Unset): @@ -293,9 +291,9 @@ def _parse_completion_deadline_sub_status_id(data: object) -> None | Unset | UUI completion_deadline_sub_status_id_type_0 = UUID(data) return completion_deadline_sub_status_id_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(None | Unset | UUID, data) + return cast(Union[None, UUID, Unset], data) completion_deadline_sub_status_id = _parse_completion_deadline_sub_status_id( d.pop("completion_deadline_sub_status_id", UNSET) @@ -303,25 +301,21 @@ def _parse_completion_deadline_sub_status_id(data: object) -> None | Unset | UUI completion_skip_weekends = d.pop("completion_skip_weekends", UNSET) + conditions = [] _conditions = d.pop("conditions", UNSET) - conditions: list[SlaConditionsItem] | Unset = UNSET - if _conditions is not UNSET: - conditions = [] - for conditions_item_data in _conditions: - conditions_item = SlaConditionsItem.from_dict(conditions_item_data) + for conditions_item_data in _conditions or []: + conditions_item = SlaConditionsItem.from_dict(conditions_item_data) - conditions.append(conditions_item) + conditions.append(conditions_item) + notification_configurations = [] _notification_configurations = d.pop("notification_configurations", UNSET) - notification_configurations: list[SlaNotificationConfigurationsItem] | Unset = UNSET - if _notification_configurations is not UNSET: - notification_configurations = [] - for notification_configurations_item_data in _notification_configurations: - notification_configurations_item = SlaNotificationConfigurationsItem.from_dict( - notification_configurations_item_data - ) + for notification_configurations_item_data in _notification_configurations or []: + notification_configurations_item = SlaNotificationConfigurationsItem.from_dict( + notification_configurations_item_data + ) - notification_configurations.append(notification_configurations_item) + notification_configurations.append(notification_configurations_item) sla = cls( name=name, diff --git a/rootly_sdk/models/sla_conditions_item.py b/rootly_sdk/models/sla_conditions_item.py index 9a5b164e..6042e1f8 100644 --- a/rootly_sdk/models/sla_conditions_item.py +++ b/rootly_sdk/models/sla_conditions_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from uuid import UUID from attrs import define as _attrs_define @@ -20,36 +18,36 @@ class SlaConditionsItem: """ Attributes: - id (UUID | Unset): Unique ID of the condition - position (int | Unset): The position of the condition - conditionable_type (SlaConditionsItemConditionableType | Unset): The type of condition - property_ (None | str | Unset): The property to evaluate (for built-in field conditions) - operator (str | Unset): The comparison operator - values (list[str] | None | Unset): The values to compare against - form_field_id (None | Unset | UUID): The ID of the form field (for custom field conditions) + id (Union[Unset, UUID]): Unique ID of the condition + position (Union[Unset, int]): The position of the condition + conditionable_type (Union[Unset, SlaConditionsItemConditionableType]): The type of condition + property_ (Union[None, Unset, str]): The property to evaluate (for built-in field conditions) + operator (Union[Unset, str]): The comparison operator + values (Union[None, Unset, list[str]]): The values to compare against + form_field_id (Union[None, UUID, Unset]): The ID of the form field (for custom field conditions) """ - id: UUID | Unset = UNSET - position: int | Unset = UNSET - conditionable_type: SlaConditionsItemConditionableType | Unset = UNSET - property_: None | str | Unset = UNSET - operator: str | Unset = UNSET - values: list[str] | None | Unset = UNSET - form_field_id: None | Unset | UUID = UNSET + id: Union[Unset, UUID] = UNSET + position: Union[Unset, int] = UNSET + conditionable_type: Union[Unset, SlaConditionsItemConditionableType] = UNSET + property_: Union[None, Unset, str] = UNSET + operator: Union[Unset, str] = UNSET + values: Union[None, Unset, list[str]] = UNSET + form_field_id: Union[None, UUID, Unset] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id: str | Unset = UNSET + id: Union[Unset, str] = UNSET if not isinstance(self.id, Unset): id = str(self.id) position = self.position - conditionable_type: str | Unset = UNSET + conditionable_type: Union[Unset, str] = UNSET if not isinstance(self.conditionable_type, Unset): conditionable_type = self.conditionable_type - property_: None | str | Unset + property_: Union[None, Unset, str] if isinstance(self.property_, Unset): property_ = UNSET else: @@ -57,7 +55,7 @@ def to_dict(self) -> dict[str, Any]: operator = self.operator - values: list[str] | None | Unset + values: Union[None, Unset, list[str]] if isinstance(self.values, Unset): values = UNSET elif isinstance(self.values, list): @@ -66,7 +64,7 @@ def to_dict(self) -> dict[str, Any]: else: values = self.values - form_field_id: None | str | Unset + form_field_id: Union[None, Unset, str] if isinstance(self.form_field_id, Unset): form_field_id = UNSET elif isinstance(self.form_field_id, UUID): @@ -98,7 +96,7 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _id = d.pop("id", UNSET) - id: UUID | Unset + id: Union[Unset, UUID] if isinstance(_id, Unset): id = UNSET else: @@ -107,24 +105,24 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: position = d.pop("position", UNSET) _conditionable_type = d.pop("conditionable_type", UNSET) - conditionable_type: SlaConditionsItemConditionableType | Unset + conditionable_type: Union[Unset, SlaConditionsItemConditionableType] if isinstance(_conditionable_type, Unset): conditionable_type = UNSET else: conditionable_type = check_sla_conditions_item_conditionable_type(_conditionable_type) - def _parse_property_(data: object) -> None | str | Unset: + def _parse_property_(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) property_ = _parse_property_(d.pop("property", UNSET)) operator = d.pop("operator", UNSET) - def _parse_values(data: object) -> list[str] | None | Unset: + def _parse_values(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -135,13 +133,13 @@ def _parse_values(data: object) -> list[str] | None | Unset: values_type_0 = cast(list[str], data) return values_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) values = _parse_values(d.pop("values", UNSET)) - def _parse_form_field_id(data: object) -> None | Unset | UUID: + def _parse_form_field_id(data: object) -> Union[None, UUID, Unset]: if data is None: return data if isinstance(data, Unset): @@ -152,9 +150,9 @@ def _parse_form_field_id(data: object) -> None | Unset | UUID: form_field_id_type_0 = UUID(data) return form_field_id_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(None | Unset | UUID, data) + return cast(Union[None, UUID, Unset], data) form_field_id = _parse_form_field_id(d.pop("form_field_id", UNSET)) diff --git a/rootly_sdk/models/sla_list.py b/rootly_sdk/models/sla_list.py index 50204fc5..0f4611af 100644 --- a/rootly_sdk/models/sla_list.py +++ b/rootly_sdk/models/sla_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,20 +20,19 @@ class SlaList: """ Attributes: - data (list[SlaListDataItem]): + data (list['SlaListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[SlaListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["SlaListDataItem"] + links: "Links" + meta: "Meta" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) sla_list = cls( data=data, diff --git a/rootly_sdk/models/sla_list_data_item.py b/rootly_sdk/models/sla_list_data_item.py index 9810e984..850b573f 100644 --- a/rootly_sdk/models/sla_list_data_item.py +++ b/rootly_sdk/models/sla_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class SlaListDataItem: id: str type_: SlaListDataItemType - attributes: Sla + attributes: "Sla" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/sla_notification_configurations_item.py b/rootly_sdk/models/sla_notification_configurations_item.py index dfb47329..26abd32e 100644 --- a/rootly_sdk/models/sla_notification_configurations_item.py +++ b/rootly_sdk/models/sla_notification_configurations_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from uuid import UUID from attrs import define as _attrs_define @@ -20,27 +18,27 @@ class SlaNotificationConfigurationsItem: """ Attributes: - id (UUID | Unset): Unique ID of the notification configuration - offset_type (SlaNotificationConfigurationsItemOffsetType | Unset): When to send the notification relative to the - deadline - offset_days (int | Unset): Number of days offset from the deadline - created_at (str | Unset): Date of creation - updated_at (str | Unset): Date of last update + id (Union[Unset, UUID]): Unique ID of the notification configuration + offset_type (Union[Unset, SlaNotificationConfigurationsItemOffsetType]): When to send the notification relative + to the deadline + offset_days (Union[Unset, int]): Number of days offset from the deadline + created_at (Union[Unset, str]): Date of creation + updated_at (Union[Unset, str]): Date of last update """ - id: UUID | Unset = UNSET - offset_type: SlaNotificationConfigurationsItemOffsetType | Unset = UNSET - offset_days: int | Unset = UNSET - created_at: str | Unset = UNSET - updated_at: str | Unset = UNSET + id: Union[Unset, UUID] = UNSET + offset_type: Union[Unset, SlaNotificationConfigurationsItemOffsetType] = UNSET + offset_days: Union[Unset, int] = UNSET + created_at: Union[Unset, str] = UNSET + updated_at: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id: str | Unset = UNSET + id: Union[Unset, str] = UNSET if not isinstance(self.id, Unset): id = str(self.id) - offset_type: str | Unset = UNSET + offset_type: Union[Unset, str] = UNSET if not isinstance(self.offset_type, Unset): offset_type = self.offset_type @@ -70,14 +68,14 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _id = d.pop("id", UNSET) - id: UUID | Unset + id: Union[Unset, UUID] if isinstance(_id, Unset): id = UNSET else: id = UUID(_id) _offset_type = d.pop("offset_type", UNSET) - offset_type: SlaNotificationConfigurationsItemOffsetType | Unset + offset_type: Union[Unset, SlaNotificationConfigurationsItemOffsetType] if isinstance(_offset_type, Unset): offset_type = UNSET else: diff --git a/rootly_sdk/models/sla_response.py b/rootly_sdk/models/sla_response.py index 8876ead5..2b0d485c 100644 --- a/rootly_sdk/models/sla_response.py +++ b/rootly_sdk/models/sla_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,18 +19,17 @@ class SlaResponse: """ Attributes: data (SlaResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: SlaResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "SlaResponseData" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = SlaResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) sla_response = cls( data=data, diff --git a/rootly_sdk/models/sla_response_data.py b/rootly_sdk/models/sla_response_data.py index df5ff9fc..4e671418 100644 --- a/rootly_sdk/models/sla_response_data.py +++ b/rootly_sdk/models/sla_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class SlaResponseData: id: str type_: SlaResponseDataType - attributes: Sla + attributes: "Sla" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/slack_channel.py b/rootly_sdk/models/slack_channel.py index 845201cd..07a344c3 100644 --- a/rootly_sdk/models/slack_channel.py +++ b/rootly_sdk/models/slack_channel.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/snapshot_datadog_graph_task_params.py b/rootly_sdk/models/snapshot_datadog_graph_task_params.py index 2781d577..5f545c82 100644 --- a/rootly_sdk/models/snapshot_datadog_graph_task_params.py +++ b/rootly_sdk/models/snapshot_datadog_graph_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -27,43 +25,42 @@ class SnapshotDatadogGraphTaskParams: """ Attributes: past_duration (str): in format '1 minute', '30 days', '3 months', etc Example: 1 hour. - task_type (SnapshotDatadogGraphTaskParamsTaskType | Unset): - dashboards (list[SnapshotDatadogGraphTaskParamsDashboardsItem] | Unset): - metric_queries (list[str] | Unset): - post_to_incident_timeline (bool | Unset): - post_to_slack_channels (list[SnapshotDatadogGraphTaskParamsPostToSlackChannelsItem] | Unset): + task_type (Union[Unset, SnapshotDatadogGraphTaskParamsTaskType]): + dashboards (Union[Unset, list['SnapshotDatadogGraphTaskParamsDashboardsItem']]): + metric_queries (Union[Unset, list[str]]): + post_to_incident_timeline (Union[Unset, bool]): + post_to_slack_channels (Union[Unset, list['SnapshotDatadogGraphTaskParamsPostToSlackChannelsItem']]): """ past_duration: str - task_type: SnapshotDatadogGraphTaskParamsTaskType | Unset = UNSET - dashboards: list[SnapshotDatadogGraphTaskParamsDashboardsItem] | Unset = UNSET - metric_queries: list[str] | Unset = UNSET - post_to_incident_timeline: bool | Unset = UNSET - post_to_slack_channels: list[SnapshotDatadogGraphTaskParamsPostToSlackChannelsItem] | Unset = UNSET + task_type: Union[Unset, SnapshotDatadogGraphTaskParamsTaskType] = UNSET + dashboards: Union[Unset, list["SnapshotDatadogGraphTaskParamsDashboardsItem"]] = UNSET + metric_queries: Union[Unset, list[str]] = UNSET + post_to_incident_timeline: Union[Unset, bool] = UNSET + post_to_slack_channels: Union[Unset, list["SnapshotDatadogGraphTaskParamsPostToSlackChannelsItem"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - past_duration = self.past_duration - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - dashboards: list[dict[str, Any]] | Unset = UNSET + dashboards: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.dashboards, Unset): dashboards = [] for dashboards_item_data in self.dashboards: dashboards_item = dashboards_item_data.to_dict() dashboards.append(dashboards_item) - metric_queries: list[str] | Unset = UNSET + metric_queries: Union[Unset, list[str]] = UNSET if not isinstance(self.metric_queries, Unset): metric_queries = self.metric_queries post_to_incident_timeline = self.post_to_incident_timeline - post_to_slack_channels: list[dict[str, Any]] | Unset = UNSET + post_to_slack_channels: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.post_to_slack_channels, Unset): post_to_slack_channels = [] for post_to_slack_channels_item_data in self.post_to_slack_channels: @@ -103,35 +100,31 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: past_duration = d.pop("past_duration") _task_type = d.pop("task_type", UNSET) - task_type: SnapshotDatadogGraphTaskParamsTaskType | Unset + task_type: Union[Unset, SnapshotDatadogGraphTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: task_type = check_snapshot_datadog_graph_task_params_task_type(_task_type) + dashboards = [] _dashboards = d.pop("dashboards", UNSET) - dashboards: list[SnapshotDatadogGraphTaskParamsDashboardsItem] | Unset = UNSET - if _dashboards is not UNSET: - dashboards = [] - for dashboards_item_data in _dashboards: - dashboards_item = SnapshotDatadogGraphTaskParamsDashboardsItem.from_dict(dashboards_item_data) + for dashboards_item_data in _dashboards or []: + dashboards_item = SnapshotDatadogGraphTaskParamsDashboardsItem.from_dict(dashboards_item_data) - dashboards.append(dashboards_item) + dashboards.append(dashboards_item) metric_queries = cast(list[str], d.pop("metric_queries", UNSET)) post_to_incident_timeline = d.pop("post_to_incident_timeline", UNSET) + post_to_slack_channels = [] _post_to_slack_channels = d.pop("post_to_slack_channels", UNSET) - post_to_slack_channels: list[SnapshotDatadogGraphTaskParamsPostToSlackChannelsItem] | Unset = UNSET - if _post_to_slack_channels is not UNSET: - post_to_slack_channels = [] - for post_to_slack_channels_item_data in _post_to_slack_channels: - post_to_slack_channels_item = SnapshotDatadogGraphTaskParamsPostToSlackChannelsItem.from_dict( - post_to_slack_channels_item_data - ) + for post_to_slack_channels_item_data in _post_to_slack_channels or []: + post_to_slack_channels_item = SnapshotDatadogGraphTaskParamsPostToSlackChannelsItem.from_dict( + post_to_slack_channels_item_data + ) - post_to_slack_channels.append(post_to_slack_channels_item) + post_to_slack_channels.append(post_to_slack_channels_item) snapshot_datadog_graph_task_params = cls( past_duration=past_duration, diff --git a/rootly_sdk/models/snapshot_datadog_graph_task_params_dashboards_item.py b/rootly_sdk/models/snapshot_datadog_graph_task_params_dashboards_item.py index 9c746203..fe4cdea2 100644 --- a/rootly_sdk/models/snapshot_datadog_graph_task_params_dashboards_item.py +++ b/rootly_sdk/models/snapshot_datadog_graph_task_params_dashboards_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class SnapshotDatadogGraphTaskParamsDashboardsItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/snapshot_datadog_graph_task_params_post_to_slack_channels_item.py b/rootly_sdk/models/snapshot_datadog_graph_task_params_post_to_slack_channels_item.py index 1e3ef6f9..b020eb6b 100644 --- a/rootly_sdk/models/snapshot_datadog_graph_task_params_post_to_slack_channels_item.py +++ b/rootly_sdk/models/snapshot_datadog_graph_task_params_post_to_slack_channels_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class SnapshotDatadogGraphTaskParamsPostToSlackChannelsItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/snapshot_grafana_dashboard_task_params.py b/rootly_sdk/models/snapshot_grafana_dashboard_task_params.py index 48b44fbd..fe9d2ab9 100644 --- a/rootly_sdk/models/snapshot_grafana_dashboard_task_params.py +++ b/rootly_sdk/models/snapshot_grafana_dashboard_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -28,32 +26,31 @@ class SnapshotGrafanaDashboardTaskParams: """ Attributes: - dashboards (list[SnapshotGrafanaDashboardTaskParamsDashboardsItem]): - task_type (SnapshotGrafanaDashboardTaskParamsTaskType | Unset): - post_to_incident_timeline (bool | Unset): - post_to_slack_channels (list[SnapshotGrafanaDashboardTaskParamsPostToSlackChannelsItem] | Unset): + dashboards (list['SnapshotGrafanaDashboardTaskParamsDashboardsItem']): + task_type (Union[Unset, SnapshotGrafanaDashboardTaskParamsTaskType]): + post_to_incident_timeline (Union[Unset, bool]): + post_to_slack_channels (Union[Unset, list['SnapshotGrafanaDashboardTaskParamsPostToSlackChannelsItem']]): """ - dashboards: list[SnapshotGrafanaDashboardTaskParamsDashboardsItem] - task_type: SnapshotGrafanaDashboardTaskParamsTaskType | Unset = UNSET - post_to_incident_timeline: bool | Unset = UNSET - post_to_slack_channels: list[SnapshotGrafanaDashboardTaskParamsPostToSlackChannelsItem] | Unset = UNSET + dashboards: list["SnapshotGrafanaDashboardTaskParamsDashboardsItem"] + task_type: Union[Unset, SnapshotGrafanaDashboardTaskParamsTaskType] = UNSET + post_to_incident_timeline: Union[Unset, bool] = UNSET + post_to_slack_channels: Union[Unset, list["SnapshotGrafanaDashboardTaskParamsPostToSlackChannelsItem"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - dashboards = [] for dashboards_item_data in self.dashboards: dashboards_item = dashboards_item_data.to_dict() dashboards.append(dashboards_item) - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type post_to_incident_timeline = self.post_to_incident_timeline - post_to_slack_channels: list[dict[str, Any]] | Unset = UNSET + post_to_slack_channels: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.post_to_slack_channels, Unset): post_to_slack_channels = [] for post_to_slack_channels_item_data in self.post_to_slack_channels: @@ -94,7 +91,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: dashboards.append(dashboards_item) _task_type = d.pop("task_type", UNSET) - task_type: SnapshotGrafanaDashboardTaskParamsTaskType | Unset + task_type: Union[Unset, SnapshotGrafanaDashboardTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: @@ -102,16 +99,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: post_to_incident_timeline = d.pop("post_to_incident_timeline", UNSET) + post_to_slack_channels = [] _post_to_slack_channels = d.pop("post_to_slack_channels", UNSET) - post_to_slack_channels: list[SnapshotGrafanaDashboardTaskParamsPostToSlackChannelsItem] | Unset = UNSET - if _post_to_slack_channels is not UNSET: - post_to_slack_channels = [] - for post_to_slack_channels_item_data in _post_to_slack_channels: - post_to_slack_channels_item = SnapshotGrafanaDashboardTaskParamsPostToSlackChannelsItem.from_dict( - post_to_slack_channels_item_data - ) + for post_to_slack_channels_item_data in _post_to_slack_channels or []: + post_to_slack_channels_item = SnapshotGrafanaDashboardTaskParamsPostToSlackChannelsItem.from_dict( + post_to_slack_channels_item_data + ) - post_to_slack_channels.append(post_to_slack_channels_item) + post_to_slack_channels.append(post_to_slack_channels_item) snapshot_grafana_dashboard_task_params = cls( dashboards=dashboards, diff --git a/rootly_sdk/models/snapshot_grafana_dashboard_task_params_dashboards_item.py b/rootly_sdk/models/snapshot_grafana_dashboard_task_params_dashboards_item.py index 7b0c3437..af6bbf6b 100644 --- a/rootly_sdk/models/snapshot_grafana_dashboard_task_params_dashboards_item.py +++ b/rootly_sdk/models/snapshot_grafana_dashboard_task_params_dashboards_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class SnapshotGrafanaDashboardTaskParamsDashboardsItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/snapshot_grafana_dashboard_task_params_post_to_slack_channels_item.py b/rootly_sdk/models/snapshot_grafana_dashboard_task_params_post_to_slack_channels_item.py index cfa584d1..465e50ef 100644 --- a/rootly_sdk/models/snapshot_grafana_dashboard_task_params_post_to_slack_channels_item.py +++ b/rootly_sdk/models/snapshot_grafana_dashboard_task_params_post_to_slack_channels_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class SnapshotGrafanaDashboardTaskParamsPostToSlackChannelsItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/snapshot_looker_look_task_params.py b/rootly_sdk/models/snapshot_looker_look_task_params.py index 967ee38b..f4cf0f08 100644 --- a/rootly_sdk/models/snapshot_looker_look_task_params.py +++ b/rootly_sdk/models/snapshot_looker_look_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -26,32 +24,31 @@ class SnapshotLookerLookTaskParams: """ Attributes: - dashboards (list[SnapshotLookerLookTaskParamsDashboardsItem]): - task_type (SnapshotLookerLookTaskParamsTaskType | Unset): - post_to_incident_timeline (bool | Unset): - post_to_slack_channels (list[SnapshotLookerLookTaskParamsPostToSlackChannelsItem] | Unset): + dashboards (list['SnapshotLookerLookTaskParamsDashboardsItem']): + task_type (Union[Unset, SnapshotLookerLookTaskParamsTaskType]): + post_to_incident_timeline (Union[Unset, bool]): + post_to_slack_channels (Union[Unset, list['SnapshotLookerLookTaskParamsPostToSlackChannelsItem']]): """ - dashboards: list[SnapshotLookerLookTaskParamsDashboardsItem] - task_type: SnapshotLookerLookTaskParamsTaskType | Unset = UNSET - post_to_incident_timeline: bool | Unset = UNSET - post_to_slack_channels: list[SnapshotLookerLookTaskParamsPostToSlackChannelsItem] | Unset = UNSET + dashboards: list["SnapshotLookerLookTaskParamsDashboardsItem"] + task_type: Union[Unset, SnapshotLookerLookTaskParamsTaskType] = UNSET + post_to_incident_timeline: Union[Unset, bool] = UNSET + post_to_slack_channels: Union[Unset, list["SnapshotLookerLookTaskParamsPostToSlackChannelsItem"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - dashboards = [] for dashboards_item_data in self.dashboards: dashboards_item = dashboards_item_data.to_dict() dashboards.append(dashboards_item) - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type post_to_incident_timeline = self.post_to_incident_timeline - post_to_slack_channels: list[dict[str, Any]] | Unset = UNSET + post_to_slack_channels: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.post_to_slack_channels, Unset): post_to_slack_channels = [] for post_to_slack_channels_item_data in self.post_to_slack_channels: @@ -90,7 +87,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: dashboards.append(dashboards_item) _task_type = d.pop("task_type", UNSET) - task_type: SnapshotLookerLookTaskParamsTaskType | Unset + task_type: Union[Unset, SnapshotLookerLookTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: @@ -98,16 +95,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: post_to_incident_timeline = d.pop("post_to_incident_timeline", UNSET) + post_to_slack_channels = [] _post_to_slack_channels = d.pop("post_to_slack_channels", UNSET) - post_to_slack_channels: list[SnapshotLookerLookTaskParamsPostToSlackChannelsItem] | Unset = UNSET - if _post_to_slack_channels is not UNSET: - post_to_slack_channels = [] - for post_to_slack_channels_item_data in _post_to_slack_channels: - post_to_slack_channels_item = SnapshotLookerLookTaskParamsPostToSlackChannelsItem.from_dict( - post_to_slack_channels_item_data - ) + for post_to_slack_channels_item_data in _post_to_slack_channels or []: + post_to_slack_channels_item = SnapshotLookerLookTaskParamsPostToSlackChannelsItem.from_dict( + post_to_slack_channels_item_data + ) - post_to_slack_channels.append(post_to_slack_channels_item) + post_to_slack_channels.append(post_to_slack_channels_item) snapshot_looker_look_task_params = cls( dashboards=dashboards, diff --git a/rootly_sdk/models/snapshot_looker_look_task_params_dashboards_item.py b/rootly_sdk/models/snapshot_looker_look_task_params_dashboards_item.py index 8f376d5f..11a21793 100644 --- a/rootly_sdk/models/snapshot_looker_look_task_params_dashboards_item.py +++ b/rootly_sdk/models/snapshot_looker_look_task_params_dashboards_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class SnapshotLookerLookTaskParamsDashboardsItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/snapshot_looker_look_task_params_post_to_slack_channels_item.py b/rootly_sdk/models/snapshot_looker_look_task_params_post_to_slack_channels_item.py index 919bbb01..949b2090 100644 --- a/rootly_sdk/models/snapshot_looker_look_task_params_post_to_slack_channels_item.py +++ b/rootly_sdk/models/snapshot_looker_look_task_params_post_to_slack_channels_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class SnapshotLookerLookTaskParamsPostToSlackChannelsItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/snapshot_new_relic_graph_task_params.py b/rootly_sdk/models/snapshot_new_relic_graph_task_params.py index be80e08d..7dda353c 100644 --- a/rootly_sdk/models/snapshot_new_relic_graph_task_params.py +++ b/rootly_sdk/models/snapshot_new_relic_graph_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -31,31 +29,30 @@ class SnapshotNewRelicGraphTaskParams: Attributes: metric_query (str): metric_type (SnapshotNewRelicGraphTaskParamsMetricType): - task_type (SnapshotNewRelicGraphTaskParamsTaskType | Unset): - post_to_incident_timeline (bool | Unset): - post_to_slack_channels (list[SnapshotNewRelicGraphTaskParamsPostToSlackChannelsItem] | Unset): + task_type (Union[Unset, SnapshotNewRelicGraphTaskParamsTaskType]): + post_to_incident_timeline (Union[Unset, bool]): + post_to_slack_channels (Union[Unset, list['SnapshotNewRelicGraphTaskParamsPostToSlackChannelsItem']]): """ metric_query: str metric_type: SnapshotNewRelicGraphTaskParamsMetricType - task_type: SnapshotNewRelicGraphTaskParamsTaskType | Unset = UNSET - post_to_incident_timeline: bool | Unset = UNSET - post_to_slack_channels: list[SnapshotNewRelicGraphTaskParamsPostToSlackChannelsItem] | Unset = UNSET + task_type: Union[Unset, SnapshotNewRelicGraphTaskParamsTaskType] = UNSET + post_to_incident_timeline: Union[Unset, bool] = UNSET + post_to_slack_channels: Union[Unset, list["SnapshotNewRelicGraphTaskParamsPostToSlackChannelsItem"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - metric_query = self.metric_query metric_type: str = self.metric_type - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type post_to_incident_timeline = self.post_to_incident_timeline - post_to_slack_channels: list[dict[str, Any]] | Unset = UNSET + post_to_slack_channels: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.post_to_slack_channels, Unset): post_to_slack_channels = [] for post_to_slack_channels_item_data in self.post_to_slack_channels: @@ -91,7 +88,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: metric_type = check_snapshot_new_relic_graph_task_params_metric_type(d.pop("metric_type")) _task_type = d.pop("task_type", UNSET) - task_type: SnapshotNewRelicGraphTaskParamsTaskType | Unset + task_type: Union[Unset, SnapshotNewRelicGraphTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: @@ -99,16 +96,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: post_to_incident_timeline = d.pop("post_to_incident_timeline", UNSET) + post_to_slack_channels = [] _post_to_slack_channels = d.pop("post_to_slack_channels", UNSET) - post_to_slack_channels: list[SnapshotNewRelicGraphTaskParamsPostToSlackChannelsItem] | Unset = UNSET - if _post_to_slack_channels is not UNSET: - post_to_slack_channels = [] - for post_to_slack_channels_item_data in _post_to_slack_channels: - post_to_slack_channels_item = SnapshotNewRelicGraphTaskParamsPostToSlackChannelsItem.from_dict( - post_to_slack_channels_item_data - ) + for post_to_slack_channels_item_data in _post_to_slack_channels or []: + post_to_slack_channels_item = SnapshotNewRelicGraphTaskParamsPostToSlackChannelsItem.from_dict( + post_to_slack_channels_item_data + ) - post_to_slack_channels.append(post_to_slack_channels_item) + post_to_slack_channels.append(post_to_slack_channels_item) snapshot_new_relic_graph_task_params = cls( metric_query=metric_query, diff --git a/rootly_sdk/models/snapshot_new_relic_graph_task_params_post_to_slack_channels_item.py b/rootly_sdk/models/snapshot_new_relic_graph_task_params_post_to_slack_channels_item.py index 143318a5..e26e74be 100644 --- a/rootly_sdk/models/snapshot_new_relic_graph_task_params_post_to_slack_channels_item.py +++ b/rootly_sdk/models/snapshot_new_relic_graph_task_params_post_to_slack_channels_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class SnapshotNewRelicGraphTaskParamsPostToSlackChannelsItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/snooze_alert.py b/rootly_sdk/models/snooze_alert.py index d4b37fda..186fac63 100644 --- a/rootly_sdk/models/snooze_alert.py +++ b/rootly_sdk/models/snooze_alert.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class SnoozeAlert: data (SnoozeAlertData): """ - data: SnoozeAlertData + data: "SnoozeAlertData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/snooze_alert_data.py b/rootly_sdk/models/snooze_alert_data.py index 32aaae38..bf68c5f4 100644 --- a/rootly_sdk/models/snooze_alert_data.py +++ b/rootly_sdk/models/snooze_alert_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class SnoozeAlertData: """ type_: SnoozeAlertDataType - attributes: SnoozeAlertDataAttributes + attributes: "SnoozeAlertDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/snooze_alert_data_attributes.py b/rootly_sdk/models/snooze_alert_data_attributes.py index 812d1f44..9fc61d54 100644 --- a/rootly_sdk/models/snooze_alert_data_attributes.py +++ b/rootly_sdk/models/snooze_alert_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/start_session_request.py b/rootly_sdk/models/start_session_request.py index bc7434a4..37104e49 100644 --- a/rootly_sdk/models/start_session_request.py +++ b/rootly_sdk/models/start_session_request.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,20 +14,20 @@ class StartSessionRequest: """ Attributes: - platform (StartSessionRequestPlatform | Unset): Meeting platform - title (None | str | Unset): Human-readable label for the recording session + platform (Union[Unset, StartSessionRequestPlatform]): Meeting platform + title (Union[None, Unset, str]): Human-readable label for the recording session """ - platform: StartSessionRequestPlatform | Unset = UNSET - title: None | str | Unset = UNSET + platform: Union[Unset, StartSessionRequestPlatform] = UNSET + title: Union[None, Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - platform: str | Unset = UNSET + platform: Union[Unset, str] = UNSET if not isinstance(self.platform, Unset): platform = self.platform - title: None | str | Unset + title: Union[None, Unset, str] if isinstance(self.title, Unset): title = UNSET else: @@ -49,18 +47,18 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _platform = d.pop("platform", UNSET) - platform: StartSessionRequestPlatform | Unset + platform: Union[Unset, StartSessionRequestPlatform] if isinstance(_platform, Unset): platform = UNSET else: platform = check_start_session_request_platform(_platform) - def _parse_title(data: object) -> None | str | Unset: + def _parse_title(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) title = _parse_title(d.pop("title", UNSET)) diff --git a/rootly_sdk/models/start_session_response.py b/rootly_sdk/models/start_session_response.py index 330d0ce5..f4d7fe0a 100644 --- a/rootly_sdk/models/start_session_response.py +++ b/rootly_sdk/models/start_session_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,15 +17,14 @@ class StartSessionResponse: """ Attributes: - data (StartSessionResponseData | Unset): + data (Union[Unset, StartSessionResponseData]): """ - data: StartSessionResponseData | Unset = UNSET + data: Union[Unset, "StartSessionResponseData"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - - data: dict[str, Any] | Unset = UNSET + data: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.data, Unset): data = self.data.to_dict() @@ -45,7 +42,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _data = d.pop("data", UNSET) - data: StartSessionResponseData | Unset + data: Union[Unset, StartSessionResponseData] if isinstance(_data, Unset): data = UNSET else: diff --git a/rootly_sdk/models/start_session_response_data.py b/rootly_sdk/models/start_session_response_data.py index 50fc32db..c110c2da 100644 --- a/rootly_sdk/models/start_session_response_data.py +++ b/rootly_sdk/models/start_session_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar from uuid import UUID diff --git a/rootly_sdk/models/status.py b/rootly_sdk/models/status.py index 629cb1f0..83d5aa1c 100644 --- a/rootly_sdk/models/status.py +++ b/rootly_sdk/models/status.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -20,8 +18,8 @@ class Status: enabled (bool): created_at (str): updated_at (str): - slug (str | Unset): - description (None | str | Unset): + slug (Union[Unset, str]): + description (Union[None, Unset, str]): """ name: str @@ -29,8 +27,8 @@ class Status: enabled: bool created_at: str updated_at: str - slug: str | Unset = UNSET - description: None | str | Unset = UNSET + slug: Union[Unset, str] = UNSET + description: Union[None, Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -46,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - description: None | str | Unset + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: @@ -85,12 +83,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: slug = d.pop("slug", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) diff --git a/rootly_sdk/models/status_list.py b/rootly_sdk/models/status_list.py index 5f0e0083..de17d50d 100644 --- a/rootly_sdk/models/status_list.py +++ b/rootly_sdk/models/status_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,20 +20,19 @@ class StatusList: """ Attributes: - data (list[StatusListDataItem]): + data (list['StatusListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[StatusListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["StatusListDataItem"] + links: "Links" + meta: "Meta" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) status_list = cls( data=data, diff --git a/rootly_sdk/models/status_list_data_item.py b/rootly_sdk/models/status_list_data_item.py index 95d811a0..6b27a0a1 100644 --- a/rootly_sdk/models/status_list_data_item.py +++ b/rootly_sdk/models/status_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class StatusListDataItem: id: str type_: StatusListDataItemType - attributes: Status + attributes: "Status" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/status_page.py b/rootly_sdk/models/status_page.py index 310d9446..964e1d2a 100644 --- a/rootly_sdk/models/status_page.py +++ b/rootly_sdk/models/status_page.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -38,76 +36,76 @@ class StatusPage: title (str): The title of the status page created_at (str): Date of creation updated_at (str): Date of last update - slug (str | Unset): The slug of the status page - public_title (None | str | Unset): The public title of the status page - description (None | str | Unset): The description of the status page - public_description (None | str | Unset): The public description of the status page - header_color (None | str | Unset): The color of the header. Eg. "#0061F2" - footer_color (None | str | Unset): The color of the footer. Eg. "#1F2F41" - allow_search_engine_index (bool | None | Unset): Allow search engines to include your public status page in + slug (Union[Unset, str]): The slug of the status page + public_title (Union[None, Unset, str]): The public title of the status page + description (Union[None, Unset, str]): The description of the status page + public_description (Union[None, Unset, str]): The public description of the status page + header_color (Union[None, Unset, str]): The color of the header. Eg. "#0061F2" + footer_color (Union[None, Unset, str]): The color of the footer. Eg. "#1F2F41" + allow_search_engine_index (Union[None, Unset, bool]): Allow search engines to include your public status page in search results - show_uptime (bool | None | Unset): Show uptime - show_uptime_last_days (StatusPageShowUptimeLastDays | Unset): Show uptime over x days - success_message (None | str | Unset): Message showing when all components are operational - failure_message (None | str | Unset): Message showing when at least one component is not operational - authentication_method (StatusPageAuthenticationMethod | Unset): Authentication method Default: 'none'. - authentication_enabled (bool | None | Unset): Enable authentication (deprecated - use authentication_method + show_uptime (Union[None, Unset, bool]): Show uptime + show_uptime_last_days (Union[Unset, StatusPageShowUptimeLastDays]): Show uptime over x days + success_message (Union[None, Unset, str]): Message showing when all components are operational + failure_message (Union[None, Unset, str]): Message showing when at least one component is not operational + authentication_method (Union[Unset, StatusPageAuthenticationMethod]): Authentication method Default: 'none'. + authentication_enabled (Union[None, Unset, bool]): Enable authentication (deprecated - use authentication_method instead) Default: False. - authentication_password (None | str | Unset): Authentication password - saml_idp_sso_service_url (None | str | Unset): SAML IdP SSO service URL - saml_idp_slo_service_url (None | str | Unset): SAML IdP SLO service URL - saml_idp_cert (None | str | Unset): SAML IdP certificate - saml_idp_cert_fingerprint (None | str | Unset): SAML IdP certificate fingerprint - saml_name_identifier_format (StatusPageSamlNameIdentifierFormat | Unset): SAML name identifier format - section_order (list[StatusPageSectionOrderType0Item] | None | Unset): Order of sections on the status page - website_url (None | str | Unset): Website URL - website_privacy_url (None | str | Unset): Website Privacy URL - website_support_url (None | str | Unset): Website Support URL - ga_tracking_id (None | str | Unset): Google Analytics tracking ID - time_zone (None | str | Unset): A valid IANA time zone name. Default: 'Etc/UTC'. - public (bool | None | Unset): Make the status page accessible to the public - service_ids (list[str] | Unset): Services attached to the status page - functionality_ids (list[str] | Unset): Functionalities attached to the status page - external_domain_names (list[str] | Unset): External domain names attached to the status page - cname_records (None | StatusPageCnameRecordsType0 | Unset): CNAME records mapping external domain names to their - DNS target values. These are populated asynchronously after setting external_domain_names. - enabled (bool | None | Unset): Enabled / Disable the status page + authentication_password (Union[None, Unset, str]): Authentication password + saml_idp_sso_service_url (Union[None, Unset, str]): SAML IdP SSO service URL + saml_idp_slo_service_url (Union[None, Unset, str]): SAML IdP SLO service URL + saml_idp_cert (Union[None, Unset, str]): SAML IdP certificate + saml_idp_cert_fingerprint (Union[None, Unset, str]): SAML IdP certificate fingerprint + saml_name_identifier_format (Union[Unset, StatusPageSamlNameIdentifierFormat]): SAML name identifier format + section_order (Union[None, Unset, list[StatusPageSectionOrderType0Item]]): Order of sections on the status page + website_url (Union[None, Unset, str]): Website URL + website_privacy_url (Union[None, Unset, str]): Website Privacy URL + website_support_url (Union[None, Unset, str]): Website Support URL + ga_tracking_id (Union[None, Unset, str]): Google Analytics tracking ID + time_zone (Union[None, Unset, str]): A valid IANA time zone name. Default: 'Etc/UTC'. + public (Union[None, Unset, bool]): Make the status page accessible to the public + service_ids (Union[Unset, list[str]]): Services attached to the status page + functionality_ids (Union[Unset, list[str]]): Functionalities attached to the status page + external_domain_names (Union[Unset, list[str]]): External domain names attached to the status page + cname_records (Union['StatusPageCnameRecordsType0', None, Unset]): CNAME records mapping external domain names + to their DNS target values. These are populated asynchronously after setting external_domain_names. + enabled (Union[None, Unset, bool]): Enabled / Disable the status page """ title: str created_at: str updated_at: str - slug: str | Unset = UNSET - public_title: None | str | Unset = UNSET - description: None | str | Unset = UNSET - public_description: None | str | Unset = UNSET - header_color: None | str | Unset = UNSET - footer_color: None | str | Unset = UNSET - allow_search_engine_index: bool | None | Unset = UNSET - show_uptime: bool | None | Unset = UNSET - show_uptime_last_days: StatusPageShowUptimeLastDays | Unset = UNSET - success_message: None | str | Unset = UNSET - failure_message: None | str | Unset = UNSET - authentication_method: StatusPageAuthenticationMethod | Unset = "none" - authentication_enabled: bool | None | Unset = False - authentication_password: None | str | Unset = UNSET - saml_idp_sso_service_url: None | str | Unset = UNSET - saml_idp_slo_service_url: None | str | Unset = UNSET - saml_idp_cert: None | str | Unset = UNSET - saml_idp_cert_fingerprint: None | str | Unset = UNSET - saml_name_identifier_format: StatusPageSamlNameIdentifierFormat | Unset = UNSET - section_order: list[StatusPageSectionOrderType0Item] | None | Unset = UNSET - website_url: None | str | Unset = UNSET - website_privacy_url: None | str | Unset = UNSET - website_support_url: None | str | Unset = UNSET - ga_tracking_id: None | str | Unset = UNSET - time_zone: None | str | Unset = "Etc/UTC" - public: bool | None | Unset = UNSET - service_ids: list[str] | Unset = UNSET - functionality_ids: list[str] | Unset = UNSET - external_domain_names: list[str] | Unset = UNSET - cname_records: None | StatusPageCnameRecordsType0 | Unset = UNSET - enabled: bool | None | Unset = UNSET + slug: Union[Unset, str] = UNSET + public_title: Union[None, Unset, str] = UNSET + description: Union[None, Unset, str] = UNSET + public_description: Union[None, Unset, str] = UNSET + header_color: Union[None, Unset, str] = UNSET + footer_color: Union[None, Unset, str] = UNSET + allow_search_engine_index: Union[None, Unset, bool] = UNSET + show_uptime: Union[None, Unset, bool] = UNSET + show_uptime_last_days: Union[Unset, StatusPageShowUptimeLastDays] = UNSET + success_message: Union[None, Unset, str] = UNSET + failure_message: Union[None, Unset, str] = UNSET + authentication_method: Union[Unset, StatusPageAuthenticationMethod] = "none" + authentication_enabled: Union[None, Unset, bool] = False + authentication_password: Union[None, Unset, str] = UNSET + saml_idp_sso_service_url: Union[None, Unset, str] = UNSET + saml_idp_slo_service_url: Union[None, Unset, str] = UNSET + saml_idp_cert: Union[None, Unset, str] = UNSET + saml_idp_cert_fingerprint: Union[None, Unset, str] = UNSET + saml_name_identifier_format: Union[Unset, StatusPageSamlNameIdentifierFormat] = UNSET + section_order: Union[None, Unset, list[StatusPageSectionOrderType0Item]] = UNSET + website_url: Union[None, Unset, str] = UNSET + website_privacy_url: Union[None, Unset, str] = UNSET + website_support_url: Union[None, Unset, str] = UNSET + ga_tracking_id: Union[None, Unset, str] = UNSET + time_zone: Union[None, Unset, str] = "Etc/UTC" + public: Union[None, Unset, bool] = UNSET + service_ids: Union[Unset, list[str]] = UNSET + functionality_ids: Union[Unset, list[str]] = UNSET + external_domain_names: Union[Unset, list[str]] = UNSET + cname_records: Union["StatusPageCnameRecordsType0", None, Unset] = UNSET + enabled: Union[None, Unset, bool] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -121,109 +119,109 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - public_title: None | str | Unset + public_title: Union[None, Unset, str] if isinstance(self.public_title, Unset): public_title = UNSET else: public_title = self.public_title - description: None | str | Unset + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: description = self.description - public_description: None | str | Unset + public_description: Union[None, Unset, str] if isinstance(self.public_description, Unset): public_description = UNSET else: public_description = self.public_description - header_color: None | str | Unset + header_color: Union[None, Unset, str] if isinstance(self.header_color, Unset): header_color = UNSET else: header_color = self.header_color - footer_color: None | str | Unset + footer_color: Union[None, Unset, str] if isinstance(self.footer_color, Unset): footer_color = UNSET else: footer_color = self.footer_color - allow_search_engine_index: bool | None | Unset + allow_search_engine_index: Union[None, Unset, bool] if isinstance(self.allow_search_engine_index, Unset): allow_search_engine_index = UNSET else: allow_search_engine_index = self.allow_search_engine_index - show_uptime: bool | None | Unset + show_uptime: Union[None, Unset, bool] if isinstance(self.show_uptime, Unset): show_uptime = UNSET else: show_uptime = self.show_uptime - show_uptime_last_days: int | Unset = UNSET + show_uptime_last_days: Union[Unset, int] = UNSET if not isinstance(self.show_uptime_last_days, Unset): show_uptime_last_days = self.show_uptime_last_days - success_message: None | str | Unset + success_message: Union[None, Unset, str] if isinstance(self.success_message, Unset): success_message = UNSET else: success_message = self.success_message - failure_message: None | str | Unset + failure_message: Union[None, Unset, str] if isinstance(self.failure_message, Unset): failure_message = UNSET else: failure_message = self.failure_message - authentication_method: str | Unset = UNSET + authentication_method: Union[Unset, str] = UNSET if not isinstance(self.authentication_method, Unset): authentication_method = self.authentication_method - authentication_enabled: bool | None | Unset + authentication_enabled: Union[None, Unset, bool] if isinstance(self.authentication_enabled, Unset): authentication_enabled = UNSET else: authentication_enabled = self.authentication_enabled - authentication_password: None | str | Unset + authentication_password: Union[None, Unset, str] if isinstance(self.authentication_password, Unset): authentication_password = UNSET else: authentication_password = self.authentication_password - saml_idp_sso_service_url: None | str | Unset + saml_idp_sso_service_url: Union[None, Unset, str] if isinstance(self.saml_idp_sso_service_url, Unset): saml_idp_sso_service_url = UNSET else: saml_idp_sso_service_url = self.saml_idp_sso_service_url - saml_idp_slo_service_url: None | str | Unset + saml_idp_slo_service_url: Union[None, Unset, str] if isinstance(self.saml_idp_slo_service_url, Unset): saml_idp_slo_service_url = UNSET else: saml_idp_slo_service_url = self.saml_idp_slo_service_url - saml_idp_cert: None | str | Unset + saml_idp_cert: Union[None, Unset, str] if isinstance(self.saml_idp_cert, Unset): saml_idp_cert = UNSET else: saml_idp_cert = self.saml_idp_cert - saml_idp_cert_fingerprint: None | str | Unset + saml_idp_cert_fingerprint: Union[None, Unset, str] if isinstance(self.saml_idp_cert_fingerprint, Unset): saml_idp_cert_fingerprint = UNSET else: saml_idp_cert_fingerprint = self.saml_idp_cert_fingerprint - saml_name_identifier_format: str | Unset = UNSET + saml_name_identifier_format: Union[Unset, str] = UNSET if not isinstance(self.saml_name_identifier_format, Unset): saml_name_identifier_format = self.saml_name_identifier_format - section_order: list[str] | None | Unset + section_order: Union[None, Unset, list[str]] if isinstance(self.section_order, Unset): section_order = UNSET elif isinstance(self.section_order, list): @@ -235,55 +233,55 @@ def to_dict(self) -> dict[str, Any]: else: section_order = self.section_order - website_url: None | str | Unset + website_url: Union[None, Unset, str] if isinstance(self.website_url, Unset): website_url = UNSET else: website_url = self.website_url - website_privacy_url: None | str | Unset + website_privacy_url: Union[None, Unset, str] if isinstance(self.website_privacy_url, Unset): website_privacy_url = UNSET else: website_privacy_url = self.website_privacy_url - website_support_url: None | str | Unset + website_support_url: Union[None, Unset, str] if isinstance(self.website_support_url, Unset): website_support_url = UNSET else: website_support_url = self.website_support_url - ga_tracking_id: None | str | Unset + ga_tracking_id: Union[None, Unset, str] if isinstance(self.ga_tracking_id, Unset): ga_tracking_id = UNSET else: ga_tracking_id = self.ga_tracking_id - time_zone: None | str | Unset + time_zone: Union[None, Unset, str] if isinstance(self.time_zone, Unset): time_zone = UNSET else: time_zone = self.time_zone - public: bool | None | Unset + public: Union[None, Unset, bool] if isinstance(self.public, Unset): public = UNSET else: public = self.public - service_ids: list[str] | Unset = UNSET + service_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.service_ids, Unset): service_ids = self.service_ids - functionality_ids: list[str] | Unset = UNSET + functionality_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.functionality_ids, Unset): functionality_ids = self.functionality_ids - external_domain_names: list[str] | Unset = UNSET + external_domain_names: Union[Unset, list[str]] = UNSET if not isinstance(self.external_domain_names, Unset): external_domain_names = self.external_domain_names - cname_records: dict[str, Any] | None | Unset + cname_records: Union[None, Unset, dict[str, Any]] if isinstance(self.cname_records, Unset): cname_records = UNSET elif isinstance(self.cname_records, StatusPageCnameRecordsType0): @@ -291,7 +289,7 @@ def to_dict(self) -> dict[str, Any]: else: cname_records = self.cname_records - enabled: bool | None | Unset + enabled: Union[None, Unset, bool] if isinstance(self.enabled, Unset): enabled = UNSET else: @@ -384,163 +382,163 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: slug = d.pop("slug", UNSET) - def _parse_public_title(data: object) -> None | str | Unset: + def _parse_public_title(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) public_title = _parse_public_title(d.pop("public_title", UNSET)) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) - def _parse_public_description(data: object) -> None | str | Unset: + def _parse_public_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) public_description = _parse_public_description(d.pop("public_description", UNSET)) - def _parse_header_color(data: object) -> None | str | Unset: + def _parse_header_color(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) header_color = _parse_header_color(d.pop("header_color", UNSET)) - def _parse_footer_color(data: object) -> None | str | Unset: + def _parse_footer_color(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) footer_color = _parse_footer_color(d.pop("footer_color", UNSET)) - def _parse_allow_search_engine_index(data: object) -> bool | None | Unset: + def _parse_allow_search_engine_index(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) allow_search_engine_index = _parse_allow_search_engine_index(d.pop("allow_search_engine_index", UNSET)) - def _parse_show_uptime(data: object) -> bool | None | Unset: + def _parse_show_uptime(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) show_uptime = _parse_show_uptime(d.pop("show_uptime", UNSET)) _show_uptime_last_days = d.pop("show_uptime_last_days", UNSET) - show_uptime_last_days: StatusPageShowUptimeLastDays | Unset + show_uptime_last_days: Union[Unset, StatusPageShowUptimeLastDays] if isinstance(_show_uptime_last_days, Unset): show_uptime_last_days = UNSET else: show_uptime_last_days = check_status_page_show_uptime_last_days(_show_uptime_last_days) - def _parse_success_message(data: object) -> None | str | Unset: + def _parse_success_message(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) success_message = _parse_success_message(d.pop("success_message", UNSET)) - def _parse_failure_message(data: object) -> None | str | Unset: + def _parse_failure_message(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) failure_message = _parse_failure_message(d.pop("failure_message", UNSET)) _authentication_method = d.pop("authentication_method", UNSET) - authentication_method: StatusPageAuthenticationMethod | Unset + authentication_method: Union[Unset, StatusPageAuthenticationMethod] if isinstance(_authentication_method, Unset): authentication_method = UNSET else: authentication_method = check_status_page_authentication_method(_authentication_method) - def _parse_authentication_enabled(data: object) -> bool | None | Unset: + def _parse_authentication_enabled(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) authentication_enabled = _parse_authentication_enabled(d.pop("authentication_enabled", UNSET)) - def _parse_authentication_password(data: object) -> None | str | Unset: + def _parse_authentication_password(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) authentication_password = _parse_authentication_password(d.pop("authentication_password", UNSET)) - def _parse_saml_idp_sso_service_url(data: object) -> None | str | Unset: + def _parse_saml_idp_sso_service_url(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) saml_idp_sso_service_url = _parse_saml_idp_sso_service_url(d.pop("saml_idp_sso_service_url", UNSET)) - def _parse_saml_idp_slo_service_url(data: object) -> None | str | Unset: + def _parse_saml_idp_slo_service_url(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) saml_idp_slo_service_url = _parse_saml_idp_slo_service_url(d.pop("saml_idp_slo_service_url", UNSET)) - def _parse_saml_idp_cert(data: object) -> None | str | Unset: + def _parse_saml_idp_cert(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) saml_idp_cert = _parse_saml_idp_cert(d.pop("saml_idp_cert", UNSET)) - def _parse_saml_idp_cert_fingerprint(data: object) -> None | str | Unset: + def _parse_saml_idp_cert_fingerprint(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) saml_idp_cert_fingerprint = _parse_saml_idp_cert_fingerprint(d.pop("saml_idp_cert_fingerprint", UNSET)) _saml_name_identifier_format = d.pop("saml_name_identifier_format", UNSET) - saml_name_identifier_format: StatusPageSamlNameIdentifierFormat | Unset + saml_name_identifier_format: Union[Unset, StatusPageSamlNameIdentifierFormat] if isinstance(_saml_name_identifier_format, Unset): saml_name_identifier_format = UNSET else: saml_name_identifier_format = check_status_page_saml_name_identifier_format(_saml_name_identifier_format) - def _parse_section_order(data: object) -> list[StatusPageSectionOrderType0Item] | None | Unset: + def _parse_section_order(data: object) -> Union[None, Unset, list[StatusPageSectionOrderType0Item]]: if data is None: return data if isinstance(data, Unset): @@ -558,63 +556,63 @@ def _parse_section_order(data: object) -> list[StatusPageSectionOrderType0Item] section_order_type_0.append(section_order_type_0_item) return section_order_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[StatusPageSectionOrderType0Item] | None | Unset, data) + return cast(Union[None, Unset, list[StatusPageSectionOrderType0Item]], data) section_order = _parse_section_order(d.pop("section_order", UNSET)) - def _parse_website_url(data: object) -> None | str | Unset: + def _parse_website_url(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) website_url = _parse_website_url(d.pop("website_url", UNSET)) - def _parse_website_privacy_url(data: object) -> None | str | Unset: + def _parse_website_privacy_url(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) website_privacy_url = _parse_website_privacy_url(d.pop("website_privacy_url", UNSET)) - def _parse_website_support_url(data: object) -> None | str | Unset: + def _parse_website_support_url(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) website_support_url = _parse_website_support_url(d.pop("website_support_url", UNSET)) - def _parse_ga_tracking_id(data: object) -> None | str | Unset: + def _parse_ga_tracking_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) ga_tracking_id = _parse_ga_tracking_id(d.pop("ga_tracking_id", UNSET)) - def _parse_time_zone(data: object) -> None | str | Unset: + def _parse_time_zone(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) time_zone = _parse_time_zone(d.pop("time_zone", UNSET)) - def _parse_public(data: object) -> bool | None | Unset: + def _parse_public(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) public = _parse_public(d.pop("public", UNSET)) @@ -624,7 +622,7 @@ def _parse_public(data: object) -> bool | None | Unset: external_domain_names = cast(list[str], d.pop("external_domain_names", UNSET)) - def _parse_cname_records(data: object) -> None | StatusPageCnameRecordsType0 | Unset: + def _parse_cname_records(data: object) -> Union["StatusPageCnameRecordsType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -635,18 +633,18 @@ def _parse_cname_records(data: object) -> None | StatusPageCnameRecordsType0 | U cname_records_type_0 = StatusPageCnameRecordsType0.from_dict(data) return cname_records_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(None | StatusPageCnameRecordsType0 | Unset, data) + return cast(Union["StatusPageCnameRecordsType0", None, Unset], data) cname_records = _parse_cname_records(d.pop("cname_records", UNSET)) - def _parse_enabled(data: object) -> bool | None | Unset: + def _parse_enabled(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) enabled = _parse_enabled(d.pop("enabled", UNSET)) diff --git a/rootly_sdk/models/status_page_announcement.py b/rootly_sdk/models/status_page_announcement.py new file mode 100644 index 00000000..534a280e --- /dev/null +++ b/rootly_sdk/models/status_page_announcement.py @@ -0,0 +1,121 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="StatusPageAnnouncement") + + +@_attrs_define +class StatusPageAnnouncement: + """ + Attributes: + status_page_id (str): ID of the status page the announcement was posted to + title (str): Title of the announcement + body (str): Body of the announcement + published_at (str): Date the announcement was published + created_at (str): Date of creation + updated_at (str): Date of last update + user_id (Union[None, Unset, int]): ID of the user who posted the announcement + """ + + status_page_id: str + title: str + body: str + published_at: str + created_at: str + updated_at: str + user_id: Union[None, Unset, int] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + status_page_id = self.status_page_id + + title = self.title + + body = self.body + + published_at = self.published_at + + created_at = self.created_at + + updated_at = self.updated_at + + user_id: Union[None, Unset, int] + if isinstance(self.user_id, Unset): + user_id = UNSET + else: + user_id = self.user_id + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "status_page_id": status_page_id, + "title": title, + "body": body, + "published_at": published_at, + "created_at": created_at, + "updated_at": updated_at, + } + ) + if user_id is not UNSET: + field_dict["user_id"] = user_id + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + status_page_id = d.pop("status_page_id") + + title = d.pop("title") + + body = d.pop("body") + + published_at = d.pop("published_at") + + created_at = d.pop("created_at") + + updated_at = d.pop("updated_at") + + def _parse_user_id(data: object) -> Union[None, Unset, int]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, int], data) + + user_id = _parse_user_id(d.pop("user_id", UNSET)) + + status_page_announcement = cls( + status_page_id=status_page_id, + title=title, + body=body, + published_at=published_at, + created_at=created_at, + updated_at=updated_at, + user_id=user_id, + ) + + status_page_announcement.additional_properties = d + return status_page_announcement + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/rootly_sdk/models/status_page_announcement_list.py b/rootly_sdk/models/status_page_announcement_list.py new file mode 100644 index 00000000..60e83b61 --- /dev/null +++ b/rootly_sdk/models/status_page_announcement_list.py @@ -0,0 +1,116 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.jsonapi_included_resource import JsonapiIncludedResource + from ..models.links import Links + from ..models.meta import Meta + from ..models.status_page_announcement_list_data_item import StatusPageAnnouncementListDataItem + + +T = TypeVar("T", bound="StatusPageAnnouncementList") + + +@_attrs_define +class StatusPageAnnouncementList: + """ + Attributes: + data (list['StatusPageAnnouncementListDataItem']): + links (Links): + meta (Meta): + included (Union[Unset, list['JsonapiIncludedResource']]): + """ + + data: list["StatusPageAnnouncementListDataItem"] + links: "Links" + meta: "Meta" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + data = [] + for data_item_data in self.data: + data_item = data_item_data.to_dict() + data.append(data_item) + + links = self.links.to_dict() + + meta = self.meta.to_dict() + + included: Union[Unset, list[dict[str, Any]]] = UNSET + if not isinstance(self.included, Unset): + included = [] + for included_item_data in self.included: + included_item = included_item_data.to_dict() + included.append(included_item) + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "data": data, + "links": links, + "meta": meta, + } + ) + if included is not UNSET: + field_dict["included"] = included + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.jsonapi_included_resource import JsonapiIncludedResource + from ..models.links import Links + from ..models.meta import Meta + from ..models.status_page_announcement_list_data_item import StatusPageAnnouncementListDataItem + + d = dict(src_dict) + data = [] + _data = d.pop("data") + for data_item_data in _data: + data_item = StatusPageAnnouncementListDataItem.from_dict(data_item_data) + + data.append(data_item) + + links = Links.from_dict(d.pop("links")) + + meta = Meta.from_dict(d.pop("meta")) + + included = [] + _included = d.pop("included", UNSET) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) + + included.append(included_item) + + status_page_announcement_list = cls( + data=data, + links=links, + meta=meta, + included=included, + ) + + status_page_announcement_list.additional_properties = d + return status_page_announcement_list + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/rootly_sdk/models/status_page_announcement_list_data_item.py b/rootly_sdk/models/status_page_announcement_list_data_item.py new file mode 100644 index 00000000..49f72003 --- /dev/null +++ b/rootly_sdk/models/status_page_announcement_list_data_item.py @@ -0,0 +1,86 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.status_page_announcement_list_data_item_type import ( + StatusPageAnnouncementListDataItemType, + check_status_page_announcement_list_data_item_type, +) + +if TYPE_CHECKING: + from ..models.status_page_announcement import StatusPageAnnouncement + + +T = TypeVar("T", bound="StatusPageAnnouncementListDataItem") + + +@_attrs_define +class StatusPageAnnouncementListDataItem: + """ + Attributes: + id (str): Unique ID of the status page announcement + type_ (StatusPageAnnouncementListDataItemType): + attributes (StatusPageAnnouncement): + """ + + id: str + type_: StatusPageAnnouncementListDataItemType + attributes: "StatusPageAnnouncement" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + type_: str = self.type_ + + attributes = self.attributes.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "type": type_, + "attributes": attributes, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.status_page_announcement import StatusPageAnnouncement + + d = dict(src_dict) + id = d.pop("id") + + type_ = check_status_page_announcement_list_data_item_type(d.pop("type")) + + attributes = StatusPageAnnouncement.from_dict(d.pop("attributes")) + + status_page_announcement_list_data_item = cls( + id=id, + type_=type_, + attributes=attributes, + ) + + status_page_announcement_list_data_item.additional_properties = d + return status_page_announcement_list_data_item + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/rootly_sdk/models/status_page_announcement_list_data_item_type.py b/rootly_sdk/models/status_page_announcement_list_data_item_type.py new file mode 100644 index 00000000..e0454e03 --- /dev/null +++ b/rootly_sdk/models/status_page_announcement_list_data_item_type.py @@ -0,0 +1,19 @@ +from typing import Literal, cast + +StatusPageAnnouncementListDataItemType = Literal["status_page_announcements"] + +STATUS_PAGE_ANNOUNCEMENT_LIST_DATA_ITEM_TYPE_VALUES: set[StatusPageAnnouncementListDataItemType] = { + "status_page_announcements", +} + + +def check_status_page_announcement_list_data_item_type( + value: str | None, +) -> StatusPageAnnouncementListDataItemType | None: + if value is None: + return None + if value in STATUS_PAGE_ANNOUNCEMENT_LIST_DATA_ITEM_TYPE_VALUES: + return cast(StatusPageAnnouncementListDataItemType, value) + raise TypeError( + f"Unexpected value {value!r}. Expected one of {STATUS_PAGE_ANNOUNCEMENT_LIST_DATA_ITEM_TYPE_VALUES!r}" + ) diff --git a/rootly_sdk/models/status_page_announcement_response.py b/rootly_sdk/models/status_page_announcement_response.py new file mode 100644 index 00000000..42d4333a --- /dev/null +++ b/rootly_sdk/models/status_page_announcement_response.py @@ -0,0 +1,88 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.jsonapi_included_resource import JsonapiIncludedResource + from ..models.status_page_announcement_response_data import StatusPageAnnouncementResponseData + + +T = TypeVar("T", bound="StatusPageAnnouncementResponse") + + +@_attrs_define +class StatusPageAnnouncementResponse: + """ + Attributes: + data (StatusPageAnnouncementResponseData): + included (Union[Unset, list['JsonapiIncludedResource']]): + """ + + data: "StatusPageAnnouncementResponseData" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + data = self.data.to_dict() + + included: Union[Unset, list[dict[str, Any]]] = UNSET + if not isinstance(self.included, Unset): + included = [] + for included_item_data in self.included: + included_item = included_item_data.to_dict() + included.append(included_item) + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "data": data, + } + ) + if included is not UNSET: + field_dict["included"] = included + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.jsonapi_included_resource import JsonapiIncludedResource + from ..models.status_page_announcement_response_data import StatusPageAnnouncementResponseData + + d = dict(src_dict) + data = StatusPageAnnouncementResponseData.from_dict(d.pop("data")) + + included = [] + _included = d.pop("included", UNSET) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) + + included.append(included_item) + + status_page_announcement_response = cls( + data=data, + included=included, + ) + + status_page_announcement_response.additional_properties = d + return status_page_announcement_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/rootly_sdk/models/status_page_announcement_response_data.py b/rootly_sdk/models/status_page_announcement_response_data.py new file mode 100644 index 00000000..07c7fe72 --- /dev/null +++ b/rootly_sdk/models/status_page_announcement_response_data.py @@ -0,0 +1,86 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.status_page_announcement_response_data_type import ( + StatusPageAnnouncementResponseDataType, + check_status_page_announcement_response_data_type, +) + +if TYPE_CHECKING: + from ..models.status_page_announcement import StatusPageAnnouncement + + +T = TypeVar("T", bound="StatusPageAnnouncementResponseData") + + +@_attrs_define +class StatusPageAnnouncementResponseData: + """ + Attributes: + id (str): Unique ID of the status page announcement + type_ (StatusPageAnnouncementResponseDataType): + attributes (StatusPageAnnouncement): + """ + + id: str + type_: StatusPageAnnouncementResponseDataType + attributes: "StatusPageAnnouncement" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + type_: str = self.type_ + + attributes = self.attributes.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "type": type_, + "attributes": attributes, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.status_page_announcement import StatusPageAnnouncement + + d = dict(src_dict) + id = d.pop("id") + + type_ = check_status_page_announcement_response_data_type(d.pop("type")) + + attributes = StatusPageAnnouncement.from_dict(d.pop("attributes")) + + status_page_announcement_response_data = cls( + id=id, + type_=type_, + attributes=attributes, + ) + + status_page_announcement_response_data.additional_properties = d + return status_page_announcement_response_data + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/rootly_sdk/models/status_page_announcement_response_data_type.py b/rootly_sdk/models/status_page_announcement_response_data_type.py new file mode 100644 index 00000000..b1cc6f2e --- /dev/null +++ b/rootly_sdk/models/status_page_announcement_response_data_type.py @@ -0,0 +1,19 @@ +from typing import Literal, cast + +StatusPageAnnouncementResponseDataType = Literal["status_page_announcements"] + +STATUS_PAGE_ANNOUNCEMENT_RESPONSE_DATA_TYPE_VALUES: set[StatusPageAnnouncementResponseDataType] = { + "status_page_announcements", +} + + +def check_status_page_announcement_response_data_type( + value: str | None, +) -> StatusPageAnnouncementResponseDataType | None: + if value is None: + return None + if value in STATUS_PAGE_ANNOUNCEMENT_RESPONSE_DATA_TYPE_VALUES: + return cast(StatusPageAnnouncementResponseDataType, value) + raise TypeError( + f"Unexpected value {value!r}. Expected one of {STATUS_PAGE_ANNOUNCEMENT_RESPONSE_DATA_TYPE_VALUES!r}" + ) diff --git a/rootly_sdk/models/status_page_cname_records_type_0.py b/rootly_sdk/models/status_page_cname_records_type_0.py index 372a2510..1993df34 100644 --- a/rootly_sdk/models/status_page_cname_records_type_0.py +++ b/rootly_sdk/models/status_page_cname_records_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -19,7 +17,6 @@ class StatusPageCnameRecordsType0: additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) diff --git a/rootly_sdk/models/status_page_component.py b/rootly_sdk/models/status_page_component.py new file mode 100644 index 00000000..8b6f6853 --- /dev/null +++ b/rootly_sdk/models/status_page_component.py @@ -0,0 +1,207 @@ +import datetime +from collections.abc import Mapping +from typing import Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field +from dateutil.parser import isoparse + +from ..models.status_page_component_status import StatusPageComponentStatus, check_status_page_component_status +from ..types import UNSET, Unset + +T = TypeVar("T", bound="StatusPageComponent") + + +@_attrs_define +class StatusPageComponent: + """ + Attributes: + status_page_id (str): + position (int): Position of the component + created_at (datetime.datetime): Date of creation + updated_at (datetime.datetime): Date of last update + status_page_component_group_id (Union[None, Unset, str]): ID of the component group the component belongs to + name (Union[None, Unset, str]): Name of the component (derived from the source for catalog-backed components) + description (Union[None, Unset, str]): Description of the component (derived from the source for catalog-backed + components) + source_type (Union[None, Unset, str]): Catalog source type backing the component (null for ad-hoc components) + source_id (Union[None, Unset, str]): ID of the catalog source backing the component (null for ad-hoc components) + status (Union[Unset, StatusPageComponentStatus]): Latest recorded status of the component + """ + + status_page_id: str + position: int + created_at: datetime.datetime + updated_at: datetime.datetime + status_page_component_group_id: Union[None, Unset, str] = UNSET + name: Union[None, Unset, str] = UNSET + description: Union[None, Unset, str] = UNSET + source_type: Union[None, Unset, str] = UNSET + source_id: Union[None, Unset, str] = UNSET + status: Union[Unset, StatusPageComponentStatus] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + status_page_id = self.status_page_id + + position = self.position + + created_at = self.created_at.isoformat() + + updated_at = self.updated_at.isoformat() + + status_page_component_group_id: Union[None, Unset, str] + if isinstance(self.status_page_component_group_id, Unset): + status_page_component_group_id = UNSET + else: + status_page_component_group_id = self.status_page_component_group_id + + name: Union[None, Unset, str] + if isinstance(self.name, Unset): + name = UNSET + else: + name = self.name + + description: Union[None, Unset, str] + if isinstance(self.description, Unset): + description = UNSET + else: + description = self.description + + source_type: Union[None, Unset, str] + if isinstance(self.source_type, Unset): + source_type = UNSET + else: + source_type = self.source_type + + source_id: Union[None, Unset, str] + if isinstance(self.source_id, Unset): + source_id = UNSET + else: + source_id = self.source_id + + status: Union[Unset, str] = UNSET + if not isinstance(self.status, Unset): + status = self.status + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "status_page_id": status_page_id, + "position": position, + "created_at": created_at, + "updated_at": updated_at, + } + ) + if status_page_component_group_id is not UNSET: + field_dict["status_page_component_group_id"] = status_page_component_group_id + if name is not UNSET: + field_dict["name"] = name + if description is not UNSET: + field_dict["description"] = description + if source_type is not UNSET: + field_dict["source_type"] = source_type + if source_id is not UNSET: + field_dict["source_id"] = source_id + if status is not UNSET: + field_dict["status"] = status + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + status_page_id = d.pop("status_page_id") + + position = d.pop("position") + + created_at = isoparse(d.pop("created_at")) + + updated_at = isoparse(d.pop("updated_at")) + + def _parse_status_page_component_group_id(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + status_page_component_group_id = _parse_status_page_component_group_id( + d.pop("status_page_component_group_id", UNSET) + ) + + def _parse_name(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + name = _parse_name(d.pop("name", UNSET)) + + def _parse_description(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + description = _parse_description(d.pop("description", UNSET)) + + def _parse_source_type(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + source_type = _parse_source_type(d.pop("source_type", UNSET)) + + def _parse_source_id(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + source_id = _parse_source_id(d.pop("source_id", UNSET)) + + _status = d.pop("status", UNSET) + status: Union[Unset, StatusPageComponentStatus] + if isinstance(_status, Unset): + status = UNSET + else: + status = check_status_page_component_status(_status) + + status_page_component = cls( + status_page_id=status_page_id, + position=position, + created_at=created_at, + updated_at=updated_at, + status_page_component_group_id=status_page_component_group_id, + name=name, + description=description, + source_type=source_type, + source_id=source_id, + status=status, + ) + + status_page_component.additional_properties = d + return status_page_component + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/rootly_sdk/models/status_page_component_group.py b/rootly_sdk/models/status_page_component_group.py new file mode 100644 index 00000000..00716130 --- /dev/null +++ b/rootly_sdk/models/status_page_component_group.py @@ -0,0 +1,124 @@ +import datetime +from collections.abc import Mapping +from typing import Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field +from dateutil.parser import isoparse + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="StatusPageComponentGroup") + + +@_attrs_define +class StatusPageComponentGroup: + """ + Attributes: + status_page_id (str): + name (str): Name of the component group + position (int): Position of the group on the status page's top-level list + created_at (datetime.datetime): Date of creation + updated_at (datetime.datetime): Date of last update + description (Union[None, Unset, str]): Description of the component group + collapsed_by_default (Union[Unset, bool]): Whether the group renders collapsed on the public page + """ + + status_page_id: str + name: str + position: int + created_at: datetime.datetime + updated_at: datetime.datetime + description: Union[None, Unset, str] = UNSET + collapsed_by_default: Union[Unset, bool] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + status_page_id = self.status_page_id + + name = self.name + + position = self.position + + created_at = self.created_at.isoformat() + + updated_at = self.updated_at.isoformat() + + description: Union[None, Unset, str] + if isinstance(self.description, Unset): + description = UNSET + else: + description = self.description + + collapsed_by_default = self.collapsed_by_default + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "status_page_id": status_page_id, + "name": name, + "position": position, + "created_at": created_at, + "updated_at": updated_at, + } + ) + if description is not UNSET: + field_dict["description"] = description + if collapsed_by_default is not UNSET: + field_dict["collapsed_by_default"] = collapsed_by_default + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + status_page_id = d.pop("status_page_id") + + name = d.pop("name") + + position = d.pop("position") + + created_at = isoparse(d.pop("created_at")) + + updated_at = isoparse(d.pop("updated_at")) + + def _parse_description(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + description = _parse_description(d.pop("description", UNSET)) + + collapsed_by_default = d.pop("collapsed_by_default", UNSET) + + status_page_component_group = cls( + status_page_id=status_page_id, + name=name, + position=position, + created_at=created_at, + updated_at=updated_at, + description=description, + collapsed_by_default=collapsed_by_default, + ) + + status_page_component_group.additional_properties = d + return status_page_component_group + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/rootly_sdk/models/status_page_component_group_list.py b/rootly_sdk/models/status_page_component_group_list.py new file mode 100644 index 00000000..7b19916d --- /dev/null +++ b/rootly_sdk/models/status_page_component_group_list.py @@ -0,0 +1,116 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.jsonapi_included_resource import JsonapiIncludedResource + from ..models.links import Links + from ..models.meta import Meta + from ..models.status_page_component_group_list_data_item import StatusPageComponentGroupListDataItem + + +T = TypeVar("T", bound="StatusPageComponentGroupList") + + +@_attrs_define +class StatusPageComponentGroupList: + """ + Attributes: + data (list['StatusPageComponentGroupListDataItem']): + links (Links): + meta (Meta): + included (Union[Unset, list['JsonapiIncludedResource']]): + """ + + data: list["StatusPageComponentGroupListDataItem"] + links: "Links" + meta: "Meta" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + data = [] + for data_item_data in self.data: + data_item = data_item_data.to_dict() + data.append(data_item) + + links = self.links.to_dict() + + meta = self.meta.to_dict() + + included: Union[Unset, list[dict[str, Any]]] = UNSET + if not isinstance(self.included, Unset): + included = [] + for included_item_data in self.included: + included_item = included_item_data.to_dict() + included.append(included_item) + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "data": data, + "links": links, + "meta": meta, + } + ) + if included is not UNSET: + field_dict["included"] = included + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.jsonapi_included_resource import JsonapiIncludedResource + from ..models.links import Links + from ..models.meta import Meta + from ..models.status_page_component_group_list_data_item import StatusPageComponentGroupListDataItem + + d = dict(src_dict) + data = [] + _data = d.pop("data") + for data_item_data in _data: + data_item = StatusPageComponentGroupListDataItem.from_dict(data_item_data) + + data.append(data_item) + + links = Links.from_dict(d.pop("links")) + + meta = Meta.from_dict(d.pop("meta")) + + included = [] + _included = d.pop("included", UNSET) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) + + included.append(included_item) + + status_page_component_group_list = cls( + data=data, + links=links, + meta=meta, + included=included, + ) + + status_page_component_group_list.additional_properties = d + return status_page_component_group_list + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/rootly_sdk/models/status_page_component_group_list_data_item.py b/rootly_sdk/models/status_page_component_group_list_data_item.py new file mode 100644 index 00000000..b1dc0e4a --- /dev/null +++ b/rootly_sdk/models/status_page_component_group_list_data_item.py @@ -0,0 +1,86 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.status_page_component_group_list_data_item_type import ( + StatusPageComponentGroupListDataItemType, + check_status_page_component_group_list_data_item_type, +) + +if TYPE_CHECKING: + from ..models.status_page_component_group import StatusPageComponentGroup + + +T = TypeVar("T", bound="StatusPageComponentGroupListDataItem") + + +@_attrs_define +class StatusPageComponentGroupListDataItem: + """ + Attributes: + id (str): Unique ID of the status page component group + type_ (StatusPageComponentGroupListDataItemType): + attributes (StatusPageComponentGroup): + """ + + id: str + type_: StatusPageComponentGroupListDataItemType + attributes: "StatusPageComponentGroup" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + type_: str = self.type_ + + attributes = self.attributes.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "type": type_, + "attributes": attributes, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.status_page_component_group import StatusPageComponentGroup + + d = dict(src_dict) + id = d.pop("id") + + type_ = check_status_page_component_group_list_data_item_type(d.pop("type")) + + attributes = StatusPageComponentGroup.from_dict(d.pop("attributes")) + + status_page_component_group_list_data_item = cls( + id=id, + type_=type_, + attributes=attributes, + ) + + status_page_component_group_list_data_item.additional_properties = d + return status_page_component_group_list_data_item + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/rootly_sdk/models/status_page_component_group_list_data_item_type.py b/rootly_sdk/models/status_page_component_group_list_data_item_type.py new file mode 100644 index 00000000..3825d6e3 --- /dev/null +++ b/rootly_sdk/models/status_page_component_group_list_data_item_type.py @@ -0,0 +1,19 @@ +from typing import Literal, cast + +StatusPageComponentGroupListDataItemType = Literal["status_page_component_groups"] + +STATUS_PAGE_COMPONENT_GROUP_LIST_DATA_ITEM_TYPE_VALUES: set[StatusPageComponentGroupListDataItemType] = { + "status_page_component_groups", +} + + +def check_status_page_component_group_list_data_item_type( + value: str | None, +) -> StatusPageComponentGroupListDataItemType | None: + if value is None: + return None + if value in STATUS_PAGE_COMPONENT_GROUP_LIST_DATA_ITEM_TYPE_VALUES: + return cast(StatusPageComponentGroupListDataItemType, value) + raise TypeError( + f"Unexpected value {value!r}. Expected one of {STATUS_PAGE_COMPONENT_GROUP_LIST_DATA_ITEM_TYPE_VALUES!r}" + ) diff --git a/rootly_sdk/models/status_page_component_group_response.py b/rootly_sdk/models/status_page_component_group_response.py new file mode 100644 index 00000000..dc741b20 --- /dev/null +++ b/rootly_sdk/models/status_page_component_group_response.py @@ -0,0 +1,88 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.jsonapi_included_resource import JsonapiIncludedResource + from ..models.status_page_component_group_response_data import StatusPageComponentGroupResponseData + + +T = TypeVar("T", bound="StatusPageComponentGroupResponse") + + +@_attrs_define +class StatusPageComponentGroupResponse: + """ + Attributes: + data (StatusPageComponentGroupResponseData): + included (Union[Unset, list['JsonapiIncludedResource']]): + """ + + data: "StatusPageComponentGroupResponseData" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + data = self.data.to_dict() + + included: Union[Unset, list[dict[str, Any]]] = UNSET + if not isinstance(self.included, Unset): + included = [] + for included_item_data in self.included: + included_item = included_item_data.to_dict() + included.append(included_item) + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "data": data, + } + ) + if included is not UNSET: + field_dict["included"] = included + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.jsonapi_included_resource import JsonapiIncludedResource + from ..models.status_page_component_group_response_data import StatusPageComponentGroupResponseData + + d = dict(src_dict) + data = StatusPageComponentGroupResponseData.from_dict(d.pop("data")) + + included = [] + _included = d.pop("included", UNSET) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) + + included.append(included_item) + + status_page_component_group_response = cls( + data=data, + included=included, + ) + + status_page_component_group_response.additional_properties = d + return status_page_component_group_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/rootly_sdk/models/status_page_component_group_response_data.py b/rootly_sdk/models/status_page_component_group_response_data.py new file mode 100644 index 00000000..b7a04aef --- /dev/null +++ b/rootly_sdk/models/status_page_component_group_response_data.py @@ -0,0 +1,86 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.status_page_component_group_response_data_type import ( + StatusPageComponentGroupResponseDataType, + check_status_page_component_group_response_data_type, +) + +if TYPE_CHECKING: + from ..models.status_page_component_group import StatusPageComponentGroup + + +T = TypeVar("T", bound="StatusPageComponentGroupResponseData") + + +@_attrs_define +class StatusPageComponentGroupResponseData: + """ + Attributes: + id (str): Unique ID of the status page component group + type_ (StatusPageComponentGroupResponseDataType): + attributes (StatusPageComponentGroup): + """ + + id: str + type_: StatusPageComponentGroupResponseDataType + attributes: "StatusPageComponentGroup" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + type_: str = self.type_ + + attributes = self.attributes.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "type": type_, + "attributes": attributes, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.status_page_component_group import StatusPageComponentGroup + + d = dict(src_dict) + id = d.pop("id") + + type_ = check_status_page_component_group_response_data_type(d.pop("type")) + + attributes = StatusPageComponentGroup.from_dict(d.pop("attributes")) + + status_page_component_group_response_data = cls( + id=id, + type_=type_, + attributes=attributes, + ) + + status_page_component_group_response_data.additional_properties = d + return status_page_component_group_response_data + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/rootly_sdk/models/status_page_component_group_response_data_type.py b/rootly_sdk/models/status_page_component_group_response_data_type.py new file mode 100644 index 00000000..20f6e77a --- /dev/null +++ b/rootly_sdk/models/status_page_component_group_response_data_type.py @@ -0,0 +1,19 @@ +from typing import Literal, cast + +StatusPageComponentGroupResponseDataType = Literal["status_page_component_groups"] + +STATUS_PAGE_COMPONENT_GROUP_RESPONSE_DATA_TYPE_VALUES: set[StatusPageComponentGroupResponseDataType] = { + "status_page_component_groups", +} + + +def check_status_page_component_group_response_data_type( + value: str | None, +) -> StatusPageComponentGroupResponseDataType | None: + if value is None: + return None + if value in STATUS_PAGE_COMPONENT_GROUP_RESPONSE_DATA_TYPE_VALUES: + return cast(StatusPageComponentGroupResponseDataType, value) + raise TypeError( + f"Unexpected value {value!r}. Expected one of {STATUS_PAGE_COMPONENT_GROUP_RESPONSE_DATA_TYPE_VALUES!r}" + ) diff --git a/rootly_sdk/models/status_page_component_list.py b/rootly_sdk/models/status_page_component_list.py new file mode 100644 index 00000000..9c570b62 --- /dev/null +++ b/rootly_sdk/models/status_page_component_list.py @@ -0,0 +1,116 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.jsonapi_included_resource import JsonapiIncludedResource + from ..models.links import Links + from ..models.meta import Meta + from ..models.status_page_component_list_data_item import StatusPageComponentListDataItem + + +T = TypeVar("T", bound="StatusPageComponentList") + + +@_attrs_define +class StatusPageComponentList: + """ + Attributes: + data (list['StatusPageComponentListDataItem']): + links (Links): + meta (Meta): + included (Union[Unset, list['JsonapiIncludedResource']]): + """ + + data: list["StatusPageComponentListDataItem"] + links: "Links" + meta: "Meta" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + data = [] + for data_item_data in self.data: + data_item = data_item_data.to_dict() + data.append(data_item) + + links = self.links.to_dict() + + meta = self.meta.to_dict() + + included: Union[Unset, list[dict[str, Any]]] = UNSET + if not isinstance(self.included, Unset): + included = [] + for included_item_data in self.included: + included_item = included_item_data.to_dict() + included.append(included_item) + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "data": data, + "links": links, + "meta": meta, + } + ) + if included is not UNSET: + field_dict["included"] = included + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.jsonapi_included_resource import JsonapiIncludedResource + from ..models.links import Links + from ..models.meta import Meta + from ..models.status_page_component_list_data_item import StatusPageComponentListDataItem + + d = dict(src_dict) + data = [] + _data = d.pop("data") + for data_item_data in _data: + data_item = StatusPageComponentListDataItem.from_dict(data_item_data) + + data.append(data_item) + + links = Links.from_dict(d.pop("links")) + + meta = Meta.from_dict(d.pop("meta")) + + included = [] + _included = d.pop("included", UNSET) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) + + included.append(included_item) + + status_page_component_list = cls( + data=data, + links=links, + meta=meta, + included=included, + ) + + status_page_component_list.additional_properties = d + return status_page_component_list + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/rootly_sdk/models/status_page_component_list_data_item.py b/rootly_sdk/models/status_page_component_list_data_item.py new file mode 100644 index 00000000..40cc9b1b --- /dev/null +++ b/rootly_sdk/models/status_page_component_list_data_item.py @@ -0,0 +1,86 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.status_page_component_list_data_item_type import ( + StatusPageComponentListDataItemType, + check_status_page_component_list_data_item_type, +) + +if TYPE_CHECKING: + from ..models.status_page_component import StatusPageComponent + + +T = TypeVar("T", bound="StatusPageComponentListDataItem") + + +@_attrs_define +class StatusPageComponentListDataItem: + """ + Attributes: + id (str): Unique ID of the status page component + type_ (StatusPageComponentListDataItemType): + attributes (StatusPageComponent): + """ + + id: str + type_: StatusPageComponentListDataItemType + attributes: "StatusPageComponent" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + type_: str = self.type_ + + attributes = self.attributes.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "type": type_, + "attributes": attributes, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.status_page_component import StatusPageComponent + + d = dict(src_dict) + id = d.pop("id") + + type_ = check_status_page_component_list_data_item_type(d.pop("type")) + + attributes = StatusPageComponent.from_dict(d.pop("attributes")) + + status_page_component_list_data_item = cls( + id=id, + type_=type_, + attributes=attributes, + ) + + status_page_component_list_data_item.additional_properties = d + return status_page_component_list_data_item + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/rootly_sdk/models/status_page_component_list_data_item_type.py b/rootly_sdk/models/status_page_component_list_data_item_type.py new file mode 100644 index 00000000..a5c205cd --- /dev/null +++ b/rootly_sdk/models/status_page_component_list_data_item_type.py @@ -0,0 +1,15 @@ +from typing import Literal, cast + +StatusPageComponentListDataItemType = Literal["status_page_components"] + +STATUS_PAGE_COMPONENT_LIST_DATA_ITEM_TYPE_VALUES: set[StatusPageComponentListDataItemType] = { + "status_page_components", +} + + +def check_status_page_component_list_data_item_type(value: str | None) -> StatusPageComponentListDataItemType | None: + if value is None: + return None + if value in STATUS_PAGE_COMPONENT_LIST_DATA_ITEM_TYPE_VALUES: + return cast(StatusPageComponentListDataItemType, value) + raise TypeError(f"Unexpected value {value!r}. Expected one of {STATUS_PAGE_COMPONENT_LIST_DATA_ITEM_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/status_page_component_response.py b/rootly_sdk/models/status_page_component_response.py new file mode 100644 index 00000000..0f7c67e0 --- /dev/null +++ b/rootly_sdk/models/status_page_component_response.py @@ -0,0 +1,88 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.jsonapi_included_resource import JsonapiIncludedResource + from ..models.status_page_component_response_data import StatusPageComponentResponseData + + +T = TypeVar("T", bound="StatusPageComponentResponse") + + +@_attrs_define +class StatusPageComponentResponse: + """ + Attributes: + data (StatusPageComponentResponseData): + included (Union[Unset, list['JsonapiIncludedResource']]): + """ + + data: "StatusPageComponentResponseData" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + data = self.data.to_dict() + + included: Union[Unset, list[dict[str, Any]]] = UNSET + if not isinstance(self.included, Unset): + included = [] + for included_item_data in self.included: + included_item = included_item_data.to_dict() + included.append(included_item) + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "data": data, + } + ) + if included is not UNSET: + field_dict["included"] = included + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.jsonapi_included_resource import JsonapiIncludedResource + from ..models.status_page_component_response_data import StatusPageComponentResponseData + + d = dict(src_dict) + data = StatusPageComponentResponseData.from_dict(d.pop("data")) + + included = [] + _included = d.pop("included", UNSET) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) + + included.append(included_item) + + status_page_component_response = cls( + data=data, + included=included, + ) + + status_page_component_response.additional_properties = d + return status_page_component_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/rootly_sdk/models/status_page_component_response_data.py b/rootly_sdk/models/status_page_component_response_data.py new file mode 100644 index 00000000..5226ae07 --- /dev/null +++ b/rootly_sdk/models/status_page_component_response_data.py @@ -0,0 +1,86 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.status_page_component_response_data_type import ( + StatusPageComponentResponseDataType, + check_status_page_component_response_data_type, +) + +if TYPE_CHECKING: + from ..models.status_page_component import StatusPageComponent + + +T = TypeVar("T", bound="StatusPageComponentResponseData") + + +@_attrs_define +class StatusPageComponentResponseData: + """ + Attributes: + id (str): Unique ID of the status page component + type_ (StatusPageComponentResponseDataType): + attributes (StatusPageComponent): + """ + + id: str + type_: StatusPageComponentResponseDataType + attributes: "StatusPageComponent" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + type_: str = self.type_ + + attributes = self.attributes.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "type": type_, + "attributes": attributes, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.status_page_component import StatusPageComponent + + d = dict(src_dict) + id = d.pop("id") + + type_ = check_status_page_component_response_data_type(d.pop("type")) + + attributes = StatusPageComponent.from_dict(d.pop("attributes")) + + status_page_component_response_data = cls( + id=id, + type_=type_, + attributes=attributes, + ) + + status_page_component_response_data.additional_properties = d + return status_page_component_response_data + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/rootly_sdk/models/status_page_component_response_data_type.py b/rootly_sdk/models/status_page_component_response_data_type.py new file mode 100644 index 00000000..53cc391c --- /dev/null +++ b/rootly_sdk/models/status_page_component_response_data_type.py @@ -0,0 +1,15 @@ +from typing import Literal, cast + +StatusPageComponentResponseDataType = Literal["status_page_components"] + +STATUS_PAGE_COMPONENT_RESPONSE_DATA_TYPE_VALUES: set[StatusPageComponentResponseDataType] = { + "status_page_components", +} + + +def check_status_page_component_response_data_type(value: str | None) -> StatusPageComponentResponseDataType | None: + if value is None: + return None + if value in STATUS_PAGE_COMPONENT_RESPONSE_DATA_TYPE_VALUES: + return cast(StatusPageComponentResponseDataType, value) + raise TypeError(f"Unexpected value {value!r}. Expected one of {STATUS_PAGE_COMPONENT_RESPONSE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/status_page_component_status.py b/rootly_sdk/models/status_page_component_status.py new file mode 100644 index 00000000..44bf5402 --- /dev/null +++ b/rootly_sdk/models/status_page_component_status.py @@ -0,0 +1,22 @@ +from typing import Literal, cast + +StatusPageComponentStatus = Literal[ + "degraded_performance", "impacted", "maintenance", "major_outage", "operational", "partial_outage" +] + +STATUS_PAGE_COMPONENT_STATUS_VALUES: set[StatusPageComponentStatus] = { + "degraded_performance", + "impacted", + "maintenance", + "major_outage", + "operational", + "partial_outage", +} + + +def check_status_page_component_status(value: str | None) -> StatusPageComponentStatus | None: + if value is None: + return None + if value in STATUS_PAGE_COMPONENT_STATUS_VALUES: + return cast(StatusPageComponentStatus, value) + raise TypeError(f"Unexpected value {value!r}. Expected one of {STATUS_PAGE_COMPONENT_STATUS_VALUES!r}") diff --git a/rootly_sdk/models/status_page_list.py b/rootly_sdk/models/status_page_list.py index 216a7858..b641db36 100644 --- a/rootly_sdk/models/status_page_list.py +++ b/rootly_sdk/models/status_page_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,20 +20,19 @@ class StatusPageList: """ Attributes: - data (list[StatusPageListDataItem]): + data (list['StatusPageListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[StatusPageListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["StatusPageListDataItem"] + links: "Links" + meta: "Meta" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) status_page_list = cls( data=data, diff --git a/rootly_sdk/models/status_page_list_data_item.py b/rootly_sdk/models/status_page_list_data_item.py index 8269723b..e1f97706 100644 --- a/rootly_sdk/models/status_page_list_data_item.py +++ b/rootly_sdk/models/status_page_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class StatusPageListDataItem: id: str type_: StatusPageListDataItemType - attributes: StatusPage + attributes: "StatusPage" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/status_page_response.py b/rootly_sdk/models/status_page_response.py index 68387501..a9e41904 100644 --- a/rootly_sdk/models/status_page_response.py +++ b/rootly_sdk/models/status_page_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,18 +19,17 @@ class StatusPageResponse: """ Attributes: data (StatusPageResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: StatusPageResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "StatusPageResponseData" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = StatusPageResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) status_page_response = cls( data=data, diff --git a/rootly_sdk/models/status_page_response_data.py b/rootly_sdk/models/status_page_response_data.py index 0b9f0474..84a57c52 100644 --- a/rootly_sdk/models/status_page_response_data.py +++ b/rootly_sdk/models/status_page_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class StatusPageResponseData: id: str type_: StatusPageResponseDataType - attributes: StatusPage + attributes: "StatusPage" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/status_page_template.py b/rootly_sdk/models/status_page_template.py index 082b8b2b..97e07199 100644 --- a/rootly_sdk/models/status_page_template.py +++ b/rootly_sdk/models/status_page_template.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,12 +19,12 @@ class StatusPageTemplate: body (str): Description of the event the template will populate created_at (str): Date of creation updated_at (str): Date of last update - update_title (None | str | Unset): Title that will be used for the status page update - update_status (None | str | Unset): Status of the event the template will populate - kind (StatusPageTemplateKind | Unset): The kind of the status page template - should_notify_subscribers (bool | None | Unset): Controls if incident subscribers should be notified - enabled (bool | None | Unset): Enable / Disable the status page template - position (int | Unset): Position of the workflow task + update_title (Union[None, Unset, str]): Title that will be used for the status page update + update_status (Union[None, Unset, str]): Status of the event the template will populate + kind (Union[Unset, StatusPageTemplateKind]): The kind of the status page template + should_notify_subscribers (Union[None, Unset, bool]): Controls if incident subscribers should be notified + enabled (Union[None, Unset, bool]): Enable / Disable the status page template + position (Union[Unset, int]): Position of the workflow task """ status_page_id: str @@ -34,12 +32,12 @@ class StatusPageTemplate: body: str created_at: str updated_at: str - update_title: None | str | Unset = UNSET - update_status: None | str | Unset = UNSET - kind: StatusPageTemplateKind | Unset = UNSET - should_notify_subscribers: bool | None | Unset = UNSET - enabled: bool | None | Unset = UNSET - position: int | Unset = UNSET + update_title: Union[None, Unset, str] = UNSET + update_status: Union[None, Unset, str] = UNSET + kind: Union[Unset, StatusPageTemplateKind] = UNSET + should_notify_subscribers: Union[None, Unset, bool] = UNSET + enabled: Union[None, Unset, bool] = UNSET + position: Union[Unset, int] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -53,29 +51,29 @@ def to_dict(self) -> dict[str, Any]: updated_at = self.updated_at - update_title: None | str | Unset + update_title: Union[None, Unset, str] if isinstance(self.update_title, Unset): update_title = UNSET else: update_title = self.update_title - update_status: None | str | Unset + update_status: Union[None, Unset, str] if isinstance(self.update_status, Unset): update_status = UNSET else: update_status = self.update_status - kind: str | Unset = UNSET + kind: Union[Unset, str] = UNSET if not isinstance(self.kind, Unset): kind = self.kind - should_notify_subscribers: bool | None | Unset + should_notify_subscribers: Union[None, Unset, bool] if isinstance(self.should_notify_subscribers, Unset): should_notify_subscribers = UNSET else: should_notify_subscribers = self.should_notify_subscribers - enabled: bool | None | Unset + enabled: Union[None, Unset, bool] if isinstance(self.enabled, Unset): enabled = UNSET else: @@ -122,46 +120,46 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: updated_at = d.pop("updated_at") - def _parse_update_title(data: object) -> None | str | Unset: + def _parse_update_title(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) update_title = _parse_update_title(d.pop("update_title", UNSET)) - def _parse_update_status(data: object) -> None | str | Unset: + def _parse_update_status(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) update_status = _parse_update_status(d.pop("update_status", UNSET)) _kind = d.pop("kind", UNSET) - kind: StatusPageTemplateKind | Unset + kind: Union[Unset, StatusPageTemplateKind] if isinstance(_kind, Unset): kind = UNSET else: kind = check_status_page_template_kind(_kind) - def _parse_should_notify_subscribers(data: object) -> bool | None | Unset: + def _parse_should_notify_subscribers(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) should_notify_subscribers = _parse_should_notify_subscribers(d.pop("should_notify_subscribers", UNSET)) - def _parse_enabled(data: object) -> bool | None | Unset: + def _parse_enabled(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) enabled = _parse_enabled(d.pop("enabled", UNSET)) diff --git a/rootly_sdk/models/status_page_template_list.py b/rootly_sdk/models/status_page_template_list.py index 8eec7a41..8afba654 100644 --- a/rootly_sdk/models/status_page_template_list.py +++ b/rootly_sdk/models/status_page_template_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,20 +20,19 @@ class StatusPageTemplateList: """ Attributes: - data (list[StatusPageTemplateListDataItem]): + data (list['StatusPageTemplateListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[StatusPageTemplateListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["StatusPageTemplateListDataItem"] + links: "Links" + meta: "Meta" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) status_page_template_list = cls( data=data, diff --git a/rootly_sdk/models/status_page_template_list_data_item.py b/rootly_sdk/models/status_page_template_list_data_item.py index 4073c903..9a0b4d49 100644 --- a/rootly_sdk/models/status_page_template_list_data_item.py +++ b/rootly_sdk/models/status_page_template_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class StatusPageTemplateListDataItem: id: str type_: StatusPageTemplateListDataItemType - attributes: StatusPageTemplate + attributes: "StatusPageTemplate" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/status_page_template_response.py b/rootly_sdk/models/status_page_template_response.py index 4c1b4eda..d100ad98 100644 --- a/rootly_sdk/models/status_page_template_response.py +++ b/rootly_sdk/models/status_page_template_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,18 +19,17 @@ class StatusPageTemplateResponse: """ Attributes: data (StatusPageTemplateResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: StatusPageTemplateResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "StatusPageTemplateResponseData" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = StatusPageTemplateResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) status_page_template_response = cls( data=data, diff --git a/rootly_sdk/models/status_page_template_response_data.py b/rootly_sdk/models/status_page_template_response_data.py index 5134cc54..b79e157e 100644 --- a/rootly_sdk/models/status_page_template_response_data.py +++ b/rootly_sdk/models/status_page_template_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class StatusPageTemplateResponseData: id: str type_: StatusPageTemplateResponseDataType - attributes: StatusPageTemplate + attributes: "StatusPageTemplate" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/status_response.py b/rootly_sdk/models/status_response.py index 3dc0cb9c..15ec719c 100644 --- a/rootly_sdk/models/status_response.py +++ b/rootly_sdk/models/status_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,18 +19,17 @@ class StatusResponse: """ Attributes: data (StatusResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: StatusResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "StatusResponseData" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = StatusResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) status_response = cls( data=data, diff --git a/rootly_sdk/models/status_response_data.py b/rootly_sdk/models/status_response_data.py index e99a2a6d..973536c0 100644 --- a/rootly_sdk/models/status_response_data.py +++ b/rootly_sdk/models/status_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class StatusResponseData: id: str type_: StatusResponseDataType - attributes: Status + attributes: "Status" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/sub_status.py b/rootly_sdk/models/sub_status.py index 6018ef9b..bccec872 100644 --- a/rootly_sdk/models/sub_status.py +++ b/rootly_sdk/models/sub_status.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -20,18 +18,18 @@ class SubStatus: parent_status (SubStatusParentStatus): created_at (str): updated_at (str): - slug (str | Unset): - description (None | str | Unset): - position (int | None | Unset): + slug (Union[Unset, str]): + description (Union[None, Unset, str]): + position (Union[None, Unset, int]): """ name: str parent_status: SubStatusParentStatus created_at: str updated_at: str - slug: str | Unset = UNSET - description: None | str | Unset = UNSET - position: int | None | Unset = UNSET + slug: Union[Unset, str] = UNSET + description: Union[None, Unset, str] = UNSET + position: Union[None, Unset, int] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -45,13 +43,13 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - description: None | str | Unset + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: description = self.description - position: int | None | Unset + position: Union[None, Unset, int] if isinstance(self.position, Unset): position = UNSET else: @@ -89,21 +87,21 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: slug = d.pop("slug", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> Union[None, Unset, int]: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(Union[None, Unset, int], data) position = _parse_position(d.pop("position", UNSET)) diff --git a/rootly_sdk/models/sub_status_list.py b/rootly_sdk/models/sub_status_list.py index 4ee3da17..d8b8d99f 100644 --- a/rootly_sdk/models/sub_status_list.py +++ b/rootly_sdk/models/sub_status_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,20 +20,19 @@ class SubStatusList: """ Attributes: - data (list[SubStatusListDataItem]): + data (list['SubStatusListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[SubStatusListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["SubStatusListDataItem"] + links: "Links" + meta: "Meta" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) sub_status_list = cls( data=data, diff --git a/rootly_sdk/models/sub_status_list_data_item.py b/rootly_sdk/models/sub_status_list_data_item.py index 0c2ad36a..364a7b4e 100644 --- a/rootly_sdk/models/sub_status_list_data_item.py +++ b/rootly_sdk/models/sub_status_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class SubStatusListDataItem: id: str type_: SubStatusListDataItemType - attributes: SubStatus + attributes: "SubStatus" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/sub_status_response.py b/rootly_sdk/models/sub_status_response.py index b6929ea4..fcbf7375 100644 --- a/rootly_sdk/models/sub_status_response.py +++ b/rootly_sdk/models/sub_status_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,18 +19,17 @@ class SubStatusResponse: """ Attributes: data (SubStatusResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: SubStatusResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "SubStatusResponseData" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = SubStatusResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) sub_status_response = cls( data=data, diff --git a/rootly_sdk/models/sub_status_response_data.py b/rootly_sdk/models/sub_status_response_data.py index fabf203f..7766e6a6 100644 --- a/rootly_sdk/models/sub_status_response_data.py +++ b/rootly_sdk/models/sub_status_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class SubStatusResponseData: id: str type_: SubStatusResponseDataType - attributes: SubStatus + attributes: "SubStatus" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/team.py b/rootly_sdk/models/team.py index e8403ea1..b4a68a9e 100644 --- a/rootly_sdk/models/team.py +++ b/rootly_sdk/models/team.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -28,74 +26,80 @@ class Team: name (str): The name of the team created_at (str): Date of creation updated_at (str): Date of last update - slug (str | Unset): - managed_by (TeamManagedBy | Unset): How this team is managed (provenance): web, api, terraform, etc. Read-only. - description (None | str | Unset): The description of the team - notify_emails (list[str] | None | Unset): Emails to attach to the team - color (None | str | Unset): The hex color of the team - position (int | None | Unset): Position of the team - backstage_id (None | str | Unset): The Backstage entity id associated to this team. eg: + slug (Union[Unset, str]): + managed_by (Union[Unset, TeamManagedBy]): How this team is managed (provenance): web, api, terraform, etc. Read- + only. + description (Union[None, Unset, str]): The description of the team + public_description (Union[None, Unset, str]): The status page description of the team + notify_emails (Union[None, Unset, list[str]]): Emails to attach to the team + color (Union[None, Unset, str]): The hex color of the team + position (Union[None, Unset, int]): Position of the team + backstage_id (Union[None, Unset, str]): The Backstage entity id associated to this team. eg: :namespace/:kind/:entity_name - external_id (None | str | Unset): The external id associated to this team - pagerduty_id (None | str | Unset): The PagerDuty group id associated to this team - pagerduty_service_id (None | str | Unset): The PagerDuty service id associated to this team - opsgenie_id (None | str | Unset): The Opsgenie group id associated to this team - victor_ops_id (None | str | Unset): The VictorOps group id associated to this team - pagertree_id (None | str | Unset): The PagerTree group id associated to this team - cortex_id (None | str | Unset): The Cortex group id associated to this team - service_now_ci_sys_id (None | str | Unset): The Service Now CI sys id associated to this team - user_ids (list[int] | None | Unset): The user ids of the members of this team. - admin_ids (list[int] | None | Unset): The user ids of the admins of this team. These users must also be present - in user_ids attribute. - alerts_email_enabled (bool | None | Unset): Enable alerts through email - alerts_email_address (None | str | Unset): Email generated to send alerts to - alert_urgency_id (None | str | Unset): The alert urgency id of the team - slack_channels (list[TeamSlackChannelsType0Item] | None | Unset): Slack Channels associated with this team - slack_aliases (list[TeamSlackAliasesType0Item] | None | Unset): Slack Aliases associated with this team - alert_broadcast_enabled (bool | None | Unset): Enable alerts to be broadcasted to a specific channel - alert_broadcast_channel (None | TeamAlertBroadcastChannelType0 | Unset): Slack channel to broadcast alerts to - incident_broadcast_enabled (bool | None | Unset): Enable incidents to be broadcasted to a specific channel - incident_broadcast_channel (None | TeamIncidentBroadcastChannelType0 | Unset): Slack channel to broadcast + external_id (Union[None, Unset, str]): The external id associated to this team + pagerduty_id (Union[None, Unset, str]): The PagerDuty group id associated to this team + pagerduty_service_id (Union[None, Unset, str]): The PagerDuty service id associated to this team + opsgenie_id (Union[None, Unset, str]): The Opsgenie group id associated to this team + victor_ops_id (Union[None, Unset, str]): The VictorOps group id associated to this team + pagertree_id (Union[None, Unset, str]): The PagerTree group id associated to this team + cortex_id (Union[None, Unset, str]): The Cortex group id associated to this team + service_now_ci_sys_id (Union[None, Unset, str]): The Service Now CI sys id associated to this team + user_ids (Union[None, Unset, list[int]]): The user ids of the members of this team. + admin_ids (Union[None, Unset, list[int]]): The user ids of the admins of this team. These users must also be + present in user_ids attribute. + alerts_email_enabled (Union[None, Unset, bool]): Enable alerts through email + alerts_email_address (Union[None, Unset, str]): Email generated to send alerts to + alert_urgency_id (Union[None, Unset, str]): The alert urgency id of the team + slack_channels (Union[None, Unset, list['TeamSlackChannelsType0Item']]): Slack Channels associated with this + team + slack_aliases (Union[None, Unset, list['TeamSlackAliasesType0Item']]): Slack Aliases associated with this team + alert_broadcast_enabled (Union[None, Unset, bool]): Enable alerts to be broadcasted to a specific channel + alert_broadcast_channel (Union['TeamAlertBroadcastChannelType0', None, Unset]): Slack channel to broadcast + alerts to + incident_broadcast_enabled (Union[None, Unset, bool]): Enable incidents to be broadcasted to a specific channel + incident_broadcast_channel (Union['TeamIncidentBroadcastChannelType0', None, Unset]): Slack channel to broadcast incidents to - auto_add_members_when_attached (bool | None | Unset): Auto add members to incident channel when team is attached - auto_add_members_scope (TeamAutoAddMembersScope | Unset): Visibility-scoped auto-add behavior. Only present when - the `enable_scoped_incident_channel_auto_add` feature flag is on for the organization. When set, it overrides - `auto_add_members_when_attached`. - properties (list[TeamPropertiesType0Item] | None | Unset): Array of property values for this team. + auto_add_members_when_attached (Union[None, Unset, bool]): Auto add members to incident channel when team is + attached + auto_add_members_scope (Union[Unset, TeamAutoAddMembersScope]): Visibility-scoped auto-add behavior. Only + present when the `enable_scoped_incident_channel_auto_add` feature flag is on for the organization. When set, it + overrides `auto_add_members_when_attached`. + properties (Union[None, Unset, list['TeamPropertiesType0Item']]): Array of property values for this team. """ name: str created_at: str updated_at: str - slug: str | Unset = UNSET - managed_by: TeamManagedBy | Unset = UNSET - description: None | str | Unset = UNSET - notify_emails: list[str] | None | Unset = UNSET - color: None | str | Unset = UNSET - position: int | None | Unset = UNSET - backstage_id: None | str | Unset = UNSET - external_id: None | str | Unset = UNSET - pagerduty_id: None | str | Unset = UNSET - pagerduty_service_id: None | str | Unset = UNSET - opsgenie_id: None | str | Unset = UNSET - victor_ops_id: None | str | Unset = UNSET - pagertree_id: None | str | Unset = UNSET - cortex_id: None | str | Unset = UNSET - service_now_ci_sys_id: None | str | Unset = UNSET - user_ids: list[int] | None | Unset = UNSET - admin_ids: list[int] | None | Unset = UNSET - alerts_email_enabled: bool | None | Unset = UNSET - alerts_email_address: None | str | Unset = UNSET - alert_urgency_id: None | str | Unset = UNSET - slack_channels: list[TeamSlackChannelsType0Item] | None | Unset = UNSET - slack_aliases: list[TeamSlackAliasesType0Item] | None | Unset = UNSET - alert_broadcast_enabled: bool | None | Unset = UNSET - alert_broadcast_channel: None | TeamAlertBroadcastChannelType0 | Unset = UNSET - incident_broadcast_enabled: bool | None | Unset = UNSET - incident_broadcast_channel: None | TeamIncidentBroadcastChannelType0 | Unset = UNSET - auto_add_members_when_attached: bool | None | Unset = UNSET - auto_add_members_scope: TeamAutoAddMembersScope | Unset = UNSET - properties: list[TeamPropertiesType0Item] | None | Unset = UNSET + slug: Union[Unset, str] = UNSET + managed_by: Union[Unset, TeamManagedBy] = UNSET + description: Union[None, Unset, str] = UNSET + public_description: Union[None, Unset, str] = UNSET + notify_emails: Union[None, Unset, list[str]] = UNSET + color: Union[None, Unset, str] = UNSET + position: Union[None, Unset, int] = UNSET + backstage_id: Union[None, Unset, str] = UNSET + external_id: Union[None, Unset, str] = UNSET + pagerduty_id: Union[None, Unset, str] = UNSET + pagerduty_service_id: Union[None, Unset, str] = UNSET + opsgenie_id: Union[None, Unset, str] = UNSET + victor_ops_id: Union[None, Unset, str] = UNSET + pagertree_id: Union[None, Unset, str] = UNSET + cortex_id: Union[None, Unset, str] = UNSET + service_now_ci_sys_id: Union[None, Unset, str] = UNSET + user_ids: Union[None, Unset, list[int]] = UNSET + admin_ids: Union[None, Unset, list[int]] = UNSET + alerts_email_enabled: Union[None, Unset, bool] = UNSET + alerts_email_address: Union[None, Unset, str] = UNSET + alert_urgency_id: Union[None, Unset, str] = UNSET + slack_channels: Union[None, Unset, list["TeamSlackChannelsType0Item"]] = UNSET + slack_aliases: Union[None, Unset, list["TeamSlackAliasesType0Item"]] = UNSET + alert_broadcast_enabled: Union[None, Unset, bool] = UNSET + alert_broadcast_channel: Union["TeamAlertBroadcastChannelType0", None, Unset] = UNSET + incident_broadcast_enabled: Union[None, Unset, bool] = UNSET + incident_broadcast_channel: Union["TeamIncidentBroadcastChannelType0", None, Unset] = UNSET + auto_add_members_when_attached: Union[None, Unset, bool] = UNSET + auto_add_members_scope: Union[Unset, TeamAutoAddMembersScope] = UNSET + properties: Union[None, Unset, list["TeamPropertiesType0Item"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -110,17 +114,23 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - managed_by: str | Unset = UNSET + managed_by: Union[Unset, str] = UNSET if not isinstance(self.managed_by, Unset): managed_by = self.managed_by - description: None | str | Unset + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: description = self.description - notify_emails: list[str] | None | Unset + public_description: Union[None, Unset, str] + if isinstance(self.public_description, Unset): + public_description = UNSET + else: + public_description = self.public_description + + notify_emails: Union[None, Unset, list[str]] if isinstance(self.notify_emails, Unset): notify_emails = UNSET elif isinstance(self.notify_emails, list): @@ -129,73 +139,73 @@ def to_dict(self) -> dict[str, Any]: else: notify_emails = self.notify_emails - color: None | str | Unset + color: Union[None, Unset, str] if isinstance(self.color, Unset): color = UNSET else: color = self.color - position: int | None | Unset + position: Union[None, Unset, int] if isinstance(self.position, Unset): position = UNSET else: position = self.position - backstage_id: None | str | Unset + backstage_id: Union[None, Unset, str] if isinstance(self.backstage_id, Unset): backstage_id = UNSET else: backstage_id = self.backstage_id - external_id: None | str | Unset + external_id: Union[None, Unset, str] if isinstance(self.external_id, Unset): external_id = UNSET else: external_id = self.external_id - pagerduty_id: None | str | Unset + pagerduty_id: Union[None, Unset, str] if isinstance(self.pagerduty_id, Unset): pagerduty_id = UNSET else: pagerduty_id = self.pagerduty_id - pagerduty_service_id: None | str | Unset + pagerduty_service_id: Union[None, Unset, str] if isinstance(self.pagerduty_service_id, Unset): pagerduty_service_id = UNSET else: pagerduty_service_id = self.pagerduty_service_id - opsgenie_id: None | str | Unset + opsgenie_id: Union[None, Unset, str] if isinstance(self.opsgenie_id, Unset): opsgenie_id = UNSET else: opsgenie_id = self.opsgenie_id - victor_ops_id: None | str | Unset + victor_ops_id: Union[None, Unset, str] if isinstance(self.victor_ops_id, Unset): victor_ops_id = UNSET else: victor_ops_id = self.victor_ops_id - pagertree_id: None | str | Unset + pagertree_id: Union[None, Unset, str] if isinstance(self.pagertree_id, Unset): pagertree_id = UNSET else: pagertree_id = self.pagertree_id - cortex_id: None | str | Unset + cortex_id: Union[None, Unset, str] if isinstance(self.cortex_id, Unset): cortex_id = UNSET else: cortex_id = self.cortex_id - service_now_ci_sys_id: None | str | Unset + service_now_ci_sys_id: Union[None, Unset, str] if isinstance(self.service_now_ci_sys_id, Unset): service_now_ci_sys_id = UNSET else: service_now_ci_sys_id = self.service_now_ci_sys_id - user_ids: list[int] | None | Unset + user_ids: Union[None, Unset, list[int]] if isinstance(self.user_ids, Unset): user_ids = UNSET elif isinstance(self.user_ids, list): @@ -204,7 +214,7 @@ def to_dict(self) -> dict[str, Any]: else: user_ids = self.user_ids - admin_ids: list[int] | None | Unset + admin_ids: Union[None, Unset, list[int]] if isinstance(self.admin_ids, Unset): admin_ids = UNSET elif isinstance(self.admin_ids, list): @@ -213,25 +223,25 @@ def to_dict(self) -> dict[str, Any]: else: admin_ids = self.admin_ids - alerts_email_enabled: bool | None | Unset + alerts_email_enabled: Union[None, Unset, bool] if isinstance(self.alerts_email_enabled, Unset): alerts_email_enabled = UNSET else: alerts_email_enabled = self.alerts_email_enabled - alerts_email_address: None | str | Unset + alerts_email_address: Union[None, Unset, str] if isinstance(self.alerts_email_address, Unset): alerts_email_address = UNSET else: alerts_email_address = self.alerts_email_address - alert_urgency_id: None | str | Unset + alert_urgency_id: Union[None, Unset, str] if isinstance(self.alert_urgency_id, Unset): alert_urgency_id = UNSET else: alert_urgency_id = self.alert_urgency_id - slack_channels: list[dict[str, Any]] | None | Unset + slack_channels: Union[None, Unset, list[dict[str, Any]]] if isinstance(self.slack_channels, Unset): slack_channels = UNSET elif isinstance(self.slack_channels, list): @@ -243,7 +253,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_channels = self.slack_channels - slack_aliases: list[dict[str, Any]] | None | Unset + slack_aliases: Union[None, Unset, list[dict[str, Any]]] if isinstance(self.slack_aliases, Unset): slack_aliases = UNSET elif isinstance(self.slack_aliases, list): @@ -255,13 +265,13 @@ def to_dict(self) -> dict[str, Any]: else: slack_aliases = self.slack_aliases - alert_broadcast_enabled: bool | None | Unset + alert_broadcast_enabled: Union[None, Unset, bool] if isinstance(self.alert_broadcast_enabled, Unset): alert_broadcast_enabled = UNSET else: alert_broadcast_enabled = self.alert_broadcast_enabled - alert_broadcast_channel: dict[str, Any] | None | Unset + alert_broadcast_channel: Union[None, Unset, dict[str, Any]] if isinstance(self.alert_broadcast_channel, Unset): alert_broadcast_channel = UNSET elif isinstance(self.alert_broadcast_channel, TeamAlertBroadcastChannelType0): @@ -269,13 +279,13 @@ def to_dict(self) -> dict[str, Any]: else: alert_broadcast_channel = self.alert_broadcast_channel - incident_broadcast_enabled: bool | None | Unset + incident_broadcast_enabled: Union[None, Unset, bool] if isinstance(self.incident_broadcast_enabled, Unset): incident_broadcast_enabled = UNSET else: incident_broadcast_enabled = self.incident_broadcast_enabled - incident_broadcast_channel: dict[str, Any] | None | Unset + incident_broadcast_channel: Union[None, Unset, dict[str, Any]] if isinstance(self.incident_broadcast_channel, Unset): incident_broadcast_channel = UNSET elif isinstance(self.incident_broadcast_channel, TeamIncidentBroadcastChannelType0): @@ -283,17 +293,17 @@ def to_dict(self) -> dict[str, Any]: else: incident_broadcast_channel = self.incident_broadcast_channel - auto_add_members_when_attached: bool | None | Unset + auto_add_members_when_attached: Union[None, Unset, bool] if isinstance(self.auto_add_members_when_attached, Unset): auto_add_members_when_attached = UNSET else: auto_add_members_when_attached = self.auto_add_members_when_attached - auto_add_members_scope: str | Unset = UNSET + auto_add_members_scope: Union[Unset, str] = UNSET if not isinstance(self.auto_add_members_scope, Unset): auto_add_members_scope = self.auto_add_members_scope - properties: list[dict[str, Any]] | None | Unset + properties: Union[None, Unset, list[dict[str, Any]]] if isinstance(self.properties, Unset): properties = UNSET elif isinstance(self.properties, list): @@ -320,6 +330,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["managed_by"] = managed_by if description is not UNSET: field_dict["description"] = description + if public_description is not UNSET: + field_dict["public_description"] = public_description if notify_emails is not UNSET: field_dict["notify_emails"] = notify_emails if color is not UNSET: @@ -393,22 +405,31 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: slug = d.pop("slug", UNSET) _managed_by = d.pop("managed_by", UNSET) - managed_by: TeamManagedBy | Unset + managed_by: Union[Unset, TeamManagedBy] if isinstance(_managed_by, Unset): managed_by = UNSET else: managed_by = check_team_managed_by(_managed_by) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) - def _parse_notify_emails(data: object) -> list[str] | None | Unset: + def _parse_public_description(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + public_description = _parse_public_description(d.pop("public_description", UNSET)) + + def _parse_notify_emails(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -419,112 +440,112 @@ def _parse_notify_emails(data: object) -> list[str] | None | Unset: notify_emails_type_0 = cast(list[str], data) return notify_emails_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) notify_emails = _parse_notify_emails(d.pop("notify_emails", UNSET)) - def _parse_color(data: object) -> None | str | Unset: + def _parse_color(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) color = _parse_color(d.pop("color", UNSET)) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> Union[None, Unset, int]: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(Union[None, Unset, int], data) position = _parse_position(d.pop("position", UNSET)) - def _parse_backstage_id(data: object) -> None | str | Unset: + def _parse_backstage_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) backstage_id = _parse_backstage_id(d.pop("backstage_id", UNSET)) - def _parse_external_id(data: object) -> None | str | Unset: + def _parse_external_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) external_id = _parse_external_id(d.pop("external_id", UNSET)) - def _parse_pagerduty_id(data: object) -> None | str | Unset: + def _parse_pagerduty_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) pagerduty_id = _parse_pagerduty_id(d.pop("pagerduty_id", UNSET)) - def _parse_pagerduty_service_id(data: object) -> None | str | Unset: + def _parse_pagerduty_service_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) pagerduty_service_id = _parse_pagerduty_service_id(d.pop("pagerduty_service_id", UNSET)) - def _parse_opsgenie_id(data: object) -> None | str | Unset: + def _parse_opsgenie_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) opsgenie_id = _parse_opsgenie_id(d.pop("opsgenie_id", UNSET)) - def _parse_victor_ops_id(data: object) -> None | str | Unset: + def _parse_victor_ops_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) victor_ops_id = _parse_victor_ops_id(d.pop("victor_ops_id", UNSET)) - def _parse_pagertree_id(data: object) -> None | str | Unset: + def _parse_pagertree_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) pagertree_id = _parse_pagertree_id(d.pop("pagertree_id", UNSET)) - def _parse_cortex_id(data: object) -> None | str | Unset: + def _parse_cortex_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) cortex_id = _parse_cortex_id(d.pop("cortex_id", UNSET)) - def _parse_service_now_ci_sys_id(data: object) -> None | str | Unset: + def _parse_service_now_ci_sys_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) service_now_ci_sys_id = _parse_service_now_ci_sys_id(d.pop("service_now_ci_sys_id", UNSET)) - def _parse_user_ids(data: object) -> list[int] | None | Unset: + def _parse_user_ids(data: object) -> Union[None, Unset, list[int]]: if data is None: return data if isinstance(data, Unset): @@ -535,13 +556,13 @@ def _parse_user_ids(data: object) -> list[int] | None | Unset: user_ids_type_0 = cast(list[int], data) return user_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[int] | None | Unset, data) + return cast(Union[None, Unset, list[int]], data) user_ids = _parse_user_ids(d.pop("user_ids", UNSET)) - def _parse_admin_ids(data: object) -> list[int] | None | Unset: + def _parse_admin_ids(data: object) -> Union[None, Unset, list[int]]: if data is None: return data if isinstance(data, Unset): @@ -552,40 +573,40 @@ def _parse_admin_ids(data: object) -> list[int] | None | Unset: admin_ids_type_0 = cast(list[int], data) return admin_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[int] | None | Unset, data) + return cast(Union[None, Unset, list[int]], data) admin_ids = _parse_admin_ids(d.pop("admin_ids", UNSET)) - def _parse_alerts_email_enabled(data: object) -> bool | None | Unset: + def _parse_alerts_email_enabled(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) alerts_email_enabled = _parse_alerts_email_enabled(d.pop("alerts_email_enabled", UNSET)) - def _parse_alerts_email_address(data: object) -> None | str | Unset: + def _parse_alerts_email_address(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) alerts_email_address = _parse_alerts_email_address(d.pop("alerts_email_address", UNSET)) - def _parse_alert_urgency_id(data: object) -> None | str | Unset: + def _parse_alert_urgency_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) alert_urgency_id = _parse_alert_urgency_id(d.pop("alert_urgency_id", UNSET)) - def _parse_slack_channels(data: object) -> list[TeamSlackChannelsType0Item] | None | Unset: + def _parse_slack_channels(data: object) -> Union[None, Unset, list["TeamSlackChannelsType0Item"]]: if data is None: return data if isinstance(data, Unset): @@ -601,13 +622,13 @@ def _parse_slack_channels(data: object) -> list[TeamSlackChannelsType0Item] | No slack_channels_type_0.append(slack_channels_type_0_item) return slack_channels_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[TeamSlackChannelsType0Item] | None | Unset, data) + return cast(Union[None, Unset, list["TeamSlackChannelsType0Item"]], data) slack_channels = _parse_slack_channels(d.pop("slack_channels", UNSET)) - def _parse_slack_aliases(data: object) -> list[TeamSlackAliasesType0Item] | None | Unset: + def _parse_slack_aliases(data: object) -> Union[None, Unset, list["TeamSlackAliasesType0Item"]]: if data is None: return data if isinstance(data, Unset): @@ -623,22 +644,22 @@ def _parse_slack_aliases(data: object) -> list[TeamSlackAliasesType0Item] | None slack_aliases_type_0.append(slack_aliases_type_0_item) return slack_aliases_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[TeamSlackAliasesType0Item] | None | Unset, data) + return cast(Union[None, Unset, list["TeamSlackAliasesType0Item"]], data) slack_aliases = _parse_slack_aliases(d.pop("slack_aliases", UNSET)) - def _parse_alert_broadcast_enabled(data: object) -> bool | None | Unset: + def _parse_alert_broadcast_enabled(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) alert_broadcast_enabled = _parse_alert_broadcast_enabled(d.pop("alert_broadcast_enabled", UNSET)) - def _parse_alert_broadcast_channel(data: object) -> None | TeamAlertBroadcastChannelType0 | Unset: + def _parse_alert_broadcast_channel(data: object) -> Union["TeamAlertBroadcastChannelType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -649,22 +670,22 @@ def _parse_alert_broadcast_channel(data: object) -> None | TeamAlertBroadcastCha alert_broadcast_channel_type_0 = TeamAlertBroadcastChannelType0.from_dict(data) return alert_broadcast_channel_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(None | TeamAlertBroadcastChannelType0 | Unset, data) + return cast(Union["TeamAlertBroadcastChannelType0", None, Unset], data) alert_broadcast_channel = _parse_alert_broadcast_channel(d.pop("alert_broadcast_channel", UNSET)) - def _parse_incident_broadcast_enabled(data: object) -> bool | None | Unset: + def _parse_incident_broadcast_enabled(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) incident_broadcast_enabled = _parse_incident_broadcast_enabled(d.pop("incident_broadcast_enabled", UNSET)) - def _parse_incident_broadcast_channel(data: object) -> None | TeamIncidentBroadcastChannelType0 | Unset: + def _parse_incident_broadcast_channel(data: object) -> Union["TeamIncidentBroadcastChannelType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -675,31 +696,31 @@ def _parse_incident_broadcast_channel(data: object) -> None | TeamIncidentBroadc incident_broadcast_channel_type_0 = TeamIncidentBroadcastChannelType0.from_dict(data) return incident_broadcast_channel_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(None | TeamIncidentBroadcastChannelType0 | Unset, data) + return cast(Union["TeamIncidentBroadcastChannelType0", None, Unset], data) incident_broadcast_channel = _parse_incident_broadcast_channel(d.pop("incident_broadcast_channel", UNSET)) - def _parse_auto_add_members_when_attached(data: object) -> bool | None | Unset: + def _parse_auto_add_members_when_attached(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) auto_add_members_when_attached = _parse_auto_add_members_when_attached( d.pop("auto_add_members_when_attached", UNSET) ) _auto_add_members_scope = d.pop("auto_add_members_scope", UNSET) - auto_add_members_scope: TeamAutoAddMembersScope | Unset + auto_add_members_scope: Union[Unset, TeamAutoAddMembersScope] if isinstance(_auto_add_members_scope, Unset): auto_add_members_scope = UNSET else: auto_add_members_scope = check_team_auto_add_members_scope(_auto_add_members_scope) - def _parse_properties(data: object) -> list[TeamPropertiesType0Item] | None | Unset: + def _parse_properties(data: object) -> Union[None, Unset, list["TeamPropertiesType0Item"]]: if data is None: return data if isinstance(data, Unset): @@ -715,9 +736,9 @@ def _parse_properties(data: object) -> list[TeamPropertiesType0Item] | None | Un properties_type_0.append(properties_type_0_item) return properties_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[TeamPropertiesType0Item] | None | Unset, data) + return cast(Union[None, Unset, list["TeamPropertiesType0Item"]], data) properties = _parse_properties(d.pop("properties", UNSET)) @@ -728,6 +749,7 @@ def _parse_properties(data: object) -> list[TeamPropertiesType0Item] | None | Un slug=slug, managed_by=managed_by, description=description, + public_description=public_description, notify_emails=notify_emails, color=color, position=position, diff --git a/rootly_sdk/models/team_alert_broadcast_channel_type_0.py b/rootly_sdk/models/team_alert_broadcast_channel_type_0.py index 137ccd8f..f7564e63 100644 --- a/rootly_sdk/models/team_alert_broadcast_channel_type_0.py +++ b/rootly_sdk/models/team_alert_broadcast_channel_type_0.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,12 +14,12 @@ class TeamAlertBroadcastChannelType0: """Slack channel to broadcast alerts to Attributes: - id (str | Unset): Slack channel ID - name (str | Unset): Slack channel name + id (Union[Unset, str]): Slack channel ID + name (Union[Unset, str]): Slack channel name """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/team_incident_broadcast_channel_type_0.py b/rootly_sdk/models/team_incident_broadcast_channel_type_0.py index 787a395f..2f452281 100644 --- a/rootly_sdk/models/team_incident_broadcast_channel_type_0.py +++ b/rootly_sdk/models/team_incident_broadcast_channel_type_0.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,12 +14,12 @@ class TeamIncidentBroadcastChannelType0: """Slack channel to broadcast incidents to Attributes: - id (str | Unset): Slack channel ID - name (str | Unset): Slack channel name + id (Union[Unset, str]): Slack channel ID + name (Union[Unset, str]): Slack channel name """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/team_list.py b/rootly_sdk/models/team_list.py index 7980ecc0..31fce59f 100644 --- a/rootly_sdk/models/team_list.py +++ b/rootly_sdk/models/team_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,20 +20,19 @@ class TeamList: """ Attributes: - data (list[TeamListDataItem]): + data (list['TeamListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[TeamListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["TeamListDataItem"] + links: "Links" + meta: "Meta" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) team_list = cls( data=data, diff --git a/rootly_sdk/models/team_list_data_item.py b/rootly_sdk/models/team_list_data_item.py index b96b9d0e..836ccae2 100644 --- a/rootly_sdk/models/team_list_data_item.py +++ b/rootly_sdk/models/team_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class TeamListDataItem: id: str type_: TeamListDataItemType - attributes: Team + attributes: "Team" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/team_properties_type_0_item.py b/rootly_sdk/models/team_properties_type_0_item.py index c184a5a0..be192ceb 100644 --- a/rootly_sdk/models/team_properties_type_0_item.py +++ b/rootly_sdk/models/team_properties_type_0_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/team_response.py b/rootly_sdk/models/team_response.py index 4055376a..908ce6c6 100644 --- a/rootly_sdk/models/team_response.py +++ b/rootly_sdk/models/team_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,18 +19,17 @@ class TeamResponse: """ Attributes: data (TeamResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: TeamResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "TeamResponseData" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = TeamResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) team_response = cls( data=data, diff --git a/rootly_sdk/models/team_response_data.py b/rootly_sdk/models/team_response_data.py index 16ecf771..50e1b9a5 100644 --- a/rootly_sdk/models/team_response_data.py +++ b/rootly_sdk/models/team_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class TeamResponseData: id: str type_: TeamResponseDataType - attributes: Team + attributes: "Team" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/team_slack_aliases_type_0_item.py b/rootly_sdk/models/team_slack_aliases_type_0_item.py index 5dfb959c..e489c76a 100644 --- a/rootly_sdk/models/team_slack_aliases_type_0_item.py +++ b/rootly_sdk/models/team_slack_aliases_type_0_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/team_slack_channels_type_0_item.py b/rootly_sdk/models/team_slack_channels_type_0_item.py index 9f85b005..f91186df 100644 --- a/rootly_sdk/models/team_slack_channels_type_0_item.py +++ b/rootly_sdk/models/team_slack_channels_type_0_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/tiptap_block_schema.py b/rootly_sdk/models/tiptap_block_schema.py index 4b4f48e3..17261904 100644 --- a/rootly_sdk/models/tiptap_block_schema.py +++ b/rootly_sdk/models/tiptap_block_schema.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,21 +19,20 @@ class TiptapBlockSchema: """TipTap block component schema for post mortem templates Attributes: - followup_component (TiptapBlockSchemaFollowupComponent | Unset): Followup component block - timeline_component (TiptapBlockSchemaTimelineComponent | Unset): Timeline component block + followup_component (Union[Unset, TiptapBlockSchemaFollowupComponent]): Followup component block + timeline_component (Union[Unset, TiptapBlockSchemaTimelineComponent]): Timeline component block """ - followup_component: TiptapBlockSchemaFollowupComponent | Unset = UNSET - timeline_component: TiptapBlockSchemaTimelineComponent | Unset = UNSET + followup_component: Union[Unset, "TiptapBlockSchemaFollowupComponent"] = UNSET + timeline_component: Union[Unset, "TiptapBlockSchemaTimelineComponent"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - - followup_component: dict[str, Any] | Unset = UNSET + followup_component: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.followup_component, Unset): followup_component = self.followup_component.to_dict() - timeline_component: dict[str, Any] | Unset = UNSET + timeline_component: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.timeline_component, Unset): timeline_component = self.timeline_component.to_dict() @@ -56,14 +53,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _followup_component = d.pop("followup_component", UNSET) - followup_component: TiptapBlockSchemaFollowupComponent | Unset + followup_component: Union[Unset, TiptapBlockSchemaFollowupComponent] if isinstance(_followup_component, Unset): followup_component = UNSET else: followup_component = TiptapBlockSchemaFollowupComponent.from_dict(_followup_component) _timeline_component = d.pop("timeline_component", UNSET) - timeline_component: TiptapBlockSchemaTimelineComponent | Unset + timeline_component: Union[Unset, TiptapBlockSchemaTimelineComponent] if isinstance(_timeline_component, Unset): timeline_component = UNSET else: diff --git a/rootly_sdk/models/tiptap_block_schema_followup_component.py b/rootly_sdk/models/tiptap_block_schema_followup_component.py index 8220706b..6f23f72d 100644 --- a/rootly_sdk/models/tiptap_block_schema_followup_component.py +++ b/rootly_sdk/models/tiptap_block_schema_followup_component.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,18 +21,18 @@ class TiptapBlockSchemaFollowupComponent: html (str): HTML representation:
Example:
. - data_sort (TiptapBlockSchemaFollowupComponentDataSort | Unset): Sort order for followups. Valid values: + data_sort (Union[Unset, TiptapBlockSchemaFollowupComponentDataSort]): Sort order for followups. Valid values: due_date, status, priority Default: 'due_date'. """ html: str - data_sort: TiptapBlockSchemaFollowupComponentDataSort | Unset = "due_date" + data_sort: Union[Unset, TiptapBlockSchemaFollowupComponentDataSort] = "due_date" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: html = self.html - data_sort: str | Unset = UNSET + data_sort: Union[Unset, str] = UNSET if not isinstance(self.data_sort, Unset): data_sort = self.data_sort @@ -56,7 +54,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: html = d.pop("html") _data_sort = d.pop("data_sort", UNSET) - data_sort: TiptapBlockSchemaFollowupComponentDataSort | Unset + data_sort: Union[Unset, TiptapBlockSchemaFollowupComponentDataSort] if isinstance(_data_sort, Unset): data_sort = UNSET else: diff --git a/rootly_sdk/models/tiptap_block_schema_timeline_component.py b/rootly_sdk/models/tiptap_block_schema_timeline_component.py index a8ec7f99..8eef08fc 100644 --- a/rootly_sdk/models/tiptap_block_schema_timeline_component.py +++ b/rootly_sdk/models/tiptap_block_schema_timeline_component.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/trigger_workflow_task_params.py b/rootly_sdk/models/trigger_workflow_task_params.py index e80d9bed..09835fb3 100644 --- a/rootly_sdk/models/trigger_workflow_task_params.py +++ b/rootly_sdk/models/trigger_workflow_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -37,27 +35,25 @@ class TriggerWorkflowTaskParams: :slug, :sequential_id, :pagerduty_incident_id, :opsgenie_incident_id, :victor_ops_incident_id, :jira_issue_id, :asana_task_id, :shortcut_task_id, :linear_issue_id, :zendesk_ticket_id, :motion_task_id, :trello_card_id, :airtable_record_id, :shortcut_story_id, :github_issue_id, :freshservice_ticket_id, :freshservice_task_id, - :clickup_task_id]", "(post_mortem) kind can only match [:id]", "(action_item) kind can only match [:id, - :jira_issue_id, :asana_task_id, :shortcut_task_id, :linear_issue_id, :zendesk_ticket_id, :motion_task_id, - :trello_card_id, :airtable_record_id, :shortcut_story_id, :github_issue_id, :freshservice_ticket_id, - :freshservice_task_id, :clickup_task_id]", "(pulse) kind can only match [:id]", "(alert) kind can only match - [:id]"] Default: 'id'. + :clickup_task_id]", "(action_item) kind can only match [:id, :jira_issue_id, :asana_task_id, :shortcut_task_id, + :linear_issue_id, :zendesk_ticket_id, :motion_task_id, :trello_card_id, :airtable_record_id, :shortcut_story_id, + :github_issue_id, :freshservice_ticket_id, :freshservice_task_id, :clickup_task_id]", "(post_mortem) kind can + only match [:id]", "(pulse) kind can only match [:id]", "(alert) kind can only match [:id]"] Default: 'id'. resource (TriggerWorkflowTaskParamsResource): workflow (TriggerWorkflowTaskParamsWorkflow): - task_type (TriggerWorkflowTaskParamsTaskType | Unset): - check_workflow_conditions (bool | Unset): + task_type (Union[Unset, TriggerWorkflowTaskParamsTaskType]): + check_workflow_conditions (Union[Unset, bool]): """ - resource: TriggerWorkflowTaskParamsResource - workflow: TriggerWorkflowTaskParamsWorkflow + resource: "TriggerWorkflowTaskParamsResource" + workflow: "TriggerWorkflowTaskParamsWorkflow" kind: TriggerWorkflowTaskParamsKind = "incident" attribute_to_query_by: TriggerWorkflowTaskParamsAttributeToQueryBy = "id" - task_type: TriggerWorkflowTaskParamsTaskType | Unset = UNSET - check_workflow_conditions: bool | Unset = UNSET + task_type: Union[Unset, TriggerWorkflowTaskParamsTaskType] = UNSET + check_workflow_conditions: Union[Unset, bool] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - kind: str = self.kind attribute_to_query_by: str = self.attribute_to_query_by @@ -66,7 +62,7 @@ def to_dict(self) -> dict[str, Any]: workflow = self.workflow.to_dict() - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -104,7 +100,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: workflow = TriggerWorkflowTaskParamsWorkflow.from_dict(d.pop("workflow")) _task_type = d.pop("task_type", UNSET) - task_type: TriggerWorkflowTaskParamsTaskType | Unset + task_type: Union[Unset, TriggerWorkflowTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/trigger_workflow_task_params_resource.py b/rootly_sdk/models/trigger_workflow_task_params_resource.py index 79d16a80..9edc0181 100644 --- a/rootly_sdk/models/trigger_workflow_task_params_resource.py +++ b/rootly_sdk/models/trigger_workflow_task_params_resource.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class TriggerWorkflowTaskParamsResource: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/trigger_workflow_task_params_workflow.py b/rootly_sdk/models/trigger_workflow_task_params_workflow.py index c4ad90c9..39e0422b 100644 --- a/rootly_sdk/models/trigger_workflow_task_params_workflow.py +++ b/rootly_sdk/models/trigger_workflow_task_params_workflow.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class TriggerWorkflowTaskParamsWorkflow: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/tweet_twitter_message_task_params.py b/rootly_sdk/models/tweet_twitter_message_task_params.py index 9c9498a3..3839d3c5 100644 --- a/rootly_sdk/models/tweet_twitter_message_task_params.py +++ b/rootly_sdk/models/tweet_twitter_message_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -20,17 +18,17 @@ class TweetTwitterMessageTaskParams: """ Attributes: message (str): - task_type (TweetTwitterMessageTaskParamsTaskType | Unset): + task_type (Union[Unset, TweetTwitterMessageTaskParamsTaskType]): """ message: str - task_type: TweetTwitterMessageTaskParamsTaskType | Unset = UNSET + task_type: Union[Unset, TweetTwitterMessageTaskParamsTaskType] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: message = self.message - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -52,7 +50,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: message = d.pop("message") _task_type = d.pop("task_type", UNSET) - task_type: TweetTwitterMessageTaskParamsTaskType | Unset + task_type: Union[Unset, TweetTwitterMessageTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/unassign_role_from_user.py b/rootly_sdk/models/unassign_role_from_user.py index a24c2f9a..3475de0e 100644 --- a/rootly_sdk/models/unassign_role_from_user.py +++ b/rootly_sdk/models/unassign_role_from_user.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UnassignRoleFromUser: data (UnassignRoleFromUserData): """ - data: UnassignRoleFromUserData + data: "UnassignRoleFromUserData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/unassign_role_from_user_data.py b/rootly_sdk/models/unassign_role_from_user_data.py index 5b70d1d0..8771ae9c 100644 --- a/rootly_sdk/models/unassign_role_from_user_data.py +++ b/rootly_sdk/models/unassign_role_from_user_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class UnassignRoleFromUserData: """ type_: UnassignRoleFromUserDataType - attributes: UnassignRoleFromUserDataAttributes + attributes: "UnassignRoleFromUserDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/unassign_role_from_user_data_attributes.py b/rootly_sdk/models/unassign_role_from_user_data_attributes.py index b936640f..68894b5f 100644 --- a/rootly_sdk/models/unassign_role_from_user_data_attributes.py +++ b/rootly_sdk/models/unassign_role_from_user_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define @@ -14,12 +12,12 @@ class UnassignRoleFromUserDataAttributes: """ Attributes: - user_id (str | Unset): ID of user you wish to remove as assigned user from this incident - incident_role_id (str | Unset): ID of the incident role + user_id (Union[Unset, str]): ID of user you wish to remove as assigned user from this incident + incident_role_id (Union[Unset, str]): ID of the incident role """ - user_id: str | Unset = UNSET - incident_role_id: str | Unset = UNSET + user_id: Union[Unset, str] = UNSET + incident_role_id: Union[Unset, str] = UNSET def to_dict(self) -> dict[str, Any]: user_id = self.user_id diff --git a/rootly_sdk/models/update_action_item_task_params.py b/rootly_sdk/models/update_action_item_task_params.py index 11036577..85f735dc 100644 --- a/rootly_sdk/models/update_action_item_task_params.py +++ b/rootly_sdk/models/update_action_item_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -38,41 +36,41 @@ class UpdateActionItemTaskParams: query_value (str): Value that attribute_to_query_by to uses to match against attribute_to_query_by (UpdateActionItemTaskParamsAttributeToQueryBy): Attribute of the action item to match against Default: 'id'. - task_type (UpdateActionItemTaskParamsTaskType | Unset): - summary (str | Unset): Brief description of the action item - assigned_to_user_id (str | Unset): [DEPRECATED] Use assigned_to_user attribute instead. The user id this action - item is assigned to - assigned_to_user (UpdateActionItemTaskParamsAssignedToUser | Unset): The user this action item is assigned to - group_ids (list[str] | None | Unset): - description (str | Unset): The action item description - priority (UpdateActionItemTaskParamsPriority | Unset): The action item priority - status (UpdateActionItemTaskParamsStatus | Unset): The action item status - custom_fields_mapping (None | str | Unset): Custom field mappings. Can contain liquid markup and need to be + task_type (Union[Unset, UpdateActionItemTaskParamsTaskType]): + summary (Union[Unset, str]): Brief description of the action item + assigned_to_user_id (Union[Unset, str]): [DEPRECATED] Use assigned_to_user attribute instead. The user id this + action item is assigned to + assigned_to_user (Union[Unset, UpdateActionItemTaskParamsAssignedToUser]): The user this action item is + assigned to + group_ids (Union[None, Unset, list[str]]): + description (Union[Unset, str]): The action item description + priority (Union[Unset, UpdateActionItemTaskParamsPriority]): The action item priority + status (Union[Unset, UpdateActionItemTaskParamsStatus]): The action item status + custom_fields_mapping (Union[None, Unset, str]): Custom field mappings. Can contain liquid markup and need to be valid JSON - post_to_incident_timeline (bool | Unset): + post_to_incident_timeline (Union[Unset, bool]): """ query_value: str attribute_to_query_by: UpdateActionItemTaskParamsAttributeToQueryBy = "id" - task_type: UpdateActionItemTaskParamsTaskType | Unset = UNSET - summary: str | Unset = UNSET - assigned_to_user_id: str | Unset = UNSET - assigned_to_user: UpdateActionItemTaskParamsAssignedToUser | Unset = UNSET - group_ids: list[str] | None | Unset = UNSET - description: str | Unset = UNSET - priority: UpdateActionItemTaskParamsPriority | Unset = UNSET - status: UpdateActionItemTaskParamsStatus | Unset = UNSET - custom_fields_mapping: None | str | Unset = UNSET - post_to_incident_timeline: bool | Unset = UNSET + task_type: Union[Unset, UpdateActionItemTaskParamsTaskType] = UNSET + summary: Union[Unset, str] = UNSET + assigned_to_user_id: Union[Unset, str] = UNSET + assigned_to_user: Union[Unset, "UpdateActionItemTaskParamsAssignedToUser"] = UNSET + group_ids: Union[None, Unset, list[str]] = UNSET + description: Union[Unset, str] = UNSET + priority: Union[Unset, UpdateActionItemTaskParamsPriority] = UNSET + status: Union[Unset, UpdateActionItemTaskParamsStatus] = UNSET + custom_fields_mapping: Union[None, Unset, str] = UNSET + post_to_incident_timeline: Union[Unset, bool] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - query_value = self.query_value attribute_to_query_by: str = self.attribute_to_query_by - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -80,11 +78,11 @@ def to_dict(self) -> dict[str, Any]: assigned_to_user_id = self.assigned_to_user_id - assigned_to_user: dict[str, Any] | Unset = UNSET + assigned_to_user: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.assigned_to_user, Unset): assigned_to_user = self.assigned_to_user.to_dict() - group_ids: list[str] | None | Unset + group_ids: Union[None, Unset, list[str]] if isinstance(self.group_ids, Unset): group_ids = UNSET elif isinstance(self.group_ids, list): @@ -95,15 +93,15 @@ def to_dict(self) -> dict[str, Any]: description = self.description - priority: str | Unset = UNSET + priority: Union[Unset, str] = UNSET if not isinstance(self.priority, Unset): priority = self.priority - status: str | Unset = UNSET + status: Union[Unset, str] = UNSET if not isinstance(self.status, Unset): status = self.status - custom_fields_mapping: None | str | Unset + custom_fields_mapping: Union[None, Unset, str] if isinstance(self.custom_fields_mapping, Unset): custom_fields_mapping = UNSET else: @@ -154,7 +152,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: ) _task_type = d.pop("task_type", UNSET) - task_type: UpdateActionItemTaskParamsTaskType | Unset + task_type: Union[Unset, UpdateActionItemTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: @@ -165,13 +163,13 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: assigned_to_user_id = d.pop("assigned_to_user_id", UNSET) _assigned_to_user = d.pop("assigned_to_user", UNSET) - assigned_to_user: UpdateActionItemTaskParamsAssignedToUser | Unset + assigned_to_user: Union[Unset, UpdateActionItemTaskParamsAssignedToUser] if isinstance(_assigned_to_user, Unset): assigned_to_user = UNSET else: assigned_to_user = UpdateActionItemTaskParamsAssignedToUser.from_dict(_assigned_to_user) - def _parse_group_ids(data: object) -> list[str] | None | Unset: + def _parse_group_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -182,34 +180,34 @@ def _parse_group_ids(data: object) -> list[str] | None | Unset: group_ids_type_0 = cast(list[str], data) return group_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) group_ids = _parse_group_ids(d.pop("group_ids", UNSET)) description = d.pop("description", UNSET) _priority = d.pop("priority", UNSET) - priority: UpdateActionItemTaskParamsPriority | Unset + priority: Union[Unset, UpdateActionItemTaskParamsPriority] if isinstance(_priority, Unset): priority = UNSET else: priority = check_update_action_item_task_params_priority(_priority) _status = d.pop("status", UNSET) - status: UpdateActionItemTaskParamsStatus | Unset + status: Union[Unset, UpdateActionItemTaskParamsStatus] if isinstance(_status, Unset): status = UNSET else: status = check_update_action_item_task_params_status(_status) - def _parse_custom_fields_mapping(data: object) -> None | str | Unset: + def _parse_custom_fields_mapping(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) custom_fields_mapping = _parse_custom_fields_mapping(d.pop("custom_fields_mapping", UNSET)) diff --git a/rootly_sdk/models/update_action_item_task_params_assigned_to_user.py b/rootly_sdk/models/update_action_item_task_params_assigned_to_user.py index 215e2fc0..968fa698 100644 --- a/rootly_sdk/models/update_action_item_task_params_assigned_to_user.py +++ b/rootly_sdk/models/update_action_item_task_params_assigned_to_user.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,12 +14,12 @@ class UpdateActionItemTaskParamsAssignedToUser: """The user this action item is assigned to Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_airtable_table_record_task_params.py b/rootly_sdk/models/update_airtable_table_record_task_params.py index 59509bfc..4c1f093c 100644 --- a/rootly_sdk/models/update_airtable_table_record_task_params.py +++ b/rootly_sdk/models/update_airtable_table_record_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,16 +20,16 @@ class UpdateAirtableTableRecordTaskParams: base_key (str): The base key table_name (str): The table name record_id (str): The record id - task_type (UpdateAirtableTableRecordTaskParamsTaskType | Unset): - custom_fields_mapping (None | str | Unset): Custom field mappings. Can contain liquid markup and need to be + task_type (Union[Unset, UpdateAirtableTableRecordTaskParamsTaskType]): + custom_fields_mapping (Union[None, Unset, str]): Custom field mappings. Can contain liquid markup and need to be valid JSON """ base_key: str table_name: str record_id: str - task_type: UpdateAirtableTableRecordTaskParamsTaskType | Unset = UNSET - custom_fields_mapping: None | str | Unset = UNSET + task_type: Union[Unset, UpdateAirtableTableRecordTaskParamsTaskType] = UNSET + custom_fields_mapping: Union[None, Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -41,11 +39,11 @@ def to_dict(self) -> dict[str, Any]: record_id = self.record_id - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - custom_fields_mapping: None | str | Unset + custom_fields_mapping: Union[None, Unset, str] if isinstance(self.custom_fields_mapping, Unset): custom_fields_mapping = UNSET else: @@ -77,18 +75,18 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: record_id = d.pop("record_id") _task_type = d.pop("task_type", UNSET) - task_type: UpdateAirtableTableRecordTaskParamsTaskType | Unset + task_type: Union[Unset, UpdateAirtableTableRecordTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: task_type = check_update_airtable_table_record_task_params_task_type(_task_type) - def _parse_custom_fields_mapping(data: object) -> None | str | Unset: + def _parse_custom_fields_mapping(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) custom_fields_mapping = _parse_custom_fields_mapping(d.pop("custom_fields_mapping", UNSET)) diff --git a/rootly_sdk/models/update_alert.py b/rootly_sdk/models/update_alert.py index 323f3c5c..761a488e 100644 --- a/rootly_sdk/models/update_alert.py +++ b/rootly_sdk/models/update_alert.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateAlert: data (UpdateAlertData): """ - data: UpdateAlertData + data: "UpdateAlertData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_alert_data.py b/rootly_sdk/models/update_alert_data.py index 730a1655..2caed9f1 100644 --- a/rootly_sdk/models/update_alert_data.py +++ b/rootly_sdk/models/update_alert_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class UpdateAlertData: """ type_: UpdateAlertDataType - attributes: UpdateAlertDataAttributes + attributes: "UpdateAlertDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_alert_data_attributes.py b/rootly_sdk/models/update_alert_data_attributes.py index 0822a489..452778c4 100644 --- a/rootly_sdk/models/update_alert_data_attributes.py +++ b/rootly_sdk/models/update_alert_data_attributes.py @@ -1,8 +1,6 @@ -from __future__ import annotations - import datetime from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from dateutil.parser import isoparse @@ -28,46 +26,48 @@ class UpdateAlertDataAttributes: """ Attributes: - noise (UpdateAlertDataAttributesNoise | Unset): Whether the alert is marked as noise - source (str | Unset): Deprecated. Accepted for backwards compatibility; new clients should omit. Defaults to - `api`. - summary (str | Unset): The summary of the alert - description (None | str | Unset): The description of the alert - service_ids (list[str] | None | Unset): The Service IDs to attach to the alert - group_ids (list[str] | None | Unset): The Group IDs to attach to the alert - functionality_ids (list[str] | None | Unset): The Functionality IDs to attach to the alert - environment_ids (list[str] | None | Unset): The Environment IDs to attach to the alert - started_at (datetime.datetime | None | Unset): Alert start datetime - ended_at (datetime.datetime | None | Unset): Alert end datetime - external_id (None | str | Unset): External ID - external_url (None | str | Unset): External Url - alert_urgency_id (None | str | Unset): The ID of the alert urgency - labels (list[None | UpdateAlertDataAttributesLabelsItemType0] | Unset): - data (None | Unset | UpdateAlertDataAttributesDataType0): Additional data - deduplication_key (None | str | Unset): Alerts sharing the same deduplication key are treated as a single alert. - alert_field_values_attributes (list[None | UpdateAlertDataAttributesAlertFieldValuesAttributesItemType0] | - Unset): Custom alert field values to create with the alert + noise (Union[Unset, UpdateAlertDataAttributesNoise]): Whether the alert is marked as noise + source (Union[Unset, str]): Deprecated. Accepted for backwards compatibility; new clients should omit. Defaults + to `api`. + summary (Union[Unset, str]): The summary of the alert + description (Union[None, Unset, str]): The description of the alert + service_ids (Union[None, Unset, list[str]]): The Service IDs to attach to the alert + group_ids (Union[None, Unset, list[str]]): The Group IDs to attach to the alert + functionality_ids (Union[None, Unset, list[str]]): The Functionality IDs to attach to the alert + environment_ids (Union[None, Unset, list[str]]): The Environment IDs to attach to the alert + started_at (Union[None, Unset, datetime.datetime]): Alert start datetime + ended_at (Union[None, Unset, datetime.datetime]): Alert end datetime + external_id (Union[None, Unset, str]): External ID + external_url (Union[None, Unset, str]): External Url + alert_urgency_id (Union[None, Unset, str]): The ID of the alert urgency + labels (Union[Unset, list[Union['UpdateAlertDataAttributesLabelsItemType0', None]]]): + data (Union['UpdateAlertDataAttributesDataType0', None, Unset]): Additional data + deduplication_key (Union[None, Unset, str]): Alerts sharing the same deduplication key are treated as a single + alert. + alert_field_values_attributes (Union[Unset, + list[Union['UpdateAlertDataAttributesAlertFieldValuesAttributesItemType0', None]]]): Custom alert field values + to create with the alert """ - noise: UpdateAlertDataAttributesNoise | Unset = UNSET - source: str | Unset = UNSET - summary: str | Unset = UNSET - description: None | str | Unset = UNSET - service_ids: list[str] | None | Unset = UNSET - group_ids: list[str] | None | Unset = UNSET - functionality_ids: list[str] | None | Unset = UNSET - environment_ids: list[str] | None | Unset = UNSET - started_at: datetime.datetime | None | Unset = UNSET - ended_at: datetime.datetime | None | Unset = UNSET - external_id: None | str | Unset = UNSET - external_url: None | str | Unset = UNSET - alert_urgency_id: None | str | Unset = UNSET - labels: list[None | UpdateAlertDataAttributesLabelsItemType0] | Unset = UNSET - data: None | Unset | UpdateAlertDataAttributesDataType0 = UNSET - deduplication_key: None | str | Unset = UNSET - alert_field_values_attributes: list[None | UpdateAlertDataAttributesAlertFieldValuesAttributesItemType0] | Unset = ( - UNSET - ) + noise: Union[Unset, UpdateAlertDataAttributesNoise] = UNSET + source: Union[Unset, str] = UNSET + summary: Union[Unset, str] = UNSET + description: Union[None, Unset, str] = UNSET + service_ids: Union[None, Unset, list[str]] = UNSET + group_ids: Union[None, Unset, list[str]] = UNSET + functionality_ids: Union[None, Unset, list[str]] = UNSET + environment_ids: Union[None, Unset, list[str]] = UNSET + started_at: Union[None, Unset, datetime.datetime] = UNSET + ended_at: Union[None, Unset, datetime.datetime] = UNSET + external_id: Union[None, Unset, str] = UNSET + external_url: Union[None, Unset, str] = UNSET + alert_urgency_id: Union[None, Unset, str] = UNSET + labels: Union[Unset, list[Union["UpdateAlertDataAttributesLabelsItemType0", None]]] = UNSET + data: Union["UpdateAlertDataAttributesDataType0", None, Unset] = UNSET + deduplication_key: Union[None, Unset, str] = UNSET + alert_field_values_attributes: Union[ + Unset, list[Union["UpdateAlertDataAttributesAlertFieldValuesAttributesItemType0", None]] + ] = UNSET def to_dict(self) -> dict[str, Any]: from ..models.update_alert_data_attributes_alert_field_values_attributes_item_type_0 import ( @@ -76,7 +76,7 @@ def to_dict(self) -> dict[str, Any]: from ..models.update_alert_data_attributes_data_type_0 import UpdateAlertDataAttributesDataType0 from ..models.update_alert_data_attributes_labels_item_type_0 import UpdateAlertDataAttributesLabelsItemType0 - noise: str | Unset = UNSET + noise: Union[Unset, str] = UNSET if not isinstance(self.noise, Unset): noise = self.noise @@ -84,13 +84,13 @@ def to_dict(self) -> dict[str, Any]: summary = self.summary - description: None | str | Unset + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: description = self.description - service_ids: list[str] | None | Unset + service_ids: Union[None, Unset, list[str]] if isinstance(self.service_ids, Unset): service_ids = UNSET elif isinstance(self.service_ids, list): @@ -99,7 +99,7 @@ def to_dict(self) -> dict[str, Any]: else: service_ids = self.service_ids - group_ids: list[str] | None | Unset + group_ids: Union[None, Unset, list[str]] if isinstance(self.group_ids, Unset): group_ids = UNSET elif isinstance(self.group_ids, list): @@ -108,7 +108,7 @@ def to_dict(self) -> dict[str, Any]: else: group_ids = self.group_ids - functionality_ids: list[str] | None | Unset + functionality_ids: Union[None, Unset, list[str]] if isinstance(self.functionality_ids, Unset): functionality_ids = UNSET elif isinstance(self.functionality_ids, list): @@ -117,7 +117,7 @@ def to_dict(self) -> dict[str, Any]: else: functionality_ids = self.functionality_ids - environment_ids: list[str] | None | Unset + environment_ids: Union[None, Unset, list[str]] if isinstance(self.environment_ids, Unset): environment_ids = UNSET elif isinstance(self.environment_ids, list): @@ -126,7 +126,7 @@ def to_dict(self) -> dict[str, Any]: else: environment_ids = self.environment_ids - started_at: None | str | Unset + started_at: Union[None, Unset, str] if isinstance(self.started_at, Unset): started_at = UNSET elif isinstance(self.started_at, datetime.datetime): @@ -134,7 +134,7 @@ def to_dict(self) -> dict[str, Any]: else: started_at = self.started_at - ended_at: None | str | Unset + ended_at: Union[None, Unset, str] if isinstance(self.ended_at, Unset): ended_at = UNSET elif isinstance(self.ended_at, datetime.datetime): @@ -142,36 +142,36 @@ def to_dict(self) -> dict[str, Any]: else: ended_at = self.ended_at - external_id: None | str | Unset + external_id: Union[None, Unset, str] if isinstance(self.external_id, Unset): external_id = UNSET else: external_id = self.external_id - external_url: None | str | Unset + external_url: Union[None, Unset, str] if isinstance(self.external_url, Unset): external_url = UNSET else: external_url = self.external_url - alert_urgency_id: None | str | Unset + alert_urgency_id: Union[None, Unset, str] if isinstance(self.alert_urgency_id, Unset): alert_urgency_id = UNSET else: alert_urgency_id = self.alert_urgency_id - labels: list[dict[str, Any] | None] | Unset = UNSET + labels: Union[Unset, list[Union[None, dict[str, Any]]]] = UNSET if not isinstance(self.labels, Unset): labels = [] for labels_item_data in self.labels: - labels_item: dict[str, Any] | None + labels_item: Union[None, dict[str, Any]] if isinstance(labels_item_data, UpdateAlertDataAttributesLabelsItemType0): labels_item = labels_item_data.to_dict() else: labels_item = labels_item_data labels.append(labels_item) - data: dict[str, Any] | None | Unset + data: Union[None, Unset, dict[str, Any]] if isinstance(self.data, Unset): data = UNSET elif isinstance(self.data, UpdateAlertDataAttributesDataType0): @@ -179,17 +179,17 @@ def to_dict(self) -> dict[str, Any]: else: data = self.data - deduplication_key: None | str | Unset + deduplication_key: Union[None, Unset, str] if isinstance(self.deduplication_key, Unset): deduplication_key = UNSET else: deduplication_key = self.deduplication_key - alert_field_values_attributes: list[dict[str, Any] | None] | Unset = UNSET + alert_field_values_attributes: Union[Unset, list[Union[None, dict[str, Any]]]] = UNSET if not isinstance(self.alert_field_values_attributes, Unset): alert_field_values_attributes = [] for alert_field_values_attributes_item_data in self.alert_field_values_attributes: - alert_field_values_attributes_item: dict[str, Any] | None + alert_field_values_attributes_item: Union[None, dict[str, Any]] if isinstance( alert_field_values_attributes_item_data, UpdateAlertDataAttributesAlertFieldValuesAttributesItemType0, @@ -249,7 +249,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _noise = d.pop("noise", UNSET) - noise: UpdateAlertDataAttributesNoise | Unset + noise: Union[Unset, UpdateAlertDataAttributesNoise] if isinstance(_noise, Unset): noise = UNSET else: @@ -259,16 +259,16 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: summary = d.pop("summary", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) - def _parse_service_ids(data: object) -> list[str] | None | Unset: + def _parse_service_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -279,13 +279,13 @@ def _parse_service_ids(data: object) -> list[str] | None | Unset: service_ids_type_0 = cast(list[str], data) return service_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) service_ids = _parse_service_ids(d.pop("service_ids", UNSET)) - def _parse_group_ids(data: object) -> list[str] | None | Unset: + def _parse_group_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -296,13 +296,13 @@ def _parse_group_ids(data: object) -> list[str] | None | Unset: group_ids_type_0 = cast(list[str], data) return group_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) group_ids = _parse_group_ids(d.pop("group_ids", UNSET)) - def _parse_functionality_ids(data: object) -> list[str] | None | Unset: + def _parse_functionality_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -313,13 +313,13 @@ def _parse_functionality_ids(data: object) -> list[str] | None | Unset: functionality_ids_type_0 = cast(list[str], data) return functionality_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) functionality_ids = _parse_functionality_ids(d.pop("functionality_ids", UNSET)) - def _parse_environment_ids(data: object) -> list[str] | None | Unset: + def _parse_environment_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -330,13 +330,13 @@ def _parse_environment_ids(data: object) -> list[str] | None | Unset: environment_ids_type_0 = cast(list[str], data) return environment_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) environment_ids = _parse_environment_ids(d.pop("environment_ids", UNSET)) - def _parse_started_at(data: object) -> datetime.datetime | None | Unset: + def _parse_started_at(data: object) -> Union[None, Unset, datetime.datetime]: if data is None: return data if isinstance(data, Unset): @@ -347,13 +347,13 @@ def _parse_started_at(data: object) -> datetime.datetime | None | Unset: started_at_type_0 = isoparse(data) return started_at_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(datetime.datetime | None | Unset, data) + return cast(Union[None, Unset, datetime.datetime], data) started_at = _parse_started_at(d.pop("started_at", UNSET)) - def _parse_ended_at(data: object) -> datetime.datetime | None | Unset: + def _parse_ended_at(data: object) -> Union[None, Unset, datetime.datetime]: if data is None: return data if isinstance(data, Unset): @@ -364,63 +364,61 @@ def _parse_ended_at(data: object) -> datetime.datetime | None | Unset: ended_at_type_0 = isoparse(data) return ended_at_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(datetime.datetime | None | Unset, data) + return cast(Union[None, Unset, datetime.datetime], data) ended_at = _parse_ended_at(d.pop("ended_at", UNSET)) - def _parse_external_id(data: object) -> None | str | Unset: + def _parse_external_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) external_id = _parse_external_id(d.pop("external_id", UNSET)) - def _parse_external_url(data: object) -> None | str | Unset: + def _parse_external_url(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) external_url = _parse_external_url(d.pop("external_url", UNSET)) - def _parse_alert_urgency_id(data: object) -> None | str | Unset: + def _parse_alert_urgency_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) alert_urgency_id = _parse_alert_urgency_id(d.pop("alert_urgency_id", UNSET)) + labels = [] _labels = d.pop("labels", UNSET) - labels: list[None | UpdateAlertDataAttributesLabelsItemType0] | Unset = UNSET - if _labels is not UNSET: - labels = [] - for labels_item_data in _labels: + for labels_item_data in _labels or []: - def _parse_labels_item(data: object) -> None | UpdateAlertDataAttributesLabelsItemType0: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - labels_item_type_0 = UpdateAlertDataAttributesLabelsItemType0.from_dict(data) + def _parse_labels_item(data: object) -> Union["UpdateAlertDataAttributesLabelsItemType0", None]: + if data is None: + return data + try: + if not isinstance(data, dict): + raise TypeError() + labels_item_type_0 = UpdateAlertDataAttributesLabelsItemType0.from_dict(data) - return labels_item_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | UpdateAlertDataAttributesLabelsItemType0, data) + return labels_item_type_0 + except: # noqa: E722 + pass + return cast(Union["UpdateAlertDataAttributesLabelsItemType0", None], data) - labels_item = _parse_labels_item(labels_item_data) + labels_item = _parse_labels_item(labels_item_data) - labels.append(labels_item) + labels.append(labels_item) - def _parse_data(data: object) -> None | Unset | UpdateAlertDataAttributesDataType0: + def _parse_data(data: object) -> Union["UpdateAlertDataAttributesDataType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -431,51 +429,47 @@ def _parse_data(data: object) -> None | Unset | UpdateAlertDataAttributesDataTyp data_type_0 = UpdateAlertDataAttributesDataType0.from_dict(data) return data_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(None | Unset | UpdateAlertDataAttributesDataType0, data) + return cast(Union["UpdateAlertDataAttributesDataType0", None, Unset], data) data = _parse_data(d.pop("data", UNSET)) - def _parse_deduplication_key(data: object) -> None | str | Unset: + def _parse_deduplication_key(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) deduplication_key = _parse_deduplication_key(d.pop("deduplication_key", UNSET)) + alert_field_values_attributes = [] _alert_field_values_attributes = d.pop("alert_field_values_attributes", UNSET) - alert_field_values_attributes: ( - list[None | UpdateAlertDataAttributesAlertFieldValuesAttributesItemType0] | Unset - ) = UNSET - if _alert_field_values_attributes is not UNSET: - alert_field_values_attributes = [] - for alert_field_values_attributes_item_data in _alert_field_values_attributes: - - def _parse_alert_field_values_attributes_item( - data: object, - ) -> None | UpdateAlertDataAttributesAlertFieldValuesAttributesItemType0: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - alert_field_values_attributes_item_type_0 = ( - UpdateAlertDataAttributesAlertFieldValuesAttributesItemType0.from_dict(data) - ) - - return alert_field_values_attributes_item_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | UpdateAlertDataAttributesAlertFieldValuesAttributesItemType0, data) - - alert_field_values_attributes_item = _parse_alert_field_values_attributes_item( - alert_field_values_attributes_item_data - ) - - alert_field_values_attributes.append(alert_field_values_attributes_item) + for alert_field_values_attributes_item_data in _alert_field_values_attributes or []: + + def _parse_alert_field_values_attributes_item( + data: object, + ) -> Union["UpdateAlertDataAttributesAlertFieldValuesAttributesItemType0", None]: + if data is None: + return data + try: + if not isinstance(data, dict): + raise TypeError() + alert_field_values_attributes_item_type_0 = ( + UpdateAlertDataAttributesAlertFieldValuesAttributesItemType0.from_dict(data) + ) + + return alert_field_values_attributes_item_type_0 + except: # noqa: E722 + pass + return cast(Union["UpdateAlertDataAttributesAlertFieldValuesAttributesItemType0", None], data) + + alert_field_values_attributes_item = _parse_alert_field_values_attributes_item( + alert_field_values_attributes_item_data + ) + + alert_field_values_attributes.append(alert_field_values_attributes_item) update_alert_data_attributes = cls( noise=noise, diff --git a/rootly_sdk/models/update_alert_data_attributes_alert_field_values_attributes_item_type_0.py b/rootly_sdk/models/update_alert_data_attributes_alert_field_values_attributes_item_type_0.py index ff427941..f34dfe8e 100644 --- a/rootly_sdk/models/update_alert_data_attributes_alert_field_values_attributes_item_type_0.py +++ b/rootly_sdk/models/update_alert_data_attributes_alert_field_values_attributes_item_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/update_alert_data_attributes_data_type_0.py b/rootly_sdk/models/update_alert_data_attributes_data_type_0.py index 29405f27..300227e7 100644 --- a/rootly_sdk/models/update_alert_data_attributes_data_type_0.py +++ b/rootly_sdk/models/update_alert_data_attributes_data_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,7 +14,6 @@ class UpdateAlertDataAttributesDataType0: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) diff --git a/rootly_sdk/models/update_alert_data_attributes_labels_item_type_0.py b/rootly_sdk/models/update_alert_data_attributes_labels_item_type_0.py index 52b1e2d8..1ec75897 100644 --- a/rootly_sdk/models/update_alert_data_attributes_labels_item_type_0.py +++ b/rootly_sdk/models/update_alert_data_attributes_labels_item_type_0.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -14,17 +12,17 @@ class UpdateAlertDataAttributesLabelsItemType0: """ Attributes: key (str): Key of the tag - value (bool | float | str): Value of the tag + value (Union[bool, float, str]): Value of the tag """ key: str - value: bool | float | str + value: Union[bool, float, str] additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: key = self.key - value: bool | float | str + value: Union[bool, float, str] value = self.value field_dict: dict[str, Any] = {} @@ -43,8 +41,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) key = d.pop("key") - def _parse_value(data: object) -> bool | float | str: - return cast(bool | float | str, data) + def _parse_value(data: object) -> Union[bool, float, str]: + return cast(Union[bool, float, str], data) value = _parse_value(d.pop("value")) diff --git a/rootly_sdk/models/update_alert_event.py b/rootly_sdk/models/update_alert_event.py index 6e00bcc1..7e1573dc 100644 --- a/rootly_sdk/models/update_alert_event.py +++ b/rootly_sdk/models/update_alert_event.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,11 +19,10 @@ class UpdateAlertEvent: data (UpdateAlertEventData): """ - data: UpdateAlertEventData + data: "UpdateAlertEventData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_alert_event_data.py b/rootly_sdk/models/update_alert_event_data.py index dde651dc..9c5af1dd 100644 --- a/rootly_sdk/models/update_alert_event_data.py +++ b/rootly_sdk/models/update_alert_event_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class UpdateAlertEventData: """ type_: UpdateAlertEventDataType - attributes: UpdateAlertEventDataAttributes + attributes: "UpdateAlertEventDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_alert_event_data_attributes.py b/rootly_sdk/models/update_alert_event_data_attributes.py index 82b7f634..9728bcf2 100644 --- a/rootly_sdk/models/update_alert_event_data_attributes.py +++ b/rootly_sdk/models/update_alert_event_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define @@ -15,11 +13,11 @@ class UpdateAlertEventDataAttributes: """ Attributes: details (str): Note message. - user_id (int | Unset): Author of the note. + user_id (Union[Unset, int]): Author of the note. """ details: str - user_id: int | Unset = UNSET + user_id: Union[Unset, int] = UNSET def to_dict(self) -> dict[str, Any]: details = self.details diff --git a/rootly_sdk/models/update_alert_field.py b/rootly_sdk/models/update_alert_field.py index 06649e62..fa71ba3b 100644 --- a/rootly_sdk/models/update_alert_field.py +++ b/rootly_sdk/models/update_alert_field.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateAlertField: data (UpdateAlertFieldData): """ - data: UpdateAlertFieldData + data: "UpdateAlertFieldData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_alert_field_data.py b/rootly_sdk/models/update_alert_field_data.py index e2ed53d9..3eb15a6f 100644 --- a/rootly_sdk/models/update_alert_field_data.py +++ b/rootly_sdk/models/update_alert_field_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class UpdateAlertFieldData: """ type_: UpdateAlertFieldDataType - attributes: UpdateAlertFieldDataAttributes + attributes: "UpdateAlertFieldDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_alert_field_data_attributes.py b/rootly_sdk/models/update_alert_field_data_attributes.py index 67e5080a..84ab4e68 100644 --- a/rootly_sdk/models/update_alert_field_data_attributes.py +++ b/rootly_sdk/models/update_alert_field_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -14,17 +12,28 @@ class UpdateAlertFieldDataAttributes: """ Attributes: - name (str | Unset): The name of the alert field + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + name (Union[Unset, str]): The name of the alert field """ - name: str | Unset = UNSET + slug: Union[None, Unset, str] = UNSET + name: Union[Unset, str] = UNSET def to_dict(self) -> dict[str, Any]: + slug: Union[None, Unset, str] + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug + name = self.name field_dict: dict[str, Any] = {} field_dict.update({}) + if slug is not UNSET: + field_dict["slug"] = slug if name is not UNSET: field_dict["name"] = name @@ -33,9 +42,20 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) + + def _parse_slug(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + slug = _parse_slug(d.pop("slug", UNSET)) + name = d.pop("name", UNSET) update_alert_field_data_attributes = cls( + slug=slug, name=name, ) diff --git a/rootly_sdk/models/update_alert_group.py b/rootly_sdk/models/update_alert_group.py index d37bfcee..6576d80b 100644 --- a/rootly_sdk/models/update_alert_group.py +++ b/rootly_sdk/models/update_alert_group.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateAlertGroup: data (UpdateAlertGroupData): """ - data: UpdateAlertGroupData + data: "UpdateAlertGroupData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_alert_group_data.py b/rootly_sdk/models/update_alert_group_data.py index 3e166626..f39cb79b 100644 --- a/rootly_sdk/models/update_alert_group_data.py +++ b/rootly_sdk/models/update_alert_group_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class UpdateAlertGroupData: """ type_: UpdateAlertGroupDataType - attributes: UpdateAlertGroupDataAttributes + attributes: "UpdateAlertGroupDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_alert_group_data_attributes.py b/rootly_sdk/models/update_alert_group_data_attributes.py index 65cd73df..6e642c0a 100644 --- a/rootly_sdk/models/update_alert_group_data_attributes.py +++ b/rootly_sdk/models/update_alert_group_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -32,38 +30,46 @@ class UpdateAlertGroupDataAttributes: """ Attributes: - name (str | Unset): The name of the alert group - description (None | str | Unset): The description of the alert group - time_window (int | Unset): The length of time an Alert Group should stay open and accept new alerts - targets (list[UpdateAlertGroupDataAttributesTargetsItem] | Unset): - attributes (list[UpdateAlertGroupDataAttributesAttributesItem] | Unset): This field is deprecated. Please use - the `conditions` field instead, `attributes` will be removed in the future. - group_by_alert_title (UpdateAlertGroupDataAttributesGroupByAlertTitle | Unset): [DEPRECATED] Whether the alerts - should be grouped by titles. This field is deprecated. Please use the `conditions` field with advanced alert - grouping instead. - group_by_alert_urgency (UpdateAlertGroupDataAttributesGroupByAlertUrgency | Unset): [DEPRECATED] Whether the - alerts should be grouped by urgencies. This field is deprecated. Please use the `conditions` field with advanced + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + name (Union[Unset, str]): The name of the alert group + description (Union[None, Unset, str]): The description of the alert group + time_window (Union[Unset, int]): The length of time an Alert Group should stay open and accept new alerts + targets (Union[Unset, list['UpdateAlertGroupDataAttributesTargetsItem']]): + attributes (Union[Unset, list['UpdateAlertGroupDataAttributesAttributesItem']]): This field is deprecated. + Please use the `conditions` field instead, `attributes` will be removed in the future. + group_by_alert_title (Union[Unset, UpdateAlertGroupDataAttributesGroupByAlertTitle]): [DEPRECATED] Whether the + alerts should be grouped by titles. This field is deprecated. Please use the `conditions` field with advanced alert grouping instead. - condition_type (UpdateAlertGroupDataAttributesConditionType | Unset): Group alerts when ANY or ALL of the fields - are matching. - conditions (list[UpdateAlertGroupDataAttributesConditionsItem] | Unset): + group_by_alert_urgency (Union[Unset, UpdateAlertGroupDataAttributesGroupByAlertUrgency]): [DEPRECATED] Whether + the alerts should be grouped by urgencies. This field is deprecated. Please use the `conditions` field with + advanced alert grouping instead. + condition_type (Union[Unset, UpdateAlertGroupDataAttributesConditionType]): Group alerts when ANY or ALL of the + fields are matching. + conditions (Union[Unset, list['UpdateAlertGroupDataAttributesConditionsItem']]): """ - name: str | Unset = UNSET - description: None | str | Unset = UNSET - time_window: int | Unset = UNSET - targets: list[UpdateAlertGroupDataAttributesTargetsItem] | Unset = UNSET - attributes: list[UpdateAlertGroupDataAttributesAttributesItem] | Unset = UNSET - group_by_alert_title: UpdateAlertGroupDataAttributesGroupByAlertTitle | Unset = UNSET - group_by_alert_urgency: UpdateAlertGroupDataAttributesGroupByAlertUrgency | Unset = UNSET - condition_type: UpdateAlertGroupDataAttributesConditionType | Unset = UNSET - conditions: list[UpdateAlertGroupDataAttributesConditionsItem] | Unset = UNSET + slug: Union[None, Unset, str] = UNSET + name: Union[Unset, str] = UNSET + description: Union[None, Unset, str] = UNSET + time_window: Union[Unset, int] = UNSET + targets: Union[Unset, list["UpdateAlertGroupDataAttributesTargetsItem"]] = UNSET + attributes: Union[Unset, list["UpdateAlertGroupDataAttributesAttributesItem"]] = UNSET + group_by_alert_title: Union[Unset, UpdateAlertGroupDataAttributesGroupByAlertTitle] = UNSET + group_by_alert_urgency: Union[Unset, UpdateAlertGroupDataAttributesGroupByAlertUrgency] = UNSET + condition_type: Union[Unset, UpdateAlertGroupDataAttributesConditionType] = UNSET + conditions: Union[Unset, list["UpdateAlertGroupDataAttributesConditionsItem"]] = UNSET def to_dict(self) -> dict[str, Any]: + slug: Union[None, Unset, str] + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug name = self.name - description: None | str | Unset + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: @@ -71,33 +77,33 @@ def to_dict(self) -> dict[str, Any]: time_window = self.time_window - targets: list[dict[str, Any]] | Unset = UNSET + targets: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.targets, Unset): targets = [] for targets_item_data in self.targets: targets_item = targets_item_data.to_dict() targets.append(targets_item) - attributes: list[dict[str, Any]] | Unset = UNSET + attributes: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.attributes, Unset): attributes = [] for attributes_item_data in self.attributes: attributes_item = attributes_item_data.to_dict() attributes.append(attributes_item) - group_by_alert_title: int | Unset = UNSET + group_by_alert_title: Union[Unset, int] = UNSET if not isinstance(self.group_by_alert_title, Unset): group_by_alert_title = self.group_by_alert_title - group_by_alert_urgency: int | Unset = UNSET + group_by_alert_urgency: Union[Unset, int] = UNSET if not isinstance(self.group_by_alert_urgency, Unset): group_by_alert_urgency = self.group_by_alert_urgency - condition_type: str | Unset = UNSET + condition_type: Union[Unset, str] = UNSET if not isinstance(self.condition_type, Unset): condition_type = self.condition_type - conditions: list[dict[str, Any]] | Unset = UNSET + conditions: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.conditions, Unset): conditions = [] for conditions_item_data in self.conditions: @@ -107,6 +113,8 @@ def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} field_dict.update({}) + if slug is not UNSET: + field_dict["slug"] = slug if name is not UNSET: field_dict["name"] = name if description is not UNSET: @@ -139,46 +147,52 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: from ..models.update_alert_group_data_attributes_targets_item import UpdateAlertGroupDataAttributesTargetsItem d = dict(src_dict) + + def _parse_slug(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + slug = _parse_slug(d.pop("slug", UNSET)) + name = d.pop("name", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) time_window = d.pop("time_window", UNSET) + targets = [] _targets = d.pop("targets", UNSET) - targets: list[UpdateAlertGroupDataAttributesTargetsItem] | Unset = UNSET - if _targets is not UNSET: - targets = [] - for targets_item_data in _targets: - targets_item = UpdateAlertGroupDataAttributesTargetsItem.from_dict(targets_item_data) + for targets_item_data in _targets or []: + targets_item = UpdateAlertGroupDataAttributesTargetsItem.from_dict(targets_item_data) - targets.append(targets_item) + targets.append(targets_item) + attributes = [] _attributes = d.pop("attributes", UNSET) - attributes: list[UpdateAlertGroupDataAttributesAttributesItem] | Unset = UNSET - if _attributes is not UNSET: - attributes = [] - for attributes_item_data in _attributes: - attributes_item = UpdateAlertGroupDataAttributesAttributesItem.from_dict(attributes_item_data) + for attributes_item_data in _attributes or []: + attributes_item = UpdateAlertGroupDataAttributesAttributesItem.from_dict(attributes_item_data) - attributes.append(attributes_item) + attributes.append(attributes_item) _group_by_alert_title = d.pop("group_by_alert_title", UNSET) - group_by_alert_title: UpdateAlertGroupDataAttributesGroupByAlertTitle | Unset + group_by_alert_title: Union[Unset, UpdateAlertGroupDataAttributesGroupByAlertTitle] if isinstance(_group_by_alert_title, Unset): group_by_alert_title = UNSET else: group_by_alert_title = check_update_alert_group_data_attributes_group_by_alert_title(_group_by_alert_title) _group_by_alert_urgency = d.pop("group_by_alert_urgency", UNSET) - group_by_alert_urgency: UpdateAlertGroupDataAttributesGroupByAlertUrgency | Unset + group_by_alert_urgency: Union[Unset, UpdateAlertGroupDataAttributesGroupByAlertUrgency] if isinstance(_group_by_alert_urgency, Unset): group_by_alert_urgency = UNSET else: @@ -187,22 +201,21 @@ def _parse_description(data: object) -> None | str | Unset: ) _condition_type = d.pop("condition_type", UNSET) - condition_type: UpdateAlertGroupDataAttributesConditionType | Unset + condition_type: Union[Unset, UpdateAlertGroupDataAttributesConditionType] if isinstance(_condition_type, Unset): condition_type = UNSET else: condition_type = check_update_alert_group_data_attributes_condition_type(_condition_type) + conditions = [] _conditions = d.pop("conditions", UNSET) - conditions: list[UpdateAlertGroupDataAttributesConditionsItem] | Unset = UNSET - if _conditions is not UNSET: - conditions = [] - for conditions_item_data in _conditions: - conditions_item = UpdateAlertGroupDataAttributesConditionsItem.from_dict(conditions_item_data) + for conditions_item_data in _conditions or []: + conditions_item = UpdateAlertGroupDataAttributesConditionsItem.from_dict(conditions_item_data) - conditions.append(conditions_item) + conditions.append(conditions_item) update_alert_group_data_attributes = cls( + slug=slug, name=name, description=description, time_window=time_window, diff --git a/rootly_sdk/models/update_alert_group_data_attributes_attributes_item.py b/rootly_sdk/models/update_alert_group_data_attributes_attributes_item.py index 6ab7e774..fb27fadb 100644 --- a/rootly_sdk/models/update_alert_group_data_attributes_attributes_item.py +++ b/rootly_sdk/models/update_alert_group_data_attributes_attributes_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,10 +13,10 @@ class UpdateAlertGroupDataAttributesAttributesItem: """ Attributes: - json_path (str | Unset): The JSON path to the value to group by. + json_path (Union[Unset, str]): The JSON path to the value to group by. """ - json_path: str | Unset = UNSET + json_path: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_alert_group_data_attributes_conditions_item.py b/rootly_sdk/models/update_alert_group_data_attributes_conditions_item.py index 75f5bd3a..801bdb07 100644 --- a/rootly_sdk/models/update_alert_group_data_attributes_conditions_item.py +++ b/rootly_sdk/models/update_alert_group_data_attributes_conditions_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -31,31 +29,32 @@ class UpdateAlertGroupDataAttributesConditionsItem: field property_field_condition_type (UpdateAlertGroupDataAttributesConditionsItemPropertyFieldConditionType): The condition type of the property field - property_field_name (str | Unset): The name of the property field. If the property field type is selected as - 'attribute', then the allowed property field names are 'summary' (for Title), 'description', 'alert_urgency' and - 'external_url' (for Alert Source URL). If the property field type is selected as 'payload', then the property - field name should be supplied in JSON Path syntax. - property_field_value (str | Unset): The value of the property field. Can be null if the property field condition - type is 'is_one_of' or 'is_not_one_of' - property_field_values (list[str] | Unset): The values of the property field. Need to be passed if the property - field condition type is 'is_one_of' or 'is_not_one_of' except for when property field name is 'alert_urgency' - alert_urgency_ids (list[str] | None | Unset): The Alert Urgency IDs to check in the condition. Only need to be - set when the property field type is 'attribute', the property field name is 'alert_urgency' and the property + property_field_name (Union[Unset, str]): The name of the property field. If the property field type is selected + as 'attribute', then the allowed property field names are 'summary' (for Title), 'description', 'alert_urgency' + and 'external_url' (for Alert Source URL). If the property field type is selected as 'payload', then the + property field name should be supplied in JSON Path syntax. + property_field_value (Union[Unset, str]): The value of the property field. Can be null if the property field + condition type is 'is_one_of' or 'is_not_one_of' + property_field_values (Union[Unset, list[str]]): The values of the property field. Need to be passed if the + property field condition type is 'is_one_of' or 'is_not_one_of' except for when property field name is + 'alert_urgency' + alert_urgency_ids (Union[None, Unset, list[str]]): The Alert Urgency IDs to check in the condition. Only need to + be set when the property field type is 'attribute', the property field name is 'alert_urgency' and the property field condition type is 'is_one_of' or 'is_not_one_of' - conditionable_type (UpdateAlertGroupDataAttributesConditionsItemConditionableType | Unset): The type of the - conditionable - conditionable_id (str | Unset): The ID of the conditionable. If conditionable_type is AlertField, this is the ID - of the alert field. + conditionable_type (Union[Unset, UpdateAlertGroupDataAttributesConditionsItemConditionableType]): The type of + the conditionable + conditionable_id (Union[Unset, str]): The ID of the conditionable. If conditionable_type is AlertField, this is + the ID of the alert field. """ property_field_type: UpdateAlertGroupDataAttributesConditionsItemPropertyFieldType property_field_condition_type: UpdateAlertGroupDataAttributesConditionsItemPropertyFieldConditionType - property_field_name: str | Unset = UNSET - property_field_value: str | Unset = UNSET - property_field_values: list[str] | Unset = UNSET - alert_urgency_ids: list[str] | None | Unset = UNSET - conditionable_type: UpdateAlertGroupDataAttributesConditionsItemConditionableType | Unset = UNSET - conditionable_id: str | Unset = UNSET + property_field_name: Union[Unset, str] = UNSET + property_field_value: Union[Unset, str] = UNSET + property_field_values: Union[Unset, list[str]] = UNSET + alert_urgency_ids: Union[None, Unset, list[str]] = UNSET + conditionable_type: Union[Unset, UpdateAlertGroupDataAttributesConditionsItemConditionableType] = UNSET + conditionable_id: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -67,11 +66,11 @@ def to_dict(self) -> dict[str, Any]: property_field_value = self.property_field_value - property_field_values: list[str] | Unset = UNSET + property_field_values: Union[Unset, list[str]] = UNSET if not isinstance(self.property_field_values, Unset): property_field_values = self.property_field_values - alert_urgency_ids: list[str] | None | Unset + alert_urgency_ids: Union[None, Unset, list[str]] if isinstance(self.alert_urgency_ids, Unset): alert_urgency_ids = UNSET elif isinstance(self.alert_urgency_ids, list): @@ -80,7 +79,7 @@ def to_dict(self) -> dict[str, Any]: else: alert_urgency_ids = self.alert_urgency_ids - conditionable_type: str | Unset = UNSET + conditionable_type: Union[Unset, str] = UNSET if not isinstance(self.conditionable_type, Unset): conditionable_type = self.conditionable_type @@ -128,7 +127,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: property_field_values = cast(list[str], d.pop("property_field_values", UNSET)) - def _parse_alert_urgency_ids(data: object) -> list[str] | None | Unset: + def _parse_alert_urgency_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -139,14 +138,14 @@ def _parse_alert_urgency_ids(data: object) -> list[str] | None | Unset: alert_urgency_ids_type_0 = cast(list[str], data) return alert_urgency_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) alert_urgency_ids = _parse_alert_urgency_ids(d.pop("alert_urgency_ids", UNSET)) _conditionable_type = d.pop("conditionable_type", UNSET) - conditionable_type: UpdateAlertGroupDataAttributesConditionsItemConditionableType | Unset + conditionable_type: Union[Unset, UpdateAlertGroupDataAttributesConditionsItemConditionableType] if isinstance(_conditionable_type, Unset): conditionable_type = UNSET else: diff --git a/rootly_sdk/models/update_alert_group_data_attributes_targets_item.py b/rootly_sdk/models/update_alert_group_data_attributes_targets_item.py index 19e5bad6..8d67ea3a 100644 --- a/rootly_sdk/models/update_alert_group_data_attributes_targets_item.py +++ b/rootly_sdk/models/update_alert_group_data_attributes_targets_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar from uuid import UUID diff --git a/rootly_sdk/models/update_alert_retrigger_rule.py b/rootly_sdk/models/update_alert_retrigger_rule.py new file mode 100644 index 00000000..67a9c719 --- /dev/null +++ b/rootly_sdk/models/update_alert_retrigger_rule.py @@ -0,0 +1,65 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +if TYPE_CHECKING: + from ..models.update_alert_retrigger_rule_data import UpdateAlertRetriggerRuleData + + +T = TypeVar("T", bound="UpdateAlertRetriggerRule") + + +@_attrs_define +class UpdateAlertRetriggerRule: + """ + Attributes: + data (UpdateAlertRetriggerRuleData): + """ + + data: "UpdateAlertRetriggerRuleData" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "data": data, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.update_alert_retrigger_rule_data import UpdateAlertRetriggerRuleData + + d = dict(src_dict) + data = UpdateAlertRetriggerRuleData.from_dict(d.pop("data")) + + update_alert_retrigger_rule = cls( + data=data, + ) + + update_alert_retrigger_rule.additional_properties = d + return update_alert_retrigger_rule + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/rootly_sdk/models/update_alert_retrigger_rule_data.py b/rootly_sdk/models/update_alert_retrigger_rule_data.py new file mode 100644 index 00000000..c7d5f159 --- /dev/null +++ b/rootly_sdk/models/update_alert_retrigger_rule_data.py @@ -0,0 +1,78 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.update_alert_retrigger_rule_data_type import ( + UpdateAlertRetriggerRuleDataType, + check_update_alert_retrigger_rule_data_type, +) + +if TYPE_CHECKING: + from ..models.update_alert_retrigger_rule_data_attributes import UpdateAlertRetriggerRuleDataAttributes + + +T = TypeVar("T", bound="UpdateAlertRetriggerRuleData") + + +@_attrs_define +class UpdateAlertRetriggerRuleData: + """ + Attributes: + type_ (UpdateAlertRetriggerRuleDataType): + attributes (UpdateAlertRetriggerRuleDataAttributes): + """ + + type_: UpdateAlertRetriggerRuleDataType + attributes: "UpdateAlertRetriggerRuleDataAttributes" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + type_: str = self.type_ + + attributes = self.attributes.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "type": type_, + "attributes": attributes, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.update_alert_retrigger_rule_data_attributes import UpdateAlertRetriggerRuleDataAttributes + + d = dict(src_dict) + type_ = check_update_alert_retrigger_rule_data_type(d.pop("type")) + + attributes = UpdateAlertRetriggerRuleDataAttributes.from_dict(d.pop("attributes")) + + update_alert_retrigger_rule_data = cls( + type_=type_, + attributes=attributes, + ) + + update_alert_retrigger_rule_data.additional_properties = d + return update_alert_retrigger_rule_data + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/rootly_sdk/models/update_alert_retrigger_rule_data_attributes.py b/rootly_sdk/models/update_alert_retrigger_rule_data_attributes.py new file mode 100644 index 00000000..e0c92c1e --- /dev/null +++ b/rootly_sdk/models/update_alert_retrigger_rule_data_attributes.py @@ -0,0 +1,121 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define + +from ..models.update_alert_retrigger_rule_data_attributes_match_mode import ( + UpdateAlertRetriggerRuleDataAttributesMatchMode, + check_update_alert_retrigger_rule_data_attributes_match_mode, +) +from ..models.update_alert_retrigger_rule_data_attributes_timeout_minutes import ( + UpdateAlertRetriggerRuleDataAttributesTimeoutMinutes, + check_update_alert_retrigger_rule_data_attributes_timeout_minutes, +) +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.update_alert_retrigger_rule_data_attributes_conditions_item import ( + UpdateAlertRetriggerRuleDataAttributesConditionsItem, + ) + + +T = TypeVar("T", bound="UpdateAlertRetriggerRuleDataAttributes") + + +@_attrs_define +class UpdateAlertRetriggerRuleDataAttributes: + """ + Attributes: + name (Union[Unset, str]): A human-readable name for the rule + match_mode (Union[Unset, UpdateAlertRetriggerRuleDataAttributesMatchMode]): Whether all or any of the conditions + must match + timeout_minutes (Union[Unset, UpdateAlertRetriggerRuleDataAttributesTimeoutMinutes]): Re-trigger the alert this + many minutes after acknowledgment. Null means never re-trigger. + position (Union[Unset, int]): The position of the rule for ordering evaluation + conditions (Union[Unset, list['UpdateAlertRetriggerRuleDataAttributesConditionsItem']]): The full desired set of + conditions; replaces the rule's existing conditions. An empty array applies to every alert. + """ + + name: Union[Unset, str] = UNSET + match_mode: Union[Unset, UpdateAlertRetriggerRuleDataAttributesMatchMode] = UNSET + timeout_minutes: Union[Unset, UpdateAlertRetriggerRuleDataAttributesTimeoutMinutes] = UNSET + position: Union[Unset, int] = UNSET + conditions: Union[Unset, list["UpdateAlertRetriggerRuleDataAttributesConditionsItem"]] = UNSET + + def to_dict(self) -> dict[str, Any]: + name = self.name + + match_mode: Union[Unset, str] = UNSET + if not isinstance(self.match_mode, Unset): + match_mode = self.match_mode + + timeout_minutes: Union[Unset, int] = UNSET + if not isinstance(self.timeout_minutes, Unset): + timeout_minutes = self.timeout_minutes + + position = self.position + + conditions: Union[Unset, list[dict[str, Any]]] = UNSET + if not isinstance(self.conditions, Unset): + conditions = [] + for conditions_item_data in self.conditions: + conditions_item = conditions_item_data.to_dict() + conditions.append(conditions_item) + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if name is not UNSET: + field_dict["name"] = name + if match_mode is not UNSET: + field_dict["match_mode"] = match_mode + if timeout_minutes is not UNSET: + field_dict["timeout_minutes"] = timeout_minutes + if position is not UNSET: + field_dict["position"] = position + if conditions is not UNSET: + field_dict["conditions"] = conditions + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.update_alert_retrigger_rule_data_attributes_conditions_item import ( + UpdateAlertRetriggerRuleDataAttributesConditionsItem, + ) + + d = dict(src_dict) + name = d.pop("name", UNSET) + + _match_mode = d.pop("match_mode", UNSET) + match_mode: Union[Unset, UpdateAlertRetriggerRuleDataAttributesMatchMode] + if isinstance(_match_mode, Unset): + match_mode = UNSET + else: + match_mode = check_update_alert_retrigger_rule_data_attributes_match_mode(_match_mode) + + _timeout_minutes = d.pop("timeout_minutes", UNSET) + timeout_minutes: Union[Unset, UpdateAlertRetriggerRuleDataAttributesTimeoutMinutes] + if isinstance(_timeout_minutes, Unset): + timeout_minutes = UNSET + else: + timeout_minutes = check_update_alert_retrigger_rule_data_attributes_timeout_minutes(_timeout_minutes) + + position = d.pop("position", UNSET) + + conditions = [] + _conditions = d.pop("conditions", UNSET) + for conditions_item_data in _conditions or []: + conditions_item = UpdateAlertRetriggerRuleDataAttributesConditionsItem.from_dict(conditions_item_data) + + conditions.append(conditions_item) + + update_alert_retrigger_rule_data_attributes = cls( + name=name, + match_mode=match_mode, + timeout_minutes=timeout_minutes, + position=position, + conditions=conditions, + ) + + return update_alert_retrigger_rule_data_attributes diff --git a/rootly_sdk/models/update_alert_retrigger_rule_data_attributes_conditions_item.py b/rootly_sdk/models/update_alert_retrigger_rule_data_attributes_conditions_item.py new file mode 100644 index 00000000..48ab32ed --- /dev/null +++ b/rootly_sdk/models/update_alert_retrigger_rule_data_attributes_conditions_item.py @@ -0,0 +1,123 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, Union, cast +from uuid import UUID + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.update_alert_retrigger_rule_data_attributes_conditions_item_kind import ( + UpdateAlertRetriggerRuleDataAttributesConditionsItemKind, + check_update_alert_retrigger_rule_data_attributes_conditions_item_kind, +) +from ..models.update_alert_retrigger_rule_data_attributes_conditions_item_operator import ( + UpdateAlertRetriggerRuleDataAttributesConditionsItemOperator, + check_update_alert_retrigger_rule_data_attributes_conditions_item_operator, +) +from ..types import UNSET, Unset + +T = TypeVar("T", bound="UpdateAlertRetriggerRuleDataAttributesConditionsItem") + + +@_attrs_define +class UpdateAlertRetriggerRuleDataAttributesConditionsItem: + """ + Attributes: + kind (UpdateAlertRetriggerRuleDataAttributesConditionsItemKind): The operand the condition matches on. Native + operands (urgency, source, service, group) match by record; alert_field/payload match a field value. + operator (UpdateAlertRetriggerRuleDataAttributesConditionsItemOperator): How the operand is compared. Native + operands support is_one_of/is_not_one_of/is_set/is_not_set; alert_field/payload additionally support the + string/regex operators. + record_ids (Union[Unset, list[UUID]]): For urgency/service/group/source conditions: the IDs of the matched + records (AlertUrgency, Service, Group, or Alerts::Source). + values (Union[Unset, list[str]]): For source conditions: non-integration source aliases (e.g. manual, api). For + alert_field/payload conditions: the values to compare against. + property_field_name (Union[Unset, str]): For alert_field conditions: the alert field id. For payload conditions: + a JSON Path (e.g. $.priority). + """ + + kind: UpdateAlertRetriggerRuleDataAttributesConditionsItemKind + operator: UpdateAlertRetriggerRuleDataAttributesConditionsItemOperator + record_ids: Union[Unset, list[UUID]] = UNSET + values: Union[Unset, list[str]] = UNSET + property_field_name: Union[Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + kind: str = self.kind + + operator: str = self.operator + + record_ids: Union[Unset, list[str]] = UNSET + if not isinstance(self.record_ids, Unset): + record_ids = [] + for record_ids_item_data in self.record_ids: + record_ids_item = str(record_ids_item_data) + record_ids.append(record_ids_item) + + values: Union[Unset, list[str]] = UNSET + if not isinstance(self.values, Unset): + values = self.values + + property_field_name = self.property_field_name + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "kind": kind, + "operator": operator, + } + ) + if record_ids is not UNSET: + field_dict["record_ids"] = record_ids + if values is not UNSET: + field_dict["values"] = values + if property_field_name is not UNSET: + field_dict["property_field_name"] = property_field_name + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + kind = check_update_alert_retrigger_rule_data_attributes_conditions_item_kind(d.pop("kind")) + + operator = check_update_alert_retrigger_rule_data_attributes_conditions_item_operator(d.pop("operator")) + + record_ids = [] + _record_ids = d.pop("record_ids", UNSET) + for record_ids_item_data in _record_ids or []: + record_ids_item = UUID(record_ids_item_data) + + record_ids.append(record_ids_item) + + values = cast(list[str], d.pop("values", UNSET)) + + property_field_name = d.pop("property_field_name", UNSET) + + update_alert_retrigger_rule_data_attributes_conditions_item = cls( + kind=kind, + operator=operator, + record_ids=record_ids, + values=values, + property_field_name=property_field_name, + ) + + update_alert_retrigger_rule_data_attributes_conditions_item.additional_properties = d + return update_alert_retrigger_rule_data_attributes_conditions_item + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/rootly_sdk/models/update_alert_retrigger_rule_data_attributes_conditions_item_kind.py b/rootly_sdk/models/update_alert_retrigger_rule_data_attributes_conditions_item_kind.py new file mode 100644 index 00000000..f4d391e8 --- /dev/null +++ b/rootly_sdk/models/update_alert_retrigger_rule_data_attributes_conditions_item_kind.py @@ -0,0 +1,28 @@ +from typing import Literal, cast + +UpdateAlertRetriggerRuleDataAttributesConditionsItemKind = Literal[ + "alert_field", "group", "payload", "service", "source", "urgency" +] + +UPDATE_ALERT_RETRIGGER_RULE_DATA_ATTRIBUTES_CONDITIONS_ITEM_KIND_VALUES: set[ + UpdateAlertRetriggerRuleDataAttributesConditionsItemKind +] = { + "alert_field", + "group", + "payload", + "service", + "source", + "urgency", +} + + +def check_update_alert_retrigger_rule_data_attributes_conditions_item_kind( + value: str | None, +) -> UpdateAlertRetriggerRuleDataAttributesConditionsItemKind | None: + if value is None: + return None + if value in UPDATE_ALERT_RETRIGGER_RULE_DATA_ATTRIBUTES_CONDITIONS_ITEM_KIND_VALUES: + return cast(UpdateAlertRetriggerRuleDataAttributesConditionsItemKind, value) + raise TypeError( + f"Unexpected value {value!r}. Expected one of {UPDATE_ALERT_RETRIGGER_RULE_DATA_ATTRIBUTES_CONDITIONS_ITEM_KIND_VALUES!r}" + ) diff --git a/rootly_sdk/models/update_alert_retrigger_rule_data_attributes_conditions_item_operator.py b/rootly_sdk/models/update_alert_retrigger_rule_data_attributes_conditions_item_operator.py new file mode 100644 index 00000000..6cb950d3 --- /dev/null +++ b/rootly_sdk/models/update_alert_retrigger_rule_data_attributes_conditions_item_operator.py @@ -0,0 +1,39 @@ +from typing import Literal, cast + +UpdateAlertRetriggerRuleDataAttributesConditionsItemOperator = Literal[ + "contains", + "does_not_contain", + "ends_with", + "is_not_one_of", + "is_not_set", + "is_one_of", + "is_set", + "matches_regex", + "starts_with", +] + +UPDATE_ALERT_RETRIGGER_RULE_DATA_ATTRIBUTES_CONDITIONS_ITEM_OPERATOR_VALUES: set[ + UpdateAlertRetriggerRuleDataAttributesConditionsItemOperator +] = { + "contains", + "does_not_contain", + "ends_with", + "is_not_one_of", + "is_not_set", + "is_one_of", + "is_set", + "matches_regex", + "starts_with", +} + + +def check_update_alert_retrigger_rule_data_attributes_conditions_item_operator( + value: str | None, +) -> UpdateAlertRetriggerRuleDataAttributesConditionsItemOperator | None: + if value is None: + return None + if value in UPDATE_ALERT_RETRIGGER_RULE_DATA_ATTRIBUTES_CONDITIONS_ITEM_OPERATOR_VALUES: + return cast(UpdateAlertRetriggerRuleDataAttributesConditionsItemOperator, value) + raise TypeError( + f"Unexpected value {value!r}. Expected one of {UPDATE_ALERT_RETRIGGER_RULE_DATA_ATTRIBUTES_CONDITIONS_ITEM_OPERATOR_VALUES!r}" + ) diff --git a/rootly_sdk/models/update_alert_retrigger_rule_data_attributes_match_mode.py b/rootly_sdk/models/update_alert_retrigger_rule_data_attributes_match_mode.py new file mode 100644 index 00000000..9951e871 --- /dev/null +++ b/rootly_sdk/models/update_alert_retrigger_rule_data_attributes_match_mode.py @@ -0,0 +1,20 @@ +from typing import Literal, cast + +UpdateAlertRetriggerRuleDataAttributesMatchMode = Literal["match-all-rules", "match-any-rule"] + +UPDATE_ALERT_RETRIGGER_RULE_DATA_ATTRIBUTES_MATCH_MODE_VALUES: set[UpdateAlertRetriggerRuleDataAttributesMatchMode] = { + "match-all-rules", + "match-any-rule", +} + + +def check_update_alert_retrigger_rule_data_attributes_match_mode( + value: str | None, +) -> UpdateAlertRetriggerRuleDataAttributesMatchMode | None: + if value is None: + return None + if value in UPDATE_ALERT_RETRIGGER_RULE_DATA_ATTRIBUTES_MATCH_MODE_VALUES: + return cast(UpdateAlertRetriggerRuleDataAttributesMatchMode, value) + raise TypeError( + f"Unexpected value {value!r}. Expected one of {UPDATE_ALERT_RETRIGGER_RULE_DATA_ATTRIBUTES_MATCH_MODE_VALUES!r}" + ) diff --git a/rootly_sdk/models/update_alert_retrigger_rule_data_attributes_timeout_minutes.py b/rootly_sdk/models/update_alert_retrigger_rule_data_attributes_timeout_minutes.py new file mode 100644 index 00000000..3625f499 --- /dev/null +++ b/rootly_sdk/models/update_alert_retrigger_rule_data_attributes_timeout_minutes.py @@ -0,0 +1,34 @@ +from typing import Literal, cast + +UpdateAlertRetriggerRuleDataAttributesTimeoutMinutes = Literal[ + 10, 20, 30, 40, 50, 60, 90, 120, 180, 240, 300, 360, 720, 1440 +] + +UPDATE_ALERT_RETRIGGER_RULE_DATA_ATTRIBUTES_TIMEOUT_MINUTES_VALUES: set[ + UpdateAlertRetriggerRuleDataAttributesTimeoutMinutes +] = { + 10, + 20, + 30, + 40, + 50, + 60, + 90, + 120, + 180, + 240, + 300, + 360, + 720, + 1440, +} + + +def check_update_alert_retrigger_rule_data_attributes_timeout_minutes( + value: int, +) -> UpdateAlertRetriggerRuleDataAttributesTimeoutMinutes: + if value in UPDATE_ALERT_RETRIGGER_RULE_DATA_ATTRIBUTES_TIMEOUT_MINUTES_VALUES: + return cast(UpdateAlertRetriggerRuleDataAttributesTimeoutMinutes, value) + raise TypeError( + f"Unexpected value {value!r}. Expected one of {UPDATE_ALERT_RETRIGGER_RULE_DATA_ATTRIBUTES_TIMEOUT_MINUTES_VALUES!r}" + ) diff --git a/rootly_sdk/models/update_alert_retrigger_rule_data_type.py b/rootly_sdk/models/update_alert_retrigger_rule_data_type.py new file mode 100644 index 00000000..d27c23e1 --- /dev/null +++ b/rootly_sdk/models/update_alert_retrigger_rule_data_type.py @@ -0,0 +1,15 @@ +from typing import Literal, cast + +UpdateAlertRetriggerRuleDataType = Literal["alert_retrigger_rules"] + +UPDATE_ALERT_RETRIGGER_RULE_DATA_TYPE_VALUES: set[UpdateAlertRetriggerRuleDataType] = { + "alert_retrigger_rules", +} + + +def check_update_alert_retrigger_rule_data_type(value: str | None) -> UpdateAlertRetriggerRuleDataType | None: + if value is None: + return None + if value in UPDATE_ALERT_RETRIGGER_RULE_DATA_TYPE_VALUES: + return cast(UpdateAlertRetriggerRuleDataType, value) + raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_ALERT_RETRIGGER_RULE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/update_alert_route.py b/rootly_sdk/models/update_alert_route.py index 61ae04b2..05914582 100644 --- a/rootly_sdk/models/update_alert_route.py +++ b/rootly_sdk/models/update_alert_route.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateAlertRoute: data (UpdateAlertRouteData): """ - data: UpdateAlertRouteData + data: "UpdateAlertRouteData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_alert_route_data.py b/rootly_sdk/models/update_alert_route_data.py index 562adaa1..a962d3d6 100644 --- a/rootly_sdk/models/update_alert_route_data.py +++ b/rootly_sdk/models/update_alert_route_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class UpdateAlertRouteData: """ type_: UpdateAlertRouteDataType - attributes: UpdateAlertRouteDataAttributes + attributes: "UpdateAlertRouteDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_alert_route_data_attributes.py b/rootly_sdk/models/update_alert_route_data_attributes.py index 21b85825..5001e80b 100644 --- a/rootly_sdk/models/update_alert_route_data_attributes.py +++ b/rootly_sdk/models/update_alert_route_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from uuid import UUID from attrs import define as _attrs_define @@ -19,40 +17,39 @@ class UpdateAlertRouteDataAttributes: """ Attributes: - name (str | Unset): The name of the alert route - enabled (bool | Unset): Whether the alert route is enabled - alerts_source_ids (list[UUID] | Unset): - owning_team_ids (list[UUID] | Unset): - rules (list[UpdateAlertRouteDataAttributesRulesItem] | Unset): + name (Union[Unset, str]): The name of the alert route + enabled (Union[Unset, bool]): Whether the alert route is enabled + alerts_source_ids (Union[Unset, list[UUID]]): + owning_team_ids (Union[Unset, list[UUID]]): + rules (Union[Unset, list['UpdateAlertRouteDataAttributesRulesItem']]): """ - name: str | Unset = UNSET - enabled: bool | Unset = UNSET - alerts_source_ids: list[UUID] | Unset = UNSET - owning_team_ids: list[UUID] | Unset = UNSET - rules: list[UpdateAlertRouteDataAttributesRulesItem] | Unset = UNSET + name: Union[Unset, str] = UNSET + enabled: Union[Unset, bool] = UNSET + alerts_source_ids: Union[Unset, list[UUID]] = UNSET + owning_team_ids: Union[Unset, list[UUID]] = UNSET + rules: Union[Unset, list["UpdateAlertRouteDataAttributesRulesItem"]] = UNSET def to_dict(self) -> dict[str, Any]: - name = self.name enabled = self.enabled - alerts_source_ids: list[str] | Unset = UNSET + alerts_source_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.alerts_source_ids, Unset): alerts_source_ids = [] for alerts_source_ids_item_data in self.alerts_source_ids: alerts_source_ids_item = str(alerts_source_ids_item_data) alerts_source_ids.append(alerts_source_ids_item) - owning_team_ids: list[str] | Unset = UNSET + owning_team_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.owning_team_ids, Unset): owning_team_ids = [] for owning_team_ids_item_data in self.owning_team_ids: owning_team_ids_item = str(owning_team_ids_item_data) owning_team_ids.append(owning_team_ids_item) - rules: list[dict[str, Any]] | Unset = UNSET + rules: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.rules, Unset): rules = [] for rules_item_data in self.rules: @@ -84,32 +81,26 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: enabled = d.pop("enabled", UNSET) + alerts_source_ids = [] _alerts_source_ids = d.pop("alerts_source_ids", UNSET) - alerts_source_ids: list[UUID] | Unset = UNSET - if _alerts_source_ids is not UNSET: - alerts_source_ids = [] - for alerts_source_ids_item_data in _alerts_source_ids: - alerts_source_ids_item = UUID(alerts_source_ids_item_data) + for alerts_source_ids_item_data in _alerts_source_ids or []: + alerts_source_ids_item = UUID(alerts_source_ids_item_data) - alerts_source_ids.append(alerts_source_ids_item) + alerts_source_ids.append(alerts_source_ids_item) + owning_team_ids = [] _owning_team_ids = d.pop("owning_team_ids", UNSET) - owning_team_ids: list[UUID] | Unset = UNSET - if _owning_team_ids is not UNSET: - owning_team_ids = [] - for owning_team_ids_item_data in _owning_team_ids: - owning_team_ids_item = UUID(owning_team_ids_item_data) + for owning_team_ids_item_data in _owning_team_ids or []: + owning_team_ids_item = UUID(owning_team_ids_item_data) - owning_team_ids.append(owning_team_ids_item) + owning_team_ids.append(owning_team_ids_item) + rules = [] _rules = d.pop("rules", UNSET) - rules: list[UpdateAlertRouteDataAttributesRulesItem] | Unset = UNSET - if _rules is not UNSET: - rules = [] - for rules_item_data in _rules: - rules_item = UpdateAlertRouteDataAttributesRulesItem.from_dict(rules_item_data) + for rules_item_data in _rules or []: + rules_item = UpdateAlertRouteDataAttributesRulesItem.from_dict(rules_item_data) - rules.append(rules_item) + rules.append(rules_item) update_alert_route_data_attributes = cls( name=name, diff --git a/rootly_sdk/models/update_alert_route_data_attributes_rules_item.py b/rootly_sdk/models/update_alert_route_data_attributes_rules_item.py index ec7a1935..9790a35c 100644 --- a/rootly_sdk/models/update_alert_route_data_attributes_rules_item.py +++ b/rootly_sdk/models/update_alert_route_data_attributes_rules_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -25,21 +23,20 @@ class UpdateAlertRouteDataAttributesRulesItem: """ Attributes: name (str): The name of the alert routing rule - destinations (list[UpdateAlertRouteDataAttributesRulesItemDestinationsItem]): - condition_groups (list[UpdateAlertRouteDataAttributesRulesItemConditionGroupsItem]): - position (int | Unset): The position of the alert routing rule for ordering evaluation - fallback_rule (bool | Unset): Whether this is a fallback rule Default: False. + destinations (list['UpdateAlertRouteDataAttributesRulesItemDestinationsItem']): + condition_groups (list['UpdateAlertRouteDataAttributesRulesItemConditionGroupsItem']): + position (Union[Unset, int]): The position of the alert routing rule for ordering evaluation + fallback_rule (Union[Unset, bool]): Whether this is a fallback rule Default: False. """ name: str - destinations: list[UpdateAlertRouteDataAttributesRulesItemDestinationsItem] - condition_groups: list[UpdateAlertRouteDataAttributesRulesItemConditionGroupsItem] - position: int | Unset = UNSET - fallback_rule: bool | Unset = False + destinations: list["UpdateAlertRouteDataAttributesRulesItemDestinationsItem"] + condition_groups: list["UpdateAlertRouteDataAttributesRulesItemConditionGroupsItem"] + position: Union[Unset, int] = UNSET + fallback_rule: Union[Unset, bool] = False additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - name = self.name destinations = [] diff --git a/rootly_sdk/models/update_alert_route_data_attributes_rules_item_condition_groups_item.py b/rootly_sdk/models/update_alert_route_data_attributes_rules_item_condition_groups_item.py index 5128c9ce..a9fda9b6 100644 --- a/rootly_sdk/models/update_alert_route_data_attributes_rules_item_condition_groups_item.py +++ b/rootly_sdk/models/update_alert_route_data_attributes_rules_item_condition_groups_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,16 +19,15 @@ class UpdateAlertRouteDataAttributesRulesItemConditionGroupsItem: """ Attributes: - conditions (list[UpdateAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItem]): - position (int | Unset): The position of the condition group + conditions (list['UpdateAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItem']): + position (Union[Unset, int]): The position of the condition group """ - conditions: list[UpdateAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItem] - position: int | Unset = UNSET + conditions: list["UpdateAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItem"] + position: Union[Unset, int] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - conditions = [] for conditions_item_data in self.conditions: conditions_item = conditions_item_data.to_dict() diff --git a/rootly_sdk/models/update_alert_route_data_attributes_rules_item_condition_groups_item_conditions_item.py b/rootly_sdk/models/update_alert_route_data_attributes_rules_item_condition_groups_item_conditions_item.py index 6ede7018..0ccedbfb 100644 --- a/rootly_sdk/models/update_alert_route_data_attributes_rules_item_condition_groups_item_conditions_item.py +++ b/rootly_sdk/models/update_alert_route_data_attributes_rules_item_condition_groups_item_conditions_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from uuid import UUID from attrs import define as _attrs_define @@ -31,27 +29,28 @@ class UpdateAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItem: property_field_condition_type (UpdateAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemPropertyFieldConditionType): property_field_type (UpdateAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemPropertyFieldType): - property_field_name (str | Unset): The name of the property field - property_field_value (None | str | Unset): The value of the property field - property_field_values (list[str] | None | Unset): - alert_urgency_ids (list[str] | None | Unset): The Alert Urgency IDs to check in the condition - conditionable_type (UpdateAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemConditionableType | - Unset): The type of the conditionable - conditionable_id (None | Unset | UUID): The ID of the conditionable + property_field_name (Union[Unset, str]): The name of the property field + property_field_value (Union[None, Unset, str]): The value of the property field + property_field_values (Union[None, Unset, list[str]]): + alert_urgency_ids (Union[None, Unset, list[str]]): The Alert Urgency IDs to check in the condition + conditionable_type (Union[Unset, + UpdateAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemConditionableType]): The type of the + conditionable + conditionable_id (Union[None, UUID, Unset]): The ID of the conditionable """ property_field_condition_type: ( UpdateAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemPropertyFieldConditionType ) property_field_type: UpdateAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemPropertyFieldType - property_field_name: str | Unset = UNSET - property_field_value: None | str | Unset = UNSET - property_field_values: list[str] | None | Unset = UNSET - alert_urgency_ids: list[str] | None | Unset = UNSET - conditionable_type: ( - UpdateAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemConditionableType | Unset - ) = UNSET - conditionable_id: None | Unset | UUID = UNSET + property_field_name: Union[Unset, str] = UNSET + property_field_value: Union[None, Unset, str] = UNSET + property_field_values: Union[None, Unset, list[str]] = UNSET + alert_urgency_ids: Union[None, Unset, list[str]] = UNSET + conditionable_type: Union[ + Unset, UpdateAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemConditionableType + ] = UNSET + conditionable_id: Union[None, UUID, Unset] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -61,13 +60,13 @@ def to_dict(self) -> dict[str, Any]: property_field_name = self.property_field_name - property_field_value: None | str | Unset + property_field_value: Union[None, Unset, str] if isinstance(self.property_field_value, Unset): property_field_value = UNSET else: property_field_value = self.property_field_value - property_field_values: list[str] | None | Unset + property_field_values: Union[None, Unset, list[str]] if isinstance(self.property_field_values, Unset): property_field_values = UNSET elif isinstance(self.property_field_values, list): @@ -76,7 +75,7 @@ def to_dict(self) -> dict[str, Any]: else: property_field_values = self.property_field_values - alert_urgency_ids: list[str] | None | Unset + alert_urgency_ids: Union[None, Unset, list[str]] if isinstance(self.alert_urgency_ids, Unset): alert_urgency_ids = UNSET elif isinstance(self.alert_urgency_ids, list): @@ -85,11 +84,11 @@ def to_dict(self) -> dict[str, Any]: else: alert_urgency_ids = self.alert_urgency_ids - conditionable_type: str | Unset = UNSET + conditionable_type: Union[Unset, str] = UNSET if not isinstance(self.conditionable_type, Unset): conditionable_type = self.conditionable_type - conditionable_id: None | str | Unset + conditionable_id: Union[None, Unset, str] if isinstance(self.conditionable_id, Unset): conditionable_id = UNSET elif isinstance(self.conditionable_id, UUID): @@ -133,16 +132,16 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: property_field_name = d.pop("property_field_name", UNSET) - def _parse_property_field_value(data: object) -> None | str | Unset: + def _parse_property_field_value(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) property_field_value = _parse_property_field_value(d.pop("property_field_value", UNSET)) - def _parse_property_field_values(data: object) -> list[str] | None | Unset: + def _parse_property_field_values(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -153,13 +152,13 @@ def _parse_property_field_values(data: object) -> list[str] | None | Unset: property_field_values_type_0 = cast(list[str], data) return property_field_values_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) property_field_values = _parse_property_field_values(d.pop("property_field_values", UNSET)) - def _parse_alert_urgency_ids(data: object) -> list[str] | None | Unset: + def _parse_alert_urgency_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -170,16 +169,16 @@ def _parse_alert_urgency_ids(data: object) -> list[str] | None | Unset: alert_urgency_ids_type_0 = cast(list[str], data) return alert_urgency_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) alert_urgency_ids = _parse_alert_urgency_ids(d.pop("alert_urgency_ids", UNSET)) _conditionable_type = d.pop("conditionable_type", UNSET) - conditionable_type: ( - UpdateAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemConditionableType | Unset - ) + conditionable_type: Union[ + Unset, UpdateAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemConditionableType + ] if isinstance(_conditionable_type, Unset): conditionable_type = UNSET else: @@ -187,7 +186,7 @@ def _parse_alert_urgency_ids(data: object) -> list[str] | None | Unset: _conditionable_type ) - def _parse_conditionable_id(data: object) -> None | Unset | UUID: + def _parse_conditionable_id(data: object) -> Union[None, UUID, Unset]: if data is None: return data if isinstance(data, Unset): @@ -198,9 +197,9 @@ def _parse_conditionable_id(data: object) -> None | Unset | UUID: conditionable_id_type_0 = UUID(data) return conditionable_id_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(None | Unset | UUID, data) + return cast(Union[None, UUID, Unset], data) conditionable_id = _parse_conditionable_id(d.pop("conditionable_id", UNSET)) diff --git a/rootly_sdk/models/update_alert_route_data_attributes_rules_item_destinations_item.py b/rootly_sdk/models/update_alert_route_data_attributes_rules_item_destinations_item.py index 3e112e79..c14eb5d0 100644 --- a/rootly_sdk/models/update_alert_route_data_attributes_rules_item_destinations_item.py +++ b/rootly_sdk/models/update_alert_route_data_attributes_rules_item_destinations_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar from uuid import UUID diff --git a/rootly_sdk/models/update_alert_routing_rule.py b/rootly_sdk/models/update_alert_routing_rule.py index 9025c22f..ab1de97b 100644 --- a/rootly_sdk/models/update_alert_routing_rule.py +++ b/rootly_sdk/models/update_alert_routing_rule.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateAlertRoutingRule: data (UpdateAlertRoutingRuleData): """ - data: UpdateAlertRoutingRuleData + data: "UpdateAlertRoutingRuleData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_alert_routing_rule_data.py b/rootly_sdk/models/update_alert_routing_rule_data.py index 8b939ad3..e4aafaf3 100644 --- a/rootly_sdk/models/update_alert_routing_rule_data.py +++ b/rootly_sdk/models/update_alert_routing_rule_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class UpdateAlertRoutingRuleData: """ type_: UpdateAlertRoutingRuleDataType - attributes: UpdateAlertRoutingRuleDataAttributes + attributes: "UpdateAlertRoutingRuleDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_alert_routing_rule_data_attributes.py b/rootly_sdk/models/update_alert_routing_rule_data_attributes.py index f055cba6..c77e21c2 100644 --- a/rootly_sdk/models/update_alert_routing_rule_data_attributes.py +++ b/rootly_sdk/models/update_alert_routing_rule_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from uuid import UUID from attrs import define as _attrs_define @@ -28,57 +26,56 @@ class UpdateAlertRoutingRuleDataAttributes: """ Attributes: - name (str | Unset): The name of the alert routing rule - enabled (bool | Unset): Whether the alert routing rule is enabled - alerts_source_id (UUID | Unset): The ID of the alerts source - position (int | Unset): The position of the alert routing rule for ordering evaluation - owning_team_ids (list[UUID] | Unset): The IDs of the teams that own the alert routing rule - condition_type (UpdateAlertRoutingRuleDataAttributesConditionType | Unset): The type of condition for the alert - routing rule - conditions (list[UpdateAlertRoutingRuleDataAttributesConditionsItem] | Unset): - destination (UpdateAlertRoutingRuleDataAttributesDestination | Unset): + name (Union[Unset, str]): The name of the alert routing rule + enabled (Union[Unset, bool]): Whether the alert routing rule is enabled + alerts_source_id (Union[Unset, UUID]): The ID of the alerts source + position (Union[Unset, int]): The position of the alert routing rule for ordering evaluation + owning_team_ids (Union[Unset, list[UUID]]): The IDs of the teams that own the alert routing rule + condition_type (Union[Unset, UpdateAlertRoutingRuleDataAttributesConditionType]): The type of condition for the + alert routing rule + conditions (Union[Unset, list['UpdateAlertRoutingRuleDataAttributesConditionsItem']]): + destination (Union[Unset, UpdateAlertRoutingRuleDataAttributesDestination]): """ - name: str | Unset = UNSET - enabled: bool | Unset = UNSET - alerts_source_id: UUID | Unset = UNSET - position: int | Unset = UNSET - owning_team_ids: list[UUID] | Unset = UNSET - condition_type: UpdateAlertRoutingRuleDataAttributesConditionType | Unset = UNSET - conditions: list[UpdateAlertRoutingRuleDataAttributesConditionsItem] | Unset = UNSET - destination: UpdateAlertRoutingRuleDataAttributesDestination | Unset = UNSET + name: Union[Unset, str] = UNSET + enabled: Union[Unset, bool] = UNSET + alerts_source_id: Union[Unset, UUID] = UNSET + position: Union[Unset, int] = UNSET + owning_team_ids: Union[Unset, list[UUID]] = UNSET + condition_type: Union[Unset, UpdateAlertRoutingRuleDataAttributesConditionType] = UNSET + conditions: Union[Unset, list["UpdateAlertRoutingRuleDataAttributesConditionsItem"]] = UNSET + destination: Union[Unset, "UpdateAlertRoutingRuleDataAttributesDestination"] = UNSET def to_dict(self) -> dict[str, Any]: - name = self.name enabled = self.enabled - alerts_source_id: str | Unset = UNSET + alerts_source_id: Union[Unset, str] = UNSET if not isinstance(self.alerts_source_id, Unset): alerts_source_id = str(self.alerts_source_id) position = self.position - owning_team_ids: list[str] | Unset = UNSET + owning_team_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.owning_team_ids, Unset): owning_team_ids = [] for owning_team_ids_item_data in self.owning_team_ids: owning_team_ids_item = str(owning_team_ids_item_data) owning_team_ids.append(owning_team_ids_item) - condition_type: str | Unset = UNSET + condition_type: Union[Unset, str] = UNSET if not isinstance(self.condition_type, Unset): condition_type = self.condition_type - conditions: list[dict[str, Any]] | Unset = UNSET + conditions: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.conditions, Unset): conditions = [] for conditions_item_data in self.conditions: conditions_item = conditions_item_data.to_dict() conditions.append(conditions_item) - destination: dict[str, Any] | Unset = UNSET + destination: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.destination, Unset): destination = self.destination.to_dict() @@ -119,7 +116,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: enabled = d.pop("enabled", UNSET) _alerts_source_id = d.pop("alerts_source_id", UNSET) - alerts_source_id: UUID | Unset + alerts_source_id: Union[Unset, UUID] if isinstance(_alerts_source_id, Unset): alerts_source_id = UNSET else: @@ -127,33 +124,29 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: position = d.pop("position", UNSET) + owning_team_ids = [] _owning_team_ids = d.pop("owning_team_ids", UNSET) - owning_team_ids: list[UUID] | Unset = UNSET - if _owning_team_ids is not UNSET: - owning_team_ids = [] - for owning_team_ids_item_data in _owning_team_ids: - owning_team_ids_item = UUID(owning_team_ids_item_data) + for owning_team_ids_item_data in _owning_team_ids or []: + owning_team_ids_item = UUID(owning_team_ids_item_data) - owning_team_ids.append(owning_team_ids_item) + owning_team_ids.append(owning_team_ids_item) _condition_type = d.pop("condition_type", UNSET) - condition_type: UpdateAlertRoutingRuleDataAttributesConditionType | Unset + condition_type: Union[Unset, UpdateAlertRoutingRuleDataAttributesConditionType] if isinstance(_condition_type, Unset): condition_type = UNSET else: condition_type = check_update_alert_routing_rule_data_attributes_condition_type(_condition_type) + conditions = [] _conditions = d.pop("conditions", UNSET) - conditions: list[UpdateAlertRoutingRuleDataAttributesConditionsItem] | Unset = UNSET - if _conditions is not UNSET: - conditions = [] - for conditions_item_data in _conditions: - conditions_item = UpdateAlertRoutingRuleDataAttributesConditionsItem.from_dict(conditions_item_data) + for conditions_item_data in _conditions or []: + conditions_item = UpdateAlertRoutingRuleDataAttributesConditionsItem.from_dict(conditions_item_data) - conditions.append(conditions_item) + conditions.append(conditions_item) _destination = d.pop("destination", UNSET) - destination: UpdateAlertRoutingRuleDataAttributesDestination | Unset + destination: Union[Unset, UpdateAlertRoutingRuleDataAttributesDestination] if isinstance(_destination, Unset): destination = UNSET else: diff --git a/rootly_sdk/models/update_alert_routing_rule_data_attributes_conditions_item.py b/rootly_sdk/models/update_alert_routing_rule_data_attributes_conditions_item.py index 307d337f..0c0e3001 100644 --- a/rootly_sdk/models/update_alert_routing_rule_data_attributes_conditions_item.py +++ b/rootly_sdk/models/update_alert_routing_rule_data_attributes_conditions_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from uuid import UUID from attrs import define as _attrs_define @@ -24,53 +22,54 @@ class UpdateAlertRoutingRuleDataAttributesConditionsItem: """ Attributes: - id (UUID | Unset): The ID of the alert routing rule condition - property_field_type (UpdateAlertRoutingRuleDataAttributesConditionsItemPropertyFieldType | Unset): The type of - the property field - property_field_name (str | Unset): The name of the property field. If the property field type is selected as - 'attribute', then the allowed property field names are 'summary' (for Title), 'description', 'alert_urgency' and - 'external_url' (for Alert Source URL). If the property field type is selected as 'payload', then the property - field name should be supplied in JSON Path syntax. - property_field_condition_type (UpdateAlertRoutingRuleDataAttributesConditionsItemPropertyFieldConditionType | - Unset): The condition type of the property field - property_field_value (None | str | Unset): The value of the property field. Can be null if the property field - condition type is 'is_one_of' or 'is_not_one_of' - property_field_values (list[str] | Unset): The values of the property field. Used if the property field + id (Union[Unset, UUID]): The ID of the alert routing rule condition + property_field_type (Union[Unset, UpdateAlertRoutingRuleDataAttributesConditionsItemPropertyFieldType]): The + type of the property field + property_field_name (Union[Unset, str]): The name of the property field. If the property field type is selected + as 'attribute', then the allowed property field names are 'summary' (for Title), 'description', 'alert_urgency' + and 'external_url' (for Alert Source URL). If the property field type is selected as 'payload', then the + property field name should be supplied in JSON Path syntax. + property_field_condition_type (Union[Unset, + UpdateAlertRoutingRuleDataAttributesConditionsItemPropertyFieldConditionType]): The condition type of the + property field + property_field_value (Union[None, Unset, str]): The value of the property field. Can be null if the property + field condition type is 'is_one_of' or 'is_not_one_of' + property_field_values (Union[Unset, list[str]]): The values of the property field. Used if the property field condition type is 'is_one_of' or 'is_not_one_of' except for when property field name is 'alert_urgency' """ - id: UUID | Unset = UNSET - property_field_type: UpdateAlertRoutingRuleDataAttributesConditionsItemPropertyFieldType | Unset = UNSET - property_field_name: str | Unset = UNSET - property_field_condition_type: ( - UpdateAlertRoutingRuleDataAttributesConditionsItemPropertyFieldConditionType | Unset - ) = UNSET - property_field_value: None | str | Unset = UNSET - property_field_values: list[str] | Unset = UNSET + id: Union[Unset, UUID] = UNSET + property_field_type: Union[Unset, UpdateAlertRoutingRuleDataAttributesConditionsItemPropertyFieldType] = UNSET + property_field_name: Union[Unset, str] = UNSET + property_field_condition_type: Union[ + Unset, UpdateAlertRoutingRuleDataAttributesConditionsItemPropertyFieldConditionType + ] = UNSET + property_field_value: Union[None, Unset, str] = UNSET + property_field_values: Union[Unset, list[str]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id: str | Unset = UNSET + id: Union[Unset, str] = UNSET if not isinstance(self.id, Unset): id = str(self.id) - property_field_type: str | Unset = UNSET + property_field_type: Union[Unset, str] = UNSET if not isinstance(self.property_field_type, Unset): property_field_type = self.property_field_type property_field_name = self.property_field_name - property_field_condition_type: str | Unset = UNSET + property_field_condition_type: Union[Unset, str] = UNSET if not isinstance(self.property_field_condition_type, Unset): property_field_condition_type = self.property_field_condition_type - property_field_value: None | str | Unset + property_field_value: Union[None, Unset, str] if isinstance(self.property_field_value, Unset): property_field_value = UNSET else: property_field_value = self.property_field_value - property_field_values: list[str] | Unset = UNSET + property_field_values: Union[Unset, list[str]] = UNSET if not isinstance(self.property_field_values, Unset): property_field_values = self.property_field_values @@ -96,14 +95,14 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _id = d.pop("id", UNSET) - id: UUID | Unset + id: Union[Unset, UUID] if isinstance(_id, Unset): id = UNSET else: id = UUID(_id) _property_field_type = d.pop("property_field_type", UNSET) - property_field_type: UpdateAlertRoutingRuleDataAttributesConditionsItemPropertyFieldType | Unset + property_field_type: Union[Unset, UpdateAlertRoutingRuleDataAttributesConditionsItemPropertyFieldType] if isinstance(_property_field_type, Unset): property_field_type = UNSET else: @@ -114,9 +113,9 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: property_field_name = d.pop("property_field_name", UNSET) _property_field_condition_type = d.pop("property_field_condition_type", UNSET) - property_field_condition_type: ( - UpdateAlertRoutingRuleDataAttributesConditionsItemPropertyFieldConditionType | Unset - ) + property_field_condition_type: Union[ + Unset, UpdateAlertRoutingRuleDataAttributesConditionsItemPropertyFieldConditionType + ] if isinstance(_property_field_condition_type, Unset): property_field_condition_type = UNSET else: @@ -126,12 +125,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: ) ) - def _parse_property_field_value(data: object) -> None | str | Unset: + def _parse_property_field_value(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) property_field_value = _parse_property_field_value(d.pop("property_field_value", UNSET)) diff --git a/rootly_sdk/models/update_alert_routing_rule_data_attributes_destination.py b/rootly_sdk/models/update_alert_routing_rule_data_attributes_destination.py index 4354e978..d9e2a74b 100644 --- a/rootly_sdk/models/update_alert_routing_rule_data_attributes_destination.py +++ b/rootly_sdk/models/update_alert_routing_rule_data_attributes_destination.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from uuid import UUID from attrs import define as _attrs_define @@ -20,21 +18,21 @@ class UpdateAlertRoutingRuleDataAttributesDestination: """ Attributes: - target_type (UpdateAlertRoutingRuleDataAttributesDestinationTargetType | Unset): The type of the target. Please - contact support if you encounter issues using `Functionality` as a target type. - target_id (UUID | Unset): The ID of the target + target_type (Union[Unset, UpdateAlertRoutingRuleDataAttributesDestinationTargetType]): The type of the target. + Please contact support if you encounter issues using `Functionality` as a target type. + target_id (Union[Unset, UUID]): The ID of the target """ - target_type: UpdateAlertRoutingRuleDataAttributesDestinationTargetType | Unset = UNSET - target_id: UUID | Unset = UNSET + target_type: Union[Unset, UpdateAlertRoutingRuleDataAttributesDestinationTargetType] = UNSET + target_id: Union[Unset, UUID] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - target_type: str | Unset = UNSET + target_type: Union[Unset, str] = UNSET if not isinstance(self.target_type, Unset): target_type = self.target_type - target_id: str | Unset = UNSET + target_id: Union[Unset, str] = UNSET if not isinstance(self.target_id, Unset): target_id = str(self.target_id) @@ -52,14 +50,14 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _target_type = d.pop("target_type", UNSET) - target_type: UpdateAlertRoutingRuleDataAttributesDestinationTargetType | Unset + target_type: Union[Unset, UpdateAlertRoutingRuleDataAttributesDestinationTargetType] if isinstance(_target_type, Unset): target_type = UNSET else: target_type = check_update_alert_routing_rule_data_attributes_destination_target_type(_target_type) _target_id = d.pop("target_id", UNSET) - target_id: UUID | Unset + target_id: Union[Unset, UUID] if isinstance(_target_id, Unset): target_id = UNSET else: diff --git a/rootly_sdk/models/update_alert_urgency.py b/rootly_sdk/models/update_alert_urgency.py index 61a7770d..4ab66a74 100644 --- a/rootly_sdk/models/update_alert_urgency.py +++ b/rootly_sdk/models/update_alert_urgency.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateAlertUrgency: data (UpdateAlertUrgencyData): """ - data: UpdateAlertUrgencyData + data: "UpdateAlertUrgencyData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_alert_urgency_data.py b/rootly_sdk/models/update_alert_urgency_data.py index 73a3352e..0e1ffff3 100644 --- a/rootly_sdk/models/update_alert_urgency_data.py +++ b/rootly_sdk/models/update_alert_urgency_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class UpdateAlertUrgencyData: """ type_: UpdateAlertUrgencyDataType - attributes: UpdateAlertUrgencyDataAttributes + attributes: "UpdateAlertUrgencyDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_alert_urgency_data_attributes.py b/rootly_sdk/models/update_alert_urgency_data_attributes.py index 0099ccef..1424511a 100644 --- a/rootly_sdk/models/update_alert_urgency_data_attributes.py +++ b/rootly_sdk/models/update_alert_urgency_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -14,26 +12,35 @@ class UpdateAlertUrgencyDataAttributes: """ Attributes: - name (str | Unset): The name of the alert urgency - description (str | Unset): The description of the alert urgency - position (int | None | Unset): Position of the alert urgency + name (Union[Unset, str]): The name of the alert urgency + description (Union[Unset, str]): The description of the alert urgency + position (Union[None, Unset, int]): Position of the alert urgency + retrigger_timeout_minutes (Union[None, Unset, int]): Re-trigger acknowledged alerts of this urgency after N + minutes; null inherits the workspace default, negative = never. """ - name: str | Unset = UNSET - description: str | Unset = UNSET - position: int | None | Unset = UNSET + name: Union[Unset, str] = UNSET + description: Union[Unset, str] = UNSET + position: Union[None, Unset, int] = UNSET + retrigger_timeout_minutes: Union[None, Unset, int] = UNSET def to_dict(self) -> dict[str, Any]: name = self.name description = self.description - position: int | None | Unset + position: Union[None, Unset, int] if isinstance(self.position, Unset): position = UNSET else: position = self.position + retrigger_timeout_minutes: Union[None, Unset, int] + if isinstance(self.retrigger_timeout_minutes, Unset): + retrigger_timeout_minutes = UNSET + else: + retrigger_timeout_minutes = self.retrigger_timeout_minutes + field_dict: dict[str, Any] = {} field_dict.update({}) @@ -43,6 +50,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["description"] = description if position is not UNSET: field_dict["position"] = position + if retrigger_timeout_minutes is not UNSET: + field_dict["retrigger_timeout_minutes"] = retrigger_timeout_minutes return field_dict @@ -53,19 +62,29 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: description = d.pop("description", UNSET) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> Union[None, Unset, int]: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(Union[None, Unset, int], data) position = _parse_position(d.pop("position", UNSET)) + def _parse_retrigger_timeout_minutes(data: object) -> Union[None, Unset, int]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, int], data) + + retrigger_timeout_minutes = _parse_retrigger_timeout_minutes(d.pop("retrigger_timeout_minutes", UNSET)) + update_alert_urgency_data_attributes = cls( name=name, description=description, position=position, + retrigger_timeout_minutes=retrigger_timeout_minutes, ) return update_alert_urgency_data_attributes diff --git a/rootly_sdk/models/update_alerts_source.py b/rootly_sdk/models/update_alerts_source.py index 92d0852d..2c27342d 100644 --- a/rootly_sdk/models/update_alerts_source.py +++ b/rootly_sdk/models/update_alerts_source.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateAlertsSource: data (UpdateAlertsSourceData): """ - data: UpdateAlertsSourceData + data: "UpdateAlertsSourceData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_alerts_source_data.py b/rootly_sdk/models/update_alerts_source_data.py index cdc6c508..c7409215 100644 --- a/rootly_sdk/models/update_alerts_source_data.py +++ b/rootly_sdk/models/update_alerts_source_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class UpdateAlertsSourceData: """ type_: UpdateAlertsSourceDataType - attributes: UpdateAlertsSourceDataAttributes + attributes: "UpdateAlertsSourceDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_alerts_source_data_attributes.py b/rootly_sdk/models/update_alerts_source_data_attributes.py index 9d4512ab..3d057466 100644 --- a/rootly_sdk/models/update_alerts_source_data_attributes.py +++ b/rootly_sdk/models/update_alerts_source_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -40,50 +38,57 @@ class UpdateAlertsSourceDataAttributes: """ Attributes: - name (str | Unset): The name of the alert source - enabled (bool | Unset): Whether the alert source is enabled. Disabled sources do not create alerts from incoming - events. - source_type (UpdateAlertsSourceDataAttributesSourceType | Unset): The alert source type - alert_urgency_id (str | Unset): ID for the default alert urgency assigned to this alert source - deduplicate_alerts_by_key (bool | Unset): Toggle alert deduplication using deduplication key. If enabled, + name (Union[Unset, str]): The name of the alert source + enabled (Union[Unset, bool]): Whether the alert source is enabled. Disabled sources do not create alerts from + incoming events. + source_type (Union[Unset, UpdateAlertsSourceDataAttributesSourceType]): The alert source type + alert_urgency_id (Union[Unset, str]): ID for the default alert urgency assigned to this alert source + deduplicate_alerts_by_key (Union[Unset, bool]): Toggle alert deduplication using deduplication key. If enabled, deduplication_key_kind and deduplication_key_path are required. - deduplication_key_kind (UpdateAlertsSourceDataAttributesDeduplicationKeyKind | Unset): Kind of deduplication - key. - deduplication_key_path (None | str | Unset): Path to deduplication key. This is a JSON Path to extract the + deduplication_key_kind (Union[Unset, UpdateAlertsSourceDataAttributesDeduplicationKeyKind]): Kind of + deduplication key. + deduplication_key_path (Union[None, Unset, str]): Path to deduplication key. This is a JSON Path to extract the deduplication key from the request body. - deduplication_key_regexp (None | str | Unset): Regular expression to extract key from value found at key path. - owner_group_ids (list[str] | Unset): List of team IDs that will own the alert source - alert_template_attributes (None | Unset | UpdateAlertsSourceDataAttributesAlertTemplateAttributesType0): - alert_source_urgency_rules_attributes - (list[UpdateAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItem] | Unset): List of rules that define - the conditions under which the alert urgency will be set automatically based on the alert payload - sourceable_attributes (None | Unset | UpdateAlertsSourceDataAttributesSourceableAttributesType0): Provide - additional attributes for generic_webhook alerts source - resolution_rule_attributes (None | Unset | UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0): - Provide additional attributes for email alerts source - alert_source_fields_attributes (list[UpdateAlertsSourceDataAttributesAlertSourceFieldsAttributesItem] | Unset): - List of alert fields to be added to the alert source. Note: This attribute requires the alert field feature to - be enabled on your account. Contact Rootly customer support if you need assistance with this feature. + deduplication_key_regexp (Union[None, Unset, str]): Regular expression to extract key from value found at key + path. + owner_group_ids (Union[Unset, list[str]]): List of team IDs that will own the alert source + alert_template_attributes (Union['UpdateAlertsSourceDataAttributesAlertTemplateAttributesType0', None, Unset]): + alert_source_urgency_rules_attributes (Union[Unset, + list['UpdateAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItem']]): List of rules that define the + conditions under which the alert urgency will be set automatically based on the alert payload + sourceable_attributes (Union['UpdateAlertsSourceDataAttributesSourceableAttributesType0', None, Unset]): Provide + additional attributes for the underlying source. `auto_resolve`, `resolve_state` and `field_mappings_attributes` + apply to generic_webhook sources; `accept_threaded_emails` applies to email sources. + resolution_rule_attributes (Union['UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0', None, + Unset]): Provide additional attributes for email alerts source + alert_source_fields_attributes (Union[Unset, + list['UpdateAlertsSourceDataAttributesAlertSourceFieldsAttributesItem']]): List of alert fields to be added to + the alert source. Note: This attribute requires the alert field feature to be enabled on your account. Contact + Rootly customer support if you need assistance with this feature. """ - name: str | Unset = UNSET - enabled: bool | Unset = UNSET - source_type: UpdateAlertsSourceDataAttributesSourceType | Unset = UNSET - alert_urgency_id: str | Unset = UNSET - deduplicate_alerts_by_key: bool | Unset = UNSET - deduplication_key_kind: UpdateAlertsSourceDataAttributesDeduplicationKeyKind | Unset = UNSET - deduplication_key_path: None | str | Unset = UNSET - deduplication_key_regexp: None | str | Unset = UNSET - owner_group_ids: list[str] | Unset = UNSET - alert_template_attributes: None | Unset | UpdateAlertsSourceDataAttributesAlertTemplateAttributesType0 = UNSET - alert_source_urgency_rules_attributes: ( - list[UpdateAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItem] | Unset - ) = UNSET - sourceable_attributes: None | Unset | UpdateAlertsSourceDataAttributesSourceableAttributesType0 = UNSET - resolution_rule_attributes: None | Unset | UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0 = UNSET - alert_source_fields_attributes: list[UpdateAlertsSourceDataAttributesAlertSourceFieldsAttributesItem] | Unset = ( + name: Union[Unset, str] = UNSET + enabled: Union[Unset, bool] = UNSET + source_type: Union[Unset, UpdateAlertsSourceDataAttributesSourceType] = UNSET + alert_urgency_id: Union[Unset, str] = UNSET + deduplicate_alerts_by_key: Union[Unset, bool] = UNSET + deduplication_key_kind: Union[Unset, UpdateAlertsSourceDataAttributesDeduplicationKeyKind] = UNSET + deduplication_key_path: Union[None, Unset, str] = UNSET + deduplication_key_regexp: Union[None, Unset, str] = UNSET + owner_group_ids: Union[Unset, list[str]] = UNSET + alert_template_attributes: Union["UpdateAlertsSourceDataAttributesAlertTemplateAttributesType0", None, Unset] = ( + UNSET + ) + alert_source_urgency_rules_attributes: Union[ + Unset, list["UpdateAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItem"] + ] = UNSET + sourceable_attributes: Union["UpdateAlertsSourceDataAttributesSourceableAttributesType0", None, Unset] = UNSET + resolution_rule_attributes: Union["UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0", None, Unset] = ( UNSET ) + alert_source_fields_attributes: Union[ + Unset, list["UpdateAlertsSourceDataAttributesAlertSourceFieldsAttributesItem"] + ] = UNSET def to_dict(self) -> dict[str, Any]: from ..models.update_alerts_source_data_attributes_alert_template_attributes_type_0 import ( @@ -100,7 +105,7 @@ def to_dict(self) -> dict[str, Any]: enabled = self.enabled - source_type: str | Unset = UNSET + source_type: Union[Unset, str] = UNSET if not isinstance(self.source_type, Unset): source_type = self.source_type @@ -108,27 +113,27 @@ def to_dict(self) -> dict[str, Any]: deduplicate_alerts_by_key = self.deduplicate_alerts_by_key - deduplication_key_kind: str | Unset = UNSET + deduplication_key_kind: Union[Unset, str] = UNSET if not isinstance(self.deduplication_key_kind, Unset): deduplication_key_kind = self.deduplication_key_kind - deduplication_key_path: None | str | Unset + deduplication_key_path: Union[None, Unset, str] if isinstance(self.deduplication_key_path, Unset): deduplication_key_path = UNSET else: deduplication_key_path = self.deduplication_key_path - deduplication_key_regexp: None | str | Unset + deduplication_key_regexp: Union[None, Unset, str] if isinstance(self.deduplication_key_regexp, Unset): deduplication_key_regexp = UNSET else: deduplication_key_regexp = self.deduplication_key_regexp - owner_group_ids: list[str] | Unset = UNSET + owner_group_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.owner_group_ids, Unset): owner_group_ids = self.owner_group_ids - alert_template_attributes: dict[str, Any] | None | Unset + alert_template_attributes: Union[None, Unset, dict[str, Any]] if isinstance(self.alert_template_attributes, Unset): alert_template_attributes = UNSET elif isinstance(self.alert_template_attributes, UpdateAlertsSourceDataAttributesAlertTemplateAttributesType0): @@ -136,14 +141,14 @@ def to_dict(self) -> dict[str, Any]: else: alert_template_attributes = self.alert_template_attributes - alert_source_urgency_rules_attributes: list[dict[str, Any]] | Unset = UNSET + alert_source_urgency_rules_attributes: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.alert_source_urgency_rules_attributes, Unset): alert_source_urgency_rules_attributes = [] for alert_source_urgency_rules_attributes_item_data in self.alert_source_urgency_rules_attributes: alert_source_urgency_rules_attributes_item = alert_source_urgency_rules_attributes_item_data.to_dict() alert_source_urgency_rules_attributes.append(alert_source_urgency_rules_attributes_item) - sourceable_attributes: dict[str, Any] | None | Unset + sourceable_attributes: Union[None, Unset, dict[str, Any]] if isinstance(self.sourceable_attributes, Unset): sourceable_attributes = UNSET elif isinstance(self.sourceable_attributes, UpdateAlertsSourceDataAttributesSourceableAttributesType0): @@ -151,7 +156,7 @@ def to_dict(self) -> dict[str, Any]: else: sourceable_attributes = self.sourceable_attributes - resolution_rule_attributes: dict[str, Any] | None | Unset + resolution_rule_attributes: Union[None, Unset, dict[str, Any]] if isinstance(self.resolution_rule_attributes, Unset): resolution_rule_attributes = UNSET elif isinstance(self.resolution_rule_attributes, UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0): @@ -159,7 +164,7 @@ def to_dict(self) -> dict[str, Any]: else: resolution_rule_attributes = self.resolution_rule_attributes - alert_source_fields_attributes: list[dict[str, Any]] | Unset = UNSET + alert_source_fields_attributes: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.alert_source_fields_attributes, Unset): alert_source_fields_attributes = [] for alert_source_fields_attributes_item_data in self.alert_source_fields_attributes: @@ -224,7 +229,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: enabled = d.pop("enabled", UNSET) _source_type = d.pop("source_type", UNSET) - source_type: UpdateAlertsSourceDataAttributesSourceType | Unset + source_type: Union[Unset, UpdateAlertsSourceDataAttributesSourceType] if isinstance(_source_type, Unset): source_type = UNSET else: @@ -235,7 +240,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: deduplicate_alerts_by_key = d.pop("deduplicate_alerts_by_key", UNSET) _deduplication_key_kind = d.pop("deduplication_key_kind", UNSET) - deduplication_key_kind: UpdateAlertsSourceDataAttributesDeduplicationKeyKind | Unset + deduplication_key_kind: Union[Unset, UpdateAlertsSourceDataAttributesDeduplicationKeyKind] if isinstance(_deduplication_key_kind, Unset): deduplication_key_kind = UNSET else: @@ -243,21 +248,21 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: _deduplication_key_kind ) - def _parse_deduplication_key_path(data: object) -> None | str | Unset: + def _parse_deduplication_key_path(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) deduplication_key_path = _parse_deduplication_key_path(d.pop("deduplication_key_path", UNSET)) - def _parse_deduplication_key_regexp(data: object) -> None | str | Unset: + def _parse_deduplication_key_regexp(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) deduplication_key_regexp = _parse_deduplication_key_regexp(d.pop("deduplication_key_regexp", UNSET)) @@ -265,7 +270,7 @@ def _parse_deduplication_key_regexp(data: object) -> None | str | Unset: def _parse_alert_template_attributes( data: object, - ) -> None | Unset | UpdateAlertsSourceDataAttributesAlertTemplateAttributesType0: + ) -> Union["UpdateAlertsSourceDataAttributesAlertTemplateAttributesType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -278,30 +283,26 @@ def _parse_alert_template_attributes( ) return alert_template_attributes_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(None | Unset | UpdateAlertsSourceDataAttributesAlertTemplateAttributesType0, data) + return cast(Union["UpdateAlertsSourceDataAttributesAlertTemplateAttributesType0", None, Unset], data) alert_template_attributes = _parse_alert_template_attributes(d.pop("alert_template_attributes", UNSET)) + alert_source_urgency_rules_attributes = [] _alert_source_urgency_rules_attributes = d.pop("alert_source_urgency_rules_attributes", UNSET) - alert_source_urgency_rules_attributes: ( - list[UpdateAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItem] | Unset - ) = UNSET - if _alert_source_urgency_rules_attributes is not UNSET: - alert_source_urgency_rules_attributes = [] - for alert_source_urgency_rules_attributes_item_data in _alert_source_urgency_rules_attributes: - alert_source_urgency_rules_attributes_item = ( - UpdateAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItem.from_dict( - alert_source_urgency_rules_attributes_item_data - ) + for alert_source_urgency_rules_attributes_item_data in _alert_source_urgency_rules_attributes or []: + alert_source_urgency_rules_attributes_item = ( + UpdateAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItem.from_dict( + alert_source_urgency_rules_attributes_item_data ) + ) - alert_source_urgency_rules_attributes.append(alert_source_urgency_rules_attributes_item) + alert_source_urgency_rules_attributes.append(alert_source_urgency_rules_attributes_item) def _parse_sourceable_attributes( data: object, - ) -> None | Unset | UpdateAlertsSourceDataAttributesSourceableAttributesType0: + ) -> Union["UpdateAlertsSourceDataAttributesSourceableAttributesType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -312,15 +313,15 @@ def _parse_sourceable_attributes( sourceable_attributes_type_0 = UpdateAlertsSourceDataAttributesSourceableAttributesType0.from_dict(data) return sourceable_attributes_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(None | Unset | UpdateAlertsSourceDataAttributesSourceableAttributesType0, data) + return cast(Union["UpdateAlertsSourceDataAttributesSourceableAttributesType0", None, Unset], data) sourceable_attributes = _parse_sourceable_attributes(d.pop("sourceable_attributes", UNSET)) def _parse_resolution_rule_attributes( data: object, - ) -> None | Unset | UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0: + ) -> Union["UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -333,26 +334,22 @@ def _parse_resolution_rule_attributes( ) return resolution_rule_attributes_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(None | Unset | UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0, data) + return cast(Union["UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0", None, Unset], data) resolution_rule_attributes = _parse_resolution_rule_attributes(d.pop("resolution_rule_attributes", UNSET)) + alert_source_fields_attributes = [] _alert_source_fields_attributes = d.pop("alert_source_fields_attributes", UNSET) - alert_source_fields_attributes: ( - list[UpdateAlertsSourceDataAttributesAlertSourceFieldsAttributesItem] | Unset - ) = UNSET - if _alert_source_fields_attributes is not UNSET: - alert_source_fields_attributes = [] - for alert_source_fields_attributes_item_data in _alert_source_fields_attributes: - alert_source_fields_attributes_item = ( - UpdateAlertsSourceDataAttributesAlertSourceFieldsAttributesItem.from_dict( - alert_source_fields_attributes_item_data - ) + for alert_source_fields_attributes_item_data in _alert_source_fields_attributes or []: + alert_source_fields_attributes_item = ( + UpdateAlertsSourceDataAttributesAlertSourceFieldsAttributesItem.from_dict( + alert_source_fields_attributes_item_data ) + ) - alert_source_fields_attributes.append(alert_source_fields_attributes_item) + alert_source_fields_attributes.append(alert_source_fields_attributes_item) update_alerts_source_data_attributes = cls( name=name, diff --git a/rootly_sdk/models/update_alerts_source_data_attributes_alert_source_fields_attributes_item.py b/rootly_sdk/models/update_alerts_source_data_attributes_alert_source_fields_attributes_item.py index e08e80c0..a1bd277d 100644 --- a/rootly_sdk/models/update_alerts_source_data_attributes_alert_source_fields_attributes_item.py +++ b/rootly_sdk/models/update_alerts_source_data_attributes_alert_source_fields_attributes_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,19 +13,19 @@ class UpdateAlertsSourceDataAttributesAlertSourceFieldsAttributesItem: """ Attributes: - alert_field_id (str | Unset): The ID of the alert field - template_body (None | str | Unset): Liquid expression to extract a specific value from the alert's payload for - evaluation + alert_field_id (Union[Unset, str]): The ID of the alert field + template_body (Union[None, Unset, str]): Liquid expression to extract a specific value from the alert's payload + for evaluation """ - alert_field_id: str | Unset = UNSET - template_body: None | str | Unset = UNSET + alert_field_id: Union[Unset, str] = UNSET + template_body: Union[None, Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: alert_field_id = self.alert_field_id - template_body: None | str | Unset + template_body: Union[None, Unset, str] if isinstance(self.template_body, Unset): template_body = UNSET else: @@ -48,12 +46,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) alert_field_id = d.pop("alert_field_id", UNSET) - def _parse_template_body(data: object) -> None | str | Unset: + def _parse_template_body(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) template_body = _parse_template_body(d.pop("template_body", UNSET)) diff --git a/rootly_sdk/models/update_alerts_source_data_attributes_alert_source_urgency_rules_attributes_item.py b/rootly_sdk/models/update_alerts_source_data_attributes_alert_source_urgency_rules_attributes_item.py index 8dbf2010..f4f49e29 100644 --- a/rootly_sdk/models/update_alerts_source_data_attributes_alert_source_urgency_rules_attributes_item.py +++ b/rootly_sdk/models/update_alerts_source_data_attributes_alert_source_urgency_rules_attributes_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -27,56 +25,57 @@ class UpdateAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItem: """ Attributes: - json_path (None | str | Unset): JSON path expression to extract a specific value from the alert's payload for - evaluation - operator (UpdateAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemOperator | Unset): Comparison - operator used to evaluate the extracted value against the specified condition - value (str | Unset): Value that the extracted payload data is compared to using the specified operator to + json_path (Union[None, Unset, str]): JSON path expression to extract a specific value from the alert's payload + for evaluation + operator (Union[Unset, UpdateAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemOperator]): + Comparison operator used to evaluate the extracted value against the specified condition + value (Union[Unset, str]): Value that the extracted payload data is compared to using the specified operator to determine a match - conditionable_type (UpdateAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemConditionableType | - Unset): The type of the conditionable - conditionable_id (None | str | Unset): The ID of the conditionable. If conditionable_type is AlertField, this is - the ID of the alert field. - kind (UpdateAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemKind | Unset): The kind of the + conditionable_type (Union[Unset, + UpdateAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemConditionableType]): The type of the + conditionable + conditionable_id (Union[None, Unset, str]): The ID of the conditionable. If conditionable_type is AlertField, + this is the ID of the alert field. + kind (Union[Unset, UpdateAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemKind]): The kind of the conditionable - alert_urgency_id (str | Unset): The ID of the alert urgency + alert_urgency_id (Union[Unset, str]): The ID of the alert urgency """ - json_path: None | str | Unset = UNSET - operator: UpdateAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemOperator | Unset = UNSET - value: str | Unset = UNSET - conditionable_type: ( - UpdateAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemConditionableType | Unset - ) = UNSET - conditionable_id: None | str | Unset = UNSET - kind: UpdateAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemKind | Unset = UNSET - alert_urgency_id: str | Unset = UNSET + json_path: Union[None, Unset, str] = UNSET + operator: Union[Unset, UpdateAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemOperator] = UNSET + value: Union[Unset, str] = UNSET + conditionable_type: Union[ + Unset, UpdateAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemConditionableType + ] = UNSET + conditionable_id: Union[None, Unset, str] = UNSET + kind: Union[Unset, UpdateAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemKind] = UNSET + alert_urgency_id: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - json_path: None | str | Unset + json_path: Union[None, Unset, str] if isinstance(self.json_path, Unset): json_path = UNSET else: json_path = self.json_path - operator: str | Unset = UNSET + operator: Union[Unset, str] = UNSET if not isinstance(self.operator, Unset): operator = self.operator value = self.value - conditionable_type: str | Unset = UNSET + conditionable_type: Union[Unset, str] = UNSET if not isinstance(self.conditionable_type, Unset): conditionable_type = self.conditionable_type - conditionable_id: None | str | Unset + conditionable_id: Union[None, Unset, str] if isinstance(self.conditionable_id, Unset): conditionable_id = UNSET else: conditionable_id = self.conditionable_id - kind: str | Unset = UNSET + kind: Union[Unset, str] = UNSET if not isinstance(self.kind, Unset): kind = self.kind @@ -106,17 +105,17 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_json_path(data: object) -> None | str | Unset: + def _parse_json_path(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) json_path = _parse_json_path(d.pop("json_path", UNSET)) _operator = d.pop("operator", UNSET) - operator: UpdateAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemOperator | Unset + operator: Union[Unset, UpdateAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemOperator] if isinstance(_operator, Unset): operator = UNSET else: @@ -127,9 +126,9 @@ def _parse_json_path(data: object) -> None | str | Unset: value = d.pop("value", UNSET) _conditionable_type = d.pop("conditionable_type", UNSET) - conditionable_type: ( - UpdateAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemConditionableType | Unset - ) + conditionable_type: Union[ + Unset, UpdateAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemConditionableType + ] if isinstance(_conditionable_type, Unset): conditionable_type = UNSET else: @@ -137,17 +136,17 @@ def _parse_json_path(data: object) -> None | str | Unset: _conditionable_type ) - def _parse_conditionable_id(data: object) -> None | str | Unset: + def _parse_conditionable_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) conditionable_id = _parse_conditionable_id(d.pop("conditionable_id", UNSET)) _kind = d.pop("kind", UNSET) - kind: UpdateAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemKind | Unset + kind: Union[Unset, UpdateAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemKind] if isinstance(_kind, Unset): kind = UNSET else: diff --git a/rootly_sdk/models/update_alerts_source_data_attributes_alert_template_attributes_type_0.py b/rootly_sdk/models/update_alerts_source_data_attributes_alert_template_attributes_type_0.py index 246b5909..c5c9d6ac 100644 --- a/rootly_sdk/models/update_alerts_source_data_attributes_alert_template_attributes_type_0.py +++ b/rootly_sdk/models/update_alerts_source_data_attributes_alert_template_attributes_type_0.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,30 +13,30 @@ class UpdateAlertsSourceDataAttributesAlertTemplateAttributesType0: """ Attributes: - title (None | str | Unset): The alert title. - description (None | str | Unset): The alert description. - external_url (None | str | Unset): The alert URL. + title (Union[None, Unset, str]): The alert title. + description (Union[None, Unset, str]): The alert description. + external_url (Union[None, Unset, str]): The alert URL. """ - title: None | str | Unset = UNSET - description: None | str | Unset = UNSET - external_url: None | str | Unset = UNSET + title: Union[None, Unset, str] = UNSET + description: Union[None, Unset, str] = UNSET + external_url: Union[None, Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - title: None | str | Unset + title: Union[None, Unset, str] if isinstance(self.title, Unset): title = UNSET else: title = self.title - description: None | str | Unset + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: description = self.description - external_url: None | str | Unset + external_url: Union[None, Unset, str] if isinstance(self.external_url, Unset): external_url = UNSET else: @@ -60,30 +58,30 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_title(data: object) -> None | str | Unset: + def _parse_title(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) title = _parse_title(d.pop("title", UNSET)) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) - def _parse_external_url(data: object) -> None | str | Unset: + def _parse_external_url(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) external_url = _parse_external_url(d.pop("external_url", UNSET)) diff --git a/rootly_sdk/models/update_alerts_source_data_attributes_resolution_rule_attributes_type_0.py b/rootly_sdk/models/update_alerts_source_data_attributes_resolution_rule_attributes_type_0.py index 4a1700e5..7f1b3ae2 100644 --- a/rootly_sdk/models/update_alerts_source_data_attributes_resolution_rule_attributes_type_0.py +++ b/rootly_sdk/models/update_alerts_source_data_attributes_resolution_rule_attributes_type_0.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -34,75 +32,76 @@ class UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0: """Provide additional attributes for email alerts source Attributes: - enabled (bool | Unset): Set this to true to enable the auto resolution rule - condition_type (UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionType | Unset): The type of - condition to evaluate to apply auto resolution rule - identifier_matchable_type (UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0IdentifierMatchableType - | Unset): The type of the identifier matchable - identifier_matchable_id (None | str | Unset): The ID of the identifier matchable. If identifier_matchable_type - is AlertField, this is the ID of the alert field. - identifier_reference_kind (UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0IdentifierReferenceKind - | Unset): The kind of the identifier reference - identifier_json_path (None | str | Unset): JSON path expression to extract unique alert identifier used to match - triggered alerts with resolving alerts - identifier_value_regex (None | str | Unset): Regex group to further specify the part of the string used as a - unique identifier - conditions_attributes - (list[UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItem] | Unset): List of + enabled (Union[Unset, bool]): Set this to true to enable the auto resolution rule + condition_type (Union[Unset, UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionType]): The + type of condition to evaluate to apply auto resolution rule + identifier_matchable_type (Union[Unset, + UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0IdentifierMatchableType]): The type of the + identifier matchable + identifier_matchable_id (Union[None, Unset, str]): The ID of the identifier matchable. If + identifier_matchable_type is AlertField, this is the ID of the alert field. + identifier_reference_kind (Union[Unset, + UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0IdentifierReferenceKind]): The kind of the + identifier reference + identifier_json_path (Union[None, Unset, str]): JSON path expression to extract unique alert identifier used to + match triggered alerts with resolving alerts + identifier_value_regex (Union[None, Unset, str]): Regex group to further specify the part of the string used as + a unique identifier + conditions_attributes (Union[Unset, + list['UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItem']]): List of conditions to evaluate for auto resolution """ - enabled: bool | Unset = UNSET - condition_type: UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionType | Unset = UNSET - identifier_matchable_type: ( - UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0IdentifierMatchableType | Unset - ) = UNSET - identifier_matchable_id: None | str | Unset = UNSET - identifier_reference_kind: ( - UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0IdentifierReferenceKind | Unset - ) = UNSET - identifier_json_path: None | str | Unset = UNSET - identifier_value_regex: None | str | Unset = UNSET - conditions_attributes: ( - list[UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItem] | Unset - ) = UNSET + enabled: Union[Unset, bool] = UNSET + condition_type: Union[Unset, UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionType] = UNSET + identifier_matchable_type: Union[ + Unset, UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0IdentifierMatchableType + ] = UNSET + identifier_matchable_id: Union[None, Unset, str] = UNSET + identifier_reference_kind: Union[ + Unset, UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0IdentifierReferenceKind + ] = UNSET + identifier_json_path: Union[None, Unset, str] = UNSET + identifier_value_regex: Union[None, Unset, str] = UNSET + conditions_attributes: Union[ + Unset, list["UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItem"] + ] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - enabled = self.enabled - condition_type: str | Unset = UNSET + condition_type: Union[Unset, str] = UNSET if not isinstance(self.condition_type, Unset): condition_type = self.condition_type - identifier_matchable_type: str | Unset = UNSET + identifier_matchable_type: Union[Unset, str] = UNSET if not isinstance(self.identifier_matchable_type, Unset): identifier_matchable_type = self.identifier_matchable_type - identifier_matchable_id: None | str | Unset + identifier_matchable_id: Union[None, Unset, str] if isinstance(self.identifier_matchable_id, Unset): identifier_matchable_id = UNSET else: identifier_matchable_id = self.identifier_matchable_id - identifier_reference_kind: str | Unset = UNSET + identifier_reference_kind: Union[Unset, str] = UNSET if not isinstance(self.identifier_reference_kind, Unset): identifier_reference_kind = self.identifier_reference_kind - identifier_json_path: None | str | Unset + identifier_json_path: Union[None, Unset, str] if isinstance(self.identifier_json_path, Unset): identifier_json_path = UNSET else: identifier_json_path = self.identifier_json_path - identifier_value_regex: None | str | Unset + identifier_value_regex: Union[None, Unset, str] if isinstance(self.identifier_value_regex, Unset): identifier_value_regex = UNSET else: identifier_value_regex = self.identifier_value_regex - conditions_attributes: list[dict[str, Any]] | Unset = UNSET + conditions_attributes: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.conditions_attributes, Unset): conditions_attributes = [] for conditions_attributes_item_data in self.conditions_attributes: @@ -141,7 +140,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: enabled = d.pop("enabled", UNSET) _condition_type = d.pop("condition_type", UNSET) - condition_type: UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionType | Unset + condition_type: Union[Unset, UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionType] if isinstance(_condition_type, Unset): condition_type = UNSET else: @@ -152,9 +151,9 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: ) _identifier_matchable_type = d.pop("identifier_matchable_type", UNSET) - identifier_matchable_type: ( - UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0IdentifierMatchableType | Unset - ) + identifier_matchable_type: Union[ + Unset, UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0IdentifierMatchableType + ] if isinstance(_identifier_matchable_type, Unset): identifier_matchable_type = UNSET else: @@ -164,19 +163,19 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: ) ) - def _parse_identifier_matchable_id(data: object) -> None | str | Unset: + def _parse_identifier_matchable_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) identifier_matchable_id = _parse_identifier_matchable_id(d.pop("identifier_matchable_id", UNSET)) _identifier_reference_kind = d.pop("identifier_reference_kind", UNSET) - identifier_reference_kind: ( - UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0IdentifierReferenceKind | Unset - ) + identifier_reference_kind: Union[ + Unset, UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0IdentifierReferenceKind + ] if isinstance(_identifier_reference_kind, Unset): identifier_reference_kind = UNSET else: @@ -186,38 +185,34 @@ def _parse_identifier_matchable_id(data: object) -> None | str | Unset: ) ) - def _parse_identifier_json_path(data: object) -> None | str | Unset: + def _parse_identifier_json_path(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) identifier_json_path = _parse_identifier_json_path(d.pop("identifier_json_path", UNSET)) - def _parse_identifier_value_regex(data: object) -> None | str | Unset: + def _parse_identifier_value_regex(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) identifier_value_regex = _parse_identifier_value_regex(d.pop("identifier_value_regex", UNSET)) + conditions_attributes = [] _conditions_attributes = d.pop("conditions_attributes", UNSET) - conditions_attributes: ( - list[UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItem] | Unset - ) = UNSET - if _conditions_attributes is not UNSET: - conditions_attributes = [] - for conditions_attributes_item_data in _conditions_attributes: - conditions_attributes_item = ( - UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItem.from_dict( - conditions_attributes_item_data - ) + for conditions_attributes_item_data in _conditions_attributes or []: + conditions_attributes_item = ( + UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItem.from_dict( + conditions_attributes_item_data ) + ) - conditions_attributes.append(conditions_attributes_item) + conditions_attributes.append(conditions_attributes_item) update_alerts_source_data_attributes_resolution_rule_attributes_type_0 = cls( enabled=enabled, diff --git a/rootly_sdk/models/update_alerts_source_data_attributes_resolution_rule_attributes_type_0_conditions_attributes_item.py b/rootly_sdk/models/update_alerts_source_data_attributes_resolution_rule_attributes_type_0_conditions_attributes_item.py index 0676be4b..dbfcaa07 100644 --- a/rootly_sdk/models/update_alerts_source_data_attributes_resolution_rule_attributes_type_0_conditions_attributes_item.py +++ b/rootly_sdk/models/update_alerts_source_data_attributes_resolution_rule_attributes_type_0_conditions_attributes_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -27,57 +25,60 @@ class UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItem: """ Attributes: - field (None | str | Unset): JSON path expression to extract a specific value from the alert's payload for + field (Union[None, Unset, str]): JSON path expression to extract a specific value from the alert's payload for evaluation - operator (UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemOperator | - Unset): Comparison operator used to evaluate the extracted value against the specified condition - value (str | Unset): Value that the extracted payload data is compared to using the specified operator to + operator (Union[Unset, + UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemOperator]): Comparison + operator used to evaluate the extracted value against the specified condition + value (Union[Unset, str]): Value that the extracted payload data is compared to using the specified operator to determine a match - conditionable_type - (UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemConditionableType | - Unset): The type of the conditionable - conditionable_id (None | str | Unset): The ID of the conditionable. If conditionable_type is AlertField, this is - the ID of the alert field. - kind (UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemKind | Unset): The - kind of the conditionable + conditionable_type (Union[Unset, + UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemConditionableType]): The + type of the conditionable + conditionable_id (Union[None, Unset, str]): The ID of the conditionable. If conditionable_type is AlertField, + this is the ID of the alert field. + kind (Union[Unset, UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemKind]): + The kind of the conditionable """ - field: None | str | Unset = UNSET - operator: UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemOperator | Unset = ( + field: Union[None, Unset, str] = UNSET + operator: Union[ + Unset, UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemOperator + ] = UNSET + value: Union[Unset, str] = UNSET + conditionable_type: Union[ + Unset, UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemConditionableType + ] = UNSET + conditionable_id: Union[None, Unset, str] = UNSET + kind: Union[Unset, UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemKind] = ( UNSET ) - value: str | Unset = UNSET - conditionable_type: ( - UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemConditionableType | Unset - ) = UNSET - conditionable_id: None | str | Unset = UNSET - kind: UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemKind | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - field: None | str | Unset + field: Union[None, Unset, str] if isinstance(self.field, Unset): field = UNSET else: field = self.field - operator: str | Unset = UNSET + operator: Union[Unset, str] = UNSET if not isinstance(self.operator, Unset): operator = self.operator value = self.value - conditionable_type: str | Unset = UNSET + conditionable_type: Union[Unset, str] = UNSET if not isinstance(self.conditionable_type, Unset): conditionable_type = self.conditionable_type - conditionable_id: None | str | Unset + conditionable_id: Union[None, Unset, str] if isinstance(self.conditionable_id, Unset): conditionable_id = UNSET else: conditionable_id = self.conditionable_id - kind: str | Unset = UNSET + kind: Union[Unset, str] = UNSET if not isinstance(self.kind, Unset): kind = self.kind @@ -103,17 +104,19 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_field(data: object) -> None | str | Unset: + def _parse_field(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) field = _parse_field(d.pop("field", UNSET)) _operator = d.pop("operator", UNSET) - operator: UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemOperator | Unset + operator: Union[ + Unset, UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemOperator + ] if isinstance(_operator, Unset): operator = UNSET else: @@ -124,10 +127,10 @@ def _parse_field(data: object) -> None | str | Unset: value = d.pop("value", UNSET) _conditionable_type = d.pop("conditionable_type", UNSET) - conditionable_type: ( - UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemConditionableType - | Unset - ) + conditionable_type: Union[ + Unset, + UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemConditionableType, + ] if isinstance(_conditionable_type, Unset): conditionable_type = UNSET else: @@ -135,17 +138,17 @@ def _parse_field(data: object) -> None | str | Unset: _conditionable_type ) - def _parse_conditionable_id(data: object) -> None | str | Unset: + def _parse_conditionable_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) conditionable_id = _parse_conditionable_id(d.pop("conditionable_id", UNSET)) _kind = d.pop("kind", UNSET) - kind: UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemKind | Unset + kind: Union[Unset, UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemKind] if isinstance(_kind, Unset): kind = UNSET else: diff --git a/rootly_sdk/models/update_alerts_source_data_attributes_sourceable_attributes_type_0.py b/rootly_sdk/models/update_alerts_source_data_attributes_sourceable_attributes_type_0.py index 29ebe687..d2c515c9 100644 --- a/rootly_sdk/models/update_alerts_source_data_attributes_sourceable_attributes_type_0.py +++ b/rootly_sdk/models/update_alerts_source_data_attributes_sourceable_attributes_type_0.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,32 +17,32 @@ @_attrs_define class UpdateAlertsSourceDataAttributesSourceableAttributesType0: - """Provide additional attributes for generic_webhook alerts source - - Attributes: - auto_resolve (bool | Unset): Set this to true to auto-resolve alerts based on field_mappings_attributes - conditions - resolve_state (None | str | Unset): This value is matched with the value extracted from alerts payload using - JSON path in field_mappings_attributes - accept_threaded_emails (bool | Unset): Set this to false to reject threaded emails - field_mappings_attributes - (list[UpdateAlertsSourceDataAttributesSourceableAttributesType0FieldMappingsAttributesItem] | Unset): Specify - rules to auto resolve alerts + """Provide additional attributes for the underlying source. `auto_resolve`, `resolve_state` and + `field_mappings_attributes` apply to generic_webhook sources; `accept_threaded_emails` applies to email sources. + + Attributes: + auto_resolve (Union[Unset, bool]): Set this to true to auto-resolve alerts based on field_mappings_attributes + conditions + resolve_state (Union[None, Unset, str]): This value is matched with the value extracted from alerts payload + using JSON path in field_mappings_attributes + accept_threaded_emails (Union[Unset, bool]): Set this to false to reject threaded emails + field_mappings_attributes (Union[Unset, + list['UpdateAlertsSourceDataAttributesSourceableAttributesType0FieldMappingsAttributesItem']]): Specify rules to + auto resolve alerts """ - auto_resolve: bool | Unset = UNSET - resolve_state: None | str | Unset = UNSET - accept_threaded_emails: bool | Unset = UNSET - field_mappings_attributes: ( - list[UpdateAlertsSourceDataAttributesSourceableAttributesType0FieldMappingsAttributesItem] | Unset - ) = UNSET + auto_resolve: Union[Unset, bool] = UNSET + resolve_state: Union[None, Unset, str] = UNSET + accept_threaded_emails: Union[Unset, bool] = UNSET + field_mappings_attributes: Union[ + Unset, list["UpdateAlertsSourceDataAttributesSourceableAttributesType0FieldMappingsAttributesItem"] + ] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - auto_resolve = self.auto_resolve - resolve_state: None | str | Unset + resolve_state: Union[None, Unset, str] if isinstance(self.resolve_state, Unset): resolve_state = UNSET else: @@ -52,7 +50,7 @@ def to_dict(self) -> dict[str, Any]: accept_threaded_emails = self.accept_threaded_emails - field_mappings_attributes: list[dict[str, Any]] | Unset = UNSET + field_mappings_attributes: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.field_mappings_attributes, Unset): field_mappings_attributes = [] for field_mappings_attributes_item_data in self.field_mappings_attributes: @@ -82,31 +80,27 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) auto_resolve = d.pop("auto_resolve", UNSET) - def _parse_resolve_state(data: object) -> None | str | Unset: + def _parse_resolve_state(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) resolve_state = _parse_resolve_state(d.pop("resolve_state", UNSET)) accept_threaded_emails = d.pop("accept_threaded_emails", UNSET) + field_mappings_attributes = [] _field_mappings_attributes = d.pop("field_mappings_attributes", UNSET) - field_mappings_attributes: ( - list[UpdateAlertsSourceDataAttributesSourceableAttributesType0FieldMappingsAttributesItem] | Unset - ) = UNSET - if _field_mappings_attributes is not UNSET: - field_mappings_attributes = [] - for field_mappings_attributes_item_data in _field_mappings_attributes: - field_mappings_attributes_item = ( - UpdateAlertsSourceDataAttributesSourceableAttributesType0FieldMappingsAttributesItem.from_dict( - field_mappings_attributes_item_data - ) + for field_mappings_attributes_item_data in _field_mappings_attributes or []: + field_mappings_attributes_item = ( + UpdateAlertsSourceDataAttributesSourceableAttributesType0FieldMappingsAttributesItem.from_dict( + field_mappings_attributes_item_data ) + ) - field_mappings_attributes.append(field_mappings_attributes_item) + field_mappings_attributes.append(field_mappings_attributes_item) update_alerts_source_data_attributes_sourceable_attributes_type_0 = cls( auto_resolve=auto_resolve, diff --git a/rootly_sdk/models/update_alerts_source_data_attributes_sourceable_attributes_type_0_field_mappings_attributes_item.py b/rootly_sdk/models/update_alerts_source_data_attributes_sourceable_attributes_type_0_field_mappings_attributes_item.py index f0794e79..ae9c0e6d 100644 --- a/rootly_sdk/models/update_alerts_source_data_attributes_sourceable_attributes_type_0_field_mappings_attributes_item.py +++ b/rootly_sdk/models/update_alerts_source_data_attributes_sourceable_attributes_type_0_field_mappings_attributes_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,19 +17,21 @@ class UpdateAlertsSourceDataAttributesSourceableAttributesType0FieldMappingsAttributesItem: """ Attributes: - field (UpdateAlertsSourceDataAttributesSourceableAttributesType0FieldMappingsAttributesItemField | Unset): + field (Union[Unset, UpdateAlertsSourceDataAttributesSourceableAttributesType0FieldMappingsAttributesItemField]): Select the field on which the condition to be evaluated - json_path (str | Unset): JSON path expression to extract a specific value from the alert's payload for + json_path (Union[Unset, str]): JSON path expression to extract a specific value from the alert's payload for evaluation. For `notification_target_id` only: if your account has opted in to Dynamic Notification Targets, this may also be a Liquid template that resolves to a notification target id at routing time. """ - field: UpdateAlertsSourceDataAttributesSourceableAttributesType0FieldMappingsAttributesItemField | Unset = UNSET - json_path: str | Unset = UNSET + field: Union[Unset, UpdateAlertsSourceDataAttributesSourceableAttributesType0FieldMappingsAttributesItemField] = ( + UNSET + ) + json_path: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - field: str | Unset = UNSET + field: Union[Unset, str] = UNSET if not isinstance(self.field, Unset): field = self.field @@ -51,7 +51,7 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _field = d.pop("field", UNSET) - field: UpdateAlertsSourceDataAttributesSourceableAttributesType0FieldMappingsAttributesItemField | Unset + field: Union[Unset, UpdateAlertsSourceDataAttributesSourceableAttributesType0FieldMappingsAttributesItemField] if isinstance(_field, Unset): field = UNSET else: diff --git a/rootly_sdk/models/update_api_key.py b/rootly_sdk/models/update_api_key.py index 316cd68b..e1838445 100644 --- a/rootly_sdk/models/update_api_key.py +++ b/rootly_sdk/models/update_api_key.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateApiKey: data (UpdateApiKeyData): """ - data: UpdateApiKeyData + data: "UpdateApiKeyData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_api_key_data.py b/rootly_sdk/models/update_api_key_data.py index 984040f9..a680bdf7 100644 --- a/rootly_sdk/models/update_api_key_data.py +++ b/rootly_sdk/models/update_api_key_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class UpdateApiKeyData: """ type_: UpdateApiKeyDataType - attributes: UpdateApiKeyDataAttributes + attributes: "UpdateApiKeyDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_api_key_data_attributes.py b/rootly_sdk/models/update_api_key_data_attributes.py index a3739511..9087ddd9 100644 --- a/rootly_sdk/models/update_api_key_data_attributes.py +++ b/rootly_sdk/models/update_api_key_data_attributes.py @@ -1,8 +1,6 @@ -from __future__ import annotations - import datetime from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from dateutil.parser import isoparse @@ -16,25 +14,25 @@ class UpdateApiKeyDataAttributes: """ Attributes: - name (str | Unset): The name of the API key - description (None | str | Unset): A description of the API key - expires_at (datetime.datetime | None | Unset): The expiration date of the API key (ISO 8601) + name (Union[Unset, str]): The name of the API key + description (Union[None, Unset, str]): A description of the API key + expires_at (Union[None, Unset, datetime.datetime]): The expiration date of the API key (ISO 8601) """ - name: str | Unset = UNSET - description: None | str | Unset = UNSET - expires_at: datetime.datetime | None | Unset = UNSET + name: Union[Unset, str] = UNSET + description: Union[None, Unset, str] = UNSET + expires_at: Union[None, Unset, datetime.datetime] = UNSET def to_dict(self) -> dict[str, Any]: name = self.name - description: None | str | Unset + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: description = self.description - expires_at: None | str | Unset + expires_at: Union[None, Unset, str] if isinstance(self.expires_at, Unset): expires_at = UNSET elif isinstance(self.expires_at, datetime.datetime): @@ -59,16 +57,16 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) - def _parse_expires_at(data: object) -> datetime.datetime | None | Unset: + def _parse_expires_at(data: object) -> Union[None, Unset, datetime.datetime]: if data is None: return data if isinstance(data, Unset): @@ -79,9 +77,9 @@ def _parse_expires_at(data: object) -> datetime.datetime | None | Unset: expires_at_type_0 = isoparse(data) return expires_at_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(datetime.datetime | None | Unset, data) + return cast(Union[None, Unset, datetime.datetime], data) expires_at = _parse_expires_at(d.pop("expires_at", UNSET)) diff --git a/rootly_sdk/models/update_asana_task_task_params.py b/rootly_sdk/models/update_asana_task_task_params.py index 8d8ed46c..2641b28e 100644 --- a/rootly_sdk/models/update_asana_task_task_params.py +++ b/rootly_sdk/models/update_asana_task_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,36 +27,35 @@ class UpdateAsanaTaskTaskParams: Attributes: task_id (str): The task id completion (UpdateAsanaTaskTaskParamsCompletion): - task_type (UpdateAsanaTaskTaskParamsTaskType | Unset): - title (str | Unset): The task title - notes (str | Unset): - assign_user_email (str | Unset): The assigned user's email - due_date (str | Unset): The due date - custom_fields_mapping (None | str | Unset): Custom field mappings. Can contain liquid markup and need to be + task_type (Union[Unset, UpdateAsanaTaskTaskParamsTaskType]): + title (Union[Unset, str]): The task title + notes (Union[Unset, str]): + assign_user_email (Union[Unset, str]): The assigned user's email + due_date (Union[Unset, str]): The due date + custom_fields_mapping (Union[None, Unset, str]): Custom field mappings. Can contain liquid markup and need to be valid JSON - dependency_direction (UpdateAsanaTaskTaskParamsDependencyDirection | Unset): Default: 'blocking'. - dependent_task_ids (list[str] | None | Unset): Dependent task ids. Supports liquid syntax + dependency_direction (Union[Unset, UpdateAsanaTaskTaskParamsDependencyDirection]): Default: 'blocking'. + dependent_task_ids (Union[None, Unset, list[str]]): Dependent task ids. Supports liquid syntax """ task_id: str - completion: UpdateAsanaTaskTaskParamsCompletion - task_type: UpdateAsanaTaskTaskParamsTaskType | Unset = UNSET - title: str | Unset = UNSET - notes: str | Unset = UNSET - assign_user_email: str | Unset = UNSET - due_date: str | Unset = UNSET - custom_fields_mapping: None | str | Unset = UNSET - dependency_direction: UpdateAsanaTaskTaskParamsDependencyDirection | Unset = "blocking" - dependent_task_ids: list[str] | None | Unset = UNSET + completion: "UpdateAsanaTaskTaskParamsCompletion" + task_type: Union[Unset, UpdateAsanaTaskTaskParamsTaskType] = UNSET + title: Union[Unset, str] = UNSET + notes: Union[Unset, str] = UNSET + assign_user_email: Union[Unset, str] = UNSET + due_date: Union[Unset, str] = UNSET + custom_fields_mapping: Union[None, Unset, str] = UNSET + dependency_direction: Union[Unset, UpdateAsanaTaskTaskParamsDependencyDirection] = "blocking" + dependent_task_ids: Union[None, Unset, list[str]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - task_id = self.task_id completion = self.completion.to_dict() - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -70,17 +67,17 @@ def to_dict(self) -> dict[str, Any]: due_date = self.due_date - custom_fields_mapping: None | str | Unset + custom_fields_mapping: Union[None, Unset, str] if isinstance(self.custom_fields_mapping, Unset): custom_fields_mapping = UNSET else: custom_fields_mapping = self.custom_fields_mapping - dependency_direction: str | Unset = UNSET + dependency_direction: Union[Unset, str] = UNSET if not isinstance(self.dependency_direction, Unset): dependency_direction = self.dependency_direction - dependent_task_ids: list[str] | None | Unset + dependent_task_ids: Union[None, Unset, list[str]] if isinstance(self.dependent_task_ids, Unset): dependent_task_ids = UNSET elif isinstance(self.dependent_task_ids, list): @@ -126,7 +123,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: completion = UpdateAsanaTaskTaskParamsCompletion.from_dict(d.pop("completion")) _task_type = d.pop("task_type", UNSET) - task_type: UpdateAsanaTaskTaskParamsTaskType | Unset + task_type: Union[Unset, UpdateAsanaTaskTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: @@ -140,23 +137,23 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: due_date = d.pop("due_date", UNSET) - def _parse_custom_fields_mapping(data: object) -> None | str | Unset: + def _parse_custom_fields_mapping(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) custom_fields_mapping = _parse_custom_fields_mapping(d.pop("custom_fields_mapping", UNSET)) _dependency_direction = d.pop("dependency_direction", UNSET) - dependency_direction: UpdateAsanaTaskTaskParamsDependencyDirection | Unset + dependency_direction: Union[Unset, UpdateAsanaTaskTaskParamsDependencyDirection] if isinstance(_dependency_direction, Unset): dependency_direction = UNSET else: dependency_direction = check_update_asana_task_task_params_dependency_direction(_dependency_direction) - def _parse_dependent_task_ids(data: object) -> list[str] | None | Unset: + def _parse_dependent_task_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -167,9 +164,9 @@ def _parse_dependent_task_ids(data: object) -> list[str] | None | Unset: dependent_task_ids_type_0 = cast(list[str], data) return dependent_task_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) dependent_task_ids = _parse_dependent_task_ids(d.pop("dependent_task_ids", UNSET)) diff --git a/rootly_sdk/models/update_asana_task_task_params_completion.py b/rootly_sdk/models/update_asana_task_task_params_completion.py index 9ed49ae3..854d9df0 100644 --- a/rootly_sdk/models/update_asana_task_task_params_completion.py +++ b/rootly_sdk/models/update_asana_task_task_params_completion.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class UpdateAsanaTaskTaskParamsCompletion: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_attached_alerts_task_params.py b/rootly_sdk/models/update_attached_alerts_task_params.py index eb67a79b..46707f73 100644 --- a/rootly_sdk/models/update_attached_alerts_task_params.py +++ b/rootly_sdk/models/update_attached_alerts_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -24,17 +22,17 @@ class UpdateAttachedAlertsTaskParams: """ Attributes: status (UpdateAttachedAlertsTaskParamsStatus): - task_type (UpdateAttachedAlertsTaskParamsTaskType | Unset): + task_type (Union[Unset, UpdateAttachedAlertsTaskParamsTaskType]): """ status: UpdateAttachedAlertsTaskParamsStatus - task_type: UpdateAttachedAlertsTaskParamsTaskType | Unset = UNSET + task_type: Union[Unset, UpdateAttachedAlertsTaskParamsTaskType] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: status: str = self.status - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -56,7 +54,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: status = check_update_attached_alerts_task_params_status(d.pop("status")) _task_type = d.pop("task_type", UNSET) - task_type: UpdateAttachedAlertsTaskParamsTaskType | Unset + task_type: Union[Unset, UpdateAttachedAlertsTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/update_authorization.py b/rootly_sdk/models/update_authorization.py index 111de878..93414489 100644 --- a/rootly_sdk/models/update_authorization.py +++ b/rootly_sdk/models/update_authorization.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateAuthorization: data (UpdateAuthorizationData): """ - data: UpdateAuthorizationData + data: "UpdateAuthorizationData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_authorization_data.py b/rootly_sdk/models/update_authorization_data.py index b69c00db..ff68e054 100644 --- a/rootly_sdk/models/update_authorization_data.py +++ b/rootly_sdk/models/update_authorization_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class UpdateAuthorizationData: """ type_: UpdateAuthorizationDataType - attributes: UpdateAuthorizationDataAttributes + attributes: "UpdateAuthorizationDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_authorization_data_attributes.py b/rootly_sdk/models/update_authorization_data_attributes.py index a5e587cc..c1f8c304 100644 --- a/rootly_sdk/models/update_authorization_data_attributes.py +++ b/rootly_sdk/models/update_authorization_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define @@ -18,13 +16,13 @@ class UpdateAuthorizationDataAttributes: """ Attributes: - permissions (list[UpdateAuthorizationDataAttributesPermissionsItem] | Unset): + permissions (Union[Unset, list[UpdateAuthorizationDataAttributesPermissionsItem]]): """ - permissions: list[UpdateAuthorizationDataAttributesPermissionsItem] | Unset = UNSET + permissions: Union[Unset, list[UpdateAuthorizationDataAttributesPermissionsItem]] = UNSET def to_dict(self) -> dict[str, Any]: - permissions: list[str] | Unset = UNSET + permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.permissions, Unset): permissions = [] for permissions_item_data in self.permissions: @@ -42,14 +40,12 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) + permissions = [] _permissions = d.pop("permissions", UNSET) - permissions: list[UpdateAuthorizationDataAttributesPermissionsItem] | Unset = UNSET - if _permissions is not UNSET: - permissions = [] - for permissions_item_data in _permissions: - permissions_item = check_update_authorization_data_attributes_permissions_item(permissions_item_data) + for permissions_item_data in _permissions or []: + permissions_item = check_update_authorization_data_attributes_permissions_item(permissions_item_data) - permissions.append(permissions_item) + permissions.append(permissions_item) update_authorization_data_attributes = cls( permissions=permissions, diff --git a/rootly_sdk/models/update_catalog.py b/rootly_sdk/models/update_catalog.py index ce690f10..9eeca011 100644 --- a/rootly_sdk/models/update_catalog.py +++ b/rootly_sdk/models/update_catalog.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateCatalog: data (UpdateCatalogData): """ - data: UpdateCatalogData + data: "UpdateCatalogData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_catalog_checklist_template.py b/rootly_sdk/models/update_catalog_checklist_template.py index 5867865e..f1b29e91 100644 --- a/rootly_sdk/models/update_catalog_checklist_template.py +++ b/rootly_sdk/models/update_catalog_checklist_template.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateCatalogChecklistTemplate: data (UpdateCatalogChecklistTemplateData): """ - data: UpdateCatalogChecklistTemplateData + data: "UpdateCatalogChecklistTemplateData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_catalog_checklist_template_data.py b/rootly_sdk/models/update_catalog_checklist_template_data.py index a7ee5fc8..1254eb27 100644 --- a/rootly_sdk/models/update_catalog_checklist_template_data.py +++ b/rootly_sdk/models/update_catalog_checklist_template_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class UpdateCatalogChecklistTemplateData: """ type_: UpdateCatalogChecklistTemplateDataType - attributes: UpdateCatalogChecklistTemplateDataAttributes + attributes: "UpdateCatalogChecklistTemplateDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_catalog_checklist_template_data_attributes.py b/rootly_sdk/models/update_catalog_checklist_template_data_attributes.py index 9e6825b4..bbb0af15 100644 --- a/rootly_sdk/models/update_catalog_checklist_template_data_attributes.py +++ b/rootly_sdk/models/update_catalog_checklist_template_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -26,41 +24,52 @@ class UpdateCatalogChecklistTemplateDataAttributes: """ Attributes: - name (str | Unset): The name of the checklist template - description (None | str | Unset): The description of the checklist template - fields (list[UpdateCatalogChecklistTemplateDataAttributesBuiltinField | - UpdateCatalogChecklistTemplateDataAttributesCustomField] | None | Unset): Template fields. Position is - determined by array order. Replaces all existing fields. - owners (list[UpdateCatalogChecklistTemplateDataAttributesOwnersType0Item] | None | Unset): Template owners. - Replaces all existing owners. + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + name (Union[Unset, str]): The name of the checklist template + description (Union[None, Unset, str]): The description of the checklist template + fields (Union[None, Unset, list[Union['UpdateCatalogChecklistTemplateDataAttributesBuiltinField', + 'UpdateCatalogChecklistTemplateDataAttributesCustomField']]]): Template fields. Position is determined by array + order. Replaces all existing fields. + owners (Union[None, Unset, list['UpdateCatalogChecklistTemplateDataAttributesOwnersType0Item']]): Template + owners. Replaces all existing owners. """ - name: str | Unset = UNSET - description: None | str | Unset = UNSET - fields: ( + slug: Union[None, Unset, str] = UNSET + name: Union[Unset, str] = UNSET + description: Union[None, Unset, str] = UNSET + fields: Union[ + None, + Unset, list[ - UpdateCatalogChecklistTemplateDataAttributesBuiltinField - | UpdateCatalogChecklistTemplateDataAttributesCustomField - ] - | None - | Unset - ) = UNSET - owners: list[UpdateCatalogChecklistTemplateDataAttributesOwnersType0Item] | None | Unset = UNSET + Union[ + "UpdateCatalogChecklistTemplateDataAttributesBuiltinField", + "UpdateCatalogChecklistTemplateDataAttributesCustomField", + ] + ], + ] = UNSET + owners: Union[None, Unset, list["UpdateCatalogChecklistTemplateDataAttributesOwnersType0Item"]] = UNSET def to_dict(self) -> dict[str, Any]: from ..models.update_catalog_checklist_template_data_attributes_builtin_field import ( UpdateCatalogChecklistTemplateDataAttributesBuiltinField, ) + slug: Union[None, Unset, str] + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug + name = self.name - description: None | str | Unset + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: description = self.description - fields: list[dict[str, Any]] | None | Unset + fields: Union[None, Unset, list[dict[str, Any]]] if isinstance(self.fields, Unset): fields = UNSET elif isinstance(self.fields, list): @@ -77,7 +86,7 @@ def to_dict(self) -> dict[str, Any]: else: fields = self.fields - owners: list[dict[str, Any]] | None | Unset + owners: Union[None, Unset, list[dict[str, Any]]] if isinstance(self.owners, Unset): owners = UNSET elif isinstance(self.owners, list): @@ -92,6 +101,8 @@ def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} field_dict.update({}) + if slug is not UNSET: + field_dict["slug"] = slug if name is not UNSET: field_dict["name"] = name if description is not UNSET: @@ -116,27 +127,39 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: ) d = dict(src_dict) + + def _parse_slug(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + slug = _parse_slug(d.pop("slug", UNSET)) + name = d.pop("name", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) def _parse_fields( data: object, - ) -> ( + ) -> Union[ + None, + Unset, list[ - UpdateCatalogChecklistTemplateDataAttributesBuiltinField - | UpdateCatalogChecklistTemplateDataAttributesCustomField - ] - | None - | Unset - ): + Union[ + "UpdateCatalogChecklistTemplateDataAttributesBuiltinField", + "UpdateCatalogChecklistTemplateDataAttributesCustomField", + ] + ], + ]: if data is None: return data if isinstance(data, Unset): @@ -150,10 +173,10 @@ def _parse_fields( def _parse_fields_type_0_item( data: object, - ) -> ( - UpdateCatalogChecklistTemplateDataAttributesBuiltinField - | UpdateCatalogChecklistTemplateDataAttributesCustomField - ): + ) -> Union[ + "UpdateCatalogChecklistTemplateDataAttributesBuiltinField", + "UpdateCatalogChecklistTemplateDataAttributesCustomField", + ]: try: if not isinstance(data, dict): raise TypeError() @@ -162,7 +185,7 @@ def _parse_fields_type_0_item( ) return fields_type_0_item_builtin_field - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass if not isinstance(data, dict): raise TypeError() @@ -177,15 +200,19 @@ def _parse_fields_type_0_item( fields_type_0.append(fields_type_0_item) return fields_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass return cast( - list[ - UpdateCatalogChecklistTemplateDataAttributesBuiltinField - | UpdateCatalogChecklistTemplateDataAttributesCustomField - ] - | None - | Unset, + Union[ + None, + Unset, + list[ + Union[ + "UpdateCatalogChecklistTemplateDataAttributesBuiltinField", + "UpdateCatalogChecklistTemplateDataAttributesCustomField", + ] + ], + ], data, ) @@ -193,7 +220,7 @@ def _parse_fields_type_0_item( def _parse_owners( data: object, - ) -> list[UpdateCatalogChecklistTemplateDataAttributesOwnersType0Item] | None | Unset: + ) -> Union[None, Unset, list["UpdateCatalogChecklistTemplateDataAttributesOwnersType0Item"]]: if data is None: return data if isinstance(data, Unset): @@ -211,13 +238,14 @@ def _parse_owners( owners_type_0.append(owners_type_0_item) return owners_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[UpdateCatalogChecklistTemplateDataAttributesOwnersType0Item] | None | Unset, data) + return cast(Union[None, Unset, list["UpdateCatalogChecklistTemplateDataAttributesOwnersType0Item"]], data) owners = _parse_owners(d.pop("owners", UNSET)) update_catalog_checklist_template_data_attributes = cls( + slug=slug, name=name, description=description, fields=fields, diff --git a/rootly_sdk/models/update_catalog_checklist_template_data_attributes_builtin_field.py b/rootly_sdk/models/update_catalog_checklist_template_data_attributes_builtin_field.py index 7e061904..f918a230 100644 --- a/rootly_sdk/models/update_catalog_checklist_template_data_attributes_builtin_field.py +++ b/rootly_sdk/models/update_catalog_checklist_template_data_attributes_builtin_field.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/update_catalog_checklist_template_data_attributes_custom_field.py b/rootly_sdk/models/update_catalog_checklist_template_data_attributes_custom_field.py index 7831a8c9..20cc0e59 100644 --- a/rootly_sdk/models/update_catalog_checklist_template_data_attributes_custom_field.py +++ b/rootly_sdk/models/update_catalog_checklist_template_data_attributes_custom_field.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,12 +19,12 @@ class UpdateCatalogChecklistTemplateDataAttributesCustomField: Attributes: field_source (UpdateCatalogChecklistTemplateDataAttributesCustomFieldFieldSource): catalog_property_id (str): ID of the catalog property - field_key (str | Unset): Ignored for custom fields (auto-derived from catalog property) + field_key (Union[Unset, str]): Ignored for custom fields (auto-derived from catalog property) """ field_source: UpdateCatalogChecklistTemplateDataAttributesCustomFieldFieldSource catalog_property_id: str - field_key: str | Unset = UNSET + field_key: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_catalog_checklist_template_data_attributes_owners_type_0_item.py b/rootly_sdk/models/update_catalog_checklist_template_data_attributes_owners_type_0_item.py index d49718a9..073dcfb7 100644 --- a/rootly_sdk/models/update_catalog_checklist_template_data_attributes_owners_type_0_item.py +++ b/rootly_sdk/models/update_catalog_checklist_template_data_attributes_owners_type_0_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/update_catalog_data.py b/rootly_sdk/models/update_catalog_data.py index 4cb95a7c..a7def769 100644 --- a/rootly_sdk/models/update_catalog_data.py +++ b/rootly_sdk/models/update_catalog_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class UpdateCatalogData: """ type_: UpdateCatalogDataType - attributes: UpdateCatalogDataAttributes + attributes: "UpdateCatalogDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_catalog_data_attributes.py b/rootly_sdk/models/update_catalog_data_attributes.py index c8e6bdc2..5b28ba36 100644 --- a/rootly_sdk/models/update_catalog_data_attributes.py +++ b/rootly_sdk/models/update_catalog_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -18,39 +16,48 @@ class UpdateCatalogDataAttributes: """ Attributes: - name (str | Unset): - description (None | str | Unset): - icon (UpdateCatalogDataAttributesIcon | Unset): - position (int | None | Unset): Default position of the catalog when displayed in a list. - external_id (None | str | Unset): An external identifier for this catalog. Must be unique within the team. + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + name (Union[Unset, str]): + description (Union[None, Unset, str]): + icon (Union[Unset, UpdateCatalogDataAttributesIcon]): + position (Union[None, Unset, int]): Default position of the catalog when displayed in a list. + external_id (Union[None, Unset, str]): An external identifier for this catalog. Must be unique within the team. """ - name: str | Unset = UNSET - description: None | str | Unset = UNSET - icon: UpdateCatalogDataAttributesIcon | Unset = UNSET - position: int | None | Unset = UNSET - external_id: None | str | Unset = UNSET + slug: Union[None, Unset, str] = UNSET + name: Union[Unset, str] = UNSET + description: Union[None, Unset, str] = UNSET + icon: Union[Unset, UpdateCatalogDataAttributesIcon] = UNSET + position: Union[None, Unset, int] = UNSET + external_id: Union[None, Unset, str] = UNSET def to_dict(self) -> dict[str, Any]: + slug: Union[None, Unset, str] + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug + name = self.name - description: None | str | Unset + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: description = self.description - icon: str | Unset = UNSET + icon: Union[Unset, str] = UNSET if not isinstance(self.icon, Unset): icon = self.icon - position: int | None | Unset + position: Union[None, Unset, int] if isinstance(self.position, Unset): position = UNSET else: position = self.position - external_id: None | str | Unset + external_id: Union[None, Unset, str] if isinstance(self.external_id, Unset): external_id = UNSET else: @@ -59,6 +66,8 @@ def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} field_dict.update({}) + if slug is not UNSET: + field_dict["slug"] = slug if name is not UNSET: field_dict["name"] = name if description is not UNSET: @@ -75,43 +84,54 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) + + def _parse_slug(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + slug = _parse_slug(d.pop("slug", UNSET)) + name = d.pop("name", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) _icon = d.pop("icon", UNSET) - icon: UpdateCatalogDataAttributesIcon | Unset + icon: Union[Unset, UpdateCatalogDataAttributesIcon] if isinstance(_icon, Unset): icon = UNSET else: icon = check_update_catalog_data_attributes_icon(_icon) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> Union[None, Unset, int]: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(Union[None, Unset, int], data) position = _parse_position(d.pop("position", UNSET)) - def _parse_external_id(data: object) -> None | str | Unset: + def _parse_external_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) external_id = _parse_external_id(d.pop("external_id", UNSET)) update_catalog_data_attributes = cls( + slug=slug, name=name, description=description, icon=icon, diff --git a/rootly_sdk/models/update_catalog_entity.py b/rootly_sdk/models/update_catalog_entity.py index 192874f3..1d01990b 100644 --- a/rootly_sdk/models/update_catalog_entity.py +++ b/rootly_sdk/models/update_catalog_entity.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateCatalogEntity: data (UpdateCatalogEntityData): """ - data: UpdateCatalogEntityData + data: "UpdateCatalogEntityData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_catalog_entity_data.py b/rootly_sdk/models/update_catalog_entity_data.py index 1e0c6e1d..1ae7aec8 100644 --- a/rootly_sdk/models/update_catalog_entity_data.py +++ b/rootly_sdk/models/update_catalog_entity_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class UpdateCatalogEntityData: """ type_: UpdateCatalogEntityDataType - attributes: UpdateCatalogEntityDataAttributes + attributes: "UpdateCatalogEntityDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_catalog_entity_data_attributes.py b/rootly_sdk/models/update_catalog_entity_data_attributes.py index d04a6a4c..5e302ad0 100644 --- a/rootly_sdk/models/update_catalog_entity_data_attributes.py +++ b/rootly_sdk/models/update_catalog_entity_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -20,52 +18,68 @@ class UpdateCatalogEntityDataAttributes: """ Attributes: - name (str | Unset): - description (None | str | Unset): - position (int | None | Unset): Default position of the item when displayed in a list. - backstage_id (None | str | Unset): The Backstage entity ID this catalog entity is linked to. - external_id (None | str | Unset): An external identifier for this catalog entity. Must be unique within the + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + name (Union[Unset, str]): + description (Union[None, Unset, str]): + public_description (Union[None, Unset, str]): The status page description of the catalog entity + position (Union[None, Unset, int]): Default position of the item when displayed in a list. + backstage_id (Union[None, Unset, str]): The Backstage entity ID this catalog entity is linked to. + external_id (Union[None, Unset, str]): An external identifier for this catalog entity. Must be unique within the catalog. - properties (list[UpdateCatalogEntityDataAttributesPropertiesItem] | Unset): Array of property values for this - catalog entity + properties (Union[Unset, list['UpdateCatalogEntityDataAttributesPropertiesItem']]): Array of property values for + this catalog entity """ - name: str | Unset = UNSET - description: None | str | Unset = UNSET - position: int | None | Unset = UNSET - backstage_id: None | str | Unset = UNSET - external_id: None | str | Unset = UNSET - properties: list[UpdateCatalogEntityDataAttributesPropertiesItem] | Unset = UNSET + slug: Union[None, Unset, str] = UNSET + name: Union[Unset, str] = UNSET + description: Union[None, Unset, str] = UNSET + public_description: Union[None, Unset, str] = UNSET + position: Union[None, Unset, int] = UNSET + backstage_id: Union[None, Unset, str] = UNSET + external_id: Union[None, Unset, str] = UNSET + properties: Union[Unset, list["UpdateCatalogEntityDataAttributesPropertiesItem"]] = UNSET def to_dict(self) -> dict[str, Any]: + slug: Union[None, Unset, str] + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug name = self.name - description: None | str | Unset + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: description = self.description - position: int | None | Unset + public_description: Union[None, Unset, str] + if isinstance(self.public_description, Unset): + public_description = UNSET + else: + public_description = self.public_description + + position: Union[None, Unset, int] if isinstance(self.position, Unset): position = UNSET else: position = self.position - backstage_id: None | str | Unset + backstage_id: Union[None, Unset, str] if isinstance(self.backstage_id, Unset): backstage_id = UNSET else: backstage_id = self.backstage_id - external_id: None | str | Unset + external_id: Union[None, Unset, str] if isinstance(self.external_id, Unset): external_id = UNSET else: external_id = self.external_id - properties: list[dict[str, Any]] | Unset = UNSET + properties: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.properties, Unset): properties = [] for properties_item_data in self.properties: @@ -75,10 +89,14 @@ def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} field_dict.update({}) + if slug is not UNSET: + field_dict["slug"] = slug if name is not UNSET: field_dict["name"] = name if description is not UNSET: field_dict["description"] = description + if public_description is not UNSET: + field_dict["public_description"] = public_description if position is not UNSET: field_dict["position"] = position if backstage_id is not UNSET: @@ -97,56 +115,75 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: ) d = dict(src_dict) + + def _parse_slug(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + slug = _parse_slug(d.pop("slug", UNSET)) + name = d.pop("name", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) - def _parse_position(data: object) -> int | None | Unset: + def _parse_public_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(Union[None, Unset, str], data) + + public_description = _parse_public_description(d.pop("public_description", UNSET)) + + def _parse_position(data: object) -> Union[None, Unset, int]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, int], data) position = _parse_position(d.pop("position", UNSET)) - def _parse_backstage_id(data: object) -> None | str | Unset: + def _parse_backstage_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) backstage_id = _parse_backstage_id(d.pop("backstage_id", UNSET)) - def _parse_external_id(data: object) -> None | str | Unset: + def _parse_external_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) external_id = _parse_external_id(d.pop("external_id", UNSET)) + properties = [] _properties = d.pop("properties", UNSET) - properties: list[UpdateCatalogEntityDataAttributesPropertiesItem] | Unset = UNSET - if _properties is not UNSET: - properties = [] - for properties_item_data in _properties: - properties_item = UpdateCatalogEntityDataAttributesPropertiesItem.from_dict(properties_item_data) + for properties_item_data in _properties or []: + properties_item = UpdateCatalogEntityDataAttributesPropertiesItem.from_dict(properties_item_data) - properties.append(properties_item) + properties.append(properties_item) update_catalog_entity_data_attributes = cls( + slug=slug, name=name, description=description, + public_description=public_description, position=position, backstage_id=backstage_id, external_id=external_id, diff --git a/rootly_sdk/models/update_catalog_entity_data_attributes_properties_item.py b/rootly_sdk/models/update_catalog_entity_data_attributes_properties_item.py index 06dcaffd..001e4eb7 100644 --- a/rootly_sdk/models/update_catalog_entity_data_attributes_properties_item.py +++ b/rootly_sdk/models/update_catalog_entity_data_attributes_properties_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/update_catalog_entity_property.py b/rootly_sdk/models/update_catalog_entity_property.py index 9e9215a5..27f982f7 100644 --- a/rootly_sdk/models/update_catalog_entity_property.py +++ b/rootly_sdk/models/update_catalog_entity_property.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -22,11 +20,10 @@ class UpdateCatalogEntityProperty: data (UpdateCatalogEntityPropertyData): """ - data: UpdateCatalogEntityPropertyData + data: "UpdateCatalogEntityPropertyData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_catalog_entity_property_data.py b/rootly_sdk/models/update_catalog_entity_property_data.py index d5d8a95a..c1b43386 100644 --- a/rootly_sdk/models/update_catalog_entity_property_data.py +++ b/rootly_sdk/models/update_catalog_entity_property_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class UpdateCatalogEntityPropertyData: """ type_: UpdateCatalogEntityPropertyDataType - attributes: UpdateCatalogEntityPropertyDataAttributes + attributes: "UpdateCatalogEntityPropertyDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_catalog_entity_property_data_attributes.py b/rootly_sdk/models/update_catalog_entity_property_data_attributes.py index eb945add..25f2e03b 100644 --- a/rootly_sdk/models/update_catalog_entity_property_data_attributes.py +++ b/rootly_sdk/models/update_catalog_entity_property_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define @@ -18,15 +16,15 @@ class UpdateCatalogEntityPropertyDataAttributes: """ Attributes: - key (UpdateCatalogEntityPropertyDataAttributesKey | Unset): - value (str | Unset): + key (Union[Unset, UpdateCatalogEntityPropertyDataAttributesKey]): + value (Union[Unset, str]): """ - key: UpdateCatalogEntityPropertyDataAttributesKey | Unset = UNSET - value: str | Unset = UNSET + key: Union[Unset, UpdateCatalogEntityPropertyDataAttributesKey] = UNSET + value: Union[Unset, str] = UNSET def to_dict(self) -> dict[str, Any]: - key: str | Unset = UNSET + key: Union[Unset, str] = UNSET if not isinstance(self.key, Unset): key = self.key @@ -46,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _key = d.pop("key", UNSET) - key: UpdateCatalogEntityPropertyDataAttributesKey | Unset + key: Union[Unset, UpdateCatalogEntityPropertyDataAttributesKey] if isinstance(_key, Unset): key = UNSET else: diff --git a/rootly_sdk/models/update_catalog_field.py b/rootly_sdk/models/update_catalog_field.py index 1c18e6d3..71d4aaf0 100644 --- a/rootly_sdk/models/update_catalog_field.py +++ b/rootly_sdk/models/update_catalog_field.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateCatalogField: data (UpdateCatalogFieldData): """ - data: UpdateCatalogFieldData + data: "UpdateCatalogFieldData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_catalog_field_data.py b/rootly_sdk/models/update_catalog_field_data.py index aead4648..08e43274 100644 --- a/rootly_sdk/models/update_catalog_field_data.py +++ b/rootly_sdk/models/update_catalog_field_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class UpdateCatalogFieldData: """ type_: UpdateCatalogFieldDataType - attributes: UpdateCatalogFieldDataAttributes + attributes: "UpdateCatalogFieldDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_catalog_field_data_attributes.py b/rootly_sdk/models/update_catalog_field_data_attributes.py index 743f9aaf..33b11e7d 100644 --- a/rootly_sdk/models/update_catalog_field_data_attributes.py +++ b/rootly_sdk/models/update_catalog_field_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -22,38 +20,48 @@ class UpdateCatalogFieldDataAttributes: """ Attributes: - name (str | Unset): - kind (UpdateCatalogFieldDataAttributesKind | Unset): - kind_catalog_id (None | str | Unset): Restricts values to items of specified catalog. - position (int | None | Unset): Default position of the item when displayed in a list. - required (bool | Unset): Whether the field is required. - catalog_type (UpdateCatalogFieldDataAttributesCatalogType | Unset): The type of catalog the field belongs to. - external_id (None | str | Unset): An external identifier for this catalog field. Must be unique within the + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + name (Union[Unset, str]): + kind (Union[Unset, UpdateCatalogFieldDataAttributesKind]): + kind_catalog_id (Union[None, Unset, str]): Restricts values to items of specified catalog. + position (Union[None, Unset, int]): Default position of the item when displayed in a list. + required (Union[Unset, bool]): Whether the field is required. + catalog_type (Union[Unset, UpdateCatalogFieldDataAttributesCatalogType]): The type of catalog the field belongs + to. + external_id (Union[None, Unset, str]): An external identifier for this catalog field. Must be unique within the scope. """ - name: str | Unset = UNSET - kind: UpdateCatalogFieldDataAttributesKind | Unset = UNSET - kind_catalog_id: None | str | Unset = UNSET - position: int | None | Unset = UNSET - required: bool | Unset = UNSET - catalog_type: UpdateCatalogFieldDataAttributesCatalogType | Unset = UNSET - external_id: None | str | Unset = UNSET + slug: Union[None, Unset, str] = UNSET + name: Union[Unset, str] = UNSET + kind: Union[Unset, UpdateCatalogFieldDataAttributesKind] = UNSET + kind_catalog_id: Union[None, Unset, str] = UNSET + position: Union[None, Unset, int] = UNSET + required: Union[Unset, bool] = UNSET + catalog_type: Union[Unset, UpdateCatalogFieldDataAttributesCatalogType] = UNSET + external_id: Union[None, Unset, str] = UNSET def to_dict(self) -> dict[str, Any]: + slug: Union[None, Unset, str] + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug + name = self.name - kind: str | Unset = UNSET + kind: Union[Unset, str] = UNSET if not isinstance(self.kind, Unset): kind = self.kind - kind_catalog_id: None | str | Unset + kind_catalog_id: Union[None, Unset, str] if isinstance(self.kind_catalog_id, Unset): kind_catalog_id = UNSET else: kind_catalog_id = self.kind_catalog_id - position: int | None | Unset + position: Union[None, Unset, int] if isinstance(self.position, Unset): position = UNSET else: @@ -61,11 +69,11 @@ def to_dict(self) -> dict[str, Any]: required = self.required - catalog_type: str | Unset = UNSET + catalog_type: Union[Unset, str] = UNSET if not isinstance(self.catalog_type, Unset): catalog_type = self.catalog_type - external_id: None | str | Unset + external_id: Union[None, Unset, str] if isinstance(self.external_id, Unset): external_id = UNSET else: @@ -74,6 +82,8 @@ def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} field_dict.update({}) + if slug is not UNSET: + field_dict["slug"] = slug if name is not UNSET: field_dict["name"] = name if kind is not UNSET: @@ -94,52 +104,63 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) + + def _parse_slug(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + slug = _parse_slug(d.pop("slug", UNSET)) + name = d.pop("name", UNSET) _kind = d.pop("kind", UNSET) - kind: UpdateCatalogFieldDataAttributesKind | Unset + kind: Union[Unset, UpdateCatalogFieldDataAttributesKind] if isinstance(_kind, Unset): kind = UNSET else: kind = check_update_catalog_field_data_attributes_kind(_kind) - def _parse_kind_catalog_id(data: object) -> None | str | Unset: + def _parse_kind_catalog_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) kind_catalog_id = _parse_kind_catalog_id(d.pop("kind_catalog_id", UNSET)) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> Union[None, Unset, int]: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(Union[None, Unset, int], data) position = _parse_position(d.pop("position", UNSET)) required = d.pop("required", UNSET) _catalog_type = d.pop("catalog_type", UNSET) - catalog_type: UpdateCatalogFieldDataAttributesCatalogType | Unset + catalog_type: Union[Unset, UpdateCatalogFieldDataAttributesCatalogType] if isinstance(_catalog_type, Unset): catalog_type = UNSET else: catalog_type = check_update_catalog_field_data_attributes_catalog_type(_catalog_type) - def _parse_external_id(data: object) -> None | str | Unset: + def _parse_external_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) external_id = _parse_external_id(d.pop("external_id", UNSET)) update_catalog_field_data_attributes = cls( + slug=slug, name=name, kind=kind, kind_catalog_id=kind_catalog_id, diff --git a/rootly_sdk/models/update_catalog_property.py b/rootly_sdk/models/update_catalog_property.py index 8b15c596..d7ba4b5e 100644 --- a/rootly_sdk/models/update_catalog_property.py +++ b/rootly_sdk/models/update_catalog_property.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateCatalogProperty: data (UpdateCatalogPropertyData): """ - data: UpdateCatalogPropertyData + data: "UpdateCatalogPropertyData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_catalog_property_data.py b/rootly_sdk/models/update_catalog_property_data.py index 2d7bf203..2412fa4f 100644 --- a/rootly_sdk/models/update_catalog_property_data.py +++ b/rootly_sdk/models/update_catalog_property_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class UpdateCatalogPropertyData: """ type_: UpdateCatalogPropertyDataType - attributes: UpdateCatalogPropertyDataAttributes + attributes: "UpdateCatalogPropertyDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_catalog_property_data_attributes.py b/rootly_sdk/models/update_catalog_property_data_attributes.py index a5327c9d..fca776fe 100644 --- a/rootly_sdk/models/update_catalog_property_data_attributes.py +++ b/rootly_sdk/models/update_catalog_property_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -22,39 +20,48 @@ class UpdateCatalogPropertyDataAttributes: """ Attributes: - name (str | Unset): - kind (UpdateCatalogPropertyDataAttributesKind | Unset): - kind_catalog_id (None | str | Unset): Restricts values to items of specified catalog. - position (int | None | Unset): Default position of the item when displayed in a list. - required (bool | Unset): Whether the property is required. - catalog_type (UpdateCatalogPropertyDataAttributesCatalogType | Unset): The type of catalog the property belongs - to. - external_id (None | str | Unset): An external identifier for this catalog property. Must be unique within the - scope. + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + name (Union[Unset, str]): + kind (Union[Unset, UpdateCatalogPropertyDataAttributesKind]): + kind_catalog_id (Union[None, Unset, str]): Restricts values to items of specified catalog. + position (Union[None, Unset, int]): Default position of the item when displayed in a list. + required (Union[Unset, bool]): Whether the property is required. + catalog_type (Union[Unset, UpdateCatalogPropertyDataAttributesCatalogType]): The type of catalog the property + belongs to. + external_id (Union[None, Unset, str]): An external identifier for this catalog property. Must be unique within + the scope. """ - name: str | Unset = UNSET - kind: UpdateCatalogPropertyDataAttributesKind | Unset = UNSET - kind_catalog_id: None | str | Unset = UNSET - position: int | None | Unset = UNSET - required: bool | Unset = UNSET - catalog_type: UpdateCatalogPropertyDataAttributesCatalogType | Unset = UNSET - external_id: None | str | Unset = UNSET + slug: Union[None, Unset, str] = UNSET + name: Union[Unset, str] = UNSET + kind: Union[Unset, UpdateCatalogPropertyDataAttributesKind] = UNSET + kind_catalog_id: Union[None, Unset, str] = UNSET + position: Union[None, Unset, int] = UNSET + required: Union[Unset, bool] = UNSET + catalog_type: Union[Unset, UpdateCatalogPropertyDataAttributesCatalogType] = UNSET + external_id: Union[None, Unset, str] = UNSET def to_dict(self) -> dict[str, Any]: + slug: Union[None, Unset, str] + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug + name = self.name - kind: str | Unset = UNSET + kind: Union[Unset, str] = UNSET if not isinstance(self.kind, Unset): kind = self.kind - kind_catalog_id: None | str | Unset + kind_catalog_id: Union[None, Unset, str] if isinstance(self.kind_catalog_id, Unset): kind_catalog_id = UNSET else: kind_catalog_id = self.kind_catalog_id - position: int | None | Unset + position: Union[None, Unset, int] if isinstance(self.position, Unset): position = UNSET else: @@ -62,11 +69,11 @@ def to_dict(self) -> dict[str, Any]: required = self.required - catalog_type: str | Unset = UNSET + catalog_type: Union[Unset, str] = UNSET if not isinstance(self.catalog_type, Unset): catalog_type = self.catalog_type - external_id: None | str | Unset + external_id: Union[None, Unset, str] if isinstance(self.external_id, Unset): external_id = UNSET else: @@ -75,6 +82,8 @@ def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} field_dict.update({}) + if slug is not UNSET: + field_dict["slug"] = slug if name is not UNSET: field_dict["name"] = name if kind is not UNSET: @@ -95,52 +104,63 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) + + def _parse_slug(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + slug = _parse_slug(d.pop("slug", UNSET)) + name = d.pop("name", UNSET) _kind = d.pop("kind", UNSET) - kind: UpdateCatalogPropertyDataAttributesKind | Unset + kind: Union[Unset, UpdateCatalogPropertyDataAttributesKind] if isinstance(_kind, Unset): kind = UNSET else: kind = check_update_catalog_property_data_attributes_kind(_kind) - def _parse_kind_catalog_id(data: object) -> None | str | Unset: + def _parse_kind_catalog_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) kind_catalog_id = _parse_kind_catalog_id(d.pop("kind_catalog_id", UNSET)) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> Union[None, Unset, int]: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(Union[None, Unset, int], data) position = _parse_position(d.pop("position", UNSET)) required = d.pop("required", UNSET) _catalog_type = d.pop("catalog_type", UNSET) - catalog_type: UpdateCatalogPropertyDataAttributesCatalogType | Unset + catalog_type: Union[Unset, UpdateCatalogPropertyDataAttributesCatalogType] if isinstance(_catalog_type, Unset): catalog_type = UNSET else: catalog_type = check_update_catalog_property_data_attributes_catalog_type(_catalog_type) - def _parse_external_id(data: object) -> None | str | Unset: + def _parse_external_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) external_id = _parse_external_id(d.pop("external_id", UNSET)) update_catalog_property_data_attributes = cls( + slug=slug, name=name, kind=kind, kind_catalog_id=kind_catalog_id, diff --git a/rootly_sdk/models/update_cause.py b/rootly_sdk/models/update_cause.py index bcbc6c76..ff36414d 100644 --- a/rootly_sdk/models/update_cause.py +++ b/rootly_sdk/models/update_cause.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateCause: data (UpdateCauseData): """ - data: UpdateCauseData + data: "UpdateCauseData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_cause_data.py b/rootly_sdk/models/update_cause_data.py index 4ee88f52..afcaf388 100644 --- a/rootly_sdk/models/update_cause_data.py +++ b/rootly_sdk/models/update_cause_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class UpdateCauseData: """ type_: UpdateCauseDataType - attributes: UpdateCauseDataAttributes + attributes: "UpdateCauseDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_cause_data_attributes.py b/rootly_sdk/models/update_cause_data_attributes.py index b3bd138c..5ce86a0a 100644 --- a/rootly_sdk/models/update_cause_data_attributes.py +++ b/rootly_sdk/models/update_cause_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -18,34 +16,51 @@ class UpdateCauseDataAttributes: """ Attributes: - name (str | Unset): The name of the cause - description (None | str | Unset): The description of the cause - position (int | None | Unset): Position of the cause - properties (list[UpdateCauseDataAttributesPropertiesItem] | Unset): Array of property values for this cause. + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + name (Union[Unset, str]): The name of the cause + description (Union[None, Unset, str]): The description of the cause + public_description (Union[None, Unset, str]): The status page description of the cause + position (Union[None, Unset, int]): Position of the cause + properties (Union[Unset, list['UpdateCauseDataAttributesPropertiesItem']]): Array of property values for this + cause. """ - name: str | Unset = UNSET - description: None | str | Unset = UNSET - position: int | None | Unset = UNSET - properties: list[UpdateCauseDataAttributesPropertiesItem] | Unset = UNSET + slug: Union[None, Unset, str] = UNSET + name: Union[Unset, str] = UNSET + description: Union[None, Unset, str] = UNSET + public_description: Union[None, Unset, str] = UNSET + position: Union[None, Unset, int] = UNSET + properties: Union[Unset, list["UpdateCauseDataAttributesPropertiesItem"]] = UNSET def to_dict(self) -> dict[str, Any]: + slug: Union[None, Unset, str] + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug name = self.name - description: None | str | Unset + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: description = self.description - position: int | None | Unset + public_description: Union[None, Unset, str] + if isinstance(self.public_description, Unset): + public_description = UNSET + else: + public_description = self.public_description + + position: Union[None, Unset, int] if isinstance(self.position, Unset): position = UNSET else: position = self.position - properties: list[dict[str, Any]] | Unset = UNSET + properties: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.properties, Unset): properties = [] for properties_item_data in self.properties: @@ -55,10 +70,14 @@ def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} field_dict.update({}) + if slug is not UNSET: + field_dict["slug"] = slug if name is not UNSET: field_dict["name"] = name if description is not UNSET: field_dict["description"] = description + if public_description is not UNSET: + field_dict["public_description"] = public_description if position is not UNSET: field_dict["position"] = position if properties is not UNSET: @@ -71,38 +90,57 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: from ..models.update_cause_data_attributes_properties_item import UpdateCauseDataAttributesPropertiesItem d = dict(src_dict) + + def _parse_slug(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + slug = _parse_slug(d.pop("slug", UNSET)) + name = d.pop("name", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) - def _parse_position(data: object) -> int | None | Unset: + def _parse_public_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(Union[None, Unset, str], data) + + public_description = _parse_public_description(d.pop("public_description", UNSET)) + + def _parse_position(data: object) -> Union[None, Unset, int]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, int], data) position = _parse_position(d.pop("position", UNSET)) + properties = [] _properties = d.pop("properties", UNSET) - properties: list[UpdateCauseDataAttributesPropertiesItem] | Unset = UNSET - if _properties is not UNSET: - properties = [] - for properties_item_data in _properties: - properties_item = UpdateCauseDataAttributesPropertiesItem.from_dict(properties_item_data) + for properties_item_data in _properties or []: + properties_item = UpdateCauseDataAttributesPropertiesItem.from_dict(properties_item_data) - properties.append(properties_item) + properties.append(properties_item) update_cause_data_attributes = cls( + slug=slug, name=name, description=description, + public_description=public_description, position=position, properties=properties, ) diff --git a/rootly_sdk/models/update_cause_data_attributes_properties_item.py b/rootly_sdk/models/update_cause_data_attributes_properties_item.py index f551eb85..536c2d79 100644 --- a/rootly_sdk/models/update_cause_data_attributes_properties_item.py +++ b/rootly_sdk/models/update_cause_data_attributes_properties_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/update_clickup_task_task_params.py b/rootly_sdk/models/update_clickup_task_task_params.py index 7be46a3a..c0da612d 100644 --- a/rootly_sdk/models/update_clickup_task_task_params.py +++ b/rootly_sdk/models/update_clickup_task_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -24,34 +22,33 @@ class UpdateClickupTaskTaskParams: """ Attributes: task_id (str): The task id - task_type (UpdateClickupTaskTaskParamsTaskType | Unset): - title (str | Unset): The task title - description (str | Unset): The task description - tags (str | Unset): The task tags - priority (UpdateClickupTaskTaskParamsPriority | Unset): The priority id and display name - due_date (str | Unset): The due date - custom_fields_mapping (None | str | Unset): Custom field mappings. Can contain liquid markup and need to be + task_type (Union[Unset, UpdateClickupTaskTaskParamsTaskType]): + title (Union[Unset, str]): The task title + description (Union[Unset, str]): The task description + tags (Union[Unset, str]): The task tags + priority (Union[Unset, UpdateClickupTaskTaskParamsPriority]): The priority id and display name + due_date (Union[Unset, str]): The due date + custom_fields_mapping (Union[None, Unset, str]): Custom field mappings. Can contain liquid markup and need to be valid JSON - task_payload (None | str | Unset): Additional ClickUp task attributes. Will be merged into whatever was + task_payload (Union[None, Unset, str]): Additional ClickUp task attributes. Will be merged into whatever was specified in this tasks current parameters. Can contain liquid markup and need to be valid JSON """ task_id: str - task_type: UpdateClickupTaskTaskParamsTaskType | Unset = UNSET - title: str | Unset = UNSET - description: str | Unset = UNSET - tags: str | Unset = UNSET - priority: UpdateClickupTaskTaskParamsPriority | Unset = UNSET - due_date: str | Unset = UNSET - custom_fields_mapping: None | str | Unset = UNSET - task_payload: None | str | Unset = UNSET + task_type: Union[Unset, UpdateClickupTaskTaskParamsTaskType] = UNSET + title: Union[Unset, str] = UNSET + description: Union[Unset, str] = UNSET + tags: Union[Unset, str] = UNSET + priority: Union[Unset, "UpdateClickupTaskTaskParamsPriority"] = UNSET + due_date: Union[Unset, str] = UNSET + custom_fields_mapping: Union[None, Unset, str] = UNSET + task_payload: Union[None, Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - task_id = self.task_id - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -61,19 +58,19 @@ def to_dict(self) -> dict[str, Any]: tags = self.tags - priority: dict[str, Any] | Unset = UNSET + priority: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.priority, Unset): priority = self.priority.to_dict() due_date = self.due_date - custom_fields_mapping: None | str | Unset + custom_fields_mapping: Union[None, Unset, str] if isinstance(self.custom_fields_mapping, Unset): custom_fields_mapping = UNSET else: custom_fields_mapping = self.custom_fields_mapping - task_payload: None | str | Unset + task_payload: Union[None, Unset, str] if isinstance(self.task_payload, Unset): task_payload = UNSET else: @@ -113,7 +110,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: task_id = d.pop("task_id") _task_type = d.pop("task_type", UNSET) - task_type: UpdateClickupTaskTaskParamsTaskType | Unset + task_type: Union[Unset, UpdateClickupTaskTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: @@ -126,7 +123,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: tags = d.pop("tags", UNSET) _priority = d.pop("priority", UNSET) - priority: UpdateClickupTaskTaskParamsPriority | Unset + priority: Union[Unset, UpdateClickupTaskTaskParamsPriority] if isinstance(_priority, Unset): priority = UNSET else: @@ -134,21 +131,21 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: due_date = d.pop("due_date", UNSET) - def _parse_custom_fields_mapping(data: object) -> None | str | Unset: + def _parse_custom_fields_mapping(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) custom_fields_mapping = _parse_custom_fields_mapping(d.pop("custom_fields_mapping", UNSET)) - def _parse_task_payload(data: object) -> None | str | Unset: + def _parse_task_payload(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) task_payload = _parse_task_payload(d.pop("task_payload", UNSET)) diff --git a/rootly_sdk/models/update_clickup_task_task_params_priority.py b/rootly_sdk/models/update_clickup_task_task_params_priority.py index bfae1358..5e453aac 100644 --- a/rootly_sdk/models/update_clickup_task_task_params_priority.py +++ b/rootly_sdk/models/update_clickup_task_task_params_priority.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,12 +14,12 @@ class UpdateClickupTaskTaskParamsPriority: """The priority id and display name Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_coda_page_task_params.py b/rootly_sdk/models/update_coda_page_task_params.py index cc57f6dc..33ea3732 100644 --- a/rootly_sdk/models/update_coda_page_task_params.py +++ b/rootly_sdk/models/update_coda_page_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -24,28 +22,27 @@ class UpdateCodaPageTaskParams: """ Attributes: page_id (str): The Coda page id - task_type (UpdateCodaPageTaskParamsTaskType | Unset): - doc_id (str | Unset): The Coda doc id - title (str | Unset): The Coda page title - subtitle (str | Unset): The Coda page subtitle - content (str | Unset): The Coda page content - template (UpdateCodaPageTaskParamsTemplate | Unset): + task_type (Union[Unset, UpdateCodaPageTaskParamsTaskType]): + doc_id (Union[Unset, str]): The Coda doc id + title (Union[Unset, str]): The Coda page title + subtitle (Union[Unset, str]): The Coda page subtitle + content (Union[Unset, str]): The Coda page content + template (Union[Unset, UpdateCodaPageTaskParamsTemplate]): """ page_id: str - task_type: UpdateCodaPageTaskParamsTaskType | Unset = UNSET - doc_id: str | Unset = UNSET - title: str | Unset = UNSET - subtitle: str | Unset = UNSET - content: str | Unset = UNSET - template: UpdateCodaPageTaskParamsTemplate | Unset = UNSET + task_type: Union[Unset, UpdateCodaPageTaskParamsTaskType] = UNSET + doc_id: Union[Unset, str] = UNSET + title: Union[Unset, str] = UNSET + subtitle: Union[Unset, str] = UNSET + content: Union[Unset, str] = UNSET + template: Union[Unset, "UpdateCodaPageTaskParamsTemplate"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - page_id = self.page_id - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -57,7 +54,7 @@ def to_dict(self) -> dict[str, Any]: content = self.content - template: dict[str, Any] | Unset = UNSET + template: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.template, Unset): template = self.template.to_dict() @@ -91,7 +88,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: page_id = d.pop("page_id") _task_type = d.pop("task_type", UNSET) - task_type: UpdateCodaPageTaskParamsTaskType | Unset + task_type: Union[Unset, UpdateCodaPageTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: @@ -106,7 +103,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: content = d.pop("content", UNSET) _template = d.pop("template", UNSET) - template: UpdateCodaPageTaskParamsTemplate | Unset + template: Union[Unset, UpdateCodaPageTaskParamsTemplate] if isinstance(_template, Unset): template = UNSET else: diff --git a/rootly_sdk/models/update_coda_page_task_params_template.py b/rootly_sdk/models/update_coda_page_task_params_template.py index 58a24acc..c7f8c73a 100644 --- a/rootly_sdk/models/update_coda_page_task_params_template.py +++ b/rootly_sdk/models/update_coda_page_task_params_template.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class UpdateCodaPageTaskParamsTemplate: """ Attributes: - id (str | Unset): Combined doc_id/page_id in format 'doc_id/page_id' - name (str | Unset): + id (Union[Unset, str]): Combined doc_id/page_id in format 'doc_id/page_id' + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_communications_group.py b/rootly_sdk/models/update_communications_group.py index f9a17ecf..01e5aa95 100644 --- a/rootly_sdk/models/update_communications_group.py +++ b/rootly_sdk/models/update_communications_group.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateCommunicationsGroup: data (UpdateCommunicationsGroupData): """ - data: UpdateCommunicationsGroupData + data: "UpdateCommunicationsGroupData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_communications_group_data.py b/rootly_sdk/models/update_communications_group_data.py index bc38f326..0fee453c 100644 --- a/rootly_sdk/models/update_communications_group_data.py +++ b/rootly_sdk/models/update_communications_group_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class UpdateCommunicationsGroupData: """ type_: UpdateCommunicationsGroupDataType - attributes: UpdateCommunicationsGroupDataAttributes + attributes: "UpdateCommunicationsGroupDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_communications_group_data_attributes.py b/rootly_sdk/models/update_communications_group_data_attributes.py index a89a63de..7ba2875a 100644 --- a/rootly_sdk/models/update_communications_group_data_attributes.py +++ b/rootly_sdk/models/update_communications_group_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -27,44 +25,43 @@ class UpdateCommunicationsGroupDataAttributes: """ Attributes: - name (str | Unset): The name of the communications group - description (None | str | Unset): The description of the communications group - communication_type_id (str | Unset): The communication type ID - is_private (bool | None | Unset): Whether the group is private - condition_type (UpdateCommunicationsGroupDataAttributesConditionType | Unset): Condition type - sms_channel (bool | None | Unset): SMS channel enabled - email_channel (bool | None | Unset): Email channel enabled - member_ids (list[int] | None | Unset): Array of member user IDs - slack_channel_ids (list[str] | None | Unset): Array of Slack channel IDs - communication_group_conditions - (list[UpdateCommunicationsGroupDataAttributesCommunicationGroupConditionsType0Item] | None | Unset): Group - conditions attributes - communication_external_group_members - (list[UpdateCommunicationsGroupDataAttributesCommunicationExternalGroupMembersType0Item] | None | Unset): - External group members attributes + name (Union[Unset, str]): The name of the communications group + description (Union[None, Unset, str]): The description of the communications group + communication_type_id (Union[Unset, str]): The communication type ID + is_private (Union[None, Unset, bool]): Whether the group is private + condition_type (Union[Unset, UpdateCommunicationsGroupDataAttributesConditionType]): Condition type + sms_channel (Union[None, Unset, bool]): SMS channel enabled + email_channel (Union[None, Unset, bool]): Email channel enabled + member_ids (Union[None, Unset, list[int]]): Array of member user IDs + slack_channel_ids (Union[None, Unset, list[str]]): Array of Slack channel IDs + communication_group_conditions (Union[None, Unset, + list['UpdateCommunicationsGroupDataAttributesCommunicationGroupConditionsType0Item']]): Group conditions + attributes + communication_external_group_members (Union[None, Unset, + list['UpdateCommunicationsGroupDataAttributesCommunicationExternalGroupMembersType0Item']]): External group + members attributes """ - name: str | Unset = UNSET - description: None | str | Unset = UNSET - communication_type_id: str | Unset = UNSET - is_private: bool | None | Unset = UNSET - condition_type: UpdateCommunicationsGroupDataAttributesConditionType | Unset = UNSET - sms_channel: bool | None | Unset = UNSET - email_channel: bool | None | Unset = UNSET - member_ids: list[int] | None | Unset = UNSET - slack_channel_ids: list[str] | None | Unset = UNSET - communication_group_conditions: ( - list[UpdateCommunicationsGroupDataAttributesCommunicationGroupConditionsType0Item] | None | Unset - ) = UNSET - communication_external_group_members: ( - list[UpdateCommunicationsGroupDataAttributesCommunicationExternalGroupMembersType0Item] | None | Unset - ) = UNSET + name: Union[Unset, str] = UNSET + description: Union[None, Unset, str] = UNSET + communication_type_id: Union[Unset, str] = UNSET + is_private: Union[None, Unset, bool] = UNSET + condition_type: Union[Unset, UpdateCommunicationsGroupDataAttributesConditionType] = UNSET + sms_channel: Union[None, Unset, bool] = UNSET + email_channel: Union[None, Unset, bool] = UNSET + member_ids: Union[None, Unset, list[int]] = UNSET + slack_channel_ids: Union[None, Unset, list[str]] = UNSET + communication_group_conditions: Union[ + None, Unset, list["UpdateCommunicationsGroupDataAttributesCommunicationGroupConditionsType0Item"] + ] = UNSET + communication_external_group_members: Union[ + None, Unset, list["UpdateCommunicationsGroupDataAttributesCommunicationExternalGroupMembersType0Item"] + ] = UNSET def to_dict(self) -> dict[str, Any]: - name = self.name - description: None | str | Unset + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: @@ -72,29 +69,29 @@ def to_dict(self) -> dict[str, Any]: communication_type_id = self.communication_type_id - is_private: bool | None | Unset + is_private: Union[None, Unset, bool] if isinstance(self.is_private, Unset): is_private = UNSET else: is_private = self.is_private - condition_type: str | Unset = UNSET + condition_type: Union[Unset, str] = UNSET if not isinstance(self.condition_type, Unset): condition_type = self.condition_type - sms_channel: bool | None | Unset + sms_channel: Union[None, Unset, bool] if isinstance(self.sms_channel, Unset): sms_channel = UNSET else: sms_channel = self.sms_channel - email_channel: bool | None | Unset + email_channel: Union[None, Unset, bool] if isinstance(self.email_channel, Unset): email_channel = UNSET else: email_channel = self.email_channel - member_ids: list[int] | None | Unset + member_ids: Union[None, Unset, list[int]] if isinstance(self.member_ids, Unset): member_ids = UNSET elif isinstance(self.member_ids, list): @@ -103,7 +100,7 @@ def to_dict(self) -> dict[str, Any]: else: member_ids = self.member_ids - slack_channel_ids: list[str] | None | Unset + slack_channel_ids: Union[None, Unset, list[str]] if isinstance(self.slack_channel_ids, Unset): slack_channel_ids = UNSET elif isinstance(self.slack_channel_ids, list): @@ -112,7 +109,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_channel_ids = self.slack_channel_ids - communication_group_conditions: list[dict[str, Any]] | None | Unset + communication_group_conditions: Union[None, Unset, list[dict[str, Any]]] if isinstance(self.communication_group_conditions, Unset): communication_group_conditions = UNSET elif isinstance(self.communication_group_conditions, list): @@ -124,7 +121,7 @@ def to_dict(self) -> dict[str, Any]: else: communication_group_conditions = self.communication_group_conditions - communication_external_group_members: list[dict[str, Any]] | None | Unset + communication_external_group_members: Union[None, Unset, list[dict[str, Any]]] if isinstance(self.communication_external_group_members, Unset): communication_external_group_members = UNSET elif isinstance(self.communication_external_group_members, list): @@ -178,52 +175,52 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) communication_type_id = d.pop("communication_type_id", UNSET) - def _parse_is_private(data: object) -> bool | None | Unset: + def _parse_is_private(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) is_private = _parse_is_private(d.pop("is_private", UNSET)) _condition_type = d.pop("condition_type", UNSET) - condition_type: UpdateCommunicationsGroupDataAttributesConditionType | Unset + condition_type: Union[Unset, UpdateCommunicationsGroupDataAttributesConditionType] if isinstance(_condition_type, Unset): condition_type = UNSET else: condition_type = check_update_communications_group_data_attributes_condition_type(_condition_type) - def _parse_sms_channel(data: object) -> bool | None | Unset: + def _parse_sms_channel(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) sms_channel = _parse_sms_channel(d.pop("sms_channel", UNSET)) - def _parse_email_channel(data: object) -> bool | None | Unset: + def _parse_email_channel(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) email_channel = _parse_email_channel(d.pop("email_channel", UNSET)) - def _parse_member_ids(data: object) -> list[int] | None | Unset: + def _parse_member_ids(data: object) -> Union[None, Unset, list[int]]: if data is None: return data if isinstance(data, Unset): @@ -234,13 +231,13 @@ def _parse_member_ids(data: object) -> list[int] | None | Unset: member_ids_type_0 = cast(list[int], data) return member_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[int] | None | Unset, data) + return cast(Union[None, Unset, list[int]], data) member_ids = _parse_member_ids(d.pop("member_ids", UNSET)) - def _parse_slack_channel_ids(data: object) -> list[str] | None | Unset: + def _parse_slack_channel_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -251,15 +248,15 @@ def _parse_slack_channel_ids(data: object) -> list[str] | None | Unset: slack_channel_ids_type_0 = cast(list[str], data) return slack_channel_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) slack_channel_ids = _parse_slack_channel_ids(d.pop("slack_channel_ids", UNSET)) def _parse_communication_group_conditions( data: object, - ) -> list[UpdateCommunicationsGroupDataAttributesCommunicationGroupConditionsType0Item] | None | Unset: + ) -> Union[None, Unset, list["UpdateCommunicationsGroupDataAttributesCommunicationGroupConditionsType0Item"]]: if data is None: return data if isinstance(data, Unset): @@ -279,10 +276,13 @@ def _parse_communication_group_conditions( communication_group_conditions_type_0.append(communication_group_conditions_type_0_item) return communication_group_conditions_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass return cast( - list[UpdateCommunicationsGroupDataAttributesCommunicationGroupConditionsType0Item] | None | Unset, data + Union[ + None, Unset, list["UpdateCommunicationsGroupDataAttributesCommunicationGroupConditionsType0Item"] + ], + data, ) communication_group_conditions = _parse_communication_group_conditions( @@ -291,7 +291,9 @@ def _parse_communication_group_conditions( def _parse_communication_external_group_members( data: object, - ) -> list[UpdateCommunicationsGroupDataAttributesCommunicationExternalGroupMembersType0Item] | None | Unset: + ) -> Union[ + None, Unset, list["UpdateCommunicationsGroupDataAttributesCommunicationExternalGroupMembersType0Item"] + ]: if data is None: return data if isinstance(data, Unset): @@ -313,10 +315,14 @@ def _parse_communication_external_group_members( communication_external_group_members_type_0.append(communication_external_group_members_type_0_item) return communication_external_group_members_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass return cast( - list[UpdateCommunicationsGroupDataAttributesCommunicationExternalGroupMembersType0Item] | None | Unset, + Union[ + None, + Unset, + list["UpdateCommunicationsGroupDataAttributesCommunicationExternalGroupMembersType0Item"], + ], data, ) diff --git a/rootly_sdk/models/update_communications_group_data_attributes_communication_external_group_members_type_0_item.py b/rootly_sdk/models/update_communications_group_data_attributes_communication_external_group_members_type_0_item.py index cafe7e7c..afd96522 100644 --- a/rootly_sdk/models/update_communications_group_data_attributes_communication_external_group_members_type_0_item.py +++ b/rootly_sdk/models/update_communications_group_data_attributes_communication_external_group_members_type_0_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,20 +13,20 @@ class UpdateCommunicationsGroupDataAttributesCommunicationExternalGroupMembersType0Item: """ Attributes: - id (None | str | Unset): ID of the external group member - name (str | Unset): Name of the external member - email (str | Unset): Email of the external member - phone_number (str | Unset): Phone number of the external member + id (Union[None, Unset, str]): ID of the external group member + name (Union[Unset, str]): Name of the external member + email (Union[Unset, str]): Email of the external member + phone_number (Union[Unset, str]): Phone number of the external member """ - id: None | str | Unset = UNSET - name: str | Unset = UNSET - email: str | Unset = UNSET - phone_number: str | Unset = UNSET + id: Union[None, Unset, str] = UNSET + name: Union[Unset, str] = UNSET + email: Union[Unset, str] = UNSET + phone_number: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id: None | str | Unset + id: Union[None, Unset, str] if isinstance(self.id, Unset): id = UNSET else: @@ -58,12 +56,12 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_id(data: object) -> None | str | Unset: + def _parse_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) id = _parse_id(d.pop("id", UNSET)) diff --git a/rootly_sdk/models/update_communications_group_data_attributes_communication_group_conditions_type_0_item.py b/rootly_sdk/models/update_communications_group_data_attributes_communication_group_conditions_type_0_item.py index 5cc8ccb1..12e43e41 100644 --- a/rootly_sdk/models/update_communications_group_data_attributes_communication_group_conditions_type_0_item.py +++ b/rootly_sdk/models/update_communications_group_data_attributes_communication_group_conditions_type_0_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,39 +17,39 @@ class UpdateCommunicationsGroupDataAttributesCommunicationGroupConditionsType0Item: """ Attributes: - id (None | str | Unset): ID of the condition - property_type (UpdateCommunicationsGroupDataAttributesCommunicationGroupConditionsType0ItemPropertyType | - Unset): Property type - service_ids (list[str] | None | Unset): Array of service IDs - severity_ids (list[str] | None | Unset): Array of severity IDs - functionality_ids (list[str] | None | Unset): Array of functionality IDs - group_ids (list[str] | None | Unset): Array of group IDs - incident_type_ids (list[str] | None | Unset): Array of incident type IDs + id (Union[None, Unset, str]): ID of the condition + property_type (Union[Unset, + UpdateCommunicationsGroupDataAttributesCommunicationGroupConditionsType0ItemPropertyType]): Property type + service_ids (Union[None, Unset, list[str]]): Array of service IDs + severity_ids (Union[None, Unset, list[str]]): Array of severity IDs + functionality_ids (Union[None, Unset, list[str]]): Array of functionality IDs + group_ids (Union[None, Unset, list[str]]): Array of group IDs + incident_type_ids (Union[None, Unset, list[str]]): Array of incident type IDs """ - id: None | str | Unset = UNSET - property_type: UpdateCommunicationsGroupDataAttributesCommunicationGroupConditionsType0ItemPropertyType | Unset = ( - UNSET - ) - service_ids: list[str] | None | Unset = UNSET - severity_ids: list[str] | None | Unset = UNSET - functionality_ids: list[str] | None | Unset = UNSET - group_ids: list[str] | None | Unset = UNSET - incident_type_ids: list[str] | None | Unset = UNSET + id: Union[None, Unset, str] = UNSET + property_type: Union[ + Unset, UpdateCommunicationsGroupDataAttributesCommunicationGroupConditionsType0ItemPropertyType + ] = UNSET + service_ids: Union[None, Unset, list[str]] = UNSET + severity_ids: Union[None, Unset, list[str]] = UNSET + functionality_ids: Union[None, Unset, list[str]] = UNSET + group_ids: Union[None, Unset, list[str]] = UNSET + incident_type_ids: Union[None, Unset, list[str]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id: None | str | Unset + id: Union[None, Unset, str] if isinstance(self.id, Unset): id = UNSET else: id = self.id - property_type: str | Unset = UNSET + property_type: Union[Unset, str] = UNSET if not isinstance(self.property_type, Unset): property_type = self.property_type - service_ids: list[str] | None | Unset + service_ids: Union[None, Unset, list[str]] if isinstance(self.service_ids, Unset): service_ids = UNSET elif isinstance(self.service_ids, list): @@ -60,7 +58,7 @@ def to_dict(self) -> dict[str, Any]: else: service_ids = self.service_ids - severity_ids: list[str] | None | Unset + severity_ids: Union[None, Unset, list[str]] if isinstance(self.severity_ids, Unset): severity_ids = UNSET elif isinstance(self.severity_ids, list): @@ -69,7 +67,7 @@ def to_dict(self) -> dict[str, Any]: else: severity_ids = self.severity_ids - functionality_ids: list[str] | None | Unset + functionality_ids: Union[None, Unset, list[str]] if isinstance(self.functionality_ids, Unset): functionality_ids = UNSET elif isinstance(self.functionality_ids, list): @@ -78,7 +76,7 @@ def to_dict(self) -> dict[str, Any]: else: functionality_ids = self.functionality_ids - group_ids: list[str] | None | Unset + group_ids: Union[None, Unset, list[str]] if isinstance(self.group_ids, Unset): group_ids = UNSET elif isinstance(self.group_ids, list): @@ -87,7 +85,7 @@ def to_dict(self) -> dict[str, Any]: else: group_ids = self.group_ids - incident_type_ids: list[str] | None | Unset + incident_type_ids: Union[None, Unset, list[str]] if isinstance(self.incident_type_ids, Unset): incident_type_ids = UNSET elif isinstance(self.incident_type_ids, list): @@ -120,17 +118,19 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_id(data: object) -> None | str | Unset: + def _parse_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) id = _parse_id(d.pop("id", UNSET)) _property_type = d.pop("property_type", UNSET) - property_type: UpdateCommunicationsGroupDataAttributesCommunicationGroupConditionsType0ItemPropertyType | Unset + property_type: Union[ + Unset, UpdateCommunicationsGroupDataAttributesCommunicationGroupConditionsType0ItemPropertyType + ] if isinstance(_property_type, Unset): property_type = UNSET else: @@ -138,7 +138,7 @@ def _parse_id(data: object) -> None | str | Unset: _property_type ) - def _parse_service_ids(data: object) -> list[str] | None | Unset: + def _parse_service_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -149,13 +149,13 @@ def _parse_service_ids(data: object) -> list[str] | None | Unset: service_ids_type_0 = cast(list[str], data) return service_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) service_ids = _parse_service_ids(d.pop("service_ids", UNSET)) - def _parse_severity_ids(data: object) -> list[str] | None | Unset: + def _parse_severity_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -166,13 +166,13 @@ def _parse_severity_ids(data: object) -> list[str] | None | Unset: severity_ids_type_0 = cast(list[str], data) return severity_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) severity_ids = _parse_severity_ids(d.pop("severity_ids", UNSET)) - def _parse_functionality_ids(data: object) -> list[str] | None | Unset: + def _parse_functionality_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -183,13 +183,13 @@ def _parse_functionality_ids(data: object) -> list[str] | None | Unset: functionality_ids_type_0 = cast(list[str], data) return functionality_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) functionality_ids = _parse_functionality_ids(d.pop("functionality_ids", UNSET)) - def _parse_group_ids(data: object) -> list[str] | None | Unset: + def _parse_group_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -200,13 +200,13 @@ def _parse_group_ids(data: object) -> list[str] | None | Unset: group_ids_type_0 = cast(list[str], data) return group_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) group_ids = _parse_group_ids(d.pop("group_ids", UNSET)) - def _parse_incident_type_ids(data: object) -> list[str] | None | Unset: + def _parse_incident_type_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -217,9 +217,9 @@ def _parse_incident_type_ids(data: object) -> list[str] | None | Unset: incident_type_ids_type_0 = cast(list[str], data) return incident_type_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) incident_type_ids = _parse_incident_type_ids(d.pop("incident_type_ids", UNSET)) diff --git a/rootly_sdk/models/update_communications_stage.py b/rootly_sdk/models/update_communications_stage.py index 1a54ae26..ce803372 100644 --- a/rootly_sdk/models/update_communications_stage.py +++ b/rootly_sdk/models/update_communications_stage.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateCommunicationsStage: data (UpdateCommunicationsStageData): """ - data: UpdateCommunicationsStageData + data: "UpdateCommunicationsStageData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_communications_stage_data.py b/rootly_sdk/models/update_communications_stage_data.py index 119b57fb..e3ead90b 100644 --- a/rootly_sdk/models/update_communications_stage_data.py +++ b/rootly_sdk/models/update_communications_stage_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class UpdateCommunicationsStageData: """ type_: UpdateCommunicationsStageDataType - attributes: UpdateCommunicationsStageDataAttributes + attributes: "UpdateCommunicationsStageDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_communications_stage_data_attributes.py b/rootly_sdk/models/update_communications_stage_data_attributes.py index a0a443e5..92fc2017 100644 --- a/rootly_sdk/models/update_communications_stage_data_attributes.py +++ b/rootly_sdk/models/update_communications_stage_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -14,25 +12,34 @@ class UpdateCommunicationsStageDataAttributes: """ Attributes: - name (str | Unset): The name of the communications stage - description (None | str | Unset): The description of the communications stage - position (int | None | Unset): Position of the communications stage + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + name (Union[Unset, str]): The name of the communications stage + description (Union[None, Unset, str]): The description of the communications stage + position (Union[None, Unset, int]): Position of the communications stage """ - name: str | Unset = UNSET - description: None | str | Unset = UNSET - position: int | None | Unset = UNSET + slug: Union[None, Unset, str] = UNSET + name: Union[Unset, str] = UNSET + description: Union[None, Unset, str] = UNSET + position: Union[None, Unset, int] = UNSET def to_dict(self) -> dict[str, Any]: + slug: Union[None, Unset, str] + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug + name = self.name - description: None | str | Unset + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: description = self.description - position: int | None | Unset + position: Union[None, Unset, int] if isinstance(self.position, Unset): position = UNSET else: @@ -41,6 +48,8 @@ def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} field_dict.update({}) + if slug is not UNSET: + field_dict["slug"] = slug if name is not UNSET: field_dict["name"] = name if description is not UNSET: @@ -53,27 +62,38 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) + + def _parse_slug(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + slug = _parse_slug(d.pop("slug", UNSET)) + name = d.pop("name", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> Union[None, Unset, int]: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(Union[None, Unset, int], data) position = _parse_position(d.pop("position", UNSET)) update_communications_stage_data_attributes = cls( + slug=slug, name=name, description=description, position=position, diff --git a/rootly_sdk/models/update_communications_template.py b/rootly_sdk/models/update_communications_template.py index 6b584d62..e21c6f26 100644 --- a/rootly_sdk/models/update_communications_template.py +++ b/rootly_sdk/models/update_communications_template.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateCommunicationsTemplate: data (UpdateCommunicationsTemplateData): """ - data: UpdateCommunicationsTemplateData + data: "UpdateCommunicationsTemplateData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_communications_template_data.py b/rootly_sdk/models/update_communications_template_data.py index 98c2b295..86dfa99c 100644 --- a/rootly_sdk/models/update_communications_template_data.py +++ b/rootly_sdk/models/update_communications_template_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class UpdateCommunicationsTemplateData: """ type_: UpdateCommunicationsTemplateDataType - attributes: UpdateCommunicationsTemplateDataAttributes + attributes: "UpdateCommunicationsTemplateDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_communications_template_data_attributes.py b/rootly_sdk/models/update_communications_template_data_attributes.py index 51b6c959..4a8c5bb4 100644 --- a/rootly_sdk/models/update_communications_template_data_attributes.py +++ b/rootly_sdk/models/update_communications_template_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -20,28 +18,27 @@ class UpdateCommunicationsTemplateDataAttributes: """ Attributes: - name (str | Unset): The name of the communications template - description (None | str | Unset): The description of the communications template - communication_type_id (str | Unset): The communication type ID - position (int | None | Unset): Position of the communications template - communication_template_stages_attributes - (list[UpdateCommunicationsTemplateDataAttributesCommunicationTemplateStagesAttributesType0Item] | None | Unset): - Template stages attributes + name (Union[Unset, str]): The name of the communications template + description (Union[None, Unset, str]): The description of the communications template + communication_type_id (Union[Unset, str]): The communication type ID + position (Union[None, Unset, int]): Position of the communications template + communication_template_stages_attributes (Union[None, Unset, + list['UpdateCommunicationsTemplateDataAttributesCommunicationTemplateStagesAttributesType0Item']]): Template + stages attributes """ - name: str | Unset = UNSET - description: None | str | Unset = UNSET - communication_type_id: str | Unset = UNSET - position: int | None | Unset = UNSET - communication_template_stages_attributes: ( - list[UpdateCommunicationsTemplateDataAttributesCommunicationTemplateStagesAttributesType0Item] | None | Unset - ) = UNSET + name: Union[Unset, str] = UNSET + description: Union[None, Unset, str] = UNSET + communication_type_id: Union[Unset, str] = UNSET + position: Union[None, Unset, int] = UNSET + communication_template_stages_attributes: Union[ + None, Unset, list["UpdateCommunicationsTemplateDataAttributesCommunicationTemplateStagesAttributesType0Item"] + ] = UNSET def to_dict(self) -> dict[str, Any]: - name = self.name - description: None | str | Unset + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: @@ -49,13 +46,13 @@ def to_dict(self) -> dict[str, Any]: communication_type_id = self.communication_type_id - position: int | None | Unset + position: Union[None, Unset, int] if isinstance(self.position, Unset): position = UNSET else: position = self.position - communication_template_stages_attributes: list[dict[str, Any]] | None | Unset + communication_template_stages_attributes: Union[None, Unset, list[dict[str, Any]]] if isinstance(self.communication_template_stages_attributes, Unset): communication_template_stages_attributes = UNSET elif isinstance(self.communication_template_stages_attributes, list): @@ -96,33 +93,33 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) communication_type_id = d.pop("communication_type_id", UNSET) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> Union[None, Unset, int]: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(Union[None, Unset, int], data) position = _parse_position(d.pop("position", UNSET)) def _parse_communication_template_stages_attributes( data: object, - ) -> ( - list[UpdateCommunicationsTemplateDataAttributesCommunicationTemplateStagesAttributesType0Item] - | None - | Unset - ): + ) -> Union[ + None, + Unset, + list["UpdateCommunicationsTemplateDataAttributesCommunicationTemplateStagesAttributesType0Item"], + ]: if data is None: return data if isinstance(data, Unset): @@ -144,12 +141,14 @@ def _parse_communication_template_stages_attributes( ) return communication_template_stages_attributes_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass return cast( - list[UpdateCommunicationsTemplateDataAttributesCommunicationTemplateStagesAttributesType0Item] - | None - | Unset, + Union[ + None, + Unset, + list["UpdateCommunicationsTemplateDataAttributesCommunicationTemplateStagesAttributesType0Item"], + ], data, ) diff --git a/rootly_sdk/models/update_communications_template_data_attributes_communication_template_stages_attributes_type_0_item.py b/rootly_sdk/models/update_communications_template_data_attributes_communication_template_stages_attributes_type_0_item.py index f8491a27..1c8482c1 100644 --- a/rootly_sdk/models/update_communications_template_data_attributes_communication_template_stages_attributes_type_0_item.py +++ b/rootly_sdk/models/update_communications_template_data_attributes_communication_template_stages_attributes_type_0_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,46 +13,46 @@ class UpdateCommunicationsTemplateDataAttributesCommunicationTemplateStagesAttributesType0Item: """ Attributes: - id (None | str | Unset): ID of the communication template stage - sms_content (None | str | Unset): SMS content for the stage - email_subject (None | str | Unset): Email subject for the stage - email_body (None | str | Unset): Email body for the stage - slack_content (None | str | Unset): Slack content for the stage + id (Union[None, Unset, str]): ID of the communication template stage + sms_content (Union[None, Unset, str]): SMS content for the stage + email_subject (Union[None, Unset, str]): Email subject for the stage + email_body (Union[None, Unset, str]): Email body for the stage + slack_content (Union[None, Unset, str]): Slack content for the stage """ - id: None | str | Unset = UNSET - sms_content: None | str | Unset = UNSET - email_subject: None | str | Unset = UNSET - email_body: None | str | Unset = UNSET - slack_content: None | str | Unset = UNSET + id: Union[None, Unset, str] = UNSET + sms_content: Union[None, Unset, str] = UNSET + email_subject: Union[None, Unset, str] = UNSET + email_body: Union[None, Unset, str] = UNSET + slack_content: Union[None, Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id: None | str | Unset + id: Union[None, Unset, str] if isinstance(self.id, Unset): id = UNSET else: id = self.id - sms_content: None | str | Unset + sms_content: Union[None, Unset, str] if isinstance(self.sms_content, Unset): sms_content = UNSET else: sms_content = self.sms_content - email_subject: None | str | Unset + email_subject: Union[None, Unset, str] if isinstance(self.email_subject, Unset): email_subject = UNSET else: email_subject = self.email_subject - email_body: None | str | Unset + email_body: Union[None, Unset, str] if isinstance(self.email_body, Unset): email_body = UNSET else: email_body = self.email_body - slack_content: None | str | Unset + slack_content: Union[None, Unset, str] if isinstance(self.slack_content, Unset): slack_content = UNSET else: @@ -80,48 +78,48 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_id(data: object) -> None | str | Unset: + def _parse_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) id = _parse_id(d.pop("id", UNSET)) - def _parse_sms_content(data: object) -> None | str | Unset: + def _parse_sms_content(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) sms_content = _parse_sms_content(d.pop("sms_content", UNSET)) - def _parse_email_subject(data: object) -> None | str | Unset: + def _parse_email_subject(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) email_subject = _parse_email_subject(d.pop("email_subject", UNSET)) - def _parse_email_body(data: object) -> None | str | Unset: + def _parse_email_body(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) email_body = _parse_email_body(d.pop("email_body", UNSET)) - def _parse_slack_content(data: object) -> None | str | Unset: + def _parse_slack_content(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) slack_content = _parse_slack_content(d.pop("slack_content", UNSET)) diff --git a/rootly_sdk/models/update_communications_type.py b/rootly_sdk/models/update_communications_type.py index 4417e08f..28420815 100644 --- a/rootly_sdk/models/update_communications_type.py +++ b/rootly_sdk/models/update_communications_type.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateCommunicationsType: data (UpdateCommunicationsTypeData): """ - data: UpdateCommunicationsTypeData + data: "UpdateCommunicationsTypeData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_communications_type_data.py b/rootly_sdk/models/update_communications_type_data.py index 8550fb92..c34b23c4 100644 --- a/rootly_sdk/models/update_communications_type_data.py +++ b/rootly_sdk/models/update_communications_type_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class UpdateCommunicationsTypeData: """ type_: UpdateCommunicationsTypeDataType - attributes: UpdateCommunicationsTypeDataAttributes + attributes: "UpdateCommunicationsTypeDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_communications_type_data_attributes.py b/rootly_sdk/models/update_communications_type_data_attributes.py index 9b78ebed..15fbe5ff 100644 --- a/rootly_sdk/models/update_communications_type_data_attributes.py +++ b/rootly_sdk/models/update_communications_type_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -14,33 +12,42 @@ class UpdateCommunicationsTypeDataAttributes: """ Attributes: - name (str | Unset): The name of the communications type - description (None | str | Unset): The description of the communications type - color (None | str | Unset): The color of the communications type - position (int | None | Unset): Position of the communications type + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + name (Union[Unset, str]): The name of the communications type + description (Union[None, Unset, str]): The description of the communications type + color (Union[None, Unset, str]): The color of the communications type + position (Union[None, Unset, int]): Position of the communications type """ - name: str | Unset = UNSET - description: None | str | Unset = UNSET - color: None | str | Unset = UNSET - position: int | None | Unset = UNSET + slug: Union[None, Unset, str] = UNSET + name: Union[Unset, str] = UNSET + description: Union[None, Unset, str] = UNSET + color: Union[None, Unset, str] = UNSET + position: Union[None, Unset, int] = UNSET def to_dict(self) -> dict[str, Any]: + slug: Union[None, Unset, str] + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug + name = self.name - description: None | str | Unset + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: description = self.description - color: None | str | Unset + color: Union[None, Unset, str] if isinstance(self.color, Unset): color = UNSET else: color = self.color - position: int | None | Unset + position: Union[None, Unset, int] if isinstance(self.position, Unset): position = UNSET else: @@ -49,6 +56,8 @@ def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} field_dict.update({}) + if slug is not UNSET: + field_dict["slug"] = slug if name is not UNSET: field_dict["name"] = name if description is not UNSET: @@ -63,36 +72,47 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) + + def _parse_slug(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + slug = _parse_slug(d.pop("slug", UNSET)) + name = d.pop("name", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) - def _parse_color(data: object) -> None | str | Unset: + def _parse_color(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) color = _parse_color(d.pop("color", UNSET)) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> Union[None, Unset, int]: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(Union[None, Unset, int], data) position = _parse_position(d.pop("position", UNSET)) update_communications_type_data_attributes = cls( + slug=slug, name=name, description=description, color=color, diff --git a/rootly_sdk/models/update_confluence_page_task_params.py b/rootly_sdk/models/update_confluence_page_task_params.py index fe6ce985..cf93c06a 100644 --- a/rootly_sdk/models/update_confluence_page_task_params.py +++ b/rootly_sdk/models/update_confluence_page_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -25,37 +23,38 @@ class UpdateConfluencePageTaskParams: """ Attributes: file_id (str): The Confluence page ID - task_type (UpdateConfluencePageTaskParamsTaskType | Unset): - integration (UpdateConfluencePageTaskParamsIntegration | Unset): Specify integration id if you have more than - one Confluence instance - title (str | Unset): The Confluence page title - content (str | Unset): The Confluence page content - post_mortem_template_id (str | Unset): Retrospective template to use when updating page, if desired - template (UpdateConfluencePageTaskParamsTemplate | Unset): The Confluence template to use - include_overview (bool | Unset): Default: True. - include_timeline (bool | Unset): Default: True. + task_type (Union[Unset, UpdateConfluencePageTaskParamsTaskType]): + integration (Union[Unset, UpdateConfluencePageTaskParamsIntegration]): Specify integration id if you have more + than one Confluence instance + title (Union[Unset, str]): The Confluence page title + content (Union[Unset, str]): The Confluence page content + post_mortem_template_id (Union[Unset, str]): Retrospective template to use when updating page, if desired + template (Union[Unset, UpdateConfluencePageTaskParamsTemplate]): The Confluence template to use + include_overview (Union[Unset, bool]): Default: True. + include_timeline (Union[Unset, bool]): Default: True. + include_follow_ups (Union[Unset, bool]): Default: True. """ file_id: str - task_type: UpdateConfluencePageTaskParamsTaskType | Unset = UNSET - integration: UpdateConfluencePageTaskParamsIntegration | Unset = UNSET - title: str | Unset = UNSET - content: str | Unset = UNSET - post_mortem_template_id: str | Unset = UNSET - template: UpdateConfluencePageTaskParamsTemplate | Unset = UNSET - include_overview: bool | Unset = True - include_timeline: bool | Unset = True + task_type: Union[Unset, UpdateConfluencePageTaskParamsTaskType] = UNSET + integration: Union[Unset, "UpdateConfluencePageTaskParamsIntegration"] = UNSET + title: Union[Unset, str] = UNSET + content: Union[Unset, str] = UNSET + post_mortem_template_id: Union[Unset, str] = UNSET + template: Union[Unset, "UpdateConfluencePageTaskParamsTemplate"] = UNSET + include_overview: Union[Unset, bool] = True + include_timeline: Union[Unset, bool] = True + include_follow_ups: Union[Unset, bool] = True additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - file_id = self.file_id - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - integration: dict[str, Any] | Unset = UNSET + integration: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.integration, Unset): integration = self.integration.to_dict() @@ -65,7 +64,7 @@ def to_dict(self) -> dict[str, Any]: post_mortem_template_id = self.post_mortem_template_id - template: dict[str, Any] | Unset = UNSET + template: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.template, Unset): template = self.template.to_dict() @@ -73,6 +72,8 @@ def to_dict(self) -> dict[str, Any]: include_timeline = self.include_timeline + include_follow_ups = self.include_follow_ups + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update( @@ -96,6 +97,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["include_overview"] = include_overview if include_timeline is not UNSET: field_dict["include_timeline"] = include_timeline + if include_follow_ups is not UNSET: + field_dict["include_follow_ups"] = include_follow_ups return field_dict @@ -108,14 +111,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: file_id = d.pop("file_id") _task_type = d.pop("task_type", UNSET) - task_type: UpdateConfluencePageTaskParamsTaskType | Unset + task_type: Union[Unset, UpdateConfluencePageTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: task_type = check_update_confluence_page_task_params_task_type(_task_type) _integration = d.pop("integration", UNSET) - integration: UpdateConfluencePageTaskParamsIntegration | Unset + integration: Union[Unset, UpdateConfluencePageTaskParamsIntegration] if isinstance(_integration, Unset): integration = UNSET else: @@ -128,7 +131,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: post_mortem_template_id = d.pop("post_mortem_template_id", UNSET) _template = d.pop("template", UNSET) - template: UpdateConfluencePageTaskParamsTemplate | Unset + template: Union[Unset, UpdateConfluencePageTaskParamsTemplate] if isinstance(_template, Unset): template = UNSET else: @@ -138,6 +141,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: include_timeline = d.pop("include_timeline", UNSET) + include_follow_ups = d.pop("include_follow_ups", UNSET) + update_confluence_page_task_params = cls( file_id=file_id, task_type=task_type, @@ -148,6 +153,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: template=template, include_overview=include_overview, include_timeline=include_timeline, + include_follow_ups=include_follow_ups, ) update_confluence_page_task_params.additional_properties = d diff --git a/rootly_sdk/models/update_confluence_page_task_params_integration.py b/rootly_sdk/models/update_confluence_page_task_params_integration.py index a1f464df..01e0c6e9 100644 --- a/rootly_sdk/models/update_confluence_page_task_params_integration.py +++ b/rootly_sdk/models/update_confluence_page_task_params_integration.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,12 +14,12 @@ class UpdateConfluencePageTaskParamsIntegration: """Specify integration id if you have more than one Confluence instance Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_confluence_page_task_params_template.py b/rootly_sdk/models/update_confluence_page_task_params_template.py index 8ab06a92..321a6a7b 100644 --- a/rootly_sdk/models/update_confluence_page_task_params_template.py +++ b/rootly_sdk/models/update_confluence_page_task_params_template.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,12 +14,12 @@ class UpdateConfluencePageTaskParamsTemplate: """The Confluence template to use Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_custom_field.py b/rootly_sdk/models/update_custom_field.py index 5ed37956..bf4eb47c 100644 --- a/rootly_sdk/models/update_custom_field.py +++ b/rootly_sdk/models/update_custom_field.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateCustomField: data (UpdateCustomFieldData): """ - data: UpdateCustomFieldData + data: "UpdateCustomFieldData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_custom_field_data.py b/rootly_sdk/models/update_custom_field_data.py index 414bc949..b67f174c 100644 --- a/rootly_sdk/models/update_custom_field_data.py +++ b/rootly_sdk/models/update_custom_field_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class UpdateCustomFieldData: """ type_: UpdateCustomFieldDataType - attributes: UpdateCustomFieldDataAttributes + attributes: "UpdateCustomFieldDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_custom_field_data_attributes.py b/rootly_sdk/models/update_custom_field_data_attributes.py index 2eac8a3a..d163a6da 100644 --- a/rootly_sdk/models/update_custom_field_data_attributes.py +++ b/rootly_sdk/models/update_custom_field_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -22,38 +20,38 @@ class UpdateCustomFieldDataAttributes: """ Attributes: - label (str | Unset): The name of the custom_field - description (None | str | Unset): The description of the custom_field - shown (list[UpdateCustomFieldDataAttributesShownItem] | Unset): - required (list[UpdateCustomFieldDataAttributesRequiredType0Item] | None | Unset): - default (None | str | Unset): The default value for text field kinds - position (int | Unset): The position of the custom_field + label (Union[Unset, str]): The name of the custom_field + description (Union[None, Unset, str]): The description of the custom_field + shown (Union[Unset, list[UpdateCustomFieldDataAttributesShownItem]]): + required (Union[None, Unset, list[UpdateCustomFieldDataAttributesRequiredType0Item]]): + default (Union[None, Unset, str]): The default value for text field kinds + position (Union[Unset, int]): The position of the custom_field """ - label: str | Unset = UNSET - description: None | str | Unset = UNSET - shown: list[UpdateCustomFieldDataAttributesShownItem] | Unset = UNSET - required: list[UpdateCustomFieldDataAttributesRequiredType0Item] | None | Unset = UNSET - default: None | str | Unset = UNSET - position: int | Unset = UNSET + label: Union[Unset, str] = UNSET + description: Union[None, Unset, str] = UNSET + shown: Union[Unset, list[UpdateCustomFieldDataAttributesShownItem]] = UNSET + required: Union[None, Unset, list[UpdateCustomFieldDataAttributesRequiredType0Item]] = UNSET + default: Union[None, Unset, str] = UNSET + position: Union[Unset, int] = UNSET def to_dict(self) -> dict[str, Any]: label = self.label - description: None | str | Unset + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: description = self.description - shown: list[str] | Unset = UNSET + shown: Union[Unset, list[str]] = UNSET if not isinstance(self.shown, Unset): shown = [] for shown_item_data in self.shown: shown_item: str = shown_item_data shown.append(shown_item) - required: list[str] | None | Unset + required: Union[None, Unset, list[str]] if isinstance(self.required, Unset): required = UNSET elif isinstance(self.required, list): @@ -65,7 +63,7 @@ def to_dict(self) -> dict[str, Any]: else: required = self.required - default: None | str | Unset + default: Union[None, Unset, str] if isinstance(self.default, Unset): default = UNSET else: @@ -96,25 +94,23 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) label = d.pop("label", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) + shown = [] _shown = d.pop("shown", UNSET) - shown: list[UpdateCustomFieldDataAttributesShownItem] | Unset = UNSET - if _shown is not UNSET: - shown = [] - for shown_item_data in _shown: - shown_item = check_update_custom_field_data_attributes_shown_item(shown_item_data) + for shown_item_data in _shown or []: + shown_item = check_update_custom_field_data_attributes_shown_item(shown_item_data) - shown.append(shown_item) + shown.append(shown_item) - def _parse_required(data: object) -> list[UpdateCustomFieldDataAttributesRequiredType0Item] | None | Unset: + def _parse_required(data: object) -> Union[None, Unset, list[UpdateCustomFieldDataAttributesRequiredType0Item]]: if data is None: return data if isinstance(data, Unset): @@ -132,18 +128,18 @@ def _parse_required(data: object) -> list[UpdateCustomFieldDataAttributesRequire required_type_0.append(required_type_0_item) return required_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[UpdateCustomFieldDataAttributesRequiredType0Item] | None | Unset, data) + return cast(Union[None, Unset, list[UpdateCustomFieldDataAttributesRequiredType0Item]], data) required = _parse_required(d.pop("required", UNSET)) - def _parse_default(data: object) -> None | str | Unset: + def _parse_default(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) default = _parse_default(d.pop("default", UNSET)) diff --git a/rootly_sdk/models/update_custom_field_option.py b/rootly_sdk/models/update_custom_field_option.py index 52ad39dc..b1be8000 100644 --- a/rootly_sdk/models/update_custom_field_option.py +++ b/rootly_sdk/models/update_custom_field_option.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateCustomFieldOption: data (UpdateCustomFieldOptionData): """ - data: UpdateCustomFieldOptionData + data: "UpdateCustomFieldOptionData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_custom_field_option_data.py b/rootly_sdk/models/update_custom_field_option_data.py index 7320f4a8..3070ade9 100644 --- a/rootly_sdk/models/update_custom_field_option_data.py +++ b/rootly_sdk/models/update_custom_field_option_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class UpdateCustomFieldOptionData: """ type_: UpdateCustomFieldOptionDataType - attributes: UpdateCustomFieldOptionDataAttributes + attributes: "UpdateCustomFieldOptionDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_custom_field_option_data_attributes.py b/rootly_sdk/models/update_custom_field_option_data_attributes.py index 72264d79..e7b3bcd0 100644 --- a/rootly_sdk/models/update_custom_field_option_data_attributes.py +++ b/rootly_sdk/models/update_custom_field_option_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define @@ -14,16 +12,16 @@ class UpdateCustomFieldOptionDataAttributes: """ Attributes: - value (str | Unset): The value of the custom_field_option - color (str | Unset): The hex color of the custom_field_option - default (bool | Unset): - position (int | Unset): The position of the custom_field_option + value (Union[Unset, str]): The value of the custom_field_option + color (Union[Unset, str]): The hex color of the custom_field_option + default (Union[Unset, bool]): + position (Union[Unset, int]): The position of the custom_field_option """ - value: str | Unset = UNSET - color: str | Unset = UNSET - default: bool | Unset = UNSET - position: int | Unset = UNSET + value: Union[Unset, str] = UNSET + color: Union[Unset, str] = UNSET + default: Union[Unset, bool] = UNSET + position: Union[Unset, int] = UNSET def to_dict(self) -> dict[str, Any]: value = self.value diff --git a/rootly_sdk/models/update_custom_form.py b/rootly_sdk/models/update_custom_form.py index 406ac1e0..c207469d 100644 --- a/rootly_sdk/models/update_custom_form.py +++ b/rootly_sdk/models/update_custom_form.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateCustomForm: data (UpdateCustomFormData): """ - data: UpdateCustomFormData + data: "UpdateCustomFormData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_custom_form_data.py b/rootly_sdk/models/update_custom_form_data.py index 73da6a83..bc9577de 100644 --- a/rootly_sdk/models/update_custom_form_data.py +++ b/rootly_sdk/models/update_custom_form_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class UpdateCustomFormData: """ type_: UpdateCustomFormDataType - attributes: UpdateCustomFormDataAttributes + attributes: "UpdateCustomFormDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_custom_form_data_attributes.py b/rootly_sdk/models/update_custom_form_data_attributes.py index 72a3286c..9075d956 100644 --- a/rootly_sdk/models/update_custom_form_data_attributes.py +++ b/rootly_sdk/models/update_custom_form_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -14,21 +12,30 @@ class UpdateCustomFormDataAttributes: """ Attributes: - name (str | Unset): The name of the custom form. - description (None | str | Unset): - enabled (bool | Unset): - command (str | Unset): The Slack command used to trigger this form. + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + name (Union[Unset, str]): The name of the custom form. + description (Union[None, Unset, str]): + enabled (Union[Unset, bool]): + command (Union[Unset, str]): The Slack command used to trigger this form. """ - name: str | Unset = UNSET - description: None | str | Unset = UNSET - enabled: bool | Unset = UNSET - command: str | Unset = UNSET + slug: Union[None, Unset, str] = UNSET + name: Union[Unset, str] = UNSET + description: Union[None, Unset, str] = UNSET + enabled: Union[Unset, bool] = UNSET + command: Union[Unset, str] = UNSET def to_dict(self) -> dict[str, Any]: + slug: Union[None, Unset, str] + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug + name = self.name - description: None | str | Unset + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: @@ -41,6 +48,8 @@ def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} field_dict.update({}) + if slug is not UNSET: + field_dict["slug"] = slug if name is not UNSET: field_dict["name"] = name if description is not UNSET: @@ -55,14 +64,24 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) + + def _parse_slug(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + slug = _parse_slug(d.pop("slug", UNSET)) + name = d.pop("name", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) @@ -71,6 +90,7 @@ def _parse_description(data: object) -> None | str | Unset: command = d.pop("command", UNSET) update_custom_form_data_attributes = cls( + slug=slug, name=name, description=description, enabled=enabled, diff --git a/rootly_sdk/models/update_dashboard.py b/rootly_sdk/models/update_dashboard.py index 1a115d37..cef144c3 100644 --- a/rootly_sdk/models/update_dashboard.py +++ b/rootly_sdk/models/update_dashboard.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateDashboard: data (UpdateDashboardData): """ - data: UpdateDashboardData + data: "UpdateDashboardData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_dashboard_data.py b/rootly_sdk/models/update_dashboard_data.py index 31bbc70c..665ce88f 100644 --- a/rootly_sdk/models/update_dashboard_data.py +++ b/rootly_sdk/models/update_dashboard_data.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -20,21 +18,20 @@ class UpdateDashboardData: """ Attributes: - type_ (UpdateDashboardDataType | Unset): - attributes (UpdateDashboardDataAttributes | Unset): + type_ (Union[Unset, UpdateDashboardDataType]): + attributes (Union[Unset, UpdateDashboardDataAttributes]): """ - type_: UpdateDashboardDataType | Unset = UNSET - attributes: UpdateDashboardDataAttributes | Unset = UNSET + type_: Union[Unset, UpdateDashboardDataType] = UNSET + attributes: Union[Unset, "UpdateDashboardDataAttributes"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - - type_: str | Unset = UNSET + type_: Union[Unset, str] = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ - attributes: dict[str, Any] | Unset = UNSET + attributes: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.attributes, Unset): attributes = self.attributes.to_dict() @@ -54,14 +51,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _type_ = d.pop("type", UNSET) - type_: UpdateDashboardDataType | Unset + type_: Union[Unset, UpdateDashboardDataType] if isinstance(_type_, Unset): type_ = UNSET else: type_ = check_update_dashboard_data_type(_type_) _attributes = d.pop("attributes", UNSET) - attributes: UpdateDashboardDataAttributes | Unset + attributes: Union[Unset, UpdateDashboardDataAttributes] if isinstance(_attributes, Unset): attributes = UNSET else: diff --git a/rootly_sdk/models/update_dashboard_data_attributes.py b/rootly_sdk/models/update_dashboard_data_attributes.py index 71ceb44b..91d6dabd 100644 --- a/rootly_sdk/models/update_dashboard_data_attributes.py +++ b/rootly_sdk/models/update_dashboard_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -26,43 +24,43 @@ class UpdateDashboardDataAttributes: """ Attributes: - name (str | Unset): The name of the dashboard - description (None | str | Unset): The description of the dashboard - owner (UpdateDashboardDataAttributesOwner | Unset): The owner type of the dashboard - public (bool | Unset): Whether the dashboard is public - range_ (None | str | Unset): The date range for dashboard panel data - auto_refresh (bool | Unset): Whether the dashboard auto-updates the UI with new data. - color (UpdateDashboardDataAttributesColor | Unset): The hex color of the dashboard - icon (str | Unset): The emoji icon of the dashboard - period (UpdateDashboardDataAttributesPeriod | Unset): The grouping period for dashboard panel data + name (Union[Unset, str]): The name of the dashboard + description (Union[None, Unset, str]): The description of the dashboard + owner (Union[Unset, UpdateDashboardDataAttributesOwner]): The owner type of the dashboard + public (Union[Unset, bool]): Whether the dashboard is public + range_ (Union[None, Unset, str]): The date range for dashboard panel data + auto_refresh (Union[Unset, bool]): Whether the dashboard auto-updates the UI with new data. + color (Union[Unset, UpdateDashboardDataAttributesColor]): The hex color of the dashboard + icon (Union[Unset, str]): The emoji icon of the dashboard + period (Union[Unset, UpdateDashboardDataAttributesPeriod]): The grouping period for dashboard panel data """ - name: str | Unset = UNSET - description: None | str | Unset = UNSET - owner: UpdateDashboardDataAttributesOwner | Unset = UNSET - public: bool | Unset = UNSET - range_: None | str | Unset = UNSET - auto_refresh: bool | Unset = UNSET - color: UpdateDashboardDataAttributesColor | Unset = UNSET - icon: str | Unset = UNSET - period: UpdateDashboardDataAttributesPeriod | Unset = UNSET + name: Union[Unset, str] = UNSET + description: Union[None, Unset, str] = UNSET + owner: Union[Unset, UpdateDashboardDataAttributesOwner] = UNSET + public: Union[Unset, bool] = UNSET + range_: Union[None, Unset, str] = UNSET + auto_refresh: Union[Unset, bool] = UNSET + color: Union[Unset, UpdateDashboardDataAttributesColor] = UNSET + icon: Union[Unset, str] = UNSET + period: Union[Unset, UpdateDashboardDataAttributesPeriod] = UNSET def to_dict(self) -> dict[str, Any]: name = self.name - description: None | str | Unset + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: description = self.description - owner: str | Unset = UNSET + owner: Union[Unset, str] = UNSET if not isinstance(self.owner, Unset): owner = self.owner public = self.public - range_: None | str | Unset + range_: Union[None, Unset, str] if isinstance(self.range_, Unset): range_ = UNSET else: @@ -70,13 +68,13 @@ def to_dict(self) -> dict[str, Any]: auto_refresh = self.auto_refresh - color: str | Unset = UNSET + color: Union[Unset, str] = UNSET if not isinstance(self.color, Unset): color = self.color icon = self.icon - period: str | Unset = UNSET + period: Union[Unset, str] = UNSET if not isinstance(self.period, Unset): period = self.period @@ -109,17 +107,17 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) _owner = d.pop("owner", UNSET) - owner: UpdateDashboardDataAttributesOwner | Unset + owner: Union[Unset, UpdateDashboardDataAttributesOwner] if isinstance(_owner, Unset): owner = UNSET else: @@ -127,19 +125,19 @@ def _parse_description(data: object) -> None | str | Unset: public = d.pop("public", UNSET) - def _parse_range_(data: object) -> None | str | Unset: + def _parse_range_(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) range_ = _parse_range_(d.pop("range", UNSET)) auto_refresh = d.pop("auto_refresh", UNSET) _color = d.pop("color", UNSET) - color: UpdateDashboardDataAttributesColor | Unset + color: Union[Unset, UpdateDashboardDataAttributesColor] if isinstance(_color, Unset): color = UNSET else: @@ -148,7 +146,7 @@ def _parse_range_(data: object) -> None | str | Unset: icon = d.pop("icon", UNSET) _period = d.pop("period", UNSET) - period: UpdateDashboardDataAttributesPeriod | Unset + period: Union[Unset, UpdateDashboardDataAttributesPeriod] if isinstance(_period, Unset): period = UNSET else: diff --git a/rootly_sdk/models/update_dashboard_panel.py b/rootly_sdk/models/update_dashboard_panel.py index b02e34b4..1d0634fc 100644 --- a/rootly_sdk/models/update_dashboard_panel.py +++ b/rootly_sdk/models/update_dashboard_panel.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateDashboardPanel: data (UpdateDashboardPanelData): """ - data: UpdateDashboardPanelData + data: "UpdateDashboardPanelData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_dashboard_panel_data.py b/rootly_sdk/models/update_dashboard_panel_data.py index 340bba12..867603fc 100644 --- a/rootly_sdk/models/update_dashboard_panel_data.py +++ b/rootly_sdk/models/update_dashboard_panel_data.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,21 +21,20 @@ class UpdateDashboardPanelData: """ Attributes: - type_ (UpdateDashboardPanelDataType | Unset): - attributes (UpdateDashboardPanelDataAttributes | Unset): + type_ (Union[Unset, UpdateDashboardPanelDataType]): + attributes (Union[Unset, UpdateDashboardPanelDataAttributes]): """ - type_: UpdateDashboardPanelDataType | Unset = UNSET - attributes: UpdateDashboardPanelDataAttributes | Unset = UNSET + type_: Union[Unset, UpdateDashboardPanelDataType] = UNSET + attributes: Union[Unset, "UpdateDashboardPanelDataAttributes"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - - type_: str | Unset = UNSET + type_: Union[Unset, str] = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ - attributes: dict[str, Any] | Unset = UNSET + attributes: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.attributes, Unset): attributes = self.attributes.to_dict() @@ -57,14 +54,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _type_ = d.pop("type", UNSET) - type_: UpdateDashboardPanelDataType | Unset + type_: Union[Unset, UpdateDashboardPanelDataType] if isinstance(_type_, Unset): type_ = UNSET else: type_ = check_update_dashboard_panel_data_type(_type_) _attributes = d.pop("attributes", UNSET) - attributes: UpdateDashboardPanelDataAttributes | Unset + attributes: Union[Unset, UpdateDashboardPanelDataAttributes] if isinstance(_attributes, Unset): attributes = UNSET else: diff --git a/rootly_sdk/models/update_dashboard_panel_data_attributes.py b/rootly_sdk/models/update_dashboard_panel_data_attributes.py index 6025a60e..738fd7fa 100644 --- a/rootly_sdk/models/update_dashboard_panel_data_attributes.py +++ b/rootly_sdk/models/update_dashboard_panel_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -21,31 +19,31 @@ class UpdateDashboardPanelDataAttributes: """ Attributes: - name (None | str | Unset): The name of the dashboard_panel - params (UpdateDashboardPanelDataAttributesParams | Unset): - position (None | Unset | UpdateDashboardPanelDataAttributesPositionType0): + name (Union[None, Unset, str]): The name of the dashboard_panel + params (Union[Unset, UpdateDashboardPanelDataAttributesParams]): + position (Union['UpdateDashboardPanelDataAttributesPositionType0', None, Unset]): """ - name: None | str | Unset = UNSET - params: UpdateDashboardPanelDataAttributesParams | Unset = UNSET - position: None | Unset | UpdateDashboardPanelDataAttributesPositionType0 = UNSET + name: Union[None, Unset, str] = UNSET + params: Union[Unset, "UpdateDashboardPanelDataAttributesParams"] = UNSET + position: Union["UpdateDashboardPanelDataAttributesPositionType0", None, Unset] = UNSET def to_dict(self) -> dict[str, Any]: from ..models.update_dashboard_panel_data_attributes_position_type_0 import ( UpdateDashboardPanelDataAttributesPositionType0, ) - name: None | str | Unset + name: Union[None, Unset, str] if isinstance(self.name, Unset): name = UNSET else: name = self.name - params: dict[str, Any] | Unset = UNSET + params: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.params, Unset): params = self.params.to_dict() - position: dict[str, Any] | None | Unset + position: Union[None, Unset, dict[str, Any]] if isinstance(self.position, Unset): position = UNSET elif isinstance(self.position, UpdateDashboardPanelDataAttributesPositionType0): @@ -74,23 +72,23 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_name(data: object) -> None | str | Unset: + def _parse_name(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) name = _parse_name(d.pop("name", UNSET)) _params = d.pop("params", UNSET) - params: UpdateDashboardPanelDataAttributesParams | Unset + params: Union[Unset, UpdateDashboardPanelDataAttributesParams] if isinstance(_params, Unset): params = UNSET else: params = UpdateDashboardPanelDataAttributesParams.from_dict(_params) - def _parse_position(data: object) -> None | Unset | UpdateDashboardPanelDataAttributesPositionType0: + def _parse_position(data: object) -> Union["UpdateDashboardPanelDataAttributesPositionType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -101,9 +99,9 @@ def _parse_position(data: object) -> None | Unset | UpdateDashboardPanelDataAttr position_type_0 = UpdateDashboardPanelDataAttributesPositionType0.from_dict(data) return position_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(None | Unset | UpdateDashboardPanelDataAttributesPositionType0, data) + return cast(Union["UpdateDashboardPanelDataAttributesPositionType0", None, Unset], data) position = _parse_position(d.pop("position", UNSET)) diff --git a/rootly_sdk/models/update_dashboard_panel_data_attributes_params.py b/rootly_sdk/models/update_dashboard_panel_data_attributes_params.py index d67d451b..5afee492 100644 --- a/rootly_sdk/models/update_dashboard_panel_data_attributes_params.py +++ b/rootly_sdk/models/update_dashboard_panel_data_attributes_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -31,43 +29,42 @@ class UpdateDashboardPanelDataAttributesParams: """ Attributes: - display (UpdateDashboardPanelDataAttributesParamsDisplay | Unset): - description (str | Unset): - table_fields (list[str] | Unset): - legend (UpdateDashboardPanelDataAttributesParamsLegend | Unset): - datalabels (UpdateDashboardPanelDataAttributesParamsDatalabels | Unset): - datasets (list[UpdateDashboardPanelDataAttributesParamsDatasetsItem] | Unset): + display (Union[Unset, UpdateDashboardPanelDataAttributesParamsDisplay]): + description (Union[Unset, str]): + table_fields (Union[Unset, list[str]]): + legend (Union[Unset, UpdateDashboardPanelDataAttributesParamsLegend]): + datalabels (Union[Unset, UpdateDashboardPanelDataAttributesParamsDatalabels]): + datasets (Union[Unset, list['UpdateDashboardPanelDataAttributesParamsDatasetsItem']]): """ - display: UpdateDashboardPanelDataAttributesParamsDisplay | Unset = UNSET - description: str | Unset = UNSET - table_fields: list[str] | Unset = UNSET - legend: UpdateDashboardPanelDataAttributesParamsLegend | Unset = UNSET - datalabels: UpdateDashboardPanelDataAttributesParamsDatalabels | Unset = UNSET - datasets: list[UpdateDashboardPanelDataAttributesParamsDatasetsItem] | Unset = UNSET + display: Union[Unset, UpdateDashboardPanelDataAttributesParamsDisplay] = UNSET + description: Union[Unset, str] = UNSET + table_fields: Union[Unset, list[str]] = UNSET + legend: Union[Unset, "UpdateDashboardPanelDataAttributesParamsLegend"] = UNSET + datalabels: Union[Unset, "UpdateDashboardPanelDataAttributesParamsDatalabels"] = UNSET + datasets: Union[Unset, list["UpdateDashboardPanelDataAttributesParamsDatasetsItem"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - - display: str | Unset = UNSET + display: Union[Unset, str] = UNSET if not isinstance(self.display, Unset): display = self.display description = self.description - table_fields: list[str] | Unset = UNSET + table_fields: Union[Unset, list[str]] = UNSET if not isinstance(self.table_fields, Unset): table_fields = self.table_fields - legend: dict[str, Any] | Unset = UNSET + legend: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.legend, Unset): legend = self.legend.to_dict() - datalabels: dict[str, Any] | Unset = UNSET + datalabels: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.datalabels, Unset): datalabels = self.datalabels.to_dict() - datasets: list[dict[str, Any]] | Unset = UNSET + datasets: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.datasets, Unset): datasets = [] for datasets_item_data in self.datasets: @@ -106,7 +103,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _display = d.pop("display", UNSET) - display: UpdateDashboardPanelDataAttributesParamsDisplay | Unset + display: Union[Unset, UpdateDashboardPanelDataAttributesParamsDisplay] if isinstance(_display, Unset): display = UNSET else: @@ -117,27 +114,25 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: table_fields = cast(list[str], d.pop("table_fields", UNSET)) _legend = d.pop("legend", UNSET) - legend: UpdateDashboardPanelDataAttributesParamsLegend | Unset + legend: Union[Unset, UpdateDashboardPanelDataAttributesParamsLegend] if isinstance(_legend, Unset): legend = UNSET else: legend = UpdateDashboardPanelDataAttributesParamsLegend.from_dict(_legend) _datalabels = d.pop("datalabels", UNSET) - datalabels: UpdateDashboardPanelDataAttributesParamsDatalabels | Unset + datalabels: Union[Unset, UpdateDashboardPanelDataAttributesParamsDatalabels] if isinstance(_datalabels, Unset): datalabels = UNSET else: datalabels = UpdateDashboardPanelDataAttributesParamsDatalabels.from_dict(_datalabels) + datasets = [] _datasets = d.pop("datasets", UNSET) - datasets: list[UpdateDashboardPanelDataAttributesParamsDatasetsItem] | Unset = UNSET - if _datasets is not UNSET: - datasets = [] - for datasets_item_data in _datasets: - datasets_item = UpdateDashboardPanelDataAttributesParamsDatasetsItem.from_dict(datasets_item_data) + for datasets_item_data in _datasets or []: + datasets_item = UpdateDashboardPanelDataAttributesParamsDatasetsItem.from_dict(datasets_item_data) - datasets.append(datasets_item) + datasets.append(datasets_item) update_dashboard_panel_data_attributes_params = cls( display=display, diff --git a/rootly_sdk/models/update_dashboard_panel_data_attributes_params_datalabels.py b/rootly_sdk/models/update_dashboard_panel_data_attributes_params_datalabels.py index 0c83750e..62d0be8d 100644 --- a/rootly_sdk/models/update_dashboard_panel_data_attributes_params_datalabels.py +++ b/rootly_sdk/models/update_dashboard_panel_data_attributes_params_datalabels.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,10 +13,10 @@ class UpdateDashboardPanelDataAttributesParamsDatalabels: """ Attributes: - enabled (bool | Unset): + enabled (Union[Unset, bool]): """ - enabled: bool | Unset = UNSET + enabled: Union[Unset, bool] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_dashboard_panel_data_attributes_params_datasets_item.py b/rootly_sdk/models/update_dashboard_panel_data_attributes_params_datasets_item.py index 49dd7014..2977680e 100644 --- a/rootly_sdk/models/update_dashboard_panel_data_attributes_params_datasets_item.py +++ b/rootly_sdk/models/update_dashboard_panel_data_attributes_params_datasets_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -31,18 +29,18 @@ class UpdateDashboardPanelDataAttributesParamsDatasetsItem: """ Attributes: - name (None | str | Unset): - collection (UpdateDashboardPanelDataAttributesParamsDatasetsItemCollection | Unset): - filter_ (list[UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItem] | Unset): - group_by (None | str | Unset | UpdateDashboardPanelDataAttributesParamsDatasetsItemGroupByType1Type0): - aggregate (None | Unset | UpdateDashboardPanelDataAttributesParamsDatasetsItemAggregateType0): + name (Union[None, Unset, str]): + collection (Union[Unset, UpdateDashboardPanelDataAttributesParamsDatasetsItemCollection]): + filter_ (Union[Unset, list['UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItem']]): + group_by (Union['UpdateDashboardPanelDataAttributesParamsDatasetsItemGroupByType1Type0', None, Unset, str]): + aggregate (Union['UpdateDashboardPanelDataAttributesParamsDatasetsItemAggregateType0', None, Unset]): """ - name: None | str | Unset = UNSET - collection: UpdateDashboardPanelDataAttributesParamsDatasetsItemCollection | Unset = UNSET - filter_: list[UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItem] | Unset = UNSET - group_by: None | str | Unset | UpdateDashboardPanelDataAttributesParamsDatasetsItemGroupByType1Type0 = UNSET - aggregate: None | Unset | UpdateDashboardPanelDataAttributesParamsDatasetsItemAggregateType0 = UNSET + name: Union[None, Unset, str] = UNSET + collection: Union[Unset, UpdateDashboardPanelDataAttributesParamsDatasetsItemCollection] = UNSET + filter_: Union[Unset, list["UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItem"]] = UNSET + group_by: Union["UpdateDashboardPanelDataAttributesParamsDatasetsItemGroupByType1Type0", None, Unset, str] = UNSET + aggregate: Union["UpdateDashboardPanelDataAttributesParamsDatasetsItemAggregateType0", None, Unset] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -53,24 +51,24 @@ def to_dict(self) -> dict[str, Any]: UpdateDashboardPanelDataAttributesParamsDatasetsItemGroupByType1Type0, ) - name: None | str | Unset + name: Union[None, Unset, str] if isinstance(self.name, Unset): name = UNSET else: name = self.name - collection: str | Unset = UNSET + collection: Union[Unset, str] = UNSET if not isinstance(self.collection, Unset): collection = self.collection - filter_: list[dict[str, Any]] | Unset = UNSET + filter_: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.filter_, Unset): filter_ = [] for filter_item_data in self.filter_: filter_item = filter_item_data.to_dict() filter_.append(filter_item) - group_by: dict[str, Any] | None | str | Unset + group_by: Union[None, Unset, dict[str, Any], str] if isinstance(self.group_by, Unset): group_by = UNSET elif isinstance(self.group_by, UpdateDashboardPanelDataAttributesParamsDatasetsItemGroupByType1Type0): @@ -78,7 +76,7 @@ def to_dict(self) -> dict[str, Any]: else: group_by = self.group_by - aggregate: dict[str, Any] | None | Unset + aggregate: Union[None, Unset, dict[str, Any]] if isinstance(self.aggregate, Unset): aggregate = UNSET elif isinstance(self.aggregate, UpdateDashboardPanelDataAttributesParamsDatasetsItemAggregateType0): @@ -116,34 +114,32 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_name(data: object) -> None | str | Unset: + def _parse_name(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) name = _parse_name(d.pop("name", UNSET)) _collection = d.pop("collection", UNSET) - collection: UpdateDashboardPanelDataAttributesParamsDatasetsItemCollection | Unset + collection: Union[Unset, UpdateDashboardPanelDataAttributesParamsDatasetsItemCollection] if isinstance(_collection, Unset): collection = UNSET else: collection = check_update_dashboard_panel_data_attributes_params_datasets_item_collection(_collection) + filter_ = [] _filter_ = d.pop("filter", UNSET) - filter_: list[UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItem] | Unset = UNSET - if _filter_ is not UNSET: - filter_ = [] - for filter_item_data in _filter_: - filter_item = UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItem.from_dict(filter_item_data) + for filter_item_data in _filter_ or []: + filter_item = UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItem.from_dict(filter_item_data) - filter_.append(filter_item) + filter_.append(filter_item) def _parse_group_by( data: object, - ) -> None | str | Unset | UpdateDashboardPanelDataAttributesParamsDatasetsItemGroupByType1Type0: + ) -> Union["UpdateDashboardPanelDataAttributesParamsDatasetsItemGroupByType1Type0", None, Unset, str]: if data is None: return data if isinstance(data, Unset): @@ -156,17 +152,17 @@ def _parse_group_by( ) return group_by_type_1_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass return cast( - None | str | Unset | UpdateDashboardPanelDataAttributesParamsDatasetsItemGroupByType1Type0, data + Union["UpdateDashboardPanelDataAttributesParamsDatasetsItemGroupByType1Type0", None, Unset, str], data ) group_by = _parse_group_by(d.pop("group_by", UNSET)) def _parse_aggregate( data: object, - ) -> None | Unset | UpdateDashboardPanelDataAttributesParamsDatasetsItemAggregateType0: + ) -> Union["UpdateDashboardPanelDataAttributesParamsDatasetsItemAggregateType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -177,9 +173,9 @@ def _parse_aggregate( aggregate_type_0 = UpdateDashboardPanelDataAttributesParamsDatasetsItemAggregateType0.from_dict(data) return aggregate_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(None | Unset | UpdateDashboardPanelDataAttributesParamsDatasetsItemAggregateType0, data) + return cast(Union["UpdateDashboardPanelDataAttributesParamsDatasetsItemAggregateType0", None, Unset], data) aggregate = _parse_aggregate(d.pop("aggregate", UNSET)) diff --git a/rootly_sdk/models/update_dashboard_panel_data_attributes_params_datasets_item_aggregate_type_0.py b/rootly_sdk/models/update_dashboard_panel_data_attributes_params_datasets_item_aggregate_type_0.py index 4b0c487d..6aee7aac 100644 --- a/rootly_sdk/models/update_dashboard_panel_data_attributes_params_datasets_item_aggregate_type_0.py +++ b/rootly_sdk/models/update_dashboard_panel_data_attributes_params_datasets_item_aggregate_type_0.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,28 +17,28 @@ class UpdateDashboardPanelDataAttributesParamsDatasetsItemAggregateType0: """ Attributes: - operation (UpdateDashboardPanelDataAttributesParamsDatasetsItemAggregateType0Operation | Unset): - key (None | str | Unset): - cumulative (bool | None | Unset): + operation (Union[Unset, UpdateDashboardPanelDataAttributesParamsDatasetsItemAggregateType0Operation]): + key (Union[None, Unset, str]): + cumulative (Union[None, Unset, bool]): """ - operation: UpdateDashboardPanelDataAttributesParamsDatasetsItemAggregateType0Operation | Unset = UNSET - key: None | str | Unset = UNSET - cumulative: bool | None | Unset = UNSET + operation: Union[Unset, UpdateDashboardPanelDataAttributesParamsDatasetsItemAggregateType0Operation] = UNSET + key: Union[None, Unset, str] = UNSET + cumulative: Union[None, Unset, bool] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - operation: str | Unset = UNSET + operation: Union[Unset, str] = UNSET if not isinstance(self.operation, Unset): operation = self.operation - key: None | str | Unset + key: Union[None, Unset, str] if isinstance(self.key, Unset): key = UNSET else: key = self.key - cumulative: bool | None | Unset + cumulative: Union[None, Unset, bool] if isinstance(self.cumulative, Unset): cumulative = UNSET else: @@ -62,7 +60,7 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _operation = d.pop("operation", UNSET) - operation: UpdateDashboardPanelDataAttributesParamsDatasetsItemAggregateType0Operation | Unset + operation: Union[Unset, UpdateDashboardPanelDataAttributesParamsDatasetsItemAggregateType0Operation] if isinstance(_operation, Unset): operation = UNSET else: @@ -70,21 +68,21 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: _operation ) - def _parse_key(data: object) -> None | str | Unset: + def _parse_key(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) key = _parse_key(d.pop("key", UNSET)) - def _parse_cumulative(data: object) -> bool | None | Unset: + def _parse_cumulative(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) cumulative = _parse_cumulative(d.pop("cumulative", UNSET)) diff --git a/rootly_sdk/models/update_dashboard_panel_data_attributes_params_datasets_item_filter_item.py b/rootly_sdk/models/update_dashboard_panel_data_attributes_params_datasets_item_filter_item.py index bb4b5355..952159f0 100644 --- a/rootly_sdk/models/update_dashboard_panel_data_attributes_params_datasets_item_filter_item.py +++ b/rootly_sdk/models/update_dashboard_panel_data_attributes_params_datasets_item_filter_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -25,21 +23,20 @@ class UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItem: """ Attributes: - operation (UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItemOperation | Unset): - rules (list[UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItem] | Unset): + operation (Union[Unset, UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItemOperation]): + rules (Union[Unset, list['UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItem']]): """ - operation: UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItemOperation | Unset = UNSET - rules: list[UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItem] | Unset = UNSET + operation: Union[Unset, UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItemOperation] = UNSET + rules: Union[Unset, list["UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItem"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - - operation: str | Unset = UNSET + operation: Union[Unset, str] = UNSET if not isinstance(self.operation, Unset): operation = self.operation - rules: list[dict[str, Any]] | Unset = UNSET + rules: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.rules, Unset): rules = [] for rules_item_data in self.rules: @@ -64,7 +61,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _operation = d.pop("operation", UNSET) - operation: UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItemOperation | Unset + operation: Union[Unset, UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItemOperation] if isinstance(_operation, Unset): operation = UNSET else: @@ -72,16 +69,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: _operation ) + rules = [] _rules = d.pop("rules", UNSET) - rules: list[UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItem] | Unset = UNSET - if _rules is not UNSET: - rules = [] - for rules_item_data in _rules: - rules_item = UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItem.from_dict( - rules_item_data - ) + for rules_item_data in _rules or []: + rules_item = UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItem.from_dict( + rules_item_data + ) - rules.append(rules_item) + rules.append(rules_item) update_dashboard_panel_data_attributes_params_datasets_item_filter_item = cls( operation=operation, diff --git a/rootly_sdk/models/update_dashboard_panel_data_attributes_params_datasets_item_filter_item_rules_item.py b/rootly_sdk/models/update_dashboard_panel_data_attributes_params_datasets_item_filter_item_rules_item.py index 982897f3..e5489af9 100644 --- a/rootly_sdk/models/update_dashboard_panel_data_attributes_params_datasets_item_filter_item_rules_item.py +++ b/rootly_sdk/models/update_dashboard_panel_data_attributes_params_datasets_item_filter_item_rules_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,24 +21,24 @@ class UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItem: """ Attributes: - operation (UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItemOperation | Unset): - condition (UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItemCondition | Unset): - key (str | Unset): - value (str | Unset): + operation (Union[Unset, UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItemOperation]): + condition (Union[Unset, UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItemCondition]): + key (Union[Unset, str]): + value (Union[Unset, str]): """ - operation: UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItemOperation | Unset = UNSET - condition: UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItemCondition | Unset = UNSET - key: str | Unset = UNSET - value: str | Unset = UNSET + operation: Union[Unset, UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItemOperation] = UNSET + condition: Union[Unset, UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItemCondition] = UNSET + key: Union[Unset, str] = UNSET + value: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - operation: str | Unset = UNSET + operation: Union[Unset, str] = UNSET if not isinstance(self.operation, Unset): operation = self.operation - condition: str | Unset = UNSET + condition: Union[Unset, str] = UNSET if not isinstance(self.condition, Unset): condition = self.condition @@ -66,7 +64,7 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _operation = d.pop("operation", UNSET) - operation: UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItemOperation | Unset + operation: Union[Unset, UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItemOperation] if isinstance(_operation, Unset): operation = UNSET else: @@ -77,7 +75,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: ) _condition = d.pop("condition", UNSET) - condition: UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItemCondition | Unset + condition: Union[Unset, UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItemCondition] if isinstance(_condition, Unset): condition = UNSET else: diff --git a/rootly_sdk/models/update_dashboard_panel_data_attributes_params_datasets_item_group_by_type_1_type_0.py b/rootly_sdk/models/update_dashboard_panel_data_attributes_params_datasets_item_group_by_type_1_type_0.py index b1641d09..aaaba96d 100644 --- a/rootly_sdk/models/update_dashboard_panel_data_attributes_params_datasets_item_group_by_type_1_type_0.py +++ b/rootly_sdk/models/update_dashboard_panel_data_attributes_params_datasets_item_group_by_type_1_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/update_dashboard_panel_data_attributes_params_legend.py b/rootly_sdk/models/update_dashboard_panel_data_attributes_params_legend.py index d9afacec..51cd4d8e 100644 --- a/rootly_sdk/models/update_dashboard_panel_data_attributes_params_legend.py +++ b/rootly_sdk/models/update_dashboard_panel_data_attributes_params_legend.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,14 +17,14 @@ class UpdateDashboardPanelDataAttributesParamsLegend: """ Attributes: - groups (UpdateDashboardPanelDataAttributesParamsLegendGroups | Unset): Default: 'all'. + groups (Union[Unset, UpdateDashboardPanelDataAttributesParamsLegendGroups]): Default: 'all'. """ - groups: UpdateDashboardPanelDataAttributesParamsLegendGroups | Unset = "all" + groups: Union[Unset, UpdateDashboardPanelDataAttributesParamsLegendGroups] = "all" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - groups: str | Unset = UNSET + groups: Union[Unset, str] = UNSET if not isinstance(self.groups, Unset): groups = self.groups @@ -42,7 +40,7 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _groups = d.pop("groups", UNSET) - groups: UpdateDashboardPanelDataAttributesParamsLegendGroups | Unset + groups: Union[Unset, UpdateDashboardPanelDataAttributesParamsLegendGroups] if isinstance(_groups, Unset): groups = UNSET else: diff --git a/rootly_sdk/models/update_dashboard_panel_data_attributes_position_type_0.py b/rootly_sdk/models/update_dashboard_panel_data_attributes_position_type_0.py index 8ce15963..2118c2c0 100644 --- a/rootly_sdk/models/update_dashboard_panel_data_attributes_position_type_0.py +++ b/rootly_sdk/models/update_dashboard_panel_data_attributes_position_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/update_datadog_notebook_task_params.py b/rootly_sdk/models/update_datadog_notebook_task_params.py index 267ccdbc..1dee9c60 100644 --- a/rootly_sdk/models/update_datadog_notebook_task_params.py +++ b/rootly_sdk/models/update_datadog_notebook_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -28,28 +26,27 @@ class UpdateDatadogNotebookTaskParams: """ Attributes: file_id (str): The Datadog notebook ID - task_type (UpdateDatadogNotebookTaskParamsTaskType | Unset): - title (str | Unset): The Datadog notebook title - content (str | Unset): The Datadog notebook content - kind (UpdateDatadogNotebookTaskParamsKind | Unset): The notebook type - post_mortem_template_id (str | Unset): Retrospective template to use when updating notebook, if desired - template (UpdateDatadogNotebookTaskParamsTemplate | Unset): The Datadog notebook template to use + task_type (Union[Unset, UpdateDatadogNotebookTaskParamsTaskType]): + title (Union[Unset, str]): The Datadog notebook title + content (Union[Unset, str]): The Datadog notebook content + kind (Union[Unset, UpdateDatadogNotebookTaskParamsKind]): The notebook type + post_mortem_template_id (Union[Unset, str]): Retrospective template to use when updating notebook, if desired + template (Union[Unset, UpdateDatadogNotebookTaskParamsTemplate]): The Datadog notebook template to use """ file_id: str - task_type: UpdateDatadogNotebookTaskParamsTaskType | Unset = UNSET - title: str | Unset = UNSET - content: str | Unset = UNSET - kind: UpdateDatadogNotebookTaskParamsKind | Unset = UNSET - post_mortem_template_id: str | Unset = UNSET - template: UpdateDatadogNotebookTaskParamsTemplate | Unset = UNSET + task_type: Union[Unset, UpdateDatadogNotebookTaskParamsTaskType] = UNSET + title: Union[Unset, str] = UNSET + content: Union[Unset, str] = UNSET + kind: Union[Unset, UpdateDatadogNotebookTaskParamsKind] = UNSET + post_mortem_template_id: Union[Unset, str] = UNSET + template: Union[Unset, "UpdateDatadogNotebookTaskParamsTemplate"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - file_id = self.file_id - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -57,13 +54,13 @@ def to_dict(self) -> dict[str, Any]: content = self.content - kind: str | Unset = UNSET + kind: Union[Unset, str] = UNSET if not isinstance(self.kind, Unset): kind = self.kind post_mortem_template_id = self.post_mortem_template_id - template: dict[str, Any] | Unset = UNSET + template: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.template, Unset): template = self.template.to_dict() @@ -97,7 +94,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: file_id = d.pop("file_id") _task_type = d.pop("task_type", UNSET) - task_type: UpdateDatadogNotebookTaskParamsTaskType | Unset + task_type: Union[Unset, UpdateDatadogNotebookTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: @@ -108,7 +105,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: content = d.pop("content", UNSET) _kind = d.pop("kind", UNSET) - kind: UpdateDatadogNotebookTaskParamsKind | Unset + kind: Union[Unset, UpdateDatadogNotebookTaskParamsKind] if isinstance(_kind, Unset): kind = UNSET else: @@ -117,7 +114,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: post_mortem_template_id = d.pop("post_mortem_template_id", UNSET) _template = d.pop("template", UNSET) - template: UpdateDatadogNotebookTaskParamsTemplate | Unset + template: Union[Unset, UpdateDatadogNotebookTaskParamsTemplate] if isinstance(_template, Unset): template = UNSET else: diff --git a/rootly_sdk/models/update_datadog_notebook_task_params_template.py b/rootly_sdk/models/update_datadog_notebook_task_params_template.py index 7946ae4c..50db4337 100644 --- a/rootly_sdk/models/update_datadog_notebook_task_params_template.py +++ b/rootly_sdk/models/update_datadog_notebook_task_params_template.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,12 +14,12 @@ class UpdateDatadogNotebookTaskParamsTemplate: """The Datadog notebook template to use Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_dropbox_paper_page_task_params.py b/rootly_sdk/models/update_dropbox_paper_page_task_params.py index 9f31d59e..e252c4ac 100644 --- a/rootly_sdk/models/update_dropbox_paper_page_task_params.py +++ b/rootly_sdk/models/update_dropbox_paper_page_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -20,23 +18,23 @@ class UpdateDropboxPaperPageTaskParams: """ Attributes: file_id (str): The Dropbox Paper document ID - task_type (UpdateDropboxPaperPageTaskParamsTaskType | Unset): - title (str | Unset): The Dropbox Paper document title - content (str | Unset): The Dropbox Paper document content - post_mortem_template_id (str | Unset): Retrospective template to use when updating document, if desired + task_type (Union[Unset, UpdateDropboxPaperPageTaskParamsTaskType]): + title (Union[Unset, str]): The Dropbox Paper document title + content (Union[Unset, str]): The Dropbox Paper document content + post_mortem_template_id (Union[Unset, str]): Retrospective template to use when updating document, if desired """ file_id: str - task_type: UpdateDropboxPaperPageTaskParamsTaskType | Unset = UNSET - title: str | Unset = UNSET - content: str | Unset = UNSET - post_mortem_template_id: str | Unset = UNSET + task_type: Union[Unset, UpdateDropboxPaperPageTaskParamsTaskType] = UNSET + title: Union[Unset, str] = UNSET + content: Union[Unset, str] = UNSET + post_mortem_template_id: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: file_id = self.file_id - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -70,7 +68,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: file_id = d.pop("file_id") _task_type = d.pop("task_type", UNSET) - task_type: UpdateDropboxPaperPageTaskParamsTaskType | Unset + task_type: Union[Unset, UpdateDropboxPaperPageTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/update_edge_connector.py b/rootly_sdk/models/update_edge_connector.py index 34021a42..d3a49f74 100644 --- a/rootly_sdk/models/update_edge_connector.py +++ b/rootly_sdk/models/update_edge_connector.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateEdgeConnector: edge_connector (UpdateEdgeConnectorEdgeConnector): """ - edge_connector: UpdateEdgeConnectorEdgeConnector + edge_connector: "UpdateEdgeConnectorEdgeConnector" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - edge_connector = self.edge_connector.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_edge_connector_action.py b/rootly_sdk/models/update_edge_connector_action.py index d616265c..03595dc3 100644 --- a/rootly_sdk/models/update_edge_connector_action.py +++ b/rootly_sdk/models/update_edge_connector_action.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateEdgeConnectorAction: action (UpdateEdgeConnectorActionAction): """ - action: UpdateEdgeConnectorActionAction + action: "UpdateEdgeConnectorActionAction" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - action = self.action.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_edge_connector_action_action.py b/rootly_sdk/models/update_edge_connector_action_action.py index 43276057..5eaf8755 100644 --- a/rootly_sdk/models/update_edge_connector_action_action.py +++ b/rootly_sdk/models/update_edge_connector_action_action.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,25 +21,24 @@ class UpdateEdgeConnectorActionAction: """ Attributes: - name (str | Unset): - action_type (UpdateEdgeConnectorActionActionActionType | Unset): - metadata (UpdateEdgeConnectorActionActionMetadata | Unset): + name (Union[Unset, str]): + action_type (Union[Unset, UpdateEdgeConnectorActionActionActionType]): + metadata (Union[Unset, UpdateEdgeConnectorActionActionMetadata]): """ - name: str | Unset = UNSET - action_type: UpdateEdgeConnectorActionActionActionType | Unset = UNSET - metadata: UpdateEdgeConnectorActionActionMetadata | Unset = UNSET + name: Union[Unset, str] = UNSET + action_type: Union[Unset, UpdateEdgeConnectorActionActionActionType] = UNSET + metadata: Union[Unset, "UpdateEdgeConnectorActionActionMetadata"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - name = self.name - action_type: str | Unset = UNSET + action_type: Union[Unset, str] = UNSET if not isinstance(self.action_type, Unset): action_type = self.action_type - metadata: dict[str, Any] | Unset = UNSET + metadata: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.metadata, Unset): metadata = self.metadata.to_dict() @@ -65,14 +62,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name = d.pop("name", UNSET) _action_type = d.pop("action_type", UNSET) - action_type: UpdateEdgeConnectorActionActionActionType | Unset + action_type: Union[Unset, UpdateEdgeConnectorActionActionActionType] if isinstance(_action_type, Unset): action_type = UNSET else: action_type = check_update_edge_connector_action_action_action_type(_action_type) _metadata = d.pop("metadata", UNSET) - metadata: UpdateEdgeConnectorActionActionMetadata | Unset + metadata: Union[Unset, UpdateEdgeConnectorActionActionMetadata] if isinstance(_metadata, Unset): metadata = UNSET else: diff --git a/rootly_sdk/models/update_edge_connector_action_action_metadata.py b/rootly_sdk/models/update_edge_connector_action_action_metadata.py index b1551783..0f536a48 100644 --- a/rootly_sdk/models/update_edge_connector_action_action_metadata.py +++ b/rootly_sdk/models/update_edge_connector_action_action_metadata.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,7 +14,6 @@ class UpdateEdgeConnectorActionActionMetadata: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) diff --git a/rootly_sdk/models/update_edge_connector_action_body.py b/rootly_sdk/models/update_edge_connector_action_body.py index e6fff5ab..ec92d9bc 100644 --- a/rootly_sdk/models/update_edge_connector_action_body.py +++ b/rootly_sdk/models/update_edge_connector_action_body.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,15 +17,14 @@ class UpdateEdgeConnectorActionBody: """ Attributes: - action (UpdateEdgeConnectorActionBodyAction | Unset): + action (Union[Unset, UpdateEdgeConnectorActionBodyAction]): """ - action: UpdateEdgeConnectorActionBodyAction | Unset = UNSET + action: Union[Unset, "UpdateEdgeConnectorActionBodyAction"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - - action: dict[str, Any] | Unset = UNSET + action: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.action, Unset): action = self.action.to_dict() @@ -45,7 +42,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _action = d.pop("action", UNSET) - action: UpdateEdgeConnectorActionBodyAction | Unset + action: Union[Unset, UpdateEdgeConnectorActionBodyAction] if isinstance(_action, Unset): action = UNSET else: diff --git a/rootly_sdk/models/update_edge_connector_action_body_action.py b/rootly_sdk/models/update_edge_connector_action_body_action.py index e33acde0..ed704dd0 100644 --- a/rootly_sdk/models/update_edge_connector_action_body_action.py +++ b/rootly_sdk/models/update_edge_connector_action_body_action.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,25 +21,24 @@ class UpdateEdgeConnectorActionBodyAction: """ Attributes: - name (str | Unset): - action_type (UpdateEdgeConnectorActionBodyActionActionType | Unset): - metadata (UpdateEdgeConnectorActionBodyActionMetadata | Unset): + name (Union[Unset, str]): + action_type (Union[Unset, UpdateEdgeConnectorActionBodyActionActionType]): + metadata (Union[Unset, UpdateEdgeConnectorActionBodyActionMetadata]): """ - name: str | Unset = UNSET - action_type: UpdateEdgeConnectorActionBodyActionActionType | Unset = UNSET - metadata: UpdateEdgeConnectorActionBodyActionMetadata | Unset = UNSET + name: Union[Unset, str] = UNSET + action_type: Union[Unset, UpdateEdgeConnectorActionBodyActionActionType] = UNSET + metadata: Union[Unset, "UpdateEdgeConnectorActionBodyActionMetadata"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - name = self.name - action_type: str | Unset = UNSET + action_type: Union[Unset, str] = UNSET if not isinstance(self.action_type, Unset): action_type = self.action_type - metadata: dict[str, Any] | Unset = UNSET + metadata: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.metadata, Unset): metadata = self.metadata.to_dict() @@ -67,14 +64,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name = d.pop("name", UNSET) _action_type = d.pop("action_type", UNSET) - action_type: UpdateEdgeConnectorActionBodyActionActionType | Unset + action_type: Union[Unset, UpdateEdgeConnectorActionBodyActionActionType] if isinstance(_action_type, Unset): action_type = UNSET else: action_type = check_update_edge_connector_action_body_action_action_type(_action_type) _metadata = d.pop("metadata", UNSET) - metadata: UpdateEdgeConnectorActionBodyActionMetadata | Unset + metadata: Union[Unset, UpdateEdgeConnectorActionBodyActionMetadata] if isinstance(_metadata, Unset): metadata = UNSET else: diff --git a/rootly_sdk/models/update_edge_connector_action_body_action_metadata.py b/rootly_sdk/models/update_edge_connector_action_body_action_metadata.py index 091eb2e7..507c8764 100644 --- a/rootly_sdk/models/update_edge_connector_action_body_action_metadata.py +++ b/rootly_sdk/models/update_edge_connector_action_body_action_metadata.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,7 +14,6 @@ class UpdateEdgeConnectorActionBodyActionMetadata: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) diff --git a/rootly_sdk/models/update_edge_connector_body.py b/rootly_sdk/models/update_edge_connector_body.py index 43596b1b..32b92ecf 100644 --- a/rootly_sdk/models/update_edge_connector_body.py +++ b/rootly_sdk/models/update_edge_connector_body.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,15 +17,14 @@ class UpdateEdgeConnectorBody: """ Attributes: - data (UpdateEdgeConnectorBodyData | Unset): + data (Union[Unset, UpdateEdgeConnectorBodyData]): """ - data: UpdateEdgeConnectorBodyData | Unset = UNSET + data: Union[Unset, "UpdateEdgeConnectorBodyData"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - - data: dict[str, Any] | Unset = UNSET + data: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.data, Unset): data = self.data.to_dict() @@ -45,7 +42,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _data = d.pop("data", UNSET) - data: UpdateEdgeConnectorBodyData | Unset + data: Union[Unset, UpdateEdgeConnectorBodyData] if isinstance(_data, Unset): data = UNSET else: diff --git a/rootly_sdk/models/update_edge_connector_body_data.py b/rootly_sdk/models/update_edge_connector_body_data.py index 22b5eb6c..a7aa90ae 100644 --- a/rootly_sdk/models/update_edge_connector_body_data.py +++ b/rootly_sdk/models/update_edge_connector_body_data.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,25 +21,24 @@ class UpdateEdgeConnectorBodyData: """ Attributes: - type_ (UpdateEdgeConnectorBodyDataType | Unset): - id (str | Unset): - attributes (UpdateEdgeConnectorBodyDataAttributes | Unset): + type_ (Union[Unset, UpdateEdgeConnectorBodyDataType]): + id (Union[Unset, str]): + attributes (Union[Unset, UpdateEdgeConnectorBodyDataAttributes]): """ - type_: UpdateEdgeConnectorBodyDataType | Unset = UNSET - id: str | Unset = UNSET - attributes: UpdateEdgeConnectorBodyDataAttributes | Unset = UNSET + type_: Union[Unset, UpdateEdgeConnectorBodyDataType] = UNSET + id: Union[Unset, str] = UNSET + attributes: Union[Unset, "UpdateEdgeConnectorBodyDataAttributes"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - - type_: str | Unset = UNSET + type_: Union[Unset, str] = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ id = self.id - attributes: dict[str, Any] | Unset = UNSET + attributes: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.attributes, Unset): attributes = self.attributes.to_dict() @@ -63,7 +60,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _type_ = d.pop("type", UNSET) - type_: UpdateEdgeConnectorBodyDataType | Unset + type_: Union[Unset, UpdateEdgeConnectorBodyDataType] if isinstance(_type_, Unset): type_ = UNSET else: @@ -72,7 +69,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: id = d.pop("id", UNSET) _attributes = d.pop("attributes", UNSET) - attributes: UpdateEdgeConnectorBodyDataAttributes | Unset + attributes: Union[Unset, UpdateEdgeConnectorBodyDataAttributes] if isinstance(_attributes, Unset): attributes = UNSET else: diff --git a/rootly_sdk/models/update_edge_connector_body_data_attributes.py b/rootly_sdk/models/update_edge_connector_body_data_attributes.py index 6324907b..ae3b14dd 100644 --- a/rootly_sdk/models/update_edge_connector_body_data_attributes.py +++ b/rootly_sdk/models/update_edge_connector_body_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,35 +21,34 @@ class UpdateEdgeConnectorBodyDataAttributes: """ Attributes: - name (str | Unset): - description (str | Unset): - status (UpdateEdgeConnectorBodyDataAttributesStatus | Unset): - subscriptions (list[str] | Unset): - filters (UpdateEdgeConnectorBodyDataAttributesFilters | Unset): Event filters + name (Union[Unset, str]): + description (Union[Unset, str]): + status (Union[Unset, UpdateEdgeConnectorBodyDataAttributesStatus]): + subscriptions (Union[Unset, list[str]]): + filters (Union[Unset, UpdateEdgeConnectorBodyDataAttributesFilters]): Event filters """ - name: str | Unset = UNSET - description: str | Unset = UNSET - status: UpdateEdgeConnectorBodyDataAttributesStatus | Unset = UNSET - subscriptions: list[str] | Unset = UNSET - filters: UpdateEdgeConnectorBodyDataAttributesFilters | Unset = UNSET + name: Union[Unset, str] = UNSET + description: Union[Unset, str] = UNSET + status: Union[Unset, UpdateEdgeConnectorBodyDataAttributesStatus] = UNSET + subscriptions: Union[Unset, list[str]] = UNSET + filters: Union[Unset, "UpdateEdgeConnectorBodyDataAttributesFilters"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - name = self.name description = self.description - status: str | Unset = UNSET + status: Union[Unset, str] = UNSET if not isinstance(self.status, Unset): status = self.status - subscriptions: list[str] | Unset = UNSET + subscriptions: Union[Unset, list[str]] = UNSET if not isinstance(self.subscriptions, Unset): subscriptions = self.subscriptions - filters: dict[str, Any] | Unset = UNSET + filters: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.filters, Unset): filters = self.filters.to_dict() @@ -83,7 +80,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: description = d.pop("description", UNSET) _status = d.pop("status", UNSET) - status: UpdateEdgeConnectorBodyDataAttributesStatus | Unset + status: Union[Unset, UpdateEdgeConnectorBodyDataAttributesStatus] if isinstance(_status, Unset): status = UNSET else: @@ -92,7 +89,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: subscriptions = cast(list[str], d.pop("subscriptions", UNSET)) _filters = d.pop("filters", UNSET) - filters: UpdateEdgeConnectorBodyDataAttributesFilters | Unset + filters: Union[Unset, UpdateEdgeConnectorBodyDataAttributesFilters] if isinstance(_filters, Unset): filters = UNSET else: diff --git a/rootly_sdk/models/update_edge_connector_body_data_attributes_filters.py b/rootly_sdk/models/update_edge_connector_body_data_attributes_filters.py index c6da5ea2..dc0a35cc 100644 --- a/rootly_sdk/models/update_edge_connector_body_data_attributes_filters.py +++ b/rootly_sdk/models/update_edge_connector_body_data_attributes_filters.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,7 +14,6 @@ class UpdateEdgeConnectorBodyDataAttributesFilters: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) diff --git a/rootly_sdk/models/update_edge_connector_edge_connector.py b/rootly_sdk/models/update_edge_connector_edge_connector.py index a2accd57..0923247a 100644 --- a/rootly_sdk/models/update_edge_connector_edge_connector.py +++ b/rootly_sdk/models/update_edge_connector_edge_connector.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,16 +17,16 @@ class UpdateEdgeConnectorEdgeConnector: """ Attributes: - name (str | Unset): - description (str | Unset): - status (UpdateEdgeConnectorEdgeConnectorStatus | Unset): - subscriptions (list[str] | Unset): + name (Union[Unset, str]): + description (Union[Unset, str]): + status (Union[Unset, UpdateEdgeConnectorEdgeConnectorStatus]): + subscriptions (Union[Unset, list[str]]): """ - name: str | Unset = UNSET - description: str | Unset = UNSET - status: UpdateEdgeConnectorEdgeConnectorStatus | Unset = UNSET - subscriptions: list[str] | Unset = UNSET + name: Union[Unset, str] = UNSET + description: Union[Unset, str] = UNSET + status: Union[Unset, UpdateEdgeConnectorEdgeConnectorStatus] = UNSET + subscriptions: Union[Unset, list[str]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -36,11 +34,11 @@ def to_dict(self) -> dict[str, Any]: description = self.description - status: str | Unset = UNSET + status: Union[Unset, str] = UNSET if not isinstance(self.status, Unset): status = self.status - subscriptions: list[str] | Unset = UNSET + subscriptions: Union[Unset, list[str]] = UNSET if not isinstance(self.subscriptions, Unset): subscriptions = self.subscriptions @@ -66,7 +64,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: description = d.pop("description", UNSET) _status = d.pop("status", UNSET) - status: UpdateEdgeConnectorEdgeConnectorStatus | Unset + status: Union[Unset, UpdateEdgeConnectorEdgeConnectorStatus] if isinstance(_status, Unset): status = UNSET else: diff --git a/rootly_sdk/models/update_environment.py b/rootly_sdk/models/update_environment.py index 4983b3f5..0af13434 100644 --- a/rootly_sdk/models/update_environment.py +++ b/rootly_sdk/models/update_environment.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateEnvironment: data (UpdateEnvironmentData): """ - data: UpdateEnvironmentData + data: "UpdateEnvironmentData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_environment_data.py b/rootly_sdk/models/update_environment_data.py index 340dd50b..bb7f5c09 100644 --- a/rootly_sdk/models/update_environment_data.py +++ b/rootly_sdk/models/update_environment_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class UpdateEnvironmentData: """ type_: UpdateEnvironmentDataType - attributes: UpdateEnvironmentDataAttributes + attributes: "UpdateEnvironmentDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_environment_data_attributes.py b/rootly_sdk/models/update_environment_data_attributes.py index f7e478fd..a67e70aa 100644 --- a/rootly_sdk/models/update_environment_data_attributes.py +++ b/rootly_sdk/models/update_environment_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -26,59 +24,75 @@ class UpdateEnvironmentDataAttributes: """ Attributes: - name (str | Unset): The name of the environment - description (None | str | Unset): The description of the environment - color (None | str | Unset): The hex color of the environment - position (int | None | Unset): Position of the environment - external_id (None | str | Unset): The external id associated to this environment - notify_emails (list[str] | None | Unset): Emails to attach to the environment - slack_channels (list[UpdateEnvironmentDataAttributesSlackChannelsType0Item] | None | Unset): Slack Channels - associated with this environment - slack_aliases (list[UpdateEnvironmentDataAttributesSlackAliasesType0Item] | None | Unset): Slack Aliases + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + name (Union[Unset, str]): The name of the environment + description (Union[None, Unset, str]): The description of the environment + public_description (Union[None, Unset, str]): The status page description of the environment + color (Union[None, Unset, str]): The hex color of the environment + position (Union[None, Unset, int]): Position of the environment + external_id (Union[None, Unset, str]): The external id associated to this environment + notify_emails (Union[None, Unset, list[str]]): Emails to attach to the environment + slack_channels (Union[None, Unset, list['UpdateEnvironmentDataAttributesSlackChannelsType0Item']]): Slack + Channels associated with this environment + slack_aliases (Union[None, Unset, list['UpdateEnvironmentDataAttributesSlackAliasesType0Item']]): Slack Aliases associated with this environment - properties (list[UpdateEnvironmentDataAttributesPropertiesItem] | Unset): Array of property values for this - environment. + properties (Union[Unset, list['UpdateEnvironmentDataAttributesPropertiesItem']]): Array of property values for + this environment. """ - name: str | Unset = UNSET - description: None | str | Unset = UNSET - color: None | str | Unset = UNSET - position: int | None | Unset = UNSET - external_id: None | str | Unset = UNSET - notify_emails: list[str] | None | Unset = UNSET - slack_channels: list[UpdateEnvironmentDataAttributesSlackChannelsType0Item] | None | Unset = UNSET - slack_aliases: list[UpdateEnvironmentDataAttributesSlackAliasesType0Item] | None | Unset = UNSET - properties: list[UpdateEnvironmentDataAttributesPropertiesItem] | Unset = UNSET + slug: Union[None, Unset, str] = UNSET + name: Union[Unset, str] = UNSET + description: Union[None, Unset, str] = UNSET + public_description: Union[None, Unset, str] = UNSET + color: Union[None, Unset, str] = UNSET + position: Union[None, Unset, int] = UNSET + external_id: Union[None, Unset, str] = UNSET + notify_emails: Union[None, Unset, list[str]] = UNSET + slack_channels: Union[None, Unset, list["UpdateEnvironmentDataAttributesSlackChannelsType0Item"]] = UNSET + slack_aliases: Union[None, Unset, list["UpdateEnvironmentDataAttributesSlackAliasesType0Item"]] = UNSET + properties: Union[Unset, list["UpdateEnvironmentDataAttributesPropertiesItem"]] = UNSET def to_dict(self) -> dict[str, Any]: + slug: Union[None, Unset, str] + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug name = self.name - description: None | str | Unset + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: description = self.description - color: None | str | Unset + public_description: Union[None, Unset, str] + if isinstance(self.public_description, Unset): + public_description = UNSET + else: + public_description = self.public_description + + color: Union[None, Unset, str] if isinstance(self.color, Unset): color = UNSET else: color = self.color - position: int | None | Unset + position: Union[None, Unset, int] if isinstance(self.position, Unset): position = UNSET else: position = self.position - external_id: None | str | Unset + external_id: Union[None, Unset, str] if isinstance(self.external_id, Unset): external_id = UNSET else: external_id = self.external_id - notify_emails: list[str] | None | Unset + notify_emails: Union[None, Unset, list[str]] if isinstance(self.notify_emails, Unset): notify_emails = UNSET elif isinstance(self.notify_emails, list): @@ -87,7 +101,7 @@ def to_dict(self) -> dict[str, Any]: else: notify_emails = self.notify_emails - slack_channels: list[dict[str, Any]] | None | Unset + slack_channels: Union[None, Unset, list[dict[str, Any]]] if isinstance(self.slack_channels, Unset): slack_channels = UNSET elif isinstance(self.slack_channels, list): @@ -99,7 +113,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_channels = self.slack_channels - slack_aliases: list[dict[str, Any]] | None | Unset + slack_aliases: Union[None, Unset, list[dict[str, Any]]] if isinstance(self.slack_aliases, Unset): slack_aliases = UNSET elif isinstance(self.slack_aliases, list): @@ -111,7 +125,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_aliases = self.slack_aliases - properties: list[dict[str, Any]] | Unset = UNSET + properties: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.properties, Unset): properties = [] for properties_item_data in self.properties: @@ -121,10 +135,14 @@ def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} field_dict.update({}) + if slug is not UNSET: + field_dict["slug"] = slug if name is not UNSET: field_dict["name"] = name if description is not UNSET: field_dict["description"] = description + if public_description is not UNSET: + field_dict["public_description"] = public_description if color is not UNSET: field_dict["color"] = color if position is not UNSET: @@ -155,45 +173,64 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: ) d = dict(src_dict) + + def _parse_slug(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + slug = _parse_slug(d.pop("slug", UNSET)) + name = d.pop("name", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) - def _parse_color(data: object) -> None | str | Unset: + def _parse_public_description(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + public_description = _parse_public_description(d.pop("public_description", UNSET)) + + def _parse_color(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) color = _parse_color(d.pop("color", UNSET)) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> Union[None, Unset, int]: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(Union[None, Unset, int], data) position = _parse_position(d.pop("position", UNSET)) - def _parse_external_id(data: object) -> None | str | Unset: + def _parse_external_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) external_id = _parse_external_id(d.pop("external_id", UNSET)) - def _parse_notify_emails(data: object) -> list[str] | None | Unset: + def _parse_notify_emails(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -204,15 +241,15 @@ def _parse_notify_emails(data: object) -> list[str] | None | Unset: notify_emails_type_0 = cast(list[str], data) return notify_emails_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) notify_emails = _parse_notify_emails(d.pop("notify_emails", UNSET)) def _parse_slack_channels( data: object, - ) -> list[UpdateEnvironmentDataAttributesSlackChannelsType0Item] | None | Unset: + ) -> Union[None, Unset, list["UpdateEnvironmentDataAttributesSlackChannelsType0Item"]]: if data is None: return data if isinstance(data, Unset): @@ -230,15 +267,15 @@ def _parse_slack_channels( slack_channels_type_0.append(slack_channels_type_0_item) return slack_channels_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[UpdateEnvironmentDataAttributesSlackChannelsType0Item] | None | Unset, data) + return cast(Union[None, Unset, list["UpdateEnvironmentDataAttributesSlackChannelsType0Item"]], data) slack_channels = _parse_slack_channels(d.pop("slack_channels", UNSET)) def _parse_slack_aliases( data: object, - ) -> list[UpdateEnvironmentDataAttributesSlackAliasesType0Item] | None | Unset: + ) -> Union[None, Unset, list["UpdateEnvironmentDataAttributesSlackAliasesType0Item"]]: if data is None: return data if isinstance(data, Unset): @@ -256,24 +293,24 @@ def _parse_slack_aliases( slack_aliases_type_0.append(slack_aliases_type_0_item) return slack_aliases_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[UpdateEnvironmentDataAttributesSlackAliasesType0Item] | None | Unset, data) + return cast(Union[None, Unset, list["UpdateEnvironmentDataAttributesSlackAliasesType0Item"]], data) slack_aliases = _parse_slack_aliases(d.pop("slack_aliases", UNSET)) + properties = [] _properties = d.pop("properties", UNSET) - properties: list[UpdateEnvironmentDataAttributesPropertiesItem] | Unset = UNSET - if _properties is not UNSET: - properties = [] - for properties_item_data in _properties: - properties_item = UpdateEnvironmentDataAttributesPropertiesItem.from_dict(properties_item_data) + for properties_item_data in _properties or []: + properties_item = UpdateEnvironmentDataAttributesPropertiesItem.from_dict(properties_item_data) - properties.append(properties_item) + properties.append(properties_item) update_environment_data_attributes = cls( + slug=slug, name=name, description=description, + public_description=public_description, color=color, position=position, external_id=external_id, diff --git a/rootly_sdk/models/update_environment_data_attributes_properties_item.py b/rootly_sdk/models/update_environment_data_attributes_properties_item.py index 555c7a02..c1cc04b9 100644 --- a/rootly_sdk/models/update_environment_data_attributes_properties_item.py +++ b/rootly_sdk/models/update_environment_data_attributes_properties_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/update_environment_data_attributes_slack_aliases_type_0_item.py b/rootly_sdk/models/update_environment_data_attributes_slack_aliases_type_0_item.py index fdc4f9b2..cfadccf4 100644 --- a/rootly_sdk/models/update_environment_data_attributes_slack_aliases_type_0_item.py +++ b/rootly_sdk/models/update_environment_data_attributes_slack_aliases_type_0_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/update_environment_data_attributes_slack_channels_type_0_item.py b/rootly_sdk/models/update_environment_data_attributes_slack_channels_type_0_item.py index 98c9e895..ae4c9d1a 100644 --- a/rootly_sdk/models/update_environment_data_attributes_slack_channels_type_0_item.py +++ b/rootly_sdk/models/update_environment_data_attributes_slack_channels_type_0_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/update_escalation_policy.py b/rootly_sdk/models/update_escalation_policy.py index 9dc8393d..d64a1ba0 100644 --- a/rootly_sdk/models/update_escalation_policy.py +++ b/rootly_sdk/models/update_escalation_policy.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateEscalationPolicy: data (UpdateEscalationPolicyData): """ - data: UpdateEscalationPolicyData + data: "UpdateEscalationPolicyData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_escalation_policy_data.py b/rootly_sdk/models/update_escalation_policy_data.py index 68a98a8b..69dcce30 100644 --- a/rootly_sdk/models/update_escalation_policy_data.py +++ b/rootly_sdk/models/update_escalation_policy_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class UpdateEscalationPolicyData: """ type_: UpdateEscalationPolicyDataType - attributes: UpdateEscalationPolicyDataAttributes + attributes: "UpdateEscalationPolicyDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_escalation_policy_data_attributes.py b/rootly_sdk/models/update_escalation_policy_data_attributes.py index 9cf51994..e4ed13bc 100644 --- a/rootly_sdk/models/update_escalation_policy_data_attributes.py +++ b/rootly_sdk/models/update_escalation_policy_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -20,21 +18,21 @@ class UpdateEscalationPolicyDataAttributes: """ Attributes: - name (str | Unset): The name of the escalation policy - description (None | str | Unset): The description of the escalation policy - repeat_count (int | Unset): The number of times this policy will be executed until someone acknowledges the - alert - group_ids (list[str] | Unset): Associated groups (alerting the group will trigger escalation policy) - service_ids (list[str] | Unset): Associated services (alerting the service will trigger escalation policy) - business_hours (None | Unset | UpdateEscalationPolicyDataAttributesBusinessHoursType0): + name (Union[Unset, str]): The name of the escalation policy + description (Union[None, Unset, str]): The description of the escalation policy + repeat_count (Union[Unset, int]): The number of times this policy will be executed until someone acknowledges + the alert + group_ids (Union[Unset, list[str]]): Associated groups (alerting the group will trigger escalation policy) + service_ids (Union[Unset, list[str]]): Associated services (alerting the service will trigger escalation policy) + business_hours (Union['UpdateEscalationPolicyDataAttributesBusinessHoursType0', None, Unset]): """ - name: str | Unset = UNSET - description: None | str | Unset = UNSET - repeat_count: int | Unset = UNSET - group_ids: list[str] | Unset = UNSET - service_ids: list[str] | Unset = UNSET - business_hours: None | Unset | UpdateEscalationPolicyDataAttributesBusinessHoursType0 = UNSET + name: Union[Unset, str] = UNSET + description: Union[None, Unset, str] = UNSET + repeat_count: Union[Unset, int] = UNSET + group_ids: Union[Unset, list[str]] = UNSET + service_ids: Union[Unset, list[str]] = UNSET + business_hours: Union["UpdateEscalationPolicyDataAttributesBusinessHoursType0", None, Unset] = UNSET def to_dict(self) -> dict[str, Any]: from ..models.update_escalation_policy_data_attributes_business_hours_type_0 import ( @@ -43,7 +41,7 @@ def to_dict(self) -> dict[str, Any]: name = self.name - description: None | str | Unset + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: @@ -51,15 +49,15 @@ def to_dict(self) -> dict[str, Any]: repeat_count = self.repeat_count - group_ids: list[str] | Unset = UNSET + group_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.group_ids, Unset): group_ids = self.group_ids - service_ids: list[str] | Unset = UNSET + service_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.service_ids, Unset): service_ids = self.service_ids - business_hours: dict[str, Any] | None | Unset + business_hours: Union[None, Unset, dict[str, Any]] if isinstance(self.business_hours, Unset): business_hours = UNSET elif isinstance(self.business_hours, UpdateEscalationPolicyDataAttributesBusinessHoursType0): @@ -94,12 +92,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) @@ -111,7 +109,7 @@ def _parse_description(data: object) -> None | str | Unset: def _parse_business_hours( data: object, - ) -> None | Unset | UpdateEscalationPolicyDataAttributesBusinessHoursType0: + ) -> Union["UpdateEscalationPolicyDataAttributesBusinessHoursType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -122,9 +120,9 @@ def _parse_business_hours( business_hours_type_0 = UpdateEscalationPolicyDataAttributesBusinessHoursType0.from_dict(data) return business_hours_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(None | Unset | UpdateEscalationPolicyDataAttributesBusinessHoursType0, data) + return cast(Union["UpdateEscalationPolicyDataAttributesBusinessHoursType0", None, Unset], data) business_hours = _parse_business_hours(d.pop("business_hours", UNSET)) diff --git a/rootly_sdk/models/update_escalation_policy_data_attributes_business_hours_type_0.py b/rootly_sdk/models/update_escalation_policy_data_attributes_business_hours_type_0.py index 08e773d8..309c198d 100644 --- a/rootly_sdk/models/update_escalation_policy_data_attributes_business_hours_type_0.py +++ b/rootly_sdk/models/update_escalation_policy_data_attributes_business_hours_type_0.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,24 +21,26 @@ class UpdateEscalationPolicyDataAttributesBusinessHoursType0: """ Attributes: - time_zone (UpdateEscalationPolicyDataAttributesBusinessHoursType0TimeZone | Unset): Time zone for business hours - days (list[UpdateEscalationPolicyDataAttributesBusinessHoursType0DaysType0Item] | None | Unset): Business days - start_time (None | str | Unset): Start time for business hours (HH:MM) - end_time (None | str | Unset): End time for business hours (HH:MM) + time_zone (Union[Unset, UpdateEscalationPolicyDataAttributesBusinessHoursType0TimeZone]): Time zone for business + hours + days (Union[None, Unset, list[UpdateEscalationPolicyDataAttributesBusinessHoursType0DaysType0Item]]): Business + days + start_time (Union[None, Unset, str]): Start time for business hours (HH:MM) + end_time (Union[None, Unset, str]): End time for business hours (HH:MM) """ - time_zone: UpdateEscalationPolicyDataAttributesBusinessHoursType0TimeZone | Unset = UNSET - days: list[UpdateEscalationPolicyDataAttributesBusinessHoursType0DaysType0Item] | None | Unset = UNSET - start_time: None | str | Unset = UNSET - end_time: None | str | Unset = UNSET + time_zone: Union[Unset, UpdateEscalationPolicyDataAttributesBusinessHoursType0TimeZone] = UNSET + days: Union[None, Unset, list[UpdateEscalationPolicyDataAttributesBusinessHoursType0DaysType0Item]] = UNSET + start_time: Union[None, Unset, str] = UNSET + end_time: Union[None, Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - time_zone: str | Unset = UNSET + time_zone: Union[Unset, str] = UNSET if not isinstance(self.time_zone, Unset): time_zone = self.time_zone - days: list[str] | None | Unset + days: Union[None, Unset, list[str]] if isinstance(self.days, Unset): days = UNSET elif isinstance(self.days, list): @@ -52,13 +52,13 @@ def to_dict(self) -> dict[str, Any]: else: days = self.days - start_time: None | str | Unset + start_time: Union[None, Unset, str] if isinstance(self.start_time, Unset): start_time = UNSET else: start_time = self.start_time - end_time: None | str | Unset + end_time: Union[None, Unset, str] if isinstance(self.end_time, Unset): end_time = UNSET else: @@ -82,7 +82,7 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _time_zone = d.pop("time_zone", UNSET) - time_zone: UpdateEscalationPolicyDataAttributesBusinessHoursType0TimeZone | Unset + time_zone: Union[Unset, UpdateEscalationPolicyDataAttributesBusinessHoursType0TimeZone] if isinstance(_time_zone, Unset): time_zone = UNSET else: @@ -90,7 +90,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: def _parse_days( data: object, - ) -> list[UpdateEscalationPolicyDataAttributesBusinessHoursType0DaysType0Item] | None | Unset: + ) -> Union[None, Unset, list[UpdateEscalationPolicyDataAttributesBusinessHoursType0DaysType0Item]]: if data is None: return data if isinstance(data, Unset): @@ -110,27 +110,29 @@ def _parse_days( days_type_0.append(days_type_0_item) return days_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[UpdateEscalationPolicyDataAttributesBusinessHoursType0DaysType0Item] | None | Unset, data) + return cast( + Union[None, Unset, list[UpdateEscalationPolicyDataAttributesBusinessHoursType0DaysType0Item]], data + ) days = _parse_days(d.pop("days", UNSET)) - def _parse_start_time(data: object) -> None | str | Unset: + def _parse_start_time(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) start_time = _parse_start_time(d.pop("start_time", UNSET)) - def _parse_end_time(data: object) -> None | str | Unset: + def _parse_end_time(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) end_time = _parse_end_time(d.pop("end_time", UNSET)) diff --git a/rootly_sdk/models/update_escalation_policy_level.py b/rootly_sdk/models/update_escalation_policy_level.py index dc0a48ed..4d915225 100644 --- a/rootly_sdk/models/update_escalation_policy_level.py +++ b/rootly_sdk/models/update_escalation_policy_level.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateEscalationPolicyLevel: data (UpdateEscalationPolicyLevelData): """ - data: UpdateEscalationPolicyLevelData + data: "UpdateEscalationPolicyLevelData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_escalation_policy_level_data.py b/rootly_sdk/models/update_escalation_policy_level_data.py index f6369f8e..93386fa0 100644 --- a/rootly_sdk/models/update_escalation_policy_level_data.py +++ b/rootly_sdk/models/update_escalation_policy_level_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class UpdateEscalationPolicyLevelData: """ type_: UpdateEscalationPolicyLevelDataType - attributes: UpdateEscalationPolicyLevelDataAttributes + attributes: "UpdateEscalationPolicyLevelDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_escalation_policy_level_data_attributes.py b/rootly_sdk/models/update_escalation_policy_level_data_attributes.py index b19e19b3..3f37bc30 100644 --- a/rootly_sdk/models/update_escalation_policy_level_data_attributes.py +++ b/rootly_sdk/models/update_escalation_policy_level_data_attributes.py @@ -1,10 +1,16 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define +from ..models.update_escalation_policy_level_data_attributes_paging_strategy_configuration_repeats_mode import ( + UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRepeatsMode, + check_update_escalation_policy_level_data_attributes_paging_strategy_configuration_repeats_mode, +) +from ..models.update_escalation_policy_level_data_attributes_paging_strategy_configuration_rotation_scope import ( + UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRotationScope, + check_update_escalation_policy_level_data_attributes_paging_strategy_configuration_rotation_scope, +) from ..models.update_escalation_policy_level_data_attributes_paging_strategy_configuration_schedule_strategy import ( UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationScheduleStrategy, check_update_escalation_policy_level_data_attributes_paging_strategy_configuration_schedule_strategy, @@ -28,32 +34,50 @@ class UpdateEscalationPolicyLevelDataAttributes: """ Attributes: - delay (int | Unset): Delay before notifying targets in the next Escalation Level. - position (int | Unset): Position of the escalation policy level - escalation_policy_path_id (None | str | Unset): The ID of the dynamic escalation policy path the level will + delay (Union[Unset, int]): Delay before notifying targets in the next Escalation Level. + position (Union[Unset, int]): Position of the escalation policy level + escalation_policy_path_id (Union[None, Unset, str]): The ID of the dynamic escalation policy path the level will belong to. If nothing is specified it will add the level to your default path. - paging_strategy_configuration_strategy - (UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationStrategy | Unset): Default: 'default'. - paging_strategy_configuration_schedule_strategy - (UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationScheduleStrategy | Unset): Default: + paging_strategy_configuration_strategy (Union[Unset, + UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationStrategy]): Default: 'default'. + paging_strategy_configuration_schedule_strategy (Union[Unset, + UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationScheduleStrategy]): Default: 'on_call_only'. - notification_target_params (list[None | - UpdateEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0] | Unset): Escalation level's - notification targets + paging_strategy_configuration_repeats (Union[None, Unset, int]): Number of times to rotate through the roster + (cycle-based round robin). + paging_strategy_configuration_repeats_mode (Union[Unset, + UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRepeatsMode]): Controls how repeats are + interpreted: 'users' pages exactly N users, 'all' pages everyone once. + paging_strategy_configuration_rotation_scope (Union[Unset, + UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRotationScope]): Scope of rotation ordering: + active rotation members only, or entire schedule. + paging_strategy_configuration_page_users_count (Union[None, Unset, int]): Number of users to page at a time + (cycle-based round robin). + notification_target_params (Union[Unset, + list[Union['UpdateEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0', None]]]): Escalation + level's notification targets """ - delay: int | Unset = UNSET - position: int | Unset = UNSET - escalation_policy_path_id: None | str | Unset = UNSET - paging_strategy_configuration_strategy: ( - UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationStrategy | Unset - ) = "default" - paging_strategy_configuration_schedule_strategy: ( - UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationScheduleStrategy | Unset - ) = "on_call_only" - notification_target_params: ( - list[None | UpdateEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0] | Unset - ) = UNSET + delay: Union[Unset, int] = UNSET + position: Union[Unset, int] = UNSET + escalation_policy_path_id: Union[None, Unset, str] = UNSET + paging_strategy_configuration_strategy: Union[ + Unset, UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationStrategy + ] = "default" + paging_strategy_configuration_schedule_strategy: Union[ + Unset, UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationScheduleStrategy + ] = "on_call_only" + paging_strategy_configuration_repeats: Union[None, Unset, int] = UNSET + paging_strategy_configuration_repeats_mode: Union[ + Unset, UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRepeatsMode + ] = UNSET + paging_strategy_configuration_rotation_scope: Union[ + Unset, UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRotationScope + ] = UNSET + paging_strategy_configuration_page_users_count: Union[None, Unset, int] = UNSET + notification_target_params: Union[ + Unset, list[Union["UpdateEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0", None]] + ] = UNSET def to_dict(self) -> dict[str, Any]: from ..models.update_escalation_policy_level_data_attributes_notification_target_params_item_type_0 import ( @@ -64,25 +88,45 @@ def to_dict(self) -> dict[str, Any]: position = self.position - escalation_policy_path_id: None | str | Unset + escalation_policy_path_id: Union[None, Unset, str] if isinstance(self.escalation_policy_path_id, Unset): escalation_policy_path_id = UNSET else: escalation_policy_path_id = self.escalation_policy_path_id - paging_strategy_configuration_strategy: str | Unset = UNSET + paging_strategy_configuration_strategy: Union[Unset, str] = UNSET if not isinstance(self.paging_strategy_configuration_strategy, Unset): paging_strategy_configuration_strategy = self.paging_strategy_configuration_strategy - paging_strategy_configuration_schedule_strategy: str | Unset = UNSET + paging_strategy_configuration_schedule_strategy: Union[Unset, str] = UNSET if not isinstance(self.paging_strategy_configuration_schedule_strategy, Unset): paging_strategy_configuration_schedule_strategy = self.paging_strategy_configuration_schedule_strategy - notification_target_params: list[dict[str, Any] | None] | Unset = UNSET + paging_strategy_configuration_repeats: Union[None, Unset, int] + if isinstance(self.paging_strategy_configuration_repeats, Unset): + paging_strategy_configuration_repeats = UNSET + else: + paging_strategy_configuration_repeats = self.paging_strategy_configuration_repeats + + paging_strategy_configuration_repeats_mode: Union[Unset, str] = UNSET + if not isinstance(self.paging_strategy_configuration_repeats_mode, Unset): + paging_strategy_configuration_repeats_mode = self.paging_strategy_configuration_repeats_mode + + paging_strategy_configuration_rotation_scope: Union[Unset, str] = UNSET + if not isinstance(self.paging_strategy_configuration_rotation_scope, Unset): + paging_strategy_configuration_rotation_scope = self.paging_strategy_configuration_rotation_scope + + paging_strategy_configuration_page_users_count: Union[None, Unset, int] + if isinstance(self.paging_strategy_configuration_page_users_count, Unset): + paging_strategy_configuration_page_users_count = UNSET + else: + paging_strategy_configuration_page_users_count = self.paging_strategy_configuration_page_users_count + + notification_target_params: Union[Unset, list[Union[None, dict[str, Any]]]] = UNSET if not isinstance(self.notification_target_params, Unset): notification_target_params = [] for notification_target_params_item_data in self.notification_target_params: - notification_target_params_item: dict[str, Any] | None + notification_target_params_item: Union[None, dict[str, Any]] if isinstance( notification_target_params_item_data, UpdateEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0, @@ -107,6 +151,16 @@ def to_dict(self) -> dict[str, Any]: field_dict["paging_strategy_configuration_schedule_strategy"] = ( paging_strategy_configuration_schedule_strategy ) + if paging_strategy_configuration_repeats is not UNSET: + field_dict["paging_strategy_configuration_repeats"] = paging_strategy_configuration_repeats + if paging_strategy_configuration_repeats_mode is not UNSET: + field_dict["paging_strategy_configuration_repeats_mode"] = paging_strategy_configuration_repeats_mode + if paging_strategy_configuration_rotation_scope is not UNSET: + field_dict["paging_strategy_configuration_rotation_scope"] = paging_strategy_configuration_rotation_scope + if paging_strategy_configuration_page_users_count is not UNSET: + field_dict["paging_strategy_configuration_page_users_count"] = ( + paging_strategy_configuration_page_users_count + ) if notification_target_params is not UNSET: field_dict["notification_target_params"] = notification_target_params @@ -123,19 +177,19 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: position = d.pop("position", UNSET) - def _parse_escalation_policy_path_id(data: object) -> None | str | Unset: + def _parse_escalation_policy_path_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) escalation_policy_path_id = _parse_escalation_policy_path_id(d.pop("escalation_policy_path_id", UNSET)) _paging_strategy_configuration_strategy = d.pop("paging_strategy_configuration_strategy", UNSET) - paging_strategy_configuration_strategy: ( - UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationStrategy | Unset - ) + paging_strategy_configuration_strategy: Union[ + Unset, UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationStrategy + ] if isinstance(_paging_strategy_configuration_strategy, Unset): paging_strategy_configuration_strategy = UNSET else: @@ -148,9 +202,9 @@ def _parse_escalation_policy_path_id(data: object) -> None | str | Unset: _paging_strategy_configuration_schedule_strategy = d.pop( "paging_strategy_configuration_schedule_strategy", UNSET ) - paging_strategy_configuration_schedule_strategy: ( - UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationScheduleStrategy | Unset - ) + paging_strategy_configuration_schedule_strategy: Union[ + Unset, UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationScheduleStrategy + ] if isinstance(_paging_strategy_configuration_schedule_strategy, Unset): paging_strategy_configuration_schedule_strategy = UNSET else: @@ -160,36 +214,82 @@ def _parse_escalation_policy_path_id(data: object) -> None | str | Unset: ) ) + def _parse_paging_strategy_configuration_repeats(data: object) -> Union[None, Unset, int]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, int], data) + + paging_strategy_configuration_repeats = _parse_paging_strategy_configuration_repeats( + d.pop("paging_strategy_configuration_repeats", UNSET) + ) + + _paging_strategy_configuration_repeats_mode = d.pop("paging_strategy_configuration_repeats_mode", UNSET) + paging_strategy_configuration_repeats_mode: Union[ + Unset, UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRepeatsMode + ] + if isinstance(_paging_strategy_configuration_repeats_mode, Unset): + paging_strategy_configuration_repeats_mode = UNSET + else: + paging_strategy_configuration_repeats_mode = ( + check_update_escalation_policy_level_data_attributes_paging_strategy_configuration_repeats_mode( + _paging_strategy_configuration_repeats_mode + ) + ) + + _paging_strategy_configuration_rotation_scope = d.pop("paging_strategy_configuration_rotation_scope", UNSET) + paging_strategy_configuration_rotation_scope: Union[ + Unset, UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRotationScope + ] + if isinstance(_paging_strategy_configuration_rotation_scope, Unset): + paging_strategy_configuration_rotation_scope = UNSET + else: + paging_strategy_configuration_rotation_scope = ( + check_update_escalation_policy_level_data_attributes_paging_strategy_configuration_rotation_scope( + _paging_strategy_configuration_rotation_scope + ) + ) + + def _parse_paging_strategy_configuration_page_users_count(data: object) -> Union[None, Unset, int]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, int], data) + + paging_strategy_configuration_page_users_count = _parse_paging_strategy_configuration_page_users_count( + d.pop("paging_strategy_configuration_page_users_count", UNSET) + ) + + notification_target_params = [] _notification_target_params = d.pop("notification_target_params", UNSET) - notification_target_params: ( - list[None | UpdateEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0] | Unset - ) = UNSET - if _notification_target_params is not UNSET: - notification_target_params = [] - for notification_target_params_item_data in _notification_target_params: - - def _parse_notification_target_params_item( - data: object, - ) -> None | UpdateEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - notification_target_params_item_type_0 = ( - UpdateEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0.from_dict(data) - ) - - return notification_target_params_item_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | UpdateEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0, data) - - notification_target_params_item = _parse_notification_target_params_item( - notification_target_params_item_data + for notification_target_params_item_data in _notification_target_params or []: + + def _parse_notification_target_params_item( + data: object, + ) -> Union["UpdateEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0", None]: + if data is None: + return data + try: + if not isinstance(data, dict): + raise TypeError() + notification_target_params_item_type_0 = ( + UpdateEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0.from_dict(data) + ) + + return notification_target_params_item_type_0 + except: # noqa: E722 + pass + return cast( + Union["UpdateEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0", None], data ) - notification_target_params.append(notification_target_params_item) + notification_target_params_item = _parse_notification_target_params_item( + notification_target_params_item_data + ) + + notification_target_params.append(notification_target_params_item) update_escalation_policy_level_data_attributes = cls( delay=delay, @@ -197,6 +297,10 @@ def _parse_notification_target_params_item( escalation_policy_path_id=escalation_policy_path_id, paging_strategy_configuration_strategy=paging_strategy_configuration_strategy, paging_strategy_configuration_schedule_strategy=paging_strategy_configuration_schedule_strategy, + paging_strategy_configuration_repeats=paging_strategy_configuration_repeats, + paging_strategy_configuration_repeats_mode=paging_strategy_configuration_repeats_mode, + paging_strategy_configuration_rotation_scope=paging_strategy_configuration_rotation_scope, + paging_strategy_configuration_page_users_count=paging_strategy_configuration_page_users_count, notification_target_params=notification_target_params, ) diff --git a/rootly_sdk/models/update_escalation_policy_level_data_attributes_notification_target_params_item_type_0.py b/rootly_sdk/models/update_escalation_policy_level_data_attributes_notification_target_params_item_type_0.py index 79fdffe0..79130e7d 100644 --- a/rootly_sdk/models/update_escalation_policy_level_data_attributes_notification_target_params_item_type_0.py +++ b/rootly_sdk/models/update_escalation_policy_level_data_attributes_notification_target_params_item_type_0.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -26,13 +24,16 @@ class UpdateEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0 id (str): The ID of notification target type_ (UpdateEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0Type): The type of the notification target - team_members (UpdateEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0TeamMembers | Unset): - For targets with type=team, controls whether to notify admins, all team members, or escalate to team EP. + team_members (Union[Unset, + UpdateEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0TeamMembers]): For targets with + type=team, controls whether to notify admins, all team members, or escalate to team EP. """ id: str type_: UpdateEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0Type - team_members: UpdateEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0TeamMembers | Unset = UNSET + team_members: Union[ + Unset, UpdateEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0TeamMembers + ] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -40,7 +41,7 @@ def to_dict(self) -> dict[str, Any]: type_: str = self.type_ - team_members: str | Unset = UNSET + team_members: Union[Unset, str] = UNSET if not isinstance(self.team_members, Unset): team_members = self.team_members @@ -67,7 +68,9 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: ) _team_members = d.pop("team_members", UNSET) - team_members: UpdateEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0TeamMembers | Unset + team_members: Union[ + Unset, UpdateEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0TeamMembers + ] if isinstance(_team_members, Unset): team_members = UNSET else: diff --git a/rootly_sdk/models/update_escalation_policy_level_data_attributes_paging_strategy_configuration_repeats_mode.py b/rootly_sdk/models/update_escalation_policy_level_data_attributes_paging_strategy_configuration_repeats_mode.py new file mode 100644 index 00000000..f2624ee7 --- /dev/null +++ b/rootly_sdk/models/update_escalation_policy_level_data_attributes_paging_strategy_configuration_repeats_mode.py @@ -0,0 +1,22 @@ +from typing import Literal, cast + +UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRepeatsMode = Literal["all", "users"] + +UPDATE_ESCALATION_POLICY_LEVEL_DATA_ATTRIBUTES_PAGING_STRATEGY_CONFIGURATION_REPEATS_MODE_VALUES: set[ + UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRepeatsMode +] = { + "all", + "users", +} + + +def check_update_escalation_policy_level_data_attributes_paging_strategy_configuration_repeats_mode( + value: str | None, +) -> UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRepeatsMode | None: + if value is None: + return None + if value in UPDATE_ESCALATION_POLICY_LEVEL_DATA_ATTRIBUTES_PAGING_STRATEGY_CONFIGURATION_REPEATS_MODE_VALUES: + return cast(UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRepeatsMode, value) + raise TypeError( + f"Unexpected value {value!r}. Expected one of {UPDATE_ESCALATION_POLICY_LEVEL_DATA_ATTRIBUTES_PAGING_STRATEGY_CONFIGURATION_REPEATS_MODE_VALUES!r}" + ) diff --git a/rootly_sdk/models/update_escalation_policy_level_data_attributes_paging_strategy_configuration_rotation_scope.py b/rootly_sdk/models/update_escalation_policy_level_data_attributes_paging_strategy_configuration_rotation_scope.py new file mode 100644 index 00000000..545a7600 --- /dev/null +++ b/rootly_sdk/models/update_escalation_policy_level_data_attributes_paging_strategy_configuration_rotation_scope.py @@ -0,0 +1,24 @@ +from typing import Literal, cast + +UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRotationScope = Literal[ + "active_rotation", "entire_schedule" +] + +UPDATE_ESCALATION_POLICY_LEVEL_DATA_ATTRIBUTES_PAGING_STRATEGY_CONFIGURATION_ROTATION_SCOPE_VALUES: set[ + UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRotationScope +] = { + "active_rotation", + "entire_schedule", +} + + +def check_update_escalation_policy_level_data_attributes_paging_strategy_configuration_rotation_scope( + value: str | None, +) -> UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRotationScope | None: + if value is None: + return None + if value in UPDATE_ESCALATION_POLICY_LEVEL_DATA_ATTRIBUTES_PAGING_STRATEGY_CONFIGURATION_ROTATION_SCOPE_VALUES: + return cast(UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRotationScope, value) + raise TypeError( + f"Unexpected value {value!r}. Expected one of {UPDATE_ESCALATION_POLICY_LEVEL_DATA_ATTRIBUTES_PAGING_STRATEGY_CONFIGURATION_ROTATION_SCOPE_VALUES!r}" + ) diff --git a/rootly_sdk/models/update_escalation_policy_path.py b/rootly_sdk/models/update_escalation_policy_path.py index b489235a..7eb93c3a 100644 --- a/rootly_sdk/models/update_escalation_policy_path.py +++ b/rootly_sdk/models/update_escalation_policy_path.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateEscalationPolicyPath: data (UpdateEscalationPolicyPathData): """ - data: UpdateEscalationPolicyPathData + data: "UpdateEscalationPolicyPathData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_escalation_policy_path_data.py b/rootly_sdk/models/update_escalation_policy_path_data.py index 99b43f08..b207fa28 100644 --- a/rootly_sdk/models/update_escalation_policy_path_data.py +++ b/rootly_sdk/models/update_escalation_policy_path_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class UpdateEscalationPolicyPathData: """ type_: UpdateEscalationPolicyPathDataType - attributes: UpdateEscalationPolicyPathDataAttributes + attributes: "UpdateEscalationPolicyPathDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes.py index a88712c9..b4b92fd5 100644 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes.py +++ b/rootly_sdk/models/update_escalation_policy_path_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -112,94 +110,101 @@ class UpdateEscalationPolicyPathDataAttributes: """ Attributes: - name (str | Unset): The name of the escalation path - notification_type (UpdateEscalationPolicyPathDataAttributesNotificationType | Unset): Position of the escalation - policy level Default: 'audible'. - path_type (UpdateEscalationPolicyPathDataAttributesPathType | Unset): The type of escalation path. Cannot be - changed after creation. - after_deferral_behavior (UpdateEscalationPolicyPathDataAttributesAfterDeferralBehavior | Unset): What happens - after a deferral path finishes. - after_deferral_path_id (None | str | Unset): The escalation path to execute after this deferral path when + name (Union[Unset, str]): The name of the escalation path + notification_type (Union[Unset, UpdateEscalationPolicyPathDataAttributesNotificationType]): Position of the + escalation policy level Default: 'audible'. + path_type (Union[Unset, UpdateEscalationPolicyPathDataAttributesPathType]): The type of escalation path. Cannot + be changed after creation. + after_deferral_behavior (Union[Unset, UpdateEscalationPolicyPathDataAttributesAfterDeferralBehavior]): What + happens after a deferral path finishes. + after_deferral_path_id (Union[None, Unset, str]): The escalation path to execute after this deferral path when after_deferral_behavior is execute_path. - default (bool | None | Unset): Whether this escalation path is the default path - match_mode (UpdateEscalationPolicyPathDataAttributesMatchMode | Unset): How path rules are matched. Default: - 'match-all-rules'. - position (int | Unset): The position of this path in the paths for this EP. - repeat (bool | None | Unset): Whether this path should be repeated until someone acknowledges the alert - repeat_count (int | None | Unset): The number of times this path will be executed until someone acknowledges the - alert - initial_delay (int | Unset): Initial delay for escalation path in minutes. Maximum 1 week (10080). - rules (list[UpdateEscalationPolicyPathDataAttributesRulesItemType0 | - UpdateEscalationPolicyPathDataAttributesRulesItemType1 | UpdateEscalationPolicyPathDataAttributesRulesItemType2 - | UpdateEscalationPolicyPathDataAttributesRulesItemType3 | - UpdateEscalationPolicyPathDataAttributesRulesItemType4 | UpdateEscalationPolicyPathDataAttributesRulesItemType5 - | UpdateEscalationPolicyPathDataAttributesRulesItemType6 | - UpdateEscalationPolicyPathDataAttributesRulesItemType7 | - UpdateEscalationPolicyPathDataAttributesRulesItemType8Type0 | - UpdateEscalationPolicyPathDataAttributesRulesItemType8Type1 | - UpdateEscalationPolicyPathDataAttributesRulesItemType8Type2 | - UpdateEscalationPolicyPathDataAttributesRulesItemType8Type3 | - UpdateEscalationPolicyPathDataAttributesRulesItemType8Type4 | - UpdateEscalationPolicyPathDataAttributesRulesItemType8Type5 | - UpdateEscalationPolicyPathDataAttributesRulesItemType8Type6 | - UpdateEscalationPolicyPathDataAttributesRulesItemType8Type7 | - UpdateEscalationPolicyPathDataAttributesRulesItemType9Type0 | - UpdateEscalationPolicyPathDataAttributesRulesItemType9Type1 | - UpdateEscalationPolicyPathDataAttributesRulesItemType9Type2 | - UpdateEscalationPolicyPathDataAttributesRulesItemType9Type3 | - UpdateEscalationPolicyPathDataAttributesRulesItemType9Type4 | - UpdateEscalationPolicyPathDataAttributesRulesItemType9Type5 | - UpdateEscalationPolicyPathDataAttributesRulesItemType9Type6 | - UpdateEscalationPolicyPathDataAttributesRulesItemType9Type7] | Unset): Escalation path conditions - time_restriction_time_zone (UpdateEscalationPolicyPathDataAttributesTimeRestrictionTimeZone | Unset): Time zone - used for time restrictions. - time_restrictions (list[UpdateEscalationPolicyPathDataAttributesTimeRestrictionsItem] | Unset): If time + default (Union[None, Unset, bool]): Whether this escalation path is the default path + match_mode (Union[Unset, UpdateEscalationPolicyPathDataAttributesMatchMode]): How path rules are matched. + Default: 'match-all-rules'. + position (Union[Unset, int]): The position of this path in the paths for this EP. + repeat (Union[None, Unset, bool]): Whether this path should be repeated until someone acknowledges the alert + repeat_count (Union[None, Unset, int]): The number of times this path will be executed until someone + acknowledges the alert + initial_delay (Union[Unset, int]): Initial delay for escalation path in minutes. Maximum 1 week (10080). + retrigger_timeout_minutes (Union[None, Unset, int]): Re-trigger acknowledged alerts on this path after N + minutes; null inherits the urgency/workspace default, negative = never. + rules (Union[Unset, list[Union['UpdateEscalationPolicyPathDataAttributesRulesItemType0', + 'UpdateEscalationPolicyPathDataAttributesRulesItemType1', + 'UpdateEscalationPolicyPathDataAttributesRulesItemType2', + 'UpdateEscalationPolicyPathDataAttributesRulesItemType3', + 'UpdateEscalationPolicyPathDataAttributesRulesItemType4', + 'UpdateEscalationPolicyPathDataAttributesRulesItemType5', + 'UpdateEscalationPolicyPathDataAttributesRulesItemType6', + 'UpdateEscalationPolicyPathDataAttributesRulesItemType7', + 'UpdateEscalationPolicyPathDataAttributesRulesItemType8Type0', + 'UpdateEscalationPolicyPathDataAttributesRulesItemType8Type1', + 'UpdateEscalationPolicyPathDataAttributesRulesItemType8Type2', + 'UpdateEscalationPolicyPathDataAttributesRulesItemType8Type3', + 'UpdateEscalationPolicyPathDataAttributesRulesItemType8Type4', + 'UpdateEscalationPolicyPathDataAttributesRulesItemType8Type5', + 'UpdateEscalationPolicyPathDataAttributesRulesItemType8Type6', + 'UpdateEscalationPolicyPathDataAttributesRulesItemType8Type7', + 'UpdateEscalationPolicyPathDataAttributesRulesItemType9Type0', + 'UpdateEscalationPolicyPathDataAttributesRulesItemType9Type1', + 'UpdateEscalationPolicyPathDataAttributesRulesItemType9Type2', + 'UpdateEscalationPolicyPathDataAttributesRulesItemType9Type3', + 'UpdateEscalationPolicyPathDataAttributesRulesItemType9Type4', + 'UpdateEscalationPolicyPathDataAttributesRulesItemType9Type5', + 'UpdateEscalationPolicyPathDataAttributesRulesItemType9Type6', + 'UpdateEscalationPolicyPathDataAttributesRulesItemType9Type7']]]): Escalation path conditions + time_restriction_time_zone (Union[Unset, UpdateEscalationPolicyPathDataAttributesTimeRestrictionTimeZone]): Time + zone used for time restrictions. + time_restrictions (Union[Unset, list['UpdateEscalationPolicyPathDataAttributesTimeRestrictionsItem']]): If time restrictions are set, alerts will follow this path when they arrive within the specified time ranges and meet the rules. """ - name: str | Unset = UNSET - notification_type: UpdateEscalationPolicyPathDataAttributesNotificationType | Unset = "audible" - path_type: UpdateEscalationPolicyPathDataAttributesPathType | Unset = UNSET - after_deferral_behavior: UpdateEscalationPolicyPathDataAttributesAfterDeferralBehavior | Unset = UNSET - after_deferral_path_id: None | str | Unset = UNSET - default: bool | None | Unset = UNSET - match_mode: UpdateEscalationPolicyPathDataAttributesMatchMode | Unset = "match-all-rules" - position: int | Unset = UNSET - repeat: bool | None | Unset = UNSET - repeat_count: int | None | Unset = UNSET - initial_delay: int | Unset = UNSET - rules: ( + name: Union[Unset, str] = UNSET + notification_type: Union[Unset, UpdateEscalationPolicyPathDataAttributesNotificationType] = "audible" + path_type: Union[Unset, UpdateEscalationPolicyPathDataAttributesPathType] = UNSET + after_deferral_behavior: Union[Unset, UpdateEscalationPolicyPathDataAttributesAfterDeferralBehavior] = UNSET + after_deferral_path_id: Union[None, Unset, str] = UNSET + default: Union[None, Unset, bool] = UNSET + match_mode: Union[Unset, UpdateEscalationPolicyPathDataAttributesMatchMode] = "match-all-rules" + position: Union[Unset, int] = UNSET + repeat: Union[None, Unset, bool] = UNSET + repeat_count: Union[None, Unset, int] = UNSET + initial_delay: Union[Unset, int] = UNSET + retrigger_timeout_minutes: Union[None, Unset, int] = UNSET + rules: Union[ + Unset, list[ - UpdateEscalationPolicyPathDataAttributesRulesItemType0 - | UpdateEscalationPolicyPathDataAttributesRulesItemType1 - | UpdateEscalationPolicyPathDataAttributesRulesItemType2 - | UpdateEscalationPolicyPathDataAttributesRulesItemType3 - | UpdateEscalationPolicyPathDataAttributesRulesItemType4 - | UpdateEscalationPolicyPathDataAttributesRulesItemType5 - | UpdateEscalationPolicyPathDataAttributesRulesItemType6 - | UpdateEscalationPolicyPathDataAttributesRulesItemType7 - | UpdateEscalationPolicyPathDataAttributesRulesItemType8Type0 - | UpdateEscalationPolicyPathDataAttributesRulesItemType8Type1 - | UpdateEscalationPolicyPathDataAttributesRulesItemType8Type2 - | UpdateEscalationPolicyPathDataAttributesRulesItemType8Type3 - | UpdateEscalationPolicyPathDataAttributesRulesItemType8Type4 - | UpdateEscalationPolicyPathDataAttributesRulesItemType8Type5 - | UpdateEscalationPolicyPathDataAttributesRulesItemType8Type6 - | UpdateEscalationPolicyPathDataAttributesRulesItemType8Type7 - | UpdateEscalationPolicyPathDataAttributesRulesItemType9Type0 - | UpdateEscalationPolicyPathDataAttributesRulesItemType9Type1 - | UpdateEscalationPolicyPathDataAttributesRulesItemType9Type2 - | UpdateEscalationPolicyPathDataAttributesRulesItemType9Type3 - | UpdateEscalationPolicyPathDataAttributesRulesItemType9Type4 - | UpdateEscalationPolicyPathDataAttributesRulesItemType9Type5 - | UpdateEscalationPolicyPathDataAttributesRulesItemType9Type6 - | UpdateEscalationPolicyPathDataAttributesRulesItemType9Type7 - ] - | Unset - ) = UNSET - time_restriction_time_zone: UpdateEscalationPolicyPathDataAttributesTimeRestrictionTimeZone | Unset = UNSET - time_restrictions: list[UpdateEscalationPolicyPathDataAttributesTimeRestrictionsItem] | Unset = UNSET + Union[ + "UpdateEscalationPolicyPathDataAttributesRulesItemType0", + "UpdateEscalationPolicyPathDataAttributesRulesItemType1", + "UpdateEscalationPolicyPathDataAttributesRulesItemType2", + "UpdateEscalationPolicyPathDataAttributesRulesItemType3", + "UpdateEscalationPolicyPathDataAttributesRulesItemType4", + "UpdateEscalationPolicyPathDataAttributesRulesItemType5", + "UpdateEscalationPolicyPathDataAttributesRulesItemType6", + "UpdateEscalationPolicyPathDataAttributesRulesItemType7", + "UpdateEscalationPolicyPathDataAttributesRulesItemType8Type0", + "UpdateEscalationPolicyPathDataAttributesRulesItemType8Type1", + "UpdateEscalationPolicyPathDataAttributesRulesItemType8Type2", + "UpdateEscalationPolicyPathDataAttributesRulesItemType8Type3", + "UpdateEscalationPolicyPathDataAttributesRulesItemType8Type4", + "UpdateEscalationPolicyPathDataAttributesRulesItemType8Type5", + "UpdateEscalationPolicyPathDataAttributesRulesItemType8Type6", + "UpdateEscalationPolicyPathDataAttributesRulesItemType8Type7", + "UpdateEscalationPolicyPathDataAttributesRulesItemType9Type0", + "UpdateEscalationPolicyPathDataAttributesRulesItemType9Type1", + "UpdateEscalationPolicyPathDataAttributesRulesItemType9Type2", + "UpdateEscalationPolicyPathDataAttributesRulesItemType9Type3", + "UpdateEscalationPolicyPathDataAttributesRulesItemType9Type4", + "UpdateEscalationPolicyPathDataAttributesRulesItemType9Type5", + "UpdateEscalationPolicyPathDataAttributesRulesItemType9Type6", + "UpdateEscalationPolicyPathDataAttributesRulesItemType9Type7", + ] + ], + ] = UNSET + time_restriction_time_zone: Union[Unset, UpdateEscalationPolicyPathDataAttributesTimeRestrictionTimeZone] = UNSET + time_restrictions: Union[Unset, list["UpdateEscalationPolicyPathDataAttributesTimeRestrictionsItem"]] = UNSET def to_dict(self) -> dict[str, Any]: from ..models.update_escalation_policy_path_data_attributes_rules_item_type_0 import ( @@ -274,43 +279,43 @@ def to_dict(self) -> dict[str, Any]: name = self.name - notification_type: str | Unset = UNSET + notification_type: Union[Unset, str] = UNSET if not isinstance(self.notification_type, Unset): notification_type = self.notification_type - path_type: str | Unset = UNSET + path_type: Union[Unset, str] = UNSET if not isinstance(self.path_type, Unset): path_type = self.path_type - after_deferral_behavior: str | Unset = UNSET + after_deferral_behavior: Union[Unset, str] = UNSET if not isinstance(self.after_deferral_behavior, Unset): after_deferral_behavior = self.after_deferral_behavior - after_deferral_path_id: None | str | Unset + after_deferral_path_id: Union[None, Unset, str] if isinstance(self.after_deferral_path_id, Unset): after_deferral_path_id = UNSET else: after_deferral_path_id = self.after_deferral_path_id - default: bool | None | Unset + default: Union[None, Unset, bool] if isinstance(self.default, Unset): default = UNSET else: default = self.default - match_mode: str | Unset = UNSET + match_mode: Union[Unset, str] = UNSET if not isinstance(self.match_mode, Unset): match_mode = self.match_mode position = self.position - repeat: bool | None | Unset + repeat: Union[None, Unset, bool] if isinstance(self.repeat, Unset): repeat = UNSET else: repeat = self.repeat - repeat_count: int | None | Unset + repeat_count: Union[None, Unset, int] if isinstance(self.repeat_count, Unset): repeat_count = UNSET else: @@ -318,7 +323,13 @@ def to_dict(self) -> dict[str, Any]: initial_delay = self.initial_delay - rules: list[dict[str, Any]] | Unset = UNSET + retrigger_timeout_minutes: Union[None, Unset, int] + if isinstance(self.retrigger_timeout_minutes, Unset): + retrigger_timeout_minutes = UNSET + else: + retrigger_timeout_minutes = self.retrigger_timeout_minutes + + rules: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.rules, Unset): rules = [] for rules_item_data in self.rules: @@ -374,11 +385,11 @@ def to_dict(self) -> dict[str, Any]: rules.append(rules_item) - time_restriction_time_zone: str | Unset = UNSET + time_restriction_time_zone: Union[Unset, str] = UNSET if not isinstance(self.time_restriction_time_zone, Unset): time_restriction_time_zone = self.time_restriction_time_zone - time_restrictions: list[dict[str, Any]] | Unset = UNSET + time_restrictions: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.time_restrictions, Unset): time_restrictions = [] for time_restrictions_item_data in self.time_restrictions: @@ -410,6 +421,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["repeat_count"] = repeat_count if initial_delay is not UNSET: field_dict["initial_delay"] = initial_delay + if retrigger_timeout_minutes is not UNSET: + field_dict["retrigger_timeout_minutes"] = retrigger_timeout_minutes if rules is not UNSET: field_dict["rules"] = rules if time_restriction_time_zone is not UNSET: @@ -501,7 +514,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name = d.pop("name", UNSET) _notification_type = d.pop("notification_type", UNSET) - notification_type: UpdateEscalationPolicyPathDataAttributesNotificationType | Unset + notification_type: Union[Unset, UpdateEscalationPolicyPathDataAttributesNotificationType] if isinstance(_notification_type, Unset): notification_type = UNSET else: @@ -510,14 +523,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: ) _path_type = d.pop("path_type", UNSET) - path_type: UpdateEscalationPolicyPathDataAttributesPathType | Unset + path_type: Union[Unset, UpdateEscalationPolicyPathDataAttributesPathType] if isinstance(_path_type, Unset): path_type = UNSET else: path_type = check_update_escalation_policy_path_data_attributes_path_type(_path_type) _after_deferral_behavior = d.pop("after_deferral_behavior", UNSET) - after_deferral_behavior: UpdateEscalationPolicyPathDataAttributesAfterDeferralBehavior | Unset + after_deferral_behavior: Union[Unset, UpdateEscalationPolicyPathDataAttributesAfterDeferralBehavior] if isinstance(_after_deferral_behavior, Unset): after_deferral_behavior = UNSET else: @@ -525,26 +538,26 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: _after_deferral_behavior ) - def _parse_after_deferral_path_id(data: object) -> None | str | Unset: + def _parse_after_deferral_path_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) after_deferral_path_id = _parse_after_deferral_path_id(d.pop("after_deferral_path_id", UNSET)) - def _parse_default(data: object) -> bool | None | Unset: + def _parse_default(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) default = _parse_default(d.pop("default", UNSET)) _match_mode = d.pop("match_mode", UNSET) - match_mode: UpdateEscalationPolicyPathDataAttributesMatchMode | Unset + match_mode: Union[Unset, UpdateEscalationPolicyPathDataAttributesMatchMode] if isinstance(_match_mode, Unset): match_mode = UNSET else: @@ -552,316 +565,293 @@ def _parse_default(data: object) -> bool | None | Unset: position = d.pop("position", UNSET) - def _parse_repeat(data: object) -> bool | None | Unset: + def _parse_repeat(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) repeat = _parse_repeat(d.pop("repeat", UNSET)) - def _parse_repeat_count(data: object) -> int | None | Unset: + def _parse_repeat_count(data: object) -> Union[None, Unset, int]: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(Union[None, Unset, int], data) repeat_count = _parse_repeat_count(d.pop("repeat_count", UNSET)) initial_delay = d.pop("initial_delay", UNSET) + def _parse_retrigger_timeout_minutes(data: object) -> Union[None, Unset, int]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, int], data) + + retrigger_timeout_minutes = _parse_retrigger_timeout_minutes(d.pop("retrigger_timeout_minutes", UNSET)) + + rules = [] _rules = d.pop("rules", UNSET) - rules: ( - list[ - UpdateEscalationPolicyPathDataAttributesRulesItemType0 - | UpdateEscalationPolicyPathDataAttributesRulesItemType1 - | UpdateEscalationPolicyPathDataAttributesRulesItemType2 - | UpdateEscalationPolicyPathDataAttributesRulesItemType3 - | UpdateEscalationPolicyPathDataAttributesRulesItemType4 - | UpdateEscalationPolicyPathDataAttributesRulesItemType5 - | UpdateEscalationPolicyPathDataAttributesRulesItemType6 - | UpdateEscalationPolicyPathDataAttributesRulesItemType7 - | UpdateEscalationPolicyPathDataAttributesRulesItemType8Type0 - | UpdateEscalationPolicyPathDataAttributesRulesItemType8Type1 - | UpdateEscalationPolicyPathDataAttributesRulesItemType8Type2 - | UpdateEscalationPolicyPathDataAttributesRulesItemType8Type3 - | UpdateEscalationPolicyPathDataAttributesRulesItemType8Type4 - | UpdateEscalationPolicyPathDataAttributesRulesItemType8Type5 - | UpdateEscalationPolicyPathDataAttributesRulesItemType8Type6 - | UpdateEscalationPolicyPathDataAttributesRulesItemType8Type7 - | UpdateEscalationPolicyPathDataAttributesRulesItemType9Type0 - | UpdateEscalationPolicyPathDataAttributesRulesItemType9Type1 - | UpdateEscalationPolicyPathDataAttributesRulesItemType9Type2 - | UpdateEscalationPolicyPathDataAttributesRulesItemType9Type3 - | UpdateEscalationPolicyPathDataAttributesRulesItemType9Type4 - | UpdateEscalationPolicyPathDataAttributesRulesItemType9Type5 - | UpdateEscalationPolicyPathDataAttributesRulesItemType9Type6 - | UpdateEscalationPolicyPathDataAttributesRulesItemType9Type7 - ] - | Unset - ) = UNSET - if _rules is not UNSET: - rules = [] - for rules_item_data in _rules: - - def _parse_rules_item( - data: object, - ) -> ( - UpdateEscalationPolicyPathDataAttributesRulesItemType0 - | UpdateEscalationPolicyPathDataAttributesRulesItemType1 - | UpdateEscalationPolicyPathDataAttributesRulesItemType2 - | UpdateEscalationPolicyPathDataAttributesRulesItemType3 - | UpdateEscalationPolicyPathDataAttributesRulesItemType4 - | UpdateEscalationPolicyPathDataAttributesRulesItemType5 - | UpdateEscalationPolicyPathDataAttributesRulesItemType6 - | UpdateEscalationPolicyPathDataAttributesRulesItemType7 - | UpdateEscalationPolicyPathDataAttributesRulesItemType8Type0 - | UpdateEscalationPolicyPathDataAttributesRulesItemType8Type1 - | UpdateEscalationPolicyPathDataAttributesRulesItemType8Type2 - | UpdateEscalationPolicyPathDataAttributesRulesItemType8Type3 - | UpdateEscalationPolicyPathDataAttributesRulesItemType8Type4 - | UpdateEscalationPolicyPathDataAttributesRulesItemType8Type5 - | UpdateEscalationPolicyPathDataAttributesRulesItemType8Type6 - | UpdateEscalationPolicyPathDataAttributesRulesItemType8Type7 - | UpdateEscalationPolicyPathDataAttributesRulesItemType9Type0 - | UpdateEscalationPolicyPathDataAttributesRulesItemType9Type1 - | UpdateEscalationPolicyPathDataAttributesRulesItemType9Type2 - | UpdateEscalationPolicyPathDataAttributesRulesItemType9Type3 - | UpdateEscalationPolicyPathDataAttributesRulesItemType9Type4 - | UpdateEscalationPolicyPathDataAttributesRulesItemType9Type5 - | UpdateEscalationPolicyPathDataAttributesRulesItemType9Type6 - | UpdateEscalationPolicyPathDataAttributesRulesItemType9Type7 - ): - try: - if not isinstance(data, dict): - raise TypeError() - rules_item_type_0 = UpdateEscalationPolicyPathDataAttributesRulesItemType0.from_dict(data) - - return rules_item_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - rules_item_type_1 = UpdateEscalationPolicyPathDataAttributesRulesItemType1.from_dict(data) - - return rules_item_type_1 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - rules_item_type_2 = UpdateEscalationPolicyPathDataAttributesRulesItemType2.from_dict(data) - - return rules_item_type_2 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - rules_item_type_3 = UpdateEscalationPolicyPathDataAttributesRulesItemType3.from_dict(data) - - return rules_item_type_3 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - rules_item_type_4 = UpdateEscalationPolicyPathDataAttributesRulesItemType4.from_dict(data) - - return rules_item_type_4 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - rules_item_type_5 = UpdateEscalationPolicyPathDataAttributesRulesItemType5.from_dict(data) - - return rules_item_type_5 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - rules_item_type_6 = UpdateEscalationPolicyPathDataAttributesRulesItemType6.from_dict(data) - - return rules_item_type_6 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - rules_item_type_7 = UpdateEscalationPolicyPathDataAttributesRulesItemType7.from_dict(data) - - return rules_item_type_7 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - rules_item_type_8_type_0 = ( - UpdateEscalationPolicyPathDataAttributesRulesItemType8Type0.from_dict(data) - ) - - return rules_item_type_8_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - rules_item_type_8_type_1 = ( - UpdateEscalationPolicyPathDataAttributesRulesItemType8Type1.from_dict(data) - ) - - return rules_item_type_8_type_1 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - rules_item_type_8_type_2 = ( - UpdateEscalationPolicyPathDataAttributesRulesItemType8Type2.from_dict(data) - ) - - return rules_item_type_8_type_2 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - rules_item_type_8_type_3 = ( - UpdateEscalationPolicyPathDataAttributesRulesItemType8Type3.from_dict(data) - ) - - return rules_item_type_8_type_3 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - rules_item_type_8_type_4 = ( - UpdateEscalationPolicyPathDataAttributesRulesItemType8Type4.from_dict(data) - ) - - return rules_item_type_8_type_4 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - rules_item_type_8_type_5 = ( - UpdateEscalationPolicyPathDataAttributesRulesItemType8Type5.from_dict(data) - ) - - return rules_item_type_8_type_5 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - rules_item_type_8_type_6 = ( - UpdateEscalationPolicyPathDataAttributesRulesItemType8Type6.from_dict(data) - ) - - return rules_item_type_8_type_6 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - rules_item_type_8_type_7 = ( - UpdateEscalationPolicyPathDataAttributesRulesItemType8Type7.from_dict(data) - ) - - return rules_item_type_8_type_7 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - rules_item_type_9_type_0 = ( - UpdateEscalationPolicyPathDataAttributesRulesItemType9Type0.from_dict(data) - ) - - return rules_item_type_9_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - rules_item_type_9_type_1 = ( - UpdateEscalationPolicyPathDataAttributesRulesItemType9Type1.from_dict(data) - ) - - return rules_item_type_9_type_1 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - rules_item_type_9_type_2 = ( - UpdateEscalationPolicyPathDataAttributesRulesItemType9Type2.from_dict(data) - ) - - return rules_item_type_9_type_2 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - rules_item_type_9_type_3 = ( - UpdateEscalationPolicyPathDataAttributesRulesItemType9Type3.from_dict(data) - ) - - return rules_item_type_9_type_3 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - rules_item_type_9_type_4 = ( - UpdateEscalationPolicyPathDataAttributesRulesItemType9Type4.from_dict(data) - ) - - return rules_item_type_9_type_4 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - rules_item_type_9_type_5 = ( - UpdateEscalationPolicyPathDataAttributesRulesItemType9Type5.from_dict(data) - ) - - return rules_item_type_9_type_5 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - rules_item_type_9_type_6 = ( - UpdateEscalationPolicyPathDataAttributesRulesItemType9Type6.from_dict(data) - ) - - return rules_item_type_9_type_6 - except (TypeError, ValueError, AttributeError, KeyError): - pass + for rules_item_data in _rules or []: + + def _parse_rules_item( + data: object, + ) -> Union[ + "UpdateEscalationPolicyPathDataAttributesRulesItemType0", + "UpdateEscalationPolicyPathDataAttributesRulesItemType1", + "UpdateEscalationPolicyPathDataAttributesRulesItemType2", + "UpdateEscalationPolicyPathDataAttributesRulesItemType3", + "UpdateEscalationPolicyPathDataAttributesRulesItemType4", + "UpdateEscalationPolicyPathDataAttributesRulesItemType5", + "UpdateEscalationPolicyPathDataAttributesRulesItemType6", + "UpdateEscalationPolicyPathDataAttributesRulesItemType7", + "UpdateEscalationPolicyPathDataAttributesRulesItemType8Type0", + "UpdateEscalationPolicyPathDataAttributesRulesItemType8Type1", + "UpdateEscalationPolicyPathDataAttributesRulesItemType8Type2", + "UpdateEscalationPolicyPathDataAttributesRulesItemType8Type3", + "UpdateEscalationPolicyPathDataAttributesRulesItemType8Type4", + "UpdateEscalationPolicyPathDataAttributesRulesItemType8Type5", + "UpdateEscalationPolicyPathDataAttributesRulesItemType8Type6", + "UpdateEscalationPolicyPathDataAttributesRulesItemType8Type7", + "UpdateEscalationPolicyPathDataAttributesRulesItemType9Type0", + "UpdateEscalationPolicyPathDataAttributesRulesItemType9Type1", + "UpdateEscalationPolicyPathDataAttributesRulesItemType9Type2", + "UpdateEscalationPolicyPathDataAttributesRulesItemType9Type3", + "UpdateEscalationPolicyPathDataAttributesRulesItemType9Type4", + "UpdateEscalationPolicyPathDataAttributesRulesItemType9Type5", + "UpdateEscalationPolicyPathDataAttributesRulesItemType9Type6", + "UpdateEscalationPolicyPathDataAttributesRulesItemType9Type7", + ]: + try: + if not isinstance(data, dict): + raise TypeError() + rules_item_type_0 = UpdateEscalationPolicyPathDataAttributesRulesItemType0.from_dict(data) + + return rules_item_type_0 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + rules_item_type_1 = UpdateEscalationPolicyPathDataAttributesRulesItemType1.from_dict(data) + + return rules_item_type_1 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + rules_item_type_2 = UpdateEscalationPolicyPathDataAttributesRulesItemType2.from_dict(data) + + return rules_item_type_2 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + rules_item_type_3 = UpdateEscalationPolicyPathDataAttributesRulesItemType3.from_dict(data) + + return rules_item_type_3 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + rules_item_type_4 = UpdateEscalationPolicyPathDataAttributesRulesItemType4.from_dict(data) + + return rules_item_type_4 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + rules_item_type_5 = UpdateEscalationPolicyPathDataAttributesRulesItemType5.from_dict(data) + + return rules_item_type_5 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + rules_item_type_6 = UpdateEscalationPolicyPathDataAttributesRulesItemType6.from_dict(data) + + return rules_item_type_6 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + rules_item_type_7 = UpdateEscalationPolicyPathDataAttributesRulesItemType7.from_dict(data) + + return rules_item_type_7 + except: # noqa: E722 + pass + try: if not isinstance(data, dict): raise TypeError() - rules_item_type_9_type_7 = UpdateEscalationPolicyPathDataAttributesRulesItemType9Type7.from_dict( + rules_item_type_8_type_0 = UpdateEscalationPolicyPathDataAttributesRulesItemType8Type0.from_dict( data ) - return rules_item_type_9_type_7 + return rules_item_type_8_type_0 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + rules_item_type_8_type_1 = UpdateEscalationPolicyPathDataAttributesRulesItemType8Type1.from_dict( + data + ) + + return rules_item_type_8_type_1 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + rules_item_type_8_type_2 = UpdateEscalationPolicyPathDataAttributesRulesItemType8Type2.from_dict( + data + ) - rules_item = _parse_rules_item(rules_item_data) + return rules_item_type_8_type_2 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + rules_item_type_8_type_3 = UpdateEscalationPolicyPathDataAttributesRulesItemType8Type3.from_dict( + data + ) - rules.append(rules_item) + return rules_item_type_8_type_3 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + rules_item_type_8_type_4 = UpdateEscalationPolicyPathDataAttributesRulesItemType8Type4.from_dict( + data + ) + + return rules_item_type_8_type_4 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + rules_item_type_8_type_5 = UpdateEscalationPolicyPathDataAttributesRulesItemType8Type5.from_dict( + data + ) + + return rules_item_type_8_type_5 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + rules_item_type_8_type_6 = UpdateEscalationPolicyPathDataAttributesRulesItemType8Type6.from_dict( + data + ) + + return rules_item_type_8_type_6 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + rules_item_type_8_type_7 = UpdateEscalationPolicyPathDataAttributesRulesItemType8Type7.from_dict( + data + ) + + return rules_item_type_8_type_7 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + rules_item_type_9_type_0 = UpdateEscalationPolicyPathDataAttributesRulesItemType9Type0.from_dict( + data + ) + + return rules_item_type_9_type_0 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + rules_item_type_9_type_1 = UpdateEscalationPolicyPathDataAttributesRulesItemType9Type1.from_dict( + data + ) + + return rules_item_type_9_type_1 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + rules_item_type_9_type_2 = UpdateEscalationPolicyPathDataAttributesRulesItemType9Type2.from_dict( + data + ) + + return rules_item_type_9_type_2 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + rules_item_type_9_type_3 = UpdateEscalationPolicyPathDataAttributesRulesItemType9Type3.from_dict( + data + ) + + return rules_item_type_9_type_3 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + rules_item_type_9_type_4 = UpdateEscalationPolicyPathDataAttributesRulesItemType9Type4.from_dict( + data + ) + + return rules_item_type_9_type_4 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + rules_item_type_9_type_5 = UpdateEscalationPolicyPathDataAttributesRulesItemType9Type5.from_dict( + data + ) + + return rules_item_type_9_type_5 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + rules_item_type_9_type_6 = UpdateEscalationPolicyPathDataAttributesRulesItemType9Type6.from_dict( + data + ) + + return rules_item_type_9_type_6 + except: # noqa: E722 + pass + if not isinstance(data, dict): + raise TypeError() + rules_item_type_9_type_7 = UpdateEscalationPolicyPathDataAttributesRulesItemType9Type7.from_dict(data) + + return rules_item_type_9_type_7 + + rules_item = _parse_rules_item(rules_item_data) + + rules.append(rules_item) _time_restriction_time_zone = d.pop("time_restriction_time_zone", UNSET) - time_restriction_time_zone: UpdateEscalationPolicyPathDataAttributesTimeRestrictionTimeZone | Unset + time_restriction_time_zone: Union[Unset, UpdateEscalationPolicyPathDataAttributesTimeRestrictionTimeZone] if isinstance(_time_restriction_time_zone, Unset): time_restriction_time_zone = UNSET else: @@ -869,16 +859,14 @@ def _parse_rules_item( _time_restriction_time_zone ) + time_restrictions = [] _time_restrictions = d.pop("time_restrictions", UNSET) - time_restrictions: list[UpdateEscalationPolicyPathDataAttributesTimeRestrictionsItem] | Unset = UNSET - if _time_restrictions is not UNSET: - time_restrictions = [] - for time_restrictions_item_data in _time_restrictions: - time_restrictions_item = UpdateEscalationPolicyPathDataAttributesTimeRestrictionsItem.from_dict( - time_restrictions_item_data - ) + for time_restrictions_item_data in _time_restrictions or []: + time_restrictions_item = UpdateEscalationPolicyPathDataAttributesTimeRestrictionsItem.from_dict( + time_restrictions_item_data + ) - time_restrictions.append(time_restrictions_item) + time_restrictions.append(time_restrictions_item) update_escalation_policy_path_data_attributes = cls( name=name, @@ -892,6 +880,7 @@ def _parse_rules_item( repeat=repeat, repeat_count=repeat_count, initial_delay=initial_delay, + retrigger_timeout_minutes=retrigger_timeout_minutes, rules=rules, time_restriction_time_zone=time_restriction_time_zone, time_restrictions=time_restrictions, diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_0.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_0.py index 43536fa1..91fcac99 100644 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_0.py +++ b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_1.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_1.py index 67efc6ac..b8a8ef1d 100644 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_1.py +++ b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_1.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_2.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_2.py index a3f2a0e2..bd2c5269 100644 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_2.py +++ b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_2.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -26,15 +24,15 @@ class UpdateEscalationPolicyPathDataAttributesRulesItemType2: rule_type (UpdateEscalationPolicyPathDataAttributesRulesItemType2RuleType): The type of the escalation path rule json_path (str): JSON path to extract value from payload operator (UpdateEscalationPolicyPathDataAttributesRulesItemType2Operator): How JSON path value should be matched - value (None | str | Unset): Value with which JSON path value should be matched - values (list[str] | Unset): Values to match against (for is_one_of / is_not_one_of operators) + value (Union[None, Unset, str]): Value with which JSON path value should be matched + values (Union[Unset, list[str]]): Values to match against (for is_one_of / is_not_one_of operators) """ rule_type: UpdateEscalationPolicyPathDataAttributesRulesItemType2RuleType json_path: str operator: UpdateEscalationPolicyPathDataAttributesRulesItemType2Operator - value: None | str | Unset = UNSET - values: list[str] | Unset = UNSET + value: Union[None, Unset, str] = UNSET + values: Union[Unset, list[str]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -44,13 +42,13 @@ def to_dict(self) -> dict[str, Any]: operator: str = self.operator - value: None | str | Unset + value: Union[None, Unset, str] if isinstance(self.value, Unset): value = UNSET else: value = self.value - values: list[str] | Unset = UNSET + values: Union[Unset, list[str]] = UNSET if not isinstance(self.values, Unset): values = self.values @@ -79,12 +77,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: operator = check_update_escalation_policy_path_data_attributes_rules_item_type_2_operator(d.pop("operator")) - def _parse_value(data: object) -> None | str | Unset: + def _parse_value(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) value = _parse_value(d.pop("value", UNSET)) diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_3.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_3.py index d654ba4a..cbcdd9bc 100644 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_3.py +++ b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_3.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -28,14 +26,14 @@ class UpdateEscalationPolicyPathDataAttributesRulesItemType3: fieldable_id (str): The ID of the alert field operator (UpdateEscalationPolicyPathDataAttributesRulesItemType3Operator): How the alert field value should be matched - values (list[str] | Unset): Values to match against + values (Union[Unset, list[str]]): Values to match against """ rule_type: UpdateEscalationPolicyPathDataAttributesRulesItemType3RuleType fieldable_type: str fieldable_id: str operator: UpdateEscalationPolicyPathDataAttributesRulesItemType3Operator - values: list[str] | Unset = UNSET + values: Union[Unset, list[str]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -47,7 +45,7 @@ def to_dict(self) -> dict[str, Any]: operator: str = self.operator - values: list[str] | Unset = UNSET + values: Union[Unset, list[str]] = UNSET if not isinstance(self.values, Unset): values = self.values diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_4.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_4.py index 8e47f315..41b5d14a 100644 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_4.py +++ b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_4.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_5.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_5.py index 34bfdabe..1f1da033 100644 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_5.py +++ b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_5.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -30,17 +28,16 @@ class UpdateEscalationPolicyPathDataAttributesRulesItemType5: Attributes: rule_type (UpdateEscalationPolicyPathDataAttributesRulesItemType5RuleType): The type of the escalation path rule time_zone (UpdateEscalationPolicyPathDataAttributesRulesItemType5TimeZone): Time zone for the deferral window - time_blocks (list[UpdateEscalationPolicyPathDataAttributesRulesItemType5TimeBlocksItem]): Time windows during + time_blocks (list['UpdateEscalationPolicyPathDataAttributesRulesItemType5TimeBlocksItem']): Time windows during which alerts are deferred """ rule_type: UpdateEscalationPolicyPathDataAttributesRulesItemType5RuleType time_zone: UpdateEscalationPolicyPathDataAttributesRulesItemType5TimeZone - time_blocks: list[UpdateEscalationPolicyPathDataAttributesRulesItemType5TimeBlocksItem] + time_blocks: list["UpdateEscalationPolicyPathDataAttributesRulesItemType5TimeBlocksItem"] additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - rule_type: str = self.rule_type time_zone: str = self.time_zone diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_5_time_blocks_item.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_5_time_blocks_item.py index d79f3ac7..d949b1d9 100644 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_5_time_blocks_item.py +++ b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_5_time_blocks_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,30 +13,30 @@ class UpdateEscalationPolicyPathDataAttributesRulesItemType5TimeBlocksItem: """ Attributes: - monday (bool | Unset): Default: False. - tuesday (bool | Unset): Default: False. - wednesday (bool | Unset): Default: False. - thursday (bool | Unset): Default: False. - friday (bool | Unset): Default: False. - saturday (bool | Unset): Default: False. - sunday (bool | Unset): Default: False. - start_time (str | Unset): Formatted as HH:MM - end_time (str | Unset): Formatted as HH:MM - all_day (bool | Unset): Default: False. - position (int | None | Unset): + monday (Union[Unset, bool]): Default: False. + tuesday (Union[Unset, bool]): Default: False. + wednesday (Union[Unset, bool]): Default: False. + thursday (Union[Unset, bool]): Default: False. + friday (Union[Unset, bool]): Default: False. + saturday (Union[Unset, bool]): Default: False. + sunday (Union[Unset, bool]): Default: False. + start_time (Union[Unset, str]): Formatted as HH:MM + end_time (Union[Unset, str]): Formatted as HH:MM + all_day (Union[Unset, bool]): Default: False. + position (Union[None, Unset, int]): """ - monday: bool | Unset = False - tuesday: bool | Unset = False - wednesday: bool | Unset = False - thursday: bool | Unset = False - friday: bool | Unset = False - saturday: bool | Unset = False - sunday: bool | Unset = False - start_time: str | Unset = UNSET - end_time: str | Unset = UNSET - all_day: bool | Unset = False - position: int | None | Unset = UNSET + monday: Union[Unset, bool] = False + tuesday: Union[Unset, bool] = False + wednesday: Union[Unset, bool] = False + thursday: Union[Unset, bool] = False + friday: Union[Unset, bool] = False + saturday: Union[Unset, bool] = False + sunday: Union[Unset, bool] = False + start_time: Union[Unset, str] = UNSET + end_time: Union[Unset, str] = UNSET + all_day: Union[Unset, bool] = False + position: Union[None, Unset, int] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -62,7 +60,7 @@ def to_dict(self) -> dict[str, Any]: all_day = self.all_day - position: int | None | Unset + position: Union[None, Unset, int] if isinstance(self.position, Unset): position = UNSET else: @@ -119,12 +117,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: all_day = d.pop("all_day", UNSET) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> Union[None, Unset, int]: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(Union[None, Unset, int], data) position = _parse_position(d.pop("position", UNSET)) diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_6.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_6.py index d543a1ff..764b5182 100644 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_6.py +++ b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_6.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_7.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_7.py index 67122596..a394755a 100644 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_7.py +++ b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_7.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_0.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_0.py index 4e875168..15ecf4f7 100644 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_0.py +++ b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_1.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_1.py index fefcf0cb..67f10e0c 100644 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_1.py +++ b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_1.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_2.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_2.py index 5548d7ad..716f6576 100644 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_2.py +++ b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_2.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -28,15 +26,15 @@ class UpdateEscalationPolicyPathDataAttributesRulesItemType8Type2: json_path (str): JSON path to extract value from payload operator (UpdateEscalationPolicyPathDataAttributesRulesItemType8Type2Operator): How JSON path value should be matched - value (None | str | Unset): Value with which JSON path value should be matched - values (list[str] | Unset): Values to match against (for is_one_of / is_not_one_of operators) + value (Union[None, Unset, str]): Value with which JSON path value should be matched + values (Union[Unset, list[str]]): Values to match against (for is_one_of / is_not_one_of operators) """ rule_type: UpdateEscalationPolicyPathDataAttributesRulesItemType8Type2RuleType json_path: str operator: UpdateEscalationPolicyPathDataAttributesRulesItemType8Type2Operator - value: None | str | Unset = UNSET - values: list[str] | Unset = UNSET + value: Union[None, Unset, str] = UNSET + values: Union[Unset, list[str]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -46,13 +44,13 @@ def to_dict(self) -> dict[str, Any]: operator: str = self.operator - value: None | str | Unset + value: Union[None, Unset, str] if isinstance(self.value, Unset): value = UNSET else: value = self.value - values: list[str] | Unset = UNSET + values: Union[Unset, list[str]] = UNSET if not isinstance(self.values, Unset): values = self.values @@ -85,12 +83,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d.pop("operator") ) - def _parse_value(data: object) -> None | str | Unset: + def _parse_value(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) value = _parse_value(d.pop("value", UNSET)) diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_3.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_3.py index 7c490b36..0943798d 100644 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_3.py +++ b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_3.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,14 +27,14 @@ class UpdateEscalationPolicyPathDataAttributesRulesItemType8Type3: fieldable_id (str): The ID of the alert field operator (UpdateEscalationPolicyPathDataAttributesRulesItemType8Type3Operator): How the alert field value should be matched - values (list[str] | Unset): Values to match against + values (Union[Unset, list[str]]): Values to match against """ rule_type: UpdateEscalationPolicyPathDataAttributesRulesItemType8Type3RuleType fieldable_type: str fieldable_id: str operator: UpdateEscalationPolicyPathDataAttributesRulesItemType8Type3Operator - values: list[str] | Unset = UNSET + values: Union[Unset, list[str]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -48,7 +46,7 @@ def to_dict(self) -> dict[str, Any]: operator: str = self.operator - values: list[str] | Unset = UNSET + values: Union[Unset, list[str]] = UNSET if not isinstance(self.values, Unset): values = self.values diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_4.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_4.py index 9ea1d8cf..3915505f 100644 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_4.py +++ b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_4.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_5.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_5.py index e8d1eb48..d2b190a0 100644 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_5.py +++ b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_5.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -32,17 +30,16 @@ class UpdateEscalationPolicyPathDataAttributesRulesItemType8Type5: rule time_zone (UpdateEscalationPolicyPathDataAttributesRulesItemType8Type5TimeZone): Time zone for the deferral window - time_blocks (list[UpdateEscalationPolicyPathDataAttributesRulesItemType8Type5TimeBlocksItem]): Time windows + time_blocks (list['UpdateEscalationPolicyPathDataAttributesRulesItemType8Type5TimeBlocksItem']): Time windows during which alerts are deferred """ rule_type: UpdateEscalationPolicyPathDataAttributesRulesItemType8Type5RuleType time_zone: UpdateEscalationPolicyPathDataAttributesRulesItemType8Type5TimeZone - time_blocks: list[UpdateEscalationPolicyPathDataAttributesRulesItemType8Type5TimeBlocksItem] + time_blocks: list["UpdateEscalationPolicyPathDataAttributesRulesItemType8Type5TimeBlocksItem"] additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - rule_type: str = self.rule_type time_zone: str = self.time_zone diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_5_time_blocks_item.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_5_time_blocks_item.py index b90ababd..44223b76 100644 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_5_time_blocks_item.py +++ b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_5_time_blocks_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,30 +13,30 @@ class UpdateEscalationPolicyPathDataAttributesRulesItemType8Type5TimeBlocksItem: """ Attributes: - monday (bool | Unset): Default: False. - tuesday (bool | Unset): Default: False. - wednesday (bool | Unset): Default: False. - thursday (bool | Unset): Default: False. - friday (bool | Unset): Default: False. - saturday (bool | Unset): Default: False. - sunday (bool | Unset): Default: False. - start_time (str | Unset): Formatted as HH:MM - end_time (str | Unset): Formatted as HH:MM - all_day (bool | Unset): Default: False. - position (int | None | Unset): + monday (Union[Unset, bool]): Default: False. + tuesday (Union[Unset, bool]): Default: False. + wednesday (Union[Unset, bool]): Default: False. + thursday (Union[Unset, bool]): Default: False. + friday (Union[Unset, bool]): Default: False. + saturday (Union[Unset, bool]): Default: False. + sunday (Union[Unset, bool]): Default: False. + start_time (Union[Unset, str]): Formatted as HH:MM + end_time (Union[Unset, str]): Formatted as HH:MM + all_day (Union[Unset, bool]): Default: False. + position (Union[None, Unset, int]): """ - monday: bool | Unset = False - tuesday: bool | Unset = False - wednesday: bool | Unset = False - thursday: bool | Unset = False - friday: bool | Unset = False - saturday: bool | Unset = False - sunday: bool | Unset = False - start_time: str | Unset = UNSET - end_time: str | Unset = UNSET - all_day: bool | Unset = False - position: int | None | Unset = UNSET + monday: Union[Unset, bool] = False + tuesday: Union[Unset, bool] = False + wednesday: Union[Unset, bool] = False + thursday: Union[Unset, bool] = False + friday: Union[Unset, bool] = False + saturday: Union[Unset, bool] = False + sunday: Union[Unset, bool] = False + start_time: Union[Unset, str] = UNSET + end_time: Union[Unset, str] = UNSET + all_day: Union[Unset, bool] = False + position: Union[None, Unset, int] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -62,7 +60,7 @@ def to_dict(self) -> dict[str, Any]: all_day = self.all_day - position: int | None | Unset + position: Union[None, Unset, int] if isinstance(self.position, Unset): position = UNSET else: @@ -119,12 +117,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: all_day = d.pop("all_day", UNSET) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> Union[None, Unset, int]: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(Union[None, Unset, int], data) position = _parse_position(d.pop("position", UNSET)) diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_6.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_6.py index 5c3b2c9a..de81d342 100644 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_6.py +++ b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_6.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_7.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_7.py index b5143c9d..9d4a69b4 100644 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_7.py +++ b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_7.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_0.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_0.py index 3d985253..23817a6a 100644 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_0.py +++ b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_1.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_1.py index a54b05f8..0ffe6200 100644 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_1.py +++ b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_1.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_2.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_2.py index e630006f..deace1cf 100644 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_2.py +++ b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_2.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -28,15 +26,15 @@ class UpdateEscalationPolicyPathDataAttributesRulesItemType9Type2: json_path (str): JSON path to extract value from payload operator (UpdateEscalationPolicyPathDataAttributesRulesItemType9Type2Operator): How JSON path value should be matched - value (None | str | Unset): Value with which JSON path value should be matched - values (list[str] | Unset): Values to match against (for is_one_of / is_not_one_of operators) + value (Union[None, Unset, str]): Value with which JSON path value should be matched + values (Union[Unset, list[str]]): Values to match against (for is_one_of / is_not_one_of operators) """ rule_type: UpdateEscalationPolicyPathDataAttributesRulesItemType9Type2RuleType json_path: str operator: UpdateEscalationPolicyPathDataAttributesRulesItemType9Type2Operator - value: None | str | Unset = UNSET - values: list[str] | Unset = UNSET + value: Union[None, Unset, str] = UNSET + values: Union[Unset, list[str]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -46,13 +44,13 @@ def to_dict(self) -> dict[str, Any]: operator: str = self.operator - value: None | str | Unset + value: Union[None, Unset, str] if isinstance(self.value, Unset): value = UNSET else: value = self.value - values: list[str] | Unset = UNSET + values: Union[Unset, list[str]] = UNSET if not isinstance(self.values, Unset): values = self.values @@ -85,12 +83,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d.pop("operator") ) - def _parse_value(data: object) -> None | str | Unset: + def _parse_value(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) value = _parse_value(d.pop("value", UNSET)) diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_3.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_3.py index 74fc9476..24a1a718 100644 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_3.py +++ b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_3.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,14 +27,14 @@ class UpdateEscalationPolicyPathDataAttributesRulesItemType9Type3: fieldable_id (str): The ID of the alert field operator (UpdateEscalationPolicyPathDataAttributesRulesItemType9Type3Operator): How the alert field value should be matched - values (list[str] | Unset): Values to match against + values (Union[Unset, list[str]]): Values to match against """ rule_type: UpdateEscalationPolicyPathDataAttributesRulesItemType9Type3RuleType fieldable_type: str fieldable_id: str operator: UpdateEscalationPolicyPathDataAttributesRulesItemType9Type3Operator - values: list[str] | Unset = UNSET + values: Union[Unset, list[str]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -48,7 +46,7 @@ def to_dict(self) -> dict[str, Any]: operator: str = self.operator - values: list[str] | Unset = UNSET + values: Union[Unset, list[str]] = UNSET if not isinstance(self.values, Unset): values = self.values diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_4.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_4.py index d9250bc1..0f5a8320 100644 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_4.py +++ b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_4.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_5.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_5.py index 6d07b9a8..ffdf6426 100644 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_5.py +++ b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_5.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -32,17 +30,16 @@ class UpdateEscalationPolicyPathDataAttributesRulesItemType9Type5: rule time_zone (UpdateEscalationPolicyPathDataAttributesRulesItemType9Type5TimeZone): Time zone for the deferral window - time_blocks (list[UpdateEscalationPolicyPathDataAttributesRulesItemType9Type5TimeBlocksItem]): Time windows + time_blocks (list['UpdateEscalationPolicyPathDataAttributesRulesItemType9Type5TimeBlocksItem']): Time windows during which alerts are deferred """ rule_type: UpdateEscalationPolicyPathDataAttributesRulesItemType9Type5RuleType time_zone: UpdateEscalationPolicyPathDataAttributesRulesItemType9Type5TimeZone - time_blocks: list[UpdateEscalationPolicyPathDataAttributesRulesItemType9Type5TimeBlocksItem] + time_blocks: list["UpdateEscalationPolicyPathDataAttributesRulesItemType9Type5TimeBlocksItem"] additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - rule_type: str = self.rule_type time_zone: str = self.time_zone diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_5_time_blocks_item.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_5_time_blocks_item.py index 31a4c90f..b641c0fa 100644 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_5_time_blocks_item.py +++ b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_5_time_blocks_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,30 +13,30 @@ class UpdateEscalationPolicyPathDataAttributesRulesItemType9Type5TimeBlocksItem: """ Attributes: - monday (bool | Unset): Default: False. - tuesday (bool | Unset): Default: False. - wednesday (bool | Unset): Default: False. - thursday (bool | Unset): Default: False. - friday (bool | Unset): Default: False. - saturday (bool | Unset): Default: False. - sunday (bool | Unset): Default: False. - start_time (str | Unset): Formatted as HH:MM - end_time (str | Unset): Formatted as HH:MM - all_day (bool | Unset): Default: False. - position (int | None | Unset): + monday (Union[Unset, bool]): Default: False. + tuesday (Union[Unset, bool]): Default: False. + wednesday (Union[Unset, bool]): Default: False. + thursday (Union[Unset, bool]): Default: False. + friday (Union[Unset, bool]): Default: False. + saturday (Union[Unset, bool]): Default: False. + sunday (Union[Unset, bool]): Default: False. + start_time (Union[Unset, str]): Formatted as HH:MM + end_time (Union[Unset, str]): Formatted as HH:MM + all_day (Union[Unset, bool]): Default: False. + position (Union[None, Unset, int]): """ - monday: bool | Unset = False - tuesday: bool | Unset = False - wednesday: bool | Unset = False - thursday: bool | Unset = False - friday: bool | Unset = False - saturday: bool | Unset = False - sunday: bool | Unset = False - start_time: str | Unset = UNSET - end_time: str | Unset = UNSET - all_day: bool | Unset = False - position: int | None | Unset = UNSET + monday: Union[Unset, bool] = False + tuesday: Union[Unset, bool] = False + wednesday: Union[Unset, bool] = False + thursday: Union[Unset, bool] = False + friday: Union[Unset, bool] = False + saturday: Union[Unset, bool] = False + sunday: Union[Unset, bool] = False + start_time: Union[Unset, str] = UNSET + end_time: Union[Unset, str] = UNSET + all_day: Union[Unset, bool] = False + position: Union[None, Unset, int] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -62,7 +60,7 @@ def to_dict(self) -> dict[str, Any]: all_day = self.all_day - position: int | None | Unset + position: Union[None, Unset, int] if isinstance(self.position, Unset): position = UNSET else: @@ -119,12 +117,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: all_day = d.pop("all_day", UNSET) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> Union[None, Unset, int]: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(Union[None, Unset, int], data) position = _parse_position(d.pop("position", UNSET)) diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_6.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_6.py index 068ee32b..8e63d912 100644 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_6.py +++ b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_6.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_7.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_7.py index 006cb474..b45ee2eb 100644 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_7.py +++ b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_7.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_time_restrictions_item.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_time_restrictions_item.py index a53f78dd..62a8b40a 100644 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_time_restrictions_item.py +++ b/rootly_sdk/models/update_escalation_policy_path_data_attributes_time_restrictions_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,26 +21,26 @@ class UpdateEscalationPolicyPathDataAttributesTimeRestrictionsItem: """ Attributes: - start_day (UpdateEscalationPolicyPathDataAttributesTimeRestrictionsItemStartDay | Unset): - start_time (str | Unset): Formatted as HH:MM - end_day (UpdateEscalationPolicyPathDataAttributesTimeRestrictionsItemEndDay | Unset): - end_time (str | Unset): Formatted as HH:MM + start_day (Union[Unset, UpdateEscalationPolicyPathDataAttributesTimeRestrictionsItemStartDay]): + start_time (Union[Unset, str]): Formatted as HH:MM + end_day (Union[Unset, UpdateEscalationPolicyPathDataAttributesTimeRestrictionsItemEndDay]): + end_time (Union[Unset, str]): Formatted as HH:MM """ - start_day: UpdateEscalationPolicyPathDataAttributesTimeRestrictionsItemStartDay | Unset = UNSET - start_time: str | Unset = UNSET - end_day: UpdateEscalationPolicyPathDataAttributesTimeRestrictionsItemEndDay | Unset = UNSET - end_time: str | Unset = UNSET + start_day: Union[Unset, UpdateEscalationPolicyPathDataAttributesTimeRestrictionsItemStartDay] = UNSET + start_time: Union[Unset, str] = UNSET + end_day: Union[Unset, UpdateEscalationPolicyPathDataAttributesTimeRestrictionsItemEndDay] = UNSET + end_time: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - start_day: str | Unset = UNSET + start_day: Union[Unset, str] = UNSET if not isinstance(self.start_day, Unset): start_day = self.start_day start_time = self.start_time - end_day: str | Unset = UNSET + end_day: Union[Unset, str] = UNSET if not isinstance(self.end_day, Unset): end_day = self.end_day @@ -66,7 +64,7 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _start_day = d.pop("start_day", UNSET) - start_day: UpdateEscalationPolicyPathDataAttributesTimeRestrictionsItemStartDay | Unset + start_day: Union[Unset, UpdateEscalationPolicyPathDataAttributesTimeRestrictionsItemStartDay] if isinstance(_start_day, Unset): start_day = UNSET else: @@ -75,7 +73,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: start_time = d.pop("start_time", UNSET) _end_day = d.pop("end_day", UNSET) - end_day: UpdateEscalationPolicyPathDataAttributesTimeRestrictionsItemEndDay | Unset + end_day: Union[Unset, UpdateEscalationPolicyPathDataAttributesTimeRestrictionsItemEndDay] if isinstance(_end_day, Unset): end_day = UNSET else: diff --git a/rootly_sdk/models/update_form_field.py b/rootly_sdk/models/update_form_field.py index b525084e..0d06144e 100644 --- a/rootly_sdk/models/update_form_field.py +++ b/rootly_sdk/models/update_form_field.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateFormField: data (UpdateFormFieldData): """ - data: UpdateFormFieldData + data: "UpdateFormFieldData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_form_field_data.py b/rootly_sdk/models/update_form_field_data.py index 2a189305..e404f75d 100644 --- a/rootly_sdk/models/update_form_field_data.py +++ b/rootly_sdk/models/update_form_field_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class UpdateFormFieldData: """ type_: UpdateFormFieldDataType - attributes: UpdateFormFieldDataAttributes + attributes: "UpdateFormFieldDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_form_field_data_attributes.py b/rootly_sdk/models/update_form_field_data_attributes.py index b35324bf..bb7e8c98 100644 --- a/rootly_sdk/models/update_form_field_data_attributes.py +++ b/rootly_sdk/models/update_form_field_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -26,48 +24,57 @@ class UpdateFormFieldDataAttributes: """ Attributes: - kind (UpdateFormFieldDataAttributesKind | Unset): The kind of the form field - input_kind (UpdateFormFieldDataAttributesInputKind | Unset): The input kind of the form field - value_kind (UpdateFormFieldDataAttributesValueKind | Unset): The value kind of the form field - value_kind_catalog_id (None | str | Unset): The ID of the catalog used when value_kind is `catalog_entity` - name (str | Unset): The name of the form field - description (None | str | Unset): The description of the form field - shown (list[str] | Unset): - required (list[str] | Unset): - show_on_incident_details (bool | Unset): Whether the form field is shown on the incident details panel - enabled (bool | Unset): Whether the form field is enabled - default_values (list[str] | Unset): - auto_set_by_catalog_property_id (None | str | Unset): Catalog property ID to auto-set this form field. Only + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + kind (Union[Unset, UpdateFormFieldDataAttributesKind]): The kind of the form field + input_kind (Union[Unset, UpdateFormFieldDataAttributesInputKind]): The input kind of the form field + value_kind (Union[Unset, UpdateFormFieldDataAttributesValueKind]): The value kind of the form field + value_kind_catalog_id (Union[None, Unset, str]): The ID of the catalog used when value_kind is `catalog_entity` + name (Union[Unset, str]): The name of the form field + description (Union[None, Unset, str]): The description of the form field + shown (Union[Unset, list[str]]): + required (Union[Unset, list[str]]): + show_on_incident_details (Union[Unset, bool]): Whether the form field is shown on the incident details panel + enabled (Union[Unset, bool]): Whether the form field is enabled + default_values (Union[Unset, list[str]]): + auto_set_by_catalog_property_id (Union[None, Unset, str]): Catalog property ID to auto-set this form field. Only reference-kind catalog properties are supported. """ - kind: UpdateFormFieldDataAttributesKind | Unset = UNSET - input_kind: UpdateFormFieldDataAttributesInputKind | Unset = UNSET - value_kind: UpdateFormFieldDataAttributesValueKind | Unset = UNSET - value_kind_catalog_id: None | str | Unset = UNSET - name: str | Unset = UNSET - description: None | str | Unset = UNSET - shown: list[str] | Unset = UNSET - required: list[str] | Unset = UNSET - show_on_incident_details: bool | Unset = UNSET - enabled: bool | Unset = UNSET - default_values: list[str] | Unset = UNSET - auto_set_by_catalog_property_id: None | str | Unset = UNSET + slug: Union[None, Unset, str] = UNSET + kind: Union[Unset, UpdateFormFieldDataAttributesKind] = UNSET + input_kind: Union[Unset, UpdateFormFieldDataAttributesInputKind] = UNSET + value_kind: Union[Unset, UpdateFormFieldDataAttributesValueKind] = UNSET + value_kind_catalog_id: Union[None, Unset, str] = UNSET + name: Union[Unset, str] = UNSET + description: Union[None, Unset, str] = UNSET + shown: Union[Unset, list[str]] = UNSET + required: Union[Unset, list[str]] = UNSET + show_on_incident_details: Union[Unset, bool] = UNSET + enabled: Union[Unset, bool] = UNSET + default_values: Union[Unset, list[str]] = UNSET + auto_set_by_catalog_property_id: Union[None, Unset, str] = UNSET def to_dict(self) -> dict[str, Any]: - kind: str | Unset = UNSET + slug: Union[None, Unset, str] + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug + + kind: Union[Unset, str] = UNSET if not isinstance(self.kind, Unset): kind = self.kind - input_kind: str | Unset = UNSET + input_kind: Union[Unset, str] = UNSET if not isinstance(self.input_kind, Unset): input_kind = self.input_kind - value_kind: str | Unset = UNSET + value_kind: Union[Unset, str] = UNSET if not isinstance(self.value_kind, Unset): value_kind = self.value_kind - value_kind_catalog_id: None | str | Unset + value_kind_catalog_id: Union[None, Unset, str] if isinstance(self.value_kind_catalog_id, Unset): value_kind_catalog_id = UNSET else: @@ -75,17 +82,17 @@ def to_dict(self) -> dict[str, Any]: name = self.name - description: None | str | Unset + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: description = self.description - shown: list[str] | Unset = UNSET + shown: Union[Unset, list[str]] = UNSET if not isinstance(self.shown, Unset): shown = self.shown - required: list[str] | Unset = UNSET + required: Union[Unset, list[str]] = UNSET if not isinstance(self.required, Unset): required = self.required @@ -93,11 +100,11 @@ def to_dict(self) -> dict[str, Any]: enabled = self.enabled - default_values: list[str] | Unset = UNSET + default_values: Union[Unset, list[str]] = UNSET if not isinstance(self.default_values, Unset): default_values = self.default_values - auto_set_by_catalog_property_id: None | str | Unset + auto_set_by_catalog_property_id: Union[None, Unset, str] if isinstance(self.auto_set_by_catalog_property_id, Unset): auto_set_by_catalog_property_id = UNSET else: @@ -106,6 +113,8 @@ def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} field_dict.update({}) + if slug is not UNSET: + field_dict["slug"] = slug if kind is not UNSET: field_dict["kind"] = kind if input_kind is not UNSET: @@ -136,44 +145,54 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) + + def _parse_slug(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + slug = _parse_slug(d.pop("slug", UNSET)) + _kind = d.pop("kind", UNSET) - kind: UpdateFormFieldDataAttributesKind | Unset + kind: Union[Unset, UpdateFormFieldDataAttributesKind] if isinstance(_kind, Unset): kind = UNSET else: kind = check_update_form_field_data_attributes_kind(_kind) _input_kind = d.pop("input_kind", UNSET) - input_kind: UpdateFormFieldDataAttributesInputKind | Unset + input_kind: Union[Unset, UpdateFormFieldDataAttributesInputKind] if isinstance(_input_kind, Unset): input_kind = UNSET else: input_kind = check_update_form_field_data_attributes_input_kind(_input_kind) _value_kind = d.pop("value_kind", UNSET) - value_kind: UpdateFormFieldDataAttributesValueKind | Unset + value_kind: Union[Unset, UpdateFormFieldDataAttributesValueKind] if isinstance(_value_kind, Unset): value_kind = UNSET else: value_kind = check_update_form_field_data_attributes_value_kind(_value_kind) - def _parse_value_kind_catalog_id(data: object) -> None | str | Unset: + def _parse_value_kind_catalog_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) value_kind_catalog_id = _parse_value_kind_catalog_id(d.pop("value_kind_catalog_id", UNSET)) name = d.pop("name", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) @@ -187,18 +206,19 @@ def _parse_description(data: object) -> None | str | Unset: default_values = cast(list[str], d.pop("default_values", UNSET)) - def _parse_auto_set_by_catalog_property_id(data: object) -> None | str | Unset: + def _parse_auto_set_by_catalog_property_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) auto_set_by_catalog_property_id = _parse_auto_set_by_catalog_property_id( d.pop("auto_set_by_catalog_property_id", UNSET) ) update_form_field_data_attributes = cls( + slug=slug, kind=kind, input_kind=input_kind, value_kind=value_kind, diff --git a/rootly_sdk/models/update_form_field_option.py b/rootly_sdk/models/update_form_field_option.py index 7fa663da..82cc645a 100644 --- a/rootly_sdk/models/update_form_field_option.py +++ b/rootly_sdk/models/update_form_field_option.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateFormFieldOption: data (UpdateFormFieldOptionData): """ - data: UpdateFormFieldOptionData + data: "UpdateFormFieldOptionData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_form_field_option_data.py b/rootly_sdk/models/update_form_field_option_data.py index 234bfe54..648a9210 100644 --- a/rootly_sdk/models/update_form_field_option_data.py +++ b/rootly_sdk/models/update_form_field_option_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class UpdateFormFieldOptionData: """ type_: UpdateFormFieldOptionDataType - attributes: UpdateFormFieldOptionDataAttributes + attributes: "UpdateFormFieldOptionDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_form_field_option_data_attributes.py b/rootly_sdk/models/update_form_field_option_data_attributes.py index 884652f0..df60aac8 100644 --- a/rootly_sdk/models/update_form_field_option_data_attributes.py +++ b/rootly_sdk/models/update_form_field_option_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define @@ -14,16 +12,16 @@ class UpdateFormFieldOptionDataAttributes: """ Attributes: - value (str | Unset): The value of the form field option - color (str | Unset): The hex color of the form field option - default (bool | Unset): - position (int | Unset): The position of the form field option + value (Union[Unset, str]): The value of the form field option + color (Union[Unset, str]): The hex color of the form field option + default (Union[Unset, bool]): + position (Union[Unset, int]): The position of the form field option """ - value: str | Unset = UNSET - color: str | Unset = UNSET - default: bool | Unset = UNSET - position: int | Unset = UNSET + value: Union[Unset, str] = UNSET + color: Union[Unset, str] = UNSET + default: Union[Unset, bool] = UNSET + position: Union[Unset, int] = UNSET def to_dict(self) -> dict[str, Any]: value = self.value diff --git a/rootly_sdk/models/update_form_field_placement.py b/rootly_sdk/models/update_form_field_placement.py index 8d8e18d4..f9a2844c 100644 --- a/rootly_sdk/models/update_form_field_placement.py +++ b/rootly_sdk/models/update_form_field_placement.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateFormFieldPlacement: data (UpdateFormFieldPlacementData): """ - data: UpdateFormFieldPlacementData + data: "UpdateFormFieldPlacementData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_form_field_placement_condition.py b/rootly_sdk/models/update_form_field_placement_condition.py index 60e1c0a5..3788132c 100644 --- a/rootly_sdk/models/update_form_field_placement_condition.py +++ b/rootly_sdk/models/update_form_field_placement_condition.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateFormFieldPlacementCondition: data (UpdateFormFieldPlacementConditionData): """ - data: UpdateFormFieldPlacementConditionData + data: "UpdateFormFieldPlacementConditionData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_form_field_placement_condition_data.py b/rootly_sdk/models/update_form_field_placement_condition_data.py index 28363a0c..d01736b0 100644 --- a/rootly_sdk/models/update_form_field_placement_condition_data.py +++ b/rootly_sdk/models/update_form_field_placement_condition_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class UpdateFormFieldPlacementConditionData: """ type_: UpdateFormFieldPlacementConditionDataType - attributes: UpdateFormFieldPlacementConditionDataAttributes + attributes: "UpdateFormFieldPlacementConditionDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_form_field_placement_condition_data_attributes.py b/rootly_sdk/models/update_form_field_placement_condition_data_attributes.py index abca4c89..659c18cb 100644 --- a/rootly_sdk/models/update_form_field_placement_condition_data_attributes.py +++ b/rootly_sdk/models/update_form_field_placement_condition_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -22,22 +20,22 @@ class UpdateFormFieldPlacementConditionDataAttributes: """ Attributes: - conditioned (UpdateFormFieldPlacementConditionDataAttributesConditioned | Unset): The resource or attribute the - condition applies. - position (int | Unset): The condition position. - form_field_id (str | Unset): The condition field. - comparison (UpdateFormFieldPlacementConditionDataAttributesComparison | Unset): The condition comparison. - values (list[str] | Unset): The values for comparison. + conditioned (Union[Unset, UpdateFormFieldPlacementConditionDataAttributesConditioned]): The resource or + attribute the condition applies. + position (Union[Unset, int]): The condition position. + form_field_id (Union[Unset, str]): The condition field. + comparison (Union[Unset, UpdateFormFieldPlacementConditionDataAttributesComparison]): The condition comparison. + values (Union[Unset, list[str]]): The values for comparison. """ - conditioned: UpdateFormFieldPlacementConditionDataAttributesConditioned | Unset = UNSET - position: int | Unset = UNSET - form_field_id: str | Unset = UNSET - comparison: UpdateFormFieldPlacementConditionDataAttributesComparison | Unset = UNSET - values: list[str] | Unset = UNSET + conditioned: Union[Unset, UpdateFormFieldPlacementConditionDataAttributesConditioned] = UNSET + position: Union[Unset, int] = UNSET + form_field_id: Union[Unset, str] = UNSET + comparison: Union[Unset, UpdateFormFieldPlacementConditionDataAttributesComparison] = UNSET + values: Union[Unset, list[str]] = UNSET def to_dict(self) -> dict[str, Any]: - conditioned: str | Unset = UNSET + conditioned: Union[Unset, str] = UNSET if not isinstance(self.conditioned, Unset): conditioned = self.conditioned @@ -45,11 +43,11 @@ def to_dict(self) -> dict[str, Any]: form_field_id = self.form_field_id - comparison: str | Unset = UNSET + comparison: Union[Unset, str] = UNSET if not isinstance(self.comparison, Unset): comparison = self.comparison - values: list[str] | Unset = UNSET + values: Union[Unset, list[str]] = UNSET if not isinstance(self.values, Unset): values = self.values @@ -73,7 +71,7 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _conditioned = d.pop("conditioned", UNSET) - conditioned: UpdateFormFieldPlacementConditionDataAttributesConditioned | Unset + conditioned: Union[Unset, UpdateFormFieldPlacementConditionDataAttributesConditioned] if isinstance(_conditioned, Unset): conditioned = UNSET else: @@ -84,7 +82,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: form_field_id = d.pop("form_field_id", UNSET) _comparison = d.pop("comparison", UNSET) - comparison: UpdateFormFieldPlacementConditionDataAttributesComparison | Unset + comparison: Union[Unset, UpdateFormFieldPlacementConditionDataAttributesComparison] if isinstance(_comparison, Unset): comparison = UNSET else: diff --git a/rootly_sdk/models/update_form_field_placement_data.py b/rootly_sdk/models/update_form_field_placement_data.py index 35393803..63c89523 100644 --- a/rootly_sdk/models/update_form_field_placement_data.py +++ b/rootly_sdk/models/update_form_field_placement_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class UpdateFormFieldPlacementData: """ type_: UpdateFormFieldPlacementDataType - attributes: UpdateFormFieldPlacementDataAttributes + attributes: "UpdateFormFieldPlacementDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_form_field_placement_data_attributes.py b/rootly_sdk/models/update_form_field_placement_data_attributes.py index aebd8477..3b0c18b3 100644 --- a/rootly_sdk/models/update_form_field_placement_data_attributes.py +++ b/rootly_sdk/models/update_form_field_placement_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define @@ -22,24 +20,25 @@ class UpdateFormFieldPlacementDataAttributes: """ Attributes: - form_set_id (str | Unset): The form set this field is placed in. - form (str | Unset): The form this field is placed on. - position (int | Unset): The position of the field placement. - required (bool | Unset): Whether the field is unconditionally required on this form. - required_operator (UpdateFormFieldPlacementDataAttributesRequiredOperator | Unset): Logical operator when + form_set_id (Union[Unset, str]): The form set this field is placed in. The form set must have the same + `resource_type` as the form field, otherwise the request is rejected with 422. + form (Union[Unset, str]): The form this field is placed on. + position (Union[Unset, int]): The position of the field placement. + required (Union[Unset, bool]): Whether the field is unconditionally required on this form. + required_operator (Union[Unset, UpdateFormFieldPlacementDataAttributesRequiredOperator]): Logical operator when evaluating multiple form_field_placement_conditions with conditioned=required - placement_operator (UpdateFormFieldPlacementDataAttributesPlacementOperator | Unset): Logical operator when - evaluating multiple form_field_placement_conditions with conditioned=placement - non_editable (bool | Unset): Whether the field is read-only and cannot be edited by users. + placement_operator (Union[Unset, UpdateFormFieldPlacementDataAttributesPlacementOperator]): Logical operator + when evaluating multiple form_field_placement_conditions with conditioned=placement + non_editable (Union[Unset, bool]): Whether the field is read-only and cannot be edited by users. """ - form_set_id: str | Unset = UNSET - form: str | Unset = UNSET - position: int | Unset = UNSET - required: bool | Unset = UNSET - required_operator: UpdateFormFieldPlacementDataAttributesRequiredOperator | Unset = UNSET - placement_operator: UpdateFormFieldPlacementDataAttributesPlacementOperator | Unset = UNSET - non_editable: bool | Unset = UNSET + form_set_id: Union[Unset, str] = UNSET + form: Union[Unset, str] = UNSET + position: Union[Unset, int] = UNSET + required: Union[Unset, bool] = UNSET + required_operator: Union[Unset, UpdateFormFieldPlacementDataAttributesRequiredOperator] = UNSET + placement_operator: Union[Unset, UpdateFormFieldPlacementDataAttributesPlacementOperator] = UNSET + non_editable: Union[Unset, bool] = UNSET def to_dict(self) -> dict[str, Any]: form_set_id = self.form_set_id @@ -50,11 +49,11 @@ def to_dict(self) -> dict[str, Any]: required = self.required - required_operator: str | Unset = UNSET + required_operator: Union[Unset, str] = UNSET if not isinstance(self.required_operator, Unset): required_operator = self.required_operator - placement_operator: str | Unset = UNSET + placement_operator: Union[Unset, str] = UNSET if not isinstance(self.placement_operator, Unset): placement_operator = self.placement_operator @@ -92,14 +91,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: required = d.pop("required", UNSET) _required_operator = d.pop("required_operator", UNSET) - required_operator: UpdateFormFieldPlacementDataAttributesRequiredOperator | Unset + required_operator: Union[Unset, UpdateFormFieldPlacementDataAttributesRequiredOperator] if isinstance(_required_operator, Unset): required_operator = UNSET else: required_operator = check_update_form_field_placement_data_attributes_required_operator(_required_operator) _placement_operator = d.pop("placement_operator", UNSET) - placement_operator: UpdateFormFieldPlacementDataAttributesPlacementOperator | Unset + placement_operator: Union[Unset, UpdateFormFieldPlacementDataAttributesPlacementOperator] if isinstance(_placement_operator, Unset): placement_operator = UNSET else: diff --git a/rootly_sdk/models/update_form_field_position.py b/rootly_sdk/models/update_form_field_position.py index b7f234f1..e25ddb92 100644 --- a/rootly_sdk/models/update_form_field_position.py +++ b/rootly_sdk/models/update_form_field_position.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateFormFieldPosition: data (UpdateFormFieldPositionData): """ - data: UpdateFormFieldPositionData + data: "UpdateFormFieldPositionData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_form_field_position_data.py b/rootly_sdk/models/update_form_field_position_data.py index 3b9cc75c..282ebd4d 100644 --- a/rootly_sdk/models/update_form_field_position_data.py +++ b/rootly_sdk/models/update_form_field_position_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class UpdateFormFieldPositionData: """ type_: UpdateFormFieldPositionDataType - attributes: UpdateFormFieldPositionDataAttributes + attributes: "UpdateFormFieldPositionDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_form_field_position_data_attributes.py b/rootly_sdk/models/update_form_field_position_data_attributes.py index bc7b1105..dd6bde48 100644 --- a/rootly_sdk/models/update_form_field_position_data_attributes.py +++ b/rootly_sdk/models/update_form_field_position_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define @@ -18,19 +16,19 @@ class UpdateFormFieldPositionDataAttributes: """ Attributes: - form_field_id (str | Unset): The ID of the form field. - form (UpdateFormFieldPositionDataAttributesForm | Unset): The form for the position - position (int | Unset): The position of the form_field_position + form_field_id (Union[Unset, str]): The ID of the form field. + form (Union[Unset, UpdateFormFieldPositionDataAttributesForm]): The form for the position + position (Union[Unset, int]): The position of the form_field_position """ - form_field_id: str | Unset = UNSET - form: UpdateFormFieldPositionDataAttributesForm | Unset = UNSET - position: int | Unset = UNSET + form_field_id: Union[Unset, str] = UNSET + form: Union[Unset, UpdateFormFieldPositionDataAttributesForm] = UNSET + position: Union[Unset, int] = UNSET def to_dict(self) -> dict[str, Any]: form_field_id = self.form_field_id - form: str | Unset = UNSET + form: Union[Unset, str] = UNSET if not isinstance(self.form, Unset): form = self.form @@ -54,7 +52,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: form_field_id = d.pop("form_field_id", UNSET) _form = d.pop("form", UNSET) - form: UpdateFormFieldPositionDataAttributesForm | Unset + form: Union[Unset, UpdateFormFieldPositionDataAttributesForm] if isinstance(_form, Unset): form = UNSET else: diff --git a/rootly_sdk/models/update_form_field_position_data_attributes_form.py b/rootly_sdk/models/update_form_field_position_data_attributes_form.py index 15a3f66a..3c58189c 100644 --- a/rootly_sdk/models/update_form_field_position_data_attributes_form.py +++ b/rootly_sdk/models/update_form_field_position_data_attributes_form.py @@ -8,6 +8,7 @@ "slack_incident_resolution_form", "slack_new_incident_form", "slack_scheduled_incident_form", + "slack_task_form", "slack_update_incident_form", "slack_update_incident_status_form", "slack_update_scheduled_incident_form", @@ -18,6 +19,7 @@ "web_incident_resolution_form", "web_new_incident_form", "web_scheduled_incident_form", + "web_task_form", "web_update_incident_form", "web_update_scheduled_incident_form", ] @@ -30,6 +32,7 @@ "slack_incident_resolution_form", "slack_new_incident_form", "slack_scheduled_incident_form", + "slack_task_form", "slack_update_incident_form", "slack_update_incident_status_form", "slack_update_scheduled_incident_form", @@ -40,6 +43,7 @@ "web_incident_resolution_form", "web_new_incident_form", "web_scheduled_incident_form", + "web_task_form", "web_update_incident_form", "web_update_scheduled_incident_form", } diff --git a/rootly_sdk/models/update_form_set.py b/rootly_sdk/models/update_form_set.py index 5122ef01..e0ff9a8b 100644 --- a/rootly_sdk/models/update_form_set.py +++ b/rootly_sdk/models/update_form_set.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateFormSet: data (UpdateFormSetData): """ - data: UpdateFormSetData + data: "UpdateFormSetData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_form_set_condition.py b/rootly_sdk/models/update_form_set_condition.py index ccd4d7ee..97080641 100644 --- a/rootly_sdk/models/update_form_set_condition.py +++ b/rootly_sdk/models/update_form_set_condition.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateFormSetCondition: data (UpdateFormSetConditionData): """ - data: UpdateFormSetConditionData + data: "UpdateFormSetConditionData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_form_set_condition_data.py b/rootly_sdk/models/update_form_set_condition_data.py index 83b587c0..c95eb31c 100644 --- a/rootly_sdk/models/update_form_set_condition_data.py +++ b/rootly_sdk/models/update_form_set_condition_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class UpdateFormSetConditionData: """ type_: UpdateFormSetConditionDataType - attributes: UpdateFormSetConditionDataAttributes + attributes: "UpdateFormSetConditionDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_form_set_condition_data_attributes.py b/rootly_sdk/models/update_form_set_condition_data_attributes.py index cbaa334a..545896d3 100644 --- a/rootly_sdk/models/update_form_set_condition_data_attributes.py +++ b/rootly_sdk/models/update_form_set_condition_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -18,23 +16,23 @@ class UpdateFormSetConditionDataAttributes: """ Attributes: - form_field_id (str | Unset): The form field this condition applies. - comparison (UpdateFormSetConditionDataAttributesComparison | Unset): The condition comparison. - values (list[str] | Unset): The values for comparison. + form_field_id (Union[Unset, str]): The form field this condition applies. + comparison (Union[Unset, UpdateFormSetConditionDataAttributesComparison]): The condition comparison. + values (Union[Unset, list[str]]): The values for comparison. """ - form_field_id: str | Unset = UNSET - comparison: UpdateFormSetConditionDataAttributesComparison | Unset = UNSET - values: list[str] | Unset = UNSET + form_field_id: Union[Unset, str] = UNSET + comparison: Union[Unset, UpdateFormSetConditionDataAttributesComparison] = UNSET + values: Union[Unset, list[str]] = UNSET def to_dict(self) -> dict[str, Any]: form_field_id = self.form_field_id - comparison: str | Unset = UNSET + comparison: Union[Unset, str] = UNSET if not isinstance(self.comparison, Unset): comparison = self.comparison - values: list[str] | Unset = UNSET + values: Union[Unset, list[str]] = UNSET if not isinstance(self.values, Unset): values = self.values @@ -56,7 +54,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: form_field_id = d.pop("form_field_id", UNSET) _comparison = d.pop("comparison", UNSET) - comparison: UpdateFormSetConditionDataAttributesComparison | Unset + comparison: Union[Unset, UpdateFormSetConditionDataAttributesComparison] if isinstance(_comparison, Unset): comparison = UNSET else: diff --git a/rootly_sdk/models/update_form_set_data.py b/rootly_sdk/models/update_form_set_data.py index 582152a4..b22a2180 100644 --- a/rootly_sdk/models/update_form_set_data.py +++ b/rootly_sdk/models/update_form_set_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class UpdateFormSetData: """ type_: UpdateFormSetDataType - attributes: UpdateFormSetDataAttributes + attributes: "UpdateFormSetDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_form_set_data_attributes.py b/rootly_sdk/models/update_form_set_data_attributes.py index 4b67156e..08c9e121 100644 --- a/rootly_sdk/models/update_form_set_data_attributes.py +++ b/rootly_sdk/models/update_form_set_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -14,30 +12,41 @@ class UpdateFormSetDataAttributes: """ Attributes: - name (str | Unset): The name of the form set - forms (list[str] | Unset): The forms included in the form set. Add custom forms using the custom form's `slug` - field. Or choose a built-in form: `web_new_incident_form`, `web_update_incident_form`, + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + name (Union[Unset, str]): The name of the form set + forms (Union[Unset, list[str]]): The forms included in the form set. Add custom forms using the custom form's + `slug` field. Or choose a built-in form: `web_new_incident_form`, `web_update_incident_form`, `web_incident_post_mortem_form`, `web_incident_mitigation_form`, `web_incident_resolution_form`, `web_incident_cancellation_form`, `web_scheduled_incident_form`, `web_update_scheduled_incident_form`, `slack_new_incident_form`, `slack_update_incident_form`, `slack_update_incident_status_form`, `slack_incident_mitigation_form`, `slack_incident_resolution_form`, `slack_incident_cancellation_form`, `slack_scheduled_incident_form`, `slack_update_scheduled_incident_form`, `google_chat_new_incident_form`, - `google_chat_update_incident_form` + `google_chat_update_incident_form`, `microsoft_teams_new_incident_form` """ - name: str | Unset = UNSET - forms: list[str] | Unset = UNSET + slug: Union[None, Unset, str] = UNSET + name: Union[Unset, str] = UNSET + forms: Union[Unset, list[str]] = UNSET def to_dict(self) -> dict[str, Any]: + slug: Union[None, Unset, str] + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug + name = self.name - forms: list[str] | Unset = UNSET + forms: Union[Unset, list[str]] = UNSET if not isinstance(self.forms, Unset): forms = self.forms field_dict: dict[str, Any] = {} field_dict.update({}) + if slug is not UNSET: + field_dict["slug"] = slug if name is not UNSET: field_dict["name"] = name if forms is not UNSET: @@ -48,11 +57,22 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) + + def _parse_slug(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + slug = _parse_slug(d.pop("slug", UNSET)) + name = d.pop("name", UNSET) forms = cast(list[str], d.pop("forms", UNSET)) update_form_set_data_attributes = cls( + slug=slug, name=name, forms=forms, ) diff --git a/rootly_sdk/models/update_functionality.py b/rootly_sdk/models/update_functionality.py index 556789c0..501a15ac 100644 --- a/rootly_sdk/models/update_functionality.py +++ b/rootly_sdk/models/update_functionality.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateFunctionality: data (UpdateFunctionalityData): """ - data: UpdateFunctionalityData + data: "UpdateFunctionalityData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_functionality_data.py b/rootly_sdk/models/update_functionality_data.py index 53e62f85..3bd9d4e7 100644 --- a/rootly_sdk/models/update_functionality_data.py +++ b/rootly_sdk/models/update_functionality_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class UpdateFunctionalityData: """ type_: UpdateFunctionalityDataType - attributes: UpdateFunctionalityDataAttributes + attributes: "UpdateFunctionalityDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_functionality_data_attributes.py b/rootly_sdk/models/update_functionality_data_attributes.py index 067bd483..b430ee6d 100644 --- a/rootly_sdk/models/update_functionality_data_attributes.py +++ b/rootly_sdk/models/update_functionality_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -26,72 +24,82 @@ class UpdateFunctionalityDataAttributes: """ Attributes: - name (str | Unset): The name of the functionality - description (None | str | Unset): The description of the functionality - public_description (None | str | Unset): The public description of the functionality - notify_emails (list[str] | None | Unset): Emails to attach to the functionality - color (None | str | Unset): The hex color of the functionality - position (int | None | Unset): Position of the functionality - backstage_id (None | str | Unset): The Backstage entity id associated to this functionality. eg: + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + name (Union[Unset, str]): The name of the functionality + description (Union[None, Unset, str]): The description of the functionality + public_description (Union[None, Unset, str]): The status page description of the functionality + notify_emails (Union[None, Unset, list[str]]): Emails to attach to the functionality + color (Union[None, Unset, str]): The hex color of the functionality + position (Union[None, Unset, int]): Position of the functionality + backstage_id (Union[None, Unset, str]): The Backstage entity id associated to this functionality. eg: :namespace/:kind/:entity_name - external_id (None | str | Unset): The external id associated to this functionality - pagerduty_id (None | str | Unset): The PagerDuty service id associated to this functionality - opsgenie_id (None | str | Unset): The Opsgenie service id associated to this functionality - opsgenie_team_id (None | str | Unset): The Opsgenie team id associated to this functionality - cortex_id (None | str | Unset): The Cortex group id associated to this functionality - service_now_ci_sys_id (None | str | Unset): The Service Now CI sys id associated to this functionality - environment_ids (list[str] | None | Unset): Environments associated with this functionality - service_ids (list[str] | None | Unset): Services associated with this functionality - owner_group_ids (list[str] | None | Unset): Owner Teams associated with this functionality - owner_user_ids (list[int] | None | Unset): Owner Users associated with this functionality - escalation_policy_id (None | str | Unset): The escalation policy id of the functionality - slack_channels (list[UpdateFunctionalityDataAttributesSlackChannelsType0Item] | None | Unset): Slack Channels - associated with this functionality - slack_aliases (list[UpdateFunctionalityDataAttributesSlackAliasesType0Item] | None | Unset): Slack Aliases - associated with this functionality - properties (list[UpdateFunctionalityDataAttributesPropertiesItem] | Unset): Array of property values for this - functionality. + external_id (Union[None, Unset, str]): The external id associated to this functionality + pagerduty_id (Union[None, Unset, str]): The PagerDuty service id associated to this functionality + opsgenie_id (Union[None, Unset, str]): The Opsgenie service id associated to this functionality + opsgenie_team_id (Union[None, Unset, str]): The Opsgenie team id associated to this functionality + cortex_id (Union[None, Unset, str]): The Cortex group id associated to this functionality + service_now_ci_sys_id (Union[None, Unset, str]): The Service Now CI sys id associated to this functionality + environment_ids (Union[None, Unset, list[str]]): Environments associated with this functionality + service_ids (Union[None, Unset, list[str]]): Services associated with this functionality + owner_group_ids (Union[None, Unset, list[str]]): Owner Teams associated with this functionality. Empty array + removes all; omitting or null leaves unchanged. + owner_user_ids (Union[None, Unset, list[int]]): Owner Users associated with this functionality. Empty array + removes all; omitting or null leaves unchanged. + escalation_policy_id (Union[None, Unset, str]): The escalation policy id of the functionality + slack_channels (Union[None, Unset, list['UpdateFunctionalityDataAttributesSlackChannelsType0Item']]): Slack + Channels associated with this functionality + slack_aliases (Union[None, Unset, list['UpdateFunctionalityDataAttributesSlackAliasesType0Item']]): Slack + Aliases associated with this functionality + properties (Union[Unset, list['UpdateFunctionalityDataAttributesPropertiesItem']]): Array of property values for + this functionality. """ - name: str | Unset = UNSET - description: None | str | Unset = UNSET - public_description: None | str | Unset = UNSET - notify_emails: list[str] | None | Unset = UNSET - color: None | str | Unset = UNSET - position: int | None | Unset = UNSET - backstage_id: None | str | Unset = UNSET - external_id: None | str | Unset = UNSET - pagerduty_id: None | str | Unset = UNSET - opsgenie_id: None | str | Unset = UNSET - opsgenie_team_id: None | str | Unset = UNSET - cortex_id: None | str | Unset = UNSET - service_now_ci_sys_id: None | str | Unset = UNSET - environment_ids: list[str] | None | Unset = UNSET - service_ids: list[str] | None | Unset = UNSET - owner_group_ids: list[str] | None | Unset = UNSET - owner_user_ids: list[int] | None | Unset = UNSET - escalation_policy_id: None | str | Unset = UNSET - slack_channels: list[UpdateFunctionalityDataAttributesSlackChannelsType0Item] | None | Unset = UNSET - slack_aliases: list[UpdateFunctionalityDataAttributesSlackAliasesType0Item] | None | Unset = UNSET - properties: list[UpdateFunctionalityDataAttributesPropertiesItem] | Unset = UNSET + slug: Union[None, Unset, str] = UNSET + name: Union[Unset, str] = UNSET + description: Union[None, Unset, str] = UNSET + public_description: Union[None, Unset, str] = UNSET + notify_emails: Union[None, Unset, list[str]] = UNSET + color: Union[None, Unset, str] = UNSET + position: Union[None, Unset, int] = UNSET + backstage_id: Union[None, Unset, str] = UNSET + external_id: Union[None, Unset, str] = UNSET + pagerduty_id: Union[None, Unset, str] = UNSET + opsgenie_id: Union[None, Unset, str] = UNSET + opsgenie_team_id: Union[None, Unset, str] = UNSET + cortex_id: Union[None, Unset, str] = UNSET + service_now_ci_sys_id: Union[None, Unset, str] = UNSET + environment_ids: Union[None, Unset, list[str]] = UNSET + service_ids: Union[None, Unset, list[str]] = UNSET + owner_group_ids: Union[None, Unset, list[str]] = UNSET + owner_user_ids: Union[None, Unset, list[int]] = UNSET + escalation_policy_id: Union[None, Unset, str] = UNSET + slack_channels: Union[None, Unset, list["UpdateFunctionalityDataAttributesSlackChannelsType0Item"]] = UNSET + slack_aliases: Union[None, Unset, list["UpdateFunctionalityDataAttributesSlackAliasesType0Item"]] = UNSET + properties: Union[Unset, list["UpdateFunctionalityDataAttributesPropertiesItem"]] = UNSET def to_dict(self) -> dict[str, Any]: + slug: Union[None, Unset, str] + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug name = self.name - description: None | str | Unset + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: description = self.description - public_description: None | str | Unset + public_description: Union[None, Unset, str] if isinstance(self.public_description, Unset): public_description = UNSET else: public_description = self.public_description - notify_emails: list[str] | None | Unset + notify_emails: Union[None, Unset, list[str]] if isinstance(self.notify_emails, Unset): notify_emails = UNSET elif isinstance(self.notify_emails, list): @@ -100,61 +108,61 @@ def to_dict(self) -> dict[str, Any]: else: notify_emails = self.notify_emails - color: None | str | Unset + color: Union[None, Unset, str] if isinstance(self.color, Unset): color = UNSET else: color = self.color - position: int | None | Unset + position: Union[None, Unset, int] if isinstance(self.position, Unset): position = UNSET else: position = self.position - backstage_id: None | str | Unset + backstage_id: Union[None, Unset, str] if isinstance(self.backstage_id, Unset): backstage_id = UNSET else: backstage_id = self.backstage_id - external_id: None | str | Unset + external_id: Union[None, Unset, str] if isinstance(self.external_id, Unset): external_id = UNSET else: external_id = self.external_id - pagerduty_id: None | str | Unset + pagerduty_id: Union[None, Unset, str] if isinstance(self.pagerduty_id, Unset): pagerduty_id = UNSET else: pagerduty_id = self.pagerduty_id - opsgenie_id: None | str | Unset + opsgenie_id: Union[None, Unset, str] if isinstance(self.opsgenie_id, Unset): opsgenie_id = UNSET else: opsgenie_id = self.opsgenie_id - opsgenie_team_id: None | str | Unset + opsgenie_team_id: Union[None, Unset, str] if isinstance(self.opsgenie_team_id, Unset): opsgenie_team_id = UNSET else: opsgenie_team_id = self.opsgenie_team_id - cortex_id: None | str | Unset + cortex_id: Union[None, Unset, str] if isinstance(self.cortex_id, Unset): cortex_id = UNSET else: cortex_id = self.cortex_id - service_now_ci_sys_id: None | str | Unset + service_now_ci_sys_id: Union[None, Unset, str] if isinstance(self.service_now_ci_sys_id, Unset): service_now_ci_sys_id = UNSET else: service_now_ci_sys_id = self.service_now_ci_sys_id - environment_ids: list[str] | None | Unset + environment_ids: Union[None, Unset, list[str]] if isinstance(self.environment_ids, Unset): environment_ids = UNSET elif isinstance(self.environment_ids, list): @@ -163,7 +171,7 @@ def to_dict(self) -> dict[str, Any]: else: environment_ids = self.environment_ids - service_ids: list[str] | None | Unset + service_ids: Union[None, Unset, list[str]] if isinstance(self.service_ids, Unset): service_ids = UNSET elif isinstance(self.service_ids, list): @@ -172,7 +180,7 @@ def to_dict(self) -> dict[str, Any]: else: service_ids = self.service_ids - owner_group_ids: list[str] | None | Unset + owner_group_ids: Union[None, Unset, list[str]] if isinstance(self.owner_group_ids, Unset): owner_group_ids = UNSET elif isinstance(self.owner_group_ids, list): @@ -181,7 +189,7 @@ def to_dict(self) -> dict[str, Any]: else: owner_group_ids = self.owner_group_ids - owner_user_ids: list[int] | None | Unset + owner_user_ids: Union[None, Unset, list[int]] if isinstance(self.owner_user_ids, Unset): owner_user_ids = UNSET elif isinstance(self.owner_user_ids, list): @@ -190,13 +198,13 @@ def to_dict(self) -> dict[str, Any]: else: owner_user_ids = self.owner_user_ids - escalation_policy_id: None | str | Unset + escalation_policy_id: Union[None, Unset, str] if isinstance(self.escalation_policy_id, Unset): escalation_policy_id = UNSET else: escalation_policy_id = self.escalation_policy_id - slack_channels: list[dict[str, Any]] | None | Unset + slack_channels: Union[None, Unset, list[dict[str, Any]]] if isinstance(self.slack_channels, Unset): slack_channels = UNSET elif isinstance(self.slack_channels, list): @@ -208,7 +216,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_channels = self.slack_channels - slack_aliases: list[dict[str, Any]] | None | Unset + slack_aliases: Union[None, Unset, list[dict[str, Any]]] if isinstance(self.slack_aliases, Unset): slack_aliases = UNSET elif isinstance(self.slack_aliases, list): @@ -220,7 +228,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_aliases = self.slack_aliases - properties: list[dict[str, Any]] | Unset = UNSET + properties: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.properties, Unset): properties = [] for properties_item_data in self.properties: @@ -230,6 +238,8 @@ def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} field_dict.update({}) + if slug is not UNSET: + field_dict["slug"] = slug if name is not UNSET: field_dict["name"] = name if description is not UNSET: @@ -288,27 +298,37 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: ) d = dict(src_dict) + + def _parse_slug(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + slug = _parse_slug(d.pop("slug", UNSET)) + name = d.pop("name", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) - def _parse_public_description(data: object) -> None | str | Unset: + def _parse_public_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) public_description = _parse_public_description(d.pop("public_description", UNSET)) - def _parse_notify_emails(data: object) -> list[str] | None | Unset: + def _parse_notify_emails(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -319,94 +339,94 @@ def _parse_notify_emails(data: object) -> list[str] | None | Unset: notify_emails_type_0 = cast(list[str], data) return notify_emails_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) notify_emails = _parse_notify_emails(d.pop("notify_emails", UNSET)) - def _parse_color(data: object) -> None | str | Unset: + def _parse_color(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) color = _parse_color(d.pop("color", UNSET)) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> Union[None, Unset, int]: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(Union[None, Unset, int], data) position = _parse_position(d.pop("position", UNSET)) - def _parse_backstage_id(data: object) -> None | str | Unset: + def _parse_backstage_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) backstage_id = _parse_backstage_id(d.pop("backstage_id", UNSET)) - def _parse_external_id(data: object) -> None | str | Unset: + def _parse_external_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) external_id = _parse_external_id(d.pop("external_id", UNSET)) - def _parse_pagerduty_id(data: object) -> None | str | Unset: + def _parse_pagerduty_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) pagerduty_id = _parse_pagerduty_id(d.pop("pagerduty_id", UNSET)) - def _parse_opsgenie_id(data: object) -> None | str | Unset: + def _parse_opsgenie_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) opsgenie_id = _parse_opsgenie_id(d.pop("opsgenie_id", UNSET)) - def _parse_opsgenie_team_id(data: object) -> None | str | Unset: + def _parse_opsgenie_team_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) opsgenie_team_id = _parse_opsgenie_team_id(d.pop("opsgenie_team_id", UNSET)) - def _parse_cortex_id(data: object) -> None | str | Unset: + def _parse_cortex_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) cortex_id = _parse_cortex_id(d.pop("cortex_id", UNSET)) - def _parse_service_now_ci_sys_id(data: object) -> None | str | Unset: + def _parse_service_now_ci_sys_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) service_now_ci_sys_id = _parse_service_now_ci_sys_id(d.pop("service_now_ci_sys_id", UNSET)) - def _parse_environment_ids(data: object) -> list[str] | None | Unset: + def _parse_environment_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -417,13 +437,13 @@ def _parse_environment_ids(data: object) -> list[str] | None | Unset: environment_ids_type_0 = cast(list[str], data) return environment_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) environment_ids = _parse_environment_ids(d.pop("environment_ids", UNSET)) - def _parse_service_ids(data: object) -> list[str] | None | Unset: + def _parse_service_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -434,13 +454,13 @@ def _parse_service_ids(data: object) -> list[str] | None | Unset: service_ids_type_0 = cast(list[str], data) return service_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) service_ids = _parse_service_ids(d.pop("service_ids", UNSET)) - def _parse_owner_group_ids(data: object) -> list[str] | None | Unset: + def _parse_owner_group_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -451,13 +471,13 @@ def _parse_owner_group_ids(data: object) -> list[str] | None | Unset: owner_group_ids_type_0 = cast(list[str], data) return owner_group_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) owner_group_ids = _parse_owner_group_ids(d.pop("owner_group_ids", UNSET)) - def _parse_owner_user_ids(data: object) -> list[int] | None | Unset: + def _parse_owner_user_ids(data: object) -> Union[None, Unset, list[int]]: if data is None: return data if isinstance(data, Unset): @@ -468,24 +488,24 @@ def _parse_owner_user_ids(data: object) -> list[int] | None | Unset: owner_user_ids_type_0 = cast(list[int], data) return owner_user_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[int] | None | Unset, data) + return cast(Union[None, Unset, list[int]], data) owner_user_ids = _parse_owner_user_ids(d.pop("owner_user_ids", UNSET)) - def _parse_escalation_policy_id(data: object) -> None | str | Unset: + def _parse_escalation_policy_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) escalation_policy_id = _parse_escalation_policy_id(d.pop("escalation_policy_id", UNSET)) def _parse_slack_channels( data: object, - ) -> list[UpdateFunctionalityDataAttributesSlackChannelsType0Item] | None | Unset: + ) -> Union[None, Unset, list["UpdateFunctionalityDataAttributesSlackChannelsType0Item"]]: if data is None: return data if isinstance(data, Unset): @@ -503,15 +523,15 @@ def _parse_slack_channels( slack_channels_type_0.append(slack_channels_type_0_item) return slack_channels_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[UpdateFunctionalityDataAttributesSlackChannelsType0Item] | None | Unset, data) + return cast(Union[None, Unset, list["UpdateFunctionalityDataAttributesSlackChannelsType0Item"]], data) slack_channels = _parse_slack_channels(d.pop("slack_channels", UNSET)) def _parse_slack_aliases( data: object, - ) -> list[UpdateFunctionalityDataAttributesSlackAliasesType0Item] | None | Unset: + ) -> Union[None, Unset, list["UpdateFunctionalityDataAttributesSlackAliasesType0Item"]]: if data is None: return data if isinstance(data, Unset): @@ -529,22 +549,21 @@ def _parse_slack_aliases( slack_aliases_type_0.append(slack_aliases_type_0_item) return slack_aliases_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[UpdateFunctionalityDataAttributesSlackAliasesType0Item] | None | Unset, data) + return cast(Union[None, Unset, list["UpdateFunctionalityDataAttributesSlackAliasesType0Item"]], data) slack_aliases = _parse_slack_aliases(d.pop("slack_aliases", UNSET)) + properties = [] _properties = d.pop("properties", UNSET) - properties: list[UpdateFunctionalityDataAttributesPropertiesItem] | Unset = UNSET - if _properties is not UNSET: - properties = [] - for properties_item_data in _properties: - properties_item = UpdateFunctionalityDataAttributesPropertiesItem.from_dict(properties_item_data) + for properties_item_data in _properties or []: + properties_item = UpdateFunctionalityDataAttributesPropertiesItem.from_dict(properties_item_data) - properties.append(properties_item) + properties.append(properties_item) update_functionality_data_attributes = cls( + slug=slug, name=name, description=description, public_description=public_description, diff --git a/rootly_sdk/models/update_functionality_data_attributes_properties_item.py b/rootly_sdk/models/update_functionality_data_attributes_properties_item.py index 8d1806bc..65940fe9 100644 --- a/rootly_sdk/models/update_functionality_data_attributes_properties_item.py +++ b/rootly_sdk/models/update_functionality_data_attributes_properties_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/update_functionality_data_attributes_slack_aliases_type_0_item.py b/rootly_sdk/models/update_functionality_data_attributes_slack_aliases_type_0_item.py index b49afaf8..0570fa7e 100644 --- a/rootly_sdk/models/update_functionality_data_attributes_slack_aliases_type_0_item.py +++ b/rootly_sdk/models/update_functionality_data_attributes_slack_aliases_type_0_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/update_functionality_data_attributes_slack_channels_type_0_item.py b/rootly_sdk/models/update_functionality_data_attributes_slack_channels_type_0_item.py index ef5557a9..7c94915e 100644 --- a/rootly_sdk/models/update_functionality_data_attributes_slack_channels_type_0_item.py +++ b/rootly_sdk/models/update_functionality_data_attributes_slack_channels_type_0_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/update_github_issue_task_params.py b/rootly_sdk/models/update_github_issue_task_params.py index a6f28436..395aa88c 100644 --- a/rootly_sdk/models/update_github_issue_task_params.py +++ b/rootly_sdk/models/update_github_issue_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -32,42 +30,41 @@ class UpdateGithubIssueTaskParams: Attributes: issue_id (str): The issue id completion (UpdateGithubIssueTaskParamsCompletion): - task_type (UpdateGithubIssueTaskParamsTaskType | Unset): - repository (UpdateGithubIssueTaskParamsRepository | Unset): The repository (used for loading labels and issue - types) - title (str | Unset): The issue title - body (str | Unset): The issue body - labels (list[UpdateGithubIssueTaskParamsLabelsItem] | Unset): The issue labels - labels_mode (UpdateGithubIssueTaskParamsLabelsMode | Unset): How to apply labels. 'replace' (default) overwrites - all existing labels. 'append' adds to existing labels without removing them. Default: 'replace'. - issue_type (UpdateGithubIssueTaskParamsIssueType | Unset): The issue type - custom_fields_mapping (None | str | Unset): Custom field mappings. Can contain liquid markup and need to be + task_type (Union[Unset, UpdateGithubIssueTaskParamsTaskType]): + repository (Union[Unset, UpdateGithubIssueTaskParamsRepository]): The repository (used for loading labels and + issue types) + title (Union[Unset, str]): The issue title + body (Union[Unset, str]): The issue body + labels (Union[Unset, list['UpdateGithubIssueTaskParamsLabelsItem']]): The issue labels + labels_mode (Union[Unset, UpdateGithubIssueTaskParamsLabelsMode]): How to apply labels. 'replace' (default) + overwrites all existing labels. 'append' adds to existing labels without removing them. Default: 'replace'. + issue_type (Union[Unset, UpdateGithubIssueTaskParamsIssueType]): The issue type + custom_fields_mapping (Union[None, Unset, str]): Custom field mappings. Can contain liquid markup and need to be valid JSON """ issue_id: str - completion: UpdateGithubIssueTaskParamsCompletion - task_type: UpdateGithubIssueTaskParamsTaskType | Unset = UNSET - repository: UpdateGithubIssueTaskParamsRepository | Unset = UNSET - title: str | Unset = UNSET - body: str | Unset = UNSET - labels: list[UpdateGithubIssueTaskParamsLabelsItem] | Unset = UNSET - labels_mode: UpdateGithubIssueTaskParamsLabelsMode | Unset = "replace" - issue_type: UpdateGithubIssueTaskParamsIssueType | Unset = UNSET - custom_fields_mapping: None | str | Unset = UNSET + completion: "UpdateGithubIssueTaskParamsCompletion" + task_type: Union[Unset, UpdateGithubIssueTaskParamsTaskType] = UNSET + repository: Union[Unset, "UpdateGithubIssueTaskParamsRepository"] = UNSET + title: Union[Unset, str] = UNSET + body: Union[Unset, str] = UNSET + labels: Union[Unset, list["UpdateGithubIssueTaskParamsLabelsItem"]] = UNSET + labels_mode: Union[Unset, UpdateGithubIssueTaskParamsLabelsMode] = "replace" + issue_type: Union[Unset, "UpdateGithubIssueTaskParamsIssueType"] = UNSET + custom_fields_mapping: Union[None, Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - issue_id = self.issue_id completion = self.completion.to_dict() - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - repository: dict[str, Any] | Unset = UNSET + repository: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.repository, Unset): repository = self.repository.to_dict() @@ -75,22 +72,22 @@ def to_dict(self) -> dict[str, Any]: body = self.body - labels: list[dict[str, Any]] | Unset = UNSET + labels: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.labels, Unset): labels = [] for labels_item_data in self.labels: labels_item = labels_item_data.to_dict() labels.append(labels_item) - labels_mode: str | Unset = UNSET + labels_mode: Union[Unset, str] = UNSET if not isinstance(self.labels_mode, Unset): labels_mode = self.labels_mode - issue_type: dict[str, Any] | Unset = UNSET + issue_type: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.issue_type, Unset): issue_type = self.issue_type.to_dict() - custom_fields_mapping: None | str | Unset + custom_fields_mapping: Union[None, Unset, str] if isinstance(self.custom_fields_mapping, Unset): custom_fields_mapping = UNSET else: @@ -136,14 +133,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: completion = UpdateGithubIssueTaskParamsCompletion.from_dict(d.pop("completion")) _task_type = d.pop("task_type", UNSET) - task_type: UpdateGithubIssueTaskParamsTaskType | Unset + task_type: Union[Unset, UpdateGithubIssueTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: task_type = check_update_github_issue_task_params_task_type(_task_type) _repository = d.pop("repository", UNSET) - repository: UpdateGithubIssueTaskParamsRepository | Unset + repository: Union[Unset, UpdateGithubIssueTaskParamsRepository] if isinstance(_repository, Unset): repository = UNSET else: @@ -153,35 +150,33 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: body = d.pop("body", UNSET) + labels = [] _labels = d.pop("labels", UNSET) - labels: list[UpdateGithubIssueTaskParamsLabelsItem] | Unset = UNSET - if _labels is not UNSET: - labels = [] - for labels_item_data in _labels: - labels_item = UpdateGithubIssueTaskParamsLabelsItem.from_dict(labels_item_data) + for labels_item_data in _labels or []: + labels_item = UpdateGithubIssueTaskParamsLabelsItem.from_dict(labels_item_data) - labels.append(labels_item) + labels.append(labels_item) _labels_mode = d.pop("labels_mode", UNSET) - labels_mode: UpdateGithubIssueTaskParamsLabelsMode | Unset + labels_mode: Union[Unset, UpdateGithubIssueTaskParamsLabelsMode] if isinstance(_labels_mode, Unset): labels_mode = UNSET else: labels_mode = check_update_github_issue_task_params_labels_mode(_labels_mode) _issue_type = d.pop("issue_type", UNSET) - issue_type: UpdateGithubIssueTaskParamsIssueType | Unset + issue_type: Union[Unset, UpdateGithubIssueTaskParamsIssueType] if isinstance(_issue_type, Unset): issue_type = UNSET else: issue_type = UpdateGithubIssueTaskParamsIssueType.from_dict(_issue_type) - def _parse_custom_fields_mapping(data: object) -> None | str | Unset: + def _parse_custom_fields_mapping(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) custom_fields_mapping = _parse_custom_fields_mapping(d.pop("custom_fields_mapping", UNSET)) diff --git a/rootly_sdk/models/update_github_issue_task_params_completion.py b/rootly_sdk/models/update_github_issue_task_params_completion.py index 2aaafc3b..80c76623 100644 --- a/rootly_sdk/models/update_github_issue_task_params_completion.py +++ b/rootly_sdk/models/update_github_issue_task_params_completion.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class UpdateGithubIssueTaskParamsCompletion: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_github_issue_task_params_issue_type.py b/rootly_sdk/models/update_github_issue_task_params_issue_type.py index 2699f2b5..d9154a54 100644 --- a/rootly_sdk/models/update_github_issue_task_params_issue_type.py +++ b/rootly_sdk/models/update_github_issue_task_params_issue_type.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,12 +14,12 @@ class UpdateGithubIssueTaskParamsIssueType: """The issue type Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_github_issue_task_params_labels_item.py b/rootly_sdk/models/update_github_issue_task_params_labels_item.py index c905b808..0b7e2859 100644 --- a/rootly_sdk/models/update_github_issue_task_params_labels_item.py +++ b/rootly_sdk/models/update_github_issue_task_params_labels_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class UpdateGithubIssueTaskParamsLabelsItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_github_issue_task_params_repository.py b/rootly_sdk/models/update_github_issue_task_params_repository.py index 541866c5..9d732125 100644 --- a/rootly_sdk/models/update_github_issue_task_params_repository.py +++ b/rootly_sdk/models/update_github_issue_task_params_repository.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,12 +14,12 @@ class UpdateGithubIssueTaskParamsRepository: """The repository (used for loading labels and issue types) Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_gitlab_issue_task_params.py b/rootly_sdk/models/update_gitlab_issue_task_params.py index c2fb8168..d6915d5f 100644 --- a/rootly_sdk/models/update_gitlab_issue_task_params.py +++ b/rootly_sdk/models/update_gitlab_issue_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,35 +27,34 @@ class UpdateGitlabIssueTaskParams: Attributes: issue_id (str): The issue id completion (UpdateGitlabIssueTaskParamsCompletion): - task_type (UpdateGitlabIssueTaskParamsTaskType | Unset): - issue_type (UpdateGitlabIssueTaskParamsIssueType | Unset): The issue type - title (str | Unset): The issue title - description (str | Unset): The issue description - labels (str | Unset): The issue labels - due_date (str | Unset): The due date + task_type (Union[Unset, UpdateGitlabIssueTaskParamsTaskType]): + issue_type (Union[Unset, UpdateGitlabIssueTaskParamsIssueType]): The issue type + title (Union[Unset, str]): The issue title + description (Union[Unset, str]): The issue description + labels (Union[Unset, str]): The issue labels + due_date (Union[Unset, str]): The due date """ issue_id: str - completion: UpdateGitlabIssueTaskParamsCompletion - task_type: UpdateGitlabIssueTaskParamsTaskType | Unset = UNSET - issue_type: UpdateGitlabIssueTaskParamsIssueType | Unset = UNSET - title: str | Unset = UNSET - description: str | Unset = UNSET - labels: str | Unset = UNSET - due_date: str | Unset = UNSET + completion: "UpdateGitlabIssueTaskParamsCompletion" + task_type: Union[Unset, UpdateGitlabIssueTaskParamsTaskType] = UNSET + issue_type: Union[Unset, UpdateGitlabIssueTaskParamsIssueType] = UNSET + title: Union[Unset, str] = UNSET + description: Union[Unset, str] = UNSET + labels: Union[Unset, str] = UNSET + due_date: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - issue_id = self.issue_id completion = self.completion.to_dict() - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - issue_type: str | Unset = UNSET + issue_type: Union[Unset, str] = UNSET if not isinstance(self.issue_type, Unset): issue_type = self.issue_type @@ -102,14 +99,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: completion = UpdateGitlabIssueTaskParamsCompletion.from_dict(d.pop("completion")) _task_type = d.pop("task_type", UNSET) - task_type: UpdateGitlabIssueTaskParamsTaskType | Unset + task_type: Union[Unset, UpdateGitlabIssueTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: task_type = check_update_gitlab_issue_task_params_task_type(_task_type) _issue_type = d.pop("issue_type", UNSET) - issue_type: UpdateGitlabIssueTaskParamsIssueType | Unset + issue_type: Union[Unset, UpdateGitlabIssueTaskParamsIssueType] if isinstance(_issue_type, Unset): issue_type = UNSET else: diff --git a/rootly_sdk/models/update_gitlab_issue_task_params_completion.py b/rootly_sdk/models/update_gitlab_issue_task_params_completion.py index 0fef7627..0dab22ae 100644 --- a/rootly_sdk/models/update_gitlab_issue_task_params_completion.py +++ b/rootly_sdk/models/update_gitlab_issue_task_params_completion.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class UpdateGitlabIssueTaskParamsCompletion: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_google_calendar_event_task_params.py b/rootly_sdk/models/update_google_calendar_event_task_params.py index 8f019d13..1131111d 100644 --- a/rootly_sdk/models/update_google_calendar_event_task_params.py +++ b/rootly_sdk/models/update_google_calendar_event_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -30,53 +28,52 @@ class UpdateGoogleCalendarEventTaskParams: """ Attributes: event_id (str): The event ID - task_type (UpdateGoogleCalendarEventTaskParamsTaskType | Unset): - calendar_id (None | str | Unset): Default: 'primary'. - summary (str | Unset): The event summary - description (str | Unset): The event description - adjustment_days (int | Unset): Days to adjust meeting by - time_of_meeting (str | Unset): Time of meeting in format HH:MM - meeting_duration (str | Unset): Meeting duration in format like '1 hour', '30 minutes' Example: 1 hour. - send_updates (bool | Unset): Send an email to the attendees notifying them of the event - can_guests_modify_event (bool | Unset): - can_guests_see_other_guests (bool | Unset): - can_guests_invite_others (bool | Unset): - attendees (list[str] | Unset): Emails of attendees - replace_attendees (bool | Unset): - conference_solution_key (UpdateGoogleCalendarEventTaskParamsConferenceSolutionKey | Unset): Sets the video + task_type (Union[Unset, UpdateGoogleCalendarEventTaskParamsTaskType]): + calendar_id (Union[None, Unset, str]): Default: 'primary'. + summary (Union[Unset, str]): The event summary + description (Union[Unset, str]): The event description + adjustment_days (Union[Unset, int]): Days to adjust meeting by + time_of_meeting (Union[Unset, str]): Time of meeting in format HH:MM + meeting_duration (Union[Unset, str]): Meeting duration in format like '1 hour', '30 minutes' Example: 1 hour. + send_updates (Union[Unset, bool]): Send an email to the attendees notifying them of the event + can_guests_modify_event (Union[Unset, bool]): + can_guests_see_other_guests (Union[Unset, bool]): + can_guests_invite_others (Union[Unset, bool]): + attendees (Union[Unset, list[str]]): Emails of attendees + replace_attendees (Union[Unset, bool]): + conference_solution_key (Union[Unset, UpdateGoogleCalendarEventTaskParamsConferenceSolutionKey]): Sets the video conference type attached to the meeting - post_to_incident_timeline (bool | Unset): - post_to_slack_channels (list[UpdateGoogleCalendarEventTaskParamsPostToSlackChannelsItem] | Unset): + post_to_incident_timeline (Union[Unset, bool]): + post_to_slack_channels (Union[Unset, list['UpdateGoogleCalendarEventTaskParamsPostToSlackChannelsItem']]): """ event_id: str - task_type: UpdateGoogleCalendarEventTaskParamsTaskType | Unset = UNSET - calendar_id: None | str | Unset = "primary" - summary: str | Unset = UNSET - description: str | Unset = UNSET - adjustment_days: int | Unset = UNSET - time_of_meeting: str | Unset = UNSET - meeting_duration: str | Unset = UNSET - send_updates: bool | Unset = UNSET - can_guests_modify_event: bool | Unset = UNSET - can_guests_see_other_guests: bool | Unset = UNSET - can_guests_invite_others: bool | Unset = UNSET - attendees: list[str] | Unset = UNSET - replace_attendees: bool | Unset = UNSET - conference_solution_key: UpdateGoogleCalendarEventTaskParamsConferenceSolutionKey | Unset = UNSET - post_to_incident_timeline: bool | Unset = UNSET - post_to_slack_channels: list[UpdateGoogleCalendarEventTaskParamsPostToSlackChannelsItem] | Unset = UNSET + task_type: Union[Unset, UpdateGoogleCalendarEventTaskParamsTaskType] = UNSET + calendar_id: Union[None, Unset, str] = "primary" + summary: Union[Unset, str] = UNSET + description: Union[Unset, str] = UNSET + adjustment_days: Union[Unset, int] = UNSET + time_of_meeting: Union[Unset, str] = UNSET + meeting_duration: Union[Unset, str] = UNSET + send_updates: Union[Unset, bool] = UNSET + can_guests_modify_event: Union[Unset, bool] = UNSET + can_guests_see_other_guests: Union[Unset, bool] = UNSET + can_guests_invite_others: Union[Unset, bool] = UNSET + attendees: Union[Unset, list[str]] = UNSET + replace_attendees: Union[Unset, bool] = UNSET + conference_solution_key: Union[Unset, UpdateGoogleCalendarEventTaskParamsConferenceSolutionKey] = UNSET + post_to_incident_timeline: Union[Unset, bool] = UNSET + post_to_slack_channels: Union[Unset, list["UpdateGoogleCalendarEventTaskParamsPostToSlackChannelsItem"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - event_id = self.event_id - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - calendar_id: None | str | Unset + calendar_id: Union[None, Unset, str] if isinstance(self.calendar_id, Unset): calendar_id = UNSET else: @@ -100,19 +97,19 @@ def to_dict(self) -> dict[str, Any]: can_guests_invite_others = self.can_guests_invite_others - attendees: list[str] | Unset = UNSET + attendees: Union[Unset, list[str]] = UNSET if not isinstance(self.attendees, Unset): attendees = self.attendees replace_attendees = self.replace_attendees - conference_solution_key: str | Unset = UNSET + conference_solution_key: Union[Unset, str] = UNSET if not isinstance(self.conference_solution_key, Unset): conference_solution_key = self.conference_solution_key post_to_incident_timeline = self.post_to_incident_timeline - post_to_slack_channels: list[dict[str, Any]] | Unset = UNSET + post_to_slack_channels: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.post_to_slack_channels, Unset): post_to_slack_channels = [] for post_to_slack_channels_item_data in self.post_to_slack_channels: @@ -171,18 +168,18 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: event_id = d.pop("event_id") _task_type = d.pop("task_type", UNSET) - task_type: UpdateGoogleCalendarEventTaskParamsTaskType | Unset + task_type: Union[Unset, UpdateGoogleCalendarEventTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: task_type = check_update_google_calendar_event_task_params_task_type(_task_type) - def _parse_calendar_id(data: object) -> None | str | Unset: + def _parse_calendar_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) calendar_id = _parse_calendar_id(d.pop("calendar_id", UNSET)) @@ -209,7 +206,7 @@ def _parse_calendar_id(data: object) -> None | str | Unset: replace_attendees = d.pop("replace_attendees", UNSET) _conference_solution_key = d.pop("conference_solution_key", UNSET) - conference_solution_key: UpdateGoogleCalendarEventTaskParamsConferenceSolutionKey | Unset + conference_solution_key: Union[Unset, UpdateGoogleCalendarEventTaskParamsConferenceSolutionKey] if isinstance(_conference_solution_key, Unset): conference_solution_key = UNSET else: @@ -219,16 +216,14 @@ def _parse_calendar_id(data: object) -> None | str | Unset: post_to_incident_timeline = d.pop("post_to_incident_timeline", UNSET) + post_to_slack_channels = [] _post_to_slack_channels = d.pop("post_to_slack_channels", UNSET) - post_to_slack_channels: list[UpdateGoogleCalendarEventTaskParamsPostToSlackChannelsItem] | Unset = UNSET - if _post_to_slack_channels is not UNSET: - post_to_slack_channels = [] - for post_to_slack_channels_item_data in _post_to_slack_channels: - post_to_slack_channels_item = UpdateGoogleCalendarEventTaskParamsPostToSlackChannelsItem.from_dict( - post_to_slack_channels_item_data - ) + for post_to_slack_channels_item_data in _post_to_slack_channels or []: + post_to_slack_channels_item = UpdateGoogleCalendarEventTaskParamsPostToSlackChannelsItem.from_dict( + post_to_slack_channels_item_data + ) - post_to_slack_channels.append(post_to_slack_channels_item) + post_to_slack_channels.append(post_to_slack_channels_item) update_google_calendar_event_task_params = cls( event_id=event_id, diff --git a/rootly_sdk/models/update_google_calendar_event_task_params_post_to_slack_channels_item.py b/rootly_sdk/models/update_google_calendar_event_task_params_post_to_slack_channels_item.py index 81404c8a..77f62cdf 100644 --- a/rootly_sdk/models/update_google_calendar_event_task_params_post_to_slack_channels_item.py +++ b/rootly_sdk/models/update_google_calendar_event_task_params_post_to_slack_channels_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class UpdateGoogleCalendarEventTaskParamsPostToSlackChannelsItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_google_chat_space_description_task_params.py b/rootly_sdk/models/update_google_chat_space_description_task_params.py index bf018939..d16fd40a 100644 --- a/rootly_sdk/models/update_google_chat_space_description_task_params.py +++ b/rootly_sdk/models/update_google_chat_space_description_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -27,21 +25,20 @@ class UpdateGoogleChatSpaceDescriptionTaskParams: Attributes: space (UpdateGoogleChatSpaceDescriptionTaskParamsSpace): description (str): The space description. Supports liquid markup - task_type (UpdateGoogleChatSpaceDescriptionTaskParamsTaskType | Unset): + task_type (Union[Unset, UpdateGoogleChatSpaceDescriptionTaskParamsTaskType]): """ - space: UpdateGoogleChatSpaceDescriptionTaskParamsSpace + space: "UpdateGoogleChatSpaceDescriptionTaskParamsSpace" description: str - task_type: UpdateGoogleChatSpaceDescriptionTaskParamsTaskType | Unset = UNSET + task_type: Union[Unset, UpdateGoogleChatSpaceDescriptionTaskParamsTaskType] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - space = self.space.to_dict() description = self.description - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -70,7 +67,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: description = d.pop("description") _task_type = d.pop("task_type", UNSET) - task_type: UpdateGoogleChatSpaceDescriptionTaskParamsTaskType | Unset + task_type: Union[Unset, UpdateGoogleChatSpaceDescriptionTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/update_google_chat_space_description_task_params_space.py b/rootly_sdk/models/update_google_chat_space_description_task_params_space.py index 42c6ff4f..19d7fa6e 100644 --- a/rootly_sdk/models/update_google_chat_space_description_task_params_space.py +++ b/rootly_sdk/models/update_google_chat_space_description_task_params_space.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class UpdateGoogleChatSpaceDescriptionTaskParamsSpace: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_google_docs_page_task_params.py b/rootly_sdk/models/update_google_docs_page_task_params.py index 80b0fe55..07521363 100644 --- a/rootly_sdk/models/update_google_docs_page_task_params.py +++ b/rootly_sdk/models/update_google_docs_page_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -20,29 +18,31 @@ class UpdateGoogleDocsPageTaskParams: """ Attributes: file_id (str): The Google Doc file ID - task_type (UpdateGoogleDocsPageTaskParamsTaskType | Unset): - title (str | Unset): The Google Doc title - content (str | Unset): The Google Doc content - post_mortem_template_id (str | Unset): Retrospective template to use when updating page, if desired - template_id (str | Unset): The Google Doc file ID to use as a template. - include_overview (bool | Unset): Default: True. - include_timeline (bool | Unset): Default: True. + task_type (Union[Unset, UpdateGoogleDocsPageTaskParamsTaskType]): + title (Union[Unset, str]): The Google Doc title + content (Union[Unset, str]): The Google Doc content + post_mortem_template_id (Union[Unset, str]): Retrospective template to use when updating page, if desired + template_id (Union[Unset, str]): The Google Doc file ID to use as a template. + include_overview (Union[Unset, bool]): Default: True. + include_timeline (Union[Unset, bool]): Default: True. + include_follow_ups (Union[Unset, bool]): Default: True. """ file_id: str - task_type: UpdateGoogleDocsPageTaskParamsTaskType | Unset = UNSET - title: str | Unset = UNSET - content: str | Unset = UNSET - post_mortem_template_id: str | Unset = UNSET - template_id: str | Unset = UNSET - include_overview: bool | Unset = True - include_timeline: bool | Unset = True + task_type: Union[Unset, UpdateGoogleDocsPageTaskParamsTaskType] = UNSET + title: Union[Unset, str] = UNSET + content: Union[Unset, str] = UNSET + post_mortem_template_id: Union[Unset, str] = UNSET + template_id: Union[Unset, str] = UNSET + include_overview: Union[Unset, bool] = True + include_timeline: Union[Unset, bool] = True + include_follow_ups: Union[Unset, bool] = True additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: file_id = self.file_id - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -58,6 +58,8 @@ def to_dict(self) -> dict[str, Any]: include_timeline = self.include_timeline + include_follow_ups = self.include_follow_ups + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update( @@ -79,6 +81,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["include_overview"] = include_overview if include_timeline is not UNSET: field_dict["include_timeline"] = include_timeline + if include_follow_ups is not UNSET: + field_dict["include_follow_ups"] = include_follow_ups return field_dict @@ -88,7 +92,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: file_id = d.pop("file_id") _task_type = d.pop("task_type", UNSET) - task_type: UpdateGoogleDocsPageTaskParamsTaskType | Unset + task_type: Union[Unset, UpdateGoogleDocsPageTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: @@ -106,6 +110,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: include_timeline = d.pop("include_timeline", UNSET) + include_follow_ups = d.pop("include_follow_ups", UNSET) + update_google_docs_page_task_params = cls( file_id=file_id, task_type=task_type, @@ -115,6 +121,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: template_id=template_id, include_overview=include_overview, include_timeline=include_timeline, + include_follow_ups=include_follow_ups, ) update_google_docs_page_task_params.additional_properties = d diff --git a/rootly_sdk/models/update_heartbeat.py b/rootly_sdk/models/update_heartbeat.py index 165a23ee..a8c09301 100644 --- a/rootly_sdk/models/update_heartbeat.py +++ b/rootly_sdk/models/update_heartbeat.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateHeartbeat: data (UpdateHeartbeatData): """ - data: UpdateHeartbeatData + data: "UpdateHeartbeatData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_heartbeat_data.py b/rootly_sdk/models/update_heartbeat_data.py index f068e428..b5696242 100644 --- a/rootly_sdk/models/update_heartbeat_data.py +++ b/rootly_sdk/models/update_heartbeat_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class UpdateHeartbeatData: """ type_: UpdateHeartbeatDataType - attributes: UpdateHeartbeatDataAttributes + attributes: "UpdateHeartbeatDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_heartbeat_data_attributes.py b/rootly_sdk/models/update_heartbeat_data_attributes.py index 6b0b4180..f2792b39 100644 --- a/rootly_sdk/models/update_heartbeat_data_attributes.py +++ b/rootly_sdk/models/update_heartbeat_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -22,36 +20,36 @@ class UpdateHeartbeatDataAttributes: """ Attributes: - name (str | Unset): The name of the heartbeat - description (None | str | Unset): The description of the heartbeat - alert_summary (str | Unset): Summary of alerts triggered when heartbeat expires. - alert_description (None | str | Unset): Description of alerts triggered when heartbeat expires. - alert_urgency_id (None | str | Unset): Urgency of alerts triggered when heartbeat expires. - interval (int | Unset): - interval_unit (UpdateHeartbeatDataAttributesIntervalUnit | Unset): - notification_target_id (str | Unset): - notification_target_type (UpdateHeartbeatDataAttributesNotificationTargetType | Unset): The type of the + name (Union[Unset, str]): The name of the heartbeat + description (Union[None, Unset, str]): The description of the heartbeat + alert_summary (Union[Unset, str]): Summary of alerts triggered when heartbeat expires. + alert_description (Union[None, Unset, str]): Description of alerts triggered when heartbeat expires. + alert_urgency_id (Union[None, Unset, str]): Urgency of alerts triggered when heartbeat expires. + interval (Union[Unset, int]): + interval_unit (Union[Unset, UpdateHeartbeatDataAttributesIntervalUnit]): + notification_target_id (Union[Unset, str]): + notification_target_type (Union[Unset, UpdateHeartbeatDataAttributesNotificationTargetType]): The type of the notification target. Please contact support if you encounter issues using `Functionality` as a target type. - owner_group_ids (list[str] | Unset): List of team IDs that own this heartbeat - enabled (bool | Unset): Whether to trigger alerts when heartbeat is expired. + owner_group_ids (Union[Unset, list[str]]): List of team IDs that own this heartbeat + enabled (Union[Unset, bool]): Whether to trigger alerts when heartbeat is expired. """ - name: str | Unset = UNSET - description: None | str | Unset = UNSET - alert_summary: str | Unset = UNSET - alert_description: None | str | Unset = UNSET - alert_urgency_id: None | str | Unset = UNSET - interval: int | Unset = UNSET - interval_unit: UpdateHeartbeatDataAttributesIntervalUnit | Unset = UNSET - notification_target_id: str | Unset = UNSET - notification_target_type: UpdateHeartbeatDataAttributesNotificationTargetType | Unset = UNSET - owner_group_ids: list[str] | Unset = UNSET - enabled: bool | Unset = UNSET + name: Union[Unset, str] = UNSET + description: Union[None, Unset, str] = UNSET + alert_summary: Union[Unset, str] = UNSET + alert_description: Union[None, Unset, str] = UNSET + alert_urgency_id: Union[None, Unset, str] = UNSET + interval: Union[Unset, int] = UNSET + interval_unit: Union[Unset, UpdateHeartbeatDataAttributesIntervalUnit] = UNSET + notification_target_id: Union[Unset, str] = UNSET + notification_target_type: Union[Unset, UpdateHeartbeatDataAttributesNotificationTargetType] = UNSET + owner_group_ids: Union[Unset, list[str]] = UNSET + enabled: Union[Unset, bool] = UNSET def to_dict(self) -> dict[str, Any]: name = self.name - description: None | str | Unset + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: @@ -59,13 +57,13 @@ def to_dict(self) -> dict[str, Any]: alert_summary = self.alert_summary - alert_description: None | str | Unset + alert_description: Union[None, Unset, str] if isinstance(self.alert_description, Unset): alert_description = UNSET else: alert_description = self.alert_description - alert_urgency_id: None | str | Unset + alert_urgency_id: Union[None, Unset, str] if isinstance(self.alert_urgency_id, Unset): alert_urgency_id = UNSET else: @@ -73,17 +71,17 @@ def to_dict(self) -> dict[str, Any]: interval = self.interval - interval_unit: str | Unset = UNSET + interval_unit: Union[Unset, str] = UNSET if not isinstance(self.interval_unit, Unset): interval_unit = self.interval_unit notification_target_id = self.notification_target_id - notification_target_type: str | Unset = UNSET + notification_target_type: Union[Unset, str] = UNSET if not isinstance(self.notification_target_type, Unset): notification_target_type = self.notification_target_type - owner_group_ids: list[str] | Unset = UNSET + owner_group_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.owner_group_ids, Unset): owner_group_ids = self.owner_group_ids @@ -122,39 +120,39 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) alert_summary = d.pop("alert_summary", UNSET) - def _parse_alert_description(data: object) -> None | str | Unset: + def _parse_alert_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) alert_description = _parse_alert_description(d.pop("alert_description", UNSET)) - def _parse_alert_urgency_id(data: object) -> None | str | Unset: + def _parse_alert_urgency_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) alert_urgency_id = _parse_alert_urgency_id(d.pop("alert_urgency_id", UNSET)) interval = d.pop("interval", UNSET) _interval_unit = d.pop("interval_unit", UNSET) - interval_unit: UpdateHeartbeatDataAttributesIntervalUnit | Unset + interval_unit: Union[Unset, UpdateHeartbeatDataAttributesIntervalUnit] if isinstance(_interval_unit, Unset): interval_unit = UNSET else: @@ -163,7 +161,7 @@ def _parse_alert_urgency_id(data: object) -> None | str | Unset: notification_target_id = d.pop("notification_target_id", UNSET) _notification_target_type = d.pop("notification_target_type", UNSET) - notification_target_type: UpdateHeartbeatDataAttributesNotificationTargetType | Unset + notification_target_type: Union[Unset, UpdateHeartbeatDataAttributesNotificationTargetType] if isinstance(_notification_target_type, Unset): notification_target_type = UNSET else: diff --git a/rootly_sdk/models/update_incident.py b/rootly_sdk/models/update_incident.py index 7f3dc16e..8539fba1 100644 --- a/rootly_sdk/models/update_incident.py +++ b/rootly_sdk/models/update_incident.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateIncident: data (UpdateIncidentData): """ - data: UpdateIncidentData + data: "UpdateIncidentData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_incident_action_item.py b/rootly_sdk/models/update_incident_action_item.py index b2746244..cd2fc2ac 100644 --- a/rootly_sdk/models/update_incident_action_item.py +++ b/rootly_sdk/models/update_incident_action_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateIncidentActionItem: data (UpdateIncidentActionItemData): """ - data: UpdateIncidentActionItemData + data: "UpdateIncidentActionItemData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_incident_action_item_data.py b/rootly_sdk/models/update_incident_action_item_data.py index ca8096f5..12a47e8c 100644 --- a/rootly_sdk/models/update_incident_action_item_data.py +++ b/rootly_sdk/models/update_incident_action_item_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class UpdateIncidentActionItemData: """ type_: UpdateIncidentActionItemDataType - attributes: UpdateIncidentActionItemDataAttributes + attributes: "UpdateIncidentActionItemDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_incident_action_item_data_attributes.py b/rootly_sdk/models/update_incident_action_item_data_attributes.py index 076174eb..fd6d7282 100644 --- a/rootly_sdk/models/update_incident_action_item_data_attributes.py +++ b/rootly_sdk/models/update_incident_action_item_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -32,58 +30,57 @@ class UpdateIncidentActionItemDataAttributes: """ Attributes: - summary (str | Unset): The summary of the action item - description (None | str | Unset): The description of the action item - kind (UpdateIncidentActionItemDataAttributesKind | Unset): The kind of the action item - assigned_to_user_id (int | None | Unset): ID of user you wish to assign this action item - assigned_to_group_ids (list[str] | None | Unset): IDs of groups you wish to assign this action item - priority (UpdateIncidentActionItemDataAttributesPriority | Unset): The priority of the action item - status (UpdateIncidentActionItemDataAttributesStatus | Unset): The status of the action item - due_date (None | str | Unset): The due date of the action item - jira_issue_id (None | str | Unset): The Jira issue ID. - jira_issue_key (None | str | Unset): The Jira issue key. - jira_issue_url (None | str | Unset): The Jira issue URL. - form_field_selections (list[UpdateIncidentActionItemDataAttributesFormFieldSelectionsType0Item] | None | Unset): - Custom field values to set on the action item. Ignored unless custom fields for action items are enabled for the - organization. + summary (Union[Unset, str]): The summary of the action item + description (Union[None, Unset, str]): The description of the action item + kind (Union[Unset, UpdateIncidentActionItemDataAttributesKind]): The kind of the action item + assigned_to_user_id (Union[None, Unset, int]): ID of user you wish to assign this action item + assigned_to_group_ids (Union[None, Unset, list[str]]): IDs of groups you wish to assign this action item + priority (Union[Unset, UpdateIncidentActionItemDataAttributesPriority]): The priority of the action item + status (Union[Unset, UpdateIncidentActionItemDataAttributesStatus]): The status of the action item + due_date (Union[None, Unset, str]): The due date of the action item + jira_issue_id (Union[None, Unset, str]): The Jira issue ID. + jira_issue_key (Union[None, Unset, str]): The Jira issue key. + jira_issue_url (Union[None, Unset, str]): The Jira issue URL. + form_field_selections (Union[None, Unset, + list['UpdateIncidentActionItemDataAttributesFormFieldSelectionsType0Item']]): Custom field values to set on the + action item. Ignored unless custom fields for action items are enabled for the organization. """ - summary: str | Unset = UNSET - description: None | str | Unset = UNSET - kind: UpdateIncidentActionItemDataAttributesKind | Unset = UNSET - assigned_to_user_id: int | None | Unset = UNSET - assigned_to_group_ids: list[str] | None | Unset = UNSET - priority: UpdateIncidentActionItemDataAttributesPriority | Unset = UNSET - status: UpdateIncidentActionItemDataAttributesStatus | Unset = UNSET - due_date: None | str | Unset = UNSET - jira_issue_id: None | str | Unset = UNSET - jira_issue_key: None | str | Unset = UNSET - jira_issue_url: None | str | Unset = UNSET - form_field_selections: list[UpdateIncidentActionItemDataAttributesFormFieldSelectionsType0Item] | None | Unset = ( - UNSET - ) + summary: Union[Unset, str] = UNSET + description: Union[None, Unset, str] = UNSET + kind: Union[Unset, UpdateIncidentActionItemDataAttributesKind] = UNSET + assigned_to_user_id: Union[None, Unset, int] = UNSET + assigned_to_group_ids: Union[None, Unset, list[str]] = UNSET + priority: Union[Unset, UpdateIncidentActionItemDataAttributesPriority] = UNSET + status: Union[Unset, UpdateIncidentActionItemDataAttributesStatus] = UNSET + due_date: Union[None, Unset, str] = UNSET + jira_issue_id: Union[None, Unset, str] = UNSET + jira_issue_key: Union[None, Unset, str] = UNSET + jira_issue_url: Union[None, Unset, str] = UNSET + form_field_selections: Union[ + None, Unset, list["UpdateIncidentActionItemDataAttributesFormFieldSelectionsType0Item"] + ] = UNSET def to_dict(self) -> dict[str, Any]: - summary = self.summary - description: None | str | Unset + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: description = self.description - kind: str | Unset = UNSET + kind: Union[Unset, str] = UNSET if not isinstance(self.kind, Unset): kind = self.kind - assigned_to_user_id: int | None | Unset + assigned_to_user_id: Union[None, Unset, int] if isinstance(self.assigned_to_user_id, Unset): assigned_to_user_id = UNSET else: assigned_to_user_id = self.assigned_to_user_id - assigned_to_group_ids: list[str] | None | Unset + assigned_to_group_ids: Union[None, Unset, list[str]] if isinstance(self.assigned_to_group_ids, Unset): assigned_to_group_ids = UNSET elif isinstance(self.assigned_to_group_ids, list): @@ -92,39 +89,39 @@ def to_dict(self) -> dict[str, Any]: else: assigned_to_group_ids = self.assigned_to_group_ids - priority: str | Unset = UNSET + priority: Union[Unset, str] = UNSET if not isinstance(self.priority, Unset): priority = self.priority - status: str | Unset = UNSET + status: Union[Unset, str] = UNSET if not isinstance(self.status, Unset): status = self.status - due_date: None | str | Unset + due_date: Union[None, Unset, str] if isinstance(self.due_date, Unset): due_date = UNSET else: due_date = self.due_date - jira_issue_id: None | str | Unset + jira_issue_id: Union[None, Unset, str] if isinstance(self.jira_issue_id, Unset): jira_issue_id = UNSET else: jira_issue_id = self.jira_issue_id - jira_issue_key: None | str | Unset + jira_issue_key: Union[None, Unset, str] if isinstance(self.jira_issue_key, Unset): jira_issue_key = UNSET else: jira_issue_key = self.jira_issue_key - jira_issue_url: None | str | Unset + jira_issue_url: Union[None, Unset, str] if isinstance(self.jira_issue_url, Unset): jira_issue_url = UNSET else: jira_issue_url = self.jira_issue_url - form_field_selections: list[dict[str, Any]] | None | Unset + form_field_selections: Union[None, Unset, list[dict[str, Any]]] if isinstance(self.form_field_selections, Unset): form_field_selections = UNSET elif isinstance(self.form_field_selections, list): @@ -175,32 +172,32 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) summary = d.pop("summary", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) _kind = d.pop("kind", UNSET) - kind: UpdateIncidentActionItemDataAttributesKind | Unset + kind: Union[Unset, UpdateIncidentActionItemDataAttributesKind] if isinstance(_kind, Unset): kind = UNSET else: kind = check_update_incident_action_item_data_attributes_kind(_kind) - def _parse_assigned_to_user_id(data: object) -> int | None | Unset: + def _parse_assigned_to_user_id(data: object) -> Union[None, Unset, int]: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(Union[None, Unset, int], data) assigned_to_user_id = _parse_assigned_to_user_id(d.pop("assigned_to_user_id", UNSET)) - def _parse_assigned_to_group_ids(data: object) -> list[str] | None | Unset: + def _parse_assigned_to_group_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -211,65 +208,65 @@ def _parse_assigned_to_group_ids(data: object) -> list[str] | None | Unset: assigned_to_group_ids_type_0 = cast(list[str], data) return assigned_to_group_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) assigned_to_group_ids = _parse_assigned_to_group_ids(d.pop("assigned_to_group_ids", UNSET)) _priority = d.pop("priority", UNSET) - priority: UpdateIncidentActionItemDataAttributesPriority | Unset + priority: Union[Unset, UpdateIncidentActionItemDataAttributesPriority] if isinstance(_priority, Unset): priority = UNSET else: priority = check_update_incident_action_item_data_attributes_priority(_priority) _status = d.pop("status", UNSET) - status: UpdateIncidentActionItemDataAttributesStatus | Unset + status: Union[Unset, UpdateIncidentActionItemDataAttributesStatus] if isinstance(_status, Unset): status = UNSET else: status = check_update_incident_action_item_data_attributes_status(_status) - def _parse_due_date(data: object) -> None | str | Unset: + def _parse_due_date(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) due_date = _parse_due_date(d.pop("due_date", UNSET)) - def _parse_jira_issue_id(data: object) -> None | str | Unset: + def _parse_jira_issue_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) jira_issue_id = _parse_jira_issue_id(d.pop("jira_issue_id", UNSET)) - def _parse_jira_issue_key(data: object) -> None | str | Unset: + def _parse_jira_issue_key(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) jira_issue_key = _parse_jira_issue_key(d.pop("jira_issue_key", UNSET)) - def _parse_jira_issue_url(data: object) -> None | str | Unset: + def _parse_jira_issue_url(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) jira_issue_url = _parse_jira_issue_url(d.pop("jira_issue_url", UNSET)) def _parse_form_field_selections( data: object, - ) -> list[UpdateIncidentActionItemDataAttributesFormFieldSelectionsType0Item] | None | Unset: + ) -> Union[None, Unset, list["UpdateIncidentActionItemDataAttributesFormFieldSelectionsType0Item"]]: if data is None: return data if isinstance(data, Unset): @@ -289,9 +286,11 @@ def _parse_form_field_selections( form_field_selections_type_0.append(form_field_selections_type_0_item) return form_field_selections_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[UpdateIncidentActionItemDataAttributesFormFieldSelectionsType0Item] | None | Unset, data) + return cast( + Union[None, Unset, list["UpdateIncidentActionItemDataAttributesFormFieldSelectionsType0Item"]], data + ) form_field_selections = _parse_form_field_selections(d.pop("form_field_selections", UNSET)) diff --git a/rootly_sdk/models/update_incident_action_item_data_attributes_form_field_selections_type_0_item.py b/rootly_sdk/models/update_incident_action_item_data_attributes_form_field_selections_type_0_item.py index 95df1e5a..3314f34c 100644 --- a/rootly_sdk/models/update_incident_action_item_data_attributes_form_field_selections_type_0_item.py +++ b/rootly_sdk/models/update_incident_action_item_data_attributes_form_field_selections_type_0_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -15,41 +13,42 @@ class UpdateIncidentActionItemDataAttributesFormFieldSelectionsType0Item: """ Attributes: form_field_id (str): ID of the custom field - id (str | Unset): ID of an existing selection. Required when updating or removing a field's existing value. - value (list[str] | None | str | Unset): Value for text, textarea, rich text, date, datetime, number, checkbox, - or tag fields - selected_option_ids (list[str] | Unset): IDs of the selected custom field options - selected_user_ids (list[int] | Unset): IDs of the selected users - selected_group_ids (list[str] | Unset): IDs of the selected teams - selected_service_ids (list[str] | Unset): IDs of the selected services - selected_functionality_ids (list[str] | Unset): IDs of the selected functionalities - selected_catalog_entity_ids (list[str] | Unset): IDs of the selected catalog entities - selected_environment_ids (list[str] | Unset): IDs of the selected environments - selected_cause_ids (list[str] | Unset): IDs of the selected causes - selected_incident_type_ids (list[str] | Unset): IDs of the selected incident types - field_destroy (bool | None | Unset): Set to true to remove the field's value from the action item + id (Union[Unset, str]): ID of an existing selection. Required when updating or removing a field's existing + value. + value (Union[None, Unset, list[str], str]): Value for text, textarea, rich text, date, datetime, number, + checkbox, or tag fields + selected_option_ids (Union[Unset, list[str]]): IDs of the selected custom field options + selected_user_ids (Union[Unset, list[int]]): IDs of the selected users + selected_group_ids (Union[Unset, list[str]]): IDs of the selected teams + selected_service_ids (Union[Unset, list[str]]): IDs of the selected services + selected_functionality_ids (Union[Unset, list[str]]): IDs of the selected functionalities + selected_catalog_entity_ids (Union[Unset, list[str]]): IDs of the selected catalog entities + selected_environment_ids (Union[Unset, list[str]]): IDs of the selected environments + selected_cause_ids (Union[Unset, list[str]]): IDs of the selected causes + selected_incident_type_ids (Union[Unset, list[str]]): IDs of the selected incident types + field_destroy (Union[None, Unset, bool]): Set to true to remove the field's value from the action item """ form_field_id: str - id: str | Unset = UNSET - value: list[str] | None | str | Unset = UNSET - selected_option_ids: list[str] | Unset = UNSET - selected_user_ids: list[int] | Unset = UNSET - selected_group_ids: list[str] | Unset = UNSET - selected_service_ids: list[str] | Unset = UNSET - selected_functionality_ids: list[str] | Unset = UNSET - selected_catalog_entity_ids: list[str] | Unset = UNSET - selected_environment_ids: list[str] | Unset = UNSET - selected_cause_ids: list[str] | Unset = UNSET - selected_incident_type_ids: list[str] | Unset = UNSET - field_destroy: bool | None | Unset = UNSET + id: Union[Unset, str] = UNSET + value: Union[None, Unset, list[str], str] = UNSET + selected_option_ids: Union[Unset, list[str]] = UNSET + selected_user_ids: Union[Unset, list[int]] = UNSET + selected_group_ids: Union[Unset, list[str]] = UNSET + selected_service_ids: Union[Unset, list[str]] = UNSET + selected_functionality_ids: Union[Unset, list[str]] = UNSET + selected_catalog_entity_ids: Union[Unset, list[str]] = UNSET + selected_environment_ids: Union[Unset, list[str]] = UNSET + selected_cause_ids: Union[Unset, list[str]] = UNSET + selected_incident_type_ids: Union[Unset, list[str]] = UNSET + field_destroy: Union[None, Unset, bool] = UNSET def to_dict(self) -> dict[str, Any]: form_field_id = self.form_field_id id = self.id - value: list[str] | None | str | Unset + value: Union[None, Unset, list[str], str] if isinstance(self.value, Unset): value = UNSET elif isinstance(self.value, list): @@ -58,43 +57,43 @@ def to_dict(self) -> dict[str, Any]: else: value = self.value - selected_option_ids: list[str] | Unset = UNSET + selected_option_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.selected_option_ids, Unset): selected_option_ids = self.selected_option_ids - selected_user_ids: list[int] | Unset = UNSET + selected_user_ids: Union[Unset, list[int]] = UNSET if not isinstance(self.selected_user_ids, Unset): selected_user_ids = self.selected_user_ids - selected_group_ids: list[str] | Unset = UNSET + selected_group_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.selected_group_ids, Unset): selected_group_ids = self.selected_group_ids - selected_service_ids: list[str] | Unset = UNSET + selected_service_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.selected_service_ids, Unset): selected_service_ids = self.selected_service_ids - selected_functionality_ids: list[str] | Unset = UNSET + selected_functionality_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.selected_functionality_ids, Unset): selected_functionality_ids = self.selected_functionality_ids - selected_catalog_entity_ids: list[str] | Unset = UNSET + selected_catalog_entity_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.selected_catalog_entity_ids, Unset): selected_catalog_entity_ids = self.selected_catalog_entity_ids - selected_environment_ids: list[str] | Unset = UNSET + selected_environment_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.selected_environment_ids, Unset): selected_environment_ids = self.selected_environment_ids - selected_cause_ids: list[str] | Unset = UNSET + selected_cause_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.selected_cause_ids, Unset): selected_cause_ids = self.selected_cause_ids - selected_incident_type_ids: list[str] | Unset = UNSET + selected_incident_type_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.selected_incident_type_ids, Unset): selected_incident_type_ids = self.selected_incident_type_ids - field_destroy: bool | None | Unset + field_destroy: Union[None, Unset, bool] if isinstance(self.field_destroy, Unset): field_destroy = UNSET else: @@ -141,7 +140,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: id = d.pop("id", UNSET) - def _parse_value(data: object) -> list[str] | None | str | Unset: + def _parse_value(data: object) -> Union[None, Unset, list[str], str]: if data is None: return data if isinstance(data, Unset): @@ -152,9 +151,9 @@ def _parse_value(data: object) -> list[str] | None | str | Unset: value_type_1 = cast(list[str], data) return value_type_1 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | str | Unset, data) + return cast(Union[None, Unset, list[str], str], data) value = _parse_value(d.pop("value", UNSET)) @@ -176,12 +175,12 @@ def _parse_value(data: object) -> list[str] | None | str | Unset: selected_incident_type_ids = cast(list[str], d.pop("selected_incident_type_ids", UNSET)) - def _parse_field_destroy(data: object) -> bool | None | Unset: + def _parse_field_destroy(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) field_destroy = _parse_field_destroy(d.pop("_destroy", UNSET)) diff --git a/rootly_sdk/models/update_incident_custom_field_selection.py b/rootly_sdk/models/update_incident_custom_field_selection.py index 9aa40a6f..3690992c 100644 --- a/rootly_sdk/models/update_incident_custom_field_selection.py +++ b/rootly_sdk/models/update_incident_custom_field_selection.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateIncidentCustomFieldSelection: data (UpdateIncidentCustomFieldSelectionData): """ - data: UpdateIncidentCustomFieldSelectionData + data: "UpdateIncidentCustomFieldSelectionData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_incident_custom_field_selection_data.py b/rootly_sdk/models/update_incident_custom_field_selection_data.py index 365c90ba..a439389b 100644 --- a/rootly_sdk/models/update_incident_custom_field_selection_data.py +++ b/rootly_sdk/models/update_incident_custom_field_selection_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class UpdateIncidentCustomFieldSelectionData: """ type_: UpdateIncidentCustomFieldSelectionDataType - attributes: UpdateIncidentCustomFieldSelectionDataAttributes + attributes: "UpdateIncidentCustomFieldSelectionDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_incident_custom_field_selection_data_attributes.py b/rootly_sdk/models/update_incident_custom_field_selection_data_attributes.py index 04f6d0da..b55e5a4f 100644 --- a/rootly_sdk/models/update_incident_custom_field_selection_data_attributes.py +++ b/rootly_sdk/models/update_incident_custom_field_selection_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -14,21 +12,21 @@ class UpdateIncidentCustomFieldSelectionDataAttributes: """ Attributes: - value (None | str | Unset): The selected value for text kind custom fields - selected_option_ids (list[int] | Unset): + value (Union[None, Unset, str]): The selected value for text kind custom fields + selected_option_ids (Union[Unset, list[int]]): """ - value: None | str | Unset = UNSET - selected_option_ids: list[int] | Unset = UNSET + value: Union[None, Unset, str] = UNSET + selected_option_ids: Union[Unset, list[int]] = UNSET def to_dict(self) -> dict[str, Any]: - value: None | str | Unset + value: Union[None, Unset, str] if isinstance(self.value, Unset): value = UNSET else: value = self.value - selected_option_ids: list[int] | Unset = UNSET + selected_option_ids: Union[Unset, list[int]] = UNSET if not isinstance(self.selected_option_ids, Unset): selected_option_ids = self.selected_option_ids @@ -46,12 +44,12 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_value(data: object) -> None | str | Unset: + def _parse_value(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) value = _parse_value(d.pop("value", UNSET)) diff --git a/rootly_sdk/models/update_incident_data.py b/rootly_sdk/models/update_incident_data.py index 79df36e1..6f4da343 100644 --- a/rootly_sdk/models/update_incident_data.py +++ b/rootly_sdk/models/update_incident_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class UpdateIncidentData: """ type_: UpdateIncidentDataType - attributes: UpdateIncidentDataAttributes + attributes: "UpdateIncidentDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_incident_data_attributes.py b/rootly_sdk/models/update_incident_data_attributes.py index b92c2028..21d40aa6 100644 --- a/rootly_sdk/models/update_incident_data_attributes.py +++ b/rootly_sdk/models/update_incident_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -26,146 +24,146 @@ class UpdateIncidentDataAttributes: """ Attributes: - title (None | str | Unset): The title of the incident - kind (UpdateIncidentDataAttributesKind | Unset): The kind of the incident Default: 'normal'. - parent_incident_id (None | str | Unset): ID of parent incident - duplicate_incident_id (None | str | Unset): ID of duplicated incident - summary (None | str | Unset): The summary of the incident - status (UpdateIncidentDataAttributesStatus | Unset): The status of the incident - private (bool | None | Unset): Convert the incident as private. Once an incident is updated as private it cannot - be undone Default: False. - severity_id (None | str | Unset): The Severity ID to attach to the incident - public_title (None | str | Unset): The public title of the incident - alert_ids (list[str] | None | Unset): The Alert IDs to attach to the incident - environment_ids (list[str] | None | Unset): The Environment IDs to attach to the incident - incident_type_ids (list[str] | None | Unset): The Incident Type IDs to attach to the incident - service_ids (list[str] | None | Unset): The Service IDs to attach to the incident - functionality_ids (list[str] | None | Unset): The Functionality IDs to attach to the incident - muted_service_ids (list[str] | None | Unset): The Service IDs to mute alerts for during maintenance. Alerts for - these services will still be triggered and attached to the incident, but won't page responders. - group_ids (list[str] | None | Unset): The Team IDs to attach to the incident - cause_ids (list[str] | None | Unset): The Cause IDs to attach to the incident - labels (None | Unset | UpdateIncidentDataAttributesLabelsType0): Labels to attach to the incidents. eg: + title (Union[None, Unset, str]): The title of the incident + kind (Union[Unset, UpdateIncidentDataAttributesKind]): The kind of the incident Default: 'normal'. + parent_incident_id (Union[None, Unset, str]): ID of parent incident + duplicate_incident_id (Union[None, Unset, str]): ID of duplicated incident + summary (Union[None, Unset, str]): The summary of the incident + status (Union[Unset, UpdateIncidentDataAttributesStatus]): The status of the incident + private (Union[None, Unset, bool]): Convert the incident as private. Once an incident is updated as private it + cannot be undone Default: False. + severity_id (Union[None, Unset, str]): The Severity ID to attach to the incident + public_title (Union[None, Unset, str]): The public title of the incident + alert_ids (Union[None, Unset, list[str]]): The Alert IDs to attach to the incident + environment_ids (Union[None, Unset, list[str]]): The Environment IDs to attach to the incident + incident_type_ids (Union[None, Unset, list[str]]): The Incident Type IDs to attach to the incident + service_ids (Union[None, Unset, list[str]]): The Service IDs to attach to the incident + functionality_ids (Union[None, Unset, list[str]]): The Functionality IDs to attach to the incident + muted_service_ids (Union[None, Unset, list[str]]): The Service IDs to mute alerts for during maintenance. Alerts + for these services will still be triggered and attached to the incident, but won't page responders. + group_ids (Union[None, Unset, list[str]]): The Team IDs to attach to the incident + cause_ids (Union[None, Unset, list[str]]): The Cause IDs to attach to the incident + labels (Union['UpdateIncidentDataAttributesLabelsType0', None, Unset]): Labels to attach to the incidents. eg: {"platform":"osx", "version": "1.29"} - slack_channel_id (None | str | Unset): Slack channel id - slack_channel_name (None | str | Unset): Slack channel name - slack_channel_url (None | str | Unset): Slack channel url - slack_channel_archived (bool | None | Unset): Whether the Slack channel is archived - google_drive_parent_id (None | str | Unset): Google Drive parent folder ID - google_drive_url (None | str | Unset): Google Drive URL - jira_issue_key (None | str | Unset): Jira issue key - jira_issue_id (None | str | Unset): Jira issue ID - jira_issue_url (None | str | Unset): Jira issue URL - scheduled_for (None | str | Unset): Date of when the maintenance begins - scheduled_until (None | str | Unset): Date of when the maintenance ends - in_triage_at (None | str | Unset): Date of triage - started_at (None | str | Unset): Date of start - detected_at (None | str | Unset): Date of detection - acknowledged_at (None | str | Unset): Date of acknowledgment - mitigated_at (None | str | Unset): Date of mitigation - resolved_at (None | str | Unset): Date of resolution - closed_at (None | str | Unset): Date of closure - cancelled_at (None | str | Unset): Date of cancellation - mitigation_message (None | str | Unset): How was the incident mitigated? - resolution_message (None | str | Unset): How was the incident resolved? - cancellation_message (None | str | Unset): Why was the incident cancelled? + slack_channel_id (Union[None, Unset, str]): Slack channel id + slack_channel_name (Union[None, Unset, str]): Slack channel name + slack_channel_url (Union[None, Unset, str]): Slack channel url + slack_channel_archived (Union[None, Unset, bool]): Whether the Slack channel is archived + google_drive_parent_id (Union[None, Unset, str]): Google Drive parent folder ID + google_drive_url (Union[None, Unset, str]): Google Drive URL + jira_issue_key (Union[None, Unset, str]): Jira issue key + jira_issue_id (Union[None, Unset, str]): Jira issue ID + jira_issue_url (Union[None, Unset, str]): Jira issue URL + scheduled_for (Union[None, Unset, str]): Date of when the maintenance begins + scheduled_until (Union[None, Unset, str]): Date of when the maintenance ends + in_triage_at (Union[None, Unset, str]): Date of triage + started_at (Union[None, Unset, str]): Date of start + detected_at (Union[None, Unset, str]): Date of detection + acknowledged_at (Union[None, Unset, str]): Date of acknowledgment + mitigated_at (Union[None, Unset, str]): Date of mitigation + resolved_at (Union[None, Unset, str]): Date of resolution + closed_at (Union[None, Unset, str]): Date of closure + cancelled_at (Union[None, Unset, str]): Date of cancellation + mitigation_message (Union[None, Unset, str]): How was the incident mitigated? + resolution_message (Union[None, Unset, str]): How was the incident resolved? + cancellation_message (Union[None, Unset, str]): Why was the incident cancelled? """ - title: None | str | Unset = UNSET - kind: UpdateIncidentDataAttributesKind | Unset = "normal" - parent_incident_id: None | str | Unset = UNSET - duplicate_incident_id: None | str | Unset = UNSET - summary: None | str | Unset = UNSET - status: UpdateIncidentDataAttributesStatus | Unset = UNSET - private: bool | None | Unset = False - severity_id: None | str | Unset = UNSET - public_title: None | str | Unset = UNSET - alert_ids: list[str] | None | Unset = UNSET - environment_ids: list[str] | None | Unset = UNSET - incident_type_ids: list[str] | None | Unset = UNSET - service_ids: list[str] | None | Unset = UNSET - functionality_ids: list[str] | None | Unset = UNSET - muted_service_ids: list[str] | None | Unset = UNSET - group_ids: list[str] | None | Unset = UNSET - cause_ids: list[str] | None | Unset = UNSET - labels: None | Unset | UpdateIncidentDataAttributesLabelsType0 = UNSET - slack_channel_id: None | str | Unset = UNSET - slack_channel_name: None | str | Unset = UNSET - slack_channel_url: None | str | Unset = UNSET - slack_channel_archived: bool | None | Unset = UNSET - google_drive_parent_id: None | str | Unset = UNSET - google_drive_url: None | str | Unset = UNSET - jira_issue_key: None | str | Unset = UNSET - jira_issue_id: None | str | Unset = UNSET - jira_issue_url: None | str | Unset = UNSET - scheduled_for: None | str | Unset = UNSET - scheduled_until: None | str | Unset = UNSET - in_triage_at: None | str | Unset = UNSET - started_at: None | str | Unset = UNSET - detected_at: None | str | Unset = UNSET - acknowledged_at: None | str | Unset = UNSET - mitigated_at: None | str | Unset = UNSET - resolved_at: None | str | Unset = UNSET - closed_at: None | str | Unset = UNSET - cancelled_at: None | str | Unset = UNSET - mitigation_message: None | str | Unset = UNSET - resolution_message: None | str | Unset = UNSET - cancellation_message: None | str | Unset = UNSET + title: Union[None, Unset, str] = UNSET + kind: Union[Unset, UpdateIncidentDataAttributesKind] = "normal" + parent_incident_id: Union[None, Unset, str] = UNSET + duplicate_incident_id: Union[None, Unset, str] = UNSET + summary: Union[None, Unset, str] = UNSET + status: Union[Unset, UpdateIncidentDataAttributesStatus] = UNSET + private: Union[None, Unset, bool] = False + severity_id: Union[None, Unset, str] = UNSET + public_title: Union[None, Unset, str] = UNSET + alert_ids: Union[None, Unset, list[str]] = UNSET + environment_ids: Union[None, Unset, list[str]] = UNSET + incident_type_ids: Union[None, Unset, list[str]] = UNSET + service_ids: Union[None, Unset, list[str]] = UNSET + functionality_ids: Union[None, Unset, list[str]] = UNSET + muted_service_ids: Union[None, Unset, list[str]] = UNSET + group_ids: Union[None, Unset, list[str]] = UNSET + cause_ids: Union[None, Unset, list[str]] = UNSET + labels: Union["UpdateIncidentDataAttributesLabelsType0", None, Unset] = UNSET + slack_channel_id: Union[None, Unset, str] = UNSET + slack_channel_name: Union[None, Unset, str] = UNSET + slack_channel_url: Union[None, Unset, str] = UNSET + slack_channel_archived: Union[None, Unset, bool] = UNSET + google_drive_parent_id: Union[None, Unset, str] = UNSET + google_drive_url: Union[None, Unset, str] = UNSET + jira_issue_key: Union[None, Unset, str] = UNSET + jira_issue_id: Union[None, Unset, str] = UNSET + jira_issue_url: Union[None, Unset, str] = UNSET + scheduled_for: Union[None, Unset, str] = UNSET + scheduled_until: Union[None, Unset, str] = UNSET + in_triage_at: Union[None, Unset, str] = UNSET + started_at: Union[None, Unset, str] = UNSET + detected_at: Union[None, Unset, str] = UNSET + acknowledged_at: Union[None, Unset, str] = UNSET + mitigated_at: Union[None, Unset, str] = UNSET + resolved_at: Union[None, Unset, str] = UNSET + closed_at: Union[None, Unset, str] = UNSET + cancelled_at: Union[None, Unset, str] = UNSET + mitigation_message: Union[None, Unset, str] = UNSET + resolution_message: Union[None, Unset, str] = UNSET + cancellation_message: Union[None, Unset, str] = UNSET def to_dict(self) -> dict[str, Any]: from ..models.update_incident_data_attributes_labels_type_0 import UpdateIncidentDataAttributesLabelsType0 - title: None | str | Unset + title: Union[None, Unset, str] if isinstance(self.title, Unset): title = UNSET else: title = self.title - kind: str | Unset = UNSET + kind: Union[Unset, str] = UNSET if not isinstance(self.kind, Unset): kind = self.kind - parent_incident_id: None | str | Unset + parent_incident_id: Union[None, Unset, str] if isinstance(self.parent_incident_id, Unset): parent_incident_id = UNSET else: parent_incident_id = self.parent_incident_id - duplicate_incident_id: None | str | Unset + duplicate_incident_id: Union[None, Unset, str] if isinstance(self.duplicate_incident_id, Unset): duplicate_incident_id = UNSET else: duplicate_incident_id = self.duplicate_incident_id - summary: None | str | Unset + summary: Union[None, Unset, str] if isinstance(self.summary, Unset): summary = UNSET else: summary = self.summary - status: str | Unset = UNSET + status: Union[Unset, str] = UNSET if not isinstance(self.status, Unset): status = self.status - private: bool | None | Unset + private: Union[None, Unset, bool] if isinstance(self.private, Unset): private = UNSET else: private = self.private - severity_id: None | str | Unset + severity_id: Union[None, Unset, str] if isinstance(self.severity_id, Unset): severity_id = UNSET else: severity_id = self.severity_id - public_title: None | str | Unset + public_title: Union[None, Unset, str] if isinstance(self.public_title, Unset): public_title = UNSET else: public_title = self.public_title - alert_ids: list[str] | None | Unset + alert_ids: Union[None, Unset, list[str]] if isinstance(self.alert_ids, Unset): alert_ids = UNSET elif isinstance(self.alert_ids, list): @@ -174,7 +172,7 @@ def to_dict(self) -> dict[str, Any]: else: alert_ids = self.alert_ids - environment_ids: list[str] | None | Unset + environment_ids: Union[None, Unset, list[str]] if isinstance(self.environment_ids, Unset): environment_ids = UNSET elif isinstance(self.environment_ids, list): @@ -183,7 +181,7 @@ def to_dict(self) -> dict[str, Any]: else: environment_ids = self.environment_ids - incident_type_ids: list[str] | None | Unset + incident_type_ids: Union[None, Unset, list[str]] if isinstance(self.incident_type_ids, Unset): incident_type_ids = UNSET elif isinstance(self.incident_type_ids, list): @@ -192,7 +190,7 @@ def to_dict(self) -> dict[str, Any]: else: incident_type_ids = self.incident_type_ids - service_ids: list[str] | None | Unset + service_ids: Union[None, Unset, list[str]] if isinstance(self.service_ids, Unset): service_ids = UNSET elif isinstance(self.service_ids, list): @@ -201,7 +199,7 @@ def to_dict(self) -> dict[str, Any]: else: service_ids = self.service_ids - functionality_ids: list[str] | None | Unset + functionality_ids: Union[None, Unset, list[str]] if isinstance(self.functionality_ids, Unset): functionality_ids = UNSET elif isinstance(self.functionality_ids, list): @@ -210,7 +208,7 @@ def to_dict(self) -> dict[str, Any]: else: functionality_ids = self.functionality_ids - muted_service_ids: list[str] | None | Unset + muted_service_ids: Union[None, Unset, list[str]] if isinstance(self.muted_service_ids, Unset): muted_service_ids = UNSET elif isinstance(self.muted_service_ids, list): @@ -219,7 +217,7 @@ def to_dict(self) -> dict[str, Any]: else: muted_service_ids = self.muted_service_ids - group_ids: list[str] | None | Unset + group_ids: Union[None, Unset, list[str]] if isinstance(self.group_ids, Unset): group_ids = UNSET elif isinstance(self.group_ids, list): @@ -228,7 +226,7 @@ def to_dict(self) -> dict[str, Any]: else: group_ids = self.group_ids - cause_ids: list[str] | None | Unset + cause_ids: Union[None, Unset, list[str]] if isinstance(self.cause_ids, Unset): cause_ids = UNSET elif isinstance(self.cause_ids, list): @@ -237,7 +235,7 @@ def to_dict(self) -> dict[str, Any]: else: cause_ids = self.cause_ids - labels: dict[str, Any] | None | Unset + labels: Union[None, Unset, dict[str, Any]] if isinstance(self.labels, Unset): labels = UNSET elif isinstance(self.labels, UpdateIncidentDataAttributesLabelsType0): @@ -245,133 +243,133 @@ def to_dict(self) -> dict[str, Any]: else: labels = self.labels - slack_channel_id: None | str | Unset + slack_channel_id: Union[None, Unset, str] if isinstance(self.slack_channel_id, Unset): slack_channel_id = UNSET else: slack_channel_id = self.slack_channel_id - slack_channel_name: None | str | Unset + slack_channel_name: Union[None, Unset, str] if isinstance(self.slack_channel_name, Unset): slack_channel_name = UNSET else: slack_channel_name = self.slack_channel_name - slack_channel_url: None | str | Unset + slack_channel_url: Union[None, Unset, str] if isinstance(self.slack_channel_url, Unset): slack_channel_url = UNSET else: slack_channel_url = self.slack_channel_url - slack_channel_archived: bool | None | Unset + slack_channel_archived: Union[None, Unset, bool] if isinstance(self.slack_channel_archived, Unset): slack_channel_archived = UNSET else: slack_channel_archived = self.slack_channel_archived - google_drive_parent_id: None | str | Unset + google_drive_parent_id: Union[None, Unset, str] if isinstance(self.google_drive_parent_id, Unset): google_drive_parent_id = UNSET else: google_drive_parent_id = self.google_drive_parent_id - google_drive_url: None | str | Unset + google_drive_url: Union[None, Unset, str] if isinstance(self.google_drive_url, Unset): google_drive_url = UNSET else: google_drive_url = self.google_drive_url - jira_issue_key: None | str | Unset + jira_issue_key: Union[None, Unset, str] if isinstance(self.jira_issue_key, Unset): jira_issue_key = UNSET else: jira_issue_key = self.jira_issue_key - jira_issue_id: None | str | Unset + jira_issue_id: Union[None, Unset, str] if isinstance(self.jira_issue_id, Unset): jira_issue_id = UNSET else: jira_issue_id = self.jira_issue_id - jira_issue_url: None | str | Unset + jira_issue_url: Union[None, Unset, str] if isinstance(self.jira_issue_url, Unset): jira_issue_url = UNSET else: jira_issue_url = self.jira_issue_url - scheduled_for: None | str | Unset + scheduled_for: Union[None, Unset, str] if isinstance(self.scheduled_for, Unset): scheduled_for = UNSET else: scheduled_for = self.scheduled_for - scheduled_until: None | str | Unset + scheduled_until: Union[None, Unset, str] if isinstance(self.scheduled_until, Unset): scheduled_until = UNSET else: scheduled_until = self.scheduled_until - in_triage_at: None | str | Unset + in_triage_at: Union[None, Unset, str] if isinstance(self.in_triage_at, Unset): in_triage_at = UNSET else: in_triage_at = self.in_triage_at - started_at: None | str | Unset + started_at: Union[None, Unset, str] if isinstance(self.started_at, Unset): started_at = UNSET else: started_at = self.started_at - detected_at: None | str | Unset + detected_at: Union[None, Unset, str] if isinstance(self.detected_at, Unset): detected_at = UNSET else: detected_at = self.detected_at - acknowledged_at: None | str | Unset + acknowledged_at: Union[None, Unset, str] if isinstance(self.acknowledged_at, Unset): acknowledged_at = UNSET else: acknowledged_at = self.acknowledged_at - mitigated_at: None | str | Unset + mitigated_at: Union[None, Unset, str] if isinstance(self.mitigated_at, Unset): mitigated_at = UNSET else: mitigated_at = self.mitigated_at - resolved_at: None | str | Unset + resolved_at: Union[None, Unset, str] if isinstance(self.resolved_at, Unset): resolved_at = UNSET else: resolved_at = self.resolved_at - closed_at: None | str | Unset + closed_at: Union[None, Unset, str] if isinstance(self.closed_at, Unset): closed_at = UNSET else: closed_at = self.closed_at - cancelled_at: None | str | Unset + cancelled_at: Union[None, Unset, str] if isinstance(self.cancelled_at, Unset): cancelled_at = UNSET else: cancelled_at = self.cancelled_at - mitigation_message: None | str | Unset + mitigation_message: Union[None, Unset, str] if isinstance(self.mitigation_message, Unset): mitigation_message = UNSET else: mitigation_message = self.mitigation_message - resolution_message: None | str | Unset + resolution_message: Union[None, Unset, str] if isinstance(self.resolution_message, Unset): resolution_message = UNSET else: resolution_message = self.resolution_message - cancellation_message: None | str | Unset + cancellation_message: Union[None, Unset, str] if isinstance(self.cancellation_message, Unset): cancellation_message = UNSET else: @@ -469,84 +467,84 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_title(data: object) -> None | str | Unset: + def _parse_title(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) title = _parse_title(d.pop("title", UNSET)) _kind = d.pop("kind", UNSET) - kind: UpdateIncidentDataAttributesKind | Unset + kind: Union[Unset, UpdateIncidentDataAttributesKind] if isinstance(_kind, Unset): kind = UNSET else: kind = check_update_incident_data_attributes_kind(_kind) - def _parse_parent_incident_id(data: object) -> None | str | Unset: + def _parse_parent_incident_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) parent_incident_id = _parse_parent_incident_id(d.pop("parent_incident_id", UNSET)) - def _parse_duplicate_incident_id(data: object) -> None | str | Unset: + def _parse_duplicate_incident_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) duplicate_incident_id = _parse_duplicate_incident_id(d.pop("duplicate_incident_id", UNSET)) - def _parse_summary(data: object) -> None | str | Unset: + def _parse_summary(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) summary = _parse_summary(d.pop("summary", UNSET)) _status = d.pop("status", UNSET) - status: UpdateIncidentDataAttributesStatus | Unset + status: Union[Unset, UpdateIncidentDataAttributesStatus] if isinstance(_status, Unset): status = UNSET else: status = check_update_incident_data_attributes_status(_status) - def _parse_private(data: object) -> bool | None | Unset: + def _parse_private(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) private = _parse_private(d.pop("private", UNSET)) - def _parse_severity_id(data: object) -> None | str | Unset: + def _parse_severity_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) severity_id = _parse_severity_id(d.pop("severity_id", UNSET)) - def _parse_public_title(data: object) -> None | str | Unset: + def _parse_public_title(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) public_title = _parse_public_title(d.pop("public_title", UNSET)) - def _parse_alert_ids(data: object) -> list[str] | None | Unset: + def _parse_alert_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -557,13 +555,13 @@ def _parse_alert_ids(data: object) -> list[str] | None | Unset: alert_ids_type_0 = cast(list[str], data) return alert_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) alert_ids = _parse_alert_ids(d.pop("alert_ids", UNSET)) - def _parse_environment_ids(data: object) -> list[str] | None | Unset: + def _parse_environment_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -574,13 +572,13 @@ def _parse_environment_ids(data: object) -> list[str] | None | Unset: environment_ids_type_0 = cast(list[str], data) return environment_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) environment_ids = _parse_environment_ids(d.pop("environment_ids", UNSET)) - def _parse_incident_type_ids(data: object) -> list[str] | None | Unset: + def _parse_incident_type_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -591,13 +589,13 @@ def _parse_incident_type_ids(data: object) -> list[str] | None | Unset: incident_type_ids_type_0 = cast(list[str], data) return incident_type_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) incident_type_ids = _parse_incident_type_ids(d.pop("incident_type_ids", UNSET)) - def _parse_service_ids(data: object) -> list[str] | None | Unset: + def _parse_service_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -608,13 +606,13 @@ def _parse_service_ids(data: object) -> list[str] | None | Unset: service_ids_type_0 = cast(list[str], data) return service_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) service_ids = _parse_service_ids(d.pop("service_ids", UNSET)) - def _parse_functionality_ids(data: object) -> list[str] | None | Unset: + def _parse_functionality_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -625,13 +623,13 @@ def _parse_functionality_ids(data: object) -> list[str] | None | Unset: functionality_ids_type_0 = cast(list[str], data) return functionality_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) functionality_ids = _parse_functionality_ids(d.pop("functionality_ids", UNSET)) - def _parse_muted_service_ids(data: object) -> list[str] | None | Unset: + def _parse_muted_service_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -642,13 +640,13 @@ def _parse_muted_service_ids(data: object) -> list[str] | None | Unset: muted_service_ids_type_0 = cast(list[str], data) return muted_service_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) muted_service_ids = _parse_muted_service_ids(d.pop("muted_service_ids", UNSET)) - def _parse_group_ids(data: object) -> list[str] | None | Unset: + def _parse_group_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -659,13 +657,13 @@ def _parse_group_ids(data: object) -> list[str] | None | Unset: group_ids_type_0 = cast(list[str], data) return group_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) group_ids = _parse_group_ids(d.pop("group_ids", UNSET)) - def _parse_cause_ids(data: object) -> list[str] | None | Unset: + def _parse_cause_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -676,13 +674,13 @@ def _parse_cause_ids(data: object) -> list[str] | None | Unset: cause_ids_type_0 = cast(list[str], data) return cause_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) cause_ids = _parse_cause_ids(d.pop("cause_ids", UNSET)) - def _parse_labels(data: object) -> None | Unset | UpdateIncidentDataAttributesLabelsType0: + def _parse_labels(data: object) -> Union["UpdateIncidentDataAttributesLabelsType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -693,207 +691,207 @@ def _parse_labels(data: object) -> None | Unset | UpdateIncidentDataAttributesLa labels_type_0 = UpdateIncidentDataAttributesLabelsType0.from_dict(data) return labels_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(None | Unset | UpdateIncidentDataAttributesLabelsType0, data) + return cast(Union["UpdateIncidentDataAttributesLabelsType0", None, Unset], data) labels = _parse_labels(d.pop("labels", UNSET)) - def _parse_slack_channel_id(data: object) -> None | str | Unset: + def _parse_slack_channel_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) slack_channel_id = _parse_slack_channel_id(d.pop("slack_channel_id", UNSET)) - def _parse_slack_channel_name(data: object) -> None | str | Unset: + def _parse_slack_channel_name(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) slack_channel_name = _parse_slack_channel_name(d.pop("slack_channel_name", UNSET)) - def _parse_slack_channel_url(data: object) -> None | str | Unset: + def _parse_slack_channel_url(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) slack_channel_url = _parse_slack_channel_url(d.pop("slack_channel_url", UNSET)) - def _parse_slack_channel_archived(data: object) -> bool | None | Unset: + def _parse_slack_channel_archived(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) slack_channel_archived = _parse_slack_channel_archived(d.pop("slack_channel_archived", UNSET)) - def _parse_google_drive_parent_id(data: object) -> None | str | Unset: + def _parse_google_drive_parent_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) google_drive_parent_id = _parse_google_drive_parent_id(d.pop("google_drive_parent_id", UNSET)) - def _parse_google_drive_url(data: object) -> None | str | Unset: + def _parse_google_drive_url(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) google_drive_url = _parse_google_drive_url(d.pop("google_drive_url", UNSET)) - def _parse_jira_issue_key(data: object) -> None | str | Unset: + def _parse_jira_issue_key(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) jira_issue_key = _parse_jira_issue_key(d.pop("jira_issue_key", UNSET)) - def _parse_jira_issue_id(data: object) -> None | str | Unset: + def _parse_jira_issue_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) jira_issue_id = _parse_jira_issue_id(d.pop("jira_issue_id", UNSET)) - def _parse_jira_issue_url(data: object) -> None | str | Unset: + def _parse_jira_issue_url(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) jira_issue_url = _parse_jira_issue_url(d.pop("jira_issue_url", UNSET)) - def _parse_scheduled_for(data: object) -> None | str | Unset: + def _parse_scheduled_for(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) scheduled_for = _parse_scheduled_for(d.pop("scheduled_for", UNSET)) - def _parse_scheduled_until(data: object) -> None | str | Unset: + def _parse_scheduled_until(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) scheduled_until = _parse_scheduled_until(d.pop("scheduled_until", UNSET)) - def _parse_in_triage_at(data: object) -> None | str | Unset: + def _parse_in_triage_at(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) in_triage_at = _parse_in_triage_at(d.pop("in_triage_at", UNSET)) - def _parse_started_at(data: object) -> None | str | Unset: + def _parse_started_at(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) started_at = _parse_started_at(d.pop("started_at", UNSET)) - def _parse_detected_at(data: object) -> None | str | Unset: + def _parse_detected_at(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) detected_at = _parse_detected_at(d.pop("detected_at", UNSET)) - def _parse_acknowledged_at(data: object) -> None | str | Unset: + def _parse_acknowledged_at(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) acknowledged_at = _parse_acknowledged_at(d.pop("acknowledged_at", UNSET)) - def _parse_mitigated_at(data: object) -> None | str | Unset: + def _parse_mitigated_at(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) mitigated_at = _parse_mitigated_at(d.pop("mitigated_at", UNSET)) - def _parse_resolved_at(data: object) -> None | str | Unset: + def _parse_resolved_at(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) resolved_at = _parse_resolved_at(d.pop("resolved_at", UNSET)) - def _parse_closed_at(data: object) -> None | str | Unset: + def _parse_closed_at(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) closed_at = _parse_closed_at(d.pop("closed_at", UNSET)) - def _parse_cancelled_at(data: object) -> None | str | Unset: + def _parse_cancelled_at(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) cancelled_at = _parse_cancelled_at(d.pop("cancelled_at", UNSET)) - def _parse_mitigation_message(data: object) -> None | str | Unset: + def _parse_mitigation_message(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) mitigation_message = _parse_mitigation_message(d.pop("mitigation_message", UNSET)) - def _parse_resolution_message(data: object) -> None | str | Unset: + def _parse_resolution_message(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) resolution_message = _parse_resolution_message(d.pop("resolution_message", UNSET)) - def _parse_cancellation_message(data: object) -> None | str | Unset: + def _parse_cancellation_message(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) cancellation_message = _parse_cancellation_message(d.pop("cancellation_message", UNSET)) diff --git a/rootly_sdk/models/update_incident_data_attributes_labels_type_0.py b/rootly_sdk/models/update_incident_data_attributes_labels_type_0.py index 3bbf882a..cd7027c9 100644 --- a/rootly_sdk/models/update_incident_data_attributes_labels_type_0.py +++ b/rootly_sdk/models/update_incident_data_attributes_labels_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,7 +14,6 @@ class UpdateIncidentDataAttributesLabelsType0: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) diff --git a/rootly_sdk/models/update_incident_event.py b/rootly_sdk/models/update_incident_event.py index 4cb04a10..ab56ae88 100644 --- a/rootly_sdk/models/update_incident_event.py +++ b/rootly_sdk/models/update_incident_event.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateIncidentEvent: data (UpdateIncidentEventData): """ - data: UpdateIncidentEventData + data: "UpdateIncidentEventData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_incident_event_data.py b/rootly_sdk/models/update_incident_event_data.py index ee5cbb73..cc26fc06 100644 --- a/rootly_sdk/models/update_incident_event_data.py +++ b/rootly_sdk/models/update_incident_event_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class UpdateIncidentEventData: """ type_: UpdateIncidentEventDataType - attributes: UpdateIncidentEventDataAttributes + attributes: "UpdateIncidentEventDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_incident_event_data_attributes.py b/rootly_sdk/models/update_incident_event_data_attributes.py index 1d966e3c..20040686 100644 --- a/rootly_sdk/models/update_incident_event_data_attributes.py +++ b/rootly_sdk/models/update_incident_event_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define @@ -18,17 +16,18 @@ class UpdateIncidentEventDataAttributes: """ Attributes: - event (str | Unset): The summary of the incident event - visibility (UpdateIncidentEventDataAttributesVisibility | Unset): The visibility of the incident action item + event (Union[Unset, str]): The summary of the incident event + visibility (Union[Unset, UpdateIncidentEventDataAttributesVisibility]): The visibility of the incident action + item """ - event: str | Unset = UNSET - visibility: UpdateIncidentEventDataAttributesVisibility | Unset = UNSET + event: Union[Unset, str] = UNSET + visibility: Union[Unset, UpdateIncidentEventDataAttributesVisibility] = UNSET def to_dict(self) -> dict[str, Any]: event = self.event - visibility: str | Unset = UNSET + visibility: Union[Unset, str] = UNSET if not isinstance(self.visibility, Unset): visibility = self.visibility @@ -48,7 +47,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: event = d.pop("event", UNSET) _visibility = d.pop("visibility", UNSET) - visibility: UpdateIncidentEventDataAttributesVisibility | Unset + visibility: Union[Unset, UpdateIncidentEventDataAttributesVisibility] if isinstance(_visibility, Unset): visibility = UNSET else: diff --git a/rootly_sdk/models/update_incident_event_functionality.py b/rootly_sdk/models/update_incident_event_functionality.py index b7d3a6e7..1991760e 100644 --- a/rootly_sdk/models/update_incident_event_functionality.py +++ b/rootly_sdk/models/update_incident_event_functionality.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateIncidentEventFunctionality: data (UpdateIncidentEventFunctionalityData): """ - data: UpdateIncidentEventFunctionalityData + data: "UpdateIncidentEventFunctionalityData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_incident_event_functionality_data.py b/rootly_sdk/models/update_incident_event_functionality_data.py index db851cd6..66eacd0d 100644 --- a/rootly_sdk/models/update_incident_event_functionality_data.py +++ b/rootly_sdk/models/update_incident_event_functionality_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class UpdateIncidentEventFunctionalityData: """ type_: UpdateIncidentEventFunctionalityDataType - attributes: UpdateIncidentEventFunctionalityDataAttributes + attributes: "UpdateIncidentEventFunctionalityDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_incident_event_functionality_data_attributes.py b/rootly_sdk/models/update_incident_event_functionality_data_attributes.py index 3dd37190..e036a562 100644 --- a/rootly_sdk/models/update_incident_event_functionality_data_attributes.py +++ b/rootly_sdk/models/update_incident_event_functionality_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/update_incident_event_service.py b/rootly_sdk/models/update_incident_event_service.py index 89e922a7..4c582722 100644 --- a/rootly_sdk/models/update_incident_event_service.py +++ b/rootly_sdk/models/update_incident_event_service.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateIncidentEventService: data (UpdateIncidentEventServiceData): """ - data: UpdateIncidentEventServiceData + data: "UpdateIncidentEventServiceData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_incident_event_service_data.py b/rootly_sdk/models/update_incident_event_service_data.py index df92c39e..39489ed7 100644 --- a/rootly_sdk/models/update_incident_event_service_data.py +++ b/rootly_sdk/models/update_incident_event_service_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class UpdateIncidentEventServiceData: """ type_: UpdateIncidentEventServiceDataType - attributes: UpdateIncidentEventServiceDataAttributes + attributes: "UpdateIncidentEventServiceDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_incident_event_service_data_attributes.py b/rootly_sdk/models/update_incident_event_service_data_attributes.py index d5f3207b..0d8cd5d6 100644 --- a/rootly_sdk/models/update_incident_event_service_data_attributes.py +++ b/rootly_sdk/models/update_incident_event_service_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/update_incident_feedback.py b/rootly_sdk/models/update_incident_feedback.py index ed194100..c74c81a1 100644 --- a/rootly_sdk/models/update_incident_feedback.py +++ b/rootly_sdk/models/update_incident_feedback.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateIncidentFeedback: data (UpdateIncidentFeedbackData): """ - data: UpdateIncidentFeedbackData + data: "UpdateIncidentFeedbackData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_incident_feedback_data.py b/rootly_sdk/models/update_incident_feedback_data.py index 540185bc..d8e341a9 100644 --- a/rootly_sdk/models/update_incident_feedback_data.py +++ b/rootly_sdk/models/update_incident_feedback_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class UpdateIncidentFeedbackData: """ type_: UpdateIncidentFeedbackDataType - attributes: UpdateIncidentFeedbackDataAttributes + attributes: "UpdateIncidentFeedbackDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_incident_feedback_data_attributes.py b/rootly_sdk/models/update_incident_feedback_data_attributes.py index 4d9558c6..55342d09 100644 --- a/rootly_sdk/models/update_incident_feedback_data_attributes.py +++ b/rootly_sdk/models/update_incident_feedback_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define @@ -18,19 +16,19 @@ class UpdateIncidentFeedbackDataAttributes: """ Attributes: - feedback (str | Unset): The feedback of the incident feedback - rating (UpdateIncidentFeedbackDataAttributesRating | Unset): The rating of the incident feedback - anonymous (bool | Unset): Is the feedback anonymous? + feedback (Union[Unset, str]): The feedback of the incident feedback + rating (Union[Unset, UpdateIncidentFeedbackDataAttributesRating]): The rating of the incident feedback + anonymous (Union[Unset, bool]): Is the feedback anonymous? """ - feedback: str | Unset = UNSET - rating: UpdateIncidentFeedbackDataAttributesRating | Unset = UNSET - anonymous: bool | Unset = UNSET + feedback: Union[Unset, str] = UNSET + rating: Union[Unset, UpdateIncidentFeedbackDataAttributesRating] = UNSET + anonymous: Union[Unset, bool] = UNSET def to_dict(self) -> dict[str, Any]: feedback = self.feedback - rating: int | Unset = UNSET + rating: Union[Unset, int] = UNSET if not isinstance(self.rating, Unset): rating = self.rating @@ -54,7 +52,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: feedback = d.pop("feedback", UNSET) _rating = d.pop("rating", UNSET) - rating: UpdateIncidentFeedbackDataAttributesRating | Unset + rating: Union[Unset, UpdateIncidentFeedbackDataAttributesRating] if isinstance(_rating, Unset): rating = UNSET else: diff --git a/rootly_sdk/models/update_incident_form_field_selection.py b/rootly_sdk/models/update_incident_form_field_selection.py index c6ad6546..d26e8ead 100644 --- a/rootly_sdk/models/update_incident_form_field_selection.py +++ b/rootly_sdk/models/update_incident_form_field_selection.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateIncidentFormFieldSelection: data (UpdateIncidentFormFieldSelectionData): """ - data: UpdateIncidentFormFieldSelectionData + data: "UpdateIncidentFormFieldSelectionData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_incident_form_field_selection_data.py b/rootly_sdk/models/update_incident_form_field_selection_data.py index 0c574ed7..863405d5 100644 --- a/rootly_sdk/models/update_incident_form_field_selection_data.py +++ b/rootly_sdk/models/update_incident_form_field_selection_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class UpdateIncidentFormFieldSelectionData: """ type_: UpdateIncidentFormFieldSelectionDataType - attributes: UpdateIncidentFormFieldSelectionDataAttributes + attributes: "UpdateIncidentFormFieldSelectionDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_incident_form_field_selection_data_attributes.py b/rootly_sdk/models/update_incident_form_field_selection_data_attributes.py index db5ea2f0..37059083 100644 --- a/rootly_sdk/models/update_incident_form_field_selection_data_attributes.py +++ b/rootly_sdk/models/update_incident_form_field_selection_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -14,69 +12,69 @@ class UpdateIncidentFormFieldSelectionDataAttributes: """ Attributes: - value (None | str | Unset): The selected value for text kind custom fields - selected_catalog_entity_ids (list[str] | Unset): - selected_group_ids (list[str] | Unset): - selected_option_ids (list[str] | Unset): - selected_service_ids (list[str] | Unset): - selected_functionality_ids (list[str] | Unset): - selected_user_ids (list[int] | Unset): - selected_environment_ids (list[str] | Unset): - selected_cause_ids (list[str] | Unset): - selected_incident_type_ids (list[str] | Unset): + value (Union[None, Unset, str]): The selected value for text kind custom fields + selected_catalog_entity_ids (Union[Unset, list[str]]): + selected_group_ids (Union[Unset, list[str]]): + selected_option_ids (Union[Unset, list[str]]): + selected_service_ids (Union[Unset, list[str]]): + selected_functionality_ids (Union[Unset, list[str]]): + selected_user_ids (Union[Unset, list[int]]): + selected_environment_ids (Union[Unset, list[str]]): + selected_cause_ids (Union[Unset, list[str]]): + selected_incident_type_ids (Union[Unset, list[str]]): """ - value: None | str | Unset = UNSET - selected_catalog_entity_ids: list[str] | Unset = UNSET - selected_group_ids: list[str] | Unset = UNSET - selected_option_ids: list[str] | Unset = UNSET - selected_service_ids: list[str] | Unset = UNSET - selected_functionality_ids: list[str] | Unset = UNSET - selected_user_ids: list[int] | Unset = UNSET - selected_environment_ids: list[str] | Unset = UNSET - selected_cause_ids: list[str] | Unset = UNSET - selected_incident_type_ids: list[str] | Unset = UNSET + value: Union[None, Unset, str] = UNSET + selected_catalog_entity_ids: Union[Unset, list[str]] = UNSET + selected_group_ids: Union[Unset, list[str]] = UNSET + selected_option_ids: Union[Unset, list[str]] = UNSET + selected_service_ids: Union[Unset, list[str]] = UNSET + selected_functionality_ids: Union[Unset, list[str]] = UNSET + selected_user_ids: Union[Unset, list[int]] = UNSET + selected_environment_ids: Union[Unset, list[str]] = UNSET + selected_cause_ids: Union[Unset, list[str]] = UNSET + selected_incident_type_ids: Union[Unset, list[str]] = UNSET def to_dict(self) -> dict[str, Any]: - value: None | str | Unset + value: Union[None, Unset, str] if isinstance(self.value, Unset): value = UNSET else: value = self.value - selected_catalog_entity_ids: list[str] | Unset = UNSET + selected_catalog_entity_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.selected_catalog_entity_ids, Unset): selected_catalog_entity_ids = self.selected_catalog_entity_ids - selected_group_ids: list[str] | Unset = UNSET + selected_group_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.selected_group_ids, Unset): selected_group_ids = self.selected_group_ids - selected_option_ids: list[str] | Unset = UNSET + selected_option_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.selected_option_ids, Unset): selected_option_ids = self.selected_option_ids - selected_service_ids: list[str] | Unset = UNSET + selected_service_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.selected_service_ids, Unset): selected_service_ids = self.selected_service_ids - selected_functionality_ids: list[str] | Unset = UNSET + selected_functionality_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.selected_functionality_ids, Unset): selected_functionality_ids = self.selected_functionality_ids - selected_user_ids: list[int] | Unset = UNSET + selected_user_ids: Union[Unset, list[int]] = UNSET if not isinstance(self.selected_user_ids, Unset): selected_user_ids = self.selected_user_ids - selected_environment_ids: list[str] | Unset = UNSET + selected_environment_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.selected_environment_ids, Unset): selected_environment_ids = self.selected_environment_ids - selected_cause_ids: list[str] | Unset = UNSET + selected_cause_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.selected_cause_ids, Unset): selected_cause_ids = self.selected_cause_ids - selected_incident_type_ids: list[str] | Unset = UNSET + selected_incident_type_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.selected_incident_type_ids, Unset): selected_incident_type_ids = self.selected_incident_type_ids @@ -110,12 +108,12 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_value(data: object) -> None | str | Unset: + def _parse_value(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) value = _parse_value(d.pop("value", UNSET)) diff --git a/rootly_sdk/models/update_incident_permission_set.py b/rootly_sdk/models/update_incident_permission_set.py index 0e8ae576..5632a471 100644 --- a/rootly_sdk/models/update_incident_permission_set.py +++ b/rootly_sdk/models/update_incident_permission_set.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateIncidentPermissionSet: data (UpdateIncidentPermissionSetData): """ - data: UpdateIncidentPermissionSetData + data: "UpdateIncidentPermissionSetData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_incident_permission_set_boolean.py b/rootly_sdk/models/update_incident_permission_set_boolean.py index 8f25c582..d8a4cb37 100644 --- a/rootly_sdk/models/update_incident_permission_set_boolean.py +++ b/rootly_sdk/models/update_incident_permission_set_boolean.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateIncidentPermissionSetBoolean: data (UpdateIncidentPermissionSetBooleanData): """ - data: UpdateIncidentPermissionSetBooleanData + data: "UpdateIncidentPermissionSetBooleanData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_incident_permission_set_boolean_data.py b/rootly_sdk/models/update_incident_permission_set_boolean_data.py index ea07346a..91b0126a 100644 --- a/rootly_sdk/models/update_incident_permission_set_boolean_data.py +++ b/rootly_sdk/models/update_incident_permission_set_boolean_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class UpdateIncidentPermissionSetBooleanData: """ type_: UpdateIncidentPermissionSetBooleanDataType - attributes: UpdateIncidentPermissionSetBooleanDataAttributes + attributes: "UpdateIncidentPermissionSetBooleanDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_incident_permission_set_boolean_data_attributes.py b/rootly_sdk/models/update_incident_permission_set_boolean_data_attributes.py index 56e4c01d..156d76d7 100644 --- a/rootly_sdk/models/update_incident_permission_set_boolean_data_attributes.py +++ b/rootly_sdk/models/update_incident_permission_set_boolean_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define @@ -24,20 +22,19 @@ class UpdateIncidentPermissionSetBooleanDataAttributes: """ Attributes: - kind (UpdateIncidentPermissionSetBooleanDataAttributesKind | Unset): - private (bool | Unset): - enabled (bool | Unset): - severity_params (UpdateIncidentPermissionSetBooleanDataAttributesSeverityParams | Unset): + kind (Union[Unset, UpdateIncidentPermissionSetBooleanDataAttributesKind]): + private (Union[Unset, bool]): + enabled (Union[Unset, bool]): + severity_params (Union[Unset, UpdateIncidentPermissionSetBooleanDataAttributesSeverityParams]): """ - kind: UpdateIncidentPermissionSetBooleanDataAttributesKind | Unset = UNSET - private: bool | Unset = UNSET - enabled: bool | Unset = UNSET - severity_params: UpdateIncidentPermissionSetBooleanDataAttributesSeverityParams | Unset = UNSET + kind: Union[Unset, UpdateIncidentPermissionSetBooleanDataAttributesKind] = UNSET + private: Union[Unset, bool] = UNSET + enabled: Union[Unset, bool] = UNSET + severity_params: Union[Unset, "UpdateIncidentPermissionSetBooleanDataAttributesSeverityParams"] = UNSET def to_dict(self) -> dict[str, Any]: - - kind: str | Unset = UNSET + kind: Union[Unset, str] = UNSET if not isinstance(self.kind, Unset): kind = self.kind @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: enabled = self.enabled - severity_params: dict[str, Any] | Unset = UNSET + severity_params: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.severity_params, Unset): severity_params = self.severity_params.to_dict() @@ -71,7 +68,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _kind = d.pop("kind", UNSET) - kind: UpdateIncidentPermissionSetBooleanDataAttributesKind | Unset + kind: Union[Unset, UpdateIncidentPermissionSetBooleanDataAttributesKind] if isinstance(_kind, Unset): kind = UNSET else: @@ -82,7 +79,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: enabled = d.pop("enabled", UNSET) _severity_params = d.pop("severity_params", UNSET) - severity_params: UpdateIncidentPermissionSetBooleanDataAttributesSeverityParams | Unset + severity_params: Union[Unset, UpdateIncidentPermissionSetBooleanDataAttributesSeverityParams] if isinstance(_severity_params, Unset): severity_params = UNSET else: diff --git a/rootly_sdk/models/update_incident_permission_set_boolean_data_attributes_severity_params.py b/rootly_sdk/models/update_incident_permission_set_boolean_data_attributes_severity_params.py index 15818ae2..d6db9a16 100644 --- a/rootly_sdk/models/update_incident_permission_set_boolean_data_attributes_severity_params.py +++ b/rootly_sdk/models/update_incident_permission_set_boolean_data_attributes_severity_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,18 +13,18 @@ class UpdateIncidentPermissionSetBooleanDataAttributesSeverityParams: """ Attributes: - fully_enabled (bool | Unset): Whether permissions are enabled for any severity incident Default: True. - applies_to_unassigned (bool | Unset): Whether permissions are enabled for incident without severity Default: - True. - create_enabled (bool | Unset): Whether permissions are enabled when creating incident Default: False. - severity_ids (list[str] | None | Unset): Severity ids that determine if an incident is permitted based on + fully_enabled (Union[Unset, bool]): Whether permissions are enabled for any severity incident Default: True. + applies_to_unassigned (Union[Unset, bool]): Whether permissions are enabled for incident without severity + Default: True. + create_enabled (Union[Unset, bool]): Whether permissions are enabled when creating incident Default: False. + severity_ids (Union[None, Unset, list[str]]): Severity ids that determine if an incident is permitted based on matching severity """ - fully_enabled: bool | Unset = True - applies_to_unassigned: bool | Unset = True - create_enabled: bool | Unset = False - severity_ids: list[str] | None | Unset = UNSET + fully_enabled: Union[Unset, bool] = True + applies_to_unassigned: Union[Unset, bool] = True + create_enabled: Union[Unset, bool] = False + severity_ids: Union[None, Unset, list[str]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -36,7 +34,7 @@ def to_dict(self) -> dict[str, Any]: create_enabled = self.create_enabled - severity_ids: list[str] | None | Unset + severity_ids: Union[None, Unset, list[str]] if isinstance(self.severity_ids, Unset): severity_ids = UNSET elif isinstance(self.severity_ids, list): @@ -68,7 +66,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: create_enabled = d.pop("create_enabled", UNSET) - def _parse_severity_ids(data: object) -> list[str] | None | Unset: + def _parse_severity_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -79,9 +77,9 @@ def _parse_severity_ids(data: object) -> list[str] | None | Unset: severity_ids_type_0 = cast(list[str], data) return severity_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) severity_ids = _parse_severity_ids(d.pop("severity_ids", UNSET)) diff --git a/rootly_sdk/models/update_incident_permission_set_data.py b/rootly_sdk/models/update_incident_permission_set_data.py index df6b990a..36c413c4 100644 --- a/rootly_sdk/models/update_incident_permission_set_data.py +++ b/rootly_sdk/models/update_incident_permission_set_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class UpdateIncidentPermissionSetData: """ type_: UpdateIncidentPermissionSetDataType - attributes: UpdateIncidentPermissionSetDataAttributes + attributes: "UpdateIncidentPermissionSetDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_incident_permission_set_data_attributes.py b/rootly_sdk/models/update_incident_permission_set_data_attributes.py index f084f371..4e96485d 100644 --- a/rootly_sdk/models/update_incident_permission_set_data_attributes.py +++ b/rootly_sdk/models/update_incident_permission_set_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -22,40 +20,49 @@ class UpdateIncidentPermissionSetDataAttributes: """ Attributes: - name (str | Unset): The incident permission set name. - description (None | str | Unset): The incident permission set description. - private_incident_permissions (list[UpdateIncidentPermissionSetDataAttributesPrivateIncidentPermissionsItem] | - Unset): - public_incident_permissions (list[UpdateIncidentPermissionSetDataAttributesPublicIncidentPermissionsItem] | - Unset): + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + name (Union[Unset, str]): The incident permission set name. + description (Union[None, Unset, str]): The incident permission set description. + private_incident_permissions (Union[Unset, + list[UpdateIncidentPermissionSetDataAttributesPrivateIncidentPermissionsItem]]): + public_incident_permissions (Union[Unset, + list[UpdateIncidentPermissionSetDataAttributesPublicIncidentPermissionsItem]]): """ - name: str | Unset = UNSET - description: None | str | Unset = UNSET - private_incident_permissions: ( - list[UpdateIncidentPermissionSetDataAttributesPrivateIncidentPermissionsItem] | Unset - ) = UNSET - public_incident_permissions: ( - list[UpdateIncidentPermissionSetDataAttributesPublicIncidentPermissionsItem] | Unset - ) = UNSET + slug: Union[None, Unset, str] = UNSET + name: Union[Unset, str] = UNSET + description: Union[None, Unset, str] = UNSET + private_incident_permissions: Union[ + Unset, list[UpdateIncidentPermissionSetDataAttributesPrivateIncidentPermissionsItem] + ] = UNSET + public_incident_permissions: Union[ + Unset, list[UpdateIncidentPermissionSetDataAttributesPublicIncidentPermissionsItem] + ] = UNSET def to_dict(self) -> dict[str, Any]: + slug: Union[None, Unset, str] + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug + name = self.name - description: None | str | Unset + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: description = self.description - private_incident_permissions: list[str] | Unset = UNSET + private_incident_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.private_incident_permissions, Unset): private_incident_permissions = [] for private_incident_permissions_item_data in self.private_incident_permissions: private_incident_permissions_item: str = private_incident_permissions_item_data private_incident_permissions.append(private_incident_permissions_item) - public_incident_permissions: list[str] | Unset = UNSET + public_incident_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.public_incident_permissions, Unset): public_incident_permissions = [] for public_incident_permissions_item_data in self.public_incident_permissions: @@ -65,6 +72,8 @@ def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} field_dict.update({}) + if slug is not UNSET: + field_dict["slug"] = slug if name is not UNSET: field_dict["name"] = name if description is not UNSET: @@ -79,48 +88,51 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) + + def _parse_slug(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + slug = _parse_slug(d.pop("slug", UNSET)) + name = d.pop("name", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) + private_incident_permissions = [] _private_incident_permissions = d.pop("private_incident_permissions", UNSET) - private_incident_permissions: ( - list[UpdateIncidentPermissionSetDataAttributesPrivateIncidentPermissionsItem] | Unset - ) = UNSET - if _private_incident_permissions is not UNSET: - private_incident_permissions = [] - for private_incident_permissions_item_data in _private_incident_permissions: - private_incident_permissions_item = ( - check_update_incident_permission_set_data_attributes_private_incident_permissions_item( - private_incident_permissions_item_data - ) + for private_incident_permissions_item_data in _private_incident_permissions or []: + private_incident_permissions_item = ( + check_update_incident_permission_set_data_attributes_private_incident_permissions_item( + private_incident_permissions_item_data ) + ) - private_incident_permissions.append(private_incident_permissions_item) + private_incident_permissions.append(private_incident_permissions_item) + public_incident_permissions = [] _public_incident_permissions = d.pop("public_incident_permissions", UNSET) - public_incident_permissions: ( - list[UpdateIncidentPermissionSetDataAttributesPublicIncidentPermissionsItem] | Unset - ) = UNSET - if _public_incident_permissions is not UNSET: - public_incident_permissions = [] - for public_incident_permissions_item_data in _public_incident_permissions: - public_incident_permissions_item = ( - check_update_incident_permission_set_data_attributes_public_incident_permissions_item( - public_incident_permissions_item_data - ) + for public_incident_permissions_item_data in _public_incident_permissions or []: + public_incident_permissions_item = ( + check_update_incident_permission_set_data_attributes_public_incident_permissions_item( + public_incident_permissions_item_data ) + ) - public_incident_permissions.append(public_incident_permissions_item) + public_incident_permissions.append(public_incident_permissions_item) update_incident_permission_set_data_attributes = cls( + slug=slug, name=name, description=description, private_incident_permissions=private_incident_permissions, diff --git a/rootly_sdk/models/update_incident_permission_set_resource.py b/rootly_sdk/models/update_incident_permission_set_resource.py index 954a62ce..f0cec4e5 100644 --- a/rootly_sdk/models/update_incident_permission_set_resource.py +++ b/rootly_sdk/models/update_incident_permission_set_resource.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateIncidentPermissionSetResource: data (UpdateIncidentPermissionSetResourceData): """ - data: UpdateIncidentPermissionSetResourceData + data: "UpdateIncidentPermissionSetResourceData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_incident_permission_set_resource_data.py b/rootly_sdk/models/update_incident_permission_set_resource_data.py index 083c9a1b..2f7048c5 100644 --- a/rootly_sdk/models/update_incident_permission_set_resource_data.py +++ b/rootly_sdk/models/update_incident_permission_set_resource_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class UpdateIncidentPermissionSetResourceData: """ type_: UpdateIncidentPermissionSetResourceDataType - attributes: UpdateIncidentPermissionSetResourceDataAttributes + attributes: "UpdateIncidentPermissionSetResourceDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_incident_permission_set_resource_data_attributes.py b/rootly_sdk/models/update_incident_permission_set_resource_data_attributes.py index 4a4b6196..b8d7899f 100644 --- a/rootly_sdk/models/update_incident_permission_set_resource_data_attributes.py +++ b/rootly_sdk/models/update_incident_permission_set_resource_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define @@ -24,22 +22,21 @@ class UpdateIncidentPermissionSetResourceDataAttributes: """ Attributes: - kind (UpdateIncidentPermissionSetResourceDataAttributesKind | Unset): - private (bool | Unset): - resource_id (str | Unset): - resource_type (str | Unset): - severity_params (UpdateIncidentPermissionSetResourceDataAttributesSeverityParams | Unset): + kind (Union[Unset, UpdateIncidentPermissionSetResourceDataAttributesKind]): + private (Union[Unset, bool]): + resource_id (Union[Unset, str]): + resource_type (Union[Unset, str]): + severity_params (Union[Unset, UpdateIncidentPermissionSetResourceDataAttributesSeverityParams]): """ - kind: UpdateIncidentPermissionSetResourceDataAttributesKind | Unset = UNSET - private: bool | Unset = UNSET - resource_id: str | Unset = UNSET - resource_type: str | Unset = UNSET - severity_params: UpdateIncidentPermissionSetResourceDataAttributesSeverityParams | Unset = UNSET + kind: Union[Unset, UpdateIncidentPermissionSetResourceDataAttributesKind] = UNSET + private: Union[Unset, bool] = UNSET + resource_id: Union[Unset, str] = UNSET + resource_type: Union[Unset, str] = UNSET + severity_params: Union[Unset, "UpdateIncidentPermissionSetResourceDataAttributesSeverityParams"] = UNSET def to_dict(self) -> dict[str, Any]: - - kind: str | Unset = UNSET + kind: Union[Unset, str] = UNSET if not isinstance(self.kind, Unset): kind = self.kind @@ -49,7 +46,7 @@ def to_dict(self) -> dict[str, Any]: resource_type = self.resource_type - severity_params: dict[str, Any] | Unset = UNSET + severity_params: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.severity_params, Unset): severity_params = self.severity_params.to_dict() @@ -77,7 +74,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _kind = d.pop("kind", UNSET) - kind: UpdateIncidentPermissionSetResourceDataAttributesKind | Unset + kind: Union[Unset, UpdateIncidentPermissionSetResourceDataAttributesKind] if isinstance(_kind, Unset): kind = UNSET else: @@ -90,7 +87,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: resource_type = d.pop("resource_type", UNSET) _severity_params = d.pop("severity_params", UNSET) - severity_params: UpdateIncidentPermissionSetResourceDataAttributesSeverityParams | Unset + severity_params: Union[Unset, UpdateIncidentPermissionSetResourceDataAttributesSeverityParams] if isinstance(_severity_params, Unset): severity_params = UNSET else: diff --git a/rootly_sdk/models/update_incident_permission_set_resource_data_attributes_severity_params.py b/rootly_sdk/models/update_incident_permission_set_resource_data_attributes_severity_params.py index 68d171f5..779e2bb7 100644 --- a/rootly_sdk/models/update_incident_permission_set_resource_data_attributes_severity_params.py +++ b/rootly_sdk/models/update_incident_permission_set_resource_data_attributes_severity_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,18 +13,18 @@ class UpdateIncidentPermissionSetResourceDataAttributesSeverityParams: """ Attributes: - fully_enabled (bool | Unset): Whether permissions are enabled for any severity incident Default: True. - create_enabled (bool | Unset): Whether permissions are enabled when creating incident Default: False. - applies_to_unassigned (bool | Unset): Whether permissions are enabled for incident without severity Default: - True. - severity_ids (list[str] | None | Unset): Severity ids that determine if an incident is permitted based on + fully_enabled (Union[Unset, bool]): Whether permissions are enabled for any severity incident Default: True. + create_enabled (Union[Unset, bool]): Whether permissions are enabled when creating incident Default: False. + applies_to_unassigned (Union[Unset, bool]): Whether permissions are enabled for incident without severity + Default: True. + severity_ids (Union[None, Unset, list[str]]): Severity ids that determine if an incident is permitted based on matching severity """ - fully_enabled: bool | Unset = True - create_enabled: bool | Unset = False - applies_to_unassigned: bool | Unset = True - severity_ids: list[str] | None | Unset = UNSET + fully_enabled: Union[Unset, bool] = True + create_enabled: Union[Unset, bool] = False + applies_to_unassigned: Union[Unset, bool] = True + severity_ids: Union[None, Unset, list[str]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -36,7 +34,7 @@ def to_dict(self) -> dict[str, Any]: applies_to_unassigned = self.applies_to_unassigned - severity_ids: list[str] | None | Unset + severity_ids: Union[None, Unset, list[str]] if isinstance(self.severity_ids, Unset): severity_ids = UNSET elif isinstance(self.severity_ids, list): @@ -68,7 +66,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: applies_to_unassigned = d.pop("applies_to_unassigned", UNSET) - def _parse_severity_ids(data: object) -> list[str] | None | Unset: + def _parse_severity_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -79,9 +77,9 @@ def _parse_severity_ids(data: object) -> list[str] | None | Unset: severity_ids_type_0 = cast(list[str], data) return severity_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) severity_ids = _parse_severity_ids(d.pop("severity_ids", UNSET)) diff --git a/rootly_sdk/models/update_incident_post_mortem.py b/rootly_sdk/models/update_incident_post_mortem.py index e5b9b00c..72c00f08 100644 --- a/rootly_sdk/models/update_incident_post_mortem.py +++ b/rootly_sdk/models/update_incident_post_mortem.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateIncidentPostMortem: data (UpdateIncidentPostMortemData): """ - data: UpdateIncidentPostMortemData + data: "UpdateIncidentPostMortemData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_incident_post_mortem_data.py b/rootly_sdk/models/update_incident_post_mortem_data.py index c37ff215..fd65235d 100644 --- a/rootly_sdk/models/update_incident_post_mortem_data.py +++ b/rootly_sdk/models/update_incident_post_mortem_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class UpdateIncidentPostMortemData: """ type_: UpdateIncidentPostMortemDataType - attributes: UpdateIncidentPostMortemDataAttributes + attributes: "UpdateIncidentPostMortemDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_incident_post_mortem_data_attributes.py b/rootly_sdk/models/update_incident_post_mortem_data_attributes.py index d251d7ec..32b1703b 100644 --- a/rootly_sdk/models/update_incident_post_mortem_data_attributes.py +++ b/rootly_sdk/models/update_incident_post_mortem_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -18,61 +16,61 @@ class UpdateIncidentPostMortemDataAttributes: """ Attributes: - title (str | Unset): The title of the incident retrospective - status (UpdateIncidentPostMortemDataAttributesStatus | Unset): The status of the incident retrospective - started_at (None | str | Unset): Date of started at - mitigated_at (None | str | Unset): Date of mitigation - resolved_at (None | str | Unset): Date of resolution - show_timeline (bool | Unset): Show events timeline of the incident retrospective - show_timeline_trail (bool | Unset): Show trail events in the timeline of the incident retrospective - show_timeline_genius (bool | Unset): Show workflow events in the timeline of the incident retrospective - show_timeline_tasks (bool | Unset): Show tasks in the timeline of the incident retrospective - show_timeline_action_items (bool | Unset): Show action items in the timeline of the incident retrospective - show_services_impacted (bool | Unset): Show functionalities impacted of the incident retrospective - show_functionalities_impacted (bool | Unset): Show services impacted of the incident retrospective - show_groups_impacted (bool | Unset): Show groups impacted of the incident retrospective - show_alerts_attached (bool | Unset): Show alerts attached to the incident - show_action_items (bool | Unset): Show action items (follow-ups) in the incident retrospective - cause_ids (list[str] | None | Unset): The Cause IDs to attach to the incident retrospective + title (Union[Unset, str]): The title of the incident retrospective + status (Union[Unset, UpdateIncidentPostMortemDataAttributesStatus]): The status of the incident retrospective + started_at (Union[None, Unset, str]): Date of started at + mitigated_at (Union[None, Unset, str]): Date of mitigation + resolved_at (Union[None, Unset, str]): Date of resolution + show_timeline (Union[Unset, bool]): Show events timeline of the incident retrospective + show_timeline_trail (Union[Unset, bool]): Show trail events in the timeline of the incident retrospective + show_timeline_genius (Union[Unset, bool]): Show workflow events in the timeline of the incident retrospective + show_timeline_tasks (Union[Unset, bool]): Show tasks in the timeline of the incident retrospective + show_timeline_action_items (Union[Unset, bool]): Show action items in the timeline of the incident retrospective + show_services_impacted (Union[Unset, bool]): Show functionalities impacted of the incident retrospective + show_functionalities_impacted (Union[Unset, bool]): Show services impacted of the incident retrospective + show_groups_impacted (Union[Unset, bool]): Show groups impacted of the incident retrospective + show_alerts_attached (Union[Unset, bool]): Show alerts attached to the incident + show_action_items (Union[Unset, bool]): Show action items (follow-ups) in the incident retrospective + cause_ids (Union[None, Unset, list[str]]): The Cause IDs to attach to the incident retrospective """ - title: str | Unset = UNSET - status: UpdateIncidentPostMortemDataAttributesStatus | Unset = UNSET - started_at: None | str | Unset = UNSET - mitigated_at: None | str | Unset = UNSET - resolved_at: None | str | Unset = UNSET - show_timeline: bool | Unset = UNSET - show_timeline_trail: bool | Unset = UNSET - show_timeline_genius: bool | Unset = UNSET - show_timeline_tasks: bool | Unset = UNSET - show_timeline_action_items: bool | Unset = UNSET - show_services_impacted: bool | Unset = UNSET - show_functionalities_impacted: bool | Unset = UNSET - show_groups_impacted: bool | Unset = UNSET - show_alerts_attached: bool | Unset = UNSET - show_action_items: bool | Unset = UNSET - cause_ids: list[str] | None | Unset = UNSET + title: Union[Unset, str] = UNSET + status: Union[Unset, UpdateIncidentPostMortemDataAttributesStatus] = UNSET + started_at: Union[None, Unset, str] = UNSET + mitigated_at: Union[None, Unset, str] = UNSET + resolved_at: Union[None, Unset, str] = UNSET + show_timeline: Union[Unset, bool] = UNSET + show_timeline_trail: Union[Unset, bool] = UNSET + show_timeline_genius: Union[Unset, bool] = UNSET + show_timeline_tasks: Union[Unset, bool] = UNSET + show_timeline_action_items: Union[Unset, bool] = UNSET + show_services_impacted: Union[Unset, bool] = UNSET + show_functionalities_impacted: Union[Unset, bool] = UNSET + show_groups_impacted: Union[Unset, bool] = UNSET + show_alerts_attached: Union[Unset, bool] = UNSET + show_action_items: Union[Unset, bool] = UNSET + cause_ids: Union[None, Unset, list[str]] = UNSET def to_dict(self) -> dict[str, Any]: title = self.title - status: str | Unset = UNSET + status: Union[Unset, str] = UNSET if not isinstance(self.status, Unset): status = self.status - started_at: None | str | Unset + started_at: Union[None, Unset, str] if isinstance(self.started_at, Unset): started_at = UNSET else: started_at = self.started_at - mitigated_at: None | str | Unset + mitigated_at: Union[None, Unset, str] if isinstance(self.mitigated_at, Unset): mitigated_at = UNSET else: mitigated_at = self.mitigated_at - resolved_at: None | str | Unset + resolved_at: Union[None, Unset, str] if isinstance(self.resolved_at, Unset): resolved_at = UNSET else: @@ -98,7 +96,7 @@ def to_dict(self) -> dict[str, Any]: show_action_items = self.show_action_items - cause_ids: list[str] | None | Unset + cause_ids: Union[None, Unset, list[str]] if isinstance(self.cause_ids, Unset): cause_ids = UNSET elif isinstance(self.cause_ids, list): @@ -151,36 +149,36 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: title = d.pop("title", UNSET) _status = d.pop("status", UNSET) - status: UpdateIncidentPostMortemDataAttributesStatus | Unset + status: Union[Unset, UpdateIncidentPostMortemDataAttributesStatus] if isinstance(_status, Unset): status = UNSET else: status = check_update_incident_post_mortem_data_attributes_status(_status) - def _parse_started_at(data: object) -> None | str | Unset: + def _parse_started_at(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) started_at = _parse_started_at(d.pop("started_at", UNSET)) - def _parse_mitigated_at(data: object) -> None | str | Unset: + def _parse_mitigated_at(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) mitigated_at = _parse_mitigated_at(d.pop("mitigated_at", UNSET)) - def _parse_resolved_at(data: object) -> None | str | Unset: + def _parse_resolved_at(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) resolved_at = _parse_resolved_at(d.pop("resolved_at", UNSET)) @@ -204,7 +202,7 @@ def _parse_resolved_at(data: object) -> None | str | Unset: show_action_items = d.pop("show_action_items", UNSET) - def _parse_cause_ids(data: object) -> list[str] | None | Unset: + def _parse_cause_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -215,9 +213,9 @@ def _parse_cause_ids(data: object) -> list[str] | None | Unset: cause_ids_type_0 = cast(list[str], data) return cause_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) cause_ids = _parse_cause_ids(d.pop("cause_ids", UNSET)) diff --git a/rootly_sdk/models/update_incident_postmortem_task_params.py b/rootly_sdk/models/update_incident_postmortem_task_params.py index 5a56484c..e942111a 100644 --- a/rootly_sdk/models/update_incident_postmortem_task_params.py +++ b/rootly_sdk/models/update_incident_postmortem_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -20,31 +18,31 @@ class UpdateIncidentPostmortemTaskParams: """ Attributes: postmortem_id (str): UUID of the retrospective that needs to be updated - task_type (UpdateIncidentPostmortemTaskParamsTaskType | Unset): - title (None | str | Unset): The incident title - status (None | str | Unset): + task_type (Union[Unset, UpdateIncidentPostmortemTaskParamsTaskType]): + title (Union[None, Unset, str]): The incident title + status (Union[None, Unset, str]): """ postmortem_id: str - task_type: UpdateIncidentPostmortemTaskParamsTaskType | Unset = UNSET - title: None | str | Unset = UNSET - status: None | str | Unset = UNSET + task_type: Union[Unset, UpdateIncidentPostmortemTaskParamsTaskType] = UNSET + title: Union[None, Unset, str] = UNSET + status: Union[None, Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: postmortem_id = self.postmortem_id - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - title: None | str | Unset + title: Union[None, Unset, str] if isinstance(self.title, Unset): title = UNSET else: title = self.title - status: None | str | Unset + status: Union[None, Unset, str] if isinstance(self.status, Unset): status = UNSET else: @@ -72,27 +70,27 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: postmortem_id = d.pop("postmortem_id") _task_type = d.pop("task_type", UNSET) - task_type: UpdateIncidentPostmortemTaskParamsTaskType | Unset + task_type: Union[Unset, UpdateIncidentPostmortemTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: task_type = check_update_incident_postmortem_task_params_task_type(_task_type) - def _parse_title(data: object) -> None | str | Unset: + def _parse_title(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) title = _parse_title(d.pop("title", UNSET)) - def _parse_status(data: object) -> None | str | Unset: + def _parse_status(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) status = _parse_status(d.pop("status", UNSET)) diff --git a/rootly_sdk/models/update_incident_retrospective_step.py b/rootly_sdk/models/update_incident_retrospective_step.py index 568fd4f2..827c9e77 100644 --- a/rootly_sdk/models/update_incident_retrospective_step.py +++ b/rootly_sdk/models/update_incident_retrospective_step.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateIncidentRetrospectiveStep: data (UpdateIncidentRetrospectiveStepData): """ - data: UpdateIncidentRetrospectiveStepData + data: "UpdateIncidentRetrospectiveStepData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_incident_retrospective_step_data.py b/rootly_sdk/models/update_incident_retrospective_step_data.py index 8a5b5a0e..2f3cfdce 100644 --- a/rootly_sdk/models/update_incident_retrospective_step_data.py +++ b/rootly_sdk/models/update_incident_retrospective_step_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class UpdateIncidentRetrospectiveStepData: """ type_: UpdateIncidentRetrospectiveStepDataType - attributes: UpdateIncidentRetrospectiveStepDataAttributes + attributes: "UpdateIncidentRetrospectiveStepDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_incident_retrospective_step_data_attributes.py b/rootly_sdk/models/update_incident_retrospective_step_data_attributes.py index f9ada1a8..fa50532e 100644 --- a/rootly_sdk/models/update_incident_retrospective_step_data_attributes.py +++ b/rootly_sdk/models/update_incident_retrospective_step_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -18,37 +16,38 @@ class UpdateIncidentRetrospectiveStepDataAttributes: """ Attributes: - title (str | Unset): The name of the incident retrospective step - description (None | str | Unset): The description of the incident retrospective step - due_date (None | str | Unset): Due date - position (int | None | Unset): Position of the step - skippable (bool | Unset): Is the step skippable? - status (UpdateIncidentRetrospectiveStepDataAttributesStatus | Unset): Status of the incident retrospective step + title (Union[Unset, str]): The name of the incident retrospective step + description (Union[None, Unset, str]): The description of the incident retrospective step + due_date (Union[None, Unset, str]): Due date + position (Union[None, Unset, int]): Position of the step + skippable (Union[Unset, bool]): Is the step skippable? + status (Union[Unset, UpdateIncidentRetrospectiveStepDataAttributesStatus]): Status of the incident retrospective + step """ - title: str | Unset = UNSET - description: None | str | Unset = UNSET - due_date: None | str | Unset = UNSET - position: int | None | Unset = UNSET - skippable: bool | Unset = UNSET - status: UpdateIncidentRetrospectiveStepDataAttributesStatus | Unset = UNSET + title: Union[Unset, str] = UNSET + description: Union[None, Unset, str] = UNSET + due_date: Union[None, Unset, str] = UNSET + position: Union[None, Unset, int] = UNSET + skippable: Union[Unset, bool] = UNSET + status: Union[Unset, UpdateIncidentRetrospectiveStepDataAttributesStatus] = UNSET def to_dict(self) -> dict[str, Any]: title = self.title - description: None | str | Unset + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: description = self.description - due_date: None | str | Unset + due_date: Union[None, Unset, str] if isinstance(self.due_date, Unset): due_date = UNSET else: due_date = self.due_date - position: int | None | Unset + position: Union[None, Unset, int] if isinstance(self.position, Unset): position = UNSET else: @@ -56,7 +55,7 @@ def to_dict(self) -> dict[str, Any]: skippable = self.skippable - status: str | Unset = UNSET + status: Union[Unset, str] = UNSET if not isinstance(self.status, Unset): status = self.status @@ -83,37 +82,37 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) title = d.pop("title", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) - def _parse_due_date(data: object) -> None | str | Unset: + def _parse_due_date(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) due_date = _parse_due_date(d.pop("due_date", UNSET)) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> Union[None, Unset, int]: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(Union[None, Unset, int], data) position = _parse_position(d.pop("position", UNSET)) skippable = d.pop("skippable", UNSET) _status = d.pop("status", UNSET) - status: UpdateIncidentRetrospectiveStepDataAttributesStatus | Unset + status: Union[Unset, UpdateIncidentRetrospectiveStepDataAttributesStatus] if isinstance(_status, Unset): status = UNSET else: diff --git a/rootly_sdk/models/update_incident_role.py b/rootly_sdk/models/update_incident_role.py index aa1178fc..49bef496 100644 --- a/rootly_sdk/models/update_incident_role.py +++ b/rootly_sdk/models/update_incident_role.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateIncidentRole: data (UpdateIncidentRoleData): """ - data: UpdateIncidentRoleData + data: "UpdateIncidentRoleData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_incident_role_data.py b/rootly_sdk/models/update_incident_role_data.py index f5dc593f..7265f0ef 100644 --- a/rootly_sdk/models/update_incident_role_data.py +++ b/rootly_sdk/models/update_incident_role_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class UpdateIncidentRoleData: """ type_: UpdateIncidentRoleDataType - attributes: UpdateIncidentRoleDataAttributes + attributes: "UpdateIncidentRoleDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_incident_role_data_attributes.py b/rootly_sdk/models/update_incident_role_data_attributes.py index fdac0c55..b028b29e 100644 --- a/rootly_sdk/models/update_incident_role_data_attributes.py +++ b/rootly_sdk/models/update_incident_role_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -14,39 +12,48 @@ class UpdateIncidentRoleDataAttributes: """ Attributes: - name (str | Unset): The name of the incident role - summary (None | str | Unset): The summary of the incident role - description (None | str | Unset): The description of the incident role - position (int | None | Unset): Position of the incident role - optional (bool | Unset): - enabled (bool | Unset): - allow_multi_user_assignment (bool | Unset): + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + name (Union[Unset, str]): The name of the incident role + summary (Union[None, Unset, str]): The summary of the incident role + description (Union[None, Unset, str]): The description of the incident role + position (Union[None, Unset, int]): Position of the incident role + optional (Union[Unset, bool]): + enabled (Union[Unset, bool]): + allow_multi_user_assignment (Union[Unset, bool]): """ - name: str | Unset = UNSET - summary: None | str | Unset = UNSET - description: None | str | Unset = UNSET - position: int | None | Unset = UNSET - optional: bool | Unset = UNSET - enabled: bool | Unset = UNSET - allow_multi_user_assignment: bool | Unset = UNSET + slug: Union[None, Unset, str] = UNSET + name: Union[Unset, str] = UNSET + summary: Union[None, Unset, str] = UNSET + description: Union[None, Unset, str] = UNSET + position: Union[None, Unset, int] = UNSET + optional: Union[Unset, bool] = UNSET + enabled: Union[Unset, bool] = UNSET + allow_multi_user_assignment: Union[Unset, bool] = UNSET def to_dict(self) -> dict[str, Any]: + slug: Union[None, Unset, str] + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug + name = self.name - summary: None | str | Unset + summary: Union[None, Unset, str] if isinstance(self.summary, Unset): summary = UNSET else: summary = self.summary - description: None | str | Unset + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: description = self.description - position: int | None | Unset + position: Union[None, Unset, int] if isinstance(self.position, Unset): position = UNSET else: @@ -61,6 +68,8 @@ def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} field_dict.update({}) + if slug is not UNSET: + field_dict["slug"] = slug if name is not UNSET: field_dict["name"] = name if summary is not UNSET: @@ -81,32 +90,42 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) + + def _parse_slug(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + slug = _parse_slug(d.pop("slug", UNSET)) + name = d.pop("name", UNSET) - def _parse_summary(data: object) -> None | str | Unset: + def _parse_summary(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) summary = _parse_summary(d.pop("summary", UNSET)) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> Union[None, Unset, int]: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(Union[None, Unset, int], data) position = _parse_position(d.pop("position", UNSET)) @@ -117,6 +136,7 @@ def _parse_position(data: object) -> int | None | Unset: allow_multi_user_assignment = d.pop("allow_multi_user_assignment", UNSET) update_incident_role_data_attributes = cls( + slug=slug, name=name, summary=summary, description=description, diff --git a/rootly_sdk/models/update_incident_role_task.py b/rootly_sdk/models/update_incident_role_task.py index 75837e60..4e894747 100644 --- a/rootly_sdk/models/update_incident_role_task.py +++ b/rootly_sdk/models/update_incident_role_task.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateIncidentRoleTask: data (UpdateIncidentRoleTaskData): """ - data: UpdateIncidentRoleTaskData + data: "UpdateIncidentRoleTaskData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_incident_role_task_data.py b/rootly_sdk/models/update_incident_role_task_data.py index 8d6727b8..e9c545b9 100644 --- a/rootly_sdk/models/update_incident_role_task_data.py +++ b/rootly_sdk/models/update_incident_role_task_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class UpdateIncidentRoleTaskData: """ type_: UpdateIncidentRoleTaskDataType - attributes: UpdateIncidentRoleTaskDataAttributes + attributes: "UpdateIncidentRoleTaskDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_incident_role_task_data_attributes.py b/rootly_sdk/models/update_incident_role_task_data_attributes.py index 2fda2b91..aa79b49d 100644 --- a/rootly_sdk/models/update_incident_role_task_data_attributes.py +++ b/rootly_sdk/models/update_incident_role_task_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -18,25 +16,25 @@ class UpdateIncidentRoleTaskDataAttributes: """ Attributes: - task (str | Unset): The task of the incident task - description (None | str | Unset): The description of the incident task - priority (UpdateIncidentRoleTaskDataAttributesPriority | Unset): The priority of the incident task + task (Union[Unset, str]): The task of the incident task + description (Union[None, Unset, str]): The description of the incident task + priority (Union[Unset, UpdateIncidentRoleTaskDataAttributesPriority]): The priority of the incident task """ - task: str | Unset = UNSET - description: None | str | Unset = UNSET - priority: UpdateIncidentRoleTaskDataAttributesPriority | Unset = UNSET + task: Union[Unset, str] = UNSET + description: Union[None, Unset, str] = UNSET + priority: Union[Unset, UpdateIncidentRoleTaskDataAttributesPriority] = UNSET def to_dict(self) -> dict[str, Any]: task = self.task - description: None | str | Unset + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: description = self.description - priority: str | Unset = UNSET + priority: Union[Unset, str] = UNSET if not isinstance(self.priority, Unset): priority = self.priority @@ -57,17 +55,17 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) task = d.pop("task", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) _priority = d.pop("priority", UNSET) - priority: UpdateIncidentRoleTaskDataAttributesPriority | Unset + priority: Union[Unset, UpdateIncidentRoleTaskDataAttributesPriority] if isinstance(_priority, Unset): priority = UNSET else: diff --git a/rootly_sdk/models/update_incident_status_page_event.py b/rootly_sdk/models/update_incident_status_page_event.py index e46300cd..a1a6fb34 100644 --- a/rootly_sdk/models/update_incident_status_page_event.py +++ b/rootly_sdk/models/update_incident_status_page_event.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateIncidentStatusPageEvent: data (UpdateIncidentStatusPageEventData): """ - data: UpdateIncidentStatusPageEventData + data: "UpdateIncidentStatusPageEventData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_incident_status_page_event_data.py b/rootly_sdk/models/update_incident_status_page_event_data.py index 20277191..1d378c39 100644 --- a/rootly_sdk/models/update_incident_status_page_event_data.py +++ b/rootly_sdk/models/update_incident_status_page_event_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class UpdateIncidentStatusPageEventData: """ type_: UpdateIncidentStatusPageEventDataType - attributes: UpdateIncidentStatusPageEventDataAttributes + attributes: "UpdateIncidentStatusPageEventDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_incident_status_page_event_data_attributes.py b/rootly_sdk/models/update_incident_status_page_event_data_attributes.py index 428524d0..4301ad3a 100644 --- a/rootly_sdk/models/update_incident_status_page_event_data_attributes.py +++ b/rootly_sdk/models/update_incident_status_page_event_data_attributes.py @@ -1,8 +1,6 @@ -from __future__ import annotations - import datetime from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from dateutil.parser import isoparse @@ -20,44 +18,44 @@ class UpdateIncidentStatusPageEventDataAttributes: """ Attributes: - event (str | Unset): The summary of the incident event - status_page_id (str | Unset): Unique ID of the status page you wish to post the event to - status (UpdateIncidentStatusPageEventDataAttributesStatus | Unset): The status of the incident event - notify_subscribers (bool | None | Unset): Notify all status pages subscribers Default: False. - should_tweet (bool | None | Unset): For Statuspage.io integrated pages auto publishes a tweet for your update - Default: False. - started_at (datetime.datetime | None | Unset): When the event started. + event (Union[Unset, str]): The summary of the incident event + status_page_id (Union[Unset, str]): Unique ID of the status page you wish to post the event to + status (Union[Unset, UpdateIncidentStatusPageEventDataAttributesStatus]): The status of the incident event + notify_subscribers (Union[None, Unset, bool]): Notify all status pages subscribers Default: False. + should_tweet (Union[None, Unset, bool]): For Statuspage.io integrated pages auto publishes a tweet for your + update Default: False. + started_at (Union[None, Unset, datetime.datetime]): When the event started. """ - event: str | Unset = UNSET - status_page_id: str | Unset = UNSET - status: UpdateIncidentStatusPageEventDataAttributesStatus | Unset = UNSET - notify_subscribers: bool | None | Unset = False - should_tweet: bool | None | Unset = False - started_at: datetime.datetime | None | Unset = UNSET + event: Union[Unset, str] = UNSET + status_page_id: Union[Unset, str] = UNSET + status: Union[Unset, UpdateIncidentStatusPageEventDataAttributesStatus] = UNSET + notify_subscribers: Union[None, Unset, bool] = False + should_tweet: Union[None, Unset, bool] = False + started_at: Union[None, Unset, datetime.datetime] = UNSET def to_dict(self) -> dict[str, Any]: event = self.event status_page_id = self.status_page_id - status: str | Unset = UNSET + status: Union[Unset, str] = UNSET if not isinstance(self.status, Unset): status = self.status - notify_subscribers: bool | None | Unset + notify_subscribers: Union[None, Unset, bool] if isinstance(self.notify_subscribers, Unset): notify_subscribers = UNSET else: notify_subscribers = self.notify_subscribers - should_tweet: bool | None | Unset + should_tweet: Union[None, Unset, bool] if isinstance(self.should_tweet, Unset): should_tweet = UNSET else: should_tweet = self.should_tweet - started_at: None | str | Unset + started_at: Union[None, Unset, str] if isinstance(self.started_at, Unset): started_at = UNSET elif isinstance(self.started_at, datetime.datetime): @@ -91,31 +89,31 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: status_page_id = d.pop("status_page_id", UNSET) _status = d.pop("status", UNSET) - status: UpdateIncidentStatusPageEventDataAttributesStatus | Unset + status: Union[Unset, UpdateIncidentStatusPageEventDataAttributesStatus] if isinstance(_status, Unset): status = UNSET else: status = check_update_incident_status_page_event_data_attributes_status(_status) - def _parse_notify_subscribers(data: object) -> bool | None | Unset: + def _parse_notify_subscribers(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) notify_subscribers = _parse_notify_subscribers(d.pop("notify_subscribers", UNSET)) - def _parse_should_tweet(data: object) -> bool | None | Unset: + def _parse_should_tweet(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) should_tweet = _parse_should_tweet(d.pop("should_tweet", UNSET)) - def _parse_started_at(data: object) -> datetime.datetime | None | Unset: + def _parse_started_at(data: object) -> Union[None, Unset, datetime.datetime]: if data is None: return data if isinstance(data, Unset): @@ -126,9 +124,9 @@ def _parse_started_at(data: object) -> datetime.datetime | None | Unset: started_at_type_0 = isoparse(data) return started_at_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(datetime.datetime | None | Unset, data) + return cast(Union[None, Unset, datetime.datetime], data) started_at = _parse_started_at(d.pop("started_at", UNSET)) diff --git a/rootly_sdk/models/update_incident_status_timestamp_task_params.py b/rootly_sdk/models/update_incident_status_timestamp_task_params.py index 552fe4a7..bb817768 100644 --- a/rootly_sdk/models/update_incident_status_timestamp_task_params.py +++ b/rootly_sdk/models/update_incident_status_timestamp_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,12 +19,12 @@ class UpdateIncidentStatusTimestampTaskParams: Attributes: sub_status_id (str): Sub-status to update timestamp for assigned_at (str): Timestamp of when the sub-status was assigned - task_type (UpdateIncidentStatusTimestampTaskParamsTaskType | Unset): + task_type (Union[Unset, UpdateIncidentStatusTimestampTaskParamsTaskType]): """ sub_status_id: str assigned_at: str - task_type: UpdateIncidentStatusTimestampTaskParamsTaskType | Unset = UNSET + task_type: Union[Unset, UpdateIncidentStatusTimestampTaskParamsTaskType] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -34,7 +32,7 @@ def to_dict(self) -> dict[str, Any]: assigned_at = self.assigned_at - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -59,7 +57,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: assigned_at = d.pop("assigned_at") _task_type = d.pop("task_type", UNSET) - task_type: UpdateIncidentStatusTimestampTaskParamsTaskType | Unset + task_type: Union[Unset, UpdateIncidentStatusTimestampTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/update_incident_sub_status.py b/rootly_sdk/models/update_incident_sub_status.py index edbfd091..1e107b9b 100644 --- a/rootly_sdk/models/update_incident_sub_status.py +++ b/rootly_sdk/models/update_incident_sub_status.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateIncidentSubStatus: data (UpdateIncidentSubStatusData): """ - data: UpdateIncidentSubStatusData + data: "UpdateIncidentSubStatusData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_incident_sub_status_data.py b/rootly_sdk/models/update_incident_sub_status_data.py index cf6a906f..36c0e79c 100644 --- a/rootly_sdk/models/update_incident_sub_status_data.py +++ b/rootly_sdk/models/update_incident_sub_status_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class UpdateIncidentSubStatusData: """ type_: UpdateIncidentSubStatusDataType - attributes: UpdateIncidentSubStatusDataAttributes + attributes: "UpdateIncidentSubStatusDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_incident_sub_status_data_attributes.py b/rootly_sdk/models/update_incident_sub_status_data_attributes.py index b3b42330..b7d0cf44 100644 --- a/rootly_sdk/models/update_incident_sub_status_data_attributes.py +++ b/rootly_sdk/models/update_incident_sub_status_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -14,23 +12,23 @@ class UpdateIncidentSubStatusDataAttributes: """ Attributes: - sub_status_id (str | Unset): Note: To change an incident's sub-status, use the PATCH /incidents/:id endpoint and - set the sub_status_id attribute. This endpoint is for modifying the timestamp of when an incident's sub-status - was assigned. - assigned_at (str | Unset): - assigned_by_user_id (int | None | Unset): + sub_status_id (Union[Unset, str]): Note: To change an incident's sub-status, use the PATCH /incidents/:id + endpoint and set the sub_status_id attribute. This endpoint is for modifying the timestamp of when an incident's + sub-status was assigned. + assigned_at (Union[Unset, str]): + assigned_by_user_id (Union[None, Unset, int]): """ - sub_status_id: str | Unset = UNSET - assigned_at: str | Unset = UNSET - assigned_by_user_id: int | None | Unset = UNSET + sub_status_id: Union[Unset, str] = UNSET + assigned_at: Union[Unset, str] = UNSET + assigned_by_user_id: Union[None, Unset, int] = UNSET def to_dict(self) -> dict[str, Any]: sub_status_id = self.sub_status_id assigned_at = self.assigned_at - assigned_by_user_id: int | None | Unset + assigned_by_user_id: Union[None, Unset, int] if isinstance(self.assigned_by_user_id, Unset): assigned_by_user_id = UNSET else: @@ -55,12 +53,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: assigned_at = d.pop("assigned_at", UNSET) - def _parse_assigned_by_user_id(data: object) -> int | None | Unset: + def _parse_assigned_by_user_id(data: object) -> Union[None, Unset, int]: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(Union[None, Unset, int], data) assigned_by_user_id = _parse_assigned_by_user_id(d.pop("assigned_by_user_id", UNSET)) diff --git a/rootly_sdk/models/update_incident_task_params.py b/rootly_sdk/models/update_incident_task_params.py index e2d5cdc3..acfc21b9 100644 --- a/rootly_sdk/models/update_incident_task_params.py +++ b/rootly_sdk/models/update_incident_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -24,84 +22,84 @@ class UpdateIncidentTaskParams: """ Attributes: incident_id (str): The incident id to update or id of any attribute on the incident - task_type (UpdateIncidentTaskParamsTaskType | Unset): - attribute_to_query_by (UpdateIncidentTaskParamsAttributeToQueryBy | Unset): Default: 'id'. - title (None | str | Unset): The incident title - summary (None | str | Unset): The incident summary - status (None | str | Unset): - severity_id (None | str | Unset): - incident_type_ids (list[str] | None | Unset): - service_ids (list[str] | None | Unset): Array of service UUIDs - functionality_ids (list[str] | None | Unset): Array of functionality UUIDs - environment_ids (list[str] | None | Unset): - group_ids (list[str] | None | Unset): Array of group/team UUIDs - started_at (None | str | Unset): - detected_at (None | str | Unset): - acknowledged_at (None | str | Unset): - mitigated_at (None | str | Unset): - resolved_at (None | str | Unset): - private (bool | Unset): - custom_fields_mapping (None | str | Unset): Custom field mappings. Can contain liquid markup and need to be + task_type (Union[Unset, UpdateIncidentTaskParamsTaskType]): + attribute_to_query_by (Union[Unset, UpdateIncidentTaskParamsAttributeToQueryBy]): Default: 'id'. + title (Union[None, Unset, str]): The incident title + summary (Union[None, Unset, str]): The incident summary + status (Union[None, Unset, str]): + severity_id (Union[None, Unset, str]): + incident_type_ids (Union[None, Unset, list[str]]): + service_ids (Union[None, Unset, list[str]]): Array of service UUIDs + functionality_ids (Union[None, Unset, list[str]]): Array of functionality UUIDs + environment_ids (Union[None, Unset, list[str]]): + group_ids (Union[None, Unset, list[str]]): Array of group/team UUIDs + started_at (Union[None, Unset, str]): + detected_at (Union[None, Unset, str]): + acknowledged_at (Union[None, Unset, str]): + mitigated_at (Union[None, Unset, str]): + resolved_at (Union[None, Unset, str]): + private (Union[Unset, bool]): + custom_fields_mapping (Union[None, Unset, str]): Custom field mappings. Can contain liquid markup and need to be valid JSON. Use 'services', 'functionalities', or 'groups' keys with arrays of names/slugs for name/slug lookup """ incident_id: str - task_type: UpdateIncidentTaskParamsTaskType | Unset = UNSET - attribute_to_query_by: UpdateIncidentTaskParamsAttributeToQueryBy | Unset = "id" - title: None | str | Unset = UNSET - summary: None | str | Unset = UNSET - status: None | str | Unset = UNSET - severity_id: None | str | Unset = UNSET - incident_type_ids: list[str] | None | Unset = UNSET - service_ids: list[str] | None | Unset = UNSET - functionality_ids: list[str] | None | Unset = UNSET - environment_ids: list[str] | None | Unset = UNSET - group_ids: list[str] | None | Unset = UNSET - started_at: None | str | Unset = UNSET - detected_at: None | str | Unset = UNSET - acknowledged_at: None | str | Unset = UNSET - mitigated_at: None | str | Unset = UNSET - resolved_at: None | str | Unset = UNSET - private: bool | Unset = UNSET - custom_fields_mapping: None | str | Unset = UNSET + task_type: Union[Unset, UpdateIncidentTaskParamsTaskType] = UNSET + attribute_to_query_by: Union[Unset, UpdateIncidentTaskParamsAttributeToQueryBy] = "id" + title: Union[None, Unset, str] = UNSET + summary: Union[None, Unset, str] = UNSET + status: Union[None, Unset, str] = UNSET + severity_id: Union[None, Unset, str] = UNSET + incident_type_ids: Union[None, Unset, list[str]] = UNSET + service_ids: Union[None, Unset, list[str]] = UNSET + functionality_ids: Union[None, Unset, list[str]] = UNSET + environment_ids: Union[None, Unset, list[str]] = UNSET + group_ids: Union[None, Unset, list[str]] = UNSET + started_at: Union[None, Unset, str] = UNSET + detected_at: Union[None, Unset, str] = UNSET + acknowledged_at: Union[None, Unset, str] = UNSET + mitigated_at: Union[None, Unset, str] = UNSET + resolved_at: Union[None, Unset, str] = UNSET + private: Union[Unset, bool] = UNSET + custom_fields_mapping: Union[None, Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: incident_id = self.incident_id - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - attribute_to_query_by: str | Unset = UNSET + attribute_to_query_by: Union[Unset, str] = UNSET if not isinstance(self.attribute_to_query_by, Unset): attribute_to_query_by = self.attribute_to_query_by - title: None | str | Unset + title: Union[None, Unset, str] if isinstance(self.title, Unset): title = UNSET else: title = self.title - summary: None | str | Unset + summary: Union[None, Unset, str] if isinstance(self.summary, Unset): summary = UNSET else: summary = self.summary - status: None | str | Unset + status: Union[None, Unset, str] if isinstance(self.status, Unset): status = UNSET else: status = self.status - severity_id: None | str | Unset + severity_id: Union[None, Unset, str] if isinstance(self.severity_id, Unset): severity_id = UNSET else: severity_id = self.severity_id - incident_type_ids: list[str] | None | Unset + incident_type_ids: Union[None, Unset, list[str]] if isinstance(self.incident_type_ids, Unset): incident_type_ids = UNSET elif isinstance(self.incident_type_ids, list): @@ -110,7 +108,7 @@ def to_dict(self) -> dict[str, Any]: else: incident_type_ids = self.incident_type_ids - service_ids: list[str] | None | Unset + service_ids: Union[None, Unset, list[str]] if isinstance(self.service_ids, Unset): service_ids = UNSET elif isinstance(self.service_ids, list): @@ -119,7 +117,7 @@ def to_dict(self) -> dict[str, Any]: else: service_ids = self.service_ids - functionality_ids: list[str] | None | Unset + functionality_ids: Union[None, Unset, list[str]] if isinstance(self.functionality_ids, Unset): functionality_ids = UNSET elif isinstance(self.functionality_ids, list): @@ -128,7 +126,7 @@ def to_dict(self) -> dict[str, Any]: else: functionality_ids = self.functionality_ids - environment_ids: list[str] | None | Unset + environment_ids: Union[None, Unset, list[str]] if isinstance(self.environment_ids, Unset): environment_ids = UNSET elif isinstance(self.environment_ids, list): @@ -137,7 +135,7 @@ def to_dict(self) -> dict[str, Any]: else: environment_ids = self.environment_ids - group_ids: list[str] | None | Unset + group_ids: Union[None, Unset, list[str]] if isinstance(self.group_ids, Unset): group_ids = UNSET elif isinstance(self.group_ids, list): @@ -146,31 +144,31 @@ def to_dict(self) -> dict[str, Any]: else: group_ids = self.group_ids - started_at: None | str | Unset + started_at: Union[None, Unset, str] if isinstance(self.started_at, Unset): started_at = UNSET else: started_at = self.started_at - detected_at: None | str | Unset + detected_at: Union[None, Unset, str] if isinstance(self.detected_at, Unset): detected_at = UNSET else: detected_at = self.detected_at - acknowledged_at: None | str | Unset + acknowledged_at: Union[None, Unset, str] if isinstance(self.acknowledged_at, Unset): acknowledged_at = UNSET else: acknowledged_at = self.acknowledged_at - mitigated_at: None | str | Unset + mitigated_at: Union[None, Unset, str] if isinstance(self.mitigated_at, Unset): mitigated_at = UNSET else: mitigated_at = self.mitigated_at - resolved_at: None | str | Unset + resolved_at: Union[None, Unset, str] if isinstance(self.resolved_at, Unset): resolved_at = UNSET else: @@ -178,7 +176,7 @@ def to_dict(self) -> dict[str, Any]: private = self.private - custom_fields_mapping: None | str | Unset + custom_fields_mapping: Union[None, Unset, str] if isinstance(self.custom_fields_mapping, Unset): custom_fields_mapping = UNSET else: @@ -236,56 +234,56 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: incident_id = d.pop("incident_id") _task_type = d.pop("task_type", UNSET) - task_type: UpdateIncidentTaskParamsTaskType | Unset + task_type: Union[Unset, UpdateIncidentTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: task_type = check_update_incident_task_params_task_type(_task_type) _attribute_to_query_by = d.pop("attribute_to_query_by", UNSET) - attribute_to_query_by: UpdateIncidentTaskParamsAttributeToQueryBy | Unset + attribute_to_query_by: Union[Unset, UpdateIncidentTaskParamsAttributeToQueryBy] if isinstance(_attribute_to_query_by, Unset): attribute_to_query_by = UNSET else: attribute_to_query_by = check_update_incident_task_params_attribute_to_query_by(_attribute_to_query_by) - def _parse_title(data: object) -> None | str | Unset: + def _parse_title(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) title = _parse_title(d.pop("title", UNSET)) - def _parse_summary(data: object) -> None | str | Unset: + def _parse_summary(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) summary = _parse_summary(d.pop("summary", UNSET)) - def _parse_status(data: object) -> None | str | Unset: + def _parse_status(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) status = _parse_status(d.pop("status", UNSET)) - def _parse_severity_id(data: object) -> None | str | Unset: + def _parse_severity_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) severity_id = _parse_severity_id(d.pop("severity_id", UNSET)) - def _parse_incident_type_ids(data: object) -> list[str] | None | Unset: + def _parse_incident_type_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -296,13 +294,13 @@ def _parse_incident_type_ids(data: object) -> list[str] | None | Unset: incident_type_ids_type_0 = cast(list[str], data) return incident_type_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) incident_type_ids = _parse_incident_type_ids(d.pop("incident_type_ids", UNSET)) - def _parse_service_ids(data: object) -> list[str] | None | Unset: + def _parse_service_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -313,13 +311,13 @@ def _parse_service_ids(data: object) -> list[str] | None | Unset: service_ids_type_0 = cast(list[str], data) return service_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) service_ids = _parse_service_ids(d.pop("service_ids", UNSET)) - def _parse_functionality_ids(data: object) -> list[str] | None | Unset: + def _parse_functionality_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -330,13 +328,13 @@ def _parse_functionality_ids(data: object) -> list[str] | None | Unset: functionality_ids_type_0 = cast(list[str], data) return functionality_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) functionality_ids = _parse_functionality_ids(d.pop("functionality_ids", UNSET)) - def _parse_environment_ids(data: object) -> list[str] | None | Unset: + def _parse_environment_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -347,13 +345,13 @@ def _parse_environment_ids(data: object) -> list[str] | None | Unset: environment_ids_type_0 = cast(list[str], data) return environment_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) environment_ids = _parse_environment_ids(d.pop("environment_ids", UNSET)) - def _parse_group_ids(data: object) -> list[str] | None | Unset: + def _parse_group_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -364,65 +362,65 @@ def _parse_group_ids(data: object) -> list[str] | None | Unset: group_ids_type_0 = cast(list[str], data) return group_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) group_ids = _parse_group_ids(d.pop("group_ids", UNSET)) - def _parse_started_at(data: object) -> None | str | Unset: + def _parse_started_at(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) started_at = _parse_started_at(d.pop("started_at", UNSET)) - def _parse_detected_at(data: object) -> None | str | Unset: + def _parse_detected_at(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) detected_at = _parse_detected_at(d.pop("detected_at", UNSET)) - def _parse_acknowledged_at(data: object) -> None | str | Unset: + def _parse_acknowledged_at(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) acknowledged_at = _parse_acknowledged_at(d.pop("acknowledged_at", UNSET)) - def _parse_mitigated_at(data: object) -> None | str | Unset: + def _parse_mitigated_at(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) mitigated_at = _parse_mitigated_at(d.pop("mitigated_at", UNSET)) - def _parse_resolved_at(data: object) -> None | str | Unset: + def _parse_resolved_at(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) resolved_at = _parse_resolved_at(d.pop("resolved_at", UNSET)) private = d.pop("private", UNSET) - def _parse_custom_fields_mapping(data: object) -> None | str | Unset: + def _parse_custom_fields_mapping(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) custom_fields_mapping = _parse_custom_fields_mapping(d.pop("custom_fields_mapping", UNSET)) diff --git a/rootly_sdk/models/update_incident_type.py b/rootly_sdk/models/update_incident_type.py index 8438b01e..5f929508 100644 --- a/rootly_sdk/models/update_incident_type.py +++ b/rootly_sdk/models/update_incident_type.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateIncidentType: data (UpdateIncidentTypeData): """ - data: UpdateIncidentTypeData + data: "UpdateIncidentTypeData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_incident_type_data.py b/rootly_sdk/models/update_incident_type_data.py index 5cde01d3..db52b409 100644 --- a/rootly_sdk/models/update_incident_type_data.py +++ b/rootly_sdk/models/update_incident_type_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class UpdateIncidentTypeData: """ type_: UpdateIncidentTypeDataType - attributes: UpdateIncidentTypeDataAttributes + attributes: "UpdateIncidentTypeDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_incident_type_data_attributes.py b/rootly_sdk/models/update_incident_type_data_attributes.py index 20fabf5e..8d234f4a 100644 --- a/rootly_sdk/models/update_incident_type_data_attributes.py +++ b/rootly_sdk/models/update_incident_type_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -26,51 +24,67 @@ class UpdateIncidentTypeDataAttributes: """ Attributes: - name (str | Unset): The name of the incident type - description (None | str | Unset): The description of the incident type - color (None | str | Unset): The hex color of the incident type - position (int | None | Unset): Position of the incident type - notify_emails (list[str] | None | Unset): Emails to attach to the incident type - slack_channels (list[UpdateIncidentTypeDataAttributesSlackChannelsType0Item] | None | Unset): Slack Channels - associated with this incident type - slack_aliases (list[UpdateIncidentTypeDataAttributesSlackAliasesType0Item] | None | Unset): Slack Aliases + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + name (Union[Unset, str]): The name of the incident type + description (Union[None, Unset, str]): The description of the incident type + public_description (Union[None, Unset, str]): The status page description of the incident type + color (Union[None, Unset, str]): The hex color of the incident type + position (Union[None, Unset, int]): Position of the incident type + notify_emails (Union[None, Unset, list[str]]): Emails to attach to the incident type + slack_channels (Union[None, Unset, list['UpdateIncidentTypeDataAttributesSlackChannelsType0Item']]): Slack + Channels associated with this incident type + slack_aliases (Union[None, Unset, list['UpdateIncidentTypeDataAttributesSlackAliasesType0Item']]): Slack Aliases associated with this incident type - properties (list[UpdateIncidentTypeDataAttributesPropertiesItem] | Unset): Array of property values for this - incident type. + properties (Union[Unset, list['UpdateIncidentTypeDataAttributesPropertiesItem']]): Array of property values for + this incident type. """ - name: str | Unset = UNSET - description: None | str | Unset = UNSET - color: None | str | Unset = UNSET - position: int | None | Unset = UNSET - notify_emails: list[str] | None | Unset = UNSET - slack_channels: list[UpdateIncidentTypeDataAttributesSlackChannelsType0Item] | None | Unset = UNSET - slack_aliases: list[UpdateIncidentTypeDataAttributesSlackAliasesType0Item] | None | Unset = UNSET - properties: list[UpdateIncidentTypeDataAttributesPropertiesItem] | Unset = UNSET + slug: Union[None, Unset, str] = UNSET + name: Union[Unset, str] = UNSET + description: Union[None, Unset, str] = UNSET + public_description: Union[None, Unset, str] = UNSET + color: Union[None, Unset, str] = UNSET + position: Union[None, Unset, int] = UNSET + notify_emails: Union[None, Unset, list[str]] = UNSET + slack_channels: Union[None, Unset, list["UpdateIncidentTypeDataAttributesSlackChannelsType0Item"]] = UNSET + slack_aliases: Union[None, Unset, list["UpdateIncidentTypeDataAttributesSlackAliasesType0Item"]] = UNSET + properties: Union[Unset, list["UpdateIncidentTypeDataAttributesPropertiesItem"]] = UNSET def to_dict(self) -> dict[str, Any]: + slug: Union[None, Unset, str] + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug name = self.name - description: None | str | Unset + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: description = self.description - color: None | str | Unset + public_description: Union[None, Unset, str] + if isinstance(self.public_description, Unset): + public_description = UNSET + else: + public_description = self.public_description + + color: Union[None, Unset, str] if isinstance(self.color, Unset): color = UNSET else: color = self.color - position: int | None | Unset + position: Union[None, Unset, int] if isinstance(self.position, Unset): position = UNSET else: position = self.position - notify_emails: list[str] | None | Unset + notify_emails: Union[None, Unset, list[str]] if isinstance(self.notify_emails, Unset): notify_emails = UNSET elif isinstance(self.notify_emails, list): @@ -79,7 +93,7 @@ def to_dict(self) -> dict[str, Any]: else: notify_emails = self.notify_emails - slack_channels: list[dict[str, Any]] | None | Unset + slack_channels: Union[None, Unset, list[dict[str, Any]]] if isinstance(self.slack_channels, Unset): slack_channels = UNSET elif isinstance(self.slack_channels, list): @@ -91,7 +105,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_channels = self.slack_channels - slack_aliases: list[dict[str, Any]] | None | Unset + slack_aliases: Union[None, Unset, list[dict[str, Any]]] if isinstance(self.slack_aliases, Unset): slack_aliases = UNSET elif isinstance(self.slack_aliases, list): @@ -103,7 +117,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_aliases = self.slack_aliases - properties: list[dict[str, Any]] | Unset = UNSET + properties: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.properties, Unset): properties = [] for properties_item_data in self.properties: @@ -113,10 +127,14 @@ def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} field_dict.update({}) + if slug is not UNSET: + field_dict["slug"] = slug if name is not UNSET: field_dict["name"] = name if description is not UNSET: field_dict["description"] = description + if public_description is not UNSET: + field_dict["public_description"] = public_description if color is not UNSET: field_dict["color"] = color if position is not UNSET: @@ -145,36 +163,55 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: ) d = dict(src_dict) + + def _parse_slug(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + slug = _parse_slug(d.pop("slug", UNSET)) + name = d.pop("name", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) - def _parse_color(data: object) -> None | str | Unset: + def _parse_public_description(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + public_description = _parse_public_description(d.pop("public_description", UNSET)) + + def _parse_color(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) color = _parse_color(d.pop("color", UNSET)) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> Union[None, Unset, int]: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(Union[None, Unset, int], data) position = _parse_position(d.pop("position", UNSET)) - def _parse_notify_emails(data: object) -> list[str] | None | Unset: + def _parse_notify_emails(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -185,15 +222,15 @@ def _parse_notify_emails(data: object) -> list[str] | None | Unset: notify_emails_type_0 = cast(list[str], data) return notify_emails_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) notify_emails = _parse_notify_emails(d.pop("notify_emails", UNSET)) def _parse_slack_channels( data: object, - ) -> list[UpdateIncidentTypeDataAttributesSlackChannelsType0Item] | None | Unset: + ) -> Union[None, Unset, list["UpdateIncidentTypeDataAttributesSlackChannelsType0Item"]]: if data is None: return data if isinstance(data, Unset): @@ -211,15 +248,15 @@ def _parse_slack_channels( slack_channels_type_0.append(slack_channels_type_0_item) return slack_channels_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[UpdateIncidentTypeDataAttributesSlackChannelsType0Item] | None | Unset, data) + return cast(Union[None, Unset, list["UpdateIncidentTypeDataAttributesSlackChannelsType0Item"]], data) slack_channels = _parse_slack_channels(d.pop("slack_channels", UNSET)) def _parse_slack_aliases( data: object, - ) -> list[UpdateIncidentTypeDataAttributesSlackAliasesType0Item] | None | Unset: + ) -> Union[None, Unset, list["UpdateIncidentTypeDataAttributesSlackAliasesType0Item"]]: if data is None: return data if isinstance(data, Unset): @@ -237,24 +274,24 @@ def _parse_slack_aliases( slack_aliases_type_0.append(slack_aliases_type_0_item) return slack_aliases_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[UpdateIncidentTypeDataAttributesSlackAliasesType0Item] | None | Unset, data) + return cast(Union[None, Unset, list["UpdateIncidentTypeDataAttributesSlackAliasesType0Item"]], data) slack_aliases = _parse_slack_aliases(d.pop("slack_aliases", UNSET)) + properties = [] _properties = d.pop("properties", UNSET) - properties: list[UpdateIncidentTypeDataAttributesPropertiesItem] | Unset = UNSET - if _properties is not UNSET: - properties = [] - for properties_item_data in _properties: - properties_item = UpdateIncidentTypeDataAttributesPropertiesItem.from_dict(properties_item_data) + for properties_item_data in _properties or []: + properties_item = UpdateIncidentTypeDataAttributesPropertiesItem.from_dict(properties_item_data) - properties.append(properties_item) + properties.append(properties_item) update_incident_type_data_attributes = cls( + slug=slug, name=name, description=description, + public_description=public_description, color=color, position=position, notify_emails=notify_emails, diff --git a/rootly_sdk/models/update_incident_type_data_attributes_properties_item.py b/rootly_sdk/models/update_incident_type_data_attributes_properties_item.py index b4e47094..de4e59f0 100644 --- a/rootly_sdk/models/update_incident_type_data_attributes_properties_item.py +++ b/rootly_sdk/models/update_incident_type_data_attributes_properties_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/update_incident_type_data_attributes_slack_aliases_type_0_item.py b/rootly_sdk/models/update_incident_type_data_attributes_slack_aliases_type_0_item.py index 749e159c..8d6b5b13 100644 --- a/rootly_sdk/models/update_incident_type_data_attributes_slack_aliases_type_0_item.py +++ b/rootly_sdk/models/update_incident_type_data_attributes_slack_aliases_type_0_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/update_incident_type_data_attributes_slack_channels_type_0_item.py b/rootly_sdk/models/update_incident_type_data_attributes_slack_channels_type_0_item.py index 549b1658..b62bba36 100644 --- a/rootly_sdk/models/update_incident_type_data_attributes_slack_channels_type_0_item.py +++ b/rootly_sdk/models/update_incident_type_data_attributes_slack_channels_type_0_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/update_jira_issue_task_params.py b/rootly_sdk/models/update_jira_issue_task_params.py index e4ae6cf7..9fbc9e06 100644 --- a/rootly_sdk/models/update_jira_issue_task_params.py +++ b/rootly_sdk/models/update_jira_issue_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -27,49 +25,54 @@ class UpdateJiraIssueTaskParams: Attributes: issue_id (str): The issue id project_key (str): The project key - task_type (UpdateJiraIssueTaskParamsTaskType | Unset): - integration (UpdateJiraIssueTaskParamsIntegration | Unset): Specify integration id if you have more than one - Jira instance - title (str | Unset): The issue title - description (str | Unset): The issue description - labels (str | Unset): The issue labels - assign_user_email (str | Unset): The assigned user's email - reporter_user_email (str | Unset): The reporter user's email - due_date (str | Unset): The due date - priority (UpdateJiraIssueTaskParamsPriority | Unset): The priority id and display name - status (UpdateJiraIssueTaskParamsStatus | Unset): The status id and display name - custom_fields_mapping (None | str | Unset): Custom field mappings. Can contain liquid markup and need to be + task_type (Union[Unset, UpdateJiraIssueTaskParamsTaskType]): + integration (Union[Unset, UpdateJiraIssueTaskParamsIntegration]): Specify integration id if you have more than + one Jira instance + title (Union[Unset, str]): The issue title + description (Union[Unset, str]): The issue description + labels (Union[Unset, str]): The issue labels + assign_user_email (Union[Unset, str]): The assigned user's email + reporter_user_email (Union[Unset, str]): The reporter user's email + due_date (Union[Unset, str]): The due date + priority (Union[Unset, UpdateJiraIssueTaskParamsPriority]): The priority id and display name + status (Union[Unset, UpdateJiraIssueTaskParamsStatus]): The status id and display name + custom_fields_mapping (Union[None, Unset, str]): Custom field mappings. Can contain liquid markup and need to be valid JSON - update_payload (None | str | Unset): Update payload. Can contain liquid markup and need to be valid JSON + update_payload (Union[None, Unset, str]): Update payload. Can contain liquid markup and need to be valid JSON + retry_count (Union[Unset, int]): Number of times to retry on rate-limit (HTTP 429) responses (0-4). 0 disables + retry. Default: 0. Example: 3. + retry_wait_time (Union[Unset, int]): Seconds to wait before each retry (1-15). Retry-After header is honored + when present and <= 90s, taking the larger of retry_wait_time and the header value. Default: 1. Example: 2. """ issue_id: str project_key: str - task_type: UpdateJiraIssueTaskParamsTaskType | Unset = UNSET - integration: UpdateJiraIssueTaskParamsIntegration | Unset = UNSET - title: str | Unset = UNSET - description: str | Unset = UNSET - labels: str | Unset = UNSET - assign_user_email: str | Unset = UNSET - reporter_user_email: str | Unset = UNSET - due_date: str | Unset = UNSET - priority: UpdateJiraIssueTaskParamsPriority | Unset = UNSET - status: UpdateJiraIssueTaskParamsStatus | Unset = UNSET - custom_fields_mapping: None | str | Unset = UNSET - update_payload: None | str | Unset = UNSET + task_type: Union[Unset, UpdateJiraIssueTaskParamsTaskType] = UNSET + integration: Union[Unset, "UpdateJiraIssueTaskParamsIntegration"] = UNSET + title: Union[Unset, str] = UNSET + description: Union[Unset, str] = UNSET + labels: Union[Unset, str] = UNSET + assign_user_email: Union[Unset, str] = UNSET + reporter_user_email: Union[Unset, str] = UNSET + due_date: Union[Unset, str] = UNSET + priority: Union[Unset, "UpdateJiraIssueTaskParamsPriority"] = UNSET + status: Union[Unset, "UpdateJiraIssueTaskParamsStatus"] = UNSET + custom_fields_mapping: Union[None, Unset, str] = UNSET + update_payload: Union[None, Unset, str] = UNSET + retry_count: Union[Unset, int] = 0 + retry_wait_time: Union[Unset, int] = 1 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - issue_id = self.issue_id project_key = self.project_key - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - integration: dict[str, Any] | Unset = UNSET + integration: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.integration, Unset): integration = self.integration.to_dict() @@ -85,26 +88,30 @@ def to_dict(self) -> dict[str, Any]: due_date = self.due_date - priority: dict[str, Any] | Unset = UNSET + priority: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.priority, Unset): priority = self.priority.to_dict() - status: dict[str, Any] | Unset = UNSET + status: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.status, Unset): status = self.status.to_dict() - custom_fields_mapping: None | str | Unset + custom_fields_mapping: Union[None, Unset, str] if isinstance(self.custom_fields_mapping, Unset): custom_fields_mapping = UNSET else: custom_fields_mapping = self.custom_fields_mapping - update_payload: None | str | Unset + update_payload: Union[None, Unset, str] if isinstance(self.update_payload, Unset): update_payload = UNSET else: update_payload = self.update_payload + retry_count = self.retry_count + + retry_wait_time = self.retry_wait_time + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update( @@ -137,6 +144,10 @@ def to_dict(self) -> dict[str, Any]: field_dict["custom_fields_mapping"] = custom_fields_mapping if update_payload is not UNSET: field_dict["update_payload"] = update_payload + if retry_count is not UNSET: + field_dict["retry_count"] = retry_count + if retry_wait_time is not UNSET: + field_dict["retry_wait_time"] = retry_wait_time return field_dict @@ -152,14 +163,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: project_key = d.pop("project_key") _task_type = d.pop("task_type", UNSET) - task_type: UpdateJiraIssueTaskParamsTaskType | Unset + task_type: Union[Unset, UpdateJiraIssueTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: task_type = check_update_jira_issue_task_params_task_type(_task_type) _integration = d.pop("integration", UNSET) - integration: UpdateJiraIssueTaskParamsIntegration | Unset + integration: Union[Unset, UpdateJiraIssueTaskParamsIntegration] if isinstance(_integration, Unset): integration = UNSET else: @@ -178,37 +189,41 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: due_date = d.pop("due_date", UNSET) _priority = d.pop("priority", UNSET) - priority: UpdateJiraIssueTaskParamsPriority | Unset + priority: Union[Unset, UpdateJiraIssueTaskParamsPriority] if isinstance(_priority, Unset): priority = UNSET else: priority = UpdateJiraIssueTaskParamsPriority.from_dict(_priority) _status = d.pop("status", UNSET) - status: UpdateJiraIssueTaskParamsStatus | Unset + status: Union[Unset, UpdateJiraIssueTaskParamsStatus] if isinstance(_status, Unset): status = UNSET else: status = UpdateJiraIssueTaskParamsStatus.from_dict(_status) - def _parse_custom_fields_mapping(data: object) -> None | str | Unset: + def _parse_custom_fields_mapping(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) custom_fields_mapping = _parse_custom_fields_mapping(d.pop("custom_fields_mapping", UNSET)) - def _parse_update_payload(data: object) -> None | str | Unset: + def _parse_update_payload(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) update_payload = _parse_update_payload(d.pop("update_payload", UNSET)) + retry_count = d.pop("retry_count", UNSET) + + retry_wait_time = d.pop("retry_wait_time", UNSET) + update_jira_issue_task_params = cls( issue_id=issue_id, project_key=project_key, @@ -224,6 +239,8 @@ def _parse_update_payload(data: object) -> None | str | Unset: status=status, custom_fields_mapping=custom_fields_mapping, update_payload=update_payload, + retry_count=retry_count, + retry_wait_time=retry_wait_time, ) update_jira_issue_task_params.additional_properties = d diff --git a/rootly_sdk/models/update_jira_issue_task_params_integration.py b/rootly_sdk/models/update_jira_issue_task_params_integration.py index 1e6f0b85..b877c632 100644 --- a/rootly_sdk/models/update_jira_issue_task_params_integration.py +++ b/rootly_sdk/models/update_jira_issue_task_params_integration.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,12 +14,12 @@ class UpdateJiraIssueTaskParamsIntegration: """Specify integration id if you have more than one Jira instance Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_jira_issue_task_params_priority.py b/rootly_sdk/models/update_jira_issue_task_params_priority.py index da36b28e..2a70fb58 100644 --- a/rootly_sdk/models/update_jira_issue_task_params_priority.py +++ b/rootly_sdk/models/update_jira_issue_task_params_priority.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,12 +14,12 @@ class UpdateJiraIssueTaskParamsPriority: """The priority id and display name Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_jira_issue_task_params_status.py b/rootly_sdk/models/update_jira_issue_task_params_status.py index 83ca7fdf..00266d58 100644 --- a/rootly_sdk/models/update_jira_issue_task_params_status.py +++ b/rootly_sdk/models/update_jira_issue_task_params_status.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,12 +14,12 @@ class UpdateJiraIssueTaskParamsStatus: """The status id and display name Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_linear_issue_task_params.py b/rootly_sdk/models/update_linear_issue_task_params.py index 555aca6c..de2087f1 100644 --- a/rootly_sdk/models/update_linear_issue_task_params.py +++ b/rootly_sdk/models/update_linear_issue_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -27,28 +25,28 @@ class UpdateLinearIssueTaskParams: """ Attributes: issue_id (str): The issue id - task_type (UpdateLinearIssueTaskParamsTaskType | Unset): - title (str | Unset): The issue title - description (str | Unset): The issue description - state (None | Unset | UpdateLinearIssueTaskParamsStateType0): The state id and display name - project (UpdateLinearIssueTaskParamsProject | Unset): The project id and display name - labels (list[UpdateLinearIssueTaskParamsLabelsItem] | Unset): - priority (UpdateLinearIssueTaskParamsPriority | Unset): The priority id and display name - assign_user_email (str | Unset): The assigned user's email - custom_fields_mapping (None | str | Unset): Custom field mappings. Can contain liquid markup and need to be + task_type (Union[Unset, UpdateLinearIssueTaskParamsTaskType]): + title (Union[Unset, str]): The issue title + description (Union[Unset, str]): The issue description + state (Union['UpdateLinearIssueTaskParamsStateType0', None, Unset]): The state id and display name + project (Union[Unset, UpdateLinearIssueTaskParamsProject]): The project id and display name + labels (Union[Unset, list['UpdateLinearIssueTaskParamsLabelsItem']]): + priority (Union[Unset, UpdateLinearIssueTaskParamsPriority]): The priority id and display name + assign_user_email (Union[Unset, str]): The assigned user's email + custom_fields_mapping (Union[None, Unset, str]): Custom field mappings. Can contain liquid markup and need to be valid JSON """ issue_id: str - task_type: UpdateLinearIssueTaskParamsTaskType | Unset = UNSET - title: str | Unset = UNSET - description: str | Unset = UNSET - state: None | Unset | UpdateLinearIssueTaskParamsStateType0 = UNSET - project: UpdateLinearIssueTaskParamsProject | Unset = UNSET - labels: list[UpdateLinearIssueTaskParamsLabelsItem] | Unset = UNSET - priority: UpdateLinearIssueTaskParamsPriority | Unset = UNSET - assign_user_email: str | Unset = UNSET - custom_fields_mapping: None | str | Unset = UNSET + task_type: Union[Unset, UpdateLinearIssueTaskParamsTaskType] = UNSET + title: Union[Unset, str] = UNSET + description: Union[Unset, str] = UNSET + state: Union["UpdateLinearIssueTaskParamsStateType0", None, Unset] = UNSET + project: Union[Unset, "UpdateLinearIssueTaskParamsProject"] = UNSET + labels: Union[Unset, list["UpdateLinearIssueTaskParamsLabelsItem"]] = UNSET + priority: Union[Unset, "UpdateLinearIssueTaskParamsPriority"] = UNSET + assign_user_email: Union[Unset, str] = UNSET + custom_fields_mapping: Union[None, Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -56,7 +54,7 @@ def to_dict(self) -> dict[str, Any]: issue_id = self.issue_id - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -64,7 +62,7 @@ def to_dict(self) -> dict[str, Any]: description = self.description - state: dict[str, Any] | None | Unset + state: Union[None, Unset, dict[str, Any]] if isinstance(self.state, Unset): state = UNSET elif isinstance(self.state, UpdateLinearIssueTaskParamsStateType0): @@ -72,24 +70,24 @@ def to_dict(self) -> dict[str, Any]: else: state = self.state - project: dict[str, Any] | Unset = UNSET + project: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.project, Unset): project = self.project.to_dict() - labels: list[dict[str, Any]] | Unset = UNSET + labels: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.labels, Unset): labels = [] for labels_item_data in self.labels: labels_item = labels_item_data.to_dict() labels.append(labels_item) - priority: dict[str, Any] | Unset = UNSET + priority: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.priority, Unset): priority = self.priority.to_dict() assign_user_email = self.assign_user_email - custom_fields_mapping: None | str | Unset + custom_fields_mapping: Union[None, Unset, str] if isinstance(self.custom_fields_mapping, Unset): custom_fields_mapping = UNSET else: @@ -134,7 +132,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: issue_id = d.pop("issue_id") _task_type = d.pop("task_type", UNSET) - task_type: UpdateLinearIssueTaskParamsTaskType | Unset + task_type: Union[Unset, UpdateLinearIssueTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: @@ -144,7 +142,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: description = d.pop("description", UNSET) - def _parse_state(data: object) -> None | Unset | UpdateLinearIssueTaskParamsStateType0: + def _parse_state(data: object) -> Union["UpdateLinearIssueTaskParamsStateType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -155,30 +153,28 @@ def _parse_state(data: object) -> None | Unset | UpdateLinearIssueTaskParamsStat state_type_0 = UpdateLinearIssueTaskParamsStateType0.from_dict(data) return state_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(None | Unset | UpdateLinearIssueTaskParamsStateType0, data) + return cast(Union["UpdateLinearIssueTaskParamsStateType0", None, Unset], data) state = _parse_state(d.pop("state", UNSET)) _project = d.pop("project", UNSET) - project: UpdateLinearIssueTaskParamsProject | Unset + project: Union[Unset, UpdateLinearIssueTaskParamsProject] if isinstance(_project, Unset): project = UNSET else: project = UpdateLinearIssueTaskParamsProject.from_dict(_project) + labels = [] _labels = d.pop("labels", UNSET) - labels: list[UpdateLinearIssueTaskParamsLabelsItem] | Unset = UNSET - if _labels is not UNSET: - labels = [] - for labels_item_data in _labels: - labels_item = UpdateLinearIssueTaskParamsLabelsItem.from_dict(labels_item_data) + for labels_item_data in _labels or []: + labels_item = UpdateLinearIssueTaskParamsLabelsItem.from_dict(labels_item_data) - labels.append(labels_item) + labels.append(labels_item) _priority = d.pop("priority", UNSET) - priority: UpdateLinearIssueTaskParamsPriority | Unset + priority: Union[Unset, UpdateLinearIssueTaskParamsPriority] if isinstance(_priority, Unset): priority = UNSET else: @@ -186,12 +182,12 @@ def _parse_state(data: object) -> None | Unset | UpdateLinearIssueTaskParamsStat assign_user_email = d.pop("assign_user_email", UNSET) - def _parse_custom_fields_mapping(data: object) -> None | str | Unset: + def _parse_custom_fields_mapping(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) custom_fields_mapping = _parse_custom_fields_mapping(d.pop("custom_fields_mapping", UNSET)) diff --git a/rootly_sdk/models/update_linear_issue_task_params_labels_item.py b/rootly_sdk/models/update_linear_issue_task_params_labels_item.py index 79c23c9d..8abb3770 100644 --- a/rootly_sdk/models/update_linear_issue_task_params_labels_item.py +++ b/rootly_sdk/models/update_linear_issue_task_params_labels_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class UpdateLinearIssueTaskParamsLabelsItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_linear_issue_task_params_priority.py b/rootly_sdk/models/update_linear_issue_task_params_priority.py index f4b9cfd4..2a3129f2 100644 --- a/rootly_sdk/models/update_linear_issue_task_params_priority.py +++ b/rootly_sdk/models/update_linear_issue_task_params_priority.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,12 +14,12 @@ class UpdateLinearIssueTaskParamsPriority: """The priority id and display name Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_linear_issue_task_params_project.py b/rootly_sdk/models/update_linear_issue_task_params_project.py index d10f9177..bdf883c5 100644 --- a/rootly_sdk/models/update_linear_issue_task_params_project.py +++ b/rootly_sdk/models/update_linear_issue_task_params_project.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,12 +14,12 @@ class UpdateLinearIssueTaskParamsProject: """The project id and display name Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_linear_issue_task_params_state_type_0.py b/rootly_sdk/models/update_linear_issue_task_params_state_type_0.py index e5b7c643..c35745ae 100644 --- a/rootly_sdk/models/update_linear_issue_task_params_state_type_0.py +++ b/rootly_sdk/models/update_linear_issue_task_params_state_type_0.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,12 +14,12 @@ class UpdateLinearIssueTaskParamsStateType0: """The state id and display name Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_live_call_router.py b/rootly_sdk/models/update_live_call_router.py index d9316b3a..ab09a49a 100644 --- a/rootly_sdk/models/update_live_call_router.py +++ b/rootly_sdk/models/update_live_call_router.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateLiveCallRouter: data (UpdateLiveCallRouterData): """ - data: UpdateLiveCallRouterData + data: "UpdateLiveCallRouterData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_live_call_router_data.py b/rootly_sdk/models/update_live_call_router_data.py index 648e051f..1fdba004 100644 --- a/rootly_sdk/models/update_live_call_router_data.py +++ b/rootly_sdk/models/update_live_call_router_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class UpdateLiveCallRouterData: """ type_: UpdateLiveCallRouterDataType - attributes: UpdateLiveCallRouterDataAttributes + attributes: "UpdateLiveCallRouterDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_live_call_router_data_attributes.py b/rootly_sdk/models/update_live_call_router_data_attributes.py index c84e7ad7..4c965b60 100644 --- a/rootly_sdk/models/update_live_call_router_data_attributes.py +++ b/rootly_sdk/models/update_live_call_router_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -39,62 +37,69 @@ class UpdateLiveCallRouterDataAttributes: """ Attributes: - kind (UpdateLiveCallRouterDataAttributesKind | Unset): The kind of the live_call_router - enabled (bool | Unset): Whether the live_call_router is enabled - name (str | Unset): The name of the live_call_router - country_code (UpdateLiveCallRouterDataAttributesCountryCode | Unset): The country code of the live_call_router - phone_type (UpdateLiveCallRouterDataAttributesPhoneType | Unset): The phone type of the live_call_router - voicemail_greeting (str | Unset): The voicemail greeting of the live_call_router - caller_greeting (str | Unset): The caller greeting message of the live_call_router - unavailable_responder_message (None | str | Unset): The message played to the caller when a responder doesn't - answer and the call moves on to the next person in the escalation. Leave blank to use the default message. - waiting_music_url (UpdateLiveCallRouterDataAttributesWaitingMusicUrl | Unset): The waiting music URL of the + kind (Union[Unset, UpdateLiveCallRouterDataAttributesKind]): The kind of the live_call_router + enabled (Union[Unset, bool]): Whether the live_call_router is enabled + name (Union[Unset, str]): The name of the live_call_router + country_code (Union[Unset, UpdateLiveCallRouterDataAttributesCountryCode]): The country code of the live_call_router - sent_to_voicemail_delay (int | Unset): The delay (seconds) after which the caller in redirected to voicemail - should_redirect_to_voicemail_on_no_answer (bool | Unset): This prompts the caller to choose voicemail or connect - live - escalation_level_delay_in_seconds (int | Unset): This overrides the delay (seconds) in escalation levels - should_auto_resolve_alert_on_call_end (bool | Unset): This overrides the delay (seconds) in escalation levels - notify_via_sms (bool | Unset): Whether responders are also notified via SMS when this router pages them - notify_via_push_notification (bool | Unset): Whether responders are also notified via push notification when - this router pages them - informational_notification_message (None | str | Unset): Optional message included in the SMS/push notification. - Supports variables such as {{ alert.url }}, {{ alert.data.* }}, and {{ alert.alert_urgency.name }}. - alert_urgency_id (str | Unset): This is used in escalation paths to determine who to page - calling_tree_enabled (bool | Unset): Whether the live call router is configured as a phone tree, requiring + phone_type (Union[Unset, UpdateLiveCallRouterDataAttributesPhoneType]): The phone type of the live_call_router + voicemail_greeting (Union[Unset, str]): The voicemail greeting of the live_call_router + caller_greeting (Union[Unset, str]): The caller greeting message of the live_call_router + unavailable_responder_message (Union[None, Unset, str]): The message played to the caller when a responder + doesn't answer and the call moves on to the next person in the escalation. Leave blank to use the default + message. + waiting_music_url (Union[Unset, UpdateLiveCallRouterDataAttributesWaitingMusicUrl]): The waiting music URL of + the live_call_router + sent_to_voicemail_delay (Union[Unset, int]): The delay (seconds) after which the caller in redirected to + voicemail + should_redirect_to_voicemail_on_no_answer (Union[Unset, bool]): This prompts the caller to choose voicemail or + connect live + escalation_level_delay_in_seconds (Union[Unset, int]): This overrides the delay (seconds) in escalation levels + should_auto_resolve_alert_on_call_end (Union[Unset, bool]): This overrides the delay (seconds) in escalation + levels + notify_via_sms (Union[Unset, bool]): Whether responders are also notified via SMS when this router pages them + notify_via_push_notification (Union[Unset, bool]): Whether responders are also notified via push notification + when this router pages them + informational_notification_message (Union[None, Unset, str]): Optional message included in the SMS/push + notification. Supports variables such as {{ alert.url }}, {{ alert.data.* }}, and {{ alert.alert_urgency.name + }}. + alert_urgency_id (Union[Unset, str]): This is used in escalation paths to determine who to page + calling_tree_enabled (Union[Unset, bool]): Whether the live call router is configured as a phone tree, requiring callers to press a key before being connected - calling_tree_prompt (str | Unset): The audio instructions callers will hear when they call this number, + calling_tree_prompt (Union[Unset, str]): The audio instructions callers will hear when they call this number, prompting them to select from available options to route their call - paging_targets (list[UpdateLiveCallRouterDataAttributesPagingTargetsItem] | Unset): Paging targets that callers - can select from when this live call router is configured as a phone tree. - escalation_policy_trigger_params (UpdateLiveCallRouterDataAttributesEscalationPolicyTriggerParams | Unset): + paging_targets (Union[Unset, list['UpdateLiveCallRouterDataAttributesPagingTargetsItem']]): Paging targets that + callers can select from when this live call router is configured as a phone tree. + escalation_policy_trigger_params (Union[Unset, + UpdateLiveCallRouterDataAttributesEscalationPolicyTriggerParams]): """ - kind: UpdateLiveCallRouterDataAttributesKind | Unset = UNSET - enabled: bool | Unset = UNSET - name: str | Unset = UNSET - country_code: UpdateLiveCallRouterDataAttributesCountryCode | Unset = UNSET - phone_type: UpdateLiveCallRouterDataAttributesPhoneType | Unset = UNSET - voicemail_greeting: str | Unset = UNSET - caller_greeting: str | Unset = UNSET - unavailable_responder_message: None | str | Unset = UNSET - waiting_music_url: UpdateLiveCallRouterDataAttributesWaitingMusicUrl | Unset = UNSET - sent_to_voicemail_delay: int | Unset = UNSET - should_redirect_to_voicemail_on_no_answer: bool | Unset = UNSET - escalation_level_delay_in_seconds: int | Unset = UNSET - should_auto_resolve_alert_on_call_end: bool | Unset = UNSET - notify_via_sms: bool | Unset = UNSET - notify_via_push_notification: bool | Unset = UNSET - informational_notification_message: None | str | Unset = UNSET - alert_urgency_id: str | Unset = UNSET - calling_tree_enabled: bool | Unset = UNSET - calling_tree_prompt: str | Unset = UNSET - paging_targets: list[UpdateLiveCallRouterDataAttributesPagingTargetsItem] | Unset = UNSET - escalation_policy_trigger_params: UpdateLiveCallRouterDataAttributesEscalationPolicyTriggerParams | Unset = UNSET + kind: Union[Unset, UpdateLiveCallRouterDataAttributesKind] = UNSET + enabled: Union[Unset, bool] = UNSET + name: Union[Unset, str] = UNSET + country_code: Union[Unset, UpdateLiveCallRouterDataAttributesCountryCode] = UNSET + phone_type: Union[Unset, UpdateLiveCallRouterDataAttributesPhoneType] = UNSET + voicemail_greeting: Union[Unset, str] = UNSET + caller_greeting: Union[Unset, str] = UNSET + unavailable_responder_message: Union[None, Unset, str] = UNSET + waiting_music_url: Union[Unset, UpdateLiveCallRouterDataAttributesWaitingMusicUrl] = UNSET + sent_to_voicemail_delay: Union[Unset, int] = UNSET + should_redirect_to_voicemail_on_no_answer: Union[Unset, bool] = UNSET + escalation_level_delay_in_seconds: Union[Unset, int] = UNSET + should_auto_resolve_alert_on_call_end: Union[Unset, bool] = UNSET + notify_via_sms: Union[Unset, bool] = UNSET + notify_via_push_notification: Union[Unset, bool] = UNSET + informational_notification_message: Union[None, Unset, str] = UNSET + alert_urgency_id: Union[Unset, str] = UNSET + calling_tree_enabled: Union[Unset, bool] = UNSET + calling_tree_prompt: Union[Unset, str] = UNSET + paging_targets: Union[Unset, list["UpdateLiveCallRouterDataAttributesPagingTargetsItem"]] = UNSET + escalation_policy_trigger_params: Union[ + Unset, "UpdateLiveCallRouterDataAttributesEscalationPolicyTriggerParams" + ] = UNSET def to_dict(self) -> dict[str, Any]: - - kind: str | Unset = UNSET + kind: Union[Unset, str] = UNSET if not isinstance(self.kind, Unset): kind = self.kind @@ -102,11 +107,11 @@ def to_dict(self) -> dict[str, Any]: name = self.name - country_code: str | Unset = UNSET + country_code: Union[Unset, str] = UNSET if not isinstance(self.country_code, Unset): country_code = self.country_code - phone_type: str | Unset = UNSET + phone_type: Union[Unset, str] = UNSET if not isinstance(self.phone_type, Unset): phone_type = self.phone_type @@ -114,13 +119,13 @@ def to_dict(self) -> dict[str, Any]: caller_greeting = self.caller_greeting - unavailable_responder_message: None | str | Unset + unavailable_responder_message: Union[None, Unset, str] if isinstance(self.unavailable_responder_message, Unset): unavailable_responder_message = UNSET else: unavailable_responder_message = self.unavailable_responder_message - waiting_music_url: str | Unset = UNSET + waiting_music_url: Union[Unset, str] = UNSET if not isinstance(self.waiting_music_url, Unset): waiting_music_url = self.waiting_music_url @@ -136,7 +141,7 @@ def to_dict(self) -> dict[str, Any]: notify_via_push_notification = self.notify_via_push_notification - informational_notification_message: None | str | Unset + informational_notification_message: Union[None, Unset, str] if isinstance(self.informational_notification_message, Unset): informational_notification_message = UNSET else: @@ -148,14 +153,14 @@ def to_dict(self) -> dict[str, Any]: calling_tree_prompt = self.calling_tree_prompt - paging_targets: list[dict[str, Any]] | Unset = UNSET + paging_targets: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.paging_targets, Unset): paging_targets = [] for paging_targets_item_data in self.paging_targets: paging_targets_item = paging_targets_item_data.to_dict() paging_targets.append(paging_targets_item) - escalation_policy_trigger_params: dict[str, Any] | Unset = UNSET + escalation_policy_trigger_params: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.escalation_policy_trigger_params, Unset): escalation_policy_trigger_params = self.escalation_policy_trigger_params.to_dict() @@ -218,7 +223,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _kind = d.pop("kind", UNSET) - kind: UpdateLiveCallRouterDataAttributesKind | Unset + kind: Union[Unset, UpdateLiveCallRouterDataAttributesKind] if isinstance(_kind, Unset): kind = UNSET else: @@ -229,14 +234,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name = d.pop("name", UNSET) _country_code = d.pop("country_code", UNSET) - country_code: UpdateLiveCallRouterDataAttributesCountryCode | Unset + country_code: Union[Unset, UpdateLiveCallRouterDataAttributesCountryCode] if isinstance(_country_code, Unset): country_code = UNSET else: country_code = check_update_live_call_router_data_attributes_country_code(_country_code) _phone_type = d.pop("phone_type", UNSET) - phone_type: UpdateLiveCallRouterDataAttributesPhoneType | Unset + phone_type: Union[Unset, UpdateLiveCallRouterDataAttributesPhoneType] if isinstance(_phone_type, Unset): phone_type = UNSET else: @@ -246,19 +251,19 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: caller_greeting = d.pop("caller_greeting", UNSET) - def _parse_unavailable_responder_message(data: object) -> None | str | Unset: + def _parse_unavailable_responder_message(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) unavailable_responder_message = _parse_unavailable_responder_message( d.pop("unavailable_responder_message", UNSET) ) _waiting_music_url = d.pop("waiting_music_url", UNSET) - waiting_music_url: UpdateLiveCallRouterDataAttributesWaitingMusicUrl | Unset + waiting_music_url: Union[Unset, UpdateLiveCallRouterDataAttributesWaitingMusicUrl] if isinstance(_waiting_music_url, Unset): waiting_music_url = UNSET else: @@ -276,12 +281,12 @@ def _parse_unavailable_responder_message(data: object) -> None | str | Unset: notify_via_push_notification = d.pop("notify_via_push_notification", UNSET) - def _parse_informational_notification_message(data: object) -> None | str | Unset: + def _parse_informational_notification_message(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) informational_notification_message = _parse_informational_notification_message( d.pop("informational_notification_message", UNSET) @@ -293,19 +298,17 @@ def _parse_informational_notification_message(data: object) -> None | str | Unse calling_tree_prompt = d.pop("calling_tree_prompt", UNSET) + paging_targets = [] _paging_targets = d.pop("paging_targets", UNSET) - paging_targets: list[UpdateLiveCallRouterDataAttributesPagingTargetsItem] | Unset = UNSET - if _paging_targets is not UNSET: - paging_targets = [] - for paging_targets_item_data in _paging_targets: - paging_targets_item = UpdateLiveCallRouterDataAttributesPagingTargetsItem.from_dict( - paging_targets_item_data - ) + for paging_targets_item_data in _paging_targets or []: + paging_targets_item = UpdateLiveCallRouterDataAttributesPagingTargetsItem.from_dict( + paging_targets_item_data + ) - paging_targets.append(paging_targets_item) + paging_targets.append(paging_targets_item) _escalation_policy_trigger_params = d.pop("escalation_policy_trigger_params", UNSET) - escalation_policy_trigger_params: UpdateLiveCallRouterDataAttributesEscalationPolicyTriggerParams | Unset + escalation_policy_trigger_params: Union[Unset, UpdateLiveCallRouterDataAttributesEscalationPolicyTriggerParams] if isinstance(_escalation_policy_trigger_params, Unset): escalation_policy_trigger_params = UNSET else: diff --git a/rootly_sdk/models/update_live_call_router_data_attributes_escalation_policy_trigger_params.py b/rootly_sdk/models/update_live_call_router_data_attributes_escalation_policy_trigger_params.py index 319b895f..95a1f5e9 100644 --- a/rootly_sdk/models/update_live_call_router_data_attributes_escalation_policy_trigger_params.py +++ b/rootly_sdk/models/update_live_call_router_data_attributes_escalation_policy_trigger_params.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/update_live_call_router_data_attributes_paging_targets_item.py b/rootly_sdk/models/update_live_call_router_data_attributes_paging_targets_item.py index 2fc7b043..d3526da7 100644 --- a/rootly_sdk/models/update_live_call_router_data_attributes_paging_targets_item.py +++ b/rootly_sdk/models/update_live_call_router_data_attributes_paging_targets_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/update_motion_task_task_params.py b/rootly_sdk/models/update_motion_task_task_params.py index 4ea29079..9522bc21 100644 --- a/rootly_sdk/models/update_motion_task_task_params.py +++ b/rootly_sdk/models/update_motion_task_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -24,30 +22,29 @@ class UpdateMotionTaskTaskParams: """ Attributes: task_id (str): The task id - task_type (UpdateMotionTaskTaskParamsTaskType | Unset): - title (str | Unset): The task title - description (str | Unset): The task description - labels (list[str] | Unset): - priority (UpdateMotionTaskTaskParamsPriority | Unset): The priority id and display name - duration (str | Unset): The duration. Eg. "NONE", "REMINDER", or a integer greater than 0. - due_date (str | Unset): The due date + task_type (Union[Unset, UpdateMotionTaskTaskParamsTaskType]): + title (Union[Unset, str]): The task title + description (Union[Unset, str]): The task description + labels (Union[Unset, list[str]]): + priority (Union[Unset, UpdateMotionTaskTaskParamsPriority]): The priority id and display name + duration (Union[Unset, str]): The duration. Eg. "NONE", "REMINDER", or a integer greater than 0. + due_date (Union[Unset, str]): The due date """ task_id: str - task_type: UpdateMotionTaskTaskParamsTaskType | Unset = UNSET - title: str | Unset = UNSET - description: str | Unset = UNSET - labels: list[str] | Unset = UNSET - priority: UpdateMotionTaskTaskParamsPriority | Unset = UNSET - duration: str | Unset = UNSET - due_date: str | Unset = UNSET + task_type: Union[Unset, UpdateMotionTaskTaskParamsTaskType] = UNSET + title: Union[Unset, str] = UNSET + description: Union[Unset, str] = UNSET + labels: Union[Unset, list[str]] = UNSET + priority: Union[Unset, "UpdateMotionTaskTaskParamsPriority"] = UNSET + duration: Union[Unset, str] = UNSET + due_date: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - task_id = self.task_id - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -55,11 +52,11 @@ def to_dict(self) -> dict[str, Any]: description = self.description - labels: list[str] | Unset = UNSET + labels: Union[Unset, list[str]] = UNSET if not isinstance(self.labels, Unset): labels = self.labels - priority: dict[str, Any] | Unset = UNSET + priority: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.priority, Unset): priority = self.priority.to_dict() @@ -99,7 +96,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: task_id = d.pop("task_id") _task_type = d.pop("task_type", UNSET) - task_type: UpdateMotionTaskTaskParamsTaskType | Unset + task_type: Union[Unset, UpdateMotionTaskTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: @@ -112,7 +109,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: labels = cast(list[str], d.pop("labels", UNSET)) _priority = d.pop("priority", UNSET) - priority: UpdateMotionTaskTaskParamsPriority | Unset + priority: Union[Unset, UpdateMotionTaskTaskParamsPriority] if isinstance(_priority, Unset): priority = UNSET else: diff --git a/rootly_sdk/models/update_motion_task_task_params_priority.py b/rootly_sdk/models/update_motion_task_task_params_priority.py index 20e79aec..1a01e035 100644 --- a/rootly_sdk/models/update_motion_task_task_params_priority.py +++ b/rootly_sdk/models/update_motion_task_task_params_priority.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,12 +14,12 @@ class UpdateMotionTaskTaskParamsPriority: """The priority id and display name Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_notion_page_task_params.py b/rootly_sdk/models/update_notion_page_task_params.py index 89bd9a23..308c177e 100644 --- a/rootly_sdk/models/update_notion_page_task_params.py +++ b/rootly_sdk/models/update_notion_page_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -20,28 +18,28 @@ class UpdateNotionPageTaskParams: """ Attributes: file_id (str): The Notion page ID - task_type (UpdateNotionPageTaskParamsTaskType | Unset): - title (str | Unset): The Notion page title - post_mortem_template_id (str | Unset): Retrospective template to use when creating page task, if desired - content (str | Unset): Custom page content with liquid templating support. When provided, only this content will - be rendered (no default sections) - show_timeline_as_table (bool | Unset): - show_action_items_as_table (bool | Unset): + task_type (Union[Unset, UpdateNotionPageTaskParamsTaskType]): + title (Union[Unset, str]): The Notion page title + post_mortem_template_id (Union[Unset, str]): Retrospective template to use when creating page task, if desired + content (Union[Unset, str]): Custom page content with liquid templating support. When provided, only this + content will be rendered (no default sections) + show_timeline_as_table (Union[Unset, bool]): + show_action_items_as_table (Union[Unset, bool]): """ file_id: str - task_type: UpdateNotionPageTaskParamsTaskType | Unset = UNSET - title: str | Unset = UNSET - post_mortem_template_id: str | Unset = UNSET - content: str | Unset = UNSET - show_timeline_as_table: bool | Unset = UNSET - show_action_items_as_table: bool | Unset = UNSET + task_type: Union[Unset, UpdateNotionPageTaskParamsTaskType] = UNSET + title: Union[Unset, str] = UNSET + post_mortem_template_id: Union[Unset, str] = UNSET + content: Union[Unset, str] = UNSET + show_timeline_as_table: Union[Unset, bool] = UNSET + show_action_items_as_table: Union[Unset, bool] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: file_id = self.file_id - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -83,7 +81,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: file_id = d.pop("file_id") _task_type = d.pop("task_type", UNSET) - task_type: UpdateNotionPageTaskParamsTaskType | Unset + task_type: Union[Unset, UpdateNotionPageTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/update_on_call_pay_report.py b/rootly_sdk/models/update_on_call_pay_report.py index 932f9471..c1ca2b46 100644 --- a/rootly_sdk/models/update_on_call_pay_report.py +++ b/rootly_sdk/models/update_on_call_pay_report.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateOnCallPayReport: data (UpdateOnCallPayReportData): """ - data: UpdateOnCallPayReportData + data: "UpdateOnCallPayReportData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_on_call_pay_report_data.py b/rootly_sdk/models/update_on_call_pay_report_data.py index c25845dc..ff717150 100644 --- a/rootly_sdk/models/update_on_call_pay_report_data.py +++ b/rootly_sdk/models/update_on_call_pay_report_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class UpdateOnCallPayReportData: """ type_: UpdateOnCallPayReportDataType - attributes: UpdateOnCallPayReportDataAttributes + attributes: "UpdateOnCallPayReportDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_on_call_pay_report_data_attributes.py b/rootly_sdk/models/update_on_call_pay_report_data_attributes.py index 513508f2..f274a069 100644 --- a/rootly_sdk/models/update_on_call_pay_report_data_attributes.py +++ b/rootly_sdk/models/update_on_call_pay_report_data_attributes.py @@ -1,8 +1,6 @@ -from __future__ import annotations - import datetime from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from dateutil.parser import isoparse @@ -16,30 +14,30 @@ class UpdateOnCallPayReportDataAttributes: """ Attributes: - start_date (datetime.date | Unset): The start date for the report period. - end_date (datetime.date | Unset): The end date for the report period. - schedule_ids (list[str] | Unset): List of schedule UUIDs to scope the report. - time_zone (str | Unset): IANA timezone used to compute day and weekend boundaries. - use_responders_time_zone (bool | Unset): When true, day and weekend boundaries are computed in each responder's - personal timezone instead of the report-wide timezone. + start_date (Union[Unset, datetime.date]): The start date for the report period. + end_date (Union[Unset, datetime.date]): The end date for the report period. + schedule_ids (Union[Unset, list[str]]): List of schedule UUIDs to scope the report. + time_zone (Union[Unset, str]): IANA timezone used to compute day and weekend boundaries. + use_responders_time_zone (Union[Unset, bool]): When true, day and weekend boundaries are computed in each + responder's personal timezone instead of the report-wide timezone. """ - start_date: datetime.date | Unset = UNSET - end_date: datetime.date | Unset = UNSET - schedule_ids: list[str] | Unset = UNSET - time_zone: str | Unset = UNSET - use_responders_time_zone: bool | Unset = UNSET + start_date: Union[Unset, datetime.date] = UNSET + end_date: Union[Unset, datetime.date] = UNSET + schedule_ids: Union[Unset, list[str]] = UNSET + time_zone: Union[Unset, str] = UNSET + use_responders_time_zone: Union[Unset, bool] = UNSET def to_dict(self) -> dict[str, Any]: - start_date: str | Unset = UNSET + start_date: Union[Unset, str] = UNSET if not isinstance(self.start_date, Unset): start_date = self.start_date.isoformat() - end_date: str | Unset = UNSET + end_date: Union[Unset, str] = UNSET if not isinstance(self.end_date, Unset): end_date = self.end_date.isoformat() - schedule_ids: list[str] | Unset = UNSET + schedule_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.schedule_ids, Unset): schedule_ids = self.schedule_ids @@ -67,14 +65,14 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _start_date = d.pop("start_date", UNSET) - start_date: datetime.date | Unset + start_date: Union[Unset, datetime.date] if isinstance(_start_date, Unset): start_date = UNSET else: start_date = isoparse(_start_date).date() _end_date = d.pop("end_date", UNSET) - end_date: datetime.date | Unset + end_date: Union[Unset, datetime.date] if isinstance(_end_date, Unset): end_date = UNSET else: diff --git a/rootly_sdk/models/update_on_call_role.py b/rootly_sdk/models/update_on_call_role.py index 273c5735..ff9a0a38 100644 --- a/rootly_sdk/models/update_on_call_role.py +++ b/rootly_sdk/models/update_on_call_role.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateOnCallRole: data (UpdateOnCallRoleData): """ - data: UpdateOnCallRoleData + data: "UpdateOnCallRoleData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_on_call_role_data.py b/rootly_sdk/models/update_on_call_role_data.py index af8dd19a..320a3c0d 100644 --- a/rootly_sdk/models/update_on_call_role_data.py +++ b/rootly_sdk/models/update_on_call_role_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class UpdateOnCallRoleData: """ type_: UpdateOnCallRoleDataType - attributes: UpdateOnCallRoleDataAttributes + attributes: "UpdateOnCallRoleDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_on_call_role_data_attributes.py b/rootly_sdk/models/update_on_call_role_data_attributes.py index bbeb6c0d..9d96123d 100644 --- a/rootly_sdk/models/update_on_call_role_data_attributes.py +++ b/rootly_sdk/models/update_on_call_role_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -110,235 +108,255 @@ class UpdateOnCallRoleDataAttributes: """ Attributes: - name (str | Unset): The role name. - system_role (str | Unset): The kind of role (user and custom type roles are only editable) Default: 'custom'. - alert_sources_permissions (list[UpdateOnCallRoleDataAttributesAlertSourcesPermissionsItem] | Unset): - alert_urgency_permissions (list[UpdateOnCallRoleDataAttributesAlertUrgencyPermissionsItem] | Unset): - alert_fields_permissions (list[UpdateOnCallRoleDataAttributesAlertFieldsPermissionsItem] | Unset): - alert_groups_permissions (list[UpdateOnCallRoleDataAttributesAlertGroupsPermissionsItem] | Unset): - alert_routing_rules_permissions (list[UpdateOnCallRoleDataAttributesAlertRoutingRulesPermissionsItem] | Unset): - on_call_readiness_report_permissions (list[UpdateOnCallRoleDataAttributesOnCallReadinessReportPermissionsItem] | - Unset): - on_call_roles_permissions (list[UpdateOnCallRoleDataAttributesOnCallRolesPermissionsItem] | Unset): - alerts_permissions (list[UpdateOnCallRoleDataAttributesAlertsPermissionsItem] | Unset): - api_keys_permissions (list[UpdateOnCallRoleDataAttributesApiKeysPermissionsItem] | Unset): - audits_permissions (list[UpdateOnCallRoleDataAttributesAuditsPermissionsItem] | Unset): - contacts_permissions (list[UpdateOnCallRoleDataAttributesContactsPermissionsItem] | Unset): - escalation_policies_permissions (list[UpdateOnCallRoleDataAttributesEscalationPoliciesPermissionsItem] | Unset): - groups_permissions (list[UpdateOnCallRoleDataAttributesGroupsPermissionsItem] | Unset): - heartbeats_permissions (list[UpdateOnCallRoleDataAttributesHeartbeatsPermissionsItem] | Unset): - integrations_permissions (list[UpdateOnCallRoleDataAttributesIntegrationsPermissionsItem] | Unset): - invitations_permissions (list[UpdateOnCallRoleDataAttributesInvitationsPermissionsItem] | Unset): - live_call_routing_permissions (list[UpdateOnCallRoleDataAttributesLiveCallRoutingPermissionsItem] | Unset): - schedule_override_permissions (list[UpdateOnCallRoleDataAttributesScheduleOverridePermissionsItem] | Unset): - schedules_permissions (list[UpdateOnCallRoleDataAttributesSchedulesPermissionsItem] | Unset): - services_permissions (list[UpdateOnCallRoleDataAttributesServicesPermissionsItem] | Unset): - functionalities_permissions (list[UpdateOnCallRoleDataAttributesFunctionalitiesPermissionsItem] | Unset): - webhooks_permissions (list[UpdateOnCallRoleDataAttributesWebhooksPermissionsItem] | Unset): - workflows_permissions (list[UpdateOnCallRoleDataAttributesWorkflowsPermissionsItem] | Unset): - catalogs_permissions (list[UpdateOnCallRoleDataAttributesCatalogsPermissionsItem] | Unset): + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + name (Union[Unset, str]): The role name. + system_role (Union[Unset, str]): The kind of role (user and custom type roles are only editable) Default: + 'custom'. + alert_sources_permissions (Union[Unset, list[UpdateOnCallRoleDataAttributesAlertSourcesPermissionsItem]]): + alert_urgency_permissions (Union[Unset, list[UpdateOnCallRoleDataAttributesAlertUrgencyPermissionsItem]]): + alert_fields_permissions (Union[Unset, list[UpdateOnCallRoleDataAttributesAlertFieldsPermissionsItem]]): + alert_groups_permissions (Union[Unset, list[UpdateOnCallRoleDataAttributesAlertGroupsPermissionsItem]]): + alert_routing_rules_permissions (Union[Unset, + list[UpdateOnCallRoleDataAttributesAlertRoutingRulesPermissionsItem]]): + on_call_readiness_report_permissions (Union[Unset, + list[UpdateOnCallRoleDataAttributesOnCallReadinessReportPermissionsItem]]): + on_call_roles_permissions (Union[Unset, list[UpdateOnCallRoleDataAttributesOnCallRolesPermissionsItem]]): + alerts_permissions (Union[Unset, list[UpdateOnCallRoleDataAttributesAlertsPermissionsItem]]): + api_keys_permissions (Union[Unset, list[UpdateOnCallRoleDataAttributesApiKeysPermissionsItem]]): + audits_permissions (Union[Unset, list[UpdateOnCallRoleDataAttributesAuditsPermissionsItem]]): + contacts_permissions (Union[Unset, list[UpdateOnCallRoleDataAttributesContactsPermissionsItem]]): + escalation_policies_permissions (Union[Unset, + list[UpdateOnCallRoleDataAttributesEscalationPoliciesPermissionsItem]]): + groups_permissions (Union[Unset, list[UpdateOnCallRoleDataAttributesGroupsPermissionsItem]]): + heartbeats_permissions (Union[Unset, list[UpdateOnCallRoleDataAttributesHeartbeatsPermissionsItem]]): + integrations_permissions (Union[Unset, list[UpdateOnCallRoleDataAttributesIntegrationsPermissionsItem]]): + invitations_permissions (Union[Unset, list[UpdateOnCallRoleDataAttributesInvitationsPermissionsItem]]): + live_call_routing_permissions (Union[Unset, + list[UpdateOnCallRoleDataAttributesLiveCallRoutingPermissionsItem]]): + schedule_override_permissions (Union[Unset, + list[UpdateOnCallRoleDataAttributesScheduleOverridePermissionsItem]]): + schedules_permissions (Union[Unset, list[UpdateOnCallRoleDataAttributesSchedulesPermissionsItem]]): + services_permissions (Union[Unset, list[UpdateOnCallRoleDataAttributesServicesPermissionsItem]]): + functionalities_permissions (Union[Unset, list[UpdateOnCallRoleDataAttributesFunctionalitiesPermissionsItem]]): + webhooks_permissions (Union[Unset, list[UpdateOnCallRoleDataAttributesWebhooksPermissionsItem]]): + workflows_permissions (Union[Unset, list[UpdateOnCallRoleDataAttributesWorkflowsPermissionsItem]]): + catalogs_permissions (Union[Unset, list[UpdateOnCallRoleDataAttributesCatalogsPermissionsItem]]): """ - name: str | Unset = UNSET - system_role: str | Unset = "custom" - alert_sources_permissions: list[UpdateOnCallRoleDataAttributesAlertSourcesPermissionsItem] | Unset = UNSET - alert_urgency_permissions: list[UpdateOnCallRoleDataAttributesAlertUrgencyPermissionsItem] | Unset = UNSET - alert_fields_permissions: list[UpdateOnCallRoleDataAttributesAlertFieldsPermissionsItem] | Unset = UNSET - alert_groups_permissions: list[UpdateOnCallRoleDataAttributesAlertGroupsPermissionsItem] | Unset = UNSET - alert_routing_rules_permissions: list[UpdateOnCallRoleDataAttributesAlertRoutingRulesPermissionsItem] | Unset = ( + slug: Union[None, Unset, str] = UNSET + name: Union[Unset, str] = UNSET + system_role: Union[Unset, str] = "custom" + alert_sources_permissions: Union[Unset, list[UpdateOnCallRoleDataAttributesAlertSourcesPermissionsItem]] = UNSET + alert_urgency_permissions: Union[Unset, list[UpdateOnCallRoleDataAttributesAlertUrgencyPermissionsItem]] = UNSET + alert_fields_permissions: Union[Unset, list[UpdateOnCallRoleDataAttributesAlertFieldsPermissionsItem]] = UNSET + alert_groups_permissions: Union[Unset, list[UpdateOnCallRoleDataAttributesAlertGroupsPermissionsItem]] = UNSET + alert_routing_rules_permissions: Union[ + Unset, list[UpdateOnCallRoleDataAttributesAlertRoutingRulesPermissionsItem] + ] = UNSET + on_call_readiness_report_permissions: Union[ + Unset, list[UpdateOnCallRoleDataAttributesOnCallReadinessReportPermissionsItem] + ] = UNSET + on_call_roles_permissions: Union[Unset, list[UpdateOnCallRoleDataAttributesOnCallRolesPermissionsItem]] = UNSET + alerts_permissions: Union[Unset, list[UpdateOnCallRoleDataAttributesAlertsPermissionsItem]] = UNSET + api_keys_permissions: Union[Unset, list[UpdateOnCallRoleDataAttributesApiKeysPermissionsItem]] = UNSET + audits_permissions: Union[Unset, list[UpdateOnCallRoleDataAttributesAuditsPermissionsItem]] = UNSET + contacts_permissions: Union[Unset, list[UpdateOnCallRoleDataAttributesContactsPermissionsItem]] = UNSET + escalation_policies_permissions: Union[ + Unset, list[UpdateOnCallRoleDataAttributesEscalationPoliciesPermissionsItem] + ] = UNSET + groups_permissions: Union[Unset, list[UpdateOnCallRoleDataAttributesGroupsPermissionsItem]] = UNSET + heartbeats_permissions: Union[Unset, list[UpdateOnCallRoleDataAttributesHeartbeatsPermissionsItem]] = UNSET + integrations_permissions: Union[Unset, list[UpdateOnCallRoleDataAttributesIntegrationsPermissionsItem]] = UNSET + invitations_permissions: Union[Unset, list[UpdateOnCallRoleDataAttributesInvitationsPermissionsItem]] = UNSET + live_call_routing_permissions: Union[Unset, list[UpdateOnCallRoleDataAttributesLiveCallRoutingPermissionsItem]] = ( + UNSET + ) + schedule_override_permissions: Union[Unset, list[UpdateOnCallRoleDataAttributesScheduleOverridePermissionsItem]] = ( UNSET ) - on_call_readiness_report_permissions: ( - list[UpdateOnCallRoleDataAttributesOnCallReadinessReportPermissionsItem] | Unset - ) = UNSET - on_call_roles_permissions: list[UpdateOnCallRoleDataAttributesOnCallRolesPermissionsItem] | Unset = UNSET - alerts_permissions: list[UpdateOnCallRoleDataAttributesAlertsPermissionsItem] | Unset = UNSET - api_keys_permissions: list[UpdateOnCallRoleDataAttributesApiKeysPermissionsItem] | Unset = UNSET - audits_permissions: list[UpdateOnCallRoleDataAttributesAuditsPermissionsItem] | Unset = UNSET - contacts_permissions: list[UpdateOnCallRoleDataAttributesContactsPermissionsItem] | Unset = UNSET - escalation_policies_permissions: list[UpdateOnCallRoleDataAttributesEscalationPoliciesPermissionsItem] | Unset = ( + schedules_permissions: Union[Unset, list[UpdateOnCallRoleDataAttributesSchedulesPermissionsItem]] = UNSET + services_permissions: Union[Unset, list[UpdateOnCallRoleDataAttributesServicesPermissionsItem]] = UNSET + functionalities_permissions: Union[Unset, list[UpdateOnCallRoleDataAttributesFunctionalitiesPermissionsItem]] = ( UNSET ) - groups_permissions: list[UpdateOnCallRoleDataAttributesGroupsPermissionsItem] | Unset = UNSET - heartbeats_permissions: list[UpdateOnCallRoleDataAttributesHeartbeatsPermissionsItem] | Unset = UNSET - integrations_permissions: list[UpdateOnCallRoleDataAttributesIntegrationsPermissionsItem] | Unset = UNSET - invitations_permissions: list[UpdateOnCallRoleDataAttributesInvitationsPermissionsItem] | Unset = UNSET - live_call_routing_permissions: list[UpdateOnCallRoleDataAttributesLiveCallRoutingPermissionsItem] | Unset = UNSET - schedule_override_permissions: list[UpdateOnCallRoleDataAttributesScheduleOverridePermissionsItem] | Unset = UNSET - schedules_permissions: list[UpdateOnCallRoleDataAttributesSchedulesPermissionsItem] | Unset = UNSET - services_permissions: list[UpdateOnCallRoleDataAttributesServicesPermissionsItem] | Unset = UNSET - functionalities_permissions: list[UpdateOnCallRoleDataAttributesFunctionalitiesPermissionsItem] | Unset = UNSET - webhooks_permissions: list[UpdateOnCallRoleDataAttributesWebhooksPermissionsItem] | Unset = UNSET - workflows_permissions: list[UpdateOnCallRoleDataAttributesWorkflowsPermissionsItem] | Unset = UNSET - catalogs_permissions: list[UpdateOnCallRoleDataAttributesCatalogsPermissionsItem] | Unset = UNSET + webhooks_permissions: Union[Unset, list[UpdateOnCallRoleDataAttributesWebhooksPermissionsItem]] = UNSET + workflows_permissions: Union[Unset, list[UpdateOnCallRoleDataAttributesWorkflowsPermissionsItem]] = UNSET + catalogs_permissions: Union[Unset, list[UpdateOnCallRoleDataAttributesCatalogsPermissionsItem]] = UNSET def to_dict(self) -> dict[str, Any]: + slug: Union[None, Unset, str] + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug + name = self.name system_role = self.system_role - alert_sources_permissions: list[str] | Unset = UNSET + alert_sources_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.alert_sources_permissions, Unset): alert_sources_permissions = [] for alert_sources_permissions_item_data in self.alert_sources_permissions: alert_sources_permissions_item: str = alert_sources_permissions_item_data alert_sources_permissions.append(alert_sources_permissions_item) - alert_urgency_permissions: list[str] | Unset = UNSET + alert_urgency_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.alert_urgency_permissions, Unset): alert_urgency_permissions = [] for alert_urgency_permissions_item_data in self.alert_urgency_permissions: alert_urgency_permissions_item: str = alert_urgency_permissions_item_data alert_urgency_permissions.append(alert_urgency_permissions_item) - alert_fields_permissions: list[str] | Unset = UNSET + alert_fields_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.alert_fields_permissions, Unset): alert_fields_permissions = [] for alert_fields_permissions_item_data in self.alert_fields_permissions: alert_fields_permissions_item: str = alert_fields_permissions_item_data alert_fields_permissions.append(alert_fields_permissions_item) - alert_groups_permissions: list[str] | Unset = UNSET + alert_groups_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.alert_groups_permissions, Unset): alert_groups_permissions = [] for alert_groups_permissions_item_data in self.alert_groups_permissions: alert_groups_permissions_item: str = alert_groups_permissions_item_data alert_groups_permissions.append(alert_groups_permissions_item) - alert_routing_rules_permissions: list[str] | Unset = UNSET + alert_routing_rules_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.alert_routing_rules_permissions, Unset): alert_routing_rules_permissions = [] for alert_routing_rules_permissions_item_data in self.alert_routing_rules_permissions: alert_routing_rules_permissions_item: str = alert_routing_rules_permissions_item_data alert_routing_rules_permissions.append(alert_routing_rules_permissions_item) - on_call_readiness_report_permissions: list[str] | Unset = UNSET + on_call_readiness_report_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.on_call_readiness_report_permissions, Unset): on_call_readiness_report_permissions = [] for on_call_readiness_report_permissions_item_data in self.on_call_readiness_report_permissions: on_call_readiness_report_permissions_item: str = on_call_readiness_report_permissions_item_data on_call_readiness_report_permissions.append(on_call_readiness_report_permissions_item) - on_call_roles_permissions: list[str] | Unset = UNSET + on_call_roles_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.on_call_roles_permissions, Unset): on_call_roles_permissions = [] for on_call_roles_permissions_item_data in self.on_call_roles_permissions: on_call_roles_permissions_item: str = on_call_roles_permissions_item_data on_call_roles_permissions.append(on_call_roles_permissions_item) - alerts_permissions: list[str] | Unset = UNSET + alerts_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.alerts_permissions, Unset): alerts_permissions = [] for alerts_permissions_item_data in self.alerts_permissions: alerts_permissions_item: str = alerts_permissions_item_data alerts_permissions.append(alerts_permissions_item) - api_keys_permissions: list[str] | Unset = UNSET + api_keys_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.api_keys_permissions, Unset): api_keys_permissions = [] for api_keys_permissions_item_data in self.api_keys_permissions: api_keys_permissions_item: str = api_keys_permissions_item_data api_keys_permissions.append(api_keys_permissions_item) - audits_permissions: list[str] | Unset = UNSET + audits_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.audits_permissions, Unset): audits_permissions = [] for audits_permissions_item_data in self.audits_permissions: audits_permissions_item: str = audits_permissions_item_data audits_permissions.append(audits_permissions_item) - contacts_permissions: list[str] | Unset = UNSET + contacts_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.contacts_permissions, Unset): contacts_permissions = [] for contacts_permissions_item_data in self.contacts_permissions: contacts_permissions_item: str = contacts_permissions_item_data contacts_permissions.append(contacts_permissions_item) - escalation_policies_permissions: list[str] | Unset = UNSET + escalation_policies_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.escalation_policies_permissions, Unset): escalation_policies_permissions = [] for escalation_policies_permissions_item_data in self.escalation_policies_permissions: escalation_policies_permissions_item: str = escalation_policies_permissions_item_data escalation_policies_permissions.append(escalation_policies_permissions_item) - groups_permissions: list[str] | Unset = UNSET + groups_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.groups_permissions, Unset): groups_permissions = [] for groups_permissions_item_data in self.groups_permissions: groups_permissions_item: str = groups_permissions_item_data groups_permissions.append(groups_permissions_item) - heartbeats_permissions: list[str] | Unset = UNSET + heartbeats_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.heartbeats_permissions, Unset): heartbeats_permissions = [] for heartbeats_permissions_item_data in self.heartbeats_permissions: heartbeats_permissions_item: str = heartbeats_permissions_item_data heartbeats_permissions.append(heartbeats_permissions_item) - integrations_permissions: list[str] | Unset = UNSET + integrations_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.integrations_permissions, Unset): integrations_permissions = [] for integrations_permissions_item_data in self.integrations_permissions: integrations_permissions_item: str = integrations_permissions_item_data integrations_permissions.append(integrations_permissions_item) - invitations_permissions: list[str] | Unset = UNSET + invitations_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.invitations_permissions, Unset): invitations_permissions = [] for invitations_permissions_item_data in self.invitations_permissions: invitations_permissions_item: str = invitations_permissions_item_data invitations_permissions.append(invitations_permissions_item) - live_call_routing_permissions: list[str] | Unset = UNSET + live_call_routing_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.live_call_routing_permissions, Unset): live_call_routing_permissions = [] for live_call_routing_permissions_item_data in self.live_call_routing_permissions: live_call_routing_permissions_item: str = live_call_routing_permissions_item_data live_call_routing_permissions.append(live_call_routing_permissions_item) - schedule_override_permissions: list[str] | Unset = UNSET + schedule_override_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.schedule_override_permissions, Unset): schedule_override_permissions = [] for schedule_override_permissions_item_data in self.schedule_override_permissions: schedule_override_permissions_item: str = schedule_override_permissions_item_data schedule_override_permissions.append(schedule_override_permissions_item) - schedules_permissions: list[str] | Unset = UNSET + schedules_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.schedules_permissions, Unset): schedules_permissions = [] for schedules_permissions_item_data in self.schedules_permissions: schedules_permissions_item: str = schedules_permissions_item_data schedules_permissions.append(schedules_permissions_item) - services_permissions: list[str] | Unset = UNSET + services_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.services_permissions, Unset): services_permissions = [] for services_permissions_item_data in self.services_permissions: services_permissions_item: str = services_permissions_item_data services_permissions.append(services_permissions_item) - functionalities_permissions: list[str] | Unset = UNSET + functionalities_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.functionalities_permissions, Unset): functionalities_permissions = [] for functionalities_permissions_item_data in self.functionalities_permissions: functionalities_permissions_item: str = functionalities_permissions_item_data functionalities_permissions.append(functionalities_permissions_item) - webhooks_permissions: list[str] | Unset = UNSET + webhooks_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.webhooks_permissions, Unset): webhooks_permissions = [] for webhooks_permissions_item_data in self.webhooks_permissions: webhooks_permissions_item: str = webhooks_permissions_item_data webhooks_permissions.append(webhooks_permissions_item) - workflows_permissions: list[str] | Unset = UNSET + workflows_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.workflows_permissions, Unset): workflows_permissions = [] for workflows_permissions_item_data in self.workflows_permissions: workflows_permissions_item: str = workflows_permissions_item_data workflows_permissions.append(workflows_permissions_item) - catalogs_permissions: list[str] | Unset = UNSET + catalogs_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.catalogs_permissions, Unset): catalogs_permissions = [] for catalogs_permissions_item_data in self.catalogs_permissions: @@ -348,6 +366,8 @@ def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} field_dict.update({}) + if slug is not UNSET: + field_dict["slug"] = slug if name is not UNSET: field_dict["name"] = name if system_role is not UNSET: @@ -406,303 +426,250 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) + + def _parse_slug(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + slug = _parse_slug(d.pop("slug", UNSET)) + name = d.pop("name", UNSET) system_role = d.pop("system_role", UNSET) + alert_sources_permissions = [] _alert_sources_permissions = d.pop("alert_sources_permissions", UNSET) - alert_sources_permissions: list[UpdateOnCallRoleDataAttributesAlertSourcesPermissionsItem] | Unset = UNSET - if _alert_sources_permissions is not UNSET: - alert_sources_permissions = [] - for alert_sources_permissions_item_data in _alert_sources_permissions: - alert_sources_permissions_item = ( - check_update_on_call_role_data_attributes_alert_sources_permissions_item( - alert_sources_permissions_item_data - ) - ) + for alert_sources_permissions_item_data in _alert_sources_permissions or []: + alert_sources_permissions_item = check_update_on_call_role_data_attributes_alert_sources_permissions_item( + alert_sources_permissions_item_data + ) - alert_sources_permissions.append(alert_sources_permissions_item) + alert_sources_permissions.append(alert_sources_permissions_item) + alert_urgency_permissions = [] _alert_urgency_permissions = d.pop("alert_urgency_permissions", UNSET) - alert_urgency_permissions: list[UpdateOnCallRoleDataAttributesAlertUrgencyPermissionsItem] | Unset = UNSET - if _alert_urgency_permissions is not UNSET: - alert_urgency_permissions = [] - for alert_urgency_permissions_item_data in _alert_urgency_permissions: - alert_urgency_permissions_item = ( - check_update_on_call_role_data_attributes_alert_urgency_permissions_item( - alert_urgency_permissions_item_data - ) - ) + for alert_urgency_permissions_item_data in _alert_urgency_permissions or []: + alert_urgency_permissions_item = check_update_on_call_role_data_attributes_alert_urgency_permissions_item( + alert_urgency_permissions_item_data + ) - alert_urgency_permissions.append(alert_urgency_permissions_item) + alert_urgency_permissions.append(alert_urgency_permissions_item) + alert_fields_permissions = [] _alert_fields_permissions = d.pop("alert_fields_permissions", UNSET) - alert_fields_permissions: list[UpdateOnCallRoleDataAttributesAlertFieldsPermissionsItem] | Unset = UNSET - if _alert_fields_permissions is not UNSET: - alert_fields_permissions = [] - for alert_fields_permissions_item_data in _alert_fields_permissions: - alert_fields_permissions_item = check_update_on_call_role_data_attributes_alert_fields_permissions_item( - alert_fields_permissions_item_data - ) + for alert_fields_permissions_item_data in _alert_fields_permissions or []: + alert_fields_permissions_item = check_update_on_call_role_data_attributes_alert_fields_permissions_item( + alert_fields_permissions_item_data + ) - alert_fields_permissions.append(alert_fields_permissions_item) + alert_fields_permissions.append(alert_fields_permissions_item) + alert_groups_permissions = [] _alert_groups_permissions = d.pop("alert_groups_permissions", UNSET) - alert_groups_permissions: list[UpdateOnCallRoleDataAttributesAlertGroupsPermissionsItem] | Unset = UNSET - if _alert_groups_permissions is not UNSET: - alert_groups_permissions = [] - for alert_groups_permissions_item_data in _alert_groups_permissions: - alert_groups_permissions_item = check_update_on_call_role_data_attributes_alert_groups_permissions_item( - alert_groups_permissions_item_data - ) + for alert_groups_permissions_item_data in _alert_groups_permissions or []: + alert_groups_permissions_item = check_update_on_call_role_data_attributes_alert_groups_permissions_item( + alert_groups_permissions_item_data + ) - alert_groups_permissions.append(alert_groups_permissions_item) + alert_groups_permissions.append(alert_groups_permissions_item) + alert_routing_rules_permissions = [] _alert_routing_rules_permissions = d.pop("alert_routing_rules_permissions", UNSET) - alert_routing_rules_permissions: ( - list[UpdateOnCallRoleDataAttributesAlertRoutingRulesPermissionsItem] | Unset - ) = UNSET - if _alert_routing_rules_permissions is not UNSET: - alert_routing_rules_permissions = [] - for alert_routing_rules_permissions_item_data in _alert_routing_rules_permissions: - alert_routing_rules_permissions_item = ( - check_update_on_call_role_data_attributes_alert_routing_rules_permissions_item( - alert_routing_rules_permissions_item_data - ) + for alert_routing_rules_permissions_item_data in _alert_routing_rules_permissions or []: + alert_routing_rules_permissions_item = ( + check_update_on_call_role_data_attributes_alert_routing_rules_permissions_item( + alert_routing_rules_permissions_item_data ) + ) - alert_routing_rules_permissions.append(alert_routing_rules_permissions_item) + alert_routing_rules_permissions.append(alert_routing_rules_permissions_item) + on_call_readiness_report_permissions = [] _on_call_readiness_report_permissions = d.pop("on_call_readiness_report_permissions", UNSET) - on_call_readiness_report_permissions: ( - list[UpdateOnCallRoleDataAttributesOnCallReadinessReportPermissionsItem] | Unset - ) = UNSET - if _on_call_readiness_report_permissions is not UNSET: - on_call_readiness_report_permissions = [] - for on_call_readiness_report_permissions_item_data in _on_call_readiness_report_permissions: - on_call_readiness_report_permissions_item = ( - check_update_on_call_role_data_attributes_on_call_readiness_report_permissions_item( - on_call_readiness_report_permissions_item_data - ) + for on_call_readiness_report_permissions_item_data in _on_call_readiness_report_permissions or []: + on_call_readiness_report_permissions_item = ( + check_update_on_call_role_data_attributes_on_call_readiness_report_permissions_item( + on_call_readiness_report_permissions_item_data ) + ) - on_call_readiness_report_permissions.append(on_call_readiness_report_permissions_item) + on_call_readiness_report_permissions.append(on_call_readiness_report_permissions_item) + on_call_roles_permissions = [] _on_call_roles_permissions = d.pop("on_call_roles_permissions", UNSET) - on_call_roles_permissions: list[UpdateOnCallRoleDataAttributesOnCallRolesPermissionsItem] | Unset = UNSET - if _on_call_roles_permissions is not UNSET: - on_call_roles_permissions = [] - for on_call_roles_permissions_item_data in _on_call_roles_permissions: - on_call_roles_permissions_item = ( - check_update_on_call_role_data_attributes_on_call_roles_permissions_item( - on_call_roles_permissions_item_data - ) - ) + for on_call_roles_permissions_item_data in _on_call_roles_permissions or []: + on_call_roles_permissions_item = check_update_on_call_role_data_attributes_on_call_roles_permissions_item( + on_call_roles_permissions_item_data + ) - on_call_roles_permissions.append(on_call_roles_permissions_item) + on_call_roles_permissions.append(on_call_roles_permissions_item) + alerts_permissions = [] _alerts_permissions = d.pop("alerts_permissions", UNSET) - alerts_permissions: list[UpdateOnCallRoleDataAttributesAlertsPermissionsItem] | Unset = UNSET - if _alerts_permissions is not UNSET: - alerts_permissions = [] - for alerts_permissions_item_data in _alerts_permissions: - alerts_permissions_item = check_update_on_call_role_data_attributes_alerts_permissions_item( - alerts_permissions_item_data - ) + for alerts_permissions_item_data in _alerts_permissions or []: + alerts_permissions_item = check_update_on_call_role_data_attributes_alerts_permissions_item( + alerts_permissions_item_data + ) - alerts_permissions.append(alerts_permissions_item) + alerts_permissions.append(alerts_permissions_item) + api_keys_permissions = [] _api_keys_permissions = d.pop("api_keys_permissions", UNSET) - api_keys_permissions: list[UpdateOnCallRoleDataAttributesApiKeysPermissionsItem] | Unset = UNSET - if _api_keys_permissions is not UNSET: - api_keys_permissions = [] - for api_keys_permissions_item_data in _api_keys_permissions: - api_keys_permissions_item = check_update_on_call_role_data_attributes_api_keys_permissions_item( - api_keys_permissions_item_data - ) + for api_keys_permissions_item_data in _api_keys_permissions or []: + api_keys_permissions_item = check_update_on_call_role_data_attributes_api_keys_permissions_item( + api_keys_permissions_item_data + ) - api_keys_permissions.append(api_keys_permissions_item) + api_keys_permissions.append(api_keys_permissions_item) + audits_permissions = [] _audits_permissions = d.pop("audits_permissions", UNSET) - audits_permissions: list[UpdateOnCallRoleDataAttributesAuditsPermissionsItem] | Unset = UNSET - if _audits_permissions is not UNSET: - audits_permissions = [] - for audits_permissions_item_data in _audits_permissions: - audits_permissions_item = check_update_on_call_role_data_attributes_audits_permissions_item( - audits_permissions_item_data - ) + for audits_permissions_item_data in _audits_permissions or []: + audits_permissions_item = check_update_on_call_role_data_attributes_audits_permissions_item( + audits_permissions_item_data + ) - audits_permissions.append(audits_permissions_item) + audits_permissions.append(audits_permissions_item) + contacts_permissions = [] _contacts_permissions = d.pop("contacts_permissions", UNSET) - contacts_permissions: list[UpdateOnCallRoleDataAttributesContactsPermissionsItem] | Unset = UNSET - if _contacts_permissions is not UNSET: - contacts_permissions = [] - for contacts_permissions_item_data in _contacts_permissions: - contacts_permissions_item = check_update_on_call_role_data_attributes_contacts_permissions_item( - contacts_permissions_item_data - ) + for contacts_permissions_item_data in _contacts_permissions or []: + contacts_permissions_item = check_update_on_call_role_data_attributes_contacts_permissions_item( + contacts_permissions_item_data + ) - contacts_permissions.append(contacts_permissions_item) + contacts_permissions.append(contacts_permissions_item) + escalation_policies_permissions = [] _escalation_policies_permissions = d.pop("escalation_policies_permissions", UNSET) - escalation_policies_permissions: ( - list[UpdateOnCallRoleDataAttributesEscalationPoliciesPermissionsItem] | Unset - ) = UNSET - if _escalation_policies_permissions is not UNSET: - escalation_policies_permissions = [] - for escalation_policies_permissions_item_data in _escalation_policies_permissions: - escalation_policies_permissions_item = ( - check_update_on_call_role_data_attributes_escalation_policies_permissions_item( - escalation_policies_permissions_item_data - ) + for escalation_policies_permissions_item_data in _escalation_policies_permissions or []: + escalation_policies_permissions_item = ( + check_update_on_call_role_data_attributes_escalation_policies_permissions_item( + escalation_policies_permissions_item_data ) + ) - escalation_policies_permissions.append(escalation_policies_permissions_item) + escalation_policies_permissions.append(escalation_policies_permissions_item) + groups_permissions = [] _groups_permissions = d.pop("groups_permissions", UNSET) - groups_permissions: list[UpdateOnCallRoleDataAttributesGroupsPermissionsItem] | Unset = UNSET - if _groups_permissions is not UNSET: - groups_permissions = [] - for groups_permissions_item_data in _groups_permissions: - groups_permissions_item = check_update_on_call_role_data_attributes_groups_permissions_item( - groups_permissions_item_data - ) + for groups_permissions_item_data in _groups_permissions or []: + groups_permissions_item = check_update_on_call_role_data_attributes_groups_permissions_item( + groups_permissions_item_data + ) - groups_permissions.append(groups_permissions_item) + groups_permissions.append(groups_permissions_item) + heartbeats_permissions = [] _heartbeats_permissions = d.pop("heartbeats_permissions", UNSET) - heartbeats_permissions: list[UpdateOnCallRoleDataAttributesHeartbeatsPermissionsItem] | Unset = UNSET - if _heartbeats_permissions is not UNSET: - heartbeats_permissions = [] - for heartbeats_permissions_item_data in _heartbeats_permissions: - heartbeats_permissions_item = check_update_on_call_role_data_attributes_heartbeats_permissions_item( - heartbeats_permissions_item_data - ) + for heartbeats_permissions_item_data in _heartbeats_permissions or []: + heartbeats_permissions_item = check_update_on_call_role_data_attributes_heartbeats_permissions_item( + heartbeats_permissions_item_data + ) - heartbeats_permissions.append(heartbeats_permissions_item) + heartbeats_permissions.append(heartbeats_permissions_item) + integrations_permissions = [] _integrations_permissions = d.pop("integrations_permissions", UNSET) - integrations_permissions: list[UpdateOnCallRoleDataAttributesIntegrationsPermissionsItem] | Unset = UNSET - if _integrations_permissions is not UNSET: - integrations_permissions = [] - for integrations_permissions_item_data in _integrations_permissions: - integrations_permissions_item = check_update_on_call_role_data_attributes_integrations_permissions_item( - integrations_permissions_item_data - ) + for integrations_permissions_item_data in _integrations_permissions or []: + integrations_permissions_item = check_update_on_call_role_data_attributes_integrations_permissions_item( + integrations_permissions_item_data + ) - integrations_permissions.append(integrations_permissions_item) + integrations_permissions.append(integrations_permissions_item) + invitations_permissions = [] _invitations_permissions = d.pop("invitations_permissions", UNSET) - invitations_permissions: list[UpdateOnCallRoleDataAttributesInvitationsPermissionsItem] | Unset = UNSET - if _invitations_permissions is not UNSET: - invitations_permissions = [] - for invitations_permissions_item_data in _invitations_permissions: - invitations_permissions_item = check_update_on_call_role_data_attributes_invitations_permissions_item( - invitations_permissions_item_data - ) + for invitations_permissions_item_data in _invitations_permissions or []: + invitations_permissions_item = check_update_on_call_role_data_attributes_invitations_permissions_item( + invitations_permissions_item_data + ) - invitations_permissions.append(invitations_permissions_item) + invitations_permissions.append(invitations_permissions_item) + live_call_routing_permissions = [] _live_call_routing_permissions = d.pop("live_call_routing_permissions", UNSET) - live_call_routing_permissions: list[UpdateOnCallRoleDataAttributesLiveCallRoutingPermissionsItem] | Unset = ( - UNSET - ) - if _live_call_routing_permissions is not UNSET: - live_call_routing_permissions = [] - for live_call_routing_permissions_item_data in _live_call_routing_permissions: - live_call_routing_permissions_item = ( - check_update_on_call_role_data_attributes_live_call_routing_permissions_item( - live_call_routing_permissions_item_data - ) + for live_call_routing_permissions_item_data in _live_call_routing_permissions or []: + live_call_routing_permissions_item = ( + check_update_on_call_role_data_attributes_live_call_routing_permissions_item( + live_call_routing_permissions_item_data ) + ) - live_call_routing_permissions.append(live_call_routing_permissions_item) + live_call_routing_permissions.append(live_call_routing_permissions_item) + schedule_override_permissions = [] _schedule_override_permissions = d.pop("schedule_override_permissions", UNSET) - schedule_override_permissions: list[UpdateOnCallRoleDataAttributesScheduleOverridePermissionsItem] | Unset = ( - UNSET - ) - if _schedule_override_permissions is not UNSET: - schedule_override_permissions = [] - for schedule_override_permissions_item_data in _schedule_override_permissions: - schedule_override_permissions_item = ( - check_update_on_call_role_data_attributes_schedule_override_permissions_item( - schedule_override_permissions_item_data - ) + for schedule_override_permissions_item_data in _schedule_override_permissions or []: + schedule_override_permissions_item = ( + check_update_on_call_role_data_attributes_schedule_override_permissions_item( + schedule_override_permissions_item_data ) + ) - schedule_override_permissions.append(schedule_override_permissions_item) + schedule_override_permissions.append(schedule_override_permissions_item) + schedules_permissions = [] _schedules_permissions = d.pop("schedules_permissions", UNSET) - schedules_permissions: list[UpdateOnCallRoleDataAttributesSchedulesPermissionsItem] | Unset = UNSET - if _schedules_permissions is not UNSET: - schedules_permissions = [] - for schedules_permissions_item_data in _schedules_permissions: - schedules_permissions_item = check_update_on_call_role_data_attributes_schedules_permissions_item( - schedules_permissions_item_data - ) + for schedules_permissions_item_data in _schedules_permissions or []: + schedules_permissions_item = check_update_on_call_role_data_attributes_schedules_permissions_item( + schedules_permissions_item_data + ) - schedules_permissions.append(schedules_permissions_item) + schedules_permissions.append(schedules_permissions_item) + services_permissions = [] _services_permissions = d.pop("services_permissions", UNSET) - services_permissions: list[UpdateOnCallRoleDataAttributesServicesPermissionsItem] | Unset = UNSET - if _services_permissions is not UNSET: - services_permissions = [] - for services_permissions_item_data in _services_permissions: - services_permissions_item = check_update_on_call_role_data_attributes_services_permissions_item( - services_permissions_item_data - ) + for services_permissions_item_data in _services_permissions or []: + services_permissions_item = check_update_on_call_role_data_attributes_services_permissions_item( + services_permissions_item_data + ) - services_permissions.append(services_permissions_item) + services_permissions.append(services_permissions_item) + functionalities_permissions = [] _functionalities_permissions = d.pop("functionalities_permissions", UNSET) - functionalities_permissions: list[UpdateOnCallRoleDataAttributesFunctionalitiesPermissionsItem] | Unset = UNSET - if _functionalities_permissions is not UNSET: - functionalities_permissions = [] - for functionalities_permissions_item_data in _functionalities_permissions: - functionalities_permissions_item = ( - check_update_on_call_role_data_attributes_functionalities_permissions_item( - functionalities_permissions_item_data - ) + for functionalities_permissions_item_data in _functionalities_permissions or []: + functionalities_permissions_item = ( + check_update_on_call_role_data_attributes_functionalities_permissions_item( + functionalities_permissions_item_data ) + ) - functionalities_permissions.append(functionalities_permissions_item) + functionalities_permissions.append(functionalities_permissions_item) + webhooks_permissions = [] _webhooks_permissions = d.pop("webhooks_permissions", UNSET) - webhooks_permissions: list[UpdateOnCallRoleDataAttributesWebhooksPermissionsItem] | Unset = UNSET - if _webhooks_permissions is not UNSET: - webhooks_permissions = [] - for webhooks_permissions_item_data in _webhooks_permissions: - webhooks_permissions_item = check_update_on_call_role_data_attributes_webhooks_permissions_item( - webhooks_permissions_item_data - ) + for webhooks_permissions_item_data in _webhooks_permissions or []: + webhooks_permissions_item = check_update_on_call_role_data_attributes_webhooks_permissions_item( + webhooks_permissions_item_data + ) - webhooks_permissions.append(webhooks_permissions_item) + webhooks_permissions.append(webhooks_permissions_item) + workflows_permissions = [] _workflows_permissions = d.pop("workflows_permissions", UNSET) - workflows_permissions: list[UpdateOnCallRoleDataAttributesWorkflowsPermissionsItem] | Unset = UNSET - if _workflows_permissions is not UNSET: - workflows_permissions = [] - for workflows_permissions_item_data in _workflows_permissions: - workflows_permissions_item = check_update_on_call_role_data_attributes_workflows_permissions_item( - workflows_permissions_item_data - ) + for workflows_permissions_item_data in _workflows_permissions or []: + workflows_permissions_item = check_update_on_call_role_data_attributes_workflows_permissions_item( + workflows_permissions_item_data + ) - workflows_permissions.append(workflows_permissions_item) + workflows_permissions.append(workflows_permissions_item) + catalogs_permissions = [] _catalogs_permissions = d.pop("catalogs_permissions", UNSET) - catalogs_permissions: list[UpdateOnCallRoleDataAttributesCatalogsPermissionsItem] | Unset = UNSET - if _catalogs_permissions is not UNSET: - catalogs_permissions = [] - for catalogs_permissions_item_data in _catalogs_permissions: - catalogs_permissions_item = check_update_on_call_role_data_attributes_catalogs_permissions_item( - catalogs_permissions_item_data - ) + for catalogs_permissions_item_data in _catalogs_permissions or []: + catalogs_permissions_item = check_update_on_call_role_data_attributes_catalogs_permissions_item( + catalogs_permissions_item_data + ) - catalogs_permissions.append(catalogs_permissions_item) + catalogs_permissions.append(catalogs_permissions_item) update_on_call_role_data_attributes = cls( + slug=slug, name=name, system_role=system_role, alert_sources_permissions=alert_sources_permissions, diff --git a/rootly_sdk/models/update_on_call_shadow.py b/rootly_sdk/models/update_on_call_shadow.py index 1c41656b..08575554 100644 --- a/rootly_sdk/models/update_on_call_shadow.py +++ b/rootly_sdk/models/update_on_call_shadow.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateOnCallShadow: data (UpdateOnCallShadowData): """ - data: UpdateOnCallShadowData + data: "UpdateOnCallShadowData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_on_call_shadow_data.py b/rootly_sdk/models/update_on_call_shadow_data.py index b7feab90..a31c2b12 100644 --- a/rootly_sdk/models/update_on_call_shadow_data.py +++ b/rootly_sdk/models/update_on_call_shadow_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class UpdateOnCallShadowData: """ type_: UpdateOnCallShadowDataType - attributes: UpdateOnCallShadowDataAttributes + attributes: "UpdateOnCallShadowDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_on_call_shadow_data_attributes.py b/rootly_sdk/models/update_on_call_shadow_data_attributes.py index 82161c38..b807bf35 100644 --- a/rootly_sdk/models/update_on_call_shadow_data_attributes.py +++ b/rootly_sdk/models/update_on_call_shadow_data_attributes.py @@ -1,8 +1,6 @@ -from __future__ import annotations - import datetime from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from dateutil.parser import isoparse @@ -20,25 +18,25 @@ class UpdateOnCallShadowDataAttributes: """ Attributes: - schedule_id (str | Unset): ID of schedule the shadow shift belongs to - shadowable_type (UpdateOnCallShadowDataAttributesShadowableType | Unset): - shadowable_id (str | Unset): ID of schedule or user the shadow user is shadowing - shadow_user_id (int | Unset): Which user the shadow shift belongs to. - starts_at (datetime.datetime | Unset): Start datetime of shadow shift - ends_at (datetime.datetime | Unset): End datetime for shadow shift + schedule_id (Union[Unset, str]): ID of schedule the shadow shift belongs to + shadowable_type (Union[Unset, UpdateOnCallShadowDataAttributesShadowableType]): + shadowable_id (Union[Unset, str]): ID of schedule or user the shadow user is shadowing + shadow_user_id (Union[Unset, int]): Which user the shadow shift belongs to. + starts_at (Union[Unset, datetime.datetime]): Start datetime of shadow shift + ends_at (Union[Unset, datetime.datetime]): End datetime for shadow shift """ - schedule_id: str | Unset = UNSET - shadowable_type: UpdateOnCallShadowDataAttributesShadowableType | Unset = UNSET - shadowable_id: str | Unset = UNSET - shadow_user_id: int | Unset = UNSET - starts_at: datetime.datetime | Unset = UNSET - ends_at: datetime.datetime | Unset = UNSET + schedule_id: Union[Unset, str] = UNSET + shadowable_type: Union[Unset, UpdateOnCallShadowDataAttributesShadowableType] = UNSET + shadowable_id: Union[Unset, str] = UNSET + shadow_user_id: Union[Unset, int] = UNSET + starts_at: Union[Unset, datetime.datetime] = UNSET + ends_at: Union[Unset, datetime.datetime] = UNSET def to_dict(self) -> dict[str, Any]: schedule_id = self.schedule_id - shadowable_type: str | Unset = UNSET + shadowable_type: Union[Unset, str] = UNSET if not isinstance(self.shadowable_type, Unset): shadowable_type = self.shadowable_type @@ -46,11 +44,11 @@ def to_dict(self) -> dict[str, Any]: shadow_user_id = self.shadow_user_id - starts_at: str | Unset = UNSET + starts_at: Union[Unset, str] = UNSET if not isinstance(self.starts_at, Unset): starts_at = self.starts_at.isoformat() - ends_at: str | Unset = UNSET + ends_at: Union[Unset, str] = UNSET if not isinstance(self.ends_at, Unset): ends_at = self.ends_at.isoformat() @@ -78,7 +76,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: schedule_id = d.pop("schedule_id", UNSET) _shadowable_type = d.pop("shadowable_type", UNSET) - shadowable_type: UpdateOnCallShadowDataAttributesShadowableType | Unset + shadowable_type: Union[Unset, UpdateOnCallShadowDataAttributesShadowableType] if isinstance(_shadowable_type, Unset): shadowable_type = UNSET else: @@ -89,14 +87,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: shadow_user_id = d.pop("shadow_user_id", UNSET) _starts_at = d.pop("starts_at", UNSET) - starts_at: datetime.datetime | Unset + starts_at: Union[Unset, datetime.datetime] if isinstance(_starts_at, Unset): starts_at = UNSET else: starts_at = isoparse(_starts_at) _ends_at = d.pop("ends_at", UNSET) - ends_at: datetime.datetime | Unset + ends_at: Union[Unset, datetime.datetime] if isinstance(_ends_at, Unset): ends_at = UNSET else: diff --git a/rootly_sdk/models/update_opsgenie_alert_task_params.py b/rootly_sdk/models/update_opsgenie_alert_task_params.py index 729d24ad..f25161bd 100644 --- a/rootly_sdk/models/update_opsgenie_alert_task_params.py +++ b/rootly_sdk/models/update_opsgenie_alert_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -30,29 +28,28 @@ class UpdateOpsgenieAlertTaskParams: alert_id (str): Opsgenie Alert ID priority (UpdateOpsgenieAlertTaskParamsPriority): completion (UpdateOpsgenieAlertTaskParamsCompletion): - task_type (UpdateOpsgenieAlertTaskParamsTaskType | Unset): - message (str | Unset): Message of the alert - description (str | Unset): Description field of the alert that is generally used to provide a detailed + task_type (Union[Unset, UpdateOpsgenieAlertTaskParamsTaskType]): + message (Union[Unset, str]): Message of the alert + description (Union[Unset, str]): Description field of the alert that is generally used to provide a detailed information about the alert """ alert_id: str priority: UpdateOpsgenieAlertTaskParamsPriority - completion: UpdateOpsgenieAlertTaskParamsCompletion - task_type: UpdateOpsgenieAlertTaskParamsTaskType | Unset = UNSET - message: str | Unset = UNSET - description: str | Unset = UNSET + completion: "UpdateOpsgenieAlertTaskParamsCompletion" + task_type: Union[Unset, UpdateOpsgenieAlertTaskParamsTaskType] = UNSET + message: Union[Unset, str] = UNSET + description: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - alert_id = self.alert_id priority: str = self.priority completion = self.completion.to_dict() - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -90,7 +87,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: completion = UpdateOpsgenieAlertTaskParamsCompletion.from_dict(d.pop("completion")) _task_type = d.pop("task_type", UNSET) - task_type: UpdateOpsgenieAlertTaskParamsTaskType | Unset + task_type: Union[Unset, UpdateOpsgenieAlertTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/update_opsgenie_alert_task_params_completion.py b/rootly_sdk/models/update_opsgenie_alert_task_params_completion.py index f1933281..519aef27 100644 --- a/rootly_sdk/models/update_opsgenie_alert_task_params_completion.py +++ b/rootly_sdk/models/update_opsgenie_alert_task_params_completion.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class UpdateOpsgenieAlertTaskParamsCompletion: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_opsgenie_incident_task_params.py b/rootly_sdk/models/update_opsgenie_incident_task_params.py index 46b0c6ef..7e3aa3b8 100644 --- a/rootly_sdk/models/update_opsgenie_incident_task_params.py +++ b/rootly_sdk/models/update_opsgenie_incident_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,26 +27,26 @@ class UpdateOpsgenieIncidentTaskParams: Attributes: opsgenie_incident_id (str): The Opsgenie incident ID, this can also be a Rootly incident variable ex. {{ incident.opsgenie_incident_id }} - task_type (UpdateOpsgenieIncidentTaskParamsTaskType | Unset): - message (str | Unset): Message of the alert - description (str | Unset): Description field of the alert that is generally used to provide a detailed + task_type (Union[Unset, UpdateOpsgenieIncidentTaskParamsTaskType]): + message (Union[Unset, str]): Message of the alert + description (Union[Unset, str]): Description field of the alert that is generally used to provide a detailed information about the alert - status (UpdateOpsgenieIncidentTaskParamsStatus | Unset): - priority (UpdateOpsgenieIncidentTaskParamsPriority | Unset): + status (Union[Unset, UpdateOpsgenieIncidentTaskParamsStatus]): + priority (Union[Unset, UpdateOpsgenieIncidentTaskParamsPriority]): """ opsgenie_incident_id: str - task_type: UpdateOpsgenieIncidentTaskParamsTaskType | Unset = UNSET - message: str | Unset = UNSET - description: str | Unset = UNSET - status: UpdateOpsgenieIncidentTaskParamsStatus | Unset = UNSET - priority: UpdateOpsgenieIncidentTaskParamsPriority | Unset = UNSET + task_type: Union[Unset, UpdateOpsgenieIncidentTaskParamsTaskType] = UNSET + message: Union[Unset, str] = UNSET + description: Union[Unset, str] = UNSET + status: Union[Unset, UpdateOpsgenieIncidentTaskParamsStatus] = UNSET + priority: Union[Unset, UpdateOpsgenieIncidentTaskParamsPriority] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: opsgenie_incident_id = self.opsgenie_incident_id - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -56,11 +54,11 @@ def to_dict(self) -> dict[str, Any]: description = self.description - status: str | Unset = UNSET + status: Union[Unset, str] = UNSET if not isinstance(self.status, Unset): status = self.status - priority: str | Unset = UNSET + priority: Union[Unset, str] = UNSET if not isinstance(self.priority, Unset): priority = self.priority @@ -90,7 +88,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: opsgenie_incident_id = d.pop("opsgenie_incident_id") _task_type = d.pop("task_type", UNSET) - task_type: UpdateOpsgenieIncidentTaskParamsTaskType | Unset + task_type: Union[Unset, UpdateOpsgenieIncidentTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: @@ -101,14 +99,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: description = d.pop("description", UNSET) _status = d.pop("status", UNSET) - status: UpdateOpsgenieIncidentTaskParamsStatus | Unset + status: Union[Unset, UpdateOpsgenieIncidentTaskParamsStatus] if isinstance(_status, Unset): status = UNSET else: status = check_update_opsgenie_incident_task_params_status(_status) _priority = d.pop("priority", UNSET) - priority: UpdateOpsgenieIncidentTaskParamsPriority | Unset + priority: Union[Unset, UpdateOpsgenieIncidentTaskParamsPriority] if isinstance(_priority, Unset): priority = UNSET else: diff --git a/rootly_sdk/models/update_override_shift.py b/rootly_sdk/models/update_override_shift.py index 236cf914..5ea83e20 100644 --- a/rootly_sdk/models/update_override_shift.py +++ b/rootly_sdk/models/update_override_shift.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateOverrideShift: data (UpdateOverrideShiftData): """ - data: UpdateOverrideShiftData + data: "UpdateOverrideShiftData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_override_shift_data.py b/rootly_sdk/models/update_override_shift_data.py index e44a0bd4..e3af4213 100644 --- a/rootly_sdk/models/update_override_shift_data.py +++ b/rootly_sdk/models/update_override_shift_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class UpdateOverrideShiftData: """ type_: UpdateOverrideShiftDataType - attributes: UpdateOverrideShiftDataAttributes + attributes: "UpdateOverrideShiftDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_override_shift_data_attributes.py b/rootly_sdk/models/update_override_shift_data_attributes.py index 2a34c48e..2e7cc8df 100644 --- a/rootly_sdk/models/update_override_shift_data_attributes.py +++ b/rootly_sdk/models/update_override_shift_data_attributes.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/update_pagerduty_incident_task_params.py b/rootly_sdk/models/update_pagerduty_incident_task_params.py index 3020e135..b7bfb25a 100644 --- a/rootly_sdk/models/update_pagerduty_incident_task_params.py +++ b/rootly_sdk/models/update_pagerduty_incident_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -28,37 +26,37 @@ class UpdatePagerdutyIncidentTaskParams: """ Attributes: pagerduty_incident_id (str): Pagerduty incident id - task_type (UpdatePagerdutyIncidentTaskParamsTaskType | Unset): - title (str | Unset): Title to update to - status (UpdatePagerdutyIncidentTaskParamsStatus | Unset): - resolution (str | Unset): A message outlining the incident's resolution in PagerDuty - escalation_level (int | Unset): Escalation level of policy attached to incident Example: 1. - urgency (UpdatePagerdutyIncidentTaskParamsUrgency | Unset): PagerDuty incident urgency, selecting auto will let - Rootly auto map our incident severity - priority (str | Unset): PagerDuty incident priority, selecting auto will let Rootly auto map our incident + task_type (Union[Unset, UpdatePagerdutyIncidentTaskParamsTaskType]): + title (Union[Unset, str]): Title to update to + status (Union[Unset, UpdatePagerdutyIncidentTaskParamsStatus]): + resolution (Union[Unset, str]): A message outlining the incident's resolution in PagerDuty + escalation_level (Union[Unset, int]): Escalation level of policy attached to incident Example: 1. + urgency (Union[Unset, UpdatePagerdutyIncidentTaskParamsUrgency]): PagerDuty incident urgency, selecting auto + will let Rootly auto map our incident severity + priority (Union[Unset, str]): PagerDuty incident priority, selecting auto will let Rootly auto map our incident severity """ pagerduty_incident_id: str - task_type: UpdatePagerdutyIncidentTaskParamsTaskType | Unset = UNSET - title: str | Unset = UNSET - status: UpdatePagerdutyIncidentTaskParamsStatus | Unset = UNSET - resolution: str | Unset = UNSET - escalation_level: int | Unset = UNSET - urgency: UpdatePagerdutyIncidentTaskParamsUrgency | Unset = UNSET - priority: str | Unset = UNSET + task_type: Union[Unset, UpdatePagerdutyIncidentTaskParamsTaskType] = UNSET + title: Union[Unset, str] = UNSET + status: Union[Unset, UpdatePagerdutyIncidentTaskParamsStatus] = UNSET + resolution: Union[Unset, str] = UNSET + escalation_level: Union[Unset, int] = UNSET + urgency: Union[Unset, UpdatePagerdutyIncidentTaskParamsUrgency] = UNSET + priority: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: pagerduty_incident_id = self.pagerduty_incident_id - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type title = self.title - status: str | Unset = UNSET + status: Union[Unset, str] = UNSET if not isinstance(self.status, Unset): status = self.status @@ -66,7 +64,7 @@ def to_dict(self) -> dict[str, Any]: escalation_level = self.escalation_level - urgency: str | Unset = UNSET + urgency: Union[Unset, str] = UNSET if not isinstance(self.urgency, Unset): urgency = self.urgency @@ -102,7 +100,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: pagerduty_incident_id = d.pop("pagerduty_incident_id") _task_type = d.pop("task_type", UNSET) - task_type: UpdatePagerdutyIncidentTaskParamsTaskType | Unset + task_type: Union[Unset, UpdatePagerdutyIncidentTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: @@ -111,7 +109,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: title = d.pop("title", UNSET) _status = d.pop("status", UNSET) - status: UpdatePagerdutyIncidentTaskParamsStatus | Unset + status: Union[Unset, UpdatePagerdutyIncidentTaskParamsStatus] if isinstance(_status, Unset): status = UNSET else: @@ -122,7 +120,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: escalation_level = d.pop("escalation_level", UNSET) _urgency = d.pop("urgency", UNSET) - urgency: UpdatePagerdutyIncidentTaskParamsUrgency | Unset + urgency: Union[Unset, UpdatePagerdutyIncidentTaskParamsUrgency] if isinstance(_urgency, Unset): urgency = UNSET else: diff --git a/rootly_sdk/models/update_pagertree_alert_task_params.py b/rootly_sdk/models/update_pagertree_alert_task_params.py index 6b7cebfb..ca5430ba 100644 --- a/rootly_sdk/models/update_pagertree_alert_task_params.py +++ b/rootly_sdk/models/update_pagertree_alert_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -32,31 +30,30 @@ class UpdatePagertreeAlertTaskParams: """ Attributes: - task_type (UpdatePagertreeAlertTaskParamsTaskType | Unset): - pagertree_alert_id (str | Unset): The prefix ID of the Pagertree alert - title (str | Unset): Title of alert as text - description (str | Unset): Description of alert as text - urgency (UpdatePagertreeAlertTaskParamsUrgency | Unset): - severity (UpdatePagertreeAlertTaskParamsSeverity | Unset): - teams (list[UpdatePagertreeAlertTaskParamsTeamsItem] | Unset): - users (list[UpdatePagertreeAlertTaskParamsUsersItem] | Unset): - incident (bool | Unset): Setting to true makes an alert a Pagertree incident + task_type (Union[Unset, UpdatePagertreeAlertTaskParamsTaskType]): + pagertree_alert_id (Union[Unset, str]): The prefix ID of the Pagertree alert + title (Union[Unset, str]): Title of alert as text + description (Union[Unset, str]): Description of alert as text + urgency (Union[Unset, UpdatePagertreeAlertTaskParamsUrgency]): + severity (Union[Unset, UpdatePagertreeAlertTaskParamsSeverity]): + teams (Union[Unset, list['UpdatePagertreeAlertTaskParamsTeamsItem']]): + users (Union[Unset, list['UpdatePagertreeAlertTaskParamsUsersItem']]): + incident (Union[Unset, bool]): Setting to true makes an alert a Pagertree incident """ - task_type: UpdatePagertreeAlertTaskParamsTaskType | Unset = UNSET - pagertree_alert_id: str | Unset = UNSET - title: str | Unset = UNSET - description: str | Unset = UNSET - urgency: UpdatePagertreeAlertTaskParamsUrgency | Unset = UNSET - severity: UpdatePagertreeAlertTaskParamsSeverity | Unset = UNSET - teams: list[UpdatePagertreeAlertTaskParamsTeamsItem] | Unset = UNSET - users: list[UpdatePagertreeAlertTaskParamsUsersItem] | Unset = UNSET - incident: bool | Unset = UNSET + task_type: Union[Unset, UpdatePagertreeAlertTaskParamsTaskType] = UNSET + pagertree_alert_id: Union[Unset, str] = UNSET + title: Union[Unset, str] = UNSET + description: Union[Unset, str] = UNSET + urgency: Union[Unset, UpdatePagertreeAlertTaskParamsUrgency] = UNSET + severity: Union[Unset, UpdatePagertreeAlertTaskParamsSeverity] = UNSET + teams: Union[Unset, list["UpdatePagertreeAlertTaskParamsTeamsItem"]] = UNSET + users: Union[Unset, list["UpdatePagertreeAlertTaskParamsUsersItem"]] = UNSET + incident: Union[Unset, bool] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -66,22 +63,22 @@ def to_dict(self) -> dict[str, Any]: description = self.description - urgency: str | Unset = UNSET + urgency: Union[Unset, str] = UNSET if not isinstance(self.urgency, Unset): urgency = self.urgency - severity: str | Unset = UNSET + severity: Union[Unset, str] = UNSET if not isinstance(self.severity, Unset): severity = self.severity - teams: list[dict[str, Any]] | Unset = UNSET + teams: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.teams, Unset): teams = [] for teams_item_data in self.teams: teams_item = teams_item_data.to_dict() teams.append(teams_item) - users: list[dict[str, Any]] | Unset = UNSET + users: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.users, Unset): users = [] for users_item_data in self.users: @@ -121,7 +118,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _task_type = d.pop("task_type", UNSET) - task_type: UpdatePagertreeAlertTaskParamsTaskType | Unset + task_type: Union[Unset, UpdatePagertreeAlertTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: @@ -134,36 +131,32 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: description = d.pop("description", UNSET) _urgency = d.pop("urgency", UNSET) - urgency: UpdatePagertreeAlertTaskParamsUrgency | Unset + urgency: Union[Unset, UpdatePagertreeAlertTaskParamsUrgency] if isinstance(_urgency, Unset): urgency = UNSET else: urgency = check_update_pagertree_alert_task_params_urgency(_urgency) _severity = d.pop("severity", UNSET) - severity: UpdatePagertreeAlertTaskParamsSeverity | Unset + severity: Union[Unset, UpdatePagertreeAlertTaskParamsSeverity] if isinstance(_severity, Unset): severity = UNSET else: severity = check_update_pagertree_alert_task_params_severity(_severity) + teams = [] _teams = d.pop("teams", UNSET) - teams: list[UpdatePagertreeAlertTaskParamsTeamsItem] | Unset = UNSET - if _teams is not UNSET: - teams = [] - for teams_item_data in _teams: - teams_item = UpdatePagertreeAlertTaskParamsTeamsItem.from_dict(teams_item_data) + for teams_item_data in _teams or []: + teams_item = UpdatePagertreeAlertTaskParamsTeamsItem.from_dict(teams_item_data) - teams.append(teams_item) + teams.append(teams_item) + users = [] _users = d.pop("users", UNSET) - users: list[UpdatePagertreeAlertTaskParamsUsersItem] | Unset = UNSET - if _users is not UNSET: - users = [] - for users_item_data in _users: - users_item = UpdatePagertreeAlertTaskParamsUsersItem.from_dict(users_item_data) + for users_item_data in _users or []: + users_item = UpdatePagertreeAlertTaskParamsUsersItem.from_dict(users_item_data) - users.append(users_item) + users.append(users_item) incident = d.pop("incident", UNSET) diff --git a/rootly_sdk/models/update_pagertree_alert_task_params_teams_item.py b/rootly_sdk/models/update_pagertree_alert_task_params_teams_item.py index 6bd86d6a..67af10df 100644 --- a/rootly_sdk/models/update_pagertree_alert_task_params_teams_item.py +++ b/rootly_sdk/models/update_pagertree_alert_task_params_teams_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class UpdatePagertreeAlertTaskParamsTeamsItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_pagertree_alert_task_params_users_item.py b/rootly_sdk/models/update_pagertree_alert_task_params_users_item.py index 8f9a0105..dcd684b6 100644 --- a/rootly_sdk/models/update_pagertree_alert_task_params_users_item.py +++ b/rootly_sdk/models/update_pagertree_alert_task_params_users_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class UpdatePagertreeAlertTaskParamsUsersItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_playbook.py b/rootly_sdk/models/update_playbook.py index acd968f6..3155be8a 100644 --- a/rootly_sdk/models/update_playbook.py +++ b/rootly_sdk/models/update_playbook.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdatePlaybook: data (UpdatePlaybookData): """ - data: UpdatePlaybookData + data: "UpdatePlaybookData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_playbook_data.py b/rootly_sdk/models/update_playbook_data.py index 9bd1cc08..55556936 100644 --- a/rootly_sdk/models/update_playbook_data.py +++ b/rootly_sdk/models/update_playbook_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class UpdatePlaybookData: """ type_: UpdatePlaybookDataType - attributes: UpdatePlaybookDataAttributes + attributes: "UpdatePlaybookDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_playbook_data_attributes.py b/rootly_sdk/models/update_playbook_data_attributes.py index c98736b1..a44192cc 100644 --- a/rootly_sdk/models/update_playbook_data_attributes.py +++ b/rootly_sdk/models/update_playbook_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -14,43 +12,43 @@ class UpdatePlaybookDataAttributes: """ Attributes: - title (str | Unset): The title of the playbook - summary (None | str | Unset): The summary of the playbook - external_url (None | str | Unset): The external url of the playbook - severity_ids (list[str] | None | Unset): The Severity IDs to attach to the incident - environment_ids (list[str] | None | Unset): The Environment IDs to attach to the incident - service_ids (list[str] | None | Unset): The Service IDs to attach to the incident - functionality_ids (list[str] | None | Unset): The Functionality IDs to attach to the incident - group_ids (list[str] | None | Unset): The Team IDs to attach to the incident - incident_type_ids (list[str] | None | Unset): The Incident Type IDs to attach to the incident + title (Union[Unset, str]): The title of the playbook + summary (Union[None, Unset, str]): The summary of the playbook + external_url (Union[None, Unset, str]): The external url of the playbook + severity_ids (Union[None, Unset, list[str]]): The Severity IDs to attach to the incident + environment_ids (Union[None, Unset, list[str]]): The Environment IDs to attach to the incident + service_ids (Union[None, Unset, list[str]]): The Service IDs to attach to the incident + functionality_ids (Union[None, Unset, list[str]]): The Functionality IDs to attach to the incident + group_ids (Union[None, Unset, list[str]]): The Team IDs to attach to the incident + incident_type_ids (Union[None, Unset, list[str]]): The Incident Type IDs to attach to the incident """ - title: str | Unset = UNSET - summary: None | str | Unset = UNSET - external_url: None | str | Unset = UNSET - severity_ids: list[str] | None | Unset = UNSET - environment_ids: list[str] | None | Unset = UNSET - service_ids: list[str] | None | Unset = UNSET - functionality_ids: list[str] | None | Unset = UNSET - group_ids: list[str] | None | Unset = UNSET - incident_type_ids: list[str] | None | Unset = UNSET + title: Union[Unset, str] = UNSET + summary: Union[None, Unset, str] = UNSET + external_url: Union[None, Unset, str] = UNSET + severity_ids: Union[None, Unset, list[str]] = UNSET + environment_ids: Union[None, Unset, list[str]] = UNSET + service_ids: Union[None, Unset, list[str]] = UNSET + functionality_ids: Union[None, Unset, list[str]] = UNSET + group_ids: Union[None, Unset, list[str]] = UNSET + incident_type_ids: Union[None, Unset, list[str]] = UNSET def to_dict(self) -> dict[str, Any]: title = self.title - summary: None | str | Unset + summary: Union[None, Unset, str] if isinstance(self.summary, Unset): summary = UNSET else: summary = self.summary - external_url: None | str | Unset + external_url: Union[None, Unset, str] if isinstance(self.external_url, Unset): external_url = UNSET else: external_url = self.external_url - severity_ids: list[str] | None | Unset + severity_ids: Union[None, Unset, list[str]] if isinstance(self.severity_ids, Unset): severity_ids = UNSET elif isinstance(self.severity_ids, list): @@ -59,7 +57,7 @@ def to_dict(self) -> dict[str, Any]: else: severity_ids = self.severity_ids - environment_ids: list[str] | None | Unset + environment_ids: Union[None, Unset, list[str]] if isinstance(self.environment_ids, Unset): environment_ids = UNSET elif isinstance(self.environment_ids, list): @@ -68,7 +66,7 @@ def to_dict(self) -> dict[str, Any]: else: environment_ids = self.environment_ids - service_ids: list[str] | None | Unset + service_ids: Union[None, Unset, list[str]] if isinstance(self.service_ids, Unset): service_ids = UNSET elif isinstance(self.service_ids, list): @@ -77,7 +75,7 @@ def to_dict(self) -> dict[str, Any]: else: service_ids = self.service_ids - functionality_ids: list[str] | None | Unset + functionality_ids: Union[None, Unset, list[str]] if isinstance(self.functionality_ids, Unset): functionality_ids = UNSET elif isinstance(self.functionality_ids, list): @@ -86,7 +84,7 @@ def to_dict(self) -> dict[str, Any]: else: functionality_ids = self.functionality_ids - group_ids: list[str] | None | Unset + group_ids: Union[None, Unset, list[str]] if isinstance(self.group_ids, Unset): group_ids = UNSET elif isinstance(self.group_ids, list): @@ -95,7 +93,7 @@ def to_dict(self) -> dict[str, Any]: else: group_ids = self.group_ids - incident_type_ids: list[str] | None | Unset + incident_type_ids: Union[None, Unset, list[str]] if isinstance(self.incident_type_ids, Unset): incident_type_ids = UNSET elif isinstance(self.incident_type_ids, list): @@ -133,25 +131,25 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) title = d.pop("title", UNSET) - def _parse_summary(data: object) -> None | str | Unset: + def _parse_summary(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) summary = _parse_summary(d.pop("summary", UNSET)) - def _parse_external_url(data: object) -> None | str | Unset: + def _parse_external_url(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) external_url = _parse_external_url(d.pop("external_url", UNSET)) - def _parse_severity_ids(data: object) -> list[str] | None | Unset: + def _parse_severity_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -162,13 +160,13 @@ def _parse_severity_ids(data: object) -> list[str] | None | Unset: severity_ids_type_0 = cast(list[str], data) return severity_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) severity_ids = _parse_severity_ids(d.pop("severity_ids", UNSET)) - def _parse_environment_ids(data: object) -> list[str] | None | Unset: + def _parse_environment_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -179,13 +177,13 @@ def _parse_environment_ids(data: object) -> list[str] | None | Unset: environment_ids_type_0 = cast(list[str], data) return environment_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) environment_ids = _parse_environment_ids(d.pop("environment_ids", UNSET)) - def _parse_service_ids(data: object) -> list[str] | None | Unset: + def _parse_service_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -196,13 +194,13 @@ def _parse_service_ids(data: object) -> list[str] | None | Unset: service_ids_type_0 = cast(list[str], data) return service_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) service_ids = _parse_service_ids(d.pop("service_ids", UNSET)) - def _parse_functionality_ids(data: object) -> list[str] | None | Unset: + def _parse_functionality_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -213,13 +211,13 @@ def _parse_functionality_ids(data: object) -> list[str] | None | Unset: functionality_ids_type_0 = cast(list[str], data) return functionality_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) functionality_ids = _parse_functionality_ids(d.pop("functionality_ids", UNSET)) - def _parse_group_ids(data: object) -> list[str] | None | Unset: + def _parse_group_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -230,13 +228,13 @@ def _parse_group_ids(data: object) -> list[str] | None | Unset: group_ids_type_0 = cast(list[str], data) return group_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) group_ids = _parse_group_ids(d.pop("group_ids", UNSET)) - def _parse_incident_type_ids(data: object) -> list[str] | None | Unset: + def _parse_incident_type_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -247,9 +245,9 @@ def _parse_incident_type_ids(data: object) -> list[str] | None | Unset: incident_type_ids_type_0 = cast(list[str], data) return incident_type_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) incident_type_ids = _parse_incident_type_ids(d.pop("incident_type_ids", UNSET)) diff --git a/rootly_sdk/models/update_playbook_task.py b/rootly_sdk/models/update_playbook_task.py index d18a975b..56544842 100644 --- a/rootly_sdk/models/update_playbook_task.py +++ b/rootly_sdk/models/update_playbook_task.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdatePlaybookTask: data (UpdatePlaybookTaskData): """ - data: UpdatePlaybookTaskData + data: "UpdatePlaybookTaskData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_playbook_task_data.py b/rootly_sdk/models/update_playbook_task_data.py index fc0209c0..0eb8ab5f 100644 --- a/rootly_sdk/models/update_playbook_task_data.py +++ b/rootly_sdk/models/update_playbook_task_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class UpdatePlaybookTaskData: """ type_: UpdatePlaybookTaskDataType - attributes: UpdatePlaybookTaskDataAttributes + attributes: "UpdatePlaybookTaskDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_playbook_task_data_attributes.py b/rootly_sdk/models/update_playbook_task_data_attributes.py index a8ef0615..8a12fa42 100644 --- a/rootly_sdk/models/update_playbook_task_data_attributes.py +++ b/rootly_sdk/models/update_playbook_task_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -14,25 +12,25 @@ class UpdatePlaybookTaskDataAttributes: """ Attributes: - task (str | Unset): The task of the task - description (None | str | Unset): The description of the task - position (int | None | Unset): The position of the task + task (Union[Unset, str]): The task of the task + description (Union[None, Unset, str]): The description of the task + position (Union[None, Unset, int]): The position of the task """ - task: str | Unset = UNSET - description: None | str | Unset = UNSET - position: int | None | Unset = UNSET + task: Union[Unset, str] = UNSET + description: Union[None, Unset, str] = UNSET + position: Union[None, Unset, int] = UNSET def to_dict(self) -> dict[str, Any]: task = self.task - description: None | str | Unset + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: description = self.description - position: int | None | Unset + position: Union[None, Unset, int] if isinstance(self.position, Unset): position = UNSET else: @@ -55,21 +53,21 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) task = d.pop("task", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> Union[None, Unset, int]: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(Union[None, Unset, int], data) position = _parse_position(d.pop("position", UNSET)) diff --git a/rootly_sdk/models/update_post_mortem_template.py b/rootly_sdk/models/update_post_mortem_template.py index 459111a4..2ef52623 100644 --- a/rootly_sdk/models/update_post_mortem_template.py +++ b/rootly_sdk/models/update_post_mortem_template.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdatePostMortemTemplate: data (UpdatePostMortemTemplateData): """ - data: UpdatePostMortemTemplateData + data: "UpdatePostMortemTemplateData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_post_mortem_template_data.py b/rootly_sdk/models/update_post_mortem_template_data.py index 6c4f98ce..b7139ea7 100644 --- a/rootly_sdk/models/update_post_mortem_template_data.py +++ b/rootly_sdk/models/update_post_mortem_template_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class UpdatePostMortemTemplateData: """ type_: UpdatePostMortemTemplateDataType - attributes: UpdatePostMortemTemplateDataAttributes + attributes: "UpdatePostMortemTemplateDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_post_mortem_template_data_attributes.py b/rootly_sdk/models/update_post_mortem_template_data_attributes.py index 25c498be..bbbeb2e8 100644 --- a/rootly_sdk/models/update_post_mortem_template_data_attributes.py +++ b/rootly_sdk/models/update_post_mortem_template_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -18,22 +16,31 @@ class UpdatePostMortemTemplateDataAttributes: """ Attributes: - name (str | Unset): The name of the postmortem template - default (bool | None | Unset): Default selected template when editing a postmortem - content (str | Unset): The postmortem template. Supports TipTap blocks (followup and timeline components), + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + name (Union[Unset, str]): The name of the postmortem template + default (Union[None, Unset, bool]): Default selected template when editing a postmortem + content (Union[Unset, str]): The postmortem template. Supports TipTap blocks (followup and timeline components), Liquid syntax, and HTML. Will be sanitized and applied to both content and content_html fields. - format_ (UpdatePostMortemTemplateDataAttributesFormat | Unset): The format of the input Default: 'html'. + format_ (Union[Unset, UpdatePostMortemTemplateDataAttributesFormat]): The format of the input Default: 'html'. """ - name: str | Unset = UNSET - default: bool | None | Unset = UNSET - content: str | Unset = UNSET - format_: UpdatePostMortemTemplateDataAttributesFormat | Unset = "html" + slug: Union[None, Unset, str] = UNSET + name: Union[Unset, str] = UNSET + default: Union[None, Unset, bool] = UNSET + content: Union[Unset, str] = UNSET + format_: Union[Unset, UpdatePostMortemTemplateDataAttributesFormat] = "html" def to_dict(self) -> dict[str, Any]: + slug: Union[None, Unset, str] + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug + name = self.name - default: bool | None | Unset + default: Union[None, Unset, bool] if isinstance(self.default, Unset): default = UNSET else: @@ -41,13 +48,15 @@ def to_dict(self) -> dict[str, Any]: content = self.content - format_: str | Unset = UNSET + format_: Union[Unset, str] = UNSET if not isinstance(self.format_, Unset): format_ = self.format_ field_dict: dict[str, Any] = {} field_dict.update({}) + if slug is not UNSET: + field_dict["slug"] = slug if name is not UNSET: field_dict["name"] = name if default is not UNSET: @@ -62,27 +71,38 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) + + def _parse_slug(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + slug = _parse_slug(d.pop("slug", UNSET)) + name = d.pop("name", UNSET) - def _parse_default(data: object) -> bool | None | Unset: + def _parse_default(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) default = _parse_default(d.pop("default", UNSET)) content = d.pop("content", UNSET) _format_ = d.pop("format", UNSET) - format_: UpdatePostMortemTemplateDataAttributesFormat | Unset + format_: Union[Unset, UpdatePostMortemTemplateDataAttributesFormat] if isinstance(_format_, Unset): format_ = UNSET else: format_ = check_update_post_mortem_template_data_attributes_format(_format_) update_post_mortem_template_data_attributes = cls( + slug=slug, name=name, default=default, content=content, diff --git a/rootly_sdk/models/update_pulse.py b/rootly_sdk/models/update_pulse.py index ce900954..8f92ec5b 100644 --- a/rootly_sdk/models/update_pulse.py +++ b/rootly_sdk/models/update_pulse.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdatePulse: data (UpdatePulseData): """ - data: UpdatePulseData + data: "UpdatePulseData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_pulse_data.py b/rootly_sdk/models/update_pulse_data.py index 651fb0dc..b79e1f0b 100644 --- a/rootly_sdk/models/update_pulse_data.py +++ b/rootly_sdk/models/update_pulse_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class UpdatePulseData: """ type_: UpdatePulseDataType - attributes: UpdatePulseDataAttributes + attributes: "UpdatePulseDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_pulse_data_attributes.py b/rootly_sdk/models/update_pulse_data_attributes.py index 0defb512..b7c865aa 100644 --- a/rootly_sdk/models/update_pulse_data_attributes.py +++ b/rootly_sdk/models/update_pulse_data_attributes.py @@ -1,8 +1,6 @@ -from __future__ import annotations - import datetime from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from dateutil.parser import isoparse @@ -22,35 +20,35 @@ class UpdatePulseDataAttributes: """ Attributes: - source (None | str | Unset): The source of the pulse (eg: k8s) - summary (str | Unset): The summary of the pulse - service_ids (list[str] | None | Unset): The Service IDs to attach to the pulse - environment_ids (list[str] | None | Unset): The Environment IDs to attach to the pulse - started_at (datetime.datetime | None | Unset): Pulse start datetime - ended_at (datetime.datetime | None | Unset): Pulse end datetime - external_url (None | str | Unset): The external url of the pulse - labels (list[None | UpdatePulseDataAttributesLabelsItemType0] | Unset): - refs (list[None | UpdatePulseDataAttributesRefsItemType0] | Unset): - data (None | Unset | UpdatePulseDataAttributesDataType0): Additional data + source (Union[None, Unset, str]): The source of the pulse (eg: k8s) + summary (Union[Unset, str]): The summary of the pulse + service_ids (Union[None, Unset, list[str]]): The Service IDs to attach to the pulse + environment_ids (Union[None, Unset, list[str]]): The Environment IDs to attach to the pulse + started_at (Union[None, Unset, datetime.datetime]): Pulse start datetime + ended_at (Union[None, Unset, datetime.datetime]): Pulse end datetime + external_url (Union[None, Unset, str]): The external url of the pulse + labels (Union[Unset, list[Union['UpdatePulseDataAttributesLabelsItemType0', None]]]): + refs (Union[Unset, list[Union['UpdatePulseDataAttributesRefsItemType0', None]]]): + data (Union['UpdatePulseDataAttributesDataType0', None, Unset]): Additional data """ - source: None | str | Unset = UNSET - summary: str | Unset = UNSET - service_ids: list[str] | None | Unset = UNSET - environment_ids: list[str] | None | Unset = UNSET - started_at: datetime.datetime | None | Unset = UNSET - ended_at: datetime.datetime | None | Unset = UNSET - external_url: None | str | Unset = UNSET - labels: list[None | UpdatePulseDataAttributesLabelsItemType0] | Unset = UNSET - refs: list[None | UpdatePulseDataAttributesRefsItemType0] | Unset = UNSET - data: None | Unset | UpdatePulseDataAttributesDataType0 = UNSET + source: Union[None, Unset, str] = UNSET + summary: Union[Unset, str] = UNSET + service_ids: Union[None, Unset, list[str]] = UNSET + environment_ids: Union[None, Unset, list[str]] = UNSET + started_at: Union[None, Unset, datetime.datetime] = UNSET + ended_at: Union[None, Unset, datetime.datetime] = UNSET + external_url: Union[None, Unset, str] = UNSET + labels: Union[Unset, list[Union["UpdatePulseDataAttributesLabelsItemType0", None]]] = UNSET + refs: Union[Unset, list[Union["UpdatePulseDataAttributesRefsItemType0", None]]] = UNSET + data: Union["UpdatePulseDataAttributesDataType0", None, Unset] = UNSET def to_dict(self) -> dict[str, Any]: from ..models.update_pulse_data_attributes_data_type_0 import UpdatePulseDataAttributesDataType0 from ..models.update_pulse_data_attributes_labels_item_type_0 import UpdatePulseDataAttributesLabelsItemType0 from ..models.update_pulse_data_attributes_refs_item_type_0 import UpdatePulseDataAttributesRefsItemType0 - source: None | str | Unset + source: Union[None, Unset, str] if isinstance(self.source, Unset): source = UNSET else: @@ -58,7 +56,7 @@ def to_dict(self) -> dict[str, Any]: summary = self.summary - service_ids: list[str] | None | Unset + service_ids: Union[None, Unset, list[str]] if isinstance(self.service_ids, Unset): service_ids = UNSET elif isinstance(self.service_ids, list): @@ -67,7 +65,7 @@ def to_dict(self) -> dict[str, Any]: else: service_ids = self.service_ids - environment_ids: list[str] | None | Unset + environment_ids: Union[None, Unset, list[str]] if isinstance(self.environment_ids, Unset): environment_ids = UNSET elif isinstance(self.environment_ids, list): @@ -76,7 +74,7 @@ def to_dict(self) -> dict[str, Any]: else: environment_ids = self.environment_ids - started_at: None | str | Unset + started_at: Union[None, Unset, str] if isinstance(self.started_at, Unset): started_at = UNSET elif isinstance(self.started_at, datetime.datetime): @@ -84,7 +82,7 @@ def to_dict(self) -> dict[str, Any]: else: started_at = self.started_at - ended_at: None | str | Unset + ended_at: Union[None, Unset, str] if isinstance(self.ended_at, Unset): ended_at = UNSET elif isinstance(self.ended_at, datetime.datetime): @@ -92,35 +90,35 @@ def to_dict(self) -> dict[str, Any]: else: ended_at = self.ended_at - external_url: None | str | Unset + external_url: Union[None, Unset, str] if isinstance(self.external_url, Unset): external_url = UNSET else: external_url = self.external_url - labels: list[dict[str, Any] | None] | Unset = UNSET + labels: Union[Unset, list[Union[None, dict[str, Any]]]] = UNSET if not isinstance(self.labels, Unset): labels = [] for labels_item_data in self.labels: - labels_item: dict[str, Any] | None + labels_item: Union[None, dict[str, Any]] if isinstance(labels_item_data, UpdatePulseDataAttributesLabelsItemType0): labels_item = labels_item_data.to_dict() else: labels_item = labels_item_data labels.append(labels_item) - refs: list[dict[str, Any] | None] | Unset = UNSET + refs: Union[Unset, list[Union[None, dict[str, Any]]]] = UNSET if not isinstance(self.refs, Unset): refs = [] for refs_item_data in self.refs: - refs_item: dict[str, Any] | None + refs_item: Union[None, dict[str, Any]] if isinstance(refs_item_data, UpdatePulseDataAttributesRefsItemType0): refs_item = refs_item_data.to_dict() else: refs_item = refs_item_data refs.append(refs_item) - data: dict[str, Any] | None | Unset + data: Union[None, Unset, dict[str, Any]] if isinstance(self.data, Unset): data = UNSET elif isinstance(self.data, UpdatePulseDataAttributesDataType0): @@ -162,18 +160,18 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_source(data: object) -> None | str | Unset: + def _parse_source(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) source = _parse_source(d.pop("source", UNSET)) summary = d.pop("summary", UNSET) - def _parse_service_ids(data: object) -> list[str] | None | Unset: + def _parse_service_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -184,13 +182,13 @@ def _parse_service_ids(data: object) -> list[str] | None | Unset: service_ids_type_0 = cast(list[str], data) return service_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) service_ids = _parse_service_ids(d.pop("service_ids", UNSET)) - def _parse_environment_ids(data: object) -> list[str] | None | Unset: + def _parse_environment_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -201,13 +199,13 @@ def _parse_environment_ids(data: object) -> list[str] | None | Unset: environment_ids_type_0 = cast(list[str], data) return environment_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) environment_ids = _parse_environment_ids(d.pop("environment_ids", UNSET)) - def _parse_started_at(data: object) -> datetime.datetime | None | Unset: + def _parse_started_at(data: object) -> Union[None, Unset, datetime.datetime]: if data is None: return data if isinstance(data, Unset): @@ -218,13 +216,13 @@ def _parse_started_at(data: object) -> datetime.datetime | None | Unset: started_at_type_0 = isoparse(data) return started_at_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(datetime.datetime | None | Unset, data) + return cast(Union[None, Unset, datetime.datetime], data) started_at = _parse_started_at(d.pop("started_at", UNSET)) - def _parse_ended_at(data: object) -> datetime.datetime | None | Unset: + def _parse_ended_at(data: object) -> Union[None, Unset, datetime.datetime]: if data is None: return data if isinstance(data, Unset): @@ -235,68 +233,64 @@ def _parse_ended_at(data: object) -> datetime.datetime | None | Unset: ended_at_type_0 = isoparse(data) return ended_at_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(datetime.datetime | None | Unset, data) + return cast(Union[None, Unset, datetime.datetime], data) ended_at = _parse_ended_at(d.pop("ended_at", UNSET)) - def _parse_external_url(data: object) -> None | str | Unset: + def _parse_external_url(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) external_url = _parse_external_url(d.pop("external_url", UNSET)) + labels = [] _labels = d.pop("labels", UNSET) - labels: list[None | UpdatePulseDataAttributesLabelsItemType0] | Unset = UNSET - if _labels is not UNSET: - labels = [] - for labels_item_data in _labels: + for labels_item_data in _labels or []: - def _parse_labels_item(data: object) -> None | UpdatePulseDataAttributesLabelsItemType0: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - labels_item_type_0 = UpdatePulseDataAttributesLabelsItemType0.from_dict(data) + def _parse_labels_item(data: object) -> Union["UpdatePulseDataAttributesLabelsItemType0", None]: + if data is None: + return data + try: + if not isinstance(data, dict): + raise TypeError() + labels_item_type_0 = UpdatePulseDataAttributesLabelsItemType0.from_dict(data) - return labels_item_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | UpdatePulseDataAttributesLabelsItemType0, data) + return labels_item_type_0 + except: # noqa: E722 + pass + return cast(Union["UpdatePulseDataAttributesLabelsItemType0", None], data) - labels_item = _parse_labels_item(labels_item_data) + labels_item = _parse_labels_item(labels_item_data) - labels.append(labels_item) + labels.append(labels_item) + refs = [] _refs = d.pop("refs", UNSET) - refs: list[None | UpdatePulseDataAttributesRefsItemType0] | Unset = UNSET - if _refs is not UNSET: - refs = [] - for refs_item_data in _refs: + for refs_item_data in _refs or []: - def _parse_refs_item(data: object) -> None | UpdatePulseDataAttributesRefsItemType0: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - refs_item_type_0 = UpdatePulseDataAttributesRefsItemType0.from_dict(data) + def _parse_refs_item(data: object) -> Union["UpdatePulseDataAttributesRefsItemType0", None]: + if data is None: + return data + try: + if not isinstance(data, dict): + raise TypeError() + refs_item_type_0 = UpdatePulseDataAttributesRefsItemType0.from_dict(data) - return refs_item_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | UpdatePulseDataAttributesRefsItemType0, data) + return refs_item_type_0 + except: # noqa: E722 + pass + return cast(Union["UpdatePulseDataAttributesRefsItemType0", None], data) - refs_item = _parse_refs_item(refs_item_data) + refs_item = _parse_refs_item(refs_item_data) - refs.append(refs_item) + refs.append(refs_item) - def _parse_data(data: object) -> None | Unset | UpdatePulseDataAttributesDataType0: + def _parse_data(data: object) -> Union["UpdatePulseDataAttributesDataType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -307,9 +301,9 @@ def _parse_data(data: object) -> None | Unset | UpdatePulseDataAttributesDataTyp data_type_0 = UpdatePulseDataAttributesDataType0.from_dict(data) return data_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(None | Unset | UpdatePulseDataAttributesDataType0, data) + return cast(Union["UpdatePulseDataAttributesDataType0", None, Unset], data) data = _parse_data(d.pop("data", UNSET)) diff --git a/rootly_sdk/models/update_pulse_data_attributes_data_type_0.py b/rootly_sdk/models/update_pulse_data_attributes_data_type_0.py index 30981982..06fff96b 100644 --- a/rootly_sdk/models/update_pulse_data_attributes_data_type_0.py +++ b/rootly_sdk/models/update_pulse_data_attributes_data_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,7 +14,6 @@ class UpdatePulseDataAttributesDataType0: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) diff --git a/rootly_sdk/models/update_pulse_data_attributes_labels_item_type_0.py b/rootly_sdk/models/update_pulse_data_attributes_labels_item_type_0.py index f677ef10..9c825e31 100644 --- a/rootly_sdk/models/update_pulse_data_attributes_labels_item_type_0.py +++ b/rootly_sdk/models/update_pulse_data_attributes_labels_item_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/update_pulse_data_attributes_refs_item_type_0.py b/rootly_sdk/models/update_pulse_data_attributes_refs_item_type_0.py index 8d76f43b..ceff1b7a 100644 --- a/rootly_sdk/models/update_pulse_data_attributes_refs_item_type_0.py +++ b/rootly_sdk/models/update_pulse_data_attributes_refs_item_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/update_quip_page_task_params.py b/rootly_sdk/models/update_quip_page_task_params.py index 3de18173..a2284a2b 100644 --- a/rootly_sdk/models/update_quip_page_task_params.py +++ b/rootly_sdk/models/update_quip_page_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -20,25 +18,25 @@ class UpdateQuipPageTaskParams: """ Attributes: file_id (str): The Quip page ID - task_type (UpdateQuipPageTaskParamsTaskType | Unset): - title (str | Unset): The Quip page title - content (str | Unset): The Quip page content - post_mortem_template_id (str | Unset): Retrospective template to use when updating page, if desired - template_id (str | Unset): The Quip file ID to use as a template + task_type (Union[Unset, UpdateQuipPageTaskParamsTaskType]): + title (Union[Unset, str]): The Quip page title + content (Union[Unset, str]): The Quip page content + post_mortem_template_id (Union[Unset, str]): Retrospective template to use when updating page, if desired + template_id (Union[Unset, str]): The Quip file ID to use as a template """ file_id: str - task_type: UpdateQuipPageTaskParamsTaskType | Unset = UNSET - title: str | Unset = UNSET - content: str | Unset = UNSET - post_mortem_template_id: str | Unset = UNSET - template_id: str | Unset = UNSET + task_type: Union[Unset, UpdateQuipPageTaskParamsTaskType] = UNSET + title: Union[Unset, str] = UNSET + content: Union[Unset, str] = UNSET + post_mortem_template_id: Union[Unset, str] = UNSET + template_id: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: file_id = self.file_id - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -76,7 +74,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: file_id = d.pop("file_id") _task_type = d.pop("task_type", UNSET) - task_type: UpdateQuipPageTaskParamsTaskType | Unset + task_type: Union[Unset, UpdateQuipPageTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/update_retrospective_configuration.py b/rootly_sdk/models/update_retrospective_configuration.py index e4975c8a..b193a418 100644 --- a/rootly_sdk/models/update_retrospective_configuration.py +++ b/rootly_sdk/models/update_retrospective_configuration.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateRetrospectiveConfiguration: data (UpdateRetrospectiveConfigurationData): """ - data: UpdateRetrospectiveConfigurationData + data: "UpdateRetrospectiveConfigurationData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_retrospective_configuration_data.py b/rootly_sdk/models/update_retrospective_configuration_data.py index 1d1cf126..35842ed6 100644 --- a/rootly_sdk/models/update_retrospective_configuration_data.py +++ b/rootly_sdk/models/update_retrospective_configuration_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class UpdateRetrospectiveConfigurationData: """ type_: UpdateRetrospectiveConfigurationDataType - attributes: UpdateRetrospectiveConfigurationDataAttributes + attributes: "UpdateRetrospectiveConfigurationDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_retrospective_configuration_data_attributes.py b/rootly_sdk/models/update_retrospective_configuration_data_attributes.py index 969dbf0b..169ae1da 100644 --- a/rootly_sdk/models/update_retrospective_configuration_data_attributes.py +++ b/rootly_sdk/models/update_retrospective_configuration_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -14,17 +12,18 @@ class UpdateRetrospectiveConfigurationDataAttributes: """ Attributes: - severity_ids (list[str] | None | Unset): The Severity IDs to attach to the retrospective configuration - group_ids (list[str] | None | Unset): The Team IDs to attach to the retrospective configuration - incident_type_ids (list[str] | None | Unset): The Incident Type IDs to attach to the retrospective configuration + severity_ids (Union[None, Unset, list[str]]): The Severity IDs to attach to the retrospective configuration + group_ids (Union[None, Unset, list[str]]): The Team IDs to attach to the retrospective configuration + incident_type_ids (Union[None, Unset, list[str]]): The Incident Type IDs to attach to the retrospective + configuration """ - severity_ids: list[str] | None | Unset = UNSET - group_ids: list[str] | None | Unset = UNSET - incident_type_ids: list[str] | None | Unset = UNSET + severity_ids: Union[None, Unset, list[str]] = UNSET + group_ids: Union[None, Unset, list[str]] = UNSET + incident_type_ids: Union[None, Unset, list[str]] = UNSET def to_dict(self) -> dict[str, Any]: - severity_ids: list[str] | None | Unset + severity_ids: Union[None, Unset, list[str]] if isinstance(self.severity_ids, Unset): severity_ids = UNSET elif isinstance(self.severity_ids, list): @@ -33,7 +32,7 @@ def to_dict(self) -> dict[str, Any]: else: severity_ids = self.severity_ids - group_ids: list[str] | None | Unset + group_ids: Union[None, Unset, list[str]] if isinstance(self.group_ids, Unset): group_ids = UNSET elif isinstance(self.group_ids, list): @@ -42,7 +41,7 @@ def to_dict(self) -> dict[str, Any]: else: group_ids = self.group_ids - incident_type_ids: list[str] | None | Unset + incident_type_ids: Union[None, Unset, list[str]] if isinstance(self.incident_type_ids, Unset): incident_type_ids = UNSET elif isinstance(self.incident_type_ids, list): @@ -67,7 +66,7 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_severity_ids(data: object) -> list[str] | None | Unset: + def _parse_severity_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -78,13 +77,13 @@ def _parse_severity_ids(data: object) -> list[str] | None | Unset: severity_ids_type_0 = cast(list[str], data) return severity_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) severity_ids = _parse_severity_ids(d.pop("severity_ids", UNSET)) - def _parse_group_ids(data: object) -> list[str] | None | Unset: + def _parse_group_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -95,13 +94,13 @@ def _parse_group_ids(data: object) -> list[str] | None | Unset: group_ids_type_0 = cast(list[str], data) return group_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) group_ids = _parse_group_ids(d.pop("group_ids", UNSET)) - def _parse_incident_type_ids(data: object) -> list[str] | None | Unset: + def _parse_incident_type_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -112,9 +111,9 @@ def _parse_incident_type_ids(data: object) -> list[str] | None | Unset: incident_type_ids_type_0 = cast(list[str], data) return incident_type_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) incident_type_ids = _parse_incident_type_ids(d.pop("incident_type_ids", UNSET)) diff --git a/rootly_sdk/models/update_retrospective_process.py b/rootly_sdk/models/update_retrospective_process.py index ca707e8e..b5e48c48 100644 --- a/rootly_sdk/models/update_retrospective_process.py +++ b/rootly_sdk/models/update_retrospective_process.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateRetrospectiveProcess: data (UpdateRetrospectiveProcessData): """ - data: UpdateRetrospectiveProcessData + data: "UpdateRetrospectiveProcessData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_retrospective_process_data.py b/rootly_sdk/models/update_retrospective_process_data.py index e5a466bb..592d517b 100644 --- a/rootly_sdk/models/update_retrospective_process_data.py +++ b/rootly_sdk/models/update_retrospective_process_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class UpdateRetrospectiveProcessData: """ type_: UpdateRetrospectiveProcessDataType - attributes: UpdateRetrospectiveProcessDataAttributes + attributes: "UpdateRetrospectiveProcessDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_retrospective_process_data_attributes.py b/rootly_sdk/models/update_retrospective_process_data_attributes.py index 2627b37f..7bd9c504 100644 --- a/rootly_sdk/models/update_retrospective_process_data_attributes.py +++ b/rootly_sdk/models/update_retrospective_process_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -26,22 +24,22 @@ class UpdateRetrospectiveProcessDataAttributes: """ Attributes: - name (str | Unset): The name of the retrospective process - description (None | str | Unset): The description of the retrospective process - retrospective_process_matching_criteria (Unset | - UpdateRetrospectiveProcessDataAttributesRetrospectiveProcessMatchingCriteriaType0 | - UpdateRetrospectiveProcessDataAttributesRetrospectiveProcessMatchingCriteriaType1 | - UpdateRetrospectiveProcessDataAttributesRetrospectiveProcessMatchingCriteriaType2): + name (Union[Unset, str]): The name of the retrospective process + description (Union[None, Unset, str]): The description of the retrospective process + retrospective_process_matching_criteria + (Union['UpdateRetrospectiveProcessDataAttributesRetrospectiveProcessMatchingCriteriaType0', + 'UpdateRetrospectiveProcessDataAttributesRetrospectiveProcessMatchingCriteriaType1', + 'UpdateRetrospectiveProcessDataAttributesRetrospectiveProcessMatchingCriteriaType2', Unset]): """ - name: str | Unset = UNSET - description: None | str | Unset = UNSET - retrospective_process_matching_criteria: ( - Unset - | UpdateRetrospectiveProcessDataAttributesRetrospectiveProcessMatchingCriteriaType0 - | UpdateRetrospectiveProcessDataAttributesRetrospectiveProcessMatchingCriteriaType1 - | UpdateRetrospectiveProcessDataAttributesRetrospectiveProcessMatchingCriteriaType2 - ) = UNSET + name: Union[Unset, str] = UNSET + description: Union[None, Unset, str] = UNSET + retrospective_process_matching_criteria: Union[ + "UpdateRetrospectiveProcessDataAttributesRetrospectiveProcessMatchingCriteriaType0", + "UpdateRetrospectiveProcessDataAttributesRetrospectiveProcessMatchingCriteriaType1", + "UpdateRetrospectiveProcessDataAttributesRetrospectiveProcessMatchingCriteriaType2", + Unset, + ] = UNSET def to_dict(self) -> dict[str, Any]: from ..models.update_retrospective_process_data_attributes_retrospective_process_matching_criteria_type_0 import ( @@ -53,13 +51,13 @@ def to_dict(self) -> dict[str, Any]: name = self.name - description: None | str | Unset + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: description = self.description - retrospective_process_matching_criteria: dict[str, Any] | Unset + retrospective_process_matching_criteria: Union[Unset, dict[str, Any]] if isinstance(self.retrospective_process_matching_criteria, Unset): retrospective_process_matching_criteria = UNSET elif isinstance( @@ -102,23 +100,23 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) def _parse_retrospective_process_matching_criteria( data: object, - ) -> ( - Unset - | UpdateRetrospectiveProcessDataAttributesRetrospectiveProcessMatchingCriteriaType0 - | UpdateRetrospectiveProcessDataAttributesRetrospectiveProcessMatchingCriteriaType1 - | UpdateRetrospectiveProcessDataAttributesRetrospectiveProcessMatchingCriteriaType2 - ): + ) -> Union[ + "UpdateRetrospectiveProcessDataAttributesRetrospectiveProcessMatchingCriteriaType0", + "UpdateRetrospectiveProcessDataAttributesRetrospectiveProcessMatchingCriteriaType1", + "UpdateRetrospectiveProcessDataAttributesRetrospectiveProcessMatchingCriteriaType2", + Unset, + ]: if isinstance(data, Unset): return data try: @@ -129,7 +127,7 @@ def _parse_retrospective_process_matching_criteria( ) return retrospective_process_matching_criteria_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -139,7 +137,7 @@ def _parse_retrospective_process_matching_criteria( ) return retrospective_process_matching_criteria_type_1 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass if not isinstance(data, dict): raise TypeError() diff --git a/rootly_sdk/models/update_retrospective_process_data_attributes_retrospective_process_matching_criteria_type_0.py b/rootly_sdk/models/update_retrospective_process_data_attributes_retrospective_process_matching_criteria_type_0.py index 5fe8b8ec..59823a93 100644 --- a/rootly_sdk/models/update_retrospective_process_data_attributes_retrospective_process_matching_criteria_type_0.py +++ b/rootly_sdk/models/update_retrospective_process_data_attributes_retrospective_process_matching_criteria_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast diff --git a/rootly_sdk/models/update_retrospective_process_data_attributes_retrospective_process_matching_criteria_type_1.py b/rootly_sdk/models/update_retrospective_process_data_attributes_retrospective_process_matching_criteria_type_1.py index 51a20fd7..0ccf8f66 100644 --- a/rootly_sdk/models/update_retrospective_process_data_attributes_retrospective_process_matching_criteria_type_1.py +++ b/rootly_sdk/models/update_retrospective_process_data_attributes_retrospective_process_matching_criteria_type_1.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast diff --git a/rootly_sdk/models/update_retrospective_process_data_attributes_retrospective_process_matching_criteria_type_2.py b/rootly_sdk/models/update_retrospective_process_data_attributes_retrospective_process_matching_criteria_type_2.py index f8c3eab1..4f61a7b2 100644 --- a/rootly_sdk/models/update_retrospective_process_data_attributes_retrospective_process_matching_criteria_type_2.py +++ b/rootly_sdk/models/update_retrospective_process_data_attributes_retrospective_process_matching_criteria_type_2.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar, cast diff --git a/rootly_sdk/models/update_retrospective_process_group.py b/rootly_sdk/models/update_retrospective_process_group.py index feef5994..95e59d85 100644 --- a/rootly_sdk/models/update_retrospective_process_group.py +++ b/rootly_sdk/models/update_retrospective_process_group.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateRetrospectiveProcessGroup: data (UpdateRetrospectiveProcessGroupData): """ - data: UpdateRetrospectiveProcessGroupData + data: "UpdateRetrospectiveProcessGroupData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_retrospective_process_group_data.py b/rootly_sdk/models/update_retrospective_process_group_data.py index 8230d21d..8a9b04c0 100644 --- a/rootly_sdk/models/update_retrospective_process_group_data.py +++ b/rootly_sdk/models/update_retrospective_process_group_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class UpdateRetrospectiveProcessGroupData: """ type_: UpdateRetrospectiveProcessGroupDataType - attributes: UpdateRetrospectiveProcessGroupDataAttributes + attributes: "UpdateRetrospectiveProcessGroupDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_retrospective_process_group_data_attributes.py b/rootly_sdk/models/update_retrospective_process_group_data_attributes.py index b34d1eac..65ee8899 100644 --- a/rootly_sdk/models/update_retrospective_process_group_data_attributes.py +++ b/rootly_sdk/models/update_retrospective_process_group_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define @@ -14,12 +12,12 @@ class UpdateRetrospectiveProcessGroupDataAttributes: """ Attributes: - sub_status_id (str | Unset): - position (int | Unset): + sub_status_id (Union[Unset, str]): + position (Union[Unset, int]): """ - sub_status_id: str | Unset = UNSET - position: int | Unset = UNSET + sub_status_id: Union[Unset, str] = UNSET + position: Union[Unset, int] = UNSET def to_dict(self) -> dict[str, Any]: sub_status_id = self.sub_status_id diff --git a/rootly_sdk/models/update_retrospective_process_group_step.py b/rootly_sdk/models/update_retrospective_process_group_step.py index ef0b3d24..59c0725f 100644 --- a/rootly_sdk/models/update_retrospective_process_group_step.py +++ b/rootly_sdk/models/update_retrospective_process_group_step.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateRetrospectiveProcessGroupStep: data (UpdateRetrospectiveProcessGroupStepData): """ - data: UpdateRetrospectiveProcessGroupStepData + data: "UpdateRetrospectiveProcessGroupStepData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_retrospective_process_group_step_data.py b/rootly_sdk/models/update_retrospective_process_group_step_data.py index 40bd1a00..72ecd8b3 100644 --- a/rootly_sdk/models/update_retrospective_process_group_step_data.py +++ b/rootly_sdk/models/update_retrospective_process_group_step_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class UpdateRetrospectiveProcessGroupStepData: """ type_: UpdateRetrospectiveProcessGroupStepDataType - attributes: UpdateRetrospectiveProcessGroupStepDataAttributes + attributes: "UpdateRetrospectiveProcessGroupStepDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_retrospective_process_group_step_data_attributes.py b/rootly_sdk/models/update_retrospective_process_group_step_data_attributes.py index 76b6e3c0..646f609e 100644 --- a/rootly_sdk/models/update_retrospective_process_group_step_data_attributes.py +++ b/rootly_sdk/models/update_retrospective_process_group_step_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define @@ -14,10 +12,10 @@ class UpdateRetrospectiveProcessGroupStepDataAttributes: """ Attributes: - position (int | Unset): + position (Union[Unset, int]): """ - position: int | Unset = UNSET + position: Union[Unset, int] = UNSET def to_dict(self) -> dict[str, Any]: position = self.position diff --git a/rootly_sdk/models/update_retrospective_step.py b/rootly_sdk/models/update_retrospective_step.py index e6088f73..bc6d3b12 100644 --- a/rootly_sdk/models/update_retrospective_step.py +++ b/rootly_sdk/models/update_retrospective_step.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateRetrospectiveStep: data (UpdateRetrospectiveStepData): """ - data: UpdateRetrospectiveStepData + data: "UpdateRetrospectiveStepData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_retrospective_step_data.py b/rootly_sdk/models/update_retrospective_step_data.py index 7d559d60..1034ebad 100644 --- a/rootly_sdk/models/update_retrospective_step_data.py +++ b/rootly_sdk/models/update_retrospective_step_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class UpdateRetrospectiveStepData: """ type_: UpdateRetrospectiveStepDataType - attributes: UpdateRetrospectiveStepDataAttributes + attributes: "UpdateRetrospectiveStepDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_retrospective_step_data_attributes.py b/rootly_sdk/models/update_retrospective_step_data_attributes.py index 421a8240..e01a5182 100644 --- a/rootly_sdk/models/update_retrospective_step_data_attributes.py +++ b/rootly_sdk/models/update_retrospective_step_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -14,44 +12,53 @@ class UpdateRetrospectiveStepDataAttributes: """ Attributes: - title (str | Unset): The name of the step - description (None | str | Unset): The description of the step - incident_role_id (None | str | Unset): Users assigned to the selected incident role will be the default owners - for this step - due_after_days (int | None | Unset): Due date in days - position (int | None | Unset): Position of the step - skippable (bool | Unset): Is the step skippable? + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `title`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + title (Union[Unset, str]): The name of the step + description (Union[None, Unset, str]): The description of the step + incident_role_id (Union[None, Unset, str]): Users assigned to the selected incident role will be the default + owners for this step + due_after_days (Union[None, Unset, int]): Due date in days + position (Union[None, Unset, int]): Position of the step + skippable (Union[Unset, bool]): Is the step skippable? """ - title: str | Unset = UNSET - description: None | str | Unset = UNSET - incident_role_id: None | str | Unset = UNSET - due_after_days: int | None | Unset = UNSET - position: int | None | Unset = UNSET - skippable: bool | Unset = UNSET + slug: Union[None, Unset, str] = UNSET + title: Union[Unset, str] = UNSET + description: Union[None, Unset, str] = UNSET + incident_role_id: Union[None, Unset, str] = UNSET + due_after_days: Union[None, Unset, int] = UNSET + position: Union[None, Unset, int] = UNSET + skippable: Union[Unset, bool] = UNSET def to_dict(self) -> dict[str, Any]: + slug: Union[None, Unset, str] + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug + title = self.title - description: None | str | Unset + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: description = self.description - incident_role_id: None | str | Unset + incident_role_id: Union[None, Unset, str] if isinstance(self.incident_role_id, Unset): incident_role_id = UNSET else: incident_role_id = self.incident_role_id - due_after_days: int | None | Unset + due_after_days: Union[None, Unset, int] if isinstance(self.due_after_days, Unset): due_after_days = UNSET else: due_after_days = self.due_after_days - position: int | None | Unset + position: Union[None, Unset, int] if isinstance(self.position, Unset): position = UNSET else: @@ -62,6 +69,8 @@ def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} field_dict.update({}) + if slug is not UNSET: + field_dict["slug"] = slug if title is not UNSET: field_dict["title"] = title if description is not UNSET: @@ -80,47 +89,58 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) + + def _parse_slug(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + slug = _parse_slug(d.pop("slug", UNSET)) + title = d.pop("title", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) - def _parse_incident_role_id(data: object) -> None | str | Unset: + def _parse_incident_role_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) incident_role_id = _parse_incident_role_id(d.pop("incident_role_id", UNSET)) - def _parse_due_after_days(data: object) -> int | None | Unset: + def _parse_due_after_days(data: object) -> Union[None, Unset, int]: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(Union[None, Unset, int], data) due_after_days = _parse_due_after_days(d.pop("due_after_days", UNSET)) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> Union[None, Unset, int]: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(Union[None, Unset, int], data) position = _parse_position(d.pop("position", UNSET)) skippable = d.pop("skippable", UNSET) update_retrospective_step_data_attributes = cls( + slug=slug, title=title, description=description, incident_role_id=incident_role_id, diff --git a/rootly_sdk/models/update_role.py b/rootly_sdk/models/update_role.py index fa829337..0e36ba39 100644 --- a/rootly_sdk/models/update_role.py +++ b/rootly_sdk/models/update_role.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateRole: data (UpdateRoleData): """ - data: UpdateRoleData + data: "UpdateRoleData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_role_data.py b/rootly_sdk/models/update_role_data.py index 0237e351..c334e4fe 100644 --- a/rootly_sdk/models/update_role_data.py +++ b/rootly_sdk/models/update_role_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class UpdateRoleData: """ type_: UpdateRoleDataType - attributes: UpdateRoleDataAttributes + attributes: "UpdateRoleDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_role_data_attributes.py b/rootly_sdk/models/update_role_data_attributes.py index 07ecec3c..9a4e1bd9 100644 --- a/rootly_sdk/models/update_role_data_attributes.py +++ b/rootly_sdk/models/update_role_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -138,85 +136,96 @@ class UpdateRoleDataAttributes: """ Attributes: - name (str | Unset): The role name. - incident_permission_set_id (None | str | Unset): Associated incident permissions set. - is_deletable (bool | Unset): Whether the role can be deleted. - is_editable (bool | Unset): Whether the role can be edited. - api_keys_permissions (list[UpdateRoleDataAttributesApiKeysPermissionsItem] | Unset): - audits_permissions (list[UpdateRoleDataAttributesAuditsPermissionsItem] | Unset): - billing_permissions (list[UpdateRoleDataAttributesBillingPermissionsItem] | Unset): - environments_permissions (list[UpdateRoleDataAttributesEnvironmentsPermissionsItem] | Unset): - form_fields_permissions (list[UpdateRoleDataAttributesFormFieldsPermissionsItem] | Unset): - functionalities_permissions (list[UpdateRoleDataAttributesFunctionalitiesPermissionsItem] | Unset): - groups_permissions (list[UpdateRoleDataAttributesGroupsPermissionsItem] | Unset): - incident_causes_permissions (list[UpdateRoleDataAttributesIncidentCausesPermissionsItem] | Unset): - incident_feedbacks_permissions (list[UpdateRoleDataAttributesIncidentFeedbacksPermissionsItem] | Unset): - incident_roles_permissions (list[UpdateRoleDataAttributesIncidentRolesPermissionsItem] | Unset): - incident_types_permissions (list[UpdateRoleDataAttributesIncidentTypesPermissionsItem] | Unset): - incidents_permissions (list[UpdateRoleDataAttributesIncidentsPermissionsItem] | Unset): - integrations_permissions (list[UpdateRoleDataAttributesIntegrationsPermissionsItem] | Unset): - invitations_permissions (list[UpdateRoleDataAttributesInvitationsPermissionsItem] | Unset): - playbooks_permissions (list[UpdateRoleDataAttributesPlaybooksPermissionsItem] | Unset): - private_incidents_permissions (list[UpdateRoleDataAttributesPrivateIncidentsPermissionsItem] | Unset): - retrospective_permissions (list[UpdateRoleDataAttributesRetrospectivePermissionsItem] | Unset): - roles_permissions (list[UpdateRoleDataAttributesRolesPermissionsItem] | Unset): - secrets_permissions (list[UpdateRoleDataAttributesSecretsPermissionsItem] | Unset): - services_permissions (list[UpdateRoleDataAttributesServicesPermissionsItem] | Unset): - severities_permissions (list[UpdateRoleDataAttributesSeveritiesPermissionsItem] | Unset): - status_pages_permissions (list[UpdateRoleDataAttributesStatusPagesPermissionsItem] | Unset): - webhooks_permissions (list[UpdateRoleDataAttributesWebhooksPermissionsItem] | Unset): - workflows_permissions (list[UpdateRoleDataAttributesWorkflowsPermissionsItem] | Unset): - catalogs_permissions (list[UpdateRoleDataAttributesCatalogsPermissionsItem] | Unset): - sub_statuses_permissions (list[UpdateRoleDataAttributesSubStatusesPermissionsItem] | Unset): - edge_connector_permissions (list[UpdateRoleDataAttributesEdgeConnectorPermissionsItem] | Unset): - slas_permissions (list[UpdateRoleDataAttributesSlasPermissionsItem] | Unset): - paging_permissions (list[UpdateRoleDataAttributesPagingPermissionsItem] | Unset): - incident_communication_permissions (list[UpdateRoleDataAttributesIncidentCommunicationPermissionsItem] | Unset): - communication_permissions (list[UpdateRoleDataAttributesCommunicationPermissionsItem] | Unset): + slug (Union[None, Unset, str]): Deprecated. Custom role slugs remain accepted temporarily. Stop setting `slug`; + it will become read-only and be derived from `name` when this property is removed from the request schema in a + future version. + name (Union[Unset, str]): The role name. + incident_permission_set_id (Union[None, Unset, str]): Associated incident permissions set. + is_deletable (Union[Unset, bool]): Whether the role can be deleted. + is_editable (Union[Unset, bool]): Whether the role can be edited. + api_keys_permissions (Union[Unset, list[UpdateRoleDataAttributesApiKeysPermissionsItem]]): + audits_permissions (Union[Unset, list[UpdateRoleDataAttributesAuditsPermissionsItem]]): + billing_permissions (Union[Unset, list[UpdateRoleDataAttributesBillingPermissionsItem]]): + environments_permissions (Union[Unset, list[UpdateRoleDataAttributesEnvironmentsPermissionsItem]]): + form_fields_permissions (Union[Unset, list[UpdateRoleDataAttributesFormFieldsPermissionsItem]]): + functionalities_permissions (Union[Unset, list[UpdateRoleDataAttributesFunctionalitiesPermissionsItem]]): + groups_permissions (Union[Unset, list[UpdateRoleDataAttributesGroupsPermissionsItem]]): + incident_causes_permissions (Union[Unset, list[UpdateRoleDataAttributesIncidentCausesPermissionsItem]]): + incident_feedbacks_permissions (Union[Unset, list[UpdateRoleDataAttributesIncidentFeedbacksPermissionsItem]]): + incident_roles_permissions (Union[Unset, list[UpdateRoleDataAttributesIncidentRolesPermissionsItem]]): + incident_types_permissions (Union[Unset, list[UpdateRoleDataAttributesIncidentTypesPermissionsItem]]): + incidents_permissions (Union[Unset, list[UpdateRoleDataAttributesIncidentsPermissionsItem]]): + integrations_permissions (Union[Unset, list[UpdateRoleDataAttributesIntegrationsPermissionsItem]]): + invitations_permissions (Union[Unset, list[UpdateRoleDataAttributesInvitationsPermissionsItem]]): + playbooks_permissions (Union[Unset, list[UpdateRoleDataAttributesPlaybooksPermissionsItem]]): + private_incidents_permissions (Union[Unset, list[UpdateRoleDataAttributesPrivateIncidentsPermissionsItem]]): + retrospective_permissions (Union[Unset, list[UpdateRoleDataAttributesRetrospectivePermissionsItem]]): + roles_permissions (Union[Unset, list[UpdateRoleDataAttributesRolesPermissionsItem]]): + secrets_permissions (Union[Unset, list[UpdateRoleDataAttributesSecretsPermissionsItem]]): + services_permissions (Union[Unset, list[UpdateRoleDataAttributesServicesPermissionsItem]]): + severities_permissions (Union[Unset, list[UpdateRoleDataAttributesSeveritiesPermissionsItem]]): + status_pages_permissions (Union[Unset, list[UpdateRoleDataAttributesStatusPagesPermissionsItem]]): + webhooks_permissions (Union[Unset, list[UpdateRoleDataAttributesWebhooksPermissionsItem]]): + workflows_permissions (Union[Unset, list[UpdateRoleDataAttributesWorkflowsPermissionsItem]]): + catalogs_permissions (Union[Unset, list[UpdateRoleDataAttributesCatalogsPermissionsItem]]): + sub_statuses_permissions (Union[Unset, list[UpdateRoleDataAttributesSubStatusesPermissionsItem]]): + edge_connector_permissions (Union[Unset, list[UpdateRoleDataAttributesEdgeConnectorPermissionsItem]]): + slas_permissions (Union[Unset, list[UpdateRoleDataAttributesSlasPermissionsItem]]): + paging_permissions (Union[Unset, list[UpdateRoleDataAttributesPagingPermissionsItem]]): + incident_communication_permissions (Union[Unset, + list[UpdateRoleDataAttributesIncidentCommunicationPermissionsItem]]): + communication_permissions (Union[Unset, list[UpdateRoleDataAttributesCommunicationPermissionsItem]]): """ - name: str | Unset = UNSET - incident_permission_set_id: None | str | Unset = UNSET - is_deletable: bool | Unset = UNSET - is_editable: bool | Unset = UNSET - api_keys_permissions: list[UpdateRoleDataAttributesApiKeysPermissionsItem] | Unset = UNSET - audits_permissions: list[UpdateRoleDataAttributesAuditsPermissionsItem] | Unset = UNSET - billing_permissions: list[UpdateRoleDataAttributesBillingPermissionsItem] | Unset = UNSET - environments_permissions: list[UpdateRoleDataAttributesEnvironmentsPermissionsItem] | Unset = UNSET - form_fields_permissions: list[UpdateRoleDataAttributesFormFieldsPermissionsItem] | Unset = UNSET - functionalities_permissions: list[UpdateRoleDataAttributesFunctionalitiesPermissionsItem] | Unset = UNSET - groups_permissions: list[UpdateRoleDataAttributesGroupsPermissionsItem] | Unset = UNSET - incident_causes_permissions: list[UpdateRoleDataAttributesIncidentCausesPermissionsItem] | Unset = UNSET - incident_feedbacks_permissions: list[UpdateRoleDataAttributesIncidentFeedbacksPermissionsItem] | Unset = UNSET - incident_roles_permissions: list[UpdateRoleDataAttributesIncidentRolesPermissionsItem] | Unset = UNSET - incident_types_permissions: list[UpdateRoleDataAttributesIncidentTypesPermissionsItem] | Unset = UNSET - incidents_permissions: list[UpdateRoleDataAttributesIncidentsPermissionsItem] | Unset = UNSET - integrations_permissions: list[UpdateRoleDataAttributesIntegrationsPermissionsItem] | Unset = UNSET - invitations_permissions: list[UpdateRoleDataAttributesInvitationsPermissionsItem] | Unset = UNSET - playbooks_permissions: list[UpdateRoleDataAttributesPlaybooksPermissionsItem] | Unset = UNSET - private_incidents_permissions: list[UpdateRoleDataAttributesPrivateIncidentsPermissionsItem] | Unset = UNSET - retrospective_permissions: list[UpdateRoleDataAttributesRetrospectivePermissionsItem] | Unset = UNSET - roles_permissions: list[UpdateRoleDataAttributesRolesPermissionsItem] | Unset = UNSET - secrets_permissions: list[UpdateRoleDataAttributesSecretsPermissionsItem] | Unset = UNSET - services_permissions: list[UpdateRoleDataAttributesServicesPermissionsItem] | Unset = UNSET - severities_permissions: list[UpdateRoleDataAttributesSeveritiesPermissionsItem] | Unset = UNSET - status_pages_permissions: list[UpdateRoleDataAttributesStatusPagesPermissionsItem] | Unset = UNSET - webhooks_permissions: list[UpdateRoleDataAttributesWebhooksPermissionsItem] | Unset = UNSET - workflows_permissions: list[UpdateRoleDataAttributesWorkflowsPermissionsItem] | Unset = UNSET - catalogs_permissions: list[UpdateRoleDataAttributesCatalogsPermissionsItem] | Unset = UNSET - sub_statuses_permissions: list[UpdateRoleDataAttributesSubStatusesPermissionsItem] | Unset = UNSET - edge_connector_permissions: list[UpdateRoleDataAttributesEdgeConnectorPermissionsItem] | Unset = UNSET - slas_permissions: list[UpdateRoleDataAttributesSlasPermissionsItem] | Unset = UNSET - paging_permissions: list[UpdateRoleDataAttributesPagingPermissionsItem] | Unset = UNSET - incident_communication_permissions: list[UpdateRoleDataAttributesIncidentCommunicationPermissionsItem] | Unset = ( - UNSET - ) - communication_permissions: list[UpdateRoleDataAttributesCommunicationPermissionsItem] | Unset = UNSET + slug: Union[None, Unset, str] = UNSET + name: Union[Unset, str] = UNSET + incident_permission_set_id: Union[None, Unset, str] = UNSET + is_deletable: Union[Unset, bool] = UNSET + is_editable: Union[Unset, bool] = UNSET + api_keys_permissions: Union[Unset, list[UpdateRoleDataAttributesApiKeysPermissionsItem]] = UNSET + audits_permissions: Union[Unset, list[UpdateRoleDataAttributesAuditsPermissionsItem]] = UNSET + billing_permissions: Union[Unset, list[UpdateRoleDataAttributesBillingPermissionsItem]] = UNSET + environments_permissions: Union[Unset, list[UpdateRoleDataAttributesEnvironmentsPermissionsItem]] = UNSET + form_fields_permissions: Union[Unset, list[UpdateRoleDataAttributesFormFieldsPermissionsItem]] = UNSET + functionalities_permissions: Union[Unset, list[UpdateRoleDataAttributesFunctionalitiesPermissionsItem]] = UNSET + groups_permissions: Union[Unset, list[UpdateRoleDataAttributesGroupsPermissionsItem]] = UNSET + incident_causes_permissions: Union[Unset, list[UpdateRoleDataAttributesIncidentCausesPermissionsItem]] = UNSET + incident_feedbacks_permissions: Union[Unset, list[UpdateRoleDataAttributesIncidentFeedbacksPermissionsItem]] = UNSET + incident_roles_permissions: Union[Unset, list[UpdateRoleDataAttributesIncidentRolesPermissionsItem]] = UNSET + incident_types_permissions: Union[Unset, list[UpdateRoleDataAttributesIncidentTypesPermissionsItem]] = UNSET + incidents_permissions: Union[Unset, list[UpdateRoleDataAttributesIncidentsPermissionsItem]] = UNSET + integrations_permissions: Union[Unset, list[UpdateRoleDataAttributesIntegrationsPermissionsItem]] = UNSET + invitations_permissions: Union[Unset, list[UpdateRoleDataAttributesInvitationsPermissionsItem]] = UNSET + playbooks_permissions: Union[Unset, list[UpdateRoleDataAttributesPlaybooksPermissionsItem]] = UNSET + private_incidents_permissions: Union[Unset, list[UpdateRoleDataAttributesPrivateIncidentsPermissionsItem]] = UNSET + retrospective_permissions: Union[Unset, list[UpdateRoleDataAttributesRetrospectivePermissionsItem]] = UNSET + roles_permissions: Union[Unset, list[UpdateRoleDataAttributesRolesPermissionsItem]] = UNSET + secrets_permissions: Union[Unset, list[UpdateRoleDataAttributesSecretsPermissionsItem]] = UNSET + services_permissions: Union[Unset, list[UpdateRoleDataAttributesServicesPermissionsItem]] = UNSET + severities_permissions: Union[Unset, list[UpdateRoleDataAttributesSeveritiesPermissionsItem]] = UNSET + status_pages_permissions: Union[Unset, list[UpdateRoleDataAttributesStatusPagesPermissionsItem]] = UNSET + webhooks_permissions: Union[Unset, list[UpdateRoleDataAttributesWebhooksPermissionsItem]] = UNSET + workflows_permissions: Union[Unset, list[UpdateRoleDataAttributesWorkflowsPermissionsItem]] = UNSET + catalogs_permissions: Union[Unset, list[UpdateRoleDataAttributesCatalogsPermissionsItem]] = UNSET + sub_statuses_permissions: Union[Unset, list[UpdateRoleDataAttributesSubStatusesPermissionsItem]] = UNSET + edge_connector_permissions: Union[Unset, list[UpdateRoleDataAttributesEdgeConnectorPermissionsItem]] = UNSET + slas_permissions: Union[Unset, list[UpdateRoleDataAttributesSlasPermissionsItem]] = UNSET + paging_permissions: Union[Unset, list[UpdateRoleDataAttributesPagingPermissionsItem]] = UNSET + incident_communication_permissions: Union[ + Unset, list[UpdateRoleDataAttributesIncidentCommunicationPermissionsItem] + ] = UNSET + communication_permissions: Union[Unset, list[UpdateRoleDataAttributesCommunicationPermissionsItem]] = UNSET def to_dict(self) -> dict[str, Any]: + slug: Union[None, Unset, str] + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug + name = self.name - incident_permission_set_id: None | str | Unset + incident_permission_set_id: Union[None, Unset, str] if isinstance(self.incident_permission_set_id, Unset): incident_permission_set_id = UNSET else: @@ -226,217 +235,217 @@ def to_dict(self) -> dict[str, Any]: is_editable = self.is_editable - api_keys_permissions: list[str] | Unset = UNSET + api_keys_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.api_keys_permissions, Unset): api_keys_permissions = [] for api_keys_permissions_item_data in self.api_keys_permissions: api_keys_permissions_item: str = api_keys_permissions_item_data api_keys_permissions.append(api_keys_permissions_item) - audits_permissions: list[str] | Unset = UNSET + audits_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.audits_permissions, Unset): audits_permissions = [] for audits_permissions_item_data in self.audits_permissions: audits_permissions_item: str = audits_permissions_item_data audits_permissions.append(audits_permissions_item) - billing_permissions: list[str] | Unset = UNSET + billing_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.billing_permissions, Unset): billing_permissions = [] for billing_permissions_item_data in self.billing_permissions: billing_permissions_item: str = billing_permissions_item_data billing_permissions.append(billing_permissions_item) - environments_permissions: list[str] | Unset = UNSET + environments_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.environments_permissions, Unset): environments_permissions = [] for environments_permissions_item_data in self.environments_permissions: environments_permissions_item: str = environments_permissions_item_data environments_permissions.append(environments_permissions_item) - form_fields_permissions: list[str] | Unset = UNSET + form_fields_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.form_fields_permissions, Unset): form_fields_permissions = [] for form_fields_permissions_item_data in self.form_fields_permissions: form_fields_permissions_item: str = form_fields_permissions_item_data form_fields_permissions.append(form_fields_permissions_item) - functionalities_permissions: list[str] | Unset = UNSET + functionalities_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.functionalities_permissions, Unset): functionalities_permissions = [] for functionalities_permissions_item_data in self.functionalities_permissions: functionalities_permissions_item: str = functionalities_permissions_item_data functionalities_permissions.append(functionalities_permissions_item) - groups_permissions: list[str] | Unset = UNSET + groups_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.groups_permissions, Unset): groups_permissions = [] for groups_permissions_item_data in self.groups_permissions: groups_permissions_item: str = groups_permissions_item_data groups_permissions.append(groups_permissions_item) - incident_causes_permissions: list[str] | Unset = UNSET + incident_causes_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.incident_causes_permissions, Unset): incident_causes_permissions = [] for incident_causes_permissions_item_data in self.incident_causes_permissions: incident_causes_permissions_item: str = incident_causes_permissions_item_data incident_causes_permissions.append(incident_causes_permissions_item) - incident_feedbacks_permissions: list[str] | Unset = UNSET + incident_feedbacks_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.incident_feedbacks_permissions, Unset): incident_feedbacks_permissions = [] for incident_feedbacks_permissions_item_data in self.incident_feedbacks_permissions: incident_feedbacks_permissions_item: str = incident_feedbacks_permissions_item_data incident_feedbacks_permissions.append(incident_feedbacks_permissions_item) - incident_roles_permissions: list[str] | Unset = UNSET + incident_roles_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.incident_roles_permissions, Unset): incident_roles_permissions = [] for incident_roles_permissions_item_data in self.incident_roles_permissions: incident_roles_permissions_item: str = incident_roles_permissions_item_data incident_roles_permissions.append(incident_roles_permissions_item) - incident_types_permissions: list[str] | Unset = UNSET + incident_types_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.incident_types_permissions, Unset): incident_types_permissions = [] for incident_types_permissions_item_data in self.incident_types_permissions: incident_types_permissions_item: str = incident_types_permissions_item_data incident_types_permissions.append(incident_types_permissions_item) - incidents_permissions: list[str] | Unset = UNSET + incidents_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.incidents_permissions, Unset): incidents_permissions = [] for incidents_permissions_item_data in self.incidents_permissions: incidents_permissions_item: str = incidents_permissions_item_data incidents_permissions.append(incidents_permissions_item) - integrations_permissions: list[str] | Unset = UNSET + integrations_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.integrations_permissions, Unset): integrations_permissions = [] for integrations_permissions_item_data in self.integrations_permissions: integrations_permissions_item: str = integrations_permissions_item_data integrations_permissions.append(integrations_permissions_item) - invitations_permissions: list[str] | Unset = UNSET + invitations_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.invitations_permissions, Unset): invitations_permissions = [] for invitations_permissions_item_data in self.invitations_permissions: invitations_permissions_item: str = invitations_permissions_item_data invitations_permissions.append(invitations_permissions_item) - playbooks_permissions: list[str] | Unset = UNSET + playbooks_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.playbooks_permissions, Unset): playbooks_permissions = [] for playbooks_permissions_item_data in self.playbooks_permissions: playbooks_permissions_item: str = playbooks_permissions_item_data playbooks_permissions.append(playbooks_permissions_item) - private_incidents_permissions: list[str] | Unset = UNSET + private_incidents_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.private_incidents_permissions, Unset): private_incidents_permissions = [] for private_incidents_permissions_item_data in self.private_incidents_permissions: private_incidents_permissions_item: str = private_incidents_permissions_item_data private_incidents_permissions.append(private_incidents_permissions_item) - retrospective_permissions: list[str] | Unset = UNSET + retrospective_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.retrospective_permissions, Unset): retrospective_permissions = [] for retrospective_permissions_item_data in self.retrospective_permissions: retrospective_permissions_item: str = retrospective_permissions_item_data retrospective_permissions.append(retrospective_permissions_item) - roles_permissions: list[str] | Unset = UNSET + roles_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.roles_permissions, Unset): roles_permissions = [] for roles_permissions_item_data in self.roles_permissions: roles_permissions_item: str = roles_permissions_item_data roles_permissions.append(roles_permissions_item) - secrets_permissions: list[str] | Unset = UNSET + secrets_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.secrets_permissions, Unset): secrets_permissions = [] for secrets_permissions_item_data in self.secrets_permissions: secrets_permissions_item: str = secrets_permissions_item_data secrets_permissions.append(secrets_permissions_item) - services_permissions: list[str] | Unset = UNSET + services_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.services_permissions, Unset): services_permissions = [] for services_permissions_item_data in self.services_permissions: services_permissions_item: str = services_permissions_item_data services_permissions.append(services_permissions_item) - severities_permissions: list[str] | Unset = UNSET + severities_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.severities_permissions, Unset): severities_permissions = [] for severities_permissions_item_data in self.severities_permissions: severities_permissions_item: str = severities_permissions_item_data severities_permissions.append(severities_permissions_item) - status_pages_permissions: list[str] | Unset = UNSET + status_pages_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.status_pages_permissions, Unset): status_pages_permissions = [] for status_pages_permissions_item_data in self.status_pages_permissions: status_pages_permissions_item: str = status_pages_permissions_item_data status_pages_permissions.append(status_pages_permissions_item) - webhooks_permissions: list[str] | Unset = UNSET + webhooks_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.webhooks_permissions, Unset): webhooks_permissions = [] for webhooks_permissions_item_data in self.webhooks_permissions: webhooks_permissions_item: str = webhooks_permissions_item_data webhooks_permissions.append(webhooks_permissions_item) - workflows_permissions: list[str] | Unset = UNSET + workflows_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.workflows_permissions, Unset): workflows_permissions = [] for workflows_permissions_item_data in self.workflows_permissions: workflows_permissions_item: str = workflows_permissions_item_data workflows_permissions.append(workflows_permissions_item) - catalogs_permissions: list[str] | Unset = UNSET + catalogs_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.catalogs_permissions, Unset): catalogs_permissions = [] for catalogs_permissions_item_data in self.catalogs_permissions: catalogs_permissions_item: str = catalogs_permissions_item_data catalogs_permissions.append(catalogs_permissions_item) - sub_statuses_permissions: list[str] | Unset = UNSET + sub_statuses_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.sub_statuses_permissions, Unset): sub_statuses_permissions = [] for sub_statuses_permissions_item_data in self.sub_statuses_permissions: sub_statuses_permissions_item: str = sub_statuses_permissions_item_data sub_statuses_permissions.append(sub_statuses_permissions_item) - edge_connector_permissions: list[str] | Unset = UNSET + edge_connector_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.edge_connector_permissions, Unset): edge_connector_permissions = [] for edge_connector_permissions_item_data in self.edge_connector_permissions: edge_connector_permissions_item: str = edge_connector_permissions_item_data edge_connector_permissions.append(edge_connector_permissions_item) - slas_permissions: list[str] | Unset = UNSET + slas_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.slas_permissions, Unset): slas_permissions = [] for slas_permissions_item_data in self.slas_permissions: slas_permissions_item: str = slas_permissions_item_data slas_permissions.append(slas_permissions_item) - paging_permissions: list[str] | Unset = UNSET + paging_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.paging_permissions, Unset): paging_permissions = [] for paging_permissions_item_data in self.paging_permissions: paging_permissions_item: str = paging_permissions_item_data paging_permissions.append(paging_permissions_item) - incident_communication_permissions: list[str] | Unset = UNSET + incident_communication_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.incident_communication_permissions, Unset): incident_communication_permissions = [] for incident_communication_permissions_item_data in self.incident_communication_permissions: incident_communication_permissions_item: str = incident_communication_permissions_item_data incident_communication_permissions.append(incident_communication_permissions_item) - communication_permissions: list[str] | Unset = UNSET + communication_permissions: Union[Unset, list[str]] = UNSET if not isinstance(self.communication_permissions, Unset): communication_permissions = [] for communication_permissions_item_data in self.communication_permissions: @@ -446,6 +455,8 @@ def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} field_dict.update({}) + if slug is not UNSET: + field_dict["slug"] = slug if name is not UNSET: field_dict["name"] = name if incident_permission_set_id is not UNSET: @@ -522,14 +533,24 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) + + def _parse_slug(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + slug = _parse_slug(d.pop("slug", UNSET)) + name = d.pop("name", UNSET) - def _parse_incident_permission_set_id(data: object) -> None | str | Unset: + def _parse_incident_permission_set_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) incident_permission_set_id = _parse_incident_permission_set_id(d.pop("incident_permission_set_id", UNSET)) @@ -537,356 +558,287 @@ def _parse_incident_permission_set_id(data: object) -> None | str | Unset: is_editable = d.pop("is_editable", UNSET) + api_keys_permissions = [] _api_keys_permissions = d.pop("api_keys_permissions", UNSET) - api_keys_permissions: list[UpdateRoleDataAttributesApiKeysPermissionsItem] | Unset = UNSET - if _api_keys_permissions is not UNSET: - api_keys_permissions = [] - for api_keys_permissions_item_data in _api_keys_permissions: - api_keys_permissions_item = check_update_role_data_attributes_api_keys_permissions_item( - api_keys_permissions_item_data - ) + for api_keys_permissions_item_data in _api_keys_permissions or []: + api_keys_permissions_item = check_update_role_data_attributes_api_keys_permissions_item( + api_keys_permissions_item_data + ) - api_keys_permissions.append(api_keys_permissions_item) + api_keys_permissions.append(api_keys_permissions_item) + audits_permissions = [] _audits_permissions = d.pop("audits_permissions", UNSET) - audits_permissions: list[UpdateRoleDataAttributesAuditsPermissionsItem] | Unset = UNSET - if _audits_permissions is not UNSET: - audits_permissions = [] - for audits_permissions_item_data in _audits_permissions: - audits_permissions_item = check_update_role_data_attributes_audits_permissions_item( - audits_permissions_item_data - ) + for audits_permissions_item_data in _audits_permissions or []: + audits_permissions_item = check_update_role_data_attributes_audits_permissions_item( + audits_permissions_item_data + ) - audits_permissions.append(audits_permissions_item) + audits_permissions.append(audits_permissions_item) + billing_permissions = [] _billing_permissions = d.pop("billing_permissions", UNSET) - billing_permissions: list[UpdateRoleDataAttributesBillingPermissionsItem] | Unset = UNSET - if _billing_permissions is not UNSET: - billing_permissions = [] - for billing_permissions_item_data in _billing_permissions: - billing_permissions_item = check_update_role_data_attributes_billing_permissions_item( - billing_permissions_item_data - ) + for billing_permissions_item_data in _billing_permissions or []: + billing_permissions_item = check_update_role_data_attributes_billing_permissions_item( + billing_permissions_item_data + ) - billing_permissions.append(billing_permissions_item) + billing_permissions.append(billing_permissions_item) + environments_permissions = [] _environments_permissions = d.pop("environments_permissions", UNSET) - environments_permissions: list[UpdateRoleDataAttributesEnvironmentsPermissionsItem] | Unset = UNSET - if _environments_permissions is not UNSET: - environments_permissions = [] - for environments_permissions_item_data in _environments_permissions: - environments_permissions_item = check_update_role_data_attributes_environments_permissions_item( - environments_permissions_item_data - ) + for environments_permissions_item_data in _environments_permissions or []: + environments_permissions_item = check_update_role_data_attributes_environments_permissions_item( + environments_permissions_item_data + ) - environments_permissions.append(environments_permissions_item) + environments_permissions.append(environments_permissions_item) + form_fields_permissions = [] _form_fields_permissions = d.pop("form_fields_permissions", UNSET) - form_fields_permissions: list[UpdateRoleDataAttributesFormFieldsPermissionsItem] | Unset = UNSET - if _form_fields_permissions is not UNSET: - form_fields_permissions = [] - for form_fields_permissions_item_data in _form_fields_permissions: - form_fields_permissions_item = check_update_role_data_attributes_form_fields_permissions_item( - form_fields_permissions_item_data - ) + for form_fields_permissions_item_data in _form_fields_permissions or []: + form_fields_permissions_item = check_update_role_data_attributes_form_fields_permissions_item( + form_fields_permissions_item_data + ) - form_fields_permissions.append(form_fields_permissions_item) + form_fields_permissions.append(form_fields_permissions_item) + functionalities_permissions = [] _functionalities_permissions = d.pop("functionalities_permissions", UNSET) - functionalities_permissions: list[UpdateRoleDataAttributesFunctionalitiesPermissionsItem] | Unset = UNSET - if _functionalities_permissions is not UNSET: - functionalities_permissions = [] - for functionalities_permissions_item_data in _functionalities_permissions: - functionalities_permissions_item = check_update_role_data_attributes_functionalities_permissions_item( - functionalities_permissions_item_data - ) + for functionalities_permissions_item_data in _functionalities_permissions or []: + functionalities_permissions_item = check_update_role_data_attributes_functionalities_permissions_item( + functionalities_permissions_item_data + ) - functionalities_permissions.append(functionalities_permissions_item) + functionalities_permissions.append(functionalities_permissions_item) + groups_permissions = [] _groups_permissions = d.pop("groups_permissions", UNSET) - groups_permissions: list[UpdateRoleDataAttributesGroupsPermissionsItem] | Unset = UNSET - if _groups_permissions is not UNSET: - groups_permissions = [] - for groups_permissions_item_data in _groups_permissions: - groups_permissions_item = check_update_role_data_attributes_groups_permissions_item( - groups_permissions_item_data - ) + for groups_permissions_item_data in _groups_permissions or []: + groups_permissions_item = check_update_role_data_attributes_groups_permissions_item( + groups_permissions_item_data + ) - groups_permissions.append(groups_permissions_item) + groups_permissions.append(groups_permissions_item) + incident_causes_permissions = [] _incident_causes_permissions = d.pop("incident_causes_permissions", UNSET) - incident_causes_permissions: list[UpdateRoleDataAttributesIncidentCausesPermissionsItem] | Unset = UNSET - if _incident_causes_permissions is not UNSET: - incident_causes_permissions = [] - for incident_causes_permissions_item_data in _incident_causes_permissions: - incident_causes_permissions_item = check_update_role_data_attributes_incident_causes_permissions_item( - incident_causes_permissions_item_data - ) + for incident_causes_permissions_item_data in _incident_causes_permissions or []: + incident_causes_permissions_item = check_update_role_data_attributes_incident_causes_permissions_item( + incident_causes_permissions_item_data + ) - incident_causes_permissions.append(incident_causes_permissions_item) + incident_causes_permissions.append(incident_causes_permissions_item) + incident_feedbacks_permissions = [] _incident_feedbacks_permissions = d.pop("incident_feedbacks_permissions", UNSET) - incident_feedbacks_permissions: list[UpdateRoleDataAttributesIncidentFeedbacksPermissionsItem] | Unset = UNSET - if _incident_feedbacks_permissions is not UNSET: - incident_feedbacks_permissions = [] - for incident_feedbacks_permissions_item_data in _incident_feedbacks_permissions: - incident_feedbacks_permissions_item = ( - check_update_role_data_attributes_incident_feedbacks_permissions_item( - incident_feedbacks_permissions_item_data - ) - ) + for incident_feedbacks_permissions_item_data in _incident_feedbacks_permissions or []: + incident_feedbacks_permissions_item = check_update_role_data_attributes_incident_feedbacks_permissions_item( + incident_feedbacks_permissions_item_data + ) - incident_feedbacks_permissions.append(incident_feedbacks_permissions_item) + incident_feedbacks_permissions.append(incident_feedbacks_permissions_item) + incident_roles_permissions = [] _incident_roles_permissions = d.pop("incident_roles_permissions", UNSET) - incident_roles_permissions: list[UpdateRoleDataAttributesIncidentRolesPermissionsItem] | Unset = UNSET - if _incident_roles_permissions is not UNSET: - incident_roles_permissions = [] - for incident_roles_permissions_item_data in _incident_roles_permissions: - incident_roles_permissions_item = check_update_role_data_attributes_incident_roles_permissions_item( - incident_roles_permissions_item_data - ) + for incident_roles_permissions_item_data in _incident_roles_permissions or []: + incident_roles_permissions_item = check_update_role_data_attributes_incident_roles_permissions_item( + incident_roles_permissions_item_data + ) - incident_roles_permissions.append(incident_roles_permissions_item) + incident_roles_permissions.append(incident_roles_permissions_item) + incident_types_permissions = [] _incident_types_permissions = d.pop("incident_types_permissions", UNSET) - incident_types_permissions: list[UpdateRoleDataAttributesIncidentTypesPermissionsItem] | Unset = UNSET - if _incident_types_permissions is not UNSET: - incident_types_permissions = [] - for incident_types_permissions_item_data in _incident_types_permissions: - incident_types_permissions_item = check_update_role_data_attributes_incident_types_permissions_item( - incident_types_permissions_item_data - ) + for incident_types_permissions_item_data in _incident_types_permissions or []: + incident_types_permissions_item = check_update_role_data_attributes_incident_types_permissions_item( + incident_types_permissions_item_data + ) - incident_types_permissions.append(incident_types_permissions_item) + incident_types_permissions.append(incident_types_permissions_item) + incidents_permissions = [] _incidents_permissions = d.pop("incidents_permissions", UNSET) - incidents_permissions: list[UpdateRoleDataAttributesIncidentsPermissionsItem] | Unset = UNSET - if _incidents_permissions is not UNSET: - incidents_permissions = [] - for incidents_permissions_item_data in _incidents_permissions: - incidents_permissions_item = check_update_role_data_attributes_incidents_permissions_item( - incidents_permissions_item_data - ) + for incidents_permissions_item_data in _incidents_permissions or []: + incidents_permissions_item = check_update_role_data_attributes_incidents_permissions_item( + incidents_permissions_item_data + ) - incidents_permissions.append(incidents_permissions_item) + incidents_permissions.append(incidents_permissions_item) + integrations_permissions = [] _integrations_permissions = d.pop("integrations_permissions", UNSET) - integrations_permissions: list[UpdateRoleDataAttributesIntegrationsPermissionsItem] | Unset = UNSET - if _integrations_permissions is not UNSET: - integrations_permissions = [] - for integrations_permissions_item_data in _integrations_permissions: - integrations_permissions_item = check_update_role_data_attributes_integrations_permissions_item( - integrations_permissions_item_data - ) + for integrations_permissions_item_data in _integrations_permissions or []: + integrations_permissions_item = check_update_role_data_attributes_integrations_permissions_item( + integrations_permissions_item_data + ) - integrations_permissions.append(integrations_permissions_item) + integrations_permissions.append(integrations_permissions_item) + invitations_permissions = [] _invitations_permissions = d.pop("invitations_permissions", UNSET) - invitations_permissions: list[UpdateRoleDataAttributesInvitationsPermissionsItem] | Unset = UNSET - if _invitations_permissions is not UNSET: - invitations_permissions = [] - for invitations_permissions_item_data in _invitations_permissions: - invitations_permissions_item = check_update_role_data_attributes_invitations_permissions_item( - invitations_permissions_item_data - ) + for invitations_permissions_item_data in _invitations_permissions or []: + invitations_permissions_item = check_update_role_data_attributes_invitations_permissions_item( + invitations_permissions_item_data + ) - invitations_permissions.append(invitations_permissions_item) + invitations_permissions.append(invitations_permissions_item) + playbooks_permissions = [] _playbooks_permissions = d.pop("playbooks_permissions", UNSET) - playbooks_permissions: list[UpdateRoleDataAttributesPlaybooksPermissionsItem] | Unset = UNSET - if _playbooks_permissions is not UNSET: - playbooks_permissions = [] - for playbooks_permissions_item_data in _playbooks_permissions: - playbooks_permissions_item = check_update_role_data_attributes_playbooks_permissions_item( - playbooks_permissions_item_data - ) + for playbooks_permissions_item_data in _playbooks_permissions or []: + playbooks_permissions_item = check_update_role_data_attributes_playbooks_permissions_item( + playbooks_permissions_item_data + ) - playbooks_permissions.append(playbooks_permissions_item) + playbooks_permissions.append(playbooks_permissions_item) + private_incidents_permissions = [] _private_incidents_permissions = d.pop("private_incidents_permissions", UNSET) - private_incidents_permissions: list[UpdateRoleDataAttributesPrivateIncidentsPermissionsItem] | Unset = UNSET - if _private_incidents_permissions is not UNSET: - private_incidents_permissions = [] - for private_incidents_permissions_item_data in _private_incidents_permissions: - private_incidents_permissions_item = ( - check_update_role_data_attributes_private_incidents_permissions_item( - private_incidents_permissions_item_data - ) - ) + for private_incidents_permissions_item_data in _private_incidents_permissions or []: + private_incidents_permissions_item = check_update_role_data_attributes_private_incidents_permissions_item( + private_incidents_permissions_item_data + ) - private_incidents_permissions.append(private_incidents_permissions_item) + private_incidents_permissions.append(private_incidents_permissions_item) + retrospective_permissions = [] _retrospective_permissions = d.pop("retrospective_permissions", UNSET) - retrospective_permissions: list[UpdateRoleDataAttributesRetrospectivePermissionsItem] | Unset = UNSET - if _retrospective_permissions is not UNSET: - retrospective_permissions = [] - for retrospective_permissions_item_data in _retrospective_permissions: - retrospective_permissions_item = check_update_role_data_attributes_retrospective_permissions_item( - retrospective_permissions_item_data - ) + for retrospective_permissions_item_data in _retrospective_permissions or []: + retrospective_permissions_item = check_update_role_data_attributes_retrospective_permissions_item( + retrospective_permissions_item_data + ) - retrospective_permissions.append(retrospective_permissions_item) + retrospective_permissions.append(retrospective_permissions_item) + roles_permissions = [] _roles_permissions = d.pop("roles_permissions", UNSET) - roles_permissions: list[UpdateRoleDataAttributesRolesPermissionsItem] | Unset = UNSET - if _roles_permissions is not UNSET: - roles_permissions = [] - for roles_permissions_item_data in _roles_permissions: - roles_permissions_item = check_update_role_data_attributes_roles_permissions_item( - roles_permissions_item_data - ) + for roles_permissions_item_data in _roles_permissions or []: + roles_permissions_item = check_update_role_data_attributes_roles_permissions_item( + roles_permissions_item_data + ) - roles_permissions.append(roles_permissions_item) + roles_permissions.append(roles_permissions_item) + secrets_permissions = [] _secrets_permissions = d.pop("secrets_permissions", UNSET) - secrets_permissions: list[UpdateRoleDataAttributesSecretsPermissionsItem] | Unset = UNSET - if _secrets_permissions is not UNSET: - secrets_permissions = [] - for secrets_permissions_item_data in _secrets_permissions: - secrets_permissions_item = check_update_role_data_attributes_secrets_permissions_item( - secrets_permissions_item_data - ) + for secrets_permissions_item_data in _secrets_permissions or []: + secrets_permissions_item = check_update_role_data_attributes_secrets_permissions_item( + secrets_permissions_item_data + ) - secrets_permissions.append(secrets_permissions_item) + secrets_permissions.append(secrets_permissions_item) + services_permissions = [] _services_permissions = d.pop("services_permissions", UNSET) - services_permissions: list[UpdateRoleDataAttributesServicesPermissionsItem] | Unset = UNSET - if _services_permissions is not UNSET: - services_permissions = [] - for services_permissions_item_data in _services_permissions: - services_permissions_item = check_update_role_data_attributes_services_permissions_item( - services_permissions_item_data - ) + for services_permissions_item_data in _services_permissions or []: + services_permissions_item = check_update_role_data_attributes_services_permissions_item( + services_permissions_item_data + ) - services_permissions.append(services_permissions_item) + services_permissions.append(services_permissions_item) + severities_permissions = [] _severities_permissions = d.pop("severities_permissions", UNSET) - severities_permissions: list[UpdateRoleDataAttributesSeveritiesPermissionsItem] | Unset = UNSET - if _severities_permissions is not UNSET: - severities_permissions = [] - for severities_permissions_item_data in _severities_permissions: - severities_permissions_item = check_update_role_data_attributes_severities_permissions_item( - severities_permissions_item_data - ) + for severities_permissions_item_data in _severities_permissions or []: + severities_permissions_item = check_update_role_data_attributes_severities_permissions_item( + severities_permissions_item_data + ) - severities_permissions.append(severities_permissions_item) + severities_permissions.append(severities_permissions_item) + status_pages_permissions = [] _status_pages_permissions = d.pop("status_pages_permissions", UNSET) - status_pages_permissions: list[UpdateRoleDataAttributesStatusPagesPermissionsItem] | Unset = UNSET - if _status_pages_permissions is not UNSET: - status_pages_permissions = [] - for status_pages_permissions_item_data in _status_pages_permissions: - status_pages_permissions_item = check_update_role_data_attributes_status_pages_permissions_item( - status_pages_permissions_item_data - ) + for status_pages_permissions_item_data in _status_pages_permissions or []: + status_pages_permissions_item = check_update_role_data_attributes_status_pages_permissions_item( + status_pages_permissions_item_data + ) - status_pages_permissions.append(status_pages_permissions_item) + status_pages_permissions.append(status_pages_permissions_item) + webhooks_permissions = [] _webhooks_permissions = d.pop("webhooks_permissions", UNSET) - webhooks_permissions: list[UpdateRoleDataAttributesWebhooksPermissionsItem] | Unset = UNSET - if _webhooks_permissions is not UNSET: - webhooks_permissions = [] - for webhooks_permissions_item_data in _webhooks_permissions: - webhooks_permissions_item = check_update_role_data_attributes_webhooks_permissions_item( - webhooks_permissions_item_data - ) + for webhooks_permissions_item_data in _webhooks_permissions or []: + webhooks_permissions_item = check_update_role_data_attributes_webhooks_permissions_item( + webhooks_permissions_item_data + ) - webhooks_permissions.append(webhooks_permissions_item) + webhooks_permissions.append(webhooks_permissions_item) + workflows_permissions = [] _workflows_permissions = d.pop("workflows_permissions", UNSET) - workflows_permissions: list[UpdateRoleDataAttributesWorkflowsPermissionsItem] | Unset = UNSET - if _workflows_permissions is not UNSET: - workflows_permissions = [] - for workflows_permissions_item_data in _workflows_permissions: - workflows_permissions_item = check_update_role_data_attributes_workflows_permissions_item( - workflows_permissions_item_data - ) + for workflows_permissions_item_data in _workflows_permissions or []: + workflows_permissions_item = check_update_role_data_attributes_workflows_permissions_item( + workflows_permissions_item_data + ) - workflows_permissions.append(workflows_permissions_item) + workflows_permissions.append(workflows_permissions_item) + catalogs_permissions = [] _catalogs_permissions = d.pop("catalogs_permissions", UNSET) - catalogs_permissions: list[UpdateRoleDataAttributesCatalogsPermissionsItem] | Unset = UNSET - if _catalogs_permissions is not UNSET: - catalogs_permissions = [] - for catalogs_permissions_item_data in _catalogs_permissions: - catalogs_permissions_item = check_update_role_data_attributes_catalogs_permissions_item( - catalogs_permissions_item_data - ) + for catalogs_permissions_item_data in _catalogs_permissions or []: + catalogs_permissions_item = check_update_role_data_attributes_catalogs_permissions_item( + catalogs_permissions_item_data + ) - catalogs_permissions.append(catalogs_permissions_item) + catalogs_permissions.append(catalogs_permissions_item) + sub_statuses_permissions = [] _sub_statuses_permissions = d.pop("sub_statuses_permissions", UNSET) - sub_statuses_permissions: list[UpdateRoleDataAttributesSubStatusesPermissionsItem] | Unset = UNSET - if _sub_statuses_permissions is not UNSET: - sub_statuses_permissions = [] - for sub_statuses_permissions_item_data in _sub_statuses_permissions: - sub_statuses_permissions_item = check_update_role_data_attributes_sub_statuses_permissions_item( - sub_statuses_permissions_item_data - ) + for sub_statuses_permissions_item_data in _sub_statuses_permissions or []: + sub_statuses_permissions_item = check_update_role_data_attributes_sub_statuses_permissions_item( + sub_statuses_permissions_item_data + ) - sub_statuses_permissions.append(sub_statuses_permissions_item) + sub_statuses_permissions.append(sub_statuses_permissions_item) + edge_connector_permissions = [] _edge_connector_permissions = d.pop("edge_connector_permissions", UNSET) - edge_connector_permissions: list[UpdateRoleDataAttributesEdgeConnectorPermissionsItem] | Unset = UNSET - if _edge_connector_permissions is not UNSET: - edge_connector_permissions = [] - for edge_connector_permissions_item_data in _edge_connector_permissions: - edge_connector_permissions_item = check_update_role_data_attributes_edge_connector_permissions_item( - edge_connector_permissions_item_data - ) + for edge_connector_permissions_item_data in _edge_connector_permissions or []: + edge_connector_permissions_item = check_update_role_data_attributes_edge_connector_permissions_item( + edge_connector_permissions_item_data + ) - edge_connector_permissions.append(edge_connector_permissions_item) + edge_connector_permissions.append(edge_connector_permissions_item) + slas_permissions = [] _slas_permissions = d.pop("slas_permissions", UNSET) - slas_permissions: list[UpdateRoleDataAttributesSlasPermissionsItem] | Unset = UNSET - if _slas_permissions is not UNSET: - slas_permissions = [] - for slas_permissions_item_data in _slas_permissions: - slas_permissions_item = check_update_role_data_attributes_slas_permissions_item( - slas_permissions_item_data - ) + for slas_permissions_item_data in _slas_permissions or []: + slas_permissions_item = check_update_role_data_attributes_slas_permissions_item(slas_permissions_item_data) - slas_permissions.append(slas_permissions_item) + slas_permissions.append(slas_permissions_item) + paging_permissions = [] _paging_permissions = d.pop("paging_permissions", UNSET) - paging_permissions: list[UpdateRoleDataAttributesPagingPermissionsItem] | Unset = UNSET - if _paging_permissions is not UNSET: - paging_permissions = [] - for paging_permissions_item_data in _paging_permissions: - paging_permissions_item = check_update_role_data_attributes_paging_permissions_item( - paging_permissions_item_data - ) + for paging_permissions_item_data in _paging_permissions or []: + paging_permissions_item = check_update_role_data_attributes_paging_permissions_item( + paging_permissions_item_data + ) - paging_permissions.append(paging_permissions_item) + paging_permissions.append(paging_permissions_item) + incident_communication_permissions = [] _incident_communication_permissions = d.pop("incident_communication_permissions", UNSET) - incident_communication_permissions: ( - list[UpdateRoleDataAttributesIncidentCommunicationPermissionsItem] | Unset - ) = UNSET - if _incident_communication_permissions is not UNSET: - incident_communication_permissions = [] - for incident_communication_permissions_item_data in _incident_communication_permissions: - incident_communication_permissions_item = ( - check_update_role_data_attributes_incident_communication_permissions_item( - incident_communication_permissions_item_data - ) + for incident_communication_permissions_item_data in _incident_communication_permissions or []: + incident_communication_permissions_item = ( + check_update_role_data_attributes_incident_communication_permissions_item( + incident_communication_permissions_item_data ) + ) - incident_communication_permissions.append(incident_communication_permissions_item) + incident_communication_permissions.append(incident_communication_permissions_item) + communication_permissions = [] _communication_permissions = d.pop("communication_permissions", UNSET) - communication_permissions: list[UpdateRoleDataAttributesCommunicationPermissionsItem] | Unset = UNSET - if _communication_permissions is not UNSET: - communication_permissions = [] - for communication_permissions_item_data in _communication_permissions: - communication_permissions_item = check_update_role_data_attributes_communication_permissions_item( - communication_permissions_item_data - ) + for communication_permissions_item_data in _communication_permissions or []: + communication_permissions_item = check_update_role_data_attributes_communication_permissions_item( + communication_permissions_item_data + ) - communication_permissions.append(communication_permissions_item) + communication_permissions.append(communication_permissions_item) update_role_data_attributes = cls( + slug=slug, name=name, incident_permission_set_id=incident_permission_set_id, is_deletable=is_deletable, diff --git a/rootly_sdk/models/update_schedule.py b/rootly_sdk/models/update_schedule.py index ad2083f3..102bd7ae 100644 --- a/rootly_sdk/models/update_schedule.py +++ b/rootly_sdk/models/update_schedule.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateSchedule: data (UpdateScheduleData): """ - data: UpdateScheduleData + data: "UpdateScheduleData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_schedule_data.py b/rootly_sdk/models/update_schedule_data.py index 4cbf9034..58501025 100644 --- a/rootly_sdk/models/update_schedule_data.py +++ b/rootly_sdk/models/update_schedule_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class UpdateScheduleData: """ type_: UpdateScheduleDataType - attributes: UpdateScheduleDataAttributes + attributes: "UpdateScheduleDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_schedule_data_attributes.py b/rootly_sdk/models/update_schedule_data_attributes.py index a8609097..33e9e293 100644 --- a/rootly_sdk/models/update_schedule_data_attributes.py +++ b/rootly_sdk/models/update_schedule_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -25,45 +23,45 @@ class UpdateScheduleDataAttributes: """ Attributes: - name (str | Unset): The name of the schedule - description (None | str | Unset): The description of the schedule - all_time_coverage (bool | None | Unset): 24/7 coverage of the schedule - slack_user_group (UpdateScheduleDataAttributesSlackUserGroup | Unset): - slack_channel (None | Unset | UpdateScheduleDataAttributesSlackChannelType0): - owner_group_ids (list[str] | Unset): Owning teams. - owner_user_id (int | None | Unset): ID of the owner of the schedule - sync_linear_enabled (bool | None | Unset): Whether the schedule is synced with Linear - include_shadows_in_slack_notifications (bool | None | Unset): Whether shadow users are included in Slack + name (Union[Unset, str]): The name of the schedule + description (Union[None, Unset, str]): The description of the schedule + all_time_coverage (Union[None, Unset, bool]): 24/7 coverage of the schedule + slack_user_group (Union[Unset, UpdateScheduleDataAttributesSlackUserGroup]): + slack_channel (Union['UpdateScheduleDataAttributesSlackChannelType0', None, Unset]): + owner_group_ids (Union[Unset, list[str]]): Owning teams. + owner_user_id (Union[None, Unset, int]): ID of the owner of the schedule + sync_linear_enabled (Union[None, Unset, bool]): Whether the schedule is synced with Linear + include_shadows_in_slack_notifications (Union[None, Unset, bool]): Whether shadow users are included in Slack notifications and user group syncing. Requires `slack_channel` to be set; otherwise this value is forced to false on save. - shift_start_notifications_enabled (bool | None | Unset): Whether shift-start notifications are enabled. Requires - `slack_channel` to be set; otherwise this value is forced to false on save. - shift_update_notifications_enabled (bool | None | Unset): Whether shift-update notifications are enabled. + shift_start_notifications_enabled (Union[None, Unset, bool]): Whether shift-start notifications are enabled. + Requires `slack_channel` to be set; otherwise this value is forced to false on save. + shift_update_notifications_enabled (Union[None, Unset, bool]): Whether shift-update notifications are enabled. Requires `slack_channel` to be set; otherwise this value is forced to false on save. - shift_report_enabled (bool | None | Unset): Whether the weekly shift summary report is enabled. Requires + shift_report_enabled (Union[None, Unset, bool]): Whether the weekly shift summary report is enabled. Requires `slack_channel` to be set; otherwise this value is forced to false on save. - shift_report_day_of_week (UpdateScheduleDataAttributesShiftReportDayOfWeek | Unset): Day of week the weekly - shift summary is sent - shift_report_time_of_day (None | str | Unset): Time of day the weekly shift summary is sent, in HH:MM 24-hour - format - shift_report_time_zone (None | str | Unset): IANA time zone used for the weekly shift summary + shift_report_day_of_week (Union[Unset, UpdateScheduleDataAttributesShiftReportDayOfWeek]): Day of week the + weekly shift summary is sent + shift_report_time_of_day (Union[None, Unset, str]): Time of day the weekly shift summary is sent, in HH:MM + 24-hour format + shift_report_time_zone (Union[None, Unset, str]): IANA time zone used for the weekly shift summary """ - name: str | Unset = UNSET - description: None | str | Unset = UNSET - all_time_coverage: bool | None | Unset = UNSET - slack_user_group: UpdateScheduleDataAttributesSlackUserGroup | Unset = UNSET - slack_channel: None | Unset | UpdateScheduleDataAttributesSlackChannelType0 = UNSET - owner_group_ids: list[str] | Unset = UNSET - owner_user_id: int | None | Unset = UNSET - sync_linear_enabled: bool | None | Unset = UNSET - include_shadows_in_slack_notifications: bool | None | Unset = UNSET - shift_start_notifications_enabled: bool | None | Unset = UNSET - shift_update_notifications_enabled: bool | None | Unset = UNSET - shift_report_enabled: bool | None | Unset = UNSET - shift_report_day_of_week: UpdateScheduleDataAttributesShiftReportDayOfWeek | Unset = UNSET - shift_report_time_of_day: None | str | Unset = UNSET - shift_report_time_zone: None | str | Unset = UNSET + name: Union[Unset, str] = UNSET + description: Union[None, Unset, str] = UNSET + all_time_coverage: Union[None, Unset, bool] = UNSET + slack_user_group: Union[Unset, "UpdateScheduleDataAttributesSlackUserGroup"] = UNSET + slack_channel: Union["UpdateScheduleDataAttributesSlackChannelType0", None, Unset] = UNSET + owner_group_ids: Union[Unset, list[str]] = UNSET + owner_user_id: Union[None, Unset, int] = UNSET + sync_linear_enabled: Union[None, Unset, bool] = UNSET + include_shadows_in_slack_notifications: Union[None, Unset, bool] = UNSET + shift_start_notifications_enabled: Union[None, Unset, bool] = UNSET + shift_update_notifications_enabled: Union[None, Unset, bool] = UNSET + shift_report_enabled: Union[None, Unset, bool] = UNSET + shift_report_day_of_week: Union[Unset, UpdateScheduleDataAttributesShiftReportDayOfWeek] = UNSET + shift_report_time_of_day: Union[None, Unset, str] = UNSET + shift_report_time_zone: Union[None, Unset, str] = UNSET def to_dict(self) -> dict[str, Any]: from ..models.update_schedule_data_attributes_slack_channel_type_0 import ( @@ -72,23 +70,23 @@ def to_dict(self) -> dict[str, Any]: name = self.name - description: None | str | Unset + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: description = self.description - all_time_coverage: bool | None | Unset + all_time_coverage: Union[None, Unset, bool] if isinstance(self.all_time_coverage, Unset): all_time_coverage = UNSET else: all_time_coverage = self.all_time_coverage - slack_user_group: dict[str, Any] | Unset = UNSET + slack_user_group: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.slack_user_group, Unset): slack_user_group = self.slack_user_group.to_dict() - slack_channel: dict[str, Any] | None | Unset + slack_channel: Union[None, Unset, dict[str, Any]] if isinstance(self.slack_channel, Unset): slack_channel = UNSET elif isinstance(self.slack_channel, UpdateScheduleDataAttributesSlackChannelType0): @@ -96,57 +94,57 @@ def to_dict(self) -> dict[str, Any]: else: slack_channel = self.slack_channel - owner_group_ids: list[str] | Unset = UNSET + owner_group_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.owner_group_ids, Unset): owner_group_ids = self.owner_group_ids - owner_user_id: int | None | Unset + owner_user_id: Union[None, Unset, int] if isinstance(self.owner_user_id, Unset): owner_user_id = UNSET else: owner_user_id = self.owner_user_id - sync_linear_enabled: bool | None | Unset + sync_linear_enabled: Union[None, Unset, bool] if isinstance(self.sync_linear_enabled, Unset): sync_linear_enabled = UNSET else: sync_linear_enabled = self.sync_linear_enabled - include_shadows_in_slack_notifications: bool | None | Unset + include_shadows_in_slack_notifications: Union[None, Unset, bool] if isinstance(self.include_shadows_in_slack_notifications, Unset): include_shadows_in_slack_notifications = UNSET else: include_shadows_in_slack_notifications = self.include_shadows_in_slack_notifications - shift_start_notifications_enabled: bool | None | Unset + shift_start_notifications_enabled: Union[None, Unset, bool] if isinstance(self.shift_start_notifications_enabled, Unset): shift_start_notifications_enabled = UNSET else: shift_start_notifications_enabled = self.shift_start_notifications_enabled - shift_update_notifications_enabled: bool | None | Unset + shift_update_notifications_enabled: Union[None, Unset, bool] if isinstance(self.shift_update_notifications_enabled, Unset): shift_update_notifications_enabled = UNSET else: shift_update_notifications_enabled = self.shift_update_notifications_enabled - shift_report_enabled: bool | None | Unset + shift_report_enabled: Union[None, Unset, bool] if isinstance(self.shift_report_enabled, Unset): shift_report_enabled = UNSET else: shift_report_enabled = self.shift_report_enabled - shift_report_day_of_week: str | Unset = UNSET + shift_report_day_of_week: Union[Unset, str] = UNSET if not isinstance(self.shift_report_day_of_week, Unset): shift_report_day_of_week = self.shift_report_day_of_week - shift_report_time_of_day: None | str | Unset + shift_report_time_of_day: Union[None, Unset, str] if isinstance(self.shift_report_time_of_day, Unset): shift_report_time_of_day = UNSET else: shift_report_time_of_day = self.shift_report_time_of_day - shift_report_time_zone: None | str | Unset + shift_report_time_zone: Union[None, Unset, str] if isinstance(self.shift_report_time_zone, Unset): shift_report_time_zone = UNSET else: @@ -198,32 +196,32 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) - def _parse_all_time_coverage(data: object) -> bool | None | Unset: + def _parse_all_time_coverage(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) all_time_coverage = _parse_all_time_coverage(d.pop("all_time_coverage", UNSET)) _slack_user_group = d.pop("slack_user_group", UNSET) - slack_user_group: UpdateScheduleDataAttributesSlackUserGroup | Unset + slack_user_group: Union[Unset, UpdateScheduleDataAttributesSlackUserGroup] if isinstance(_slack_user_group, Unset): slack_user_group = UNSET else: slack_user_group = UpdateScheduleDataAttributesSlackUserGroup.from_dict(_slack_user_group) - def _parse_slack_channel(data: object) -> None | Unset | UpdateScheduleDataAttributesSlackChannelType0: + def _parse_slack_channel(data: object) -> Union["UpdateScheduleDataAttributesSlackChannelType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -234,76 +232,76 @@ def _parse_slack_channel(data: object) -> None | Unset | UpdateScheduleDataAttri slack_channel_type_0 = UpdateScheduleDataAttributesSlackChannelType0.from_dict(data) return slack_channel_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(None | Unset | UpdateScheduleDataAttributesSlackChannelType0, data) + return cast(Union["UpdateScheduleDataAttributesSlackChannelType0", None, Unset], data) slack_channel = _parse_slack_channel(d.pop("slack_channel", UNSET)) owner_group_ids = cast(list[str], d.pop("owner_group_ids", UNSET)) - def _parse_owner_user_id(data: object) -> int | None | Unset: + def _parse_owner_user_id(data: object) -> Union[None, Unset, int]: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(Union[None, Unset, int], data) owner_user_id = _parse_owner_user_id(d.pop("owner_user_id", UNSET)) - def _parse_sync_linear_enabled(data: object) -> bool | None | Unset: + def _parse_sync_linear_enabled(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) sync_linear_enabled = _parse_sync_linear_enabled(d.pop("sync_linear_enabled", UNSET)) - def _parse_include_shadows_in_slack_notifications(data: object) -> bool | None | Unset: + def _parse_include_shadows_in_slack_notifications(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) include_shadows_in_slack_notifications = _parse_include_shadows_in_slack_notifications( d.pop("include_shadows_in_slack_notifications", UNSET) ) - def _parse_shift_start_notifications_enabled(data: object) -> bool | None | Unset: + def _parse_shift_start_notifications_enabled(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) shift_start_notifications_enabled = _parse_shift_start_notifications_enabled( d.pop("shift_start_notifications_enabled", UNSET) ) - def _parse_shift_update_notifications_enabled(data: object) -> bool | None | Unset: + def _parse_shift_update_notifications_enabled(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) shift_update_notifications_enabled = _parse_shift_update_notifications_enabled( d.pop("shift_update_notifications_enabled", UNSET) ) - def _parse_shift_report_enabled(data: object) -> bool | None | Unset: + def _parse_shift_report_enabled(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) shift_report_enabled = _parse_shift_report_enabled(d.pop("shift_report_enabled", UNSET)) _shift_report_day_of_week = d.pop("shift_report_day_of_week", UNSET) - shift_report_day_of_week: UpdateScheduleDataAttributesShiftReportDayOfWeek | Unset + shift_report_day_of_week: Union[Unset, UpdateScheduleDataAttributesShiftReportDayOfWeek] if isinstance(_shift_report_day_of_week, Unset): shift_report_day_of_week = UNSET else: @@ -311,21 +309,21 @@ def _parse_shift_report_enabled(data: object) -> bool | None | Unset: _shift_report_day_of_week ) - def _parse_shift_report_time_of_day(data: object) -> None | str | Unset: + def _parse_shift_report_time_of_day(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) shift_report_time_of_day = _parse_shift_report_time_of_day(d.pop("shift_report_time_of_day", UNSET)) - def _parse_shift_report_time_zone(data: object) -> None | str | Unset: + def _parse_shift_report_time_zone(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) shift_report_time_zone = _parse_shift_report_time_zone(d.pop("shift_report_time_zone", UNSET)) diff --git a/rootly_sdk/models/update_schedule_data_attributes_slack_channel_type_0.py b/rootly_sdk/models/update_schedule_data_attributes_slack_channel_type_0.py index 3c23e5e9..a00cd723 100644 --- a/rootly_sdk/models/update_schedule_data_attributes_slack_channel_type_0.py +++ b/rootly_sdk/models/update_schedule_data_attributes_slack_channel_type_0.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class UpdateScheduleDataAttributesSlackChannelType0: """ Attributes: - id (str | Unset): Slack channel ID - name (str | Unset): Slack channel name + id (Union[Unset, str]): Slack channel ID + name (Union[Unset, str]): Slack channel name """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_schedule_data_attributes_slack_user_group.py b/rootly_sdk/models/update_schedule_data_attributes_slack_user_group.py index c8444389..c7c9aac4 100644 --- a/rootly_sdk/models/update_schedule_data_attributes_slack_user_group.py +++ b/rootly_sdk/models/update_schedule_data_attributes_slack_user_group.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class UpdateScheduleDataAttributesSlackUserGroup: """ Attributes: - id (str | Unset): Slack user group ID - name (str | Unset): Slack user group name + id (Union[Unset, str]): Slack user group ID + name (Union[Unset, str]): Slack user group name """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_schedule_rotation.py b/rootly_sdk/models/update_schedule_rotation.py index 70ac37af..921f3797 100644 --- a/rootly_sdk/models/update_schedule_rotation.py +++ b/rootly_sdk/models/update_schedule_rotation.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateScheduleRotation: data (UpdateScheduleRotationData): """ - data: UpdateScheduleRotationData + data: "UpdateScheduleRotationData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_schedule_rotation_active_day.py b/rootly_sdk/models/update_schedule_rotation_active_day.py index 397dded0..e76df6e6 100644 --- a/rootly_sdk/models/update_schedule_rotation_active_day.py +++ b/rootly_sdk/models/update_schedule_rotation_active_day.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateScheduleRotationActiveDay: data (UpdateScheduleRotationActiveDayData): """ - data: UpdateScheduleRotationActiveDayData + data: "UpdateScheduleRotationActiveDayData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_schedule_rotation_active_day_data.py b/rootly_sdk/models/update_schedule_rotation_active_day_data.py index 9ddf97ca..515b3780 100644 --- a/rootly_sdk/models/update_schedule_rotation_active_day_data.py +++ b/rootly_sdk/models/update_schedule_rotation_active_day_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class UpdateScheduleRotationActiveDayData: """ type_: UpdateScheduleRotationActiveDayDataType - attributes: UpdateScheduleRotationActiveDayDataAttributes + attributes: "UpdateScheduleRotationActiveDayDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_schedule_rotation_active_day_data_attributes.py b/rootly_sdk/models/update_schedule_rotation_active_day_data_attributes.py index b25922b5..34bacfbc 100644 --- a/rootly_sdk/models/update_schedule_rotation_active_day_data_attributes.py +++ b/rootly_sdk/models/update_schedule_rotation_active_day_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define @@ -24,22 +22,24 @@ class UpdateScheduleRotationActiveDayDataAttributes: """ Attributes: - day_name (UpdateScheduleRotationActiveDayDataAttributesDayName | Unset): Schedule rotation day name for which - active times to be created - active_time_attributes (list[UpdateScheduleRotationActiveDayDataAttributesActiveTimeAttributesItem] | Unset): - Schedule rotation active times per day + day_name (Union[Unset, UpdateScheduleRotationActiveDayDataAttributesDayName]): Schedule rotation day name for + which active times to be created + active_time_attributes (Union[Unset, + list['UpdateScheduleRotationActiveDayDataAttributesActiveTimeAttributesItem']]): Schedule rotation active times + per day """ - day_name: UpdateScheduleRotationActiveDayDataAttributesDayName | Unset = UNSET - active_time_attributes: list[UpdateScheduleRotationActiveDayDataAttributesActiveTimeAttributesItem] | Unset = UNSET + day_name: Union[Unset, UpdateScheduleRotationActiveDayDataAttributesDayName] = UNSET + active_time_attributes: Union[ + Unset, list["UpdateScheduleRotationActiveDayDataAttributesActiveTimeAttributesItem"] + ] = UNSET def to_dict(self) -> dict[str, Any]: - - day_name: str | Unset = UNSET + day_name: Union[Unset, str] = UNSET if not isinstance(self.day_name, Unset): day_name = self.day_name - active_time_attributes: list[dict[str, Any]] | Unset = UNSET + active_time_attributes: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.active_time_attributes, Unset): active_time_attributes = [] for active_time_attributes_item_data in self.active_time_attributes: @@ -64,26 +64,22 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _day_name = d.pop("day_name", UNSET) - day_name: UpdateScheduleRotationActiveDayDataAttributesDayName | Unset + day_name: Union[Unset, UpdateScheduleRotationActiveDayDataAttributesDayName] if isinstance(_day_name, Unset): day_name = UNSET else: day_name = check_update_schedule_rotation_active_day_data_attributes_day_name(_day_name) + active_time_attributes = [] _active_time_attributes = d.pop("active_time_attributes", UNSET) - active_time_attributes: list[UpdateScheduleRotationActiveDayDataAttributesActiveTimeAttributesItem] | Unset = ( - UNSET - ) - if _active_time_attributes is not UNSET: - active_time_attributes = [] - for active_time_attributes_item_data in _active_time_attributes: - active_time_attributes_item = ( - UpdateScheduleRotationActiveDayDataAttributesActiveTimeAttributesItem.from_dict( - active_time_attributes_item_data - ) + for active_time_attributes_item_data in _active_time_attributes or []: + active_time_attributes_item = ( + UpdateScheduleRotationActiveDayDataAttributesActiveTimeAttributesItem.from_dict( + active_time_attributes_item_data ) + ) - active_time_attributes.append(active_time_attributes_item) + active_time_attributes.append(active_time_attributes_item) update_schedule_rotation_active_day_data_attributes = cls( day_name=day_name, diff --git a/rootly_sdk/models/update_schedule_rotation_active_day_data_attributes_active_time_attributes_item.py b/rootly_sdk/models/update_schedule_rotation_active_day_data_attributes_active_time_attributes_item.py index 2b671883..f439f8c5 100644 --- a/rootly_sdk/models/update_schedule_rotation_active_day_data_attributes_active_time_attributes_item.py +++ b/rootly_sdk/models/update_schedule_rotation_active_day_data_attributes_active_time_attributes_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class UpdateScheduleRotationActiveDayDataAttributesActiveTimeAttributesItem: """ Attributes: - start_time (str | Unset): Start time for schedule rotation active time - end_time (str | Unset): End time for schedule rotation active time + start_time (Union[Unset, str]): Start time for schedule rotation active time + end_time (Union[Unset, str]): End time for schedule rotation active time """ - start_time: str | Unset = UNSET - end_time: str | Unset = UNSET + start_time: Union[Unset, str] = UNSET + end_time: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_schedule_rotation_data.py b/rootly_sdk/models/update_schedule_rotation_data.py index 4cfacf30..4e9691fc 100644 --- a/rootly_sdk/models/update_schedule_rotation_data.py +++ b/rootly_sdk/models/update_schedule_rotation_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class UpdateScheduleRotationData: """ type_: UpdateScheduleRotationDataType - attributes: UpdateScheduleRotationDataAttributes + attributes: "UpdateScheduleRotationDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_schedule_rotation_data_attributes.py b/rootly_sdk/models/update_schedule_rotation_data_attributes.py index dfa4b3af..b51dddcf 100644 --- a/rootly_sdk/models/update_schedule_rotation_data_attributes.py +++ b/rootly_sdk/models/update_schedule_rotation_data_attributes.py @@ -1,8 +1,6 @@ -from __future__ import annotations - import datetime from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from dateutil.parser import isoparse @@ -47,47 +45,48 @@ class UpdateScheduleRotationDataAttributes: Attributes: schedule_rotationable_type (UpdateScheduleRotationDataAttributesScheduleRotationableType): Schedule rotation type - name (str | Unset): The name of the schedule rotation - position (int | Unset): Position of the schedule rotation - active_all_week (bool | Unset): Schedule rotation active all week? Default: True. - active_days (list[UpdateScheduleRotationDataAttributesActiveDaysItem] | Unset): - active_time_type (str | Unset): - active_time_attributes (list[UpdateScheduleRotationDataAttributesActiveTimeAttributesItem] | Unset): Schedule - rotation's active times - time_zone (str | Unset): A valid IANA time zone name. Default: 'Etc/UTC'. - schedule_rotationable_attributes (Unset | - UpdateScheduleRotationDataAttributesScheduleRotationableAttributesType0 | - UpdateScheduleRotationDataAttributesScheduleRotationableAttributesType1 | - UpdateScheduleRotationDataAttributesScheduleRotationableAttributesType2 | - UpdateScheduleRotationDataAttributesScheduleRotationableAttributesType3): - start_time (datetime.datetime | None | Unset): RFC3339 date-time when rotation starts. Shifts will only be + name (Union[Unset, str]): The name of the schedule rotation + position (Union[Unset, int]): Position of the schedule rotation + active_all_week (Union[Unset, bool]): Schedule rotation active all week? Default: True. + active_days (Union[Unset, list[UpdateScheduleRotationDataAttributesActiveDaysItem]]): + active_time_type (Union[Unset, str]): + active_time_attributes (Union[Unset, list['UpdateScheduleRotationDataAttributesActiveTimeAttributesItem']]): + Schedule rotation's active times + time_zone (Union[Unset, str]): A valid IANA time zone name. Default: 'Etc/UTC'. + schedule_rotationable_attributes + (Union['UpdateScheduleRotationDataAttributesScheduleRotationableAttributesType0', + 'UpdateScheduleRotationDataAttributesScheduleRotationableAttributesType1', + 'UpdateScheduleRotationDataAttributesScheduleRotationableAttributesType2', + 'UpdateScheduleRotationDataAttributesScheduleRotationableAttributesType3', Unset]): + start_time (Union[None, Unset, datetime.datetime]): RFC3339 date-time when rotation starts. Shifts will only be created after this time. - end_time (datetime.datetime | None | Unset): RFC3339 date-time when rotation ends. Shifts will only be created - before this time. - schedule_rotation_members (list[UpdateScheduleRotationDataAttributesScheduleRotationMembersType0Item] | None | - Unset): You can only update schedule rotation members if your account has schedule nesting feature enabled + end_time (Union[None, Unset, datetime.datetime]): RFC3339 date-time when rotation ends. Shifts will only be + created before this time. + schedule_rotation_members (Union[None, Unset, + list['UpdateScheduleRotationDataAttributesScheduleRotationMembersType0Item']]): You can only update schedule + rotation members if your account has schedule nesting feature enabled """ schedule_rotationable_type: UpdateScheduleRotationDataAttributesScheduleRotationableType - name: str | Unset = UNSET - position: int | Unset = UNSET - active_all_week: bool | Unset = True - active_days: list[UpdateScheduleRotationDataAttributesActiveDaysItem] | Unset = UNSET - active_time_type: str | Unset = UNSET - active_time_attributes: list[UpdateScheduleRotationDataAttributesActiveTimeAttributesItem] | Unset = UNSET - time_zone: str | Unset = "Etc/UTC" - schedule_rotationable_attributes: ( - Unset - | UpdateScheduleRotationDataAttributesScheduleRotationableAttributesType0 - | UpdateScheduleRotationDataAttributesScheduleRotationableAttributesType1 - | UpdateScheduleRotationDataAttributesScheduleRotationableAttributesType2 - | UpdateScheduleRotationDataAttributesScheduleRotationableAttributesType3 - ) = UNSET - start_time: datetime.datetime | None | Unset = UNSET - end_time: datetime.datetime | None | Unset = UNSET - schedule_rotation_members: ( - list[UpdateScheduleRotationDataAttributesScheduleRotationMembersType0Item] | None | Unset - ) = UNSET + name: Union[Unset, str] = UNSET + position: Union[Unset, int] = UNSET + active_all_week: Union[Unset, bool] = True + active_days: Union[Unset, list[UpdateScheduleRotationDataAttributesActiveDaysItem]] = UNSET + active_time_type: Union[Unset, str] = UNSET + active_time_attributes: Union[Unset, list["UpdateScheduleRotationDataAttributesActiveTimeAttributesItem"]] = UNSET + time_zone: Union[Unset, str] = "Etc/UTC" + schedule_rotationable_attributes: Union[ + "UpdateScheduleRotationDataAttributesScheduleRotationableAttributesType0", + "UpdateScheduleRotationDataAttributesScheduleRotationableAttributesType1", + "UpdateScheduleRotationDataAttributesScheduleRotationableAttributesType2", + "UpdateScheduleRotationDataAttributesScheduleRotationableAttributesType3", + Unset, + ] = UNSET + start_time: Union[None, Unset, datetime.datetime] = UNSET + end_time: Union[None, Unset, datetime.datetime] = UNSET + schedule_rotation_members: Union[ + None, Unset, list["UpdateScheduleRotationDataAttributesScheduleRotationMembersType0Item"] + ] = UNSET def to_dict(self) -> dict[str, Any]: from ..models.update_schedule_rotation_data_attributes_schedule_rotationable_attributes_type_0 import ( @@ -108,7 +107,7 @@ def to_dict(self) -> dict[str, Any]: active_all_week = self.active_all_week - active_days: list[str] | Unset = UNSET + active_days: Union[Unset, list[str]] = UNSET if not isinstance(self.active_days, Unset): active_days = [] for active_days_item_data in self.active_days: @@ -117,7 +116,7 @@ def to_dict(self) -> dict[str, Any]: active_time_type = self.active_time_type - active_time_attributes: list[dict[str, Any]] | Unset = UNSET + active_time_attributes: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.active_time_attributes, Unset): active_time_attributes = [] for active_time_attributes_item_data in self.active_time_attributes: @@ -126,7 +125,7 @@ def to_dict(self) -> dict[str, Any]: time_zone = self.time_zone - schedule_rotationable_attributes: dict[str, Any] | Unset + schedule_rotationable_attributes: Union[Unset, dict[str, Any]] if isinstance(self.schedule_rotationable_attributes, Unset): schedule_rotationable_attributes = UNSET elif isinstance( @@ -147,7 +146,7 @@ def to_dict(self) -> dict[str, Any]: else: schedule_rotationable_attributes = self.schedule_rotationable_attributes.to_dict() - start_time: None | str | Unset + start_time: Union[None, Unset, str] if isinstance(self.start_time, Unset): start_time = UNSET elif isinstance(self.start_time, datetime.datetime): @@ -155,7 +154,7 @@ def to_dict(self) -> dict[str, Any]: else: start_time = self.start_time - end_time: None | str | Unset + end_time: Union[None, Unset, str] if isinstance(self.end_time, Unset): end_time = UNSET elif isinstance(self.end_time, datetime.datetime): @@ -163,7 +162,7 @@ def to_dict(self) -> dict[str, Any]: else: end_time = self.end_time - schedule_rotation_members: list[dict[str, Any]] | None | Unset + schedule_rotation_members: Union[None, Unset, list[dict[str, Any]]] if isinstance(self.schedule_rotation_members, Unset): schedule_rotation_members = UNSET elif isinstance(self.schedule_rotation_members, list): @@ -239,41 +238,35 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: active_all_week = d.pop("active_all_week", UNSET) + active_days = [] _active_days = d.pop("active_days", UNSET) - active_days: list[UpdateScheduleRotationDataAttributesActiveDaysItem] | Unset = UNSET - if _active_days is not UNSET: - active_days = [] - for active_days_item_data in _active_days: - active_days_item = check_update_schedule_rotation_data_attributes_active_days_item( - active_days_item_data - ) + for active_days_item_data in _active_days or []: + active_days_item = check_update_schedule_rotation_data_attributes_active_days_item(active_days_item_data) - active_days.append(active_days_item) + active_days.append(active_days_item) active_time_type = d.pop("active_time_type", UNSET) + active_time_attributes = [] _active_time_attributes = d.pop("active_time_attributes", UNSET) - active_time_attributes: list[UpdateScheduleRotationDataAttributesActiveTimeAttributesItem] | Unset = UNSET - if _active_time_attributes is not UNSET: - active_time_attributes = [] - for active_time_attributes_item_data in _active_time_attributes: - active_time_attributes_item = UpdateScheduleRotationDataAttributesActiveTimeAttributesItem.from_dict( - active_time_attributes_item_data - ) + for active_time_attributes_item_data in _active_time_attributes or []: + active_time_attributes_item = UpdateScheduleRotationDataAttributesActiveTimeAttributesItem.from_dict( + active_time_attributes_item_data + ) - active_time_attributes.append(active_time_attributes_item) + active_time_attributes.append(active_time_attributes_item) time_zone = d.pop("time_zone", UNSET) def _parse_schedule_rotationable_attributes( data: object, - ) -> ( - Unset - | UpdateScheduleRotationDataAttributesScheduleRotationableAttributesType0 - | UpdateScheduleRotationDataAttributesScheduleRotationableAttributesType1 - | UpdateScheduleRotationDataAttributesScheduleRotationableAttributesType2 - | UpdateScheduleRotationDataAttributesScheduleRotationableAttributesType3 - ): + ) -> Union[ + "UpdateScheduleRotationDataAttributesScheduleRotationableAttributesType0", + "UpdateScheduleRotationDataAttributesScheduleRotationableAttributesType1", + "UpdateScheduleRotationDataAttributesScheduleRotationableAttributesType2", + "UpdateScheduleRotationDataAttributesScheduleRotationableAttributesType3", + Unset, + ]: if isinstance(data, Unset): return data try: @@ -284,7 +277,7 @@ def _parse_schedule_rotationable_attributes( ) return schedule_rotationable_attributes_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -294,7 +287,7 @@ def _parse_schedule_rotationable_attributes( ) return schedule_rotationable_attributes_type_1 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -304,7 +297,7 @@ def _parse_schedule_rotationable_attributes( ) return schedule_rotationable_attributes_type_2 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass if not isinstance(data, dict): raise TypeError() @@ -318,7 +311,7 @@ def _parse_schedule_rotationable_attributes( d.pop("schedule_rotationable_attributes", UNSET) ) - def _parse_start_time(data: object) -> datetime.datetime | None | Unset: + def _parse_start_time(data: object) -> Union[None, Unset, datetime.datetime]: if data is None: return data if isinstance(data, Unset): @@ -329,13 +322,13 @@ def _parse_start_time(data: object) -> datetime.datetime | None | Unset: start_time_type_0 = isoparse(data) return start_time_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(datetime.datetime | None | Unset, data) + return cast(Union[None, Unset, datetime.datetime], data) start_time = _parse_start_time(d.pop("start_time", UNSET)) - def _parse_end_time(data: object) -> datetime.datetime | None | Unset: + def _parse_end_time(data: object) -> Union[None, Unset, datetime.datetime]: if data is None: return data if isinstance(data, Unset): @@ -346,15 +339,15 @@ def _parse_end_time(data: object) -> datetime.datetime | None | Unset: end_time_type_0 = isoparse(data) return end_time_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(datetime.datetime | None | Unset, data) + return cast(Union[None, Unset, datetime.datetime], data) end_time = _parse_end_time(d.pop("end_time", UNSET)) def _parse_schedule_rotation_members( data: object, - ) -> list[UpdateScheduleRotationDataAttributesScheduleRotationMembersType0Item] | None | Unset: + ) -> Union[None, Unset, list["UpdateScheduleRotationDataAttributesScheduleRotationMembersType0Item"]]: if data is None: return data if isinstance(data, Unset): @@ -374,9 +367,11 @@ def _parse_schedule_rotation_members( schedule_rotation_members_type_0.append(schedule_rotation_members_type_0_item) return schedule_rotation_members_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[UpdateScheduleRotationDataAttributesScheduleRotationMembersType0Item] | None | Unset, data) + return cast( + Union[None, Unset, list["UpdateScheduleRotationDataAttributesScheduleRotationMembersType0Item"]], data + ) schedule_rotation_members = _parse_schedule_rotation_members(d.pop("schedule_rotation_members", UNSET)) diff --git a/rootly_sdk/models/update_schedule_rotation_data_attributes_active_time_attributes_item.py b/rootly_sdk/models/update_schedule_rotation_data_attributes_active_time_attributes_item.py index 16999eca..d2f97054 100644 --- a/rootly_sdk/models/update_schedule_rotation_data_attributes_active_time_attributes_item.py +++ b/rootly_sdk/models/update_schedule_rotation_data_attributes_active_time_attributes_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/update_schedule_rotation_data_attributes_schedule_rotation_members_type_0_item.py b/rootly_sdk/models/update_schedule_rotation_data_attributes_schedule_rotation_members_type_0_item.py index fd3c09dc..e4e69c60 100644 --- a/rootly_sdk/models/update_schedule_rotation_data_attributes_schedule_rotation_members_type_0_item.py +++ b/rootly_sdk/models/update_schedule_rotation_data_attributes_schedule_rotation_members_type_0_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,12 +19,12 @@ class UpdateScheduleRotationDataAttributesScheduleRotationMembersType0Item: Attributes: member_type (UpdateScheduleRotationDataAttributesScheduleRotationMembersType0ItemMemberType): Type of member member_id (str): ID of the member - position (int | Unset): Position of the member in rotation + position (Union[Unset, int]): Position of the member in rotation """ member_type: UpdateScheduleRotationDataAttributesScheduleRotationMembersType0ItemMemberType member_id: str - position: int | Unset = UNSET + position: Union[Unset, int] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_schedule_rotation_data_attributes_schedule_rotationable_attributes_type_0.py b/rootly_sdk/models/update_schedule_rotation_data_attributes_schedule_rotationable_attributes_type_0.py index 252cbab7..d43b06fc 100644 --- a/rootly_sdk/models/update_schedule_rotation_data_attributes_schedule_rotationable_attributes_type_0.py +++ b/rootly_sdk/models/update_schedule_rotation_data_attributes_schedule_rotationable_attributes_type_0.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/update_schedule_rotation_data_attributes_schedule_rotationable_attributes_type_1.py b/rootly_sdk/models/update_schedule_rotation_data_attributes_schedule_rotationable_attributes_type_1.py index dd465bea..389f8b8b 100644 --- a/rootly_sdk/models/update_schedule_rotation_data_attributes_schedule_rotationable_attributes_type_1.py +++ b/rootly_sdk/models/update_schedule_rotation_data_attributes_schedule_rotationable_attributes_type_1.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/update_schedule_rotation_data_attributes_schedule_rotationable_attributes_type_2.py b/rootly_sdk/models/update_schedule_rotation_data_attributes_schedule_rotationable_attributes_type_2.py index b9b2c88f..451c364f 100644 --- a/rootly_sdk/models/update_schedule_rotation_data_attributes_schedule_rotationable_attributes_type_2.py +++ b/rootly_sdk/models/update_schedule_rotation_data_attributes_schedule_rotationable_attributes_type_2.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/update_schedule_rotation_data_attributes_schedule_rotationable_attributes_type_3.py b/rootly_sdk/models/update_schedule_rotation_data_attributes_schedule_rotationable_attributes_type_3.py index 53f98ff3..b36bed23 100644 --- a/rootly_sdk/models/update_schedule_rotation_data_attributes_schedule_rotationable_attributes_type_3.py +++ b/rootly_sdk/models/update_schedule_rotation_data_attributes_schedule_rotationable_attributes_type_3.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/update_schedule_rotation_user.py b/rootly_sdk/models/update_schedule_rotation_user.py index 0750bafd..2d3d11c9 100644 --- a/rootly_sdk/models/update_schedule_rotation_user.py +++ b/rootly_sdk/models/update_schedule_rotation_user.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateScheduleRotationUser: data (UpdateScheduleRotationUserData): """ - data: UpdateScheduleRotationUserData + data: "UpdateScheduleRotationUserData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_schedule_rotation_user_data.py b/rootly_sdk/models/update_schedule_rotation_user_data.py index 460b1e6e..69217cc6 100644 --- a/rootly_sdk/models/update_schedule_rotation_user_data.py +++ b/rootly_sdk/models/update_schedule_rotation_user_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class UpdateScheduleRotationUserData: """ type_: UpdateScheduleRotationUserDataType - attributes: UpdateScheduleRotationUserDataAttributes + attributes: "UpdateScheduleRotationUserDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_schedule_rotation_user_data_attributes.py b/rootly_sdk/models/update_schedule_rotation_user_data_attributes.py index 7b8c2006..8e746aa6 100644 --- a/rootly_sdk/models/update_schedule_rotation_user_data_attributes.py +++ b/rootly_sdk/models/update_schedule_rotation_user_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define @@ -14,12 +12,12 @@ class UpdateScheduleRotationUserDataAttributes: """ Attributes: - user_id (int | Unset): Schedule rotation user - position (int | Unset): Position of the user inside rotation + user_id (Union[Unset, int]): Schedule rotation user + position (Union[Unset, int]): Position of the user inside rotation """ - user_id: int | Unset = UNSET - position: int | Unset = UNSET + user_id: Union[Unset, int] = UNSET + position: Union[Unset, int] = UNSET def to_dict(self) -> dict[str, Any]: user_id = self.user_id diff --git a/rootly_sdk/models/update_secret.py b/rootly_sdk/models/update_secret.py index 09fb2dc2..cb35d785 100644 --- a/rootly_sdk/models/update_secret.py +++ b/rootly_sdk/models/update_secret.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateSecret: data (UpdateSecretData): """ - data: UpdateSecretData + data: "UpdateSecretData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_secret_data.py b/rootly_sdk/models/update_secret_data.py index ed599fda..cebfeff5 100644 --- a/rootly_sdk/models/update_secret_data.py +++ b/rootly_sdk/models/update_secret_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class UpdateSecretData: """ type_: UpdateSecretDataType - attributes: UpdateSecretDataAttributes + attributes: "UpdateSecretDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_secret_data_attributes.py b/rootly_sdk/models/update_secret_data_attributes.py index 9aaed46f..60710d00 100644 --- a/rootly_sdk/models/update_secret_data_attributes.py +++ b/rootly_sdk/models/update_secret_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -15,36 +13,36 @@ class UpdateSecretDataAttributes: """ Attributes: name (str): The name of the secret - secret (str | Unset): The secret - hashicorp_vault_mount (None | str | Unset): The HashiCorp Vault secret mount path Default: 'secret'. - hashicorp_vault_path (None | str | Unset): The HashiCorp Vault secret path - hashicorp_vault_version (int | None | Unset): The HashiCorp Vault secret version Default: 0. + secret (Union[Unset, str]): The secret + hashicorp_vault_mount (Union[None, Unset, str]): The HashiCorp Vault secret mount path Default: 'secret'. + hashicorp_vault_path (Union[None, Unset, str]): The HashiCorp Vault secret path + hashicorp_vault_version (Union[None, Unset, int]): The HashiCorp Vault secret version Default: 0. """ name: str - secret: str | Unset = UNSET - hashicorp_vault_mount: None | str | Unset = "secret" - hashicorp_vault_path: None | str | Unset = UNSET - hashicorp_vault_version: int | None | Unset = 0 + secret: Union[Unset, str] = UNSET + hashicorp_vault_mount: Union[None, Unset, str] = "secret" + hashicorp_vault_path: Union[None, Unset, str] = UNSET + hashicorp_vault_version: Union[None, Unset, int] = 0 def to_dict(self) -> dict[str, Any]: name = self.name secret = self.secret - hashicorp_vault_mount: None | str | Unset + hashicorp_vault_mount: Union[None, Unset, str] if isinstance(self.hashicorp_vault_mount, Unset): hashicorp_vault_mount = UNSET else: hashicorp_vault_mount = self.hashicorp_vault_mount - hashicorp_vault_path: None | str | Unset + hashicorp_vault_path: Union[None, Unset, str] if isinstance(self.hashicorp_vault_path, Unset): hashicorp_vault_path = UNSET else: hashicorp_vault_path = self.hashicorp_vault_path - hashicorp_vault_version: int | None | Unset + hashicorp_vault_version: Union[None, Unset, int] if isinstance(self.hashicorp_vault_version, Unset): hashicorp_vault_version = UNSET else: @@ -75,30 +73,30 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: secret = d.pop("secret", UNSET) - def _parse_hashicorp_vault_mount(data: object) -> None | str | Unset: + def _parse_hashicorp_vault_mount(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) hashicorp_vault_mount = _parse_hashicorp_vault_mount(d.pop("hashicorp_vault_mount", UNSET)) - def _parse_hashicorp_vault_path(data: object) -> None | str | Unset: + def _parse_hashicorp_vault_path(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) hashicorp_vault_path = _parse_hashicorp_vault_path(d.pop("hashicorp_vault_path", UNSET)) - def _parse_hashicorp_vault_version(data: object) -> int | None | Unset: + def _parse_hashicorp_vault_version(data: object) -> Union[None, Unset, int]: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(Union[None, Unset, int], data) hashicorp_vault_version = _parse_hashicorp_vault_version(d.pop("hashicorp_vault_version", UNSET)) diff --git a/rootly_sdk/models/update_service.py b/rootly_sdk/models/update_service.py index f5bf5217..e1c9b8af 100644 --- a/rootly_sdk/models/update_service.py +++ b/rootly_sdk/models/update_service.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateService: data (UpdateServiceData): """ - data: UpdateServiceData + data: "UpdateServiceData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_service_data.py b/rootly_sdk/models/update_service_data.py index f37ffa9f..66ba895b 100644 --- a/rootly_sdk/models/update_service_data.py +++ b/rootly_sdk/models/update_service_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class UpdateServiceData: """ type_: UpdateServiceDataType - attributes: UpdateServiceDataAttributes + attributes: "UpdateServiceDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_service_data_attributes.py b/rootly_sdk/models/update_service_data_attributes.py index 2f07c2ad..03f9b612 100644 --- a/rootly_sdk/models/update_service_data_attributes.py +++ b/rootly_sdk/models/update_service_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -30,78 +28,86 @@ class UpdateServiceDataAttributes: """ Attributes: - name (str | Unset): The name of the service - description (None | str | Unset): The description of the service - public_description (None | str | Unset): The public description of the service - notify_emails (list[str] | None | Unset): Emails to attach to the service - color (None | str | Unset): The hex color of the service - position (int | None | Unset): Position of the service - backstage_id (None | str | Unset): The Backstage entity id associated to this service. eg: + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + name (Union[Unset, str]): The name of the service + description (Union[None, Unset, str]): The description of the service + public_description (Union[None, Unset, str]): The status page description of the service + notify_emails (Union[None, Unset, list[str]]): Emails to attach to the service + color (Union[None, Unset, str]): The hex color of the service + position (Union[None, Unset, int]): Position of the service + backstage_id (Union[None, Unset, str]): The Backstage entity id associated to this service. eg: :namespace/:kind/:entity_name - external_id (None | str | Unset): The external id associated to this service - pagerduty_id (None | str | Unset): The PagerDuty service id associated to this service - opsgenie_id (None | str | Unset): The Opsgenie service id associated to this service - cortex_id (None | str | Unset): The Cortex group id associated to this service - service_now_ci_sys_id (None | str | Unset): The Service Now CI sys id associated to this service - github_repository_name (None | str | Unset): The GitHub repository name associated to this service. eg: + external_id (Union[None, Unset, str]): The external id associated to this service + pagerduty_id (Union[None, Unset, str]): The PagerDuty service id associated to this service + opsgenie_id (Union[None, Unset, str]): The Opsgenie service id associated to this service + cortex_id (Union[None, Unset, str]): The Cortex group id associated to this service + service_now_ci_sys_id (Union[None, Unset, str]): The Service Now CI sys id associated to this service + github_repository_name (Union[None, Unset, str]): The GitHub repository name associated to this service. eg: rootlyhq/my-service - github_repository_branch (None | str | Unset): The GitHub repository branch associated to this service. eg: main - gitlab_repository_name (None | str | Unset): The GitLab repository name associated to this service. eg: + github_repository_branch (Union[None, Unset, str]): The GitHub repository branch associated to this service. eg: + main + gitlab_repository_name (Union[None, Unset, str]): The GitLab repository name associated to this service. eg: rootlyhq/my-service - gitlab_repository_branch (None | str | Unset): The GitLab repository branch associated to this service. eg: main - environment_ids (list[str] | None | Unset): Environments associated with this service - service_ids (list[str] | None | Unset): Services dependent on this service - owner_group_ids (list[str] | None | Unset): Owner Teams associated with this service - owner_user_ids (list[int] | None | Unset): Owner Users associated with this service - alerts_email_enabled (bool | None | Unset): Enable alerts through email - alert_urgency_id (None | str | Unset): The alert urgency id of the service - escalation_policy_id (None | str | Unset): The escalation policy id of the service - kubernetes_deployment_name (None | str | Unset): The Kubernetes deployment name associated to this service. eg: - namespace/deployment-name - slack_channels (list[UpdateServiceDataAttributesSlackChannelsType0Item] | None | Unset): Slack Channels + gitlab_repository_branch (Union[None, Unset, str]): The GitLab repository branch associated to this service. eg: + main + environment_ids (Union[None, Unset, list[str]]): Environments associated with this service + service_ids (Union[None, Unset, list[str]]): Services dependent on this service + owner_group_ids (Union[None, Unset, list[str]]): Owner Teams associated with this service. Empty array removes + all; omitting or null leaves unchanged. + owner_user_ids (Union[None, Unset, list[int]]): Owner Users associated with this service. Empty array removes + all; omitting or null leaves unchanged. + alerts_email_enabled (Union[None, Unset, bool]): Enable alerts through email + alert_urgency_id (Union[None, Unset, str]): The alert urgency id of the service + escalation_policy_id (Union[None, Unset, str]): The escalation policy id of the service + kubernetes_deployment_name (Union[None, Unset, str]): The Kubernetes deployment name associated to this service. + eg: namespace/deployment-name + slack_channels (Union[None, Unset, list['UpdateServiceDataAttributesSlackChannelsType0Item']]): Slack Channels + associated with this service + slack_aliases (Union[None, Unset, list['UpdateServiceDataAttributesSlackAliasesType0Item']]): Slack Aliases associated with this service - slack_aliases (list[UpdateServiceDataAttributesSlackAliasesType0Item] | None | Unset): Slack Aliases associated - with this service - alert_broadcast_enabled (bool | None | Unset): Enable alerts to be broadcasted to a specific channel - alert_broadcast_channel (None | Unset | UpdateServiceDataAttributesAlertBroadcastChannelType0): Slack channel to - broadcast alerts to - incident_broadcast_enabled (bool | None | Unset): Enable incidents to be broadcasted to a specific channel - incident_broadcast_channel (None | Unset | UpdateServiceDataAttributesIncidentBroadcastChannelType0): Slack - channel to broadcast incidents to - properties (list[UpdateServiceDataAttributesPropertiesItem] | Unset): Array of property values for this service. + alert_broadcast_enabled (Union[None, Unset, bool]): Enable alerts to be broadcasted to a specific channel + alert_broadcast_channel (Union['UpdateServiceDataAttributesAlertBroadcastChannelType0', None, Unset]): Slack + channel to broadcast alerts to + incident_broadcast_enabled (Union[None, Unset, bool]): Enable incidents to be broadcasted to a specific channel + incident_broadcast_channel (Union['UpdateServiceDataAttributesIncidentBroadcastChannelType0', None, Unset]): + Slack channel to broadcast incidents to + properties (Union[Unset, list['UpdateServiceDataAttributesPropertiesItem']]): Array of property values for this + service. """ - name: str | Unset = UNSET - description: None | str | Unset = UNSET - public_description: None | str | Unset = UNSET - notify_emails: list[str] | None | Unset = UNSET - color: None | str | Unset = UNSET - position: int | None | Unset = UNSET - backstage_id: None | str | Unset = UNSET - external_id: None | str | Unset = UNSET - pagerduty_id: None | str | Unset = UNSET - opsgenie_id: None | str | Unset = UNSET - cortex_id: None | str | Unset = UNSET - service_now_ci_sys_id: None | str | Unset = UNSET - github_repository_name: None | str | Unset = UNSET - github_repository_branch: None | str | Unset = UNSET - gitlab_repository_name: None | str | Unset = UNSET - gitlab_repository_branch: None | str | Unset = UNSET - environment_ids: list[str] | None | Unset = UNSET - service_ids: list[str] | None | Unset = UNSET - owner_group_ids: list[str] | None | Unset = UNSET - owner_user_ids: list[int] | None | Unset = UNSET - alerts_email_enabled: bool | None | Unset = UNSET - alert_urgency_id: None | str | Unset = UNSET - escalation_policy_id: None | str | Unset = UNSET - kubernetes_deployment_name: None | str | Unset = UNSET - slack_channels: list[UpdateServiceDataAttributesSlackChannelsType0Item] | None | Unset = UNSET - slack_aliases: list[UpdateServiceDataAttributesSlackAliasesType0Item] | None | Unset = UNSET - alert_broadcast_enabled: bool | None | Unset = UNSET - alert_broadcast_channel: None | Unset | UpdateServiceDataAttributesAlertBroadcastChannelType0 = UNSET - incident_broadcast_enabled: bool | None | Unset = UNSET - incident_broadcast_channel: None | Unset | UpdateServiceDataAttributesIncidentBroadcastChannelType0 = UNSET - properties: list[UpdateServiceDataAttributesPropertiesItem] | Unset = UNSET + slug: Union[None, Unset, str] = UNSET + name: Union[Unset, str] = UNSET + description: Union[None, Unset, str] = UNSET + public_description: Union[None, Unset, str] = UNSET + notify_emails: Union[None, Unset, list[str]] = UNSET + color: Union[None, Unset, str] = UNSET + position: Union[None, Unset, int] = UNSET + backstage_id: Union[None, Unset, str] = UNSET + external_id: Union[None, Unset, str] = UNSET + pagerduty_id: Union[None, Unset, str] = UNSET + opsgenie_id: Union[None, Unset, str] = UNSET + cortex_id: Union[None, Unset, str] = UNSET + service_now_ci_sys_id: Union[None, Unset, str] = UNSET + github_repository_name: Union[None, Unset, str] = UNSET + github_repository_branch: Union[None, Unset, str] = UNSET + gitlab_repository_name: Union[None, Unset, str] = UNSET + gitlab_repository_branch: Union[None, Unset, str] = UNSET + environment_ids: Union[None, Unset, list[str]] = UNSET + service_ids: Union[None, Unset, list[str]] = UNSET + owner_group_ids: Union[None, Unset, list[str]] = UNSET + owner_user_ids: Union[None, Unset, list[int]] = UNSET + alerts_email_enabled: Union[None, Unset, bool] = UNSET + alert_urgency_id: Union[None, Unset, str] = UNSET + escalation_policy_id: Union[None, Unset, str] = UNSET + kubernetes_deployment_name: Union[None, Unset, str] = UNSET + slack_channels: Union[None, Unset, list["UpdateServiceDataAttributesSlackChannelsType0Item"]] = UNSET + slack_aliases: Union[None, Unset, list["UpdateServiceDataAttributesSlackAliasesType0Item"]] = UNSET + alert_broadcast_enabled: Union[None, Unset, bool] = UNSET + alert_broadcast_channel: Union["UpdateServiceDataAttributesAlertBroadcastChannelType0", None, Unset] = UNSET + incident_broadcast_enabled: Union[None, Unset, bool] = UNSET + incident_broadcast_channel: Union["UpdateServiceDataAttributesIncidentBroadcastChannelType0", None, Unset] = UNSET + properties: Union[Unset, list["UpdateServiceDataAttributesPropertiesItem"]] = UNSET def to_dict(self) -> dict[str, Any]: from ..models.update_service_data_attributes_alert_broadcast_channel_type_0 import ( @@ -111,21 +117,27 @@ def to_dict(self) -> dict[str, Any]: UpdateServiceDataAttributesIncidentBroadcastChannelType0, ) + slug: Union[None, Unset, str] + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug + name = self.name - description: None | str | Unset + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: description = self.description - public_description: None | str | Unset + public_description: Union[None, Unset, str] if isinstance(self.public_description, Unset): public_description = UNSET else: public_description = self.public_description - notify_emails: list[str] | None | Unset + notify_emails: Union[None, Unset, list[str]] if isinstance(self.notify_emails, Unset): notify_emails = UNSET elif isinstance(self.notify_emails, list): @@ -134,79 +146,79 @@ def to_dict(self) -> dict[str, Any]: else: notify_emails = self.notify_emails - color: None | str | Unset + color: Union[None, Unset, str] if isinstance(self.color, Unset): color = UNSET else: color = self.color - position: int | None | Unset + position: Union[None, Unset, int] if isinstance(self.position, Unset): position = UNSET else: position = self.position - backstage_id: None | str | Unset + backstage_id: Union[None, Unset, str] if isinstance(self.backstage_id, Unset): backstage_id = UNSET else: backstage_id = self.backstage_id - external_id: None | str | Unset + external_id: Union[None, Unset, str] if isinstance(self.external_id, Unset): external_id = UNSET else: external_id = self.external_id - pagerduty_id: None | str | Unset + pagerduty_id: Union[None, Unset, str] if isinstance(self.pagerduty_id, Unset): pagerduty_id = UNSET else: pagerduty_id = self.pagerduty_id - opsgenie_id: None | str | Unset + opsgenie_id: Union[None, Unset, str] if isinstance(self.opsgenie_id, Unset): opsgenie_id = UNSET else: opsgenie_id = self.opsgenie_id - cortex_id: None | str | Unset + cortex_id: Union[None, Unset, str] if isinstance(self.cortex_id, Unset): cortex_id = UNSET else: cortex_id = self.cortex_id - service_now_ci_sys_id: None | str | Unset + service_now_ci_sys_id: Union[None, Unset, str] if isinstance(self.service_now_ci_sys_id, Unset): service_now_ci_sys_id = UNSET else: service_now_ci_sys_id = self.service_now_ci_sys_id - github_repository_name: None | str | Unset + github_repository_name: Union[None, Unset, str] if isinstance(self.github_repository_name, Unset): github_repository_name = UNSET else: github_repository_name = self.github_repository_name - github_repository_branch: None | str | Unset + github_repository_branch: Union[None, Unset, str] if isinstance(self.github_repository_branch, Unset): github_repository_branch = UNSET else: github_repository_branch = self.github_repository_branch - gitlab_repository_name: None | str | Unset + gitlab_repository_name: Union[None, Unset, str] if isinstance(self.gitlab_repository_name, Unset): gitlab_repository_name = UNSET else: gitlab_repository_name = self.gitlab_repository_name - gitlab_repository_branch: None | str | Unset + gitlab_repository_branch: Union[None, Unset, str] if isinstance(self.gitlab_repository_branch, Unset): gitlab_repository_branch = UNSET else: gitlab_repository_branch = self.gitlab_repository_branch - environment_ids: list[str] | None | Unset + environment_ids: Union[None, Unset, list[str]] if isinstance(self.environment_ids, Unset): environment_ids = UNSET elif isinstance(self.environment_ids, list): @@ -215,7 +227,7 @@ def to_dict(self) -> dict[str, Any]: else: environment_ids = self.environment_ids - service_ids: list[str] | None | Unset + service_ids: Union[None, Unset, list[str]] if isinstance(self.service_ids, Unset): service_ids = UNSET elif isinstance(self.service_ids, list): @@ -224,7 +236,7 @@ def to_dict(self) -> dict[str, Any]: else: service_ids = self.service_ids - owner_group_ids: list[str] | None | Unset + owner_group_ids: Union[None, Unset, list[str]] if isinstance(self.owner_group_ids, Unset): owner_group_ids = UNSET elif isinstance(self.owner_group_ids, list): @@ -233,7 +245,7 @@ def to_dict(self) -> dict[str, Any]: else: owner_group_ids = self.owner_group_ids - owner_user_ids: list[int] | None | Unset + owner_user_ids: Union[None, Unset, list[int]] if isinstance(self.owner_user_ids, Unset): owner_user_ids = UNSET elif isinstance(self.owner_user_ids, list): @@ -242,31 +254,31 @@ def to_dict(self) -> dict[str, Any]: else: owner_user_ids = self.owner_user_ids - alerts_email_enabled: bool | None | Unset + alerts_email_enabled: Union[None, Unset, bool] if isinstance(self.alerts_email_enabled, Unset): alerts_email_enabled = UNSET else: alerts_email_enabled = self.alerts_email_enabled - alert_urgency_id: None | str | Unset + alert_urgency_id: Union[None, Unset, str] if isinstance(self.alert_urgency_id, Unset): alert_urgency_id = UNSET else: alert_urgency_id = self.alert_urgency_id - escalation_policy_id: None | str | Unset + escalation_policy_id: Union[None, Unset, str] if isinstance(self.escalation_policy_id, Unset): escalation_policy_id = UNSET else: escalation_policy_id = self.escalation_policy_id - kubernetes_deployment_name: None | str | Unset + kubernetes_deployment_name: Union[None, Unset, str] if isinstance(self.kubernetes_deployment_name, Unset): kubernetes_deployment_name = UNSET else: kubernetes_deployment_name = self.kubernetes_deployment_name - slack_channels: list[dict[str, Any]] | None | Unset + slack_channels: Union[None, Unset, list[dict[str, Any]]] if isinstance(self.slack_channels, Unset): slack_channels = UNSET elif isinstance(self.slack_channels, list): @@ -278,7 +290,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_channels = self.slack_channels - slack_aliases: list[dict[str, Any]] | None | Unset + slack_aliases: Union[None, Unset, list[dict[str, Any]]] if isinstance(self.slack_aliases, Unset): slack_aliases = UNSET elif isinstance(self.slack_aliases, list): @@ -290,13 +302,13 @@ def to_dict(self) -> dict[str, Any]: else: slack_aliases = self.slack_aliases - alert_broadcast_enabled: bool | None | Unset + alert_broadcast_enabled: Union[None, Unset, bool] if isinstance(self.alert_broadcast_enabled, Unset): alert_broadcast_enabled = UNSET else: alert_broadcast_enabled = self.alert_broadcast_enabled - alert_broadcast_channel: dict[str, Any] | None | Unset + alert_broadcast_channel: Union[None, Unset, dict[str, Any]] if isinstance(self.alert_broadcast_channel, Unset): alert_broadcast_channel = UNSET elif isinstance(self.alert_broadcast_channel, UpdateServiceDataAttributesAlertBroadcastChannelType0): @@ -304,13 +316,13 @@ def to_dict(self) -> dict[str, Any]: else: alert_broadcast_channel = self.alert_broadcast_channel - incident_broadcast_enabled: bool | None | Unset + incident_broadcast_enabled: Union[None, Unset, bool] if isinstance(self.incident_broadcast_enabled, Unset): incident_broadcast_enabled = UNSET else: incident_broadcast_enabled = self.incident_broadcast_enabled - incident_broadcast_channel: dict[str, Any] | None | Unset + incident_broadcast_channel: Union[None, Unset, dict[str, Any]] if isinstance(self.incident_broadcast_channel, Unset): incident_broadcast_channel = UNSET elif isinstance(self.incident_broadcast_channel, UpdateServiceDataAttributesIncidentBroadcastChannelType0): @@ -318,7 +330,7 @@ def to_dict(self) -> dict[str, Any]: else: incident_broadcast_channel = self.incident_broadcast_channel - properties: list[dict[str, Any]] | Unset = UNSET + properties: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.properties, Unset): properties = [] for properties_item_data in self.properties: @@ -328,6 +340,8 @@ def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} field_dict.update({}) + if slug is not UNSET: + field_dict["slug"] = slug if name is not UNSET: field_dict["name"] = name if description is not UNSET: @@ -410,27 +424,37 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: ) d = dict(src_dict) + + def _parse_slug(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + slug = _parse_slug(d.pop("slug", UNSET)) + name = d.pop("name", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) - def _parse_public_description(data: object) -> None | str | Unset: + def _parse_public_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) public_description = _parse_public_description(d.pop("public_description", UNSET)) - def _parse_notify_emails(data: object) -> list[str] | None | Unset: + def _parse_notify_emails(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -441,121 +465,121 @@ def _parse_notify_emails(data: object) -> list[str] | None | Unset: notify_emails_type_0 = cast(list[str], data) return notify_emails_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) notify_emails = _parse_notify_emails(d.pop("notify_emails", UNSET)) - def _parse_color(data: object) -> None | str | Unset: + def _parse_color(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) color = _parse_color(d.pop("color", UNSET)) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> Union[None, Unset, int]: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(Union[None, Unset, int], data) position = _parse_position(d.pop("position", UNSET)) - def _parse_backstage_id(data: object) -> None | str | Unset: + def _parse_backstage_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) backstage_id = _parse_backstage_id(d.pop("backstage_id", UNSET)) - def _parse_external_id(data: object) -> None | str | Unset: + def _parse_external_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) external_id = _parse_external_id(d.pop("external_id", UNSET)) - def _parse_pagerduty_id(data: object) -> None | str | Unset: + def _parse_pagerduty_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) pagerduty_id = _parse_pagerduty_id(d.pop("pagerduty_id", UNSET)) - def _parse_opsgenie_id(data: object) -> None | str | Unset: + def _parse_opsgenie_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) opsgenie_id = _parse_opsgenie_id(d.pop("opsgenie_id", UNSET)) - def _parse_cortex_id(data: object) -> None | str | Unset: + def _parse_cortex_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) cortex_id = _parse_cortex_id(d.pop("cortex_id", UNSET)) - def _parse_service_now_ci_sys_id(data: object) -> None | str | Unset: + def _parse_service_now_ci_sys_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) service_now_ci_sys_id = _parse_service_now_ci_sys_id(d.pop("service_now_ci_sys_id", UNSET)) - def _parse_github_repository_name(data: object) -> None | str | Unset: + def _parse_github_repository_name(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) github_repository_name = _parse_github_repository_name(d.pop("github_repository_name", UNSET)) - def _parse_github_repository_branch(data: object) -> None | str | Unset: + def _parse_github_repository_branch(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) github_repository_branch = _parse_github_repository_branch(d.pop("github_repository_branch", UNSET)) - def _parse_gitlab_repository_name(data: object) -> None | str | Unset: + def _parse_gitlab_repository_name(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) gitlab_repository_name = _parse_gitlab_repository_name(d.pop("gitlab_repository_name", UNSET)) - def _parse_gitlab_repository_branch(data: object) -> None | str | Unset: + def _parse_gitlab_repository_branch(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) gitlab_repository_branch = _parse_gitlab_repository_branch(d.pop("gitlab_repository_branch", UNSET)) - def _parse_environment_ids(data: object) -> list[str] | None | Unset: + def _parse_environment_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -566,13 +590,13 @@ def _parse_environment_ids(data: object) -> list[str] | None | Unset: environment_ids_type_0 = cast(list[str], data) return environment_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) environment_ids = _parse_environment_ids(d.pop("environment_ids", UNSET)) - def _parse_service_ids(data: object) -> list[str] | None | Unset: + def _parse_service_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -583,13 +607,13 @@ def _parse_service_ids(data: object) -> list[str] | None | Unset: service_ids_type_0 = cast(list[str], data) return service_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) service_ids = _parse_service_ids(d.pop("service_ids", UNSET)) - def _parse_owner_group_ids(data: object) -> list[str] | None | Unset: + def _parse_owner_group_ids(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -600,13 +624,13 @@ def _parse_owner_group_ids(data: object) -> list[str] | None | Unset: owner_group_ids_type_0 = cast(list[str], data) return owner_group_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) owner_group_ids = _parse_owner_group_ids(d.pop("owner_group_ids", UNSET)) - def _parse_owner_user_ids(data: object) -> list[int] | None | Unset: + def _parse_owner_user_ids(data: object) -> Union[None, Unset, list[int]]: if data is None: return data if isinstance(data, Unset): @@ -617,51 +641,51 @@ def _parse_owner_user_ids(data: object) -> list[int] | None | Unset: owner_user_ids_type_0 = cast(list[int], data) return owner_user_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[int] | None | Unset, data) + return cast(Union[None, Unset, list[int]], data) owner_user_ids = _parse_owner_user_ids(d.pop("owner_user_ids", UNSET)) - def _parse_alerts_email_enabled(data: object) -> bool | None | Unset: + def _parse_alerts_email_enabled(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) alerts_email_enabled = _parse_alerts_email_enabled(d.pop("alerts_email_enabled", UNSET)) - def _parse_alert_urgency_id(data: object) -> None | str | Unset: + def _parse_alert_urgency_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) alert_urgency_id = _parse_alert_urgency_id(d.pop("alert_urgency_id", UNSET)) - def _parse_escalation_policy_id(data: object) -> None | str | Unset: + def _parse_escalation_policy_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) escalation_policy_id = _parse_escalation_policy_id(d.pop("escalation_policy_id", UNSET)) - def _parse_kubernetes_deployment_name(data: object) -> None | str | Unset: + def _parse_kubernetes_deployment_name(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) kubernetes_deployment_name = _parse_kubernetes_deployment_name(d.pop("kubernetes_deployment_name", UNSET)) def _parse_slack_channels( data: object, - ) -> list[UpdateServiceDataAttributesSlackChannelsType0Item] | None | Unset: + ) -> Union[None, Unset, list["UpdateServiceDataAttributesSlackChannelsType0Item"]]: if data is None: return data if isinstance(data, Unset): @@ -679,13 +703,15 @@ def _parse_slack_channels( slack_channels_type_0.append(slack_channels_type_0_item) return slack_channels_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[UpdateServiceDataAttributesSlackChannelsType0Item] | None | Unset, data) + return cast(Union[None, Unset, list["UpdateServiceDataAttributesSlackChannelsType0Item"]], data) slack_channels = _parse_slack_channels(d.pop("slack_channels", UNSET)) - def _parse_slack_aliases(data: object) -> list[UpdateServiceDataAttributesSlackAliasesType0Item] | None | Unset: + def _parse_slack_aliases( + data: object, + ) -> Union[None, Unset, list["UpdateServiceDataAttributesSlackAliasesType0Item"]]: if data is None: return data if isinstance(data, Unset): @@ -703,24 +729,24 @@ def _parse_slack_aliases(data: object) -> list[UpdateServiceDataAttributesSlackA slack_aliases_type_0.append(slack_aliases_type_0_item) return slack_aliases_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[UpdateServiceDataAttributesSlackAliasesType0Item] | None | Unset, data) + return cast(Union[None, Unset, list["UpdateServiceDataAttributesSlackAliasesType0Item"]], data) slack_aliases = _parse_slack_aliases(d.pop("slack_aliases", UNSET)) - def _parse_alert_broadcast_enabled(data: object) -> bool | None | Unset: + def _parse_alert_broadcast_enabled(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) alert_broadcast_enabled = _parse_alert_broadcast_enabled(d.pop("alert_broadcast_enabled", UNSET)) def _parse_alert_broadcast_channel( data: object, - ) -> None | Unset | UpdateServiceDataAttributesAlertBroadcastChannelType0: + ) -> Union["UpdateServiceDataAttributesAlertBroadcastChannelType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -731,24 +757,24 @@ def _parse_alert_broadcast_channel( alert_broadcast_channel_type_0 = UpdateServiceDataAttributesAlertBroadcastChannelType0.from_dict(data) return alert_broadcast_channel_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(None | Unset | UpdateServiceDataAttributesAlertBroadcastChannelType0, data) + return cast(Union["UpdateServiceDataAttributesAlertBroadcastChannelType0", None, Unset], data) alert_broadcast_channel = _parse_alert_broadcast_channel(d.pop("alert_broadcast_channel", UNSET)) - def _parse_incident_broadcast_enabled(data: object) -> bool | None | Unset: + def _parse_incident_broadcast_enabled(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) incident_broadcast_enabled = _parse_incident_broadcast_enabled(d.pop("incident_broadcast_enabled", UNSET)) def _parse_incident_broadcast_channel( data: object, - ) -> None | Unset | UpdateServiceDataAttributesIncidentBroadcastChannelType0: + ) -> Union["UpdateServiceDataAttributesIncidentBroadcastChannelType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -761,22 +787,21 @@ def _parse_incident_broadcast_channel( ) return incident_broadcast_channel_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(None | Unset | UpdateServiceDataAttributesIncidentBroadcastChannelType0, data) + return cast(Union["UpdateServiceDataAttributesIncidentBroadcastChannelType0", None, Unset], data) incident_broadcast_channel = _parse_incident_broadcast_channel(d.pop("incident_broadcast_channel", UNSET)) + properties = [] _properties = d.pop("properties", UNSET) - properties: list[UpdateServiceDataAttributesPropertiesItem] | Unset = UNSET - if _properties is not UNSET: - properties = [] - for properties_item_data in _properties: - properties_item = UpdateServiceDataAttributesPropertiesItem.from_dict(properties_item_data) + for properties_item_data in _properties or []: + properties_item = UpdateServiceDataAttributesPropertiesItem.from_dict(properties_item_data) - properties.append(properties_item) + properties.append(properties_item) update_service_data_attributes = cls( + slug=slug, name=name, description=description, public_description=public_description, diff --git a/rootly_sdk/models/update_service_data_attributes_alert_broadcast_channel_type_0.py b/rootly_sdk/models/update_service_data_attributes_alert_broadcast_channel_type_0.py index ec637d7b..f5f466b5 100644 --- a/rootly_sdk/models/update_service_data_attributes_alert_broadcast_channel_type_0.py +++ b/rootly_sdk/models/update_service_data_attributes_alert_broadcast_channel_type_0.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,11 +15,11 @@ class UpdateServiceDataAttributesAlertBroadcastChannelType0: Attributes: id (str): Slack channel ID - name (str | Unset): Slack channel name + name (Union[Unset, str]): Slack channel name """ id: str - name: str | Unset = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_service_data_attributes_incident_broadcast_channel_type_0.py b/rootly_sdk/models/update_service_data_attributes_incident_broadcast_channel_type_0.py index aff0a0b6..0e88f29b 100644 --- a/rootly_sdk/models/update_service_data_attributes_incident_broadcast_channel_type_0.py +++ b/rootly_sdk/models/update_service_data_attributes_incident_broadcast_channel_type_0.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,11 +15,11 @@ class UpdateServiceDataAttributesIncidentBroadcastChannelType0: Attributes: id (str): Slack channel ID - name (str | Unset): Slack channel name + name (Union[Unset, str]): Slack channel name """ id: str - name: str | Unset = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_service_data_attributes_properties_item.py b/rootly_sdk/models/update_service_data_attributes_properties_item.py index ed866804..c548afb0 100644 --- a/rootly_sdk/models/update_service_data_attributes_properties_item.py +++ b/rootly_sdk/models/update_service_data_attributes_properties_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/update_service_data_attributes_slack_aliases_type_0_item.py b/rootly_sdk/models/update_service_data_attributes_slack_aliases_type_0_item.py index 1f0653e1..fda97fed 100644 --- a/rootly_sdk/models/update_service_data_attributes_slack_aliases_type_0_item.py +++ b/rootly_sdk/models/update_service_data_attributes_slack_aliases_type_0_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/update_service_data_attributes_slack_channels_type_0_item.py b/rootly_sdk/models/update_service_data_attributes_slack_channels_type_0_item.py index 42f2f67c..fb934d04 100644 --- a/rootly_sdk/models/update_service_data_attributes_slack_channels_type_0_item.py +++ b/rootly_sdk/models/update_service_data_attributes_slack_channels_type_0_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/update_service_now_incident_task_params.py b/rootly_sdk/models/update_service_now_incident_task_params.py index ac5e8b1a..cdc60655 100644 --- a/rootly_sdk/models/update_service_now_incident_task_params.py +++ b/rootly_sdk/models/update_service_now_incident_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -25,29 +23,28 @@ class UpdateServiceNowIncidentTaskParams: """ Attributes: incident_id (str): The incident id - task_type (UpdateServiceNowIncidentTaskParamsTaskType | Unset): - title (str | Unset): The incident title - description (str | Unset): The incident description - priority (UpdateServiceNowIncidentTaskParamsPriority | Unset): The priority id and display name - completion (UpdateServiceNowIncidentTaskParamsCompletion | Unset): The completion id and display name - custom_fields_mapping (None | str | Unset): Custom field mappings. Can contain liquid markup and need to be + task_type (Union[Unset, UpdateServiceNowIncidentTaskParamsTaskType]): + title (Union[Unset, str]): The incident title + description (Union[Unset, str]): The incident description + priority (Union[Unset, UpdateServiceNowIncidentTaskParamsPriority]): The priority id and display name + completion (Union[Unset, UpdateServiceNowIncidentTaskParamsCompletion]): The completion id and display name + custom_fields_mapping (Union[None, Unset, str]): Custom field mappings. Can contain liquid markup and need to be valid JSON """ incident_id: str - task_type: UpdateServiceNowIncidentTaskParamsTaskType | Unset = UNSET - title: str | Unset = UNSET - description: str | Unset = UNSET - priority: UpdateServiceNowIncidentTaskParamsPriority | Unset = UNSET - completion: UpdateServiceNowIncidentTaskParamsCompletion | Unset = UNSET - custom_fields_mapping: None | str | Unset = UNSET + task_type: Union[Unset, UpdateServiceNowIncidentTaskParamsTaskType] = UNSET + title: Union[Unset, str] = UNSET + description: Union[Unset, str] = UNSET + priority: Union[Unset, "UpdateServiceNowIncidentTaskParamsPriority"] = UNSET + completion: Union[Unset, "UpdateServiceNowIncidentTaskParamsCompletion"] = UNSET + custom_fields_mapping: Union[None, Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - incident_id = self.incident_id - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -55,15 +52,15 @@ def to_dict(self) -> dict[str, Any]: description = self.description - priority: dict[str, Any] | Unset = UNSET + priority: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.priority, Unset): priority = self.priority.to_dict() - completion: dict[str, Any] | Unset = UNSET + completion: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.completion, Unset): completion = self.completion.to_dict() - custom_fields_mapping: None | str | Unset + custom_fields_mapping: Union[None, Unset, str] if isinstance(self.custom_fields_mapping, Unset): custom_fields_mapping = UNSET else: @@ -102,7 +99,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: incident_id = d.pop("incident_id") _task_type = d.pop("task_type", UNSET) - task_type: UpdateServiceNowIncidentTaskParamsTaskType | Unset + task_type: Union[Unset, UpdateServiceNowIncidentTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: @@ -113,25 +110,25 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: description = d.pop("description", UNSET) _priority = d.pop("priority", UNSET) - priority: UpdateServiceNowIncidentTaskParamsPriority | Unset + priority: Union[Unset, UpdateServiceNowIncidentTaskParamsPriority] if isinstance(_priority, Unset): priority = UNSET else: priority = UpdateServiceNowIncidentTaskParamsPriority.from_dict(_priority) _completion = d.pop("completion", UNSET) - completion: UpdateServiceNowIncidentTaskParamsCompletion | Unset + completion: Union[Unset, UpdateServiceNowIncidentTaskParamsCompletion] if isinstance(_completion, Unset): completion = UNSET else: completion = UpdateServiceNowIncidentTaskParamsCompletion.from_dict(_completion) - def _parse_custom_fields_mapping(data: object) -> None | str | Unset: + def _parse_custom_fields_mapping(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) custom_fields_mapping = _parse_custom_fields_mapping(d.pop("custom_fields_mapping", UNSET)) diff --git a/rootly_sdk/models/update_service_now_incident_task_params_completion.py b/rootly_sdk/models/update_service_now_incident_task_params_completion.py index f88a1164..5c4a45fc 100644 --- a/rootly_sdk/models/update_service_now_incident_task_params_completion.py +++ b/rootly_sdk/models/update_service_now_incident_task_params_completion.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,12 +14,12 @@ class UpdateServiceNowIncidentTaskParamsCompletion: """The completion id and display name Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_service_now_incident_task_params_priority.py b/rootly_sdk/models/update_service_now_incident_task_params_priority.py index a48fa9a6..05a8ddf4 100644 --- a/rootly_sdk/models/update_service_now_incident_task_params_priority.py +++ b/rootly_sdk/models/update_service_now_incident_task_params_priority.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,12 +14,12 @@ class UpdateServiceNowIncidentTaskParamsPriority: """The priority id and display name Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_severity.py b/rootly_sdk/models/update_severity.py index c4018f33..eea36150 100644 --- a/rootly_sdk/models/update_severity.py +++ b/rootly_sdk/models/update_severity.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateSeverity: data (UpdateSeverityData): """ - data: UpdateSeverityData + data: "UpdateSeverityData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_severity_data.py b/rootly_sdk/models/update_severity_data.py index 7e03bb83..3e607d77 100644 --- a/rootly_sdk/models/update_severity_data.py +++ b/rootly_sdk/models/update_severity_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class UpdateSeverityData: """ type_: UpdateSeverityDataType - attributes: UpdateSeverityDataAttributes + attributes: "UpdateSeverityDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_severity_data_attributes.py b/rootly_sdk/models/update_severity_data_attributes.py index 0cba8e42..a5c4b508 100644 --- a/rootly_sdk/models/update_severity_data_attributes.py +++ b/rootly_sdk/models/update_severity_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -27,54 +25,62 @@ class UpdateSeverityDataAttributes: """ Attributes: - name (str | Unset): The name of the severity - description (None | str | Unset): The description of the severity - severity (UpdateSeverityDataAttributesSeverity | Unset): The severity of the severity - color (None | str | Unset): The hex color of the severity - position (int | None | Unset): Position of the severity - notify_emails (list[str] | None | Unset): Emails to attach to the severity - slack_channels (list[UpdateSeverityDataAttributesSlackChannelsType0Item] | None | Unset): Slack Channels + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + name (Union[Unset, str]): The name of the severity + description (Union[None, Unset, str]): The description of the severity + severity (Union[Unset, UpdateSeverityDataAttributesSeverity]): The severity of the severity + color (Union[None, Unset, str]): The hex color of the severity + position (Union[None, Unset, int]): Position of the severity + notify_emails (Union[None, Unset, list[str]]): Emails to attach to the severity + slack_channels (Union[None, Unset, list['UpdateSeverityDataAttributesSlackChannelsType0Item']]): Slack Channels + associated with this severity + slack_aliases (Union[None, Unset, list['UpdateSeverityDataAttributesSlackAliasesType0Item']]): Slack Aliases associated with this severity - slack_aliases (list[UpdateSeverityDataAttributesSlackAliasesType0Item] | None | Unset): Slack Aliases associated - with this severity """ - name: str | Unset = UNSET - description: None | str | Unset = UNSET - severity: UpdateSeverityDataAttributesSeverity | Unset = UNSET - color: None | str | Unset = UNSET - position: int | None | Unset = UNSET - notify_emails: list[str] | None | Unset = UNSET - slack_channels: list[UpdateSeverityDataAttributesSlackChannelsType0Item] | None | Unset = UNSET - slack_aliases: list[UpdateSeverityDataAttributesSlackAliasesType0Item] | None | Unset = UNSET + slug: Union[None, Unset, str] = UNSET + name: Union[Unset, str] = UNSET + description: Union[None, Unset, str] = UNSET + severity: Union[Unset, UpdateSeverityDataAttributesSeverity] = UNSET + color: Union[None, Unset, str] = UNSET + position: Union[None, Unset, int] = UNSET + notify_emails: Union[None, Unset, list[str]] = UNSET + slack_channels: Union[None, Unset, list["UpdateSeverityDataAttributesSlackChannelsType0Item"]] = UNSET + slack_aliases: Union[None, Unset, list["UpdateSeverityDataAttributesSlackAliasesType0Item"]] = UNSET def to_dict(self) -> dict[str, Any]: + slug: Union[None, Unset, str] + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug name = self.name - description: None | str | Unset + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: description = self.description - severity: str | Unset = UNSET + severity: Union[Unset, str] = UNSET if not isinstance(self.severity, Unset): severity = self.severity - color: None | str | Unset + color: Union[None, Unset, str] if isinstance(self.color, Unset): color = UNSET else: color = self.color - position: int | None | Unset + position: Union[None, Unset, int] if isinstance(self.position, Unset): position = UNSET else: position = self.position - notify_emails: list[str] | None | Unset + notify_emails: Union[None, Unset, list[str]] if isinstance(self.notify_emails, Unset): notify_emails = UNSET elif isinstance(self.notify_emails, list): @@ -83,7 +89,7 @@ def to_dict(self) -> dict[str, Any]: else: notify_emails = self.notify_emails - slack_channels: list[dict[str, Any]] | None | Unset + slack_channels: Union[None, Unset, list[dict[str, Any]]] if isinstance(self.slack_channels, Unset): slack_channels = UNSET elif isinstance(self.slack_channels, list): @@ -95,7 +101,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_channels = self.slack_channels - slack_aliases: list[dict[str, Any]] | None | Unset + slack_aliases: Union[None, Unset, list[dict[str, Any]]] if isinstance(self.slack_aliases, Unset): slack_aliases = UNSET elif isinstance(self.slack_aliases, list): @@ -110,6 +116,8 @@ def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} field_dict.update({}) + if slug is not UNSET: + field_dict["slug"] = slug if name is not UNSET: field_dict["name"] = name if description is not UNSET: @@ -139,43 +147,53 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: ) d = dict(src_dict) + + def _parse_slug(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + slug = _parse_slug(d.pop("slug", UNSET)) + name = d.pop("name", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) _severity = d.pop("severity", UNSET) - severity: UpdateSeverityDataAttributesSeverity | Unset + severity: Union[Unset, UpdateSeverityDataAttributesSeverity] if isinstance(_severity, Unset): severity = UNSET else: severity = check_update_severity_data_attributes_severity(_severity) - def _parse_color(data: object) -> None | str | Unset: + def _parse_color(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) color = _parse_color(d.pop("color", UNSET)) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> Union[None, Unset, int]: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(Union[None, Unset, int], data) position = _parse_position(d.pop("position", UNSET)) - def _parse_notify_emails(data: object) -> list[str] | None | Unset: + def _parse_notify_emails(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -186,15 +204,15 @@ def _parse_notify_emails(data: object) -> list[str] | None | Unset: notify_emails_type_0 = cast(list[str], data) return notify_emails_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) notify_emails = _parse_notify_emails(d.pop("notify_emails", UNSET)) def _parse_slack_channels( data: object, - ) -> list[UpdateSeverityDataAttributesSlackChannelsType0Item] | None | Unset: + ) -> Union[None, Unset, list["UpdateSeverityDataAttributesSlackChannelsType0Item"]]: if data is None: return data if isinstance(data, Unset): @@ -212,15 +230,15 @@ def _parse_slack_channels( slack_channels_type_0.append(slack_channels_type_0_item) return slack_channels_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[UpdateSeverityDataAttributesSlackChannelsType0Item] | None | Unset, data) + return cast(Union[None, Unset, list["UpdateSeverityDataAttributesSlackChannelsType0Item"]], data) slack_channels = _parse_slack_channels(d.pop("slack_channels", UNSET)) def _parse_slack_aliases( data: object, - ) -> list[UpdateSeverityDataAttributesSlackAliasesType0Item] | None | Unset: + ) -> Union[None, Unset, list["UpdateSeverityDataAttributesSlackAliasesType0Item"]]: if data is None: return data if isinstance(data, Unset): @@ -238,13 +256,14 @@ def _parse_slack_aliases( slack_aliases_type_0.append(slack_aliases_type_0_item) return slack_aliases_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[UpdateSeverityDataAttributesSlackAliasesType0Item] | None | Unset, data) + return cast(Union[None, Unset, list["UpdateSeverityDataAttributesSlackAliasesType0Item"]], data) slack_aliases = _parse_slack_aliases(d.pop("slack_aliases", UNSET)) update_severity_data_attributes = cls( + slug=slug, name=name, description=description, severity=severity, diff --git a/rootly_sdk/models/update_severity_data_attributes_slack_aliases_type_0_item.py b/rootly_sdk/models/update_severity_data_attributes_slack_aliases_type_0_item.py index ac383ddc..bfe51d70 100644 --- a/rootly_sdk/models/update_severity_data_attributes_slack_aliases_type_0_item.py +++ b/rootly_sdk/models/update_severity_data_attributes_slack_aliases_type_0_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/update_severity_data_attributes_slack_channels_type_0_item.py b/rootly_sdk/models/update_severity_data_attributes_slack_channels_type_0_item.py index e4b47c5e..f429bb07 100644 --- a/rootly_sdk/models/update_severity_data_attributes_slack_channels_type_0_item.py +++ b/rootly_sdk/models/update_severity_data_attributes_slack_channels_type_0_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/update_sharepoint_page_task_params.py b/rootly_sdk/models/update_sharepoint_page_task_params.py index c8af9115..6f3ae806 100644 --- a/rootly_sdk/models/update_sharepoint_page_task_params.py +++ b/rootly_sdk/models/update_sharepoint_page_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -20,23 +18,23 @@ class UpdateSharepointPageTaskParams: """ Attributes: file_id (str): The SharePoint file ID - task_type (UpdateSharepointPageTaskParamsTaskType | Unset): - title (str | Unset): The SharePoint document title - content (str | Unset): The SharePoint document content - post_mortem_template_id (str | Unset): Retrospective template to use when updating document, if desired + task_type (Union[Unset, UpdateSharepointPageTaskParamsTaskType]): + title (Union[Unset, str]): The SharePoint document title + content (Union[Unset, str]): The SharePoint document content + post_mortem_template_id (Union[Unset, str]): Retrospective template to use when updating document, if desired """ file_id: str - task_type: UpdateSharepointPageTaskParamsTaskType | Unset = UNSET - title: str | Unset = UNSET - content: str | Unset = UNSET - post_mortem_template_id: str | Unset = UNSET + task_type: Union[Unset, UpdateSharepointPageTaskParamsTaskType] = UNSET + title: Union[Unset, str] = UNSET + content: Union[Unset, str] = UNSET + post_mortem_template_id: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: file_id = self.file_id - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -70,7 +68,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: file_id = d.pop("file_id") _task_type = d.pop("task_type", UNSET) - task_type: UpdateSharepointPageTaskParamsTaskType | Unset + task_type: Union[Unset, UpdateSharepointPageTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/update_shortcut_story_task_params.py b/rootly_sdk/models/update_shortcut_story_task_params.py index 9064d34c..d822fa64 100644 --- a/rootly_sdk/models/update_shortcut_story_task_params.py +++ b/rootly_sdk/models/update_shortcut_story_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -25,29 +23,28 @@ class UpdateShortcutStoryTaskParams: Attributes: story_id (str): The story id archivation (UpdateShortcutStoryTaskParamsArchivation): The archivation id and display name - task_type (UpdateShortcutStoryTaskParamsTaskType | Unset): - title (str | Unset): The incident title - description (str | Unset): The incident description - labels (str | Unset): The story labels - due_date (str | Unset): The due date + task_type (Union[Unset, UpdateShortcutStoryTaskParamsTaskType]): + title (Union[Unset, str]): The incident title + description (Union[Unset, str]): The incident description + labels (Union[Unset, str]): The story labels + due_date (Union[Unset, str]): The due date """ story_id: str - archivation: UpdateShortcutStoryTaskParamsArchivation - task_type: UpdateShortcutStoryTaskParamsTaskType | Unset = UNSET - title: str | Unset = UNSET - description: str | Unset = UNSET - labels: str | Unset = UNSET - due_date: str | Unset = UNSET + archivation: "UpdateShortcutStoryTaskParamsArchivation" + task_type: Union[Unset, UpdateShortcutStoryTaskParamsTaskType] = UNSET + title: Union[Unset, str] = UNSET + description: Union[Unset, str] = UNSET + labels: Union[Unset, str] = UNSET + due_date: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - story_id = self.story_id archivation = self.archivation.to_dict() - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -90,7 +87,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: archivation = UpdateShortcutStoryTaskParamsArchivation.from_dict(d.pop("archivation")) _task_type = d.pop("task_type", UNSET) - task_type: UpdateShortcutStoryTaskParamsTaskType | Unset + task_type: Union[Unset, UpdateShortcutStoryTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/update_shortcut_story_task_params_archivation.py b/rootly_sdk/models/update_shortcut_story_task_params_archivation.py index faabfdc3..c8b5d40e 100644 --- a/rootly_sdk/models/update_shortcut_story_task_params_archivation.py +++ b/rootly_sdk/models/update_shortcut_story_task_params_archivation.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,12 +14,12 @@ class UpdateShortcutStoryTaskParamsArchivation: """The archivation id and display name Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_shortcut_task_task_params.py b/rootly_sdk/models/update_shortcut_task_task_params.py index 4d0d99c3..eb00d6f2 100644 --- a/rootly_sdk/models/update_shortcut_task_task_params.py +++ b/rootly_sdk/models/update_shortcut_task_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -26,26 +24,25 @@ class UpdateShortcutTaskTaskParams: task_id (str): The task id parent_story_id (str): The parent story completion (UpdateShortcutTaskTaskParamsCompletion): The completion id and display name - task_type (UpdateShortcutTaskTaskParamsTaskType | Unset): - description (str | Unset): The task description + task_type (Union[Unset, UpdateShortcutTaskTaskParamsTaskType]): + description (Union[Unset, str]): The task description """ task_id: str parent_story_id: str - completion: UpdateShortcutTaskTaskParamsCompletion - task_type: UpdateShortcutTaskTaskParamsTaskType | Unset = UNSET - description: str | Unset = UNSET + completion: "UpdateShortcutTaskTaskParamsCompletion" + task_type: Union[Unset, UpdateShortcutTaskTaskParamsTaskType] = UNSET + description: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - task_id = self.task_id parent_story_id = self.parent_story_id completion = self.completion.to_dict() - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -79,7 +76,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: completion = UpdateShortcutTaskTaskParamsCompletion.from_dict(d.pop("completion")) _task_type = d.pop("task_type", UNSET) - task_type: UpdateShortcutTaskTaskParamsTaskType | Unset + task_type: Union[Unset, UpdateShortcutTaskTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/update_shortcut_task_task_params_completion.py b/rootly_sdk/models/update_shortcut_task_task_params_completion.py index 1d7d80bf..c38cfc45 100644 --- a/rootly_sdk/models/update_shortcut_task_task_params_completion.py +++ b/rootly_sdk/models/update_shortcut_task_task_params_completion.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,12 +14,12 @@ class UpdateShortcutTaskTaskParamsCompletion: """The completion id and display name Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_sla.py b/rootly_sdk/models/update_sla.py index 37dabf11..06214811 100644 --- a/rootly_sdk/models/update_sla.py +++ b/rootly_sdk/models/update_sla.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateSla: data (UpdateSlaData): """ - data: UpdateSlaData + data: "UpdateSlaData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_sla_data.py b/rootly_sdk/models/update_sla_data.py index d172f4f3..8676003f 100644 --- a/rootly_sdk/models/update_sla_data.py +++ b/rootly_sdk/models/update_sla_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class UpdateSlaData: """ type_: UpdateSlaDataType - attributes: UpdateSlaDataAttributes + attributes: "UpdateSlaDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_sla_data_attributes.py b/rootly_sdk/models/update_sla_data_attributes.py index 76ae5a32..9629d9da 100644 --- a/rootly_sdk/models/update_sla_data_attributes.py +++ b/rootly_sdk/models/update_sla_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from uuid import UUID from attrs import define as _attrs_define @@ -42,73 +40,81 @@ class UpdateSlaDataAttributes: """ Attributes: - name (str | Unset): The name of the SLA - description (None | str | Unset): A description of the SLA - position (int | None | Unset): Position of the SLA for ordering - condition_match_type (UpdateSlaDataAttributesConditionMatchType | Unset): Whether all or any conditions must - match - manager_role_id (None | Unset | UUID): The ID of the incident role responsible for this SLA. Exactly one of + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + name (Union[Unset, str]): The name of the SLA + description (Union[None, Unset, str]): A description of the SLA + position (Union[None, Unset, int]): Position of the SLA for ordering + condition_match_type (Union[Unset, UpdateSlaDataAttributesConditionMatchType]): Whether all or any conditions + must match + manager_role_id (Union[None, UUID, Unset]): The ID of the incident role responsible for this SLA. Exactly one of `manager_role_id` or `manager_user_id` must be provided. - manager_user_id (int | None | Unset): The ID of the user responsible for this SLA. Exactly one of + manager_user_id (Union[None, Unset, int]): The ID of the user responsible for this SLA. Exactly one of `manager_role_id` or `manager_user_id` must be provided. - assignment_deadline_days (UpdateSlaDataAttributesAssignmentDeadlineDays | Unset): Number of days for the + assignment_deadline_days (Union[Unset, UpdateSlaDataAttributesAssignmentDeadlineDays]): Number of days for the assignment deadline - assignment_deadline_parent_status (UpdateSlaDataAttributesAssignmentDeadlineParentStatus | Unset): The incident - parent status that triggers the assignment deadline - assignment_deadline_sub_status_id (None | Unset | UUID): Sub-status for the assignment deadline. Required when - custom lifecycle statuses are enabled on the team. - assignment_skip_weekends (bool | Unset): Whether to skip weekends when calculating the assignment deadline - completion_deadline_days (UpdateSlaDataAttributesCompletionDeadlineDays | Unset): Number of days for the + assignment_deadline_parent_status (Union[Unset, UpdateSlaDataAttributesAssignmentDeadlineParentStatus]): The + incident parent status that triggers the assignment deadline + assignment_deadline_sub_status_id (Union[None, UUID, Unset]): Sub-status for the assignment deadline. Required + when custom lifecycle statuses are enabled on the team. + assignment_skip_weekends (Union[Unset, bool]): Whether to skip weekends when calculating the assignment deadline + completion_deadline_days (Union[Unset, UpdateSlaDataAttributesCompletionDeadlineDays]): Number of days for the completion deadline - completion_deadline_parent_status (UpdateSlaDataAttributesCompletionDeadlineParentStatus | Unset): The incident - parent status that triggers the completion deadline - completion_deadline_sub_status_id (None | Unset | UUID): Sub-status for the completion deadline. Required when - custom lifecycle statuses are enabled on the team. - completion_skip_weekends (bool | Unset): Whether to skip weekends when calculating the completion deadline - conditions (list[UpdateSlaDataAttributesConditionsItem] | Unset): Conditions that determine which incidents this - SLA applies to. Replaces all existing conditions. - notification_configurations (list[UpdateSlaDataAttributesNotificationConfigurationsItem] | Unset): Notification - timing configurations. Replaces all existing configurations. + completion_deadline_parent_status (Union[Unset, UpdateSlaDataAttributesCompletionDeadlineParentStatus]): The + incident parent status that triggers the completion deadline + completion_deadline_sub_status_id (Union[None, UUID, Unset]): Sub-status for the completion deadline. Required + when custom lifecycle statuses are enabled on the team. + completion_skip_weekends (Union[Unset, bool]): Whether to skip weekends when calculating the completion deadline + conditions (Union[Unset, list['UpdateSlaDataAttributesConditionsItem']]): Conditions that determine which + incidents this SLA applies to. Replaces all existing conditions. + notification_configurations (Union[Unset, list['UpdateSlaDataAttributesNotificationConfigurationsItem']]): + Notification timing configurations. Replaces all existing configurations. """ - name: str | Unset = UNSET - description: None | str | Unset = UNSET - position: int | None | Unset = UNSET - condition_match_type: UpdateSlaDataAttributesConditionMatchType | Unset = UNSET - manager_role_id: None | Unset | UUID = UNSET - manager_user_id: int | None | Unset = UNSET - assignment_deadline_days: UpdateSlaDataAttributesAssignmentDeadlineDays | Unset = UNSET - assignment_deadline_parent_status: UpdateSlaDataAttributesAssignmentDeadlineParentStatus | Unset = UNSET - assignment_deadline_sub_status_id: None | Unset | UUID = UNSET - assignment_skip_weekends: bool | Unset = UNSET - completion_deadline_days: UpdateSlaDataAttributesCompletionDeadlineDays | Unset = UNSET - completion_deadline_parent_status: UpdateSlaDataAttributesCompletionDeadlineParentStatus | Unset = UNSET - completion_deadline_sub_status_id: None | Unset | UUID = UNSET - completion_skip_weekends: bool | Unset = UNSET - conditions: list[UpdateSlaDataAttributesConditionsItem] | Unset = UNSET - notification_configurations: list[UpdateSlaDataAttributesNotificationConfigurationsItem] | Unset = UNSET + slug: Union[None, Unset, str] = UNSET + name: Union[Unset, str] = UNSET + description: Union[None, Unset, str] = UNSET + position: Union[None, Unset, int] = UNSET + condition_match_type: Union[Unset, UpdateSlaDataAttributesConditionMatchType] = UNSET + manager_role_id: Union[None, UUID, Unset] = UNSET + manager_user_id: Union[None, Unset, int] = UNSET + assignment_deadline_days: Union[Unset, UpdateSlaDataAttributesAssignmentDeadlineDays] = UNSET + assignment_deadline_parent_status: Union[Unset, UpdateSlaDataAttributesAssignmentDeadlineParentStatus] = UNSET + assignment_deadline_sub_status_id: Union[None, UUID, Unset] = UNSET + assignment_skip_weekends: Union[Unset, bool] = UNSET + completion_deadline_days: Union[Unset, UpdateSlaDataAttributesCompletionDeadlineDays] = UNSET + completion_deadline_parent_status: Union[Unset, UpdateSlaDataAttributesCompletionDeadlineParentStatus] = UNSET + completion_deadline_sub_status_id: Union[None, UUID, Unset] = UNSET + completion_skip_weekends: Union[Unset, bool] = UNSET + conditions: Union[Unset, list["UpdateSlaDataAttributesConditionsItem"]] = UNSET + notification_configurations: Union[Unset, list["UpdateSlaDataAttributesNotificationConfigurationsItem"]] = UNSET def to_dict(self) -> dict[str, Any]: + slug: Union[None, Unset, str] + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug name = self.name - description: None | str | Unset + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: description = self.description - position: int | None | Unset + position: Union[None, Unset, int] if isinstance(self.position, Unset): position = UNSET else: position = self.position - condition_match_type: str | Unset = UNSET + condition_match_type: Union[Unset, str] = UNSET if not isinstance(self.condition_match_type, Unset): condition_match_type = self.condition_match_type - manager_role_id: None | str | Unset + manager_role_id: Union[None, Unset, str] if isinstance(self.manager_role_id, Unset): manager_role_id = UNSET elif isinstance(self.manager_role_id, UUID): @@ -116,21 +122,21 @@ def to_dict(self) -> dict[str, Any]: else: manager_role_id = self.manager_role_id - manager_user_id: int | None | Unset + manager_user_id: Union[None, Unset, int] if isinstance(self.manager_user_id, Unset): manager_user_id = UNSET else: manager_user_id = self.manager_user_id - assignment_deadline_days: int | Unset = UNSET + assignment_deadline_days: Union[Unset, int] = UNSET if not isinstance(self.assignment_deadline_days, Unset): assignment_deadline_days = self.assignment_deadline_days - assignment_deadline_parent_status: str | Unset = UNSET + assignment_deadline_parent_status: Union[Unset, str] = UNSET if not isinstance(self.assignment_deadline_parent_status, Unset): assignment_deadline_parent_status = self.assignment_deadline_parent_status - assignment_deadline_sub_status_id: None | str | Unset + assignment_deadline_sub_status_id: Union[None, Unset, str] if isinstance(self.assignment_deadline_sub_status_id, Unset): assignment_deadline_sub_status_id = UNSET elif isinstance(self.assignment_deadline_sub_status_id, UUID): @@ -140,15 +146,15 @@ def to_dict(self) -> dict[str, Any]: assignment_skip_weekends = self.assignment_skip_weekends - completion_deadline_days: int | Unset = UNSET + completion_deadline_days: Union[Unset, int] = UNSET if not isinstance(self.completion_deadline_days, Unset): completion_deadline_days = self.completion_deadline_days - completion_deadline_parent_status: str | Unset = UNSET + completion_deadline_parent_status: Union[Unset, str] = UNSET if not isinstance(self.completion_deadline_parent_status, Unset): completion_deadline_parent_status = self.completion_deadline_parent_status - completion_deadline_sub_status_id: None | str | Unset + completion_deadline_sub_status_id: Union[None, Unset, str] if isinstance(self.completion_deadline_sub_status_id, Unset): completion_deadline_sub_status_id = UNSET elif isinstance(self.completion_deadline_sub_status_id, UUID): @@ -158,14 +164,14 @@ def to_dict(self) -> dict[str, Any]: completion_skip_weekends = self.completion_skip_weekends - conditions: list[dict[str, Any]] | Unset = UNSET + conditions: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.conditions, Unset): conditions = [] for conditions_item_data in self.conditions: conditions_item = conditions_item_data.to_dict() conditions.append(conditions_item) - notification_configurations: list[dict[str, Any]] | Unset = UNSET + notification_configurations: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.notification_configurations, Unset): notification_configurations = [] for notification_configurations_item_data in self.notification_configurations: @@ -175,6 +181,8 @@ def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} field_dict.update({}) + if slug is not UNSET: + field_dict["slug"] = slug if name is not UNSET: field_dict["name"] = name if description is not UNSET: @@ -218,34 +226,44 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: ) d = dict(src_dict) + + def _parse_slug(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + slug = _parse_slug(d.pop("slug", UNSET)) + name = d.pop("name", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> Union[None, Unset, int]: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(Union[None, Unset, int], data) position = _parse_position(d.pop("position", UNSET)) _condition_match_type = d.pop("condition_match_type", UNSET) - condition_match_type: UpdateSlaDataAttributesConditionMatchType | Unset + condition_match_type: Union[Unset, UpdateSlaDataAttributesConditionMatchType] if isinstance(_condition_match_type, Unset): condition_match_type = UNSET else: condition_match_type = check_update_sla_data_attributes_condition_match_type(_condition_match_type) - def _parse_manager_role_id(data: object) -> None | Unset | UUID: + def _parse_manager_role_id(data: object) -> Union[None, UUID, Unset]: if data is None: return data if isinstance(data, Unset): @@ -256,23 +274,23 @@ def _parse_manager_role_id(data: object) -> None | Unset | UUID: manager_role_id_type_0 = UUID(data) return manager_role_id_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(None | Unset | UUID, data) + return cast(Union[None, UUID, Unset], data) manager_role_id = _parse_manager_role_id(d.pop("manager_role_id", UNSET)) - def _parse_manager_user_id(data: object) -> int | None | Unset: + def _parse_manager_user_id(data: object) -> Union[None, Unset, int]: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(Union[None, Unset, int], data) manager_user_id = _parse_manager_user_id(d.pop("manager_user_id", UNSET)) _assignment_deadline_days = d.pop("assignment_deadline_days", UNSET) - assignment_deadline_days: UpdateSlaDataAttributesAssignmentDeadlineDays | Unset + assignment_deadline_days: Union[Unset, UpdateSlaDataAttributesAssignmentDeadlineDays] if isinstance(_assignment_deadline_days, Unset): assignment_deadline_days = UNSET else: @@ -281,7 +299,7 @@ def _parse_manager_user_id(data: object) -> int | None | Unset: ) _assignment_deadline_parent_status = d.pop("assignment_deadline_parent_status", UNSET) - assignment_deadline_parent_status: UpdateSlaDataAttributesAssignmentDeadlineParentStatus | Unset + assignment_deadline_parent_status: Union[Unset, UpdateSlaDataAttributesAssignmentDeadlineParentStatus] if isinstance(_assignment_deadline_parent_status, Unset): assignment_deadline_parent_status = UNSET else: @@ -289,7 +307,7 @@ def _parse_manager_user_id(data: object) -> int | None | Unset: _assignment_deadline_parent_status ) - def _parse_assignment_deadline_sub_status_id(data: object) -> None | Unset | UUID: + def _parse_assignment_deadline_sub_status_id(data: object) -> Union[None, UUID, Unset]: if data is None: return data if isinstance(data, Unset): @@ -300,9 +318,9 @@ def _parse_assignment_deadline_sub_status_id(data: object) -> None | Unset | UUI assignment_deadline_sub_status_id_type_0 = UUID(data) return assignment_deadline_sub_status_id_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(None | Unset | UUID, data) + return cast(Union[None, UUID, Unset], data) assignment_deadline_sub_status_id = _parse_assignment_deadline_sub_status_id( d.pop("assignment_deadline_sub_status_id", UNSET) @@ -311,7 +329,7 @@ def _parse_assignment_deadline_sub_status_id(data: object) -> None | Unset | UUI assignment_skip_weekends = d.pop("assignment_skip_weekends", UNSET) _completion_deadline_days = d.pop("completion_deadline_days", UNSET) - completion_deadline_days: UpdateSlaDataAttributesCompletionDeadlineDays | Unset + completion_deadline_days: Union[Unset, UpdateSlaDataAttributesCompletionDeadlineDays] if isinstance(_completion_deadline_days, Unset): completion_deadline_days = UNSET else: @@ -320,7 +338,7 @@ def _parse_assignment_deadline_sub_status_id(data: object) -> None | Unset | UUI ) _completion_deadline_parent_status = d.pop("completion_deadline_parent_status", UNSET) - completion_deadline_parent_status: UpdateSlaDataAttributesCompletionDeadlineParentStatus | Unset + completion_deadline_parent_status: Union[Unset, UpdateSlaDataAttributesCompletionDeadlineParentStatus] if isinstance(_completion_deadline_parent_status, Unset): completion_deadline_parent_status = UNSET else: @@ -328,7 +346,7 @@ def _parse_assignment_deadline_sub_status_id(data: object) -> None | Unset | UUI _completion_deadline_parent_status ) - def _parse_completion_deadline_sub_status_id(data: object) -> None | Unset | UUID: + def _parse_completion_deadline_sub_status_id(data: object) -> Union[None, UUID, Unset]: if data is None: return data if isinstance(data, Unset): @@ -339,9 +357,9 @@ def _parse_completion_deadline_sub_status_id(data: object) -> None | Unset | UUI completion_deadline_sub_status_id_type_0 = UUID(data) return completion_deadline_sub_status_id_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(None | Unset | UUID, data) + return cast(Union[None, UUID, Unset], data) completion_deadline_sub_status_id = _parse_completion_deadline_sub_status_id( d.pop("completion_deadline_sub_status_id", UNSET) @@ -349,27 +367,24 @@ def _parse_completion_deadline_sub_status_id(data: object) -> None | Unset | UUI completion_skip_weekends = d.pop("completion_skip_weekends", UNSET) + conditions = [] _conditions = d.pop("conditions", UNSET) - conditions: list[UpdateSlaDataAttributesConditionsItem] | Unset = UNSET - if _conditions is not UNSET: - conditions = [] - for conditions_item_data in _conditions: - conditions_item = UpdateSlaDataAttributesConditionsItem.from_dict(conditions_item_data) + for conditions_item_data in _conditions or []: + conditions_item = UpdateSlaDataAttributesConditionsItem.from_dict(conditions_item_data) - conditions.append(conditions_item) + conditions.append(conditions_item) + notification_configurations = [] _notification_configurations = d.pop("notification_configurations", UNSET) - notification_configurations: list[UpdateSlaDataAttributesNotificationConfigurationsItem] | Unset = UNSET - if _notification_configurations is not UNSET: - notification_configurations = [] - for notification_configurations_item_data in _notification_configurations: - notification_configurations_item = UpdateSlaDataAttributesNotificationConfigurationsItem.from_dict( - notification_configurations_item_data - ) + for notification_configurations_item_data in _notification_configurations or []: + notification_configurations_item = UpdateSlaDataAttributesNotificationConfigurationsItem.from_dict( + notification_configurations_item_data + ) - notification_configurations.append(notification_configurations_item) + notification_configurations.append(notification_configurations_item) update_sla_data_attributes = cls( + slug=slug, name=name, description=description, position=position, diff --git a/rootly_sdk/models/update_sla_data_attributes_conditions_item.py b/rootly_sdk/models/update_sla_data_attributes_conditions_item.py index 2b02950b..e7decffd 100644 --- a/rootly_sdk/models/update_sla_data_attributes_conditions_item.py +++ b/rootly_sdk/models/update_sla_data_attributes_conditions_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from uuid import UUID from attrs import define as _attrs_define @@ -26,21 +24,21 @@ class UpdateSlaDataAttributesConditionsItem: Attributes: conditionable_type (UpdateSlaDataAttributesConditionsItemConditionableType): The type of condition operator (str): The comparison operator - property_ (UpdateSlaDataAttributesConditionsItemProperty | Unset): The property to evaluate (for built-in field - conditions). When the team has custom lifecycle statuses enabled, use 'sub_status' (with sub-status IDs as + property_ (Union[Unset, UpdateSlaDataAttributesConditionsItemProperty]): The property to evaluate (for built-in + field conditions). When the team has custom lifecycle statuses enabled, use 'sub_status' (with sub-status IDs as values); otherwise use 'status' (with parent status names). Sending the wrong one will return a validation error. - values (list[str] | None | Unset): The values to compare against - form_field_id (None | Unset | UUID): The ID of the form field (for custom field conditions) - position (int | Unset): The position of the condition for ordering + values (Union[None, Unset, list[str]]): The values to compare against + form_field_id (Union[None, UUID, Unset]): The ID of the form field (for custom field conditions) + position (Union[Unset, int]): The position of the condition for ordering """ conditionable_type: UpdateSlaDataAttributesConditionsItemConditionableType operator: str - property_: UpdateSlaDataAttributesConditionsItemProperty | Unset = UNSET - values: list[str] | None | Unset = UNSET - form_field_id: None | Unset | UUID = UNSET - position: int | Unset = UNSET + property_: Union[Unset, UpdateSlaDataAttributesConditionsItemProperty] = UNSET + values: Union[None, Unset, list[str]] = UNSET + form_field_id: Union[None, UUID, Unset] = UNSET + position: Union[Unset, int] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -48,11 +46,11 @@ def to_dict(self) -> dict[str, Any]: operator = self.operator - property_: str | Unset = UNSET + property_: Union[Unset, str] = UNSET if not isinstance(self.property_, Unset): property_ = self.property_ - values: list[str] | None | Unset + values: Union[None, Unset, list[str]] if isinstance(self.values, Unset): values = UNSET elif isinstance(self.values, list): @@ -61,7 +59,7 @@ def to_dict(self) -> dict[str, Any]: else: values = self.values - form_field_id: None | str | Unset + form_field_id: Union[None, Unset, str] if isinstance(self.form_field_id, Unset): form_field_id = UNSET elif isinstance(self.form_field_id, UUID): @@ -100,13 +98,13 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: operator = d.pop("operator") _property_ = d.pop("property", UNSET) - property_: UpdateSlaDataAttributesConditionsItemProperty | Unset + property_: Union[Unset, UpdateSlaDataAttributesConditionsItemProperty] if isinstance(_property_, Unset): property_ = UNSET else: property_ = check_update_sla_data_attributes_conditions_item_property(_property_) - def _parse_values(data: object) -> list[str] | None | Unset: + def _parse_values(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -117,13 +115,13 @@ def _parse_values(data: object) -> list[str] | None | Unset: values_type_0 = cast(list[str], data) return values_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) values = _parse_values(d.pop("values", UNSET)) - def _parse_form_field_id(data: object) -> None | Unset | UUID: + def _parse_form_field_id(data: object) -> Union[None, UUID, Unset]: if data is None: return data if isinstance(data, Unset): @@ -134,9 +132,9 @@ def _parse_form_field_id(data: object) -> None | Unset | UUID: form_field_id_type_0 = UUID(data) return form_field_id_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(None | Unset | UUID, data) + return cast(Union[None, UUID, Unset], data) form_field_id = _parse_form_field_id(d.pop("form_field_id", UNSET)) diff --git a/rootly_sdk/models/update_sla_data_attributes_notification_configurations_item.py b/rootly_sdk/models/update_sla_data_attributes_notification_configurations_item.py index d4296bf0..9e6b7a2c 100644 --- a/rootly_sdk/models/update_sla_data_attributes_notification_configurations_item.py +++ b/rootly_sdk/models/update_sla_data_attributes_notification_configurations_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/update_slack_channel_topic_task_params.py b/rootly_sdk/models/update_slack_channel_topic_task_params.py index bad81d39..8a1b913b 100644 --- a/rootly_sdk/models/update_slack_channel_topic_task_params.py +++ b/rootly_sdk/models/update_slack_channel_topic_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -25,21 +23,20 @@ class UpdateSlackChannelTopicTaskParams: Attributes: channel (UpdateSlackChannelTopicTaskParamsChannel): topic (str): - task_type (UpdateSlackChannelTopicTaskParamsTaskType | Unset): + task_type (Union[Unset, UpdateSlackChannelTopicTaskParamsTaskType]): """ - channel: UpdateSlackChannelTopicTaskParamsChannel + channel: "UpdateSlackChannelTopicTaskParamsChannel" topic: str - task_type: UpdateSlackChannelTopicTaskParamsTaskType | Unset = UNSET + task_type: Union[Unset, UpdateSlackChannelTopicTaskParamsTaskType] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - channel = self.channel.to_dict() topic = self.topic - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -66,7 +63,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: topic = d.pop("topic") _task_type = d.pop("task_type", UNSET) - task_type: UpdateSlackChannelTopicTaskParamsTaskType | Unset + task_type: Union[Unset, UpdateSlackChannelTopicTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/update_slack_channel_topic_task_params_channel.py b/rootly_sdk/models/update_slack_channel_topic_task_params_channel.py index 134f02c9..26ab56c7 100644 --- a/rootly_sdk/models/update_slack_channel_topic_task_params_channel.py +++ b/rootly_sdk/models/update_slack_channel_topic_task_params_channel.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class UpdateSlackChannelTopicTaskParamsChannel: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_status_page.py b/rootly_sdk/models/update_status_page.py index cd6792b0..3cbbccdd 100644 --- a/rootly_sdk/models/update_status_page.py +++ b/rootly_sdk/models/update_status_page.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateStatusPage: data (UpdateStatusPageData): """ - data: UpdateStatusPageData + data: "UpdateStatusPageData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_status_page_announcement.py b/rootly_sdk/models/update_status_page_announcement.py new file mode 100644 index 00000000..4fa689e1 --- /dev/null +++ b/rootly_sdk/models/update_status_page_announcement.py @@ -0,0 +1,65 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +if TYPE_CHECKING: + from ..models.update_status_page_announcement_data import UpdateStatusPageAnnouncementData + + +T = TypeVar("T", bound="UpdateStatusPageAnnouncement") + + +@_attrs_define +class UpdateStatusPageAnnouncement: + """ + Attributes: + data (UpdateStatusPageAnnouncementData): + """ + + data: "UpdateStatusPageAnnouncementData" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "data": data, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.update_status_page_announcement_data import UpdateStatusPageAnnouncementData + + d = dict(src_dict) + data = UpdateStatusPageAnnouncementData.from_dict(d.pop("data")) + + update_status_page_announcement = cls( + data=data, + ) + + update_status_page_announcement.additional_properties = d + return update_status_page_announcement + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/rootly_sdk/models/update_status_page_announcement_data.py b/rootly_sdk/models/update_status_page_announcement_data.py new file mode 100644 index 00000000..d3144c10 --- /dev/null +++ b/rootly_sdk/models/update_status_page_announcement_data.py @@ -0,0 +1,78 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.update_status_page_announcement_data_type import ( + UpdateStatusPageAnnouncementDataType, + check_update_status_page_announcement_data_type, +) + +if TYPE_CHECKING: + from ..models.update_status_page_announcement_data_attributes import UpdateStatusPageAnnouncementDataAttributes + + +T = TypeVar("T", bound="UpdateStatusPageAnnouncementData") + + +@_attrs_define +class UpdateStatusPageAnnouncementData: + """ + Attributes: + type_ (UpdateStatusPageAnnouncementDataType): + attributes (UpdateStatusPageAnnouncementDataAttributes): + """ + + type_: UpdateStatusPageAnnouncementDataType + attributes: "UpdateStatusPageAnnouncementDataAttributes" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + type_: str = self.type_ + + attributes = self.attributes.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "type": type_, + "attributes": attributes, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.update_status_page_announcement_data_attributes import UpdateStatusPageAnnouncementDataAttributes + + d = dict(src_dict) + type_ = check_update_status_page_announcement_data_type(d.pop("type")) + + attributes = UpdateStatusPageAnnouncementDataAttributes.from_dict(d.pop("attributes")) + + update_status_page_announcement_data = cls( + type_=type_, + attributes=attributes, + ) + + update_status_page_announcement_data.additional_properties = d + return update_status_page_announcement_data + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/rootly_sdk/models/update_status_page_announcement_data_attributes.py b/rootly_sdk/models/update_status_page_announcement_data_attributes.py new file mode 100644 index 00000000..b6d4f22a --- /dev/null +++ b/rootly_sdk/models/update_status_page_announcement_data_attributes.py @@ -0,0 +1,49 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="UpdateStatusPageAnnouncementDataAttributes") + + +@_attrs_define +class UpdateStatusPageAnnouncementDataAttributes: + """ + Attributes: + title (Union[Unset, str]): Title of the announcement + body (Union[Unset, str]): Body of the announcement + """ + + title: Union[Unset, str] = UNSET + body: Union[Unset, str] = UNSET + + def to_dict(self) -> dict[str, Any]: + title = self.title + + body = self.body + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if title is not UNSET: + field_dict["title"] = title + if body is not UNSET: + field_dict["body"] = body + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + title = d.pop("title", UNSET) + + body = d.pop("body", UNSET) + + update_status_page_announcement_data_attributes = cls( + title=title, + body=body, + ) + + return update_status_page_announcement_data_attributes diff --git a/rootly_sdk/models/update_status_page_announcement_data_type.py b/rootly_sdk/models/update_status_page_announcement_data_type.py new file mode 100644 index 00000000..503f646e --- /dev/null +++ b/rootly_sdk/models/update_status_page_announcement_data_type.py @@ -0,0 +1,15 @@ +from typing import Literal, cast + +UpdateStatusPageAnnouncementDataType = Literal["status_page_announcements"] + +UPDATE_STATUS_PAGE_ANNOUNCEMENT_DATA_TYPE_VALUES: set[UpdateStatusPageAnnouncementDataType] = { + "status_page_announcements", +} + + +def check_update_status_page_announcement_data_type(value: str | None) -> UpdateStatusPageAnnouncementDataType | None: + if value is None: + return None + if value in UPDATE_STATUS_PAGE_ANNOUNCEMENT_DATA_TYPE_VALUES: + return cast(UpdateStatusPageAnnouncementDataType, value) + raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_STATUS_PAGE_ANNOUNCEMENT_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/update_status_page_component.py b/rootly_sdk/models/update_status_page_component.py new file mode 100644 index 00000000..a2aeabac --- /dev/null +++ b/rootly_sdk/models/update_status_page_component.py @@ -0,0 +1,65 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +if TYPE_CHECKING: + from ..models.update_status_page_component_data import UpdateStatusPageComponentData + + +T = TypeVar("T", bound="UpdateStatusPageComponent") + + +@_attrs_define +class UpdateStatusPageComponent: + """ + Attributes: + data (UpdateStatusPageComponentData): + """ + + data: "UpdateStatusPageComponentData" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "data": data, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.update_status_page_component_data import UpdateStatusPageComponentData + + d = dict(src_dict) + data = UpdateStatusPageComponentData.from_dict(d.pop("data")) + + update_status_page_component = cls( + data=data, + ) + + update_status_page_component.additional_properties = d + return update_status_page_component + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/rootly_sdk/models/update_status_page_component_data.py b/rootly_sdk/models/update_status_page_component_data.py new file mode 100644 index 00000000..f41707fe --- /dev/null +++ b/rootly_sdk/models/update_status_page_component_data.py @@ -0,0 +1,78 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.update_status_page_component_data_type import ( + UpdateStatusPageComponentDataType, + check_update_status_page_component_data_type, +) + +if TYPE_CHECKING: + from ..models.update_status_page_component_data_attributes import UpdateStatusPageComponentDataAttributes + + +T = TypeVar("T", bound="UpdateStatusPageComponentData") + + +@_attrs_define +class UpdateStatusPageComponentData: + """ + Attributes: + type_ (UpdateStatusPageComponentDataType): + attributes (UpdateStatusPageComponentDataAttributes): + """ + + type_: UpdateStatusPageComponentDataType + attributes: "UpdateStatusPageComponentDataAttributes" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + type_: str = self.type_ + + attributes = self.attributes.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "type": type_, + "attributes": attributes, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.update_status_page_component_data_attributes import UpdateStatusPageComponentDataAttributes + + d = dict(src_dict) + type_ = check_update_status_page_component_data_type(d.pop("type")) + + attributes = UpdateStatusPageComponentDataAttributes.from_dict(d.pop("attributes")) + + update_status_page_component_data = cls( + type_=type_, + attributes=attributes, + ) + + update_status_page_component_data.additional_properties = d + return update_status_page_component_data + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/rootly_sdk/models/update_status_page_component_data_attributes.py b/rootly_sdk/models/update_status_page_component_data_attributes.py new file mode 100644 index 00000000..b7ddafbd --- /dev/null +++ b/rootly_sdk/models/update_status_page_component_data_attributes.py @@ -0,0 +1,105 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, Union, cast + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="UpdateStatusPageComponentDataAttributes") + + +@_attrs_define +class UpdateStatusPageComponentDataAttributes: + """ + Attributes: + name (Union[None, Unset, str]): Name of the component (ad-hoc components only) + description (Union[None, Unset, str]): Description of the component (ad-hoc components only) + status_page_component_group_id (Union[None, Unset, str]): ID of the component group on the same status page + (null moves the component to the top level) + position (Union[Unset, int]): Position of the component (within its group, or on the page's top-level list when + ungrouped) + """ + + name: Union[None, Unset, str] = UNSET + description: Union[None, Unset, str] = UNSET + status_page_component_group_id: Union[None, Unset, str] = UNSET + position: Union[Unset, int] = UNSET + + def to_dict(self) -> dict[str, Any]: + name: Union[None, Unset, str] + if isinstance(self.name, Unset): + name = UNSET + else: + name = self.name + + description: Union[None, Unset, str] + if isinstance(self.description, Unset): + description = UNSET + else: + description = self.description + + status_page_component_group_id: Union[None, Unset, str] + if isinstance(self.status_page_component_group_id, Unset): + status_page_component_group_id = UNSET + else: + status_page_component_group_id = self.status_page_component_group_id + + position = self.position + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if name is not UNSET: + field_dict["name"] = name + if description is not UNSET: + field_dict["description"] = description + if status_page_component_group_id is not UNSET: + field_dict["status_page_component_group_id"] = status_page_component_group_id + if position is not UNSET: + field_dict["position"] = position + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + + def _parse_name(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + name = _parse_name(d.pop("name", UNSET)) + + def _parse_description(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + description = _parse_description(d.pop("description", UNSET)) + + def _parse_status_page_component_group_id(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + status_page_component_group_id = _parse_status_page_component_group_id( + d.pop("status_page_component_group_id", UNSET) + ) + + position = d.pop("position", UNSET) + + update_status_page_component_data_attributes = cls( + name=name, + description=description, + status_page_component_group_id=status_page_component_group_id, + position=position, + ) + + return update_status_page_component_data_attributes diff --git a/rootly_sdk/models/update_status_page_component_data_type.py b/rootly_sdk/models/update_status_page_component_data_type.py new file mode 100644 index 00000000..297ae8c3 --- /dev/null +++ b/rootly_sdk/models/update_status_page_component_data_type.py @@ -0,0 +1,15 @@ +from typing import Literal, cast + +UpdateStatusPageComponentDataType = Literal["status_page_components"] + +UPDATE_STATUS_PAGE_COMPONENT_DATA_TYPE_VALUES: set[UpdateStatusPageComponentDataType] = { + "status_page_components", +} + + +def check_update_status_page_component_data_type(value: str | None) -> UpdateStatusPageComponentDataType | None: + if value is None: + return None + if value in UPDATE_STATUS_PAGE_COMPONENT_DATA_TYPE_VALUES: + return cast(UpdateStatusPageComponentDataType, value) + raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_STATUS_PAGE_COMPONENT_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/update_status_page_component_group.py b/rootly_sdk/models/update_status_page_component_group.py new file mode 100644 index 00000000..1832b9ce --- /dev/null +++ b/rootly_sdk/models/update_status_page_component_group.py @@ -0,0 +1,65 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +if TYPE_CHECKING: + from ..models.update_status_page_component_group_data import UpdateStatusPageComponentGroupData + + +T = TypeVar("T", bound="UpdateStatusPageComponentGroup") + + +@_attrs_define +class UpdateStatusPageComponentGroup: + """ + Attributes: + data (UpdateStatusPageComponentGroupData): + """ + + data: "UpdateStatusPageComponentGroupData" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "data": data, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.update_status_page_component_group_data import UpdateStatusPageComponentGroupData + + d = dict(src_dict) + data = UpdateStatusPageComponentGroupData.from_dict(d.pop("data")) + + update_status_page_component_group = cls( + data=data, + ) + + update_status_page_component_group.additional_properties = d + return update_status_page_component_group + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/rootly_sdk/models/update_status_page_component_group_data.py b/rootly_sdk/models/update_status_page_component_group_data.py new file mode 100644 index 00000000..3ff92539 --- /dev/null +++ b/rootly_sdk/models/update_status_page_component_group_data.py @@ -0,0 +1,80 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.update_status_page_component_group_data_type import ( + UpdateStatusPageComponentGroupDataType, + check_update_status_page_component_group_data_type, +) + +if TYPE_CHECKING: + from ..models.update_status_page_component_group_data_attributes import UpdateStatusPageComponentGroupDataAttributes + + +T = TypeVar("T", bound="UpdateStatusPageComponentGroupData") + + +@_attrs_define +class UpdateStatusPageComponentGroupData: + """ + Attributes: + type_ (UpdateStatusPageComponentGroupDataType): + attributes (UpdateStatusPageComponentGroupDataAttributes): + """ + + type_: UpdateStatusPageComponentGroupDataType + attributes: "UpdateStatusPageComponentGroupDataAttributes" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + type_: str = self.type_ + + attributes = self.attributes.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "type": type_, + "attributes": attributes, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.update_status_page_component_group_data_attributes import ( + UpdateStatusPageComponentGroupDataAttributes, + ) + + d = dict(src_dict) + type_ = check_update_status_page_component_group_data_type(d.pop("type")) + + attributes = UpdateStatusPageComponentGroupDataAttributes.from_dict(d.pop("attributes")) + + update_status_page_component_group_data = cls( + type_=type_, + attributes=attributes, + ) + + update_status_page_component_group_data.additional_properties = d + return update_status_page_component_group_data + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/rootly_sdk/models/update_status_page_component_group_data_attributes.py b/rootly_sdk/models/update_status_page_component_group_data_attributes.py new file mode 100644 index 00000000..b587bfb5 --- /dev/null +++ b/rootly_sdk/models/update_status_page_component_group_data_attributes.py @@ -0,0 +1,90 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, Union, cast + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="UpdateStatusPageComponentGroupDataAttributes") + + +@_attrs_define +class UpdateStatusPageComponentGroupDataAttributes: + """ + Attributes: + name (Union[Unset, str]): Name of the component group + description (Union[None, Unset, str]): Description of the component group + position (Union[Unset, int]): Position of the group on the status page's top-level list (shared with ungrouped + components) + collapsed_by_default (Union[None, Unset, bool]): Whether the group renders collapsed on the public page + """ + + name: Union[Unset, str] = UNSET + description: Union[None, Unset, str] = UNSET + position: Union[Unset, int] = UNSET + collapsed_by_default: Union[None, Unset, bool] = UNSET + + def to_dict(self) -> dict[str, Any]: + name = self.name + + description: Union[None, Unset, str] + if isinstance(self.description, Unset): + description = UNSET + else: + description = self.description + + position = self.position + + collapsed_by_default: Union[None, Unset, bool] + if isinstance(self.collapsed_by_default, Unset): + collapsed_by_default = UNSET + else: + collapsed_by_default = self.collapsed_by_default + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if name is not UNSET: + field_dict["name"] = name + if description is not UNSET: + field_dict["description"] = description + if position is not UNSET: + field_dict["position"] = position + if collapsed_by_default is not UNSET: + field_dict["collapsed_by_default"] = collapsed_by_default + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + name = d.pop("name", UNSET) + + def _parse_description(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + description = _parse_description(d.pop("description", UNSET)) + + position = d.pop("position", UNSET) + + def _parse_collapsed_by_default(data: object) -> Union[None, Unset, bool]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, bool], data) + + collapsed_by_default = _parse_collapsed_by_default(d.pop("collapsed_by_default", UNSET)) + + update_status_page_component_group_data_attributes = cls( + name=name, + description=description, + position=position, + collapsed_by_default=collapsed_by_default, + ) + + return update_status_page_component_group_data_attributes diff --git a/rootly_sdk/models/update_status_page_component_group_data_type.py b/rootly_sdk/models/update_status_page_component_group_data_type.py new file mode 100644 index 00000000..6ae36636 --- /dev/null +++ b/rootly_sdk/models/update_status_page_component_group_data_type.py @@ -0,0 +1,19 @@ +from typing import Literal, cast + +UpdateStatusPageComponentGroupDataType = Literal["status_page_component_groups"] + +UPDATE_STATUS_PAGE_COMPONENT_GROUP_DATA_TYPE_VALUES: set[UpdateStatusPageComponentGroupDataType] = { + "status_page_component_groups", +} + + +def check_update_status_page_component_group_data_type( + value: str | None, +) -> UpdateStatusPageComponentGroupDataType | None: + if value is None: + return None + if value in UPDATE_STATUS_PAGE_COMPONENT_GROUP_DATA_TYPE_VALUES: + return cast(UpdateStatusPageComponentGroupDataType, value) + raise TypeError( + f"Unexpected value {value!r}. Expected one of {UPDATE_STATUS_PAGE_COMPONENT_GROUP_DATA_TYPE_VALUES!r}" + ) diff --git a/rootly_sdk/models/update_status_page_data.py b/rootly_sdk/models/update_status_page_data.py index ee8c76f2..a0601657 100644 --- a/rootly_sdk/models/update_status_page_data.py +++ b/rootly_sdk/models/update_status_page_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class UpdateStatusPageData: """ type_: UpdateStatusPageDataType - attributes: UpdateStatusPageDataAttributes + attributes: "UpdateStatusPageDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_status_page_data_attributes.py b/rootly_sdk/models/update_status_page_data_attributes.py index ee451103..479659b1 100644 --- a/rootly_sdk/models/update_status_page_data_attributes.py +++ b/rootly_sdk/models/update_status_page_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -30,172 +28,181 @@ class UpdateStatusPageDataAttributes: """ Attributes: - title (str | Unset): The title of the status page - public_title (None | str | Unset): The public title of the status page - description (None | str | Unset): The description of the status page - public_description (None | str | Unset): The public description of the status page - header_color (None | str | Unset): The color of the header. Eg. "#0061F2" - footer_color (None | str | Unset): The color of the footer. Eg. "#1F2F41" - allow_search_engine_index (bool | None | Unset): Allow search engines to include your public status page in + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `title`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + title (Union[Unset, str]): The title of the status page + public_title (Union[None, Unset, str]): The public title of the status page + description (Union[None, Unset, str]): The description of the status page + public_description (Union[None, Unset, str]): The public description of the status page + header_color (Union[None, Unset, str]): The color of the header. Eg. "#0061F2" + footer_color (Union[None, Unset, str]): The color of the footer. Eg. "#1F2F41" + allow_search_engine_index (Union[None, Unset, bool]): Allow search engines to include your public status page in search results - show_uptime (bool | None | Unset): Show uptime - show_uptime_last_days (UpdateStatusPageDataAttributesShowUptimeLastDays | Unset): Show uptime over x days - success_message (None | str | Unset): Message showing when all components are operational - failure_message (None | str | Unset): Message showing when at least one component is not operational - authentication_method (UpdateStatusPageDataAttributesAuthenticationMethod | Unset): Authentication method + show_uptime (Union[None, Unset, bool]): Show uptime + show_uptime_last_days (Union[Unset, UpdateStatusPageDataAttributesShowUptimeLastDays]): Show uptime over x days + success_message (Union[None, Unset, str]): Message showing when all components are operational + failure_message (Union[None, Unset, str]): Message showing when at least one component is not operational + authentication_method (Union[Unset, UpdateStatusPageDataAttributesAuthenticationMethod]): Authentication method Default: 'none'. - authentication_enabled (bool | None | Unset): Enable authentication (deprecated - use authentication_method + authentication_enabled (Union[None, Unset, bool]): Enable authentication (deprecated - use authentication_method instead) Default: False. - authentication_password (None | str | Unset): Authentication password - saml_idp_sso_service_url (None | str | Unset): SAML IdP SSO service URL - saml_idp_slo_service_url (None | str | Unset): SAML IdP SLO service URL - saml_idp_cert (None | str | Unset): SAML IdP certificate - saml_name_identifier_format (UpdateStatusPageDataAttributesSamlNameIdentifierFormat | Unset): SAML name + authentication_password (Union[None, Unset, str]): Authentication password + saml_idp_sso_service_url (Union[None, Unset, str]): SAML IdP SSO service URL + saml_idp_slo_service_url (Union[None, Unset, str]): SAML IdP SLO service URL + saml_idp_cert (Union[None, Unset, str]): SAML IdP certificate + saml_name_identifier_format (Union[Unset, UpdateStatusPageDataAttributesSamlNameIdentifierFormat]): SAML name identifier format - section_order (list[UpdateStatusPageDataAttributesSectionOrderType0Item] | None | Unset): Order of sections on - the status page - external_domain_names (list[str] | None | Unset): External domain names attached to the status page - website_url (None | str | Unset): Website URL - website_privacy_url (None | str | Unset): Website Privacy URL - website_support_url (None | str | Unset): Website Support URL - ga_tracking_id (None | str | Unset): Google Analytics tracking ID - time_zone (None | str | Unset): A valid IANA time zone name. Default: 'Etc/UTC'. - public (bool | None | Unset): Make the status page accessible to the public - service_ids (list[str] | Unset): Services attached to the status page - functionality_ids (list[str] | Unset): Functionalities attached to the status page - enabled (bool | None | Unset): Enabled / Disable the status page + section_order (Union[None, Unset, list[UpdateStatusPageDataAttributesSectionOrderType0Item]]): Order of sections + on the status page + external_domain_names (Union[None, Unset, list[str]]): External domain names attached to the status page + website_url (Union[None, Unset, str]): Website URL + website_privacy_url (Union[None, Unset, str]): Website Privacy URL + website_support_url (Union[None, Unset, str]): Website Support URL + ga_tracking_id (Union[None, Unset, str]): Google Analytics tracking ID + time_zone (Union[None, Unset, str]): A valid IANA time zone name. Default: 'Etc/UTC'. + public (Union[None, Unset, bool]): Make the status page accessible to the public + service_ids (Union[Unset, list[str]]): Services attached to the status page + functionality_ids (Union[Unset, list[str]]): Functionalities attached to the status page + enabled (Union[None, Unset, bool]): Enabled / Disable the status page """ - title: str | Unset = UNSET - public_title: None | str | Unset = UNSET - description: None | str | Unset = UNSET - public_description: None | str | Unset = UNSET - header_color: None | str | Unset = UNSET - footer_color: None | str | Unset = UNSET - allow_search_engine_index: bool | None | Unset = UNSET - show_uptime: bool | None | Unset = UNSET - show_uptime_last_days: UpdateStatusPageDataAttributesShowUptimeLastDays | Unset = UNSET - success_message: None | str | Unset = UNSET - failure_message: None | str | Unset = UNSET - authentication_method: UpdateStatusPageDataAttributesAuthenticationMethod | Unset = "none" - authentication_enabled: bool | None | Unset = False - authentication_password: None | str | Unset = UNSET - saml_idp_sso_service_url: None | str | Unset = UNSET - saml_idp_slo_service_url: None | str | Unset = UNSET - saml_idp_cert: None | str | Unset = UNSET - saml_name_identifier_format: UpdateStatusPageDataAttributesSamlNameIdentifierFormat | Unset = UNSET - section_order: list[UpdateStatusPageDataAttributesSectionOrderType0Item] | None | Unset = UNSET - external_domain_names: list[str] | None | Unset = UNSET - website_url: None | str | Unset = UNSET - website_privacy_url: None | str | Unset = UNSET - website_support_url: None | str | Unset = UNSET - ga_tracking_id: None | str | Unset = UNSET - time_zone: None | str | Unset = "Etc/UTC" - public: bool | None | Unset = UNSET - service_ids: list[str] | Unset = UNSET - functionality_ids: list[str] | Unset = UNSET - enabled: bool | None | Unset = UNSET + slug: Union[None, Unset, str] = UNSET + title: Union[Unset, str] = UNSET + public_title: Union[None, Unset, str] = UNSET + description: Union[None, Unset, str] = UNSET + public_description: Union[None, Unset, str] = UNSET + header_color: Union[None, Unset, str] = UNSET + footer_color: Union[None, Unset, str] = UNSET + allow_search_engine_index: Union[None, Unset, bool] = UNSET + show_uptime: Union[None, Unset, bool] = UNSET + show_uptime_last_days: Union[Unset, UpdateStatusPageDataAttributesShowUptimeLastDays] = UNSET + success_message: Union[None, Unset, str] = UNSET + failure_message: Union[None, Unset, str] = UNSET + authentication_method: Union[Unset, UpdateStatusPageDataAttributesAuthenticationMethod] = "none" + authentication_enabled: Union[None, Unset, bool] = False + authentication_password: Union[None, Unset, str] = UNSET + saml_idp_sso_service_url: Union[None, Unset, str] = UNSET + saml_idp_slo_service_url: Union[None, Unset, str] = UNSET + saml_idp_cert: Union[None, Unset, str] = UNSET + saml_name_identifier_format: Union[Unset, UpdateStatusPageDataAttributesSamlNameIdentifierFormat] = UNSET + section_order: Union[None, Unset, list[UpdateStatusPageDataAttributesSectionOrderType0Item]] = UNSET + external_domain_names: Union[None, Unset, list[str]] = UNSET + website_url: Union[None, Unset, str] = UNSET + website_privacy_url: Union[None, Unset, str] = UNSET + website_support_url: Union[None, Unset, str] = UNSET + ga_tracking_id: Union[None, Unset, str] = UNSET + time_zone: Union[None, Unset, str] = "Etc/UTC" + public: Union[None, Unset, bool] = UNSET + service_ids: Union[Unset, list[str]] = UNSET + functionality_ids: Union[Unset, list[str]] = UNSET + enabled: Union[None, Unset, bool] = UNSET def to_dict(self) -> dict[str, Any]: + slug: Union[None, Unset, str] + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug + title = self.title - public_title: None | str | Unset + public_title: Union[None, Unset, str] if isinstance(self.public_title, Unset): public_title = UNSET else: public_title = self.public_title - description: None | str | Unset + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: description = self.description - public_description: None | str | Unset + public_description: Union[None, Unset, str] if isinstance(self.public_description, Unset): public_description = UNSET else: public_description = self.public_description - header_color: None | str | Unset + header_color: Union[None, Unset, str] if isinstance(self.header_color, Unset): header_color = UNSET else: header_color = self.header_color - footer_color: None | str | Unset + footer_color: Union[None, Unset, str] if isinstance(self.footer_color, Unset): footer_color = UNSET else: footer_color = self.footer_color - allow_search_engine_index: bool | None | Unset + allow_search_engine_index: Union[None, Unset, bool] if isinstance(self.allow_search_engine_index, Unset): allow_search_engine_index = UNSET else: allow_search_engine_index = self.allow_search_engine_index - show_uptime: bool | None | Unset + show_uptime: Union[None, Unset, bool] if isinstance(self.show_uptime, Unset): show_uptime = UNSET else: show_uptime = self.show_uptime - show_uptime_last_days: int | Unset = UNSET + show_uptime_last_days: Union[Unset, int] = UNSET if not isinstance(self.show_uptime_last_days, Unset): show_uptime_last_days = self.show_uptime_last_days - success_message: None | str | Unset + success_message: Union[None, Unset, str] if isinstance(self.success_message, Unset): success_message = UNSET else: success_message = self.success_message - failure_message: None | str | Unset + failure_message: Union[None, Unset, str] if isinstance(self.failure_message, Unset): failure_message = UNSET else: failure_message = self.failure_message - authentication_method: str | Unset = UNSET + authentication_method: Union[Unset, str] = UNSET if not isinstance(self.authentication_method, Unset): authentication_method = self.authentication_method - authentication_enabled: bool | None | Unset + authentication_enabled: Union[None, Unset, bool] if isinstance(self.authentication_enabled, Unset): authentication_enabled = UNSET else: authentication_enabled = self.authentication_enabled - authentication_password: None | str | Unset + authentication_password: Union[None, Unset, str] if isinstance(self.authentication_password, Unset): authentication_password = UNSET else: authentication_password = self.authentication_password - saml_idp_sso_service_url: None | str | Unset + saml_idp_sso_service_url: Union[None, Unset, str] if isinstance(self.saml_idp_sso_service_url, Unset): saml_idp_sso_service_url = UNSET else: saml_idp_sso_service_url = self.saml_idp_sso_service_url - saml_idp_slo_service_url: None | str | Unset + saml_idp_slo_service_url: Union[None, Unset, str] if isinstance(self.saml_idp_slo_service_url, Unset): saml_idp_slo_service_url = UNSET else: saml_idp_slo_service_url = self.saml_idp_slo_service_url - saml_idp_cert: None | str | Unset + saml_idp_cert: Union[None, Unset, str] if isinstance(self.saml_idp_cert, Unset): saml_idp_cert = UNSET else: saml_idp_cert = self.saml_idp_cert - saml_name_identifier_format: str | Unset = UNSET + saml_name_identifier_format: Union[Unset, str] = UNSET if not isinstance(self.saml_name_identifier_format, Unset): saml_name_identifier_format = self.saml_name_identifier_format - section_order: list[str] | None | Unset + section_order: Union[None, Unset, list[str]] if isinstance(self.section_order, Unset): section_order = UNSET elif isinstance(self.section_order, list): @@ -207,7 +214,7 @@ def to_dict(self) -> dict[str, Any]: else: section_order = self.section_order - external_domain_names: list[str] | None | Unset + external_domain_names: Union[None, Unset, list[str]] if isinstance(self.external_domain_names, Unset): external_domain_names = UNSET elif isinstance(self.external_domain_names, list): @@ -216,51 +223,51 @@ def to_dict(self) -> dict[str, Any]: else: external_domain_names = self.external_domain_names - website_url: None | str | Unset + website_url: Union[None, Unset, str] if isinstance(self.website_url, Unset): website_url = UNSET else: website_url = self.website_url - website_privacy_url: None | str | Unset + website_privacy_url: Union[None, Unset, str] if isinstance(self.website_privacy_url, Unset): website_privacy_url = UNSET else: website_privacy_url = self.website_privacy_url - website_support_url: None | str | Unset + website_support_url: Union[None, Unset, str] if isinstance(self.website_support_url, Unset): website_support_url = UNSET else: website_support_url = self.website_support_url - ga_tracking_id: None | str | Unset + ga_tracking_id: Union[None, Unset, str] if isinstance(self.ga_tracking_id, Unset): ga_tracking_id = UNSET else: ga_tracking_id = self.ga_tracking_id - time_zone: None | str | Unset + time_zone: Union[None, Unset, str] if isinstance(self.time_zone, Unset): time_zone = UNSET else: time_zone = self.time_zone - public: bool | None | Unset + public: Union[None, Unset, bool] if isinstance(self.public, Unset): public = UNSET else: public = self.public - service_ids: list[str] | Unset = UNSET + service_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.service_ids, Unset): service_ids = self.service_ids - functionality_ids: list[str] | Unset = UNSET + functionality_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.functionality_ids, Unset): functionality_ids = self.functionality_ids - enabled: bool | None | Unset + enabled: Union[None, Unset, bool] if isinstance(self.enabled, Unset): enabled = UNSET else: @@ -269,6 +276,8 @@ def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} field_dict.update({}) + if slug is not UNSET: + field_dict["slug"] = slug if title is not UNSET: field_dict["title"] = title if public_title is not UNSET: @@ -333,73 +342,83 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) + + def _parse_slug(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + slug = _parse_slug(d.pop("slug", UNSET)) + title = d.pop("title", UNSET) - def _parse_public_title(data: object) -> None | str | Unset: + def _parse_public_title(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) public_title = _parse_public_title(d.pop("public_title", UNSET)) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) - def _parse_public_description(data: object) -> None | str | Unset: + def _parse_public_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) public_description = _parse_public_description(d.pop("public_description", UNSET)) - def _parse_header_color(data: object) -> None | str | Unset: + def _parse_header_color(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) header_color = _parse_header_color(d.pop("header_color", UNSET)) - def _parse_footer_color(data: object) -> None | str | Unset: + def _parse_footer_color(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) footer_color = _parse_footer_color(d.pop("footer_color", UNSET)) - def _parse_allow_search_engine_index(data: object) -> bool | None | Unset: + def _parse_allow_search_engine_index(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) allow_search_engine_index = _parse_allow_search_engine_index(d.pop("allow_search_engine_index", UNSET)) - def _parse_show_uptime(data: object) -> bool | None | Unset: + def _parse_show_uptime(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) show_uptime = _parse_show_uptime(d.pop("show_uptime", UNSET)) _show_uptime_last_days = d.pop("show_uptime_last_days", UNSET) - show_uptime_last_days: UpdateStatusPageDataAttributesShowUptimeLastDays | Unset + show_uptime_last_days: Union[Unset, UpdateStatusPageDataAttributesShowUptimeLastDays] if isinstance(_show_uptime_last_days, Unset): show_uptime_last_days = UNSET else: @@ -407,26 +426,26 @@ def _parse_show_uptime(data: object) -> bool | None | Unset: _show_uptime_last_days ) - def _parse_success_message(data: object) -> None | str | Unset: + def _parse_success_message(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) success_message = _parse_success_message(d.pop("success_message", UNSET)) - def _parse_failure_message(data: object) -> None | str | Unset: + def _parse_failure_message(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) failure_message = _parse_failure_message(d.pop("failure_message", UNSET)) _authentication_method = d.pop("authentication_method", UNSET) - authentication_method: UpdateStatusPageDataAttributesAuthenticationMethod | Unset + authentication_method: Union[Unset, UpdateStatusPageDataAttributesAuthenticationMethod] if isinstance(_authentication_method, Unset): authentication_method = UNSET else: @@ -434,53 +453,53 @@ def _parse_failure_message(data: object) -> None | str | Unset: _authentication_method ) - def _parse_authentication_enabled(data: object) -> bool | None | Unset: + def _parse_authentication_enabled(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) authentication_enabled = _parse_authentication_enabled(d.pop("authentication_enabled", UNSET)) - def _parse_authentication_password(data: object) -> None | str | Unset: + def _parse_authentication_password(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) authentication_password = _parse_authentication_password(d.pop("authentication_password", UNSET)) - def _parse_saml_idp_sso_service_url(data: object) -> None | str | Unset: + def _parse_saml_idp_sso_service_url(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) saml_idp_sso_service_url = _parse_saml_idp_sso_service_url(d.pop("saml_idp_sso_service_url", UNSET)) - def _parse_saml_idp_slo_service_url(data: object) -> None | str | Unset: + def _parse_saml_idp_slo_service_url(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) saml_idp_slo_service_url = _parse_saml_idp_slo_service_url(d.pop("saml_idp_slo_service_url", UNSET)) - def _parse_saml_idp_cert(data: object) -> None | str | Unset: + def _parse_saml_idp_cert(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) saml_idp_cert = _parse_saml_idp_cert(d.pop("saml_idp_cert", UNSET)) _saml_name_identifier_format = d.pop("saml_name_identifier_format", UNSET) - saml_name_identifier_format: UpdateStatusPageDataAttributesSamlNameIdentifierFormat | Unset + saml_name_identifier_format: Union[Unset, UpdateStatusPageDataAttributesSamlNameIdentifierFormat] if isinstance(_saml_name_identifier_format, Unset): saml_name_identifier_format = UNSET else: @@ -490,7 +509,7 @@ def _parse_saml_idp_cert(data: object) -> None | str | Unset: def _parse_section_order( data: object, - ) -> list[UpdateStatusPageDataAttributesSectionOrderType0Item] | None | Unset: + ) -> Union[None, Unset, list[UpdateStatusPageDataAttributesSectionOrderType0Item]]: if data is None: return data if isinstance(data, Unset): @@ -508,13 +527,13 @@ def _parse_section_order( section_order_type_0.append(section_order_type_0_item) return section_order_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[UpdateStatusPageDataAttributesSectionOrderType0Item] | None | Unset, data) + return cast(Union[None, Unset, list[UpdateStatusPageDataAttributesSectionOrderType0Item]], data) section_order = _parse_section_order(d.pop("section_order", UNSET)) - def _parse_external_domain_names(data: object) -> list[str] | None | Unset: + def _parse_external_domain_names(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -525,63 +544,63 @@ def _parse_external_domain_names(data: object) -> list[str] | None | Unset: external_domain_names_type_0 = cast(list[str], data) return external_domain_names_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) external_domain_names = _parse_external_domain_names(d.pop("external_domain_names", UNSET)) - def _parse_website_url(data: object) -> None | str | Unset: + def _parse_website_url(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) website_url = _parse_website_url(d.pop("website_url", UNSET)) - def _parse_website_privacy_url(data: object) -> None | str | Unset: + def _parse_website_privacy_url(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) website_privacy_url = _parse_website_privacy_url(d.pop("website_privacy_url", UNSET)) - def _parse_website_support_url(data: object) -> None | str | Unset: + def _parse_website_support_url(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) website_support_url = _parse_website_support_url(d.pop("website_support_url", UNSET)) - def _parse_ga_tracking_id(data: object) -> None | str | Unset: + def _parse_ga_tracking_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) ga_tracking_id = _parse_ga_tracking_id(d.pop("ga_tracking_id", UNSET)) - def _parse_time_zone(data: object) -> None | str | Unset: + def _parse_time_zone(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) time_zone = _parse_time_zone(d.pop("time_zone", UNSET)) - def _parse_public(data: object) -> bool | None | Unset: + def _parse_public(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) public = _parse_public(d.pop("public", UNSET)) @@ -589,16 +608,17 @@ def _parse_public(data: object) -> bool | None | Unset: functionality_ids = cast(list[str], d.pop("functionality_ids", UNSET)) - def _parse_enabled(data: object) -> bool | None | Unset: + def _parse_enabled(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) enabled = _parse_enabled(d.pop("enabled", UNSET)) update_status_page_data_attributes = cls( + slug=slug, title=title, public_title=public_title, description=description, diff --git a/rootly_sdk/models/update_status_page_template.py b/rootly_sdk/models/update_status_page_template.py index e02434c5..2d1d2500 100644 --- a/rootly_sdk/models/update_status_page_template.py +++ b/rootly_sdk/models/update_status_page_template.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateStatusPageTemplate: data (UpdateStatusPageTemplateData): """ - data: UpdateStatusPageTemplateData + data: "UpdateStatusPageTemplateData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_status_page_template_data.py b/rootly_sdk/models/update_status_page_template_data.py index ac86327b..008f3102 100644 --- a/rootly_sdk/models/update_status_page_template_data.py +++ b/rootly_sdk/models/update_status_page_template_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class UpdateStatusPageTemplateData: """ type_: UpdateStatusPageTemplateDataType - attributes: UpdateStatusPageTemplateDataAttributes + attributes: "UpdateStatusPageTemplateDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_status_page_template_data_attributes.py b/rootly_sdk/models/update_status_page_template_data_attributes.py index 9efc9b6b..3ae0f197 100644 --- a/rootly_sdk/models/update_status_page_template_data_attributes.py +++ b/rootly_sdk/models/update_status_page_template_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -24,44 +22,44 @@ class UpdateStatusPageTemplateDataAttributes: Attributes: title (str): Title of the template body (str): Description of the event the template will populate - update_title (None | str | Unset): Title that will be used for the status page update - update_status (UpdateStatusPageTemplateDataAttributesUpdateStatus | Unset): Status of the event the template - will populate - kind (UpdateStatusPageTemplateDataAttributesKind | Unset): The kind of the status page template - should_notify_subscribers (bool | None | Unset): Controls if incident subscribers should be notified - position (int | Unset): Position of the workflow task - enabled (bool | None | Unset): Enable / Disable the status page template + update_title (Union[None, Unset, str]): Title that will be used for the status page update + update_status (Union[Unset, UpdateStatusPageTemplateDataAttributesUpdateStatus]): Status of the event the + template will populate + kind (Union[Unset, UpdateStatusPageTemplateDataAttributesKind]): The kind of the status page template + should_notify_subscribers (Union[None, Unset, bool]): Controls if incident subscribers should be notified + position (Union[Unset, int]): Position of the workflow task + enabled (Union[None, Unset, bool]): Enable / Disable the status page template """ title: str body: str - update_title: None | str | Unset = UNSET - update_status: UpdateStatusPageTemplateDataAttributesUpdateStatus | Unset = UNSET - kind: UpdateStatusPageTemplateDataAttributesKind | Unset = UNSET - should_notify_subscribers: bool | None | Unset = UNSET - position: int | Unset = UNSET - enabled: bool | None | Unset = UNSET + update_title: Union[None, Unset, str] = UNSET + update_status: Union[Unset, UpdateStatusPageTemplateDataAttributesUpdateStatus] = UNSET + kind: Union[Unset, UpdateStatusPageTemplateDataAttributesKind] = UNSET + should_notify_subscribers: Union[None, Unset, bool] = UNSET + position: Union[Unset, int] = UNSET + enabled: Union[None, Unset, bool] = UNSET def to_dict(self) -> dict[str, Any]: title = self.title body = self.body - update_title: None | str | Unset + update_title: Union[None, Unset, str] if isinstance(self.update_title, Unset): update_title = UNSET else: update_title = self.update_title - update_status: str | Unset = UNSET + update_status: Union[Unset, str] = UNSET if not isinstance(self.update_status, Unset): update_status = self.update_status - kind: str | Unset = UNSET + kind: Union[Unset, str] = UNSET if not isinstance(self.kind, Unset): kind = self.kind - should_notify_subscribers: bool | None | Unset + should_notify_subscribers: Union[None, Unset, bool] if isinstance(self.should_notify_subscribers, Unset): should_notify_subscribers = UNSET else: @@ -69,7 +67,7 @@ def to_dict(self) -> dict[str, Any]: position = self.position - enabled: bool | None | Unset + enabled: Union[None, Unset, bool] if isinstance(self.enabled, Unset): enabled = UNSET else: @@ -105,46 +103,46 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: body = d.pop("body") - def _parse_update_title(data: object) -> None | str | Unset: + def _parse_update_title(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) update_title = _parse_update_title(d.pop("update_title", UNSET)) _update_status = d.pop("update_status", UNSET) - update_status: UpdateStatusPageTemplateDataAttributesUpdateStatus | Unset + update_status: Union[Unset, UpdateStatusPageTemplateDataAttributesUpdateStatus] if isinstance(_update_status, Unset): update_status = UNSET else: update_status = check_update_status_page_template_data_attributes_update_status(_update_status) _kind = d.pop("kind", UNSET) - kind: UpdateStatusPageTemplateDataAttributesKind | Unset + kind: Union[Unset, UpdateStatusPageTemplateDataAttributesKind] if isinstance(_kind, Unset): kind = UNSET else: kind = check_update_status_page_template_data_attributes_kind(_kind) - def _parse_should_notify_subscribers(data: object) -> bool | None | Unset: + def _parse_should_notify_subscribers(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) should_notify_subscribers = _parse_should_notify_subscribers(d.pop("should_notify_subscribers", UNSET)) position = d.pop("position", UNSET) - def _parse_enabled(data: object) -> bool | None | Unset: + def _parse_enabled(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) enabled = _parse_enabled(d.pop("enabled", UNSET)) diff --git a/rootly_sdk/models/update_status_task_params.py b/rootly_sdk/models/update_status_task_params.py index d623cf43..a3474000 100644 --- a/rootly_sdk/models/update_status_task_params.py +++ b/rootly_sdk/models/update_status_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -24,19 +22,19 @@ class UpdateStatusTaskParams: """ Attributes: status (UpdateStatusTaskParamsStatus): - task_type (UpdateStatusTaskParamsTaskType | Unset): - inactivity_timeout (str | Unset): In format '1 hour', '1 day', etc Example: 1 hour. + task_type (Union[Unset, UpdateStatusTaskParamsTaskType]): + inactivity_timeout (Union[Unset, str]): In format '1 hour', '1 day', etc Example: 1 hour. """ status: UpdateStatusTaskParamsStatus - task_type: UpdateStatusTaskParamsTaskType | Unset = UNSET - inactivity_timeout: str | Unset = UNSET + task_type: Union[Unset, UpdateStatusTaskParamsTaskType] = UNSET + inactivity_timeout: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: status: str = self.status - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -62,7 +60,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: status = check_update_status_task_params_status(d.pop("status")) _task_type = d.pop("task_type", UNSET) - task_type: UpdateStatusTaskParamsTaskType | Unset + task_type: Union[Unset, UpdateStatusTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/update_sub_status.py b/rootly_sdk/models/update_sub_status.py index e5aa52fa..6fda819a 100644 --- a/rootly_sdk/models/update_sub_status.py +++ b/rootly_sdk/models/update_sub_status.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateSubStatus: data (UpdateSubStatusData): """ - data: UpdateSubStatusData + data: "UpdateSubStatusData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_sub_status_data.py b/rootly_sdk/models/update_sub_status_data.py index 8216557b..9ff74dae 100644 --- a/rootly_sdk/models/update_sub_status_data.py +++ b/rootly_sdk/models/update_sub_status_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class UpdateSubStatusData: """ type_: UpdateSubStatusDataType - attributes: UpdateSubStatusDataAttributes + attributes: "UpdateSubStatusDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_sub_status_data_attributes.py b/rootly_sdk/models/update_sub_status_data_attributes.py index 06db078d..d5c7eee3 100644 --- a/rootly_sdk/models/update_sub_status_data_attributes.py +++ b/rootly_sdk/models/update_sub_status_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -14,25 +12,34 @@ class UpdateSubStatusDataAttributes: """ Attributes: - name (str | Unset): - description (None | str | Unset): - position (int | None | Unset): + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + name (Union[Unset, str]): + description (Union[None, Unset, str]): + position (Union[None, Unset, int]): """ - name: str | Unset = UNSET - description: None | str | Unset = UNSET - position: int | None | Unset = UNSET + slug: Union[None, Unset, str] = UNSET + name: Union[Unset, str] = UNSET + description: Union[None, Unset, str] = UNSET + position: Union[None, Unset, int] = UNSET def to_dict(self) -> dict[str, Any]: + slug: Union[None, Unset, str] + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug + name = self.name - description: None | str | Unset + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: description = self.description - position: int | None | Unset + position: Union[None, Unset, int] if isinstance(self.position, Unset): position = UNSET else: @@ -41,6 +48,8 @@ def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} field_dict.update({}) + if slug is not UNSET: + field_dict["slug"] = slug if name is not UNSET: field_dict["name"] = name if description is not UNSET: @@ -53,27 +62,38 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) + + def _parse_slug(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + slug = _parse_slug(d.pop("slug", UNSET)) + name = d.pop("name", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> Union[None, Unset, int]: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(Union[None, Unset, int], data) position = _parse_position(d.pop("position", UNSET)) update_sub_status_data_attributes = cls( + slug=slug, name=name, description=description, position=position, diff --git a/rootly_sdk/models/update_team.py b/rootly_sdk/models/update_team.py index 77cd58e9..54e99506 100644 --- a/rootly_sdk/models/update_team.py +++ b/rootly_sdk/models/update_team.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateTeam: data (UpdateTeamData): """ - data: UpdateTeamData + data: "UpdateTeamData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_team_data.py b/rootly_sdk/models/update_team_data.py index 52c08654..faa345fa 100644 --- a/rootly_sdk/models/update_team_data.py +++ b/rootly_sdk/models/update_team_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class UpdateTeamData: """ type_: UpdateTeamDataType - attributes: UpdateTeamDataAttributes + attributes: "UpdateTeamDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_team_data_attributes.py b/rootly_sdk/models/update_team_data_attributes.py index 46c7c643..46b62b11 100644 --- a/rootly_sdk/models/update_team_data_attributes.py +++ b/rootly_sdk/models/update_team_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -34,70 +32,77 @@ class UpdateTeamDataAttributes: """ Attributes: - name (str | Unset): The name of the team - description (None | str | Unset): The description of the team - notify_emails (list[str] | None | Unset): Emails to attach to the team - color (None | str | Unset): The hex color of the team - position (int | None | Unset): Position of the team - backstage_id (None | str | Unset): The Backstage entity id associated to this team. eg: + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + name (Union[Unset, str]): The name of the team + description (Union[None, Unset, str]): The description of the team + public_description (Union[None, Unset, str]): The status page description of the team + notify_emails (Union[None, Unset, list[str]]): Emails to attach to the team + color (Union[None, Unset, str]): The hex color of the team + position (Union[None, Unset, int]): Position of the team + backstage_id (Union[None, Unset, str]): The Backstage entity id associated to this team. eg: :namespace/:kind/:entity_name - external_id (None | str | Unset): The external id associated to this team - pagerduty_id (None | str | Unset): The PagerDuty group id associated to this team - pagerduty_service_id (None | str | Unset): The PagerDuty service id associated to this team - opsgenie_id (None | str | Unset): The Opsgenie group id associated to this team - victor_ops_id (None | str | Unset): The VictorOps group id associated to this team - pagertree_id (None | str | Unset): The PagerTree group id associated to this team - cortex_id (None | str | Unset): The Cortex group id associated to this team - service_now_ci_sys_id (None | str | Unset): The Service Now CI sys id associated to this team - user_ids (list[int] | None | Unset): The user ids of the members of this team. - admin_ids (list[int] | None | Unset): The user ids of the admins of this team. These users must also be present - in user_ids attribute. - alerts_email_enabled (bool | None | Unset): Enable alerts through email - alert_urgency_id (None | str | Unset): The alert urgency id of the team - slack_channels (list[UpdateTeamDataAttributesSlackChannelsType0Item] | None | Unset): Slack Channels associated - with this team - slack_aliases (list[UpdateTeamDataAttributesSlackAliasesType0Item] | None | Unset): Slack Aliases associated - with this team - alert_broadcast_enabled (bool | None | Unset): Enable alerts to be broadcasted to a specific channel - alert_broadcast_channel (None | Unset | UpdateTeamDataAttributesAlertBroadcastChannelType0): Slack channel to - broadcast alerts to - incident_broadcast_enabled (bool | None | Unset): Enable incidents to be broadcasted to a specific channel - incident_broadcast_channel (None | Unset | UpdateTeamDataAttributesIncidentBroadcastChannelType0): Slack channel - to broadcast incidents to - auto_add_members_when_attached (bool | None | Unset): Auto add members to incident channel when team is attached - auto_add_members_scope (UpdateTeamDataAttributesAutoAddMembersScope | Unset): Visibility-scoped auto-add + external_id (Union[None, Unset, str]): The external id associated to this team + pagerduty_id (Union[None, Unset, str]): The PagerDuty group id associated to this team + pagerduty_service_id (Union[None, Unset, str]): The PagerDuty service id associated to this team + opsgenie_id (Union[None, Unset, str]): The Opsgenie group id associated to this team + victor_ops_id (Union[None, Unset, str]): The VictorOps group id associated to this team + pagertree_id (Union[None, Unset, str]): The PagerTree group id associated to this team + cortex_id (Union[None, Unset, str]): The Cortex group id associated to this team + service_now_ci_sys_id (Union[None, Unset, str]): The Service Now CI sys id associated to this team + user_ids (Union[None, Unset, list[int]]): The user ids of the members of this team. + admin_ids (Union[None, Unset, list[int]]): The user ids of the admins of this team. These users must also be + present in user_ids attribute. + alerts_email_enabled (Union[None, Unset, bool]): Enable alerts through email + alert_urgency_id (Union[None, Unset, str]): The alert urgency id of the team + slack_channels (Union[None, Unset, list['UpdateTeamDataAttributesSlackChannelsType0Item']]): Slack Channels + associated with this team + slack_aliases (Union[None, Unset, list['UpdateTeamDataAttributesSlackAliasesType0Item']]): Slack Aliases + associated with this team + alert_broadcast_enabled (Union[None, Unset, bool]): Enable alerts to be broadcasted to a specific channel + alert_broadcast_channel (Union['UpdateTeamDataAttributesAlertBroadcastChannelType0', None, Unset]): Slack + channel to broadcast alerts to + incident_broadcast_enabled (Union[None, Unset, bool]): Enable incidents to be broadcasted to a specific channel + incident_broadcast_channel (Union['UpdateTeamDataAttributesIncidentBroadcastChannelType0', None, Unset]): Slack + channel to broadcast incidents to + auto_add_members_when_attached (Union[None, Unset, bool]): Auto add members to incident channel when team is + attached + auto_add_members_scope (Union[Unset, UpdateTeamDataAttributesAutoAddMembersScope]): Visibility-scoped auto-add behavior. Only present when the `enable_scoped_incident_channel_auto_add` feature flag is on for the organization. When set, it overrides `auto_add_members_when_attached`. - properties (list[UpdateTeamDataAttributesPropertiesItem] | Unset): Array of property values for this team. + properties (Union[Unset, list['UpdateTeamDataAttributesPropertiesItem']]): Array of property values for this + team. """ - name: str | Unset = UNSET - description: None | str | Unset = UNSET - notify_emails: list[str] | None | Unset = UNSET - color: None | str | Unset = UNSET - position: int | None | Unset = UNSET - backstage_id: None | str | Unset = UNSET - external_id: None | str | Unset = UNSET - pagerduty_id: None | str | Unset = UNSET - pagerduty_service_id: None | str | Unset = UNSET - opsgenie_id: None | str | Unset = UNSET - victor_ops_id: None | str | Unset = UNSET - pagertree_id: None | str | Unset = UNSET - cortex_id: None | str | Unset = UNSET - service_now_ci_sys_id: None | str | Unset = UNSET - user_ids: list[int] | None | Unset = UNSET - admin_ids: list[int] | None | Unset = UNSET - alerts_email_enabled: bool | None | Unset = UNSET - alert_urgency_id: None | str | Unset = UNSET - slack_channels: list[UpdateTeamDataAttributesSlackChannelsType0Item] | None | Unset = UNSET - slack_aliases: list[UpdateTeamDataAttributesSlackAliasesType0Item] | None | Unset = UNSET - alert_broadcast_enabled: bool | None | Unset = UNSET - alert_broadcast_channel: None | Unset | UpdateTeamDataAttributesAlertBroadcastChannelType0 = UNSET - incident_broadcast_enabled: bool | None | Unset = UNSET - incident_broadcast_channel: None | Unset | UpdateTeamDataAttributesIncidentBroadcastChannelType0 = UNSET - auto_add_members_when_attached: bool | None | Unset = UNSET - auto_add_members_scope: UpdateTeamDataAttributesAutoAddMembersScope | Unset = UNSET - properties: list[UpdateTeamDataAttributesPropertiesItem] | Unset = UNSET + slug: Union[None, Unset, str] = UNSET + name: Union[Unset, str] = UNSET + description: Union[None, Unset, str] = UNSET + public_description: Union[None, Unset, str] = UNSET + notify_emails: Union[None, Unset, list[str]] = UNSET + color: Union[None, Unset, str] = UNSET + position: Union[None, Unset, int] = UNSET + backstage_id: Union[None, Unset, str] = UNSET + external_id: Union[None, Unset, str] = UNSET + pagerduty_id: Union[None, Unset, str] = UNSET + pagerduty_service_id: Union[None, Unset, str] = UNSET + opsgenie_id: Union[None, Unset, str] = UNSET + victor_ops_id: Union[None, Unset, str] = UNSET + pagertree_id: Union[None, Unset, str] = UNSET + cortex_id: Union[None, Unset, str] = UNSET + service_now_ci_sys_id: Union[None, Unset, str] = UNSET + user_ids: Union[None, Unset, list[int]] = UNSET + admin_ids: Union[None, Unset, list[int]] = UNSET + alerts_email_enabled: Union[None, Unset, bool] = UNSET + alert_urgency_id: Union[None, Unset, str] = UNSET + slack_channels: Union[None, Unset, list["UpdateTeamDataAttributesSlackChannelsType0Item"]] = UNSET + slack_aliases: Union[None, Unset, list["UpdateTeamDataAttributesSlackAliasesType0Item"]] = UNSET + alert_broadcast_enabled: Union[None, Unset, bool] = UNSET + alert_broadcast_channel: Union["UpdateTeamDataAttributesAlertBroadcastChannelType0", None, Unset] = UNSET + incident_broadcast_enabled: Union[None, Unset, bool] = UNSET + incident_broadcast_channel: Union["UpdateTeamDataAttributesIncidentBroadcastChannelType0", None, Unset] = UNSET + auto_add_members_when_attached: Union[None, Unset, bool] = UNSET + auto_add_members_scope: Union[Unset, UpdateTeamDataAttributesAutoAddMembersScope] = UNSET + properties: Union[Unset, list["UpdateTeamDataAttributesPropertiesItem"]] = UNSET def to_dict(self) -> dict[str, Any]: from ..models.update_team_data_attributes_alert_broadcast_channel_type_0 import ( @@ -107,15 +112,27 @@ def to_dict(self) -> dict[str, Any]: UpdateTeamDataAttributesIncidentBroadcastChannelType0, ) + slug: Union[None, Unset, str] + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug + name = self.name - description: None | str | Unset + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: description = self.description - notify_emails: list[str] | None | Unset + public_description: Union[None, Unset, str] + if isinstance(self.public_description, Unset): + public_description = UNSET + else: + public_description = self.public_description + + notify_emails: Union[None, Unset, list[str]] if isinstance(self.notify_emails, Unset): notify_emails = UNSET elif isinstance(self.notify_emails, list): @@ -124,73 +141,73 @@ def to_dict(self) -> dict[str, Any]: else: notify_emails = self.notify_emails - color: None | str | Unset + color: Union[None, Unset, str] if isinstance(self.color, Unset): color = UNSET else: color = self.color - position: int | None | Unset + position: Union[None, Unset, int] if isinstance(self.position, Unset): position = UNSET else: position = self.position - backstage_id: None | str | Unset + backstage_id: Union[None, Unset, str] if isinstance(self.backstage_id, Unset): backstage_id = UNSET else: backstage_id = self.backstage_id - external_id: None | str | Unset + external_id: Union[None, Unset, str] if isinstance(self.external_id, Unset): external_id = UNSET else: external_id = self.external_id - pagerduty_id: None | str | Unset + pagerduty_id: Union[None, Unset, str] if isinstance(self.pagerduty_id, Unset): pagerduty_id = UNSET else: pagerduty_id = self.pagerduty_id - pagerduty_service_id: None | str | Unset + pagerduty_service_id: Union[None, Unset, str] if isinstance(self.pagerduty_service_id, Unset): pagerduty_service_id = UNSET else: pagerduty_service_id = self.pagerduty_service_id - opsgenie_id: None | str | Unset + opsgenie_id: Union[None, Unset, str] if isinstance(self.opsgenie_id, Unset): opsgenie_id = UNSET else: opsgenie_id = self.opsgenie_id - victor_ops_id: None | str | Unset + victor_ops_id: Union[None, Unset, str] if isinstance(self.victor_ops_id, Unset): victor_ops_id = UNSET else: victor_ops_id = self.victor_ops_id - pagertree_id: None | str | Unset + pagertree_id: Union[None, Unset, str] if isinstance(self.pagertree_id, Unset): pagertree_id = UNSET else: pagertree_id = self.pagertree_id - cortex_id: None | str | Unset + cortex_id: Union[None, Unset, str] if isinstance(self.cortex_id, Unset): cortex_id = UNSET else: cortex_id = self.cortex_id - service_now_ci_sys_id: None | str | Unset + service_now_ci_sys_id: Union[None, Unset, str] if isinstance(self.service_now_ci_sys_id, Unset): service_now_ci_sys_id = UNSET else: service_now_ci_sys_id = self.service_now_ci_sys_id - user_ids: list[int] | None | Unset + user_ids: Union[None, Unset, list[int]] if isinstance(self.user_ids, Unset): user_ids = UNSET elif isinstance(self.user_ids, list): @@ -199,7 +216,7 @@ def to_dict(self) -> dict[str, Any]: else: user_ids = self.user_ids - admin_ids: list[int] | None | Unset + admin_ids: Union[None, Unset, list[int]] if isinstance(self.admin_ids, Unset): admin_ids = UNSET elif isinstance(self.admin_ids, list): @@ -208,19 +225,19 @@ def to_dict(self) -> dict[str, Any]: else: admin_ids = self.admin_ids - alerts_email_enabled: bool | None | Unset + alerts_email_enabled: Union[None, Unset, bool] if isinstance(self.alerts_email_enabled, Unset): alerts_email_enabled = UNSET else: alerts_email_enabled = self.alerts_email_enabled - alert_urgency_id: None | str | Unset + alert_urgency_id: Union[None, Unset, str] if isinstance(self.alert_urgency_id, Unset): alert_urgency_id = UNSET else: alert_urgency_id = self.alert_urgency_id - slack_channels: list[dict[str, Any]] | None | Unset + slack_channels: Union[None, Unset, list[dict[str, Any]]] if isinstance(self.slack_channels, Unset): slack_channels = UNSET elif isinstance(self.slack_channels, list): @@ -232,7 +249,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_channels = self.slack_channels - slack_aliases: list[dict[str, Any]] | None | Unset + slack_aliases: Union[None, Unset, list[dict[str, Any]]] if isinstance(self.slack_aliases, Unset): slack_aliases = UNSET elif isinstance(self.slack_aliases, list): @@ -244,13 +261,13 @@ def to_dict(self) -> dict[str, Any]: else: slack_aliases = self.slack_aliases - alert_broadcast_enabled: bool | None | Unset + alert_broadcast_enabled: Union[None, Unset, bool] if isinstance(self.alert_broadcast_enabled, Unset): alert_broadcast_enabled = UNSET else: alert_broadcast_enabled = self.alert_broadcast_enabled - alert_broadcast_channel: dict[str, Any] | None | Unset + alert_broadcast_channel: Union[None, Unset, dict[str, Any]] if isinstance(self.alert_broadcast_channel, Unset): alert_broadcast_channel = UNSET elif isinstance(self.alert_broadcast_channel, UpdateTeamDataAttributesAlertBroadcastChannelType0): @@ -258,13 +275,13 @@ def to_dict(self) -> dict[str, Any]: else: alert_broadcast_channel = self.alert_broadcast_channel - incident_broadcast_enabled: bool | None | Unset + incident_broadcast_enabled: Union[None, Unset, bool] if isinstance(self.incident_broadcast_enabled, Unset): incident_broadcast_enabled = UNSET else: incident_broadcast_enabled = self.incident_broadcast_enabled - incident_broadcast_channel: dict[str, Any] | None | Unset + incident_broadcast_channel: Union[None, Unset, dict[str, Any]] if isinstance(self.incident_broadcast_channel, Unset): incident_broadcast_channel = UNSET elif isinstance(self.incident_broadcast_channel, UpdateTeamDataAttributesIncidentBroadcastChannelType0): @@ -272,17 +289,17 @@ def to_dict(self) -> dict[str, Any]: else: incident_broadcast_channel = self.incident_broadcast_channel - auto_add_members_when_attached: bool | None | Unset + auto_add_members_when_attached: Union[None, Unset, bool] if isinstance(self.auto_add_members_when_attached, Unset): auto_add_members_when_attached = UNSET else: auto_add_members_when_attached = self.auto_add_members_when_attached - auto_add_members_scope: str | Unset = UNSET + auto_add_members_scope: Union[Unset, str] = UNSET if not isinstance(self.auto_add_members_scope, Unset): auto_add_members_scope = self.auto_add_members_scope - properties: list[dict[str, Any]] | Unset = UNSET + properties: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.properties, Unset): properties = [] for properties_item_data in self.properties: @@ -292,10 +309,14 @@ def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} field_dict.update({}) + if slug is not UNSET: + field_dict["slug"] = slug if name is not UNSET: field_dict["name"] = name if description is not UNSET: field_dict["description"] = description + if public_description is not UNSET: + field_dict["public_description"] = public_description if notify_emails is not UNSET: field_dict["notify_emails"] = notify_emails if color is not UNSET: @@ -366,18 +387,37 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: ) d = dict(src_dict) + + def _parse_slug(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + slug = _parse_slug(d.pop("slug", UNSET)) + name = d.pop("name", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) - def _parse_notify_emails(data: object) -> list[str] | None | Unset: + def _parse_public_description(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + public_description = _parse_public_description(d.pop("public_description", UNSET)) + + def _parse_notify_emails(data: object) -> Union[None, Unset, list[str]]: if data is None: return data if isinstance(data, Unset): @@ -388,112 +428,112 @@ def _parse_notify_emails(data: object) -> list[str] | None | Unset: notify_emails_type_0 = cast(list[str], data) return notify_emails_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[str] | None | Unset, data) + return cast(Union[None, Unset, list[str]], data) notify_emails = _parse_notify_emails(d.pop("notify_emails", UNSET)) - def _parse_color(data: object) -> None | str | Unset: + def _parse_color(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) color = _parse_color(d.pop("color", UNSET)) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> Union[None, Unset, int]: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(Union[None, Unset, int], data) position = _parse_position(d.pop("position", UNSET)) - def _parse_backstage_id(data: object) -> None | str | Unset: + def _parse_backstage_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) backstage_id = _parse_backstage_id(d.pop("backstage_id", UNSET)) - def _parse_external_id(data: object) -> None | str | Unset: + def _parse_external_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) external_id = _parse_external_id(d.pop("external_id", UNSET)) - def _parse_pagerduty_id(data: object) -> None | str | Unset: + def _parse_pagerduty_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) pagerduty_id = _parse_pagerduty_id(d.pop("pagerduty_id", UNSET)) - def _parse_pagerduty_service_id(data: object) -> None | str | Unset: + def _parse_pagerduty_service_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) pagerduty_service_id = _parse_pagerduty_service_id(d.pop("pagerduty_service_id", UNSET)) - def _parse_opsgenie_id(data: object) -> None | str | Unset: + def _parse_opsgenie_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) opsgenie_id = _parse_opsgenie_id(d.pop("opsgenie_id", UNSET)) - def _parse_victor_ops_id(data: object) -> None | str | Unset: + def _parse_victor_ops_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) victor_ops_id = _parse_victor_ops_id(d.pop("victor_ops_id", UNSET)) - def _parse_pagertree_id(data: object) -> None | str | Unset: + def _parse_pagertree_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) pagertree_id = _parse_pagertree_id(d.pop("pagertree_id", UNSET)) - def _parse_cortex_id(data: object) -> None | str | Unset: + def _parse_cortex_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) cortex_id = _parse_cortex_id(d.pop("cortex_id", UNSET)) - def _parse_service_now_ci_sys_id(data: object) -> None | str | Unset: + def _parse_service_now_ci_sys_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) service_now_ci_sys_id = _parse_service_now_ci_sys_id(d.pop("service_now_ci_sys_id", UNSET)) - def _parse_user_ids(data: object) -> list[int] | None | Unset: + def _parse_user_ids(data: object) -> Union[None, Unset, list[int]]: if data is None: return data if isinstance(data, Unset): @@ -504,13 +544,13 @@ def _parse_user_ids(data: object) -> list[int] | None | Unset: user_ids_type_0 = cast(list[int], data) return user_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[int] | None | Unset, data) + return cast(Union[None, Unset, list[int]], data) user_ids = _parse_user_ids(d.pop("user_ids", UNSET)) - def _parse_admin_ids(data: object) -> list[int] | None | Unset: + def _parse_admin_ids(data: object) -> Union[None, Unset, list[int]]: if data is None: return data if isinstance(data, Unset): @@ -521,31 +561,33 @@ def _parse_admin_ids(data: object) -> list[int] | None | Unset: admin_ids_type_0 = cast(list[int], data) return admin_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[int] | None | Unset, data) + return cast(Union[None, Unset, list[int]], data) admin_ids = _parse_admin_ids(d.pop("admin_ids", UNSET)) - def _parse_alerts_email_enabled(data: object) -> bool | None | Unset: + def _parse_alerts_email_enabled(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) alerts_email_enabled = _parse_alerts_email_enabled(d.pop("alerts_email_enabled", UNSET)) - def _parse_alert_urgency_id(data: object) -> None | str | Unset: + def _parse_alert_urgency_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) alert_urgency_id = _parse_alert_urgency_id(d.pop("alert_urgency_id", UNSET)) - def _parse_slack_channels(data: object) -> list[UpdateTeamDataAttributesSlackChannelsType0Item] | None | Unset: + def _parse_slack_channels( + data: object, + ) -> Union[None, Unset, list["UpdateTeamDataAttributesSlackChannelsType0Item"]]: if data is None: return data if isinstance(data, Unset): @@ -563,13 +605,15 @@ def _parse_slack_channels(data: object) -> list[UpdateTeamDataAttributesSlackCha slack_channels_type_0.append(slack_channels_type_0_item) return slack_channels_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[UpdateTeamDataAttributesSlackChannelsType0Item] | None | Unset, data) + return cast(Union[None, Unset, list["UpdateTeamDataAttributesSlackChannelsType0Item"]], data) slack_channels = _parse_slack_channels(d.pop("slack_channels", UNSET)) - def _parse_slack_aliases(data: object) -> list[UpdateTeamDataAttributesSlackAliasesType0Item] | None | Unset: + def _parse_slack_aliases( + data: object, + ) -> Union[None, Unset, list["UpdateTeamDataAttributesSlackAliasesType0Item"]]: if data is None: return data if isinstance(data, Unset): @@ -587,24 +631,24 @@ def _parse_slack_aliases(data: object) -> list[UpdateTeamDataAttributesSlackAlia slack_aliases_type_0.append(slack_aliases_type_0_item) return slack_aliases_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[UpdateTeamDataAttributesSlackAliasesType0Item] | None | Unset, data) + return cast(Union[None, Unset, list["UpdateTeamDataAttributesSlackAliasesType0Item"]], data) slack_aliases = _parse_slack_aliases(d.pop("slack_aliases", UNSET)) - def _parse_alert_broadcast_enabled(data: object) -> bool | None | Unset: + def _parse_alert_broadcast_enabled(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) alert_broadcast_enabled = _parse_alert_broadcast_enabled(d.pop("alert_broadcast_enabled", UNSET)) def _parse_alert_broadcast_channel( data: object, - ) -> None | Unset | UpdateTeamDataAttributesAlertBroadcastChannelType0: + ) -> Union["UpdateTeamDataAttributesAlertBroadcastChannelType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -615,24 +659,24 @@ def _parse_alert_broadcast_channel( alert_broadcast_channel_type_0 = UpdateTeamDataAttributesAlertBroadcastChannelType0.from_dict(data) return alert_broadcast_channel_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(None | Unset | UpdateTeamDataAttributesAlertBroadcastChannelType0, data) + return cast(Union["UpdateTeamDataAttributesAlertBroadcastChannelType0", None, Unset], data) alert_broadcast_channel = _parse_alert_broadcast_channel(d.pop("alert_broadcast_channel", UNSET)) - def _parse_incident_broadcast_enabled(data: object) -> bool | None | Unset: + def _parse_incident_broadcast_enabled(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) incident_broadcast_enabled = _parse_incident_broadcast_enabled(d.pop("incident_broadcast_enabled", UNSET)) def _parse_incident_broadcast_channel( data: object, - ) -> None | Unset | UpdateTeamDataAttributesIncidentBroadcastChannelType0: + ) -> Union["UpdateTeamDataAttributesIncidentBroadcastChannelType0", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -645,42 +689,42 @@ def _parse_incident_broadcast_channel( ) return incident_broadcast_channel_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(None | Unset | UpdateTeamDataAttributesIncidentBroadcastChannelType0, data) + return cast(Union["UpdateTeamDataAttributesIncidentBroadcastChannelType0", None, Unset], data) incident_broadcast_channel = _parse_incident_broadcast_channel(d.pop("incident_broadcast_channel", UNSET)) - def _parse_auto_add_members_when_attached(data: object) -> bool | None | Unset: + def _parse_auto_add_members_when_attached(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) auto_add_members_when_attached = _parse_auto_add_members_when_attached( d.pop("auto_add_members_when_attached", UNSET) ) _auto_add_members_scope = d.pop("auto_add_members_scope", UNSET) - auto_add_members_scope: UpdateTeamDataAttributesAutoAddMembersScope | Unset + auto_add_members_scope: Union[Unset, UpdateTeamDataAttributesAutoAddMembersScope] if isinstance(_auto_add_members_scope, Unset): auto_add_members_scope = UNSET else: auto_add_members_scope = check_update_team_data_attributes_auto_add_members_scope(_auto_add_members_scope) + properties = [] _properties = d.pop("properties", UNSET) - properties: list[UpdateTeamDataAttributesPropertiesItem] | Unset = UNSET - if _properties is not UNSET: - properties = [] - for properties_item_data in _properties: - properties_item = UpdateTeamDataAttributesPropertiesItem.from_dict(properties_item_data) + for properties_item_data in _properties or []: + properties_item = UpdateTeamDataAttributesPropertiesItem.from_dict(properties_item_data) - properties.append(properties_item) + properties.append(properties_item) update_team_data_attributes = cls( + slug=slug, name=name, description=description, + public_description=public_description, notify_emails=notify_emails, color=color, position=position, diff --git a/rootly_sdk/models/update_team_data_attributes_alert_broadcast_channel_type_0.py b/rootly_sdk/models/update_team_data_attributes_alert_broadcast_channel_type_0.py index d609ce1e..129bb572 100644 --- a/rootly_sdk/models/update_team_data_attributes_alert_broadcast_channel_type_0.py +++ b/rootly_sdk/models/update_team_data_attributes_alert_broadcast_channel_type_0.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,11 +15,11 @@ class UpdateTeamDataAttributesAlertBroadcastChannelType0: Attributes: id (str): Slack channel ID - name (str | Unset): Slack channel name + name (Union[Unset, str]): Slack channel name """ id: str - name: str | Unset = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_team_data_attributes_incident_broadcast_channel_type_0.py b/rootly_sdk/models/update_team_data_attributes_incident_broadcast_channel_type_0.py index 66230036..32c1a0f4 100644 --- a/rootly_sdk/models/update_team_data_attributes_incident_broadcast_channel_type_0.py +++ b/rootly_sdk/models/update_team_data_attributes_incident_broadcast_channel_type_0.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,11 +15,11 @@ class UpdateTeamDataAttributesIncidentBroadcastChannelType0: Attributes: id (str): Slack channel ID - name (str | Unset): Slack channel name + name (Union[Unset, str]): Slack channel name """ id: str - name: str | Unset = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_team_data_attributes_properties_item.py b/rootly_sdk/models/update_team_data_attributes_properties_item.py index 4a14f3eb..d5ce8d26 100644 --- a/rootly_sdk/models/update_team_data_attributes_properties_item.py +++ b/rootly_sdk/models/update_team_data_attributes_properties_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/update_team_data_attributes_slack_aliases_type_0_item.py b/rootly_sdk/models/update_team_data_attributes_slack_aliases_type_0_item.py index 9ed2220b..ed8d4c01 100644 --- a/rootly_sdk/models/update_team_data_attributes_slack_aliases_type_0_item.py +++ b/rootly_sdk/models/update_team_data_attributes_slack_aliases_type_0_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/update_team_data_attributes_slack_channels_type_0_item.py b/rootly_sdk/models/update_team_data_attributes_slack_channels_type_0_item.py index 0d642c32..3c22919f 100644 --- a/rootly_sdk/models/update_team_data_attributes_slack_channels_type_0_item.py +++ b/rootly_sdk/models/update_team_data_attributes_slack_channels_type_0_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/update_trello_card_task_params.py b/rootly_sdk/models/update_trello_card_task_params.py index ebb78f45..9effa774 100644 --- a/rootly_sdk/models/update_trello_card_task_params.py +++ b/rootly_sdk/models/update_trello_card_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -28,33 +26,32 @@ class UpdateTrelloCardTaskParams: Attributes: card_id (str): The card id archivation (UpdateTrelloCardTaskParamsArchivation): The archivation id and display name - task_type (UpdateTrelloCardTaskParamsTaskType | Unset): - title (str | Unset): The card title - description (str | Unset): The card description - due_date (str | Unset): The due date - board (UpdateTrelloCardTaskParamsBoard | Unset): The board id and display name - list_ (UpdateTrelloCardTaskParamsList | Unset): The list id and display name - labels (list[UpdateTrelloCardTaskParamsLabelsItem] | Unset): + task_type (Union[Unset, UpdateTrelloCardTaskParamsTaskType]): + title (Union[Unset, str]): The card title + description (Union[Unset, str]): The card description + due_date (Union[Unset, str]): The due date + board (Union[Unset, UpdateTrelloCardTaskParamsBoard]): The board id and display name + list_ (Union[Unset, UpdateTrelloCardTaskParamsList]): The list id and display name + labels (Union[Unset, list['UpdateTrelloCardTaskParamsLabelsItem']]): """ card_id: str - archivation: UpdateTrelloCardTaskParamsArchivation - task_type: UpdateTrelloCardTaskParamsTaskType | Unset = UNSET - title: str | Unset = UNSET - description: str | Unset = UNSET - due_date: str | Unset = UNSET - board: UpdateTrelloCardTaskParamsBoard | Unset = UNSET - list_: UpdateTrelloCardTaskParamsList | Unset = UNSET - labels: list[UpdateTrelloCardTaskParamsLabelsItem] | Unset = UNSET + archivation: "UpdateTrelloCardTaskParamsArchivation" + task_type: Union[Unset, UpdateTrelloCardTaskParamsTaskType] = UNSET + title: Union[Unset, str] = UNSET + description: Union[Unset, str] = UNSET + due_date: Union[Unset, str] = UNSET + board: Union[Unset, "UpdateTrelloCardTaskParamsBoard"] = UNSET + list_: Union[Unset, "UpdateTrelloCardTaskParamsList"] = UNSET + labels: Union[Unset, list["UpdateTrelloCardTaskParamsLabelsItem"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - card_id = self.card_id archivation = self.archivation.to_dict() - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -64,15 +61,15 @@ def to_dict(self) -> dict[str, Any]: due_date = self.due_date - board: dict[str, Any] | Unset = UNSET + board: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.board, Unset): board = self.board.to_dict() - list_: dict[str, Any] | Unset = UNSET + list_: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.list_, Unset): list_ = self.list_.to_dict() - labels: list[dict[str, Any]] | Unset = UNSET + labels: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.labels, Unset): labels = [] for labels_item_data in self.labels: @@ -117,7 +114,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: archivation = UpdateTrelloCardTaskParamsArchivation.from_dict(d.pop("archivation")) _task_type = d.pop("task_type", UNSET) - task_type: UpdateTrelloCardTaskParamsTaskType | Unset + task_type: Union[Unset, UpdateTrelloCardTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: @@ -130,27 +127,25 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: due_date = d.pop("due_date", UNSET) _board = d.pop("board", UNSET) - board: UpdateTrelloCardTaskParamsBoard | Unset + board: Union[Unset, UpdateTrelloCardTaskParamsBoard] if isinstance(_board, Unset): board = UNSET else: board = UpdateTrelloCardTaskParamsBoard.from_dict(_board) _list_ = d.pop("list", UNSET) - list_: UpdateTrelloCardTaskParamsList | Unset + list_: Union[Unset, UpdateTrelloCardTaskParamsList] if isinstance(_list_, Unset): list_ = UNSET else: list_ = UpdateTrelloCardTaskParamsList.from_dict(_list_) + labels = [] _labels = d.pop("labels", UNSET) - labels: list[UpdateTrelloCardTaskParamsLabelsItem] | Unset = UNSET - if _labels is not UNSET: - labels = [] - for labels_item_data in _labels: - labels_item = UpdateTrelloCardTaskParamsLabelsItem.from_dict(labels_item_data) + for labels_item_data in _labels or []: + labels_item = UpdateTrelloCardTaskParamsLabelsItem.from_dict(labels_item_data) - labels.append(labels_item) + labels.append(labels_item) update_trello_card_task_params = cls( card_id=card_id, diff --git a/rootly_sdk/models/update_trello_card_task_params_archivation.py b/rootly_sdk/models/update_trello_card_task_params_archivation.py index 14b2a7be..5a575507 100644 --- a/rootly_sdk/models/update_trello_card_task_params_archivation.py +++ b/rootly_sdk/models/update_trello_card_task_params_archivation.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,12 +14,12 @@ class UpdateTrelloCardTaskParamsArchivation: """The archivation id and display name Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_trello_card_task_params_board.py b/rootly_sdk/models/update_trello_card_task_params_board.py index 586b06c8..169d1d14 100644 --- a/rootly_sdk/models/update_trello_card_task_params_board.py +++ b/rootly_sdk/models/update_trello_card_task_params_board.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,12 +14,12 @@ class UpdateTrelloCardTaskParamsBoard: """The board id and display name Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_trello_card_task_params_labels_item.py b/rootly_sdk/models/update_trello_card_task_params_labels_item.py index 061422b6..823f1b25 100644 --- a/rootly_sdk/models/update_trello_card_task_params_labels_item.py +++ b/rootly_sdk/models/update_trello_card_task_params_labels_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,12 +13,12 @@ class UpdateTrelloCardTaskParamsLabelsItem: """ Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_trello_card_task_params_list.py b/rootly_sdk/models/update_trello_card_task_params_list.py index bd084e60..e8a7f44b 100644 --- a/rootly_sdk/models/update_trello_card_task_params_list.py +++ b/rootly_sdk/models/update_trello_card_task_params_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,12 +14,12 @@ class UpdateTrelloCardTaskParamsList: """The list id and display name Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_user.py b/rootly_sdk/models/update_user.py index bfd07c3b..afb8ad14 100644 --- a/rootly_sdk/models/update_user.py +++ b/rootly_sdk/models/update_user.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateUser: data (UpdateUserData): """ - data: UpdateUserData + data: "UpdateUserData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_user_data.py b/rootly_sdk/models/update_user_data.py index a24938b0..019d9d74 100644 --- a/rootly_sdk/models/update_user_data.py +++ b/rootly_sdk/models/update_user_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class UpdateUserData: """ type_: UpdateUserDataType - attributes: UpdateUserDataAttributes + attributes: "UpdateUserDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_user_data_attributes.py b/rootly_sdk/models/update_user_data_attributes.py index 1ef584d0..be2b7a50 100644 --- a/rootly_sdk/models/update_user_data_attributes.py +++ b/rootly_sdk/models/update_user_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -14,37 +12,37 @@ class UpdateUserDataAttributes: """ Attributes: - first_name (None | str | Unset): First name of the user - last_name (None | str | Unset): Last name of the user - role_id (None | str | Unset): ID of the role to assign - on_call_role_id (None | str | Unset): ID of the on-call role to assign + first_name (Union[None, Unset, str]): First name of the user + last_name (Union[None, Unset, str]): Last name of the user + role_id (Union[None, Unset, str]): ID of the role to assign + on_call_role_id (Union[None, Unset, str]): ID of the on-call role to assign """ - first_name: None | str | Unset = UNSET - last_name: None | str | Unset = UNSET - role_id: None | str | Unset = UNSET - on_call_role_id: None | str | Unset = UNSET + first_name: Union[None, Unset, str] = UNSET + last_name: Union[None, Unset, str] = UNSET + role_id: Union[None, Unset, str] = UNSET + on_call_role_id: Union[None, Unset, str] = UNSET def to_dict(self) -> dict[str, Any]: - first_name: None | str | Unset + first_name: Union[None, Unset, str] if isinstance(self.first_name, Unset): first_name = UNSET else: first_name = self.first_name - last_name: None | str | Unset + last_name: Union[None, Unset, str] if isinstance(self.last_name, Unset): last_name = UNSET else: last_name = self.last_name - role_id: None | str | Unset + role_id: Union[None, Unset, str] if isinstance(self.role_id, Unset): role_id = UNSET else: role_id = self.role_id - on_call_role_id: None | str | Unset + on_call_role_id: Union[None, Unset, str] if isinstance(self.on_call_role_id, Unset): on_call_role_id = UNSET else: @@ -68,39 +66,39 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_first_name(data: object) -> None | str | Unset: + def _parse_first_name(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) first_name = _parse_first_name(d.pop("first_name", UNSET)) - def _parse_last_name(data: object) -> None | str | Unset: + def _parse_last_name(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) last_name = _parse_last_name(d.pop("last_name", UNSET)) - def _parse_role_id(data: object) -> None | str | Unset: + def _parse_role_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) role_id = _parse_role_id(d.pop("role_id", UNSET)) - def _parse_on_call_role_id(data: object) -> None | str | Unset: + def _parse_on_call_role_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) on_call_role_id = _parse_on_call_role_id(d.pop("on_call_role_id", UNSET)) diff --git a/rootly_sdk/models/update_user_email_address.py b/rootly_sdk/models/update_user_email_address.py index 68b98497..31757578 100644 --- a/rootly_sdk/models/update_user_email_address.py +++ b/rootly_sdk/models/update_user_email_address.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateUserEmailAddress: data (UpdateUserEmailAddressData): """ - data: UpdateUserEmailAddressData + data: "UpdateUserEmailAddressData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_user_email_address_data.py b/rootly_sdk/models/update_user_email_address_data.py index d94f4368..2b87d935 100644 --- a/rootly_sdk/models/update_user_email_address_data.py +++ b/rootly_sdk/models/update_user_email_address_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class UpdateUserEmailAddressData: """ type_: UpdateUserEmailAddressDataType - attributes: UpdateUserEmailAddressDataAttributes + attributes: "UpdateUserEmailAddressDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_user_email_address_data_attributes.py b/rootly_sdk/models/update_user_email_address_data_attributes.py index 977a87b2..0ee8f1dd 100644 --- a/rootly_sdk/models/update_user_email_address_data_attributes.py +++ b/rootly_sdk/models/update_user_email_address_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define @@ -14,10 +12,10 @@ class UpdateUserEmailAddressDataAttributes: """ Attributes: - email (str | Unset): Email address + email (Union[Unset, str]): Email address """ - email: str | Unset = UNSET + email: Union[Unset, str] = UNSET def to_dict(self) -> dict[str, Any]: email = self.email diff --git a/rootly_sdk/models/update_user_notification_rule.py b/rootly_sdk/models/update_user_notification_rule.py index 8550ba96..5e02a9df 100644 --- a/rootly_sdk/models/update_user_notification_rule.py +++ b/rootly_sdk/models/update_user_notification_rule.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateUserNotificationRule: data (UpdateUserNotificationRuleData): """ - data: UpdateUserNotificationRuleData + data: "UpdateUserNotificationRuleData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_user_notification_rule_data.py b/rootly_sdk/models/update_user_notification_rule_data.py index 0c45fc09..dd48e99d 100644 --- a/rootly_sdk/models/update_user_notification_rule_data.py +++ b/rootly_sdk/models/update_user_notification_rule_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class UpdateUserNotificationRuleData: """ type_: UpdateUserNotificationRuleDataType - attributes: UpdateUserNotificationRuleDataAttributes + attributes: "UpdateUserNotificationRuleDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_user_notification_rule_data_attributes.py b/rootly_sdk/models/update_user_notification_rule_data_attributes.py index 8c2a5196..c508d7e0 100644 --- a/rootly_sdk/models/update_user_notification_rule_data_attributes.py +++ b/rootly_sdk/models/update_user_notification_rule_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -18,62 +16,62 @@ class UpdateUserNotificationRuleDataAttributes: """ Attributes: - delay (int | None | Unset): Delay after which rule gets triggered - position (int | None | Unset): Position of the rule - user_email_address_id (None | str | Unset): User email address to which notification to be sent - user_call_number_id (None | str | Unset): User phone number to which notification to be sent - user_sms_number_id (None | str | Unset): User sms number to which notification to be sent - user_device_id (None | str | Unset): User device to which notification to be sent - enabled_contact_types (list[UpdateUserNotificationRuleDataAttributesEnabledContactTypesItem] | Unset): Contact - types for which notification needs to be enabled + delay (Union[None, Unset, int]): Delay after which rule gets triggered + position (Union[None, Unset, int]): Position of the rule + user_email_address_id (Union[None, Unset, str]): User email address to which notification to be sent + user_call_number_id (Union[None, Unset, str]): User phone number to which notification to be sent + user_sms_number_id (Union[None, Unset, str]): User sms number to which notification to be sent + user_device_id (Union[None, Unset, str]): User device to which notification to be sent + enabled_contact_types (Union[Unset, list[UpdateUserNotificationRuleDataAttributesEnabledContactTypesItem]]): + Contact types for which notification needs to be enabled """ - delay: int | None | Unset = UNSET - position: int | None | Unset = UNSET - user_email_address_id: None | str | Unset = UNSET - user_call_number_id: None | str | Unset = UNSET - user_sms_number_id: None | str | Unset = UNSET - user_device_id: None | str | Unset = UNSET - enabled_contact_types: list[UpdateUserNotificationRuleDataAttributesEnabledContactTypesItem] | Unset = UNSET + delay: Union[None, Unset, int] = UNSET + position: Union[None, Unset, int] = UNSET + user_email_address_id: Union[None, Unset, str] = UNSET + user_call_number_id: Union[None, Unset, str] = UNSET + user_sms_number_id: Union[None, Unset, str] = UNSET + user_device_id: Union[None, Unset, str] = UNSET + enabled_contact_types: Union[Unset, list[UpdateUserNotificationRuleDataAttributesEnabledContactTypesItem]] = UNSET def to_dict(self) -> dict[str, Any]: - delay: int | None | Unset + delay: Union[None, Unset, int] if isinstance(self.delay, Unset): delay = UNSET else: delay = self.delay - position: int | None | Unset + position: Union[None, Unset, int] if isinstance(self.position, Unset): position = UNSET else: position = self.position - user_email_address_id: None | str | Unset + user_email_address_id: Union[None, Unset, str] if isinstance(self.user_email_address_id, Unset): user_email_address_id = UNSET else: user_email_address_id = self.user_email_address_id - user_call_number_id: None | str | Unset + user_call_number_id: Union[None, Unset, str] if isinstance(self.user_call_number_id, Unset): user_call_number_id = UNSET else: user_call_number_id = self.user_call_number_id - user_sms_number_id: None | str | Unset + user_sms_number_id: Union[None, Unset, str] if isinstance(self.user_sms_number_id, Unset): user_sms_number_id = UNSET else: user_sms_number_id = self.user_sms_number_id - user_device_id: None | str | Unset + user_device_id: Union[None, Unset, str] if isinstance(self.user_device_id, Unset): user_device_id = UNSET else: user_device_id = self.user_device_id - enabled_contact_types: list[str] | Unset = UNSET + enabled_contact_types: Union[Unset, list[str]] = UNSET if not isinstance(self.enabled_contact_types, Unset): enabled_contact_types = [] for enabled_contact_types_item_data in self.enabled_contact_types: @@ -104,72 +102,68 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_delay(data: object) -> int | None | Unset: + def _parse_delay(data: object) -> Union[None, Unset, int]: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(Union[None, Unset, int], data) delay = _parse_delay(d.pop("delay", UNSET)) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> Union[None, Unset, int]: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(Union[None, Unset, int], data) position = _parse_position(d.pop("position", UNSET)) - def _parse_user_email_address_id(data: object) -> None | str | Unset: + def _parse_user_email_address_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) user_email_address_id = _parse_user_email_address_id(d.pop("user_email_address_id", UNSET)) - def _parse_user_call_number_id(data: object) -> None | str | Unset: + def _parse_user_call_number_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) user_call_number_id = _parse_user_call_number_id(d.pop("user_call_number_id", UNSET)) - def _parse_user_sms_number_id(data: object) -> None | str | Unset: + def _parse_user_sms_number_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) user_sms_number_id = _parse_user_sms_number_id(d.pop("user_sms_number_id", UNSET)) - def _parse_user_device_id(data: object) -> None | str | Unset: + def _parse_user_device_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) user_device_id = _parse_user_device_id(d.pop("user_device_id", UNSET)) + enabled_contact_types = [] _enabled_contact_types = d.pop("enabled_contact_types", UNSET) - enabled_contact_types: list[UpdateUserNotificationRuleDataAttributesEnabledContactTypesItem] | Unset = UNSET - if _enabled_contact_types is not UNSET: - enabled_contact_types = [] - for enabled_contact_types_item_data in _enabled_contact_types: - enabled_contact_types_item = ( - check_update_user_notification_rule_data_attributes_enabled_contact_types_item( - enabled_contact_types_item_data - ) - ) + for enabled_contact_types_item_data in _enabled_contact_types or []: + enabled_contact_types_item = check_update_user_notification_rule_data_attributes_enabled_contact_types_item( + enabled_contact_types_item_data + ) - enabled_contact_types.append(enabled_contact_types_item) + enabled_contact_types.append(enabled_contact_types_item) update_user_notification_rule_data_attributes = cls( delay=delay, diff --git a/rootly_sdk/models/update_user_notification_rule_data_attributes_enabled_contact_types_item.py b/rootly_sdk/models/update_user_notification_rule_data_attributes_enabled_contact_types_item.py index 481a0d9a..149df040 100644 --- a/rootly_sdk/models/update_user_notification_rule_data_attributes_enabled_contact_types_item.py +++ b/rootly_sdk/models/update_user_notification_rule_data_attributes_enabled_contact_types_item.py @@ -1,7 +1,7 @@ from typing import Literal, cast UpdateUserNotificationRuleDataAttributesEnabledContactTypesItem = Literal[ - "call", "device", "email", "google_chat", "non_critical_device", "slack", "sms" + "call", "device", "email", "google_chat", "microsoft_teams", "non_critical_device", "slack", "sms" ] UPDATE_USER_NOTIFICATION_RULE_DATA_ATTRIBUTES_ENABLED_CONTACT_TYPES_ITEM_VALUES: set[ @@ -11,6 +11,7 @@ "device", "email", "google_chat", + "microsoft_teams", "non_critical_device", "slack", "sms", diff --git a/rootly_sdk/models/update_user_phone_number.py b/rootly_sdk/models/update_user_phone_number.py index b6e60d61..14c053e0 100644 --- a/rootly_sdk/models/update_user_phone_number.py +++ b/rootly_sdk/models/update_user_phone_number.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateUserPhoneNumber: data (UpdateUserPhoneNumberData): """ - data: UpdateUserPhoneNumberData + data: "UpdateUserPhoneNumberData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_user_phone_number_data.py b/rootly_sdk/models/update_user_phone_number_data.py index 10339845..196d946f 100644 --- a/rootly_sdk/models/update_user_phone_number_data.py +++ b/rootly_sdk/models/update_user_phone_number_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class UpdateUserPhoneNumberData: """ type_: UpdateUserPhoneNumberDataType - attributes: UpdateUserPhoneNumberDataAttributes + attributes: "UpdateUserPhoneNumberDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_user_phone_number_data_attributes.py b/rootly_sdk/models/update_user_phone_number_data_attributes.py index 28772c0b..425d0c24 100644 --- a/rootly_sdk/models/update_user_phone_number_data_attributes.py +++ b/rootly_sdk/models/update_user_phone_number_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define @@ -14,10 +12,10 @@ class UpdateUserPhoneNumberDataAttributes: """ Attributes: - phone (str | Unset): Phone number in international format + phone (Union[Unset, str]): Phone number in international format """ - phone: str | Unset = UNSET + phone: Union[Unset, str] = UNSET def to_dict(self) -> dict[str, Any]: phone = self.phone diff --git a/rootly_sdk/models/update_victor_ops_incident_task_params.py b/rootly_sdk/models/update_victor_ops_incident_task_params.py index 861fb6d5..6608833b 100644 --- a/rootly_sdk/models/update_victor_ops_incident_task_params.py +++ b/rootly_sdk/models/update_victor_ops_incident_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -26,14 +24,14 @@ class UpdateVictorOpsIncidentTaskParams: victor_ops_incident_id (str): The victor_ops incident ID, this can also be a Rootly incident variable ex. {{ incident.victor_ops_incident_id }} status (UpdateVictorOpsIncidentTaskParamsStatus): - task_type (UpdateVictorOpsIncidentTaskParamsTaskType | Unset): - resolution_message (str | Unset): Resolution message + task_type (Union[Unset, UpdateVictorOpsIncidentTaskParamsTaskType]): + resolution_message (Union[Unset, str]): Resolution message """ victor_ops_incident_id: str status: UpdateVictorOpsIncidentTaskParamsStatus - task_type: UpdateVictorOpsIncidentTaskParamsTaskType | Unset = UNSET - resolution_message: str | Unset = UNSET + task_type: Union[Unset, UpdateVictorOpsIncidentTaskParamsTaskType] = UNSET + resolution_message: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -41,7 +39,7 @@ def to_dict(self) -> dict[str, Any]: status: str = self.status - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -70,7 +68,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: status = check_update_victor_ops_incident_task_params_status(d.pop("status")) _task_type = d.pop("task_type", UNSET) - task_type: UpdateVictorOpsIncidentTaskParamsTaskType | Unset + task_type: Union[Unset, UpdateVictorOpsIncidentTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/update_webhooks_endpoint.py b/rootly_sdk/models/update_webhooks_endpoint.py index a6e4f061..8825d130 100644 --- a/rootly_sdk/models/update_webhooks_endpoint.py +++ b/rootly_sdk/models/update_webhooks_endpoint.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateWebhooksEndpoint: data (UpdateWebhooksEndpointData): """ - data: UpdateWebhooksEndpointData + data: "UpdateWebhooksEndpointData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_webhooks_endpoint_data.py b/rootly_sdk/models/update_webhooks_endpoint_data.py index c206aef7..3d7f75a2 100644 --- a/rootly_sdk/models/update_webhooks_endpoint_data.py +++ b/rootly_sdk/models/update_webhooks_endpoint_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,11 +25,10 @@ class UpdateWebhooksEndpointData: """ type_: UpdateWebhooksEndpointDataType - attributes: UpdateWebhooksEndpointDataAttributes + attributes: "UpdateWebhooksEndpointDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_webhooks_endpoint_data_attributes.py b/rootly_sdk/models/update_webhooks_endpoint_data_attributes.py index b69e2934..3d0c9d6c 100644 --- a/rootly_sdk/models/update_webhooks_endpoint_data_attributes.py +++ b/rootly_sdk/models/update_webhooks_endpoint_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -24,23 +22,32 @@ class UpdateWebhooksEndpointDataAttributes: """ Attributes: - name (str | Unset): The name of the endpoint - event_types (list[UpdateWebhooksEndpointDataAttributesEventTypesItem] | Unset): - enabled (bool | Unset): - custom_headers (list[UpdateWebhooksEndpointDataAttributesCustomHeadersItem] | Unset): Custom HTTP headers sent - with each delivery. Max 10. Reserved names (Content-Type, X-Rootly-Signature, Host, etc.) are rejected. + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + name (Union[Unset, str]): The name of the endpoint + event_types (Union[Unset, list[UpdateWebhooksEndpointDataAttributesEventTypesItem]]): + enabled (Union[Unset, bool]): + custom_headers (Union[Unset, list['UpdateWebhooksEndpointDataAttributesCustomHeadersItem']]): Custom HTTP + headers sent with each delivery. Max 10. Reserved names (Content-Type, X-Rootly-Signature, Host, etc.) are + rejected. """ - name: str | Unset = UNSET - event_types: list[UpdateWebhooksEndpointDataAttributesEventTypesItem] | Unset = UNSET - enabled: bool | Unset = UNSET - custom_headers: list[UpdateWebhooksEndpointDataAttributesCustomHeadersItem] | Unset = UNSET + slug: Union[None, Unset, str] = UNSET + name: Union[Unset, str] = UNSET + event_types: Union[Unset, list[UpdateWebhooksEndpointDataAttributesEventTypesItem]] = UNSET + enabled: Union[Unset, bool] = UNSET + custom_headers: Union[Unset, list["UpdateWebhooksEndpointDataAttributesCustomHeadersItem"]] = UNSET def to_dict(self) -> dict[str, Any]: + slug: Union[None, Unset, str] + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug name = self.name - event_types: list[str] | Unset = UNSET + event_types: Union[Unset, list[str]] = UNSET if not isinstance(self.event_types, Unset): event_types = [] for event_types_item_data in self.event_types: @@ -49,7 +56,7 @@ def to_dict(self) -> dict[str, Any]: enabled = self.enabled - custom_headers: list[dict[str, Any]] | Unset = UNSET + custom_headers: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.custom_headers, Unset): custom_headers = [] for custom_headers_item_data in self.custom_headers: @@ -59,6 +66,8 @@ def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} field_dict.update({}) + if slug is not UNSET: + field_dict["slug"] = slug if name is not UNSET: field_dict["name"] = name if event_types is not UNSET: @@ -77,33 +86,38 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: ) d = dict(src_dict) + + def _parse_slug(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + slug = _parse_slug(d.pop("slug", UNSET)) + name = d.pop("name", UNSET) + event_types = [] _event_types = d.pop("event_types", UNSET) - event_types: list[UpdateWebhooksEndpointDataAttributesEventTypesItem] | Unset = UNSET - if _event_types is not UNSET: - event_types = [] - for event_types_item_data in _event_types: - event_types_item = check_update_webhooks_endpoint_data_attributes_event_types_item( - event_types_item_data - ) + for event_types_item_data in _event_types or []: + event_types_item = check_update_webhooks_endpoint_data_attributes_event_types_item(event_types_item_data) - event_types.append(event_types_item) + event_types.append(event_types_item) enabled = d.pop("enabled", UNSET) + custom_headers = [] _custom_headers = d.pop("custom_headers", UNSET) - custom_headers: list[UpdateWebhooksEndpointDataAttributesCustomHeadersItem] | Unset = UNSET - if _custom_headers is not UNSET: - custom_headers = [] - for custom_headers_item_data in _custom_headers: - custom_headers_item = UpdateWebhooksEndpointDataAttributesCustomHeadersItem.from_dict( - custom_headers_item_data - ) + for custom_headers_item_data in _custom_headers or []: + custom_headers_item = UpdateWebhooksEndpointDataAttributesCustomHeadersItem.from_dict( + custom_headers_item_data + ) - custom_headers.append(custom_headers_item) + custom_headers.append(custom_headers_item) update_webhooks_endpoint_data_attributes = cls( + slug=slug, name=name, event_types=event_types, enabled=enabled, diff --git a/rootly_sdk/models/update_webhooks_endpoint_data_attributes_custom_headers_item.py b/rootly_sdk/models/update_webhooks_endpoint_data_attributes_custom_headers_item.py index e08d3e1f..5927d14e 100644 --- a/rootly_sdk/models/update_webhooks_endpoint_data_attributes_custom_headers_item.py +++ b/rootly_sdk/models/update_webhooks_endpoint_data_attributes_custom_headers_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/update_webhooks_endpoint_data_attributes_event_types_item.py b/rootly_sdk/models/update_webhooks_endpoint_data_attributes_event_types_item.py index 9cdc03f1..67f69ba4 100644 --- a/rootly_sdk/models/update_webhooks_endpoint_data_attributes_event_types_item.py +++ b/rootly_sdk/models/update_webhooks_endpoint_data_attributes_event_types_item.py @@ -2,6 +2,7 @@ UpdateWebhooksEndpointDataAttributesEventTypesItem = Literal[ "alert.created", + "alert.updated", "audit_log.created", "genius_workflow_run.canceled", "genius_workflow_run.completed", @@ -38,6 +39,7 @@ UpdateWebhooksEndpointDataAttributesEventTypesItem ] = { "alert.created", + "alert.updated", "audit_log.created", "genius_workflow_run.canceled", "genius_workflow_run.completed", diff --git a/rootly_sdk/models/update_workflow.py b/rootly_sdk/models/update_workflow.py index 5364c155..66d9c7cd 100644 --- a/rootly_sdk/models/update_workflow.py +++ b/rootly_sdk/models/update_workflow.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateWorkflow: data (UpdateWorkflowData): """ - data: UpdateWorkflowData + data: "UpdateWorkflowData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_workflow_action_item_form_field_condition.py b/rootly_sdk/models/update_workflow_action_item_form_field_condition.py index 1433a89b..cdfdb15b 100644 --- a/rootly_sdk/models/update_workflow_action_item_form_field_condition.py +++ b/rootly_sdk/models/update_workflow_action_item_form_field_condition.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -22,11 +20,10 @@ class UpdateWorkflowActionItemFormFieldCondition: data (UpdateWorkflowActionItemFormFieldConditionData): """ - data: UpdateWorkflowActionItemFormFieldConditionData + data: "UpdateWorkflowActionItemFormFieldConditionData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_workflow_action_item_form_field_condition_data.py b/rootly_sdk/models/update_workflow_action_item_form_field_condition_data.py index 72950187..f6692ebc 100644 --- a/rootly_sdk/models/update_workflow_action_item_form_field_condition_data.py +++ b/rootly_sdk/models/update_workflow_action_item_form_field_condition_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class UpdateWorkflowActionItemFormFieldConditionData: """ type_: UpdateWorkflowActionItemFormFieldConditionDataType - attributes: UpdateWorkflowActionItemFormFieldConditionDataAttributes + attributes: "UpdateWorkflowActionItemFormFieldConditionDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_workflow_action_item_form_field_condition_data_attributes.py b/rootly_sdk/models/update_workflow_action_item_form_field_condition_data_attributes.py index c44ebd68..042401cd 100644 --- a/rootly_sdk/models/update_workflow_action_item_form_field_condition_data_attributes.py +++ b/rootly_sdk/models/update_workflow_action_item_form_field_condition_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -18,74 +16,77 @@ class UpdateWorkflowActionItemFormFieldConditionDataAttributes: """ Attributes: - action_item_condition (UpdateWorkflowActionItemFormFieldConditionDataAttributesActionItemCondition | Unset): The - trigger condition Default: 'ANY'. - values (list[str] | Unset): - selected_catalog_entity_ids (list[str] | Unset): - selected_functionality_ids (list[str] | Unset): - selected_group_ids (list[str] | Unset): - selected_option_ids (list[str] | Unset): - selected_service_ids (list[str] | Unset): - selected_user_ids (list[int] | Unset): - selected_cause_ids (list[str] | Unset): - selected_environment_ids (list[str] | Unset): - selected_incident_type_ids (list[str] | Unset): + action_item_condition (Union[Unset, + UpdateWorkflowActionItemFormFieldConditionDataAttributesActionItemCondition]): The trigger condition Default: + 'ANY'. + values (Union[Unset, list[str]]): + selected_catalog_entity_ids (Union[Unset, list[str]]): + selected_functionality_ids (Union[Unset, list[str]]): + selected_group_ids (Union[Unset, list[str]]): + selected_option_ids (Union[Unset, list[str]]): + selected_service_ids (Union[Unset, list[str]]): + selected_user_ids (Union[Unset, list[int]]): + selected_cause_ids (Union[Unset, list[str]]): + selected_environment_ids (Union[Unset, list[str]]): + selected_incident_type_ids (Union[Unset, list[str]]): """ - action_item_condition: UpdateWorkflowActionItemFormFieldConditionDataAttributesActionItemCondition | Unset = "ANY" - values: list[str] | Unset = UNSET - selected_catalog_entity_ids: list[str] | Unset = UNSET - selected_functionality_ids: list[str] | Unset = UNSET - selected_group_ids: list[str] | Unset = UNSET - selected_option_ids: list[str] | Unset = UNSET - selected_service_ids: list[str] | Unset = UNSET - selected_user_ids: list[int] | Unset = UNSET - selected_cause_ids: list[str] | Unset = UNSET - selected_environment_ids: list[str] | Unset = UNSET - selected_incident_type_ids: list[str] | Unset = UNSET + action_item_condition: Union[Unset, UpdateWorkflowActionItemFormFieldConditionDataAttributesActionItemCondition] = ( + "ANY" + ) + values: Union[Unset, list[str]] = UNSET + selected_catalog_entity_ids: Union[Unset, list[str]] = UNSET + selected_functionality_ids: Union[Unset, list[str]] = UNSET + selected_group_ids: Union[Unset, list[str]] = UNSET + selected_option_ids: Union[Unset, list[str]] = UNSET + selected_service_ids: Union[Unset, list[str]] = UNSET + selected_user_ids: Union[Unset, list[int]] = UNSET + selected_cause_ids: Union[Unset, list[str]] = UNSET + selected_environment_ids: Union[Unset, list[str]] = UNSET + selected_incident_type_ids: Union[Unset, list[str]] = UNSET def to_dict(self) -> dict[str, Any]: - action_item_condition: str | Unset = UNSET + action_item_condition: Union[Unset, str] = UNSET if not isinstance(self.action_item_condition, Unset): action_item_condition = self.action_item_condition - values: list[str] | Unset = UNSET + values: Union[Unset, list[str]] = UNSET if not isinstance(self.values, Unset): values = self.values - selected_catalog_entity_ids: list[str] | Unset = UNSET + selected_catalog_entity_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.selected_catalog_entity_ids, Unset): selected_catalog_entity_ids = self.selected_catalog_entity_ids - selected_functionality_ids: list[str] | Unset = UNSET + selected_functionality_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.selected_functionality_ids, Unset): selected_functionality_ids = self.selected_functionality_ids - selected_group_ids: list[str] | Unset = UNSET + selected_group_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.selected_group_ids, Unset): selected_group_ids = self.selected_group_ids - selected_option_ids: list[str] | Unset = UNSET + selected_option_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.selected_option_ids, Unset): selected_option_ids = self.selected_option_ids - selected_service_ids: list[str] | Unset = UNSET + selected_service_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.selected_service_ids, Unset): selected_service_ids = self.selected_service_ids - selected_user_ids: list[int] | Unset = UNSET + selected_user_ids: Union[Unset, list[int]] = UNSET if not isinstance(self.selected_user_ids, Unset): selected_user_ids = self.selected_user_ids - selected_cause_ids: list[str] | Unset = UNSET + selected_cause_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.selected_cause_ids, Unset): selected_cause_ids = self.selected_cause_ids - selected_environment_ids: list[str] | Unset = UNSET + selected_environment_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.selected_environment_ids, Unset): selected_environment_ids = self.selected_environment_ids - selected_incident_type_ids: list[str] | Unset = UNSET + selected_incident_type_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.selected_incident_type_ids, Unset): selected_incident_type_ids = self.selected_incident_type_ids @@ -121,7 +122,7 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _action_item_condition = d.pop("action_item_condition", UNSET) - action_item_condition: UpdateWorkflowActionItemFormFieldConditionDataAttributesActionItemCondition | Unset + action_item_condition: Union[Unset, UpdateWorkflowActionItemFormFieldConditionDataAttributesActionItemCondition] if isinstance(_action_item_condition, Unset): action_item_condition = UNSET else: diff --git a/rootly_sdk/models/update_workflow_custom_field_selection.py b/rootly_sdk/models/update_workflow_custom_field_selection.py index 638a1ec9..931ab1c2 100644 --- a/rootly_sdk/models/update_workflow_custom_field_selection.py +++ b/rootly_sdk/models/update_workflow_custom_field_selection.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateWorkflowCustomFieldSelection: data (UpdateWorkflowCustomFieldSelectionData): """ - data: UpdateWorkflowCustomFieldSelectionData + data: "UpdateWorkflowCustomFieldSelectionData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_workflow_custom_field_selection_data.py b/rootly_sdk/models/update_workflow_custom_field_selection_data.py index e1ba2a31..dc4ebd9c 100644 --- a/rootly_sdk/models/update_workflow_custom_field_selection_data.py +++ b/rootly_sdk/models/update_workflow_custom_field_selection_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class UpdateWorkflowCustomFieldSelectionData: """ type_: UpdateWorkflowCustomFieldSelectionDataType - attributes: UpdateWorkflowCustomFieldSelectionDataAttributes + attributes: "UpdateWorkflowCustomFieldSelectionDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_workflow_custom_field_selection_data_attributes.py b/rootly_sdk/models/update_workflow_custom_field_selection_data_attributes.py index 6aa9476a..ab567ff9 100644 --- a/rootly_sdk/models/update_workflow_custom_field_selection_data_attributes.py +++ b/rootly_sdk/models/update_workflow_custom_field_selection_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -18,26 +16,26 @@ class UpdateWorkflowCustomFieldSelectionDataAttributes: """ Attributes: - incident_condition (UpdateWorkflowCustomFieldSelectionDataAttributesIncidentCondition | Unset): The trigger - condition Default: 'ANY'. - values (list[str] | Unset): - selected_option_ids (list[int] | Unset): + incident_condition (Union[Unset, UpdateWorkflowCustomFieldSelectionDataAttributesIncidentCondition]): The + trigger condition Default: 'ANY'. + values (Union[Unset, list[str]]): + selected_option_ids (Union[Unset, list[int]]): """ - incident_condition: UpdateWorkflowCustomFieldSelectionDataAttributesIncidentCondition | Unset = "ANY" - values: list[str] | Unset = UNSET - selected_option_ids: list[int] | Unset = UNSET + incident_condition: Union[Unset, UpdateWorkflowCustomFieldSelectionDataAttributesIncidentCondition] = "ANY" + values: Union[Unset, list[str]] = UNSET + selected_option_ids: Union[Unset, list[int]] = UNSET def to_dict(self) -> dict[str, Any]: - incident_condition: str | Unset = UNSET + incident_condition: Union[Unset, str] = UNSET if not isinstance(self.incident_condition, Unset): incident_condition = self.incident_condition - values: list[str] | Unset = UNSET + values: Union[Unset, list[str]] = UNSET if not isinstance(self.values, Unset): values = self.values - selected_option_ids: list[int] | Unset = UNSET + selected_option_ids: Union[Unset, list[int]] = UNSET if not isinstance(self.selected_option_ids, Unset): selected_option_ids = self.selected_option_ids @@ -57,7 +55,7 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _incident_condition = d.pop("incident_condition", UNSET) - incident_condition: UpdateWorkflowCustomFieldSelectionDataAttributesIncidentCondition | Unset + incident_condition: Union[Unset, UpdateWorkflowCustomFieldSelectionDataAttributesIncidentCondition] if isinstance(_incident_condition, Unset): incident_condition = UNSET else: diff --git a/rootly_sdk/models/update_workflow_data.py b/rootly_sdk/models/update_workflow_data.py index 2da420ed..3283f669 100644 --- a/rootly_sdk/models/update_workflow_data.py +++ b/rootly_sdk/models/update_workflow_data.py @@ -1,12 +1,10 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define -from attrs import field as _attrs_field from ..models.update_workflow_data_type import UpdateWorkflowDataType, check_update_workflow_data_type +from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.update_workflow_data_attributes import UpdateWorkflowDataAttributes @@ -21,26 +19,31 @@ class UpdateWorkflowData: Attributes: type_ (UpdateWorkflowDataType): attributes (UpdateWorkflowDataAttributes): + id (Union[Unset, str]): Accepted for JSON:API client compatibility, but ignored. The workflow to update is + identified by the id in the path. """ type_: UpdateWorkflowDataType - attributes: UpdateWorkflowDataAttributes - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: "UpdateWorkflowDataAttributes" + id: Union[Unset, str] = UNSET def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() + id = self.id + field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, "attributes": attributes, } ) + if id is not UNSET: + field_dict["id"] = id return field_dict @@ -53,26 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = UpdateWorkflowDataAttributes.from_dict(d.pop("attributes")) + id = d.pop("id", UNSET) + update_workflow_data = cls( type_=type_, attributes=attributes, + id=id, ) - update_workflow_data.additional_properties = d return update_workflow_data - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/rootly_sdk/models/update_workflow_data_attributes.py b/rootly_sdk/models/update_workflow_data_attributes.py index be178cbf..5f141d1f 100644 --- a/rootly_sdk/models/update_workflow_data_attributes.py +++ b/rootly_sdk/models/update_workflow_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -22,66 +20,69 @@ class UpdateWorkflowDataAttributes: """ Attributes: - name (str | Unset): The title of the workflow - description (None | str | Unset): The description of the workflow - command (None | str | Unset): Workflow command - command_feedback_enabled (bool | None | Unset): This will notify you back when the workflow is starting - wait (None | str | Unset): Wait this duration before executing - repeat_every_duration (None | str | Unset): Repeat workflow every duration - repeat_condition_duration_since_first_run (None | str | Unset): The workflow will stop repeating if its runtime - since it's first workflow run exceeds the duration set in this field - repeat_condition_number_of_repeats (int | Unset): The workflow will stop repeating if the number of repeats - exceeds the value set in this field - continuously_repeat (bool | Unset): When continuously repeat is true, repeat workflows aren't automatically - stopped when conditions aren't met. This setting won't override your conditions set by + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + property will be removed from the request schema in a future version. + name (Union[Unset, str]): The title of the workflow + description (Union[None, Unset, str]): The description of the workflow + command (Union[None, Unset, str]): Workflow command + command_feedback_enabled (Union[None, Unset, bool]): This will notify you back when the workflow is starting + wait (Union[None, Unset, str]): Wait this duration before executing + repeat_every_duration (Union[None, Unset, str]): Repeat workflow every duration + repeat_condition_duration_since_first_run (Union[None, Unset, str]): The workflow will stop repeating if its + runtime since it's first workflow run exceeds the duration set in this field + repeat_condition_number_of_repeats (Union[Unset, int]): The workflow will stop repeating if the number of + repeats exceeds the value set in this field + continuously_repeat (Union[Unset, bool]): When continuously repeat is true, repeat workflows aren't + automatically stopped when conditions aren't met. This setting won't override your conditions set by repeat_condition_duration_since_first_run and repeat_condition_number_of_repeats parameters. - enabled (bool | Unset): - locked (bool | Unset): Restricts workflow edits to admins when turned on. Only admins can set this field. - position (int | Unset): The order which the workflow should run with other workflows. - workflow_group_id (None | str | Unset): The group this workflow belongs to. - trigger_params (ActionItemTriggerParams | AlertTriggerParams | IncidentTriggerParams | PulseTriggerParams | - SimpleTriggerParams | Unset): - environment_ids (list[str] | Unset): - severity_ids (list[str] | Unset): - incident_type_ids (list[str] | Unset): - incident_role_ids (list[str] | Unset): - service_ids (list[str] | Unset): - functionality_ids (list[str] | Unset): - group_ids (list[str] | Unset): - cause_ids (list[str] | Unset): - sub_status_ids (list[str] | Unset): + enabled (Union[Unset, bool]): + locked (Union[Unset, bool]): Restricts workflow edits to admins when turned on. Only admins can set this field. + position (Union[Unset, int]): The order which the workflow should run with other workflows. + workflow_group_id (Union[None, Unset, str]): The group this workflow belongs to. + trigger_params (Union['ActionItemTriggerParams', 'AlertTriggerParams', 'IncidentTriggerParams', + 'PulseTriggerParams', 'SimpleTriggerParams', Unset]): + environment_ids (Union[Unset, list[str]]): + severity_ids (Union[Unset, list[str]]): + incident_type_ids (Union[Unset, list[str]]): + incident_role_ids (Union[Unset, list[str]]): + service_ids (Union[Unset, list[str]]): + functionality_ids (Union[Unset, list[str]]): + group_ids (Union[Unset, list[str]]): + cause_ids (Union[Unset, list[str]]): + sub_status_ids (Union[Unset, list[str]]): """ - name: str | Unset = UNSET - description: None | str | Unset = UNSET - command: None | str | Unset = UNSET - command_feedback_enabled: bool | None | Unset = UNSET - wait: None | str | Unset = UNSET - repeat_every_duration: None | str | Unset = UNSET - repeat_condition_duration_since_first_run: None | str | Unset = UNSET - repeat_condition_number_of_repeats: int | Unset = UNSET - continuously_repeat: bool | Unset = UNSET - enabled: bool | Unset = UNSET - locked: bool | Unset = UNSET - position: int | Unset = UNSET - workflow_group_id: None | str | Unset = UNSET - trigger_params: ( - ActionItemTriggerParams - | AlertTriggerParams - | IncidentTriggerParams - | PulseTriggerParams - | SimpleTriggerParams - | Unset - ) = UNSET - environment_ids: list[str] | Unset = UNSET - severity_ids: list[str] | Unset = UNSET - incident_type_ids: list[str] | Unset = UNSET - incident_role_ids: list[str] | Unset = UNSET - service_ids: list[str] | Unset = UNSET - functionality_ids: list[str] | Unset = UNSET - group_ids: list[str] | Unset = UNSET - cause_ids: list[str] | Unset = UNSET - sub_status_ids: list[str] | Unset = UNSET + slug: Union[None, Unset, str] = UNSET + name: Union[Unset, str] = UNSET + description: Union[None, Unset, str] = UNSET + command: Union[None, Unset, str] = UNSET + command_feedback_enabled: Union[None, Unset, bool] = UNSET + wait: Union[None, Unset, str] = UNSET + repeat_every_duration: Union[None, Unset, str] = UNSET + repeat_condition_duration_since_first_run: Union[None, Unset, str] = UNSET + repeat_condition_number_of_repeats: Union[Unset, int] = UNSET + continuously_repeat: Union[Unset, bool] = UNSET + enabled: Union[Unset, bool] = UNSET + locked: Union[Unset, bool] = UNSET + position: Union[Unset, int] = UNSET + workflow_group_id: Union[None, Unset, str] = UNSET + trigger_params: Union[ + "ActionItemTriggerParams", + "AlertTriggerParams", + "IncidentTriggerParams", + "PulseTriggerParams", + "SimpleTriggerParams", + Unset, + ] = UNSET + environment_ids: Union[Unset, list[str]] = UNSET + severity_ids: Union[Unset, list[str]] = UNSET + incident_type_ids: Union[Unset, list[str]] = UNSET + incident_role_ids: Union[Unset, list[str]] = UNSET + service_ids: Union[Unset, list[str]] = UNSET + functionality_ids: Union[Unset, list[str]] = UNSET + group_ids: Union[Unset, list[str]] = UNSET + cause_ids: Union[Unset, list[str]] = UNSET + sub_status_ids: Union[Unset, list[str]] = UNSET def to_dict(self) -> dict[str, Any]: from ..models.action_item_trigger_params import ActionItemTriggerParams @@ -89,39 +90,45 @@ def to_dict(self) -> dict[str, Any]: from ..models.incident_trigger_params import IncidentTriggerParams from ..models.pulse_trigger_params import PulseTriggerParams + slug: Union[None, Unset, str] + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug + name = self.name - description: None | str | Unset + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: description = self.description - command: None | str | Unset + command: Union[None, Unset, str] if isinstance(self.command, Unset): command = UNSET else: command = self.command - command_feedback_enabled: bool | None | Unset + command_feedback_enabled: Union[None, Unset, bool] if isinstance(self.command_feedback_enabled, Unset): command_feedback_enabled = UNSET else: command_feedback_enabled = self.command_feedback_enabled - wait: None | str | Unset + wait: Union[None, Unset, str] if isinstance(self.wait, Unset): wait = UNSET else: wait = self.wait - repeat_every_duration: None | str | Unset + repeat_every_duration: Union[None, Unset, str] if isinstance(self.repeat_every_duration, Unset): repeat_every_duration = UNSET else: repeat_every_duration = self.repeat_every_duration - repeat_condition_duration_since_first_run: None | str | Unset + repeat_condition_duration_since_first_run: Union[None, Unset, str] if isinstance(self.repeat_condition_duration_since_first_run, Unset): repeat_condition_duration_since_first_run = UNSET else: @@ -137,13 +144,13 @@ def to_dict(self) -> dict[str, Any]: position = self.position - workflow_group_id: None | str | Unset + workflow_group_id: Union[None, Unset, str] if isinstance(self.workflow_group_id, Unset): workflow_group_id = UNSET else: workflow_group_id = self.workflow_group_id - trigger_params: dict[str, Any] | Unset + trigger_params: Union[Unset, dict[str, Any]] if isinstance(self.trigger_params, Unset): trigger_params = UNSET elif isinstance(self.trigger_params, IncidentTriggerParams): @@ -157,45 +164,47 @@ def to_dict(self) -> dict[str, Any]: else: trigger_params = self.trigger_params.to_dict() - environment_ids: list[str] | Unset = UNSET + environment_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.environment_ids, Unset): environment_ids = self.environment_ids - severity_ids: list[str] | Unset = UNSET + severity_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.severity_ids, Unset): severity_ids = self.severity_ids - incident_type_ids: list[str] | Unset = UNSET + incident_type_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.incident_type_ids, Unset): incident_type_ids = self.incident_type_ids - incident_role_ids: list[str] | Unset = UNSET + incident_role_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.incident_role_ids, Unset): incident_role_ids = self.incident_role_ids - service_ids: list[str] | Unset = UNSET + service_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.service_ids, Unset): service_ids = self.service_ids - functionality_ids: list[str] | Unset = UNSET + functionality_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.functionality_ids, Unset): functionality_ids = self.functionality_ids - group_ids: list[str] | Unset = UNSET + group_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.group_ids, Unset): group_ids = self.group_ids - cause_ids: list[str] | Unset = UNSET + cause_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.cause_ids, Unset): cause_ids = self.cause_ids - sub_status_ids: list[str] | Unset = UNSET + sub_status_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.sub_status_ids, Unset): sub_status_ids = self.sub_status_ids field_dict: dict[str, Any] = {} field_dict.update({}) + if slug is not UNSET: + field_dict["slug"] = slug if name is not UNSET: field_dict["name"] = name if description is not UNSET: @@ -254,59 +263,69 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: from ..models.simple_trigger_params import SimpleTriggerParams d = dict(src_dict) + + def _parse_slug(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + slug = _parse_slug(d.pop("slug", UNSET)) + name = d.pop("name", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) - def _parse_command(data: object) -> None | str | Unset: + def _parse_command(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) command = _parse_command(d.pop("command", UNSET)) - def _parse_command_feedback_enabled(data: object) -> bool | None | Unset: + def _parse_command_feedback_enabled(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) command_feedback_enabled = _parse_command_feedback_enabled(d.pop("command_feedback_enabled", UNSET)) - def _parse_wait(data: object) -> None | str | Unset: + def _parse_wait(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) wait = _parse_wait(d.pop("wait", UNSET)) - def _parse_repeat_every_duration(data: object) -> None | str | Unset: + def _parse_repeat_every_duration(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) repeat_every_duration = _parse_repeat_every_duration(d.pop("repeat_every_duration", UNSET)) - def _parse_repeat_condition_duration_since_first_run(data: object) -> None | str | Unset: + def _parse_repeat_condition_duration_since_first_run(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) repeat_condition_duration_since_first_run = _parse_repeat_condition_duration_since_first_run( d.pop("repeat_condition_duration_since_first_run", UNSET) @@ -322,25 +341,25 @@ def _parse_repeat_condition_duration_since_first_run(data: object) -> None | str position = d.pop("position", UNSET) - def _parse_workflow_group_id(data: object) -> None | str | Unset: + def _parse_workflow_group_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) workflow_group_id = _parse_workflow_group_id(d.pop("workflow_group_id", UNSET)) def _parse_trigger_params( data: object, - ) -> ( - ActionItemTriggerParams - | AlertTriggerParams - | IncidentTriggerParams - | PulseTriggerParams - | SimpleTriggerParams - | Unset - ): + ) -> Union[ + "ActionItemTriggerParams", + "AlertTriggerParams", + "IncidentTriggerParams", + "PulseTriggerParams", + "SimpleTriggerParams", + Unset, + ]: if isinstance(data, Unset): return data try: @@ -349,7 +368,7 @@ def _parse_trigger_params( trigger_params_type_0 = IncidentTriggerParams.from_dict(data) return trigger_params_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -357,7 +376,7 @@ def _parse_trigger_params( trigger_params_type_1 = ActionItemTriggerParams.from_dict(data) return trigger_params_type_1 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -365,7 +384,7 @@ def _parse_trigger_params( trigger_params_type_2 = AlertTriggerParams.from_dict(data) return trigger_params_type_2 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -373,7 +392,7 @@ def _parse_trigger_params( trigger_params_type_3 = PulseTriggerParams.from_dict(data) return trigger_params_type_3 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass if not isinstance(data, dict): raise TypeError() @@ -402,6 +421,7 @@ def _parse_trigger_params( sub_status_ids = cast(list[str], d.pop("sub_status_ids", UNSET)) update_workflow_data_attributes = cls( + slug=slug, name=name, description=description, command=command, diff --git a/rootly_sdk/models/update_workflow_form_field_condition.py b/rootly_sdk/models/update_workflow_form_field_condition.py index 93eb741d..5dcc8f4a 100644 --- a/rootly_sdk/models/update_workflow_form_field_condition.py +++ b/rootly_sdk/models/update_workflow_form_field_condition.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateWorkflowFormFieldCondition: data (UpdateWorkflowFormFieldConditionData): """ - data: UpdateWorkflowFormFieldConditionData + data: "UpdateWorkflowFormFieldConditionData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_workflow_form_field_condition_data.py b/rootly_sdk/models/update_workflow_form_field_condition_data.py index e83fbb57..de2ac575 100644 --- a/rootly_sdk/models/update_workflow_form_field_condition_data.py +++ b/rootly_sdk/models/update_workflow_form_field_condition_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class UpdateWorkflowFormFieldConditionData: """ type_: UpdateWorkflowFormFieldConditionDataType - attributes: UpdateWorkflowFormFieldConditionDataAttributes + attributes: "UpdateWorkflowFormFieldConditionDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_workflow_form_field_condition_data_attributes.py b/rootly_sdk/models/update_workflow_form_field_condition_data_attributes.py index 212d2286..dee79350 100644 --- a/rootly_sdk/models/update_workflow_form_field_condition_data_attributes.py +++ b/rootly_sdk/models/update_workflow_form_field_condition_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define @@ -18,74 +16,74 @@ class UpdateWorkflowFormFieldConditionDataAttributes: """ Attributes: - incident_condition (UpdateWorkflowFormFieldConditionDataAttributesIncidentCondition | Unset): The trigger + incident_condition (Union[Unset, UpdateWorkflowFormFieldConditionDataAttributesIncidentCondition]): The trigger condition Default: 'ANY'. - values (list[str] | Unset): - selected_catalog_entity_ids (list[str] | Unset): - selected_functionality_ids (list[str] | Unset): - selected_group_ids (list[str] | Unset): - selected_option_ids (list[str] | Unset): - selected_service_ids (list[str] | Unset): - selected_user_ids (list[int] | Unset): - selected_cause_ids (list[str] | Unset): - selected_environment_ids (list[str] | Unset): - selected_incident_type_ids (list[str] | Unset): + values (Union[Unset, list[str]]): + selected_catalog_entity_ids (Union[Unset, list[str]]): + selected_functionality_ids (Union[Unset, list[str]]): + selected_group_ids (Union[Unset, list[str]]): + selected_option_ids (Union[Unset, list[str]]): + selected_service_ids (Union[Unset, list[str]]): + selected_user_ids (Union[Unset, list[int]]): + selected_cause_ids (Union[Unset, list[str]]): + selected_environment_ids (Union[Unset, list[str]]): + selected_incident_type_ids (Union[Unset, list[str]]): """ - incident_condition: UpdateWorkflowFormFieldConditionDataAttributesIncidentCondition | Unset = "ANY" - values: list[str] | Unset = UNSET - selected_catalog_entity_ids: list[str] | Unset = UNSET - selected_functionality_ids: list[str] | Unset = UNSET - selected_group_ids: list[str] | Unset = UNSET - selected_option_ids: list[str] | Unset = UNSET - selected_service_ids: list[str] | Unset = UNSET - selected_user_ids: list[int] | Unset = UNSET - selected_cause_ids: list[str] | Unset = UNSET - selected_environment_ids: list[str] | Unset = UNSET - selected_incident_type_ids: list[str] | Unset = UNSET + incident_condition: Union[Unset, UpdateWorkflowFormFieldConditionDataAttributesIncidentCondition] = "ANY" + values: Union[Unset, list[str]] = UNSET + selected_catalog_entity_ids: Union[Unset, list[str]] = UNSET + selected_functionality_ids: Union[Unset, list[str]] = UNSET + selected_group_ids: Union[Unset, list[str]] = UNSET + selected_option_ids: Union[Unset, list[str]] = UNSET + selected_service_ids: Union[Unset, list[str]] = UNSET + selected_user_ids: Union[Unset, list[int]] = UNSET + selected_cause_ids: Union[Unset, list[str]] = UNSET + selected_environment_ids: Union[Unset, list[str]] = UNSET + selected_incident_type_ids: Union[Unset, list[str]] = UNSET def to_dict(self) -> dict[str, Any]: - incident_condition: str | Unset = UNSET + incident_condition: Union[Unset, str] = UNSET if not isinstance(self.incident_condition, Unset): incident_condition = self.incident_condition - values: list[str] | Unset = UNSET + values: Union[Unset, list[str]] = UNSET if not isinstance(self.values, Unset): values = self.values - selected_catalog_entity_ids: list[str] | Unset = UNSET + selected_catalog_entity_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.selected_catalog_entity_ids, Unset): selected_catalog_entity_ids = self.selected_catalog_entity_ids - selected_functionality_ids: list[str] | Unset = UNSET + selected_functionality_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.selected_functionality_ids, Unset): selected_functionality_ids = self.selected_functionality_ids - selected_group_ids: list[str] | Unset = UNSET + selected_group_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.selected_group_ids, Unset): selected_group_ids = self.selected_group_ids - selected_option_ids: list[str] | Unset = UNSET + selected_option_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.selected_option_ids, Unset): selected_option_ids = self.selected_option_ids - selected_service_ids: list[str] | Unset = UNSET + selected_service_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.selected_service_ids, Unset): selected_service_ids = self.selected_service_ids - selected_user_ids: list[int] | Unset = UNSET + selected_user_ids: Union[Unset, list[int]] = UNSET if not isinstance(self.selected_user_ids, Unset): selected_user_ids = self.selected_user_ids - selected_cause_ids: list[str] | Unset = UNSET + selected_cause_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.selected_cause_ids, Unset): selected_cause_ids = self.selected_cause_ids - selected_environment_ids: list[str] | Unset = UNSET + selected_environment_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.selected_environment_ids, Unset): selected_environment_ids = self.selected_environment_ids - selected_incident_type_ids: list[str] | Unset = UNSET + selected_incident_type_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.selected_incident_type_ids, Unset): selected_incident_type_ids = self.selected_incident_type_ids @@ -121,7 +119,7 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _incident_condition = d.pop("incident_condition", UNSET) - incident_condition: UpdateWorkflowFormFieldConditionDataAttributesIncidentCondition | Unset + incident_condition: Union[Unset, UpdateWorkflowFormFieldConditionDataAttributesIncidentCondition] if isinstance(_incident_condition, Unset): incident_condition = UNSET else: diff --git a/rootly_sdk/models/update_workflow_group.py b/rootly_sdk/models/update_workflow_group.py index 0f3e5d4f..14a490be 100644 --- a/rootly_sdk/models/update_workflow_group.py +++ b/rootly_sdk/models/update_workflow_group.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateWorkflowGroup: data (UpdateWorkflowGroupData): """ - data: UpdateWorkflowGroupData + data: "UpdateWorkflowGroupData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_workflow_group_data.py b/rootly_sdk/models/update_workflow_group_data.py index e5eda1a8..dca07ffb 100644 --- a/rootly_sdk/models/update_workflow_group_data.py +++ b/rootly_sdk/models/update_workflow_group_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class UpdateWorkflowGroupData: """ type_: UpdateWorkflowGroupDataType - attributes: UpdateWorkflowGroupDataAttributes + attributes: "UpdateWorkflowGroupDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_workflow_group_data_attributes.py b/rootly_sdk/models/update_workflow_group_data_attributes.py index b61fd078..356af9ef 100644 --- a/rootly_sdk/models/update_workflow_group_data_attributes.py +++ b/rootly_sdk/models/update_workflow_group_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,30 +17,39 @@ class UpdateWorkflowGroupDataAttributes: """ Attributes: - kind (UpdateWorkflowGroupDataAttributesKind | Unset): The kind of the workflow group - name (str | Unset): The name of the workflow group. - description (None | str | Unset): A description of the workflow group. - icon (str | Unset): An emoji icon displayed next to the workflow group. - expanded (bool | Unset): Whether the group is expanded or collapsed. - position (int | Unset): The position of the workflow group + slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name` and `kind`; any submitted value is + ignored. This property will be removed from the request schema in a future version. + kind (Union[Unset, UpdateWorkflowGroupDataAttributesKind]): The kind of the workflow group + name (Union[Unset, str]): The name of the workflow group. + description (Union[None, Unset, str]): A description of the workflow group. + icon (Union[Unset, str]): An emoji icon displayed next to the workflow group. + expanded (Union[Unset, bool]): Whether the group is expanded or collapsed. + position (Union[Unset, int]): The position of the workflow group """ - kind: UpdateWorkflowGroupDataAttributesKind | Unset = UNSET - name: str | Unset = UNSET - description: None | str | Unset = UNSET - icon: str | Unset = UNSET - expanded: bool | Unset = UNSET - position: int | Unset = UNSET + slug: Union[None, Unset, str] = UNSET + kind: Union[Unset, UpdateWorkflowGroupDataAttributesKind] = UNSET + name: Union[Unset, str] = UNSET + description: Union[None, Unset, str] = UNSET + icon: Union[Unset, str] = UNSET + expanded: Union[Unset, bool] = UNSET + position: Union[Unset, int] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - kind: str | Unset = UNSET + slug: Union[None, Unset, str] + if isinstance(self.slug, Unset): + slug = UNSET + else: + slug = self.slug + + kind: Union[Unset, str] = UNSET if not isinstance(self.kind, Unset): kind = self.kind name = self.name - description: None | str | Unset + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: @@ -57,6 +64,8 @@ def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update({}) + if slug is not UNSET: + field_dict["slug"] = slug if kind is not UNSET: field_dict["kind"] = kind if name is not UNSET: @@ -75,8 +84,18 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) + + def _parse_slug(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + slug = _parse_slug(d.pop("slug", UNSET)) + _kind = d.pop("kind", UNSET) - kind: UpdateWorkflowGroupDataAttributesKind | Unset + kind: Union[Unset, UpdateWorkflowGroupDataAttributesKind] if isinstance(_kind, Unset): kind = UNSET else: @@ -84,12 +103,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name = d.pop("name", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) @@ -100,6 +119,7 @@ def _parse_description(data: object) -> None | str | Unset: position = d.pop("position", UNSET) update_workflow_group_data_attributes = cls( + slug=slug, kind=kind, name=name, description=description, diff --git a/rootly_sdk/models/update_workflow_task.py b/rootly_sdk/models/update_workflow_task.py index 93fe2216..e1af76eb 100644 --- a/rootly_sdk/models/update_workflow_task.py +++ b/rootly_sdk/models/update_workflow_task.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UpdateWorkflowTask: data (UpdateWorkflowTaskData): """ - data: UpdateWorkflowTaskData + data: "UpdateWorkflowTaskData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/update_workflow_task_data.py b/rootly_sdk/models/update_workflow_task_data.py index d2f7760b..e84af22e 100644 --- a/rootly_sdk/models/update_workflow_task_data.py +++ b/rootly_sdk/models/update_workflow_task_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,11 +22,10 @@ class UpdateWorkflowTaskData: """ type_: UpdateWorkflowTaskDataType - attributes: UpdateWorkflowTaskDataAttributes + attributes: "UpdateWorkflowTaskDataAttributes" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: str = self.type_ attributes = self.attributes.to_dict() diff --git a/rootly_sdk/models/update_workflow_task_data_attributes.py b/rootly_sdk/models/update_workflow_task_data_attributes.py index c7a0cbe9..f3d880be 100644 --- a/rootly_sdk/models/update_workflow_task_data_attributes.py +++ b/rootly_sdk/models/update_workflow_task_data_attributes.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define @@ -21,11 +19,18 @@ from ..models.archive_microsoft_teams_channels_task_params import ArchiveMicrosoftTeamsChannelsTaskParams from ..models.archive_slack_channels_task_params import ArchiveSlackChannelsTaskParams from ..models.attach_datadog_dashboards_task_params import AttachDatadogDashboardsTaskParams + from ..models.attach_retrospective_pdf_to_freshservice_ticket_task_params import ( + AttachRetrospectivePdfToFreshserviceTicketTaskParams, + ) from ..models.attach_retrospective_pdf_to_jira_issue_task_params import AttachRetrospectivePdfToJiraIssueTaskParams from ..models.auto_assign_role_opsgenie_task_params import AutoAssignRoleOpsgenieTaskParams from ..models.auto_assign_role_pagerduty_task_params_type_0 import AutoAssignRolePagerdutyTaskParamsType0 from ..models.auto_assign_role_pagerduty_task_params_type_1 import AutoAssignRolePagerdutyTaskParamsType1 - from ..models.auto_assign_role_rootly_task_params import AutoAssignRoleRootlyTaskParams + from ..models.auto_assign_role_rootly_task_params_type_0 import AutoAssignRoleRootlyTaskParamsType0 + from ..models.auto_assign_role_rootly_task_params_type_1 import AutoAssignRoleRootlyTaskParamsType1 + from ..models.auto_assign_role_rootly_task_params_type_2 import AutoAssignRoleRootlyTaskParamsType2 + from ..models.auto_assign_role_rootly_task_params_type_3 import AutoAssignRoleRootlyTaskParamsType3 + from ..models.auto_assign_role_rootly_task_params_type_4 import AutoAssignRoleRootlyTaskParamsType4 from ..models.auto_assign_role_victor_ops_task_params import AutoAssignRoleVictorOpsTaskParams from ..models.call_people_task_params import CallPeopleTaskParams from ..models.change_google_chat_space_privacy_task_params import ChangeGoogleChatSpacePrivacyTaskParams @@ -188,237 +193,248 @@ class UpdateWorkflowTaskDataAttributes: """ Attributes: - name (str | Unset): Name of the workflow task - position (int | Unset): The position of the workflow task - skip_on_failure (bool | Unset): Skip workflow task if any failures - enabled (bool | Unset): Enable/disable workflow task Default: True. - task_params (AddActionItemTaskParams | AddMicrosoftTeamsChatTabTaskParams | AddMicrosoftTeamsTabTaskParamsType0 - | AddMicrosoftTeamsTabTaskParamsType1 | AddRoleTaskParams | AddSlackBookmarkTaskParamsType0 | - AddSlackBookmarkTaskParamsType1 | AddTeamTaskParams | AddToTimelineTaskParams | - ArchiveGoogleChatSpacesTaskParams | ArchiveMicrosoftTeamsChannelsTaskParams | ArchiveSlackChannelsTaskParams | - AttachDatadogDashboardsTaskParams | AttachRetrospectivePdfToJiraIssueTaskParams | - AutoAssignRoleOpsgenieTaskParams | AutoAssignRolePagerdutyTaskParamsType0 | - AutoAssignRolePagerdutyTaskParamsType1 | AutoAssignRoleRootlyTaskParams | AutoAssignRoleVictorOpsTaskParams | - CallPeopleTaskParams | ChangeGoogleChatSpacePrivacyTaskParams | ChangeSlackChannelPrivacyTaskParams | - CreateAirtableTableRecordTaskParams | CreateAnthropicChatCompletionTaskParams | CreateAsanaSubtaskTaskParams | - CreateAsanaTaskTaskParams | CreateClickupTaskTaskParams | CreateCodaPageTaskParams | - CreateConfluencePageTaskParams | CreateDatadogNotebookTaskParams | CreateDropboxPaperPageTaskParams | - CreateGithubIssueTaskParams | CreateGitlabIssueTaskParams | CreateGoogleCalendarEventTaskParams | - CreateGoogleChatSpaceTaskParams | CreateGoogleDocsPageTaskParams | CreateGoogleDocsPermissionsTaskParams | - CreateGoogleGeminiChatCompletionTaskParams | CreateGoogleMeetingTaskParams | CreateGoToMeetingTaskParams | - CreateIncidentPostmortemTaskParams | CreateIncidentTaskParams | CreateJiraIssueTaskParams | - CreateJiraSubtaskTaskParams | CreateJsmopsAlertTaskParams | CreateLinearIssueCommentTaskParams | - CreateLinearIssueTaskParams | CreateLinearSubtaskIssueTaskParams | CreateMicrosoftTeamsChannelTaskParams | - CreateMicrosoftTeamsChatTaskParams | CreateMicrosoftTeamsMeetingTaskParams | - CreateMistralChatCompletionTaskParams | CreateMotionTaskTaskParams | CreateNotionPageTaskParams | - CreateOpenaiChatCompletionTaskParams | CreateOpsgenieAlertTaskParams | CreateOutlookEventTaskParams | - CreatePagerdutyStatusUpdateTaskParams | CreatePagertreeAlertTaskParams | CreateQuipPageTaskParams | - CreateServiceNowIncidentTaskParams | CreateSharepointPageTaskParams | CreateShortcutStoryTaskParamsType0 | - CreateShortcutStoryTaskParamsType1 | CreateShortcutTaskTaskParams | CreateSlackChannelTaskParams | - CreateSubIncidentTaskParams | CreateTrelloCardTaskParams | CreateWatsonxChatCompletionTaskParams | - CreateWebexMeetingTaskParams | CreateZendeskJiraLinkTaskParams | CreateZendeskTicketTaskParams | - CreateZoomMeetingTaskParams | GetAlertsTaskParams | GetGithubCommitsTaskParamsType0 | - GetGithubCommitsTaskParamsType1 | GetGitlabCommitsTaskParamsType0 | GetGitlabCommitsTaskParamsType1 | - GetPulsesTaskParams | HttpClientTaskParams | InviteToGoogleChatSpaceTaskParams | - InviteToMicrosoftTeamsChannelRootlyTaskParams | InviteToMicrosoftTeamsChannelTaskParams | - InviteToSlackChannelOpsgenieTaskParams | InviteToSlackChannelPagerdutyTaskParamsType0 | - InviteToSlackChannelPagerdutyTaskParamsType1 | InviteToSlackChannelRootlyTaskParams | - InviteToSlackChannelTaskParamsType0 | InviteToSlackChannelTaskParamsType1 | InviteToSlackChannelTaskParamsType2 - | InviteToSlackChannelVictorOpsTaskParams | PageJsmopsOnCallRespondersTaskParams | - PageOpsgenieOnCallRespondersTaskParams | PagePagerdutyOnCallRespondersTaskParams | - PageRootlyOnCallRespondersTaskParams | PageVictorOpsOnCallRespondersTaskParamsType0 | - PageVictorOpsOnCallRespondersTaskParamsType1 | PrintTaskParams | PublishIncidentTaskParams | - RedisClientTaskParams | RemoveGoogleDocsPermissionsTaskParams | RenameGoogleChatSpaceTaskParams | - RenameMicrosoftTeamsChannelTaskParams | RenameSlackChannelTaskParams | RunCommandHerokuTaskParams | - SendDashboardReportTaskParams | SendEmailTaskParams | SendGoogleChatAttachmentsTaskParams | - SendGoogleChatMessageTaskParams | SendMicrosoftTeamsBlocksTaskParamsType0 | - SendMicrosoftTeamsChatMessageTaskParams | SendMicrosoftTeamsMessageTaskParamsType0 | - SendSlackBlocksTaskParamsType0 | SendSlackBlocksTaskParamsType1 | SendSlackBlocksTaskParamsType2 | - SendSlackMessageTaskParamsType0 | SendSlackMessageTaskParamsType1 | SendSlackMessageTaskParamsType2 | - SendSmsTaskParams | SendWhatsappMessageTaskParams | SnapshotDatadogGraphTaskParams | - SnapshotGrafanaDashboardTaskParams | SnapshotLookerLookTaskParams | SnapshotNewRelicGraphTaskParams | - TriggerWorkflowTaskParams | TweetTwitterMessageTaskParams | Unset | UpdateActionItemTaskParams | - UpdateAirtableTableRecordTaskParams | UpdateAsanaTaskTaskParams | UpdateAttachedAlertsTaskParams | - UpdateClickupTaskTaskParams | UpdateCodaPageTaskParams | UpdateConfluencePageTaskParams | - UpdateDatadogNotebookTaskParams | UpdateDropboxPaperPageTaskParams | UpdateGithubIssueTaskParams | - UpdateGitlabIssueTaskParams | UpdateGoogleCalendarEventTaskParams | UpdateGoogleChatSpaceDescriptionTaskParams | - UpdateGoogleDocsPageTaskParams | UpdateIncidentPostmortemTaskParams | UpdateIncidentStatusTimestampTaskParams | - UpdateIncidentTaskParams | UpdateJiraIssueTaskParams | UpdateLinearIssueTaskParams | UpdateMotionTaskTaskParams - | UpdateNotionPageTaskParams | UpdateOpsgenieAlertTaskParams | UpdateOpsgenieIncidentTaskParams | - UpdatePagerdutyIncidentTaskParams | UpdatePagertreeAlertTaskParams | UpdateQuipPageTaskParams | - UpdateServiceNowIncidentTaskParams | UpdateSharepointPageTaskParams | UpdateShortcutStoryTaskParams | - UpdateShortcutTaskTaskParams | UpdateSlackChannelTopicTaskParams | UpdateStatusTaskParams | - UpdateTrelloCardTaskParams | UpdateVictorOpsIncidentTaskParams | UpdateZendeskTicketTaskParams): + name (Union[Unset, str]): Name of the workflow task + position (Union[Unset, int]): The position of the workflow task + skip_on_failure (Union[Unset, bool]): Skip workflow task if any failures + enabled (Union[Unset, bool]): Enable/disable workflow task Default: True. + task_params (Union['AddActionItemTaskParams', 'AddMicrosoftTeamsChatTabTaskParams', + 'AddMicrosoftTeamsTabTaskParamsType0', 'AddMicrosoftTeamsTabTaskParamsType1', 'AddRoleTaskParams', + 'AddSlackBookmarkTaskParamsType0', 'AddSlackBookmarkTaskParamsType1', 'AddTeamTaskParams', + 'AddToTimelineTaskParams', 'ArchiveGoogleChatSpacesTaskParams', 'ArchiveMicrosoftTeamsChannelsTaskParams', + 'ArchiveSlackChannelsTaskParams', 'AttachDatadogDashboardsTaskParams', + 'AttachRetrospectivePdfToFreshserviceTicketTaskParams', 'AttachRetrospectivePdfToJiraIssueTaskParams', + 'AutoAssignRoleOpsgenieTaskParams', 'AutoAssignRolePagerdutyTaskParamsType0', + 'AutoAssignRolePagerdutyTaskParamsType1', 'AutoAssignRoleRootlyTaskParamsType0', + 'AutoAssignRoleRootlyTaskParamsType1', 'AutoAssignRoleRootlyTaskParamsType2', + 'AutoAssignRoleRootlyTaskParamsType3', 'AutoAssignRoleRootlyTaskParamsType4', + 'AutoAssignRoleVictorOpsTaskParams', 'CallPeopleTaskParams', 'ChangeGoogleChatSpacePrivacyTaskParams', + 'ChangeSlackChannelPrivacyTaskParams', 'CreateAirtableTableRecordTaskParams', + 'CreateAnthropicChatCompletionTaskParams', 'CreateAsanaSubtaskTaskParams', 'CreateAsanaTaskTaskParams', + 'CreateClickupTaskTaskParams', 'CreateCodaPageTaskParams', 'CreateConfluencePageTaskParams', + 'CreateDatadogNotebookTaskParams', 'CreateDropboxPaperPageTaskParams', 'CreateGithubIssueTaskParams', + 'CreateGitlabIssueTaskParams', 'CreateGoToMeetingTaskParams', 'CreateGoogleCalendarEventTaskParams', + 'CreateGoogleChatSpaceTaskParams', 'CreateGoogleDocsPageTaskParams', 'CreateGoogleDocsPermissionsTaskParams', + 'CreateGoogleGeminiChatCompletionTaskParams', 'CreateGoogleMeetingTaskParams', + 'CreateIncidentPostmortemTaskParams', 'CreateIncidentTaskParams', 'CreateJiraIssueTaskParams', + 'CreateJiraSubtaskTaskParams', 'CreateJsmopsAlertTaskParams', 'CreateLinearIssueCommentTaskParams', + 'CreateLinearIssueTaskParams', 'CreateLinearSubtaskIssueTaskParams', 'CreateMicrosoftTeamsChannelTaskParams', + 'CreateMicrosoftTeamsChatTaskParams', 'CreateMicrosoftTeamsMeetingTaskParams', + 'CreateMistralChatCompletionTaskParams', 'CreateMotionTaskTaskParams', 'CreateNotionPageTaskParams', + 'CreateOpenaiChatCompletionTaskParams', 'CreateOpsgenieAlertTaskParams', 'CreateOutlookEventTaskParams', + 'CreatePagerdutyStatusUpdateTaskParams', 'CreatePagertreeAlertTaskParams', 'CreateQuipPageTaskParams', + 'CreateServiceNowIncidentTaskParams', 'CreateSharepointPageTaskParams', 'CreateShortcutStoryTaskParamsType0', + 'CreateShortcutStoryTaskParamsType1', 'CreateShortcutTaskTaskParams', 'CreateSlackChannelTaskParams', + 'CreateSubIncidentTaskParams', 'CreateTrelloCardTaskParams', 'CreateWatsonxChatCompletionTaskParams', + 'CreateWebexMeetingTaskParams', 'CreateZendeskJiraLinkTaskParams', 'CreateZendeskTicketTaskParams', + 'CreateZoomMeetingTaskParams', 'GetAlertsTaskParams', 'GetGithubCommitsTaskParamsType0', + 'GetGithubCommitsTaskParamsType1', 'GetGitlabCommitsTaskParamsType0', 'GetGitlabCommitsTaskParamsType1', + 'GetPulsesTaskParams', 'HttpClientTaskParams', 'InviteToGoogleChatSpaceTaskParams', + 'InviteToMicrosoftTeamsChannelRootlyTaskParams', 'InviteToMicrosoftTeamsChannelTaskParams', + 'InviteToSlackChannelOpsgenieTaskParams', 'InviteToSlackChannelPagerdutyTaskParamsType0', + 'InviteToSlackChannelPagerdutyTaskParamsType1', 'InviteToSlackChannelRootlyTaskParams', + 'InviteToSlackChannelTaskParamsType0', 'InviteToSlackChannelTaskParamsType1', + 'InviteToSlackChannelTaskParamsType2', 'InviteToSlackChannelVictorOpsTaskParams', + 'PageJsmopsOnCallRespondersTaskParams', 'PageOpsgenieOnCallRespondersTaskParams', + 'PagePagerdutyOnCallRespondersTaskParams', 'PageRootlyOnCallRespondersTaskParams', + 'PageVictorOpsOnCallRespondersTaskParamsType0', 'PageVictorOpsOnCallRespondersTaskParamsType1', + 'PrintTaskParams', 'PublishIncidentTaskParams', 'RedisClientTaskParams', + 'RemoveGoogleDocsPermissionsTaskParams', 'RenameGoogleChatSpaceTaskParams', + 'RenameMicrosoftTeamsChannelTaskParams', 'RenameSlackChannelTaskParams', 'RunCommandHerokuTaskParams', + 'SendDashboardReportTaskParams', 'SendEmailTaskParams', 'SendGoogleChatAttachmentsTaskParams', + 'SendGoogleChatMessageTaskParams', 'SendMicrosoftTeamsBlocksTaskParamsType0', + 'SendMicrosoftTeamsChatMessageTaskParams', 'SendMicrosoftTeamsMessageTaskParamsType0', + 'SendSlackBlocksTaskParamsType0', 'SendSlackBlocksTaskParamsType1', 'SendSlackBlocksTaskParamsType2', + 'SendSlackMessageTaskParamsType0', 'SendSlackMessageTaskParamsType1', 'SendSlackMessageTaskParamsType2', + 'SendSmsTaskParams', 'SendWhatsappMessageTaskParams', 'SnapshotDatadogGraphTaskParams', + 'SnapshotGrafanaDashboardTaskParams', 'SnapshotLookerLookTaskParams', 'SnapshotNewRelicGraphTaskParams', + 'TriggerWorkflowTaskParams', 'TweetTwitterMessageTaskParams', 'UpdateActionItemTaskParams', + 'UpdateAirtableTableRecordTaskParams', 'UpdateAsanaTaskTaskParams', 'UpdateAttachedAlertsTaskParams', + 'UpdateClickupTaskTaskParams', 'UpdateCodaPageTaskParams', 'UpdateConfluencePageTaskParams', + 'UpdateDatadogNotebookTaskParams', 'UpdateDropboxPaperPageTaskParams', 'UpdateGithubIssueTaskParams', + 'UpdateGitlabIssueTaskParams', 'UpdateGoogleCalendarEventTaskParams', + 'UpdateGoogleChatSpaceDescriptionTaskParams', 'UpdateGoogleDocsPageTaskParams', + 'UpdateIncidentPostmortemTaskParams', 'UpdateIncidentStatusTimestampTaskParams', 'UpdateIncidentTaskParams', + 'UpdateJiraIssueTaskParams', 'UpdateLinearIssueTaskParams', 'UpdateMotionTaskTaskParams', + 'UpdateNotionPageTaskParams', 'UpdateOpsgenieAlertTaskParams', 'UpdateOpsgenieIncidentTaskParams', + 'UpdatePagerdutyIncidentTaskParams', 'UpdatePagertreeAlertTaskParams', 'UpdateQuipPageTaskParams', + 'UpdateServiceNowIncidentTaskParams', 'UpdateSharepointPageTaskParams', 'UpdateShortcutStoryTaskParams', + 'UpdateShortcutTaskTaskParams', 'UpdateSlackChannelTopicTaskParams', 'UpdateStatusTaskParams', + 'UpdateTrelloCardTaskParams', 'UpdateVictorOpsIncidentTaskParams', 'UpdateZendeskTicketTaskParams', Unset]): """ - name: str | Unset = UNSET - position: int | Unset = UNSET - skip_on_failure: bool | Unset = UNSET - enabled: bool | Unset = True - task_params: ( - AddActionItemTaskParams - | AddMicrosoftTeamsChatTabTaskParams - | AddMicrosoftTeamsTabTaskParamsType0 - | AddMicrosoftTeamsTabTaskParamsType1 - | AddRoleTaskParams - | AddSlackBookmarkTaskParamsType0 - | AddSlackBookmarkTaskParamsType1 - | AddTeamTaskParams - | AddToTimelineTaskParams - | ArchiveGoogleChatSpacesTaskParams - | ArchiveMicrosoftTeamsChannelsTaskParams - | ArchiveSlackChannelsTaskParams - | AttachDatadogDashboardsTaskParams - | AttachRetrospectivePdfToJiraIssueTaskParams - | AutoAssignRoleOpsgenieTaskParams - | AutoAssignRolePagerdutyTaskParamsType0 - | AutoAssignRolePagerdutyTaskParamsType1 - | AutoAssignRoleRootlyTaskParams - | AutoAssignRoleVictorOpsTaskParams - | CallPeopleTaskParams - | ChangeGoogleChatSpacePrivacyTaskParams - | ChangeSlackChannelPrivacyTaskParams - | CreateAirtableTableRecordTaskParams - | CreateAnthropicChatCompletionTaskParams - | CreateAsanaSubtaskTaskParams - | CreateAsanaTaskTaskParams - | CreateClickupTaskTaskParams - | CreateCodaPageTaskParams - | CreateConfluencePageTaskParams - | CreateDatadogNotebookTaskParams - | CreateDropboxPaperPageTaskParams - | CreateGithubIssueTaskParams - | CreateGitlabIssueTaskParams - | CreateGoogleCalendarEventTaskParams - | CreateGoogleChatSpaceTaskParams - | CreateGoogleDocsPageTaskParams - | CreateGoogleDocsPermissionsTaskParams - | CreateGoogleGeminiChatCompletionTaskParams - | CreateGoogleMeetingTaskParams - | CreateGoToMeetingTaskParams - | CreateIncidentPostmortemTaskParams - | CreateIncidentTaskParams - | CreateJiraIssueTaskParams - | CreateJiraSubtaskTaskParams - | CreateJsmopsAlertTaskParams - | CreateLinearIssueCommentTaskParams - | CreateLinearIssueTaskParams - | CreateLinearSubtaskIssueTaskParams - | CreateMicrosoftTeamsChannelTaskParams - | CreateMicrosoftTeamsChatTaskParams - | CreateMicrosoftTeamsMeetingTaskParams - | CreateMistralChatCompletionTaskParams - | CreateMotionTaskTaskParams - | CreateNotionPageTaskParams - | CreateOpenaiChatCompletionTaskParams - | CreateOpsgenieAlertTaskParams - | CreateOutlookEventTaskParams - | CreatePagerdutyStatusUpdateTaskParams - | CreatePagertreeAlertTaskParams - | CreateQuipPageTaskParams - | CreateServiceNowIncidentTaskParams - | CreateSharepointPageTaskParams - | CreateShortcutStoryTaskParamsType0 - | CreateShortcutStoryTaskParamsType1 - | CreateShortcutTaskTaskParams - | CreateSlackChannelTaskParams - | CreateSubIncidentTaskParams - | CreateTrelloCardTaskParams - | CreateWatsonxChatCompletionTaskParams - | CreateWebexMeetingTaskParams - | CreateZendeskJiraLinkTaskParams - | CreateZendeskTicketTaskParams - | CreateZoomMeetingTaskParams - | GetAlertsTaskParams - | GetGithubCommitsTaskParamsType0 - | GetGithubCommitsTaskParamsType1 - | GetGitlabCommitsTaskParamsType0 - | GetGitlabCommitsTaskParamsType1 - | GetPulsesTaskParams - | HttpClientTaskParams - | InviteToGoogleChatSpaceTaskParams - | InviteToMicrosoftTeamsChannelRootlyTaskParams - | InviteToMicrosoftTeamsChannelTaskParams - | InviteToSlackChannelOpsgenieTaskParams - | InviteToSlackChannelPagerdutyTaskParamsType0 - | InviteToSlackChannelPagerdutyTaskParamsType1 - | InviteToSlackChannelRootlyTaskParams - | InviteToSlackChannelTaskParamsType0 - | InviteToSlackChannelTaskParamsType1 - | InviteToSlackChannelTaskParamsType2 - | InviteToSlackChannelVictorOpsTaskParams - | PageJsmopsOnCallRespondersTaskParams - | PageOpsgenieOnCallRespondersTaskParams - | PagePagerdutyOnCallRespondersTaskParams - | PageRootlyOnCallRespondersTaskParams - | PageVictorOpsOnCallRespondersTaskParamsType0 - | PageVictorOpsOnCallRespondersTaskParamsType1 - | PrintTaskParams - | PublishIncidentTaskParams - | RedisClientTaskParams - | RemoveGoogleDocsPermissionsTaskParams - | RenameGoogleChatSpaceTaskParams - | RenameMicrosoftTeamsChannelTaskParams - | RenameSlackChannelTaskParams - | RunCommandHerokuTaskParams - | SendDashboardReportTaskParams - | SendEmailTaskParams - | SendGoogleChatAttachmentsTaskParams - | SendGoogleChatMessageTaskParams - | SendMicrosoftTeamsBlocksTaskParamsType0 - | SendMicrosoftTeamsChatMessageTaskParams - | SendMicrosoftTeamsMessageTaskParamsType0 - | SendSlackBlocksTaskParamsType0 - | SendSlackBlocksTaskParamsType1 - | SendSlackBlocksTaskParamsType2 - | SendSlackMessageTaskParamsType0 - | SendSlackMessageTaskParamsType1 - | SendSlackMessageTaskParamsType2 - | SendSmsTaskParams - | SendWhatsappMessageTaskParams - | SnapshotDatadogGraphTaskParams - | SnapshotGrafanaDashboardTaskParams - | SnapshotLookerLookTaskParams - | SnapshotNewRelicGraphTaskParams - | TriggerWorkflowTaskParams - | TweetTwitterMessageTaskParams - | Unset - | UpdateActionItemTaskParams - | UpdateAirtableTableRecordTaskParams - | UpdateAsanaTaskTaskParams - | UpdateAttachedAlertsTaskParams - | UpdateClickupTaskTaskParams - | UpdateCodaPageTaskParams - | UpdateConfluencePageTaskParams - | UpdateDatadogNotebookTaskParams - | UpdateDropboxPaperPageTaskParams - | UpdateGithubIssueTaskParams - | UpdateGitlabIssueTaskParams - | UpdateGoogleCalendarEventTaskParams - | UpdateGoogleChatSpaceDescriptionTaskParams - | UpdateGoogleDocsPageTaskParams - | UpdateIncidentPostmortemTaskParams - | UpdateIncidentStatusTimestampTaskParams - | UpdateIncidentTaskParams - | UpdateJiraIssueTaskParams - | UpdateLinearIssueTaskParams - | UpdateMotionTaskTaskParams - | UpdateNotionPageTaskParams - | UpdateOpsgenieAlertTaskParams - | UpdateOpsgenieIncidentTaskParams - | UpdatePagerdutyIncidentTaskParams - | UpdatePagertreeAlertTaskParams - | UpdateQuipPageTaskParams - | UpdateServiceNowIncidentTaskParams - | UpdateSharepointPageTaskParams - | UpdateShortcutStoryTaskParams - | UpdateShortcutTaskTaskParams - | UpdateSlackChannelTopicTaskParams - | UpdateStatusTaskParams - | UpdateTrelloCardTaskParams - | UpdateVictorOpsIncidentTaskParams - | UpdateZendeskTicketTaskParams - ) = UNSET + name: Union[Unset, str] = UNSET + position: Union[Unset, int] = UNSET + skip_on_failure: Union[Unset, bool] = UNSET + enabled: Union[Unset, bool] = True + task_params: Union[ + "AddActionItemTaskParams", + "AddMicrosoftTeamsChatTabTaskParams", + "AddMicrosoftTeamsTabTaskParamsType0", + "AddMicrosoftTeamsTabTaskParamsType1", + "AddRoleTaskParams", + "AddSlackBookmarkTaskParamsType0", + "AddSlackBookmarkTaskParamsType1", + "AddTeamTaskParams", + "AddToTimelineTaskParams", + "ArchiveGoogleChatSpacesTaskParams", + "ArchiveMicrosoftTeamsChannelsTaskParams", + "ArchiveSlackChannelsTaskParams", + "AttachDatadogDashboardsTaskParams", + "AttachRetrospectivePdfToFreshserviceTicketTaskParams", + "AttachRetrospectivePdfToJiraIssueTaskParams", + "AutoAssignRoleOpsgenieTaskParams", + "AutoAssignRolePagerdutyTaskParamsType0", + "AutoAssignRolePagerdutyTaskParamsType1", + "AutoAssignRoleRootlyTaskParamsType0", + "AutoAssignRoleRootlyTaskParamsType1", + "AutoAssignRoleRootlyTaskParamsType2", + "AutoAssignRoleRootlyTaskParamsType3", + "AutoAssignRoleRootlyTaskParamsType4", + "AutoAssignRoleVictorOpsTaskParams", + "CallPeopleTaskParams", + "ChangeGoogleChatSpacePrivacyTaskParams", + "ChangeSlackChannelPrivacyTaskParams", + "CreateAirtableTableRecordTaskParams", + "CreateAnthropicChatCompletionTaskParams", + "CreateAsanaSubtaskTaskParams", + "CreateAsanaTaskTaskParams", + "CreateClickupTaskTaskParams", + "CreateCodaPageTaskParams", + "CreateConfluencePageTaskParams", + "CreateDatadogNotebookTaskParams", + "CreateDropboxPaperPageTaskParams", + "CreateGithubIssueTaskParams", + "CreateGitlabIssueTaskParams", + "CreateGoToMeetingTaskParams", + "CreateGoogleCalendarEventTaskParams", + "CreateGoogleChatSpaceTaskParams", + "CreateGoogleDocsPageTaskParams", + "CreateGoogleDocsPermissionsTaskParams", + "CreateGoogleGeminiChatCompletionTaskParams", + "CreateGoogleMeetingTaskParams", + "CreateIncidentPostmortemTaskParams", + "CreateIncidentTaskParams", + "CreateJiraIssueTaskParams", + "CreateJiraSubtaskTaskParams", + "CreateJsmopsAlertTaskParams", + "CreateLinearIssueCommentTaskParams", + "CreateLinearIssueTaskParams", + "CreateLinearSubtaskIssueTaskParams", + "CreateMicrosoftTeamsChannelTaskParams", + "CreateMicrosoftTeamsChatTaskParams", + "CreateMicrosoftTeamsMeetingTaskParams", + "CreateMistralChatCompletionTaskParams", + "CreateMotionTaskTaskParams", + "CreateNotionPageTaskParams", + "CreateOpenaiChatCompletionTaskParams", + "CreateOpsgenieAlertTaskParams", + "CreateOutlookEventTaskParams", + "CreatePagerdutyStatusUpdateTaskParams", + "CreatePagertreeAlertTaskParams", + "CreateQuipPageTaskParams", + "CreateServiceNowIncidentTaskParams", + "CreateSharepointPageTaskParams", + "CreateShortcutStoryTaskParamsType0", + "CreateShortcutStoryTaskParamsType1", + "CreateShortcutTaskTaskParams", + "CreateSlackChannelTaskParams", + "CreateSubIncidentTaskParams", + "CreateTrelloCardTaskParams", + "CreateWatsonxChatCompletionTaskParams", + "CreateWebexMeetingTaskParams", + "CreateZendeskJiraLinkTaskParams", + "CreateZendeskTicketTaskParams", + "CreateZoomMeetingTaskParams", + "GetAlertsTaskParams", + "GetGithubCommitsTaskParamsType0", + "GetGithubCommitsTaskParamsType1", + "GetGitlabCommitsTaskParamsType0", + "GetGitlabCommitsTaskParamsType1", + "GetPulsesTaskParams", + "HttpClientTaskParams", + "InviteToGoogleChatSpaceTaskParams", + "InviteToMicrosoftTeamsChannelRootlyTaskParams", + "InviteToMicrosoftTeamsChannelTaskParams", + "InviteToSlackChannelOpsgenieTaskParams", + "InviteToSlackChannelPagerdutyTaskParamsType0", + "InviteToSlackChannelPagerdutyTaskParamsType1", + "InviteToSlackChannelRootlyTaskParams", + "InviteToSlackChannelTaskParamsType0", + "InviteToSlackChannelTaskParamsType1", + "InviteToSlackChannelTaskParamsType2", + "InviteToSlackChannelVictorOpsTaskParams", + "PageJsmopsOnCallRespondersTaskParams", + "PageOpsgenieOnCallRespondersTaskParams", + "PagePagerdutyOnCallRespondersTaskParams", + "PageRootlyOnCallRespondersTaskParams", + "PageVictorOpsOnCallRespondersTaskParamsType0", + "PageVictorOpsOnCallRespondersTaskParamsType1", + "PrintTaskParams", + "PublishIncidentTaskParams", + "RedisClientTaskParams", + "RemoveGoogleDocsPermissionsTaskParams", + "RenameGoogleChatSpaceTaskParams", + "RenameMicrosoftTeamsChannelTaskParams", + "RenameSlackChannelTaskParams", + "RunCommandHerokuTaskParams", + "SendDashboardReportTaskParams", + "SendEmailTaskParams", + "SendGoogleChatAttachmentsTaskParams", + "SendGoogleChatMessageTaskParams", + "SendMicrosoftTeamsBlocksTaskParamsType0", + "SendMicrosoftTeamsChatMessageTaskParams", + "SendMicrosoftTeamsMessageTaskParamsType0", + "SendSlackBlocksTaskParamsType0", + "SendSlackBlocksTaskParamsType1", + "SendSlackBlocksTaskParamsType2", + "SendSlackMessageTaskParamsType0", + "SendSlackMessageTaskParamsType1", + "SendSlackMessageTaskParamsType2", + "SendSmsTaskParams", + "SendWhatsappMessageTaskParams", + "SnapshotDatadogGraphTaskParams", + "SnapshotGrafanaDashboardTaskParams", + "SnapshotLookerLookTaskParams", + "SnapshotNewRelicGraphTaskParams", + "TriggerWorkflowTaskParams", + "TweetTwitterMessageTaskParams", + "UpdateActionItemTaskParams", + "UpdateAirtableTableRecordTaskParams", + "UpdateAsanaTaskTaskParams", + "UpdateAttachedAlertsTaskParams", + "UpdateClickupTaskTaskParams", + "UpdateCodaPageTaskParams", + "UpdateConfluencePageTaskParams", + "UpdateDatadogNotebookTaskParams", + "UpdateDropboxPaperPageTaskParams", + "UpdateGithubIssueTaskParams", + "UpdateGitlabIssueTaskParams", + "UpdateGoogleCalendarEventTaskParams", + "UpdateGoogleChatSpaceDescriptionTaskParams", + "UpdateGoogleDocsPageTaskParams", + "UpdateIncidentPostmortemTaskParams", + "UpdateIncidentStatusTimestampTaskParams", + "UpdateIncidentTaskParams", + "UpdateJiraIssueTaskParams", + "UpdateLinearIssueTaskParams", + "UpdateMotionTaskTaskParams", + "UpdateNotionPageTaskParams", + "UpdateOpsgenieAlertTaskParams", + "UpdateOpsgenieIncidentTaskParams", + "UpdatePagerdutyIncidentTaskParams", + "UpdatePagertreeAlertTaskParams", + "UpdateQuipPageTaskParams", + "UpdateServiceNowIncidentTaskParams", + "UpdateSharepointPageTaskParams", + "UpdateShortcutStoryTaskParams", + "UpdateShortcutTaskTaskParams", + "UpdateSlackChannelTopicTaskParams", + "UpdateStatusTaskParams", + "UpdateTrelloCardTaskParams", + "UpdateVictorOpsIncidentTaskParams", + "UpdateZendeskTicketTaskParams", + Unset, + ] = UNSET def to_dict(self) -> dict[str, Any]: from ..models.add_action_item_task_params import AddActionItemTaskParams @@ -434,13 +450,20 @@ def to_dict(self) -> dict[str, Any]: from ..models.archive_microsoft_teams_channels_task_params import ArchiveMicrosoftTeamsChannelsTaskParams from ..models.archive_slack_channels_task_params import ArchiveSlackChannelsTaskParams from ..models.attach_datadog_dashboards_task_params import AttachDatadogDashboardsTaskParams + from ..models.attach_retrospective_pdf_to_freshservice_ticket_task_params import ( + AttachRetrospectivePdfToFreshserviceTicketTaskParams, + ) from ..models.attach_retrospective_pdf_to_jira_issue_task_params import ( AttachRetrospectivePdfToJiraIssueTaskParams, ) from ..models.auto_assign_role_opsgenie_task_params import AutoAssignRoleOpsgenieTaskParams from ..models.auto_assign_role_pagerduty_task_params_type_0 import AutoAssignRolePagerdutyTaskParamsType0 from ..models.auto_assign_role_pagerduty_task_params_type_1 import AutoAssignRolePagerdutyTaskParamsType1 - from ..models.auto_assign_role_rootly_task_params import AutoAssignRoleRootlyTaskParams + from ..models.auto_assign_role_rootly_task_params_type_0 import AutoAssignRoleRootlyTaskParamsType0 + from ..models.auto_assign_role_rootly_task_params_type_1 import AutoAssignRoleRootlyTaskParamsType1 + from ..models.auto_assign_role_rootly_task_params_type_2 import AutoAssignRoleRootlyTaskParamsType2 + from ..models.auto_assign_role_rootly_task_params_type_3 import AutoAssignRoleRootlyTaskParamsType3 + from ..models.auto_assign_role_rootly_task_params_type_4 import AutoAssignRoleRootlyTaskParamsType4 from ..models.auto_assign_role_victor_ops_task_params import AutoAssignRoleVictorOpsTaskParams from ..models.call_people_task_params import CallPeopleTaskParams from ..models.change_google_chat_space_privacy_task_params import ChangeGoogleChatSpacePrivacyTaskParams @@ -602,7 +625,7 @@ def to_dict(self) -> dict[str, Any]: enabled = self.enabled - task_params: dict[str, Any] | Unset + task_params: Union[Unset, dict[str, Any]] if isinstance(self.task_params, Unset): task_params = UNSET elif isinstance(self.task_params, AddActionItemTaskParams): @@ -625,7 +648,15 @@ def to_dict(self) -> dict[str, Any]: task_params = self.task_params.to_dict() elif isinstance(self.task_params, AutoAssignRoleOpsgenieTaskParams): task_params = self.task_params.to_dict() - elif isinstance(self.task_params, AutoAssignRoleRootlyTaskParams): + elif isinstance(self.task_params, AutoAssignRoleRootlyTaskParamsType0): + task_params = self.task_params.to_dict() + elif isinstance(self.task_params, AutoAssignRoleRootlyTaskParamsType1): + task_params = self.task_params.to_dict() + elif isinstance(self.task_params, AutoAssignRoleRootlyTaskParamsType2): + task_params = self.task_params.to_dict() + elif isinstance(self.task_params, AutoAssignRoleRootlyTaskParamsType3): + task_params = self.task_params.to_dict() + elif isinstance(self.task_params, AutoAssignRoleRootlyTaskParamsType4): task_params = self.task_params.to_dict() elif isinstance(self.task_params, AutoAssignRolePagerdutyTaskParamsType0): task_params = self.task_params.to_dict() @@ -697,6 +728,8 @@ def to_dict(self) -> dict[str, Any]: task_params = self.task_params.to_dict() elif isinstance(self.task_params, AttachRetrospectivePdfToJiraIssueTaskParams): task_params = self.task_params.to_dict() + elif isinstance(self.task_params, AttachRetrospectivePdfToFreshserviceTicketTaskParams): + task_params = self.task_params.to_dict() elif isinstance(self.task_params, CreateLinearIssueTaskParams): task_params = self.task_params.to_dict() elif isinstance(self.task_params, CreateLinearSubtaskIssueTaskParams): @@ -959,13 +992,20 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: from ..models.archive_microsoft_teams_channels_task_params import ArchiveMicrosoftTeamsChannelsTaskParams from ..models.archive_slack_channels_task_params import ArchiveSlackChannelsTaskParams from ..models.attach_datadog_dashboards_task_params import AttachDatadogDashboardsTaskParams + from ..models.attach_retrospective_pdf_to_freshservice_ticket_task_params import ( + AttachRetrospectivePdfToFreshserviceTicketTaskParams, + ) from ..models.attach_retrospective_pdf_to_jira_issue_task_params import ( AttachRetrospectivePdfToJiraIssueTaskParams, ) from ..models.auto_assign_role_opsgenie_task_params import AutoAssignRoleOpsgenieTaskParams from ..models.auto_assign_role_pagerduty_task_params_type_0 import AutoAssignRolePagerdutyTaskParamsType0 from ..models.auto_assign_role_pagerduty_task_params_type_1 import AutoAssignRolePagerdutyTaskParamsType1 - from ..models.auto_assign_role_rootly_task_params import AutoAssignRoleRootlyTaskParams + from ..models.auto_assign_role_rootly_task_params_type_0 import AutoAssignRoleRootlyTaskParamsType0 + from ..models.auto_assign_role_rootly_task_params_type_1 import AutoAssignRoleRootlyTaskParamsType1 + from ..models.auto_assign_role_rootly_task_params_type_2 import AutoAssignRoleRootlyTaskParamsType2 + from ..models.auto_assign_role_rootly_task_params_type_3 import AutoAssignRoleRootlyTaskParamsType3 + from ..models.auto_assign_role_rootly_task_params_type_4 import AutoAssignRoleRootlyTaskParamsType4 from ..models.auto_assign_role_victor_ops_task_params import AutoAssignRoleVictorOpsTaskParams from ..models.call_people_task_params import CallPeopleTaskParams from ..models.change_google_chat_space_privacy_task_params import ChangeGoogleChatSpacePrivacyTaskParams @@ -1131,170 +1171,175 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: def _parse_task_params( data: object, - ) -> ( - AddActionItemTaskParams - | AddMicrosoftTeamsChatTabTaskParams - | AddMicrosoftTeamsTabTaskParamsType0 - | AddMicrosoftTeamsTabTaskParamsType1 - | AddRoleTaskParams - | AddSlackBookmarkTaskParamsType0 - | AddSlackBookmarkTaskParamsType1 - | AddTeamTaskParams - | AddToTimelineTaskParams - | ArchiveGoogleChatSpacesTaskParams - | ArchiveMicrosoftTeamsChannelsTaskParams - | ArchiveSlackChannelsTaskParams - | AttachDatadogDashboardsTaskParams - | AttachRetrospectivePdfToJiraIssueTaskParams - | AutoAssignRoleOpsgenieTaskParams - | AutoAssignRolePagerdutyTaskParamsType0 - | AutoAssignRolePagerdutyTaskParamsType1 - | AutoAssignRoleRootlyTaskParams - | AutoAssignRoleVictorOpsTaskParams - | CallPeopleTaskParams - | ChangeGoogleChatSpacePrivacyTaskParams - | ChangeSlackChannelPrivacyTaskParams - | CreateAirtableTableRecordTaskParams - | CreateAnthropicChatCompletionTaskParams - | CreateAsanaSubtaskTaskParams - | CreateAsanaTaskTaskParams - | CreateClickupTaskTaskParams - | CreateCodaPageTaskParams - | CreateConfluencePageTaskParams - | CreateDatadogNotebookTaskParams - | CreateDropboxPaperPageTaskParams - | CreateGithubIssueTaskParams - | CreateGitlabIssueTaskParams - | CreateGoogleCalendarEventTaskParams - | CreateGoogleChatSpaceTaskParams - | CreateGoogleDocsPageTaskParams - | CreateGoogleDocsPermissionsTaskParams - | CreateGoogleGeminiChatCompletionTaskParams - | CreateGoogleMeetingTaskParams - | CreateGoToMeetingTaskParams - | CreateIncidentPostmortemTaskParams - | CreateIncidentTaskParams - | CreateJiraIssueTaskParams - | CreateJiraSubtaskTaskParams - | CreateJsmopsAlertTaskParams - | CreateLinearIssueCommentTaskParams - | CreateLinearIssueTaskParams - | CreateLinearSubtaskIssueTaskParams - | CreateMicrosoftTeamsChannelTaskParams - | CreateMicrosoftTeamsChatTaskParams - | CreateMicrosoftTeamsMeetingTaskParams - | CreateMistralChatCompletionTaskParams - | CreateMotionTaskTaskParams - | CreateNotionPageTaskParams - | CreateOpenaiChatCompletionTaskParams - | CreateOpsgenieAlertTaskParams - | CreateOutlookEventTaskParams - | CreatePagerdutyStatusUpdateTaskParams - | CreatePagertreeAlertTaskParams - | CreateQuipPageTaskParams - | CreateServiceNowIncidentTaskParams - | CreateSharepointPageTaskParams - | CreateShortcutStoryTaskParamsType0 - | CreateShortcutStoryTaskParamsType1 - | CreateShortcutTaskTaskParams - | CreateSlackChannelTaskParams - | CreateSubIncidentTaskParams - | CreateTrelloCardTaskParams - | CreateWatsonxChatCompletionTaskParams - | CreateWebexMeetingTaskParams - | CreateZendeskJiraLinkTaskParams - | CreateZendeskTicketTaskParams - | CreateZoomMeetingTaskParams - | GetAlertsTaskParams - | GetGithubCommitsTaskParamsType0 - | GetGithubCommitsTaskParamsType1 - | GetGitlabCommitsTaskParamsType0 - | GetGitlabCommitsTaskParamsType1 - | GetPulsesTaskParams - | HttpClientTaskParams - | InviteToGoogleChatSpaceTaskParams - | InviteToMicrosoftTeamsChannelRootlyTaskParams - | InviteToMicrosoftTeamsChannelTaskParams - | InviteToSlackChannelOpsgenieTaskParams - | InviteToSlackChannelPagerdutyTaskParamsType0 - | InviteToSlackChannelPagerdutyTaskParamsType1 - | InviteToSlackChannelRootlyTaskParams - | InviteToSlackChannelTaskParamsType0 - | InviteToSlackChannelTaskParamsType1 - | InviteToSlackChannelTaskParamsType2 - | InviteToSlackChannelVictorOpsTaskParams - | PageJsmopsOnCallRespondersTaskParams - | PageOpsgenieOnCallRespondersTaskParams - | PagePagerdutyOnCallRespondersTaskParams - | PageRootlyOnCallRespondersTaskParams - | PageVictorOpsOnCallRespondersTaskParamsType0 - | PageVictorOpsOnCallRespondersTaskParamsType1 - | PrintTaskParams - | PublishIncidentTaskParams - | RedisClientTaskParams - | RemoveGoogleDocsPermissionsTaskParams - | RenameGoogleChatSpaceTaskParams - | RenameMicrosoftTeamsChannelTaskParams - | RenameSlackChannelTaskParams - | RunCommandHerokuTaskParams - | SendDashboardReportTaskParams - | SendEmailTaskParams - | SendGoogleChatAttachmentsTaskParams - | SendGoogleChatMessageTaskParams - | SendMicrosoftTeamsBlocksTaskParamsType0 - | SendMicrosoftTeamsChatMessageTaskParams - | SendMicrosoftTeamsMessageTaskParamsType0 - | SendSlackBlocksTaskParamsType0 - | SendSlackBlocksTaskParamsType1 - | SendSlackBlocksTaskParamsType2 - | SendSlackMessageTaskParamsType0 - | SendSlackMessageTaskParamsType1 - | SendSlackMessageTaskParamsType2 - | SendSmsTaskParams - | SendWhatsappMessageTaskParams - | SnapshotDatadogGraphTaskParams - | SnapshotGrafanaDashboardTaskParams - | SnapshotLookerLookTaskParams - | SnapshotNewRelicGraphTaskParams - | TriggerWorkflowTaskParams - | TweetTwitterMessageTaskParams - | Unset - | UpdateActionItemTaskParams - | UpdateAirtableTableRecordTaskParams - | UpdateAsanaTaskTaskParams - | UpdateAttachedAlertsTaskParams - | UpdateClickupTaskTaskParams - | UpdateCodaPageTaskParams - | UpdateConfluencePageTaskParams - | UpdateDatadogNotebookTaskParams - | UpdateDropboxPaperPageTaskParams - | UpdateGithubIssueTaskParams - | UpdateGitlabIssueTaskParams - | UpdateGoogleCalendarEventTaskParams - | UpdateGoogleChatSpaceDescriptionTaskParams - | UpdateGoogleDocsPageTaskParams - | UpdateIncidentPostmortemTaskParams - | UpdateIncidentStatusTimestampTaskParams - | UpdateIncidentTaskParams - | UpdateJiraIssueTaskParams - | UpdateLinearIssueTaskParams - | UpdateMotionTaskTaskParams - | UpdateNotionPageTaskParams - | UpdateOpsgenieAlertTaskParams - | UpdateOpsgenieIncidentTaskParams - | UpdatePagerdutyIncidentTaskParams - | UpdatePagertreeAlertTaskParams - | UpdateQuipPageTaskParams - | UpdateServiceNowIncidentTaskParams - | UpdateSharepointPageTaskParams - | UpdateShortcutStoryTaskParams - | UpdateShortcutTaskTaskParams - | UpdateSlackChannelTopicTaskParams - | UpdateStatusTaskParams - | UpdateTrelloCardTaskParams - | UpdateVictorOpsIncidentTaskParams - | UpdateZendeskTicketTaskParams - ): + ) -> Union[ + "AddActionItemTaskParams", + "AddMicrosoftTeamsChatTabTaskParams", + "AddMicrosoftTeamsTabTaskParamsType0", + "AddMicrosoftTeamsTabTaskParamsType1", + "AddRoleTaskParams", + "AddSlackBookmarkTaskParamsType0", + "AddSlackBookmarkTaskParamsType1", + "AddTeamTaskParams", + "AddToTimelineTaskParams", + "ArchiveGoogleChatSpacesTaskParams", + "ArchiveMicrosoftTeamsChannelsTaskParams", + "ArchiveSlackChannelsTaskParams", + "AttachDatadogDashboardsTaskParams", + "AttachRetrospectivePdfToFreshserviceTicketTaskParams", + "AttachRetrospectivePdfToJiraIssueTaskParams", + "AutoAssignRoleOpsgenieTaskParams", + "AutoAssignRolePagerdutyTaskParamsType0", + "AutoAssignRolePagerdutyTaskParamsType1", + "AutoAssignRoleRootlyTaskParamsType0", + "AutoAssignRoleRootlyTaskParamsType1", + "AutoAssignRoleRootlyTaskParamsType2", + "AutoAssignRoleRootlyTaskParamsType3", + "AutoAssignRoleRootlyTaskParamsType4", + "AutoAssignRoleVictorOpsTaskParams", + "CallPeopleTaskParams", + "ChangeGoogleChatSpacePrivacyTaskParams", + "ChangeSlackChannelPrivacyTaskParams", + "CreateAirtableTableRecordTaskParams", + "CreateAnthropicChatCompletionTaskParams", + "CreateAsanaSubtaskTaskParams", + "CreateAsanaTaskTaskParams", + "CreateClickupTaskTaskParams", + "CreateCodaPageTaskParams", + "CreateConfluencePageTaskParams", + "CreateDatadogNotebookTaskParams", + "CreateDropboxPaperPageTaskParams", + "CreateGithubIssueTaskParams", + "CreateGitlabIssueTaskParams", + "CreateGoToMeetingTaskParams", + "CreateGoogleCalendarEventTaskParams", + "CreateGoogleChatSpaceTaskParams", + "CreateGoogleDocsPageTaskParams", + "CreateGoogleDocsPermissionsTaskParams", + "CreateGoogleGeminiChatCompletionTaskParams", + "CreateGoogleMeetingTaskParams", + "CreateIncidentPostmortemTaskParams", + "CreateIncidentTaskParams", + "CreateJiraIssueTaskParams", + "CreateJiraSubtaskTaskParams", + "CreateJsmopsAlertTaskParams", + "CreateLinearIssueCommentTaskParams", + "CreateLinearIssueTaskParams", + "CreateLinearSubtaskIssueTaskParams", + "CreateMicrosoftTeamsChannelTaskParams", + "CreateMicrosoftTeamsChatTaskParams", + "CreateMicrosoftTeamsMeetingTaskParams", + "CreateMistralChatCompletionTaskParams", + "CreateMotionTaskTaskParams", + "CreateNotionPageTaskParams", + "CreateOpenaiChatCompletionTaskParams", + "CreateOpsgenieAlertTaskParams", + "CreateOutlookEventTaskParams", + "CreatePagerdutyStatusUpdateTaskParams", + "CreatePagertreeAlertTaskParams", + "CreateQuipPageTaskParams", + "CreateServiceNowIncidentTaskParams", + "CreateSharepointPageTaskParams", + "CreateShortcutStoryTaskParamsType0", + "CreateShortcutStoryTaskParamsType1", + "CreateShortcutTaskTaskParams", + "CreateSlackChannelTaskParams", + "CreateSubIncidentTaskParams", + "CreateTrelloCardTaskParams", + "CreateWatsonxChatCompletionTaskParams", + "CreateWebexMeetingTaskParams", + "CreateZendeskJiraLinkTaskParams", + "CreateZendeskTicketTaskParams", + "CreateZoomMeetingTaskParams", + "GetAlertsTaskParams", + "GetGithubCommitsTaskParamsType0", + "GetGithubCommitsTaskParamsType1", + "GetGitlabCommitsTaskParamsType0", + "GetGitlabCommitsTaskParamsType1", + "GetPulsesTaskParams", + "HttpClientTaskParams", + "InviteToGoogleChatSpaceTaskParams", + "InviteToMicrosoftTeamsChannelRootlyTaskParams", + "InviteToMicrosoftTeamsChannelTaskParams", + "InviteToSlackChannelOpsgenieTaskParams", + "InviteToSlackChannelPagerdutyTaskParamsType0", + "InviteToSlackChannelPagerdutyTaskParamsType1", + "InviteToSlackChannelRootlyTaskParams", + "InviteToSlackChannelTaskParamsType0", + "InviteToSlackChannelTaskParamsType1", + "InviteToSlackChannelTaskParamsType2", + "InviteToSlackChannelVictorOpsTaskParams", + "PageJsmopsOnCallRespondersTaskParams", + "PageOpsgenieOnCallRespondersTaskParams", + "PagePagerdutyOnCallRespondersTaskParams", + "PageRootlyOnCallRespondersTaskParams", + "PageVictorOpsOnCallRespondersTaskParamsType0", + "PageVictorOpsOnCallRespondersTaskParamsType1", + "PrintTaskParams", + "PublishIncidentTaskParams", + "RedisClientTaskParams", + "RemoveGoogleDocsPermissionsTaskParams", + "RenameGoogleChatSpaceTaskParams", + "RenameMicrosoftTeamsChannelTaskParams", + "RenameSlackChannelTaskParams", + "RunCommandHerokuTaskParams", + "SendDashboardReportTaskParams", + "SendEmailTaskParams", + "SendGoogleChatAttachmentsTaskParams", + "SendGoogleChatMessageTaskParams", + "SendMicrosoftTeamsBlocksTaskParamsType0", + "SendMicrosoftTeamsChatMessageTaskParams", + "SendMicrosoftTeamsMessageTaskParamsType0", + "SendSlackBlocksTaskParamsType0", + "SendSlackBlocksTaskParamsType1", + "SendSlackBlocksTaskParamsType2", + "SendSlackMessageTaskParamsType0", + "SendSlackMessageTaskParamsType1", + "SendSlackMessageTaskParamsType2", + "SendSmsTaskParams", + "SendWhatsappMessageTaskParams", + "SnapshotDatadogGraphTaskParams", + "SnapshotGrafanaDashboardTaskParams", + "SnapshotLookerLookTaskParams", + "SnapshotNewRelicGraphTaskParams", + "TriggerWorkflowTaskParams", + "TweetTwitterMessageTaskParams", + "UpdateActionItemTaskParams", + "UpdateAirtableTableRecordTaskParams", + "UpdateAsanaTaskTaskParams", + "UpdateAttachedAlertsTaskParams", + "UpdateClickupTaskTaskParams", + "UpdateCodaPageTaskParams", + "UpdateConfluencePageTaskParams", + "UpdateDatadogNotebookTaskParams", + "UpdateDropboxPaperPageTaskParams", + "UpdateGithubIssueTaskParams", + "UpdateGitlabIssueTaskParams", + "UpdateGoogleCalendarEventTaskParams", + "UpdateGoogleChatSpaceDescriptionTaskParams", + "UpdateGoogleDocsPageTaskParams", + "UpdateIncidentPostmortemTaskParams", + "UpdateIncidentStatusTimestampTaskParams", + "UpdateIncidentTaskParams", + "UpdateJiraIssueTaskParams", + "UpdateLinearIssueTaskParams", + "UpdateMotionTaskTaskParams", + "UpdateNotionPageTaskParams", + "UpdateOpsgenieAlertTaskParams", + "UpdateOpsgenieIncidentTaskParams", + "UpdatePagerdutyIncidentTaskParams", + "UpdatePagertreeAlertTaskParams", + "UpdateQuipPageTaskParams", + "UpdateServiceNowIncidentTaskParams", + "UpdateSharepointPageTaskParams", + "UpdateShortcutStoryTaskParams", + "UpdateShortcutTaskTaskParams", + "UpdateSlackChannelTopicTaskParams", + "UpdateStatusTaskParams", + "UpdateTrelloCardTaskParams", + "UpdateVictorOpsIncidentTaskParams", + "UpdateZendeskTicketTaskParams", + Unset, + ]: if isinstance(data, Unset): return data try: @@ -1303,7 +1348,7 @@ def _parse_task_params( task_params_type_0 = AddActionItemTaskParams.from_dict(data) return task_params_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1311,7 +1356,7 @@ def _parse_task_params( task_params_type_1 = UpdateActionItemTaskParams.from_dict(data) return task_params_type_1 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1319,7 +1364,7 @@ def _parse_task_params( task_params_type_2 = AddRoleTaskParams.from_dict(data) return task_params_type_2 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1327,7 +1372,7 @@ def _parse_task_params( componentsschemasadd_slack_bookmark_task_params_type_0 = AddSlackBookmarkTaskParamsType0.from_dict(data) return componentsschemasadd_slack_bookmark_task_params_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1335,7 +1380,7 @@ def _parse_task_params( componentsschemasadd_slack_bookmark_task_params_type_1 = AddSlackBookmarkTaskParamsType1.from_dict(data) return componentsschemasadd_slack_bookmark_task_params_type_1 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1343,7 +1388,7 @@ def _parse_task_params( task_params_type_4 = AddTeamTaskParams.from_dict(data) return task_params_type_4 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1351,7 +1396,7 @@ def _parse_task_params( task_params_type_5 = AddToTimelineTaskParams.from_dict(data) return task_params_type_5 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1359,7 +1404,7 @@ def _parse_task_params( task_params_type_6 = ArchiveSlackChannelsTaskParams.from_dict(data) return task_params_type_6 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1367,7 +1412,7 @@ def _parse_task_params( task_params_type_7 = AttachDatadogDashboardsTaskParams.from_dict(data) return task_params_type_7 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1375,15 +1420,57 @@ def _parse_task_params( task_params_type_8 = AutoAssignRoleOpsgenieTaskParams.from_dict(data) return task_params_type_8 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + componentsschemasauto_assign_role_rootly_task_params_type_0 = ( + AutoAssignRoleRootlyTaskParamsType0.from_dict(data) + ) + + return componentsschemasauto_assign_role_rootly_task_params_type_0 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + componentsschemasauto_assign_role_rootly_task_params_type_1 = ( + AutoAssignRoleRootlyTaskParamsType1.from_dict(data) + ) + + return componentsschemasauto_assign_role_rootly_task_params_type_1 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + componentsschemasauto_assign_role_rootly_task_params_type_2 = ( + AutoAssignRoleRootlyTaskParamsType2.from_dict(data) + ) + + return componentsschemasauto_assign_role_rootly_task_params_type_2 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + componentsschemasauto_assign_role_rootly_task_params_type_3 = ( + AutoAssignRoleRootlyTaskParamsType3.from_dict(data) + ) + + return componentsschemasauto_assign_role_rootly_task_params_type_3 + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_9 = AutoAssignRoleRootlyTaskParams.from_dict(data) + componentsschemasauto_assign_role_rootly_task_params_type_4 = ( + AutoAssignRoleRootlyTaskParamsType4.from_dict(data) + ) - return task_params_type_9 - except (TypeError, ValueError, AttributeError, KeyError): + return componentsschemasauto_assign_role_rootly_task_params_type_4 + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1393,7 +1480,7 @@ def _parse_task_params( ) return componentsschemasauto_assign_role_pagerduty_task_params_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1403,7 +1490,7 @@ def _parse_task_params( ) return componentsschemasauto_assign_role_pagerduty_task_params_type_1 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1411,7 +1498,7 @@ def _parse_task_params( task_params_type_11 = UpdatePagerdutyIncidentTaskParams.from_dict(data) return task_params_type_11 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1419,7 +1506,7 @@ def _parse_task_params( task_params_type_12 = CreatePagerdutyStatusUpdateTaskParams.from_dict(data) return task_params_type_12 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1427,7 +1514,7 @@ def _parse_task_params( task_params_type_13 = CreatePagertreeAlertTaskParams.from_dict(data) return task_params_type_13 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1435,7 +1522,7 @@ def _parse_task_params( task_params_type_14 = UpdatePagertreeAlertTaskParams.from_dict(data) return task_params_type_14 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1443,7 +1530,7 @@ def _parse_task_params( task_params_type_15 = AutoAssignRoleVictorOpsTaskParams.from_dict(data) return task_params_type_15 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1451,7 +1538,7 @@ def _parse_task_params( task_params_type_16 = CallPeopleTaskParams.from_dict(data) return task_params_type_16 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1459,7 +1546,7 @@ def _parse_task_params( task_params_type_17 = CreateAirtableTableRecordTaskParams.from_dict(data) return task_params_type_17 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1467,7 +1554,7 @@ def _parse_task_params( task_params_type_18 = CreateAsanaSubtaskTaskParams.from_dict(data) return task_params_type_18 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1475,7 +1562,7 @@ def _parse_task_params( task_params_type_19 = CreateAsanaTaskTaskParams.from_dict(data) return task_params_type_19 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1483,7 +1570,7 @@ def _parse_task_params( task_params_type_20 = CreateConfluencePageTaskParams.from_dict(data) return task_params_type_20 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1491,7 +1578,7 @@ def _parse_task_params( task_params_type_21 = CreateDatadogNotebookTaskParams.from_dict(data) return task_params_type_21 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1499,7 +1586,7 @@ def _parse_task_params( task_params_type_22 = CreateCodaPageTaskParams.from_dict(data) return task_params_type_22 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1507,7 +1594,7 @@ def _parse_task_params( task_params_type_23 = CreateDropboxPaperPageTaskParams.from_dict(data) return task_params_type_23 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1515,7 +1602,7 @@ def _parse_task_params( task_params_type_24 = CreateGithubIssueTaskParams.from_dict(data) return task_params_type_24 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1523,7 +1610,7 @@ def _parse_task_params( task_params_type_25 = CreateGitlabIssueTaskParams.from_dict(data) return task_params_type_25 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1531,7 +1618,7 @@ def _parse_task_params( task_params_type_26 = CreateOutlookEventTaskParams.from_dict(data) return task_params_type_26 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1539,7 +1626,7 @@ def _parse_task_params( task_params_type_27 = CreateGoogleCalendarEventTaskParams.from_dict(data) return task_params_type_27 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1547,7 +1634,7 @@ def _parse_task_params( task_params_type_28 = UpdateGoogleDocsPageTaskParams.from_dict(data) return task_params_type_28 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1555,7 +1642,7 @@ def _parse_task_params( task_params_type_29 = UpdateCodaPageTaskParams.from_dict(data) return task_params_type_29 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1563,7 +1650,7 @@ def _parse_task_params( task_params_type_30 = UpdateGoogleCalendarEventTaskParams.from_dict(data) return task_params_type_30 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1571,7 +1658,7 @@ def _parse_task_params( task_params_type_31 = CreateSharepointPageTaskParams.from_dict(data) return task_params_type_31 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1579,7 +1666,7 @@ def _parse_task_params( task_params_type_32 = CreateGoogleDocsPageTaskParams.from_dict(data) return task_params_type_32 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1587,7 +1674,7 @@ def _parse_task_params( task_params_type_33 = CreateGoogleDocsPermissionsTaskParams.from_dict(data) return task_params_type_33 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1595,7 +1682,7 @@ def _parse_task_params( task_params_type_34 = RemoveGoogleDocsPermissionsTaskParams.from_dict(data) return task_params_type_34 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1603,7 +1690,7 @@ def _parse_task_params( task_params_type_35 = CreateQuipPageTaskParams.from_dict(data) return task_params_type_35 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1611,7 +1698,7 @@ def _parse_task_params( task_params_type_36 = CreateGoogleMeetingTaskParams.from_dict(data) return task_params_type_36 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1619,7 +1706,7 @@ def _parse_task_params( task_params_type_37 = CreateGoToMeetingTaskParams.from_dict(data) return task_params_type_37 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1627,7 +1714,7 @@ def _parse_task_params( task_params_type_38 = CreateIncidentTaskParams.from_dict(data) return task_params_type_38 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1635,7 +1722,7 @@ def _parse_task_params( task_params_type_39 = CreateSubIncidentTaskParams.from_dict(data) return task_params_type_39 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1643,7 +1730,7 @@ def _parse_task_params( task_params_type_40 = CreateIncidentPostmortemTaskParams.from_dict(data) return task_params_type_40 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1651,7 +1738,7 @@ def _parse_task_params( task_params_type_41 = CreateJiraIssueTaskParams.from_dict(data) return task_params_type_41 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1659,7 +1746,7 @@ def _parse_task_params( task_params_type_42 = CreateJiraSubtaskTaskParams.from_dict(data) return task_params_type_42 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1667,55 +1754,63 @@ def _parse_task_params( task_params_type_43 = AttachRetrospectivePdfToJiraIssueTaskParams.from_dict(data) return task_params_type_43 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_44 = CreateLinearIssueTaskParams.from_dict(data) + task_params_type_44 = AttachRetrospectivePdfToFreshserviceTicketTaskParams.from_dict(data) return task_params_type_44 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_45 = CreateLinearSubtaskIssueTaskParams.from_dict(data) + task_params_type_45 = CreateLinearIssueTaskParams.from_dict(data) return task_params_type_45 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_46 = CreateLinearIssueCommentTaskParams.from_dict(data) + task_params_type_46 = CreateLinearSubtaskIssueTaskParams.from_dict(data) return task_params_type_46 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_47 = CreateMicrosoftTeamsMeetingTaskParams.from_dict(data) + task_params_type_47 = CreateLinearIssueCommentTaskParams.from_dict(data) return task_params_type_47 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_48 = CreateMicrosoftTeamsChannelTaskParams.from_dict(data) + task_params_type_48 = CreateMicrosoftTeamsMeetingTaskParams.from_dict(data) return task_params_type_48 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_49 = CreateMicrosoftTeamsChatTaskParams.from_dict(data) + task_params_type_49 = CreateMicrosoftTeamsChannelTaskParams.from_dict(data) return task_params_type_49 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + task_params_type_50 = CreateMicrosoftTeamsChatTaskParams.from_dict(data) + + return task_params_type_50 + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1725,7 +1820,7 @@ def _parse_task_params( ) return componentsschemasadd_microsoft_teams_tab_task_params_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1735,111 +1830,111 @@ def _parse_task_params( ) return componentsschemasadd_microsoft_teams_tab_task_params_type_1 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - task_params_type_51 = AddMicrosoftTeamsChatTabTaskParams.from_dict(data) - - return task_params_type_51 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_52 = CreateGoogleChatSpaceTaskParams.from_dict(data) + task_params_type_52 = AddMicrosoftTeamsChatTabTaskParams.from_dict(data) return task_params_type_52 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_53 = SendGoogleChatMessageTaskParams.from_dict(data) + task_params_type_53 = CreateGoogleChatSpaceTaskParams.from_dict(data) return task_params_type_53 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_54 = SendGoogleChatAttachmentsTaskParams.from_dict(data) + task_params_type_54 = SendGoogleChatMessageTaskParams.from_dict(data) return task_params_type_54 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_55 = InviteToGoogleChatSpaceTaskParams.from_dict(data) + task_params_type_55 = SendGoogleChatAttachmentsTaskParams.from_dict(data) return task_params_type_55 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_56 = ArchiveGoogleChatSpacesTaskParams.from_dict(data) + task_params_type_56 = InviteToGoogleChatSpaceTaskParams.from_dict(data) return task_params_type_56 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_57 = RenameGoogleChatSpaceTaskParams.from_dict(data) + task_params_type_57 = ArchiveGoogleChatSpacesTaskParams.from_dict(data) return task_params_type_57 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_58 = UpdateGoogleChatSpaceDescriptionTaskParams.from_dict(data) + task_params_type_58 = RenameGoogleChatSpaceTaskParams.from_dict(data) return task_params_type_58 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_59 = ChangeGoogleChatSpacePrivacyTaskParams.from_dict(data) + task_params_type_59 = UpdateGoogleChatSpaceDescriptionTaskParams.from_dict(data) return task_params_type_59 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_60 = ArchiveMicrosoftTeamsChannelsTaskParams.from_dict(data) + task_params_type_60 = ChangeGoogleChatSpacePrivacyTaskParams.from_dict(data) return task_params_type_60 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_61 = RenameMicrosoftTeamsChannelTaskParams.from_dict(data) + task_params_type_61 = ArchiveMicrosoftTeamsChannelsTaskParams.from_dict(data) return task_params_type_61 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_62 = InviteToMicrosoftTeamsChannelTaskParams.from_dict(data) + task_params_type_62 = RenameMicrosoftTeamsChannelTaskParams.from_dict(data) return task_params_type_62 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_63 = CreateNotionPageTaskParams.from_dict(data) + task_params_type_63 = InviteToMicrosoftTeamsChannelTaskParams.from_dict(data) return task_params_type_63 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + task_params_type_64 = CreateNotionPageTaskParams.from_dict(data) + + return task_params_type_64 + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1849,15 +1944,15 @@ def _parse_task_params( ) return componentsschemassend_microsoft_teams_message_task_params_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_65 = SendMicrosoftTeamsChatMessageTaskParams.from_dict(data) + task_params_type_66 = SendMicrosoftTeamsChatMessageTaskParams.from_dict(data) - return task_params_type_65 - except (TypeError, ValueError, AttributeError, KeyError): + return task_params_type_66 + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1867,63 +1962,63 @@ def _parse_task_params( ) return componentsschemassend_microsoft_teams_blocks_task_params_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - task_params_type_67 = UpdateNotionPageTaskParams.from_dict(data) - - return task_params_type_67 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_68 = UpdateQuipPageTaskParams.from_dict(data) + task_params_type_68 = UpdateNotionPageTaskParams.from_dict(data) return task_params_type_68 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_69 = UpdateConfluencePageTaskParams.from_dict(data) + task_params_type_69 = UpdateQuipPageTaskParams.from_dict(data) return task_params_type_69 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_70 = UpdateSharepointPageTaskParams.from_dict(data) + task_params_type_70 = UpdateConfluencePageTaskParams.from_dict(data) return task_params_type_70 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_71 = UpdateDropboxPaperPageTaskParams.from_dict(data) + task_params_type_71 = UpdateSharepointPageTaskParams.from_dict(data) return task_params_type_71 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_72 = UpdateDatadogNotebookTaskParams.from_dict(data) + task_params_type_72 = UpdateDropboxPaperPageTaskParams.from_dict(data) return task_params_type_72 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_73 = CreateServiceNowIncidentTaskParams.from_dict(data) + task_params_type_73 = UpdateDatadogNotebookTaskParams.from_dict(data) return task_params_type_73 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + task_params_type_74 = CreateServiceNowIncidentTaskParams.from_dict(data) + + return task_params_type_74 + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1933,7 +2028,7 @@ def _parse_task_params( ) return componentsschemascreate_shortcut_story_task_params_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1943,71 +2038,71 @@ def _parse_task_params( ) return componentsschemascreate_shortcut_story_task_params_type_1 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - task_params_type_75 = CreateShortcutTaskTaskParams.from_dict(data) - - return task_params_type_75 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_76 = CreateTrelloCardTaskParams.from_dict(data) + task_params_type_76 = CreateShortcutTaskTaskParams.from_dict(data) return task_params_type_76 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_77 = CreateWebexMeetingTaskParams.from_dict(data) + task_params_type_77 = CreateTrelloCardTaskParams.from_dict(data) return task_params_type_77 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_78 = CreateZendeskTicketTaskParams.from_dict(data) + task_params_type_78 = CreateWebexMeetingTaskParams.from_dict(data) return task_params_type_78 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_79 = CreateZendeskJiraLinkTaskParams.from_dict(data) + task_params_type_79 = CreateZendeskTicketTaskParams.from_dict(data) return task_params_type_79 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_80 = CreateClickupTaskTaskParams.from_dict(data) + task_params_type_80 = CreateZendeskJiraLinkTaskParams.from_dict(data) return task_params_type_80 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_81 = CreateMotionTaskTaskParams.from_dict(data) + task_params_type_81 = CreateClickupTaskTaskParams.from_dict(data) return task_params_type_81 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_82 = CreateZoomMeetingTaskParams.from_dict(data) + task_params_type_82 = CreateMotionTaskTaskParams.from_dict(data) return task_params_type_82 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + task_params_type_83 = CreateZoomMeetingTaskParams.from_dict(data) + + return task_params_type_83 + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -2015,7 +2110,7 @@ def _parse_task_params( componentsschemasget_github_commits_task_params_type_0 = GetGithubCommitsTaskParamsType0.from_dict(data) return componentsschemasget_github_commits_task_params_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -2023,7 +2118,7 @@ def _parse_task_params( componentsschemasget_github_commits_task_params_type_1 = GetGithubCommitsTaskParamsType1.from_dict(data) return componentsschemasget_github_commits_task_params_type_1 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -2031,7 +2126,7 @@ def _parse_task_params( componentsschemasget_gitlab_commits_task_params_type_0 = GetGitlabCommitsTaskParamsType0.from_dict(data) return componentsschemasget_gitlab_commits_task_params_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -2039,55 +2134,55 @@ def _parse_task_params( componentsschemasget_gitlab_commits_task_params_type_1 = GetGitlabCommitsTaskParamsType1.from_dict(data) return componentsschemasget_gitlab_commits_task_params_type_1 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_85 = GetPulsesTaskParams.from_dict(data) - - return task_params_type_85 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - task_params_type_86 = GetAlertsTaskParams.from_dict(data) + task_params_type_86 = GetPulsesTaskParams.from_dict(data) return task_params_type_86 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_87 = HttpClientTaskParams.from_dict(data) + task_params_type_87 = GetAlertsTaskParams.from_dict(data) return task_params_type_87 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_88 = InviteToSlackChannelOpsgenieTaskParams.from_dict(data) + task_params_type_88 = HttpClientTaskParams.from_dict(data) return task_params_type_88 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_89 = InviteToSlackChannelRootlyTaskParams.from_dict(data) + task_params_type_89 = InviteToSlackChannelOpsgenieTaskParams.from_dict(data) return task_params_type_89 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_90 = InviteToMicrosoftTeamsChannelRootlyTaskParams.from_dict(data) + task_params_type_90 = InviteToSlackChannelRootlyTaskParams.from_dict(data) return task_params_type_90 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + task_params_type_91 = InviteToMicrosoftTeamsChannelRootlyTaskParams.from_dict(data) + + return task_params_type_91 + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -2097,7 +2192,7 @@ def _parse_task_params( ) return componentsschemasinvite_to_slack_channel_pagerduty_task_params_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -2107,7 +2202,7 @@ def _parse_task_params( ) return componentsschemasinvite_to_slack_channel_pagerduty_task_params_type_1 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -2117,7 +2212,7 @@ def _parse_task_params( ) return componentsschemasinvite_to_slack_channel_task_params_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -2127,7 +2222,7 @@ def _parse_task_params( ) return componentsschemasinvite_to_slack_channel_task_params_type_1 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -2137,79 +2232,79 @@ def _parse_task_params( ) return componentsschemasinvite_to_slack_channel_task_params_type_2 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - task_params_type_93 = InviteToSlackChannelVictorOpsTaskParams.from_dict(data) - - return task_params_type_93 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_94 = PageOpsgenieOnCallRespondersTaskParams.from_dict(data) + task_params_type_94 = InviteToSlackChannelVictorOpsTaskParams.from_dict(data) return task_params_type_94 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_95 = CreateOpsgenieAlertTaskParams.from_dict(data) + task_params_type_95 = PageOpsgenieOnCallRespondersTaskParams.from_dict(data) return task_params_type_95 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_96 = CreateJsmopsAlertTaskParams.from_dict(data) + task_params_type_96 = CreateOpsgenieAlertTaskParams.from_dict(data) return task_params_type_96 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_97 = PageJsmopsOnCallRespondersTaskParams.from_dict(data) + task_params_type_97 = CreateJsmopsAlertTaskParams.from_dict(data) return task_params_type_97 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_98 = UpdateOpsgenieAlertTaskParams.from_dict(data) + task_params_type_98 = PageJsmopsOnCallRespondersTaskParams.from_dict(data) return task_params_type_98 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_99 = UpdateOpsgenieIncidentTaskParams.from_dict(data) + task_params_type_99 = UpdateOpsgenieAlertTaskParams.from_dict(data) return task_params_type_99 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_100 = PageRootlyOnCallRespondersTaskParams.from_dict(data) + task_params_type_100 = UpdateOpsgenieIncidentTaskParams.from_dict(data) return task_params_type_100 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_101 = PagePagerdutyOnCallRespondersTaskParams.from_dict(data) + task_params_type_101 = PageRootlyOnCallRespondersTaskParams.from_dict(data) return task_params_type_101 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + task_params_type_102 = PagePagerdutyOnCallRespondersTaskParams.from_dict(data) + + return task_params_type_102 + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -2219,7 +2314,7 @@ def _parse_task_params( ) return componentsschemaspage_victor_ops_on_call_responders_task_params_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -2229,87 +2324,87 @@ def _parse_task_params( ) return componentsschemaspage_victor_ops_on_call_responders_task_params_type_1 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - task_params_type_103 = UpdateVictorOpsIncidentTaskParams.from_dict(data) - - return task_params_type_103 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_104 = PrintTaskParams.from_dict(data) + task_params_type_104 = UpdateVictorOpsIncidentTaskParams.from_dict(data) return task_params_type_104 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_105 = PublishIncidentTaskParams.from_dict(data) + task_params_type_105 = PrintTaskParams.from_dict(data) return task_params_type_105 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_106 = RedisClientTaskParams.from_dict(data) + task_params_type_106 = PublishIncidentTaskParams.from_dict(data) return task_params_type_106 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_107 = RenameSlackChannelTaskParams.from_dict(data) + task_params_type_107 = RedisClientTaskParams.from_dict(data) return task_params_type_107 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_108 = ChangeSlackChannelPrivacyTaskParams.from_dict(data) + task_params_type_108 = RenameSlackChannelTaskParams.from_dict(data) return task_params_type_108 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_109 = RunCommandHerokuTaskParams.from_dict(data) + task_params_type_109 = ChangeSlackChannelPrivacyTaskParams.from_dict(data) return task_params_type_109 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_110 = SendEmailTaskParams.from_dict(data) + task_params_type_110 = RunCommandHerokuTaskParams.from_dict(data) return task_params_type_110 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_111 = SendDashboardReportTaskParams.from_dict(data) + task_params_type_111 = SendEmailTaskParams.from_dict(data) return task_params_type_111 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_112 = CreateSlackChannelTaskParams.from_dict(data) + task_params_type_112 = SendDashboardReportTaskParams.from_dict(data) return task_params_type_112 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + task_params_type_113 = CreateSlackChannelTaskParams.from_dict(data) + + return task_params_type_113 + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -2317,7 +2412,7 @@ def _parse_task_params( componentsschemassend_slack_message_task_params_type_0 = SendSlackMessageTaskParamsType0.from_dict(data) return componentsschemassend_slack_message_task_params_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -2325,7 +2420,7 @@ def _parse_task_params( componentsschemassend_slack_message_task_params_type_1 = SendSlackMessageTaskParamsType1.from_dict(data) return componentsschemassend_slack_message_task_params_type_1 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -2333,223 +2428,223 @@ def _parse_task_params( componentsschemassend_slack_message_task_params_type_2 = SendSlackMessageTaskParamsType2.from_dict(data) return componentsschemassend_slack_message_task_params_type_2 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - task_params_type_114 = SendSmsTaskParams.from_dict(data) - - return task_params_type_114 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_115 = SendWhatsappMessageTaskParams.from_dict(data) + task_params_type_115 = SendSmsTaskParams.from_dict(data) return task_params_type_115 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_116 = SnapshotDatadogGraphTaskParams.from_dict(data) + task_params_type_116 = SendWhatsappMessageTaskParams.from_dict(data) return task_params_type_116 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_117 = SnapshotGrafanaDashboardTaskParams.from_dict(data) + task_params_type_117 = SnapshotDatadogGraphTaskParams.from_dict(data) return task_params_type_117 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_118 = SnapshotLookerLookTaskParams.from_dict(data) + task_params_type_118 = SnapshotGrafanaDashboardTaskParams.from_dict(data) return task_params_type_118 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_119 = SnapshotNewRelicGraphTaskParams.from_dict(data) + task_params_type_119 = SnapshotLookerLookTaskParams.from_dict(data) return task_params_type_119 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_120 = TweetTwitterMessageTaskParams.from_dict(data) + task_params_type_120 = SnapshotNewRelicGraphTaskParams.from_dict(data) return task_params_type_120 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_121 = UpdateAirtableTableRecordTaskParams.from_dict(data) + task_params_type_121 = TweetTwitterMessageTaskParams.from_dict(data) return task_params_type_121 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_122 = UpdateAsanaTaskTaskParams.from_dict(data) + task_params_type_122 = UpdateAirtableTableRecordTaskParams.from_dict(data) return task_params_type_122 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_123 = UpdateGithubIssueTaskParams.from_dict(data) + task_params_type_123 = UpdateAsanaTaskTaskParams.from_dict(data) return task_params_type_123 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_124 = UpdateGitlabIssueTaskParams.from_dict(data) + task_params_type_124 = UpdateGithubIssueTaskParams.from_dict(data) return task_params_type_124 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_125 = UpdateIncidentTaskParams.from_dict(data) + task_params_type_125 = UpdateGitlabIssueTaskParams.from_dict(data) return task_params_type_125 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_126 = UpdateIncidentPostmortemTaskParams.from_dict(data) + task_params_type_126 = UpdateIncidentTaskParams.from_dict(data) return task_params_type_126 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_127 = UpdateJiraIssueTaskParams.from_dict(data) + task_params_type_127 = UpdateIncidentPostmortemTaskParams.from_dict(data) return task_params_type_127 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_128 = UpdateLinearIssueTaskParams.from_dict(data) + task_params_type_128 = UpdateJiraIssueTaskParams.from_dict(data) return task_params_type_128 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_129 = UpdateServiceNowIncidentTaskParams.from_dict(data) + task_params_type_129 = UpdateLinearIssueTaskParams.from_dict(data) return task_params_type_129 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_130 = UpdateShortcutStoryTaskParams.from_dict(data) + task_params_type_130 = UpdateServiceNowIncidentTaskParams.from_dict(data) return task_params_type_130 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_131 = UpdateShortcutTaskTaskParams.from_dict(data) + task_params_type_131 = UpdateShortcutStoryTaskParams.from_dict(data) return task_params_type_131 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_132 = UpdateSlackChannelTopicTaskParams.from_dict(data) + task_params_type_132 = UpdateShortcutTaskTaskParams.from_dict(data) return task_params_type_132 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_133 = UpdateStatusTaskParams.from_dict(data) + task_params_type_133 = UpdateSlackChannelTopicTaskParams.from_dict(data) return task_params_type_133 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_134 = UpdateIncidentStatusTimestampTaskParams.from_dict(data) + task_params_type_134 = UpdateStatusTaskParams.from_dict(data) return task_params_type_134 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_135 = UpdateTrelloCardTaskParams.from_dict(data) + task_params_type_135 = UpdateIncidentStatusTimestampTaskParams.from_dict(data) return task_params_type_135 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_136 = UpdateClickupTaskTaskParams.from_dict(data) + task_params_type_136 = UpdateTrelloCardTaskParams.from_dict(data) return task_params_type_136 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_137 = UpdateMotionTaskTaskParams.from_dict(data) + task_params_type_137 = UpdateClickupTaskTaskParams.from_dict(data) return task_params_type_137 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_138 = UpdateZendeskTicketTaskParams.from_dict(data) + task_params_type_138 = UpdateMotionTaskTaskParams.from_dict(data) return task_params_type_138 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_139 = UpdateAttachedAlertsTaskParams.from_dict(data) + task_params_type_139 = UpdateZendeskTicketTaskParams.from_dict(data) return task_params_type_139 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_140 = TriggerWorkflowTaskParams.from_dict(data) + task_params_type_140 = UpdateAttachedAlertsTaskParams.from_dict(data) return task_params_type_140 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + task_params_type_141 = TriggerWorkflowTaskParams.from_dict(data) + + return task_params_type_141 + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -2557,7 +2652,7 @@ def _parse_task_params( componentsschemassend_slack_blocks_task_params_type_0 = SendSlackBlocksTaskParamsType0.from_dict(data) return componentsschemassend_slack_blocks_task_params_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -2565,7 +2660,7 @@ def _parse_task_params( componentsschemassend_slack_blocks_task_params_type_1 = SendSlackBlocksTaskParamsType1.from_dict(data) return componentsschemassend_slack_blocks_task_params_type_1 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -2573,45 +2668,45 @@ def _parse_task_params( componentsschemassend_slack_blocks_task_params_type_2 = SendSlackBlocksTaskParamsType2.from_dict(data) return componentsschemassend_slack_blocks_task_params_type_2 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_142 = CreateOpenaiChatCompletionTaskParams.from_dict(data) + task_params_type_143 = CreateOpenaiChatCompletionTaskParams.from_dict(data) - return task_params_type_142 - except (TypeError, ValueError, AttributeError, KeyError): + return task_params_type_143 + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_143 = CreateWatsonxChatCompletionTaskParams.from_dict(data) + task_params_type_144 = CreateWatsonxChatCompletionTaskParams.from_dict(data) - return task_params_type_143 - except (TypeError, ValueError, AttributeError, KeyError): + return task_params_type_144 + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_144 = CreateGoogleGeminiChatCompletionTaskParams.from_dict(data) + task_params_type_145 = CreateGoogleGeminiChatCompletionTaskParams.from_dict(data) - return task_params_type_144 - except (TypeError, ValueError, AttributeError, KeyError): + return task_params_type_145 + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_145 = CreateMistralChatCompletionTaskParams.from_dict(data) + task_params_type_146 = CreateMistralChatCompletionTaskParams.from_dict(data) - return task_params_type_145 - except (TypeError, ValueError, AttributeError, KeyError): + return task_params_type_146 + except: # noqa: E722 pass if not isinstance(data, dict): raise TypeError() - task_params_type_146 = CreateAnthropicChatCompletionTaskParams.from_dict(data) + task_params_type_147 = CreateAnthropicChatCompletionTaskParams.from_dict(data) - return task_params_type_146 + return task_params_type_147 task_params = _parse_task_params(d.pop("task_params", UNSET)) diff --git a/rootly_sdk/models/update_zendesk_ticket_task_params.py b/rootly_sdk/models/update_zendesk_ticket_task_params.py index 1791e774..278fa3a5 100644 --- a/rootly_sdk/models/update_zendesk_ticket_task_params.py +++ b/rootly_sdk/models/update_zendesk_ticket_task_params.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -25,32 +23,31 @@ class UpdateZendeskTicketTaskParams: """ Attributes: ticket_id (str): The ticket id - task_type (UpdateZendeskTicketTaskParamsTaskType | Unset): - subject (str | Unset): The ticket subject - tags (str | Unset): The ticket tags - priority (UpdateZendeskTicketTaskParamsPriority | Unset): The priority id and display name - completion (UpdateZendeskTicketTaskParamsCompletion | Unset): The completion id and display name - custom_fields_mapping (None | str | Unset): Custom field mappings. Can contain liquid markup and need to be + task_type (Union[Unset, UpdateZendeskTicketTaskParamsTaskType]): + subject (Union[Unset, str]): The ticket subject + tags (Union[Unset, str]): The ticket tags + priority (Union[Unset, UpdateZendeskTicketTaskParamsPriority]): The priority id and display name + completion (Union[Unset, UpdateZendeskTicketTaskParamsCompletion]): The completion id and display name + custom_fields_mapping (Union[None, Unset, str]): Custom field mappings. Can contain liquid markup and need to be valid JSON - ticket_payload (None | str | Unset): Additional Zendesk ticket attributes. Will be merged into whatever was + ticket_payload (Union[None, Unset, str]): Additional Zendesk ticket attributes. Will be merged into whatever was specified in this tasks current parameters. Can contain liquid markup and need to be valid JSON """ ticket_id: str - task_type: UpdateZendeskTicketTaskParamsTaskType | Unset = UNSET - subject: str | Unset = UNSET - tags: str | Unset = UNSET - priority: UpdateZendeskTicketTaskParamsPriority | Unset = UNSET - completion: UpdateZendeskTicketTaskParamsCompletion | Unset = UNSET - custom_fields_mapping: None | str | Unset = UNSET - ticket_payload: None | str | Unset = UNSET + task_type: Union[Unset, UpdateZendeskTicketTaskParamsTaskType] = UNSET + subject: Union[Unset, str] = UNSET + tags: Union[Unset, str] = UNSET + priority: Union[Unset, "UpdateZendeskTicketTaskParamsPriority"] = UNSET + completion: Union[Unset, "UpdateZendeskTicketTaskParamsCompletion"] = UNSET + custom_fields_mapping: Union[None, Unset, str] = UNSET + ticket_payload: Union[None, Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - ticket_id = self.ticket_id - task_type: str | Unset = UNSET + task_type: Union[Unset, str] = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -58,21 +55,21 @@ def to_dict(self) -> dict[str, Any]: tags = self.tags - priority: dict[str, Any] | Unset = UNSET + priority: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.priority, Unset): priority = self.priority.to_dict() - completion: dict[str, Any] | Unset = UNSET + completion: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.completion, Unset): completion = self.completion.to_dict() - custom_fields_mapping: None | str | Unset + custom_fields_mapping: Union[None, Unset, str] if isinstance(self.custom_fields_mapping, Unset): custom_fields_mapping = UNSET else: custom_fields_mapping = self.custom_fields_mapping - ticket_payload: None | str | Unset + ticket_payload: Union[None, Unset, str] if isinstance(self.ticket_payload, Unset): ticket_payload = UNSET else: @@ -111,7 +108,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: ticket_id = d.pop("ticket_id") _task_type = d.pop("task_type", UNSET) - task_type: UpdateZendeskTicketTaskParamsTaskType | Unset + task_type: Union[Unset, UpdateZendeskTicketTaskParamsTaskType] if isinstance(_task_type, Unset): task_type = UNSET else: @@ -122,34 +119,34 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: tags = d.pop("tags", UNSET) _priority = d.pop("priority", UNSET) - priority: UpdateZendeskTicketTaskParamsPriority | Unset + priority: Union[Unset, UpdateZendeskTicketTaskParamsPriority] if isinstance(_priority, Unset): priority = UNSET else: priority = UpdateZendeskTicketTaskParamsPriority.from_dict(_priority) _completion = d.pop("completion", UNSET) - completion: UpdateZendeskTicketTaskParamsCompletion | Unset + completion: Union[Unset, UpdateZendeskTicketTaskParamsCompletion] if isinstance(_completion, Unset): completion = UNSET else: completion = UpdateZendeskTicketTaskParamsCompletion.from_dict(_completion) - def _parse_custom_fields_mapping(data: object) -> None | str | Unset: + def _parse_custom_fields_mapping(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) custom_fields_mapping = _parse_custom_fields_mapping(d.pop("custom_fields_mapping", UNSET)) - def _parse_ticket_payload(data: object) -> None | str | Unset: + def _parse_ticket_payload(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) ticket_payload = _parse_ticket_payload(d.pop("ticket_payload", UNSET)) diff --git a/rootly_sdk/models/update_zendesk_ticket_task_params_completion.py b/rootly_sdk/models/update_zendesk_ticket_task_params_completion.py index 5e531f48..ba9121d6 100644 --- a/rootly_sdk/models/update_zendesk_ticket_task_params_completion.py +++ b/rootly_sdk/models/update_zendesk_ticket_task_params_completion.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,12 +14,12 @@ class UpdateZendeskTicketTaskParamsCompletion: """The completion id and display name Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_zendesk_ticket_task_params_priority.py b/rootly_sdk/models/update_zendesk_ticket_task_params_priority.py index e87ec4f3..d79538c3 100644 --- a/rootly_sdk/models/update_zendesk_ticket_task_params_priority.py +++ b/rootly_sdk/models/update_zendesk_ticket_task_params_priority.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,12 +14,12 @@ class UpdateZendeskTicketTaskParamsPriority: """The priority id and display name Attributes: - id (str | Unset): - name (str | Unset): + id (Union[Unset, str]): + name (Union[Unset, str]): """ - id: str | Unset = UNSET - name: str | Unset = UNSET + id: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/uptime_chart_response.py b/rootly_sdk/models/uptime_chart_response.py index 0662c7d6..314e0a8b 100644 --- a/rootly_sdk/models/uptime_chart_response.py +++ b/rootly_sdk/models/uptime_chart_response.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,11 +18,10 @@ class UptimeChartResponse: data (UptimeChartResponseData): """ - data: UptimeChartResponseData + data: "UptimeChartResponseData" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() field_dict: dict[str, Any] = {} diff --git a/rootly_sdk/models/uptime_chart_response_data.py b/rootly_sdk/models/uptime_chart_response_data.py index 72ef2ae1..489012f1 100644 --- a/rootly_sdk/models/uptime_chart_response_data.py +++ b/rootly_sdk/models/uptime_chart_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,7 +14,6 @@ class UptimeChartResponseData: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) diff --git a/rootly_sdk/models/user.py b/rootly_sdk/models/user.py index 3604e323..dfcb1358 100644 --- a/rootly_sdk/models/user.py +++ b/rootly_sdk/models/user.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -18,21 +16,21 @@ class User: email (str): The email of the user created_at (str): Date of creation updated_at (str): Date of last update - first_name (None | str | Unset): First name of the user - last_name (None | str | Unset): Last name of the user - full_name (None | str | Unset): The full name of the user - full_name_with_team (None | str | Unset): The full name with team of the user - time_zone (None | str | Unset): Configured time zone + first_name (Union[None, Unset, str]): First name of the user + last_name (Union[None, Unset, str]): Last name of the user + full_name (Union[None, Unset, str]): The full name of the user + full_name_with_team (Union[None, Unset, str]): The full name with team of the user + time_zone (Union[None, Unset, str]): Configured time zone """ email: str created_at: str updated_at: str - first_name: None | str | Unset = UNSET - last_name: None | str | Unset = UNSET - full_name: None | str | Unset = UNSET - full_name_with_team: None | str | Unset = UNSET - time_zone: None | str | Unset = UNSET + first_name: Union[None, Unset, str] = UNSET + last_name: Union[None, Unset, str] = UNSET + full_name: Union[None, Unset, str] = UNSET + full_name_with_team: Union[None, Unset, str] = UNSET + time_zone: Union[None, Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,31 +40,31 @@ def to_dict(self) -> dict[str, Any]: updated_at = self.updated_at - first_name: None | str | Unset + first_name: Union[None, Unset, str] if isinstance(self.first_name, Unset): first_name = UNSET else: first_name = self.first_name - last_name: None | str | Unset + last_name: Union[None, Unset, str] if isinstance(self.last_name, Unset): last_name = UNSET else: last_name = self.last_name - full_name: None | str | Unset + full_name: Union[None, Unset, str] if isinstance(self.full_name, Unset): full_name = UNSET else: full_name = self.full_name - full_name_with_team: None | str | Unset + full_name_with_team: Union[None, Unset, str] if isinstance(self.full_name_with_team, Unset): full_name_with_team = UNSET else: full_name_with_team = self.full_name_with_team - time_zone: None | str | Unset + time_zone: Union[None, Unset, str] if isinstance(self.time_zone, Unset): time_zone = UNSET else: @@ -103,48 +101,48 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: updated_at = d.pop("updated_at") - def _parse_first_name(data: object) -> None | str | Unset: + def _parse_first_name(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) first_name = _parse_first_name(d.pop("first_name", UNSET)) - def _parse_last_name(data: object) -> None | str | Unset: + def _parse_last_name(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) last_name = _parse_last_name(d.pop("last_name", UNSET)) - def _parse_full_name(data: object) -> None | str | Unset: + def _parse_full_name(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) full_name = _parse_full_name(d.pop("full_name", UNSET)) - def _parse_full_name_with_team(data: object) -> None | str | Unset: + def _parse_full_name_with_team(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) full_name_with_team = _parse_full_name_with_team(d.pop("full_name_with_team", UNSET)) - def _parse_time_zone(data: object) -> None | str | Unset: + def _parse_time_zone(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) time_zone = _parse_time_zone(d.pop("time_zone", UNSET)) diff --git a/rootly_sdk/models/user_email_address.py b/rootly_sdk/models/user_email_address.py index 2f901d3e..cb07bb05 100644 --- a/rootly_sdk/models/user_email_address.py +++ b/rootly_sdk/models/user_email_address.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,18 +13,18 @@ class UserEmailAddress: """ Attributes: - user_id (int | Unset): - email (str | Unset): Email address - primary (bool | Unset): Whether this is the primary email address - created_at (str | Unset): Date of creation - updated_at (str | Unset): Date of last update + user_id (Union[Unset, int]): + email (Union[Unset, str]): Email address + primary (Union[Unset, bool]): Whether this is the primary email address + created_at (Union[Unset, str]): Date of creation + updated_at (Union[Unset, str]): Date of last update """ - user_id: int | Unset = UNSET - email: str | Unset = UNSET - primary: bool | Unset = UNSET - created_at: str | Unset = UNSET - updated_at: str | Unset = UNSET + user_id: Union[Unset, int] = UNSET + email: Union[Unset, str] = UNSET + primary: Union[Unset, bool] = UNSET + created_at: Union[Unset, str] = UNSET + updated_at: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/user_email_address_list.py b/rootly_sdk/models/user_email_address_list.py index c66109e3..170754cd 100644 --- a/rootly_sdk/models/user_email_address_list.py +++ b/rootly_sdk/models/user_email_address_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,20 +20,19 @@ class UserEmailAddressList: """ Attributes: - data (list[UserEmailAddressListDataItem]): + data (list['UserEmailAddressListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[UserEmailAddressListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["UserEmailAddressListDataItem"] + links: "Links" + meta: "Meta" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) user_email_address_list = cls( data=data, diff --git a/rootly_sdk/models/user_email_address_list_data_item.py b/rootly_sdk/models/user_email_address_list_data_item.py index 2e958798..86906a72 100644 --- a/rootly_sdk/models/user_email_address_list_data_item.py +++ b/rootly_sdk/models/user_email_address_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class UserEmailAddressListDataItem: id: str type_: UserEmailAddressListDataItemType - attributes: UserEmailAddress + attributes: "UserEmailAddress" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/user_email_address_response.py b/rootly_sdk/models/user_email_address_response.py index 78fed502..957c753a 100644 --- a/rootly_sdk/models/user_email_address_response.py +++ b/rootly_sdk/models/user_email_address_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,18 +19,17 @@ class UserEmailAddressResponse: """ Attributes: data (UserEmailAddressResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: UserEmailAddressResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "UserEmailAddressResponseData" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = UserEmailAddressResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) user_email_address_response = cls( data=data, diff --git a/rootly_sdk/models/user_email_address_response_data.py b/rootly_sdk/models/user_email_address_response_data.py index 8d79cd83..05b0715b 100644 --- a/rootly_sdk/models/user_email_address_response_data.py +++ b/rootly_sdk/models/user_email_address_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class UserEmailAddressResponseData: id: str type_: UserEmailAddressResponseDataType - attributes: UserEmailAddress + attributes: "UserEmailAddress" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/user_flat_response.py b/rootly_sdk/models/user_flat_response.py index ed5c61d3..91ac6ba8 100644 --- a/rootly_sdk/models/user_flat_response.py +++ b/rootly_sdk/models/user_flat_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -20,32 +18,32 @@ class UserFlatResponse: email (str): Email address created_at (str): Date of creation updated_at (str): Date of last update - name (str | Unset): Display name - phone (None | str | Unset): Primary phone number - phone_2 (None | str | Unset): Secondary phone number - first_name (None | str | Unset): First name - last_name (None | str | Unset): Last name - preferred_name (None | str | Unset): Preferred name - full_name (None | str | Unset): Full name - full_name_with_team (None | str | Unset): Full name with team context - slack_id (None | str | Unset): Slack user ID - time_zone (None | str | Unset): IANA time zone + name (Union[Unset, str]): Display name + phone (Union[None, Unset, str]): Primary phone number + phone_2 (Union[None, Unset, str]): Secondary phone number + first_name (Union[None, Unset, str]): First name + last_name (Union[None, Unset, str]): Last name + preferred_name (Union[None, Unset, str]): Preferred name + full_name (Union[None, Unset, str]): Full name + full_name_with_team (Union[None, Unset, str]): Full name with team context + slack_id (Union[None, Unset, str]): Slack user ID + time_zone (Union[None, Unset, str]): IANA time zone """ id: int email: str created_at: str updated_at: str - name: str | Unset = UNSET - phone: None | str | Unset = UNSET - phone_2: None | str | Unset = UNSET - first_name: None | str | Unset = UNSET - last_name: None | str | Unset = UNSET - preferred_name: None | str | Unset = UNSET - full_name: None | str | Unset = UNSET - full_name_with_team: None | str | Unset = UNSET - slack_id: None | str | Unset = UNSET - time_zone: None | str | Unset = UNSET + name: Union[Unset, str] = UNSET + phone: Union[None, Unset, str] = UNSET + phone_2: Union[None, Unset, str] = UNSET + first_name: Union[None, Unset, str] = UNSET + last_name: Union[None, Unset, str] = UNSET + preferred_name: Union[None, Unset, str] = UNSET + full_name: Union[None, Unset, str] = UNSET + full_name_with_team: Union[None, Unset, str] = UNSET + slack_id: Union[None, Unset, str] = UNSET + time_zone: Union[None, Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -59,55 +57,55 @@ def to_dict(self) -> dict[str, Any]: name = self.name - phone: None | str | Unset + phone: Union[None, Unset, str] if isinstance(self.phone, Unset): phone = UNSET else: phone = self.phone - phone_2: None | str | Unset + phone_2: Union[None, Unset, str] if isinstance(self.phone_2, Unset): phone_2 = UNSET else: phone_2 = self.phone_2 - first_name: None | str | Unset + first_name: Union[None, Unset, str] if isinstance(self.first_name, Unset): first_name = UNSET else: first_name = self.first_name - last_name: None | str | Unset + last_name: Union[None, Unset, str] if isinstance(self.last_name, Unset): last_name = UNSET else: last_name = self.last_name - preferred_name: None | str | Unset + preferred_name: Union[None, Unset, str] if isinstance(self.preferred_name, Unset): preferred_name = UNSET else: preferred_name = self.preferred_name - full_name: None | str | Unset + full_name: Union[None, Unset, str] if isinstance(self.full_name, Unset): full_name = UNSET else: full_name = self.full_name - full_name_with_team: None | str | Unset + full_name_with_team: Union[None, Unset, str] if isinstance(self.full_name_with_team, Unset): full_name_with_team = UNSET else: full_name_with_team = self.full_name_with_team - slack_id: None | str | Unset + slack_id: Union[None, Unset, str] if isinstance(self.slack_id, Unset): slack_id = UNSET else: slack_id = self.slack_id - time_zone: None | str | Unset + time_zone: Union[None, Unset, str] if isinstance(self.time_zone, Unset): time_zone = UNSET else: @@ -159,84 +157,84 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name = d.pop("name", UNSET) - def _parse_phone(data: object) -> None | str | Unset: + def _parse_phone(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) phone = _parse_phone(d.pop("phone", UNSET)) - def _parse_phone_2(data: object) -> None | str | Unset: + def _parse_phone_2(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) phone_2 = _parse_phone_2(d.pop("phone_2", UNSET)) - def _parse_first_name(data: object) -> None | str | Unset: + def _parse_first_name(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) first_name = _parse_first_name(d.pop("first_name", UNSET)) - def _parse_last_name(data: object) -> None | str | Unset: + def _parse_last_name(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) last_name = _parse_last_name(d.pop("last_name", UNSET)) - def _parse_preferred_name(data: object) -> None | str | Unset: + def _parse_preferred_name(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) preferred_name = _parse_preferred_name(d.pop("preferred_name", UNSET)) - def _parse_full_name(data: object) -> None | str | Unset: + def _parse_full_name(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) full_name = _parse_full_name(d.pop("full_name", UNSET)) - def _parse_full_name_with_team(data: object) -> None | str | Unset: + def _parse_full_name_with_team(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) full_name_with_team = _parse_full_name_with_team(d.pop("full_name_with_team", UNSET)) - def _parse_slack_id(data: object) -> None | str | Unset: + def _parse_slack_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) slack_id = _parse_slack_id(d.pop("slack_id", UNSET)) - def _parse_time_zone(data: object) -> None | str | Unset: + def _parse_time_zone(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) time_zone = _parse_time_zone(d.pop("time_zone", UNSET)) diff --git a/rootly_sdk/models/user_list.py b/rootly_sdk/models/user_list.py index 45656060..48603800 100644 --- a/rootly_sdk/models/user_list.py +++ b/rootly_sdk/models/user_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,20 +20,19 @@ class UserList: """ Attributes: - data (list[UserListDataItem]): + data (list['UserListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[UserListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["UserListDataItem"] + links: "Links" + meta: "Meta" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) user_list = cls( data=data, diff --git a/rootly_sdk/models/user_list_data_item.py b/rootly_sdk/models/user_list_data_item.py index 96f8c048..da905a84 100644 --- a/rootly_sdk/models/user_list_data_item.py +++ b/rootly_sdk/models/user_list_data_item.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -24,24 +22,23 @@ class UserListDataItem: id (str): Unique ID of the user type_ (UserListDataItemType): attributes (User): - relationships (UserRelationships | Unset): + relationships (Union[Unset, UserRelationships]): """ id: str type_: UserListDataItemType - attributes: User - relationships: UserRelationships | Unset = UNSET + attributes: "User" + relationships: Union[Unset, "UserRelationships"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ attributes = self.attributes.to_dict() - relationships: dict[str, Any] | Unset = UNSET + relationships: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.relationships, Unset): relationships = self.relationships.to_dict() @@ -72,7 +69,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = User.from_dict(d.pop("attributes")) _relationships = d.pop("relationships", UNSET) - relationships: UserRelationships | Unset + relationships: Union[Unset, UserRelationships] if isinstance(_relationships, Unset): relationships = UNSET else: diff --git a/rootly_sdk/models/user_notification_rule.py b/rootly_sdk/models/user_notification_rule.py index a1ece08a..b6c1d135 100644 --- a/rootly_sdk/models/user_notification_rule.py +++ b/rootly_sdk/models/user_notification_rule.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,81 +21,81 @@ class UserNotificationRule: """ Attributes: - user_id (int | Unset): - delay (int | None | Unset): Delay after which rule gets triggered - position (int | None | Unset): Position of the rule - user_email_address_id (None | str | Unset): User email address to which notification to be sent - user_call_number_id (None | str | Unset): User phone number to which notification to be sent - user_sms_number_id (None | str | Unset): User sms number to which notification to be sent - user_device_id (None | str | Unset): User device to which notification to be sent - enabled_contact_types (list[UserNotificationRuleEnabledContactTypesItem] | Unset): Contact types for which + user_id (Union[Unset, int]): + delay (Union[None, Unset, int]): Delay after which rule gets triggered + position (Union[None, Unset, int]): Position of the rule + user_email_address_id (Union[None, Unset, str]): User email address to which notification to be sent + user_call_number_id (Union[None, Unset, str]): User phone number to which notification to be sent + user_sms_number_id (Union[None, Unset, str]): User sms number to which notification to be sent + user_device_id (Union[None, Unset, str]): User device to which notification to be sent + enabled_contact_types (Union[Unset, list[UserNotificationRuleEnabledContactTypesItem]]): Contact types for which notification needs to be enabled - notification_type (UserNotificationRuleNotificationType | Unset): Type of notification rule (audible or quiet). - Audible notifications use sound/vibration to alert users, while quiet notifications are silent. - created_at (str | Unset): Date of creation - updated_at (str | Unset): Date of last update + notification_type (Union[Unset, UserNotificationRuleNotificationType]): Type of notification rule (audible or + quiet). Audible notifications use sound/vibration to alert users, while quiet notifications are silent. + created_at (Union[Unset, str]): Date of creation + updated_at (Union[Unset, str]): Date of last update """ - user_id: int | Unset = UNSET - delay: int | None | Unset = UNSET - position: int | None | Unset = UNSET - user_email_address_id: None | str | Unset = UNSET - user_call_number_id: None | str | Unset = UNSET - user_sms_number_id: None | str | Unset = UNSET - user_device_id: None | str | Unset = UNSET - enabled_contact_types: list[UserNotificationRuleEnabledContactTypesItem] | Unset = UNSET - notification_type: UserNotificationRuleNotificationType | Unset = UNSET - created_at: str | Unset = UNSET - updated_at: str | Unset = UNSET + user_id: Union[Unset, int] = UNSET + delay: Union[None, Unset, int] = UNSET + position: Union[None, Unset, int] = UNSET + user_email_address_id: Union[None, Unset, str] = UNSET + user_call_number_id: Union[None, Unset, str] = UNSET + user_sms_number_id: Union[None, Unset, str] = UNSET + user_device_id: Union[None, Unset, str] = UNSET + enabled_contact_types: Union[Unset, list[UserNotificationRuleEnabledContactTypesItem]] = UNSET + notification_type: Union[Unset, UserNotificationRuleNotificationType] = UNSET + created_at: Union[Unset, str] = UNSET + updated_at: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: user_id = self.user_id - delay: int | None | Unset + delay: Union[None, Unset, int] if isinstance(self.delay, Unset): delay = UNSET else: delay = self.delay - position: int | None | Unset + position: Union[None, Unset, int] if isinstance(self.position, Unset): position = UNSET else: position = self.position - user_email_address_id: None | str | Unset + user_email_address_id: Union[None, Unset, str] if isinstance(self.user_email_address_id, Unset): user_email_address_id = UNSET else: user_email_address_id = self.user_email_address_id - user_call_number_id: None | str | Unset + user_call_number_id: Union[None, Unset, str] if isinstance(self.user_call_number_id, Unset): user_call_number_id = UNSET else: user_call_number_id = self.user_call_number_id - user_sms_number_id: None | str | Unset + user_sms_number_id: Union[None, Unset, str] if isinstance(self.user_sms_number_id, Unset): user_sms_number_id = UNSET else: user_sms_number_id = self.user_sms_number_id - user_device_id: None | str | Unset + user_device_id: Union[None, Unset, str] if isinstance(self.user_device_id, Unset): user_device_id = UNSET else: user_device_id = self.user_device_id - enabled_contact_types: list[str] | Unset = UNSET + enabled_contact_types: Union[Unset, list[str]] = UNSET if not isinstance(self.enabled_contact_types, Unset): enabled_contact_types = [] for enabled_contact_types_item_data in self.enabled_contact_types: enabled_contact_types_item: str = enabled_contact_types_item_data enabled_contact_types.append(enabled_contact_types_item) - notification_type: str | Unset = UNSET + notification_type: Union[Unset, str] = UNSET if not isinstance(self.notification_type, Unset): notification_type = self.notification_type @@ -138,73 +136,71 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) user_id = d.pop("user_id", UNSET) - def _parse_delay(data: object) -> int | None | Unset: + def _parse_delay(data: object) -> Union[None, Unset, int]: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(Union[None, Unset, int], data) delay = _parse_delay(d.pop("delay", UNSET)) - def _parse_position(data: object) -> int | None | Unset: + def _parse_position(data: object) -> Union[None, Unset, int]: if data is None: return data if isinstance(data, Unset): return data - return cast(int | None | Unset, data) + return cast(Union[None, Unset, int], data) position = _parse_position(d.pop("position", UNSET)) - def _parse_user_email_address_id(data: object) -> None | str | Unset: + def _parse_user_email_address_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) user_email_address_id = _parse_user_email_address_id(d.pop("user_email_address_id", UNSET)) - def _parse_user_call_number_id(data: object) -> None | str | Unset: + def _parse_user_call_number_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) user_call_number_id = _parse_user_call_number_id(d.pop("user_call_number_id", UNSET)) - def _parse_user_sms_number_id(data: object) -> None | str | Unset: + def _parse_user_sms_number_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) user_sms_number_id = _parse_user_sms_number_id(d.pop("user_sms_number_id", UNSET)) - def _parse_user_device_id(data: object) -> None | str | Unset: + def _parse_user_device_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) user_device_id = _parse_user_device_id(d.pop("user_device_id", UNSET)) + enabled_contact_types = [] _enabled_contact_types = d.pop("enabled_contact_types", UNSET) - enabled_contact_types: list[UserNotificationRuleEnabledContactTypesItem] | Unset = UNSET - if _enabled_contact_types is not UNSET: - enabled_contact_types = [] - for enabled_contact_types_item_data in _enabled_contact_types: - enabled_contact_types_item = check_user_notification_rule_enabled_contact_types_item( - enabled_contact_types_item_data - ) + for enabled_contact_types_item_data in _enabled_contact_types or []: + enabled_contact_types_item = check_user_notification_rule_enabled_contact_types_item( + enabled_contact_types_item_data + ) - enabled_contact_types.append(enabled_contact_types_item) + enabled_contact_types.append(enabled_contact_types_item) _notification_type = d.pop("notification_type", UNSET) - notification_type: UserNotificationRuleNotificationType | Unset + notification_type: Union[Unset, UserNotificationRuleNotificationType] if isinstance(_notification_type, Unset): notification_type = UNSET else: diff --git a/rootly_sdk/models/user_notification_rule_enabled_contact_types_item.py b/rootly_sdk/models/user_notification_rule_enabled_contact_types_item.py index 4858502c..0b4a4f5a 100644 --- a/rootly_sdk/models/user_notification_rule_enabled_contact_types_item.py +++ b/rootly_sdk/models/user_notification_rule_enabled_contact_types_item.py @@ -1,7 +1,7 @@ from typing import Literal, cast UserNotificationRuleEnabledContactTypesItem = Literal[ - "call", "device", "email", "google_chat", "non_critical_device", "slack", "sms" + "call", "device", "email", "google_chat", "microsoft_teams", "non_critical_device", "slack", "sms" ] USER_NOTIFICATION_RULE_ENABLED_CONTACT_TYPES_ITEM_VALUES: set[UserNotificationRuleEnabledContactTypesItem] = { @@ -9,6 +9,7 @@ "device", "email", "google_chat", + "microsoft_teams", "non_critical_device", "slack", "sms", diff --git a/rootly_sdk/models/user_notification_rule_list.py b/rootly_sdk/models/user_notification_rule_list.py index 5d45a1b1..e173dd80 100644 --- a/rootly_sdk/models/user_notification_rule_list.py +++ b/rootly_sdk/models/user_notification_rule_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,20 +20,19 @@ class UserNotificationRuleList: """ Attributes: - data (list[UserNotificationRuleListDataItem]): + data (list['UserNotificationRuleListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[UserNotificationRuleListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["UserNotificationRuleListDataItem"] + links: "Links" + meta: "Meta" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) user_notification_rule_list = cls( data=data, diff --git a/rootly_sdk/models/user_notification_rule_list_data_item.py b/rootly_sdk/models/user_notification_rule_list_data_item.py index a31d183a..cf65d0b1 100644 --- a/rootly_sdk/models/user_notification_rule_list_data_item.py +++ b/rootly_sdk/models/user_notification_rule_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class UserNotificationRuleListDataItem: id: str type_: UserNotificationRuleListDataItemType - attributes: UserNotificationRule + attributes: "UserNotificationRule" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/user_notification_rule_response.py b/rootly_sdk/models/user_notification_rule_response.py index d84b742e..cbdce3c5 100644 --- a/rootly_sdk/models/user_notification_rule_response.py +++ b/rootly_sdk/models/user_notification_rule_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,18 +19,17 @@ class UserNotificationRuleResponse: """ Attributes: data (UserNotificationRuleResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: UserNotificationRuleResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "UserNotificationRuleResponseData" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = UserNotificationRuleResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) user_notification_rule_response = cls( data=data, diff --git a/rootly_sdk/models/user_notification_rule_response_data.py b/rootly_sdk/models/user_notification_rule_response_data.py index 76739bf0..962221fd 100644 --- a/rootly_sdk/models/user_notification_rule_response_data.py +++ b/rootly_sdk/models/user_notification_rule_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class UserNotificationRuleResponseData: id: str type_: UserNotificationRuleResponseDataType - attributes: UserNotificationRule + attributes: "UserNotificationRule" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/user_phone_number.py b/rootly_sdk/models/user_phone_number.py index 56225020..8ef80129 100644 --- a/rootly_sdk/models/user_phone_number.py +++ b/rootly_sdk/models/user_phone_number.py @@ -1,8 +1,6 @@ -from __future__ import annotations - import datetime from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,22 +15,22 @@ class UserPhoneNumber: """ Attributes: - user_id (int | Unset): - phone (str | Unset): Phone number in international format - primary (bool | Unset): Whether this is the primary phone number - verified_at (datetime.datetime | None | Unset): Date when phone number was verified - verification_attempts_today (int | Unset): Number of verification attempts made today - created_at (str | Unset): Date of creation - updated_at (str | Unset): Date of last update + user_id (Union[Unset, int]): + phone (Union[Unset, str]): Phone number in international format + primary (Union[Unset, bool]): Whether this is the primary phone number + verified_at (Union[None, Unset, datetime.datetime]): Date when phone number was verified + verification_attempts_today (Union[Unset, int]): Number of verification attempts made today + created_at (Union[Unset, str]): Date of creation + updated_at (Union[Unset, str]): Date of last update """ - user_id: int | Unset = UNSET - phone: str | Unset = UNSET - primary: bool | Unset = UNSET - verified_at: datetime.datetime | None | Unset = UNSET - verification_attempts_today: int | Unset = UNSET - created_at: str | Unset = UNSET - updated_at: str | Unset = UNSET + user_id: Union[Unset, int] = UNSET + phone: Union[Unset, str] = UNSET + primary: Union[Unset, bool] = UNSET + verified_at: Union[None, Unset, datetime.datetime] = UNSET + verification_attempts_today: Union[Unset, int] = UNSET + created_at: Union[Unset, str] = UNSET + updated_at: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +40,7 @@ def to_dict(self) -> dict[str, Any]: primary = self.primary - verified_at: None | str | Unset + verified_at: Union[None, Unset, str] if isinstance(self.verified_at, Unset): verified_at = UNSET elif isinstance(self.verified_at, datetime.datetime): @@ -85,7 +83,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: primary = d.pop("primary", UNSET) - def _parse_verified_at(data: object) -> datetime.datetime | None | Unset: + def _parse_verified_at(data: object) -> Union[None, Unset, datetime.datetime]: if data is None: return data if isinstance(data, Unset): @@ -96,9 +94,9 @@ def _parse_verified_at(data: object) -> datetime.datetime | None | Unset: verified_at_type_0 = isoparse(data) return verified_at_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(datetime.datetime | None | Unset, data) + return cast(Union[None, Unset, datetime.datetime], data) verified_at = _parse_verified_at(d.pop("verified_at", UNSET)) diff --git a/rootly_sdk/models/user_phone_number_list.py b/rootly_sdk/models/user_phone_number_list.py index 862069a5..033976d2 100644 --- a/rootly_sdk/models/user_phone_number_list.py +++ b/rootly_sdk/models/user_phone_number_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,20 +20,19 @@ class UserPhoneNumberList: """ Attributes: - data (list[UserPhoneNumberListDataItem]): + data (list['UserPhoneNumberListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[UserPhoneNumberListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["UserPhoneNumberListDataItem"] + links: "Links" + meta: "Meta" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) user_phone_number_list = cls( data=data, diff --git a/rootly_sdk/models/user_phone_number_list_data_item.py b/rootly_sdk/models/user_phone_number_list_data_item.py index 5fec150d..d8e9ce4c 100644 --- a/rootly_sdk/models/user_phone_number_list_data_item.py +++ b/rootly_sdk/models/user_phone_number_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class UserPhoneNumberListDataItem: id: str type_: UserPhoneNumberListDataItemType - attributes: UserPhoneNumber + attributes: "UserPhoneNumber" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/user_phone_number_response.py b/rootly_sdk/models/user_phone_number_response.py index e4451cf2..2fba80f8 100644 --- a/rootly_sdk/models/user_phone_number_response.py +++ b/rootly_sdk/models/user_phone_number_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,18 +19,17 @@ class UserPhoneNumberResponse: """ Attributes: data (UserPhoneNumberResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: UserPhoneNumberResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "UserPhoneNumberResponseData" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = UserPhoneNumberResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) user_phone_number_response = cls( data=data, diff --git a/rootly_sdk/models/user_phone_number_response_data.py b/rootly_sdk/models/user_phone_number_response_data.py index e8a248ba..4fcbf23a 100644 --- a/rootly_sdk/models/user_phone_number_response_data.py +++ b/rootly_sdk/models/user_phone_number_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class UserPhoneNumberResponseData: id: str type_: UserPhoneNumberResponseDataType - attributes: UserPhoneNumber + attributes: "UserPhoneNumber" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/user_relationships.py b/rootly_sdk/models/user_relationships.py index 1b6cfd67..4ae2784b 100644 --- a/rootly_sdk/models/user_relationships.py +++ b/rootly_sdk/models/user_relationships.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -20,21 +18,20 @@ class UserRelationships: """ Attributes: - role (RoleRelationship | Unset): - on_call_role (OnCallRoleRelationship | Unset): + role (Union[Unset, RoleRelationship]): + on_call_role (Union[Unset, OnCallRoleRelationship]): """ - role: RoleRelationship | Unset = UNSET - on_call_role: OnCallRoleRelationship | Unset = UNSET + role: Union[Unset, "RoleRelationship"] = UNSET + on_call_role: Union[Unset, "OnCallRoleRelationship"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - - role: dict[str, Any] | Unset = UNSET + role: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.role, Unset): role = self.role.to_dict() - on_call_role: dict[str, Any] | Unset = UNSET + on_call_role: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.on_call_role, Unset): on_call_role = self.on_call_role.to_dict() @@ -55,14 +52,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _role = d.pop("role", UNSET) - role: RoleRelationship | Unset + role: Union[Unset, RoleRelationship] if isinstance(_role, Unset): role = UNSET else: role = RoleRelationship.from_dict(_role) _on_call_role = d.pop("on_call_role", UNSET) - on_call_role: OnCallRoleRelationship | Unset + on_call_role: Union[Unset, OnCallRoleRelationship] if isinstance(_on_call_role, Unset): on_call_role = UNSET else: diff --git a/rootly_sdk/models/user_response.py b/rootly_sdk/models/user_response.py index e0c5a147..519893b0 100644 --- a/rootly_sdk/models/user_response.py +++ b/rootly_sdk/models/user_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,18 +19,17 @@ class UserResponse: """ Attributes: data (UserResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: UserResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "UserResponseData" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = UserResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) user_response = cls( data=data, diff --git a/rootly_sdk/models/user_response_data.py b/rootly_sdk/models/user_response_data.py index 483c1d26..eb26b052 100644 --- a/rootly_sdk/models/user_response_data.py +++ b/rootly_sdk/models/user_response_data.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -24,24 +22,23 @@ class UserResponseData: id (str): Unique ID of the user type_ (UserResponseDataType): attributes (User): - relationships (UserRelationships | Unset): + relationships (Union[Unset, UserRelationships]): """ id: str type_: UserResponseDataType - attributes: User - relationships: UserRelationships | Unset = UNSET + attributes: "User" + relationships: Union[Unset, "UserRelationships"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ attributes = self.attributes.to_dict() - relationships: dict[str, Any] | Unset = UNSET + relationships: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.relationships, Unset): relationships = self.relationships.to_dict() @@ -72,7 +69,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = User.from_dict(d.pop("attributes")) _relationships = d.pop("relationships", UNSET) - relationships: UserRelationships | Unset + relationships: Union[Unset, UserRelationships] if isinstance(_relationships, Unset): relationships = UNSET else: diff --git a/rootly_sdk/models/verified_domain.py b/rootly_sdk/models/verified_domain.py new file mode 100644 index 00000000..4246f8b7 --- /dev/null +++ b/rootly_sdk/models/verified_domain.py @@ -0,0 +1,199 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.verified_domain_source import VerifiedDomainSource, check_verified_domain_source +from ..models.verified_domain_verification_status import ( + VerifiedDomainVerificationStatus, + check_verified_domain_verification_status, +) +from ..types import UNSET, Unset + +T = TypeVar("T", bound="VerifiedDomain") + + +@_attrs_define +class VerifiedDomain: + """ + Attributes: + domain (str): The domain name + verification_status (VerifiedDomainVerificationStatus): Verification status + verification_token (str): The verification token + txt_host (str): The TXT record hostname to add + txt_value (str): The TXT record value to add + created_at (str): Date of creation + updated_at (str): Date of last update + verified_at (Union[None, Unset, str]): When the domain was first verified + last_checked_at (Union[None, Unset, str]): When the domain was last checked + last_check_passed_at (Union[None, Unset, str]): When the TXT record was last found + check_failures_count (Union[Unset, int]): Number of consecutive check failures + source (Union[Unset, VerifiedDomainSource]): How the domain was added + """ + + domain: str + verification_status: VerifiedDomainVerificationStatus + verification_token: str + txt_host: str + txt_value: str + created_at: str + updated_at: str + verified_at: Union[None, Unset, str] = UNSET + last_checked_at: Union[None, Unset, str] = UNSET + last_check_passed_at: Union[None, Unset, str] = UNSET + check_failures_count: Union[Unset, int] = UNSET + source: Union[Unset, VerifiedDomainSource] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + domain = self.domain + + verification_status: str = self.verification_status + + verification_token = self.verification_token + + txt_host = self.txt_host + + txt_value = self.txt_value + + created_at = self.created_at + + updated_at = self.updated_at + + verified_at: Union[None, Unset, str] + if isinstance(self.verified_at, Unset): + verified_at = UNSET + else: + verified_at = self.verified_at + + last_checked_at: Union[None, Unset, str] + if isinstance(self.last_checked_at, Unset): + last_checked_at = UNSET + else: + last_checked_at = self.last_checked_at + + last_check_passed_at: Union[None, Unset, str] + if isinstance(self.last_check_passed_at, Unset): + last_check_passed_at = UNSET + else: + last_check_passed_at = self.last_check_passed_at + + check_failures_count = self.check_failures_count + + source: Union[Unset, str] = UNSET + if not isinstance(self.source, Unset): + source = self.source + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "domain": domain, + "verification_status": verification_status, + "verification_token": verification_token, + "txt_host": txt_host, + "txt_value": txt_value, + "created_at": created_at, + "updated_at": updated_at, + } + ) + if verified_at is not UNSET: + field_dict["verified_at"] = verified_at + if last_checked_at is not UNSET: + field_dict["last_checked_at"] = last_checked_at + if last_check_passed_at is not UNSET: + field_dict["last_check_passed_at"] = last_check_passed_at + if check_failures_count is not UNSET: + field_dict["check_failures_count"] = check_failures_count + if source is not UNSET: + field_dict["source"] = source + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + domain = d.pop("domain") + + verification_status = check_verified_domain_verification_status(d.pop("verification_status")) + + verification_token = d.pop("verification_token") + + txt_host = d.pop("txt_host") + + txt_value = d.pop("txt_value") + + created_at = d.pop("created_at") + + updated_at = d.pop("updated_at") + + def _parse_verified_at(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + verified_at = _parse_verified_at(d.pop("verified_at", UNSET)) + + def _parse_last_checked_at(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + last_checked_at = _parse_last_checked_at(d.pop("last_checked_at", UNSET)) + + def _parse_last_check_passed_at(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + last_check_passed_at = _parse_last_check_passed_at(d.pop("last_check_passed_at", UNSET)) + + check_failures_count = d.pop("check_failures_count", UNSET) + + _source = d.pop("source", UNSET) + source: Union[Unset, VerifiedDomainSource] + if isinstance(_source, Unset): + source = UNSET + else: + source = check_verified_domain_source(_source) + + verified_domain = cls( + domain=domain, + verification_status=verification_status, + verification_token=verification_token, + txt_host=txt_host, + txt_value=txt_value, + created_at=created_at, + updated_at=updated_at, + verified_at=verified_at, + last_checked_at=last_checked_at, + last_check_passed_at=last_check_passed_at, + check_failures_count=check_failures_count, + source=source, + ) + + verified_domain.additional_properties = d + return verified_domain + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/rootly_sdk/models/verified_domain_list.py b/rootly_sdk/models/verified_domain_list.py new file mode 100644 index 00000000..55b8aa5c --- /dev/null +++ b/rootly_sdk/models/verified_domain_list.py @@ -0,0 +1,116 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.jsonapi_included_resource import JsonapiIncludedResource + from ..models.links import Links + from ..models.meta import Meta + from ..models.verified_domain_list_data_item import VerifiedDomainListDataItem + + +T = TypeVar("T", bound="VerifiedDomainList") + + +@_attrs_define +class VerifiedDomainList: + """ + Attributes: + data (list['VerifiedDomainListDataItem']): + links (Links): + meta (Meta): + included (Union[Unset, list['JsonapiIncludedResource']]): + """ + + data: list["VerifiedDomainListDataItem"] + links: "Links" + meta: "Meta" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + data = [] + for data_item_data in self.data: + data_item = data_item_data.to_dict() + data.append(data_item) + + links = self.links.to_dict() + + meta = self.meta.to_dict() + + included: Union[Unset, list[dict[str, Any]]] = UNSET + if not isinstance(self.included, Unset): + included = [] + for included_item_data in self.included: + included_item = included_item_data.to_dict() + included.append(included_item) + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "data": data, + "links": links, + "meta": meta, + } + ) + if included is not UNSET: + field_dict["included"] = included + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.jsonapi_included_resource import JsonapiIncludedResource + from ..models.links import Links + from ..models.meta import Meta + from ..models.verified_domain_list_data_item import VerifiedDomainListDataItem + + d = dict(src_dict) + data = [] + _data = d.pop("data") + for data_item_data in _data: + data_item = VerifiedDomainListDataItem.from_dict(data_item_data) + + data.append(data_item) + + links = Links.from_dict(d.pop("links")) + + meta = Meta.from_dict(d.pop("meta")) + + included = [] + _included = d.pop("included", UNSET) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) + + included.append(included_item) + + verified_domain_list = cls( + data=data, + links=links, + meta=meta, + included=included, + ) + + verified_domain_list.additional_properties = d + return verified_domain_list + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/rootly_sdk/models/verified_domain_list_data_item.py b/rootly_sdk/models/verified_domain_list_data_item.py new file mode 100644 index 00000000..49509fa3 --- /dev/null +++ b/rootly_sdk/models/verified_domain_list_data_item.py @@ -0,0 +1,86 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.verified_domain_list_data_item_type import ( + VerifiedDomainListDataItemType, + check_verified_domain_list_data_item_type, +) + +if TYPE_CHECKING: + from ..models.verified_domain import VerifiedDomain + + +T = TypeVar("T", bound="VerifiedDomainListDataItem") + + +@_attrs_define +class VerifiedDomainListDataItem: + """ + Attributes: + id (str): Unique ID of the verified domain + type_ (VerifiedDomainListDataItemType): + attributes (VerifiedDomain): + """ + + id: str + type_: VerifiedDomainListDataItemType + attributes: "VerifiedDomain" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + type_: str = self.type_ + + attributes = self.attributes.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "type": type_, + "attributes": attributes, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.verified_domain import VerifiedDomain + + d = dict(src_dict) + id = d.pop("id") + + type_ = check_verified_domain_list_data_item_type(d.pop("type")) + + attributes = VerifiedDomain.from_dict(d.pop("attributes")) + + verified_domain_list_data_item = cls( + id=id, + type_=type_, + attributes=attributes, + ) + + verified_domain_list_data_item.additional_properties = d + return verified_domain_list_data_item + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/rootly_sdk/models/verified_domain_list_data_item_type.py b/rootly_sdk/models/verified_domain_list_data_item_type.py new file mode 100644 index 00000000..b2f2b033 --- /dev/null +++ b/rootly_sdk/models/verified_domain_list_data_item_type.py @@ -0,0 +1,15 @@ +from typing import Literal, cast + +VerifiedDomainListDataItemType = Literal["verified_domains"] + +VERIFIED_DOMAIN_LIST_DATA_ITEM_TYPE_VALUES: set[VerifiedDomainListDataItemType] = { + "verified_domains", +} + + +def check_verified_domain_list_data_item_type(value: str | None) -> VerifiedDomainListDataItemType | None: + if value is None: + return None + if value in VERIFIED_DOMAIN_LIST_DATA_ITEM_TYPE_VALUES: + return cast(VerifiedDomainListDataItemType, value) + raise TypeError(f"Unexpected value {value!r}. Expected one of {VERIFIED_DOMAIN_LIST_DATA_ITEM_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/verified_domain_response.py b/rootly_sdk/models/verified_domain_response.py new file mode 100644 index 00000000..9e345a3b --- /dev/null +++ b/rootly_sdk/models/verified_domain_response.py @@ -0,0 +1,88 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.jsonapi_included_resource import JsonapiIncludedResource + from ..models.verified_domain_response_data import VerifiedDomainResponseData + + +T = TypeVar("T", bound="VerifiedDomainResponse") + + +@_attrs_define +class VerifiedDomainResponse: + """ + Attributes: + data (VerifiedDomainResponseData): + included (Union[Unset, list['JsonapiIncludedResource']]): + """ + + data: "VerifiedDomainResponseData" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + data = self.data.to_dict() + + included: Union[Unset, list[dict[str, Any]]] = UNSET + if not isinstance(self.included, Unset): + included = [] + for included_item_data in self.included: + included_item = included_item_data.to_dict() + included.append(included_item) + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "data": data, + } + ) + if included is not UNSET: + field_dict["included"] = included + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.jsonapi_included_resource import JsonapiIncludedResource + from ..models.verified_domain_response_data import VerifiedDomainResponseData + + d = dict(src_dict) + data = VerifiedDomainResponseData.from_dict(d.pop("data")) + + included = [] + _included = d.pop("included", UNSET) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) + + included.append(included_item) + + verified_domain_response = cls( + data=data, + included=included, + ) + + verified_domain_response.additional_properties = d + return verified_domain_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/rootly_sdk/models/verified_domain_response_data.py b/rootly_sdk/models/verified_domain_response_data.py new file mode 100644 index 00000000..b5d30fa3 --- /dev/null +++ b/rootly_sdk/models/verified_domain_response_data.py @@ -0,0 +1,86 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.verified_domain_response_data_type import ( + VerifiedDomainResponseDataType, + check_verified_domain_response_data_type, +) + +if TYPE_CHECKING: + from ..models.verified_domain import VerifiedDomain + + +T = TypeVar("T", bound="VerifiedDomainResponseData") + + +@_attrs_define +class VerifiedDomainResponseData: + """ + Attributes: + id (str): Unique ID of the verified domain + type_ (VerifiedDomainResponseDataType): + attributes (VerifiedDomain): + """ + + id: str + type_: VerifiedDomainResponseDataType + attributes: "VerifiedDomain" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + type_: str = self.type_ + + attributes = self.attributes.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "type": type_, + "attributes": attributes, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.verified_domain import VerifiedDomain + + d = dict(src_dict) + id = d.pop("id") + + type_ = check_verified_domain_response_data_type(d.pop("type")) + + attributes = VerifiedDomain.from_dict(d.pop("attributes")) + + verified_domain_response_data = cls( + id=id, + type_=type_, + attributes=attributes, + ) + + verified_domain_response_data.additional_properties = d + return verified_domain_response_data + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/rootly_sdk/models/verified_domain_response_data_type.py b/rootly_sdk/models/verified_domain_response_data_type.py new file mode 100644 index 00000000..a7b6e33d --- /dev/null +++ b/rootly_sdk/models/verified_domain_response_data_type.py @@ -0,0 +1,15 @@ +from typing import Literal, cast + +VerifiedDomainResponseDataType = Literal["verified_domains"] + +VERIFIED_DOMAIN_RESPONSE_DATA_TYPE_VALUES: set[VerifiedDomainResponseDataType] = { + "verified_domains", +} + + +def check_verified_domain_response_data_type(value: str | None) -> VerifiedDomainResponseDataType | None: + if value is None: + return None + if value in VERIFIED_DOMAIN_RESPONSE_DATA_TYPE_VALUES: + return cast(VerifiedDomainResponseDataType, value) + raise TypeError(f"Unexpected value {value!r}. Expected one of {VERIFIED_DOMAIN_RESPONSE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/verified_domain_source.py b/rootly_sdk/models/verified_domain_source.py new file mode 100644 index 00000000..6f4b9879 --- /dev/null +++ b/rootly_sdk/models/verified_domain_source.py @@ -0,0 +1,17 @@ +from typing import Literal, cast + +VerifiedDomainSource = Literal["manual", "migration", "oauth_auto"] + +VERIFIED_DOMAIN_SOURCE_VALUES: set[VerifiedDomainSource] = { + "manual", + "migration", + "oauth_auto", +} + + +def check_verified_domain_source(value: str | None) -> VerifiedDomainSource | None: + if value is None: + return None + if value in VERIFIED_DOMAIN_SOURCE_VALUES: + return cast(VerifiedDomainSource, value) + raise TypeError(f"Unexpected value {value!r}. Expected one of {VERIFIED_DOMAIN_SOURCE_VALUES!r}") diff --git a/rootly_sdk/models/verified_domain_verification_status.py b/rootly_sdk/models/verified_domain_verification_status.py new file mode 100644 index 00000000..ea62937b --- /dev/null +++ b/rootly_sdk/models/verified_domain_verification_status.py @@ -0,0 +1,18 @@ +from typing import Literal, cast + +VerifiedDomainVerificationStatus = Literal["expired", "failing", "pending", "verified"] + +VERIFIED_DOMAIN_VERIFICATION_STATUS_VALUES: set[VerifiedDomainVerificationStatus] = { + "expired", + "failing", + "pending", + "verified", +} + + +def check_verified_domain_verification_status(value: str | None) -> VerifiedDomainVerificationStatus | None: + if value is None: + return None + if value in VERIFIED_DOMAIN_VERIFICATION_STATUS_VALUES: + return cast(VerifiedDomainVerificationStatus, value) + raise TypeError(f"Unexpected value {value!r}. Expected one of {VERIFIED_DOMAIN_VERIFICATION_STATUS_VALUES!r}") diff --git a/rootly_sdk/models/verify_phone_number_request.py b/rootly_sdk/models/verify_phone_number_request.py index 0a2aa912..af4fd0ef 100644 --- a/rootly_sdk/models/verify_phone_number_request.py +++ b/rootly_sdk/models/verify_phone_number_request.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/webhooks_delivery.py b/rootly_sdk/models/webhooks_delivery.py index 82c25bb5..191854a4 100644 --- a/rootly_sdk/models/webhooks_delivery.py +++ b/rootly_sdk/models/webhooks_delivery.py @@ -1,11 +1,11 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field +from ..models.webhooks_delivery_status import WebhooksDeliveryStatus, check_webhooks_delivery_status + T = TypeVar("T", bound="WebhooksDelivery") @@ -15,14 +15,20 @@ class WebhooksDelivery: Attributes: endpoint_id (str): payload (str): - delivered_at (None | str): + status (WebhooksDeliveryStatus): Delivery status + response_status (Union[None, int]): HTTP status code recorded for the delivery attempt. It is null before the + first attempt. For SSRF and transport failures, Rootly generates this code because no destination response was + received. + delivered_at (Union[None, str]): created_at (str): Date of creation updated_at (str): Date of last update """ endpoint_id: str payload: str - delivered_at: None | str + status: WebhooksDeliveryStatus + response_status: Union[None, int] + delivered_at: Union[None, str] created_at: str updated_at: str additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -32,7 +38,12 @@ def to_dict(self) -> dict[str, Any]: payload = self.payload - delivered_at: None | str + status: str = self.status + + response_status: Union[None, int] + response_status = self.response_status + + delivered_at: Union[None, str] delivered_at = self.delivered_at created_at = self.created_at @@ -45,6 +56,8 @@ def to_dict(self) -> dict[str, Any]: { "endpoint_id": endpoint_id, "payload": payload, + "status": status, + "response_status": response_status, "delivered_at": delivered_at, "created_at": created_at, "updated_at": updated_at, @@ -60,10 +73,19 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: payload = d.pop("payload") - def _parse_delivered_at(data: object) -> None | str: + status = check_webhooks_delivery_status(d.pop("status")) + + def _parse_response_status(data: object) -> Union[None, int]: + if data is None: + return data + return cast(Union[None, int], data) + + response_status = _parse_response_status(d.pop("response_status")) + + def _parse_delivered_at(data: object) -> Union[None, str]: if data is None: return data - return cast(None | str, data) + return cast(Union[None, str], data) delivered_at = _parse_delivered_at(d.pop("delivered_at")) @@ -74,6 +96,8 @@ def _parse_delivered_at(data: object) -> None | str: webhooks_delivery = cls( endpoint_id=endpoint_id, payload=payload, + status=status, + response_status=response_status, delivered_at=delivered_at, created_at=created_at, updated_at=updated_at, diff --git a/rootly_sdk/models/webhooks_delivery_list.py b/rootly_sdk/models/webhooks_delivery_list.py index a059491e..1817efc8 100644 --- a/rootly_sdk/models/webhooks_delivery_list.py +++ b/rootly_sdk/models/webhooks_delivery_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,34 +20,33 @@ class WebhooksDeliveryList: """ Attributes: - data (list[WebhooksDeliveryListDataItem]): - links (Links | Unset): - meta (Meta | Unset): - included (list[JsonapiIncludedResource] | Unset): + data (list['WebhooksDeliveryListDataItem']): + links (Union[Unset, Links]): + meta (Union[Unset, Meta]): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[WebhooksDeliveryListDataItem] - links: Links | Unset = UNSET - meta: Meta | Unset = UNSET - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["WebhooksDeliveryListDataItem"] + links: Union[Unset, "Links"] = UNSET + meta: Union[Unset, "Meta"] = UNSET + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() data.append(data_item) - links: dict[str, Any] | Unset = UNSET + links: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.links, Unset): links = self.links.to_dict() - meta: dict[str, Any] | Unset = UNSET + meta: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.meta, Unset): meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -88,27 +85,25 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data.append(data_item) _links = d.pop("links", UNSET) - links: Links | Unset + links: Union[Unset, Links] if isinstance(_links, Unset): links = UNSET else: links = Links.from_dict(_links) _meta = d.pop("meta", UNSET) - meta: Meta | Unset + meta: Union[Unset, Meta] if isinstance(_meta, Unset): meta = UNSET else: meta = Meta.from_dict(_meta) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) webhooks_delivery_list = cls( data=data, diff --git a/rootly_sdk/models/webhooks_delivery_list_data_item.py b/rootly_sdk/models/webhooks_delivery_list_data_item.py index 0cbb26a3..28e9bcf7 100644 --- a/rootly_sdk/models/webhooks_delivery_list_data_item.py +++ b/rootly_sdk/models/webhooks_delivery_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class WebhooksDeliveryListDataItem: id: str type_: WebhooksDeliveryListDataItemType - attributes: WebhooksDelivery + attributes: "WebhooksDelivery" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/webhooks_delivery_response.py b/rootly_sdk/models/webhooks_delivery_response.py index f75bc185..21193c2a 100644 --- a/rootly_sdk/models/webhooks_delivery_response.py +++ b/rootly_sdk/models/webhooks_delivery_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,18 +19,17 @@ class WebhooksDeliveryResponse: """ Attributes: data (WebhooksDeliveryResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: WebhooksDeliveryResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "WebhooksDeliveryResponseData" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = WebhooksDeliveryResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) webhooks_delivery_response = cls( data=data, diff --git a/rootly_sdk/models/webhooks_delivery_response_data.py b/rootly_sdk/models/webhooks_delivery_response_data.py index d4c4ca28..e08e14af 100644 --- a/rootly_sdk/models/webhooks_delivery_response_data.py +++ b/rootly_sdk/models/webhooks_delivery_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class WebhooksDeliveryResponseData: id: str type_: WebhooksDeliveryResponseDataType - attributes: WebhooksDelivery + attributes: "WebhooksDelivery" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/webhooks_delivery_status.py b/rootly_sdk/models/webhooks_delivery_status.py new file mode 100644 index 00000000..577e3d3a --- /dev/null +++ b/rootly_sdk/models/webhooks_delivery_status.py @@ -0,0 +1,17 @@ +from typing import Literal, cast + +WebhooksDeliveryStatus = Literal["failed", "pending", "success"] + +WEBHOOKS_DELIVERY_STATUS_VALUES: set[WebhooksDeliveryStatus] = { + "failed", + "pending", + "success", +} + + +def check_webhooks_delivery_status(value: str | None) -> WebhooksDeliveryStatus | None: + if value is None: + return None + if value in WEBHOOKS_DELIVERY_STATUS_VALUES: + return cast(WebhooksDeliveryStatus, value) + raise TypeError(f"Unexpected value {value!r}. Expected one of {WEBHOOKS_DELIVERY_STATUS_VALUES!r}") diff --git a/rootly_sdk/models/webhooks_endpoint.py b/rootly_sdk/models/webhooks_endpoint.py index 54589ce4..db31f9a3 100644 --- a/rootly_sdk/models/webhooks_endpoint.py +++ b/rootly_sdk/models/webhooks_endpoint.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -30,9 +28,9 @@ class WebhooksEndpoint: enabled (bool): created_at (str): Date of creation updated_at (str): Date of last update - slug (str | Unset): The slug of the endpoint - custom_headers (list[WebhooksEndpointCustomHeadersItem] | Unset): Custom HTTP headers sent with each delivery. - Max 10. Reserved names (Content-Type, X-Rootly-Signature, Host, etc.) are rejected. + slug (Union[Unset, str]): The slug of the endpoint + custom_headers (Union[Unset, list['WebhooksEndpointCustomHeadersItem']]): Custom HTTP headers sent with each + delivery. Max 10. Reserved names (Content-Type, X-Rootly-Signature, Host, etc.) are rejected. """ name: str @@ -42,12 +40,11 @@ class WebhooksEndpoint: enabled: bool created_at: str updated_at: str - slug: str | Unset = UNSET - custom_headers: list[WebhooksEndpointCustomHeadersItem] | Unset = UNSET + slug: Union[Unset, str] = UNSET + custom_headers: Union[Unset, list["WebhooksEndpointCustomHeadersItem"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - name = self.name url = self.url @@ -67,7 +64,7 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - custom_headers: list[dict[str, Any]] | Unset = UNSET + custom_headers: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.custom_headers, Unset): custom_headers = [] for custom_headers_item_data in self.custom_headers: @@ -120,14 +117,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: slug = d.pop("slug", UNSET) + custom_headers = [] _custom_headers = d.pop("custom_headers", UNSET) - custom_headers: list[WebhooksEndpointCustomHeadersItem] | Unset = UNSET - if _custom_headers is not UNSET: - custom_headers = [] - for custom_headers_item_data in _custom_headers: - custom_headers_item = WebhooksEndpointCustomHeadersItem.from_dict(custom_headers_item_data) + for custom_headers_item_data in _custom_headers or []: + custom_headers_item = WebhooksEndpointCustomHeadersItem.from_dict(custom_headers_item_data) - custom_headers.append(custom_headers_item) + custom_headers.append(custom_headers_item) webhooks_endpoint = cls( name=name, diff --git a/rootly_sdk/models/webhooks_endpoint_custom_headers_item.py b/rootly_sdk/models/webhooks_endpoint_custom_headers_item.py index 4dc7a532..40958b3c 100644 --- a/rootly_sdk/models/webhooks_endpoint_custom_headers_item.py +++ b/rootly_sdk/models/webhooks_endpoint_custom_headers_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/webhooks_endpoint_event_types_item.py b/rootly_sdk/models/webhooks_endpoint_event_types_item.py index 8c8f32c8..f4256cf0 100644 --- a/rootly_sdk/models/webhooks_endpoint_event_types_item.py +++ b/rootly_sdk/models/webhooks_endpoint_event_types_item.py @@ -2,6 +2,7 @@ WebhooksEndpointEventTypesItem = Literal[ "alert.created", + "alert.updated", "audit_log.created", "genius_workflow_run.canceled", "genius_workflow_run.completed", @@ -36,6 +37,7 @@ WEBHOOKS_ENDPOINT_EVENT_TYPES_ITEM_VALUES: set[WebhooksEndpointEventTypesItem] = { "alert.created", + "alert.updated", "audit_log.created", "genius_workflow_run.canceled", "genius_workflow_run.completed", diff --git a/rootly_sdk/models/webhooks_endpoint_list.py b/rootly_sdk/models/webhooks_endpoint_list.py index 7948809d..3d1995b2 100644 --- a/rootly_sdk/models/webhooks_endpoint_list.py +++ b/rootly_sdk/models/webhooks_endpoint_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,34 +20,33 @@ class WebhooksEndpointList: """ Attributes: - data (list[WebhooksEndpointListDataItem]): - links (Links | Unset): - meta (Meta | Unset): - included (list[JsonapiIncludedResource] | Unset): + data (list['WebhooksEndpointListDataItem']): + links (Union[Unset, Links]): + meta (Union[Unset, Meta]): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[WebhooksEndpointListDataItem] - links: Links | Unset = UNSET - meta: Meta | Unset = UNSET - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["WebhooksEndpointListDataItem"] + links: Union[Unset, "Links"] = UNSET + meta: Union[Unset, "Meta"] = UNSET + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() data.append(data_item) - links: dict[str, Any] | Unset = UNSET + links: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.links, Unset): links = self.links.to_dict() - meta: dict[str, Any] | Unset = UNSET + meta: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.meta, Unset): meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -88,27 +85,25 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data.append(data_item) _links = d.pop("links", UNSET) - links: Links | Unset + links: Union[Unset, Links] if isinstance(_links, Unset): links = UNSET else: links = Links.from_dict(_links) _meta = d.pop("meta", UNSET) - meta: Meta | Unset + meta: Union[Unset, Meta] if isinstance(_meta, Unset): meta = UNSET else: meta = Meta.from_dict(_meta) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) webhooks_endpoint_list = cls( data=data, diff --git a/rootly_sdk/models/webhooks_endpoint_list_data_item.py b/rootly_sdk/models/webhooks_endpoint_list_data_item.py index c3c181eb..cc5bce1c 100644 --- a/rootly_sdk/models/webhooks_endpoint_list_data_item.py +++ b/rootly_sdk/models/webhooks_endpoint_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class WebhooksEndpointListDataItem: id: str type_: WebhooksEndpointListDataItemType - attributes: WebhooksEndpoint + attributes: "WebhooksEndpoint" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/webhooks_endpoint_response.py b/rootly_sdk/models/webhooks_endpoint_response.py index 0b880393..a8b3cf62 100644 --- a/rootly_sdk/models/webhooks_endpoint_response.py +++ b/rootly_sdk/models/webhooks_endpoint_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,18 +19,17 @@ class WebhooksEndpointResponse: """ Attributes: data (WebhooksEndpointResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: WebhooksEndpointResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "WebhooksEndpointResponseData" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = WebhooksEndpointResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) webhooks_endpoint_response = cls( data=data, diff --git a/rootly_sdk/models/webhooks_endpoint_response_data.py b/rootly_sdk/models/webhooks_endpoint_response_data.py index d3e2828f..d86d8e51 100644 --- a/rootly_sdk/models/webhooks_endpoint_response_data.py +++ b/rootly_sdk/models/webhooks_endpoint_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class WebhooksEndpointResponseData: id: str type_: WebhooksEndpointResponseDataType - attributes: WebhooksEndpoint + attributes: "WebhooksEndpoint" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/workflow.py b/rootly_sdk/models/workflow.py index ee3acbe6..49fdb282 100644 --- a/rootly_sdk/models/workflow.py +++ b/rootly_sdk/models/workflow.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -27,71 +25,71 @@ class Workflow: name (str): The title of the workflow created_at (str): Date of creation updated_at (str): Date of last update - slug (str | Unset): The slug of the workflow - description (None | str | Unset): The description of the workflow - command (None | str | Unset): Workflow command - command_feedback_enabled (bool | None | Unset): This will notify you back when the workflow is starting - wait (None | str | Unset): Wait this duration before executing - repeat_every_duration (None | str | Unset): Repeat workflow every duration - repeat_condition_duration_since_first_run (None | str | Unset): The workflow will stop repeating if its runtime - since it's first workflow run exceeds the duration set in this field - repeat_condition_number_of_repeats (int | Unset): The workflow will stop repeating if the number of repeats - exceeds the value set in this field - continuously_repeat (bool | Unset): When continuously repeat is true, repeat workflows aren't automatically - stopped when conditions aren't met. This setting won't override your conditions set by + slug (Union[Unset, str]): The slug of the workflow + description (Union[None, Unset, str]): The description of the workflow + command (Union[None, Unset, str]): Workflow command + command_feedback_enabled (Union[None, Unset, bool]): This will notify you back when the workflow is starting + wait (Union[None, Unset, str]): Wait this duration before executing + repeat_every_duration (Union[None, Unset, str]): Repeat workflow every duration + repeat_condition_duration_since_first_run (Union[None, Unset, str]): The workflow will stop repeating if its + runtime since it's first workflow run exceeds the duration set in this field + repeat_condition_number_of_repeats (Union[Unset, int]): The workflow will stop repeating if the number of + repeats exceeds the value set in this field + continuously_repeat (Union[Unset, bool]): When continuously repeat is true, repeat workflows aren't + automatically stopped when conditions aren't met. This setting won't override your conditions set by repeat_condition_duration_since_first_run and repeat_condition_number_of_repeats parameters. - repeat_on (list[WorkflowRepeatOnType0Item] | None | Unset): - enabled (bool | Unset): - locked (bool | Unset): Restricts workflow edits to admins when turned on. Only admins can set this field. - position (int | Unset): The order which the workflow should run with other workflows. - workflow_group_id (None | str | Unset): The group this workflow belongs to. - trigger_params (ActionItemTriggerParams | AlertTriggerParams | IncidentTriggerParams | PulseTriggerParams | - SimpleTriggerParams | Unset): - environment_ids (list[str] | Unset): - severity_ids (list[str] | Unset): - incident_type_ids (list[str] | Unset): - incident_role_ids (list[str] | Unset): - service_ids (list[str] | Unset): - functionality_ids (list[str] | Unset): - group_ids (list[str] | Unset): - cause_ids (list[str] | Unset): - sub_status_ids (list[str] | Unset): + repeat_on (Union[None, Unset, list[WorkflowRepeatOnType0Item]]): + enabled (Union[Unset, bool]): + locked (Union[Unset, bool]): Restricts workflow edits to admins when turned on. Only admins can set this field. + position (Union[Unset, int]): The order which the workflow should run with other workflows. + workflow_group_id (Union[None, Unset, str]): The group this workflow belongs to. + trigger_params (Union['ActionItemTriggerParams', 'AlertTriggerParams', 'IncidentTriggerParams', + 'PulseTriggerParams', 'SimpleTriggerParams', Unset]): + environment_ids (Union[Unset, list[str]]): + severity_ids (Union[Unset, list[str]]): + incident_type_ids (Union[Unset, list[str]]): + incident_role_ids (Union[Unset, list[str]]): + service_ids (Union[Unset, list[str]]): + functionality_ids (Union[Unset, list[str]]): + group_ids (Union[Unset, list[str]]): + cause_ids (Union[Unset, list[str]]): + sub_status_ids (Union[Unset, list[str]]): """ name: str created_at: str updated_at: str - slug: str | Unset = UNSET - description: None | str | Unset = UNSET - command: None | str | Unset = UNSET - command_feedback_enabled: bool | None | Unset = UNSET - wait: None | str | Unset = UNSET - repeat_every_duration: None | str | Unset = UNSET - repeat_condition_duration_since_first_run: None | str | Unset = UNSET - repeat_condition_number_of_repeats: int | Unset = UNSET - continuously_repeat: bool | Unset = UNSET - repeat_on: list[WorkflowRepeatOnType0Item] | None | Unset = UNSET - enabled: bool | Unset = UNSET - locked: bool | Unset = UNSET - position: int | Unset = UNSET - workflow_group_id: None | str | Unset = UNSET - trigger_params: ( - ActionItemTriggerParams - | AlertTriggerParams - | IncidentTriggerParams - | PulseTriggerParams - | SimpleTriggerParams - | Unset - ) = UNSET - environment_ids: list[str] | Unset = UNSET - severity_ids: list[str] | Unset = UNSET - incident_type_ids: list[str] | Unset = UNSET - incident_role_ids: list[str] | Unset = UNSET - service_ids: list[str] | Unset = UNSET - functionality_ids: list[str] | Unset = UNSET - group_ids: list[str] | Unset = UNSET - cause_ids: list[str] | Unset = UNSET - sub_status_ids: list[str] | Unset = UNSET + slug: Union[Unset, str] = UNSET + description: Union[None, Unset, str] = UNSET + command: Union[None, Unset, str] = UNSET + command_feedback_enabled: Union[None, Unset, bool] = UNSET + wait: Union[None, Unset, str] = UNSET + repeat_every_duration: Union[None, Unset, str] = UNSET + repeat_condition_duration_since_first_run: Union[None, Unset, str] = UNSET + repeat_condition_number_of_repeats: Union[Unset, int] = UNSET + continuously_repeat: Union[Unset, bool] = UNSET + repeat_on: Union[None, Unset, list[WorkflowRepeatOnType0Item]] = UNSET + enabled: Union[Unset, bool] = UNSET + locked: Union[Unset, bool] = UNSET + position: Union[Unset, int] = UNSET + workflow_group_id: Union[None, Unset, str] = UNSET + trigger_params: Union[ + "ActionItemTriggerParams", + "AlertTriggerParams", + "IncidentTriggerParams", + "PulseTriggerParams", + "SimpleTriggerParams", + Unset, + ] = UNSET + environment_ids: Union[Unset, list[str]] = UNSET + severity_ids: Union[Unset, list[str]] = UNSET + incident_type_ids: Union[Unset, list[str]] = UNSET + incident_role_ids: Union[Unset, list[str]] = UNSET + service_ids: Union[Unset, list[str]] = UNSET + functionality_ids: Union[Unset, list[str]] = UNSET + group_ids: Union[Unset, list[str]] = UNSET + cause_ids: Union[Unset, list[str]] = UNSET + sub_status_ids: Union[Unset, list[str]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -108,37 +106,37 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - description: None | str | Unset + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: description = self.description - command: None | str | Unset + command: Union[None, Unset, str] if isinstance(self.command, Unset): command = UNSET else: command = self.command - command_feedback_enabled: bool | None | Unset + command_feedback_enabled: Union[None, Unset, bool] if isinstance(self.command_feedback_enabled, Unset): command_feedback_enabled = UNSET else: command_feedback_enabled = self.command_feedback_enabled - wait: None | str | Unset + wait: Union[None, Unset, str] if isinstance(self.wait, Unset): wait = UNSET else: wait = self.wait - repeat_every_duration: None | str | Unset + repeat_every_duration: Union[None, Unset, str] if isinstance(self.repeat_every_duration, Unset): repeat_every_duration = UNSET else: repeat_every_duration = self.repeat_every_duration - repeat_condition_duration_since_first_run: None | str | Unset + repeat_condition_duration_since_first_run: Union[None, Unset, str] if isinstance(self.repeat_condition_duration_since_first_run, Unset): repeat_condition_duration_since_first_run = UNSET else: @@ -148,7 +146,7 @@ def to_dict(self) -> dict[str, Any]: continuously_repeat = self.continuously_repeat - repeat_on: list[str] | None | Unset + repeat_on: Union[None, Unset, list[str]] if isinstance(self.repeat_on, Unset): repeat_on = UNSET elif isinstance(self.repeat_on, list): @@ -166,13 +164,13 @@ def to_dict(self) -> dict[str, Any]: position = self.position - workflow_group_id: None | str | Unset + workflow_group_id: Union[None, Unset, str] if isinstance(self.workflow_group_id, Unset): workflow_group_id = UNSET else: workflow_group_id = self.workflow_group_id - trigger_params: dict[str, Any] | Unset + trigger_params: Union[Unset, dict[str, Any]] if isinstance(self.trigger_params, Unset): trigger_params = UNSET elif isinstance(self.trigger_params, IncidentTriggerParams): @@ -186,39 +184,39 @@ def to_dict(self) -> dict[str, Any]: else: trigger_params = self.trigger_params.to_dict() - environment_ids: list[str] | Unset = UNSET + environment_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.environment_ids, Unset): environment_ids = self.environment_ids - severity_ids: list[str] | Unset = UNSET + severity_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.severity_ids, Unset): severity_ids = self.severity_ids - incident_type_ids: list[str] | Unset = UNSET + incident_type_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.incident_type_ids, Unset): incident_type_ids = self.incident_type_ids - incident_role_ids: list[str] | Unset = UNSET + incident_role_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.incident_role_ids, Unset): incident_role_ids = self.incident_role_ids - service_ids: list[str] | Unset = UNSET + service_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.service_ids, Unset): service_ids = self.service_ids - functionality_ids: list[str] | Unset = UNSET + functionality_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.functionality_ids, Unset): functionality_ids = self.functionality_ids - group_ids: list[str] | Unset = UNSET + group_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.group_ids, Unset): group_ids = self.group_ids - cause_ids: list[str] | Unset = UNSET + cause_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.cause_ids, Unset): cause_ids = self.cause_ids - sub_status_ids: list[str] | Unset = UNSET + sub_status_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.sub_status_ids, Unset): sub_status_ids = self.sub_status_ids @@ -299,57 +297,57 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: slug = d.pop("slug", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) - def _parse_command(data: object) -> None | str | Unset: + def _parse_command(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) command = _parse_command(d.pop("command", UNSET)) - def _parse_command_feedback_enabled(data: object) -> bool | None | Unset: + def _parse_command_feedback_enabled(data: object) -> Union[None, Unset, bool]: if data is None: return data if isinstance(data, Unset): return data - return cast(bool | None | Unset, data) + return cast(Union[None, Unset, bool], data) command_feedback_enabled = _parse_command_feedback_enabled(d.pop("command_feedback_enabled", UNSET)) - def _parse_wait(data: object) -> None | str | Unset: + def _parse_wait(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) wait = _parse_wait(d.pop("wait", UNSET)) - def _parse_repeat_every_duration(data: object) -> None | str | Unset: + def _parse_repeat_every_duration(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) repeat_every_duration = _parse_repeat_every_duration(d.pop("repeat_every_duration", UNSET)) - def _parse_repeat_condition_duration_since_first_run(data: object) -> None | str | Unset: + def _parse_repeat_condition_duration_since_first_run(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) repeat_condition_duration_since_first_run = _parse_repeat_condition_duration_since_first_run( d.pop("repeat_condition_duration_since_first_run", UNSET) @@ -359,7 +357,7 @@ def _parse_repeat_condition_duration_since_first_run(data: object) -> None | str continuously_repeat = d.pop("continuously_repeat", UNSET) - def _parse_repeat_on(data: object) -> list[WorkflowRepeatOnType0Item] | None | Unset: + def _parse_repeat_on(data: object) -> Union[None, Unset, list[WorkflowRepeatOnType0Item]]: if data is None: return data if isinstance(data, Unset): @@ -375,9 +373,9 @@ def _parse_repeat_on(data: object) -> list[WorkflowRepeatOnType0Item] | None | U repeat_on_type_0.append(repeat_on_type_0_item) return repeat_on_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass - return cast(list[WorkflowRepeatOnType0Item] | None | Unset, data) + return cast(Union[None, Unset, list[WorkflowRepeatOnType0Item]], data) repeat_on = _parse_repeat_on(d.pop("repeat_on", UNSET)) @@ -387,25 +385,25 @@ def _parse_repeat_on(data: object) -> list[WorkflowRepeatOnType0Item] | None | U position = d.pop("position", UNSET) - def _parse_workflow_group_id(data: object) -> None | str | Unset: + def _parse_workflow_group_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) workflow_group_id = _parse_workflow_group_id(d.pop("workflow_group_id", UNSET)) def _parse_trigger_params( data: object, - ) -> ( - ActionItemTriggerParams - | AlertTriggerParams - | IncidentTriggerParams - | PulseTriggerParams - | SimpleTriggerParams - | Unset - ): + ) -> Union[ + "ActionItemTriggerParams", + "AlertTriggerParams", + "IncidentTriggerParams", + "PulseTriggerParams", + "SimpleTriggerParams", + Unset, + ]: if isinstance(data, Unset): return data try: @@ -414,7 +412,7 @@ def _parse_trigger_params( trigger_params_type_0 = IncidentTriggerParams.from_dict(data) return trigger_params_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -422,7 +420,7 @@ def _parse_trigger_params( trigger_params_type_1 = ActionItemTriggerParams.from_dict(data) return trigger_params_type_1 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -430,7 +428,7 @@ def _parse_trigger_params( trigger_params_type_2 = AlertTriggerParams.from_dict(data) return trigger_params_type_2 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -438,7 +436,7 @@ def _parse_trigger_params( trigger_params_type_3 = PulseTriggerParams.from_dict(data) return trigger_params_type_3 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass if not isinstance(data, dict): raise TypeError() diff --git a/rootly_sdk/models/workflow_action_item_form_field_condition.py b/rootly_sdk/models/workflow_action_item_form_field_condition.py index 511e7fa5..52a437fe 100644 --- a/rootly_sdk/models/workflow_action_item_form_field_condition.py +++ b/rootly_sdk/models/workflow_action_item_form_field_condition.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -26,13 +24,13 @@ class WorkflowActionItemFormFieldCondition: selected_catalog_entity_ids (list[str]): selected_option_ids (list[str]): selected_user_ids (list[int]): - values (list[str] | Unset): - selected_functionality_ids (list[str] | Unset): - selected_group_ids (list[str] | Unset): - selected_service_ids (list[str] | Unset): - selected_cause_ids (list[str] | Unset): - selected_environment_ids (list[str] | Unset): - selected_incident_type_ids (list[str] | Unset): + values (Union[Unset, list[str]]): + selected_functionality_ids (Union[Unset, list[str]]): + selected_group_ids (Union[Unset, list[str]]): + selected_service_ids (Union[Unset, list[str]]): + selected_cause_ids (Union[Unset, list[str]]): + selected_environment_ids (Union[Unset, list[str]]): + selected_incident_type_ids (Union[Unset, list[str]]): """ workflow_id: str @@ -41,13 +39,13 @@ class WorkflowActionItemFormFieldCondition: selected_option_ids: list[str] selected_user_ids: list[int] action_item_condition: WorkflowActionItemFormFieldConditionActionItemCondition = "ANY" - values: list[str] | Unset = UNSET - selected_functionality_ids: list[str] | Unset = UNSET - selected_group_ids: list[str] | Unset = UNSET - selected_service_ids: list[str] | Unset = UNSET - selected_cause_ids: list[str] | Unset = UNSET - selected_environment_ids: list[str] | Unset = UNSET - selected_incident_type_ids: list[str] | Unset = UNSET + values: Union[Unset, list[str]] = UNSET + selected_functionality_ids: Union[Unset, list[str]] = UNSET + selected_group_ids: Union[Unset, list[str]] = UNSET + selected_service_ids: Union[Unset, list[str]] = UNSET + selected_cause_ids: Union[Unset, list[str]] = UNSET + selected_environment_ids: Union[Unset, list[str]] = UNSET + selected_incident_type_ids: Union[Unset, list[str]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -63,31 +61,31 @@ def to_dict(self) -> dict[str, Any]: selected_user_ids = self.selected_user_ids - values: list[str] | Unset = UNSET + values: Union[Unset, list[str]] = UNSET if not isinstance(self.values, Unset): values = self.values - selected_functionality_ids: list[str] | Unset = UNSET + selected_functionality_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.selected_functionality_ids, Unset): selected_functionality_ids = self.selected_functionality_ids - selected_group_ids: list[str] | Unset = UNSET + selected_group_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.selected_group_ids, Unset): selected_group_ids = self.selected_group_ids - selected_service_ids: list[str] | Unset = UNSET + selected_service_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.selected_service_ids, Unset): selected_service_ids = self.selected_service_ids - selected_cause_ids: list[str] | Unset = UNSET + selected_cause_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.selected_cause_ids, Unset): selected_cause_ids = self.selected_cause_ids - selected_environment_ids: list[str] | Unset = UNSET + selected_environment_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.selected_environment_ids, Unset): selected_environment_ids = self.selected_environment_ids - selected_incident_type_ids: list[str] | Unset = UNSET + selected_incident_type_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.selected_incident_type_ids, Unset): selected_incident_type_ids = self.selected_incident_type_ids diff --git a/rootly_sdk/models/workflow_action_item_form_field_condition_list.py b/rootly_sdk/models/workflow_action_item_form_field_condition_list.py index b855ca58..93639cb9 100644 --- a/rootly_sdk/models/workflow_action_item_form_field_condition_list.py +++ b/rootly_sdk/models/workflow_action_item_form_field_condition_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -24,20 +22,19 @@ class WorkflowActionItemFormFieldConditionList: """ Attributes: - data (list[WorkflowActionItemFormFieldConditionListDataItem]): + data (list['WorkflowActionItemFormFieldConditionListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[WorkflowActionItemFormFieldConditionListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["WorkflowActionItemFormFieldConditionListDataItem"] + links: "Links" + meta: "Meta" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -47,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -89,14 +86,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) workflow_action_item_form_field_condition_list = cls( data=data, diff --git a/rootly_sdk/models/workflow_action_item_form_field_condition_list_data_item.py b/rootly_sdk/models/workflow_action_item_form_field_condition_list_data_item.py index 0196c392..274ccb1a 100644 --- a/rootly_sdk/models/workflow_action_item_form_field_condition_list_data_item.py +++ b/rootly_sdk/models/workflow_action_item_form_field_condition_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class WorkflowActionItemFormFieldConditionListDataItem: id: str type_: WorkflowActionItemFormFieldConditionListDataItemType - attributes: WorkflowActionItemFormFieldCondition + attributes: "WorkflowActionItemFormFieldCondition" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/workflow_action_item_form_field_condition_response.py b/rootly_sdk/models/workflow_action_item_form_field_condition_response.py index d5a6bc3c..6bd44e41 100644 --- a/rootly_sdk/models/workflow_action_item_form_field_condition_response.py +++ b/rootly_sdk/models/workflow_action_item_form_field_condition_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,18 +21,17 @@ class WorkflowActionItemFormFieldConditionResponse: """ Attributes: data (WorkflowActionItemFormFieldConditionResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: WorkflowActionItemFormFieldConditionResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "WorkflowActionItemFormFieldConditionResponseData" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -63,14 +60,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = WorkflowActionItemFormFieldConditionResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) workflow_action_item_form_field_condition_response = cls( data=data, diff --git a/rootly_sdk/models/workflow_action_item_form_field_condition_response_data.py b/rootly_sdk/models/workflow_action_item_form_field_condition_response_data.py index ba8b9202..52a2c586 100644 --- a/rootly_sdk/models/workflow_action_item_form_field_condition_response_data.py +++ b/rootly_sdk/models/workflow_action_item_form_field_condition_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class WorkflowActionItemFormFieldConditionResponseData: id: str type_: WorkflowActionItemFormFieldConditionResponseDataType - attributes: WorkflowActionItemFormFieldCondition + attributes: "WorkflowActionItemFormFieldCondition" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/workflow_custom_field_selection.py b/rootly_sdk/models/workflow_custom_field_selection.py index aa0bec5c..3998395d 100644 --- a/rootly_sdk/models/workflow_custom_field_selection.py +++ b/rootly_sdk/models/workflow_custom_field_selection.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,14 +21,14 @@ class WorkflowCustomFieldSelection: custom_field_id (int): The custom field for this selection incident_condition (WorkflowCustomFieldSelectionIncidentCondition): The trigger condition Default: 'ANY'. selected_option_ids (list[int]): - values (list[str] | Unset): + values (Union[Unset, list[str]]): """ workflow_id: str custom_field_id: int selected_option_ids: list[int] incident_condition: WorkflowCustomFieldSelectionIncidentCondition = "ANY" - values: list[str] | Unset = UNSET + values: Union[Unset, list[str]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +40,7 @@ def to_dict(self) -> dict[str, Any]: selected_option_ids = self.selected_option_ids - values: list[str] | Unset = UNSET + values: Union[Unset, list[str]] = UNSET if not isinstance(self.values, Unset): values = self.values diff --git a/rootly_sdk/models/workflow_custom_field_selection_list.py b/rootly_sdk/models/workflow_custom_field_selection_list.py index c4c1b992..2a5e0f68 100644 --- a/rootly_sdk/models/workflow_custom_field_selection_list.py +++ b/rootly_sdk/models/workflow_custom_field_selection_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,20 +20,19 @@ class WorkflowCustomFieldSelectionList: """ Attributes: - data (list[WorkflowCustomFieldSelectionListDataItem]): + data (list['WorkflowCustomFieldSelectionListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[WorkflowCustomFieldSelectionListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["WorkflowCustomFieldSelectionListDataItem"] + links: "Links" + meta: "Meta" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) workflow_custom_field_selection_list = cls( data=data, diff --git a/rootly_sdk/models/workflow_custom_field_selection_list_data_item.py b/rootly_sdk/models/workflow_custom_field_selection_list_data_item.py index 3c0c25c7..5dee7a75 100644 --- a/rootly_sdk/models/workflow_custom_field_selection_list_data_item.py +++ b/rootly_sdk/models/workflow_custom_field_selection_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class WorkflowCustomFieldSelectionListDataItem: id: str type_: WorkflowCustomFieldSelectionListDataItemType - attributes: WorkflowCustomFieldSelection + attributes: "WorkflowCustomFieldSelection" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/workflow_custom_field_selection_response.py b/rootly_sdk/models/workflow_custom_field_selection_response.py index 359a6902..1c4c5cee 100644 --- a/rootly_sdk/models/workflow_custom_field_selection_response.py +++ b/rootly_sdk/models/workflow_custom_field_selection_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,18 +19,17 @@ class WorkflowCustomFieldSelectionResponse: """ Attributes: data (WorkflowCustomFieldSelectionResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: WorkflowCustomFieldSelectionResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "WorkflowCustomFieldSelectionResponseData" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = WorkflowCustomFieldSelectionResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) workflow_custom_field_selection_response = cls( data=data, diff --git a/rootly_sdk/models/workflow_custom_field_selection_response_data.py b/rootly_sdk/models/workflow_custom_field_selection_response_data.py index a6358569..0ae87605 100644 --- a/rootly_sdk/models/workflow_custom_field_selection_response_data.py +++ b/rootly_sdk/models/workflow_custom_field_selection_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class WorkflowCustomFieldSelectionResponseData: id: str type_: WorkflowCustomFieldSelectionResponseDataType - attributes: WorkflowCustomFieldSelection + attributes: "WorkflowCustomFieldSelection" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/workflow_form_field_condition.py b/rootly_sdk/models/workflow_form_field_condition.py index f3d3ed95..1fba73c3 100644 --- a/rootly_sdk/models/workflow_form_field_condition.py +++ b/rootly_sdk/models/workflow_form_field_condition.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -25,13 +23,13 @@ class WorkflowFormFieldCondition: selected_catalog_entity_ids (list[str]): selected_option_ids (list[str]): selected_user_ids (list[int]): - values (list[str] | Unset): - selected_functionality_ids (list[str] | Unset): - selected_group_ids (list[str] | Unset): - selected_service_ids (list[str] | Unset): - selected_cause_ids (list[str] | Unset): - selected_environment_ids (list[str] | Unset): - selected_incident_type_ids (list[str] | Unset): + values (Union[Unset, list[str]]): + selected_functionality_ids (Union[Unset, list[str]]): + selected_group_ids (Union[Unset, list[str]]): + selected_service_ids (Union[Unset, list[str]]): + selected_cause_ids (Union[Unset, list[str]]): + selected_environment_ids (Union[Unset, list[str]]): + selected_incident_type_ids (Union[Unset, list[str]]): """ workflow_id: str @@ -40,13 +38,13 @@ class WorkflowFormFieldCondition: selected_option_ids: list[str] selected_user_ids: list[int] incident_condition: WorkflowFormFieldConditionIncidentCondition = "ANY" - values: list[str] | Unset = UNSET - selected_functionality_ids: list[str] | Unset = UNSET - selected_group_ids: list[str] | Unset = UNSET - selected_service_ids: list[str] | Unset = UNSET - selected_cause_ids: list[str] | Unset = UNSET - selected_environment_ids: list[str] | Unset = UNSET - selected_incident_type_ids: list[str] | Unset = UNSET + values: Union[Unset, list[str]] = UNSET + selected_functionality_ids: Union[Unset, list[str]] = UNSET + selected_group_ids: Union[Unset, list[str]] = UNSET + selected_service_ids: Union[Unset, list[str]] = UNSET + selected_cause_ids: Union[Unset, list[str]] = UNSET + selected_environment_ids: Union[Unset, list[str]] = UNSET + selected_incident_type_ids: Union[Unset, list[str]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -62,31 +60,31 @@ def to_dict(self) -> dict[str, Any]: selected_user_ids = self.selected_user_ids - values: list[str] | Unset = UNSET + values: Union[Unset, list[str]] = UNSET if not isinstance(self.values, Unset): values = self.values - selected_functionality_ids: list[str] | Unset = UNSET + selected_functionality_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.selected_functionality_ids, Unset): selected_functionality_ids = self.selected_functionality_ids - selected_group_ids: list[str] | Unset = UNSET + selected_group_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.selected_group_ids, Unset): selected_group_ids = self.selected_group_ids - selected_service_ids: list[str] | Unset = UNSET + selected_service_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.selected_service_ids, Unset): selected_service_ids = self.selected_service_ids - selected_cause_ids: list[str] | Unset = UNSET + selected_cause_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.selected_cause_ids, Unset): selected_cause_ids = self.selected_cause_ids - selected_environment_ids: list[str] | Unset = UNSET + selected_environment_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.selected_environment_ids, Unset): selected_environment_ids = self.selected_environment_ids - selected_incident_type_ids: list[str] | Unset = UNSET + selected_incident_type_ids: Union[Unset, list[str]] = UNSET if not isinstance(self.selected_incident_type_ids, Unset): selected_incident_type_ids = self.selected_incident_type_ids diff --git a/rootly_sdk/models/workflow_form_field_condition_list.py b/rootly_sdk/models/workflow_form_field_condition_list.py index dfbfcc0d..581248e6 100644 --- a/rootly_sdk/models/workflow_form_field_condition_list.py +++ b/rootly_sdk/models/workflow_form_field_condition_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,20 +20,19 @@ class WorkflowFormFieldConditionList: """ Attributes: - data (list[WorkflowFormFieldConditionListDataItem]): + data (list['WorkflowFormFieldConditionListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[WorkflowFormFieldConditionListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["WorkflowFormFieldConditionListDataItem"] + links: "Links" + meta: "Meta" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) workflow_form_field_condition_list = cls( data=data, diff --git a/rootly_sdk/models/workflow_form_field_condition_list_data_item.py b/rootly_sdk/models/workflow_form_field_condition_list_data_item.py index 3faa4ee9..3597e8e1 100644 --- a/rootly_sdk/models/workflow_form_field_condition_list_data_item.py +++ b/rootly_sdk/models/workflow_form_field_condition_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class WorkflowFormFieldConditionListDataItem: id: str type_: WorkflowFormFieldConditionListDataItemType - attributes: WorkflowFormFieldCondition + attributes: "WorkflowFormFieldCondition" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/workflow_form_field_condition_response.py b/rootly_sdk/models/workflow_form_field_condition_response.py index a9ea7141..7aa2c3d1 100644 --- a/rootly_sdk/models/workflow_form_field_condition_response.py +++ b/rootly_sdk/models/workflow_form_field_condition_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,18 +19,17 @@ class WorkflowFormFieldConditionResponse: """ Attributes: data (WorkflowFormFieldConditionResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: WorkflowFormFieldConditionResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "WorkflowFormFieldConditionResponseData" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = WorkflowFormFieldConditionResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) workflow_form_field_condition_response = cls( data=data, diff --git a/rootly_sdk/models/workflow_form_field_condition_response_data.py b/rootly_sdk/models/workflow_form_field_condition_response_data.py index e38e325b..c7a81d78 100644 --- a/rootly_sdk/models/workflow_form_field_condition_response_data.py +++ b/rootly_sdk/models/workflow_form_field_condition_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class WorkflowFormFieldConditionResponseData: id: str type_: WorkflowFormFieldConditionResponseDataType - attributes: WorkflowFormFieldCondition + attributes: "WorkflowFormFieldCondition" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/workflow_group.py b/rootly_sdk/models/workflow_group.py index 1563246a..a834661a 100644 --- a/rootly_sdk/models/workflow_group.py +++ b/rootly_sdk/models/workflow_group.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -18,20 +16,20 @@ class WorkflowGroup: Attributes: name (str): The name of the workflow group. position (int): The position of the workflow group - kind (WorkflowGroupKind | Unset): The kind of the workflow group - slug (str | Unset): The slug of the workflow group. - description (None | str | Unset): A description of the workflow group. - icon (str | Unset): An emoji icon displayed next to the workflow group. - expanded (bool | Unset): Whether the group is expanded or collapsed. + kind (Union[Unset, WorkflowGroupKind]): The kind of the workflow group + slug (Union[Unset, str]): The slug of the workflow group. + description (Union[None, Unset, str]): A description of the workflow group. + icon (Union[Unset, str]): An emoji icon displayed next to the workflow group. + expanded (Union[Unset, bool]): Whether the group is expanded or collapsed. """ name: str position: int - kind: WorkflowGroupKind | Unset = UNSET - slug: str | Unset = UNSET - description: None | str | Unset = UNSET - icon: str | Unset = UNSET - expanded: bool | Unset = UNSET + kind: Union[Unset, WorkflowGroupKind] = UNSET + slug: Union[Unset, str] = UNSET + description: Union[None, Unset, str] = UNSET + icon: Union[Unset, str] = UNSET + expanded: Union[Unset, bool] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -39,13 +37,13 @@ def to_dict(self) -> dict[str, Any]: position = self.position - kind: str | Unset = UNSET + kind: Union[Unset, str] = UNSET if not isinstance(self.kind, Unset): kind = self.kind slug = self.slug - description: None | str | Unset + description: Union[None, Unset, str] if isinstance(self.description, Unset): description = UNSET else: @@ -84,7 +82,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: position = d.pop("position") _kind = d.pop("kind", UNSET) - kind: WorkflowGroupKind | Unset + kind: Union[Unset, WorkflowGroupKind] if isinstance(_kind, Unset): kind = UNSET else: @@ -92,12 +90,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: slug = d.pop("slug", UNSET) - def _parse_description(data: object) -> None | str | Unset: + def _parse_description(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) description = _parse_description(d.pop("description", UNSET)) diff --git a/rootly_sdk/models/workflow_group_list.py b/rootly_sdk/models/workflow_group_list.py index 31743ee5..ecc4f021 100644 --- a/rootly_sdk/models/workflow_group_list.py +++ b/rootly_sdk/models/workflow_group_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,20 +20,19 @@ class WorkflowGroupList: """ Attributes: - data (list[WorkflowGroupListDataItem]): + data (list['WorkflowGroupListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[WorkflowGroupListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["WorkflowGroupListDataItem"] + links: "Links" + meta: "Meta" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) workflow_group_list = cls( data=data, diff --git a/rootly_sdk/models/workflow_group_list_data_item.py b/rootly_sdk/models/workflow_group_list_data_item.py index 039a54f5..adf2c51c 100644 --- a/rootly_sdk/models/workflow_group_list_data_item.py +++ b/rootly_sdk/models/workflow_group_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class WorkflowGroupListDataItem: id: str type_: WorkflowGroupListDataItemType - attributes: WorkflowGroup + attributes: "WorkflowGroup" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/workflow_group_response.py b/rootly_sdk/models/workflow_group_response.py index d2bd3bec..ef0c5ad5 100644 --- a/rootly_sdk/models/workflow_group_response.py +++ b/rootly_sdk/models/workflow_group_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,18 +19,17 @@ class WorkflowGroupResponse: """ Attributes: data (WorkflowGroupResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: WorkflowGroupResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "WorkflowGroupResponseData" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = WorkflowGroupResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) workflow_group_response = cls( data=data, diff --git a/rootly_sdk/models/workflow_group_response_data.py b/rootly_sdk/models/workflow_group_response_data.py index f637b6cd..6fcd902e 100644 --- a/rootly_sdk/models/workflow_group_response_data.py +++ b/rootly_sdk/models/workflow_group_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class WorkflowGroupResponseData: id: str type_: WorkflowGroupResponseDataType - attributes: WorkflowGroup + attributes: "WorkflowGroup" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/workflow_list.py b/rootly_sdk/models/workflow_list.py index b74bb15d..94bf3795 100644 --- a/rootly_sdk/models/workflow_list.py +++ b/rootly_sdk/models/workflow_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,20 +20,19 @@ class WorkflowList: """ Attributes: - data (list[WorkflowListDataItem]): + data (list['WorkflowListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[WorkflowListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["WorkflowListDataItem"] + links: "Links" + meta: "Meta" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) workflow_list = cls( data=data, diff --git a/rootly_sdk/models/workflow_list_data_item.py b/rootly_sdk/models/workflow_list_data_item.py index 713a974e..b751de36 100644 --- a/rootly_sdk/models/workflow_list_data_item.py +++ b/rootly_sdk/models/workflow_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class WorkflowListDataItem: id: str type_: WorkflowListDataItemType - attributes: Workflow + attributes: "Workflow" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/workflow_response.py b/rootly_sdk/models/workflow_response.py index 48ad6d5a..638a1d68 100644 --- a/rootly_sdk/models/workflow_response.py +++ b/rootly_sdk/models/workflow_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,18 +19,17 @@ class WorkflowResponse: """ Attributes: data (WorkflowResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: WorkflowResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "WorkflowResponseData" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = WorkflowResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) workflow_response = cls( data=data, diff --git a/rootly_sdk/models/workflow_response_data.py b/rootly_sdk/models/workflow_response_data.py index 708d02d4..eeced5e7 100644 --- a/rootly_sdk/models/workflow_response_data.py +++ b/rootly_sdk/models/workflow_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class WorkflowResponseData: id: str type_: WorkflowResponseDataType - attributes: Workflow + attributes: "Workflow" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/workflow_run.py b/rootly_sdk/models/workflow_run.py index 1953ec09..7dbf6bf7 100644 --- a/rootly_sdk/models/workflow_run.py +++ b/rootly_sdk/models/workflow_run.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -24,104 +22,103 @@ class WorkflowRun: workflow_id (str): status (WorkflowRunStatus): triggered_by (WorkflowRunTriggeredBy): - status_message (None | str | Unset): - started_at (None | str | Unset): - completed_at (None | str | Unset): - failed_at (None | str | Unset): - canceled_at (None | str | Unset): - incident_id (None | str | Unset): - post_mortem_id (None | str | Unset): - action_item_id (None | str | Unset): - alert_id (None | str | Unset): - pulse_id (None | str | Unset): - context (WorkflowRunContext | Unset): + status_message (Union[None, Unset, str]): + started_at (Union[None, Unset, str]): + completed_at (Union[None, Unset, str]): + failed_at (Union[None, Unset, str]): + canceled_at (Union[None, Unset, str]): + incident_id (Union[None, Unset, str]): + post_mortem_id (Union[None, Unset, str]): + action_item_id (Union[None, Unset, str]): + alert_id (Union[None, Unset, str]): + pulse_id (Union[None, Unset, str]): + context (Union[Unset, WorkflowRunContext]): """ workflow_id: str status: WorkflowRunStatus triggered_by: WorkflowRunTriggeredBy - status_message: None | str | Unset = UNSET - started_at: None | str | Unset = UNSET - completed_at: None | str | Unset = UNSET - failed_at: None | str | Unset = UNSET - canceled_at: None | str | Unset = UNSET - incident_id: None | str | Unset = UNSET - post_mortem_id: None | str | Unset = UNSET - action_item_id: None | str | Unset = UNSET - alert_id: None | str | Unset = UNSET - pulse_id: None | str | Unset = UNSET - context: WorkflowRunContext | Unset = UNSET + status_message: Union[None, Unset, str] = UNSET + started_at: Union[None, Unset, str] = UNSET + completed_at: Union[None, Unset, str] = UNSET + failed_at: Union[None, Unset, str] = UNSET + canceled_at: Union[None, Unset, str] = UNSET + incident_id: Union[None, Unset, str] = UNSET + post_mortem_id: Union[None, Unset, str] = UNSET + action_item_id: Union[None, Unset, str] = UNSET + alert_id: Union[None, Unset, str] = UNSET + pulse_id: Union[None, Unset, str] = UNSET + context: Union[Unset, "WorkflowRunContext"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - workflow_id = self.workflow_id status: str = self.status triggered_by: str = self.triggered_by - status_message: None | str | Unset + status_message: Union[None, Unset, str] if isinstance(self.status_message, Unset): status_message = UNSET else: status_message = self.status_message - started_at: None | str | Unset + started_at: Union[None, Unset, str] if isinstance(self.started_at, Unset): started_at = UNSET else: started_at = self.started_at - completed_at: None | str | Unset + completed_at: Union[None, Unset, str] if isinstance(self.completed_at, Unset): completed_at = UNSET else: completed_at = self.completed_at - failed_at: None | str | Unset + failed_at: Union[None, Unset, str] if isinstance(self.failed_at, Unset): failed_at = UNSET else: failed_at = self.failed_at - canceled_at: None | str | Unset + canceled_at: Union[None, Unset, str] if isinstance(self.canceled_at, Unset): canceled_at = UNSET else: canceled_at = self.canceled_at - incident_id: None | str | Unset + incident_id: Union[None, Unset, str] if isinstance(self.incident_id, Unset): incident_id = UNSET else: incident_id = self.incident_id - post_mortem_id: None | str | Unset + post_mortem_id: Union[None, Unset, str] if isinstance(self.post_mortem_id, Unset): post_mortem_id = UNSET else: post_mortem_id = self.post_mortem_id - action_item_id: None | str | Unset + action_item_id: Union[None, Unset, str] if isinstance(self.action_item_id, Unset): action_item_id = UNSET else: action_item_id = self.action_item_id - alert_id: None | str | Unset + alert_id: Union[None, Unset, str] if isinstance(self.alert_id, Unset): alert_id = UNSET else: alert_id = self.alert_id - pulse_id: None | str | Unset + pulse_id: Union[None, Unset, str] if isinstance(self.pulse_id, Unset): pulse_id = UNSET else: pulse_id = self.pulse_id - context: dict[str, Any] | Unset = UNSET + context: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.context, Unset): context = self.context.to_dict() @@ -170,98 +167,98 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: triggered_by = check_workflow_run_triggered_by(d.pop("triggered_by")) - def _parse_status_message(data: object) -> None | str | Unset: + def _parse_status_message(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) status_message = _parse_status_message(d.pop("status_message", UNSET)) - def _parse_started_at(data: object) -> None | str | Unset: + def _parse_started_at(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) started_at = _parse_started_at(d.pop("started_at", UNSET)) - def _parse_completed_at(data: object) -> None | str | Unset: + def _parse_completed_at(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) completed_at = _parse_completed_at(d.pop("completed_at", UNSET)) - def _parse_failed_at(data: object) -> None | str | Unset: + def _parse_failed_at(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) failed_at = _parse_failed_at(d.pop("failed_at", UNSET)) - def _parse_canceled_at(data: object) -> None | str | Unset: + def _parse_canceled_at(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) canceled_at = _parse_canceled_at(d.pop("canceled_at", UNSET)) - def _parse_incident_id(data: object) -> None | str | Unset: + def _parse_incident_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) incident_id = _parse_incident_id(d.pop("incident_id", UNSET)) - def _parse_post_mortem_id(data: object) -> None | str | Unset: + def _parse_post_mortem_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) post_mortem_id = _parse_post_mortem_id(d.pop("post_mortem_id", UNSET)) - def _parse_action_item_id(data: object) -> None | str | Unset: + def _parse_action_item_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) action_item_id = _parse_action_item_id(d.pop("action_item_id", UNSET)) - def _parse_alert_id(data: object) -> None | str | Unset: + def _parse_alert_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) alert_id = _parse_alert_id(d.pop("alert_id", UNSET)) - def _parse_pulse_id(data: object) -> None | str | Unset: + def _parse_pulse_id(data: object) -> Union[None, Unset, str]: if data is None: return data if isinstance(data, Unset): return data - return cast(None | str | Unset, data) + return cast(Union[None, Unset, str], data) pulse_id = _parse_pulse_id(d.pop("pulse_id", UNSET)) _context = d.pop("context", UNSET) - context: WorkflowRunContext | Unset + context: Union[Unset, WorkflowRunContext] if isinstance(_context, Unset): context = UNSET else: diff --git a/rootly_sdk/models/workflow_run_context.py b/rootly_sdk/models/workflow_run_context.py index ecd3107f..28bff04f 100644 --- a/rootly_sdk/models/workflow_run_context.py +++ b/rootly_sdk/models/workflow_run_context.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import Any, TypeVar @@ -16,7 +14,6 @@ class WorkflowRunContext: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) diff --git a/rootly_sdk/models/workflow_run_response.py b/rootly_sdk/models/workflow_run_response.py index 54aa6066..a4f24eed 100644 --- a/rootly_sdk/models/workflow_run_response.py +++ b/rootly_sdk/models/workflow_run_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,18 +19,17 @@ class WorkflowRunResponse: """ Attributes: data (WorkflowRunResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: WorkflowRunResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "WorkflowRunResponseData" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = WorkflowRunResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) workflow_run_response = cls( data=data, diff --git a/rootly_sdk/models/workflow_run_response_data.py b/rootly_sdk/models/workflow_run_response_data.py index a40ae7da..73ec5e96 100644 --- a/rootly_sdk/models/workflow_run_response_data.py +++ b/rootly_sdk/models/workflow_run_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,11 +24,10 @@ class WorkflowRunResponseData: id: str type_: WorkflowRunResponseDataType - attributes: WorkflowRun + attributes: "WorkflowRun" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/workflow_runs_list.py b/rootly_sdk/models/workflow_runs_list.py index 578c499e..f174b18c 100644 --- a/rootly_sdk/models/workflow_runs_list.py +++ b/rootly_sdk/models/workflow_runs_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,20 +20,19 @@ class WorkflowRunsList: """ Attributes: - data (list[WorkflowRunsListDataItem]): + data (list['WorkflowRunsListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[WorkflowRunsListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["WorkflowRunsListDataItem"] + links: "Links" + meta: "Meta" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) workflow_runs_list = cls( data=data, diff --git a/rootly_sdk/models/workflow_runs_list_data_item.py b/rootly_sdk/models/workflow_runs_list_data_item.py index 503f7ea4..970d0bec 100644 --- a/rootly_sdk/models/workflow_runs_list_data_item.py +++ b/rootly_sdk/models/workflow_runs_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class WorkflowRunsListDataItem: id: str type_: WorkflowRunsListDataItemType - attributes: WorkflowRun + attributes: "WorkflowRun" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/workflow_task.py b/rootly_sdk/models/workflow_task.py index 09603629..460fcb99 100644 --- a/rootly_sdk/models/workflow_task.py +++ b/rootly_sdk/models/workflow_task.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,11 +20,18 @@ from ..models.archive_microsoft_teams_channels_task_params import ArchiveMicrosoftTeamsChannelsTaskParams from ..models.archive_slack_channels_task_params import ArchiveSlackChannelsTaskParams from ..models.attach_datadog_dashboards_task_params import AttachDatadogDashboardsTaskParams + from ..models.attach_retrospective_pdf_to_freshservice_ticket_task_params import ( + AttachRetrospectivePdfToFreshserviceTicketTaskParams, + ) from ..models.attach_retrospective_pdf_to_jira_issue_task_params import AttachRetrospectivePdfToJiraIssueTaskParams from ..models.auto_assign_role_opsgenie_task_params import AutoAssignRoleOpsgenieTaskParams from ..models.auto_assign_role_pagerduty_task_params_type_0 import AutoAssignRolePagerdutyTaskParamsType0 from ..models.auto_assign_role_pagerduty_task_params_type_1 import AutoAssignRolePagerdutyTaskParamsType1 - from ..models.auto_assign_role_rootly_task_params import AutoAssignRoleRootlyTaskParams + from ..models.auto_assign_role_rootly_task_params_type_0 import AutoAssignRoleRootlyTaskParamsType0 + from ..models.auto_assign_role_rootly_task_params_type_1 import AutoAssignRoleRootlyTaskParamsType1 + from ..models.auto_assign_role_rootly_task_params_type_2 import AutoAssignRoleRootlyTaskParamsType2 + from ..models.auto_assign_role_rootly_task_params_type_3 import AutoAssignRoleRootlyTaskParamsType3 + from ..models.auto_assign_role_rootly_task_params_type_4 import AutoAssignRoleRootlyTaskParamsType4 from ..models.auto_assign_role_victor_ops_task_params import AutoAssignRoleVictorOpsTaskParams from ..models.call_people_task_params import CallPeopleTaskParams from ..models.change_google_chat_space_privacy_task_params import ChangeGoogleChatSpacePrivacyTaskParams @@ -190,241 +195,252 @@ class WorkflowTask: """ Attributes: workflow_id (str): The ID of the parent workflow - task_params (AddActionItemTaskParams | AddMicrosoftTeamsChatTabTaskParams | AddMicrosoftTeamsTabTaskParamsType0 - | AddMicrosoftTeamsTabTaskParamsType1 | AddRoleTaskParams | AddSlackBookmarkTaskParamsType0 | - AddSlackBookmarkTaskParamsType1 | AddTeamTaskParams | AddToTimelineTaskParams | - ArchiveGoogleChatSpacesTaskParams | ArchiveMicrosoftTeamsChannelsTaskParams | ArchiveSlackChannelsTaskParams | - AttachDatadogDashboardsTaskParams | AttachRetrospectivePdfToJiraIssueTaskParams | - AutoAssignRoleOpsgenieTaskParams | AutoAssignRolePagerdutyTaskParamsType0 | - AutoAssignRolePagerdutyTaskParamsType1 | AutoAssignRoleRootlyTaskParams | AutoAssignRoleVictorOpsTaskParams | - CallPeopleTaskParams | ChangeGoogleChatSpacePrivacyTaskParams | ChangeSlackChannelPrivacyTaskParams | - CreateAirtableTableRecordTaskParams | CreateAnthropicChatCompletionTaskParams | CreateAsanaSubtaskTaskParams | - CreateAsanaTaskTaskParams | CreateClickupTaskTaskParams | CreateCodaPageTaskParams | - CreateConfluencePageTaskParams | CreateDatadogNotebookTaskParams | CreateDropboxPaperPageTaskParams | - CreateGithubIssueTaskParams | CreateGitlabIssueTaskParams | CreateGoogleCalendarEventTaskParams | - CreateGoogleChatSpaceTaskParams | CreateGoogleDocsPageTaskParams | CreateGoogleDocsPermissionsTaskParams | - CreateGoogleGeminiChatCompletionTaskParams | CreateGoogleMeetingTaskParams | CreateGoToMeetingTaskParams | - CreateIncidentPostmortemTaskParams | CreateIncidentTaskParams | CreateJiraIssueTaskParams | - CreateJiraSubtaskTaskParams | CreateJsmopsAlertTaskParams | CreateLinearIssueCommentTaskParams | - CreateLinearIssueTaskParams | CreateLinearSubtaskIssueTaskParams | CreateMicrosoftTeamsChannelTaskParams | - CreateMicrosoftTeamsChatTaskParams | CreateMicrosoftTeamsMeetingTaskParams | - CreateMistralChatCompletionTaskParams | CreateMotionTaskTaskParams | CreateNotionPageTaskParams | - CreateOpenaiChatCompletionTaskParams | CreateOpsgenieAlertTaskParams | CreateOutlookEventTaskParams | - CreatePagerdutyStatusUpdateTaskParams | CreatePagertreeAlertTaskParams | CreateQuipPageTaskParams | - CreateServiceNowIncidentTaskParams | CreateSharepointPageTaskParams | CreateShortcutStoryTaskParamsType0 | - CreateShortcutStoryTaskParamsType1 | CreateShortcutTaskTaskParams | CreateSlackChannelTaskParams | - CreateSubIncidentTaskParams | CreateTrelloCardTaskParams | CreateWatsonxChatCompletionTaskParams | - CreateWebexMeetingTaskParams | CreateZendeskJiraLinkTaskParams | CreateZendeskTicketTaskParams | - CreateZoomMeetingTaskParams | GetAlertsTaskParams | GetGithubCommitsTaskParamsType0 | - GetGithubCommitsTaskParamsType1 | GetGitlabCommitsTaskParamsType0 | GetGitlabCommitsTaskParamsType1 | - GetPulsesTaskParams | HttpClientTaskParams | InviteToGoogleChatSpaceTaskParams | - InviteToMicrosoftTeamsChannelRootlyTaskParams | InviteToMicrosoftTeamsChannelTaskParams | - InviteToSlackChannelOpsgenieTaskParams | InviteToSlackChannelPagerdutyTaskParamsType0 | - InviteToSlackChannelPagerdutyTaskParamsType1 | InviteToSlackChannelRootlyTaskParams | - InviteToSlackChannelTaskParamsType0 | InviteToSlackChannelTaskParamsType1 | InviteToSlackChannelTaskParamsType2 - | InviteToSlackChannelVictorOpsTaskParams | PageJsmopsOnCallRespondersTaskParams | - PageOpsgenieOnCallRespondersTaskParams | PagePagerdutyOnCallRespondersTaskParams | - PageRootlyOnCallRespondersTaskParams | PageVictorOpsOnCallRespondersTaskParamsType0 | - PageVictorOpsOnCallRespondersTaskParamsType1 | PrintTaskParams | PublishIncidentTaskParams | - RedisClientTaskParams | RemoveGoogleDocsPermissionsTaskParams | RenameGoogleChatSpaceTaskParams | - RenameMicrosoftTeamsChannelTaskParams | RenameSlackChannelTaskParams | RunCommandHerokuTaskParams | - SendDashboardReportTaskParams | SendEmailTaskParams | SendGoogleChatAttachmentsTaskParams | - SendGoogleChatMessageTaskParams | SendMicrosoftTeamsBlocksTaskParamsType0 | - SendMicrosoftTeamsChatMessageTaskParams | SendMicrosoftTeamsMessageTaskParamsType0 | - SendSlackBlocksTaskParamsType0 | SendSlackBlocksTaskParamsType1 | SendSlackBlocksTaskParamsType2 | - SendSlackMessageTaskParamsType0 | SendSlackMessageTaskParamsType1 | SendSlackMessageTaskParamsType2 | - SendSmsTaskParams | SendWhatsappMessageTaskParams | SnapshotDatadogGraphTaskParams | - SnapshotGrafanaDashboardTaskParams | SnapshotLookerLookTaskParams | SnapshotNewRelicGraphTaskParams | - TriggerWorkflowTaskParams | TweetTwitterMessageTaskParams | UpdateActionItemTaskParams | - UpdateAirtableTableRecordTaskParams | UpdateAsanaTaskTaskParams | UpdateAttachedAlertsTaskParams | - UpdateClickupTaskTaskParams | UpdateCodaPageTaskParams | UpdateConfluencePageTaskParams | - UpdateDatadogNotebookTaskParams | UpdateDropboxPaperPageTaskParams | UpdateGithubIssueTaskParams | - UpdateGitlabIssueTaskParams | UpdateGoogleCalendarEventTaskParams | UpdateGoogleChatSpaceDescriptionTaskParams | - UpdateGoogleDocsPageTaskParams | UpdateIncidentPostmortemTaskParams | UpdateIncidentStatusTimestampTaskParams | - UpdateIncidentTaskParams | UpdateJiraIssueTaskParams | UpdateLinearIssueTaskParams | UpdateMotionTaskTaskParams - | UpdateNotionPageTaskParams | UpdateOpsgenieAlertTaskParams | UpdateOpsgenieIncidentTaskParams | - UpdatePagerdutyIncidentTaskParams | UpdatePagertreeAlertTaskParams | UpdateQuipPageTaskParams | - UpdateServiceNowIncidentTaskParams | UpdateSharepointPageTaskParams | UpdateShortcutStoryTaskParams | - UpdateShortcutTaskTaskParams | UpdateSlackChannelTopicTaskParams | UpdateStatusTaskParams | - UpdateTrelloCardTaskParams | UpdateVictorOpsIncidentTaskParams | UpdateZendeskTicketTaskParams): + task_params (Union['AddActionItemTaskParams', 'AddMicrosoftTeamsChatTabTaskParams', + 'AddMicrosoftTeamsTabTaskParamsType0', 'AddMicrosoftTeamsTabTaskParamsType1', 'AddRoleTaskParams', + 'AddSlackBookmarkTaskParamsType0', 'AddSlackBookmarkTaskParamsType1', 'AddTeamTaskParams', + 'AddToTimelineTaskParams', 'ArchiveGoogleChatSpacesTaskParams', 'ArchiveMicrosoftTeamsChannelsTaskParams', + 'ArchiveSlackChannelsTaskParams', 'AttachDatadogDashboardsTaskParams', + 'AttachRetrospectivePdfToFreshserviceTicketTaskParams', 'AttachRetrospectivePdfToJiraIssueTaskParams', + 'AutoAssignRoleOpsgenieTaskParams', 'AutoAssignRolePagerdutyTaskParamsType0', + 'AutoAssignRolePagerdutyTaskParamsType1', 'AutoAssignRoleRootlyTaskParamsType0', + 'AutoAssignRoleRootlyTaskParamsType1', 'AutoAssignRoleRootlyTaskParamsType2', + 'AutoAssignRoleRootlyTaskParamsType3', 'AutoAssignRoleRootlyTaskParamsType4', + 'AutoAssignRoleVictorOpsTaskParams', 'CallPeopleTaskParams', 'ChangeGoogleChatSpacePrivacyTaskParams', + 'ChangeSlackChannelPrivacyTaskParams', 'CreateAirtableTableRecordTaskParams', + 'CreateAnthropicChatCompletionTaskParams', 'CreateAsanaSubtaskTaskParams', 'CreateAsanaTaskTaskParams', + 'CreateClickupTaskTaskParams', 'CreateCodaPageTaskParams', 'CreateConfluencePageTaskParams', + 'CreateDatadogNotebookTaskParams', 'CreateDropboxPaperPageTaskParams', 'CreateGithubIssueTaskParams', + 'CreateGitlabIssueTaskParams', 'CreateGoToMeetingTaskParams', 'CreateGoogleCalendarEventTaskParams', + 'CreateGoogleChatSpaceTaskParams', 'CreateGoogleDocsPageTaskParams', 'CreateGoogleDocsPermissionsTaskParams', + 'CreateGoogleGeminiChatCompletionTaskParams', 'CreateGoogleMeetingTaskParams', + 'CreateIncidentPostmortemTaskParams', 'CreateIncidentTaskParams', 'CreateJiraIssueTaskParams', + 'CreateJiraSubtaskTaskParams', 'CreateJsmopsAlertTaskParams', 'CreateLinearIssueCommentTaskParams', + 'CreateLinearIssueTaskParams', 'CreateLinearSubtaskIssueTaskParams', 'CreateMicrosoftTeamsChannelTaskParams', + 'CreateMicrosoftTeamsChatTaskParams', 'CreateMicrosoftTeamsMeetingTaskParams', + 'CreateMistralChatCompletionTaskParams', 'CreateMotionTaskTaskParams', 'CreateNotionPageTaskParams', + 'CreateOpenaiChatCompletionTaskParams', 'CreateOpsgenieAlertTaskParams', 'CreateOutlookEventTaskParams', + 'CreatePagerdutyStatusUpdateTaskParams', 'CreatePagertreeAlertTaskParams', 'CreateQuipPageTaskParams', + 'CreateServiceNowIncidentTaskParams', 'CreateSharepointPageTaskParams', 'CreateShortcutStoryTaskParamsType0', + 'CreateShortcutStoryTaskParamsType1', 'CreateShortcutTaskTaskParams', 'CreateSlackChannelTaskParams', + 'CreateSubIncidentTaskParams', 'CreateTrelloCardTaskParams', 'CreateWatsonxChatCompletionTaskParams', + 'CreateWebexMeetingTaskParams', 'CreateZendeskJiraLinkTaskParams', 'CreateZendeskTicketTaskParams', + 'CreateZoomMeetingTaskParams', 'GetAlertsTaskParams', 'GetGithubCommitsTaskParamsType0', + 'GetGithubCommitsTaskParamsType1', 'GetGitlabCommitsTaskParamsType0', 'GetGitlabCommitsTaskParamsType1', + 'GetPulsesTaskParams', 'HttpClientTaskParams', 'InviteToGoogleChatSpaceTaskParams', + 'InviteToMicrosoftTeamsChannelRootlyTaskParams', 'InviteToMicrosoftTeamsChannelTaskParams', + 'InviteToSlackChannelOpsgenieTaskParams', 'InviteToSlackChannelPagerdutyTaskParamsType0', + 'InviteToSlackChannelPagerdutyTaskParamsType1', 'InviteToSlackChannelRootlyTaskParams', + 'InviteToSlackChannelTaskParamsType0', 'InviteToSlackChannelTaskParamsType1', + 'InviteToSlackChannelTaskParamsType2', 'InviteToSlackChannelVictorOpsTaskParams', + 'PageJsmopsOnCallRespondersTaskParams', 'PageOpsgenieOnCallRespondersTaskParams', + 'PagePagerdutyOnCallRespondersTaskParams', 'PageRootlyOnCallRespondersTaskParams', + 'PageVictorOpsOnCallRespondersTaskParamsType0', 'PageVictorOpsOnCallRespondersTaskParamsType1', + 'PrintTaskParams', 'PublishIncidentTaskParams', 'RedisClientTaskParams', + 'RemoveGoogleDocsPermissionsTaskParams', 'RenameGoogleChatSpaceTaskParams', + 'RenameMicrosoftTeamsChannelTaskParams', 'RenameSlackChannelTaskParams', 'RunCommandHerokuTaskParams', + 'SendDashboardReportTaskParams', 'SendEmailTaskParams', 'SendGoogleChatAttachmentsTaskParams', + 'SendGoogleChatMessageTaskParams', 'SendMicrosoftTeamsBlocksTaskParamsType0', + 'SendMicrosoftTeamsChatMessageTaskParams', 'SendMicrosoftTeamsMessageTaskParamsType0', + 'SendSlackBlocksTaskParamsType0', 'SendSlackBlocksTaskParamsType1', 'SendSlackBlocksTaskParamsType2', + 'SendSlackMessageTaskParamsType0', 'SendSlackMessageTaskParamsType1', 'SendSlackMessageTaskParamsType2', + 'SendSmsTaskParams', 'SendWhatsappMessageTaskParams', 'SnapshotDatadogGraphTaskParams', + 'SnapshotGrafanaDashboardTaskParams', 'SnapshotLookerLookTaskParams', 'SnapshotNewRelicGraphTaskParams', + 'TriggerWorkflowTaskParams', 'TweetTwitterMessageTaskParams', 'UpdateActionItemTaskParams', + 'UpdateAirtableTableRecordTaskParams', 'UpdateAsanaTaskTaskParams', 'UpdateAttachedAlertsTaskParams', + 'UpdateClickupTaskTaskParams', 'UpdateCodaPageTaskParams', 'UpdateConfluencePageTaskParams', + 'UpdateDatadogNotebookTaskParams', 'UpdateDropboxPaperPageTaskParams', 'UpdateGithubIssueTaskParams', + 'UpdateGitlabIssueTaskParams', 'UpdateGoogleCalendarEventTaskParams', + 'UpdateGoogleChatSpaceDescriptionTaskParams', 'UpdateGoogleDocsPageTaskParams', + 'UpdateIncidentPostmortemTaskParams', 'UpdateIncidentStatusTimestampTaskParams', 'UpdateIncidentTaskParams', + 'UpdateJiraIssueTaskParams', 'UpdateLinearIssueTaskParams', 'UpdateMotionTaskTaskParams', + 'UpdateNotionPageTaskParams', 'UpdateOpsgenieAlertTaskParams', 'UpdateOpsgenieIncidentTaskParams', + 'UpdatePagerdutyIncidentTaskParams', 'UpdatePagertreeAlertTaskParams', 'UpdateQuipPageTaskParams', + 'UpdateServiceNowIncidentTaskParams', 'UpdateSharepointPageTaskParams', 'UpdateShortcutStoryTaskParams', + 'UpdateShortcutTaskTaskParams', 'UpdateSlackChannelTopicTaskParams', 'UpdateStatusTaskParams', + 'UpdateTrelloCardTaskParams', 'UpdateVictorOpsIncidentTaskParams', 'UpdateZendeskTicketTaskParams']): position (int): The position of the workflow task skip_on_failure (bool): Skip workflow task if any failures enabled (bool): Enable/disable workflow task Default: True. created_at (str): Date of creation updated_at (str): Date of last update - name (str | Unset): Name of the workflow task + name (Union[Unset, str]): Name of the workflow task """ workflow_id: str - task_params: ( - AddActionItemTaskParams - | AddMicrosoftTeamsChatTabTaskParams - | AddMicrosoftTeamsTabTaskParamsType0 - | AddMicrosoftTeamsTabTaskParamsType1 - | AddRoleTaskParams - | AddSlackBookmarkTaskParamsType0 - | AddSlackBookmarkTaskParamsType1 - | AddTeamTaskParams - | AddToTimelineTaskParams - | ArchiveGoogleChatSpacesTaskParams - | ArchiveMicrosoftTeamsChannelsTaskParams - | ArchiveSlackChannelsTaskParams - | AttachDatadogDashboardsTaskParams - | AttachRetrospectivePdfToJiraIssueTaskParams - | AutoAssignRoleOpsgenieTaskParams - | AutoAssignRolePagerdutyTaskParamsType0 - | AutoAssignRolePagerdutyTaskParamsType1 - | AutoAssignRoleRootlyTaskParams - | AutoAssignRoleVictorOpsTaskParams - | CallPeopleTaskParams - | ChangeGoogleChatSpacePrivacyTaskParams - | ChangeSlackChannelPrivacyTaskParams - | CreateAirtableTableRecordTaskParams - | CreateAnthropicChatCompletionTaskParams - | CreateAsanaSubtaskTaskParams - | CreateAsanaTaskTaskParams - | CreateClickupTaskTaskParams - | CreateCodaPageTaskParams - | CreateConfluencePageTaskParams - | CreateDatadogNotebookTaskParams - | CreateDropboxPaperPageTaskParams - | CreateGithubIssueTaskParams - | CreateGitlabIssueTaskParams - | CreateGoogleCalendarEventTaskParams - | CreateGoogleChatSpaceTaskParams - | CreateGoogleDocsPageTaskParams - | CreateGoogleDocsPermissionsTaskParams - | CreateGoogleGeminiChatCompletionTaskParams - | CreateGoogleMeetingTaskParams - | CreateGoToMeetingTaskParams - | CreateIncidentPostmortemTaskParams - | CreateIncidentTaskParams - | CreateJiraIssueTaskParams - | CreateJiraSubtaskTaskParams - | CreateJsmopsAlertTaskParams - | CreateLinearIssueCommentTaskParams - | CreateLinearIssueTaskParams - | CreateLinearSubtaskIssueTaskParams - | CreateMicrosoftTeamsChannelTaskParams - | CreateMicrosoftTeamsChatTaskParams - | CreateMicrosoftTeamsMeetingTaskParams - | CreateMistralChatCompletionTaskParams - | CreateMotionTaskTaskParams - | CreateNotionPageTaskParams - | CreateOpenaiChatCompletionTaskParams - | CreateOpsgenieAlertTaskParams - | CreateOutlookEventTaskParams - | CreatePagerdutyStatusUpdateTaskParams - | CreatePagertreeAlertTaskParams - | CreateQuipPageTaskParams - | CreateServiceNowIncidentTaskParams - | CreateSharepointPageTaskParams - | CreateShortcutStoryTaskParamsType0 - | CreateShortcutStoryTaskParamsType1 - | CreateShortcutTaskTaskParams - | CreateSlackChannelTaskParams - | CreateSubIncidentTaskParams - | CreateTrelloCardTaskParams - | CreateWatsonxChatCompletionTaskParams - | CreateWebexMeetingTaskParams - | CreateZendeskJiraLinkTaskParams - | CreateZendeskTicketTaskParams - | CreateZoomMeetingTaskParams - | GetAlertsTaskParams - | GetGithubCommitsTaskParamsType0 - | GetGithubCommitsTaskParamsType1 - | GetGitlabCommitsTaskParamsType0 - | GetGitlabCommitsTaskParamsType1 - | GetPulsesTaskParams - | HttpClientTaskParams - | InviteToGoogleChatSpaceTaskParams - | InviteToMicrosoftTeamsChannelRootlyTaskParams - | InviteToMicrosoftTeamsChannelTaskParams - | InviteToSlackChannelOpsgenieTaskParams - | InviteToSlackChannelPagerdutyTaskParamsType0 - | InviteToSlackChannelPagerdutyTaskParamsType1 - | InviteToSlackChannelRootlyTaskParams - | InviteToSlackChannelTaskParamsType0 - | InviteToSlackChannelTaskParamsType1 - | InviteToSlackChannelTaskParamsType2 - | InviteToSlackChannelVictorOpsTaskParams - | PageJsmopsOnCallRespondersTaskParams - | PageOpsgenieOnCallRespondersTaskParams - | PagePagerdutyOnCallRespondersTaskParams - | PageRootlyOnCallRespondersTaskParams - | PageVictorOpsOnCallRespondersTaskParamsType0 - | PageVictorOpsOnCallRespondersTaskParamsType1 - | PrintTaskParams - | PublishIncidentTaskParams - | RedisClientTaskParams - | RemoveGoogleDocsPermissionsTaskParams - | RenameGoogleChatSpaceTaskParams - | RenameMicrosoftTeamsChannelTaskParams - | RenameSlackChannelTaskParams - | RunCommandHerokuTaskParams - | SendDashboardReportTaskParams - | SendEmailTaskParams - | SendGoogleChatAttachmentsTaskParams - | SendGoogleChatMessageTaskParams - | SendMicrosoftTeamsBlocksTaskParamsType0 - | SendMicrosoftTeamsChatMessageTaskParams - | SendMicrosoftTeamsMessageTaskParamsType0 - | SendSlackBlocksTaskParamsType0 - | SendSlackBlocksTaskParamsType1 - | SendSlackBlocksTaskParamsType2 - | SendSlackMessageTaskParamsType0 - | SendSlackMessageTaskParamsType1 - | SendSlackMessageTaskParamsType2 - | SendSmsTaskParams - | SendWhatsappMessageTaskParams - | SnapshotDatadogGraphTaskParams - | SnapshotGrafanaDashboardTaskParams - | SnapshotLookerLookTaskParams - | SnapshotNewRelicGraphTaskParams - | TriggerWorkflowTaskParams - | TweetTwitterMessageTaskParams - | UpdateActionItemTaskParams - | UpdateAirtableTableRecordTaskParams - | UpdateAsanaTaskTaskParams - | UpdateAttachedAlertsTaskParams - | UpdateClickupTaskTaskParams - | UpdateCodaPageTaskParams - | UpdateConfluencePageTaskParams - | UpdateDatadogNotebookTaskParams - | UpdateDropboxPaperPageTaskParams - | UpdateGithubIssueTaskParams - | UpdateGitlabIssueTaskParams - | UpdateGoogleCalendarEventTaskParams - | UpdateGoogleChatSpaceDescriptionTaskParams - | UpdateGoogleDocsPageTaskParams - | UpdateIncidentPostmortemTaskParams - | UpdateIncidentStatusTimestampTaskParams - | UpdateIncidentTaskParams - | UpdateJiraIssueTaskParams - | UpdateLinearIssueTaskParams - | UpdateMotionTaskTaskParams - | UpdateNotionPageTaskParams - | UpdateOpsgenieAlertTaskParams - | UpdateOpsgenieIncidentTaskParams - | UpdatePagerdutyIncidentTaskParams - | UpdatePagertreeAlertTaskParams - | UpdateQuipPageTaskParams - | UpdateServiceNowIncidentTaskParams - | UpdateSharepointPageTaskParams - | UpdateShortcutStoryTaskParams - | UpdateShortcutTaskTaskParams - | UpdateSlackChannelTopicTaskParams - | UpdateStatusTaskParams - | UpdateTrelloCardTaskParams - | UpdateVictorOpsIncidentTaskParams - | UpdateZendeskTicketTaskParams - ) + task_params: Union[ + "AddActionItemTaskParams", + "AddMicrosoftTeamsChatTabTaskParams", + "AddMicrosoftTeamsTabTaskParamsType0", + "AddMicrosoftTeamsTabTaskParamsType1", + "AddRoleTaskParams", + "AddSlackBookmarkTaskParamsType0", + "AddSlackBookmarkTaskParamsType1", + "AddTeamTaskParams", + "AddToTimelineTaskParams", + "ArchiveGoogleChatSpacesTaskParams", + "ArchiveMicrosoftTeamsChannelsTaskParams", + "ArchiveSlackChannelsTaskParams", + "AttachDatadogDashboardsTaskParams", + "AttachRetrospectivePdfToFreshserviceTicketTaskParams", + "AttachRetrospectivePdfToJiraIssueTaskParams", + "AutoAssignRoleOpsgenieTaskParams", + "AutoAssignRolePagerdutyTaskParamsType0", + "AutoAssignRolePagerdutyTaskParamsType1", + "AutoAssignRoleRootlyTaskParamsType0", + "AutoAssignRoleRootlyTaskParamsType1", + "AutoAssignRoleRootlyTaskParamsType2", + "AutoAssignRoleRootlyTaskParamsType3", + "AutoAssignRoleRootlyTaskParamsType4", + "AutoAssignRoleVictorOpsTaskParams", + "CallPeopleTaskParams", + "ChangeGoogleChatSpacePrivacyTaskParams", + "ChangeSlackChannelPrivacyTaskParams", + "CreateAirtableTableRecordTaskParams", + "CreateAnthropicChatCompletionTaskParams", + "CreateAsanaSubtaskTaskParams", + "CreateAsanaTaskTaskParams", + "CreateClickupTaskTaskParams", + "CreateCodaPageTaskParams", + "CreateConfluencePageTaskParams", + "CreateDatadogNotebookTaskParams", + "CreateDropboxPaperPageTaskParams", + "CreateGithubIssueTaskParams", + "CreateGitlabIssueTaskParams", + "CreateGoToMeetingTaskParams", + "CreateGoogleCalendarEventTaskParams", + "CreateGoogleChatSpaceTaskParams", + "CreateGoogleDocsPageTaskParams", + "CreateGoogleDocsPermissionsTaskParams", + "CreateGoogleGeminiChatCompletionTaskParams", + "CreateGoogleMeetingTaskParams", + "CreateIncidentPostmortemTaskParams", + "CreateIncidentTaskParams", + "CreateJiraIssueTaskParams", + "CreateJiraSubtaskTaskParams", + "CreateJsmopsAlertTaskParams", + "CreateLinearIssueCommentTaskParams", + "CreateLinearIssueTaskParams", + "CreateLinearSubtaskIssueTaskParams", + "CreateMicrosoftTeamsChannelTaskParams", + "CreateMicrosoftTeamsChatTaskParams", + "CreateMicrosoftTeamsMeetingTaskParams", + "CreateMistralChatCompletionTaskParams", + "CreateMotionTaskTaskParams", + "CreateNotionPageTaskParams", + "CreateOpenaiChatCompletionTaskParams", + "CreateOpsgenieAlertTaskParams", + "CreateOutlookEventTaskParams", + "CreatePagerdutyStatusUpdateTaskParams", + "CreatePagertreeAlertTaskParams", + "CreateQuipPageTaskParams", + "CreateServiceNowIncidentTaskParams", + "CreateSharepointPageTaskParams", + "CreateShortcutStoryTaskParamsType0", + "CreateShortcutStoryTaskParamsType1", + "CreateShortcutTaskTaskParams", + "CreateSlackChannelTaskParams", + "CreateSubIncidentTaskParams", + "CreateTrelloCardTaskParams", + "CreateWatsonxChatCompletionTaskParams", + "CreateWebexMeetingTaskParams", + "CreateZendeskJiraLinkTaskParams", + "CreateZendeskTicketTaskParams", + "CreateZoomMeetingTaskParams", + "GetAlertsTaskParams", + "GetGithubCommitsTaskParamsType0", + "GetGithubCommitsTaskParamsType1", + "GetGitlabCommitsTaskParamsType0", + "GetGitlabCommitsTaskParamsType1", + "GetPulsesTaskParams", + "HttpClientTaskParams", + "InviteToGoogleChatSpaceTaskParams", + "InviteToMicrosoftTeamsChannelRootlyTaskParams", + "InviteToMicrosoftTeamsChannelTaskParams", + "InviteToSlackChannelOpsgenieTaskParams", + "InviteToSlackChannelPagerdutyTaskParamsType0", + "InviteToSlackChannelPagerdutyTaskParamsType1", + "InviteToSlackChannelRootlyTaskParams", + "InviteToSlackChannelTaskParamsType0", + "InviteToSlackChannelTaskParamsType1", + "InviteToSlackChannelTaskParamsType2", + "InviteToSlackChannelVictorOpsTaskParams", + "PageJsmopsOnCallRespondersTaskParams", + "PageOpsgenieOnCallRespondersTaskParams", + "PagePagerdutyOnCallRespondersTaskParams", + "PageRootlyOnCallRespondersTaskParams", + "PageVictorOpsOnCallRespondersTaskParamsType0", + "PageVictorOpsOnCallRespondersTaskParamsType1", + "PrintTaskParams", + "PublishIncidentTaskParams", + "RedisClientTaskParams", + "RemoveGoogleDocsPermissionsTaskParams", + "RenameGoogleChatSpaceTaskParams", + "RenameMicrosoftTeamsChannelTaskParams", + "RenameSlackChannelTaskParams", + "RunCommandHerokuTaskParams", + "SendDashboardReportTaskParams", + "SendEmailTaskParams", + "SendGoogleChatAttachmentsTaskParams", + "SendGoogleChatMessageTaskParams", + "SendMicrosoftTeamsBlocksTaskParamsType0", + "SendMicrosoftTeamsChatMessageTaskParams", + "SendMicrosoftTeamsMessageTaskParamsType0", + "SendSlackBlocksTaskParamsType0", + "SendSlackBlocksTaskParamsType1", + "SendSlackBlocksTaskParamsType2", + "SendSlackMessageTaskParamsType0", + "SendSlackMessageTaskParamsType1", + "SendSlackMessageTaskParamsType2", + "SendSmsTaskParams", + "SendWhatsappMessageTaskParams", + "SnapshotDatadogGraphTaskParams", + "SnapshotGrafanaDashboardTaskParams", + "SnapshotLookerLookTaskParams", + "SnapshotNewRelicGraphTaskParams", + "TriggerWorkflowTaskParams", + "TweetTwitterMessageTaskParams", + "UpdateActionItemTaskParams", + "UpdateAirtableTableRecordTaskParams", + "UpdateAsanaTaskTaskParams", + "UpdateAttachedAlertsTaskParams", + "UpdateClickupTaskTaskParams", + "UpdateCodaPageTaskParams", + "UpdateConfluencePageTaskParams", + "UpdateDatadogNotebookTaskParams", + "UpdateDropboxPaperPageTaskParams", + "UpdateGithubIssueTaskParams", + "UpdateGitlabIssueTaskParams", + "UpdateGoogleCalendarEventTaskParams", + "UpdateGoogleChatSpaceDescriptionTaskParams", + "UpdateGoogleDocsPageTaskParams", + "UpdateIncidentPostmortemTaskParams", + "UpdateIncidentStatusTimestampTaskParams", + "UpdateIncidentTaskParams", + "UpdateJiraIssueTaskParams", + "UpdateLinearIssueTaskParams", + "UpdateMotionTaskTaskParams", + "UpdateNotionPageTaskParams", + "UpdateOpsgenieAlertTaskParams", + "UpdateOpsgenieIncidentTaskParams", + "UpdatePagerdutyIncidentTaskParams", + "UpdatePagertreeAlertTaskParams", + "UpdateQuipPageTaskParams", + "UpdateServiceNowIncidentTaskParams", + "UpdateSharepointPageTaskParams", + "UpdateShortcutStoryTaskParams", + "UpdateShortcutTaskTaskParams", + "UpdateSlackChannelTopicTaskParams", + "UpdateStatusTaskParams", + "UpdateTrelloCardTaskParams", + "UpdateVictorOpsIncidentTaskParams", + "UpdateZendeskTicketTaskParams", + ] position: int skip_on_failure: bool created_at: str updated_at: str enabled: bool = True - name: str | Unset = UNSET + name: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -441,13 +457,20 @@ def to_dict(self) -> dict[str, Any]: from ..models.archive_microsoft_teams_channels_task_params import ArchiveMicrosoftTeamsChannelsTaskParams from ..models.archive_slack_channels_task_params import ArchiveSlackChannelsTaskParams from ..models.attach_datadog_dashboards_task_params import AttachDatadogDashboardsTaskParams + from ..models.attach_retrospective_pdf_to_freshservice_ticket_task_params import ( + AttachRetrospectivePdfToFreshserviceTicketTaskParams, + ) from ..models.attach_retrospective_pdf_to_jira_issue_task_params import ( AttachRetrospectivePdfToJiraIssueTaskParams, ) from ..models.auto_assign_role_opsgenie_task_params import AutoAssignRoleOpsgenieTaskParams from ..models.auto_assign_role_pagerduty_task_params_type_0 import AutoAssignRolePagerdutyTaskParamsType0 from ..models.auto_assign_role_pagerduty_task_params_type_1 import AutoAssignRolePagerdutyTaskParamsType1 - from ..models.auto_assign_role_rootly_task_params import AutoAssignRoleRootlyTaskParams + from ..models.auto_assign_role_rootly_task_params_type_0 import AutoAssignRoleRootlyTaskParamsType0 + from ..models.auto_assign_role_rootly_task_params_type_1 import AutoAssignRoleRootlyTaskParamsType1 + from ..models.auto_assign_role_rootly_task_params_type_2 import AutoAssignRoleRootlyTaskParamsType2 + from ..models.auto_assign_role_rootly_task_params_type_3 import AutoAssignRoleRootlyTaskParamsType3 + from ..models.auto_assign_role_rootly_task_params_type_4 import AutoAssignRoleRootlyTaskParamsType4 from ..models.auto_assign_role_victor_ops_task_params import AutoAssignRoleVictorOpsTaskParams from ..models.call_people_task_params import CallPeopleTaskParams from ..models.change_google_chat_space_privacy_task_params import ChangeGoogleChatSpacePrivacyTaskParams @@ -624,7 +647,15 @@ def to_dict(self) -> dict[str, Any]: task_params = self.task_params.to_dict() elif isinstance(self.task_params, AutoAssignRoleOpsgenieTaskParams): task_params = self.task_params.to_dict() - elif isinstance(self.task_params, AutoAssignRoleRootlyTaskParams): + elif isinstance(self.task_params, AutoAssignRoleRootlyTaskParamsType0): + task_params = self.task_params.to_dict() + elif isinstance(self.task_params, AutoAssignRoleRootlyTaskParamsType1): + task_params = self.task_params.to_dict() + elif isinstance(self.task_params, AutoAssignRoleRootlyTaskParamsType2): + task_params = self.task_params.to_dict() + elif isinstance(self.task_params, AutoAssignRoleRootlyTaskParamsType3): + task_params = self.task_params.to_dict() + elif isinstance(self.task_params, AutoAssignRoleRootlyTaskParamsType4): task_params = self.task_params.to_dict() elif isinstance(self.task_params, AutoAssignRolePagerdutyTaskParamsType0): task_params = self.task_params.to_dict() @@ -696,6 +727,8 @@ def to_dict(self) -> dict[str, Any]: task_params = self.task_params.to_dict() elif isinstance(self.task_params, AttachRetrospectivePdfToJiraIssueTaskParams): task_params = self.task_params.to_dict() + elif isinstance(self.task_params, AttachRetrospectivePdfToFreshserviceTicketTaskParams): + task_params = self.task_params.to_dict() elif isinstance(self.task_params, CreateLinearIssueTaskParams): task_params = self.task_params.to_dict() elif isinstance(self.task_params, CreateLinearSubtaskIssueTaskParams): @@ -972,13 +1005,20 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: from ..models.archive_microsoft_teams_channels_task_params import ArchiveMicrosoftTeamsChannelsTaskParams from ..models.archive_slack_channels_task_params import ArchiveSlackChannelsTaskParams from ..models.attach_datadog_dashboards_task_params import AttachDatadogDashboardsTaskParams + from ..models.attach_retrospective_pdf_to_freshservice_ticket_task_params import ( + AttachRetrospectivePdfToFreshserviceTicketTaskParams, + ) from ..models.attach_retrospective_pdf_to_jira_issue_task_params import ( AttachRetrospectivePdfToJiraIssueTaskParams, ) from ..models.auto_assign_role_opsgenie_task_params import AutoAssignRoleOpsgenieTaskParams from ..models.auto_assign_role_pagerduty_task_params_type_0 import AutoAssignRolePagerdutyTaskParamsType0 from ..models.auto_assign_role_pagerduty_task_params_type_1 import AutoAssignRolePagerdutyTaskParamsType1 - from ..models.auto_assign_role_rootly_task_params import AutoAssignRoleRootlyTaskParams + from ..models.auto_assign_role_rootly_task_params_type_0 import AutoAssignRoleRootlyTaskParamsType0 + from ..models.auto_assign_role_rootly_task_params_type_1 import AutoAssignRoleRootlyTaskParamsType1 + from ..models.auto_assign_role_rootly_task_params_type_2 import AutoAssignRoleRootlyTaskParamsType2 + from ..models.auto_assign_role_rootly_task_params_type_3 import AutoAssignRoleRootlyTaskParamsType3 + from ..models.auto_assign_role_rootly_task_params_type_4 import AutoAssignRoleRootlyTaskParamsType4 from ..models.auto_assign_role_victor_ops_task_params import AutoAssignRoleVictorOpsTaskParams from ..models.call_people_task_params import CallPeopleTaskParams from ..models.change_google_chat_space_privacy_task_params import ChangeGoogleChatSpacePrivacyTaskParams @@ -1138,176 +1178,181 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: def _parse_task_params( data: object, - ) -> ( - AddActionItemTaskParams - | AddMicrosoftTeamsChatTabTaskParams - | AddMicrosoftTeamsTabTaskParamsType0 - | AddMicrosoftTeamsTabTaskParamsType1 - | AddRoleTaskParams - | AddSlackBookmarkTaskParamsType0 - | AddSlackBookmarkTaskParamsType1 - | AddTeamTaskParams - | AddToTimelineTaskParams - | ArchiveGoogleChatSpacesTaskParams - | ArchiveMicrosoftTeamsChannelsTaskParams - | ArchiveSlackChannelsTaskParams - | AttachDatadogDashboardsTaskParams - | AttachRetrospectivePdfToJiraIssueTaskParams - | AutoAssignRoleOpsgenieTaskParams - | AutoAssignRolePagerdutyTaskParamsType0 - | AutoAssignRolePagerdutyTaskParamsType1 - | AutoAssignRoleRootlyTaskParams - | AutoAssignRoleVictorOpsTaskParams - | CallPeopleTaskParams - | ChangeGoogleChatSpacePrivacyTaskParams - | ChangeSlackChannelPrivacyTaskParams - | CreateAirtableTableRecordTaskParams - | CreateAnthropicChatCompletionTaskParams - | CreateAsanaSubtaskTaskParams - | CreateAsanaTaskTaskParams - | CreateClickupTaskTaskParams - | CreateCodaPageTaskParams - | CreateConfluencePageTaskParams - | CreateDatadogNotebookTaskParams - | CreateDropboxPaperPageTaskParams - | CreateGithubIssueTaskParams - | CreateGitlabIssueTaskParams - | CreateGoogleCalendarEventTaskParams - | CreateGoogleChatSpaceTaskParams - | CreateGoogleDocsPageTaskParams - | CreateGoogleDocsPermissionsTaskParams - | CreateGoogleGeminiChatCompletionTaskParams - | CreateGoogleMeetingTaskParams - | CreateGoToMeetingTaskParams - | CreateIncidentPostmortemTaskParams - | CreateIncidentTaskParams - | CreateJiraIssueTaskParams - | CreateJiraSubtaskTaskParams - | CreateJsmopsAlertTaskParams - | CreateLinearIssueCommentTaskParams - | CreateLinearIssueTaskParams - | CreateLinearSubtaskIssueTaskParams - | CreateMicrosoftTeamsChannelTaskParams - | CreateMicrosoftTeamsChatTaskParams - | CreateMicrosoftTeamsMeetingTaskParams - | CreateMistralChatCompletionTaskParams - | CreateMotionTaskTaskParams - | CreateNotionPageTaskParams - | CreateOpenaiChatCompletionTaskParams - | CreateOpsgenieAlertTaskParams - | CreateOutlookEventTaskParams - | CreatePagerdutyStatusUpdateTaskParams - | CreatePagertreeAlertTaskParams - | CreateQuipPageTaskParams - | CreateServiceNowIncidentTaskParams - | CreateSharepointPageTaskParams - | CreateShortcutStoryTaskParamsType0 - | CreateShortcutStoryTaskParamsType1 - | CreateShortcutTaskTaskParams - | CreateSlackChannelTaskParams - | CreateSubIncidentTaskParams - | CreateTrelloCardTaskParams - | CreateWatsonxChatCompletionTaskParams - | CreateWebexMeetingTaskParams - | CreateZendeskJiraLinkTaskParams - | CreateZendeskTicketTaskParams - | CreateZoomMeetingTaskParams - | GetAlertsTaskParams - | GetGithubCommitsTaskParamsType0 - | GetGithubCommitsTaskParamsType1 - | GetGitlabCommitsTaskParamsType0 - | GetGitlabCommitsTaskParamsType1 - | GetPulsesTaskParams - | HttpClientTaskParams - | InviteToGoogleChatSpaceTaskParams - | InviteToMicrosoftTeamsChannelRootlyTaskParams - | InviteToMicrosoftTeamsChannelTaskParams - | InviteToSlackChannelOpsgenieTaskParams - | InviteToSlackChannelPagerdutyTaskParamsType0 - | InviteToSlackChannelPagerdutyTaskParamsType1 - | InviteToSlackChannelRootlyTaskParams - | InviteToSlackChannelTaskParamsType0 - | InviteToSlackChannelTaskParamsType1 - | InviteToSlackChannelTaskParamsType2 - | InviteToSlackChannelVictorOpsTaskParams - | PageJsmopsOnCallRespondersTaskParams - | PageOpsgenieOnCallRespondersTaskParams - | PagePagerdutyOnCallRespondersTaskParams - | PageRootlyOnCallRespondersTaskParams - | PageVictorOpsOnCallRespondersTaskParamsType0 - | PageVictorOpsOnCallRespondersTaskParamsType1 - | PrintTaskParams - | PublishIncidentTaskParams - | RedisClientTaskParams - | RemoveGoogleDocsPermissionsTaskParams - | RenameGoogleChatSpaceTaskParams - | RenameMicrosoftTeamsChannelTaskParams - | RenameSlackChannelTaskParams - | RunCommandHerokuTaskParams - | SendDashboardReportTaskParams - | SendEmailTaskParams - | SendGoogleChatAttachmentsTaskParams - | SendGoogleChatMessageTaskParams - | SendMicrosoftTeamsBlocksTaskParamsType0 - | SendMicrosoftTeamsChatMessageTaskParams - | SendMicrosoftTeamsMessageTaskParamsType0 - | SendSlackBlocksTaskParamsType0 - | SendSlackBlocksTaskParamsType1 - | SendSlackBlocksTaskParamsType2 - | SendSlackMessageTaskParamsType0 - | SendSlackMessageTaskParamsType1 - | SendSlackMessageTaskParamsType2 - | SendSmsTaskParams - | SendWhatsappMessageTaskParams - | SnapshotDatadogGraphTaskParams - | SnapshotGrafanaDashboardTaskParams - | SnapshotLookerLookTaskParams - | SnapshotNewRelicGraphTaskParams - | TriggerWorkflowTaskParams - | TweetTwitterMessageTaskParams - | UpdateActionItemTaskParams - | UpdateAirtableTableRecordTaskParams - | UpdateAsanaTaskTaskParams - | UpdateAttachedAlertsTaskParams - | UpdateClickupTaskTaskParams - | UpdateCodaPageTaskParams - | UpdateConfluencePageTaskParams - | UpdateDatadogNotebookTaskParams - | UpdateDropboxPaperPageTaskParams - | UpdateGithubIssueTaskParams - | UpdateGitlabIssueTaskParams - | UpdateGoogleCalendarEventTaskParams - | UpdateGoogleChatSpaceDescriptionTaskParams - | UpdateGoogleDocsPageTaskParams - | UpdateIncidentPostmortemTaskParams - | UpdateIncidentStatusTimestampTaskParams - | UpdateIncidentTaskParams - | UpdateJiraIssueTaskParams - | UpdateLinearIssueTaskParams - | UpdateMotionTaskTaskParams - | UpdateNotionPageTaskParams - | UpdateOpsgenieAlertTaskParams - | UpdateOpsgenieIncidentTaskParams - | UpdatePagerdutyIncidentTaskParams - | UpdatePagertreeAlertTaskParams - | UpdateQuipPageTaskParams - | UpdateServiceNowIncidentTaskParams - | UpdateSharepointPageTaskParams - | UpdateShortcutStoryTaskParams - | UpdateShortcutTaskTaskParams - | UpdateSlackChannelTopicTaskParams - | UpdateStatusTaskParams - | UpdateTrelloCardTaskParams - | UpdateVictorOpsIncidentTaskParams - | UpdateZendeskTicketTaskParams - ): + ) -> Union[ + "AddActionItemTaskParams", + "AddMicrosoftTeamsChatTabTaskParams", + "AddMicrosoftTeamsTabTaskParamsType0", + "AddMicrosoftTeamsTabTaskParamsType1", + "AddRoleTaskParams", + "AddSlackBookmarkTaskParamsType0", + "AddSlackBookmarkTaskParamsType1", + "AddTeamTaskParams", + "AddToTimelineTaskParams", + "ArchiveGoogleChatSpacesTaskParams", + "ArchiveMicrosoftTeamsChannelsTaskParams", + "ArchiveSlackChannelsTaskParams", + "AttachDatadogDashboardsTaskParams", + "AttachRetrospectivePdfToFreshserviceTicketTaskParams", + "AttachRetrospectivePdfToJiraIssueTaskParams", + "AutoAssignRoleOpsgenieTaskParams", + "AutoAssignRolePagerdutyTaskParamsType0", + "AutoAssignRolePagerdutyTaskParamsType1", + "AutoAssignRoleRootlyTaskParamsType0", + "AutoAssignRoleRootlyTaskParamsType1", + "AutoAssignRoleRootlyTaskParamsType2", + "AutoAssignRoleRootlyTaskParamsType3", + "AutoAssignRoleRootlyTaskParamsType4", + "AutoAssignRoleVictorOpsTaskParams", + "CallPeopleTaskParams", + "ChangeGoogleChatSpacePrivacyTaskParams", + "ChangeSlackChannelPrivacyTaskParams", + "CreateAirtableTableRecordTaskParams", + "CreateAnthropicChatCompletionTaskParams", + "CreateAsanaSubtaskTaskParams", + "CreateAsanaTaskTaskParams", + "CreateClickupTaskTaskParams", + "CreateCodaPageTaskParams", + "CreateConfluencePageTaskParams", + "CreateDatadogNotebookTaskParams", + "CreateDropboxPaperPageTaskParams", + "CreateGithubIssueTaskParams", + "CreateGitlabIssueTaskParams", + "CreateGoToMeetingTaskParams", + "CreateGoogleCalendarEventTaskParams", + "CreateGoogleChatSpaceTaskParams", + "CreateGoogleDocsPageTaskParams", + "CreateGoogleDocsPermissionsTaskParams", + "CreateGoogleGeminiChatCompletionTaskParams", + "CreateGoogleMeetingTaskParams", + "CreateIncidentPostmortemTaskParams", + "CreateIncidentTaskParams", + "CreateJiraIssueTaskParams", + "CreateJiraSubtaskTaskParams", + "CreateJsmopsAlertTaskParams", + "CreateLinearIssueCommentTaskParams", + "CreateLinearIssueTaskParams", + "CreateLinearSubtaskIssueTaskParams", + "CreateMicrosoftTeamsChannelTaskParams", + "CreateMicrosoftTeamsChatTaskParams", + "CreateMicrosoftTeamsMeetingTaskParams", + "CreateMistralChatCompletionTaskParams", + "CreateMotionTaskTaskParams", + "CreateNotionPageTaskParams", + "CreateOpenaiChatCompletionTaskParams", + "CreateOpsgenieAlertTaskParams", + "CreateOutlookEventTaskParams", + "CreatePagerdutyStatusUpdateTaskParams", + "CreatePagertreeAlertTaskParams", + "CreateQuipPageTaskParams", + "CreateServiceNowIncidentTaskParams", + "CreateSharepointPageTaskParams", + "CreateShortcutStoryTaskParamsType0", + "CreateShortcutStoryTaskParamsType1", + "CreateShortcutTaskTaskParams", + "CreateSlackChannelTaskParams", + "CreateSubIncidentTaskParams", + "CreateTrelloCardTaskParams", + "CreateWatsonxChatCompletionTaskParams", + "CreateWebexMeetingTaskParams", + "CreateZendeskJiraLinkTaskParams", + "CreateZendeskTicketTaskParams", + "CreateZoomMeetingTaskParams", + "GetAlertsTaskParams", + "GetGithubCommitsTaskParamsType0", + "GetGithubCommitsTaskParamsType1", + "GetGitlabCommitsTaskParamsType0", + "GetGitlabCommitsTaskParamsType1", + "GetPulsesTaskParams", + "HttpClientTaskParams", + "InviteToGoogleChatSpaceTaskParams", + "InviteToMicrosoftTeamsChannelRootlyTaskParams", + "InviteToMicrosoftTeamsChannelTaskParams", + "InviteToSlackChannelOpsgenieTaskParams", + "InviteToSlackChannelPagerdutyTaskParamsType0", + "InviteToSlackChannelPagerdutyTaskParamsType1", + "InviteToSlackChannelRootlyTaskParams", + "InviteToSlackChannelTaskParamsType0", + "InviteToSlackChannelTaskParamsType1", + "InviteToSlackChannelTaskParamsType2", + "InviteToSlackChannelVictorOpsTaskParams", + "PageJsmopsOnCallRespondersTaskParams", + "PageOpsgenieOnCallRespondersTaskParams", + "PagePagerdutyOnCallRespondersTaskParams", + "PageRootlyOnCallRespondersTaskParams", + "PageVictorOpsOnCallRespondersTaskParamsType0", + "PageVictorOpsOnCallRespondersTaskParamsType1", + "PrintTaskParams", + "PublishIncidentTaskParams", + "RedisClientTaskParams", + "RemoveGoogleDocsPermissionsTaskParams", + "RenameGoogleChatSpaceTaskParams", + "RenameMicrosoftTeamsChannelTaskParams", + "RenameSlackChannelTaskParams", + "RunCommandHerokuTaskParams", + "SendDashboardReportTaskParams", + "SendEmailTaskParams", + "SendGoogleChatAttachmentsTaskParams", + "SendGoogleChatMessageTaskParams", + "SendMicrosoftTeamsBlocksTaskParamsType0", + "SendMicrosoftTeamsChatMessageTaskParams", + "SendMicrosoftTeamsMessageTaskParamsType0", + "SendSlackBlocksTaskParamsType0", + "SendSlackBlocksTaskParamsType1", + "SendSlackBlocksTaskParamsType2", + "SendSlackMessageTaskParamsType0", + "SendSlackMessageTaskParamsType1", + "SendSlackMessageTaskParamsType2", + "SendSmsTaskParams", + "SendWhatsappMessageTaskParams", + "SnapshotDatadogGraphTaskParams", + "SnapshotGrafanaDashboardTaskParams", + "SnapshotLookerLookTaskParams", + "SnapshotNewRelicGraphTaskParams", + "TriggerWorkflowTaskParams", + "TweetTwitterMessageTaskParams", + "UpdateActionItemTaskParams", + "UpdateAirtableTableRecordTaskParams", + "UpdateAsanaTaskTaskParams", + "UpdateAttachedAlertsTaskParams", + "UpdateClickupTaskTaskParams", + "UpdateCodaPageTaskParams", + "UpdateConfluencePageTaskParams", + "UpdateDatadogNotebookTaskParams", + "UpdateDropboxPaperPageTaskParams", + "UpdateGithubIssueTaskParams", + "UpdateGitlabIssueTaskParams", + "UpdateGoogleCalendarEventTaskParams", + "UpdateGoogleChatSpaceDescriptionTaskParams", + "UpdateGoogleDocsPageTaskParams", + "UpdateIncidentPostmortemTaskParams", + "UpdateIncidentStatusTimestampTaskParams", + "UpdateIncidentTaskParams", + "UpdateJiraIssueTaskParams", + "UpdateLinearIssueTaskParams", + "UpdateMotionTaskTaskParams", + "UpdateNotionPageTaskParams", + "UpdateOpsgenieAlertTaskParams", + "UpdateOpsgenieIncidentTaskParams", + "UpdatePagerdutyIncidentTaskParams", + "UpdatePagertreeAlertTaskParams", + "UpdateQuipPageTaskParams", + "UpdateServiceNowIncidentTaskParams", + "UpdateSharepointPageTaskParams", + "UpdateShortcutStoryTaskParams", + "UpdateShortcutTaskTaskParams", + "UpdateSlackChannelTopicTaskParams", + "UpdateStatusTaskParams", + "UpdateTrelloCardTaskParams", + "UpdateVictorOpsIncidentTaskParams", + "UpdateZendeskTicketTaskParams", + ]: try: if not isinstance(data, dict): raise TypeError() task_params_type_0 = AddActionItemTaskParams.from_dict(data) return task_params_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1315,7 +1360,7 @@ def _parse_task_params( task_params_type_1 = UpdateActionItemTaskParams.from_dict(data) return task_params_type_1 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1323,7 +1368,7 @@ def _parse_task_params( task_params_type_2 = AddRoleTaskParams.from_dict(data) return task_params_type_2 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1331,7 +1376,7 @@ def _parse_task_params( componentsschemasadd_slack_bookmark_task_params_type_0 = AddSlackBookmarkTaskParamsType0.from_dict(data) return componentsschemasadd_slack_bookmark_task_params_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1339,7 +1384,7 @@ def _parse_task_params( componentsschemasadd_slack_bookmark_task_params_type_1 = AddSlackBookmarkTaskParamsType1.from_dict(data) return componentsschemasadd_slack_bookmark_task_params_type_1 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1347,7 +1392,7 @@ def _parse_task_params( task_params_type_4 = AddTeamTaskParams.from_dict(data) return task_params_type_4 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1355,7 +1400,7 @@ def _parse_task_params( task_params_type_5 = AddToTimelineTaskParams.from_dict(data) return task_params_type_5 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1363,7 +1408,7 @@ def _parse_task_params( task_params_type_6 = ArchiveSlackChannelsTaskParams.from_dict(data) return task_params_type_6 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1371,7 +1416,7 @@ def _parse_task_params( task_params_type_7 = AttachDatadogDashboardsTaskParams.from_dict(data) return task_params_type_7 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1379,15 +1424,57 @@ def _parse_task_params( task_params_type_8 = AutoAssignRoleOpsgenieTaskParams.from_dict(data) return task_params_type_8 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + componentsschemasauto_assign_role_rootly_task_params_type_0 = ( + AutoAssignRoleRootlyTaskParamsType0.from_dict(data) + ) + + return componentsschemasauto_assign_role_rootly_task_params_type_0 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + componentsschemasauto_assign_role_rootly_task_params_type_1 = ( + AutoAssignRoleRootlyTaskParamsType1.from_dict(data) + ) + + return componentsschemasauto_assign_role_rootly_task_params_type_1 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + componentsschemasauto_assign_role_rootly_task_params_type_2 = ( + AutoAssignRoleRootlyTaskParamsType2.from_dict(data) + ) + + return componentsschemasauto_assign_role_rootly_task_params_type_2 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + componentsschemasauto_assign_role_rootly_task_params_type_3 = ( + AutoAssignRoleRootlyTaskParamsType3.from_dict(data) + ) + + return componentsschemasauto_assign_role_rootly_task_params_type_3 + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_9 = AutoAssignRoleRootlyTaskParams.from_dict(data) + componentsschemasauto_assign_role_rootly_task_params_type_4 = ( + AutoAssignRoleRootlyTaskParamsType4.from_dict(data) + ) - return task_params_type_9 - except (TypeError, ValueError, AttributeError, KeyError): + return componentsschemasauto_assign_role_rootly_task_params_type_4 + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1397,7 +1484,7 @@ def _parse_task_params( ) return componentsschemasauto_assign_role_pagerduty_task_params_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1407,7 +1494,7 @@ def _parse_task_params( ) return componentsschemasauto_assign_role_pagerduty_task_params_type_1 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1415,7 +1502,7 @@ def _parse_task_params( task_params_type_11 = UpdatePagerdutyIncidentTaskParams.from_dict(data) return task_params_type_11 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1423,7 +1510,7 @@ def _parse_task_params( task_params_type_12 = CreatePagerdutyStatusUpdateTaskParams.from_dict(data) return task_params_type_12 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1431,7 +1518,7 @@ def _parse_task_params( task_params_type_13 = CreatePagertreeAlertTaskParams.from_dict(data) return task_params_type_13 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1439,7 +1526,7 @@ def _parse_task_params( task_params_type_14 = UpdatePagertreeAlertTaskParams.from_dict(data) return task_params_type_14 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1447,7 +1534,7 @@ def _parse_task_params( task_params_type_15 = AutoAssignRoleVictorOpsTaskParams.from_dict(data) return task_params_type_15 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1455,7 +1542,7 @@ def _parse_task_params( task_params_type_16 = CallPeopleTaskParams.from_dict(data) return task_params_type_16 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1463,7 +1550,7 @@ def _parse_task_params( task_params_type_17 = CreateAirtableTableRecordTaskParams.from_dict(data) return task_params_type_17 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1471,7 +1558,7 @@ def _parse_task_params( task_params_type_18 = CreateAsanaSubtaskTaskParams.from_dict(data) return task_params_type_18 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1479,7 +1566,7 @@ def _parse_task_params( task_params_type_19 = CreateAsanaTaskTaskParams.from_dict(data) return task_params_type_19 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1487,7 +1574,7 @@ def _parse_task_params( task_params_type_20 = CreateConfluencePageTaskParams.from_dict(data) return task_params_type_20 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1495,7 +1582,7 @@ def _parse_task_params( task_params_type_21 = CreateDatadogNotebookTaskParams.from_dict(data) return task_params_type_21 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1503,7 +1590,7 @@ def _parse_task_params( task_params_type_22 = CreateCodaPageTaskParams.from_dict(data) return task_params_type_22 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1511,7 +1598,7 @@ def _parse_task_params( task_params_type_23 = CreateDropboxPaperPageTaskParams.from_dict(data) return task_params_type_23 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1519,7 +1606,7 @@ def _parse_task_params( task_params_type_24 = CreateGithubIssueTaskParams.from_dict(data) return task_params_type_24 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1527,7 +1614,7 @@ def _parse_task_params( task_params_type_25 = CreateGitlabIssueTaskParams.from_dict(data) return task_params_type_25 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1535,7 +1622,7 @@ def _parse_task_params( task_params_type_26 = CreateOutlookEventTaskParams.from_dict(data) return task_params_type_26 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1543,7 +1630,7 @@ def _parse_task_params( task_params_type_27 = CreateGoogleCalendarEventTaskParams.from_dict(data) return task_params_type_27 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1551,7 +1638,7 @@ def _parse_task_params( task_params_type_28 = UpdateGoogleDocsPageTaskParams.from_dict(data) return task_params_type_28 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1559,7 +1646,7 @@ def _parse_task_params( task_params_type_29 = UpdateCodaPageTaskParams.from_dict(data) return task_params_type_29 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1567,7 +1654,7 @@ def _parse_task_params( task_params_type_30 = UpdateGoogleCalendarEventTaskParams.from_dict(data) return task_params_type_30 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1575,7 +1662,7 @@ def _parse_task_params( task_params_type_31 = CreateSharepointPageTaskParams.from_dict(data) return task_params_type_31 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1583,7 +1670,7 @@ def _parse_task_params( task_params_type_32 = CreateGoogleDocsPageTaskParams.from_dict(data) return task_params_type_32 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1591,7 +1678,7 @@ def _parse_task_params( task_params_type_33 = CreateGoogleDocsPermissionsTaskParams.from_dict(data) return task_params_type_33 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1599,7 +1686,7 @@ def _parse_task_params( task_params_type_34 = RemoveGoogleDocsPermissionsTaskParams.from_dict(data) return task_params_type_34 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1607,7 +1694,7 @@ def _parse_task_params( task_params_type_35 = CreateQuipPageTaskParams.from_dict(data) return task_params_type_35 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1615,7 +1702,7 @@ def _parse_task_params( task_params_type_36 = CreateGoogleMeetingTaskParams.from_dict(data) return task_params_type_36 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1623,7 +1710,7 @@ def _parse_task_params( task_params_type_37 = CreateGoToMeetingTaskParams.from_dict(data) return task_params_type_37 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1631,7 +1718,7 @@ def _parse_task_params( task_params_type_38 = CreateIncidentTaskParams.from_dict(data) return task_params_type_38 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1639,7 +1726,7 @@ def _parse_task_params( task_params_type_39 = CreateSubIncidentTaskParams.from_dict(data) return task_params_type_39 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1647,7 +1734,7 @@ def _parse_task_params( task_params_type_40 = CreateIncidentPostmortemTaskParams.from_dict(data) return task_params_type_40 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1655,7 +1742,7 @@ def _parse_task_params( task_params_type_41 = CreateJiraIssueTaskParams.from_dict(data) return task_params_type_41 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1663,7 +1750,7 @@ def _parse_task_params( task_params_type_42 = CreateJiraSubtaskTaskParams.from_dict(data) return task_params_type_42 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1671,55 +1758,63 @@ def _parse_task_params( task_params_type_43 = AttachRetrospectivePdfToJiraIssueTaskParams.from_dict(data) return task_params_type_43 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_44 = CreateLinearIssueTaskParams.from_dict(data) + task_params_type_44 = AttachRetrospectivePdfToFreshserviceTicketTaskParams.from_dict(data) return task_params_type_44 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_45 = CreateLinearSubtaskIssueTaskParams.from_dict(data) + task_params_type_45 = CreateLinearIssueTaskParams.from_dict(data) return task_params_type_45 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_46 = CreateLinearIssueCommentTaskParams.from_dict(data) + task_params_type_46 = CreateLinearSubtaskIssueTaskParams.from_dict(data) return task_params_type_46 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_47 = CreateMicrosoftTeamsMeetingTaskParams.from_dict(data) + task_params_type_47 = CreateLinearIssueCommentTaskParams.from_dict(data) return task_params_type_47 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_48 = CreateMicrosoftTeamsChannelTaskParams.from_dict(data) + task_params_type_48 = CreateMicrosoftTeamsMeetingTaskParams.from_dict(data) return task_params_type_48 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_49 = CreateMicrosoftTeamsChatTaskParams.from_dict(data) + task_params_type_49 = CreateMicrosoftTeamsChannelTaskParams.from_dict(data) return task_params_type_49 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + task_params_type_50 = CreateMicrosoftTeamsChatTaskParams.from_dict(data) + + return task_params_type_50 + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1729,7 +1824,7 @@ def _parse_task_params( ) return componentsschemasadd_microsoft_teams_tab_task_params_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1739,111 +1834,111 @@ def _parse_task_params( ) return componentsschemasadd_microsoft_teams_tab_task_params_type_1 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_51 = AddMicrosoftTeamsChatTabTaskParams.from_dict(data) - - return task_params_type_51 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - task_params_type_52 = CreateGoogleChatSpaceTaskParams.from_dict(data) + task_params_type_52 = AddMicrosoftTeamsChatTabTaskParams.from_dict(data) return task_params_type_52 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_53 = SendGoogleChatMessageTaskParams.from_dict(data) + task_params_type_53 = CreateGoogleChatSpaceTaskParams.from_dict(data) return task_params_type_53 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_54 = SendGoogleChatAttachmentsTaskParams.from_dict(data) + task_params_type_54 = SendGoogleChatMessageTaskParams.from_dict(data) return task_params_type_54 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_55 = InviteToGoogleChatSpaceTaskParams.from_dict(data) + task_params_type_55 = SendGoogleChatAttachmentsTaskParams.from_dict(data) return task_params_type_55 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_56 = ArchiveGoogleChatSpacesTaskParams.from_dict(data) + task_params_type_56 = InviteToGoogleChatSpaceTaskParams.from_dict(data) return task_params_type_56 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_57 = RenameGoogleChatSpaceTaskParams.from_dict(data) + task_params_type_57 = ArchiveGoogleChatSpacesTaskParams.from_dict(data) return task_params_type_57 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_58 = UpdateGoogleChatSpaceDescriptionTaskParams.from_dict(data) + task_params_type_58 = RenameGoogleChatSpaceTaskParams.from_dict(data) return task_params_type_58 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_59 = ChangeGoogleChatSpacePrivacyTaskParams.from_dict(data) + task_params_type_59 = UpdateGoogleChatSpaceDescriptionTaskParams.from_dict(data) return task_params_type_59 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_60 = ArchiveMicrosoftTeamsChannelsTaskParams.from_dict(data) + task_params_type_60 = ChangeGoogleChatSpacePrivacyTaskParams.from_dict(data) return task_params_type_60 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_61 = RenameMicrosoftTeamsChannelTaskParams.from_dict(data) + task_params_type_61 = ArchiveMicrosoftTeamsChannelsTaskParams.from_dict(data) return task_params_type_61 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_62 = InviteToMicrosoftTeamsChannelTaskParams.from_dict(data) + task_params_type_62 = RenameMicrosoftTeamsChannelTaskParams.from_dict(data) return task_params_type_62 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_63 = CreateNotionPageTaskParams.from_dict(data) + task_params_type_63 = InviteToMicrosoftTeamsChannelTaskParams.from_dict(data) return task_params_type_63 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + task_params_type_64 = CreateNotionPageTaskParams.from_dict(data) + + return task_params_type_64 + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1853,15 +1948,15 @@ def _parse_task_params( ) return componentsschemassend_microsoft_teams_message_task_params_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_65 = SendMicrosoftTeamsChatMessageTaskParams.from_dict(data) + task_params_type_66 = SendMicrosoftTeamsChatMessageTaskParams.from_dict(data) - return task_params_type_65 - except (TypeError, ValueError, AttributeError, KeyError): + return task_params_type_66 + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1871,63 +1966,63 @@ def _parse_task_params( ) return componentsschemassend_microsoft_teams_blocks_task_params_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - task_params_type_67 = UpdateNotionPageTaskParams.from_dict(data) - - return task_params_type_67 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_68 = UpdateQuipPageTaskParams.from_dict(data) + task_params_type_68 = UpdateNotionPageTaskParams.from_dict(data) return task_params_type_68 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_69 = UpdateConfluencePageTaskParams.from_dict(data) + task_params_type_69 = UpdateQuipPageTaskParams.from_dict(data) return task_params_type_69 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_70 = UpdateSharepointPageTaskParams.from_dict(data) + task_params_type_70 = UpdateConfluencePageTaskParams.from_dict(data) return task_params_type_70 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_71 = UpdateDropboxPaperPageTaskParams.from_dict(data) + task_params_type_71 = UpdateSharepointPageTaskParams.from_dict(data) return task_params_type_71 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_72 = UpdateDatadogNotebookTaskParams.from_dict(data) + task_params_type_72 = UpdateDropboxPaperPageTaskParams.from_dict(data) return task_params_type_72 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_73 = CreateServiceNowIncidentTaskParams.from_dict(data) + task_params_type_73 = UpdateDatadogNotebookTaskParams.from_dict(data) return task_params_type_73 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + task_params_type_74 = CreateServiceNowIncidentTaskParams.from_dict(data) + + return task_params_type_74 + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1937,7 +2032,7 @@ def _parse_task_params( ) return componentsschemascreate_shortcut_story_task_params_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -1947,71 +2042,71 @@ def _parse_task_params( ) return componentsschemascreate_shortcut_story_task_params_type_1 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - task_params_type_75 = CreateShortcutTaskTaskParams.from_dict(data) - - return task_params_type_75 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_76 = CreateTrelloCardTaskParams.from_dict(data) + task_params_type_76 = CreateShortcutTaskTaskParams.from_dict(data) return task_params_type_76 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_77 = CreateWebexMeetingTaskParams.from_dict(data) + task_params_type_77 = CreateTrelloCardTaskParams.from_dict(data) return task_params_type_77 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_78 = CreateZendeskTicketTaskParams.from_dict(data) + task_params_type_78 = CreateWebexMeetingTaskParams.from_dict(data) return task_params_type_78 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_79 = CreateZendeskJiraLinkTaskParams.from_dict(data) + task_params_type_79 = CreateZendeskTicketTaskParams.from_dict(data) return task_params_type_79 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_80 = CreateClickupTaskTaskParams.from_dict(data) + task_params_type_80 = CreateZendeskJiraLinkTaskParams.from_dict(data) return task_params_type_80 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_81 = CreateMotionTaskTaskParams.from_dict(data) + task_params_type_81 = CreateClickupTaskTaskParams.from_dict(data) return task_params_type_81 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_82 = CreateZoomMeetingTaskParams.from_dict(data) + task_params_type_82 = CreateMotionTaskTaskParams.from_dict(data) return task_params_type_82 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + task_params_type_83 = CreateZoomMeetingTaskParams.from_dict(data) + + return task_params_type_83 + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -2019,7 +2114,7 @@ def _parse_task_params( componentsschemasget_github_commits_task_params_type_0 = GetGithubCommitsTaskParamsType0.from_dict(data) return componentsschemasget_github_commits_task_params_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -2027,7 +2122,7 @@ def _parse_task_params( componentsschemasget_github_commits_task_params_type_1 = GetGithubCommitsTaskParamsType1.from_dict(data) return componentsschemasget_github_commits_task_params_type_1 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -2035,7 +2130,7 @@ def _parse_task_params( componentsschemasget_gitlab_commits_task_params_type_0 = GetGitlabCommitsTaskParamsType0.from_dict(data) return componentsschemasget_gitlab_commits_task_params_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -2043,55 +2138,55 @@ def _parse_task_params( componentsschemasget_gitlab_commits_task_params_type_1 = GetGitlabCommitsTaskParamsType1.from_dict(data) return componentsschemasget_gitlab_commits_task_params_type_1 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_85 = GetPulsesTaskParams.from_dict(data) - - return task_params_type_85 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - task_params_type_86 = GetAlertsTaskParams.from_dict(data) + task_params_type_86 = GetPulsesTaskParams.from_dict(data) return task_params_type_86 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_87 = HttpClientTaskParams.from_dict(data) + task_params_type_87 = GetAlertsTaskParams.from_dict(data) return task_params_type_87 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_88 = InviteToSlackChannelOpsgenieTaskParams.from_dict(data) + task_params_type_88 = HttpClientTaskParams.from_dict(data) return task_params_type_88 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_89 = InviteToSlackChannelRootlyTaskParams.from_dict(data) + task_params_type_89 = InviteToSlackChannelOpsgenieTaskParams.from_dict(data) return task_params_type_89 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_90 = InviteToMicrosoftTeamsChannelRootlyTaskParams.from_dict(data) + task_params_type_90 = InviteToSlackChannelRootlyTaskParams.from_dict(data) return task_params_type_90 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + task_params_type_91 = InviteToMicrosoftTeamsChannelRootlyTaskParams.from_dict(data) + + return task_params_type_91 + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -2101,7 +2196,7 @@ def _parse_task_params( ) return componentsschemasinvite_to_slack_channel_pagerduty_task_params_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -2111,7 +2206,7 @@ def _parse_task_params( ) return componentsschemasinvite_to_slack_channel_pagerduty_task_params_type_1 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -2121,7 +2216,7 @@ def _parse_task_params( ) return componentsschemasinvite_to_slack_channel_task_params_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -2131,7 +2226,7 @@ def _parse_task_params( ) return componentsschemasinvite_to_slack_channel_task_params_type_1 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -2141,79 +2236,79 @@ def _parse_task_params( ) return componentsschemasinvite_to_slack_channel_task_params_type_2 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_93 = InviteToSlackChannelVictorOpsTaskParams.from_dict(data) - - return task_params_type_93 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - task_params_type_94 = PageOpsgenieOnCallRespondersTaskParams.from_dict(data) + task_params_type_94 = InviteToSlackChannelVictorOpsTaskParams.from_dict(data) return task_params_type_94 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_95 = CreateOpsgenieAlertTaskParams.from_dict(data) + task_params_type_95 = PageOpsgenieOnCallRespondersTaskParams.from_dict(data) return task_params_type_95 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_96 = CreateJsmopsAlertTaskParams.from_dict(data) + task_params_type_96 = CreateOpsgenieAlertTaskParams.from_dict(data) return task_params_type_96 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_97 = PageJsmopsOnCallRespondersTaskParams.from_dict(data) + task_params_type_97 = CreateJsmopsAlertTaskParams.from_dict(data) return task_params_type_97 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_98 = UpdateOpsgenieAlertTaskParams.from_dict(data) + task_params_type_98 = PageJsmopsOnCallRespondersTaskParams.from_dict(data) return task_params_type_98 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_99 = UpdateOpsgenieIncidentTaskParams.from_dict(data) + task_params_type_99 = UpdateOpsgenieAlertTaskParams.from_dict(data) return task_params_type_99 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_100 = PageRootlyOnCallRespondersTaskParams.from_dict(data) + task_params_type_100 = UpdateOpsgenieIncidentTaskParams.from_dict(data) return task_params_type_100 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_101 = PagePagerdutyOnCallRespondersTaskParams.from_dict(data) + task_params_type_101 = PageRootlyOnCallRespondersTaskParams.from_dict(data) return task_params_type_101 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + task_params_type_102 = PagePagerdutyOnCallRespondersTaskParams.from_dict(data) + + return task_params_type_102 + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -2223,7 +2318,7 @@ def _parse_task_params( ) return componentsschemaspage_victor_ops_on_call_responders_task_params_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -2233,87 +2328,87 @@ def _parse_task_params( ) return componentsschemaspage_victor_ops_on_call_responders_task_params_type_1 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - task_params_type_103 = UpdateVictorOpsIncidentTaskParams.from_dict(data) - - return task_params_type_103 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_104 = PrintTaskParams.from_dict(data) + task_params_type_104 = UpdateVictorOpsIncidentTaskParams.from_dict(data) return task_params_type_104 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_105 = PublishIncidentTaskParams.from_dict(data) + task_params_type_105 = PrintTaskParams.from_dict(data) return task_params_type_105 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_106 = RedisClientTaskParams.from_dict(data) + task_params_type_106 = PublishIncidentTaskParams.from_dict(data) return task_params_type_106 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_107 = RenameSlackChannelTaskParams.from_dict(data) + task_params_type_107 = RedisClientTaskParams.from_dict(data) return task_params_type_107 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_108 = ChangeSlackChannelPrivacyTaskParams.from_dict(data) + task_params_type_108 = RenameSlackChannelTaskParams.from_dict(data) return task_params_type_108 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_109 = RunCommandHerokuTaskParams.from_dict(data) + task_params_type_109 = ChangeSlackChannelPrivacyTaskParams.from_dict(data) return task_params_type_109 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_110 = SendEmailTaskParams.from_dict(data) + task_params_type_110 = RunCommandHerokuTaskParams.from_dict(data) return task_params_type_110 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_111 = SendDashboardReportTaskParams.from_dict(data) + task_params_type_111 = SendEmailTaskParams.from_dict(data) return task_params_type_111 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_112 = CreateSlackChannelTaskParams.from_dict(data) + task_params_type_112 = SendDashboardReportTaskParams.from_dict(data) return task_params_type_112 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + task_params_type_113 = CreateSlackChannelTaskParams.from_dict(data) + + return task_params_type_113 + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -2321,7 +2416,7 @@ def _parse_task_params( componentsschemassend_slack_message_task_params_type_0 = SendSlackMessageTaskParamsType0.from_dict(data) return componentsschemassend_slack_message_task_params_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -2329,7 +2424,7 @@ def _parse_task_params( componentsschemassend_slack_message_task_params_type_1 = SendSlackMessageTaskParamsType1.from_dict(data) return componentsschemassend_slack_message_task_params_type_1 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -2337,223 +2432,223 @@ def _parse_task_params( componentsschemassend_slack_message_task_params_type_2 = SendSlackMessageTaskParamsType2.from_dict(data) return componentsschemassend_slack_message_task_params_type_2 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_114 = SendSmsTaskParams.from_dict(data) - - return task_params_type_114 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - task_params_type_115 = SendWhatsappMessageTaskParams.from_dict(data) + task_params_type_115 = SendSmsTaskParams.from_dict(data) return task_params_type_115 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_116 = SnapshotDatadogGraphTaskParams.from_dict(data) + task_params_type_116 = SendWhatsappMessageTaskParams.from_dict(data) return task_params_type_116 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_117 = SnapshotGrafanaDashboardTaskParams.from_dict(data) + task_params_type_117 = SnapshotDatadogGraphTaskParams.from_dict(data) return task_params_type_117 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_118 = SnapshotLookerLookTaskParams.from_dict(data) + task_params_type_118 = SnapshotGrafanaDashboardTaskParams.from_dict(data) return task_params_type_118 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_119 = SnapshotNewRelicGraphTaskParams.from_dict(data) + task_params_type_119 = SnapshotLookerLookTaskParams.from_dict(data) return task_params_type_119 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_120 = TweetTwitterMessageTaskParams.from_dict(data) + task_params_type_120 = SnapshotNewRelicGraphTaskParams.from_dict(data) return task_params_type_120 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_121 = UpdateAirtableTableRecordTaskParams.from_dict(data) + task_params_type_121 = TweetTwitterMessageTaskParams.from_dict(data) return task_params_type_121 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_122 = UpdateAsanaTaskTaskParams.from_dict(data) + task_params_type_122 = UpdateAirtableTableRecordTaskParams.from_dict(data) return task_params_type_122 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_123 = UpdateGithubIssueTaskParams.from_dict(data) + task_params_type_123 = UpdateAsanaTaskTaskParams.from_dict(data) return task_params_type_123 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_124 = UpdateGitlabIssueTaskParams.from_dict(data) + task_params_type_124 = UpdateGithubIssueTaskParams.from_dict(data) return task_params_type_124 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_125 = UpdateIncidentTaskParams.from_dict(data) + task_params_type_125 = UpdateGitlabIssueTaskParams.from_dict(data) return task_params_type_125 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_126 = UpdateIncidentPostmortemTaskParams.from_dict(data) + task_params_type_126 = UpdateIncidentTaskParams.from_dict(data) return task_params_type_126 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_127 = UpdateJiraIssueTaskParams.from_dict(data) + task_params_type_127 = UpdateIncidentPostmortemTaskParams.from_dict(data) return task_params_type_127 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_128 = UpdateLinearIssueTaskParams.from_dict(data) + task_params_type_128 = UpdateJiraIssueTaskParams.from_dict(data) return task_params_type_128 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_129 = UpdateServiceNowIncidentTaskParams.from_dict(data) + task_params_type_129 = UpdateLinearIssueTaskParams.from_dict(data) return task_params_type_129 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_130 = UpdateShortcutStoryTaskParams.from_dict(data) + task_params_type_130 = UpdateServiceNowIncidentTaskParams.from_dict(data) return task_params_type_130 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_131 = UpdateShortcutTaskTaskParams.from_dict(data) + task_params_type_131 = UpdateShortcutStoryTaskParams.from_dict(data) return task_params_type_131 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_132 = UpdateSlackChannelTopicTaskParams.from_dict(data) + task_params_type_132 = UpdateShortcutTaskTaskParams.from_dict(data) return task_params_type_132 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_133 = UpdateStatusTaskParams.from_dict(data) + task_params_type_133 = UpdateSlackChannelTopicTaskParams.from_dict(data) return task_params_type_133 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_134 = UpdateIncidentStatusTimestampTaskParams.from_dict(data) + task_params_type_134 = UpdateStatusTaskParams.from_dict(data) return task_params_type_134 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_135 = UpdateTrelloCardTaskParams.from_dict(data) + task_params_type_135 = UpdateIncidentStatusTimestampTaskParams.from_dict(data) return task_params_type_135 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_136 = UpdateClickupTaskTaskParams.from_dict(data) + task_params_type_136 = UpdateTrelloCardTaskParams.from_dict(data) return task_params_type_136 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_137 = UpdateMotionTaskTaskParams.from_dict(data) + task_params_type_137 = UpdateClickupTaskTaskParams.from_dict(data) return task_params_type_137 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_138 = UpdateZendeskTicketTaskParams.from_dict(data) + task_params_type_138 = UpdateMotionTaskTaskParams.from_dict(data) return task_params_type_138 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_139 = UpdateAttachedAlertsTaskParams.from_dict(data) + task_params_type_139 = UpdateZendeskTicketTaskParams.from_dict(data) return task_params_type_139 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_140 = TriggerWorkflowTaskParams.from_dict(data) + task_params_type_140 = UpdateAttachedAlertsTaskParams.from_dict(data) return task_params_type_140 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + task_params_type_141 = TriggerWorkflowTaskParams.from_dict(data) + + return task_params_type_141 + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -2561,7 +2656,7 @@ def _parse_task_params( componentsschemassend_slack_blocks_task_params_type_0 = SendSlackBlocksTaskParamsType0.from_dict(data) return componentsschemassend_slack_blocks_task_params_type_0 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -2569,7 +2664,7 @@ def _parse_task_params( componentsschemassend_slack_blocks_task_params_type_1 = SendSlackBlocksTaskParamsType1.from_dict(data) return componentsschemassend_slack_blocks_task_params_type_1 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): @@ -2577,45 +2672,45 @@ def _parse_task_params( componentsschemassend_slack_blocks_task_params_type_2 = SendSlackBlocksTaskParamsType2.from_dict(data) return componentsschemassend_slack_blocks_task_params_type_2 - except (TypeError, ValueError, AttributeError, KeyError): + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_142 = CreateOpenaiChatCompletionTaskParams.from_dict(data) + task_params_type_143 = CreateOpenaiChatCompletionTaskParams.from_dict(data) - return task_params_type_142 - except (TypeError, ValueError, AttributeError, KeyError): + return task_params_type_143 + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_143 = CreateWatsonxChatCompletionTaskParams.from_dict(data) + task_params_type_144 = CreateWatsonxChatCompletionTaskParams.from_dict(data) - return task_params_type_143 - except (TypeError, ValueError, AttributeError, KeyError): + return task_params_type_144 + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_144 = CreateGoogleGeminiChatCompletionTaskParams.from_dict(data) + task_params_type_145 = CreateGoogleGeminiChatCompletionTaskParams.from_dict(data) - return task_params_type_144 - except (TypeError, ValueError, AttributeError, KeyError): + return task_params_type_145 + except: # noqa: E722 pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_145 = CreateMistralChatCompletionTaskParams.from_dict(data) + task_params_type_146 = CreateMistralChatCompletionTaskParams.from_dict(data) - return task_params_type_145 - except (TypeError, ValueError, AttributeError, KeyError): + return task_params_type_146 + except: # noqa: E722 pass if not isinstance(data, dict): raise TypeError() - task_params_type_146 = CreateAnthropicChatCompletionTaskParams.from_dict(data) + task_params_type_147 = CreateAnthropicChatCompletionTaskParams.from_dict(data) - return task_params_type_146 + return task_params_type_147 task_params = _parse_task_params(d.pop("task_params")) diff --git a/rootly_sdk/models/workflow_task_list.py b/rootly_sdk/models/workflow_task_list.py index 147ac020..10807fda 100644 --- a/rootly_sdk/models/workflow_task_list.py +++ b/rootly_sdk/models/workflow_task_list.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,20 +20,19 @@ class WorkflowTaskList: """ Attributes: - data (list[WorkflowTaskListDataItem]): + data (list['WorkflowTaskListDataItem']): links (Links): meta (Meta): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: list[WorkflowTaskListDataItem] - links: Links - meta: Meta - included: list[JsonapiIncludedResource] | Unset = UNSET + data: list["WorkflowTaskListDataItem"] + links: "Links" + meta: "Meta" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -45,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = Meta.from_dict(d.pop("meta")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) workflow_task_list = cls( data=data, diff --git a/rootly_sdk/models/workflow_task_list_data_item.py b/rootly_sdk/models/workflow_task_list_data_item.py index 9e144806..43d4b2c7 100644 --- a/rootly_sdk/models/workflow_task_list_data_item.py +++ b/rootly_sdk/models/workflow_task_list_data_item.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class WorkflowTaskListDataItem: id: str type_: WorkflowTaskListDataItemType - attributes: WorkflowTask + attributes: "WorkflowTask" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/models/workflow_task_response.py b/rootly_sdk/models/workflow_task_response.py index 26b15a77..33601361 100644 --- a/rootly_sdk/models/workflow_task_response.py +++ b/rootly_sdk/models/workflow_task_response.py @@ -1,7 +1,5 @@ -from __future__ import annotations - from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,18 +19,17 @@ class WorkflowTaskResponse: """ Attributes: data (WorkflowTaskResponseData): - included (list[JsonapiIncludedResource] | Unset): + included (Union[Unset, list['JsonapiIncludedResource']]): """ - data: WorkflowTaskResponseData - included: list[JsonapiIncludedResource] | Unset = UNSET + data: "WorkflowTaskResponseData" + included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data = self.data.to_dict() - included: list[dict[str, Any]] | Unset = UNSET + included: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -59,14 +56,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) data = WorkflowTaskResponseData.from_dict(d.pop("data")) + included = [] _included = d.pop("included", UNSET) - included: list[JsonapiIncludedResource] | Unset = UNSET - if _included is not UNSET: - included = [] - for included_item_data in _included: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + for included_item_data in _included or []: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) workflow_task_response = cls( data=data, diff --git a/rootly_sdk/models/workflow_task_response_data.py b/rootly_sdk/models/workflow_task_response_data.py index eb7f6834..73762081 100644 --- a/rootly_sdk/models/workflow_task_response_data.py +++ b/rootly_sdk/models/workflow_task_response_data.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,11 +27,10 @@ class WorkflowTaskResponseData: id: str type_: WorkflowTaskResponseDataType - attributes: WorkflowTask + attributes: "WorkflowTask" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id = self.id type_: str = self.type_ diff --git a/rootly_sdk/types.py b/rootly_sdk/types.py index b64af095..1b96ca40 100644 --- a/rootly_sdk/types.py +++ b/rootly_sdk/types.py @@ -2,7 +2,7 @@ from collections.abc import Mapping, MutableMapping from http import HTTPStatus -from typing import IO, BinaryIO, Generic, Literal, TypeVar +from typing import IO, BinaryIO, Generic, Literal, Optional, TypeVar, Union from attrs import define @@ -15,13 +15,13 @@ def __bool__(self) -> Literal[False]: UNSET: Unset = Unset() # The types that `httpx.Client(files=)` can accept, copied from that library. -FileContent = IO[bytes] | bytes | str -FileTypes = ( +FileContent = Union[IO[bytes], bytes, str] +FileTypes = Union[ # (filename, file (or bytes), content_type) - tuple[str | None, FileContent, str | None] + tuple[Optional[str], FileContent, Optional[str]], # (filename, file (or bytes), content_type, headers) - | tuple[str | None, FileContent, str | None, Mapping[str, str]] -) + tuple[Optional[str], FileContent, Optional[str], Mapping[str, str]], +] RequestFiles = list[tuple[str, FileTypes]] @@ -30,8 +30,8 @@ class File: """Contains information for file uploads""" payload: BinaryIO - file_name: str | None = None - mime_type: str | None = None + file_name: Optional[str] = None + mime_type: Optional[str] = None def to_tuple(self) -> FileTypes: """Return a tuple representation that httpx will accept for multipart/form-data""" @@ -48,7 +48,7 @@ class Response(Generic[T]): status_code: HTTPStatus content: bytes headers: MutableMapping[str, str] - parsed: T | None + parsed: Optional[T] __all__ = ["UNSET", "File", "FileTypes", "RequestFiles", "Response", "Unset"] From f3d2c4ef7c7c276a64f13796f7132878b53db2ac Mon Sep 17 00:00:00 2001 From: Quentin Rousseau Date: Fri, 14 Aug 2026 09:42:11 -0700 Subject: [PATCH 2/5] Align generated code with Ruff 0.16.3 --- .github/workflows/ci.yml | 2 +- Makefile | 5 +- rootly_sdk/api/ai_chat/create_ai_chat.py | 54 +- .../api/ai_chat/delete_ai_chat_session.py | 6 +- .../ai_chat/list_ai_chat_session_messages.py | 38 +- rootly_sdk/api/ai_chat/stream_ai_chat.py | 30 +- .../api/alert_events/create_alert_event.py | 18 +- .../api/alert_events/delete_alert_event.py | 18 +- .../api/alert_events/get_alert_event.py | 18 +- .../api/alert_events/list_alert_events.py | 64 +- .../alert_events/list_alert_events_feed.py | 130 +- .../api/alert_events/update_alert_event.py | 18 +- .../api/alert_fields/create_alert_field.py | 18 +- .../api/alert_fields/delete_alert_field.py | 28 +- .../api/alert_fields/get_alert_field.py | 28 +- .../api/alert_fields/list_alert_fields.py | 204 +- .../api/alert_fields/update_alert_field.py | 28 +- .../api/alert_groups/create_alert_group.py | 18 +- .../api/alert_groups/delete_alert_group.py | 28 +- .../api/alert_groups/get_alert_group.py | 28 +- .../api/alert_groups/list_alert_groups.py | 104 +- .../api/alert_groups/update_alert_group.py | 28 +- .../create_alert_retrigger_rule.py | 18 +- .../delete_alert_retrigger_rule.py | 6 +- .../get_alert_retrigger_rule.py | 12 +- .../list_alert_retrigger_rules.py | 12 +- .../update_alert_retrigger_rule.py | 12 +- .../api/alert_routes/create_alert_route.py | 18 +- .../api/alert_routes/delete_alert_route.py | 18 +- .../api/alert_routes/get_alert_route.py | 18 +- .../api/alert_routes/list_alert_routes.py | 148 +- .../api/alert_routes/patch_alert_route.py | 18 +- .../api/alert_routes/update_alert_route.py | 18 +- .../create_alert_routing_rule.py | 18 +- .../delete_alert_routing_rule.py | 28 +- .../get_alert_routing_rule.py | 28 +- .../list_alert_routing_rules.py | 192 +- .../update_alert_routing_rule.py | 28 +- .../api/alert_sources/create_alerts_source.py | 18 +- .../api/alert_sources/delete_alerts_source.py | 18 +- .../api/alert_sources/get_alerts_source.py | 18 +- .../api/alert_sources/list_alerts_sources.py | 104 +- .../api/alert_sources/update_alerts_source.py | 18 +- .../alert_urgencies/create_alert_urgency.py | 18 +- .../alert_urgencies/delete_alert_urgency.py | 18 +- .../api/alert_urgencies/get_alert_urgency.py | 18 +- .../alert_urgencies/list_alert_urgencies.py | 154 +- .../alert_urgencies/update_alert_urgency.py | 18 +- rootly_sdk/api/alerts/acknowledge_alert.py | 18 +- rootly_sdk/api/alerts/attach_alert.py | 18 +- rootly_sdk/api/alerts/create_alert.py | 18 +- rootly_sdk/api/alerts/escalate_alert.py | 18 +- rootly_sdk/api/alerts/get_alert.py | 30 +- rootly_sdk/api/alerts/get_receipt.py | 18 +- rootly_sdk/api/alerts/list_alerts.py | 512 ++--- rootly_sdk/api/alerts/list_incident_alerts.py | 22 +- rootly_sdk/api/alerts/resolve_alert.py | 18 +- rootly_sdk/api/alerts/snooze_alert.py | 18 +- rootly_sdk/api/alerts/update_alert.py | 18 +- rootly_sdk/api/api_keys/create_api_key.py | 18 +- rootly_sdk/api/api_keys/delete_api_key.py | 18 +- rootly_sdk/api/api_keys/get_api_key.py | 28 +- rootly_sdk/api/api_keys/list_api_keys.py | 258 +-- rootly_sdk/api/api_keys/rotate_api_key.py | 18 +- rootly_sdk/api/api_keys/update_api_key.py | 18 +- rootly_sdk/api/audits/list_audits.py | 290 +-- .../authorizations/create_authorization.py | 18 +- .../authorizations/delete_authorization.py | 18 +- .../api/authorizations/get_authorization.py | 18 +- .../api/authorizations/list_authorizations.py | 134 +- .../authorizations/update_authorization.py | 18 +- .../create_catalog_checklist_template.py | 18 +- .../delete_catalog_checklist_template.py | 28 +- .../get_catalog_checklist_template.py | 28 +- .../list_catalog_checklist_templates.py | 136 +- .../trigger_catalog_checklist_template.py | 28 +- .../update_catalog_checklist_template.py | 28 +- .../bulk_delete_catalog_entities.py | 24 +- .../bulk_upsert_catalog_entities.py | 30 +- .../catalog_entities/create_catalog_entity.py | 18 +- .../catalog_entities/delete_catalog_entity.py | 28 +- .../catalog_entities/get_catalog_entity.py | 40 +- .../catalog_entities/list_catalog_entities.py | 278 ++- .../catalog_entities/update_catalog_entity.py | 28 +- .../get_catalog_entity_checklist.py | 18 +- .../list_catalog_entity_checklists.py | 112 +- .../create_catalog_entity_property.py | 18 +- .../delete_catalog_entity_property.py | 18 +- .../get_catalog_entity_property.py | 30 +- .../list_catalog_entity_properties.py | 116 +- .../update_catalog_entity_property.py | 18 +- .../create_catalog_property.py | 6 +- .../delete_catalog_property.py | 6 +- .../get_catalog_property.py | 6 +- .../list_catalog_properties.py | 6 +- .../update_catalog_property.py | 6 +- rootly_sdk/api/catalogs/create_catalog.py | 18 +- rootly_sdk/api/catalogs/delete_catalog.py | 28 +- rootly_sdk/api/catalogs/get_catalog.py | 28 +- rootly_sdk/api/catalogs/list_catalogs.py | 264 +-- rootly_sdk/api/catalogs/update_catalog.py | 28 +- rootly_sdk/api/causes/create_cause.py | 18 +- .../causes/create_cause_catalog_property.py | 18 +- rootly_sdk/api/causes/delete_cause.py | 28 +- rootly_sdk/api/causes/get_cause.py | 28 +- .../causes/list_cause_catalog_properties.py | 128 +- rootly_sdk/api/causes/list_causes.py | 190 +- rootly_sdk/api/causes/update_cause.py | 28 +- .../create_communications_group.py | 18 +- .../delete_communications_group.py | 18 +- .../get_communications_group.py | 18 +- .../list_communications_groups.py | 142 +- .../update_communications_group.py | 18 +- .../create_communications_stage.py | 18 +- .../delete_communications_stage.py | 18 +- .../get_communications_stage.py | 18 +- .../list_communications_stages.py | 112 +- .../update_communications_stage.py | 18 +- .../create_communications_template.py | 18 +- .../delete_communications_template.py | 18 +- .../get_communications_template.py | 18 +- .../list_communications_templates.py | 122 +- .../update_communications_template.py | 18 +- .../create_communications_type.py | 18 +- .../delete_communications_type.py | 18 +- .../get_communications_type.py | 18 +- .../list_communications_types.py | 112 +- .../update_communications_type.py | 18 +- .../api/custom_forms/create_custom_form.py | 18 +- .../api/custom_forms/delete_custom_form.py | 28 +- .../api/custom_forms/get_custom_form.py | 28 +- .../api/custom_forms/list_custom_forms.py | 128 +- .../api/custom_forms/update_custom_form.py | 28 +- .../create_dashboard_panel.py | 18 +- .../delete_dashboard_panel.py | 12 +- .../duplicate_dashboard_panel.py | 18 +- .../dashboard_panels/get_dashboard_panel.py | 42 +- .../dashboard_panels/list_dashboard_panels.py | 44 +- .../update_dashboard_panel.py | 12 +- rootly_sdk/api/dashboards/create_dashboard.py | 18 +- rootly_sdk/api/dashboards/delete_dashboard.py | 28 +- .../api/dashboards/duplicate_dashboard.py | 28 +- rootly_sdk/api/dashboards/get_dashboard.py | 40 +- rootly_sdk/api/dashboards/list_dashboards.py | 42 +- .../api/dashboards/set_default_dashboard.py | 28 +- rootly_sdk/api/dashboards/update_dashboard.py | 28 +- .../create_custom_field_option.py | 18 +- .../delete_custom_field_option.py | 18 +- .../get_custom_field_option.py | 18 +- .../list_custom_field_options.py | 62 +- .../update_custom_field_option.py | 18 +- .../create_custom_field.py | 18 +- .../delete_custom_field.py | 18 +- .../get_custom_field.py | 30 +- .../list_custom_fields.py | 298 ++- .../update_custom_field.py | 18 +- .../create_incident_custom_field_selection.py | 18 +- .../delete_incident_custom_field_selection.py | 18 +- .../get_incident_custom_field_selection.py | 18 +- .../list_incident_custom_field_selections.py | 42 +- .../update_incident_custom_field_selection.py | 18 +- .../create_workflow_custom_field_selection.py | 18 +- .../delete_workflow_custom_field_selection.py | 18 +- .../get_workflow_custom_field_selection.py | 18 +- .../list_workflow_custom_field_selections.py | 42 +- .../update_workflow_custom_field_selection.py | 18 +- .../create_edge_connector_action.py | 6 +- .../delete_edge_connector_action.py | 12 +- .../get_edge_connector_action.py | 12 +- .../list_edge_connector_actions.py | 6 +- .../update_edge_connector_action.py | 12 +- .../edge_connectors/create_edge_connector.py | 6 +- .../edge_connectors/delete_edge_connector.py | 6 +- .../api/edge_connectors/get_edge_connector.py | 6 +- .../edge_connectors/list_edge_connectors.py | 30 +- .../edge_connectors/update_edge_connector.py | 6 +- .../environments/bulk_delete_environments.py | 30 +- .../environments/bulk_upsert_environments.py | 18 +- .../api/environments/create_environment.py | 18 +- .../create_environment_catalog_property.py | 18 +- .../api/environments/delete_environment.py | 28 +- .../api/environments/get_environment.py | 28 +- .../list_environment_catalog_properties.py | 128 +- .../api/environments/list_environments.py | 254 ++- .../api/environments/update_environment.py | 28 +- .../delete_escalation_level.py | 18 +- .../escalation_levels/get_escalation_level.py | 18 +- .../update_escalation_level.py | 18 +- .../create_escalation_level_paths.py | 18 +- .../list_escalation_levels_paths.py | 42 +- .../create_escalation_level.py | 18 +- .../list_escalation_levels.py | 42 +- .../create_escalation_path.py | 18 +- .../delete_escalation_path.py | 18 +- .../escalation_paths/get_escalation_path.py | 30 +- .../escalation_paths/list_escalation_paths.py | 56 +- .../update_escalation_path.py | 18 +- .../create_escalation_policy.py | 18 +- .../delete_escalation_policy.py | 18 +- .../get_escalation_policy.py | 30 +- .../list_escalation_policies.py | 194 +- .../update_escalation_policy.py | 18 +- .../create_form_field_option.py | 18 +- .../delete_form_field_option.py | 18 +- .../get_form_field_option.py | 18 +- .../list_form_field_options.py | 64 +- .../update_form_field_option.py | 18 +- .../create_form_field_placement_condition.py | 18 +- .../delete_form_field_placement_condition.py | 18 +- .../get_form_field_placement_condition.py | 18 +- .../list_form_field_placement_conditions.py | 52 +- .../update_form_field_placement_condition.py | 18 +- .../create_form_field_placement.py | 18 +- .../delete_form_field_placement.py | 18 +- .../get_form_field_placement.py | 18 +- .../list_form_field_placements.py | 52 +- .../update_form_field_placement.py | 18 +- .../create_form_field_position.py | 18 +- .../delete_form_field_position.py | 18 +- .../get_form_field_position.py | 18 +- .../list_form_field_positions.py | 52 +- .../update_form_field_position.py | 18 +- .../api/form_fields/create_form_field.py | 18 +- .../api/form_fields/delete_form_field.py | 28 +- rootly_sdk/api/form_fields/get_form_field.py | 40 +- .../api/form_fields/list_form_fields.py | 292 +-- .../api/form_fields/update_form_field.py | 28 +- .../create_form_set_condition.py | 18 +- .../delete_form_set_condition.py | 18 +- .../get_form_set_condition.py | 18 +- .../list_form_set_conditions.py | 52 +- .../update_form_set_condition.py | 18 +- rootly_sdk/api/form_sets/create_form_set.py | 18 +- rootly_sdk/api/form_sets/delete_form_set.py | 28 +- rootly_sdk/api/form_sets/get_form_set.py | 28 +- rootly_sdk/api/form_sets/list_form_sets.py | 100 +- rootly_sdk/api/form_sets/update_form_set.py | 28 +- .../bulk_delete_functionalities.py | 24 +- .../bulk_upsert_functionalities.py | 30 +- .../functionalities/create_functionality.py | 18 +- .../create_functionality_catalog_property.py | 18 +- .../functionalities/delete_functionality.py | 28 +- .../api/functionalities/get_functionality.py | 28 +- .../get_functionality_incidents_chart.py | 28 +- .../get_functionality_uptime_chart.py | 38 +- .../functionalities/list_functionalities.py | 244 ++- .../list_functionality_catalog_properties.py | 128 +- .../functionalities/update_functionality.py | 28 +- rootly_sdk/api/heartbeats/create_heartbeat.py | 18 +- rootly_sdk/api/heartbeats/delete_heartbeat.py | 28 +- rootly_sdk/api/heartbeats/get_heartbeat.py | 28 +- rootly_sdk/api/heartbeats/list_heartbeats.py | 110 +- rootly_sdk/api/heartbeats/ping_heartbeat.py | 18 +- rootly_sdk/api/heartbeats/update_heartbeat.py | 28 +- .../create_incident_action_item.py | 18 +- .../delete_incident_action_item.py | 18 +- .../get_incident_action_items.py | 18 +- .../list_all_incident_action_items.py | 372 ++-- .../list_incident_action_items.py | 42 +- .../update_incident_action_item.py | 18 +- .../create_incident_event_functionality.py | 18 +- .../delete_incident_event_functionality.py | 18 +- .../get_incident_event_functionalities.py | 18 +- .../list_incident_event_functionalities.py | 42 +- .../update_incident_event_functionality.py | 18 +- .../create_incident_event_service.py | 18 +- .../delete_incident_event_service.py | 18 +- .../get_incident_event_services.py | 18 +- .../list_incident_event_services.py | 42 +- .../update_incident_event_service.py | 18 +- .../incident_events/create_incident_event.py | 18 +- .../incident_events/delete_incident_event.py | 18 +- .../incident_events/get_incident_events.py | 18 +- .../incident_events/list_incident_events.py | 44 +- .../incident_events/update_incident_event.py | 18 +- .../create_incident_feedback.py | 18 +- .../get_incident_feedbacks.py | 18 +- .../list_incident_feedbacks.py | 42 +- .../update_incident_feedback.py | 18 +- .../create_incident_form_field_selection.py | 18 +- .../delete_incident_form_field_selection.py | 18 +- .../get_incident_form_field_selection.py | 18 +- .../list_incident_form_field_selections.py | 42 +- .../update_incident_form_field_selection.py | 18 +- .../create_incident_permission_set_boolean.py | 18 +- .../delete_incident_permission_set_boolean.py | 18 +- .../get_incident_permission_set_boolean.py | 18 +- .../list_incident_permission_set_booleans.py | 102 +- .../update_incident_permission_set_boolean.py | 18 +- ...create_incident_permission_set_resource.py | 18 +- ...delete_incident_permission_set_resource.py | 18 +- .../get_incident_permission_set_resource.py | 18 +- .../list_incident_permission_set_resources.py | 102 +- ...update_incident_permission_set_resource.py | 18 +- .../create_incident_permission_set.py | 18 +- .../delete_incident_permission_set.py | 28 +- .../get_incident_permission_set.py | 28 +- .../list_incident_permission_sets.py | 122 +- .../update_incident_permission_set.py | 28 +- .../get_incident_retrospective_step.py | 18 +- .../update_incident_retrospective_step.py | 18 +- .../list_incident_post_mortems.py | 382 ++-- .../list_incident_postmortem.py | 28 +- .../update_incident_postmortem.py | 28 +- .../create_incident_role_task.py | 18 +- .../delete_incident_role_task.py | 18 +- .../get_incident_role_task.py | 18 +- .../list_incident_role_tasks.py | 42 +- .../update_incident_role_task.py | 18 +- .../incident_roles/create_incident_role.py | 18 +- .../incident_roles/delete_incident_role.py | 28 +- .../api/incident_roles/get_incident_role.py | 28 +- .../api/incident_roles/list_incident_roles.py | 244 ++- .../incident_roles/update_incident_role.py | 28 +- .../create_incident_status_page.py | 18 +- .../delete_incident_status_page.py | 18 +- .../get_incident_status_pages.py | 18 +- .../list_incident_status_pages.py | 42 +- .../update_incident_status_page.py | 18 +- .../create_incident_sub_status.py | 18 +- .../delete_incident_sub_status.py | 18 +- .../get_incident_sub_status.py | 24 +- .../list_incident_sub_statuses.py | 106 +- .../update_incident_sub_status.py | 12 +- .../incident_types/create_incident_type.py | 18 +- .../create_incident_type_catalog_property.py | 18 +- .../incident_types/delete_incident_type.py | 28 +- .../api/incident_types/get_incident_type.py | 28 +- .../list_incident_type_catalog_properties.py | 128 +- .../api/incident_types/list_incident_types.py | 244 ++- .../incident_types/update_incident_type.py | 28 +- .../incidents/add_subscribers_to_incident.py | 28 +- .../api/incidents/assign_user_to_incident.py | 28 +- rootly_sdk/api/incidents/cancel_incident.py | 28 +- rootly_sdk/api/incidents/create_incident.py | 18 +- rootly_sdk/api/incidents/delete_incident.py | 28 +- .../incidents/detach_from_parent_incident.py | 28 +- rootly_sdk/api/incidents/get_incident.py | 40 +- rootly_sdk/api/incidents/list_incidents.py | 1652 ++++++++--------- .../incidents/mark_as_duplicate_incident.py | 28 +- rootly_sdk/api/incidents/mitigate_incident.py | 28 +- .../remove_assigned_user_from_incident.py | 28 +- .../remove_subscribers_to_incident.py | 28 +- rootly_sdk/api/incidents/resolve_incident.py | 28 +- rootly_sdk/api/incidents/restart_incident.py | 28 +- rootly_sdk/api/incidents/triage_incident.py | 28 +- .../incidents/unmark_as_duplicate_incident.py | 28 +- rootly_sdk/api/incidents/update_incident.py | 28 +- rootly_sdk/api/ip_ranges/get_ip_ranges.py | 14 +- .../create_live_call_router.py | 18 +- .../delete_live_call_router.py | 18 +- .../generate_phone_number_live_call_router.py | 18 +- .../live_call_routers/get_live_call_router.py | 18 +- .../list_live_call_routers.py | 124 +- .../update_live_call_router.py | 18 +- .../create_meeting_recording.py | 30 +- .../delete_meeting_recording.py | 18 +- .../delete_meeting_recording_video.py | 18 +- .../delete_standalone_meeting_recording.py | 6 +- .../get_meeting_recording.py | 30 +- .../import_meeting_recording.py | 18 +- .../leave_meeting_recording.py | 18 +- .../list_all_meeting_recordings.py | 42 +- .../list_meeting_recordings.py | 38 +- .../pause_meeting_recording.py | 18 +- .../resume_meeting_recording.py | 18 +- .../start_recording_session.py | 18 +- .../stop_meeting_recording.py | 18 +- .../create_on_call_pay_report.py | 18 +- .../get_on_call_pay_report.py | 28 +- .../list_on_call_pay_reports.py | 94 +- .../regenerate_on_call_pay_report.py | 18 +- .../update_on_call_pay_report.py | 18 +- .../api/on_call_roles/create_on_call_role.py | 18 +- .../api/on_call_roles/delete_on_call_role.py | 18 +- .../api/on_call_roles/get_on_call_role.py | 18 +- .../api/on_call_roles/list_on_call_roles.py | 124 +- .../api/on_call_roles/update_on_call_role.py | 18 +- .../on_call_shadows/create_on_call_shadow.py | 18 +- .../api/on_call_shadows/get_on_call_shadow.py | 18 +- .../on_call_shadows/list_on_call_shadows.py | 44 +- .../on_call_shadows/update_on_call_shadow.py | 18 +- rootly_sdk/api/on_calls/list_oncalls.py | 130 +- .../override_shifts/create_override_shift.py | 18 +- .../override_shifts/delete_on_call_shadow.py | 18 +- .../override_shifts/delete_override_shift.py | 18 +- .../api/override_shifts/get_override_shift.py | 18 +- .../override_shifts/list_override_shifts.py | 44 +- .../override_shifts/update_override_shift.py | 18 +- .../playbook_tasks/create_playbook_task.py | 18 +- .../playbook_tasks/delete_playbook_task.py | 18 +- .../api/playbook_tasks/get_playbook_task.py | 18 +- .../api/playbook_tasks/list_playbook_tasks.py | 44 +- .../playbook_tasks/update_playbook_task.py | 18 +- rootly_sdk/api/playbooks/create_playbook.py | 18 +- rootly_sdk/api/playbooks/delete_playbook.py | 18 +- rootly_sdk/api/playbooks/get_playbook.py | 30 +- rootly_sdk/api/playbooks/list_playbooks.py | 42 +- rootly_sdk/api/playbooks/update_playbook.py | 18 +- rootly_sdk/api/pulses/create_pulse.py | 18 +- rootly_sdk/api/pulses/get_pulse.py | 18 +- rootly_sdk/api/pulses/list_pulses.py | 410 ++-- rootly_sdk/api/pulses/update_pulse.py | 18 +- .../get_retrospective_configuration.py | 30 +- .../list_retrospective_configurations.py | 54 +- .../update_retrospective_configuration.py | 18 +- ...create_retrospective_process_group_step.py | 18 +- ...delete_retrospective_process_group_step.py | 18 +- .../get_retrospective_process_group_step.py | 12 +- .../list_retrospective_process_group_steps.py | 92 +- ...update_retrospective_process_group_step.py | 12 +- .../create_retrospective_process_group.py | 18 +- .../delete_retrospective_process_group.py | 18 +- .../get_retrospective_process_group.py | 24 +- .../list_retrospective_process_groups.py | 106 +- .../update_retrospective_process_group.py | 12 +- .../create_retrospective_process.py | 18 +- .../delete_retrospective_process.py | 18 +- .../get_retrospective_process.py | 30 +- .../list_retrospective_processes.py | 44 +- .../update_retrospective_process.py | 18 +- .../create_retrospective_step.py | 18 +- .../delete_retrospective_step.py | 18 +- .../get_retrospective_step.py | 18 +- .../list_retrospective_steps.py | 52 +- .../update_retrospective_step.py | 18 +- .../create_postmortem_template.py | 18 +- .../delete_postmortem_template.py | 28 +- .../get_postmortem_template.py | 28 +- .../list_postmortem_templates.py | 42 +- .../update_postmortem_template.py | 28 +- rootly_sdk/api/roles/create_role.py | 18 +- rootly_sdk/api/roles/delete_role.py | 28 +- rootly_sdk/api/roles/get_role.py | 28 +- rootly_sdk/api/roles/list_roles.py | 120 +- rootly_sdk/api/roles/update_role.py | 28 +- .../create_schedule_rotation_active_day.py | 18 +- .../delete_schedule_rotation_active_day.py | 18 +- .../get_schedule_rotation_active_day.py | 18 +- .../list_schedule_rotation_active_days.py | 42 +- .../update_schedule_rotation_active_day.py | 18 +- .../create_schedule_rotation_user.py | 18 +- .../delete_schedule_rotation_user.py | 18 +- .../get_schedule_rotation_user.py | 18 +- .../list_schedule_rotation_users.py | 42 +- .../update_schedule_rotation_user.py | 18 +- .../create_schedule_rotation.py | 18 +- .../delete_schedule_rotation.py | 18 +- .../get_schedule_rotation.py | 18 +- .../list_schedule_rotations.py | 52 +- .../update_schedule_rotation.py | 18 +- rootly_sdk/api/schedules/create_schedule.py | 18 +- rootly_sdk/api/schedules/delete_schedule.py | 18 +- rootly_sdk/api/schedules/get_schedule.py | 18 +- rootly_sdk/api/schedules/list_schedules.py | 190 +- rootly_sdk/api/schedules/update_schedule.py | 18 +- rootly_sdk/api/secrets/create_secret.py | 18 +- rootly_sdk/api/secrets/delete_secret.py | 18 +- rootly_sdk/api/secrets/get_secret.py | 18 +- rootly_sdk/api/secrets/list_secrets.py | 40 +- rootly_sdk/api/secrets/update_secret.py | 18 +- .../api/services/bulk_delete_services.py | 18 +- .../api/services/bulk_upsert_services.py | 18 +- rootly_sdk/api/services/create_service.py | 18 +- .../create_service_catalog_property.py | 18 +- rootly_sdk/api/services/delete_service.py | 28 +- rootly_sdk/api/services/get_service.py | 28 +- .../services/get_service_incidents_chart.py | 28 +- .../api/services/get_service_uptime_chart.py | 38 +- .../list_service_catalog_properties.py | 128 +- rootly_sdk/api/services/list_services.py | 340 ++-- rootly_sdk/api/services/update_service.py | 28 +- rootly_sdk/api/severities/create_severity.py | 18 +- rootly_sdk/api/severities/delete_severity.py | 28 +- rootly_sdk/api/severities/get_severity.py | 28 +- rootly_sdk/api/severities/list_severities.py | 300 +-- rootly_sdk/api/severities/update_severity.py | 28 +- .../create_shift_coverage_request.py | 18 +- .../delete_shift_coverage_request.py | 12 +- .../get_shift_coverage_request.py | 12 +- .../list_shift_coverage_requests.py | 12 +- rootly_sdk/api/shifts/get_schedule_shifts.py | 38 +- rootly_sdk/api/shifts/list_shifts.py | 94 +- rootly_sdk/api/sl_as/create_sla.py | 18 +- rootly_sdk/api/sl_as/delete_sla.py | 18 +- rootly_sdk/api/sl_as/get_sla.py | 18 +- rootly_sdk/api/sl_as/list_sl_as.py | 190 +- rootly_sdk/api/sl_as/update_sla.py | 18 +- .../create_status_page_announcement.py | 18 +- .../delete_status_page_announcement.py | 18 +- .../get_status_page_announcement.py | 18 +- .../list_status_page_announcements.py | 42 +- .../update_status_page_announcement.py | 18 +- .../create_status_page_component_group.py | 18 +- .../delete_status_page_component_group.py | 6 +- .../get_status_page_component_group.py | 28 +- .../list_status_page_component_groups.py | 42 +- .../update_status_page_component_group.py | 18 +- .../create_status_page_component.py | 18 +- .../delete_status_page_component.py | 6 +- .../get_status_page_component.py | 28 +- .../list_status_page_components.py | 42 +- .../update_status_page_component.py | 18 +- .../create_status_page_template.py | 18 +- .../delete_status_page_template.py | 18 +- .../get_status_page_template.py | 18 +- .../list_status_page_templates.py | 42 +- .../update_status_page_template.py | 18 +- .../api/status_pages/create_status_page.py | 18 +- .../api/status_pages/delete_status_page.py | 28 +- .../api/status_pages/get_status_page.py | 28 +- .../api/status_pages/list_status_pages.py | 204 +- .../api/status_pages/update_status_page.py | 28 +- rootly_sdk/api/statuses/get_status.py | 28 +- rootly_sdk/api/statuses/list_statuses.py | 118 +- .../api/sub_statuses/create_sub_status.py | 18 +- .../api/sub_statuses/delete_sub_status.py | 28 +- rootly_sdk/api/sub_statuses/get_sub_status.py | 28 +- .../api/sub_statuses/list_sub_statuses.py | 110 +- .../api/sub_statuses/update_sub_status.py | 28 +- rootly_sdk/api/teams/bulk_delete_groups.py | 18 +- rootly_sdk/api/teams/bulk_upsert_groups.py | 18 +- .../teams/create_group_catalog_property.py | 18 +- rootly_sdk/api/teams/create_team.py | 18 +- rootly_sdk/api/teams/delete_team.py | 28 +- rootly_sdk/api/teams/get_team.py | 40 +- .../api/teams/get_team_incidents_chart.py | 18 +- .../teams/list_group_catalog_properties.py | 128 +- rootly_sdk/api/teams/list_teams.py | 392 ++-- rootly_sdk/api/teams/update_team.py | 28 +- .../create_user_email_address.py | 18 +- .../delete_user_email_address.py | 18 +- .../get_user_email_addresses.py | 18 +- .../resend_user_email_address_verification.py | 18 +- .../show_user_email_address.py | 18 +- .../update_user_email_address.py | 18 +- .../verify_user_email_address.py | 18 +- .../create_user_notification_rule.py | 18 +- .../delete_user_notification_rule.py | 18 +- .../get_user_notification_rule.py | 18 +- .../list_user_notification_rules.py | 52 +- .../update_user_notification_rule.py | 18 +- .../create_user_phone_number.py | 18 +- .../delete_user_phone_number.py | 18 +- .../get_user_phone_numbers.py | 18 +- .../show_user_phone_number.py | 18 +- .../update_user_phone_number.py | 18 +- rootly_sdk/api/users/delete_user.py | 18 +- rootly_sdk/api/users/get_current_user.py | 18 +- rootly_sdk/api/users/get_user.py | 30 +- rootly_sdk/api/users/list_users.py | 122 +- rootly_sdk/api/users/update_user.py | 18 +- .../delete_v1_verified_domains_id.py | 12 +- .../get_v1_verified_domains.py | 34 +- .../get_v1_verified_domains_id.py | 12 +- .../post_v1_verified_domains.py | 12 +- .../deliver_webhooks_delivery.py | 12 +- .../get_webhooks_delivery.py | 18 +- .../list_webhooks_deliveries.py | 154 +- .../create_webhooks_endpoint.py | 18 +- .../delete_webhooks_endpoint.py | 18 +- .../get_webhooks_endpoint.py | 18 +- .../list_webhooks_endpoints.py | 62 +- .../update_webhooks_endpoint.py | 18 +- ...rkflow_action_item_form_field_condition.py | 18 +- ...rkflow_action_item_form_field_condition.py | 18 +- ...rkflow_action_item_form_field_condition.py | 18 +- ...kflow_action_item_form_field_conditions.py | 42 +- ...rkflow_action_item_form_field_condition.py | 18 +- .../create_workflow_form_field_condition.py | 18 +- .../delete_workflow_form_field_condition.py | 18 +- .../get_workflow_form_field_condition.py | 18 +- .../list_workflow_form_field_conditions.py | 42 +- .../update_workflow_form_field_condition.py | 18 +- .../workflow_groups/create_workflow_group.py | 18 +- .../workflow_groups/delete_workflow_group.py | 18 +- .../api/workflow_groups/get_workflow_group.py | 18 +- .../workflow_groups/list_workflow_groups.py | 104 +- .../workflow_groups/update_workflow_group.py | 18 +- .../api/workflow_runs/create_workflow_run.py | 18 +- .../api/workflow_runs/list_workflow_runs.py | 86 +- .../workflow_tasks/create_workflow_task.py | 18 +- .../workflow_tasks/delete_workflow_task.py | 18 +- .../api/workflow_tasks/get_workflow_task.py | 18 +- .../api/workflow_tasks/list_workflow_tasks.py | 154 +- .../workflow_tasks/update_workflow_task.py | 18 +- rootly_sdk/api/workflows/create_workflow.py | 18 +- rootly_sdk/api/workflows/delete_workflow.py | 28 +- rootly_sdk/api/workflows/get_workflow.py | 40 +- rootly_sdk/api/workflows/list_workflows.py | 204 +- rootly_sdk/api/workflows/update_workflow.py | 28 +- rootly_sdk/client.py | 18 +- .../models/action_item_trigger_params.py | 204 +- .../models/add_action_item_task_params.py | 46 +- ...ction_item_task_params_assigned_to_user.py | 6 +- ...task_params_post_to_slack_channels_item.py | 6 +- ...dd_microsoft_teams_chat_tab_task_params.py | 8 +- ...crosoft_teams_chat_tab_task_params_chat.py | 6 +- rootly_sdk/models/add_role_task_params.py | 12 +- .../add_role_task_params_assigned_to_user.py | 6 +- .../models/add_subscribers_data_attributes.py | 18 +- rootly_sdk/models/add_team_task_params.py | 8 +- .../models/add_to_timeline_task_params.py | 14 +- ...task_params_post_to_slack_channels_item.py | 6 +- rootly_sdk/models/ai_chat_response.py | 6 +- .../ai_chat_response_data_attributes.py | 16 +- .../models/ai_chat_session_message_list.py | 4 +- rootly_sdk/models/alert.py | 192 +- rootly_sdk/models/alert_event.py | 54 +- .../alert_event_escalation_target_type_0.py | 4 +- ...ert_event_escalation_target_type_0_data.py | 8 +- rootly_sdk/models/alert_event_feed_list.py | 8 +- rootly_sdk/models/alert_event_feed_meta.py | 50 +- .../models/alert_event_incident_type_0.py | 52 +- rootly_sdk/models/alert_event_list.py | 6 +- rootly_sdk/models/alert_event_response.py | 6 +- .../models/alert_event_schedule_type_0.py | 22 +- ...chedule_type_0_escalation_policies_item.py | 10 +- rootly_sdk/models/alert_event_user.py | 42 +- rootly_sdk/models/alert_field.py | 4 +- rootly_sdk/models/alert_field_list.py | 6 +- rootly_sdk/models/alert_field_response.py | 6 +- .../models/alert_field_response_data.py | 4 +- rootly_sdk/models/alert_group.py | 36 +- .../models/alert_group_attributes_item.py | 4 +- .../models/alert_group_conditions_item.py | 48 +- rootly_sdk/models/alert_group_list.py | 6 +- rootly_sdk/models/alert_group_response.py | 6 +- rootly_sdk/models/alert_labels_item_type_0.py | 10 +- rootly_sdk/models/alert_list.py | 6 +- rootly_sdk/models/alert_list_data_item.py | 4 +- rootly_sdk/models/alert_response.py | 6 +- rootly_sdk/models/alert_response_data.py | 4 +- rootly_sdk/models/alert_retrigger_rule.py | 36 +- .../alert_retrigger_rule_conditions_item.py | 12 +- .../models/alert_retrigger_rule_list.py | 6 +- .../models/alert_retrigger_rule_response.py | 6 +- rootly_sdk/models/alert_route.py | 12 +- rootly_sdk/models/alert_route_rules_item.py | 6 +- ..._route_rules_item_condition_groups_item.py | 4 +- ...m_condition_groups_item_conditions_item.py | 42 +- rootly_sdk/models/alert_routing_rule.py | 10 +- .../models/alert_routing_rule_condition.py | 44 +- .../alert_routing_rule_condition_group.py | 16 +- ...lert_routing_rule_condition_groups_item.py | 16 +- ...e_condition_groups_item_conditions_item.py | 44 +- .../alert_routing_rule_conditions_item.py | 14 +- rootly_sdk/models/alert_routing_rule_list.py | 6 +- .../models/alert_routing_rule_response.py | 6 +- rootly_sdk/models/alert_trigger_params.py | 84 +- ...gger_params_alert_field_conditions_item.py | 6 +- ...trigger_params_alert_payload_conditions.py | 12 +- ...lert_payload_conditions_conditions_item.py | 8 +- rootly_sdk/models/alert_urgency.py | 38 +- rootly_sdk/models/alert_urgency_list.py | 6 +- rootly_sdk/models/alert_urgency_response.py | 6 +- rootly_sdk/models/alerts_source.py | 70 +- ...rce_alert_source_fields_attributes_item.py | 12 +- ...rt_source_urgency_rules_attributes_item.py | 40 +- ...source_alert_template_attributes_type_0.py | 26 +- rootly_sdk/models/alerts_source_list.py | 6 +- ...ource_resolution_rule_attributes_type_0.py | 52 +- ...butes_type_0_conditions_attributes_item.py | 44 +- rootly_sdk/models/alerts_source_response.py | 6 +- ...rts_source_sourceable_attributes_type_0.py | 26 +- ...s_type_0_field_mappings_attributes_item.py | 10 +- rootly_sdk/models/api_key.py | 50 +- rootly_sdk/models/api_key_list.py | 6 +- rootly_sdk/models/api_key_response.py | 6 +- .../models/api_key_with_token_response.py | 6 +- ...key_with_token_response_data_attributes.py | 50 +- .../archive_google_chat_spaces_task_params.py | 8 +- ...gle_chat_spaces_task_params_spaces_item.py | 6 +- ...ve_microsoft_teams_channels_task_params.py | 8 +- ...eams_channels_task_params_channels_item.py | 6 +- ...crosoft_teams_channels_task_params_team.py | 6 +- .../archive_slack_channels_task_params.py | 8 +- ...lack_channels_task_params_channels_item.py | 6 +- .../assign_role_to_user_data_attributes.py | 6 +- .../models/attach_alert_data_attributes.py | 10 +- .../attach_datadog_dashboards_task_params.py | 14 +- ..._dashboards_task_params_dashboards_item.py | 6 +- ...task_params_post_to_slack_channels_item.py | 6 +- ..._pdf_to_freshservice_ticket_task_params.py | 10 +- ...ospective_pdf_to_jira_issue_task_params.py | 12 +- ...f_to_jira_issue_task_params_integration.py | 6 +- rootly_sdk/models/audit.py | 90 +- rootly_sdk/models/audits_list.py | 6 +- rootly_sdk/models/authorization_list.py | 6 +- rootly_sdk/models/authorization_response.py | 6 +- .../auto_assign_role_opsgenie_task_params.py | 8 +- ...sign_role_opsgenie_task_params_schedule.py | 6 +- ...e_pagerduty_task_params_type_0_schedule.py | 6 +- ...ty_task_params_type_1_escalation_policy.py | 6 +- ..._params_type_0_escalation_policy_target.py | 6 +- ...ootly_task_params_type_1_service_target.py | 6 +- ...e_rootly_task_params_type_2_user_target.py | 6 +- ..._rootly_task_params_type_3_group_target.py | 6 +- ...otly_task_params_type_4_schedule_target.py | 6 +- ...auto_assign_role_victor_ops_task_params.py | 8 +- ...assign_role_victor_ops_task_params_team.py | 6 +- .../bulk_destroy_catalog_entities_response.py | 4 +- ..._destroy_catalog_entities_response_data.py | 14 +- .../bulk_destroy_catalog_entities_type_1.py | 6 +- .../bulk_destroy_environments_response.py | 4 +- ...bulk_destroy_environments_response_data.py | 14 +- .../bulk_destroy_environments_type_1.py | 6 +- .../bulk_destroy_functionalities_response.py | 4 +- ...k_destroy_functionalities_response_data.py | 14 +- .../bulk_destroy_functionalities_type_1.py | 6 +- .../models/bulk_destroy_services_response.py | 4 +- .../bulk_destroy_services_response_data.py | 14 +- .../models/bulk_destroy_services_type_1.py | 6 +- .../models/bulk_destroy_teams_response.py | 4 +- .../bulk_destroy_teams_response_data.py | 14 +- .../models/bulk_destroy_teams_type_1.py | 6 +- ...k_upsert_catalog_entities_entities_item.py | 32 +- ...alog_entities_entities_item_fields_item.py | 6 +- .../bulk_upsert_catalog_entities_response.py | 6 +- ...ert_catalog_entities_response_data_item.py | 12 +- .../bulk_upsert_environments_entities_item.py | 48 +- ..._environments_entities_item_fields_item.py | 6 +- .../bulk_upsert_environments_response.py | 6 +- ..._upsert_environments_response_data_item.py | 12 +- ...lk_upsert_functionalities_entities_item.py | 120 +- ...nctionalities_entities_item_fields_item.py | 6 +- .../bulk_upsert_functionalities_response.py | 6 +- ...sert_functionalities_response_data_item.py | 12 +- .../bulk_upsert_services_entities_item.py | 168 +- ...sert_services_entities_item_fields_item.py | 6 +- .../models/bulk_upsert_services_response.py | 6 +- ...bulk_upsert_services_response_data_item.py | 12 +- .../models/bulk_upsert_teams_entities_item.py | 128 +- ..._upsert_teams_entities_item_fields_item.py | 6 +- .../models/bulk_upsert_teams_response.py | 6 +- .../bulk_upsert_teams_response_data_item.py | 12 +- rootly_sdk/models/call_people_task_params.py | 8 +- .../models/cancel_incident_data_attributes.py | 10 +- rootly_sdk/models/catalog.py | 34 +- .../models/catalog_checklist_template.py | 28 +- ...g_checklist_template_fields_type_0_item.py | 18 +- .../models/catalog_checklist_template_list.py | 12 +- ...g_checklist_template_owners_type_0_item.py | 10 +- .../catalog_checklist_template_response.py | 6 +- rootly_sdk/models/catalog_entity.py | 54 +- rootly_sdk/models/catalog_entity_checklist.py | 42 +- ..._checklist_checklist_fields_type_0_item.py | 4 +- ...klist_checklist_fields_type_0_item_data.py | 12 +- ...list_fields_type_0_item_data_attributes.py | 36 +- ..._checklist_checklist_owners_type_0_item.py | 4 +- ...klist_checklist_owners_type_0_item_data.py | 12 +- ...list_owners_type_0_item_data_attributes.py | 10 +- .../models/catalog_entity_checklist_list.py | 12 +- .../catalog_entity_checklist_response.py | 6 +- rootly_sdk/models/catalog_entity_list.py | 6 +- .../models/catalog_entity_property_list.py | 6 +- .../catalog_entity_property_response.py | 6 +- rootly_sdk/models/catalog_entity_response.py | 6 +- rootly_sdk/models/catalog_field.py | 50 +- rootly_sdk/models/catalog_field_list.py | 6 +- rootly_sdk/models/catalog_field_response.py | 6 +- rootly_sdk/models/catalog_list.py | 6 +- rootly_sdk/models/catalog_property.py | 50 +- rootly_sdk/models/catalog_property_list.py | 6 +- .../models/catalog_property_response.py | 6 +- rootly_sdk/models/catalog_response.py | 6 +- rootly_sdk/models/cause.py | 32 +- rootly_sdk/models/cause_list.py | 6 +- rootly_sdk/models/cause_response.py | 6 +- ...e_google_chat_space_privacy_task_params.py | 16 +- ...le_chat_space_privacy_task_params_space.py | 6 +- ...hange_slack_channel_privacy_task_params.py | 8 +- ...ack_channel_privacy_task_params_channel.py | 6 +- rootly_sdk/models/communications_group.py | 52 +- ...tion_external_group_members_type_0_item.py | 10 +- ...munication_group_conditions_type_0_item.py | 48 +- .../models/communications_group_response.py | 6 +- .../models/communications_groups_response.py | 12 +- rootly_sdk/models/communications_stage.py | 20 +- .../models/communications_stage_response.py | 6 +- .../models/communications_stages_response.py | 12 +- rootly_sdk/models/communications_template.py | 36 +- ...mmunication_template_stages_type_0_item.py | 4 +- ...cation_template_stages_type_0_item_data.py | 12 +- ...late_stages_type_0_item_data_attributes.py | 52 +- ...tem_data_attributes_communication_stage.py | 6 +- ..._data_attributes_communication_template.py | 6 +- ...munications_template_communication_type.py | 6 +- .../communications_template_response.py | 6 +- .../communications_templates_response.py | 12 +- rootly_sdk/models/communications_type.py | 20 +- .../models/communications_type_response.py | 6 +- .../models/communications_types_response.py | 12 +- ...reate_airtable_table_record_task_params.py | 16 +- ..._airtable_table_record_task_params_base.py | 6 +- ...airtable_table_record_task_params_table.py | 6 +- ...e_anthropic_chat_completion_task_params.py | 12 +- ...ropic_chat_completion_task_params_model.py | 6 +- .../create_asana_subtask_task_params.py | 36 +- ...te_asana_subtask_task_params_completion.py | 6 +- .../models/create_asana_task_task_params.py | 36 +- ...reate_asana_task_task_params_completion.py | 6 +- ...te_asana_task_task_params_projects_item.py | 6 +- ...create_asana_task_task_params_workspace.py | 6 +- .../models/create_clickup_task_task_params.py | 32 +- .../create_clickup_task_task_params_list.py | 6 +- ...reate_clickup_task_task_params_priority.py | 6 +- .../models/create_coda_page_task_params.py | 24 +- .../create_coda_page_task_params_doc.py | 6 +- .../create_coda_page_task_params_template.py | 6 +- .../create_confluence_page_task_params.py | 32 +- ...te_confluence_page_task_params_ancestor.py | 6 +- ...confluence_page_task_params_integration.py | 6 +- ...reate_confluence_page_task_params_space.py | 6 +- ...te_confluence_page_task_params_template.py | 6 +- .../create_datadog_notebook_task_params.py | 16 +- ...e_datadog_notebook_task_params_template.py | 6 +- .../create_dropbox_paper_page_task_params.py | 20 +- ...ropbox_paper_page_task_params_namespace.py | 6 +- ...ox_paper_page_task_params_parent_folder.py | 6 +- .../create_edge_connector_action_body.py | 4 +- ...reate_edge_connector_action_body_action.py | 4 +- ...e_connector_action_body_action_metadata.py | 10 +- ...on_body_action_metadata_parameters_item.py | 18 +- ...ate_edge_connector_body_data_attributes.py | 16 +- ..._connector_body_data_attributes_filters.py | 18 +- .../models/create_github_issue_task_params.py | 32 +- ...ate_github_issue_task_params_issue_type.py | 6 +- ...te_github_issue_task_params_labels_item.py | 6 +- ...ate_github_issue_task_params_repository.py | 6 +- .../models/create_gitlab_issue_task_params.py | 14 +- ...ate_gitlab_issue_task_params_repository.py | 6 +- .../create_go_to_meeting_task_params.py | 28 +- ...task_params_post_to_slack_channels_item.py | 6 +- ...reate_google_calendar_event_task_params.py | 50 +- ...task_params_post_to_slack_channels_item.py | 6 +- .../create_google_chat_space_task_params.py | 12 +- .../create_google_docs_page_task_params.py | 30 +- ...eate_google_docs_page_task_params_drive.py | 6 +- ...gle_docs_page_task_params_parent_folder.py | 6 +- ...ate_google_docs_permissions_task_params.py | 18 +- ...ogle_gemini_chat_completion_task_params.py | 10 +- ...emini_chat_completion_task_params_model.py | 6 +- .../create_google_meeting_task_params.py | 44 +- ...task_params_post_to_slack_channels_item.py | 6 +- .../create_incident_postmortem_task_params.py | 16 +- ..._postmortem_task_params_template_type_0.py | 6 +- .../models/create_incident_task_params.py | 42 +- .../models/create_jira_issue_task_params.py | 48 +- ...eate_jira_issue_task_params_integration.py | 6 +- ...reate_jira_issue_task_params_issue_type.py | 6 +- .../create_jira_issue_task_params_priority.py | 6 +- .../create_jira_issue_task_params_status.py | 6 +- .../models/create_jira_subtask_task_params.py | 48 +- ...te_jira_subtask_task_params_integration.py | 6 +- ...reate_jira_subtask_task_params_priority.py | 6 +- .../create_jira_subtask_task_params_status.py | 6 +- ..._subtask_task_params_subtask_issue_type.py | 6 +- .../models/create_jsmops_alert_task_params.py | 46 +- ...mops_alert_task_params_escalations_item.py | 6 +- ...jsmops_alert_task_params_schedules_item.py | 6 +- ...ate_jsmops_alert_task_params_teams_item.py | 6 +- ...ate_jsmops_alert_task_params_users_item.py | 6 +- ...create_linear_issue_comment_task_params.py | 8 +- .../models/create_linear_issue_task_params.py | 30 +- ...te_linear_issue_task_params_labels_item.py | 6 +- ...reate_linear_issue_task_params_priority.py | 6 +- ...create_linear_issue_task_params_project.py | 6 +- .../create_linear_issue_task_params_state.py | 6 +- .../create_linear_issue_task_params_team.py | 6 +- ...create_linear_subtask_issue_task_params.py | 26 +- ...r_subtask_issue_task_params_labels_item.py | 6 +- ...near_subtask_issue_task_params_priority.py | 6 +- ..._linear_subtask_issue_task_params_state.py | 6 +- ...ate_microsoft_teams_channel_task_params.py | 16 +- ...icrosoft_teams_channel_task_params_team.py | 6 +- ...create_microsoft_teams_chat_task_params.py | 22 +- ...oft_teams_chat_task_params_members_item.py | 6 +- ...ate_microsoft_teams_meeting_task_params.py | 22 +- ...task_params_post_to_slack_channels_item.py | 6 +- ...ate_mistral_chat_completion_task_params.py | 16 +- ...stral_chat_completion_task_params_model.py | 6 +- .../models/create_motion_task_task_params.py | 26 +- ...create_motion_task_task_params_priority.py | 6 +- .../create_motion_task_task_params_project.py | 6 +- .../create_motion_task_task_params_status.py | 6 +- ...reate_motion_task_task_params_workspace.py | 6 +- .../models/create_notion_page_task_params.py | 18 +- ...ate_notion_page_task_params_parent_page.py | 6 +- ...eate_openai_chat_completion_task_params.py | 28 +- ...penai_chat_completion_task_params_model.py | 6 +- .../create_opsgenie_alert_task_params.py | 40 +- ...enie_alert_task_params_escalations_item.py | 6 +- ...sgenie_alert_task_params_schedules_item.py | 6 +- ...e_opsgenie_alert_task_params_teams_item.py | 6 +- ...e_opsgenie_alert_task_params_users_item.py | 6 +- .../create_outlook_event_task_params.py | 30 +- ...eate_outlook_event_task_params_calendar.py | 6 +- ...task_params_post_to_slack_channels_item.py | 6 +- ...ate_pagerduty_status_update_task_params.py | 8 +- .../create_pagertree_alert_task_params.py | 34 +- ..._pagertree_alert_task_params_teams_item.py | 6 +- ..._pagertree_alert_task_params_users_item.py | 6 +- .../models/create_quip_page_task_params.py | 18 +- ...create_service_now_incident_task_params.py | 24 +- ...ice_now_incident_task_params_completion.py | 6 +- ...rvice_now_incident_task_params_priority.py | 6 +- .../create_sharepoint_page_task_params.py | 18 +- ...reate_sharepoint_page_task_params_drive.py | 6 +- ...arepoint_page_task_params_parent_folder.py | 6 +- ...create_sharepoint_page_task_params_site.py | 6 +- ...ortcut_story_task_params_type_0_project.py | 6 +- ...story_task_params_type_1_workflow_state.py | 6 +- .../create_shortcut_task_task_params.py | 8 +- ...te_shortcut_task_task_params_completion.py | 6 +- .../create_slack_channel_task_params.py | 14 +- ...ate_slack_channel_task_params_workspace.py | 6 +- .../models/create_sub_incident_task_params.py | 10 +- .../models/create_trello_card_task_params.py | 18 +- ...ate_trello_card_task_params_archivation.py | 6 +- .../create_trello_card_task_params_board.py | 6 +- ...ate_trello_card_task_params_labels_item.py | 6 +- .../create_trello_card_task_params_list.py | 6 +- ...ate_watsonx_chat_completion_task_params.py | 10 +- ...tsonx_chat_completion_task_params_model.py | 6 +- .../create_webex_meeting_task_params.py | 24 +- ...task_params_post_to_slack_channels_item.py | 6 +- .../create_zendesk_jira_link_task_params.py | 8 +- .../create_zendesk_ticket_task_params.py | 34 +- ...e_zendesk_ticket_task_params_completion.py | 6 +- ...ate_zendesk_ticket_task_params_priority.py | 6 +- .../models/create_zoom_meeting_task_params.py | 38 +- ...task_params_post_to_slack_channels_item.py | 6 +- rootly_sdk/models/custom_field.py | 38 +- rootly_sdk/models/custom_field_list.py | 6 +- rootly_sdk/models/custom_field_option.py | 6 +- rootly_sdk/models/custom_field_option_list.py | 6 +- .../models/custom_field_option_response.py | 6 +- rootly_sdk/models/custom_field_response.py | 6 +- rootly_sdk/models/custom_form.py | 12 +- rootly_sdk/models/custom_form_list.py | 6 +- rootly_sdk/models/custom_form_response.py | 6 +- rootly_sdk/models/dashboard.py | 50 +- rootly_sdk/models/dashboard_list.py | 6 +- rootly_sdk/models/dashboard_panel.py | 16 +- rootly_sdk/models/dashboard_panel_list.py | 6 +- rootly_sdk/models/dashboard_panel_params.py | 24 +- .../dashboard_panel_params_datalabels.py | 4 +- .../dashboard_panel_params_datasets_item.py | 22 +- ...l_params_datasets_item_aggregate_type_0.py | 24 +- ..._panel_params_datasets_item_filter_item.py | 12 +- ...ms_datasets_item_filter_item_rules_item.py | 18 +- .../models/dashboard_panel_params_legend.py | 8 +- rootly_sdk/models/dashboard_panel_response.py | 6 +- rootly_sdk/models/dashboard_response.py | 6 +- .../models/delete_alert_route_response_200.py | 4 +- .../delete_alert_route_response_200_data.py | 8 +- ...lert_route_response_200_data_attributes.py | 4 +- .../duplicate_incident_data_attributes.py | 20 +- .../edge_connector_action_data_attributes.py | 54 +- ..._data_attributes_parameters_type_0_item.py | 36 +- .../models/edge_connector_data_attributes.py | 46 +- rootly_sdk/models/environment.py | 82 +- rootly_sdk/models/environment_list.py | 6 +- rootly_sdk/models/environment_response.py | 6 +- rootly_sdk/models/errors_list.py | 6 +- rootly_sdk/models/errors_list_errors_item.py | 18 +- rootly_sdk/models/escalate_alert.py | 4 +- rootly_sdk/models/escalate_alert_data.py | 10 +- .../models/escalate_alert_data_attributes.py | 6 +- rootly_sdk/models/escalation_policy.py | 24 +- ...escalation_policy_business_hours_type_0.py | 32 +- rootly_sdk/models/escalation_policy_level.py | 76 +- .../models/escalation_policy_level_list.py | 6 +- ..._notification_target_params_item_type_0.py | 8 +- .../escalation_policy_level_response.py | 6 +- .../escalation_policy_level_response_data.py | 8 +- rootly_sdk/models/escalation_policy_list.py | 6 +- rootly_sdk/models/escalation_policy_path.py | 80 +- .../models/escalation_policy_path_list.py | 6 +- .../models/escalation_policy_path_response.py | 6 +- .../escalation_policy_path_response_data.py | 8 +- ...scalation_policy_path_rules_item_type_2.py | 14 +- ...scalation_policy_path_rules_item_type_3.py | 6 +- ...path_rules_item_type_5_time_blocks_item.py | 30 +- ...on_policy_path_rules_item_type_8_type_2.py | 14 +- ...on_policy_path_rules_item_type_8_type_3.py | 6 +- ...les_item_type_8_type_5_time_blocks_item.py | 30 +- ...on_policy_path_rules_item_type_9_type_2.py | 14 +- ...on_policy_path_rules_item_type_9_type_3.py | 6 +- ...les_item_type_9_type_5_time_blocks_item.py | 30 +- ...tion_policy_path_time_restrictions_item.py | 18 +- .../models/escalation_policy_response.py | 6 +- rootly_sdk/models/form_field.py | 38 +- rootly_sdk/models/form_field_list.py | 6 +- rootly_sdk/models/form_field_option.py | 8 +- rootly_sdk/models/form_field_option_list.py | 6 +- .../models/form_field_option_response.py | 6 +- rootly_sdk/models/form_field_placement.py | 16 +- .../form_field_placement_condition_list.py | 6 +- ...form_field_placement_condition_response.py | 6 +- .../models/form_field_placement_list.py | 6 +- .../models/form_field_placement_response.py | 6 +- rootly_sdk/models/form_field_position_list.py | 6 +- .../models/form_field_position_response.py | 6 +- rootly_sdk/models/form_field_response.py | 6 +- rootly_sdk/models/form_set.py | 4 +- rootly_sdk/models/form_set_condition_list.py | 6 +- .../models/form_set_condition_response.py | 6 +- rootly_sdk/models/form_set_list.py | 6 +- rootly_sdk/models/form_set_response.py | 6 +- rootly_sdk/models/functionality.py | 170 +- rootly_sdk/models/functionality_list.py | 6 +- rootly_sdk/models/functionality_response.py | 6 +- rootly_sdk/models/get_alerts_task_params.py | 36 +- ..._task_params_parent_message_thread_task.py | 6 +- ...task_params_post_to_slack_channels_item.py | 6 +- rootly_sdk/models/get_pulses_task_params.py | 40 +- ..._task_params_parent_message_thread_task.py | 6 +- ...task_params_post_to_slack_channels_item.py | 6 +- rootly_sdk/models/heartbeat.py | 62 +- rootly_sdk/models/heartbeat_list.py | 6 +- rootly_sdk/models/heartbeat_response.py | 6 +- rootly_sdk/models/http_client_task_params.py | 34 +- ...task_params_post_to_slack_channels_item.py | 6 +- rootly_sdk/models/import_meeting_recording.py | 26 +- rootly_sdk/models/incident.py | 974 +++++----- rootly_sdk/models/incident_action_item.py | 74 +- .../models/incident_action_item_list.py | 6 +- .../models/incident_action_item_response.py | 6 +- .../models/incident_custom_field_selection.py | 14 +- .../incident_custom_field_selection_list.py | 6 +- ...ncident_custom_field_selection_response.py | 6 +- rootly_sdk/models/incident_event.py | 8 +- .../incident_event_functionality_list.py | 6 +- .../incident_event_functionality_response.py | 6 +- rootly_sdk/models/incident_event_list.py | 6 +- rootly_sdk/models/incident_event_response.py | 6 +- .../models/incident_event_service_list.py | 6 +- .../models/incident_event_service_response.py | 6 +- rootly_sdk/models/incident_feedback_list.py | 6 +- .../models/incident_feedback_response.py | 6 +- .../models/incident_form_field_selection.py | 46 +- .../incident_form_field_selection_list.py | 6 +- .../incident_form_field_selection_response.py | 6 +- rootly_sdk/models/incident_list.py | 6 +- rootly_sdk/models/incident_permission_set.py | 20 +- .../models/incident_permission_set_boolean.py | 8 +- .../incident_permission_set_boolean_list.py | 6 +- ...ncident_permission_set_boolean_response.py | 6 +- .../models/incident_permission_set_list.py | 6 +- .../incident_permission_set_resource.py | 8 +- .../incident_permission_set_resource_list.py | 6 +- ...cident_permission_set_resource_response.py | 6 +- .../incident_permission_set_response.py | 6 +- rootly_sdk/models/incident_post_mortem.py | 66 +- .../models/incident_post_mortem_list.py | 6 +- .../models/incident_post_mortem_response.py | 6 +- rootly_sdk/models/incident_response.py | 6 +- .../models/incident_retrospective_step.py | 36 +- .../incident_retrospective_step_response.py | 6 +- rootly_sdk/models/incident_role.py | 34 +- rootly_sdk/models/incident_role_list.py | 6 +- rootly_sdk/models/incident_role_response.py | 6 +- rootly_sdk/models/incident_role_task.py | 18 +- rootly_sdk/models/incident_role_task_list.py | 6 +- .../models/incident_role_task_response.py | 6 +- .../models/incident_status_page_event.py | 18 +- .../models/incident_status_page_event_list.py | 6 +- .../incident_status_page_event_response.py | 6 +- ..._page_event_status_page_components_item.py | 8 +- rootly_sdk/models/incident_sub_status.py | 10 +- rootly_sdk/models/incident_sub_status_list.py | 6 +- .../models/incident_sub_status_response.py | 6 +- rootly_sdk/models/incident_trigger_params.py | 164 +- rootly_sdk/models/incident_type.py | 64 +- rootly_sdk/models/incident_type_list.py | 6 +- rootly_sdk/models/incident_type_response.py | 6 +- ...ting_global_dial_in_numbers_type_0_item.py | 12 +- ...invite_to_google_chat_space_task_params.py | 8 +- ..._to_google_chat_space_task_params_space.py | 6 +- ...rosoft_teams_channel_rootly_task_params.py | 26 +- ...eams_channel_rootly_task_params_channel.py | 6 +- ...ly_task_params_escalation_policy_target.py | 6 +- ...channel_rootly_task_params_group_target.py | 6 +- ...nnel_rootly_task_params_schedule_target.py | 6 +- ...annel_rootly_task_params_service_target.py | 6 +- ...t_teams_channel_rootly_task_params_team.py | 6 +- ..._channel_rootly_task_params_user_target.py | 6 +- ..._to_microsoft_teams_channel_task_params.py | 10 +- ...osoft_teams_channel_task_params_channel.py | 6 +- ...icrosoft_teams_channel_task_params_team.py | 6 +- ...e_to_slack_channel_opsgenie_task_params.py | 8 +- ...nnel_opsgenie_task_params_channels_item.py | 6 +- ...k_channel_opsgenie_task_params_schedule.py | 6 +- ...ty_task_params_type_0_escalation_policy.py | 6 +- ...l_pagerduty_task_params_type_1_schedule.py | 6 +- ...ite_to_slack_channel_rootly_task_params.py | 26 +- ...hannel_rootly_task_params_channels_item.py | 6 +- ...ly_task_params_escalation_policy_target.py | 6 +- ...channel_rootly_task_params_group_target.py | 6 +- ...nnel_rootly_task_params_schedule_target.py | 6 +- ...annel_rootly_task_params_service_target.py | 6 +- ..._channel_rootly_task_params_user_target.py | 6 +- ...nel_task_params_type_0_slack_users_item.py | 6 +- ...sk_params_type_1_slack_user_groups_item.py | 6 +- ...to_slack_channel_victor_ops_task_params.py | 8 +- ...el_victor_ops_task_params_channels_item.py | 6 +- ...ack_channel_victor_ops_task_params_team.py | 6 +- .../models/jsonapi_included_resource.py | 8 +- rootly_sdk/models/links.py | 26 +- rootly_sdk/models/live_call_router.py | 72 +- rootly_sdk/models/live_call_router_list.py | 6 +- .../models/live_call_router_response.py | 6 +- rootly_sdk/models/meeting_recording.py | 70 +- rootly_sdk/models/meeting_recording_detail.py | 94 +- rootly_sdk/models/meeting_recording_list.py | 4 +- .../meeting_recording_transcript_word.py | 6 +- rootly_sdk/models/meta.py | 34 +- .../mitigate_incident_data_attributes.py | 10 +- .../models/new_alert_data_attributes.py | 142 +- ...lert_data_attributes_labels_item_type_0.py | 10 +- .../models/new_alert_event_data_attributes.py | 4 +- .../models/new_alert_field_data_attributes.py | 10 +- .../models/new_alert_group_data_attributes.py | 50 +- ...t_group_data_attributes_attributes_item.py | 4 +- ...t_group_data_attributes_conditions_item.py | 26 +- ...ew_alert_retrigger_rule_data_attributes.py | 20 +- ...er_rule_data_attributes_conditions_item.py | 12 +- rootly_sdk/models/new_alert_route.py | 4 +- rootly_sdk/models/new_alert_route_data.py | 10 +- .../models/new_alert_route_data_attributes.py | 12 +- ..._alert_route_data_attributes_rules_item.py | 6 +- ...ibutes_rules_item_condition_groups_item.py | 4 +- ...m_condition_groups_item_conditions_item.py | 50 +- .../new_alert_routing_rule_data_attributes.py | 20 +- ...ng_rule_data_attributes_conditions_item.py | 8 +- .../new_alert_urgency_data_attributes.py | 18 +- .../new_alerts_source_data_attributes.py | 58 +- ...tes_alert_source_fields_attributes_item.py | 12 +- ...rt_source_urgency_rules_attributes_item.py | 46 +- ...ibutes_alert_template_attributes_type_0.py | 26 +- ...butes_resolution_rule_attributes_type_0.py | 70 +- ...butes_type_0_conditions_attributes_item.py | 50 +- ...attributes_sourceable_attributes_type_0.py | 22 +- ...s_type_0_field_mappings_attributes_item.py | 10 +- .../models/new_api_key_data_attributes.py | 34 +- ...alog_checklist_template_data_attributes.py | 68 +- ...t_template_data_attributes_custom_field.py | 4 +- .../models/new_catalog_data_attributes.py | 40 +- .../new_catalog_entity_data_attributes.py | 54 +- ...catalog_entity_property_data_attributes.py | 4 +- .../new_catalog_field_data_attributes.py | 44 +- .../new_catalog_property_data_attributes.py | 44 +- .../models/new_cause_data_attributes.py | 38 +- ...ew_communications_group_data_attributes.py | 82 +- ...tion_external_group_members_type_0_item.py | 8 +- ...munication_group_conditions_type_0_item.py | 52 +- ...ew_communications_stage_data_attributes.py | 26 +- ...communications_template_data_attributes.py | 40 +- ..._template_stages_attributes_type_0_item.py | 36 +- ...new_communications_type_data_attributes.py | 34 +- .../new_custom_field_data_attributes.py | 32 +- ...new_custom_field_option_data_attributes.py | 8 +- .../models/new_custom_form_data_attributes.py | 20 +- .../models/new_dashboard_data_attributes.py | 36 +- .../new_dashboard_panel_data_attributes.py | 10 +- ..._dashboard_panel_data_attributes_params.py | 24 +- ...panel_data_attributes_params_datalabels.py | 4 +- ...el_data_attributes_params_datasets_item.py | 22 +- ...s_params_datasets_item_aggregate_type_0.py | 24 +- ...ibutes_params_datasets_item_filter_item.py | 12 +- ...ms_datasets_item_filter_item_rules_item.py | 18 +- ...ard_panel_data_attributes_params_legend.py | 8 +- .../new_edge_connector_action_action.py | 4 +- ...w_edge_connector_action_action_metadata.py | 32 +- ..._action_metadata_parameters_type_0_item.py | 36 +- .../new_edge_connector_edge_connector.py | 20 +- .../models/new_environment_data_attributes.py | 78 +- .../new_escalation_policy_data_attributes.py | 20 +- ...y_data_attributes_business_hours_type_0.py | 34 +- ...escalation_policy_level_data_attributes.py | 84 +- ..._notification_target_params_item_type_0.py | 10 +- ..._escalation_policy_path_data_attributes.py | 90 +- ..._path_data_attributes_rules_item_type_2.py | 14 +- ..._path_data_attributes_rules_item_type_3.py | 6 +- ...utes_rules_item_type_5_time_blocks_item.py | 30 +- .../models/new_form_field_data_attributes.py | 62 +- .../new_form_field_option_data_attributes.py | 8 +- ...eld_placement_condition_data_attributes.py | 4 +- ...ew_form_field_placement_data_attributes.py | 20 +- .../models/new_form_set_data_attributes.py | 10 +- .../new_functionality_data_attributes.py | 180 +- .../models/new_heartbeat_data_attributes.py | 32 +- ...ew_incident_action_item_data_attributes.py | 86 +- ...butes_form_field_selections_type_0_item.py | 56 +- ..._custom_field_selection_data_attributes.py | 14 +- .../models/new_incident_data_attributes.py | 304 +-- .../new_incident_event_data_attributes.py | 8 +- .../new_incident_feedback_data_attributes.py | 4 +- ...nt_form_field_selection_data_attributes.py | 46 +- ..._permission_set_boolean_data_attributes.py | 8 +- ...boolean_data_attributes_severity_params.py | 16 +- ...incident_permission_set_data_attributes.py | 34 +- ...permission_set_resource_data_attributes.py | 10 +- ...esource_data_attributes_severity_params.py | 16 +- .../new_incident_role_data_attributes.py | 40 +- .../new_incident_role_task_data_attributes.py | 18 +- ...ident_status_page_event_data_attributes.py | 46 +- ...utes_status_page_components_type_0_item.py | 8 +- ...new_incident_sub_status_data_attributes.py | 10 +- .../new_incident_type_data_attributes.py | 70 +- .../new_live_call_router_data_attributes.py | 48 +- .../new_on_call_pay_report_data_attributes.py | 10 +- .../new_on_call_role_data_attributes.py | 118 +- .../models/new_playbook_data_attributes.py | 66 +- .../new_playbook_task_data_attributes.py | 18 +- ...ew_post_mortem_template_data_attributes.py | 26 +- .../models/new_pulse_data_attributes.py | 62 +- ...w_retrospective_process_data_attributes.py | 10 +- ...ospective_process_group_data_attributes.py | 4 +- ...tive_process_group_step_data_attributes.py | 4 +- .../new_retrospective_step_data_attributes.py | 44 +- rootly_sdk/models/new_role_data_attributes.py | 152 +- .../models/new_schedule_data_attributes.py | 88 +- ...le_data_attributes_slack_channel_type_0.py | 6 +- ...hedule_data_attributes_slack_user_group.py | 6 +- ..._attributes_active_time_attributes_item.py | 6 +- .../new_schedule_rotation_data_attributes.py | 46 +- ...s_schedule_rotation_members_type_0_item.py | 4 +- .../models/new_schedule_rotation_user.py | 4 +- .../models/new_schedule_rotation_user_data.py | 10 +- ..._schedule_rotation_user_data_attributes.py | 4 +- .../models/new_secret_data_attributes.py | 32 +- .../models/new_service_data_attributes.py | 254 +-- ...tributes_alert_broadcast_channel_type_0.py | 4 +- ...butes_incident_broadcast_channel_type_0.py | 4 +- .../models/new_severity_data_attributes.py | 64 +- ..._shift_coverage_request_data_attributes.py | 4 +- rootly_sdk/models/new_sla_data_attributes.py | 76 +- ...new_sla_data_attributes_conditions_item.py | 26 +- ...tatus_page_announcement_data_attributes.py | 4 +- ...w_status_page_component_data_attributes.py | 42 +- ...us_page_component_group_data_attributes.py | 20 +- .../models/new_status_page_data_attributes.py | 220 +-- ...ew_status_page_template_data_attributes.py | 42 +- .../models/new_sub_status_data_attributes.py | 26 +- rootly_sdk/models/new_team_data_attributes.py | 214 +-- ...tributes_alert_broadcast_channel_type_0.py | 4 +- ...butes_incident_broadcast_channel_type_0.py | 4 +- ..._user_notification_rule_data_attributes.py | 50 +- .../new_webhooks_endpoint_data_attributes.py | 22 +- ...em_form_field_condition_data_attributes.py | 42 +- ..._custom_field_selection_data_attributes.py | 12 +- .../models/new_workflow_data_attributes.py | 122 +- ...ow_form_field_condition_data_attributes.py | 44 +- .../new_workflow_group_data_attributes.py | 30 +- ...new_workflow_run_data_attributes_type_0.py | 20 +- ...new_workflow_run_data_attributes_type_1.py | 20 +- ...new_workflow_run_data_attributes_type_2.py | 20 +- ...new_workflow_run_data_attributes_type_3.py | 20 +- ...new_workflow_run_data_attributes_type_4.py | 20 +- ...new_workflow_run_data_attributes_type_5.py | 20 +- .../new_workflow_task_data_attributes.py | 8 +- rootly_sdk/models/on_call_pay_report.py | 62 +- rootly_sdk/models/on_call_pay_report_list.py | 6 +- .../models/on_call_pay_report_response.py | 6 +- rootly_sdk/models/on_call_role.py | 102 +- rootly_sdk/models/on_call_role_list.py | 6 +- .../models/on_call_role_relationship.py | 2 +- .../on_call_role_relationship_data_type_0.py | 10 +- rootly_sdk/models/on_call_role_response.py | 6 +- rootly_sdk/models/on_call_shadow.py | 6 +- rootly_sdk/models/on_call_shadow_response.py | 6 +- rootly_sdk/models/on_call_shadows_list.py | 6 +- rootly_sdk/models/oncall.py | 50 +- rootly_sdk/models/oncall_list.py | 6 +- rootly_sdk/models/oncall_list_data_item.py | 4 +- rootly_sdk/models/oncall_relationships.py | 12 +- .../oncall_relationships_escalation_policy.py | 2 +- ...tionships_escalation_policy_data_type_0.py | 10 +- .../models/oncall_relationships_schedule.py | 2 +- ...call_relationships_schedule_data_type_0.py | 10 +- .../models/oncall_relationships_user.py | 2 +- .../oncall_relationships_user_data_type_0.py | 10 +- rootly_sdk/models/override_shift.py | 22 +- rootly_sdk/models/override_shift_list.py | 6 +- rootly_sdk/models/override_shift_response.py | 6 +- ...e_jsmops_on_call_responders_task_params.py | 34 +- ..._call_responders_task_params_teams_item.py | 6 +- ..._call_responders_task_params_users_item.py | 6 +- ...opsgenie_on_call_responders_task_params.py | 34 +- ..._call_responders_task_params_teams_item.py | 6 +- ..._call_responders_task_params_users_item.py | 6 +- ...agerduty_on_call_responders_task_params.py | 36 +- ...rs_task_params_escalation_policies_item.py | 6 +- ..._on_call_responders_task_params_service.py | 6 +- ..._call_responders_task_params_users_item.py | 6 +- ...e_rootly_on_call_responders_task_params.py | 32 +- ...rs_task_params_escalation_policy_target.py | 6 +- ...onders_task_params_functionality_target.py | 6 +- ...all_responders_task_params_group_target.py | 6 +- ...l_responders_task_params_service_target.py | 6 +- ...call_responders_task_params_user_target.py | 6 +- ...esponders_task_params_type_0_users_item.py | 6 +- ..._params_type_1_escalation_policies_item.py | 6 +- .../patch_alert_route_data_attributes.py | 18 +- ..._alert_route_data_attributes_rules_item.py | 24 +- ...ibutes_rules_item_condition_groups_item.py | 16 +- ...m_condition_groups_item_conditions_item.py | 86 +- ...attributes_rules_item_destinations_item.py | 22 +- .../models/phone_verification_response.py | 6 +- rootly_sdk/models/playbook.py | 66 +- rootly_sdk/models/playbook_list.py | 6 +- rootly_sdk/models/playbook_response.py | 6 +- rootly_sdk/models/playbook_task.py | 20 +- rootly_sdk/models/playbook_task_list.py | 6 +- rootly_sdk/models/playbook_task_response.py | 6 +- rootly_sdk/models/post_mortem_template.py | 28 +- .../models/post_mortem_template_list.py | 6 +- .../models/post_mortem_template_response.py | 6 +- .../models/post_mortem_trigger_params.py | 182 +- rootly_sdk/models/print_task_params.py | 8 +- .../models/publish_incident_task_params.py | 28 +- .../publish_incident_task_params_incident.py | 6 +- ...cident_task_params_status_page_template.py | 6 +- rootly_sdk/models/pulse.py | 38 +- rootly_sdk/models/pulse_list.py | 6 +- rootly_sdk/models/pulse_response.py | 6 +- rootly_sdk/models/pulse_trigger_params.py | 56 +- rootly_sdk/models/receipt.py | 12 +- rootly_sdk/models/redis_client_task_params.py | 18 +- ...task_params_post_to_slack_channels_item.py | 6 +- ...ove_google_docs_permissions_task_params.py | 8 +- .../remove_subscribers_data_attributes.py | 18 +- .../rename_google_chat_space_task_params.py | 8 +- ...ame_google_chat_space_task_params_space.py | 6 +- ...ame_microsoft_teams_channel_task_params.py | 8 +- ...osoft_teams_channel_task_params_channel.py | 6 +- ...icrosoft_teams_channel_task_params_team.py | 6 +- .../rename_slack_channel_task_params.py | 8 +- ...ename_slack_channel_task_params_channel.py | 6 +- rootly_sdk/models/resolve_alert.py | 4 +- rootly_sdk/models/resolve_alert_data.py | 10 +- .../models/resolve_alert_data_attributes.py | 18 +- .../resolve_incident_data_attributes.py | 10 +- rootly_sdk/models/restart_incident_data.py | 4 +- .../models/retrospective_configuration.py | 36 +- .../retrospective_configuration_list.py | 6 +- .../retrospective_configuration_response.py | 6 +- rootly_sdk/models/retrospective_process.py | 24 +- .../retrospective_process_group_list.py | 6 +- .../retrospective_process_group_response.py | 6 +- .../retrospective_process_group_step_list.py | 6 +- ...trospective_process_group_step_response.py | 6 +- .../models/retrospective_process_list.py | 6 +- .../models/retrospective_process_response.py | 6 +- rootly_sdk/models/retrospective_step.py | 32 +- rootly_sdk/models/retrospective_step_list.py | 6 +- .../models/retrospective_step_response.py | 6 +- rootly_sdk/models/role.py | 148 +- rootly_sdk/models/role_list.py | 6 +- rootly_sdk/models/role_relationship.py | 2 +- .../models/role_relationship_data_type_0.py | 10 +- rootly_sdk/models/role_response.py | 6 +- .../models/rotate_api_key_data_attributes.py | 12 +- .../models/run_command_heroku_task_params.py | 14 +- ...task_params_post_to_slack_channels_item.py | 6 +- rootly_sdk/models/schedule.py | 44 +- rootly_sdk/models/schedule_list.py | 6 +- rootly_sdk/models/schedule_response.py | 6 +- rootly_sdk/models/schedule_rotation.py | 32 +- ..._active_day_active_time_attributes_item.py | 6 +- .../schedule_rotation_active_day_list.py | 6 +- .../schedule_rotation_active_day_response.py | 8 +- ...edule_rotation_active_day_response_data.py | 12 +- rootly_sdk/models/schedule_rotation_list.py | 6 +- .../models/schedule_rotation_response.py | 6 +- .../models/schedule_rotation_user_list.py | 6 +- .../models/schedule_rotation_user_response.py | 6 +- .../models/schedule_slack_channel_type_0.py | 6 +- .../schedule_slack_user_group_type_0.py | 6 +- rootly_sdk/models/secret.py | 16 +- rootly_sdk/models/secret_list.py | 8 +- .../send_dashboard_report_task_params.py | 26 +- rootly_sdk/models/send_email_task_params.py | 46 +- ...end_google_chat_attachments_task_params.py | 8 +- ...hat_attachments_task_params_spaces_item.py | 6 +- .../send_google_chat_message_task_params.py | 16 +- ...le_chat_message_task_params_spaces_item.py | 6 +- ...blocks_task_params_type_0_channels_item.py | 6 +- ...icrosoft_teams_chat_message_task_params.py | 8 +- ...ams_chat_message_task_params_chats_item.py | 6 +- ...essage_task_params_type_0_channels_item.py | 6 +- ...blocks_task_params_type_0_channels_item.py | 6 +- ...cks_task_params_type_1_slack_users_item.py | 6 +- ...sk_params_type_2_slack_user_groups_item.py | 6 +- ...essage_task_params_type_0_channels_item.py | 6 +- ...age_task_params_type_1_slack_users_item.py | 6 +- ...sk_params_type_2_slack_user_groups_item.py | 6 +- rootly_sdk/models/send_sms_task_params.py | 8 +- .../send_whatsapp_message_task_params.py | 8 +- rootly_sdk/models/service.py | 244 +-- .../service_alert_broadcast_channel_type_0.py | 6 +- ...rvice_incident_broadcast_channel_type_0.py | 6 +- rootly_sdk/models/service_list.py | 6 +- rootly_sdk/models/service_response.py | 6 +- rootly_sdk/models/severity.py | 58 +- rootly_sdk/models/severity_list.py | 6 +- rootly_sdk/models/severity_response.py | 6 +- rootly_sdk/models/shift.py | 18 +- rootly_sdk/models/shift_coverage_request.py | 20 +- .../models/shift_coverage_request_list.py | 12 +- .../models/shift_coverage_request_response.py | 6 +- rootly_sdk/models/shift_list.py | 8 +- rootly_sdk/models/shift_list_data_item.py | 4 +- rootly_sdk/models/shift_override.py | 6 +- rootly_sdk/models/shift_override_response.py | 6 +- rootly_sdk/models/shift_relationships.py | 12 +- .../models/shift_relationships_assignee.py | 2 +- ...hift_relationships_assignee_data_type_0.py | 6 +- .../shift_relationships_shift_override.py | 2 +- ...elationships_shift_override_data_type_0.py | 10 +- rootly_sdk/models/shift_relationships_user.py | 2 +- .../shift_relationships_user_data_type_0.py | 10 +- rootly_sdk/models/simple_trigger_params.py | 6 +- rootly_sdk/models/sla.py | 64 +- rootly_sdk/models/sla_conditions_item.py | 42 +- rootly_sdk/models/sla_list.py | 6 +- .../sla_notification_configurations_item.py | 20 +- rootly_sdk/models/sla_response.py | 6 +- .../snapshot_datadog_graph_task_params.py | 22 +- ...tadog_graph_task_params_dashboards_item.py | 6 +- ...task_params_post_to_slack_channels_item.py | 6 +- .../snapshot_grafana_dashboard_task_params.py | 14 +- ...a_dashboard_task_params_dashboards_item.py | 6 +- ...task_params_post_to_slack_channels_item.py | 6 +- .../snapshot_looker_look_task_params.py | 14 +- ...looker_look_task_params_dashboards_item.py | 6 +- ...task_params_post_to_slack_channels_item.py | 6 +- .../snapshot_new_relic_graph_task_params.py | 14 +- ...task_params_post_to_slack_channels_item.py | 6 +- rootly_sdk/models/start_session_request.py | 16 +- rootly_sdk/models/start_session_response.py | 4 +- rootly_sdk/models/status.py | 12 +- rootly_sdk/models/status_list.py | 6 +- rootly_sdk/models/status_page.py | 218 +-- rootly_sdk/models/status_page_announcement.py | 10 +- .../models/status_page_announcement_list.py | 6 +- .../status_page_announcement_response.py | 6 +- rootly_sdk/models/status_page_component.py | 48 +- .../models/status_page_component_group.py | 12 +- .../status_page_component_group_list.py | 6 +- .../status_page_component_group_response.py | 6 +- .../models/status_page_component_list.py | 6 +- .../models/status_page_component_response.py | 6 +- rootly_sdk/models/status_page_list.py | 6 +- rootly_sdk/models/status_page_response.py | 6 +- rootly_sdk/models/status_page_template.py | 42 +- .../models/status_page_template_list.py | 6 +- .../models/status_page_template_response.py | 6 +- rootly_sdk/models/status_response.py | 6 +- rootly_sdk/models/sub_status.py | 20 +- rootly_sdk/models/sub_status_list.py | 6 +- rootly_sdk/models/sub_status_response.py | 6 +- rootly_sdk/models/team.py | 218 +-- .../team_alert_broadcast_channel_type_0.py | 6 +- .../team_incident_broadcast_channel_type_0.py | 6 +- rootly_sdk/models/team_list.py | 6 +- rootly_sdk/models/team_response.py | 6 +- rootly_sdk/models/tiptap_block_schema.py | 8 +- .../tiptap_block_schema_followup_component.py | 8 +- .../models/trigger_workflow_task_params.py | 10 +- .../trigger_workflow_task_params_resource.py | 6 +- .../trigger_workflow_task_params_workflow.py | 6 +- .../tweet_twitter_message_task_params.py | 8 +- ...unassign_role_from_user_data_attributes.py | 6 +- .../models/update_action_item_task_params.py | 46 +- ...ction_item_task_params_assigned_to_user.py | 6 +- ...pdate_airtable_table_record_task_params.py | 16 +- .../models/update_alert_data_attributes.py | 116 +- ...lert_data_attributes_labels_item_type_0.py | 10 +- .../update_alert_event_data_attributes.py | 4 +- .../update_alert_field_data_attributes.py | 12 +- .../update_alert_group_data_attributes.py | 52 +- ...t_group_data_attributes_attributes_item.py | 4 +- ...t_group_data_attributes_conditions_item.py | 26 +- ...te_alert_retrigger_rule_data_attributes.py | 22 +- ...er_rule_data_attributes_conditions_item.py | 12 +- .../update_alert_route_data_attributes.py | 18 +- ..._alert_route_data_attributes_rules_item.py | 6 +- ...ibutes_rules_item_condition_groups_item.py | 4 +- ...m_condition_groups_item_conditions_item.py | 50 +- ...date_alert_routing_rule_data_attributes.py | 30 +- ...ng_rule_data_attributes_conditions_item.py | 42 +- ...outing_rule_data_attributes_destination.py | 14 +- .../update_alert_urgency_data_attributes.py | 22 +- .../update_alerts_source_data_attributes.py | 62 +- ...tes_alert_source_fields_attributes_item.py | 12 +- ...rt_source_urgency_rules_attributes_item.py | 48 +- ...ibutes_alert_template_attributes_type_0.py | 26 +- ...butes_resolution_rule_attributes_type_0.py | 70 +- ...butes_type_0_conditions_attributes_item.py | 52 +- ...attributes_sourceable_attributes_type_0.py | 22 +- ...s_type_0_field_mappings_attributes_item.py | 12 +- .../models/update_api_key_data_attributes.py | 20 +- .../models/update_asana_task_task_params.py | 38 +- ...pdate_asana_task_task_params_completion.py | 6 +- .../update_attached_alerts_task_params.py | 8 +- .../update_authorization_data_attributes.py | 6 +- ...alog_checklist_template_data_attributes.py | 68 +- ...t_template_data_attributes_custom_field.py | 4 +- .../models/update_catalog_data_attributes.py | 42 +- .../update_catalog_entity_data_attributes.py | 56 +- ...catalog_entity_property_data_attributes.py | 10 +- .../update_catalog_field_data_attributes.py | 50 +- ...update_catalog_property_data_attributes.py | 50 +- .../models/update_cause_data_attributes.py | 40 +- .../models/update_clickup_task_task_params.py | 34 +- ...pdate_clickup_task_task_params_priority.py | 6 +- .../models/update_coda_page_task_params.py | 18 +- .../update_coda_page_task_params_template.py | 6 +- ...te_communications_group_data_attributes.py | 94 +- ...tion_external_group_members_type_0_item.py | 16 +- ...munication_group_conditions_type_0_item.py | 62 +- ...te_communications_stage_data_attributes.py | 28 +- ...communications_template_data_attributes.py | 48 +- ..._template_stages_attributes_type_0_item.py | 42 +- ...ate_communications_type_data_attributes.py | 36 +- .../update_confluence_page_task_params.py | 26 +- ...confluence_page_task_params_integration.py | 6 +- ...te_confluence_page_task_params_template.py | 6 +- .../update_custom_field_data_attributes.py | 34 +- ...ate_custom_field_option_data_attributes.py | 10 +- .../update_custom_form_data_attributes.py | 24 +- rootly_sdk/models/update_dashboard_data.py | 10 +- .../update_dashboard_data_attributes.py | 44 +- .../models/update_dashboard_panel_data.py | 10 +- .../update_dashboard_panel_data_attributes.py | 14 +- ..._dashboard_panel_data_attributes_params.py | 24 +- ...panel_data_attributes_params_datalabels.py | 4 +- ...el_data_attributes_params_datasets_item.py | 22 +- ...s_params_datasets_item_aggregate_type_0.py | 24 +- ...ibutes_params_datasets_item_filter_item.py | 12 +- ...ms_datasets_item_filter_item_rules_item.py | 18 +- ...ard_panel_data_attributes_params_legend.py | 8 +- .../update_datadog_notebook_task_params.py | 22 +- ...e_datadog_notebook_task_params_template.py | 6 +- .../update_dropbox_paper_page_task_params.py | 14 +- .../update_edge_connector_action_action.py | 12 +- .../update_edge_connector_action_body.py | 4 +- ...pdate_edge_connector_action_body_action.py | 12 +- .../models/update_edge_connector_body.py | 4 +- .../models/update_edge_connector_body_data.py | 12 +- ...ate_edge_connector_body_data_attributes.py | 18 +- .../update_edge_connector_edge_connector.py | 16 +- .../update_environment_data_attributes.py | 80 +- ...pdate_escalation_policy_data_attributes.py | 22 +- ...y_data_attributes_business_hours_type_0.py | 34 +- ...escalation_policy_level_data_attributes.py | 94 +- ..._notification_target_params_item_type_0.py | 12 +- ..._escalation_policy_path_data_attributes.py | 92 +- ..._path_data_attributes_rules_item_type_2.py | 14 +- ..._path_data_attributes_rules_item_type_3.py | 6 +- ...utes_rules_item_type_5_time_blocks_item.py | 30 +- ...ata_attributes_rules_item_type_8_type_2.py | 14 +- ...ata_attributes_rules_item_type_8_type_3.py | 6 +- ...les_item_type_8_type_5_time_blocks_item.py | 30 +- ...ata_attributes_rules_item_type_9_type_2.py | 14 +- ...ata_attributes_rules_item_type_9_type_3.py | 6 +- ...les_item_type_9_type_5_time_blocks_item.py | 30 +- ..._data_attributes_time_restrictions_item.py | 18 +- .../update_form_field_data_attributes.py | 70 +- ...pdate_form_field_option_data_attributes.py | 10 +- ...eld_placement_condition_data_attributes.py | 22 +- ...te_form_field_placement_data_attributes.py | 24 +- ...ate_form_field_position_data_attributes.py | 12 +- ...date_form_set_condition_data_attributes.py | 14 +- .../models/update_form_set_data_attributes.py | 16 +- .../update_functionality_data_attributes.py | 168 +- .../models/update_github_issue_task_params.py | 36 +- ...ate_github_issue_task_params_completion.py | 6 +- ...ate_github_issue_task_params_issue_type.py | 6 +- ...te_github_issue_task_params_labels_item.py | 6 +- ...ate_github_issue_task_params_repository.py | 6 +- .../models/update_gitlab_issue_task_params.py | 22 +- ...ate_gitlab_issue_task_params_completion.py | 6 +- ...pdate_google_calendar_event_task_params.py | 52 +- ...task_params_post_to_slack_channels_item.py | 6 +- ...ogle_chat_space_description_task_params.py | 8 +- ...hat_space_description_task_params_space.py | 6 +- .../update_google_docs_page_task_params.py | 22 +- .../update_heartbeat_data_attributes.py | 52 +- ...te_incident_action_item_data_attributes.py | 92 +- ...butes_form_field_selections_type_0_item.py | 56 +- ..._custom_field_selection_data_attributes.py | 14 +- .../models/update_incident_data_attributes.py | 310 ++-- .../update_incident_event_data_attributes.py | 10 +- ...pdate_incident_feedback_data_attributes.py | 12 +- ...nt_form_field_selection_data_attributes.py | 46 +- ..._permission_set_boolean_data_attributes.py | 14 +- ...boolean_data_attributes_severity_params.py | 16 +- ...incident_permission_set_data_attributes.py | 36 +- ...permission_set_resource_data_attributes.py | 16 +- ...esource_data_attributes_severity_params.py | 16 +- ...te_incident_post_mortem_data_attributes.py | 62 +- .../update_incident_postmortem_task_params.py | 24 +- ...dent_retrospective_step_data_attributes.py | 36 +- .../update_incident_role_data_attributes.py | 42 +- ...date_incident_role_task_data_attributes.py | 18 +- ...ident_status_page_event_data_attributes.py | 36 +- ...e_incident_status_timestamp_task_params.py | 8 +- ...ate_incident_sub_status_data_attributes.py | 14 +- .../models/update_incident_task_params.py | 136 +- .../update_incident_type_data_attributes.py | 72 +- .../models/update_jira_issue_task_params.py | 50 +- ...date_jira_issue_task_params_integration.py | 6 +- .../update_jira_issue_task_params_priority.py | 6 +- .../update_jira_issue_task_params_status.py | 6 +- .../models/update_linear_issue_task_params.py | 34 +- ...te_linear_issue_task_params_labels_item.py | 6 +- ...pdate_linear_issue_task_params_priority.py | 6 +- ...update_linear_issue_task_params_project.py | 6 +- ...e_linear_issue_task_params_state_type_0.py | 6 +- ...update_live_call_router_data_attributes.py | 74 +- .../models/update_motion_task_task_params.py | 22 +- ...update_motion_task_task_params_priority.py | 6 +- .../models/update_notion_page_task_params.py | 18 +- ...date_on_call_pay_report_data_attributes.py | 22 +- .../update_on_call_role_data_attributes.py | 120 +- .../update_on_call_shadow_data_attributes.py | 26 +- .../update_opsgenie_alert_task_params.py | 12 +- ...e_opsgenie_alert_task_params_completion.py | 6 +- .../update_opsgenie_incident_task_params.py | 24 +- .../update_pagerduty_incident_task_params.py | 28 +- .../update_pagertree_alert_task_params.py | 36 +- ..._pagertree_alert_task_params_teams_item.py | 6 +- ..._pagertree_alert_task_params_users_item.py | 6 +- .../models/update_playbook_data_attributes.py | 68 +- .../update_playbook_task_data_attributes.py | 20 +- ...te_post_mortem_template_data_attributes.py | 28 +- .../models/update_pulse_data_attributes.py | 64 +- .../models/update_quip_page_task_params.py | 16 +- ...ospective_configuration_data_attributes.py | 26 +- ...e_retrospective_process_data_attributes.py | 12 +- ...ospective_process_group_data_attributes.py | 6 +- ...tive_process_group_step_data_attributes.py | 4 +- ...date_retrospective_step_data_attributes.py | 46 +- .../models/update_role_data_attributes.py | 152 +- .../models/update_schedule_data_attributes.py | 98 +- ...le_data_attributes_slack_channel_type_0.py | 6 +- ...hedule_data_attributes_slack_user_group.py | 6 +- ...ule_rotation_active_day_data_attributes.py | 16 +- ..._attributes_active_time_attributes_item.py | 6 +- ...pdate_schedule_rotation_data_attributes.py | 48 +- ...s_schedule_rotation_members_type_0_item.py | 4 +- ..._schedule_rotation_user_data_attributes.py | 6 +- .../models/update_secret_data_attributes.py | 28 +- .../models/update_service_data_attributes.py | 234 +-- ...tributes_alert_broadcast_channel_type_0.py | 4 +- ...butes_incident_broadcast_channel_type_0.py | 4 +- ...update_service_now_incident_task_params.py | 26 +- ...ice_now_incident_task_params_completion.py | 6 +- ...rvice_now_incident_task_params_priority.py | 6 +- .../models/update_severity_data_attributes.py | 66 +- .../update_sharepoint_page_task_params.py | 14 +- .../update_shortcut_story_task_params.py | 16 +- ..._shortcut_story_task_params_archivation.py | 6 +- .../update_shortcut_task_task_params.py | 10 +- ...te_shortcut_task_task_params_completion.py | 6 +- .../models/update_sla_data_attributes.py | 102 +- ...ate_sla_data_attributes_conditions_item.py | 26 +- .../update_slack_channel_topic_task_params.py | 8 +- ...slack_channel_topic_task_params_channel.py | 6 +- ...tatus_page_announcement_data_attributes.py | 6 +- ...e_status_page_component_data_attributes.py | 28 +- ...us_page_component_group_data_attributes.py | 22 +- .../update_status_page_data_attributes.py | 222 +-- ...te_status_page_template_data_attributes.py | 40 +- .../models/update_status_task_params.py | 10 +- .../update_sub_status_data_attributes.py | 28 +- .../models/update_team_data_attributes.py | 208 +-- ...tributes_alert_broadcast_channel_type_0.py | 4 +- ...butes_incident_broadcast_channel_type_0.py | 4 +- .../models/update_trello_card_task_params.py | 24 +- ...ate_trello_card_task_params_archivation.py | 6 +- .../update_trello_card_task_params_board.py | 6 +- ...ate_trello_card_task_params_labels_item.py | 6 +- .../update_trello_card_task_params_list.py | 6 +- .../models/update_user_data_attributes.py | 34 +- ...date_user_email_address_data_attributes.py | 4 +- ..._user_notification_rule_data_attributes.py | 54 +- ...pdate_user_phone_number_data_attributes.py | 4 +- .../update_victor_ops_incident_task_params.py | 10 +- ...pdate_webhooks_endpoint_data_attributes.py | 22 +- ...em_form_field_condition_data_attributes.py | 50 +- ..._custom_field_selection_data_attributes.py | 16 +- rootly_sdk/models/update_workflow_data.py | 4 +- .../models/update_workflow_data_attributes.py | 114 +- ...ow_form_field_condition_data_attributes.py | 48 +- .../update_workflow_group_data_attributes.py | 32 +- .../update_workflow_task_data_attributes.py | 10 +- .../update_zendesk_ticket_task_params.py | 34 +- ...e_zendesk_ticket_task_params_completion.py | 6 +- ...ate_zendesk_ticket_task_params_priority.py | 6 +- rootly_sdk/models/user.py | 42 +- rootly_sdk/models/user_email_address.py | 12 +- rootly_sdk/models/user_email_address_list.py | 6 +- .../models/user_email_address_response.py | 6 +- rootly_sdk/models/user_flat_response.py | 76 +- rootly_sdk/models/user_list.py | 6 +- rootly_sdk/models/user_list_data_item.py | 4 +- rootly_sdk/models/user_notification_rule.py | 66 +- .../models/user_notification_rule_list.py | 6 +- .../models/user_notification_rule_response.py | 6 +- rootly_sdk/models/user_phone_number.py | 22 +- rootly_sdk/models/user_phone_number_list.py | 6 +- .../models/user_phone_number_response.py | 6 +- rootly_sdk/models/user_relationships.py | 8 +- rootly_sdk/models/user_response.py | 6 +- rootly_sdk/models/user_response_data.py | 4 +- rootly_sdk/models/verified_domain.py | 34 +- rootly_sdk/models/verified_domain_list.py | 6 +- rootly_sdk/models/verified_domain_response.py | 6 +- rootly_sdk/models/webhooks_delivery.py | 18 +- rootly_sdk/models/webhooks_delivery_list.py | 12 +- .../models/webhooks_delivery_response.py | 6 +- rootly_sdk/models/webhooks_endpoint.py | 8 +- rootly_sdk/models/webhooks_endpoint_list.py | 12 +- .../models/webhooks_endpoint_response.py | 6 +- rootly_sdk/models/workflow.py | 114 +- ...rkflow_action_item_form_field_condition.py | 30 +- ...w_action_item_form_field_condition_list.py | 6 +- ...tion_item_form_field_condition_response.py | 6 +- .../models/workflow_custom_field_selection.py | 6 +- .../workflow_custom_field_selection_list.py | 6 +- ...orkflow_custom_field_selection_response.py | 6 +- .../models/workflow_form_field_condition.py | 30 +- .../workflow_form_field_condition_list.py | 6 +- .../workflow_form_field_condition_response.py | 6 +- rootly_sdk/models/workflow_group.py | 22 +- rootly_sdk/models/workflow_group_list.py | 6 +- rootly_sdk/models/workflow_group_response.py | 6 +- rootly_sdk/models/workflow_list.py | 6 +- rootly_sdk/models/workflow_response.py | 6 +- rootly_sdk/models/workflow_run.py | 84 +- rootly_sdk/models/workflow_run_response.py | 6 +- rootly_sdk/models/workflow_runs_list.py | 6 +- rootly_sdk/models/workflow_task.py | 2 +- rootly_sdk/models/workflow_task_list.py | 6 +- rootly_sdk/models/workflow_task_response.py | 6 +- rootly_sdk/types.py | 19 +- 1752 files changed, 25566 insertions(+), 25934 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d420a391..d0a654e5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,7 +21,7 @@ jobs: run: pip install uv - name: Install dependencies - run: uv pip install --system "ruff>=0.15.0" + run: uv pip install --system "ruff==0.16.3" - name: Ruff check run: ruff check . diff --git a/Makefile b/Makefile index 94d22b41..8f87260a 100644 --- a/Makefile +++ b/Makefile @@ -13,6 +13,7 @@ NEW_PATCH := $(MAJOR).$(MINOR).$(shell echo $$(($(PATCH) + 1))) # Today's date TODAY := $(shell date +%Y-%m-%d) +RUFF_VERSION := 0.16.3 bump-major: @echo "Bumping version: $(CURRENT_VERSION) -> $(NEW_MAJOR)" @@ -42,9 +43,9 @@ regenerate: @echo "Applying nullable enum fix..." @python tools/fix_nullable_enums.py @echo "Fixing lint errors..." - @ruff check --fix rootly_sdk/ + @uvx --from ruff==$(RUFF_VERSION) ruff check --fix rootly_sdk/ @echo "Formatting patched files..." - @ruff format rootly_sdk/ + @uvx --from ruff==$(RUFF_VERSION) ruff format rootly_sdk/ test: python -c "import rootly_sdk; print('SDK imports successfully')" diff --git a/rootly_sdk/api/ai_chat/create_ai_chat.py b/rootly_sdk/api/ai_chat/create_ai_chat.py index 3c39d143..77ab6bae 100644 --- a/rootly_sdk/api/ai_chat/create_ai_chat.py +++ b/rootly_sdk/api/ai_chat/create_ai_chat.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union, cast +from typing import Any, cast from uuid import UUID import httpx @@ -13,25 +13,25 @@ def _get_kwargs( *, message: str, - session_id: Union[Unset, UUID] = UNSET, - incident_id: Union[Unset, UUID] = UNSET, - alert_id: Union[Unset, UUID] = UNSET, + session_id: Unset | UUID = UNSET, + incident_id: Unset | UUID = UNSET, + alert_id: Unset | UUID = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} params["message"] = message - json_session_id: Union[Unset, str] = UNSET + json_session_id: Unset | str = UNSET if not isinstance(session_id, Unset): json_session_id = str(session_id) params["session_id"] = json_session_id - json_incident_id: Union[Unset, str] = UNSET + json_incident_id: Unset | str = UNSET if not isinstance(incident_id, Unset): json_incident_id = str(incident_id) params["incident_id"] = json_incident_id - json_alert_id: Union[Unset, str] = UNSET + json_alert_id: Unset | str = UNSET if not isinstance(alert_id, Unset): json_alert_id = str(alert_id) params["alert_id"] = json_alert_id @@ -47,9 +47,7 @@ def _get_kwargs( return _kwargs -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[AiChatResponse, Any]]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> AiChatResponse | Any | None: if response.status_code == 200: response_200 = AiChatResponse.from_dict(response.json()) @@ -70,8 +68,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[AiChatResponse, Any]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[AiChatResponse | Any]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -84,10 +82,10 @@ def sync_detailed( *, client: AuthenticatedClient, message: str, - session_id: Union[Unset, UUID] = UNSET, - incident_id: Union[Unset, UUID] = UNSET, - alert_id: Union[Unset, UUID] = UNSET, -) -> Response[Union[AiChatResponse, Any]]: + session_id: Unset | UUID = UNSET, + incident_id: Unset | UUID = UNSET, + alert_id: Unset | UUID = UNSET, +) -> Response[AiChatResponse | Any]: """Send AI chat message Send a message to the AI assistant and receive a synchronous reply. Optionally bind the conversation @@ -126,10 +124,10 @@ def sync( *, client: AuthenticatedClient, message: str, - session_id: Union[Unset, UUID] = UNSET, - incident_id: Union[Unset, UUID] = UNSET, - alert_id: Union[Unset, UUID] = UNSET, -) -> Optional[Union[AiChatResponse, Any]]: + session_id: Unset | UUID = UNSET, + incident_id: Unset | UUID = UNSET, + alert_id: Unset | UUID = UNSET, +) -> AiChatResponse | Any | None: """Send AI chat message Send a message to the AI assistant and receive a synchronous reply. Optionally bind the conversation @@ -163,10 +161,10 @@ async def asyncio_detailed( *, client: AuthenticatedClient, message: str, - session_id: Union[Unset, UUID] = UNSET, - incident_id: Union[Unset, UUID] = UNSET, - alert_id: Union[Unset, UUID] = UNSET, -) -> Response[Union[AiChatResponse, Any]]: + session_id: Unset | UUID = UNSET, + incident_id: Unset | UUID = UNSET, + alert_id: Unset | UUID = UNSET, +) -> Response[AiChatResponse | Any]: """Send AI chat message Send a message to the AI assistant and receive a synchronous reply. Optionally bind the conversation @@ -203,10 +201,10 @@ async def asyncio( *, client: AuthenticatedClient, message: str, - session_id: Union[Unset, UUID] = UNSET, - incident_id: Union[Unset, UUID] = UNSET, - alert_id: Union[Unset, UUID] = UNSET, -) -> Optional[Union[AiChatResponse, Any]]: + session_id: Unset | UUID = UNSET, + incident_id: Unset | UUID = UNSET, + alert_id: Unset | UUID = UNSET, +) -> AiChatResponse | Any | None: """Send AI chat message Send a message to the AI assistant and receive a synchronous reply. Optionally bind the conversation diff --git a/rootly_sdk/api/ai_chat/delete_ai_chat_session.py b/rootly_sdk/api/ai_chat/delete_ai_chat_session.py index b99efc94..2a6cfc00 100644 --- a/rootly_sdk/api/ai_chat/delete_ai_chat_session.py +++ b/rootly_sdk/api/ai_chat/delete_ai_chat_session.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any from uuid import UUID import httpx @@ -20,7 +20,7 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Any | None: if response.status_code == 204: return None @@ -33,7 +33,7 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Any]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, diff --git a/rootly_sdk/api/ai_chat/list_ai_chat_session_messages.py b/rootly_sdk/api/ai_chat/list_ai_chat_session_messages.py index 3f8081ec..22f548c3 100644 --- a/rootly_sdk/api/ai_chat/list_ai_chat_session_messages.py +++ b/rootly_sdk/api/ai_chat/list_ai_chat_session_messages.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union, cast +from typing import Any, cast from uuid import UUID import httpx @@ -13,8 +13,8 @@ def _get_kwargs( session_id: UUID, *, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -34,8 +34,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[AiChatSessionMessageList, Any]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> AiChatSessionMessageList | Any | None: if response.status_code == 200: response_200 = AiChatSessionMessageList.from_dict(response.json()) @@ -52,8 +52,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[AiChatSessionMessageList, Any]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[AiChatSessionMessageList | Any]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,9 +66,9 @@ def sync_detailed( session_id: UUID, *, client: AuthenticatedClient, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, -) -> Response[Union[AiChatSessionMessageList, Any]]: + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, +) -> Response[AiChatSessionMessageList | Any]: """List AI chat session messages Returns the user and assistant message history for a session, paginated and chronologically ordered. @@ -104,9 +104,9 @@ def sync( session_id: UUID, *, client: AuthenticatedClient, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, -) -> Optional[Union[AiChatSessionMessageList, Any]]: + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, +) -> AiChatSessionMessageList | Any | None: """List AI chat session messages Returns the user and assistant message history for a session, paginated and chronologically ordered. @@ -137,9 +137,9 @@ async def asyncio_detailed( session_id: UUID, *, client: AuthenticatedClient, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, -) -> Response[Union[AiChatSessionMessageList, Any]]: + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, +) -> Response[AiChatSessionMessageList | Any]: """List AI chat session messages Returns the user and assistant message history for a session, paginated and chronologically ordered. @@ -173,9 +173,9 @@ async def asyncio( session_id: UUID, *, client: AuthenticatedClient, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, -) -> Optional[Union[AiChatSessionMessageList, Any]]: + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, +) -> AiChatSessionMessageList | Any | None: """List AI chat session messages Returns the user and assistant message history for a session, paginated and chronologically ordered. diff --git a/rootly_sdk/api/ai_chat/stream_ai_chat.py b/rootly_sdk/api/ai_chat/stream_ai_chat.py index 7c8371d8..1dab0fe1 100644 --- a/rootly_sdk/api/ai_chat/stream_ai_chat.py +++ b/rootly_sdk/api/ai_chat/stream_ai_chat.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any from uuid import UUID import httpx @@ -12,25 +12,25 @@ def _get_kwargs( *, message: str, - session_id: Union[Unset, UUID] = UNSET, - incident_id: Union[Unset, UUID] = UNSET, - alert_id: Union[Unset, UUID] = UNSET, + session_id: Unset | UUID = UNSET, + incident_id: Unset | UUID = UNSET, + alert_id: Unset | UUID = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} params["message"] = message - json_session_id: Union[Unset, str] = UNSET + json_session_id: Unset | str = UNSET if not isinstance(session_id, Unset): json_session_id = str(session_id) params["session_id"] = json_session_id - json_incident_id: Union[Unset, str] = UNSET + json_incident_id: Unset | str = UNSET if not isinstance(incident_id, Unset): json_incident_id = str(incident_id) params["incident_id"] = json_incident_id - json_alert_id: Union[Unset, str] = UNSET + json_alert_id: Unset | str = UNSET if not isinstance(alert_id, Unset): json_alert_id = str(alert_id) params["alert_id"] = json_alert_id @@ -46,7 +46,7 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Any | None: if response.status_code == 200: return None @@ -59,7 +59,7 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Any]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -72,9 +72,9 @@ def sync_detailed( *, client: AuthenticatedClient, message: str, - session_id: Union[Unset, UUID] = UNSET, - incident_id: Union[Unset, UUID] = UNSET, - alert_id: Union[Unset, UUID] = UNSET, + session_id: Unset | UUID = UNSET, + incident_id: Unset | UUID = UNSET, + alert_id: Unset | UUID = UNSET, ) -> Response[Any]: """Stream AI chat response (SSE) @@ -115,9 +115,9 @@ async def asyncio_detailed( *, client: AuthenticatedClient, message: str, - session_id: Union[Unset, UUID] = UNSET, - incident_id: Union[Unset, UUID] = UNSET, - alert_id: Union[Unset, UUID] = UNSET, + session_id: Unset | UUID = UNSET, + incident_id: Unset | UUID = UNSET, + alert_id: Unset | UUID = UNSET, ) -> Response[Any]: """Stream AI chat response (SSE) diff --git a/rootly_sdk/api/alert_events/create_alert_event.py b/rootly_sdk/api/alert_events/create_alert_event.py index 0f0a5955..f5d287dc 100644 --- a/rootly_sdk/api/alert_events/create_alert_event.py +++ b/rootly_sdk/api/alert_events/create_alert_event.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[AlertEventResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> AlertEventResponse | ErrorsList | None: if response.status_code == 201: response_201 = AlertEventResponse.from_dict(response.json()) @@ -51,8 +51,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[AlertEventResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[AlertEventResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewAlertEvent, -) -> Response[Union[AlertEventResponse, ErrorsList]]: +) -> Response[AlertEventResponse | ErrorsList]: """Create alert event Creates a new alert event @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: NewAlertEvent, -) -> Optional[Union[AlertEventResponse, ErrorsList]]: +) -> AlertEventResponse | ErrorsList | None: """Create alert event Creates a new alert event @@ -129,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewAlertEvent, -) -> Response[Union[AlertEventResponse, ErrorsList]]: +) -> Response[AlertEventResponse | ErrorsList]: """Create alert event Creates a new alert event @@ -161,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewAlertEvent, -) -> Optional[Union[AlertEventResponse, ErrorsList]]: +) -> AlertEventResponse | ErrorsList | None: """Create alert event Creates a new alert event diff --git a/rootly_sdk/api/alert_events/delete_alert_event.py b/rootly_sdk/api/alert_events/delete_alert_event.py index 1dbeba70..cb3dd9b6 100644 --- a/rootly_sdk/api/alert_events/delete_alert_event.py +++ b/rootly_sdk/api/alert_events/delete_alert_event.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union, cast +from typing import Any, cast import httpx @@ -20,9 +20,7 @@ def _get_kwargs( return _kwargs -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[Any, ErrorsList]]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Any | ErrorsList | None: if response.status_code == 200: response_200 = cast(Any, None) return response_200 @@ -38,9 +36,7 @@ def _parse_response( return None -def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[Any, ErrorsList]]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Any | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -53,7 +49,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[Any, ErrorsList]]: +) -> Response[Any | ErrorsList]: """Delete alert event Deletes a specific alert event. Only alert events with kind 'note' (user-created notes) can be @@ -85,7 +81,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[Any, ErrorsList]]: +) -> Any | ErrorsList | None: """Delete alert event Deletes a specific alert event. Only alert events with kind 'note' (user-created notes) can be @@ -112,7 +108,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[Any, ErrorsList]]: +) -> Response[Any | ErrorsList]: """Delete alert event Deletes a specific alert event. Only alert events with kind 'note' (user-created notes) can be @@ -142,7 +138,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[Any, ErrorsList]]: +) -> Any | ErrorsList | None: """Delete alert event Deletes a specific alert event. Only alert events with kind 'note' (user-created notes) can be diff --git a/rootly_sdk/api/alert_events/get_alert_event.py b/rootly_sdk/api/alert_events/get_alert_event.py index a9544bfd..97436121 100644 --- a/rootly_sdk/api/alert_events/get_alert_event.py +++ b/rootly_sdk/api/alert_events/get_alert_event.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[AlertEventResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> AlertEventResponse | ErrorsList | None: if response.status_code == 200: response_200 = AlertEventResponse.from_dict(response.json()) @@ -41,8 +41,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[AlertEventResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[AlertEventResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -55,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[AlertEventResponse, ErrorsList]]: +) -> Response[AlertEventResponse | ErrorsList]: """Retrieve alert event Retrieves a specific alert_event by id @@ -86,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[AlertEventResponse, ErrorsList]]: +) -> AlertEventResponse | ErrorsList | None: """Retrieve alert event Retrieves a specific alert_event by id @@ -112,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[AlertEventResponse, ErrorsList]]: +) -> Response[AlertEventResponse | ErrorsList]: """Retrieve alert event Retrieves a specific alert_event by id @@ -141,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[AlertEventResponse, ErrorsList]]: +) -> AlertEventResponse | ErrorsList | None: """Retrieve alert event Retrieves a specific alert_event by id diff --git a/rootly_sdk/api/alert_events/list_alert_events.py b/rootly_sdk/api/alert_events/list_alert_events.py index 51b26ed6..9f2e292e 100644 --- a/rootly_sdk/api/alert_events/list_alert_events.py +++ b/rootly_sdk/api/alert_events/list_alert_events.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -12,11 +12,11 @@ def _get_kwargs( alert_id: str, *, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterkind: Union[Unset, str] = UNSET, - filteraction: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterkind: Unset | str = UNSET, + filteraction: Unset | str = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -41,9 +41,7 @@ def _get_kwargs( return _kwargs -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[AlertEventList]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> AlertEventList | None: if response.status_code == 200: response_200 = AlertEventList.from_dict(response.json()) @@ -55,9 +53,7 @@ def _parse_response( return None -def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[AlertEventList]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[AlertEventList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -70,11 +66,11 @@ def sync_detailed( alert_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterkind: Union[Unset, str] = UNSET, - filteraction: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterkind: Unset | str = UNSET, + filteraction: Unset | str = UNSET, ) -> Response[AlertEventList]: """List alert events @@ -116,12 +112,12 @@ def sync( alert_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterkind: Union[Unset, str] = UNSET, - filteraction: Union[Unset, str] = UNSET, -) -> Optional[AlertEventList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterkind: Unset | str = UNSET, + filteraction: Unset | str = UNSET, +) -> AlertEventList | None: """List alert events List alert_events @@ -157,11 +153,11 @@ async def asyncio_detailed( alert_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterkind: Union[Unset, str] = UNSET, - filteraction: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterkind: Unset | str = UNSET, + filteraction: Unset | str = UNSET, ) -> Response[AlertEventList]: """List alert events @@ -201,12 +197,12 @@ async def asyncio( alert_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterkind: Union[Unset, str] = UNSET, - filteraction: Union[Unset, str] = UNSET, -) -> Optional[AlertEventList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterkind: Unset | str = UNSET, + filteraction: Unset | str = UNSET, +) -> AlertEventList | None: """List alert events List alert_events diff --git a/rootly_sdk/api/alert_events/list_alert_events_feed.py b/rootly_sdk/api/alert_events/list_alert_events_feed.py index cd82cfb5..aa204cc1 100644 --- a/rootly_sdk/api/alert_events/list_alert_events_feed.py +++ b/rootly_sdk/api/alert_events/list_alert_events_feed.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -18,17 +18,17 @@ def _get_kwargs( *, - include: Union[Unset, str] = UNSET, - pagesize: Union[Unset, int] = UNSET, - pageafter: Union[Unset, str] = UNSET, - sort: Union[Unset, ListAlertEventsFeedSort] = UNSET, - filterkind: Union[Unset, ListAlertEventsFeedFilterkind] = UNSET, - filteraction: Union[Unset, ListAlertEventsFeedFilteraction] = UNSET, - filteralert_id: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagesize: Unset | int = UNSET, + pageafter: Unset | str = UNSET, + sort: Unset | ListAlertEventsFeedSort = UNSET, + filterkind: Unset | ListAlertEventsFeedFilterkind = UNSET, + filteraction: Unset | ListAlertEventsFeedFilteraction = UNSET, + filteralert_id: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -38,19 +38,19 @@ def _get_kwargs( params["page[after]"] = pageafter - json_sort: Union[Unset, str] = UNSET + json_sort: Unset | str = UNSET if not isinstance(sort, Unset): json_sort = sort params["sort"] = json_sort - json_filterkind: Union[Unset, str] = UNSET + json_filterkind: Unset | str = UNSET if not isinstance(filterkind, Unset): json_filterkind = filterkind params["filter[kind]"] = json_filterkind - json_filteraction: Union[Unset, str] = UNSET + json_filteraction: Unset | str = UNSET if not isinstance(filteraction, Unset): json_filteraction = filteraction @@ -77,9 +77,7 @@ def _get_kwargs( return _kwargs -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[AlertEventFeedList]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> AlertEventFeedList | None: if response.status_code == 200: response_200 = AlertEventFeedList.from_dict(response.json()) @@ -91,9 +89,7 @@ def _parse_response( return None -def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[AlertEventFeedList]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[AlertEventFeedList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -105,17 +101,17 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagesize: Union[Unset, int] = UNSET, - pageafter: Union[Unset, str] = UNSET, - sort: Union[Unset, ListAlertEventsFeedSort] = UNSET, - filterkind: Union[Unset, ListAlertEventsFeedFilterkind] = UNSET, - filteraction: Union[Unset, ListAlertEventsFeedFilteraction] = UNSET, - filteralert_id: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagesize: Unset | int = UNSET, + pageafter: Unset | str = UNSET, + sort: Unset | ListAlertEventsFeedSort = UNSET, + filterkind: Unset | ListAlertEventsFeedFilterkind = UNSET, + filteraction: Unset | ListAlertEventsFeedFilteraction = UNSET, + filteralert_id: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> Response[AlertEventFeedList]: """List alert events across alerts @@ -168,18 +164,18 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagesize: Union[Unset, int] = UNSET, - pageafter: Union[Unset, str] = UNSET, - sort: Union[Unset, ListAlertEventsFeedSort] = UNSET, - filterkind: Union[Unset, ListAlertEventsFeedFilterkind] = UNSET, - filteraction: Union[Unset, ListAlertEventsFeedFilteraction] = UNSET, - filteralert_id: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, -) -> Optional[AlertEventFeedList]: + include: Unset | str = UNSET, + pagesize: Unset | int = UNSET, + pageafter: Unset | str = UNSET, + sort: Unset | ListAlertEventsFeedSort = UNSET, + filterkind: Unset | ListAlertEventsFeedFilterkind = UNSET, + filteraction: Unset | ListAlertEventsFeedFilteraction = UNSET, + filteralert_id: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, +) -> AlertEventFeedList | None: """List alert events across alerts Returns a flat list of alert events across all alerts the requester can access. Designed for @@ -226,17 +222,17 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagesize: Union[Unset, int] = UNSET, - pageafter: Union[Unset, str] = UNSET, - sort: Union[Unset, ListAlertEventsFeedSort] = UNSET, - filterkind: Union[Unset, ListAlertEventsFeedFilterkind] = UNSET, - filteraction: Union[Unset, ListAlertEventsFeedFilteraction] = UNSET, - filteralert_id: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagesize: Unset | int = UNSET, + pageafter: Unset | str = UNSET, + sort: Unset | ListAlertEventsFeedSort = UNSET, + filterkind: Unset | ListAlertEventsFeedFilterkind = UNSET, + filteraction: Unset | ListAlertEventsFeedFilteraction = UNSET, + filteralert_id: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> Response[AlertEventFeedList]: """List alert events across alerts @@ -287,18 +283,18 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagesize: Union[Unset, int] = UNSET, - pageafter: Union[Unset, str] = UNSET, - sort: Union[Unset, ListAlertEventsFeedSort] = UNSET, - filterkind: Union[Unset, ListAlertEventsFeedFilterkind] = UNSET, - filteraction: Union[Unset, ListAlertEventsFeedFilteraction] = UNSET, - filteralert_id: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, -) -> Optional[AlertEventFeedList]: + include: Unset | str = UNSET, + pagesize: Unset | int = UNSET, + pageafter: Unset | str = UNSET, + sort: Unset | ListAlertEventsFeedSort = UNSET, + filterkind: Unset | ListAlertEventsFeedFilterkind = UNSET, + filteraction: Unset | ListAlertEventsFeedFilteraction = UNSET, + filteralert_id: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, +) -> AlertEventFeedList | None: """List alert events across alerts Returns a flat list of alert events across all alerts the requester can access. Designed for diff --git a/rootly_sdk/api/alert_events/update_alert_event.py b/rootly_sdk/api/alert_events/update_alert_event.py index ad592d52..f4649948 100644 --- a/rootly_sdk/api/alert_events/update_alert_event.py +++ b/rootly_sdk/api/alert_events/update_alert_event.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[AlertEventResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> AlertEventResponse | ErrorsList | None: if response.status_code == 200: response_200 = AlertEventResponse.from_dict(response.json()) @@ -51,8 +51,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[AlertEventResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[AlertEventResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateAlertEvent, -) -> Response[Union[AlertEventResponse, ErrorsList]]: +) -> Response[AlertEventResponse | ErrorsList]: """Update alert event Updates a specific alert event. Only alert events with kind 'note' (user-created notes) can be @@ -102,7 +102,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateAlertEvent, -) -> Optional[Union[AlertEventResponse, ErrorsList]]: +) -> AlertEventResponse | ErrorsList | None: """Update alert event Updates a specific alert event. Only alert events with kind 'note' (user-created notes) can be @@ -133,7 +133,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateAlertEvent, -) -> Response[Union[AlertEventResponse, ErrorsList]]: +) -> Response[AlertEventResponse | ErrorsList]: """Update alert event Updates a specific alert event. Only alert events with kind 'note' (user-created notes) can be @@ -167,7 +167,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateAlertEvent, -) -> Optional[Union[AlertEventResponse, ErrorsList]]: +) -> AlertEventResponse | ErrorsList | None: """Update alert event Updates a specific alert event. Only alert events with kind 'note' (user-created notes) can be diff --git a/rootly_sdk/api/alert_fields/create_alert_field.py b/rootly_sdk/api/alert_fields/create_alert_field.py index 96f2e3a2..768e2a75 100644 --- a/rootly_sdk/api/alert_fields/create_alert_field.py +++ b/rootly_sdk/api/alert_fields/create_alert_field.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[AlertFieldResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> AlertFieldResponse | ErrorsList | None: if response.status_code == 201: response_201 = AlertFieldResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[AlertFieldResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[AlertFieldResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +69,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewAlertField, -) -> Response[Union[AlertFieldResponse, ErrorsList]]: +) -> Response[AlertFieldResponse | ErrorsList]: """Creates an alert field Creates a new alert field from provided data @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: NewAlertField, -) -> Optional[Union[AlertFieldResponse, ErrorsList]]: +) -> AlertFieldResponse | ErrorsList | None: """Creates an alert field Creates a new alert field from provided data @@ -126,7 +126,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewAlertField, -) -> Response[Union[AlertFieldResponse, ErrorsList]]: +) -> Response[AlertFieldResponse | ErrorsList]: """Creates an alert field Creates a new alert field from provided data @@ -155,7 +155,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewAlertField, -) -> Optional[Union[AlertFieldResponse, ErrorsList]]: +) -> AlertFieldResponse | ErrorsList | None: """Creates an alert field Creates a new alert field from provided data diff --git a/rootly_sdk/api/alert_fields/delete_alert_field.py b/rootly_sdk/api/alert_fields/delete_alert_field.py index 3eaa5e59..7adfde1f 100644 --- a/rootly_sdk/api/alert_fields/delete_alert_field.py +++ b/rootly_sdk/api/alert_fields/delete_alert_field.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any from uuid import UUID import httpx @@ -12,7 +12,7 @@ def _get_kwargs( - id: Union[UUID, str], + id: UUID | str, ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "delete", @@ -23,8 +23,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[AlertFieldResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> AlertFieldResponse | ErrorsList | None: if response.status_code == 200: response_200 = AlertFieldResponse.from_dict(response.json()) @@ -47,8 +47,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[AlertFieldResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[AlertFieldResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -58,10 +58,10 @@ def _build_response( def sync_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Response[Union[AlertFieldResponse, ErrorsList]]: +) -> Response[AlertFieldResponse | ErrorsList]: """Delete an alert field Delete a specific alert field by id @@ -89,10 +89,10 @@ def sync_detailed( def sync( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Optional[Union[AlertFieldResponse, ErrorsList]]: +) -> AlertFieldResponse | ErrorsList | None: """Delete an alert field Delete a specific alert field by id @@ -115,10 +115,10 @@ def sync( async def asyncio_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Response[Union[AlertFieldResponse, ErrorsList]]: +) -> Response[AlertFieldResponse | ErrorsList]: """Delete an alert field Delete a specific alert field by id @@ -144,10 +144,10 @@ async def asyncio_detailed( async def asyncio( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Optional[Union[AlertFieldResponse, ErrorsList]]: +) -> AlertFieldResponse | ErrorsList | None: """Delete an alert field Delete a specific alert field by id diff --git a/rootly_sdk/api/alert_fields/get_alert_field.py b/rootly_sdk/api/alert_fields/get_alert_field.py index 5484e155..5d58ac0c 100644 --- a/rootly_sdk/api/alert_fields/get_alert_field.py +++ b/rootly_sdk/api/alert_fields/get_alert_field.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any from uuid import UUID import httpx @@ -12,7 +12,7 @@ def _get_kwargs( - id: Union[UUID, str], + id: UUID | str, ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "get", @@ -23,8 +23,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[AlertFieldResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> AlertFieldResponse | ErrorsList | None: if response.status_code == 200: response_200 = AlertFieldResponse.from_dict(response.json()) @@ -42,8 +42,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[AlertFieldResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[AlertFieldResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -53,10 +53,10 @@ def _build_response( def sync_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Response[Union[AlertFieldResponse, ErrorsList]]: +) -> Response[AlertFieldResponse | ErrorsList]: """Retrieves an alert field Retrieves a specific alert field by id @@ -84,10 +84,10 @@ def sync_detailed( def sync( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Optional[Union[AlertFieldResponse, ErrorsList]]: +) -> AlertFieldResponse | ErrorsList | None: """Retrieves an alert field Retrieves a specific alert field by id @@ -110,10 +110,10 @@ def sync( async def asyncio_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Response[Union[AlertFieldResponse, ErrorsList]]: +) -> Response[AlertFieldResponse | ErrorsList]: """Retrieves an alert field Retrieves a specific alert field by id @@ -139,10 +139,10 @@ async def asyncio_detailed( async def asyncio( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Optional[Union[AlertFieldResponse, ErrorsList]]: +) -> AlertFieldResponse | ErrorsList | None: """Retrieves an alert field Retrieves a specific alert field by id diff --git a/rootly_sdk/api/alert_fields/list_alert_fields.py b/rootly_sdk/api/alert_fields/list_alert_fields.py index ee6c0e82..68df61d3 100644 --- a/rootly_sdk/api/alert_fields/list_alert_fields.py +++ b/rootly_sdk/api/alert_fields/list_alert_fields.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -11,25 +11,25 @@ def _get_kwargs( *, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterkind: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, - filterkindeq: Union[Unset, str] = UNSET, - filterkindnot_eq: Union[Unset, str] = UNSET, - filterkindin: Union[Unset, str] = UNSET, - filterkindnot_in: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filterkindeq: Unset | str = UNSET, + filterkindnot_eq: Unset | str = UNSET, + filterkindin: Unset | str = UNSET, + filterkindnot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -82,9 +82,7 @@ def _get_kwargs( return _kwargs -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[AlertFieldList]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> AlertFieldList | None: if response.status_code == 200: response_200 = AlertFieldList.from_dict(response.json()) @@ -96,9 +94,7 @@ def _parse_response( return None -def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[AlertFieldList]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[AlertFieldList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -110,25 +106,25 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterkind: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, - filterkindeq: Union[Unset, str] = UNSET, - filterkindnot_eq: Union[Unset, str] = UNSET, - filterkindin: Union[Unset, str] = UNSET, - filterkindnot_in: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filterkindeq: Unset | str = UNSET, + filterkindnot_eq: Unset | str = UNSET, + filterkindin: Unset | str = UNSET, + filterkindnot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[AlertFieldList]: """List alert fields @@ -195,26 +191,26 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterkind: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, - filterkindeq: Union[Unset, str] = UNSET, - filterkindnot_eq: Union[Unset, str] = UNSET, - filterkindin: Union[Unset, str] = UNSET, - filterkindnot_in: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, -) -> Optional[AlertFieldList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filterkindeq: Unset | str = UNSET, + filterkindnot_eq: Unset | str = UNSET, + filterkindin: Unset | str = UNSET, + filterkindnot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, +) -> AlertFieldList | None: """List alert fields List alert fields @@ -275,25 +271,25 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterkind: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, - filterkindeq: Union[Unset, str] = UNSET, - filterkindnot_eq: Union[Unset, str] = UNSET, - filterkindin: Union[Unset, str] = UNSET, - filterkindnot_in: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filterkindeq: Unset | str = UNSET, + filterkindnot_eq: Unset | str = UNSET, + filterkindin: Unset | str = UNSET, + filterkindnot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[AlertFieldList]: """List alert fields @@ -358,26 +354,26 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterkind: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, - filterkindeq: Union[Unset, str] = UNSET, - filterkindnot_eq: Union[Unset, str] = UNSET, - filterkindin: Union[Unset, str] = UNSET, - filterkindnot_in: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, -) -> Optional[AlertFieldList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filterkindeq: Unset | str = UNSET, + filterkindnot_eq: Unset | str = UNSET, + filterkindin: Unset | str = UNSET, + filterkindnot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, +) -> AlertFieldList | None: """List alert fields List alert fields diff --git a/rootly_sdk/api/alert_fields/update_alert_field.py b/rootly_sdk/api/alert_fields/update_alert_field.py index 516f53fb..256920be 100644 --- a/rootly_sdk/api/alert_fields/update_alert_field.py +++ b/rootly_sdk/api/alert_fields/update_alert_field.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any from uuid import UUID import httpx @@ -13,7 +13,7 @@ def _get_kwargs( - id: Union[UUID, str], + id: UUID | str, *, body: UpdateAlertField, ) -> dict[str, Any]: @@ -33,8 +33,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[AlertFieldResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> AlertFieldResponse | ErrorsList | None: if response.status_code == 200: response_200 = AlertFieldResponse.from_dict(response.json()) @@ -52,8 +52,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[AlertFieldResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[AlertFieldResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -63,11 +63,11 @@ def _build_response( def sync_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdateAlertField, -) -> Response[Union[AlertFieldResponse, ErrorsList]]: +) -> Response[AlertFieldResponse | ErrorsList]: """Update an alert field Update a specific alert field by id @@ -97,11 +97,11 @@ def sync_detailed( def sync( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdateAlertField, -) -> Optional[Union[AlertFieldResponse, ErrorsList]]: +) -> AlertFieldResponse | ErrorsList | None: """Update an alert field Update a specific alert field by id @@ -126,11 +126,11 @@ def sync( async def asyncio_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdateAlertField, -) -> Response[Union[AlertFieldResponse, ErrorsList]]: +) -> Response[AlertFieldResponse | ErrorsList]: """Update an alert field Update a specific alert field by id @@ -158,11 +158,11 @@ async def asyncio_detailed( async def asyncio( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdateAlertField, -) -> Optional[Union[AlertFieldResponse, ErrorsList]]: +) -> AlertFieldResponse | ErrorsList | None: """Update an alert field Update a specific alert field by id diff --git a/rootly_sdk/api/alert_groups/create_alert_group.py b/rootly_sdk/api/alert_groups/create_alert_group.py index 87890912..0a1096b0 100644 --- a/rootly_sdk/api/alert_groups/create_alert_group.py +++ b/rootly_sdk/api/alert_groups/create_alert_group.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[AlertGroupResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> AlertGroupResponse | ErrorsList | None: if response.status_code == 201: response_201 = AlertGroupResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[AlertGroupResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[AlertGroupResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +69,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewAlertGroup, -) -> Response[Union[AlertGroupResponse, ErrorsList]]: +) -> Response[AlertGroupResponse | ErrorsList]: """Creates an alert group Creates a new alert group. **Note**: For enhanced functionality and future compatibility, consider @@ -102,7 +102,7 @@ def sync( *, client: AuthenticatedClient, body: NewAlertGroup, -) -> Optional[Union[AlertGroupResponse, ErrorsList]]: +) -> AlertGroupResponse | ErrorsList | None: """Creates an alert group Creates a new alert group. **Note**: For enhanced functionality and future compatibility, consider @@ -130,7 +130,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewAlertGroup, -) -> Response[Union[AlertGroupResponse, ErrorsList]]: +) -> Response[AlertGroupResponse | ErrorsList]: """Creates an alert group Creates a new alert group. **Note**: For enhanced functionality and future compatibility, consider @@ -161,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewAlertGroup, -) -> Optional[Union[AlertGroupResponse, ErrorsList]]: +) -> AlertGroupResponse | ErrorsList | None: """Creates an alert group Creates a new alert group. **Note**: For enhanced functionality and future compatibility, consider diff --git a/rootly_sdk/api/alert_groups/delete_alert_group.py b/rootly_sdk/api/alert_groups/delete_alert_group.py index e0beea6d..71a11c17 100644 --- a/rootly_sdk/api/alert_groups/delete_alert_group.py +++ b/rootly_sdk/api/alert_groups/delete_alert_group.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any from uuid import UUID import httpx @@ -12,7 +12,7 @@ def _get_kwargs( - id: Union[UUID, str], + id: UUID | str, ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "delete", @@ -23,8 +23,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[AlertGroupResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> AlertGroupResponse | ErrorsList | None: if response.status_code == 200: response_200 = AlertGroupResponse.from_dict(response.json()) @@ -42,8 +42,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[AlertGroupResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[AlertGroupResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -53,10 +53,10 @@ def _build_response( def sync_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Response[Union[AlertGroupResponse, ErrorsList]]: +) -> Response[AlertGroupResponse | ErrorsList]: """Delete an alert group Delete a specific alert group by id @@ -84,10 +84,10 @@ def sync_detailed( def sync( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Optional[Union[AlertGroupResponse, ErrorsList]]: +) -> AlertGroupResponse | ErrorsList | None: """Delete an alert group Delete a specific alert group by id @@ -110,10 +110,10 @@ def sync( async def asyncio_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Response[Union[AlertGroupResponse, ErrorsList]]: +) -> Response[AlertGroupResponse | ErrorsList]: """Delete an alert group Delete a specific alert group by id @@ -139,10 +139,10 @@ async def asyncio_detailed( async def asyncio( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Optional[Union[AlertGroupResponse, ErrorsList]]: +) -> AlertGroupResponse | ErrorsList | None: """Delete an alert group Delete a specific alert group by id diff --git a/rootly_sdk/api/alert_groups/get_alert_group.py b/rootly_sdk/api/alert_groups/get_alert_group.py index d446f287..01d08e47 100644 --- a/rootly_sdk/api/alert_groups/get_alert_group.py +++ b/rootly_sdk/api/alert_groups/get_alert_group.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any from uuid import UUID import httpx @@ -12,7 +12,7 @@ def _get_kwargs( - id: Union[UUID, str], + id: UUID | str, ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "get", @@ -23,8 +23,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[AlertGroupResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> AlertGroupResponse | ErrorsList | None: if response.status_code == 200: response_200 = AlertGroupResponse.from_dict(response.json()) @@ -42,8 +42,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[AlertGroupResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[AlertGroupResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -53,10 +53,10 @@ def _build_response( def sync_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Response[Union[AlertGroupResponse, ErrorsList]]: +) -> Response[AlertGroupResponse | ErrorsList]: """Retrieves an alert group Retrieves a specific alert group by id @@ -84,10 +84,10 @@ def sync_detailed( def sync( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Optional[Union[AlertGroupResponse, ErrorsList]]: +) -> AlertGroupResponse | ErrorsList | None: """Retrieves an alert group Retrieves a specific alert group by id @@ -110,10 +110,10 @@ def sync( async def asyncio_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Response[Union[AlertGroupResponse, ErrorsList]]: +) -> Response[AlertGroupResponse | ErrorsList]: """Retrieves an alert group Retrieves a specific alert group by id @@ -139,10 +139,10 @@ async def asyncio_detailed( async def asyncio( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Optional[Union[AlertGroupResponse, ErrorsList]]: +) -> AlertGroupResponse | ErrorsList | None: """Retrieves an alert group Retrieves a specific alert group by id diff --git a/rootly_sdk/api/alert_groups/list_alert_groups.py b/rootly_sdk/api/alert_groups/list_alert_groups.py index 9a19b2dc..c094e22c 100644 --- a/rootly_sdk/api/alert_groups/list_alert_groups.py +++ b/rootly_sdk/api/alert_groups/list_alert_groups.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -11,15 +11,15 @@ def _get_kwargs( *, - include: Union[Unset, str] = UNSET, - filterslugeq: Union[Unset, str] = UNSET, - filterslugnot_eq: Union[Unset, str] = UNSET, - filterslugin: Union[Unset, str] = UNSET, - filterslugnot_in: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -52,9 +52,7 @@ def _get_kwargs( return _kwargs -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[AlertGroupList]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> AlertGroupList | None: if response.status_code == 200: response_200 = AlertGroupList.from_dict(response.json()) @@ -66,9 +64,7 @@ def _parse_response( return None -def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[AlertGroupList]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[AlertGroupList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -80,15 +76,15 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - filterslugeq: Union[Unset, str] = UNSET, - filterslugnot_eq: Union[Unset, str] = UNSET, - filterslugin: Union[Unset, str] = UNSET, - filterslugnot_in: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, ) -> Response[AlertGroupList]: """List alert groups @@ -135,16 +131,16 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - filterslugeq: Union[Unset, str] = UNSET, - filterslugnot_eq: Union[Unset, str] = UNSET, - filterslugin: Union[Unset, str] = UNSET, - filterslugnot_in: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, -) -> Optional[AlertGroupList]: + include: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, +) -> AlertGroupList | None: """List alert groups List alert groups @@ -185,15 +181,15 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - filterslugeq: Union[Unset, str] = UNSET, - filterslugnot_eq: Union[Unset, str] = UNSET, - filterslugin: Union[Unset, str] = UNSET, - filterslugnot_in: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, ) -> Response[AlertGroupList]: """List alert groups @@ -238,16 +234,16 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - filterslugeq: Union[Unset, str] = UNSET, - filterslugnot_eq: Union[Unset, str] = UNSET, - filterslugin: Union[Unset, str] = UNSET, - filterslugnot_in: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, -) -> Optional[AlertGroupList]: + include: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, +) -> AlertGroupList | None: """List alert groups List alert groups diff --git a/rootly_sdk/api/alert_groups/update_alert_group.py b/rootly_sdk/api/alert_groups/update_alert_group.py index ebe97731..f61520b5 100644 --- a/rootly_sdk/api/alert_groups/update_alert_group.py +++ b/rootly_sdk/api/alert_groups/update_alert_group.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any from uuid import UUID import httpx @@ -13,7 +13,7 @@ def _get_kwargs( - id: Union[UUID, str], + id: UUID | str, *, body: UpdateAlertGroup, ) -> dict[str, Any]: @@ -33,8 +33,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[AlertGroupResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> AlertGroupResponse | ErrorsList | None: if response.status_code == 200: response_200 = AlertGroupResponse.from_dict(response.json()) @@ -52,8 +52,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[AlertGroupResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[AlertGroupResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -63,11 +63,11 @@ def _build_response( def sync_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdateAlertGroup, -) -> Response[Union[AlertGroupResponse, ErrorsList]]: +) -> Response[AlertGroupResponse | ErrorsList]: """Update an alert group Update a specific alert group by id. **Note**: For enhanced functionality and future compatibility, @@ -99,11 +99,11 @@ def sync_detailed( def sync( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdateAlertGroup, -) -> Optional[Union[AlertGroupResponse, ErrorsList]]: +) -> AlertGroupResponse | ErrorsList | None: """Update an alert group Update a specific alert group by id. **Note**: For enhanced functionality and future compatibility, @@ -130,11 +130,11 @@ def sync( async def asyncio_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdateAlertGroup, -) -> Response[Union[AlertGroupResponse, ErrorsList]]: +) -> Response[AlertGroupResponse | ErrorsList]: """Update an alert group Update a specific alert group by id. **Note**: For enhanced functionality and future compatibility, @@ -164,11 +164,11 @@ async def asyncio_detailed( async def asyncio( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdateAlertGroup, -) -> Optional[Union[AlertGroupResponse, ErrorsList]]: +) -> AlertGroupResponse | ErrorsList | None: """Update an alert group Update a specific alert group by id. **Note**: For enhanced functionality and future compatibility, diff --git a/rootly_sdk/api/alert_retrigger_rules/create_alert_retrigger_rule.py b/rootly_sdk/api/alert_retrigger_rules/create_alert_retrigger_rule.py index 7affe65a..46ebb90c 100644 --- a/rootly_sdk/api/alert_retrigger_rules/create_alert_retrigger_rule.py +++ b/rootly_sdk/api/alert_retrigger_rules/create_alert_retrigger_rule.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[AlertRetriggerRuleResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> AlertRetriggerRuleResponse | ErrorsList | None: if response.status_code == 201: response_201 = AlertRetriggerRuleResponse.from_dict(response.json()) @@ -50,8 +50,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[AlertRetriggerRuleResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[AlertRetriggerRuleResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -64,7 +64,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewAlertRetriggerRule, -) -> Response[Union[AlertRetriggerRuleResponse, ErrorsList]]: +) -> Response[AlertRetriggerRuleResponse | ErrorsList]: """Creates an alert re-trigger rule Args: @@ -93,7 +93,7 @@ def sync( *, client: AuthenticatedClient, body: NewAlertRetriggerRule, -) -> Optional[Union[AlertRetriggerRuleResponse, ErrorsList]]: +) -> AlertRetriggerRuleResponse | ErrorsList | None: """Creates an alert re-trigger rule Args: @@ -117,7 +117,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewAlertRetriggerRule, -) -> Response[Union[AlertRetriggerRuleResponse, ErrorsList]]: +) -> Response[AlertRetriggerRuleResponse | ErrorsList]: """Creates an alert re-trigger rule Args: @@ -144,7 +144,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewAlertRetriggerRule, -) -> Optional[Union[AlertRetriggerRuleResponse, ErrorsList]]: +) -> AlertRetriggerRuleResponse | ErrorsList | None: """Creates an alert re-trigger rule Args: diff --git a/rootly_sdk/api/alert_retrigger_rules/delete_alert_retrigger_rule.py b/rootly_sdk/api/alert_retrigger_rules/delete_alert_retrigger_rule.py index 45f2565e..e7846c20 100644 --- a/rootly_sdk/api/alert_retrigger_rules/delete_alert_retrigger_rule.py +++ b/rootly_sdk/api/alert_retrigger_rules/delete_alert_retrigger_rule.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -19,7 +19,7 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Any | None: if response.status_code == 200: return None @@ -29,7 +29,7 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Any]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, diff --git a/rootly_sdk/api/alert_retrigger_rules/get_alert_retrigger_rule.py b/rootly_sdk/api/alert_retrigger_rules/get_alert_retrigger_rule.py index 50968ed9..b5b0f5f7 100644 --- a/rootly_sdk/api/alert_retrigger_rules/get_alert_retrigger_rule.py +++ b/rootly_sdk/api/alert_retrigger_rules/get_alert_retrigger_rule.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -21,8 +21,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[AlertRetriggerRuleResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> AlertRetriggerRuleResponse | None: if response.status_code == 200: response_200 = AlertRetriggerRuleResponse.from_dict(response.json()) @@ -35,7 +35,7 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response + *, client: AuthenticatedClient | Client, response: httpx.Response ) -> Response[AlertRetriggerRuleResponse]: return Response( status_code=HTTPStatus(response.status_code), @@ -78,7 +78,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[AlertRetriggerRuleResponse]: +) -> AlertRetriggerRuleResponse | None: """Retrieves an alert re-trigger rule Args: @@ -129,7 +129,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[AlertRetriggerRuleResponse]: +) -> AlertRetriggerRuleResponse | None: """Retrieves an alert re-trigger rule Args: diff --git a/rootly_sdk/api/alert_retrigger_rules/list_alert_retrigger_rules.py b/rootly_sdk/api/alert_retrigger_rules/list_alert_retrigger_rules.py index 30ee5df5..8b9a6032 100644 --- a/rootly_sdk/api/alert_retrigger_rules/list_alert_retrigger_rules.py +++ b/rootly_sdk/api/alert_retrigger_rules/list_alert_retrigger_rules.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -18,9 +18,7 @@ def _get_kwargs() -> dict[str, Any]: return _kwargs -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[AlertRetriggerRuleList]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> AlertRetriggerRuleList | None: if response.status_code == 200: response_200 = AlertRetriggerRuleList.from_dict(response.json()) @@ -33,7 +31,7 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response + *, client: AuthenticatedClient | Client, response: httpx.Response ) -> Response[AlertRetriggerRuleList]: return Response( status_code=HTTPStatus(response.status_code), @@ -69,7 +67,7 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, -) -> Optional[AlertRetriggerRuleList]: +) -> AlertRetriggerRuleList | None: """List alert re-trigger rules Raises: @@ -109,7 +107,7 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, -) -> Optional[AlertRetriggerRuleList]: +) -> AlertRetriggerRuleList | None: """List alert re-trigger rules Raises: diff --git a/rootly_sdk/api/alert_retrigger_rules/update_alert_retrigger_rule.py b/rootly_sdk/api/alert_retrigger_rules/update_alert_retrigger_rule.py index c464f2a6..a2f98da6 100644 --- a/rootly_sdk/api/alert_retrigger_rules/update_alert_retrigger_rule.py +++ b/rootly_sdk/api/alert_retrigger_rules/update_alert_retrigger_rule.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[AlertRetriggerRuleResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> AlertRetriggerRuleResponse | None: if response.status_code == 200: response_200 = AlertRetriggerRuleResponse.from_dict(response.json()) @@ -45,7 +45,7 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response + *, client: AuthenticatedClient | Client, response: httpx.Response ) -> Response[AlertRetriggerRuleResponse]: return Response( status_code=HTTPStatus(response.status_code), @@ -92,7 +92,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateAlertRetriggerRule, -) -> Optional[AlertRetriggerRuleResponse]: +) -> AlertRetriggerRuleResponse | None: """Updates an alert re-trigger rule Args: @@ -149,7 +149,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateAlertRetriggerRule, -) -> Optional[AlertRetriggerRuleResponse]: +) -> AlertRetriggerRuleResponse | None: """Updates an alert re-trigger rule Args: diff --git a/rootly_sdk/api/alert_routes/create_alert_route.py b/rootly_sdk/api/alert_routes/create_alert_route.py index a2f05a42..71352eb9 100644 --- a/rootly_sdk/api/alert_routes/create_alert_route.py +++ b/rootly_sdk/api/alert_routes/create_alert_route.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[AlertRouteResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> AlertRouteResponse | ErrorsList | None: if response.status_code == 201: response_201 = AlertRouteResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[AlertRouteResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[AlertRouteResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +69,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewAlertRoute, -) -> Response[Union[AlertRouteResponse, ErrorsList]]: +) -> Response[AlertRouteResponse | ErrorsList]: """Creates an alert route Creates a new alert route from provided data. **Note: This endpoint requires access to Advanced @@ -114,7 +114,7 @@ def sync( *, client: AuthenticatedClient, body: NewAlertRoute, -) -> Optional[Union[AlertRouteResponse, ErrorsList]]: +) -> AlertRouteResponse | ErrorsList | None: """Creates an alert route Creates a new alert route from provided data. **Note: This endpoint requires access to Advanced @@ -154,7 +154,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewAlertRoute, -) -> Response[Union[AlertRouteResponse, ErrorsList]]: +) -> Response[AlertRouteResponse | ErrorsList]: """Creates an alert route Creates a new alert route from provided data. **Note: This endpoint requires access to Advanced @@ -197,7 +197,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewAlertRoute, -) -> Optional[Union[AlertRouteResponse, ErrorsList]]: +) -> AlertRouteResponse | ErrorsList | None: """Creates an alert route Creates a new alert route from provided data. **Note: This endpoint requires access to Advanced diff --git a/rootly_sdk/api/alert_routes/delete_alert_route.py b/rootly_sdk/api/alert_routes/delete_alert_route.py index 17ff6ee4..58ef7c73 100644 --- a/rootly_sdk/api/alert_routes/delete_alert_route.py +++ b/rootly_sdk/api/alert_routes/delete_alert_route.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[DeleteAlertRouteResponse200, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> DeleteAlertRouteResponse200 | ErrorsList | None: if response.status_code == 200: response_200 = DeleteAlertRouteResponse200.from_dict(response.json()) @@ -51,8 +51,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[DeleteAlertRouteResponse200, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[DeleteAlertRouteResponse200 | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -65,7 +65,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[DeleteAlertRouteResponse200, ErrorsList]]: +) -> Response[DeleteAlertRouteResponse200 | ErrorsList]: """Delete an alert route Delete a specific alert route by id. **Note: This endpoint requires access to Advanced Alert @@ -98,7 +98,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[DeleteAlertRouteResponse200, ErrorsList]]: +) -> DeleteAlertRouteResponse200 | ErrorsList | None: """Delete an alert route Delete a specific alert route by id. **Note: This endpoint requires access to Advanced Alert @@ -126,7 +126,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[DeleteAlertRouteResponse200, ErrorsList]]: +) -> Response[DeleteAlertRouteResponse200 | ErrorsList]: """Delete an alert route Delete a specific alert route by id. **Note: This endpoint requires access to Advanced Alert @@ -157,7 +157,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[DeleteAlertRouteResponse200, ErrorsList]]: +) -> DeleteAlertRouteResponse200 | ErrorsList | None: """Delete an alert route Delete a specific alert route by id. **Note: This endpoint requires access to Advanced Alert diff --git a/rootly_sdk/api/alert_routes/get_alert_route.py b/rootly_sdk/api/alert_routes/get_alert_route.py index 0384cd75..0cc6a688 100644 --- a/rootly_sdk/api/alert_routes/get_alert_route.py +++ b/rootly_sdk/api/alert_routes/get_alert_route.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[AlertRouteResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> AlertRouteResponse | ErrorsList | None: if response.status_code == 200: response_200 = AlertRouteResponse.from_dict(response.json()) @@ -46,8 +46,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[AlertRouteResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[AlertRouteResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -60,7 +60,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[AlertRouteResponse, ErrorsList]]: +) -> Response[AlertRouteResponse | ErrorsList]: """Get an alert route Get a specific alert route by id. **Note: This endpoint requires access to Advanced Alert Routing. @@ -100,7 +100,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[AlertRouteResponse, ErrorsList]]: +) -> AlertRouteResponse | ErrorsList | None: """Get an alert route Get a specific alert route by id. **Note: This endpoint requires access to Advanced Alert Routing. @@ -135,7 +135,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[AlertRouteResponse, ErrorsList]]: +) -> Response[AlertRouteResponse | ErrorsList]: """Get an alert route Get a specific alert route by id. **Note: This endpoint requires access to Advanced Alert Routing. @@ -173,7 +173,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[AlertRouteResponse, ErrorsList]]: +) -> AlertRouteResponse | ErrorsList | None: """Get an alert route Get a specific alert route by id. **Note: This endpoint requires access to Advanced Alert Routing. diff --git a/rootly_sdk/api/alert_routes/list_alert_routes.py b/rootly_sdk/api/alert_routes/list_alert_routes.py index e65f78e3..e248dc32 100644 --- a/rootly_sdk/api/alert_routes/list_alert_routes.py +++ b/rootly_sdk/api/alert_routes/list_alert_routes.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -12,19 +12,19 @@ def _get_kwargs( *, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterslugeq: Union[Unset, str] = UNSET, - filterslugnot_eq: Union[Unset, str] = UNSET, - filterslugin: Union[Unset, str] = UNSET, - filterslugnot_in: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -66,8 +66,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[AlertRouteList, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> AlertRouteList | ErrorsList | None: if response.status_code == 200: response_200 = AlertRouteList.from_dict(response.json()) @@ -85,8 +85,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[AlertRouteList, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[AlertRouteList | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -98,20 +98,20 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterslugeq: Union[Unset, str] = UNSET, - filterslugnot_eq: Union[Unset, str] = UNSET, - filterslugin: Union[Unset, str] = UNSET, - filterslugnot_in: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, -) -> Response[Union[AlertRouteList, ErrorsList]]: + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, +) -> Response[AlertRouteList | ErrorsList]: """List alert routes List all alert routes for the current team with filtering and pagination. **Note: This endpoint @@ -167,20 +167,20 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterslugeq: Union[Unset, str] = UNSET, - filterslugnot_eq: Union[Unset, str] = UNSET, - filterslugin: Union[Unset, str] = UNSET, - filterslugnot_in: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, -) -> Optional[Union[AlertRouteList, ErrorsList]]: + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, +) -> AlertRouteList | ErrorsList | None: """List alert routes List all alert routes for the current team with filtering and pagination. **Note: This endpoint @@ -231,20 +231,20 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterslugeq: Union[Unset, str] = UNSET, - filterslugnot_eq: Union[Unset, str] = UNSET, - filterslugin: Union[Unset, str] = UNSET, - filterslugnot_in: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, -) -> Response[Union[AlertRouteList, ErrorsList]]: + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, +) -> Response[AlertRouteList | ErrorsList]: """List alert routes List all alert routes for the current team with filtering and pagination. **Note: This endpoint @@ -298,20 +298,20 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterslugeq: Union[Unset, str] = UNSET, - filterslugnot_eq: Union[Unset, str] = UNSET, - filterslugin: Union[Unset, str] = UNSET, - filterslugnot_in: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, -) -> Optional[Union[AlertRouteList, ErrorsList]]: + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, +) -> AlertRouteList | ErrorsList | None: """List alert routes List all alert routes for the current team with filtering and pagination. **Note: This endpoint diff --git a/rootly_sdk/api/alert_routes/patch_alert_route.py b/rootly_sdk/api/alert_routes/patch_alert_route.py index 31f0fd42..019b4703 100644 --- a/rootly_sdk/api/alert_routes/patch_alert_route.py +++ b/rootly_sdk/api/alert_routes/patch_alert_route.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[AlertRouteResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> AlertRouteResponse | ErrorsList | None: if response.status_code == 200: response_200 = AlertRouteResponse.from_dict(response.json()) @@ -61,8 +61,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[AlertRouteResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[AlertRouteResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -76,7 +76,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: PatchAlertRoute, -) -> Response[Union[AlertRouteResponse, ErrorsList]]: +) -> Response[AlertRouteResponse | ErrorsList]: """Update an alert route Updates an alert route. **Note: This endpoint requires access to Advanced Alert Routing. If you're @@ -111,7 +111,7 @@ def sync( *, client: AuthenticatedClient, body: PatchAlertRoute, -) -> Optional[Union[AlertRouteResponse, ErrorsList]]: +) -> AlertRouteResponse | ErrorsList | None: """Update an alert route Updates an alert route. **Note: This endpoint requires access to Advanced Alert Routing. If you're @@ -141,7 +141,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: PatchAlertRoute, -) -> Response[Union[AlertRouteResponse, ErrorsList]]: +) -> Response[AlertRouteResponse | ErrorsList]: """Update an alert route Updates an alert route. **Note: This endpoint requires access to Advanced Alert Routing. If you're @@ -174,7 +174,7 @@ async def asyncio( *, client: AuthenticatedClient, body: PatchAlertRoute, -) -> Optional[Union[AlertRouteResponse, ErrorsList]]: +) -> AlertRouteResponse | ErrorsList | None: """Update an alert route Updates an alert route. **Note: This endpoint requires access to Advanced Alert Routing. If you're diff --git a/rootly_sdk/api/alert_routes/update_alert_route.py b/rootly_sdk/api/alert_routes/update_alert_route.py index d7045642..61f7adaa 100644 --- a/rootly_sdk/api/alert_routes/update_alert_route.py +++ b/rootly_sdk/api/alert_routes/update_alert_route.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[AlertRouteResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> AlertRouteResponse | ErrorsList | None: if response.status_code == 200: response_200 = AlertRouteResponse.from_dict(response.json()) @@ -56,8 +56,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[AlertRouteResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[AlertRouteResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -71,7 +71,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateAlertRoute, -) -> Response[Union[AlertRouteResponse, ErrorsList]]: +) -> Response[AlertRouteResponse | ErrorsList]: """Update an alert route Update a specific alert route by id. **Note: This endpoint requires access to Advanced Alert @@ -119,7 +119,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateAlertRoute, -) -> Optional[Union[AlertRouteResponse, ErrorsList]]: +) -> AlertRouteResponse | ErrorsList | None: """Update an alert route Update a specific alert route by id. **Note: This endpoint requires access to Advanced Alert @@ -162,7 +162,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateAlertRoute, -) -> Response[Union[AlertRouteResponse, ErrorsList]]: +) -> Response[AlertRouteResponse | ErrorsList]: """Update an alert route Update a specific alert route by id. **Note: This endpoint requires access to Advanced Alert @@ -208,7 +208,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateAlertRoute, -) -> Optional[Union[AlertRouteResponse, ErrorsList]]: +) -> AlertRouteResponse | ErrorsList | None: """Update an alert route Update a specific alert route by id. **Note: This endpoint requires access to Advanced Alert diff --git a/rootly_sdk/api/alert_routing_rules/create_alert_routing_rule.py b/rootly_sdk/api/alert_routing_rules/create_alert_routing_rule.py index 3b79e264..1d62f2ab 100644 --- a/rootly_sdk/api/alert_routing_rules/create_alert_routing_rule.py +++ b/rootly_sdk/api/alert_routing_rules/create_alert_routing_rule.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[AlertRoutingRuleResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> AlertRoutingRuleResponse | ErrorsList | None: if response.status_code == 201: response_201 = AlertRoutingRuleResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[AlertRoutingRuleResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[AlertRoutingRuleResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +69,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewAlertRoutingRule, -) -> Response[Union[AlertRoutingRuleResponse, ErrorsList]]: +) -> Response[AlertRoutingRuleResponse | ErrorsList]: """Creates an alert routing rule Creates a new alert routing rule from provided data. **Note: If you are an advanced alert routing @@ -102,7 +102,7 @@ def sync( *, client: AuthenticatedClient, body: NewAlertRoutingRule, -) -> Optional[Union[AlertRoutingRuleResponse, ErrorsList]]: +) -> AlertRoutingRuleResponse | ErrorsList | None: """Creates an alert routing rule Creates a new alert routing rule from provided data. **Note: If you are an advanced alert routing @@ -130,7 +130,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewAlertRoutingRule, -) -> Response[Union[AlertRoutingRuleResponse, ErrorsList]]: +) -> Response[AlertRoutingRuleResponse | ErrorsList]: """Creates an alert routing rule Creates a new alert routing rule from provided data. **Note: If you are an advanced alert routing @@ -161,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewAlertRoutingRule, -) -> Optional[Union[AlertRoutingRuleResponse, ErrorsList]]: +) -> AlertRoutingRuleResponse | ErrorsList | None: """Creates an alert routing rule Creates a new alert routing rule from provided data. **Note: If you are an advanced alert routing diff --git a/rootly_sdk/api/alert_routing_rules/delete_alert_routing_rule.py b/rootly_sdk/api/alert_routing_rules/delete_alert_routing_rule.py index f9ea676c..fbb953a2 100644 --- a/rootly_sdk/api/alert_routing_rules/delete_alert_routing_rule.py +++ b/rootly_sdk/api/alert_routing_rules/delete_alert_routing_rule.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any from uuid import UUID import httpx @@ -12,7 +12,7 @@ def _get_kwargs( - id: Union[UUID, str], + id: UUID | str, ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "delete", @@ -23,8 +23,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[AlertRoutingRuleResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> AlertRoutingRuleResponse | ErrorsList | None: if response.status_code == 200: response_200 = AlertRoutingRuleResponse.from_dict(response.json()) @@ -42,8 +42,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[AlertRoutingRuleResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[AlertRoutingRuleResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -53,10 +53,10 @@ def _build_response( def sync_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Response[Union[AlertRoutingRuleResponse, ErrorsList]]: +) -> Response[AlertRoutingRuleResponse | ErrorsList]: """Delete an alert routing rule Delete a specific alert routing rule by id. **Note: If you are an advanced alert routing user, you @@ -86,10 +86,10 @@ def sync_detailed( def sync( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Optional[Union[AlertRoutingRuleResponse, ErrorsList]]: +) -> AlertRoutingRuleResponse | ErrorsList | None: """Delete an alert routing rule Delete a specific alert routing rule by id. **Note: If you are an advanced alert routing user, you @@ -114,10 +114,10 @@ def sync( async def asyncio_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Response[Union[AlertRoutingRuleResponse, ErrorsList]]: +) -> Response[AlertRoutingRuleResponse | ErrorsList]: """Delete an alert routing rule Delete a specific alert routing rule by id. **Note: If you are an advanced alert routing user, you @@ -145,10 +145,10 @@ async def asyncio_detailed( async def asyncio( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Optional[Union[AlertRoutingRuleResponse, ErrorsList]]: +) -> AlertRoutingRuleResponse | ErrorsList | None: """Delete an alert routing rule Delete a specific alert routing rule by id. **Note: If you are an advanced alert routing user, you diff --git a/rootly_sdk/api/alert_routing_rules/get_alert_routing_rule.py b/rootly_sdk/api/alert_routing_rules/get_alert_routing_rule.py index c2ea686c..bf683612 100644 --- a/rootly_sdk/api/alert_routing_rules/get_alert_routing_rule.py +++ b/rootly_sdk/api/alert_routing_rules/get_alert_routing_rule.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any from uuid import UUID import httpx @@ -12,7 +12,7 @@ def _get_kwargs( - id: Union[UUID, str], + id: UUID | str, ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "get", @@ -23,8 +23,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[AlertRoutingRuleResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> AlertRoutingRuleResponse | ErrorsList | None: if response.status_code == 200: response_200 = AlertRoutingRuleResponse.from_dict(response.json()) @@ -42,8 +42,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[AlertRoutingRuleResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[AlertRoutingRuleResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -53,10 +53,10 @@ def _build_response( def sync_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Response[Union[AlertRoutingRuleResponse, ErrorsList]]: +) -> Response[AlertRoutingRuleResponse | ErrorsList]: """Retrieves an alert routing rule Retrieves a specific alert routing rule by id. **Note: If you are an advanced alert routing user, @@ -86,10 +86,10 @@ def sync_detailed( def sync( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Optional[Union[AlertRoutingRuleResponse, ErrorsList]]: +) -> AlertRoutingRuleResponse | ErrorsList | None: """Retrieves an alert routing rule Retrieves a specific alert routing rule by id. **Note: If you are an advanced alert routing user, @@ -114,10 +114,10 @@ def sync( async def asyncio_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Response[Union[AlertRoutingRuleResponse, ErrorsList]]: +) -> Response[AlertRoutingRuleResponse | ErrorsList]: """Retrieves an alert routing rule Retrieves a specific alert routing rule by id. **Note: If you are an advanced alert routing user, @@ -145,10 +145,10 @@ async def asyncio_detailed( async def asyncio( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Optional[Union[AlertRoutingRuleResponse, ErrorsList]]: +) -> AlertRoutingRuleResponse | ErrorsList | None: """Retrieves an alert routing rule Retrieves a specific alert routing rule by id. **Note: If you are an advanced alert routing user, diff --git a/rootly_sdk/api/alert_routing_rules/list_alert_routing_rules.py b/rootly_sdk/api/alert_routing_rules/list_alert_routing_rules.py index f96a0a60..80ae8d97 100644 --- a/rootly_sdk/api/alert_routing_rules/list_alert_routing_rules.py +++ b/rootly_sdk/api/alert_routing_rules/list_alert_routing_rules.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -11,24 +11,24 @@ def _get_kwargs( *, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filterslugeq: Union[Unset, str] = UNSET, - filterslugnot_eq: Union[Unset, str] = UNSET, - filterslugin: Union[Unset, str] = UNSET, - filterslugnot_in: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -79,9 +79,7 @@ def _get_kwargs( return _kwargs -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[AlertRoutingRuleList]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> AlertRoutingRuleList | None: if response.status_code == 200: response_200 = AlertRoutingRuleList.from_dict(response.json()) @@ -94,7 +92,7 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response + *, client: AuthenticatedClient | Client, response: httpx.Response ) -> Response[AlertRoutingRuleList]: return Response( status_code=HTTPStatus(response.status_code), @@ -107,24 +105,24 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filterslugeq: Union[Unset, str] = UNSET, - filterslugnot_eq: Union[Unset, str] = UNSET, - filterslugin: Union[Unset, str] = UNSET, - filterslugnot_in: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[AlertRoutingRuleList]: """List alert routing rules @@ -191,25 +189,25 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filterslugeq: Union[Unset, str] = UNSET, - filterslugnot_eq: Union[Unset, str] = UNSET, - filterslugin: Union[Unset, str] = UNSET, - filterslugnot_in: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, -) -> Optional[AlertRoutingRuleList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, +) -> AlertRoutingRuleList | None: """List alert routing rules List alert routing rules. **Note: If you are an advanced alert routing user, you should use the @@ -270,24 +268,24 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filterslugeq: Union[Unset, str] = UNSET, - filterslugnot_eq: Union[Unset, str] = UNSET, - filterslugin: Union[Unset, str] = UNSET, - filterslugnot_in: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[AlertRoutingRuleList]: """List alert routing rules @@ -352,25 +350,25 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filterslugeq: Union[Unset, str] = UNSET, - filterslugnot_eq: Union[Unset, str] = UNSET, - filterslugin: Union[Unset, str] = UNSET, - filterslugnot_in: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, -) -> Optional[AlertRoutingRuleList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, +) -> AlertRoutingRuleList | None: """List alert routing rules List alert routing rules. **Note: If you are an advanced alert routing user, you should use the diff --git a/rootly_sdk/api/alert_routing_rules/update_alert_routing_rule.py b/rootly_sdk/api/alert_routing_rules/update_alert_routing_rule.py index 69931d36..2963b725 100644 --- a/rootly_sdk/api/alert_routing_rules/update_alert_routing_rule.py +++ b/rootly_sdk/api/alert_routing_rules/update_alert_routing_rule.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any from uuid import UUID import httpx @@ -13,7 +13,7 @@ def _get_kwargs( - id: Union[UUID, str], + id: UUID | str, *, body: UpdateAlertRoutingRule, ) -> dict[str, Any]: @@ -33,8 +33,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[AlertRoutingRuleResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> AlertRoutingRuleResponse | ErrorsList | None: if response.status_code == 200: response_200 = AlertRoutingRuleResponse.from_dict(response.json()) @@ -52,8 +52,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[AlertRoutingRuleResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[AlertRoutingRuleResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -63,11 +63,11 @@ def _build_response( def sync_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdateAlertRoutingRule, -) -> Response[Union[AlertRoutingRuleResponse, ErrorsList]]: +) -> Response[AlertRoutingRuleResponse | ErrorsList]: """Update an alert routing rule Update a specific alert routing rule by id. **Note: If you are an advanced alert routing user, you @@ -99,11 +99,11 @@ def sync_detailed( def sync( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdateAlertRoutingRule, -) -> Optional[Union[AlertRoutingRuleResponse, ErrorsList]]: +) -> AlertRoutingRuleResponse | ErrorsList | None: """Update an alert routing rule Update a specific alert routing rule by id. **Note: If you are an advanced alert routing user, you @@ -130,11 +130,11 @@ def sync( async def asyncio_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdateAlertRoutingRule, -) -> Response[Union[AlertRoutingRuleResponse, ErrorsList]]: +) -> Response[AlertRoutingRuleResponse | ErrorsList]: """Update an alert routing rule Update a specific alert routing rule by id. **Note: If you are an advanced alert routing user, you @@ -164,11 +164,11 @@ async def asyncio_detailed( async def asyncio( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdateAlertRoutingRule, -) -> Optional[Union[AlertRoutingRuleResponse, ErrorsList]]: +) -> AlertRoutingRuleResponse | ErrorsList | None: """Update an alert routing rule Update a specific alert routing rule by id. **Note: If you are an advanced alert routing user, you diff --git a/rootly_sdk/api/alert_sources/create_alerts_source.py b/rootly_sdk/api/alert_sources/create_alerts_source.py index 5eb02737..2799fd4c 100644 --- a/rootly_sdk/api/alert_sources/create_alerts_source.py +++ b/rootly_sdk/api/alert_sources/create_alerts_source.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[AlertsSourceResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> AlertsSourceResponse | ErrorsList | None: if response.status_code == 201: response_201 = AlertsSourceResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[AlertsSourceResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[AlertsSourceResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +69,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewAlertsSource, -) -> Response[Union[AlertsSourceResponse, ErrorsList]]: +) -> Response[AlertsSourceResponse | ErrorsList]: """Creates an alert source Creates a new alert source from provided data @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: NewAlertsSource, -) -> Optional[Union[AlertsSourceResponse, ErrorsList]]: +) -> AlertsSourceResponse | ErrorsList | None: """Creates an alert source Creates a new alert source from provided data @@ -126,7 +126,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewAlertsSource, -) -> Response[Union[AlertsSourceResponse, ErrorsList]]: +) -> Response[AlertsSourceResponse | ErrorsList]: """Creates an alert source Creates a new alert source from provided data @@ -155,7 +155,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewAlertsSource, -) -> Optional[Union[AlertsSourceResponse, ErrorsList]]: +) -> AlertsSourceResponse | ErrorsList | None: """Creates an alert source Creates a new alert source from provided data diff --git a/rootly_sdk/api/alert_sources/delete_alerts_source.py b/rootly_sdk/api/alert_sources/delete_alerts_source.py index f6f0dc74..92d06bad 100644 --- a/rootly_sdk/api/alert_sources/delete_alerts_source.py +++ b/rootly_sdk/api/alert_sources/delete_alerts_source.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[AlertsSourceResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> AlertsSourceResponse | ErrorsList | None: if response.status_code == 200: response_200 = AlertsSourceResponse.from_dict(response.json()) @@ -41,8 +41,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[AlertsSourceResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[AlertsSourceResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -55,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[AlertsSourceResponse, ErrorsList]]: +) -> Response[AlertsSourceResponse | ErrorsList]: """Delete an alert source Delete a specific alert source by id @@ -86,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[AlertsSourceResponse, ErrorsList]]: +) -> AlertsSourceResponse | ErrorsList | None: """Delete an alert source Delete a specific alert source by id @@ -112,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[AlertsSourceResponse, ErrorsList]]: +) -> Response[AlertsSourceResponse | ErrorsList]: """Delete an alert source Delete a specific alert source by id @@ -141,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[AlertsSourceResponse, ErrorsList]]: +) -> AlertsSourceResponse | ErrorsList | None: """Delete an alert source Delete a specific alert source by id diff --git a/rootly_sdk/api/alert_sources/get_alerts_source.py b/rootly_sdk/api/alert_sources/get_alerts_source.py index 1affea50..dcca8a3e 100644 --- a/rootly_sdk/api/alert_sources/get_alerts_source.py +++ b/rootly_sdk/api/alert_sources/get_alerts_source.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[AlertsSourceResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> AlertsSourceResponse | ErrorsList | None: if response.status_code == 200: response_200 = AlertsSourceResponse.from_dict(response.json()) @@ -41,8 +41,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[AlertsSourceResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[AlertsSourceResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -55,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[AlertsSourceResponse, ErrorsList]]: +) -> Response[AlertsSourceResponse | ErrorsList]: """Retrieves an alert source Retrieves a specific alert source by id @@ -86,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[AlertsSourceResponse, ErrorsList]]: +) -> AlertsSourceResponse | ErrorsList | None: """Retrieves an alert source Retrieves a specific alert source by id @@ -112,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[AlertsSourceResponse, ErrorsList]]: +) -> Response[AlertsSourceResponse | ErrorsList]: """Retrieves an alert source Retrieves a specific alert source by id @@ -141,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[AlertsSourceResponse, ErrorsList]]: +) -> AlertsSourceResponse | ErrorsList | None: """Retrieves an alert source Retrieves a specific alert source by id diff --git a/rootly_sdk/api/alert_sources/list_alerts_sources.py b/rootly_sdk/api/alert_sources/list_alerts_sources.py index 1fd86d39..be6ae53e 100644 --- a/rootly_sdk/api/alert_sources/list_alerts_sources.py +++ b/rootly_sdk/api/alert_sources/list_alerts_sources.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -11,15 +11,15 @@ def _get_kwargs( *, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filterstatuses: Union[Unset, str] = UNSET, - filtersource_types: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterenabled: Union[Unset, bool] = UNSET, - sort: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterstatuses: Unset | str = UNSET, + filtersource_types: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterenabled: Unset | bool = UNSET, + sort: Unset | str = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -52,9 +52,7 @@ def _get_kwargs( return _kwargs -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[AlertsSourceList]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> AlertsSourceList | None: if response.status_code == 200: response_200 = AlertsSourceList.from_dict(response.json()) @@ -66,9 +64,7 @@ def _parse_response( return None -def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[AlertsSourceList]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[AlertsSourceList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -80,15 +76,15 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filterstatuses: Union[Unset, str] = UNSET, - filtersource_types: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterenabled: Union[Unset, bool] = UNSET, - sort: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterstatuses: Unset | str = UNSET, + filtersource_types: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterenabled: Unset | bool = UNSET, + sort: Unset | str = UNSET, ) -> Response[AlertsSourceList]: """List alert sources @@ -135,16 +131,16 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filterstatuses: Union[Unset, str] = UNSET, - filtersource_types: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterenabled: Union[Unset, bool] = UNSET, - sort: Union[Unset, str] = UNSET, -) -> Optional[AlertsSourceList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterstatuses: Unset | str = UNSET, + filtersource_types: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterenabled: Unset | bool = UNSET, + sort: Unset | str = UNSET, +) -> AlertsSourceList | None: """List alert sources List alert sources @@ -185,15 +181,15 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filterstatuses: Union[Unset, str] = UNSET, - filtersource_types: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterenabled: Union[Unset, bool] = UNSET, - sort: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterstatuses: Unset | str = UNSET, + filtersource_types: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterenabled: Unset | bool = UNSET, + sort: Unset | str = UNSET, ) -> Response[AlertsSourceList]: """List alert sources @@ -238,16 +234,16 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filterstatuses: Union[Unset, str] = UNSET, - filtersource_types: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterenabled: Union[Unset, bool] = UNSET, - sort: Union[Unset, str] = UNSET, -) -> Optional[AlertsSourceList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterstatuses: Unset | str = UNSET, + filtersource_types: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterenabled: Unset | bool = UNSET, + sort: Unset | str = UNSET, +) -> AlertsSourceList | None: """List alert sources List alert sources diff --git a/rootly_sdk/api/alert_sources/update_alerts_source.py b/rootly_sdk/api/alert_sources/update_alerts_source.py index 32406f2d..0a73d9e4 100644 --- a/rootly_sdk/api/alert_sources/update_alerts_source.py +++ b/rootly_sdk/api/alert_sources/update_alerts_source.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[AlertsSourceResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> AlertsSourceResponse | ErrorsList | None: if response.status_code == 200: response_200 = AlertsSourceResponse.from_dict(response.json()) @@ -51,8 +51,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[AlertsSourceResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[AlertsSourceResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateAlertsSource, -) -> Response[Union[AlertsSourceResponse, ErrorsList]]: +) -> Response[AlertsSourceResponse | ErrorsList]: """Update an alert source Update a specific alert source by id @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateAlertsSource, -) -> Optional[Union[AlertsSourceResponse, ErrorsList]]: +) -> AlertsSourceResponse | ErrorsList | None: """Update an alert source Update a specific alert source by id @@ -129,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateAlertsSource, -) -> Response[Union[AlertsSourceResponse, ErrorsList]]: +) -> Response[AlertsSourceResponse | ErrorsList]: """Update an alert source Update a specific alert source by id @@ -161,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateAlertsSource, -) -> Optional[Union[AlertsSourceResponse, ErrorsList]]: +) -> AlertsSourceResponse | ErrorsList | None: """Update an alert source Update a specific alert source by id diff --git a/rootly_sdk/api/alert_urgencies/create_alert_urgency.py b/rootly_sdk/api/alert_urgencies/create_alert_urgency.py index 2d1e5e01..875f1fa0 100644 --- a/rootly_sdk/api/alert_urgencies/create_alert_urgency.py +++ b/rootly_sdk/api/alert_urgencies/create_alert_urgency.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[AlertUrgencyResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> AlertUrgencyResponse | ErrorsList | None: if response.status_code == 201: response_201 = AlertUrgencyResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[AlertUrgencyResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[AlertUrgencyResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +69,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewAlertUrgency, -) -> Response[Union[AlertUrgencyResponse, ErrorsList]]: +) -> Response[AlertUrgencyResponse | ErrorsList]: """Creates an alert urgency Creates a new alert urgency from provided data @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: NewAlertUrgency, -) -> Optional[Union[AlertUrgencyResponse, ErrorsList]]: +) -> AlertUrgencyResponse | ErrorsList | None: """Creates an alert urgency Creates a new alert urgency from provided data @@ -126,7 +126,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewAlertUrgency, -) -> Response[Union[AlertUrgencyResponse, ErrorsList]]: +) -> Response[AlertUrgencyResponse | ErrorsList]: """Creates an alert urgency Creates a new alert urgency from provided data @@ -155,7 +155,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewAlertUrgency, -) -> Optional[Union[AlertUrgencyResponse, ErrorsList]]: +) -> AlertUrgencyResponse | ErrorsList | None: """Creates an alert urgency Creates a new alert urgency from provided data diff --git a/rootly_sdk/api/alert_urgencies/delete_alert_urgency.py b/rootly_sdk/api/alert_urgencies/delete_alert_urgency.py index 1d92430d..e9f92b31 100644 --- a/rootly_sdk/api/alert_urgencies/delete_alert_urgency.py +++ b/rootly_sdk/api/alert_urgencies/delete_alert_urgency.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[AlertUrgencyResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> AlertUrgencyResponse | ErrorsList | None: if response.status_code == 200: response_200 = AlertUrgencyResponse.from_dict(response.json()) @@ -41,8 +41,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[AlertUrgencyResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[AlertUrgencyResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -55,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[AlertUrgencyResponse, ErrorsList]]: +) -> Response[AlertUrgencyResponse | ErrorsList]: """Delete an alert urgency Delete a specific alert urgency by id @@ -86,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[AlertUrgencyResponse, ErrorsList]]: +) -> AlertUrgencyResponse | ErrorsList | None: """Delete an alert urgency Delete a specific alert urgency by id @@ -112,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[AlertUrgencyResponse, ErrorsList]]: +) -> Response[AlertUrgencyResponse | ErrorsList]: """Delete an alert urgency Delete a specific alert urgency by id @@ -141,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[AlertUrgencyResponse, ErrorsList]]: +) -> AlertUrgencyResponse | ErrorsList | None: """Delete an alert urgency Delete a specific alert urgency by id diff --git a/rootly_sdk/api/alert_urgencies/get_alert_urgency.py b/rootly_sdk/api/alert_urgencies/get_alert_urgency.py index ecf14a8e..a1b9d84b 100644 --- a/rootly_sdk/api/alert_urgencies/get_alert_urgency.py +++ b/rootly_sdk/api/alert_urgencies/get_alert_urgency.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[AlertUrgencyResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> AlertUrgencyResponse | ErrorsList | None: if response.status_code == 200: response_200 = AlertUrgencyResponse.from_dict(response.json()) @@ -41,8 +41,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[AlertUrgencyResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[AlertUrgencyResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -55,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[AlertUrgencyResponse, ErrorsList]]: +) -> Response[AlertUrgencyResponse | ErrorsList]: """Retrieves an alert urgency Retrieves a specific alert urgency by id @@ -86,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[AlertUrgencyResponse, ErrorsList]]: +) -> AlertUrgencyResponse | ErrorsList | None: """Retrieves an alert urgency Retrieves a specific alert urgency by id @@ -112,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[AlertUrgencyResponse, ErrorsList]]: +) -> Response[AlertUrgencyResponse | ErrorsList]: """Retrieves an alert urgency Retrieves a specific alert urgency by id @@ -141,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[AlertUrgencyResponse, ErrorsList]]: +) -> AlertUrgencyResponse | ErrorsList | None: """Retrieves an alert urgency Retrieves a specific alert urgency by id diff --git a/rootly_sdk/api/alert_urgencies/list_alert_urgencies.py b/rootly_sdk/api/alert_urgencies/list_alert_urgencies.py index 130acb3b..3ce979c9 100644 --- a/rootly_sdk/api/alert_urgencies/list_alert_urgencies.py +++ b/rootly_sdk/api/alert_urgencies/list_alert_urgencies.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -11,20 +11,20 @@ def _get_kwargs( *, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -67,9 +67,7 @@ def _get_kwargs( return _kwargs -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[AlertUrgencyList]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> AlertUrgencyList | None: if response.status_code == 200: response_200 = AlertUrgencyList.from_dict(response.json()) @@ -81,9 +79,7 @@ def _parse_response( return None -def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[AlertUrgencyList]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[AlertUrgencyList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -95,20 +91,20 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[AlertUrgencyList]: """List alert urgencies @@ -165,21 +161,21 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, -) -> Optional[AlertUrgencyList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, +) -> AlertUrgencyList | None: """List alert urgencies List alert urgencies @@ -230,20 +226,20 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[AlertUrgencyList]: """List alert urgencies @@ -298,21 +294,21 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, -) -> Optional[AlertUrgencyList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, +) -> AlertUrgencyList | None: """List alert urgencies List alert urgencies diff --git a/rootly_sdk/api/alert_urgencies/update_alert_urgency.py b/rootly_sdk/api/alert_urgencies/update_alert_urgency.py index 75c95584..fb82767a 100644 --- a/rootly_sdk/api/alert_urgencies/update_alert_urgency.py +++ b/rootly_sdk/api/alert_urgencies/update_alert_urgency.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[AlertUrgencyResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> AlertUrgencyResponse | ErrorsList | None: if response.status_code == 200: response_200 = AlertUrgencyResponse.from_dict(response.json()) @@ -51,8 +51,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[AlertUrgencyResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[AlertUrgencyResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateAlertUrgency, -) -> Response[Union[AlertUrgencyResponse, ErrorsList]]: +) -> Response[AlertUrgencyResponse | ErrorsList]: """Update an alert urgency Update a specific alert urgency by id @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateAlertUrgency, -) -> Optional[Union[AlertUrgencyResponse, ErrorsList]]: +) -> AlertUrgencyResponse | ErrorsList | None: """Update an alert urgency Update a specific alert urgency by id @@ -129,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateAlertUrgency, -) -> Response[Union[AlertUrgencyResponse, ErrorsList]]: +) -> Response[AlertUrgencyResponse | ErrorsList]: """Update an alert urgency Update a specific alert urgency by id @@ -161,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateAlertUrgency, -) -> Optional[Union[AlertUrgencyResponse, ErrorsList]]: +) -> AlertUrgencyResponse | ErrorsList | None: """Update an alert urgency Update a specific alert urgency by id diff --git a/rootly_sdk/api/alerts/acknowledge_alert.py b/rootly_sdk/api/alerts/acknowledge_alert.py index 8529aae3..7bc7b1dd 100644 --- a/rootly_sdk/api/alerts/acknowledge_alert.py +++ b/rootly_sdk/api/alerts/acknowledge_alert.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[AlertResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> AlertResponse | ErrorsList | None: if response.status_code == 200: response_200 = AlertResponse.from_dict(response.json()) @@ -46,8 +46,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[AlertResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[AlertResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -60,7 +60,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[AlertResponse, ErrorsList]]: +) -> Response[AlertResponse | ErrorsList]: """Acknowledges an alert Acknowledges a specific alert by id @@ -91,7 +91,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[AlertResponse, ErrorsList]]: +) -> AlertResponse | ErrorsList | None: """Acknowledges an alert Acknowledges a specific alert by id @@ -117,7 +117,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[AlertResponse, ErrorsList]]: +) -> Response[AlertResponse | ErrorsList]: """Acknowledges an alert Acknowledges a specific alert by id @@ -146,7 +146,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[AlertResponse, ErrorsList]]: +) -> AlertResponse | ErrorsList | None: """Acknowledges an alert Acknowledges a specific alert by id diff --git a/rootly_sdk/api/alerts/attach_alert.py b/rootly_sdk/api/alerts/attach_alert.py index 69f8b112..2c0ce528 100644 --- a/rootly_sdk/api/alerts/attach_alert.py +++ b/rootly_sdk/api/alerts/attach_alert.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -31,9 +31,7 @@ def _get_kwargs( return _kwargs -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[AlertList, ErrorsList]]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> AlertList | ErrorsList | None: if response.status_code == 200: response_200 = AlertList.from_dict(response.json()) @@ -51,8 +49,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[AlertList, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[AlertList | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,7 +64,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: AttachAlert, -) -> Response[Union[AlertList, ErrorsList]]: +) -> Response[AlertList | ErrorsList]: """Attach alerts to an incident Attach alerts to an incident from provided data @@ -100,7 +98,7 @@ def sync( *, client: AuthenticatedClient, body: AttachAlert, -) -> Optional[Union[AlertList, ErrorsList]]: +) -> AlertList | ErrorsList | None: """Attach alerts to an incident Attach alerts to an incident from provided data @@ -129,7 +127,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: AttachAlert, -) -> Response[Union[AlertList, ErrorsList]]: +) -> Response[AlertList | ErrorsList]: """Attach alerts to an incident Attach alerts to an incident from provided data @@ -161,7 +159,7 @@ async def asyncio( *, client: AuthenticatedClient, body: AttachAlert, -) -> Optional[Union[AlertList, ErrorsList]]: +) -> AlertList | ErrorsList | None: """Attach alerts to an incident Attach alerts to an incident from provided data diff --git a/rootly_sdk/api/alerts/create_alert.py b/rootly_sdk/api/alerts/create_alert.py index 739c2cf6..9578c1ca 100644 --- a/rootly_sdk/api/alerts/create_alert.py +++ b/rootly_sdk/api/alerts/create_alert.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[AlertResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> AlertResponse | ErrorsList | None: if response.status_code == 201: response_201 = AlertResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[AlertResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[AlertResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +69,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewAlert, -) -> Response[Union[AlertResponse, ErrorsList]]: +) -> Response[AlertResponse | ErrorsList]: """Creates an alert Creates a new alert from provided data @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: NewAlert, -) -> Optional[Union[AlertResponse, ErrorsList]]: +) -> AlertResponse | ErrorsList | None: """Creates an alert Creates a new alert from provided data @@ -126,7 +126,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewAlert, -) -> Response[Union[AlertResponse, ErrorsList]]: +) -> Response[AlertResponse | ErrorsList]: """Creates an alert Creates a new alert from provided data @@ -155,7 +155,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewAlert, -) -> Optional[Union[AlertResponse, ErrorsList]]: +) -> AlertResponse | ErrorsList | None: """Creates an alert Creates a new alert from provided data diff --git a/rootly_sdk/api/alerts/escalate_alert.py b/rootly_sdk/api/alerts/escalate_alert.py index 5be96021..bd4ac638 100644 --- a/rootly_sdk/api/alerts/escalate_alert.py +++ b/rootly_sdk/api/alerts/escalate_alert.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[AlertResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> AlertResponse | ErrorsList | None: if response.status_code == 200: response_200 = AlertResponse.from_dict(response.json()) @@ -61,8 +61,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[AlertResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[AlertResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -76,7 +76,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: EscalateAlert, -) -> Response[Union[AlertResponse, ErrorsList]]: +) -> Response[AlertResponse | ErrorsList]: """Escalates an alert Escalates a specific alert to the next or specified level in its escalation policy @@ -110,7 +110,7 @@ def sync( *, client: AuthenticatedClient, body: EscalateAlert, -) -> Optional[Union[AlertResponse, ErrorsList]]: +) -> AlertResponse | ErrorsList | None: """Escalates an alert Escalates a specific alert to the next or specified level in its escalation policy @@ -139,7 +139,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: EscalateAlert, -) -> Response[Union[AlertResponse, ErrorsList]]: +) -> Response[AlertResponse | ErrorsList]: """Escalates an alert Escalates a specific alert to the next or specified level in its escalation policy @@ -171,7 +171,7 @@ async def asyncio( *, client: AuthenticatedClient, body: EscalateAlert, -) -> Optional[Union[AlertResponse, ErrorsList]]: +) -> AlertResponse | ErrorsList | None: """Escalates an alert Escalates a specific alert to the next or specified level in its escalation policy diff --git a/rootly_sdk/api/alerts/get_alert.py b/rootly_sdk/api/alerts/get_alert.py index 037095a9..c34c24e4 100644 --- a/rootly_sdk/api/alerts/get_alert.py +++ b/rootly_sdk/api/alerts/get_alert.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -14,11 +14,11 @@ def _get_kwargs( id: str, *, - include: Union[Unset, GetAlertInclude] = UNSET, + include: Unset | GetAlertInclude = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} - json_include: Union[Unset, str] = UNSET + json_include: Unset | str = UNSET if not isinstance(include, Unset): json_include = include @@ -36,8 +36,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[AlertResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> AlertResponse | ErrorsList | None: if response.status_code == 200: response_200 = AlertResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[AlertResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[AlertResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,8 +69,8 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, - include: Union[Unset, GetAlertInclude] = UNSET, -) -> Response[Union[AlertResponse, ErrorsList]]: + include: Unset | GetAlertInclude = UNSET, +) -> Response[AlertResponse | ErrorsList]: """Retrieves an alert Retrieves a specific alert by id @@ -103,8 +103,8 @@ def sync( id: str, *, client: AuthenticatedClient, - include: Union[Unset, GetAlertInclude] = UNSET, -) -> Optional[Union[AlertResponse, ErrorsList]]: + include: Unset | GetAlertInclude = UNSET, +) -> AlertResponse | ErrorsList | None: """Retrieves an alert Retrieves a specific alert by id @@ -132,8 +132,8 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, - include: Union[Unset, GetAlertInclude] = UNSET, -) -> Response[Union[AlertResponse, ErrorsList]]: + include: Unset | GetAlertInclude = UNSET, +) -> Response[AlertResponse | ErrorsList]: """Retrieves an alert Retrieves a specific alert by id @@ -164,8 +164,8 @@ async def asyncio( id: str, *, client: AuthenticatedClient, - include: Union[Unset, GetAlertInclude] = UNSET, -) -> Optional[Union[AlertResponse, ErrorsList]]: + include: Unset | GetAlertInclude = UNSET, +) -> AlertResponse | ErrorsList | None: """Retrieves an alert Retrieves a specific alert by id diff --git a/rootly_sdk/api/alerts/get_receipt.py b/rootly_sdk/api/alerts/get_receipt.py index 56b056be..032cd781 100644 --- a/rootly_sdk/api/alerts/get_receipt.py +++ b/rootly_sdk/api/alerts/get_receipt.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union, cast +from typing import Any, cast import httpx @@ -20,9 +20,7 @@ def _get_kwargs( return _kwargs -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[Any, Receipt]]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Any | Receipt | None: if response.status_code == 200: response_200 = Receipt.from_dict(response.json()) @@ -38,9 +36,7 @@ def _parse_response( return None -def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[Any, Receipt]]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Any | Receipt]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -53,7 +49,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[Any, Receipt]]: +) -> Response[Any | Receipt]: """Get a receipt Retrieve the delivery receipt for a notification by ID, including its state and (when applicable) @@ -85,7 +81,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[Any, Receipt]]: +) -> Any | Receipt | None: """Get a receipt Retrieve the delivery receipt for a notification by ID, including its state and (when applicable) @@ -112,7 +108,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[Any, Receipt]]: +) -> Response[Any | Receipt]: """Get a receipt Retrieve the delivery receipt for a notification by ID, including its state and (when applicable) @@ -142,7 +138,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[Any, Receipt]]: +) -> Any | Receipt | None: """Get a receipt Retrieve the delivery receipt for a notification by ID, including its state and (when applicable) diff --git a/rootly_sdk/api/alerts/list_alerts.py b/rootly_sdk/api/alerts/list_alerts.py index 21ccb452..0193806d 100644 --- a/rootly_sdk/api/alerts/list_alerts.py +++ b/rootly_sdk/api/alerts/list_alerts.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -12,60 +12,60 @@ def _get_kwargs( *, - include: Union[Unset, ListAlertsInclude] = UNSET, - filterstatus: Union[Unset, str] = UNSET, - filtersource: Union[Unset, str] = UNSET, - filterservices: Union[Unset, str] = UNSET, - filterenvironments: Union[Unset, str] = UNSET, - filtergroups: Union[Unset, str] = UNSET, - filterlabels: Union[Unset, str] = UNSET, - filterstarted_atgt: Union[Unset, str] = UNSET, - filterstarted_atgte: Union[Unset, str] = UNSET, - filterstarted_atlt: Union[Unset, str] = UNSET, - filterstarted_atlte: Union[Unset, str] = UNSET, - filterended_atgt: Union[Unset, str] = UNSET, - filterended_atgte: Union[Unset, str] = UNSET, - filterended_atlt: Union[Unset, str] = UNSET, - filterended_atlte: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filterupdated_atgt: Union[Unset, str] = UNSET, - filterupdated_atgte: Union[Unset, str] = UNSET, - filterupdated_atlt: Union[Unset, str] = UNSET, - filterupdated_atlte: Union[Unset, str] = UNSET, - filterstatuseq: Union[Unset, str] = UNSET, - filterstatusnot_eq: Union[Unset, str] = UNSET, - filterstatusin: Union[Unset, str] = UNSET, - filterstatusnot_in: Union[Unset, str] = UNSET, - filtersourceeq: Union[Unset, str] = UNSET, - filtersourcenot_eq: Union[Unset, str] = UNSET, - filtersourcein: Union[Unset, str] = UNSET, - filtersourcenot_in: Union[Unset, str] = UNSET, - filterserviceseq: Union[Unset, str] = UNSET, - filterservicesnot_eq: Union[Unset, str] = UNSET, - filterservicesin: Union[Unset, str] = UNSET, - filterservicesnot_in: Union[Unset, str] = UNSET, - filtergroupseq: Union[Unset, str] = UNSET, - filtergroupsnot_eq: Union[Unset, str] = UNSET, - filtergroupsin: Union[Unset, str] = UNSET, - filtergroupsnot_in: Union[Unset, str] = UNSET, - filterenvironmentseq: Union[Unset, str] = UNSET, - filterenvironmentsnot_eq: Union[Unset, str] = UNSET, - filterenvironmentsin: Union[Unset, str] = UNSET, - filterenvironmentsnot_in: Union[Unset, str] = UNSET, - filterlabelseq: Union[Unset, str] = UNSET, - filterlabelsnot_eq: Union[Unset, str] = UNSET, - filterlabelsin: Union[Unset, str] = UNSET, - filterlabelsnot_in: Union[Unset, str] = UNSET, - pageafter: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + include: Unset | ListAlertsInclude = UNSET, + filterstatus: Unset | str = UNSET, + filtersource: Unset | str = UNSET, + filterservices: Unset | str = UNSET, + filterenvironments: Unset | str = UNSET, + filtergroups: Unset | str = UNSET, + filterlabels: Unset | str = UNSET, + filterstarted_atgt: Unset | str = UNSET, + filterstarted_atgte: Unset | str = UNSET, + filterstarted_atlt: Unset | str = UNSET, + filterstarted_atlte: Unset | str = UNSET, + filterended_atgt: Unset | str = UNSET, + filterended_atgte: Unset | str = UNSET, + filterended_atlt: Unset | str = UNSET, + filterended_atlte: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterupdated_atgt: Unset | str = UNSET, + filterupdated_atgte: Unset | str = UNSET, + filterupdated_atlt: Unset | str = UNSET, + filterupdated_atlte: Unset | str = UNSET, + filterstatuseq: Unset | str = UNSET, + filterstatusnot_eq: Unset | str = UNSET, + filterstatusin: Unset | str = UNSET, + filterstatusnot_in: Unset | str = UNSET, + filtersourceeq: Unset | str = UNSET, + filtersourcenot_eq: Unset | str = UNSET, + filtersourcein: Unset | str = UNSET, + filtersourcenot_in: Unset | str = UNSET, + filterserviceseq: Unset | str = UNSET, + filterservicesnot_eq: Unset | str = UNSET, + filterservicesin: Unset | str = UNSET, + filterservicesnot_in: Unset | str = UNSET, + filtergroupseq: Unset | str = UNSET, + filtergroupsnot_eq: Unset | str = UNSET, + filtergroupsin: Unset | str = UNSET, + filtergroupsnot_in: Unset | str = UNSET, + filterenvironmentseq: Unset | str = UNSET, + filterenvironmentsnot_eq: Unset | str = UNSET, + filterenvironmentsin: Unset | str = UNSET, + filterenvironmentsnot_in: Unset | str = UNSET, + filterlabelseq: Unset | str = UNSET, + filterlabelsnot_eq: Unset | str = UNSET, + filterlabelsin: Unset | str = UNSET, + filterlabelsnot_in: Unset | str = UNSET, + pageafter: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} - json_include: Union[Unset, str] = UNSET + json_include: Unset | str = UNSET if not isinstance(include, Unset): json_include = include @@ -180,7 +180,7 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[AlertList]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> AlertList | None: if response.status_code == 200: response_200 = AlertList.from_dict(response.json()) @@ -192,7 +192,7 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[AlertList]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[AlertList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -204,56 +204,56 @@ def _build_response(*, client: Union[AuthenticatedClient, Client], response: htt def sync_detailed( *, client: AuthenticatedClient, - include: Union[Unset, ListAlertsInclude] = UNSET, - filterstatus: Union[Unset, str] = UNSET, - filtersource: Union[Unset, str] = UNSET, - filterservices: Union[Unset, str] = UNSET, - filterenvironments: Union[Unset, str] = UNSET, - filtergroups: Union[Unset, str] = UNSET, - filterlabels: Union[Unset, str] = UNSET, - filterstarted_atgt: Union[Unset, str] = UNSET, - filterstarted_atgte: Union[Unset, str] = UNSET, - filterstarted_atlt: Union[Unset, str] = UNSET, - filterstarted_atlte: Union[Unset, str] = UNSET, - filterended_atgt: Union[Unset, str] = UNSET, - filterended_atgte: Union[Unset, str] = UNSET, - filterended_atlt: Union[Unset, str] = UNSET, - filterended_atlte: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filterupdated_atgt: Union[Unset, str] = UNSET, - filterupdated_atgte: Union[Unset, str] = UNSET, - filterupdated_atlt: Union[Unset, str] = UNSET, - filterupdated_atlte: Union[Unset, str] = UNSET, - filterstatuseq: Union[Unset, str] = UNSET, - filterstatusnot_eq: Union[Unset, str] = UNSET, - filterstatusin: Union[Unset, str] = UNSET, - filterstatusnot_in: Union[Unset, str] = UNSET, - filtersourceeq: Union[Unset, str] = UNSET, - filtersourcenot_eq: Union[Unset, str] = UNSET, - filtersourcein: Union[Unset, str] = UNSET, - filtersourcenot_in: Union[Unset, str] = UNSET, - filterserviceseq: Union[Unset, str] = UNSET, - filterservicesnot_eq: Union[Unset, str] = UNSET, - filterservicesin: Union[Unset, str] = UNSET, - filterservicesnot_in: Union[Unset, str] = UNSET, - filtergroupseq: Union[Unset, str] = UNSET, - filtergroupsnot_eq: Union[Unset, str] = UNSET, - filtergroupsin: Union[Unset, str] = UNSET, - filtergroupsnot_in: Union[Unset, str] = UNSET, - filterenvironmentseq: Union[Unset, str] = UNSET, - filterenvironmentsnot_eq: Union[Unset, str] = UNSET, - filterenvironmentsin: Union[Unset, str] = UNSET, - filterenvironmentsnot_in: Union[Unset, str] = UNSET, - filterlabelseq: Union[Unset, str] = UNSET, - filterlabelsnot_eq: Union[Unset, str] = UNSET, - filterlabelsin: Union[Unset, str] = UNSET, - filterlabelsnot_in: Union[Unset, str] = UNSET, - pageafter: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + include: Unset | ListAlertsInclude = UNSET, + filterstatus: Unset | str = UNSET, + filtersource: Unset | str = UNSET, + filterservices: Unset | str = UNSET, + filterenvironments: Unset | str = UNSET, + filtergroups: Unset | str = UNSET, + filterlabels: Unset | str = UNSET, + filterstarted_atgt: Unset | str = UNSET, + filterstarted_atgte: Unset | str = UNSET, + filterstarted_atlt: Unset | str = UNSET, + filterstarted_atlte: Unset | str = UNSET, + filterended_atgt: Unset | str = UNSET, + filterended_atgte: Unset | str = UNSET, + filterended_atlt: Unset | str = UNSET, + filterended_atlte: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterupdated_atgt: Unset | str = UNSET, + filterupdated_atgte: Unset | str = UNSET, + filterupdated_atlt: Unset | str = UNSET, + filterupdated_atlte: Unset | str = UNSET, + filterstatuseq: Unset | str = UNSET, + filterstatusnot_eq: Unset | str = UNSET, + filterstatusin: Unset | str = UNSET, + filterstatusnot_in: Unset | str = UNSET, + filtersourceeq: Unset | str = UNSET, + filtersourcenot_eq: Unset | str = UNSET, + filtersourcein: Unset | str = UNSET, + filtersourcenot_in: Unset | str = UNSET, + filterserviceseq: Unset | str = UNSET, + filterservicesnot_eq: Unset | str = UNSET, + filterservicesin: Unset | str = UNSET, + filterservicesnot_in: Unset | str = UNSET, + filtergroupseq: Unset | str = UNSET, + filtergroupsnot_eq: Unset | str = UNSET, + filtergroupsin: Unset | str = UNSET, + filtergroupsnot_in: Unset | str = UNSET, + filterenvironmentseq: Unset | str = UNSET, + filterenvironmentsnot_eq: Unset | str = UNSET, + filterenvironmentsin: Unset | str = UNSET, + filterenvironmentsnot_in: Unset | str = UNSET, + filterlabelseq: Unset | str = UNSET, + filterlabelsnot_eq: Unset | str = UNSET, + filterlabelsin: Unset | str = UNSET, + filterlabelsnot_in: Unset | str = UNSET, + pageafter: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[AlertList]: """List alerts @@ -382,57 +382,57 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: Union[Unset, ListAlertsInclude] = UNSET, - filterstatus: Union[Unset, str] = UNSET, - filtersource: Union[Unset, str] = UNSET, - filterservices: Union[Unset, str] = UNSET, - filterenvironments: Union[Unset, str] = UNSET, - filtergroups: Union[Unset, str] = UNSET, - filterlabels: Union[Unset, str] = UNSET, - filterstarted_atgt: Union[Unset, str] = UNSET, - filterstarted_atgte: Union[Unset, str] = UNSET, - filterstarted_atlt: Union[Unset, str] = UNSET, - filterstarted_atlte: Union[Unset, str] = UNSET, - filterended_atgt: Union[Unset, str] = UNSET, - filterended_atgte: Union[Unset, str] = UNSET, - filterended_atlt: Union[Unset, str] = UNSET, - filterended_atlte: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filterupdated_atgt: Union[Unset, str] = UNSET, - filterupdated_atgte: Union[Unset, str] = UNSET, - filterupdated_atlt: Union[Unset, str] = UNSET, - filterupdated_atlte: Union[Unset, str] = UNSET, - filterstatuseq: Union[Unset, str] = UNSET, - filterstatusnot_eq: Union[Unset, str] = UNSET, - filterstatusin: Union[Unset, str] = UNSET, - filterstatusnot_in: Union[Unset, str] = UNSET, - filtersourceeq: Union[Unset, str] = UNSET, - filtersourcenot_eq: Union[Unset, str] = UNSET, - filtersourcein: Union[Unset, str] = UNSET, - filtersourcenot_in: Union[Unset, str] = UNSET, - filterserviceseq: Union[Unset, str] = UNSET, - filterservicesnot_eq: Union[Unset, str] = UNSET, - filterservicesin: Union[Unset, str] = UNSET, - filterservicesnot_in: Union[Unset, str] = UNSET, - filtergroupseq: Union[Unset, str] = UNSET, - filtergroupsnot_eq: Union[Unset, str] = UNSET, - filtergroupsin: Union[Unset, str] = UNSET, - filtergroupsnot_in: Union[Unset, str] = UNSET, - filterenvironmentseq: Union[Unset, str] = UNSET, - filterenvironmentsnot_eq: Union[Unset, str] = UNSET, - filterenvironmentsin: Union[Unset, str] = UNSET, - filterenvironmentsnot_in: Union[Unset, str] = UNSET, - filterlabelseq: Union[Unset, str] = UNSET, - filterlabelsnot_eq: Union[Unset, str] = UNSET, - filterlabelsin: Union[Unset, str] = UNSET, - filterlabelsnot_in: Union[Unset, str] = UNSET, - pageafter: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, -) -> Optional[AlertList]: + include: Unset | ListAlertsInclude = UNSET, + filterstatus: Unset | str = UNSET, + filtersource: Unset | str = UNSET, + filterservices: Unset | str = UNSET, + filterenvironments: Unset | str = UNSET, + filtergroups: Unset | str = UNSET, + filterlabels: Unset | str = UNSET, + filterstarted_atgt: Unset | str = UNSET, + filterstarted_atgte: Unset | str = UNSET, + filterstarted_atlt: Unset | str = UNSET, + filterstarted_atlte: Unset | str = UNSET, + filterended_atgt: Unset | str = UNSET, + filterended_atgte: Unset | str = UNSET, + filterended_atlt: Unset | str = UNSET, + filterended_atlte: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterupdated_atgt: Unset | str = UNSET, + filterupdated_atgte: Unset | str = UNSET, + filterupdated_atlt: Unset | str = UNSET, + filterupdated_atlte: Unset | str = UNSET, + filterstatuseq: Unset | str = UNSET, + filterstatusnot_eq: Unset | str = UNSET, + filterstatusin: Unset | str = UNSET, + filterstatusnot_in: Unset | str = UNSET, + filtersourceeq: Unset | str = UNSET, + filtersourcenot_eq: Unset | str = UNSET, + filtersourcein: Unset | str = UNSET, + filtersourcenot_in: Unset | str = UNSET, + filterserviceseq: Unset | str = UNSET, + filterservicesnot_eq: Unset | str = UNSET, + filterservicesin: Unset | str = UNSET, + filterservicesnot_in: Unset | str = UNSET, + filtergroupseq: Unset | str = UNSET, + filtergroupsnot_eq: Unset | str = UNSET, + filtergroupsin: Unset | str = UNSET, + filtergroupsnot_in: Unset | str = UNSET, + filterenvironmentseq: Unset | str = UNSET, + filterenvironmentsnot_eq: Unset | str = UNSET, + filterenvironmentsin: Unset | str = UNSET, + filterenvironmentsnot_in: Unset | str = UNSET, + filterlabelseq: Unset | str = UNSET, + filterlabelsnot_eq: Unset | str = UNSET, + filterlabelsin: Unset | str = UNSET, + filterlabelsnot_in: Unset | str = UNSET, + pageafter: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, +) -> AlertList | None: """List alerts List alerts @@ -555,56 +555,56 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: Union[Unset, ListAlertsInclude] = UNSET, - filterstatus: Union[Unset, str] = UNSET, - filtersource: Union[Unset, str] = UNSET, - filterservices: Union[Unset, str] = UNSET, - filterenvironments: Union[Unset, str] = UNSET, - filtergroups: Union[Unset, str] = UNSET, - filterlabels: Union[Unset, str] = UNSET, - filterstarted_atgt: Union[Unset, str] = UNSET, - filterstarted_atgte: Union[Unset, str] = UNSET, - filterstarted_atlt: Union[Unset, str] = UNSET, - filterstarted_atlte: Union[Unset, str] = UNSET, - filterended_atgt: Union[Unset, str] = UNSET, - filterended_atgte: Union[Unset, str] = UNSET, - filterended_atlt: Union[Unset, str] = UNSET, - filterended_atlte: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filterupdated_atgt: Union[Unset, str] = UNSET, - filterupdated_atgte: Union[Unset, str] = UNSET, - filterupdated_atlt: Union[Unset, str] = UNSET, - filterupdated_atlte: Union[Unset, str] = UNSET, - filterstatuseq: Union[Unset, str] = UNSET, - filterstatusnot_eq: Union[Unset, str] = UNSET, - filterstatusin: Union[Unset, str] = UNSET, - filterstatusnot_in: Union[Unset, str] = UNSET, - filtersourceeq: Union[Unset, str] = UNSET, - filtersourcenot_eq: Union[Unset, str] = UNSET, - filtersourcein: Union[Unset, str] = UNSET, - filtersourcenot_in: Union[Unset, str] = UNSET, - filterserviceseq: Union[Unset, str] = UNSET, - filterservicesnot_eq: Union[Unset, str] = UNSET, - filterservicesin: Union[Unset, str] = UNSET, - filterservicesnot_in: Union[Unset, str] = UNSET, - filtergroupseq: Union[Unset, str] = UNSET, - filtergroupsnot_eq: Union[Unset, str] = UNSET, - filtergroupsin: Union[Unset, str] = UNSET, - filtergroupsnot_in: Union[Unset, str] = UNSET, - filterenvironmentseq: Union[Unset, str] = UNSET, - filterenvironmentsnot_eq: Union[Unset, str] = UNSET, - filterenvironmentsin: Union[Unset, str] = UNSET, - filterenvironmentsnot_in: Union[Unset, str] = UNSET, - filterlabelseq: Union[Unset, str] = UNSET, - filterlabelsnot_eq: Union[Unset, str] = UNSET, - filterlabelsin: Union[Unset, str] = UNSET, - filterlabelsnot_in: Union[Unset, str] = UNSET, - pageafter: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + include: Unset | ListAlertsInclude = UNSET, + filterstatus: Unset | str = UNSET, + filtersource: Unset | str = UNSET, + filterservices: Unset | str = UNSET, + filterenvironments: Unset | str = UNSET, + filtergroups: Unset | str = UNSET, + filterlabels: Unset | str = UNSET, + filterstarted_atgt: Unset | str = UNSET, + filterstarted_atgte: Unset | str = UNSET, + filterstarted_atlt: Unset | str = UNSET, + filterstarted_atlte: Unset | str = UNSET, + filterended_atgt: Unset | str = UNSET, + filterended_atgte: Unset | str = UNSET, + filterended_atlt: Unset | str = UNSET, + filterended_atlte: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterupdated_atgt: Unset | str = UNSET, + filterupdated_atgte: Unset | str = UNSET, + filterupdated_atlt: Unset | str = UNSET, + filterupdated_atlte: Unset | str = UNSET, + filterstatuseq: Unset | str = UNSET, + filterstatusnot_eq: Unset | str = UNSET, + filterstatusin: Unset | str = UNSET, + filterstatusnot_in: Unset | str = UNSET, + filtersourceeq: Unset | str = UNSET, + filtersourcenot_eq: Unset | str = UNSET, + filtersourcein: Unset | str = UNSET, + filtersourcenot_in: Unset | str = UNSET, + filterserviceseq: Unset | str = UNSET, + filterservicesnot_eq: Unset | str = UNSET, + filterservicesin: Unset | str = UNSET, + filterservicesnot_in: Unset | str = UNSET, + filtergroupseq: Unset | str = UNSET, + filtergroupsnot_eq: Unset | str = UNSET, + filtergroupsin: Unset | str = UNSET, + filtergroupsnot_in: Unset | str = UNSET, + filterenvironmentseq: Unset | str = UNSET, + filterenvironmentsnot_eq: Unset | str = UNSET, + filterenvironmentsin: Unset | str = UNSET, + filterenvironmentsnot_in: Unset | str = UNSET, + filterlabelseq: Unset | str = UNSET, + filterlabelsnot_eq: Unset | str = UNSET, + filterlabelsin: Unset | str = UNSET, + filterlabelsnot_in: Unset | str = UNSET, + pageafter: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[AlertList]: """List alerts @@ -731,57 +731,57 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: Union[Unset, ListAlertsInclude] = UNSET, - filterstatus: Union[Unset, str] = UNSET, - filtersource: Union[Unset, str] = UNSET, - filterservices: Union[Unset, str] = UNSET, - filterenvironments: Union[Unset, str] = UNSET, - filtergroups: Union[Unset, str] = UNSET, - filterlabels: Union[Unset, str] = UNSET, - filterstarted_atgt: Union[Unset, str] = UNSET, - filterstarted_atgte: Union[Unset, str] = UNSET, - filterstarted_atlt: Union[Unset, str] = UNSET, - filterstarted_atlte: Union[Unset, str] = UNSET, - filterended_atgt: Union[Unset, str] = UNSET, - filterended_atgte: Union[Unset, str] = UNSET, - filterended_atlt: Union[Unset, str] = UNSET, - filterended_atlte: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filterupdated_atgt: Union[Unset, str] = UNSET, - filterupdated_atgte: Union[Unset, str] = UNSET, - filterupdated_atlt: Union[Unset, str] = UNSET, - filterupdated_atlte: Union[Unset, str] = UNSET, - filterstatuseq: Union[Unset, str] = UNSET, - filterstatusnot_eq: Union[Unset, str] = UNSET, - filterstatusin: Union[Unset, str] = UNSET, - filterstatusnot_in: Union[Unset, str] = UNSET, - filtersourceeq: Union[Unset, str] = UNSET, - filtersourcenot_eq: Union[Unset, str] = UNSET, - filtersourcein: Union[Unset, str] = UNSET, - filtersourcenot_in: Union[Unset, str] = UNSET, - filterserviceseq: Union[Unset, str] = UNSET, - filterservicesnot_eq: Union[Unset, str] = UNSET, - filterservicesin: Union[Unset, str] = UNSET, - filterservicesnot_in: Union[Unset, str] = UNSET, - filtergroupseq: Union[Unset, str] = UNSET, - filtergroupsnot_eq: Union[Unset, str] = UNSET, - filtergroupsin: Union[Unset, str] = UNSET, - filtergroupsnot_in: Union[Unset, str] = UNSET, - filterenvironmentseq: Union[Unset, str] = UNSET, - filterenvironmentsnot_eq: Union[Unset, str] = UNSET, - filterenvironmentsin: Union[Unset, str] = UNSET, - filterenvironmentsnot_in: Union[Unset, str] = UNSET, - filterlabelseq: Union[Unset, str] = UNSET, - filterlabelsnot_eq: Union[Unset, str] = UNSET, - filterlabelsin: Union[Unset, str] = UNSET, - filterlabelsnot_in: Union[Unset, str] = UNSET, - pageafter: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, -) -> Optional[AlertList]: + include: Unset | ListAlertsInclude = UNSET, + filterstatus: Unset | str = UNSET, + filtersource: Unset | str = UNSET, + filterservices: Unset | str = UNSET, + filterenvironments: Unset | str = UNSET, + filtergroups: Unset | str = UNSET, + filterlabels: Unset | str = UNSET, + filterstarted_atgt: Unset | str = UNSET, + filterstarted_atgte: Unset | str = UNSET, + filterstarted_atlt: Unset | str = UNSET, + filterstarted_atlte: Unset | str = UNSET, + filterended_atgt: Unset | str = UNSET, + filterended_atgte: Unset | str = UNSET, + filterended_atlt: Unset | str = UNSET, + filterended_atlte: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterupdated_atgt: Unset | str = UNSET, + filterupdated_atgte: Unset | str = UNSET, + filterupdated_atlt: Unset | str = UNSET, + filterupdated_atlte: Unset | str = UNSET, + filterstatuseq: Unset | str = UNSET, + filterstatusnot_eq: Unset | str = UNSET, + filterstatusin: Unset | str = UNSET, + filterstatusnot_in: Unset | str = UNSET, + filtersourceeq: Unset | str = UNSET, + filtersourcenot_eq: Unset | str = UNSET, + filtersourcein: Unset | str = UNSET, + filtersourcenot_in: Unset | str = UNSET, + filterserviceseq: Unset | str = UNSET, + filterservicesnot_eq: Unset | str = UNSET, + filterservicesin: Unset | str = UNSET, + filterservicesnot_in: Unset | str = UNSET, + filtergroupseq: Unset | str = UNSET, + filtergroupsnot_eq: Unset | str = UNSET, + filtergroupsin: Unset | str = UNSET, + filtergroupsnot_in: Unset | str = UNSET, + filterenvironmentseq: Unset | str = UNSET, + filterenvironmentsnot_eq: Unset | str = UNSET, + filterenvironmentsin: Unset | str = UNSET, + filterenvironmentsnot_in: Unset | str = UNSET, + filterlabelseq: Unset | str = UNSET, + filterlabelsnot_eq: Unset | str = UNSET, + filterlabelsin: Unset | str = UNSET, + filterlabelsnot_in: Unset | str = UNSET, + pageafter: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, +) -> AlertList | None: """List alerts List alerts diff --git a/rootly_sdk/api/alerts/list_incident_alerts.py b/rootly_sdk/api/alerts/list_incident_alerts.py index 171a2398..0932d1c3 100644 --- a/rootly_sdk/api/alerts/list_incident_alerts.py +++ b/rootly_sdk/api/alerts/list_incident_alerts.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -13,11 +13,11 @@ def _get_kwargs( incident_id: str, *, - include: Union[Unset, ListIncidentAlertsInclude] = UNSET, + include: Unset | ListIncidentAlertsInclude = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} - json_include: Union[Unset, str] = UNSET + json_include: Unset | str = UNSET if not isinstance(include, Unset): json_include = include @@ -34,7 +34,7 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[AlertList]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> AlertList | None: if response.status_code == 200: response_200 = AlertList.from_dict(response.json()) @@ -46,7 +46,7 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[AlertList]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[AlertList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,7 +59,7 @@ def sync_detailed( incident_id: str, *, client: AuthenticatedClient, - include: Union[Unset, ListIncidentAlertsInclude] = UNSET, + include: Unset | ListIncidentAlertsInclude = UNSET, ) -> Response[AlertList]: """List Incident alerts @@ -93,8 +93,8 @@ def sync( incident_id: str, *, client: AuthenticatedClient, - include: Union[Unset, ListIncidentAlertsInclude] = UNSET, -) -> Optional[AlertList]: + include: Unset | ListIncidentAlertsInclude = UNSET, +) -> AlertList | None: """List Incident alerts List incident alerts @@ -122,7 +122,7 @@ async def asyncio_detailed( incident_id: str, *, client: AuthenticatedClient, - include: Union[Unset, ListIncidentAlertsInclude] = UNSET, + include: Unset | ListIncidentAlertsInclude = UNSET, ) -> Response[AlertList]: """List Incident alerts @@ -154,8 +154,8 @@ async def asyncio( incident_id: str, *, client: AuthenticatedClient, - include: Union[Unset, ListIncidentAlertsInclude] = UNSET, -) -> Optional[AlertList]: + include: Unset | ListIncidentAlertsInclude = UNSET, +) -> AlertList | None: """List Incident alerts List incident alerts diff --git a/rootly_sdk/api/alerts/resolve_alert.py b/rootly_sdk/api/alerts/resolve_alert.py index 9e57e8d3..0dfeab41 100644 --- a/rootly_sdk/api/alerts/resolve_alert.py +++ b/rootly_sdk/api/alerts/resolve_alert.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[AlertResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> AlertResponse | ErrorsList | None: if response.status_code == 200: response_200 = AlertResponse.from_dict(response.json()) @@ -51,8 +51,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[AlertResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[AlertResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: ResolveAlert, -) -> Response[Union[AlertResponse, ErrorsList]]: +) -> Response[AlertResponse | ErrorsList]: """Resolves an alert Resolves a specific alert by id @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: ResolveAlert, -) -> Optional[Union[AlertResponse, ErrorsList]]: +) -> AlertResponse | ErrorsList | None: """Resolves an alert Resolves a specific alert by id @@ -129,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: ResolveAlert, -) -> Response[Union[AlertResponse, ErrorsList]]: +) -> Response[AlertResponse | ErrorsList]: """Resolves an alert Resolves a specific alert by id @@ -161,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: ResolveAlert, -) -> Optional[Union[AlertResponse, ErrorsList]]: +) -> AlertResponse | ErrorsList | None: """Resolves an alert Resolves a specific alert by id diff --git a/rootly_sdk/api/alerts/snooze_alert.py b/rootly_sdk/api/alerts/snooze_alert.py index e6b03f50..3c2d9ff0 100644 --- a/rootly_sdk/api/alerts/snooze_alert.py +++ b/rootly_sdk/api/alerts/snooze_alert.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[AlertResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> AlertResponse | ErrorsList | None: if response.status_code == 200: response_200 = AlertResponse.from_dict(response.json()) @@ -61,8 +61,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[AlertResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[AlertResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -76,7 +76,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: SnoozeAlert, -) -> Response[Union[AlertResponse, ErrorsList]]: +) -> Response[AlertResponse | ErrorsList]: """Snoozes an alert Snoozes a specific alert by id, extending the acknowledgment timeout @@ -110,7 +110,7 @@ def sync( *, client: AuthenticatedClient, body: SnoozeAlert, -) -> Optional[Union[AlertResponse, ErrorsList]]: +) -> AlertResponse | ErrorsList | None: """Snoozes an alert Snoozes a specific alert by id, extending the acknowledgment timeout @@ -139,7 +139,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: SnoozeAlert, -) -> Response[Union[AlertResponse, ErrorsList]]: +) -> Response[AlertResponse | ErrorsList]: """Snoozes an alert Snoozes a specific alert by id, extending the acknowledgment timeout @@ -171,7 +171,7 @@ async def asyncio( *, client: AuthenticatedClient, body: SnoozeAlert, -) -> Optional[Union[AlertResponse, ErrorsList]]: +) -> AlertResponse | ErrorsList | None: """Snoozes an alert Snoozes a specific alert by id, extending the acknowledgment timeout diff --git a/rootly_sdk/api/alerts/update_alert.py b/rootly_sdk/api/alerts/update_alert.py index 0a41f5bc..169e0410 100644 --- a/rootly_sdk/api/alerts/update_alert.py +++ b/rootly_sdk/api/alerts/update_alert.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[AlertResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> AlertResponse | ErrorsList | None: if response.status_code == 200: response_200 = AlertResponse.from_dict(response.json()) @@ -51,8 +51,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[AlertResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[AlertResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateAlert, -) -> Response[Union[AlertResponse, ErrorsList]]: +) -> Response[AlertResponse | ErrorsList]: """Update alert Updates an alert @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateAlert, -) -> Optional[Union[AlertResponse, ErrorsList]]: +) -> AlertResponse | ErrorsList | None: """Update alert Updates an alert @@ -129,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateAlert, -) -> Response[Union[AlertResponse, ErrorsList]]: +) -> Response[AlertResponse | ErrorsList]: """Update alert Updates an alert @@ -161,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateAlert, -) -> Optional[Union[AlertResponse, ErrorsList]]: +) -> AlertResponse | ErrorsList | None: """Update alert Updates an alert diff --git a/rootly_sdk/api/api_keys/create_api_key.py b/rootly_sdk/api/api_keys/create_api_key.py index c06b60be..5df4ee0d 100644 --- a/rootly_sdk/api/api_keys/create_api_key.py +++ b/rootly_sdk/api/api_keys/create_api_key.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ApiKeyWithTokenResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiKeyWithTokenResponse | ErrorsList | None: if response.status_code == 201: response_201 = ApiKeyWithTokenResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ApiKeyWithTokenResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ApiKeyWithTokenResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +69,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewApiKey, -) -> Response[Union[ApiKeyWithTokenResponse, ErrorsList]]: +) -> Response[ApiKeyWithTokenResponse | ErrorsList]: """Creates an API key Creates a new API key and returns it with the plaintext token. **The token is only returned once** — @@ -111,7 +111,7 @@ def sync( *, client: AuthenticatedClient, body: NewApiKey, -) -> Optional[Union[ApiKeyWithTokenResponse, ErrorsList]]: +) -> ApiKeyWithTokenResponse | ErrorsList | None: """Creates an API key Creates a new API key and returns it with the plaintext token. **The token is only returned once** — @@ -148,7 +148,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewApiKey, -) -> Response[Union[ApiKeyWithTokenResponse, ErrorsList]]: +) -> Response[ApiKeyWithTokenResponse | ErrorsList]: """Creates an API key Creates a new API key and returns it with the plaintext token. **The token is only returned once** — @@ -188,7 +188,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewApiKey, -) -> Optional[Union[ApiKeyWithTokenResponse, ErrorsList]]: +) -> ApiKeyWithTokenResponse | ErrorsList | None: """Creates an API key Creates a new API key and returns it with the plaintext token. **The token is only returned once** — diff --git a/rootly_sdk/api/api_keys/delete_api_key.py b/rootly_sdk/api/api_keys/delete_api_key.py index 1e68358a..6760e4a8 100644 --- a/rootly_sdk/api/api_keys/delete_api_key.py +++ b/rootly_sdk/api/api_keys/delete_api_key.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any from uuid import UUID import httpx @@ -23,8 +23,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ApiKeyResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiKeyResponse | ErrorsList | None: if response.status_code == 200: response_200 = ApiKeyResponse.from_dict(response.json()) @@ -42,8 +42,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ApiKeyResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ApiKeyResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -56,7 +56,7 @@ def sync_detailed( id: UUID, *, client: AuthenticatedClient, -) -> Response[Union[ApiKeyResponse, ErrorsList]]: +) -> Response[ApiKeyResponse | ErrorsList]: """Revoke an API key Revoke an API key. The key is immediately invalidated and can no longer be used for authentication. @@ -91,7 +91,7 @@ def sync( id: UUID, *, client: AuthenticatedClient, -) -> Optional[Union[ApiKeyResponse, ErrorsList]]: +) -> ApiKeyResponse | ErrorsList | None: """Revoke an API key Revoke an API key. The key is immediately invalidated and can no longer be used for authentication. @@ -121,7 +121,7 @@ async def asyncio_detailed( id: UUID, *, client: AuthenticatedClient, -) -> Response[Union[ApiKeyResponse, ErrorsList]]: +) -> Response[ApiKeyResponse | ErrorsList]: """Revoke an API key Revoke an API key. The key is immediately invalidated and can no longer be used for authentication. @@ -154,7 +154,7 @@ async def asyncio( id: UUID, *, client: AuthenticatedClient, -) -> Optional[Union[ApiKeyResponse, ErrorsList]]: +) -> ApiKeyResponse | ErrorsList | None: """Revoke an API key Revoke an API key. The key is immediately invalidated and can no longer be used for authentication. diff --git a/rootly_sdk/api/api_keys/get_api_key.py b/rootly_sdk/api/api_keys/get_api_key.py index 318c71b2..5cc91a24 100644 --- a/rootly_sdk/api/api_keys/get_api_key.py +++ b/rootly_sdk/api/api_keys/get_api_key.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any from uuid import UUID import httpx @@ -14,7 +14,7 @@ def _get_kwargs( id: UUID, *, - include: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ApiKeyResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiKeyResponse | ErrorsList | None: if response.status_code == 200: response_200 = ApiKeyResponse.from_dict(response.json()) @@ -51,8 +51,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ApiKeyResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ApiKeyResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -65,8 +65,8 @@ def sync_detailed( id: UUID, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, -) -> Response[Union[ApiKeyResponse, ErrorsList]]: + include: Unset | str = UNSET, +) -> Response[ApiKeyResponse | ErrorsList]: """Retrieves an API key Retrieves a specific API key by its UUID. Returns key metadata including name, kind, expiration, @@ -100,8 +100,8 @@ def sync( id: UUID, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, -) -> Optional[Union[ApiKeyResponse, ErrorsList]]: + include: Unset | str = UNSET, +) -> ApiKeyResponse | ErrorsList | None: """Retrieves an API key Retrieves a specific API key by its UUID. Returns key metadata including name, kind, expiration, @@ -130,8 +130,8 @@ async def asyncio_detailed( id: UUID, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, -) -> Response[Union[ApiKeyResponse, ErrorsList]]: + include: Unset | str = UNSET, +) -> Response[ApiKeyResponse | ErrorsList]: """Retrieves an API key Retrieves a specific API key by its UUID. Returns key metadata including name, kind, expiration, @@ -163,8 +163,8 @@ async def asyncio( id: UUID, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, -) -> Optional[Union[ApiKeyResponse, ErrorsList]]: + include: Unset | str = UNSET, +) -> ApiKeyResponse | ErrorsList | None: """Retrieves an API key Retrieves a specific API key by its UUID. Returns key metadata including name, kind, expiration, diff --git a/rootly_sdk/api/api_keys/list_api_keys.py b/rootly_sdk/api/api_keys/list_api_keys.py index 83cd1e6d..2c8322c6 100644 --- a/rootly_sdk/api/api_keys/list_api_keys.py +++ b/rootly_sdk/api/api_keys/list_api_keys.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -12,30 +12,30 @@ def _get_kwargs( *, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterkind: Union[Unset, str] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filteruser_id: Union[Unset, str] = UNSET, - filtergroup_ids: Union[Unset, str] = UNSET, - filterrole_id: Union[Unset, str] = UNSET, - filteractive: Union[Unset, bool] = UNSET, - filterexpired: Union[Unset, bool] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filterexpires_atgt: Union[Unset, str] = UNSET, - filterexpires_atgte: Union[Unset, str] = UNSET, - filterexpires_atlt: Union[Unset, str] = UNSET, - filterexpires_atlte: Union[Unset, str] = UNSET, - filterlast_used_atgt: Union[Unset, str] = UNSET, - filterlast_used_atgte: Union[Unset, str] = UNSET, - filterlast_used_atlt: Union[Unset, str] = UNSET, - filterlast_used_atlte: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterkind: Unset | str = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filteruser_id: Unset | str = UNSET, + filtergroup_ids: Unset | str = UNSET, + filterrole_id: Unset | str = UNSET, + filteractive: Unset | bool = UNSET, + filterexpired: Unset | bool = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterexpires_atgt: Unset | str = UNSET, + filterexpires_atgte: Unset | str = UNSET, + filterexpires_atlt: Unset | str = UNSET, + filterexpires_atlte: Unset | str = UNSET, + filterlast_used_atgt: Unset | str = UNSET, + filterlast_used_atgte: Unset | str = UNSET, + filterlast_used_atlt: Unset | str = UNSET, + filterlast_used_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -99,8 +99,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ApiKeyList, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiKeyList | ErrorsList | None: if response.status_code == 200: response_200 = ApiKeyList.from_dict(response.json()) @@ -118,8 +118,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ApiKeyList, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ApiKeyList | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -131,31 +131,31 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterkind: Union[Unset, str] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filteruser_id: Union[Unset, str] = UNSET, - filtergroup_ids: Union[Unset, str] = UNSET, - filterrole_id: Union[Unset, str] = UNSET, - filteractive: Union[Unset, bool] = UNSET, - filterexpired: Union[Unset, bool] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filterexpires_atgt: Union[Unset, str] = UNSET, - filterexpires_atgte: Union[Unset, str] = UNSET, - filterexpires_atlt: Union[Unset, str] = UNSET, - filterexpires_atlte: Union[Unset, str] = UNSET, - filterlast_used_atgt: Union[Unset, str] = UNSET, - filterlast_used_atgte: Union[Unset, str] = UNSET, - filterlast_used_atlt: Union[Unset, str] = UNSET, - filterlast_used_atlte: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, -) -> Response[Union[ApiKeyList, ErrorsList]]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterkind: Unset | str = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filteruser_id: Unset | str = UNSET, + filtergroup_ids: Unset | str = UNSET, + filterrole_id: Unset | str = UNSET, + filteractive: Unset | bool = UNSET, + filterexpired: Unset | bool = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterexpires_atgt: Unset | str = UNSET, + filterexpires_atgte: Unset | str = UNSET, + filterexpires_atlt: Unset | str = UNSET, + filterexpires_atlte: Unset | str = UNSET, + filterlast_used_atgt: Unset | str = UNSET, + filterlast_used_atgte: Unset | str = UNSET, + filterlast_used_atlt: Unset | str = UNSET, + filterlast_used_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, +) -> Response[ApiKeyList | ErrorsList]: """List API keys List API keys for the current organization. Returns key metadata including name, kind, expiration, @@ -247,31 +247,31 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterkind: Union[Unset, str] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filteruser_id: Union[Unset, str] = UNSET, - filtergroup_ids: Union[Unset, str] = UNSET, - filterrole_id: Union[Unset, str] = UNSET, - filteractive: Union[Unset, bool] = UNSET, - filterexpired: Union[Unset, bool] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filterexpires_atgt: Union[Unset, str] = UNSET, - filterexpires_atgte: Union[Unset, str] = UNSET, - filterexpires_atlt: Union[Unset, str] = UNSET, - filterexpires_atlte: Union[Unset, str] = UNSET, - filterlast_used_atgt: Union[Unset, str] = UNSET, - filterlast_used_atgte: Union[Unset, str] = UNSET, - filterlast_used_atlt: Union[Unset, str] = UNSET, - filterlast_used_atlte: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, -) -> Optional[Union[ApiKeyList, ErrorsList]]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterkind: Unset | str = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filteruser_id: Unset | str = UNSET, + filtergroup_ids: Unset | str = UNSET, + filterrole_id: Unset | str = UNSET, + filteractive: Unset | bool = UNSET, + filterexpired: Unset | bool = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterexpires_atgt: Unset | str = UNSET, + filterexpires_atgte: Unset | str = UNSET, + filterexpires_atlt: Unset | str = UNSET, + filterexpires_atlte: Unset | str = UNSET, + filterlast_used_atgt: Unset | str = UNSET, + filterlast_used_atgte: Unset | str = UNSET, + filterlast_used_atlt: Unset | str = UNSET, + filterlast_used_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, +) -> ApiKeyList | ErrorsList | None: """List API keys List API keys for the current organization. Returns key metadata including name, kind, expiration, @@ -358,31 +358,31 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterkind: Union[Unset, str] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filteruser_id: Union[Unset, str] = UNSET, - filtergroup_ids: Union[Unset, str] = UNSET, - filterrole_id: Union[Unset, str] = UNSET, - filteractive: Union[Unset, bool] = UNSET, - filterexpired: Union[Unset, bool] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filterexpires_atgt: Union[Unset, str] = UNSET, - filterexpires_atgte: Union[Unset, str] = UNSET, - filterexpires_atlt: Union[Unset, str] = UNSET, - filterexpires_atlte: Union[Unset, str] = UNSET, - filterlast_used_atgt: Union[Unset, str] = UNSET, - filterlast_used_atgte: Union[Unset, str] = UNSET, - filterlast_used_atlt: Union[Unset, str] = UNSET, - filterlast_used_atlte: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, -) -> Response[Union[ApiKeyList, ErrorsList]]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterkind: Unset | str = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filteruser_id: Unset | str = UNSET, + filtergroup_ids: Unset | str = UNSET, + filterrole_id: Unset | str = UNSET, + filteractive: Unset | bool = UNSET, + filterexpired: Unset | bool = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterexpires_atgt: Unset | str = UNSET, + filterexpires_atgte: Unset | str = UNSET, + filterexpires_atlt: Unset | str = UNSET, + filterexpires_atlte: Unset | str = UNSET, + filterlast_used_atgt: Unset | str = UNSET, + filterlast_used_atgte: Unset | str = UNSET, + filterlast_used_atlt: Unset | str = UNSET, + filterlast_used_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, +) -> Response[ApiKeyList | ErrorsList]: """List API keys List API keys for the current organization. Returns key metadata including name, kind, expiration, @@ -472,31 +472,31 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterkind: Union[Unset, str] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filteruser_id: Union[Unset, str] = UNSET, - filtergroup_ids: Union[Unset, str] = UNSET, - filterrole_id: Union[Unset, str] = UNSET, - filteractive: Union[Unset, bool] = UNSET, - filterexpired: Union[Unset, bool] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filterexpires_atgt: Union[Unset, str] = UNSET, - filterexpires_atgte: Union[Unset, str] = UNSET, - filterexpires_atlt: Union[Unset, str] = UNSET, - filterexpires_atlte: Union[Unset, str] = UNSET, - filterlast_used_atgt: Union[Unset, str] = UNSET, - filterlast_used_atgte: Union[Unset, str] = UNSET, - filterlast_used_atlt: Union[Unset, str] = UNSET, - filterlast_used_atlte: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, -) -> Optional[Union[ApiKeyList, ErrorsList]]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterkind: Unset | str = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filteruser_id: Unset | str = UNSET, + filtergroup_ids: Unset | str = UNSET, + filterrole_id: Unset | str = UNSET, + filteractive: Unset | bool = UNSET, + filterexpired: Unset | bool = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterexpires_atgt: Unset | str = UNSET, + filterexpires_atgte: Unset | str = UNSET, + filterexpires_atlt: Unset | str = UNSET, + filterexpires_atlte: Unset | str = UNSET, + filterlast_used_atgt: Unset | str = UNSET, + filterlast_used_atgte: Unset | str = UNSET, + filterlast_used_atlt: Unset | str = UNSET, + filterlast_used_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, +) -> ApiKeyList | ErrorsList | None: """List API keys List API keys for the current organization. Returns key metadata including name, kind, expiration, diff --git a/rootly_sdk/api/api_keys/rotate_api_key.py b/rootly_sdk/api/api_keys/rotate_api_key.py index e49584eb..7fff187b 100644 --- a/rootly_sdk/api/api_keys/rotate_api_key.py +++ b/rootly_sdk/api/api_keys/rotate_api_key.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ApiKeyWithTokenResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiKeyWithTokenResponse | ErrorsList | None: if response.status_code == 200: response_200 = ApiKeyWithTokenResponse.from_dict(response.json()) @@ -51,8 +51,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ApiKeyWithTokenResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ApiKeyWithTokenResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: RotateApiKey, -) -> Response[Union[ApiKeyWithTokenResponse, ErrorsList]]: +) -> Response[ApiKeyWithTokenResponse | ErrorsList]: """Rotate an API key Rotate an API key's token. Issues a new secret token and returns it — **the new token is only shown @@ -119,7 +119,7 @@ def sync( *, client: AuthenticatedClient, body: RotateApiKey, -) -> Optional[Union[ApiKeyWithTokenResponse, ErrorsList]]: +) -> ApiKeyWithTokenResponse | ErrorsList | None: """Rotate an API key Rotate an API key's token. Issues a new secret token and returns it — **the new token is only shown @@ -167,7 +167,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: RotateApiKey, -) -> Response[Union[ApiKeyWithTokenResponse, ErrorsList]]: +) -> Response[ApiKeyWithTokenResponse | ErrorsList]: """Rotate an API key Rotate an API key's token. Issues a new secret token and returns it — **the new token is only shown @@ -218,7 +218,7 @@ async def asyncio( *, client: AuthenticatedClient, body: RotateApiKey, -) -> Optional[Union[ApiKeyWithTokenResponse, ErrorsList]]: +) -> ApiKeyWithTokenResponse | ErrorsList | None: """Rotate an API key Rotate an API key's token. Issues a new secret token and returns it — **the new token is only shown diff --git a/rootly_sdk/api/api_keys/update_api_key.py b/rootly_sdk/api/api_keys/update_api_key.py index 4ceb9e2b..1411b1d1 100644 --- a/rootly_sdk/api/api_keys/update_api_key.py +++ b/rootly_sdk/api/api_keys/update_api_key.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any from uuid import UUID import httpx @@ -33,8 +33,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ApiKeyResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiKeyResponse | ErrorsList | None: if response.status_code == 200: response_200 = ApiKeyResponse.from_dict(response.json()) @@ -52,8 +52,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ApiKeyResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ApiKeyResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -67,7 +67,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateApiKey, -) -> Response[Union[ApiKeyResponse, ErrorsList]]: +) -> Response[ApiKeyResponse | ErrorsList]: """Update an API key Update an API key's mutable attributes: `name`, `description`, and `expires_at`. @@ -107,7 +107,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateApiKey, -) -> Optional[Union[ApiKeyResponse, ErrorsList]]: +) -> ApiKeyResponse | ErrorsList | None: """Update an API key Update an API key's mutable attributes: `name`, `description`, and `expires_at`. @@ -142,7 +142,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateApiKey, -) -> Response[Union[ApiKeyResponse, ErrorsList]]: +) -> Response[ApiKeyResponse | ErrorsList]: """Update an API key Update an API key's mutable attributes: `name`, `description`, and `expires_at`. @@ -180,7 +180,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateApiKey, -) -> Optional[Union[ApiKeyResponse, ErrorsList]]: +) -> ApiKeyResponse | ErrorsList | None: """Update an API key Update an API key's mutable attributes: `name`, `description`, and `expires_at`. diff --git a/rootly_sdk/api/audits/list_audits.py b/rootly_sdk/api/audits/list_audits.py index 9fc427af..4bca1146 100644 --- a/rootly_sdk/api/audits/list_audits.py +++ b/rootly_sdk/api/audits/list_audits.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -11,34 +11,34 @@ def _get_kwargs( *, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filteruser_id: Union[Unset, str] = UNSET, - filterapi_key_id: Union[Unset, str] = UNSET, - filtersource: Union[Unset, str] = UNSET, - filteritem_type: Union[Unset, str] = UNSET, - filteruser_ideq: Union[Unset, str] = UNSET, - filteruser_idnot_eq: Union[Unset, str] = UNSET, - filteruser_idin: Union[Unset, str] = UNSET, - filteruser_idnot_in: Union[Unset, str] = UNSET, - filterapi_key_ideq: Union[Unset, str] = UNSET, - filterapi_key_idnot_eq: Union[Unset, str] = UNSET, - filterapi_key_idin: Union[Unset, str] = UNSET, - filterapi_key_idnot_in: Union[Unset, str] = UNSET, - filtersourceeq: Union[Unset, str] = UNSET, - filtersourcenot_eq: Union[Unset, str] = UNSET, - filtersourcein: Union[Unset, str] = UNSET, - filtersourcenot_in: Union[Unset, str] = UNSET, - filteritem_typeeq: Union[Unset, str] = UNSET, - filteritem_typenot_eq: Union[Unset, str] = UNSET, - filteritem_typein: Union[Unset, str] = UNSET, - filteritem_typenot_in: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filteruser_id: Unset | str = UNSET, + filterapi_key_id: Unset | str = UNSET, + filtersource: Unset | str = UNSET, + filteritem_type: Unset | str = UNSET, + filteruser_ideq: Unset | str = UNSET, + filteruser_idnot_eq: Unset | str = UNSET, + filteruser_idin: Unset | str = UNSET, + filteruser_idnot_in: Unset | str = UNSET, + filterapi_key_ideq: Unset | str = UNSET, + filterapi_key_idnot_eq: Unset | str = UNSET, + filterapi_key_idin: Unset | str = UNSET, + filterapi_key_idnot_in: Unset | str = UNSET, + filtersourceeq: Unset | str = UNSET, + filtersourcenot_eq: Unset | str = UNSET, + filtersourcein: Unset | str = UNSET, + filtersourcenot_in: Unset | str = UNSET, + filteritem_typeeq: Unset | str = UNSET, + filteritem_typenot_eq: Unset | str = UNSET, + filteritem_typein: Unset | str = UNSET, + filteritem_typenot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -109,7 +109,7 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[AuditsList]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> AuditsList | None: if response.status_code == 200: response_200 = AuditsList.from_dict(response.json()) @@ -121,7 +121,7 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[AuditsList]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[AuditsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -133,34 +133,34 @@ def _build_response(*, client: Union[AuthenticatedClient, Client], response: htt def sync_detailed( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filteruser_id: Union[Unset, str] = UNSET, - filterapi_key_id: Union[Unset, str] = UNSET, - filtersource: Union[Unset, str] = UNSET, - filteritem_type: Union[Unset, str] = UNSET, - filteruser_ideq: Union[Unset, str] = UNSET, - filteruser_idnot_eq: Union[Unset, str] = UNSET, - filteruser_idin: Union[Unset, str] = UNSET, - filteruser_idnot_in: Union[Unset, str] = UNSET, - filterapi_key_ideq: Union[Unset, str] = UNSET, - filterapi_key_idnot_eq: Union[Unset, str] = UNSET, - filterapi_key_idin: Union[Unset, str] = UNSET, - filterapi_key_idnot_in: Union[Unset, str] = UNSET, - filtersourceeq: Union[Unset, str] = UNSET, - filtersourcenot_eq: Union[Unset, str] = UNSET, - filtersourcein: Union[Unset, str] = UNSET, - filtersourcenot_in: Union[Unset, str] = UNSET, - filteritem_typeeq: Union[Unset, str] = UNSET, - filteritem_typenot_eq: Union[Unset, str] = UNSET, - filteritem_typein: Union[Unset, str] = UNSET, - filteritem_typenot_in: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filteruser_id: Unset | str = UNSET, + filterapi_key_id: Unset | str = UNSET, + filtersource: Unset | str = UNSET, + filteritem_type: Unset | str = UNSET, + filteruser_ideq: Unset | str = UNSET, + filteruser_idnot_eq: Unset | str = UNSET, + filteruser_idin: Unset | str = UNSET, + filteruser_idnot_in: Unset | str = UNSET, + filterapi_key_ideq: Unset | str = UNSET, + filterapi_key_idnot_eq: Unset | str = UNSET, + filterapi_key_idin: Unset | str = UNSET, + filterapi_key_idnot_in: Unset | str = UNSET, + filtersourceeq: Unset | str = UNSET, + filtersourcenot_eq: Unset | str = UNSET, + filtersourcein: Unset | str = UNSET, + filtersourcenot_in: Unset | str = UNSET, + filteritem_typeeq: Unset | str = UNSET, + filteritem_typenot_eq: Unset | str = UNSET, + filteritem_typein: Unset | str = UNSET, + filteritem_typenot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[AuditsList]: """List audits @@ -245,35 +245,35 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filteruser_id: Union[Unset, str] = UNSET, - filterapi_key_id: Union[Unset, str] = UNSET, - filtersource: Union[Unset, str] = UNSET, - filteritem_type: Union[Unset, str] = UNSET, - filteruser_ideq: Union[Unset, str] = UNSET, - filteruser_idnot_eq: Union[Unset, str] = UNSET, - filteruser_idin: Union[Unset, str] = UNSET, - filteruser_idnot_in: Union[Unset, str] = UNSET, - filterapi_key_ideq: Union[Unset, str] = UNSET, - filterapi_key_idnot_eq: Union[Unset, str] = UNSET, - filterapi_key_idin: Union[Unset, str] = UNSET, - filterapi_key_idnot_in: Union[Unset, str] = UNSET, - filtersourceeq: Union[Unset, str] = UNSET, - filtersourcenot_eq: Union[Unset, str] = UNSET, - filtersourcein: Union[Unset, str] = UNSET, - filtersourcenot_in: Union[Unset, str] = UNSET, - filteritem_typeeq: Union[Unset, str] = UNSET, - filteritem_typenot_eq: Union[Unset, str] = UNSET, - filteritem_typein: Union[Unset, str] = UNSET, - filteritem_typenot_in: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, -) -> Optional[AuditsList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filteruser_id: Unset | str = UNSET, + filterapi_key_id: Unset | str = UNSET, + filtersource: Unset | str = UNSET, + filteritem_type: Unset | str = UNSET, + filteruser_ideq: Unset | str = UNSET, + filteruser_idnot_eq: Unset | str = UNSET, + filteruser_idin: Unset | str = UNSET, + filteruser_idnot_in: Unset | str = UNSET, + filterapi_key_ideq: Unset | str = UNSET, + filterapi_key_idnot_eq: Unset | str = UNSET, + filterapi_key_idin: Unset | str = UNSET, + filterapi_key_idnot_in: Unset | str = UNSET, + filtersourceeq: Unset | str = UNSET, + filtersourcenot_eq: Unset | str = UNSET, + filtersourcein: Unset | str = UNSET, + filtersourcenot_in: Unset | str = UNSET, + filteritem_typeeq: Unset | str = UNSET, + filteritem_typenot_eq: Unset | str = UNSET, + filteritem_typein: Unset | str = UNSET, + filteritem_typenot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, +) -> AuditsList | None: """List audits List audits @@ -352,34 +352,34 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filteruser_id: Union[Unset, str] = UNSET, - filterapi_key_id: Union[Unset, str] = UNSET, - filtersource: Union[Unset, str] = UNSET, - filteritem_type: Union[Unset, str] = UNSET, - filteruser_ideq: Union[Unset, str] = UNSET, - filteruser_idnot_eq: Union[Unset, str] = UNSET, - filteruser_idin: Union[Unset, str] = UNSET, - filteruser_idnot_in: Union[Unset, str] = UNSET, - filterapi_key_ideq: Union[Unset, str] = UNSET, - filterapi_key_idnot_eq: Union[Unset, str] = UNSET, - filterapi_key_idin: Union[Unset, str] = UNSET, - filterapi_key_idnot_in: Union[Unset, str] = UNSET, - filtersourceeq: Union[Unset, str] = UNSET, - filtersourcenot_eq: Union[Unset, str] = UNSET, - filtersourcein: Union[Unset, str] = UNSET, - filtersourcenot_in: Union[Unset, str] = UNSET, - filteritem_typeeq: Union[Unset, str] = UNSET, - filteritem_typenot_eq: Union[Unset, str] = UNSET, - filteritem_typein: Union[Unset, str] = UNSET, - filteritem_typenot_in: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filteruser_id: Unset | str = UNSET, + filterapi_key_id: Unset | str = UNSET, + filtersource: Unset | str = UNSET, + filteritem_type: Unset | str = UNSET, + filteruser_ideq: Unset | str = UNSET, + filteruser_idnot_eq: Unset | str = UNSET, + filteruser_idin: Unset | str = UNSET, + filteruser_idnot_in: Unset | str = UNSET, + filterapi_key_ideq: Unset | str = UNSET, + filterapi_key_idnot_eq: Unset | str = UNSET, + filterapi_key_idin: Unset | str = UNSET, + filterapi_key_idnot_in: Unset | str = UNSET, + filtersourceeq: Unset | str = UNSET, + filtersourcenot_eq: Unset | str = UNSET, + filtersourcein: Unset | str = UNSET, + filtersourcenot_in: Unset | str = UNSET, + filteritem_typeeq: Unset | str = UNSET, + filteritem_typenot_eq: Unset | str = UNSET, + filteritem_typein: Unset | str = UNSET, + filteritem_typenot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[AuditsList]: """List audits @@ -462,35 +462,35 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filteruser_id: Union[Unset, str] = UNSET, - filterapi_key_id: Union[Unset, str] = UNSET, - filtersource: Union[Unset, str] = UNSET, - filteritem_type: Union[Unset, str] = UNSET, - filteruser_ideq: Union[Unset, str] = UNSET, - filteruser_idnot_eq: Union[Unset, str] = UNSET, - filteruser_idin: Union[Unset, str] = UNSET, - filteruser_idnot_in: Union[Unset, str] = UNSET, - filterapi_key_ideq: Union[Unset, str] = UNSET, - filterapi_key_idnot_eq: Union[Unset, str] = UNSET, - filterapi_key_idin: Union[Unset, str] = UNSET, - filterapi_key_idnot_in: Union[Unset, str] = UNSET, - filtersourceeq: Union[Unset, str] = UNSET, - filtersourcenot_eq: Union[Unset, str] = UNSET, - filtersourcein: Union[Unset, str] = UNSET, - filtersourcenot_in: Union[Unset, str] = UNSET, - filteritem_typeeq: Union[Unset, str] = UNSET, - filteritem_typenot_eq: Union[Unset, str] = UNSET, - filteritem_typein: Union[Unset, str] = UNSET, - filteritem_typenot_in: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, -) -> Optional[AuditsList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filteruser_id: Unset | str = UNSET, + filterapi_key_id: Unset | str = UNSET, + filtersource: Unset | str = UNSET, + filteritem_type: Unset | str = UNSET, + filteruser_ideq: Unset | str = UNSET, + filteruser_idnot_eq: Unset | str = UNSET, + filteruser_idin: Unset | str = UNSET, + filteruser_idnot_in: Unset | str = UNSET, + filterapi_key_ideq: Unset | str = UNSET, + filterapi_key_idnot_eq: Unset | str = UNSET, + filterapi_key_idin: Unset | str = UNSET, + filterapi_key_idnot_in: Unset | str = UNSET, + filtersourceeq: Unset | str = UNSET, + filtersourcenot_eq: Unset | str = UNSET, + filtersourcein: Unset | str = UNSET, + filtersourcenot_in: Unset | str = UNSET, + filteritem_typeeq: Unset | str = UNSET, + filteritem_typenot_eq: Unset | str = UNSET, + filteritem_typein: Unset | str = UNSET, + filteritem_typenot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, +) -> AuditsList | None: """List audits List audits diff --git a/rootly_sdk/api/authorizations/create_authorization.py b/rootly_sdk/api/authorizations/create_authorization.py index 3d6f1257..42583829 100644 --- a/rootly_sdk/api/authorizations/create_authorization.py +++ b/rootly_sdk/api/authorizations/create_authorization.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[AuthorizationResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> AuthorizationResponse | ErrorsList | None: if response.status_code == 201: response_201 = AuthorizationResponse.from_dict(response.json()) @@ -50,8 +50,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[AuthorizationResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[AuthorizationResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -64,7 +64,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewAuthorization, -) -> Response[Union[AuthorizationResponse, ErrorsList]]: +) -> Response[AuthorizationResponse | ErrorsList]: """Creates an authorization Creates a new authorization from provided data @@ -95,7 +95,7 @@ def sync( *, client: AuthenticatedClient, body: NewAuthorization, -) -> Optional[Union[AuthorizationResponse, ErrorsList]]: +) -> AuthorizationResponse | ErrorsList | None: """Creates an authorization Creates a new authorization from provided data @@ -121,7 +121,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewAuthorization, -) -> Response[Union[AuthorizationResponse, ErrorsList]]: +) -> Response[AuthorizationResponse | ErrorsList]: """Creates an authorization Creates a new authorization from provided data @@ -150,7 +150,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewAuthorization, -) -> Optional[Union[AuthorizationResponse, ErrorsList]]: +) -> AuthorizationResponse | ErrorsList | None: """Creates an authorization Creates a new authorization from provided data diff --git a/rootly_sdk/api/authorizations/delete_authorization.py b/rootly_sdk/api/authorizations/delete_authorization.py index 00afe7d4..bfe0dd26 100644 --- a/rootly_sdk/api/authorizations/delete_authorization.py +++ b/rootly_sdk/api/authorizations/delete_authorization.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[AuthorizationResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> AuthorizationResponse | ErrorsList | None: if response.status_code == 200: response_200 = AuthorizationResponse.from_dict(response.json()) @@ -41,8 +41,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[AuthorizationResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[AuthorizationResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -55,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[AuthorizationResponse, ErrorsList]]: +) -> Response[AuthorizationResponse | ErrorsList]: """Delete an authorization Delete a specific authorization by id @@ -86,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[AuthorizationResponse, ErrorsList]]: +) -> AuthorizationResponse | ErrorsList | None: """Delete an authorization Delete a specific authorization by id @@ -112,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[AuthorizationResponse, ErrorsList]]: +) -> Response[AuthorizationResponse | ErrorsList]: """Delete an authorization Delete a specific authorization by id @@ -141,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[AuthorizationResponse, ErrorsList]]: +) -> AuthorizationResponse | ErrorsList | None: """Delete an authorization Delete a specific authorization by id diff --git a/rootly_sdk/api/authorizations/get_authorization.py b/rootly_sdk/api/authorizations/get_authorization.py index e54e9d6f..f715f915 100644 --- a/rootly_sdk/api/authorizations/get_authorization.py +++ b/rootly_sdk/api/authorizations/get_authorization.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[AuthorizationResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> AuthorizationResponse | ErrorsList | None: if response.status_code == 200: response_200 = AuthorizationResponse.from_dict(response.json()) @@ -41,8 +41,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[AuthorizationResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[AuthorizationResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -55,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[AuthorizationResponse, ErrorsList]]: +) -> Response[AuthorizationResponse | ErrorsList]: """Retrieves an authorization Retrieves a specific authorization by id @@ -86,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[AuthorizationResponse, ErrorsList]]: +) -> AuthorizationResponse | ErrorsList | None: """Retrieves an authorization Retrieves a specific authorization by id @@ -112,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[AuthorizationResponse, ErrorsList]]: +) -> Response[AuthorizationResponse | ErrorsList]: """Retrieves an authorization Retrieves a specific authorization by id @@ -141,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[AuthorizationResponse, ErrorsList]]: +) -> AuthorizationResponse | ErrorsList | None: """Retrieves an authorization Retrieves a specific authorization by id diff --git a/rootly_sdk/api/authorizations/list_authorizations.py b/rootly_sdk/api/authorizations/list_authorizations.py index 7877045f..a5da47f3 100644 --- a/rootly_sdk/api/authorizations/list_authorizations.py +++ b/rootly_sdk/api/authorizations/list_authorizations.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -11,18 +11,18 @@ def _get_kwargs( *, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterauthorizable_id: Union[Unset, str] = UNSET, - filterauthorizable_type: Union[Unset, str] = UNSET, - filtergrantee_id: Union[Unset, str] = UNSET, - filtergrantee_type: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterauthorizable_id: Unset | str = UNSET, + filterauthorizable_type: Unset | str = UNSET, + filtergrantee_id: Unset | str = UNSET, + filtergrantee_type: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -61,9 +61,7 @@ def _get_kwargs( return _kwargs -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[AuthorizationList]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> AuthorizationList | None: if response.status_code == 200: response_200 = AuthorizationList.from_dict(response.json()) @@ -75,9 +73,7 @@ def _parse_response( return None -def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[AuthorizationList]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[AuthorizationList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -89,18 +85,18 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterauthorizable_id: Union[Unset, str] = UNSET, - filterauthorizable_type: Union[Unset, str] = UNSET, - filtergrantee_id: Union[Unset, str] = UNSET, - filtergrantee_type: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterauthorizable_id: Unset | str = UNSET, + filterauthorizable_type: Unset | str = UNSET, + filtergrantee_id: Unset | str = UNSET, + filtergrantee_type: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[AuthorizationList]: """List authorizations @@ -153,19 +149,19 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterauthorizable_id: Union[Unset, str] = UNSET, - filterauthorizable_type: Union[Unset, str] = UNSET, - filtergrantee_id: Union[Unset, str] = UNSET, - filtergrantee_type: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, -) -> Optional[AuthorizationList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterauthorizable_id: Unset | str = UNSET, + filterauthorizable_type: Unset | str = UNSET, + filtergrantee_id: Unset | str = UNSET, + filtergrantee_type: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, +) -> AuthorizationList | None: """List authorizations List authorizations @@ -212,18 +208,18 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterauthorizable_id: Union[Unset, str] = UNSET, - filterauthorizable_type: Union[Unset, str] = UNSET, - filtergrantee_id: Union[Unset, str] = UNSET, - filtergrantee_type: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterauthorizable_id: Unset | str = UNSET, + filterauthorizable_type: Unset | str = UNSET, + filtergrantee_id: Unset | str = UNSET, + filtergrantee_type: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[AuthorizationList]: """List authorizations @@ -274,19 +270,19 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterauthorizable_id: Union[Unset, str] = UNSET, - filterauthorizable_type: Union[Unset, str] = UNSET, - filtergrantee_id: Union[Unset, str] = UNSET, - filtergrantee_type: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, -) -> Optional[AuthorizationList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterauthorizable_id: Unset | str = UNSET, + filterauthorizable_type: Unset | str = UNSET, + filtergrantee_id: Unset | str = UNSET, + filtergrantee_type: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, +) -> AuthorizationList | None: """List authorizations List authorizations diff --git a/rootly_sdk/api/authorizations/update_authorization.py b/rootly_sdk/api/authorizations/update_authorization.py index d5e4d6d3..67dfa1c8 100644 --- a/rootly_sdk/api/authorizations/update_authorization.py +++ b/rootly_sdk/api/authorizations/update_authorization.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[AuthorizationResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> AuthorizationResponse | ErrorsList | None: if response.status_code == 200: response_200 = AuthorizationResponse.from_dict(response.json()) @@ -51,8 +51,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[AuthorizationResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[AuthorizationResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateAuthorization, -) -> Response[Union[AuthorizationResponse, ErrorsList]]: +) -> Response[AuthorizationResponse | ErrorsList]: """Update an authorization Update a specific authorization by id @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateAuthorization, -) -> Optional[Union[AuthorizationResponse, ErrorsList]]: +) -> AuthorizationResponse | ErrorsList | None: """Update an authorization Update a specific authorization by id @@ -129,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateAuthorization, -) -> Response[Union[AuthorizationResponse, ErrorsList]]: +) -> Response[AuthorizationResponse | ErrorsList]: """Update an authorization Update a specific authorization by id @@ -161,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateAuthorization, -) -> Optional[Union[AuthorizationResponse, ErrorsList]]: +) -> AuthorizationResponse | ErrorsList | None: """Update an authorization Update a specific authorization by id diff --git a/rootly_sdk/api/catalog_checklist_templates/create_catalog_checklist_template.py b/rootly_sdk/api/catalog_checklist_templates/create_catalog_checklist_template.py index e28bb282..a78ecfc4 100644 --- a/rootly_sdk/api/catalog_checklist_templates/create_catalog_checklist_template.py +++ b/rootly_sdk/api/catalog_checklist_templates/create_catalog_checklist_template.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[CatalogChecklistTemplateResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CatalogChecklistTemplateResponse | ErrorsList | None: if response.status_code == 201: response_201 = CatalogChecklistTemplateResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[CatalogChecklistTemplateResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[CatalogChecklistTemplateResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +69,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewCatalogChecklistTemplate, -) -> Response[Union[CatalogChecklistTemplateResponse, ErrorsList]]: +) -> Response[CatalogChecklistTemplateResponse | ErrorsList]: """Creates a catalog checklist template Creates a new catalog checklist template @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: NewCatalogChecklistTemplate, -) -> Optional[Union[CatalogChecklistTemplateResponse, ErrorsList]]: +) -> CatalogChecklistTemplateResponse | ErrorsList | None: """Creates a catalog checklist template Creates a new catalog checklist template @@ -126,7 +126,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewCatalogChecklistTemplate, -) -> Response[Union[CatalogChecklistTemplateResponse, ErrorsList]]: +) -> Response[CatalogChecklistTemplateResponse | ErrorsList]: """Creates a catalog checklist template Creates a new catalog checklist template @@ -155,7 +155,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewCatalogChecklistTemplate, -) -> Optional[Union[CatalogChecklistTemplateResponse, ErrorsList]]: +) -> CatalogChecklistTemplateResponse | ErrorsList | None: """Creates a catalog checklist template Creates a new catalog checklist template diff --git a/rootly_sdk/api/catalog_checklist_templates/delete_catalog_checklist_template.py b/rootly_sdk/api/catalog_checklist_templates/delete_catalog_checklist_template.py index f4b0be89..8dabe3aa 100644 --- a/rootly_sdk/api/catalog_checklist_templates/delete_catalog_checklist_template.py +++ b/rootly_sdk/api/catalog_checklist_templates/delete_catalog_checklist_template.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any from uuid import UUID import httpx @@ -12,7 +12,7 @@ def _get_kwargs( - id: Union[UUID, str], + id: UUID | str, ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "delete", @@ -23,8 +23,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[CatalogChecklistTemplateResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CatalogChecklistTemplateResponse | ErrorsList | None: if response.status_code == 200: response_200 = CatalogChecklistTemplateResponse.from_dict(response.json()) @@ -42,8 +42,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[CatalogChecklistTemplateResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[CatalogChecklistTemplateResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -53,10 +53,10 @@ def _build_response( def sync_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Response[Union[CatalogChecklistTemplateResponse, ErrorsList]]: +) -> Response[CatalogChecklistTemplateResponse | ErrorsList]: """Delete a catalog checklist template Delete a specific catalog checklist template by id @@ -84,10 +84,10 @@ def sync_detailed( def sync( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Optional[Union[CatalogChecklistTemplateResponse, ErrorsList]]: +) -> CatalogChecklistTemplateResponse | ErrorsList | None: """Delete a catalog checklist template Delete a specific catalog checklist template by id @@ -110,10 +110,10 @@ def sync( async def asyncio_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Response[Union[CatalogChecklistTemplateResponse, ErrorsList]]: +) -> Response[CatalogChecklistTemplateResponse | ErrorsList]: """Delete a catalog checklist template Delete a specific catalog checklist template by id @@ -139,10 +139,10 @@ async def asyncio_detailed( async def asyncio( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Optional[Union[CatalogChecklistTemplateResponse, ErrorsList]]: +) -> CatalogChecklistTemplateResponse | ErrorsList | None: """Delete a catalog checklist template Delete a specific catalog checklist template by id diff --git a/rootly_sdk/api/catalog_checklist_templates/get_catalog_checklist_template.py b/rootly_sdk/api/catalog_checklist_templates/get_catalog_checklist_template.py index e4ef31cd..7b09302b 100644 --- a/rootly_sdk/api/catalog_checklist_templates/get_catalog_checklist_template.py +++ b/rootly_sdk/api/catalog_checklist_templates/get_catalog_checklist_template.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any from uuid import UUID import httpx @@ -12,7 +12,7 @@ def _get_kwargs( - id: Union[UUID, str], + id: UUID | str, ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "get", @@ -23,8 +23,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[CatalogChecklistTemplateResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CatalogChecklistTemplateResponse | ErrorsList | None: if response.status_code == 200: response_200 = CatalogChecklistTemplateResponse.from_dict(response.json()) @@ -42,8 +42,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[CatalogChecklistTemplateResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[CatalogChecklistTemplateResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -53,10 +53,10 @@ def _build_response( def sync_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Response[Union[CatalogChecklistTemplateResponse, ErrorsList]]: +) -> Response[CatalogChecklistTemplateResponse | ErrorsList]: """Retrieves a catalog checklist template Retrieves a specific catalog checklist template by id @@ -84,10 +84,10 @@ def sync_detailed( def sync( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Optional[Union[CatalogChecklistTemplateResponse, ErrorsList]]: +) -> CatalogChecklistTemplateResponse | ErrorsList | None: """Retrieves a catalog checklist template Retrieves a specific catalog checklist template by id @@ -110,10 +110,10 @@ def sync( async def asyncio_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Response[Union[CatalogChecklistTemplateResponse, ErrorsList]]: +) -> Response[CatalogChecklistTemplateResponse | ErrorsList]: """Retrieves a catalog checklist template Retrieves a specific catalog checklist template by id @@ -139,10 +139,10 @@ async def asyncio_detailed( async def asyncio( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Optional[Union[CatalogChecklistTemplateResponse, ErrorsList]]: +) -> CatalogChecklistTemplateResponse | ErrorsList | None: """Retrieves a catalog checklist template Retrieves a specific catalog checklist template by id diff --git a/rootly_sdk/api/catalog_checklist_templates/list_catalog_checklist_templates.py b/rootly_sdk/api/catalog_checklist_templates/list_catalog_checklist_templates.py index c36c8ac8..3201e961 100644 --- a/rootly_sdk/api/catalog_checklist_templates/list_catalog_checklist_templates.py +++ b/rootly_sdk/api/catalog_checklist_templates/list_catalog_checklist_templates.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -17,28 +17,28 @@ def _get_kwargs( *, - include: Union[Unset, ListCatalogChecklistTemplatesInclude] = UNSET, - sort: Union[Unset, ListCatalogChecklistTemplatesSort] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtercatalog_type: Union[Unset, str] = UNSET, - filterscope_type: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, + include: Unset | ListCatalogChecklistTemplatesInclude = UNSET, + sort: Unset | ListCatalogChecklistTemplatesSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtercatalog_type: Unset | str = UNSET, + filterscope_type: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} - json_include: Union[Unset, str] = UNSET + json_include: Unset | str = UNSET if not isinstance(include, Unset): json_include = include params["include"] = json_include - json_sort: Union[Unset, str] = UNSET + json_sort: Unset | str = UNSET if not isinstance(sort, Unset): json_sort = sort @@ -76,8 +76,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[CatalogChecklistTemplateList]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CatalogChecklistTemplateList | None: if response.status_code == 200: response_200 = CatalogChecklistTemplateList.from_dict(response.json()) @@ -90,7 +90,7 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response + *, client: AuthenticatedClient | Client, response: httpx.Response ) -> Response[CatalogChecklistTemplateList]: return Response( status_code=HTTPStatus(response.status_code), @@ -103,18 +103,18 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - include: Union[Unset, ListCatalogChecklistTemplatesInclude] = UNSET, - sort: Union[Unset, ListCatalogChecklistTemplatesSort] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtercatalog_type: Union[Unset, str] = UNSET, - filterscope_type: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, + include: Unset | ListCatalogChecklistTemplatesInclude = UNSET, + sort: Unset | ListCatalogChecklistTemplatesSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtercatalog_type: Unset | str = UNSET, + filterscope_type: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> Response[CatalogChecklistTemplateList]: """List catalog checklist templates @@ -167,19 +167,19 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: Union[Unset, ListCatalogChecklistTemplatesInclude] = UNSET, - sort: Union[Unset, ListCatalogChecklistTemplatesSort] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtercatalog_type: Union[Unset, str] = UNSET, - filterscope_type: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, -) -> Optional[CatalogChecklistTemplateList]: + include: Unset | ListCatalogChecklistTemplatesInclude = UNSET, + sort: Unset | ListCatalogChecklistTemplatesSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtercatalog_type: Unset | str = UNSET, + filterscope_type: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, +) -> CatalogChecklistTemplateList | None: """List catalog checklist templates List catalog checklist templates @@ -226,18 +226,18 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: Union[Unset, ListCatalogChecklistTemplatesInclude] = UNSET, - sort: Union[Unset, ListCatalogChecklistTemplatesSort] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtercatalog_type: Union[Unset, str] = UNSET, - filterscope_type: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, + include: Unset | ListCatalogChecklistTemplatesInclude = UNSET, + sort: Unset | ListCatalogChecklistTemplatesSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtercatalog_type: Unset | str = UNSET, + filterscope_type: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> Response[CatalogChecklistTemplateList]: """List catalog checklist templates @@ -288,19 +288,19 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: Union[Unset, ListCatalogChecklistTemplatesInclude] = UNSET, - sort: Union[Unset, ListCatalogChecklistTemplatesSort] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtercatalog_type: Union[Unset, str] = UNSET, - filterscope_type: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, -) -> Optional[CatalogChecklistTemplateList]: + include: Unset | ListCatalogChecklistTemplatesInclude = UNSET, + sort: Unset | ListCatalogChecklistTemplatesSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtercatalog_type: Unset | str = UNSET, + filterscope_type: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, +) -> CatalogChecklistTemplateList | None: """List catalog checklist templates List catalog checklist templates diff --git a/rootly_sdk/api/catalog_checklist_templates/trigger_catalog_checklist_template.py b/rootly_sdk/api/catalog_checklist_templates/trigger_catalog_checklist_template.py index 47561a90..6d42ab1f 100644 --- a/rootly_sdk/api/catalog_checklist_templates/trigger_catalog_checklist_template.py +++ b/rootly_sdk/api/catalog_checklist_templates/trigger_catalog_checklist_template.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union, cast +from typing import Any, cast from uuid import UUID import httpx @@ -11,7 +11,7 @@ def _get_kwargs( - id: Union[UUID, str], + id: UUID | str, ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "post", @@ -21,9 +21,7 @@ def _get_kwargs( return _kwargs -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[Any, ErrorsList]]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Any | ErrorsList | None: if response.status_code == 202: response_202 = cast(Any, None) return response_202 @@ -39,9 +37,7 @@ def _parse_response( return None -def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[Any, ErrorsList]]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Any | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -51,10 +47,10 @@ def _build_response( def sync_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Response[Union[Any, ErrorsList]]: +) -> Response[Any | ErrorsList]: """Trigger an audit for a catalog checklist template Triggers an audit for all applicable entities of the checklist template @@ -82,10 +78,10 @@ def sync_detailed( def sync( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Optional[Union[Any, ErrorsList]]: +) -> Any | ErrorsList | None: """Trigger an audit for a catalog checklist template Triggers an audit for all applicable entities of the checklist template @@ -108,10 +104,10 @@ def sync( async def asyncio_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Response[Union[Any, ErrorsList]]: +) -> Response[Any | ErrorsList]: """Trigger an audit for a catalog checklist template Triggers an audit for all applicable entities of the checklist template @@ -137,10 +133,10 @@ async def asyncio_detailed( async def asyncio( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Optional[Union[Any, ErrorsList]]: +) -> Any | ErrorsList | None: """Trigger an audit for a catalog checklist template Triggers an audit for all applicable entities of the checklist template diff --git a/rootly_sdk/api/catalog_checklist_templates/update_catalog_checklist_template.py b/rootly_sdk/api/catalog_checklist_templates/update_catalog_checklist_template.py index 3a311850..23ee77cb 100644 --- a/rootly_sdk/api/catalog_checklist_templates/update_catalog_checklist_template.py +++ b/rootly_sdk/api/catalog_checklist_templates/update_catalog_checklist_template.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any from uuid import UUID import httpx @@ -13,7 +13,7 @@ def _get_kwargs( - id: Union[UUID, str], + id: UUID | str, *, body: UpdateCatalogChecklistTemplate, ) -> dict[str, Any]: @@ -33,8 +33,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[CatalogChecklistTemplateResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CatalogChecklistTemplateResponse | ErrorsList | None: if response.status_code == 200: response_200 = CatalogChecklistTemplateResponse.from_dict(response.json()) @@ -52,8 +52,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[CatalogChecklistTemplateResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[CatalogChecklistTemplateResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -63,11 +63,11 @@ def _build_response( def sync_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdateCatalogChecklistTemplate, -) -> Response[Union[CatalogChecklistTemplateResponse, ErrorsList]]: +) -> Response[CatalogChecklistTemplateResponse | ErrorsList]: """Update a catalog checklist template Update a specific catalog checklist template by id @@ -97,11 +97,11 @@ def sync_detailed( def sync( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdateCatalogChecklistTemplate, -) -> Optional[Union[CatalogChecklistTemplateResponse, ErrorsList]]: +) -> CatalogChecklistTemplateResponse | ErrorsList | None: """Update a catalog checklist template Update a specific catalog checklist template by id @@ -126,11 +126,11 @@ def sync( async def asyncio_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdateCatalogChecklistTemplate, -) -> Response[Union[CatalogChecklistTemplateResponse, ErrorsList]]: +) -> Response[CatalogChecklistTemplateResponse | ErrorsList]: """Update a catalog checklist template Update a specific catalog checklist template by id @@ -158,11 +158,11 @@ async def asyncio_detailed( async def asyncio( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdateCatalogChecklistTemplate, -) -> Optional[Union[CatalogChecklistTemplateResponse, ErrorsList]]: +) -> CatalogChecklistTemplateResponse | ErrorsList | None: """Update a catalog checklist template Update a specific catalog checklist template by id diff --git a/rootly_sdk/api/catalog_entities/bulk_delete_catalog_entities.py b/rootly_sdk/api/catalog_entities/bulk_delete_catalog_entities.py index 047595cc..e356f8df 100644 --- a/rootly_sdk/api/catalog_entities/bulk_delete_catalog_entities.py +++ b/rootly_sdk/api/catalog_entities/bulk_delete_catalog_entities.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any, Union import httpx @@ -37,10 +37,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[ - Union[BulkDestroyCatalogEntitiesResponse, ErrorsList, Union["BulkDestroyCatalogEntitiesResponse", "ErrorsList"]] -]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> BulkDestroyCatalogEntitiesResponse | ErrorsList | Union["BulkDestroyCatalogEntitiesResponse", "ErrorsList"] | None: if response.status_code == 200: response_200 = BulkDestroyCatalogEntitiesResponse.from_dict(response.json()) @@ -79,9 +77,9 @@ def _parse_response_422(data: object) -> Union["BulkDestroyCatalogEntitiesRespon def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response + *, client: AuthenticatedClient | Client, response: httpx.Response ) -> Response[ - Union[BulkDestroyCatalogEntitiesResponse, ErrorsList, Union["BulkDestroyCatalogEntitiesResponse", "ErrorsList"]] + BulkDestroyCatalogEntitiesResponse | ErrorsList | Union["BulkDestroyCatalogEntitiesResponse", "ErrorsList"] ]: return Response( status_code=HTTPStatus(response.status_code), @@ -97,7 +95,7 @@ def sync_detailed( client: AuthenticatedClient, body: Union["BulkDestroyCatalogEntitiesType0", "BulkDestroyCatalogEntitiesType1"], ) -> Response[ - Union[BulkDestroyCatalogEntitiesResponse, ErrorsList, Union["BulkDestroyCatalogEntitiesResponse", "ErrorsList"]] + BulkDestroyCatalogEntitiesResponse | ErrorsList | Union["BulkDestroyCatalogEntitiesResponse", "ErrorsList"] ]: """Bulk delete Catalog Entities @@ -135,9 +133,7 @@ def sync( *, client: AuthenticatedClient, body: Union["BulkDestroyCatalogEntitiesType0", "BulkDestroyCatalogEntitiesType1"], -) -> Optional[ - Union[BulkDestroyCatalogEntitiesResponse, ErrorsList, Union["BulkDestroyCatalogEntitiesResponse", "ErrorsList"]] -]: +) -> BulkDestroyCatalogEntitiesResponse | ErrorsList | Union["BulkDestroyCatalogEntitiesResponse", "ErrorsList"] | None: """Bulk delete Catalog Entities Delete catalog entities by external_id list, or prune by managed_by source. Two mutually exclusive @@ -170,7 +166,7 @@ async def asyncio_detailed( client: AuthenticatedClient, body: Union["BulkDestroyCatalogEntitiesType0", "BulkDestroyCatalogEntitiesType1"], ) -> Response[ - Union[BulkDestroyCatalogEntitiesResponse, ErrorsList, Union["BulkDestroyCatalogEntitiesResponse", "ErrorsList"]] + BulkDestroyCatalogEntitiesResponse | ErrorsList | Union["BulkDestroyCatalogEntitiesResponse", "ErrorsList"] ]: """Bulk delete Catalog Entities @@ -206,9 +202,7 @@ async def asyncio( *, client: AuthenticatedClient, body: Union["BulkDestroyCatalogEntitiesType0", "BulkDestroyCatalogEntitiesType1"], -) -> Optional[ - Union[BulkDestroyCatalogEntitiesResponse, ErrorsList, Union["BulkDestroyCatalogEntitiesResponse", "ErrorsList"]] -]: +) -> BulkDestroyCatalogEntitiesResponse | ErrorsList | Union["BulkDestroyCatalogEntitiesResponse", "ErrorsList"] | None: """Bulk delete Catalog Entities Delete catalog entities by external_id list, or prune by managed_by source. Two mutually exclusive diff --git a/rootly_sdk/api/catalog_entities/bulk_upsert_catalog_entities.py b/rootly_sdk/api/catalog_entities/bulk_upsert_catalog_entities.py index 85a0658d..f9eacd35 100644 --- a/rootly_sdk/api/catalog_entities/bulk_upsert_catalog_entities.py +++ b/rootly_sdk/api/catalog_entities/bulk_upsert_catalog_entities.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any, Union import httpx @@ -33,10 +33,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[ - Union[BulkUpsertCatalogEntitiesResponse, ErrorsList, Union["BulkUpsertCatalogEntitiesError", "ErrorsList"]] -]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> BulkUpsertCatalogEntitiesResponse | ErrorsList | Union["BulkUpsertCatalogEntitiesError", "ErrorsList"] | None: if response.status_code == 200: response_200 = BulkUpsertCatalogEntitiesResponse.from_dict(response.json()) @@ -75,10 +73,8 @@ def _parse_response_422(data: object) -> Union["BulkUpsertCatalogEntitiesError", def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[ - Union[BulkUpsertCatalogEntitiesResponse, ErrorsList, Union["BulkUpsertCatalogEntitiesError", "ErrorsList"]] -]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[BulkUpsertCatalogEntitiesResponse | ErrorsList | Union["BulkUpsertCatalogEntitiesError", "ErrorsList"]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -92,9 +88,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: BulkUpsertCatalogEntities, -) -> Response[ - Union[BulkUpsertCatalogEntitiesResponse, ErrorsList, Union["BulkUpsertCatalogEntitiesError", "ErrorsList"]] -]: +) -> Response[BulkUpsertCatalogEntitiesResponse | ErrorsList | Union["BulkUpsertCatalogEntitiesError", "ErrorsList"]]: """Bulk upsert Catalog Entities Create or update multiple catalog entities by external_id. Only attributes present in the payload @@ -129,9 +123,7 @@ def sync( *, client: AuthenticatedClient, body: BulkUpsertCatalogEntities, -) -> Optional[ - Union[BulkUpsertCatalogEntitiesResponse, ErrorsList, Union["BulkUpsertCatalogEntitiesError", "ErrorsList"]] -]: +) -> BulkUpsertCatalogEntitiesResponse | ErrorsList | Union["BulkUpsertCatalogEntitiesError", "ErrorsList"] | None: """Bulk upsert Catalog Entities Create or update multiple catalog entities by external_id. Only attributes present in the payload @@ -161,9 +153,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: BulkUpsertCatalogEntities, -) -> Response[ - Union[BulkUpsertCatalogEntitiesResponse, ErrorsList, Union["BulkUpsertCatalogEntitiesError", "ErrorsList"]] -]: +) -> Response[BulkUpsertCatalogEntitiesResponse | ErrorsList | Union["BulkUpsertCatalogEntitiesError", "ErrorsList"]]: """Bulk upsert Catalog Entities Create or update multiple catalog entities by external_id. Only attributes present in the payload @@ -196,9 +186,7 @@ async def asyncio( *, client: AuthenticatedClient, body: BulkUpsertCatalogEntities, -) -> Optional[ - Union[BulkUpsertCatalogEntitiesResponse, ErrorsList, Union["BulkUpsertCatalogEntitiesError", "ErrorsList"]] -]: +) -> BulkUpsertCatalogEntitiesResponse | ErrorsList | Union["BulkUpsertCatalogEntitiesError", "ErrorsList"] | None: """Bulk upsert Catalog Entities Create or update multiple catalog entities by external_id. Only attributes present in the payload diff --git a/rootly_sdk/api/catalog_entities/create_catalog_entity.py b/rootly_sdk/api/catalog_entities/create_catalog_entity.py index e066c4ec..19599362 100644 --- a/rootly_sdk/api/catalog_entities/create_catalog_entity.py +++ b/rootly_sdk/api/catalog_entities/create_catalog_entity.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[CatalogEntityResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CatalogEntityResponse | ErrorsList | None: if response.status_code == 201: response_201 = CatalogEntityResponse.from_dict(response.json()) @@ -56,8 +56,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[CatalogEntityResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[CatalogEntityResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -71,7 +71,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewCatalogEntity, -) -> Response[Union[CatalogEntityResponse, ErrorsList]]: +) -> Response[CatalogEntityResponse | ErrorsList]: """Creates a Catalog Entity Creates a new Catalog Entity from provided data @@ -105,7 +105,7 @@ def sync( *, client: AuthenticatedClient, body: NewCatalogEntity, -) -> Optional[Union[CatalogEntityResponse, ErrorsList]]: +) -> CatalogEntityResponse | ErrorsList | None: """Creates a Catalog Entity Creates a new Catalog Entity from provided data @@ -134,7 +134,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewCatalogEntity, -) -> Response[Union[CatalogEntityResponse, ErrorsList]]: +) -> Response[CatalogEntityResponse | ErrorsList]: """Creates a Catalog Entity Creates a new Catalog Entity from provided data @@ -166,7 +166,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewCatalogEntity, -) -> Optional[Union[CatalogEntityResponse, ErrorsList]]: +) -> CatalogEntityResponse | ErrorsList | None: """Creates a Catalog Entity Creates a new Catalog Entity from provided data diff --git a/rootly_sdk/api/catalog_entities/delete_catalog_entity.py b/rootly_sdk/api/catalog_entities/delete_catalog_entity.py index 8ccaf331..0507b2ea 100644 --- a/rootly_sdk/api/catalog_entities/delete_catalog_entity.py +++ b/rootly_sdk/api/catalog_entities/delete_catalog_entity.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any from uuid import UUID import httpx @@ -12,7 +12,7 @@ def _get_kwargs( - id: Union[UUID, str], + id: UUID | str, ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "delete", @@ -23,8 +23,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[CatalogEntityResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CatalogEntityResponse | ErrorsList | None: if response.status_code == 200: response_200 = CatalogEntityResponse.from_dict(response.json()) @@ -42,8 +42,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[CatalogEntityResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[CatalogEntityResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -53,10 +53,10 @@ def _build_response( def sync_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Response[Union[CatalogEntityResponse, ErrorsList]]: +) -> Response[CatalogEntityResponse | ErrorsList]: """Delete a Catalog Entity Delete a specific Catalog Entity by id @@ -84,10 +84,10 @@ def sync_detailed( def sync( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Optional[Union[CatalogEntityResponse, ErrorsList]]: +) -> CatalogEntityResponse | ErrorsList | None: """Delete a Catalog Entity Delete a specific Catalog Entity by id @@ -110,10 +110,10 @@ def sync( async def asyncio_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Response[Union[CatalogEntityResponse, ErrorsList]]: +) -> Response[CatalogEntityResponse | ErrorsList]: """Delete a Catalog Entity Delete a specific Catalog Entity by id @@ -139,10 +139,10 @@ async def asyncio_detailed( async def asyncio( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Optional[Union[CatalogEntityResponse, ErrorsList]]: +) -> CatalogEntityResponse | ErrorsList | None: """Delete a Catalog Entity Delete a specific Catalog Entity by id diff --git a/rootly_sdk/api/catalog_entities/get_catalog_entity.py b/rootly_sdk/api/catalog_entities/get_catalog_entity.py index 8dfde1a1..6251c47a 100644 --- a/rootly_sdk/api/catalog_entities/get_catalog_entity.py +++ b/rootly_sdk/api/catalog_entities/get_catalog_entity.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any from uuid import UUID import httpx @@ -13,13 +13,13 @@ def _get_kwargs( - id: Union[UUID, str], + id: UUID | str, *, - include: Union[Unset, GetCatalogEntityInclude] = UNSET, + include: Unset | GetCatalogEntityInclude = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} - json_include: Union[Unset, str] = UNSET + json_include: Unset | str = UNSET if not isinstance(include, Unset): json_include = include @@ -37,8 +37,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[CatalogEntityResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CatalogEntityResponse | ErrorsList | None: if response.status_code == 200: response_200 = CatalogEntityResponse.from_dict(response.json()) @@ -56,8 +56,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[CatalogEntityResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[CatalogEntityResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -67,11 +67,11 @@ def _build_response( def sync_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, - include: Union[Unset, GetCatalogEntityInclude] = UNSET, -) -> Response[Union[CatalogEntityResponse, ErrorsList]]: + include: Unset | GetCatalogEntityInclude = UNSET, +) -> Response[CatalogEntityResponse | ErrorsList]: """Retrieves a Catalog Entity Retrieves a specific Catalog Entity by id @@ -101,11 +101,11 @@ def sync_detailed( def sync( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, - include: Union[Unset, GetCatalogEntityInclude] = UNSET, -) -> Optional[Union[CatalogEntityResponse, ErrorsList]]: + include: Unset | GetCatalogEntityInclude = UNSET, +) -> CatalogEntityResponse | ErrorsList | None: """Retrieves a Catalog Entity Retrieves a specific Catalog Entity by id @@ -130,11 +130,11 @@ def sync( async def asyncio_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, - include: Union[Unset, GetCatalogEntityInclude] = UNSET, -) -> Response[Union[CatalogEntityResponse, ErrorsList]]: + include: Unset | GetCatalogEntityInclude = UNSET, +) -> Response[CatalogEntityResponse | ErrorsList]: """Retrieves a Catalog Entity Retrieves a specific Catalog Entity by id @@ -162,11 +162,11 @@ async def asyncio_detailed( async def asyncio( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, - include: Union[Unset, GetCatalogEntityInclude] = UNSET, -) -> Optional[Union[CatalogEntityResponse, ErrorsList]]: + include: Unset | GetCatalogEntityInclude = UNSET, +) -> CatalogEntityResponse | ErrorsList | None: """Retrieves a Catalog Entity Retrieves a specific Catalog Entity by id diff --git a/rootly_sdk/api/catalog_entities/list_catalog_entities.py b/rootly_sdk/api/catalog_entities/list_catalog_entities.py index accf6ef1..2e2ba6b7 100644 --- a/rootly_sdk/api/catalog_entities/list_catalog_entities.py +++ b/rootly_sdk/api/catalog_entities/list_catalog_entities.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -14,42 +14,42 @@ def _get_kwargs( catalog_id: str, *, - include: Union[Unset, ListCatalogEntitiesInclude] = UNSET, - sort: Union[Unset, ListCatalogEntitiesSort] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterbackstage_id: Union[Unset, str] = UNSET, - filterexternal_id: Union[Unset, str] = UNSET, - filtermanaged_by: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filterslugeq: Union[Unset, str] = UNSET, - filterslugnot_eq: Union[Unset, str] = UNSET, - filterslugin: Union[Unset, str] = UNSET, - filterslugnot_in: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, - filtermanaged_byeq: Union[Unset, str] = UNSET, - filtermanaged_bynot_eq: Union[Unset, str] = UNSET, - filtermanaged_byin: Union[Unset, str] = UNSET, - filtermanaged_bynot_in: Union[Unset, str] = UNSET, + include: Unset | ListCatalogEntitiesInclude = UNSET, + sort: Unset | ListCatalogEntitiesSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterbackstage_id: Unset | str = UNSET, + filterexternal_id: Unset | str = UNSET, + filtermanaged_by: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filtermanaged_byeq: Unset | str = UNSET, + filtermanaged_bynot_eq: Unset | str = UNSET, + filtermanaged_byin: Unset | str = UNSET, + filtermanaged_bynot_in: Unset | str = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} - json_include: Union[Unset, str] = UNSET + json_include: Unset | str = UNSET if not isinstance(include, Unset): json_include = include params["include"] = json_include - json_sort: Union[Unset, str] = UNSET + json_sort: Unset | str = UNSET if not isinstance(sort, Unset): json_sort = sort @@ -114,9 +114,7 @@ def _get_kwargs( return _kwargs -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[CatalogEntityList]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> CatalogEntityList | None: if response.status_code == 200: response_200 = CatalogEntityList.from_dict(response.json()) @@ -128,9 +126,7 @@ def _parse_response( return None -def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[CatalogEntityList]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[CatalogEntityList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -143,32 +139,32 @@ def sync_detailed( catalog_id: str, *, client: AuthenticatedClient, - include: Union[Unset, ListCatalogEntitiesInclude] = UNSET, - sort: Union[Unset, ListCatalogEntitiesSort] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterbackstage_id: Union[Unset, str] = UNSET, - filterexternal_id: Union[Unset, str] = UNSET, - filtermanaged_by: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filterslugeq: Union[Unset, str] = UNSET, - filterslugnot_eq: Union[Unset, str] = UNSET, - filterslugin: Union[Unset, str] = UNSET, - filterslugnot_in: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, - filtermanaged_byeq: Union[Unset, str] = UNSET, - filtermanaged_bynot_eq: Union[Unset, str] = UNSET, - filtermanaged_byin: Union[Unset, str] = UNSET, - filtermanaged_bynot_in: Union[Unset, str] = UNSET, + include: Unset | ListCatalogEntitiesInclude = UNSET, + sort: Unset | ListCatalogEntitiesSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterbackstage_id: Unset | str = UNSET, + filterexternal_id: Unset | str = UNSET, + filtermanaged_by: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filtermanaged_byeq: Unset | str = UNSET, + filtermanaged_bynot_eq: Unset | str = UNSET, + filtermanaged_byin: Unset | str = UNSET, + filtermanaged_bynot_in: Unset | str = UNSET, ) -> Response[CatalogEntityList]: """List Catalog Entities @@ -252,33 +248,33 @@ def sync( catalog_id: str, *, client: AuthenticatedClient, - include: Union[Unset, ListCatalogEntitiesInclude] = UNSET, - sort: Union[Unset, ListCatalogEntitiesSort] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterbackstage_id: Union[Unset, str] = UNSET, - filterexternal_id: Union[Unset, str] = UNSET, - filtermanaged_by: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filterslugeq: Union[Unset, str] = UNSET, - filterslugnot_eq: Union[Unset, str] = UNSET, - filterslugin: Union[Unset, str] = UNSET, - filterslugnot_in: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, - filtermanaged_byeq: Union[Unset, str] = UNSET, - filtermanaged_bynot_eq: Union[Unset, str] = UNSET, - filtermanaged_byin: Union[Unset, str] = UNSET, - filtermanaged_bynot_in: Union[Unset, str] = UNSET, -) -> Optional[CatalogEntityList]: + include: Unset | ListCatalogEntitiesInclude = UNSET, + sort: Unset | ListCatalogEntitiesSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterbackstage_id: Unset | str = UNSET, + filterexternal_id: Unset | str = UNSET, + filtermanaged_by: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filtermanaged_byeq: Unset | str = UNSET, + filtermanaged_bynot_eq: Unset | str = UNSET, + filtermanaged_byin: Unset | str = UNSET, + filtermanaged_bynot_in: Unset | str = UNSET, +) -> CatalogEntityList | None: """List Catalog Entities List Catalog Entities @@ -356,32 +352,32 @@ async def asyncio_detailed( catalog_id: str, *, client: AuthenticatedClient, - include: Union[Unset, ListCatalogEntitiesInclude] = UNSET, - sort: Union[Unset, ListCatalogEntitiesSort] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterbackstage_id: Union[Unset, str] = UNSET, - filterexternal_id: Union[Unset, str] = UNSET, - filtermanaged_by: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filterslugeq: Union[Unset, str] = UNSET, - filterslugnot_eq: Union[Unset, str] = UNSET, - filterslugin: Union[Unset, str] = UNSET, - filterslugnot_in: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, - filtermanaged_byeq: Union[Unset, str] = UNSET, - filtermanaged_bynot_eq: Union[Unset, str] = UNSET, - filtermanaged_byin: Union[Unset, str] = UNSET, - filtermanaged_bynot_in: Union[Unset, str] = UNSET, + include: Unset | ListCatalogEntitiesInclude = UNSET, + sort: Unset | ListCatalogEntitiesSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterbackstage_id: Unset | str = UNSET, + filterexternal_id: Unset | str = UNSET, + filtermanaged_by: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filtermanaged_byeq: Unset | str = UNSET, + filtermanaged_bynot_eq: Unset | str = UNSET, + filtermanaged_byin: Unset | str = UNSET, + filtermanaged_bynot_in: Unset | str = UNSET, ) -> Response[CatalogEntityList]: """List Catalog Entities @@ -463,33 +459,33 @@ async def asyncio( catalog_id: str, *, client: AuthenticatedClient, - include: Union[Unset, ListCatalogEntitiesInclude] = UNSET, - sort: Union[Unset, ListCatalogEntitiesSort] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterbackstage_id: Union[Unset, str] = UNSET, - filterexternal_id: Union[Unset, str] = UNSET, - filtermanaged_by: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filterslugeq: Union[Unset, str] = UNSET, - filterslugnot_eq: Union[Unset, str] = UNSET, - filterslugin: Union[Unset, str] = UNSET, - filterslugnot_in: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, - filtermanaged_byeq: Union[Unset, str] = UNSET, - filtermanaged_bynot_eq: Union[Unset, str] = UNSET, - filtermanaged_byin: Union[Unset, str] = UNSET, - filtermanaged_bynot_in: Union[Unset, str] = UNSET, -) -> Optional[CatalogEntityList]: + include: Unset | ListCatalogEntitiesInclude = UNSET, + sort: Unset | ListCatalogEntitiesSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterbackstage_id: Unset | str = UNSET, + filterexternal_id: Unset | str = UNSET, + filtermanaged_by: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filtermanaged_byeq: Unset | str = UNSET, + filtermanaged_bynot_eq: Unset | str = UNSET, + filtermanaged_byin: Unset | str = UNSET, + filtermanaged_bynot_in: Unset | str = UNSET, +) -> CatalogEntityList | None: """List Catalog Entities List Catalog Entities diff --git a/rootly_sdk/api/catalog_entities/update_catalog_entity.py b/rootly_sdk/api/catalog_entities/update_catalog_entity.py index 2cb1cb4c..9d1d2f5c 100644 --- a/rootly_sdk/api/catalog_entities/update_catalog_entity.py +++ b/rootly_sdk/api/catalog_entities/update_catalog_entity.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any from uuid import UUID import httpx @@ -13,7 +13,7 @@ def _get_kwargs( - id: Union[UUID, str], + id: UUID | str, *, body: UpdateCatalogEntity, ) -> dict[str, Any]: @@ -33,8 +33,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[CatalogEntityResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CatalogEntityResponse | ErrorsList | None: if response.status_code == 200: response_200 = CatalogEntityResponse.from_dict(response.json()) @@ -52,8 +52,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[CatalogEntityResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[CatalogEntityResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -63,11 +63,11 @@ def _build_response( def sync_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdateCatalogEntity, -) -> Response[Union[CatalogEntityResponse, ErrorsList]]: +) -> Response[CatalogEntityResponse | ErrorsList]: """Update a Catalog Entity Update a specific Catalog Entity by id @@ -97,11 +97,11 @@ def sync_detailed( def sync( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdateCatalogEntity, -) -> Optional[Union[CatalogEntityResponse, ErrorsList]]: +) -> CatalogEntityResponse | ErrorsList | None: """Update a Catalog Entity Update a specific Catalog Entity by id @@ -126,11 +126,11 @@ def sync( async def asyncio_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdateCatalogEntity, -) -> Response[Union[CatalogEntityResponse, ErrorsList]]: +) -> Response[CatalogEntityResponse | ErrorsList]: """Update a Catalog Entity Update a specific Catalog Entity by id @@ -158,11 +158,11 @@ async def asyncio_detailed( async def asyncio( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdateCatalogEntity, -) -> Optional[Union[CatalogEntityResponse, ErrorsList]]: +) -> CatalogEntityResponse | ErrorsList | None: """Update a Catalog Entity Update a specific Catalog Entity by id diff --git a/rootly_sdk/api/catalog_entity_checklists/get_catalog_entity_checklist.py b/rootly_sdk/api/catalog_entity_checklists/get_catalog_entity_checklist.py index b5a59482..3b9a528e 100644 --- a/rootly_sdk/api/catalog_entity_checklists/get_catalog_entity_checklist.py +++ b/rootly_sdk/api/catalog_entity_checklists/get_catalog_entity_checklist.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any from uuid import UUID import httpx @@ -23,8 +23,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[CatalogEntityChecklistResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CatalogEntityChecklistResponse | ErrorsList | None: if response.status_code == 200: response_200 = CatalogEntityChecklistResponse.from_dict(response.json()) @@ -42,8 +42,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[CatalogEntityChecklistResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[CatalogEntityChecklistResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -56,7 +56,7 @@ def sync_detailed( id: UUID, *, client: AuthenticatedClient, -) -> Response[Union[CatalogEntityChecklistResponse, ErrorsList]]: +) -> Response[CatalogEntityChecklistResponse | ErrorsList]: """Retrieves a catalog entity checklist Retrieves a specific catalog entity checklist by id @@ -87,7 +87,7 @@ def sync( id: UUID, *, client: AuthenticatedClient, -) -> Optional[Union[CatalogEntityChecklistResponse, ErrorsList]]: +) -> CatalogEntityChecklistResponse | ErrorsList | None: """Retrieves a catalog entity checklist Retrieves a specific catalog entity checklist by id @@ -113,7 +113,7 @@ async def asyncio_detailed( id: UUID, *, client: AuthenticatedClient, -) -> Response[Union[CatalogEntityChecklistResponse, ErrorsList]]: +) -> Response[CatalogEntityChecklistResponse | ErrorsList]: """Retrieves a catalog entity checklist Retrieves a specific catalog entity checklist by id @@ -142,7 +142,7 @@ async def asyncio( id: UUID, *, client: AuthenticatedClient, -) -> Optional[Union[CatalogEntityChecklistResponse, ErrorsList]]: +) -> CatalogEntityChecklistResponse | ErrorsList | None: """Retrieves a catalog entity checklist Retrieves a specific catalog entity checklist by id diff --git a/rootly_sdk/api/catalog_entity_checklists/list_catalog_entity_checklists.py b/rootly_sdk/api/catalog_entity_checklists/list_catalog_entity_checklists.py index 8bff27bd..78dacef1 100644 --- a/rootly_sdk/api/catalog_entity_checklists/list_catalog_entity_checklists.py +++ b/rootly_sdk/api/catalog_entity_checklists/list_catalog_entity_checklists.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -11,16 +11,16 @@ def _get_kwargs( *, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterstatus: Union[Unset, str] = UNSET, - filtercatalog_checklist_template_id: Union[Unset, str] = UNSET, - filterauditable_type: Union[Unset, str] = UNSET, - filterauditable_id: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterstatus: Unset | str = UNSET, + filtercatalog_checklist_template_id: Unset | str = UNSET, + filterauditable_type: Unset | str = UNSET, + filterauditable_id: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -56,8 +56,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[CatalogEntityChecklistList]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CatalogEntityChecklistList | None: if response.status_code == 200: response_200 = CatalogEntityChecklistList.from_dict(response.json()) @@ -70,7 +70,7 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response + *, client: AuthenticatedClient | Client, response: httpx.Response ) -> Response[CatalogEntityChecklistList]: return Response( status_code=HTTPStatus(response.status_code), @@ -83,16 +83,16 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterstatus: Union[Unset, str] = UNSET, - filtercatalog_checklist_template_id: Union[Unset, str] = UNSET, - filterauditable_type: Union[Unset, str] = UNSET, - filterauditable_id: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterstatus: Unset | str = UNSET, + filtercatalog_checklist_template_id: Unset | str = UNSET, + filterauditable_type: Unset | str = UNSET, + filterauditable_id: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> Response[CatalogEntityChecklistList]: """List catalog entity checklists @@ -141,17 +141,17 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterstatus: Union[Unset, str] = UNSET, - filtercatalog_checklist_template_id: Union[Unset, str] = UNSET, - filterauditable_type: Union[Unset, str] = UNSET, - filterauditable_id: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, -) -> Optional[CatalogEntityChecklistList]: + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterstatus: Unset | str = UNSET, + filtercatalog_checklist_template_id: Unset | str = UNSET, + filterauditable_type: Unset | str = UNSET, + filterauditable_id: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, +) -> CatalogEntityChecklistList | None: """List catalog entity checklists List catalog entity checklists @@ -194,16 +194,16 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterstatus: Union[Unset, str] = UNSET, - filtercatalog_checklist_template_id: Union[Unset, str] = UNSET, - filterauditable_type: Union[Unset, str] = UNSET, - filterauditable_id: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterstatus: Unset | str = UNSET, + filtercatalog_checklist_template_id: Unset | str = UNSET, + filterauditable_type: Unset | str = UNSET, + filterauditable_id: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> Response[CatalogEntityChecklistList]: """List catalog entity checklists @@ -250,17 +250,17 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterstatus: Union[Unset, str] = UNSET, - filtercatalog_checklist_template_id: Union[Unset, str] = UNSET, - filterauditable_type: Union[Unset, str] = UNSET, - filterauditable_id: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, -) -> Optional[CatalogEntityChecklistList]: + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterstatus: Unset | str = UNSET, + filtercatalog_checklist_template_id: Unset | str = UNSET, + filterauditable_type: Unset | str = UNSET, + filterauditable_id: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, +) -> CatalogEntityChecklistList | None: """List catalog entity checklists List catalog entity checklists diff --git a/rootly_sdk/api/catalog_entity_properties/create_catalog_entity_property.py b/rootly_sdk/api/catalog_entity_properties/create_catalog_entity_property.py index 6df3ab90..43ab5578 100644 --- a/rootly_sdk/api/catalog_entity_properties/create_catalog_entity_property.py +++ b/rootly_sdk/api/catalog_entity_properties/create_catalog_entity_property.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[CatalogEntityPropertyResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CatalogEntityPropertyResponse | ErrorsList | None: if response.status_code == 201: response_201 = CatalogEntityPropertyResponse.from_dict(response.json()) @@ -56,8 +56,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[CatalogEntityPropertyResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[CatalogEntityPropertyResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -71,7 +71,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewCatalogEntityProperty, -) -> Response[Union[CatalogEntityPropertyResponse, ErrorsList]]: +) -> Response[CatalogEntityPropertyResponse | ErrorsList]: """Creates a Catalog Entity Property **Deprecated:** This endpoint is deprecated, please use the `fields` attribute on catalog entities @@ -111,7 +111,7 @@ def sync( *, client: AuthenticatedClient, body: NewCatalogEntityProperty, -) -> Optional[Union[CatalogEntityPropertyResponse, ErrorsList]]: +) -> CatalogEntityPropertyResponse | ErrorsList | None: """Creates a Catalog Entity Property **Deprecated:** This endpoint is deprecated, please use the `fields` attribute on catalog entities @@ -146,7 +146,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewCatalogEntityProperty, -) -> Response[Union[CatalogEntityPropertyResponse, ErrorsList]]: +) -> Response[CatalogEntityPropertyResponse | ErrorsList]: """Creates a Catalog Entity Property **Deprecated:** This endpoint is deprecated, please use the `fields` attribute on catalog entities @@ -184,7 +184,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewCatalogEntityProperty, -) -> Optional[Union[CatalogEntityPropertyResponse, ErrorsList]]: +) -> CatalogEntityPropertyResponse | ErrorsList | None: """Creates a Catalog Entity Property **Deprecated:** This endpoint is deprecated, please use the `fields` attribute on catalog entities diff --git a/rootly_sdk/api/catalog_entity_properties/delete_catalog_entity_property.py b/rootly_sdk/api/catalog_entity_properties/delete_catalog_entity_property.py index 49026906..acd0aab7 100644 --- a/rootly_sdk/api/catalog_entity_properties/delete_catalog_entity_property.py +++ b/rootly_sdk/api/catalog_entity_properties/delete_catalog_entity_property.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[CatalogEntityPropertyResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CatalogEntityPropertyResponse | ErrorsList | None: if response.status_code == 200: response_200 = CatalogEntityPropertyResponse.from_dict(response.json()) @@ -41,8 +41,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[CatalogEntityPropertyResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[CatalogEntityPropertyResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -55,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[CatalogEntityPropertyResponse, ErrorsList]]: +) -> Response[CatalogEntityPropertyResponse | ErrorsList]: """Delete a Catalog Entity Property **Deprecated:** This endpoint is deprecated, please use the `fields` attribute on catalog entities @@ -90,7 +90,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[CatalogEntityPropertyResponse, ErrorsList]]: +) -> CatalogEntityPropertyResponse | ErrorsList | None: """Delete a Catalog Entity Property **Deprecated:** This endpoint is deprecated, please use the `fields` attribute on catalog entities @@ -120,7 +120,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[CatalogEntityPropertyResponse, ErrorsList]]: +) -> Response[CatalogEntityPropertyResponse | ErrorsList]: """Delete a Catalog Entity Property **Deprecated:** This endpoint is deprecated, please use the `fields` attribute on catalog entities @@ -153,7 +153,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[CatalogEntityPropertyResponse, ErrorsList]]: +) -> CatalogEntityPropertyResponse | ErrorsList | None: """Delete a Catalog Entity Property **Deprecated:** This endpoint is deprecated, please use the `fields` attribute on catalog entities diff --git a/rootly_sdk/api/catalog_entity_properties/get_catalog_entity_property.py b/rootly_sdk/api/catalog_entity_properties/get_catalog_entity_property.py index c2006b31..774c79cb 100644 --- a/rootly_sdk/api/catalog_entity_properties/get_catalog_entity_property.py +++ b/rootly_sdk/api/catalog_entity_properties/get_catalog_entity_property.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -16,11 +16,11 @@ def _get_kwargs( id: str, *, - include: Union[Unset, GetCatalogEntityPropertyInclude] = UNSET, + include: Unset | GetCatalogEntityPropertyInclude = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} - json_include: Union[Unset, str] = UNSET + json_include: Unset | str = UNSET if not isinstance(include, Unset): json_include = include @@ -38,8 +38,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[CatalogEntityPropertyResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CatalogEntityPropertyResponse | ErrorsList | None: if response.status_code == 200: response_200 = CatalogEntityPropertyResponse.from_dict(response.json()) @@ -57,8 +57,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[CatalogEntityPropertyResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[CatalogEntityPropertyResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -71,8 +71,8 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, - include: Union[Unset, GetCatalogEntityPropertyInclude] = UNSET, -) -> Response[Union[CatalogEntityPropertyResponse, ErrorsList]]: + include: Unset | GetCatalogEntityPropertyInclude = UNSET, +) -> Response[CatalogEntityPropertyResponse | ErrorsList]: """Retrieves a Catalog Entity Property **Deprecated:** This endpoint is deprecated, please use `include=fields` on catalog entities or @@ -109,8 +109,8 @@ def sync( id: str, *, client: AuthenticatedClient, - include: Union[Unset, GetCatalogEntityPropertyInclude] = UNSET, -) -> Optional[Union[CatalogEntityPropertyResponse, ErrorsList]]: + include: Unset | GetCatalogEntityPropertyInclude = UNSET, +) -> CatalogEntityPropertyResponse | ErrorsList | None: """Retrieves a Catalog Entity Property **Deprecated:** This endpoint is deprecated, please use `include=fields` on catalog entities or @@ -142,8 +142,8 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, - include: Union[Unset, GetCatalogEntityPropertyInclude] = UNSET, -) -> Response[Union[CatalogEntityPropertyResponse, ErrorsList]]: + include: Unset | GetCatalogEntityPropertyInclude = UNSET, +) -> Response[CatalogEntityPropertyResponse | ErrorsList]: """Retrieves a Catalog Entity Property **Deprecated:** This endpoint is deprecated, please use `include=fields` on catalog entities or @@ -178,8 +178,8 @@ async def asyncio( id: str, *, client: AuthenticatedClient, - include: Union[Unset, GetCatalogEntityPropertyInclude] = UNSET, -) -> Optional[Union[CatalogEntityPropertyResponse, ErrorsList]]: + include: Unset | GetCatalogEntityPropertyInclude = UNSET, +) -> CatalogEntityPropertyResponse | ErrorsList | None: """Retrieves a Catalog Entity Property **Deprecated:** This endpoint is deprecated, please use `include=fields` on catalog entities or diff --git a/rootly_sdk/api/catalog_entity_properties/list_catalog_entity_properties.py b/rootly_sdk/api/catalog_entity_properties/list_catalog_entity_properties.py index 9346c562..b0e16a22 100644 --- a/rootly_sdk/api/catalog_entity_properties/list_catalog_entity_properties.py +++ b/rootly_sdk/api/catalog_entity_properties/list_catalog_entity_properties.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -18,26 +18,26 @@ def _get_kwargs( catalog_entity_id: str, *, - include: Union[Unset, ListCatalogEntityPropertiesInclude] = UNSET, - sort: Union[Unset, ListCatalogEntityPropertiesSort] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtercatalog_field_id: Union[Unset, str] = UNSET, - filterkey: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, + include: Unset | ListCatalogEntityPropertiesInclude = UNSET, + sort: Unset | ListCatalogEntityPropertiesSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtercatalog_field_id: Unset | str = UNSET, + filterkey: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} - json_include: Union[Unset, str] = UNSET + json_include: Unset | str = UNSET if not isinstance(include, Unset): json_include = include params["include"] = json_include - json_sort: Union[Unset, str] = UNSET + json_sort: Unset | str = UNSET if not isinstance(sort, Unset): json_sort = sort @@ -71,8 +71,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[CatalogEntityPropertyList]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CatalogEntityPropertyList | None: if response.status_code == 200: response_200 = CatalogEntityPropertyList.from_dict(response.json()) @@ -85,7 +85,7 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response + *, client: AuthenticatedClient | Client, response: httpx.Response ) -> Response[CatalogEntityPropertyList]: return Response( status_code=HTTPStatus(response.status_code), @@ -99,16 +99,16 @@ def sync_detailed( catalog_entity_id: str, *, client: AuthenticatedClient, - include: Union[Unset, ListCatalogEntityPropertiesInclude] = UNSET, - sort: Union[Unset, ListCatalogEntityPropertiesSort] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtercatalog_field_id: Union[Unset, str] = UNSET, - filterkey: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, + include: Unset | ListCatalogEntityPropertiesInclude = UNSET, + sort: Unset | ListCatalogEntityPropertiesSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtercatalog_field_id: Unset | str = UNSET, + filterkey: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> Response[CatalogEntityPropertyList]: """List catalog properties @@ -164,17 +164,17 @@ def sync( catalog_entity_id: str, *, client: AuthenticatedClient, - include: Union[Unset, ListCatalogEntityPropertiesInclude] = UNSET, - sort: Union[Unset, ListCatalogEntityPropertiesSort] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtercatalog_field_id: Union[Unset, str] = UNSET, - filterkey: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, -) -> Optional[CatalogEntityPropertyList]: + include: Unset | ListCatalogEntityPropertiesInclude = UNSET, + sort: Unset | ListCatalogEntityPropertiesSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtercatalog_field_id: Unset | str = UNSET, + filterkey: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, +) -> CatalogEntityPropertyList | None: """List catalog properties **Deprecated:** This endpoint is deprecated, please use `include=fields` on catalog entities or @@ -224,16 +224,16 @@ async def asyncio_detailed( catalog_entity_id: str, *, client: AuthenticatedClient, - include: Union[Unset, ListCatalogEntityPropertiesInclude] = UNSET, - sort: Union[Unset, ListCatalogEntityPropertiesSort] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtercatalog_field_id: Union[Unset, str] = UNSET, - filterkey: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, + include: Unset | ListCatalogEntityPropertiesInclude = UNSET, + sort: Unset | ListCatalogEntityPropertiesSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtercatalog_field_id: Unset | str = UNSET, + filterkey: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> Response[CatalogEntityPropertyList]: """List catalog properties @@ -287,17 +287,17 @@ async def asyncio( catalog_entity_id: str, *, client: AuthenticatedClient, - include: Union[Unset, ListCatalogEntityPropertiesInclude] = UNSET, - sort: Union[Unset, ListCatalogEntityPropertiesSort] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtercatalog_field_id: Union[Unset, str] = UNSET, - filterkey: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, -) -> Optional[CatalogEntityPropertyList]: + include: Unset | ListCatalogEntityPropertiesInclude = UNSET, + sort: Unset | ListCatalogEntityPropertiesSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtercatalog_field_id: Unset | str = UNSET, + filterkey: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, +) -> CatalogEntityPropertyList | None: """List catalog properties **Deprecated:** This endpoint is deprecated, please use `include=fields` on catalog entities or diff --git a/rootly_sdk/api/catalog_entity_properties/update_catalog_entity_property.py b/rootly_sdk/api/catalog_entity_properties/update_catalog_entity_property.py index 498661cb..121225f3 100644 --- a/rootly_sdk/api/catalog_entity_properties/update_catalog_entity_property.py +++ b/rootly_sdk/api/catalog_entity_properties/update_catalog_entity_property.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[CatalogEntityPropertyResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CatalogEntityPropertyResponse | ErrorsList | None: if response.status_code == 200: response_200 = CatalogEntityPropertyResponse.from_dict(response.json()) @@ -51,8 +51,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[CatalogEntityPropertyResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[CatalogEntityPropertyResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateCatalogEntityProperty, -) -> Response[Union[CatalogEntityPropertyResponse, ErrorsList]]: +) -> Response[CatalogEntityPropertyResponse | ErrorsList]: """Update a Catalog Entity Property **Deprecated:** This endpoint is deprecated, please use the `fields` attribute on catalog entities @@ -107,7 +107,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateCatalogEntityProperty, -) -> Optional[Union[CatalogEntityPropertyResponse, ErrorsList]]: +) -> CatalogEntityPropertyResponse | ErrorsList | None: """Update a Catalog Entity Property **Deprecated:** This endpoint is deprecated, please use the `fields` attribute on catalog entities @@ -143,7 +143,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateCatalogEntityProperty, -) -> Response[Union[CatalogEntityPropertyResponse, ErrorsList]]: +) -> Response[CatalogEntityPropertyResponse | ErrorsList]: """Update a Catalog Entity Property **Deprecated:** This endpoint is deprecated, please use the `fields` attribute on catalog entities @@ -182,7 +182,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateCatalogEntityProperty, -) -> Optional[Union[CatalogEntityPropertyResponse, ErrorsList]]: +) -> CatalogEntityPropertyResponse | ErrorsList | None: """Update a Catalog Entity Property **Deprecated:** This endpoint is deprecated, please use the `fields` attribute on catalog entities diff --git a/rootly_sdk/api/catalog_properties/create_catalog_property.py b/rootly_sdk/api/catalog_properties/create_catalog_property.py index 9fc7b1e4..572706bb 100644 --- a/rootly_sdk/api/catalog_properties/create_catalog_property.py +++ b/rootly_sdk/api/catalog_properties/create_catalog_property.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -29,7 +29,7 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Any | None: if response.status_code == 201: return None @@ -39,7 +39,7 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Any]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, diff --git a/rootly_sdk/api/catalog_properties/delete_catalog_property.py b/rootly_sdk/api/catalog_properties/delete_catalog_property.py index d00bb3c6..357e3f0a 100644 --- a/rootly_sdk/api/catalog_properties/delete_catalog_property.py +++ b/rootly_sdk/api/catalog_properties/delete_catalog_property.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -19,7 +19,7 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Any | None: if response.status_code == 200: return None @@ -29,7 +29,7 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Any]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, diff --git a/rootly_sdk/api/catalog_properties/get_catalog_property.py b/rootly_sdk/api/catalog_properties/get_catalog_property.py index 7f9963fb..4735f106 100644 --- a/rootly_sdk/api/catalog_properties/get_catalog_property.py +++ b/rootly_sdk/api/catalog_properties/get_catalog_property.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -19,7 +19,7 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Any | None: if response.status_code == 200: return None @@ -29,7 +29,7 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Any]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, diff --git a/rootly_sdk/api/catalog_properties/list_catalog_properties.py b/rootly_sdk/api/catalog_properties/list_catalog_properties.py index 05930da5..95f3c5c7 100644 --- a/rootly_sdk/api/catalog_properties/list_catalog_properties.py +++ b/rootly_sdk/api/catalog_properties/list_catalog_properties.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -19,7 +19,7 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Any | None: if response.status_code == 200: return None @@ -29,7 +29,7 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Any]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, diff --git a/rootly_sdk/api/catalog_properties/update_catalog_property.py b/rootly_sdk/api/catalog_properties/update_catalog_property.py index 6c837ccf..b52f9831 100644 --- a/rootly_sdk/api/catalog_properties/update_catalog_property.py +++ b/rootly_sdk/api/catalog_properties/update_catalog_property.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -29,7 +29,7 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Any | None: if response.status_code == 200: return None @@ -39,7 +39,7 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Any]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, diff --git a/rootly_sdk/api/catalogs/create_catalog.py b/rootly_sdk/api/catalogs/create_catalog.py index cfb0ab3a..17867409 100644 --- a/rootly_sdk/api/catalogs/create_catalog.py +++ b/rootly_sdk/api/catalogs/create_catalog.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[CatalogResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CatalogResponse | ErrorsList | None: if response.status_code == 201: response_201 = CatalogResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[CatalogResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[CatalogResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +69,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewCatalog, -) -> Response[Union[CatalogResponse, ErrorsList]]: +) -> Response[CatalogResponse | ErrorsList]: """Creates a catalog Creates a new catalog from provided data @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: NewCatalog, -) -> Optional[Union[CatalogResponse, ErrorsList]]: +) -> CatalogResponse | ErrorsList | None: """Creates a catalog Creates a new catalog from provided data @@ -126,7 +126,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewCatalog, -) -> Response[Union[CatalogResponse, ErrorsList]]: +) -> Response[CatalogResponse | ErrorsList]: """Creates a catalog Creates a new catalog from provided data @@ -155,7 +155,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewCatalog, -) -> Optional[Union[CatalogResponse, ErrorsList]]: +) -> CatalogResponse | ErrorsList | None: """Creates a catalog Creates a new catalog from provided data diff --git a/rootly_sdk/api/catalogs/delete_catalog.py b/rootly_sdk/api/catalogs/delete_catalog.py index c2a0ea18..ec886956 100644 --- a/rootly_sdk/api/catalogs/delete_catalog.py +++ b/rootly_sdk/api/catalogs/delete_catalog.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any from uuid import UUID import httpx @@ -12,7 +12,7 @@ def _get_kwargs( - id: Union[UUID, str], + id: UUID | str, ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "delete", @@ -23,8 +23,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[CatalogResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CatalogResponse | ErrorsList | None: if response.status_code == 200: response_200 = CatalogResponse.from_dict(response.json()) @@ -42,8 +42,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[CatalogResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[CatalogResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -53,10 +53,10 @@ def _build_response( def sync_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Response[Union[CatalogResponse, ErrorsList]]: +) -> Response[CatalogResponse | ErrorsList]: """Delete a catalog Delete a specific catalog by id @@ -84,10 +84,10 @@ def sync_detailed( def sync( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Optional[Union[CatalogResponse, ErrorsList]]: +) -> CatalogResponse | ErrorsList | None: """Delete a catalog Delete a specific catalog by id @@ -110,10 +110,10 @@ def sync( async def asyncio_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Response[Union[CatalogResponse, ErrorsList]]: +) -> Response[CatalogResponse | ErrorsList]: """Delete a catalog Delete a specific catalog by id @@ -139,10 +139,10 @@ async def asyncio_detailed( async def asyncio( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Optional[Union[CatalogResponse, ErrorsList]]: +) -> CatalogResponse | ErrorsList | None: """Delete a catalog Delete a specific catalog by id diff --git a/rootly_sdk/api/catalogs/get_catalog.py b/rootly_sdk/api/catalogs/get_catalog.py index 59324e2a..4d6d46de 100644 --- a/rootly_sdk/api/catalogs/get_catalog.py +++ b/rootly_sdk/api/catalogs/get_catalog.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any from uuid import UUID import httpx @@ -12,7 +12,7 @@ def _get_kwargs( - id: Union[UUID, str], + id: UUID | str, ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "get", @@ -23,8 +23,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[CatalogResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CatalogResponse | ErrorsList | None: if response.status_code == 200: response_200 = CatalogResponse.from_dict(response.json()) @@ -42,8 +42,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[CatalogResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[CatalogResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -53,10 +53,10 @@ def _build_response( def sync_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Response[Union[CatalogResponse, ErrorsList]]: +) -> Response[CatalogResponse | ErrorsList]: """Retrieves a catalog Retrieves a specific catalog by id @@ -84,10 +84,10 @@ def sync_detailed( def sync( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Optional[Union[CatalogResponse, ErrorsList]]: +) -> CatalogResponse | ErrorsList | None: """Retrieves a catalog Retrieves a specific catalog by id @@ -110,10 +110,10 @@ def sync( async def asyncio_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Response[Union[CatalogResponse, ErrorsList]]: +) -> Response[CatalogResponse | ErrorsList]: """Retrieves a catalog Retrieves a specific catalog by id @@ -139,10 +139,10 @@ async def asyncio_detailed( async def asyncio( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Optional[Union[CatalogResponse, ErrorsList]]: +) -> CatalogResponse | ErrorsList | None: """Retrieves a catalog Retrieves a specific catalog by id diff --git a/rootly_sdk/api/catalogs/list_catalogs.py b/rootly_sdk/api/catalogs/list_catalogs.py index babbf4c7..cd3bd35f 100644 --- a/rootly_sdk/api/catalogs/list_catalogs.py +++ b/rootly_sdk/api/catalogs/list_catalogs.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -13,41 +13,41 @@ def _get_kwargs( *, - include: Union[Unset, ListCatalogsInclude] = UNSET, - sort: Union[Unset, ListCatalogsSort] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterexternal_id: Union[Unset, str] = UNSET, - filtermanaged_by: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filterslugeq: Union[Unset, str] = UNSET, - filterslugnot_eq: Union[Unset, str] = UNSET, - filterslugin: Union[Unset, str] = UNSET, - filterslugnot_in: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, - filtermanaged_byeq: Union[Unset, str] = UNSET, - filtermanaged_bynot_eq: Union[Unset, str] = UNSET, - filtermanaged_byin: Union[Unset, str] = UNSET, - filtermanaged_bynot_in: Union[Unset, str] = UNSET, + include: Unset | ListCatalogsInclude = UNSET, + sort: Unset | ListCatalogsSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterexternal_id: Unset | str = UNSET, + filtermanaged_by: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filtermanaged_byeq: Unset | str = UNSET, + filtermanaged_bynot_eq: Unset | str = UNSET, + filtermanaged_byin: Unset | str = UNSET, + filtermanaged_bynot_in: Unset | str = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} - json_include: Union[Unset, str] = UNSET + json_include: Unset | str = UNSET if not isinstance(include, Unset): json_include = include params["include"] = json_include - json_sort: Union[Unset, str] = UNSET + json_sort: Unset | str = UNSET if not isinstance(sort, Unset): json_sort = sort @@ -110,7 +110,7 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[CatalogList]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> CatalogList | None: if response.status_code == 200: response_200 = CatalogList.from_dict(response.json()) @@ -122,7 +122,7 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[CatalogList]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[CatalogList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -134,31 +134,31 @@ def _build_response(*, client: Union[AuthenticatedClient, Client], response: htt def sync_detailed( *, client: AuthenticatedClient, - include: Union[Unset, ListCatalogsInclude] = UNSET, - sort: Union[Unset, ListCatalogsSort] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterexternal_id: Union[Unset, str] = UNSET, - filtermanaged_by: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filterslugeq: Union[Unset, str] = UNSET, - filterslugnot_eq: Union[Unset, str] = UNSET, - filterslugin: Union[Unset, str] = UNSET, - filterslugnot_in: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, - filtermanaged_byeq: Union[Unset, str] = UNSET, - filtermanaged_bynot_eq: Union[Unset, str] = UNSET, - filtermanaged_byin: Union[Unset, str] = UNSET, - filtermanaged_bynot_in: Union[Unset, str] = UNSET, + include: Unset | ListCatalogsInclude = UNSET, + sort: Unset | ListCatalogsSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterexternal_id: Unset | str = UNSET, + filtermanaged_by: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filtermanaged_byeq: Unset | str = UNSET, + filtermanaged_bynot_eq: Unset | str = UNSET, + filtermanaged_byin: Unset | str = UNSET, + filtermanaged_bynot_in: Unset | str = UNSET, ) -> Response[CatalogList]: """List catalogs @@ -237,32 +237,32 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: Union[Unset, ListCatalogsInclude] = UNSET, - sort: Union[Unset, ListCatalogsSort] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterexternal_id: Union[Unset, str] = UNSET, - filtermanaged_by: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filterslugeq: Union[Unset, str] = UNSET, - filterslugnot_eq: Union[Unset, str] = UNSET, - filterslugin: Union[Unset, str] = UNSET, - filterslugnot_in: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, - filtermanaged_byeq: Union[Unset, str] = UNSET, - filtermanaged_bynot_eq: Union[Unset, str] = UNSET, - filtermanaged_byin: Union[Unset, str] = UNSET, - filtermanaged_bynot_in: Union[Unset, str] = UNSET, -) -> Optional[CatalogList]: + include: Unset | ListCatalogsInclude = UNSET, + sort: Unset | ListCatalogsSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterexternal_id: Unset | str = UNSET, + filtermanaged_by: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filtermanaged_byeq: Unset | str = UNSET, + filtermanaged_bynot_eq: Unset | str = UNSET, + filtermanaged_byin: Unset | str = UNSET, + filtermanaged_bynot_in: Unset | str = UNSET, +) -> CatalogList | None: """List catalogs List catalogs @@ -335,31 +335,31 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: Union[Unset, ListCatalogsInclude] = UNSET, - sort: Union[Unset, ListCatalogsSort] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterexternal_id: Union[Unset, str] = UNSET, - filtermanaged_by: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filterslugeq: Union[Unset, str] = UNSET, - filterslugnot_eq: Union[Unset, str] = UNSET, - filterslugin: Union[Unset, str] = UNSET, - filterslugnot_in: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, - filtermanaged_byeq: Union[Unset, str] = UNSET, - filtermanaged_bynot_eq: Union[Unset, str] = UNSET, - filtermanaged_byin: Union[Unset, str] = UNSET, - filtermanaged_bynot_in: Union[Unset, str] = UNSET, + include: Unset | ListCatalogsInclude = UNSET, + sort: Unset | ListCatalogsSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterexternal_id: Unset | str = UNSET, + filtermanaged_by: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filtermanaged_byeq: Unset | str = UNSET, + filtermanaged_bynot_eq: Unset | str = UNSET, + filtermanaged_byin: Unset | str = UNSET, + filtermanaged_bynot_in: Unset | str = UNSET, ) -> Response[CatalogList]: """List catalogs @@ -436,32 +436,32 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: Union[Unset, ListCatalogsInclude] = UNSET, - sort: Union[Unset, ListCatalogsSort] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterexternal_id: Union[Unset, str] = UNSET, - filtermanaged_by: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filterslugeq: Union[Unset, str] = UNSET, - filterslugnot_eq: Union[Unset, str] = UNSET, - filterslugin: Union[Unset, str] = UNSET, - filterslugnot_in: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, - filtermanaged_byeq: Union[Unset, str] = UNSET, - filtermanaged_bynot_eq: Union[Unset, str] = UNSET, - filtermanaged_byin: Union[Unset, str] = UNSET, - filtermanaged_bynot_in: Union[Unset, str] = UNSET, -) -> Optional[CatalogList]: + include: Unset | ListCatalogsInclude = UNSET, + sort: Unset | ListCatalogsSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterexternal_id: Unset | str = UNSET, + filtermanaged_by: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filtermanaged_byeq: Unset | str = UNSET, + filtermanaged_bynot_eq: Unset | str = UNSET, + filtermanaged_byin: Unset | str = UNSET, + filtermanaged_bynot_in: Unset | str = UNSET, +) -> CatalogList | None: """List catalogs List catalogs diff --git a/rootly_sdk/api/catalogs/update_catalog.py b/rootly_sdk/api/catalogs/update_catalog.py index 93d889a8..c4838523 100644 --- a/rootly_sdk/api/catalogs/update_catalog.py +++ b/rootly_sdk/api/catalogs/update_catalog.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any from uuid import UUID import httpx @@ -13,7 +13,7 @@ def _get_kwargs( - id: Union[UUID, str], + id: UUID | str, *, body: UpdateCatalog, ) -> dict[str, Any]: @@ -33,8 +33,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[CatalogResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CatalogResponse | ErrorsList | None: if response.status_code == 200: response_200 = CatalogResponse.from_dict(response.json()) @@ -52,8 +52,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[CatalogResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[CatalogResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -63,11 +63,11 @@ def _build_response( def sync_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdateCatalog, -) -> Response[Union[CatalogResponse, ErrorsList]]: +) -> Response[CatalogResponse | ErrorsList]: """Update a catalog Update a specific catalog by id @@ -97,11 +97,11 @@ def sync_detailed( def sync( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdateCatalog, -) -> Optional[Union[CatalogResponse, ErrorsList]]: +) -> CatalogResponse | ErrorsList | None: """Update a catalog Update a specific catalog by id @@ -126,11 +126,11 @@ def sync( async def asyncio_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdateCatalog, -) -> Response[Union[CatalogResponse, ErrorsList]]: +) -> Response[CatalogResponse | ErrorsList]: """Update a catalog Update a specific catalog by id @@ -158,11 +158,11 @@ async def asyncio_detailed( async def asyncio( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdateCatalog, -) -> Optional[Union[CatalogResponse, ErrorsList]]: +) -> CatalogResponse | ErrorsList | None: """Update a catalog Update a specific catalog by id diff --git a/rootly_sdk/api/causes/create_cause.py b/rootly_sdk/api/causes/create_cause.py index 8762e9c3..963bab83 100644 --- a/rootly_sdk/api/causes/create_cause.py +++ b/rootly_sdk/api/causes/create_cause.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[CauseResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CauseResponse | ErrorsList | None: if response.status_code == 201: response_201 = CauseResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[CauseResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[CauseResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +69,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewCause, -) -> Response[Union[CauseResponse, ErrorsList]]: +) -> Response[CauseResponse | ErrorsList]: """Creates a cause Creates a new cause from provided data @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: NewCause, -) -> Optional[Union[CauseResponse, ErrorsList]]: +) -> CauseResponse | ErrorsList | None: """Creates a cause Creates a new cause from provided data @@ -126,7 +126,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewCause, -) -> Response[Union[CauseResponse, ErrorsList]]: +) -> Response[CauseResponse | ErrorsList]: """Creates a cause Creates a new cause from provided data @@ -155,7 +155,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewCause, -) -> Optional[Union[CauseResponse, ErrorsList]]: +) -> CauseResponse | ErrorsList | None: """Creates a cause Creates a new cause from provided data diff --git a/rootly_sdk/api/causes/create_cause_catalog_property.py b/rootly_sdk/api/causes/create_cause_catalog_property.py index 91b16895..753ab575 100644 --- a/rootly_sdk/api/causes/create_cause_catalog_property.py +++ b/rootly_sdk/api/causes/create_cause_catalog_property.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[CatalogPropertyResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CatalogPropertyResponse | ErrorsList | None: if response.status_code == 201: response_201 = CatalogPropertyResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[CatalogPropertyResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[CatalogPropertyResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +69,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewCatalogProperty, -) -> Response[Union[CatalogPropertyResponse, ErrorsList]]: +) -> Response[CatalogPropertyResponse | ErrorsList]: """Creates a Catalog Property Creates a new Catalog Property from provided data @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: NewCatalogProperty, -) -> Optional[Union[CatalogPropertyResponse, ErrorsList]]: +) -> CatalogPropertyResponse | ErrorsList | None: """Creates a Catalog Property Creates a new Catalog Property from provided data @@ -126,7 +126,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewCatalogProperty, -) -> Response[Union[CatalogPropertyResponse, ErrorsList]]: +) -> Response[CatalogPropertyResponse | ErrorsList]: """Creates a Catalog Property Creates a new Catalog Property from provided data @@ -155,7 +155,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewCatalogProperty, -) -> Optional[Union[CatalogPropertyResponse, ErrorsList]]: +) -> CatalogPropertyResponse | ErrorsList | None: """Creates a Catalog Property Creates a new Catalog Property from provided data diff --git a/rootly_sdk/api/causes/delete_cause.py b/rootly_sdk/api/causes/delete_cause.py index 59220ddd..e025be3a 100644 --- a/rootly_sdk/api/causes/delete_cause.py +++ b/rootly_sdk/api/causes/delete_cause.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any from uuid import UUID import httpx @@ -12,7 +12,7 @@ def _get_kwargs( - id: Union[UUID, str], + id: UUID | str, ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "delete", @@ -23,8 +23,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[CauseResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CauseResponse | ErrorsList | None: if response.status_code == 200: response_200 = CauseResponse.from_dict(response.json()) @@ -42,8 +42,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[CauseResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[CauseResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -53,10 +53,10 @@ def _build_response( def sync_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Response[Union[CauseResponse, ErrorsList]]: +) -> Response[CauseResponse | ErrorsList]: """Delete a cause Delete a specific cause by id @@ -84,10 +84,10 @@ def sync_detailed( def sync( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Optional[Union[CauseResponse, ErrorsList]]: +) -> CauseResponse | ErrorsList | None: """Delete a cause Delete a specific cause by id @@ -110,10 +110,10 @@ def sync( async def asyncio_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Response[Union[CauseResponse, ErrorsList]]: +) -> Response[CauseResponse | ErrorsList]: """Delete a cause Delete a specific cause by id @@ -139,10 +139,10 @@ async def asyncio_detailed( async def asyncio( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Optional[Union[CauseResponse, ErrorsList]]: +) -> CauseResponse | ErrorsList | None: """Delete a cause Delete a specific cause by id diff --git a/rootly_sdk/api/causes/get_cause.py b/rootly_sdk/api/causes/get_cause.py index f8a5cfc6..d0c85914 100644 --- a/rootly_sdk/api/causes/get_cause.py +++ b/rootly_sdk/api/causes/get_cause.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any from uuid import UUID import httpx @@ -12,7 +12,7 @@ def _get_kwargs( - id: Union[UUID, str], + id: UUID | str, ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "get", @@ -23,8 +23,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[CauseResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CauseResponse | ErrorsList | None: if response.status_code == 200: response_200 = CauseResponse.from_dict(response.json()) @@ -42,8 +42,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[CauseResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[CauseResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -53,10 +53,10 @@ def _build_response( def sync_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Response[Union[CauseResponse, ErrorsList]]: +) -> Response[CauseResponse | ErrorsList]: """Retrieves a cause Retrieves a specific cause by id @@ -84,10 +84,10 @@ def sync_detailed( def sync( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Optional[Union[CauseResponse, ErrorsList]]: +) -> CauseResponse | ErrorsList | None: """Retrieves a cause Retrieves a specific cause by id @@ -110,10 +110,10 @@ def sync( async def asyncio_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Response[Union[CauseResponse, ErrorsList]]: +) -> Response[CauseResponse | ErrorsList]: """Retrieves a cause Retrieves a specific cause by id @@ -139,10 +139,10 @@ async def asyncio_detailed( async def asyncio( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Optional[Union[CauseResponse, ErrorsList]]: +) -> CauseResponse | ErrorsList | None: """Retrieves a cause Retrieves a specific cause by id diff --git a/rootly_sdk/api/causes/list_cause_catalog_properties.py b/rootly_sdk/api/causes/list_cause_catalog_properties.py index 714d68a1..665840f4 100644 --- a/rootly_sdk/api/causes/list_cause_catalog_properties.py +++ b/rootly_sdk/api/causes/list_cause_catalog_properties.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -17,27 +17,27 @@ def _get_kwargs( *, - include: Union[Unset, ListCauseCatalogPropertiesInclude] = UNSET, - sort: Union[Unset, ListCauseCatalogPropertiesSort] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterkind: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, + include: Unset | ListCauseCatalogPropertiesInclude = UNSET, + sort: Unset | ListCauseCatalogPropertiesSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} - json_include: Union[Unset, str] = UNSET + json_include: Unset | str = UNSET if not isinstance(include, Unset): json_include = include params["include"] = json_include - json_sort: Union[Unset, str] = UNSET + json_sort: Unset | str = UNSET if not isinstance(sort, Unset): json_sort = sort @@ -72,9 +72,7 @@ def _get_kwargs( return _kwargs -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[CatalogPropertyList]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> CatalogPropertyList | None: if response.status_code == 200: response_200 = CatalogPropertyList.from_dict(response.json()) @@ -86,9 +84,7 @@ def _parse_response( return None -def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[CatalogPropertyList]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[CatalogPropertyList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -100,17 +96,17 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - include: Union[Unset, ListCauseCatalogPropertiesInclude] = UNSET, - sort: Union[Unset, ListCauseCatalogPropertiesSort] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterkind: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, + include: Unset | ListCauseCatalogPropertiesInclude = UNSET, + sort: Unset | ListCauseCatalogPropertiesSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> Response[CatalogPropertyList]: """List Catalog Properties @@ -161,18 +157,18 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: Union[Unset, ListCauseCatalogPropertiesInclude] = UNSET, - sort: Union[Unset, ListCauseCatalogPropertiesSort] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterkind: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, -) -> Optional[CatalogPropertyList]: + include: Unset | ListCauseCatalogPropertiesInclude = UNSET, + sort: Unset | ListCauseCatalogPropertiesSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, +) -> CatalogPropertyList | None: """List Catalog Properties List Cause Catalog Properties @@ -217,17 +213,17 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: Union[Unset, ListCauseCatalogPropertiesInclude] = UNSET, - sort: Union[Unset, ListCauseCatalogPropertiesSort] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterkind: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, + include: Unset | ListCauseCatalogPropertiesInclude = UNSET, + sort: Unset | ListCauseCatalogPropertiesSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> Response[CatalogPropertyList]: """List Catalog Properties @@ -276,18 +272,18 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: Union[Unset, ListCauseCatalogPropertiesInclude] = UNSET, - sort: Union[Unset, ListCauseCatalogPropertiesSort] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterkind: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, -) -> Optional[CatalogPropertyList]: + include: Unset | ListCauseCatalogPropertiesInclude = UNSET, + sort: Unset | ListCauseCatalogPropertiesSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, +) -> CatalogPropertyList | None: """List Catalog Properties List Cause Catalog Properties diff --git a/rootly_sdk/api/causes/list_causes.py b/rootly_sdk/api/causes/list_causes.py index c33d8b2d..2da725c2 100644 --- a/rootly_sdk/api/causes/list_causes.py +++ b/rootly_sdk/api/causes/list_causes.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -11,24 +11,24 @@ def _get_kwargs( *, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filterslugeq: Union[Unset, str] = UNSET, - filterslugnot_eq: Union[Unset, str] = UNSET, - filterslugin: Union[Unset, str] = UNSET, - filterslugnot_in: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -79,7 +79,7 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[CauseList]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> CauseList | None: if response.status_code == 200: response_200 = CauseList.from_dict(response.json()) @@ -91,7 +91,7 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[CauseList]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[CauseList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -103,24 +103,24 @@ def _build_response(*, client: Union[AuthenticatedClient, Client], response: htt def sync_detailed( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filterslugeq: Union[Unset, str] = UNSET, - filterslugnot_eq: Union[Unset, str] = UNSET, - filterslugin: Union[Unset, str] = UNSET, - filterslugnot_in: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, ) -> Response[CauseList]: """List causes @@ -185,25 +185,25 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filterslugeq: Union[Unset, str] = UNSET, - filterslugnot_eq: Union[Unset, str] = UNSET, - filterslugin: Union[Unset, str] = UNSET, - filterslugnot_in: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, -) -> Optional[CauseList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, +) -> CauseList | None: """List causes List causes @@ -262,24 +262,24 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filterslugeq: Union[Unset, str] = UNSET, - filterslugnot_eq: Union[Unset, str] = UNSET, - filterslugin: Union[Unset, str] = UNSET, - filterslugnot_in: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, ) -> Response[CauseList]: """List causes @@ -342,25 +342,25 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filterslugeq: Union[Unset, str] = UNSET, - filterslugnot_eq: Union[Unset, str] = UNSET, - filterslugin: Union[Unset, str] = UNSET, - filterslugnot_in: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, -) -> Optional[CauseList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, +) -> CauseList | None: """List causes List causes diff --git a/rootly_sdk/api/causes/update_cause.py b/rootly_sdk/api/causes/update_cause.py index 39ff3759..a33c39fc 100644 --- a/rootly_sdk/api/causes/update_cause.py +++ b/rootly_sdk/api/causes/update_cause.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any from uuid import UUID import httpx @@ -13,7 +13,7 @@ def _get_kwargs( - id: Union[UUID, str], + id: UUID | str, *, body: UpdateCause, ) -> dict[str, Any]: @@ -33,8 +33,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[CauseResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CauseResponse | ErrorsList | None: if response.status_code == 200: response_200 = CauseResponse.from_dict(response.json()) @@ -52,8 +52,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[CauseResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[CauseResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -63,11 +63,11 @@ def _build_response( def sync_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdateCause, -) -> Response[Union[CauseResponse, ErrorsList]]: +) -> Response[CauseResponse | ErrorsList]: """Update a cause Update a specific cause by id @@ -97,11 +97,11 @@ def sync_detailed( def sync( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdateCause, -) -> Optional[Union[CauseResponse, ErrorsList]]: +) -> CauseResponse | ErrorsList | None: """Update a cause Update a specific cause by id @@ -126,11 +126,11 @@ def sync( async def asyncio_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdateCause, -) -> Response[Union[CauseResponse, ErrorsList]]: +) -> Response[CauseResponse | ErrorsList]: """Update a cause Update a specific cause by id @@ -158,11 +158,11 @@ async def asyncio_detailed( async def asyncio( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdateCause, -) -> Optional[Union[CauseResponse, ErrorsList]]: +) -> CauseResponse | ErrorsList | None: """Update a cause Update a specific cause by id diff --git a/rootly_sdk/api/communications_groups/create_communications_group.py b/rootly_sdk/api/communications_groups/create_communications_group.py index c02b8fcd..c3ed86fd 100644 --- a/rootly_sdk/api/communications_groups/create_communications_group.py +++ b/rootly_sdk/api/communications_groups/create_communications_group.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[CommunicationsGroupResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CommunicationsGroupResponse | ErrorsList | None: if response.status_code == 201: response_201 = CommunicationsGroupResponse.from_dict(response.json()) @@ -50,8 +50,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[CommunicationsGroupResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[CommunicationsGroupResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -64,7 +64,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewCommunicationsGroup, -) -> Response[Union[CommunicationsGroupResponse, ErrorsList]]: +) -> Response[CommunicationsGroupResponse | ErrorsList]: """Creates a communications group Creates a new communications group from provided data @@ -95,7 +95,7 @@ def sync( *, client: AuthenticatedClient, body: NewCommunicationsGroup, -) -> Optional[Union[CommunicationsGroupResponse, ErrorsList]]: +) -> CommunicationsGroupResponse | ErrorsList | None: """Creates a communications group Creates a new communications group from provided data @@ -121,7 +121,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewCommunicationsGroup, -) -> Response[Union[CommunicationsGroupResponse, ErrorsList]]: +) -> Response[CommunicationsGroupResponse | ErrorsList]: """Creates a communications group Creates a new communications group from provided data @@ -150,7 +150,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewCommunicationsGroup, -) -> Optional[Union[CommunicationsGroupResponse, ErrorsList]]: +) -> CommunicationsGroupResponse | ErrorsList | None: """Creates a communications group Creates a new communications group from provided data diff --git a/rootly_sdk/api/communications_groups/delete_communications_group.py b/rootly_sdk/api/communications_groups/delete_communications_group.py index 9b8f1c84..3101f2d4 100644 --- a/rootly_sdk/api/communications_groups/delete_communications_group.py +++ b/rootly_sdk/api/communications_groups/delete_communications_group.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union, cast +from typing import Any, cast import httpx @@ -20,9 +20,7 @@ def _get_kwargs( return _kwargs -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[Any, ErrorsList]]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Any | ErrorsList | None: if response.status_code == 200: response_200 = cast(Any, None) return response_200 @@ -38,9 +36,7 @@ def _parse_response( return None -def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[Any, ErrorsList]]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Any | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -53,7 +49,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[Any, ErrorsList]]: +) -> Response[Any | ErrorsList]: """Deletes a communications group Deletes a communications group @@ -84,7 +80,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[Any, ErrorsList]]: +) -> Any | ErrorsList | None: """Deletes a communications group Deletes a communications group @@ -110,7 +106,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[Any, ErrorsList]]: +) -> Response[Any | ErrorsList]: """Deletes a communications group Deletes a communications group @@ -139,7 +135,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[Any, ErrorsList]]: +) -> Any | ErrorsList | None: """Deletes a communications group Deletes a communications group diff --git a/rootly_sdk/api/communications_groups/get_communications_group.py b/rootly_sdk/api/communications_groups/get_communications_group.py index 3120d336..d50430d4 100644 --- a/rootly_sdk/api/communications_groups/get_communications_group.py +++ b/rootly_sdk/api/communications_groups/get_communications_group.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[CommunicationsGroupResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CommunicationsGroupResponse | ErrorsList | None: if response.status_code == 200: response_200 = CommunicationsGroupResponse.from_dict(response.json()) @@ -41,8 +41,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[CommunicationsGroupResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[CommunicationsGroupResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -55,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[CommunicationsGroupResponse, ErrorsList]]: +) -> Response[CommunicationsGroupResponse | ErrorsList]: """Shows a communications group Shows details of a communications group @@ -86,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[CommunicationsGroupResponse, ErrorsList]]: +) -> CommunicationsGroupResponse | ErrorsList | None: """Shows a communications group Shows details of a communications group @@ -112,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[CommunicationsGroupResponse, ErrorsList]]: +) -> Response[CommunicationsGroupResponse | ErrorsList]: """Shows a communications group Shows details of a communications group @@ -141,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[CommunicationsGroupResponse, ErrorsList]]: +) -> CommunicationsGroupResponse | ErrorsList | None: """Shows a communications group Shows details of a communications group diff --git a/rootly_sdk/api/communications_groups/list_communications_groups.py b/rootly_sdk/api/communications_groups/list_communications_groups.py index 574ab3a2..c3054d0c 100644 --- a/rootly_sdk/api/communications_groups/list_communications_groups.py +++ b/rootly_sdk/api/communications_groups/list_communications_groups.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -11,19 +11,19 @@ def _get_kwargs( *, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filteris_private: Union[Unset, str] = UNSET, - filtercommunication_type_id: Union[Unset, str] = UNSET, - filtercondition_type: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filteris_private: Unset | str = UNSET, + filtercommunication_type_id: Unset | str = UNSET, + filtercondition_type: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -65,8 +65,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[CommunicationsGroupsResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CommunicationsGroupsResponse | None: if response.status_code == 200: response_200 = CommunicationsGroupsResponse.from_dict(response.json()) @@ -79,7 +79,7 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response + *, client: AuthenticatedClient | Client, response: httpx.Response ) -> Response[CommunicationsGroupsResponse]: return Response( status_code=HTTPStatus(response.status_code), @@ -92,19 +92,19 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filteris_private: Union[Unset, str] = UNSET, - filtercommunication_type_id: Union[Unset, str] = UNSET, - filtercondition_type: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filteris_private: Unset | str = UNSET, + filtercommunication_type_id: Unset | str = UNSET, + filtercondition_type: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[CommunicationsGroupsResponse]: """Lists communications groups @@ -159,20 +159,20 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filteris_private: Union[Unset, str] = UNSET, - filtercommunication_type_id: Union[Unset, str] = UNSET, - filtercondition_type: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, -) -> Optional[CommunicationsGroupsResponse]: + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filteris_private: Unset | str = UNSET, + filtercommunication_type_id: Unset | str = UNSET, + filtercondition_type: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, +) -> CommunicationsGroupsResponse | None: """Lists communications groups Lists communications groups @@ -221,19 +221,19 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filteris_private: Union[Unset, str] = UNSET, - filtercommunication_type_id: Union[Unset, str] = UNSET, - filtercondition_type: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filteris_private: Unset | str = UNSET, + filtercommunication_type_id: Unset | str = UNSET, + filtercondition_type: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[CommunicationsGroupsResponse]: """Lists communications groups @@ -286,20 +286,20 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filteris_private: Union[Unset, str] = UNSET, - filtercommunication_type_id: Union[Unset, str] = UNSET, - filtercondition_type: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, -) -> Optional[CommunicationsGroupsResponse]: + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filteris_private: Unset | str = UNSET, + filtercommunication_type_id: Unset | str = UNSET, + filtercondition_type: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, +) -> CommunicationsGroupsResponse | None: """Lists communications groups Lists communications groups diff --git a/rootly_sdk/api/communications_groups/update_communications_group.py b/rootly_sdk/api/communications_groups/update_communications_group.py index 8ff0d27b..d8ec28ec 100644 --- a/rootly_sdk/api/communications_groups/update_communications_group.py +++ b/rootly_sdk/api/communications_groups/update_communications_group.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[CommunicationsGroupResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CommunicationsGroupResponse | ErrorsList | None: if response.status_code == 200: response_200 = CommunicationsGroupResponse.from_dict(response.json()) @@ -51,8 +51,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[CommunicationsGroupResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[CommunicationsGroupResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateCommunicationsGroup, -) -> Response[Union[CommunicationsGroupResponse, ErrorsList]]: +) -> Response[CommunicationsGroupResponse | ErrorsList]: """Updates a communications group Updates a communications group @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateCommunicationsGroup, -) -> Optional[Union[CommunicationsGroupResponse, ErrorsList]]: +) -> CommunicationsGroupResponse | ErrorsList | None: """Updates a communications group Updates a communications group @@ -129,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateCommunicationsGroup, -) -> Response[Union[CommunicationsGroupResponse, ErrorsList]]: +) -> Response[CommunicationsGroupResponse | ErrorsList]: """Updates a communications group Updates a communications group @@ -161,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateCommunicationsGroup, -) -> Optional[Union[CommunicationsGroupResponse, ErrorsList]]: +) -> CommunicationsGroupResponse | ErrorsList | None: """Updates a communications group Updates a communications group diff --git a/rootly_sdk/api/communications_stages/create_communications_stage.py b/rootly_sdk/api/communications_stages/create_communications_stage.py index a25921cf..6d610ff8 100644 --- a/rootly_sdk/api/communications_stages/create_communications_stage.py +++ b/rootly_sdk/api/communications_stages/create_communications_stage.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[CommunicationsStageResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CommunicationsStageResponse | ErrorsList | None: if response.status_code == 201: response_201 = CommunicationsStageResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[CommunicationsStageResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[CommunicationsStageResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +69,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewCommunicationsStage, -) -> Response[Union[CommunicationsStageResponse, ErrorsList]]: +) -> Response[CommunicationsStageResponse | ErrorsList]: """Creates a communications stage Creates a new communications stage from provided data @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: NewCommunicationsStage, -) -> Optional[Union[CommunicationsStageResponse, ErrorsList]]: +) -> CommunicationsStageResponse | ErrorsList | None: """Creates a communications stage Creates a new communications stage from provided data @@ -126,7 +126,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewCommunicationsStage, -) -> Response[Union[CommunicationsStageResponse, ErrorsList]]: +) -> Response[CommunicationsStageResponse | ErrorsList]: """Creates a communications stage Creates a new communications stage from provided data @@ -155,7 +155,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewCommunicationsStage, -) -> Optional[Union[CommunicationsStageResponse, ErrorsList]]: +) -> CommunicationsStageResponse | ErrorsList | None: """Creates a communications stage Creates a new communications stage from provided data diff --git a/rootly_sdk/api/communications_stages/delete_communications_stage.py b/rootly_sdk/api/communications_stages/delete_communications_stage.py index a8efae30..acee9e80 100644 --- a/rootly_sdk/api/communications_stages/delete_communications_stage.py +++ b/rootly_sdk/api/communications_stages/delete_communications_stage.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union, cast +from typing import Any, cast import httpx @@ -20,9 +20,7 @@ def _get_kwargs( return _kwargs -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[Any, ErrorsList]]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Any | ErrorsList | None: if response.status_code == 200: response_200 = cast(Any, None) return response_200 @@ -38,9 +36,7 @@ def _parse_response( return None -def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[Any, ErrorsList]]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Any | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -53,7 +49,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[Any, ErrorsList]]: +) -> Response[Any | ErrorsList]: """Deletes a communications stage Deletes a communications stage @@ -84,7 +80,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[Any, ErrorsList]]: +) -> Any | ErrorsList | None: """Deletes a communications stage Deletes a communications stage @@ -110,7 +106,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[Any, ErrorsList]]: +) -> Response[Any | ErrorsList]: """Deletes a communications stage Deletes a communications stage @@ -139,7 +135,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[Any, ErrorsList]]: +) -> Any | ErrorsList | None: """Deletes a communications stage Deletes a communications stage diff --git a/rootly_sdk/api/communications_stages/get_communications_stage.py b/rootly_sdk/api/communications_stages/get_communications_stage.py index 349beb9b..11af7837 100644 --- a/rootly_sdk/api/communications_stages/get_communications_stage.py +++ b/rootly_sdk/api/communications_stages/get_communications_stage.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[CommunicationsStageResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CommunicationsStageResponse | ErrorsList | None: if response.status_code == 200: response_200 = CommunicationsStageResponse.from_dict(response.json()) @@ -41,8 +41,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[CommunicationsStageResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[CommunicationsStageResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -55,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[CommunicationsStageResponse, ErrorsList]]: +) -> Response[CommunicationsStageResponse | ErrorsList]: """Shows a communications stage Shows details of a communications stage @@ -86,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[CommunicationsStageResponse, ErrorsList]]: +) -> CommunicationsStageResponse | ErrorsList | None: """Shows a communications stage Shows details of a communications stage @@ -112,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[CommunicationsStageResponse, ErrorsList]]: +) -> Response[CommunicationsStageResponse | ErrorsList]: """Shows a communications stage Shows details of a communications stage @@ -141,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[CommunicationsStageResponse, ErrorsList]]: +) -> CommunicationsStageResponse | ErrorsList | None: """Shows a communications stage Shows details of a communications stage diff --git a/rootly_sdk/api/communications_stages/list_communications_stages.py b/rootly_sdk/api/communications_stages/list_communications_stages.py index e9375099..e68a79e0 100644 --- a/rootly_sdk/api/communications_stages/list_communications_stages.py +++ b/rootly_sdk/api/communications_stages/list_communications_stages.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -11,16 +11,16 @@ def _get_kwargs( *, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -56,8 +56,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[CommunicationsStagesResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CommunicationsStagesResponse | None: if response.status_code == 200: response_200 = CommunicationsStagesResponse.from_dict(response.json()) @@ -70,7 +70,7 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response + *, client: AuthenticatedClient | Client, response: httpx.Response ) -> Response[CommunicationsStagesResponse]: return Response( status_code=HTTPStatus(response.status_code), @@ -83,16 +83,16 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[CommunicationsStagesResponse]: """Lists communications stages @@ -141,17 +141,17 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, -) -> Optional[CommunicationsStagesResponse]: + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, +) -> CommunicationsStagesResponse | None: """Lists communications stages Lists communications stages @@ -194,16 +194,16 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[CommunicationsStagesResponse]: """Lists communications stages @@ -250,17 +250,17 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, -) -> Optional[CommunicationsStagesResponse]: + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, +) -> CommunicationsStagesResponse | None: """Lists communications stages Lists communications stages diff --git a/rootly_sdk/api/communications_stages/update_communications_stage.py b/rootly_sdk/api/communications_stages/update_communications_stage.py index 51fc8ce7..0214d959 100644 --- a/rootly_sdk/api/communications_stages/update_communications_stage.py +++ b/rootly_sdk/api/communications_stages/update_communications_stage.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[CommunicationsStageResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CommunicationsStageResponse | ErrorsList | None: if response.status_code == 200: response_200 = CommunicationsStageResponse.from_dict(response.json()) @@ -51,8 +51,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[CommunicationsStageResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[CommunicationsStageResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateCommunicationsStage, -) -> Response[Union[CommunicationsStageResponse, ErrorsList]]: +) -> Response[CommunicationsStageResponse | ErrorsList]: """Updates a communications stage Updates a communications stage @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateCommunicationsStage, -) -> Optional[Union[CommunicationsStageResponse, ErrorsList]]: +) -> CommunicationsStageResponse | ErrorsList | None: """Updates a communications stage Updates a communications stage @@ -129,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateCommunicationsStage, -) -> Response[Union[CommunicationsStageResponse, ErrorsList]]: +) -> Response[CommunicationsStageResponse | ErrorsList]: """Updates a communications stage Updates a communications stage @@ -161,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateCommunicationsStage, -) -> Optional[Union[CommunicationsStageResponse, ErrorsList]]: +) -> CommunicationsStageResponse | ErrorsList | None: """Updates a communications stage Updates a communications stage diff --git a/rootly_sdk/api/communications_templates/create_communications_template.py b/rootly_sdk/api/communications_templates/create_communications_template.py index d3c18079..6c67d411 100644 --- a/rootly_sdk/api/communications_templates/create_communications_template.py +++ b/rootly_sdk/api/communications_templates/create_communications_template.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[CommunicationsTemplateResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CommunicationsTemplateResponse | ErrorsList | None: if response.status_code == 201: response_201 = CommunicationsTemplateResponse.from_dict(response.json()) @@ -50,8 +50,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[CommunicationsTemplateResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[CommunicationsTemplateResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -64,7 +64,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewCommunicationsTemplate, -) -> Response[Union[CommunicationsTemplateResponse, ErrorsList]]: +) -> Response[CommunicationsTemplateResponse | ErrorsList]: """Creates a communications template Creates a new communications template from provided data @@ -95,7 +95,7 @@ def sync( *, client: AuthenticatedClient, body: NewCommunicationsTemplate, -) -> Optional[Union[CommunicationsTemplateResponse, ErrorsList]]: +) -> CommunicationsTemplateResponse | ErrorsList | None: """Creates a communications template Creates a new communications template from provided data @@ -121,7 +121,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewCommunicationsTemplate, -) -> Response[Union[CommunicationsTemplateResponse, ErrorsList]]: +) -> Response[CommunicationsTemplateResponse | ErrorsList]: """Creates a communications template Creates a new communications template from provided data @@ -150,7 +150,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewCommunicationsTemplate, -) -> Optional[Union[CommunicationsTemplateResponse, ErrorsList]]: +) -> CommunicationsTemplateResponse | ErrorsList | None: """Creates a communications template Creates a new communications template from provided data diff --git a/rootly_sdk/api/communications_templates/delete_communications_template.py b/rootly_sdk/api/communications_templates/delete_communications_template.py index f8f22391..d1ffce2e 100644 --- a/rootly_sdk/api/communications_templates/delete_communications_template.py +++ b/rootly_sdk/api/communications_templates/delete_communications_template.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union, cast +from typing import Any, cast import httpx @@ -20,9 +20,7 @@ def _get_kwargs( return _kwargs -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[Any, ErrorsList]]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Any | ErrorsList | None: if response.status_code == 200: response_200 = cast(Any, None) return response_200 @@ -38,9 +36,7 @@ def _parse_response( return None -def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[Any, ErrorsList]]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Any | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -53,7 +49,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[Any, ErrorsList]]: +) -> Response[Any | ErrorsList]: """Deletes a communications template Deletes a communications template @@ -84,7 +80,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[Any, ErrorsList]]: +) -> Any | ErrorsList | None: """Deletes a communications template Deletes a communications template @@ -110,7 +106,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[Any, ErrorsList]]: +) -> Response[Any | ErrorsList]: """Deletes a communications template Deletes a communications template @@ -139,7 +135,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[Any, ErrorsList]]: +) -> Any | ErrorsList | None: """Deletes a communications template Deletes a communications template diff --git a/rootly_sdk/api/communications_templates/get_communications_template.py b/rootly_sdk/api/communications_templates/get_communications_template.py index baa98196..f8d67d19 100644 --- a/rootly_sdk/api/communications_templates/get_communications_template.py +++ b/rootly_sdk/api/communications_templates/get_communications_template.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[CommunicationsTemplateResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CommunicationsTemplateResponse | ErrorsList | None: if response.status_code == 200: response_200 = CommunicationsTemplateResponse.from_dict(response.json()) @@ -41,8 +41,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[CommunicationsTemplateResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[CommunicationsTemplateResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -55,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[CommunicationsTemplateResponse, ErrorsList]]: +) -> Response[CommunicationsTemplateResponse | ErrorsList]: """Shows a communications template Shows details of a communications template @@ -86,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[CommunicationsTemplateResponse, ErrorsList]]: +) -> CommunicationsTemplateResponse | ErrorsList | None: """Shows a communications template Shows details of a communications template @@ -112,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[CommunicationsTemplateResponse, ErrorsList]]: +) -> Response[CommunicationsTemplateResponse | ErrorsList]: """Shows a communications template Shows details of a communications template @@ -141,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[CommunicationsTemplateResponse, ErrorsList]]: +) -> CommunicationsTemplateResponse | ErrorsList | None: """Shows a communications template Shows details of a communications template diff --git a/rootly_sdk/api/communications_templates/list_communications_templates.py b/rootly_sdk/api/communications_templates/list_communications_templates.py index e8e25f3e..a3161de8 100644 --- a/rootly_sdk/api/communications_templates/list_communications_templates.py +++ b/rootly_sdk/api/communications_templates/list_communications_templates.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -11,17 +11,17 @@ def _get_kwargs( *, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtercommunication_type_id: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtercommunication_type_id: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -59,8 +59,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[CommunicationsTemplatesResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CommunicationsTemplatesResponse | None: if response.status_code == 200: response_200 = CommunicationsTemplatesResponse.from_dict(response.json()) @@ -73,7 +73,7 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response + *, client: AuthenticatedClient | Client, response: httpx.Response ) -> Response[CommunicationsTemplatesResponse]: return Response( status_code=HTTPStatus(response.status_code), @@ -86,17 +86,17 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtercommunication_type_id: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtercommunication_type_id: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[CommunicationsTemplatesResponse]: """Lists communications templates @@ -147,18 +147,18 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtercommunication_type_id: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, -) -> Optional[CommunicationsTemplatesResponse]: + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtercommunication_type_id: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, +) -> CommunicationsTemplatesResponse | None: """Lists communications templates Lists communications templates @@ -203,17 +203,17 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtercommunication_type_id: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtercommunication_type_id: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[CommunicationsTemplatesResponse]: """Lists communications templates @@ -262,18 +262,18 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtercommunication_type_id: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, -) -> Optional[CommunicationsTemplatesResponse]: + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtercommunication_type_id: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, +) -> CommunicationsTemplatesResponse | None: """Lists communications templates Lists communications templates diff --git a/rootly_sdk/api/communications_templates/update_communications_template.py b/rootly_sdk/api/communications_templates/update_communications_template.py index f0da99f7..5894b08a 100644 --- a/rootly_sdk/api/communications_templates/update_communications_template.py +++ b/rootly_sdk/api/communications_templates/update_communications_template.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[CommunicationsTemplateResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CommunicationsTemplateResponse | ErrorsList | None: if response.status_code == 200: response_200 = CommunicationsTemplateResponse.from_dict(response.json()) @@ -51,8 +51,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[CommunicationsTemplateResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[CommunicationsTemplateResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateCommunicationsTemplate, -) -> Response[Union[CommunicationsTemplateResponse, ErrorsList]]: +) -> Response[CommunicationsTemplateResponse | ErrorsList]: """Updates a communications template Updates a communications template @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateCommunicationsTemplate, -) -> Optional[Union[CommunicationsTemplateResponse, ErrorsList]]: +) -> CommunicationsTemplateResponse | ErrorsList | None: """Updates a communications template Updates a communications template @@ -129,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateCommunicationsTemplate, -) -> Response[Union[CommunicationsTemplateResponse, ErrorsList]]: +) -> Response[CommunicationsTemplateResponse | ErrorsList]: """Updates a communications template Updates a communications template @@ -161,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateCommunicationsTemplate, -) -> Optional[Union[CommunicationsTemplateResponse, ErrorsList]]: +) -> CommunicationsTemplateResponse | ErrorsList | None: """Updates a communications template Updates a communications template diff --git a/rootly_sdk/api/communications_types/create_communications_type.py b/rootly_sdk/api/communications_types/create_communications_type.py index 20a87539..62e71775 100644 --- a/rootly_sdk/api/communications_types/create_communications_type.py +++ b/rootly_sdk/api/communications_types/create_communications_type.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[CommunicationsTypeResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CommunicationsTypeResponse | ErrorsList | None: if response.status_code == 201: response_201 = CommunicationsTypeResponse.from_dict(response.json()) @@ -50,8 +50,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[CommunicationsTypeResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[CommunicationsTypeResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -64,7 +64,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewCommunicationsType, -) -> Response[Union[CommunicationsTypeResponse, ErrorsList]]: +) -> Response[CommunicationsTypeResponse | ErrorsList]: """Creates a communications type Creates a new communications type from provided data @@ -95,7 +95,7 @@ def sync( *, client: AuthenticatedClient, body: NewCommunicationsType, -) -> Optional[Union[CommunicationsTypeResponse, ErrorsList]]: +) -> CommunicationsTypeResponse | ErrorsList | None: """Creates a communications type Creates a new communications type from provided data @@ -121,7 +121,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewCommunicationsType, -) -> Response[Union[CommunicationsTypeResponse, ErrorsList]]: +) -> Response[CommunicationsTypeResponse | ErrorsList]: """Creates a communications type Creates a new communications type from provided data @@ -150,7 +150,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewCommunicationsType, -) -> Optional[Union[CommunicationsTypeResponse, ErrorsList]]: +) -> CommunicationsTypeResponse | ErrorsList | None: """Creates a communications type Creates a new communications type from provided data diff --git a/rootly_sdk/api/communications_types/delete_communications_type.py b/rootly_sdk/api/communications_types/delete_communications_type.py index 5da11018..50705d45 100644 --- a/rootly_sdk/api/communications_types/delete_communications_type.py +++ b/rootly_sdk/api/communications_types/delete_communications_type.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union, cast +from typing import Any, cast import httpx @@ -20,9 +20,7 @@ def _get_kwargs( return _kwargs -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[Any, ErrorsList]]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Any | ErrorsList | None: if response.status_code == 200: response_200 = cast(Any, None) return response_200 @@ -38,9 +36,7 @@ def _parse_response( return None -def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[Any, ErrorsList]]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Any | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -53,7 +49,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[Any, ErrorsList]]: +) -> Response[Any | ErrorsList]: """Deletes a communications type Deletes a communications type @@ -84,7 +80,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[Any, ErrorsList]]: +) -> Any | ErrorsList | None: """Deletes a communications type Deletes a communications type @@ -110,7 +106,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[Any, ErrorsList]]: +) -> Response[Any | ErrorsList]: """Deletes a communications type Deletes a communications type @@ -139,7 +135,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[Any, ErrorsList]]: +) -> Any | ErrorsList | None: """Deletes a communications type Deletes a communications type diff --git a/rootly_sdk/api/communications_types/get_communications_type.py b/rootly_sdk/api/communications_types/get_communications_type.py index 59bdd836..6c3d3e3f 100644 --- a/rootly_sdk/api/communications_types/get_communications_type.py +++ b/rootly_sdk/api/communications_types/get_communications_type.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[CommunicationsTypeResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CommunicationsTypeResponse | ErrorsList | None: if response.status_code == 200: response_200 = CommunicationsTypeResponse.from_dict(response.json()) @@ -41,8 +41,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[CommunicationsTypeResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[CommunicationsTypeResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -55,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[CommunicationsTypeResponse, ErrorsList]]: +) -> Response[CommunicationsTypeResponse | ErrorsList]: """Shows a communications type Shows details of a communications type @@ -86,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[CommunicationsTypeResponse, ErrorsList]]: +) -> CommunicationsTypeResponse | ErrorsList | None: """Shows a communications type Shows details of a communications type @@ -112,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[CommunicationsTypeResponse, ErrorsList]]: +) -> Response[CommunicationsTypeResponse | ErrorsList]: """Shows a communications type Shows details of a communications type @@ -141,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[CommunicationsTypeResponse, ErrorsList]]: +) -> CommunicationsTypeResponse | ErrorsList | None: """Shows a communications type Shows details of a communications type diff --git a/rootly_sdk/api/communications_types/list_communications_types.py b/rootly_sdk/api/communications_types/list_communications_types.py index f67df31b..1d7c6b9a 100644 --- a/rootly_sdk/api/communications_types/list_communications_types.py +++ b/rootly_sdk/api/communications_types/list_communications_types.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -11,16 +11,16 @@ def _get_kwargs( *, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -56,8 +56,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[CommunicationsTypesResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CommunicationsTypesResponse | None: if response.status_code == 200: response_200 = CommunicationsTypesResponse.from_dict(response.json()) @@ -70,7 +70,7 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response + *, client: AuthenticatedClient | Client, response: httpx.Response ) -> Response[CommunicationsTypesResponse]: return Response( status_code=HTTPStatus(response.status_code), @@ -83,16 +83,16 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[CommunicationsTypesResponse]: """Lists communications types @@ -141,17 +141,17 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, -) -> Optional[CommunicationsTypesResponse]: + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, +) -> CommunicationsTypesResponse | None: """Lists communications types Lists communications types @@ -194,16 +194,16 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[CommunicationsTypesResponse]: """Lists communications types @@ -250,17 +250,17 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, -) -> Optional[CommunicationsTypesResponse]: + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, +) -> CommunicationsTypesResponse | None: """Lists communications types Lists communications types diff --git a/rootly_sdk/api/communications_types/update_communications_type.py b/rootly_sdk/api/communications_types/update_communications_type.py index 134d596b..cda47a9b 100644 --- a/rootly_sdk/api/communications_types/update_communications_type.py +++ b/rootly_sdk/api/communications_types/update_communications_type.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[CommunicationsTypeResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CommunicationsTypeResponse | ErrorsList | None: if response.status_code == 200: response_200 = CommunicationsTypeResponse.from_dict(response.json()) @@ -51,8 +51,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[CommunicationsTypeResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[CommunicationsTypeResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateCommunicationsType, -) -> Response[Union[CommunicationsTypeResponse, ErrorsList]]: +) -> Response[CommunicationsTypeResponse | ErrorsList]: """Updates a communications type Updates a communications type @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateCommunicationsType, -) -> Optional[Union[CommunicationsTypeResponse, ErrorsList]]: +) -> CommunicationsTypeResponse | ErrorsList | None: """Updates a communications type Updates a communications type @@ -129,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateCommunicationsType, -) -> Response[Union[CommunicationsTypeResponse, ErrorsList]]: +) -> Response[CommunicationsTypeResponse | ErrorsList]: """Updates a communications type Updates a communications type @@ -161,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateCommunicationsType, -) -> Optional[Union[CommunicationsTypeResponse, ErrorsList]]: +) -> CommunicationsTypeResponse | ErrorsList | None: """Updates a communications type Updates a communications type diff --git a/rootly_sdk/api/custom_forms/create_custom_form.py b/rootly_sdk/api/custom_forms/create_custom_form.py index 317f41b4..bbe174d9 100644 --- a/rootly_sdk/api/custom_forms/create_custom_form.py +++ b/rootly_sdk/api/custom_forms/create_custom_form.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[CustomFormResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CustomFormResponse | ErrorsList | None: if response.status_code == 201: response_201 = CustomFormResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[CustomFormResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[CustomFormResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +69,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewCustomForm, -) -> Response[Union[CustomFormResponse, ErrorsList]]: +) -> Response[CustomFormResponse | ErrorsList]: """Creates a custom form Creates a new custom form from provided data @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: NewCustomForm, -) -> Optional[Union[CustomFormResponse, ErrorsList]]: +) -> CustomFormResponse | ErrorsList | None: """Creates a custom form Creates a new custom form from provided data @@ -126,7 +126,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewCustomForm, -) -> Response[Union[CustomFormResponse, ErrorsList]]: +) -> Response[CustomFormResponse | ErrorsList]: """Creates a custom form Creates a new custom form from provided data @@ -155,7 +155,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewCustomForm, -) -> Optional[Union[CustomFormResponse, ErrorsList]]: +) -> CustomFormResponse | ErrorsList | None: """Creates a custom form Creates a new custom form from provided data diff --git a/rootly_sdk/api/custom_forms/delete_custom_form.py b/rootly_sdk/api/custom_forms/delete_custom_form.py index a707fa7c..18759967 100644 --- a/rootly_sdk/api/custom_forms/delete_custom_form.py +++ b/rootly_sdk/api/custom_forms/delete_custom_form.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any from uuid import UUID import httpx @@ -12,7 +12,7 @@ def _get_kwargs( - id: Union[UUID, str], + id: UUID | str, ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "delete", @@ -23,8 +23,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[CustomFormResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CustomFormResponse | ErrorsList | None: if response.status_code == 200: response_200 = CustomFormResponse.from_dict(response.json()) @@ -42,8 +42,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[CustomFormResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[CustomFormResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -53,10 +53,10 @@ def _build_response( def sync_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Response[Union[CustomFormResponse, ErrorsList]]: +) -> Response[CustomFormResponse | ErrorsList]: """Delete a custom form Delete a specific custom form by id @@ -84,10 +84,10 @@ def sync_detailed( def sync( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Optional[Union[CustomFormResponse, ErrorsList]]: +) -> CustomFormResponse | ErrorsList | None: """Delete a custom form Delete a specific custom form by id @@ -110,10 +110,10 @@ def sync( async def asyncio_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Response[Union[CustomFormResponse, ErrorsList]]: +) -> Response[CustomFormResponse | ErrorsList]: """Delete a custom form Delete a specific custom form by id @@ -139,10 +139,10 @@ async def asyncio_detailed( async def asyncio( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Optional[Union[CustomFormResponse, ErrorsList]]: +) -> CustomFormResponse | ErrorsList | None: """Delete a custom form Delete a specific custom form by id diff --git a/rootly_sdk/api/custom_forms/get_custom_form.py b/rootly_sdk/api/custom_forms/get_custom_form.py index a9a6bd95..b6d6b985 100644 --- a/rootly_sdk/api/custom_forms/get_custom_form.py +++ b/rootly_sdk/api/custom_forms/get_custom_form.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any from uuid import UUID import httpx @@ -12,7 +12,7 @@ def _get_kwargs( - id: Union[UUID, str], + id: UUID | str, ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "get", @@ -23,8 +23,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[CustomFormResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CustomFormResponse | ErrorsList | None: if response.status_code == 200: response_200 = CustomFormResponse.from_dict(response.json()) @@ -42,8 +42,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[CustomFormResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[CustomFormResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -53,10 +53,10 @@ def _build_response( def sync_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Response[Union[CustomFormResponse, ErrorsList]]: +) -> Response[CustomFormResponse | ErrorsList]: """Retrieves a custom form Retrieves a specific custom form by id @@ -84,10 +84,10 @@ def sync_detailed( def sync( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Optional[Union[CustomFormResponse, ErrorsList]]: +) -> CustomFormResponse | ErrorsList | None: """Retrieves a custom form Retrieves a specific custom form by id @@ -110,10 +110,10 @@ def sync( async def asyncio_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Response[Union[CustomFormResponse, ErrorsList]]: +) -> Response[CustomFormResponse | ErrorsList]: """Retrieves a custom form Retrieves a specific custom form by id @@ -139,10 +139,10 @@ async def asyncio_detailed( async def asyncio( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Optional[Union[CustomFormResponse, ErrorsList]]: +) -> CustomFormResponse | ErrorsList | None: """Retrieves a custom form Retrieves a specific custom form by id diff --git a/rootly_sdk/api/custom_forms/list_custom_forms.py b/rootly_sdk/api/custom_forms/list_custom_forms.py index 3c6aafc2..d1dc7aa2 100644 --- a/rootly_sdk/api/custom_forms/list_custom_forms.py +++ b/rootly_sdk/api/custom_forms/list_custom_forms.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -12,17 +12,17 @@ def _get_kwargs( *, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtercommand: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtercommand: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -60,8 +60,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[CustomFormList, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CustomFormList | ErrorsList | None: if response.status_code == 200: response_200 = CustomFormList.from_dict(response.json()) @@ -79,8 +79,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[CustomFormList, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[CustomFormList | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -92,18 +92,18 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtercommand: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, -) -> Response[Union[CustomFormList, ErrorsList]]: + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtercommand: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, +) -> Response[CustomFormList | ErrorsList]: """List custom forms List custom forms @@ -153,18 +153,18 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtercommand: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, -) -> Optional[Union[CustomFormList, ErrorsList]]: + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtercommand: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, +) -> CustomFormList | ErrorsList | None: """List custom forms List custom forms @@ -209,18 +209,18 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtercommand: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, -) -> Response[Union[CustomFormList, ErrorsList]]: + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtercommand: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, +) -> Response[CustomFormList | ErrorsList]: """List custom forms List custom forms @@ -268,18 +268,18 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtercommand: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, -) -> Optional[Union[CustomFormList, ErrorsList]]: + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtercommand: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, +) -> CustomFormList | ErrorsList | None: """List custom forms List custom forms diff --git a/rootly_sdk/api/custom_forms/update_custom_form.py b/rootly_sdk/api/custom_forms/update_custom_form.py index 717b2052..c5e1b259 100644 --- a/rootly_sdk/api/custom_forms/update_custom_form.py +++ b/rootly_sdk/api/custom_forms/update_custom_form.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any from uuid import UUID import httpx @@ -13,7 +13,7 @@ def _get_kwargs( - id: Union[UUID, str], + id: UUID | str, *, body: UpdateCustomForm, ) -> dict[str, Any]: @@ -33,8 +33,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[CustomFormResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CustomFormResponse | ErrorsList | None: if response.status_code == 200: response_200 = CustomFormResponse.from_dict(response.json()) @@ -52,8 +52,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[CustomFormResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[CustomFormResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -63,11 +63,11 @@ def _build_response( def sync_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdateCustomForm, -) -> Response[Union[CustomFormResponse, ErrorsList]]: +) -> Response[CustomFormResponse | ErrorsList]: """Update a custom form Update a specific custom form by id @@ -97,11 +97,11 @@ def sync_detailed( def sync( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdateCustomForm, -) -> Optional[Union[CustomFormResponse, ErrorsList]]: +) -> CustomFormResponse | ErrorsList | None: """Update a custom form Update a specific custom form by id @@ -126,11 +126,11 @@ def sync( async def asyncio_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdateCustomForm, -) -> Response[Union[CustomFormResponse, ErrorsList]]: +) -> Response[CustomFormResponse | ErrorsList]: """Update a custom form Update a specific custom form by id @@ -158,11 +158,11 @@ async def asyncio_detailed( async def asyncio( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdateCustomForm, -) -> Optional[Union[CustomFormResponse, ErrorsList]]: +) -> CustomFormResponse | ErrorsList | None: """Update a custom form Update a specific custom form by id diff --git a/rootly_sdk/api/dashboard_panels/create_dashboard_panel.py b/rootly_sdk/api/dashboard_panels/create_dashboard_panel.py index ad486a8b..e1302e00 100644 --- a/rootly_sdk/api/dashboard_panels/create_dashboard_panel.py +++ b/rootly_sdk/api/dashboard_panels/create_dashboard_panel.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[DashboardPanelResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> DashboardPanelResponse | ErrorsList | None: if response.status_code == 201: response_201 = DashboardPanelResponse.from_dict(response.json()) @@ -51,8 +51,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[DashboardPanelResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[DashboardPanelResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewDashboardPanel, -) -> Response[Union[DashboardPanelResponse, ErrorsList]]: +) -> Response[DashboardPanelResponse | ErrorsList]: """Creates a dashboard panel Creates a new dashboard panel from provided data @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: NewDashboardPanel, -) -> Optional[Union[DashboardPanelResponse, ErrorsList]]: +) -> DashboardPanelResponse | ErrorsList | None: """Creates a dashboard panel Creates a new dashboard panel from provided data @@ -129,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewDashboardPanel, -) -> Response[Union[DashboardPanelResponse, ErrorsList]]: +) -> Response[DashboardPanelResponse | ErrorsList]: """Creates a dashboard panel Creates a new dashboard panel from provided data @@ -161,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewDashboardPanel, -) -> Optional[Union[DashboardPanelResponse, ErrorsList]]: +) -> DashboardPanelResponse | ErrorsList | None: """Creates a dashboard panel Creates a new dashboard panel from provided data diff --git a/rootly_sdk/api/dashboard_panels/delete_dashboard_panel.py b/rootly_sdk/api/dashboard_panels/delete_dashboard_panel.py index 4a41bc7e..9580cb4c 100644 --- a/rootly_sdk/api/dashboard_panels/delete_dashboard_panel.py +++ b/rootly_sdk/api/dashboard_panels/delete_dashboard_panel.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -20,9 +20,7 @@ def _get_kwargs( return _kwargs -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[DashboardPanelResponse]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> DashboardPanelResponse | None: if response.status_code == 200: response_200 = DashboardPanelResponse.from_dict(response.json()) @@ -35,7 +33,7 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response + *, client: AuthenticatedClient | Client, response: httpx.Response ) -> Response[DashboardPanelResponse]: return Response( status_code=HTTPStatus(response.status_code), @@ -80,7 +78,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[DashboardPanelResponse]: +) -> DashboardPanelResponse | None: """Delete a dashboard panel Delete a specific dashboard panel by id @@ -135,7 +133,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[DashboardPanelResponse]: +) -> DashboardPanelResponse | None: """Delete a dashboard panel Delete a specific dashboard panel by id diff --git a/rootly_sdk/api/dashboard_panels/duplicate_dashboard_panel.py b/rootly_sdk/api/dashboard_panels/duplicate_dashboard_panel.py index 8b5448ec..ef54bcfd 100644 --- a/rootly_sdk/api/dashboard_panels/duplicate_dashboard_panel.py +++ b/rootly_sdk/api/dashboard_panels/duplicate_dashboard_panel.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[DashboardPanelResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> DashboardPanelResponse | ErrorsList | None: if response.status_code == 201: response_201 = DashboardPanelResponse.from_dict(response.json()) @@ -41,8 +41,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[DashboardPanelResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[DashboardPanelResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -55,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[DashboardPanelResponse, ErrorsList]]: +) -> Response[DashboardPanelResponse | ErrorsList]: """Duplicates a dashboard panel Duplicates a dashboard panel @@ -86,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[DashboardPanelResponse, ErrorsList]]: +) -> DashboardPanelResponse | ErrorsList | None: """Duplicates a dashboard panel Duplicates a dashboard panel @@ -112,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[DashboardPanelResponse, ErrorsList]]: +) -> Response[DashboardPanelResponse | ErrorsList]: """Duplicates a dashboard panel Duplicates a dashboard panel @@ -141,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[DashboardPanelResponse, ErrorsList]]: +) -> DashboardPanelResponse | ErrorsList | None: """Duplicates a dashboard panel Duplicates a dashboard panel diff --git a/rootly_sdk/api/dashboard_panels/get_dashboard_panel.py b/rootly_sdk/api/dashboard_panels/get_dashboard_panel.py index 534e3c58..8fabc049 100644 --- a/rootly_sdk/api/dashboard_panels/get_dashboard_panel.py +++ b/rootly_sdk/api/dashboard_panels/get_dashboard_panel.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -12,9 +12,9 @@ def _get_kwargs( id: str, *, - range_: Union[Unset, str] = UNSET, - period: Union[Unset, str] = UNSET, - time_zone: Union[Unset, str] = UNSET, + range_: Unset | str = UNSET, + period: Unset | str = UNSET, + time_zone: Unset | str = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -35,9 +35,7 @@ def _get_kwargs( return _kwargs -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[DashboardPanelResponse]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> DashboardPanelResponse | None: if response.status_code == 200: response_200 = DashboardPanelResponse.from_dict(response.json()) @@ -50,7 +48,7 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response + *, client: AuthenticatedClient | Client, response: httpx.Response ) -> Response[DashboardPanelResponse]: return Response( status_code=HTTPStatus(response.status_code), @@ -64,9 +62,9 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, - range_: Union[Unset, str] = UNSET, - period: Union[Unset, str] = UNSET, - time_zone: Union[Unset, str] = UNSET, + range_: Unset | str = UNSET, + period: Unset | str = UNSET, + time_zone: Unset | str = UNSET, ) -> Response[DashboardPanelResponse]: """Retrieves a dashboard panel @@ -104,10 +102,10 @@ def sync( id: str, *, client: AuthenticatedClient, - range_: Union[Unset, str] = UNSET, - period: Union[Unset, str] = UNSET, - time_zone: Union[Unset, str] = UNSET, -) -> Optional[DashboardPanelResponse]: + range_: Unset | str = UNSET, + period: Unset | str = UNSET, + time_zone: Unset | str = UNSET, +) -> DashboardPanelResponse | None: """Retrieves a dashboard panel Retrieves a specific dashboard panel by id @@ -139,9 +137,9 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, - range_: Union[Unset, str] = UNSET, - period: Union[Unset, str] = UNSET, - time_zone: Union[Unset, str] = UNSET, + range_: Unset | str = UNSET, + period: Unset | str = UNSET, + time_zone: Unset | str = UNSET, ) -> Response[DashboardPanelResponse]: """Retrieves a dashboard panel @@ -177,10 +175,10 @@ async def asyncio( id: str, *, client: AuthenticatedClient, - range_: Union[Unset, str] = UNSET, - period: Union[Unset, str] = UNSET, - time_zone: Union[Unset, str] = UNSET, -) -> Optional[DashboardPanelResponse]: + range_: Unset | str = UNSET, + period: Unset | str = UNSET, + time_zone: Unset | str = UNSET, +) -> DashboardPanelResponse | None: """Retrieves a dashboard panel Retrieves a specific dashboard panel by id diff --git a/rootly_sdk/api/dashboard_panels/list_dashboard_panels.py b/rootly_sdk/api/dashboard_panels/list_dashboard_panels.py index 87bbc3d6..60d15e58 100644 --- a/rootly_sdk/api/dashboard_panels/list_dashboard_panels.py +++ b/rootly_sdk/api/dashboard_panels/list_dashboard_panels.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -12,9 +12,9 @@ def _get_kwargs( dashboard_id: str, *, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -35,9 +35,7 @@ def _get_kwargs( return _kwargs -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[DashboardPanelList]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> DashboardPanelList | None: if response.status_code == 200: response_200 = DashboardPanelList.from_dict(response.json()) @@ -49,9 +47,7 @@ def _parse_response( return None -def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[DashboardPanelList]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[DashboardPanelList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -64,9 +60,9 @@ def sync_detailed( dashboard_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[DashboardPanelList]: """List dashboard panels @@ -104,10 +100,10 @@ def sync( dashboard_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, -) -> Optional[DashboardPanelList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, +) -> DashboardPanelList | None: """List dashboard panels List dashboard panels @@ -139,9 +135,9 @@ async def asyncio_detailed( dashboard_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[DashboardPanelList]: """List dashboard panels @@ -177,10 +173,10 @@ async def asyncio( dashboard_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, -) -> Optional[DashboardPanelList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, +) -> DashboardPanelList | None: """List dashboard panels List dashboard panels diff --git a/rootly_sdk/api/dashboard_panels/update_dashboard_panel.py b/rootly_sdk/api/dashboard_panels/update_dashboard_panel.py index e5aa46ee..05914600 100644 --- a/rootly_sdk/api/dashboard_panels/update_dashboard_panel.py +++ b/rootly_sdk/api/dashboard_panels/update_dashboard_panel.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -30,9 +30,7 @@ def _get_kwargs( return _kwargs -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[DashboardPanelResponse]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> DashboardPanelResponse | None: if response.status_code == 200: response_200 = DashboardPanelResponse.from_dict(response.json()) @@ -45,7 +43,7 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response + *, client: AuthenticatedClient | Client, response: httpx.Response ) -> Response[DashboardPanelResponse]: return Response( status_code=HTTPStatus(response.status_code), @@ -94,7 +92,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateDashboardPanel, -) -> Optional[DashboardPanelResponse]: +) -> DashboardPanelResponse | None: """Update a dashboard panel Update a specific dashboard panel by id @@ -155,7 +153,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateDashboardPanel, -) -> Optional[DashboardPanelResponse]: +) -> DashboardPanelResponse | None: """Update a dashboard panel Update a specific dashboard panel by id diff --git a/rootly_sdk/api/dashboards/create_dashboard.py b/rootly_sdk/api/dashboards/create_dashboard.py index 4680a26d..aa3291f9 100644 --- a/rootly_sdk/api/dashboards/create_dashboard.py +++ b/rootly_sdk/api/dashboards/create_dashboard.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[DashboardResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> DashboardResponse | ErrorsList | None: if response.status_code == 201: response_201 = DashboardResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[DashboardResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[DashboardResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +69,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewDashboard, -) -> Response[Union[DashboardResponse, ErrorsList]]: +) -> Response[DashboardResponse | ErrorsList]: """Creates a dashboard Creates a new dashboard from provided data @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: NewDashboard, -) -> Optional[Union[DashboardResponse, ErrorsList]]: +) -> DashboardResponse | ErrorsList | None: """Creates a dashboard Creates a new dashboard from provided data @@ -126,7 +126,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewDashboard, -) -> Response[Union[DashboardResponse, ErrorsList]]: +) -> Response[DashboardResponse | ErrorsList]: """Creates a dashboard Creates a new dashboard from provided data @@ -155,7 +155,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewDashboard, -) -> Optional[Union[DashboardResponse, ErrorsList]]: +) -> DashboardResponse | ErrorsList | None: """Creates a dashboard Creates a new dashboard from provided data diff --git a/rootly_sdk/api/dashboards/delete_dashboard.py b/rootly_sdk/api/dashboards/delete_dashboard.py index 04100988..8d7d943a 100644 --- a/rootly_sdk/api/dashboards/delete_dashboard.py +++ b/rootly_sdk/api/dashboards/delete_dashboard.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any from uuid import UUID import httpx @@ -12,7 +12,7 @@ def _get_kwargs( - id: Union[UUID, str], + id: UUID | str, ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "delete", @@ -23,8 +23,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[DashboardResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> DashboardResponse | ErrorsList | None: if response.status_code == 200: response_200 = DashboardResponse.from_dict(response.json()) @@ -42,8 +42,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[DashboardResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[DashboardResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -53,10 +53,10 @@ def _build_response( def sync_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Response[Union[DashboardResponse, ErrorsList]]: +) -> Response[DashboardResponse | ErrorsList]: """Delete a dashboard Delete a specific dashboard by id @@ -84,10 +84,10 @@ def sync_detailed( def sync( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Optional[Union[DashboardResponse, ErrorsList]]: +) -> DashboardResponse | ErrorsList | None: """Delete a dashboard Delete a specific dashboard by id @@ -110,10 +110,10 @@ def sync( async def asyncio_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Response[Union[DashboardResponse, ErrorsList]]: +) -> Response[DashboardResponse | ErrorsList]: """Delete a dashboard Delete a specific dashboard by id @@ -139,10 +139,10 @@ async def asyncio_detailed( async def asyncio( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Optional[Union[DashboardResponse, ErrorsList]]: +) -> DashboardResponse | ErrorsList | None: """Delete a dashboard Delete a specific dashboard by id diff --git a/rootly_sdk/api/dashboards/duplicate_dashboard.py b/rootly_sdk/api/dashboards/duplicate_dashboard.py index 0840cbae..ae8dfea4 100644 --- a/rootly_sdk/api/dashboards/duplicate_dashboard.py +++ b/rootly_sdk/api/dashboards/duplicate_dashboard.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any from uuid import UUID import httpx @@ -12,7 +12,7 @@ def _get_kwargs( - id: Union[UUID, str], + id: UUID | str, ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "post", @@ -23,8 +23,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[DashboardResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> DashboardResponse | ErrorsList | None: if response.status_code == 201: response_201 = DashboardResponse.from_dict(response.json()) @@ -42,8 +42,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[DashboardResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[DashboardResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -53,10 +53,10 @@ def _build_response( def sync_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Response[Union[DashboardResponse, ErrorsList]]: +) -> Response[DashboardResponse | ErrorsList]: """Duplicates a dashboard Duplicates a dashboard @@ -84,10 +84,10 @@ def sync_detailed( def sync( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Optional[Union[DashboardResponse, ErrorsList]]: +) -> DashboardResponse | ErrorsList | None: """Duplicates a dashboard Duplicates a dashboard @@ -110,10 +110,10 @@ def sync( async def asyncio_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Response[Union[DashboardResponse, ErrorsList]]: +) -> Response[DashboardResponse | ErrorsList]: """Duplicates a dashboard Duplicates a dashboard @@ -139,10 +139,10 @@ async def asyncio_detailed( async def asyncio( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Optional[Union[DashboardResponse, ErrorsList]]: +) -> DashboardResponse | ErrorsList | None: """Duplicates a dashboard Duplicates a dashboard diff --git a/rootly_sdk/api/dashboards/get_dashboard.py b/rootly_sdk/api/dashboards/get_dashboard.py index d282f5d7..41389041 100644 --- a/rootly_sdk/api/dashboards/get_dashboard.py +++ b/rootly_sdk/api/dashboards/get_dashboard.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any from uuid import UUID import httpx @@ -13,13 +13,13 @@ def _get_kwargs( - id: Union[UUID, str], + id: UUID | str, *, - include: Union[Unset, GetDashboardInclude] = UNSET, + include: Unset | GetDashboardInclude = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} - json_include: Union[Unset, str] = UNSET + json_include: Unset | str = UNSET if not isinstance(include, Unset): json_include = include @@ -37,8 +37,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[DashboardResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> DashboardResponse | ErrorsList | None: if response.status_code == 200: response_200 = DashboardResponse.from_dict(response.json()) @@ -56,8 +56,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[DashboardResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[DashboardResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -67,11 +67,11 @@ def _build_response( def sync_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, - include: Union[Unset, GetDashboardInclude] = UNSET, -) -> Response[Union[DashboardResponse, ErrorsList]]: + include: Unset | GetDashboardInclude = UNSET, +) -> Response[DashboardResponse | ErrorsList]: """Retrieves a dashboard Retrieves a specific dashboard by id @@ -101,11 +101,11 @@ def sync_detailed( def sync( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, - include: Union[Unset, GetDashboardInclude] = UNSET, -) -> Optional[Union[DashboardResponse, ErrorsList]]: + include: Unset | GetDashboardInclude = UNSET, +) -> DashboardResponse | ErrorsList | None: """Retrieves a dashboard Retrieves a specific dashboard by id @@ -130,11 +130,11 @@ def sync( async def asyncio_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, - include: Union[Unset, GetDashboardInclude] = UNSET, -) -> Response[Union[DashboardResponse, ErrorsList]]: + include: Unset | GetDashboardInclude = UNSET, +) -> Response[DashboardResponse | ErrorsList]: """Retrieves a dashboard Retrieves a specific dashboard by id @@ -162,11 +162,11 @@ async def asyncio_detailed( async def asyncio( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, - include: Union[Unset, GetDashboardInclude] = UNSET, -) -> Optional[Union[DashboardResponse, ErrorsList]]: + include: Unset | GetDashboardInclude = UNSET, +) -> DashboardResponse | ErrorsList | None: """Retrieves a dashboard Retrieves a specific dashboard by id diff --git a/rootly_sdk/api/dashboards/list_dashboards.py b/rootly_sdk/api/dashboards/list_dashboards.py index db9bcb29..13665e62 100644 --- a/rootly_sdk/api/dashboards/list_dashboards.py +++ b/rootly_sdk/api/dashboards/list_dashboards.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -12,13 +12,13 @@ def _get_kwargs( *, - include: Union[Unset, ListDashboardsInclude] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + include: Unset | ListDashboardsInclude = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} - json_include: Union[Unset, str] = UNSET + json_include: Unset | str = UNSET if not isinstance(include, Unset): json_include = include @@ -39,7 +39,7 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[DashboardList]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> DashboardList | None: if response.status_code == 200: response_200 = DashboardList.from_dict(response.json()) @@ -51,7 +51,7 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[DashboardList]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[DashboardList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -63,9 +63,9 @@ def _build_response(*, client: Union[AuthenticatedClient, Client], response: htt def sync_detailed( *, client: AuthenticatedClient, - include: Union[Unset, ListDashboardsInclude] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + include: Unset | ListDashboardsInclude = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[DashboardList]: """List dashboards @@ -100,10 +100,10 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: Union[Unset, ListDashboardsInclude] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, -) -> Optional[DashboardList]: + include: Unset | ListDashboardsInclude = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, +) -> DashboardList | None: """List dashboards List dashboards @@ -132,9 +132,9 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: Union[Unset, ListDashboardsInclude] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + include: Unset | ListDashboardsInclude = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[DashboardList]: """List dashboards @@ -167,10 +167,10 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: Union[Unset, ListDashboardsInclude] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, -) -> Optional[DashboardList]: + include: Unset | ListDashboardsInclude = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, +) -> DashboardList | None: """List dashboards List dashboards diff --git a/rootly_sdk/api/dashboards/set_default_dashboard.py b/rootly_sdk/api/dashboards/set_default_dashboard.py index 31841b9e..d6fb3419 100644 --- a/rootly_sdk/api/dashboards/set_default_dashboard.py +++ b/rootly_sdk/api/dashboards/set_default_dashboard.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any from uuid import UUID import httpx @@ -12,7 +12,7 @@ def _get_kwargs( - id: Union[UUID, str], + id: UUID | str, ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "post", @@ -23,8 +23,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[DashboardResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> DashboardResponse | ErrorsList | None: if response.status_code == 200: response_200 = DashboardResponse.from_dict(response.json()) @@ -42,8 +42,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[DashboardResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[DashboardResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -53,10 +53,10 @@ def _build_response( def sync_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Response[Union[DashboardResponse, ErrorsList]]: +) -> Response[DashboardResponse | ErrorsList]: """Sets dashboard to user default Sets dashboard to user default @@ -84,10 +84,10 @@ def sync_detailed( def sync( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Optional[Union[DashboardResponse, ErrorsList]]: +) -> DashboardResponse | ErrorsList | None: """Sets dashboard to user default Sets dashboard to user default @@ -110,10 +110,10 @@ def sync( async def asyncio_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Response[Union[DashboardResponse, ErrorsList]]: +) -> Response[DashboardResponse | ErrorsList]: """Sets dashboard to user default Sets dashboard to user default @@ -139,10 +139,10 @@ async def asyncio_detailed( async def asyncio( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Optional[Union[DashboardResponse, ErrorsList]]: +) -> DashboardResponse | ErrorsList | None: """Sets dashboard to user default Sets dashboard to user default diff --git a/rootly_sdk/api/dashboards/update_dashboard.py b/rootly_sdk/api/dashboards/update_dashboard.py index 1ea219f3..f1dab2cb 100644 --- a/rootly_sdk/api/dashboards/update_dashboard.py +++ b/rootly_sdk/api/dashboards/update_dashboard.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any from uuid import UUID import httpx @@ -13,7 +13,7 @@ def _get_kwargs( - id: Union[UUID, str], + id: UUID | str, *, body: UpdateDashboard, ) -> dict[str, Any]: @@ -33,8 +33,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[DashboardResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> DashboardResponse | ErrorsList | None: if response.status_code == 200: response_200 = DashboardResponse.from_dict(response.json()) @@ -52,8 +52,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[DashboardResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[DashboardResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -63,11 +63,11 @@ def _build_response( def sync_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdateDashboard, -) -> Response[Union[DashboardResponse, ErrorsList]]: +) -> Response[DashboardResponse | ErrorsList]: """Update a dashboard Update a specific dashboard by id @@ -97,11 +97,11 @@ def sync_detailed( def sync( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdateDashboard, -) -> Optional[Union[DashboardResponse, ErrorsList]]: +) -> DashboardResponse | ErrorsList | None: """Update a dashboard Update a specific dashboard by id @@ -126,11 +126,11 @@ def sync( async def asyncio_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdateDashboard, -) -> Response[Union[DashboardResponse, ErrorsList]]: +) -> Response[DashboardResponse | ErrorsList]: """Update a dashboard Update a specific dashboard by id @@ -158,11 +158,11 @@ async def asyncio_detailed( async def asyncio( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdateDashboard, -) -> Optional[Union[DashboardResponse, ErrorsList]]: +) -> DashboardResponse | ErrorsList | None: """Update a dashboard Update a specific dashboard by id diff --git a/rootly_sdk/api/deprecated_custom_field_options/create_custom_field_option.py b/rootly_sdk/api/deprecated_custom_field_options/create_custom_field_option.py index d3ed1d1d..64fb8702 100644 --- a/rootly_sdk/api/deprecated_custom_field_options/create_custom_field_option.py +++ b/rootly_sdk/api/deprecated_custom_field_options/create_custom_field_option.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[CustomFieldOptionResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CustomFieldOptionResponse | ErrorsList | None: if response.status_code == 201: response_201 = CustomFieldOptionResponse.from_dict(response.json()) @@ -56,8 +56,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[CustomFieldOptionResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[CustomFieldOptionResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -71,7 +71,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewCustomFieldOption, -) -> Response[Union[CustomFieldOptionResponse, ErrorsList]]: +) -> Response[CustomFieldOptionResponse | ErrorsList]: """[DEPRECATED] Creates a custom field option [DEPRECATED] Use form field endpoints instead. Creates a new custom field option from provided data @@ -105,7 +105,7 @@ def sync( *, client: AuthenticatedClient, body: NewCustomFieldOption, -) -> Optional[Union[CustomFieldOptionResponse, ErrorsList]]: +) -> CustomFieldOptionResponse | ErrorsList | None: """[DEPRECATED] Creates a custom field option [DEPRECATED] Use form field endpoints instead. Creates a new custom field option from provided data @@ -134,7 +134,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewCustomFieldOption, -) -> Response[Union[CustomFieldOptionResponse, ErrorsList]]: +) -> Response[CustomFieldOptionResponse | ErrorsList]: """[DEPRECATED] Creates a custom field option [DEPRECATED] Use form field endpoints instead. Creates a new custom field option from provided data @@ -166,7 +166,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewCustomFieldOption, -) -> Optional[Union[CustomFieldOptionResponse, ErrorsList]]: +) -> CustomFieldOptionResponse | ErrorsList | None: """[DEPRECATED] Creates a custom field option [DEPRECATED] Use form field endpoints instead. Creates a new custom field option from provided data diff --git a/rootly_sdk/api/deprecated_custom_field_options/delete_custom_field_option.py b/rootly_sdk/api/deprecated_custom_field_options/delete_custom_field_option.py index c235a7a1..331f1a0e 100644 --- a/rootly_sdk/api/deprecated_custom_field_options/delete_custom_field_option.py +++ b/rootly_sdk/api/deprecated_custom_field_options/delete_custom_field_option.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[CustomFieldOptionResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CustomFieldOptionResponse | ErrorsList | None: if response.status_code == 200: response_200 = CustomFieldOptionResponse.from_dict(response.json()) @@ -41,8 +41,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[CustomFieldOptionResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[CustomFieldOptionResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -55,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[CustomFieldOptionResponse, ErrorsList]]: +) -> Response[CustomFieldOptionResponse | ErrorsList]: """[DEPRECATED] Delete a custom field option [DEPRECATED] Use form field endpoints instead. Delete a specific Custom Field Option by id @@ -86,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[CustomFieldOptionResponse, ErrorsList]]: +) -> CustomFieldOptionResponse | ErrorsList | None: """[DEPRECATED] Delete a custom field option [DEPRECATED] Use form field endpoints instead. Delete a specific Custom Field Option by id @@ -112,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[CustomFieldOptionResponse, ErrorsList]]: +) -> Response[CustomFieldOptionResponse | ErrorsList]: """[DEPRECATED] Delete a custom field option [DEPRECATED] Use form field endpoints instead. Delete a specific Custom Field Option by id @@ -141,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[CustomFieldOptionResponse, ErrorsList]]: +) -> CustomFieldOptionResponse | ErrorsList | None: """[DEPRECATED] Delete a custom field option [DEPRECATED] Use form field endpoints instead. Delete a specific Custom Field Option by id diff --git a/rootly_sdk/api/deprecated_custom_field_options/get_custom_field_option.py b/rootly_sdk/api/deprecated_custom_field_options/get_custom_field_option.py index 62f5f606..1f7ee239 100644 --- a/rootly_sdk/api/deprecated_custom_field_options/get_custom_field_option.py +++ b/rootly_sdk/api/deprecated_custom_field_options/get_custom_field_option.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[CustomFieldOptionResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CustomFieldOptionResponse | ErrorsList | None: if response.status_code == 200: response_200 = CustomFieldOptionResponse.from_dict(response.json()) @@ -41,8 +41,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[CustomFieldOptionResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[CustomFieldOptionResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -55,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[CustomFieldOptionResponse, ErrorsList]]: +) -> Response[CustomFieldOptionResponse | ErrorsList]: """[DEPRECATED] Retrieves a custom field option [DEPRECATED] Use form field endpoints instead. Retrieves a specific custom field option by id @@ -86,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[CustomFieldOptionResponse, ErrorsList]]: +) -> CustomFieldOptionResponse | ErrorsList | None: """[DEPRECATED] Retrieves a custom field option [DEPRECATED] Use form field endpoints instead. Retrieves a specific custom field option by id @@ -112,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[CustomFieldOptionResponse, ErrorsList]]: +) -> Response[CustomFieldOptionResponse | ErrorsList]: """[DEPRECATED] Retrieves a custom field option [DEPRECATED] Use form field endpoints instead. Retrieves a specific custom field option by id @@ -141,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[CustomFieldOptionResponse, ErrorsList]]: +) -> CustomFieldOptionResponse | ErrorsList | None: """[DEPRECATED] Retrieves a custom field option [DEPRECATED] Use form field endpoints instead. Retrieves a specific custom field option by id diff --git a/rootly_sdk/api/deprecated_custom_field_options/list_custom_field_options.py b/rootly_sdk/api/deprecated_custom_field_options/list_custom_field_options.py index 54959f33..cec6b6d7 100644 --- a/rootly_sdk/api/deprecated_custom_field_options/list_custom_field_options.py +++ b/rootly_sdk/api/deprecated_custom_field_options/list_custom_field_options.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -12,11 +12,11 @@ def _get_kwargs( custom_field_id: str, *, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtervalue: Union[Unset, str] = UNSET, - filtercolor: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtervalue: Unset | str = UNSET, + filtercolor: Unset | str = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -41,9 +41,7 @@ def _get_kwargs( return _kwargs -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[CustomFieldOptionList]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> CustomFieldOptionList | None: if response.status_code == 200: response_200 = CustomFieldOptionList.from_dict(response.json()) @@ -56,7 +54,7 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response + *, client: AuthenticatedClient | Client, response: httpx.Response ) -> Response[CustomFieldOptionList]: return Response( status_code=HTTPStatus(response.status_code), @@ -70,11 +68,11 @@ def sync_detailed( custom_field_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtervalue: Union[Unset, str] = UNSET, - filtercolor: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtervalue: Unset | str = UNSET, + filtercolor: Unset | str = UNSET, ) -> Response[CustomFieldOptionList]: """[DEPRECATED] List custom field options @@ -116,12 +114,12 @@ def sync( custom_field_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtervalue: Union[Unset, str] = UNSET, - filtercolor: Union[Unset, str] = UNSET, -) -> Optional[CustomFieldOptionList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtervalue: Unset | str = UNSET, + filtercolor: Unset | str = UNSET, +) -> CustomFieldOptionList | None: """[DEPRECATED] List custom field options [DEPRECATED] Use form field endpoints instead. List custom field options @@ -157,11 +155,11 @@ async def asyncio_detailed( custom_field_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtervalue: Union[Unset, str] = UNSET, - filtercolor: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtervalue: Unset | str = UNSET, + filtercolor: Unset | str = UNSET, ) -> Response[CustomFieldOptionList]: """[DEPRECATED] List custom field options @@ -201,12 +199,12 @@ async def asyncio( custom_field_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtervalue: Union[Unset, str] = UNSET, - filtercolor: Union[Unset, str] = UNSET, -) -> Optional[CustomFieldOptionList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtervalue: Unset | str = UNSET, + filtercolor: Unset | str = UNSET, +) -> CustomFieldOptionList | None: """[DEPRECATED] List custom field options [DEPRECATED] Use form field endpoints instead. List custom field options diff --git a/rootly_sdk/api/deprecated_custom_field_options/update_custom_field_option.py b/rootly_sdk/api/deprecated_custom_field_options/update_custom_field_option.py index 80432df7..4f114d44 100644 --- a/rootly_sdk/api/deprecated_custom_field_options/update_custom_field_option.py +++ b/rootly_sdk/api/deprecated_custom_field_options/update_custom_field_option.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[CustomFieldOptionResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CustomFieldOptionResponse | ErrorsList | None: if response.status_code == 200: response_200 = CustomFieldOptionResponse.from_dict(response.json()) @@ -51,8 +51,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[CustomFieldOptionResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[CustomFieldOptionResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateCustomFieldOption, -) -> Response[Union[CustomFieldOptionResponse, ErrorsList]]: +) -> Response[CustomFieldOptionResponse | ErrorsList]: """[DEPRECATED] Update a custom field option [DEPRECATED] Use form field endpoints instead. Update a specific custom field option by id @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateCustomFieldOption, -) -> Optional[Union[CustomFieldOptionResponse, ErrorsList]]: +) -> CustomFieldOptionResponse | ErrorsList | None: """[DEPRECATED] Update a custom field option [DEPRECATED] Use form field endpoints instead. Update a specific custom field option by id @@ -129,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateCustomFieldOption, -) -> Response[Union[CustomFieldOptionResponse, ErrorsList]]: +) -> Response[CustomFieldOptionResponse | ErrorsList]: """[DEPRECATED] Update a custom field option [DEPRECATED] Use form field endpoints instead. Update a specific custom field option by id @@ -161,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateCustomFieldOption, -) -> Optional[Union[CustomFieldOptionResponse, ErrorsList]]: +) -> CustomFieldOptionResponse | ErrorsList | None: """[DEPRECATED] Update a custom field option [DEPRECATED] Use form field endpoints instead. Update a specific custom field option by id diff --git a/rootly_sdk/api/deprecated_custom_fields/create_custom_field.py b/rootly_sdk/api/deprecated_custom_fields/create_custom_field.py index 90daacb1..d8545178 100644 --- a/rootly_sdk/api/deprecated_custom_fields/create_custom_field.py +++ b/rootly_sdk/api/deprecated_custom_fields/create_custom_field.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[CustomFieldResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CustomFieldResponse | ErrorsList | None: if response.status_code == 201: response_201 = CustomFieldResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[CustomFieldResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[CustomFieldResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +69,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewCustomField, -) -> Response[Union[CustomFieldResponse, ErrorsList]]: +) -> Response[CustomFieldResponse | ErrorsList]: """[DEPRECATED] Creates a Custom Field [DEPRECATED] Use form field endpoints instead. Creates a new custom field from provided data @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: NewCustomField, -) -> Optional[Union[CustomFieldResponse, ErrorsList]]: +) -> CustomFieldResponse | ErrorsList | None: """[DEPRECATED] Creates a Custom Field [DEPRECATED] Use form field endpoints instead. Creates a new custom field from provided data @@ -126,7 +126,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewCustomField, -) -> Response[Union[CustomFieldResponse, ErrorsList]]: +) -> Response[CustomFieldResponse | ErrorsList]: """[DEPRECATED] Creates a Custom Field [DEPRECATED] Use form field endpoints instead. Creates a new custom field from provided data @@ -155,7 +155,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewCustomField, -) -> Optional[Union[CustomFieldResponse, ErrorsList]]: +) -> CustomFieldResponse | ErrorsList | None: """[DEPRECATED] Creates a Custom Field [DEPRECATED] Use form field endpoints instead. Creates a new custom field from provided data diff --git a/rootly_sdk/api/deprecated_custom_fields/delete_custom_field.py b/rootly_sdk/api/deprecated_custom_fields/delete_custom_field.py index c472b2c7..3391f10e 100644 --- a/rootly_sdk/api/deprecated_custom_fields/delete_custom_field.py +++ b/rootly_sdk/api/deprecated_custom_fields/delete_custom_field.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[CustomFieldResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CustomFieldResponse | ErrorsList | None: if response.status_code == 200: response_200 = CustomFieldResponse.from_dict(response.json()) @@ -41,8 +41,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[CustomFieldResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[CustomFieldResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -55,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[CustomFieldResponse, ErrorsList]]: +) -> Response[CustomFieldResponse | ErrorsList]: """[DEPRECATED] Delete a Custom Field [DEPRECATED] Use form field endpoints instead. Delete a specific custom field by id @@ -86,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[CustomFieldResponse, ErrorsList]]: +) -> CustomFieldResponse | ErrorsList | None: """[DEPRECATED] Delete a Custom Field [DEPRECATED] Use form field endpoints instead. Delete a specific custom field by id @@ -112,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[CustomFieldResponse, ErrorsList]]: +) -> Response[CustomFieldResponse | ErrorsList]: """[DEPRECATED] Delete a Custom Field [DEPRECATED] Use form field endpoints instead. Delete a specific custom field by id @@ -141,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[CustomFieldResponse, ErrorsList]]: +) -> CustomFieldResponse | ErrorsList | None: """[DEPRECATED] Delete a Custom Field [DEPRECATED] Use form field endpoints instead. Delete a specific custom field by id diff --git a/rootly_sdk/api/deprecated_custom_fields/get_custom_field.py b/rootly_sdk/api/deprecated_custom_fields/get_custom_field.py index 4d7309ce..693eb8ff 100644 --- a/rootly_sdk/api/deprecated_custom_fields/get_custom_field.py +++ b/rootly_sdk/api/deprecated_custom_fields/get_custom_field.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -14,11 +14,11 @@ def _get_kwargs( id: str, *, - include: Union[Unset, GetCustomFieldInclude] = UNSET, + include: Unset | GetCustomFieldInclude = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} - json_include: Union[Unset, str] = UNSET + json_include: Unset | str = UNSET if not isinstance(include, Unset): json_include = include @@ -36,8 +36,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[CustomFieldResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CustomFieldResponse | ErrorsList | None: if response.status_code == 200: response_200 = CustomFieldResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[CustomFieldResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[CustomFieldResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,8 +69,8 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, - include: Union[Unset, GetCustomFieldInclude] = UNSET, -) -> Response[Union[CustomFieldResponse, ErrorsList]]: + include: Unset | GetCustomFieldInclude = UNSET, +) -> Response[CustomFieldResponse | ErrorsList]: """[DEPRECATED] Retrieves a Custom Field Retrieves a specific custom_field by id @@ -103,8 +103,8 @@ def sync( id: str, *, client: AuthenticatedClient, - include: Union[Unset, GetCustomFieldInclude] = UNSET, -) -> Optional[Union[CustomFieldResponse, ErrorsList]]: + include: Unset | GetCustomFieldInclude = UNSET, +) -> CustomFieldResponse | ErrorsList | None: """[DEPRECATED] Retrieves a Custom Field Retrieves a specific custom_field by id @@ -132,8 +132,8 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, - include: Union[Unset, GetCustomFieldInclude] = UNSET, -) -> Response[Union[CustomFieldResponse, ErrorsList]]: + include: Unset | GetCustomFieldInclude = UNSET, +) -> Response[CustomFieldResponse | ErrorsList]: """[DEPRECATED] Retrieves a Custom Field Retrieves a specific custom_field by id @@ -164,8 +164,8 @@ async def asyncio( id: str, *, client: AuthenticatedClient, - include: Union[Unset, GetCustomFieldInclude] = UNSET, -) -> Optional[Union[CustomFieldResponse, ErrorsList]]: + include: Unset | GetCustomFieldInclude = UNSET, +) -> CustomFieldResponse | ErrorsList | None: """[DEPRECATED] Retrieves a Custom Field Retrieves a specific custom_field by id diff --git a/rootly_sdk/api/deprecated_custom_fields/list_custom_fields.py b/rootly_sdk/api/deprecated_custom_fields/list_custom_fields.py index 350e2492..c792fd54 100644 --- a/rootly_sdk/api/deprecated_custom_fields/list_custom_fields.py +++ b/rootly_sdk/api/deprecated_custom_fields/list_custom_fields.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -13,44 +13,44 @@ def _get_kwargs( *, - include: Union[Unset, ListCustomFieldsInclude] = UNSET, - sort: Union[Unset, ListCustomFieldsSort] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filterlabel: Union[Unset, str] = UNSET, - filterkind: Union[Unset, str] = UNSET, - filterenabled: Union[Unset, bool] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filterslugeq: Union[Unset, str] = UNSET, - filterslugnot_eq: Union[Unset, str] = UNSET, - filterslugin: Union[Unset, str] = UNSET, - filterslugnot_in: Union[Unset, str] = UNSET, - filterlabeleq: Union[Unset, str] = UNSET, - filterlabelnot_eq: Union[Unset, str] = UNSET, - filterlabelin: Union[Unset, str] = UNSET, - filterlabelnot_in: Union[Unset, str] = UNSET, - filterkindeq: Union[Unset, str] = UNSET, - filterkindnot_eq: Union[Unset, str] = UNSET, - filterkindin: Union[Unset, str] = UNSET, - filterkindnot_in: Union[Unset, str] = UNSET, - filterenabledeq: Union[Unset, str] = UNSET, - filterenablednot_eq: Union[Unset, str] = UNSET, - filterenabledin: Union[Unset, str] = UNSET, - filterenablednot_in: Union[Unset, str] = UNSET, + include: Unset | ListCustomFieldsInclude = UNSET, + sort: Unset | ListCustomFieldsSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filterlabel: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filterenabled: Unset | bool = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filterlabeleq: Unset | str = UNSET, + filterlabelnot_eq: Unset | str = UNSET, + filterlabelin: Unset | str = UNSET, + filterlabelnot_in: Unset | str = UNSET, + filterkindeq: Unset | str = UNSET, + filterkindnot_eq: Unset | str = UNSET, + filterkindin: Unset | str = UNSET, + filterkindnot_in: Unset | str = UNSET, + filterenabledeq: Unset | str = UNSET, + filterenablednot_eq: Unset | str = UNSET, + filterenabledin: Unset | str = UNSET, + filterenablednot_in: Unset | str = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} - json_include: Union[Unset, str] = UNSET + json_include: Unset | str = UNSET if not isinstance(include, Unset): json_include = include params["include"] = json_include - json_sort: Union[Unset, str] = UNSET + json_sort: Unset | str = UNSET if not isinstance(sort, Unset): json_sort = sort @@ -119,9 +119,7 @@ def _get_kwargs( return _kwargs -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[CustomFieldList]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> CustomFieldList | None: if response.status_code == 200: response_200 = CustomFieldList.from_dict(response.json()) @@ -133,9 +131,7 @@ def _parse_response( return None -def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[CustomFieldList]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[CustomFieldList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -147,34 +143,34 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - include: Union[Unset, ListCustomFieldsInclude] = UNSET, - sort: Union[Unset, ListCustomFieldsSort] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filterlabel: Union[Unset, str] = UNSET, - filterkind: Union[Unset, str] = UNSET, - filterenabled: Union[Unset, bool] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filterslugeq: Union[Unset, str] = UNSET, - filterslugnot_eq: Union[Unset, str] = UNSET, - filterslugin: Union[Unset, str] = UNSET, - filterslugnot_in: Union[Unset, str] = UNSET, - filterlabeleq: Union[Unset, str] = UNSET, - filterlabelnot_eq: Union[Unset, str] = UNSET, - filterlabelin: Union[Unset, str] = UNSET, - filterlabelnot_in: Union[Unset, str] = UNSET, - filterkindeq: Union[Unset, str] = UNSET, - filterkindnot_eq: Union[Unset, str] = UNSET, - filterkindin: Union[Unset, str] = UNSET, - filterkindnot_in: Union[Unset, str] = UNSET, - filterenabledeq: Union[Unset, str] = UNSET, - filterenablednot_eq: Union[Unset, str] = UNSET, - filterenabledin: Union[Unset, str] = UNSET, - filterenablednot_in: Union[Unset, str] = UNSET, + include: Unset | ListCustomFieldsInclude = UNSET, + sort: Unset | ListCustomFieldsSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filterlabel: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filterenabled: Unset | bool = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filterlabeleq: Unset | str = UNSET, + filterlabelnot_eq: Unset | str = UNSET, + filterlabelin: Unset | str = UNSET, + filterlabelnot_in: Unset | str = UNSET, + filterkindeq: Unset | str = UNSET, + filterkindnot_eq: Unset | str = UNSET, + filterkindin: Unset | str = UNSET, + filterkindnot_in: Unset | str = UNSET, + filterenabledeq: Unset | str = UNSET, + filterenablednot_eq: Unset | str = UNSET, + filterenabledin: Unset | str = UNSET, + filterenablednot_in: Unset | str = UNSET, ) -> Response[CustomFieldList]: """[DEPRECATED] List Custom Fields @@ -259,35 +255,35 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: Union[Unset, ListCustomFieldsInclude] = UNSET, - sort: Union[Unset, ListCustomFieldsSort] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filterlabel: Union[Unset, str] = UNSET, - filterkind: Union[Unset, str] = UNSET, - filterenabled: Union[Unset, bool] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filterslugeq: Union[Unset, str] = UNSET, - filterslugnot_eq: Union[Unset, str] = UNSET, - filterslugin: Union[Unset, str] = UNSET, - filterslugnot_in: Union[Unset, str] = UNSET, - filterlabeleq: Union[Unset, str] = UNSET, - filterlabelnot_eq: Union[Unset, str] = UNSET, - filterlabelin: Union[Unset, str] = UNSET, - filterlabelnot_in: Union[Unset, str] = UNSET, - filterkindeq: Union[Unset, str] = UNSET, - filterkindnot_eq: Union[Unset, str] = UNSET, - filterkindin: Union[Unset, str] = UNSET, - filterkindnot_in: Union[Unset, str] = UNSET, - filterenabledeq: Union[Unset, str] = UNSET, - filterenablednot_eq: Union[Unset, str] = UNSET, - filterenabledin: Union[Unset, str] = UNSET, - filterenablednot_in: Union[Unset, str] = UNSET, -) -> Optional[CustomFieldList]: + include: Unset | ListCustomFieldsInclude = UNSET, + sort: Unset | ListCustomFieldsSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filterlabel: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filterenabled: Unset | bool = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filterlabeleq: Unset | str = UNSET, + filterlabelnot_eq: Unset | str = UNSET, + filterlabelin: Unset | str = UNSET, + filterlabelnot_in: Unset | str = UNSET, + filterkindeq: Unset | str = UNSET, + filterkindnot_eq: Unset | str = UNSET, + filterkindin: Unset | str = UNSET, + filterkindnot_in: Unset | str = UNSET, + filterenabledeq: Unset | str = UNSET, + filterenablednot_eq: Unset | str = UNSET, + filterenabledin: Unset | str = UNSET, + filterenablednot_in: Unset | str = UNSET, +) -> CustomFieldList | None: """[DEPRECATED] List Custom Fields [DEPRECATED] Use form field endpoints instead. List Custom fields @@ -366,34 +362,34 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: Union[Unset, ListCustomFieldsInclude] = UNSET, - sort: Union[Unset, ListCustomFieldsSort] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filterlabel: Union[Unset, str] = UNSET, - filterkind: Union[Unset, str] = UNSET, - filterenabled: Union[Unset, bool] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filterslugeq: Union[Unset, str] = UNSET, - filterslugnot_eq: Union[Unset, str] = UNSET, - filterslugin: Union[Unset, str] = UNSET, - filterslugnot_in: Union[Unset, str] = UNSET, - filterlabeleq: Union[Unset, str] = UNSET, - filterlabelnot_eq: Union[Unset, str] = UNSET, - filterlabelin: Union[Unset, str] = UNSET, - filterlabelnot_in: Union[Unset, str] = UNSET, - filterkindeq: Union[Unset, str] = UNSET, - filterkindnot_eq: Union[Unset, str] = UNSET, - filterkindin: Union[Unset, str] = UNSET, - filterkindnot_in: Union[Unset, str] = UNSET, - filterenabledeq: Union[Unset, str] = UNSET, - filterenablednot_eq: Union[Unset, str] = UNSET, - filterenabledin: Union[Unset, str] = UNSET, - filterenablednot_in: Union[Unset, str] = UNSET, + include: Unset | ListCustomFieldsInclude = UNSET, + sort: Unset | ListCustomFieldsSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filterlabel: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filterenabled: Unset | bool = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filterlabeleq: Unset | str = UNSET, + filterlabelnot_eq: Unset | str = UNSET, + filterlabelin: Unset | str = UNSET, + filterlabelnot_in: Unset | str = UNSET, + filterkindeq: Unset | str = UNSET, + filterkindnot_eq: Unset | str = UNSET, + filterkindin: Unset | str = UNSET, + filterkindnot_in: Unset | str = UNSET, + filterenabledeq: Unset | str = UNSET, + filterenablednot_eq: Unset | str = UNSET, + filterenabledin: Unset | str = UNSET, + filterenablednot_in: Unset | str = UNSET, ) -> Response[CustomFieldList]: """[DEPRECATED] List Custom Fields @@ -476,35 +472,35 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: Union[Unset, ListCustomFieldsInclude] = UNSET, - sort: Union[Unset, ListCustomFieldsSort] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filterlabel: Union[Unset, str] = UNSET, - filterkind: Union[Unset, str] = UNSET, - filterenabled: Union[Unset, bool] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filterslugeq: Union[Unset, str] = UNSET, - filterslugnot_eq: Union[Unset, str] = UNSET, - filterslugin: Union[Unset, str] = UNSET, - filterslugnot_in: Union[Unset, str] = UNSET, - filterlabeleq: Union[Unset, str] = UNSET, - filterlabelnot_eq: Union[Unset, str] = UNSET, - filterlabelin: Union[Unset, str] = UNSET, - filterlabelnot_in: Union[Unset, str] = UNSET, - filterkindeq: Union[Unset, str] = UNSET, - filterkindnot_eq: Union[Unset, str] = UNSET, - filterkindin: Union[Unset, str] = UNSET, - filterkindnot_in: Union[Unset, str] = UNSET, - filterenabledeq: Union[Unset, str] = UNSET, - filterenablednot_eq: Union[Unset, str] = UNSET, - filterenabledin: Union[Unset, str] = UNSET, - filterenablednot_in: Union[Unset, str] = UNSET, -) -> Optional[CustomFieldList]: + include: Unset | ListCustomFieldsInclude = UNSET, + sort: Unset | ListCustomFieldsSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filterlabel: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filterenabled: Unset | bool = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filterlabeleq: Unset | str = UNSET, + filterlabelnot_eq: Unset | str = UNSET, + filterlabelin: Unset | str = UNSET, + filterlabelnot_in: Unset | str = UNSET, + filterkindeq: Unset | str = UNSET, + filterkindnot_eq: Unset | str = UNSET, + filterkindin: Unset | str = UNSET, + filterkindnot_in: Unset | str = UNSET, + filterenabledeq: Unset | str = UNSET, + filterenablednot_eq: Unset | str = UNSET, + filterenabledin: Unset | str = UNSET, + filterenablednot_in: Unset | str = UNSET, +) -> CustomFieldList | None: """[DEPRECATED] List Custom Fields [DEPRECATED] Use form field endpoints instead. List Custom fields diff --git a/rootly_sdk/api/deprecated_custom_fields/update_custom_field.py b/rootly_sdk/api/deprecated_custom_fields/update_custom_field.py index 5000d73a..bd9635d7 100644 --- a/rootly_sdk/api/deprecated_custom_fields/update_custom_field.py +++ b/rootly_sdk/api/deprecated_custom_fields/update_custom_field.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[CustomFieldResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CustomFieldResponse | ErrorsList | None: if response.status_code == 200: response_200 = CustomFieldResponse.from_dict(response.json()) @@ -51,8 +51,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[CustomFieldResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[CustomFieldResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateCustomField, -) -> Response[Union[CustomFieldResponse, ErrorsList]]: +) -> Response[CustomFieldResponse | ErrorsList]: """[DEPRECATED] Update a Custom Field [DEPRECATED] Use form field endpoints instead. Update a specific custom field by id @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateCustomField, -) -> Optional[Union[CustomFieldResponse, ErrorsList]]: +) -> CustomFieldResponse | ErrorsList | None: """[DEPRECATED] Update a Custom Field [DEPRECATED] Use form field endpoints instead. Update a specific custom field by id @@ -129,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateCustomField, -) -> Response[Union[CustomFieldResponse, ErrorsList]]: +) -> Response[CustomFieldResponse | ErrorsList]: """[DEPRECATED] Update a Custom Field [DEPRECATED] Use form field endpoints instead. Update a specific custom field by id @@ -161,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateCustomField, -) -> Optional[Union[CustomFieldResponse, ErrorsList]]: +) -> CustomFieldResponse | ErrorsList | None: """[DEPRECATED] Update a Custom Field [DEPRECATED] Use form field endpoints instead. Update a specific custom field by id diff --git a/rootly_sdk/api/deprecated_incident_custom_field_selections/create_incident_custom_field_selection.py b/rootly_sdk/api/deprecated_incident_custom_field_selections/create_incident_custom_field_selection.py index 1bb4a08c..c8df48b9 100644 --- a/rootly_sdk/api/deprecated_incident_custom_field_selections/create_incident_custom_field_selection.py +++ b/rootly_sdk/api/deprecated_incident_custom_field_selections/create_incident_custom_field_selection.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, IncidentCustomFieldSelectionResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | IncidentCustomFieldSelectionResponse | None: if response.status_code == 201: response_201 = IncidentCustomFieldSelectionResponse.from_dict(response.json()) @@ -56,8 +56,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, IncidentCustomFieldSelectionResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | IncidentCustomFieldSelectionResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -71,7 +71,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewIncidentCustomFieldSelection, -) -> Response[Union[ErrorsList, IncidentCustomFieldSelectionResponse]]: +) -> Response[ErrorsList | IncidentCustomFieldSelectionResponse]: """[DEPRECATED] Creates an incident custom field selection [DEPRECATED] Use form field endpoints instead. Creates a new incident custom field selection from @@ -106,7 +106,7 @@ def sync( *, client: AuthenticatedClient, body: NewIncidentCustomFieldSelection, -) -> Optional[Union[ErrorsList, IncidentCustomFieldSelectionResponse]]: +) -> ErrorsList | IncidentCustomFieldSelectionResponse | None: """[DEPRECATED] Creates an incident custom field selection [DEPRECATED] Use form field endpoints instead. Creates a new incident custom field selection from @@ -136,7 +136,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewIncidentCustomFieldSelection, -) -> Response[Union[ErrorsList, IncidentCustomFieldSelectionResponse]]: +) -> Response[ErrorsList | IncidentCustomFieldSelectionResponse]: """[DEPRECATED] Creates an incident custom field selection [DEPRECATED] Use form field endpoints instead. Creates a new incident custom field selection from @@ -169,7 +169,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewIncidentCustomFieldSelection, -) -> Optional[Union[ErrorsList, IncidentCustomFieldSelectionResponse]]: +) -> ErrorsList | IncidentCustomFieldSelectionResponse | None: """[DEPRECATED] Creates an incident custom field selection [DEPRECATED] Use form field endpoints instead. Creates a new incident custom field selection from diff --git a/rootly_sdk/api/deprecated_incident_custom_field_selections/delete_incident_custom_field_selection.py b/rootly_sdk/api/deprecated_incident_custom_field_selections/delete_incident_custom_field_selection.py index 3975d183..649c250e 100644 --- a/rootly_sdk/api/deprecated_incident_custom_field_selections/delete_incident_custom_field_selection.py +++ b/rootly_sdk/api/deprecated_incident_custom_field_selections/delete_incident_custom_field_selection.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, IncidentCustomFieldSelectionResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | IncidentCustomFieldSelectionResponse | None: if response.status_code == 200: response_200 = IncidentCustomFieldSelectionResponse.from_dict(response.json()) @@ -41,8 +41,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, IncidentCustomFieldSelectionResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | IncidentCustomFieldSelectionResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -55,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, IncidentCustomFieldSelectionResponse]]: +) -> Response[ErrorsList | IncidentCustomFieldSelectionResponse]: """[DEPRECATED] Delete an incident custom field selection [DEPRECATED] Use form field endpoints instead. Delete a specific incident custom field selection by @@ -87,7 +87,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, IncidentCustomFieldSelectionResponse]]: +) -> ErrorsList | IncidentCustomFieldSelectionResponse | None: """[DEPRECATED] Delete an incident custom field selection [DEPRECATED] Use form field endpoints instead. Delete a specific incident custom field selection by @@ -114,7 +114,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, IncidentCustomFieldSelectionResponse]]: +) -> Response[ErrorsList | IncidentCustomFieldSelectionResponse]: """[DEPRECATED] Delete an incident custom field selection [DEPRECATED] Use form field endpoints instead. Delete a specific incident custom field selection by @@ -144,7 +144,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, IncidentCustomFieldSelectionResponse]]: +) -> ErrorsList | IncidentCustomFieldSelectionResponse | None: """[DEPRECATED] Delete an incident custom field selection [DEPRECATED] Use form field endpoints instead. Delete a specific incident custom field selection by diff --git a/rootly_sdk/api/deprecated_incident_custom_field_selections/get_incident_custom_field_selection.py b/rootly_sdk/api/deprecated_incident_custom_field_selections/get_incident_custom_field_selection.py index 9570ee31..2eb7fe16 100644 --- a/rootly_sdk/api/deprecated_incident_custom_field_selections/get_incident_custom_field_selection.py +++ b/rootly_sdk/api/deprecated_incident_custom_field_selections/get_incident_custom_field_selection.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, IncidentCustomFieldSelectionResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | IncidentCustomFieldSelectionResponse | None: if response.status_code == 200: response_200 = IncidentCustomFieldSelectionResponse.from_dict(response.json()) @@ -41,8 +41,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, IncidentCustomFieldSelectionResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | IncidentCustomFieldSelectionResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -55,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, IncidentCustomFieldSelectionResponse]]: +) -> Response[ErrorsList | IncidentCustomFieldSelectionResponse]: """[DEPRECATED] Retrieves an incident custom field selection [DEPRECATED] Use form field endpoints instead. Retrieves a specific incident custom field selection @@ -87,7 +87,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, IncidentCustomFieldSelectionResponse]]: +) -> ErrorsList | IncidentCustomFieldSelectionResponse | None: """[DEPRECATED] Retrieves an incident custom field selection [DEPRECATED] Use form field endpoints instead. Retrieves a specific incident custom field selection @@ -114,7 +114,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, IncidentCustomFieldSelectionResponse]]: +) -> Response[ErrorsList | IncidentCustomFieldSelectionResponse]: """[DEPRECATED] Retrieves an incident custom field selection [DEPRECATED] Use form field endpoints instead. Retrieves a specific incident custom field selection @@ -144,7 +144,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, IncidentCustomFieldSelectionResponse]]: +) -> ErrorsList | IncidentCustomFieldSelectionResponse | None: """[DEPRECATED] Retrieves an incident custom field selection [DEPRECATED] Use form field endpoints instead. Retrieves a specific incident custom field selection diff --git a/rootly_sdk/api/deprecated_incident_custom_field_selections/list_incident_custom_field_selections.py b/rootly_sdk/api/deprecated_incident_custom_field_selections/list_incident_custom_field_selections.py index 5529de84..d57c8279 100644 --- a/rootly_sdk/api/deprecated_incident_custom_field_selections/list_incident_custom_field_selections.py +++ b/rootly_sdk/api/deprecated_incident_custom_field_selections/list_incident_custom_field_selections.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -12,9 +12,9 @@ def _get_kwargs( incident_id: str, *, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -36,8 +36,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[IncidentCustomFieldSelectionList]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> IncidentCustomFieldSelectionList | None: if response.status_code == 200: response_200 = IncidentCustomFieldSelectionList.from_dict(response.json()) @@ -50,7 +50,7 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response + *, client: AuthenticatedClient | Client, response: httpx.Response ) -> Response[IncidentCustomFieldSelectionList]: return Response( status_code=HTTPStatus(response.status_code), @@ -64,9 +64,9 @@ def sync_detailed( incident_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[IncidentCustomFieldSelectionList]: """[DEPRECATED] List incident custom field selections @@ -104,10 +104,10 @@ def sync( incident_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, -) -> Optional[IncidentCustomFieldSelectionList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, +) -> IncidentCustomFieldSelectionList | None: """[DEPRECATED] List incident custom field selections [DEPRECATED] Use form field endpoints instead. List incident custom field selections @@ -139,9 +139,9 @@ async def asyncio_detailed( incident_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[IncidentCustomFieldSelectionList]: """[DEPRECATED] List incident custom field selections @@ -177,10 +177,10 @@ async def asyncio( incident_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, -) -> Optional[IncidentCustomFieldSelectionList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, +) -> IncidentCustomFieldSelectionList | None: """[DEPRECATED] List incident custom field selections [DEPRECATED] Use form field endpoints instead. List incident custom field selections diff --git a/rootly_sdk/api/deprecated_incident_custom_field_selections/update_incident_custom_field_selection.py b/rootly_sdk/api/deprecated_incident_custom_field_selections/update_incident_custom_field_selection.py index 18aabdda..7269c699 100644 --- a/rootly_sdk/api/deprecated_incident_custom_field_selections/update_incident_custom_field_selection.py +++ b/rootly_sdk/api/deprecated_incident_custom_field_selections/update_incident_custom_field_selection.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, IncidentCustomFieldSelectionResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | IncidentCustomFieldSelectionResponse | None: if response.status_code == 200: response_200 = IncidentCustomFieldSelectionResponse.from_dict(response.json()) @@ -51,8 +51,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, IncidentCustomFieldSelectionResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | IncidentCustomFieldSelectionResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateIncidentCustomFieldSelection, -) -> Response[Union[ErrorsList, IncidentCustomFieldSelectionResponse]]: +) -> Response[ErrorsList | IncidentCustomFieldSelectionResponse]: """[DEPRECATED] Update an incident custom field selection [DEPRECATED] Use form field endpoints instead. Update a specific incident custom field selection by @@ -101,7 +101,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateIncidentCustomFieldSelection, -) -> Optional[Union[ErrorsList, IncidentCustomFieldSelectionResponse]]: +) -> ErrorsList | IncidentCustomFieldSelectionResponse | None: """[DEPRECATED] Update an incident custom field selection [DEPRECATED] Use form field endpoints instead. Update a specific incident custom field selection by @@ -131,7 +131,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateIncidentCustomFieldSelection, -) -> Response[Union[ErrorsList, IncidentCustomFieldSelectionResponse]]: +) -> Response[ErrorsList | IncidentCustomFieldSelectionResponse]: """[DEPRECATED] Update an incident custom field selection [DEPRECATED] Use form field endpoints instead. Update a specific incident custom field selection by @@ -164,7 +164,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateIncidentCustomFieldSelection, -) -> Optional[Union[ErrorsList, IncidentCustomFieldSelectionResponse]]: +) -> ErrorsList | IncidentCustomFieldSelectionResponse | None: """[DEPRECATED] Update an incident custom field selection [DEPRECATED] Use form field endpoints instead. Update a specific incident custom field selection by diff --git a/rootly_sdk/api/deprecated_workflow_custom_field_selections/create_workflow_custom_field_selection.py b/rootly_sdk/api/deprecated_workflow_custom_field_selections/create_workflow_custom_field_selection.py index 60c9b18d..5e0751b7 100644 --- a/rootly_sdk/api/deprecated_workflow_custom_field_selections/create_workflow_custom_field_selection.py +++ b/rootly_sdk/api/deprecated_workflow_custom_field_selections/create_workflow_custom_field_selection.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, WorkflowCustomFieldSelectionResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | WorkflowCustomFieldSelectionResponse | None: if response.status_code == 201: response_201 = WorkflowCustomFieldSelectionResponse.from_dict(response.json()) @@ -51,8 +51,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, WorkflowCustomFieldSelectionResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | WorkflowCustomFieldSelectionResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewWorkflowCustomFieldSelection, -) -> Response[Union[ErrorsList, WorkflowCustomFieldSelectionResponse]]: +) -> Response[ErrorsList | WorkflowCustomFieldSelectionResponse]: """[DEPRECATED] Creates a workflow custom field selection [DEPRECATED] Use form field endpoints instead. Creates a new workflow custom field selection from @@ -101,7 +101,7 @@ def sync( *, client: AuthenticatedClient, body: NewWorkflowCustomFieldSelection, -) -> Optional[Union[ErrorsList, WorkflowCustomFieldSelectionResponse]]: +) -> ErrorsList | WorkflowCustomFieldSelectionResponse | None: """[DEPRECATED] Creates a workflow custom field selection [DEPRECATED] Use form field endpoints instead. Creates a new workflow custom field selection from @@ -131,7 +131,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewWorkflowCustomFieldSelection, -) -> Response[Union[ErrorsList, WorkflowCustomFieldSelectionResponse]]: +) -> Response[ErrorsList | WorkflowCustomFieldSelectionResponse]: """[DEPRECATED] Creates a workflow custom field selection [DEPRECATED] Use form field endpoints instead. Creates a new workflow custom field selection from @@ -164,7 +164,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewWorkflowCustomFieldSelection, -) -> Optional[Union[ErrorsList, WorkflowCustomFieldSelectionResponse]]: +) -> ErrorsList | WorkflowCustomFieldSelectionResponse | None: """[DEPRECATED] Creates a workflow custom field selection [DEPRECATED] Use form field endpoints instead. Creates a new workflow custom field selection from diff --git a/rootly_sdk/api/deprecated_workflow_custom_field_selections/delete_workflow_custom_field_selection.py b/rootly_sdk/api/deprecated_workflow_custom_field_selections/delete_workflow_custom_field_selection.py index bd73c09f..6a1c1aed 100644 --- a/rootly_sdk/api/deprecated_workflow_custom_field_selections/delete_workflow_custom_field_selection.py +++ b/rootly_sdk/api/deprecated_workflow_custom_field_selections/delete_workflow_custom_field_selection.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, WorkflowCustomFieldSelectionResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | WorkflowCustomFieldSelectionResponse | None: if response.status_code == 200: response_200 = WorkflowCustomFieldSelectionResponse.from_dict(response.json()) @@ -41,8 +41,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, WorkflowCustomFieldSelectionResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | WorkflowCustomFieldSelectionResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -55,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, WorkflowCustomFieldSelectionResponse]]: +) -> Response[ErrorsList | WorkflowCustomFieldSelectionResponse]: """[DEPRECATED] Delete a workflow custom field selection [DEPRECATED] Use form field endpoints instead. Delete a specific workflow custom field selection by @@ -87,7 +87,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, WorkflowCustomFieldSelectionResponse]]: +) -> ErrorsList | WorkflowCustomFieldSelectionResponse | None: """[DEPRECATED] Delete a workflow custom field selection [DEPRECATED] Use form field endpoints instead. Delete a specific workflow custom field selection by @@ -114,7 +114,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, WorkflowCustomFieldSelectionResponse]]: +) -> Response[ErrorsList | WorkflowCustomFieldSelectionResponse]: """[DEPRECATED] Delete a workflow custom field selection [DEPRECATED] Use form field endpoints instead. Delete a specific workflow custom field selection by @@ -144,7 +144,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, WorkflowCustomFieldSelectionResponse]]: +) -> ErrorsList | WorkflowCustomFieldSelectionResponse | None: """[DEPRECATED] Delete a workflow custom field selection [DEPRECATED] Use form field endpoints instead. Delete a specific workflow custom field selection by diff --git a/rootly_sdk/api/deprecated_workflow_custom_field_selections/get_workflow_custom_field_selection.py b/rootly_sdk/api/deprecated_workflow_custom_field_selections/get_workflow_custom_field_selection.py index 577d072c..01b037e7 100644 --- a/rootly_sdk/api/deprecated_workflow_custom_field_selections/get_workflow_custom_field_selection.py +++ b/rootly_sdk/api/deprecated_workflow_custom_field_selections/get_workflow_custom_field_selection.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, WorkflowCustomFieldSelectionResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | WorkflowCustomFieldSelectionResponse | None: if response.status_code == 200: response_200 = WorkflowCustomFieldSelectionResponse.from_dict(response.json()) @@ -41,8 +41,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, WorkflowCustomFieldSelectionResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | WorkflowCustomFieldSelectionResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -55,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, WorkflowCustomFieldSelectionResponse]]: +) -> Response[ErrorsList | WorkflowCustomFieldSelectionResponse]: """[DEPRECATED] Retrieves a workflow custom field selection [DEPRECATED] Use form field endpoints instead. Retrieves a specific workflow custom field selection @@ -87,7 +87,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, WorkflowCustomFieldSelectionResponse]]: +) -> ErrorsList | WorkflowCustomFieldSelectionResponse | None: """[DEPRECATED] Retrieves a workflow custom field selection [DEPRECATED] Use form field endpoints instead. Retrieves a specific workflow custom field selection @@ -114,7 +114,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, WorkflowCustomFieldSelectionResponse]]: +) -> Response[ErrorsList | WorkflowCustomFieldSelectionResponse]: """[DEPRECATED] Retrieves a workflow custom field selection [DEPRECATED] Use form field endpoints instead. Retrieves a specific workflow custom field selection @@ -144,7 +144,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, WorkflowCustomFieldSelectionResponse]]: +) -> ErrorsList | WorkflowCustomFieldSelectionResponse | None: """[DEPRECATED] Retrieves a workflow custom field selection [DEPRECATED] Use form field endpoints instead. Retrieves a specific workflow custom field selection diff --git a/rootly_sdk/api/deprecated_workflow_custom_field_selections/list_workflow_custom_field_selections.py b/rootly_sdk/api/deprecated_workflow_custom_field_selections/list_workflow_custom_field_selections.py index 14aaedb8..b023d80d 100644 --- a/rootly_sdk/api/deprecated_workflow_custom_field_selections/list_workflow_custom_field_selections.py +++ b/rootly_sdk/api/deprecated_workflow_custom_field_selections/list_workflow_custom_field_selections.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -12,9 +12,9 @@ def _get_kwargs( workflow_id: str, *, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -36,8 +36,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[WorkflowCustomFieldSelectionList]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> WorkflowCustomFieldSelectionList | None: if response.status_code == 200: response_200 = WorkflowCustomFieldSelectionList.from_dict(response.json()) @@ -50,7 +50,7 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response + *, client: AuthenticatedClient | Client, response: httpx.Response ) -> Response[WorkflowCustomFieldSelectionList]: return Response( status_code=HTTPStatus(response.status_code), @@ -64,9 +64,9 @@ def sync_detailed( workflow_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[WorkflowCustomFieldSelectionList]: """[DEPRECATED] List workflow custom field selections @@ -104,10 +104,10 @@ def sync( workflow_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, -) -> Optional[WorkflowCustomFieldSelectionList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, +) -> WorkflowCustomFieldSelectionList | None: """[DEPRECATED] List workflow custom field selections [DEPRECATED] Use form field endpoints instead. List workflow custom field selections @@ -139,9 +139,9 @@ async def asyncio_detailed( workflow_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[WorkflowCustomFieldSelectionList]: """[DEPRECATED] List workflow custom field selections @@ -177,10 +177,10 @@ async def asyncio( workflow_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, -) -> Optional[WorkflowCustomFieldSelectionList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, +) -> WorkflowCustomFieldSelectionList | None: """[DEPRECATED] List workflow custom field selections [DEPRECATED] Use form field endpoints instead. List workflow custom field selections diff --git a/rootly_sdk/api/deprecated_workflow_custom_field_selections/update_workflow_custom_field_selection.py b/rootly_sdk/api/deprecated_workflow_custom_field_selections/update_workflow_custom_field_selection.py index 94961cd3..78517bb2 100644 --- a/rootly_sdk/api/deprecated_workflow_custom_field_selections/update_workflow_custom_field_selection.py +++ b/rootly_sdk/api/deprecated_workflow_custom_field_selections/update_workflow_custom_field_selection.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, WorkflowCustomFieldSelectionResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | WorkflowCustomFieldSelectionResponse | None: if response.status_code == 200: response_200 = WorkflowCustomFieldSelectionResponse.from_dict(response.json()) @@ -51,8 +51,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, WorkflowCustomFieldSelectionResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | WorkflowCustomFieldSelectionResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateWorkflowCustomFieldSelection, -) -> Response[Union[ErrorsList, WorkflowCustomFieldSelectionResponse]]: +) -> Response[ErrorsList | WorkflowCustomFieldSelectionResponse]: """[DEPRECATED] Update a workflow custom field selection [DEPRECATED] Use form field endpoints instead. Update a specific workflow custom field selection by @@ -101,7 +101,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateWorkflowCustomFieldSelection, -) -> Optional[Union[ErrorsList, WorkflowCustomFieldSelectionResponse]]: +) -> ErrorsList | WorkflowCustomFieldSelectionResponse | None: """[DEPRECATED] Update a workflow custom field selection [DEPRECATED] Use form field endpoints instead. Update a specific workflow custom field selection by @@ -131,7 +131,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateWorkflowCustomFieldSelection, -) -> Response[Union[ErrorsList, WorkflowCustomFieldSelectionResponse]]: +) -> Response[ErrorsList | WorkflowCustomFieldSelectionResponse]: """[DEPRECATED] Update a workflow custom field selection [DEPRECATED] Use form field endpoints instead. Update a specific workflow custom field selection by @@ -164,7 +164,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateWorkflowCustomFieldSelection, -) -> Optional[Union[ErrorsList, WorkflowCustomFieldSelectionResponse]]: +) -> ErrorsList | WorkflowCustomFieldSelectionResponse | None: """[DEPRECATED] Update a workflow custom field selection [DEPRECATED] Use form field endpoints instead. Update a specific workflow custom field selection by diff --git a/rootly_sdk/api/edge_connector_actions/create_edge_connector_action.py b/rootly_sdk/api/edge_connector_actions/create_edge_connector_action.py index f868d88d..29ca9bbd 100644 --- a/rootly_sdk/api/edge_connector_actions/create_edge_connector_action.py +++ b/rootly_sdk/api/edge_connector_actions/create_edge_connector_action.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -29,7 +29,7 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Any | None: if response.status_code == 201: return None @@ -42,7 +42,7 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Any]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, diff --git a/rootly_sdk/api/edge_connector_actions/delete_edge_connector_action.py b/rootly_sdk/api/edge_connector_actions/delete_edge_connector_action.py index 0acc33cb..5ec477b2 100644 --- a/rootly_sdk/api/edge_connector_actions/delete_edge_connector_action.py +++ b/rootly_sdk/api/edge_connector_actions/delete_edge_connector_action.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any from uuid import UUID import httpx @@ -11,7 +11,7 @@ def _get_kwargs( edge_connector_id: str, - id: Union[UUID, str], + id: UUID | str, ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "delete", @@ -21,7 +21,7 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Any | None: if response.status_code == 200: return None @@ -31,7 +31,7 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Any]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -42,7 +42,7 @@ def _build_response(*, client: Union[AuthenticatedClient, Client], response: htt def sync_detailed( edge_connector_id: str, - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[Any]: @@ -74,7 +74,7 @@ def sync_detailed( async def asyncio_detailed( edge_connector_id: str, - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[Any]: diff --git a/rootly_sdk/api/edge_connector_actions/get_edge_connector_action.py b/rootly_sdk/api/edge_connector_actions/get_edge_connector_action.py index b198edb9..880d1923 100644 --- a/rootly_sdk/api/edge_connector_actions/get_edge_connector_action.py +++ b/rootly_sdk/api/edge_connector_actions/get_edge_connector_action.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any from uuid import UUID import httpx @@ -11,7 +11,7 @@ def _get_kwargs( edge_connector_id: str, - id: Union[UUID, str], + id: UUID | str, ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "get", @@ -21,7 +21,7 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Any | None: if response.status_code == 200: return None @@ -34,7 +34,7 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Any]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -45,7 +45,7 @@ def _build_response(*, client: Union[AuthenticatedClient, Client], response: htt def sync_detailed( edge_connector_id: str, - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[Any]: @@ -77,7 +77,7 @@ def sync_detailed( async def asyncio_detailed( edge_connector_id: str, - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, ) -> Response[Any]: diff --git a/rootly_sdk/api/edge_connector_actions/list_edge_connector_actions.py b/rootly_sdk/api/edge_connector_actions/list_edge_connector_actions.py index 77ce3cc8..28079f6d 100644 --- a/rootly_sdk/api/edge_connector_actions/list_edge_connector_actions.py +++ b/rootly_sdk/api/edge_connector_actions/list_edge_connector_actions.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -19,7 +19,7 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Any | None: if response.status_code == 200: return None @@ -32,7 +32,7 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Any]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, diff --git a/rootly_sdk/api/edge_connector_actions/update_edge_connector_action.py b/rootly_sdk/api/edge_connector_actions/update_edge_connector_action.py index e8b5ffad..cf2b03a1 100644 --- a/rootly_sdk/api/edge_connector_actions/update_edge_connector_action.py +++ b/rootly_sdk/api/edge_connector_actions/update_edge_connector_action.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any from uuid import UUID import httpx @@ -12,7 +12,7 @@ def _get_kwargs( edge_connector_id: str, - id: Union[UUID, str], + id: UUID | str, *, body: UpdateEdgeConnectorActionBody, ) -> dict[str, Any]: @@ -31,7 +31,7 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Any | None: if response.status_code == 200: return None @@ -41,7 +41,7 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Any]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -52,7 +52,7 @@ def _build_response(*, client: Union[AuthenticatedClient, Client], response: htt def sync_detailed( edge_connector_id: str, - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdateEdgeConnectorActionBody, @@ -87,7 +87,7 @@ def sync_detailed( async def asyncio_detailed( edge_connector_id: str, - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdateEdgeConnectorActionBody, diff --git a/rootly_sdk/api/edge_connectors/create_edge_connector.py b/rootly_sdk/api/edge_connectors/create_edge_connector.py index de16ac85..31971c77 100644 --- a/rootly_sdk/api/edge_connectors/create_edge_connector.py +++ b/rootly_sdk/api/edge_connectors/create_edge_connector.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -28,7 +28,7 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Any | None: if response.status_code == 201: return None @@ -41,7 +41,7 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Any]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, diff --git a/rootly_sdk/api/edge_connectors/delete_edge_connector.py b/rootly_sdk/api/edge_connectors/delete_edge_connector.py index d9b27fde..7f472c71 100644 --- a/rootly_sdk/api/edge_connectors/delete_edge_connector.py +++ b/rootly_sdk/api/edge_connectors/delete_edge_connector.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -19,7 +19,7 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Any | None: if response.status_code == 200: return None @@ -29,7 +29,7 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Any]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, diff --git a/rootly_sdk/api/edge_connectors/get_edge_connector.py b/rootly_sdk/api/edge_connectors/get_edge_connector.py index 68b51cb3..b1667ef7 100644 --- a/rootly_sdk/api/edge_connectors/get_edge_connector.py +++ b/rootly_sdk/api/edge_connectors/get_edge_connector.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -19,7 +19,7 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Any | None: if response.status_code == 200: return None @@ -32,7 +32,7 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Any]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, diff --git a/rootly_sdk/api/edge_connectors/list_edge_connectors.py b/rootly_sdk/api/edge_connectors/list_edge_connectors.py index 4ea586aa..1e7b1c39 100644 --- a/rootly_sdk/api/edge_connectors/list_edge_connectors.py +++ b/rootly_sdk/api/edge_connectors/list_edge_connectors.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -10,10 +10,10 @@ def _get_kwargs( *, - page: Union[Unset, int] = UNSET, - per_page: Union[Unset, int] = UNSET, - status: Union[Unset, str] = UNSET, - name: Union[Unset, str] = UNSET, + page: Unset | int = UNSET, + per_page: Unset | int = UNSET, + status: Unset | str = UNSET, + name: Unset | str = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -36,7 +36,7 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Any | None: if response.status_code == 200: return None @@ -46,7 +46,7 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Any]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -58,10 +58,10 @@ def _build_response(*, client: Union[AuthenticatedClient, Client], response: htt def sync_detailed( *, client: AuthenticatedClient, - page: Union[Unset, int] = UNSET, - per_page: Union[Unset, int] = UNSET, - status: Union[Unset, str] = UNSET, - name: Union[Unset, str] = UNSET, + page: Unset | int = UNSET, + per_page: Unset | int = UNSET, + status: Unset | str = UNSET, + name: Unset | str = UNSET, ) -> Response[Any]: """List edge connectors @@ -96,10 +96,10 @@ def sync_detailed( async def asyncio_detailed( *, client: AuthenticatedClient, - page: Union[Unset, int] = UNSET, - per_page: Union[Unset, int] = UNSET, - status: Union[Unset, str] = UNSET, - name: Union[Unset, str] = UNSET, + page: Unset | int = UNSET, + per_page: Unset | int = UNSET, + status: Unset | str = UNSET, + name: Unset | str = UNSET, ) -> Response[Any]: """List edge connectors diff --git a/rootly_sdk/api/edge_connectors/update_edge_connector.py b/rootly_sdk/api/edge_connectors/update_edge_connector.py index 3d417ae8..1c7b0e27 100644 --- a/rootly_sdk/api/edge_connectors/update_edge_connector.py +++ b/rootly_sdk/api/edge_connectors/update_edge_connector.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -29,7 +29,7 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Any | None: if response.status_code == 200: return None @@ -42,7 +42,7 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Any]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, diff --git a/rootly_sdk/api/environments/bulk_delete_environments.py b/rootly_sdk/api/environments/bulk_delete_environments.py index 3d6ca2c4..26e40317 100644 --- a/rootly_sdk/api/environments/bulk_delete_environments.py +++ b/rootly_sdk/api/environments/bulk_delete_environments.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any, Union import httpx @@ -36,10 +36,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[ - Union[BulkDestroyEnvironmentsResponse, ErrorsList, Union["BulkDestroyEnvironmentsResponse", "ErrorsList"]] -]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> BulkDestroyEnvironmentsResponse | ErrorsList | Union["BulkDestroyEnvironmentsResponse", "ErrorsList"] | None: if response.status_code == 200: response_200 = BulkDestroyEnvironmentsResponse.from_dict(response.json()) @@ -78,10 +76,8 @@ def _parse_response_422(data: object) -> Union["BulkDestroyEnvironmentsResponse" def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[ - Union[BulkDestroyEnvironmentsResponse, ErrorsList, Union["BulkDestroyEnvironmentsResponse", "ErrorsList"]] -]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[BulkDestroyEnvironmentsResponse | ErrorsList | Union["BulkDestroyEnvironmentsResponse", "ErrorsList"]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -94,9 +90,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: Union["BulkDestroyEnvironmentsType0", "BulkDestroyEnvironmentsType1"], -) -> Response[ - Union[BulkDestroyEnvironmentsResponse, ErrorsList, Union["BulkDestroyEnvironmentsResponse", "ErrorsList"]] -]: +) -> Response[BulkDestroyEnvironmentsResponse | ErrorsList | Union["BulkDestroyEnvironmentsResponse", "ErrorsList"]]: """Bulk delete Environments Delete environments by external_id list, or prune by managed_by source. Two mutually exclusive @@ -130,9 +124,7 @@ def sync( *, client: AuthenticatedClient, body: Union["BulkDestroyEnvironmentsType0", "BulkDestroyEnvironmentsType1"], -) -> Optional[ - Union[BulkDestroyEnvironmentsResponse, ErrorsList, Union["BulkDestroyEnvironmentsResponse", "ErrorsList"]] -]: +) -> BulkDestroyEnvironmentsResponse | ErrorsList | Union["BulkDestroyEnvironmentsResponse", "ErrorsList"] | None: """Bulk delete Environments Delete environments by external_id list, or prune by managed_by source. Two mutually exclusive @@ -161,9 +153,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: Union["BulkDestroyEnvironmentsType0", "BulkDestroyEnvironmentsType1"], -) -> Response[ - Union[BulkDestroyEnvironmentsResponse, ErrorsList, Union["BulkDestroyEnvironmentsResponse", "ErrorsList"]] -]: +) -> Response[BulkDestroyEnvironmentsResponse | ErrorsList | Union["BulkDestroyEnvironmentsResponse", "ErrorsList"]]: """Bulk delete Environments Delete environments by external_id list, or prune by managed_by source. Two mutually exclusive @@ -195,9 +185,7 @@ async def asyncio( *, client: AuthenticatedClient, body: Union["BulkDestroyEnvironmentsType0", "BulkDestroyEnvironmentsType1"], -) -> Optional[ - Union[BulkDestroyEnvironmentsResponse, ErrorsList, Union["BulkDestroyEnvironmentsResponse", "ErrorsList"]] -]: +) -> BulkDestroyEnvironmentsResponse | ErrorsList | Union["BulkDestroyEnvironmentsResponse", "ErrorsList"] | None: """Bulk delete Environments Delete environments by external_id list, or prune by managed_by source. Two mutually exclusive diff --git a/rootly_sdk/api/environments/bulk_upsert_environments.py b/rootly_sdk/api/environments/bulk_upsert_environments.py index dce558a8..8ad20328 100644 --- a/rootly_sdk/api/environments/bulk_upsert_environments.py +++ b/rootly_sdk/api/environments/bulk_upsert_environments.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any, Union import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[BulkUpsertEnvironmentsResponse, ErrorsList, Union["BulkUpsertEnvironmentsError", "ErrorsList"]]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> BulkUpsertEnvironmentsResponse | ErrorsList | Union["BulkUpsertEnvironmentsError", "ErrorsList"] | None: if response.status_code == 200: response_200 = BulkUpsertEnvironmentsResponse.from_dict(response.json()) @@ -72,8 +72,8 @@ def _parse_response_422(data: object) -> Union["BulkUpsertEnvironmentsError", "E def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[BulkUpsertEnvironmentsResponse, ErrorsList, Union["BulkUpsertEnvironmentsError", "ErrorsList"]]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[BulkUpsertEnvironmentsResponse | ErrorsList | Union["BulkUpsertEnvironmentsError", "ErrorsList"]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -86,7 +86,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: BulkUpsertEnvironments, -) -> Response[Union[BulkUpsertEnvironmentsResponse, ErrorsList, Union["BulkUpsertEnvironmentsError", "ErrorsList"]]]: +) -> Response[BulkUpsertEnvironmentsResponse | ErrorsList | Union["BulkUpsertEnvironmentsError", "ErrorsList"]]: """Bulk upsert Environments Create or update multiple environments by external_id. Only attributes present in the payload are @@ -121,7 +121,7 @@ def sync( *, client: AuthenticatedClient, body: BulkUpsertEnvironments, -) -> Optional[Union[BulkUpsertEnvironmentsResponse, ErrorsList, Union["BulkUpsertEnvironmentsError", "ErrorsList"]]]: +) -> BulkUpsertEnvironmentsResponse | ErrorsList | Union["BulkUpsertEnvironmentsError", "ErrorsList"] | None: """Bulk upsert Environments Create or update multiple environments by external_id. Only attributes present in the payload are @@ -151,7 +151,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: BulkUpsertEnvironments, -) -> Response[Union[BulkUpsertEnvironmentsResponse, ErrorsList, Union["BulkUpsertEnvironmentsError", "ErrorsList"]]]: +) -> Response[BulkUpsertEnvironmentsResponse | ErrorsList | Union["BulkUpsertEnvironmentsError", "ErrorsList"]]: """Bulk upsert Environments Create or update multiple environments by external_id. Only attributes present in the payload are @@ -184,7 +184,7 @@ async def asyncio( *, client: AuthenticatedClient, body: BulkUpsertEnvironments, -) -> Optional[Union[BulkUpsertEnvironmentsResponse, ErrorsList, Union["BulkUpsertEnvironmentsError", "ErrorsList"]]]: +) -> BulkUpsertEnvironmentsResponse | ErrorsList | Union["BulkUpsertEnvironmentsError", "ErrorsList"] | None: """Bulk upsert Environments Create or update multiple environments by external_id. Only attributes present in the payload are diff --git a/rootly_sdk/api/environments/create_environment.py b/rootly_sdk/api/environments/create_environment.py index 2e9683dc..caf794c0 100644 --- a/rootly_sdk/api/environments/create_environment.py +++ b/rootly_sdk/api/environments/create_environment.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[EnvironmentResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> EnvironmentResponse | ErrorsList | None: if response.status_code == 201: response_201 = EnvironmentResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[EnvironmentResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[EnvironmentResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +69,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewEnvironment, -) -> Response[Union[EnvironmentResponse, ErrorsList]]: +) -> Response[EnvironmentResponse | ErrorsList]: """Creates an environment Creates a new environment from provided data @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: NewEnvironment, -) -> Optional[Union[EnvironmentResponse, ErrorsList]]: +) -> EnvironmentResponse | ErrorsList | None: """Creates an environment Creates a new environment from provided data @@ -126,7 +126,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewEnvironment, -) -> Response[Union[EnvironmentResponse, ErrorsList]]: +) -> Response[EnvironmentResponse | ErrorsList]: """Creates an environment Creates a new environment from provided data @@ -155,7 +155,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewEnvironment, -) -> Optional[Union[EnvironmentResponse, ErrorsList]]: +) -> EnvironmentResponse | ErrorsList | None: """Creates an environment Creates a new environment from provided data diff --git a/rootly_sdk/api/environments/create_environment_catalog_property.py b/rootly_sdk/api/environments/create_environment_catalog_property.py index 4686a137..2f99eba5 100644 --- a/rootly_sdk/api/environments/create_environment_catalog_property.py +++ b/rootly_sdk/api/environments/create_environment_catalog_property.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[CatalogPropertyResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CatalogPropertyResponse | ErrorsList | None: if response.status_code == 201: response_201 = CatalogPropertyResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[CatalogPropertyResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[CatalogPropertyResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +69,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewCatalogProperty, -) -> Response[Union[CatalogPropertyResponse, ErrorsList]]: +) -> Response[CatalogPropertyResponse | ErrorsList]: """Creates a Catalog Property Creates a new Catalog Property from provided data @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: NewCatalogProperty, -) -> Optional[Union[CatalogPropertyResponse, ErrorsList]]: +) -> CatalogPropertyResponse | ErrorsList | None: """Creates a Catalog Property Creates a new Catalog Property from provided data @@ -126,7 +126,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewCatalogProperty, -) -> Response[Union[CatalogPropertyResponse, ErrorsList]]: +) -> Response[CatalogPropertyResponse | ErrorsList]: """Creates a Catalog Property Creates a new Catalog Property from provided data @@ -155,7 +155,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewCatalogProperty, -) -> Optional[Union[CatalogPropertyResponse, ErrorsList]]: +) -> CatalogPropertyResponse | ErrorsList | None: """Creates a Catalog Property Creates a new Catalog Property from provided data diff --git a/rootly_sdk/api/environments/delete_environment.py b/rootly_sdk/api/environments/delete_environment.py index cb682340..ef4496ee 100644 --- a/rootly_sdk/api/environments/delete_environment.py +++ b/rootly_sdk/api/environments/delete_environment.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any from uuid import UUID import httpx @@ -12,7 +12,7 @@ def _get_kwargs( - id: Union[UUID, str], + id: UUID | str, ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "delete", @@ -23,8 +23,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[EnvironmentResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> EnvironmentResponse | ErrorsList | None: if response.status_code == 200: response_200 = EnvironmentResponse.from_dict(response.json()) @@ -42,8 +42,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[EnvironmentResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[EnvironmentResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -53,10 +53,10 @@ def _build_response( def sync_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Response[Union[EnvironmentResponse, ErrorsList]]: +) -> Response[EnvironmentResponse | ErrorsList]: """Delete an environment Delete a specific environment by id @@ -84,10 +84,10 @@ def sync_detailed( def sync( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Optional[Union[EnvironmentResponse, ErrorsList]]: +) -> EnvironmentResponse | ErrorsList | None: """Delete an environment Delete a specific environment by id @@ -110,10 +110,10 @@ def sync( async def asyncio_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Response[Union[EnvironmentResponse, ErrorsList]]: +) -> Response[EnvironmentResponse | ErrorsList]: """Delete an environment Delete a specific environment by id @@ -139,10 +139,10 @@ async def asyncio_detailed( async def asyncio( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Optional[Union[EnvironmentResponse, ErrorsList]]: +) -> EnvironmentResponse | ErrorsList | None: """Delete an environment Delete a specific environment by id diff --git a/rootly_sdk/api/environments/get_environment.py b/rootly_sdk/api/environments/get_environment.py index 795b467e..8481d2d2 100644 --- a/rootly_sdk/api/environments/get_environment.py +++ b/rootly_sdk/api/environments/get_environment.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any from uuid import UUID import httpx @@ -12,7 +12,7 @@ def _get_kwargs( - id: Union[UUID, str], + id: UUID | str, ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "get", @@ -23,8 +23,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[EnvironmentResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> EnvironmentResponse | ErrorsList | None: if response.status_code == 200: response_200 = EnvironmentResponse.from_dict(response.json()) @@ -42,8 +42,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[EnvironmentResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[EnvironmentResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -53,10 +53,10 @@ def _build_response( def sync_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Response[Union[EnvironmentResponse, ErrorsList]]: +) -> Response[EnvironmentResponse | ErrorsList]: """Retrieves an environment Retrieves a specific environment by id @@ -84,10 +84,10 @@ def sync_detailed( def sync( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Optional[Union[EnvironmentResponse, ErrorsList]]: +) -> EnvironmentResponse | ErrorsList | None: """Retrieves an environment Retrieves a specific environment by id @@ -110,10 +110,10 @@ def sync( async def asyncio_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Response[Union[EnvironmentResponse, ErrorsList]]: +) -> Response[EnvironmentResponse | ErrorsList]: """Retrieves an environment Retrieves a specific environment by id @@ -139,10 +139,10 @@ async def asyncio_detailed( async def asyncio( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Optional[Union[EnvironmentResponse, ErrorsList]]: +) -> EnvironmentResponse | ErrorsList | None: """Retrieves an environment Retrieves a specific environment by id diff --git a/rootly_sdk/api/environments/list_environment_catalog_properties.py b/rootly_sdk/api/environments/list_environment_catalog_properties.py index aec11ddf..6a882fc6 100644 --- a/rootly_sdk/api/environments/list_environment_catalog_properties.py +++ b/rootly_sdk/api/environments/list_environment_catalog_properties.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -17,27 +17,27 @@ def _get_kwargs( *, - include: Union[Unset, ListEnvironmentCatalogPropertiesInclude] = UNSET, - sort: Union[Unset, ListEnvironmentCatalogPropertiesSort] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterkind: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, + include: Unset | ListEnvironmentCatalogPropertiesInclude = UNSET, + sort: Unset | ListEnvironmentCatalogPropertiesSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} - json_include: Union[Unset, str] = UNSET + json_include: Unset | str = UNSET if not isinstance(include, Unset): json_include = include params["include"] = json_include - json_sort: Union[Unset, str] = UNSET + json_sort: Unset | str = UNSET if not isinstance(sort, Unset): json_sort = sort @@ -72,9 +72,7 @@ def _get_kwargs( return _kwargs -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[CatalogPropertyList]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> CatalogPropertyList | None: if response.status_code == 200: response_200 = CatalogPropertyList.from_dict(response.json()) @@ -86,9 +84,7 @@ def _parse_response( return None -def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[CatalogPropertyList]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[CatalogPropertyList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -100,17 +96,17 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - include: Union[Unset, ListEnvironmentCatalogPropertiesInclude] = UNSET, - sort: Union[Unset, ListEnvironmentCatalogPropertiesSort] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterkind: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, + include: Unset | ListEnvironmentCatalogPropertiesInclude = UNSET, + sort: Unset | ListEnvironmentCatalogPropertiesSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> Response[CatalogPropertyList]: """List Catalog Properties @@ -161,18 +157,18 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: Union[Unset, ListEnvironmentCatalogPropertiesInclude] = UNSET, - sort: Union[Unset, ListEnvironmentCatalogPropertiesSort] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterkind: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, -) -> Optional[CatalogPropertyList]: + include: Unset | ListEnvironmentCatalogPropertiesInclude = UNSET, + sort: Unset | ListEnvironmentCatalogPropertiesSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, +) -> CatalogPropertyList | None: """List Catalog Properties List Environment Catalog Properties @@ -217,17 +213,17 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: Union[Unset, ListEnvironmentCatalogPropertiesInclude] = UNSET, - sort: Union[Unset, ListEnvironmentCatalogPropertiesSort] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterkind: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, + include: Unset | ListEnvironmentCatalogPropertiesInclude = UNSET, + sort: Unset | ListEnvironmentCatalogPropertiesSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> Response[CatalogPropertyList]: """List Catalog Properties @@ -276,18 +272,18 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: Union[Unset, ListEnvironmentCatalogPropertiesInclude] = UNSET, - sort: Union[Unset, ListEnvironmentCatalogPropertiesSort] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterkind: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, -) -> Optional[CatalogPropertyList]: + include: Unset | ListEnvironmentCatalogPropertiesInclude = UNSET, + sort: Unset | ListEnvironmentCatalogPropertiesSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, +) -> CatalogPropertyList | None: """List Catalog Properties List Environment Catalog Properties diff --git a/rootly_sdk/api/environments/list_environments.py b/rootly_sdk/api/environments/list_environments.py index 7de3109b..00547daa 100644 --- a/rootly_sdk/api/environments/list_environments.py +++ b/rootly_sdk/api/environments/list_environments.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -11,30 +11,30 @@ def _get_kwargs( *, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filtercolor: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filterslugeq: Union[Unset, str] = UNSET, - filterslugnot_eq: Union[Unset, str] = UNSET, - filterslugin: Union[Unset, str] = UNSET, - filterslugnot_in: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, - filtercoloreq: Union[Unset, str] = UNSET, - filtercolornot_eq: Union[Unset, str] = UNSET, - filtercolorin: Union[Unset, str] = UNSET, - filtercolornot_in: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filtercolor: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filtercoloreq: Unset | str = UNSET, + filtercolornot_eq: Unset | str = UNSET, + filtercolorin: Unset | str = UNSET, + filtercolornot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -97,9 +97,7 @@ def _get_kwargs( return _kwargs -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[EnvironmentList]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> EnvironmentList | None: if response.status_code == 200: response_200 = EnvironmentList.from_dict(response.json()) @@ -111,9 +109,7 @@ def _parse_response( return None -def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[EnvironmentList]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[EnvironmentList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -125,30 +121,30 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filtercolor: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filterslugeq: Union[Unset, str] = UNSET, - filterslugnot_eq: Union[Unset, str] = UNSET, - filterslugin: Union[Unset, str] = UNSET, - filterslugnot_in: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, - filtercoloreq: Union[Unset, str] = UNSET, - filtercolornot_eq: Union[Unset, str] = UNSET, - filtercolorin: Union[Unset, str] = UNSET, - filtercolornot_in: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filtercolor: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filtercoloreq: Unset | str = UNSET, + filtercolornot_eq: Unset | str = UNSET, + filtercolorin: Unset | str = UNSET, + filtercolornot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[EnvironmentList]: """List environments @@ -225,31 +221,31 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filtercolor: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filterslugeq: Union[Unset, str] = UNSET, - filterslugnot_eq: Union[Unset, str] = UNSET, - filterslugin: Union[Unset, str] = UNSET, - filterslugnot_in: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, - filtercoloreq: Union[Unset, str] = UNSET, - filtercolornot_eq: Union[Unset, str] = UNSET, - filtercolorin: Union[Unset, str] = UNSET, - filtercolornot_in: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, -) -> Optional[EnvironmentList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filtercolor: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filtercoloreq: Unset | str = UNSET, + filtercolornot_eq: Unset | str = UNSET, + filtercolorin: Unset | str = UNSET, + filtercolornot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, +) -> EnvironmentList | None: """List environments List environments @@ -320,30 +316,30 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filtercolor: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filterslugeq: Union[Unset, str] = UNSET, - filterslugnot_eq: Union[Unset, str] = UNSET, - filterslugin: Union[Unset, str] = UNSET, - filterslugnot_in: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, - filtercoloreq: Union[Unset, str] = UNSET, - filtercolornot_eq: Union[Unset, str] = UNSET, - filtercolorin: Union[Unset, str] = UNSET, - filtercolornot_in: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filtercolor: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filtercoloreq: Unset | str = UNSET, + filtercolornot_eq: Unset | str = UNSET, + filtercolorin: Unset | str = UNSET, + filtercolornot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[EnvironmentList]: """List environments @@ -418,31 +414,31 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filtercolor: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filterslugeq: Union[Unset, str] = UNSET, - filterslugnot_eq: Union[Unset, str] = UNSET, - filterslugin: Union[Unset, str] = UNSET, - filterslugnot_in: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, - filtercoloreq: Union[Unset, str] = UNSET, - filtercolornot_eq: Union[Unset, str] = UNSET, - filtercolorin: Union[Unset, str] = UNSET, - filtercolornot_in: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, -) -> Optional[EnvironmentList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filtercolor: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filtercoloreq: Unset | str = UNSET, + filtercolornot_eq: Unset | str = UNSET, + filtercolorin: Unset | str = UNSET, + filtercolornot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, +) -> EnvironmentList | None: """List environments List environments diff --git a/rootly_sdk/api/environments/update_environment.py b/rootly_sdk/api/environments/update_environment.py index d6b6eb9e..9c168e2a 100644 --- a/rootly_sdk/api/environments/update_environment.py +++ b/rootly_sdk/api/environments/update_environment.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any from uuid import UUID import httpx @@ -13,7 +13,7 @@ def _get_kwargs( - id: Union[UUID, str], + id: UUID | str, *, body: UpdateEnvironment, ) -> dict[str, Any]: @@ -33,8 +33,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[EnvironmentResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> EnvironmentResponse | ErrorsList | None: if response.status_code == 200: response_200 = EnvironmentResponse.from_dict(response.json()) @@ -52,8 +52,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[EnvironmentResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[EnvironmentResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -63,11 +63,11 @@ def _build_response( def sync_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdateEnvironment, -) -> Response[Union[EnvironmentResponse, ErrorsList]]: +) -> Response[EnvironmentResponse | ErrorsList]: """Update an environment Update a specific environment by id @@ -97,11 +97,11 @@ def sync_detailed( def sync( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdateEnvironment, -) -> Optional[Union[EnvironmentResponse, ErrorsList]]: +) -> EnvironmentResponse | ErrorsList | None: """Update an environment Update a specific environment by id @@ -126,11 +126,11 @@ def sync( async def asyncio_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdateEnvironment, -) -> Response[Union[EnvironmentResponse, ErrorsList]]: +) -> Response[EnvironmentResponse | ErrorsList]: """Update an environment Update a specific environment by id @@ -158,11 +158,11 @@ async def asyncio_detailed( async def asyncio( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdateEnvironment, -) -> Optional[Union[EnvironmentResponse, ErrorsList]]: +) -> EnvironmentResponse | ErrorsList | None: """Update an environment Update a specific environment by id diff --git a/rootly_sdk/api/escalation_levels/delete_escalation_level.py b/rootly_sdk/api/escalation_levels/delete_escalation_level.py index 108f983c..88675392 100644 --- a/rootly_sdk/api/escalation_levels/delete_escalation_level.py +++ b/rootly_sdk/api/escalation_levels/delete_escalation_level.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, EscalationPolicyLevelResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | EscalationPolicyLevelResponse | None: if response.status_code == 200: response_200 = EscalationPolicyLevelResponse.from_dict(response.json()) @@ -41,8 +41,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, EscalationPolicyLevelResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | EscalationPolicyLevelResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -55,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, EscalationPolicyLevelResponse]]: +) -> Response[ErrorsList | EscalationPolicyLevelResponse]: """Delete an escalation level Delete a specific escalation level by id @@ -86,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, EscalationPolicyLevelResponse]]: +) -> ErrorsList | EscalationPolicyLevelResponse | None: """Delete an escalation level Delete a specific escalation level by id @@ -112,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, EscalationPolicyLevelResponse]]: +) -> Response[ErrorsList | EscalationPolicyLevelResponse]: """Delete an escalation level Delete a specific escalation level by id @@ -141,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, EscalationPolicyLevelResponse]]: +) -> ErrorsList | EscalationPolicyLevelResponse | None: """Delete an escalation level Delete a specific escalation level by id diff --git a/rootly_sdk/api/escalation_levels/get_escalation_level.py b/rootly_sdk/api/escalation_levels/get_escalation_level.py index 1886acef..b60bf742 100644 --- a/rootly_sdk/api/escalation_levels/get_escalation_level.py +++ b/rootly_sdk/api/escalation_levels/get_escalation_level.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, EscalationPolicyLevelResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | EscalationPolicyLevelResponse | None: if response.status_code == 200: response_200 = EscalationPolicyLevelResponse.from_dict(response.json()) @@ -41,8 +41,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, EscalationPolicyLevelResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | EscalationPolicyLevelResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -55,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, EscalationPolicyLevelResponse]]: +) -> Response[ErrorsList | EscalationPolicyLevelResponse]: """Retrieves an escalation level Retrieves a specific escalation level by id @@ -86,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, EscalationPolicyLevelResponse]]: +) -> ErrorsList | EscalationPolicyLevelResponse | None: """Retrieves an escalation level Retrieves a specific escalation level by id @@ -112,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, EscalationPolicyLevelResponse]]: +) -> Response[ErrorsList | EscalationPolicyLevelResponse]: """Retrieves an escalation level Retrieves a specific escalation level by id @@ -141,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, EscalationPolicyLevelResponse]]: +) -> ErrorsList | EscalationPolicyLevelResponse | None: """Retrieves an escalation level Retrieves a specific escalation level by id diff --git a/rootly_sdk/api/escalation_levels/update_escalation_level.py b/rootly_sdk/api/escalation_levels/update_escalation_level.py index 9e854c4b..8a2a4146 100644 --- a/rootly_sdk/api/escalation_levels/update_escalation_level.py +++ b/rootly_sdk/api/escalation_levels/update_escalation_level.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, EscalationPolicyLevelResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | EscalationPolicyLevelResponse | None: if response.status_code == 200: response_200 = EscalationPolicyLevelResponse.from_dict(response.json()) @@ -51,8 +51,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, EscalationPolicyLevelResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | EscalationPolicyLevelResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateEscalationPolicyLevel, -) -> Response[Union[ErrorsList, EscalationPolicyLevelResponse]]: +) -> Response[ErrorsList | EscalationPolicyLevelResponse]: """Update an escalation level Update a specific escalation level by id @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateEscalationPolicyLevel, -) -> Optional[Union[ErrorsList, EscalationPolicyLevelResponse]]: +) -> ErrorsList | EscalationPolicyLevelResponse | None: """Update an escalation level Update a specific escalation level by id @@ -129,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateEscalationPolicyLevel, -) -> Response[Union[ErrorsList, EscalationPolicyLevelResponse]]: +) -> Response[ErrorsList | EscalationPolicyLevelResponse]: """Update an escalation level Update a specific escalation level by id @@ -161,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateEscalationPolicyLevel, -) -> Optional[Union[ErrorsList, EscalationPolicyLevelResponse]]: +) -> ErrorsList | EscalationPolicyLevelResponse | None: """Update an escalation level Update a specific escalation level by id diff --git a/rootly_sdk/api/escalation_levels_path/create_escalation_level_paths.py b/rootly_sdk/api/escalation_levels_path/create_escalation_level_paths.py index 481053e5..cf7dcc78 100644 --- a/rootly_sdk/api/escalation_levels_path/create_escalation_level_paths.py +++ b/rootly_sdk/api/escalation_levels_path/create_escalation_level_paths.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, EscalationPolicyLevelResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | EscalationPolicyLevelResponse | None: if response.status_code == 201: response_201 = EscalationPolicyLevelResponse.from_dict(response.json()) @@ -56,8 +56,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, EscalationPolicyLevelResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | EscalationPolicyLevelResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -71,7 +71,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewEscalationPolicyLevel, -) -> Response[Union[ErrorsList, EscalationPolicyLevelResponse]]: +) -> Response[ErrorsList | EscalationPolicyLevelResponse]: """Creates an escalation level for an Escalation Path Creates a new escalation level from provided data @@ -105,7 +105,7 @@ def sync( *, client: AuthenticatedClient, body: NewEscalationPolicyLevel, -) -> Optional[Union[ErrorsList, EscalationPolicyLevelResponse]]: +) -> ErrorsList | EscalationPolicyLevelResponse | None: """Creates an escalation level for an Escalation Path Creates a new escalation level from provided data @@ -134,7 +134,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewEscalationPolicyLevel, -) -> Response[Union[ErrorsList, EscalationPolicyLevelResponse]]: +) -> Response[ErrorsList | EscalationPolicyLevelResponse]: """Creates an escalation level for an Escalation Path Creates a new escalation level from provided data @@ -166,7 +166,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewEscalationPolicyLevel, -) -> Optional[Union[ErrorsList, EscalationPolicyLevelResponse]]: +) -> ErrorsList | EscalationPolicyLevelResponse | None: """Creates an escalation level for an Escalation Path Creates a new escalation level from provided data diff --git a/rootly_sdk/api/escalation_levels_path/list_escalation_levels_paths.py b/rootly_sdk/api/escalation_levels_path/list_escalation_levels_paths.py index 947aa789..b5aa0f32 100644 --- a/rootly_sdk/api/escalation_levels_path/list_escalation_levels_paths.py +++ b/rootly_sdk/api/escalation_levels_path/list_escalation_levels_paths.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -12,9 +12,9 @@ def _get_kwargs( escalation_policy_path_id: str, *, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -36,8 +36,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[EscalationPolicyLevelList]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> EscalationPolicyLevelList | None: if response.status_code == 200: response_200 = EscalationPolicyLevelList.from_dict(response.json()) @@ -50,7 +50,7 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response + *, client: AuthenticatedClient | Client, response: httpx.Response ) -> Response[EscalationPolicyLevelList]: return Response( status_code=HTTPStatus(response.status_code), @@ -64,9 +64,9 @@ def sync_detailed( escalation_policy_path_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[EscalationPolicyLevelList]: """List escalation levels for an Escalation Path @@ -104,10 +104,10 @@ def sync( escalation_policy_path_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, -) -> Optional[EscalationPolicyLevelList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, +) -> EscalationPolicyLevelList | None: """List escalation levels for an Escalation Path List escalation levels @@ -139,9 +139,9 @@ async def asyncio_detailed( escalation_policy_path_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[EscalationPolicyLevelList]: """List escalation levels for an Escalation Path @@ -177,10 +177,10 @@ async def asyncio( escalation_policy_path_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, -) -> Optional[EscalationPolicyLevelList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, +) -> EscalationPolicyLevelList | None: """List escalation levels for an Escalation Path List escalation levels diff --git a/rootly_sdk/api/escalation_levels_policies/create_escalation_level.py b/rootly_sdk/api/escalation_levels_policies/create_escalation_level.py index a5203b74..98b5d182 100644 --- a/rootly_sdk/api/escalation_levels_policies/create_escalation_level.py +++ b/rootly_sdk/api/escalation_levels_policies/create_escalation_level.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, EscalationPolicyLevelResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | EscalationPolicyLevelResponse | None: if response.status_code == 201: response_201 = EscalationPolicyLevelResponse.from_dict(response.json()) @@ -56,8 +56,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, EscalationPolicyLevelResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | EscalationPolicyLevelResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -71,7 +71,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewEscalationPolicyLevel, -) -> Response[Union[ErrorsList, EscalationPolicyLevelResponse]]: +) -> Response[ErrorsList | EscalationPolicyLevelResponse]: """Creates an escalation level for an Escalation Policy Creates a new escalation level from provided data @@ -105,7 +105,7 @@ def sync( *, client: AuthenticatedClient, body: NewEscalationPolicyLevel, -) -> Optional[Union[ErrorsList, EscalationPolicyLevelResponse]]: +) -> ErrorsList | EscalationPolicyLevelResponse | None: """Creates an escalation level for an Escalation Policy Creates a new escalation level from provided data @@ -134,7 +134,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewEscalationPolicyLevel, -) -> Response[Union[ErrorsList, EscalationPolicyLevelResponse]]: +) -> Response[ErrorsList | EscalationPolicyLevelResponse]: """Creates an escalation level for an Escalation Policy Creates a new escalation level from provided data @@ -166,7 +166,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewEscalationPolicyLevel, -) -> Optional[Union[ErrorsList, EscalationPolicyLevelResponse]]: +) -> ErrorsList | EscalationPolicyLevelResponse | None: """Creates an escalation level for an Escalation Policy Creates a new escalation level from provided data diff --git a/rootly_sdk/api/escalation_levels_policies/list_escalation_levels.py b/rootly_sdk/api/escalation_levels_policies/list_escalation_levels.py index 07a35e04..d0911eef 100644 --- a/rootly_sdk/api/escalation_levels_policies/list_escalation_levels.py +++ b/rootly_sdk/api/escalation_levels_policies/list_escalation_levels.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -12,9 +12,9 @@ def _get_kwargs( escalation_policy_id: str, *, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -36,8 +36,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[EscalationPolicyLevelList]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> EscalationPolicyLevelList | None: if response.status_code == 200: response_200 = EscalationPolicyLevelList.from_dict(response.json()) @@ -50,7 +50,7 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response + *, client: AuthenticatedClient | Client, response: httpx.Response ) -> Response[EscalationPolicyLevelList]: return Response( status_code=HTTPStatus(response.status_code), @@ -64,9 +64,9 @@ def sync_detailed( escalation_policy_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[EscalationPolicyLevelList]: """List escalation levels for an Escalation Policy @@ -104,10 +104,10 @@ def sync( escalation_policy_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, -) -> Optional[EscalationPolicyLevelList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, +) -> EscalationPolicyLevelList | None: """List escalation levels for an Escalation Policy List escalation levels @@ -139,9 +139,9 @@ async def asyncio_detailed( escalation_policy_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[EscalationPolicyLevelList]: """List escalation levels for an Escalation Policy @@ -177,10 +177,10 @@ async def asyncio( escalation_policy_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, -) -> Optional[EscalationPolicyLevelList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, +) -> EscalationPolicyLevelList | None: """List escalation levels for an Escalation Policy List escalation levels diff --git a/rootly_sdk/api/escalation_paths/create_escalation_path.py b/rootly_sdk/api/escalation_paths/create_escalation_path.py index be5a537d..21f082d3 100644 --- a/rootly_sdk/api/escalation_paths/create_escalation_path.py +++ b/rootly_sdk/api/escalation_paths/create_escalation_path.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, EscalationPolicyPathResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | EscalationPolicyPathResponse | None: if response.status_code == 201: response_201 = EscalationPolicyPathResponse.from_dict(response.json()) @@ -56,8 +56,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, EscalationPolicyPathResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | EscalationPolicyPathResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -71,7 +71,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewEscalationPolicyPath, -) -> Response[Union[ErrorsList, EscalationPolicyPathResponse]]: +) -> Response[ErrorsList | EscalationPolicyPathResponse]: """Creates an escalation path Creates a new escalation path from provided data @@ -105,7 +105,7 @@ def sync( *, client: AuthenticatedClient, body: NewEscalationPolicyPath, -) -> Optional[Union[ErrorsList, EscalationPolicyPathResponse]]: +) -> ErrorsList | EscalationPolicyPathResponse | None: """Creates an escalation path Creates a new escalation path from provided data @@ -134,7 +134,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewEscalationPolicyPath, -) -> Response[Union[ErrorsList, EscalationPolicyPathResponse]]: +) -> Response[ErrorsList | EscalationPolicyPathResponse]: """Creates an escalation path Creates a new escalation path from provided data @@ -166,7 +166,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewEscalationPolicyPath, -) -> Optional[Union[ErrorsList, EscalationPolicyPathResponse]]: +) -> ErrorsList | EscalationPolicyPathResponse | None: """Creates an escalation path Creates a new escalation path from provided data diff --git a/rootly_sdk/api/escalation_paths/delete_escalation_path.py b/rootly_sdk/api/escalation_paths/delete_escalation_path.py index a81287a1..f7fd6f89 100644 --- a/rootly_sdk/api/escalation_paths/delete_escalation_path.py +++ b/rootly_sdk/api/escalation_paths/delete_escalation_path.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, EscalationPolicyPathResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | EscalationPolicyPathResponse | None: if response.status_code == 200: response_200 = EscalationPolicyPathResponse.from_dict(response.json()) @@ -41,8 +41,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, EscalationPolicyPathResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | EscalationPolicyPathResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -55,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, EscalationPolicyPathResponse]]: +) -> Response[ErrorsList | EscalationPolicyPathResponse]: """Delete an escalation path Delete a specific escalation path by id @@ -86,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, EscalationPolicyPathResponse]]: +) -> ErrorsList | EscalationPolicyPathResponse | None: """Delete an escalation path Delete a specific escalation path by id @@ -112,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, EscalationPolicyPathResponse]]: +) -> Response[ErrorsList | EscalationPolicyPathResponse]: """Delete an escalation path Delete a specific escalation path by id @@ -141,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, EscalationPolicyPathResponse]]: +) -> ErrorsList | EscalationPolicyPathResponse | None: """Delete an escalation path Delete a specific escalation path by id diff --git a/rootly_sdk/api/escalation_paths/get_escalation_path.py b/rootly_sdk/api/escalation_paths/get_escalation_path.py index 05f73ee1..98762af3 100644 --- a/rootly_sdk/api/escalation_paths/get_escalation_path.py +++ b/rootly_sdk/api/escalation_paths/get_escalation_path.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -14,11 +14,11 @@ def _get_kwargs( id: str, *, - include: Union[Unset, GetEscalationPathInclude] = UNSET, + include: Unset | GetEscalationPathInclude = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} - json_include: Union[Unset, str] = UNSET + json_include: Unset | str = UNSET if not isinstance(include, Unset): json_include = include @@ -36,8 +36,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, EscalationPolicyPathResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | EscalationPolicyPathResponse | None: if response.status_code == 200: response_200 = EscalationPolicyPathResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, EscalationPolicyPathResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | EscalationPolicyPathResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,8 +69,8 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, - include: Union[Unset, GetEscalationPathInclude] = UNSET, -) -> Response[Union[ErrorsList, EscalationPolicyPathResponse]]: + include: Unset | GetEscalationPathInclude = UNSET, +) -> Response[ErrorsList | EscalationPolicyPathResponse]: """Retrieves an escalation path Retrieves a specific escalation path by id @@ -103,8 +103,8 @@ def sync( id: str, *, client: AuthenticatedClient, - include: Union[Unset, GetEscalationPathInclude] = UNSET, -) -> Optional[Union[ErrorsList, EscalationPolicyPathResponse]]: + include: Unset | GetEscalationPathInclude = UNSET, +) -> ErrorsList | EscalationPolicyPathResponse | None: """Retrieves an escalation path Retrieves a specific escalation path by id @@ -132,8 +132,8 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, - include: Union[Unset, GetEscalationPathInclude] = UNSET, -) -> Response[Union[ErrorsList, EscalationPolicyPathResponse]]: + include: Unset | GetEscalationPathInclude = UNSET, +) -> Response[ErrorsList | EscalationPolicyPathResponse]: """Retrieves an escalation path Retrieves a specific escalation path by id @@ -164,8 +164,8 @@ async def asyncio( id: str, *, client: AuthenticatedClient, - include: Union[Unset, GetEscalationPathInclude] = UNSET, -) -> Optional[Union[ErrorsList, EscalationPolicyPathResponse]]: + include: Unset | GetEscalationPathInclude = UNSET, +) -> ErrorsList | EscalationPolicyPathResponse | None: """Retrieves an escalation path Retrieves a specific escalation path by id diff --git a/rootly_sdk/api/escalation_paths/list_escalation_paths.py b/rootly_sdk/api/escalation_paths/list_escalation_paths.py index e8a97b85..117e1031 100644 --- a/rootly_sdk/api/escalation_paths/list_escalation_paths.py +++ b/rootly_sdk/api/escalation_paths/list_escalation_paths.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -16,20 +16,20 @@ def _get_kwargs( escalation_policy_id: str, *, - include: Union[Unset, ListEscalationPathsInclude] = UNSET, - filterpath_type: Union[Unset, ListEscalationPathsFilterpathType] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + include: Unset | ListEscalationPathsInclude = UNSET, + filterpath_type: Unset | ListEscalationPathsFilterpathType = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} - json_include: Union[Unset, str] = UNSET + json_include: Unset | str = UNSET if not isinstance(include, Unset): json_include = include params["include"] = json_include - json_filterpath_type: Union[Unset, str] = UNSET + json_filterpath_type: Unset | str = UNSET if not isinstance(filterpath_type, Unset): json_filterpath_type = filterpath_type @@ -51,8 +51,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[EscalationPolicyPathList]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> EscalationPolicyPathList | None: if response.status_code == 200: response_200 = EscalationPolicyPathList.from_dict(response.json()) @@ -65,7 +65,7 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response + *, client: AuthenticatedClient | Client, response: httpx.Response ) -> Response[EscalationPolicyPathList]: return Response( status_code=HTTPStatus(response.status_code), @@ -79,10 +79,10 @@ def sync_detailed( escalation_policy_id: str, *, client: AuthenticatedClient, - include: Union[Unset, ListEscalationPathsInclude] = UNSET, - filterpath_type: Union[Unset, ListEscalationPathsFilterpathType] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + include: Unset | ListEscalationPathsInclude = UNSET, + filterpath_type: Unset | ListEscalationPathsFilterpathType = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[EscalationPolicyPathList]: """List escalation paths @@ -122,11 +122,11 @@ def sync( escalation_policy_id: str, *, client: AuthenticatedClient, - include: Union[Unset, ListEscalationPathsInclude] = UNSET, - filterpath_type: Union[Unset, ListEscalationPathsFilterpathType] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, -) -> Optional[EscalationPolicyPathList]: + include: Unset | ListEscalationPathsInclude = UNSET, + filterpath_type: Unset | ListEscalationPathsFilterpathType = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, +) -> EscalationPolicyPathList | None: """List escalation paths List escalation paths @@ -160,10 +160,10 @@ async def asyncio_detailed( escalation_policy_id: str, *, client: AuthenticatedClient, - include: Union[Unset, ListEscalationPathsInclude] = UNSET, - filterpath_type: Union[Unset, ListEscalationPathsFilterpathType] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + include: Unset | ListEscalationPathsInclude = UNSET, + filterpath_type: Unset | ListEscalationPathsFilterpathType = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[EscalationPolicyPathList]: """List escalation paths @@ -201,11 +201,11 @@ async def asyncio( escalation_policy_id: str, *, client: AuthenticatedClient, - include: Union[Unset, ListEscalationPathsInclude] = UNSET, - filterpath_type: Union[Unset, ListEscalationPathsFilterpathType] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, -) -> Optional[EscalationPolicyPathList]: + include: Unset | ListEscalationPathsInclude = UNSET, + filterpath_type: Unset | ListEscalationPathsFilterpathType = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, +) -> EscalationPolicyPathList | None: """List escalation paths List escalation paths diff --git a/rootly_sdk/api/escalation_paths/update_escalation_path.py b/rootly_sdk/api/escalation_paths/update_escalation_path.py index 1f0fa8a4..9187d4d9 100644 --- a/rootly_sdk/api/escalation_paths/update_escalation_path.py +++ b/rootly_sdk/api/escalation_paths/update_escalation_path.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, EscalationPolicyPathResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | EscalationPolicyPathResponse | None: if response.status_code == 200: response_200 = EscalationPolicyPathResponse.from_dict(response.json()) @@ -51,8 +51,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, EscalationPolicyPathResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | EscalationPolicyPathResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateEscalationPolicyPath, -) -> Response[Union[ErrorsList, EscalationPolicyPathResponse]]: +) -> Response[ErrorsList | EscalationPolicyPathResponse]: """Update an escalation path Update a specific escalation path by id @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateEscalationPolicyPath, -) -> Optional[Union[ErrorsList, EscalationPolicyPathResponse]]: +) -> ErrorsList | EscalationPolicyPathResponse | None: """Update an escalation path Update a specific escalation path by id @@ -129,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateEscalationPolicyPath, -) -> Response[Union[ErrorsList, EscalationPolicyPathResponse]]: +) -> Response[ErrorsList | EscalationPolicyPathResponse]: """Update an escalation path Update a specific escalation path by id @@ -161,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateEscalationPolicyPath, -) -> Optional[Union[ErrorsList, EscalationPolicyPathResponse]]: +) -> ErrorsList | EscalationPolicyPathResponse | None: """Update an escalation path Update a specific escalation path by id diff --git a/rootly_sdk/api/escalation_policies/create_escalation_policy.py b/rootly_sdk/api/escalation_policies/create_escalation_policy.py index 8c61e2bf..74416a48 100644 --- a/rootly_sdk/api/escalation_policies/create_escalation_policy.py +++ b/rootly_sdk/api/escalation_policies/create_escalation_policy.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, EscalationPolicyResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | EscalationPolicyResponse | None: if response.status_code == 201: response_201 = EscalationPolicyResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, EscalationPolicyResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | EscalationPolicyResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +69,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewEscalationPolicy, -) -> Response[Union[ErrorsList, EscalationPolicyResponse]]: +) -> Response[ErrorsList | EscalationPolicyResponse]: """Creates an escalation policy Creates a new escalation policy from provided data @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: NewEscalationPolicy, -) -> Optional[Union[ErrorsList, EscalationPolicyResponse]]: +) -> ErrorsList | EscalationPolicyResponse | None: """Creates an escalation policy Creates a new escalation policy from provided data @@ -126,7 +126,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewEscalationPolicy, -) -> Response[Union[ErrorsList, EscalationPolicyResponse]]: +) -> Response[ErrorsList | EscalationPolicyResponse]: """Creates an escalation policy Creates a new escalation policy from provided data @@ -155,7 +155,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewEscalationPolicy, -) -> Optional[Union[ErrorsList, EscalationPolicyResponse]]: +) -> ErrorsList | EscalationPolicyResponse | None: """Creates an escalation policy Creates a new escalation policy from provided data diff --git a/rootly_sdk/api/escalation_policies/delete_escalation_policy.py b/rootly_sdk/api/escalation_policies/delete_escalation_policy.py index b6a7f55f..e07ef4de 100644 --- a/rootly_sdk/api/escalation_policies/delete_escalation_policy.py +++ b/rootly_sdk/api/escalation_policies/delete_escalation_policy.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, EscalationPolicyResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | EscalationPolicyResponse | None: if response.status_code == 200: response_200 = EscalationPolicyResponse.from_dict(response.json()) @@ -41,8 +41,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, EscalationPolicyResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | EscalationPolicyResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -55,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, EscalationPolicyResponse]]: +) -> Response[ErrorsList | EscalationPolicyResponse]: """Delete an escalation policy Delete a specific escalation policy by id @@ -86,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, EscalationPolicyResponse]]: +) -> ErrorsList | EscalationPolicyResponse | None: """Delete an escalation policy Delete a specific escalation policy by id @@ -112,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, EscalationPolicyResponse]]: +) -> Response[ErrorsList | EscalationPolicyResponse]: """Delete an escalation policy Delete a specific escalation policy by id @@ -141,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, EscalationPolicyResponse]]: +) -> ErrorsList | EscalationPolicyResponse | None: """Delete an escalation policy Delete a specific escalation policy by id diff --git a/rootly_sdk/api/escalation_policies/get_escalation_policy.py b/rootly_sdk/api/escalation_policies/get_escalation_policy.py index 2037e6b8..c19bfb44 100644 --- a/rootly_sdk/api/escalation_policies/get_escalation_policy.py +++ b/rootly_sdk/api/escalation_policies/get_escalation_policy.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -14,11 +14,11 @@ def _get_kwargs( id: str, *, - include: Union[Unset, GetEscalationPolicyInclude] = UNSET, + include: Unset | GetEscalationPolicyInclude = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} - json_include: Union[Unset, str] = UNSET + json_include: Unset | str = UNSET if not isinstance(include, Unset): json_include = include @@ -36,8 +36,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, EscalationPolicyResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | EscalationPolicyResponse | None: if response.status_code == 200: response_200 = EscalationPolicyResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, EscalationPolicyResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | EscalationPolicyResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,8 +69,8 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, - include: Union[Unset, GetEscalationPolicyInclude] = UNSET, -) -> Response[Union[ErrorsList, EscalationPolicyResponse]]: + include: Unset | GetEscalationPolicyInclude = UNSET, +) -> Response[ErrorsList | EscalationPolicyResponse]: """Retrieves an escalation policy Retrieves a specific escalation policy by id @@ -103,8 +103,8 @@ def sync( id: str, *, client: AuthenticatedClient, - include: Union[Unset, GetEscalationPolicyInclude] = UNSET, -) -> Optional[Union[ErrorsList, EscalationPolicyResponse]]: + include: Unset | GetEscalationPolicyInclude = UNSET, +) -> ErrorsList | EscalationPolicyResponse | None: """Retrieves an escalation policy Retrieves a specific escalation policy by id @@ -132,8 +132,8 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, - include: Union[Unset, GetEscalationPolicyInclude] = UNSET, -) -> Response[Union[ErrorsList, EscalationPolicyResponse]]: + include: Unset | GetEscalationPolicyInclude = UNSET, +) -> Response[ErrorsList | EscalationPolicyResponse]: """Retrieves an escalation policy Retrieves a specific escalation policy by id @@ -164,8 +164,8 @@ async def asyncio( id: str, *, client: AuthenticatedClient, - include: Union[Unset, GetEscalationPolicyInclude] = UNSET, -) -> Optional[Union[ErrorsList, EscalationPolicyResponse]]: + include: Unset | GetEscalationPolicyInclude = UNSET, +) -> ErrorsList | EscalationPolicyResponse | None: """Retrieves an escalation policy Retrieves a specific escalation policy by id diff --git a/rootly_sdk/api/escalation_policies/list_escalation_policies.py b/rootly_sdk/api/escalation_policies/list_escalation_policies.py index c4116c19..6d945707 100644 --- a/rootly_sdk/api/escalation_policies/list_escalation_policies.py +++ b/rootly_sdk/api/escalation_policies/list_escalation_policies.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -14,28 +14,28 @@ def _get_kwargs( *, - include: Union[Unset, ListEscalationPoliciesInclude] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterteam_ids: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, - filterteam_idseq: Union[Unset, str] = UNSET, - filterteam_idsnot_eq: Union[Unset, str] = UNSET, - filterteam_idsin: Union[Unset, str] = UNSET, - filterteam_idsnot_in: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + include: Unset | ListEscalationPoliciesInclude = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterteam_ids: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filterteam_idseq: Unset | str = UNSET, + filterteam_idsnot_eq: Unset | str = UNSET, + filterteam_idsin: Unset | str = UNSET, + filterteam_idsnot_in: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} - json_include: Union[Unset, str] = UNSET + json_include: Unset | str = UNSET if not isinstance(include, Unset): json_include = include @@ -86,9 +86,7 @@ def _get_kwargs( return _kwargs -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[EscalationPolicyList]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> EscalationPolicyList | None: if response.status_code == 200: response_200 = EscalationPolicyList.from_dict(response.json()) @@ -101,7 +99,7 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response + *, client: AuthenticatedClient | Client, response: httpx.Response ) -> Response[EscalationPolicyList]: return Response( status_code=HTTPStatus(response.status_code), @@ -114,24 +112,24 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - include: Union[Unset, ListEscalationPoliciesInclude] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterteam_ids: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, - filterteam_idseq: Union[Unset, str] = UNSET, - filterteam_idsnot_eq: Union[Unset, str] = UNSET, - filterteam_idsin: Union[Unset, str] = UNSET, - filterteam_idsnot_in: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + include: Unset | ListEscalationPoliciesInclude = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterteam_ids: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filterteam_idseq: Unset | str = UNSET, + filterteam_idsnot_eq: Unset | str = UNSET, + filterteam_idsin: Unset | str = UNSET, + filterteam_idsnot_in: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[EscalationPolicyList]: """List escalation policies @@ -196,25 +194,25 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: Union[Unset, ListEscalationPoliciesInclude] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterteam_ids: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, - filterteam_idseq: Union[Unset, str] = UNSET, - filterteam_idsnot_eq: Union[Unset, str] = UNSET, - filterteam_idsin: Union[Unset, str] = UNSET, - filterteam_idsnot_in: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, -) -> Optional[EscalationPolicyList]: + include: Unset | ListEscalationPoliciesInclude = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterteam_ids: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filterteam_idseq: Unset | str = UNSET, + filterteam_idsnot_eq: Unset | str = UNSET, + filterteam_idsin: Unset | str = UNSET, + filterteam_idsnot_in: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, +) -> EscalationPolicyList | None: """List escalation policies List escalation policies @@ -273,24 +271,24 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: Union[Unset, ListEscalationPoliciesInclude] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterteam_ids: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, - filterteam_idseq: Union[Unset, str] = UNSET, - filterteam_idsnot_eq: Union[Unset, str] = UNSET, - filterteam_idsin: Union[Unset, str] = UNSET, - filterteam_idsnot_in: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + include: Unset | ListEscalationPoliciesInclude = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterteam_ids: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filterteam_idseq: Unset | str = UNSET, + filterteam_idsnot_eq: Unset | str = UNSET, + filterteam_idsin: Unset | str = UNSET, + filterteam_idsnot_in: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[EscalationPolicyList]: """List escalation policies @@ -353,25 +351,25 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: Union[Unset, ListEscalationPoliciesInclude] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterteam_ids: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, - filterteam_idseq: Union[Unset, str] = UNSET, - filterteam_idsnot_eq: Union[Unset, str] = UNSET, - filterteam_idsin: Union[Unset, str] = UNSET, - filterteam_idsnot_in: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, -) -> Optional[EscalationPolicyList]: + include: Unset | ListEscalationPoliciesInclude = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterteam_ids: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filterteam_idseq: Unset | str = UNSET, + filterteam_idsnot_eq: Unset | str = UNSET, + filterteam_idsin: Unset | str = UNSET, + filterteam_idsnot_in: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, +) -> EscalationPolicyList | None: """List escalation policies List escalation policies diff --git a/rootly_sdk/api/escalation_policies/update_escalation_policy.py b/rootly_sdk/api/escalation_policies/update_escalation_policy.py index 72c99902..11db6e82 100644 --- a/rootly_sdk/api/escalation_policies/update_escalation_policy.py +++ b/rootly_sdk/api/escalation_policies/update_escalation_policy.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, EscalationPolicyResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | EscalationPolicyResponse | None: if response.status_code == 200: response_200 = EscalationPolicyResponse.from_dict(response.json()) @@ -51,8 +51,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, EscalationPolicyResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | EscalationPolicyResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateEscalationPolicy, -) -> Response[Union[ErrorsList, EscalationPolicyResponse]]: +) -> Response[ErrorsList | EscalationPolicyResponse]: """Update an escalation policy Update a specific escalation policy by id @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateEscalationPolicy, -) -> Optional[Union[ErrorsList, EscalationPolicyResponse]]: +) -> ErrorsList | EscalationPolicyResponse | None: """Update an escalation policy Update a specific escalation policy by id @@ -129,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateEscalationPolicy, -) -> Response[Union[ErrorsList, EscalationPolicyResponse]]: +) -> Response[ErrorsList | EscalationPolicyResponse]: """Update an escalation policy Update a specific escalation policy by id @@ -161,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateEscalationPolicy, -) -> Optional[Union[ErrorsList, EscalationPolicyResponse]]: +) -> ErrorsList | EscalationPolicyResponse | None: """Update an escalation policy Update a specific escalation policy by id diff --git a/rootly_sdk/api/form_field_options/create_form_field_option.py b/rootly_sdk/api/form_field_options/create_form_field_option.py index 57b1e452..292bf1c9 100644 --- a/rootly_sdk/api/form_field_options/create_form_field_option.py +++ b/rootly_sdk/api/form_field_options/create_form_field_option.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, FormFieldOptionResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | FormFieldOptionResponse | None: if response.status_code == 201: response_201 = FormFieldOptionResponse.from_dict(response.json()) @@ -56,8 +56,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, FormFieldOptionResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | FormFieldOptionResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -71,7 +71,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewFormFieldOption, -) -> Response[Union[ErrorsList, FormFieldOptionResponse]]: +) -> Response[ErrorsList | FormFieldOptionResponse]: """Creates FormField Options Creates a new form_field_option from provided data @@ -105,7 +105,7 @@ def sync( *, client: AuthenticatedClient, body: NewFormFieldOption, -) -> Optional[Union[ErrorsList, FormFieldOptionResponse]]: +) -> ErrorsList | FormFieldOptionResponse | None: """Creates FormField Options Creates a new form_field_option from provided data @@ -134,7 +134,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewFormFieldOption, -) -> Response[Union[ErrorsList, FormFieldOptionResponse]]: +) -> Response[ErrorsList | FormFieldOptionResponse]: """Creates FormField Options Creates a new form_field_option from provided data @@ -166,7 +166,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewFormFieldOption, -) -> Optional[Union[ErrorsList, FormFieldOptionResponse]]: +) -> ErrorsList | FormFieldOptionResponse | None: """Creates FormField Options Creates a new form_field_option from provided data diff --git a/rootly_sdk/api/form_field_options/delete_form_field_option.py b/rootly_sdk/api/form_field_options/delete_form_field_option.py index 1570e14e..b7ff0f29 100644 --- a/rootly_sdk/api/form_field_options/delete_form_field_option.py +++ b/rootly_sdk/api/form_field_options/delete_form_field_option.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, FormFieldOptionResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | FormFieldOptionResponse | None: if response.status_code == 200: response_200 = FormFieldOptionResponse.from_dict(response.json()) @@ -41,8 +41,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, FormFieldOptionResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | FormFieldOptionResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -55,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, FormFieldOptionResponse]]: +) -> Response[ErrorsList | FormFieldOptionResponse]: """Delete FormField Options Delete a specific form_field_option by id @@ -86,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, FormFieldOptionResponse]]: +) -> ErrorsList | FormFieldOptionResponse | None: """Delete FormField Options Delete a specific form_field_option by id @@ -112,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, FormFieldOptionResponse]]: +) -> Response[ErrorsList | FormFieldOptionResponse]: """Delete FormField Options Delete a specific form_field_option by id @@ -141,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, FormFieldOptionResponse]]: +) -> ErrorsList | FormFieldOptionResponse | None: """Delete FormField Options Delete a specific form_field_option by id diff --git a/rootly_sdk/api/form_field_options/get_form_field_option.py b/rootly_sdk/api/form_field_options/get_form_field_option.py index 71b50416..0cf1dfbc 100644 --- a/rootly_sdk/api/form_field_options/get_form_field_option.py +++ b/rootly_sdk/api/form_field_options/get_form_field_option.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, FormFieldOptionResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | FormFieldOptionResponse | None: if response.status_code == 200: response_200 = FormFieldOptionResponse.from_dict(response.json()) @@ -41,8 +41,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, FormFieldOptionResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | FormFieldOptionResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -55,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, FormFieldOptionResponse]]: +) -> Response[ErrorsList | FormFieldOptionResponse]: """Retrieves FormField Options Retrieves a specific form_field_option by id @@ -86,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, FormFieldOptionResponse]]: +) -> ErrorsList | FormFieldOptionResponse | None: """Retrieves FormField Options Retrieves a specific form_field_option by id @@ -112,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, FormFieldOptionResponse]]: +) -> Response[ErrorsList | FormFieldOptionResponse]: """Retrieves FormField Options Retrieves a specific form_field_option by id @@ -141,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, FormFieldOptionResponse]]: +) -> ErrorsList | FormFieldOptionResponse | None: """Retrieves FormField Options Retrieves a specific form_field_option by id diff --git a/rootly_sdk/api/form_field_options/list_form_field_options.py b/rootly_sdk/api/form_field_options/list_form_field_options.py index c5ea6e83..08cd3f56 100644 --- a/rootly_sdk/api/form_field_options/list_form_field_options.py +++ b/rootly_sdk/api/form_field_options/list_form_field_options.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -12,11 +12,11 @@ def _get_kwargs( form_field_id: str, *, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtervalue: Union[Unset, str] = UNSET, - filtercolor: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtervalue: Unset | str = UNSET, + filtercolor: Unset | str = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -41,9 +41,7 @@ def _get_kwargs( return _kwargs -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[FormFieldOptionList]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> FormFieldOptionList | None: if response.status_code == 200: response_200 = FormFieldOptionList.from_dict(response.json()) @@ -55,9 +53,7 @@ def _parse_response( return None -def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[FormFieldOptionList]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[FormFieldOptionList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -70,11 +66,11 @@ def sync_detailed( form_field_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtervalue: Union[Unset, str] = UNSET, - filtercolor: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtervalue: Unset | str = UNSET, + filtercolor: Unset | str = UNSET, ) -> Response[FormFieldOptionList]: """List FormField Options @@ -116,12 +112,12 @@ def sync( form_field_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtervalue: Union[Unset, str] = UNSET, - filtercolor: Union[Unset, str] = UNSET, -) -> Optional[FormFieldOptionList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtervalue: Unset | str = UNSET, + filtercolor: Unset | str = UNSET, +) -> FormFieldOptionList | None: """List FormField Options List form_field_options @@ -157,11 +153,11 @@ async def asyncio_detailed( form_field_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtervalue: Union[Unset, str] = UNSET, - filtercolor: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtervalue: Unset | str = UNSET, + filtercolor: Unset | str = UNSET, ) -> Response[FormFieldOptionList]: """List FormField Options @@ -201,12 +197,12 @@ async def asyncio( form_field_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtervalue: Union[Unset, str] = UNSET, - filtercolor: Union[Unset, str] = UNSET, -) -> Optional[FormFieldOptionList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtervalue: Unset | str = UNSET, + filtercolor: Unset | str = UNSET, +) -> FormFieldOptionList | None: """List FormField Options List form_field_options diff --git a/rootly_sdk/api/form_field_options/update_form_field_option.py b/rootly_sdk/api/form_field_options/update_form_field_option.py index 603badf4..80c84c48 100644 --- a/rootly_sdk/api/form_field_options/update_form_field_option.py +++ b/rootly_sdk/api/form_field_options/update_form_field_option.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, FormFieldOptionResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | FormFieldOptionResponse | None: if response.status_code == 200: response_200 = FormFieldOptionResponse.from_dict(response.json()) @@ -51,8 +51,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, FormFieldOptionResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | FormFieldOptionResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateFormFieldOption, -) -> Response[Union[ErrorsList, FormFieldOptionResponse]]: +) -> Response[ErrorsList | FormFieldOptionResponse]: """Update FormField Options Update a specific form_field_option by id @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateFormFieldOption, -) -> Optional[Union[ErrorsList, FormFieldOptionResponse]]: +) -> ErrorsList | FormFieldOptionResponse | None: """Update FormField Options Update a specific form_field_option by id @@ -129,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateFormFieldOption, -) -> Response[Union[ErrorsList, FormFieldOptionResponse]]: +) -> Response[ErrorsList | FormFieldOptionResponse]: """Update FormField Options Update a specific form_field_option by id @@ -161,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateFormFieldOption, -) -> Optional[Union[ErrorsList, FormFieldOptionResponse]]: +) -> ErrorsList | FormFieldOptionResponse | None: """Update FormField Options Update a specific form_field_option by id diff --git a/rootly_sdk/api/form_field_placement_conditions/create_form_field_placement_condition.py b/rootly_sdk/api/form_field_placement_conditions/create_form_field_placement_condition.py index f6a660a4..11a876d3 100644 --- a/rootly_sdk/api/form_field_placement_conditions/create_form_field_placement_condition.py +++ b/rootly_sdk/api/form_field_placement_conditions/create_form_field_placement_condition.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, FormFieldPlacementConditionResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | FormFieldPlacementConditionResponse | None: if response.status_code == 201: response_201 = FormFieldPlacementConditionResponse.from_dict(response.json()) @@ -56,8 +56,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, FormFieldPlacementConditionResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | FormFieldPlacementConditionResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -71,7 +71,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewFormFieldPlacementCondition, -) -> Response[Union[ErrorsList, FormFieldPlacementConditionResponse]]: +) -> Response[ErrorsList | FormFieldPlacementConditionResponse]: """Creates a Form Set Condition Creates a new form_field_placement_condition from provided data @@ -105,7 +105,7 @@ def sync( *, client: AuthenticatedClient, body: NewFormFieldPlacementCondition, -) -> Optional[Union[ErrorsList, FormFieldPlacementConditionResponse]]: +) -> ErrorsList | FormFieldPlacementConditionResponse | None: """Creates a Form Set Condition Creates a new form_field_placement_condition from provided data @@ -134,7 +134,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewFormFieldPlacementCondition, -) -> Response[Union[ErrorsList, FormFieldPlacementConditionResponse]]: +) -> Response[ErrorsList | FormFieldPlacementConditionResponse]: """Creates a Form Set Condition Creates a new form_field_placement_condition from provided data @@ -166,7 +166,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewFormFieldPlacementCondition, -) -> Optional[Union[ErrorsList, FormFieldPlacementConditionResponse]]: +) -> ErrorsList | FormFieldPlacementConditionResponse | None: """Creates a Form Set Condition Creates a new form_field_placement_condition from provided data diff --git a/rootly_sdk/api/form_field_placement_conditions/delete_form_field_placement_condition.py b/rootly_sdk/api/form_field_placement_conditions/delete_form_field_placement_condition.py index 0eb7fc5e..39538b58 100644 --- a/rootly_sdk/api/form_field_placement_conditions/delete_form_field_placement_condition.py +++ b/rootly_sdk/api/form_field_placement_conditions/delete_form_field_placement_condition.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, FormFieldPlacementConditionResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | FormFieldPlacementConditionResponse | None: if response.status_code == 200: response_200 = FormFieldPlacementConditionResponse.from_dict(response.json()) @@ -41,8 +41,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, FormFieldPlacementConditionResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | FormFieldPlacementConditionResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -55,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, FormFieldPlacementConditionResponse]]: +) -> Response[ErrorsList | FormFieldPlacementConditionResponse]: """Delete a Form Set Condition Delete a specific form_field_placement_condition by id @@ -86,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, FormFieldPlacementConditionResponse]]: +) -> ErrorsList | FormFieldPlacementConditionResponse | None: """Delete a Form Set Condition Delete a specific form_field_placement_condition by id @@ -112,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, FormFieldPlacementConditionResponse]]: +) -> Response[ErrorsList | FormFieldPlacementConditionResponse]: """Delete a Form Set Condition Delete a specific form_field_placement_condition by id @@ -141,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, FormFieldPlacementConditionResponse]]: +) -> ErrorsList | FormFieldPlacementConditionResponse | None: """Delete a Form Set Condition Delete a specific form_field_placement_condition by id diff --git a/rootly_sdk/api/form_field_placement_conditions/get_form_field_placement_condition.py b/rootly_sdk/api/form_field_placement_conditions/get_form_field_placement_condition.py index 19026f81..5a711a1c 100644 --- a/rootly_sdk/api/form_field_placement_conditions/get_form_field_placement_condition.py +++ b/rootly_sdk/api/form_field_placement_conditions/get_form_field_placement_condition.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, FormFieldPlacementConditionResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | FormFieldPlacementConditionResponse | None: if response.status_code == 200: response_200 = FormFieldPlacementConditionResponse.from_dict(response.json()) @@ -41,8 +41,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, FormFieldPlacementConditionResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | FormFieldPlacementConditionResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -55,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, FormFieldPlacementConditionResponse]]: +) -> Response[ErrorsList | FormFieldPlacementConditionResponse]: """Retrieves a Form Set Condition Retrieves a specific form_field_placement_condition by id @@ -86,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, FormFieldPlacementConditionResponse]]: +) -> ErrorsList | FormFieldPlacementConditionResponse | None: """Retrieves a Form Set Condition Retrieves a specific form_field_placement_condition by id @@ -112,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, FormFieldPlacementConditionResponse]]: +) -> Response[ErrorsList | FormFieldPlacementConditionResponse]: """Retrieves a Form Set Condition Retrieves a specific form_field_placement_condition by id @@ -141,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, FormFieldPlacementConditionResponse]]: +) -> ErrorsList | FormFieldPlacementConditionResponse | None: """Retrieves a Form Set Condition Retrieves a specific form_field_placement_condition by id diff --git a/rootly_sdk/api/form_field_placement_conditions/list_form_field_placement_conditions.py b/rootly_sdk/api/form_field_placement_conditions/list_form_field_placement_conditions.py index 882973e3..b7b9946d 100644 --- a/rootly_sdk/api/form_field_placement_conditions/list_form_field_placement_conditions.py +++ b/rootly_sdk/api/form_field_placement_conditions/list_form_field_placement_conditions.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -12,10 +12,10 @@ def _get_kwargs( form_field_placement_id: str, *, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterform_field_id: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterform_field_id: Unset | str = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -39,8 +39,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[FormFieldPlacementConditionList]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> FormFieldPlacementConditionList | None: if response.status_code == 200: response_200 = FormFieldPlacementConditionList.from_dict(response.json()) @@ -53,7 +53,7 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response + *, client: AuthenticatedClient | Client, response: httpx.Response ) -> Response[FormFieldPlacementConditionList]: return Response( status_code=HTTPStatus(response.status_code), @@ -67,10 +67,10 @@ def sync_detailed( form_field_placement_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterform_field_id: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterform_field_id: Unset | str = UNSET, ) -> Response[FormFieldPlacementConditionList]: """List Form Set Conditions @@ -110,11 +110,11 @@ def sync( form_field_placement_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterform_field_id: Union[Unset, str] = UNSET, -) -> Optional[FormFieldPlacementConditionList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterform_field_id: Unset | str = UNSET, +) -> FormFieldPlacementConditionList | None: """List Form Set Conditions List form_field_placement_conditions @@ -148,10 +148,10 @@ async def asyncio_detailed( form_field_placement_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterform_field_id: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterform_field_id: Unset | str = UNSET, ) -> Response[FormFieldPlacementConditionList]: """List Form Set Conditions @@ -189,11 +189,11 @@ async def asyncio( form_field_placement_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterform_field_id: Union[Unset, str] = UNSET, -) -> Optional[FormFieldPlacementConditionList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterform_field_id: Unset | str = UNSET, +) -> FormFieldPlacementConditionList | None: """List Form Set Conditions List form_field_placement_conditions diff --git a/rootly_sdk/api/form_field_placement_conditions/update_form_field_placement_condition.py b/rootly_sdk/api/form_field_placement_conditions/update_form_field_placement_condition.py index 25352fce..66a45fc6 100644 --- a/rootly_sdk/api/form_field_placement_conditions/update_form_field_placement_condition.py +++ b/rootly_sdk/api/form_field_placement_conditions/update_form_field_placement_condition.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, FormFieldPlacementConditionResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | FormFieldPlacementConditionResponse | None: if response.status_code == 200: response_200 = FormFieldPlacementConditionResponse.from_dict(response.json()) @@ -51,8 +51,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, FormFieldPlacementConditionResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | FormFieldPlacementConditionResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateFormFieldPlacementCondition, -) -> Response[Union[ErrorsList, FormFieldPlacementConditionResponse]]: +) -> Response[ErrorsList | FormFieldPlacementConditionResponse]: """Update a Form Set Condition Update a specific form_field_placement_condition by id @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateFormFieldPlacementCondition, -) -> Optional[Union[ErrorsList, FormFieldPlacementConditionResponse]]: +) -> ErrorsList | FormFieldPlacementConditionResponse | None: """Update a Form Set Condition Update a specific form_field_placement_condition by id @@ -129,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateFormFieldPlacementCondition, -) -> Response[Union[ErrorsList, FormFieldPlacementConditionResponse]]: +) -> Response[ErrorsList | FormFieldPlacementConditionResponse]: """Update a Form Set Condition Update a specific form_field_placement_condition by id @@ -161,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateFormFieldPlacementCondition, -) -> Optional[Union[ErrorsList, FormFieldPlacementConditionResponse]]: +) -> ErrorsList | FormFieldPlacementConditionResponse | None: """Update a Form Set Condition Update a specific form_field_placement_condition by id diff --git a/rootly_sdk/api/form_field_placements/create_form_field_placement.py b/rootly_sdk/api/form_field_placements/create_form_field_placement.py index 35bfce1b..6e198d96 100644 --- a/rootly_sdk/api/form_field_placements/create_form_field_placement.py +++ b/rootly_sdk/api/form_field_placements/create_form_field_placement.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, FormFieldPlacementResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | FormFieldPlacementResponse | None: if response.status_code == 201: response_201 = FormFieldPlacementResponse.from_dict(response.json()) @@ -56,8 +56,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, FormFieldPlacementResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | FormFieldPlacementResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -71,7 +71,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewFormFieldPlacement, -) -> Response[Union[ErrorsList, FormFieldPlacementResponse]]: +) -> Response[ErrorsList | FormFieldPlacementResponse]: """Creates a Form Field Placement Creates a new form_field_placement from provided data @@ -105,7 +105,7 @@ def sync( *, client: AuthenticatedClient, body: NewFormFieldPlacement, -) -> Optional[Union[ErrorsList, FormFieldPlacementResponse]]: +) -> ErrorsList | FormFieldPlacementResponse | None: """Creates a Form Field Placement Creates a new form_field_placement from provided data @@ -134,7 +134,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewFormFieldPlacement, -) -> Response[Union[ErrorsList, FormFieldPlacementResponse]]: +) -> Response[ErrorsList | FormFieldPlacementResponse]: """Creates a Form Field Placement Creates a new form_field_placement from provided data @@ -166,7 +166,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewFormFieldPlacement, -) -> Optional[Union[ErrorsList, FormFieldPlacementResponse]]: +) -> ErrorsList | FormFieldPlacementResponse | None: """Creates a Form Field Placement Creates a new form_field_placement from provided data diff --git a/rootly_sdk/api/form_field_placements/delete_form_field_placement.py b/rootly_sdk/api/form_field_placements/delete_form_field_placement.py index 1cae6093..424e34e1 100644 --- a/rootly_sdk/api/form_field_placements/delete_form_field_placement.py +++ b/rootly_sdk/api/form_field_placements/delete_form_field_placement.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, FormFieldPlacementResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | FormFieldPlacementResponse | None: if response.status_code == 200: response_200 = FormFieldPlacementResponse.from_dict(response.json()) @@ -41,8 +41,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, FormFieldPlacementResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | FormFieldPlacementResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -55,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, FormFieldPlacementResponse]]: +) -> Response[ErrorsList | FormFieldPlacementResponse]: """Delete a Form Field Placement Delete a specific form_field_placement by id @@ -86,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, FormFieldPlacementResponse]]: +) -> ErrorsList | FormFieldPlacementResponse | None: """Delete a Form Field Placement Delete a specific form_field_placement by id @@ -112,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, FormFieldPlacementResponse]]: +) -> Response[ErrorsList | FormFieldPlacementResponse]: """Delete a Form Field Placement Delete a specific form_field_placement by id @@ -141,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, FormFieldPlacementResponse]]: +) -> ErrorsList | FormFieldPlacementResponse | None: """Delete a Form Field Placement Delete a specific form_field_placement by id diff --git a/rootly_sdk/api/form_field_placements/get_form_field_placement.py b/rootly_sdk/api/form_field_placements/get_form_field_placement.py index 83cfc9e1..18e171f2 100644 --- a/rootly_sdk/api/form_field_placements/get_form_field_placement.py +++ b/rootly_sdk/api/form_field_placements/get_form_field_placement.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, FormFieldPlacementResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | FormFieldPlacementResponse | None: if response.status_code == 200: response_200 = FormFieldPlacementResponse.from_dict(response.json()) @@ -41,8 +41,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, FormFieldPlacementResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | FormFieldPlacementResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -55,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, FormFieldPlacementResponse]]: +) -> Response[ErrorsList | FormFieldPlacementResponse]: """Retrieves a Form Field Placement Retrieves a specific form_field_placement by id @@ -86,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, FormFieldPlacementResponse]]: +) -> ErrorsList | FormFieldPlacementResponse | None: """Retrieves a Form Field Placement Retrieves a specific form_field_placement by id @@ -112,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, FormFieldPlacementResponse]]: +) -> Response[ErrorsList | FormFieldPlacementResponse]: """Retrieves a Form Field Placement Retrieves a specific form_field_placement by id @@ -141,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, FormFieldPlacementResponse]]: +) -> ErrorsList | FormFieldPlacementResponse | None: """Retrieves a Form Field Placement Retrieves a specific form_field_placement by id diff --git a/rootly_sdk/api/form_field_placements/list_form_field_placements.py b/rootly_sdk/api/form_field_placements/list_form_field_placements.py index 09872d3b..11bb34cc 100644 --- a/rootly_sdk/api/form_field_placements/list_form_field_placements.py +++ b/rootly_sdk/api/form_field_placements/list_form_field_placements.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -12,10 +12,10 @@ def _get_kwargs( form_field_id: str, *, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterform_field_id: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterform_field_id: Unset | str = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -38,9 +38,7 @@ def _get_kwargs( return _kwargs -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[FormFieldPlacementList]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> FormFieldPlacementList | None: if response.status_code == 200: response_200 = FormFieldPlacementList.from_dict(response.json()) @@ -53,7 +51,7 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response + *, client: AuthenticatedClient | Client, response: httpx.Response ) -> Response[FormFieldPlacementList]: return Response( status_code=HTTPStatus(response.status_code), @@ -67,10 +65,10 @@ def sync_detailed( form_field_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterform_field_id: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterform_field_id: Unset | str = UNSET, ) -> Response[FormFieldPlacementList]: """List Form Field Placements @@ -110,11 +108,11 @@ def sync( form_field_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterform_field_id: Union[Unset, str] = UNSET, -) -> Optional[FormFieldPlacementList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterform_field_id: Unset | str = UNSET, +) -> FormFieldPlacementList | None: """List Form Field Placements List form_field_placements @@ -148,10 +146,10 @@ async def asyncio_detailed( form_field_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterform_field_id: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterform_field_id: Unset | str = UNSET, ) -> Response[FormFieldPlacementList]: """List Form Field Placements @@ -189,11 +187,11 @@ async def asyncio( form_field_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterform_field_id: Union[Unset, str] = UNSET, -) -> Optional[FormFieldPlacementList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterform_field_id: Unset | str = UNSET, +) -> FormFieldPlacementList | None: """List Form Field Placements List form_field_placements diff --git a/rootly_sdk/api/form_field_placements/update_form_field_placement.py b/rootly_sdk/api/form_field_placements/update_form_field_placement.py index 1a82b14b..87ff299a 100644 --- a/rootly_sdk/api/form_field_placements/update_form_field_placement.py +++ b/rootly_sdk/api/form_field_placements/update_form_field_placement.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, FormFieldPlacementResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | FormFieldPlacementResponse | None: if response.status_code == 200: response_200 = FormFieldPlacementResponse.from_dict(response.json()) @@ -56,8 +56,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, FormFieldPlacementResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | FormFieldPlacementResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -71,7 +71,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateFormFieldPlacement, -) -> Response[Union[ErrorsList, FormFieldPlacementResponse]]: +) -> Response[ErrorsList | FormFieldPlacementResponse]: """Update a Form Field Placement Update a specific form_field_placement by id @@ -105,7 +105,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateFormFieldPlacement, -) -> Optional[Union[ErrorsList, FormFieldPlacementResponse]]: +) -> ErrorsList | FormFieldPlacementResponse | None: """Update a Form Field Placement Update a specific form_field_placement by id @@ -134,7 +134,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateFormFieldPlacement, -) -> Response[Union[ErrorsList, FormFieldPlacementResponse]]: +) -> Response[ErrorsList | FormFieldPlacementResponse]: """Update a Form Field Placement Update a specific form_field_placement by id @@ -166,7 +166,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateFormFieldPlacement, -) -> Optional[Union[ErrorsList, FormFieldPlacementResponse]]: +) -> ErrorsList | FormFieldPlacementResponse | None: """Update a Form Field Placement Update a specific form_field_placement by id diff --git a/rootly_sdk/api/form_field_positions/create_form_field_position.py b/rootly_sdk/api/form_field_positions/create_form_field_position.py index 78bc3b12..b4a5ccb1 100644 --- a/rootly_sdk/api/form_field_positions/create_form_field_position.py +++ b/rootly_sdk/api/form_field_positions/create_form_field_position.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, FormFieldPositionResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | FormFieldPositionResponse | None: if response.status_code == 201: response_201 = FormFieldPositionResponse.from_dict(response.json()) @@ -56,8 +56,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, FormFieldPositionResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | FormFieldPositionResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -71,7 +71,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewFormFieldPosition, -) -> Response[Union[ErrorsList, FormFieldPositionResponse]]: +) -> Response[ErrorsList | FormFieldPositionResponse]: """Creates FormField Positions Creates a new form field_position from provided data @@ -105,7 +105,7 @@ def sync( *, client: AuthenticatedClient, body: NewFormFieldPosition, -) -> Optional[Union[ErrorsList, FormFieldPositionResponse]]: +) -> ErrorsList | FormFieldPositionResponse | None: """Creates FormField Positions Creates a new form field_position from provided data @@ -134,7 +134,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewFormFieldPosition, -) -> Response[Union[ErrorsList, FormFieldPositionResponse]]: +) -> Response[ErrorsList | FormFieldPositionResponse]: """Creates FormField Positions Creates a new form field_position from provided data @@ -166,7 +166,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewFormFieldPosition, -) -> Optional[Union[ErrorsList, FormFieldPositionResponse]]: +) -> ErrorsList | FormFieldPositionResponse | None: """Creates FormField Positions Creates a new form field_position from provided data diff --git a/rootly_sdk/api/form_field_positions/delete_form_field_position.py b/rootly_sdk/api/form_field_positions/delete_form_field_position.py index 1466a269..c4649baf 100644 --- a/rootly_sdk/api/form_field_positions/delete_form_field_position.py +++ b/rootly_sdk/api/form_field_positions/delete_form_field_position.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, FormFieldPositionResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | FormFieldPositionResponse | None: if response.status_code == 200: response_200 = FormFieldPositionResponse.from_dict(response.json()) @@ -41,8 +41,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, FormFieldPositionResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | FormFieldPositionResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -55,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, FormFieldPositionResponse]]: +) -> Response[ErrorsList | FormFieldPositionResponse]: """Delete a FormFieldPosition Delete a specific form_field position by id @@ -86,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, FormFieldPositionResponse]]: +) -> ErrorsList | FormFieldPositionResponse | None: """Delete a FormFieldPosition Delete a specific form_field position by id @@ -112,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, FormFieldPositionResponse]]: +) -> Response[ErrorsList | FormFieldPositionResponse]: """Delete a FormFieldPosition Delete a specific form_field position by id @@ -141,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, FormFieldPositionResponse]]: +) -> ErrorsList | FormFieldPositionResponse | None: """Delete a FormFieldPosition Delete a specific form_field position by id diff --git a/rootly_sdk/api/form_field_positions/get_form_field_position.py b/rootly_sdk/api/form_field_positions/get_form_field_position.py index 4d75ebe2..c99f14ad 100644 --- a/rootly_sdk/api/form_field_positions/get_form_field_position.py +++ b/rootly_sdk/api/form_field_positions/get_form_field_position.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, FormFieldPositionResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | FormFieldPositionResponse | None: if response.status_code == 200: response_200 = FormFieldPositionResponse.from_dict(response.json()) @@ -41,8 +41,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, FormFieldPositionResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | FormFieldPositionResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -55,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, FormFieldPositionResponse]]: +) -> Response[ErrorsList | FormFieldPositionResponse]: """Retrieves a FormFieldPosition Retrieves a specific form field_position by id @@ -86,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, FormFieldPositionResponse]]: +) -> ErrorsList | FormFieldPositionResponse | None: """Retrieves a FormFieldPosition Retrieves a specific form field_position by id @@ -112,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, FormFieldPositionResponse]]: +) -> Response[ErrorsList | FormFieldPositionResponse]: """Retrieves a FormFieldPosition Retrieves a specific form field_position by id @@ -141,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, FormFieldPositionResponse]]: +) -> ErrorsList | FormFieldPositionResponse | None: """Retrieves a FormFieldPosition Retrieves a specific form field_position by id diff --git a/rootly_sdk/api/form_field_positions/list_form_field_positions.py b/rootly_sdk/api/form_field_positions/list_form_field_positions.py index 38d25f2a..d29efabe 100644 --- a/rootly_sdk/api/form_field_positions/list_form_field_positions.py +++ b/rootly_sdk/api/form_field_positions/list_form_field_positions.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -12,10 +12,10 @@ def _get_kwargs( form_field_id: str, *, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterform: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterform: Unset | str = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -38,9 +38,7 @@ def _get_kwargs( return _kwargs -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[FormFieldPositionList]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> FormFieldPositionList | None: if response.status_code == 200: response_200 = FormFieldPositionList.from_dict(response.json()) @@ -53,7 +51,7 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response + *, client: AuthenticatedClient | Client, response: httpx.Response ) -> Response[FormFieldPositionList]: return Response( status_code=HTTPStatus(response.status_code), @@ -67,10 +65,10 @@ def sync_detailed( form_field_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterform: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterform: Unset | str = UNSET, ) -> Response[FormFieldPositionList]: """List FormField Position @@ -110,11 +108,11 @@ def sync( form_field_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterform: Union[Unset, str] = UNSET, -) -> Optional[FormFieldPositionList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterform: Unset | str = UNSET, +) -> FormFieldPositionList | None: """List FormField Position List form field positions @@ -148,10 +146,10 @@ async def asyncio_detailed( form_field_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterform: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterform: Unset | str = UNSET, ) -> Response[FormFieldPositionList]: """List FormField Position @@ -189,11 +187,11 @@ async def asyncio( form_field_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterform: Union[Unset, str] = UNSET, -) -> Optional[FormFieldPositionList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterform: Unset | str = UNSET, +) -> FormFieldPositionList | None: """List FormField Position List form field positions diff --git a/rootly_sdk/api/form_field_positions/update_form_field_position.py b/rootly_sdk/api/form_field_positions/update_form_field_position.py index 8783d7ed..8a906621 100644 --- a/rootly_sdk/api/form_field_positions/update_form_field_position.py +++ b/rootly_sdk/api/form_field_positions/update_form_field_position.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, FormFieldPositionResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | FormFieldPositionResponse | None: if response.status_code == 200: response_200 = FormFieldPositionResponse.from_dict(response.json()) @@ -56,8 +56,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, FormFieldPositionResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | FormFieldPositionResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -71,7 +71,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateFormFieldPosition, -) -> Response[Union[ErrorsList, FormFieldPositionResponse]]: +) -> Response[ErrorsList | FormFieldPositionResponse]: """Update a FormFieldPosition Update a specific form_field position by id @@ -105,7 +105,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateFormFieldPosition, -) -> Optional[Union[ErrorsList, FormFieldPositionResponse]]: +) -> ErrorsList | FormFieldPositionResponse | None: """Update a FormFieldPosition Update a specific form_field position by id @@ -134,7 +134,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateFormFieldPosition, -) -> Response[Union[ErrorsList, FormFieldPositionResponse]]: +) -> Response[ErrorsList | FormFieldPositionResponse]: """Update a FormFieldPosition Update a specific form_field position by id @@ -166,7 +166,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateFormFieldPosition, -) -> Optional[Union[ErrorsList, FormFieldPositionResponse]]: +) -> ErrorsList | FormFieldPositionResponse | None: """Update a FormFieldPosition Update a specific form_field position by id diff --git a/rootly_sdk/api/form_fields/create_form_field.py b/rootly_sdk/api/form_fields/create_form_field.py index 045e4010..22ff4b11 100644 --- a/rootly_sdk/api/form_fields/create_form_field.py +++ b/rootly_sdk/api/form_fields/create_form_field.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, FormFieldResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | FormFieldResponse | None: if response.status_code == 201: response_201 = FormFieldResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, FormFieldResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | FormFieldResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +69,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewFormField, -) -> Response[Union[ErrorsList, FormFieldResponse]]: +) -> Response[ErrorsList | FormFieldResponse]: """Creates a Form Field Creates a new form_field from provided data @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: NewFormField, -) -> Optional[Union[ErrorsList, FormFieldResponse]]: +) -> ErrorsList | FormFieldResponse | None: """Creates a Form Field Creates a new form_field from provided data @@ -126,7 +126,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewFormField, -) -> Response[Union[ErrorsList, FormFieldResponse]]: +) -> Response[ErrorsList | FormFieldResponse]: """Creates a Form Field Creates a new form_field from provided data @@ -155,7 +155,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewFormField, -) -> Optional[Union[ErrorsList, FormFieldResponse]]: +) -> ErrorsList | FormFieldResponse | None: """Creates a Form Field Creates a new form_field from provided data diff --git a/rootly_sdk/api/form_fields/delete_form_field.py b/rootly_sdk/api/form_fields/delete_form_field.py index 4d123ad4..7fd167da 100644 --- a/rootly_sdk/api/form_fields/delete_form_field.py +++ b/rootly_sdk/api/form_fields/delete_form_field.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any from uuid import UUID import httpx @@ -12,7 +12,7 @@ def _get_kwargs( - id: Union[UUID, str], + id: UUID | str, ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "delete", @@ -23,8 +23,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, FormFieldResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | FormFieldResponse | None: if response.status_code == 200: response_200 = FormFieldResponse.from_dict(response.json()) @@ -42,8 +42,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, FormFieldResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | FormFieldResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -53,10 +53,10 @@ def _build_response( def sync_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, FormFieldResponse]]: +) -> Response[ErrorsList | FormFieldResponse]: """Delete a Form Field Delete a specific form_field by id @@ -84,10 +84,10 @@ def sync_detailed( def sync( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, FormFieldResponse]]: +) -> ErrorsList | FormFieldResponse | None: """Delete a Form Field Delete a specific form_field by id @@ -110,10 +110,10 @@ def sync( async def asyncio_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, FormFieldResponse]]: +) -> Response[ErrorsList | FormFieldResponse]: """Delete a Form Field Delete a specific form_field by id @@ -139,10 +139,10 @@ async def asyncio_detailed( async def asyncio( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, FormFieldResponse]]: +) -> ErrorsList | FormFieldResponse | None: """Delete a Form Field Delete a specific form_field by id diff --git a/rootly_sdk/api/form_fields/get_form_field.py b/rootly_sdk/api/form_fields/get_form_field.py index 0e6e3aa0..f491ac34 100644 --- a/rootly_sdk/api/form_fields/get_form_field.py +++ b/rootly_sdk/api/form_fields/get_form_field.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any from uuid import UUID import httpx @@ -13,13 +13,13 @@ def _get_kwargs( - id: Union[UUID, str], + id: UUID | str, *, - include: Union[Unset, GetFormFieldInclude] = UNSET, + include: Unset | GetFormFieldInclude = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} - json_include: Union[Unset, str] = UNSET + json_include: Unset | str = UNSET if not isinstance(include, Unset): json_include = include @@ -37,8 +37,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, FormFieldResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | FormFieldResponse | None: if response.status_code == 200: response_200 = FormFieldResponse.from_dict(response.json()) @@ -56,8 +56,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, FormFieldResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | FormFieldResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -67,11 +67,11 @@ def _build_response( def sync_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, - include: Union[Unset, GetFormFieldInclude] = UNSET, -) -> Response[Union[ErrorsList, FormFieldResponse]]: + include: Unset | GetFormFieldInclude = UNSET, +) -> Response[ErrorsList | FormFieldResponse]: """Retrieves a Form Field Retrieves a specific form_field by id @@ -101,11 +101,11 @@ def sync_detailed( def sync( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, - include: Union[Unset, GetFormFieldInclude] = UNSET, -) -> Optional[Union[ErrorsList, FormFieldResponse]]: + include: Unset | GetFormFieldInclude = UNSET, +) -> ErrorsList | FormFieldResponse | None: """Retrieves a Form Field Retrieves a specific form_field by id @@ -130,11 +130,11 @@ def sync( async def asyncio_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, - include: Union[Unset, GetFormFieldInclude] = UNSET, -) -> Response[Union[ErrorsList, FormFieldResponse]]: + include: Unset | GetFormFieldInclude = UNSET, +) -> Response[ErrorsList | FormFieldResponse]: """Retrieves a Form Field Retrieves a specific form_field by id @@ -162,11 +162,11 @@ async def asyncio_detailed( async def asyncio( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, - include: Union[Unset, GetFormFieldInclude] = UNSET, -) -> Optional[Union[ErrorsList, FormFieldResponse]]: + include: Unset | GetFormFieldInclude = UNSET, +) -> ErrorsList | FormFieldResponse | None: """Retrieves a Form Field Retrieves a specific form_field by id diff --git a/rootly_sdk/api/form_fields/list_form_fields.py b/rootly_sdk/api/form_fields/list_form_fields.py index e400b81a..f41e79aa 100644 --- a/rootly_sdk/api/form_fields/list_form_fields.py +++ b/rootly_sdk/api/form_fields/list_form_fields.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -12,38 +12,38 @@ def _get_kwargs( *, - include: Union[Unset, ListFormFieldsInclude] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterkind: Union[Unset, str] = UNSET, - filterenabled: Union[Unset, bool] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filterslugeq: Union[Unset, str] = UNSET, - filterslugnot_eq: Union[Unset, str] = UNSET, - filterslugin: Union[Unset, str] = UNSET, - filterslugnot_in: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, - filterkindeq: Union[Unset, str] = UNSET, - filterkindnot_eq: Union[Unset, str] = UNSET, - filterkindin: Union[Unset, str] = UNSET, - filterkindnot_in: Union[Unset, str] = UNSET, - filterenabledeq: Union[Unset, str] = UNSET, - filterenablednot_eq: Union[Unset, str] = UNSET, - filterenabledin: Union[Unset, str] = UNSET, - filterenablednot_in: Union[Unset, str] = UNSET, + include: Unset | ListFormFieldsInclude = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filterenabled: Unset | bool = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filterkindeq: Unset | str = UNSET, + filterkindnot_eq: Unset | str = UNSET, + filterkindin: Unset | str = UNSET, + filterkindnot_in: Unset | str = UNSET, + filterenabledeq: Unset | str = UNSET, + filterenablednot_eq: Unset | str = UNSET, + filterenabledin: Unset | str = UNSET, + filterenablednot_in: Unset | str = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} - json_include: Union[Unset, str] = UNSET + json_include: Unset | str = UNSET if not isinstance(include, Unset): json_include = include @@ -114,7 +114,7 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[FormFieldList]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> FormFieldList | None: if response.status_code == 200: response_200 = FormFieldList.from_dict(response.json()) @@ -126,7 +126,7 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[FormFieldList]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[FormFieldList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -138,34 +138,34 @@ def _build_response(*, client: Union[AuthenticatedClient, Client], response: htt def sync_detailed( *, client: AuthenticatedClient, - include: Union[Unset, ListFormFieldsInclude] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterkind: Union[Unset, str] = UNSET, - filterenabled: Union[Unset, bool] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filterslugeq: Union[Unset, str] = UNSET, - filterslugnot_eq: Union[Unset, str] = UNSET, - filterslugin: Union[Unset, str] = UNSET, - filterslugnot_in: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, - filterkindeq: Union[Unset, str] = UNSET, - filterkindnot_eq: Union[Unset, str] = UNSET, - filterkindin: Union[Unset, str] = UNSET, - filterkindnot_in: Union[Unset, str] = UNSET, - filterenabledeq: Union[Unset, str] = UNSET, - filterenablednot_eq: Union[Unset, str] = UNSET, - filterenabledin: Union[Unset, str] = UNSET, - filterenablednot_in: Union[Unset, str] = UNSET, + include: Unset | ListFormFieldsInclude = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filterenabled: Unset | bool = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filterkindeq: Unset | str = UNSET, + filterkindnot_eq: Unset | str = UNSET, + filterkindin: Unset | str = UNSET, + filterkindnot_in: Unset | str = UNSET, + filterenabledeq: Unset | str = UNSET, + filterenablednot_eq: Unset | str = UNSET, + filterenabledin: Unset | str = UNSET, + filterenablednot_in: Unset | str = UNSET, ) -> Response[FormFieldList]: """List Form Fields @@ -250,35 +250,35 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: Union[Unset, ListFormFieldsInclude] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterkind: Union[Unset, str] = UNSET, - filterenabled: Union[Unset, bool] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filterslugeq: Union[Unset, str] = UNSET, - filterslugnot_eq: Union[Unset, str] = UNSET, - filterslugin: Union[Unset, str] = UNSET, - filterslugnot_in: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, - filterkindeq: Union[Unset, str] = UNSET, - filterkindnot_eq: Union[Unset, str] = UNSET, - filterkindin: Union[Unset, str] = UNSET, - filterkindnot_in: Union[Unset, str] = UNSET, - filterenabledeq: Union[Unset, str] = UNSET, - filterenablednot_eq: Union[Unset, str] = UNSET, - filterenabledin: Union[Unset, str] = UNSET, - filterenablednot_in: Union[Unset, str] = UNSET, -) -> Optional[FormFieldList]: + include: Unset | ListFormFieldsInclude = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filterenabled: Unset | bool = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filterkindeq: Unset | str = UNSET, + filterkindnot_eq: Unset | str = UNSET, + filterkindin: Unset | str = UNSET, + filterkindnot_in: Unset | str = UNSET, + filterenabledeq: Unset | str = UNSET, + filterenablednot_eq: Unset | str = UNSET, + filterenabledin: Unset | str = UNSET, + filterenablednot_in: Unset | str = UNSET, +) -> FormFieldList | None: """List Form Fields List form_fields @@ -357,34 +357,34 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: Union[Unset, ListFormFieldsInclude] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterkind: Union[Unset, str] = UNSET, - filterenabled: Union[Unset, bool] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filterslugeq: Union[Unset, str] = UNSET, - filterslugnot_eq: Union[Unset, str] = UNSET, - filterslugin: Union[Unset, str] = UNSET, - filterslugnot_in: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, - filterkindeq: Union[Unset, str] = UNSET, - filterkindnot_eq: Union[Unset, str] = UNSET, - filterkindin: Union[Unset, str] = UNSET, - filterkindnot_in: Union[Unset, str] = UNSET, - filterenabledeq: Union[Unset, str] = UNSET, - filterenablednot_eq: Union[Unset, str] = UNSET, - filterenabledin: Union[Unset, str] = UNSET, - filterenablednot_in: Union[Unset, str] = UNSET, + include: Unset | ListFormFieldsInclude = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filterenabled: Unset | bool = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filterkindeq: Unset | str = UNSET, + filterkindnot_eq: Unset | str = UNSET, + filterkindin: Unset | str = UNSET, + filterkindnot_in: Unset | str = UNSET, + filterenabledeq: Unset | str = UNSET, + filterenablednot_eq: Unset | str = UNSET, + filterenabledin: Unset | str = UNSET, + filterenablednot_in: Unset | str = UNSET, ) -> Response[FormFieldList]: """List Form Fields @@ -467,35 +467,35 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: Union[Unset, ListFormFieldsInclude] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterkind: Union[Unset, str] = UNSET, - filterenabled: Union[Unset, bool] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filterslugeq: Union[Unset, str] = UNSET, - filterslugnot_eq: Union[Unset, str] = UNSET, - filterslugin: Union[Unset, str] = UNSET, - filterslugnot_in: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, - filterkindeq: Union[Unset, str] = UNSET, - filterkindnot_eq: Union[Unset, str] = UNSET, - filterkindin: Union[Unset, str] = UNSET, - filterkindnot_in: Union[Unset, str] = UNSET, - filterenabledeq: Union[Unset, str] = UNSET, - filterenablednot_eq: Union[Unset, str] = UNSET, - filterenabledin: Union[Unset, str] = UNSET, - filterenablednot_in: Union[Unset, str] = UNSET, -) -> Optional[FormFieldList]: + include: Unset | ListFormFieldsInclude = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filterenabled: Unset | bool = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filterkindeq: Unset | str = UNSET, + filterkindnot_eq: Unset | str = UNSET, + filterkindin: Unset | str = UNSET, + filterkindnot_in: Unset | str = UNSET, + filterenabledeq: Unset | str = UNSET, + filterenablednot_eq: Unset | str = UNSET, + filterenabledin: Unset | str = UNSET, + filterenablednot_in: Unset | str = UNSET, +) -> FormFieldList | None: """List Form Fields List form_fields diff --git a/rootly_sdk/api/form_fields/update_form_field.py b/rootly_sdk/api/form_fields/update_form_field.py index f0f70838..ea2f4249 100644 --- a/rootly_sdk/api/form_fields/update_form_field.py +++ b/rootly_sdk/api/form_fields/update_form_field.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any from uuid import UUID import httpx @@ -13,7 +13,7 @@ def _get_kwargs( - id: Union[UUID, str], + id: UUID | str, *, body: UpdateFormField, ) -> dict[str, Any]: @@ -33,8 +33,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, FormFieldResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | FormFieldResponse | None: if response.status_code == 200: response_200 = FormFieldResponse.from_dict(response.json()) @@ -52,8 +52,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, FormFieldResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | FormFieldResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -63,11 +63,11 @@ def _build_response( def sync_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdateFormField, -) -> Response[Union[ErrorsList, FormFieldResponse]]: +) -> Response[ErrorsList | FormFieldResponse]: """Update a Form Field Update a specific form_field by id @@ -97,11 +97,11 @@ def sync_detailed( def sync( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdateFormField, -) -> Optional[Union[ErrorsList, FormFieldResponse]]: +) -> ErrorsList | FormFieldResponse | None: """Update a Form Field Update a specific form_field by id @@ -126,11 +126,11 @@ def sync( async def asyncio_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdateFormField, -) -> Response[Union[ErrorsList, FormFieldResponse]]: +) -> Response[ErrorsList | FormFieldResponse]: """Update a Form Field Update a specific form_field by id @@ -158,11 +158,11 @@ async def asyncio_detailed( async def asyncio( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdateFormField, -) -> Optional[Union[ErrorsList, FormFieldResponse]]: +) -> ErrorsList | FormFieldResponse | None: """Update a Form Field Update a specific form_field by id diff --git a/rootly_sdk/api/form_set_conditions/create_form_set_condition.py b/rootly_sdk/api/form_set_conditions/create_form_set_condition.py index f7038be8..6a3f278c 100644 --- a/rootly_sdk/api/form_set_conditions/create_form_set_condition.py +++ b/rootly_sdk/api/form_set_conditions/create_form_set_condition.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, FormSetConditionResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | FormSetConditionResponse | None: if response.status_code == 201: response_201 = FormSetConditionResponse.from_dict(response.json()) @@ -56,8 +56,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, FormSetConditionResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | FormSetConditionResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -71,7 +71,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewFormSetCondition, -) -> Response[Union[ErrorsList, FormSetConditionResponse]]: +) -> Response[ErrorsList | FormSetConditionResponse]: """Creates a Form Set Condition Creates a new form_set_condition from provided data @@ -105,7 +105,7 @@ def sync( *, client: AuthenticatedClient, body: NewFormSetCondition, -) -> Optional[Union[ErrorsList, FormSetConditionResponse]]: +) -> ErrorsList | FormSetConditionResponse | None: """Creates a Form Set Condition Creates a new form_set_condition from provided data @@ -134,7 +134,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewFormSetCondition, -) -> Response[Union[ErrorsList, FormSetConditionResponse]]: +) -> Response[ErrorsList | FormSetConditionResponse]: """Creates a Form Set Condition Creates a new form_set_condition from provided data @@ -166,7 +166,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewFormSetCondition, -) -> Optional[Union[ErrorsList, FormSetConditionResponse]]: +) -> ErrorsList | FormSetConditionResponse | None: """Creates a Form Set Condition Creates a new form_set_condition from provided data diff --git a/rootly_sdk/api/form_set_conditions/delete_form_set_condition.py b/rootly_sdk/api/form_set_conditions/delete_form_set_condition.py index 06b7f5d4..9fe830e3 100644 --- a/rootly_sdk/api/form_set_conditions/delete_form_set_condition.py +++ b/rootly_sdk/api/form_set_conditions/delete_form_set_condition.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, FormSetConditionResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | FormSetConditionResponse | None: if response.status_code == 200: response_200 = FormSetConditionResponse.from_dict(response.json()) @@ -41,8 +41,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, FormSetConditionResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | FormSetConditionResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -55,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, FormSetConditionResponse]]: +) -> Response[ErrorsList | FormSetConditionResponse]: """Delete a Form Set Condition Delete a specific form_set_condition by id @@ -86,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, FormSetConditionResponse]]: +) -> ErrorsList | FormSetConditionResponse | None: """Delete a Form Set Condition Delete a specific form_set_condition by id @@ -112,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, FormSetConditionResponse]]: +) -> Response[ErrorsList | FormSetConditionResponse]: """Delete a Form Set Condition Delete a specific form_set_condition by id @@ -141,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, FormSetConditionResponse]]: +) -> ErrorsList | FormSetConditionResponse | None: """Delete a Form Set Condition Delete a specific form_set_condition by id diff --git a/rootly_sdk/api/form_set_conditions/get_form_set_condition.py b/rootly_sdk/api/form_set_conditions/get_form_set_condition.py index 59a9c023..08b6d6aa 100644 --- a/rootly_sdk/api/form_set_conditions/get_form_set_condition.py +++ b/rootly_sdk/api/form_set_conditions/get_form_set_condition.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, FormSetConditionResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | FormSetConditionResponse | None: if response.status_code == 200: response_200 = FormSetConditionResponse.from_dict(response.json()) @@ -41,8 +41,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, FormSetConditionResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | FormSetConditionResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -55,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, FormSetConditionResponse]]: +) -> Response[ErrorsList | FormSetConditionResponse]: """Retrieves a Form Set Condition Retrieves a specific form_set_condition by id @@ -86,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, FormSetConditionResponse]]: +) -> ErrorsList | FormSetConditionResponse | None: """Retrieves a Form Set Condition Retrieves a specific form_set_condition by id @@ -112,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, FormSetConditionResponse]]: +) -> Response[ErrorsList | FormSetConditionResponse]: """Retrieves a Form Set Condition Retrieves a specific form_set_condition by id @@ -141,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, FormSetConditionResponse]]: +) -> ErrorsList | FormSetConditionResponse | None: """Retrieves a Form Set Condition Retrieves a specific form_set_condition by id diff --git a/rootly_sdk/api/form_set_conditions/list_form_set_conditions.py b/rootly_sdk/api/form_set_conditions/list_form_set_conditions.py index c37fa74d..8d9548f1 100644 --- a/rootly_sdk/api/form_set_conditions/list_form_set_conditions.py +++ b/rootly_sdk/api/form_set_conditions/list_form_set_conditions.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -12,10 +12,10 @@ def _get_kwargs( form_set_id: str, *, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterform_field_id: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterform_field_id: Unset | str = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -38,9 +38,7 @@ def _get_kwargs( return _kwargs -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[FormSetConditionList]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> FormSetConditionList | None: if response.status_code == 200: response_200 = FormSetConditionList.from_dict(response.json()) @@ -53,7 +51,7 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response + *, client: AuthenticatedClient | Client, response: httpx.Response ) -> Response[FormSetConditionList]: return Response( status_code=HTTPStatus(response.status_code), @@ -67,10 +65,10 @@ def sync_detailed( form_set_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterform_field_id: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterform_field_id: Unset | str = UNSET, ) -> Response[FormSetConditionList]: """List Form Set Conditions @@ -110,11 +108,11 @@ def sync( form_set_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterform_field_id: Union[Unset, str] = UNSET, -) -> Optional[FormSetConditionList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterform_field_id: Unset | str = UNSET, +) -> FormSetConditionList | None: """List Form Set Conditions List form_set_conditions @@ -148,10 +146,10 @@ async def asyncio_detailed( form_set_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterform_field_id: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterform_field_id: Unset | str = UNSET, ) -> Response[FormSetConditionList]: """List Form Set Conditions @@ -189,11 +187,11 @@ async def asyncio( form_set_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterform_field_id: Union[Unset, str] = UNSET, -) -> Optional[FormSetConditionList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterform_field_id: Unset | str = UNSET, +) -> FormSetConditionList | None: """List Form Set Conditions List form_set_conditions diff --git a/rootly_sdk/api/form_set_conditions/update_form_set_condition.py b/rootly_sdk/api/form_set_conditions/update_form_set_condition.py index 6f25633d..f0a6a415 100644 --- a/rootly_sdk/api/form_set_conditions/update_form_set_condition.py +++ b/rootly_sdk/api/form_set_conditions/update_form_set_condition.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, FormSetConditionResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | FormSetConditionResponse | None: if response.status_code == 200: response_200 = FormSetConditionResponse.from_dict(response.json()) @@ -51,8 +51,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, FormSetConditionResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | FormSetConditionResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateFormSetCondition, -) -> Response[Union[ErrorsList, FormSetConditionResponse]]: +) -> Response[ErrorsList | FormSetConditionResponse]: """Update a Form Set Condition Update a specific form_set_condition by id @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateFormSetCondition, -) -> Optional[Union[ErrorsList, FormSetConditionResponse]]: +) -> ErrorsList | FormSetConditionResponse | None: """Update a Form Set Condition Update a specific form_set_condition by id @@ -129,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateFormSetCondition, -) -> Response[Union[ErrorsList, FormSetConditionResponse]]: +) -> Response[ErrorsList | FormSetConditionResponse]: """Update a Form Set Condition Update a specific form_set_condition by id @@ -161,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateFormSetCondition, -) -> Optional[Union[ErrorsList, FormSetConditionResponse]]: +) -> ErrorsList | FormSetConditionResponse | None: """Update a Form Set Condition Update a specific form_set_condition by id diff --git a/rootly_sdk/api/form_sets/create_form_set.py b/rootly_sdk/api/form_sets/create_form_set.py index 95c8c074..23414b97 100644 --- a/rootly_sdk/api/form_sets/create_form_set.py +++ b/rootly_sdk/api/form_sets/create_form_set.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, FormSetResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | FormSetResponse | None: if response.status_code == 201: response_201 = FormSetResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, FormSetResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | FormSetResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +69,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewFormSet, -) -> Response[Union[ErrorsList, FormSetResponse]]: +) -> Response[ErrorsList | FormSetResponse]: """Creates a Form Set Creates a new form_set from provided data @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: NewFormSet, -) -> Optional[Union[ErrorsList, FormSetResponse]]: +) -> ErrorsList | FormSetResponse | None: """Creates a Form Set Creates a new form_set from provided data @@ -126,7 +126,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewFormSet, -) -> Response[Union[ErrorsList, FormSetResponse]]: +) -> Response[ErrorsList | FormSetResponse]: """Creates a Form Set Creates a new form_set from provided data @@ -155,7 +155,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewFormSet, -) -> Optional[Union[ErrorsList, FormSetResponse]]: +) -> ErrorsList | FormSetResponse | None: """Creates a Form Set Creates a new form_set from provided data diff --git a/rootly_sdk/api/form_sets/delete_form_set.py b/rootly_sdk/api/form_sets/delete_form_set.py index b10ad82a..9fe2a6fc 100644 --- a/rootly_sdk/api/form_sets/delete_form_set.py +++ b/rootly_sdk/api/form_sets/delete_form_set.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any from uuid import UUID import httpx @@ -12,7 +12,7 @@ def _get_kwargs( - id: Union[UUID, str], + id: UUID | str, ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "delete", @@ -23,8 +23,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, FormSetResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | FormSetResponse | None: if response.status_code == 200: response_200 = FormSetResponse.from_dict(response.json()) @@ -42,8 +42,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, FormSetResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | FormSetResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -53,10 +53,10 @@ def _build_response( def sync_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, FormSetResponse]]: +) -> Response[ErrorsList | FormSetResponse]: """Delete a Form Set Delete a specific form_set by id @@ -84,10 +84,10 @@ def sync_detailed( def sync( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, FormSetResponse]]: +) -> ErrorsList | FormSetResponse | None: """Delete a Form Set Delete a specific form_set by id @@ -110,10 +110,10 @@ def sync( async def asyncio_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, FormSetResponse]]: +) -> Response[ErrorsList | FormSetResponse]: """Delete a Form Set Delete a specific form_set by id @@ -139,10 +139,10 @@ async def asyncio_detailed( async def asyncio( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, FormSetResponse]]: +) -> ErrorsList | FormSetResponse | None: """Delete a Form Set Delete a specific form_set by id diff --git a/rootly_sdk/api/form_sets/get_form_set.py b/rootly_sdk/api/form_sets/get_form_set.py index e4f2c1d9..c1f524ab 100644 --- a/rootly_sdk/api/form_sets/get_form_set.py +++ b/rootly_sdk/api/form_sets/get_form_set.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any from uuid import UUID import httpx @@ -12,7 +12,7 @@ def _get_kwargs( - id: Union[UUID, str], + id: UUID | str, ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "get", @@ -23,8 +23,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, FormSetResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | FormSetResponse | None: if response.status_code == 200: response_200 = FormSetResponse.from_dict(response.json()) @@ -42,8 +42,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, FormSetResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | FormSetResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -53,10 +53,10 @@ def _build_response( def sync_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, FormSetResponse]]: +) -> Response[ErrorsList | FormSetResponse]: """Retrieves a Form Set Retrieves a specific form_set by id @@ -84,10 +84,10 @@ def sync_detailed( def sync( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, FormSetResponse]]: +) -> ErrorsList | FormSetResponse | None: """Retrieves a Form Set Retrieves a specific form_set by id @@ -110,10 +110,10 @@ def sync( async def asyncio_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, FormSetResponse]]: +) -> Response[ErrorsList | FormSetResponse]: """Retrieves a Form Set Retrieves a specific form_set by id @@ -139,10 +139,10 @@ async def asyncio_detailed( async def asyncio( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, FormSetResponse]]: +) -> ErrorsList | FormSetResponse | None: """Retrieves a Form Set Retrieves a specific form_set by id diff --git a/rootly_sdk/api/form_sets/list_form_sets.py b/rootly_sdk/api/form_sets/list_form_sets.py index e8de0a26..03441b76 100644 --- a/rootly_sdk/api/form_sets/list_form_sets.py +++ b/rootly_sdk/api/form_sets/list_form_sets.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -11,15 +11,15 @@ def _get_kwargs( *, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filteris_default: Union[Unset, bool] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filteris_default: Unset | bool = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -52,7 +52,7 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[FormSetList]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> FormSetList | None: if response.status_code == 200: response_200 = FormSetList.from_dict(response.json()) @@ -64,7 +64,7 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[FormSetList]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[FormSetList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -76,15 +76,15 @@ def _build_response(*, client: Union[AuthenticatedClient, Client], response: htt def sync_detailed( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filteris_default: Union[Unset, bool] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filteris_default: Unset | bool = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> Response[FormSetList]: """List Form Sets @@ -131,16 +131,16 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filteris_default: Union[Unset, bool] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, -) -> Optional[FormSetList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filteris_default: Unset | bool = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, +) -> FormSetList | None: """List Form Sets List form_sets @@ -181,15 +181,15 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filteris_default: Union[Unset, bool] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filteris_default: Unset | bool = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> Response[FormSetList]: """List Form Sets @@ -234,16 +234,16 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filteris_default: Union[Unset, bool] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, -) -> Optional[FormSetList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filteris_default: Unset | bool = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, +) -> FormSetList | None: """List Form Sets List form_sets diff --git a/rootly_sdk/api/form_sets/update_form_set.py b/rootly_sdk/api/form_sets/update_form_set.py index c45931db..bb60765d 100644 --- a/rootly_sdk/api/form_sets/update_form_set.py +++ b/rootly_sdk/api/form_sets/update_form_set.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any from uuid import UUID import httpx @@ -13,7 +13,7 @@ def _get_kwargs( - id: Union[UUID, str], + id: UUID | str, *, body: UpdateFormSet, ) -> dict[str, Any]: @@ -33,8 +33,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, FormSetResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | FormSetResponse | None: if response.status_code == 200: response_200 = FormSetResponse.from_dict(response.json()) @@ -52,8 +52,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, FormSetResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | FormSetResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -63,11 +63,11 @@ def _build_response( def sync_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdateFormSet, -) -> Response[Union[ErrorsList, FormSetResponse]]: +) -> Response[ErrorsList | FormSetResponse]: """Update a Form Set Update a specific form_set by id @@ -97,11 +97,11 @@ def sync_detailed( def sync( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdateFormSet, -) -> Optional[Union[ErrorsList, FormSetResponse]]: +) -> ErrorsList | FormSetResponse | None: """Update a Form Set Update a specific form_set by id @@ -126,11 +126,11 @@ def sync( async def asyncio_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdateFormSet, -) -> Response[Union[ErrorsList, FormSetResponse]]: +) -> Response[ErrorsList | FormSetResponse]: """Update a Form Set Update a specific form_set by id @@ -158,11 +158,11 @@ async def asyncio_detailed( async def asyncio( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdateFormSet, -) -> Optional[Union[ErrorsList, FormSetResponse]]: +) -> ErrorsList | FormSetResponse | None: """Update a Form Set Update a specific form_set by id diff --git a/rootly_sdk/api/functionalities/bulk_delete_functionalities.py b/rootly_sdk/api/functionalities/bulk_delete_functionalities.py index 9e873495..19ab8b52 100644 --- a/rootly_sdk/api/functionalities/bulk_delete_functionalities.py +++ b/rootly_sdk/api/functionalities/bulk_delete_functionalities.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any, Union import httpx @@ -36,10 +36,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[ - Union[BulkDestroyFunctionalitiesResponse, ErrorsList, Union["BulkDestroyFunctionalitiesResponse", "ErrorsList"]] -]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> BulkDestroyFunctionalitiesResponse | ErrorsList | Union["BulkDestroyFunctionalitiesResponse", "ErrorsList"] | None: if response.status_code == 200: response_200 = BulkDestroyFunctionalitiesResponse.from_dict(response.json()) @@ -78,9 +76,9 @@ def _parse_response_422(data: object) -> Union["BulkDestroyFunctionalitiesRespon def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response + *, client: AuthenticatedClient | Client, response: httpx.Response ) -> Response[ - Union[BulkDestroyFunctionalitiesResponse, ErrorsList, Union["BulkDestroyFunctionalitiesResponse", "ErrorsList"]] + BulkDestroyFunctionalitiesResponse | ErrorsList | Union["BulkDestroyFunctionalitiesResponse", "ErrorsList"] ]: return Response( status_code=HTTPStatus(response.status_code), @@ -95,7 +93,7 @@ def sync_detailed( client: AuthenticatedClient, body: Union["BulkDestroyFunctionalitiesType0", "BulkDestroyFunctionalitiesType1"], ) -> Response[ - Union[BulkDestroyFunctionalitiesResponse, ErrorsList, Union["BulkDestroyFunctionalitiesResponse", "ErrorsList"]] + BulkDestroyFunctionalitiesResponse | ErrorsList | Union["BulkDestroyFunctionalitiesResponse", "ErrorsList"] ]: """Bulk delete Functionalities @@ -130,9 +128,7 @@ def sync( *, client: AuthenticatedClient, body: Union["BulkDestroyFunctionalitiesType0", "BulkDestroyFunctionalitiesType1"], -) -> Optional[ - Union[BulkDestroyFunctionalitiesResponse, ErrorsList, Union["BulkDestroyFunctionalitiesResponse", "ErrorsList"]] -]: +) -> BulkDestroyFunctionalitiesResponse | ErrorsList | Union["BulkDestroyFunctionalitiesResponse", "ErrorsList"] | None: """Bulk delete Functionalities Delete functionalities by external_id list, or prune by managed_by source. Two mutually exclusive @@ -162,7 +158,7 @@ async def asyncio_detailed( client: AuthenticatedClient, body: Union["BulkDestroyFunctionalitiesType0", "BulkDestroyFunctionalitiesType1"], ) -> Response[ - Union[BulkDestroyFunctionalitiesResponse, ErrorsList, Union["BulkDestroyFunctionalitiesResponse", "ErrorsList"]] + BulkDestroyFunctionalitiesResponse | ErrorsList | Union["BulkDestroyFunctionalitiesResponse", "ErrorsList"] ]: """Bulk delete Functionalities @@ -195,9 +191,7 @@ async def asyncio( *, client: AuthenticatedClient, body: Union["BulkDestroyFunctionalitiesType0", "BulkDestroyFunctionalitiesType1"], -) -> Optional[ - Union[BulkDestroyFunctionalitiesResponse, ErrorsList, Union["BulkDestroyFunctionalitiesResponse", "ErrorsList"]] -]: +) -> BulkDestroyFunctionalitiesResponse | ErrorsList | Union["BulkDestroyFunctionalitiesResponse", "ErrorsList"] | None: """Bulk delete Functionalities Delete functionalities by external_id list, or prune by managed_by source. Two mutually exclusive diff --git a/rootly_sdk/api/functionalities/bulk_upsert_functionalities.py b/rootly_sdk/api/functionalities/bulk_upsert_functionalities.py index 5411b075..d194bfb1 100644 --- a/rootly_sdk/api/functionalities/bulk_upsert_functionalities.py +++ b/rootly_sdk/api/functionalities/bulk_upsert_functionalities.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any, Union import httpx @@ -32,10 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[ - Union[BulkUpsertFunctionalitiesResponse, ErrorsList, Union["BulkUpsertFunctionalitiesError", "ErrorsList"]] -]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> BulkUpsertFunctionalitiesResponse | ErrorsList | Union["BulkUpsertFunctionalitiesError", "ErrorsList"] | None: if response.status_code == 200: response_200 = BulkUpsertFunctionalitiesResponse.from_dict(response.json()) @@ -74,10 +72,8 @@ def _parse_response_422(data: object) -> Union["BulkUpsertFunctionalitiesError", def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[ - Union[BulkUpsertFunctionalitiesResponse, ErrorsList, Union["BulkUpsertFunctionalitiesError", "ErrorsList"]] -]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[BulkUpsertFunctionalitiesResponse | ErrorsList | Union["BulkUpsertFunctionalitiesError", "ErrorsList"]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -90,9 +86,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: BulkUpsertFunctionalities, -) -> Response[ - Union[BulkUpsertFunctionalitiesResponse, ErrorsList, Union["BulkUpsertFunctionalitiesError", "ErrorsList"]] -]: +) -> Response[BulkUpsertFunctionalitiesResponse | ErrorsList | Union["BulkUpsertFunctionalitiesError", "ErrorsList"]]: """Bulk upsert Functionalities Create or update multiple functionalities by external_id. Only attributes present in the payload are @@ -127,9 +121,7 @@ def sync( *, client: AuthenticatedClient, body: BulkUpsertFunctionalities, -) -> Optional[ - Union[BulkUpsertFunctionalitiesResponse, ErrorsList, Union["BulkUpsertFunctionalitiesError", "ErrorsList"]] -]: +) -> BulkUpsertFunctionalitiesResponse | ErrorsList | Union["BulkUpsertFunctionalitiesError", "ErrorsList"] | None: """Bulk upsert Functionalities Create or update multiple functionalities by external_id. Only attributes present in the payload are @@ -159,9 +151,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: BulkUpsertFunctionalities, -) -> Response[ - Union[BulkUpsertFunctionalitiesResponse, ErrorsList, Union["BulkUpsertFunctionalitiesError", "ErrorsList"]] -]: +) -> Response[BulkUpsertFunctionalitiesResponse | ErrorsList | Union["BulkUpsertFunctionalitiesError", "ErrorsList"]]: """Bulk upsert Functionalities Create or update multiple functionalities by external_id. Only attributes present in the payload are @@ -194,9 +184,7 @@ async def asyncio( *, client: AuthenticatedClient, body: BulkUpsertFunctionalities, -) -> Optional[ - Union[BulkUpsertFunctionalitiesResponse, ErrorsList, Union["BulkUpsertFunctionalitiesError", "ErrorsList"]] -]: +) -> BulkUpsertFunctionalitiesResponse | ErrorsList | Union["BulkUpsertFunctionalitiesError", "ErrorsList"] | None: """Bulk upsert Functionalities Create or update multiple functionalities by external_id. Only attributes present in the payload are diff --git a/rootly_sdk/api/functionalities/create_functionality.py b/rootly_sdk/api/functionalities/create_functionality.py index 8772515d..182d32f4 100644 --- a/rootly_sdk/api/functionalities/create_functionality.py +++ b/rootly_sdk/api/functionalities/create_functionality.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, FunctionalityResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | FunctionalityResponse | None: if response.status_code == 201: response_201 = FunctionalityResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, FunctionalityResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | FunctionalityResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +69,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewFunctionality, -) -> Response[Union[ErrorsList, FunctionalityResponse]]: +) -> Response[ErrorsList | FunctionalityResponse]: """Creates a functionality Creates a new functionality from provided data @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: NewFunctionality, -) -> Optional[Union[ErrorsList, FunctionalityResponse]]: +) -> ErrorsList | FunctionalityResponse | None: """Creates a functionality Creates a new functionality from provided data @@ -126,7 +126,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewFunctionality, -) -> Response[Union[ErrorsList, FunctionalityResponse]]: +) -> Response[ErrorsList | FunctionalityResponse]: """Creates a functionality Creates a new functionality from provided data @@ -155,7 +155,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewFunctionality, -) -> Optional[Union[ErrorsList, FunctionalityResponse]]: +) -> ErrorsList | FunctionalityResponse | None: """Creates a functionality Creates a new functionality from provided data diff --git a/rootly_sdk/api/functionalities/create_functionality_catalog_property.py b/rootly_sdk/api/functionalities/create_functionality_catalog_property.py index 9c6630e8..1d2108e9 100644 --- a/rootly_sdk/api/functionalities/create_functionality_catalog_property.py +++ b/rootly_sdk/api/functionalities/create_functionality_catalog_property.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[CatalogPropertyResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CatalogPropertyResponse | ErrorsList | None: if response.status_code == 201: response_201 = CatalogPropertyResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[CatalogPropertyResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[CatalogPropertyResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +69,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewCatalogProperty, -) -> Response[Union[CatalogPropertyResponse, ErrorsList]]: +) -> Response[CatalogPropertyResponse | ErrorsList]: """Creates a Catalog Property Creates a new Catalog Property from provided data @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: NewCatalogProperty, -) -> Optional[Union[CatalogPropertyResponse, ErrorsList]]: +) -> CatalogPropertyResponse | ErrorsList | None: """Creates a Catalog Property Creates a new Catalog Property from provided data @@ -126,7 +126,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewCatalogProperty, -) -> Response[Union[CatalogPropertyResponse, ErrorsList]]: +) -> Response[CatalogPropertyResponse | ErrorsList]: """Creates a Catalog Property Creates a new Catalog Property from provided data @@ -155,7 +155,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewCatalogProperty, -) -> Optional[Union[CatalogPropertyResponse, ErrorsList]]: +) -> CatalogPropertyResponse | ErrorsList | None: """Creates a Catalog Property Creates a new Catalog Property from provided data diff --git a/rootly_sdk/api/functionalities/delete_functionality.py b/rootly_sdk/api/functionalities/delete_functionality.py index e58d65fc..8859e976 100644 --- a/rootly_sdk/api/functionalities/delete_functionality.py +++ b/rootly_sdk/api/functionalities/delete_functionality.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any from uuid import UUID import httpx @@ -12,7 +12,7 @@ def _get_kwargs( - id: Union[UUID, str], + id: UUID | str, ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "delete", @@ -23,8 +23,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, FunctionalityResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | FunctionalityResponse | None: if response.status_code == 200: response_200 = FunctionalityResponse.from_dict(response.json()) @@ -42,8 +42,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, FunctionalityResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | FunctionalityResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -53,10 +53,10 @@ def _build_response( def sync_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, FunctionalityResponse]]: +) -> Response[ErrorsList | FunctionalityResponse]: """Delete a functionality Delete a specific functionality by id @@ -84,10 +84,10 @@ def sync_detailed( def sync( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, FunctionalityResponse]]: +) -> ErrorsList | FunctionalityResponse | None: """Delete a functionality Delete a specific functionality by id @@ -110,10 +110,10 @@ def sync( async def asyncio_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, FunctionalityResponse]]: +) -> Response[ErrorsList | FunctionalityResponse]: """Delete a functionality Delete a specific functionality by id @@ -139,10 +139,10 @@ async def asyncio_detailed( async def asyncio( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, FunctionalityResponse]]: +) -> ErrorsList | FunctionalityResponse | None: """Delete a functionality Delete a specific functionality by id diff --git a/rootly_sdk/api/functionalities/get_functionality.py b/rootly_sdk/api/functionalities/get_functionality.py index 5ac0a55e..18143e81 100644 --- a/rootly_sdk/api/functionalities/get_functionality.py +++ b/rootly_sdk/api/functionalities/get_functionality.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any from uuid import UUID import httpx @@ -12,7 +12,7 @@ def _get_kwargs( - id: Union[UUID, str], + id: UUID | str, ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "get", @@ -23,8 +23,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, FunctionalityResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | FunctionalityResponse | None: if response.status_code == 200: response_200 = FunctionalityResponse.from_dict(response.json()) @@ -42,8 +42,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, FunctionalityResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | FunctionalityResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -53,10 +53,10 @@ def _build_response( def sync_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, FunctionalityResponse]]: +) -> Response[ErrorsList | FunctionalityResponse]: """Retrieves a functionality Retrieves a specific functionality by id @@ -84,10 +84,10 @@ def sync_detailed( def sync( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, FunctionalityResponse]]: +) -> ErrorsList | FunctionalityResponse | None: """Retrieves a functionality Retrieves a specific functionality by id @@ -110,10 +110,10 @@ def sync( async def asyncio_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, FunctionalityResponse]]: +) -> Response[ErrorsList | FunctionalityResponse]: """Retrieves a functionality Retrieves a specific functionality by id @@ -139,10 +139,10 @@ async def asyncio_detailed( async def asyncio( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, FunctionalityResponse]]: +) -> ErrorsList | FunctionalityResponse | None: """Retrieves a functionality Retrieves a specific functionality by id diff --git a/rootly_sdk/api/functionalities/get_functionality_incidents_chart.py b/rootly_sdk/api/functionalities/get_functionality_incidents_chart.py index cc465bc2..26df4c9a 100644 --- a/rootly_sdk/api/functionalities/get_functionality_incidents_chart.py +++ b/rootly_sdk/api/functionalities/get_functionality_incidents_chart.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any from uuid import UUID import httpx @@ -12,7 +12,7 @@ def _get_kwargs( - id: Union[UUID, str], + id: UUID | str, *, period: str, ) -> dict[str, Any]: @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, IncidentsChartResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | IncidentsChartResponse | None: if response.status_code == 200: response_200 = IncidentsChartResponse.from_dict(response.json()) @@ -51,8 +51,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, IncidentsChartResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | IncidentsChartResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -62,11 +62,11 @@ def _build_response( def sync_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, period: str, -) -> Response[Union[ErrorsList, IncidentsChartResponse]]: +) -> Response[ErrorsList | IncidentsChartResponse]: """Get functionality incidents chart Get functionality incidents chart @@ -96,11 +96,11 @@ def sync_detailed( def sync( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, period: str, -) -> Optional[Union[ErrorsList, IncidentsChartResponse]]: +) -> ErrorsList | IncidentsChartResponse | None: """Get functionality incidents chart Get functionality incidents chart @@ -125,11 +125,11 @@ def sync( async def asyncio_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, period: str, -) -> Response[Union[ErrorsList, IncidentsChartResponse]]: +) -> Response[ErrorsList | IncidentsChartResponse]: """Get functionality incidents chart Get functionality incidents chart @@ -157,11 +157,11 @@ async def asyncio_detailed( async def asyncio( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, period: str, -) -> Optional[Union[ErrorsList, IncidentsChartResponse]]: +) -> ErrorsList | IncidentsChartResponse | None: """Get functionality incidents chart Get functionality incidents chart diff --git a/rootly_sdk/api/functionalities/get_functionality_uptime_chart.py b/rootly_sdk/api/functionalities/get_functionality_uptime_chart.py index 09e7424f..3ed7b9fd 100644 --- a/rootly_sdk/api/functionalities/get_functionality_uptime_chart.py +++ b/rootly_sdk/api/functionalities/get_functionality_uptime_chart.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any from uuid import UUID import httpx @@ -12,9 +12,9 @@ def _get_kwargs( - id: Union[UUID, str], + id: UUID | str, *, - period: Union[Unset, str] = UNSET, + period: Unset | str = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, UptimeChartResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | UptimeChartResponse | None: if response.status_code == 200: response_200 = UptimeChartResponse.from_dict(response.json()) @@ -51,8 +51,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, UptimeChartResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | UptimeChartResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -62,11 +62,11 @@ def _build_response( def sync_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, - period: Union[Unset, str] = UNSET, -) -> Response[Union[ErrorsList, UptimeChartResponse]]: + period: Unset | str = UNSET, +) -> Response[ErrorsList | UptimeChartResponse]: """Get functionality uptime chart Get functionality uptime chart @@ -96,11 +96,11 @@ def sync_detailed( def sync( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, - period: Union[Unset, str] = UNSET, -) -> Optional[Union[ErrorsList, UptimeChartResponse]]: + period: Unset | str = UNSET, +) -> ErrorsList | UptimeChartResponse | None: """Get functionality uptime chart Get functionality uptime chart @@ -125,11 +125,11 @@ def sync( async def asyncio_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, - period: Union[Unset, str] = UNSET, -) -> Response[Union[ErrorsList, UptimeChartResponse]]: + period: Unset | str = UNSET, +) -> Response[ErrorsList | UptimeChartResponse]: """Get functionality uptime chart Get functionality uptime chart @@ -157,11 +157,11 @@ async def asyncio_detailed( async def asyncio( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, - period: Union[Unset, str] = UNSET, -) -> Optional[Union[ErrorsList, UptimeChartResponse]]: + period: Unset | str = UNSET, +) -> ErrorsList | UptimeChartResponse | None: """Get functionality uptime chart Get functionality uptime chart diff --git a/rootly_sdk/api/functionalities/list_functionalities.py b/rootly_sdk/api/functionalities/list_functionalities.py index e73d4744..d0dc2cbf 100644 --- a/rootly_sdk/api/functionalities/list_functionalities.py +++ b/rootly_sdk/api/functionalities/list_functionalities.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -11,29 +11,29 @@ def _get_kwargs( *, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterbackstage_id: Union[Unset, str] = UNSET, - filtercortex_id: Union[Unset, str] = UNSET, - filteropslevel_id: Union[Unset, str] = UNSET, - filterexternal_id: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, - filterslugeq: Union[Unset, str] = UNSET, - filterslugnot_eq: Union[Unset, str] = UNSET, - filterslugin: Union[Unset, str] = UNSET, - filterslugnot_in: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterbackstage_id: Unset | str = UNSET, + filtercortex_id: Unset | str = UNSET, + filteropslevel_id: Unset | str = UNSET, + filterexternal_id: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -94,9 +94,7 @@ def _get_kwargs( return _kwargs -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[FunctionalityList]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> FunctionalityList | None: if response.status_code == 200: response_200 = FunctionalityList.from_dict(response.json()) @@ -108,9 +106,7 @@ def _parse_response( return None -def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[FunctionalityList]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[FunctionalityList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -122,29 +118,29 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterbackstage_id: Union[Unset, str] = UNSET, - filtercortex_id: Union[Unset, str] = UNSET, - filteropslevel_id: Union[Unset, str] = UNSET, - filterexternal_id: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, - filterslugeq: Union[Unset, str] = UNSET, - filterslugnot_eq: Union[Unset, str] = UNSET, - filterslugin: Union[Unset, str] = UNSET, - filterslugnot_in: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterbackstage_id: Unset | str = UNSET, + filtercortex_id: Unset | str = UNSET, + filteropslevel_id: Unset | str = UNSET, + filterexternal_id: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[FunctionalityList]: """List functionalities @@ -219,30 +215,30 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterbackstage_id: Union[Unset, str] = UNSET, - filtercortex_id: Union[Unset, str] = UNSET, - filteropslevel_id: Union[Unset, str] = UNSET, - filterexternal_id: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, - filterslugeq: Union[Unset, str] = UNSET, - filterslugnot_eq: Union[Unset, str] = UNSET, - filterslugin: Union[Unset, str] = UNSET, - filterslugnot_in: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, -) -> Optional[FunctionalityList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterbackstage_id: Unset | str = UNSET, + filtercortex_id: Unset | str = UNSET, + filteropslevel_id: Unset | str = UNSET, + filterexternal_id: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, +) -> FunctionalityList | None: """List functionalities List functionalities @@ -311,29 +307,29 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterbackstage_id: Union[Unset, str] = UNSET, - filtercortex_id: Union[Unset, str] = UNSET, - filteropslevel_id: Union[Unset, str] = UNSET, - filterexternal_id: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, - filterslugeq: Union[Unset, str] = UNSET, - filterslugnot_eq: Union[Unset, str] = UNSET, - filterslugin: Union[Unset, str] = UNSET, - filterslugnot_in: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterbackstage_id: Unset | str = UNSET, + filtercortex_id: Unset | str = UNSET, + filteropslevel_id: Unset | str = UNSET, + filterexternal_id: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[FunctionalityList]: """List functionalities @@ -406,30 +402,30 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterbackstage_id: Union[Unset, str] = UNSET, - filtercortex_id: Union[Unset, str] = UNSET, - filteropslevel_id: Union[Unset, str] = UNSET, - filterexternal_id: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, - filterslugeq: Union[Unset, str] = UNSET, - filterslugnot_eq: Union[Unset, str] = UNSET, - filterslugin: Union[Unset, str] = UNSET, - filterslugnot_in: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, -) -> Optional[FunctionalityList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterbackstage_id: Unset | str = UNSET, + filtercortex_id: Unset | str = UNSET, + filteropslevel_id: Unset | str = UNSET, + filterexternal_id: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, +) -> FunctionalityList | None: """List functionalities List functionalities diff --git a/rootly_sdk/api/functionalities/list_functionality_catalog_properties.py b/rootly_sdk/api/functionalities/list_functionality_catalog_properties.py index 900fc08a..e5661399 100644 --- a/rootly_sdk/api/functionalities/list_functionality_catalog_properties.py +++ b/rootly_sdk/api/functionalities/list_functionality_catalog_properties.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -17,27 +17,27 @@ def _get_kwargs( *, - include: Union[Unset, ListFunctionalityCatalogPropertiesInclude] = UNSET, - sort: Union[Unset, ListFunctionalityCatalogPropertiesSort] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterkind: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, + include: Unset | ListFunctionalityCatalogPropertiesInclude = UNSET, + sort: Unset | ListFunctionalityCatalogPropertiesSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} - json_include: Union[Unset, str] = UNSET + json_include: Unset | str = UNSET if not isinstance(include, Unset): json_include = include params["include"] = json_include - json_sort: Union[Unset, str] = UNSET + json_sort: Unset | str = UNSET if not isinstance(sort, Unset): json_sort = sort @@ -72,9 +72,7 @@ def _get_kwargs( return _kwargs -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[CatalogPropertyList]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> CatalogPropertyList | None: if response.status_code == 200: response_200 = CatalogPropertyList.from_dict(response.json()) @@ -86,9 +84,7 @@ def _parse_response( return None -def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[CatalogPropertyList]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[CatalogPropertyList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -100,17 +96,17 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - include: Union[Unset, ListFunctionalityCatalogPropertiesInclude] = UNSET, - sort: Union[Unset, ListFunctionalityCatalogPropertiesSort] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterkind: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, + include: Unset | ListFunctionalityCatalogPropertiesInclude = UNSET, + sort: Unset | ListFunctionalityCatalogPropertiesSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> Response[CatalogPropertyList]: """List Catalog Properties @@ -161,18 +157,18 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: Union[Unset, ListFunctionalityCatalogPropertiesInclude] = UNSET, - sort: Union[Unset, ListFunctionalityCatalogPropertiesSort] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterkind: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, -) -> Optional[CatalogPropertyList]: + include: Unset | ListFunctionalityCatalogPropertiesInclude = UNSET, + sort: Unset | ListFunctionalityCatalogPropertiesSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, +) -> CatalogPropertyList | None: """List Catalog Properties List Functionality Catalog Properties @@ -217,17 +213,17 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: Union[Unset, ListFunctionalityCatalogPropertiesInclude] = UNSET, - sort: Union[Unset, ListFunctionalityCatalogPropertiesSort] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterkind: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, + include: Unset | ListFunctionalityCatalogPropertiesInclude = UNSET, + sort: Unset | ListFunctionalityCatalogPropertiesSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> Response[CatalogPropertyList]: """List Catalog Properties @@ -276,18 +272,18 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: Union[Unset, ListFunctionalityCatalogPropertiesInclude] = UNSET, - sort: Union[Unset, ListFunctionalityCatalogPropertiesSort] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterkind: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, -) -> Optional[CatalogPropertyList]: + include: Unset | ListFunctionalityCatalogPropertiesInclude = UNSET, + sort: Unset | ListFunctionalityCatalogPropertiesSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, +) -> CatalogPropertyList | None: """List Catalog Properties List Functionality Catalog Properties diff --git a/rootly_sdk/api/functionalities/update_functionality.py b/rootly_sdk/api/functionalities/update_functionality.py index 8b76fce9..9806eae2 100644 --- a/rootly_sdk/api/functionalities/update_functionality.py +++ b/rootly_sdk/api/functionalities/update_functionality.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any from uuid import UUID import httpx @@ -13,7 +13,7 @@ def _get_kwargs( - id: Union[UUID, str], + id: UUID | str, *, body: UpdateFunctionality, ) -> dict[str, Any]: @@ -33,8 +33,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, FunctionalityResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | FunctionalityResponse | None: if response.status_code == 200: response_200 = FunctionalityResponse.from_dict(response.json()) @@ -52,8 +52,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, FunctionalityResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | FunctionalityResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -63,11 +63,11 @@ def _build_response( def sync_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdateFunctionality, -) -> Response[Union[ErrorsList, FunctionalityResponse]]: +) -> Response[ErrorsList | FunctionalityResponse]: """Update a functionality Update a specific functionality by id @@ -97,11 +97,11 @@ def sync_detailed( def sync( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdateFunctionality, -) -> Optional[Union[ErrorsList, FunctionalityResponse]]: +) -> ErrorsList | FunctionalityResponse | None: """Update a functionality Update a specific functionality by id @@ -126,11 +126,11 @@ def sync( async def asyncio_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdateFunctionality, -) -> Response[Union[ErrorsList, FunctionalityResponse]]: +) -> Response[ErrorsList | FunctionalityResponse]: """Update a functionality Update a specific functionality by id @@ -158,11 +158,11 @@ async def asyncio_detailed( async def asyncio( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdateFunctionality, -) -> Optional[Union[ErrorsList, FunctionalityResponse]]: +) -> ErrorsList | FunctionalityResponse | None: """Update a functionality Update a specific functionality by id diff --git a/rootly_sdk/api/heartbeats/create_heartbeat.py b/rootly_sdk/api/heartbeats/create_heartbeat.py index 470b270e..04e60cb0 100644 --- a/rootly_sdk/api/heartbeats/create_heartbeat.py +++ b/rootly_sdk/api/heartbeats/create_heartbeat.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, HeartbeatResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | HeartbeatResponse | None: if response.status_code == 201: response_201 = HeartbeatResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, HeartbeatResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | HeartbeatResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +69,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewHeartbeat, -) -> Response[Union[ErrorsList, HeartbeatResponse]]: +) -> Response[ErrorsList | HeartbeatResponse]: """Creates a heartbeat Creates a new heartbeat from provided data @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: NewHeartbeat, -) -> Optional[Union[ErrorsList, HeartbeatResponse]]: +) -> ErrorsList | HeartbeatResponse | None: """Creates a heartbeat Creates a new heartbeat from provided data @@ -126,7 +126,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewHeartbeat, -) -> Response[Union[ErrorsList, HeartbeatResponse]]: +) -> Response[ErrorsList | HeartbeatResponse]: """Creates a heartbeat Creates a new heartbeat from provided data @@ -155,7 +155,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewHeartbeat, -) -> Optional[Union[ErrorsList, HeartbeatResponse]]: +) -> ErrorsList | HeartbeatResponse | None: """Creates a heartbeat Creates a new heartbeat from provided data diff --git a/rootly_sdk/api/heartbeats/delete_heartbeat.py b/rootly_sdk/api/heartbeats/delete_heartbeat.py index 68ff2836..2e74ade2 100644 --- a/rootly_sdk/api/heartbeats/delete_heartbeat.py +++ b/rootly_sdk/api/heartbeats/delete_heartbeat.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any from uuid import UUID import httpx @@ -12,7 +12,7 @@ def _get_kwargs( - id: Union[UUID, str], + id: UUID | str, ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "delete", @@ -23,8 +23,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, HeartbeatResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | HeartbeatResponse | None: if response.status_code == 200: response_200 = HeartbeatResponse.from_dict(response.json()) @@ -42,8 +42,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, HeartbeatResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | HeartbeatResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -53,10 +53,10 @@ def _build_response( def sync_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, HeartbeatResponse]]: +) -> Response[ErrorsList | HeartbeatResponse]: """Delete a heartbeat Delete a specific heartbeat by id @@ -84,10 +84,10 @@ def sync_detailed( def sync( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, HeartbeatResponse]]: +) -> ErrorsList | HeartbeatResponse | None: """Delete a heartbeat Delete a specific heartbeat by id @@ -110,10 +110,10 @@ def sync( async def asyncio_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, HeartbeatResponse]]: +) -> Response[ErrorsList | HeartbeatResponse]: """Delete a heartbeat Delete a specific heartbeat by id @@ -139,10 +139,10 @@ async def asyncio_detailed( async def asyncio( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, HeartbeatResponse]]: +) -> ErrorsList | HeartbeatResponse | None: """Delete a heartbeat Delete a specific heartbeat by id diff --git a/rootly_sdk/api/heartbeats/get_heartbeat.py b/rootly_sdk/api/heartbeats/get_heartbeat.py index 6a9a9827..a18d703d 100644 --- a/rootly_sdk/api/heartbeats/get_heartbeat.py +++ b/rootly_sdk/api/heartbeats/get_heartbeat.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any from uuid import UUID import httpx @@ -12,7 +12,7 @@ def _get_kwargs( - id: Union[UUID, str], + id: UUID | str, ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "get", @@ -23,8 +23,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, HeartbeatResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | HeartbeatResponse | None: if response.status_code == 200: response_200 = HeartbeatResponse.from_dict(response.json()) @@ -42,8 +42,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, HeartbeatResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | HeartbeatResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -53,10 +53,10 @@ def _build_response( def sync_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, HeartbeatResponse]]: +) -> Response[ErrorsList | HeartbeatResponse]: """Retrieves a heartbeat Retrieves a specific heartbeat by id @@ -84,10 +84,10 @@ def sync_detailed( def sync( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, HeartbeatResponse]]: +) -> ErrorsList | HeartbeatResponse | None: """Retrieves a heartbeat Retrieves a specific heartbeat by id @@ -110,10 +110,10 @@ def sync( async def asyncio_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, HeartbeatResponse]]: +) -> Response[ErrorsList | HeartbeatResponse]: """Retrieves a heartbeat Retrieves a specific heartbeat by id @@ -139,10 +139,10 @@ async def asyncio_detailed( async def asyncio( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, HeartbeatResponse]]: +) -> ErrorsList | HeartbeatResponse | None: """Retrieves a heartbeat Retrieves a specific heartbeat by id diff --git a/rootly_sdk/api/heartbeats/list_heartbeats.py b/rootly_sdk/api/heartbeats/list_heartbeats.py index 13277877..585c0f32 100644 --- a/rootly_sdk/api/heartbeats/list_heartbeats.py +++ b/rootly_sdk/api/heartbeats/list_heartbeats.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -11,16 +11,16 @@ def _get_kwargs( *, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -55,7 +55,7 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[HeartbeatList]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> HeartbeatList | None: if response.status_code == 200: response_200 = HeartbeatList.from_dict(response.json()) @@ -67,7 +67,7 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[HeartbeatList]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[HeartbeatList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -79,16 +79,16 @@ def _build_response(*, client: Union[AuthenticatedClient, Client], response: htt def sync_detailed( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> Response[HeartbeatList]: """List heartbeats @@ -137,17 +137,17 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, -) -> Optional[HeartbeatList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, +) -> HeartbeatList | None: """List heartbeats List heartbeats @@ -190,16 +190,16 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> Response[HeartbeatList]: """List heartbeats @@ -246,17 +246,17 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, -) -> Optional[HeartbeatList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, +) -> HeartbeatList | None: """List heartbeats List heartbeats diff --git a/rootly_sdk/api/heartbeats/ping_heartbeat.py b/rootly_sdk/api/heartbeats/ping_heartbeat.py index 2d55dc02..557cc949 100644 --- a/rootly_sdk/api/heartbeats/ping_heartbeat.py +++ b/rootly_sdk/api/heartbeats/ping_heartbeat.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union, cast +from typing import Any, cast import httpx @@ -20,9 +20,7 @@ def _get_kwargs( return _kwargs -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[Any, ErrorsList]]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Any | ErrorsList | None: if response.status_code == 204: response_204 = cast(Any, None) return response_204 @@ -38,9 +36,7 @@ def _parse_response( return None -def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[Any, ErrorsList]]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Any | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -53,7 +49,7 @@ def sync_detailed( heartbeat_id: str, *, client: AuthenticatedClient, -) -> Response[Union[Any, ErrorsList]]: +) -> Response[Any | ErrorsList]: """Ping a heartbeat Ping a specific heartbeat by id @@ -84,7 +80,7 @@ def sync( heartbeat_id: str, *, client: AuthenticatedClient, -) -> Optional[Union[Any, ErrorsList]]: +) -> Any | ErrorsList | None: """Ping a heartbeat Ping a specific heartbeat by id @@ -110,7 +106,7 @@ async def asyncio_detailed( heartbeat_id: str, *, client: AuthenticatedClient, -) -> Response[Union[Any, ErrorsList]]: +) -> Response[Any | ErrorsList]: """Ping a heartbeat Ping a specific heartbeat by id @@ -139,7 +135,7 @@ async def asyncio( heartbeat_id: str, *, client: AuthenticatedClient, -) -> Optional[Union[Any, ErrorsList]]: +) -> Any | ErrorsList | None: """Ping a heartbeat Ping a specific heartbeat by id diff --git a/rootly_sdk/api/heartbeats/update_heartbeat.py b/rootly_sdk/api/heartbeats/update_heartbeat.py index af6abf1e..76cd6f90 100644 --- a/rootly_sdk/api/heartbeats/update_heartbeat.py +++ b/rootly_sdk/api/heartbeats/update_heartbeat.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any from uuid import UUID import httpx @@ -13,7 +13,7 @@ def _get_kwargs( - id: Union[UUID, str], + id: UUID | str, *, body: UpdateHeartbeat, ) -> dict[str, Any]: @@ -33,8 +33,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, HeartbeatResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | HeartbeatResponse | None: if response.status_code == 200: response_200 = HeartbeatResponse.from_dict(response.json()) @@ -57,8 +57,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, HeartbeatResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | HeartbeatResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -68,11 +68,11 @@ def _build_response( def sync_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdateHeartbeat, -) -> Response[Union[ErrorsList, HeartbeatResponse]]: +) -> Response[ErrorsList | HeartbeatResponse]: """Update a heartbeat Update a specific heartbeat by id @@ -102,11 +102,11 @@ def sync_detailed( def sync( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdateHeartbeat, -) -> Optional[Union[ErrorsList, HeartbeatResponse]]: +) -> ErrorsList | HeartbeatResponse | None: """Update a heartbeat Update a specific heartbeat by id @@ -131,11 +131,11 @@ def sync( async def asyncio_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdateHeartbeat, -) -> Response[Union[ErrorsList, HeartbeatResponse]]: +) -> Response[ErrorsList | HeartbeatResponse]: """Update a heartbeat Update a specific heartbeat by id @@ -163,11 +163,11 @@ async def asyncio_detailed( async def asyncio( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdateHeartbeat, -) -> Optional[Union[ErrorsList, HeartbeatResponse]]: +) -> ErrorsList | HeartbeatResponse | None: """Update a heartbeat Update a specific heartbeat by id diff --git a/rootly_sdk/api/incident_action_items/create_incident_action_item.py b/rootly_sdk/api/incident_action_items/create_incident_action_item.py index 94b0f125..a8e52752 100644 --- a/rootly_sdk/api/incident_action_items/create_incident_action_item.py +++ b/rootly_sdk/api/incident_action_items/create_incident_action_item.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, IncidentActionItemResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | IncidentActionItemResponse | None: if response.status_code == 201: response_201 = IncidentActionItemResponse.from_dict(response.json()) @@ -56,8 +56,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, IncidentActionItemResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | IncidentActionItemResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -71,7 +71,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewIncidentActionItem, -) -> Response[Union[ErrorsList, IncidentActionItemResponse]]: +) -> Response[ErrorsList | IncidentActionItemResponse]: """Creates an incident action item Creates a new action item from provided data @@ -105,7 +105,7 @@ def sync( *, client: AuthenticatedClient, body: NewIncidentActionItem, -) -> Optional[Union[ErrorsList, IncidentActionItemResponse]]: +) -> ErrorsList | IncidentActionItemResponse | None: """Creates an incident action item Creates a new action item from provided data @@ -134,7 +134,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewIncidentActionItem, -) -> Response[Union[ErrorsList, IncidentActionItemResponse]]: +) -> Response[ErrorsList | IncidentActionItemResponse]: """Creates an incident action item Creates a new action item from provided data @@ -166,7 +166,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewIncidentActionItem, -) -> Optional[Union[ErrorsList, IncidentActionItemResponse]]: +) -> ErrorsList | IncidentActionItemResponse | None: """Creates an incident action item Creates a new action item from provided data diff --git a/rootly_sdk/api/incident_action_items/delete_incident_action_item.py b/rootly_sdk/api/incident_action_items/delete_incident_action_item.py index 0f608c3e..2ed1c40a 100644 --- a/rootly_sdk/api/incident_action_items/delete_incident_action_item.py +++ b/rootly_sdk/api/incident_action_items/delete_incident_action_item.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, IncidentActionItemResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | IncidentActionItemResponse | None: if response.status_code == 200: response_200 = IncidentActionItemResponse.from_dict(response.json()) @@ -41,8 +41,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, IncidentActionItemResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | IncidentActionItemResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -55,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, IncidentActionItemResponse]]: +) -> Response[ErrorsList | IncidentActionItemResponse]: """Delete an incident action item Delete a specific incident action item by id @@ -86,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, IncidentActionItemResponse]]: +) -> ErrorsList | IncidentActionItemResponse | None: """Delete an incident action item Delete a specific incident action item by id @@ -112,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, IncidentActionItemResponse]]: +) -> Response[ErrorsList | IncidentActionItemResponse]: """Delete an incident action item Delete a specific incident action item by id @@ -141,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, IncidentActionItemResponse]]: +) -> ErrorsList | IncidentActionItemResponse | None: """Delete an incident action item Delete a specific incident action item by id diff --git a/rootly_sdk/api/incident_action_items/get_incident_action_items.py b/rootly_sdk/api/incident_action_items/get_incident_action_items.py index 369eb41c..6dd4bc1c 100644 --- a/rootly_sdk/api/incident_action_items/get_incident_action_items.py +++ b/rootly_sdk/api/incident_action_items/get_incident_action_items.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, IncidentActionItemResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | IncidentActionItemResponse | None: if response.status_code == 200: response_200 = IncidentActionItemResponse.from_dict(response.json()) @@ -41,8 +41,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, IncidentActionItemResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | IncidentActionItemResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -55,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, IncidentActionItemResponse]]: +) -> Response[ErrorsList | IncidentActionItemResponse]: """Retrieves an incident action item Retrieves a specific incident_action_item by id @@ -86,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, IncidentActionItemResponse]]: +) -> ErrorsList | IncidentActionItemResponse | None: """Retrieves an incident action item Retrieves a specific incident_action_item by id @@ -112,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, IncidentActionItemResponse]]: +) -> Response[ErrorsList | IncidentActionItemResponse]: """Retrieves an incident action item Retrieves a specific incident_action_item by id @@ -141,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, IncidentActionItemResponse]]: +) -> ErrorsList | IncidentActionItemResponse | None: """Retrieves an incident action item Retrieves a specific incident_action_item by id diff --git a/rootly_sdk/api/incident_action_items/list_all_incident_action_items.py b/rootly_sdk/api/incident_action_items/list_all_incident_action_items.py index b77c604e..0b566a8d 100644 --- a/rootly_sdk/api/incident_action_items/list_all_incident_action_items.py +++ b/rootly_sdk/api/incident_action_items/list_all_incident_action_items.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -11,42 +11,42 @@ def _get_kwargs( *, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterkind: Union[Unset, str] = UNSET, - filterpriority: Union[Unset, str] = UNSET, - filterstatus: Union[Unset, str] = UNSET, - filterincident_status: Union[Unset, str] = UNSET, - filterincident_created_atgt: Union[Unset, str] = UNSET, - filterincident_created_atgte: Union[Unset, str] = UNSET, - filterincident_created_atlt: Union[Unset, str] = UNSET, - filterincident_created_atlte: Union[Unset, str] = UNSET, - filterdue_dategt: Union[Unset, str] = UNSET, - filterdue_dategte: Union[Unset, str] = UNSET, - filterdue_datelt: Union[Unset, str] = UNSET, - filterdue_datelte: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filterkindeq: Union[Unset, str] = UNSET, - filterkindnot_eq: Union[Unset, str] = UNSET, - filterkindin: Union[Unset, str] = UNSET, - filterkindnot_in: Union[Unset, str] = UNSET, - filterpriorityeq: Union[Unset, str] = UNSET, - filterprioritynot_eq: Union[Unset, str] = UNSET, - filterpriorityin: Union[Unset, str] = UNSET, - filterprioritynot_in: Union[Unset, str] = UNSET, - filterstatuseq: Union[Unset, str] = UNSET, - filterstatusnot_eq: Union[Unset, str] = UNSET, - filterstatusin: Union[Unset, str] = UNSET, - filterstatusnot_in: Union[Unset, str] = UNSET, - filterincident_statuseq: Union[Unset, str] = UNSET, - filterincident_statusnot_eq: Union[Unset, str] = UNSET, - filterincident_statusin: Union[Unset, str] = UNSET, - filterincident_statusnot_in: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterkind: Unset | str = UNSET, + filterpriority: Unset | str = UNSET, + filterstatus: Unset | str = UNSET, + filterincident_status: Unset | str = UNSET, + filterincident_created_atgt: Unset | str = UNSET, + filterincident_created_atgte: Unset | str = UNSET, + filterincident_created_atlt: Unset | str = UNSET, + filterincident_created_atlte: Unset | str = UNSET, + filterdue_dategt: Unset | str = UNSET, + filterdue_dategte: Unset | str = UNSET, + filterdue_datelt: Unset | str = UNSET, + filterdue_datelte: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterkindeq: Unset | str = UNSET, + filterkindnot_eq: Unset | str = UNSET, + filterkindin: Unset | str = UNSET, + filterkindnot_in: Unset | str = UNSET, + filterpriorityeq: Unset | str = UNSET, + filterprioritynot_eq: Unset | str = UNSET, + filterpriorityin: Unset | str = UNSET, + filterprioritynot_in: Unset | str = UNSET, + filterstatuseq: Unset | str = UNSET, + filterstatusnot_eq: Unset | str = UNSET, + filterstatusin: Unset | str = UNSET, + filterstatusnot_in: Unset | str = UNSET, + filterincident_statuseq: Unset | str = UNSET, + filterincident_statusnot_eq: Unset | str = UNSET, + filterincident_statusin: Unset | str = UNSET, + filterincident_statusnot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -133,9 +133,7 @@ def _get_kwargs( return _kwargs -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[IncidentActionItemList]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> IncidentActionItemList | None: if response.status_code == 200: response_200 = IncidentActionItemList.from_dict(response.json()) @@ -148,7 +146,7 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response + *, client: AuthenticatedClient | Client, response: httpx.Response ) -> Response[IncidentActionItemList]: return Response( status_code=HTTPStatus(response.status_code), @@ -161,42 +159,42 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterkind: Union[Unset, str] = UNSET, - filterpriority: Union[Unset, str] = UNSET, - filterstatus: Union[Unset, str] = UNSET, - filterincident_status: Union[Unset, str] = UNSET, - filterincident_created_atgt: Union[Unset, str] = UNSET, - filterincident_created_atgte: Union[Unset, str] = UNSET, - filterincident_created_atlt: Union[Unset, str] = UNSET, - filterincident_created_atlte: Union[Unset, str] = UNSET, - filterdue_dategt: Union[Unset, str] = UNSET, - filterdue_dategte: Union[Unset, str] = UNSET, - filterdue_datelt: Union[Unset, str] = UNSET, - filterdue_datelte: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filterkindeq: Union[Unset, str] = UNSET, - filterkindnot_eq: Union[Unset, str] = UNSET, - filterkindin: Union[Unset, str] = UNSET, - filterkindnot_in: Union[Unset, str] = UNSET, - filterpriorityeq: Union[Unset, str] = UNSET, - filterprioritynot_eq: Union[Unset, str] = UNSET, - filterpriorityin: Union[Unset, str] = UNSET, - filterprioritynot_in: Union[Unset, str] = UNSET, - filterstatuseq: Union[Unset, str] = UNSET, - filterstatusnot_eq: Union[Unset, str] = UNSET, - filterstatusin: Union[Unset, str] = UNSET, - filterstatusnot_in: Union[Unset, str] = UNSET, - filterincident_statuseq: Union[Unset, str] = UNSET, - filterincident_statusnot_eq: Union[Unset, str] = UNSET, - filterincident_statusin: Union[Unset, str] = UNSET, - filterincident_statusnot_in: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterkind: Unset | str = UNSET, + filterpriority: Unset | str = UNSET, + filterstatus: Unset | str = UNSET, + filterincident_status: Unset | str = UNSET, + filterincident_created_atgt: Unset | str = UNSET, + filterincident_created_atgte: Unset | str = UNSET, + filterincident_created_atlt: Unset | str = UNSET, + filterincident_created_atlte: Unset | str = UNSET, + filterdue_dategt: Unset | str = UNSET, + filterdue_dategte: Unset | str = UNSET, + filterdue_datelt: Unset | str = UNSET, + filterdue_datelte: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterkindeq: Unset | str = UNSET, + filterkindnot_eq: Unset | str = UNSET, + filterkindin: Unset | str = UNSET, + filterkindnot_in: Unset | str = UNSET, + filterpriorityeq: Unset | str = UNSET, + filterprioritynot_eq: Unset | str = UNSET, + filterpriorityin: Unset | str = UNSET, + filterprioritynot_in: Unset | str = UNSET, + filterstatuseq: Unset | str = UNSET, + filterstatusnot_eq: Unset | str = UNSET, + filterstatusin: Unset | str = UNSET, + filterstatusnot_in: Unset | str = UNSET, + filterincident_statuseq: Unset | str = UNSET, + filterincident_statusnot_eq: Unset | str = UNSET, + filterincident_statusin: Unset | str = UNSET, + filterincident_statusnot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[IncidentActionItemList]: """List all action items for an organization @@ -297,43 +295,43 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterkind: Union[Unset, str] = UNSET, - filterpriority: Union[Unset, str] = UNSET, - filterstatus: Union[Unset, str] = UNSET, - filterincident_status: Union[Unset, str] = UNSET, - filterincident_created_atgt: Union[Unset, str] = UNSET, - filterincident_created_atgte: Union[Unset, str] = UNSET, - filterincident_created_atlt: Union[Unset, str] = UNSET, - filterincident_created_atlte: Union[Unset, str] = UNSET, - filterdue_dategt: Union[Unset, str] = UNSET, - filterdue_dategte: Union[Unset, str] = UNSET, - filterdue_datelt: Union[Unset, str] = UNSET, - filterdue_datelte: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filterkindeq: Union[Unset, str] = UNSET, - filterkindnot_eq: Union[Unset, str] = UNSET, - filterkindin: Union[Unset, str] = UNSET, - filterkindnot_in: Union[Unset, str] = UNSET, - filterpriorityeq: Union[Unset, str] = UNSET, - filterprioritynot_eq: Union[Unset, str] = UNSET, - filterpriorityin: Union[Unset, str] = UNSET, - filterprioritynot_in: Union[Unset, str] = UNSET, - filterstatuseq: Union[Unset, str] = UNSET, - filterstatusnot_eq: Union[Unset, str] = UNSET, - filterstatusin: Union[Unset, str] = UNSET, - filterstatusnot_in: Union[Unset, str] = UNSET, - filterincident_statuseq: Union[Unset, str] = UNSET, - filterincident_statusnot_eq: Union[Unset, str] = UNSET, - filterincident_statusin: Union[Unset, str] = UNSET, - filterincident_statusnot_in: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, -) -> Optional[IncidentActionItemList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterkind: Unset | str = UNSET, + filterpriority: Unset | str = UNSET, + filterstatus: Unset | str = UNSET, + filterincident_status: Unset | str = UNSET, + filterincident_created_atgt: Unset | str = UNSET, + filterincident_created_atgte: Unset | str = UNSET, + filterincident_created_atlt: Unset | str = UNSET, + filterincident_created_atlte: Unset | str = UNSET, + filterdue_dategt: Unset | str = UNSET, + filterdue_dategte: Unset | str = UNSET, + filterdue_datelt: Unset | str = UNSET, + filterdue_datelte: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterkindeq: Unset | str = UNSET, + filterkindnot_eq: Unset | str = UNSET, + filterkindin: Unset | str = UNSET, + filterkindnot_in: Unset | str = UNSET, + filterpriorityeq: Unset | str = UNSET, + filterprioritynot_eq: Unset | str = UNSET, + filterpriorityin: Unset | str = UNSET, + filterprioritynot_in: Unset | str = UNSET, + filterstatuseq: Unset | str = UNSET, + filterstatusnot_eq: Unset | str = UNSET, + filterstatusin: Unset | str = UNSET, + filterstatusnot_in: Unset | str = UNSET, + filterincident_statuseq: Unset | str = UNSET, + filterincident_statusnot_eq: Unset | str = UNSET, + filterincident_statusin: Unset | str = UNSET, + filterincident_statusnot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, +) -> IncidentActionItemList | None: """List all action items for an organization List all action items for an organization @@ -428,42 +426,42 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterkind: Union[Unset, str] = UNSET, - filterpriority: Union[Unset, str] = UNSET, - filterstatus: Union[Unset, str] = UNSET, - filterincident_status: Union[Unset, str] = UNSET, - filterincident_created_atgt: Union[Unset, str] = UNSET, - filterincident_created_atgte: Union[Unset, str] = UNSET, - filterincident_created_atlt: Union[Unset, str] = UNSET, - filterincident_created_atlte: Union[Unset, str] = UNSET, - filterdue_dategt: Union[Unset, str] = UNSET, - filterdue_dategte: Union[Unset, str] = UNSET, - filterdue_datelt: Union[Unset, str] = UNSET, - filterdue_datelte: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filterkindeq: Union[Unset, str] = UNSET, - filterkindnot_eq: Union[Unset, str] = UNSET, - filterkindin: Union[Unset, str] = UNSET, - filterkindnot_in: Union[Unset, str] = UNSET, - filterpriorityeq: Union[Unset, str] = UNSET, - filterprioritynot_eq: Union[Unset, str] = UNSET, - filterpriorityin: Union[Unset, str] = UNSET, - filterprioritynot_in: Union[Unset, str] = UNSET, - filterstatuseq: Union[Unset, str] = UNSET, - filterstatusnot_eq: Union[Unset, str] = UNSET, - filterstatusin: Union[Unset, str] = UNSET, - filterstatusnot_in: Union[Unset, str] = UNSET, - filterincident_statuseq: Union[Unset, str] = UNSET, - filterincident_statusnot_eq: Union[Unset, str] = UNSET, - filterincident_statusin: Union[Unset, str] = UNSET, - filterincident_statusnot_in: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterkind: Unset | str = UNSET, + filterpriority: Unset | str = UNSET, + filterstatus: Unset | str = UNSET, + filterincident_status: Unset | str = UNSET, + filterincident_created_atgt: Unset | str = UNSET, + filterincident_created_atgte: Unset | str = UNSET, + filterincident_created_atlt: Unset | str = UNSET, + filterincident_created_atlte: Unset | str = UNSET, + filterdue_dategt: Unset | str = UNSET, + filterdue_dategte: Unset | str = UNSET, + filterdue_datelt: Unset | str = UNSET, + filterdue_datelte: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterkindeq: Unset | str = UNSET, + filterkindnot_eq: Unset | str = UNSET, + filterkindin: Unset | str = UNSET, + filterkindnot_in: Unset | str = UNSET, + filterpriorityeq: Unset | str = UNSET, + filterprioritynot_eq: Unset | str = UNSET, + filterpriorityin: Unset | str = UNSET, + filterprioritynot_in: Unset | str = UNSET, + filterstatuseq: Unset | str = UNSET, + filterstatusnot_eq: Unset | str = UNSET, + filterstatusin: Unset | str = UNSET, + filterstatusnot_in: Unset | str = UNSET, + filterincident_statuseq: Unset | str = UNSET, + filterincident_statusnot_eq: Unset | str = UNSET, + filterincident_statusin: Unset | str = UNSET, + filterincident_statusnot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[IncidentActionItemList]: """List all action items for an organization @@ -562,43 +560,43 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterkind: Union[Unset, str] = UNSET, - filterpriority: Union[Unset, str] = UNSET, - filterstatus: Union[Unset, str] = UNSET, - filterincident_status: Union[Unset, str] = UNSET, - filterincident_created_atgt: Union[Unset, str] = UNSET, - filterincident_created_atgte: Union[Unset, str] = UNSET, - filterincident_created_atlt: Union[Unset, str] = UNSET, - filterincident_created_atlte: Union[Unset, str] = UNSET, - filterdue_dategt: Union[Unset, str] = UNSET, - filterdue_dategte: Union[Unset, str] = UNSET, - filterdue_datelt: Union[Unset, str] = UNSET, - filterdue_datelte: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filterkindeq: Union[Unset, str] = UNSET, - filterkindnot_eq: Union[Unset, str] = UNSET, - filterkindin: Union[Unset, str] = UNSET, - filterkindnot_in: Union[Unset, str] = UNSET, - filterpriorityeq: Union[Unset, str] = UNSET, - filterprioritynot_eq: Union[Unset, str] = UNSET, - filterpriorityin: Union[Unset, str] = UNSET, - filterprioritynot_in: Union[Unset, str] = UNSET, - filterstatuseq: Union[Unset, str] = UNSET, - filterstatusnot_eq: Union[Unset, str] = UNSET, - filterstatusin: Union[Unset, str] = UNSET, - filterstatusnot_in: Union[Unset, str] = UNSET, - filterincident_statuseq: Union[Unset, str] = UNSET, - filterincident_statusnot_eq: Union[Unset, str] = UNSET, - filterincident_statusin: Union[Unset, str] = UNSET, - filterincident_statusnot_in: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, -) -> Optional[IncidentActionItemList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterkind: Unset | str = UNSET, + filterpriority: Unset | str = UNSET, + filterstatus: Unset | str = UNSET, + filterincident_status: Unset | str = UNSET, + filterincident_created_atgt: Unset | str = UNSET, + filterincident_created_atgte: Unset | str = UNSET, + filterincident_created_atlt: Unset | str = UNSET, + filterincident_created_atlte: Unset | str = UNSET, + filterdue_dategt: Unset | str = UNSET, + filterdue_dategte: Unset | str = UNSET, + filterdue_datelt: Unset | str = UNSET, + filterdue_datelte: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterkindeq: Unset | str = UNSET, + filterkindnot_eq: Unset | str = UNSET, + filterkindin: Unset | str = UNSET, + filterkindnot_in: Unset | str = UNSET, + filterpriorityeq: Unset | str = UNSET, + filterprioritynot_eq: Unset | str = UNSET, + filterpriorityin: Unset | str = UNSET, + filterprioritynot_in: Unset | str = UNSET, + filterstatuseq: Unset | str = UNSET, + filterstatusnot_eq: Unset | str = UNSET, + filterstatusin: Unset | str = UNSET, + filterstatusnot_in: Unset | str = UNSET, + filterincident_statuseq: Unset | str = UNSET, + filterincident_statusnot_eq: Unset | str = UNSET, + filterincident_statusin: Unset | str = UNSET, + filterincident_statusnot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, +) -> IncidentActionItemList | None: """List all action items for an organization List all action items for an organization diff --git a/rootly_sdk/api/incident_action_items/list_incident_action_items.py b/rootly_sdk/api/incident_action_items/list_incident_action_items.py index 541a55a4..9ea3c16e 100644 --- a/rootly_sdk/api/incident_action_items/list_incident_action_items.py +++ b/rootly_sdk/api/incident_action_items/list_incident_action_items.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -12,9 +12,9 @@ def _get_kwargs( incident_id: str, *, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -35,9 +35,7 @@ def _get_kwargs( return _kwargs -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[IncidentActionItemList]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> IncidentActionItemList | None: if response.status_code == 200: response_200 = IncidentActionItemList.from_dict(response.json()) @@ -50,7 +48,7 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response + *, client: AuthenticatedClient | Client, response: httpx.Response ) -> Response[IncidentActionItemList]: return Response( status_code=HTTPStatus(response.status_code), @@ -64,9 +62,9 @@ def sync_detailed( incident_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[IncidentActionItemList]: """List incident action items @@ -104,10 +102,10 @@ def sync( incident_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, -) -> Optional[IncidentActionItemList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, +) -> IncidentActionItemList | None: """List incident action items List incident action items @@ -139,9 +137,9 @@ async def asyncio_detailed( incident_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[IncidentActionItemList]: """List incident action items @@ -177,10 +175,10 @@ async def asyncio( incident_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, -) -> Optional[IncidentActionItemList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, +) -> IncidentActionItemList | None: """List incident action items List incident action items diff --git a/rootly_sdk/api/incident_action_items/update_incident_action_item.py b/rootly_sdk/api/incident_action_items/update_incident_action_item.py index a370f7ff..9c0b7bbf 100644 --- a/rootly_sdk/api/incident_action_items/update_incident_action_item.py +++ b/rootly_sdk/api/incident_action_items/update_incident_action_item.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, IncidentActionItemResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | IncidentActionItemResponse | None: if response.status_code == 200: response_200 = IncidentActionItemResponse.from_dict(response.json()) @@ -51,8 +51,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, IncidentActionItemResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | IncidentActionItemResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateIncidentActionItem, -) -> Response[Union[ErrorsList, IncidentActionItemResponse]]: +) -> Response[ErrorsList | IncidentActionItemResponse]: """Update an incident action item Update a specific incident action item by id @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateIncidentActionItem, -) -> Optional[Union[ErrorsList, IncidentActionItemResponse]]: +) -> ErrorsList | IncidentActionItemResponse | None: """Update an incident action item Update a specific incident action item by id @@ -129,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateIncidentActionItem, -) -> Response[Union[ErrorsList, IncidentActionItemResponse]]: +) -> Response[ErrorsList | IncidentActionItemResponse]: """Update an incident action item Update a specific incident action item by id @@ -161,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateIncidentActionItem, -) -> Optional[Union[ErrorsList, IncidentActionItemResponse]]: +) -> ErrorsList | IncidentActionItemResponse | None: """Update an incident action item Update a specific incident action item by id diff --git a/rootly_sdk/api/incident_event_functionalities/create_incident_event_functionality.py b/rootly_sdk/api/incident_event_functionalities/create_incident_event_functionality.py index b1c50def..736aae39 100644 --- a/rootly_sdk/api/incident_event_functionalities/create_incident_event_functionality.py +++ b/rootly_sdk/api/incident_event_functionalities/create_incident_event_functionality.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, IncidentEventFunctionalityResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | IncidentEventFunctionalityResponse | None: if response.status_code == 201: response_201 = IncidentEventFunctionalityResponse.from_dict(response.json()) @@ -56,8 +56,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, IncidentEventFunctionalityResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | IncidentEventFunctionalityResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -71,7 +71,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewIncidentEventFunctionality, -) -> Response[Union[ErrorsList, IncidentEventFunctionalityResponse]]: +) -> Response[ErrorsList | IncidentEventFunctionalityResponse]: """Creates an incident event functionality Creates a new event functionality from provided data @@ -105,7 +105,7 @@ def sync( *, client: AuthenticatedClient, body: NewIncidentEventFunctionality, -) -> Optional[Union[ErrorsList, IncidentEventFunctionalityResponse]]: +) -> ErrorsList | IncidentEventFunctionalityResponse | None: """Creates an incident event functionality Creates a new event functionality from provided data @@ -134,7 +134,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewIncidentEventFunctionality, -) -> Response[Union[ErrorsList, IncidentEventFunctionalityResponse]]: +) -> Response[ErrorsList | IncidentEventFunctionalityResponse]: """Creates an incident event functionality Creates a new event functionality from provided data @@ -166,7 +166,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewIncidentEventFunctionality, -) -> Optional[Union[ErrorsList, IncidentEventFunctionalityResponse]]: +) -> ErrorsList | IncidentEventFunctionalityResponse | None: """Creates an incident event functionality Creates a new event functionality from provided data diff --git a/rootly_sdk/api/incident_event_functionalities/delete_incident_event_functionality.py b/rootly_sdk/api/incident_event_functionalities/delete_incident_event_functionality.py index 0f934365..fa9b8b75 100644 --- a/rootly_sdk/api/incident_event_functionalities/delete_incident_event_functionality.py +++ b/rootly_sdk/api/incident_event_functionalities/delete_incident_event_functionality.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, IncidentEventFunctionalityResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | IncidentEventFunctionalityResponse | None: if response.status_code == 200: response_200 = IncidentEventFunctionalityResponse.from_dict(response.json()) @@ -41,8 +41,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, IncidentEventFunctionalityResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | IncidentEventFunctionalityResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -55,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, IncidentEventFunctionalityResponse]]: +) -> Response[ErrorsList | IncidentEventFunctionalityResponse]: """Delete an incident event functionality Delete a specific incident event functionality by id @@ -86,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, IncidentEventFunctionalityResponse]]: +) -> ErrorsList | IncidentEventFunctionalityResponse | None: """Delete an incident event functionality Delete a specific incident event functionality by id @@ -112,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, IncidentEventFunctionalityResponse]]: +) -> Response[ErrorsList | IncidentEventFunctionalityResponse]: """Delete an incident event functionality Delete a specific incident event functionality by id @@ -141,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, IncidentEventFunctionalityResponse]]: +) -> ErrorsList | IncidentEventFunctionalityResponse | None: """Delete an incident event functionality Delete a specific incident event functionality by id diff --git a/rootly_sdk/api/incident_event_functionalities/get_incident_event_functionalities.py b/rootly_sdk/api/incident_event_functionalities/get_incident_event_functionalities.py index b1913571..bcbd76ae 100644 --- a/rootly_sdk/api/incident_event_functionalities/get_incident_event_functionalities.py +++ b/rootly_sdk/api/incident_event_functionalities/get_incident_event_functionalities.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, IncidentEventFunctionalityResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | IncidentEventFunctionalityResponse | None: if response.status_code == 200: response_200 = IncidentEventFunctionalityResponse.from_dict(response.json()) @@ -41,8 +41,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, IncidentEventFunctionalityResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | IncidentEventFunctionalityResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -55,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, IncidentEventFunctionalityResponse]]: +) -> Response[ErrorsList | IncidentEventFunctionalityResponse]: """Retrieves an incident event functionality Retrieves a specific incident_event_functionality by id @@ -86,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, IncidentEventFunctionalityResponse]]: +) -> ErrorsList | IncidentEventFunctionalityResponse | None: """Retrieves an incident event functionality Retrieves a specific incident_event_functionality by id @@ -112,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, IncidentEventFunctionalityResponse]]: +) -> Response[ErrorsList | IncidentEventFunctionalityResponse]: """Retrieves an incident event functionality Retrieves a specific incident_event_functionality by id @@ -141,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, IncidentEventFunctionalityResponse]]: +) -> ErrorsList | IncidentEventFunctionalityResponse | None: """Retrieves an incident event functionality Retrieves a specific incident_event_functionality by id diff --git a/rootly_sdk/api/incident_event_functionalities/list_incident_event_functionalities.py b/rootly_sdk/api/incident_event_functionalities/list_incident_event_functionalities.py index 65374aac..3676b424 100644 --- a/rootly_sdk/api/incident_event_functionalities/list_incident_event_functionalities.py +++ b/rootly_sdk/api/incident_event_functionalities/list_incident_event_functionalities.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -12,9 +12,9 @@ def _get_kwargs( incident_event_id: str, *, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -36,8 +36,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[IncidentEventFunctionalityList]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> IncidentEventFunctionalityList | None: if response.status_code == 200: response_200 = IncidentEventFunctionalityList.from_dict(response.json()) @@ -50,7 +50,7 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response + *, client: AuthenticatedClient | Client, response: httpx.Response ) -> Response[IncidentEventFunctionalityList]: return Response( status_code=HTTPStatus(response.status_code), @@ -64,9 +64,9 @@ def sync_detailed( incident_event_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[IncidentEventFunctionalityList]: """List incident event functionalities @@ -104,10 +104,10 @@ def sync( incident_event_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, -) -> Optional[IncidentEventFunctionalityList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, +) -> IncidentEventFunctionalityList | None: """List incident event functionalities List incident event functionalities @@ -139,9 +139,9 @@ async def asyncio_detailed( incident_event_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[IncidentEventFunctionalityList]: """List incident event functionalities @@ -177,10 +177,10 @@ async def asyncio( incident_event_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, -) -> Optional[IncidentEventFunctionalityList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, +) -> IncidentEventFunctionalityList | None: """List incident event functionalities List incident event functionalities diff --git a/rootly_sdk/api/incident_event_functionalities/update_incident_event_functionality.py b/rootly_sdk/api/incident_event_functionalities/update_incident_event_functionality.py index 4e3b4c62..09b0e16e 100644 --- a/rootly_sdk/api/incident_event_functionalities/update_incident_event_functionality.py +++ b/rootly_sdk/api/incident_event_functionalities/update_incident_event_functionality.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, IncidentEventFunctionalityResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | IncidentEventFunctionalityResponse | None: if response.status_code == 200: response_200 = IncidentEventFunctionalityResponse.from_dict(response.json()) @@ -51,8 +51,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, IncidentEventFunctionalityResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | IncidentEventFunctionalityResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateIncidentEventFunctionality, -) -> Response[Union[ErrorsList, IncidentEventFunctionalityResponse]]: +) -> Response[ErrorsList | IncidentEventFunctionalityResponse]: """Update an incident event Update a specific incident event functionality by id @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateIncidentEventFunctionality, -) -> Optional[Union[ErrorsList, IncidentEventFunctionalityResponse]]: +) -> ErrorsList | IncidentEventFunctionalityResponse | None: """Update an incident event Update a specific incident event functionality by id @@ -129,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateIncidentEventFunctionality, -) -> Response[Union[ErrorsList, IncidentEventFunctionalityResponse]]: +) -> Response[ErrorsList | IncidentEventFunctionalityResponse]: """Update an incident event Update a specific incident event functionality by id @@ -161,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateIncidentEventFunctionality, -) -> Optional[Union[ErrorsList, IncidentEventFunctionalityResponse]]: +) -> ErrorsList | IncidentEventFunctionalityResponse | None: """Update an incident event Update a specific incident event functionality by id diff --git a/rootly_sdk/api/incident_event_services/create_incident_event_service.py b/rootly_sdk/api/incident_event_services/create_incident_event_service.py index 88cb5b8c..8cbda389 100644 --- a/rootly_sdk/api/incident_event_services/create_incident_event_service.py +++ b/rootly_sdk/api/incident_event_services/create_incident_event_service.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, IncidentEventServiceResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | IncidentEventServiceResponse | None: if response.status_code == 201: response_201 = IncidentEventServiceResponse.from_dict(response.json()) @@ -56,8 +56,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, IncidentEventServiceResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | IncidentEventServiceResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -71,7 +71,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewIncidentEventService, -) -> Response[Union[ErrorsList, IncidentEventServiceResponse]]: +) -> Response[ErrorsList | IncidentEventServiceResponse]: """Creates an incident event service Creates a new event service from provided data @@ -105,7 +105,7 @@ def sync( *, client: AuthenticatedClient, body: NewIncidentEventService, -) -> Optional[Union[ErrorsList, IncidentEventServiceResponse]]: +) -> ErrorsList | IncidentEventServiceResponse | None: """Creates an incident event service Creates a new event service from provided data @@ -134,7 +134,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewIncidentEventService, -) -> Response[Union[ErrorsList, IncidentEventServiceResponse]]: +) -> Response[ErrorsList | IncidentEventServiceResponse]: """Creates an incident event service Creates a new event service from provided data @@ -166,7 +166,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewIncidentEventService, -) -> Optional[Union[ErrorsList, IncidentEventServiceResponse]]: +) -> ErrorsList | IncidentEventServiceResponse | None: """Creates an incident event service Creates a new event service from provided data diff --git a/rootly_sdk/api/incident_event_services/delete_incident_event_service.py b/rootly_sdk/api/incident_event_services/delete_incident_event_service.py index 4e789fb7..ae2f92e5 100644 --- a/rootly_sdk/api/incident_event_services/delete_incident_event_service.py +++ b/rootly_sdk/api/incident_event_services/delete_incident_event_service.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, IncidentEventServiceResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | IncidentEventServiceResponse | None: if response.status_code == 200: response_200 = IncidentEventServiceResponse.from_dict(response.json()) @@ -41,8 +41,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, IncidentEventServiceResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | IncidentEventServiceResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -55,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, IncidentEventServiceResponse]]: +) -> Response[ErrorsList | IncidentEventServiceResponse]: """Delete an incident event functionalitu Delete a specific incident event service by id @@ -86,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, IncidentEventServiceResponse]]: +) -> ErrorsList | IncidentEventServiceResponse | None: """Delete an incident event functionalitu Delete a specific incident event service by id @@ -112,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, IncidentEventServiceResponse]]: +) -> Response[ErrorsList | IncidentEventServiceResponse]: """Delete an incident event functionalitu Delete a specific incident event service by id @@ -141,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, IncidentEventServiceResponse]]: +) -> ErrorsList | IncidentEventServiceResponse | None: """Delete an incident event functionalitu Delete a specific incident event service by id diff --git a/rootly_sdk/api/incident_event_services/get_incident_event_services.py b/rootly_sdk/api/incident_event_services/get_incident_event_services.py index aeedae16..fc9396a8 100644 --- a/rootly_sdk/api/incident_event_services/get_incident_event_services.py +++ b/rootly_sdk/api/incident_event_services/get_incident_event_services.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, IncidentEventServiceResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | IncidentEventServiceResponse | None: if response.status_code == 200: response_200 = IncidentEventServiceResponse.from_dict(response.json()) @@ -41,8 +41,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, IncidentEventServiceResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | IncidentEventServiceResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -55,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, IncidentEventServiceResponse]]: +) -> Response[ErrorsList | IncidentEventServiceResponse]: """Retrieves an incident event service Retrieves a specific incident_event_service by id @@ -86,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, IncidentEventServiceResponse]]: +) -> ErrorsList | IncidentEventServiceResponse | None: """Retrieves an incident event service Retrieves a specific incident_event_service by id @@ -112,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, IncidentEventServiceResponse]]: +) -> Response[ErrorsList | IncidentEventServiceResponse]: """Retrieves an incident event service Retrieves a specific incident_event_service by id @@ -141,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, IncidentEventServiceResponse]]: +) -> ErrorsList | IncidentEventServiceResponse | None: """Retrieves an incident event service Retrieves a specific incident_event_service by id diff --git a/rootly_sdk/api/incident_event_services/list_incident_event_services.py b/rootly_sdk/api/incident_event_services/list_incident_event_services.py index b8b44bad..2301da6a 100644 --- a/rootly_sdk/api/incident_event_services/list_incident_event_services.py +++ b/rootly_sdk/api/incident_event_services/list_incident_event_services.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -12,9 +12,9 @@ def _get_kwargs( incident_event_id: str, *, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -36,8 +36,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[IncidentEventServiceList]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> IncidentEventServiceList | None: if response.status_code == 200: response_200 = IncidentEventServiceList.from_dict(response.json()) @@ -50,7 +50,7 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response + *, client: AuthenticatedClient | Client, response: httpx.Response ) -> Response[IncidentEventServiceList]: return Response( status_code=HTTPStatus(response.status_code), @@ -64,9 +64,9 @@ def sync_detailed( incident_event_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[IncidentEventServiceList]: """List incident event services @@ -104,10 +104,10 @@ def sync( incident_event_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, -) -> Optional[IncidentEventServiceList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, +) -> IncidentEventServiceList | None: """List incident event services List incident event services @@ -139,9 +139,9 @@ async def asyncio_detailed( incident_event_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[IncidentEventServiceList]: """List incident event services @@ -177,10 +177,10 @@ async def asyncio( incident_event_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, -) -> Optional[IncidentEventServiceList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, +) -> IncidentEventServiceList | None: """List incident event services List incident event services diff --git a/rootly_sdk/api/incident_event_services/update_incident_event_service.py b/rootly_sdk/api/incident_event_services/update_incident_event_service.py index ba086e52..be5fe06a 100644 --- a/rootly_sdk/api/incident_event_services/update_incident_event_service.py +++ b/rootly_sdk/api/incident_event_services/update_incident_event_service.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, IncidentEventServiceResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | IncidentEventServiceResponse | None: if response.status_code == 200: response_200 = IncidentEventServiceResponse.from_dict(response.json()) @@ -51,8 +51,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, IncidentEventServiceResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | IncidentEventServiceResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateIncidentEventService, -) -> Response[Union[ErrorsList, IncidentEventServiceResponse]]: +) -> Response[ErrorsList | IncidentEventServiceResponse]: """Update an incident event Update a specific incident event service by id @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateIncidentEventService, -) -> Optional[Union[ErrorsList, IncidentEventServiceResponse]]: +) -> ErrorsList | IncidentEventServiceResponse | None: """Update an incident event Update a specific incident event service by id @@ -129,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateIncidentEventService, -) -> Response[Union[ErrorsList, IncidentEventServiceResponse]]: +) -> Response[ErrorsList | IncidentEventServiceResponse]: """Update an incident event Update a specific incident event service by id @@ -161,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateIncidentEventService, -) -> Optional[Union[ErrorsList, IncidentEventServiceResponse]]: +) -> ErrorsList | IncidentEventServiceResponse | None: """Update an incident event Update a specific incident event service by id diff --git a/rootly_sdk/api/incident_events/create_incident_event.py b/rootly_sdk/api/incident_events/create_incident_event.py index 4e2580bb..218606b0 100644 --- a/rootly_sdk/api/incident_events/create_incident_event.py +++ b/rootly_sdk/api/incident_events/create_incident_event.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, IncidentEventResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | IncidentEventResponse | None: if response.status_code == 201: response_201 = IncidentEventResponse.from_dict(response.json()) @@ -56,8 +56,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, IncidentEventResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | IncidentEventResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -71,7 +71,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewIncidentEvent, -) -> Response[Union[ErrorsList, IncidentEventResponse]]: +) -> Response[ErrorsList | IncidentEventResponse]: """Creates an incident event Creates a new event from provided data @@ -105,7 +105,7 @@ def sync( *, client: AuthenticatedClient, body: NewIncidentEvent, -) -> Optional[Union[ErrorsList, IncidentEventResponse]]: +) -> ErrorsList | IncidentEventResponse | None: """Creates an incident event Creates a new event from provided data @@ -134,7 +134,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewIncidentEvent, -) -> Response[Union[ErrorsList, IncidentEventResponse]]: +) -> Response[ErrorsList | IncidentEventResponse]: """Creates an incident event Creates a new event from provided data @@ -166,7 +166,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewIncidentEvent, -) -> Optional[Union[ErrorsList, IncidentEventResponse]]: +) -> ErrorsList | IncidentEventResponse | None: """Creates an incident event Creates a new event from provided data diff --git a/rootly_sdk/api/incident_events/delete_incident_event.py b/rootly_sdk/api/incident_events/delete_incident_event.py index 13fe1ae0..9fda3db4 100644 --- a/rootly_sdk/api/incident_events/delete_incident_event.py +++ b/rootly_sdk/api/incident_events/delete_incident_event.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, IncidentEventResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | IncidentEventResponse | None: if response.status_code == 200: response_200 = IncidentEventResponse.from_dict(response.json()) @@ -41,8 +41,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, IncidentEventResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | IncidentEventResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -55,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, IncidentEventResponse]]: +) -> Response[ErrorsList | IncidentEventResponse]: """Delete an incident event Delete a specific incident event by id @@ -86,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, IncidentEventResponse]]: +) -> ErrorsList | IncidentEventResponse | None: """Delete an incident event Delete a specific incident event by id @@ -112,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, IncidentEventResponse]]: +) -> Response[ErrorsList | IncidentEventResponse]: """Delete an incident event Delete a specific incident event by id @@ -141,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, IncidentEventResponse]]: +) -> ErrorsList | IncidentEventResponse | None: """Delete an incident event Delete a specific incident event by id diff --git a/rootly_sdk/api/incident_events/get_incident_events.py b/rootly_sdk/api/incident_events/get_incident_events.py index 7782f618..df761f0d 100644 --- a/rootly_sdk/api/incident_events/get_incident_events.py +++ b/rootly_sdk/api/incident_events/get_incident_events.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, IncidentEventResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | IncidentEventResponse | None: if response.status_code == 200: response_200 = IncidentEventResponse.from_dict(response.json()) @@ -41,8 +41,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, IncidentEventResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | IncidentEventResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -55,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, IncidentEventResponse]]: +) -> Response[ErrorsList | IncidentEventResponse]: """Retrieves an incident event Retrieves a specific incident_event by id @@ -86,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, IncidentEventResponse]]: +) -> ErrorsList | IncidentEventResponse | None: """Retrieves an incident event Retrieves a specific incident_event by id @@ -112,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, IncidentEventResponse]]: +) -> Response[ErrorsList | IncidentEventResponse]: """Retrieves an incident event Retrieves a specific incident_event by id @@ -141,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, IncidentEventResponse]]: +) -> ErrorsList | IncidentEventResponse | None: """Retrieves an incident event Retrieves a specific incident_event by id diff --git a/rootly_sdk/api/incident_events/list_incident_events.py b/rootly_sdk/api/incident_events/list_incident_events.py index 2df8fc47..84b2c44f 100644 --- a/rootly_sdk/api/incident_events/list_incident_events.py +++ b/rootly_sdk/api/incident_events/list_incident_events.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -12,9 +12,9 @@ def _get_kwargs( incident_id: str, *, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -35,9 +35,7 @@ def _get_kwargs( return _kwargs -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[IncidentEventList]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> IncidentEventList | None: if response.status_code == 200: response_200 = IncidentEventList.from_dict(response.json()) @@ -49,9 +47,7 @@ def _parse_response( return None -def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[IncidentEventList]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[IncidentEventList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -64,9 +60,9 @@ def sync_detailed( incident_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[IncidentEventList]: """List incident events @@ -104,10 +100,10 @@ def sync( incident_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, -) -> Optional[IncidentEventList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, +) -> IncidentEventList | None: """List incident events List incident events @@ -139,9 +135,9 @@ async def asyncio_detailed( incident_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[IncidentEventList]: """List incident events @@ -177,10 +173,10 @@ async def asyncio( incident_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, -) -> Optional[IncidentEventList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, +) -> IncidentEventList | None: """List incident events List incident events diff --git a/rootly_sdk/api/incident_events/update_incident_event.py b/rootly_sdk/api/incident_events/update_incident_event.py index d30cddb0..bc6dd20a 100644 --- a/rootly_sdk/api/incident_events/update_incident_event.py +++ b/rootly_sdk/api/incident_events/update_incident_event.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, IncidentEventResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | IncidentEventResponse | None: if response.status_code == 200: response_200 = IncidentEventResponse.from_dict(response.json()) @@ -51,8 +51,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, IncidentEventResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | IncidentEventResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateIncidentEvent, -) -> Response[Union[ErrorsList, IncidentEventResponse]]: +) -> Response[ErrorsList | IncidentEventResponse]: """Update an incident event Update a specific incident event by id @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateIncidentEvent, -) -> Optional[Union[ErrorsList, IncidentEventResponse]]: +) -> ErrorsList | IncidentEventResponse | None: """Update an incident event Update a specific incident event by id @@ -129,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateIncidentEvent, -) -> Response[Union[ErrorsList, IncidentEventResponse]]: +) -> Response[ErrorsList | IncidentEventResponse]: """Update an incident event Update a specific incident event by id @@ -161,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateIncidentEvent, -) -> Optional[Union[ErrorsList, IncidentEventResponse]]: +) -> ErrorsList | IncidentEventResponse | None: """Update an incident event Update a specific incident event by id diff --git a/rootly_sdk/api/incident_feedbacks/create_incident_feedback.py b/rootly_sdk/api/incident_feedbacks/create_incident_feedback.py index 1cbb51ee..6b3767bd 100644 --- a/rootly_sdk/api/incident_feedbacks/create_incident_feedback.py +++ b/rootly_sdk/api/incident_feedbacks/create_incident_feedback.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, IncidentFeedbackResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | IncidentFeedbackResponse | None: if response.status_code == 201: response_201 = IncidentFeedbackResponse.from_dict(response.json()) @@ -56,8 +56,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, IncidentFeedbackResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | IncidentFeedbackResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -71,7 +71,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewIncidentFeedback, -) -> Response[Union[ErrorsList, IncidentFeedbackResponse]]: +) -> Response[ErrorsList | IncidentFeedbackResponse]: """Creates an incident feedback Creates a new feedback from provided data @@ -105,7 +105,7 @@ def sync( *, client: AuthenticatedClient, body: NewIncidentFeedback, -) -> Optional[Union[ErrorsList, IncidentFeedbackResponse]]: +) -> ErrorsList | IncidentFeedbackResponse | None: """Creates an incident feedback Creates a new feedback from provided data @@ -134,7 +134,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewIncidentFeedback, -) -> Response[Union[ErrorsList, IncidentFeedbackResponse]]: +) -> Response[ErrorsList | IncidentFeedbackResponse]: """Creates an incident feedback Creates a new feedback from provided data @@ -166,7 +166,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewIncidentFeedback, -) -> Optional[Union[ErrorsList, IncidentFeedbackResponse]]: +) -> ErrorsList | IncidentFeedbackResponse | None: """Creates an incident feedback Creates a new feedback from provided data diff --git a/rootly_sdk/api/incident_feedbacks/get_incident_feedbacks.py b/rootly_sdk/api/incident_feedbacks/get_incident_feedbacks.py index 2158a77c..8e53814d 100644 --- a/rootly_sdk/api/incident_feedbacks/get_incident_feedbacks.py +++ b/rootly_sdk/api/incident_feedbacks/get_incident_feedbacks.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, IncidentFeedbackResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | IncidentFeedbackResponse | None: if response.status_code == 200: response_200 = IncidentFeedbackResponse.from_dict(response.json()) @@ -41,8 +41,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, IncidentFeedbackResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | IncidentFeedbackResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -55,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, IncidentFeedbackResponse]]: +) -> Response[ErrorsList | IncidentFeedbackResponse]: """Retrieves an incident feedback Retrieves a specific incident_feedback by id @@ -86,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, IncidentFeedbackResponse]]: +) -> ErrorsList | IncidentFeedbackResponse | None: """Retrieves an incident feedback Retrieves a specific incident_feedback by id @@ -112,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, IncidentFeedbackResponse]]: +) -> Response[ErrorsList | IncidentFeedbackResponse]: """Retrieves an incident feedback Retrieves a specific incident_feedback by id @@ -141,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, IncidentFeedbackResponse]]: +) -> ErrorsList | IncidentFeedbackResponse | None: """Retrieves an incident feedback Retrieves a specific incident_feedback by id diff --git a/rootly_sdk/api/incident_feedbacks/list_incident_feedbacks.py b/rootly_sdk/api/incident_feedbacks/list_incident_feedbacks.py index ed523ed2..3efafc21 100644 --- a/rootly_sdk/api/incident_feedbacks/list_incident_feedbacks.py +++ b/rootly_sdk/api/incident_feedbacks/list_incident_feedbacks.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -12,9 +12,9 @@ def _get_kwargs( incident_id: str, *, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -35,9 +35,7 @@ def _get_kwargs( return _kwargs -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[IncidentFeedbackList]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> IncidentFeedbackList | None: if response.status_code == 200: response_200 = IncidentFeedbackList.from_dict(response.json()) @@ -50,7 +48,7 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response + *, client: AuthenticatedClient | Client, response: httpx.Response ) -> Response[IncidentFeedbackList]: return Response( status_code=HTTPStatus(response.status_code), @@ -64,9 +62,9 @@ def sync_detailed( incident_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[IncidentFeedbackList]: """List incident feedbacks @@ -104,10 +102,10 @@ def sync( incident_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, -) -> Optional[IncidentFeedbackList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, +) -> IncidentFeedbackList | None: """List incident feedbacks List incident feedbacks @@ -139,9 +137,9 @@ async def asyncio_detailed( incident_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[IncidentFeedbackList]: """List incident feedbacks @@ -177,10 +175,10 @@ async def asyncio( incident_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, -) -> Optional[IncidentFeedbackList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, +) -> IncidentFeedbackList | None: """List incident feedbacks List incident feedbacks diff --git a/rootly_sdk/api/incident_feedbacks/update_incident_feedback.py b/rootly_sdk/api/incident_feedbacks/update_incident_feedback.py index a07f8db8..e23f16ea 100644 --- a/rootly_sdk/api/incident_feedbacks/update_incident_feedback.py +++ b/rootly_sdk/api/incident_feedbacks/update_incident_feedback.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, IncidentFeedbackResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | IncidentFeedbackResponse | None: if response.status_code == 200: response_200 = IncidentFeedbackResponse.from_dict(response.json()) @@ -51,8 +51,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, IncidentFeedbackResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | IncidentFeedbackResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateIncidentFeedback, -) -> Response[Union[ErrorsList, IncidentFeedbackResponse]]: +) -> Response[ErrorsList | IncidentFeedbackResponse]: """Update an incident feedback Update a specific incident feedback by id @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateIncidentFeedback, -) -> Optional[Union[ErrorsList, IncidentFeedbackResponse]]: +) -> ErrorsList | IncidentFeedbackResponse | None: """Update an incident feedback Update a specific incident feedback by id @@ -129,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateIncidentFeedback, -) -> Response[Union[ErrorsList, IncidentFeedbackResponse]]: +) -> Response[ErrorsList | IncidentFeedbackResponse]: """Update an incident feedback Update a specific incident feedback by id @@ -161,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateIncidentFeedback, -) -> Optional[Union[ErrorsList, IncidentFeedbackResponse]]: +) -> ErrorsList | IncidentFeedbackResponse | None: """Update an incident feedback Update a specific incident feedback by id diff --git a/rootly_sdk/api/incident_form_field_selections/create_incident_form_field_selection.py b/rootly_sdk/api/incident_form_field_selections/create_incident_form_field_selection.py index cb178ab2..acce98af 100644 --- a/rootly_sdk/api/incident_form_field_selections/create_incident_form_field_selection.py +++ b/rootly_sdk/api/incident_form_field_selections/create_incident_form_field_selection.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, IncidentFormFieldSelectionResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | IncidentFormFieldSelectionResponse | None: if response.status_code == 201: response_201 = IncidentFormFieldSelectionResponse.from_dict(response.json()) @@ -56,8 +56,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, IncidentFormFieldSelectionResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | IncidentFormFieldSelectionResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -71,7 +71,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewIncidentFormFieldSelection, -) -> Response[Union[ErrorsList, IncidentFormFieldSelectionResponse]]: +) -> Response[ErrorsList | IncidentFormFieldSelectionResponse]: """Creates an incident form field selection Creates a new incident form field selection from provided data @@ -105,7 +105,7 @@ def sync( *, client: AuthenticatedClient, body: NewIncidentFormFieldSelection, -) -> Optional[Union[ErrorsList, IncidentFormFieldSelectionResponse]]: +) -> ErrorsList | IncidentFormFieldSelectionResponse | None: """Creates an incident form field selection Creates a new incident form field selection from provided data @@ -134,7 +134,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewIncidentFormFieldSelection, -) -> Response[Union[ErrorsList, IncidentFormFieldSelectionResponse]]: +) -> Response[ErrorsList | IncidentFormFieldSelectionResponse]: """Creates an incident form field selection Creates a new incident form field selection from provided data @@ -166,7 +166,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewIncidentFormFieldSelection, -) -> Optional[Union[ErrorsList, IncidentFormFieldSelectionResponse]]: +) -> ErrorsList | IncidentFormFieldSelectionResponse | None: """Creates an incident form field selection Creates a new incident form field selection from provided data diff --git a/rootly_sdk/api/incident_form_field_selections/delete_incident_form_field_selection.py b/rootly_sdk/api/incident_form_field_selections/delete_incident_form_field_selection.py index 99f336db..657ef26a 100644 --- a/rootly_sdk/api/incident_form_field_selections/delete_incident_form_field_selection.py +++ b/rootly_sdk/api/incident_form_field_selections/delete_incident_form_field_selection.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, IncidentFormFieldSelectionResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | IncidentFormFieldSelectionResponse | None: if response.status_code == 200: response_200 = IncidentFormFieldSelectionResponse.from_dict(response.json()) @@ -41,8 +41,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, IncidentFormFieldSelectionResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | IncidentFormFieldSelectionResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -55,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, IncidentFormFieldSelectionResponse]]: +) -> Response[ErrorsList | IncidentFormFieldSelectionResponse]: """Delete an incident form field selection Delete a specific incident form field selection by id @@ -86,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, IncidentFormFieldSelectionResponse]]: +) -> ErrorsList | IncidentFormFieldSelectionResponse | None: """Delete an incident form field selection Delete a specific incident form field selection by id @@ -112,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, IncidentFormFieldSelectionResponse]]: +) -> Response[ErrorsList | IncidentFormFieldSelectionResponse]: """Delete an incident form field selection Delete a specific incident form field selection by id @@ -141,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, IncidentFormFieldSelectionResponse]]: +) -> ErrorsList | IncidentFormFieldSelectionResponse | None: """Delete an incident form field selection Delete a specific incident form field selection by id diff --git a/rootly_sdk/api/incident_form_field_selections/get_incident_form_field_selection.py b/rootly_sdk/api/incident_form_field_selections/get_incident_form_field_selection.py index dec522c8..73f16e1f 100644 --- a/rootly_sdk/api/incident_form_field_selections/get_incident_form_field_selection.py +++ b/rootly_sdk/api/incident_form_field_selections/get_incident_form_field_selection.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, IncidentFormFieldSelectionResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | IncidentFormFieldSelectionResponse | None: if response.status_code == 200: response_200 = IncidentFormFieldSelectionResponse.from_dict(response.json()) @@ -41,8 +41,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, IncidentFormFieldSelectionResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | IncidentFormFieldSelectionResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -55,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, IncidentFormFieldSelectionResponse]]: +) -> Response[ErrorsList | IncidentFormFieldSelectionResponse]: """Retrieves an incident form field selection Retrieves a specific incident form field selection by id @@ -86,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, IncidentFormFieldSelectionResponse]]: +) -> ErrorsList | IncidentFormFieldSelectionResponse | None: """Retrieves an incident form field selection Retrieves a specific incident form field selection by id @@ -112,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, IncidentFormFieldSelectionResponse]]: +) -> Response[ErrorsList | IncidentFormFieldSelectionResponse]: """Retrieves an incident form field selection Retrieves a specific incident form field selection by id @@ -141,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, IncidentFormFieldSelectionResponse]]: +) -> ErrorsList | IncidentFormFieldSelectionResponse | None: """Retrieves an incident form field selection Retrieves a specific incident form field selection by id diff --git a/rootly_sdk/api/incident_form_field_selections/list_incident_form_field_selections.py b/rootly_sdk/api/incident_form_field_selections/list_incident_form_field_selections.py index fecfec73..2cc3ecde 100644 --- a/rootly_sdk/api/incident_form_field_selections/list_incident_form_field_selections.py +++ b/rootly_sdk/api/incident_form_field_selections/list_incident_form_field_selections.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -12,9 +12,9 @@ def _get_kwargs( incident_id: str, *, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -36,8 +36,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[IncidentFormFieldSelectionList]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> IncidentFormFieldSelectionList | None: if response.status_code == 200: response_200 = IncidentFormFieldSelectionList.from_dict(response.json()) @@ -50,7 +50,7 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response + *, client: AuthenticatedClient | Client, response: httpx.Response ) -> Response[IncidentFormFieldSelectionList]: return Response( status_code=HTTPStatus(response.status_code), @@ -64,9 +64,9 @@ def sync_detailed( incident_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[IncidentFormFieldSelectionList]: """List incident form field selections @@ -104,10 +104,10 @@ def sync( incident_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, -) -> Optional[IncidentFormFieldSelectionList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, +) -> IncidentFormFieldSelectionList | None: """List incident form field selections List incident form field selections @@ -139,9 +139,9 @@ async def asyncio_detailed( incident_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[IncidentFormFieldSelectionList]: """List incident form field selections @@ -177,10 +177,10 @@ async def asyncio( incident_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, -) -> Optional[IncidentFormFieldSelectionList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, +) -> IncidentFormFieldSelectionList | None: """List incident form field selections List incident form field selections diff --git a/rootly_sdk/api/incident_form_field_selections/update_incident_form_field_selection.py b/rootly_sdk/api/incident_form_field_selections/update_incident_form_field_selection.py index 9f722097..bf3ff766 100644 --- a/rootly_sdk/api/incident_form_field_selections/update_incident_form_field_selection.py +++ b/rootly_sdk/api/incident_form_field_selections/update_incident_form_field_selection.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, IncidentFormFieldSelectionResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | IncidentFormFieldSelectionResponse | None: if response.status_code == 200: response_200 = IncidentFormFieldSelectionResponse.from_dict(response.json()) @@ -51,8 +51,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, IncidentFormFieldSelectionResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | IncidentFormFieldSelectionResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateIncidentFormFieldSelection, -) -> Response[Union[ErrorsList, IncidentFormFieldSelectionResponse]]: +) -> Response[ErrorsList | IncidentFormFieldSelectionResponse]: """Update an incident form field selection Update a specific incident form field selection by id @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateIncidentFormFieldSelection, -) -> Optional[Union[ErrorsList, IncidentFormFieldSelectionResponse]]: +) -> ErrorsList | IncidentFormFieldSelectionResponse | None: """Update an incident form field selection Update a specific incident form field selection by id @@ -129,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateIncidentFormFieldSelection, -) -> Response[Union[ErrorsList, IncidentFormFieldSelectionResponse]]: +) -> Response[ErrorsList | IncidentFormFieldSelectionResponse]: """Update an incident form field selection Update a specific incident form field selection by id @@ -161,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateIncidentFormFieldSelection, -) -> Optional[Union[ErrorsList, IncidentFormFieldSelectionResponse]]: +) -> ErrorsList | IncidentFormFieldSelectionResponse | None: """Update an incident form field selection Update a specific incident form field selection by id diff --git a/rootly_sdk/api/incident_permission_set_booleans/create_incident_permission_set_boolean.py b/rootly_sdk/api/incident_permission_set_booleans/create_incident_permission_set_boolean.py index 25c20550..5ef2ca88 100644 --- a/rootly_sdk/api/incident_permission_set_booleans/create_incident_permission_set_boolean.py +++ b/rootly_sdk/api/incident_permission_set_booleans/create_incident_permission_set_boolean.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, IncidentPermissionSetBooleanResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | IncidentPermissionSetBooleanResponse | None: if response.status_code == 201: response_201 = IncidentPermissionSetBooleanResponse.from_dict(response.json()) @@ -56,8 +56,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, IncidentPermissionSetBooleanResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | IncidentPermissionSetBooleanResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -71,7 +71,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewIncidentPermissionSetBoolean, -) -> Response[Union[ErrorsList, IncidentPermissionSetBooleanResponse]]: +) -> Response[ErrorsList | IncidentPermissionSetBooleanResponse]: """Creates an incident_permission_set_boolean Creates a new incident_permission_set_boolean from provided data @@ -105,7 +105,7 @@ def sync( *, client: AuthenticatedClient, body: NewIncidentPermissionSetBoolean, -) -> Optional[Union[ErrorsList, IncidentPermissionSetBooleanResponse]]: +) -> ErrorsList | IncidentPermissionSetBooleanResponse | None: """Creates an incident_permission_set_boolean Creates a new incident_permission_set_boolean from provided data @@ -134,7 +134,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewIncidentPermissionSetBoolean, -) -> Response[Union[ErrorsList, IncidentPermissionSetBooleanResponse]]: +) -> Response[ErrorsList | IncidentPermissionSetBooleanResponse]: """Creates an incident_permission_set_boolean Creates a new incident_permission_set_boolean from provided data @@ -166,7 +166,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewIncidentPermissionSetBoolean, -) -> Optional[Union[ErrorsList, IncidentPermissionSetBooleanResponse]]: +) -> ErrorsList | IncidentPermissionSetBooleanResponse | None: """Creates an incident_permission_set_boolean Creates a new incident_permission_set_boolean from provided data diff --git a/rootly_sdk/api/incident_permission_set_booleans/delete_incident_permission_set_boolean.py b/rootly_sdk/api/incident_permission_set_booleans/delete_incident_permission_set_boolean.py index 19d611a9..d9af5506 100644 --- a/rootly_sdk/api/incident_permission_set_booleans/delete_incident_permission_set_boolean.py +++ b/rootly_sdk/api/incident_permission_set_booleans/delete_incident_permission_set_boolean.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, IncidentPermissionSetBooleanResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | IncidentPermissionSetBooleanResponse | None: if response.status_code == 200: response_200 = IncidentPermissionSetBooleanResponse.from_dict(response.json()) @@ -41,8 +41,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, IncidentPermissionSetBooleanResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | IncidentPermissionSetBooleanResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -55,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, IncidentPermissionSetBooleanResponse]]: +) -> Response[ErrorsList | IncidentPermissionSetBooleanResponse]: """Delete an incident_permission_set_boolean Delete a specific incident_permission_set_boolean by id @@ -86,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, IncidentPermissionSetBooleanResponse]]: +) -> ErrorsList | IncidentPermissionSetBooleanResponse | None: """Delete an incident_permission_set_boolean Delete a specific incident_permission_set_boolean by id @@ -112,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, IncidentPermissionSetBooleanResponse]]: +) -> Response[ErrorsList | IncidentPermissionSetBooleanResponse]: """Delete an incident_permission_set_boolean Delete a specific incident_permission_set_boolean by id @@ -141,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, IncidentPermissionSetBooleanResponse]]: +) -> ErrorsList | IncidentPermissionSetBooleanResponse | None: """Delete an incident_permission_set_boolean Delete a specific incident_permission_set_boolean by id diff --git a/rootly_sdk/api/incident_permission_set_booleans/get_incident_permission_set_boolean.py b/rootly_sdk/api/incident_permission_set_booleans/get_incident_permission_set_boolean.py index 832962f2..3d982670 100644 --- a/rootly_sdk/api/incident_permission_set_booleans/get_incident_permission_set_boolean.py +++ b/rootly_sdk/api/incident_permission_set_booleans/get_incident_permission_set_boolean.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, IncidentPermissionSetBooleanResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | IncidentPermissionSetBooleanResponse | None: if response.status_code == 200: response_200 = IncidentPermissionSetBooleanResponse.from_dict(response.json()) @@ -41,8 +41,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, IncidentPermissionSetBooleanResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | IncidentPermissionSetBooleanResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -55,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, IncidentPermissionSetBooleanResponse]]: +) -> Response[ErrorsList | IncidentPermissionSetBooleanResponse]: """Retrieves an incident_permission_set_boolean Retrieves a specific incident_permission_set_boolean by id @@ -86,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, IncidentPermissionSetBooleanResponse]]: +) -> ErrorsList | IncidentPermissionSetBooleanResponse | None: """Retrieves an incident_permission_set_boolean Retrieves a specific incident_permission_set_boolean by id @@ -112,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, IncidentPermissionSetBooleanResponse]]: +) -> Response[ErrorsList | IncidentPermissionSetBooleanResponse]: """Retrieves an incident_permission_set_boolean Retrieves a specific incident_permission_set_boolean by id @@ -141,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, IncidentPermissionSetBooleanResponse]]: +) -> ErrorsList | IncidentPermissionSetBooleanResponse | None: """Retrieves an incident_permission_set_boolean Retrieves a specific incident_permission_set_boolean by id diff --git a/rootly_sdk/api/incident_permission_set_booleans/list_incident_permission_set_booleans.py b/rootly_sdk/api/incident_permission_set_booleans/list_incident_permission_set_booleans.py index 3905738e..19f86eaa 100644 --- a/rootly_sdk/api/incident_permission_set_booleans/list_incident_permission_set_booleans.py +++ b/rootly_sdk/api/incident_permission_set_booleans/list_incident_permission_set_booleans.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -12,15 +12,15 @@ def _get_kwargs( incident_permission_set_id: str, *, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterkind: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterkind: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -54,8 +54,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[IncidentPermissionSetBooleanList]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> IncidentPermissionSetBooleanList | None: if response.status_code == 200: response_200 = IncidentPermissionSetBooleanList.from_dict(response.json()) @@ -68,7 +68,7 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response + *, client: AuthenticatedClient | Client, response: httpx.Response ) -> Response[IncidentPermissionSetBooleanList]: return Response( status_code=HTTPStatus(response.status_code), @@ -82,15 +82,15 @@ def sync_detailed( incident_permission_set_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterkind: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterkind: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[IncidentPermissionSetBooleanList]: """List incident_permission_set_booleans @@ -140,16 +140,16 @@ def sync( incident_permission_set_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterkind: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, -) -> Optional[IncidentPermissionSetBooleanList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterkind: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, +) -> IncidentPermissionSetBooleanList | None: """List incident_permission_set_booleans List incident_permission_set_booleans @@ -193,15 +193,15 @@ async def asyncio_detailed( incident_permission_set_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterkind: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterkind: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[IncidentPermissionSetBooleanList]: """List incident_permission_set_booleans @@ -249,16 +249,16 @@ async def asyncio( incident_permission_set_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterkind: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, -) -> Optional[IncidentPermissionSetBooleanList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterkind: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, +) -> IncidentPermissionSetBooleanList | None: """List incident_permission_set_booleans List incident_permission_set_booleans diff --git a/rootly_sdk/api/incident_permission_set_booleans/update_incident_permission_set_boolean.py b/rootly_sdk/api/incident_permission_set_booleans/update_incident_permission_set_boolean.py index c8c539b6..dfb06a52 100644 --- a/rootly_sdk/api/incident_permission_set_booleans/update_incident_permission_set_boolean.py +++ b/rootly_sdk/api/incident_permission_set_booleans/update_incident_permission_set_boolean.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, IncidentPermissionSetBooleanResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | IncidentPermissionSetBooleanResponse | None: if response.status_code == 200: response_200 = IncidentPermissionSetBooleanResponse.from_dict(response.json()) @@ -51,8 +51,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, IncidentPermissionSetBooleanResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | IncidentPermissionSetBooleanResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateIncidentPermissionSetBoolean, -) -> Response[Union[ErrorsList, IncidentPermissionSetBooleanResponse]]: +) -> Response[ErrorsList | IncidentPermissionSetBooleanResponse]: """Update an incident_permission_set_boolean Update a specific incident_permission_set_boolean by id @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateIncidentPermissionSetBoolean, -) -> Optional[Union[ErrorsList, IncidentPermissionSetBooleanResponse]]: +) -> ErrorsList | IncidentPermissionSetBooleanResponse | None: """Update an incident_permission_set_boolean Update a specific incident_permission_set_boolean by id @@ -129,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateIncidentPermissionSetBoolean, -) -> Response[Union[ErrorsList, IncidentPermissionSetBooleanResponse]]: +) -> Response[ErrorsList | IncidentPermissionSetBooleanResponse]: """Update an incident_permission_set_boolean Update a specific incident_permission_set_boolean by id @@ -161,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateIncidentPermissionSetBoolean, -) -> Optional[Union[ErrorsList, IncidentPermissionSetBooleanResponse]]: +) -> ErrorsList | IncidentPermissionSetBooleanResponse | None: """Update an incident_permission_set_boolean Update a specific incident_permission_set_boolean by id diff --git a/rootly_sdk/api/incident_permission_set_resources/create_incident_permission_set_resource.py b/rootly_sdk/api/incident_permission_set_resources/create_incident_permission_set_resource.py index 7834de08..eed644e9 100644 --- a/rootly_sdk/api/incident_permission_set_resources/create_incident_permission_set_resource.py +++ b/rootly_sdk/api/incident_permission_set_resources/create_incident_permission_set_resource.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, IncidentPermissionSetResourceResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | IncidentPermissionSetResourceResponse | None: if response.status_code == 201: response_201 = IncidentPermissionSetResourceResponse.from_dict(response.json()) @@ -56,8 +56,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, IncidentPermissionSetResourceResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | IncidentPermissionSetResourceResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -71,7 +71,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewIncidentPermissionSetResource, -) -> Response[Union[ErrorsList, IncidentPermissionSetResourceResponse]]: +) -> Response[ErrorsList | IncidentPermissionSetResourceResponse]: """Creates an incident_permission_set_resource Creates a new incident_permission_set_resource from provided data @@ -105,7 +105,7 @@ def sync( *, client: AuthenticatedClient, body: NewIncidentPermissionSetResource, -) -> Optional[Union[ErrorsList, IncidentPermissionSetResourceResponse]]: +) -> ErrorsList | IncidentPermissionSetResourceResponse | None: """Creates an incident_permission_set_resource Creates a new incident_permission_set_resource from provided data @@ -134,7 +134,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewIncidentPermissionSetResource, -) -> Response[Union[ErrorsList, IncidentPermissionSetResourceResponse]]: +) -> Response[ErrorsList | IncidentPermissionSetResourceResponse]: """Creates an incident_permission_set_resource Creates a new incident_permission_set_resource from provided data @@ -166,7 +166,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewIncidentPermissionSetResource, -) -> Optional[Union[ErrorsList, IncidentPermissionSetResourceResponse]]: +) -> ErrorsList | IncidentPermissionSetResourceResponse | None: """Creates an incident_permission_set_resource Creates a new incident_permission_set_resource from provided data diff --git a/rootly_sdk/api/incident_permission_set_resources/delete_incident_permission_set_resource.py b/rootly_sdk/api/incident_permission_set_resources/delete_incident_permission_set_resource.py index 95a1ff9d..509b5486 100644 --- a/rootly_sdk/api/incident_permission_set_resources/delete_incident_permission_set_resource.py +++ b/rootly_sdk/api/incident_permission_set_resources/delete_incident_permission_set_resource.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, IncidentPermissionSetResourceResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | IncidentPermissionSetResourceResponse | None: if response.status_code == 200: response_200 = IncidentPermissionSetResourceResponse.from_dict(response.json()) @@ -41,8 +41,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, IncidentPermissionSetResourceResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | IncidentPermissionSetResourceResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -55,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, IncidentPermissionSetResourceResponse]]: +) -> Response[ErrorsList | IncidentPermissionSetResourceResponse]: """Delete an incident_permission_set_resource Delete a specific incident_permission_set_resource by id @@ -86,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, IncidentPermissionSetResourceResponse]]: +) -> ErrorsList | IncidentPermissionSetResourceResponse | None: """Delete an incident_permission_set_resource Delete a specific incident_permission_set_resource by id @@ -112,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, IncidentPermissionSetResourceResponse]]: +) -> Response[ErrorsList | IncidentPermissionSetResourceResponse]: """Delete an incident_permission_set_resource Delete a specific incident_permission_set_resource by id @@ -141,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, IncidentPermissionSetResourceResponse]]: +) -> ErrorsList | IncidentPermissionSetResourceResponse | None: """Delete an incident_permission_set_resource Delete a specific incident_permission_set_resource by id diff --git a/rootly_sdk/api/incident_permission_set_resources/get_incident_permission_set_resource.py b/rootly_sdk/api/incident_permission_set_resources/get_incident_permission_set_resource.py index 45e2ce20..95a6d9f9 100644 --- a/rootly_sdk/api/incident_permission_set_resources/get_incident_permission_set_resource.py +++ b/rootly_sdk/api/incident_permission_set_resources/get_incident_permission_set_resource.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, IncidentPermissionSetResourceResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | IncidentPermissionSetResourceResponse | None: if response.status_code == 200: response_200 = IncidentPermissionSetResourceResponse.from_dict(response.json()) @@ -41,8 +41,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, IncidentPermissionSetResourceResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | IncidentPermissionSetResourceResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -55,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, IncidentPermissionSetResourceResponse]]: +) -> Response[ErrorsList | IncidentPermissionSetResourceResponse]: """Retrieves an incident_permission_set_resource Retrieves a specific incident_permission_set_resource by id @@ -86,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, IncidentPermissionSetResourceResponse]]: +) -> ErrorsList | IncidentPermissionSetResourceResponse | None: """Retrieves an incident_permission_set_resource Retrieves a specific incident_permission_set_resource by id @@ -112,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, IncidentPermissionSetResourceResponse]]: +) -> Response[ErrorsList | IncidentPermissionSetResourceResponse]: """Retrieves an incident_permission_set_resource Retrieves a specific incident_permission_set_resource by id @@ -141,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, IncidentPermissionSetResourceResponse]]: +) -> ErrorsList | IncidentPermissionSetResourceResponse | None: """Retrieves an incident_permission_set_resource Retrieves a specific incident_permission_set_resource by id diff --git a/rootly_sdk/api/incident_permission_set_resources/list_incident_permission_set_resources.py b/rootly_sdk/api/incident_permission_set_resources/list_incident_permission_set_resources.py index bc553002..d3468228 100644 --- a/rootly_sdk/api/incident_permission_set_resources/list_incident_permission_set_resources.py +++ b/rootly_sdk/api/incident_permission_set_resources/list_incident_permission_set_resources.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -12,15 +12,15 @@ def _get_kwargs( incident_permission_set_id: str, *, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterkind: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterkind: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -54,8 +54,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[IncidentPermissionSetResourceList]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> IncidentPermissionSetResourceList | None: if response.status_code == 200: response_200 = IncidentPermissionSetResourceList.from_dict(response.json()) @@ -68,7 +68,7 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response + *, client: AuthenticatedClient | Client, response: httpx.Response ) -> Response[IncidentPermissionSetResourceList]: return Response( status_code=HTTPStatus(response.status_code), @@ -82,15 +82,15 @@ def sync_detailed( incident_permission_set_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterkind: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterkind: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[IncidentPermissionSetResourceList]: """List incident_permission_set_resources @@ -140,16 +140,16 @@ def sync( incident_permission_set_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterkind: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, -) -> Optional[IncidentPermissionSetResourceList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterkind: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, +) -> IncidentPermissionSetResourceList | None: """List incident_permission_set_resources List incident_permission_set_resources @@ -193,15 +193,15 @@ async def asyncio_detailed( incident_permission_set_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterkind: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterkind: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[IncidentPermissionSetResourceList]: """List incident_permission_set_resources @@ -249,16 +249,16 @@ async def asyncio( incident_permission_set_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterkind: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, -) -> Optional[IncidentPermissionSetResourceList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterkind: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, +) -> IncidentPermissionSetResourceList | None: """List incident_permission_set_resources List incident_permission_set_resources diff --git a/rootly_sdk/api/incident_permission_set_resources/update_incident_permission_set_resource.py b/rootly_sdk/api/incident_permission_set_resources/update_incident_permission_set_resource.py index dd125cbf..836110ab 100644 --- a/rootly_sdk/api/incident_permission_set_resources/update_incident_permission_set_resource.py +++ b/rootly_sdk/api/incident_permission_set_resources/update_incident_permission_set_resource.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, IncidentPermissionSetResourceResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | IncidentPermissionSetResourceResponse | None: if response.status_code == 200: response_200 = IncidentPermissionSetResourceResponse.from_dict(response.json()) @@ -51,8 +51,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, IncidentPermissionSetResourceResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | IncidentPermissionSetResourceResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateIncidentPermissionSetResource, -) -> Response[Union[ErrorsList, IncidentPermissionSetResourceResponse]]: +) -> Response[ErrorsList | IncidentPermissionSetResourceResponse]: """Update an incident_permission_set_resource Update a specific incident_permission_set_resource by id @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateIncidentPermissionSetResource, -) -> Optional[Union[ErrorsList, IncidentPermissionSetResourceResponse]]: +) -> ErrorsList | IncidentPermissionSetResourceResponse | None: """Update an incident_permission_set_resource Update a specific incident_permission_set_resource by id @@ -129,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateIncidentPermissionSetResource, -) -> Response[Union[ErrorsList, IncidentPermissionSetResourceResponse]]: +) -> Response[ErrorsList | IncidentPermissionSetResourceResponse]: """Update an incident_permission_set_resource Update a specific incident_permission_set_resource by id @@ -161,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateIncidentPermissionSetResource, -) -> Optional[Union[ErrorsList, IncidentPermissionSetResourceResponse]]: +) -> ErrorsList | IncidentPermissionSetResourceResponse | None: """Update an incident_permission_set_resource Update a specific incident_permission_set_resource by id diff --git a/rootly_sdk/api/incident_permission_sets/create_incident_permission_set.py b/rootly_sdk/api/incident_permission_sets/create_incident_permission_set.py index 212ff795..3ca7465c 100644 --- a/rootly_sdk/api/incident_permission_sets/create_incident_permission_set.py +++ b/rootly_sdk/api/incident_permission_sets/create_incident_permission_set.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, IncidentPermissionSetResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | IncidentPermissionSetResponse | None: if response.status_code == 201: response_201 = IncidentPermissionSetResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, IncidentPermissionSetResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | IncidentPermissionSetResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +69,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewIncidentPermissionSet, -) -> Response[Union[ErrorsList, IncidentPermissionSetResponse]]: +) -> Response[ErrorsList | IncidentPermissionSetResponse]: """Creates an incident_permission_set Creates a new incident_permission_set from provided data @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: NewIncidentPermissionSet, -) -> Optional[Union[ErrorsList, IncidentPermissionSetResponse]]: +) -> ErrorsList | IncidentPermissionSetResponse | None: """Creates an incident_permission_set Creates a new incident_permission_set from provided data @@ -126,7 +126,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewIncidentPermissionSet, -) -> Response[Union[ErrorsList, IncidentPermissionSetResponse]]: +) -> Response[ErrorsList | IncidentPermissionSetResponse]: """Creates an incident_permission_set Creates a new incident_permission_set from provided data @@ -155,7 +155,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewIncidentPermissionSet, -) -> Optional[Union[ErrorsList, IncidentPermissionSetResponse]]: +) -> ErrorsList | IncidentPermissionSetResponse | None: """Creates an incident_permission_set Creates a new incident_permission_set from provided data diff --git a/rootly_sdk/api/incident_permission_sets/delete_incident_permission_set.py b/rootly_sdk/api/incident_permission_sets/delete_incident_permission_set.py index 49a6f59b..c918492e 100644 --- a/rootly_sdk/api/incident_permission_sets/delete_incident_permission_set.py +++ b/rootly_sdk/api/incident_permission_sets/delete_incident_permission_set.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any from uuid import UUID import httpx @@ -12,7 +12,7 @@ def _get_kwargs( - id: Union[UUID, str], + id: UUID | str, ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "delete", @@ -23,8 +23,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, IncidentPermissionSetResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | IncidentPermissionSetResponse | None: if response.status_code == 200: response_200 = IncidentPermissionSetResponse.from_dict(response.json()) @@ -42,8 +42,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, IncidentPermissionSetResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | IncidentPermissionSetResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -53,10 +53,10 @@ def _build_response( def sync_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, IncidentPermissionSetResponse]]: +) -> Response[ErrorsList | IncidentPermissionSetResponse]: """Delete an incident_permission_set Delete a specific incident_permission_set by id @@ -84,10 +84,10 @@ def sync_detailed( def sync( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, IncidentPermissionSetResponse]]: +) -> ErrorsList | IncidentPermissionSetResponse | None: """Delete an incident_permission_set Delete a specific incident_permission_set by id @@ -110,10 +110,10 @@ def sync( async def asyncio_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, IncidentPermissionSetResponse]]: +) -> Response[ErrorsList | IncidentPermissionSetResponse]: """Delete an incident_permission_set Delete a specific incident_permission_set by id @@ -139,10 +139,10 @@ async def asyncio_detailed( async def asyncio( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, IncidentPermissionSetResponse]]: +) -> ErrorsList | IncidentPermissionSetResponse | None: """Delete an incident_permission_set Delete a specific incident_permission_set by id diff --git a/rootly_sdk/api/incident_permission_sets/get_incident_permission_set.py b/rootly_sdk/api/incident_permission_sets/get_incident_permission_set.py index 4650cc75..b04192d0 100644 --- a/rootly_sdk/api/incident_permission_sets/get_incident_permission_set.py +++ b/rootly_sdk/api/incident_permission_sets/get_incident_permission_set.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any from uuid import UUID import httpx @@ -12,7 +12,7 @@ def _get_kwargs( - id: Union[UUID, str], + id: UUID | str, ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "get", @@ -23,8 +23,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, IncidentPermissionSetResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | IncidentPermissionSetResponse | None: if response.status_code == 200: response_200 = IncidentPermissionSetResponse.from_dict(response.json()) @@ -42,8 +42,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, IncidentPermissionSetResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | IncidentPermissionSetResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -53,10 +53,10 @@ def _build_response( def sync_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, IncidentPermissionSetResponse]]: +) -> Response[ErrorsList | IncidentPermissionSetResponse]: """Retrieves an incident_permission_set Retrieves a specific incident_permission_set by id @@ -84,10 +84,10 @@ def sync_detailed( def sync( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, IncidentPermissionSetResponse]]: +) -> ErrorsList | IncidentPermissionSetResponse | None: """Retrieves an incident_permission_set Retrieves a specific incident_permission_set by id @@ -110,10 +110,10 @@ def sync( async def asyncio_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, IncidentPermissionSetResponse]]: +) -> Response[ErrorsList | IncidentPermissionSetResponse]: """Retrieves an incident_permission_set Retrieves a specific incident_permission_set by id @@ -139,10 +139,10 @@ async def asyncio_detailed( async def asyncio( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, IncidentPermissionSetResponse]]: +) -> ErrorsList | IncidentPermissionSetResponse | None: """Retrieves an incident_permission_set Retrieves a specific incident_permission_set by id diff --git a/rootly_sdk/api/incident_permission_sets/list_incident_permission_sets.py b/rootly_sdk/api/incident_permission_sets/list_incident_permission_sets.py index 184071a3..6d7617d7 100644 --- a/rootly_sdk/api/incident_permission_sets/list_incident_permission_sets.py +++ b/rootly_sdk/api/incident_permission_sets/list_incident_permission_sets.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -11,17 +11,17 @@ def _get_kwargs( *, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -59,8 +59,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[IncidentPermissionSetList]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> IncidentPermissionSetList | None: if response.status_code == 200: response_200 = IncidentPermissionSetList.from_dict(response.json()) @@ -73,7 +73,7 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response + *, client: AuthenticatedClient | Client, response: httpx.Response ) -> Response[IncidentPermissionSetList]: return Response( status_code=HTTPStatus(response.status_code), @@ -86,17 +86,17 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[IncidentPermissionSetList]: """List incident_permission_sets @@ -147,18 +147,18 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, -) -> Optional[IncidentPermissionSetList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, +) -> IncidentPermissionSetList | None: """List incident_permission_sets List incident_permission_sets @@ -203,17 +203,17 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[IncidentPermissionSetList]: """List incident_permission_sets @@ -262,18 +262,18 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, -) -> Optional[IncidentPermissionSetList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, +) -> IncidentPermissionSetList | None: """List incident_permission_sets List incident_permission_sets diff --git a/rootly_sdk/api/incident_permission_sets/update_incident_permission_set.py b/rootly_sdk/api/incident_permission_sets/update_incident_permission_set.py index 206cc135..c3e19cac 100644 --- a/rootly_sdk/api/incident_permission_sets/update_incident_permission_set.py +++ b/rootly_sdk/api/incident_permission_sets/update_incident_permission_set.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any from uuid import UUID import httpx @@ -13,7 +13,7 @@ def _get_kwargs( - id: Union[UUID, str], + id: UUID | str, *, body: UpdateIncidentPermissionSet, ) -> dict[str, Any]: @@ -33,8 +33,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, IncidentPermissionSetResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | IncidentPermissionSetResponse | None: if response.status_code == 200: response_200 = IncidentPermissionSetResponse.from_dict(response.json()) @@ -52,8 +52,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, IncidentPermissionSetResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | IncidentPermissionSetResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -63,11 +63,11 @@ def _build_response( def sync_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdateIncidentPermissionSet, -) -> Response[Union[ErrorsList, IncidentPermissionSetResponse]]: +) -> Response[ErrorsList | IncidentPermissionSetResponse]: """Update an incident_permission_set Update a specific incident_permission_set by id @@ -97,11 +97,11 @@ def sync_detailed( def sync( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdateIncidentPermissionSet, -) -> Optional[Union[ErrorsList, IncidentPermissionSetResponse]]: +) -> ErrorsList | IncidentPermissionSetResponse | None: """Update an incident_permission_set Update a specific incident_permission_set by id @@ -126,11 +126,11 @@ def sync( async def asyncio_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdateIncidentPermissionSet, -) -> Response[Union[ErrorsList, IncidentPermissionSetResponse]]: +) -> Response[ErrorsList | IncidentPermissionSetResponse]: """Update an incident_permission_set Update a specific incident_permission_set by id @@ -158,11 +158,11 @@ async def asyncio_detailed( async def asyncio( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdateIncidentPermissionSet, -) -> Optional[Union[ErrorsList, IncidentPermissionSetResponse]]: +) -> ErrorsList | IncidentPermissionSetResponse | None: """Update an incident_permission_set Update a specific incident_permission_set by id diff --git a/rootly_sdk/api/incident_retrospective_steps/get_incident_retrospective_step.py b/rootly_sdk/api/incident_retrospective_steps/get_incident_retrospective_step.py index b9bd386c..f9ea28aa 100644 --- a/rootly_sdk/api/incident_retrospective_steps/get_incident_retrospective_step.py +++ b/rootly_sdk/api/incident_retrospective_steps/get_incident_retrospective_step.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, IncidentRetrospectiveStepResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | IncidentRetrospectiveStepResponse | None: if response.status_code == 200: response_200 = IncidentRetrospectiveStepResponse.from_dict(response.json()) @@ -41,8 +41,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, IncidentRetrospectiveStepResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | IncidentRetrospectiveStepResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -55,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, IncidentRetrospectiveStepResponse]]: +) -> Response[ErrorsList | IncidentRetrospectiveStepResponse]: """Retrieves an incident retrospective step Retrieves a specific incident retrospective step by id @@ -86,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, IncidentRetrospectiveStepResponse]]: +) -> ErrorsList | IncidentRetrospectiveStepResponse | None: """Retrieves an incident retrospective step Retrieves a specific incident retrospective step by id @@ -112,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, IncidentRetrospectiveStepResponse]]: +) -> Response[ErrorsList | IncidentRetrospectiveStepResponse]: """Retrieves an incident retrospective step Retrieves a specific incident retrospective step by id @@ -141,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, IncidentRetrospectiveStepResponse]]: +) -> ErrorsList | IncidentRetrospectiveStepResponse | None: """Retrieves an incident retrospective step Retrieves a specific incident retrospective step by id diff --git a/rootly_sdk/api/incident_retrospective_steps/update_incident_retrospective_step.py b/rootly_sdk/api/incident_retrospective_steps/update_incident_retrospective_step.py index 4eb42fe9..12aec1a9 100644 --- a/rootly_sdk/api/incident_retrospective_steps/update_incident_retrospective_step.py +++ b/rootly_sdk/api/incident_retrospective_steps/update_incident_retrospective_step.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, IncidentRetrospectiveStepResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | IncidentRetrospectiveStepResponse | None: if response.status_code == 200: response_200 = IncidentRetrospectiveStepResponse.from_dict(response.json()) @@ -51,8 +51,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, IncidentRetrospectiveStepResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | IncidentRetrospectiveStepResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateIncidentRetrospectiveStep, -) -> Response[Union[ErrorsList, IncidentRetrospectiveStepResponse]]: +) -> Response[ErrorsList | IncidentRetrospectiveStepResponse]: """Update an incident retrospective step Update a specific incident retrospective step by id @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateIncidentRetrospectiveStep, -) -> Optional[Union[ErrorsList, IncidentRetrospectiveStepResponse]]: +) -> ErrorsList | IncidentRetrospectiveStepResponse | None: """Update an incident retrospective step Update a specific incident retrospective step by id @@ -129,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateIncidentRetrospectiveStep, -) -> Response[Union[ErrorsList, IncidentRetrospectiveStepResponse]]: +) -> Response[ErrorsList | IncidentRetrospectiveStepResponse]: """Update an incident retrospective step Update a specific incident retrospective step by id @@ -161,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateIncidentRetrospectiveStep, -) -> Optional[Union[ErrorsList, IncidentRetrospectiveStepResponse]]: +) -> ErrorsList | IncidentRetrospectiveStepResponse | None: """Update an incident retrospective step Update a specific incident retrospective step by id diff --git a/rootly_sdk/api/incident_retrospectives/list_incident_post_mortems.py b/rootly_sdk/api/incident_retrospectives/list_incident_post_mortems.py index 2f45f6d0..8aa4c16c 100644 --- a/rootly_sdk/api/incident_retrospectives/list_incident_post_mortems.py +++ b/rootly_sdk/api/incident_retrospectives/list_incident_post_mortems.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -11,43 +11,43 @@ def _get_kwargs( *, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filterstatus: Union[Unset, str] = UNSET, - filterseverity: Union[Unset, str] = UNSET, - filtertype: Union[Unset, str] = UNSET, - filteruser_id: Union[Unset, int] = UNSET, - filtertypes: Union[Unset, str] = UNSET, - filtertype_ids: Union[Unset, str] = UNSET, - filterenvironments: Union[Unset, str] = UNSET, - filterenvironment_ids: Union[Unset, str] = UNSET, - filterfunctionalities: Union[Unset, str] = UNSET, - filterfunctionality_ids: Union[Unset, str] = UNSET, - filterservices: Union[Unset, str] = UNSET, - filterservice_ids: Union[Unset, str] = UNSET, - filterteams: Union[Unset, str] = UNSET, - filterteam_ids: Union[Unset, str] = UNSET, - filtercauses: Union[Unset, str] = UNSET, - filtercause_ids: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filterstarted_atgt: Union[Unset, str] = UNSET, - filterstarted_atgte: Union[Unset, str] = UNSET, - filterstarted_atlt: Union[Unset, str] = UNSET, - filterstarted_atlte: Union[Unset, str] = UNSET, - filtermitigated_atgt: Union[Unset, str] = UNSET, - filtermitigated_atgte: Union[Unset, str] = UNSET, - filtermitigated_atlt: Union[Unset, str] = UNSET, - filtermitigated_atlte: Union[Unset, str] = UNSET, - filterresolved_atgt: Union[Unset, str] = UNSET, - filterresolved_atgte: Union[Unset, str] = UNSET, - filterresolved_atlt: Union[Unset, str] = UNSET, - filterresolved_atlte: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterstatus: Unset | str = UNSET, + filterseverity: Unset | str = UNSET, + filtertype: Unset | str = UNSET, + filteruser_id: Unset | int = UNSET, + filtertypes: Unset | str = UNSET, + filtertype_ids: Unset | str = UNSET, + filterenvironments: Unset | str = UNSET, + filterenvironment_ids: Unset | str = UNSET, + filterfunctionalities: Unset | str = UNSET, + filterfunctionality_ids: Unset | str = UNSET, + filterservices: Unset | str = UNSET, + filterservice_ids: Unset | str = UNSET, + filterteams: Unset | str = UNSET, + filterteam_ids: Unset | str = UNSET, + filtercauses: Unset | str = UNSET, + filtercause_ids: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterstarted_atgt: Unset | str = UNSET, + filterstarted_atgte: Unset | str = UNSET, + filterstarted_atlt: Unset | str = UNSET, + filterstarted_atlte: Unset | str = UNSET, + filtermitigated_atgt: Unset | str = UNSET, + filtermitigated_atgte: Unset | str = UNSET, + filtermitigated_atlt: Unset | str = UNSET, + filtermitigated_atlte: Unset | str = UNSET, + filterresolved_atgt: Unset | str = UNSET, + filterresolved_atgte: Unset | str = UNSET, + filterresolved_atlt: Unset | str = UNSET, + filterresolved_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -136,9 +136,7 @@ def _get_kwargs( return _kwargs -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[IncidentPostMortemList]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> IncidentPostMortemList | None: if response.status_code == 200: response_200 = IncidentPostMortemList.from_dict(response.json()) @@ -151,7 +149,7 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response + *, client: AuthenticatedClient | Client, response: httpx.Response ) -> Response[IncidentPostMortemList]: return Response( status_code=HTTPStatus(response.status_code), @@ -164,43 +162,43 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filterstatus: Union[Unset, str] = UNSET, - filterseverity: Union[Unset, str] = UNSET, - filtertype: Union[Unset, str] = UNSET, - filteruser_id: Union[Unset, int] = UNSET, - filtertypes: Union[Unset, str] = UNSET, - filtertype_ids: Union[Unset, str] = UNSET, - filterenvironments: Union[Unset, str] = UNSET, - filterenvironment_ids: Union[Unset, str] = UNSET, - filterfunctionalities: Union[Unset, str] = UNSET, - filterfunctionality_ids: Union[Unset, str] = UNSET, - filterservices: Union[Unset, str] = UNSET, - filterservice_ids: Union[Unset, str] = UNSET, - filterteams: Union[Unset, str] = UNSET, - filterteam_ids: Union[Unset, str] = UNSET, - filtercauses: Union[Unset, str] = UNSET, - filtercause_ids: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filterstarted_atgt: Union[Unset, str] = UNSET, - filterstarted_atgte: Union[Unset, str] = UNSET, - filterstarted_atlt: Union[Unset, str] = UNSET, - filterstarted_atlte: Union[Unset, str] = UNSET, - filtermitigated_atgt: Union[Unset, str] = UNSET, - filtermitigated_atgte: Union[Unset, str] = UNSET, - filtermitigated_atlt: Union[Unset, str] = UNSET, - filtermitigated_atlte: Union[Unset, str] = UNSET, - filterresolved_atgt: Union[Unset, str] = UNSET, - filterresolved_atgte: Union[Unset, str] = UNSET, - filterresolved_atlt: Union[Unset, str] = UNSET, - filterresolved_atlte: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterstatus: Unset | str = UNSET, + filterseverity: Unset | str = UNSET, + filtertype: Unset | str = UNSET, + filteruser_id: Unset | int = UNSET, + filtertypes: Unset | str = UNSET, + filtertype_ids: Unset | str = UNSET, + filterenvironments: Unset | str = UNSET, + filterenvironment_ids: Unset | str = UNSET, + filterfunctionalities: Unset | str = UNSET, + filterfunctionality_ids: Unset | str = UNSET, + filterservices: Unset | str = UNSET, + filterservice_ids: Unset | str = UNSET, + filterteams: Unset | str = UNSET, + filterteam_ids: Unset | str = UNSET, + filtercauses: Unset | str = UNSET, + filtercause_ids: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterstarted_atgt: Unset | str = UNSET, + filterstarted_atgte: Unset | str = UNSET, + filterstarted_atlt: Unset | str = UNSET, + filterstarted_atlte: Unset | str = UNSET, + filtermitigated_atgt: Unset | str = UNSET, + filtermitigated_atgte: Unset | str = UNSET, + filtermitigated_atlt: Unset | str = UNSET, + filtermitigated_atlte: Unset | str = UNSET, + filterresolved_atgt: Unset | str = UNSET, + filterresolved_atgte: Unset | str = UNSET, + filterresolved_atlt: Unset | str = UNSET, + filterresolved_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[IncidentPostMortemList]: """List incident retrospectives @@ -303,44 +301,44 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filterstatus: Union[Unset, str] = UNSET, - filterseverity: Union[Unset, str] = UNSET, - filtertype: Union[Unset, str] = UNSET, - filteruser_id: Union[Unset, int] = UNSET, - filtertypes: Union[Unset, str] = UNSET, - filtertype_ids: Union[Unset, str] = UNSET, - filterenvironments: Union[Unset, str] = UNSET, - filterenvironment_ids: Union[Unset, str] = UNSET, - filterfunctionalities: Union[Unset, str] = UNSET, - filterfunctionality_ids: Union[Unset, str] = UNSET, - filterservices: Union[Unset, str] = UNSET, - filterservice_ids: Union[Unset, str] = UNSET, - filterteams: Union[Unset, str] = UNSET, - filterteam_ids: Union[Unset, str] = UNSET, - filtercauses: Union[Unset, str] = UNSET, - filtercause_ids: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filterstarted_atgt: Union[Unset, str] = UNSET, - filterstarted_atgte: Union[Unset, str] = UNSET, - filterstarted_atlt: Union[Unset, str] = UNSET, - filterstarted_atlte: Union[Unset, str] = UNSET, - filtermitigated_atgt: Union[Unset, str] = UNSET, - filtermitigated_atgte: Union[Unset, str] = UNSET, - filtermitigated_atlt: Union[Unset, str] = UNSET, - filtermitigated_atlte: Union[Unset, str] = UNSET, - filterresolved_atgt: Union[Unset, str] = UNSET, - filterresolved_atgte: Union[Unset, str] = UNSET, - filterresolved_atlt: Union[Unset, str] = UNSET, - filterresolved_atlte: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, -) -> Optional[IncidentPostMortemList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterstatus: Unset | str = UNSET, + filterseverity: Unset | str = UNSET, + filtertype: Unset | str = UNSET, + filteruser_id: Unset | int = UNSET, + filtertypes: Unset | str = UNSET, + filtertype_ids: Unset | str = UNSET, + filterenvironments: Unset | str = UNSET, + filterenvironment_ids: Unset | str = UNSET, + filterfunctionalities: Unset | str = UNSET, + filterfunctionality_ids: Unset | str = UNSET, + filterservices: Unset | str = UNSET, + filterservice_ids: Unset | str = UNSET, + filterteams: Unset | str = UNSET, + filterteam_ids: Unset | str = UNSET, + filtercauses: Unset | str = UNSET, + filtercause_ids: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterstarted_atgt: Unset | str = UNSET, + filterstarted_atgte: Unset | str = UNSET, + filterstarted_atlt: Unset | str = UNSET, + filterstarted_atlte: Unset | str = UNSET, + filtermitigated_atgt: Unset | str = UNSET, + filtermitigated_atgte: Unset | str = UNSET, + filtermitigated_atlt: Unset | str = UNSET, + filtermitigated_atlte: Unset | str = UNSET, + filterresolved_atgt: Unset | str = UNSET, + filterresolved_atgte: Unset | str = UNSET, + filterresolved_atlt: Unset | str = UNSET, + filterresolved_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, +) -> IncidentPostMortemList | None: """List incident retrospectives List incident retrospectives @@ -437,43 +435,43 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filterstatus: Union[Unset, str] = UNSET, - filterseverity: Union[Unset, str] = UNSET, - filtertype: Union[Unset, str] = UNSET, - filteruser_id: Union[Unset, int] = UNSET, - filtertypes: Union[Unset, str] = UNSET, - filtertype_ids: Union[Unset, str] = UNSET, - filterenvironments: Union[Unset, str] = UNSET, - filterenvironment_ids: Union[Unset, str] = UNSET, - filterfunctionalities: Union[Unset, str] = UNSET, - filterfunctionality_ids: Union[Unset, str] = UNSET, - filterservices: Union[Unset, str] = UNSET, - filterservice_ids: Union[Unset, str] = UNSET, - filterteams: Union[Unset, str] = UNSET, - filterteam_ids: Union[Unset, str] = UNSET, - filtercauses: Union[Unset, str] = UNSET, - filtercause_ids: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filterstarted_atgt: Union[Unset, str] = UNSET, - filterstarted_atgte: Union[Unset, str] = UNSET, - filterstarted_atlt: Union[Unset, str] = UNSET, - filterstarted_atlte: Union[Unset, str] = UNSET, - filtermitigated_atgt: Union[Unset, str] = UNSET, - filtermitigated_atgte: Union[Unset, str] = UNSET, - filtermitigated_atlt: Union[Unset, str] = UNSET, - filtermitigated_atlte: Union[Unset, str] = UNSET, - filterresolved_atgt: Union[Unset, str] = UNSET, - filterresolved_atgte: Union[Unset, str] = UNSET, - filterresolved_atlt: Union[Unset, str] = UNSET, - filterresolved_atlte: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterstatus: Unset | str = UNSET, + filterseverity: Unset | str = UNSET, + filtertype: Unset | str = UNSET, + filteruser_id: Unset | int = UNSET, + filtertypes: Unset | str = UNSET, + filtertype_ids: Unset | str = UNSET, + filterenvironments: Unset | str = UNSET, + filterenvironment_ids: Unset | str = UNSET, + filterfunctionalities: Unset | str = UNSET, + filterfunctionality_ids: Unset | str = UNSET, + filterservices: Unset | str = UNSET, + filterservice_ids: Unset | str = UNSET, + filterteams: Unset | str = UNSET, + filterteam_ids: Unset | str = UNSET, + filtercauses: Unset | str = UNSET, + filtercause_ids: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterstarted_atgt: Unset | str = UNSET, + filterstarted_atgte: Unset | str = UNSET, + filterstarted_atlt: Unset | str = UNSET, + filterstarted_atlte: Unset | str = UNSET, + filtermitigated_atgt: Unset | str = UNSET, + filtermitigated_atgte: Unset | str = UNSET, + filtermitigated_atlt: Unset | str = UNSET, + filtermitigated_atlte: Unset | str = UNSET, + filterresolved_atgt: Unset | str = UNSET, + filterresolved_atgte: Unset | str = UNSET, + filterresolved_atlt: Unset | str = UNSET, + filterresolved_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[IncidentPostMortemList]: """List incident retrospectives @@ -574,44 +572,44 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filterstatus: Union[Unset, str] = UNSET, - filterseverity: Union[Unset, str] = UNSET, - filtertype: Union[Unset, str] = UNSET, - filteruser_id: Union[Unset, int] = UNSET, - filtertypes: Union[Unset, str] = UNSET, - filtertype_ids: Union[Unset, str] = UNSET, - filterenvironments: Union[Unset, str] = UNSET, - filterenvironment_ids: Union[Unset, str] = UNSET, - filterfunctionalities: Union[Unset, str] = UNSET, - filterfunctionality_ids: Union[Unset, str] = UNSET, - filterservices: Union[Unset, str] = UNSET, - filterservice_ids: Union[Unset, str] = UNSET, - filterteams: Union[Unset, str] = UNSET, - filterteam_ids: Union[Unset, str] = UNSET, - filtercauses: Union[Unset, str] = UNSET, - filtercause_ids: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filterstarted_atgt: Union[Unset, str] = UNSET, - filterstarted_atgte: Union[Unset, str] = UNSET, - filterstarted_atlt: Union[Unset, str] = UNSET, - filterstarted_atlte: Union[Unset, str] = UNSET, - filtermitigated_atgt: Union[Unset, str] = UNSET, - filtermitigated_atgte: Union[Unset, str] = UNSET, - filtermitigated_atlt: Union[Unset, str] = UNSET, - filtermitigated_atlte: Union[Unset, str] = UNSET, - filterresolved_atgt: Union[Unset, str] = UNSET, - filterresolved_atgte: Union[Unset, str] = UNSET, - filterresolved_atlt: Union[Unset, str] = UNSET, - filterresolved_atlte: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, -) -> Optional[IncidentPostMortemList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterstatus: Unset | str = UNSET, + filterseverity: Unset | str = UNSET, + filtertype: Unset | str = UNSET, + filteruser_id: Unset | int = UNSET, + filtertypes: Unset | str = UNSET, + filtertype_ids: Unset | str = UNSET, + filterenvironments: Unset | str = UNSET, + filterenvironment_ids: Unset | str = UNSET, + filterfunctionalities: Unset | str = UNSET, + filterfunctionality_ids: Unset | str = UNSET, + filterservices: Unset | str = UNSET, + filterservice_ids: Unset | str = UNSET, + filterteams: Unset | str = UNSET, + filterteam_ids: Unset | str = UNSET, + filtercauses: Unset | str = UNSET, + filtercause_ids: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterstarted_atgt: Unset | str = UNSET, + filterstarted_atgte: Unset | str = UNSET, + filterstarted_atlt: Unset | str = UNSET, + filterstarted_atlte: Unset | str = UNSET, + filtermitigated_atgt: Unset | str = UNSET, + filtermitigated_atgte: Unset | str = UNSET, + filtermitigated_atlt: Unset | str = UNSET, + filtermitigated_atlte: Unset | str = UNSET, + filterresolved_atgt: Unset | str = UNSET, + filterresolved_atgte: Unset | str = UNSET, + filterresolved_atlt: Unset | str = UNSET, + filterresolved_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, +) -> IncidentPostMortemList | None: """List incident retrospectives List incident retrospectives diff --git a/rootly_sdk/api/incident_retrospectives/list_incident_postmortem.py b/rootly_sdk/api/incident_retrospectives/list_incident_postmortem.py index eea6fc07..44d0276b 100644 --- a/rootly_sdk/api/incident_retrospectives/list_incident_postmortem.py +++ b/rootly_sdk/api/incident_retrospectives/list_incident_postmortem.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any from uuid import UUID import httpx @@ -12,7 +12,7 @@ def _get_kwargs( - id: Union[UUID, str], + id: UUID | str, ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "get", @@ -23,8 +23,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, IncidentPostMortemResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | IncidentPostMortemResponse | None: if response.status_code == 200: response_200 = IncidentPostMortemResponse.from_dict(response.json()) @@ -42,8 +42,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, IncidentPostMortemResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | IncidentPostMortemResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -53,10 +53,10 @@ def _build_response( def sync_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, IncidentPostMortemResponse]]: +) -> Response[ErrorsList | IncidentPostMortemResponse]: """Retrieves an incident retrospective List incidents retrospectives @@ -84,10 +84,10 @@ def sync_detailed( def sync( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, IncidentPostMortemResponse]]: +) -> ErrorsList | IncidentPostMortemResponse | None: """Retrieves an incident retrospective List incidents retrospectives @@ -110,10 +110,10 @@ def sync( async def asyncio_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, IncidentPostMortemResponse]]: +) -> Response[ErrorsList | IncidentPostMortemResponse]: """Retrieves an incident retrospective List incidents retrospectives @@ -139,10 +139,10 @@ async def asyncio_detailed( async def asyncio( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, IncidentPostMortemResponse]]: +) -> ErrorsList | IncidentPostMortemResponse | None: """Retrieves an incident retrospective List incidents retrospectives diff --git a/rootly_sdk/api/incident_retrospectives/update_incident_postmortem.py b/rootly_sdk/api/incident_retrospectives/update_incident_postmortem.py index 42655644..7eb66270 100644 --- a/rootly_sdk/api/incident_retrospectives/update_incident_postmortem.py +++ b/rootly_sdk/api/incident_retrospectives/update_incident_postmortem.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any from uuid import UUID import httpx @@ -13,7 +13,7 @@ def _get_kwargs( - id: Union[UUID, str], + id: UUID | str, *, body: UpdateIncidentPostMortem, ) -> dict[str, Any]: @@ -33,8 +33,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, IncidentPostMortemResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | IncidentPostMortemResponse | None: if response.status_code == 200: response_200 = IncidentPostMortemResponse.from_dict(response.json()) @@ -52,8 +52,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, IncidentPostMortemResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | IncidentPostMortemResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -63,11 +63,11 @@ def _build_response( def sync_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdateIncidentPostMortem, -) -> Response[Union[ErrorsList, IncidentPostMortemResponse]]: +) -> Response[ErrorsList | IncidentPostMortemResponse]: """Update an incident retrospective Update a specific incident retrospective by id @@ -97,11 +97,11 @@ def sync_detailed( def sync( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdateIncidentPostMortem, -) -> Optional[Union[ErrorsList, IncidentPostMortemResponse]]: +) -> ErrorsList | IncidentPostMortemResponse | None: """Update an incident retrospective Update a specific incident retrospective by id @@ -126,11 +126,11 @@ def sync( async def asyncio_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdateIncidentPostMortem, -) -> Response[Union[ErrorsList, IncidentPostMortemResponse]]: +) -> Response[ErrorsList | IncidentPostMortemResponse]: """Update an incident retrospective Update a specific incident retrospective by id @@ -158,11 +158,11 @@ async def asyncio_detailed( async def asyncio( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdateIncidentPostMortem, -) -> Optional[Union[ErrorsList, IncidentPostMortemResponse]]: +) -> ErrorsList | IncidentPostMortemResponse | None: """Update an incident retrospective Update a specific incident retrospective by id diff --git a/rootly_sdk/api/incident_role_tasks/create_incident_role_task.py b/rootly_sdk/api/incident_role_tasks/create_incident_role_task.py index 8bea2ead..855f016c 100644 --- a/rootly_sdk/api/incident_role_tasks/create_incident_role_task.py +++ b/rootly_sdk/api/incident_role_tasks/create_incident_role_task.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, IncidentRoleTaskResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | IncidentRoleTaskResponse | None: if response.status_code == 201: response_201 = IncidentRoleTaskResponse.from_dict(response.json()) @@ -56,8 +56,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, IncidentRoleTaskResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | IncidentRoleTaskResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -71,7 +71,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewIncidentRoleTask, -) -> Response[Union[ErrorsList, IncidentRoleTaskResponse]]: +) -> Response[ErrorsList | IncidentRoleTaskResponse]: """Creates an incident role task Creates a new task from provided data @@ -105,7 +105,7 @@ def sync( *, client: AuthenticatedClient, body: NewIncidentRoleTask, -) -> Optional[Union[ErrorsList, IncidentRoleTaskResponse]]: +) -> ErrorsList | IncidentRoleTaskResponse | None: """Creates an incident role task Creates a new task from provided data @@ -134,7 +134,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewIncidentRoleTask, -) -> Response[Union[ErrorsList, IncidentRoleTaskResponse]]: +) -> Response[ErrorsList | IncidentRoleTaskResponse]: """Creates an incident role task Creates a new task from provided data @@ -166,7 +166,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewIncidentRoleTask, -) -> Optional[Union[ErrorsList, IncidentRoleTaskResponse]]: +) -> ErrorsList | IncidentRoleTaskResponse | None: """Creates an incident role task Creates a new task from provided data diff --git a/rootly_sdk/api/incident_role_tasks/delete_incident_role_task.py b/rootly_sdk/api/incident_role_tasks/delete_incident_role_task.py index 345ed218..9fb114a0 100644 --- a/rootly_sdk/api/incident_role_tasks/delete_incident_role_task.py +++ b/rootly_sdk/api/incident_role_tasks/delete_incident_role_task.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, IncidentRoleTaskResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | IncidentRoleTaskResponse | None: if response.status_code == 200: response_200 = IncidentRoleTaskResponse.from_dict(response.json()) @@ -41,8 +41,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, IncidentRoleTaskResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | IncidentRoleTaskResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -55,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, IncidentRoleTaskResponse]]: +) -> Response[ErrorsList | IncidentRoleTaskResponse]: """Delete an incident role task Delete a specific incident_role task by id @@ -86,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, IncidentRoleTaskResponse]]: +) -> ErrorsList | IncidentRoleTaskResponse | None: """Delete an incident role task Delete a specific incident_role task by id @@ -112,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, IncidentRoleTaskResponse]]: +) -> Response[ErrorsList | IncidentRoleTaskResponse]: """Delete an incident role task Delete a specific incident_role task by id @@ -141,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, IncidentRoleTaskResponse]]: +) -> ErrorsList | IncidentRoleTaskResponse | None: """Delete an incident role task Delete a specific incident_role task by id diff --git a/rootly_sdk/api/incident_role_tasks/get_incident_role_task.py b/rootly_sdk/api/incident_role_tasks/get_incident_role_task.py index b7e3e1ab..76609b7c 100644 --- a/rootly_sdk/api/incident_role_tasks/get_incident_role_task.py +++ b/rootly_sdk/api/incident_role_tasks/get_incident_role_task.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, IncidentRoleTaskResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | IncidentRoleTaskResponse | None: if response.status_code == 200: response_200 = IncidentRoleTaskResponse.from_dict(response.json()) @@ -41,8 +41,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, IncidentRoleTaskResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | IncidentRoleTaskResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -55,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, IncidentRoleTaskResponse]]: +) -> Response[ErrorsList | IncidentRoleTaskResponse]: """Retrieves an incident role task Retrieves a specific incident_role_task by id @@ -86,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, IncidentRoleTaskResponse]]: +) -> ErrorsList | IncidentRoleTaskResponse | None: """Retrieves an incident role task Retrieves a specific incident_role_task by id @@ -112,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, IncidentRoleTaskResponse]]: +) -> Response[ErrorsList | IncidentRoleTaskResponse]: """Retrieves an incident role task Retrieves a specific incident_role_task by id @@ -141,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, IncidentRoleTaskResponse]]: +) -> ErrorsList | IncidentRoleTaskResponse | None: """Retrieves an incident role task Retrieves a specific incident_role_task by id diff --git a/rootly_sdk/api/incident_role_tasks/list_incident_role_tasks.py b/rootly_sdk/api/incident_role_tasks/list_incident_role_tasks.py index cb8fef89..610fa1ef 100644 --- a/rootly_sdk/api/incident_role_tasks/list_incident_role_tasks.py +++ b/rootly_sdk/api/incident_role_tasks/list_incident_role_tasks.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -12,9 +12,9 @@ def _get_kwargs( incident_role_id: str, *, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -35,9 +35,7 @@ def _get_kwargs( return _kwargs -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[IncidentRoleTaskList]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> IncidentRoleTaskList | None: if response.status_code == 200: response_200 = IncidentRoleTaskList.from_dict(response.json()) @@ -50,7 +48,7 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response + *, client: AuthenticatedClient | Client, response: httpx.Response ) -> Response[IncidentRoleTaskList]: return Response( status_code=HTTPStatus(response.status_code), @@ -64,9 +62,9 @@ def sync_detailed( incident_role_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[IncidentRoleTaskList]: """List incident role tasks @@ -104,10 +102,10 @@ def sync( incident_role_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, -) -> Optional[IncidentRoleTaskList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, +) -> IncidentRoleTaskList | None: """List incident role tasks List incident_role tasks @@ -139,9 +137,9 @@ async def asyncio_detailed( incident_role_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[IncidentRoleTaskList]: """List incident role tasks @@ -177,10 +175,10 @@ async def asyncio( incident_role_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, -) -> Optional[IncidentRoleTaskList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, +) -> IncidentRoleTaskList | None: """List incident role tasks List incident_role tasks diff --git a/rootly_sdk/api/incident_role_tasks/update_incident_role_task.py b/rootly_sdk/api/incident_role_tasks/update_incident_role_task.py index 676d3209..0ac5e71f 100644 --- a/rootly_sdk/api/incident_role_tasks/update_incident_role_task.py +++ b/rootly_sdk/api/incident_role_tasks/update_incident_role_task.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, IncidentRoleTaskResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | IncidentRoleTaskResponse | None: if response.status_code == 200: response_200 = IncidentRoleTaskResponse.from_dict(response.json()) @@ -51,8 +51,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, IncidentRoleTaskResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | IncidentRoleTaskResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateIncidentRoleTask, -) -> Response[Union[ErrorsList, IncidentRoleTaskResponse]]: +) -> Response[ErrorsList | IncidentRoleTaskResponse]: """Update an incident role task Update a specific incident_role task by id @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateIncidentRoleTask, -) -> Optional[Union[ErrorsList, IncidentRoleTaskResponse]]: +) -> ErrorsList | IncidentRoleTaskResponse | None: """Update an incident role task Update a specific incident_role task by id @@ -129,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateIncidentRoleTask, -) -> Response[Union[ErrorsList, IncidentRoleTaskResponse]]: +) -> Response[ErrorsList | IncidentRoleTaskResponse]: """Update an incident role task Update a specific incident_role task by id @@ -161,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateIncidentRoleTask, -) -> Optional[Union[ErrorsList, IncidentRoleTaskResponse]]: +) -> ErrorsList | IncidentRoleTaskResponse | None: """Update an incident role task Update a specific incident_role task by id diff --git a/rootly_sdk/api/incident_roles/create_incident_role.py b/rootly_sdk/api/incident_roles/create_incident_role.py index 41318ccc..a3244bb6 100644 --- a/rootly_sdk/api/incident_roles/create_incident_role.py +++ b/rootly_sdk/api/incident_roles/create_incident_role.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, IncidentRoleResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | IncidentRoleResponse | None: if response.status_code == 201: response_201 = IncidentRoleResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, IncidentRoleResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | IncidentRoleResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +69,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewIncidentRole, -) -> Response[Union[ErrorsList, IncidentRoleResponse]]: +) -> Response[ErrorsList | IncidentRoleResponse]: """Creates an incident role Creates a new incident role from provided data @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: NewIncidentRole, -) -> Optional[Union[ErrorsList, IncidentRoleResponse]]: +) -> ErrorsList | IncidentRoleResponse | None: """Creates an incident role Creates a new incident role from provided data @@ -126,7 +126,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewIncidentRole, -) -> Response[Union[ErrorsList, IncidentRoleResponse]]: +) -> Response[ErrorsList | IncidentRoleResponse]: """Creates an incident role Creates a new incident role from provided data @@ -155,7 +155,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewIncidentRole, -) -> Optional[Union[ErrorsList, IncidentRoleResponse]]: +) -> ErrorsList | IncidentRoleResponse | None: """Creates an incident role Creates a new incident role from provided data diff --git a/rootly_sdk/api/incident_roles/delete_incident_role.py b/rootly_sdk/api/incident_roles/delete_incident_role.py index 844c6bc5..36721535 100644 --- a/rootly_sdk/api/incident_roles/delete_incident_role.py +++ b/rootly_sdk/api/incident_roles/delete_incident_role.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any from uuid import UUID import httpx @@ -12,7 +12,7 @@ def _get_kwargs( - id: Union[UUID, str], + id: UUID | str, ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "delete", @@ -23,8 +23,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, IncidentRoleResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | IncidentRoleResponse | None: if response.status_code == 200: response_200 = IncidentRoleResponse.from_dict(response.json()) @@ -42,8 +42,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, IncidentRoleResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | IncidentRoleResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -53,10 +53,10 @@ def _build_response( def sync_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, IncidentRoleResponse]]: +) -> Response[ErrorsList | IncidentRoleResponse]: """Delete an incident role Delete a specific incident_role by id @@ -84,10 +84,10 @@ def sync_detailed( def sync( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, IncidentRoleResponse]]: +) -> ErrorsList | IncidentRoleResponse | None: """Delete an incident role Delete a specific incident_role by id @@ -110,10 +110,10 @@ def sync( async def asyncio_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, IncidentRoleResponse]]: +) -> Response[ErrorsList | IncidentRoleResponse]: """Delete an incident role Delete a specific incident_role by id @@ -139,10 +139,10 @@ async def asyncio_detailed( async def asyncio( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, IncidentRoleResponse]]: +) -> ErrorsList | IncidentRoleResponse | None: """Delete an incident role Delete a specific incident_role by id diff --git a/rootly_sdk/api/incident_roles/get_incident_role.py b/rootly_sdk/api/incident_roles/get_incident_role.py index 2a6513ce..8ec86036 100644 --- a/rootly_sdk/api/incident_roles/get_incident_role.py +++ b/rootly_sdk/api/incident_roles/get_incident_role.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any from uuid import UUID import httpx @@ -12,7 +12,7 @@ def _get_kwargs( - id: Union[UUID, str], + id: UUID | str, ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "get", @@ -23,8 +23,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, IncidentRoleResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | IncidentRoleResponse | None: if response.status_code == 200: response_200 = IncidentRoleResponse.from_dict(response.json()) @@ -42,8 +42,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, IncidentRoleResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | IncidentRoleResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -53,10 +53,10 @@ def _build_response( def sync_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, IncidentRoleResponse]]: +) -> Response[ErrorsList | IncidentRoleResponse]: """Retrieves an incident role Retrieves a specific incident_role by id @@ -84,10 +84,10 @@ def sync_detailed( def sync( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, IncidentRoleResponse]]: +) -> ErrorsList | IncidentRoleResponse | None: """Retrieves an incident role Retrieves a specific incident_role by id @@ -110,10 +110,10 @@ def sync( async def asyncio_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, IncidentRoleResponse]]: +) -> Response[ErrorsList | IncidentRoleResponse]: """Retrieves an incident role Retrieves a specific incident_role by id @@ -139,10 +139,10 @@ async def asyncio_detailed( async def asyncio( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, IncidentRoleResponse]]: +) -> ErrorsList | IncidentRoleResponse | None: """Retrieves an incident role Retrieves a specific incident_role by id diff --git a/rootly_sdk/api/incident_roles/list_incident_roles.py b/rootly_sdk/api/incident_roles/list_incident_roles.py index abd9a583..b3b19baa 100644 --- a/rootly_sdk/api/incident_roles/list_incident_roles.py +++ b/rootly_sdk/api/incident_roles/list_incident_roles.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -11,29 +11,29 @@ def _get_kwargs( *, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterenabled: Union[Unset, bool] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filterslugeq: Union[Unset, str] = UNSET, - filterslugnot_eq: Union[Unset, str] = UNSET, - filterslugin: Union[Unset, str] = UNSET, - filterslugnot_in: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, - filterenabledeq: Union[Unset, str] = UNSET, - filterenablednot_eq: Union[Unset, str] = UNSET, - filterenabledin: Union[Unset, str] = UNSET, - filterenablednot_in: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterenabled: Unset | bool = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filterenabledeq: Unset | str = UNSET, + filterenablednot_eq: Unset | str = UNSET, + filterenabledin: Unset | str = UNSET, + filterenablednot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -94,9 +94,7 @@ def _get_kwargs( return _kwargs -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[IncidentRoleList]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> IncidentRoleList | None: if response.status_code == 200: response_200 = IncidentRoleList.from_dict(response.json()) @@ -108,9 +106,7 @@ def _parse_response( return None -def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[IncidentRoleList]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[IncidentRoleList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -122,29 +118,29 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterenabled: Union[Unset, bool] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filterslugeq: Union[Unset, str] = UNSET, - filterslugnot_eq: Union[Unset, str] = UNSET, - filterslugin: Union[Unset, str] = UNSET, - filterslugnot_in: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, - filterenabledeq: Union[Unset, str] = UNSET, - filterenablednot_eq: Union[Unset, str] = UNSET, - filterenabledin: Union[Unset, str] = UNSET, - filterenablednot_in: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterenabled: Unset | bool = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filterenabledeq: Unset | str = UNSET, + filterenablednot_eq: Unset | str = UNSET, + filterenabledin: Unset | str = UNSET, + filterenablednot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[IncidentRoleList]: """List incident roles @@ -219,30 +215,30 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterenabled: Union[Unset, bool] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filterslugeq: Union[Unset, str] = UNSET, - filterslugnot_eq: Union[Unset, str] = UNSET, - filterslugin: Union[Unset, str] = UNSET, - filterslugnot_in: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, - filterenabledeq: Union[Unset, str] = UNSET, - filterenablednot_eq: Union[Unset, str] = UNSET, - filterenabledin: Union[Unset, str] = UNSET, - filterenablednot_in: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, -) -> Optional[IncidentRoleList]: + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterenabled: Unset | bool = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filterenabledeq: Unset | str = UNSET, + filterenablednot_eq: Unset | str = UNSET, + filterenabledin: Unset | str = UNSET, + filterenablednot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, +) -> IncidentRoleList | None: """List incident roles List incident roles @@ -311,29 +307,29 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterenabled: Union[Unset, bool] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filterslugeq: Union[Unset, str] = UNSET, - filterslugnot_eq: Union[Unset, str] = UNSET, - filterslugin: Union[Unset, str] = UNSET, - filterslugnot_in: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, - filterenabledeq: Union[Unset, str] = UNSET, - filterenablednot_eq: Union[Unset, str] = UNSET, - filterenabledin: Union[Unset, str] = UNSET, - filterenablednot_in: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterenabled: Unset | bool = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filterenabledeq: Unset | str = UNSET, + filterenablednot_eq: Unset | str = UNSET, + filterenabledin: Unset | str = UNSET, + filterenablednot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[IncidentRoleList]: """List incident roles @@ -406,30 +402,30 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterenabled: Union[Unset, bool] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filterslugeq: Union[Unset, str] = UNSET, - filterslugnot_eq: Union[Unset, str] = UNSET, - filterslugin: Union[Unset, str] = UNSET, - filterslugnot_in: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, - filterenabledeq: Union[Unset, str] = UNSET, - filterenablednot_eq: Union[Unset, str] = UNSET, - filterenabledin: Union[Unset, str] = UNSET, - filterenablednot_in: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, -) -> Optional[IncidentRoleList]: + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterenabled: Unset | bool = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filterenabledeq: Unset | str = UNSET, + filterenablednot_eq: Unset | str = UNSET, + filterenabledin: Unset | str = UNSET, + filterenablednot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, +) -> IncidentRoleList | None: """List incident roles List incident roles diff --git a/rootly_sdk/api/incident_roles/update_incident_role.py b/rootly_sdk/api/incident_roles/update_incident_role.py index c379068e..d65d7d9c 100644 --- a/rootly_sdk/api/incident_roles/update_incident_role.py +++ b/rootly_sdk/api/incident_roles/update_incident_role.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any from uuid import UUID import httpx @@ -13,7 +13,7 @@ def _get_kwargs( - id: Union[UUID, str], + id: UUID | str, *, body: UpdateIncidentRole, ) -> dict[str, Any]: @@ -33,8 +33,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, IncidentRoleResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | IncidentRoleResponse | None: if response.status_code == 200: response_200 = IncidentRoleResponse.from_dict(response.json()) @@ -52,8 +52,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, IncidentRoleResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | IncidentRoleResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -63,11 +63,11 @@ def _build_response( def sync_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdateIncidentRole, -) -> Response[Union[ErrorsList, IncidentRoleResponse]]: +) -> Response[ErrorsList | IncidentRoleResponse]: """Update an incident role Update a specific incident_role by id @@ -97,11 +97,11 @@ def sync_detailed( def sync( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdateIncidentRole, -) -> Optional[Union[ErrorsList, IncidentRoleResponse]]: +) -> ErrorsList | IncidentRoleResponse | None: """Update an incident role Update a specific incident_role by id @@ -126,11 +126,11 @@ def sync( async def asyncio_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdateIncidentRole, -) -> Response[Union[ErrorsList, IncidentRoleResponse]]: +) -> Response[ErrorsList | IncidentRoleResponse]: """Update an incident role Update a specific incident_role by id @@ -158,11 +158,11 @@ async def asyncio_detailed( async def asyncio( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdateIncidentRole, -) -> Optional[Union[ErrorsList, IncidentRoleResponse]]: +) -> ErrorsList | IncidentRoleResponse | None: """Update an incident role Update a specific incident_role by id diff --git a/rootly_sdk/api/incident_status_page_events/create_incident_status_page.py b/rootly_sdk/api/incident_status_page_events/create_incident_status_page.py index 859cfe78..f046af4c 100644 --- a/rootly_sdk/api/incident_status_page_events/create_incident_status_page.py +++ b/rootly_sdk/api/incident_status_page_events/create_incident_status_page.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, IncidentStatusPageEventResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | IncidentStatusPageEventResponse | None: if response.status_code == 201: response_201 = IncidentStatusPageEventResponse.from_dict(response.json()) @@ -56,8 +56,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, IncidentStatusPageEventResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | IncidentStatusPageEventResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -71,7 +71,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewIncidentStatusPageEvent, -) -> Response[Union[ErrorsList, IncidentStatusPageEventResponse]]: +) -> Response[ErrorsList | IncidentStatusPageEventResponse]: """Creates an incident status page event Creates a new event from provided data @@ -105,7 +105,7 @@ def sync( *, client: AuthenticatedClient, body: NewIncidentStatusPageEvent, -) -> Optional[Union[ErrorsList, IncidentStatusPageEventResponse]]: +) -> ErrorsList | IncidentStatusPageEventResponse | None: """Creates an incident status page event Creates a new event from provided data @@ -134,7 +134,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewIncidentStatusPageEvent, -) -> Response[Union[ErrorsList, IncidentStatusPageEventResponse]]: +) -> Response[ErrorsList | IncidentStatusPageEventResponse]: """Creates an incident status page event Creates a new event from provided data @@ -166,7 +166,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewIncidentStatusPageEvent, -) -> Optional[Union[ErrorsList, IncidentStatusPageEventResponse]]: +) -> ErrorsList | IncidentStatusPageEventResponse | None: """Creates an incident status page event Creates a new event from provided data diff --git a/rootly_sdk/api/incident_status_page_events/delete_incident_status_page.py b/rootly_sdk/api/incident_status_page_events/delete_incident_status_page.py index 1a1264a8..36058d66 100644 --- a/rootly_sdk/api/incident_status_page_events/delete_incident_status_page.py +++ b/rootly_sdk/api/incident_status_page_events/delete_incident_status_page.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, IncidentStatusPageEventResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | IncidentStatusPageEventResponse | None: if response.status_code == 200: response_200 = IncidentStatusPageEventResponse.from_dict(response.json()) @@ -41,8 +41,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, IncidentStatusPageEventResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | IncidentStatusPageEventResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -55,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, IncidentStatusPageEventResponse]]: +) -> Response[ErrorsList | IncidentStatusPageEventResponse]: """Delete an incident status page event Delete a specific incident status page event by id @@ -86,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, IncidentStatusPageEventResponse]]: +) -> ErrorsList | IncidentStatusPageEventResponse | None: """Delete an incident status page event Delete a specific incident status page event by id @@ -112,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, IncidentStatusPageEventResponse]]: +) -> Response[ErrorsList | IncidentStatusPageEventResponse]: """Delete an incident status page event Delete a specific incident status page event by id @@ -141,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, IncidentStatusPageEventResponse]]: +) -> ErrorsList | IncidentStatusPageEventResponse | None: """Delete an incident status page event Delete a specific incident status page event by id diff --git a/rootly_sdk/api/incident_status_page_events/get_incident_status_pages.py b/rootly_sdk/api/incident_status_page_events/get_incident_status_pages.py index ab178a36..eb52a159 100644 --- a/rootly_sdk/api/incident_status_page_events/get_incident_status_pages.py +++ b/rootly_sdk/api/incident_status_page_events/get_incident_status_pages.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, IncidentStatusPageEventResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | IncidentStatusPageEventResponse | None: if response.status_code == 200: response_200 = IncidentStatusPageEventResponse.from_dict(response.json()) @@ -41,8 +41,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, IncidentStatusPageEventResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | IncidentStatusPageEventResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -55,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, IncidentStatusPageEventResponse]]: +) -> Response[ErrorsList | IncidentStatusPageEventResponse]: """Retrieves an incident status page event Retrieves a specific incident_status_page_event by id @@ -86,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, IncidentStatusPageEventResponse]]: +) -> ErrorsList | IncidentStatusPageEventResponse | None: """Retrieves an incident status page event Retrieves a specific incident_status_page_event by id @@ -112,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, IncidentStatusPageEventResponse]]: +) -> Response[ErrorsList | IncidentStatusPageEventResponse]: """Retrieves an incident status page event Retrieves a specific incident_status_page_event by id @@ -141,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, IncidentStatusPageEventResponse]]: +) -> ErrorsList | IncidentStatusPageEventResponse | None: """Retrieves an incident status page event Retrieves a specific incident_status_page_event by id diff --git a/rootly_sdk/api/incident_status_page_events/list_incident_status_pages.py b/rootly_sdk/api/incident_status_page_events/list_incident_status_pages.py index 7b1881b0..104d288b 100644 --- a/rootly_sdk/api/incident_status_page_events/list_incident_status_pages.py +++ b/rootly_sdk/api/incident_status_page_events/list_incident_status_pages.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -12,9 +12,9 @@ def _get_kwargs( incident_id: str, *, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -36,8 +36,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[IncidentStatusPageEventList]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> IncidentStatusPageEventList | None: if response.status_code == 200: response_200 = IncidentStatusPageEventList.from_dict(response.json()) @@ -50,7 +50,7 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response + *, client: AuthenticatedClient | Client, response: httpx.Response ) -> Response[IncidentStatusPageEventList]: return Response( status_code=HTTPStatus(response.status_code), @@ -64,9 +64,9 @@ def sync_detailed( incident_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[IncidentStatusPageEventList]: """List incident status page events @@ -104,10 +104,10 @@ def sync( incident_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, -) -> Optional[IncidentStatusPageEventList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, +) -> IncidentStatusPageEventList | None: """List incident status page events List incident status page events @@ -139,9 +139,9 @@ async def asyncio_detailed( incident_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[IncidentStatusPageEventList]: """List incident status page events @@ -177,10 +177,10 @@ async def asyncio( incident_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, -) -> Optional[IncidentStatusPageEventList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, +) -> IncidentStatusPageEventList | None: """List incident status page events List incident status page events diff --git a/rootly_sdk/api/incident_status_page_events/update_incident_status_page.py b/rootly_sdk/api/incident_status_page_events/update_incident_status_page.py index a1bb222f..6b544116 100644 --- a/rootly_sdk/api/incident_status_page_events/update_incident_status_page.py +++ b/rootly_sdk/api/incident_status_page_events/update_incident_status_page.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, IncidentStatusPageEventResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | IncidentStatusPageEventResponse | None: if response.status_code == 200: response_200 = IncidentStatusPageEventResponse.from_dict(response.json()) @@ -51,8 +51,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, IncidentStatusPageEventResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | IncidentStatusPageEventResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateIncidentStatusPageEvent, -) -> Response[Union[ErrorsList, IncidentStatusPageEventResponse]]: +) -> Response[ErrorsList | IncidentStatusPageEventResponse]: """Update an incident status page event Update a specific incident status page event by id @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateIncidentStatusPageEvent, -) -> Optional[Union[ErrorsList, IncidentStatusPageEventResponse]]: +) -> ErrorsList | IncidentStatusPageEventResponse | None: """Update an incident status page event Update a specific incident status page event by id @@ -129,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateIncidentStatusPageEvent, -) -> Response[Union[ErrorsList, IncidentStatusPageEventResponse]]: +) -> Response[ErrorsList | IncidentStatusPageEventResponse]: """Update an incident status page event Update a specific incident status page event by id @@ -161,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateIncidentStatusPageEvent, -) -> Optional[Union[ErrorsList, IncidentStatusPageEventResponse]]: +) -> ErrorsList | IncidentStatusPageEventResponse | None: """Update an incident status page event Update a specific incident status page event by id diff --git a/rootly_sdk/api/incident_sub_statuses/create_incident_sub_status.py b/rootly_sdk/api/incident_sub_statuses/create_incident_sub_status.py index 1d1611f4..eff7cccb 100644 --- a/rootly_sdk/api/incident_sub_statuses/create_incident_sub_status.py +++ b/rootly_sdk/api/incident_sub_statuses/create_incident_sub_status.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, IncidentSubStatusResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | IncidentSubStatusResponse | None: if response.status_code == 201: response_201 = IncidentSubStatusResponse.from_dict(response.json()) @@ -51,8 +51,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, IncidentSubStatusResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | IncidentSubStatusResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewIncidentSubStatus, -) -> Response[Union[ErrorsList, IncidentSubStatusResponse]]: +) -> Response[ErrorsList | IncidentSubStatusResponse]: """Creates a sub-status assignment Creates a new sub-status assignment from provided data @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: NewIncidentSubStatus, -) -> Optional[Union[ErrorsList, IncidentSubStatusResponse]]: +) -> ErrorsList | IncidentSubStatusResponse | None: """Creates a sub-status assignment Creates a new sub-status assignment from provided data @@ -129,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewIncidentSubStatus, -) -> Response[Union[ErrorsList, IncidentSubStatusResponse]]: +) -> Response[ErrorsList | IncidentSubStatusResponse]: """Creates a sub-status assignment Creates a new sub-status assignment from provided data @@ -161,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewIncidentSubStatus, -) -> Optional[Union[ErrorsList, IncidentSubStatusResponse]]: +) -> ErrorsList | IncidentSubStatusResponse | None: """Creates a sub-status assignment Creates a new sub-status assignment from provided data diff --git a/rootly_sdk/api/incident_sub_statuses/delete_incident_sub_status.py b/rootly_sdk/api/incident_sub_statuses/delete_incident_sub_status.py index bd3ab981..a0050da0 100644 --- a/rootly_sdk/api/incident_sub_statuses/delete_incident_sub_status.py +++ b/rootly_sdk/api/incident_sub_statuses/delete_incident_sub_status.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, IncidentSubStatusResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | IncidentSubStatusResponse | None: if response.status_code == 200: response_200 = IncidentSubStatusResponse.from_dict(response.json()) @@ -41,8 +41,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, IncidentSubStatusResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | IncidentSubStatusResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -55,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, IncidentSubStatusResponse]]: +) -> Response[ErrorsList | IncidentSubStatusResponse]: """Delete an incident_sub_status Delete a specific incident_sub_status by id @@ -86,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, IncidentSubStatusResponse]]: +) -> ErrorsList | IncidentSubStatusResponse | None: """Delete an incident_sub_status Delete a specific incident_sub_status by id @@ -112,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, IncidentSubStatusResponse]]: +) -> Response[ErrorsList | IncidentSubStatusResponse]: """Delete an incident_sub_status Delete a specific incident_sub_status by id @@ -141,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, IncidentSubStatusResponse]]: +) -> ErrorsList | IncidentSubStatusResponse | None: """Delete an incident_sub_status Delete a specific incident_sub_status by id diff --git a/rootly_sdk/api/incident_sub_statuses/get_incident_sub_status.py b/rootly_sdk/api/incident_sub_statuses/get_incident_sub_status.py index 2d81f56e..e08c4dd9 100644 --- a/rootly_sdk/api/incident_sub_statuses/get_incident_sub_status.py +++ b/rootly_sdk/api/incident_sub_statuses/get_incident_sub_status.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -13,11 +13,11 @@ def _get_kwargs( id: str, *, - include: Union[Unset, GetIncidentSubStatusInclude] = UNSET, + include: Unset | GetIncidentSubStatusInclude = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} - json_include: Union[Unset, str] = UNSET + json_include: Unset | str = UNSET if not isinstance(include, Unset): json_include = include @@ -35,8 +35,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[IncidentSubStatusResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> IncidentSubStatusResponse | None: if response.status_code == 200: response_200 = IncidentSubStatusResponse.from_dict(response.json()) @@ -49,7 +49,7 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response + *, client: AuthenticatedClient | Client, response: httpx.Response ) -> Response[IncidentSubStatusResponse]: return Response( status_code=HTTPStatus(response.status_code), @@ -63,7 +63,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, - include: Union[Unset, GetIncidentSubStatusInclude] = UNSET, + include: Unset | GetIncidentSubStatusInclude = UNSET, ) -> Response[IncidentSubStatusResponse]: """Retrieves incident_sub_status @@ -97,8 +97,8 @@ def sync( id: str, *, client: AuthenticatedClient, - include: Union[Unset, GetIncidentSubStatusInclude] = UNSET, -) -> Optional[IncidentSubStatusResponse]: + include: Unset | GetIncidentSubStatusInclude = UNSET, +) -> IncidentSubStatusResponse | None: """Retrieves incident_sub_status Retrieves a specific incident_sub_status by id @@ -126,7 +126,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, - include: Union[Unset, GetIncidentSubStatusInclude] = UNSET, + include: Unset | GetIncidentSubStatusInclude = UNSET, ) -> Response[IncidentSubStatusResponse]: """Retrieves incident_sub_status @@ -158,8 +158,8 @@ async def asyncio( id: str, *, client: AuthenticatedClient, - include: Union[Unset, GetIncidentSubStatusInclude] = UNSET, -) -> Optional[IncidentSubStatusResponse]: + include: Unset | GetIncidentSubStatusInclude = UNSET, +) -> IncidentSubStatusResponse | None: """Retrieves incident_sub_status Retrieves a specific incident_sub_status by id diff --git a/rootly_sdk/api/incident_sub_statuses/list_incident_sub_statuses.py b/rootly_sdk/api/incident_sub_statuses/list_incident_sub_statuses.py index 22322f17..fb6483d6 100644 --- a/rootly_sdk/api/incident_sub_statuses/list_incident_sub_statuses.py +++ b/rootly_sdk/api/incident_sub_statuses/list_incident_sub_statuses.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -16,25 +16,25 @@ def _get_kwargs( incident_id: str, *, - include: Union[Unset, ListIncidentSubStatusesInclude] = UNSET, - sort: Union[Unset, ListIncidentSubStatusesSort] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersub_status_id: Union[Unset, str] = UNSET, - filterassigned_atgt: Union[Unset, str] = UNSET, - filterassigned_atgte: Union[Unset, str] = UNSET, - filterassigned_atlt: Union[Unset, str] = UNSET, - filterassigned_atlte: Union[Unset, str] = UNSET, + include: Unset | ListIncidentSubStatusesInclude = UNSET, + sort: Unset | ListIncidentSubStatusesSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersub_status_id: Unset | str = UNSET, + filterassigned_atgt: Unset | str = UNSET, + filterassigned_atgte: Unset | str = UNSET, + filterassigned_atlt: Unset | str = UNSET, + filterassigned_atlte: Unset | str = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} - json_include: Union[Unset, str] = UNSET + json_include: Unset | str = UNSET if not isinstance(include, Unset): json_include = include params["include"] = json_include - json_sort: Union[Unset, str] = UNSET + json_sort: Unset | str = UNSET if not isinstance(sort, Unset): json_sort = sort @@ -65,9 +65,7 @@ def _get_kwargs( return _kwargs -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[IncidentSubStatusList]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> IncidentSubStatusList | None: if response.status_code == 200: response_200 = IncidentSubStatusList.from_dict(response.json()) @@ -80,7 +78,7 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response + *, client: AuthenticatedClient | Client, response: httpx.Response ) -> Response[IncidentSubStatusList]: return Response( status_code=HTTPStatus(response.status_code), @@ -94,15 +92,15 @@ def sync_detailed( incident_id: str, *, client: AuthenticatedClient, - include: Union[Unset, ListIncidentSubStatusesInclude] = UNSET, - sort: Union[Unset, ListIncidentSubStatusesSort] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersub_status_id: Union[Unset, str] = UNSET, - filterassigned_atgt: Union[Unset, str] = UNSET, - filterassigned_atgte: Union[Unset, str] = UNSET, - filterassigned_atlt: Union[Unset, str] = UNSET, - filterassigned_atlte: Union[Unset, str] = UNSET, + include: Unset | ListIncidentSubStatusesInclude = UNSET, + sort: Unset | ListIncidentSubStatusesSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersub_status_id: Unset | str = UNSET, + filterassigned_atgt: Unset | str = UNSET, + filterassigned_atgte: Unset | str = UNSET, + filterassigned_atlt: Unset | str = UNSET, + filterassigned_atlte: Unset | str = UNSET, ) -> Response[IncidentSubStatusList]: """List incident_sub_statuses @@ -152,16 +150,16 @@ def sync( incident_id: str, *, client: AuthenticatedClient, - include: Union[Unset, ListIncidentSubStatusesInclude] = UNSET, - sort: Union[Unset, ListIncidentSubStatusesSort] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersub_status_id: Union[Unset, str] = UNSET, - filterassigned_atgt: Union[Unset, str] = UNSET, - filterassigned_atgte: Union[Unset, str] = UNSET, - filterassigned_atlt: Union[Unset, str] = UNSET, - filterassigned_atlte: Union[Unset, str] = UNSET, -) -> Optional[IncidentSubStatusList]: + include: Unset | ListIncidentSubStatusesInclude = UNSET, + sort: Unset | ListIncidentSubStatusesSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersub_status_id: Unset | str = UNSET, + filterassigned_atgt: Unset | str = UNSET, + filterassigned_atgte: Unset | str = UNSET, + filterassigned_atlt: Unset | str = UNSET, + filterassigned_atlte: Unset | str = UNSET, +) -> IncidentSubStatusList | None: """List incident_sub_statuses List incident_sub_statuses @@ -205,15 +203,15 @@ async def asyncio_detailed( incident_id: str, *, client: AuthenticatedClient, - include: Union[Unset, ListIncidentSubStatusesInclude] = UNSET, - sort: Union[Unset, ListIncidentSubStatusesSort] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersub_status_id: Union[Unset, str] = UNSET, - filterassigned_atgt: Union[Unset, str] = UNSET, - filterassigned_atgte: Union[Unset, str] = UNSET, - filterassigned_atlt: Union[Unset, str] = UNSET, - filterassigned_atlte: Union[Unset, str] = UNSET, + include: Unset | ListIncidentSubStatusesInclude = UNSET, + sort: Unset | ListIncidentSubStatusesSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersub_status_id: Unset | str = UNSET, + filterassigned_atgt: Unset | str = UNSET, + filterassigned_atgte: Unset | str = UNSET, + filterassigned_atlt: Unset | str = UNSET, + filterassigned_atlte: Unset | str = UNSET, ) -> Response[IncidentSubStatusList]: """List incident_sub_statuses @@ -261,16 +259,16 @@ async def asyncio( incident_id: str, *, client: AuthenticatedClient, - include: Union[Unset, ListIncidentSubStatusesInclude] = UNSET, - sort: Union[Unset, ListIncidentSubStatusesSort] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersub_status_id: Union[Unset, str] = UNSET, - filterassigned_atgt: Union[Unset, str] = UNSET, - filterassigned_atgte: Union[Unset, str] = UNSET, - filterassigned_atlt: Union[Unset, str] = UNSET, - filterassigned_atlte: Union[Unset, str] = UNSET, -) -> Optional[IncidentSubStatusList]: + include: Unset | ListIncidentSubStatusesInclude = UNSET, + sort: Unset | ListIncidentSubStatusesSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersub_status_id: Unset | str = UNSET, + filterassigned_atgt: Unset | str = UNSET, + filterassigned_atgte: Unset | str = UNSET, + filterassigned_atlt: Unset | str = UNSET, + filterassigned_atlte: Unset | str = UNSET, +) -> IncidentSubStatusList | None: """List incident_sub_statuses List incident_sub_statuses diff --git a/rootly_sdk/api/incident_sub_statuses/update_incident_sub_status.py b/rootly_sdk/api/incident_sub_statuses/update_incident_sub_status.py index e9c29d41..767df1f8 100644 --- a/rootly_sdk/api/incident_sub_statuses/update_incident_sub_status.py +++ b/rootly_sdk/api/incident_sub_statuses/update_incident_sub_status.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[IncidentSubStatusResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> IncidentSubStatusResponse | None: if response.status_code == 200: response_200 = IncidentSubStatusResponse.from_dict(response.json()) @@ -45,7 +45,7 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response + *, client: AuthenticatedClient | Client, response: httpx.Response ) -> Response[IncidentSubStatusResponse]: return Response( status_code=HTTPStatus(response.status_code), @@ -94,7 +94,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateIncidentSubStatus, -) -> Optional[IncidentSubStatusResponse]: +) -> IncidentSubStatusResponse | None: """Update incident_sub_status Update a specific incident_sub_status by id @@ -155,7 +155,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateIncidentSubStatus, -) -> Optional[IncidentSubStatusResponse]: +) -> IncidentSubStatusResponse | None: """Update incident_sub_status Update a specific incident_sub_status by id diff --git a/rootly_sdk/api/incident_types/create_incident_type.py b/rootly_sdk/api/incident_types/create_incident_type.py index 12c734ce..850d7886 100644 --- a/rootly_sdk/api/incident_types/create_incident_type.py +++ b/rootly_sdk/api/incident_types/create_incident_type.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, IncidentTypeResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | IncidentTypeResponse | None: if response.status_code == 201: response_201 = IncidentTypeResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, IncidentTypeResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | IncidentTypeResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +69,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewIncidentType, -) -> Response[Union[ErrorsList, IncidentTypeResponse]]: +) -> Response[ErrorsList | IncidentTypeResponse]: """Creates an incident type Creates a new incident_type from provided data @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: NewIncidentType, -) -> Optional[Union[ErrorsList, IncidentTypeResponse]]: +) -> ErrorsList | IncidentTypeResponse | None: """Creates an incident type Creates a new incident_type from provided data @@ -126,7 +126,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewIncidentType, -) -> Response[Union[ErrorsList, IncidentTypeResponse]]: +) -> Response[ErrorsList | IncidentTypeResponse]: """Creates an incident type Creates a new incident_type from provided data @@ -155,7 +155,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewIncidentType, -) -> Optional[Union[ErrorsList, IncidentTypeResponse]]: +) -> ErrorsList | IncidentTypeResponse | None: """Creates an incident type Creates a new incident_type from provided data diff --git a/rootly_sdk/api/incident_types/create_incident_type_catalog_property.py b/rootly_sdk/api/incident_types/create_incident_type_catalog_property.py index f2378b02..2f4aed56 100644 --- a/rootly_sdk/api/incident_types/create_incident_type_catalog_property.py +++ b/rootly_sdk/api/incident_types/create_incident_type_catalog_property.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[CatalogPropertyResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CatalogPropertyResponse | ErrorsList | None: if response.status_code == 201: response_201 = CatalogPropertyResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[CatalogPropertyResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[CatalogPropertyResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +69,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewCatalogProperty, -) -> Response[Union[CatalogPropertyResponse, ErrorsList]]: +) -> Response[CatalogPropertyResponse | ErrorsList]: """Creates a Catalog Property Creates a new Catalog Property from provided data @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: NewCatalogProperty, -) -> Optional[Union[CatalogPropertyResponse, ErrorsList]]: +) -> CatalogPropertyResponse | ErrorsList | None: """Creates a Catalog Property Creates a new Catalog Property from provided data @@ -126,7 +126,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewCatalogProperty, -) -> Response[Union[CatalogPropertyResponse, ErrorsList]]: +) -> Response[CatalogPropertyResponse | ErrorsList]: """Creates a Catalog Property Creates a new Catalog Property from provided data @@ -155,7 +155,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewCatalogProperty, -) -> Optional[Union[CatalogPropertyResponse, ErrorsList]]: +) -> CatalogPropertyResponse | ErrorsList | None: """Creates a Catalog Property Creates a new Catalog Property from provided data diff --git a/rootly_sdk/api/incident_types/delete_incident_type.py b/rootly_sdk/api/incident_types/delete_incident_type.py index 96a4038e..5318328f 100644 --- a/rootly_sdk/api/incident_types/delete_incident_type.py +++ b/rootly_sdk/api/incident_types/delete_incident_type.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any from uuid import UUID import httpx @@ -12,7 +12,7 @@ def _get_kwargs( - id: Union[UUID, str], + id: UUID | str, ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "delete", @@ -23,8 +23,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, IncidentTypeResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | IncidentTypeResponse | None: if response.status_code == 200: response_200 = IncidentTypeResponse.from_dict(response.json()) @@ -42,8 +42,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, IncidentTypeResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | IncidentTypeResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -53,10 +53,10 @@ def _build_response( def sync_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, IncidentTypeResponse]]: +) -> Response[ErrorsList | IncidentTypeResponse]: """Delete an incident type Delete a specific incident_type by id @@ -84,10 +84,10 @@ def sync_detailed( def sync( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, IncidentTypeResponse]]: +) -> ErrorsList | IncidentTypeResponse | None: """Delete an incident type Delete a specific incident_type by id @@ -110,10 +110,10 @@ def sync( async def asyncio_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, IncidentTypeResponse]]: +) -> Response[ErrorsList | IncidentTypeResponse]: """Delete an incident type Delete a specific incident_type by id @@ -139,10 +139,10 @@ async def asyncio_detailed( async def asyncio( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, IncidentTypeResponse]]: +) -> ErrorsList | IncidentTypeResponse | None: """Delete an incident type Delete a specific incident_type by id diff --git a/rootly_sdk/api/incident_types/get_incident_type.py b/rootly_sdk/api/incident_types/get_incident_type.py index 765b2668..48476201 100644 --- a/rootly_sdk/api/incident_types/get_incident_type.py +++ b/rootly_sdk/api/incident_types/get_incident_type.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any from uuid import UUID import httpx @@ -12,7 +12,7 @@ def _get_kwargs( - id: Union[UUID, str], + id: UUID | str, ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "get", @@ -23,8 +23,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, IncidentTypeResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | IncidentTypeResponse | None: if response.status_code == 200: response_200 = IncidentTypeResponse.from_dict(response.json()) @@ -42,8 +42,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, IncidentTypeResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | IncidentTypeResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -53,10 +53,10 @@ def _build_response( def sync_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, IncidentTypeResponse]]: +) -> Response[ErrorsList | IncidentTypeResponse]: """Retrieves an incident type Retrieves a specific incident_type by id @@ -84,10 +84,10 @@ def sync_detailed( def sync( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, IncidentTypeResponse]]: +) -> ErrorsList | IncidentTypeResponse | None: """Retrieves an incident type Retrieves a specific incident_type by id @@ -110,10 +110,10 @@ def sync( async def asyncio_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, IncidentTypeResponse]]: +) -> Response[ErrorsList | IncidentTypeResponse]: """Retrieves an incident type Retrieves a specific incident_type by id @@ -139,10 +139,10 @@ async def asyncio_detailed( async def asyncio( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, IncidentTypeResponse]]: +) -> ErrorsList | IncidentTypeResponse | None: """Retrieves an incident type Retrieves a specific incident_type by id diff --git a/rootly_sdk/api/incident_types/list_incident_type_catalog_properties.py b/rootly_sdk/api/incident_types/list_incident_type_catalog_properties.py index b0dd576c..b102ba96 100644 --- a/rootly_sdk/api/incident_types/list_incident_type_catalog_properties.py +++ b/rootly_sdk/api/incident_types/list_incident_type_catalog_properties.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -17,27 +17,27 @@ def _get_kwargs( *, - include: Union[Unset, ListIncidentTypeCatalogPropertiesInclude] = UNSET, - sort: Union[Unset, ListIncidentTypeCatalogPropertiesSort] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterkind: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, + include: Unset | ListIncidentTypeCatalogPropertiesInclude = UNSET, + sort: Unset | ListIncidentTypeCatalogPropertiesSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} - json_include: Union[Unset, str] = UNSET + json_include: Unset | str = UNSET if not isinstance(include, Unset): json_include = include params["include"] = json_include - json_sort: Union[Unset, str] = UNSET + json_sort: Unset | str = UNSET if not isinstance(sort, Unset): json_sort = sort @@ -72,9 +72,7 @@ def _get_kwargs( return _kwargs -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[CatalogPropertyList]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> CatalogPropertyList | None: if response.status_code == 200: response_200 = CatalogPropertyList.from_dict(response.json()) @@ -86,9 +84,7 @@ def _parse_response( return None -def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[CatalogPropertyList]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[CatalogPropertyList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -100,17 +96,17 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - include: Union[Unset, ListIncidentTypeCatalogPropertiesInclude] = UNSET, - sort: Union[Unset, ListIncidentTypeCatalogPropertiesSort] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterkind: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, + include: Unset | ListIncidentTypeCatalogPropertiesInclude = UNSET, + sort: Unset | ListIncidentTypeCatalogPropertiesSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> Response[CatalogPropertyList]: """List Catalog Properties @@ -161,18 +157,18 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: Union[Unset, ListIncidentTypeCatalogPropertiesInclude] = UNSET, - sort: Union[Unset, ListIncidentTypeCatalogPropertiesSort] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterkind: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, -) -> Optional[CatalogPropertyList]: + include: Unset | ListIncidentTypeCatalogPropertiesInclude = UNSET, + sort: Unset | ListIncidentTypeCatalogPropertiesSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, +) -> CatalogPropertyList | None: """List Catalog Properties List IncidentType Catalog Properties @@ -217,17 +213,17 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: Union[Unset, ListIncidentTypeCatalogPropertiesInclude] = UNSET, - sort: Union[Unset, ListIncidentTypeCatalogPropertiesSort] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterkind: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, + include: Unset | ListIncidentTypeCatalogPropertiesInclude = UNSET, + sort: Unset | ListIncidentTypeCatalogPropertiesSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> Response[CatalogPropertyList]: """List Catalog Properties @@ -276,18 +272,18 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: Union[Unset, ListIncidentTypeCatalogPropertiesInclude] = UNSET, - sort: Union[Unset, ListIncidentTypeCatalogPropertiesSort] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterkind: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, -) -> Optional[CatalogPropertyList]: + include: Unset | ListIncidentTypeCatalogPropertiesInclude = UNSET, + sort: Unset | ListIncidentTypeCatalogPropertiesSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, +) -> CatalogPropertyList | None: """List Catalog Properties List IncidentType Catalog Properties diff --git a/rootly_sdk/api/incident_types/list_incident_types.py b/rootly_sdk/api/incident_types/list_incident_types.py index 91e31896..461425b8 100644 --- a/rootly_sdk/api/incident_types/list_incident_types.py +++ b/rootly_sdk/api/incident_types/list_incident_types.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -11,29 +11,29 @@ def _get_kwargs( *, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filtercolor: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filterslugeq: Union[Unset, str] = UNSET, - filterslugnot_eq: Union[Unset, str] = UNSET, - filterslugin: Union[Unset, str] = UNSET, - filterslugnot_in: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, - filtercoloreq: Union[Unset, str] = UNSET, - filtercolornot_eq: Union[Unset, str] = UNSET, - filtercolorin: Union[Unset, str] = UNSET, - filtercolornot_in: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filtercolor: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filtercoloreq: Unset | str = UNSET, + filtercolornot_eq: Unset | str = UNSET, + filtercolorin: Unset | str = UNSET, + filtercolornot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -94,9 +94,7 @@ def _get_kwargs( return _kwargs -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[IncidentTypeList]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> IncidentTypeList | None: if response.status_code == 200: response_200 = IncidentTypeList.from_dict(response.json()) @@ -108,9 +106,7 @@ def _parse_response( return None -def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[IncidentTypeList]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[IncidentTypeList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -122,29 +118,29 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filtercolor: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filterslugeq: Union[Unset, str] = UNSET, - filterslugnot_eq: Union[Unset, str] = UNSET, - filterslugin: Union[Unset, str] = UNSET, - filterslugnot_in: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, - filtercoloreq: Union[Unset, str] = UNSET, - filtercolornot_eq: Union[Unset, str] = UNSET, - filtercolorin: Union[Unset, str] = UNSET, - filtercolornot_in: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filtercolor: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filtercoloreq: Unset | str = UNSET, + filtercolornot_eq: Unset | str = UNSET, + filtercolorin: Unset | str = UNSET, + filtercolornot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[IncidentTypeList]: """List incident types @@ -219,30 +215,30 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filtercolor: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filterslugeq: Union[Unset, str] = UNSET, - filterslugnot_eq: Union[Unset, str] = UNSET, - filterslugin: Union[Unset, str] = UNSET, - filterslugnot_in: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, - filtercoloreq: Union[Unset, str] = UNSET, - filtercolornot_eq: Union[Unset, str] = UNSET, - filtercolorin: Union[Unset, str] = UNSET, - filtercolornot_in: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, -) -> Optional[IncidentTypeList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filtercolor: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filtercoloreq: Unset | str = UNSET, + filtercolornot_eq: Unset | str = UNSET, + filtercolorin: Unset | str = UNSET, + filtercolornot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, +) -> IncidentTypeList | None: """List incident types List incident types @@ -311,29 +307,29 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filtercolor: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filterslugeq: Union[Unset, str] = UNSET, - filterslugnot_eq: Union[Unset, str] = UNSET, - filterslugin: Union[Unset, str] = UNSET, - filterslugnot_in: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, - filtercoloreq: Union[Unset, str] = UNSET, - filtercolornot_eq: Union[Unset, str] = UNSET, - filtercolorin: Union[Unset, str] = UNSET, - filtercolornot_in: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filtercolor: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filtercoloreq: Unset | str = UNSET, + filtercolornot_eq: Unset | str = UNSET, + filtercolorin: Unset | str = UNSET, + filtercolornot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[IncidentTypeList]: """List incident types @@ -406,30 +402,30 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filtercolor: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filterslugeq: Union[Unset, str] = UNSET, - filterslugnot_eq: Union[Unset, str] = UNSET, - filterslugin: Union[Unset, str] = UNSET, - filterslugnot_in: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, - filtercoloreq: Union[Unset, str] = UNSET, - filtercolornot_eq: Union[Unset, str] = UNSET, - filtercolorin: Union[Unset, str] = UNSET, - filtercolornot_in: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, -) -> Optional[IncidentTypeList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filtercolor: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filtercoloreq: Unset | str = UNSET, + filtercolornot_eq: Unset | str = UNSET, + filtercolorin: Unset | str = UNSET, + filtercolornot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, +) -> IncidentTypeList | None: """List incident types List incident types diff --git a/rootly_sdk/api/incident_types/update_incident_type.py b/rootly_sdk/api/incident_types/update_incident_type.py index 76a0aa5e..ba3f07cd 100644 --- a/rootly_sdk/api/incident_types/update_incident_type.py +++ b/rootly_sdk/api/incident_types/update_incident_type.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any from uuid import UUID import httpx @@ -13,7 +13,7 @@ def _get_kwargs( - id: Union[UUID, str], + id: UUID | str, *, body: UpdateIncidentType, ) -> dict[str, Any]: @@ -33,8 +33,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, IncidentTypeResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | IncidentTypeResponse | None: if response.status_code == 200: response_200 = IncidentTypeResponse.from_dict(response.json()) @@ -52,8 +52,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, IncidentTypeResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | IncidentTypeResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -63,11 +63,11 @@ def _build_response( def sync_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdateIncidentType, -) -> Response[Union[ErrorsList, IncidentTypeResponse]]: +) -> Response[ErrorsList | IncidentTypeResponse]: """Update an incident type Update a specific incident_type by id @@ -97,11 +97,11 @@ def sync_detailed( def sync( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdateIncidentType, -) -> Optional[Union[ErrorsList, IncidentTypeResponse]]: +) -> ErrorsList | IncidentTypeResponse | None: """Update an incident type Update a specific incident_type by id @@ -126,11 +126,11 @@ def sync( async def asyncio_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdateIncidentType, -) -> Response[Union[ErrorsList, IncidentTypeResponse]]: +) -> Response[ErrorsList | IncidentTypeResponse]: """Update an incident type Update a specific incident_type by id @@ -158,11 +158,11 @@ async def asyncio_detailed( async def asyncio( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdateIncidentType, -) -> Optional[Union[ErrorsList, IncidentTypeResponse]]: +) -> ErrorsList | IncidentTypeResponse | None: """Update an incident type Update a specific incident_type by id diff --git a/rootly_sdk/api/incidents/add_subscribers_to_incident.py b/rootly_sdk/api/incidents/add_subscribers_to_incident.py index 3d163aa7..28cc4647 100644 --- a/rootly_sdk/api/incidents/add_subscribers_to_incident.py +++ b/rootly_sdk/api/incidents/add_subscribers_to_incident.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any from uuid import UUID import httpx @@ -13,7 +13,7 @@ def _get_kwargs( - id: Union[UUID, str], + id: UUID | str, *, body: AddSubscribers, ) -> dict[str, Any]: @@ -33,8 +33,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, IncidentResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | IncidentResponse | None: if response.status_code == 200: response_200 = IncidentResponse.from_dict(response.json()) @@ -52,8 +52,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, IncidentResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | IncidentResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -63,11 +63,11 @@ def _build_response( def sync_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: AddSubscribers, -) -> Response[Union[ErrorsList, IncidentResponse]]: +) -> Response[ErrorsList | IncidentResponse]: """Add subscribers to incident Add subscribers to incident @@ -97,11 +97,11 @@ def sync_detailed( def sync( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: AddSubscribers, -) -> Optional[Union[ErrorsList, IncidentResponse]]: +) -> ErrorsList | IncidentResponse | None: """Add subscribers to incident Add subscribers to incident @@ -126,11 +126,11 @@ def sync( async def asyncio_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: AddSubscribers, -) -> Response[Union[ErrorsList, IncidentResponse]]: +) -> Response[ErrorsList | IncidentResponse]: """Add subscribers to incident Add subscribers to incident @@ -158,11 +158,11 @@ async def asyncio_detailed( async def asyncio( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: AddSubscribers, -) -> Optional[Union[ErrorsList, IncidentResponse]]: +) -> ErrorsList | IncidentResponse | None: """Add subscribers to incident Add subscribers to incident diff --git a/rootly_sdk/api/incidents/assign_user_to_incident.py b/rootly_sdk/api/incidents/assign_user_to_incident.py index 68cc66c8..85f5d763 100644 --- a/rootly_sdk/api/incidents/assign_user_to_incident.py +++ b/rootly_sdk/api/incidents/assign_user_to_incident.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any from uuid import UUID import httpx @@ -13,7 +13,7 @@ def _get_kwargs( - id: Union[UUID, str], + id: UUID | str, *, body: AssignRoleToUser, ) -> dict[str, Any]: @@ -33,8 +33,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, IncidentResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | IncidentResponse | None: if response.status_code == 200: response_200 = IncidentResponse.from_dict(response.json()) @@ -52,8 +52,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, IncidentResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | IncidentResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -63,11 +63,11 @@ def _build_response( def sync_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: AssignRoleToUser, -) -> Response[Union[ErrorsList, IncidentResponse]]: +) -> Response[ErrorsList | IncidentResponse]: """Assign user to incident Assign user to incident @@ -97,11 +97,11 @@ def sync_detailed( def sync( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: AssignRoleToUser, -) -> Optional[Union[ErrorsList, IncidentResponse]]: +) -> ErrorsList | IncidentResponse | None: """Assign user to incident Assign user to incident @@ -126,11 +126,11 @@ def sync( async def asyncio_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: AssignRoleToUser, -) -> Response[Union[ErrorsList, IncidentResponse]]: +) -> Response[ErrorsList | IncidentResponse]: """Assign user to incident Assign user to incident @@ -158,11 +158,11 @@ async def asyncio_detailed( async def asyncio( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: AssignRoleToUser, -) -> Optional[Union[ErrorsList, IncidentResponse]]: +) -> ErrorsList | IncidentResponse | None: """Assign user to incident Assign user to incident diff --git a/rootly_sdk/api/incidents/cancel_incident.py b/rootly_sdk/api/incidents/cancel_incident.py index c2da65cc..127e505a 100644 --- a/rootly_sdk/api/incidents/cancel_incident.py +++ b/rootly_sdk/api/incidents/cancel_incident.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any from uuid import UUID import httpx @@ -13,7 +13,7 @@ def _get_kwargs( - id: Union[UUID, str], + id: UUID | str, *, body: CancelIncident, ) -> dict[str, Any]: @@ -33,8 +33,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, IncidentResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | IncidentResponse | None: if response.status_code == 200: response_200 = IncidentResponse.from_dict(response.json()) @@ -52,8 +52,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, IncidentResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | IncidentResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -63,11 +63,11 @@ def _build_response( def sync_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: CancelIncident, -) -> Response[Union[ErrorsList, IncidentResponse]]: +) -> Response[ErrorsList | IncidentResponse]: """Cancel an incident Cancel a specific incident by id @@ -97,11 +97,11 @@ def sync_detailed( def sync( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: CancelIncident, -) -> Optional[Union[ErrorsList, IncidentResponse]]: +) -> ErrorsList | IncidentResponse | None: """Cancel an incident Cancel a specific incident by id @@ -126,11 +126,11 @@ def sync( async def asyncio_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: CancelIncident, -) -> Response[Union[ErrorsList, IncidentResponse]]: +) -> Response[ErrorsList | IncidentResponse]: """Cancel an incident Cancel a specific incident by id @@ -158,11 +158,11 @@ async def asyncio_detailed( async def asyncio( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: CancelIncident, -) -> Optional[Union[ErrorsList, IncidentResponse]]: +) -> ErrorsList | IncidentResponse | None: """Cancel an incident Cancel a specific incident by id diff --git a/rootly_sdk/api/incidents/create_incident.py b/rootly_sdk/api/incidents/create_incident.py index 8a0ccd50..8150ea17 100644 --- a/rootly_sdk/api/incidents/create_incident.py +++ b/rootly_sdk/api/incidents/create_incident.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, IncidentResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | IncidentResponse | None: if response.status_code == 201: response_201 = IncidentResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, IncidentResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | IncidentResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +69,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewIncident, -) -> Response[Union[ErrorsList, IncidentResponse]]: +) -> Response[ErrorsList | IncidentResponse]: """Creates an incident Creates a new incident from provided data @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: NewIncident, -) -> Optional[Union[ErrorsList, IncidentResponse]]: +) -> ErrorsList | IncidentResponse | None: """Creates an incident Creates a new incident from provided data @@ -126,7 +126,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewIncident, -) -> Response[Union[ErrorsList, IncidentResponse]]: +) -> Response[ErrorsList | IncidentResponse]: """Creates an incident Creates a new incident from provided data @@ -155,7 +155,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewIncident, -) -> Optional[Union[ErrorsList, IncidentResponse]]: +) -> ErrorsList | IncidentResponse | None: """Creates an incident Creates a new incident from provided data diff --git a/rootly_sdk/api/incidents/delete_incident.py b/rootly_sdk/api/incidents/delete_incident.py index 5568243c..b39d249e 100644 --- a/rootly_sdk/api/incidents/delete_incident.py +++ b/rootly_sdk/api/incidents/delete_incident.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any from uuid import UUID import httpx @@ -12,7 +12,7 @@ def _get_kwargs( - id: Union[UUID, str], + id: UUID | str, ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "delete", @@ -23,8 +23,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, IncidentResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | IncidentResponse | None: if response.status_code == 200: response_200 = IncidentResponse.from_dict(response.json()) @@ -42,8 +42,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, IncidentResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | IncidentResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -53,10 +53,10 @@ def _build_response( def sync_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, IncidentResponse]]: +) -> Response[ErrorsList | IncidentResponse]: """Delete an incident Delete a specific incident by id @@ -84,10 +84,10 @@ def sync_detailed( def sync( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, IncidentResponse]]: +) -> ErrorsList | IncidentResponse | None: """Delete an incident Delete a specific incident by id @@ -110,10 +110,10 @@ def sync( async def asyncio_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, IncidentResponse]]: +) -> Response[ErrorsList | IncidentResponse]: """Delete an incident Delete a specific incident by id @@ -139,10 +139,10 @@ async def asyncio_detailed( async def asyncio( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, IncidentResponse]]: +) -> ErrorsList | IncidentResponse | None: """Delete an incident Delete a specific incident by id diff --git a/rootly_sdk/api/incidents/detach_from_parent_incident.py b/rootly_sdk/api/incidents/detach_from_parent_incident.py index 00a608f7..071c3b5a 100644 --- a/rootly_sdk/api/incidents/detach_from_parent_incident.py +++ b/rootly_sdk/api/incidents/detach_from_parent_incident.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union, cast +from typing import Any, cast from uuid import UUID import httpx @@ -12,7 +12,7 @@ def _get_kwargs( - id: Union[UUID, str], + id: UUID | str, ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "put", @@ -23,8 +23,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[Any, ErrorsList, IncidentResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Any | ErrorsList | IncidentResponse | None: if response.status_code == 200: response_200 = IncidentResponse.from_dict(response.json()) @@ -46,8 +46,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[Any, ErrorsList, IncidentResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[Any | ErrorsList | IncidentResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -57,10 +57,10 @@ def _build_response( def sync_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Response[Union[Any, ErrorsList, IncidentResponse]]: +) -> Response[Any | ErrorsList | IncidentResponse]: """Detach an incident from its parent Detach a sub-incident from its parent incident @@ -88,10 +88,10 @@ def sync_detailed( def sync( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Optional[Union[Any, ErrorsList, IncidentResponse]]: +) -> Any | ErrorsList | IncidentResponse | None: """Detach an incident from its parent Detach a sub-incident from its parent incident @@ -114,10 +114,10 @@ def sync( async def asyncio_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Response[Union[Any, ErrorsList, IncidentResponse]]: +) -> Response[Any | ErrorsList | IncidentResponse]: """Detach an incident from its parent Detach a sub-incident from its parent incident @@ -143,10 +143,10 @@ async def asyncio_detailed( async def asyncio( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Optional[Union[Any, ErrorsList, IncidentResponse]]: +) -> Any | ErrorsList | IncidentResponse | None: """Detach an incident from its parent Detach a sub-incident from its parent incident diff --git a/rootly_sdk/api/incidents/get_incident.py b/rootly_sdk/api/incidents/get_incident.py index d803a802..86bea102 100644 --- a/rootly_sdk/api/incidents/get_incident.py +++ b/rootly_sdk/api/incidents/get_incident.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any from uuid import UUID import httpx @@ -13,13 +13,13 @@ def _get_kwargs( - id: Union[UUID, str], + id: UUID | str, *, - include: Union[Unset, GetIncidentInclude] = UNSET, + include: Unset | GetIncidentInclude = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} - json_include: Union[Unset, str] = UNSET + json_include: Unset | str = UNSET if not isinstance(include, Unset): json_include = include @@ -37,8 +37,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, IncidentResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | IncidentResponse | None: if response.status_code == 200: response_200 = IncidentResponse.from_dict(response.json()) @@ -56,8 +56,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, IncidentResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | IncidentResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -67,11 +67,11 @@ def _build_response( def sync_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, - include: Union[Unset, GetIncidentInclude] = UNSET, -) -> Response[Union[ErrorsList, IncidentResponse]]: + include: Unset | GetIncidentInclude = UNSET, +) -> Response[ErrorsList | IncidentResponse]: """Retrieves an incident Retrieves a specific incident by id @@ -101,11 +101,11 @@ def sync_detailed( def sync( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, - include: Union[Unset, GetIncidentInclude] = UNSET, -) -> Optional[Union[ErrorsList, IncidentResponse]]: + include: Unset | GetIncidentInclude = UNSET, +) -> ErrorsList | IncidentResponse | None: """Retrieves an incident Retrieves a specific incident by id @@ -130,11 +130,11 @@ def sync( async def asyncio_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, - include: Union[Unset, GetIncidentInclude] = UNSET, -) -> Response[Union[ErrorsList, IncidentResponse]]: + include: Unset | GetIncidentInclude = UNSET, +) -> Response[ErrorsList | IncidentResponse]: """Retrieves an incident Retrieves a specific incident by id @@ -162,11 +162,11 @@ async def asyncio_detailed( async def asyncio( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, - include: Union[Unset, GetIncidentInclude] = UNSET, -) -> Optional[Union[ErrorsList, IncidentResponse]]: + include: Unset | GetIncidentInclude = UNSET, +) -> ErrorsList | IncidentResponse | None: """Retrieves an incident Retrieves a specific incident by id diff --git a/rootly_sdk/api/incidents/list_incidents.py b/rootly_sdk/api/incidents/list_incidents.py index d522e89f..d6bc8f16 100644 --- a/rootly_sdk/api/incidents/list_incidents.py +++ b/rootly_sdk/api/incidents/list_incidents.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -14,169 +14,169 @@ def _get_kwargs( *, - pageafter: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filterkind: Union[Unset, str] = UNSET, - filterstatus: Union[Unset, str] = UNSET, - filterprivate: Union[Unset, str] = UNSET, - filteruser_id: Union[Unset, int] = UNSET, - filterseverity: Union[Unset, str] = UNSET, - filterseverity_id: Union[Unset, str] = UNSET, - filterlabels: Union[Unset, str] = UNSET, - filtertypes: Union[Unset, str] = UNSET, - filtertype_ids: Union[Unset, str] = UNSET, - filterenvironments: Union[Unset, str] = UNSET, - filterenvironment_ids: Union[Unset, str] = UNSET, - filterfunctionalities: Union[Unset, str] = UNSET, - filterfunctionality_ids: Union[Unset, str] = UNSET, - filterfunctionality_names: Union[Unset, str] = UNSET, - filterservices: Union[Unset, str] = UNSET, - filterservice_ids: Union[Unset, str] = UNSET, - filterservice_names: Union[Unset, str] = UNSET, - filterteams: Union[Unset, str] = UNSET, - filterteam_ids: Union[Unset, str] = UNSET, - filterteam_names: Union[Unset, str] = UNSET, - filtercause: Union[Unset, str] = UNSET, - filtercause_ids: Union[Unset, str] = UNSET, - filtercustom_field_selected_option_ids: Union[Unset, str] = UNSET, - filterslack_channel_id: Union[Unset, str] = UNSET, - filtersequential_id: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filterupdated_atgt: Union[Unset, str] = UNSET, - filterupdated_atgte: Union[Unset, str] = UNSET, - filterupdated_atlt: Union[Unset, str] = UNSET, - filterupdated_atlte: Union[Unset, str] = UNSET, - filterstarted_atgt: Union[Unset, str] = UNSET, - filterstarted_atgte: Union[Unset, str] = UNSET, - filterstarted_atlt: Union[Unset, str] = UNSET, - filterstarted_atlte: Union[Unset, str] = UNSET, - filterdetected_atgt: Union[Unset, str] = UNSET, - filterdetected_atgte: Union[Unset, str] = UNSET, - filterdetected_atlt: Union[Unset, str] = UNSET, - filterdetected_atlte: Union[Unset, str] = UNSET, - filteracknowledged_atgt: Union[Unset, str] = UNSET, - filteracknowledged_atgte: Union[Unset, str] = UNSET, - filteracknowledged_atlt: Union[Unset, str] = UNSET, - filteracknowledged_atlte: Union[Unset, str] = UNSET, - filtermitigated_atgt: Union[Unset, str] = UNSET, - filtermitigated_atgte: Union[Unset, str] = UNSET, - filtermitigated_atlt: Union[Unset, str] = UNSET, - filtermitigated_atlte: Union[Unset, str] = UNSET, - filterresolved_atgt: Union[Unset, str] = UNSET, - filterresolved_atgte: Union[Unset, str] = UNSET, - filterresolved_atlt: Union[Unset, str] = UNSET, - filterresolved_atlte: Union[Unset, str] = UNSET, - filterclosed_atgt: Union[Unset, str] = UNSET, - filterclosed_atgte: Union[Unset, str] = UNSET, - filterclosed_atlt: Union[Unset, str] = UNSET, - filterclosed_atlte: Union[Unset, str] = UNSET, - filterin_triage_atgt: Union[Unset, str] = UNSET, - filterin_triage_atgte: Union[Unset, str] = UNSET, - filterin_triage_atlt: Union[Unset, str] = UNSET, - filterin_triage_atlte: Union[Unset, str] = UNSET, - filterkindeq: Union[Unset, str] = UNSET, - filterkindnot_eq: Union[Unset, str] = UNSET, - filterkindin: Union[Unset, str] = UNSET, - filterkindnot_in: Union[Unset, str] = UNSET, - filterstatuseq: Union[Unset, str] = UNSET, - filterstatusnot_eq: Union[Unset, str] = UNSET, - filterstatusin: Union[Unset, str] = UNSET, - filterstatusnot_in: Union[Unset, str] = UNSET, - filterprivateeq: Union[Unset, str] = UNSET, - filterprivatenot_eq: Union[Unset, str] = UNSET, - filterprivatein: Union[Unset, str] = UNSET, - filterprivatenot_in: Union[Unset, str] = UNSET, - filteruser_ideq: Union[Unset, str] = UNSET, - filteruser_idnot_eq: Union[Unset, str] = UNSET, - filteruser_idin: Union[Unset, str] = UNSET, - filteruser_idnot_in: Union[Unset, str] = UNSET, - filterseverityeq: Union[Unset, str] = UNSET, - filterseveritynot_eq: Union[Unset, str] = UNSET, - filterseverityin: Union[Unset, str] = UNSET, - filterseveritynot_in: Union[Unset, str] = UNSET, - filterseverity_ideq: Union[Unset, str] = UNSET, - filterseverity_idnot_eq: Union[Unset, str] = UNSET, - filterseverity_idin: Union[Unset, str] = UNSET, - filterseverity_idnot_in: Union[Unset, str] = UNSET, - filterlabelseq: Union[Unset, str] = UNSET, - filterlabelsnot_eq: Union[Unset, str] = UNSET, - filterlabelsin: Union[Unset, str] = UNSET, - filterlabelsnot_in: Union[Unset, str] = UNSET, - filterzendesk_ticket_ideq: Union[Unset, str] = UNSET, - filterzendesk_ticket_idnot_eq: Union[Unset, str] = UNSET, - filterzendesk_ticket_idin: Union[Unset, str] = UNSET, - filterzendesk_ticket_idnot_in: Union[Unset, str] = UNSET, - filtersequential_ideq: Union[Unset, str] = UNSET, - filtersequential_idnot_eq: Union[Unset, str] = UNSET, - filtersequential_idin: Union[Unset, str] = UNSET, - filtersequential_idnot_in: Union[Unset, str] = UNSET, - filtertypeseq: Union[Unset, str] = UNSET, - filtertypesnot_eq: Union[Unset, str] = UNSET, - filtertypesin: Union[Unset, str] = UNSET, - filtertypesnot_in: Union[Unset, str] = UNSET, - filtertype_idseq: Union[Unset, str] = UNSET, - filtertype_idsnot_eq: Union[Unset, str] = UNSET, - filtertype_idsin: Union[Unset, str] = UNSET, - filtertype_idsnot_in: Union[Unset, str] = UNSET, - filterenvironmentseq: Union[Unset, str] = UNSET, - filterenvironmentsnot_eq: Union[Unset, str] = UNSET, - filterenvironmentsin: Union[Unset, str] = UNSET, - filterenvironmentsnot_in: Union[Unset, str] = UNSET, - filterenvironment_idseq: Union[Unset, str] = UNSET, - filterenvironment_idsnot_eq: Union[Unset, str] = UNSET, - filterenvironment_idsin: Union[Unset, str] = UNSET, - filterenvironment_idsnot_in: Union[Unset, str] = UNSET, - filterserviceseq: Union[Unset, str] = UNSET, - filterservicesnot_eq: Union[Unset, str] = UNSET, - filterservicesin: Union[Unset, str] = UNSET, - filterservicesnot_in: Union[Unset, str] = UNSET, - filterservice_idseq: Union[Unset, str] = UNSET, - filterservice_idsnot_eq: Union[Unset, str] = UNSET, - filterservice_idsin: Union[Unset, str] = UNSET, - filterservice_idsnot_in: Union[Unset, str] = UNSET, - filterservice_nameseq: Union[Unset, str] = UNSET, - filterservice_namesnot_eq: Union[Unset, str] = UNSET, - filterservice_namesin: Union[Unset, str] = UNSET, - filterservice_namesnot_in: Union[Unset, str] = UNSET, - filterfunctionalitieseq: Union[Unset, str] = UNSET, - filterfunctionalitiesnot_eq: Union[Unset, str] = UNSET, - filterfunctionalitiesin: Union[Unset, str] = UNSET, - filterfunctionalitiesnot_in: Union[Unset, str] = UNSET, - filterfunctionality_idseq: Union[Unset, str] = UNSET, - filterfunctionality_idsnot_eq: Union[Unset, str] = UNSET, - filterfunctionality_idsin: Union[Unset, str] = UNSET, - filterfunctionality_idsnot_in: Union[Unset, str] = UNSET, - filterfunctionality_nameseq: Union[Unset, str] = UNSET, - filterfunctionality_namesnot_eq: Union[Unset, str] = UNSET, - filterfunctionality_namesin: Union[Unset, str] = UNSET, - filterfunctionality_namesnot_in: Union[Unset, str] = UNSET, - filtercauseseq: Union[Unset, str] = UNSET, - filtercausesnot_eq: Union[Unset, str] = UNSET, - filtercausesin: Union[Unset, str] = UNSET, - filtercausesnot_in: Union[Unset, str] = UNSET, - filtercause_idseq: Union[Unset, str] = UNSET, - filtercause_idsnot_eq: Union[Unset, str] = UNSET, - filtercause_idsin: Union[Unset, str] = UNSET, - filtercause_idsnot_in: Union[Unset, str] = UNSET, - filterteamseq: Union[Unset, str] = UNSET, - filterteamsnot_eq: Union[Unset, str] = UNSET, - filterteamsin: Union[Unset, str] = UNSET, - filterteamsnot_in: Union[Unset, str] = UNSET, - filterteam_idseq: Union[Unset, str] = UNSET, - filterteam_idsnot_eq: Union[Unset, str] = UNSET, - filterteam_idsin: Union[Unset, str] = UNSET, - filterteam_idsnot_in: Union[Unset, str] = UNSET, - filterteam_nameseq: Union[Unset, str] = UNSET, - filterteam_namesnot_eq: Union[Unset, str] = UNSET, - filterteam_namesin: Union[Unset, str] = UNSET, - filterteam_namesnot_in: Union[Unset, str] = UNSET, - sort: Union[Unset, ListIncidentsSort] = UNSET, - include: Union[Unset, ListIncidentsInclude] = UNSET, + pageafter: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filterstatus: Unset | str = UNSET, + filterprivate: Unset | str = UNSET, + filteruser_id: Unset | int = UNSET, + filterseverity: Unset | str = UNSET, + filterseverity_id: Unset | str = UNSET, + filterlabels: Unset | str = UNSET, + filtertypes: Unset | str = UNSET, + filtertype_ids: Unset | str = UNSET, + filterenvironments: Unset | str = UNSET, + filterenvironment_ids: Unset | str = UNSET, + filterfunctionalities: Unset | str = UNSET, + filterfunctionality_ids: Unset | str = UNSET, + filterfunctionality_names: Unset | str = UNSET, + filterservices: Unset | str = UNSET, + filterservice_ids: Unset | str = UNSET, + filterservice_names: Unset | str = UNSET, + filterteams: Unset | str = UNSET, + filterteam_ids: Unset | str = UNSET, + filterteam_names: Unset | str = UNSET, + filtercause: Unset | str = UNSET, + filtercause_ids: Unset | str = UNSET, + filtercustom_field_selected_option_ids: Unset | str = UNSET, + filterslack_channel_id: Unset | str = UNSET, + filtersequential_id: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterupdated_atgt: Unset | str = UNSET, + filterupdated_atgte: Unset | str = UNSET, + filterupdated_atlt: Unset | str = UNSET, + filterupdated_atlte: Unset | str = UNSET, + filterstarted_atgt: Unset | str = UNSET, + filterstarted_atgte: Unset | str = UNSET, + filterstarted_atlt: Unset | str = UNSET, + filterstarted_atlte: Unset | str = UNSET, + filterdetected_atgt: Unset | str = UNSET, + filterdetected_atgte: Unset | str = UNSET, + filterdetected_atlt: Unset | str = UNSET, + filterdetected_atlte: Unset | str = UNSET, + filteracknowledged_atgt: Unset | str = UNSET, + filteracknowledged_atgte: Unset | str = UNSET, + filteracknowledged_atlt: Unset | str = UNSET, + filteracknowledged_atlte: Unset | str = UNSET, + filtermitigated_atgt: Unset | str = UNSET, + filtermitigated_atgte: Unset | str = UNSET, + filtermitigated_atlt: Unset | str = UNSET, + filtermitigated_atlte: Unset | str = UNSET, + filterresolved_atgt: Unset | str = UNSET, + filterresolved_atgte: Unset | str = UNSET, + filterresolved_atlt: Unset | str = UNSET, + filterresolved_atlte: Unset | str = UNSET, + filterclosed_atgt: Unset | str = UNSET, + filterclosed_atgte: Unset | str = UNSET, + filterclosed_atlt: Unset | str = UNSET, + filterclosed_atlte: Unset | str = UNSET, + filterin_triage_atgt: Unset | str = UNSET, + filterin_triage_atgte: Unset | str = UNSET, + filterin_triage_atlt: Unset | str = UNSET, + filterin_triage_atlte: Unset | str = UNSET, + filterkindeq: Unset | str = UNSET, + filterkindnot_eq: Unset | str = UNSET, + filterkindin: Unset | str = UNSET, + filterkindnot_in: Unset | str = UNSET, + filterstatuseq: Unset | str = UNSET, + filterstatusnot_eq: Unset | str = UNSET, + filterstatusin: Unset | str = UNSET, + filterstatusnot_in: Unset | str = UNSET, + filterprivateeq: Unset | str = UNSET, + filterprivatenot_eq: Unset | str = UNSET, + filterprivatein: Unset | str = UNSET, + filterprivatenot_in: Unset | str = UNSET, + filteruser_ideq: Unset | str = UNSET, + filteruser_idnot_eq: Unset | str = UNSET, + filteruser_idin: Unset | str = UNSET, + filteruser_idnot_in: Unset | str = UNSET, + filterseverityeq: Unset | str = UNSET, + filterseveritynot_eq: Unset | str = UNSET, + filterseverityin: Unset | str = UNSET, + filterseveritynot_in: Unset | str = UNSET, + filterseverity_ideq: Unset | str = UNSET, + filterseverity_idnot_eq: Unset | str = UNSET, + filterseverity_idin: Unset | str = UNSET, + filterseverity_idnot_in: Unset | str = UNSET, + filterlabelseq: Unset | str = UNSET, + filterlabelsnot_eq: Unset | str = UNSET, + filterlabelsin: Unset | str = UNSET, + filterlabelsnot_in: Unset | str = UNSET, + filterzendesk_ticket_ideq: Unset | str = UNSET, + filterzendesk_ticket_idnot_eq: Unset | str = UNSET, + filterzendesk_ticket_idin: Unset | str = UNSET, + filterzendesk_ticket_idnot_in: Unset | str = UNSET, + filtersequential_ideq: Unset | str = UNSET, + filtersequential_idnot_eq: Unset | str = UNSET, + filtersequential_idin: Unset | str = UNSET, + filtersequential_idnot_in: Unset | str = UNSET, + filtertypeseq: Unset | str = UNSET, + filtertypesnot_eq: Unset | str = UNSET, + filtertypesin: Unset | str = UNSET, + filtertypesnot_in: Unset | str = UNSET, + filtertype_idseq: Unset | str = UNSET, + filtertype_idsnot_eq: Unset | str = UNSET, + filtertype_idsin: Unset | str = UNSET, + filtertype_idsnot_in: Unset | str = UNSET, + filterenvironmentseq: Unset | str = UNSET, + filterenvironmentsnot_eq: Unset | str = UNSET, + filterenvironmentsin: Unset | str = UNSET, + filterenvironmentsnot_in: Unset | str = UNSET, + filterenvironment_idseq: Unset | str = UNSET, + filterenvironment_idsnot_eq: Unset | str = UNSET, + filterenvironment_idsin: Unset | str = UNSET, + filterenvironment_idsnot_in: Unset | str = UNSET, + filterserviceseq: Unset | str = UNSET, + filterservicesnot_eq: Unset | str = UNSET, + filterservicesin: Unset | str = UNSET, + filterservicesnot_in: Unset | str = UNSET, + filterservice_idseq: Unset | str = UNSET, + filterservice_idsnot_eq: Unset | str = UNSET, + filterservice_idsin: Unset | str = UNSET, + filterservice_idsnot_in: Unset | str = UNSET, + filterservice_nameseq: Unset | str = UNSET, + filterservice_namesnot_eq: Unset | str = UNSET, + filterservice_namesin: Unset | str = UNSET, + filterservice_namesnot_in: Unset | str = UNSET, + filterfunctionalitieseq: Unset | str = UNSET, + filterfunctionalitiesnot_eq: Unset | str = UNSET, + filterfunctionalitiesin: Unset | str = UNSET, + filterfunctionalitiesnot_in: Unset | str = UNSET, + filterfunctionality_idseq: Unset | str = UNSET, + filterfunctionality_idsnot_eq: Unset | str = UNSET, + filterfunctionality_idsin: Unset | str = UNSET, + filterfunctionality_idsnot_in: Unset | str = UNSET, + filterfunctionality_nameseq: Unset | str = UNSET, + filterfunctionality_namesnot_eq: Unset | str = UNSET, + filterfunctionality_namesin: Unset | str = UNSET, + filterfunctionality_namesnot_in: Unset | str = UNSET, + filtercauseseq: Unset | str = UNSET, + filtercausesnot_eq: Unset | str = UNSET, + filtercausesin: Unset | str = UNSET, + filtercausesnot_in: Unset | str = UNSET, + filtercause_idseq: Unset | str = UNSET, + filtercause_idsnot_eq: Unset | str = UNSET, + filtercause_idsin: Unset | str = UNSET, + filtercause_idsnot_in: Unset | str = UNSET, + filterteamseq: Unset | str = UNSET, + filterteamsnot_eq: Unset | str = UNSET, + filterteamsin: Unset | str = UNSET, + filterteamsnot_in: Unset | str = UNSET, + filterteam_idseq: Unset | str = UNSET, + filterteam_idsnot_eq: Unset | str = UNSET, + filterteam_idsin: Unset | str = UNSET, + filterteam_idsnot_in: Unset | str = UNSET, + filterteam_nameseq: Unset | str = UNSET, + filterteam_namesnot_eq: Unset | str = UNSET, + filterteam_namesin: Unset | str = UNSET, + filterteam_namesnot_in: Unset | str = UNSET, + sort: Unset | ListIncidentsSort = UNSET, + include: Unset | ListIncidentsInclude = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -502,13 +502,13 @@ def _get_kwargs( params["filter[team_names][not_in]"] = filterteam_namesnot_in - json_sort: Union[Unset, str] = UNSET + json_sort: Unset | str = UNSET if not isinstance(sort, Unset): json_sort = sort params["sort"] = json_sort - json_include: Union[Unset, str] = UNSET + json_include: Unset | str = UNSET if not isinstance(include, Unset): json_include = include @@ -526,8 +526,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, IncidentList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | IncidentList | None: if response.status_code == 200: response_200 = IncidentList.from_dict(response.json()) @@ -545,8 +545,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, IncidentList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | IncidentList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -558,170 +558,170 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - pageafter: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filterkind: Union[Unset, str] = UNSET, - filterstatus: Union[Unset, str] = UNSET, - filterprivate: Union[Unset, str] = UNSET, - filteruser_id: Union[Unset, int] = UNSET, - filterseverity: Union[Unset, str] = UNSET, - filterseverity_id: Union[Unset, str] = UNSET, - filterlabels: Union[Unset, str] = UNSET, - filtertypes: Union[Unset, str] = UNSET, - filtertype_ids: Union[Unset, str] = UNSET, - filterenvironments: Union[Unset, str] = UNSET, - filterenvironment_ids: Union[Unset, str] = UNSET, - filterfunctionalities: Union[Unset, str] = UNSET, - filterfunctionality_ids: Union[Unset, str] = UNSET, - filterfunctionality_names: Union[Unset, str] = UNSET, - filterservices: Union[Unset, str] = UNSET, - filterservice_ids: Union[Unset, str] = UNSET, - filterservice_names: Union[Unset, str] = UNSET, - filterteams: Union[Unset, str] = UNSET, - filterteam_ids: Union[Unset, str] = UNSET, - filterteam_names: Union[Unset, str] = UNSET, - filtercause: Union[Unset, str] = UNSET, - filtercause_ids: Union[Unset, str] = UNSET, - filtercustom_field_selected_option_ids: Union[Unset, str] = UNSET, - filterslack_channel_id: Union[Unset, str] = UNSET, - filtersequential_id: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filterupdated_atgt: Union[Unset, str] = UNSET, - filterupdated_atgte: Union[Unset, str] = UNSET, - filterupdated_atlt: Union[Unset, str] = UNSET, - filterupdated_atlte: Union[Unset, str] = UNSET, - filterstarted_atgt: Union[Unset, str] = UNSET, - filterstarted_atgte: Union[Unset, str] = UNSET, - filterstarted_atlt: Union[Unset, str] = UNSET, - filterstarted_atlte: Union[Unset, str] = UNSET, - filterdetected_atgt: Union[Unset, str] = UNSET, - filterdetected_atgte: Union[Unset, str] = UNSET, - filterdetected_atlt: Union[Unset, str] = UNSET, - filterdetected_atlte: Union[Unset, str] = UNSET, - filteracknowledged_atgt: Union[Unset, str] = UNSET, - filteracknowledged_atgte: Union[Unset, str] = UNSET, - filteracknowledged_atlt: Union[Unset, str] = UNSET, - filteracknowledged_atlte: Union[Unset, str] = UNSET, - filtermitigated_atgt: Union[Unset, str] = UNSET, - filtermitigated_atgte: Union[Unset, str] = UNSET, - filtermitigated_atlt: Union[Unset, str] = UNSET, - filtermitigated_atlte: Union[Unset, str] = UNSET, - filterresolved_atgt: Union[Unset, str] = UNSET, - filterresolved_atgte: Union[Unset, str] = UNSET, - filterresolved_atlt: Union[Unset, str] = UNSET, - filterresolved_atlte: Union[Unset, str] = UNSET, - filterclosed_atgt: Union[Unset, str] = UNSET, - filterclosed_atgte: Union[Unset, str] = UNSET, - filterclosed_atlt: Union[Unset, str] = UNSET, - filterclosed_atlte: Union[Unset, str] = UNSET, - filterin_triage_atgt: Union[Unset, str] = UNSET, - filterin_triage_atgte: Union[Unset, str] = UNSET, - filterin_triage_atlt: Union[Unset, str] = UNSET, - filterin_triage_atlte: Union[Unset, str] = UNSET, - filterkindeq: Union[Unset, str] = UNSET, - filterkindnot_eq: Union[Unset, str] = UNSET, - filterkindin: Union[Unset, str] = UNSET, - filterkindnot_in: Union[Unset, str] = UNSET, - filterstatuseq: Union[Unset, str] = UNSET, - filterstatusnot_eq: Union[Unset, str] = UNSET, - filterstatusin: Union[Unset, str] = UNSET, - filterstatusnot_in: Union[Unset, str] = UNSET, - filterprivateeq: Union[Unset, str] = UNSET, - filterprivatenot_eq: Union[Unset, str] = UNSET, - filterprivatein: Union[Unset, str] = UNSET, - filterprivatenot_in: Union[Unset, str] = UNSET, - filteruser_ideq: Union[Unset, str] = UNSET, - filteruser_idnot_eq: Union[Unset, str] = UNSET, - filteruser_idin: Union[Unset, str] = UNSET, - filteruser_idnot_in: Union[Unset, str] = UNSET, - filterseverityeq: Union[Unset, str] = UNSET, - filterseveritynot_eq: Union[Unset, str] = UNSET, - filterseverityin: Union[Unset, str] = UNSET, - filterseveritynot_in: Union[Unset, str] = UNSET, - filterseverity_ideq: Union[Unset, str] = UNSET, - filterseverity_idnot_eq: Union[Unset, str] = UNSET, - filterseverity_idin: Union[Unset, str] = UNSET, - filterseverity_idnot_in: Union[Unset, str] = UNSET, - filterlabelseq: Union[Unset, str] = UNSET, - filterlabelsnot_eq: Union[Unset, str] = UNSET, - filterlabelsin: Union[Unset, str] = UNSET, - filterlabelsnot_in: Union[Unset, str] = UNSET, - filterzendesk_ticket_ideq: Union[Unset, str] = UNSET, - filterzendesk_ticket_idnot_eq: Union[Unset, str] = UNSET, - filterzendesk_ticket_idin: Union[Unset, str] = UNSET, - filterzendesk_ticket_idnot_in: Union[Unset, str] = UNSET, - filtersequential_ideq: Union[Unset, str] = UNSET, - filtersequential_idnot_eq: Union[Unset, str] = UNSET, - filtersequential_idin: Union[Unset, str] = UNSET, - filtersequential_idnot_in: Union[Unset, str] = UNSET, - filtertypeseq: Union[Unset, str] = UNSET, - filtertypesnot_eq: Union[Unset, str] = UNSET, - filtertypesin: Union[Unset, str] = UNSET, - filtertypesnot_in: Union[Unset, str] = UNSET, - filtertype_idseq: Union[Unset, str] = UNSET, - filtertype_idsnot_eq: Union[Unset, str] = UNSET, - filtertype_idsin: Union[Unset, str] = UNSET, - filtertype_idsnot_in: Union[Unset, str] = UNSET, - filterenvironmentseq: Union[Unset, str] = UNSET, - filterenvironmentsnot_eq: Union[Unset, str] = UNSET, - filterenvironmentsin: Union[Unset, str] = UNSET, - filterenvironmentsnot_in: Union[Unset, str] = UNSET, - filterenvironment_idseq: Union[Unset, str] = UNSET, - filterenvironment_idsnot_eq: Union[Unset, str] = UNSET, - filterenvironment_idsin: Union[Unset, str] = UNSET, - filterenvironment_idsnot_in: Union[Unset, str] = UNSET, - filterserviceseq: Union[Unset, str] = UNSET, - filterservicesnot_eq: Union[Unset, str] = UNSET, - filterservicesin: Union[Unset, str] = UNSET, - filterservicesnot_in: Union[Unset, str] = UNSET, - filterservice_idseq: Union[Unset, str] = UNSET, - filterservice_idsnot_eq: Union[Unset, str] = UNSET, - filterservice_idsin: Union[Unset, str] = UNSET, - filterservice_idsnot_in: Union[Unset, str] = UNSET, - filterservice_nameseq: Union[Unset, str] = UNSET, - filterservice_namesnot_eq: Union[Unset, str] = UNSET, - filterservice_namesin: Union[Unset, str] = UNSET, - filterservice_namesnot_in: Union[Unset, str] = UNSET, - filterfunctionalitieseq: Union[Unset, str] = UNSET, - filterfunctionalitiesnot_eq: Union[Unset, str] = UNSET, - filterfunctionalitiesin: Union[Unset, str] = UNSET, - filterfunctionalitiesnot_in: Union[Unset, str] = UNSET, - filterfunctionality_idseq: Union[Unset, str] = UNSET, - filterfunctionality_idsnot_eq: Union[Unset, str] = UNSET, - filterfunctionality_idsin: Union[Unset, str] = UNSET, - filterfunctionality_idsnot_in: Union[Unset, str] = UNSET, - filterfunctionality_nameseq: Union[Unset, str] = UNSET, - filterfunctionality_namesnot_eq: Union[Unset, str] = UNSET, - filterfunctionality_namesin: Union[Unset, str] = UNSET, - filterfunctionality_namesnot_in: Union[Unset, str] = UNSET, - filtercauseseq: Union[Unset, str] = UNSET, - filtercausesnot_eq: Union[Unset, str] = UNSET, - filtercausesin: Union[Unset, str] = UNSET, - filtercausesnot_in: Union[Unset, str] = UNSET, - filtercause_idseq: Union[Unset, str] = UNSET, - filtercause_idsnot_eq: Union[Unset, str] = UNSET, - filtercause_idsin: Union[Unset, str] = UNSET, - filtercause_idsnot_in: Union[Unset, str] = UNSET, - filterteamseq: Union[Unset, str] = UNSET, - filterteamsnot_eq: Union[Unset, str] = UNSET, - filterteamsin: Union[Unset, str] = UNSET, - filterteamsnot_in: Union[Unset, str] = UNSET, - filterteam_idseq: Union[Unset, str] = UNSET, - filterteam_idsnot_eq: Union[Unset, str] = UNSET, - filterteam_idsin: Union[Unset, str] = UNSET, - filterteam_idsnot_in: Union[Unset, str] = UNSET, - filterteam_nameseq: Union[Unset, str] = UNSET, - filterteam_namesnot_eq: Union[Unset, str] = UNSET, - filterteam_namesin: Union[Unset, str] = UNSET, - filterteam_namesnot_in: Union[Unset, str] = UNSET, - sort: Union[Unset, ListIncidentsSort] = UNSET, - include: Union[Unset, ListIncidentsInclude] = UNSET, -) -> Response[Union[ErrorsList, IncidentList]]: + pageafter: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filterstatus: Unset | str = UNSET, + filterprivate: Unset | str = UNSET, + filteruser_id: Unset | int = UNSET, + filterseverity: Unset | str = UNSET, + filterseverity_id: Unset | str = UNSET, + filterlabels: Unset | str = UNSET, + filtertypes: Unset | str = UNSET, + filtertype_ids: Unset | str = UNSET, + filterenvironments: Unset | str = UNSET, + filterenvironment_ids: Unset | str = UNSET, + filterfunctionalities: Unset | str = UNSET, + filterfunctionality_ids: Unset | str = UNSET, + filterfunctionality_names: Unset | str = UNSET, + filterservices: Unset | str = UNSET, + filterservice_ids: Unset | str = UNSET, + filterservice_names: Unset | str = UNSET, + filterteams: Unset | str = UNSET, + filterteam_ids: Unset | str = UNSET, + filterteam_names: Unset | str = UNSET, + filtercause: Unset | str = UNSET, + filtercause_ids: Unset | str = UNSET, + filtercustom_field_selected_option_ids: Unset | str = UNSET, + filterslack_channel_id: Unset | str = UNSET, + filtersequential_id: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterupdated_atgt: Unset | str = UNSET, + filterupdated_atgte: Unset | str = UNSET, + filterupdated_atlt: Unset | str = UNSET, + filterupdated_atlte: Unset | str = UNSET, + filterstarted_atgt: Unset | str = UNSET, + filterstarted_atgte: Unset | str = UNSET, + filterstarted_atlt: Unset | str = UNSET, + filterstarted_atlte: Unset | str = UNSET, + filterdetected_atgt: Unset | str = UNSET, + filterdetected_atgte: Unset | str = UNSET, + filterdetected_atlt: Unset | str = UNSET, + filterdetected_atlte: Unset | str = UNSET, + filteracknowledged_atgt: Unset | str = UNSET, + filteracknowledged_atgte: Unset | str = UNSET, + filteracknowledged_atlt: Unset | str = UNSET, + filteracknowledged_atlte: Unset | str = UNSET, + filtermitigated_atgt: Unset | str = UNSET, + filtermitigated_atgte: Unset | str = UNSET, + filtermitigated_atlt: Unset | str = UNSET, + filtermitigated_atlte: Unset | str = UNSET, + filterresolved_atgt: Unset | str = UNSET, + filterresolved_atgte: Unset | str = UNSET, + filterresolved_atlt: Unset | str = UNSET, + filterresolved_atlte: Unset | str = UNSET, + filterclosed_atgt: Unset | str = UNSET, + filterclosed_atgte: Unset | str = UNSET, + filterclosed_atlt: Unset | str = UNSET, + filterclosed_atlte: Unset | str = UNSET, + filterin_triage_atgt: Unset | str = UNSET, + filterin_triage_atgte: Unset | str = UNSET, + filterin_triage_atlt: Unset | str = UNSET, + filterin_triage_atlte: Unset | str = UNSET, + filterkindeq: Unset | str = UNSET, + filterkindnot_eq: Unset | str = UNSET, + filterkindin: Unset | str = UNSET, + filterkindnot_in: Unset | str = UNSET, + filterstatuseq: Unset | str = UNSET, + filterstatusnot_eq: Unset | str = UNSET, + filterstatusin: Unset | str = UNSET, + filterstatusnot_in: Unset | str = UNSET, + filterprivateeq: Unset | str = UNSET, + filterprivatenot_eq: Unset | str = UNSET, + filterprivatein: Unset | str = UNSET, + filterprivatenot_in: Unset | str = UNSET, + filteruser_ideq: Unset | str = UNSET, + filteruser_idnot_eq: Unset | str = UNSET, + filteruser_idin: Unset | str = UNSET, + filteruser_idnot_in: Unset | str = UNSET, + filterseverityeq: Unset | str = UNSET, + filterseveritynot_eq: Unset | str = UNSET, + filterseverityin: Unset | str = UNSET, + filterseveritynot_in: Unset | str = UNSET, + filterseverity_ideq: Unset | str = UNSET, + filterseverity_idnot_eq: Unset | str = UNSET, + filterseverity_idin: Unset | str = UNSET, + filterseverity_idnot_in: Unset | str = UNSET, + filterlabelseq: Unset | str = UNSET, + filterlabelsnot_eq: Unset | str = UNSET, + filterlabelsin: Unset | str = UNSET, + filterlabelsnot_in: Unset | str = UNSET, + filterzendesk_ticket_ideq: Unset | str = UNSET, + filterzendesk_ticket_idnot_eq: Unset | str = UNSET, + filterzendesk_ticket_idin: Unset | str = UNSET, + filterzendesk_ticket_idnot_in: Unset | str = UNSET, + filtersequential_ideq: Unset | str = UNSET, + filtersequential_idnot_eq: Unset | str = UNSET, + filtersequential_idin: Unset | str = UNSET, + filtersequential_idnot_in: Unset | str = UNSET, + filtertypeseq: Unset | str = UNSET, + filtertypesnot_eq: Unset | str = UNSET, + filtertypesin: Unset | str = UNSET, + filtertypesnot_in: Unset | str = UNSET, + filtertype_idseq: Unset | str = UNSET, + filtertype_idsnot_eq: Unset | str = UNSET, + filtertype_idsin: Unset | str = UNSET, + filtertype_idsnot_in: Unset | str = UNSET, + filterenvironmentseq: Unset | str = UNSET, + filterenvironmentsnot_eq: Unset | str = UNSET, + filterenvironmentsin: Unset | str = UNSET, + filterenvironmentsnot_in: Unset | str = UNSET, + filterenvironment_idseq: Unset | str = UNSET, + filterenvironment_idsnot_eq: Unset | str = UNSET, + filterenvironment_idsin: Unset | str = UNSET, + filterenvironment_idsnot_in: Unset | str = UNSET, + filterserviceseq: Unset | str = UNSET, + filterservicesnot_eq: Unset | str = UNSET, + filterservicesin: Unset | str = UNSET, + filterservicesnot_in: Unset | str = UNSET, + filterservice_idseq: Unset | str = UNSET, + filterservice_idsnot_eq: Unset | str = UNSET, + filterservice_idsin: Unset | str = UNSET, + filterservice_idsnot_in: Unset | str = UNSET, + filterservice_nameseq: Unset | str = UNSET, + filterservice_namesnot_eq: Unset | str = UNSET, + filterservice_namesin: Unset | str = UNSET, + filterservice_namesnot_in: Unset | str = UNSET, + filterfunctionalitieseq: Unset | str = UNSET, + filterfunctionalitiesnot_eq: Unset | str = UNSET, + filterfunctionalitiesin: Unset | str = UNSET, + filterfunctionalitiesnot_in: Unset | str = UNSET, + filterfunctionality_idseq: Unset | str = UNSET, + filterfunctionality_idsnot_eq: Unset | str = UNSET, + filterfunctionality_idsin: Unset | str = UNSET, + filterfunctionality_idsnot_in: Unset | str = UNSET, + filterfunctionality_nameseq: Unset | str = UNSET, + filterfunctionality_namesnot_eq: Unset | str = UNSET, + filterfunctionality_namesin: Unset | str = UNSET, + filterfunctionality_namesnot_in: Unset | str = UNSET, + filtercauseseq: Unset | str = UNSET, + filtercausesnot_eq: Unset | str = UNSET, + filtercausesin: Unset | str = UNSET, + filtercausesnot_in: Unset | str = UNSET, + filtercause_idseq: Unset | str = UNSET, + filtercause_idsnot_eq: Unset | str = UNSET, + filtercause_idsin: Unset | str = UNSET, + filtercause_idsnot_in: Unset | str = UNSET, + filterteamseq: Unset | str = UNSET, + filterteamsnot_eq: Unset | str = UNSET, + filterteamsin: Unset | str = UNSET, + filterteamsnot_in: Unset | str = UNSET, + filterteam_idseq: Unset | str = UNSET, + filterteam_idsnot_eq: Unset | str = UNSET, + filterteam_idsin: Unset | str = UNSET, + filterteam_idsnot_in: Unset | str = UNSET, + filterteam_nameseq: Unset | str = UNSET, + filterteam_namesnot_eq: Unset | str = UNSET, + filterteam_namesin: Unset | str = UNSET, + filterteam_namesnot_in: Unset | str = UNSET, + sort: Unset | ListIncidentsSort = UNSET, + include: Unset | ListIncidentsInclude = UNSET, +) -> Response[ErrorsList | IncidentList]: """List incidents List incidents @@ -1075,170 +1075,170 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - pageafter: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filterkind: Union[Unset, str] = UNSET, - filterstatus: Union[Unset, str] = UNSET, - filterprivate: Union[Unset, str] = UNSET, - filteruser_id: Union[Unset, int] = UNSET, - filterseverity: Union[Unset, str] = UNSET, - filterseverity_id: Union[Unset, str] = UNSET, - filterlabels: Union[Unset, str] = UNSET, - filtertypes: Union[Unset, str] = UNSET, - filtertype_ids: Union[Unset, str] = UNSET, - filterenvironments: Union[Unset, str] = UNSET, - filterenvironment_ids: Union[Unset, str] = UNSET, - filterfunctionalities: Union[Unset, str] = UNSET, - filterfunctionality_ids: Union[Unset, str] = UNSET, - filterfunctionality_names: Union[Unset, str] = UNSET, - filterservices: Union[Unset, str] = UNSET, - filterservice_ids: Union[Unset, str] = UNSET, - filterservice_names: Union[Unset, str] = UNSET, - filterteams: Union[Unset, str] = UNSET, - filterteam_ids: Union[Unset, str] = UNSET, - filterteam_names: Union[Unset, str] = UNSET, - filtercause: Union[Unset, str] = UNSET, - filtercause_ids: Union[Unset, str] = UNSET, - filtercustom_field_selected_option_ids: Union[Unset, str] = UNSET, - filterslack_channel_id: Union[Unset, str] = UNSET, - filtersequential_id: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filterupdated_atgt: Union[Unset, str] = UNSET, - filterupdated_atgte: Union[Unset, str] = UNSET, - filterupdated_atlt: Union[Unset, str] = UNSET, - filterupdated_atlte: Union[Unset, str] = UNSET, - filterstarted_atgt: Union[Unset, str] = UNSET, - filterstarted_atgte: Union[Unset, str] = UNSET, - filterstarted_atlt: Union[Unset, str] = UNSET, - filterstarted_atlte: Union[Unset, str] = UNSET, - filterdetected_atgt: Union[Unset, str] = UNSET, - filterdetected_atgte: Union[Unset, str] = UNSET, - filterdetected_atlt: Union[Unset, str] = UNSET, - filterdetected_atlte: Union[Unset, str] = UNSET, - filteracknowledged_atgt: Union[Unset, str] = UNSET, - filteracknowledged_atgte: Union[Unset, str] = UNSET, - filteracknowledged_atlt: Union[Unset, str] = UNSET, - filteracknowledged_atlte: Union[Unset, str] = UNSET, - filtermitigated_atgt: Union[Unset, str] = UNSET, - filtermitigated_atgte: Union[Unset, str] = UNSET, - filtermitigated_atlt: Union[Unset, str] = UNSET, - filtermitigated_atlte: Union[Unset, str] = UNSET, - filterresolved_atgt: Union[Unset, str] = UNSET, - filterresolved_atgte: Union[Unset, str] = UNSET, - filterresolved_atlt: Union[Unset, str] = UNSET, - filterresolved_atlte: Union[Unset, str] = UNSET, - filterclosed_atgt: Union[Unset, str] = UNSET, - filterclosed_atgte: Union[Unset, str] = UNSET, - filterclosed_atlt: Union[Unset, str] = UNSET, - filterclosed_atlte: Union[Unset, str] = UNSET, - filterin_triage_atgt: Union[Unset, str] = UNSET, - filterin_triage_atgte: Union[Unset, str] = UNSET, - filterin_triage_atlt: Union[Unset, str] = UNSET, - filterin_triage_atlte: Union[Unset, str] = UNSET, - filterkindeq: Union[Unset, str] = UNSET, - filterkindnot_eq: Union[Unset, str] = UNSET, - filterkindin: Union[Unset, str] = UNSET, - filterkindnot_in: Union[Unset, str] = UNSET, - filterstatuseq: Union[Unset, str] = UNSET, - filterstatusnot_eq: Union[Unset, str] = UNSET, - filterstatusin: Union[Unset, str] = UNSET, - filterstatusnot_in: Union[Unset, str] = UNSET, - filterprivateeq: Union[Unset, str] = UNSET, - filterprivatenot_eq: Union[Unset, str] = UNSET, - filterprivatein: Union[Unset, str] = UNSET, - filterprivatenot_in: Union[Unset, str] = UNSET, - filteruser_ideq: Union[Unset, str] = UNSET, - filteruser_idnot_eq: Union[Unset, str] = UNSET, - filteruser_idin: Union[Unset, str] = UNSET, - filteruser_idnot_in: Union[Unset, str] = UNSET, - filterseverityeq: Union[Unset, str] = UNSET, - filterseveritynot_eq: Union[Unset, str] = UNSET, - filterseverityin: Union[Unset, str] = UNSET, - filterseveritynot_in: Union[Unset, str] = UNSET, - filterseverity_ideq: Union[Unset, str] = UNSET, - filterseverity_idnot_eq: Union[Unset, str] = UNSET, - filterseverity_idin: Union[Unset, str] = UNSET, - filterseverity_idnot_in: Union[Unset, str] = UNSET, - filterlabelseq: Union[Unset, str] = UNSET, - filterlabelsnot_eq: Union[Unset, str] = UNSET, - filterlabelsin: Union[Unset, str] = UNSET, - filterlabelsnot_in: Union[Unset, str] = UNSET, - filterzendesk_ticket_ideq: Union[Unset, str] = UNSET, - filterzendesk_ticket_idnot_eq: Union[Unset, str] = UNSET, - filterzendesk_ticket_idin: Union[Unset, str] = UNSET, - filterzendesk_ticket_idnot_in: Union[Unset, str] = UNSET, - filtersequential_ideq: Union[Unset, str] = UNSET, - filtersequential_idnot_eq: Union[Unset, str] = UNSET, - filtersequential_idin: Union[Unset, str] = UNSET, - filtersequential_idnot_in: Union[Unset, str] = UNSET, - filtertypeseq: Union[Unset, str] = UNSET, - filtertypesnot_eq: Union[Unset, str] = UNSET, - filtertypesin: Union[Unset, str] = UNSET, - filtertypesnot_in: Union[Unset, str] = UNSET, - filtertype_idseq: Union[Unset, str] = UNSET, - filtertype_idsnot_eq: Union[Unset, str] = UNSET, - filtertype_idsin: Union[Unset, str] = UNSET, - filtertype_idsnot_in: Union[Unset, str] = UNSET, - filterenvironmentseq: Union[Unset, str] = UNSET, - filterenvironmentsnot_eq: Union[Unset, str] = UNSET, - filterenvironmentsin: Union[Unset, str] = UNSET, - filterenvironmentsnot_in: Union[Unset, str] = UNSET, - filterenvironment_idseq: Union[Unset, str] = UNSET, - filterenvironment_idsnot_eq: Union[Unset, str] = UNSET, - filterenvironment_idsin: Union[Unset, str] = UNSET, - filterenvironment_idsnot_in: Union[Unset, str] = UNSET, - filterserviceseq: Union[Unset, str] = UNSET, - filterservicesnot_eq: Union[Unset, str] = UNSET, - filterservicesin: Union[Unset, str] = UNSET, - filterservicesnot_in: Union[Unset, str] = UNSET, - filterservice_idseq: Union[Unset, str] = UNSET, - filterservice_idsnot_eq: Union[Unset, str] = UNSET, - filterservice_idsin: Union[Unset, str] = UNSET, - filterservice_idsnot_in: Union[Unset, str] = UNSET, - filterservice_nameseq: Union[Unset, str] = UNSET, - filterservice_namesnot_eq: Union[Unset, str] = UNSET, - filterservice_namesin: Union[Unset, str] = UNSET, - filterservice_namesnot_in: Union[Unset, str] = UNSET, - filterfunctionalitieseq: Union[Unset, str] = UNSET, - filterfunctionalitiesnot_eq: Union[Unset, str] = UNSET, - filterfunctionalitiesin: Union[Unset, str] = UNSET, - filterfunctionalitiesnot_in: Union[Unset, str] = UNSET, - filterfunctionality_idseq: Union[Unset, str] = UNSET, - filterfunctionality_idsnot_eq: Union[Unset, str] = UNSET, - filterfunctionality_idsin: Union[Unset, str] = UNSET, - filterfunctionality_idsnot_in: Union[Unset, str] = UNSET, - filterfunctionality_nameseq: Union[Unset, str] = UNSET, - filterfunctionality_namesnot_eq: Union[Unset, str] = UNSET, - filterfunctionality_namesin: Union[Unset, str] = UNSET, - filterfunctionality_namesnot_in: Union[Unset, str] = UNSET, - filtercauseseq: Union[Unset, str] = UNSET, - filtercausesnot_eq: Union[Unset, str] = UNSET, - filtercausesin: Union[Unset, str] = UNSET, - filtercausesnot_in: Union[Unset, str] = UNSET, - filtercause_idseq: Union[Unset, str] = UNSET, - filtercause_idsnot_eq: Union[Unset, str] = UNSET, - filtercause_idsin: Union[Unset, str] = UNSET, - filtercause_idsnot_in: Union[Unset, str] = UNSET, - filterteamseq: Union[Unset, str] = UNSET, - filterteamsnot_eq: Union[Unset, str] = UNSET, - filterteamsin: Union[Unset, str] = UNSET, - filterteamsnot_in: Union[Unset, str] = UNSET, - filterteam_idseq: Union[Unset, str] = UNSET, - filterteam_idsnot_eq: Union[Unset, str] = UNSET, - filterteam_idsin: Union[Unset, str] = UNSET, - filterteam_idsnot_in: Union[Unset, str] = UNSET, - filterteam_nameseq: Union[Unset, str] = UNSET, - filterteam_namesnot_eq: Union[Unset, str] = UNSET, - filterteam_namesin: Union[Unset, str] = UNSET, - filterteam_namesnot_in: Union[Unset, str] = UNSET, - sort: Union[Unset, ListIncidentsSort] = UNSET, - include: Union[Unset, ListIncidentsInclude] = UNSET, -) -> Optional[Union[ErrorsList, IncidentList]]: + pageafter: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filterstatus: Unset | str = UNSET, + filterprivate: Unset | str = UNSET, + filteruser_id: Unset | int = UNSET, + filterseverity: Unset | str = UNSET, + filterseverity_id: Unset | str = UNSET, + filterlabels: Unset | str = UNSET, + filtertypes: Unset | str = UNSET, + filtertype_ids: Unset | str = UNSET, + filterenvironments: Unset | str = UNSET, + filterenvironment_ids: Unset | str = UNSET, + filterfunctionalities: Unset | str = UNSET, + filterfunctionality_ids: Unset | str = UNSET, + filterfunctionality_names: Unset | str = UNSET, + filterservices: Unset | str = UNSET, + filterservice_ids: Unset | str = UNSET, + filterservice_names: Unset | str = UNSET, + filterteams: Unset | str = UNSET, + filterteam_ids: Unset | str = UNSET, + filterteam_names: Unset | str = UNSET, + filtercause: Unset | str = UNSET, + filtercause_ids: Unset | str = UNSET, + filtercustom_field_selected_option_ids: Unset | str = UNSET, + filterslack_channel_id: Unset | str = UNSET, + filtersequential_id: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterupdated_atgt: Unset | str = UNSET, + filterupdated_atgte: Unset | str = UNSET, + filterupdated_atlt: Unset | str = UNSET, + filterupdated_atlte: Unset | str = UNSET, + filterstarted_atgt: Unset | str = UNSET, + filterstarted_atgte: Unset | str = UNSET, + filterstarted_atlt: Unset | str = UNSET, + filterstarted_atlte: Unset | str = UNSET, + filterdetected_atgt: Unset | str = UNSET, + filterdetected_atgte: Unset | str = UNSET, + filterdetected_atlt: Unset | str = UNSET, + filterdetected_atlte: Unset | str = UNSET, + filteracknowledged_atgt: Unset | str = UNSET, + filteracknowledged_atgte: Unset | str = UNSET, + filteracknowledged_atlt: Unset | str = UNSET, + filteracknowledged_atlte: Unset | str = UNSET, + filtermitigated_atgt: Unset | str = UNSET, + filtermitigated_atgte: Unset | str = UNSET, + filtermitigated_atlt: Unset | str = UNSET, + filtermitigated_atlte: Unset | str = UNSET, + filterresolved_atgt: Unset | str = UNSET, + filterresolved_atgte: Unset | str = UNSET, + filterresolved_atlt: Unset | str = UNSET, + filterresolved_atlte: Unset | str = UNSET, + filterclosed_atgt: Unset | str = UNSET, + filterclosed_atgte: Unset | str = UNSET, + filterclosed_atlt: Unset | str = UNSET, + filterclosed_atlte: Unset | str = UNSET, + filterin_triage_atgt: Unset | str = UNSET, + filterin_triage_atgte: Unset | str = UNSET, + filterin_triage_atlt: Unset | str = UNSET, + filterin_triage_atlte: Unset | str = UNSET, + filterkindeq: Unset | str = UNSET, + filterkindnot_eq: Unset | str = UNSET, + filterkindin: Unset | str = UNSET, + filterkindnot_in: Unset | str = UNSET, + filterstatuseq: Unset | str = UNSET, + filterstatusnot_eq: Unset | str = UNSET, + filterstatusin: Unset | str = UNSET, + filterstatusnot_in: Unset | str = UNSET, + filterprivateeq: Unset | str = UNSET, + filterprivatenot_eq: Unset | str = UNSET, + filterprivatein: Unset | str = UNSET, + filterprivatenot_in: Unset | str = UNSET, + filteruser_ideq: Unset | str = UNSET, + filteruser_idnot_eq: Unset | str = UNSET, + filteruser_idin: Unset | str = UNSET, + filteruser_idnot_in: Unset | str = UNSET, + filterseverityeq: Unset | str = UNSET, + filterseveritynot_eq: Unset | str = UNSET, + filterseverityin: Unset | str = UNSET, + filterseveritynot_in: Unset | str = UNSET, + filterseverity_ideq: Unset | str = UNSET, + filterseverity_idnot_eq: Unset | str = UNSET, + filterseverity_idin: Unset | str = UNSET, + filterseverity_idnot_in: Unset | str = UNSET, + filterlabelseq: Unset | str = UNSET, + filterlabelsnot_eq: Unset | str = UNSET, + filterlabelsin: Unset | str = UNSET, + filterlabelsnot_in: Unset | str = UNSET, + filterzendesk_ticket_ideq: Unset | str = UNSET, + filterzendesk_ticket_idnot_eq: Unset | str = UNSET, + filterzendesk_ticket_idin: Unset | str = UNSET, + filterzendesk_ticket_idnot_in: Unset | str = UNSET, + filtersequential_ideq: Unset | str = UNSET, + filtersequential_idnot_eq: Unset | str = UNSET, + filtersequential_idin: Unset | str = UNSET, + filtersequential_idnot_in: Unset | str = UNSET, + filtertypeseq: Unset | str = UNSET, + filtertypesnot_eq: Unset | str = UNSET, + filtertypesin: Unset | str = UNSET, + filtertypesnot_in: Unset | str = UNSET, + filtertype_idseq: Unset | str = UNSET, + filtertype_idsnot_eq: Unset | str = UNSET, + filtertype_idsin: Unset | str = UNSET, + filtertype_idsnot_in: Unset | str = UNSET, + filterenvironmentseq: Unset | str = UNSET, + filterenvironmentsnot_eq: Unset | str = UNSET, + filterenvironmentsin: Unset | str = UNSET, + filterenvironmentsnot_in: Unset | str = UNSET, + filterenvironment_idseq: Unset | str = UNSET, + filterenvironment_idsnot_eq: Unset | str = UNSET, + filterenvironment_idsin: Unset | str = UNSET, + filterenvironment_idsnot_in: Unset | str = UNSET, + filterserviceseq: Unset | str = UNSET, + filterservicesnot_eq: Unset | str = UNSET, + filterservicesin: Unset | str = UNSET, + filterservicesnot_in: Unset | str = UNSET, + filterservice_idseq: Unset | str = UNSET, + filterservice_idsnot_eq: Unset | str = UNSET, + filterservice_idsin: Unset | str = UNSET, + filterservice_idsnot_in: Unset | str = UNSET, + filterservice_nameseq: Unset | str = UNSET, + filterservice_namesnot_eq: Unset | str = UNSET, + filterservice_namesin: Unset | str = UNSET, + filterservice_namesnot_in: Unset | str = UNSET, + filterfunctionalitieseq: Unset | str = UNSET, + filterfunctionalitiesnot_eq: Unset | str = UNSET, + filterfunctionalitiesin: Unset | str = UNSET, + filterfunctionalitiesnot_in: Unset | str = UNSET, + filterfunctionality_idseq: Unset | str = UNSET, + filterfunctionality_idsnot_eq: Unset | str = UNSET, + filterfunctionality_idsin: Unset | str = UNSET, + filterfunctionality_idsnot_in: Unset | str = UNSET, + filterfunctionality_nameseq: Unset | str = UNSET, + filterfunctionality_namesnot_eq: Unset | str = UNSET, + filterfunctionality_namesin: Unset | str = UNSET, + filterfunctionality_namesnot_in: Unset | str = UNSET, + filtercauseseq: Unset | str = UNSET, + filtercausesnot_eq: Unset | str = UNSET, + filtercausesin: Unset | str = UNSET, + filtercausesnot_in: Unset | str = UNSET, + filtercause_idseq: Unset | str = UNSET, + filtercause_idsnot_eq: Unset | str = UNSET, + filtercause_idsin: Unset | str = UNSET, + filtercause_idsnot_in: Unset | str = UNSET, + filterteamseq: Unset | str = UNSET, + filterteamsnot_eq: Unset | str = UNSET, + filterteamsin: Unset | str = UNSET, + filterteamsnot_in: Unset | str = UNSET, + filterteam_idseq: Unset | str = UNSET, + filterteam_idsnot_eq: Unset | str = UNSET, + filterteam_idsin: Unset | str = UNSET, + filterteam_idsnot_in: Unset | str = UNSET, + filterteam_nameseq: Unset | str = UNSET, + filterteam_namesnot_eq: Unset | str = UNSET, + filterteam_namesin: Unset | str = UNSET, + filterteam_namesnot_in: Unset | str = UNSET, + sort: Unset | ListIncidentsSort = UNSET, + include: Unset | ListIncidentsInclude = UNSET, +) -> ErrorsList | IncidentList | None: """List incidents List incidents @@ -1587,170 +1587,170 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - pageafter: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filterkind: Union[Unset, str] = UNSET, - filterstatus: Union[Unset, str] = UNSET, - filterprivate: Union[Unset, str] = UNSET, - filteruser_id: Union[Unset, int] = UNSET, - filterseverity: Union[Unset, str] = UNSET, - filterseverity_id: Union[Unset, str] = UNSET, - filterlabels: Union[Unset, str] = UNSET, - filtertypes: Union[Unset, str] = UNSET, - filtertype_ids: Union[Unset, str] = UNSET, - filterenvironments: Union[Unset, str] = UNSET, - filterenvironment_ids: Union[Unset, str] = UNSET, - filterfunctionalities: Union[Unset, str] = UNSET, - filterfunctionality_ids: Union[Unset, str] = UNSET, - filterfunctionality_names: Union[Unset, str] = UNSET, - filterservices: Union[Unset, str] = UNSET, - filterservice_ids: Union[Unset, str] = UNSET, - filterservice_names: Union[Unset, str] = UNSET, - filterteams: Union[Unset, str] = UNSET, - filterteam_ids: Union[Unset, str] = UNSET, - filterteam_names: Union[Unset, str] = UNSET, - filtercause: Union[Unset, str] = UNSET, - filtercause_ids: Union[Unset, str] = UNSET, - filtercustom_field_selected_option_ids: Union[Unset, str] = UNSET, - filterslack_channel_id: Union[Unset, str] = UNSET, - filtersequential_id: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filterupdated_atgt: Union[Unset, str] = UNSET, - filterupdated_atgte: Union[Unset, str] = UNSET, - filterupdated_atlt: Union[Unset, str] = UNSET, - filterupdated_atlte: Union[Unset, str] = UNSET, - filterstarted_atgt: Union[Unset, str] = UNSET, - filterstarted_atgte: Union[Unset, str] = UNSET, - filterstarted_atlt: Union[Unset, str] = UNSET, - filterstarted_atlte: Union[Unset, str] = UNSET, - filterdetected_atgt: Union[Unset, str] = UNSET, - filterdetected_atgte: Union[Unset, str] = UNSET, - filterdetected_atlt: Union[Unset, str] = UNSET, - filterdetected_atlte: Union[Unset, str] = UNSET, - filteracknowledged_atgt: Union[Unset, str] = UNSET, - filteracknowledged_atgte: Union[Unset, str] = UNSET, - filteracknowledged_atlt: Union[Unset, str] = UNSET, - filteracknowledged_atlte: Union[Unset, str] = UNSET, - filtermitigated_atgt: Union[Unset, str] = UNSET, - filtermitigated_atgte: Union[Unset, str] = UNSET, - filtermitigated_atlt: Union[Unset, str] = UNSET, - filtermitigated_atlte: Union[Unset, str] = UNSET, - filterresolved_atgt: Union[Unset, str] = UNSET, - filterresolved_atgte: Union[Unset, str] = UNSET, - filterresolved_atlt: Union[Unset, str] = UNSET, - filterresolved_atlte: Union[Unset, str] = UNSET, - filterclosed_atgt: Union[Unset, str] = UNSET, - filterclosed_atgte: Union[Unset, str] = UNSET, - filterclosed_atlt: Union[Unset, str] = UNSET, - filterclosed_atlte: Union[Unset, str] = UNSET, - filterin_triage_atgt: Union[Unset, str] = UNSET, - filterin_triage_atgte: Union[Unset, str] = UNSET, - filterin_triage_atlt: Union[Unset, str] = UNSET, - filterin_triage_atlte: Union[Unset, str] = UNSET, - filterkindeq: Union[Unset, str] = UNSET, - filterkindnot_eq: Union[Unset, str] = UNSET, - filterkindin: Union[Unset, str] = UNSET, - filterkindnot_in: Union[Unset, str] = UNSET, - filterstatuseq: Union[Unset, str] = UNSET, - filterstatusnot_eq: Union[Unset, str] = UNSET, - filterstatusin: Union[Unset, str] = UNSET, - filterstatusnot_in: Union[Unset, str] = UNSET, - filterprivateeq: Union[Unset, str] = UNSET, - filterprivatenot_eq: Union[Unset, str] = UNSET, - filterprivatein: Union[Unset, str] = UNSET, - filterprivatenot_in: Union[Unset, str] = UNSET, - filteruser_ideq: Union[Unset, str] = UNSET, - filteruser_idnot_eq: Union[Unset, str] = UNSET, - filteruser_idin: Union[Unset, str] = UNSET, - filteruser_idnot_in: Union[Unset, str] = UNSET, - filterseverityeq: Union[Unset, str] = UNSET, - filterseveritynot_eq: Union[Unset, str] = UNSET, - filterseverityin: Union[Unset, str] = UNSET, - filterseveritynot_in: Union[Unset, str] = UNSET, - filterseverity_ideq: Union[Unset, str] = UNSET, - filterseverity_idnot_eq: Union[Unset, str] = UNSET, - filterseverity_idin: Union[Unset, str] = UNSET, - filterseverity_idnot_in: Union[Unset, str] = UNSET, - filterlabelseq: Union[Unset, str] = UNSET, - filterlabelsnot_eq: Union[Unset, str] = UNSET, - filterlabelsin: Union[Unset, str] = UNSET, - filterlabelsnot_in: Union[Unset, str] = UNSET, - filterzendesk_ticket_ideq: Union[Unset, str] = UNSET, - filterzendesk_ticket_idnot_eq: Union[Unset, str] = UNSET, - filterzendesk_ticket_idin: Union[Unset, str] = UNSET, - filterzendesk_ticket_idnot_in: Union[Unset, str] = UNSET, - filtersequential_ideq: Union[Unset, str] = UNSET, - filtersequential_idnot_eq: Union[Unset, str] = UNSET, - filtersequential_idin: Union[Unset, str] = UNSET, - filtersequential_idnot_in: Union[Unset, str] = UNSET, - filtertypeseq: Union[Unset, str] = UNSET, - filtertypesnot_eq: Union[Unset, str] = UNSET, - filtertypesin: Union[Unset, str] = UNSET, - filtertypesnot_in: Union[Unset, str] = UNSET, - filtertype_idseq: Union[Unset, str] = UNSET, - filtertype_idsnot_eq: Union[Unset, str] = UNSET, - filtertype_idsin: Union[Unset, str] = UNSET, - filtertype_idsnot_in: Union[Unset, str] = UNSET, - filterenvironmentseq: Union[Unset, str] = UNSET, - filterenvironmentsnot_eq: Union[Unset, str] = UNSET, - filterenvironmentsin: Union[Unset, str] = UNSET, - filterenvironmentsnot_in: Union[Unset, str] = UNSET, - filterenvironment_idseq: Union[Unset, str] = UNSET, - filterenvironment_idsnot_eq: Union[Unset, str] = UNSET, - filterenvironment_idsin: Union[Unset, str] = UNSET, - filterenvironment_idsnot_in: Union[Unset, str] = UNSET, - filterserviceseq: Union[Unset, str] = UNSET, - filterservicesnot_eq: Union[Unset, str] = UNSET, - filterservicesin: Union[Unset, str] = UNSET, - filterservicesnot_in: Union[Unset, str] = UNSET, - filterservice_idseq: Union[Unset, str] = UNSET, - filterservice_idsnot_eq: Union[Unset, str] = UNSET, - filterservice_idsin: Union[Unset, str] = UNSET, - filterservice_idsnot_in: Union[Unset, str] = UNSET, - filterservice_nameseq: Union[Unset, str] = UNSET, - filterservice_namesnot_eq: Union[Unset, str] = UNSET, - filterservice_namesin: Union[Unset, str] = UNSET, - filterservice_namesnot_in: Union[Unset, str] = UNSET, - filterfunctionalitieseq: Union[Unset, str] = UNSET, - filterfunctionalitiesnot_eq: Union[Unset, str] = UNSET, - filterfunctionalitiesin: Union[Unset, str] = UNSET, - filterfunctionalitiesnot_in: Union[Unset, str] = UNSET, - filterfunctionality_idseq: Union[Unset, str] = UNSET, - filterfunctionality_idsnot_eq: Union[Unset, str] = UNSET, - filterfunctionality_idsin: Union[Unset, str] = UNSET, - filterfunctionality_idsnot_in: Union[Unset, str] = UNSET, - filterfunctionality_nameseq: Union[Unset, str] = UNSET, - filterfunctionality_namesnot_eq: Union[Unset, str] = UNSET, - filterfunctionality_namesin: Union[Unset, str] = UNSET, - filterfunctionality_namesnot_in: Union[Unset, str] = UNSET, - filtercauseseq: Union[Unset, str] = UNSET, - filtercausesnot_eq: Union[Unset, str] = UNSET, - filtercausesin: Union[Unset, str] = UNSET, - filtercausesnot_in: Union[Unset, str] = UNSET, - filtercause_idseq: Union[Unset, str] = UNSET, - filtercause_idsnot_eq: Union[Unset, str] = UNSET, - filtercause_idsin: Union[Unset, str] = UNSET, - filtercause_idsnot_in: Union[Unset, str] = UNSET, - filterteamseq: Union[Unset, str] = UNSET, - filterteamsnot_eq: Union[Unset, str] = UNSET, - filterteamsin: Union[Unset, str] = UNSET, - filterteamsnot_in: Union[Unset, str] = UNSET, - filterteam_idseq: Union[Unset, str] = UNSET, - filterteam_idsnot_eq: Union[Unset, str] = UNSET, - filterteam_idsin: Union[Unset, str] = UNSET, - filterteam_idsnot_in: Union[Unset, str] = UNSET, - filterteam_nameseq: Union[Unset, str] = UNSET, - filterteam_namesnot_eq: Union[Unset, str] = UNSET, - filterteam_namesin: Union[Unset, str] = UNSET, - filterteam_namesnot_in: Union[Unset, str] = UNSET, - sort: Union[Unset, ListIncidentsSort] = UNSET, - include: Union[Unset, ListIncidentsInclude] = UNSET, -) -> Response[Union[ErrorsList, IncidentList]]: + pageafter: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filterstatus: Unset | str = UNSET, + filterprivate: Unset | str = UNSET, + filteruser_id: Unset | int = UNSET, + filterseverity: Unset | str = UNSET, + filterseverity_id: Unset | str = UNSET, + filterlabels: Unset | str = UNSET, + filtertypes: Unset | str = UNSET, + filtertype_ids: Unset | str = UNSET, + filterenvironments: Unset | str = UNSET, + filterenvironment_ids: Unset | str = UNSET, + filterfunctionalities: Unset | str = UNSET, + filterfunctionality_ids: Unset | str = UNSET, + filterfunctionality_names: Unset | str = UNSET, + filterservices: Unset | str = UNSET, + filterservice_ids: Unset | str = UNSET, + filterservice_names: Unset | str = UNSET, + filterteams: Unset | str = UNSET, + filterteam_ids: Unset | str = UNSET, + filterteam_names: Unset | str = UNSET, + filtercause: Unset | str = UNSET, + filtercause_ids: Unset | str = UNSET, + filtercustom_field_selected_option_ids: Unset | str = UNSET, + filterslack_channel_id: Unset | str = UNSET, + filtersequential_id: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterupdated_atgt: Unset | str = UNSET, + filterupdated_atgte: Unset | str = UNSET, + filterupdated_atlt: Unset | str = UNSET, + filterupdated_atlte: Unset | str = UNSET, + filterstarted_atgt: Unset | str = UNSET, + filterstarted_atgte: Unset | str = UNSET, + filterstarted_atlt: Unset | str = UNSET, + filterstarted_atlte: Unset | str = UNSET, + filterdetected_atgt: Unset | str = UNSET, + filterdetected_atgte: Unset | str = UNSET, + filterdetected_atlt: Unset | str = UNSET, + filterdetected_atlte: Unset | str = UNSET, + filteracknowledged_atgt: Unset | str = UNSET, + filteracknowledged_atgte: Unset | str = UNSET, + filteracknowledged_atlt: Unset | str = UNSET, + filteracknowledged_atlte: Unset | str = UNSET, + filtermitigated_atgt: Unset | str = UNSET, + filtermitigated_atgte: Unset | str = UNSET, + filtermitigated_atlt: Unset | str = UNSET, + filtermitigated_atlte: Unset | str = UNSET, + filterresolved_atgt: Unset | str = UNSET, + filterresolved_atgte: Unset | str = UNSET, + filterresolved_atlt: Unset | str = UNSET, + filterresolved_atlte: Unset | str = UNSET, + filterclosed_atgt: Unset | str = UNSET, + filterclosed_atgte: Unset | str = UNSET, + filterclosed_atlt: Unset | str = UNSET, + filterclosed_atlte: Unset | str = UNSET, + filterin_triage_atgt: Unset | str = UNSET, + filterin_triage_atgte: Unset | str = UNSET, + filterin_triage_atlt: Unset | str = UNSET, + filterin_triage_atlte: Unset | str = UNSET, + filterkindeq: Unset | str = UNSET, + filterkindnot_eq: Unset | str = UNSET, + filterkindin: Unset | str = UNSET, + filterkindnot_in: Unset | str = UNSET, + filterstatuseq: Unset | str = UNSET, + filterstatusnot_eq: Unset | str = UNSET, + filterstatusin: Unset | str = UNSET, + filterstatusnot_in: Unset | str = UNSET, + filterprivateeq: Unset | str = UNSET, + filterprivatenot_eq: Unset | str = UNSET, + filterprivatein: Unset | str = UNSET, + filterprivatenot_in: Unset | str = UNSET, + filteruser_ideq: Unset | str = UNSET, + filteruser_idnot_eq: Unset | str = UNSET, + filteruser_idin: Unset | str = UNSET, + filteruser_idnot_in: Unset | str = UNSET, + filterseverityeq: Unset | str = UNSET, + filterseveritynot_eq: Unset | str = UNSET, + filterseverityin: Unset | str = UNSET, + filterseveritynot_in: Unset | str = UNSET, + filterseverity_ideq: Unset | str = UNSET, + filterseverity_idnot_eq: Unset | str = UNSET, + filterseverity_idin: Unset | str = UNSET, + filterseverity_idnot_in: Unset | str = UNSET, + filterlabelseq: Unset | str = UNSET, + filterlabelsnot_eq: Unset | str = UNSET, + filterlabelsin: Unset | str = UNSET, + filterlabelsnot_in: Unset | str = UNSET, + filterzendesk_ticket_ideq: Unset | str = UNSET, + filterzendesk_ticket_idnot_eq: Unset | str = UNSET, + filterzendesk_ticket_idin: Unset | str = UNSET, + filterzendesk_ticket_idnot_in: Unset | str = UNSET, + filtersequential_ideq: Unset | str = UNSET, + filtersequential_idnot_eq: Unset | str = UNSET, + filtersequential_idin: Unset | str = UNSET, + filtersequential_idnot_in: Unset | str = UNSET, + filtertypeseq: Unset | str = UNSET, + filtertypesnot_eq: Unset | str = UNSET, + filtertypesin: Unset | str = UNSET, + filtertypesnot_in: Unset | str = UNSET, + filtertype_idseq: Unset | str = UNSET, + filtertype_idsnot_eq: Unset | str = UNSET, + filtertype_idsin: Unset | str = UNSET, + filtertype_idsnot_in: Unset | str = UNSET, + filterenvironmentseq: Unset | str = UNSET, + filterenvironmentsnot_eq: Unset | str = UNSET, + filterenvironmentsin: Unset | str = UNSET, + filterenvironmentsnot_in: Unset | str = UNSET, + filterenvironment_idseq: Unset | str = UNSET, + filterenvironment_idsnot_eq: Unset | str = UNSET, + filterenvironment_idsin: Unset | str = UNSET, + filterenvironment_idsnot_in: Unset | str = UNSET, + filterserviceseq: Unset | str = UNSET, + filterservicesnot_eq: Unset | str = UNSET, + filterservicesin: Unset | str = UNSET, + filterservicesnot_in: Unset | str = UNSET, + filterservice_idseq: Unset | str = UNSET, + filterservice_idsnot_eq: Unset | str = UNSET, + filterservice_idsin: Unset | str = UNSET, + filterservice_idsnot_in: Unset | str = UNSET, + filterservice_nameseq: Unset | str = UNSET, + filterservice_namesnot_eq: Unset | str = UNSET, + filterservice_namesin: Unset | str = UNSET, + filterservice_namesnot_in: Unset | str = UNSET, + filterfunctionalitieseq: Unset | str = UNSET, + filterfunctionalitiesnot_eq: Unset | str = UNSET, + filterfunctionalitiesin: Unset | str = UNSET, + filterfunctionalitiesnot_in: Unset | str = UNSET, + filterfunctionality_idseq: Unset | str = UNSET, + filterfunctionality_idsnot_eq: Unset | str = UNSET, + filterfunctionality_idsin: Unset | str = UNSET, + filterfunctionality_idsnot_in: Unset | str = UNSET, + filterfunctionality_nameseq: Unset | str = UNSET, + filterfunctionality_namesnot_eq: Unset | str = UNSET, + filterfunctionality_namesin: Unset | str = UNSET, + filterfunctionality_namesnot_in: Unset | str = UNSET, + filtercauseseq: Unset | str = UNSET, + filtercausesnot_eq: Unset | str = UNSET, + filtercausesin: Unset | str = UNSET, + filtercausesnot_in: Unset | str = UNSET, + filtercause_idseq: Unset | str = UNSET, + filtercause_idsnot_eq: Unset | str = UNSET, + filtercause_idsin: Unset | str = UNSET, + filtercause_idsnot_in: Unset | str = UNSET, + filterteamseq: Unset | str = UNSET, + filterteamsnot_eq: Unset | str = UNSET, + filterteamsin: Unset | str = UNSET, + filterteamsnot_in: Unset | str = UNSET, + filterteam_idseq: Unset | str = UNSET, + filterteam_idsnot_eq: Unset | str = UNSET, + filterteam_idsin: Unset | str = UNSET, + filterteam_idsnot_in: Unset | str = UNSET, + filterteam_nameseq: Unset | str = UNSET, + filterteam_namesnot_eq: Unset | str = UNSET, + filterteam_namesin: Unset | str = UNSET, + filterteam_namesnot_in: Unset | str = UNSET, + sort: Unset | ListIncidentsSort = UNSET, + include: Unset | ListIncidentsInclude = UNSET, +) -> Response[ErrorsList | IncidentList]: """List incidents List incidents @@ -2102,170 +2102,170 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - pageafter: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filterkind: Union[Unset, str] = UNSET, - filterstatus: Union[Unset, str] = UNSET, - filterprivate: Union[Unset, str] = UNSET, - filteruser_id: Union[Unset, int] = UNSET, - filterseverity: Union[Unset, str] = UNSET, - filterseverity_id: Union[Unset, str] = UNSET, - filterlabels: Union[Unset, str] = UNSET, - filtertypes: Union[Unset, str] = UNSET, - filtertype_ids: Union[Unset, str] = UNSET, - filterenvironments: Union[Unset, str] = UNSET, - filterenvironment_ids: Union[Unset, str] = UNSET, - filterfunctionalities: Union[Unset, str] = UNSET, - filterfunctionality_ids: Union[Unset, str] = UNSET, - filterfunctionality_names: Union[Unset, str] = UNSET, - filterservices: Union[Unset, str] = UNSET, - filterservice_ids: Union[Unset, str] = UNSET, - filterservice_names: Union[Unset, str] = UNSET, - filterteams: Union[Unset, str] = UNSET, - filterteam_ids: Union[Unset, str] = UNSET, - filterteam_names: Union[Unset, str] = UNSET, - filtercause: Union[Unset, str] = UNSET, - filtercause_ids: Union[Unset, str] = UNSET, - filtercustom_field_selected_option_ids: Union[Unset, str] = UNSET, - filterslack_channel_id: Union[Unset, str] = UNSET, - filtersequential_id: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filterupdated_atgt: Union[Unset, str] = UNSET, - filterupdated_atgte: Union[Unset, str] = UNSET, - filterupdated_atlt: Union[Unset, str] = UNSET, - filterupdated_atlte: Union[Unset, str] = UNSET, - filterstarted_atgt: Union[Unset, str] = UNSET, - filterstarted_atgte: Union[Unset, str] = UNSET, - filterstarted_atlt: Union[Unset, str] = UNSET, - filterstarted_atlte: Union[Unset, str] = UNSET, - filterdetected_atgt: Union[Unset, str] = UNSET, - filterdetected_atgte: Union[Unset, str] = UNSET, - filterdetected_atlt: Union[Unset, str] = UNSET, - filterdetected_atlte: Union[Unset, str] = UNSET, - filteracknowledged_atgt: Union[Unset, str] = UNSET, - filteracknowledged_atgte: Union[Unset, str] = UNSET, - filteracknowledged_atlt: Union[Unset, str] = UNSET, - filteracknowledged_atlte: Union[Unset, str] = UNSET, - filtermitigated_atgt: Union[Unset, str] = UNSET, - filtermitigated_atgte: Union[Unset, str] = UNSET, - filtermitigated_atlt: Union[Unset, str] = UNSET, - filtermitigated_atlte: Union[Unset, str] = UNSET, - filterresolved_atgt: Union[Unset, str] = UNSET, - filterresolved_atgte: Union[Unset, str] = UNSET, - filterresolved_atlt: Union[Unset, str] = UNSET, - filterresolved_atlte: Union[Unset, str] = UNSET, - filterclosed_atgt: Union[Unset, str] = UNSET, - filterclosed_atgte: Union[Unset, str] = UNSET, - filterclosed_atlt: Union[Unset, str] = UNSET, - filterclosed_atlte: Union[Unset, str] = UNSET, - filterin_triage_atgt: Union[Unset, str] = UNSET, - filterin_triage_atgte: Union[Unset, str] = UNSET, - filterin_triage_atlt: Union[Unset, str] = UNSET, - filterin_triage_atlte: Union[Unset, str] = UNSET, - filterkindeq: Union[Unset, str] = UNSET, - filterkindnot_eq: Union[Unset, str] = UNSET, - filterkindin: Union[Unset, str] = UNSET, - filterkindnot_in: Union[Unset, str] = UNSET, - filterstatuseq: Union[Unset, str] = UNSET, - filterstatusnot_eq: Union[Unset, str] = UNSET, - filterstatusin: Union[Unset, str] = UNSET, - filterstatusnot_in: Union[Unset, str] = UNSET, - filterprivateeq: Union[Unset, str] = UNSET, - filterprivatenot_eq: Union[Unset, str] = UNSET, - filterprivatein: Union[Unset, str] = UNSET, - filterprivatenot_in: Union[Unset, str] = UNSET, - filteruser_ideq: Union[Unset, str] = UNSET, - filteruser_idnot_eq: Union[Unset, str] = UNSET, - filteruser_idin: Union[Unset, str] = UNSET, - filteruser_idnot_in: Union[Unset, str] = UNSET, - filterseverityeq: Union[Unset, str] = UNSET, - filterseveritynot_eq: Union[Unset, str] = UNSET, - filterseverityin: Union[Unset, str] = UNSET, - filterseveritynot_in: Union[Unset, str] = UNSET, - filterseverity_ideq: Union[Unset, str] = UNSET, - filterseverity_idnot_eq: Union[Unset, str] = UNSET, - filterseverity_idin: Union[Unset, str] = UNSET, - filterseverity_idnot_in: Union[Unset, str] = UNSET, - filterlabelseq: Union[Unset, str] = UNSET, - filterlabelsnot_eq: Union[Unset, str] = UNSET, - filterlabelsin: Union[Unset, str] = UNSET, - filterlabelsnot_in: Union[Unset, str] = UNSET, - filterzendesk_ticket_ideq: Union[Unset, str] = UNSET, - filterzendesk_ticket_idnot_eq: Union[Unset, str] = UNSET, - filterzendesk_ticket_idin: Union[Unset, str] = UNSET, - filterzendesk_ticket_idnot_in: Union[Unset, str] = UNSET, - filtersequential_ideq: Union[Unset, str] = UNSET, - filtersequential_idnot_eq: Union[Unset, str] = UNSET, - filtersequential_idin: Union[Unset, str] = UNSET, - filtersequential_idnot_in: Union[Unset, str] = UNSET, - filtertypeseq: Union[Unset, str] = UNSET, - filtertypesnot_eq: Union[Unset, str] = UNSET, - filtertypesin: Union[Unset, str] = UNSET, - filtertypesnot_in: Union[Unset, str] = UNSET, - filtertype_idseq: Union[Unset, str] = UNSET, - filtertype_idsnot_eq: Union[Unset, str] = UNSET, - filtertype_idsin: Union[Unset, str] = UNSET, - filtertype_idsnot_in: Union[Unset, str] = UNSET, - filterenvironmentseq: Union[Unset, str] = UNSET, - filterenvironmentsnot_eq: Union[Unset, str] = UNSET, - filterenvironmentsin: Union[Unset, str] = UNSET, - filterenvironmentsnot_in: Union[Unset, str] = UNSET, - filterenvironment_idseq: Union[Unset, str] = UNSET, - filterenvironment_idsnot_eq: Union[Unset, str] = UNSET, - filterenvironment_idsin: Union[Unset, str] = UNSET, - filterenvironment_idsnot_in: Union[Unset, str] = UNSET, - filterserviceseq: Union[Unset, str] = UNSET, - filterservicesnot_eq: Union[Unset, str] = UNSET, - filterservicesin: Union[Unset, str] = UNSET, - filterservicesnot_in: Union[Unset, str] = UNSET, - filterservice_idseq: Union[Unset, str] = UNSET, - filterservice_idsnot_eq: Union[Unset, str] = UNSET, - filterservice_idsin: Union[Unset, str] = UNSET, - filterservice_idsnot_in: Union[Unset, str] = UNSET, - filterservice_nameseq: Union[Unset, str] = UNSET, - filterservice_namesnot_eq: Union[Unset, str] = UNSET, - filterservice_namesin: Union[Unset, str] = UNSET, - filterservice_namesnot_in: Union[Unset, str] = UNSET, - filterfunctionalitieseq: Union[Unset, str] = UNSET, - filterfunctionalitiesnot_eq: Union[Unset, str] = UNSET, - filterfunctionalitiesin: Union[Unset, str] = UNSET, - filterfunctionalitiesnot_in: Union[Unset, str] = UNSET, - filterfunctionality_idseq: Union[Unset, str] = UNSET, - filterfunctionality_idsnot_eq: Union[Unset, str] = UNSET, - filterfunctionality_idsin: Union[Unset, str] = UNSET, - filterfunctionality_idsnot_in: Union[Unset, str] = UNSET, - filterfunctionality_nameseq: Union[Unset, str] = UNSET, - filterfunctionality_namesnot_eq: Union[Unset, str] = UNSET, - filterfunctionality_namesin: Union[Unset, str] = UNSET, - filterfunctionality_namesnot_in: Union[Unset, str] = UNSET, - filtercauseseq: Union[Unset, str] = UNSET, - filtercausesnot_eq: Union[Unset, str] = UNSET, - filtercausesin: Union[Unset, str] = UNSET, - filtercausesnot_in: Union[Unset, str] = UNSET, - filtercause_idseq: Union[Unset, str] = UNSET, - filtercause_idsnot_eq: Union[Unset, str] = UNSET, - filtercause_idsin: Union[Unset, str] = UNSET, - filtercause_idsnot_in: Union[Unset, str] = UNSET, - filterteamseq: Union[Unset, str] = UNSET, - filterteamsnot_eq: Union[Unset, str] = UNSET, - filterteamsin: Union[Unset, str] = UNSET, - filterteamsnot_in: Union[Unset, str] = UNSET, - filterteam_idseq: Union[Unset, str] = UNSET, - filterteam_idsnot_eq: Union[Unset, str] = UNSET, - filterteam_idsin: Union[Unset, str] = UNSET, - filterteam_idsnot_in: Union[Unset, str] = UNSET, - filterteam_nameseq: Union[Unset, str] = UNSET, - filterteam_namesnot_eq: Union[Unset, str] = UNSET, - filterteam_namesin: Union[Unset, str] = UNSET, - filterteam_namesnot_in: Union[Unset, str] = UNSET, - sort: Union[Unset, ListIncidentsSort] = UNSET, - include: Union[Unset, ListIncidentsInclude] = UNSET, -) -> Optional[Union[ErrorsList, IncidentList]]: + pageafter: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filterstatus: Unset | str = UNSET, + filterprivate: Unset | str = UNSET, + filteruser_id: Unset | int = UNSET, + filterseverity: Unset | str = UNSET, + filterseverity_id: Unset | str = UNSET, + filterlabels: Unset | str = UNSET, + filtertypes: Unset | str = UNSET, + filtertype_ids: Unset | str = UNSET, + filterenvironments: Unset | str = UNSET, + filterenvironment_ids: Unset | str = UNSET, + filterfunctionalities: Unset | str = UNSET, + filterfunctionality_ids: Unset | str = UNSET, + filterfunctionality_names: Unset | str = UNSET, + filterservices: Unset | str = UNSET, + filterservice_ids: Unset | str = UNSET, + filterservice_names: Unset | str = UNSET, + filterteams: Unset | str = UNSET, + filterteam_ids: Unset | str = UNSET, + filterteam_names: Unset | str = UNSET, + filtercause: Unset | str = UNSET, + filtercause_ids: Unset | str = UNSET, + filtercustom_field_selected_option_ids: Unset | str = UNSET, + filterslack_channel_id: Unset | str = UNSET, + filtersequential_id: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterupdated_atgt: Unset | str = UNSET, + filterupdated_atgte: Unset | str = UNSET, + filterupdated_atlt: Unset | str = UNSET, + filterupdated_atlte: Unset | str = UNSET, + filterstarted_atgt: Unset | str = UNSET, + filterstarted_atgte: Unset | str = UNSET, + filterstarted_atlt: Unset | str = UNSET, + filterstarted_atlte: Unset | str = UNSET, + filterdetected_atgt: Unset | str = UNSET, + filterdetected_atgte: Unset | str = UNSET, + filterdetected_atlt: Unset | str = UNSET, + filterdetected_atlte: Unset | str = UNSET, + filteracknowledged_atgt: Unset | str = UNSET, + filteracknowledged_atgte: Unset | str = UNSET, + filteracknowledged_atlt: Unset | str = UNSET, + filteracknowledged_atlte: Unset | str = UNSET, + filtermitigated_atgt: Unset | str = UNSET, + filtermitigated_atgte: Unset | str = UNSET, + filtermitigated_atlt: Unset | str = UNSET, + filtermitigated_atlte: Unset | str = UNSET, + filterresolved_atgt: Unset | str = UNSET, + filterresolved_atgte: Unset | str = UNSET, + filterresolved_atlt: Unset | str = UNSET, + filterresolved_atlte: Unset | str = UNSET, + filterclosed_atgt: Unset | str = UNSET, + filterclosed_atgte: Unset | str = UNSET, + filterclosed_atlt: Unset | str = UNSET, + filterclosed_atlte: Unset | str = UNSET, + filterin_triage_atgt: Unset | str = UNSET, + filterin_triage_atgte: Unset | str = UNSET, + filterin_triage_atlt: Unset | str = UNSET, + filterin_triage_atlte: Unset | str = UNSET, + filterkindeq: Unset | str = UNSET, + filterkindnot_eq: Unset | str = UNSET, + filterkindin: Unset | str = UNSET, + filterkindnot_in: Unset | str = UNSET, + filterstatuseq: Unset | str = UNSET, + filterstatusnot_eq: Unset | str = UNSET, + filterstatusin: Unset | str = UNSET, + filterstatusnot_in: Unset | str = UNSET, + filterprivateeq: Unset | str = UNSET, + filterprivatenot_eq: Unset | str = UNSET, + filterprivatein: Unset | str = UNSET, + filterprivatenot_in: Unset | str = UNSET, + filteruser_ideq: Unset | str = UNSET, + filteruser_idnot_eq: Unset | str = UNSET, + filteruser_idin: Unset | str = UNSET, + filteruser_idnot_in: Unset | str = UNSET, + filterseverityeq: Unset | str = UNSET, + filterseveritynot_eq: Unset | str = UNSET, + filterseverityin: Unset | str = UNSET, + filterseveritynot_in: Unset | str = UNSET, + filterseverity_ideq: Unset | str = UNSET, + filterseverity_idnot_eq: Unset | str = UNSET, + filterseverity_idin: Unset | str = UNSET, + filterseverity_idnot_in: Unset | str = UNSET, + filterlabelseq: Unset | str = UNSET, + filterlabelsnot_eq: Unset | str = UNSET, + filterlabelsin: Unset | str = UNSET, + filterlabelsnot_in: Unset | str = UNSET, + filterzendesk_ticket_ideq: Unset | str = UNSET, + filterzendesk_ticket_idnot_eq: Unset | str = UNSET, + filterzendesk_ticket_idin: Unset | str = UNSET, + filterzendesk_ticket_idnot_in: Unset | str = UNSET, + filtersequential_ideq: Unset | str = UNSET, + filtersequential_idnot_eq: Unset | str = UNSET, + filtersequential_idin: Unset | str = UNSET, + filtersequential_idnot_in: Unset | str = UNSET, + filtertypeseq: Unset | str = UNSET, + filtertypesnot_eq: Unset | str = UNSET, + filtertypesin: Unset | str = UNSET, + filtertypesnot_in: Unset | str = UNSET, + filtertype_idseq: Unset | str = UNSET, + filtertype_idsnot_eq: Unset | str = UNSET, + filtertype_idsin: Unset | str = UNSET, + filtertype_idsnot_in: Unset | str = UNSET, + filterenvironmentseq: Unset | str = UNSET, + filterenvironmentsnot_eq: Unset | str = UNSET, + filterenvironmentsin: Unset | str = UNSET, + filterenvironmentsnot_in: Unset | str = UNSET, + filterenvironment_idseq: Unset | str = UNSET, + filterenvironment_idsnot_eq: Unset | str = UNSET, + filterenvironment_idsin: Unset | str = UNSET, + filterenvironment_idsnot_in: Unset | str = UNSET, + filterserviceseq: Unset | str = UNSET, + filterservicesnot_eq: Unset | str = UNSET, + filterservicesin: Unset | str = UNSET, + filterservicesnot_in: Unset | str = UNSET, + filterservice_idseq: Unset | str = UNSET, + filterservice_idsnot_eq: Unset | str = UNSET, + filterservice_idsin: Unset | str = UNSET, + filterservice_idsnot_in: Unset | str = UNSET, + filterservice_nameseq: Unset | str = UNSET, + filterservice_namesnot_eq: Unset | str = UNSET, + filterservice_namesin: Unset | str = UNSET, + filterservice_namesnot_in: Unset | str = UNSET, + filterfunctionalitieseq: Unset | str = UNSET, + filterfunctionalitiesnot_eq: Unset | str = UNSET, + filterfunctionalitiesin: Unset | str = UNSET, + filterfunctionalitiesnot_in: Unset | str = UNSET, + filterfunctionality_idseq: Unset | str = UNSET, + filterfunctionality_idsnot_eq: Unset | str = UNSET, + filterfunctionality_idsin: Unset | str = UNSET, + filterfunctionality_idsnot_in: Unset | str = UNSET, + filterfunctionality_nameseq: Unset | str = UNSET, + filterfunctionality_namesnot_eq: Unset | str = UNSET, + filterfunctionality_namesin: Unset | str = UNSET, + filterfunctionality_namesnot_in: Unset | str = UNSET, + filtercauseseq: Unset | str = UNSET, + filtercausesnot_eq: Unset | str = UNSET, + filtercausesin: Unset | str = UNSET, + filtercausesnot_in: Unset | str = UNSET, + filtercause_idseq: Unset | str = UNSET, + filtercause_idsnot_eq: Unset | str = UNSET, + filtercause_idsin: Unset | str = UNSET, + filtercause_idsnot_in: Unset | str = UNSET, + filterteamseq: Unset | str = UNSET, + filterteamsnot_eq: Unset | str = UNSET, + filterteamsin: Unset | str = UNSET, + filterteamsnot_in: Unset | str = UNSET, + filterteam_idseq: Unset | str = UNSET, + filterteam_idsnot_eq: Unset | str = UNSET, + filterteam_idsin: Unset | str = UNSET, + filterteam_idsnot_in: Unset | str = UNSET, + filterteam_nameseq: Unset | str = UNSET, + filterteam_namesnot_eq: Unset | str = UNSET, + filterteam_namesin: Unset | str = UNSET, + filterteam_namesnot_in: Unset | str = UNSET, + sort: Unset | ListIncidentsSort = UNSET, + include: Unset | ListIncidentsInclude = UNSET, +) -> ErrorsList | IncidentList | None: """List incidents List incidents diff --git a/rootly_sdk/api/incidents/mark_as_duplicate_incident.py b/rootly_sdk/api/incidents/mark_as_duplicate_incident.py index 5c00bfce..d6ed447d 100644 --- a/rootly_sdk/api/incidents/mark_as_duplicate_incident.py +++ b/rootly_sdk/api/incidents/mark_as_duplicate_incident.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any from uuid import UUID import httpx @@ -13,7 +13,7 @@ def _get_kwargs( - id: Union[UUID, str], + id: UUID | str, *, body: ResolveIncident, ) -> dict[str, Any]: @@ -33,8 +33,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, IncidentResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | IncidentResponse | None: if response.status_code == 200: response_200 = IncidentResponse.from_dict(response.json()) @@ -52,8 +52,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, IncidentResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | IncidentResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -63,11 +63,11 @@ def _build_response( def sync_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: ResolveIncident, -) -> Response[Union[ErrorsList, IncidentResponse]]: +) -> Response[ErrorsList | IncidentResponse]: """Mark an incident as a duplicate Mark an incident as a duplicate @@ -97,11 +97,11 @@ def sync_detailed( def sync( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: ResolveIncident, -) -> Optional[Union[ErrorsList, IncidentResponse]]: +) -> ErrorsList | IncidentResponse | None: """Mark an incident as a duplicate Mark an incident as a duplicate @@ -126,11 +126,11 @@ def sync( async def asyncio_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: ResolveIncident, -) -> Response[Union[ErrorsList, IncidentResponse]]: +) -> Response[ErrorsList | IncidentResponse]: """Mark an incident as a duplicate Mark an incident as a duplicate @@ -158,11 +158,11 @@ async def asyncio_detailed( async def asyncio( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: ResolveIncident, -) -> Optional[Union[ErrorsList, IncidentResponse]]: +) -> ErrorsList | IncidentResponse | None: """Mark an incident as a duplicate Mark an incident as a duplicate diff --git a/rootly_sdk/api/incidents/mitigate_incident.py b/rootly_sdk/api/incidents/mitigate_incident.py index 903539bf..efb44525 100644 --- a/rootly_sdk/api/incidents/mitigate_incident.py +++ b/rootly_sdk/api/incidents/mitigate_incident.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any from uuid import UUID import httpx @@ -13,7 +13,7 @@ def _get_kwargs( - id: Union[UUID, str], + id: UUID | str, *, body: MitigateIncident, ) -> dict[str, Any]: @@ -33,8 +33,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, IncidentResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | IncidentResponse | None: if response.status_code == 200: response_200 = IncidentResponse.from_dict(response.json()) @@ -52,8 +52,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, IncidentResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | IncidentResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -63,11 +63,11 @@ def _build_response( def sync_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: MitigateIncident, -) -> Response[Union[ErrorsList, IncidentResponse]]: +) -> Response[ErrorsList | IncidentResponse]: """Mitigate an incident Mitigate a specific incident by id @@ -97,11 +97,11 @@ def sync_detailed( def sync( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: MitigateIncident, -) -> Optional[Union[ErrorsList, IncidentResponse]]: +) -> ErrorsList | IncidentResponse | None: """Mitigate an incident Mitigate a specific incident by id @@ -126,11 +126,11 @@ def sync( async def asyncio_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: MitigateIncident, -) -> Response[Union[ErrorsList, IncidentResponse]]: +) -> Response[ErrorsList | IncidentResponse]: """Mitigate an incident Mitigate a specific incident by id @@ -158,11 +158,11 @@ async def asyncio_detailed( async def asyncio( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: MitigateIncident, -) -> Optional[Union[ErrorsList, IncidentResponse]]: +) -> ErrorsList | IncidentResponse | None: """Mitigate an incident Mitigate a specific incident by id diff --git a/rootly_sdk/api/incidents/remove_assigned_user_from_incident.py b/rootly_sdk/api/incidents/remove_assigned_user_from_incident.py index 924fa2dd..ae393430 100644 --- a/rootly_sdk/api/incidents/remove_assigned_user_from_incident.py +++ b/rootly_sdk/api/incidents/remove_assigned_user_from_incident.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any from uuid import UUID import httpx @@ -13,7 +13,7 @@ def _get_kwargs( - id: Union[UUID, str], + id: UUID | str, *, body: UnassignRoleFromUser, ) -> dict[str, Any]: @@ -33,8 +33,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, IncidentResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | IncidentResponse | None: if response.status_code == 200: response_200 = IncidentResponse.from_dict(response.json()) @@ -52,8 +52,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, IncidentResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | IncidentResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -63,11 +63,11 @@ def _build_response( def sync_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UnassignRoleFromUser, -) -> Response[Union[ErrorsList, IncidentResponse]]: +) -> Response[ErrorsList | IncidentResponse]: """Remove assigned user from incident Remove assigned user from incident @@ -97,11 +97,11 @@ def sync_detailed( def sync( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UnassignRoleFromUser, -) -> Optional[Union[ErrorsList, IncidentResponse]]: +) -> ErrorsList | IncidentResponse | None: """Remove assigned user from incident Remove assigned user from incident @@ -126,11 +126,11 @@ def sync( async def asyncio_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UnassignRoleFromUser, -) -> Response[Union[ErrorsList, IncidentResponse]]: +) -> Response[ErrorsList | IncidentResponse]: """Remove assigned user from incident Remove assigned user from incident @@ -158,11 +158,11 @@ async def asyncio_detailed( async def asyncio( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UnassignRoleFromUser, -) -> Optional[Union[ErrorsList, IncidentResponse]]: +) -> ErrorsList | IncidentResponse | None: """Remove assigned user from incident Remove assigned user from incident diff --git a/rootly_sdk/api/incidents/remove_subscribers_to_incident.py b/rootly_sdk/api/incidents/remove_subscribers_to_incident.py index 1ad27b4b..ba5666eb 100644 --- a/rootly_sdk/api/incidents/remove_subscribers_to_incident.py +++ b/rootly_sdk/api/incidents/remove_subscribers_to_incident.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any from uuid import UUID import httpx @@ -13,7 +13,7 @@ def _get_kwargs( - id: Union[UUID, str], + id: UUID | str, *, body: RemoveSubscribers, ) -> dict[str, Any]: @@ -33,8 +33,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, IncidentResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | IncidentResponse | None: if response.status_code == 200: response_200 = IncidentResponse.from_dict(response.json()) @@ -52,8 +52,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, IncidentResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | IncidentResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -63,11 +63,11 @@ def _build_response( def sync_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: RemoveSubscribers, -) -> Response[Union[ErrorsList, IncidentResponse]]: +) -> Response[ErrorsList | IncidentResponse]: """Remove subscribers from incident Remove subscribers to incident @@ -97,11 +97,11 @@ def sync_detailed( def sync( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: RemoveSubscribers, -) -> Optional[Union[ErrorsList, IncidentResponse]]: +) -> ErrorsList | IncidentResponse | None: """Remove subscribers from incident Remove subscribers to incident @@ -126,11 +126,11 @@ def sync( async def asyncio_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: RemoveSubscribers, -) -> Response[Union[ErrorsList, IncidentResponse]]: +) -> Response[ErrorsList | IncidentResponse]: """Remove subscribers from incident Remove subscribers to incident @@ -158,11 +158,11 @@ async def asyncio_detailed( async def asyncio( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: RemoveSubscribers, -) -> Optional[Union[ErrorsList, IncidentResponse]]: +) -> ErrorsList | IncidentResponse | None: """Remove subscribers from incident Remove subscribers to incident diff --git a/rootly_sdk/api/incidents/resolve_incident.py b/rootly_sdk/api/incidents/resolve_incident.py index 7e243c74..690fa270 100644 --- a/rootly_sdk/api/incidents/resolve_incident.py +++ b/rootly_sdk/api/incidents/resolve_incident.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any from uuid import UUID import httpx @@ -13,7 +13,7 @@ def _get_kwargs( - id: Union[UUID, str], + id: UUID | str, *, body: ResolveIncident, ) -> dict[str, Any]: @@ -33,8 +33,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, IncidentResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | IncidentResponse | None: if response.status_code == 200: response_200 = IncidentResponse.from_dict(response.json()) @@ -52,8 +52,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, IncidentResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | IncidentResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -63,11 +63,11 @@ def _build_response( def sync_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: ResolveIncident, -) -> Response[Union[ErrorsList, IncidentResponse]]: +) -> Response[ErrorsList | IncidentResponse]: """Resolve an incident Resolve a specific incident by id @@ -97,11 +97,11 @@ def sync_detailed( def sync( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: ResolveIncident, -) -> Optional[Union[ErrorsList, IncidentResponse]]: +) -> ErrorsList | IncidentResponse | None: """Resolve an incident Resolve a specific incident by id @@ -126,11 +126,11 @@ def sync( async def asyncio_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: ResolveIncident, -) -> Response[Union[ErrorsList, IncidentResponse]]: +) -> Response[ErrorsList | IncidentResponse]: """Resolve an incident Resolve a specific incident by id @@ -158,11 +158,11 @@ async def asyncio_detailed( async def asyncio( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: ResolveIncident, -) -> Optional[Union[ErrorsList, IncidentResponse]]: +) -> ErrorsList | IncidentResponse | None: """Resolve an incident Resolve a specific incident by id diff --git a/rootly_sdk/api/incidents/restart_incident.py b/rootly_sdk/api/incidents/restart_incident.py index 0c1a990b..7ff3aaca 100644 --- a/rootly_sdk/api/incidents/restart_incident.py +++ b/rootly_sdk/api/incidents/restart_incident.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any from uuid import UUID import httpx @@ -13,7 +13,7 @@ def _get_kwargs( - id: Union[UUID, str], + id: UUID | str, *, body: RestartIncident, ) -> dict[str, Any]: @@ -33,8 +33,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, IncidentResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | IncidentResponse | None: if response.status_code == 200: response_200 = IncidentResponse.from_dict(response.json()) @@ -52,8 +52,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, IncidentResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | IncidentResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -63,11 +63,11 @@ def _build_response( def sync_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: RestartIncident, -) -> Response[Union[ErrorsList, IncidentResponse]]: +) -> Response[ErrorsList | IncidentResponse]: """Restart an incident Restart a specific incident by id @@ -97,11 +97,11 @@ def sync_detailed( def sync( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: RestartIncident, -) -> Optional[Union[ErrorsList, IncidentResponse]]: +) -> ErrorsList | IncidentResponse | None: """Restart an incident Restart a specific incident by id @@ -126,11 +126,11 @@ def sync( async def asyncio_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: RestartIncident, -) -> Response[Union[ErrorsList, IncidentResponse]]: +) -> Response[ErrorsList | IncidentResponse]: """Restart an incident Restart a specific incident by id @@ -158,11 +158,11 @@ async def asyncio_detailed( async def asyncio( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: RestartIncident, -) -> Optional[Union[ErrorsList, IncidentResponse]]: +) -> ErrorsList | IncidentResponse | None: """Restart an incident Restart a specific incident by id diff --git a/rootly_sdk/api/incidents/triage_incident.py b/rootly_sdk/api/incidents/triage_incident.py index 1a8a4eb3..b70ba562 100644 --- a/rootly_sdk/api/incidents/triage_incident.py +++ b/rootly_sdk/api/incidents/triage_incident.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any from uuid import UUID import httpx @@ -13,7 +13,7 @@ def _get_kwargs( - id: Union[UUID, str], + id: UUID | str, *, body: InTriageIncident, ) -> dict[str, Any]: @@ -33,8 +33,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, IncidentResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | IncidentResponse | None: if response.status_code == 200: response_200 = IncidentResponse.from_dict(response.json()) @@ -52,8 +52,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, IncidentResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | IncidentResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -63,11 +63,11 @@ def _build_response( def sync_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: InTriageIncident, -) -> Response[Union[ErrorsList, IncidentResponse]]: +) -> Response[ErrorsList | IncidentResponse]: """Triage an incident Set a specific incident by ID to triage state @@ -97,11 +97,11 @@ def sync_detailed( def sync( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: InTriageIncident, -) -> Optional[Union[ErrorsList, IncidentResponse]]: +) -> ErrorsList | IncidentResponse | None: """Triage an incident Set a specific incident by ID to triage state @@ -126,11 +126,11 @@ def sync( async def asyncio_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: InTriageIncident, -) -> Response[Union[ErrorsList, IncidentResponse]]: +) -> Response[ErrorsList | IncidentResponse]: """Triage an incident Set a specific incident by ID to triage state @@ -158,11 +158,11 @@ async def asyncio_detailed( async def asyncio( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: InTriageIncident, -) -> Optional[Union[ErrorsList, IncidentResponse]]: +) -> ErrorsList | IncidentResponse | None: """Triage an incident Set a specific incident by ID to triage state diff --git a/rootly_sdk/api/incidents/unmark_as_duplicate_incident.py b/rootly_sdk/api/incidents/unmark_as_duplicate_incident.py index 2e052b26..3d1d9822 100644 --- a/rootly_sdk/api/incidents/unmark_as_duplicate_incident.py +++ b/rootly_sdk/api/incidents/unmark_as_duplicate_incident.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union, cast +from typing import Any, cast from uuid import UUID import httpx @@ -12,7 +12,7 @@ def _get_kwargs( - id: Union[UUID, str], + id: UUID | str, ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "put", @@ -23,8 +23,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[Any, ErrorsList, IncidentResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Any | ErrorsList | IncidentResponse | None: if response.status_code == 200: response_200 = IncidentResponse.from_dict(response.json()) @@ -46,8 +46,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[Any, ErrorsList, IncidentResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[Any | ErrorsList | IncidentResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -57,10 +57,10 @@ def _build_response( def sync_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Response[Union[Any, ErrorsList, IncidentResponse]]: +) -> Response[Any | ErrorsList | IncidentResponse]: """Remove duplicate marking from an incident Remove the duplicate marking from an incident @@ -88,10 +88,10 @@ def sync_detailed( def sync( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Optional[Union[Any, ErrorsList, IncidentResponse]]: +) -> Any | ErrorsList | IncidentResponse | None: """Remove duplicate marking from an incident Remove the duplicate marking from an incident @@ -114,10 +114,10 @@ def sync( async def asyncio_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Response[Union[Any, ErrorsList, IncidentResponse]]: +) -> Response[Any | ErrorsList | IncidentResponse]: """Remove duplicate marking from an incident Remove the duplicate marking from an incident @@ -143,10 +143,10 @@ async def asyncio_detailed( async def asyncio( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Optional[Union[Any, ErrorsList, IncidentResponse]]: +) -> Any | ErrorsList | IncidentResponse | None: """Remove duplicate marking from an incident Remove the duplicate marking from an incident diff --git a/rootly_sdk/api/incidents/update_incident.py b/rootly_sdk/api/incidents/update_incident.py index 1c2f3a56..00521b61 100644 --- a/rootly_sdk/api/incidents/update_incident.py +++ b/rootly_sdk/api/incidents/update_incident.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any from uuid import UUID import httpx @@ -13,7 +13,7 @@ def _get_kwargs( - id: Union[UUID, str], + id: UUID | str, *, body: UpdateIncident, ) -> dict[str, Any]: @@ -33,8 +33,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, IncidentResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | IncidentResponse | None: if response.status_code == 200: response_200 = IncidentResponse.from_dict(response.json()) @@ -52,8 +52,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, IncidentResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | IncidentResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -63,11 +63,11 @@ def _build_response( def sync_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdateIncident, -) -> Response[Union[ErrorsList, IncidentResponse]]: +) -> Response[ErrorsList | IncidentResponse]: """Update an incident Update a specific incident by id @@ -97,11 +97,11 @@ def sync_detailed( def sync( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdateIncident, -) -> Optional[Union[ErrorsList, IncidentResponse]]: +) -> ErrorsList | IncidentResponse | None: """Update an incident Update a specific incident by id @@ -126,11 +126,11 @@ def sync( async def asyncio_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdateIncident, -) -> Response[Union[ErrorsList, IncidentResponse]]: +) -> Response[ErrorsList | IncidentResponse]: """Update an incident Update a specific incident by id @@ -158,11 +158,11 @@ async def asyncio_detailed( async def asyncio( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdateIncident, -) -> Optional[Union[ErrorsList, IncidentResponse]]: +) -> ErrorsList | IncidentResponse | None: """Update an incident Update a specific incident by id diff --git a/rootly_sdk/api/ip_ranges/get_ip_ranges.py b/rootly_sdk/api/ip_ranges/get_ip_ranges.py index b257179c..de282bf7 100644 --- a/rootly_sdk/api/ip_ranges/get_ip_ranges.py +++ b/rootly_sdk/api/ip_ranges/get_ip_ranges.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -18,9 +18,7 @@ def _get_kwargs() -> dict[str, Any]: return _kwargs -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[IpRangesResponse]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> IpRangesResponse | None: if response.status_code == 200: response_200 = IpRangesResponse.from_dict(response.json()) @@ -32,9 +30,7 @@ def _parse_response( return None -def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[IpRangesResponse]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[IpRangesResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -71,7 +67,7 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, -) -> Optional[IpRangesResponse]: +) -> IpRangesResponse | None: """Retrieves IP ranges Retrieves the IP ranges for rootly.com services @@ -115,7 +111,7 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, -) -> Optional[IpRangesResponse]: +) -> IpRangesResponse | None: """Retrieves IP ranges Retrieves the IP ranges for rootly.com services diff --git a/rootly_sdk/api/live_call_routers/create_live_call_router.py b/rootly_sdk/api/live_call_routers/create_live_call_router.py index 0b553c6a..e34f474e 100644 --- a/rootly_sdk/api/live_call_routers/create_live_call_router.py +++ b/rootly_sdk/api/live_call_routers/create_live_call_router.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, LiveCallRouterResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | LiveCallRouterResponse | None: if response.status_code == 201: response_201 = LiveCallRouterResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, LiveCallRouterResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | LiveCallRouterResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +69,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewLiveCallRouter, -) -> Response[Union[ErrorsList, LiveCallRouterResponse]]: +) -> Response[ErrorsList | LiveCallRouterResponse]: """Creates a Live Call Router Creates a new Live Call Router from provided data @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: NewLiveCallRouter, -) -> Optional[Union[ErrorsList, LiveCallRouterResponse]]: +) -> ErrorsList | LiveCallRouterResponse | None: """Creates a Live Call Router Creates a new Live Call Router from provided data @@ -126,7 +126,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewLiveCallRouter, -) -> Response[Union[ErrorsList, LiveCallRouterResponse]]: +) -> Response[ErrorsList | LiveCallRouterResponse]: """Creates a Live Call Router Creates a new Live Call Router from provided data @@ -155,7 +155,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewLiveCallRouter, -) -> Optional[Union[ErrorsList, LiveCallRouterResponse]]: +) -> ErrorsList | LiveCallRouterResponse | None: """Creates a Live Call Router Creates a new Live Call Router from provided data diff --git a/rootly_sdk/api/live_call_routers/delete_live_call_router.py b/rootly_sdk/api/live_call_routers/delete_live_call_router.py index 39286617..c4c1e7cc 100644 --- a/rootly_sdk/api/live_call_routers/delete_live_call_router.py +++ b/rootly_sdk/api/live_call_routers/delete_live_call_router.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, LiveCallRouterResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | LiveCallRouterResponse | None: if response.status_code == 200: response_200 = LiveCallRouterResponse.from_dict(response.json()) @@ -41,8 +41,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, LiveCallRouterResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | LiveCallRouterResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -55,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, LiveCallRouterResponse]]: +) -> Response[ErrorsList | LiveCallRouterResponse]: """Delete a Live Call Router Delete a specific Live Call Router by id @@ -86,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, LiveCallRouterResponse]]: +) -> ErrorsList | LiveCallRouterResponse | None: """Delete a Live Call Router Delete a specific Live Call Router by id @@ -112,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, LiveCallRouterResponse]]: +) -> Response[ErrorsList | LiveCallRouterResponse]: """Delete a Live Call Router Delete a specific Live Call Router by id @@ -141,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, LiveCallRouterResponse]]: +) -> ErrorsList | LiveCallRouterResponse | None: """Delete a Live Call Router Delete a specific Live Call Router by id diff --git a/rootly_sdk/api/live_call_routers/generate_phone_number_live_call_router.py b/rootly_sdk/api/live_call_routers/generate_phone_number_live_call_router.py index 1aed77d4..405a91e4 100644 --- a/rootly_sdk/api/live_call_routers/generate_phone_number_live_call_router.py +++ b/rootly_sdk/api/live_call_routers/generate_phone_number_live_call_router.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union, cast +from typing import Any, cast import httpx @@ -39,9 +39,7 @@ def _get_kwargs( return _kwargs -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[Any, ErrorsList]]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Any | ErrorsList | None: if response.status_code == 200: response_200 = cast(Any, None) return response_200 @@ -57,9 +55,7 @@ def _parse_response( return None -def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[Any, ErrorsList]]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Any | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -73,7 +69,7 @@ def sync_detailed( client: AuthenticatedClient, country_code: GeneratePhoneNumberLiveCallRouterCountryCode, phone_type: GeneratePhoneNumberLiveCallRouterPhoneType, -) -> Response[Union[Any, ErrorsList]]: +) -> Response[Any | ErrorsList]: """Generates a phone number for Live Call Router Generates a phone number for Live Call Router @@ -107,7 +103,7 @@ def sync( client: AuthenticatedClient, country_code: GeneratePhoneNumberLiveCallRouterCountryCode, phone_type: GeneratePhoneNumberLiveCallRouterPhoneType, -) -> Optional[Union[Any, ErrorsList]]: +) -> Any | ErrorsList | None: """Generates a phone number for Live Call Router Generates a phone number for Live Call Router @@ -136,7 +132,7 @@ async def asyncio_detailed( client: AuthenticatedClient, country_code: GeneratePhoneNumberLiveCallRouterCountryCode, phone_type: GeneratePhoneNumberLiveCallRouterPhoneType, -) -> Response[Union[Any, ErrorsList]]: +) -> Response[Any | ErrorsList]: """Generates a phone number for Live Call Router Generates a phone number for Live Call Router @@ -168,7 +164,7 @@ async def asyncio( client: AuthenticatedClient, country_code: GeneratePhoneNumberLiveCallRouterCountryCode, phone_type: GeneratePhoneNumberLiveCallRouterPhoneType, -) -> Optional[Union[Any, ErrorsList]]: +) -> Any | ErrorsList | None: """Generates a phone number for Live Call Router Generates a phone number for Live Call Router diff --git a/rootly_sdk/api/live_call_routers/get_live_call_router.py b/rootly_sdk/api/live_call_routers/get_live_call_router.py index 39cf19b6..477a4a36 100644 --- a/rootly_sdk/api/live_call_routers/get_live_call_router.py +++ b/rootly_sdk/api/live_call_routers/get_live_call_router.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, LiveCallRouterResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | LiveCallRouterResponse | None: if response.status_code == 200: response_200 = LiveCallRouterResponse.from_dict(response.json()) @@ -41,8 +41,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, LiveCallRouterResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | LiveCallRouterResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -55,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, LiveCallRouterResponse]]: +) -> Response[ErrorsList | LiveCallRouterResponse]: """Retrieves a Live Call Router Retrieves a specific Live Call Router by id @@ -86,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, LiveCallRouterResponse]]: +) -> ErrorsList | LiveCallRouterResponse | None: """Retrieves a Live Call Router Retrieves a specific Live Call Router by id @@ -112,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, LiveCallRouterResponse]]: +) -> Response[ErrorsList | LiveCallRouterResponse]: """Retrieves a Live Call Router Retrieves a specific Live Call Router by id @@ -141,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, LiveCallRouterResponse]]: +) -> ErrorsList | LiveCallRouterResponse | None: """Retrieves a Live Call Router Retrieves a specific Live Call Router by id diff --git a/rootly_sdk/api/live_call_routers/list_live_call_routers.py b/rootly_sdk/api/live_call_routers/list_live_call_routers.py index 23a42fec..3725a19e 100644 --- a/rootly_sdk/api/live_call_routers/list_live_call_routers.py +++ b/rootly_sdk/api/live_call_routers/list_live_call_routers.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -11,17 +11,17 @@ def _get_kwargs( *, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -58,9 +58,7 @@ def _get_kwargs( return _kwargs -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[LiveCallRouterList]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> LiveCallRouterList | None: if response.status_code == 200: response_200 = LiveCallRouterList.from_dict(response.json()) @@ -72,9 +70,7 @@ def _parse_response( return None -def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[LiveCallRouterList]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[LiveCallRouterList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -86,17 +82,17 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[LiveCallRouterList]: """List Live Call Routers @@ -147,18 +143,18 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, -) -> Optional[LiveCallRouterList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, +) -> LiveCallRouterList | None: """List Live Call Routers List Live Call Routers @@ -203,17 +199,17 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[LiveCallRouterList]: """List Live Call Routers @@ -262,18 +258,18 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, -) -> Optional[LiveCallRouterList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, +) -> LiveCallRouterList | None: """List Live Call Routers List Live Call Routers diff --git a/rootly_sdk/api/live_call_routers/update_live_call_router.py b/rootly_sdk/api/live_call_routers/update_live_call_router.py index f39a6175..41e988ce 100644 --- a/rootly_sdk/api/live_call_routers/update_live_call_router.py +++ b/rootly_sdk/api/live_call_routers/update_live_call_router.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, LiveCallRouterResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | LiveCallRouterResponse | None: if response.status_code == 200: response_200 = LiveCallRouterResponse.from_dict(response.json()) @@ -51,8 +51,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, LiveCallRouterResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | LiveCallRouterResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateLiveCallRouter, -) -> Response[Union[ErrorsList, LiveCallRouterResponse]]: +) -> Response[ErrorsList | LiveCallRouterResponse]: """Update a Live Call Router Update a specific Live Call Router by id @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateLiveCallRouter, -) -> Optional[Union[ErrorsList, LiveCallRouterResponse]]: +) -> ErrorsList | LiveCallRouterResponse | None: """Update a Live Call Router Update a specific Live Call Router by id @@ -129,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateLiveCallRouter, -) -> Response[Union[ErrorsList, LiveCallRouterResponse]]: +) -> Response[ErrorsList | LiveCallRouterResponse]: """Update a Live Call Router Update a specific Live Call Router by id @@ -161,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateLiveCallRouter, -) -> Optional[Union[ErrorsList, LiveCallRouterResponse]]: +) -> ErrorsList | LiveCallRouterResponse | None: """Update a Live Call Router Update a specific Live Call Router by id diff --git a/rootly_sdk/api/meeting_recordings/create_meeting_recording.py b/rootly_sdk/api/meeting_recordings/create_meeting_recording.py index 29d42edb..bf134334 100644 --- a/rootly_sdk/api/meeting_recordings/create_meeting_recording.py +++ b/rootly_sdk/api/meeting_recordings/create_meeting_recording.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union, cast +from typing import Any, cast import httpx @@ -15,11 +15,11 @@ def _get_kwargs( incident_id: str, *, - platform: Union[Unset, CreateMeetingRecordingPlatform] = UNSET, + platform: Unset | CreateMeetingRecordingPlatform = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} - json_platform: Union[Unset, str] = UNSET + json_platform: Unset | str = UNSET if not isinstance(platform, Unset): json_platform = platform @@ -37,8 +37,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[Any, MeetingRecordingResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Any | MeetingRecordingResponse | None: if response.status_code == 201: response_201 = MeetingRecordingResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[Any, MeetingRecordingResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[Any | MeetingRecordingResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,8 +69,8 @@ def sync_detailed( incident_id: str, *, client: AuthenticatedClient, - platform: Union[Unset, CreateMeetingRecordingPlatform] = UNSET, -) -> Response[Union[Any, MeetingRecordingResponse]]: + platform: Unset | CreateMeetingRecordingPlatform = UNSET, +) -> Response[Any | MeetingRecordingResponse]: """Create meeting recording Invite a recording bot to the incident's meeting. If no previous recordings exist for the platform, @@ -105,8 +105,8 @@ def sync( incident_id: str, *, client: AuthenticatedClient, - platform: Union[Unset, CreateMeetingRecordingPlatform] = UNSET, -) -> Optional[Union[Any, MeetingRecordingResponse]]: + platform: Unset | CreateMeetingRecordingPlatform = UNSET, +) -> Any | MeetingRecordingResponse | None: """Create meeting recording Invite a recording bot to the incident's meeting. If no previous recordings exist for the platform, @@ -136,8 +136,8 @@ async def asyncio_detailed( incident_id: str, *, client: AuthenticatedClient, - platform: Union[Unset, CreateMeetingRecordingPlatform] = UNSET, -) -> Response[Union[Any, MeetingRecordingResponse]]: + platform: Unset | CreateMeetingRecordingPlatform = UNSET, +) -> Response[Any | MeetingRecordingResponse]: """Create meeting recording Invite a recording bot to the incident's meeting. If no previous recordings exist for the platform, @@ -170,8 +170,8 @@ async def asyncio( incident_id: str, *, client: AuthenticatedClient, - platform: Union[Unset, CreateMeetingRecordingPlatform] = UNSET, -) -> Optional[Union[Any, MeetingRecordingResponse]]: + platform: Unset | CreateMeetingRecordingPlatform = UNSET, +) -> Any | MeetingRecordingResponse | None: """Create meeting recording Invite a recording bot to the incident's meeting. If no previous recordings exist for the platform, diff --git a/rootly_sdk/api/meeting_recordings/delete_meeting_recording.py b/rootly_sdk/api/meeting_recordings/delete_meeting_recording.py index 8b6880f5..80104322 100644 --- a/rootly_sdk/api/meeting_recordings/delete_meeting_recording.py +++ b/rootly_sdk/api/meeting_recordings/delete_meeting_recording.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union, cast +from typing import Any, cast import httpx @@ -21,8 +21,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[Any, MeetingRecordingResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Any | MeetingRecordingResponse | None: if response.status_code == 200: response_200 = MeetingRecordingResponse.from_dict(response.json()) @@ -39,8 +39,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[Any, MeetingRecordingResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[Any | MeetingRecordingResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -53,7 +53,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[Any, MeetingRecordingResponse]]: +) -> Response[Any | MeetingRecordingResponse]: """Delete a meeting recording Delete a meeting recording. Only completed or failed recordings can be deleted. Active recordings @@ -85,7 +85,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[Any, MeetingRecordingResponse]]: +) -> Any | MeetingRecordingResponse | None: """Delete a meeting recording Delete a meeting recording. Only completed or failed recordings can be deleted. Active recordings @@ -112,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[Any, MeetingRecordingResponse]]: +) -> Response[Any | MeetingRecordingResponse]: """Delete a meeting recording Delete a meeting recording. Only completed or failed recordings can be deleted. Active recordings @@ -142,7 +142,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[Any, MeetingRecordingResponse]]: +) -> Any | MeetingRecordingResponse | None: """Delete a meeting recording Delete a meeting recording. Only completed or failed recordings can be deleted. Active recordings diff --git a/rootly_sdk/api/meeting_recordings/delete_meeting_recording_video.py b/rootly_sdk/api/meeting_recordings/delete_meeting_recording_video.py index 7a9aa0d7..eb3a7026 100644 --- a/rootly_sdk/api/meeting_recordings/delete_meeting_recording_video.py +++ b/rootly_sdk/api/meeting_recordings/delete_meeting_recording_video.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union, cast +from typing import Any, cast import httpx @@ -21,8 +21,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[Any, MeetingRecordingResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Any | MeetingRecordingResponse | None: if response.status_code == 200: response_200 = MeetingRecordingResponse.from_dict(response.json()) @@ -39,8 +39,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[Any, MeetingRecordingResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[Any | MeetingRecordingResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -53,7 +53,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[Any, MeetingRecordingResponse]]: +) -> Response[Any | MeetingRecordingResponse]: """Delete video from a meeting recording Delete only the video file from a meeting recording. The transcript, summary, and all metadata are @@ -85,7 +85,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[Any, MeetingRecordingResponse]]: +) -> Any | MeetingRecordingResponse | None: """Delete video from a meeting recording Delete only the video file from a meeting recording. The transcript, summary, and all metadata are @@ -112,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[Any, MeetingRecordingResponse]]: +) -> Response[Any | MeetingRecordingResponse]: """Delete video from a meeting recording Delete only the video file from a meeting recording. The transcript, summary, and all metadata are @@ -142,7 +142,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[Any, MeetingRecordingResponse]]: +) -> Any | MeetingRecordingResponse | None: """Delete video from a meeting recording Delete only the video file from a meeting recording. The transcript, summary, and all metadata are diff --git a/rootly_sdk/api/meeting_recordings/delete_standalone_meeting_recording.py b/rootly_sdk/api/meeting_recordings/delete_standalone_meeting_recording.py index 9671c261..7b359c18 100644 --- a/rootly_sdk/api/meeting_recordings/delete_standalone_meeting_recording.py +++ b/rootly_sdk/api/meeting_recordings/delete_standalone_meeting_recording.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -19,7 +19,7 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Any | None: if response.status_code == 204: return None @@ -35,7 +35,7 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Any]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, diff --git a/rootly_sdk/api/meeting_recordings/get_meeting_recording.py b/rootly_sdk/api/meeting_recordings/get_meeting_recording.py index ff274db9..c6427f71 100644 --- a/rootly_sdk/api/meeting_recordings/get_meeting_recording.py +++ b/rootly_sdk/api/meeting_recordings/get_meeting_recording.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union, cast +from typing import Any, cast import httpx @@ -13,11 +13,11 @@ def _get_kwargs( id: str, *, - include: Union[Unset, GetMeetingRecordingInclude] = UNSET, + include: Unset | GetMeetingRecordingInclude = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} - json_include: Union[Unset, str] = UNSET + json_include: Unset | str = UNSET if not isinstance(include, Unset): json_include = include @@ -35,8 +35,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[Any, MeetingRecordingResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Any | MeetingRecordingResponse | None: if response.status_code == 200: response_200 = MeetingRecordingResponse.from_dict(response.json()) @@ -53,8 +53,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[Any, MeetingRecordingResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[Any | MeetingRecordingResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -67,8 +67,8 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, - include: Union[Unset, GetMeetingRecordingInclude] = UNSET, -) -> Response[Union[Any, MeetingRecordingResponse]]: + include: Unset | GetMeetingRecordingInclude = UNSET, +) -> Response[Any | MeetingRecordingResponse]: """Get a meeting recording Retrieve a single meeting recording session including its status, duration, speaker count, word @@ -102,8 +102,8 @@ def sync( id: str, *, client: AuthenticatedClient, - include: Union[Unset, GetMeetingRecordingInclude] = UNSET, -) -> Optional[Union[Any, MeetingRecordingResponse]]: + include: Unset | GetMeetingRecordingInclude = UNSET, +) -> Any | MeetingRecordingResponse | None: """Get a meeting recording Retrieve a single meeting recording session including its status, duration, speaker count, word @@ -132,8 +132,8 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, - include: Union[Unset, GetMeetingRecordingInclude] = UNSET, -) -> Response[Union[Any, MeetingRecordingResponse]]: + include: Unset | GetMeetingRecordingInclude = UNSET, +) -> Response[Any | MeetingRecordingResponse]: """Get a meeting recording Retrieve a single meeting recording session including its status, duration, speaker count, word @@ -165,8 +165,8 @@ async def asyncio( id: str, *, client: AuthenticatedClient, - include: Union[Unset, GetMeetingRecordingInclude] = UNSET, -) -> Optional[Union[Any, MeetingRecordingResponse]]: + include: Unset | GetMeetingRecordingInclude = UNSET, +) -> Any | MeetingRecordingResponse | None: """Get a meeting recording Retrieve a single meeting recording session including its status, duration, speaker count, word diff --git a/rootly_sdk/api/meeting_recordings/import_meeting_recording.py b/rootly_sdk/api/meeting_recordings/import_meeting_recording.py index 81df5ada..2eac11ac 100644 --- a/rootly_sdk/api/meeting_recordings/import_meeting_recording.py +++ b/rootly_sdk/api/meeting_recordings/import_meeting_recording.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union, cast +from typing import Any, cast import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[Any, MeetingRecordingResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Any | MeetingRecordingResponse | None: if response.status_code == 201: response_201 = MeetingRecordingResponse.from_dict(response.json()) @@ -49,8 +49,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[Any, MeetingRecordingResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[Any | MeetingRecordingResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -64,7 +64,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: ImportMeetingRecording, -) -> Response[Union[Any, MeetingRecordingResponse]]: +) -> Response[Any | MeetingRecordingResponse]: """Import a meeting recording Import an externally captured meeting recording and attach it to an incident. Video and transcript @@ -101,7 +101,7 @@ def sync( *, client: AuthenticatedClient, body: ImportMeetingRecording, -) -> Optional[Union[Any, MeetingRecordingResponse]]: +) -> Any | MeetingRecordingResponse | None: """Import a meeting recording Import an externally captured meeting recording and attach it to an incident. Video and transcript @@ -133,7 +133,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: ImportMeetingRecording, -) -> Response[Union[Any, MeetingRecordingResponse]]: +) -> Response[Any | MeetingRecordingResponse]: """Import a meeting recording Import an externally captured meeting recording and attach it to an incident. Video and transcript @@ -168,7 +168,7 @@ async def asyncio( *, client: AuthenticatedClient, body: ImportMeetingRecording, -) -> Optional[Union[Any, MeetingRecordingResponse]]: +) -> Any | MeetingRecordingResponse | None: """Import a meeting recording Import an externally captured meeting recording and attach it to an incident. Video and transcript diff --git a/rootly_sdk/api/meeting_recordings/leave_meeting_recording.py b/rootly_sdk/api/meeting_recordings/leave_meeting_recording.py index ab5fe030..a1766945 100644 --- a/rootly_sdk/api/meeting_recordings/leave_meeting_recording.py +++ b/rootly_sdk/api/meeting_recordings/leave_meeting_recording.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union, cast +from typing import Any, cast import httpx @@ -21,8 +21,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[Any, MeetingRecordingResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Any | MeetingRecordingResponse | None: if response.status_code == 200: response_200 = MeetingRecordingResponse.from_dict(response.json()) @@ -39,8 +39,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[Any, MeetingRecordingResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[Any | MeetingRecordingResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -53,7 +53,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[Any, MeetingRecordingResponse]]: +) -> Response[Any | MeetingRecordingResponse]: """Leave a meeting call Remove the recording bot from the meeting entirely. Unlike stop, this immediately disconnects the @@ -86,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[Any, MeetingRecordingResponse]]: +) -> Any | MeetingRecordingResponse | None: """Leave a meeting call Remove the recording bot from the meeting entirely. Unlike stop, this immediately disconnects the @@ -114,7 +114,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[Any, MeetingRecordingResponse]]: +) -> Response[Any | MeetingRecordingResponse]: """Leave a meeting call Remove the recording bot from the meeting entirely. Unlike stop, this immediately disconnects the @@ -145,7 +145,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[Any, MeetingRecordingResponse]]: +) -> Any | MeetingRecordingResponse | None: """Leave a meeting call Remove the recording bot from the meeting entirely. Unlike stop, this immediately disconnects the diff --git a/rootly_sdk/api/meeting_recordings/list_all_meeting_recordings.py b/rootly_sdk/api/meeting_recordings/list_all_meeting_recordings.py index b13d093a..728c67b1 100644 --- a/rootly_sdk/api/meeting_recordings/list_all_meeting_recordings.py +++ b/rootly_sdk/api/meeting_recordings/list_all_meeting_recordings.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -11,9 +11,9 @@ def _get_kwargs( *, - status: Union[Unset, str] = UNSET, - platform: Union[Unset, str] = UNSET, - created_by: Union[Unset, str] = UNSET, + status: Unset | str = UNSET, + platform: Unset | str = UNSET, + created_by: Unset | str = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -34,9 +34,7 @@ def _get_kwargs( return _kwargs -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[MeetingRecordingList]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> MeetingRecordingList | None: if response.status_code == 200: response_200 = MeetingRecordingList.from_dict(response.json()) @@ -49,7 +47,7 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response + *, client: AuthenticatedClient | Client, response: httpx.Response ) -> Response[MeetingRecordingList]: return Response( status_code=HTTPStatus(response.status_code), @@ -62,9 +60,9 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - status: Union[Unset, str] = UNSET, - platform: Union[Unset, str] = UNSET, - created_by: Union[Unset, str] = UNSET, + status: Unset | str = UNSET, + platform: Unset | str = UNSET, + created_by: Unset | str = UNSET, ) -> Response[MeetingRecordingList]: """List all meeting recordings @@ -101,10 +99,10 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - status: Union[Unset, str] = UNSET, - platform: Union[Unset, str] = UNSET, - created_by: Union[Unset, str] = UNSET, -) -> Optional[MeetingRecordingList]: + status: Unset | str = UNSET, + platform: Unset | str = UNSET, + created_by: Unset | str = UNSET, +) -> MeetingRecordingList | None: """List all meeting recordings List meeting recordings across the organization. Returns the current user's standalone recordings @@ -135,9 +133,9 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - status: Union[Unset, str] = UNSET, - platform: Union[Unset, str] = UNSET, - created_by: Union[Unset, str] = UNSET, + status: Unset | str = UNSET, + platform: Unset | str = UNSET, + created_by: Unset | str = UNSET, ) -> Response[MeetingRecordingList]: """List all meeting recordings @@ -172,10 +170,10 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - status: Union[Unset, str] = UNSET, - platform: Union[Unset, str] = UNSET, - created_by: Union[Unset, str] = UNSET, -) -> Optional[MeetingRecordingList]: + status: Unset | str = UNSET, + platform: Unset | str = UNSET, + created_by: Unset | str = UNSET, +) -> MeetingRecordingList | None: """List all meeting recordings List meeting recordings across the organization. Returns the current user's standalone recordings diff --git a/rootly_sdk/api/meeting_recordings/list_meeting_recordings.py b/rootly_sdk/api/meeting_recordings/list_meeting_recordings.py index add21fdb..834d62fc 100644 --- a/rootly_sdk/api/meeting_recordings/list_meeting_recordings.py +++ b/rootly_sdk/api/meeting_recordings/list_meeting_recordings.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union, cast +from typing import Any, cast import httpx @@ -12,8 +12,8 @@ def _get_kwargs( incident_id: str, *, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -33,8 +33,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[Any, MeetingRecordingList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Any | MeetingRecordingList | None: if response.status_code == 200: response_200 = MeetingRecordingList.from_dict(response.json()) @@ -51,8 +51,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[Any, MeetingRecordingList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[Any | MeetingRecordingList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -65,9 +65,9 @@ def sync_detailed( incident_id: str, *, client: AuthenticatedClient, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, -) -> Response[Union[Any, MeetingRecordingList]]: + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, +) -> Response[Any | MeetingRecordingList]: """List meeting recordings List all meeting recording sessions for an incident. Returns recordings sorted by session number. @@ -103,9 +103,9 @@ def sync( incident_id: str, *, client: AuthenticatedClient, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, -) -> Optional[Union[Any, MeetingRecordingList]]: + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, +) -> Any | MeetingRecordingList | None: """List meeting recordings List all meeting recording sessions for an incident. Returns recordings sorted by session number. @@ -136,9 +136,9 @@ async def asyncio_detailed( incident_id: str, *, client: AuthenticatedClient, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, -) -> Response[Union[Any, MeetingRecordingList]]: + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, +) -> Response[Any | MeetingRecordingList]: """List meeting recordings List all meeting recording sessions for an incident. Returns recordings sorted by session number. @@ -172,9 +172,9 @@ async def asyncio( incident_id: str, *, client: AuthenticatedClient, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, -) -> Optional[Union[Any, MeetingRecordingList]]: + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, +) -> Any | MeetingRecordingList | None: """List meeting recordings List all meeting recording sessions for an incident. Returns recordings sorted by session number. diff --git a/rootly_sdk/api/meeting_recordings/pause_meeting_recording.py b/rootly_sdk/api/meeting_recordings/pause_meeting_recording.py index c4d86bea..85dce15f 100644 --- a/rootly_sdk/api/meeting_recordings/pause_meeting_recording.py +++ b/rootly_sdk/api/meeting_recordings/pause_meeting_recording.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union, cast +from typing import Any, cast import httpx @@ -21,8 +21,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[Any, MeetingRecordingResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Any | MeetingRecordingResponse | None: if response.status_code == 200: response_200 = MeetingRecordingResponse.from_dict(response.json()) @@ -39,8 +39,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[Any, MeetingRecordingResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[Any | MeetingRecordingResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -53,7 +53,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[Any, MeetingRecordingResponse]]: +) -> Response[Any | MeetingRecordingResponse]: """Pause a meeting recording Pause an active recording session. The bot remains in the meeting but stops capturing audio/video. @@ -85,7 +85,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[Any, MeetingRecordingResponse]]: +) -> Any | MeetingRecordingResponse | None: """Pause a meeting recording Pause an active recording session. The bot remains in the meeting but stops capturing audio/video. @@ -112,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[Any, MeetingRecordingResponse]]: +) -> Response[Any | MeetingRecordingResponse]: """Pause a meeting recording Pause an active recording session. The bot remains in the meeting but stops capturing audio/video. @@ -142,7 +142,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[Any, MeetingRecordingResponse]]: +) -> Any | MeetingRecordingResponse | None: """Pause a meeting recording Pause an active recording session. The bot remains in the meeting but stops capturing audio/video. diff --git a/rootly_sdk/api/meeting_recordings/resume_meeting_recording.py b/rootly_sdk/api/meeting_recordings/resume_meeting_recording.py index d6a8b823..f1370763 100644 --- a/rootly_sdk/api/meeting_recordings/resume_meeting_recording.py +++ b/rootly_sdk/api/meeting_recordings/resume_meeting_recording.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union, cast +from typing import Any, cast import httpx @@ -21,8 +21,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[Any, MeetingRecordingResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Any | MeetingRecordingResponse | None: if response.status_code == 200: response_200 = MeetingRecordingResponse.from_dict(response.json()) @@ -39,8 +39,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[Any, MeetingRecordingResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[Any | MeetingRecordingResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -53,7 +53,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[Any, MeetingRecordingResponse]]: +) -> Response[Any | MeetingRecordingResponse]: """Resume a meeting recording Resume a paused recording session. The bot continues capturing audio/video from the meeting. @@ -84,7 +84,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[Any, MeetingRecordingResponse]]: +) -> Any | MeetingRecordingResponse | None: """Resume a meeting recording Resume a paused recording session. The bot continues capturing audio/video from the meeting. @@ -110,7 +110,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[Any, MeetingRecordingResponse]]: +) -> Response[Any | MeetingRecordingResponse]: """Resume a meeting recording Resume a paused recording session. The bot continues capturing audio/video from the meeting. @@ -139,7 +139,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[Any, MeetingRecordingResponse]]: +) -> Any | MeetingRecordingResponse | None: """Resume a meeting recording Resume a paused recording session. The bot continues capturing audio/video from the meeting. diff --git a/rootly_sdk/api/meeting_recordings/start_recording_session.py b/rootly_sdk/api/meeting_recordings/start_recording_session.py index ef4121b8..0c4149b1 100644 --- a/rootly_sdk/api/meeting_recordings/start_recording_session.py +++ b/rootly_sdk/api/meeting_recordings/start_recording_session.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union, cast +from typing import Any, cast import httpx @@ -30,8 +30,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[Any, StartSessionResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Any | StartSessionResponse | None: if response.status_code == 201: response_201 = StartSessionResponse.from_dict(response.json()) @@ -48,8 +48,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[Any, StartSessionResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[Any | StartSessionResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -62,7 +62,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: StartSessionRequest, -) -> Response[Union[Any, StartSessionResponse]]: +) -> Response[Any | StartSessionResponse]: """Start a recording session Start a new desktop recording session. The server creates a recording record and returns a stream @@ -95,7 +95,7 @@ def sync( *, client: AuthenticatedClient, body: StartSessionRequest, -) -> Optional[Union[Any, StartSessionResponse]]: +) -> Any | StartSessionResponse | None: """Start a recording session Start a new desktop recording session. The server creates a recording record and returns a stream @@ -123,7 +123,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: StartSessionRequest, -) -> Response[Union[Any, StartSessionResponse]]: +) -> Response[Any | StartSessionResponse]: """Start a recording session Start a new desktop recording session. The server creates a recording record and returns a stream @@ -154,7 +154,7 @@ async def asyncio( *, client: AuthenticatedClient, body: StartSessionRequest, -) -> Optional[Union[Any, StartSessionResponse]]: +) -> Any | StartSessionResponse | None: """Start a recording session Start a new desktop recording session. The server creates a recording record and returns a stream diff --git a/rootly_sdk/api/meeting_recordings/stop_meeting_recording.py b/rootly_sdk/api/meeting_recordings/stop_meeting_recording.py index a960c348..6254c41e 100644 --- a/rootly_sdk/api/meeting_recordings/stop_meeting_recording.py +++ b/rootly_sdk/api/meeting_recordings/stop_meeting_recording.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union, cast +from typing import Any, cast import httpx @@ -21,8 +21,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[Any, MeetingRecordingResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Any | MeetingRecordingResponse | None: if response.status_code == 200: response_200 = MeetingRecordingResponse.from_dict(response.json()) @@ -39,8 +39,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[Any, MeetingRecordingResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[Any | MeetingRecordingResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -53,7 +53,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[Any, MeetingRecordingResponse]]: +) -> Response[Any | MeetingRecordingResponse]: """Stop a meeting recording Stop an active or paused recording. The bot finishes processing, generates a transcript, and the @@ -86,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[Any, MeetingRecordingResponse]]: +) -> Any | MeetingRecordingResponse | None: """Stop a meeting recording Stop an active or paused recording. The bot finishes processing, generates a transcript, and the @@ -114,7 +114,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[Any, MeetingRecordingResponse]]: +) -> Response[Any | MeetingRecordingResponse]: """Stop a meeting recording Stop an active or paused recording. The bot finishes processing, generates a transcript, and the @@ -145,7 +145,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[Any, MeetingRecordingResponse]]: +) -> Any | MeetingRecordingResponse | None: """Stop a meeting recording Stop an active or paused recording. The bot finishes processing, generates a transcript, and the diff --git a/rootly_sdk/api/on_call_pay_reports/create_on_call_pay_report.py b/rootly_sdk/api/on_call_pay_reports/create_on_call_pay_report.py index ebfd7d20..983d83f1 100644 --- a/rootly_sdk/api/on_call_pay_reports/create_on_call_pay_report.py +++ b/rootly_sdk/api/on_call_pay_reports/create_on_call_pay_report.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, OnCallPayReportResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | OnCallPayReportResponse | None: if response.status_code == 201: response_201 = OnCallPayReportResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, OnCallPayReportResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | OnCallPayReportResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +69,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewOnCallPayReport, -) -> Response[Union[ErrorsList, OnCallPayReportResponse]]: +) -> Response[ErrorsList | OnCallPayReportResponse]: """Creates an On-Call Pay Report Generates a new on-call pay report for the given date range. The report is generated asynchronously. @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: NewOnCallPayReport, -) -> Optional[Union[ErrorsList, OnCallPayReportResponse]]: +) -> ErrorsList | OnCallPayReportResponse | None: """Creates an On-Call Pay Report Generates a new on-call pay report for the given date range. The report is generated asynchronously. @@ -126,7 +126,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewOnCallPayReport, -) -> Response[Union[ErrorsList, OnCallPayReportResponse]]: +) -> Response[ErrorsList | OnCallPayReportResponse]: """Creates an On-Call Pay Report Generates a new on-call pay report for the given date range. The report is generated asynchronously. @@ -155,7 +155,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewOnCallPayReport, -) -> Optional[Union[ErrorsList, OnCallPayReportResponse]]: +) -> ErrorsList | OnCallPayReportResponse | None: """Creates an On-Call Pay Report Generates a new on-call pay report for the given date range. The report is generated asynchronously. diff --git a/rootly_sdk/api/on_call_pay_reports/get_on_call_pay_report.py b/rootly_sdk/api/on_call_pay_reports/get_on_call_pay_report.py index 40284b38..99a0722e 100644 --- a/rootly_sdk/api/on_call_pay_reports/get_on_call_pay_report.py +++ b/rootly_sdk/api/on_call_pay_reports/get_on_call_pay_report.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -13,7 +13,7 @@ def _get_kwargs( id: str, *, - include: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, OnCallPayReportResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | OnCallPayReportResponse | None: if response.status_code == 200: response_200 = OnCallPayReportResponse.from_dict(response.json()) @@ -50,8 +50,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, OnCallPayReportResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | OnCallPayReportResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -64,8 +64,8 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, -) -> Response[Union[ErrorsList, OnCallPayReportResponse]]: + include: Unset | str = UNSET, +) -> Response[ErrorsList | OnCallPayReportResponse]: """Retrieves an On-Call Pay Report Retrieves a specific on-call pay report by id @@ -98,8 +98,8 @@ def sync( id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, -) -> Optional[Union[ErrorsList, OnCallPayReportResponse]]: + include: Unset | str = UNSET, +) -> ErrorsList | OnCallPayReportResponse | None: """Retrieves an On-Call Pay Report Retrieves a specific on-call pay report by id @@ -127,8 +127,8 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, -) -> Response[Union[ErrorsList, OnCallPayReportResponse]]: + include: Unset | str = UNSET, +) -> Response[ErrorsList | OnCallPayReportResponse]: """Retrieves an On-Call Pay Report Retrieves a specific on-call pay report by id @@ -159,8 +159,8 @@ async def asyncio( id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, -) -> Optional[Union[ErrorsList, OnCallPayReportResponse]]: + include: Unset | str = UNSET, +) -> ErrorsList | OnCallPayReportResponse | None: """Retrieves an On-Call Pay Report Retrieves a specific on-call pay report by id diff --git a/rootly_sdk/api/on_call_pay_reports/list_on_call_pay_reports.py b/rootly_sdk/api/on_call_pay_reports/list_on_call_pay_reports.py index db45ecec..787eb8cf 100644 --- a/rootly_sdk/api/on_call_pay_reports/list_on_call_pay_reports.py +++ b/rootly_sdk/api/on_call_pay_reports/list_on_call_pay_reports.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -11,14 +11,14 @@ def _get_kwargs( *, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterstatus: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterstatus: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -49,9 +49,7 @@ def _get_kwargs( return _kwargs -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[OnCallPayReportList]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> OnCallPayReportList | None: if response.status_code == 200: response_200 = OnCallPayReportList.from_dict(response.json()) @@ -63,9 +61,7 @@ def _parse_response( return None -def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[OnCallPayReportList]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[OnCallPayReportList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -77,14 +73,14 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterstatus: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterstatus: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> Response[OnCallPayReportList]: """List On-Call Pay Reports @@ -129,15 +125,15 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterstatus: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, -) -> Optional[OnCallPayReportList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterstatus: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, +) -> OnCallPayReportList | None: """List On-Call Pay Reports List on-call pay reports @@ -176,14 +172,14 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterstatus: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterstatus: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> Response[OnCallPayReportList]: """List On-Call Pay Reports @@ -226,15 +222,15 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterstatus: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, -) -> Optional[OnCallPayReportList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterstatus: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, +) -> OnCallPayReportList | None: """List On-Call Pay Reports List on-call pay reports diff --git a/rootly_sdk/api/on_call_pay_reports/regenerate_on_call_pay_report.py b/rootly_sdk/api/on_call_pay_reports/regenerate_on_call_pay_report.py index 2a73983d..759b2879 100644 --- a/rootly_sdk/api/on_call_pay_reports/regenerate_on_call_pay_report.py +++ b/rootly_sdk/api/on_call_pay_reports/regenerate_on_call_pay_report.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, OnCallPayReportResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | OnCallPayReportResponse | None: if response.status_code == 200: response_200 = OnCallPayReportResponse.from_dict(response.json()) @@ -41,8 +41,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, OnCallPayReportResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | OnCallPayReportResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -55,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, OnCallPayReportResponse]]: +) -> Response[ErrorsList | OnCallPayReportResponse]: """Regenerate an On-Call Pay Report Triggers regeneration of an existing on-call pay report. @@ -86,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, OnCallPayReportResponse]]: +) -> ErrorsList | OnCallPayReportResponse | None: """Regenerate an On-Call Pay Report Triggers regeneration of an existing on-call pay report. @@ -112,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, OnCallPayReportResponse]]: +) -> Response[ErrorsList | OnCallPayReportResponse]: """Regenerate an On-Call Pay Report Triggers regeneration of an existing on-call pay report. @@ -141,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, OnCallPayReportResponse]]: +) -> ErrorsList | OnCallPayReportResponse | None: """Regenerate an On-Call Pay Report Triggers regeneration of an existing on-call pay report. diff --git a/rootly_sdk/api/on_call_pay_reports/update_on_call_pay_report.py b/rootly_sdk/api/on_call_pay_reports/update_on_call_pay_report.py index d27af043..b65dc22c 100644 --- a/rootly_sdk/api/on_call_pay_reports/update_on_call_pay_report.py +++ b/rootly_sdk/api/on_call_pay_reports/update_on_call_pay_report.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, OnCallPayReportResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | OnCallPayReportResponse | None: if response.status_code == 200: response_200 = OnCallPayReportResponse.from_dict(response.json()) @@ -56,8 +56,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, OnCallPayReportResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | OnCallPayReportResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -71,7 +71,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateOnCallPayReport, -) -> Response[Union[ErrorsList, OnCallPayReportResponse]]: +) -> Response[ErrorsList | OnCallPayReportResponse]: """Update an On-Call Pay Report Update a specific on-call pay report by id. Triggers report regeneration. @@ -105,7 +105,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateOnCallPayReport, -) -> Optional[Union[ErrorsList, OnCallPayReportResponse]]: +) -> ErrorsList | OnCallPayReportResponse | None: """Update an On-Call Pay Report Update a specific on-call pay report by id. Triggers report regeneration. @@ -134,7 +134,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateOnCallPayReport, -) -> Response[Union[ErrorsList, OnCallPayReportResponse]]: +) -> Response[ErrorsList | OnCallPayReportResponse]: """Update an On-Call Pay Report Update a specific on-call pay report by id. Triggers report regeneration. @@ -166,7 +166,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateOnCallPayReport, -) -> Optional[Union[ErrorsList, OnCallPayReportResponse]]: +) -> ErrorsList | OnCallPayReportResponse | None: """Update an On-Call Pay Report Update a specific on-call pay report by id. Triggers report regeneration. diff --git a/rootly_sdk/api/on_call_roles/create_on_call_role.py b/rootly_sdk/api/on_call_roles/create_on_call_role.py index d90d9cf7..5ad769b9 100644 --- a/rootly_sdk/api/on_call_roles/create_on_call_role.py +++ b/rootly_sdk/api/on_call_roles/create_on_call_role.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, OnCallRoleResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | OnCallRoleResponse | None: if response.status_code == 201: response_201 = OnCallRoleResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, OnCallRoleResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | OnCallRoleResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +69,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewOnCallRole, -) -> Response[Union[ErrorsList, OnCallRoleResponse]]: +) -> Response[ErrorsList | OnCallRoleResponse]: """Creates an On-Call Role Creates a new On-Call Role from provided data @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: NewOnCallRole, -) -> Optional[Union[ErrorsList, OnCallRoleResponse]]: +) -> ErrorsList | OnCallRoleResponse | None: """Creates an On-Call Role Creates a new On-Call Role from provided data @@ -126,7 +126,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewOnCallRole, -) -> Response[Union[ErrorsList, OnCallRoleResponse]]: +) -> Response[ErrorsList | OnCallRoleResponse]: """Creates an On-Call Role Creates a new On-Call Role from provided data @@ -155,7 +155,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewOnCallRole, -) -> Optional[Union[ErrorsList, OnCallRoleResponse]]: +) -> ErrorsList | OnCallRoleResponse | None: """Creates an On-Call Role Creates a new On-Call Role from provided data diff --git a/rootly_sdk/api/on_call_roles/delete_on_call_role.py b/rootly_sdk/api/on_call_roles/delete_on_call_role.py index cba7de3b..e01d7f37 100644 --- a/rootly_sdk/api/on_call_roles/delete_on_call_role.py +++ b/rootly_sdk/api/on_call_roles/delete_on_call_role.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, OnCallRoleResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | OnCallRoleResponse | None: if response.status_code == 200: response_200 = OnCallRoleResponse.from_dict(response.json()) @@ -41,8 +41,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, OnCallRoleResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | OnCallRoleResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -55,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, OnCallRoleResponse]]: +) -> Response[ErrorsList | OnCallRoleResponse]: """Delete an On-Call Role Delete a specific On-Call Role by id @@ -86,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, OnCallRoleResponse]]: +) -> ErrorsList | OnCallRoleResponse | None: """Delete an On-Call Role Delete a specific On-Call Role by id @@ -112,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, OnCallRoleResponse]]: +) -> Response[ErrorsList | OnCallRoleResponse]: """Delete an On-Call Role Delete a specific On-Call Role by id @@ -141,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, OnCallRoleResponse]]: +) -> ErrorsList | OnCallRoleResponse | None: """Delete an On-Call Role Delete a specific On-Call Role by id diff --git a/rootly_sdk/api/on_call_roles/get_on_call_role.py b/rootly_sdk/api/on_call_roles/get_on_call_role.py index 8fd359bc..c796b0f9 100644 --- a/rootly_sdk/api/on_call_roles/get_on_call_role.py +++ b/rootly_sdk/api/on_call_roles/get_on_call_role.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, OnCallRoleResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | OnCallRoleResponse | None: if response.status_code == 200: response_200 = OnCallRoleResponse.from_dict(response.json()) @@ -41,8 +41,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, OnCallRoleResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | OnCallRoleResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -55,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, OnCallRoleResponse]]: +) -> Response[ErrorsList | OnCallRoleResponse]: """Retrieves an On-Call Role Retrieves a specific On-Call Role by id @@ -86,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, OnCallRoleResponse]]: +) -> ErrorsList | OnCallRoleResponse | None: """Retrieves an On-Call Role Retrieves a specific On-Call Role by id @@ -112,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, OnCallRoleResponse]]: +) -> Response[ErrorsList | OnCallRoleResponse]: """Retrieves an On-Call Role Retrieves a specific On-Call Role by id @@ -141,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, OnCallRoleResponse]]: +) -> ErrorsList | OnCallRoleResponse | None: """Retrieves an On-Call Role Retrieves a specific On-Call Role by id diff --git a/rootly_sdk/api/on_call_roles/list_on_call_roles.py b/rootly_sdk/api/on_call_roles/list_on_call_roles.py index 90270c3c..8b175ca8 100644 --- a/rootly_sdk/api/on_call_roles/list_on_call_roles.py +++ b/rootly_sdk/api/on_call_roles/list_on_call_roles.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -11,17 +11,17 @@ def _get_kwargs( *, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -58,9 +58,7 @@ def _get_kwargs( return _kwargs -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[OnCallRoleList]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> OnCallRoleList | None: if response.status_code == 200: response_200 = OnCallRoleList.from_dict(response.json()) @@ -72,9 +70,7 @@ def _parse_response( return None -def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[OnCallRoleList]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[OnCallRoleList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -86,17 +82,17 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[OnCallRoleList]: """List On-Call Roles @@ -147,18 +143,18 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, -) -> Optional[OnCallRoleList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, +) -> OnCallRoleList | None: """List On-Call Roles List On-Call Roles @@ -203,17 +199,17 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[OnCallRoleList]: """List On-Call Roles @@ -262,18 +258,18 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, -) -> Optional[OnCallRoleList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, +) -> OnCallRoleList | None: """List On-Call Roles List On-Call Roles diff --git a/rootly_sdk/api/on_call_roles/update_on_call_role.py b/rootly_sdk/api/on_call_roles/update_on_call_role.py index 823ce122..97cfb572 100644 --- a/rootly_sdk/api/on_call_roles/update_on_call_role.py +++ b/rootly_sdk/api/on_call_roles/update_on_call_role.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, OnCallRoleResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | OnCallRoleResponse | None: if response.status_code == 200: response_200 = OnCallRoleResponse.from_dict(response.json()) @@ -51,8 +51,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, OnCallRoleResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | OnCallRoleResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateOnCallRole, -) -> Response[Union[ErrorsList, OnCallRoleResponse]]: +) -> Response[ErrorsList | OnCallRoleResponse]: """Update an On-Call Role Update a specific On-Call Role by id @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateOnCallRole, -) -> Optional[Union[ErrorsList, OnCallRoleResponse]]: +) -> ErrorsList | OnCallRoleResponse | None: """Update an On-Call Role Update a specific On-Call Role by id @@ -129,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateOnCallRole, -) -> Response[Union[ErrorsList, OnCallRoleResponse]]: +) -> Response[ErrorsList | OnCallRoleResponse]: """Update an On-Call Role Update a specific On-Call Role by id @@ -161,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateOnCallRole, -) -> Optional[Union[ErrorsList, OnCallRoleResponse]]: +) -> ErrorsList | OnCallRoleResponse | None: """Update an On-Call Role Update a specific On-Call Role by id diff --git a/rootly_sdk/api/on_call_shadows/create_on_call_shadow.py b/rootly_sdk/api/on_call_shadows/create_on_call_shadow.py index fca68680..06292c4b 100644 --- a/rootly_sdk/api/on_call_shadows/create_on_call_shadow.py +++ b/rootly_sdk/api/on_call_shadows/create_on_call_shadow.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, OnCallShadowResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | OnCallShadowResponse | None: if response.status_code == 201: response_201 = OnCallShadowResponse.from_dict(response.json()) @@ -56,8 +56,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, OnCallShadowResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | OnCallShadowResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -71,7 +71,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewOnCallShadow, -) -> Response[Union[ErrorsList, OnCallShadowResponse]]: +) -> Response[ErrorsList | OnCallShadowResponse]: """creates an shadow configuration Creates a new on call shadow configuration from provided data @@ -105,7 +105,7 @@ def sync( *, client: AuthenticatedClient, body: NewOnCallShadow, -) -> Optional[Union[ErrorsList, OnCallShadowResponse]]: +) -> ErrorsList | OnCallShadowResponse | None: """creates an shadow configuration Creates a new on call shadow configuration from provided data @@ -134,7 +134,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewOnCallShadow, -) -> Response[Union[ErrorsList, OnCallShadowResponse]]: +) -> Response[ErrorsList | OnCallShadowResponse]: """creates an shadow configuration Creates a new on call shadow configuration from provided data @@ -166,7 +166,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewOnCallShadow, -) -> Optional[Union[ErrorsList, OnCallShadowResponse]]: +) -> ErrorsList | OnCallShadowResponse | None: """creates an shadow configuration Creates a new on call shadow configuration from provided data diff --git a/rootly_sdk/api/on_call_shadows/get_on_call_shadow.py b/rootly_sdk/api/on_call_shadows/get_on_call_shadow.py index 33dc51e4..33c9d5e0 100644 --- a/rootly_sdk/api/on_call_shadows/get_on_call_shadow.py +++ b/rootly_sdk/api/on_call_shadows/get_on_call_shadow.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, OnCallShadowResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | OnCallShadowResponse | None: if response.status_code == 200: response_200 = OnCallShadowResponse.from_dict(response.json()) @@ -41,8 +41,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, OnCallShadowResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | OnCallShadowResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -55,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, OnCallShadowResponse]]: +) -> Response[ErrorsList | OnCallShadowResponse]: """Retrieves an On Call Shadow configuration by ID Retrieves a specific On Call Shadow configuration by ID @@ -86,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, OnCallShadowResponse]]: +) -> ErrorsList | OnCallShadowResponse | None: """Retrieves an On Call Shadow configuration by ID Retrieves a specific On Call Shadow configuration by ID @@ -112,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, OnCallShadowResponse]]: +) -> Response[ErrorsList | OnCallShadowResponse]: """Retrieves an On Call Shadow configuration by ID Retrieves a specific On Call Shadow configuration by ID @@ -141,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, OnCallShadowResponse]]: +) -> ErrorsList | OnCallShadowResponse | None: """Retrieves an On Call Shadow configuration by ID Retrieves a specific On Call Shadow configuration by ID diff --git a/rootly_sdk/api/on_call_shadows/list_on_call_shadows.py b/rootly_sdk/api/on_call_shadows/list_on_call_shadows.py index e40bd629..4f6a4101 100644 --- a/rootly_sdk/api/on_call_shadows/list_on_call_shadows.py +++ b/rootly_sdk/api/on_call_shadows/list_on_call_shadows.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -12,9 +12,9 @@ def _get_kwargs( schedule_id: str, *, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -35,9 +35,7 @@ def _get_kwargs( return _kwargs -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[OnCallShadowsList]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> OnCallShadowsList | None: if response.status_code == 200: response_200 = OnCallShadowsList.from_dict(response.json()) @@ -49,9 +47,7 @@ def _parse_response( return None -def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[OnCallShadowsList]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[OnCallShadowsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -64,9 +60,9 @@ def sync_detailed( schedule_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[OnCallShadowsList]: """List On Call Shadows for Shift @@ -104,10 +100,10 @@ def sync( schedule_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, -) -> Optional[OnCallShadowsList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, +) -> OnCallShadowsList | None: """List On Call Shadows for Shift List shadow shifts for schedule @@ -139,9 +135,9 @@ async def asyncio_detailed( schedule_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[OnCallShadowsList]: """List On Call Shadows for Shift @@ -177,10 +173,10 @@ async def asyncio( schedule_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, -) -> Optional[OnCallShadowsList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, +) -> OnCallShadowsList | None: """List On Call Shadows for Shift List shadow shifts for schedule diff --git a/rootly_sdk/api/on_call_shadows/update_on_call_shadow.py b/rootly_sdk/api/on_call_shadows/update_on_call_shadow.py index a004160b..c053d8a2 100644 --- a/rootly_sdk/api/on_call_shadows/update_on_call_shadow.py +++ b/rootly_sdk/api/on_call_shadows/update_on_call_shadow.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, OnCallShadowResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | OnCallShadowResponse | None: if response.status_code == 200: response_200 = OnCallShadowResponse.from_dict(response.json()) @@ -51,8 +51,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, OnCallShadowResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | OnCallShadowResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateOnCallShadow, -) -> Response[Union[ErrorsList, OnCallShadowResponse]]: +) -> Response[ErrorsList | OnCallShadowResponse]: """Update an On Call Shadow configuration Update a specific on call shadow configuration by id @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateOnCallShadow, -) -> Optional[Union[ErrorsList, OnCallShadowResponse]]: +) -> ErrorsList | OnCallShadowResponse | None: """Update an On Call Shadow configuration Update a specific on call shadow configuration by id @@ -129,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateOnCallShadow, -) -> Response[Union[ErrorsList, OnCallShadowResponse]]: +) -> Response[ErrorsList | OnCallShadowResponse]: """Update an On Call Shadow configuration Update a specific on call shadow configuration by id @@ -161,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateOnCallShadow, -) -> Optional[Union[ErrorsList, OnCallShadowResponse]]: +) -> ErrorsList | OnCallShadowResponse | None: """Update an On Call Shadow configuration Update a specific on call shadow configuration by id diff --git a/rootly_sdk/api/on_calls/list_oncalls.py b/rootly_sdk/api/on_calls/list_oncalls.py index e74a4212..3429aedd 100644 --- a/rootly_sdk/api/on_calls/list_oncalls.py +++ b/rootly_sdk/api/on_calls/list_oncalls.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -13,21 +13,21 @@ def _get_kwargs( *, - include: Union[Unset, ListOncallsInclude] = UNSET, - since: Union[Unset, str] = UNSET, - until: Union[Unset, str] = UNSET, - earliest: Union[Unset, bool] = UNSET, - time_zone: Union[Unset, str] = UNSET, - filterescalation_policy_ids: Union[Unset, str] = UNSET, - filterschedule_ids: Union[Unset, str] = UNSET, - filteruser_ids: Union[Unset, str] = UNSET, - filterservice_ids: Union[Unset, str] = UNSET, - filtergroup_ids: Union[Unset, str] = UNSET, - filternotification_types: Union[Unset, str] = UNSET, + include: Unset | ListOncallsInclude = UNSET, + since: Unset | str = UNSET, + until: Unset | str = UNSET, + earliest: Unset | bool = UNSET, + time_zone: Unset | str = UNSET, + filterescalation_policy_ids: Unset | str = UNSET, + filterschedule_ids: Unset | str = UNSET, + filteruser_ids: Unset | str = UNSET, + filterservice_ids: Unset | str = UNSET, + filtergroup_ids: Unset | str = UNSET, + filternotification_types: Unset | str = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} - json_include: Union[Unset, str] = UNSET + json_include: Unset | str = UNSET if not isinstance(include, Unset): json_include = include @@ -65,8 +65,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, OncallList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | OncallList | None: if response.status_code == 200: response_200 = OncallList.from_dict(response.json()) @@ -89,8 +89,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, OncallList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | OncallList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -102,18 +102,18 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - include: Union[Unset, ListOncallsInclude] = UNSET, - since: Union[Unset, str] = UNSET, - until: Union[Unset, str] = UNSET, - earliest: Union[Unset, bool] = UNSET, - time_zone: Union[Unset, str] = UNSET, - filterescalation_policy_ids: Union[Unset, str] = UNSET, - filterschedule_ids: Union[Unset, str] = UNSET, - filteruser_ids: Union[Unset, str] = UNSET, - filterservice_ids: Union[Unset, str] = UNSET, - filtergroup_ids: Union[Unset, str] = UNSET, - filternotification_types: Union[Unset, str] = UNSET, -) -> Response[Union[ErrorsList, OncallList]]: + include: Unset | ListOncallsInclude = UNSET, + since: Unset | str = UNSET, + until: Unset | str = UNSET, + earliest: Unset | bool = UNSET, + time_zone: Unset | str = UNSET, + filterescalation_policy_ids: Unset | str = UNSET, + filterschedule_ids: Unset | str = UNSET, + filteruser_ids: Unset | str = UNSET, + filterservice_ids: Unset | str = UNSET, + filtergroup_ids: Unset | str = UNSET, + filternotification_types: Unset | str = UNSET, +) -> Response[ErrorsList | OncallList]: """List on-calls List who is currently on-call, with support for filtering by escalation policy, schedule, and user. @@ -164,18 +164,18 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: Union[Unset, ListOncallsInclude] = UNSET, - since: Union[Unset, str] = UNSET, - until: Union[Unset, str] = UNSET, - earliest: Union[Unset, bool] = UNSET, - time_zone: Union[Unset, str] = UNSET, - filterescalation_policy_ids: Union[Unset, str] = UNSET, - filterschedule_ids: Union[Unset, str] = UNSET, - filteruser_ids: Union[Unset, str] = UNSET, - filterservice_ids: Union[Unset, str] = UNSET, - filtergroup_ids: Union[Unset, str] = UNSET, - filternotification_types: Union[Unset, str] = UNSET, -) -> Optional[Union[ErrorsList, OncallList]]: + include: Unset | ListOncallsInclude = UNSET, + since: Unset | str = UNSET, + until: Unset | str = UNSET, + earliest: Unset | bool = UNSET, + time_zone: Unset | str = UNSET, + filterescalation_policy_ids: Unset | str = UNSET, + filterschedule_ids: Unset | str = UNSET, + filteruser_ids: Unset | str = UNSET, + filterservice_ids: Unset | str = UNSET, + filtergroup_ids: Unset | str = UNSET, + filternotification_types: Unset | str = UNSET, +) -> ErrorsList | OncallList | None: """List on-calls List who is currently on-call, with support for filtering by escalation policy, schedule, and user. @@ -221,18 +221,18 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: Union[Unset, ListOncallsInclude] = UNSET, - since: Union[Unset, str] = UNSET, - until: Union[Unset, str] = UNSET, - earliest: Union[Unset, bool] = UNSET, - time_zone: Union[Unset, str] = UNSET, - filterescalation_policy_ids: Union[Unset, str] = UNSET, - filterschedule_ids: Union[Unset, str] = UNSET, - filteruser_ids: Union[Unset, str] = UNSET, - filterservice_ids: Union[Unset, str] = UNSET, - filtergroup_ids: Union[Unset, str] = UNSET, - filternotification_types: Union[Unset, str] = UNSET, -) -> Response[Union[ErrorsList, OncallList]]: + include: Unset | ListOncallsInclude = UNSET, + since: Unset | str = UNSET, + until: Unset | str = UNSET, + earliest: Unset | bool = UNSET, + time_zone: Unset | str = UNSET, + filterescalation_policy_ids: Unset | str = UNSET, + filterschedule_ids: Unset | str = UNSET, + filteruser_ids: Unset | str = UNSET, + filterservice_ids: Unset | str = UNSET, + filtergroup_ids: Unset | str = UNSET, + filternotification_types: Unset | str = UNSET, +) -> Response[ErrorsList | OncallList]: """List on-calls List who is currently on-call, with support for filtering by escalation policy, schedule, and user. @@ -281,18 +281,18 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: Union[Unset, ListOncallsInclude] = UNSET, - since: Union[Unset, str] = UNSET, - until: Union[Unset, str] = UNSET, - earliest: Union[Unset, bool] = UNSET, - time_zone: Union[Unset, str] = UNSET, - filterescalation_policy_ids: Union[Unset, str] = UNSET, - filterschedule_ids: Union[Unset, str] = UNSET, - filteruser_ids: Union[Unset, str] = UNSET, - filterservice_ids: Union[Unset, str] = UNSET, - filtergroup_ids: Union[Unset, str] = UNSET, - filternotification_types: Union[Unset, str] = UNSET, -) -> Optional[Union[ErrorsList, OncallList]]: + include: Unset | ListOncallsInclude = UNSET, + since: Unset | str = UNSET, + until: Unset | str = UNSET, + earliest: Unset | bool = UNSET, + time_zone: Unset | str = UNSET, + filterescalation_policy_ids: Unset | str = UNSET, + filterschedule_ids: Unset | str = UNSET, + filteruser_ids: Unset | str = UNSET, + filterservice_ids: Unset | str = UNSET, + filtergroup_ids: Unset | str = UNSET, + filternotification_types: Unset | str = UNSET, +) -> ErrorsList | OncallList | None: """List on-calls List who is currently on-call, with support for filtering by escalation policy, schedule, and user. diff --git a/rootly_sdk/api/override_shifts/create_override_shift.py b/rootly_sdk/api/override_shifts/create_override_shift.py index bdd7f59d..53a40917 100644 --- a/rootly_sdk/api/override_shifts/create_override_shift.py +++ b/rootly_sdk/api/override_shifts/create_override_shift.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, OverrideShiftResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | OverrideShiftResponse | None: if response.status_code == 200: response_200 = OverrideShiftResponse.from_dict(response.json()) @@ -61,8 +61,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, OverrideShiftResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | OverrideShiftResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -76,7 +76,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewOverrideShift, -) -> Response[Union[ErrorsList, OverrideShiftResponse]]: +) -> Response[ErrorsList | OverrideShiftResponse]: """creates an override shift Creates a new override shift from provided data. If any existing override shifts overlap with the @@ -113,7 +113,7 @@ def sync( *, client: AuthenticatedClient, body: NewOverrideShift, -) -> Optional[Union[ErrorsList, OverrideShiftResponse]]: +) -> ErrorsList | OverrideShiftResponse | None: """creates an override shift Creates a new override shift from provided data. If any existing override shifts overlap with the @@ -145,7 +145,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewOverrideShift, -) -> Response[Union[ErrorsList, OverrideShiftResponse]]: +) -> Response[ErrorsList | OverrideShiftResponse]: """creates an override shift Creates a new override shift from provided data. If any existing override shifts overlap with the @@ -180,7 +180,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewOverrideShift, -) -> Optional[Union[ErrorsList, OverrideShiftResponse]]: +) -> ErrorsList | OverrideShiftResponse | None: """creates an override shift Creates a new override shift from provided data. If any existing override shifts overlap with the diff --git a/rootly_sdk/api/override_shifts/delete_on_call_shadow.py b/rootly_sdk/api/override_shifts/delete_on_call_shadow.py index eb2e34f1..5c08cc93 100644 --- a/rootly_sdk/api/override_shifts/delete_on_call_shadow.py +++ b/rootly_sdk/api/override_shifts/delete_on_call_shadow.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, OnCallShadowResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | OnCallShadowResponse | None: if response.status_code == 200: response_200 = OnCallShadowResponse.from_dict(response.json()) @@ -46,8 +46,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, OnCallShadowResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | OnCallShadowResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -60,7 +60,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, OnCallShadowResponse]]: +) -> Response[ErrorsList | OnCallShadowResponse]: """Delete an on call shadow configuration Delete a specific on call shadow configuration by id. Future shadows are hard-deleted. Active @@ -92,7 +92,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, OnCallShadowResponse]]: +) -> ErrorsList | OnCallShadowResponse | None: """Delete an on call shadow configuration Delete a specific on call shadow configuration by id. Future shadows are hard-deleted. Active @@ -119,7 +119,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, OnCallShadowResponse]]: +) -> Response[ErrorsList | OnCallShadowResponse]: """Delete an on call shadow configuration Delete a specific on call shadow configuration by id. Future shadows are hard-deleted. Active @@ -149,7 +149,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, OnCallShadowResponse]]: +) -> ErrorsList | OnCallShadowResponse | None: """Delete an on call shadow configuration Delete a specific on call shadow configuration by id. Future shadows are hard-deleted. Active diff --git a/rootly_sdk/api/override_shifts/delete_override_shift.py b/rootly_sdk/api/override_shifts/delete_override_shift.py index b4534a10..cb4a3e9c 100644 --- a/rootly_sdk/api/override_shifts/delete_override_shift.py +++ b/rootly_sdk/api/override_shifts/delete_override_shift.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, OverrideShiftResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | OverrideShiftResponse | None: if response.status_code == 200: response_200 = OverrideShiftResponse.from_dict(response.json()) @@ -41,8 +41,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, OverrideShiftResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | OverrideShiftResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -55,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, OverrideShiftResponse]]: +) -> Response[ErrorsList | OverrideShiftResponse]: """Delete an override shift Delete a specific override shift by id @@ -86,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, OverrideShiftResponse]]: +) -> ErrorsList | OverrideShiftResponse | None: """Delete an override shift Delete a specific override shift by id @@ -112,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, OverrideShiftResponse]]: +) -> Response[ErrorsList | OverrideShiftResponse]: """Delete an override shift Delete a specific override shift by id @@ -141,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, OverrideShiftResponse]]: +) -> ErrorsList | OverrideShiftResponse | None: """Delete an override shift Delete a specific override shift by id diff --git a/rootly_sdk/api/override_shifts/get_override_shift.py b/rootly_sdk/api/override_shifts/get_override_shift.py index cec3b722..945033d2 100644 --- a/rootly_sdk/api/override_shifts/get_override_shift.py +++ b/rootly_sdk/api/override_shifts/get_override_shift.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, OverrideShiftResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | OverrideShiftResponse | None: if response.status_code == 200: response_200 = OverrideShiftResponse.from_dict(response.json()) @@ -41,8 +41,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, OverrideShiftResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | OverrideShiftResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -55,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, OverrideShiftResponse]]: +) -> Response[ErrorsList | OverrideShiftResponse]: """Retrieves an override shift Retrieves a specific override shift by id @@ -86,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, OverrideShiftResponse]]: +) -> ErrorsList | OverrideShiftResponse | None: """Retrieves an override shift Retrieves a specific override shift by id @@ -112,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, OverrideShiftResponse]]: +) -> Response[ErrorsList | OverrideShiftResponse]: """Retrieves an override shift Retrieves a specific override shift by id @@ -141,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, OverrideShiftResponse]]: +) -> ErrorsList | OverrideShiftResponse | None: """Retrieves an override shift Retrieves a specific override shift by id diff --git a/rootly_sdk/api/override_shifts/list_override_shifts.py b/rootly_sdk/api/override_shifts/list_override_shifts.py index 7a7f83d1..778a806c 100644 --- a/rootly_sdk/api/override_shifts/list_override_shifts.py +++ b/rootly_sdk/api/override_shifts/list_override_shifts.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -12,9 +12,9 @@ def _get_kwargs( schedule_id: str, *, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -35,9 +35,7 @@ def _get_kwargs( return _kwargs -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[OverrideShiftList]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> OverrideShiftList | None: if response.status_code == 200: response_200 = OverrideShiftList.from_dict(response.json()) @@ -49,9 +47,7 @@ def _parse_response( return None -def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[OverrideShiftList]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[OverrideShiftList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -64,9 +60,9 @@ def sync_detailed( schedule_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[OverrideShiftList]: """List override shifts @@ -104,10 +100,10 @@ def sync( schedule_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, -) -> Optional[OverrideShiftList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, +) -> OverrideShiftList | None: """List override shifts List override shifts @@ -139,9 +135,9 @@ async def asyncio_detailed( schedule_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[OverrideShiftList]: """List override shifts @@ -177,10 +173,10 @@ async def asyncio( schedule_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, -) -> Optional[OverrideShiftList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, +) -> OverrideShiftList | None: """List override shifts List override shifts diff --git a/rootly_sdk/api/override_shifts/update_override_shift.py b/rootly_sdk/api/override_shifts/update_override_shift.py index 77f6afe3..1d51fe99 100644 --- a/rootly_sdk/api/override_shifts/update_override_shift.py +++ b/rootly_sdk/api/override_shifts/update_override_shift.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, OverrideShiftResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | OverrideShiftResponse | None: if response.status_code == 200: response_200 = OverrideShiftResponse.from_dict(response.json()) @@ -51,8 +51,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, OverrideShiftResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | OverrideShiftResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateOverrideShift, -) -> Response[Union[ErrorsList, OverrideShiftResponse]]: +) -> Response[ErrorsList | OverrideShiftResponse]: """Update an override shift Update a specific override shift by id @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateOverrideShift, -) -> Optional[Union[ErrorsList, OverrideShiftResponse]]: +) -> ErrorsList | OverrideShiftResponse | None: """Update an override shift Update a specific override shift by id @@ -129,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateOverrideShift, -) -> Response[Union[ErrorsList, OverrideShiftResponse]]: +) -> Response[ErrorsList | OverrideShiftResponse]: """Update an override shift Update a specific override shift by id @@ -161,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateOverrideShift, -) -> Optional[Union[ErrorsList, OverrideShiftResponse]]: +) -> ErrorsList | OverrideShiftResponse | None: """Update an override shift Update a specific override shift by id diff --git a/rootly_sdk/api/playbook_tasks/create_playbook_task.py b/rootly_sdk/api/playbook_tasks/create_playbook_task.py index bb41ac7f..1d183cf4 100644 --- a/rootly_sdk/api/playbook_tasks/create_playbook_task.py +++ b/rootly_sdk/api/playbook_tasks/create_playbook_task.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, PlaybookTaskResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | PlaybookTaskResponse | None: if response.status_code == 201: response_201 = PlaybookTaskResponse.from_dict(response.json()) @@ -56,8 +56,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, PlaybookTaskResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | PlaybookTaskResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -71,7 +71,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewPlaybookTask, -) -> Response[Union[ErrorsList, PlaybookTaskResponse]]: +) -> Response[ErrorsList | PlaybookTaskResponse]: """Creates a playbook task Creates a new task from provided data @@ -105,7 +105,7 @@ def sync( *, client: AuthenticatedClient, body: NewPlaybookTask, -) -> Optional[Union[ErrorsList, PlaybookTaskResponse]]: +) -> ErrorsList | PlaybookTaskResponse | None: """Creates a playbook task Creates a new task from provided data @@ -134,7 +134,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewPlaybookTask, -) -> Response[Union[ErrorsList, PlaybookTaskResponse]]: +) -> Response[ErrorsList | PlaybookTaskResponse]: """Creates a playbook task Creates a new task from provided data @@ -166,7 +166,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewPlaybookTask, -) -> Optional[Union[ErrorsList, PlaybookTaskResponse]]: +) -> ErrorsList | PlaybookTaskResponse | None: """Creates a playbook task Creates a new task from provided data diff --git a/rootly_sdk/api/playbook_tasks/delete_playbook_task.py b/rootly_sdk/api/playbook_tasks/delete_playbook_task.py index 0bd2b482..6b25e8b3 100644 --- a/rootly_sdk/api/playbook_tasks/delete_playbook_task.py +++ b/rootly_sdk/api/playbook_tasks/delete_playbook_task.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, PlaybookTaskResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | PlaybookTaskResponse | None: if response.status_code == 200: response_200 = PlaybookTaskResponse.from_dict(response.json()) @@ -41,8 +41,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, PlaybookTaskResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | PlaybookTaskResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -55,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, PlaybookTaskResponse]]: +) -> Response[ErrorsList | PlaybookTaskResponse]: """Delete a playbook task Delete a specific playbook task by id @@ -86,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, PlaybookTaskResponse]]: +) -> ErrorsList | PlaybookTaskResponse | None: """Delete a playbook task Delete a specific playbook task by id @@ -112,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, PlaybookTaskResponse]]: +) -> Response[ErrorsList | PlaybookTaskResponse]: """Delete a playbook task Delete a specific playbook task by id @@ -141,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, PlaybookTaskResponse]]: +) -> ErrorsList | PlaybookTaskResponse | None: """Delete a playbook task Delete a specific playbook task by id diff --git a/rootly_sdk/api/playbook_tasks/get_playbook_task.py b/rootly_sdk/api/playbook_tasks/get_playbook_task.py index 7e61b14f..1caa8d23 100644 --- a/rootly_sdk/api/playbook_tasks/get_playbook_task.py +++ b/rootly_sdk/api/playbook_tasks/get_playbook_task.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, PlaybookTaskResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | PlaybookTaskResponse | None: if response.status_code == 200: response_200 = PlaybookTaskResponse.from_dict(response.json()) @@ -41,8 +41,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, PlaybookTaskResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | PlaybookTaskResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -55,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, PlaybookTaskResponse]]: +) -> Response[ErrorsList | PlaybookTaskResponse]: """Retrieves a playbook task Retrieves a specific playbook_task by id @@ -86,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, PlaybookTaskResponse]]: +) -> ErrorsList | PlaybookTaskResponse | None: """Retrieves a playbook task Retrieves a specific playbook_task by id @@ -112,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, PlaybookTaskResponse]]: +) -> Response[ErrorsList | PlaybookTaskResponse]: """Retrieves a playbook task Retrieves a specific playbook_task by id @@ -141,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, PlaybookTaskResponse]]: +) -> ErrorsList | PlaybookTaskResponse | None: """Retrieves a playbook task Retrieves a specific playbook_task by id diff --git a/rootly_sdk/api/playbook_tasks/list_playbook_tasks.py b/rootly_sdk/api/playbook_tasks/list_playbook_tasks.py index 37ef2e38..7c9aad1c 100644 --- a/rootly_sdk/api/playbook_tasks/list_playbook_tasks.py +++ b/rootly_sdk/api/playbook_tasks/list_playbook_tasks.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -12,9 +12,9 @@ def _get_kwargs( playbook_id: str, *, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -35,9 +35,7 @@ def _get_kwargs( return _kwargs -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[PlaybookTaskList]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> PlaybookTaskList | None: if response.status_code == 200: response_200 = PlaybookTaskList.from_dict(response.json()) @@ -49,9 +47,7 @@ def _parse_response( return None -def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[PlaybookTaskList]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[PlaybookTaskList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -64,9 +60,9 @@ def sync_detailed( playbook_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[PlaybookTaskList]: """List playbook tasks @@ -104,10 +100,10 @@ def sync( playbook_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, -) -> Optional[PlaybookTaskList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, +) -> PlaybookTaskList | None: """List playbook tasks List playbook tasks @@ -139,9 +135,9 @@ async def asyncio_detailed( playbook_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[PlaybookTaskList]: """List playbook tasks @@ -177,10 +173,10 @@ async def asyncio( playbook_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, -) -> Optional[PlaybookTaskList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, +) -> PlaybookTaskList | None: """List playbook tasks List playbook tasks diff --git a/rootly_sdk/api/playbook_tasks/update_playbook_task.py b/rootly_sdk/api/playbook_tasks/update_playbook_task.py index 25a75f3f..11903b62 100644 --- a/rootly_sdk/api/playbook_tasks/update_playbook_task.py +++ b/rootly_sdk/api/playbook_tasks/update_playbook_task.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, PlaybookTaskResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | PlaybookTaskResponse | None: if response.status_code == 200: response_200 = PlaybookTaskResponse.from_dict(response.json()) @@ -51,8 +51,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, PlaybookTaskResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | PlaybookTaskResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdatePlaybookTask, -) -> Response[Union[ErrorsList, PlaybookTaskResponse]]: +) -> Response[ErrorsList | PlaybookTaskResponse]: """Update a playbook task Update a specific playbook task by id @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: UpdatePlaybookTask, -) -> Optional[Union[ErrorsList, PlaybookTaskResponse]]: +) -> ErrorsList | PlaybookTaskResponse | None: """Update a playbook task Update a specific playbook task by id @@ -129,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdatePlaybookTask, -) -> Response[Union[ErrorsList, PlaybookTaskResponse]]: +) -> Response[ErrorsList | PlaybookTaskResponse]: """Update a playbook task Update a specific playbook task by id @@ -161,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdatePlaybookTask, -) -> Optional[Union[ErrorsList, PlaybookTaskResponse]]: +) -> ErrorsList | PlaybookTaskResponse | None: """Update a playbook task Update a specific playbook task by id diff --git a/rootly_sdk/api/playbooks/create_playbook.py b/rootly_sdk/api/playbooks/create_playbook.py index 9dfa3a60..ca3ebc8c 100644 --- a/rootly_sdk/api/playbooks/create_playbook.py +++ b/rootly_sdk/api/playbooks/create_playbook.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, PlaybookResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | PlaybookResponse | None: if response.status_code == 201: response_201 = PlaybookResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, PlaybookResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | PlaybookResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +69,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewPlaybook, -) -> Response[Union[ErrorsList, PlaybookResponse]]: +) -> Response[ErrorsList | PlaybookResponse]: """Creates a playbook Creates a new playbook from provided data @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: NewPlaybook, -) -> Optional[Union[ErrorsList, PlaybookResponse]]: +) -> ErrorsList | PlaybookResponse | None: """Creates a playbook Creates a new playbook from provided data @@ -126,7 +126,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewPlaybook, -) -> Response[Union[ErrorsList, PlaybookResponse]]: +) -> Response[ErrorsList | PlaybookResponse]: """Creates a playbook Creates a new playbook from provided data @@ -155,7 +155,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewPlaybook, -) -> Optional[Union[ErrorsList, PlaybookResponse]]: +) -> ErrorsList | PlaybookResponse | None: """Creates a playbook Creates a new playbook from provided data diff --git a/rootly_sdk/api/playbooks/delete_playbook.py b/rootly_sdk/api/playbooks/delete_playbook.py index 0cd04ede..5ef76845 100644 --- a/rootly_sdk/api/playbooks/delete_playbook.py +++ b/rootly_sdk/api/playbooks/delete_playbook.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, PlaybookResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | PlaybookResponse | None: if response.status_code == 200: response_200 = PlaybookResponse.from_dict(response.json()) @@ -41,8 +41,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, PlaybookResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | PlaybookResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -55,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, PlaybookResponse]]: +) -> Response[ErrorsList | PlaybookResponse]: """Delete a playbook Delete a specific playbook by id @@ -86,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, PlaybookResponse]]: +) -> ErrorsList | PlaybookResponse | None: """Delete a playbook Delete a specific playbook by id @@ -112,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, PlaybookResponse]]: +) -> Response[ErrorsList | PlaybookResponse]: """Delete a playbook Delete a specific playbook by id @@ -141,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, PlaybookResponse]]: +) -> ErrorsList | PlaybookResponse | None: """Delete a playbook Delete a specific playbook by id diff --git a/rootly_sdk/api/playbooks/get_playbook.py b/rootly_sdk/api/playbooks/get_playbook.py index 658fb0ea..8d8dcb9c 100644 --- a/rootly_sdk/api/playbooks/get_playbook.py +++ b/rootly_sdk/api/playbooks/get_playbook.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -14,11 +14,11 @@ def _get_kwargs( id: str, *, - include: Union[Unset, GetPlaybookInclude] = UNSET, + include: Unset | GetPlaybookInclude = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} - json_include: Union[Unset, str] = UNSET + json_include: Unset | str = UNSET if not isinstance(include, Unset): json_include = include @@ -36,8 +36,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, PlaybookResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | PlaybookResponse | None: if response.status_code == 200: response_200 = PlaybookResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, PlaybookResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | PlaybookResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,8 +69,8 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, - include: Union[Unset, GetPlaybookInclude] = UNSET, -) -> Response[Union[ErrorsList, PlaybookResponse]]: + include: Unset | GetPlaybookInclude = UNSET, +) -> Response[ErrorsList | PlaybookResponse]: """Retrieves a playbook Retrieves a specific playbook by id @@ -103,8 +103,8 @@ def sync( id: str, *, client: AuthenticatedClient, - include: Union[Unset, GetPlaybookInclude] = UNSET, -) -> Optional[Union[ErrorsList, PlaybookResponse]]: + include: Unset | GetPlaybookInclude = UNSET, +) -> ErrorsList | PlaybookResponse | None: """Retrieves a playbook Retrieves a specific playbook by id @@ -132,8 +132,8 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, - include: Union[Unset, GetPlaybookInclude] = UNSET, -) -> Response[Union[ErrorsList, PlaybookResponse]]: + include: Unset | GetPlaybookInclude = UNSET, +) -> Response[ErrorsList | PlaybookResponse]: """Retrieves a playbook Retrieves a specific playbook by id @@ -164,8 +164,8 @@ async def asyncio( id: str, *, client: AuthenticatedClient, - include: Union[Unset, GetPlaybookInclude] = UNSET, -) -> Optional[Union[ErrorsList, PlaybookResponse]]: + include: Unset | GetPlaybookInclude = UNSET, +) -> ErrorsList | PlaybookResponse | None: """Retrieves a playbook Retrieves a specific playbook by id diff --git a/rootly_sdk/api/playbooks/list_playbooks.py b/rootly_sdk/api/playbooks/list_playbooks.py index 9c569938..e7ba8cb3 100644 --- a/rootly_sdk/api/playbooks/list_playbooks.py +++ b/rootly_sdk/api/playbooks/list_playbooks.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -12,13 +12,13 @@ def _get_kwargs( *, - include: Union[Unset, ListPlaybooksInclude] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + include: Unset | ListPlaybooksInclude = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} - json_include: Union[Unset, str] = UNSET + json_include: Unset | str = UNSET if not isinstance(include, Unset): json_include = include @@ -39,7 +39,7 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[PlaybookList]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> PlaybookList | None: if response.status_code == 200: response_200 = PlaybookList.from_dict(response.json()) @@ -51,7 +51,7 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[PlaybookList]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[PlaybookList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -63,9 +63,9 @@ def _build_response(*, client: Union[AuthenticatedClient, Client], response: htt def sync_detailed( *, client: AuthenticatedClient, - include: Union[Unset, ListPlaybooksInclude] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + include: Unset | ListPlaybooksInclude = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[PlaybookList]: """List playbooks @@ -100,10 +100,10 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: Union[Unset, ListPlaybooksInclude] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, -) -> Optional[PlaybookList]: + include: Unset | ListPlaybooksInclude = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, +) -> PlaybookList | None: """List playbooks List playbooks @@ -132,9 +132,9 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: Union[Unset, ListPlaybooksInclude] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + include: Unset | ListPlaybooksInclude = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[PlaybookList]: """List playbooks @@ -167,10 +167,10 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: Union[Unset, ListPlaybooksInclude] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, -) -> Optional[PlaybookList]: + include: Unset | ListPlaybooksInclude = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, +) -> PlaybookList | None: """List playbooks List playbooks diff --git a/rootly_sdk/api/playbooks/update_playbook.py b/rootly_sdk/api/playbooks/update_playbook.py index 370dc2c9..06bf4a5e 100644 --- a/rootly_sdk/api/playbooks/update_playbook.py +++ b/rootly_sdk/api/playbooks/update_playbook.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, PlaybookResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | PlaybookResponse | None: if response.status_code == 200: response_200 = PlaybookResponse.from_dict(response.json()) @@ -51,8 +51,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, PlaybookResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | PlaybookResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdatePlaybook, -) -> Response[Union[ErrorsList, PlaybookResponse]]: +) -> Response[ErrorsList | PlaybookResponse]: """Update a playbook Update a specific playbook by id @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: UpdatePlaybook, -) -> Optional[Union[ErrorsList, PlaybookResponse]]: +) -> ErrorsList | PlaybookResponse | None: """Update a playbook Update a specific playbook by id @@ -129,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdatePlaybook, -) -> Response[Union[ErrorsList, PlaybookResponse]]: +) -> Response[ErrorsList | PlaybookResponse]: """Update a playbook Update a specific playbook by id @@ -161,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdatePlaybook, -) -> Optional[Union[ErrorsList, PlaybookResponse]]: +) -> ErrorsList | PlaybookResponse | None: """Update a playbook Update a specific playbook by id diff --git a/rootly_sdk/api/pulses/create_pulse.py b/rootly_sdk/api/pulses/create_pulse.py index c4f507be..a54eb50b 100644 --- a/rootly_sdk/api/pulses/create_pulse.py +++ b/rootly_sdk/api/pulses/create_pulse.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, PulseResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | PulseResponse | None: if response.status_code == 201: response_201 = PulseResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, PulseResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | PulseResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +69,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewPulse, -) -> Response[Union[ErrorsList, PulseResponse]]: +) -> Response[ErrorsList | PulseResponse]: """Creates a pulse Creates a new pulse from provided data @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: NewPulse, -) -> Optional[Union[ErrorsList, PulseResponse]]: +) -> ErrorsList | PulseResponse | None: """Creates a pulse Creates a new pulse from provided data @@ -126,7 +126,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewPulse, -) -> Response[Union[ErrorsList, PulseResponse]]: +) -> Response[ErrorsList | PulseResponse]: """Creates a pulse Creates a new pulse from provided data @@ -155,7 +155,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewPulse, -) -> Optional[Union[ErrorsList, PulseResponse]]: +) -> ErrorsList | PulseResponse | None: """Creates a pulse Creates a new pulse from provided data diff --git a/rootly_sdk/api/pulses/get_pulse.py b/rootly_sdk/api/pulses/get_pulse.py index 01f70acb..66769553 100644 --- a/rootly_sdk/api/pulses/get_pulse.py +++ b/rootly_sdk/api/pulses/get_pulse.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, PulseResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | PulseResponse | None: if response.status_code == 200: response_200 = PulseResponse.from_dict(response.json()) @@ -41,8 +41,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, PulseResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | PulseResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -55,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, PulseResponse]]: +) -> Response[ErrorsList | PulseResponse]: """Retrieves a pulse Retrieves a specific pulse by id @@ -86,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, PulseResponse]]: +) -> ErrorsList | PulseResponse | None: """Retrieves a pulse Retrieves a specific pulse by id @@ -112,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, PulseResponse]]: +) -> Response[ErrorsList | PulseResponse]: """Retrieves a pulse Retrieves a specific pulse by id @@ -141,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, PulseResponse]]: +) -> ErrorsList | PulseResponse | None: """Retrieves a pulse Retrieves a specific pulse by id diff --git a/rootly_sdk/api/pulses/list_pulses.py b/rootly_sdk/api/pulses/list_pulses.py index 23667696..c03b1e5f 100644 --- a/rootly_sdk/api/pulses/list_pulses.py +++ b/rootly_sdk/api/pulses/list_pulses.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -11,46 +11,46 @@ def _get_kwargs( *, - include: Union[Unset, str] = UNSET, - filtersource: Union[Unset, str] = UNSET, - filterservices: Union[Unset, str] = UNSET, - filterenvironments: Union[Unset, str] = UNSET, - filterlabels: Union[Unset, str] = UNSET, - filterrefs: Union[Unset, str] = UNSET, - filterstarted_atgt: Union[Unset, str] = UNSET, - filterstarted_atgte: Union[Unset, str] = UNSET, - filterstarted_atlt: Union[Unset, str] = UNSET, - filterstarted_atlte: Union[Unset, str] = UNSET, - filterended_atgt: Union[Unset, str] = UNSET, - filterended_atgte: Union[Unset, str] = UNSET, - filterended_atlt: Union[Unset, str] = UNSET, - filterended_atlte: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filtersourceeq: Union[Unset, str] = UNSET, - filtersourcenot_eq: Union[Unset, str] = UNSET, - filtersourcein: Union[Unset, str] = UNSET, - filtersourcenot_in: Union[Unset, str] = UNSET, - filterserviceseq: Union[Unset, str] = UNSET, - filterservicesnot_eq: Union[Unset, str] = UNSET, - filterservicesin: Union[Unset, str] = UNSET, - filterservicesnot_in: Union[Unset, str] = UNSET, - filterenvironmentseq: Union[Unset, str] = UNSET, - filterenvironmentsnot_eq: Union[Unset, str] = UNSET, - filterenvironmentsin: Union[Unset, str] = UNSET, - filterenvironmentsnot_in: Union[Unset, str] = UNSET, - filterlabelseq: Union[Unset, str] = UNSET, - filterlabelsnot_eq: Union[Unset, str] = UNSET, - filterlabelsin: Union[Unset, str] = UNSET, - filterlabelsnot_in: Union[Unset, str] = UNSET, - filterrefseq: Union[Unset, str] = UNSET, - filterrefsnot_eq: Union[Unset, str] = UNSET, - filterrefsin: Union[Unset, str] = UNSET, - filterrefsnot_in: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + include: Unset | str = UNSET, + filtersource: Unset | str = UNSET, + filterservices: Unset | str = UNSET, + filterenvironments: Unset | str = UNSET, + filterlabels: Unset | str = UNSET, + filterrefs: Unset | str = UNSET, + filterstarted_atgt: Unset | str = UNSET, + filterstarted_atgte: Unset | str = UNSET, + filterstarted_atlt: Unset | str = UNSET, + filterstarted_atlte: Unset | str = UNSET, + filterended_atgt: Unset | str = UNSET, + filterended_atgte: Unset | str = UNSET, + filterended_atlt: Unset | str = UNSET, + filterended_atlte: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filtersourceeq: Unset | str = UNSET, + filtersourcenot_eq: Unset | str = UNSET, + filtersourcein: Unset | str = UNSET, + filtersourcenot_in: Unset | str = UNSET, + filterserviceseq: Unset | str = UNSET, + filterservicesnot_eq: Unset | str = UNSET, + filterservicesin: Unset | str = UNSET, + filterservicesnot_in: Unset | str = UNSET, + filterenvironmentseq: Unset | str = UNSET, + filterenvironmentsnot_eq: Unset | str = UNSET, + filterenvironmentsin: Unset | str = UNSET, + filterenvironmentsnot_in: Unset | str = UNSET, + filterlabelseq: Unset | str = UNSET, + filterlabelsnot_eq: Unset | str = UNSET, + filterlabelsin: Unset | str = UNSET, + filterlabelsnot_in: Unset | str = UNSET, + filterrefseq: Unset | str = UNSET, + filterrefsnot_eq: Unset | str = UNSET, + filterrefsin: Unset | str = UNSET, + filterrefsnot_in: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -145,7 +145,7 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[PulseList]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> PulseList | None: if response.status_code == 200: response_200 = PulseList.from_dict(response.json()) @@ -157,7 +157,7 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[PulseList]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[PulseList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -169,46 +169,46 @@ def _build_response(*, client: Union[AuthenticatedClient, Client], response: htt def sync_detailed( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - filtersource: Union[Unset, str] = UNSET, - filterservices: Union[Unset, str] = UNSET, - filterenvironments: Union[Unset, str] = UNSET, - filterlabels: Union[Unset, str] = UNSET, - filterrefs: Union[Unset, str] = UNSET, - filterstarted_atgt: Union[Unset, str] = UNSET, - filterstarted_atgte: Union[Unset, str] = UNSET, - filterstarted_atlt: Union[Unset, str] = UNSET, - filterstarted_atlte: Union[Unset, str] = UNSET, - filterended_atgt: Union[Unset, str] = UNSET, - filterended_atgte: Union[Unset, str] = UNSET, - filterended_atlt: Union[Unset, str] = UNSET, - filterended_atlte: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filtersourceeq: Union[Unset, str] = UNSET, - filtersourcenot_eq: Union[Unset, str] = UNSET, - filtersourcein: Union[Unset, str] = UNSET, - filtersourcenot_in: Union[Unset, str] = UNSET, - filterserviceseq: Union[Unset, str] = UNSET, - filterservicesnot_eq: Union[Unset, str] = UNSET, - filterservicesin: Union[Unset, str] = UNSET, - filterservicesnot_in: Union[Unset, str] = UNSET, - filterenvironmentseq: Union[Unset, str] = UNSET, - filterenvironmentsnot_eq: Union[Unset, str] = UNSET, - filterenvironmentsin: Union[Unset, str] = UNSET, - filterenvironmentsnot_in: Union[Unset, str] = UNSET, - filterlabelseq: Union[Unset, str] = UNSET, - filterlabelsnot_eq: Union[Unset, str] = UNSET, - filterlabelsin: Union[Unset, str] = UNSET, - filterlabelsnot_in: Union[Unset, str] = UNSET, - filterrefseq: Union[Unset, str] = UNSET, - filterrefsnot_eq: Union[Unset, str] = UNSET, - filterrefsin: Union[Unset, str] = UNSET, - filterrefsnot_in: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + include: Unset | str = UNSET, + filtersource: Unset | str = UNSET, + filterservices: Unset | str = UNSET, + filterenvironments: Unset | str = UNSET, + filterlabels: Unset | str = UNSET, + filterrefs: Unset | str = UNSET, + filterstarted_atgt: Unset | str = UNSET, + filterstarted_atgte: Unset | str = UNSET, + filterstarted_atlt: Unset | str = UNSET, + filterstarted_atlte: Unset | str = UNSET, + filterended_atgt: Unset | str = UNSET, + filterended_atgte: Unset | str = UNSET, + filterended_atlt: Unset | str = UNSET, + filterended_atlte: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filtersourceeq: Unset | str = UNSET, + filtersourcenot_eq: Unset | str = UNSET, + filtersourcein: Unset | str = UNSET, + filtersourcenot_in: Unset | str = UNSET, + filterserviceseq: Unset | str = UNSET, + filterservicesnot_eq: Unset | str = UNSET, + filterservicesin: Unset | str = UNSET, + filterservicesnot_in: Unset | str = UNSET, + filterenvironmentseq: Unset | str = UNSET, + filterenvironmentsnot_eq: Unset | str = UNSET, + filterenvironmentsin: Unset | str = UNSET, + filterenvironmentsnot_in: Unset | str = UNSET, + filterlabelseq: Unset | str = UNSET, + filterlabelsnot_eq: Unset | str = UNSET, + filterlabelsin: Unset | str = UNSET, + filterlabelsnot_in: Unset | str = UNSET, + filterrefseq: Unset | str = UNSET, + filterrefsnot_eq: Unset | str = UNSET, + filterrefsin: Unset | str = UNSET, + filterrefsnot_in: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[PulseList]: """List pulses @@ -317,47 +317,47 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - filtersource: Union[Unset, str] = UNSET, - filterservices: Union[Unset, str] = UNSET, - filterenvironments: Union[Unset, str] = UNSET, - filterlabels: Union[Unset, str] = UNSET, - filterrefs: Union[Unset, str] = UNSET, - filterstarted_atgt: Union[Unset, str] = UNSET, - filterstarted_atgte: Union[Unset, str] = UNSET, - filterstarted_atlt: Union[Unset, str] = UNSET, - filterstarted_atlte: Union[Unset, str] = UNSET, - filterended_atgt: Union[Unset, str] = UNSET, - filterended_atgte: Union[Unset, str] = UNSET, - filterended_atlt: Union[Unset, str] = UNSET, - filterended_atlte: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filtersourceeq: Union[Unset, str] = UNSET, - filtersourcenot_eq: Union[Unset, str] = UNSET, - filtersourcein: Union[Unset, str] = UNSET, - filtersourcenot_in: Union[Unset, str] = UNSET, - filterserviceseq: Union[Unset, str] = UNSET, - filterservicesnot_eq: Union[Unset, str] = UNSET, - filterservicesin: Union[Unset, str] = UNSET, - filterservicesnot_in: Union[Unset, str] = UNSET, - filterenvironmentseq: Union[Unset, str] = UNSET, - filterenvironmentsnot_eq: Union[Unset, str] = UNSET, - filterenvironmentsin: Union[Unset, str] = UNSET, - filterenvironmentsnot_in: Union[Unset, str] = UNSET, - filterlabelseq: Union[Unset, str] = UNSET, - filterlabelsnot_eq: Union[Unset, str] = UNSET, - filterlabelsin: Union[Unset, str] = UNSET, - filterlabelsnot_in: Union[Unset, str] = UNSET, - filterrefseq: Union[Unset, str] = UNSET, - filterrefsnot_eq: Union[Unset, str] = UNSET, - filterrefsin: Union[Unset, str] = UNSET, - filterrefsnot_in: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, -) -> Optional[PulseList]: + include: Unset | str = UNSET, + filtersource: Unset | str = UNSET, + filterservices: Unset | str = UNSET, + filterenvironments: Unset | str = UNSET, + filterlabels: Unset | str = UNSET, + filterrefs: Unset | str = UNSET, + filterstarted_atgt: Unset | str = UNSET, + filterstarted_atgte: Unset | str = UNSET, + filterstarted_atlt: Unset | str = UNSET, + filterstarted_atlte: Unset | str = UNSET, + filterended_atgt: Unset | str = UNSET, + filterended_atgte: Unset | str = UNSET, + filterended_atlt: Unset | str = UNSET, + filterended_atlte: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filtersourceeq: Unset | str = UNSET, + filtersourcenot_eq: Unset | str = UNSET, + filtersourcein: Unset | str = UNSET, + filtersourcenot_in: Unset | str = UNSET, + filterserviceseq: Unset | str = UNSET, + filterservicesnot_eq: Unset | str = UNSET, + filterservicesin: Unset | str = UNSET, + filterservicesnot_in: Unset | str = UNSET, + filterenvironmentseq: Unset | str = UNSET, + filterenvironmentsnot_eq: Unset | str = UNSET, + filterenvironmentsin: Unset | str = UNSET, + filterenvironmentsnot_in: Unset | str = UNSET, + filterlabelseq: Unset | str = UNSET, + filterlabelsnot_eq: Unset | str = UNSET, + filterlabelsin: Unset | str = UNSET, + filterlabelsnot_in: Unset | str = UNSET, + filterrefseq: Unset | str = UNSET, + filterrefsnot_eq: Unset | str = UNSET, + filterrefsin: Unset | str = UNSET, + filterrefsnot_in: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, +) -> PulseList | None: """List pulses List pulses @@ -460,46 +460,46 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - filtersource: Union[Unset, str] = UNSET, - filterservices: Union[Unset, str] = UNSET, - filterenvironments: Union[Unset, str] = UNSET, - filterlabels: Union[Unset, str] = UNSET, - filterrefs: Union[Unset, str] = UNSET, - filterstarted_atgt: Union[Unset, str] = UNSET, - filterstarted_atgte: Union[Unset, str] = UNSET, - filterstarted_atlt: Union[Unset, str] = UNSET, - filterstarted_atlte: Union[Unset, str] = UNSET, - filterended_atgt: Union[Unset, str] = UNSET, - filterended_atgte: Union[Unset, str] = UNSET, - filterended_atlt: Union[Unset, str] = UNSET, - filterended_atlte: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filtersourceeq: Union[Unset, str] = UNSET, - filtersourcenot_eq: Union[Unset, str] = UNSET, - filtersourcein: Union[Unset, str] = UNSET, - filtersourcenot_in: Union[Unset, str] = UNSET, - filterserviceseq: Union[Unset, str] = UNSET, - filterservicesnot_eq: Union[Unset, str] = UNSET, - filterservicesin: Union[Unset, str] = UNSET, - filterservicesnot_in: Union[Unset, str] = UNSET, - filterenvironmentseq: Union[Unset, str] = UNSET, - filterenvironmentsnot_eq: Union[Unset, str] = UNSET, - filterenvironmentsin: Union[Unset, str] = UNSET, - filterenvironmentsnot_in: Union[Unset, str] = UNSET, - filterlabelseq: Union[Unset, str] = UNSET, - filterlabelsnot_eq: Union[Unset, str] = UNSET, - filterlabelsin: Union[Unset, str] = UNSET, - filterlabelsnot_in: Union[Unset, str] = UNSET, - filterrefseq: Union[Unset, str] = UNSET, - filterrefsnot_eq: Union[Unset, str] = UNSET, - filterrefsin: Union[Unset, str] = UNSET, - filterrefsnot_in: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + include: Unset | str = UNSET, + filtersource: Unset | str = UNSET, + filterservices: Unset | str = UNSET, + filterenvironments: Unset | str = UNSET, + filterlabels: Unset | str = UNSET, + filterrefs: Unset | str = UNSET, + filterstarted_atgt: Unset | str = UNSET, + filterstarted_atgte: Unset | str = UNSET, + filterstarted_atlt: Unset | str = UNSET, + filterstarted_atlte: Unset | str = UNSET, + filterended_atgt: Unset | str = UNSET, + filterended_atgte: Unset | str = UNSET, + filterended_atlt: Unset | str = UNSET, + filterended_atlte: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filtersourceeq: Unset | str = UNSET, + filtersourcenot_eq: Unset | str = UNSET, + filtersourcein: Unset | str = UNSET, + filtersourcenot_in: Unset | str = UNSET, + filterserviceseq: Unset | str = UNSET, + filterservicesnot_eq: Unset | str = UNSET, + filterservicesin: Unset | str = UNSET, + filterservicesnot_in: Unset | str = UNSET, + filterenvironmentseq: Unset | str = UNSET, + filterenvironmentsnot_eq: Unset | str = UNSET, + filterenvironmentsin: Unset | str = UNSET, + filterenvironmentsnot_in: Unset | str = UNSET, + filterlabelseq: Unset | str = UNSET, + filterlabelsnot_eq: Unset | str = UNSET, + filterlabelsin: Unset | str = UNSET, + filterlabelsnot_in: Unset | str = UNSET, + filterrefseq: Unset | str = UNSET, + filterrefsnot_eq: Unset | str = UNSET, + filterrefsin: Unset | str = UNSET, + filterrefsnot_in: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[PulseList]: """List pulses @@ -606,47 +606,47 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - filtersource: Union[Unset, str] = UNSET, - filterservices: Union[Unset, str] = UNSET, - filterenvironments: Union[Unset, str] = UNSET, - filterlabels: Union[Unset, str] = UNSET, - filterrefs: Union[Unset, str] = UNSET, - filterstarted_atgt: Union[Unset, str] = UNSET, - filterstarted_atgte: Union[Unset, str] = UNSET, - filterstarted_atlt: Union[Unset, str] = UNSET, - filterstarted_atlte: Union[Unset, str] = UNSET, - filterended_atgt: Union[Unset, str] = UNSET, - filterended_atgte: Union[Unset, str] = UNSET, - filterended_atlt: Union[Unset, str] = UNSET, - filterended_atlte: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filtersourceeq: Union[Unset, str] = UNSET, - filtersourcenot_eq: Union[Unset, str] = UNSET, - filtersourcein: Union[Unset, str] = UNSET, - filtersourcenot_in: Union[Unset, str] = UNSET, - filterserviceseq: Union[Unset, str] = UNSET, - filterservicesnot_eq: Union[Unset, str] = UNSET, - filterservicesin: Union[Unset, str] = UNSET, - filterservicesnot_in: Union[Unset, str] = UNSET, - filterenvironmentseq: Union[Unset, str] = UNSET, - filterenvironmentsnot_eq: Union[Unset, str] = UNSET, - filterenvironmentsin: Union[Unset, str] = UNSET, - filterenvironmentsnot_in: Union[Unset, str] = UNSET, - filterlabelseq: Union[Unset, str] = UNSET, - filterlabelsnot_eq: Union[Unset, str] = UNSET, - filterlabelsin: Union[Unset, str] = UNSET, - filterlabelsnot_in: Union[Unset, str] = UNSET, - filterrefseq: Union[Unset, str] = UNSET, - filterrefsnot_eq: Union[Unset, str] = UNSET, - filterrefsin: Union[Unset, str] = UNSET, - filterrefsnot_in: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, -) -> Optional[PulseList]: + include: Unset | str = UNSET, + filtersource: Unset | str = UNSET, + filterservices: Unset | str = UNSET, + filterenvironments: Unset | str = UNSET, + filterlabels: Unset | str = UNSET, + filterrefs: Unset | str = UNSET, + filterstarted_atgt: Unset | str = UNSET, + filterstarted_atgte: Unset | str = UNSET, + filterstarted_atlt: Unset | str = UNSET, + filterstarted_atlte: Unset | str = UNSET, + filterended_atgt: Unset | str = UNSET, + filterended_atgte: Unset | str = UNSET, + filterended_atlt: Unset | str = UNSET, + filterended_atlte: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filtersourceeq: Unset | str = UNSET, + filtersourcenot_eq: Unset | str = UNSET, + filtersourcein: Unset | str = UNSET, + filtersourcenot_in: Unset | str = UNSET, + filterserviceseq: Unset | str = UNSET, + filterservicesnot_eq: Unset | str = UNSET, + filterservicesin: Unset | str = UNSET, + filterservicesnot_in: Unset | str = UNSET, + filterenvironmentseq: Unset | str = UNSET, + filterenvironmentsnot_eq: Unset | str = UNSET, + filterenvironmentsin: Unset | str = UNSET, + filterenvironmentsnot_in: Unset | str = UNSET, + filterlabelseq: Unset | str = UNSET, + filterlabelsnot_eq: Unset | str = UNSET, + filterlabelsin: Unset | str = UNSET, + filterlabelsnot_in: Unset | str = UNSET, + filterrefseq: Unset | str = UNSET, + filterrefsnot_eq: Unset | str = UNSET, + filterrefsin: Unset | str = UNSET, + filterrefsnot_in: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, +) -> PulseList | None: """List pulses List pulses diff --git a/rootly_sdk/api/pulses/update_pulse.py b/rootly_sdk/api/pulses/update_pulse.py index 961c0885..2364915a 100644 --- a/rootly_sdk/api/pulses/update_pulse.py +++ b/rootly_sdk/api/pulses/update_pulse.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, PulseResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | PulseResponse | None: if response.status_code == 200: response_200 = PulseResponse.from_dict(response.json()) @@ -51,8 +51,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, PulseResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | PulseResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdatePulse, -) -> Response[Union[ErrorsList, PulseResponse]]: +) -> Response[ErrorsList | PulseResponse]: """Update a pulse Update a specific pulse by id @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: UpdatePulse, -) -> Optional[Union[ErrorsList, PulseResponse]]: +) -> ErrorsList | PulseResponse | None: """Update a pulse Update a specific pulse by id @@ -129,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdatePulse, -) -> Response[Union[ErrorsList, PulseResponse]]: +) -> Response[ErrorsList | PulseResponse]: """Update a pulse Update a specific pulse by id @@ -161,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdatePulse, -) -> Optional[Union[ErrorsList, PulseResponse]]: +) -> ErrorsList | PulseResponse | None: """Update a pulse Update a specific pulse by id diff --git a/rootly_sdk/api/retrospective_configurations/get_retrospective_configuration.py b/rootly_sdk/api/retrospective_configurations/get_retrospective_configuration.py index b4e6f9cc..c9e25ba8 100644 --- a/rootly_sdk/api/retrospective_configurations/get_retrospective_configuration.py +++ b/rootly_sdk/api/retrospective_configurations/get_retrospective_configuration.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -16,11 +16,11 @@ def _get_kwargs( id: str, *, - include: Union[Unset, GetRetrospectiveConfigurationInclude] = UNSET, + include: Unset | GetRetrospectiveConfigurationInclude = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} - json_include: Union[Unset, str] = UNSET + json_include: Unset | str = UNSET if not isinstance(include, Unset): json_include = include @@ -38,8 +38,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, RetrospectiveConfigurationResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | RetrospectiveConfigurationResponse | None: if response.status_code == 200: response_200 = RetrospectiveConfigurationResponse.from_dict(response.json()) @@ -57,8 +57,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, RetrospectiveConfigurationResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | RetrospectiveConfigurationResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -71,8 +71,8 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, - include: Union[Unset, GetRetrospectiveConfigurationInclude] = UNSET, -) -> Response[Union[ErrorsList, RetrospectiveConfigurationResponse]]: + include: Unset | GetRetrospectiveConfigurationInclude = UNSET, +) -> Response[ErrorsList | RetrospectiveConfigurationResponse]: """Retrieves a Retrospective Configuration Retrieves a specific retrospective_configuration by id @@ -105,8 +105,8 @@ def sync( id: str, *, client: AuthenticatedClient, - include: Union[Unset, GetRetrospectiveConfigurationInclude] = UNSET, -) -> Optional[Union[ErrorsList, RetrospectiveConfigurationResponse]]: + include: Unset | GetRetrospectiveConfigurationInclude = UNSET, +) -> ErrorsList | RetrospectiveConfigurationResponse | None: """Retrieves a Retrospective Configuration Retrieves a specific retrospective_configuration by id @@ -134,8 +134,8 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, - include: Union[Unset, GetRetrospectiveConfigurationInclude] = UNSET, -) -> Response[Union[ErrorsList, RetrospectiveConfigurationResponse]]: + include: Unset | GetRetrospectiveConfigurationInclude = UNSET, +) -> Response[ErrorsList | RetrospectiveConfigurationResponse]: """Retrieves a Retrospective Configuration Retrieves a specific retrospective_configuration by id @@ -166,8 +166,8 @@ async def asyncio( id: str, *, client: AuthenticatedClient, - include: Union[Unset, GetRetrospectiveConfigurationInclude] = UNSET, -) -> Optional[Union[ErrorsList, RetrospectiveConfigurationResponse]]: + include: Unset | GetRetrospectiveConfigurationInclude = UNSET, +) -> ErrorsList | RetrospectiveConfigurationResponse | None: """Retrieves a Retrospective Configuration Retrieves a specific retrospective_configuration by id diff --git a/rootly_sdk/api/retrospective_configurations/list_retrospective_configurations.py b/rootly_sdk/api/retrospective_configurations/list_retrospective_configurations.py index fccc98da..219d509d 100644 --- a/rootly_sdk/api/retrospective_configurations/list_retrospective_configurations.py +++ b/rootly_sdk/api/retrospective_configurations/list_retrospective_configurations.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -14,14 +14,14 @@ def _get_kwargs( *, - include: Union[Unset, ListRetrospectiveConfigurationsInclude] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterkind: Union[Unset, str] = UNSET, + include: Unset | ListRetrospectiveConfigurationsInclude = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterkind: Unset | str = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} - json_include: Union[Unset, str] = UNSET + json_include: Unset | str = UNSET if not isinstance(include, Unset): json_include = include @@ -45,8 +45,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[RetrospectiveConfigurationList]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> RetrospectiveConfigurationList | None: if response.status_code == 200: response_200 = RetrospectiveConfigurationList.from_dict(response.json()) @@ -59,7 +59,7 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response + *, client: AuthenticatedClient | Client, response: httpx.Response ) -> Response[RetrospectiveConfigurationList]: return Response( status_code=HTTPStatus(response.status_code), @@ -72,10 +72,10 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - include: Union[Unset, ListRetrospectiveConfigurationsInclude] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterkind: Union[Unset, str] = UNSET, + include: Unset | ListRetrospectiveConfigurationsInclude = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterkind: Unset | str = UNSET, ) -> Response[RetrospectiveConfigurationList]: """List retrospective configurations @@ -112,11 +112,11 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: Union[Unset, ListRetrospectiveConfigurationsInclude] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterkind: Union[Unset, str] = UNSET, -) -> Optional[RetrospectiveConfigurationList]: + include: Unset | ListRetrospectiveConfigurationsInclude = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterkind: Unset | str = UNSET, +) -> RetrospectiveConfigurationList | None: """List retrospective configurations List retrospective configurations @@ -147,10 +147,10 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: Union[Unset, ListRetrospectiveConfigurationsInclude] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterkind: Union[Unset, str] = UNSET, + include: Unset | ListRetrospectiveConfigurationsInclude = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterkind: Unset | str = UNSET, ) -> Response[RetrospectiveConfigurationList]: """List retrospective configurations @@ -185,11 +185,11 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: Union[Unset, ListRetrospectiveConfigurationsInclude] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterkind: Union[Unset, str] = UNSET, -) -> Optional[RetrospectiveConfigurationList]: + include: Unset | ListRetrospectiveConfigurationsInclude = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterkind: Unset | str = UNSET, +) -> RetrospectiveConfigurationList | None: """List retrospective configurations List retrospective configurations diff --git a/rootly_sdk/api/retrospective_configurations/update_retrospective_configuration.py b/rootly_sdk/api/retrospective_configurations/update_retrospective_configuration.py index 15f4eb22..0947dc5e 100644 --- a/rootly_sdk/api/retrospective_configurations/update_retrospective_configuration.py +++ b/rootly_sdk/api/retrospective_configurations/update_retrospective_configuration.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, RetrospectiveConfigurationResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | RetrospectiveConfigurationResponse | None: if response.status_code == 200: response_200 = RetrospectiveConfigurationResponse.from_dict(response.json()) @@ -51,8 +51,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, RetrospectiveConfigurationResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | RetrospectiveConfigurationResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateRetrospectiveConfiguration, -) -> Response[Union[ErrorsList, RetrospectiveConfigurationResponse]]: +) -> Response[ErrorsList | RetrospectiveConfigurationResponse]: """Update a retrospective configuration Update a specific retrospective configuration by id @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateRetrospectiveConfiguration, -) -> Optional[Union[ErrorsList, RetrospectiveConfigurationResponse]]: +) -> ErrorsList | RetrospectiveConfigurationResponse | None: """Update a retrospective configuration Update a specific retrospective configuration by id @@ -129,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateRetrospectiveConfiguration, -) -> Response[Union[ErrorsList, RetrospectiveConfigurationResponse]]: +) -> Response[ErrorsList | RetrospectiveConfigurationResponse]: """Update a retrospective configuration Update a specific retrospective configuration by id @@ -161,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateRetrospectiveConfiguration, -) -> Optional[Union[ErrorsList, RetrospectiveConfigurationResponse]]: +) -> ErrorsList | RetrospectiveConfigurationResponse | None: """Update a retrospective configuration Update a specific retrospective configuration by id diff --git a/rootly_sdk/api/retrospective_process_group_steps/create_retrospective_process_group_step.py b/rootly_sdk/api/retrospective_process_group_steps/create_retrospective_process_group_step.py index c901772c..fc44bf43 100644 --- a/rootly_sdk/api/retrospective_process_group_steps/create_retrospective_process_group_step.py +++ b/rootly_sdk/api/retrospective_process_group_steps/create_retrospective_process_group_step.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, RetrospectiveProcessGroupStepResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | RetrospectiveProcessGroupStepResponse | None: if response.status_code == 201: response_201 = RetrospectiveProcessGroupStepResponse.from_dict(response.json()) @@ -51,8 +51,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, RetrospectiveProcessGroupStepResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | RetrospectiveProcessGroupStepResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewRetrospectiveProcessGroupStep, -) -> Response[Union[ErrorsList, RetrospectiveProcessGroupStepResponse]]: +) -> Response[ErrorsList | RetrospectiveProcessGroupStepResponse]: """Creates a retrospective process group step Creates a new retrospective process group step from provided data @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: NewRetrospectiveProcessGroupStep, -) -> Optional[Union[ErrorsList, RetrospectiveProcessGroupStepResponse]]: +) -> ErrorsList | RetrospectiveProcessGroupStepResponse | None: """Creates a retrospective process group step Creates a new retrospective process group step from provided data @@ -129,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewRetrospectiveProcessGroupStep, -) -> Response[Union[ErrorsList, RetrospectiveProcessGroupStepResponse]]: +) -> Response[ErrorsList | RetrospectiveProcessGroupStepResponse]: """Creates a retrospective process group step Creates a new retrospective process group step from provided data @@ -161,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewRetrospectiveProcessGroupStep, -) -> Optional[Union[ErrorsList, RetrospectiveProcessGroupStepResponse]]: +) -> ErrorsList | RetrospectiveProcessGroupStepResponse | None: """Creates a retrospective process group step Creates a new retrospective process group step from provided data diff --git a/rootly_sdk/api/retrospective_process_group_steps/delete_retrospective_process_group_step.py b/rootly_sdk/api/retrospective_process_group_steps/delete_retrospective_process_group_step.py index 3b314bcf..f3a4c85f 100644 --- a/rootly_sdk/api/retrospective_process_group_steps/delete_retrospective_process_group_step.py +++ b/rootly_sdk/api/retrospective_process_group_steps/delete_retrospective_process_group_step.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, RetrospectiveProcessGroupStepResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | RetrospectiveProcessGroupStepResponse | None: if response.status_code == 200: response_200 = RetrospectiveProcessGroupStepResponse.from_dict(response.json()) @@ -41,8 +41,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, RetrospectiveProcessGroupStepResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | RetrospectiveProcessGroupStepResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -55,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, RetrospectiveProcessGroupStepResponse]]: +) -> Response[ErrorsList | RetrospectiveProcessGroupStepResponse]: """Delete a RetrospectiveProcessGroup Step Delete a specific RetrospectiveProcessGroup Step by id @@ -86,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, RetrospectiveProcessGroupStepResponse]]: +) -> ErrorsList | RetrospectiveProcessGroupStepResponse | None: """Delete a RetrospectiveProcessGroup Step Delete a specific RetrospectiveProcessGroup Step by id @@ -112,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, RetrospectiveProcessGroupStepResponse]]: +) -> Response[ErrorsList | RetrospectiveProcessGroupStepResponse]: """Delete a RetrospectiveProcessGroup Step Delete a specific RetrospectiveProcessGroup Step by id @@ -141,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, RetrospectiveProcessGroupStepResponse]]: +) -> ErrorsList | RetrospectiveProcessGroupStepResponse | None: """Delete a RetrospectiveProcessGroup Step Delete a specific RetrospectiveProcessGroup Step by id diff --git a/rootly_sdk/api/retrospective_process_group_steps/get_retrospective_process_group_step.py b/rootly_sdk/api/retrospective_process_group_steps/get_retrospective_process_group_step.py index b4a17ddc..769b164e 100644 --- a/rootly_sdk/api/retrospective_process_group_steps/get_retrospective_process_group_step.py +++ b/rootly_sdk/api/retrospective_process_group_steps/get_retrospective_process_group_step.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -21,8 +21,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[RetrospectiveProcessGroupStepResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> RetrospectiveProcessGroupStepResponse | None: if response.status_code == 200: response_200 = RetrospectiveProcessGroupStepResponse.from_dict(response.json()) @@ -35,7 +35,7 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response + *, client: AuthenticatedClient | Client, response: httpx.Response ) -> Response[RetrospectiveProcessGroupStepResponse]: return Response( status_code=HTTPStatus(response.status_code), @@ -80,7 +80,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[RetrospectiveProcessGroupStepResponse]: +) -> RetrospectiveProcessGroupStepResponse | None: """Retrieves a RetrospectiveProcessGroup Step Retrieves a specific RetrospectiveProcessGroup Step by id @@ -135,7 +135,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[RetrospectiveProcessGroupStepResponse]: +) -> RetrospectiveProcessGroupStepResponse | None: """Retrieves a RetrospectiveProcessGroup Step Retrieves a specific RetrospectiveProcessGroup Step by id diff --git a/rootly_sdk/api/retrospective_process_group_steps/list_retrospective_process_group_steps.py b/rootly_sdk/api/retrospective_process_group_steps/list_retrospective_process_group_steps.py index a0213bb5..2c7ec67e 100644 --- a/rootly_sdk/api/retrospective_process_group_steps/list_retrospective_process_group_steps.py +++ b/rootly_sdk/api/retrospective_process_group_steps/list_retrospective_process_group_steps.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -12,14 +12,14 @@ def _get_kwargs( retrospective_process_group_id: str, *, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterretrospective_step_id: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterretrospective_step_id: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -51,8 +51,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[RetrospectiveProcessGroupStepList]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> RetrospectiveProcessGroupStepList | None: if response.status_code == 200: response_200 = RetrospectiveProcessGroupStepList.from_dict(response.json()) @@ -65,7 +65,7 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response + *, client: AuthenticatedClient | Client, response: httpx.Response ) -> Response[RetrospectiveProcessGroupStepList]: return Response( status_code=HTTPStatus(response.status_code), @@ -79,14 +79,14 @@ def sync_detailed( retrospective_process_group_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterretrospective_step_id: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterretrospective_step_id: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> Response[RetrospectiveProcessGroupStepList]: """List RetrospectiveProcessGroup Steps @@ -134,15 +134,15 @@ def sync( retrospective_process_group_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterretrospective_step_id: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, -) -> Optional[RetrospectiveProcessGroupStepList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterretrospective_step_id: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, +) -> RetrospectiveProcessGroupStepList | None: """List RetrospectiveProcessGroup Steps List RetrospectiveProcessGroup Steps @@ -184,14 +184,14 @@ async def asyncio_detailed( retrospective_process_group_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterretrospective_step_id: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterretrospective_step_id: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> Response[RetrospectiveProcessGroupStepList]: """List RetrospectiveProcessGroup Steps @@ -237,15 +237,15 @@ async def asyncio( retrospective_process_group_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterretrospective_step_id: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, -) -> Optional[RetrospectiveProcessGroupStepList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterretrospective_step_id: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, +) -> RetrospectiveProcessGroupStepList | None: """List RetrospectiveProcessGroup Steps List RetrospectiveProcessGroup Steps diff --git a/rootly_sdk/api/retrospective_process_group_steps/update_retrospective_process_group_step.py b/rootly_sdk/api/retrospective_process_group_steps/update_retrospective_process_group_step.py index c362ddd6..db601b68 100644 --- a/rootly_sdk/api/retrospective_process_group_steps/update_retrospective_process_group_step.py +++ b/rootly_sdk/api/retrospective_process_group_steps/update_retrospective_process_group_step.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[RetrospectiveProcessGroupStepResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> RetrospectiveProcessGroupStepResponse | None: if response.status_code == 200: response_200 = RetrospectiveProcessGroupStepResponse.from_dict(response.json()) @@ -45,7 +45,7 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response + *, client: AuthenticatedClient | Client, response: httpx.Response ) -> Response[RetrospectiveProcessGroupStepResponse]: return Response( status_code=HTTPStatus(response.status_code), @@ -94,7 +94,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateRetrospectiveProcessGroupStep, -) -> Optional[RetrospectiveProcessGroupStepResponse]: +) -> RetrospectiveProcessGroupStepResponse | None: """Update RetrospectiveProcessGroup Step Update a specific RetrospectiveProcessGroup Step by id @@ -155,7 +155,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateRetrospectiveProcessGroupStep, -) -> Optional[RetrospectiveProcessGroupStepResponse]: +) -> RetrospectiveProcessGroupStepResponse | None: """Update RetrospectiveProcessGroup Step Update a specific RetrospectiveProcessGroup Step by id diff --git a/rootly_sdk/api/retrospective_process_groups/create_retrospective_process_group.py b/rootly_sdk/api/retrospective_process_groups/create_retrospective_process_group.py index 7fe70e89..b2593167 100644 --- a/rootly_sdk/api/retrospective_process_groups/create_retrospective_process_group.py +++ b/rootly_sdk/api/retrospective_process_groups/create_retrospective_process_group.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, RetrospectiveProcessGroupResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | RetrospectiveProcessGroupResponse | None: if response.status_code == 201: response_201 = RetrospectiveProcessGroupResponse.from_dict(response.json()) @@ -51,8 +51,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, RetrospectiveProcessGroupResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | RetrospectiveProcessGroupResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewRetrospectiveProcessGroup, -) -> Response[Union[ErrorsList, RetrospectiveProcessGroupResponse]]: +) -> Response[ErrorsList | RetrospectiveProcessGroupResponse]: """Creates a retrospective process group Creates a new retrospective process group from provided data @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: NewRetrospectiveProcessGroup, -) -> Optional[Union[ErrorsList, RetrospectiveProcessGroupResponse]]: +) -> ErrorsList | RetrospectiveProcessGroupResponse | None: """Creates a retrospective process group Creates a new retrospective process group from provided data @@ -129,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewRetrospectiveProcessGroup, -) -> Response[Union[ErrorsList, RetrospectiveProcessGroupResponse]]: +) -> Response[ErrorsList | RetrospectiveProcessGroupResponse]: """Creates a retrospective process group Creates a new retrospective process group from provided data @@ -161,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewRetrospectiveProcessGroup, -) -> Optional[Union[ErrorsList, RetrospectiveProcessGroupResponse]]: +) -> ErrorsList | RetrospectiveProcessGroupResponse | None: """Creates a retrospective process group Creates a new retrospective process group from provided data diff --git a/rootly_sdk/api/retrospective_process_groups/delete_retrospective_process_group.py b/rootly_sdk/api/retrospective_process_groups/delete_retrospective_process_group.py index 62377dde..e5af35fc 100644 --- a/rootly_sdk/api/retrospective_process_groups/delete_retrospective_process_group.py +++ b/rootly_sdk/api/retrospective_process_groups/delete_retrospective_process_group.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, RetrospectiveProcessGroupResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | RetrospectiveProcessGroupResponse | None: if response.status_code == 200: response_200 = RetrospectiveProcessGroupResponse.from_dict(response.json()) @@ -41,8 +41,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, RetrospectiveProcessGroupResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | RetrospectiveProcessGroupResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -55,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, RetrospectiveProcessGroupResponse]]: +) -> Response[ErrorsList | RetrospectiveProcessGroupResponse]: """Delete a Retrospective Process Group Delete a specific Retrospective Process Group by id @@ -86,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, RetrospectiveProcessGroupResponse]]: +) -> ErrorsList | RetrospectiveProcessGroupResponse | None: """Delete a Retrospective Process Group Delete a specific Retrospective Process Group by id @@ -112,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, RetrospectiveProcessGroupResponse]]: +) -> Response[ErrorsList | RetrospectiveProcessGroupResponse]: """Delete a Retrospective Process Group Delete a specific Retrospective Process Group by id @@ -141,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, RetrospectiveProcessGroupResponse]]: +) -> ErrorsList | RetrospectiveProcessGroupResponse | None: """Delete a Retrospective Process Group Delete a specific Retrospective Process Group by id diff --git a/rootly_sdk/api/retrospective_process_groups/get_retrospective_process_group.py b/rootly_sdk/api/retrospective_process_groups/get_retrospective_process_group.py index 650413ad..02bd0f1b 100644 --- a/rootly_sdk/api/retrospective_process_groups/get_retrospective_process_group.py +++ b/rootly_sdk/api/retrospective_process_groups/get_retrospective_process_group.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -15,11 +15,11 @@ def _get_kwargs( id: str, *, - include: Union[Unset, GetRetrospectiveProcessGroupInclude] = UNSET, + include: Unset | GetRetrospectiveProcessGroupInclude = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} - json_include: Union[Unset, str] = UNSET + json_include: Unset | str = UNSET if not isinstance(include, Unset): json_include = include @@ -37,8 +37,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[RetrospectiveProcessGroupResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> RetrospectiveProcessGroupResponse | None: if response.status_code == 200: response_200 = RetrospectiveProcessGroupResponse.from_dict(response.json()) @@ -51,7 +51,7 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response + *, client: AuthenticatedClient | Client, response: httpx.Response ) -> Response[RetrospectiveProcessGroupResponse]: return Response( status_code=HTTPStatus(response.status_code), @@ -65,7 +65,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, - include: Union[Unset, GetRetrospectiveProcessGroupInclude] = UNSET, + include: Unset | GetRetrospectiveProcessGroupInclude = UNSET, ) -> Response[RetrospectiveProcessGroupResponse]: """Retrieves a Retrospective Process Group @@ -99,8 +99,8 @@ def sync( id: str, *, client: AuthenticatedClient, - include: Union[Unset, GetRetrospectiveProcessGroupInclude] = UNSET, -) -> Optional[RetrospectiveProcessGroupResponse]: + include: Unset | GetRetrospectiveProcessGroupInclude = UNSET, +) -> RetrospectiveProcessGroupResponse | None: """Retrieves a Retrospective Process Group Retrieves a specific Retrospective Process Group by id @@ -128,7 +128,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, - include: Union[Unset, GetRetrospectiveProcessGroupInclude] = UNSET, + include: Unset | GetRetrospectiveProcessGroupInclude = UNSET, ) -> Response[RetrospectiveProcessGroupResponse]: """Retrieves a Retrospective Process Group @@ -160,8 +160,8 @@ async def asyncio( id: str, *, client: AuthenticatedClient, - include: Union[Unset, GetRetrospectiveProcessGroupInclude] = UNSET, -) -> Optional[RetrospectiveProcessGroupResponse]: + include: Unset | GetRetrospectiveProcessGroupInclude = UNSET, +) -> RetrospectiveProcessGroupResponse | None: """Retrieves a Retrospective Process Group Retrieves a specific Retrospective Process Group by id diff --git a/rootly_sdk/api/retrospective_process_groups/list_retrospective_process_groups.py b/rootly_sdk/api/retrospective_process_groups/list_retrospective_process_groups.py index f8475227..364e8a03 100644 --- a/rootly_sdk/api/retrospective_process_groups/list_retrospective_process_groups.py +++ b/rootly_sdk/api/retrospective_process_groups/list_retrospective_process_groups.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -18,25 +18,25 @@ def _get_kwargs( retrospective_process_id: str, *, - include: Union[Unset, ListRetrospectiveProcessGroupsInclude] = UNSET, - sort: Union[Unset, ListRetrospectiveProcessGroupsSort] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersub_status_id: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, + include: Unset | ListRetrospectiveProcessGroupsInclude = UNSET, + sort: Unset | ListRetrospectiveProcessGroupsSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersub_status_id: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} - json_include: Union[Unset, str] = UNSET + json_include: Unset | str = UNSET if not isinstance(include, Unset): json_include = include params["include"] = json_include - json_sort: Union[Unset, str] = UNSET + json_sort: Unset | str = UNSET if not isinstance(sort, Unset): json_sort = sort @@ -68,8 +68,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[RetrospectiveProcessGroupList]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> RetrospectiveProcessGroupList | None: if response.status_code == 200: response_200 = RetrospectiveProcessGroupList.from_dict(response.json()) @@ -82,7 +82,7 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response + *, client: AuthenticatedClient | Client, response: httpx.Response ) -> Response[RetrospectiveProcessGroupList]: return Response( status_code=HTTPStatus(response.status_code), @@ -96,15 +96,15 @@ def sync_detailed( retrospective_process_id: str, *, client: AuthenticatedClient, - include: Union[Unset, ListRetrospectiveProcessGroupsInclude] = UNSET, - sort: Union[Unset, ListRetrospectiveProcessGroupsSort] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersub_status_id: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, + include: Unset | ListRetrospectiveProcessGroupsInclude = UNSET, + sort: Unset | ListRetrospectiveProcessGroupsSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersub_status_id: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> Response[RetrospectiveProcessGroupList]: """List Retrospective Process Groups @@ -154,16 +154,16 @@ def sync( retrospective_process_id: str, *, client: AuthenticatedClient, - include: Union[Unset, ListRetrospectiveProcessGroupsInclude] = UNSET, - sort: Union[Unset, ListRetrospectiveProcessGroupsSort] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersub_status_id: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, -) -> Optional[RetrospectiveProcessGroupList]: + include: Unset | ListRetrospectiveProcessGroupsInclude = UNSET, + sort: Unset | ListRetrospectiveProcessGroupsSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersub_status_id: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, +) -> RetrospectiveProcessGroupList | None: """List Retrospective Process Groups List Retrospective Process Groups @@ -207,15 +207,15 @@ async def asyncio_detailed( retrospective_process_id: str, *, client: AuthenticatedClient, - include: Union[Unset, ListRetrospectiveProcessGroupsInclude] = UNSET, - sort: Union[Unset, ListRetrospectiveProcessGroupsSort] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersub_status_id: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, + include: Unset | ListRetrospectiveProcessGroupsInclude = UNSET, + sort: Unset | ListRetrospectiveProcessGroupsSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersub_status_id: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> Response[RetrospectiveProcessGroupList]: """List Retrospective Process Groups @@ -263,16 +263,16 @@ async def asyncio( retrospective_process_id: str, *, client: AuthenticatedClient, - include: Union[Unset, ListRetrospectiveProcessGroupsInclude] = UNSET, - sort: Union[Unset, ListRetrospectiveProcessGroupsSort] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersub_status_id: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, -) -> Optional[RetrospectiveProcessGroupList]: + include: Unset | ListRetrospectiveProcessGroupsInclude = UNSET, + sort: Unset | ListRetrospectiveProcessGroupsSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersub_status_id: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, +) -> RetrospectiveProcessGroupList | None: """List Retrospective Process Groups List Retrospective Process Groups diff --git a/rootly_sdk/api/retrospective_process_groups/update_retrospective_process_group.py b/rootly_sdk/api/retrospective_process_groups/update_retrospective_process_group.py index 9a311992..0960115f 100644 --- a/rootly_sdk/api/retrospective_process_groups/update_retrospective_process_group.py +++ b/rootly_sdk/api/retrospective_process_groups/update_retrospective_process_group.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[RetrospectiveProcessGroupResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> RetrospectiveProcessGroupResponse | None: if response.status_code == 200: response_200 = RetrospectiveProcessGroupResponse.from_dict(response.json()) @@ -45,7 +45,7 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response + *, client: AuthenticatedClient | Client, response: httpx.Response ) -> Response[RetrospectiveProcessGroupResponse]: return Response( status_code=HTTPStatus(response.status_code), @@ -94,7 +94,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateRetrospectiveProcessGroup, -) -> Optional[RetrospectiveProcessGroupResponse]: +) -> RetrospectiveProcessGroupResponse | None: """Update a Retrospective Process Group Update a specific Retrospective Process Group by id @@ -155,7 +155,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateRetrospectiveProcessGroup, -) -> Optional[RetrospectiveProcessGroupResponse]: +) -> RetrospectiveProcessGroupResponse | None: """Update a Retrospective Process Group Update a specific Retrospective Process Group by id diff --git a/rootly_sdk/api/retrospective_processes/create_retrospective_process.py b/rootly_sdk/api/retrospective_processes/create_retrospective_process.py index d7eb7c9d..80fdaa15 100644 --- a/rootly_sdk/api/retrospective_processes/create_retrospective_process.py +++ b/rootly_sdk/api/retrospective_processes/create_retrospective_process.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, RetrospectiveProcessResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | RetrospectiveProcessResponse | None: if response.status_code == 201: response_201 = RetrospectiveProcessResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, RetrospectiveProcessResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | RetrospectiveProcessResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +69,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewRetrospectiveProcess, -) -> Response[Union[ErrorsList, RetrospectiveProcessResponse]]: +) -> Response[ErrorsList | RetrospectiveProcessResponse]: """Creates a retrospective process Creates a new retrospective process from provided data @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: NewRetrospectiveProcess, -) -> Optional[Union[ErrorsList, RetrospectiveProcessResponse]]: +) -> ErrorsList | RetrospectiveProcessResponse | None: """Creates a retrospective process Creates a new retrospective process from provided data @@ -126,7 +126,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewRetrospectiveProcess, -) -> Response[Union[ErrorsList, RetrospectiveProcessResponse]]: +) -> Response[ErrorsList | RetrospectiveProcessResponse]: """Creates a retrospective process Creates a new retrospective process from provided data @@ -155,7 +155,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewRetrospectiveProcess, -) -> Optional[Union[ErrorsList, RetrospectiveProcessResponse]]: +) -> ErrorsList | RetrospectiveProcessResponse | None: """Creates a retrospective process Creates a new retrospective process from provided data diff --git a/rootly_sdk/api/retrospective_processes/delete_retrospective_process.py b/rootly_sdk/api/retrospective_processes/delete_retrospective_process.py index 012851be..8c3808e0 100644 --- a/rootly_sdk/api/retrospective_processes/delete_retrospective_process.py +++ b/rootly_sdk/api/retrospective_processes/delete_retrospective_process.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, RetrospectiveProcessResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | RetrospectiveProcessResponse | None: if response.status_code == 200: response_200 = RetrospectiveProcessResponse.from_dict(response.json()) @@ -41,8 +41,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, RetrospectiveProcessResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | RetrospectiveProcessResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -55,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, RetrospectiveProcessResponse]]: +) -> Response[ErrorsList | RetrospectiveProcessResponse]: """Delete a retrospective process Delete a specific retrospective process by id @@ -86,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, RetrospectiveProcessResponse]]: +) -> ErrorsList | RetrospectiveProcessResponse | None: """Delete a retrospective process Delete a specific retrospective process by id @@ -112,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, RetrospectiveProcessResponse]]: +) -> Response[ErrorsList | RetrospectiveProcessResponse]: """Delete a retrospective process Delete a specific retrospective process by id @@ -141,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, RetrospectiveProcessResponse]]: +) -> ErrorsList | RetrospectiveProcessResponse | None: """Delete a retrospective process Delete a specific retrospective process by id diff --git a/rootly_sdk/api/retrospective_processes/get_retrospective_process.py b/rootly_sdk/api/retrospective_processes/get_retrospective_process.py index e0b2b766..f86ca3de 100644 --- a/rootly_sdk/api/retrospective_processes/get_retrospective_process.py +++ b/rootly_sdk/api/retrospective_processes/get_retrospective_process.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -16,11 +16,11 @@ def _get_kwargs( id: str, *, - include: Union[Unset, GetRetrospectiveProcessInclude] = UNSET, + include: Unset | GetRetrospectiveProcessInclude = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} - json_include: Union[Unset, str] = UNSET + json_include: Unset | str = UNSET if not isinstance(include, Unset): json_include = include @@ -38,8 +38,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, RetrospectiveProcessResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | RetrospectiveProcessResponse | None: if response.status_code == 200: response_200 = RetrospectiveProcessResponse.from_dict(response.json()) @@ -57,8 +57,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, RetrospectiveProcessResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | RetrospectiveProcessResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -71,8 +71,8 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, - include: Union[Unset, GetRetrospectiveProcessInclude] = UNSET, -) -> Response[Union[ErrorsList, RetrospectiveProcessResponse]]: + include: Unset | GetRetrospectiveProcessInclude = UNSET, +) -> Response[ErrorsList | RetrospectiveProcessResponse]: """Retrieves a retrospective process Retrieves a specific retrospective process by id @@ -105,8 +105,8 @@ def sync( id: str, *, client: AuthenticatedClient, - include: Union[Unset, GetRetrospectiveProcessInclude] = UNSET, -) -> Optional[Union[ErrorsList, RetrospectiveProcessResponse]]: + include: Unset | GetRetrospectiveProcessInclude = UNSET, +) -> ErrorsList | RetrospectiveProcessResponse | None: """Retrieves a retrospective process Retrieves a specific retrospective process by id @@ -134,8 +134,8 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, - include: Union[Unset, GetRetrospectiveProcessInclude] = UNSET, -) -> Response[Union[ErrorsList, RetrospectiveProcessResponse]]: + include: Unset | GetRetrospectiveProcessInclude = UNSET, +) -> Response[ErrorsList | RetrospectiveProcessResponse]: """Retrieves a retrospective process Retrieves a specific retrospective process by id @@ -166,8 +166,8 @@ async def asyncio( id: str, *, client: AuthenticatedClient, - include: Union[Unset, GetRetrospectiveProcessInclude] = UNSET, -) -> Optional[Union[ErrorsList, RetrospectiveProcessResponse]]: + include: Unset | GetRetrospectiveProcessInclude = UNSET, +) -> ErrorsList | RetrospectiveProcessResponse | None: """Retrieves a retrospective process Retrieves a specific retrospective process by id diff --git a/rootly_sdk/api/retrospective_processes/list_retrospective_processes.py b/rootly_sdk/api/retrospective_processes/list_retrospective_processes.py index 55c638e7..b2fbd7b2 100644 --- a/rootly_sdk/api/retrospective_processes/list_retrospective_processes.py +++ b/rootly_sdk/api/retrospective_processes/list_retrospective_processes.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -14,13 +14,13 @@ def _get_kwargs( *, - include: Union[Unset, ListRetrospectiveProcessesInclude] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + include: Unset | ListRetrospectiveProcessesInclude = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} - json_include: Union[Unset, str] = UNSET + json_include: Unset | str = UNSET if not isinstance(include, Unset): json_include = include @@ -42,8 +42,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[RetrospectiveProcessList]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> RetrospectiveProcessList | None: if response.status_code == 200: response_200 = RetrospectiveProcessList.from_dict(response.json()) @@ -56,7 +56,7 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response + *, client: AuthenticatedClient | Client, response: httpx.Response ) -> Response[RetrospectiveProcessList]: return Response( status_code=HTTPStatus(response.status_code), @@ -69,9 +69,9 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - include: Union[Unset, ListRetrospectiveProcessesInclude] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + include: Unset | ListRetrospectiveProcessesInclude = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[RetrospectiveProcessList]: """List retrospective processes @@ -106,10 +106,10 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: Union[Unset, ListRetrospectiveProcessesInclude] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, -) -> Optional[RetrospectiveProcessList]: + include: Unset | ListRetrospectiveProcessesInclude = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, +) -> RetrospectiveProcessList | None: """List retrospective processes List retrospective processes @@ -138,9 +138,9 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: Union[Unset, ListRetrospectiveProcessesInclude] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + include: Unset | ListRetrospectiveProcessesInclude = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[RetrospectiveProcessList]: """List retrospective processes @@ -173,10 +173,10 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: Union[Unset, ListRetrospectiveProcessesInclude] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, -) -> Optional[RetrospectiveProcessList]: + include: Unset | ListRetrospectiveProcessesInclude = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, +) -> RetrospectiveProcessList | None: """List retrospective processes List retrospective processes diff --git a/rootly_sdk/api/retrospective_processes/update_retrospective_process.py b/rootly_sdk/api/retrospective_processes/update_retrospective_process.py index 01d66581..8afeb077 100644 --- a/rootly_sdk/api/retrospective_processes/update_retrospective_process.py +++ b/rootly_sdk/api/retrospective_processes/update_retrospective_process.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, RetrospectiveProcessResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | RetrospectiveProcessResponse | None: if response.status_code == 200: response_200 = RetrospectiveProcessResponse.from_dict(response.json()) @@ -51,8 +51,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, RetrospectiveProcessResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | RetrospectiveProcessResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateRetrospectiveProcess, -) -> Response[Union[ErrorsList, RetrospectiveProcessResponse]]: +) -> Response[ErrorsList | RetrospectiveProcessResponse]: """Update a retrospective process Updates a specific retrospective process by id @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateRetrospectiveProcess, -) -> Optional[Union[ErrorsList, RetrospectiveProcessResponse]]: +) -> ErrorsList | RetrospectiveProcessResponse | None: """Update a retrospective process Updates a specific retrospective process by id @@ -129,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateRetrospectiveProcess, -) -> Response[Union[ErrorsList, RetrospectiveProcessResponse]]: +) -> Response[ErrorsList | RetrospectiveProcessResponse]: """Update a retrospective process Updates a specific retrospective process by id @@ -161,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateRetrospectiveProcess, -) -> Optional[Union[ErrorsList, RetrospectiveProcessResponse]]: +) -> ErrorsList | RetrospectiveProcessResponse | None: """Update a retrospective process Updates a specific retrospective process by id diff --git a/rootly_sdk/api/retrospective_steps/create_retrospective_step.py b/rootly_sdk/api/retrospective_steps/create_retrospective_step.py index ee7406f8..8c370ff6 100644 --- a/rootly_sdk/api/retrospective_steps/create_retrospective_step.py +++ b/rootly_sdk/api/retrospective_steps/create_retrospective_step.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, RetrospectiveStepResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | RetrospectiveStepResponse | None: if response.status_code == 201: response_201 = RetrospectiveStepResponse.from_dict(response.json()) @@ -56,8 +56,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, RetrospectiveStepResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | RetrospectiveStepResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -71,7 +71,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewRetrospectiveStep, -) -> Response[Union[ErrorsList, RetrospectiveStepResponse]]: +) -> Response[ErrorsList | RetrospectiveStepResponse]: """Creates a retrospective step Creates a new retrospective step from provided data @@ -105,7 +105,7 @@ def sync( *, client: AuthenticatedClient, body: NewRetrospectiveStep, -) -> Optional[Union[ErrorsList, RetrospectiveStepResponse]]: +) -> ErrorsList | RetrospectiveStepResponse | None: """Creates a retrospective step Creates a new retrospective step from provided data @@ -134,7 +134,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewRetrospectiveStep, -) -> Response[Union[ErrorsList, RetrospectiveStepResponse]]: +) -> Response[ErrorsList | RetrospectiveStepResponse]: """Creates a retrospective step Creates a new retrospective step from provided data @@ -166,7 +166,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewRetrospectiveStep, -) -> Optional[Union[ErrorsList, RetrospectiveStepResponse]]: +) -> ErrorsList | RetrospectiveStepResponse | None: """Creates a retrospective step Creates a new retrospective step from provided data diff --git a/rootly_sdk/api/retrospective_steps/delete_retrospective_step.py b/rootly_sdk/api/retrospective_steps/delete_retrospective_step.py index 2f8e11ca..5988c137 100644 --- a/rootly_sdk/api/retrospective_steps/delete_retrospective_step.py +++ b/rootly_sdk/api/retrospective_steps/delete_retrospective_step.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, RetrospectiveStepResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | RetrospectiveStepResponse | None: if response.status_code == 200: response_200 = RetrospectiveStepResponse.from_dict(response.json()) @@ -41,8 +41,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, RetrospectiveStepResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | RetrospectiveStepResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -55,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, RetrospectiveStepResponse]]: +) -> Response[ErrorsList | RetrospectiveStepResponse]: """Delete a retrospective step Delete a specific retrospective step by id @@ -86,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, RetrospectiveStepResponse]]: +) -> ErrorsList | RetrospectiveStepResponse | None: """Delete a retrospective step Delete a specific retrospective step by id @@ -112,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, RetrospectiveStepResponse]]: +) -> Response[ErrorsList | RetrospectiveStepResponse]: """Delete a retrospective step Delete a specific retrospective step by id @@ -141,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, RetrospectiveStepResponse]]: +) -> ErrorsList | RetrospectiveStepResponse | None: """Delete a retrospective step Delete a specific retrospective step by id diff --git a/rootly_sdk/api/retrospective_steps/get_retrospective_step.py b/rootly_sdk/api/retrospective_steps/get_retrospective_step.py index 65b918d7..52b64de5 100644 --- a/rootly_sdk/api/retrospective_steps/get_retrospective_step.py +++ b/rootly_sdk/api/retrospective_steps/get_retrospective_step.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, RetrospectiveStepResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | RetrospectiveStepResponse | None: if response.status_code == 200: response_200 = RetrospectiveStepResponse.from_dict(response.json()) @@ -41,8 +41,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, RetrospectiveStepResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | RetrospectiveStepResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -55,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, RetrospectiveStepResponse]]: +) -> Response[ErrorsList | RetrospectiveStepResponse]: """Retrieves a retrospective step Retrieves a specific retrospective step by id @@ -86,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, RetrospectiveStepResponse]]: +) -> ErrorsList | RetrospectiveStepResponse | None: """Retrieves a retrospective step Retrieves a specific retrospective step by id @@ -112,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, RetrospectiveStepResponse]]: +) -> Response[ErrorsList | RetrospectiveStepResponse]: """Retrieves a retrospective step Retrieves a specific retrospective step by id @@ -141,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, RetrospectiveStepResponse]]: +) -> ErrorsList | RetrospectiveStepResponse | None: """Retrieves a retrospective step Retrieves a specific retrospective step by id diff --git a/rootly_sdk/api/retrospective_steps/list_retrospective_steps.py b/rootly_sdk/api/retrospective_steps/list_retrospective_steps.py index 58772c57..11922444 100644 --- a/rootly_sdk/api/retrospective_steps/list_retrospective_steps.py +++ b/rootly_sdk/api/retrospective_steps/list_retrospective_steps.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -12,10 +12,10 @@ def _get_kwargs( retrospective_process_id: str, *, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - sort: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + sort: Unset | str = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -38,9 +38,7 @@ def _get_kwargs( return _kwargs -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[RetrospectiveStepList]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> RetrospectiveStepList | None: if response.status_code == 200: response_200 = RetrospectiveStepList.from_dict(response.json()) @@ -53,7 +51,7 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response + *, client: AuthenticatedClient | Client, response: httpx.Response ) -> Response[RetrospectiveStepList]: return Response( status_code=HTTPStatus(response.status_code), @@ -67,10 +65,10 @@ def sync_detailed( retrospective_process_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - sort: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + sort: Unset | str = UNSET, ) -> Response[RetrospectiveStepList]: """List retrospective steps @@ -110,11 +108,11 @@ def sync( retrospective_process_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - sort: Union[Unset, str] = UNSET, -) -> Optional[RetrospectiveStepList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + sort: Unset | str = UNSET, +) -> RetrospectiveStepList | None: """List retrospective steps List retrospective steps @@ -148,10 +146,10 @@ async def asyncio_detailed( retrospective_process_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - sort: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + sort: Unset | str = UNSET, ) -> Response[RetrospectiveStepList]: """List retrospective steps @@ -189,11 +187,11 @@ async def asyncio( retrospective_process_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - sort: Union[Unset, str] = UNSET, -) -> Optional[RetrospectiveStepList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + sort: Unset | str = UNSET, +) -> RetrospectiveStepList | None: """List retrospective steps List retrospective steps diff --git a/rootly_sdk/api/retrospective_steps/update_retrospective_step.py b/rootly_sdk/api/retrospective_steps/update_retrospective_step.py index bef07255..553bd75e 100644 --- a/rootly_sdk/api/retrospective_steps/update_retrospective_step.py +++ b/rootly_sdk/api/retrospective_steps/update_retrospective_step.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, RetrospectiveStepResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | RetrospectiveStepResponse | None: if response.status_code == 200: response_200 = RetrospectiveStepResponse.from_dict(response.json()) @@ -51,8 +51,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, RetrospectiveStepResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | RetrospectiveStepResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateRetrospectiveStep, -) -> Response[Union[ErrorsList, RetrospectiveStepResponse]]: +) -> Response[ErrorsList | RetrospectiveStepResponse]: """Update a retrospective step Update a specific retrospective step by id @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateRetrospectiveStep, -) -> Optional[Union[ErrorsList, RetrospectiveStepResponse]]: +) -> ErrorsList | RetrospectiveStepResponse | None: """Update a retrospective step Update a specific retrospective step by id @@ -129,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateRetrospectiveStep, -) -> Response[Union[ErrorsList, RetrospectiveStepResponse]]: +) -> Response[ErrorsList | RetrospectiveStepResponse]: """Update a retrospective step Update a specific retrospective step by id @@ -161,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateRetrospectiveStep, -) -> Optional[Union[ErrorsList, RetrospectiveStepResponse]]: +) -> ErrorsList | RetrospectiveStepResponse | None: """Update a retrospective step Update a specific retrospective step by id diff --git a/rootly_sdk/api/retrospective_templates/create_postmortem_template.py b/rootly_sdk/api/retrospective_templates/create_postmortem_template.py index 943e4b9f..854b6889 100644 --- a/rootly_sdk/api/retrospective_templates/create_postmortem_template.py +++ b/rootly_sdk/api/retrospective_templates/create_postmortem_template.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, PostMortemTemplateResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | PostMortemTemplateResponse | None: if response.status_code == 201: response_201 = PostMortemTemplateResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, PostMortemTemplateResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | PostMortemTemplateResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +69,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewPostMortemTemplate, -) -> Response[Union[ErrorsList, PostMortemTemplateResponse]]: +) -> Response[ErrorsList | PostMortemTemplateResponse]: """Creates a retrospective template Creates a new Retrospective Template from provided data @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: NewPostMortemTemplate, -) -> Optional[Union[ErrorsList, PostMortemTemplateResponse]]: +) -> ErrorsList | PostMortemTemplateResponse | None: """Creates a retrospective template Creates a new Retrospective Template from provided data @@ -126,7 +126,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewPostMortemTemplate, -) -> Response[Union[ErrorsList, PostMortemTemplateResponse]]: +) -> Response[ErrorsList | PostMortemTemplateResponse]: """Creates a retrospective template Creates a new Retrospective Template from provided data @@ -155,7 +155,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewPostMortemTemplate, -) -> Optional[Union[ErrorsList, PostMortemTemplateResponse]]: +) -> ErrorsList | PostMortemTemplateResponse | None: """Creates a retrospective template Creates a new Retrospective Template from provided data diff --git a/rootly_sdk/api/retrospective_templates/delete_postmortem_template.py b/rootly_sdk/api/retrospective_templates/delete_postmortem_template.py index 75e30f7e..b88c5b8d 100644 --- a/rootly_sdk/api/retrospective_templates/delete_postmortem_template.py +++ b/rootly_sdk/api/retrospective_templates/delete_postmortem_template.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any from uuid import UUID import httpx @@ -12,7 +12,7 @@ def _get_kwargs( - id: Union[UUID, str], + id: UUID | str, ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "delete", @@ -23,8 +23,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, PostMortemTemplateResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | PostMortemTemplateResponse | None: if response.status_code == 200: response_200 = PostMortemTemplateResponse.from_dict(response.json()) @@ -42,8 +42,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, PostMortemTemplateResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | PostMortemTemplateResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -53,10 +53,10 @@ def _build_response( def sync_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, PostMortemTemplateResponse]]: +) -> Response[ErrorsList | PostMortemTemplateResponse]: """Delete a Retrospective Template Delete a specific Retrospective Template by id @@ -84,10 +84,10 @@ def sync_detailed( def sync( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, PostMortemTemplateResponse]]: +) -> ErrorsList | PostMortemTemplateResponse | None: """Delete a Retrospective Template Delete a specific Retrospective Template by id @@ -110,10 +110,10 @@ def sync( async def asyncio_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, PostMortemTemplateResponse]]: +) -> Response[ErrorsList | PostMortemTemplateResponse]: """Delete a Retrospective Template Delete a specific Retrospective Template by id @@ -139,10 +139,10 @@ async def asyncio_detailed( async def asyncio( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, PostMortemTemplateResponse]]: +) -> ErrorsList | PostMortemTemplateResponse | None: """Delete a Retrospective Template Delete a specific Retrospective Template by id diff --git a/rootly_sdk/api/retrospective_templates/get_postmortem_template.py b/rootly_sdk/api/retrospective_templates/get_postmortem_template.py index 14b3417b..b4484263 100644 --- a/rootly_sdk/api/retrospective_templates/get_postmortem_template.py +++ b/rootly_sdk/api/retrospective_templates/get_postmortem_template.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any from uuid import UUID import httpx @@ -12,7 +12,7 @@ def _get_kwargs( - id: Union[UUID, str], + id: UUID | str, ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "get", @@ -23,8 +23,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, PostMortemTemplateResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | PostMortemTemplateResponse | None: if response.status_code == 200: response_200 = PostMortemTemplateResponse.from_dict(response.json()) @@ -42,8 +42,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, PostMortemTemplateResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | PostMortemTemplateResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -53,10 +53,10 @@ def _build_response( def sync_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, PostMortemTemplateResponse]]: +) -> Response[ErrorsList | PostMortemTemplateResponse]: """Retrieves a Retrospective Template Retrieves a specific Retrospective Template by id @@ -84,10 +84,10 @@ def sync_detailed( def sync( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, PostMortemTemplateResponse]]: +) -> ErrorsList | PostMortemTemplateResponse | None: """Retrieves a Retrospective Template Retrieves a specific Retrospective Template by id @@ -110,10 +110,10 @@ def sync( async def asyncio_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, PostMortemTemplateResponse]]: +) -> Response[ErrorsList | PostMortemTemplateResponse]: """Retrieves a Retrospective Template Retrieves a specific Retrospective Template by id @@ -139,10 +139,10 @@ async def asyncio_detailed( async def asyncio( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, PostMortemTemplateResponse]]: +) -> ErrorsList | PostMortemTemplateResponse | None: """Retrieves a Retrospective Template Retrieves a specific Retrospective Template by id diff --git a/rootly_sdk/api/retrospective_templates/list_postmortem_templates.py b/rootly_sdk/api/retrospective_templates/list_postmortem_templates.py index 3bb0cf1c..4bd711cb 100644 --- a/rootly_sdk/api/retrospective_templates/list_postmortem_templates.py +++ b/rootly_sdk/api/retrospective_templates/list_postmortem_templates.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -11,9 +11,9 @@ def _get_kwargs( *, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -34,9 +34,7 @@ def _get_kwargs( return _kwargs -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[PostMortemTemplateList]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> PostMortemTemplateList | None: if response.status_code == 200: response_200 = PostMortemTemplateList.from_dict(response.json()) @@ -49,7 +47,7 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response + *, client: AuthenticatedClient | Client, response: httpx.Response ) -> Response[PostMortemTemplateList]: return Response( status_code=HTTPStatus(response.status_code), @@ -62,9 +60,9 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[PostMortemTemplateList]: """List Retrospective Templates @@ -99,10 +97,10 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, -) -> Optional[PostMortemTemplateList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, +) -> PostMortemTemplateList | None: """List Retrospective Templates List Retrospective Templates @@ -131,9 +129,9 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[PostMortemTemplateList]: """List Retrospective Templates @@ -166,10 +164,10 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, -) -> Optional[PostMortemTemplateList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, +) -> PostMortemTemplateList | None: """List Retrospective Templates List Retrospective Templates diff --git a/rootly_sdk/api/retrospective_templates/update_postmortem_template.py b/rootly_sdk/api/retrospective_templates/update_postmortem_template.py index eaad68a3..c3d78abf 100644 --- a/rootly_sdk/api/retrospective_templates/update_postmortem_template.py +++ b/rootly_sdk/api/retrospective_templates/update_postmortem_template.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any from uuid import UUID import httpx @@ -13,7 +13,7 @@ def _get_kwargs( - id: Union[UUID, str], + id: UUID | str, *, body: UpdatePostMortemTemplate, ) -> dict[str, Any]: @@ -33,8 +33,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, PostMortemTemplateResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | PostMortemTemplateResponse | None: if response.status_code == 200: response_200 = PostMortemTemplateResponse.from_dict(response.json()) @@ -52,8 +52,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, PostMortemTemplateResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | PostMortemTemplateResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -63,11 +63,11 @@ def _build_response( def sync_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdatePostMortemTemplate, -) -> Response[Union[ErrorsList, PostMortemTemplateResponse]]: +) -> Response[ErrorsList | PostMortemTemplateResponse]: """Update a Retrospective Template Update a specific Retrospective Template by id @@ -97,11 +97,11 @@ def sync_detailed( def sync( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdatePostMortemTemplate, -) -> Optional[Union[ErrorsList, PostMortemTemplateResponse]]: +) -> ErrorsList | PostMortemTemplateResponse | None: """Update a Retrospective Template Update a specific Retrospective Template by id @@ -126,11 +126,11 @@ def sync( async def asyncio_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdatePostMortemTemplate, -) -> Response[Union[ErrorsList, PostMortemTemplateResponse]]: +) -> Response[ErrorsList | PostMortemTemplateResponse]: """Update a Retrospective Template Update a specific Retrospective Template by id @@ -158,11 +158,11 @@ async def asyncio_detailed( async def asyncio( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdatePostMortemTemplate, -) -> Optional[Union[ErrorsList, PostMortemTemplateResponse]]: +) -> ErrorsList | PostMortemTemplateResponse | None: """Update a Retrospective Template Update a specific Retrospective Template by id diff --git a/rootly_sdk/api/roles/create_role.py b/rootly_sdk/api/roles/create_role.py index 0a33ff76..cc05aa9d 100644 --- a/rootly_sdk/api/roles/create_role.py +++ b/rootly_sdk/api/roles/create_role.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, RoleResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | RoleResponse | None: if response.status_code == 201: response_201 = RoleResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, RoleResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | RoleResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +69,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewRole, -) -> Response[Union[ErrorsList, RoleResponse]]: +) -> Response[ErrorsList | RoleResponse]: """Creates a role Creates a new role from provided data @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: NewRole, -) -> Optional[Union[ErrorsList, RoleResponse]]: +) -> ErrorsList | RoleResponse | None: """Creates a role Creates a new role from provided data @@ -126,7 +126,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewRole, -) -> Response[Union[ErrorsList, RoleResponse]]: +) -> Response[ErrorsList | RoleResponse]: """Creates a role Creates a new role from provided data @@ -155,7 +155,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewRole, -) -> Optional[Union[ErrorsList, RoleResponse]]: +) -> ErrorsList | RoleResponse | None: """Creates a role Creates a new role from provided data diff --git a/rootly_sdk/api/roles/delete_role.py b/rootly_sdk/api/roles/delete_role.py index 428bebfb..c4103b98 100644 --- a/rootly_sdk/api/roles/delete_role.py +++ b/rootly_sdk/api/roles/delete_role.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any from uuid import UUID import httpx @@ -12,7 +12,7 @@ def _get_kwargs( - id: Union[UUID, str], + id: UUID | str, ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "delete", @@ -23,8 +23,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, RoleResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | RoleResponse | None: if response.status_code == 200: response_200 = RoleResponse.from_dict(response.json()) @@ -42,8 +42,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, RoleResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | RoleResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -53,10 +53,10 @@ def _build_response( def sync_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, RoleResponse]]: +) -> Response[ErrorsList | RoleResponse]: """Delete a role Delete a specific role by id @@ -84,10 +84,10 @@ def sync_detailed( def sync( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, RoleResponse]]: +) -> ErrorsList | RoleResponse | None: """Delete a role Delete a specific role by id @@ -110,10 +110,10 @@ def sync( async def asyncio_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, RoleResponse]]: +) -> Response[ErrorsList | RoleResponse]: """Delete a role Delete a specific role by id @@ -139,10 +139,10 @@ async def asyncio_detailed( async def asyncio( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, RoleResponse]]: +) -> ErrorsList | RoleResponse | None: """Delete a role Delete a specific role by id diff --git a/rootly_sdk/api/roles/get_role.py b/rootly_sdk/api/roles/get_role.py index 4f8dc7c2..fa5e147f 100644 --- a/rootly_sdk/api/roles/get_role.py +++ b/rootly_sdk/api/roles/get_role.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any from uuid import UUID import httpx @@ -12,7 +12,7 @@ def _get_kwargs( - id: Union[UUID, str], + id: UUID | str, ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "get", @@ -23,8 +23,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, RoleResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | RoleResponse | None: if response.status_code == 200: response_200 = RoleResponse.from_dict(response.json()) @@ -42,8 +42,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, RoleResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | RoleResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -53,10 +53,10 @@ def _build_response( def sync_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, RoleResponse]]: +) -> Response[ErrorsList | RoleResponse]: """Retrieves a role Retrieves a specific role by id @@ -84,10 +84,10 @@ def sync_detailed( def sync( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, RoleResponse]]: +) -> ErrorsList | RoleResponse | None: """Retrieves a role Retrieves a specific role by id @@ -110,10 +110,10 @@ def sync( async def asyncio_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, RoleResponse]]: +) -> Response[ErrorsList | RoleResponse]: """Retrieves a role Retrieves a specific role by id @@ -139,10 +139,10 @@ async def asyncio_detailed( async def asyncio( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, RoleResponse]]: +) -> ErrorsList | RoleResponse | None: """Retrieves a role Retrieves a specific role by id diff --git a/rootly_sdk/api/roles/list_roles.py b/rootly_sdk/api/roles/list_roles.py index e0bb35dd..92958f7c 100644 --- a/rootly_sdk/api/roles/list_roles.py +++ b/rootly_sdk/api/roles/list_roles.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -11,17 +11,17 @@ def _get_kwargs( *, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -58,7 +58,7 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[RoleList]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> RoleList | None: if response.status_code == 200: response_200 = RoleList.from_dict(response.json()) @@ -70,7 +70,7 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[RoleList]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[RoleList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -82,17 +82,17 @@ def _build_response(*, client: Union[AuthenticatedClient, Client], response: htt def sync_detailed( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[RoleList]: """List roles @@ -143,18 +143,18 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, -) -> Optional[RoleList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, +) -> RoleList | None: """List roles List roles @@ -199,17 +199,17 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[RoleList]: """List roles @@ -258,18 +258,18 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, -) -> Optional[RoleList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | str = UNSET, +) -> RoleList | None: """List roles List roles diff --git a/rootly_sdk/api/roles/update_role.py b/rootly_sdk/api/roles/update_role.py index 8db0ac1e..2aae9b98 100644 --- a/rootly_sdk/api/roles/update_role.py +++ b/rootly_sdk/api/roles/update_role.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any from uuid import UUID import httpx @@ -13,7 +13,7 @@ def _get_kwargs( - id: Union[UUID, str], + id: UUID | str, *, body: UpdateRole, ) -> dict[str, Any]: @@ -33,8 +33,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, RoleResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | RoleResponse | None: if response.status_code == 200: response_200 = RoleResponse.from_dict(response.json()) @@ -52,8 +52,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, RoleResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | RoleResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -63,11 +63,11 @@ def _build_response( def sync_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdateRole, -) -> Response[Union[ErrorsList, RoleResponse]]: +) -> Response[ErrorsList | RoleResponse]: """Update a role Update a specific role by id @@ -97,11 +97,11 @@ def sync_detailed( def sync( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdateRole, -) -> Optional[Union[ErrorsList, RoleResponse]]: +) -> ErrorsList | RoleResponse | None: """Update a role Update a specific role by id @@ -126,11 +126,11 @@ def sync( async def asyncio_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdateRole, -) -> Response[Union[ErrorsList, RoleResponse]]: +) -> Response[ErrorsList | RoleResponse]: """Update a role Update a specific role by id @@ -158,11 +158,11 @@ async def asyncio_detailed( async def asyncio( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdateRole, -) -> Optional[Union[ErrorsList, RoleResponse]]: +) -> ErrorsList | RoleResponse | None: """Update a role Update a specific role by id diff --git a/rootly_sdk/api/schedule_rotation_active_days/create_schedule_rotation_active_day.py b/rootly_sdk/api/schedule_rotation_active_days/create_schedule_rotation_active_day.py index ff0e1cbe..c107f416 100644 --- a/rootly_sdk/api/schedule_rotation_active_days/create_schedule_rotation_active_day.py +++ b/rootly_sdk/api/schedule_rotation_active_days/create_schedule_rotation_active_day.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, ScheduleRotationActiveDayResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | ScheduleRotationActiveDayResponse | None: if response.status_code == 201: response_201 = ScheduleRotationActiveDayResponse.from_dict(response.json()) @@ -56,8 +56,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, ScheduleRotationActiveDayResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | ScheduleRotationActiveDayResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -71,7 +71,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewScheduleRotationActiveDay, -) -> Response[Union[ErrorsList, ScheduleRotationActiveDayResponse]]: +) -> Response[ErrorsList | ScheduleRotationActiveDayResponse]: """Creates a schedule rotation active day Creates a new schedule rotation active day from provided data @@ -105,7 +105,7 @@ def sync( *, client: AuthenticatedClient, body: NewScheduleRotationActiveDay, -) -> Optional[Union[ErrorsList, ScheduleRotationActiveDayResponse]]: +) -> ErrorsList | ScheduleRotationActiveDayResponse | None: """Creates a schedule rotation active day Creates a new schedule rotation active day from provided data @@ -134,7 +134,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewScheduleRotationActiveDay, -) -> Response[Union[ErrorsList, ScheduleRotationActiveDayResponse]]: +) -> Response[ErrorsList | ScheduleRotationActiveDayResponse]: """Creates a schedule rotation active day Creates a new schedule rotation active day from provided data @@ -166,7 +166,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewScheduleRotationActiveDay, -) -> Optional[Union[ErrorsList, ScheduleRotationActiveDayResponse]]: +) -> ErrorsList | ScheduleRotationActiveDayResponse | None: """Creates a schedule rotation active day Creates a new schedule rotation active day from provided data diff --git a/rootly_sdk/api/schedule_rotation_active_days/delete_schedule_rotation_active_day.py b/rootly_sdk/api/schedule_rotation_active_days/delete_schedule_rotation_active_day.py index badcfaaf..8e688f7c 100644 --- a/rootly_sdk/api/schedule_rotation_active_days/delete_schedule_rotation_active_day.py +++ b/rootly_sdk/api/schedule_rotation_active_days/delete_schedule_rotation_active_day.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, ScheduleRotationActiveDayResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | ScheduleRotationActiveDayResponse | None: if response.status_code == 200: response_200 = ScheduleRotationActiveDayResponse.from_dict(response.json()) @@ -41,8 +41,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, ScheduleRotationActiveDayResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | ScheduleRotationActiveDayResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -55,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, ScheduleRotationActiveDayResponse]]: +) -> Response[ErrorsList | ScheduleRotationActiveDayResponse]: """Delete a schedule rotation active day Delete a specific schedule rotation active day @@ -86,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, ScheduleRotationActiveDayResponse]]: +) -> ErrorsList | ScheduleRotationActiveDayResponse | None: """Delete a schedule rotation active day Delete a specific schedule rotation active day @@ -112,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, ScheduleRotationActiveDayResponse]]: +) -> Response[ErrorsList | ScheduleRotationActiveDayResponse]: """Delete a schedule rotation active day Delete a specific schedule rotation active day @@ -141,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, ScheduleRotationActiveDayResponse]]: +) -> ErrorsList | ScheduleRotationActiveDayResponse | None: """Delete a schedule rotation active day Delete a specific schedule rotation active day diff --git a/rootly_sdk/api/schedule_rotation_active_days/get_schedule_rotation_active_day.py b/rootly_sdk/api/schedule_rotation_active_days/get_schedule_rotation_active_day.py index c1806ee7..e0458be5 100644 --- a/rootly_sdk/api/schedule_rotation_active_days/get_schedule_rotation_active_day.py +++ b/rootly_sdk/api/schedule_rotation_active_days/get_schedule_rotation_active_day.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, ScheduleRotationActiveDayResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | ScheduleRotationActiveDayResponse | None: if response.status_code == 200: response_200 = ScheduleRotationActiveDayResponse.from_dict(response.json()) @@ -41,8 +41,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, ScheduleRotationActiveDayResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | ScheduleRotationActiveDayResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -55,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, ScheduleRotationActiveDayResponse]]: +) -> Response[ErrorsList | ScheduleRotationActiveDayResponse]: """Retrieves a schedule rotation active day Retrieves a specific schedule rotation active day by id @@ -86,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, ScheduleRotationActiveDayResponse]]: +) -> ErrorsList | ScheduleRotationActiveDayResponse | None: """Retrieves a schedule rotation active day Retrieves a specific schedule rotation active day by id @@ -112,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, ScheduleRotationActiveDayResponse]]: +) -> Response[ErrorsList | ScheduleRotationActiveDayResponse]: """Retrieves a schedule rotation active day Retrieves a specific schedule rotation active day by id @@ -141,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, ScheduleRotationActiveDayResponse]]: +) -> ErrorsList | ScheduleRotationActiveDayResponse | None: """Retrieves a schedule rotation active day Retrieves a specific schedule rotation active day by id diff --git a/rootly_sdk/api/schedule_rotation_active_days/list_schedule_rotation_active_days.py b/rootly_sdk/api/schedule_rotation_active_days/list_schedule_rotation_active_days.py index 2881f106..1e54c8a5 100644 --- a/rootly_sdk/api/schedule_rotation_active_days/list_schedule_rotation_active_days.py +++ b/rootly_sdk/api/schedule_rotation_active_days/list_schedule_rotation_active_days.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -12,9 +12,9 @@ def _get_kwargs( schedule_rotation_id: str, *, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -36,8 +36,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[ScheduleRotationActiveDayList]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ScheduleRotationActiveDayList | None: if response.status_code == 200: response_200 = ScheduleRotationActiveDayList.from_dict(response.json()) @@ -50,7 +50,7 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response + *, client: AuthenticatedClient | Client, response: httpx.Response ) -> Response[ScheduleRotationActiveDayList]: return Response( status_code=HTTPStatus(response.status_code), @@ -64,9 +64,9 @@ def sync_detailed( schedule_rotation_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[ScheduleRotationActiveDayList]: """List schedule rotation active days @@ -104,10 +104,10 @@ def sync( schedule_rotation_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, -) -> Optional[ScheduleRotationActiveDayList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, +) -> ScheduleRotationActiveDayList | None: """List schedule rotation active days List schedule rotation active days @@ -139,9 +139,9 @@ async def asyncio_detailed( schedule_rotation_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[ScheduleRotationActiveDayList]: """List schedule rotation active days @@ -177,10 +177,10 @@ async def asyncio( schedule_rotation_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, -) -> Optional[ScheduleRotationActiveDayList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, +) -> ScheduleRotationActiveDayList | None: """List schedule rotation active days List schedule rotation active days diff --git a/rootly_sdk/api/schedule_rotation_active_days/update_schedule_rotation_active_day.py b/rootly_sdk/api/schedule_rotation_active_days/update_schedule_rotation_active_day.py index 8679b6bd..4b87bbda 100644 --- a/rootly_sdk/api/schedule_rotation_active_days/update_schedule_rotation_active_day.py +++ b/rootly_sdk/api/schedule_rotation_active_days/update_schedule_rotation_active_day.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, ScheduleRotationActiveDayResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | ScheduleRotationActiveDayResponse | None: if response.status_code == 200: response_200 = ScheduleRotationActiveDayResponse.from_dict(response.json()) @@ -51,8 +51,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, ScheduleRotationActiveDayResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | ScheduleRotationActiveDayResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateScheduleRotationActiveDay, -) -> Response[Union[ErrorsList, ScheduleRotationActiveDayResponse]]: +) -> Response[ErrorsList | ScheduleRotationActiveDayResponse]: """Update a schedule rotation active day Update a specific schedule rotation active day by id @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateScheduleRotationActiveDay, -) -> Optional[Union[ErrorsList, ScheduleRotationActiveDayResponse]]: +) -> ErrorsList | ScheduleRotationActiveDayResponse | None: """Update a schedule rotation active day Update a specific schedule rotation active day by id @@ -129,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateScheduleRotationActiveDay, -) -> Response[Union[ErrorsList, ScheduleRotationActiveDayResponse]]: +) -> Response[ErrorsList | ScheduleRotationActiveDayResponse]: """Update a schedule rotation active day Update a specific schedule rotation active day by id @@ -161,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateScheduleRotationActiveDay, -) -> Optional[Union[ErrorsList, ScheduleRotationActiveDayResponse]]: +) -> ErrorsList | ScheduleRotationActiveDayResponse | None: """Update a schedule rotation active day Update a specific schedule rotation active day by id diff --git a/rootly_sdk/api/schedule_rotation_users/create_schedule_rotation_user.py b/rootly_sdk/api/schedule_rotation_users/create_schedule_rotation_user.py index f1a7bd87..b87c2ed5 100644 --- a/rootly_sdk/api/schedule_rotation_users/create_schedule_rotation_user.py +++ b/rootly_sdk/api/schedule_rotation_users/create_schedule_rotation_user.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, ScheduleRotationUserResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | ScheduleRotationUserResponse | None: if response.status_code == 201: response_201 = ScheduleRotationUserResponse.from_dict(response.json()) @@ -56,8 +56,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, ScheduleRotationUserResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | ScheduleRotationUserResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -71,7 +71,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewScheduleRotationUser, -) -> Response[Union[ErrorsList, ScheduleRotationUserResponse]]: +) -> Response[ErrorsList | ScheduleRotationUserResponse]: """Creates a schedule rotation user Creates a new schedule rotation user from provided data @@ -105,7 +105,7 @@ def sync( *, client: AuthenticatedClient, body: NewScheduleRotationUser, -) -> Optional[Union[ErrorsList, ScheduleRotationUserResponse]]: +) -> ErrorsList | ScheduleRotationUserResponse | None: """Creates a schedule rotation user Creates a new schedule rotation user from provided data @@ -134,7 +134,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewScheduleRotationUser, -) -> Response[Union[ErrorsList, ScheduleRotationUserResponse]]: +) -> Response[ErrorsList | ScheduleRotationUserResponse]: """Creates a schedule rotation user Creates a new schedule rotation user from provided data @@ -166,7 +166,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewScheduleRotationUser, -) -> Optional[Union[ErrorsList, ScheduleRotationUserResponse]]: +) -> ErrorsList | ScheduleRotationUserResponse | None: """Creates a schedule rotation user Creates a new schedule rotation user from provided data diff --git a/rootly_sdk/api/schedule_rotation_users/delete_schedule_rotation_user.py b/rootly_sdk/api/schedule_rotation_users/delete_schedule_rotation_user.py index b5eb4cc8..f7fe1339 100644 --- a/rootly_sdk/api/schedule_rotation_users/delete_schedule_rotation_user.py +++ b/rootly_sdk/api/schedule_rotation_users/delete_schedule_rotation_user.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, ScheduleRotationUserResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | ScheduleRotationUserResponse | None: if response.status_code == 200: response_200 = ScheduleRotationUserResponse.from_dict(response.json()) @@ -41,8 +41,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, ScheduleRotationUserResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | ScheduleRotationUserResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -55,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, ScheduleRotationUserResponse]]: +) -> Response[ErrorsList | ScheduleRotationUserResponse]: """Delete a schedule rotation user Delete a specific schedule rotation user by id @@ -86,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, ScheduleRotationUserResponse]]: +) -> ErrorsList | ScheduleRotationUserResponse | None: """Delete a schedule rotation user Delete a specific schedule rotation user by id @@ -112,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, ScheduleRotationUserResponse]]: +) -> Response[ErrorsList | ScheduleRotationUserResponse]: """Delete a schedule rotation user Delete a specific schedule rotation user by id @@ -141,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, ScheduleRotationUserResponse]]: +) -> ErrorsList | ScheduleRotationUserResponse | None: """Delete a schedule rotation user Delete a specific schedule rotation user by id diff --git a/rootly_sdk/api/schedule_rotation_users/get_schedule_rotation_user.py b/rootly_sdk/api/schedule_rotation_users/get_schedule_rotation_user.py index 1ab416c0..d1e6b151 100644 --- a/rootly_sdk/api/schedule_rotation_users/get_schedule_rotation_user.py +++ b/rootly_sdk/api/schedule_rotation_users/get_schedule_rotation_user.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, ScheduleRotationUserResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | ScheduleRotationUserResponse | None: if response.status_code == 200: response_200 = ScheduleRotationUserResponse.from_dict(response.json()) @@ -41,8 +41,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, ScheduleRotationUserResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | ScheduleRotationUserResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -55,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, ScheduleRotationUserResponse]]: +) -> Response[ErrorsList | ScheduleRotationUserResponse]: """Retrieves a schedule rotation user Retrieves a specific schedule rotation user by id @@ -86,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, ScheduleRotationUserResponse]]: +) -> ErrorsList | ScheduleRotationUserResponse | None: """Retrieves a schedule rotation user Retrieves a specific schedule rotation user by id @@ -112,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, ScheduleRotationUserResponse]]: +) -> Response[ErrorsList | ScheduleRotationUserResponse]: """Retrieves a schedule rotation user Retrieves a specific schedule rotation user by id @@ -141,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, ScheduleRotationUserResponse]]: +) -> ErrorsList | ScheduleRotationUserResponse | None: """Retrieves a schedule rotation user Retrieves a specific schedule rotation user by id diff --git a/rootly_sdk/api/schedule_rotation_users/list_schedule_rotation_users.py b/rootly_sdk/api/schedule_rotation_users/list_schedule_rotation_users.py index 4b02a448..21d8f869 100644 --- a/rootly_sdk/api/schedule_rotation_users/list_schedule_rotation_users.py +++ b/rootly_sdk/api/schedule_rotation_users/list_schedule_rotation_users.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -12,9 +12,9 @@ def _get_kwargs( schedule_rotation_id: str, *, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -36,8 +36,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[ScheduleRotationUserList]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ScheduleRotationUserList | None: if response.status_code == 200: response_200 = ScheduleRotationUserList.from_dict(response.json()) @@ -50,7 +50,7 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response + *, client: AuthenticatedClient | Client, response: httpx.Response ) -> Response[ScheduleRotationUserList]: return Response( status_code=HTTPStatus(response.status_code), @@ -64,9 +64,9 @@ def sync_detailed( schedule_rotation_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[ScheduleRotationUserList]: """List schedule rotation users @@ -102,10 +102,10 @@ def sync( schedule_rotation_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, -) -> Optional[ScheduleRotationUserList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, +) -> ScheduleRotationUserList | None: """List schedule rotation users Args: @@ -135,9 +135,9 @@ async def asyncio_detailed( schedule_rotation_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[ScheduleRotationUserList]: """List schedule rotation users @@ -171,10 +171,10 @@ async def asyncio( schedule_rotation_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, -) -> Optional[ScheduleRotationUserList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, +) -> ScheduleRotationUserList | None: """List schedule rotation users Args: diff --git a/rootly_sdk/api/schedule_rotation_users/update_schedule_rotation_user.py b/rootly_sdk/api/schedule_rotation_users/update_schedule_rotation_user.py index 93609cb0..85250a89 100644 --- a/rootly_sdk/api/schedule_rotation_users/update_schedule_rotation_user.py +++ b/rootly_sdk/api/schedule_rotation_users/update_schedule_rotation_user.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, ScheduleRotationUserResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | ScheduleRotationUserResponse | None: if response.status_code == 200: response_200 = ScheduleRotationUserResponse.from_dict(response.json()) @@ -51,8 +51,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, ScheduleRotationUserResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | ScheduleRotationUserResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateScheduleRotationUser, -) -> Response[Union[ErrorsList, ScheduleRotationUserResponse]]: +) -> Response[ErrorsList | ScheduleRotationUserResponse]: """Update schedule rotation user Update a specific schedule rotation user by id @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateScheduleRotationUser, -) -> Optional[Union[ErrorsList, ScheduleRotationUserResponse]]: +) -> ErrorsList | ScheduleRotationUserResponse | None: """Update schedule rotation user Update a specific schedule rotation user by id @@ -129,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateScheduleRotationUser, -) -> Response[Union[ErrorsList, ScheduleRotationUserResponse]]: +) -> Response[ErrorsList | ScheduleRotationUserResponse]: """Update schedule rotation user Update a specific schedule rotation user by id @@ -161,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateScheduleRotationUser, -) -> Optional[Union[ErrorsList, ScheduleRotationUserResponse]]: +) -> ErrorsList | ScheduleRotationUserResponse | None: """Update schedule rotation user Update a specific schedule rotation user by id diff --git a/rootly_sdk/api/schedule_rotations/create_schedule_rotation.py b/rootly_sdk/api/schedule_rotations/create_schedule_rotation.py index 3d3e5a0c..9e113ece 100644 --- a/rootly_sdk/api/schedule_rotations/create_schedule_rotation.py +++ b/rootly_sdk/api/schedule_rotations/create_schedule_rotation.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, ScheduleRotationResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | ScheduleRotationResponse | None: if response.status_code == 201: response_201 = ScheduleRotationResponse.from_dict(response.json()) @@ -56,8 +56,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, ScheduleRotationResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | ScheduleRotationResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -71,7 +71,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewScheduleRotation, -) -> Response[Union[ErrorsList, ScheduleRotationResponse]]: +) -> Response[ErrorsList | ScheduleRotationResponse]: """Creates a schedule rotation Creates a new schedule rotation from provided data @@ -105,7 +105,7 @@ def sync( *, client: AuthenticatedClient, body: NewScheduleRotation, -) -> Optional[Union[ErrorsList, ScheduleRotationResponse]]: +) -> ErrorsList | ScheduleRotationResponse | None: """Creates a schedule rotation Creates a new schedule rotation from provided data @@ -134,7 +134,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewScheduleRotation, -) -> Response[Union[ErrorsList, ScheduleRotationResponse]]: +) -> Response[ErrorsList | ScheduleRotationResponse]: """Creates a schedule rotation Creates a new schedule rotation from provided data @@ -166,7 +166,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewScheduleRotation, -) -> Optional[Union[ErrorsList, ScheduleRotationResponse]]: +) -> ErrorsList | ScheduleRotationResponse | None: """Creates a schedule rotation Creates a new schedule rotation from provided data diff --git a/rootly_sdk/api/schedule_rotations/delete_schedule_rotation.py b/rootly_sdk/api/schedule_rotations/delete_schedule_rotation.py index d38a8889..0bd9ab54 100644 --- a/rootly_sdk/api/schedule_rotations/delete_schedule_rotation.py +++ b/rootly_sdk/api/schedule_rotations/delete_schedule_rotation.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, ScheduleRotationResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | ScheduleRotationResponse | None: if response.status_code == 200: response_200 = ScheduleRotationResponse.from_dict(response.json()) @@ -41,8 +41,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, ScheduleRotationResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | ScheduleRotationResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -55,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, ScheduleRotationResponse]]: +) -> Response[ErrorsList | ScheduleRotationResponse]: """Delete a schedule rotation Delete a specific schedule rotation by id @@ -86,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, ScheduleRotationResponse]]: +) -> ErrorsList | ScheduleRotationResponse | None: """Delete a schedule rotation Delete a specific schedule rotation by id @@ -112,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, ScheduleRotationResponse]]: +) -> Response[ErrorsList | ScheduleRotationResponse]: """Delete a schedule rotation Delete a specific schedule rotation by id @@ -141,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, ScheduleRotationResponse]]: +) -> ErrorsList | ScheduleRotationResponse | None: """Delete a schedule rotation Delete a specific schedule rotation by id diff --git a/rootly_sdk/api/schedule_rotations/get_schedule_rotation.py b/rootly_sdk/api/schedule_rotations/get_schedule_rotation.py index 3990016f..7cb6f77b 100644 --- a/rootly_sdk/api/schedule_rotations/get_schedule_rotation.py +++ b/rootly_sdk/api/schedule_rotations/get_schedule_rotation.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, ScheduleRotationResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | ScheduleRotationResponse | None: if response.status_code == 200: response_200 = ScheduleRotationResponse.from_dict(response.json()) @@ -41,8 +41,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, ScheduleRotationResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | ScheduleRotationResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -55,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, ScheduleRotationResponse]]: +) -> Response[ErrorsList | ScheduleRotationResponse]: """Retrieves a schedule rotation Retrieves a specific schedule rotation by id @@ -86,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, ScheduleRotationResponse]]: +) -> ErrorsList | ScheduleRotationResponse | None: """Retrieves a schedule rotation Retrieves a specific schedule rotation by id @@ -112,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, ScheduleRotationResponse]]: +) -> Response[ErrorsList | ScheduleRotationResponse]: """Retrieves a schedule rotation Retrieves a specific schedule rotation by id @@ -141,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, ScheduleRotationResponse]]: +) -> ErrorsList | ScheduleRotationResponse | None: """Retrieves a schedule rotation Retrieves a specific schedule rotation by id diff --git a/rootly_sdk/api/schedule_rotations/list_schedule_rotations.py b/rootly_sdk/api/schedule_rotations/list_schedule_rotations.py index e81b15cb..1cc7afbf 100644 --- a/rootly_sdk/api/schedule_rotations/list_schedule_rotations.py +++ b/rootly_sdk/api/schedule_rotations/list_schedule_rotations.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -12,10 +12,10 @@ def _get_kwargs( schedule_id: str, *, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - sort: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + sort: Unset | str = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -38,9 +38,7 @@ def _get_kwargs( return _kwargs -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[ScheduleRotationList]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> ScheduleRotationList | None: if response.status_code == 200: response_200 = ScheduleRotationList.from_dict(response.json()) @@ -53,7 +51,7 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response + *, client: AuthenticatedClient | Client, response: httpx.Response ) -> Response[ScheduleRotationList]: return Response( status_code=HTTPStatus(response.status_code), @@ -67,10 +65,10 @@ def sync_detailed( schedule_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - sort: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + sort: Unset | str = UNSET, ) -> Response[ScheduleRotationList]: """List schedule rotations @@ -110,11 +108,11 @@ def sync( schedule_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - sort: Union[Unset, str] = UNSET, -) -> Optional[ScheduleRotationList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + sort: Unset | str = UNSET, +) -> ScheduleRotationList | None: """List schedule rotations List schedule rotations @@ -148,10 +146,10 @@ async def asyncio_detailed( schedule_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - sort: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + sort: Unset | str = UNSET, ) -> Response[ScheduleRotationList]: """List schedule rotations @@ -189,11 +187,11 @@ async def asyncio( schedule_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - sort: Union[Unset, str] = UNSET, -) -> Optional[ScheduleRotationList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + sort: Unset | str = UNSET, +) -> ScheduleRotationList | None: """List schedule rotations List schedule rotations diff --git a/rootly_sdk/api/schedule_rotations/update_schedule_rotation.py b/rootly_sdk/api/schedule_rotations/update_schedule_rotation.py index 994916bb..5ec8c3c3 100644 --- a/rootly_sdk/api/schedule_rotations/update_schedule_rotation.py +++ b/rootly_sdk/api/schedule_rotations/update_schedule_rotation.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, ScheduleRotationResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | ScheduleRotationResponse | None: if response.status_code == 200: response_200 = ScheduleRotationResponse.from_dict(response.json()) @@ -51,8 +51,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, ScheduleRotationResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | ScheduleRotationResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateScheduleRotation, -) -> Response[Union[ErrorsList, ScheduleRotationResponse]]: +) -> Response[ErrorsList | ScheduleRotationResponse]: """Update a schedule rotation Update a specific schedule rotation by id @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateScheduleRotation, -) -> Optional[Union[ErrorsList, ScheduleRotationResponse]]: +) -> ErrorsList | ScheduleRotationResponse | None: """Update a schedule rotation Update a specific schedule rotation by id @@ -129,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateScheduleRotation, -) -> Response[Union[ErrorsList, ScheduleRotationResponse]]: +) -> Response[ErrorsList | ScheduleRotationResponse]: """Update a schedule rotation Update a specific schedule rotation by id @@ -161,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateScheduleRotation, -) -> Optional[Union[ErrorsList, ScheduleRotationResponse]]: +) -> ErrorsList | ScheduleRotationResponse | None: """Update a schedule rotation Update a specific schedule rotation by id diff --git a/rootly_sdk/api/schedules/create_schedule.py b/rootly_sdk/api/schedules/create_schedule.py index ea80b639..41dd8104 100644 --- a/rootly_sdk/api/schedules/create_schedule.py +++ b/rootly_sdk/api/schedules/create_schedule.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, ScheduleResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | ScheduleResponse | None: if response.status_code == 201: response_201 = ScheduleResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, ScheduleResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | ScheduleResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +69,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewSchedule, -) -> Response[Union[ErrorsList, ScheduleResponse]]: +) -> Response[ErrorsList | ScheduleResponse]: """Creates a schedule Creates a new schedule from provided data @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: NewSchedule, -) -> Optional[Union[ErrorsList, ScheduleResponse]]: +) -> ErrorsList | ScheduleResponse | None: """Creates a schedule Creates a new schedule from provided data @@ -126,7 +126,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewSchedule, -) -> Response[Union[ErrorsList, ScheduleResponse]]: +) -> Response[ErrorsList | ScheduleResponse]: """Creates a schedule Creates a new schedule from provided data @@ -155,7 +155,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewSchedule, -) -> Optional[Union[ErrorsList, ScheduleResponse]]: +) -> ErrorsList | ScheduleResponse | None: """Creates a schedule Creates a new schedule from provided data diff --git a/rootly_sdk/api/schedules/delete_schedule.py b/rootly_sdk/api/schedules/delete_schedule.py index 830d8dc6..83c1016e 100644 --- a/rootly_sdk/api/schedules/delete_schedule.py +++ b/rootly_sdk/api/schedules/delete_schedule.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, ScheduleResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | ScheduleResponse | None: if response.status_code == 200: response_200 = ScheduleResponse.from_dict(response.json()) @@ -41,8 +41,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, ScheduleResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | ScheduleResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -55,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, ScheduleResponse]]: +) -> Response[ErrorsList | ScheduleResponse]: """Delete a schedule Delete a specific schedule by id @@ -86,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, ScheduleResponse]]: +) -> ErrorsList | ScheduleResponse | None: """Delete a schedule Delete a specific schedule by id @@ -112,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, ScheduleResponse]]: +) -> Response[ErrorsList | ScheduleResponse]: """Delete a schedule Delete a specific schedule by id @@ -141,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, ScheduleResponse]]: +) -> ErrorsList | ScheduleResponse | None: """Delete a schedule Delete a specific schedule by id diff --git a/rootly_sdk/api/schedules/get_schedule.py b/rootly_sdk/api/schedules/get_schedule.py index 9d4c10c5..5449e85a 100644 --- a/rootly_sdk/api/schedules/get_schedule.py +++ b/rootly_sdk/api/schedules/get_schedule.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, ScheduleResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | ScheduleResponse | None: if response.status_code == 200: response_200 = ScheduleResponse.from_dict(response.json()) @@ -41,8 +41,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, ScheduleResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | ScheduleResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -55,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, ScheduleResponse]]: +) -> Response[ErrorsList | ScheduleResponse]: """Retrieves a schedule Retrieves a specific schedule by id @@ -86,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, ScheduleResponse]]: +) -> ErrorsList | ScheduleResponse | None: """Retrieves a schedule Retrieves a specific schedule by id @@ -112,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, ScheduleResponse]]: +) -> Response[ErrorsList | ScheduleResponse]: """Retrieves a schedule Retrieves a specific schedule by id @@ -141,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, ScheduleResponse]]: +) -> ErrorsList | ScheduleResponse | None: """Retrieves a schedule Retrieves a specific schedule by id diff --git a/rootly_sdk/api/schedules/list_schedules.py b/rootly_sdk/api/schedules/list_schedules.py index 671ca77e..16a4ceca 100644 --- a/rootly_sdk/api/schedules/list_schedules.py +++ b/rootly_sdk/api/schedules/list_schedules.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -11,24 +11,24 @@ def _get_kwargs( *, - include: Union[Unset, str] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterteam_ids: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, - filterteam_idseq: Union[Unset, str] = UNSET, - filterteam_idsnot_eq: Union[Unset, str] = UNSET, - filterteam_idsin: Union[Unset, str] = UNSET, - filterteam_idsnot_in: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + include: Unset | str = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterteam_ids: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filterteam_idseq: Unset | str = UNSET, + filterteam_idsnot_eq: Unset | str = UNSET, + filterteam_idsin: Unset | str = UNSET, + filterteam_idsnot_in: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -79,7 +79,7 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[ScheduleList]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> ScheduleList | None: if response.status_code == 200: response_200 = ScheduleList.from_dict(response.json()) @@ -91,7 +91,7 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[ScheduleList]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[ScheduleList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -103,24 +103,24 @@ def _build_response(*, client: Union[AuthenticatedClient, Client], response: htt def sync_detailed( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterteam_ids: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, - filterteam_idseq: Union[Unset, str] = UNSET, - filterteam_idsnot_eq: Union[Unset, str] = UNSET, - filterteam_idsin: Union[Unset, str] = UNSET, - filterteam_idsnot_in: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + include: Unset | str = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterteam_ids: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filterteam_idseq: Unset | str = UNSET, + filterteam_idsnot_eq: Unset | str = UNSET, + filterteam_idsin: Unset | str = UNSET, + filterteam_idsnot_in: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[ScheduleList]: """List schedules @@ -185,25 +185,25 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterteam_ids: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, - filterteam_idseq: Union[Unset, str] = UNSET, - filterteam_idsnot_eq: Union[Unset, str] = UNSET, - filterteam_idsin: Union[Unset, str] = UNSET, - filterteam_idsnot_in: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, -) -> Optional[ScheduleList]: + include: Unset | str = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterteam_ids: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filterteam_idseq: Unset | str = UNSET, + filterteam_idsnot_eq: Unset | str = UNSET, + filterteam_idsin: Unset | str = UNSET, + filterteam_idsnot_in: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, +) -> ScheduleList | None: """List schedules List schedules @@ -262,24 +262,24 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterteam_ids: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, - filterteam_idseq: Union[Unset, str] = UNSET, - filterteam_idsnot_eq: Union[Unset, str] = UNSET, - filterteam_idsin: Union[Unset, str] = UNSET, - filterteam_idsnot_in: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + include: Unset | str = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterteam_ids: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filterteam_idseq: Unset | str = UNSET, + filterteam_idsnot_eq: Unset | str = UNSET, + filterteam_idsin: Unset | str = UNSET, + filterteam_idsnot_in: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[ScheduleList]: """List schedules @@ -342,25 +342,25 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterteam_ids: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, - filterteam_idseq: Union[Unset, str] = UNSET, - filterteam_idsnot_eq: Union[Unset, str] = UNSET, - filterteam_idsin: Union[Unset, str] = UNSET, - filterteam_idsnot_in: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, -) -> Optional[ScheduleList]: + include: Unset | str = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterteam_ids: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filterteam_idseq: Unset | str = UNSET, + filterteam_idsnot_eq: Unset | str = UNSET, + filterteam_idsin: Unset | str = UNSET, + filterteam_idsnot_in: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, +) -> ScheduleList | None: """List schedules List schedules diff --git a/rootly_sdk/api/schedules/update_schedule.py b/rootly_sdk/api/schedules/update_schedule.py index 9b38f097..0ba5b2b4 100644 --- a/rootly_sdk/api/schedules/update_schedule.py +++ b/rootly_sdk/api/schedules/update_schedule.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, ScheduleResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | ScheduleResponse | None: if response.status_code == 200: response_200 = ScheduleResponse.from_dict(response.json()) @@ -51,8 +51,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, ScheduleResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | ScheduleResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateSchedule, -) -> Response[Union[ErrorsList, ScheduleResponse]]: +) -> Response[ErrorsList | ScheduleResponse]: """Update a schedule Updates a specific schedule by id @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateSchedule, -) -> Optional[Union[ErrorsList, ScheduleResponse]]: +) -> ErrorsList | ScheduleResponse | None: """Update a schedule Updates a specific schedule by id @@ -129,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateSchedule, -) -> Response[Union[ErrorsList, ScheduleResponse]]: +) -> Response[ErrorsList | ScheduleResponse]: """Update a schedule Updates a specific schedule by id @@ -161,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateSchedule, -) -> Optional[Union[ErrorsList, ScheduleResponse]]: +) -> ErrorsList | ScheduleResponse | None: """Update a schedule Updates a specific schedule by id diff --git a/rootly_sdk/api/secrets/create_secret.py b/rootly_sdk/api/secrets/create_secret.py index 7c9f7b88..a28973eb 100644 --- a/rootly_sdk/api/secrets/create_secret.py +++ b/rootly_sdk/api/secrets/create_secret.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, SecretResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | SecretResponse | None: if response.status_code == 201: response_201 = SecretResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, SecretResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | SecretResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +69,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewSecret, -) -> Response[Union[ErrorsList, SecretResponse]]: +) -> Response[ErrorsList | SecretResponse]: """Creates a secret Creates a new secret from provided data @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: NewSecret, -) -> Optional[Union[ErrorsList, SecretResponse]]: +) -> ErrorsList | SecretResponse | None: """Creates a secret Creates a new secret from provided data @@ -126,7 +126,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewSecret, -) -> Response[Union[ErrorsList, SecretResponse]]: +) -> Response[ErrorsList | SecretResponse]: """Creates a secret Creates a new secret from provided data @@ -155,7 +155,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewSecret, -) -> Optional[Union[ErrorsList, SecretResponse]]: +) -> ErrorsList | SecretResponse | None: """Creates a secret Creates a new secret from provided data diff --git a/rootly_sdk/api/secrets/delete_secret.py b/rootly_sdk/api/secrets/delete_secret.py index 59636160..aded439f 100644 --- a/rootly_sdk/api/secrets/delete_secret.py +++ b/rootly_sdk/api/secrets/delete_secret.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, SecretResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | SecretResponse | None: if response.status_code == 200: response_200 = SecretResponse.from_dict(response.json()) @@ -41,8 +41,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, SecretResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | SecretResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -55,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, SecretResponse]]: +) -> Response[ErrorsList | SecretResponse]: """Delete a secret Delete a specific secret by id @@ -86,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, SecretResponse]]: +) -> ErrorsList | SecretResponse | None: """Delete a secret Delete a specific secret by id @@ -112,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, SecretResponse]]: +) -> Response[ErrorsList | SecretResponse]: """Delete a secret Delete a specific secret by id @@ -141,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, SecretResponse]]: +) -> ErrorsList | SecretResponse | None: """Delete a secret Delete a specific secret by id diff --git a/rootly_sdk/api/secrets/get_secret.py b/rootly_sdk/api/secrets/get_secret.py index a3fc9b87..4d1b134a 100644 --- a/rootly_sdk/api/secrets/get_secret.py +++ b/rootly_sdk/api/secrets/get_secret.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, SecretResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | SecretResponse | None: if response.status_code == 200: response_200 = SecretResponse.from_dict(response.json()) @@ -41,8 +41,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, SecretResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | SecretResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -55,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, SecretResponse]]: +) -> Response[ErrorsList | SecretResponse]: """Retrieves a secret Retrieve a specific secret by id @@ -86,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, SecretResponse]]: +) -> ErrorsList | SecretResponse | None: """Retrieves a secret Retrieve a specific secret by id @@ -112,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, SecretResponse]]: +) -> Response[ErrorsList | SecretResponse]: """Retrieves a secret Retrieve a specific secret by id @@ -141,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, SecretResponse]]: +) -> ErrorsList | SecretResponse | None: """Retrieves a secret Retrieve a specific secret by id diff --git a/rootly_sdk/api/secrets/list_secrets.py b/rootly_sdk/api/secrets/list_secrets.py index 42d88361..09aced5b 100644 --- a/rootly_sdk/api/secrets/list_secrets.py +++ b/rootly_sdk/api/secrets/list_secrets.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -11,9 +11,9 @@ def _get_kwargs( *, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -34,7 +34,7 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[SecretList]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> SecretList | None: if response.status_code == 200: response_200 = SecretList.from_dict(response.json()) @@ -46,7 +46,7 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[SecretList]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[SecretList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -58,9 +58,9 @@ def _build_response(*, client: Union[AuthenticatedClient, Client], response: htt def sync_detailed( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[SecretList]: """List secrets @@ -95,10 +95,10 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, -) -> Optional[SecretList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, +) -> SecretList | None: """List secrets List secrets @@ -127,9 +127,9 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[SecretList]: """List secrets @@ -162,10 +162,10 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, -) -> Optional[SecretList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, +) -> SecretList | None: """List secrets List secrets diff --git a/rootly_sdk/api/secrets/update_secret.py b/rootly_sdk/api/secrets/update_secret.py index fac42927..b6c122d6 100644 --- a/rootly_sdk/api/secrets/update_secret.py +++ b/rootly_sdk/api/secrets/update_secret.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, SecretResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | SecretResponse | None: if response.status_code == 200: response_200 = SecretResponse.from_dict(response.json()) @@ -51,8 +51,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, SecretResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | SecretResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateSecret, -) -> Response[Union[ErrorsList, SecretResponse]]: +) -> Response[ErrorsList | SecretResponse]: """Update a secret Update a specific secret by id @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateSecret, -) -> Optional[Union[ErrorsList, SecretResponse]]: +) -> ErrorsList | SecretResponse | None: """Update a secret Update a specific secret by id @@ -129,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateSecret, -) -> Response[Union[ErrorsList, SecretResponse]]: +) -> Response[ErrorsList | SecretResponse]: """Update a secret Update a specific secret by id @@ -161,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateSecret, -) -> Optional[Union[ErrorsList, SecretResponse]]: +) -> ErrorsList | SecretResponse | None: """Update a secret Update a specific secret by id diff --git a/rootly_sdk/api/services/bulk_delete_services.py b/rootly_sdk/api/services/bulk_delete_services.py index 68b67c7f..a0b10bc5 100644 --- a/rootly_sdk/api/services/bulk_delete_services.py +++ b/rootly_sdk/api/services/bulk_delete_services.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any, Union import httpx @@ -36,8 +36,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[BulkDestroyServicesResponse, ErrorsList, Union["BulkDestroyServicesResponse", "ErrorsList"]]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> BulkDestroyServicesResponse | ErrorsList | Union["BulkDestroyServicesResponse", "ErrorsList"] | None: if response.status_code == 200: response_200 = BulkDestroyServicesResponse.from_dict(response.json()) @@ -76,8 +76,8 @@ def _parse_response_422(data: object) -> Union["BulkDestroyServicesResponse", "E def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[BulkDestroyServicesResponse, ErrorsList, Union["BulkDestroyServicesResponse", "ErrorsList"]]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[BulkDestroyServicesResponse | ErrorsList | Union["BulkDestroyServicesResponse", "ErrorsList"]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -90,7 +90,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: Union["BulkDestroyServicesType0", "BulkDestroyServicesType1"], -) -> Response[Union[BulkDestroyServicesResponse, ErrorsList, Union["BulkDestroyServicesResponse", "ErrorsList"]]]: +) -> Response[BulkDestroyServicesResponse | ErrorsList | Union["BulkDestroyServicesResponse", "ErrorsList"]]: """Bulk delete Services Delete services by external_id list, or prune by managed_by source. Two mutually exclusive modes. @@ -123,7 +123,7 @@ def sync( *, client: AuthenticatedClient, body: Union["BulkDestroyServicesType0", "BulkDestroyServicesType1"], -) -> Optional[Union[BulkDestroyServicesResponse, ErrorsList, Union["BulkDestroyServicesResponse", "ErrorsList"]]]: +) -> BulkDestroyServicesResponse | ErrorsList | Union["BulkDestroyServicesResponse", "ErrorsList"] | None: """Bulk delete Services Delete services by external_id list, or prune by managed_by source. Two mutually exclusive modes. @@ -151,7 +151,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: Union["BulkDestroyServicesType0", "BulkDestroyServicesType1"], -) -> Response[Union[BulkDestroyServicesResponse, ErrorsList, Union["BulkDestroyServicesResponse", "ErrorsList"]]]: +) -> Response[BulkDestroyServicesResponse | ErrorsList | Union["BulkDestroyServicesResponse", "ErrorsList"]]: """Bulk delete Services Delete services by external_id list, or prune by managed_by source. Two mutually exclusive modes. @@ -182,7 +182,7 @@ async def asyncio( *, client: AuthenticatedClient, body: Union["BulkDestroyServicesType0", "BulkDestroyServicesType1"], -) -> Optional[Union[BulkDestroyServicesResponse, ErrorsList, Union["BulkDestroyServicesResponse", "ErrorsList"]]]: +) -> BulkDestroyServicesResponse | ErrorsList | Union["BulkDestroyServicesResponse", "ErrorsList"] | None: """Bulk delete Services Delete services by external_id list, or prune by managed_by source. Two mutually exclusive modes. diff --git a/rootly_sdk/api/services/bulk_upsert_services.py b/rootly_sdk/api/services/bulk_upsert_services.py index 777c01b8..8acfaa05 100644 --- a/rootly_sdk/api/services/bulk_upsert_services.py +++ b/rootly_sdk/api/services/bulk_upsert_services.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any, Union import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[BulkUpsertServicesResponse, ErrorsList, Union["BulkUpsertServicesError", "ErrorsList"]]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> BulkUpsertServicesResponse | ErrorsList | Union["BulkUpsertServicesError", "ErrorsList"] | None: if response.status_code == 200: response_200 = BulkUpsertServicesResponse.from_dict(response.json()) @@ -72,8 +72,8 @@ def _parse_response_422(data: object) -> Union["BulkUpsertServicesError", "Error def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[BulkUpsertServicesResponse, ErrorsList, Union["BulkUpsertServicesError", "ErrorsList"]]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[BulkUpsertServicesResponse | ErrorsList | Union["BulkUpsertServicesError", "ErrorsList"]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -86,7 +86,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: BulkUpsertServices, -) -> Response[Union[BulkUpsertServicesResponse, ErrorsList, Union["BulkUpsertServicesError", "ErrorsList"]]]: +) -> Response[BulkUpsertServicesResponse | ErrorsList | Union["BulkUpsertServicesError", "ErrorsList"]]: """Bulk upsert Services Create or update multiple services by external_id. Only attributes present in the payload are @@ -121,7 +121,7 @@ def sync( *, client: AuthenticatedClient, body: BulkUpsertServices, -) -> Optional[Union[BulkUpsertServicesResponse, ErrorsList, Union["BulkUpsertServicesError", "ErrorsList"]]]: +) -> BulkUpsertServicesResponse | ErrorsList | Union["BulkUpsertServicesError", "ErrorsList"] | None: """Bulk upsert Services Create or update multiple services by external_id. Only attributes present in the payload are @@ -151,7 +151,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: BulkUpsertServices, -) -> Response[Union[BulkUpsertServicesResponse, ErrorsList, Union["BulkUpsertServicesError", "ErrorsList"]]]: +) -> Response[BulkUpsertServicesResponse | ErrorsList | Union["BulkUpsertServicesError", "ErrorsList"]]: """Bulk upsert Services Create or update multiple services by external_id. Only attributes present in the payload are @@ -184,7 +184,7 @@ async def asyncio( *, client: AuthenticatedClient, body: BulkUpsertServices, -) -> Optional[Union[BulkUpsertServicesResponse, ErrorsList, Union["BulkUpsertServicesError", "ErrorsList"]]]: +) -> BulkUpsertServicesResponse | ErrorsList | Union["BulkUpsertServicesError", "ErrorsList"] | None: """Bulk upsert Services Create or update multiple services by external_id. Only attributes present in the payload are diff --git a/rootly_sdk/api/services/create_service.py b/rootly_sdk/api/services/create_service.py index c3a8b42e..56e5f79c 100644 --- a/rootly_sdk/api/services/create_service.py +++ b/rootly_sdk/api/services/create_service.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, ServiceResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | ServiceResponse | None: if response.status_code == 201: response_201 = ServiceResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, ServiceResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | ServiceResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +69,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewService, -) -> Response[Union[ErrorsList, ServiceResponse]]: +) -> Response[ErrorsList | ServiceResponse]: """Creates a service Creates a new service from provided data @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: NewService, -) -> Optional[Union[ErrorsList, ServiceResponse]]: +) -> ErrorsList | ServiceResponse | None: """Creates a service Creates a new service from provided data @@ -126,7 +126,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewService, -) -> Response[Union[ErrorsList, ServiceResponse]]: +) -> Response[ErrorsList | ServiceResponse]: """Creates a service Creates a new service from provided data @@ -155,7 +155,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewService, -) -> Optional[Union[ErrorsList, ServiceResponse]]: +) -> ErrorsList | ServiceResponse | None: """Creates a service Creates a new service from provided data diff --git a/rootly_sdk/api/services/create_service_catalog_property.py b/rootly_sdk/api/services/create_service_catalog_property.py index 29dd5aac..10022b29 100644 --- a/rootly_sdk/api/services/create_service_catalog_property.py +++ b/rootly_sdk/api/services/create_service_catalog_property.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[CatalogPropertyResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CatalogPropertyResponse | ErrorsList | None: if response.status_code == 201: response_201 = CatalogPropertyResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[CatalogPropertyResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[CatalogPropertyResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +69,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewCatalogProperty, -) -> Response[Union[CatalogPropertyResponse, ErrorsList]]: +) -> Response[CatalogPropertyResponse | ErrorsList]: """Creates a Catalog Property Creates a new Catalog Property from provided data @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: NewCatalogProperty, -) -> Optional[Union[CatalogPropertyResponse, ErrorsList]]: +) -> CatalogPropertyResponse | ErrorsList | None: """Creates a Catalog Property Creates a new Catalog Property from provided data @@ -126,7 +126,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewCatalogProperty, -) -> Response[Union[CatalogPropertyResponse, ErrorsList]]: +) -> Response[CatalogPropertyResponse | ErrorsList]: """Creates a Catalog Property Creates a new Catalog Property from provided data @@ -155,7 +155,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewCatalogProperty, -) -> Optional[Union[CatalogPropertyResponse, ErrorsList]]: +) -> CatalogPropertyResponse | ErrorsList | None: """Creates a Catalog Property Creates a new Catalog Property from provided data diff --git a/rootly_sdk/api/services/delete_service.py b/rootly_sdk/api/services/delete_service.py index 07842636..e4761a6c 100644 --- a/rootly_sdk/api/services/delete_service.py +++ b/rootly_sdk/api/services/delete_service.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any from uuid import UUID import httpx @@ -12,7 +12,7 @@ def _get_kwargs( - id: Union[UUID, str], + id: UUID | str, ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "delete", @@ -23,8 +23,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, ServiceResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | ServiceResponse | None: if response.status_code == 200: response_200 = ServiceResponse.from_dict(response.json()) @@ -42,8 +42,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, ServiceResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | ServiceResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -53,10 +53,10 @@ def _build_response( def sync_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, ServiceResponse]]: +) -> Response[ErrorsList | ServiceResponse]: """Delete a service Delete a specific service by id @@ -84,10 +84,10 @@ def sync_detailed( def sync( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, ServiceResponse]]: +) -> ErrorsList | ServiceResponse | None: """Delete a service Delete a specific service by id @@ -110,10 +110,10 @@ def sync( async def asyncio_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, ServiceResponse]]: +) -> Response[ErrorsList | ServiceResponse]: """Delete a service Delete a specific service by id @@ -139,10 +139,10 @@ async def asyncio_detailed( async def asyncio( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, ServiceResponse]]: +) -> ErrorsList | ServiceResponse | None: """Delete a service Delete a specific service by id diff --git a/rootly_sdk/api/services/get_service.py b/rootly_sdk/api/services/get_service.py index bdb5a8a7..eea3f3c3 100644 --- a/rootly_sdk/api/services/get_service.py +++ b/rootly_sdk/api/services/get_service.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any from uuid import UUID import httpx @@ -12,7 +12,7 @@ def _get_kwargs( - id: Union[UUID, str], + id: UUID | str, ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "get", @@ -23,8 +23,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, ServiceResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | ServiceResponse | None: if response.status_code == 200: response_200 = ServiceResponse.from_dict(response.json()) @@ -42,8 +42,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, ServiceResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | ServiceResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -53,10 +53,10 @@ def _build_response( def sync_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, ServiceResponse]]: +) -> Response[ErrorsList | ServiceResponse]: """Retrieves a service Retrieves a specific service by id @@ -84,10 +84,10 @@ def sync_detailed( def sync( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, ServiceResponse]]: +) -> ErrorsList | ServiceResponse | None: """Retrieves a service Retrieves a specific service by id @@ -110,10 +110,10 @@ def sync( async def asyncio_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, ServiceResponse]]: +) -> Response[ErrorsList | ServiceResponse]: """Retrieves a service Retrieves a specific service by id @@ -139,10 +139,10 @@ async def asyncio_detailed( async def asyncio( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, ServiceResponse]]: +) -> ErrorsList | ServiceResponse | None: """Retrieves a service Retrieves a specific service by id diff --git a/rootly_sdk/api/services/get_service_incidents_chart.py b/rootly_sdk/api/services/get_service_incidents_chart.py index b46278c6..499f72b2 100644 --- a/rootly_sdk/api/services/get_service_incidents_chart.py +++ b/rootly_sdk/api/services/get_service_incidents_chart.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any from uuid import UUID import httpx @@ -12,7 +12,7 @@ def _get_kwargs( - id: Union[UUID, str], + id: UUID | str, *, period: str, ) -> dict[str, Any]: @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, IncidentsChartResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | IncidentsChartResponse | None: if response.status_code == 200: response_200 = IncidentsChartResponse.from_dict(response.json()) @@ -51,8 +51,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, IncidentsChartResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | IncidentsChartResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -62,11 +62,11 @@ def _build_response( def sync_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, period: str, -) -> Response[Union[ErrorsList, IncidentsChartResponse]]: +) -> Response[ErrorsList | IncidentsChartResponse]: """Get service incidents chart Get service incidents chart @@ -96,11 +96,11 @@ def sync_detailed( def sync( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, period: str, -) -> Optional[Union[ErrorsList, IncidentsChartResponse]]: +) -> ErrorsList | IncidentsChartResponse | None: """Get service incidents chart Get service incidents chart @@ -125,11 +125,11 @@ def sync( async def asyncio_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, period: str, -) -> Response[Union[ErrorsList, IncidentsChartResponse]]: +) -> Response[ErrorsList | IncidentsChartResponse]: """Get service incidents chart Get service incidents chart @@ -157,11 +157,11 @@ async def asyncio_detailed( async def asyncio( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, period: str, -) -> Optional[Union[ErrorsList, IncidentsChartResponse]]: +) -> ErrorsList | IncidentsChartResponse | None: """Get service incidents chart Get service incidents chart diff --git a/rootly_sdk/api/services/get_service_uptime_chart.py b/rootly_sdk/api/services/get_service_uptime_chart.py index 56d80b98..7efba8d2 100644 --- a/rootly_sdk/api/services/get_service_uptime_chart.py +++ b/rootly_sdk/api/services/get_service_uptime_chart.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any from uuid import UUID import httpx @@ -12,9 +12,9 @@ def _get_kwargs( - id: Union[UUID, str], + id: UUID | str, *, - period: Union[Unset, str] = UNSET, + period: Unset | str = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, UptimeChartResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | UptimeChartResponse | None: if response.status_code == 200: response_200 = UptimeChartResponse.from_dict(response.json()) @@ -51,8 +51,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, UptimeChartResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | UptimeChartResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -62,11 +62,11 @@ def _build_response( def sync_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, - period: Union[Unset, str] = UNSET, -) -> Response[Union[ErrorsList, UptimeChartResponse]]: + period: Unset | str = UNSET, +) -> Response[ErrorsList | UptimeChartResponse]: """Get service uptime chart Get service uptime chart @@ -96,11 +96,11 @@ def sync_detailed( def sync( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, - period: Union[Unset, str] = UNSET, -) -> Optional[Union[ErrorsList, UptimeChartResponse]]: + period: Unset | str = UNSET, +) -> ErrorsList | UptimeChartResponse | None: """Get service uptime chart Get service uptime chart @@ -125,11 +125,11 @@ def sync( async def asyncio_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, - period: Union[Unset, str] = UNSET, -) -> Response[Union[ErrorsList, UptimeChartResponse]]: + period: Unset | str = UNSET, +) -> Response[ErrorsList | UptimeChartResponse]: """Get service uptime chart Get service uptime chart @@ -157,11 +157,11 @@ async def asyncio_detailed( async def asyncio( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, - period: Union[Unset, str] = UNSET, -) -> Optional[Union[ErrorsList, UptimeChartResponse]]: + period: Unset | str = UNSET, +) -> ErrorsList | UptimeChartResponse | None: """Get service uptime chart Get service uptime chart diff --git a/rootly_sdk/api/services/list_service_catalog_properties.py b/rootly_sdk/api/services/list_service_catalog_properties.py index 3a5e9383..85a6e5c7 100644 --- a/rootly_sdk/api/services/list_service_catalog_properties.py +++ b/rootly_sdk/api/services/list_service_catalog_properties.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -17,27 +17,27 @@ def _get_kwargs( *, - include: Union[Unset, ListServiceCatalogPropertiesInclude] = UNSET, - sort: Union[Unset, ListServiceCatalogPropertiesSort] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterkind: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, + include: Unset | ListServiceCatalogPropertiesInclude = UNSET, + sort: Unset | ListServiceCatalogPropertiesSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} - json_include: Union[Unset, str] = UNSET + json_include: Unset | str = UNSET if not isinstance(include, Unset): json_include = include params["include"] = json_include - json_sort: Union[Unset, str] = UNSET + json_sort: Unset | str = UNSET if not isinstance(sort, Unset): json_sort = sort @@ -72,9 +72,7 @@ def _get_kwargs( return _kwargs -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[CatalogPropertyList]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> CatalogPropertyList | None: if response.status_code == 200: response_200 = CatalogPropertyList.from_dict(response.json()) @@ -86,9 +84,7 @@ def _parse_response( return None -def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[CatalogPropertyList]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[CatalogPropertyList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -100,17 +96,17 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - include: Union[Unset, ListServiceCatalogPropertiesInclude] = UNSET, - sort: Union[Unset, ListServiceCatalogPropertiesSort] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterkind: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, + include: Unset | ListServiceCatalogPropertiesInclude = UNSET, + sort: Unset | ListServiceCatalogPropertiesSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> Response[CatalogPropertyList]: """List Catalog Properties @@ -161,18 +157,18 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: Union[Unset, ListServiceCatalogPropertiesInclude] = UNSET, - sort: Union[Unset, ListServiceCatalogPropertiesSort] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterkind: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, -) -> Optional[CatalogPropertyList]: + include: Unset | ListServiceCatalogPropertiesInclude = UNSET, + sort: Unset | ListServiceCatalogPropertiesSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, +) -> CatalogPropertyList | None: """List Catalog Properties List Service Catalog Properties @@ -217,17 +213,17 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: Union[Unset, ListServiceCatalogPropertiesInclude] = UNSET, - sort: Union[Unset, ListServiceCatalogPropertiesSort] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterkind: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, + include: Unset | ListServiceCatalogPropertiesInclude = UNSET, + sort: Unset | ListServiceCatalogPropertiesSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> Response[CatalogPropertyList]: """List Catalog Properties @@ -276,18 +272,18 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: Union[Unset, ListServiceCatalogPropertiesInclude] = UNSET, - sort: Union[Unset, ListServiceCatalogPropertiesSort] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterkind: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, -) -> Optional[CatalogPropertyList]: + include: Unset | ListServiceCatalogPropertiesInclude = UNSET, + sort: Unset | ListServiceCatalogPropertiesSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, +) -> CatalogPropertyList | None: """List Catalog Properties List Service Catalog Properties diff --git a/rootly_sdk/api/services/list_services.py b/rootly_sdk/api/services/list_services.py index 4858e922..f691c5c3 100644 --- a/rootly_sdk/api/services/list_services.py +++ b/rootly_sdk/api/services/list_services.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -11,39 +11,39 @@ def _get_kwargs( *, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filterbackstage_id: Union[Unset, str] = UNSET, - filtercortex_id: Union[Unset, str] = UNSET, - filteropslevel_id: Union[Unset, str] = UNSET, - filterexternal_id: Union[Unset, str] = UNSET, - filteralert_broadcast_enabled: Union[Unset, bool] = UNSET, - filterincident_broadcast_enabled: Union[Unset, bool] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, - filterslugeq: Union[Unset, str] = UNSET, - filterslugnot_eq: Union[Unset, str] = UNSET, - filterslugin: Union[Unset, str] = UNSET, - filterslugnot_in: Union[Unset, str] = UNSET, - filteralert_broadcast_enabledeq: Union[Unset, str] = UNSET, - filteralert_broadcast_enablednot_eq: Union[Unset, str] = UNSET, - filteralert_broadcast_enabledin: Union[Unset, str] = UNSET, - filteralert_broadcast_enablednot_in: Union[Unset, str] = UNSET, - filterincident_broadcast_enabledeq: Union[Unset, str] = UNSET, - filterincident_broadcast_enablednot_eq: Union[Unset, str] = UNSET, - filterincident_broadcast_enabledin: Union[Unset, str] = UNSET, - filterincident_broadcast_enablednot_in: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filterbackstage_id: Unset | str = UNSET, + filtercortex_id: Unset | str = UNSET, + filteropslevel_id: Unset | str = UNSET, + filterexternal_id: Unset | str = UNSET, + filteralert_broadcast_enabled: Unset | bool = UNSET, + filterincident_broadcast_enabled: Unset | bool = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filteralert_broadcast_enabledeq: Unset | str = UNSET, + filteralert_broadcast_enablednot_eq: Unset | str = UNSET, + filteralert_broadcast_enabledin: Unset | str = UNSET, + filteralert_broadcast_enablednot_in: Unset | str = UNSET, + filterincident_broadcast_enabledeq: Unset | str = UNSET, + filterincident_broadcast_enablednot_eq: Unset | str = UNSET, + filterincident_broadcast_enabledin: Unset | str = UNSET, + filterincident_broadcast_enablednot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -124,7 +124,7 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[ServiceList]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> ServiceList | None: if response.status_code == 200: response_200 = ServiceList.from_dict(response.json()) @@ -136,7 +136,7 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[ServiceList]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[ServiceList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -148,39 +148,39 @@ def _build_response(*, client: Union[AuthenticatedClient, Client], response: htt def sync_detailed( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filterbackstage_id: Union[Unset, str] = UNSET, - filtercortex_id: Union[Unset, str] = UNSET, - filteropslevel_id: Union[Unset, str] = UNSET, - filterexternal_id: Union[Unset, str] = UNSET, - filteralert_broadcast_enabled: Union[Unset, bool] = UNSET, - filterincident_broadcast_enabled: Union[Unset, bool] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, - filterslugeq: Union[Unset, str] = UNSET, - filterslugnot_eq: Union[Unset, str] = UNSET, - filterslugin: Union[Unset, str] = UNSET, - filterslugnot_in: Union[Unset, str] = UNSET, - filteralert_broadcast_enabledeq: Union[Unset, str] = UNSET, - filteralert_broadcast_enablednot_eq: Union[Unset, str] = UNSET, - filteralert_broadcast_enabledin: Union[Unset, str] = UNSET, - filteralert_broadcast_enablednot_in: Union[Unset, str] = UNSET, - filterincident_broadcast_enabledeq: Union[Unset, str] = UNSET, - filterincident_broadcast_enablednot_eq: Union[Unset, str] = UNSET, - filterincident_broadcast_enabledin: Union[Unset, str] = UNSET, - filterincident_broadcast_enablednot_in: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filterbackstage_id: Unset | str = UNSET, + filtercortex_id: Unset | str = UNSET, + filteropslevel_id: Unset | str = UNSET, + filterexternal_id: Unset | str = UNSET, + filteralert_broadcast_enabled: Unset | bool = UNSET, + filterincident_broadcast_enabled: Unset | bool = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filteralert_broadcast_enabledeq: Unset | str = UNSET, + filteralert_broadcast_enablednot_eq: Unset | str = UNSET, + filteralert_broadcast_enabledin: Unset | str = UNSET, + filteralert_broadcast_enablednot_in: Unset | str = UNSET, + filterincident_broadcast_enabledeq: Unset | str = UNSET, + filterincident_broadcast_enablednot_eq: Unset | str = UNSET, + filterincident_broadcast_enabledin: Unset | str = UNSET, + filterincident_broadcast_enablednot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[ServiceList]: """List services @@ -275,40 +275,40 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filterbackstage_id: Union[Unset, str] = UNSET, - filtercortex_id: Union[Unset, str] = UNSET, - filteropslevel_id: Union[Unset, str] = UNSET, - filterexternal_id: Union[Unset, str] = UNSET, - filteralert_broadcast_enabled: Union[Unset, bool] = UNSET, - filterincident_broadcast_enabled: Union[Unset, bool] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, - filterslugeq: Union[Unset, str] = UNSET, - filterslugnot_eq: Union[Unset, str] = UNSET, - filterslugin: Union[Unset, str] = UNSET, - filterslugnot_in: Union[Unset, str] = UNSET, - filteralert_broadcast_enabledeq: Union[Unset, str] = UNSET, - filteralert_broadcast_enablednot_eq: Union[Unset, str] = UNSET, - filteralert_broadcast_enabledin: Union[Unset, str] = UNSET, - filteralert_broadcast_enablednot_in: Union[Unset, str] = UNSET, - filterincident_broadcast_enabledeq: Union[Unset, str] = UNSET, - filterincident_broadcast_enablednot_eq: Union[Unset, str] = UNSET, - filterincident_broadcast_enabledin: Union[Unset, str] = UNSET, - filterincident_broadcast_enablednot_in: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, -) -> Optional[ServiceList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filterbackstage_id: Unset | str = UNSET, + filtercortex_id: Unset | str = UNSET, + filteropslevel_id: Unset | str = UNSET, + filterexternal_id: Unset | str = UNSET, + filteralert_broadcast_enabled: Unset | bool = UNSET, + filterincident_broadcast_enabled: Unset | bool = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filteralert_broadcast_enabledeq: Unset | str = UNSET, + filteralert_broadcast_enablednot_eq: Unset | str = UNSET, + filteralert_broadcast_enabledin: Unset | str = UNSET, + filteralert_broadcast_enablednot_in: Unset | str = UNSET, + filterincident_broadcast_enabledeq: Unset | str = UNSET, + filterincident_broadcast_enablednot_eq: Unset | str = UNSET, + filterincident_broadcast_enabledin: Unset | str = UNSET, + filterincident_broadcast_enablednot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, +) -> ServiceList | None: """List services List services @@ -397,39 +397,39 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filterbackstage_id: Union[Unset, str] = UNSET, - filtercortex_id: Union[Unset, str] = UNSET, - filteropslevel_id: Union[Unset, str] = UNSET, - filterexternal_id: Union[Unset, str] = UNSET, - filteralert_broadcast_enabled: Union[Unset, bool] = UNSET, - filterincident_broadcast_enabled: Union[Unset, bool] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, - filterslugeq: Union[Unset, str] = UNSET, - filterslugnot_eq: Union[Unset, str] = UNSET, - filterslugin: Union[Unset, str] = UNSET, - filterslugnot_in: Union[Unset, str] = UNSET, - filteralert_broadcast_enabledeq: Union[Unset, str] = UNSET, - filteralert_broadcast_enablednot_eq: Union[Unset, str] = UNSET, - filteralert_broadcast_enabledin: Union[Unset, str] = UNSET, - filteralert_broadcast_enablednot_in: Union[Unset, str] = UNSET, - filterincident_broadcast_enabledeq: Union[Unset, str] = UNSET, - filterincident_broadcast_enablednot_eq: Union[Unset, str] = UNSET, - filterincident_broadcast_enabledin: Union[Unset, str] = UNSET, - filterincident_broadcast_enablednot_in: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filterbackstage_id: Unset | str = UNSET, + filtercortex_id: Unset | str = UNSET, + filteropslevel_id: Unset | str = UNSET, + filterexternal_id: Unset | str = UNSET, + filteralert_broadcast_enabled: Unset | bool = UNSET, + filterincident_broadcast_enabled: Unset | bool = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filteralert_broadcast_enabledeq: Unset | str = UNSET, + filteralert_broadcast_enablednot_eq: Unset | str = UNSET, + filteralert_broadcast_enabledin: Unset | str = UNSET, + filteralert_broadcast_enablednot_in: Unset | str = UNSET, + filterincident_broadcast_enabledeq: Unset | str = UNSET, + filterincident_broadcast_enablednot_eq: Unset | str = UNSET, + filterincident_broadcast_enabledin: Unset | str = UNSET, + filterincident_broadcast_enablednot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[ServiceList]: """List services @@ -522,40 +522,40 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filterbackstage_id: Union[Unset, str] = UNSET, - filtercortex_id: Union[Unset, str] = UNSET, - filteropslevel_id: Union[Unset, str] = UNSET, - filterexternal_id: Union[Unset, str] = UNSET, - filteralert_broadcast_enabled: Union[Unset, bool] = UNSET, - filterincident_broadcast_enabled: Union[Unset, bool] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, - filterslugeq: Union[Unset, str] = UNSET, - filterslugnot_eq: Union[Unset, str] = UNSET, - filterslugin: Union[Unset, str] = UNSET, - filterslugnot_in: Union[Unset, str] = UNSET, - filteralert_broadcast_enabledeq: Union[Unset, str] = UNSET, - filteralert_broadcast_enablednot_eq: Union[Unset, str] = UNSET, - filteralert_broadcast_enabledin: Union[Unset, str] = UNSET, - filteralert_broadcast_enablednot_in: Union[Unset, str] = UNSET, - filterincident_broadcast_enabledeq: Union[Unset, str] = UNSET, - filterincident_broadcast_enablednot_eq: Union[Unset, str] = UNSET, - filterincident_broadcast_enabledin: Union[Unset, str] = UNSET, - filterincident_broadcast_enablednot_in: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, -) -> Optional[ServiceList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filterbackstage_id: Unset | str = UNSET, + filtercortex_id: Unset | str = UNSET, + filteropslevel_id: Unset | str = UNSET, + filterexternal_id: Unset | str = UNSET, + filteralert_broadcast_enabled: Unset | bool = UNSET, + filterincident_broadcast_enabled: Unset | bool = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filteralert_broadcast_enabledeq: Unset | str = UNSET, + filteralert_broadcast_enablednot_eq: Unset | str = UNSET, + filteralert_broadcast_enabledin: Unset | str = UNSET, + filteralert_broadcast_enablednot_in: Unset | str = UNSET, + filterincident_broadcast_enabledeq: Unset | str = UNSET, + filterincident_broadcast_enablednot_eq: Unset | str = UNSET, + filterincident_broadcast_enabledin: Unset | str = UNSET, + filterincident_broadcast_enablednot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, +) -> ServiceList | None: """List services List services diff --git a/rootly_sdk/api/services/update_service.py b/rootly_sdk/api/services/update_service.py index d75507ca..23521465 100644 --- a/rootly_sdk/api/services/update_service.py +++ b/rootly_sdk/api/services/update_service.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any from uuid import UUID import httpx @@ -13,7 +13,7 @@ def _get_kwargs( - id: Union[UUID, str], + id: UUID | str, *, body: UpdateService, ) -> dict[str, Any]: @@ -33,8 +33,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, ServiceResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | ServiceResponse | None: if response.status_code == 200: response_200 = ServiceResponse.from_dict(response.json()) @@ -52,8 +52,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, ServiceResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | ServiceResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -63,11 +63,11 @@ def _build_response( def sync_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdateService, -) -> Response[Union[ErrorsList, ServiceResponse]]: +) -> Response[ErrorsList | ServiceResponse]: """Update a service Update a specific service by id @@ -97,11 +97,11 @@ def sync_detailed( def sync( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdateService, -) -> Optional[Union[ErrorsList, ServiceResponse]]: +) -> ErrorsList | ServiceResponse | None: """Update a service Update a specific service by id @@ -126,11 +126,11 @@ def sync( async def asyncio_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdateService, -) -> Response[Union[ErrorsList, ServiceResponse]]: +) -> Response[ErrorsList | ServiceResponse]: """Update a service Update a specific service by id @@ -158,11 +158,11 @@ async def asyncio_detailed( async def asyncio( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdateService, -) -> Optional[Union[ErrorsList, ServiceResponse]]: +) -> ErrorsList | ServiceResponse | None: """Update a service Update a specific service by id diff --git a/rootly_sdk/api/severities/create_severity.py b/rootly_sdk/api/severities/create_severity.py index f7c094c7..5282399a 100644 --- a/rootly_sdk/api/severities/create_severity.py +++ b/rootly_sdk/api/severities/create_severity.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, SeverityResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | SeverityResponse | None: if response.status_code == 201: response_201 = SeverityResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, SeverityResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | SeverityResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +69,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewSeverity, -) -> Response[Union[ErrorsList, SeverityResponse]]: +) -> Response[ErrorsList | SeverityResponse]: """Creates a severity Creates a new severity from provided data @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: NewSeverity, -) -> Optional[Union[ErrorsList, SeverityResponse]]: +) -> ErrorsList | SeverityResponse | None: """Creates a severity Creates a new severity from provided data @@ -126,7 +126,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewSeverity, -) -> Response[Union[ErrorsList, SeverityResponse]]: +) -> Response[ErrorsList | SeverityResponse]: """Creates a severity Creates a new severity from provided data @@ -155,7 +155,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewSeverity, -) -> Optional[Union[ErrorsList, SeverityResponse]]: +) -> ErrorsList | SeverityResponse | None: """Creates a severity Creates a new severity from provided data diff --git a/rootly_sdk/api/severities/delete_severity.py b/rootly_sdk/api/severities/delete_severity.py index 908fa1be..53aa6ffe 100644 --- a/rootly_sdk/api/severities/delete_severity.py +++ b/rootly_sdk/api/severities/delete_severity.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any from uuid import UUID import httpx @@ -12,7 +12,7 @@ def _get_kwargs( - id: Union[UUID, str], + id: UUID | str, ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "delete", @@ -23,8 +23,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, SeverityResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | SeverityResponse | None: if response.status_code == 200: response_200 = SeverityResponse.from_dict(response.json()) @@ -42,8 +42,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, SeverityResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | SeverityResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -53,10 +53,10 @@ def _build_response( def sync_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, SeverityResponse]]: +) -> Response[ErrorsList | SeverityResponse]: """Delete a severity Delete a specific severity by id @@ -84,10 +84,10 @@ def sync_detailed( def sync( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, SeverityResponse]]: +) -> ErrorsList | SeverityResponse | None: """Delete a severity Delete a specific severity by id @@ -110,10 +110,10 @@ def sync( async def asyncio_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, SeverityResponse]]: +) -> Response[ErrorsList | SeverityResponse]: """Delete a severity Delete a specific severity by id @@ -139,10 +139,10 @@ async def asyncio_detailed( async def asyncio( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, SeverityResponse]]: +) -> ErrorsList | SeverityResponse | None: """Delete a severity Delete a specific severity by id diff --git a/rootly_sdk/api/severities/get_severity.py b/rootly_sdk/api/severities/get_severity.py index e054f225..cf85c9b3 100644 --- a/rootly_sdk/api/severities/get_severity.py +++ b/rootly_sdk/api/severities/get_severity.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any from uuid import UUID import httpx @@ -12,7 +12,7 @@ def _get_kwargs( - id: Union[UUID, str], + id: UUID | str, ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "get", @@ -23,8 +23,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, SeverityResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | SeverityResponse | None: if response.status_code == 200: response_200 = SeverityResponse.from_dict(response.json()) @@ -42,8 +42,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, SeverityResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | SeverityResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -53,10 +53,10 @@ def _build_response( def sync_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, SeverityResponse]]: +) -> Response[ErrorsList | SeverityResponse]: """Retrieves a severity Retrieves a specific severity by id @@ -84,10 +84,10 @@ def sync_detailed( def sync( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, SeverityResponse]]: +) -> ErrorsList | SeverityResponse | None: """Retrieves a severity Retrieves a specific severity by id @@ -110,10 +110,10 @@ def sync( async def asyncio_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, SeverityResponse]]: +) -> Response[ErrorsList | SeverityResponse]: """Retrieves a severity Retrieves a specific severity by id @@ -139,10 +139,10 @@ async def asyncio_detailed( async def asyncio( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, SeverityResponse]]: +) -> ErrorsList | SeverityResponse | None: """Retrieves a severity Retrieves a specific severity by id diff --git a/rootly_sdk/api/severities/list_severities.py b/rootly_sdk/api/severities/list_severities.py index c0f47c57..221516df 100644 --- a/rootly_sdk/api/severities/list_severities.py +++ b/rootly_sdk/api/severities/list_severities.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -11,35 +11,35 @@ def _get_kwargs( *, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterseverity: Union[Unset, str] = UNSET, - filtercolor: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filterslugeq: Union[Unset, str] = UNSET, - filterslugnot_eq: Union[Unset, str] = UNSET, - filterslugin: Union[Unset, str] = UNSET, - filterslugnot_in: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, - filterseverityeq: Union[Unset, str] = UNSET, - filterseveritynot_eq: Union[Unset, str] = UNSET, - filterseverityin: Union[Unset, str] = UNSET, - filterseveritynot_in: Union[Unset, str] = UNSET, - filtercoloreq: Union[Unset, str] = UNSET, - filtercolornot_eq: Union[Unset, str] = UNSET, - filtercolorin: Union[Unset, str] = UNSET, - filtercolornot_in: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterseverity: Unset | str = UNSET, + filtercolor: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filterseverityeq: Unset | str = UNSET, + filterseveritynot_eq: Unset | str = UNSET, + filterseverityin: Unset | str = UNSET, + filterseveritynot_in: Unset | str = UNSET, + filtercoloreq: Unset | str = UNSET, + filtercolornot_eq: Unset | str = UNSET, + filtercolorin: Unset | str = UNSET, + filtercolornot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -112,7 +112,7 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[SeverityList]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> SeverityList | None: if response.status_code == 200: response_200 = SeverityList.from_dict(response.json()) @@ -124,7 +124,7 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[SeverityList]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[SeverityList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -136,35 +136,35 @@ def _build_response(*, client: Union[AuthenticatedClient, Client], response: htt def sync_detailed( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterseverity: Union[Unset, str] = UNSET, - filtercolor: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filterslugeq: Union[Unset, str] = UNSET, - filterslugnot_eq: Union[Unset, str] = UNSET, - filterslugin: Union[Unset, str] = UNSET, - filterslugnot_in: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, - filterseverityeq: Union[Unset, str] = UNSET, - filterseveritynot_eq: Union[Unset, str] = UNSET, - filterseverityin: Union[Unset, str] = UNSET, - filterseveritynot_in: Union[Unset, str] = UNSET, - filtercoloreq: Union[Unset, str] = UNSET, - filtercolornot_eq: Union[Unset, str] = UNSET, - filtercolorin: Union[Unset, str] = UNSET, - filtercolornot_in: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterseverity: Unset | str = UNSET, + filtercolor: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filterseverityeq: Unset | str = UNSET, + filterseveritynot_eq: Unset | str = UNSET, + filterseverityin: Unset | str = UNSET, + filterseveritynot_in: Unset | str = UNSET, + filtercoloreq: Unset | str = UNSET, + filtercolornot_eq: Unset | str = UNSET, + filtercolorin: Unset | str = UNSET, + filtercolornot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[SeverityList]: """List severities @@ -251,36 +251,36 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterseverity: Union[Unset, str] = UNSET, - filtercolor: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filterslugeq: Union[Unset, str] = UNSET, - filterslugnot_eq: Union[Unset, str] = UNSET, - filterslugin: Union[Unset, str] = UNSET, - filterslugnot_in: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, - filterseverityeq: Union[Unset, str] = UNSET, - filterseveritynot_eq: Union[Unset, str] = UNSET, - filterseverityin: Union[Unset, str] = UNSET, - filterseveritynot_in: Union[Unset, str] = UNSET, - filtercoloreq: Union[Unset, str] = UNSET, - filtercolornot_eq: Union[Unset, str] = UNSET, - filtercolorin: Union[Unset, str] = UNSET, - filtercolornot_in: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, -) -> Optional[SeverityList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterseverity: Unset | str = UNSET, + filtercolor: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filterseverityeq: Unset | str = UNSET, + filterseveritynot_eq: Unset | str = UNSET, + filterseverityin: Unset | str = UNSET, + filterseveritynot_in: Unset | str = UNSET, + filtercoloreq: Unset | str = UNSET, + filtercolornot_eq: Unset | str = UNSET, + filtercolorin: Unset | str = UNSET, + filtercolornot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, +) -> SeverityList | None: """List severities List severities @@ -361,35 +361,35 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterseverity: Union[Unset, str] = UNSET, - filtercolor: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filterslugeq: Union[Unset, str] = UNSET, - filterslugnot_eq: Union[Unset, str] = UNSET, - filterslugin: Union[Unset, str] = UNSET, - filterslugnot_in: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, - filterseverityeq: Union[Unset, str] = UNSET, - filterseveritynot_eq: Union[Unset, str] = UNSET, - filterseverityin: Union[Unset, str] = UNSET, - filterseveritynot_in: Union[Unset, str] = UNSET, - filtercoloreq: Union[Unset, str] = UNSET, - filtercolornot_eq: Union[Unset, str] = UNSET, - filtercolorin: Union[Unset, str] = UNSET, - filtercolornot_in: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterseverity: Unset | str = UNSET, + filtercolor: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filterseverityeq: Unset | str = UNSET, + filterseveritynot_eq: Unset | str = UNSET, + filterseverityin: Unset | str = UNSET, + filterseveritynot_in: Unset | str = UNSET, + filtercoloreq: Unset | str = UNSET, + filtercolornot_eq: Unset | str = UNSET, + filtercolorin: Unset | str = UNSET, + filtercolornot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[SeverityList]: """List severities @@ -474,36 +474,36 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterseverity: Union[Unset, str] = UNSET, - filtercolor: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filterslugeq: Union[Unset, str] = UNSET, - filterslugnot_eq: Union[Unset, str] = UNSET, - filterslugin: Union[Unset, str] = UNSET, - filterslugnot_in: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, - filterseverityeq: Union[Unset, str] = UNSET, - filterseveritynot_eq: Union[Unset, str] = UNSET, - filterseverityin: Union[Unset, str] = UNSET, - filterseveritynot_in: Union[Unset, str] = UNSET, - filtercoloreq: Union[Unset, str] = UNSET, - filtercolornot_eq: Union[Unset, str] = UNSET, - filtercolorin: Union[Unset, str] = UNSET, - filtercolornot_in: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, -) -> Optional[SeverityList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterseverity: Unset | str = UNSET, + filtercolor: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filterseverityeq: Unset | str = UNSET, + filterseveritynot_eq: Unset | str = UNSET, + filterseverityin: Unset | str = UNSET, + filterseveritynot_in: Unset | str = UNSET, + filtercoloreq: Unset | str = UNSET, + filtercolornot_eq: Unset | str = UNSET, + filtercolorin: Unset | str = UNSET, + filtercolornot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, +) -> SeverityList | None: """List severities List severities diff --git a/rootly_sdk/api/severities/update_severity.py b/rootly_sdk/api/severities/update_severity.py index 900f77d4..552576b1 100644 --- a/rootly_sdk/api/severities/update_severity.py +++ b/rootly_sdk/api/severities/update_severity.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any from uuid import UUID import httpx @@ -13,7 +13,7 @@ def _get_kwargs( - id: Union[UUID, str], + id: UUID | str, *, body: UpdateSeverity, ) -> dict[str, Any]: @@ -33,8 +33,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, SeverityResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | SeverityResponse | None: if response.status_code == 200: response_200 = SeverityResponse.from_dict(response.json()) @@ -52,8 +52,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, SeverityResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | SeverityResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -63,11 +63,11 @@ def _build_response( def sync_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdateSeverity, -) -> Response[Union[ErrorsList, SeverityResponse]]: +) -> Response[ErrorsList | SeverityResponse]: """Update a severity Update a specific severity by id @@ -97,11 +97,11 @@ def sync_detailed( def sync( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdateSeverity, -) -> Optional[Union[ErrorsList, SeverityResponse]]: +) -> ErrorsList | SeverityResponse | None: """Update a severity Update a specific severity by id @@ -126,11 +126,11 @@ def sync( async def asyncio_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdateSeverity, -) -> Response[Union[ErrorsList, SeverityResponse]]: +) -> Response[ErrorsList | SeverityResponse]: """Update a severity Update a specific severity by id @@ -158,11 +158,11 @@ async def asyncio_detailed( async def asyncio( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdateSeverity, -) -> Optional[Union[ErrorsList, SeverityResponse]]: +) -> ErrorsList | SeverityResponse | None: """Update a severity Update a specific severity by id diff --git a/rootly_sdk/api/shift_coverage_requests/create_shift_coverage_request.py b/rootly_sdk/api/shift_coverage_requests/create_shift_coverage_request.py index 6ff99b3e..7c89bc56 100644 --- a/rootly_sdk/api/shift_coverage_requests/create_shift_coverage_request.py +++ b/rootly_sdk/api/shift_coverage_requests/create_shift_coverage_request.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, ShiftCoverageRequestList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | ShiftCoverageRequestList | None: if response.status_code == 201: response_201 = ShiftCoverageRequestList.from_dict(response.json()) @@ -51,8 +51,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, ShiftCoverageRequestList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | ShiftCoverageRequestList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewShiftCoverageRequest, -) -> Response[Union[ErrorsList, ShiftCoverageRequestList]]: +) -> Response[ErrorsList | ShiftCoverageRequestList]: """creates shift coverage requests Creates coverage requests for the shifts overlapping the requested time range. A range can span @@ -103,7 +103,7 @@ def sync( *, client: AuthenticatedClient, body: NewShiftCoverageRequest, -) -> Optional[Union[ErrorsList, ShiftCoverageRequestList]]: +) -> ErrorsList | ShiftCoverageRequestList | None: """creates shift coverage requests Creates coverage requests for the shifts overlapping the requested time range. A range can span @@ -135,7 +135,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewShiftCoverageRequest, -) -> Response[Union[ErrorsList, ShiftCoverageRequestList]]: +) -> Response[ErrorsList | ShiftCoverageRequestList]: """creates shift coverage requests Creates coverage requests for the shifts overlapping the requested time range. A range can span @@ -170,7 +170,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewShiftCoverageRequest, -) -> Optional[Union[ErrorsList, ShiftCoverageRequestList]]: +) -> ErrorsList | ShiftCoverageRequestList | None: """creates shift coverage requests Creates coverage requests for the shifts overlapping the requested time range. A range can span diff --git a/rootly_sdk/api/shift_coverage_requests/delete_shift_coverage_request.py b/rootly_sdk/api/shift_coverage_requests/delete_shift_coverage_request.py index ad36be34..bd91309d 100644 --- a/rootly_sdk/api/shift_coverage_requests/delete_shift_coverage_request.py +++ b/rootly_sdk/api/shift_coverage_requests/delete_shift_coverage_request.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -21,8 +21,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[ShiftCoverageRequestResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ShiftCoverageRequestResponse | None: if response.status_code == 200: response_200 = ShiftCoverageRequestResponse.from_dict(response.json()) @@ -35,7 +35,7 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response + *, client: AuthenticatedClient | Client, response: httpx.Response ) -> Response[ShiftCoverageRequestResponse]: return Response( status_code=HTTPStatus(response.status_code), @@ -80,7 +80,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[ShiftCoverageRequestResponse]: +) -> ShiftCoverageRequestResponse | None: """deletes a shift coverage request Deletes a shift coverage request. @@ -135,7 +135,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[ShiftCoverageRequestResponse]: +) -> ShiftCoverageRequestResponse | None: """deletes a shift coverage request Deletes a shift coverage request. diff --git a/rootly_sdk/api/shift_coverage_requests/get_shift_coverage_request.py b/rootly_sdk/api/shift_coverage_requests/get_shift_coverage_request.py index 3309d75b..b2ef0c39 100644 --- a/rootly_sdk/api/shift_coverage_requests/get_shift_coverage_request.py +++ b/rootly_sdk/api/shift_coverage_requests/get_shift_coverage_request.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -21,8 +21,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[ShiftCoverageRequestResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ShiftCoverageRequestResponse | None: if response.status_code == 200: response_200 = ShiftCoverageRequestResponse.from_dict(response.json()) @@ -35,7 +35,7 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response + *, client: AuthenticatedClient | Client, response: httpx.Response ) -> Response[ShiftCoverageRequestResponse]: return Response( status_code=HTTPStatus(response.status_code), @@ -80,7 +80,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[ShiftCoverageRequestResponse]: +) -> ShiftCoverageRequestResponse | None: """retrieves a shift coverage request Retrieves a specific shift coverage request. @@ -135,7 +135,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[ShiftCoverageRequestResponse]: +) -> ShiftCoverageRequestResponse | None: """retrieves a shift coverage request Retrieves a specific shift coverage request. diff --git a/rootly_sdk/api/shift_coverage_requests/list_shift_coverage_requests.py b/rootly_sdk/api/shift_coverage_requests/list_shift_coverage_requests.py index 5e118cd4..8f2a905e 100644 --- a/rootly_sdk/api/shift_coverage_requests/list_shift_coverage_requests.py +++ b/rootly_sdk/api/shift_coverage_requests/list_shift_coverage_requests.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -21,8 +21,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[ShiftCoverageRequestList]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ShiftCoverageRequestList | None: if response.status_code == 200: response_200 = ShiftCoverageRequestList.from_dict(response.json()) @@ -35,7 +35,7 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response + *, client: AuthenticatedClient | Client, response: httpx.Response ) -> Response[ShiftCoverageRequestList]: return Response( status_code=HTTPStatus(response.status_code), @@ -80,7 +80,7 @@ def sync( schedule_id: str, *, client: AuthenticatedClient, -) -> Optional[ShiftCoverageRequestList]: +) -> ShiftCoverageRequestList | None: """list shift coverage requests List active shift coverage requests for a schedule. @@ -135,7 +135,7 @@ async def asyncio( schedule_id: str, *, client: AuthenticatedClient, -) -> Optional[ShiftCoverageRequestList]: +) -> ShiftCoverageRequestList | None: """list shift coverage requests List active shift coverage requests for a schedule. diff --git a/rootly_sdk/api/shifts/get_schedule_shifts.py b/rootly_sdk/api/shifts/get_schedule_shifts.py index f1f858fd..baf5f6bb 100644 --- a/rootly_sdk/api/shifts/get_schedule_shifts.py +++ b/rootly_sdk/api/shifts/get_schedule_shifts.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -13,8 +13,8 @@ def _get_kwargs( id: str, *, - to: Union[Unset, str] = UNSET, - from_: Union[Unset, str] = UNSET, + to: Unset | str = UNSET, + from_: Unset | str = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -33,9 +33,7 @@ def _get_kwargs( return _kwargs -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, ShiftList]]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> ErrorsList | ShiftList | None: if response.status_code == 200: response_200 = ShiftList.from_dict(response.json()) @@ -53,8 +51,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, ShiftList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | ShiftList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -67,9 +65,9 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, - to: Union[Unset, str] = UNSET, - from_: Union[Unset, str] = UNSET, -) -> Response[Union[ErrorsList, ShiftList]]: + to: Unset | str = UNSET, + from_: Unset | str = UNSET, +) -> Response[ErrorsList | ShiftList]: """Retrieves a schedule shifts Retrieves schedule shifts @@ -104,9 +102,9 @@ def sync( id: str, *, client: AuthenticatedClient, - to: Union[Unset, str] = UNSET, - from_: Union[Unset, str] = UNSET, -) -> Optional[Union[ErrorsList, ShiftList]]: + to: Unset | str = UNSET, + from_: Unset | str = UNSET, +) -> ErrorsList | ShiftList | None: """Retrieves a schedule shifts Retrieves schedule shifts @@ -136,9 +134,9 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, - to: Union[Unset, str] = UNSET, - from_: Union[Unset, str] = UNSET, -) -> Response[Union[ErrorsList, ShiftList]]: + to: Unset | str = UNSET, + from_: Unset | str = UNSET, +) -> Response[ErrorsList | ShiftList]: """Retrieves a schedule shifts Retrieves schedule shifts @@ -171,9 +169,9 @@ async def asyncio( id: str, *, client: AuthenticatedClient, - to: Union[Unset, str] = UNSET, - from_: Union[Unset, str] = UNSET, -) -> Optional[Union[ErrorsList, ShiftList]]: + to: Unset | str = UNSET, + from_: Unset | str = UNSET, +) -> ErrorsList | ShiftList | None: """Retrieves a schedule shifts Retrieves schedule shifts diff --git a/rootly_sdk/api/shifts/list_shifts.py b/rootly_sdk/api/shifts/list_shifts.py index 8af3168b..6ee43619 100644 --- a/rootly_sdk/api/shifts/list_shifts.py +++ b/rootly_sdk/api/shifts/list_shifts.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -13,17 +13,17 @@ def _get_kwargs( *, - include: Union[Unset, ListShiftsInclude] = UNSET, - from_: Union[Unset, str] = UNSET, - to: Union[Unset, str] = UNSET, - user_ids: Union[Unset, list[int]] = UNSET, - schedule_ids: Union[Unset, list[str]] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + include: Unset | ListShiftsInclude = UNSET, + from_: Unset | str = UNSET, + to: Unset | str = UNSET, + user_ids: Unset | list[int] = UNSET, + schedule_ids: Unset | list[str] = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} - json_include: Union[Unset, str] = UNSET + json_include: Unset | str = UNSET if not isinstance(include, Unset): json_include = include @@ -33,13 +33,13 @@ def _get_kwargs( params["to"] = to - json_user_ids: Union[Unset, list[int]] = UNSET + json_user_ids: Unset | list[int] = UNSET if not isinstance(user_ids, Unset): json_user_ids = user_ids params["user_ids[]"] = json_user_ids - json_schedule_ids: Union[Unset, list[str]] = UNSET + json_schedule_ids: Unset | list[str] = UNSET if not isinstance(schedule_ids, Unset): json_schedule_ids = schedule_ids @@ -60,9 +60,7 @@ def _get_kwargs( return _kwargs -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, ShiftList]]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> ErrorsList | ShiftList | None: if response.status_code == 200: response_200 = ShiftList.from_dict(response.json()) @@ -80,8 +78,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, ShiftList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | ShiftList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -93,14 +91,14 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - include: Union[Unset, ListShiftsInclude] = UNSET, - from_: Union[Unset, str] = UNSET, - to: Union[Unset, str] = UNSET, - user_ids: Union[Unset, list[int]] = UNSET, - schedule_ids: Union[Unset, list[str]] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, -) -> Response[Union[ErrorsList, ShiftList]]: + include: Unset | ListShiftsInclude = UNSET, + from_: Unset | str = UNSET, + to: Unset | str = UNSET, + user_ids: Unset | list[int] = UNSET, + schedule_ids: Unset | list[str] = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, +) -> Response[ErrorsList | ShiftList]: """List shifts List shifts @@ -142,14 +140,14 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: Union[Unset, ListShiftsInclude] = UNSET, - from_: Union[Unset, str] = UNSET, - to: Union[Unset, str] = UNSET, - user_ids: Union[Unset, list[int]] = UNSET, - schedule_ids: Union[Unset, list[str]] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, -) -> Optional[Union[ErrorsList, ShiftList]]: + include: Unset | ListShiftsInclude = UNSET, + from_: Unset | str = UNSET, + to: Unset | str = UNSET, + user_ids: Unset | list[int] = UNSET, + schedule_ids: Unset | list[str] = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, +) -> ErrorsList | ShiftList | None: """List shifts List shifts @@ -186,14 +184,14 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: Union[Unset, ListShiftsInclude] = UNSET, - from_: Union[Unset, str] = UNSET, - to: Union[Unset, str] = UNSET, - user_ids: Union[Unset, list[int]] = UNSET, - schedule_ids: Union[Unset, list[str]] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, -) -> Response[Union[ErrorsList, ShiftList]]: + include: Unset | ListShiftsInclude = UNSET, + from_: Unset | str = UNSET, + to: Unset | str = UNSET, + user_ids: Unset | list[int] = UNSET, + schedule_ids: Unset | list[str] = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, +) -> Response[ErrorsList | ShiftList]: """List shifts List shifts @@ -233,14 +231,14 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: Union[Unset, ListShiftsInclude] = UNSET, - from_: Union[Unset, str] = UNSET, - to: Union[Unset, str] = UNSET, - user_ids: Union[Unset, list[int]] = UNSET, - schedule_ids: Union[Unset, list[str]] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, -) -> Optional[Union[ErrorsList, ShiftList]]: + include: Unset | ListShiftsInclude = UNSET, + from_: Unset | str = UNSET, + to: Unset | str = UNSET, + user_ids: Unset | list[int] = UNSET, + schedule_ids: Unset | list[str] = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, +) -> ErrorsList | ShiftList | None: """List shifts List shifts diff --git a/rootly_sdk/api/sl_as/create_sla.py b/rootly_sdk/api/sl_as/create_sla.py index 6a5a53a1..338f3be4 100644 --- a/rootly_sdk/api/sl_as/create_sla.py +++ b/rootly_sdk/api/sl_as/create_sla.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, SlaResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | SlaResponse | None: if response.status_code == 201: response_201 = SlaResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, SlaResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | SlaResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +69,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewSla, -) -> Response[Union[ErrorsList, SlaResponse]]: +) -> Response[ErrorsList | SlaResponse]: """Creates an SLA Creates a new SLA from provided data @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: NewSla, -) -> Optional[Union[ErrorsList, SlaResponse]]: +) -> ErrorsList | SlaResponse | None: """Creates an SLA Creates a new SLA from provided data @@ -126,7 +126,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewSla, -) -> Response[Union[ErrorsList, SlaResponse]]: +) -> Response[ErrorsList | SlaResponse]: """Creates an SLA Creates a new SLA from provided data @@ -155,7 +155,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewSla, -) -> Optional[Union[ErrorsList, SlaResponse]]: +) -> ErrorsList | SlaResponse | None: """Creates an SLA Creates a new SLA from provided data diff --git a/rootly_sdk/api/sl_as/delete_sla.py b/rootly_sdk/api/sl_as/delete_sla.py index 0b9a5ae8..97174330 100644 --- a/rootly_sdk/api/sl_as/delete_sla.py +++ b/rootly_sdk/api/sl_as/delete_sla.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, SlaResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | SlaResponse | None: if response.status_code == 200: response_200 = SlaResponse.from_dict(response.json()) @@ -41,8 +41,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, SlaResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | SlaResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -55,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, SlaResponse]]: +) -> Response[ErrorsList | SlaResponse]: """Delete an SLA Delete a specific SLA by id @@ -86,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, SlaResponse]]: +) -> ErrorsList | SlaResponse | None: """Delete an SLA Delete a specific SLA by id @@ -112,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, SlaResponse]]: +) -> Response[ErrorsList | SlaResponse]: """Delete an SLA Delete a specific SLA by id @@ -141,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, SlaResponse]]: +) -> ErrorsList | SlaResponse | None: """Delete an SLA Delete a specific SLA by id diff --git a/rootly_sdk/api/sl_as/get_sla.py b/rootly_sdk/api/sl_as/get_sla.py index 4ebaae43..8cf0f064 100644 --- a/rootly_sdk/api/sl_as/get_sla.py +++ b/rootly_sdk/api/sl_as/get_sla.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, SlaResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | SlaResponse | None: if response.status_code == 200: response_200 = SlaResponse.from_dict(response.json()) @@ -41,8 +41,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, SlaResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | SlaResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -55,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, SlaResponse]]: +) -> Response[ErrorsList | SlaResponse]: """Retrieves an SLA Retrieves a specific SLA by id @@ -86,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, SlaResponse]]: +) -> ErrorsList | SlaResponse | None: """Retrieves an SLA Retrieves a specific SLA by id @@ -112,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, SlaResponse]]: +) -> Response[ErrorsList | SlaResponse]: """Retrieves an SLA Retrieves a specific SLA by id @@ -141,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, SlaResponse]]: +) -> ErrorsList | SlaResponse | None: """Retrieves an SLA Retrieves a specific SLA by id diff --git a/rootly_sdk/api/sl_as/list_sl_as.py b/rootly_sdk/api/sl_as/list_sl_as.py index 6c9e7694..25cca503 100644 --- a/rootly_sdk/api/sl_as/list_sl_as.py +++ b/rootly_sdk/api/sl_as/list_sl_as.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -11,24 +11,24 @@ def _get_kwargs( *, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filterslugeq: Union[Unset, str] = UNSET, - filterslugnot_eq: Union[Unset, str] = UNSET, - filterslugin: Union[Unset, str] = UNSET, - filterslugnot_in: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -79,7 +79,7 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[SlaList]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> SlaList | None: if response.status_code == 200: response_200 = SlaList.from_dict(response.json()) @@ -91,7 +91,7 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[SlaList]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[SlaList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -103,24 +103,24 @@ def _build_response(*, client: Union[AuthenticatedClient, Client], response: htt def sync_detailed( *, client: AuthenticatedClient, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filterslugeq: Union[Unset, str] = UNSET, - filterslugnot_eq: Union[Unset, str] = UNSET, - filterslugin: Union[Unset, str] = UNSET, - filterslugnot_in: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[SlaList]: """List SLAs @@ -185,25 +185,25 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filterslugeq: Union[Unset, str] = UNSET, - filterslugnot_eq: Union[Unset, str] = UNSET, - filterslugin: Union[Unset, str] = UNSET, - filterslugnot_in: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, -) -> Optional[SlaList]: + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, +) -> SlaList | None: """List SLAs List SLAs @@ -262,24 +262,24 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filterslugeq: Union[Unset, str] = UNSET, - filterslugnot_eq: Union[Unset, str] = UNSET, - filterslugin: Union[Unset, str] = UNSET, - filterslugnot_in: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[SlaList]: """List SLAs @@ -342,25 +342,25 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filterslugeq: Union[Unset, str] = UNSET, - filterslugnot_eq: Union[Unset, str] = UNSET, - filterslugin: Union[Unset, str] = UNSET, - filterslugnot_in: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, -) -> Optional[SlaList]: + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, +) -> SlaList | None: """List SLAs List SLAs diff --git a/rootly_sdk/api/sl_as/update_sla.py b/rootly_sdk/api/sl_as/update_sla.py index b23291a7..25d81a75 100644 --- a/rootly_sdk/api/sl_as/update_sla.py +++ b/rootly_sdk/api/sl_as/update_sla.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, SlaResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | SlaResponse | None: if response.status_code == 200: response_200 = SlaResponse.from_dict(response.json()) @@ -51,8 +51,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, SlaResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | SlaResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateSla, -) -> Response[Union[ErrorsList, SlaResponse]]: +) -> Response[ErrorsList | SlaResponse]: """Update an SLA Update a specific SLA by id @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateSla, -) -> Optional[Union[ErrorsList, SlaResponse]]: +) -> ErrorsList | SlaResponse | None: """Update an SLA Update a specific SLA by id @@ -129,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateSla, -) -> Response[Union[ErrorsList, SlaResponse]]: +) -> Response[ErrorsList | SlaResponse]: """Update an SLA Update a specific SLA by id @@ -161,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateSla, -) -> Optional[Union[ErrorsList, SlaResponse]]: +) -> ErrorsList | SlaResponse | None: """Update an SLA Update a specific SLA by id diff --git a/rootly_sdk/api/status_page_announcements/create_status_page_announcement.py b/rootly_sdk/api/status_page_announcements/create_status_page_announcement.py index 390347ba..c15ef8e3 100644 --- a/rootly_sdk/api/status_page_announcements/create_status_page_announcement.py +++ b/rootly_sdk/api/status_page_announcements/create_status_page_announcement.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, StatusPageAnnouncementResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | StatusPageAnnouncementResponse | None: if response.status_code == 201: response_201 = StatusPageAnnouncementResponse.from_dict(response.json()) @@ -56,8 +56,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, StatusPageAnnouncementResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | StatusPageAnnouncementResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -71,7 +71,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewStatusPageAnnouncement, -) -> Response[Union[ErrorsList, StatusPageAnnouncementResponse]]: +) -> Response[ErrorsList | StatusPageAnnouncementResponse]: """Creates a status page announcement Posts an announcement to a status page and notifies its subscribers unless notify_subscribers is @@ -106,7 +106,7 @@ def sync( *, client: AuthenticatedClient, body: NewStatusPageAnnouncement, -) -> Optional[Union[ErrorsList, StatusPageAnnouncementResponse]]: +) -> ErrorsList | StatusPageAnnouncementResponse | None: """Creates a status page announcement Posts an announcement to a status page and notifies its subscribers unless notify_subscribers is @@ -136,7 +136,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewStatusPageAnnouncement, -) -> Response[Union[ErrorsList, StatusPageAnnouncementResponse]]: +) -> Response[ErrorsList | StatusPageAnnouncementResponse]: """Creates a status page announcement Posts an announcement to a status page and notifies its subscribers unless notify_subscribers is @@ -169,7 +169,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewStatusPageAnnouncement, -) -> Optional[Union[ErrorsList, StatusPageAnnouncementResponse]]: +) -> ErrorsList | StatusPageAnnouncementResponse | None: """Creates a status page announcement Posts an announcement to a status page and notifies its subscribers unless notify_subscribers is diff --git a/rootly_sdk/api/status_page_announcements/delete_status_page_announcement.py b/rootly_sdk/api/status_page_announcements/delete_status_page_announcement.py index 542649c9..1314cc77 100644 --- a/rootly_sdk/api/status_page_announcements/delete_status_page_announcement.py +++ b/rootly_sdk/api/status_page_announcements/delete_status_page_announcement.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, StatusPageAnnouncementResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | StatusPageAnnouncementResponse | None: if response.status_code == 200: response_200 = StatusPageAnnouncementResponse.from_dict(response.json()) @@ -41,8 +41,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, StatusPageAnnouncementResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | StatusPageAnnouncementResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -55,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, StatusPageAnnouncementResponse]]: +) -> Response[ErrorsList | StatusPageAnnouncementResponse]: """Delete a status page announcement Delete a specific status page announcement by id @@ -86,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, StatusPageAnnouncementResponse]]: +) -> ErrorsList | StatusPageAnnouncementResponse | None: """Delete a status page announcement Delete a specific status page announcement by id @@ -112,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, StatusPageAnnouncementResponse]]: +) -> Response[ErrorsList | StatusPageAnnouncementResponse]: """Delete a status page announcement Delete a specific status page announcement by id @@ -141,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, StatusPageAnnouncementResponse]]: +) -> ErrorsList | StatusPageAnnouncementResponse | None: """Delete a status page announcement Delete a specific status page announcement by id diff --git a/rootly_sdk/api/status_page_announcements/get_status_page_announcement.py b/rootly_sdk/api/status_page_announcements/get_status_page_announcement.py index 1c6c6bd8..bc616232 100644 --- a/rootly_sdk/api/status_page_announcements/get_status_page_announcement.py +++ b/rootly_sdk/api/status_page_announcements/get_status_page_announcement.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, StatusPageAnnouncementResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | StatusPageAnnouncementResponse | None: if response.status_code == 200: response_200 = StatusPageAnnouncementResponse.from_dict(response.json()) @@ -41,8 +41,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, StatusPageAnnouncementResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | StatusPageAnnouncementResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -55,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, StatusPageAnnouncementResponse]]: +) -> Response[ErrorsList | StatusPageAnnouncementResponse]: """Retrieves a status page announcement Retrieves a specific status page announcement by id @@ -86,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, StatusPageAnnouncementResponse]]: +) -> ErrorsList | StatusPageAnnouncementResponse | None: """Retrieves a status page announcement Retrieves a specific status page announcement by id @@ -112,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, StatusPageAnnouncementResponse]]: +) -> Response[ErrorsList | StatusPageAnnouncementResponse]: """Retrieves a status page announcement Retrieves a specific status page announcement by id @@ -141,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, StatusPageAnnouncementResponse]]: +) -> ErrorsList | StatusPageAnnouncementResponse | None: """Retrieves a status page announcement Retrieves a specific status page announcement by id diff --git a/rootly_sdk/api/status_page_announcements/list_status_page_announcements.py b/rootly_sdk/api/status_page_announcements/list_status_page_announcements.py index 1088c155..2bc98e02 100644 --- a/rootly_sdk/api/status_page_announcements/list_status_page_announcements.py +++ b/rootly_sdk/api/status_page_announcements/list_status_page_announcements.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -12,9 +12,9 @@ def _get_kwargs( status_page_id: str, *, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -36,8 +36,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[StatusPageAnnouncementList]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> StatusPageAnnouncementList | None: if response.status_code == 200: response_200 = StatusPageAnnouncementList.from_dict(response.json()) @@ -50,7 +50,7 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response + *, client: AuthenticatedClient | Client, response: httpx.Response ) -> Response[StatusPageAnnouncementList]: return Response( status_code=HTTPStatus(response.status_code), @@ -64,9 +64,9 @@ def sync_detailed( status_page_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[StatusPageAnnouncementList]: """List status page announcements @@ -104,10 +104,10 @@ def sync( status_page_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, -) -> Optional[StatusPageAnnouncementList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, +) -> StatusPageAnnouncementList | None: """List status page announcements List status page announcements @@ -139,9 +139,9 @@ async def asyncio_detailed( status_page_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[StatusPageAnnouncementList]: """List status page announcements @@ -177,10 +177,10 @@ async def asyncio( status_page_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, -) -> Optional[StatusPageAnnouncementList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, +) -> StatusPageAnnouncementList | None: """List status page announcements List status page announcements diff --git a/rootly_sdk/api/status_page_announcements/update_status_page_announcement.py b/rootly_sdk/api/status_page_announcements/update_status_page_announcement.py index a2cb8335..85139011 100644 --- a/rootly_sdk/api/status_page_announcements/update_status_page_announcement.py +++ b/rootly_sdk/api/status_page_announcements/update_status_page_announcement.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, StatusPageAnnouncementResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | StatusPageAnnouncementResponse | None: if response.status_code == 200: response_200 = StatusPageAnnouncementResponse.from_dict(response.json()) @@ -51,8 +51,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, StatusPageAnnouncementResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | StatusPageAnnouncementResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateStatusPageAnnouncement, -) -> Response[Union[ErrorsList, StatusPageAnnouncementResponse]]: +) -> Response[ErrorsList | StatusPageAnnouncementResponse]: """Update a status page announcement Update a specific status page announcement by id @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateStatusPageAnnouncement, -) -> Optional[Union[ErrorsList, StatusPageAnnouncementResponse]]: +) -> ErrorsList | StatusPageAnnouncementResponse | None: """Update a status page announcement Update a specific status page announcement by id @@ -129,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateStatusPageAnnouncement, -) -> Response[Union[ErrorsList, StatusPageAnnouncementResponse]]: +) -> Response[ErrorsList | StatusPageAnnouncementResponse]: """Update a status page announcement Update a specific status page announcement by id @@ -161,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateStatusPageAnnouncement, -) -> Optional[Union[ErrorsList, StatusPageAnnouncementResponse]]: +) -> ErrorsList | StatusPageAnnouncementResponse | None: """Update a status page announcement Update a specific status page announcement by id diff --git a/rootly_sdk/api/status_page_component_groups/create_status_page_component_group.py b/rootly_sdk/api/status_page_component_groups/create_status_page_component_group.py index 0070a911..62f8a188 100644 --- a/rootly_sdk/api/status_page_component_groups/create_status_page_component_group.py +++ b/rootly_sdk/api/status_page_component_groups/create_status_page_component_group.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, StatusPageComponentGroupResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | StatusPageComponentGroupResponse | None: if response.status_code == 201: response_201 = StatusPageComponentGroupResponse.from_dict(response.json()) @@ -56,8 +56,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, StatusPageComponentGroupResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | StatusPageComponentGroupResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -71,7 +71,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewStatusPageComponentGroup, -) -> Response[Union[ErrorsList, StatusPageComponentGroupResponse]]: +) -> Response[ErrorsList | StatusPageComponentGroupResponse]: """Creates a status page component group Creates a new status page component group from provided data @@ -105,7 +105,7 @@ def sync( *, client: AuthenticatedClient, body: NewStatusPageComponentGroup, -) -> Optional[Union[ErrorsList, StatusPageComponentGroupResponse]]: +) -> ErrorsList | StatusPageComponentGroupResponse | None: """Creates a status page component group Creates a new status page component group from provided data @@ -134,7 +134,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewStatusPageComponentGroup, -) -> Response[Union[ErrorsList, StatusPageComponentGroupResponse]]: +) -> Response[ErrorsList | StatusPageComponentGroupResponse]: """Creates a status page component group Creates a new status page component group from provided data @@ -166,7 +166,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewStatusPageComponentGroup, -) -> Optional[Union[ErrorsList, StatusPageComponentGroupResponse]]: +) -> ErrorsList | StatusPageComponentGroupResponse | None: """Creates a status page component group Creates a new status page component group from provided data diff --git a/rootly_sdk/api/status_page_component_groups/delete_status_page_component_group.py b/rootly_sdk/api/status_page_component_groups/delete_status_page_component_group.py index 3074986c..8c5021bc 100644 --- a/rootly_sdk/api/status_page_component_groups/delete_status_page_component_group.py +++ b/rootly_sdk/api/status_page_component_groups/delete_status_page_component_group.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -19,7 +19,7 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Any | None: if response.status_code == 200: return None @@ -29,7 +29,7 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Any]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, diff --git a/rootly_sdk/api/status_page_component_groups/get_status_page_component_group.py b/rootly_sdk/api/status_page_component_groups/get_status_page_component_group.py index 03f27eb3..2539c21b 100644 --- a/rootly_sdk/api/status_page_component_groups/get_status_page_component_group.py +++ b/rootly_sdk/api/status_page_component_groups/get_status_page_component_group.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -13,7 +13,7 @@ def _get_kwargs( id: str, *, - include: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, StatusPageComponentGroupResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | StatusPageComponentGroupResponse | None: if response.status_code == 200: response_200 = StatusPageComponentGroupResponse.from_dict(response.json()) @@ -50,8 +50,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, StatusPageComponentGroupResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | StatusPageComponentGroupResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -64,8 +64,8 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, -) -> Response[Union[ErrorsList, StatusPageComponentGroupResponse]]: + include: Unset | str = UNSET, +) -> Response[ErrorsList | StatusPageComponentGroupResponse]: """Retrieves a status page component group Retrieves a status page component group @@ -98,8 +98,8 @@ def sync( id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, -) -> Optional[Union[ErrorsList, StatusPageComponentGroupResponse]]: + include: Unset | str = UNSET, +) -> ErrorsList | StatusPageComponentGroupResponse | None: """Retrieves a status page component group Retrieves a status page component group @@ -127,8 +127,8 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, -) -> Response[Union[ErrorsList, StatusPageComponentGroupResponse]]: + include: Unset | str = UNSET, +) -> Response[ErrorsList | StatusPageComponentGroupResponse]: """Retrieves a status page component group Retrieves a status page component group @@ -159,8 +159,8 @@ async def asyncio( id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, -) -> Optional[Union[ErrorsList, StatusPageComponentGroupResponse]]: + include: Unset | str = UNSET, +) -> ErrorsList | StatusPageComponentGroupResponse | None: """Retrieves a status page component group Retrieves a status page component group diff --git a/rootly_sdk/api/status_page_component_groups/list_status_page_component_groups.py b/rootly_sdk/api/status_page_component_groups/list_status_page_component_groups.py index 682c67ef..a78bcc4a 100644 --- a/rootly_sdk/api/status_page_component_groups/list_status_page_component_groups.py +++ b/rootly_sdk/api/status_page_component_groups/list_status_page_component_groups.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -12,9 +12,9 @@ def _get_kwargs( status_page_id: str, *, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -36,8 +36,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[StatusPageComponentGroupList]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> StatusPageComponentGroupList | None: if response.status_code == 200: response_200 = StatusPageComponentGroupList.from_dict(response.json()) @@ -50,7 +50,7 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response + *, client: AuthenticatedClient | Client, response: httpx.Response ) -> Response[StatusPageComponentGroupList]: return Response( status_code=HTTPStatus(response.status_code), @@ -64,9 +64,9 @@ def sync_detailed( status_page_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[StatusPageComponentGroupList]: """List status page component groups @@ -104,10 +104,10 @@ def sync( status_page_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, -) -> Optional[StatusPageComponentGroupList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, +) -> StatusPageComponentGroupList | None: """List status page component groups List status page component groups @@ -139,9 +139,9 @@ async def asyncio_detailed( status_page_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[StatusPageComponentGroupList]: """List status page component groups @@ -177,10 +177,10 @@ async def asyncio( status_page_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, -) -> Optional[StatusPageComponentGroupList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, +) -> StatusPageComponentGroupList | None: """List status page component groups List status page component groups diff --git a/rootly_sdk/api/status_page_component_groups/update_status_page_component_group.py b/rootly_sdk/api/status_page_component_groups/update_status_page_component_group.py index 3c59e569..a416ba29 100644 --- a/rootly_sdk/api/status_page_component_groups/update_status_page_component_group.py +++ b/rootly_sdk/api/status_page_component_groups/update_status_page_component_group.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, StatusPageComponentGroupResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | StatusPageComponentGroupResponse | None: if response.status_code == 200: response_200 = StatusPageComponentGroupResponse.from_dict(response.json()) @@ -51,8 +51,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, StatusPageComponentGroupResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | StatusPageComponentGroupResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateStatusPageComponentGroup, -) -> Response[Union[ErrorsList, StatusPageComponentGroupResponse]]: +) -> Response[ErrorsList | StatusPageComponentGroupResponse]: """Update a status page component group Update a status page component group @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateStatusPageComponentGroup, -) -> Optional[Union[ErrorsList, StatusPageComponentGroupResponse]]: +) -> ErrorsList | StatusPageComponentGroupResponse | None: """Update a status page component group Update a status page component group @@ -129,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateStatusPageComponentGroup, -) -> Response[Union[ErrorsList, StatusPageComponentGroupResponse]]: +) -> Response[ErrorsList | StatusPageComponentGroupResponse]: """Update a status page component group Update a status page component group @@ -161,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateStatusPageComponentGroup, -) -> Optional[Union[ErrorsList, StatusPageComponentGroupResponse]]: +) -> ErrorsList | StatusPageComponentGroupResponse | None: """Update a status page component group Update a status page component group diff --git a/rootly_sdk/api/status_page_components/create_status_page_component.py b/rootly_sdk/api/status_page_components/create_status_page_component.py index b39f72b4..9b026f90 100644 --- a/rootly_sdk/api/status_page_components/create_status_page_component.py +++ b/rootly_sdk/api/status_page_components/create_status_page_component.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, StatusPageComponentResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | StatusPageComponentResponse | None: if response.status_code == 201: response_201 = StatusPageComponentResponse.from_dict(response.json()) @@ -56,8 +56,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, StatusPageComponentResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | StatusPageComponentResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -71,7 +71,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewStatusPageComponent, -) -> Response[Union[ErrorsList, StatusPageComponentResponse]]: +) -> Response[ErrorsList | StatusPageComponentResponse]: """Creates a status page component Creates a new status page component from provided data @@ -105,7 +105,7 @@ def sync( *, client: AuthenticatedClient, body: NewStatusPageComponent, -) -> Optional[Union[ErrorsList, StatusPageComponentResponse]]: +) -> ErrorsList | StatusPageComponentResponse | None: """Creates a status page component Creates a new status page component from provided data @@ -134,7 +134,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewStatusPageComponent, -) -> Response[Union[ErrorsList, StatusPageComponentResponse]]: +) -> Response[ErrorsList | StatusPageComponentResponse]: """Creates a status page component Creates a new status page component from provided data @@ -166,7 +166,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewStatusPageComponent, -) -> Optional[Union[ErrorsList, StatusPageComponentResponse]]: +) -> ErrorsList | StatusPageComponentResponse | None: """Creates a status page component Creates a new status page component from provided data diff --git a/rootly_sdk/api/status_page_components/delete_status_page_component.py b/rootly_sdk/api/status_page_components/delete_status_page_component.py index 5c9f3f1c..e362005d 100644 --- a/rootly_sdk/api/status_page_components/delete_status_page_component.py +++ b/rootly_sdk/api/status_page_components/delete_status_page_component.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -19,7 +19,7 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Any | None: if response.status_code == 200: return None @@ -29,7 +29,7 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Any]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, diff --git a/rootly_sdk/api/status_page_components/get_status_page_component.py b/rootly_sdk/api/status_page_components/get_status_page_component.py index 11a48038..b89508ec 100644 --- a/rootly_sdk/api/status_page_components/get_status_page_component.py +++ b/rootly_sdk/api/status_page_components/get_status_page_component.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -13,7 +13,7 @@ def _get_kwargs( id: str, *, - include: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, StatusPageComponentResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | StatusPageComponentResponse | None: if response.status_code == 200: response_200 = StatusPageComponentResponse.from_dict(response.json()) @@ -50,8 +50,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, StatusPageComponentResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | StatusPageComponentResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -64,8 +64,8 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, -) -> Response[Union[ErrorsList, StatusPageComponentResponse]]: + include: Unset | str = UNSET, +) -> Response[ErrorsList | StatusPageComponentResponse]: """Retrieves a status page component Retrieves a status page component @@ -98,8 +98,8 @@ def sync( id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, -) -> Optional[Union[ErrorsList, StatusPageComponentResponse]]: + include: Unset | str = UNSET, +) -> ErrorsList | StatusPageComponentResponse | None: """Retrieves a status page component Retrieves a status page component @@ -127,8 +127,8 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, -) -> Response[Union[ErrorsList, StatusPageComponentResponse]]: + include: Unset | str = UNSET, +) -> Response[ErrorsList | StatusPageComponentResponse]: """Retrieves a status page component Retrieves a status page component @@ -159,8 +159,8 @@ async def asyncio( id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, -) -> Optional[Union[ErrorsList, StatusPageComponentResponse]]: + include: Unset | str = UNSET, +) -> ErrorsList | StatusPageComponentResponse | None: """Retrieves a status page component Retrieves a status page component diff --git a/rootly_sdk/api/status_page_components/list_status_page_components.py b/rootly_sdk/api/status_page_components/list_status_page_components.py index 7a1bc2e2..575d4e2b 100644 --- a/rootly_sdk/api/status_page_components/list_status_page_components.py +++ b/rootly_sdk/api/status_page_components/list_status_page_components.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -12,9 +12,9 @@ def _get_kwargs( status_page_id: str, *, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -36,8 +36,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[StatusPageComponentList]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> StatusPageComponentList | None: if response.status_code == 200: response_200 = StatusPageComponentList.from_dict(response.json()) @@ -50,7 +50,7 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response + *, client: AuthenticatedClient | Client, response: httpx.Response ) -> Response[StatusPageComponentList]: return Response( status_code=HTTPStatus(response.status_code), @@ -64,9 +64,9 @@ def sync_detailed( status_page_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[StatusPageComponentList]: """List status page components @@ -104,10 +104,10 @@ def sync( status_page_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, -) -> Optional[StatusPageComponentList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, +) -> StatusPageComponentList | None: """List status page components List status page components @@ -139,9 +139,9 @@ async def asyncio_detailed( status_page_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[StatusPageComponentList]: """List status page components @@ -177,10 +177,10 @@ async def asyncio( status_page_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, -) -> Optional[StatusPageComponentList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, +) -> StatusPageComponentList | None: """List status page components List status page components diff --git a/rootly_sdk/api/status_page_components/update_status_page_component.py b/rootly_sdk/api/status_page_components/update_status_page_component.py index 542a8c34..e049a15f 100644 --- a/rootly_sdk/api/status_page_components/update_status_page_component.py +++ b/rootly_sdk/api/status_page_components/update_status_page_component.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, StatusPageComponentResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | StatusPageComponentResponse | None: if response.status_code == 200: response_200 = StatusPageComponentResponse.from_dict(response.json()) @@ -51,8 +51,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, StatusPageComponentResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | StatusPageComponentResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateStatusPageComponent, -) -> Response[Union[ErrorsList, StatusPageComponentResponse]]: +) -> Response[ErrorsList | StatusPageComponentResponse]: """Update a status page component Update a status page component @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateStatusPageComponent, -) -> Optional[Union[ErrorsList, StatusPageComponentResponse]]: +) -> ErrorsList | StatusPageComponentResponse | None: """Update a status page component Update a status page component @@ -129,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateStatusPageComponent, -) -> Response[Union[ErrorsList, StatusPageComponentResponse]]: +) -> Response[ErrorsList | StatusPageComponentResponse]: """Update a status page component Update a status page component @@ -161,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateStatusPageComponent, -) -> Optional[Union[ErrorsList, StatusPageComponentResponse]]: +) -> ErrorsList | StatusPageComponentResponse | None: """Update a status page component Update a status page component diff --git a/rootly_sdk/api/status_page_templates/create_status_page_template.py b/rootly_sdk/api/status_page_templates/create_status_page_template.py index fda3490b..b2f957dc 100644 --- a/rootly_sdk/api/status_page_templates/create_status_page_template.py +++ b/rootly_sdk/api/status_page_templates/create_status_page_template.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, StatusPageTemplateResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | StatusPageTemplateResponse | None: if response.status_code == 201: response_201 = StatusPageTemplateResponse.from_dict(response.json()) @@ -56,8 +56,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, StatusPageTemplateResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | StatusPageTemplateResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -71,7 +71,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: StatusPageTemplate, -) -> Response[Union[ErrorsList, StatusPageTemplateResponse]]: +) -> Response[ErrorsList | StatusPageTemplateResponse]: """Creates a status page template Creates a new template from provided data @@ -105,7 +105,7 @@ def sync( *, client: AuthenticatedClient, body: StatusPageTemplate, -) -> Optional[Union[ErrorsList, StatusPageTemplateResponse]]: +) -> ErrorsList | StatusPageTemplateResponse | None: """Creates a status page template Creates a new template from provided data @@ -134,7 +134,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: StatusPageTemplate, -) -> Response[Union[ErrorsList, StatusPageTemplateResponse]]: +) -> Response[ErrorsList | StatusPageTemplateResponse]: """Creates a status page template Creates a new template from provided data @@ -166,7 +166,7 @@ async def asyncio( *, client: AuthenticatedClient, body: StatusPageTemplate, -) -> Optional[Union[ErrorsList, StatusPageTemplateResponse]]: +) -> ErrorsList | StatusPageTemplateResponse | None: """Creates a status page template Creates a new template from provided data diff --git a/rootly_sdk/api/status_page_templates/delete_status_page_template.py b/rootly_sdk/api/status_page_templates/delete_status_page_template.py index 2d5d6b79..161fa164 100644 --- a/rootly_sdk/api/status_page_templates/delete_status_page_template.py +++ b/rootly_sdk/api/status_page_templates/delete_status_page_template.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, StatusPageTemplateResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | StatusPageTemplateResponse | None: if response.status_code == 200: response_200 = StatusPageTemplateResponse.from_dict(response.json()) @@ -41,8 +41,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, StatusPageTemplateResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | StatusPageTemplateResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -55,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, StatusPageTemplateResponse]]: +) -> Response[ErrorsList | StatusPageTemplateResponse]: """Delete a incident event Delete a specific template event by id @@ -86,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, StatusPageTemplateResponse]]: +) -> ErrorsList | StatusPageTemplateResponse | None: """Delete a incident event Delete a specific template event by id @@ -112,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, StatusPageTemplateResponse]]: +) -> Response[ErrorsList | StatusPageTemplateResponse]: """Delete a incident event Delete a specific template event by id @@ -141,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, StatusPageTemplateResponse]]: +) -> ErrorsList | StatusPageTemplateResponse | None: """Delete a incident event Delete a specific template event by id diff --git a/rootly_sdk/api/status_page_templates/get_status_page_template.py b/rootly_sdk/api/status_page_templates/get_status_page_template.py index 6d0d5660..14fdfede 100644 --- a/rootly_sdk/api/status_page_templates/get_status_page_template.py +++ b/rootly_sdk/api/status_page_templates/get_status_page_template.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, StatusPageTemplateResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | StatusPageTemplateResponse | None: if response.status_code == 200: response_200 = StatusPageTemplateResponse.from_dict(response.json()) @@ -41,8 +41,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, StatusPageTemplateResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | StatusPageTemplateResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -55,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, StatusPageTemplateResponse]]: +) -> Response[ErrorsList | StatusPageTemplateResponse]: """Retrieves a status page template Retrieves a specific status_page_template by id @@ -86,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, StatusPageTemplateResponse]]: +) -> ErrorsList | StatusPageTemplateResponse | None: """Retrieves a status page template Retrieves a specific status_page_template by id @@ -112,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, StatusPageTemplateResponse]]: +) -> Response[ErrorsList | StatusPageTemplateResponse]: """Retrieves a status page template Retrieves a specific status_page_template by id @@ -141,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, StatusPageTemplateResponse]]: +) -> ErrorsList | StatusPageTemplateResponse | None: """Retrieves a status page template Retrieves a specific status_page_template by id diff --git a/rootly_sdk/api/status_page_templates/list_status_page_templates.py b/rootly_sdk/api/status_page_templates/list_status_page_templates.py index 1f72d4f0..e3a79d97 100644 --- a/rootly_sdk/api/status_page_templates/list_status_page_templates.py +++ b/rootly_sdk/api/status_page_templates/list_status_page_templates.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -12,9 +12,9 @@ def _get_kwargs( status_page_id: str, *, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -35,9 +35,7 @@ def _get_kwargs( return _kwargs -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[StatusPageTemplateList]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> StatusPageTemplateList | None: if response.status_code == 200: response_200 = StatusPageTemplateList.from_dict(response.json()) @@ -50,7 +48,7 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response + *, client: AuthenticatedClient | Client, response: httpx.Response ) -> Response[StatusPageTemplateList]: return Response( status_code=HTTPStatus(response.status_code), @@ -64,9 +62,9 @@ def sync_detailed( status_page_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[StatusPageTemplateList]: """List status page templates @@ -104,10 +102,10 @@ def sync( status_page_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, -) -> Optional[StatusPageTemplateList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, +) -> StatusPageTemplateList | None: """List status page templates List status page templates @@ -139,9 +137,9 @@ async def asyncio_detailed( status_page_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[StatusPageTemplateList]: """List status page templates @@ -177,10 +175,10 @@ async def asyncio( status_page_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, -) -> Optional[StatusPageTemplateList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, +) -> StatusPageTemplateList | None: """List status page templates List status page templates diff --git a/rootly_sdk/api/status_page_templates/update_status_page_template.py b/rootly_sdk/api/status_page_templates/update_status_page_template.py index 09bed928..88b755fa 100644 --- a/rootly_sdk/api/status_page_templates/update_status_page_template.py +++ b/rootly_sdk/api/status_page_templates/update_status_page_template.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, StatusPageTemplateResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | StatusPageTemplateResponse | None: if response.status_code == 200: response_200 = StatusPageTemplateResponse.from_dict(response.json()) @@ -51,8 +51,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, StatusPageTemplateResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | StatusPageTemplateResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: StatusPageTemplate, -) -> Response[Union[ErrorsList, StatusPageTemplateResponse]]: +) -> Response[ErrorsList | StatusPageTemplateResponse]: """Update status page template Update a specific template event by id @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: StatusPageTemplate, -) -> Optional[Union[ErrorsList, StatusPageTemplateResponse]]: +) -> ErrorsList | StatusPageTemplateResponse | None: """Update status page template Update a specific template event by id @@ -129,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: StatusPageTemplate, -) -> Response[Union[ErrorsList, StatusPageTemplateResponse]]: +) -> Response[ErrorsList | StatusPageTemplateResponse]: """Update status page template Update a specific template event by id @@ -161,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: StatusPageTemplate, -) -> Optional[Union[ErrorsList, StatusPageTemplateResponse]]: +) -> ErrorsList | StatusPageTemplateResponse | None: """Update status page template Update a specific template event by id diff --git a/rootly_sdk/api/status_pages/create_status_page.py b/rootly_sdk/api/status_pages/create_status_page.py index a46de930..9e7615a1 100644 --- a/rootly_sdk/api/status_pages/create_status_page.py +++ b/rootly_sdk/api/status_pages/create_status_page.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, StatusPageResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | StatusPageResponse | None: if response.status_code == 201: response_201 = StatusPageResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, StatusPageResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | StatusPageResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +69,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewStatusPage, -) -> Response[Union[ErrorsList, StatusPageResponse]]: +) -> Response[ErrorsList | StatusPageResponse]: """Creates a status page Creates a new status page from provided data @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: NewStatusPage, -) -> Optional[Union[ErrorsList, StatusPageResponse]]: +) -> ErrorsList | StatusPageResponse | None: """Creates a status page Creates a new status page from provided data @@ -126,7 +126,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewStatusPage, -) -> Response[Union[ErrorsList, StatusPageResponse]]: +) -> Response[ErrorsList | StatusPageResponse]: """Creates a status page Creates a new status page from provided data @@ -155,7 +155,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewStatusPage, -) -> Optional[Union[ErrorsList, StatusPageResponse]]: +) -> ErrorsList | StatusPageResponse | None: """Creates a status page Creates a new status page from provided data diff --git a/rootly_sdk/api/status_pages/delete_status_page.py b/rootly_sdk/api/status_pages/delete_status_page.py index b55f6bb0..ef7a14b6 100644 --- a/rootly_sdk/api/status_pages/delete_status_page.py +++ b/rootly_sdk/api/status_pages/delete_status_page.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any from uuid import UUID import httpx @@ -12,7 +12,7 @@ def _get_kwargs( - id: Union[UUID, str], + id: UUID | str, ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "delete", @@ -23,8 +23,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, StatusPageResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | StatusPageResponse | None: if response.status_code == 200: response_200 = StatusPageResponse.from_dict(response.json()) @@ -42,8 +42,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, StatusPageResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | StatusPageResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -53,10 +53,10 @@ def _build_response( def sync_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, StatusPageResponse]]: +) -> Response[ErrorsList | StatusPageResponse]: """Delete a status page Delete a specific status page by id @@ -84,10 +84,10 @@ def sync_detailed( def sync( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, StatusPageResponse]]: +) -> ErrorsList | StatusPageResponse | None: """Delete a status page Delete a specific status page by id @@ -110,10 +110,10 @@ def sync( async def asyncio_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, StatusPageResponse]]: +) -> Response[ErrorsList | StatusPageResponse]: """Delete a status page Delete a specific status page by id @@ -139,10 +139,10 @@ async def asyncio_detailed( async def asyncio( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, StatusPageResponse]]: +) -> ErrorsList | StatusPageResponse | None: """Delete a status page Delete a specific status page by id diff --git a/rootly_sdk/api/status_pages/get_status_page.py b/rootly_sdk/api/status_pages/get_status_page.py index 905bb823..5f12160f 100644 --- a/rootly_sdk/api/status_pages/get_status_page.py +++ b/rootly_sdk/api/status_pages/get_status_page.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any from uuid import UUID import httpx @@ -12,7 +12,7 @@ def _get_kwargs( - id: Union[UUID, str], + id: UUID | str, ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "get", @@ -23,8 +23,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, StatusPageResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | StatusPageResponse | None: if response.status_code == 200: response_200 = StatusPageResponse.from_dict(response.json()) @@ -42,8 +42,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, StatusPageResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | StatusPageResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -53,10 +53,10 @@ def _build_response( def sync_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, StatusPageResponse]]: +) -> Response[ErrorsList | StatusPageResponse]: """Retrieves a status page Retrieves a specific status page by id @@ -84,10 +84,10 @@ def sync_detailed( def sync( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, StatusPageResponse]]: +) -> ErrorsList | StatusPageResponse | None: """Retrieves a status page Retrieves a specific status page by id @@ -110,10 +110,10 @@ def sync( async def asyncio_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, StatusPageResponse]]: +) -> Response[ErrorsList | StatusPageResponse]: """Retrieves a status page Retrieves a specific status page by id @@ -139,10 +139,10 @@ async def asyncio_detailed( async def asyncio( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, StatusPageResponse]]: +) -> ErrorsList | StatusPageResponse | None: """Retrieves a status page Retrieves a specific status page by id diff --git a/rootly_sdk/api/status_pages/list_status_pages.py b/rootly_sdk/api/status_pages/list_status_pages.py index 50a54de7..abf15426 100644 --- a/rootly_sdk/api/status_pages/list_status_pages.py +++ b/rootly_sdk/api/status_pages/list_status_pages.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -11,25 +11,25 @@ def _get_kwargs( *, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, - filterslugeq: Union[Unset, str] = UNSET, - filterslugnot_eq: Union[Unset, str] = UNSET, - filterslugin: Union[Unset, str] = UNSET, - filterslugnot_in: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -82,9 +82,7 @@ def _get_kwargs( return _kwargs -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[StatusPageList]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> StatusPageList | None: if response.status_code == 200: response_200 = StatusPageList.from_dict(response.json()) @@ -96,9 +94,7 @@ def _parse_response( return None -def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[StatusPageList]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[StatusPageList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -110,25 +106,25 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, - filterslugeq: Union[Unset, str] = UNSET, - filterslugnot_eq: Union[Unset, str] = UNSET, - filterslugin: Union[Unset, str] = UNSET, - filterslugnot_in: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[StatusPageList]: """List status pages @@ -195,26 +191,26 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, - filterslugeq: Union[Unset, str] = UNSET, - filterslugnot_eq: Union[Unset, str] = UNSET, - filterslugin: Union[Unset, str] = UNSET, - filterslugnot_in: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, -) -> Optional[StatusPageList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, +) -> StatusPageList | None: """List status pages List status pages @@ -275,25 +271,25 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, - filterslugeq: Union[Unset, str] = UNSET, - filterslugnot_eq: Union[Unset, str] = UNSET, - filterslugin: Union[Unset, str] = UNSET, - filterslugnot_in: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[StatusPageList]: """List status pages @@ -358,26 +354,26 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, - filterslugeq: Union[Unset, str] = UNSET, - filterslugnot_eq: Union[Unset, str] = UNSET, - filterslugin: Union[Unset, str] = UNSET, - filterslugnot_in: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, -) -> Optional[StatusPageList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, +) -> StatusPageList | None: """List status pages List status pages diff --git a/rootly_sdk/api/status_pages/update_status_page.py b/rootly_sdk/api/status_pages/update_status_page.py index 0a934e6d..74ebf96f 100644 --- a/rootly_sdk/api/status_pages/update_status_page.py +++ b/rootly_sdk/api/status_pages/update_status_page.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any from uuid import UUID import httpx @@ -13,7 +13,7 @@ def _get_kwargs( - id: Union[UUID, str], + id: UUID | str, *, body: UpdateStatusPage, ) -> dict[str, Any]: @@ -33,8 +33,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, StatusPageResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | StatusPageResponse | None: if response.status_code == 200: response_200 = StatusPageResponse.from_dict(response.json()) @@ -57,8 +57,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, StatusPageResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | StatusPageResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -68,11 +68,11 @@ def _build_response( def sync_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdateStatusPage, -) -> Response[Union[ErrorsList, StatusPageResponse]]: +) -> Response[ErrorsList | StatusPageResponse]: """Update a status page Update a specific status page by id @@ -102,11 +102,11 @@ def sync_detailed( def sync( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdateStatusPage, -) -> Optional[Union[ErrorsList, StatusPageResponse]]: +) -> ErrorsList | StatusPageResponse | None: """Update a status page Update a specific status page by id @@ -131,11 +131,11 @@ def sync( async def asyncio_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdateStatusPage, -) -> Response[Union[ErrorsList, StatusPageResponse]]: +) -> Response[ErrorsList | StatusPageResponse]: """Update a status page Update a specific status page by id @@ -163,11 +163,11 @@ async def asyncio_detailed( async def asyncio( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdateStatusPage, -) -> Optional[Union[ErrorsList, StatusPageResponse]]: +) -> ErrorsList | StatusPageResponse | None: """Update a status page Update a specific status page by id diff --git a/rootly_sdk/api/statuses/get_status.py b/rootly_sdk/api/statuses/get_status.py index 4d7251eb..d10a7bc7 100644 --- a/rootly_sdk/api/statuses/get_status.py +++ b/rootly_sdk/api/statuses/get_status.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any from uuid import UUID import httpx @@ -12,7 +12,7 @@ def _get_kwargs( - id: Union[UUID, str], + id: UUID | str, ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "get", @@ -23,8 +23,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, StatusResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | StatusResponse | None: if response.status_code == 200: response_200 = StatusResponse.from_dict(response.json()) @@ -42,8 +42,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, StatusResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | StatusResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -53,10 +53,10 @@ def _build_response( def sync_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, StatusResponse]]: +) -> Response[ErrorsList | StatusResponse]: """Retrieves a Status Retrieves a specific Status by id @@ -84,10 +84,10 @@ def sync_detailed( def sync( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, StatusResponse]]: +) -> ErrorsList | StatusResponse | None: """Retrieves a Status Retrieves a specific Status by id @@ -110,10 +110,10 @@ def sync( async def asyncio_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, StatusResponse]]: +) -> Response[ErrorsList | StatusResponse]: """Retrieves a Status Retrieves a specific Status by id @@ -139,10 +139,10 @@ async def asyncio_detailed( async def asyncio( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, StatusResponse]]: +) -> ErrorsList | StatusResponse | None: """Retrieves a Status Retrieves a specific Status by id diff --git a/rootly_sdk/api/statuses/list_statuses.py b/rootly_sdk/api/statuses/list_statuses.py index 5134f93d..b2f4c035 100644 --- a/rootly_sdk/api/statuses/list_statuses.py +++ b/rootly_sdk/api/statuses/list_statuses.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -12,16 +12,16 @@ def _get_kwargs( *, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterenabled: Union[Unset, bool] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterenabled: Unset | bool = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -57,8 +57,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, StatusList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | StatusList | None: if response.status_code == 200: response_200 = StatusList.from_dict(response.json()) @@ -76,8 +76,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, StatusList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | StatusList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -89,17 +89,17 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterenabled: Union[Unset, bool] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, -) -> Response[Union[ErrorsList, StatusList]]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterenabled: Unset | bool = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, +) -> Response[ErrorsList | StatusList]: """List Statuses List Statuses @@ -147,17 +147,17 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterenabled: Union[Unset, bool] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, -) -> Optional[Union[ErrorsList, StatusList]]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterenabled: Unset | bool = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, +) -> ErrorsList | StatusList | None: """List Statuses List Statuses @@ -200,17 +200,17 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterenabled: Union[Unset, bool] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, -) -> Response[Union[ErrorsList, StatusList]]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterenabled: Unset | bool = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, +) -> Response[ErrorsList | StatusList]: """List Statuses List Statuses @@ -256,17 +256,17 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterenabled: Union[Unset, bool] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, -) -> Optional[Union[ErrorsList, StatusList]]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterenabled: Unset | bool = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, +) -> ErrorsList | StatusList | None: """List Statuses List Statuses diff --git a/rootly_sdk/api/sub_statuses/create_sub_status.py b/rootly_sdk/api/sub_statuses/create_sub_status.py index 3f2cc6e3..f34b6c2d 100644 --- a/rootly_sdk/api/sub_statuses/create_sub_status.py +++ b/rootly_sdk/api/sub_statuses/create_sub_status.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, SubStatusResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | SubStatusResponse | None: if response.status_code == 201: response_201 = SubStatusResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, SubStatusResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | SubStatusResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +69,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewSubStatus, -) -> Response[Union[ErrorsList, SubStatusResponse]]: +) -> Response[ErrorsList | SubStatusResponse]: """Creates a Sub-Status Creates a new Sub-Status from provided data @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: NewSubStatus, -) -> Optional[Union[ErrorsList, SubStatusResponse]]: +) -> ErrorsList | SubStatusResponse | None: """Creates a Sub-Status Creates a new Sub-Status from provided data @@ -126,7 +126,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewSubStatus, -) -> Response[Union[ErrorsList, SubStatusResponse]]: +) -> Response[ErrorsList | SubStatusResponse]: """Creates a Sub-Status Creates a new Sub-Status from provided data @@ -155,7 +155,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewSubStatus, -) -> Optional[Union[ErrorsList, SubStatusResponse]]: +) -> ErrorsList | SubStatusResponse | None: """Creates a Sub-Status Creates a new Sub-Status from provided data diff --git a/rootly_sdk/api/sub_statuses/delete_sub_status.py b/rootly_sdk/api/sub_statuses/delete_sub_status.py index 30da1496..88af630e 100644 --- a/rootly_sdk/api/sub_statuses/delete_sub_status.py +++ b/rootly_sdk/api/sub_statuses/delete_sub_status.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any from uuid import UUID import httpx @@ -12,7 +12,7 @@ def _get_kwargs( - id: Union[UUID, str], + id: UUID | str, ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "delete", @@ -23,8 +23,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, SubStatusResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | SubStatusResponse | None: if response.status_code == 200: response_200 = SubStatusResponse.from_dict(response.json()) @@ -42,8 +42,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, SubStatusResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | SubStatusResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -53,10 +53,10 @@ def _build_response( def sync_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, SubStatusResponse]]: +) -> Response[ErrorsList | SubStatusResponse]: """Delete a Sub-Status Delete a specific Sub-Status by id @@ -84,10 +84,10 @@ def sync_detailed( def sync( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, SubStatusResponse]]: +) -> ErrorsList | SubStatusResponse | None: """Delete a Sub-Status Delete a specific Sub-Status by id @@ -110,10 +110,10 @@ def sync( async def asyncio_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, SubStatusResponse]]: +) -> Response[ErrorsList | SubStatusResponse]: """Delete a Sub-Status Delete a specific Sub-Status by id @@ -139,10 +139,10 @@ async def asyncio_detailed( async def asyncio( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, SubStatusResponse]]: +) -> ErrorsList | SubStatusResponse | None: """Delete a Sub-Status Delete a specific Sub-Status by id diff --git a/rootly_sdk/api/sub_statuses/get_sub_status.py b/rootly_sdk/api/sub_statuses/get_sub_status.py index 51fe6569..a364bb50 100644 --- a/rootly_sdk/api/sub_statuses/get_sub_status.py +++ b/rootly_sdk/api/sub_statuses/get_sub_status.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any from uuid import UUID import httpx @@ -12,7 +12,7 @@ def _get_kwargs( - id: Union[UUID, str], + id: UUID | str, ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "get", @@ -23,8 +23,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, SubStatusResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | SubStatusResponse | None: if response.status_code == 200: response_200 = SubStatusResponse.from_dict(response.json()) @@ -42,8 +42,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, SubStatusResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | SubStatusResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -53,10 +53,10 @@ def _build_response( def sync_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, SubStatusResponse]]: +) -> Response[ErrorsList | SubStatusResponse]: """Retrieves a Sub-Status Retrieves a specific Sub-Status by id @@ -84,10 +84,10 @@ def sync_detailed( def sync( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, SubStatusResponse]]: +) -> ErrorsList | SubStatusResponse | None: """Retrieves a Sub-Status Retrieves a specific Sub-Status by id @@ -110,10 +110,10 @@ def sync( async def asyncio_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, SubStatusResponse]]: +) -> Response[ErrorsList | SubStatusResponse]: """Retrieves a Sub-Status Retrieves a specific Sub-Status by id @@ -139,10 +139,10 @@ async def asyncio_detailed( async def asyncio( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, SubStatusResponse]]: +) -> ErrorsList | SubStatusResponse | None: """Retrieves a Sub-Status Retrieves a specific Sub-Status by id diff --git a/rootly_sdk/api/sub_statuses/list_sub_statuses.py b/rootly_sdk/api/sub_statuses/list_sub_statuses.py index 97be7c66..4bd03cdb 100644 --- a/rootly_sdk/api/sub_statuses/list_sub_statuses.py +++ b/rootly_sdk/api/sub_statuses/list_sub_statuses.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -11,16 +11,16 @@ def _get_kwargs( *, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterparent_status: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterparent_status: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -55,7 +55,7 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[SubStatusList]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> SubStatusList | None: if response.status_code == 200: response_200 = SubStatusList.from_dict(response.json()) @@ -67,7 +67,7 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[SubStatusList]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[SubStatusList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -79,16 +79,16 @@ def _build_response(*, client: Union[AuthenticatedClient, Client], response: htt def sync_detailed( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterparent_status: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterparent_status: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> Response[SubStatusList]: """List Sub-Statuses @@ -137,17 +137,17 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterparent_status: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, -) -> Optional[SubStatusList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterparent_status: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, +) -> SubStatusList | None: """List Sub-Statuses List Sub-Statuses @@ -190,16 +190,16 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterparent_status: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterparent_status: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> Response[SubStatusList]: """List Sub-Statuses @@ -246,17 +246,17 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterparent_status: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, -) -> Optional[SubStatusList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterparent_status: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, +) -> SubStatusList | None: """List Sub-Statuses List Sub-Statuses diff --git a/rootly_sdk/api/sub_statuses/update_sub_status.py b/rootly_sdk/api/sub_statuses/update_sub_status.py index 0df47965..684f59c8 100644 --- a/rootly_sdk/api/sub_statuses/update_sub_status.py +++ b/rootly_sdk/api/sub_statuses/update_sub_status.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any from uuid import UUID import httpx @@ -13,7 +13,7 @@ def _get_kwargs( - id: Union[UUID, str], + id: UUID | str, *, body: UpdateSubStatus, ) -> dict[str, Any]: @@ -33,8 +33,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, SubStatusResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | SubStatusResponse | None: if response.status_code == 200: response_200 = SubStatusResponse.from_dict(response.json()) @@ -52,8 +52,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, SubStatusResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | SubStatusResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -63,11 +63,11 @@ def _build_response( def sync_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdateSubStatus, -) -> Response[Union[ErrorsList, SubStatusResponse]]: +) -> Response[ErrorsList | SubStatusResponse]: """Update a Sub-Status Update a specific Sub-Status by id @@ -97,11 +97,11 @@ def sync_detailed( def sync( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdateSubStatus, -) -> Optional[Union[ErrorsList, SubStatusResponse]]: +) -> ErrorsList | SubStatusResponse | None: """Update a Sub-Status Update a specific Sub-Status by id @@ -126,11 +126,11 @@ def sync( async def asyncio_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdateSubStatus, -) -> Response[Union[ErrorsList, SubStatusResponse]]: +) -> Response[ErrorsList | SubStatusResponse]: """Update a Sub-Status Update a specific Sub-Status by id @@ -158,11 +158,11 @@ async def asyncio_detailed( async def asyncio( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdateSubStatus, -) -> Optional[Union[ErrorsList, SubStatusResponse]]: +) -> ErrorsList | SubStatusResponse | None: """Update a Sub-Status Update a specific Sub-Status by id diff --git a/rootly_sdk/api/teams/bulk_delete_groups.py b/rootly_sdk/api/teams/bulk_delete_groups.py index fec43db8..f748b5db 100644 --- a/rootly_sdk/api/teams/bulk_delete_groups.py +++ b/rootly_sdk/api/teams/bulk_delete_groups.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any, Union import httpx @@ -36,8 +36,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[BulkDestroyTeamsResponse, ErrorsList, Union["BulkDestroyTeamsResponse", "ErrorsList"]]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> BulkDestroyTeamsResponse | ErrorsList | Union["BulkDestroyTeamsResponse", "ErrorsList"] | None: if response.status_code == 200: response_200 = BulkDestroyTeamsResponse.from_dict(response.json()) @@ -76,8 +76,8 @@ def _parse_response_422(data: object) -> Union["BulkDestroyTeamsResponse", "Erro def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[BulkDestroyTeamsResponse, ErrorsList, Union["BulkDestroyTeamsResponse", "ErrorsList"]]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[BulkDestroyTeamsResponse | ErrorsList | Union["BulkDestroyTeamsResponse", "ErrorsList"]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -90,7 +90,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: Union["BulkDestroyTeamsType0", "BulkDestroyTeamsType1"], -) -> Response[Union[BulkDestroyTeamsResponse, ErrorsList, Union["BulkDestroyTeamsResponse", "ErrorsList"]]]: +) -> Response[BulkDestroyTeamsResponse | ErrorsList | Union["BulkDestroyTeamsResponse", "ErrorsList"]]: """Bulk delete Teams Delete teams by external_id list, or prune by managed_by source. Two mutually exclusive modes. @@ -123,7 +123,7 @@ def sync( *, client: AuthenticatedClient, body: Union["BulkDestroyTeamsType0", "BulkDestroyTeamsType1"], -) -> Optional[Union[BulkDestroyTeamsResponse, ErrorsList, Union["BulkDestroyTeamsResponse", "ErrorsList"]]]: +) -> BulkDestroyTeamsResponse | ErrorsList | Union["BulkDestroyTeamsResponse", "ErrorsList"] | None: """Bulk delete Teams Delete teams by external_id list, or prune by managed_by source. Two mutually exclusive modes. @@ -151,7 +151,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: Union["BulkDestroyTeamsType0", "BulkDestroyTeamsType1"], -) -> Response[Union[BulkDestroyTeamsResponse, ErrorsList, Union["BulkDestroyTeamsResponse", "ErrorsList"]]]: +) -> Response[BulkDestroyTeamsResponse | ErrorsList | Union["BulkDestroyTeamsResponse", "ErrorsList"]]: """Bulk delete Teams Delete teams by external_id list, or prune by managed_by source. Two mutually exclusive modes. @@ -182,7 +182,7 @@ async def asyncio( *, client: AuthenticatedClient, body: Union["BulkDestroyTeamsType0", "BulkDestroyTeamsType1"], -) -> Optional[Union[BulkDestroyTeamsResponse, ErrorsList, Union["BulkDestroyTeamsResponse", "ErrorsList"]]]: +) -> BulkDestroyTeamsResponse | ErrorsList | Union["BulkDestroyTeamsResponse", "ErrorsList"] | None: """Bulk delete Teams Delete teams by external_id list, or prune by managed_by source. Two mutually exclusive modes. diff --git a/rootly_sdk/api/teams/bulk_upsert_groups.py b/rootly_sdk/api/teams/bulk_upsert_groups.py index 1850921e..5a5a471a 100644 --- a/rootly_sdk/api/teams/bulk_upsert_groups.py +++ b/rootly_sdk/api/teams/bulk_upsert_groups.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any, Union import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[BulkUpsertTeamsResponse, ErrorsList, Union["BulkUpsertTeamsError", "ErrorsList"]]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> BulkUpsertTeamsResponse | ErrorsList | Union["BulkUpsertTeamsError", "ErrorsList"] | None: if response.status_code == 200: response_200 = BulkUpsertTeamsResponse.from_dict(response.json()) @@ -72,8 +72,8 @@ def _parse_response_422(data: object) -> Union["BulkUpsertTeamsError", "ErrorsLi def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[BulkUpsertTeamsResponse, ErrorsList, Union["BulkUpsertTeamsError", "ErrorsList"]]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[BulkUpsertTeamsResponse | ErrorsList | Union["BulkUpsertTeamsError", "ErrorsList"]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -86,7 +86,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: BulkUpsertTeams, -) -> Response[Union[BulkUpsertTeamsResponse, ErrorsList, Union["BulkUpsertTeamsError", "ErrorsList"]]]: +) -> Response[BulkUpsertTeamsResponse | ErrorsList | Union["BulkUpsertTeamsError", "ErrorsList"]]: """Bulk upsert Teams Create or update multiple teams by external_id. Only attributes present in the payload are written @@ -121,7 +121,7 @@ def sync( *, client: AuthenticatedClient, body: BulkUpsertTeams, -) -> Optional[Union[BulkUpsertTeamsResponse, ErrorsList, Union["BulkUpsertTeamsError", "ErrorsList"]]]: +) -> BulkUpsertTeamsResponse | ErrorsList | Union["BulkUpsertTeamsError", "ErrorsList"] | None: """Bulk upsert Teams Create or update multiple teams by external_id. Only attributes present in the payload are written @@ -151,7 +151,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: BulkUpsertTeams, -) -> Response[Union[BulkUpsertTeamsResponse, ErrorsList, Union["BulkUpsertTeamsError", "ErrorsList"]]]: +) -> Response[BulkUpsertTeamsResponse | ErrorsList | Union["BulkUpsertTeamsError", "ErrorsList"]]: """Bulk upsert Teams Create or update multiple teams by external_id. Only attributes present in the payload are written @@ -184,7 +184,7 @@ async def asyncio( *, client: AuthenticatedClient, body: BulkUpsertTeams, -) -> Optional[Union[BulkUpsertTeamsResponse, ErrorsList, Union["BulkUpsertTeamsError", "ErrorsList"]]]: +) -> BulkUpsertTeamsResponse | ErrorsList | Union["BulkUpsertTeamsError", "ErrorsList"] | None: """Bulk upsert Teams Create or update multiple teams by external_id. Only attributes present in the payload are written diff --git a/rootly_sdk/api/teams/create_group_catalog_property.py b/rootly_sdk/api/teams/create_group_catalog_property.py index b089a497..d8f5620c 100644 --- a/rootly_sdk/api/teams/create_group_catalog_property.py +++ b/rootly_sdk/api/teams/create_group_catalog_property.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[CatalogPropertyResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CatalogPropertyResponse | ErrorsList | None: if response.status_code == 201: response_201 = CatalogPropertyResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[CatalogPropertyResponse, ErrorsList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[CatalogPropertyResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +69,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewCatalogProperty, -) -> Response[Union[CatalogPropertyResponse, ErrorsList]]: +) -> Response[CatalogPropertyResponse | ErrorsList]: """Creates a Catalog Property Creates a new Catalog Property from provided data @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: NewCatalogProperty, -) -> Optional[Union[CatalogPropertyResponse, ErrorsList]]: +) -> CatalogPropertyResponse | ErrorsList | None: """Creates a Catalog Property Creates a new Catalog Property from provided data @@ -126,7 +126,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewCatalogProperty, -) -> Response[Union[CatalogPropertyResponse, ErrorsList]]: +) -> Response[CatalogPropertyResponse | ErrorsList]: """Creates a Catalog Property Creates a new Catalog Property from provided data @@ -155,7 +155,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewCatalogProperty, -) -> Optional[Union[CatalogPropertyResponse, ErrorsList]]: +) -> CatalogPropertyResponse | ErrorsList | None: """Creates a Catalog Property Creates a new Catalog Property from provided data diff --git a/rootly_sdk/api/teams/create_team.py b/rootly_sdk/api/teams/create_team.py index d4f48e06..17bbf1b8 100644 --- a/rootly_sdk/api/teams/create_team.py +++ b/rootly_sdk/api/teams/create_team.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, TeamResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | TeamResponse | None: if response.status_code == 201: response_201 = TeamResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, TeamResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | TeamResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +69,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewTeam, -) -> Response[Union[ErrorsList, TeamResponse]]: +) -> Response[ErrorsList | TeamResponse]: """Creates a team Creates a new team from provided data @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: NewTeam, -) -> Optional[Union[ErrorsList, TeamResponse]]: +) -> ErrorsList | TeamResponse | None: """Creates a team Creates a new team from provided data @@ -126,7 +126,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewTeam, -) -> Response[Union[ErrorsList, TeamResponse]]: +) -> Response[ErrorsList | TeamResponse]: """Creates a team Creates a new team from provided data @@ -155,7 +155,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewTeam, -) -> Optional[Union[ErrorsList, TeamResponse]]: +) -> ErrorsList | TeamResponse | None: """Creates a team Creates a new team from provided data diff --git a/rootly_sdk/api/teams/delete_team.py b/rootly_sdk/api/teams/delete_team.py index 365021ed..c9bb64fa 100644 --- a/rootly_sdk/api/teams/delete_team.py +++ b/rootly_sdk/api/teams/delete_team.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any from uuid import UUID import httpx @@ -12,7 +12,7 @@ def _get_kwargs( - id: Union[UUID, str], + id: UUID | str, ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "delete", @@ -23,8 +23,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, TeamResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | TeamResponse | None: if response.status_code == 200: response_200 = TeamResponse.from_dict(response.json()) @@ -42,8 +42,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, TeamResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | TeamResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -53,10 +53,10 @@ def _build_response( def sync_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, TeamResponse]]: +) -> Response[ErrorsList | TeamResponse]: """Delete a team Delete a specific team by id @@ -84,10 +84,10 @@ def sync_detailed( def sync( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, TeamResponse]]: +) -> ErrorsList | TeamResponse | None: """Delete a team Delete a specific team by id @@ -110,10 +110,10 @@ def sync( async def asyncio_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, TeamResponse]]: +) -> Response[ErrorsList | TeamResponse]: """Delete a team Delete a specific team by id @@ -139,10 +139,10 @@ async def asyncio_detailed( async def asyncio( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, TeamResponse]]: +) -> ErrorsList | TeamResponse | None: """Delete a team Delete a specific team by id diff --git a/rootly_sdk/api/teams/get_team.py b/rootly_sdk/api/teams/get_team.py index a679e777..154624c1 100644 --- a/rootly_sdk/api/teams/get_team.py +++ b/rootly_sdk/api/teams/get_team.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any from uuid import UUID import httpx @@ -13,13 +13,13 @@ def _get_kwargs( - id: Union[UUID, str], + id: UUID | str, *, - include: Union[Unset, GetTeamInclude] = UNSET, + include: Unset | GetTeamInclude = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} - json_include: Union[Unset, str] = UNSET + json_include: Unset | str = UNSET if not isinstance(include, Unset): json_include = include @@ -37,8 +37,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, TeamResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | TeamResponse | None: if response.status_code == 200: response_200 = TeamResponse.from_dict(response.json()) @@ -56,8 +56,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, TeamResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | TeamResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -67,11 +67,11 @@ def _build_response( def sync_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, - include: Union[Unset, GetTeamInclude] = UNSET, -) -> Response[Union[ErrorsList, TeamResponse]]: + include: Unset | GetTeamInclude = UNSET, +) -> Response[ErrorsList | TeamResponse]: """Retrieves a team Retrieves a specific team by id @@ -101,11 +101,11 @@ def sync_detailed( def sync( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, - include: Union[Unset, GetTeamInclude] = UNSET, -) -> Optional[Union[ErrorsList, TeamResponse]]: + include: Unset | GetTeamInclude = UNSET, +) -> ErrorsList | TeamResponse | None: """Retrieves a team Retrieves a specific team by id @@ -130,11 +130,11 @@ def sync( async def asyncio_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, - include: Union[Unset, GetTeamInclude] = UNSET, -) -> Response[Union[ErrorsList, TeamResponse]]: + include: Unset | GetTeamInclude = UNSET, +) -> Response[ErrorsList | TeamResponse]: """Retrieves a team Retrieves a specific team by id @@ -162,11 +162,11 @@ async def asyncio_detailed( async def asyncio( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, - include: Union[Unset, GetTeamInclude] = UNSET, -) -> Optional[Union[ErrorsList, TeamResponse]]: + include: Unset | GetTeamInclude = UNSET, +) -> ErrorsList | TeamResponse | None: """Retrieves a team Retrieves a specific team by id diff --git a/rootly_sdk/api/teams/get_team_incidents_chart.py b/rootly_sdk/api/teams/get_team_incidents_chart.py index 8659d987..46979aba 100644 --- a/rootly_sdk/api/teams/get_team_incidents_chart.py +++ b/rootly_sdk/api/teams/get_team_incidents_chart.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, IncidentsChartResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | IncidentsChartResponse | None: if response.status_code == 200: response_200 = IncidentsChartResponse.from_dict(response.json()) @@ -50,8 +50,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, IncidentsChartResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | IncidentsChartResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -65,7 +65,7 @@ def sync_detailed( *, client: AuthenticatedClient, period: str, -) -> Response[Union[ErrorsList, IncidentsChartResponse]]: +) -> Response[ErrorsList | IncidentsChartResponse]: """Get team incidents chart Get team incidents chart @@ -99,7 +99,7 @@ def sync( *, client: AuthenticatedClient, period: str, -) -> Optional[Union[ErrorsList, IncidentsChartResponse]]: +) -> ErrorsList | IncidentsChartResponse | None: """Get team incidents chart Get team incidents chart @@ -128,7 +128,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, period: str, -) -> Response[Union[ErrorsList, IncidentsChartResponse]]: +) -> Response[ErrorsList | IncidentsChartResponse]: """Get team incidents chart Get team incidents chart @@ -160,7 +160,7 @@ async def asyncio( *, client: AuthenticatedClient, period: str, -) -> Optional[Union[ErrorsList, IncidentsChartResponse]]: +) -> ErrorsList | IncidentsChartResponse | None: """Get team incidents chart Get team incidents chart diff --git a/rootly_sdk/api/teams/list_group_catalog_properties.py b/rootly_sdk/api/teams/list_group_catalog_properties.py index 5f27521e..99dda92c 100644 --- a/rootly_sdk/api/teams/list_group_catalog_properties.py +++ b/rootly_sdk/api/teams/list_group_catalog_properties.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -17,27 +17,27 @@ def _get_kwargs( *, - include: Union[Unset, ListGroupCatalogPropertiesInclude] = UNSET, - sort: Union[Unset, ListGroupCatalogPropertiesSort] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterkind: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, + include: Unset | ListGroupCatalogPropertiesInclude = UNSET, + sort: Unset | ListGroupCatalogPropertiesSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} - json_include: Union[Unset, str] = UNSET + json_include: Unset | str = UNSET if not isinstance(include, Unset): json_include = include params["include"] = json_include - json_sort: Union[Unset, str] = UNSET + json_sort: Unset | str = UNSET if not isinstance(sort, Unset): json_sort = sort @@ -72,9 +72,7 @@ def _get_kwargs( return _kwargs -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[CatalogPropertyList]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> CatalogPropertyList | None: if response.status_code == 200: response_200 = CatalogPropertyList.from_dict(response.json()) @@ -86,9 +84,7 @@ def _parse_response( return None -def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[CatalogPropertyList]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[CatalogPropertyList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -100,17 +96,17 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - include: Union[Unset, ListGroupCatalogPropertiesInclude] = UNSET, - sort: Union[Unset, ListGroupCatalogPropertiesSort] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterkind: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, + include: Unset | ListGroupCatalogPropertiesInclude = UNSET, + sort: Unset | ListGroupCatalogPropertiesSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> Response[CatalogPropertyList]: """List Catalog Properties @@ -161,18 +157,18 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: Union[Unset, ListGroupCatalogPropertiesInclude] = UNSET, - sort: Union[Unset, ListGroupCatalogPropertiesSort] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterkind: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, -) -> Optional[CatalogPropertyList]: + include: Unset | ListGroupCatalogPropertiesInclude = UNSET, + sort: Unset | ListGroupCatalogPropertiesSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, +) -> CatalogPropertyList | None: """List Catalog Properties List Group Catalog Properties @@ -217,17 +213,17 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: Union[Unset, ListGroupCatalogPropertiesInclude] = UNSET, - sort: Union[Unset, ListGroupCatalogPropertiesSort] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterkind: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, + include: Unset | ListGroupCatalogPropertiesInclude = UNSET, + sort: Unset | ListGroupCatalogPropertiesSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> Response[CatalogPropertyList]: """List Catalog Properties @@ -276,18 +272,18 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: Union[Unset, ListGroupCatalogPropertiesInclude] = UNSET, - sort: Union[Unset, ListGroupCatalogPropertiesSort] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterkind: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, -) -> Optional[CatalogPropertyList]: + include: Unset | ListGroupCatalogPropertiesInclude = UNSET, + sort: Unset | ListGroupCatalogPropertiesSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, +) -> CatalogPropertyList | None: """List Catalog Properties List Group Catalog Properties diff --git a/rootly_sdk/api/teams/list_teams.py b/rootly_sdk/api/teams/list_teams.py index e8cef2da..c31abb6b 100644 --- a/rootly_sdk/api/teams/list_teams.py +++ b/rootly_sdk/api/teams/list_teams.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -12,48 +12,48 @@ def _get_kwargs( *, - include: Union[Unset, ListTeamsInclude] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterbackstage_id: Union[Unset, str] = UNSET, - filtercortex_id: Union[Unset, str] = UNSET, - filteropslevel_id: Union[Unset, str] = UNSET, - filterexternal_id: Union[Unset, str] = UNSET, - filtercolor: Union[Unset, str] = UNSET, - filteralert_broadcast_enabled: Union[Unset, bool] = UNSET, - filterincident_broadcast_enabled: Union[Unset, bool] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filterslugeq: Union[Unset, str] = UNSET, - filterslugnot_eq: Union[Unset, str] = UNSET, - filterslugin: Union[Unset, str] = UNSET, - filterslugnot_in: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, - filtercoloreq: Union[Unset, str] = UNSET, - filtercolornot_eq: Union[Unset, str] = UNSET, - filtercolorin: Union[Unset, str] = UNSET, - filtercolornot_in: Union[Unset, str] = UNSET, - filteralert_broadcast_enabledeq: Union[Unset, str] = UNSET, - filteralert_broadcast_enablednot_eq: Union[Unset, str] = UNSET, - filteralert_broadcast_enabledin: Union[Unset, str] = UNSET, - filteralert_broadcast_enablednot_in: Union[Unset, str] = UNSET, - filterincident_broadcast_enabledeq: Union[Unset, str] = UNSET, - filterincident_broadcast_enablednot_eq: Union[Unset, str] = UNSET, - filterincident_broadcast_enabledin: Union[Unset, str] = UNSET, - filterincident_broadcast_enablednot_in: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, + include: Unset | ListTeamsInclude = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterbackstage_id: Unset | str = UNSET, + filtercortex_id: Unset | str = UNSET, + filteropslevel_id: Unset | str = UNSET, + filterexternal_id: Unset | str = UNSET, + filtercolor: Unset | str = UNSET, + filteralert_broadcast_enabled: Unset | bool = UNSET, + filterincident_broadcast_enabled: Unset | bool = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filtercoloreq: Unset | str = UNSET, + filtercolornot_eq: Unset | str = UNSET, + filtercolorin: Unset | str = UNSET, + filtercolornot_in: Unset | str = UNSET, + filteralert_broadcast_enabledeq: Unset | str = UNSET, + filteralert_broadcast_enablednot_eq: Unset | str = UNSET, + filteralert_broadcast_enabledin: Unset | str = UNSET, + filteralert_broadcast_enablednot_in: Unset | str = UNSET, + filterincident_broadcast_enabledeq: Unset | str = UNSET, + filterincident_broadcast_enablednot_eq: Unset | str = UNSET, + filterincident_broadcast_enabledin: Unset | str = UNSET, + filterincident_broadcast_enablednot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} - json_include: Union[Unset, str] = UNSET + json_include: Unset | str = UNSET if not isinstance(include, Unset): json_include = include @@ -144,7 +144,7 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[TeamList]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> TeamList | None: if response.status_code == 200: response_200 = TeamList.from_dict(response.json()) @@ -156,7 +156,7 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[TeamList]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[TeamList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -168,44 +168,44 @@ def _build_response(*, client: Union[AuthenticatedClient, Client], response: htt def sync_detailed( *, client: AuthenticatedClient, - include: Union[Unset, ListTeamsInclude] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterbackstage_id: Union[Unset, str] = UNSET, - filtercortex_id: Union[Unset, str] = UNSET, - filteropslevel_id: Union[Unset, str] = UNSET, - filterexternal_id: Union[Unset, str] = UNSET, - filtercolor: Union[Unset, str] = UNSET, - filteralert_broadcast_enabled: Union[Unset, bool] = UNSET, - filterincident_broadcast_enabled: Union[Unset, bool] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filterslugeq: Union[Unset, str] = UNSET, - filterslugnot_eq: Union[Unset, str] = UNSET, - filterslugin: Union[Unset, str] = UNSET, - filterslugnot_in: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, - filtercoloreq: Union[Unset, str] = UNSET, - filtercolornot_eq: Union[Unset, str] = UNSET, - filtercolorin: Union[Unset, str] = UNSET, - filtercolornot_in: Union[Unset, str] = UNSET, - filteralert_broadcast_enabledeq: Union[Unset, str] = UNSET, - filteralert_broadcast_enablednot_eq: Union[Unset, str] = UNSET, - filteralert_broadcast_enabledin: Union[Unset, str] = UNSET, - filteralert_broadcast_enablednot_in: Union[Unset, str] = UNSET, - filterincident_broadcast_enabledeq: Union[Unset, str] = UNSET, - filterincident_broadcast_enablednot_eq: Union[Unset, str] = UNSET, - filterincident_broadcast_enabledin: Union[Unset, str] = UNSET, - filterincident_broadcast_enablednot_in: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, + include: Unset | ListTeamsInclude = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterbackstage_id: Unset | str = UNSET, + filtercortex_id: Unset | str = UNSET, + filteropslevel_id: Unset | str = UNSET, + filterexternal_id: Unset | str = UNSET, + filtercolor: Unset | str = UNSET, + filteralert_broadcast_enabled: Unset | bool = UNSET, + filterincident_broadcast_enabled: Unset | bool = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filtercoloreq: Unset | str = UNSET, + filtercolornot_eq: Unset | str = UNSET, + filtercolorin: Unset | str = UNSET, + filtercolornot_in: Unset | str = UNSET, + filteralert_broadcast_enabledeq: Unset | str = UNSET, + filteralert_broadcast_enablednot_eq: Unset | str = UNSET, + filteralert_broadcast_enabledin: Unset | str = UNSET, + filteralert_broadcast_enablednot_in: Unset | str = UNSET, + filterincident_broadcast_enabledeq: Unset | str = UNSET, + filterincident_broadcast_enablednot_eq: Unset | str = UNSET, + filterincident_broadcast_enabledin: Unset | str = UNSET, + filterincident_broadcast_enablednot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[TeamList]: """List teams @@ -310,45 +310,45 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: Union[Unset, ListTeamsInclude] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterbackstage_id: Union[Unset, str] = UNSET, - filtercortex_id: Union[Unset, str] = UNSET, - filteropslevel_id: Union[Unset, str] = UNSET, - filterexternal_id: Union[Unset, str] = UNSET, - filtercolor: Union[Unset, str] = UNSET, - filteralert_broadcast_enabled: Union[Unset, bool] = UNSET, - filterincident_broadcast_enabled: Union[Unset, bool] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filterslugeq: Union[Unset, str] = UNSET, - filterslugnot_eq: Union[Unset, str] = UNSET, - filterslugin: Union[Unset, str] = UNSET, - filterslugnot_in: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, - filtercoloreq: Union[Unset, str] = UNSET, - filtercolornot_eq: Union[Unset, str] = UNSET, - filtercolorin: Union[Unset, str] = UNSET, - filtercolornot_in: Union[Unset, str] = UNSET, - filteralert_broadcast_enabledeq: Union[Unset, str] = UNSET, - filteralert_broadcast_enablednot_eq: Union[Unset, str] = UNSET, - filteralert_broadcast_enabledin: Union[Unset, str] = UNSET, - filteralert_broadcast_enablednot_in: Union[Unset, str] = UNSET, - filterincident_broadcast_enabledeq: Union[Unset, str] = UNSET, - filterincident_broadcast_enablednot_eq: Union[Unset, str] = UNSET, - filterincident_broadcast_enabledin: Union[Unset, str] = UNSET, - filterincident_broadcast_enablednot_in: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, -) -> Optional[TeamList]: + include: Unset | ListTeamsInclude = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterbackstage_id: Unset | str = UNSET, + filtercortex_id: Unset | str = UNSET, + filteropslevel_id: Unset | str = UNSET, + filterexternal_id: Unset | str = UNSET, + filtercolor: Unset | str = UNSET, + filteralert_broadcast_enabled: Unset | bool = UNSET, + filterincident_broadcast_enabled: Unset | bool = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filtercoloreq: Unset | str = UNSET, + filtercolornot_eq: Unset | str = UNSET, + filtercolorin: Unset | str = UNSET, + filtercolornot_in: Unset | str = UNSET, + filteralert_broadcast_enabledeq: Unset | str = UNSET, + filteralert_broadcast_enablednot_eq: Unset | str = UNSET, + filteralert_broadcast_enabledin: Unset | str = UNSET, + filteralert_broadcast_enablednot_in: Unset | str = UNSET, + filterincident_broadcast_enabledeq: Unset | str = UNSET, + filterincident_broadcast_enablednot_eq: Unset | str = UNSET, + filterincident_broadcast_enabledin: Unset | str = UNSET, + filterincident_broadcast_enablednot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, +) -> TeamList | None: """List teams List teams @@ -447,44 +447,44 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: Union[Unset, ListTeamsInclude] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterbackstage_id: Union[Unset, str] = UNSET, - filtercortex_id: Union[Unset, str] = UNSET, - filteropslevel_id: Union[Unset, str] = UNSET, - filterexternal_id: Union[Unset, str] = UNSET, - filtercolor: Union[Unset, str] = UNSET, - filteralert_broadcast_enabled: Union[Unset, bool] = UNSET, - filterincident_broadcast_enabled: Union[Unset, bool] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filterslugeq: Union[Unset, str] = UNSET, - filterslugnot_eq: Union[Unset, str] = UNSET, - filterslugin: Union[Unset, str] = UNSET, - filterslugnot_in: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, - filtercoloreq: Union[Unset, str] = UNSET, - filtercolornot_eq: Union[Unset, str] = UNSET, - filtercolorin: Union[Unset, str] = UNSET, - filtercolornot_in: Union[Unset, str] = UNSET, - filteralert_broadcast_enabledeq: Union[Unset, str] = UNSET, - filteralert_broadcast_enablednot_eq: Union[Unset, str] = UNSET, - filteralert_broadcast_enabledin: Union[Unset, str] = UNSET, - filteralert_broadcast_enablednot_in: Union[Unset, str] = UNSET, - filterincident_broadcast_enabledeq: Union[Unset, str] = UNSET, - filterincident_broadcast_enablednot_eq: Union[Unset, str] = UNSET, - filterincident_broadcast_enabledin: Union[Unset, str] = UNSET, - filterincident_broadcast_enablednot_in: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, + include: Unset | ListTeamsInclude = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterbackstage_id: Unset | str = UNSET, + filtercortex_id: Unset | str = UNSET, + filteropslevel_id: Unset | str = UNSET, + filterexternal_id: Unset | str = UNSET, + filtercolor: Unset | str = UNSET, + filteralert_broadcast_enabled: Unset | bool = UNSET, + filterincident_broadcast_enabled: Unset | bool = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filtercoloreq: Unset | str = UNSET, + filtercolornot_eq: Unset | str = UNSET, + filtercolorin: Unset | str = UNSET, + filtercolornot_in: Unset | str = UNSET, + filteralert_broadcast_enabledeq: Unset | str = UNSET, + filteralert_broadcast_enablednot_eq: Unset | str = UNSET, + filteralert_broadcast_enabledin: Unset | str = UNSET, + filteralert_broadcast_enablednot_in: Unset | str = UNSET, + filterincident_broadcast_enabledeq: Unset | str = UNSET, + filterincident_broadcast_enablednot_eq: Unset | str = UNSET, + filterincident_broadcast_enabledin: Unset | str = UNSET, + filterincident_broadcast_enablednot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, ) -> Response[TeamList]: """List teams @@ -587,45 +587,45 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: Union[Unset, ListTeamsInclude] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterbackstage_id: Union[Unset, str] = UNSET, - filtercortex_id: Union[Unset, str] = UNSET, - filteropslevel_id: Union[Unset, str] = UNSET, - filterexternal_id: Union[Unset, str] = UNSET, - filtercolor: Union[Unset, str] = UNSET, - filteralert_broadcast_enabled: Union[Unset, bool] = UNSET, - filterincident_broadcast_enabled: Union[Unset, bool] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filterslugeq: Union[Unset, str] = UNSET, - filterslugnot_eq: Union[Unset, str] = UNSET, - filterslugin: Union[Unset, str] = UNSET, - filterslugnot_in: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, - filtercoloreq: Union[Unset, str] = UNSET, - filtercolornot_eq: Union[Unset, str] = UNSET, - filtercolorin: Union[Unset, str] = UNSET, - filtercolornot_in: Union[Unset, str] = UNSET, - filteralert_broadcast_enabledeq: Union[Unset, str] = UNSET, - filteralert_broadcast_enablednot_eq: Union[Unset, str] = UNSET, - filteralert_broadcast_enabledin: Union[Unset, str] = UNSET, - filteralert_broadcast_enablednot_in: Union[Unset, str] = UNSET, - filterincident_broadcast_enabledeq: Union[Unset, str] = UNSET, - filterincident_broadcast_enablednot_eq: Union[Unset, str] = UNSET, - filterincident_broadcast_enabledin: Union[Unset, str] = UNSET, - filterincident_broadcast_enablednot_in: Union[Unset, str] = UNSET, - sort: Union[Unset, str] = UNSET, -) -> Optional[TeamList]: + include: Unset | ListTeamsInclude = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterbackstage_id: Unset | str = UNSET, + filtercortex_id: Unset | str = UNSET, + filteropslevel_id: Unset | str = UNSET, + filterexternal_id: Unset | str = UNSET, + filtercolor: Unset | str = UNSET, + filteralert_broadcast_enabled: Unset | bool = UNSET, + filterincident_broadcast_enabled: Unset | bool = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filtercoloreq: Unset | str = UNSET, + filtercolornot_eq: Unset | str = UNSET, + filtercolorin: Unset | str = UNSET, + filtercolornot_in: Unset | str = UNSET, + filteralert_broadcast_enabledeq: Unset | str = UNSET, + filteralert_broadcast_enablednot_eq: Unset | str = UNSET, + filteralert_broadcast_enabledin: Unset | str = UNSET, + filteralert_broadcast_enablednot_in: Unset | str = UNSET, + filterincident_broadcast_enabledeq: Unset | str = UNSET, + filterincident_broadcast_enablednot_eq: Unset | str = UNSET, + filterincident_broadcast_enabledin: Unset | str = UNSET, + filterincident_broadcast_enablednot_in: Unset | str = UNSET, + sort: Unset | str = UNSET, +) -> TeamList | None: """List teams List teams diff --git a/rootly_sdk/api/teams/update_team.py b/rootly_sdk/api/teams/update_team.py index 590299b0..92f9645a 100644 --- a/rootly_sdk/api/teams/update_team.py +++ b/rootly_sdk/api/teams/update_team.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any from uuid import UUID import httpx @@ -13,7 +13,7 @@ def _get_kwargs( - id: Union[UUID, str], + id: UUID | str, *, body: UpdateTeam, ) -> dict[str, Any]: @@ -33,8 +33,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, TeamResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | TeamResponse | None: if response.status_code == 200: response_200 = TeamResponse.from_dict(response.json()) @@ -52,8 +52,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, TeamResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | TeamResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -63,11 +63,11 @@ def _build_response( def sync_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdateTeam, -) -> Response[Union[ErrorsList, TeamResponse]]: +) -> Response[ErrorsList | TeamResponse]: """Update a team Update a specific team by id @@ -97,11 +97,11 @@ def sync_detailed( def sync( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdateTeam, -) -> Optional[Union[ErrorsList, TeamResponse]]: +) -> ErrorsList | TeamResponse | None: """Update a team Update a specific team by id @@ -126,11 +126,11 @@ def sync( async def asyncio_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdateTeam, -) -> Response[Union[ErrorsList, TeamResponse]]: +) -> Response[ErrorsList | TeamResponse]: """Update a team Update a specific team by id @@ -158,11 +158,11 @@ async def asyncio_detailed( async def asyncio( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdateTeam, -) -> Optional[Union[ErrorsList, TeamResponse]]: +) -> ErrorsList | TeamResponse | None: """Update a team Update a specific team by id diff --git a/rootly_sdk/api/user_email_addresses/create_user_email_address.py b/rootly_sdk/api/user_email_addresses/create_user_email_address.py index 0f5a7e2b..6abb0a4f 100644 --- a/rootly_sdk/api/user_email_addresses/create_user_email_address.py +++ b/rootly_sdk/api/user_email_addresses/create_user_email_address.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, UserEmailAddressResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | UserEmailAddressResponse | None: if response.status_code == 201: response_201 = UserEmailAddressResponse.from_dict(response.json()) @@ -61,8 +61,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, UserEmailAddressResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | UserEmailAddressResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -76,7 +76,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewUserEmailAddress, -) -> Response[Union[ErrorsList, UserEmailAddressResponse]]: +) -> Response[ErrorsList | UserEmailAddressResponse]: """Creates a user email address Creates a new user email address from provided data @@ -110,7 +110,7 @@ def sync( *, client: AuthenticatedClient, body: NewUserEmailAddress, -) -> Optional[Union[ErrorsList, UserEmailAddressResponse]]: +) -> ErrorsList | UserEmailAddressResponse | None: """Creates a user email address Creates a new user email address from provided data @@ -139,7 +139,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewUserEmailAddress, -) -> Response[Union[ErrorsList, UserEmailAddressResponse]]: +) -> Response[ErrorsList | UserEmailAddressResponse]: """Creates a user email address Creates a new user email address from provided data @@ -171,7 +171,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewUserEmailAddress, -) -> Optional[Union[ErrorsList, UserEmailAddressResponse]]: +) -> ErrorsList | UserEmailAddressResponse | None: """Creates a user email address Creates a new user email address from provided data diff --git a/rootly_sdk/api/user_email_addresses/delete_user_email_address.py b/rootly_sdk/api/user_email_addresses/delete_user_email_address.py index afad9ca2..b33ed180 100644 --- a/rootly_sdk/api/user_email_addresses/delete_user_email_address.py +++ b/rootly_sdk/api/user_email_addresses/delete_user_email_address.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, UserEmailAddressResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | UserEmailAddressResponse | None: if response.status_code == 200: response_200 = UserEmailAddressResponse.from_dict(response.json()) @@ -46,8 +46,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, UserEmailAddressResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | UserEmailAddressResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -60,7 +60,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, UserEmailAddressResponse]]: +) -> Response[ErrorsList | UserEmailAddressResponse]: """Delete user email address Deletes a user email address @@ -91,7 +91,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, UserEmailAddressResponse]]: +) -> ErrorsList | UserEmailAddressResponse | None: """Delete user email address Deletes a user email address @@ -117,7 +117,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, UserEmailAddressResponse]]: +) -> Response[ErrorsList | UserEmailAddressResponse]: """Delete user email address Deletes a user email address @@ -146,7 +146,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, UserEmailAddressResponse]]: +) -> ErrorsList | UserEmailAddressResponse | None: """Delete user email address Deletes a user email address diff --git a/rootly_sdk/api/user_email_addresses/get_user_email_addresses.py b/rootly_sdk/api/user_email_addresses/get_user_email_addresses.py index f3a4dc5a..30837a61 100644 --- a/rootly_sdk/api/user_email_addresses/get_user_email_addresses.py +++ b/rootly_sdk/api/user_email_addresses/get_user_email_addresses.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, UserEmailAddressList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | UserEmailAddressList | None: if response.status_code == 200: response_200 = UserEmailAddressList.from_dict(response.json()) @@ -46,8 +46,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, UserEmailAddressList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | UserEmailAddressList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -60,7 +60,7 @@ def sync_detailed( user_id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, UserEmailAddressList]]: +) -> Response[ErrorsList | UserEmailAddressList]: """Retrieves user email addresses Retrieves all email addresses for the specified user @@ -91,7 +91,7 @@ def sync( user_id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, UserEmailAddressList]]: +) -> ErrorsList | UserEmailAddressList | None: """Retrieves user email addresses Retrieves all email addresses for the specified user @@ -117,7 +117,7 @@ async def asyncio_detailed( user_id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, UserEmailAddressList]]: +) -> Response[ErrorsList | UserEmailAddressList]: """Retrieves user email addresses Retrieves all email addresses for the specified user @@ -146,7 +146,7 @@ async def asyncio( user_id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, UserEmailAddressList]]: +) -> ErrorsList | UserEmailAddressList | None: """Retrieves user email addresses Retrieves all email addresses for the specified user diff --git a/rootly_sdk/api/user_email_addresses/resend_user_email_address_verification.py b/rootly_sdk/api/user_email_addresses/resend_user_email_address_verification.py index 6e85b335..b7d03cf9 100644 --- a/rootly_sdk/api/user_email_addresses/resend_user_email_address_verification.py +++ b/rootly_sdk/api/user_email_addresses/resend_user_email_address_verification.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, UserEmailAddressResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | UserEmailAddressResponse | None: if response.status_code == 200: response_200 = UserEmailAddressResponse.from_dict(response.json()) @@ -46,8 +46,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, UserEmailAddressResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | UserEmailAddressResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -60,7 +60,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, UserEmailAddressResponse]]: +) -> Response[ErrorsList | UserEmailAddressResponse]: """Resends verification email Resends verification email for an email address @@ -91,7 +91,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, UserEmailAddressResponse]]: +) -> ErrorsList | UserEmailAddressResponse | None: """Resends verification email Resends verification email for an email address @@ -117,7 +117,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, UserEmailAddressResponse]]: +) -> Response[ErrorsList | UserEmailAddressResponse]: """Resends verification email Resends verification email for an email address @@ -146,7 +146,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, UserEmailAddressResponse]]: +) -> ErrorsList | UserEmailAddressResponse | None: """Resends verification email Resends verification email for an email address diff --git a/rootly_sdk/api/user_email_addresses/show_user_email_address.py b/rootly_sdk/api/user_email_addresses/show_user_email_address.py index e2e9e680..f350ab94 100644 --- a/rootly_sdk/api/user_email_addresses/show_user_email_address.py +++ b/rootly_sdk/api/user_email_addresses/show_user_email_address.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, UserEmailAddressResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | UserEmailAddressResponse | None: if response.status_code == 200: response_200 = UserEmailAddressResponse.from_dict(response.json()) @@ -46,8 +46,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, UserEmailAddressResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | UserEmailAddressResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -60,7 +60,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, UserEmailAddressResponse]]: +) -> Response[ErrorsList | UserEmailAddressResponse]: """Show user email address Retrieves a specific user email address @@ -91,7 +91,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, UserEmailAddressResponse]]: +) -> ErrorsList | UserEmailAddressResponse | None: """Show user email address Retrieves a specific user email address @@ -117,7 +117,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, UserEmailAddressResponse]]: +) -> Response[ErrorsList | UserEmailAddressResponse]: """Show user email address Retrieves a specific user email address @@ -146,7 +146,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, UserEmailAddressResponse]]: +) -> ErrorsList | UserEmailAddressResponse | None: """Show user email address Retrieves a specific user email address diff --git a/rootly_sdk/api/user_email_addresses/update_user_email_address.py b/rootly_sdk/api/user_email_addresses/update_user_email_address.py index de27a6ad..e2af7b2c 100644 --- a/rootly_sdk/api/user_email_addresses/update_user_email_address.py +++ b/rootly_sdk/api/user_email_addresses/update_user_email_address.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, UserEmailAddressResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | UserEmailAddressResponse | None: if response.status_code == 200: response_200 = UserEmailAddressResponse.from_dict(response.json()) @@ -61,8 +61,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, UserEmailAddressResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | UserEmailAddressResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -76,7 +76,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateUserEmailAddress, -) -> Response[Union[ErrorsList, UserEmailAddressResponse]]: +) -> Response[ErrorsList | UserEmailAddressResponse]: """Update user email address Updates a user email address @@ -110,7 +110,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateUserEmailAddress, -) -> Optional[Union[ErrorsList, UserEmailAddressResponse]]: +) -> ErrorsList | UserEmailAddressResponse | None: """Update user email address Updates a user email address @@ -139,7 +139,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateUserEmailAddress, -) -> Response[Union[ErrorsList, UserEmailAddressResponse]]: +) -> Response[ErrorsList | UserEmailAddressResponse]: """Update user email address Updates a user email address @@ -171,7 +171,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateUserEmailAddress, -) -> Optional[Union[ErrorsList, UserEmailAddressResponse]]: +) -> ErrorsList | UserEmailAddressResponse | None: """Update user email address Updates a user email address diff --git a/rootly_sdk/api/user_email_addresses/verify_user_email_address.py b/rootly_sdk/api/user_email_addresses/verify_user_email_address.py index 7fe99ebd..92667c75 100644 --- a/rootly_sdk/api/user_email_addresses/verify_user_email_address.py +++ b/rootly_sdk/api/user_email_addresses/verify_user_email_address.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, UserEmailAddressResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | UserEmailAddressResponse | None: if response.status_code == 200: response_200 = UserEmailAddressResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, UserEmailAddressResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | UserEmailAddressResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -70,7 +70,7 @@ def sync_detailed( *, client: AuthenticatedClient, token: str, -) -> Response[Union[ErrorsList, UserEmailAddressResponse]]: +) -> Response[ErrorsList | UserEmailAddressResponse]: """Verifies an email address with token Verifies an email address using a verification token @@ -104,7 +104,7 @@ def sync( *, client: AuthenticatedClient, token: str, -) -> Optional[Union[ErrorsList, UserEmailAddressResponse]]: +) -> ErrorsList | UserEmailAddressResponse | None: """Verifies an email address with token Verifies an email address using a verification token @@ -133,7 +133,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, token: str, -) -> Response[Union[ErrorsList, UserEmailAddressResponse]]: +) -> Response[ErrorsList | UserEmailAddressResponse]: """Verifies an email address with token Verifies an email address using a verification token @@ -165,7 +165,7 @@ async def asyncio( *, client: AuthenticatedClient, token: str, -) -> Optional[Union[ErrorsList, UserEmailAddressResponse]]: +) -> ErrorsList | UserEmailAddressResponse | None: """Verifies an email address with token Verifies an email address using a verification token diff --git a/rootly_sdk/api/user_notification_rules/create_user_notification_rule.py b/rootly_sdk/api/user_notification_rules/create_user_notification_rule.py index 9852ef02..d1400b94 100644 --- a/rootly_sdk/api/user_notification_rules/create_user_notification_rule.py +++ b/rootly_sdk/api/user_notification_rules/create_user_notification_rule.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, UserNotificationRuleResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | UserNotificationRuleResponse | None: if response.status_code == 201: response_201 = UserNotificationRuleResponse.from_dict(response.json()) @@ -56,8 +56,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, UserNotificationRuleResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | UserNotificationRuleResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -71,7 +71,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewUserNotificationRule, -) -> Response[Union[ErrorsList, UserNotificationRuleResponse]]: +) -> Response[ErrorsList | UserNotificationRuleResponse]: """Creates an user notification rule Creates a new user notification rule from provided data @@ -105,7 +105,7 @@ def sync( *, client: AuthenticatedClient, body: NewUserNotificationRule, -) -> Optional[Union[ErrorsList, UserNotificationRuleResponse]]: +) -> ErrorsList | UserNotificationRuleResponse | None: """Creates an user notification rule Creates a new user notification rule from provided data @@ -134,7 +134,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewUserNotificationRule, -) -> Response[Union[ErrorsList, UserNotificationRuleResponse]]: +) -> Response[ErrorsList | UserNotificationRuleResponse]: """Creates an user notification rule Creates a new user notification rule from provided data @@ -166,7 +166,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewUserNotificationRule, -) -> Optional[Union[ErrorsList, UserNotificationRuleResponse]]: +) -> ErrorsList | UserNotificationRuleResponse | None: """Creates an user notification rule Creates a new user notification rule from provided data diff --git a/rootly_sdk/api/user_notification_rules/delete_user_notification_rule.py b/rootly_sdk/api/user_notification_rules/delete_user_notification_rule.py index 7fc24fab..8e6643d7 100644 --- a/rootly_sdk/api/user_notification_rules/delete_user_notification_rule.py +++ b/rootly_sdk/api/user_notification_rules/delete_user_notification_rule.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, UserNotificationRuleResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | UserNotificationRuleResponse | None: if response.status_code == 200: response_200 = UserNotificationRuleResponse.from_dict(response.json()) @@ -41,8 +41,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, UserNotificationRuleResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | UserNotificationRuleResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -55,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, UserNotificationRuleResponse]]: +) -> Response[ErrorsList | UserNotificationRuleResponse]: """Delete an user notification rule Delete a specific user notification rule by id @@ -86,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, UserNotificationRuleResponse]]: +) -> ErrorsList | UserNotificationRuleResponse | None: """Delete an user notification rule Delete a specific user notification rule by id @@ -112,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, UserNotificationRuleResponse]]: +) -> Response[ErrorsList | UserNotificationRuleResponse]: """Delete an user notification rule Delete a specific user notification rule by id @@ -141,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, UserNotificationRuleResponse]]: +) -> ErrorsList | UserNotificationRuleResponse | None: """Delete an user notification rule Delete a specific user notification rule by id diff --git a/rootly_sdk/api/user_notification_rules/get_user_notification_rule.py b/rootly_sdk/api/user_notification_rules/get_user_notification_rule.py index c42708ed..3951c128 100644 --- a/rootly_sdk/api/user_notification_rules/get_user_notification_rule.py +++ b/rootly_sdk/api/user_notification_rules/get_user_notification_rule.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, UserNotificationRuleResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | UserNotificationRuleResponse | None: if response.status_code == 200: response_200 = UserNotificationRuleResponse.from_dict(response.json()) @@ -41,8 +41,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, UserNotificationRuleResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | UserNotificationRuleResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -55,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, UserNotificationRuleResponse]]: +) -> Response[ErrorsList | UserNotificationRuleResponse]: """Retrieves an user notification rule Retrieves a specific user notification rule by id @@ -86,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, UserNotificationRuleResponse]]: +) -> ErrorsList | UserNotificationRuleResponse | None: """Retrieves an user notification rule Retrieves a specific user notification rule by id @@ -112,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, UserNotificationRuleResponse]]: +) -> Response[ErrorsList | UserNotificationRuleResponse]: """Retrieves an user notification rule Retrieves a specific user notification rule by id @@ -141,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, UserNotificationRuleResponse]]: +) -> ErrorsList | UserNotificationRuleResponse | None: """Retrieves an user notification rule Retrieves a specific user notification rule by id diff --git a/rootly_sdk/api/user_notification_rules/list_user_notification_rules.py b/rootly_sdk/api/user_notification_rules/list_user_notification_rules.py index b1e1c3a2..15115e91 100644 --- a/rootly_sdk/api/user_notification_rules/list_user_notification_rules.py +++ b/rootly_sdk/api/user_notification_rules/list_user_notification_rules.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -12,10 +12,10 @@ def _get_kwargs( user_id: str, *, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - sort: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + sort: Unset | str = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -39,8 +39,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[UserNotificationRuleList]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> UserNotificationRuleList | None: if response.status_code == 200: response_200 = UserNotificationRuleList.from_dict(response.json()) @@ -53,7 +53,7 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response + *, client: AuthenticatedClient | Client, response: httpx.Response ) -> Response[UserNotificationRuleList]: return Response( status_code=HTTPStatus(response.status_code), @@ -67,10 +67,10 @@ def sync_detailed( user_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - sort: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + sort: Unset | str = UNSET, ) -> Response[UserNotificationRuleList]: """List user notification rules @@ -110,11 +110,11 @@ def sync( user_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - sort: Union[Unset, str] = UNSET, -) -> Optional[UserNotificationRuleList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + sort: Unset | str = UNSET, +) -> UserNotificationRuleList | None: """List user notification rules List user notification rules @@ -148,10 +148,10 @@ async def asyncio_detailed( user_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - sort: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + sort: Unset | str = UNSET, ) -> Response[UserNotificationRuleList]: """List user notification rules @@ -189,11 +189,11 @@ async def asyncio( user_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - sort: Union[Unset, str] = UNSET, -) -> Optional[UserNotificationRuleList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + sort: Unset | str = UNSET, +) -> UserNotificationRuleList | None: """List user notification rules List user notification rules diff --git a/rootly_sdk/api/user_notification_rules/update_user_notification_rule.py b/rootly_sdk/api/user_notification_rules/update_user_notification_rule.py index 26a2f4e2..267b399d 100644 --- a/rootly_sdk/api/user_notification_rules/update_user_notification_rule.py +++ b/rootly_sdk/api/user_notification_rules/update_user_notification_rule.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, UserNotificationRuleResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | UserNotificationRuleResponse | None: if response.status_code == 200: response_200 = UserNotificationRuleResponse.from_dict(response.json()) @@ -51,8 +51,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, UserNotificationRuleResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | UserNotificationRuleResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateUserNotificationRule, -) -> Response[Union[ErrorsList, UserNotificationRuleResponse]]: +) -> Response[ErrorsList | UserNotificationRuleResponse]: """Update an user notification rule Update a specific user notification rule by id @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateUserNotificationRule, -) -> Optional[Union[ErrorsList, UserNotificationRuleResponse]]: +) -> ErrorsList | UserNotificationRuleResponse | None: """Update an user notification rule Update a specific user notification rule by id @@ -129,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateUserNotificationRule, -) -> Response[Union[ErrorsList, UserNotificationRuleResponse]]: +) -> Response[ErrorsList | UserNotificationRuleResponse]: """Update an user notification rule Update a specific user notification rule by id @@ -161,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateUserNotificationRule, -) -> Optional[Union[ErrorsList, UserNotificationRuleResponse]]: +) -> ErrorsList | UserNotificationRuleResponse | None: """Update an user notification rule Update a specific user notification rule by id diff --git a/rootly_sdk/api/user_phone_numbers/create_user_phone_number.py b/rootly_sdk/api/user_phone_numbers/create_user_phone_number.py index f70fcda9..8064bd89 100644 --- a/rootly_sdk/api/user_phone_numbers/create_user_phone_number.py +++ b/rootly_sdk/api/user_phone_numbers/create_user_phone_number.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, UserPhoneNumberResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | UserPhoneNumberResponse | None: if response.status_code == 201: response_201 = UserPhoneNumberResponse.from_dict(response.json()) @@ -61,8 +61,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, UserPhoneNumberResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | UserPhoneNumberResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -76,7 +76,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewUserPhoneNumber, -) -> Response[Union[ErrorsList, UserPhoneNumberResponse]]: +) -> Response[ErrorsList | UserPhoneNumberResponse]: """Creates a user phone number Creates a new user phone number from provided data @@ -110,7 +110,7 @@ def sync( *, client: AuthenticatedClient, body: NewUserPhoneNumber, -) -> Optional[Union[ErrorsList, UserPhoneNumberResponse]]: +) -> ErrorsList | UserPhoneNumberResponse | None: """Creates a user phone number Creates a new user phone number from provided data @@ -139,7 +139,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewUserPhoneNumber, -) -> Response[Union[ErrorsList, UserPhoneNumberResponse]]: +) -> Response[ErrorsList | UserPhoneNumberResponse]: """Creates a user phone number Creates a new user phone number from provided data @@ -171,7 +171,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewUserPhoneNumber, -) -> Optional[Union[ErrorsList, UserPhoneNumberResponse]]: +) -> ErrorsList | UserPhoneNumberResponse | None: """Creates a user phone number Creates a new user phone number from provided data diff --git a/rootly_sdk/api/user_phone_numbers/delete_user_phone_number.py b/rootly_sdk/api/user_phone_numbers/delete_user_phone_number.py index 1126603d..a0afefd8 100644 --- a/rootly_sdk/api/user_phone_numbers/delete_user_phone_number.py +++ b/rootly_sdk/api/user_phone_numbers/delete_user_phone_number.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, UserPhoneNumberResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | UserPhoneNumberResponse | None: if response.status_code == 200: response_200 = UserPhoneNumberResponse.from_dict(response.json()) @@ -51,8 +51,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, UserPhoneNumberResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | UserPhoneNumberResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -65,7 +65,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, UserPhoneNumberResponse]]: +) -> Response[ErrorsList | UserPhoneNumberResponse]: """Delete user phone number Deletes a user phone number @@ -96,7 +96,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, UserPhoneNumberResponse]]: +) -> ErrorsList | UserPhoneNumberResponse | None: """Delete user phone number Deletes a user phone number @@ -122,7 +122,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, UserPhoneNumberResponse]]: +) -> Response[ErrorsList | UserPhoneNumberResponse]: """Delete user phone number Deletes a user phone number @@ -151,7 +151,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, UserPhoneNumberResponse]]: +) -> ErrorsList | UserPhoneNumberResponse | None: """Delete user phone number Deletes a user phone number diff --git a/rootly_sdk/api/user_phone_numbers/get_user_phone_numbers.py b/rootly_sdk/api/user_phone_numbers/get_user_phone_numbers.py index 5bc2b4ce..b31cba8f 100644 --- a/rootly_sdk/api/user_phone_numbers/get_user_phone_numbers.py +++ b/rootly_sdk/api/user_phone_numbers/get_user_phone_numbers.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, UserPhoneNumberList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | UserPhoneNumberList | None: if response.status_code == 200: response_200 = UserPhoneNumberList.from_dict(response.json()) @@ -46,8 +46,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, UserPhoneNumberList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | UserPhoneNumberList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -60,7 +60,7 @@ def sync_detailed( user_id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, UserPhoneNumberList]]: +) -> Response[ErrorsList | UserPhoneNumberList]: """Retrieves user phone numbers Retrieves all phone numbers for the specified user @@ -91,7 +91,7 @@ def sync( user_id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, UserPhoneNumberList]]: +) -> ErrorsList | UserPhoneNumberList | None: """Retrieves user phone numbers Retrieves all phone numbers for the specified user @@ -117,7 +117,7 @@ async def asyncio_detailed( user_id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, UserPhoneNumberList]]: +) -> Response[ErrorsList | UserPhoneNumberList]: """Retrieves user phone numbers Retrieves all phone numbers for the specified user @@ -146,7 +146,7 @@ async def asyncio( user_id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, UserPhoneNumberList]]: +) -> ErrorsList | UserPhoneNumberList | None: """Retrieves user phone numbers Retrieves all phone numbers for the specified user diff --git a/rootly_sdk/api/user_phone_numbers/show_user_phone_number.py b/rootly_sdk/api/user_phone_numbers/show_user_phone_number.py index 770751c3..462a38b1 100644 --- a/rootly_sdk/api/user_phone_numbers/show_user_phone_number.py +++ b/rootly_sdk/api/user_phone_numbers/show_user_phone_number.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, UserPhoneNumberResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | UserPhoneNumberResponse | None: if response.status_code == 200: response_200 = UserPhoneNumberResponse.from_dict(response.json()) @@ -46,8 +46,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, UserPhoneNumberResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | UserPhoneNumberResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -60,7 +60,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, UserPhoneNumberResponse]]: +) -> Response[ErrorsList | UserPhoneNumberResponse]: """Show user phone number Retrieves a specific user phone number @@ -91,7 +91,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, UserPhoneNumberResponse]]: +) -> ErrorsList | UserPhoneNumberResponse | None: """Show user phone number Retrieves a specific user phone number @@ -117,7 +117,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, UserPhoneNumberResponse]]: +) -> Response[ErrorsList | UserPhoneNumberResponse]: """Show user phone number Retrieves a specific user phone number @@ -146,7 +146,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, UserPhoneNumberResponse]]: +) -> ErrorsList | UserPhoneNumberResponse | None: """Show user phone number Retrieves a specific user phone number diff --git a/rootly_sdk/api/user_phone_numbers/update_user_phone_number.py b/rootly_sdk/api/user_phone_numbers/update_user_phone_number.py index b9302312..5fc8306a 100644 --- a/rootly_sdk/api/user_phone_numbers/update_user_phone_number.py +++ b/rootly_sdk/api/user_phone_numbers/update_user_phone_number.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, UserPhoneNumberResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | UserPhoneNumberResponse | None: if response.status_code == 200: response_200 = UserPhoneNumberResponse.from_dict(response.json()) @@ -61,8 +61,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, UserPhoneNumberResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | UserPhoneNumberResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -76,7 +76,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateUserPhoneNumber, -) -> Response[Union[ErrorsList, UserPhoneNumberResponse]]: +) -> Response[ErrorsList | UserPhoneNumberResponse]: """Update user phone number Updates a user phone number @@ -110,7 +110,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateUserPhoneNumber, -) -> Optional[Union[ErrorsList, UserPhoneNumberResponse]]: +) -> ErrorsList | UserPhoneNumberResponse | None: """Update user phone number Updates a user phone number @@ -139,7 +139,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateUserPhoneNumber, -) -> Response[Union[ErrorsList, UserPhoneNumberResponse]]: +) -> Response[ErrorsList | UserPhoneNumberResponse]: """Update user phone number Updates a user phone number @@ -171,7 +171,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateUserPhoneNumber, -) -> Optional[Union[ErrorsList, UserPhoneNumberResponse]]: +) -> ErrorsList | UserPhoneNumberResponse | None: """Update user phone number Updates a user phone number diff --git a/rootly_sdk/api/users/delete_user.py b/rootly_sdk/api/users/delete_user.py index 81465710..3aaeadb4 100644 --- a/rootly_sdk/api/users/delete_user.py +++ b/rootly_sdk/api/users/delete_user.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, UserResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | UserResponse | None: if response.status_code == 200: response_200 = UserResponse.from_dict(response.json()) @@ -41,8 +41,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, UserResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | UserResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -55,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, UserResponse]]: +) -> Response[ErrorsList | UserResponse]: """Delete an user Delete a specific user by id @@ -86,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, UserResponse]]: +) -> ErrorsList | UserResponse | None: """Delete an user Delete a specific user by id @@ -112,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, UserResponse]]: +) -> Response[ErrorsList | UserResponse]: """Delete an user Delete a specific user by id @@ -141,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, UserResponse]]: +) -> ErrorsList | UserResponse | None: """Delete an user Delete a specific user by id diff --git a/rootly_sdk/api/users/get_current_user.py b/rootly_sdk/api/users/get_current_user.py index d121d249..2a264abd 100644 --- a/rootly_sdk/api/users/get_current_user.py +++ b/rootly_sdk/api/users/get_current_user.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -20,8 +20,8 @@ def _get_kwargs() -> dict[str, Any]: def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, UserResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | UserResponse | None: if response.status_code == 200: response_200 = UserResponse.from_dict(response.json()) @@ -39,8 +39,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, UserResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | UserResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -52,7 +52,7 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, UserResponse]]: +) -> Response[ErrorsList | UserResponse]: """Get current user Get current user @@ -77,7 +77,7 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, UserResponse]]: +) -> ErrorsList | UserResponse | None: """Get current user Get current user @@ -98,7 +98,7 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, UserResponse]]: +) -> Response[ErrorsList | UserResponse]: """Get current user Get current user @@ -121,7 +121,7 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, UserResponse]]: +) -> ErrorsList | UserResponse | None: """Get current user Get current user diff --git a/rootly_sdk/api/users/get_user.py b/rootly_sdk/api/users/get_user.py index ae91581a..b07da7fd 100644 --- a/rootly_sdk/api/users/get_user.py +++ b/rootly_sdk/api/users/get_user.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -14,11 +14,11 @@ def _get_kwargs( id: str, *, - include: Union[Unset, GetUserInclude] = UNSET, + include: Unset | GetUserInclude = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} - json_include: Union[Unset, str] = UNSET + json_include: Unset | str = UNSET if not isinstance(include, Unset): json_include = include @@ -36,8 +36,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, UserResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | UserResponse | None: if response.status_code == 200: response_200 = UserResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, UserResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | UserResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,8 +69,8 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, - include: Union[Unset, GetUserInclude] = UNSET, -) -> Response[Union[ErrorsList, UserResponse]]: + include: Unset | GetUserInclude = UNSET, +) -> Response[ErrorsList | UserResponse]: """Retrieves an user Retrieves a specific user by id @@ -103,8 +103,8 @@ def sync( id: str, *, client: AuthenticatedClient, - include: Union[Unset, GetUserInclude] = UNSET, -) -> Optional[Union[ErrorsList, UserResponse]]: + include: Unset | GetUserInclude = UNSET, +) -> ErrorsList | UserResponse | None: """Retrieves an user Retrieves a specific user by id @@ -132,8 +132,8 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, - include: Union[Unset, GetUserInclude] = UNSET, -) -> Response[Union[ErrorsList, UserResponse]]: + include: Unset | GetUserInclude = UNSET, +) -> Response[ErrorsList | UserResponse]: """Retrieves an user Retrieves a specific user by id @@ -164,8 +164,8 @@ async def asyncio( id: str, *, client: AuthenticatedClient, - include: Union[Unset, GetUserInclude] = UNSET, -) -> Optional[Union[ErrorsList, UserResponse]]: + include: Unset | GetUserInclude = UNSET, +) -> ErrorsList | UserResponse | None: """Retrieves an user Retrieves a specific user by id diff --git a/rootly_sdk/api/users/list_users.py b/rootly_sdk/api/users/list_users.py index 60b82cf1..0c8ec7b0 100644 --- a/rootly_sdk/api/users/list_users.py +++ b/rootly_sdk/api/users/list_users.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -14,16 +14,16 @@ def _get_kwargs( *, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filteremail: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - sort: Union[Unset, ListUsersSort] = UNSET, - include: Union[Unset, ListUsersInclude] = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filteremail: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | ListUsersSort = UNSET, + include: Unset | ListUsersInclude = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -43,13 +43,13 @@ def _get_kwargs( params["filter[created_at][lte]"] = filtercreated_atlte - json_sort: Union[Unset, str] = UNSET + json_sort: Unset | str = UNSET if not isinstance(sort, Unset): json_sort = sort params["sort"] = json_sort - json_include: Union[Unset, str] = UNSET + json_include: Unset | str = UNSET if not isinstance(include, Unset): json_include = include @@ -66,9 +66,7 @@ def _get_kwargs( return _kwargs -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, UserList]]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> ErrorsList | UserList | None: if response.status_code == 200: response_200 = UserList.from_dict(response.json()) @@ -86,8 +84,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, UserList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | UserList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -99,17 +97,17 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filteremail: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - sort: Union[Unset, ListUsersSort] = UNSET, - include: Union[Unset, ListUsersInclude] = UNSET, -) -> Response[Union[ErrorsList, UserList]]: + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filteremail: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | ListUsersSort = UNSET, + include: Unset | ListUsersInclude = UNSET, +) -> Response[ErrorsList | UserList]: """List users List users @@ -157,17 +155,17 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filteremail: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - sort: Union[Unset, ListUsersSort] = UNSET, - include: Union[Unset, ListUsersInclude] = UNSET, -) -> Optional[Union[ErrorsList, UserList]]: + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filteremail: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | ListUsersSort = UNSET, + include: Unset | ListUsersInclude = UNSET, +) -> ErrorsList | UserList | None: """List users List users @@ -210,17 +208,17 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filteremail: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - sort: Union[Unset, ListUsersSort] = UNSET, - include: Union[Unset, ListUsersInclude] = UNSET, -) -> Response[Union[ErrorsList, UserList]]: + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filteremail: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | ListUsersSort = UNSET, + include: Unset | ListUsersInclude = UNSET, +) -> Response[ErrorsList | UserList]: """List users List users @@ -266,17 +264,17 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filteremail: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - sort: Union[Unset, ListUsersSort] = UNSET, - include: Union[Unset, ListUsersInclude] = UNSET, -) -> Optional[Union[ErrorsList, UserList]]: + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filteremail: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + sort: Unset | ListUsersSort = UNSET, + include: Unset | ListUsersInclude = UNSET, +) -> ErrorsList | UserList | None: """List users List users diff --git a/rootly_sdk/api/users/update_user.py b/rootly_sdk/api/users/update_user.py index 993c9597..c02f9635 100644 --- a/rootly_sdk/api/users/update_user.py +++ b/rootly_sdk/api/users/update_user.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, UserResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | UserResponse | None: if response.status_code == 200: response_200 = UserResponse.from_dict(response.json()) @@ -51,8 +51,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, UserResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | UserResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateUser, -) -> Response[Union[ErrorsList, UserResponse]]: +) -> Response[ErrorsList | UserResponse]: """Update a user Update a specific user by id @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateUser, -) -> Optional[Union[ErrorsList, UserResponse]]: +) -> ErrorsList | UserResponse | None: """Update a user Update a specific user by id @@ -129,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateUser, -) -> Response[Union[ErrorsList, UserResponse]]: +) -> Response[ErrorsList | UserResponse]: """Update a user Update a specific user by id @@ -161,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateUser, -) -> Optional[Union[ErrorsList, UserResponse]]: +) -> ErrorsList | UserResponse | None: """Update a user Update a specific user by id diff --git a/rootly_sdk/api/verified_domains/delete_v1_verified_domains_id.py b/rootly_sdk/api/verified_domains/delete_v1_verified_domains_id.py index 511b079e..26993025 100644 --- a/rootly_sdk/api/verified_domains/delete_v1_verified_domains_id.py +++ b/rootly_sdk/api/verified_domains/delete_v1_verified_domains_id.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -20,9 +20,7 @@ def _get_kwargs( return _kwargs -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[VerifiedDomainResponse]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> VerifiedDomainResponse | None: if response.status_code == 200: response_200 = VerifiedDomainResponse.from_dict(response.json()) @@ -35,7 +33,7 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response + *, client: AuthenticatedClient | Client, response: httpx.Response ) -> Response[VerifiedDomainResponse]: return Response( status_code=HTTPStatus(response.status_code), @@ -78,7 +76,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[VerifiedDomainResponse]: +) -> VerifiedDomainResponse | None: """Delete a verified domain Args: @@ -129,7 +127,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[VerifiedDomainResponse]: +) -> VerifiedDomainResponse | None: """Delete a verified domain Args: diff --git a/rootly_sdk/api/verified_domains/get_v1_verified_domains.py b/rootly_sdk/api/verified_domains/get_v1_verified_domains.py index ac994498..895c23d9 100644 --- a/rootly_sdk/api/verified_domains/get_v1_verified_domains.py +++ b/rootly_sdk/api/verified_domains/get_v1_verified_domains.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -11,8 +11,8 @@ def _get_kwargs( *, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -31,9 +31,7 @@ def _get_kwargs( return _kwargs -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[VerifiedDomainList]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> VerifiedDomainList | None: if response.status_code == 200: response_200 = VerifiedDomainList.from_dict(response.json()) @@ -45,9 +43,7 @@ def _parse_response( return None -def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[VerifiedDomainList]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[VerifiedDomainList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,8 +55,8 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[VerifiedDomainList]: """List verified domains @@ -91,9 +87,9 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, -) -> Optional[VerifiedDomainList]: + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, +) -> VerifiedDomainList | None: """List verified domains Args: @@ -118,8 +114,8 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[VerifiedDomainList]: """List verified domains @@ -148,9 +144,9 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, -) -> Optional[VerifiedDomainList]: + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, +) -> VerifiedDomainList | None: """List verified domains Args: diff --git a/rootly_sdk/api/verified_domains/get_v1_verified_domains_id.py b/rootly_sdk/api/verified_domains/get_v1_verified_domains_id.py index ae232e85..bfeaf46e 100644 --- a/rootly_sdk/api/verified_domains/get_v1_verified_domains_id.py +++ b/rootly_sdk/api/verified_domains/get_v1_verified_domains_id.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -20,9 +20,7 @@ def _get_kwargs( return _kwargs -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[VerifiedDomainResponse]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> VerifiedDomainResponse | None: if response.status_code == 200: response_200 = VerifiedDomainResponse.from_dict(response.json()) @@ -35,7 +33,7 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response + *, client: AuthenticatedClient | Client, response: httpx.Response ) -> Response[VerifiedDomainResponse]: return Response( status_code=HTTPStatus(response.status_code), @@ -78,7 +76,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[VerifiedDomainResponse]: +) -> VerifiedDomainResponse | None: """Show a verified domain Args: @@ -129,7 +127,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[VerifiedDomainResponse]: +) -> VerifiedDomainResponse | None: """Show a verified domain Args: diff --git a/rootly_sdk/api/verified_domains/post_v1_verified_domains.py b/rootly_sdk/api/verified_domains/post_v1_verified_domains.py index 6b9081cd..ef9418fd 100644 --- a/rootly_sdk/api/verified_domains/post_v1_verified_domains.py +++ b/rootly_sdk/api/verified_domains/post_v1_verified_domains.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -29,9 +29,7 @@ def _get_kwargs( return _kwargs -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[VerifiedDomainResponse]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> VerifiedDomainResponse | None: if response.status_code == 201: response_201 = VerifiedDomainResponse.from_dict(response.json()) @@ -44,7 +42,7 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response + *, client: AuthenticatedClient | Client, response: httpx.Response ) -> Response[VerifiedDomainResponse]: return Response( status_code=HTTPStatus(response.status_code), @@ -87,7 +85,7 @@ def sync( *, client: AuthenticatedClient, body: NewVerifiedDomain, -) -> Optional[VerifiedDomainResponse]: +) -> VerifiedDomainResponse | None: """Create a verified domain Args: @@ -138,7 +136,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewVerifiedDomain, -) -> Optional[VerifiedDomainResponse]: +) -> VerifiedDomainResponse | None: """Create a verified domain Args: diff --git a/rootly_sdk/api/webhooks_deliveries/deliver_webhooks_delivery.py b/rootly_sdk/api/webhooks_deliveries/deliver_webhooks_delivery.py index 673d0491..668768b5 100644 --- a/rootly_sdk/api/webhooks_deliveries/deliver_webhooks_delivery.py +++ b/rootly_sdk/api/webhooks_deliveries/deliver_webhooks_delivery.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -21,8 +21,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[WebhooksDeliveryResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> WebhooksDeliveryResponse | None: if response.status_code == 200: response_200 = WebhooksDeliveryResponse.from_dict(response.json()) @@ -35,7 +35,7 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response + *, client: AuthenticatedClient | Client, response: httpx.Response ) -> Response[WebhooksDeliveryResponse]: return Response( status_code=HTTPStatus(response.status_code), @@ -80,7 +80,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[WebhooksDeliveryResponse]: +) -> WebhooksDeliveryResponse | None: """Retries a webhook delivery Retries a webhook delivery @@ -135,7 +135,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[WebhooksDeliveryResponse]: +) -> WebhooksDeliveryResponse | None: """Retries a webhook delivery Retries a webhook delivery diff --git a/rootly_sdk/api/webhooks_deliveries/get_webhooks_delivery.py b/rootly_sdk/api/webhooks_deliveries/get_webhooks_delivery.py index 3584d435..f2dd25c1 100644 --- a/rootly_sdk/api/webhooks_deliveries/get_webhooks_delivery.py +++ b/rootly_sdk/api/webhooks_deliveries/get_webhooks_delivery.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, WebhooksDeliveryResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | WebhooksDeliveryResponse | None: if response.status_code == 200: response_200 = WebhooksDeliveryResponse.from_dict(response.json()) @@ -41,8 +41,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, WebhooksDeliveryResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | WebhooksDeliveryResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -55,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, WebhooksDeliveryResponse]]: +) -> Response[ErrorsList | WebhooksDeliveryResponse]: """Retrieves a webhook delivery Retrieves a specific webhook delivery by id @@ -86,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, WebhooksDeliveryResponse]]: +) -> ErrorsList | WebhooksDeliveryResponse | None: """Retrieves a webhook delivery Retrieves a specific webhook delivery by id @@ -112,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, WebhooksDeliveryResponse]]: +) -> Response[ErrorsList | WebhooksDeliveryResponse]: """Retrieves a webhook delivery Retrieves a specific webhook delivery by id @@ -141,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, WebhooksDeliveryResponse]]: +) -> ErrorsList | WebhooksDeliveryResponse | None: """Retrieves a webhook delivery Retrieves a specific webhook delivery by id diff --git a/rootly_sdk/api/webhooks_deliveries/list_webhooks_deliveries.py b/rootly_sdk/api/webhooks_deliveries/list_webhooks_deliveries.py index 9324b350..406eb177 100644 --- a/rootly_sdk/api/webhooks_deliveries/list_webhooks_deliveries.py +++ b/rootly_sdk/api/webhooks_deliveries/list_webhooks_deliveries.py @@ -1,6 +1,6 @@ import datetime from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -14,18 +14,18 @@ def _get_kwargs( endpoint_id: str, *, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterstatus: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, datetime.datetime] = UNSET, - filtercreated_atgte: Union[Unset, datetime.datetime] = UNSET, - filtercreated_atlt: Union[Unset, datetime.datetime] = UNSET, - filtercreated_atlte: Union[Unset, datetime.datetime] = UNSET, - filterdelivered_atgt: Union[Unset, datetime.datetime] = UNSET, - filterdelivered_atgte: Union[Unset, datetime.datetime] = UNSET, - filterdelivered_atlt: Union[Unset, datetime.datetime] = UNSET, - filterdelivered_atlte: Union[Unset, datetime.datetime] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterstatus: Unset | str = UNSET, + filtercreated_atgt: Unset | datetime.datetime = UNSET, + filtercreated_atgte: Unset | datetime.datetime = UNSET, + filtercreated_atlt: Unset | datetime.datetime = UNSET, + filtercreated_atlte: Unset | datetime.datetime = UNSET, + filterdelivered_atgt: Unset | datetime.datetime = UNSET, + filterdelivered_atgte: Unset | datetime.datetime = UNSET, + filterdelivered_atlt: Unset | datetime.datetime = UNSET, + filterdelivered_atlte: Unset | datetime.datetime = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -37,42 +37,42 @@ def _get_kwargs( params["filter[status]"] = filterstatus - json_filtercreated_atgt: Union[Unset, str] = UNSET + json_filtercreated_atgt: Unset | str = UNSET if not isinstance(filtercreated_atgt, Unset): json_filtercreated_atgt = filtercreated_atgt.isoformat() params["filter[created_at][gt]"] = json_filtercreated_atgt - json_filtercreated_atgte: Union[Unset, str] = UNSET + json_filtercreated_atgte: Unset | str = UNSET if not isinstance(filtercreated_atgte, Unset): json_filtercreated_atgte = filtercreated_atgte.isoformat() params["filter[created_at][gte]"] = json_filtercreated_atgte - json_filtercreated_atlt: Union[Unset, str] = UNSET + json_filtercreated_atlt: Unset | str = UNSET if not isinstance(filtercreated_atlt, Unset): json_filtercreated_atlt = filtercreated_atlt.isoformat() params["filter[created_at][lt]"] = json_filtercreated_atlt - json_filtercreated_atlte: Union[Unset, str] = UNSET + json_filtercreated_atlte: Unset | str = UNSET if not isinstance(filtercreated_atlte, Unset): json_filtercreated_atlte = filtercreated_atlte.isoformat() params["filter[created_at][lte]"] = json_filtercreated_atlte - json_filterdelivered_atgt: Union[Unset, str] = UNSET + json_filterdelivered_atgt: Unset | str = UNSET if not isinstance(filterdelivered_atgt, Unset): json_filterdelivered_atgt = filterdelivered_atgt.isoformat() params["filter[delivered_at][gt]"] = json_filterdelivered_atgt - json_filterdelivered_atgte: Union[Unset, str] = UNSET + json_filterdelivered_atgte: Unset | str = UNSET if not isinstance(filterdelivered_atgte, Unset): json_filterdelivered_atgte = filterdelivered_atgte.isoformat() params["filter[delivered_at][gte]"] = json_filterdelivered_atgte - json_filterdelivered_atlt: Union[Unset, str] = UNSET + json_filterdelivered_atlt: Unset | str = UNSET if not isinstance(filterdelivered_atlt, Unset): json_filterdelivered_atlt = filterdelivered_atlt.isoformat() params["filter[delivered_at][lt]"] = json_filterdelivered_atlt - json_filterdelivered_atlte: Union[Unset, str] = UNSET + json_filterdelivered_atlte: Unset | str = UNSET if not isinstance(filterdelivered_atlte, Unset): json_filterdelivered_atlte = filterdelivered_atlte.isoformat() params["filter[delivered_at][lte]"] = json_filterdelivered_atlte @@ -89,8 +89,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, WebhooksDeliveryList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | WebhooksDeliveryList | None: if response.status_code == 200: response_200 = WebhooksDeliveryList.from_dict(response.json()) @@ -108,8 +108,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, WebhooksDeliveryList]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | WebhooksDeliveryList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -122,19 +122,19 @@ def sync_detailed( endpoint_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterstatus: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, datetime.datetime] = UNSET, - filtercreated_atgte: Union[Unset, datetime.datetime] = UNSET, - filtercreated_atlt: Union[Unset, datetime.datetime] = UNSET, - filtercreated_atlte: Union[Unset, datetime.datetime] = UNSET, - filterdelivered_atgt: Union[Unset, datetime.datetime] = UNSET, - filterdelivered_atgte: Union[Unset, datetime.datetime] = UNSET, - filterdelivered_atlt: Union[Unset, datetime.datetime] = UNSET, - filterdelivered_atlte: Union[Unset, datetime.datetime] = UNSET, -) -> Response[Union[ErrorsList, WebhooksDeliveryList]]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterstatus: Unset | str = UNSET, + filtercreated_atgt: Unset | datetime.datetime = UNSET, + filtercreated_atgte: Unset | datetime.datetime = UNSET, + filtercreated_atlt: Unset | datetime.datetime = UNSET, + filtercreated_atlte: Unset | datetime.datetime = UNSET, + filterdelivered_atgt: Unset | datetime.datetime = UNSET, + filterdelivered_atgte: Unset | datetime.datetime = UNSET, + filterdelivered_atlt: Unset | datetime.datetime = UNSET, + filterdelivered_atlte: Unset | datetime.datetime = UNSET, +) -> Response[ErrorsList | WebhooksDeliveryList]: """List webhook deliveries List webhook deliveries for given endpoint @@ -189,19 +189,19 @@ def sync( endpoint_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterstatus: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, datetime.datetime] = UNSET, - filtercreated_atgte: Union[Unset, datetime.datetime] = UNSET, - filtercreated_atlt: Union[Unset, datetime.datetime] = UNSET, - filtercreated_atlte: Union[Unset, datetime.datetime] = UNSET, - filterdelivered_atgt: Union[Unset, datetime.datetime] = UNSET, - filterdelivered_atgte: Union[Unset, datetime.datetime] = UNSET, - filterdelivered_atlt: Union[Unset, datetime.datetime] = UNSET, - filterdelivered_atlte: Union[Unset, datetime.datetime] = UNSET, -) -> Optional[Union[ErrorsList, WebhooksDeliveryList]]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterstatus: Unset | str = UNSET, + filtercreated_atgt: Unset | datetime.datetime = UNSET, + filtercreated_atgte: Unset | datetime.datetime = UNSET, + filtercreated_atlt: Unset | datetime.datetime = UNSET, + filtercreated_atlte: Unset | datetime.datetime = UNSET, + filterdelivered_atgt: Unset | datetime.datetime = UNSET, + filterdelivered_atgte: Unset | datetime.datetime = UNSET, + filterdelivered_atlt: Unset | datetime.datetime = UNSET, + filterdelivered_atlte: Unset | datetime.datetime = UNSET, +) -> ErrorsList | WebhooksDeliveryList | None: """List webhook deliveries List webhook deliveries for given endpoint @@ -251,19 +251,19 @@ async def asyncio_detailed( endpoint_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterstatus: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, datetime.datetime] = UNSET, - filtercreated_atgte: Union[Unset, datetime.datetime] = UNSET, - filtercreated_atlt: Union[Unset, datetime.datetime] = UNSET, - filtercreated_atlte: Union[Unset, datetime.datetime] = UNSET, - filterdelivered_atgt: Union[Unset, datetime.datetime] = UNSET, - filterdelivered_atgte: Union[Unset, datetime.datetime] = UNSET, - filterdelivered_atlt: Union[Unset, datetime.datetime] = UNSET, - filterdelivered_atlte: Union[Unset, datetime.datetime] = UNSET, -) -> Response[Union[ErrorsList, WebhooksDeliveryList]]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterstatus: Unset | str = UNSET, + filtercreated_atgt: Unset | datetime.datetime = UNSET, + filtercreated_atgte: Unset | datetime.datetime = UNSET, + filtercreated_atlt: Unset | datetime.datetime = UNSET, + filtercreated_atlte: Unset | datetime.datetime = UNSET, + filterdelivered_atgt: Unset | datetime.datetime = UNSET, + filterdelivered_atgte: Unset | datetime.datetime = UNSET, + filterdelivered_atlt: Unset | datetime.datetime = UNSET, + filterdelivered_atlte: Unset | datetime.datetime = UNSET, +) -> Response[ErrorsList | WebhooksDeliveryList]: """List webhook deliveries List webhook deliveries for given endpoint @@ -316,19 +316,19 @@ async def asyncio( endpoint_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterstatus: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, datetime.datetime] = UNSET, - filtercreated_atgte: Union[Unset, datetime.datetime] = UNSET, - filtercreated_atlt: Union[Unset, datetime.datetime] = UNSET, - filtercreated_atlte: Union[Unset, datetime.datetime] = UNSET, - filterdelivered_atgt: Union[Unset, datetime.datetime] = UNSET, - filterdelivered_atgte: Union[Unset, datetime.datetime] = UNSET, - filterdelivered_atlt: Union[Unset, datetime.datetime] = UNSET, - filterdelivered_atlte: Union[Unset, datetime.datetime] = UNSET, -) -> Optional[Union[ErrorsList, WebhooksDeliveryList]]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterstatus: Unset | str = UNSET, + filtercreated_atgt: Unset | datetime.datetime = UNSET, + filtercreated_atgte: Unset | datetime.datetime = UNSET, + filtercreated_atlt: Unset | datetime.datetime = UNSET, + filtercreated_atlte: Unset | datetime.datetime = UNSET, + filterdelivered_atgt: Unset | datetime.datetime = UNSET, + filterdelivered_atgte: Unset | datetime.datetime = UNSET, + filterdelivered_atlt: Unset | datetime.datetime = UNSET, + filterdelivered_atlte: Unset | datetime.datetime = UNSET, +) -> ErrorsList | WebhooksDeliveryList | None: """List webhook deliveries List webhook deliveries for given endpoint diff --git a/rootly_sdk/api/webhooks_endpoints/create_webhooks_endpoint.py b/rootly_sdk/api/webhooks_endpoints/create_webhooks_endpoint.py index 5d081f71..a17df666 100644 --- a/rootly_sdk/api/webhooks_endpoints/create_webhooks_endpoint.py +++ b/rootly_sdk/api/webhooks_endpoints/create_webhooks_endpoint.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, WebhooksEndpointResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | WebhooksEndpointResponse | None: if response.status_code == 201: response_201 = WebhooksEndpointResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, WebhooksEndpointResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | WebhooksEndpointResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +69,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewWebhooksEndpoint, -) -> Response[Union[ErrorsList, WebhooksEndpointResponse]]: +) -> Response[ErrorsList | WebhooksEndpointResponse]: """Creates a webhook endpoint Creates a new webhook endpoint from provided data @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: NewWebhooksEndpoint, -) -> Optional[Union[ErrorsList, WebhooksEndpointResponse]]: +) -> ErrorsList | WebhooksEndpointResponse | None: """Creates a webhook endpoint Creates a new webhook endpoint from provided data @@ -126,7 +126,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewWebhooksEndpoint, -) -> Response[Union[ErrorsList, WebhooksEndpointResponse]]: +) -> Response[ErrorsList | WebhooksEndpointResponse]: """Creates a webhook endpoint Creates a new webhook endpoint from provided data @@ -155,7 +155,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewWebhooksEndpoint, -) -> Optional[Union[ErrorsList, WebhooksEndpointResponse]]: +) -> ErrorsList | WebhooksEndpointResponse | None: """Creates a webhook endpoint Creates a new webhook endpoint from provided data diff --git a/rootly_sdk/api/webhooks_endpoints/delete_webhooks_endpoint.py b/rootly_sdk/api/webhooks_endpoints/delete_webhooks_endpoint.py index 2c766231..05ed1579 100644 --- a/rootly_sdk/api/webhooks_endpoints/delete_webhooks_endpoint.py +++ b/rootly_sdk/api/webhooks_endpoints/delete_webhooks_endpoint.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, WebhooksEndpointResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | WebhooksEndpointResponse | None: if response.status_code == 200: response_200 = WebhooksEndpointResponse.from_dict(response.json()) @@ -41,8 +41,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, WebhooksEndpointResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | WebhooksEndpointResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -55,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, WebhooksEndpointResponse]]: +) -> Response[ErrorsList | WebhooksEndpointResponse]: """Delete a webhook endpoint Delete a specific webhook endpoint by id @@ -86,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, WebhooksEndpointResponse]]: +) -> ErrorsList | WebhooksEndpointResponse | None: """Delete a webhook endpoint Delete a specific webhook endpoint by id @@ -112,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, WebhooksEndpointResponse]]: +) -> Response[ErrorsList | WebhooksEndpointResponse]: """Delete a webhook endpoint Delete a specific webhook endpoint by id @@ -141,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, WebhooksEndpointResponse]]: +) -> ErrorsList | WebhooksEndpointResponse | None: """Delete a webhook endpoint Delete a specific webhook endpoint by id diff --git a/rootly_sdk/api/webhooks_endpoints/get_webhooks_endpoint.py b/rootly_sdk/api/webhooks_endpoints/get_webhooks_endpoint.py index 6df73b81..9030cf93 100644 --- a/rootly_sdk/api/webhooks_endpoints/get_webhooks_endpoint.py +++ b/rootly_sdk/api/webhooks_endpoints/get_webhooks_endpoint.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, WebhooksEndpointResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | WebhooksEndpointResponse | None: if response.status_code == 200: response_200 = WebhooksEndpointResponse.from_dict(response.json()) @@ -41,8 +41,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, WebhooksEndpointResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | WebhooksEndpointResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -55,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, WebhooksEndpointResponse]]: +) -> Response[ErrorsList | WebhooksEndpointResponse]: """Retrieves a webhook endpoint Retrieves a specific webhook endpoint by id @@ -86,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, WebhooksEndpointResponse]]: +) -> ErrorsList | WebhooksEndpointResponse | None: """Retrieves a webhook endpoint Retrieves a specific webhook endpoint by id @@ -112,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, WebhooksEndpointResponse]]: +) -> Response[ErrorsList | WebhooksEndpointResponse]: """Retrieves a webhook endpoint Retrieves a specific webhook endpoint by id @@ -141,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, WebhooksEndpointResponse]]: +) -> ErrorsList | WebhooksEndpointResponse | None: """Retrieves a webhook endpoint Retrieves a specific webhook endpoint by id diff --git a/rootly_sdk/api/webhooks_endpoints/list_webhooks_endpoints.py b/rootly_sdk/api/webhooks_endpoints/list_webhooks_endpoints.py index 4d467067..b3665ca8 100644 --- a/rootly_sdk/api/webhooks_endpoints/list_webhooks_endpoints.py +++ b/rootly_sdk/api/webhooks_endpoints/list_webhooks_endpoints.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -11,11 +11,11 @@ def _get_kwargs( *, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -40,9 +40,7 @@ def _get_kwargs( return _kwargs -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[WebhooksEndpointList]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> WebhooksEndpointList | None: if response.status_code == 200: response_200 = WebhooksEndpointList.from_dict(response.json()) @@ -55,7 +53,7 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response + *, client: AuthenticatedClient | Client, response: httpx.Response ) -> Response[WebhooksEndpointList]: return Response( status_code=HTTPStatus(response.status_code), @@ -68,11 +66,11 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, ) -> Response[WebhooksEndpointList]: """List webhook endpoints @@ -111,12 +109,12 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, -) -> Optional[WebhooksEndpointList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, +) -> WebhooksEndpointList | None: """List webhook endpoints List webhook endpoints @@ -149,11 +147,11 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, ) -> Response[WebhooksEndpointList]: """List webhook endpoints @@ -190,12 +188,12 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, -) -> Optional[WebhooksEndpointList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filterslug: Unset | str = UNSET, + filtername: Unset | str = UNSET, +) -> WebhooksEndpointList | None: """List webhook endpoints List webhook endpoints diff --git a/rootly_sdk/api/webhooks_endpoints/update_webhooks_endpoint.py b/rootly_sdk/api/webhooks_endpoints/update_webhooks_endpoint.py index fdecbe74..daeca8b2 100644 --- a/rootly_sdk/api/webhooks_endpoints/update_webhooks_endpoint.py +++ b/rootly_sdk/api/webhooks_endpoints/update_webhooks_endpoint.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, WebhooksEndpointResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | WebhooksEndpointResponse | None: if response.status_code == 200: response_200 = WebhooksEndpointResponse.from_dict(response.json()) @@ -51,8 +51,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, WebhooksEndpointResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | WebhooksEndpointResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateWebhooksEndpoint, -) -> Response[Union[ErrorsList, WebhooksEndpointResponse]]: +) -> Response[ErrorsList | WebhooksEndpointResponse]: """Update a webhook endpoint Update a specific webhook endpoint by id @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateWebhooksEndpoint, -) -> Optional[Union[ErrorsList, WebhooksEndpointResponse]]: +) -> ErrorsList | WebhooksEndpointResponse | None: """Update a webhook endpoint Update a specific webhook endpoint by id @@ -129,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateWebhooksEndpoint, -) -> Response[Union[ErrorsList, WebhooksEndpointResponse]]: +) -> Response[ErrorsList | WebhooksEndpointResponse]: """Update a webhook endpoint Update a specific webhook endpoint by id @@ -161,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateWebhooksEndpoint, -) -> Optional[Union[ErrorsList, WebhooksEndpointResponse]]: +) -> ErrorsList | WebhooksEndpointResponse | None: """Update a webhook endpoint Update a specific webhook endpoint by id diff --git a/rootly_sdk/api/workflow_action_item_form_field_conditions/create_workflow_action_item_form_field_condition.py b/rootly_sdk/api/workflow_action_item_form_field_conditions/create_workflow_action_item_form_field_condition.py index ad28f48f..716282fc 100644 --- a/rootly_sdk/api/workflow_action_item_form_field_conditions/create_workflow_action_item_form_field_condition.py +++ b/rootly_sdk/api/workflow_action_item_form_field_conditions/create_workflow_action_item_form_field_condition.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union, cast +from typing import Any, cast import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[Any, ErrorsList, WorkflowActionItemFormFieldConditionResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Any | ErrorsList | WorkflowActionItemFormFieldConditionResponse | None: if response.status_code == 201: response_201 = WorkflowActionItemFormFieldConditionResponse.from_dict(response.json()) @@ -60,8 +60,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[Any, ErrorsList, WorkflowActionItemFormFieldConditionResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[Any | ErrorsList | WorkflowActionItemFormFieldConditionResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -75,7 +75,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewWorkflowActionItemFormFieldCondition, -) -> Response[Union[Any, ErrorsList, WorkflowActionItemFormFieldConditionResponse]]: +) -> Response[Any | ErrorsList | WorkflowActionItemFormFieldConditionResponse]: """Creates a workflow action item form field condition Creates a new workflow action item form field condition from provided data @@ -109,7 +109,7 @@ def sync( *, client: AuthenticatedClient, body: NewWorkflowActionItemFormFieldCondition, -) -> Optional[Union[Any, ErrorsList, WorkflowActionItemFormFieldConditionResponse]]: +) -> Any | ErrorsList | WorkflowActionItemFormFieldConditionResponse | None: """Creates a workflow action item form field condition Creates a new workflow action item form field condition from provided data @@ -138,7 +138,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewWorkflowActionItemFormFieldCondition, -) -> Response[Union[Any, ErrorsList, WorkflowActionItemFormFieldConditionResponse]]: +) -> Response[Any | ErrorsList | WorkflowActionItemFormFieldConditionResponse]: """Creates a workflow action item form field condition Creates a new workflow action item form field condition from provided data @@ -170,7 +170,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewWorkflowActionItemFormFieldCondition, -) -> Optional[Union[Any, ErrorsList, WorkflowActionItemFormFieldConditionResponse]]: +) -> Any | ErrorsList | WorkflowActionItemFormFieldConditionResponse | None: """Creates a workflow action item form field condition Creates a new workflow action item form field condition from provided data diff --git a/rootly_sdk/api/workflow_action_item_form_field_conditions/delete_workflow_action_item_form_field_condition.py b/rootly_sdk/api/workflow_action_item_form_field_conditions/delete_workflow_action_item_form_field_condition.py index 6be46910..4e92ec96 100644 --- a/rootly_sdk/api/workflow_action_item_form_field_conditions/delete_workflow_action_item_form_field_condition.py +++ b/rootly_sdk/api/workflow_action_item_form_field_conditions/delete_workflow_action_item_form_field_condition.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, WorkflowActionItemFormFieldConditionResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | WorkflowActionItemFormFieldConditionResponse | None: if response.status_code == 200: response_200 = WorkflowActionItemFormFieldConditionResponse.from_dict(response.json()) @@ -41,8 +41,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, WorkflowActionItemFormFieldConditionResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | WorkflowActionItemFormFieldConditionResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -55,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, WorkflowActionItemFormFieldConditionResponse]]: +) -> Response[ErrorsList | WorkflowActionItemFormFieldConditionResponse]: """Delete a workflow action item form field condition Delete a specific workflow action item form field condition by id @@ -86,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, WorkflowActionItemFormFieldConditionResponse]]: +) -> ErrorsList | WorkflowActionItemFormFieldConditionResponse | None: """Delete a workflow action item form field condition Delete a specific workflow action item form field condition by id @@ -112,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, WorkflowActionItemFormFieldConditionResponse]]: +) -> Response[ErrorsList | WorkflowActionItemFormFieldConditionResponse]: """Delete a workflow action item form field condition Delete a specific workflow action item form field condition by id @@ -141,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, WorkflowActionItemFormFieldConditionResponse]]: +) -> ErrorsList | WorkflowActionItemFormFieldConditionResponse | None: """Delete a workflow action item form field condition Delete a specific workflow action item form field condition by id diff --git a/rootly_sdk/api/workflow_action_item_form_field_conditions/get_workflow_action_item_form_field_condition.py b/rootly_sdk/api/workflow_action_item_form_field_conditions/get_workflow_action_item_form_field_condition.py index a4b2b77b..c1e9e0cc 100644 --- a/rootly_sdk/api/workflow_action_item_form_field_conditions/get_workflow_action_item_form_field_condition.py +++ b/rootly_sdk/api/workflow_action_item_form_field_conditions/get_workflow_action_item_form_field_condition.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, WorkflowActionItemFormFieldConditionResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | WorkflowActionItemFormFieldConditionResponse | None: if response.status_code == 200: response_200 = WorkflowActionItemFormFieldConditionResponse.from_dict(response.json()) @@ -41,8 +41,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, WorkflowActionItemFormFieldConditionResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | WorkflowActionItemFormFieldConditionResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -55,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, WorkflowActionItemFormFieldConditionResponse]]: +) -> Response[ErrorsList | WorkflowActionItemFormFieldConditionResponse]: """Retrieves a workflow action item form field condition Retrieves a specific workflow action item form field condition by id @@ -86,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, WorkflowActionItemFormFieldConditionResponse]]: +) -> ErrorsList | WorkflowActionItemFormFieldConditionResponse | None: """Retrieves a workflow action item form field condition Retrieves a specific workflow action item form field condition by id @@ -112,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, WorkflowActionItemFormFieldConditionResponse]]: +) -> Response[ErrorsList | WorkflowActionItemFormFieldConditionResponse]: """Retrieves a workflow action item form field condition Retrieves a specific workflow action item form field condition by id @@ -141,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, WorkflowActionItemFormFieldConditionResponse]]: +) -> ErrorsList | WorkflowActionItemFormFieldConditionResponse | None: """Retrieves a workflow action item form field condition Retrieves a specific workflow action item form field condition by id diff --git a/rootly_sdk/api/workflow_action_item_form_field_conditions/list_workflow_action_item_form_field_conditions.py b/rootly_sdk/api/workflow_action_item_form_field_conditions/list_workflow_action_item_form_field_conditions.py index e9709332..e5cbae29 100644 --- a/rootly_sdk/api/workflow_action_item_form_field_conditions/list_workflow_action_item_form_field_conditions.py +++ b/rootly_sdk/api/workflow_action_item_form_field_conditions/list_workflow_action_item_form_field_conditions.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -12,9 +12,9 @@ def _get_kwargs( workflow_id: str, *, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -36,8 +36,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[WorkflowActionItemFormFieldConditionList]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> WorkflowActionItemFormFieldConditionList | None: if response.status_code == 200: response_200 = WorkflowActionItemFormFieldConditionList.from_dict(response.json()) @@ -50,7 +50,7 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response + *, client: AuthenticatedClient | Client, response: httpx.Response ) -> Response[WorkflowActionItemFormFieldConditionList]: return Response( status_code=HTTPStatus(response.status_code), @@ -64,9 +64,9 @@ def sync_detailed( workflow_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[WorkflowActionItemFormFieldConditionList]: """List workflow action item form field conditions @@ -104,10 +104,10 @@ def sync( workflow_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, -) -> Optional[WorkflowActionItemFormFieldConditionList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, +) -> WorkflowActionItemFormFieldConditionList | None: """List workflow action item form field conditions List workflow action item form field conditions @@ -139,9 +139,9 @@ async def asyncio_detailed( workflow_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[WorkflowActionItemFormFieldConditionList]: """List workflow action item form field conditions @@ -177,10 +177,10 @@ async def asyncio( workflow_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, -) -> Optional[WorkflowActionItemFormFieldConditionList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, +) -> WorkflowActionItemFormFieldConditionList | None: """List workflow action item form field conditions List workflow action item form field conditions diff --git a/rootly_sdk/api/workflow_action_item_form_field_conditions/update_workflow_action_item_form_field_condition.py b/rootly_sdk/api/workflow_action_item_form_field_conditions/update_workflow_action_item_form_field_condition.py index 85690d2a..44851c12 100644 --- a/rootly_sdk/api/workflow_action_item_form_field_conditions/update_workflow_action_item_form_field_condition.py +++ b/rootly_sdk/api/workflow_action_item_form_field_conditions/update_workflow_action_item_form_field_condition.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, WorkflowActionItemFormFieldConditionResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | WorkflowActionItemFormFieldConditionResponse | None: if response.status_code == 200: response_200 = WorkflowActionItemFormFieldConditionResponse.from_dict(response.json()) @@ -51,8 +51,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, WorkflowActionItemFormFieldConditionResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | WorkflowActionItemFormFieldConditionResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateWorkflowActionItemFormFieldCondition, -) -> Response[Union[ErrorsList, WorkflowActionItemFormFieldConditionResponse]]: +) -> Response[ErrorsList | WorkflowActionItemFormFieldConditionResponse]: """Update a workflow action item form field condition Update a specific workflow action item form field condition by id @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateWorkflowActionItemFormFieldCondition, -) -> Optional[Union[ErrorsList, WorkflowActionItemFormFieldConditionResponse]]: +) -> ErrorsList | WorkflowActionItemFormFieldConditionResponse | None: """Update a workflow action item form field condition Update a specific workflow action item form field condition by id @@ -129,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateWorkflowActionItemFormFieldCondition, -) -> Response[Union[ErrorsList, WorkflowActionItemFormFieldConditionResponse]]: +) -> Response[ErrorsList | WorkflowActionItemFormFieldConditionResponse]: """Update a workflow action item form field condition Update a specific workflow action item form field condition by id @@ -161,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateWorkflowActionItemFormFieldCondition, -) -> Optional[Union[ErrorsList, WorkflowActionItemFormFieldConditionResponse]]: +) -> ErrorsList | WorkflowActionItemFormFieldConditionResponse | None: """Update a workflow action item form field condition Update a specific workflow action item form field condition by id diff --git a/rootly_sdk/api/workflow_form_field_conditions/create_workflow_form_field_condition.py b/rootly_sdk/api/workflow_form_field_conditions/create_workflow_form_field_condition.py index 0fb0bba0..6fd39430 100644 --- a/rootly_sdk/api/workflow_form_field_conditions/create_workflow_form_field_condition.py +++ b/rootly_sdk/api/workflow_form_field_conditions/create_workflow_form_field_condition.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, WorkflowFormFieldConditionResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | WorkflowFormFieldConditionResponse | None: if response.status_code == 201: response_201 = WorkflowFormFieldConditionResponse.from_dict(response.json()) @@ -56,8 +56,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, WorkflowFormFieldConditionResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | WorkflowFormFieldConditionResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -71,7 +71,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewWorkflowFormFieldCondition, -) -> Response[Union[ErrorsList, WorkflowFormFieldConditionResponse]]: +) -> Response[ErrorsList | WorkflowFormFieldConditionResponse]: """Creates a workflow form field condition Creates a new workflow form field condition from provided data @@ -105,7 +105,7 @@ def sync( *, client: AuthenticatedClient, body: NewWorkflowFormFieldCondition, -) -> Optional[Union[ErrorsList, WorkflowFormFieldConditionResponse]]: +) -> ErrorsList | WorkflowFormFieldConditionResponse | None: """Creates a workflow form field condition Creates a new workflow form field condition from provided data @@ -134,7 +134,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewWorkflowFormFieldCondition, -) -> Response[Union[ErrorsList, WorkflowFormFieldConditionResponse]]: +) -> Response[ErrorsList | WorkflowFormFieldConditionResponse]: """Creates a workflow form field condition Creates a new workflow form field condition from provided data @@ -166,7 +166,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewWorkflowFormFieldCondition, -) -> Optional[Union[ErrorsList, WorkflowFormFieldConditionResponse]]: +) -> ErrorsList | WorkflowFormFieldConditionResponse | None: """Creates a workflow form field condition Creates a new workflow form field condition from provided data diff --git a/rootly_sdk/api/workflow_form_field_conditions/delete_workflow_form_field_condition.py b/rootly_sdk/api/workflow_form_field_conditions/delete_workflow_form_field_condition.py index cfd84c05..d8a84656 100644 --- a/rootly_sdk/api/workflow_form_field_conditions/delete_workflow_form_field_condition.py +++ b/rootly_sdk/api/workflow_form_field_conditions/delete_workflow_form_field_condition.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, WorkflowFormFieldConditionResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | WorkflowFormFieldConditionResponse | None: if response.status_code == 200: response_200 = WorkflowFormFieldConditionResponse.from_dict(response.json()) @@ -41,8 +41,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, WorkflowFormFieldConditionResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | WorkflowFormFieldConditionResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -55,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, WorkflowFormFieldConditionResponse]]: +) -> Response[ErrorsList | WorkflowFormFieldConditionResponse]: """Delete a workflow_form field condition Delete a specific workflow form field condition by id @@ -86,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, WorkflowFormFieldConditionResponse]]: +) -> ErrorsList | WorkflowFormFieldConditionResponse | None: """Delete a workflow_form field condition Delete a specific workflow form field condition by id @@ -112,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, WorkflowFormFieldConditionResponse]]: +) -> Response[ErrorsList | WorkflowFormFieldConditionResponse]: """Delete a workflow_form field condition Delete a specific workflow form field condition by id @@ -141,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, WorkflowFormFieldConditionResponse]]: +) -> ErrorsList | WorkflowFormFieldConditionResponse | None: """Delete a workflow_form field condition Delete a specific workflow form field condition by id diff --git a/rootly_sdk/api/workflow_form_field_conditions/get_workflow_form_field_condition.py b/rootly_sdk/api/workflow_form_field_conditions/get_workflow_form_field_condition.py index c8bfb3a8..a5e5f940 100644 --- a/rootly_sdk/api/workflow_form_field_conditions/get_workflow_form_field_condition.py +++ b/rootly_sdk/api/workflow_form_field_conditions/get_workflow_form_field_condition.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, WorkflowFormFieldConditionResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | WorkflowFormFieldConditionResponse | None: if response.status_code == 200: response_200 = WorkflowFormFieldConditionResponse.from_dict(response.json()) @@ -41,8 +41,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, WorkflowFormFieldConditionResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | WorkflowFormFieldConditionResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -55,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, WorkflowFormFieldConditionResponse]]: +) -> Response[ErrorsList | WorkflowFormFieldConditionResponse]: """Retrieves a workflow form field condition Retrieves a specific workflow form field condition by id @@ -86,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, WorkflowFormFieldConditionResponse]]: +) -> ErrorsList | WorkflowFormFieldConditionResponse | None: """Retrieves a workflow form field condition Retrieves a specific workflow form field condition by id @@ -112,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, WorkflowFormFieldConditionResponse]]: +) -> Response[ErrorsList | WorkflowFormFieldConditionResponse]: """Retrieves a workflow form field condition Retrieves a specific workflow form field condition by id @@ -141,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, WorkflowFormFieldConditionResponse]]: +) -> ErrorsList | WorkflowFormFieldConditionResponse | None: """Retrieves a workflow form field condition Retrieves a specific workflow form field condition by id diff --git a/rootly_sdk/api/workflow_form_field_conditions/list_workflow_form_field_conditions.py b/rootly_sdk/api/workflow_form_field_conditions/list_workflow_form_field_conditions.py index 300596a1..9b10918e 100644 --- a/rootly_sdk/api/workflow_form_field_conditions/list_workflow_form_field_conditions.py +++ b/rootly_sdk/api/workflow_form_field_conditions/list_workflow_form_field_conditions.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -12,9 +12,9 @@ def _get_kwargs( workflow_id: str, *, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -36,8 +36,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[WorkflowFormFieldConditionList]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> WorkflowFormFieldConditionList | None: if response.status_code == 200: response_200 = WorkflowFormFieldConditionList.from_dict(response.json()) @@ -50,7 +50,7 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response + *, client: AuthenticatedClient | Client, response: httpx.Response ) -> Response[WorkflowFormFieldConditionList]: return Response( status_code=HTTPStatus(response.status_code), @@ -64,9 +64,9 @@ def sync_detailed( workflow_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[WorkflowFormFieldConditionList]: """List workflow form field conditions @@ -104,10 +104,10 @@ def sync( workflow_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, -) -> Optional[WorkflowFormFieldConditionList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, +) -> WorkflowFormFieldConditionList | None: """List workflow form field conditions List workflow form field conditions @@ -139,9 +139,9 @@ async def asyncio_detailed( workflow_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, ) -> Response[WorkflowFormFieldConditionList]: """List workflow form field conditions @@ -177,10 +177,10 @@ async def asyncio( workflow_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, -) -> Optional[WorkflowFormFieldConditionList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, +) -> WorkflowFormFieldConditionList | None: """List workflow form field conditions List workflow form field conditions diff --git a/rootly_sdk/api/workflow_form_field_conditions/update_workflow_form_field_condition.py b/rootly_sdk/api/workflow_form_field_conditions/update_workflow_form_field_condition.py index a790687b..5c3f0de6 100644 --- a/rootly_sdk/api/workflow_form_field_conditions/update_workflow_form_field_condition.py +++ b/rootly_sdk/api/workflow_form_field_conditions/update_workflow_form_field_condition.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, WorkflowFormFieldConditionResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | WorkflowFormFieldConditionResponse | None: if response.status_code == 200: response_200 = WorkflowFormFieldConditionResponse.from_dict(response.json()) @@ -56,8 +56,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, WorkflowFormFieldConditionResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | WorkflowFormFieldConditionResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -71,7 +71,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateWorkflowFormFieldCondition, -) -> Response[Union[ErrorsList, WorkflowFormFieldConditionResponse]]: +) -> Response[ErrorsList | WorkflowFormFieldConditionResponse]: """Update a workflow form field condition Update a specific workflow form field condition by id @@ -105,7 +105,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateWorkflowFormFieldCondition, -) -> Optional[Union[ErrorsList, WorkflowFormFieldConditionResponse]]: +) -> ErrorsList | WorkflowFormFieldConditionResponse | None: """Update a workflow form field condition Update a specific workflow form field condition by id @@ -134,7 +134,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateWorkflowFormFieldCondition, -) -> Response[Union[ErrorsList, WorkflowFormFieldConditionResponse]]: +) -> Response[ErrorsList | WorkflowFormFieldConditionResponse]: """Update a workflow form field condition Update a specific workflow form field condition by id @@ -166,7 +166,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateWorkflowFormFieldCondition, -) -> Optional[Union[ErrorsList, WorkflowFormFieldConditionResponse]]: +) -> ErrorsList | WorkflowFormFieldConditionResponse | None: """Update a workflow form field condition Update a specific workflow form field condition by id diff --git a/rootly_sdk/api/workflow_groups/create_workflow_group.py b/rootly_sdk/api/workflow_groups/create_workflow_group.py index 8ce6df94..75cea8c3 100644 --- a/rootly_sdk/api/workflow_groups/create_workflow_group.py +++ b/rootly_sdk/api/workflow_groups/create_workflow_group.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, WorkflowGroupResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | WorkflowGroupResponse | None: if response.status_code == 201: response_201 = WorkflowGroupResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, WorkflowGroupResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | WorkflowGroupResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +69,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewWorkflowGroup, -) -> Response[Union[ErrorsList, WorkflowGroupResponse]]: +) -> Response[ErrorsList | WorkflowGroupResponse]: """Creates a workflow group Creates a new workflow group from provided data @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: NewWorkflowGroup, -) -> Optional[Union[ErrorsList, WorkflowGroupResponse]]: +) -> ErrorsList | WorkflowGroupResponse | None: """Creates a workflow group Creates a new workflow group from provided data @@ -126,7 +126,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewWorkflowGroup, -) -> Response[Union[ErrorsList, WorkflowGroupResponse]]: +) -> Response[ErrorsList | WorkflowGroupResponse]: """Creates a workflow group Creates a new workflow group from provided data @@ -155,7 +155,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewWorkflowGroup, -) -> Optional[Union[ErrorsList, WorkflowGroupResponse]]: +) -> ErrorsList | WorkflowGroupResponse | None: """Creates a workflow group Creates a new workflow group from provided data diff --git a/rootly_sdk/api/workflow_groups/delete_workflow_group.py b/rootly_sdk/api/workflow_groups/delete_workflow_group.py index 9364610e..8537c97c 100644 --- a/rootly_sdk/api/workflow_groups/delete_workflow_group.py +++ b/rootly_sdk/api/workflow_groups/delete_workflow_group.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, WorkflowGroupResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | WorkflowGroupResponse | None: if response.status_code == 200: response_200 = WorkflowGroupResponse.from_dict(response.json()) @@ -41,8 +41,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, WorkflowGroupResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | WorkflowGroupResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -55,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, WorkflowGroupResponse]]: +) -> Response[ErrorsList | WorkflowGroupResponse]: """Delete a workflow_group Delete a specific workflow group by id @@ -86,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, WorkflowGroupResponse]]: +) -> ErrorsList | WorkflowGroupResponse | None: """Delete a workflow_group Delete a specific workflow group by id @@ -112,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, WorkflowGroupResponse]]: +) -> Response[ErrorsList | WorkflowGroupResponse]: """Delete a workflow_group Delete a specific workflow group by id @@ -141,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, WorkflowGroupResponse]]: +) -> ErrorsList | WorkflowGroupResponse | None: """Delete a workflow_group Delete a specific workflow group by id diff --git a/rootly_sdk/api/workflow_groups/get_workflow_group.py b/rootly_sdk/api/workflow_groups/get_workflow_group.py index 8065dccd..ef87b467 100644 --- a/rootly_sdk/api/workflow_groups/get_workflow_group.py +++ b/rootly_sdk/api/workflow_groups/get_workflow_group.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, WorkflowGroupResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | WorkflowGroupResponse | None: if response.status_code == 200: response_200 = WorkflowGroupResponse.from_dict(response.json()) @@ -41,8 +41,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, WorkflowGroupResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | WorkflowGroupResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -55,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, WorkflowGroupResponse]]: +) -> Response[ErrorsList | WorkflowGroupResponse]: """Retrieves a workflow group Retrieves a specific workflow group by id @@ -86,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, WorkflowGroupResponse]]: +) -> ErrorsList | WorkflowGroupResponse | None: """Retrieves a workflow group Retrieves a specific workflow group by id @@ -112,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, WorkflowGroupResponse]]: +) -> Response[ErrorsList | WorkflowGroupResponse]: """Retrieves a workflow group Retrieves a specific workflow group by id @@ -141,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, WorkflowGroupResponse]]: +) -> ErrorsList | WorkflowGroupResponse | None: """Retrieves a workflow group Retrieves a specific workflow group by id diff --git a/rootly_sdk/api/workflow_groups/list_workflow_groups.py b/rootly_sdk/api/workflow_groups/list_workflow_groups.py index 3eeb518b..26a08737 100644 --- a/rootly_sdk/api/workflow_groups/list_workflow_groups.py +++ b/rootly_sdk/api/workflow_groups/list_workflow_groups.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -11,15 +11,15 @@ def _get_kwargs( *, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filterkind: Union[Unset, str] = UNSET, - filterexpanded: Union[Unset, bool] = UNSET, - filterposition: Union[Unset, int] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filterexpanded: Unset | bool = UNSET, + filterposition: Unset | int = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -52,9 +52,7 @@ def _get_kwargs( return _kwargs -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[WorkflowGroupList]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> WorkflowGroupList | None: if response.status_code == 200: response_200 = WorkflowGroupList.from_dict(response.json()) @@ -66,9 +64,7 @@ def _parse_response( return None -def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[WorkflowGroupList]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[WorkflowGroupList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -80,15 +76,15 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filterkind: Union[Unset, str] = UNSET, - filterexpanded: Union[Unset, bool] = UNSET, - filterposition: Union[Unset, int] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filterexpanded: Unset | bool = UNSET, + filterposition: Unset | int = UNSET, ) -> Response[WorkflowGroupList]: """List workflow groups @@ -135,16 +131,16 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filterkind: Union[Unset, str] = UNSET, - filterexpanded: Union[Unset, bool] = UNSET, - filterposition: Union[Unset, int] = UNSET, -) -> Optional[WorkflowGroupList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filterexpanded: Unset | bool = UNSET, + filterposition: Unset | int = UNSET, +) -> WorkflowGroupList | None: """List workflow groups List workflow groups @@ -185,15 +181,15 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filterkind: Union[Unset, str] = UNSET, - filterexpanded: Union[Unset, bool] = UNSET, - filterposition: Union[Unset, int] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filterexpanded: Unset | bool = UNSET, + filterposition: Unset | int = UNSET, ) -> Response[WorkflowGroupList]: """List workflow groups @@ -238,16 +234,16 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filterkind: Union[Unset, str] = UNSET, - filterexpanded: Union[Unset, bool] = UNSET, - filterposition: Union[Unset, int] = UNSET, -) -> Optional[WorkflowGroupList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filterkind: Unset | str = UNSET, + filterexpanded: Unset | bool = UNSET, + filterposition: Unset | int = UNSET, +) -> WorkflowGroupList | None: """List workflow groups List workflow groups diff --git a/rootly_sdk/api/workflow_groups/update_workflow_group.py b/rootly_sdk/api/workflow_groups/update_workflow_group.py index 6c4606e7..2338e429 100644 --- a/rootly_sdk/api/workflow_groups/update_workflow_group.py +++ b/rootly_sdk/api/workflow_groups/update_workflow_group.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, WorkflowGroupResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | WorkflowGroupResponse | None: if response.status_code == 200: response_200 = WorkflowGroupResponse.from_dict(response.json()) @@ -51,8 +51,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, WorkflowGroupResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | WorkflowGroupResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateWorkflowGroup, -) -> Response[Union[ErrorsList, WorkflowGroupResponse]]: +) -> Response[ErrorsList | WorkflowGroupResponse]: """Update a workflow group Update a specific workflow group by id @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateWorkflowGroup, -) -> Optional[Union[ErrorsList, WorkflowGroupResponse]]: +) -> ErrorsList | WorkflowGroupResponse | None: """Update a workflow group Update a specific workflow group by id @@ -129,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateWorkflowGroup, -) -> Response[Union[ErrorsList, WorkflowGroupResponse]]: +) -> Response[ErrorsList | WorkflowGroupResponse]: """Update a workflow group Update a specific workflow group by id @@ -161,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateWorkflowGroup, -) -> Optional[Union[ErrorsList, WorkflowGroupResponse]]: +) -> ErrorsList | WorkflowGroupResponse | None: """Update a workflow group Update a specific workflow group by id diff --git a/rootly_sdk/api/workflow_runs/create_workflow_run.py b/rootly_sdk/api/workflow_runs/create_workflow_run.py index d0fa2847..8876080e 100644 --- a/rootly_sdk/api/workflow_runs/create_workflow_run.py +++ b/rootly_sdk/api/workflow_runs/create_workflow_run.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, WorkflowRunResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | WorkflowRunResponse | None: if response.status_code == 201: response_201 = WorkflowRunResponse.from_dict(response.json()) @@ -56,8 +56,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, WorkflowRunResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | WorkflowRunResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -71,7 +71,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewWorkflowRun, -) -> Response[Union[ErrorsList, WorkflowRunResponse]]: +) -> Response[ErrorsList | WorkflowRunResponse]: """Creates a workflow run Creates a new workflow run from provided data @@ -105,7 +105,7 @@ def sync( *, client: AuthenticatedClient, body: NewWorkflowRun, -) -> Optional[Union[ErrorsList, WorkflowRunResponse]]: +) -> ErrorsList | WorkflowRunResponse | None: """Creates a workflow run Creates a new workflow run from provided data @@ -134,7 +134,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewWorkflowRun, -) -> Response[Union[ErrorsList, WorkflowRunResponse]]: +) -> Response[ErrorsList | WorkflowRunResponse]: """Creates a workflow run Creates a new workflow run from provided data @@ -166,7 +166,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewWorkflowRun, -) -> Optional[Union[ErrorsList, WorkflowRunResponse]]: +) -> ErrorsList | WorkflowRunResponse | None: """Creates a workflow run Creates a new workflow run from provided data diff --git a/rootly_sdk/api/workflow_runs/list_workflow_runs.py b/rootly_sdk/api/workflow_runs/list_workflow_runs.py index c4901d66..4c1bf17f 100644 --- a/rootly_sdk/api/workflow_runs/list_workflow_runs.py +++ b/rootly_sdk/api/workflow_runs/list_workflow_runs.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -13,17 +13,17 @@ def _get_kwargs( workflow_id: str, *, - include: Union[Unset, ListWorkflowRunsInclude] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, + include: Unset | ListWorkflowRunsInclude = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} - json_include: Union[Unset, str] = UNSET + json_include: Unset | str = UNSET if not isinstance(include, Unset): json_include = include @@ -52,9 +52,7 @@ def _get_kwargs( return _kwargs -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[WorkflowRunsList]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> WorkflowRunsList | None: if response.status_code == 200: response_200 = WorkflowRunsList.from_dict(response.json()) @@ -66,9 +64,7 @@ def _parse_response( return None -def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[WorkflowRunsList]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[WorkflowRunsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -81,13 +77,13 @@ def sync_detailed( workflow_id: str, *, client: AuthenticatedClient, - include: Union[Unset, ListWorkflowRunsInclude] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, + include: Unset | ListWorkflowRunsInclude = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> Response[WorkflowRunsList]: """List workflow runs @@ -133,14 +129,14 @@ def sync( workflow_id: str, *, client: AuthenticatedClient, - include: Union[Unset, ListWorkflowRunsInclude] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, -) -> Optional[WorkflowRunsList]: + include: Unset | ListWorkflowRunsInclude = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, +) -> WorkflowRunsList | None: """List workflow runs List workflow runs @@ -180,13 +176,13 @@ async def asyncio_detailed( workflow_id: str, *, client: AuthenticatedClient, - include: Union[Unset, ListWorkflowRunsInclude] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, + include: Unset | ListWorkflowRunsInclude = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, ) -> Response[WorkflowRunsList]: """List workflow runs @@ -230,14 +226,14 @@ async def asyncio( workflow_id: str, *, client: AuthenticatedClient, - include: Union[Unset, ListWorkflowRunsInclude] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, -) -> Optional[WorkflowRunsList]: + include: Unset | ListWorkflowRunsInclude = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, +) -> WorkflowRunsList | None: """List workflow runs List workflow runs diff --git a/rootly_sdk/api/workflow_tasks/create_workflow_task.py b/rootly_sdk/api/workflow_tasks/create_workflow_task.py index b103f8e1..6a5588e5 100644 --- a/rootly_sdk/api/workflow_tasks/create_workflow_task.py +++ b/rootly_sdk/api/workflow_tasks/create_workflow_task.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, WorkflowTaskResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | WorkflowTaskResponse | None: if response.status_code == 201: response_201 = WorkflowTaskResponse.from_dict(response.json()) @@ -51,8 +51,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, WorkflowTaskResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | WorkflowTaskResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewWorkflowTask, -) -> Response[Union[ErrorsList, WorkflowTaskResponse]]: +) -> Response[ErrorsList | WorkflowTaskResponse]: """Creates a workflow task Creates a new workflow task from provided data @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: NewWorkflowTask, -) -> Optional[Union[ErrorsList, WorkflowTaskResponse]]: +) -> ErrorsList | WorkflowTaskResponse | None: """Creates a workflow task Creates a new workflow task from provided data @@ -129,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewWorkflowTask, -) -> Response[Union[ErrorsList, WorkflowTaskResponse]]: +) -> Response[ErrorsList | WorkflowTaskResponse]: """Creates a workflow task Creates a new workflow task from provided data @@ -161,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewWorkflowTask, -) -> Optional[Union[ErrorsList, WorkflowTaskResponse]]: +) -> ErrorsList | WorkflowTaskResponse | None: """Creates a workflow task Creates a new workflow task from provided data diff --git a/rootly_sdk/api/workflow_tasks/delete_workflow_task.py b/rootly_sdk/api/workflow_tasks/delete_workflow_task.py index 29a1c38d..b5db52c2 100644 --- a/rootly_sdk/api/workflow_tasks/delete_workflow_task.py +++ b/rootly_sdk/api/workflow_tasks/delete_workflow_task.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, WorkflowTaskResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | WorkflowTaskResponse | None: if response.status_code == 200: response_200 = WorkflowTaskResponse.from_dict(response.json()) @@ -41,8 +41,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, WorkflowTaskResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | WorkflowTaskResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -55,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, WorkflowTaskResponse]]: +) -> Response[ErrorsList | WorkflowTaskResponse]: """Delete a workflow task Delete a specific workflow task by id @@ -86,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, WorkflowTaskResponse]]: +) -> ErrorsList | WorkflowTaskResponse | None: """Delete a workflow task Delete a specific workflow task by id @@ -112,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, WorkflowTaskResponse]]: +) -> Response[ErrorsList | WorkflowTaskResponse]: """Delete a workflow task Delete a specific workflow task by id @@ -141,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, WorkflowTaskResponse]]: +) -> ErrorsList | WorkflowTaskResponse | None: """Delete a workflow task Delete a specific workflow task by id diff --git a/rootly_sdk/api/workflow_tasks/get_workflow_task.py b/rootly_sdk/api/workflow_tasks/get_workflow_task.py index 31506850..1e2d3735 100644 --- a/rootly_sdk/api/workflow_tasks/get_workflow_task.py +++ b/rootly_sdk/api/workflow_tasks/get_workflow_task.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,8 +22,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, WorkflowTaskResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | WorkflowTaskResponse | None: if response.status_code == 200: response_200 = WorkflowTaskResponse.from_dict(response.json()) @@ -41,8 +41,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, WorkflowTaskResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | WorkflowTaskResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -55,7 +55,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, WorkflowTaskResponse]]: +) -> Response[ErrorsList | WorkflowTaskResponse]: """Retrieves a workflow task Retrieves a specific workflow_task by id @@ -86,7 +86,7 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, WorkflowTaskResponse]]: +) -> ErrorsList | WorkflowTaskResponse | None: """Retrieves a workflow task Retrieves a specific workflow_task by id @@ -112,7 +112,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, WorkflowTaskResponse]]: +) -> Response[ErrorsList | WorkflowTaskResponse]: """Retrieves a workflow task Retrieves a specific workflow_task by id @@ -141,7 +141,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, WorkflowTaskResponse]]: +) -> ErrorsList | WorkflowTaskResponse | None: """Retrieves a workflow task Retrieves a specific workflow_task by id diff --git a/rootly_sdk/api/workflow_tasks/list_workflow_tasks.py b/rootly_sdk/api/workflow_tasks/list_workflow_tasks.py index c0a8a272..dedb18a3 100644 --- a/rootly_sdk/api/workflow_tasks/list_workflow_tasks.py +++ b/rootly_sdk/api/workflow_tasks/list_workflow_tasks.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -12,20 +12,20 @@ def _get_kwargs( workflow_id: str, *, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, - filterslugeq: Union[Unset, str] = UNSET, - filterslugnot_eq: Union[Unset, str] = UNSET, - filterslugin: Union[Unset, str] = UNSET, - filterslugnot_in: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -68,9 +68,7 @@ def _get_kwargs( return _kwargs -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[WorkflowTaskList]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> WorkflowTaskList | None: if response.status_code == 200: response_200 = WorkflowTaskList.from_dict(response.json()) @@ -82,9 +80,7 @@ def _parse_response( return None -def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[WorkflowTaskList]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[WorkflowTaskList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -97,20 +93,20 @@ def sync_detailed( workflow_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, - filterslugeq: Union[Unset, str] = UNSET, - filterslugnot_eq: Union[Unset, str] = UNSET, - filterslugin: Union[Unset, str] = UNSET, - filterslugnot_in: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, ) -> Response[WorkflowTaskList]: """List workflow tasks @@ -170,21 +166,21 @@ def sync( workflow_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, - filterslugeq: Union[Unset, str] = UNSET, - filterslugnot_eq: Union[Unset, str] = UNSET, - filterslugin: Union[Unset, str] = UNSET, - filterslugnot_in: Union[Unset, str] = UNSET, -) -> Optional[WorkflowTaskList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, +) -> WorkflowTaskList | None: """List workflow tasks List workflow tasks @@ -238,20 +234,20 @@ async def asyncio_detailed( workflow_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, - filterslugeq: Union[Unset, str] = UNSET, - filterslugnot_eq: Union[Unset, str] = UNSET, - filterslugin: Union[Unset, str] = UNSET, - filterslugnot_in: Union[Unset, str] = UNSET, + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, ) -> Response[WorkflowTaskList]: """List workflow tasks @@ -309,21 +305,21 @@ async def asyncio( workflow_id: str, *, client: AuthenticatedClient, - include: Union[Unset, str] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, - filterslugeq: Union[Unset, str] = UNSET, - filterslugnot_eq: Union[Unset, str] = UNSET, - filterslugin: Union[Unset, str] = UNSET, - filterslugnot_in: Union[Unset, str] = UNSET, -) -> Optional[WorkflowTaskList]: + include: Unset | str = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, +) -> WorkflowTaskList | None: """List workflow tasks List workflow tasks diff --git a/rootly_sdk/api/workflow_tasks/update_workflow_task.py b/rootly_sdk/api/workflow_tasks/update_workflow_task.py index 30afc39d..51e59bd2 100644 --- a/rootly_sdk/api/workflow_tasks/update_workflow_task.py +++ b/rootly_sdk/api/workflow_tasks/update_workflow_task.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -32,8 +32,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, WorkflowTaskResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | WorkflowTaskResponse | None: if response.status_code == 200: response_200 = WorkflowTaskResponse.from_dict(response.json()) @@ -51,8 +51,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, WorkflowTaskResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | WorkflowTaskResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,7 +66,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateWorkflowTask, -) -> Response[Union[ErrorsList, WorkflowTaskResponse]]: +) -> Response[ErrorsList | WorkflowTaskResponse]: """Update a workflow task Update a specific workflow task by id @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateWorkflowTask, -) -> Optional[Union[ErrorsList, WorkflowTaskResponse]]: +) -> ErrorsList | WorkflowTaskResponse | None: """Update a workflow task Update a specific workflow task by id @@ -129,7 +129,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateWorkflowTask, -) -> Response[Union[ErrorsList, WorkflowTaskResponse]]: +) -> Response[ErrorsList | WorkflowTaskResponse]: """Update a workflow task Update a specific workflow task by id @@ -161,7 +161,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateWorkflowTask, -) -> Optional[Union[ErrorsList, WorkflowTaskResponse]]: +) -> ErrorsList | WorkflowTaskResponse | None: """Update a workflow task Update a specific workflow task by id diff --git a/rootly_sdk/api/workflows/create_workflow.py b/rootly_sdk/api/workflows/create_workflow.py index f59f2d54..df1267c7 100644 --- a/rootly_sdk/api/workflows/create_workflow.py +++ b/rootly_sdk/api/workflows/create_workflow.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -31,8 +31,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, WorkflowResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | WorkflowResponse | None: if response.status_code == 201: response_201 = WorkflowResponse.from_dict(response.json()) @@ -55,8 +55,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, WorkflowResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | WorkflowResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +69,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewWorkflow, -) -> Response[Union[ErrorsList, WorkflowResponse]]: +) -> Response[ErrorsList | WorkflowResponse]: """Creates a workflow Creates a new workflow from provided data @@ -100,7 +100,7 @@ def sync( *, client: AuthenticatedClient, body: NewWorkflow, -) -> Optional[Union[ErrorsList, WorkflowResponse]]: +) -> ErrorsList | WorkflowResponse | None: """Creates a workflow Creates a new workflow from provided data @@ -126,7 +126,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewWorkflow, -) -> Response[Union[ErrorsList, WorkflowResponse]]: +) -> Response[ErrorsList | WorkflowResponse]: """Creates a workflow Creates a new workflow from provided data @@ -155,7 +155,7 @@ async def asyncio( *, client: AuthenticatedClient, body: NewWorkflow, -) -> Optional[Union[ErrorsList, WorkflowResponse]]: +) -> ErrorsList | WorkflowResponse | None: """Creates a workflow Creates a new workflow from provided data diff --git a/rootly_sdk/api/workflows/delete_workflow.py b/rootly_sdk/api/workflows/delete_workflow.py index 999d347b..88b7e2a2 100644 --- a/rootly_sdk/api/workflows/delete_workflow.py +++ b/rootly_sdk/api/workflows/delete_workflow.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any from uuid import UUID import httpx @@ -12,7 +12,7 @@ def _get_kwargs( - id: Union[UUID, str], + id: UUID | str, ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "delete", @@ -23,8 +23,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, WorkflowResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | WorkflowResponse | None: if response.status_code == 200: response_200 = WorkflowResponse.from_dict(response.json()) @@ -42,8 +42,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, WorkflowResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | WorkflowResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -53,10 +53,10 @@ def _build_response( def sync_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, WorkflowResponse]]: +) -> Response[ErrorsList | WorkflowResponse]: """Delete a workflow Delete a specific workflow by id @@ -84,10 +84,10 @@ def sync_detailed( def sync( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, WorkflowResponse]]: +) -> ErrorsList | WorkflowResponse | None: """Delete a workflow Delete a specific workflow by id @@ -110,10 +110,10 @@ def sync( async def asyncio_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Response[Union[ErrorsList, WorkflowResponse]]: +) -> Response[ErrorsList | WorkflowResponse]: """Delete a workflow Delete a specific workflow by id @@ -139,10 +139,10 @@ async def asyncio_detailed( async def asyncio( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, -) -> Optional[Union[ErrorsList, WorkflowResponse]]: +) -> ErrorsList | WorkflowResponse | None: """Delete a workflow Delete a specific workflow by id diff --git a/rootly_sdk/api/workflows/get_workflow.py b/rootly_sdk/api/workflows/get_workflow.py index 19cbb099..87dfb81a 100644 --- a/rootly_sdk/api/workflows/get_workflow.py +++ b/rootly_sdk/api/workflows/get_workflow.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any from uuid import UUID import httpx @@ -13,13 +13,13 @@ def _get_kwargs( - id: Union[UUID, str], + id: UUID | str, *, - include: Union[Unset, GetWorkflowInclude] = UNSET, + include: Unset | GetWorkflowInclude = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} - json_include: Union[Unset, str] = UNSET + json_include: Unset | str = UNSET if not isinstance(include, Unset): json_include = include @@ -37,8 +37,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, WorkflowResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | WorkflowResponse | None: if response.status_code == 200: response_200 = WorkflowResponse.from_dict(response.json()) @@ -56,8 +56,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, WorkflowResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | WorkflowResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -67,11 +67,11 @@ def _build_response( def sync_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, - include: Union[Unset, GetWorkflowInclude] = UNSET, -) -> Response[Union[ErrorsList, WorkflowResponse]]: + include: Unset | GetWorkflowInclude = UNSET, +) -> Response[ErrorsList | WorkflowResponse]: """Retrieves a workflow Retrieves a specific workflow by id @@ -101,11 +101,11 @@ def sync_detailed( def sync( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, - include: Union[Unset, GetWorkflowInclude] = UNSET, -) -> Optional[Union[ErrorsList, WorkflowResponse]]: + include: Unset | GetWorkflowInclude = UNSET, +) -> ErrorsList | WorkflowResponse | None: """Retrieves a workflow Retrieves a specific workflow by id @@ -130,11 +130,11 @@ def sync( async def asyncio_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, - include: Union[Unset, GetWorkflowInclude] = UNSET, -) -> Response[Union[ErrorsList, WorkflowResponse]]: + include: Unset | GetWorkflowInclude = UNSET, +) -> Response[ErrorsList | WorkflowResponse]: """Retrieves a workflow Retrieves a specific workflow by id @@ -162,11 +162,11 @@ async def asyncio_detailed( async def asyncio( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, - include: Union[Unset, GetWorkflowInclude] = UNSET, -) -> Optional[Union[ErrorsList, WorkflowResponse]]: + include: Unset | GetWorkflowInclude = UNSET, +) -> ErrorsList | WorkflowResponse | None: """Retrieves a workflow Retrieves a specific workflow by id diff --git a/rootly_sdk/api/workflows/list_workflows.py b/rootly_sdk/api/workflows/list_workflows.py index 5dc4125b..96900f54 100644 --- a/rootly_sdk/api/workflows/list_workflows.py +++ b/rootly_sdk/api/workflows/list_workflows.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -13,35 +13,35 @@ def _get_kwargs( *, - include: Union[Unset, ListWorkflowsInclude] = UNSET, - sort: Union[Unset, ListWorkflowsSort] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filterslugeq: Union[Unset, str] = UNSET, - filterslugnot_eq: Union[Unset, str] = UNSET, - filterslugin: Union[Unset, str] = UNSET, - filterslugnot_in: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, + include: Unset | ListWorkflowsInclude = UNSET, + sort: Unset | ListWorkflowsSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} - json_include: Union[Unset, str] = UNSET + json_include: Unset | str = UNSET if not isinstance(include, Unset): json_include = include params["include"] = json_include - json_sort: Union[Unset, str] = UNSET + json_sort: Unset | str = UNSET if not isinstance(sort, Unset): json_sort = sort @@ -92,7 +92,7 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[WorkflowList]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> WorkflowList | None: if response.status_code == 200: response_200 = WorkflowList.from_dict(response.json()) @@ -104,7 +104,7 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[WorkflowList]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[WorkflowList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -116,25 +116,25 @@ def _build_response(*, client: Union[AuthenticatedClient, Client], response: htt def sync_detailed( *, client: AuthenticatedClient, - include: Union[Unset, ListWorkflowsInclude] = UNSET, - sort: Union[Unset, ListWorkflowsSort] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filterslugeq: Union[Unset, str] = UNSET, - filterslugnot_eq: Union[Unset, str] = UNSET, - filterslugin: Union[Unset, str] = UNSET, - filterslugnot_in: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, + include: Unset | ListWorkflowsInclude = UNSET, + sort: Unset | ListWorkflowsSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, ) -> Response[WorkflowList]: """List workflows @@ -201,26 +201,26 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: Union[Unset, ListWorkflowsInclude] = UNSET, - sort: Union[Unset, ListWorkflowsSort] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filterslugeq: Union[Unset, str] = UNSET, - filterslugnot_eq: Union[Unset, str] = UNSET, - filterslugin: Union[Unset, str] = UNSET, - filterslugnot_in: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, -) -> Optional[WorkflowList]: + include: Unset | ListWorkflowsInclude = UNSET, + sort: Unset | ListWorkflowsSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, +) -> WorkflowList | None: """List workflows List workflows @@ -281,25 +281,25 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: Union[Unset, ListWorkflowsInclude] = UNSET, - sort: Union[Unset, ListWorkflowsSort] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filterslugeq: Union[Unset, str] = UNSET, - filterslugnot_eq: Union[Unset, str] = UNSET, - filterslugin: Union[Unset, str] = UNSET, - filterslugnot_in: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, + include: Unset | ListWorkflowsInclude = UNSET, + sort: Unset | ListWorkflowsSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, ) -> Response[WorkflowList]: """List workflows @@ -364,26 +364,26 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: Union[Unset, ListWorkflowsInclude] = UNSET, - sort: Union[Unset, ListWorkflowsSort] = UNSET, - pagenumber: Union[Unset, int] = UNSET, - pagesize: Union[Unset, int] = UNSET, - filtersearch: Union[Unset, str] = UNSET, - filtername: Union[Unset, str] = UNSET, - filterslug: Union[Unset, str] = UNSET, - filtercreated_atgt: Union[Unset, str] = UNSET, - filtercreated_atgte: Union[Unset, str] = UNSET, - filtercreated_atlt: Union[Unset, str] = UNSET, - filtercreated_atlte: Union[Unset, str] = UNSET, - filterslugeq: Union[Unset, str] = UNSET, - filterslugnot_eq: Union[Unset, str] = UNSET, - filterslugin: Union[Unset, str] = UNSET, - filterslugnot_in: Union[Unset, str] = UNSET, - filternameeq: Union[Unset, str] = UNSET, - filternamenot_eq: Union[Unset, str] = UNSET, - filternamein: Union[Unset, str] = UNSET, - filternamenot_in: Union[Unset, str] = UNSET, -) -> Optional[WorkflowList]: + include: Unset | ListWorkflowsInclude = UNSET, + sort: Unset | ListWorkflowsSort = UNSET, + pagenumber: Unset | int = UNSET, + pagesize: Unset | int = UNSET, + filtersearch: Unset | str = UNSET, + filtername: Unset | str = UNSET, + filterslug: Unset | str = UNSET, + filtercreated_atgt: Unset | str = UNSET, + filtercreated_atgte: Unset | str = UNSET, + filtercreated_atlt: Unset | str = UNSET, + filtercreated_atlte: Unset | str = UNSET, + filterslugeq: Unset | str = UNSET, + filterslugnot_eq: Unset | str = UNSET, + filterslugin: Unset | str = UNSET, + filterslugnot_in: Unset | str = UNSET, + filternameeq: Unset | str = UNSET, + filternamenot_eq: Unset | str = UNSET, + filternamein: Unset | str = UNSET, + filternamenot_in: Unset | str = UNSET, +) -> WorkflowList | None: """List workflows List workflows diff --git a/rootly_sdk/api/workflows/update_workflow.py b/rootly_sdk/api/workflows/update_workflow.py index 15bc0bc5..d2ac8854 100644 --- a/rootly_sdk/api/workflows/update_workflow.py +++ b/rootly_sdk/api/workflows/update_workflow.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any from uuid import UUID import httpx @@ -13,7 +13,7 @@ def _get_kwargs( - id: Union[UUID, str], + id: UUID | str, *, body: UpdateWorkflow, ) -> dict[str, Any]: @@ -33,8 +33,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorsList, WorkflowResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | WorkflowResponse | None: if response.status_code == 200: response_200 = WorkflowResponse.from_dict(response.json()) @@ -57,8 +57,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorsList, WorkflowResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | WorkflowResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -68,11 +68,11 @@ def _build_response( def sync_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdateWorkflow, -) -> Response[Union[ErrorsList, WorkflowResponse]]: +) -> Response[ErrorsList | WorkflowResponse]: """Update a workflow Update a specific workflow by id @@ -102,11 +102,11 @@ def sync_detailed( def sync( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdateWorkflow, -) -> Optional[Union[ErrorsList, WorkflowResponse]]: +) -> ErrorsList | WorkflowResponse | None: """Update a workflow Update a specific workflow by id @@ -131,11 +131,11 @@ def sync( async def asyncio_detailed( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdateWorkflow, -) -> Response[Union[ErrorsList, WorkflowResponse]]: +) -> Response[ErrorsList | WorkflowResponse]: """Update a workflow Update a specific workflow by id @@ -163,11 +163,11 @@ async def asyncio_detailed( async def asyncio( - id: Union[UUID, str], + id: UUID | str, *, client: AuthenticatedClient, body: UpdateWorkflow, -) -> Optional[Union[ErrorsList, WorkflowResponse]]: +) -> ErrorsList | WorkflowResponse | None: """Update a workflow Update a specific workflow by id diff --git a/rootly_sdk/client.py b/rootly_sdk/client.py index e80446f1..3f312fb1 100644 --- a/rootly_sdk/client.py +++ b/rootly_sdk/client.py @@ -1,5 +1,5 @@ import ssl -from typing import Any, Optional, Union +from typing import Any import httpx from attrs import define, evolve, field @@ -38,12 +38,12 @@ class Client: _base_url: str = field(alias="base_url") _cookies: dict[str, str] = field(factory=dict, kw_only=True, alias="cookies") _headers: dict[str, str] = field(factory=dict, kw_only=True, alias="headers") - _timeout: Optional[httpx.Timeout] = field(default=None, kw_only=True, alias="timeout") - _verify_ssl: Union[str, bool, ssl.SSLContext] = field(default=True, kw_only=True, alias="verify_ssl") + _timeout: httpx.Timeout | None = field(default=None, kw_only=True, alias="timeout") + _verify_ssl: str | bool | ssl.SSLContext = field(default=True, kw_only=True, alias="verify_ssl") _follow_redirects: bool = field(default=False, kw_only=True, alias="follow_redirects") _httpx_args: dict[str, Any] = field(factory=dict, kw_only=True, alias="httpx_args") - _client: Optional[httpx.Client] = field(default=None, init=False) - _async_client: Optional[httpx.AsyncClient] = field(default=None, init=False) + _client: httpx.Client | None = field(default=None, init=False) + _async_client: httpx.AsyncClient | None = field(default=None, init=False) def with_headers(self, headers: dict[str, str]) -> "Client": """Get a new client matching this one with additional headers""" @@ -168,12 +168,12 @@ class AuthenticatedClient: _base_url: str = field(alias="base_url") _cookies: dict[str, str] = field(factory=dict, kw_only=True, alias="cookies") _headers: dict[str, str] = field(factory=dict, kw_only=True, alias="headers") - _timeout: Optional[httpx.Timeout] = field(default=None, kw_only=True, alias="timeout") - _verify_ssl: Union[str, bool, ssl.SSLContext] = field(default=True, kw_only=True, alias="verify_ssl") + _timeout: httpx.Timeout | None = field(default=None, kw_only=True, alias="timeout") + _verify_ssl: str | bool | ssl.SSLContext = field(default=True, kw_only=True, alias="verify_ssl") _follow_redirects: bool = field(default=False, kw_only=True, alias="follow_redirects") _httpx_args: dict[str, Any] = field(factory=dict, kw_only=True, alias="httpx_args") - _client: Optional[httpx.Client] = field(default=None, init=False) - _async_client: Optional[httpx.AsyncClient] = field(default=None, init=False) + _client: httpx.Client | None = field(default=None, init=False) + _async_client: httpx.AsyncClient | None = field(default=None, init=False) token: str prefix: str = "Bearer" diff --git a/rootly_sdk/models/action_item_trigger_params.py b/rootly_sdk/models/action_item_trigger_params.py index 878b8f0a..fde80595 100644 --- a/rootly_sdk/models/action_item_trigger_params.py +++ b/rootly_sdk/models/action_item_trigger_params.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -187,207 +187,203 @@ class ActionItemTriggerParams: """ trigger_type: ActionItemTriggerParamsTriggerType - triggers: Union[Unset, list[str]] = UNSET - incident_visibilities: Union[Unset, list[bool]] = UNSET - incident_kinds: Union[Unset, list[ActionItemTriggerParamsIncidentKindsItem]] = UNSET - incident_statuses: Union[Unset, list[ActionItemTriggerParamsIncidentStatusesItem]] = UNSET - incident_inactivity_duration: Union[None, Unset, str] = UNSET - incident_condition: Union[Unset, ActionItemTriggerParamsIncidentCondition] = "ALL" - incident_condition_visibility: Union[Unset, ActionItemTriggerParamsIncidentConditionVisibility] = "ANY" - incident_condition_kind: Union[Unset, ActionItemTriggerParamsIncidentConditionKind] = "IS" - incident_condition_status: Union[Unset, ActionItemTriggerParamsIncidentConditionStatus] = "ANY" - incident_condition_sub_status: Union[Unset, ActionItemTriggerParamsIncidentConditionSubStatus] = "ANY" - incident_condition_environment: Union[Unset, ActionItemTriggerParamsIncidentConditionEnvironment] = "ANY" - incident_condition_severity: Union[Unset, ActionItemTriggerParamsIncidentConditionSeverity] = "ANY" - incident_condition_incident_type: Union[Unset, ActionItemTriggerParamsIncidentConditionIncidentType] = "ANY" - incident_condition_incident_roles: Union[Unset, ActionItemTriggerParamsIncidentConditionIncidentRoles] = "ANY" - incident_condition_service: Union[Unset, ActionItemTriggerParamsIncidentConditionService] = "ANY" - incident_condition_functionality: Union[Unset, ActionItemTriggerParamsIncidentConditionFunctionality] = "ANY" - incident_condition_group: Union[Unset, ActionItemTriggerParamsIncidentConditionGroup] = "ANY" - incident_condition_label: Union[Unset, ActionItemTriggerParamsIncidentConditionLabel] = "ANY" - incident_condition_label_use_regexp: Union[Unset, bool] = False - incident_labels: Union[Unset, list[str]] = UNSET - incident_condition_summary: Union[Unset, ActionItemTriggerParamsIncidentConditionSummary] = UNSET - incident_condition_started_at: Union[Unset, ActionItemTriggerParamsIncidentConditionStartedAt] = UNSET - incident_condition_detected_at: Union[Unset, ActionItemTriggerParamsIncidentConditionDetectedAt] = UNSET - incident_condition_acknowledged_at: Union[Unset, ActionItemTriggerParamsIncidentConditionAcknowledgedAt] = UNSET - incident_condition_mitigated_at: Union[Unset, ActionItemTriggerParamsIncidentConditionMitigatedAt] = UNSET - incident_condition_resolved_at: Union[Unset, ActionItemTriggerParamsIncidentConditionResolvedAt] = UNSET - incident_conditional_inactivity: Union[Unset, ActionItemTriggerParamsIncidentConditionalInactivity] = UNSET - incident_action_item_condition: Union[Unset, ActionItemTriggerParamsIncidentActionItemCondition] = UNSET - incident_action_item_condition_kind: Union[Unset, ActionItemTriggerParamsIncidentActionItemConditionKind] = "ANY" - incident_action_item_kinds: Union[Unset, list[ActionItemTriggerParamsIncidentActionItemKindsItem]] = UNSET - incident_action_item_condition_status: Union[Unset, ActionItemTriggerParamsIncidentActionItemConditionStatus] = ( - "ANY" - ) - incident_action_item_statuses: Union[Unset, list[ActionItemTriggerParamsIncidentActionItemStatusesItem]] = UNSET - incident_action_item_condition_priority: Union[ - Unset, ActionItemTriggerParamsIncidentActionItemConditionPriority - ] = "ANY" - incident_action_item_priorities: Union[Unset, list[ActionItemTriggerParamsIncidentActionItemPrioritiesItem]] = UNSET - incident_action_item_condition_group: Union[Unset, ActionItemTriggerParamsIncidentActionItemConditionGroup] = "ANY" - incident_action_item_group_ids: Union[Unset, list[str]] = UNSET + triggers: Unset | list[str] = UNSET + incident_visibilities: Unset | list[bool] = UNSET + incident_kinds: Unset | list[ActionItemTriggerParamsIncidentKindsItem] = UNSET + incident_statuses: Unset | list[ActionItemTriggerParamsIncidentStatusesItem] = UNSET + incident_inactivity_duration: None | Unset | str = UNSET + incident_condition: Unset | ActionItemTriggerParamsIncidentCondition = "ALL" + incident_condition_visibility: Unset | ActionItemTriggerParamsIncidentConditionVisibility = "ANY" + incident_condition_kind: Unset | ActionItemTriggerParamsIncidentConditionKind = "IS" + incident_condition_status: Unset | ActionItemTriggerParamsIncidentConditionStatus = "ANY" + incident_condition_sub_status: Unset | ActionItemTriggerParamsIncidentConditionSubStatus = "ANY" + incident_condition_environment: Unset | ActionItemTriggerParamsIncidentConditionEnvironment = "ANY" + incident_condition_severity: Unset | ActionItemTriggerParamsIncidentConditionSeverity = "ANY" + incident_condition_incident_type: Unset | ActionItemTriggerParamsIncidentConditionIncidentType = "ANY" + incident_condition_incident_roles: Unset | ActionItemTriggerParamsIncidentConditionIncidentRoles = "ANY" + incident_condition_service: Unset | ActionItemTriggerParamsIncidentConditionService = "ANY" + incident_condition_functionality: Unset | ActionItemTriggerParamsIncidentConditionFunctionality = "ANY" + incident_condition_group: Unset | ActionItemTriggerParamsIncidentConditionGroup = "ANY" + incident_condition_label: Unset | ActionItemTriggerParamsIncidentConditionLabel = "ANY" + incident_condition_label_use_regexp: Unset | bool = False + incident_labels: Unset | list[str] = UNSET + incident_condition_summary: Unset | ActionItemTriggerParamsIncidentConditionSummary = UNSET + incident_condition_started_at: Unset | ActionItemTriggerParamsIncidentConditionStartedAt = UNSET + incident_condition_detected_at: Unset | ActionItemTriggerParamsIncidentConditionDetectedAt = UNSET + incident_condition_acknowledged_at: Unset | ActionItemTriggerParamsIncidentConditionAcknowledgedAt = UNSET + incident_condition_mitigated_at: Unset | ActionItemTriggerParamsIncidentConditionMitigatedAt = UNSET + incident_condition_resolved_at: Unset | ActionItemTriggerParamsIncidentConditionResolvedAt = UNSET + incident_conditional_inactivity: Unset | ActionItemTriggerParamsIncidentConditionalInactivity = UNSET + incident_action_item_condition: Unset | ActionItemTriggerParamsIncidentActionItemCondition = UNSET + incident_action_item_condition_kind: Unset | ActionItemTriggerParamsIncidentActionItemConditionKind = "ANY" + incident_action_item_kinds: Unset | list[ActionItemTriggerParamsIncidentActionItemKindsItem] = UNSET + incident_action_item_condition_status: Unset | ActionItemTriggerParamsIncidentActionItemConditionStatus = "ANY" + incident_action_item_statuses: Unset | list[ActionItemTriggerParamsIncidentActionItemStatusesItem] = UNSET + incident_action_item_condition_priority: Unset | ActionItemTriggerParamsIncidentActionItemConditionPriority = "ANY" + incident_action_item_priorities: Unset | list[ActionItemTriggerParamsIncidentActionItemPrioritiesItem] = UNSET + incident_action_item_condition_group: Unset | ActionItemTriggerParamsIncidentActionItemConditionGroup = "ANY" + incident_action_item_group_ids: Unset | list[str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: trigger_type: str = self.trigger_type - triggers: Union[Unset, list[str]] = UNSET + triggers: Unset | list[str] = UNSET if not isinstance(self.triggers, Unset): triggers = self.triggers - incident_visibilities: Union[Unset, list[bool]] = UNSET + incident_visibilities: Unset | list[bool] = UNSET if not isinstance(self.incident_visibilities, Unset): incident_visibilities = self.incident_visibilities - incident_kinds: Union[Unset, list[str]] = UNSET + incident_kinds: Unset | list[str] = UNSET if not isinstance(self.incident_kinds, Unset): incident_kinds = [] for incident_kinds_item_data in self.incident_kinds: incident_kinds_item: str = incident_kinds_item_data incident_kinds.append(incident_kinds_item) - incident_statuses: Union[Unset, list[str]] = UNSET + incident_statuses: Unset | list[str] = UNSET if not isinstance(self.incident_statuses, Unset): incident_statuses = [] for incident_statuses_item_data in self.incident_statuses: incident_statuses_item: str = incident_statuses_item_data incident_statuses.append(incident_statuses_item) - incident_inactivity_duration: Union[None, Unset, str] + incident_inactivity_duration: None | Unset | str if isinstance(self.incident_inactivity_duration, Unset): incident_inactivity_duration = UNSET else: incident_inactivity_duration = self.incident_inactivity_duration - incident_condition: Union[Unset, str] = UNSET + incident_condition: Unset | str = UNSET if not isinstance(self.incident_condition, Unset): incident_condition = self.incident_condition - incident_condition_visibility: Union[Unset, str] = UNSET + incident_condition_visibility: Unset | str = UNSET if not isinstance(self.incident_condition_visibility, Unset): incident_condition_visibility = self.incident_condition_visibility - incident_condition_kind: Union[Unset, str] = UNSET + incident_condition_kind: Unset | str = UNSET if not isinstance(self.incident_condition_kind, Unset): incident_condition_kind = self.incident_condition_kind - incident_condition_status: Union[Unset, str] = UNSET + incident_condition_status: Unset | str = UNSET if not isinstance(self.incident_condition_status, Unset): incident_condition_status = self.incident_condition_status - incident_condition_sub_status: Union[Unset, str] = UNSET + incident_condition_sub_status: Unset | str = UNSET if not isinstance(self.incident_condition_sub_status, Unset): incident_condition_sub_status = self.incident_condition_sub_status - incident_condition_environment: Union[Unset, str] = UNSET + incident_condition_environment: Unset | str = UNSET if not isinstance(self.incident_condition_environment, Unset): incident_condition_environment = self.incident_condition_environment - incident_condition_severity: Union[Unset, str] = UNSET + incident_condition_severity: Unset | str = UNSET if not isinstance(self.incident_condition_severity, Unset): incident_condition_severity = self.incident_condition_severity - incident_condition_incident_type: Union[Unset, str] = UNSET + incident_condition_incident_type: Unset | str = UNSET if not isinstance(self.incident_condition_incident_type, Unset): incident_condition_incident_type = self.incident_condition_incident_type - incident_condition_incident_roles: Union[Unset, str] = UNSET + incident_condition_incident_roles: Unset | str = UNSET if not isinstance(self.incident_condition_incident_roles, Unset): incident_condition_incident_roles = self.incident_condition_incident_roles - incident_condition_service: Union[Unset, str] = UNSET + incident_condition_service: Unset | str = UNSET if not isinstance(self.incident_condition_service, Unset): incident_condition_service = self.incident_condition_service - incident_condition_functionality: Union[Unset, str] = UNSET + incident_condition_functionality: Unset | str = UNSET if not isinstance(self.incident_condition_functionality, Unset): incident_condition_functionality = self.incident_condition_functionality - incident_condition_group: Union[Unset, str] = UNSET + incident_condition_group: Unset | str = UNSET if not isinstance(self.incident_condition_group, Unset): incident_condition_group = self.incident_condition_group - incident_condition_label: Union[Unset, str] = UNSET + incident_condition_label: Unset | str = UNSET if not isinstance(self.incident_condition_label, Unset): incident_condition_label = self.incident_condition_label incident_condition_label_use_regexp = self.incident_condition_label_use_regexp - incident_labels: Union[Unset, list[str]] = UNSET + incident_labels: Unset | list[str] = UNSET if not isinstance(self.incident_labels, Unset): incident_labels = self.incident_labels - incident_condition_summary: Union[Unset, str] = UNSET + incident_condition_summary: Unset | str = UNSET if not isinstance(self.incident_condition_summary, Unset): incident_condition_summary = self.incident_condition_summary - incident_condition_started_at: Union[Unset, str] = UNSET + incident_condition_started_at: Unset | str = UNSET if not isinstance(self.incident_condition_started_at, Unset): incident_condition_started_at = self.incident_condition_started_at - incident_condition_detected_at: Union[Unset, str] = UNSET + incident_condition_detected_at: Unset | str = UNSET if not isinstance(self.incident_condition_detected_at, Unset): incident_condition_detected_at = self.incident_condition_detected_at - incident_condition_acknowledged_at: Union[Unset, str] = UNSET + incident_condition_acknowledged_at: Unset | str = UNSET if not isinstance(self.incident_condition_acknowledged_at, Unset): incident_condition_acknowledged_at = self.incident_condition_acknowledged_at - incident_condition_mitigated_at: Union[Unset, str] = UNSET + incident_condition_mitigated_at: Unset | str = UNSET if not isinstance(self.incident_condition_mitigated_at, Unset): incident_condition_mitigated_at = self.incident_condition_mitigated_at - incident_condition_resolved_at: Union[Unset, str] = UNSET + incident_condition_resolved_at: Unset | str = UNSET if not isinstance(self.incident_condition_resolved_at, Unset): incident_condition_resolved_at = self.incident_condition_resolved_at - incident_conditional_inactivity: Union[Unset, str] = UNSET + incident_conditional_inactivity: Unset | str = UNSET if not isinstance(self.incident_conditional_inactivity, Unset): incident_conditional_inactivity = self.incident_conditional_inactivity - incident_action_item_condition: Union[Unset, str] = UNSET + incident_action_item_condition: Unset | str = UNSET if not isinstance(self.incident_action_item_condition, Unset): incident_action_item_condition = self.incident_action_item_condition - incident_action_item_condition_kind: Union[Unset, str] = UNSET + incident_action_item_condition_kind: Unset | str = UNSET if not isinstance(self.incident_action_item_condition_kind, Unset): incident_action_item_condition_kind = self.incident_action_item_condition_kind - incident_action_item_kinds: Union[Unset, list[str]] = UNSET + incident_action_item_kinds: Unset | list[str] = UNSET if not isinstance(self.incident_action_item_kinds, Unset): incident_action_item_kinds = [] for incident_action_item_kinds_item_data in self.incident_action_item_kinds: incident_action_item_kinds_item: str = incident_action_item_kinds_item_data incident_action_item_kinds.append(incident_action_item_kinds_item) - incident_action_item_condition_status: Union[Unset, str] = UNSET + incident_action_item_condition_status: Unset | str = UNSET if not isinstance(self.incident_action_item_condition_status, Unset): incident_action_item_condition_status = self.incident_action_item_condition_status - incident_action_item_statuses: Union[Unset, list[str]] = UNSET + incident_action_item_statuses: Unset | list[str] = UNSET if not isinstance(self.incident_action_item_statuses, Unset): incident_action_item_statuses = [] for incident_action_item_statuses_item_data in self.incident_action_item_statuses: incident_action_item_statuses_item: str = incident_action_item_statuses_item_data incident_action_item_statuses.append(incident_action_item_statuses_item) - incident_action_item_condition_priority: Union[Unset, str] = UNSET + incident_action_item_condition_priority: Unset | str = UNSET if not isinstance(self.incident_action_item_condition_priority, Unset): incident_action_item_condition_priority = self.incident_action_item_condition_priority - incident_action_item_priorities: Union[Unset, list[str]] = UNSET + incident_action_item_priorities: Unset | list[str] = UNSET if not isinstance(self.incident_action_item_priorities, Unset): incident_action_item_priorities = [] for incident_action_item_priorities_item_data in self.incident_action_item_priorities: incident_action_item_priorities_item: str = incident_action_item_priorities_item_data incident_action_item_priorities.append(incident_action_item_priorities_item) - incident_action_item_condition_group: Union[Unset, str] = UNSET + incident_action_item_condition_group: Unset | str = UNSET if not isinstance(self.incident_action_item_condition_group, Unset): incident_action_item_condition_group = self.incident_action_item_condition_group - incident_action_item_group_ids: Union[Unset, list[str]] = UNSET + incident_action_item_group_ids: Unset | list[str] = UNSET if not isinstance(self.incident_action_item_group_ids, Unset): incident_action_item_group_ids = self.incident_action_item_group_ids @@ -498,24 +494,24 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: incident_statuses.append(incident_statuses_item) - def _parse_incident_inactivity_duration(data: object) -> Union[None, Unset, str]: + def _parse_incident_inactivity_duration(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) incident_inactivity_duration = _parse_incident_inactivity_duration(d.pop("incident_inactivity_duration", UNSET)) _incident_condition = d.pop("incident_condition", UNSET) - incident_condition: Union[Unset, ActionItemTriggerParamsIncidentCondition] + incident_condition: Unset | ActionItemTriggerParamsIncidentCondition if isinstance(_incident_condition, Unset): incident_condition = UNSET else: incident_condition = check_action_item_trigger_params_incident_condition(_incident_condition) _incident_condition_visibility = d.pop("incident_condition_visibility", UNSET) - incident_condition_visibility: Union[Unset, ActionItemTriggerParamsIncidentConditionVisibility] + incident_condition_visibility: Unset | ActionItemTriggerParamsIncidentConditionVisibility if isinstance(_incident_condition_visibility, Unset): incident_condition_visibility = UNSET else: @@ -524,14 +520,14 @@ def _parse_incident_inactivity_duration(data: object) -> Union[None, Unset, str] ) _incident_condition_kind = d.pop("incident_condition_kind", UNSET) - incident_condition_kind: Union[Unset, ActionItemTriggerParamsIncidentConditionKind] + incident_condition_kind: Unset | ActionItemTriggerParamsIncidentConditionKind if isinstance(_incident_condition_kind, Unset): incident_condition_kind = UNSET else: incident_condition_kind = check_action_item_trigger_params_incident_condition_kind(_incident_condition_kind) _incident_condition_status = d.pop("incident_condition_status", UNSET) - incident_condition_status: Union[Unset, ActionItemTriggerParamsIncidentConditionStatus] + incident_condition_status: Unset | ActionItemTriggerParamsIncidentConditionStatus if isinstance(_incident_condition_status, Unset): incident_condition_status = UNSET else: @@ -540,7 +536,7 @@ def _parse_incident_inactivity_duration(data: object) -> Union[None, Unset, str] ) _incident_condition_sub_status = d.pop("incident_condition_sub_status", UNSET) - incident_condition_sub_status: Union[Unset, ActionItemTriggerParamsIncidentConditionSubStatus] + incident_condition_sub_status: Unset | ActionItemTriggerParamsIncidentConditionSubStatus if isinstance(_incident_condition_sub_status, Unset): incident_condition_sub_status = UNSET else: @@ -549,7 +545,7 @@ def _parse_incident_inactivity_duration(data: object) -> Union[None, Unset, str] ) _incident_condition_environment = d.pop("incident_condition_environment", UNSET) - incident_condition_environment: Union[Unset, ActionItemTriggerParamsIncidentConditionEnvironment] + incident_condition_environment: Unset | ActionItemTriggerParamsIncidentConditionEnvironment if isinstance(_incident_condition_environment, Unset): incident_condition_environment = UNSET else: @@ -558,7 +554,7 @@ def _parse_incident_inactivity_duration(data: object) -> Union[None, Unset, str] ) _incident_condition_severity = d.pop("incident_condition_severity", UNSET) - incident_condition_severity: Union[Unset, ActionItemTriggerParamsIncidentConditionSeverity] + incident_condition_severity: Unset | ActionItemTriggerParamsIncidentConditionSeverity if isinstance(_incident_condition_severity, Unset): incident_condition_severity = UNSET else: @@ -567,7 +563,7 @@ def _parse_incident_inactivity_duration(data: object) -> Union[None, Unset, str] ) _incident_condition_incident_type = d.pop("incident_condition_incident_type", UNSET) - incident_condition_incident_type: Union[Unset, ActionItemTriggerParamsIncidentConditionIncidentType] + incident_condition_incident_type: Unset | ActionItemTriggerParamsIncidentConditionIncidentType if isinstance(_incident_condition_incident_type, Unset): incident_condition_incident_type = UNSET else: @@ -576,7 +572,7 @@ def _parse_incident_inactivity_duration(data: object) -> Union[None, Unset, str] ) _incident_condition_incident_roles = d.pop("incident_condition_incident_roles", UNSET) - incident_condition_incident_roles: Union[Unset, ActionItemTriggerParamsIncidentConditionIncidentRoles] + incident_condition_incident_roles: Unset | ActionItemTriggerParamsIncidentConditionIncidentRoles if isinstance(_incident_condition_incident_roles, Unset): incident_condition_incident_roles = UNSET else: @@ -585,7 +581,7 @@ def _parse_incident_inactivity_duration(data: object) -> Union[None, Unset, str] ) _incident_condition_service = d.pop("incident_condition_service", UNSET) - incident_condition_service: Union[Unset, ActionItemTriggerParamsIncidentConditionService] + incident_condition_service: Unset | ActionItemTriggerParamsIncidentConditionService if isinstance(_incident_condition_service, Unset): incident_condition_service = UNSET else: @@ -594,7 +590,7 @@ def _parse_incident_inactivity_duration(data: object) -> Union[None, Unset, str] ) _incident_condition_functionality = d.pop("incident_condition_functionality", UNSET) - incident_condition_functionality: Union[Unset, ActionItemTriggerParamsIncidentConditionFunctionality] + incident_condition_functionality: Unset | ActionItemTriggerParamsIncidentConditionFunctionality if isinstance(_incident_condition_functionality, Unset): incident_condition_functionality = UNSET else: @@ -603,7 +599,7 @@ def _parse_incident_inactivity_duration(data: object) -> Union[None, Unset, str] ) _incident_condition_group = d.pop("incident_condition_group", UNSET) - incident_condition_group: Union[Unset, ActionItemTriggerParamsIncidentConditionGroup] + incident_condition_group: Unset | ActionItemTriggerParamsIncidentConditionGroup if isinstance(_incident_condition_group, Unset): incident_condition_group = UNSET else: @@ -612,7 +608,7 @@ def _parse_incident_inactivity_duration(data: object) -> Union[None, Unset, str] ) _incident_condition_label = d.pop("incident_condition_label", UNSET) - incident_condition_label: Union[Unset, ActionItemTriggerParamsIncidentConditionLabel] + incident_condition_label: Unset | ActionItemTriggerParamsIncidentConditionLabel if isinstance(_incident_condition_label, Unset): incident_condition_label = UNSET else: @@ -625,7 +621,7 @@ def _parse_incident_inactivity_duration(data: object) -> Union[None, Unset, str] incident_labels = cast(list[str], d.pop("incident_labels", UNSET)) _incident_condition_summary = d.pop("incident_condition_summary", UNSET) - incident_condition_summary: Union[Unset, ActionItemTriggerParamsIncidentConditionSummary] + incident_condition_summary: Unset | ActionItemTriggerParamsIncidentConditionSummary if isinstance(_incident_condition_summary, Unset): incident_condition_summary = UNSET else: @@ -634,7 +630,7 @@ def _parse_incident_inactivity_duration(data: object) -> Union[None, Unset, str] ) _incident_condition_started_at = d.pop("incident_condition_started_at", UNSET) - incident_condition_started_at: Union[Unset, ActionItemTriggerParamsIncidentConditionStartedAt] + incident_condition_started_at: Unset | ActionItemTriggerParamsIncidentConditionStartedAt if isinstance(_incident_condition_started_at, Unset): incident_condition_started_at = UNSET else: @@ -643,7 +639,7 @@ def _parse_incident_inactivity_duration(data: object) -> Union[None, Unset, str] ) _incident_condition_detected_at = d.pop("incident_condition_detected_at", UNSET) - incident_condition_detected_at: Union[Unset, ActionItemTriggerParamsIncidentConditionDetectedAt] + incident_condition_detected_at: Unset | ActionItemTriggerParamsIncidentConditionDetectedAt if isinstance(_incident_condition_detected_at, Unset): incident_condition_detected_at = UNSET else: @@ -652,7 +648,7 @@ def _parse_incident_inactivity_duration(data: object) -> Union[None, Unset, str] ) _incident_condition_acknowledged_at = d.pop("incident_condition_acknowledged_at", UNSET) - incident_condition_acknowledged_at: Union[Unset, ActionItemTriggerParamsIncidentConditionAcknowledgedAt] + incident_condition_acknowledged_at: Unset | ActionItemTriggerParamsIncidentConditionAcknowledgedAt if isinstance(_incident_condition_acknowledged_at, Unset): incident_condition_acknowledged_at = UNSET else: @@ -661,7 +657,7 @@ def _parse_incident_inactivity_duration(data: object) -> Union[None, Unset, str] ) _incident_condition_mitigated_at = d.pop("incident_condition_mitigated_at", UNSET) - incident_condition_mitigated_at: Union[Unset, ActionItemTriggerParamsIncidentConditionMitigatedAt] + incident_condition_mitigated_at: Unset | ActionItemTriggerParamsIncidentConditionMitigatedAt if isinstance(_incident_condition_mitigated_at, Unset): incident_condition_mitigated_at = UNSET else: @@ -670,7 +666,7 @@ def _parse_incident_inactivity_duration(data: object) -> Union[None, Unset, str] ) _incident_condition_resolved_at = d.pop("incident_condition_resolved_at", UNSET) - incident_condition_resolved_at: Union[Unset, ActionItemTriggerParamsIncidentConditionResolvedAt] + incident_condition_resolved_at: Unset | ActionItemTriggerParamsIncidentConditionResolvedAt if isinstance(_incident_condition_resolved_at, Unset): incident_condition_resolved_at = UNSET else: @@ -679,7 +675,7 @@ def _parse_incident_inactivity_duration(data: object) -> Union[None, Unset, str] ) _incident_conditional_inactivity = d.pop("incident_conditional_inactivity", UNSET) - incident_conditional_inactivity: Union[Unset, ActionItemTriggerParamsIncidentConditionalInactivity] + incident_conditional_inactivity: Unset | ActionItemTriggerParamsIncidentConditionalInactivity if isinstance(_incident_conditional_inactivity, Unset): incident_conditional_inactivity = UNSET else: @@ -688,7 +684,7 @@ def _parse_incident_inactivity_duration(data: object) -> Union[None, Unset, str] ) _incident_action_item_condition = d.pop("incident_action_item_condition", UNSET) - incident_action_item_condition: Union[Unset, ActionItemTriggerParamsIncidentActionItemCondition] + incident_action_item_condition: Unset | ActionItemTriggerParamsIncidentActionItemCondition if isinstance(_incident_action_item_condition, Unset): incident_action_item_condition = UNSET else: @@ -697,7 +693,7 @@ def _parse_incident_inactivity_duration(data: object) -> Union[None, Unset, str] ) _incident_action_item_condition_kind = d.pop("incident_action_item_condition_kind", UNSET) - incident_action_item_condition_kind: Union[Unset, ActionItemTriggerParamsIncidentActionItemConditionKind] + incident_action_item_condition_kind: Unset | ActionItemTriggerParamsIncidentActionItemConditionKind if isinstance(_incident_action_item_condition_kind, Unset): incident_action_item_condition_kind = UNSET else: @@ -715,7 +711,7 @@ def _parse_incident_inactivity_duration(data: object) -> Union[None, Unset, str] incident_action_item_kinds.append(incident_action_item_kinds_item) _incident_action_item_condition_status = d.pop("incident_action_item_condition_status", UNSET) - incident_action_item_condition_status: Union[Unset, ActionItemTriggerParamsIncidentActionItemConditionStatus] + incident_action_item_condition_status: Unset | ActionItemTriggerParamsIncidentActionItemConditionStatus if isinstance(_incident_action_item_condition_status, Unset): incident_action_item_condition_status = UNSET else: @@ -735,9 +731,7 @@ def _parse_incident_inactivity_duration(data: object) -> Union[None, Unset, str] incident_action_item_statuses.append(incident_action_item_statuses_item) _incident_action_item_condition_priority = d.pop("incident_action_item_condition_priority", UNSET) - incident_action_item_condition_priority: Union[ - Unset, ActionItemTriggerParamsIncidentActionItemConditionPriority - ] + incident_action_item_condition_priority: Unset | ActionItemTriggerParamsIncidentActionItemConditionPriority if isinstance(_incident_action_item_condition_priority, Unset): incident_action_item_condition_priority = UNSET else: @@ -759,7 +753,7 @@ def _parse_incident_inactivity_duration(data: object) -> Union[None, Unset, str] incident_action_item_priorities.append(incident_action_item_priorities_item) _incident_action_item_condition_group = d.pop("incident_action_item_condition_group", UNSET) - incident_action_item_condition_group: Union[Unset, ActionItemTriggerParamsIncidentActionItemConditionGroup] + incident_action_item_condition_group: Unset | ActionItemTriggerParamsIncidentActionItemConditionGroup if isinstance(_incident_action_item_condition_group, Unset): incident_action_item_condition_group = UNSET else: diff --git a/rootly_sdk/models/add_action_item_task_params.py b/rootly_sdk/models/add_action_item_task_params.py index fa8b7d4d..ce3f369c 100644 --- a/rootly_sdk/models/add_action_item_task_params.py +++ b/rootly_sdk/models/add_action_item_task_params.py @@ -59,17 +59,17 @@ class AddActionItemTaskParams: priority: AddActionItemTaskParamsPriority summary: str status: AddActionItemTaskParamsStatus - task_type: Union[Unset, AddActionItemTaskParamsTaskType] = UNSET - attribute_to_query_by: Union[Unset, AddActionItemTaskParamsAttributeToQueryBy] = UNSET - query_value: Union[None, Unset, str] = UNSET - incident_role_id: Union[Unset, str] = UNSET - assigned_to_user_id: Union[Unset, str] = UNSET + task_type: Unset | AddActionItemTaskParamsTaskType = UNSET + attribute_to_query_by: Unset | AddActionItemTaskParamsAttributeToQueryBy = UNSET + query_value: None | Unset | str = UNSET + incident_role_id: Unset | str = UNSET + assigned_to_user_id: Unset | str = UNSET assigned_to_user: Union[Unset, "AddActionItemTaskParamsAssignedToUser"] = UNSET - kind: Union[Unset, str] = UNSET - description: Union[Unset, str] = UNSET - post_to_incident_timeline: Union[Unset, bool] = UNSET - custom_fields_mapping: Union[None, Unset, str] = UNSET - post_to_slack_channels: Union[Unset, list["AddActionItemTaskParamsPostToSlackChannelsItem"]] = UNSET + kind: Unset | str = UNSET + description: Unset | str = UNSET + post_to_incident_timeline: Unset | bool = UNSET + custom_fields_mapping: None | Unset | str = UNSET + post_to_slack_channels: Unset | list["AddActionItemTaskParamsPostToSlackChannelsItem"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -79,15 +79,15 @@ def to_dict(self) -> dict[str, Any]: status: str = self.status - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - attribute_to_query_by: Union[Unset, str] = UNSET + attribute_to_query_by: Unset | str = UNSET if not isinstance(self.attribute_to_query_by, Unset): attribute_to_query_by = self.attribute_to_query_by - query_value: Union[None, Unset, str] + query_value: None | Unset | str if isinstance(self.query_value, Unset): query_value = UNSET else: @@ -97,7 +97,7 @@ def to_dict(self) -> dict[str, Any]: assigned_to_user_id = self.assigned_to_user_id - assigned_to_user: Union[Unset, dict[str, Any]] = UNSET + assigned_to_user: Unset | dict[str, Any] = UNSET if not isinstance(self.assigned_to_user, Unset): assigned_to_user = self.assigned_to_user.to_dict() @@ -107,13 +107,13 @@ def to_dict(self) -> dict[str, Any]: post_to_incident_timeline = self.post_to_incident_timeline - custom_fields_mapping: Union[None, Unset, str] + custom_fields_mapping: None | Unset | str if isinstance(self.custom_fields_mapping, Unset): custom_fields_mapping = UNSET else: custom_fields_mapping = self.custom_fields_mapping - post_to_slack_channels: Union[Unset, list[dict[str, Any]]] = UNSET + post_to_slack_channels: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.post_to_slack_channels, Unset): post_to_slack_channels = [] for post_to_slack_channels_item_data in self.post_to_slack_channels: @@ -169,25 +169,25 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: status = check_add_action_item_task_params_status(d.pop("status")) _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, AddActionItemTaskParamsTaskType] + task_type: Unset | AddActionItemTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: task_type = check_add_action_item_task_params_task_type(_task_type) _attribute_to_query_by = d.pop("attribute_to_query_by", UNSET) - attribute_to_query_by: Union[Unset, AddActionItemTaskParamsAttributeToQueryBy] + attribute_to_query_by: Unset | AddActionItemTaskParamsAttributeToQueryBy if isinstance(_attribute_to_query_by, Unset): attribute_to_query_by = UNSET else: attribute_to_query_by = check_add_action_item_task_params_attribute_to_query_by(_attribute_to_query_by) - def _parse_query_value(data: object) -> Union[None, Unset, str]: + def _parse_query_value(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) query_value = _parse_query_value(d.pop("query_value", UNSET)) @@ -196,7 +196,7 @@ def _parse_query_value(data: object) -> Union[None, Unset, str]: assigned_to_user_id = d.pop("assigned_to_user_id", UNSET) _assigned_to_user = d.pop("assigned_to_user", UNSET) - assigned_to_user: Union[Unset, AddActionItemTaskParamsAssignedToUser] + assigned_to_user: Unset | AddActionItemTaskParamsAssignedToUser if isinstance(_assigned_to_user, Unset): assigned_to_user = UNSET else: @@ -208,12 +208,12 @@ def _parse_query_value(data: object) -> Union[None, Unset, str]: post_to_incident_timeline = d.pop("post_to_incident_timeline", UNSET) - def _parse_custom_fields_mapping(data: object) -> Union[None, Unset, str]: + def _parse_custom_fields_mapping(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) custom_fields_mapping = _parse_custom_fields_mapping(d.pop("custom_fields_mapping", UNSET)) diff --git a/rootly_sdk/models/add_action_item_task_params_assigned_to_user.py b/rootly_sdk/models/add_action_item_task_params_assigned_to_user.py index efda1d60..972a5720 100644 --- a/rootly_sdk/models/add_action_item_task_params_assigned_to_user.py +++ b/rootly_sdk/models/add_action_item_task_params_assigned_to_user.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -18,8 +18,8 @@ class AddActionItemTaskParamsAssignedToUser: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/add_action_item_task_params_post_to_slack_channels_item.py b/rootly_sdk/models/add_action_item_task_params_post_to_slack_channels_item.py index d3e2ed64..0c500319 100644 --- a/rootly_sdk/models/add_action_item_task_params_post_to_slack_channels_item.py +++ b/rootly_sdk/models/add_action_item_task_params_post_to_slack_channels_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class AddActionItemTaskParamsPostToSlackChannelsItem: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/add_microsoft_teams_chat_tab_task_params.py b/rootly_sdk/models/add_microsoft_teams_chat_tab_task_params.py index 699bb122..ae7c5c7b 100644 --- a/rootly_sdk/models/add_microsoft_teams_chat_tab_task_params.py +++ b/rootly_sdk/models/add_microsoft_teams_chat_tab_task_params.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -30,7 +30,7 @@ class AddMicrosoftTeamsChatTabTaskParams: chat: "AddMicrosoftTeamsChatTabTaskParamsChat" title: str link: str - task_type: Union[Unset, AddMicrosoftTeamsChatTabTaskParamsTaskType] = UNSET + task_type: Unset | AddMicrosoftTeamsChatTabTaskParamsTaskType = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -40,7 +40,7 @@ def to_dict(self) -> dict[str, Any]: link = self.link - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -70,7 +70,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: link = d.pop("link") _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, AddMicrosoftTeamsChatTabTaskParamsTaskType] + task_type: Unset | AddMicrosoftTeamsChatTabTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/add_microsoft_teams_chat_tab_task_params_chat.py b/rootly_sdk/models/add_microsoft_teams_chat_tab_task_params_chat.py index 01b9e8b4..2d33f9ef 100644 --- a/rootly_sdk/models/add_microsoft_teams_chat_tab_task_params_chat.py +++ b/rootly_sdk/models/add_microsoft_teams_chat_tab_task_params_chat.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class AddMicrosoftTeamsChatTabTaskParamsChat: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/add_role_task_params.py b/rootly_sdk/models/add_role_task_params.py index 2aa322e6..85e68e5a 100644 --- a/rootly_sdk/models/add_role_task_params.py +++ b/rootly_sdk/models/add_role_task_params.py @@ -26,21 +26,21 @@ class AddRoleTaskParams: """ incident_role_id: str - task_type: Union[Unset, AddRoleTaskParamsTaskType] = UNSET - assigned_to_user_id: Union[Unset, str] = UNSET + task_type: Unset | AddRoleTaskParamsTaskType = UNSET + assigned_to_user_id: Unset | str = UNSET assigned_to_user: Union[Unset, "AddRoleTaskParamsAssignedToUser"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: incident_role_id = self.incident_role_id - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type assigned_to_user_id = self.assigned_to_user_id - assigned_to_user: Union[Unset, dict[str, Any]] = UNSET + assigned_to_user: Unset | dict[str, Any] = UNSET if not isinstance(self.assigned_to_user, Unset): assigned_to_user = self.assigned_to_user.to_dict() @@ -68,7 +68,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: incident_role_id = d.pop("incident_role_id") _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, AddRoleTaskParamsTaskType] + task_type: Unset | AddRoleTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: @@ -77,7 +77,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: assigned_to_user_id = d.pop("assigned_to_user_id", UNSET) _assigned_to_user = d.pop("assigned_to_user", UNSET) - assigned_to_user: Union[Unset, AddRoleTaskParamsAssignedToUser] + assigned_to_user: Unset | AddRoleTaskParamsAssignedToUser if isinstance(_assigned_to_user, Unset): assigned_to_user = UNSET else: diff --git a/rootly_sdk/models/add_role_task_params_assigned_to_user.py b/rootly_sdk/models/add_role_task_params_assigned_to_user.py index 773c88a5..8e99caa9 100644 --- a/rootly_sdk/models/add_role_task_params_assigned_to_user.py +++ b/rootly_sdk/models/add_role_task_params_assigned_to_user.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -18,8 +18,8 @@ class AddRoleTaskParamsAssignedToUser: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/add_subscribers_data_attributes.py b/rootly_sdk/models/add_subscribers_data_attributes.py index 2b72bf7a..b3543b07 100644 --- a/rootly_sdk/models/add_subscribers_data_attributes.py +++ b/rootly_sdk/models/add_subscribers_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -17,11 +17,11 @@ class AddSubscribersDataAttributes: private incidents will be removed from the subscriber list of this incident Default: False. """ - user_ids: Union[None, Unset, list[str]] = UNSET - remove_users_with_no_private_incident_access: Union[None, Unset, bool] = False + user_ids: None | Unset | list[str] = UNSET + remove_users_with_no_private_incident_access: None | Unset | bool = False def to_dict(self) -> dict[str, Any]: - user_ids: Union[None, Unset, list[str]] + user_ids: None | Unset | list[str] if isinstance(self.user_ids, Unset): user_ids = UNSET elif isinstance(self.user_ids, list): @@ -30,7 +30,7 @@ def to_dict(self) -> dict[str, Any]: else: user_ids = self.user_ids - remove_users_with_no_private_incident_access: Union[None, Unset, bool] + remove_users_with_no_private_incident_access: None | Unset | bool if isinstance(self.remove_users_with_no_private_incident_access, Unset): remove_users_with_no_private_incident_access = UNSET else: @@ -50,7 +50,7 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_user_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_user_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -63,16 +63,16 @@ def _parse_user_ids(data: object) -> Union[None, Unset, list[str]]: return user_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) user_ids = _parse_user_ids(d.pop("user_ids", UNSET)) - def _parse_remove_users_with_no_private_incident_access(data: object) -> Union[None, Unset, bool]: + def _parse_remove_users_with_no_private_incident_access(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) remove_users_with_no_private_incident_access = _parse_remove_users_with_no_private_incident_access( d.pop("remove_users_with_no_private_incident_access", UNSET) diff --git a/rootly_sdk/models/add_team_task_params.py b/rootly_sdk/models/add_team_task_params.py index 158d9c1f..f1847b9a 100644 --- a/rootly_sdk/models/add_team_task_params.py +++ b/rootly_sdk/models/add_team_task_params.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,13 +19,13 @@ class AddTeamTaskParams: """ group_id: str - task_type: Union[Unset, AddTeamTaskParamsTaskType] = UNSET + task_type: Unset | AddTeamTaskParamsTaskType = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: group_id = self.group_id - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -47,7 +47,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: group_id = d.pop("group_id") _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, AddTeamTaskParamsTaskType] + task_type: Unset | AddTeamTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/add_to_timeline_task_params.py b/rootly_sdk/models/add_to_timeline_task_params.py index d435c175..d30f8943 100644 --- a/rootly_sdk/models/add_to_timeline_task_params.py +++ b/rootly_sdk/models/add_to_timeline_task_params.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -30,21 +30,21 @@ class AddToTimelineTaskParams: """ event: str - task_type: Union[Unset, AddToTimelineTaskParamsTaskType] = UNSET - url: Union[Unset, str] = UNSET - post_to_slack_channels: Union[Unset, list["AddToTimelineTaskParamsPostToSlackChannelsItem"]] = UNSET + task_type: Unset | AddToTimelineTaskParamsTaskType = UNSET + url: Unset | str = UNSET + post_to_slack_channels: Unset | list["AddToTimelineTaskParamsPostToSlackChannelsItem"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: event = self.event - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type url = self.url - post_to_slack_channels: Union[Unset, list[dict[str, Any]]] = UNSET + post_to_slack_channels: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.post_to_slack_channels, Unset): post_to_slack_channels = [] for post_to_slack_channels_item_data in self.post_to_slack_channels: @@ -77,7 +77,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: event = d.pop("event") _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, AddToTimelineTaskParamsTaskType] + task_type: Unset | AddToTimelineTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/add_to_timeline_task_params_post_to_slack_channels_item.py b/rootly_sdk/models/add_to_timeline_task_params_post_to_slack_channels_item.py index 66a75d0f..bd3ec020 100644 --- a/rootly_sdk/models/add_to_timeline_task_params_post_to_slack_channels_item.py +++ b/rootly_sdk/models/add_to_timeline_task_params_post_to_slack_channels_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class AddToTimelineTaskParamsPostToSlackChannelsItem: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/ai_chat_response.py b/rootly_sdk/models/ai_chat_response.py index c420fe43..f2b4be4e 100644 --- a/rootly_sdk/models/ai_chat_response.py +++ b/rootly_sdk/models/ai_chat_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,13 +23,13 @@ class AiChatResponse: """ data: "AiChatResponseData" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/ai_chat_response_data_attributes.py b/rootly_sdk/models/ai_chat_response_data_attributes.py index 16734ad6..7c79d03d 100644 --- a/rootly_sdk/models/ai_chat_response_data_attributes.py +++ b/rootly_sdk/models/ai_chat_response_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from uuid import UUID from attrs import define as _attrs_define @@ -24,20 +24,20 @@ class AiChatResponseDataAttributes: """ session_id: UUID - reply: Union[None, Unset, str] = UNSET - status: Union[Unset, AiChatResponseDataAttributesStatus] = UNSET + reply: None | Unset | str = UNSET + status: Unset | AiChatResponseDataAttributesStatus = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: session_id = str(self.session_id) - reply: Union[None, Unset, str] + reply: None | Unset | str if isinstance(self.reply, Unset): reply = UNSET else: reply = self.reply - status: Union[Unset, str] = UNSET + status: Unset | str = UNSET if not isinstance(self.status, Unset): status = self.status @@ -60,17 +60,17 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) session_id = UUID(d.pop("session_id")) - def _parse_reply(data: object) -> Union[None, Unset, str]: + def _parse_reply(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) reply = _parse_reply(d.pop("reply", UNSET)) _status = d.pop("status", UNSET) - status: Union[Unset, AiChatResponseDataAttributesStatus] + status: Unset | AiChatResponseDataAttributesStatus if isinstance(_status, Unset): status = UNSET else: diff --git a/rootly_sdk/models/ai_chat_session_message_list.py b/rootly_sdk/models/ai_chat_session_message_list.py index 01c7bd82..30301e4a 100644 --- a/rootly_sdk/models/ai_chat_session_message_list.py +++ b/rootly_sdk/models/ai_chat_session_message_list.py @@ -32,7 +32,7 @@ def to_dict(self) -> dict[str, Any]: messages_item = messages_item_data.to_dict() messages.append(messages_item) - meta: Union[Unset, dict[str, Any]] = UNSET + meta: Unset | dict[str, Any] = UNSET if not isinstance(self.meta, Unset): meta = self.meta.to_dict() @@ -62,7 +62,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: messages.append(messages_item) _meta = d.pop("meta", UNSET) - meta: Union[Unset, AiChatSessionMessageListMeta] + meta: Unset | AiChatSessionMessageListMeta if isinstance(_meta, Unset): meta = UNSET else: diff --git a/rootly_sdk/models/alert.py b/rootly_sdk/models/alert.py index 3c3ad56b..c4303e8e 100644 --- a/rootly_sdk/models/alert.py +++ b/rootly_sdk/models/alert.py @@ -84,35 +84,35 @@ class Alert: summary: str created_at: str updated_at: str - noise: Union[Unset, AlertNoise] = UNSET - status: Union[Unset, AlertStatus] = UNSET - description: Union[None, Unset, str] = UNSET - services: Union[Unset, list["Service"]] = UNSET - groups: Union[Unset, list["Team"]] = UNSET - functionalities: Union[Unset, list["Functionality"]] = UNSET - environments: Union[Unset, list["Environment"]] = UNSET - service_ids: Union[None, Unset, list[str]] = UNSET - group_ids: Union[None, Unset, list[str]] = UNSET - functionality_ids: Union[None, Unset, list[str]] = UNSET - environment_ids: Union[None, Unset, list[str]] = UNSET - external_id: Union[None, Unset, str] = UNSET - external_url: Union[None, Unset, str] = UNSET - alert_urgency_id: Union[None, Unset, str] = UNSET + noise: Unset | AlertNoise = UNSET + status: Unset | AlertStatus = UNSET + description: None | Unset | str = UNSET + services: Unset | list["Service"] = UNSET + groups: Unset | list["Team"] = UNSET + functionalities: Unset | list["Functionality"] = UNSET + environments: Unset | list["Environment"] = UNSET + service_ids: None | Unset | list[str] = UNSET + group_ids: None | Unset | list[str] = UNSET + functionality_ids: None | Unset | list[str] = UNSET + environment_ids: None | Unset | list[str] = UNSET + external_id: None | Unset | str = UNSET + external_url: None | Unset | str = UNSET + alert_urgency_id: None | Unset | str = UNSET alert_urgency: Union[Unset, "AlertUrgency"] = UNSET - group_leader_alert_id: Union[None, Unset, str] = UNSET - is_group_leader_alert: Union[None, Unset, bool] = UNSET - labels: Union[Unset, list[Union["AlertLabelsItemType0", None]]] = UNSET + group_leader_alert_id: None | Unset | str = UNSET + is_group_leader_alert: None | Unset | bool = UNSET + labels: Unset | list[Union["AlertLabelsItemType0", None]] = UNSET data: Union["AlertDataType0", None, Unset] = UNSET - notification_target_type: Union[Unset, AlertNotificationTargetType] = UNSET - notification_target_id: Union[None, Unset, str] = UNSET - deduplication_key: Union[None, Unset, str] = UNSET - alert_field_values: Union[None, Unset, list["AlertAlertFieldValuesType0Item"]] = UNSET - responders: Union[None, Unset, list["UserFlatResponse"]] = UNSET - notified_users: Union[None, Unset, list["User"]] = UNSET - alerting_targets: Union[None, Unset, list["AlertAlertingTargetsType0Item"]] = UNSET - url: Union[Unset, str] = UNSET - started_at: Union[None, Unset, datetime.datetime] = UNSET - ended_at: Union[None, Unset, datetime.datetime] = UNSET + notification_target_type: Unset | AlertNotificationTargetType = UNSET + notification_target_id: None | Unset | str = UNSET + deduplication_key: None | Unset | str = UNSET + alert_field_values: None | Unset | list["AlertAlertFieldValuesType0Item"] = UNSET + responders: None | Unset | list["UserFlatResponse"] = UNSET + notified_users: None | Unset | list["User"] = UNSET + alerting_targets: None | Unset | list["AlertAlertingTargetsType0Item"] = UNSET + url: Unset | str = UNSET + started_at: None | Unset | datetime.datetime = UNSET + ended_at: None | Unset | datetime.datetime = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -129,49 +129,49 @@ def to_dict(self) -> dict[str, Any]: updated_at = self.updated_at - noise: Union[Unset, str] = UNSET + noise: Unset | str = UNSET if not isinstance(self.noise, Unset): noise = self.noise - status: Union[Unset, str] = UNSET + status: Unset | str = UNSET if not isinstance(self.status, Unset): status = self.status - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - services: Union[Unset, list[dict[str, Any]]] = UNSET + services: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.services, Unset): services = [] for services_item_data in self.services: services_item = services_item_data.to_dict() services.append(services_item) - groups: Union[Unset, list[dict[str, Any]]] = UNSET + groups: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.groups, Unset): groups = [] for groups_item_data in self.groups: groups_item = groups_item_data.to_dict() groups.append(groups_item) - functionalities: Union[Unset, list[dict[str, Any]]] = UNSET + functionalities: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.functionalities, Unset): functionalities = [] for functionalities_item_data in self.functionalities: functionalities_item = functionalities_item_data.to_dict() functionalities.append(functionalities_item) - environments: Union[Unset, list[dict[str, Any]]] = UNSET + environments: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.environments, Unset): environments = [] for environments_item_data in self.environments: environments_item = environments_item_data.to_dict() environments.append(environments_item) - service_ids: Union[None, Unset, list[str]] + service_ids: None | Unset | list[str] if isinstance(self.service_ids, Unset): service_ids = UNSET elif isinstance(self.service_ids, list): @@ -180,7 +180,7 @@ def to_dict(self) -> dict[str, Any]: else: service_ids = self.service_ids - group_ids: Union[None, Unset, list[str]] + group_ids: None | Unset | list[str] if isinstance(self.group_ids, Unset): group_ids = UNSET elif isinstance(self.group_ids, list): @@ -189,7 +189,7 @@ def to_dict(self) -> dict[str, Any]: else: group_ids = self.group_ids - functionality_ids: Union[None, Unset, list[str]] + functionality_ids: None | Unset | list[str] if isinstance(self.functionality_ids, Unset): functionality_ids = UNSET elif isinstance(self.functionality_ids, list): @@ -198,7 +198,7 @@ def to_dict(self) -> dict[str, Any]: else: functionality_ids = self.functionality_ids - environment_ids: Union[None, Unset, list[str]] + environment_ids: None | Unset | list[str] if isinstance(self.environment_ids, Unset): environment_ids = UNSET elif isinstance(self.environment_ids, list): @@ -207,52 +207,52 @@ def to_dict(self) -> dict[str, Any]: else: environment_ids = self.environment_ids - external_id: Union[None, Unset, str] + external_id: None | Unset | str if isinstance(self.external_id, Unset): external_id = UNSET else: external_id = self.external_id - external_url: Union[None, Unset, str] + external_url: None | Unset | str if isinstance(self.external_url, Unset): external_url = UNSET else: external_url = self.external_url - alert_urgency_id: Union[None, Unset, str] + alert_urgency_id: None | Unset | str if isinstance(self.alert_urgency_id, Unset): alert_urgency_id = UNSET else: alert_urgency_id = self.alert_urgency_id - alert_urgency: Union[Unset, dict[str, Any]] = UNSET + alert_urgency: Unset | dict[str, Any] = UNSET if not isinstance(self.alert_urgency, Unset): alert_urgency = self.alert_urgency.to_dict() - group_leader_alert_id: Union[None, Unset, str] + group_leader_alert_id: None | Unset | str if isinstance(self.group_leader_alert_id, Unset): group_leader_alert_id = UNSET else: group_leader_alert_id = self.group_leader_alert_id - is_group_leader_alert: Union[None, Unset, bool] + is_group_leader_alert: None | Unset | bool if isinstance(self.is_group_leader_alert, Unset): is_group_leader_alert = UNSET else: is_group_leader_alert = self.is_group_leader_alert - labels: Union[Unset, list[Union[None, dict[str, Any]]]] = UNSET + labels: Unset | list[None | dict[str, Any]] = UNSET if not isinstance(self.labels, Unset): labels = [] for labels_item_data in self.labels: - labels_item: Union[None, dict[str, Any]] + labels_item: None | dict[str, Any] if isinstance(labels_item_data, AlertLabelsItemType0): labels_item = labels_item_data.to_dict() else: labels_item = labels_item_data labels.append(labels_item) - data: Union[None, Unset, dict[str, Any]] + data: None | Unset | dict[str, Any] if isinstance(self.data, Unset): data = UNSET elif isinstance(self.data, AlertDataType0): @@ -260,23 +260,23 @@ def to_dict(self) -> dict[str, Any]: else: data = self.data - notification_target_type: Union[Unset, str] = UNSET + notification_target_type: Unset | str = UNSET if not isinstance(self.notification_target_type, Unset): notification_target_type = self.notification_target_type - notification_target_id: Union[None, Unset, str] + notification_target_id: None | Unset | str if isinstance(self.notification_target_id, Unset): notification_target_id = UNSET else: notification_target_id = self.notification_target_id - deduplication_key: Union[None, Unset, str] + deduplication_key: None | Unset | str if isinstance(self.deduplication_key, Unset): deduplication_key = UNSET else: deduplication_key = self.deduplication_key - alert_field_values: Union[None, Unset, list[dict[str, Any]]] + alert_field_values: None | Unset | list[dict[str, Any]] if isinstance(self.alert_field_values, Unset): alert_field_values = UNSET elif isinstance(self.alert_field_values, list): @@ -288,7 +288,7 @@ def to_dict(self) -> dict[str, Any]: else: alert_field_values = self.alert_field_values - responders: Union[None, Unset, list[dict[str, Any]]] + responders: None | Unset | list[dict[str, Any]] if isinstance(self.responders, Unset): responders = UNSET elif isinstance(self.responders, list): @@ -300,7 +300,7 @@ def to_dict(self) -> dict[str, Any]: else: responders = self.responders - notified_users: Union[None, Unset, list[dict[str, Any]]] + notified_users: None | Unset | list[dict[str, Any]] if isinstance(self.notified_users, Unset): notified_users = UNSET elif isinstance(self.notified_users, list): @@ -312,7 +312,7 @@ def to_dict(self) -> dict[str, Any]: else: notified_users = self.notified_users - alerting_targets: Union[None, Unset, list[dict[str, Any]]] + alerting_targets: None | Unset | list[dict[str, Any]] if isinstance(self.alerting_targets, Unset): alerting_targets = UNSET elif isinstance(self.alerting_targets, list): @@ -326,7 +326,7 @@ def to_dict(self) -> dict[str, Any]: url = self.url - started_at: Union[None, Unset, str] + started_at: None | Unset | str if isinstance(self.started_at, Unset): started_at = UNSET elif isinstance(self.started_at, datetime.datetime): @@ -334,7 +334,7 @@ def to_dict(self) -> dict[str, Any]: else: started_at = self.started_at - ended_at: Union[None, Unset, str] + ended_at: None | Unset | str if isinstance(self.ended_at, Unset): ended_at = UNSET elif isinstance(self.ended_at, datetime.datetime): @@ -440,25 +440,25 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: updated_at = d.pop("updated_at") _noise = d.pop("noise", UNSET) - noise: Union[Unset, AlertNoise] + noise: Unset | AlertNoise if isinstance(_noise, Unset): noise = UNSET else: noise = check_alert_noise(_noise) _status = d.pop("status", UNSET) - status: Union[Unset, AlertStatus] + status: Unset | AlertStatus if isinstance(_status, Unset): status = UNSET else: status = check_alert_status(_status) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) @@ -490,7 +490,7 @@ def _parse_description(data: object) -> Union[None, Unset, str]: environments.append(environments_item) - def _parse_service_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_service_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -503,11 +503,11 @@ def _parse_service_ids(data: object) -> Union[None, Unset, list[str]]: return service_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) service_ids = _parse_service_ids(d.pop("service_ids", UNSET)) - def _parse_group_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_group_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -520,11 +520,11 @@ def _parse_group_ids(data: object) -> Union[None, Unset, list[str]]: return group_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) group_ids = _parse_group_ids(d.pop("group_ids", UNSET)) - def _parse_functionality_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_functionality_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -537,11 +537,11 @@ def _parse_functionality_ids(data: object) -> Union[None, Unset, list[str]]: return functionality_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) functionality_ids = _parse_functionality_ids(d.pop("functionality_ids", UNSET)) - def _parse_environment_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_environment_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -554,59 +554,59 @@ def _parse_environment_ids(data: object) -> Union[None, Unset, list[str]]: return environment_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) environment_ids = _parse_environment_ids(d.pop("environment_ids", UNSET)) - def _parse_external_id(data: object) -> Union[None, Unset, str]: + def _parse_external_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) external_id = _parse_external_id(d.pop("external_id", UNSET)) - def _parse_external_url(data: object) -> Union[None, Unset, str]: + def _parse_external_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) external_url = _parse_external_url(d.pop("external_url", UNSET)) - def _parse_alert_urgency_id(data: object) -> Union[None, Unset, str]: + def _parse_alert_urgency_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) alert_urgency_id = _parse_alert_urgency_id(d.pop("alert_urgency_id", UNSET)) _alert_urgency = d.pop("alert_urgency", UNSET) - alert_urgency: Union[Unset, AlertUrgency] + alert_urgency: Unset | AlertUrgency if isinstance(_alert_urgency, Unset): alert_urgency = UNSET else: alert_urgency = AlertUrgency.from_dict(_alert_urgency) - def _parse_group_leader_alert_id(data: object) -> Union[None, Unset, str]: + def _parse_group_leader_alert_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) group_leader_alert_id = _parse_group_leader_alert_id(d.pop("group_leader_alert_id", UNSET)) - def _parse_is_group_leader_alert(data: object) -> Union[None, Unset, bool]: + def _parse_is_group_leader_alert(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) is_group_leader_alert = _parse_is_group_leader_alert(d.pop("is_group_leader_alert", UNSET)) @@ -649,31 +649,31 @@ def _parse_data(data: object) -> Union["AlertDataType0", None, Unset]: data = _parse_data(d.pop("data", UNSET)) _notification_target_type = d.pop("notification_target_type", UNSET) - notification_target_type: Union[Unset, AlertNotificationTargetType] + notification_target_type: Unset | AlertNotificationTargetType if isinstance(_notification_target_type, Unset): notification_target_type = UNSET else: notification_target_type = check_alert_notification_target_type(_notification_target_type) - def _parse_notification_target_id(data: object) -> Union[None, Unset, str]: + def _parse_notification_target_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) notification_target_id = _parse_notification_target_id(d.pop("notification_target_id", UNSET)) - def _parse_deduplication_key(data: object) -> Union[None, Unset, str]: + def _parse_deduplication_key(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) deduplication_key = _parse_deduplication_key(d.pop("deduplication_key", UNSET)) - def _parse_alert_field_values(data: object) -> Union[None, Unset, list["AlertAlertFieldValuesType0Item"]]: + def _parse_alert_field_values(data: object) -> None | Unset | list["AlertAlertFieldValuesType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -693,11 +693,11 @@ def _parse_alert_field_values(data: object) -> Union[None, Unset, list["AlertAle return alert_field_values_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list["AlertAlertFieldValuesType0Item"]], data) + return cast(None | Unset | list["AlertAlertFieldValuesType0Item"], data) alert_field_values = _parse_alert_field_values(d.pop("alert_field_values", UNSET)) - def _parse_responders(data: object) -> Union[None, Unset, list["UserFlatResponse"]]: + def _parse_responders(data: object) -> None | Unset | list["UserFlatResponse"]: if data is None: return data if isinstance(data, Unset): @@ -715,11 +715,11 @@ def _parse_responders(data: object) -> Union[None, Unset, list["UserFlatResponse return responders_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list["UserFlatResponse"]], data) + return cast(None | Unset | list["UserFlatResponse"], data) responders = _parse_responders(d.pop("responders", UNSET)) - def _parse_notified_users(data: object) -> Union[None, Unset, list["User"]]: + def _parse_notified_users(data: object) -> None | Unset | list["User"]: if data is None: return data if isinstance(data, Unset): @@ -737,11 +737,11 @@ def _parse_notified_users(data: object) -> Union[None, Unset, list["User"]]: return notified_users_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list["User"]], data) + return cast(None | Unset | list["User"], data) notified_users = _parse_notified_users(d.pop("notified_users", UNSET)) - def _parse_alerting_targets(data: object) -> Union[None, Unset, list["AlertAlertingTargetsType0Item"]]: + def _parse_alerting_targets(data: object) -> None | Unset | list["AlertAlertingTargetsType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -761,13 +761,13 @@ def _parse_alerting_targets(data: object) -> Union[None, Unset, list["AlertAlert return alerting_targets_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list["AlertAlertingTargetsType0Item"]], data) + return cast(None | Unset | list["AlertAlertingTargetsType0Item"], data) alerting_targets = _parse_alerting_targets(d.pop("alerting_targets", UNSET)) url = d.pop("url", UNSET) - def _parse_started_at(data: object) -> Union[None, Unset, datetime.datetime]: + def _parse_started_at(data: object) -> None | Unset | datetime.datetime: if data is None: return data if isinstance(data, Unset): @@ -780,11 +780,11 @@ def _parse_started_at(data: object) -> Union[None, Unset, datetime.datetime]: return started_at_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, datetime.datetime], data) + return cast(None | Unset | datetime.datetime, data) started_at = _parse_started_at(d.pop("started_at", UNSET)) - def _parse_ended_at(data: object) -> Union[None, Unset, datetime.datetime]: + def _parse_ended_at(data: object) -> None | Unset | datetime.datetime: if data is None: return data if isinstance(data, Unset): @@ -797,7 +797,7 @@ def _parse_ended_at(data: object) -> Union[None, Unset, datetime.datetime]: return ended_at_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, datetime.datetime], data) + return cast(None | Unset | datetime.datetime, data) ended_at = _parse_ended_at(d.pop("ended_at", UNSET)) diff --git a/rootly_sdk/models/alert_event.py b/rootly_sdk/models/alert_event.py index d01b5629..035387e9 100644 --- a/rootly_sdk/models/alert_event.py +++ b/rootly_sdk/models/alert_event.py @@ -48,16 +48,16 @@ class AlertEvent: source: str created_at: str updated_at: str - user_id: Union[None, Unset, int] = UNSET - details: Union[None, Unset, str] = UNSET + user_id: None | Unset | int = UNSET + details: None | Unset | str = UNSET user: Union[Unset, "AlertEventUser"] = UNSET incident: Union["AlertEventIncidentType0", None, Unset] = UNSET schedule: Union["AlertEventScheduleType0", None, Unset] = UNSET - escalation_level: Union[None, Unset, int] = UNSET - escalation_target_type: Union[None, Unset, str] = UNSET + escalation_level: None | Unset | int = UNSET + escalation_target_type: None | Unset | str = UNSET escalation_target: Union["AlertEventEscalationTargetType0", None, Unset] = UNSET slack_channel: Union[Unset, "SlackChannel"] = UNSET - incident_ids: Union[None, Unset, list[str]] = UNSET + incident_ids: None | Unset | list[str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -77,23 +77,23 @@ def to_dict(self) -> dict[str, Any]: updated_at = self.updated_at - user_id: Union[None, Unset, int] + user_id: None | Unset | int if isinstance(self.user_id, Unset): user_id = UNSET else: user_id = self.user_id - details: Union[None, Unset, str] + details: None | Unset | str if isinstance(self.details, Unset): details = UNSET else: details = self.details - user: Union[Unset, dict[str, Any]] = UNSET + user: Unset | dict[str, Any] = UNSET if not isinstance(self.user, Unset): user = self.user.to_dict() - incident: Union[None, Unset, dict[str, Any]] + incident: None | Unset | dict[str, Any] if isinstance(self.incident, Unset): incident = UNSET elif isinstance(self.incident, AlertEventIncidentType0): @@ -101,7 +101,7 @@ def to_dict(self) -> dict[str, Any]: else: incident = self.incident - schedule: Union[None, Unset, dict[str, Any]] + schedule: None | Unset | dict[str, Any] if isinstance(self.schedule, Unset): schedule = UNSET elif isinstance(self.schedule, AlertEventScheduleType0): @@ -109,19 +109,19 @@ def to_dict(self) -> dict[str, Any]: else: schedule = self.schedule - escalation_level: Union[None, Unset, int] + escalation_level: None | Unset | int if isinstance(self.escalation_level, Unset): escalation_level = UNSET else: escalation_level = self.escalation_level - escalation_target_type: Union[None, Unset, str] + escalation_target_type: None | Unset | str if isinstance(self.escalation_target_type, Unset): escalation_target_type = UNSET else: escalation_target_type = self.escalation_target_type - escalation_target: Union[None, Unset, dict[str, Any]] + escalation_target: None | Unset | dict[str, Any] if isinstance(self.escalation_target, Unset): escalation_target = UNSET elif isinstance(self.escalation_target, AlertEventEscalationTargetType0): @@ -129,11 +129,11 @@ def to_dict(self) -> dict[str, Any]: else: escalation_target = self.escalation_target - slack_channel: Union[Unset, dict[str, Any]] = UNSET + slack_channel: Unset | dict[str, Any] = UNSET if not isinstance(self.slack_channel, Unset): slack_channel = self.slack_channel.to_dict() - incident_ids: Union[None, Unset, list[str]] + incident_ids: None | Unset | list[str] if isinstance(self.incident_ids, Unset): incident_ids = UNSET elif isinstance(self.incident_ids, list): @@ -198,26 +198,26 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: updated_at = d.pop("updated_at") - def _parse_user_id(data: object) -> Union[None, Unset, int]: + def _parse_user_id(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) user_id = _parse_user_id(d.pop("user_id", UNSET)) - def _parse_details(data: object) -> Union[None, Unset, str]: + def _parse_details(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) details = _parse_details(d.pop("details", UNSET)) _user = d.pop("user", UNSET) - user: Union[Unset, AlertEventUser] + user: Unset | AlertEventUser if isinstance(_user, Unset): user = UNSET else: @@ -257,21 +257,21 @@ def _parse_schedule(data: object) -> Union["AlertEventScheduleType0", None, Unse schedule = _parse_schedule(d.pop("schedule", UNSET)) - def _parse_escalation_level(data: object) -> Union[None, Unset, int]: + def _parse_escalation_level(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) escalation_level = _parse_escalation_level(d.pop("escalation_level", UNSET)) - def _parse_escalation_target_type(data: object) -> Union[None, Unset, str]: + def _parse_escalation_target_type(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) escalation_target_type = _parse_escalation_target_type(d.pop("escalation_target_type", UNSET)) @@ -293,13 +293,13 @@ def _parse_escalation_target(data: object) -> Union["AlertEventEscalationTargetT escalation_target = _parse_escalation_target(d.pop("escalation_target", UNSET)) _slack_channel = d.pop("slack_channel", UNSET) - slack_channel: Union[Unset, SlackChannel] + slack_channel: Unset | SlackChannel if isinstance(_slack_channel, Unset): slack_channel = UNSET else: slack_channel = SlackChannel.from_dict(_slack_channel) - def _parse_incident_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_incident_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -312,7 +312,7 @@ def _parse_incident_ids(data: object) -> Union[None, Unset, list[str]]: return incident_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) incident_ids = _parse_incident_ids(d.pop("incident_ids", UNSET)) diff --git a/rootly_sdk/models/alert_event_escalation_target_type_0.py b/rootly_sdk/models/alert_event_escalation_target_type_0.py index 5cff5b9b..d6c59111 100644 --- a/rootly_sdk/models/alert_event_escalation_target_type_0.py +++ b/rootly_sdk/models/alert_event_escalation_target_type_0.py @@ -25,7 +25,7 @@ class AlertEventEscalationTargetType0: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data: Union[Unset, dict[str, Any]] = UNSET + data: Unset | dict[str, Any] = UNSET if not isinstance(self.data, Unset): data = self.data.to_dict() @@ -43,7 +43,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _data = d.pop("data", UNSET) - data: Union[Unset, AlertEventEscalationTargetType0Data] + data: Unset | AlertEventEscalationTargetType0Data if isinstance(_data, Unset): data = UNSET else: diff --git a/rootly_sdk/models/alert_event_escalation_target_type_0_data.py b/rootly_sdk/models/alert_event_escalation_target_type_0_data.py index 562a35c8..75d6a66f 100644 --- a/rootly_sdk/models/alert_event_escalation_target_type_0_data.py +++ b/rootly_sdk/models/alert_event_escalation_target_type_0_data.py @@ -24,8 +24,8 @@ class AlertEventEscalationTargetType0Data: attributes (Union[Unset, AlertEventEscalationTargetType0DataAttributes]): """ - id: Union[Unset, str] = UNSET - type_: Union[Unset, str] = UNSET + id: Unset | str = UNSET + type_: Unset | str = UNSET attributes: Union[Unset, "AlertEventEscalationTargetType0DataAttributes"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -34,7 +34,7 @@ def to_dict(self) -> dict[str, Any]: type_ = self.type_ - attributes: Union[Unset, dict[str, Any]] = UNSET + attributes: Unset | dict[str, Any] = UNSET if not isinstance(self.attributes, Unset): attributes = self.attributes.to_dict() @@ -62,7 +62,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: type_ = d.pop("type", UNSET) _attributes = d.pop("attributes", UNSET) - attributes: Union[Unset, AlertEventEscalationTargetType0DataAttributes] + attributes: Unset | AlertEventEscalationTargetType0DataAttributes if isinstance(_attributes, Unset): attributes = UNSET else: diff --git a/rootly_sdk/models/alert_event_feed_list.py b/rootly_sdk/models/alert_event_feed_list.py index 9ecde4c6..726b2d24 100644 --- a/rootly_sdk/models/alert_event_feed_list.py +++ b/rootly_sdk/models/alert_event_feed_list.py @@ -30,7 +30,7 @@ class AlertEventFeedList: data: list["AlertEventFeedListDataItem"] meta: "AlertEventFeedMeta" links: Union[Unset, "Links"] = UNSET - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -41,11 +41,11 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - links: Union[Unset, dict[str, Any]] = UNSET + links: Unset | dict[str, Any] = UNSET if not isinstance(self.links, Unset): links = self.links.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,7 +85,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: meta = AlertEventFeedMeta.from_dict(d.pop("meta")) _links = d.pop("links", UNSET) - links: Union[Unset, Links] + links: Unset | Links if isinstance(_links, Unset): links = UNSET else: diff --git a/rootly_sdk/models/alert_event_feed_meta.py b/rootly_sdk/models/alert_event_feed_meta.py index 871a38db..9c99a935 100644 --- a/rootly_sdk/models/alert_event_feed_meta.py +++ b/rootly_sdk/models/alert_event_feed_meta.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,43 +22,43 @@ class AlertEventFeedMeta: total_pages (Union[None, Unset, int]): """ - next_cursor: Union[None, str] - current_page: Union[None, Unset, int] = UNSET - next_page: Union[None, Unset, int] = UNSET - prev_page: Union[None, Unset, int] = UNSET - total_count: Union[None, Unset, int] = UNSET - total_pages: Union[None, Unset, int] = UNSET + next_cursor: None | str + current_page: None | Unset | int = UNSET + next_page: None | Unset | int = UNSET + prev_page: None | Unset | int = UNSET + total_count: None | Unset | int = UNSET + total_pages: None | Unset | int = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - next_cursor: Union[None, str] + next_cursor: None | str next_cursor = self.next_cursor - current_page: Union[None, Unset, int] + current_page: None | Unset | int if isinstance(self.current_page, Unset): current_page = UNSET else: current_page = self.current_page - next_page: Union[None, Unset, int] + next_page: None | Unset | int if isinstance(self.next_page, Unset): next_page = UNSET else: next_page = self.next_page - prev_page: Union[None, Unset, int] + prev_page: None | Unset | int if isinstance(self.prev_page, Unset): prev_page = UNSET else: prev_page = self.prev_page - total_count: Union[None, Unset, int] + total_count: None | Unset | int if isinstance(self.total_count, Unset): total_count = UNSET else: total_count = self.total_count - total_pages: Union[None, Unset, int] + total_pages: None | Unset | int if isinstance(self.total_pages, Unset): total_pages = UNSET else: @@ -88,55 +88,55 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_next_cursor(data: object) -> Union[None, str]: + def _parse_next_cursor(data: object) -> None | str: if data is None: return data - return cast(Union[None, str], data) + return cast(None | str, data) next_cursor = _parse_next_cursor(d.pop("next_cursor")) - def _parse_current_page(data: object) -> Union[None, Unset, int]: + def _parse_current_page(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) current_page = _parse_current_page(d.pop("current_page", UNSET)) - def _parse_next_page(data: object) -> Union[None, Unset, int]: + def _parse_next_page(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) next_page = _parse_next_page(d.pop("next_page", UNSET)) - def _parse_prev_page(data: object) -> Union[None, Unset, int]: + def _parse_prev_page(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) prev_page = _parse_prev_page(d.pop("prev_page", UNSET)) - def _parse_total_count(data: object) -> Union[None, Unset, int]: + def _parse_total_count(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) total_count = _parse_total_count(d.pop("total_count", UNSET)) - def _parse_total_pages(data: object) -> Union[None, Unset, int]: + def _parse_total_pages(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) total_pages = _parse_total_pages(d.pop("total_pages", UNSET)) diff --git a/rootly_sdk/models/alert_event_incident_type_0.py b/rootly_sdk/models/alert_event_incident_type_0.py index 2bb19750..13c40982 100644 --- a/rootly_sdk/models/alert_event_incident_type_0.py +++ b/rootly_sdk/models/alert_event_incident_type_0.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -28,25 +28,25 @@ class AlertEventIncidentType0: updated_at (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - sequential_id: Union[None, Unset, int] = UNSET - title: Union[Unset, str] = UNSET - slug: Union[Unset, str] = UNSET - kind: Union[Unset, str] = UNSET - status: Union[Unset, str] = UNSET - private: Union[Unset, bool] = UNSET - description: Union[None, Unset, str] = UNSET - started_at: Union[None, Unset, str] = UNSET - duration: Union[None, Unset, int] = UNSET - url: Union[Unset, str] = UNSET - created_at: Union[Unset, str] = UNSET - updated_at: Union[Unset, str] = UNSET + id: Unset | str = UNSET + sequential_id: None | Unset | int = UNSET + title: Unset | str = UNSET + slug: Unset | str = UNSET + kind: Unset | str = UNSET + status: Unset | str = UNSET + private: Unset | bool = UNSET + description: None | Unset | str = UNSET + started_at: None | Unset | str = UNSET + duration: None | Unset | int = UNSET + url: Unset | str = UNSET + created_at: Unset | str = UNSET + updated_at: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: id = self.id - sequential_id: Union[None, Unset, int] + sequential_id: None | Unset | int if isinstance(self.sequential_id, Unset): sequential_id = UNSET else: @@ -62,19 +62,19 @@ def to_dict(self) -> dict[str, Any]: private = self.private - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - started_at: Union[None, Unset, str] + started_at: None | Unset | str if isinstance(self.started_at, Unset): started_at = UNSET else: started_at = self.started_at - duration: Union[None, Unset, int] + duration: None | Unset | int if isinstance(self.duration, Unset): duration = UNSET else: @@ -123,12 +123,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) id = d.pop("id", UNSET) - def _parse_sequential_id(data: object) -> Union[None, Unset, int]: + def _parse_sequential_id(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) sequential_id = _parse_sequential_id(d.pop("sequential_id", UNSET)) @@ -142,30 +142,30 @@ def _parse_sequential_id(data: object) -> Union[None, Unset, int]: private = d.pop("private", UNSET) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_started_at(data: object) -> Union[None, Unset, str]: + def _parse_started_at(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) started_at = _parse_started_at(d.pop("started_at", UNSET)) - def _parse_duration(data: object) -> Union[None, Unset, int]: + def _parse_duration(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) duration = _parse_duration(d.pop("duration", UNSET)) diff --git a/rootly_sdk/models/alert_event_list.py b/rootly_sdk/models/alert_event_list.py index 4570a8ec..db503596 100644 --- a/rootly_sdk/models/alert_event_list.py +++ b/rootly_sdk/models/alert_event_list.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,7 +29,7 @@ class AlertEventList: data: list["AlertEventListDataItem"] links: "Links" meta: "Meta" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/alert_event_response.py b/rootly_sdk/models/alert_event_response.py index a50f0426..c929be5d 100644 --- a/rootly_sdk/models/alert_event_response.py +++ b/rootly_sdk/models/alert_event_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,13 +23,13 @@ class AlertEventResponse: """ data: "AlertEventResponseData" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/alert_event_schedule_type_0.py b/rootly_sdk/models/alert_event_schedule_type_0.py index a65b967e..d18aab86 100644 --- a/rootly_sdk/models/alert_event_schedule_type_0.py +++ b/rootly_sdk/models/alert_event_schedule_type_0.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -27,12 +27,12 @@ class AlertEventScheduleType0: updated_at (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET - description: Union[None, Unset, str] = UNSET - escalation_policies: Union[Unset, list["AlertEventScheduleType0EscalationPoliciesItem"]] = UNSET - created_at: Union[Unset, str] = UNSET - updated_at: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET + description: None | Unset | str = UNSET + escalation_policies: Unset | list["AlertEventScheduleType0EscalationPoliciesItem"] = UNSET + created_at: Unset | str = UNSET + updated_at: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -40,13 +40,13 @@ def to_dict(self) -> dict[str, Any]: name = self.name - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - escalation_policies: Union[Unset, list[dict[str, Any]]] = UNSET + escalation_policies: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.escalation_policies, Unset): escalation_policies = [] for escalation_policies_item_data in self.escalation_policies: @@ -86,12 +86,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name = d.pop("name", UNSET) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) diff --git a/rootly_sdk/models/alert_event_schedule_type_0_escalation_policies_item.py b/rootly_sdk/models/alert_event_schedule_type_0_escalation_policies_item.py index 7a3b3551..aea276ce 100644 --- a/rootly_sdk/models/alert_event_schedule_type_0_escalation_policies_item.py +++ b/rootly_sdk/models/alert_event_schedule_type_0_escalation_policies_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,10 +19,10 @@ class AlertEventScheduleType0EscalationPoliciesItem: updated_at (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET - created_at: Union[Unset, str] = UNSET - updated_at: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET + created_at: Unset | str = UNSET + updated_at: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/alert_event_user.py b/rootly_sdk/models/alert_event_user.py index 2ccae8c8..961ceb22 100644 --- a/rootly_sdk/models/alert_event_user.py +++ b/rootly_sdk/models/alert_event_user.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -30,11 +30,11 @@ class AlertEventUser: email: str created_at: str updated_at: str - first_name: Union[None, Unset, str] = UNSET - last_name: Union[None, Unset, str] = UNSET - preferred_name: Union[None, Unset, str] = UNSET - full_name: Union[None, Unset, str] = UNSET - time_zone: Union[None, Unset, str] = UNSET + first_name: None | Unset | str = UNSET + last_name: None | Unset | str = UNSET + preferred_name: None | Unset | str = UNSET + full_name: None | Unset | str = UNSET + time_zone: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -48,31 +48,31 @@ def to_dict(self) -> dict[str, Any]: updated_at = self.updated_at - first_name: Union[None, Unset, str] + first_name: None | Unset | str if isinstance(self.first_name, Unset): first_name = UNSET else: first_name = self.first_name - last_name: Union[None, Unset, str] + last_name: None | Unset | str if isinstance(self.last_name, Unset): last_name = UNSET else: last_name = self.last_name - preferred_name: Union[None, Unset, str] + preferred_name: None | Unset | str if isinstance(self.preferred_name, Unset): preferred_name = UNSET else: preferred_name = self.preferred_name - full_name: Union[None, Unset, str] + full_name: None | Unset | str if isinstance(self.full_name, Unset): full_name = UNSET else: full_name = self.full_name - time_zone: Union[None, Unset, str] + time_zone: None | Unset | str if isinstance(self.time_zone, Unset): time_zone = UNSET else: @@ -115,48 +115,48 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: updated_at = d.pop("updated_at") - def _parse_first_name(data: object) -> Union[None, Unset, str]: + def _parse_first_name(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) first_name = _parse_first_name(d.pop("first_name", UNSET)) - def _parse_last_name(data: object) -> Union[None, Unset, str]: + def _parse_last_name(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) last_name = _parse_last_name(d.pop("last_name", UNSET)) - def _parse_preferred_name(data: object) -> Union[None, Unset, str]: + def _parse_preferred_name(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) preferred_name = _parse_preferred_name(d.pop("preferred_name", UNSET)) - def _parse_full_name(data: object) -> Union[None, Unset, str]: + def _parse_full_name(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) full_name = _parse_full_name(d.pop("full_name", UNSET)) - def _parse_time_zone(data: object) -> Union[None, Unset, str]: + def _parse_time_zone(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) time_zone = _parse_time_zone(d.pop("time_zone", UNSET)) diff --git a/rootly_sdk/models/alert_field.py b/rootly_sdk/models/alert_field.py index ed5413df..1796e3d9 100644 --- a/rootly_sdk/models/alert_field.py +++ b/rootly_sdk/models/alert_field.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -24,7 +24,7 @@ class AlertField: kind: str created_at: str updated_at: str - slug: Union[Unset, str] = UNSET + slug: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/alert_field_list.py b/rootly_sdk/models/alert_field_list.py index 9bdbf254..d0fb658d 100644 --- a/rootly_sdk/models/alert_field_list.py +++ b/rootly_sdk/models/alert_field_list.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,7 +29,7 @@ class AlertFieldList: data: list["AlertFieldListDataItem"] links: "Links" meta: "Meta" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/alert_field_response.py b/rootly_sdk/models/alert_field_response.py index 19183d6c..e6197c98 100644 --- a/rootly_sdk/models/alert_field_response.py +++ b/rootly_sdk/models/alert_field_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,13 +23,13 @@ class AlertFieldResponse: """ data: "AlertFieldResponseData" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/alert_field_response_data.py b/rootly_sdk/models/alert_field_response_data.py index b8e455db..45c54724 100644 --- a/rootly_sdk/models/alert_field_response_data.py +++ b/rootly_sdk/models/alert_field_response_data.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -25,7 +25,7 @@ class AlertFieldResponseData: type_: AlertFieldResponseDataType attributes: "AlertField" - id: Union[Unset, str] = UNSET + id: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/alert_group.py b/rootly_sdk/models/alert_group.py index 4aac20b1..f9913184 100644 --- a/rootly_sdk/models/alert_group.py +++ b/rootly_sdk/models/alert_group.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -38,24 +38,24 @@ class AlertGroup: """ name: str - description: Union[None, str] + description: None | str condition_type: str time_window: int created_at: str updated_at: str - deleted_at: Union[None, str] - slug: Union[Unset, str] = UNSET - group_by_alert_title: Union[Unset, bool] = UNSET - group_by_alert_urgency: Union[Unset, bool] = UNSET - targets: Union[Unset, list["AlertGroupTargetsItem"]] = UNSET - attributes: Union[Unset, list["AlertGroupAttributesItem"]] = UNSET - conditions: Union[Unset, list["AlertGroupConditionsItem"]] = UNSET + deleted_at: None | str + slug: Unset | str = UNSET + group_by_alert_title: Unset | bool = UNSET + group_by_alert_urgency: Unset | bool = UNSET + targets: Unset | list["AlertGroupTargetsItem"] = UNSET + attributes: Unset | list["AlertGroupAttributesItem"] = UNSET + conditions: Unset | list["AlertGroupConditionsItem"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: name = self.name - description: Union[None, str] + description: None | str description = self.description condition_type = self.condition_type @@ -66,7 +66,7 @@ def to_dict(self) -> dict[str, Any]: updated_at = self.updated_at - deleted_at: Union[None, str] + deleted_at: None | str deleted_at = self.deleted_at slug = self.slug @@ -75,21 +75,21 @@ def to_dict(self) -> dict[str, Any]: group_by_alert_urgency = self.group_by_alert_urgency - targets: Union[Unset, list[dict[str, Any]]] = UNSET + targets: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.targets, Unset): targets = [] for targets_item_data in self.targets: targets_item = targets_item_data.to_dict() targets.append(targets_item) - attributes: Union[Unset, list[dict[str, Any]]] = UNSET + attributes: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.attributes, Unset): attributes = [] for attributes_item_data in self.attributes: attributes_item = attributes_item_data.to_dict() attributes.append(attributes_item) - conditions: Union[Unset, list[dict[str, Any]]] = UNSET + conditions: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.conditions, Unset): conditions = [] for conditions_item_data in self.conditions: @@ -133,10 +133,10 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name") - def _parse_description(data: object) -> Union[None, str]: + def _parse_description(data: object) -> None | str: if data is None: return data - return cast(Union[None, str], data) + return cast(None | str, data) description = _parse_description(d.pop("description")) @@ -148,10 +148,10 @@ def _parse_description(data: object) -> Union[None, str]: updated_at = d.pop("updated_at") - def _parse_deleted_at(data: object) -> Union[None, str]: + def _parse_deleted_at(data: object) -> None | str: if data is None: return data - return cast(Union[None, str], data) + return cast(None | str, data) deleted_at = _parse_deleted_at(d.pop("deleted_at")) diff --git a/rootly_sdk/models/alert_group_attributes_item.py b/rootly_sdk/models/alert_group_attributes_item.py index 5a12e82e..120ba12a 100644 --- a/rootly_sdk/models/alert_group_attributes_item.py +++ b/rootly_sdk/models/alert_group_attributes_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,7 +16,7 @@ class AlertGroupAttributesItem: json_path (Union[Unset, str]): The JSON path to the value to group by. """ - json_path: Union[Unset, str] = UNSET + json_path: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/alert_group_conditions_item.py b/rootly_sdk/models/alert_group_conditions_item.py index 09ffad5a..c521f354 100644 --- a/rootly_sdk/models/alert_group_conditions_item.py +++ b/rootly_sdk/models/alert_group_conditions_item.py @@ -51,13 +51,13 @@ class AlertGroupConditionsItem: property_field_type: AlertGroupConditionsItemPropertyFieldType property_field_condition_type: AlertGroupConditionsItemPropertyFieldConditionType - property_field_name: Union[None, Unset, str] = UNSET - property_field_value: Union[None, Unset, str] = UNSET - property_field_values: Union[Unset, list[str]] = UNSET - values: Union[Unset, list[Union["AlertGroupConditionsItemValuesItemType0", None]]] = UNSET - alert_urgency_ids: Union[None, Unset, list[str]] = UNSET - conditionable_type: Union[Unset, AlertGroupConditionsItemConditionableType] = UNSET - conditionable_id: Union[None, Unset, str] = UNSET + property_field_name: None | Unset | str = UNSET + property_field_value: None | Unset | str = UNSET + property_field_values: Unset | list[str] = UNSET + values: Unset | list[Union["AlertGroupConditionsItemValuesItemType0", None]] = UNSET + alert_urgency_ids: None | Unset | list[str] = UNSET + conditionable_type: Unset | AlertGroupConditionsItemConditionableType = UNSET + conditionable_id: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -67,34 +67,34 @@ def to_dict(self) -> dict[str, Any]: property_field_condition_type: str = self.property_field_condition_type - property_field_name: Union[None, Unset, str] + property_field_name: None | Unset | str if isinstance(self.property_field_name, Unset): property_field_name = UNSET else: property_field_name = self.property_field_name - property_field_value: Union[None, Unset, str] + property_field_value: None | Unset | str if isinstance(self.property_field_value, Unset): property_field_value = UNSET else: property_field_value = self.property_field_value - property_field_values: Union[Unset, list[str]] = UNSET + property_field_values: Unset | list[str] = UNSET if not isinstance(self.property_field_values, Unset): property_field_values = self.property_field_values - values: Union[Unset, list[Union[None, dict[str, Any]]]] = UNSET + values: Unset | list[None | dict[str, Any]] = UNSET if not isinstance(self.values, Unset): values = [] for values_item_data in self.values: - values_item: Union[None, dict[str, Any]] + values_item: None | dict[str, Any] if isinstance(values_item_data, AlertGroupConditionsItemValuesItemType0): values_item = values_item_data.to_dict() else: values_item = values_item_data values.append(values_item) - alert_urgency_ids: Union[None, Unset, list[str]] + alert_urgency_ids: None | Unset | list[str] if isinstance(self.alert_urgency_ids, Unset): alert_urgency_ids = UNSET elif isinstance(self.alert_urgency_ids, list): @@ -103,11 +103,11 @@ def to_dict(self) -> dict[str, Any]: else: alert_urgency_ids = self.alert_urgency_ids - conditionable_type: Union[Unset, str] = UNSET + conditionable_type: Unset | str = UNSET if not isinstance(self.conditionable_type, Unset): conditionable_type = self.conditionable_type - conditionable_id: Union[None, Unset, str] + conditionable_id: None | Unset | str if isinstance(self.conditionable_id, Unset): conditionable_id = UNSET else: @@ -149,21 +149,21 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d.pop("property_field_condition_type") ) - def _parse_property_field_name(data: object) -> Union[None, Unset, str]: + def _parse_property_field_name(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) property_field_name = _parse_property_field_name(d.pop("property_field_name", UNSET)) - def _parse_property_field_value(data: object) -> Union[None, Unset, str]: + def _parse_property_field_value(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) property_field_value = _parse_property_field_value(d.pop("property_field_value", UNSET)) @@ -190,7 +190,7 @@ def _parse_values_item(data: object) -> Union["AlertGroupConditionsItemValuesIte values.append(values_item) - def _parse_alert_urgency_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_alert_urgency_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -203,23 +203,23 @@ def _parse_alert_urgency_ids(data: object) -> Union[None, Unset, list[str]]: return alert_urgency_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) alert_urgency_ids = _parse_alert_urgency_ids(d.pop("alert_urgency_ids", UNSET)) _conditionable_type = d.pop("conditionable_type", UNSET) - conditionable_type: Union[Unset, AlertGroupConditionsItemConditionableType] + conditionable_type: Unset | AlertGroupConditionsItemConditionableType if isinstance(_conditionable_type, Unset): conditionable_type = UNSET else: conditionable_type = check_alert_group_conditions_item_conditionable_type(_conditionable_type) - def _parse_conditionable_id(data: object) -> Union[None, Unset, str]: + def _parse_conditionable_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) conditionable_id = _parse_conditionable_id(d.pop("conditionable_id", UNSET)) diff --git a/rootly_sdk/models/alert_group_list.py b/rootly_sdk/models/alert_group_list.py index 666271b7..311a2215 100644 --- a/rootly_sdk/models/alert_group_list.py +++ b/rootly_sdk/models/alert_group_list.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,7 +23,7 @@ class AlertGroupList: """ data: list["AlertGroupListDataItem"] - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -32,7 +32,7 @@ def to_dict(self) -> dict[str, Any]: data_item = data_item_data.to_dict() data.append(data_item) - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/alert_group_response.py b/rootly_sdk/models/alert_group_response.py index 052d2fe5..5977b2ad 100644 --- a/rootly_sdk/models/alert_group_response.py +++ b/rootly_sdk/models/alert_group_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,13 +23,13 @@ class AlertGroupResponse: """ data: "AlertGroupResponseData" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/alert_labels_item_type_0.py b/rootly_sdk/models/alert_labels_item_type_0.py index 5c38de65..cf7bf716 100644 --- a/rootly_sdk/models/alert_labels_item_type_0.py +++ b/rootly_sdk/models/alert_labels_item_type_0.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,13 +16,13 @@ class AlertLabelsItemType0: """ key: str - value: Union[bool, float, str] + value: bool | float | str additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: key = self.key - value: Union[bool, float, str] + value: bool | float | str value = self.value field_dict: dict[str, Any] = {} @@ -41,8 +41,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) key = d.pop("key") - def _parse_value(data: object) -> Union[bool, float, str]: - return cast(Union[bool, float, str], data) + def _parse_value(data: object) -> bool | float | str: + return cast(bool | float | str, data) value = _parse_value(d.pop("value")) diff --git a/rootly_sdk/models/alert_list.py b/rootly_sdk/models/alert_list.py index e1fb545e..504318ac 100644 --- a/rootly_sdk/models/alert_list.py +++ b/rootly_sdk/models/alert_list.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,7 +29,7 @@ class AlertList: data: list["AlertListDataItem"] links: "Links" meta: "Meta" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/alert_list_data_item.py b/rootly_sdk/models/alert_list_data_item.py index ad55285d..9cdca68b 100644 --- a/rootly_sdk/models/alert_list_data_item.py +++ b/rootly_sdk/models/alert_list_data_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -27,7 +27,7 @@ class AlertListDataItem: id: str type_: AlertListDataItemType attributes: "Alert" - source: Union[Unset, str] = UNSET + source: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/alert_response.py b/rootly_sdk/models/alert_response.py index 1b7500b5..3dec4951 100644 --- a/rootly_sdk/models/alert_response.py +++ b/rootly_sdk/models/alert_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,13 +23,13 @@ class AlertResponse: """ data: "AlertResponseData" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/alert_response_data.py b/rootly_sdk/models/alert_response_data.py index 2f8d1f1f..c0eb05a2 100644 --- a/rootly_sdk/models/alert_response_data.py +++ b/rootly_sdk/models/alert_response_data.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -27,7 +27,7 @@ class AlertResponseData: id: str type_: AlertResponseDataType attributes: "Alert" - source: Union[Unset, str] = UNSET + source: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/alert_retrigger_rule.py b/rootly_sdk/models/alert_retrigger_rule.py index 7eee14c3..eea8cf77 100644 --- a/rootly_sdk/models/alert_retrigger_rule.py +++ b/rootly_sdk/models/alert_retrigger_rule.py @@ -1,6 +1,6 @@ import datetime from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -30,23 +30,23 @@ class AlertRetriggerRule: updated_at (Union[Unset, datetime.datetime]): """ - name: Union[Unset, str] = UNSET - match_mode: Union[Unset, AlertRetriggerRuleMatchMode] = UNSET - timeout_minutes: Union[None, Unset, int] = UNSET - position: Union[Unset, int] = UNSET - conditions: Union[Unset, list["AlertRetriggerRuleConditionsItem"]] = UNSET - created_at: Union[Unset, datetime.datetime] = UNSET - updated_at: Union[Unset, datetime.datetime] = UNSET + name: Unset | str = UNSET + match_mode: Unset | AlertRetriggerRuleMatchMode = UNSET + timeout_minutes: None | Unset | int = UNSET + position: Unset | int = UNSET + conditions: Unset | list["AlertRetriggerRuleConditionsItem"] = UNSET + created_at: Unset | datetime.datetime = UNSET + updated_at: Unset | datetime.datetime = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: name = self.name - match_mode: Union[Unset, str] = UNSET + match_mode: Unset | str = UNSET if not isinstance(self.match_mode, Unset): match_mode = self.match_mode - timeout_minutes: Union[None, Unset, int] + timeout_minutes: None | Unset | int if isinstance(self.timeout_minutes, Unset): timeout_minutes = UNSET else: @@ -54,18 +54,18 @@ def to_dict(self) -> dict[str, Any]: position = self.position - conditions: Union[Unset, list[dict[str, Any]]] = UNSET + conditions: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.conditions, Unset): conditions = [] for conditions_item_data in self.conditions: conditions_item = conditions_item_data.to_dict() conditions.append(conditions_item) - created_at: Union[Unset, str] = UNSET + created_at: Unset | str = UNSET if not isinstance(self.created_at, Unset): created_at = self.created_at.isoformat() - updated_at: Union[Unset, str] = UNSET + updated_at: Unset | str = UNSET if not isinstance(self.updated_at, Unset): updated_at = self.updated_at.isoformat() @@ -97,18 +97,18 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name = d.pop("name", UNSET) _match_mode = d.pop("match_mode", UNSET) - match_mode: Union[Unset, AlertRetriggerRuleMatchMode] + match_mode: Unset | AlertRetriggerRuleMatchMode if isinstance(_match_mode, Unset): match_mode = UNSET else: match_mode = check_alert_retrigger_rule_match_mode(_match_mode) - def _parse_timeout_minutes(data: object) -> Union[None, Unset, int]: + def _parse_timeout_minutes(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) timeout_minutes = _parse_timeout_minutes(d.pop("timeout_minutes", UNSET)) @@ -122,14 +122,14 @@ def _parse_timeout_minutes(data: object) -> Union[None, Unset, int]: conditions.append(conditions_item) _created_at = d.pop("created_at", UNSET) - created_at: Union[Unset, datetime.datetime] + created_at: Unset | datetime.datetime if isinstance(_created_at, Unset): created_at = UNSET else: created_at = isoparse(_created_at) _updated_at = d.pop("updated_at", UNSET) - updated_at: Union[Unset, datetime.datetime] + updated_at: Unset | datetime.datetime if isinstance(_updated_at, Unset): updated_at = UNSET else: diff --git a/rootly_sdk/models/alert_retrigger_rule_conditions_item.py b/rootly_sdk/models/alert_retrigger_rule_conditions_item.py index f4561edd..9a0ba8cf 100644 --- a/rootly_sdk/models/alert_retrigger_rule_conditions_item.py +++ b/rootly_sdk/models/alert_retrigger_rule_conditions_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from uuid import UUID from attrs import define as _attrs_define @@ -38,9 +38,9 @@ class AlertRetriggerRuleConditionsItem: id: UUID kind: AlertRetriggerRuleConditionsItemKind operator: AlertRetriggerRuleConditionsItemOperator - record_ids: Union[Unset, list[UUID]] = UNSET - values: Union[Unset, list[str]] = UNSET - property_field_name: Union[Unset, str] = UNSET + record_ids: Unset | list[UUID] = UNSET + values: Unset | list[str] = UNSET + property_field_name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -50,14 +50,14 @@ def to_dict(self) -> dict[str, Any]: operator: str = self.operator - record_ids: Union[Unset, list[str]] = UNSET + record_ids: Unset | list[str] = UNSET if not isinstance(self.record_ids, Unset): record_ids = [] for record_ids_item_data in self.record_ids: record_ids_item = str(record_ids_item_data) record_ids.append(record_ids_item) - values: Union[Unset, list[str]] = UNSET + values: Unset | list[str] = UNSET if not isinstance(self.values, Unset): values = self.values diff --git a/rootly_sdk/models/alert_retrigger_rule_list.py b/rootly_sdk/models/alert_retrigger_rule_list.py index df1c8a23..e1137b96 100644 --- a/rootly_sdk/models/alert_retrigger_rule_list.py +++ b/rootly_sdk/models/alert_retrigger_rule_list.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,7 +29,7 @@ class AlertRetriggerRuleList: data: list["AlertRetriggerRuleListDataItem"] links: "Links" meta: "Meta" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/alert_retrigger_rule_response.py b/rootly_sdk/models/alert_retrigger_rule_response.py index b9f5cb52..78cd47eb 100644 --- a/rootly_sdk/models/alert_retrigger_rule_response.py +++ b/rootly_sdk/models/alert_retrigger_rule_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,13 +23,13 @@ class AlertRetriggerRuleResponse: """ data: "AlertRetriggerRuleResponseData" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/alert_route.py b/rootly_sdk/models/alert_route.py index 1b8ffc5d..d8f701e4 100644 --- a/rootly_sdk/models/alert_route.py +++ b/rootly_sdk/models/alert_route.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from uuid import UUID from attrs import define as _attrs_define @@ -27,9 +27,9 @@ class AlertRoute: name: str alerts_source_ids: list[UUID] - enabled: Union[Unset, bool] = UNSET - owning_team_ids: Union[Unset, list[UUID]] = UNSET - rules: Union[Unset, list["AlertRouteRulesItem"]] = UNSET + enabled: Unset | bool = UNSET + owning_team_ids: Unset | list[UUID] = UNSET + rules: Unset | list["AlertRouteRulesItem"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,14 +42,14 @@ def to_dict(self) -> dict[str, Any]: enabled = self.enabled - owning_team_ids: Union[Unset, list[str]] = UNSET + owning_team_ids: Unset | list[str] = UNSET if not isinstance(self.owning_team_ids, Unset): owning_team_ids = [] for owning_team_ids_item_data in self.owning_team_ids: owning_team_ids_item = str(owning_team_ids_item_data) owning_team_ids.append(owning_team_ids_item) - rules: Union[Unset, list[dict[str, Any]]] = UNSET + rules: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.rules, Unset): rules = [] for rules_item_data in self.rules: diff --git a/rootly_sdk/models/alert_route_rules_item.py b/rootly_sdk/models/alert_route_rules_item.py index 64a3cb20..697ee425 100644 --- a/rootly_sdk/models/alert_route_rules_item.py +++ b/rootly_sdk/models/alert_route_rules_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -28,8 +28,8 @@ class AlertRouteRulesItem: name: str destinations: list["AlertRouteRulesItemDestinationsItem"] condition_groups: list["AlertRouteRulesItemConditionGroupsItem"] - position: Union[Unset, int] = UNSET - fallback_rule: Union[Unset, bool] = False + position: Unset | int = UNSET + fallback_rule: Unset | bool = False additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/alert_route_rules_item_condition_groups_item.py b/rootly_sdk/models/alert_route_rules_item_condition_groups_item.py index 294a000e..94f139fc 100644 --- a/rootly_sdk/models/alert_route_rules_item_condition_groups_item.py +++ b/rootly_sdk/models/alert_route_rules_item_condition_groups_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -24,7 +24,7 @@ class AlertRouteRulesItemConditionGroupsItem: """ conditions: list["AlertRouteRulesItemConditionGroupsItemConditionsItem"] - position: Union[Unset, int] = UNSET + position: Unset | int = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/alert_route_rules_item_condition_groups_item_conditions_item.py b/rootly_sdk/models/alert_route_rules_item_condition_groups_item_conditions_item.py index 762078a4..91f1fba8 100644 --- a/rootly_sdk/models/alert_route_rules_item_condition_groups_item_conditions_item.py +++ b/rootly_sdk/models/alert_route_rules_item_condition_groups_item_conditions_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from uuid import UUID from attrs import define as _attrs_define @@ -39,12 +39,12 @@ class AlertRouteRulesItemConditionGroupsItemConditionsItem: property_field_condition_type: AlertRouteRulesItemConditionGroupsItemConditionsItemPropertyFieldConditionType property_field_type: AlertRouteRulesItemConditionGroupsItemConditionsItemPropertyFieldType - property_field_name: Union[Unset, str] = UNSET - property_field_value: Union[None, Unset, str] = UNSET - property_field_values: Union[None, Unset, list[str]] = UNSET - alert_urgency_ids: Union[None, Unset, list[str]] = UNSET - conditionable_type: Union[Unset, AlertRouteRulesItemConditionGroupsItemConditionsItemConditionableType] = UNSET - conditionable_id: Union[None, UUID, Unset] = UNSET + property_field_name: Unset | str = UNSET + property_field_value: None | Unset | str = UNSET + property_field_values: None | Unset | list[str] = UNSET + alert_urgency_ids: None | Unset | list[str] = UNSET + conditionable_type: Unset | AlertRouteRulesItemConditionGroupsItemConditionsItemConditionableType = UNSET + conditionable_id: None | UUID | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -54,13 +54,13 @@ def to_dict(self) -> dict[str, Any]: property_field_name = self.property_field_name - property_field_value: Union[None, Unset, str] + property_field_value: None | Unset | str if isinstance(self.property_field_value, Unset): property_field_value = UNSET else: property_field_value = self.property_field_value - property_field_values: Union[None, Unset, list[str]] + property_field_values: None | Unset | list[str] if isinstance(self.property_field_values, Unset): property_field_values = UNSET elif isinstance(self.property_field_values, list): @@ -69,7 +69,7 @@ def to_dict(self) -> dict[str, Any]: else: property_field_values = self.property_field_values - alert_urgency_ids: Union[None, Unset, list[str]] + alert_urgency_ids: None | Unset | list[str] if isinstance(self.alert_urgency_ids, Unset): alert_urgency_ids = UNSET elif isinstance(self.alert_urgency_ids, list): @@ -78,11 +78,11 @@ def to_dict(self) -> dict[str, Any]: else: alert_urgency_ids = self.alert_urgency_ids - conditionable_type: Union[Unset, str] = UNSET + conditionable_type: Unset | str = UNSET if not isinstance(self.conditionable_type, Unset): conditionable_type = self.conditionable_type - conditionable_id: Union[None, Unset, str] + conditionable_id: None | Unset | str if isinstance(self.conditionable_id, Unset): conditionable_id = UNSET elif isinstance(self.conditionable_id, UUID): @@ -128,16 +128,16 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: property_field_name = d.pop("property_field_name", UNSET) - def _parse_property_field_value(data: object) -> Union[None, Unset, str]: + def _parse_property_field_value(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) property_field_value = _parse_property_field_value(d.pop("property_field_value", UNSET)) - def _parse_property_field_values(data: object) -> Union[None, Unset, list[str]]: + def _parse_property_field_values(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -150,11 +150,11 @@ def _parse_property_field_values(data: object) -> Union[None, Unset, list[str]]: return property_field_values_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) property_field_values = _parse_property_field_values(d.pop("property_field_values", UNSET)) - def _parse_alert_urgency_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_alert_urgency_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -167,12 +167,12 @@ def _parse_alert_urgency_ids(data: object) -> Union[None, Unset, list[str]]: return alert_urgency_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) alert_urgency_ids = _parse_alert_urgency_ids(d.pop("alert_urgency_ids", UNSET)) _conditionable_type = d.pop("conditionable_type", UNSET) - conditionable_type: Union[Unset, AlertRouteRulesItemConditionGroupsItemConditionsItemConditionableType] + conditionable_type: Unset | AlertRouteRulesItemConditionGroupsItemConditionsItemConditionableType if isinstance(_conditionable_type, Unset): conditionable_type = UNSET else: @@ -180,7 +180,7 @@ def _parse_alert_urgency_ids(data: object) -> Union[None, Unset, list[str]]: _conditionable_type ) - def _parse_conditionable_id(data: object) -> Union[None, UUID, Unset]: + def _parse_conditionable_id(data: object) -> None | UUID | Unset: if data is None: return data if isinstance(data, Unset): @@ -193,7 +193,7 @@ def _parse_conditionable_id(data: object) -> Union[None, UUID, Unset]: return conditionable_id_type_0 except: # noqa: E722 pass - return cast(Union[None, UUID, Unset], data) + return cast(None | UUID | Unset, data) conditionable_id = _parse_conditionable_id(d.pop("conditionable_id", UNSET)) diff --git a/rootly_sdk/models/alert_routing_rule.py b/rootly_sdk/models/alert_routing_rule.py index 03551da2..d6c36741 100644 --- a/rootly_sdk/models/alert_routing_rule.py +++ b/rootly_sdk/models/alert_routing_rule.py @@ -45,9 +45,9 @@ class AlertRoutingRule: condition_type: AlertRoutingRuleConditionType created_at: str updated_at: str - conditions: Union[Unset, list["AlertRoutingRuleConditionsItem"]] = UNSET + conditions: Unset | list["AlertRoutingRuleConditionsItem"] = UNSET destination: Union["AlertRoutingRuleDestinationType0", None, Unset] = UNSET - condition_groups: Union[Unset, list["AlertRoutingRuleConditionGroupsItem"]] = UNSET + condition_groups: Unset | list["AlertRoutingRuleConditionGroupsItem"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -67,14 +67,14 @@ def to_dict(self) -> dict[str, Any]: updated_at = self.updated_at - conditions: Union[Unset, list[dict[str, Any]]] = UNSET + conditions: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.conditions, Unset): conditions = [] for conditions_item_data in self.conditions: conditions_item = conditions_item_data.to_dict() conditions.append(conditions_item) - destination: Union[None, Unset, dict[str, Any]] + destination: None | Unset | dict[str, Any] if isinstance(self.destination, Unset): destination = UNSET elif isinstance(self.destination, AlertRoutingRuleDestinationType0): @@ -82,7 +82,7 @@ def to_dict(self) -> dict[str, Any]: else: destination = self.destination - condition_groups: Union[Unset, list[dict[str, Any]]] = UNSET + condition_groups: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.condition_groups, Unset): condition_groups = [] for condition_groups_item_data in self.condition_groups: diff --git a/rootly_sdk/models/alert_routing_rule_condition.py b/rootly_sdk/models/alert_routing_rule_condition.py index a3540287..90aa12ea 100644 --- a/rootly_sdk/models/alert_routing_rule_condition.py +++ b/rootly_sdk/models/alert_routing_rule_condition.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from uuid import UUID from attrs import define as _attrs_define @@ -39,13 +39,13 @@ class AlertRoutingRuleCondition: property_field_type: AlertRoutingRuleConditionPropertyFieldType property_field_name: str property_field_condition_type: AlertRoutingRuleConditionPropertyFieldConditionType - id: Union[Unset, UUID] = UNSET - property_field_value: Union[None, Unset, str] = UNSET - property_field_values: Union[None, Unset, list[str]] = UNSET - conditionable_id: Union[None, UUID, Unset] = UNSET - conditionable_type: Union[None, Unset, str] = UNSET - created_at: Union[Unset, str] = UNSET - updated_at: Union[Unset, str] = UNSET + id: Unset | UUID = UNSET + property_field_value: None | Unset | str = UNSET + property_field_values: None | Unset | list[str] = UNSET + conditionable_id: None | UUID | Unset = UNSET + conditionable_type: None | Unset | str = UNSET + created_at: Unset | str = UNSET + updated_at: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -55,17 +55,17 @@ def to_dict(self) -> dict[str, Any]: property_field_condition_type: str = self.property_field_condition_type - id: Union[Unset, str] = UNSET + id: Unset | str = UNSET if not isinstance(self.id, Unset): id = str(self.id) - property_field_value: Union[None, Unset, str] + property_field_value: None | Unset | str if isinstance(self.property_field_value, Unset): property_field_value = UNSET else: property_field_value = self.property_field_value - property_field_values: Union[None, Unset, list[str]] + property_field_values: None | Unset | list[str] if isinstance(self.property_field_values, Unset): property_field_values = UNSET elif isinstance(self.property_field_values, list): @@ -74,7 +74,7 @@ def to_dict(self) -> dict[str, Any]: else: property_field_values = self.property_field_values - conditionable_id: Union[None, Unset, str] + conditionable_id: None | Unset | str if isinstance(self.conditionable_id, Unset): conditionable_id = UNSET elif isinstance(self.conditionable_id, UUID): @@ -82,7 +82,7 @@ def to_dict(self) -> dict[str, Any]: else: conditionable_id = self.conditionable_id - conditionable_type: Union[None, Unset, str] + conditionable_type: None | Unset | str if isinstance(self.conditionable_type, Unset): conditionable_type = UNSET else: @@ -130,22 +130,22 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: ) _id = d.pop("id", UNSET) - id: Union[Unset, UUID] + id: Unset | UUID if isinstance(_id, Unset): id = UNSET else: id = UUID(_id) - def _parse_property_field_value(data: object) -> Union[None, Unset, str]: + def _parse_property_field_value(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) property_field_value = _parse_property_field_value(d.pop("property_field_value", UNSET)) - def _parse_property_field_values(data: object) -> Union[None, Unset, list[str]]: + def _parse_property_field_values(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -158,11 +158,11 @@ def _parse_property_field_values(data: object) -> Union[None, Unset, list[str]]: return property_field_values_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) property_field_values = _parse_property_field_values(d.pop("property_field_values", UNSET)) - def _parse_conditionable_id(data: object) -> Union[None, UUID, Unset]: + def _parse_conditionable_id(data: object) -> None | UUID | Unset: if data is None: return data if isinstance(data, Unset): @@ -175,16 +175,16 @@ def _parse_conditionable_id(data: object) -> Union[None, UUID, Unset]: return conditionable_id_type_0 except: # noqa: E722 pass - return cast(Union[None, UUID, Unset], data) + return cast(None | UUID | Unset, data) conditionable_id = _parse_conditionable_id(d.pop("conditionable_id", UNSET)) - def _parse_conditionable_type(data: object) -> Union[None, Unset, str]: + def _parse_conditionable_type(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) conditionable_type = _parse_conditionable_type(d.pop("conditionable_type", UNSET)) diff --git a/rootly_sdk/models/alert_routing_rule_condition_group.py b/rootly_sdk/models/alert_routing_rule_condition_group.py index 7c3df35d..bc3441dc 100644 --- a/rootly_sdk/models/alert_routing_rule_condition_group.py +++ b/rootly_sdk/models/alert_routing_rule_condition_group.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from uuid import UUID from attrs import define as _attrs_define @@ -27,20 +27,20 @@ class AlertRoutingRuleConditionGroup: """ position: int - id: Union[Unset, UUID] = UNSET - conditions: Union[Unset, list["AlertRoutingRuleCondition"]] = UNSET - created_at: Union[Unset, str] = UNSET - updated_at: Union[Unset, str] = UNSET + id: Unset | UUID = UNSET + conditions: Unset | list["AlertRoutingRuleCondition"] = UNSET + created_at: Unset | str = UNSET + updated_at: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: position = self.position - id: Union[Unset, str] = UNSET + id: Unset | str = UNSET if not isinstance(self.id, Unset): id = str(self.id) - conditions: Union[Unset, list[dict[str, Any]]] = UNSET + conditions: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.conditions, Unset): conditions = [] for conditions_item_data in self.conditions: @@ -77,7 +77,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: position = d.pop("position") _id = d.pop("id", UNSET) - id: Union[Unset, UUID] + id: Unset | UUID if isinstance(_id, Unset): id = UNSET else: diff --git a/rootly_sdk/models/alert_routing_rule_condition_groups_item.py b/rootly_sdk/models/alert_routing_rule_condition_groups_item.py index 31699f1d..e16fffa5 100644 --- a/rootly_sdk/models/alert_routing_rule_condition_groups_item.py +++ b/rootly_sdk/models/alert_routing_rule_condition_groups_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from uuid import UUID from attrs import define as _attrs_define @@ -29,20 +29,20 @@ class AlertRoutingRuleConditionGroupsItem: """ position: int - id: Union[Unset, UUID] = UNSET - conditions: Union[Unset, list["AlertRoutingRuleConditionGroupsItemConditionsItem"]] = UNSET - created_at: Union[Unset, str] = UNSET - updated_at: Union[Unset, str] = UNSET + id: Unset | UUID = UNSET + conditions: Unset | list["AlertRoutingRuleConditionGroupsItemConditionsItem"] = UNSET + created_at: Unset | str = UNSET + updated_at: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: position = self.position - id: Union[Unset, str] = UNSET + id: Unset | str = UNSET if not isinstance(self.id, Unset): id = str(self.id) - conditions: Union[Unset, list[dict[str, Any]]] = UNSET + conditions: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.conditions, Unset): conditions = [] for conditions_item_data in self.conditions: @@ -81,7 +81,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: position = d.pop("position") _id = d.pop("id", UNSET) - id: Union[Unset, UUID] + id: Unset | UUID if isinstance(_id, Unset): id = UNSET else: diff --git a/rootly_sdk/models/alert_routing_rule_condition_groups_item_conditions_item.py b/rootly_sdk/models/alert_routing_rule_condition_groups_item_conditions_item.py index a9ef4f07..8958ac1b 100644 --- a/rootly_sdk/models/alert_routing_rule_condition_groups_item_conditions_item.py +++ b/rootly_sdk/models/alert_routing_rule_condition_groups_item_conditions_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from uuid import UUID from attrs import define as _attrs_define @@ -39,13 +39,13 @@ class AlertRoutingRuleConditionGroupsItemConditionsItem: property_field_type: AlertRoutingRuleConditionGroupsItemConditionsItemPropertyFieldType property_field_name: str property_field_condition_type: AlertRoutingRuleConditionGroupsItemConditionsItemPropertyFieldConditionType - id: Union[Unset, UUID] = UNSET - property_field_value: Union[None, Unset, str] = UNSET - property_field_values: Union[None, Unset, list[str]] = UNSET - conditionable_id: Union[None, UUID, Unset] = UNSET - conditionable_type: Union[None, Unset, str] = UNSET - created_at: Union[Unset, str] = UNSET - updated_at: Union[Unset, str] = UNSET + id: Unset | UUID = UNSET + property_field_value: None | Unset | str = UNSET + property_field_values: None | Unset | list[str] = UNSET + conditionable_id: None | UUID | Unset = UNSET + conditionable_type: None | Unset | str = UNSET + created_at: Unset | str = UNSET + updated_at: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -55,17 +55,17 @@ def to_dict(self) -> dict[str, Any]: property_field_condition_type: str = self.property_field_condition_type - id: Union[Unset, str] = UNSET + id: Unset | str = UNSET if not isinstance(self.id, Unset): id = str(self.id) - property_field_value: Union[None, Unset, str] + property_field_value: None | Unset | str if isinstance(self.property_field_value, Unset): property_field_value = UNSET else: property_field_value = self.property_field_value - property_field_values: Union[None, Unset, list[str]] + property_field_values: None | Unset | list[str] if isinstance(self.property_field_values, Unset): property_field_values = UNSET elif isinstance(self.property_field_values, list): @@ -74,7 +74,7 @@ def to_dict(self) -> dict[str, Any]: else: property_field_values = self.property_field_values - conditionable_id: Union[None, Unset, str] + conditionable_id: None | Unset | str if isinstance(self.conditionable_id, Unset): conditionable_id = UNSET elif isinstance(self.conditionable_id, UUID): @@ -82,7 +82,7 @@ def to_dict(self) -> dict[str, Any]: else: conditionable_id = self.conditionable_id - conditionable_type: Union[None, Unset, str] + conditionable_type: None | Unset | str if isinstance(self.conditionable_type, Unset): conditionable_type = UNSET else: @@ -134,22 +134,22 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: ) _id = d.pop("id", UNSET) - id: Union[Unset, UUID] + id: Unset | UUID if isinstance(_id, Unset): id = UNSET else: id = UUID(_id) - def _parse_property_field_value(data: object) -> Union[None, Unset, str]: + def _parse_property_field_value(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) property_field_value = _parse_property_field_value(d.pop("property_field_value", UNSET)) - def _parse_property_field_values(data: object) -> Union[None, Unset, list[str]]: + def _parse_property_field_values(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -162,11 +162,11 @@ def _parse_property_field_values(data: object) -> Union[None, Unset, list[str]]: return property_field_values_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) property_field_values = _parse_property_field_values(d.pop("property_field_values", UNSET)) - def _parse_conditionable_id(data: object) -> Union[None, UUID, Unset]: + def _parse_conditionable_id(data: object) -> None | UUID | Unset: if data is None: return data if isinstance(data, Unset): @@ -179,16 +179,16 @@ def _parse_conditionable_id(data: object) -> Union[None, UUID, Unset]: return conditionable_id_type_0 except: # noqa: E722 pass - return cast(Union[None, UUID, Unset], data) + return cast(None | UUID | Unset, data) conditionable_id = _parse_conditionable_id(d.pop("conditionable_id", UNSET)) - def _parse_conditionable_type(data: object) -> Union[None, Unset, str]: + def _parse_conditionable_type(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) conditionable_type = _parse_conditionable_type(d.pop("conditionable_type", UNSET)) diff --git a/rootly_sdk/models/alert_routing_rule_conditions_item.py b/rootly_sdk/models/alert_routing_rule_conditions_item.py index cbec1e60..88f1a77f 100644 --- a/rootly_sdk/models/alert_routing_rule_conditions_item.py +++ b/rootly_sdk/models/alert_routing_rule_conditions_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -37,8 +37,8 @@ class AlertRoutingRuleConditionsItem: property_field_type: AlertRoutingRuleConditionsItemPropertyFieldType property_field_name: str property_field_condition_type: AlertRoutingRuleConditionsItemPropertyFieldConditionType - property_field_value: Union[None, Unset, str] = UNSET - property_field_values: Union[Unset, list[str]] = UNSET + property_field_value: None | Unset | str = UNSET + property_field_values: Unset | list[str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -48,13 +48,13 @@ def to_dict(self) -> dict[str, Any]: property_field_condition_type: str = self.property_field_condition_type - property_field_value: Union[None, Unset, str] + property_field_value: None | Unset | str if isinstance(self.property_field_value, Unset): property_field_value = UNSET else: property_field_value = self.property_field_value - property_field_values: Union[Unset, list[str]] = UNSET + property_field_values: Unset | list[str] = UNSET if not isinstance(self.property_field_values, Unset): property_field_values = self.property_field_values @@ -85,12 +85,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d.pop("property_field_condition_type") ) - def _parse_property_field_value(data: object) -> Union[None, Unset, str]: + def _parse_property_field_value(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) property_field_value = _parse_property_field_value(d.pop("property_field_value", UNSET)) diff --git a/rootly_sdk/models/alert_routing_rule_list.py b/rootly_sdk/models/alert_routing_rule_list.py index 638bff98..ffd3bf29 100644 --- a/rootly_sdk/models/alert_routing_rule_list.py +++ b/rootly_sdk/models/alert_routing_rule_list.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,7 +29,7 @@ class AlertRoutingRuleList: data: list["AlertRoutingRuleListDataItem"] links: "Links" meta: "Meta" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/alert_routing_rule_response.py b/rootly_sdk/models/alert_routing_rule_response.py index ccc3afd4..ac519419 100644 --- a/rootly_sdk/models/alert_routing_rule_response.py +++ b/rootly_sdk/models/alert_routing_rule_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,13 +23,13 @@ class AlertRoutingRuleResponse: """ data: "AlertRoutingRuleResponseData" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/alert_trigger_params.py b/rootly_sdk/models/alert_trigger_params.py index 46873879..0a7cb339 100644 --- a/rootly_sdk/models/alert_trigger_params.py +++ b/rootly_sdk/models/alert_trigger_params.py @@ -74,106 +74,106 @@ class AlertTriggerParams: """ trigger_type: AlertTriggerParamsTriggerType - triggers: Union[Unset, list[AlertTriggerParamsTriggersItem]] = UNSET - alert_condition: Union[Unset, AlertTriggerParamsAlertCondition] = UNSET - alert_condition_source: Union[Unset, AlertTriggerParamsAlertConditionSource] = "ANY" - alert_condition_source_use_regexp: Union[Unset, bool] = False - alert_sources: Union[Unset, list[str]] = UNSET - alert_condition_label: Union[Unset, AlertTriggerParamsAlertConditionLabel] = "ANY" - alert_condition_label_use_regexp: Union[Unset, bool] = False - alert_condition_status: Union[Unset, AlertTriggerParamsAlertConditionStatus] = "ANY" - alert_condition_status_use_regexp: Union[Unset, bool] = False - alert_statuses: Union[Unset, list[str]] = UNSET - alert_labels: Union[Unset, list[str]] = UNSET - alert_condition_urgency: Union[Unset, AlertTriggerParamsAlertConditionUrgency] = "ANY" - alert_urgency_ids: Union[Unset, list[UUID]] = UNSET - alert_condition_payload: Union[Unset, AlertTriggerParamsAlertConditionPayload] = "ANY" - alert_condition_payload_use_regexp: Union[Unset, bool] = False - alert_payload: Union[Unset, list[str]] = UNSET - alert_query_payload: Union[None, Unset, str] = UNSET - alert_field_conditions: Union[Unset, list["AlertTriggerParamsAlertFieldConditionsItem"]] = UNSET + triggers: Unset | list[AlertTriggerParamsTriggersItem] = UNSET + alert_condition: Unset | AlertTriggerParamsAlertCondition = UNSET + alert_condition_source: Unset | AlertTriggerParamsAlertConditionSource = "ANY" + alert_condition_source_use_regexp: Unset | bool = False + alert_sources: Unset | list[str] = UNSET + alert_condition_label: Unset | AlertTriggerParamsAlertConditionLabel = "ANY" + alert_condition_label_use_regexp: Unset | bool = False + alert_condition_status: Unset | AlertTriggerParamsAlertConditionStatus = "ANY" + alert_condition_status_use_regexp: Unset | bool = False + alert_statuses: Unset | list[str] = UNSET + alert_labels: Unset | list[str] = UNSET + alert_condition_urgency: Unset | AlertTriggerParamsAlertConditionUrgency = "ANY" + alert_urgency_ids: Unset | list[UUID] = UNSET + alert_condition_payload: Unset | AlertTriggerParamsAlertConditionPayload = "ANY" + alert_condition_payload_use_regexp: Unset | bool = False + alert_payload: Unset | list[str] = UNSET + alert_query_payload: None | Unset | str = UNSET + alert_field_conditions: Unset | list["AlertTriggerParamsAlertFieldConditionsItem"] = UNSET alert_payload_conditions: Union[Unset, "AlertTriggerParamsAlertPayloadConditions"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: trigger_type: str = self.trigger_type - triggers: Union[Unset, list[str]] = UNSET + triggers: Unset | list[str] = UNSET if not isinstance(self.triggers, Unset): triggers = [] for triggers_item_data in self.triggers: triggers_item: str = triggers_item_data triggers.append(triggers_item) - alert_condition: Union[Unset, str] = UNSET + alert_condition: Unset | str = UNSET if not isinstance(self.alert_condition, Unset): alert_condition = self.alert_condition - alert_condition_source: Union[Unset, str] = UNSET + alert_condition_source: Unset | str = UNSET if not isinstance(self.alert_condition_source, Unset): alert_condition_source = self.alert_condition_source alert_condition_source_use_regexp = self.alert_condition_source_use_regexp - alert_sources: Union[Unset, list[str]] = UNSET + alert_sources: Unset | list[str] = UNSET if not isinstance(self.alert_sources, Unset): alert_sources = self.alert_sources - alert_condition_label: Union[Unset, str] = UNSET + alert_condition_label: Unset | str = UNSET if not isinstance(self.alert_condition_label, Unset): alert_condition_label = self.alert_condition_label alert_condition_label_use_regexp = self.alert_condition_label_use_regexp - alert_condition_status: Union[Unset, str] = UNSET + alert_condition_status: Unset | str = UNSET if not isinstance(self.alert_condition_status, Unset): alert_condition_status = self.alert_condition_status alert_condition_status_use_regexp = self.alert_condition_status_use_regexp - alert_statuses: Union[Unset, list[str]] = UNSET + alert_statuses: Unset | list[str] = UNSET if not isinstance(self.alert_statuses, Unset): alert_statuses = self.alert_statuses - alert_labels: Union[Unset, list[str]] = UNSET + alert_labels: Unset | list[str] = UNSET if not isinstance(self.alert_labels, Unset): alert_labels = self.alert_labels - alert_condition_urgency: Union[Unset, str] = UNSET + alert_condition_urgency: Unset | str = UNSET if not isinstance(self.alert_condition_urgency, Unset): alert_condition_urgency = self.alert_condition_urgency - alert_urgency_ids: Union[Unset, list[str]] = UNSET + alert_urgency_ids: Unset | list[str] = UNSET if not isinstance(self.alert_urgency_ids, Unset): alert_urgency_ids = [] for alert_urgency_ids_item_data in self.alert_urgency_ids: alert_urgency_ids_item = str(alert_urgency_ids_item_data) alert_urgency_ids.append(alert_urgency_ids_item) - alert_condition_payload: Union[Unset, str] = UNSET + alert_condition_payload: Unset | str = UNSET if not isinstance(self.alert_condition_payload, Unset): alert_condition_payload = self.alert_condition_payload alert_condition_payload_use_regexp = self.alert_condition_payload_use_regexp - alert_payload: Union[Unset, list[str]] = UNSET + alert_payload: Unset | list[str] = UNSET if not isinstance(self.alert_payload, Unset): alert_payload = self.alert_payload - alert_query_payload: Union[None, Unset, str] + alert_query_payload: None | Unset | str if isinstance(self.alert_query_payload, Unset): alert_query_payload = UNSET else: alert_query_payload = self.alert_query_payload - alert_field_conditions: Union[Unset, list[dict[str, Any]]] = UNSET + alert_field_conditions: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.alert_field_conditions, Unset): alert_field_conditions = [] for alert_field_conditions_item_data in self.alert_field_conditions: alert_field_conditions_item = alert_field_conditions_item_data.to_dict() alert_field_conditions.append(alert_field_conditions_item) - alert_payload_conditions: Union[Unset, dict[str, Any]] = UNSET + alert_payload_conditions: Unset | dict[str, Any] = UNSET if not isinstance(self.alert_payload_conditions, Unset): alert_payload_conditions = self.alert_payload_conditions.to_dict() @@ -241,14 +241,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: triggers.append(triggers_item) _alert_condition = d.pop("alert_condition", UNSET) - alert_condition: Union[Unset, AlertTriggerParamsAlertCondition] + alert_condition: Unset | AlertTriggerParamsAlertCondition if isinstance(_alert_condition, Unset): alert_condition = UNSET else: alert_condition = check_alert_trigger_params_alert_condition(_alert_condition) _alert_condition_source = d.pop("alert_condition_source", UNSET) - alert_condition_source: Union[Unset, AlertTriggerParamsAlertConditionSource] + alert_condition_source: Unset | AlertTriggerParamsAlertConditionSource if isinstance(_alert_condition_source, Unset): alert_condition_source = UNSET else: @@ -259,7 +259,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: alert_sources = cast(list[str], d.pop("alert_sources", UNSET)) _alert_condition_label = d.pop("alert_condition_label", UNSET) - alert_condition_label: Union[Unset, AlertTriggerParamsAlertConditionLabel] + alert_condition_label: Unset | AlertTriggerParamsAlertConditionLabel if isinstance(_alert_condition_label, Unset): alert_condition_label = UNSET else: @@ -268,7 +268,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: alert_condition_label_use_regexp = d.pop("alert_condition_label_use_regexp", UNSET) _alert_condition_status = d.pop("alert_condition_status", UNSET) - alert_condition_status: Union[Unset, AlertTriggerParamsAlertConditionStatus] + alert_condition_status: Unset | AlertTriggerParamsAlertConditionStatus if isinstance(_alert_condition_status, Unset): alert_condition_status = UNSET else: @@ -281,7 +281,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: alert_labels = cast(list[str], d.pop("alert_labels", UNSET)) _alert_condition_urgency = d.pop("alert_condition_urgency", UNSET) - alert_condition_urgency: Union[Unset, AlertTriggerParamsAlertConditionUrgency] + alert_condition_urgency: Unset | AlertTriggerParamsAlertConditionUrgency if isinstance(_alert_condition_urgency, Unset): alert_condition_urgency = UNSET else: @@ -295,7 +295,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: alert_urgency_ids.append(alert_urgency_ids_item) _alert_condition_payload = d.pop("alert_condition_payload", UNSET) - alert_condition_payload: Union[Unset, AlertTriggerParamsAlertConditionPayload] + alert_condition_payload: Unset | AlertTriggerParamsAlertConditionPayload if isinstance(_alert_condition_payload, Unset): alert_condition_payload = UNSET else: @@ -305,12 +305,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: alert_payload = cast(list[str], d.pop("alert_payload", UNSET)) - def _parse_alert_query_payload(data: object) -> Union[None, Unset, str]: + def _parse_alert_query_payload(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) alert_query_payload = _parse_alert_query_payload(d.pop("alert_query_payload", UNSET)) @@ -324,7 +324,7 @@ def _parse_alert_query_payload(data: object) -> Union[None, Unset, str]: alert_field_conditions.append(alert_field_conditions_item) _alert_payload_conditions = d.pop("alert_payload_conditions", UNSET) - alert_payload_conditions: Union[Unset, AlertTriggerParamsAlertPayloadConditions] + alert_payload_conditions: Unset | AlertTriggerParamsAlertPayloadConditions if isinstance(_alert_payload_conditions, Unset): alert_payload_conditions = UNSET else: diff --git a/rootly_sdk/models/alert_trigger_params_alert_field_conditions_item.py b/rootly_sdk/models/alert_trigger_params_alert_field_conditions_item.py index 222116fa..d4463fd9 100644 --- a/rootly_sdk/models/alert_trigger_params_alert_field_conditions_item.py +++ b/rootly_sdk/models/alert_trigger_params_alert_field_conditions_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -24,7 +24,7 @@ class AlertTriggerParamsAlertFieldConditionsItem: alert_field_id: str condition_type: AlertTriggerParamsAlertFieldConditionsItemConditionType - values: Union[Unset, list[str]] = UNSET + values: Unset | list[str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -32,7 +32,7 @@ def to_dict(self) -> dict[str, Any]: condition_type: str = self.condition_type - values: Union[Unset, list[str]] = UNSET + values: Unset | list[str] = UNSET if not isinstance(self.values, Unset): values = self.values diff --git a/rootly_sdk/models/alert_trigger_params_alert_payload_conditions.py b/rootly_sdk/models/alert_trigger_params_alert_payload_conditions.py index a3302aa4..c037c6b6 100644 --- a/rootly_sdk/models/alert_trigger_params_alert_payload_conditions.py +++ b/rootly_sdk/models/alert_trigger_params_alert_payload_conditions.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -27,16 +27,16 @@ class AlertTriggerParamsAlertPayloadConditions: conditions (Union[Unset, list['AlertTriggerParamsAlertPayloadConditionsConditionsItem']]): """ - logic: Union[Unset, AlertTriggerParamsAlertPayloadConditionsLogic] = UNSET - conditions: Union[Unset, list["AlertTriggerParamsAlertPayloadConditionsConditionsItem"]] = UNSET + logic: Unset | AlertTriggerParamsAlertPayloadConditionsLogic = UNSET + conditions: Unset | list["AlertTriggerParamsAlertPayloadConditionsConditionsItem"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - logic: Union[Unset, str] = UNSET + logic: Unset | str = UNSET if not isinstance(self.logic, Unset): logic = self.logic - conditions: Union[Unset, list[dict[str, Any]]] = UNSET + conditions: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.conditions, Unset): conditions = [] for conditions_item_data in self.conditions: @@ -61,7 +61,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _logic = d.pop("logic", UNSET) - logic: Union[Unset, AlertTriggerParamsAlertPayloadConditionsLogic] + logic: Unset | AlertTriggerParamsAlertPayloadConditionsLogic if isinstance(_logic, Unset): logic = UNSET else: diff --git a/rootly_sdk/models/alert_trigger_params_alert_payload_conditions_conditions_item.py b/rootly_sdk/models/alert_trigger_params_alert_payload_conditions_conditions_item.py index 7e5cd5dd..d00a6cc6 100644 --- a/rootly_sdk/models/alert_trigger_params_alert_payload_conditions_conditions_item.py +++ b/rootly_sdk/models/alert_trigger_params_alert_payload_conditions_conditions_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -25,8 +25,8 @@ class AlertTriggerParamsAlertPayloadConditionsConditionsItem: query: str operator: AlertTriggerParamsAlertPayloadConditionsConditionsItemOperator - values: Union[Unset, list[str]] = UNSET - use_regexp: Union[Unset, bool] = UNSET + values: Unset | list[str] = UNSET + use_regexp: Unset | bool = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -34,7 +34,7 @@ def to_dict(self) -> dict[str, Any]: operator: str = self.operator - values: Union[Unset, list[str]] = UNSET + values: Unset | list[str] = UNSET if not isinstance(self.values, Unset): values = self.values diff --git a/rootly_sdk/models/alert_urgency.py b/rootly_sdk/models/alert_urgency.py index fe2a2546..d9ae5f2d 100644 --- a/rootly_sdk/models/alert_urgency.py +++ b/rootly_sdk/models/alert_urgency.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -32,12 +32,12 @@ class AlertUrgency: position: int created_at: str updated_at: str - id: Union[Unset, str] = UNSET - retrigger_timeout_minutes: Union[None, Unset, int] = UNSET - urgency: Union[None, Unset, str] = UNSET - color: Union[None, Unset, str] = UNSET - team_id: Union[Unset, int] = UNSET - deleted_at: Union[None, Unset, str] = UNSET + id: Unset | str = UNSET + retrigger_timeout_minutes: None | Unset | int = UNSET + urgency: None | Unset | str = UNSET + color: None | Unset | str = UNSET + team_id: Unset | int = UNSET + deleted_at: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -53,19 +53,19 @@ def to_dict(self) -> dict[str, Any]: id = self.id - retrigger_timeout_minutes: Union[None, Unset, int] + retrigger_timeout_minutes: None | Unset | int if isinstance(self.retrigger_timeout_minutes, Unset): retrigger_timeout_minutes = UNSET else: retrigger_timeout_minutes = self.retrigger_timeout_minutes - urgency: Union[None, Unset, str] + urgency: None | Unset | str if isinstance(self.urgency, Unset): urgency = UNSET else: urgency = self.urgency - color: Union[None, Unset, str] + color: None | Unset | str if isinstance(self.color, Unset): color = UNSET else: @@ -73,7 +73,7 @@ def to_dict(self) -> dict[str, Any]: team_id = self.team_id - deleted_at: Union[None, Unset, str] + deleted_at: None | Unset | str if isinstance(self.deleted_at, Unset): deleted_at = UNSET else: @@ -120,41 +120,41 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: id = d.pop("id", UNSET) - def _parse_retrigger_timeout_minutes(data: object) -> Union[None, Unset, int]: + def _parse_retrigger_timeout_minutes(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) retrigger_timeout_minutes = _parse_retrigger_timeout_minutes(d.pop("retrigger_timeout_minutes", UNSET)) - def _parse_urgency(data: object) -> Union[None, Unset, str]: + def _parse_urgency(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) urgency = _parse_urgency(d.pop("urgency", UNSET)) - def _parse_color(data: object) -> Union[None, Unset, str]: + def _parse_color(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) color = _parse_color(d.pop("color", UNSET)) team_id = d.pop("team_id", UNSET) - def _parse_deleted_at(data: object) -> Union[None, Unset, str]: + def _parse_deleted_at(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) deleted_at = _parse_deleted_at(d.pop("deleted_at", UNSET)) diff --git a/rootly_sdk/models/alert_urgency_list.py b/rootly_sdk/models/alert_urgency_list.py index 16897a58..ba752c31 100644 --- a/rootly_sdk/models/alert_urgency_list.py +++ b/rootly_sdk/models/alert_urgency_list.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,7 +29,7 @@ class AlertUrgencyList: data: list["AlertUrgencyListDataItem"] links: "Links" meta: "Meta" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/alert_urgency_response.py b/rootly_sdk/models/alert_urgency_response.py index cc8615df..c3fafb51 100644 --- a/rootly_sdk/models/alert_urgency_response.py +++ b/rootly_sdk/models/alert_urgency_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,13 +23,13 @@ class AlertUrgencyResponse: """ data: "AlertUrgencyResponseData" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/alerts_source.py b/rootly_sdk/models/alerts_source.py index f27b6380..3cc27deb 100644 --- a/rootly_sdk/models/alerts_source.py +++ b/rootly_sdk/models/alerts_source.py @@ -67,23 +67,21 @@ class AlertsSource: secret: str created_at: str updated_at: str - enabled: Union[Unset, bool] = UNSET - source_type: Union[Unset, AlertsSourceSourceType] = UNSET - alert_urgency_id: Union[Unset, str] = UNSET - deduplicate_alerts_by_key: Union[Unset, bool] = UNSET - deduplication_key_kind: Union[Unset, AlertsSourceDeduplicationKeyKind] = UNSET - deduplication_key_path: Union[None, Unset, str] = UNSET - deduplication_key_regexp: Union[None, Unset, str] = UNSET - owner_group_ids: Union[Unset, list[str]] = UNSET + enabled: Unset | bool = UNSET + source_type: Unset | AlertsSourceSourceType = UNSET + alert_urgency_id: Unset | str = UNSET + deduplicate_alerts_by_key: Unset | bool = UNSET + deduplication_key_kind: Unset | AlertsSourceDeduplicationKeyKind = UNSET + deduplication_key_path: None | Unset | str = UNSET + deduplication_key_regexp: None | Unset | str = UNSET + owner_group_ids: Unset | list[str] = UNSET alert_template_attributes: Union["AlertsSourceAlertTemplateAttributesType0", None, Unset] = UNSET - alert_source_urgency_rules_attributes: Union[Unset, list["AlertsSourceAlertSourceUrgencyRulesAttributesItem"]] = ( - UNSET - ) + alert_source_urgency_rules_attributes: Unset | list["AlertsSourceAlertSourceUrgencyRulesAttributesItem"] = UNSET sourceable_attributes: Union["AlertsSourceSourceableAttributesType0", None, Unset] = UNSET resolution_rule_attributes: Union["AlertsSourceResolutionRuleAttributesType0", None, Unset] = UNSET - alert_source_fields_attributes: Union[Unset, list["AlertsSourceAlertSourceFieldsAttributesItem"]] = UNSET - email: Union[None, Unset, str] = UNSET - webhook_endpoint: Union[None, Unset, str] = UNSET + alert_source_fields_attributes: Unset | list["AlertsSourceAlertSourceFieldsAttributesItem"] = UNSET + email: None | Unset | str = UNSET + webhook_endpoint: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -103,7 +101,7 @@ def to_dict(self) -> dict[str, Any]: enabled = self.enabled - source_type: Union[Unset, str] = UNSET + source_type: Unset | str = UNSET if not isinstance(self.source_type, Unset): source_type = self.source_type @@ -111,27 +109,27 @@ def to_dict(self) -> dict[str, Any]: deduplicate_alerts_by_key = self.deduplicate_alerts_by_key - deduplication_key_kind: Union[Unset, str] = UNSET + deduplication_key_kind: Unset | str = UNSET if not isinstance(self.deduplication_key_kind, Unset): deduplication_key_kind = self.deduplication_key_kind - deduplication_key_path: Union[None, Unset, str] + deduplication_key_path: None | Unset | str if isinstance(self.deduplication_key_path, Unset): deduplication_key_path = UNSET else: deduplication_key_path = self.deduplication_key_path - deduplication_key_regexp: Union[None, Unset, str] + deduplication_key_regexp: None | Unset | str if isinstance(self.deduplication_key_regexp, Unset): deduplication_key_regexp = UNSET else: deduplication_key_regexp = self.deduplication_key_regexp - owner_group_ids: Union[Unset, list[str]] = UNSET + owner_group_ids: Unset | list[str] = UNSET if not isinstance(self.owner_group_ids, Unset): owner_group_ids = self.owner_group_ids - alert_template_attributes: Union[None, Unset, dict[str, Any]] + alert_template_attributes: None | Unset | dict[str, Any] if isinstance(self.alert_template_attributes, Unset): alert_template_attributes = UNSET elif isinstance(self.alert_template_attributes, AlertsSourceAlertTemplateAttributesType0): @@ -139,14 +137,14 @@ def to_dict(self) -> dict[str, Any]: else: alert_template_attributes = self.alert_template_attributes - alert_source_urgency_rules_attributes: Union[Unset, list[dict[str, Any]]] = UNSET + alert_source_urgency_rules_attributes: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.alert_source_urgency_rules_attributes, Unset): alert_source_urgency_rules_attributes = [] for alert_source_urgency_rules_attributes_item_data in self.alert_source_urgency_rules_attributes: alert_source_urgency_rules_attributes_item = alert_source_urgency_rules_attributes_item_data.to_dict() alert_source_urgency_rules_attributes.append(alert_source_urgency_rules_attributes_item) - sourceable_attributes: Union[None, Unset, dict[str, Any]] + sourceable_attributes: None | Unset | dict[str, Any] if isinstance(self.sourceable_attributes, Unset): sourceable_attributes = UNSET elif isinstance(self.sourceable_attributes, AlertsSourceSourceableAttributesType0): @@ -154,7 +152,7 @@ def to_dict(self) -> dict[str, Any]: else: sourceable_attributes = self.sourceable_attributes - resolution_rule_attributes: Union[None, Unset, dict[str, Any]] + resolution_rule_attributes: None | Unset | dict[str, Any] if isinstance(self.resolution_rule_attributes, Unset): resolution_rule_attributes = UNSET elif isinstance(self.resolution_rule_attributes, AlertsSourceResolutionRuleAttributesType0): @@ -162,20 +160,20 @@ def to_dict(self) -> dict[str, Any]: else: resolution_rule_attributes = self.resolution_rule_attributes - alert_source_fields_attributes: Union[Unset, list[dict[str, Any]]] = UNSET + alert_source_fields_attributes: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.alert_source_fields_attributes, Unset): alert_source_fields_attributes = [] for alert_source_fields_attributes_item_data in self.alert_source_fields_attributes: alert_source_fields_attributes_item = alert_source_fields_attributes_item_data.to_dict() alert_source_fields_attributes.append(alert_source_fields_attributes_item) - email: Union[None, Unset, str] + email: None | Unset | str if isinstance(self.email, Unset): email = UNSET else: email = self.email - webhook_endpoint: Union[None, Unset, str] + webhook_endpoint: None | Unset | str if isinstance(self.webhook_endpoint, Unset): webhook_endpoint = UNSET else: @@ -251,7 +249,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: enabled = d.pop("enabled", UNSET) _source_type = d.pop("source_type", UNSET) - source_type: Union[Unset, AlertsSourceSourceType] + source_type: Unset | AlertsSourceSourceType if isinstance(_source_type, Unset): source_type = UNSET else: @@ -262,27 +260,27 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: deduplicate_alerts_by_key = d.pop("deduplicate_alerts_by_key", UNSET) _deduplication_key_kind = d.pop("deduplication_key_kind", UNSET) - deduplication_key_kind: Union[Unset, AlertsSourceDeduplicationKeyKind] + deduplication_key_kind: Unset | AlertsSourceDeduplicationKeyKind if isinstance(_deduplication_key_kind, Unset): deduplication_key_kind = UNSET else: deduplication_key_kind = check_alerts_source_deduplication_key_kind(_deduplication_key_kind) - def _parse_deduplication_key_path(data: object) -> Union[None, Unset, str]: + def _parse_deduplication_key_path(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) deduplication_key_path = _parse_deduplication_key_path(d.pop("deduplication_key_path", UNSET)) - def _parse_deduplication_key_regexp(data: object) -> Union[None, Unset, str]: + def _parse_deduplication_key_regexp(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) deduplication_key_regexp = _parse_deduplication_key_regexp(d.pop("deduplication_key_regexp", UNSET)) @@ -361,21 +359,21 @@ def _parse_resolution_rule_attributes( alert_source_fields_attributes.append(alert_source_fields_attributes_item) - def _parse_email(data: object) -> Union[None, Unset, str]: + def _parse_email(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) email = _parse_email(d.pop("email", UNSET)) - def _parse_webhook_endpoint(data: object) -> Union[None, Unset, str]: + def _parse_webhook_endpoint(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) webhook_endpoint = _parse_webhook_endpoint(d.pop("webhook_endpoint", UNSET)) diff --git a/rootly_sdk/models/alerts_source_alert_source_fields_attributes_item.py b/rootly_sdk/models/alerts_source_alert_source_fields_attributes_item.py index a8cb412b..4c60c844 100644 --- a/rootly_sdk/models/alerts_source_alert_source_fields_attributes_item.py +++ b/rootly_sdk/models/alerts_source_alert_source_fields_attributes_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -18,14 +18,14 @@ class AlertsSourceAlertSourceFieldsAttributesItem: for evaluation """ - alert_field_id: Union[Unset, str] = UNSET - template_body: Union[None, Unset, str] = UNSET + alert_field_id: Unset | str = UNSET + template_body: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: alert_field_id = self.alert_field_id - template_body: Union[None, Unset, str] + template_body: None | Unset | str if isinstance(self.template_body, Unset): template_body = UNSET else: @@ -46,12 +46,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) alert_field_id = d.pop("alert_field_id", UNSET) - def _parse_template_body(data: object) -> Union[None, Unset, str]: + def _parse_template_body(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) template_body = _parse_template_body(d.pop("template_body", UNSET)) diff --git a/rootly_sdk/models/alerts_source_alert_source_urgency_rules_attributes_item.py b/rootly_sdk/models/alerts_source_alert_source_urgency_rules_attributes_item.py index 33d15b76..a462d04a 100644 --- a/rootly_sdk/models/alerts_source_alert_source_urgency_rules_attributes_item.py +++ b/rootly_sdk/models/alerts_source_alert_source_urgency_rules_attributes_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -39,39 +39,39 @@ class AlertsSourceAlertSourceUrgencyRulesAttributesItem: alert_urgency_id (Union[Unset, str]): The ID of the alert urgency """ - json_path: Union[None, Unset, str] = UNSET - operator: Union[Unset, AlertsSourceAlertSourceUrgencyRulesAttributesItemOperator] = UNSET - value: Union[Unset, str] = UNSET - conditionable_type: Union[Unset, AlertsSourceAlertSourceUrgencyRulesAttributesItemConditionableType] = UNSET - conditionable_id: Union[None, Unset, str] = UNSET - kind: Union[Unset, AlertsSourceAlertSourceUrgencyRulesAttributesItemKind] = UNSET - alert_urgency_id: Union[Unset, str] = UNSET + json_path: None | Unset | str = UNSET + operator: Unset | AlertsSourceAlertSourceUrgencyRulesAttributesItemOperator = UNSET + value: Unset | str = UNSET + conditionable_type: Unset | AlertsSourceAlertSourceUrgencyRulesAttributesItemConditionableType = UNSET + conditionable_id: None | Unset | str = UNSET + kind: Unset | AlertsSourceAlertSourceUrgencyRulesAttributesItemKind = UNSET + alert_urgency_id: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - json_path: Union[None, Unset, str] + json_path: None | Unset | str if isinstance(self.json_path, Unset): json_path = UNSET else: json_path = self.json_path - operator: Union[Unset, str] = UNSET + operator: Unset | str = UNSET if not isinstance(self.operator, Unset): operator = self.operator value = self.value - conditionable_type: Union[Unset, str] = UNSET + conditionable_type: Unset | str = UNSET if not isinstance(self.conditionable_type, Unset): conditionable_type = self.conditionable_type - conditionable_id: Union[None, Unset, str] + conditionable_id: None | Unset | str if isinstance(self.conditionable_id, Unset): conditionable_id = UNSET else: conditionable_id = self.conditionable_id - kind: Union[Unset, str] = UNSET + kind: Unset | str = UNSET if not isinstance(self.kind, Unset): kind = self.kind @@ -101,17 +101,17 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_json_path(data: object) -> Union[None, Unset, str]: + def _parse_json_path(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) json_path = _parse_json_path(d.pop("json_path", UNSET)) _operator = d.pop("operator", UNSET) - operator: Union[Unset, AlertsSourceAlertSourceUrgencyRulesAttributesItemOperator] + operator: Unset | AlertsSourceAlertSourceUrgencyRulesAttributesItemOperator if isinstance(_operator, Unset): operator = UNSET else: @@ -120,7 +120,7 @@ def _parse_json_path(data: object) -> Union[None, Unset, str]: value = d.pop("value", UNSET) _conditionable_type = d.pop("conditionable_type", UNSET) - conditionable_type: Union[Unset, AlertsSourceAlertSourceUrgencyRulesAttributesItemConditionableType] + conditionable_type: Unset | AlertsSourceAlertSourceUrgencyRulesAttributesItemConditionableType if isinstance(_conditionable_type, Unset): conditionable_type = UNSET else: @@ -128,17 +128,17 @@ def _parse_json_path(data: object) -> Union[None, Unset, str]: _conditionable_type ) - def _parse_conditionable_id(data: object) -> Union[None, Unset, str]: + def _parse_conditionable_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) conditionable_id = _parse_conditionable_id(d.pop("conditionable_id", UNSET)) _kind = d.pop("kind", UNSET) - kind: Union[Unset, AlertsSourceAlertSourceUrgencyRulesAttributesItemKind] + kind: Unset | AlertsSourceAlertSourceUrgencyRulesAttributesItemKind if isinstance(_kind, Unset): kind = UNSET else: diff --git a/rootly_sdk/models/alerts_source_alert_template_attributes_type_0.py b/rootly_sdk/models/alerts_source_alert_template_attributes_type_0.py index aecbe7a0..5cd8aa2f 100644 --- a/rootly_sdk/models/alerts_source_alert_template_attributes_type_0.py +++ b/rootly_sdk/models/alerts_source_alert_template_attributes_type_0.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -18,25 +18,25 @@ class AlertsSourceAlertTemplateAttributesType0: external_url (Union[None, Unset, str]): The alert URL. """ - title: Union[None, Unset, str] = UNSET - description: Union[None, Unset, str] = UNSET - external_url: Union[None, Unset, str] = UNSET + title: None | Unset | str = UNSET + description: None | Unset | str = UNSET + external_url: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - title: Union[None, Unset, str] + title: None | Unset | str if isinstance(self.title, Unset): title = UNSET else: title = self.title - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - external_url: Union[None, Unset, str] + external_url: None | Unset | str if isinstance(self.external_url, Unset): external_url = UNSET else: @@ -58,30 +58,30 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_title(data: object) -> Union[None, Unset, str]: + def _parse_title(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) title = _parse_title(d.pop("title", UNSET)) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_external_url(data: object) -> Union[None, Unset, str]: + def _parse_external_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) external_url = _parse_external_url(d.pop("external_url", UNSET)) diff --git a/rootly_sdk/models/alerts_source_list.py b/rootly_sdk/models/alerts_source_list.py index 8e42181b..8335e9c5 100644 --- a/rootly_sdk/models/alerts_source_list.py +++ b/rootly_sdk/models/alerts_source_list.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,7 +29,7 @@ class AlertsSourceList: data: list["AlertsSourceListDataItem"] links: "Links" meta: "Meta" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/alerts_source_resolution_rule_attributes_type_0.py b/rootly_sdk/models/alerts_source_resolution_rule_attributes_type_0.py index 73e32aab..5364cf61 100644 --- a/rootly_sdk/models/alerts_source_resolution_rule_attributes_type_0.py +++ b/rootly_sdk/models/alerts_source_resolution_rule_attributes_type_0.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -49,52 +49,50 @@ class AlertsSourceResolutionRuleAttributesType0: List of conditions to evaluate for auto resolution """ - enabled: Union[Unset, bool] = UNSET - condition_type: Union[Unset, AlertsSourceResolutionRuleAttributesType0ConditionType] = UNSET - identifier_matchable_type: Union[Unset, AlertsSourceResolutionRuleAttributesType0IdentifierMatchableType] = UNSET - identifier_matchable_id: Union[None, Unset, str] = UNSET - identifier_reference_kind: Union[Unset, AlertsSourceResolutionRuleAttributesType0IdentifierReferenceKind] = UNSET - identifier_json_path: Union[None, Unset, str] = UNSET - identifier_value_regex: Union[None, Unset, str] = UNSET - conditions_attributes: Union[Unset, list["AlertsSourceResolutionRuleAttributesType0ConditionsAttributesItem"]] = ( - UNSET - ) + enabled: Unset | bool = UNSET + condition_type: Unset | AlertsSourceResolutionRuleAttributesType0ConditionType = UNSET + identifier_matchable_type: Unset | AlertsSourceResolutionRuleAttributesType0IdentifierMatchableType = UNSET + identifier_matchable_id: None | Unset | str = UNSET + identifier_reference_kind: Unset | AlertsSourceResolutionRuleAttributesType0IdentifierReferenceKind = UNSET + identifier_json_path: None | Unset | str = UNSET + identifier_value_regex: None | Unset | str = UNSET + conditions_attributes: Unset | list["AlertsSourceResolutionRuleAttributesType0ConditionsAttributesItem"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: enabled = self.enabled - condition_type: Union[Unset, str] = UNSET + condition_type: Unset | str = UNSET if not isinstance(self.condition_type, Unset): condition_type = self.condition_type - identifier_matchable_type: Union[Unset, str] = UNSET + identifier_matchable_type: Unset | str = UNSET if not isinstance(self.identifier_matchable_type, Unset): identifier_matchable_type = self.identifier_matchable_type - identifier_matchable_id: Union[None, Unset, str] + identifier_matchable_id: None | Unset | str if isinstance(self.identifier_matchable_id, Unset): identifier_matchable_id = UNSET else: identifier_matchable_id = self.identifier_matchable_id - identifier_reference_kind: Union[Unset, str] = UNSET + identifier_reference_kind: Unset | str = UNSET if not isinstance(self.identifier_reference_kind, Unset): identifier_reference_kind = self.identifier_reference_kind - identifier_json_path: Union[None, Unset, str] + identifier_json_path: None | Unset | str if isinstance(self.identifier_json_path, Unset): identifier_json_path = UNSET else: identifier_json_path = self.identifier_json_path - identifier_value_regex: Union[None, Unset, str] + identifier_value_regex: None | Unset | str if isinstance(self.identifier_value_regex, Unset): identifier_value_regex = UNSET else: identifier_value_regex = self.identifier_value_regex - conditions_attributes: Union[Unset, list[dict[str, Any]]] = UNSET + conditions_attributes: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.conditions_attributes, Unset): conditions_attributes = [] for conditions_attributes_item_data in self.conditions_attributes: @@ -133,14 +131,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: enabled = d.pop("enabled", UNSET) _condition_type = d.pop("condition_type", UNSET) - condition_type: Union[Unset, AlertsSourceResolutionRuleAttributesType0ConditionType] + condition_type: Unset | AlertsSourceResolutionRuleAttributesType0ConditionType if isinstance(_condition_type, Unset): condition_type = UNSET else: condition_type = check_alerts_source_resolution_rule_attributes_type_0_condition_type(_condition_type) _identifier_matchable_type = d.pop("identifier_matchable_type", UNSET) - identifier_matchable_type: Union[Unset, AlertsSourceResolutionRuleAttributesType0IdentifierMatchableType] + identifier_matchable_type: Unset | AlertsSourceResolutionRuleAttributesType0IdentifierMatchableType if isinstance(_identifier_matchable_type, Unset): identifier_matchable_type = UNSET else: @@ -148,17 +146,17 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: _identifier_matchable_type ) - def _parse_identifier_matchable_id(data: object) -> Union[None, Unset, str]: + def _parse_identifier_matchable_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) identifier_matchable_id = _parse_identifier_matchable_id(d.pop("identifier_matchable_id", UNSET)) _identifier_reference_kind = d.pop("identifier_reference_kind", UNSET) - identifier_reference_kind: Union[Unset, AlertsSourceResolutionRuleAttributesType0IdentifierReferenceKind] + identifier_reference_kind: Unset | AlertsSourceResolutionRuleAttributesType0IdentifierReferenceKind if isinstance(_identifier_reference_kind, Unset): identifier_reference_kind = UNSET else: @@ -166,21 +164,21 @@ def _parse_identifier_matchable_id(data: object) -> Union[None, Unset, str]: _identifier_reference_kind ) - def _parse_identifier_json_path(data: object) -> Union[None, Unset, str]: + def _parse_identifier_json_path(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) identifier_json_path = _parse_identifier_json_path(d.pop("identifier_json_path", UNSET)) - def _parse_identifier_value_regex(data: object) -> Union[None, Unset, str]: + def _parse_identifier_value_regex(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) identifier_value_regex = _parse_identifier_value_regex(d.pop("identifier_value_regex", UNSET)) diff --git a/rootly_sdk/models/alerts_source_resolution_rule_attributes_type_0_conditions_attributes_item.py b/rootly_sdk/models/alerts_source_resolution_rule_attributes_type_0_conditions_attributes_item.py index a79fa572..37aa59ad 100644 --- a/rootly_sdk/models/alerts_source_resolution_rule_attributes_type_0_conditions_attributes_item.py +++ b/rootly_sdk/models/alerts_source_resolution_rule_attributes_type_0_conditions_attributes_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -40,40 +40,40 @@ class AlertsSourceResolutionRuleAttributesType0ConditionsAttributesItem: conditionable """ - field: Union[None, Unset, str] = UNSET - operator: Union[Unset, AlertsSourceResolutionRuleAttributesType0ConditionsAttributesItemOperator] = UNSET - value: Union[Unset, str] = UNSET - conditionable_type: Union[ - Unset, AlertsSourceResolutionRuleAttributesType0ConditionsAttributesItemConditionableType - ] = UNSET - conditionable_id: Union[None, Unset, str] = UNSET - kind: Union[Unset, AlertsSourceResolutionRuleAttributesType0ConditionsAttributesItemKind] = UNSET + field: None | Unset | str = UNSET + operator: Unset | AlertsSourceResolutionRuleAttributesType0ConditionsAttributesItemOperator = UNSET + value: Unset | str = UNSET + conditionable_type: Unset | AlertsSourceResolutionRuleAttributesType0ConditionsAttributesItemConditionableType = ( + UNSET + ) + conditionable_id: None | Unset | str = UNSET + kind: Unset | AlertsSourceResolutionRuleAttributesType0ConditionsAttributesItemKind = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - field: Union[None, Unset, str] + field: None | Unset | str if isinstance(self.field, Unset): field = UNSET else: field = self.field - operator: Union[Unset, str] = UNSET + operator: Unset | str = UNSET if not isinstance(self.operator, Unset): operator = self.operator value = self.value - conditionable_type: Union[Unset, str] = UNSET + conditionable_type: Unset | str = UNSET if not isinstance(self.conditionable_type, Unset): conditionable_type = self.conditionable_type - conditionable_id: Union[None, Unset, str] + conditionable_id: None | Unset | str if isinstance(self.conditionable_id, Unset): conditionable_id = UNSET else: conditionable_id = self.conditionable_id - kind: Union[Unset, str] = UNSET + kind: Unset | str = UNSET if not isinstance(self.kind, Unset): kind = self.kind @@ -99,17 +99,17 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_field(data: object) -> Union[None, Unset, str]: + def _parse_field(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) field = _parse_field(d.pop("field", UNSET)) _operator = d.pop("operator", UNSET) - operator: Union[Unset, AlertsSourceResolutionRuleAttributesType0ConditionsAttributesItemOperator] + operator: Unset | AlertsSourceResolutionRuleAttributesType0ConditionsAttributesItemOperator if isinstance(_operator, Unset): operator = UNSET else: @@ -120,9 +120,7 @@ def _parse_field(data: object) -> Union[None, Unset, str]: value = d.pop("value", UNSET) _conditionable_type = d.pop("conditionable_type", UNSET) - conditionable_type: Union[ - Unset, AlertsSourceResolutionRuleAttributesType0ConditionsAttributesItemConditionableType - ] + conditionable_type: Unset | AlertsSourceResolutionRuleAttributesType0ConditionsAttributesItemConditionableType if isinstance(_conditionable_type, Unset): conditionable_type = UNSET else: @@ -132,17 +130,17 @@ def _parse_field(data: object) -> Union[None, Unset, str]: ) ) - def _parse_conditionable_id(data: object) -> Union[None, Unset, str]: + def _parse_conditionable_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) conditionable_id = _parse_conditionable_id(d.pop("conditionable_id", UNSET)) _kind = d.pop("kind", UNSET) - kind: Union[Unset, AlertsSourceResolutionRuleAttributesType0ConditionsAttributesItemKind] + kind: Unset | AlertsSourceResolutionRuleAttributesType0ConditionsAttributesItemKind if isinstance(_kind, Unset): kind = UNSET else: diff --git a/rootly_sdk/models/alerts_source_response.py b/rootly_sdk/models/alerts_source_response.py index 7938c6f0..f7e132aa 100644 --- a/rootly_sdk/models/alerts_source_response.py +++ b/rootly_sdk/models/alerts_source_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,13 +23,13 @@ class AlertsSourceResponse: """ data: "AlertsSourceResponseData" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/alerts_source_sourceable_attributes_type_0.py b/rootly_sdk/models/alerts_source_sourceable_attributes_type_0.py index f7bdf054..1c5966d0 100644 --- a/rootly_sdk/models/alerts_source_sourceable_attributes_type_0.py +++ b/rootly_sdk/models/alerts_source_sourceable_attributes_type_0.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from uuid import UUID from attrs import define as _attrs_define @@ -33,23 +33,21 @@ class AlertsSourceSourceableAttributesType0: list['AlertsSourceSourceableAttributesType0FieldMappingsAttributesItem']]): Specify rules to auto resolve alerts """ - id: Union[Unset, UUID] = UNSET - auto_resolve: Union[Unset, bool] = UNSET - resolve_state: Union[None, Unset, str] = UNSET - accept_threaded_emails: Union[Unset, bool] = UNSET - field_mappings_attributes: Union[ - Unset, list["AlertsSourceSourceableAttributesType0FieldMappingsAttributesItem"] - ] = UNSET + id: Unset | UUID = UNSET + auto_resolve: Unset | bool = UNSET + resolve_state: None | Unset | str = UNSET + accept_threaded_emails: Unset | bool = UNSET + field_mappings_attributes: Unset | list["AlertsSourceSourceableAttributesType0FieldMappingsAttributesItem"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id: Union[Unset, str] = UNSET + id: Unset | str = UNSET if not isinstance(self.id, Unset): id = str(self.id) auto_resolve = self.auto_resolve - resolve_state: Union[None, Unset, str] + resolve_state: None | Unset | str if isinstance(self.resolve_state, Unset): resolve_state = UNSET else: @@ -57,7 +55,7 @@ def to_dict(self) -> dict[str, Any]: accept_threaded_emails = self.accept_threaded_emails - field_mappings_attributes: Union[Unset, list[dict[str, Any]]] = UNSET + field_mappings_attributes: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.field_mappings_attributes, Unset): field_mappings_attributes = [] for field_mappings_attributes_item_data in self.field_mappings_attributes: @@ -88,7 +86,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _id = d.pop("id", UNSET) - id: Union[Unset, UUID] + id: Unset | UUID if isinstance(_id, Unset): id = UNSET else: @@ -96,12 +94,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: auto_resolve = d.pop("auto_resolve", UNSET) - def _parse_resolve_state(data: object) -> Union[None, Unset, str]: + def _parse_resolve_state(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) resolve_state = _parse_resolve_state(d.pop("resolve_state", UNSET)) diff --git a/rootly_sdk/models/alerts_source_sourceable_attributes_type_0_field_mappings_attributes_item.py b/rootly_sdk/models/alerts_source_sourceable_attributes_type_0_field_mappings_attributes_item.py index 6f68a4b5..5c28c098 100644 --- a/rootly_sdk/models/alerts_source_sourceable_attributes_type_0_field_mappings_attributes_item.py +++ b/rootly_sdk/models/alerts_source_sourceable_attributes_type_0_field_mappings_attributes_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -24,12 +24,12 @@ class AlertsSourceSourceableAttributesType0FieldMappingsAttributesItem: this may also be a Liquid template that resolves to a notification target id at routing time. """ - field: Union[Unset, AlertsSourceSourceableAttributesType0FieldMappingsAttributesItemField] = UNSET - json_path: Union[Unset, str] = UNSET + field: Unset | AlertsSourceSourceableAttributesType0FieldMappingsAttributesItemField = UNSET + json_path: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - field: Union[Unset, str] = UNSET + field: Unset | str = UNSET if not isinstance(self.field, Unset): field = self.field @@ -49,7 +49,7 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _field = d.pop("field", UNSET) - field: Union[Unset, AlertsSourceSourceableAttributesType0FieldMappingsAttributesItemField] + field: Unset | AlertsSourceSourceableAttributesType0FieldMappingsAttributesItemField if isinstance(_field, Unset): field = UNSET else: diff --git a/rootly_sdk/models/api_key.py b/rootly_sdk/models/api_key.py index c523ec66..8cbe7a1b 100644 --- a/rootly_sdk/models/api_key.py +++ b/rootly_sdk/models/api_key.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -30,12 +30,12 @@ class ApiKey: kind: ApiKeyKind created_at: str updated_at: str - description: Union[None, Unset, str] = UNSET - role_id: Union[None, Unset, str] = UNSET - on_call_role_id: Union[None, Unset, str] = UNSET - expires_at: Union[None, Unset, str] = UNSET - last_used_at: Union[None, Unset, str] = UNSET - grace_period_ends_at: Union[None, Unset, str] = UNSET + description: None | Unset | str = UNSET + role_id: None | Unset | str = UNSET + on_call_role_id: None | Unset | str = UNSET + expires_at: None | Unset | str = UNSET + last_used_at: None | Unset | str = UNSET + grace_period_ends_at: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -47,37 +47,37 @@ def to_dict(self) -> dict[str, Any]: updated_at = self.updated_at - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - role_id: Union[None, Unset, str] + role_id: None | Unset | str if isinstance(self.role_id, Unset): role_id = UNSET else: role_id = self.role_id - on_call_role_id: Union[None, Unset, str] + on_call_role_id: None | Unset | str if isinstance(self.on_call_role_id, Unset): on_call_role_id = UNSET else: on_call_role_id = self.on_call_role_id - expires_at: Union[None, Unset, str] + expires_at: None | Unset | str if isinstance(self.expires_at, Unset): expires_at = UNSET else: expires_at = self.expires_at - last_used_at: Union[None, Unset, str] + last_used_at: None | Unset | str if isinstance(self.last_used_at, Unset): last_used_at = UNSET else: last_used_at = self.last_used_at - grace_period_ends_at: Union[None, Unset, str] + grace_period_ends_at: None | Unset | str if isinstance(self.grace_period_ends_at, Unset): grace_period_ends_at = UNSET else: @@ -119,57 +119,57 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: updated_at = d.pop("updated_at") - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_role_id(data: object) -> Union[None, Unset, str]: + def _parse_role_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) role_id = _parse_role_id(d.pop("role_id", UNSET)) - def _parse_on_call_role_id(data: object) -> Union[None, Unset, str]: + def _parse_on_call_role_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) on_call_role_id = _parse_on_call_role_id(d.pop("on_call_role_id", UNSET)) - def _parse_expires_at(data: object) -> Union[None, Unset, str]: + def _parse_expires_at(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) expires_at = _parse_expires_at(d.pop("expires_at", UNSET)) - def _parse_last_used_at(data: object) -> Union[None, Unset, str]: + def _parse_last_used_at(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) last_used_at = _parse_last_used_at(d.pop("last_used_at", UNSET)) - def _parse_grace_period_ends_at(data: object) -> Union[None, Unset, str]: + def _parse_grace_period_ends_at(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) grace_period_ends_at = _parse_grace_period_ends_at(d.pop("grace_period_ends_at", UNSET)) diff --git a/rootly_sdk/models/api_key_list.py b/rootly_sdk/models/api_key_list.py index 56537d28..a2dab4b9 100644 --- a/rootly_sdk/models/api_key_list.py +++ b/rootly_sdk/models/api_key_list.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,7 +29,7 @@ class ApiKeyList: data: list["ApiKeyListDataItem"] links: "Links" meta: "Meta" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/api_key_response.py b/rootly_sdk/models/api_key_response.py index b9c73373..b9623902 100644 --- a/rootly_sdk/models/api_key_response.py +++ b/rootly_sdk/models/api_key_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,13 +23,13 @@ class ApiKeyResponse: """ data: "ApiKeyResponseData" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/api_key_with_token_response.py b/rootly_sdk/models/api_key_with_token_response.py index fab90172..6621fe08 100644 --- a/rootly_sdk/models/api_key_with_token_response.py +++ b/rootly_sdk/models/api_key_with_token_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,13 +23,13 @@ class ApiKeyWithTokenResponse: """ data: "ApiKeyWithTokenResponseData" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/api_key_with_token_response_data_attributes.py b/rootly_sdk/models/api_key_with_token_response_data_attributes.py index 35f13582..daa23b56 100644 --- a/rootly_sdk/models/api_key_with_token_response_data_attributes.py +++ b/rootly_sdk/models/api_key_with_token_response_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -32,12 +32,12 @@ class ApiKeyWithTokenResponseDataAttributes: created_at: str updated_at: str token: str - description: Union[None, Unset, str] = UNSET - role_id: Union[None, Unset, str] = UNSET - on_call_role_id: Union[None, Unset, str] = UNSET - expires_at: Union[None, Unset, str] = UNSET - last_used_at: Union[None, Unset, str] = UNSET - grace_period_ends_at: Union[None, Unset, str] = UNSET + description: None | Unset | str = UNSET + role_id: None | Unset | str = UNSET + on_call_role_id: None | Unset | str = UNSET + expires_at: None | Unset | str = UNSET + last_used_at: None | Unset | str = UNSET + grace_period_ends_at: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -51,37 +51,37 @@ def to_dict(self) -> dict[str, Any]: token = self.token - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - role_id: Union[None, Unset, str] + role_id: None | Unset | str if isinstance(self.role_id, Unset): role_id = UNSET else: role_id = self.role_id - on_call_role_id: Union[None, Unset, str] + on_call_role_id: None | Unset | str if isinstance(self.on_call_role_id, Unset): on_call_role_id = UNSET else: on_call_role_id = self.on_call_role_id - expires_at: Union[None, Unset, str] + expires_at: None | Unset | str if isinstance(self.expires_at, Unset): expires_at = UNSET else: expires_at = self.expires_at - last_used_at: Union[None, Unset, str] + last_used_at: None | Unset | str if isinstance(self.last_used_at, Unset): last_used_at = UNSET else: last_used_at = self.last_used_at - grace_period_ends_at: Union[None, Unset, str] + grace_period_ends_at: None | Unset | str if isinstance(self.grace_period_ends_at, Unset): grace_period_ends_at = UNSET else: @@ -126,57 +126,57 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: token = d.pop("token") - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_role_id(data: object) -> Union[None, Unset, str]: + def _parse_role_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) role_id = _parse_role_id(d.pop("role_id", UNSET)) - def _parse_on_call_role_id(data: object) -> Union[None, Unset, str]: + def _parse_on_call_role_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) on_call_role_id = _parse_on_call_role_id(d.pop("on_call_role_id", UNSET)) - def _parse_expires_at(data: object) -> Union[None, Unset, str]: + def _parse_expires_at(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) expires_at = _parse_expires_at(d.pop("expires_at", UNSET)) - def _parse_last_used_at(data: object) -> Union[None, Unset, str]: + def _parse_last_used_at(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) last_used_at = _parse_last_used_at(d.pop("last_used_at", UNSET)) - def _parse_grace_period_ends_at(data: object) -> Union[None, Unset, str]: + def _parse_grace_period_ends_at(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) grace_period_ends_at = _parse_grace_period_ends_at(d.pop("grace_period_ends_at", UNSET)) diff --git a/rootly_sdk/models/archive_google_chat_spaces_task_params.py b/rootly_sdk/models/archive_google_chat_spaces_task_params.py index 79ec0c65..fb8c332c 100644 --- a/rootly_sdk/models/archive_google_chat_spaces_task_params.py +++ b/rootly_sdk/models/archive_google_chat_spaces_task_params.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -26,7 +26,7 @@ class ArchiveGoogleChatSpacesTaskParams: """ spaces: list["ArchiveGoogleChatSpacesTaskParamsSpacesItem"] - task_type: Union[Unset, ArchiveGoogleChatSpacesTaskParamsTaskType] = UNSET + task_type: Unset | ArchiveGoogleChatSpacesTaskParamsTaskType = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -35,7 +35,7 @@ def to_dict(self) -> dict[str, Any]: spaces_item = spaces_item_data.to_dict() spaces.append(spaces_item) - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -66,7 +66,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: spaces.append(spaces_item) _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, ArchiveGoogleChatSpacesTaskParamsTaskType] + task_type: Unset | ArchiveGoogleChatSpacesTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/archive_google_chat_spaces_task_params_spaces_item.py b/rootly_sdk/models/archive_google_chat_spaces_task_params_spaces_item.py index 12587f1f..47588364 100644 --- a/rootly_sdk/models/archive_google_chat_spaces_task_params_spaces_item.py +++ b/rootly_sdk/models/archive_google_chat_spaces_task_params_spaces_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class ArchiveGoogleChatSpacesTaskParamsSpacesItem: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/archive_microsoft_teams_channels_task_params.py b/rootly_sdk/models/archive_microsoft_teams_channels_task_params.py index 43bd0dd3..16877c4e 100644 --- a/rootly_sdk/models/archive_microsoft_teams_channels_task_params.py +++ b/rootly_sdk/models/archive_microsoft_teams_channels_task_params.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -31,7 +31,7 @@ class ArchiveMicrosoftTeamsChannelsTaskParams: team: "ArchiveMicrosoftTeamsChannelsTaskParamsTeam" channels: list["ArchiveMicrosoftTeamsChannelsTaskParamsChannelsItem"] - task_type: Union[Unset, ArchiveMicrosoftTeamsChannelsTaskParamsTaskType] = UNSET + task_type: Unset | ArchiveMicrosoftTeamsChannelsTaskParamsTaskType = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: channels_item = channels_item_data.to_dict() channels.append(channels_item) - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -79,7 +79,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: channels.append(channels_item) _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, ArchiveMicrosoftTeamsChannelsTaskParamsTaskType] + task_type: Unset | ArchiveMicrosoftTeamsChannelsTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/archive_microsoft_teams_channels_task_params_channels_item.py b/rootly_sdk/models/archive_microsoft_teams_channels_task_params_channels_item.py index 69fe8347..d22bf87d 100644 --- a/rootly_sdk/models/archive_microsoft_teams_channels_task_params_channels_item.py +++ b/rootly_sdk/models/archive_microsoft_teams_channels_task_params_channels_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class ArchiveMicrosoftTeamsChannelsTaskParamsChannelsItem: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/archive_microsoft_teams_channels_task_params_team.py b/rootly_sdk/models/archive_microsoft_teams_channels_task_params_team.py index c0d28df1..d254639c 100644 --- a/rootly_sdk/models/archive_microsoft_teams_channels_task_params_team.py +++ b/rootly_sdk/models/archive_microsoft_teams_channels_task_params_team.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class ArchiveMicrosoftTeamsChannelsTaskParamsTeam: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/archive_slack_channels_task_params.py b/rootly_sdk/models/archive_slack_channels_task_params.py index 6523b66c..567f8aad 100644 --- a/rootly_sdk/models/archive_slack_channels_task_params.py +++ b/rootly_sdk/models/archive_slack_channels_task_params.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -26,7 +26,7 @@ class ArchiveSlackChannelsTaskParams: """ channels: list["ArchiveSlackChannelsTaskParamsChannelsItem"] - task_type: Union[Unset, ArchiveSlackChannelsTaskParamsTaskType] = UNSET + task_type: Unset | ArchiveSlackChannelsTaskParamsTaskType = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -35,7 +35,7 @@ def to_dict(self) -> dict[str, Any]: channels_item = channels_item_data.to_dict() channels.append(channels_item) - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -64,7 +64,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: channels.append(channels_item) _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, ArchiveSlackChannelsTaskParamsTaskType] + task_type: Unset | ArchiveSlackChannelsTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/archive_slack_channels_task_params_channels_item.py b/rootly_sdk/models/archive_slack_channels_task_params_channels_item.py index aff89e32..61adea9f 100644 --- a/rootly_sdk/models/archive_slack_channels_task_params_channels_item.py +++ b/rootly_sdk/models/archive_slack_channels_task_params_channels_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class ArchiveSlackChannelsTaskParamsChannelsItem: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/assign_role_to_user_data_attributes.py b/rootly_sdk/models/assign_role_to_user_data_attributes.py index 5a8c512e..11b176f1 100644 --- a/rootly_sdk/models/assign_role_to_user_data_attributes.py +++ b/rootly_sdk/models/assign_role_to_user_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define @@ -16,8 +16,8 @@ class AssignRoleToUserDataAttributes: incident_role_id (Union[Unset, str]): ID of the incident role """ - user_id: Union[Unset, str] = UNSET - incident_role_id: Union[Unset, str] = UNSET + user_id: Unset | str = UNSET + incident_role_id: Unset | str = UNSET def to_dict(self) -> dict[str, Any]: user_id = self.user_id diff --git a/rootly_sdk/models/attach_alert_data_attributes.py b/rootly_sdk/models/attach_alert_data_attributes.py index 02c1000d..597f3be9 100644 --- a/rootly_sdk/models/attach_alert_data_attributes.py +++ b/rootly_sdk/models/attach_alert_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -13,10 +13,10 @@ class AttachAlertDataAttributes: alert_ids (Union[None, list[str]]): Alert Id to attach to the incident """ - alert_ids: Union[None, list[str]] + alert_ids: None | list[str] def to_dict(self) -> dict[str, Any]: - alert_ids: Union[None, list[str]] + alert_ids: None | list[str] if isinstance(self.alert_ids, list): alert_ids = self.alert_ids @@ -37,7 +37,7 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_alert_ids(data: object) -> Union[None, list[str]]: + def _parse_alert_ids(data: object) -> None | list[str]: if data is None: return data try: @@ -48,7 +48,7 @@ def _parse_alert_ids(data: object) -> Union[None, list[str]]: return alert_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, list[str]], data) + return cast(None | list[str], data) alert_ids = _parse_alert_ids(d.pop("alert_ids")) diff --git a/rootly_sdk/models/attach_datadog_dashboards_task_params.py b/rootly_sdk/models/attach_datadog_dashboards_task_params.py index 7c874b07..36c3444b 100644 --- a/rootly_sdk/models/attach_datadog_dashboards_task_params.py +++ b/rootly_sdk/models/attach_datadog_dashboards_task_params.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -33,9 +33,9 @@ class AttachDatadogDashboardsTaskParams: """ dashboards: list["AttachDatadogDashboardsTaskParamsDashboardsItem"] - task_type: Union[Unset, AttachDatadogDashboardsTaskParamsTaskType] = UNSET - post_to_incident_timeline: Union[Unset, bool] = UNSET - post_to_slack_channels: Union[Unset, list["AttachDatadogDashboardsTaskParamsPostToSlackChannelsItem"]] = UNSET + task_type: Unset | AttachDatadogDashboardsTaskParamsTaskType = UNSET + post_to_incident_timeline: Unset | bool = UNSET + post_to_slack_channels: Unset | list["AttachDatadogDashboardsTaskParamsPostToSlackChannelsItem"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -44,13 +44,13 @@ def to_dict(self) -> dict[str, Any]: dashboards_item = dashboards_item_data.to_dict() dashboards.append(dashboards_item) - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type post_to_incident_timeline = self.post_to_incident_timeline - post_to_slack_channels: Union[Unset, list[dict[str, Any]]] = UNSET + post_to_slack_channels: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.post_to_slack_channels, Unset): post_to_slack_channels = [] for post_to_slack_channels_item_data in self.post_to_slack_channels: @@ -91,7 +91,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: dashboards.append(dashboards_item) _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, AttachDatadogDashboardsTaskParamsTaskType] + task_type: Unset | AttachDatadogDashboardsTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/attach_datadog_dashboards_task_params_dashboards_item.py b/rootly_sdk/models/attach_datadog_dashboards_task_params_dashboards_item.py index 690ccc5d..7921c70f 100644 --- a/rootly_sdk/models/attach_datadog_dashboards_task_params_dashboards_item.py +++ b/rootly_sdk/models/attach_datadog_dashboards_task_params_dashboards_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class AttachDatadogDashboardsTaskParamsDashboardsItem: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/attach_datadog_dashboards_task_params_post_to_slack_channels_item.py b/rootly_sdk/models/attach_datadog_dashboards_task_params_post_to_slack_channels_item.py index 53c9bad1..cb588b97 100644 --- a/rootly_sdk/models/attach_datadog_dashboards_task_params_post_to_slack_channels_item.py +++ b/rootly_sdk/models/attach_datadog_dashboards_task_params_post_to_slack_channels_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class AttachDatadogDashboardsTaskParamsPostToSlackChannelsItem: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/attach_retrospective_pdf_to_freshservice_ticket_task_params.py b/rootly_sdk/models/attach_retrospective_pdf_to_freshservice_ticket_task_params.py index c80b4ce2..f9fd95ed 100644 --- a/rootly_sdk/models/attach_retrospective_pdf_to_freshservice_ticket_task_params.py +++ b/rootly_sdk/models/attach_retrospective_pdf_to_freshservice_ticket_task_params.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,14 +23,14 @@ class AttachRetrospectivePdfToFreshserviceTicketTaskParams: """ ticket_id: str - task_type: Union[Unset, AttachRetrospectivePdfToFreshserviceTicketTaskParamsTaskType] = UNSET - filename: Union[Unset, str] = UNSET + task_type: Unset | AttachRetrospectivePdfToFreshserviceTicketTaskParamsTaskType = UNSET + filename: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: ticket_id = self.ticket_id - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -56,7 +56,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: ticket_id = d.pop("ticket_id") _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, AttachRetrospectivePdfToFreshserviceTicketTaskParamsTaskType] + task_type: Unset | AttachRetrospectivePdfToFreshserviceTicketTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/attach_retrospective_pdf_to_jira_issue_task_params.py b/rootly_sdk/models/attach_retrospective_pdf_to_jira_issue_task_params.py index 63d006ec..5f0d7787 100644 --- a/rootly_sdk/models/attach_retrospective_pdf_to_jira_issue_task_params.py +++ b/rootly_sdk/models/attach_retrospective_pdf_to_jira_issue_task_params.py @@ -31,19 +31,19 @@ class AttachRetrospectivePdfToJiraIssueTaskParams: """ issue_id: str - task_type: Union[Unset, AttachRetrospectivePdfToJiraIssueTaskParamsTaskType] = UNSET + task_type: Unset | AttachRetrospectivePdfToJiraIssueTaskParamsTaskType = UNSET integration: Union[Unset, "AttachRetrospectivePdfToJiraIssueTaskParamsIntegration"] = UNSET - filename: Union[Unset, str] = UNSET + filename: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: issue_id = self.issue_id - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - integration: Union[Unset, dict[str, Any]] = UNSET + integration: Unset | dict[str, Any] = UNSET if not isinstance(self.integration, Unset): integration = self.integration.to_dict() @@ -75,14 +75,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: issue_id = d.pop("issue_id") _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, AttachRetrospectivePdfToJiraIssueTaskParamsTaskType] + task_type: Unset | AttachRetrospectivePdfToJiraIssueTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: task_type = check_attach_retrospective_pdf_to_jira_issue_task_params_task_type(_task_type) _integration = d.pop("integration", UNSET) - integration: Union[Unset, AttachRetrospectivePdfToJiraIssueTaskParamsIntegration] + integration: Unset | AttachRetrospectivePdfToJiraIssueTaskParamsIntegration if isinstance(_integration, Unset): integration = UNSET else: diff --git a/rootly_sdk/models/attach_retrospective_pdf_to_jira_issue_task_params_integration.py b/rootly_sdk/models/attach_retrospective_pdf_to_jira_issue_task_params_integration.py index 92deaba2..e4aec1c4 100644 --- a/rootly_sdk/models/attach_retrospective_pdf_to_jira_issue_task_params_integration.py +++ b/rootly_sdk/models/attach_retrospective_pdf_to_jira_issue_task_params_integration.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -18,8 +18,8 @@ class AttachRetrospectivePdfToJiraIssueTaskParamsIntegration: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/audit.py b/rootly_sdk/models/audit.py index a5c31508..ec4864a5 100644 --- a/rootly_sdk/models/audit.py +++ b/rootly_sdk/models/audit.py @@ -40,19 +40,19 @@ class Audit: event: str created_at: str - item_type: Union[Unset, AuditItemType] = UNSET - item_type_display: Union[None, Unset, str] = UNSET + item_type: Unset | AuditItemType = UNSET + item_type_display: None | Unset | str = UNSET object_: Union["AuditObjectType0", None, Unset] = UNSET object_changes: Union["AuditObjectChangesType0", None, Unset] = UNSET - user_id: Union[None, Unset, int] = UNSET - user_name: Union[None, Unset, str] = UNSET - user_email: Union[None, Unset, str] = UNSET - ip_address: Union[None, Unset, str] = UNSET - user_agent: Union[None, Unset, str] = UNSET - request_id: Union[None, Unset, str] = UNSET - session_id: Union[None, Unset, str] = UNSET - item_id: Union[None, Unset, str] = UNSET - id: Union[None, Unset, int] = UNSET + user_id: None | Unset | int = UNSET + user_name: None | Unset | str = UNSET + user_email: None | Unset | str = UNSET + ip_address: None | Unset | str = UNSET + user_agent: None | Unset | str = UNSET + request_id: None | Unset | str = UNSET + session_id: None | Unset | str = UNSET + item_id: None | Unset | str = UNSET + id: None | Unset | int = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -63,17 +63,17 @@ def to_dict(self) -> dict[str, Any]: created_at = self.created_at - item_type: Union[Unset, str] = UNSET + item_type: Unset | str = UNSET if not isinstance(self.item_type, Unset): item_type = self.item_type - item_type_display: Union[None, Unset, str] + item_type_display: None | Unset | str if isinstance(self.item_type_display, Unset): item_type_display = UNSET else: item_type_display = self.item_type_display - object_: Union[None, Unset, dict[str, Any]] + object_: None | Unset | dict[str, Any] if isinstance(self.object_, Unset): object_ = UNSET elif isinstance(self.object_, AuditObjectType0): @@ -81,7 +81,7 @@ def to_dict(self) -> dict[str, Any]: else: object_ = self.object_ - object_changes: Union[None, Unset, dict[str, Any]] + object_changes: None | Unset | dict[str, Any] if isinstance(self.object_changes, Unset): object_changes = UNSET elif isinstance(self.object_changes, AuditObjectChangesType0): @@ -89,55 +89,55 @@ def to_dict(self) -> dict[str, Any]: else: object_changes = self.object_changes - user_id: Union[None, Unset, int] + user_id: None | Unset | int if isinstance(self.user_id, Unset): user_id = UNSET else: user_id = self.user_id - user_name: Union[None, Unset, str] + user_name: None | Unset | str if isinstance(self.user_name, Unset): user_name = UNSET else: user_name = self.user_name - user_email: Union[None, Unset, str] + user_email: None | Unset | str if isinstance(self.user_email, Unset): user_email = UNSET else: user_email = self.user_email - ip_address: Union[None, Unset, str] + ip_address: None | Unset | str if isinstance(self.ip_address, Unset): ip_address = UNSET else: ip_address = self.ip_address - user_agent: Union[None, Unset, str] + user_agent: None | Unset | str if isinstance(self.user_agent, Unset): user_agent = UNSET else: user_agent = self.user_agent - request_id: Union[None, Unset, str] + request_id: None | Unset | str if isinstance(self.request_id, Unset): request_id = UNSET else: request_id = self.request_id - session_id: Union[None, Unset, str] + session_id: None | Unset | str if isinstance(self.session_id, Unset): session_id = UNSET else: session_id = self.session_id - item_id: Union[None, Unset, str] + item_id: None | Unset | str if isinstance(self.item_id, Unset): item_id = UNSET else: item_id = self.item_id - id: Union[None, Unset, int] + id: None | Unset | int if isinstance(self.id, Unset): id = UNSET else: @@ -191,18 +191,18 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: created_at = d.pop("created_at") _item_type = d.pop("item_type", UNSET) - item_type: Union[Unset, AuditItemType] + item_type: Unset | AuditItemType if isinstance(_item_type, Unset): item_type = UNSET else: item_type = check_audit_item_type(_item_type) - def _parse_item_type_display(data: object) -> Union[None, Unset, str]: + def _parse_item_type_display(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) item_type_display = _parse_item_type_display(d.pop("item_type_display", UNSET)) @@ -240,84 +240,84 @@ def _parse_object_changes(data: object) -> Union["AuditObjectChangesType0", None object_changes = _parse_object_changes(d.pop("object_changes", UNSET)) - def _parse_user_id(data: object) -> Union[None, Unset, int]: + def _parse_user_id(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) user_id = _parse_user_id(d.pop("user_id", UNSET)) - def _parse_user_name(data: object) -> Union[None, Unset, str]: + def _parse_user_name(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) user_name = _parse_user_name(d.pop("user_name", UNSET)) - def _parse_user_email(data: object) -> Union[None, Unset, str]: + def _parse_user_email(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) user_email = _parse_user_email(d.pop("user_email", UNSET)) - def _parse_ip_address(data: object) -> Union[None, Unset, str]: + def _parse_ip_address(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) ip_address = _parse_ip_address(d.pop("ip_address", UNSET)) - def _parse_user_agent(data: object) -> Union[None, Unset, str]: + def _parse_user_agent(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) user_agent = _parse_user_agent(d.pop("user_agent", UNSET)) - def _parse_request_id(data: object) -> Union[None, Unset, str]: + def _parse_request_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) request_id = _parse_request_id(d.pop("request_id", UNSET)) - def _parse_session_id(data: object) -> Union[None, Unset, str]: + def _parse_session_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) session_id = _parse_session_id(d.pop("session_id", UNSET)) - def _parse_item_id(data: object) -> Union[None, Unset, str]: + def _parse_item_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) item_id = _parse_item_id(d.pop("item_id", UNSET)) - def _parse_id(data: object) -> Union[None, Unset, int]: + def _parse_id(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) id = _parse_id(d.pop("id", UNSET)) diff --git a/rootly_sdk/models/audits_list.py b/rootly_sdk/models/audits_list.py index 9b1c234d..bd5ffb11 100644 --- a/rootly_sdk/models/audits_list.py +++ b/rootly_sdk/models/audits_list.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,7 +29,7 @@ class AuditsList: data: list["AuditsListDataItem"] links: "Links" meta: "Meta" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/authorization_list.py b/rootly_sdk/models/authorization_list.py index d003cf14..fa0df65d 100644 --- a/rootly_sdk/models/authorization_list.py +++ b/rootly_sdk/models/authorization_list.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,7 +29,7 @@ class AuthorizationList: data: list["AuthorizationListDataItem"] links: "Links" meta: "Meta" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/authorization_response.py b/rootly_sdk/models/authorization_response.py index a49c86fe..0141ff5a 100644 --- a/rootly_sdk/models/authorization_response.py +++ b/rootly_sdk/models/authorization_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,13 +23,13 @@ class AuthorizationResponse: """ data: "AuthorizationResponseData" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/auto_assign_role_opsgenie_task_params.py b/rootly_sdk/models/auto_assign_role_opsgenie_task_params.py index cb11e3aa..7180c666 100644 --- a/rootly_sdk/models/auto_assign_role_opsgenie_task_params.py +++ b/rootly_sdk/models/auto_assign_role_opsgenie_task_params.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -28,7 +28,7 @@ class AutoAssignRoleOpsgenieTaskParams: incident_role_id: str schedule: "AutoAssignRoleOpsgenieTaskParamsSchedule" - task_type: Union[Unset, AutoAssignRoleOpsgenieTaskParamsTaskType] = UNSET + task_type: Unset | AutoAssignRoleOpsgenieTaskParamsTaskType = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -36,7 +36,7 @@ def to_dict(self) -> dict[str, Any]: schedule = self.schedule.to_dict() - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -63,7 +63,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: schedule = AutoAssignRoleOpsgenieTaskParamsSchedule.from_dict(d.pop("schedule")) _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, AutoAssignRoleOpsgenieTaskParamsTaskType] + task_type: Unset | AutoAssignRoleOpsgenieTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/auto_assign_role_opsgenie_task_params_schedule.py b/rootly_sdk/models/auto_assign_role_opsgenie_task_params_schedule.py index c5d5fbb2..f56df6a9 100644 --- a/rootly_sdk/models/auto_assign_role_opsgenie_task_params_schedule.py +++ b/rootly_sdk/models/auto_assign_role_opsgenie_task_params_schedule.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class AutoAssignRoleOpsgenieTaskParamsSchedule: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/auto_assign_role_pagerduty_task_params_type_0_schedule.py b/rootly_sdk/models/auto_assign_role_pagerduty_task_params_type_0_schedule.py index 9d5ae5c1..4b18a5dd 100644 --- a/rootly_sdk/models/auto_assign_role_pagerduty_task_params_type_0_schedule.py +++ b/rootly_sdk/models/auto_assign_role_pagerduty_task_params_type_0_schedule.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class AutoAssignRolePagerdutyTaskParamsType0Schedule: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/auto_assign_role_pagerduty_task_params_type_1_escalation_policy.py b/rootly_sdk/models/auto_assign_role_pagerduty_task_params_type_1_escalation_policy.py index 33870a7e..31768832 100644 --- a/rootly_sdk/models/auto_assign_role_pagerduty_task_params_type_1_escalation_policy.py +++ b/rootly_sdk/models/auto_assign_role_pagerduty_task_params_type_1_escalation_policy.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class AutoAssignRolePagerdutyTaskParamsType1EscalationPolicy: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/auto_assign_role_rootly_task_params_type_0_escalation_policy_target.py b/rootly_sdk/models/auto_assign_role_rootly_task_params_type_0_escalation_policy_target.py index 328eb935..04e6e1a3 100644 --- a/rootly_sdk/models/auto_assign_role_rootly_task_params_type_0_escalation_policy_target.py +++ b/rootly_sdk/models/auto_assign_role_rootly_task_params_type_0_escalation_policy_target.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class AutoAssignRoleRootlyTaskParamsType0EscalationPolicyTarget: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/auto_assign_role_rootly_task_params_type_1_service_target.py b/rootly_sdk/models/auto_assign_role_rootly_task_params_type_1_service_target.py index b32ca81a..04743c81 100644 --- a/rootly_sdk/models/auto_assign_role_rootly_task_params_type_1_service_target.py +++ b/rootly_sdk/models/auto_assign_role_rootly_task_params_type_1_service_target.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class AutoAssignRoleRootlyTaskParamsType1ServiceTarget: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/auto_assign_role_rootly_task_params_type_2_user_target.py b/rootly_sdk/models/auto_assign_role_rootly_task_params_type_2_user_target.py index d9158122..66331d25 100644 --- a/rootly_sdk/models/auto_assign_role_rootly_task_params_type_2_user_target.py +++ b/rootly_sdk/models/auto_assign_role_rootly_task_params_type_2_user_target.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class AutoAssignRoleRootlyTaskParamsType2UserTarget: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/auto_assign_role_rootly_task_params_type_3_group_target.py b/rootly_sdk/models/auto_assign_role_rootly_task_params_type_3_group_target.py index 59787f53..9e506c67 100644 --- a/rootly_sdk/models/auto_assign_role_rootly_task_params_type_3_group_target.py +++ b/rootly_sdk/models/auto_assign_role_rootly_task_params_type_3_group_target.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class AutoAssignRoleRootlyTaskParamsType3GroupTarget: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/auto_assign_role_rootly_task_params_type_4_schedule_target.py b/rootly_sdk/models/auto_assign_role_rootly_task_params_type_4_schedule_target.py index 118daeb3..8d1f180b 100644 --- a/rootly_sdk/models/auto_assign_role_rootly_task_params_type_4_schedule_target.py +++ b/rootly_sdk/models/auto_assign_role_rootly_task_params_type_4_schedule_target.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class AutoAssignRoleRootlyTaskParamsType4ScheduleTarget: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/auto_assign_role_victor_ops_task_params.py b/rootly_sdk/models/auto_assign_role_victor_ops_task_params.py index 891f9496..6071ebbb 100644 --- a/rootly_sdk/models/auto_assign_role_victor_ops_task_params.py +++ b/rootly_sdk/models/auto_assign_role_victor_ops_task_params.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -28,7 +28,7 @@ class AutoAssignRoleVictorOpsTaskParams: incident_role_id: str team: "AutoAssignRoleVictorOpsTaskParamsTeam" - task_type: Union[Unset, AutoAssignRoleVictorOpsTaskParamsTaskType] = UNSET + task_type: Unset | AutoAssignRoleVictorOpsTaskParamsTaskType = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -36,7 +36,7 @@ def to_dict(self) -> dict[str, Any]: team = self.team.to_dict() - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -63,7 +63,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: team = AutoAssignRoleVictorOpsTaskParamsTeam.from_dict(d.pop("team")) _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, AutoAssignRoleVictorOpsTaskParamsTaskType] + task_type: Unset | AutoAssignRoleVictorOpsTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/auto_assign_role_victor_ops_task_params_team.py b/rootly_sdk/models/auto_assign_role_victor_ops_task_params_team.py index 0a4ccc60..c4a051fe 100644 --- a/rootly_sdk/models/auto_assign_role_victor_ops_task_params_team.py +++ b/rootly_sdk/models/auto_assign_role_victor_ops_task_params_team.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class AutoAssignRoleVictorOpsTaskParamsTeam: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/bulk_destroy_catalog_entities_response.py b/rootly_sdk/models/bulk_destroy_catalog_entities_response.py index 06225dc0..f2809ade 100644 --- a/rootly_sdk/models/bulk_destroy_catalog_entities_response.py +++ b/rootly_sdk/models/bulk_destroy_catalog_entities_response.py @@ -24,7 +24,7 @@ class BulkDestroyCatalogEntitiesResponse: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data: Union[Unset, dict[str, Any]] = UNSET + data: Unset | dict[str, Any] = UNSET if not isinstance(self.data, Unset): data = self.data.to_dict() @@ -42,7 +42,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _data = d.pop("data", UNSET) - data: Union[Unset, BulkDestroyCatalogEntitiesResponseData] + data: Unset | BulkDestroyCatalogEntitiesResponseData if isinstance(_data, Unset): data = UNSET else: diff --git a/rootly_sdk/models/bulk_destroy_catalog_entities_response_data.py b/rootly_sdk/models/bulk_destroy_catalog_entities_response_data.py index df606e58..485f2e1c 100644 --- a/rootly_sdk/models/bulk_destroy_catalog_entities_response_data.py +++ b/rootly_sdk/models/bulk_destroy_catalog_entities_response_data.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -20,21 +20,21 @@ class BulkDestroyCatalogEntitiesResponseData: caller (external_ids mode only) """ - deleted_external_ids: Union[Unset, list[str]] = UNSET - failed_external_ids: Union[Unset, list[str]] = UNSET - not_found_external_ids: Union[Unset, list[str]] = UNSET + deleted_external_ids: Unset | list[str] = UNSET + failed_external_ids: Unset | list[str] = UNSET + not_found_external_ids: Unset | list[str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - deleted_external_ids: Union[Unset, list[str]] = UNSET + deleted_external_ids: Unset | list[str] = UNSET if not isinstance(self.deleted_external_ids, Unset): deleted_external_ids = self.deleted_external_ids - failed_external_ids: Union[Unset, list[str]] = UNSET + failed_external_ids: Unset | list[str] = UNSET if not isinstance(self.failed_external_ids, Unset): failed_external_ids = self.failed_external_ids - not_found_external_ids: Union[Unset, list[str]] = UNSET + not_found_external_ids: Unset | list[str] = UNSET if not isinstance(self.not_found_external_ids, Unset): not_found_external_ids = self.not_found_external_ids diff --git a/rootly_sdk/models/bulk_destroy_catalog_entities_type_1.py b/rootly_sdk/models/bulk_destroy_catalog_entities_type_1.py index 4c183bd5..2c7aee2f 100644 --- a/rootly_sdk/models/bulk_destroy_catalog_entities_type_1.py +++ b/rootly_sdk/models/bulk_destroy_catalog_entities_type_1.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -22,12 +22,12 @@ class BulkDestroyCatalogEntitiesType1: """ managed_by: BulkDestroyCatalogEntitiesType1ManagedBy - keep_external_ids: Union[Unset, list[str]] = UNSET + keep_external_ids: Unset | list[str] = UNSET def to_dict(self) -> dict[str, Any]: managed_by: str = self.managed_by - keep_external_ids: Union[Unset, list[str]] = UNSET + keep_external_ids: Unset | list[str] = UNSET if not isinstance(self.keep_external_ids, Unset): keep_external_ids = self.keep_external_ids diff --git a/rootly_sdk/models/bulk_destroy_environments_response.py b/rootly_sdk/models/bulk_destroy_environments_response.py index b3475244..44391875 100644 --- a/rootly_sdk/models/bulk_destroy_environments_response.py +++ b/rootly_sdk/models/bulk_destroy_environments_response.py @@ -24,7 +24,7 @@ class BulkDestroyEnvironmentsResponse: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data: Union[Unset, dict[str, Any]] = UNSET + data: Unset | dict[str, Any] = UNSET if not isinstance(self.data, Unset): data = self.data.to_dict() @@ -42,7 +42,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _data = d.pop("data", UNSET) - data: Union[Unset, BulkDestroyEnvironmentsResponseData] + data: Unset | BulkDestroyEnvironmentsResponseData if isinstance(_data, Unset): data = UNSET else: diff --git a/rootly_sdk/models/bulk_destroy_environments_response_data.py b/rootly_sdk/models/bulk_destroy_environments_response_data.py index b23b194a..35713f90 100644 --- a/rootly_sdk/models/bulk_destroy_environments_response_data.py +++ b/rootly_sdk/models/bulk_destroy_environments_response_data.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -20,21 +20,21 @@ class BulkDestroyEnvironmentsResponseData: caller (external_ids mode only) """ - deleted_external_ids: Union[Unset, list[str]] = UNSET - failed_external_ids: Union[Unset, list[str]] = UNSET - not_found_external_ids: Union[Unset, list[str]] = UNSET + deleted_external_ids: Unset | list[str] = UNSET + failed_external_ids: Unset | list[str] = UNSET + not_found_external_ids: Unset | list[str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - deleted_external_ids: Union[Unset, list[str]] = UNSET + deleted_external_ids: Unset | list[str] = UNSET if not isinstance(self.deleted_external_ids, Unset): deleted_external_ids = self.deleted_external_ids - failed_external_ids: Union[Unset, list[str]] = UNSET + failed_external_ids: Unset | list[str] = UNSET if not isinstance(self.failed_external_ids, Unset): failed_external_ids = self.failed_external_ids - not_found_external_ids: Union[Unset, list[str]] = UNSET + not_found_external_ids: Unset | list[str] = UNSET if not isinstance(self.not_found_external_ids, Unset): not_found_external_ids = self.not_found_external_ids diff --git a/rootly_sdk/models/bulk_destroy_environments_type_1.py b/rootly_sdk/models/bulk_destroy_environments_type_1.py index 5d19873a..20b4d2bc 100644 --- a/rootly_sdk/models/bulk_destroy_environments_type_1.py +++ b/rootly_sdk/models/bulk_destroy_environments_type_1.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -22,12 +22,12 @@ class BulkDestroyEnvironmentsType1: """ managed_by: BulkDestroyEnvironmentsType1ManagedBy - keep_external_ids: Union[Unset, list[str]] = UNSET + keep_external_ids: Unset | list[str] = UNSET def to_dict(self) -> dict[str, Any]: managed_by: str = self.managed_by - keep_external_ids: Union[Unset, list[str]] = UNSET + keep_external_ids: Unset | list[str] = UNSET if not isinstance(self.keep_external_ids, Unset): keep_external_ids = self.keep_external_ids diff --git a/rootly_sdk/models/bulk_destroy_functionalities_response.py b/rootly_sdk/models/bulk_destroy_functionalities_response.py index 38a37676..305b6c0c 100644 --- a/rootly_sdk/models/bulk_destroy_functionalities_response.py +++ b/rootly_sdk/models/bulk_destroy_functionalities_response.py @@ -24,7 +24,7 @@ class BulkDestroyFunctionalitiesResponse: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data: Union[Unset, dict[str, Any]] = UNSET + data: Unset | dict[str, Any] = UNSET if not isinstance(self.data, Unset): data = self.data.to_dict() @@ -42,7 +42,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _data = d.pop("data", UNSET) - data: Union[Unset, BulkDestroyFunctionalitiesResponseData] + data: Unset | BulkDestroyFunctionalitiesResponseData if isinstance(_data, Unset): data = UNSET else: diff --git a/rootly_sdk/models/bulk_destroy_functionalities_response_data.py b/rootly_sdk/models/bulk_destroy_functionalities_response_data.py index e8b6710d..983b7e64 100644 --- a/rootly_sdk/models/bulk_destroy_functionalities_response_data.py +++ b/rootly_sdk/models/bulk_destroy_functionalities_response_data.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -20,21 +20,21 @@ class BulkDestroyFunctionalitiesResponseData: caller (external_ids mode only) """ - deleted_external_ids: Union[Unset, list[str]] = UNSET - failed_external_ids: Union[Unset, list[str]] = UNSET - not_found_external_ids: Union[Unset, list[str]] = UNSET + deleted_external_ids: Unset | list[str] = UNSET + failed_external_ids: Unset | list[str] = UNSET + not_found_external_ids: Unset | list[str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - deleted_external_ids: Union[Unset, list[str]] = UNSET + deleted_external_ids: Unset | list[str] = UNSET if not isinstance(self.deleted_external_ids, Unset): deleted_external_ids = self.deleted_external_ids - failed_external_ids: Union[Unset, list[str]] = UNSET + failed_external_ids: Unset | list[str] = UNSET if not isinstance(self.failed_external_ids, Unset): failed_external_ids = self.failed_external_ids - not_found_external_ids: Union[Unset, list[str]] = UNSET + not_found_external_ids: Unset | list[str] = UNSET if not isinstance(self.not_found_external_ids, Unset): not_found_external_ids = self.not_found_external_ids diff --git a/rootly_sdk/models/bulk_destroy_functionalities_type_1.py b/rootly_sdk/models/bulk_destroy_functionalities_type_1.py index 10205358..e68f7239 100644 --- a/rootly_sdk/models/bulk_destroy_functionalities_type_1.py +++ b/rootly_sdk/models/bulk_destroy_functionalities_type_1.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -22,12 +22,12 @@ class BulkDestroyFunctionalitiesType1: """ managed_by: BulkDestroyFunctionalitiesType1ManagedBy - keep_external_ids: Union[Unset, list[str]] = UNSET + keep_external_ids: Unset | list[str] = UNSET def to_dict(self) -> dict[str, Any]: managed_by: str = self.managed_by - keep_external_ids: Union[Unset, list[str]] = UNSET + keep_external_ids: Unset | list[str] = UNSET if not isinstance(self.keep_external_ids, Unset): keep_external_ids = self.keep_external_ids diff --git a/rootly_sdk/models/bulk_destroy_services_response.py b/rootly_sdk/models/bulk_destroy_services_response.py index b9348c07..af591752 100644 --- a/rootly_sdk/models/bulk_destroy_services_response.py +++ b/rootly_sdk/models/bulk_destroy_services_response.py @@ -24,7 +24,7 @@ class BulkDestroyServicesResponse: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data: Union[Unset, dict[str, Any]] = UNSET + data: Unset | dict[str, Any] = UNSET if not isinstance(self.data, Unset): data = self.data.to_dict() @@ -42,7 +42,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _data = d.pop("data", UNSET) - data: Union[Unset, BulkDestroyServicesResponseData] + data: Unset | BulkDestroyServicesResponseData if isinstance(_data, Unset): data = UNSET else: diff --git a/rootly_sdk/models/bulk_destroy_services_response_data.py b/rootly_sdk/models/bulk_destroy_services_response_data.py index 70a59148..d5cf813f 100644 --- a/rootly_sdk/models/bulk_destroy_services_response_data.py +++ b/rootly_sdk/models/bulk_destroy_services_response_data.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -20,21 +20,21 @@ class BulkDestroyServicesResponseData: caller (external_ids mode only) """ - deleted_external_ids: Union[Unset, list[str]] = UNSET - failed_external_ids: Union[Unset, list[str]] = UNSET - not_found_external_ids: Union[Unset, list[str]] = UNSET + deleted_external_ids: Unset | list[str] = UNSET + failed_external_ids: Unset | list[str] = UNSET + not_found_external_ids: Unset | list[str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - deleted_external_ids: Union[Unset, list[str]] = UNSET + deleted_external_ids: Unset | list[str] = UNSET if not isinstance(self.deleted_external_ids, Unset): deleted_external_ids = self.deleted_external_ids - failed_external_ids: Union[Unset, list[str]] = UNSET + failed_external_ids: Unset | list[str] = UNSET if not isinstance(self.failed_external_ids, Unset): failed_external_ids = self.failed_external_ids - not_found_external_ids: Union[Unset, list[str]] = UNSET + not_found_external_ids: Unset | list[str] = UNSET if not isinstance(self.not_found_external_ids, Unset): not_found_external_ids = self.not_found_external_ids diff --git a/rootly_sdk/models/bulk_destroy_services_type_1.py b/rootly_sdk/models/bulk_destroy_services_type_1.py index 59c00e42..7a8c0fc9 100644 --- a/rootly_sdk/models/bulk_destroy_services_type_1.py +++ b/rootly_sdk/models/bulk_destroy_services_type_1.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -22,12 +22,12 @@ class BulkDestroyServicesType1: """ managed_by: BulkDestroyServicesType1ManagedBy - keep_external_ids: Union[Unset, list[str]] = UNSET + keep_external_ids: Unset | list[str] = UNSET def to_dict(self) -> dict[str, Any]: managed_by: str = self.managed_by - keep_external_ids: Union[Unset, list[str]] = UNSET + keep_external_ids: Unset | list[str] = UNSET if not isinstance(self.keep_external_ids, Unset): keep_external_ids = self.keep_external_ids diff --git a/rootly_sdk/models/bulk_destroy_teams_response.py b/rootly_sdk/models/bulk_destroy_teams_response.py index 87765807..70a1bda4 100644 --- a/rootly_sdk/models/bulk_destroy_teams_response.py +++ b/rootly_sdk/models/bulk_destroy_teams_response.py @@ -24,7 +24,7 @@ class BulkDestroyTeamsResponse: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data: Union[Unset, dict[str, Any]] = UNSET + data: Unset | dict[str, Any] = UNSET if not isinstance(self.data, Unset): data = self.data.to_dict() @@ -42,7 +42,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _data = d.pop("data", UNSET) - data: Union[Unset, BulkDestroyTeamsResponseData] + data: Unset | BulkDestroyTeamsResponseData if isinstance(_data, Unset): data = UNSET else: diff --git a/rootly_sdk/models/bulk_destroy_teams_response_data.py b/rootly_sdk/models/bulk_destroy_teams_response_data.py index cf1bdc7c..619fd269 100644 --- a/rootly_sdk/models/bulk_destroy_teams_response_data.py +++ b/rootly_sdk/models/bulk_destroy_teams_response_data.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -20,21 +20,21 @@ class BulkDestroyTeamsResponseData: caller (external_ids mode only) """ - deleted_external_ids: Union[Unset, list[str]] = UNSET - failed_external_ids: Union[Unset, list[str]] = UNSET - not_found_external_ids: Union[Unset, list[str]] = UNSET + deleted_external_ids: Unset | list[str] = UNSET + failed_external_ids: Unset | list[str] = UNSET + not_found_external_ids: Unset | list[str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - deleted_external_ids: Union[Unset, list[str]] = UNSET + deleted_external_ids: Unset | list[str] = UNSET if not isinstance(self.deleted_external_ids, Unset): deleted_external_ids = self.deleted_external_ids - failed_external_ids: Union[Unset, list[str]] = UNSET + failed_external_ids: Unset | list[str] = UNSET if not isinstance(self.failed_external_ids, Unset): failed_external_ids = self.failed_external_ids - not_found_external_ids: Union[Unset, list[str]] = UNSET + not_found_external_ids: Unset | list[str] = UNSET if not isinstance(self.not_found_external_ids, Unset): not_found_external_ids = self.not_found_external_ids diff --git a/rootly_sdk/models/bulk_destroy_teams_type_1.py b/rootly_sdk/models/bulk_destroy_teams_type_1.py index 669bc888..4063f4b2 100644 --- a/rootly_sdk/models/bulk_destroy_teams_type_1.py +++ b/rootly_sdk/models/bulk_destroy_teams_type_1.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -22,12 +22,12 @@ class BulkDestroyTeamsType1: """ managed_by: BulkDestroyTeamsType1ManagedBy - keep_external_ids: Union[Unset, list[str]] = UNSET + keep_external_ids: Unset | list[str] = UNSET def to_dict(self) -> dict[str, Any]: managed_by: str = self.managed_by - keep_external_ids: Union[Unset, list[str]] = UNSET + keep_external_ids: Unset | list[str] = UNSET if not isinstance(self.keep_external_ids, Unset): keep_external_ids = self.keep_external_ids diff --git a/rootly_sdk/models/bulk_upsert_catalog_entities_entities_item.py b/rootly_sdk/models/bulk_upsert_catalog_entities_entities_item.py index 5631b154..4e8ecc10 100644 --- a/rootly_sdk/models/bulk_upsert_catalog_entities_entities_item.py +++ b/rootly_sdk/models/bulk_upsert_catalog_entities_entities_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -30,11 +30,11 @@ class BulkUpsertCatalogEntitiesEntitiesItem: """ external_id: str - name: Union[Unset, str] = UNSET - description: Union[None, Unset, str] = UNSET - public_description: Union[None, Unset, str] = UNSET - backstage_id: Union[None, Unset, str] = UNSET - fields: Union[Unset, list["BulkUpsertCatalogEntitiesEntitiesItemFieldsItem"]] = UNSET + name: Unset | str = UNSET + description: None | Unset | str = UNSET + public_description: None | Unset | str = UNSET + backstage_id: None | Unset | str = UNSET + fields: Unset | list["BulkUpsertCatalogEntitiesEntitiesItemFieldsItem"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,25 +42,25 @@ def to_dict(self) -> dict[str, Any]: name = self.name - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - public_description: Union[None, Unset, str] + public_description: None | Unset | str if isinstance(self.public_description, Unset): public_description = UNSET else: public_description = self.public_description - backstage_id: Union[None, Unset, str] + backstage_id: None | Unset | str if isinstance(self.backstage_id, Unset): backstage_id = UNSET else: backstage_id = self.backstage_id - fields: Union[Unset, list[dict[str, Any]]] = UNSET + fields: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.fields, Unset): fields = [] for fields_item_data in self.fields: @@ -98,30 +98,30 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name = d.pop("name", UNSET) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_public_description(data: object) -> Union[None, Unset, str]: + def _parse_public_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) public_description = _parse_public_description(d.pop("public_description", UNSET)) - def _parse_backstage_id(data: object) -> Union[None, Unset, str]: + def _parse_backstage_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) backstage_id = _parse_backstage_id(d.pop("backstage_id", UNSET)) diff --git a/rootly_sdk/models/bulk_upsert_catalog_entities_entities_item_fields_item.py b/rootly_sdk/models/bulk_upsert_catalog_entities_entities_item_fields_item.py index 4ebdd271..98503dc3 100644 --- a/rootly_sdk/models/bulk_upsert_catalog_entities_entities_item_fields_item.py +++ b/rootly_sdk/models/bulk_upsert_catalog_entities_entities_item_fields_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,8 +21,8 @@ class BulkUpsertCatalogEntitiesEntitiesItemFieldsItem: """ value: str - catalog_field_id: Union[Unset, str] = UNSET - catalog_property_id: Union[Unset, str] = UNSET + catalog_field_id: Unset | str = UNSET + catalog_property_id: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/bulk_upsert_catalog_entities_response.py b/rootly_sdk/models/bulk_upsert_catalog_entities_response.py index 8f66215a..3d5f864c 100644 --- a/rootly_sdk/models/bulk_upsert_catalog_entities_response.py +++ b/rootly_sdk/models/bulk_upsert_catalog_entities_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -20,11 +20,11 @@ class BulkUpsertCatalogEntitiesResponse: data (Union[Unset, list['BulkUpsertCatalogEntitiesResponseDataItem']]): """ - data: Union[Unset, list["BulkUpsertCatalogEntitiesResponseDataItem"]] = UNSET + data: Unset | list["BulkUpsertCatalogEntitiesResponseDataItem"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data: Union[Unset, list[dict[str, Any]]] = UNSET + data: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.data, Unset): data = [] for data_item_data in self.data: diff --git a/rootly_sdk/models/bulk_upsert_catalog_entities_response_data_item.py b/rootly_sdk/models/bulk_upsert_catalog_entities_response_data_item.py index 86d5fe46..92739697 100644 --- a/rootly_sdk/models/bulk_upsert_catalog_entities_response_data_item.py +++ b/rootly_sdk/models/bulk_upsert_catalog_entities_response_data_item.py @@ -26,19 +26,19 @@ class BulkUpsertCatalogEntitiesResponseDataItem: attributes (Union[Unset, CatalogEntity]): """ - id: Union[Unset, str] = UNSET - type_: Union[Unset, BulkUpsertCatalogEntitiesResponseDataItemType] = UNSET + id: Unset | str = UNSET + type_: Unset | BulkUpsertCatalogEntitiesResponseDataItemType = UNSET attributes: Union[Unset, "CatalogEntity"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: id = self.id - type_: Union[Unset, str] = UNSET + type_: Unset | str = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ - attributes: Union[Unset, dict[str, Any]] = UNSET + attributes: Unset | dict[str, Any] = UNSET if not isinstance(self.attributes, Unset): attributes = self.attributes.to_dict() @@ -62,14 +62,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: id = d.pop("id", UNSET) _type_ = d.pop("type", UNSET) - type_: Union[Unset, BulkUpsertCatalogEntitiesResponseDataItemType] + type_: Unset | BulkUpsertCatalogEntitiesResponseDataItemType if isinstance(_type_, Unset): type_ = UNSET else: type_ = check_bulk_upsert_catalog_entities_response_data_item_type(_type_) _attributes = d.pop("attributes", UNSET) - attributes: Union[Unset, CatalogEntity] + attributes: Unset | CatalogEntity if isinstance(_attributes, Unset): attributes = UNSET else: diff --git a/rootly_sdk/models/bulk_upsert_environments_entities_item.py b/rootly_sdk/models/bulk_upsert_environments_entities_item.py index 4f9a7720..255726bb 100644 --- a/rootly_sdk/models/bulk_upsert_environments_entities_item.py +++ b/rootly_sdk/models/bulk_upsert_environments_entities_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,13 +29,13 @@ class BulkUpsertEnvironmentsEntitiesItem: """ external_id: str - name: Union[Unset, str] = UNSET - description: Union[None, Unset, str] = UNSET - public_description: Union[None, Unset, str] = UNSET - color: Union[None, Unset, str] = UNSET - position: Union[None, Unset, int] = UNSET - notify_emails: Union[None, Unset, list[str]] = UNSET - fields: Union[Unset, list["BulkUpsertEnvironmentsEntitiesItemFieldsItem"]] = UNSET + name: Unset | str = UNSET + description: None | Unset | str = UNSET + public_description: None | Unset | str = UNSET + color: None | Unset | str = UNSET + position: None | Unset | int = UNSET + notify_emails: None | Unset | list[str] = UNSET + fields: Unset | list["BulkUpsertEnvironmentsEntitiesItemFieldsItem"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -43,31 +43,31 @@ def to_dict(self) -> dict[str, Any]: name = self.name - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - public_description: Union[None, Unset, str] + public_description: None | Unset | str if isinstance(self.public_description, Unset): public_description = UNSET else: public_description = self.public_description - color: Union[None, Unset, str] + color: None | Unset | str if isinstance(self.color, Unset): color = UNSET else: color = self.color - position: Union[None, Unset, int] + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: position = self.position - notify_emails: Union[None, Unset, list[str]] + notify_emails: None | Unset | list[str] if isinstance(self.notify_emails, Unset): notify_emails = UNSET elif isinstance(self.notify_emails, list): @@ -76,7 +76,7 @@ def to_dict(self) -> dict[str, Any]: else: notify_emails = self.notify_emails - fields: Union[Unset, list[dict[str, Any]]] = UNSET + fields: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.fields, Unset): fields = [] for fields_item_data in self.fields: @@ -118,43 +118,43 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name = d.pop("name", UNSET) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_public_description(data: object) -> Union[None, Unset, str]: + def _parse_public_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) public_description = _parse_public_description(d.pop("public_description", UNSET)) - def _parse_color(data: object) -> Union[None, Unset, str]: + def _parse_color(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) color = _parse_color(d.pop("color", UNSET)) - def _parse_position(data: object) -> Union[None, Unset, int]: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) - def _parse_notify_emails(data: object) -> Union[None, Unset, list[str]]: + def _parse_notify_emails(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -167,7 +167,7 @@ def _parse_notify_emails(data: object) -> Union[None, Unset, list[str]]: return notify_emails_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) notify_emails = _parse_notify_emails(d.pop("notify_emails", UNSET)) diff --git a/rootly_sdk/models/bulk_upsert_environments_entities_item_fields_item.py b/rootly_sdk/models/bulk_upsert_environments_entities_item_fields_item.py index 96227631..78b617b9 100644 --- a/rootly_sdk/models/bulk_upsert_environments_entities_item_fields_item.py +++ b/rootly_sdk/models/bulk_upsert_environments_entities_item_fields_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,8 +21,8 @@ class BulkUpsertEnvironmentsEntitiesItemFieldsItem: """ value: str - catalog_field_id: Union[Unset, str] = UNSET - catalog_property_id: Union[Unset, str] = UNSET + catalog_field_id: Unset | str = UNSET + catalog_property_id: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/bulk_upsert_environments_response.py b/rootly_sdk/models/bulk_upsert_environments_response.py index ac71f655..72890e00 100644 --- a/rootly_sdk/models/bulk_upsert_environments_response.py +++ b/rootly_sdk/models/bulk_upsert_environments_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -20,11 +20,11 @@ class BulkUpsertEnvironmentsResponse: data (Union[Unset, list['BulkUpsertEnvironmentsResponseDataItem']]): """ - data: Union[Unset, list["BulkUpsertEnvironmentsResponseDataItem"]] = UNSET + data: Unset | list["BulkUpsertEnvironmentsResponseDataItem"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data: Union[Unset, list[dict[str, Any]]] = UNSET + data: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.data, Unset): data = [] for data_item_data in self.data: diff --git a/rootly_sdk/models/bulk_upsert_environments_response_data_item.py b/rootly_sdk/models/bulk_upsert_environments_response_data_item.py index 609e4e4e..fd861d60 100644 --- a/rootly_sdk/models/bulk_upsert_environments_response_data_item.py +++ b/rootly_sdk/models/bulk_upsert_environments_response_data_item.py @@ -26,19 +26,19 @@ class BulkUpsertEnvironmentsResponseDataItem: attributes (Union[Unset, Environment]): """ - id: Union[Unset, str] = UNSET - type_: Union[Unset, BulkUpsertEnvironmentsResponseDataItemType] = UNSET + id: Unset | str = UNSET + type_: Unset | BulkUpsertEnvironmentsResponseDataItemType = UNSET attributes: Union[Unset, "Environment"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: id = self.id - type_: Union[Unset, str] = UNSET + type_: Unset | str = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ - attributes: Union[Unset, dict[str, Any]] = UNSET + attributes: Unset | dict[str, Any] = UNSET if not isinstance(self.attributes, Unset): attributes = self.attributes.to_dict() @@ -62,14 +62,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: id = d.pop("id", UNSET) _type_ = d.pop("type", UNSET) - type_: Union[Unset, BulkUpsertEnvironmentsResponseDataItemType] + type_: Unset | BulkUpsertEnvironmentsResponseDataItemType if isinstance(_type_, Unset): type_ = UNSET else: type_ = check_bulk_upsert_environments_response_data_item_type(_type_) _attributes = d.pop("attributes", UNSET) - attributes: Union[Unset, Environment] + attributes: Unset | Environment if isinstance(_attributes, Unset): attributes = UNSET else: diff --git a/rootly_sdk/models/bulk_upsert_functionalities_entities_item.py b/rootly_sdk/models/bulk_upsert_functionalities_entities_item.py index d9997474..b5c14786 100644 --- a/rootly_sdk/models/bulk_upsert_functionalities_entities_item.py +++ b/rootly_sdk/models/bulk_upsert_functionalities_entities_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -40,22 +40,22 @@ class BulkUpsertFunctionalitiesEntitiesItem: """ external_id: str - name: Union[Unset, str] = UNSET - description: Union[None, Unset, str] = UNSET - public_description: Union[None, Unset, str] = UNSET - color: Union[None, Unset, str] = UNSET - position: Union[None, Unset, int] = UNSET - show_uptime: Union[None, Unset, bool] = UNSET - show_uptime_last_days: Union[None, Unset, int] = UNSET - notify_emails: Union[None, Unset, list[str]] = UNSET - pagerduty_id: Union[None, Unset, str] = UNSET - opsgenie_id: Union[None, Unset, str] = UNSET - opsgenie_team_id: Union[None, Unset, str] = UNSET - backstage_id: Union[None, Unset, str] = UNSET - cortex_id: Union[None, Unset, str] = UNSET - opslevel_id: Union[None, Unset, str] = UNSET - service_now_ci_sys_id: Union[None, Unset, str] = UNSET - fields: Union[Unset, list["BulkUpsertFunctionalitiesEntitiesItemFieldsItem"]] = UNSET + name: Unset | str = UNSET + description: None | Unset | str = UNSET + public_description: None | Unset | str = UNSET + color: None | Unset | str = UNSET + position: None | Unset | int = UNSET + show_uptime: None | Unset | bool = UNSET + show_uptime_last_days: None | Unset | int = UNSET + notify_emails: None | Unset | list[str] = UNSET + pagerduty_id: None | Unset | str = UNSET + opsgenie_id: None | Unset | str = UNSET + opsgenie_team_id: None | Unset | str = UNSET + backstage_id: None | Unset | str = UNSET + cortex_id: None | Unset | str = UNSET + opslevel_id: None | Unset | str = UNSET + service_now_ci_sys_id: None | Unset | str = UNSET + fields: Unset | list["BulkUpsertFunctionalitiesEntitiesItemFieldsItem"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -63,43 +63,43 @@ def to_dict(self) -> dict[str, Any]: name = self.name - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - public_description: Union[None, Unset, str] + public_description: None | Unset | str if isinstance(self.public_description, Unset): public_description = UNSET else: public_description = self.public_description - color: Union[None, Unset, str] + color: None | Unset | str if isinstance(self.color, Unset): color = UNSET else: color = self.color - position: Union[None, Unset, int] + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: position = self.position - show_uptime: Union[None, Unset, bool] + show_uptime: None | Unset | bool if isinstance(self.show_uptime, Unset): show_uptime = UNSET else: show_uptime = self.show_uptime - show_uptime_last_days: Union[None, Unset, int] + show_uptime_last_days: None | Unset | int if isinstance(self.show_uptime_last_days, Unset): show_uptime_last_days = UNSET else: show_uptime_last_days = self.show_uptime_last_days - notify_emails: Union[None, Unset, list[str]] + notify_emails: None | Unset | list[str] if isinstance(self.notify_emails, Unset): notify_emails = UNSET elif isinstance(self.notify_emails, list): @@ -108,49 +108,49 @@ def to_dict(self) -> dict[str, Any]: else: notify_emails = self.notify_emails - pagerduty_id: Union[None, Unset, str] + pagerduty_id: None | Unset | str if isinstance(self.pagerduty_id, Unset): pagerduty_id = UNSET else: pagerduty_id = self.pagerduty_id - opsgenie_id: Union[None, Unset, str] + opsgenie_id: None | Unset | str if isinstance(self.opsgenie_id, Unset): opsgenie_id = UNSET else: opsgenie_id = self.opsgenie_id - opsgenie_team_id: Union[None, Unset, str] + opsgenie_team_id: None | Unset | str if isinstance(self.opsgenie_team_id, Unset): opsgenie_team_id = UNSET else: opsgenie_team_id = self.opsgenie_team_id - backstage_id: Union[None, Unset, str] + backstage_id: None | Unset | str if isinstance(self.backstage_id, Unset): backstage_id = UNSET else: backstage_id = self.backstage_id - cortex_id: Union[None, Unset, str] + cortex_id: None | Unset | str if isinstance(self.cortex_id, Unset): cortex_id = UNSET else: cortex_id = self.cortex_id - opslevel_id: Union[None, Unset, str] + opslevel_id: None | Unset | str if isinstance(self.opslevel_id, Unset): opslevel_id = UNSET else: opslevel_id = self.opslevel_id - service_now_ci_sys_id: Union[None, Unset, str] + service_now_ci_sys_id: None | Unset | str if isinstance(self.service_now_ci_sys_id, Unset): service_now_ci_sys_id = UNSET else: service_now_ci_sys_id = self.service_now_ci_sys_id - fields: Union[Unset, list[dict[str, Any]]] = UNSET + fields: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.fields, Unset): fields = [] for fields_item_data in self.fields: @@ -210,61 +210,61 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name = d.pop("name", UNSET) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_public_description(data: object) -> Union[None, Unset, str]: + def _parse_public_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) public_description = _parse_public_description(d.pop("public_description", UNSET)) - def _parse_color(data: object) -> Union[None, Unset, str]: + def _parse_color(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) color = _parse_color(d.pop("color", UNSET)) - def _parse_position(data: object) -> Union[None, Unset, int]: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) - def _parse_show_uptime(data: object) -> Union[None, Unset, bool]: + def _parse_show_uptime(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) show_uptime = _parse_show_uptime(d.pop("show_uptime", UNSET)) - def _parse_show_uptime_last_days(data: object) -> Union[None, Unset, int]: + def _parse_show_uptime_last_days(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) show_uptime_last_days = _parse_show_uptime_last_days(d.pop("show_uptime_last_days", UNSET)) - def _parse_notify_emails(data: object) -> Union[None, Unset, list[str]]: + def _parse_notify_emails(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -277,70 +277,70 @@ def _parse_notify_emails(data: object) -> Union[None, Unset, list[str]]: return notify_emails_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) notify_emails = _parse_notify_emails(d.pop("notify_emails", UNSET)) - def _parse_pagerduty_id(data: object) -> Union[None, Unset, str]: + def _parse_pagerduty_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) pagerduty_id = _parse_pagerduty_id(d.pop("pagerduty_id", UNSET)) - def _parse_opsgenie_id(data: object) -> Union[None, Unset, str]: + def _parse_opsgenie_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) opsgenie_id = _parse_opsgenie_id(d.pop("opsgenie_id", UNSET)) - def _parse_opsgenie_team_id(data: object) -> Union[None, Unset, str]: + def _parse_opsgenie_team_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) opsgenie_team_id = _parse_opsgenie_team_id(d.pop("opsgenie_team_id", UNSET)) - def _parse_backstage_id(data: object) -> Union[None, Unset, str]: + def _parse_backstage_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) backstage_id = _parse_backstage_id(d.pop("backstage_id", UNSET)) - def _parse_cortex_id(data: object) -> Union[None, Unset, str]: + def _parse_cortex_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) cortex_id = _parse_cortex_id(d.pop("cortex_id", UNSET)) - def _parse_opslevel_id(data: object) -> Union[None, Unset, str]: + def _parse_opslevel_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) opslevel_id = _parse_opslevel_id(d.pop("opslevel_id", UNSET)) - def _parse_service_now_ci_sys_id(data: object) -> Union[None, Unset, str]: + def _parse_service_now_ci_sys_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) service_now_ci_sys_id = _parse_service_now_ci_sys_id(d.pop("service_now_ci_sys_id", UNSET)) diff --git a/rootly_sdk/models/bulk_upsert_functionalities_entities_item_fields_item.py b/rootly_sdk/models/bulk_upsert_functionalities_entities_item_fields_item.py index e059981a..a55c96c3 100644 --- a/rootly_sdk/models/bulk_upsert_functionalities_entities_item_fields_item.py +++ b/rootly_sdk/models/bulk_upsert_functionalities_entities_item_fields_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,8 +21,8 @@ class BulkUpsertFunctionalitiesEntitiesItemFieldsItem: """ value: str - catalog_field_id: Union[Unset, str] = UNSET - catalog_property_id: Union[Unset, str] = UNSET + catalog_field_id: Unset | str = UNSET + catalog_property_id: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/bulk_upsert_functionalities_response.py b/rootly_sdk/models/bulk_upsert_functionalities_response.py index 1b1d4b58..e042eeba 100644 --- a/rootly_sdk/models/bulk_upsert_functionalities_response.py +++ b/rootly_sdk/models/bulk_upsert_functionalities_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -20,11 +20,11 @@ class BulkUpsertFunctionalitiesResponse: data (Union[Unset, list['BulkUpsertFunctionalitiesResponseDataItem']]): """ - data: Union[Unset, list["BulkUpsertFunctionalitiesResponseDataItem"]] = UNSET + data: Unset | list["BulkUpsertFunctionalitiesResponseDataItem"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data: Union[Unset, list[dict[str, Any]]] = UNSET + data: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.data, Unset): data = [] for data_item_data in self.data: diff --git a/rootly_sdk/models/bulk_upsert_functionalities_response_data_item.py b/rootly_sdk/models/bulk_upsert_functionalities_response_data_item.py index 58ce35bf..d12b3435 100644 --- a/rootly_sdk/models/bulk_upsert_functionalities_response_data_item.py +++ b/rootly_sdk/models/bulk_upsert_functionalities_response_data_item.py @@ -26,19 +26,19 @@ class BulkUpsertFunctionalitiesResponseDataItem: attributes (Union[Unset, Functionality]): """ - id: Union[Unset, str] = UNSET - type_: Union[Unset, BulkUpsertFunctionalitiesResponseDataItemType] = UNSET + id: Unset | str = UNSET + type_: Unset | BulkUpsertFunctionalitiesResponseDataItemType = UNSET attributes: Union[Unset, "Functionality"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: id = self.id - type_: Union[Unset, str] = UNSET + type_: Unset | str = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ - attributes: Union[Unset, dict[str, Any]] = UNSET + attributes: Unset | dict[str, Any] = UNSET if not isinstance(self.attributes, Unset): attributes = self.attributes.to_dict() @@ -62,14 +62,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: id = d.pop("id", UNSET) _type_ = d.pop("type", UNSET) - type_: Union[Unset, BulkUpsertFunctionalitiesResponseDataItemType] + type_: Unset | BulkUpsertFunctionalitiesResponseDataItemType if isinstance(_type_, Unset): type_ = UNSET else: type_ = check_bulk_upsert_functionalities_response_data_item_type(_type_) _attributes = d.pop("attributes", UNSET) - attributes: Union[Unset, Functionality] + attributes: Unset | Functionality if isinstance(_attributes, Unset): attributes = UNSET else: diff --git a/rootly_sdk/models/bulk_upsert_services_entities_item.py b/rootly_sdk/models/bulk_upsert_services_entities_item.py index 19f054af..c04617a9 100644 --- a/rootly_sdk/models/bulk_upsert_services_entities_item.py +++ b/rootly_sdk/models/bulk_upsert_services_entities_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -44,28 +44,28 @@ class BulkUpsertServicesEntitiesItem: """ external_id: str - name: Union[Unset, str] = UNSET - description: Union[None, Unset, str] = UNSET - public_description: Union[None, Unset, str] = UNSET - color: Union[None, Unset, str] = UNSET - position: Union[None, Unset, int] = UNSET - show_uptime: Union[None, Unset, bool] = UNSET - show_uptime_last_days: Union[None, Unset, int] = UNSET - github_repository_name: Union[None, Unset, str] = UNSET - github_repository_branch: Union[None, Unset, str] = UNSET - gitlab_repository_name: Union[None, Unset, str] = UNSET - gitlab_repository_branch: Union[None, Unset, str] = UNSET - kubernetes_deployment_name: Union[None, Unset, str] = UNSET - pagerduty_id: Union[None, Unset, str] = UNSET - opsgenie_id: Union[None, Unset, str] = UNSET - opsgenie_team_id: Union[None, Unset, str] = UNSET - cortex_id: Union[None, Unset, str] = UNSET - opslevel_id: Union[None, Unset, str] = UNSET - backstage_id: Union[None, Unset, str] = UNSET - service_now_ci_sys_id: Union[None, Unset, str] = UNSET - notify_emails: Union[None, Unset, list[str]] = UNSET - alerts_email_enabled: Union[None, Unset, bool] = UNSET - fields: Union[Unset, list["BulkUpsertServicesEntitiesItemFieldsItem"]] = UNSET + name: Unset | str = UNSET + description: None | Unset | str = UNSET + public_description: None | Unset | str = UNSET + color: None | Unset | str = UNSET + position: None | Unset | int = UNSET + show_uptime: None | Unset | bool = UNSET + show_uptime_last_days: None | Unset | int = UNSET + github_repository_name: None | Unset | str = UNSET + github_repository_branch: None | Unset | str = UNSET + gitlab_repository_name: None | Unset | str = UNSET + gitlab_repository_branch: None | Unset | str = UNSET + kubernetes_deployment_name: None | Unset | str = UNSET + pagerduty_id: None | Unset | str = UNSET + opsgenie_id: None | Unset | str = UNSET + opsgenie_team_id: None | Unset | str = UNSET + cortex_id: None | Unset | str = UNSET + opslevel_id: None | Unset | str = UNSET + backstage_id: None | Unset | str = UNSET + service_now_ci_sys_id: None | Unset | str = UNSET + notify_emails: None | Unset | list[str] = UNSET + alerts_email_enabled: None | Unset | bool = UNSET + fields: Unset | list["BulkUpsertServicesEntitiesItemFieldsItem"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -73,115 +73,115 @@ def to_dict(self) -> dict[str, Any]: name = self.name - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - public_description: Union[None, Unset, str] + public_description: None | Unset | str if isinstance(self.public_description, Unset): public_description = UNSET else: public_description = self.public_description - color: Union[None, Unset, str] + color: None | Unset | str if isinstance(self.color, Unset): color = UNSET else: color = self.color - position: Union[None, Unset, int] + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: position = self.position - show_uptime: Union[None, Unset, bool] + show_uptime: None | Unset | bool if isinstance(self.show_uptime, Unset): show_uptime = UNSET else: show_uptime = self.show_uptime - show_uptime_last_days: Union[None, Unset, int] + show_uptime_last_days: None | Unset | int if isinstance(self.show_uptime_last_days, Unset): show_uptime_last_days = UNSET else: show_uptime_last_days = self.show_uptime_last_days - github_repository_name: Union[None, Unset, str] + github_repository_name: None | Unset | str if isinstance(self.github_repository_name, Unset): github_repository_name = UNSET else: github_repository_name = self.github_repository_name - github_repository_branch: Union[None, Unset, str] + github_repository_branch: None | Unset | str if isinstance(self.github_repository_branch, Unset): github_repository_branch = UNSET else: github_repository_branch = self.github_repository_branch - gitlab_repository_name: Union[None, Unset, str] + gitlab_repository_name: None | Unset | str if isinstance(self.gitlab_repository_name, Unset): gitlab_repository_name = UNSET else: gitlab_repository_name = self.gitlab_repository_name - gitlab_repository_branch: Union[None, Unset, str] + gitlab_repository_branch: None | Unset | str if isinstance(self.gitlab_repository_branch, Unset): gitlab_repository_branch = UNSET else: gitlab_repository_branch = self.gitlab_repository_branch - kubernetes_deployment_name: Union[None, Unset, str] + kubernetes_deployment_name: None | Unset | str if isinstance(self.kubernetes_deployment_name, Unset): kubernetes_deployment_name = UNSET else: kubernetes_deployment_name = self.kubernetes_deployment_name - pagerduty_id: Union[None, Unset, str] + pagerduty_id: None | Unset | str if isinstance(self.pagerduty_id, Unset): pagerduty_id = UNSET else: pagerduty_id = self.pagerduty_id - opsgenie_id: Union[None, Unset, str] + opsgenie_id: None | Unset | str if isinstance(self.opsgenie_id, Unset): opsgenie_id = UNSET else: opsgenie_id = self.opsgenie_id - opsgenie_team_id: Union[None, Unset, str] + opsgenie_team_id: None | Unset | str if isinstance(self.opsgenie_team_id, Unset): opsgenie_team_id = UNSET else: opsgenie_team_id = self.opsgenie_team_id - cortex_id: Union[None, Unset, str] + cortex_id: None | Unset | str if isinstance(self.cortex_id, Unset): cortex_id = UNSET else: cortex_id = self.cortex_id - opslevel_id: Union[None, Unset, str] + opslevel_id: None | Unset | str if isinstance(self.opslevel_id, Unset): opslevel_id = UNSET else: opslevel_id = self.opslevel_id - backstage_id: Union[None, Unset, str] + backstage_id: None | Unset | str if isinstance(self.backstage_id, Unset): backstage_id = UNSET else: backstage_id = self.backstage_id - service_now_ci_sys_id: Union[None, Unset, str] + service_now_ci_sys_id: None | Unset | str if isinstance(self.service_now_ci_sys_id, Unset): service_now_ci_sys_id = UNSET else: service_now_ci_sys_id = self.service_now_ci_sys_id - notify_emails: Union[None, Unset, list[str]] + notify_emails: None | Unset | list[str] if isinstance(self.notify_emails, Unset): notify_emails = UNSET elif isinstance(self.notify_emails, list): @@ -190,13 +190,13 @@ def to_dict(self) -> dict[str, Any]: else: notify_emails = self.notify_emails - alerts_email_enabled: Union[None, Unset, bool] + alerts_email_enabled: None | Unset | bool if isinstance(self.alerts_email_enabled, Unset): alerts_email_enabled = UNSET else: alerts_email_enabled = self.alerts_email_enabled - fields: Union[Unset, list[dict[str, Any]]] = UNSET + fields: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.fields, Unset): fields = [] for fields_item_data in self.fields: @@ -266,169 +266,169 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name = d.pop("name", UNSET) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_public_description(data: object) -> Union[None, Unset, str]: + def _parse_public_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) public_description = _parse_public_description(d.pop("public_description", UNSET)) - def _parse_color(data: object) -> Union[None, Unset, str]: + def _parse_color(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) color = _parse_color(d.pop("color", UNSET)) - def _parse_position(data: object) -> Union[None, Unset, int]: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) - def _parse_show_uptime(data: object) -> Union[None, Unset, bool]: + def _parse_show_uptime(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) show_uptime = _parse_show_uptime(d.pop("show_uptime", UNSET)) - def _parse_show_uptime_last_days(data: object) -> Union[None, Unset, int]: + def _parse_show_uptime_last_days(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) show_uptime_last_days = _parse_show_uptime_last_days(d.pop("show_uptime_last_days", UNSET)) - def _parse_github_repository_name(data: object) -> Union[None, Unset, str]: + def _parse_github_repository_name(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) github_repository_name = _parse_github_repository_name(d.pop("github_repository_name", UNSET)) - def _parse_github_repository_branch(data: object) -> Union[None, Unset, str]: + def _parse_github_repository_branch(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) github_repository_branch = _parse_github_repository_branch(d.pop("github_repository_branch", UNSET)) - def _parse_gitlab_repository_name(data: object) -> Union[None, Unset, str]: + def _parse_gitlab_repository_name(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) gitlab_repository_name = _parse_gitlab_repository_name(d.pop("gitlab_repository_name", UNSET)) - def _parse_gitlab_repository_branch(data: object) -> Union[None, Unset, str]: + def _parse_gitlab_repository_branch(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) gitlab_repository_branch = _parse_gitlab_repository_branch(d.pop("gitlab_repository_branch", UNSET)) - def _parse_kubernetes_deployment_name(data: object) -> Union[None, Unset, str]: + def _parse_kubernetes_deployment_name(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) kubernetes_deployment_name = _parse_kubernetes_deployment_name(d.pop("kubernetes_deployment_name", UNSET)) - def _parse_pagerduty_id(data: object) -> Union[None, Unset, str]: + def _parse_pagerduty_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) pagerduty_id = _parse_pagerduty_id(d.pop("pagerduty_id", UNSET)) - def _parse_opsgenie_id(data: object) -> Union[None, Unset, str]: + def _parse_opsgenie_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) opsgenie_id = _parse_opsgenie_id(d.pop("opsgenie_id", UNSET)) - def _parse_opsgenie_team_id(data: object) -> Union[None, Unset, str]: + def _parse_opsgenie_team_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) opsgenie_team_id = _parse_opsgenie_team_id(d.pop("opsgenie_team_id", UNSET)) - def _parse_cortex_id(data: object) -> Union[None, Unset, str]: + def _parse_cortex_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) cortex_id = _parse_cortex_id(d.pop("cortex_id", UNSET)) - def _parse_opslevel_id(data: object) -> Union[None, Unset, str]: + def _parse_opslevel_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) opslevel_id = _parse_opslevel_id(d.pop("opslevel_id", UNSET)) - def _parse_backstage_id(data: object) -> Union[None, Unset, str]: + def _parse_backstage_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) backstage_id = _parse_backstage_id(d.pop("backstage_id", UNSET)) - def _parse_service_now_ci_sys_id(data: object) -> Union[None, Unset, str]: + def _parse_service_now_ci_sys_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) service_now_ci_sys_id = _parse_service_now_ci_sys_id(d.pop("service_now_ci_sys_id", UNSET)) - def _parse_notify_emails(data: object) -> Union[None, Unset, list[str]]: + def _parse_notify_emails(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -441,16 +441,16 @@ def _parse_notify_emails(data: object) -> Union[None, Unset, list[str]]: return notify_emails_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) notify_emails = _parse_notify_emails(d.pop("notify_emails", UNSET)) - def _parse_alerts_email_enabled(data: object) -> Union[None, Unset, bool]: + def _parse_alerts_email_enabled(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) alerts_email_enabled = _parse_alerts_email_enabled(d.pop("alerts_email_enabled", UNSET)) diff --git a/rootly_sdk/models/bulk_upsert_services_entities_item_fields_item.py b/rootly_sdk/models/bulk_upsert_services_entities_item_fields_item.py index dbbdeafa..4b873417 100644 --- a/rootly_sdk/models/bulk_upsert_services_entities_item_fields_item.py +++ b/rootly_sdk/models/bulk_upsert_services_entities_item_fields_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,8 +21,8 @@ class BulkUpsertServicesEntitiesItemFieldsItem: """ value: str - catalog_field_id: Union[Unset, str] = UNSET - catalog_property_id: Union[Unset, str] = UNSET + catalog_field_id: Unset | str = UNSET + catalog_property_id: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/bulk_upsert_services_response.py b/rootly_sdk/models/bulk_upsert_services_response.py index 3f6293f5..1fee4353 100644 --- a/rootly_sdk/models/bulk_upsert_services_response.py +++ b/rootly_sdk/models/bulk_upsert_services_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -20,11 +20,11 @@ class BulkUpsertServicesResponse: data (Union[Unset, list['BulkUpsertServicesResponseDataItem']]): """ - data: Union[Unset, list["BulkUpsertServicesResponseDataItem"]] = UNSET + data: Unset | list["BulkUpsertServicesResponseDataItem"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data: Union[Unset, list[dict[str, Any]]] = UNSET + data: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.data, Unset): data = [] for data_item_data in self.data: diff --git a/rootly_sdk/models/bulk_upsert_services_response_data_item.py b/rootly_sdk/models/bulk_upsert_services_response_data_item.py index 3f24ee16..622e2f0f 100644 --- a/rootly_sdk/models/bulk_upsert_services_response_data_item.py +++ b/rootly_sdk/models/bulk_upsert_services_response_data_item.py @@ -26,19 +26,19 @@ class BulkUpsertServicesResponseDataItem: attributes (Union[Unset, Service]): """ - id: Union[Unset, str] = UNSET - type_: Union[Unset, BulkUpsertServicesResponseDataItemType] = UNSET + id: Unset | str = UNSET + type_: Unset | BulkUpsertServicesResponseDataItemType = UNSET attributes: Union[Unset, "Service"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: id = self.id - type_: Union[Unset, str] = UNSET + type_: Unset | str = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ - attributes: Union[Unset, dict[str, Any]] = UNSET + attributes: Unset | dict[str, Any] = UNSET if not isinstance(self.attributes, Unset): attributes = self.attributes.to_dict() @@ -62,14 +62,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: id = d.pop("id", UNSET) _type_ = d.pop("type", UNSET) - type_: Union[Unset, BulkUpsertServicesResponseDataItemType] + type_: Unset | BulkUpsertServicesResponseDataItemType if isinstance(_type_, Unset): type_ = UNSET else: type_ = check_bulk_upsert_services_response_data_item_type(_type_) _attributes = d.pop("attributes", UNSET) - attributes: Union[Unset, Service] + attributes: Unset | Service if isinstance(_attributes, Unset): attributes = UNSET else: diff --git a/rootly_sdk/models/bulk_upsert_teams_entities_item.py b/rootly_sdk/models/bulk_upsert_teams_entities_item.py index d0edba81..33868db8 100644 --- a/rootly_sdk/models/bulk_upsert_teams_entities_item.py +++ b/rootly_sdk/models/bulk_upsert_teams_entities_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -39,23 +39,23 @@ class BulkUpsertTeamsEntitiesItem: """ external_id: str - name: Union[Unset, str] = UNSET - description: Union[None, Unset, str] = UNSET - public_description: Union[None, Unset, str] = UNSET - color: Union[None, Unset, str] = UNSET - position: Union[None, Unset, int] = UNSET - notify_emails: Union[None, Unset, list[str]] = UNSET - pagerduty_id: Union[None, Unset, str] = UNSET - pagerduty_service_id: Union[None, Unset, str] = UNSET - opsgenie_id: Union[None, Unset, str] = UNSET - victor_ops_id: Union[None, Unset, str] = UNSET - pagertree_id: Union[None, Unset, str] = UNSET - backstage_id: Union[None, Unset, str] = UNSET - cortex_id: Union[None, Unset, str] = UNSET - opslevel_id: Union[None, Unset, str] = UNSET - service_now_ci_sys_id: Union[None, Unset, str] = UNSET - alerts_email_enabled: Union[None, Unset, bool] = UNSET - fields: Union[Unset, list["BulkUpsertTeamsEntitiesItemFieldsItem"]] = UNSET + name: Unset | str = UNSET + description: None | Unset | str = UNSET + public_description: None | Unset | str = UNSET + color: None | Unset | str = UNSET + position: None | Unset | int = UNSET + notify_emails: None | Unset | list[str] = UNSET + pagerduty_id: None | Unset | str = UNSET + pagerduty_service_id: None | Unset | str = UNSET + opsgenie_id: None | Unset | str = UNSET + victor_ops_id: None | Unset | str = UNSET + pagertree_id: None | Unset | str = UNSET + backstage_id: None | Unset | str = UNSET + cortex_id: None | Unset | str = UNSET + opslevel_id: None | Unset | str = UNSET + service_now_ci_sys_id: None | Unset | str = UNSET + alerts_email_enabled: None | Unset | bool = UNSET + fields: Unset | list["BulkUpsertTeamsEntitiesItemFieldsItem"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -63,31 +63,31 @@ def to_dict(self) -> dict[str, Any]: name = self.name - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - public_description: Union[None, Unset, str] + public_description: None | Unset | str if isinstance(self.public_description, Unset): public_description = UNSET else: public_description = self.public_description - color: Union[None, Unset, str] + color: None | Unset | str if isinstance(self.color, Unset): color = UNSET else: color = self.color - position: Union[None, Unset, int] + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: position = self.position - notify_emails: Union[None, Unset, list[str]] + notify_emails: None | Unset | list[str] if isinstance(self.notify_emails, Unset): notify_emails = UNSET elif isinstance(self.notify_emails, list): @@ -96,67 +96,67 @@ def to_dict(self) -> dict[str, Any]: else: notify_emails = self.notify_emails - pagerduty_id: Union[None, Unset, str] + pagerduty_id: None | Unset | str if isinstance(self.pagerduty_id, Unset): pagerduty_id = UNSET else: pagerduty_id = self.pagerduty_id - pagerduty_service_id: Union[None, Unset, str] + pagerduty_service_id: None | Unset | str if isinstance(self.pagerduty_service_id, Unset): pagerduty_service_id = UNSET else: pagerduty_service_id = self.pagerduty_service_id - opsgenie_id: Union[None, Unset, str] + opsgenie_id: None | Unset | str if isinstance(self.opsgenie_id, Unset): opsgenie_id = UNSET else: opsgenie_id = self.opsgenie_id - victor_ops_id: Union[None, Unset, str] + victor_ops_id: None | Unset | str if isinstance(self.victor_ops_id, Unset): victor_ops_id = UNSET else: victor_ops_id = self.victor_ops_id - pagertree_id: Union[None, Unset, str] + pagertree_id: None | Unset | str if isinstance(self.pagertree_id, Unset): pagertree_id = UNSET else: pagertree_id = self.pagertree_id - backstage_id: Union[None, Unset, str] + backstage_id: None | Unset | str if isinstance(self.backstage_id, Unset): backstage_id = UNSET else: backstage_id = self.backstage_id - cortex_id: Union[None, Unset, str] + cortex_id: None | Unset | str if isinstance(self.cortex_id, Unset): cortex_id = UNSET else: cortex_id = self.cortex_id - opslevel_id: Union[None, Unset, str] + opslevel_id: None | Unset | str if isinstance(self.opslevel_id, Unset): opslevel_id = UNSET else: opslevel_id = self.opslevel_id - service_now_ci_sys_id: Union[None, Unset, str] + service_now_ci_sys_id: None | Unset | str if isinstance(self.service_now_ci_sys_id, Unset): service_now_ci_sys_id = UNSET else: service_now_ci_sys_id = self.service_now_ci_sys_id - alerts_email_enabled: Union[None, Unset, bool] + alerts_email_enabled: None | Unset | bool if isinstance(self.alerts_email_enabled, Unset): alerts_email_enabled = UNSET else: alerts_email_enabled = self.alerts_email_enabled - fields: Union[Unset, list[dict[str, Any]]] = UNSET + fields: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.fields, Unset): fields = [] for fields_item_data in self.fields: @@ -216,43 +216,43 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name = d.pop("name", UNSET) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_public_description(data: object) -> Union[None, Unset, str]: + def _parse_public_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) public_description = _parse_public_description(d.pop("public_description", UNSET)) - def _parse_color(data: object) -> Union[None, Unset, str]: + def _parse_color(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) color = _parse_color(d.pop("color", UNSET)) - def _parse_position(data: object) -> Union[None, Unset, int]: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) - def _parse_notify_emails(data: object) -> Union[None, Unset, list[str]]: + def _parse_notify_emails(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -265,97 +265,97 @@ def _parse_notify_emails(data: object) -> Union[None, Unset, list[str]]: return notify_emails_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) notify_emails = _parse_notify_emails(d.pop("notify_emails", UNSET)) - def _parse_pagerduty_id(data: object) -> Union[None, Unset, str]: + def _parse_pagerduty_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) pagerduty_id = _parse_pagerduty_id(d.pop("pagerduty_id", UNSET)) - def _parse_pagerduty_service_id(data: object) -> Union[None, Unset, str]: + def _parse_pagerduty_service_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) pagerduty_service_id = _parse_pagerduty_service_id(d.pop("pagerduty_service_id", UNSET)) - def _parse_opsgenie_id(data: object) -> Union[None, Unset, str]: + def _parse_opsgenie_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) opsgenie_id = _parse_opsgenie_id(d.pop("opsgenie_id", UNSET)) - def _parse_victor_ops_id(data: object) -> Union[None, Unset, str]: + def _parse_victor_ops_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) victor_ops_id = _parse_victor_ops_id(d.pop("victor_ops_id", UNSET)) - def _parse_pagertree_id(data: object) -> Union[None, Unset, str]: + def _parse_pagertree_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) pagertree_id = _parse_pagertree_id(d.pop("pagertree_id", UNSET)) - def _parse_backstage_id(data: object) -> Union[None, Unset, str]: + def _parse_backstage_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) backstage_id = _parse_backstage_id(d.pop("backstage_id", UNSET)) - def _parse_cortex_id(data: object) -> Union[None, Unset, str]: + def _parse_cortex_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) cortex_id = _parse_cortex_id(d.pop("cortex_id", UNSET)) - def _parse_opslevel_id(data: object) -> Union[None, Unset, str]: + def _parse_opslevel_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) opslevel_id = _parse_opslevel_id(d.pop("opslevel_id", UNSET)) - def _parse_service_now_ci_sys_id(data: object) -> Union[None, Unset, str]: + def _parse_service_now_ci_sys_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) service_now_ci_sys_id = _parse_service_now_ci_sys_id(d.pop("service_now_ci_sys_id", UNSET)) - def _parse_alerts_email_enabled(data: object) -> Union[None, Unset, bool]: + def _parse_alerts_email_enabled(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) alerts_email_enabled = _parse_alerts_email_enabled(d.pop("alerts_email_enabled", UNSET)) diff --git a/rootly_sdk/models/bulk_upsert_teams_entities_item_fields_item.py b/rootly_sdk/models/bulk_upsert_teams_entities_item_fields_item.py index eb48ec31..8d2ce3d1 100644 --- a/rootly_sdk/models/bulk_upsert_teams_entities_item_fields_item.py +++ b/rootly_sdk/models/bulk_upsert_teams_entities_item_fields_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,8 +21,8 @@ class BulkUpsertTeamsEntitiesItemFieldsItem: """ value: str - catalog_field_id: Union[Unset, str] = UNSET - catalog_property_id: Union[Unset, str] = UNSET + catalog_field_id: Unset | str = UNSET + catalog_property_id: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/bulk_upsert_teams_response.py b/rootly_sdk/models/bulk_upsert_teams_response.py index bab6ab21..c4644149 100644 --- a/rootly_sdk/models/bulk_upsert_teams_response.py +++ b/rootly_sdk/models/bulk_upsert_teams_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -20,11 +20,11 @@ class BulkUpsertTeamsResponse: data (Union[Unset, list['BulkUpsertTeamsResponseDataItem']]): """ - data: Union[Unset, list["BulkUpsertTeamsResponseDataItem"]] = UNSET + data: Unset | list["BulkUpsertTeamsResponseDataItem"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data: Union[Unset, list[dict[str, Any]]] = UNSET + data: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.data, Unset): data = [] for data_item_data in self.data: diff --git a/rootly_sdk/models/bulk_upsert_teams_response_data_item.py b/rootly_sdk/models/bulk_upsert_teams_response_data_item.py index 9b30ac3f..9bdacaaf 100644 --- a/rootly_sdk/models/bulk_upsert_teams_response_data_item.py +++ b/rootly_sdk/models/bulk_upsert_teams_response_data_item.py @@ -26,19 +26,19 @@ class BulkUpsertTeamsResponseDataItem: attributes (Union[Unset, Team]): """ - id: Union[Unset, str] = UNSET - type_: Union[Unset, BulkUpsertTeamsResponseDataItemType] = UNSET + id: Unset | str = UNSET + type_: Unset | BulkUpsertTeamsResponseDataItemType = UNSET attributes: Union[Unset, "Team"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: id = self.id - type_: Union[Unset, str] = UNSET + type_: Unset | str = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ - attributes: Union[Unset, dict[str, Any]] = UNSET + attributes: Unset | dict[str, Any] = UNSET if not isinstance(self.attributes, Unset): attributes = self.attributes.to_dict() @@ -62,14 +62,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: id = d.pop("id", UNSET) _type_ = d.pop("type", UNSET) - type_: Union[Unset, BulkUpsertTeamsResponseDataItemType] + type_: Unset | BulkUpsertTeamsResponseDataItemType if isinstance(_type_, Unset): type_ = UNSET else: type_ = check_bulk_upsert_teams_response_data_item_type(_type_) _attributes = d.pop("attributes", UNSET) - attributes: Union[Unset, Team] + attributes: Unset | Team if isinstance(_attributes, Unset): attributes = UNSET else: diff --git a/rootly_sdk/models/call_people_task_params.py b/rootly_sdk/models/call_people_task_params.py index 86d89d56..796d763c 100644 --- a/rootly_sdk/models/call_people_task_params.py +++ b/rootly_sdk/models/call_people_task_params.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -26,7 +26,7 @@ class CallPeopleTaskParams: phone_numbers: list[str] name: str content: str - task_type: Union[Unset, CallPeopleTaskParamsTaskType] = UNSET + task_type: Unset | CallPeopleTaskParamsTaskType = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -36,7 +36,7 @@ def to_dict(self) -> dict[str, Any]: content = self.content - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -64,7 +64,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: content = d.pop("content") _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, CallPeopleTaskParamsTaskType] + task_type: Unset | CallPeopleTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/cancel_incident_data_attributes.py b/rootly_sdk/models/cancel_incident_data_attributes.py index 90b9253c..6586a808 100644 --- a/rootly_sdk/models/cancel_incident_data_attributes.py +++ b/rootly_sdk/models/cancel_incident_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -15,10 +15,10 @@ class CancelIncidentDataAttributes: cancellation_message (Union[None, Unset, str]): Why was the incident cancelled? """ - cancellation_message: Union[None, Unset, str] = UNSET + cancellation_message: None | Unset | str = UNSET def to_dict(self) -> dict[str, Any]: - cancellation_message: Union[None, Unset, str] + cancellation_message: None | Unset | str if isinstance(self.cancellation_message, Unset): cancellation_message = UNSET else: @@ -36,12 +36,12 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_cancellation_message(data: object) -> Union[None, Unset, str]: + def _parse_cancellation_message(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) cancellation_message = _parse_cancellation_message(d.pop("cancellation_message", UNSET)) diff --git a/rootly_sdk/models/catalog.py b/rootly_sdk/models/catalog.py index 60f6a364..45896f39 100644 --- a/rootly_sdk/models/catalog.py +++ b/rootly_sdk/models/catalog.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -28,13 +28,13 @@ class Catalog: name: str icon: CatalogIcon - position: Union[None, int] + position: None | int created_at: str updated_at: str - slug: Union[Unset, str] = UNSET - description: Union[None, Unset, str] = UNSET - external_id: Union[None, Unset, str] = UNSET - managed_by: Union[Unset, CatalogManagedBy] = UNSET + slug: Unset | str = UNSET + description: None | Unset | str = UNSET + external_id: None | Unset | str = UNSET + managed_by: Unset | CatalogManagedBy = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: icon: str = self.icon - position: Union[None, int] + position: None | int position = self.position created_at = self.created_at @@ -51,19 +51,19 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - external_id: Union[None, Unset, str] + external_id: None | Unset | str if isinstance(self.external_id, Unset): external_id = UNSET else: external_id = self.external_id - managed_by: Union[Unset, str] = UNSET + managed_by: Unset | str = UNSET if not isinstance(self.managed_by, Unset): managed_by = self.managed_by @@ -96,10 +96,10 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: icon = check_catalog_icon(d.pop("icon")) - def _parse_position(data: object) -> Union[None, int]: + def _parse_position(data: object) -> None | int: if data is None: return data - return cast(Union[None, int], data) + return cast(None | int, data) position = _parse_position(d.pop("position")) @@ -109,26 +109,26 @@ def _parse_position(data: object) -> Union[None, int]: slug = d.pop("slug", UNSET) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_external_id(data: object) -> Union[None, Unset, str]: + def _parse_external_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) external_id = _parse_external_id(d.pop("external_id", UNSET)) _managed_by = d.pop("managed_by", UNSET) - managed_by: Union[Unset, CatalogManagedBy] + managed_by: Unset | CatalogManagedBy if isinstance(_managed_by, Unset): managed_by = UNSET else: diff --git a/rootly_sdk/models/catalog_checklist_template.py b/rootly_sdk/models/catalog_checklist_template.py index 524f01ad..a9ae621d 100644 --- a/rootly_sdk/models/catalog_checklist_template.py +++ b/rootly_sdk/models/catalog_checklist_template.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -44,10 +44,10 @@ class CatalogChecklistTemplate: scope_id: str created_at: str updated_at: str - slug: Union[Unset, str] = UNSET - description: Union[None, Unset, str] = UNSET - fields: Union[None, Unset, list["CatalogChecklistTemplateFieldsType0Item"]] = UNSET - owners: Union[None, Unset, list["CatalogChecklistTemplateOwnersType0Item"]] = UNSET + slug: Unset | str = UNSET + description: None | Unset | str = UNSET + fields: None | Unset | list["CatalogChecklistTemplateFieldsType0Item"] = UNSET + owners: None | Unset | list["CatalogChecklistTemplateOwnersType0Item"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -65,13 +65,13 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - fields: Union[None, Unset, list[dict[str, Any]]] + fields: None | Unset | list[dict[str, Any]] if isinstance(self.fields, Unset): fields = UNSET elif isinstance(self.fields, list): @@ -83,7 +83,7 @@ def to_dict(self) -> dict[str, Any]: else: fields = self.fields - owners: Union[None, Unset, list[dict[str, Any]]] + owners: None | Unset | list[dict[str, Any]] if isinstance(self.owners, Unset): owners = UNSET elif isinstance(self.owners, list): @@ -138,16 +138,16 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: slug = d.pop("slug", UNSET) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_fields(data: object) -> Union[None, Unset, list["CatalogChecklistTemplateFieldsType0Item"]]: + def _parse_fields(data: object) -> None | Unset | list["CatalogChecklistTemplateFieldsType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -165,11 +165,11 @@ def _parse_fields(data: object) -> Union[None, Unset, list["CatalogChecklistTemp return fields_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list["CatalogChecklistTemplateFieldsType0Item"]], data) + return cast(None | Unset | list["CatalogChecklistTemplateFieldsType0Item"], data) fields = _parse_fields(d.pop("fields", UNSET)) - def _parse_owners(data: object) -> Union[None, Unset, list["CatalogChecklistTemplateOwnersType0Item"]]: + def _parse_owners(data: object) -> None | Unset | list["CatalogChecklistTemplateOwnersType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -187,7 +187,7 @@ def _parse_owners(data: object) -> Union[None, Unset, list["CatalogChecklistTemp return owners_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list["CatalogChecklistTemplateOwnersType0Item"]], data) + return cast(None | Unset | list["CatalogChecklistTemplateOwnersType0Item"], data) owners = _parse_owners(d.pop("owners", UNSET)) diff --git a/rootly_sdk/models/catalog_checklist_template_fields_type_0_item.py b/rootly_sdk/models/catalog_checklist_template_fields_type_0_item.py index b39a45e9..81804df4 100644 --- a/rootly_sdk/models/catalog_checklist_template_fields_type_0_item.py +++ b/rootly_sdk/models/catalog_checklist_template_fields_type_0_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,19 +22,19 @@ class CatalogChecklistTemplateFieldsType0Item: catalog_property_id (Union[None, Unset, str]): ID of the catalog property for custom fields """ - field_source: Union[Unset, CatalogChecklistTemplateFieldsType0ItemFieldSource] = UNSET - field_key: Union[Unset, str] = UNSET - catalog_property_id: Union[None, Unset, str] = UNSET + field_source: Unset | CatalogChecklistTemplateFieldsType0ItemFieldSource = UNSET + field_key: Unset | str = UNSET + catalog_property_id: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - field_source: Union[Unset, str] = UNSET + field_source: Unset | str = UNSET if not isinstance(self.field_source, Unset): field_source = self.field_source field_key = self.field_key - catalog_property_id: Union[None, Unset, str] + catalog_property_id: None | Unset | str if isinstance(self.catalog_property_id, Unset): catalog_property_id = UNSET else: @@ -56,7 +56,7 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _field_source = d.pop("field_source", UNSET) - field_source: Union[Unset, CatalogChecklistTemplateFieldsType0ItemFieldSource] + field_source: Unset | CatalogChecklistTemplateFieldsType0ItemFieldSource if isinstance(_field_source, Unset): field_source = UNSET else: @@ -64,12 +64,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: field_key = d.pop("field_key", UNSET) - def _parse_catalog_property_id(data: object) -> Union[None, Unset, str]: + def _parse_catalog_property_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) catalog_property_id = _parse_catalog_property_id(d.pop("catalog_property_id", UNSET)) diff --git a/rootly_sdk/models/catalog_checklist_template_list.py b/rootly_sdk/models/catalog_checklist_template_list.py index ad2edc12..c4ef5839 100644 --- a/rootly_sdk/models/catalog_checklist_template_list.py +++ b/rootly_sdk/models/catalog_checklist_template_list.py @@ -29,7 +29,7 @@ class CatalogChecklistTemplateList: data: list["CatalogChecklistTemplateListDataItem"] links: Union[Unset, "Links"] = UNSET meta: Union[Unset, "Meta"] = UNSET - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -38,15 +38,15 @@ def to_dict(self) -> dict[str, Any]: data_item = data_item_data.to_dict() data.append(data_item) - links: Union[Unset, dict[str, Any]] = UNSET + links: Unset | dict[str, Any] = UNSET if not isinstance(self.links, Unset): links = self.links.to_dict() - meta: Union[Unset, dict[str, Any]] = UNSET + meta: Unset | dict[str, Any] = UNSET if not isinstance(self.meta, Unset): meta = self.meta.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +85,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data.append(data_item) _links = d.pop("links", UNSET) - links: Union[Unset, Links] + links: Unset | Links if isinstance(_links, Unset): links = UNSET else: links = Links.from_dict(_links) _meta = d.pop("meta", UNSET) - meta: Union[Unset, Meta] + meta: Unset | Meta if isinstance(_meta, Unset): meta = UNSET else: diff --git a/rootly_sdk/models/catalog_checklist_template_owners_type_0_item.py b/rootly_sdk/models/catalog_checklist_template_owners_type_0_item.py index aed5bb12..5e05961b 100644 --- a/rootly_sdk/models/catalog_checklist_template_owners_type_0_item.py +++ b/rootly_sdk/models/catalog_checklist_template_owners_type_0_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,14 +21,14 @@ class CatalogChecklistTemplateOwnersType0Item: type_ (Union[Unset, CatalogChecklistTemplateOwnersType0ItemType]): Type of owner """ - id: Union[Unset, str] = UNSET - type_: Union[Unset, CatalogChecklistTemplateOwnersType0ItemType] = UNSET + id: Unset | str = UNSET + type_: Unset | CatalogChecklistTemplateOwnersType0ItemType = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: id = self.id - type_: Union[Unset, str] = UNSET + type_: Unset | str = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ @@ -48,7 +48,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: id = d.pop("id", UNSET) _type_ = d.pop("type", UNSET) - type_: Union[Unset, CatalogChecklistTemplateOwnersType0ItemType] + type_: Unset | CatalogChecklistTemplateOwnersType0ItemType if isinstance(_type_, Unset): type_ = UNSET else: diff --git a/rootly_sdk/models/catalog_checklist_template_response.py b/rootly_sdk/models/catalog_checklist_template_response.py index 3cf42b9f..1f517df8 100644 --- a/rootly_sdk/models/catalog_checklist_template_response.py +++ b/rootly_sdk/models/catalog_checklist_template_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,13 +23,13 @@ class CatalogChecklistTemplateResponse: """ data: "CatalogChecklistTemplateResponseData" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/catalog_entity.py b/rootly_sdk/models/catalog_entity.py index 6a42a642..8affd2bd 100644 --- a/rootly_sdk/models/catalog_entity.py +++ b/rootly_sdk/models/catalog_entity.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -33,22 +33,22 @@ class CatalogEntity: """ name: str - position: Union[None, int] + position: None | int created_at: str updated_at: str - slug: Union[Unset, str] = UNSET - description: Union[None, Unset, str] = UNSET - public_description: Union[None, Unset, str] = UNSET - backstage_id: Union[None, Unset, str] = UNSET - external_id: Union[None, Unset, str] = UNSET - managed_by: Union[Unset, CatalogEntityManagedBy] = UNSET - properties: Union[Unset, list["CatalogEntityPropertiesItem"]] = UNSET + slug: Unset | str = UNSET + description: None | Unset | str = UNSET + public_description: None | Unset | str = UNSET + backstage_id: None | Unset | str = UNSET + external_id: None | Unset | str = UNSET + managed_by: Unset | CatalogEntityManagedBy = UNSET + properties: Unset | list["CatalogEntityPropertiesItem"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: name = self.name - position: Union[None, int] + position: None | int position = self.position created_at = self.created_at @@ -57,35 +57,35 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - public_description: Union[None, Unset, str] + public_description: None | Unset | str if isinstance(self.public_description, Unset): public_description = UNSET else: public_description = self.public_description - backstage_id: Union[None, Unset, str] + backstage_id: None | Unset | str if isinstance(self.backstage_id, Unset): backstage_id = UNSET else: backstage_id = self.backstage_id - external_id: Union[None, Unset, str] + external_id: None | Unset | str if isinstance(self.external_id, Unset): external_id = UNSET else: external_id = self.external_id - managed_by: Union[Unset, str] = UNSET + managed_by: Unset | str = UNSET if not isinstance(self.managed_by, Unset): managed_by = self.managed_by - properties: Union[Unset, list[dict[str, Any]]] = UNSET + properties: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.properties, Unset): properties = [] for properties_item_data in self.properties: @@ -126,10 +126,10 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name") - def _parse_position(data: object) -> Union[None, int]: + def _parse_position(data: object) -> None | int: if data is None: return data - return cast(Union[None, int], data) + return cast(None | int, data) position = _parse_position(d.pop("position")) @@ -139,44 +139,44 @@ def _parse_position(data: object) -> Union[None, int]: slug = d.pop("slug", UNSET) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_public_description(data: object) -> Union[None, Unset, str]: + def _parse_public_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) public_description = _parse_public_description(d.pop("public_description", UNSET)) - def _parse_backstage_id(data: object) -> Union[None, Unset, str]: + def _parse_backstage_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) backstage_id = _parse_backstage_id(d.pop("backstage_id", UNSET)) - def _parse_external_id(data: object) -> Union[None, Unset, str]: + def _parse_external_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) external_id = _parse_external_id(d.pop("external_id", UNSET)) _managed_by = d.pop("managed_by", UNSET) - managed_by: Union[Unset, CatalogEntityManagedBy] + managed_by: Unset | CatalogEntityManagedBy if isinstance(_managed_by, Unset): managed_by = UNSET else: diff --git a/rootly_sdk/models/catalog_entity_checklist.py b/rootly_sdk/models/catalog_entity_checklist.py index ac0893ca..e13a70db 100644 --- a/rootly_sdk/models/catalog_entity_checklist.py +++ b/rootly_sdk/models/catalog_entity_checklist.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -46,11 +46,11 @@ class CatalogEntityChecklist: status: CatalogEntityChecklistStatus created_at: str updated_at: str - started_at: Union[None, Unset, str] = UNSET - completed_at: Union[None, Unset, str] = UNSET - completed_by_user_id: Union[None, Unset, str] = UNSET - checklist_fields: Union[None, Unset, list["CatalogEntityChecklistChecklistFieldsType0Item"]] = UNSET - checklist_owners: Union[None, Unset, list["CatalogEntityChecklistChecklistOwnersType0Item"]] = UNSET + started_at: None | Unset | str = UNSET + completed_at: None | Unset | str = UNSET + completed_by_user_id: None | Unset | str = UNSET + checklist_fields: None | Unset | list["CatalogEntityChecklistChecklistFieldsType0Item"] = UNSET + checklist_owners: None | Unset | list["CatalogEntityChecklistChecklistOwnersType0Item"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -66,25 +66,25 @@ def to_dict(self) -> dict[str, Any]: updated_at = self.updated_at - started_at: Union[None, Unset, str] + started_at: None | Unset | str if isinstance(self.started_at, Unset): started_at = UNSET else: started_at = self.started_at - completed_at: Union[None, Unset, str] + completed_at: None | Unset | str if isinstance(self.completed_at, Unset): completed_at = UNSET else: completed_at = self.completed_at - completed_by_user_id: Union[None, Unset, str] + completed_by_user_id: None | Unset | str if isinstance(self.completed_by_user_id, Unset): completed_by_user_id = UNSET else: completed_by_user_id = self.completed_by_user_id - checklist_fields: Union[None, Unset, list[dict[str, Any]]] + checklist_fields: None | Unset | list[dict[str, Any]] if isinstance(self.checklist_fields, Unset): checklist_fields = UNSET elif isinstance(self.checklist_fields, list): @@ -96,7 +96,7 @@ def to_dict(self) -> dict[str, Any]: else: checklist_fields = self.checklist_fields - checklist_owners: Union[None, Unset, list[dict[str, Any]]] + checklist_owners: None | Unset | list[dict[str, Any]] if isinstance(self.checklist_owners, Unset): checklist_owners = UNSET elif isinstance(self.checklist_owners, list): @@ -155,36 +155,36 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: updated_at = d.pop("updated_at") - def _parse_started_at(data: object) -> Union[None, Unset, str]: + def _parse_started_at(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) started_at = _parse_started_at(d.pop("started_at", UNSET)) - def _parse_completed_at(data: object) -> Union[None, Unset, str]: + def _parse_completed_at(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) completed_at = _parse_completed_at(d.pop("completed_at", UNSET)) - def _parse_completed_by_user_id(data: object) -> Union[None, Unset, str]: + def _parse_completed_by_user_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) completed_by_user_id = _parse_completed_by_user_id(d.pop("completed_by_user_id", UNSET)) def _parse_checklist_fields( data: object, - ) -> Union[None, Unset, list["CatalogEntityChecklistChecklistFieldsType0Item"]]: + ) -> None | Unset | list["CatalogEntityChecklistChecklistFieldsType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -204,13 +204,13 @@ def _parse_checklist_fields( return checklist_fields_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list["CatalogEntityChecklistChecklistFieldsType0Item"]], data) + return cast(None | Unset | list["CatalogEntityChecklistChecklistFieldsType0Item"], data) checklist_fields = _parse_checklist_fields(d.pop("checklist_fields", UNSET)) def _parse_checklist_owners( data: object, - ) -> Union[None, Unset, list["CatalogEntityChecklistChecklistOwnersType0Item"]]: + ) -> None | Unset | list["CatalogEntityChecklistChecklistOwnersType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -230,7 +230,7 @@ def _parse_checklist_owners( return checklist_owners_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list["CatalogEntityChecklistChecklistOwnersType0Item"]], data) + return cast(None | Unset | list["CatalogEntityChecklistChecklistOwnersType0Item"], data) checklist_owners = _parse_checklist_owners(d.pop("checklist_owners", UNSET)) diff --git a/rootly_sdk/models/catalog_entity_checklist_checklist_fields_type_0_item.py b/rootly_sdk/models/catalog_entity_checklist_checklist_fields_type_0_item.py index 95b68fd3..bcb3ab76 100644 --- a/rootly_sdk/models/catalog_entity_checklist_checklist_fields_type_0_item.py +++ b/rootly_sdk/models/catalog_entity_checklist_checklist_fields_type_0_item.py @@ -26,7 +26,7 @@ class CatalogEntityChecklistChecklistFieldsType0Item: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data: Union[Unset, dict[str, Any]] = UNSET + data: Unset | dict[str, Any] = UNSET if not isinstance(self.data, Unset): data = self.data.to_dict() @@ -46,7 +46,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _data = d.pop("data", UNSET) - data: Union[Unset, CatalogEntityChecklistChecklistFieldsType0ItemData] + data: Unset | CatalogEntityChecklistChecklistFieldsType0ItemData if isinstance(_data, Unset): data = UNSET else: diff --git a/rootly_sdk/models/catalog_entity_checklist_checklist_fields_type_0_item_data.py b/rootly_sdk/models/catalog_entity_checklist_checklist_fields_type_0_item_data.py index 0aabf9ca..ec8b5928 100644 --- a/rootly_sdk/models/catalog_entity_checklist_checklist_fields_type_0_item_data.py +++ b/rootly_sdk/models/catalog_entity_checklist_checklist_fields_type_0_item_data.py @@ -28,19 +28,19 @@ class CatalogEntityChecklistChecklistFieldsType0ItemData: attributes (Union[Unset, CatalogEntityChecklistChecklistFieldsType0ItemDataAttributes]): """ - id: Union[Unset, str] = UNSET - type_: Union[Unset, CatalogEntityChecklistChecklistFieldsType0ItemDataType] = UNSET + id: Unset | str = UNSET + type_: Unset | CatalogEntityChecklistChecklistFieldsType0ItemDataType = UNSET attributes: Union[Unset, "CatalogEntityChecklistChecklistFieldsType0ItemDataAttributes"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: id = self.id - type_: Union[Unset, str] = UNSET + type_: Unset | str = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ - attributes: Union[Unset, dict[str, Any]] = UNSET + attributes: Unset | dict[str, Any] = UNSET if not isinstance(self.attributes, Unset): attributes = self.attributes.to_dict() @@ -66,14 +66,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: id = d.pop("id", UNSET) _type_ = d.pop("type", UNSET) - type_: Union[Unset, CatalogEntityChecklistChecklistFieldsType0ItemDataType] + type_: Unset | CatalogEntityChecklistChecklistFieldsType0ItemDataType if isinstance(_type_, Unset): type_ = UNSET else: type_ = check_catalog_entity_checklist_checklist_fields_type_0_item_data_type(_type_) _attributes = d.pop("attributes", UNSET) - attributes: Union[Unset, CatalogEntityChecklistChecklistFieldsType0ItemDataAttributes] + attributes: Unset | CatalogEntityChecklistChecklistFieldsType0ItemDataAttributes if isinstance(_attributes, Unset): attributes = UNSET else: diff --git a/rootly_sdk/models/catalog_entity_checklist_checklist_fields_type_0_item_data_attributes.py b/rootly_sdk/models/catalog_entity_checklist_checklist_fields_type_0_item_data_attributes.py index d9a99bb0..9a4d70b7 100644 --- a/rootly_sdk/models/catalog_entity_checklist_checklist_fields_type_0_item_data_attributes.py +++ b/rootly_sdk/models/catalog_entity_checklist_checklist_fields_type_0_item_data_attributes.py @@ -31,17 +31,17 @@ class CatalogEntityChecklistChecklistFieldsType0ItemDataAttributes: updated_at (Union[Unset, str]): Date of last update """ - catalog_entity_checklist_id: Union[Unset, str] = UNSET - catalog_checklist_template_field_id: Union[None, Unset, str] = UNSET - field_key: Union[Unset, str] = UNSET - checked: Union[Unset, bool] = UNSET + catalog_entity_checklist_id: Unset | str = UNSET + catalog_checklist_template_field_id: None | Unset | str = UNSET + field_key: Unset | str = UNSET + checked: Unset | bool = UNSET value_snapshot: Union[ "CatalogEntityChecklistChecklistFieldsType0ItemDataAttributesValueSnapshotType0", None, Unset ] = UNSET - completed_by_user_id: Union[None, Unset, str] = UNSET - completed_at: Union[None, Unset, str] = UNSET - created_at: Union[Unset, str] = UNSET - updated_at: Union[Unset, str] = UNSET + completed_by_user_id: None | Unset | str = UNSET + completed_at: None | Unset | str = UNSET + created_at: Unset | str = UNSET + updated_at: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -51,7 +51,7 @@ def to_dict(self) -> dict[str, Any]: catalog_entity_checklist_id = self.catalog_entity_checklist_id - catalog_checklist_template_field_id: Union[None, Unset, str] + catalog_checklist_template_field_id: None | Unset | str if isinstance(self.catalog_checklist_template_field_id, Unset): catalog_checklist_template_field_id = UNSET else: @@ -61,7 +61,7 @@ def to_dict(self) -> dict[str, Any]: checked = self.checked - value_snapshot: Union[None, Unset, dict[str, Any]] + value_snapshot: None | Unset | dict[str, Any] if isinstance(self.value_snapshot, Unset): value_snapshot = UNSET elif isinstance( @@ -71,13 +71,13 @@ def to_dict(self) -> dict[str, Any]: else: value_snapshot = self.value_snapshot - completed_by_user_id: Union[None, Unset, str] + completed_by_user_id: None | Unset | str if isinstance(self.completed_by_user_id, Unset): completed_by_user_id = UNSET else: completed_by_user_id = self.completed_by_user_id - completed_at: Union[None, Unset, str] + completed_at: None | Unset | str if isinstance(self.completed_at, Unset): completed_at = UNSET else: @@ -120,12 +120,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) catalog_entity_checklist_id = d.pop("catalog_entity_checklist_id", UNSET) - def _parse_catalog_checklist_template_field_id(data: object) -> Union[None, Unset, str]: + def _parse_catalog_checklist_template_field_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) catalog_checklist_template_field_id = _parse_catalog_checklist_template_field_id( d.pop("catalog_checklist_template_field_id", UNSET) @@ -159,21 +159,21 @@ def _parse_value_snapshot( value_snapshot = _parse_value_snapshot(d.pop("value_snapshot", UNSET)) - def _parse_completed_by_user_id(data: object) -> Union[None, Unset, str]: + def _parse_completed_by_user_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) completed_by_user_id = _parse_completed_by_user_id(d.pop("completed_by_user_id", UNSET)) - def _parse_completed_at(data: object) -> Union[None, Unset, str]: + def _parse_completed_at(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) completed_at = _parse_completed_at(d.pop("completed_at", UNSET)) diff --git a/rootly_sdk/models/catalog_entity_checklist_checklist_owners_type_0_item.py b/rootly_sdk/models/catalog_entity_checklist_checklist_owners_type_0_item.py index 92dbc718..b5f47041 100644 --- a/rootly_sdk/models/catalog_entity_checklist_checklist_owners_type_0_item.py +++ b/rootly_sdk/models/catalog_entity_checklist_checklist_owners_type_0_item.py @@ -26,7 +26,7 @@ class CatalogEntityChecklistChecklistOwnersType0Item: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data: Union[Unset, dict[str, Any]] = UNSET + data: Unset | dict[str, Any] = UNSET if not isinstance(self.data, Unset): data = self.data.to_dict() @@ -46,7 +46,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _data = d.pop("data", UNSET) - data: Union[Unset, CatalogEntityChecklistChecklistOwnersType0ItemData] + data: Unset | CatalogEntityChecklistChecklistOwnersType0ItemData if isinstance(_data, Unset): data = UNSET else: diff --git a/rootly_sdk/models/catalog_entity_checklist_checklist_owners_type_0_item_data.py b/rootly_sdk/models/catalog_entity_checklist_checklist_owners_type_0_item_data.py index 8ae555a4..04fc37d8 100644 --- a/rootly_sdk/models/catalog_entity_checklist_checklist_owners_type_0_item_data.py +++ b/rootly_sdk/models/catalog_entity_checklist_checklist_owners_type_0_item_data.py @@ -28,19 +28,19 @@ class CatalogEntityChecklistChecklistOwnersType0ItemData: attributes (Union[Unset, CatalogEntityChecklistChecklistOwnersType0ItemDataAttributes]): """ - id: Union[Unset, str] = UNSET - type_: Union[Unset, CatalogEntityChecklistChecklistOwnersType0ItemDataType] = UNSET + id: Unset | str = UNSET + type_: Unset | CatalogEntityChecklistChecklistOwnersType0ItemDataType = UNSET attributes: Union[Unset, "CatalogEntityChecklistChecklistOwnersType0ItemDataAttributes"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: id = self.id - type_: Union[Unset, str] = UNSET + type_: Unset | str = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ - attributes: Union[Unset, dict[str, Any]] = UNSET + attributes: Unset | dict[str, Any] = UNSET if not isinstance(self.attributes, Unset): attributes = self.attributes.to_dict() @@ -66,14 +66,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: id = d.pop("id", UNSET) _type_ = d.pop("type", UNSET) - type_: Union[Unset, CatalogEntityChecklistChecklistOwnersType0ItemDataType] + type_: Unset | CatalogEntityChecklistChecklistOwnersType0ItemDataType if isinstance(_type_, Unset): type_ = UNSET else: type_ = check_catalog_entity_checklist_checklist_owners_type_0_item_data_type(_type_) _attributes = d.pop("attributes", UNSET) - attributes: Union[Unset, CatalogEntityChecklistChecklistOwnersType0ItemDataAttributes] + attributes: Unset | CatalogEntityChecklistChecklistOwnersType0ItemDataAttributes if isinstance(_attributes, Unset): attributes = UNSET else: diff --git a/rootly_sdk/models/catalog_entity_checklist_checklist_owners_type_0_item_data_attributes.py b/rootly_sdk/models/catalog_entity_checklist_checklist_owners_type_0_item_data_attributes.py index cd63986f..1e2f85e4 100644 --- a/rootly_sdk/models/catalog_entity_checklist_checklist_owners_type_0_item_data_attributes.py +++ b/rootly_sdk/models/catalog_entity_checklist_checklist_owners_type_0_item_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,10 +19,10 @@ class CatalogEntityChecklistChecklistOwnersType0ItemDataAttributes: updated_at (Union[Unset, str]): Date of last update """ - catalog_entity_checklist_id: Union[Unset, str] = UNSET - owner_user_id: Union[Unset, str] = UNSET - created_at: Union[Unset, str] = UNSET - updated_at: Union[Unset, str] = UNSET + catalog_entity_checklist_id: Unset | str = UNSET + owner_user_id: Unset | str = UNSET + created_at: Unset | str = UNSET + updated_at: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/catalog_entity_checklist_list.py b/rootly_sdk/models/catalog_entity_checklist_list.py index 576541bb..ab8ee26d 100644 --- a/rootly_sdk/models/catalog_entity_checklist_list.py +++ b/rootly_sdk/models/catalog_entity_checklist_list.py @@ -29,7 +29,7 @@ class CatalogEntityChecklistList: data: list["CatalogEntityChecklistListDataItem"] links: Union[Unset, "Links"] = UNSET meta: Union[Unset, "Meta"] = UNSET - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -38,15 +38,15 @@ def to_dict(self) -> dict[str, Any]: data_item = data_item_data.to_dict() data.append(data_item) - links: Union[Unset, dict[str, Any]] = UNSET + links: Unset | dict[str, Any] = UNSET if not isinstance(self.links, Unset): links = self.links.to_dict() - meta: Union[Unset, dict[str, Any]] = UNSET + meta: Unset | dict[str, Any] = UNSET if not isinstance(self.meta, Unset): meta = self.meta.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +85,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data.append(data_item) _links = d.pop("links", UNSET) - links: Union[Unset, Links] + links: Unset | Links if isinstance(_links, Unset): links = UNSET else: links = Links.from_dict(_links) _meta = d.pop("meta", UNSET) - meta: Union[Unset, Meta] + meta: Unset | Meta if isinstance(_meta, Unset): meta = UNSET else: diff --git a/rootly_sdk/models/catalog_entity_checklist_response.py b/rootly_sdk/models/catalog_entity_checklist_response.py index 48bdb586..85097426 100644 --- a/rootly_sdk/models/catalog_entity_checklist_response.py +++ b/rootly_sdk/models/catalog_entity_checklist_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,13 +23,13 @@ class CatalogEntityChecklistResponse: """ data: "CatalogEntityChecklistResponseData" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/catalog_entity_list.py b/rootly_sdk/models/catalog_entity_list.py index 1c9c6c94..5c111e7e 100644 --- a/rootly_sdk/models/catalog_entity_list.py +++ b/rootly_sdk/models/catalog_entity_list.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,7 +29,7 @@ class CatalogEntityList: data: list["CatalogEntityListDataItem"] links: "Links" meta: "Meta" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/catalog_entity_property_list.py b/rootly_sdk/models/catalog_entity_property_list.py index 48a7dd06..9cfd64a2 100644 --- a/rootly_sdk/models/catalog_entity_property_list.py +++ b/rootly_sdk/models/catalog_entity_property_list.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -31,7 +31,7 @@ class CatalogEntityPropertyList: data: list["CatalogEntityPropertyListDataItem"] links: "Links" meta: "Meta" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -44,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/catalog_entity_property_response.py b/rootly_sdk/models/catalog_entity_property_response.py index f7e5a75f..4d5e1433 100644 --- a/rootly_sdk/models/catalog_entity_property_response.py +++ b/rootly_sdk/models/catalog_entity_property_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -25,13 +25,13 @@ class CatalogEntityPropertyResponse: """ data: "CatalogEntityPropertyResponseData" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/catalog_entity_response.py b/rootly_sdk/models/catalog_entity_response.py index 2ff78524..88a94682 100644 --- a/rootly_sdk/models/catalog_entity_response.py +++ b/rootly_sdk/models/catalog_entity_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,13 +23,13 @@ class CatalogEntityResponse: """ data: "CatalogEntityResponseData" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/catalog_field.py b/rootly_sdk/models/catalog_field.py index a69f88e2..47e853eb 100644 --- a/rootly_sdk/models/catalog_field.py +++ b/rootly_sdk/models/catalog_field.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -32,23 +32,23 @@ class CatalogField: managed_by (Union[Unset, CatalogFieldManagedBy]): Which source manages this resource (read-only). """ - catalog_id: Union[None, str] + catalog_id: None | str name: str kind: CatalogFieldKind multiple: bool - position: Union[None, int] + position: None | int created_at: str updated_at: str - slug: Union[Unset, str] = UNSET - kind_catalog_id: Union[None, Unset, str] = UNSET - required: Union[Unset, bool] = UNSET - catalog_type: Union[Unset, CatalogFieldCatalogType] = UNSET - external_id: Union[None, Unset, str] = UNSET - managed_by: Union[Unset, CatalogFieldManagedBy] = UNSET + slug: Unset | str = UNSET + kind_catalog_id: None | Unset | str = UNSET + required: Unset | bool = UNSET + catalog_type: Unset | CatalogFieldCatalogType = UNSET + external_id: None | Unset | str = UNSET + managed_by: Unset | CatalogFieldManagedBy = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - catalog_id: Union[None, str] + catalog_id: None | str catalog_id = self.catalog_id name = self.name @@ -57,7 +57,7 @@ def to_dict(self) -> dict[str, Any]: multiple = self.multiple - position: Union[None, int] + position: None | int position = self.position created_at = self.created_at @@ -66,7 +66,7 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - kind_catalog_id: Union[None, Unset, str] + kind_catalog_id: None | Unset | str if isinstance(self.kind_catalog_id, Unset): kind_catalog_id = UNSET else: @@ -74,17 +74,17 @@ def to_dict(self) -> dict[str, Any]: required = self.required - catalog_type: Union[Unset, str] = UNSET + catalog_type: Unset | str = UNSET if not isinstance(self.catalog_type, Unset): catalog_type = self.catalog_type - external_id: Union[None, Unset, str] + external_id: None | Unset | str if isinstance(self.external_id, Unset): external_id = UNSET else: external_id = self.external_id - managed_by: Union[Unset, str] = UNSET + managed_by: Unset | str = UNSET if not isinstance(self.managed_by, Unset): managed_by = self.managed_by @@ -120,10 +120,10 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_catalog_id(data: object) -> Union[None, str]: + def _parse_catalog_id(data: object) -> None | str: if data is None: return data - return cast(Union[None, str], data) + return cast(None | str, data) catalog_id = _parse_catalog_id(d.pop("catalog_id")) @@ -133,10 +133,10 @@ def _parse_catalog_id(data: object) -> Union[None, str]: multiple = d.pop("multiple") - def _parse_position(data: object) -> Union[None, int]: + def _parse_position(data: object) -> None | int: if data is None: return data - return cast(Union[None, int], data) + return cast(None | int, data) position = _parse_position(d.pop("position")) @@ -146,35 +146,35 @@ def _parse_position(data: object) -> Union[None, int]: slug = d.pop("slug", UNSET) - def _parse_kind_catalog_id(data: object) -> Union[None, Unset, str]: + def _parse_kind_catalog_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) kind_catalog_id = _parse_kind_catalog_id(d.pop("kind_catalog_id", UNSET)) required = d.pop("required", UNSET) _catalog_type = d.pop("catalog_type", UNSET) - catalog_type: Union[Unset, CatalogFieldCatalogType] + catalog_type: Unset | CatalogFieldCatalogType if isinstance(_catalog_type, Unset): catalog_type = UNSET else: catalog_type = check_catalog_field_catalog_type(_catalog_type) - def _parse_external_id(data: object) -> Union[None, Unset, str]: + def _parse_external_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) external_id = _parse_external_id(d.pop("external_id", UNSET)) _managed_by = d.pop("managed_by", UNSET) - managed_by: Union[Unset, CatalogFieldManagedBy] + managed_by: Unset | CatalogFieldManagedBy if isinstance(_managed_by, Unset): managed_by = UNSET else: diff --git a/rootly_sdk/models/catalog_field_list.py b/rootly_sdk/models/catalog_field_list.py index aee4306e..69edf3ce 100644 --- a/rootly_sdk/models/catalog_field_list.py +++ b/rootly_sdk/models/catalog_field_list.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,7 +29,7 @@ class CatalogFieldList: data: list["CatalogFieldListDataItem"] links: "Links" meta: "Meta" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/catalog_field_response.py b/rootly_sdk/models/catalog_field_response.py index bdf07e64..18ae0ed0 100644 --- a/rootly_sdk/models/catalog_field_response.py +++ b/rootly_sdk/models/catalog_field_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,13 +23,13 @@ class CatalogFieldResponse: """ data: "CatalogFieldResponseData" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/catalog_list.py b/rootly_sdk/models/catalog_list.py index a66b7913..c307f652 100644 --- a/rootly_sdk/models/catalog_list.py +++ b/rootly_sdk/models/catalog_list.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,7 +29,7 @@ class CatalogList: data: list["CatalogListDataItem"] links: "Links" meta: "Meta" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/catalog_property.py b/rootly_sdk/models/catalog_property.py index 497241cd..af5b8991 100644 --- a/rootly_sdk/models/catalog_property.py +++ b/rootly_sdk/models/catalog_property.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -32,23 +32,23 @@ class CatalogProperty: managed_by (Union[Unset, CatalogPropertyManagedBy]): Which source manages this resource (read-only). """ - catalog_id: Union[None, str] + catalog_id: None | str name: str kind: CatalogPropertyKind multiple: bool - position: Union[None, int] + position: None | int created_at: str updated_at: str - slug: Union[Unset, str] = UNSET - kind_catalog_id: Union[None, Unset, str] = UNSET - required: Union[Unset, bool] = UNSET - catalog_type: Union[Unset, CatalogPropertyCatalogType] = UNSET - external_id: Union[None, Unset, str] = UNSET - managed_by: Union[Unset, CatalogPropertyManagedBy] = UNSET + slug: Unset | str = UNSET + kind_catalog_id: None | Unset | str = UNSET + required: Unset | bool = UNSET + catalog_type: Unset | CatalogPropertyCatalogType = UNSET + external_id: None | Unset | str = UNSET + managed_by: Unset | CatalogPropertyManagedBy = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - catalog_id: Union[None, str] + catalog_id: None | str catalog_id = self.catalog_id name = self.name @@ -57,7 +57,7 @@ def to_dict(self) -> dict[str, Any]: multiple = self.multiple - position: Union[None, int] + position: None | int position = self.position created_at = self.created_at @@ -66,7 +66,7 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - kind_catalog_id: Union[None, Unset, str] + kind_catalog_id: None | Unset | str if isinstance(self.kind_catalog_id, Unset): kind_catalog_id = UNSET else: @@ -74,17 +74,17 @@ def to_dict(self) -> dict[str, Any]: required = self.required - catalog_type: Union[Unset, str] = UNSET + catalog_type: Unset | str = UNSET if not isinstance(self.catalog_type, Unset): catalog_type = self.catalog_type - external_id: Union[None, Unset, str] + external_id: None | Unset | str if isinstance(self.external_id, Unset): external_id = UNSET else: external_id = self.external_id - managed_by: Union[Unset, str] = UNSET + managed_by: Unset | str = UNSET if not isinstance(self.managed_by, Unset): managed_by = self.managed_by @@ -120,10 +120,10 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_catalog_id(data: object) -> Union[None, str]: + def _parse_catalog_id(data: object) -> None | str: if data is None: return data - return cast(Union[None, str], data) + return cast(None | str, data) catalog_id = _parse_catalog_id(d.pop("catalog_id")) @@ -133,10 +133,10 @@ def _parse_catalog_id(data: object) -> Union[None, str]: multiple = d.pop("multiple") - def _parse_position(data: object) -> Union[None, int]: + def _parse_position(data: object) -> None | int: if data is None: return data - return cast(Union[None, int], data) + return cast(None | int, data) position = _parse_position(d.pop("position")) @@ -146,35 +146,35 @@ def _parse_position(data: object) -> Union[None, int]: slug = d.pop("slug", UNSET) - def _parse_kind_catalog_id(data: object) -> Union[None, Unset, str]: + def _parse_kind_catalog_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) kind_catalog_id = _parse_kind_catalog_id(d.pop("kind_catalog_id", UNSET)) required = d.pop("required", UNSET) _catalog_type = d.pop("catalog_type", UNSET) - catalog_type: Union[Unset, CatalogPropertyCatalogType] + catalog_type: Unset | CatalogPropertyCatalogType if isinstance(_catalog_type, Unset): catalog_type = UNSET else: catalog_type = check_catalog_property_catalog_type(_catalog_type) - def _parse_external_id(data: object) -> Union[None, Unset, str]: + def _parse_external_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) external_id = _parse_external_id(d.pop("external_id", UNSET)) _managed_by = d.pop("managed_by", UNSET) - managed_by: Union[Unset, CatalogPropertyManagedBy] + managed_by: Unset | CatalogPropertyManagedBy if isinstance(_managed_by, Unset): managed_by = UNSET else: diff --git a/rootly_sdk/models/catalog_property_list.py b/rootly_sdk/models/catalog_property_list.py index 0888e714..d61b7225 100644 --- a/rootly_sdk/models/catalog_property_list.py +++ b/rootly_sdk/models/catalog_property_list.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,7 +29,7 @@ class CatalogPropertyList: data: list["CatalogPropertyListDataItem"] links: "Links" meta: "Meta" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/catalog_property_response.py b/rootly_sdk/models/catalog_property_response.py index 4db32d00..f4669081 100644 --- a/rootly_sdk/models/catalog_property_response.py +++ b/rootly_sdk/models/catalog_property_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,13 +23,13 @@ class CatalogPropertyResponse: """ data: "CatalogPropertyResponseData" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/catalog_response.py b/rootly_sdk/models/catalog_response.py index bd17dcd5..77b93a64 100644 --- a/rootly_sdk/models/catalog_response.py +++ b/rootly_sdk/models/catalog_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,13 +23,13 @@ class CatalogResponse: """ data: "CatalogResponseData" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/cause.py b/rootly_sdk/models/cause.py index 8d0e9f10..ac51daa7 100644 --- a/rootly_sdk/models/cause.py +++ b/rootly_sdk/models/cause.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -30,11 +30,11 @@ class Cause: name: str created_at: str updated_at: str - slug: Union[Unset, str] = UNSET - description: Union[None, Unset, str] = UNSET - public_description: Union[None, Unset, str] = UNSET - position: Union[None, Unset, int] = UNSET - properties: Union[Unset, list["CausePropertiesItem"]] = UNSET + slug: Unset | str = UNSET + description: None | Unset | str = UNSET + public_description: None | Unset | str = UNSET + position: None | Unset | int = UNSET + properties: Unset | list["CausePropertiesItem"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -46,25 +46,25 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - public_description: Union[None, Unset, str] + public_description: None | Unset | str if isinstance(self.public_description, Unset): public_description = UNSET else: public_description = self.public_description - position: Union[None, Unset, int] + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: position = self.position - properties: Union[Unset, list[dict[str, Any]]] = UNSET + properties: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.properties, Unset): properties = [] for properties_item_data in self.properties: @@ -106,30 +106,30 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: slug = d.pop("slug", UNSET) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_public_description(data: object) -> Union[None, Unset, str]: + def _parse_public_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) public_description = _parse_public_description(d.pop("public_description", UNSET)) - def _parse_position(data: object) -> Union[None, Unset, int]: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) diff --git a/rootly_sdk/models/cause_list.py b/rootly_sdk/models/cause_list.py index 91cf4159..b2a05e85 100644 --- a/rootly_sdk/models/cause_list.py +++ b/rootly_sdk/models/cause_list.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,7 +29,7 @@ class CauseList: data: list["CauseListDataItem"] links: "Links" meta: "Meta" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/cause_response.py b/rootly_sdk/models/cause_response.py index dadded01..8db75808 100644 --- a/rootly_sdk/models/cause_response.py +++ b/rootly_sdk/models/cause_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,13 +23,13 @@ class CauseResponse: """ data: "CauseResponseData" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/change_google_chat_space_privacy_task_params.py b/rootly_sdk/models/change_google_chat_space_privacy_task_params.py index dbae8087..7e38b344 100644 --- a/rootly_sdk/models/change_google_chat_space_privacy_task_params.py +++ b/rootly_sdk/models/change_google_chat_space_privacy_task_params.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -28,18 +28,18 @@ class ChangeGoogleChatSpacePrivacyTaskParams: """ space: "ChangeGoogleChatSpacePrivacyTaskParamsSpace" - task_type: Union[Unset, ChangeGoogleChatSpacePrivacyTaskParamsTaskType] = UNSET - audience: Union[None, Unset, str] = UNSET + task_type: Unset | ChangeGoogleChatSpacePrivacyTaskParamsTaskType = UNSET + audience: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: space = self.space.to_dict() - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - audience: Union[None, Unset, str] + audience: None | Unset | str if isinstance(self.audience, Unset): audience = UNSET else: @@ -69,18 +69,18 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: space = ChangeGoogleChatSpacePrivacyTaskParamsSpace.from_dict(d.pop("space")) _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, ChangeGoogleChatSpacePrivacyTaskParamsTaskType] + task_type: Unset | ChangeGoogleChatSpacePrivacyTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: task_type = check_change_google_chat_space_privacy_task_params_task_type(_task_type) - def _parse_audience(data: object) -> Union[None, Unset, str]: + def _parse_audience(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) audience = _parse_audience(d.pop("audience", UNSET)) diff --git a/rootly_sdk/models/change_google_chat_space_privacy_task_params_space.py b/rootly_sdk/models/change_google_chat_space_privacy_task_params_space.py index b756ca5d..a9116862 100644 --- a/rootly_sdk/models/change_google_chat_space_privacy_task_params_space.py +++ b/rootly_sdk/models/change_google_chat_space_privacy_task_params_space.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class ChangeGoogleChatSpacePrivacyTaskParamsSpace: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/change_slack_channel_privacy_task_params.py b/rootly_sdk/models/change_slack_channel_privacy_task_params.py index 3570c17a..3c87f256 100644 --- a/rootly_sdk/models/change_slack_channel_privacy_task_params.py +++ b/rootly_sdk/models/change_slack_channel_privacy_task_params.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -32,7 +32,7 @@ class ChangeSlackChannelPrivacyTaskParams: channel: "ChangeSlackChannelPrivacyTaskParamsChannel" privacy: ChangeSlackChannelPrivacyTaskParamsPrivacy - task_type: Union[Unset, ChangeSlackChannelPrivacyTaskParamsTaskType] = UNSET + task_type: Unset | ChangeSlackChannelPrivacyTaskParamsTaskType = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -40,7 +40,7 @@ def to_dict(self) -> dict[str, Any]: privacy: str = self.privacy - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -67,7 +67,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: privacy = check_change_slack_channel_privacy_task_params_privacy(d.pop("privacy")) _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, ChangeSlackChannelPrivacyTaskParamsTaskType] + task_type: Unset | ChangeSlackChannelPrivacyTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/change_slack_channel_privacy_task_params_channel.py b/rootly_sdk/models/change_slack_channel_privacy_task_params_channel.py index 4f4c08c3..4457d494 100644 --- a/rootly_sdk/models/change_slack_channel_privacy_task_params_channel.py +++ b/rootly_sdk/models/change_slack_channel_privacy_task_params_channel.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class ChangeSlackChannelPrivacyTaskParamsChannel: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/communications_group.py b/rootly_sdk/models/communications_group.py index 0ea7ef03..5c8f0903 100644 --- a/rootly_sdk/models/communications_group.py +++ b/rootly_sdk/models/communications_group.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -52,16 +52,16 @@ class CommunicationsGroup: email_channel: bool created_at: str updated_at: str - slug: Union[Unset, str] = UNSET - description: Union[None, Unset, str] = UNSET - communication_group_conditions: Union[ - None, Unset, list["CommunicationsGroupCommunicationGroupConditionsType0Item"] - ] = UNSET - member_ids: Union[None, Unset, list[int]] = UNSET - slack_channel_ids: Union[None, Unset, list[str]] = UNSET - communication_external_group_members: Union[ - None, Unset, list["CommunicationsGroupCommunicationExternalGroupMembersType0Item"] - ] = UNSET + slug: Unset | str = UNSET + description: None | Unset | str = UNSET + communication_group_conditions: None | Unset | list["CommunicationsGroupCommunicationGroupConditionsType0Item"] = ( + UNSET + ) + member_ids: None | Unset | list[int] = UNSET + slack_channel_ids: None | Unset | list[str] = UNSET + communication_external_group_members: ( + None | Unset | list["CommunicationsGroupCommunicationExternalGroupMembersType0Item"] + ) = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -83,13 +83,13 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - communication_group_conditions: Union[None, Unset, list[dict[str, Any]]] + communication_group_conditions: None | Unset | list[dict[str, Any]] if isinstance(self.communication_group_conditions, Unset): communication_group_conditions = UNSET elif isinstance(self.communication_group_conditions, list): @@ -101,7 +101,7 @@ def to_dict(self) -> dict[str, Any]: else: communication_group_conditions = self.communication_group_conditions - member_ids: Union[None, Unset, list[int]] + member_ids: None | Unset | list[int] if isinstance(self.member_ids, Unset): member_ids = UNSET elif isinstance(self.member_ids, list): @@ -110,7 +110,7 @@ def to_dict(self) -> dict[str, Any]: else: member_ids = self.member_ids - slack_channel_ids: Union[None, Unset, list[str]] + slack_channel_ids: None | Unset | list[str] if isinstance(self.slack_channel_ids, Unset): slack_channel_ids = UNSET elif isinstance(self.slack_channel_ids, list): @@ -119,7 +119,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_channel_ids = self.slack_channel_ids - communication_external_group_members: Union[None, Unset, list[dict[str, Any]]] + communication_external_group_members: None | Unset | list[dict[str, Any]] if isinstance(self.communication_external_group_members, Unset): communication_external_group_members = UNSET elif isinstance(self.communication_external_group_members, list): @@ -190,18 +190,18 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: slug = d.pop("slug", UNSET) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) def _parse_communication_group_conditions( data: object, - ) -> Union[None, Unset, list["CommunicationsGroupCommunicationGroupConditionsType0Item"]]: + ) -> None | Unset | list["CommunicationsGroupCommunicationGroupConditionsType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -223,13 +223,13 @@ def _parse_communication_group_conditions( return communication_group_conditions_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list["CommunicationsGroupCommunicationGroupConditionsType0Item"]], data) + return cast(None | Unset | list["CommunicationsGroupCommunicationGroupConditionsType0Item"], data) communication_group_conditions = _parse_communication_group_conditions( d.pop("communication_group_conditions", UNSET) ) - def _parse_member_ids(data: object) -> Union[None, Unset, list[int]]: + def _parse_member_ids(data: object) -> None | Unset | list[int]: if data is None: return data if isinstance(data, Unset): @@ -242,11 +242,11 @@ def _parse_member_ids(data: object) -> Union[None, Unset, list[int]]: return member_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[int]], data) + return cast(None | Unset | list[int], data) member_ids = _parse_member_ids(d.pop("member_ids", UNSET)) - def _parse_slack_channel_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_slack_channel_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -259,13 +259,13 @@ def _parse_slack_channel_ids(data: object) -> Union[None, Unset, list[str]]: return slack_channel_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) slack_channel_ids = _parse_slack_channel_ids(d.pop("slack_channel_ids", UNSET)) def _parse_communication_external_group_members( data: object, - ) -> Union[None, Unset, list["CommunicationsGroupCommunicationExternalGroupMembersType0Item"]]: + ) -> None | Unset | list["CommunicationsGroupCommunicationExternalGroupMembersType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -289,7 +289,7 @@ def _parse_communication_external_group_members( return communication_external_group_members_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list["CommunicationsGroupCommunicationExternalGroupMembersType0Item"]], data) + return cast(None | Unset | list["CommunicationsGroupCommunicationExternalGroupMembersType0Item"], data) communication_external_group_members = _parse_communication_external_group_members( d.pop("communication_external_group_members", UNSET) diff --git a/rootly_sdk/models/communications_group_communication_external_group_members_type_0_item.py b/rootly_sdk/models/communications_group_communication_external_group_members_type_0_item.py index 17a38c3f..51c6093d 100644 --- a/rootly_sdk/models/communications_group_communication_external_group_members_type_0_item.py +++ b/rootly_sdk/models/communications_group_communication_external_group_members_type_0_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,10 +19,10 @@ class CommunicationsGroupCommunicationExternalGroupMembersType0Item: phone_number (Union[Unset, str]): Phone number of the external member """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET - email: Union[Unset, str] = UNSET - phone_number: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET + email: Unset | str = UNSET + phone_number: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/communications_group_communication_group_conditions_type_0_item.py b/rootly_sdk/models/communications_group_communication_group_conditions_type_0_item.py index ca010751..49c2521d 100644 --- a/rootly_sdk/models/communications_group_communication_group_conditions_type_0_item.py +++ b/rootly_sdk/models/communications_group_communication_group_conditions_type_0_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -26,20 +26,20 @@ class CommunicationsGroupCommunicationGroupConditionsType0Item: incident_type_ids (Union[None, Unset, list[str]]): Array of incident type IDs """ - property_type: Union[Unset, CommunicationsGroupCommunicationGroupConditionsType0ItemPropertyType] = UNSET - service_ids: Union[None, Unset, list[str]] = UNSET - severity_ids: Union[None, Unset, list[str]] = UNSET - functionality_ids: Union[None, Unset, list[str]] = UNSET - group_ids: Union[None, Unset, list[str]] = UNSET - incident_type_ids: Union[None, Unset, list[str]] = UNSET + property_type: Unset | CommunicationsGroupCommunicationGroupConditionsType0ItemPropertyType = UNSET + service_ids: None | Unset | list[str] = UNSET + severity_ids: None | Unset | list[str] = UNSET + functionality_ids: None | Unset | list[str] = UNSET + group_ids: None | Unset | list[str] = UNSET + incident_type_ids: None | Unset | list[str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - property_type: Union[Unset, str] = UNSET + property_type: Unset | str = UNSET if not isinstance(self.property_type, Unset): property_type = self.property_type - service_ids: Union[None, Unset, list[str]] + service_ids: None | Unset | list[str] if isinstance(self.service_ids, Unset): service_ids = UNSET elif isinstance(self.service_ids, list): @@ -48,7 +48,7 @@ def to_dict(self) -> dict[str, Any]: else: service_ids = self.service_ids - severity_ids: Union[None, Unset, list[str]] + severity_ids: None | Unset | list[str] if isinstance(self.severity_ids, Unset): severity_ids = UNSET elif isinstance(self.severity_ids, list): @@ -57,7 +57,7 @@ def to_dict(self) -> dict[str, Any]: else: severity_ids = self.severity_ids - functionality_ids: Union[None, Unset, list[str]] + functionality_ids: None | Unset | list[str] if isinstance(self.functionality_ids, Unset): functionality_ids = UNSET elif isinstance(self.functionality_ids, list): @@ -66,7 +66,7 @@ def to_dict(self) -> dict[str, Any]: else: functionality_ids = self.functionality_ids - group_ids: Union[None, Unset, list[str]] + group_ids: None | Unset | list[str] if isinstance(self.group_ids, Unset): group_ids = UNSET elif isinstance(self.group_ids, list): @@ -75,7 +75,7 @@ def to_dict(self) -> dict[str, Any]: else: group_ids = self.group_ids - incident_type_ids: Union[None, Unset, list[str]] + incident_type_ids: None | Unset | list[str] if isinstance(self.incident_type_ids, Unset): incident_type_ids = UNSET elif isinstance(self.incident_type_ids, list): @@ -106,7 +106,7 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _property_type = d.pop("property_type", UNSET) - property_type: Union[Unset, CommunicationsGroupCommunicationGroupConditionsType0ItemPropertyType] + property_type: Unset | CommunicationsGroupCommunicationGroupConditionsType0ItemPropertyType if isinstance(_property_type, Unset): property_type = UNSET else: @@ -114,7 +114,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: _property_type ) - def _parse_service_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_service_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -127,11 +127,11 @@ def _parse_service_ids(data: object) -> Union[None, Unset, list[str]]: return service_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) service_ids = _parse_service_ids(d.pop("service_ids", UNSET)) - def _parse_severity_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_severity_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -144,11 +144,11 @@ def _parse_severity_ids(data: object) -> Union[None, Unset, list[str]]: return severity_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) severity_ids = _parse_severity_ids(d.pop("severity_ids", UNSET)) - def _parse_functionality_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_functionality_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -161,11 +161,11 @@ def _parse_functionality_ids(data: object) -> Union[None, Unset, list[str]]: return functionality_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) functionality_ids = _parse_functionality_ids(d.pop("functionality_ids", UNSET)) - def _parse_group_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_group_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -178,11 +178,11 @@ def _parse_group_ids(data: object) -> Union[None, Unset, list[str]]: return group_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) group_ids = _parse_group_ids(d.pop("group_ids", UNSET)) - def _parse_incident_type_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_incident_type_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -195,7 +195,7 @@ def _parse_incident_type_ids(data: object) -> Union[None, Unset, list[str]]: return incident_type_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) incident_type_ids = _parse_incident_type_ids(d.pop("incident_type_ids", UNSET)) diff --git a/rootly_sdk/models/communications_group_response.py b/rootly_sdk/models/communications_group_response.py index 315560df..6c34df6d 100644 --- a/rootly_sdk/models/communications_group_response.py +++ b/rootly_sdk/models/communications_group_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,13 +23,13 @@ class CommunicationsGroupResponse: """ data: "CommunicationsGroupResponseData" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/communications_groups_response.py b/rootly_sdk/models/communications_groups_response.py index c1168002..f38a5fcf 100644 --- a/rootly_sdk/models/communications_groups_response.py +++ b/rootly_sdk/models/communications_groups_response.py @@ -29,7 +29,7 @@ class CommunicationsGroupsResponse: data: list["CommunicationsGroupsResponseDataItem"] links: Union[Unset, "Links"] = UNSET meta: Union[Unset, "Meta"] = UNSET - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -38,15 +38,15 @@ def to_dict(self) -> dict[str, Any]: data_item = data_item_data.to_dict() data.append(data_item) - links: Union[Unset, dict[str, Any]] = UNSET + links: Unset | dict[str, Any] = UNSET if not isinstance(self.links, Unset): links = self.links.to_dict() - meta: Union[Unset, dict[str, Any]] = UNSET + meta: Unset | dict[str, Any] = UNSET if not isinstance(self.meta, Unset): meta = self.meta.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +85,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data.append(data_item) _links = d.pop("links", UNSET) - links: Union[Unset, Links] + links: Unset | Links if isinstance(_links, Unset): links = UNSET else: links = Links.from_dict(_links) _meta = d.pop("meta", UNSET) - meta: Union[Unset, Meta] + meta: Unset | Meta if isinstance(_meta, Unset): meta = UNSET else: diff --git a/rootly_sdk/models/communications_stage.py b/rootly_sdk/models/communications_stage.py index 382def07..fadd1b8c 100644 --- a/rootly_sdk/models/communications_stage.py +++ b/rootly_sdk/models/communications_stage.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,17 +22,17 @@ class CommunicationsStage: """ name: str - position: Union[None, int] + position: None | int created_at: str updated_at: str - slug: Union[Unset, str] = UNSET - description: Union[None, Unset, str] = UNSET + slug: Unset | str = UNSET + description: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: name = self.name - position: Union[None, int] + position: None | int position = self.position created_at = self.created_at @@ -41,7 +41,7 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: @@ -69,10 +69,10 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name") - def _parse_position(data: object) -> Union[None, int]: + def _parse_position(data: object) -> None | int: if data is None: return data - return cast(Union[None, int], data) + return cast(None | int, data) position = _parse_position(d.pop("position")) @@ -82,12 +82,12 @@ def _parse_position(data: object) -> Union[None, int]: slug = d.pop("slug", UNSET) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) diff --git a/rootly_sdk/models/communications_stage_response.py b/rootly_sdk/models/communications_stage_response.py index 5516fdae..cadf4ee8 100644 --- a/rootly_sdk/models/communications_stage_response.py +++ b/rootly_sdk/models/communications_stage_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,13 +23,13 @@ class CommunicationsStageResponse: """ data: "CommunicationsStageResponseData" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/communications_stages_response.py b/rootly_sdk/models/communications_stages_response.py index 4ac096f5..70d1fd5c 100644 --- a/rootly_sdk/models/communications_stages_response.py +++ b/rootly_sdk/models/communications_stages_response.py @@ -29,7 +29,7 @@ class CommunicationsStagesResponse: data: list["CommunicationsStagesResponseDataItem"] links: Union[Unset, "Links"] = UNSET meta: Union[Unset, "Meta"] = UNSET - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -38,15 +38,15 @@ def to_dict(self) -> dict[str, Any]: data_item = data_item_data.to_dict() data.append(data_item) - links: Union[Unset, dict[str, Any]] = UNSET + links: Unset | dict[str, Any] = UNSET if not isinstance(self.links, Unset): links = self.links.to_dict() - meta: Union[Unset, dict[str, Any]] = UNSET + meta: Unset | dict[str, Any] = UNSET if not isinstance(self.meta, Unset): meta = self.meta.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +85,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data.append(data_item) _links = d.pop("links", UNSET) - links: Union[Unset, Links] + links: Unset | Links if isinstance(_links, Unset): links = UNSET else: links = Links.from_dict(_links) _meta = d.pop("meta", UNSET) - meta: Union[Unset, Meta] + meta: Unset | Meta if isinstance(_meta, Unset): meta = UNSET else: diff --git a/rootly_sdk/models/communications_template.py b/rootly_sdk/models/communications_template.py index 9e24305c..1e892142 100644 --- a/rootly_sdk/models/communications_template.py +++ b/rootly_sdk/models/communications_template.py @@ -33,22 +33,22 @@ class CommunicationsTemplate: """ name: str - position: Union[None, int] + position: None | int created_at: str updated_at: str - slug: Union[Unset, str] = UNSET - description: Union[None, Unset, str] = UNSET - communication_type_id: Union[Unset, str] = UNSET - communication_template_stages: Union[ - None, Unset, list["CommunicationsTemplateCommunicationTemplateStagesType0Item"] - ] = UNSET + slug: Unset | str = UNSET + description: None | Unset | str = UNSET + communication_type_id: Unset | str = UNSET + communication_template_stages: None | Unset | list["CommunicationsTemplateCommunicationTemplateStagesType0Item"] = ( + UNSET + ) communication_type: Union[Unset, "CommunicationsTemplateCommunicationType"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: name = self.name - position: Union[None, int] + position: None | int position = self.position created_at = self.created_at @@ -57,7 +57,7 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: @@ -65,7 +65,7 @@ def to_dict(self) -> dict[str, Any]: communication_type_id = self.communication_type_id - communication_template_stages: Union[None, Unset, list[dict[str, Any]]] + communication_template_stages: None | Unset | list[dict[str, Any]] if isinstance(self.communication_template_stages, Unset): communication_template_stages = UNSET elif isinstance(self.communication_template_stages, list): @@ -77,7 +77,7 @@ def to_dict(self) -> dict[str, Any]: else: communication_template_stages = self.communication_template_stages - communication_type: Union[Unset, dict[str, Any]] = UNSET + communication_type: Unset | dict[str, Any] = UNSET if not isinstance(self.communication_type, Unset): communication_type = self.communication_type.to_dict() @@ -114,10 +114,10 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name") - def _parse_position(data: object) -> Union[None, int]: + def _parse_position(data: object) -> None | int: if data is None: return data - return cast(Union[None, int], data) + return cast(None | int, data) position = _parse_position(d.pop("position")) @@ -127,12 +127,12 @@ def _parse_position(data: object) -> Union[None, int]: slug = d.pop("slug", UNSET) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) @@ -140,7 +140,7 @@ def _parse_description(data: object) -> Union[None, Unset, str]: def _parse_communication_template_stages( data: object, - ) -> Union[None, Unset, list["CommunicationsTemplateCommunicationTemplateStagesType0Item"]]: + ) -> None | Unset | list["CommunicationsTemplateCommunicationTemplateStagesType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -162,14 +162,14 @@ def _parse_communication_template_stages( return communication_template_stages_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list["CommunicationsTemplateCommunicationTemplateStagesType0Item"]], data) + return cast(None | Unset | list["CommunicationsTemplateCommunicationTemplateStagesType0Item"], data) communication_template_stages = _parse_communication_template_stages( d.pop("communication_template_stages", UNSET) ) _communication_type = d.pop("communication_type", UNSET) - communication_type: Union[Unset, CommunicationsTemplateCommunicationType] + communication_type: Unset | CommunicationsTemplateCommunicationType if isinstance(_communication_type, Unset): communication_type = UNSET else: diff --git a/rootly_sdk/models/communications_template_communication_template_stages_type_0_item.py b/rootly_sdk/models/communications_template_communication_template_stages_type_0_item.py index 634f7c75..94f47d8b 100644 --- a/rootly_sdk/models/communications_template_communication_template_stages_type_0_item.py +++ b/rootly_sdk/models/communications_template_communication_template_stages_type_0_item.py @@ -26,7 +26,7 @@ class CommunicationsTemplateCommunicationTemplateStagesType0Item: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data: Union[Unset, dict[str, Any]] = UNSET + data: Unset | dict[str, Any] = UNSET if not isinstance(self.data, Unset): data = self.data.to_dict() @@ -46,7 +46,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _data = d.pop("data", UNSET) - data: Union[Unset, CommunicationsTemplateCommunicationTemplateStagesType0ItemData] + data: Unset | CommunicationsTemplateCommunicationTemplateStagesType0ItemData if isinstance(_data, Unset): data = UNSET else: diff --git a/rootly_sdk/models/communications_template_communication_template_stages_type_0_item_data.py b/rootly_sdk/models/communications_template_communication_template_stages_type_0_item_data.py index 2fb45e5e..318d79c6 100644 --- a/rootly_sdk/models/communications_template_communication_template_stages_type_0_item_data.py +++ b/rootly_sdk/models/communications_template_communication_template_stages_type_0_item_data.py @@ -28,19 +28,19 @@ class CommunicationsTemplateCommunicationTemplateStagesType0ItemData: attributes (Union[Unset, CommunicationsTemplateCommunicationTemplateStagesType0ItemDataAttributes]): """ - id: Union[Unset, str] = UNSET - type_: Union[Unset, CommunicationsTemplateCommunicationTemplateStagesType0ItemDataType] = UNSET + id: Unset | str = UNSET + type_: Unset | CommunicationsTemplateCommunicationTemplateStagesType0ItemDataType = UNSET attributes: Union[Unset, "CommunicationsTemplateCommunicationTemplateStagesType0ItemDataAttributes"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: id = self.id - type_: Union[Unset, str] = UNSET + type_: Unset | str = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ - attributes: Union[Unset, dict[str, Any]] = UNSET + attributes: Unset | dict[str, Any] = UNSET if not isinstance(self.attributes, Unset): attributes = self.attributes.to_dict() @@ -66,14 +66,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: id = d.pop("id", UNSET) _type_ = d.pop("type", UNSET) - type_: Union[Unset, CommunicationsTemplateCommunicationTemplateStagesType0ItemDataType] + type_: Unset | CommunicationsTemplateCommunicationTemplateStagesType0ItemDataType if isinstance(_type_, Unset): type_ = UNSET else: type_ = check_communications_template_communication_template_stages_type_0_item_data_type(_type_) _attributes = d.pop("attributes", UNSET) - attributes: Union[Unset, CommunicationsTemplateCommunicationTemplateStagesType0ItemDataAttributes] + attributes: Unset | CommunicationsTemplateCommunicationTemplateStagesType0ItemDataAttributes if isinstance(_attributes, Unset): attributes = UNSET else: diff --git a/rootly_sdk/models/communications_template_communication_template_stages_type_0_item_data_attributes.py b/rootly_sdk/models/communications_template_communication_template_stages_type_0_item_data_attributes.py index fd0747c1..cabf8621 100644 --- a/rootly_sdk/models/communications_template_communication_template_stages_type_0_item_data_attributes.py +++ b/rootly_sdk/models/communications_template_communication_template_stages_type_0_item_data_attributes.py @@ -34,12 +34,12 @@ class CommunicationsTemplateCommunicationTemplateStagesType0ItemDataAttributes: CommunicationsTemplateCommunicationTemplateStagesType0ItemDataAttributesCommunicationTemplate]): """ - email_body: Union[None, Unset, str] = UNSET - email_subject: Union[None, Unset, str] = UNSET - slack_content: Union[None, Unset, str] = UNSET - sms_content: Union[None, Unset, str] = UNSET - created_at: Union[Unset, str] = UNSET - updated_at: Union[Unset, str] = UNSET + email_body: None | Unset | str = UNSET + email_subject: None | Unset | str = UNSET + slack_content: None | Unset | str = UNSET + sms_content: None | Unset | str = UNSET + created_at: Unset | str = UNSET + updated_at: Unset | str = UNSET communication_stage: Union[ Unset, "CommunicationsTemplateCommunicationTemplateStagesType0ItemDataAttributesCommunicationStage" ] = UNSET @@ -49,25 +49,25 @@ class CommunicationsTemplateCommunicationTemplateStagesType0ItemDataAttributes: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - email_body: Union[None, Unset, str] + email_body: None | Unset | str if isinstance(self.email_body, Unset): email_body = UNSET else: email_body = self.email_body - email_subject: Union[None, Unset, str] + email_subject: None | Unset | str if isinstance(self.email_subject, Unset): email_subject = UNSET else: email_subject = self.email_subject - slack_content: Union[None, Unset, str] + slack_content: None | Unset | str if isinstance(self.slack_content, Unset): slack_content = UNSET else: slack_content = self.slack_content - sms_content: Union[None, Unset, str] + sms_content: None | Unset | str if isinstance(self.sms_content, Unset): sms_content = UNSET else: @@ -77,11 +77,11 @@ def to_dict(self) -> dict[str, Any]: updated_at = self.updated_at - communication_stage: Union[Unset, dict[str, Any]] = UNSET + communication_stage: Unset | dict[str, Any] = UNSET if not isinstance(self.communication_stage, Unset): communication_stage = self.communication_stage.to_dict() - communication_template: Union[Unset, dict[str, Any]] = UNSET + communication_template: Unset | dict[str, Any] = UNSET if not isinstance(self.communication_template, Unset): communication_template = self.communication_template.to_dict() @@ -118,39 +118,39 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_email_body(data: object) -> Union[None, Unset, str]: + def _parse_email_body(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) email_body = _parse_email_body(d.pop("email_body", UNSET)) - def _parse_email_subject(data: object) -> Union[None, Unset, str]: + def _parse_email_subject(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) email_subject = _parse_email_subject(d.pop("email_subject", UNSET)) - def _parse_slack_content(data: object) -> Union[None, Unset, str]: + def _parse_slack_content(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) slack_content = _parse_slack_content(d.pop("slack_content", UNSET)) - def _parse_sms_content(data: object) -> Union[None, Unset, str]: + def _parse_sms_content(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) sms_content = _parse_sms_content(d.pop("sms_content", UNSET)) @@ -159,9 +159,9 @@ def _parse_sms_content(data: object) -> Union[None, Unset, str]: updated_at = d.pop("updated_at", UNSET) _communication_stage = d.pop("communication_stage", UNSET) - communication_stage: Union[ - Unset, CommunicationsTemplateCommunicationTemplateStagesType0ItemDataAttributesCommunicationStage - ] + communication_stage: ( + Unset | CommunicationsTemplateCommunicationTemplateStagesType0ItemDataAttributesCommunicationStage + ) if isinstance(_communication_stage, Unset): communication_stage = UNSET else: @@ -172,9 +172,9 @@ def _parse_sms_content(data: object) -> Union[None, Unset, str]: ) _communication_template = d.pop("communication_template", UNSET) - communication_template: Union[ - Unset, CommunicationsTemplateCommunicationTemplateStagesType0ItemDataAttributesCommunicationTemplate - ] + communication_template: ( + Unset | CommunicationsTemplateCommunicationTemplateStagesType0ItemDataAttributesCommunicationTemplate + ) if isinstance(_communication_template, Unset): communication_template = UNSET else: diff --git a/rootly_sdk/models/communications_template_communication_template_stages_type_0_item_data_attributes_communication_stage.py b/rootly_sdk/models/communications_template_communication_template_stages_type_0_item_data_attributes_communication_stage.py index f2358dc8..aa63f20b 100644 --- a/rootly_sdk/models/communications_template_communication_template_stages_type_0_item_data_attributes_communication_stage.py +++ b/rootly_sdk/models/communications_template_communication_template_stages_type_0_item_data_attributes_communication_stage.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class CommunicationsTemplateCommunicationTemplateStagesType0ItemDataAttributesCo name (Union[Unset, str]): The communication stage name """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/communications_template_communication_template_stages_type_0_item_data_attributes_communication_template.py b/rootly_sdk/models/communications_template_communication_template_stages_type_0_item_data_attributes_communication_template.py index 85785e5a..b5b69095 100644 --- a/rootly_sdk/models/communications_template_communication_template_stages_type_0_item_data_attributes_communication_template.py +++ b/rootly_sdk/models/communications_template_communication_template_stages_type_0_item_data_attributes_communication_template.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class CommunicationsTemplateCommunicationTemplateStagesType0ItemDataAttributesCo name (Union[Unset, str]): The communication template name """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/communications_template_communication_type.py b/rootly_sdk/models/communications_template_communication_type.py index 378fbce7..48cfce89 100644 --- a/rootly_sdk/models/communications_template_communication_type.py +++ b/rootly_sdk/models/communications_template_communication_type.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class CommunicationsTemplateCommunicationType: name (Union[Unset, str]): Name of the communication type """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/communications_template_response.py b/rootly_sdk/models/communications_template_response.py index 25b39d3b..cf3d8f2c 100644 --- a/rootly_sdk/models/communications_template_response.py +++ b/rootly_sdk/models/communications_template_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,13 +23,13 @@ class CommunicationsTemplateResponse: """ data: "CommunicationsTemplateResponseData" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/communications_templates_response.py b/rootly_sdk/models/communications_templates_response.py index 2752f2ac..8b0365e3 100644 --- a/rootly_sdk/models/communications_templates_response.py +++ b/rootly_sdk/models/communications_templates_response.py @@ -29,7 +29,7 @@ class CommunicationsTemplatesResponse: data: list["CommunicationsTemplatesResponseDataItem"] links: Union[Unset, "Links"] = UNSET meta: Union[Unset, "Meta"] = UNSET - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -38,15 +38,15 @@ def to_dict(self) -> dict[str, Any]: data_item = data_item_data.to_dict() data.append(data_item) - links: Union[Unset, dict[str, Any]] = UNSET + links: Unset | dict[str, Any] = UNSET if not isinstance(self.links, Unset): links = self.links.to_dict() - meta: Union[Unset, dict[str, Any]] = UNSET + meta: Unset | dict[str, Any] = UNSET if not isinstance(self.meta, Unset): meta = self.meta.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +85,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data.append(data_item) _links = d.pop("links", UNSET) - links: Union[Unset, Links] + links: Unset | Links if isinstance(_links, Unset): links = UNSET else: links = Links.from_dict(_links) _meta = d.pop("meta", UNSET) - meta: Union[Unset, Meta] + meta: Unset | Meta if isinstance(_meta, Unset): meta = UNSET else: diff --git a/rootly_sdk/models/communications_type.py b/rootly_sdk/models/communications_type.py index a88f17ed..4574bcae 100644 --- a/rootly_sdk/models/communications_type.py +++ b/rootly_sdk/models/communications_type.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,18 +23,18 @@ class CommunicationsType: """ name: str - color: Union[None, str] + color: None | str position: int created_at: str updated_at: str - slug: Union[Unset, str] = UNSET - description: Union[None, Unset, str] = UNSET + slug: Unset | str = UNSET + description: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: name = self.name - color: Union[None, str] + color: None | str color = self.color position = self.position @@ -45,7 +45,7 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: @@ -74,10 +74,10 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name") - def _parse_color(data: object) -> Union[None, str]: + def _parse_color(data: object) -> None | str: if data is None: return data - return cast(Union[None, str], data) + return cast(None | str, data) color = _parse_color(d.pop("color")) @@ -89,12 +89,12 @@ def _parse_color(data: object) -> Union[None, str]: slug = d.pop("slug", UNSET) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) diff --git a/rootly_sdk/models/communications_type_response.py b/rootly_sdk/models/communications_type_response.py index 6d66bbd1..89cfbca7 100644 --- a/rootly_sdk/models/communications_type_response.py +++ b/rootly_sdk/models/communications_type_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,13 +23,13 @@ class CommunicationsTypeResponse: """ data: "CommunicationsTypeResponseData" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/communications_types_response.py b/rootly_sdk/models/communications_types_response.py index 90e27b65..d2583e16 100644 --- a/rootly_sdk/models/communications_types_response.py +++ b/rootly_sdk/models/communications_types_response.py @@ -29,7 +29,7 @@ class CommunicationsTypesResponse: data: list["CommunicationsTypesResponseDataItem"] links: Union[Unset, "Links"] = UNSET meta: Union[Unset, "Meta"] = UNSET - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -38,15 +38,15 @@ def to_dict(self) -> dict[str, Any]: data_item = data_item_data.to_dict() data.append(data_item) - links: Union[Unset, dict[str, Any]] = UNSET + links: Unset | dict[str, Any] = UNSET if not isinstance(self.links, Unset): links = self.links.to_dict() - meta: Union[Unset, dict[str, Any]] = UNSET + meta: Unset | dict[str, Any] = UNSET if not isinstance(self.meta, Unset): meta = self.meta.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +85,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data.append(data_item) _links = d.pop("links", UNSET) - links: Union[Unset, Links] + links: Unset | Links if isinstance(_links, Unset): links = UNSET else: links = Links.from_dict(_links) _meta = d.pop("meta", UNSET) - meta: Union[Unset, Meta] + meta: Unset | Meta if isinstance(_meta, Unset): meta = UNSET else: diff --git a/rootly_sdk/models/create_airtable_table_record_task_params.py b/rootly_sdk/models/create_airtable_table_record_task_params.py index 785636ba..02aa62ba 100644 --- a/rootly_sdk/models/create_airtable_table_record_task_params.py +++ b/rootly_sdk/models/create_airtable_table_record_task_params.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -31,8 +31,8 @@ class CreateAirtableTableRecordTaskParams: base: "CreateAirtableTableRecordTaskParamsBase" table: "CreateAirtableTableRecordTaskParamsTable" - task_type: Union[Unset, CreateAirtableTableRecordTaskParamsTaskType] = UNSET - custom_fields_mapping: Union[None, Unset, str] = UNSET + task_type: Unset | CreateAirtableTableRecordTaskParamsTaskType = UNSET + custom_fields_mapping: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -40,11 +40,11 @@ def to_dict(self) -> dict[str, Any]: table = self.table.to_dict() - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - custom_fields_mapping: Union[None, Unset, str] + custom_fields_mapping: None | Unset | str if isinstance(self.custom_fields_mapping, Unset): custom_fields_mapping = UNSET else: @@ -76,18 +76,18 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: table = CreateAirtableTableRecordTaskParamsTable.from_dict(d.pop("table")) _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, CreateAirtableTableRecordTaskParamsTaskType] + task_type: Unset | CreateAirtableTableRecordTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: task_type = check_create_airtable_table_record_task_params_task_type(_task_type) - def _parse_custom_fields_mapping(data: object) -> Union[None, Unset, str]: + def _parse_custom_fields_mapping(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) custom_fields_mapping = _parse_custom_fields_mapping(d.pop("custom_fields_mapping", UNSET)) diff --git a/rootly_sdk/models/create_airtable_table_record_task_params_base.py b/rootly_sdk/models/create_airtable_table_record_task_params_base.py index 8b2ad465..e4dac884 100644 --- a/rootly_sdk/models/create_airtable_table_record_task_params_base.py +++ b/rootly_sdk/models/create_airtable_table_record_task_params_base.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class CreateAirtableTableRecordTaskParamsBase: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_airtable_table_record_task_params_table.py b/rootly_sdk/models/create_airtable_table_record_task_params_table.py index 81734370..77f8f3bb 100644 --- a/rootly_sdk/models/create_airtable_table_record_task_params_table.py +++ b/rootly_sdk/models/create_airtable_table_record_task_params_table.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class CreateAirtableTableRecordTaskParamsTable: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_anthropic_chat_completion_task_params.py b/rootly_sdk/models/create_anthropic_chat_completion_task_params.py index f8d4ea44..9bae2c8b 100644 --- a/rootly_sdk/models/create_anthropic_chat_completion_task_params.py +++ b/rootly_sdk/models/create_anthropic_chat_completion_task_params.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -30,9 +30,9 @@ class CreateAnthropicChatCompletionTaskParams: model: "CreateAnthropicChatCompletionTaskParamsModel" prompt: str - task_type: Union[Unset, CreateAnthropicChatCompletionTaskParamsTaskType] = UNSET - system_prompt: Union[Unset, str] = UNSET - max_tokens: Union[Unset, int] = UNSET + task_type: Unset | CreateAnthropicChatCompletionTaskParamsTaskType = UNSET + system_prompt: Unset | str = UNSET + max_tokens: Unset | int = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -40,7 +40,7 @@ def to_dict(self) -> dict[str, Any]: prompt = self.prompt - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -77,7 +77,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: prompt = d.pop("prompt") _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, CreateAnthropicChatCompletionTaskParamsTaskType] + task_type: Unset | CreateAnthropicChatCompletionTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/create_anthropic_chat_completion_task_params_model.py b/rootly_sdk/models/create_anthropic_chat_completion_task_params_model.py index 9e0ee37b..9eeddadf 100644 --- a/rootly_sdk/models/create_anthropic_chat_completion_task_params_model.py +++ b/rootly_sdk/models/create_anthropic_chat_completion_task_params_model.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -18,8 +18,8 @@ class CreateAnthropicChatCompletionTaskParamsModel: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_asana_subtask_task_params.py b/rootly_sdk/models/create_asana_subtask_task_params.py index 8169a7a5..fc23a420 100644 --- a/rootly_sdk/models/create_asana_subtask_task_params.py +++ b/rootly_sdk/models/create_asana_subtask_task_params.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -41,13 +41,13 @@ class CreateAsanaSubtaskTaskParams: parent_task_id: str title: str completion: "CreateAsanaSubtaskTaskParamsCompletion" - task_type: Union[Unset, CreateAsanaSubtaskTaskParamsTaskType] = UNSET - notes: Union[Unset, str] = UNSET - assign_user_email: Union[Unset, str] = UNSET - due_date: Union[Unset, str] = UNSET - custom_fields_mapping: Union[None, Unset, str] = UNSET - dependency_direction: Union[Unset, CreateAsanaSubtaskTaskParamsDependencyDirection] = "blocking" - dependent_task_ids: Union[None, Unset, list[str]] = UNSET + task_type: Unset | CreateAsanaSubtaskTaskParamsTaskType = UNSET + notes: Unset | str = UNSET + assign_user_email: Unset | str = UNSET + due_date: Unset | str = UNSET + custom_fields_mapping: None | Unset | str = UNSET + dependency_direction: Unset | CreateAsanaSubtaskTaskParamsDependencyDirection = "blocking" + dependent_task_ids: None | Unset | list[str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -57,7 +57,7 @@ def to_dict(self) -> dict[str, Any]: completion = self.completion.to_dict() - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -67,17 +67,17 @@ def to_dict(self) -> dict[str, Any]: due_date = self.due_date - custom_fields_mapping: Union[None, Unset, str] + custom_fields_mapping: None | Unset | str if isinstance(self.custom_fields_mapping, Unset): custom_fields_mapping = UNSET else: custom_fields_mapping = self.custom_fields_mapping - dependency_direction: Union[Unset, str] = UNSET + dependency_direction: Unset | str = UNSET if not isinstance(self.dependency_direction, Unset): dependency_direction = self.dependency_direction - dependent_task_ids: Union[None, Unset, list[str]] + dependent_task_ids: None | Unset | list[str] if isinstance(self.dependent_task_ids, Unset): dependent_task_ids = UNSET elif isinstance(self.dependent_task_ids, list): @@ -124,7 +124,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: completion = CreateAsanaSubtaskTaskParamsCompletion.from_dict(d.pop("completion")) _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, CreateAsanaSubtaskTaskParamsTaskType] + task_type: Unset | CreateAsanaSubtaskTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: @@ -136,23 +136,23 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: due_date = d.pop("due_date", UNSET) - def _parse_custom_fields_mapping(data: object) -> Union[None, Unset, str]: + def _parse_custom_fields_mapping(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) custom_fields_mapping = _parse_custom_fields_mapping(d.pop("custom_fields_mapping", UNSET)) _dependency_direction = d.pop("dependency_direction", UNSET) - dependency_direction: Union[Unset, CreateAsanaSubtaskTaskParamsDependencyDirection] + dependency_direction: Unset | CreateAsanaSubtaskTaskParamsDependencyDirection if isinstance(_dependency_direction, Unset): dependency_direction = UNSET else: dependency_direction = check_create_asana_subtask_task_params_dependency_direction(_dependency_direction) - def _parse_dependent_task_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_dependent_task_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -165,7 +165,7 @@ def _parse_dependent_task_ids(data: object) -> Union[None, Unset, list[str]]: return dependent_task_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) dependent_task_ids = _parse_dependent_task_ids(d.pop("dependent_task_ids", UNSET)) diff --git a/rootly_sdk/models/create_asana_subtask_task_params_completion.py b/rootly_sdk/models/create_asana_subtask_task_params_completion.py index 0bc64c50..a4a99573 100644 --- a/rootly_sdk/models/create_asana_subtask_task_params_completion.py +++ b/rootly_sdk/models/create_asana_subtask_task_params_completion.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class CreateAsanaSubtaskTaskParamsCompletion: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_asana_task_task_params.py b/rootly_sdk/models/create_asana_task_task_params.py index 75072a50..cfb6cc5c 100644 --- a/rootly_sdk/models/create_asana_task_task_params.py +++ b/rootly_sdk/models/create_asana_task_task_params.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -45,13 +45,13 @@ class CreateAsanaTaskTaskParams: projects: list["CreateAsanaTaskTaskParamsProjectsItem"] title: str completion: "CreateAsanaTaskTaskParamsCompletion" - task_type: Union[Unset, CreateAsanaTaskTaskParamsTaskType] = UNSET - notes: Union[Unset, str] = UNSET - assign_user_email: Union[Unset, str] = UNSET - due_date: Union[Unset, str] = UNSET - custom_fields_mapping: Union[None, Unset, str] = UNSET - dependency_direction: Union[Unset, CreateAsanaTaskTaskParamsDependencyDirection] = "blocking" - dependent_task_ids: Union[None, Unset, list[str]] = UNSET + task_type: Unset | CreateAsanaTaskTaskParamsTaskType = UNSET + notes: Unset | str = UNSET + assign_user_email: Unset | str = UNSET + due_date: Unset | str = UNSET + custom_fields_mapping: None | Unset | str = UNSET + dependency_direction: Unset | CreateAsanaTaskTaskParamsDependencyDirection = "blocking" + dependent_task_ids: None | Unset | list[str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -66,7 +66,7 @@ def to_dict(self) -> dict[str, Any]: completion = self.completion.to_dict() - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -76,17 +76,17 @@ def to_dict(self) -> dict[str, Any]: due_date = self.due_date - custom_fields_mapping: Union[None, Unset, str] + custom_fields_mapping: None | Unset | str if isinstance(self.custom_fields_mapping, Unset): custom_fields_mapping = UNSET else: custom_fields_mapping = self.custom_fields_mapping - dependency_direction: Union[Unset, str] = UNSET + dependency_direction: Unset | str = UNSET if not isinstance(self.dependency_direction, Unset): dependency_direction = self.dependency_direction - dependent_task_ids: Union[None, Unset, list[str]] + dependent_task_ids: None | Unset | list[str] if isinstance(self.dependent_task_ids, Unset): dependent_task_ids = UNSET elif isinstance(self.dependent_task_ids, list): @@ -143,7 +143,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: completion = CreateAsanaTaskTaskParamsCompletion.from_dict(d.pop("completion")) _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, CreateAsanaTaskTaskParamsTaskType] + task_type: Unset | CreateAsanaTaskTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: @@ -155,23 +155,23 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: due_date = d.pop("due_date", UNSET) - def _parse_custom_fields_mapping(data: object) -> Union[None, Unset, str]: + def _parse_custom_fields_mapping(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) custom_fields_mapping = _parse_custom_fields_mapping(d.pop("custom_fields_mapping", UNSET)) _dependency_direction = d.pop("dependency_direction", UNSET) - dependency_direction: Union[Unset, CreateAsanaTaskTaskParamsDependencyDirection] + dependency_direction: Unset | CreateAsanaTaskTaskParamsDependencyDirection if isinstance(_dependency_direction, Unset): dependency_direction = UNSET else: dependency_direction = check_create_asana_task_task_params_dependency_direction(_dependency_direction) - def _parse_dependent_task_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_dependent_task_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -184,7 +184,7 @@ def _parse_dependent_task_ids(data: object) -> Union[None, Unset, list[str]]: return dependent_task_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) dependent_task_ids = _parse_dependent_task_ids(d.pop("dependent_task_ids", UNSET)) diff --git a/rootly_sdk/models/create_asana_task_task_params_completion.py b/rootly_sdk/models/create_asana_task_task_params_completion.py index 4eb25b2e..a64d8b2b 100644 --- a/rootly_sdk/models/create_asana_task_task_params_completion.py +++ b/rootly_sdk/models/create_asana_task_task_params_completion.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class CreateAsanaTaskTaskParamsCompletion: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_asana_task_task_params_projects_item.py b/rootly_sdk/models/create_asana_task_task_params_projects_item.py index 5f2be515..88723252 100644 --- a/rootly_sdk/models/create_asana_task_task_params_projects_item.py +++ b/rootly_sdk/models/create_asana_task_task_params_projects_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class CreateAsanaTaskTaskParamsProjectsItem: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_asana_task_task_params_workspace.py b/rootly_sdk/models/create_asana_task_task_params_workspace.py index 093f7965..e21ea450 100644 --- a/rootly_sdk/models/create_asana_task_task_params_workspace.py +++ b/rootly_sdk/models/create_asana_task_task_params_workspace.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class CreateAsanaTaskTaskParamsWorkspace: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_clickup_task_task_params.py b/rootly_sdk/models/create_clickup_task_task_params.py index 0492b38a..c7857b0d 100644 --- a/rootly_sdk/models/create_clickup_task_task_params.py +++ b/rootly_sdk/models/create_clickup_task_task_params.py @@ -37,13 +37,13 @@ class CreateClickupTaskTaskParams: title: str list_: "CreateClickupTaskTaskParamsList" - task_type: Union[Unset, CreateClickupTaskTaskParamsTaskType] = UNSET - description: Union[Unset, str] = UNSET - tags: Union[Unset, str] = UNSET + task_type: Unset | CreateClickupTaskTaskParamsTaskType = UNSET + description: Unset | str = UNSET + tags: Unset | str = UNSET priority: Union[Unset, "CreateClickupTaskTaskParamsPriority"] = UNSET - due_date: Union[Unset, str] = UNSET - custom_fields_mapping: Union[None, Unset, str] = UNSET - task_payload: Union[None, Unset, str] = UNSET + due_date: Unset | str = UNSET + custom_fields_mapping: None | Unset | str = UNSET + task_payload: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -51,7 +51,7 @@ def to_dict(self) -> dict[str, Any]: list_ = self.list_.to_dict() - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -59,19 +59,19 @@ def to_dict(self) -> dict[str, Any]: tags = self.tags - priority: Union[Unset, dict[str, Any]] = UNSET + priority: Unset | dict[str, Any] = UNSET if not isinstance(self.priority, Unset): priority = self.priority.to_dict() due_date = self.due_date - custom_fields_mapping: Union[None, Unset, str] + custom_fields_mapping: None | Unset | str if isinstance(self.custom_fields_mapping, Unset): custom_fields_mapping = UNSET else: custom_fields_mapping = self.custom_fields_mapping - task_payload: Union[None, Unset, str] + task_payload: None | Unset | str if isinstance(self.task_payload, Unset): task_payload = UNSET else: @@ -113,7 +113,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: list_ = CreateClickupTaskTaskParamsList.from_dict(d.pop("list")) _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, CreateClickupTaskTaskParamsTaskType] + task_type: Unset | CreateClickupTaskTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: @@ -124,7 +124,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: tags = d.pop("tags", UNSET) _priority = d.pop("priority", UNSET) - priority: Union[Unset, CreateClickupTaskTaskParamsPriority] + priority: Unset | CreateClickupTaskTaskParamsPriority if isinstance(_priority, Unset): priority = UNSET else: @@ -132,21 +132,21 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: due_date = d.pop("due_date", UNSET) - def _parse_custom_fields_mapping(data: object) -> Union[None, Unset, str]: + def _parse_custom_fields_mapping(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) custom_fields_mapping = _parse_custom_fields_mapping(d.pop("custom_fields_mapping", UNSET)) - def _parse_task_payload(data: object) -> Union[None, Unset, str]: + def _parse_task_payload(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) task_payload = _parse_task_payload(d.pop("task_payload", UNSET)) diff --git a/rootly_sdk/models/create_clickup_task_task_params_list.py b/rootly_sdk/models/create_clickup_task_task_params_list.py index 3209c0d3..9ca1035e 100644 --- a/rootly_sdk/models/create_clickup_task_task_params_list.py +++ b/rootly_sdk/models/create_clickup_task_task_params_list.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class CreateClickupTaskTaskParamsList: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_clickup_task_task_params_priority.py b/rootly_sdk/models/create_clickup_task_task_params_priority.py index b3be24f2..21c4a7c6 100644 --- a/rootly_sdk/models/create_clickup_task_task_params_priority.py +++ b/rootly_sdk/models/create_clickup_task_task_params_priority.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -18,8 +18,8 @@ class CreateClickupTaskTaskParamsPriority: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_coda_page_task_params.py b/rootly_sdk/models/create_coda_page_task_params.py index ce57ae23..6819d148 100644 --- a/rootly_sdk/models/create_coda_page_task_params.py +++ b/rootly_sdk/models/create_coda_page_task_params.py @@ -34,20 +34,20 @@ class CreateCodaPageTaskParams: """ title: str - task_type: Union[Unset, CreateCodaPageTaskParamsTaskType] = UNSET - post_mortem_template_id: Union[Unset, str] = UNSET - mark_post_mortem_as_published: Union[Unset, bool] = True - subtitle: Union[Unset, str] = UNSET - content: Union[Unset, str] = UNSET + task_type: Unset | CreateCodaPageTaskParamsTaskType = UNSET + post_mortem_template_id: Unset | str = UNSET + mark_post_mortem_as_published: Unset | bool = True + subtitle: Unset | str = UNSET + content: Unset | str = UNSET template: Union[Unset, "CreateCodaPageTaskParamsTemplate"] = UNSET - folder_id: Union[Unset, str] = UNSET + folder_id: Unset | str = UNSET doc: Union[Unset, "CreateCodaPageTaskParamsDoc"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: title = self.title - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -59,13 +59,13 @@ def to_dict(self) -> dict[str, Any]: content = self.content - template: Union[Unset, dict[str, Any]] = UNSET + template: Unset | dict[str, Any] = UNSET if not isinstance(self.template, Unset): template = self.template.to_dict() folder_id = self.folder_id - doc: Union[Unset, dict[str, Any]] = UNSET + doc: Unset | dict[str, Any] = UNSET if not isinstance(self.doc, Unset): doc = self.doc.to_dict() @@ -104,7 +104,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: title = d.pop("title") _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, CreateCodaPageTaskParamsTaskType] + task_type: Unset | CreateCodaPageTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: @@ -119,7 +119,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: content = d.pop("content", UNSET) _template = d.pop("template", UNSET) - template: Union[Unset, CreateCodaPageTaskParamsTemplate] + template: Unset | CreateCodaPageTaskParamsTemplate if isinstance(_template, Unset): template = UNSET else: @@ -128,7 +128,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: folder_id = d.pop("folder_id", UNSET) _doc = d.pop("doc", UNSET) - doc: Union[Unset, CreateCodaPageTaskParamsDoc] + doc: Unset | CreateCodaPageTaskParamsDoc if isinstance(_doc, Unset): doc = UNSET else: diff --git a/rootly_sdk/models/create_coda_page_task_params_doc.py b/rootly_sdk/models/create_coda_page_task_params_doc.py index 91641cb7..ae70fa93 100644 --- a/rootly_sdk/models/create_coda_page_task_params_doc.py +++ b/rootly_sdk/models/create_coda_page_task_params_doc.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -18,8 +18,8 @@ class CreateCodaPageTaskParamsDoc: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_coda_page_task_params_template.py b/rootly_sdk/models/create_coda_page_task_params_template.py index 9e8ee330..54bfee21 100644 --- a/rootly_sdk/models/create_coda_page_task_params_template.py +++ b/rootly_sdk/models/create_coda_page_task_params_template.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class CreateCodaPageTaskParamsTemplate: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_confluence_page_task_params.py b/rootly_sdk/models/create_confluence_page_task_params.py index d0fb2267..b05a3656 100644 --- a/rootly_sdk/models/create_confluence_page_task_params.py +++ b/rootly_sdk/models/create_confluence_page_task_params.py @@ -42,17 +42,17 @@ class CreateConfluencePageTaskParams: space: "CreateConfluencePageTaskParamsSpace" title: str - task_type: Union[Unset, CreateConfluencePageTaskParamsTaskType] = UNSET + task_type: Unset | CreateConfluencePageTaskParamsTaskType = UNSET integration: Union[Unset, "CreateConfluencePageTaskParamsIntegration"] = UNSET ancestor: Union[Unset, "CreateConfluencePageTaskParamsAncestor"] = UNSET template: Union[Unset, "CreateConfluencePageTaskParamsTemplate"] = UNSET - content: Union[Unset, str] = UNSET - post_mortem_template_id: Union[Unset, str] = UNSET - mark_post_mortem_as_published: Union[Unset, bool] = True - include_overview: Union[Unset, bool] = True - include_timeline: Union[Unset, bool] = True - include_follow_ups: Union[Unset, bool] = True - create_as_live_doc: Union[Unset, bool] = False + content: Unset | str = UNSET + post_mortem_template_id: Unset | str = UNSET + mark_post_mortem_as_published: Unset | bool = True + include_overview: Unset | bool = True + include_timeline: Unset | bool = True + include_follow_ups: Unset | bool = True + create_as_live_doc: Unset | bool = False additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -60,19 +60,19 @@ def to_dict(self) -> dict[str, Any]: title = self.title - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - integration: Union[Unset, dict[str, Any]] = UNSET + integration: Unset | dict[str, Any] = UNSET if not isinstance(self.integration, Unset): integration = self.integration.to_dict() - ancestor: Union[Unset, dict[str, Any]] = UNSET + ancestor: Unset | dict[str, Any] = UNSET if not isinstance(self.ancestor, Unset): ancestor = self.ancestor.to_dict() - template: Union[Unset, dict[str, Any]] = UNSET + template: Unset | dict[str, Any] = UNSET if not isinstance(self.template, Unset): template = self.template.to_dict() @@ -136,28 +136,28 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: title = d.pop("title") _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, CreateConfluencePageTaskParamsTaskType] + task_type: Unset | CreateConfluencePageTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: task_type = check_create_confluence_page_task_params_task_type(_task_type) _integration = d.pop("integration", UNSET) - integration: Union[Unset, CreateConfluencePageTaskParamsIntegration] + integration: Unset | CreateConfluencePageTaskParamsIntegration if isinstance(_integration, Unset): integration = UNSET else: integration = CreateConfluencePageTaskParamsIntegration.from_dict(_integration) _ancestor = d.pop("ancestor", UNSET) - ancestor: Union[Unset, CreateConfluencePageTaskParamsAncestor] + ancestor: Unset | CreateConfluencePageTaskParamsAncestor if isinstance(_ancestor, Unset): ancestor = UNSET else: ancestor = CreateConfluencePageTaskParamsAncestor.from_dict(_ancestor) _template = d.pop("template", UNSET) - template: Union[Unset, CreateConfluencePageTaskParamsTemplate] + template: Unset | CreateConfluencePageTaskParamsTemplate if isinstance(_template, Unset): template = UNSET else: diff --git a/rootly_sdk/models/create_confluence_page_task_params_ancestor.py b/rootly_sdk/models/create_confluence_page_task_params_ancestor.py index 260cb027..42829d65 100644 --- a/rootly_sdk/models/create_confluence_page_task_params_ancestor.py +++ b/rootly_sdk/models/create_confluence_page_task_params_ancestor.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class CreateConfluencePageTaskParamsAncestor: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_confluence_page_task_params_integration.py b/rootly_sdk/models/create_confluence_page_task_params_integration.py index e95f48a5..0479d651 100644 --- a/rootly_sdk/models/create_confluence_page_task_params_integration.py +++ b/rootly_sdk/models/create_confluence_page_task_params_integration.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -18,8 +18,8 @@ class CreateConfluencePageTaskParamsIntegration: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_confluence_page_task_params_space.py b/rootly_sdk/models/create_confluence_page_task_params_space.py index 7f25fa03..2e7b2651 100644 --- a/rootly_sdk/models/create_confluence_page_task_params_space.py +++ b/rootly_sdk/models/create_confluence_page_task_params_space.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class CreateConfluencePageTaskParamsSpace: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_confluence_page_task_params_template.py b/rootly_sdk/models/create_confluence_page_task_params_template.py index d64e94b4..4b7df4c3 100644 --- a/rootly_sdk/models/create_confluence_page_task_params_template.py +++ b/rootly_sdk/models/create_confluence_page_task_params_template.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class CreateConfluencePageTaskParamsTemplate: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_datadog_notebook_task_params.py b/rootly_sdk/models/create_datadog_notebook_task_params.py index 0d7cce7b..bf7881c1 100644 --- a/rootly_sdk/models/create_datadog_notebook_task_params.py +++ b/rootly_sdk/models/create_datadog_notebook_task_params.py @@ -36,11 +36,11 @@ class CreateDatadogNotebookTaskParams: title: str kind: CreateDatadogNotebookTaskParamsKind - task_type: Union[Unset, CreateDatadogNotebookTaskParamsTaskType] = UNSET - post_mortem_template_id: Union[Unset, str] = UNSET - mark_post_mortem_as_published: Union[Unset, bool] = True + task_type: Unset | CreateDatadogNotebookTaskParamsTaskType = UNSET + post_mortem_template_id: Unset | str = UNSET + mark_post_mortem_as_published: Unset | bool = True template: Union[Unset, "CreateDatadogNotebookTaskParamsTemplate"] = UNSET - content: Union[Unset, str] = UNSET + content: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -48,7 +48,7 @@ def to_dict(self) -> dict[str, Any]: kind: str = self.kind - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -56,7 +56,7 @@ def to_dict(self) -> dict[str, Any]: mark_post_mortem_as_published = self.mark_post_mortem_as_published - template: Union[Unset, dict[str, Any]] = UNSET + template: Unset | dict[str, Any] = UNSET if not isinstance(self.template, Unset): template = self.template.to_dict() @@ -93,7 +93,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: kind = check_create_datadog_notebook_task_params_kind(d.pop("kind")) _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, CreateDatadogNotebookTaskParamsTaskType] + task_type: Unset | CreateDatadogNotebookTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: @@ -104,7 +104,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: mark_post_mortem_as_published = d.pop("mark_post_mortem_as_published", UNSET) _template = d.pop("template", UNSET) - template: Union[Unset, CreateDatadogNotebookTaskParamsTemplate] + template: Unset | CreateDatadogNotebookTaskParamsTemplate if isinstance(_template, Unset): template = UNSET else: diff --git a/rootly_sdk/models/create_datadog_notebook_task_params_template.py b/rootly_sdk/models/create_datadog_notebook_task_params_template.py index c955dc8d..7191fa50 100644 --- a/rootly_sdk/models/create_datadog_notebook_task_params_template.py +++ b/rootly_sdk/models/create_datadog_notebook_task_params_template.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class CreateDatadogNotebookTaskParamsTemplate: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_dropbox_paper_page_task_params.py b/rootly_sdk/models/create_dropbox_paper_page_task_params.py index c64407e9..4fcdee63 100644 --- a/rootly_sdk/models/create_dropbox_paper_page_task_params.py +++ b/rootly_sdk/models/create_dropbox_paper_page_task_params.py @@ -34,10 +34,10 @@ class CreateDropboxPaperPageTaskParams: """ title: str - task_type: Union[Unset, CreateDropboxPaperPageTaskParamsTaskType] = UNSET - post_mortem_template_id: Union[Unset, str] = UNSET - mark_post_mortem_as_published: Union[Unset, bool] = True - content: Union[Unset, str] = UNSET + task_type: Unset | CreateDropboxPaperPageTaskParamsTaskType = UNSET + post_mortem_template_id: Unset | str = UNSET + mark_post_mortem_as_published: Unset | bool = True + content: Unset | str = UNSET namespace: Union[Unset, "CreateDropboxPaperPageTaskParamsNamespace"] = UNSET parent_folder: Union[Unset, "CreateDropboxPaperPageTaskParamsParentFolder"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -45,7 +45,7 @@ class CreateDropboxPaperPageTaskParams: def to_dict(self) -> dict[str, Any]: title = self.title - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -55,11 +55,11 @@ def to_dict(self) -> dict[str, Any]: content = self.content - namespace: Union[Unset, dict[str, Any]] = UNSET + namespace: Unset | dict[str, Any] = UNSET if not isinstance(self.namespace, Unset): namespace = self.namespace.to_dict() - parent_folder: Union[Unset, dict[str, Any]] = UNSET + parent_folder: Unset | dict[str, Any] = UNSET if not isinstance(self.parent_folder, Unset): parent_folder = self.parent_folder.to_dict() @@ -96,7 +96,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: title = d.pop("title") _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, CreateDropboxPaperPageTaskParamsTaskType] + task_type: Unset | CreateDropboxPaperPageTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: @@ -109,14 +109,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: content = d.pop("content", UNSET) _namespace = d.pop("namespace", UNSET) - namespace: Union[Unset, CreateDropboxPaperPageTaskParamsNamespace] + namespace: Unset | CreateDropboxPaperPageTaskParamsNamespace if isinstance(_namespace, Unset): namespace = UNSET else: namespace = CreateDropboxPaperPageTaskParamsNamespace.from_dict(_namespace) _parent_folder = d.pop("parent_folder", UNSET) - parent_folder: Union[Unset, CreateDropboxPaperPageTaskParamsParentFolder] + parent_folder: Unset | CreateDropboxPaperPageTaskParamsParentFolder if isinstance(_parent_folder, Unset): parent_folder = UNSET else: diff --git a/rootly_sdk/models/create_dropbox_paper_page_task_params_namespace.py b/rootly_sdk/models/create_dropbox_paper_page_task_params_namespace.py index dee14108..93b1ef98 100644 --- a/rootly_sdk/models/create_dropbox_paper_page_task_params_namespace.py +++ b/rootly_sdk/models/create_dropbox_paper_page_task_params_namespace.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class CreateDropboxPaperPageTaskParamsNamespace: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_dropbox_paper_page_task_params_parent_folder.py b/rootly_sdk/models/create_dropbox_paper_page_task_params_parent_folder.py index a0895b3d..ca4e271f 100644 --- a/rootly_sdk/models/create_dropbox_paper_page_task_params_parent_folder.py +++ b/rootly_sdk/models/create_dropbox_paper_page_task_params_parent_folder.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class CreateDropboxPaperPageTaskParamsParentFolder: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_edge_connector_action_body.py b/rootly_sdk/models/create_edge_connector_action_body.py index b5e797c2..b5e7af64 100644 --- a/rootly_sdk/models/create_edge_connector_action_body.py +++ b/rootly_sdk/models/create_edge_connector_action_body.py @@ -24,7 +24,7 @@ class CreateEdgeConnectorActionBody: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - action: Union[Unset, dict[str, Any]] = UNSET + action: Unset | dict[str, Any] = UNSET if not isinstance(self.action, Unset): action = self.action.to_dict() @@ -42,7 +42,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _action = d.pop("action", UNSET) - action: Union[Unset, CreateEdgeConnectorActionBodyAction] + action: Unset | CreateEdgeConnectorActionBodyAction if isinstance(_action, Unset): action = UNSET else: diff --git a/rootly_sdk/models/create_edge_connector_action_body_action.py b/rootly_sdk/models/create_edge_connector_action_body_action.py index 9d221d36..47bc8d5a 100644 --- a/rootly_sdk/models/create_edge_connector_action_body_action.py +++ b/rootly_sdk/models/create_edge_connector_action_body_action.py @@ -36,7 +36,7 @@ def to_dict(self) -> dict[str, Any]: action_type: str = self.action_type - metadata: Union[Unset, dict[str, Any]] = UNSET + metadata: Unset | dict[str, Any] = UNSET if not isinstance(self.metadata, Unset): metadata = self.metadata.to_dict() @@ -65,7 +65,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: action_type = check_create_edge_connector_action_body_action_action_type(d.pop("action_type")) _metadata = d.pop("metadata", UNSET) - metadata: Union[Unset, CreateEdgeConnectorActionBodyActionMetadata] + metadata: Unset | CreateEdgeConnectorActionBodyActionMetadata if isinstance(_metadata, Unset): metadata = UNSET else: diff --git a/rootly_sdk/models/create_edge_connector_action_body_action_metadata.py b/rootly_sdk/models/create_edge_connector_action_body_action_metadata.py index 6bd6a469..e32305e3 100644 --- a/rootly_sdk/models/create_edge_connector_action_body_action_metadata.py +++ b/rootly_sdk/models/create_edge_connector_action_body_action_metadata.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -24,9 +24,9 @@ class CreateEdgeConnectorActionBodyActionMetadata: parameters (Union[Unset, list['CreateEdgeConnectorActionBodyActionMetadataParametersItem']]): """ - description: Union[Unset, str] = UNSET - timeout: Union[Unset, int] = UNSET - parameters: Union[Unset, list["CreateEdgeConnectorActionBodyActionMetadataParametersItem"]] = UNSET + description: Unset | str = UNSET + timeout: Unset | int = UNSET + parameters: Unset | list["CreateEdgeConnectorActionBodyActionMetadataParametersItem"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -34,7 +34,7 @@ def to_dict(self) -> dict[str, Any]: timeout = self.timeout - parameters: Union[Unset, list[dict[str, Any]]] = UNSET + parameters: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.parameters, Unset): parameters = [] for parameters_item_data in self.parameters: diff --git a/rootly_sdk/models/create_edge_connector_action_body_action_metadata_parameters_item.py b/rootly_sdk/models/create_edge_connector_action_body_action_metadata_parameters_item.py index 888285ba..8da7d329 100644 --- a/rootly_sdk/models/create_edge_connector_action_body_action_metadata_parameters_item.py +++ b/rootly_sdk/models/create_edge_connector_action_body_action_metadata_parameters_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -24,17 +24,17 @@ class CreateEdgeConnectorActionBodyActionMetadataParametersItem: options (Union[Unset, list[str]]): """ - name: Union[Unset, str] = UNSET - type_: Union[Unset, CreateEdgeConnectorActionBodyActionMetadataParametersItemType] = UNSET - required: Union[Unset, bool] = UNSET - description: Union[Unset, str] = UNSET - options: Union[Unset, list[str]] = UNSET + name: Unset | str = UNSET + type_: Unset | CreateEdgeConnectorActionBodyActionMetadataParametersItemType = UNSET + required: Unset | bool = UNSET + description: Unset | str = UNSET + options: Unset | list[str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: name = self.name - type_: Union[Unset, str] = UNSET + type_: Unset | str = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ @@ -42,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: description = self.description - options: Union[Unset, list[str]] = UNSET + options: Unset | list[str] = UNSET if not isinstance(self.options, Unset): options = self.options @@ -68,7 +68,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name = d.pop("name", UNSET) _type_ = d.pop("type", UNSET) - type_: Union[Unset, CreateEdgeConnectorActionBodyActionMetadataParametersItemType] + type_: Unset | CreateEdgeConnectorActionBodyActionMetadataParametersItemType if isinstance(_type_, Unset): type_ = UNSET else: diff --git a/rootly_sdk/models/create_edge_connector_body_data_attributes.py b/rootly_sdk/models/create_edge_connector_body_data_attributes.py index 9a08b8f0..68321be2 100644 --- a/rootly_sdk/models/create_edge_connector_body_data_attributes.py +++ b/rootly_sdk/models/create_edge_connector_body_data_attributes.py @@ -30,9 +30,9 @@ class CreateEdgeConnectorBodyDataAttributes: """ name: str - description: Union[Unset, str] = UNSET - status: Union[Unset, CreateEdgeConnectorBodyDataAttributesStatus] = UNSET - subscriptions: Union[Unset, list[str]] = UNSET + description: Unset | str = UNSET + status: Unset | CreateEdgeConnectorBodyDataAttributesStatus = UNSET + subscriptions: Unset | list[str] = UNSET filters: Union[Unset, "CreateEdgeConnectorBodyDataAttributesFilters"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -41,15 +41,15 @@ def to_dict(self) -> dict[str, Any]: description = self.description - status: Union[Unset, str] = UNSET + status: Unset | str = UNSET if not isinstance(self.status, Unset): status = self.status - subscriptions: Union[Unset, list[str]] = UNSET + subscriptions: Unset | list[str] = UNSET if not isinstance(self.subscriptions, Unset): subscriptions = self.subscriptions - filters: Union[Unset, dict[str, Any]] = UNSET + filters: Unset | dict[str, Any] = UNSET if not isinstance(self.filters, Unset): filters = self.filters.to_dict() @@ -83,7 +83,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: description = d.pop("description", UNSET) _status = d.pop("status", UNSET) - status: Union[Unset, CreateEdgeConnectorBodyDataAttributesStatus] + status: Unset | CreateEdgeConnectorBodyDataAttributesStatus if isinstance(_status, Unset): status = UNSET else: @@ -92,7 +92,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: subscriptions = cast(list[str], d.pop("subscriptions", UNSET)) _filters = d.pop("filters", UNSET) - filters: Union[Unset, CreateEdgeConnectorBodyDataAttributesFilters] + filters: Unset | CreateEdgeConnectorBodyDataAttributesFilters if isinstance(_filters, Unset): filters = UNSET else: diff --git a/rootly_sdk/models/create_edge_connector_body_data_attributes_filters.py b/rootly_sdk/models/create_edge_connector_body_data_attributes_filters.py index aa4ee100..c28b2f7b 100644 --- a/rootly_sdk/models/create_edge_connector_body_data_attributes_filters.py +++ b/rootly_sdk/models/create_edge_connector_body_data_attributes_filters.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -19,25 +19,25 @@ class CreateEdgeConnectorBodyDataAttributesFilters: functionality_ids (Union[Unset, list[str]]): Filter by functionality UUIDs """ - group_ids: Union[Unset, list[str]] = UNSET - service_ids: Union[Unset, list[str]] = UNSET - environment_ids: Union[Unset, list[str]] = UNSET - functionality_ids: Union[Unset, list[str]] = UNSET + group_ids: Unset | list[str] = UNSET + service_ids: Unset | list[str] = UNSET + environment_ids: Unset | list[str] = UNSET + functionality_ids: Unset | list[str] = UNSET def to_dict(self) -> dict[str, Any]: - group_ids: Union[Unset, list[str]] = UNSET + group_ids: Unset | list[str] = UNSET if not isinstance(self.group_ids, Unset): group_ids = self.group_ids - service_ids: Union[Unset, list[str]] = UNSET + service_ids: Unset | list[str] = UNSET if not isinstance(self.service_ids, Unset): service_ids = self.service_ids - environment_ids: Union[Unset, list[str]] = UNSET + environment_ids: Unset | list[str] = UNSET if not isinstance(self.environment_ids, Unset): environment_ids = self.environment_ids - functionality_ids: Union[Unset, list[str]] = UNSET + functionality_ids: Unset | list[str] = UNSET if not isinstance(self.functionality_ids, Unset): functionality_ids = self.functionality_ids diff --git a/rootly_sdk/models/create_github_issue_task_params.py b/rootly_sdk/models/create_github_issue_task_params.py index 089c633e..632aaccc 100644 --- a/rootly_sdk/models/create_github_issue_task_params.py +++ b/rootly_sdk/models/create_github_issue_task_params.py @@ -36,12 +36,12 @@ class CreateGithubIssueTaskParams: title: str repository: "CreateGithubIssueTaskParamsRepository" - task_type: Union[Unset, CreateGithubIssueTaskParamsTaskType] = UNSET - body: Union[Unset, str] = UNSET - labels: Union[Unset, list["CreateGithubIssueTaskParamsLabelsItem"]] = UNSET + task_type: Unset | CreateGithubIssueTaskParamsTaskType = UNSET + body: Unset | str = UNSET + labels: Unset | list["CreateGithubIssueTaskParamsLabelsItem"] = UNSET issue_type: Union[Unset, "CreateGithubIssueTaskParamsIssueType"] = UNSET - parent_issue_number: Union[None, Unset, str] = UNSET - custom_fields_mapping: Union[None, Unset, str] = UNSET + parent_issue_number: None | Unset | str = UNSET + custom_fields_mapping: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -49,30 +49,30 @@ def to_dict(self) -> dict[str, Any]: repository = self.repository.to_dict() - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type body = self.body - labels: Union[Unset, list[dict[str, Any]]] = UNSET + labels: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.labels, Unset): labels = [] for labels_item_data in self.labels: labels_item = labels_item_data.to_dict() labels.append(labels_item) - issue_type: Union[Unset, dict[str, Any]] = UNSET + issue_type: Unset | dict[str, Any] = UNSET if not isinstance(self.issue_type, Unset): issue_type = self.issue_type.to_dict() - parent_issue_number: Union[None, Unset, str] + parent_issue_number: None | Unset | str if isinstance(self.parent_issue_number, Unset): parent_issue_number = UNSET else: parent_issue_number = self.parent_issue_number - custom_fields_mapping: Union[None, Unset, str] + custom_fields_mapping: None | Unset | str if isinstance(self.custom_fields_mapping, Unset): custom_fields_mapping = UNSET else: @@ -113,7 +113,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: repository = CreateGithubIssueTaskParamsRepository.from_dict(d.pop("repository")) _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, CreateGithubIssueTaskParamsTaskType] + task_type: Unset | CreateGithubIssueTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: @@ -129,27 +129,27 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: labels.append(labels_item) _issue_type = d.pop("issue_type", UNSET) - issue_type: Union[Unset, CreateGithubIssueTaskParamsIssueType] + issue_type: Unset | CreateGithubIssueTaskParamsIssueType if isinstance(_issue_type, Unset): issue_type = UNSET else: issue_type = CreateGithubIssueTaskParamsIssueType.from_dict(_issue_type) - def _parse_parent_issue_number(data: object) -> Union[None, Unset, str]: + def _parse_parent_issue_number(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) parent_issue_number = _parse_parent_issue_number(d.pop("parent_issue_number", UNSET)) - def _parse_custom_fields_mapping(data: object) -> Union[None, Unset, str]: + def _parse_custom_fields_mapping(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) custom_fields_mapping = _parse_custom_fields_mapping(d.pop("custom_fields_mapping", UNSET)) diff --git a/rootly_sdk/models/create_github_issue_task_params_issue_type.py b/rootly_sdk/models/create_github_issue_task_params_issue_type.py index d8204cb0..161e025d 100644 --- a/rootly_sdk/models/create_github_issue_task_params_issue_type.py +++ b/rootly_sdk/models/create_github_issue_task_params_issue_type.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -18,8 +18,8 @@ class CreateGithubIssueTaskParamsIssueType: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_github_issue_task_params_labels_item.py b/rootly_sdk/models/create_github_issue_task_params_labels_item.py index 46565784..d3e8c024 100644 --- a/rootly_sdk/models/create_github_issue_task_params_labels_item.py +++ b/rootly_sdk/models/create_github_issue_task_params_labels_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class CreateGithubIssueTaskParamsLabelsItem: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_github_issue_task_params_repository.py b/rootly_sdk/models/create_github_issue_task_params_repository.py index 40a514c9..75501b1d 100644 --- a/rootly_sdk/models/create_github_issue_task_params_repository.py +++ b/rootly_sdk/models/create_github_issue_task_params_repository.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class CreateGithubIssueTaskParamsRepository: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_gitlab_issue_task_params.py b/rootly_sdk/models/create_gitlab_issue_task_params.py index 2d11062e..ea0b548f 100644 --- a/rootly_sdk/models/create_gitlab_issue_task_params.py +++ b/rootly_sdk/models/create_gitlab_issue_task_params.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -37,10 +37,10 @@ class CreateGitlabIssueTaskParams: issue_type: CreateGitlabIssueTaskParamsIssueType title: str repository: "CreateGitlabIssueTaskParamsRepository" - task_type: Union[Unset, CreateGitlabIssueTaskParamsTaskType] = UNSET - description: Union[Unset, str] = UNSET - labels: Union[Unset, str] = UNSET - due_date: Union[Unset, str] = UNSET + task_type: Unset | CreateGitlabIssueTaskParamsTaskType = UNSET + description: Unset | str = UNSET + labels: Unset | str = UNSET + due_date: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -50,7 +50,7 @@ def to_dict(self) -> dict[str, Any]: repository = self.repository.to_dict() - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -92,7 +92,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: repository = CreateGitlabIssueTaskParamsRepository.from_dict(d.pop("repository")) _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, CreateGitlabIssueTaskParamsTaskType] + task_type: Unset | CreateGitlabIssueTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/create_gitlab_issue_task_params_repository.py b/rootly_sdk/models/create_gitlab_issue_task_params_repository.py index 06470840..5b377efe 100644 --- a/rootly_sdk/models/create_gitlab_issue_task_params_repository.py +++ b/rootly_sdk/models/create_gitlab_issue_task_params_repository.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class CreateGitlabIssueTaskParamsRepository: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_go_to_meeting_task_params.py b/rootly_sdk/models/create_go_to_meeting_task_params.py index 3189143e..5144ec0b 100644 --- a/rootly_sdk/models/create_go_to_meeting_task_params.py +++ b/rootly_sdk/models/create_go_to_meeting_task_params.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -37,25 +37,25 @@ class CreateGoToMeetingTaskParams: """ subject: str - task_type: Union[Unset, CreateGoToMeetingTaskParamsTaskType] = UNSET - conference_call_info: Union[Unset, CreateGoToMeetingTaskParamsConferenceCallInfo] = "voip" - password_required: Union[None, Unset, bool] = UNSET - post_to_incident_timeline: Union[Unset, bool] = UNSET - post_to_slack_channels: Union[Unset, list["CreateGoToMeetingTaskParamsPostToSlackChannelsItem"]] = UNSET + task_type: Unset | CreateGoToMeetingTaskParamsTaskType = UNSET + conference_call_info: Unset | CreateGoToMeetingTaskParamsConferenceCallInfo = "voip" + password_required: None | Unset | bool = UNSET + post_to_incident_timeline: Unset | bool = UNSET + post_to_slack_channels: Unset | list["CreateGoToMeetingTaskParamsPostToSlackChannelsItem"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: subject = self.subject - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - conference_call_info: Union[Unset, str] = UNSET + conference_call_info: Unset | str = UNSET if not isinstance(self.conference_call_info, Unset): conference_call_info = self.conference_call_info - password_required: Union[None, Unset, bool] + password_required: None | Unset | bool if isinstance(self.password_required, Unset): password_required = UNSET else: @@ -63,7 +63,7 @@ def to_dict(self) -> dict[str, Any]: post_to_incident_timeline = self.post_to_incident_timeline - post_to_slack_channels: Union[Unset, list[dict[str, Any]]] = UNSET + post_to_slack_channels: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.post_to_slack_channels, Unset): post_to_slack_channels = [] for post_to_slack_channels_item_data in self.post_to_slack_channels: @@ -100,25 +100,25 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: subject = d.pop("subject") _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, CreateGoToMeetingTaskParamsTaskType] + task_type: Unset | CreateGoToMeetingTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: task_type = check_create_go_to_meeting_task_params_task_type(_task_type) _conference_call_info = d.pop("conference_call_info", UNSET) - conference_call_info: Union[Unset, CreateGoToMeetingTaskParamsConferenceCallInfo] + conference_call_info: Unset | CreateGoToMeetingTaskParamsConferenceCallInfo if isinstance(_conference_call_info, Unset): conference_call_info = UNSET else: conference_call_info = check_create_go_to_meeting_task_params_conference_call_info(_conference_call_info) - def _parse_password_required(data: object) -> Union[None, Unset, bool]: + def _parse_password_required(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) password_required = _parse_password_required(d.pop("password_required", UNSET)) diff --git a/rootly_sdk/models/create_go_to_meeting_task_params_post_to_slack_channels_item.py b/rootly_sdk/models/create_go_to_meeting_task_params_post_to_slack_channels_item.py index b1c4aa2d..fdc0eebb 100644 --- a/rootly_sdk/models/create_go_to_meeting_task_params_post_to_slack_channels_item.py +++ b/rootly_sdk/models/create_go_to_meeting_task_params_post_to_slack_channels_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class CreateGoToMeetingTaskParamsPostToSlackChannelsItem: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_google_calendar_event_task_params.py b/rootly_sdk/models/create_google_calendar_event_task_params.py index 58677e57..fe8900b0 100644 --- a/rootly_sdk/models/create_google_calendar_event_task_params.py +++ b/rootly_sdk/models/create_google_calendar_event_task_params.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -52,18 +52,18 @@ class CreateGoogleCalendarEventTaskParams: meeting_duration: str summary: str description: str - task_type: Union[Unset, CreateGoogleCalendarEventTaskParamsTaskType] = UNSET - attendees: Union[Unset, list[str]] = UNSET - time_zone: Union[None, Unset, str] = UNSET - calendar_id: Union[None, Unset, str] = "primary" - send_updates: Union[Unset, bool] = UNSET - can_guests_modify_event: Union[Unset, bool] = UNSET - can_guests_see_other_guests: Union[Unset, bool] = UNSET - can_guests_invite_others: Union[Unset, bool] = UNSET - exclude_weekends: Union[Unset, bool] = UNSET - conference_solution_key: Union[Unset, CreateGoogleCalendarEventTaskParamsConferenceSolutionKey] = UNSET - post_to_incident_timeline: Union[Unset, bool] = UNSET - post_to_slack_channels: Union[Unset, list["CreateGoogleCalendarEventTaskParamsPostToSlackChannelsItem"]] = UNSET + task_type: Unset | CreateGoogleCalendarEventTaskParamsTaskType = UNSET + attendees: Unset | list[str] = UNSET + time_zone: None | Unset | str = UNSET + calendar_id: None | Unset | str = "primary" + send_updates: Unset | bool = UNSET + can_guests_modify_event: Unset | bool = UNSET + can_guests_see_other_guests: Unset | bool = UNSET + can_guests_invite_others: Unset | bool = UNSET + exclude_weekends: Unset | bool = UNSET + conference_solution_key: Unset | CreateGoogleCalendarEventTaskParamsConferenceSolutionKey = UNSET + post_to_incident_timeline: Unset | bool = UNSET + post_to_slack_channels: Unset | list["CreateGoogleCalendarEventTaskParamsPostToSlackChannelsItem"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -77,21 +77,21 @@ def to_dict(self) -> dict[str, Any]: description = self.description - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - attendees: Union[Unset, list[str]] = UNSET + attendees: Unset | list[str] = UNSET if not isinstance(self.attendees, Unset): attendees = self.attendees - time_zone: Union[None, Unset, str] + time_zone: None | Unset | str if isinstance(self.time_zone, Unset): time_zone = UNSET else: time_zone = self.time_zone - calendar_id: Union[None, Unset, str] + calendar_id: None | Unset | str if isinstance(self.calendar_id, Unset): calendar_id = UNSET else: @@ -107,13 +107,13 @@ def to_dict(self) -> dict[str, Any]: exclude_weekends = self.exclude_weekends - conference_solution_key: Union[Unset, str] = UNSET + conference_solution_key: Unset | str = UNSET if not isinstance(self.conference_solution_key, Unset): conference_solution_key = self.conference_solution_key post_to_incident_timeline = self.post_to_incident_timeline - post_to_slack_channels: Union[Unset, list[dict[str, Any]]] = UNSET + post_to_slack_channels: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.post_to_slack_channels, Unset): post_to_slack_channels = [] for post_to_slack_channels_item_data in self.post_to_slack_channels: @@ -176,7 +176,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: description = d.pop("description") _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, CreateGoogleCalendarEventTaskParamsTaskType] + task_type: Unset | CreateGoogleCalendarEventTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: @@ -184,21 +184,21 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attendees = cast(list[str], d.pop("attendees", UNSET)) - def _parse_time_zone(data: object) -> Union[None, Unset, str]: + def _parse_time_zone(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) time_zone = _parse_time_zone(d.pop("time_zone", UNSET)) - def _parse_calendar_id(data: object) -> Union[None, Unset, str]: + def _parse_calendar_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) calendar_id = _parse_calendar_id(d.pop("calendar_id", UNSET)) @@ -213,7 +213,7 @@ def _parse_calendar_id(data: object) -> Union[None, Unset, str]: exclude_weekends = d.pop("exclude_weekends", UNSET) _conference_solution_key = d.pop("conference_solution_key", UNSET) - conference_solution_key: Union[Unset, CreateGoogleCalendarEventTaskParamsConferenceSolutionKey] + conference_solution_key: Unset | CreateGoogleCalendarEventTaskParamsConferenceSolutionKey if isinstance(_conference_solution_key, Unset): conference_solution_key = UNSET else: diff --git a/rootly_sdk/models/create_google_calendar_event_task_params_post_to_slack_channels_item.py b/rootly_sdk/models/create_google_calendar_event_task_params_post_to_slack_channels_item.py index a6c051b5..bd006c20 100644 --- a/rootly_sdk/models/create_google_calendar_event_task_params_post_to_slack_channels_item.py +++ b/rootly_sdk/models/create_google_calendar_event_task_params_post_to_slack_channels_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class CreateGoogleCalendarEventTaskParamsPostToSlackChannelsItem: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_google_chat_space_task_params.py b/rootly_sdk/models/create_google_chat_space_task_params.py index e6379ff2..ae1d1521 100644 --- a/rootly_sdk/models/create_google_chat_space_task_params.py +++ b/rootly_sdk/models/create_google_chat_space_task_params.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -25,15 +25,15 @@ class CreateGoogleChatSpaceTaskParams: """ title: str - task_type: Union[Unset, CreateGoogleChatSpaceTaskParamsTaskType] = UNSET - description: Union[Unset, str] = UNSET - audience: Union[Unset, str] = UNSET + task_type: Unset | CreateGoogleChatSpaceTaskParamsTaskType = UNSET + description: Unset | str = UNSET + audience: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: title = self.title - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -63,7 +63,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: title = d.pop("title") _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, CreateGoogleChatSpaceTaskParamsTaskType] + task_type: Unset | CreateGoogleChatSpaceTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/create_google_docs_page_task_params.py b/rootly_sdk/models/create_google_docs_page_task_params.py index e43a917f..aa755541 100644 --- a/rootly_sdk/models/create_google_docs_page_task_params.py +++ b/rootly_sdk/models/create_google_docs_page_task_params.py @@ -37,23 +37,23 @@ class CreateGoogleDocsPageTaskParams: """ title: str - task_type: Union[Unset, CreateGoogleDocsPageTaskParamsTaskType] = UNSET - post_mortem_template_id: Union[Unset, str] = UNSET - mark_post_mortem_as_published: Union[Unset, bool] = True + task_type: Unset | CreateGoogleDocsPageTaskParamsTaskType = UNSET + post_mortem_template_id: Unset | str = UNSET + mark_post_mortem_as_published: Unset | bool = True drive: Union[Unset, "CreateGoogleDocsPageTaskParamsDrive"] = UNSET parent_folder: Union[Unset, "CreateGoogleDocsPageTaskParamsParentFolder"] = UNSET - content: Union[Unset, str] = UNSET - template_id: Union[Unset, str] = UNSET - permissions: Union[Unset, str] = UNSET - include_overview: Union[Unset, bool] = True - include_timeline: Union[Unset, bool] = True - include_follow_ups: Union[Unset, bool] = True + content: Unset | str = UNSET + template_id: Unset | str = UNSET + permissions: Unset | str = UNSET + include_overview: Unset | bool = True + include_timeline: Unset | bool = True + include_follow_ups: Unset | bool = True additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: title = self.title - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -61,11 +61,11 @@ def to_dict(self) -> dict[str, Any]: mark_post_mortem_as_published = self.mark_post_mortem_as_published - drive: Union[Unset, dict[str, Any]] = UNSET + drive: Unset | dict[str, Any] = UNSET if not isinstance(self.drive, Unset): drive = self.drive.to_dict() - parent_folder: Union[Unset, dict[str, Any]] = UNSET + parent_folder: Unset | dict[str, Any] = UNSET if not isinstance(self.parent_folder, Unset): parent_folder = self.parent_folder.to_dict() @@ -124,7 +124,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: title = d.pop("title") _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, CreateGoogleDocsPageTaskParamsTaskType] + task_type: Unset | CreateGoogleDocsPageTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: @@ -135,14 +135,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: mark_post_mortem_as_published = d.pop("mark_post_mortem_as_published", UNSET) _drive = d.pop("drive", UNSET) - drive: Union[Unset, CreateGoogleDocsPageTaskParamsDrive] + drive: Unset | CreateGoogleDocsPageTaskParamsDrive if isinstance(_drive, Unset): drive = UNSET else: drive = CreateGoogleDocsPageTaskParamsDrive.from_dict(_drive) _parent_folder = d.pop("parent_folder", UNSET) - parent_folder: Union[Unset, CreateGoogleDocsPageTaskParamsParentFolder] + parent_folder: Unset | CreateGoogleDocsPageTaskParamsParentFolder if isinstance(_parent_folder, Unset): parent_folder = UNSET else: diff --git a/rootly_sdk/models/create_google_docs_page_task_params_drive.py b/rootly_sdk/models/create_google_docs_page_task_params_drive.py index fe74cbcf..9bc8cd93 100644 --- a/rootly_sdk/models/create_google_docs_page_task_params_drive.py +++ b/rootly_sdk/models/create_google_docs_page_task_params_drive.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class CreateGoogleDocsPageTaskParamsDrive: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_google_docs_page_task_params_parent_folder.py b/rootly_sdk/models/create_google_docs_page_task_params_parent_folder.py index b0429645..aa73628a 100644 --- a/rootly_sdk/models/create_google_docs_page_task_params_parent_folder.py +++ b/rootly_sdk/models/create_google_docs_page_task_params_parent_folder.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class CreateGoogleDocsPageTaskParamsParentFolder: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_google_docs_permissions_task_params.py b/rootly_sdk/models/create_google_docs_permissions_task_params.py index 3cc2443a..90211d3f 100644 --- a/rootly_sdk/models/create_google_docs_permissions_task_params.py +++ b/rootly_sdk/models/create_google_docs_permissions_task_params.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -26,9 +26,9 @@ class CreateGoogleDocsPermissionsTaskParams: file_id: str permissions: str - task_type: Union[Unset, CreateGoogleDocsPermissionsTaskParamsTaskType] = UNSET - send_notification_email: Union[Unset, bool] = UNSET - email_message: Union[None, Unset, str] = UNSET + task_type: Unset | CreateGoogleDocsPermissionsTaskParamsTaskType = UNSET + send_notification_email: Unset | bool = UNSET + email_message: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -36,13 +36,13 @@ def to_dict(self) -> dict[str, Any]: permissions = self.permissions - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type send_notification_email = self.send_notification_email - email_message: Union[None, Unset, str] + email_message: None | Unset | str if isinstance(self.email_message, Unset): email_message = UNSET else: @@ -73,7 +73,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: permissions = d.pop("permissions") _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, CreateGoogleDocsPermissionsTaskParamsTaskType] + task_type: Unset | CreateGoogleDocsPermissionsTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: @@ -81,12 +81,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: send_notification_email = d.pop("send_notification_email", UNSET) - def _parse_email_message(data: object) -> Union[None, Unset, str]: + def _parse_email_message(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) email_message = _parse_email_message(d.pop("email_message", UNSET)) diff --git a/rootly_sdk/models/create_google_gemini_chat_completion_task_params.py b/rootly_sdk/models/create_google_gemini_chat_completion_task_params.py index 10cbd8a5..87e49bf1 100644 --- a/rootly_sdk/models/create_google_gemini_chat_completion_task_params.py +++ b/rootly_sdk/models/create_google_gemini_chat_completion_task_params.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -31,8 +31,8 @@ class CreateGoogleGeminiChatCompletionTaskParams: model: "CreateGoogleGeminiChatCompletionTaskParamsModel" prompt: str - task_type: Union[Unset, CreateGoogleGeminiChatCompletionTaskParamsTaskType] = UNSET - system_prompt: Union[Unset, str] = UNSET + task_type: Unset | CreateGoogleGeminiChatCompletionTaskParamsTaskType = UNSET + system_prompt: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -40,7 +40,7 @@ def to_dict(self) -> dict[str, Any]: prompt = self.prompt - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -73,7 +73,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: prompt = d.pop("prompt") _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, CreateGoogleGeminiChatCompletionTaskParamsTaskType] + task_type: Unset | CreateGoogleGeminiChatCompletionTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/create_google_gemini_chat_completion_task_params_model.py b/rootly_sdk/models/create_google_gemini_chat_completion_task_params_model.py index d01d44fe..c0099766 100644 --- a/rootly_sdk/models/create_google_gemini_chat_completion_task_params_model.py +++ b/rootly_sdk/models/create_google_gemini_chat_completion_task_params_model.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -18,8 +18,8 @@ class CreateGoogleGeminiChatCompletionTaskParamsModel: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_google_meeting_task_params.py b/rootly_sdk/models/create_google_meeting_task_params.py index 0a98bfc4..89e2e1e3 100644 --- a/rootly_sdk/models/create_google_meeting_task_params.py +++ b/rootly_sdk/models/create_google_meeting_task_params.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -44,40 +44,40 @@ class CreateGoogleMeetingTaskParams: post_to_slack_channels (Union[Unset, list['CreateGoogleMeetingTaskParamsPostToSlackChannelsItem']]): """ - summary: Union[None, str] - description: Union[None, str] - task_type: Union[Unset, CreateGoogleMeetingTaskParamsTaskType] = UNSET - conference_solution_key: Union[Unset, CreateGoogleMeetingTaskParamsConferenceSolutionKey] = UNSET - record_meeting: Union[Unset, bool] = UNSET - recording_mode: Union[Unset, CreateGoogleMeetingTaskParamsRecordingMode] = UNSET - post_to_incident_timeline: Union[Unset, bool] = UNSET - post_to_slack_channels: Union[Unset, list["CreateGoogleMeetingTaskParamsPostToSlackChannelsItem"]] = UNSET + summary: None | str + description: None | str + task_type: Unset | CreateGoogleMeetingTaskParamsTaskType = UNSET + conference_solution_key: Unset | CreateGoogleMeetingTaskParamsConferenceSolutionKey = UNSET + record_meeting: Unset | bool = UNSET + recording_mode: Unset | CreateGoogleMeetingTaskParamsRecordingMode = UNSET + post_to_incident_timeline: Unset | bool = UNSET + post_to_slack_channels: Unset | list["CreateGoogleMeetingTaskParamsPostToSlackChannelsItem"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - summary: Union[None, str] + summary: None | str summary = self.summary - description: Union[None, str] + description: None | str description = self.description - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - conference_solution_key: Union[Unset, str] = UNSET + conference_solution_key: Unset | str = UNSET if not isinstance(self.conference_solution_key, Unset): conference_solution_key = self.conference_solution_key record_meeting = self.record_meeting - recording_mode: Union[Unset, str] = UNSET + recording_mode: Unset | str = UNSET if not isinstance(self.recording_mode, Unset): recording_mode = self.recording_mode post_to_incident_timeline = self.post_to_incident_timeline - post_to_slack_channels: Union[Unset, list[dict[str, Any]]] = UNSET + post_to_slack_channels: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.post_to_slack_channels, Unset): post_to_slack_channels = [] for post_to_slack_channels_item_data in self.post_to_slack_channels: @@ -115,29 +115,29 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_summary(data: object) -> Union[None, str]: + def _parse_summary(data: object) -> None | str: if data is None: return data - return cast(Union[None, str], data) + return cast(None | str, data) summary = _parse_summary(d.pop("summary")) - def _parse_description(data: object) -> Union[None, str]: + def _parse_description(data: object) -> None | str: if data is None: return data - return cast(Union[None, str], data) + return cast(None | str, data) description = _parse_description(d.pop("description")) _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, CreateGoogleMeetingTaskParamsTaskType] + task_type: Unset | CreateGoogleMeetingTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: task_type = check_create_google_meeting_task_params_task_type(_task_type) _conference_solution_key = d.pop("conference_solution_key", UNSET) - conference_solution_key: Union[Unset, CreateGoogleMeetingTaskParamsConferenceSolutionKey] + conference_solution_key: Unset | CreateGoogleMeetingTaskParamsConferenceSolutionKey if isinstance(_conference_solution_key, Unset): conference_solution_key = UNSET else: @@ -148,7 +148,7 @@ def _parse_description(data: object) -> Union[None, str]: record_meeting = d.pop("record_meeting", UNSET) _recording_mode = d.pop("recording_mode", UNSET) - recording_mode: Union[Unset, CreateGoogleMeetingTaskParamsRecordingMode] + recording_mode: Unset | CreateGoogleMeetingTaskParamsRecordingMode if isinstance(_recording_mode, Unset): recording_mode = UNSET else: diff --git a/rootly_sdk/models/create_google_meeting_task_params_post_to_slack_channels_item.py b/rootly_sdk/models/create_google_meeting_task_params_post_to_slack_channels_item.py index 93046341..596f6f21 100644 --- a/rootly_sdk/models/create_google_meeting_task_params_post_to_slack_channels_item.py +++ b/rootly_sdk/models/create_google_meeting_task_params_post_to_slack_channels_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class CreateGoogleMeetingTaskParamsPostToSlackChannelsItem: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_incident_postmortem_task_params.py b/rootly_sdk/models/create_incident_postmortem_task_params.py index 0f10917e..1a875f38 100644 --- a/rootly_sdk/models/create_incident_postmortem_task_params.py +++ b/rootly_sdk/models/create_incident_postmortem_task_params.py @@ -32,8 +32,8 @@ class CreateIncidentPostmortemTaskParams: incident_id: str title: str - task_type: Union[Unset, CreateIncidentPostmortemTaskParamsTaskType] = UNSET - status: Union[None, Unset, str] = UNSET + task_type: Unset | CreateIncidentPostmortemTaskParamsTaskType = UNSET + status: None | Unset | str = UNSET template: Union["CreateIncidentPostmortemTaskParamsTemplateType0", None, Unset] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -46,17 +46,17 @@ def to_dict(self) -> dict[str, Any]: title = self.title - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - status: Union[None, Unset, str] + status: None | Unset | str if isinstance(self.status, Unset): status = UNSET else: status = self.status - template: Union[None, Unset, dict[str, Any]] + template: None | Unset | dict[str, Any] if isinstance(self.template, Unset): template = UNSET elif isinstance(self.template, CreateIncidentPostmortemTaskParamsTemplateType0): @@ -93,18 +93,18 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: title = d.pop("title") _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, CreateIncidentPostmortemTaskParamsTaskType] + task_type: Unset | CreateIncidentPostmortemTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: task_type = check_create_incident_postmortem_task_params_task_type(_task_type) - def _parse_status(data: object) -> Union[None, Unset, str]: + def _parse_status(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) status = _parse_status(d.pop("status", UNSET)) diff --git a/rootly_sdk/models/create_incident_postmortem_task_params_template_type_0.py b/rootly_sdk/models/create_incident_postmortem_task_params_template_type_0.py index ea02ecab..c5ad478e 100644 --- a/rootly_sdk/models/create_incident_postmortem_task_params_template_type_0.py +++ b/rootly_sdk/models/create_incident_postmortem_task_params_template_type_0.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -18,8 +18,8 @@ class CreateIncidentPostmortemTaskParamsTemplateType0: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_incident_task_params.py b/rootly_sdk/models/create_incident_task_params.py index 6a1905b5..1065a82a 100644 --- a/rootly_sdk/models/create_incident_task_params.py +++ b/rootly_sdk/models/create_incident_task_params.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -32,22 +32,22 @@ class CreateIncidentTaskParams: """ title: str - task_type: Union[Unset, CreateIncidentTaskParamsTaskType] = UNSET - summary: Union[Unset, str] = UNSET - severity_id: Union[Unset, str] = UNSET - incident_type_ids: Union[Unset, list[str]] = UNSET - service_ids: Union[Unset, list[str]] = UNSET - functionality_ids: Union[Unset, list[str]] = UNSET - environment_ids: Union[Unset, list[str]] = UNSET - group_ids: Union[Unset, list[str]] = UNSET - private: Union[Unset, bool] = UNSET - custom_fields_mapping: Union[None, Unset, str] = UNSET + task_type: Unset | CreateIncidentTaskParamsTaskType = UNSET + summary: Unset | str = UNSET + severity_id: Unset | str = UNSET + incident_type_ids: Unset | list[str] = UNSET + service_ids: Unset | list[str] = UNSET + functionality_ids: Unset | list[str] = UNSET + environment_ids: Unset | list[str] = UNSET + group_ids: Unset | list[str] = UNSET + private: Unset | bool = UNSET + custom_fields_mapping: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: title = self.title - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -55,29 +55,29 @@ def to_dict(self) -> dict[str, Any]: severity_id = self.severity_id - incident_type_ids: Union[Unset, list[str]] = UNSET + incident_type_ids: Unset | list[str] = UNSET if not isinstance(self.incident_type_ids, Unset): incident_type_ids = self.incident_type_ids - service_ids: Union[Unset, list[str]] = UNSET + service_ids: Unset | list[str] = UNSET if not isinstance(self.service_ids, Unset): service_ids = self.service_ids - functionality_ids: Union[Unset, list[str]] = UNSET + functionality_ids: Unset | list[str] = UNSET if not isinstance(self.functionality_ids, Unset): functionality_ids = self.functionality_ids - environment_ids: Union[Unset, list[str]] = UNSET + environment_ids: Unset | list[str] = UNSET if not isinstance(self.environment_ids, Unset): environment_ids = self.environment_ids - group_ids: Union[Unset, list[str]] = UNSET + group_ids: Unset | list[str] = UNSET if not isinstance(self.group_ids, Unset): group_ids = self.group_ids private = self.private - custom_fields_mapping: Union[None, Unset, str] + custom_fields_mapping: None | Unset | str if isinstance(self.custom_fields_mapping, Unset): custom_fields_mapping = UNSET else: @@ -119,7 +119,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: title = d.pop("title") _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, CreateIncidentTaskParamsTaskType] + task_type: Unset | CreateIncidentTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: @@ -141,12 +141,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: private = d.pop("private", UNSET) - def _parse_custom_fields_mapping(data: object) -> Union[None, Unset, str]: + def _parse_custom_fields_mapping(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) custom_fields_mapping = _parse_custom_fields_mapping(d.pop("custom_fields_mapping", UNSET)) diff --git a/rootly_sdk/models/create_jira_issue_task_params.py b/rootly_sdk/models/create_jira_issue_task_params.py index 155c217a..462fc455 100644 --- a/rootly_sdk/models/create_jira_issue_task_params.py +++ b/rootly_sdk/models/create_jira_issue_task_params.py @@ -49,19 +49,19 @@ class CreateJiraIssueTaskParams: title: str project_key: str issue_type: "CreateJiraIssueTaskParamsIssueType" - task_type: Union[Unset, CreateJiraIssueTaskParamsTaskType] = UNSET + task_type: Unset | CreateJiraIssueTaskParamsTaskType = UNSET integration: Union[Unset, "CreateJiraIssueTaskParamsIntegration"] = UNSET - description: Union[Unset, str] = UNSET - labels: Union[Unset, str] = UNSET - assign_user_email: Union[Unset, str] = UNSET - reporter_user_email: Union[Unset, str] = UNSET - due_date: Union[Unset, str] = UNSET + description: Unset | str = UNSET + labels: Unset | str = UNSET + assign_user_email: Unset | str = UNSET + reporter_user_email: Unset | str = UNSET + due_date: Unset | str = UNSET priority: Union[Unset, "CreateJiraIssueTaskParamsPriority"] = UNSET status: Union[Unset, "CreateJiraIssueTaskParamsStatus"] = UNSET - custom_fields_mapping: Union[None, Unset, str] = UNSET - update_payload: Union[None, Unset, str] = UNSET - retry_count: Union[Unset, int] = 0 - retry_wait_time: Union[Unset, int] = 1 + custom_fields_mapping: None | Unset | str = UNSET + update_payload: None | Unset | str = UNSET + retry_count: Unset | int = 0 + retry_wait_time: Unset | int = 1 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -71,11 +71,11 @@ def to_dict(self) -> dict[str, Any]: issue_type = self.issue_type.to_dict() - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - integration: Union[Unset, dict[str, Any]] = UNSET + integration: Unset | dict[str, Any] = UNSET if not isinstance(self.integration, Unset): integration = self.integration.to_dict() @@ -89,21 +89,21 @@ def to_dict(self) -> dict[str, Any]: due_date = self.due_date - priority: Union[Unset, dict[str, Any]] = UNSET + priority: Unset | dict[str, Any] = UNSET if not isinstance(self.priority, Unset): priority = self.priority.to_dict() - status: Union[Unset, dict[str, Any]] = UNSET + status: Unset | dict[str, Any] = UNSET if not isinstance(self.status, Unset): status = self.status.to_dict() - custom_fields_mapping: Union[None, Unset, str] + custom_fields_mapping: None | Unset | str if isinstance(self.custom_fields_mapping, Unset): custom_fields_mapping = UNSET else: custom_fields_mapping = self.custom_fields_mapping - update_payload: Union[None, Unset, str] + update_payload: None | Unset | str if isinstance(self.update_payload, Unset): update_payload = UNSET else: @@ -166,14 +166,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: issue_type = CreateJiraIssueTaskParamsIssueType.from_dict(d.pop("issue_type")) _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, CreateJiraIssueTaskParamsTaskType] + task_type: Unset | CreateJiraIssueTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: task_type = check_create_jira_issue_task_params_task_type(_task_type) _integration = d.pop("integration", UNSET) - integration: Union[Unset, CreateJiraIssueTaskParamsIntegration] + integration: Unset | CreateJiraIssueTaskParamsIntegration if isinstance(_integration, Unset): integration = UNSET else: @@ -190,34 +190,34 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: due_date = d.pop("due_date", UNSET) _priority = d.pop("priority", UNSET) - priority: Union[Unset, CreateJiraIssueTaskParamsPriority] + priority: Unset | CreateJiraIssueTaskParamsPriority if isinstance(_priority, Unset): priority = UNSET else: priority = CreateJiraIssueTaskParamsPriority.from_dict(_priority) _status = d.pop("status", UNSET) - status: Union[Unset, CreateJiraIssueTaskParamsStatus] + status: Unset | CreateJiraIssueTaskParamsStatus if isinstance(_status, Unset): status = UNSET else: status = CreateJiraIssueTaskParamsStatus.from_dict(_status) - def _parse_custom_fields_mapping(data: object) -> Union[None, Unset, str]: + def _parse_custom_fields_mapping(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) custom_fields_mapping = _parse_custom_fields_mapping(d.pop("custom_fields_mapping", UNSET)) - def _parse_update_payload(data: object) -> Union[None, Unset, str]: + def _parse_update_payload(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) update_payload = _parse_update_payload(d.pop("update_payload", UNSET)) diff --git a/rootly_sdk/models/create_jira_issue_task_params_integration.py b/rootly_sdk/models/create_jira_issue_task_params_integration.py index c4ae4e9e..b3fe98a6 100644 --- a/rootly_sdk/models/create_jira_issue_task_params_integration.py +++ b/rootly_sdk/models/create_jira_issue_task_params_integration.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -18,8 +18,8 @@ class CreateJiraIssueTaskParamsIntegration: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_jira_issue_task_params_issue_type.py b/rootly_sdk/models/create_jira_issue_task_params_issue_type.py index 4b72a799..8e6dfd69 100644 --- a/rootly_sdk/models/create_jira_issue_task_params_issue_type.py +++ b/rootly_sdk/models/create_jira_issue_task_params_issue_type.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -18,8 +18,8 @@ class CreateJiraIssueTaskParamsIssueType: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_jira_issue_task_params_priority.py b/rootly_sdk/models/create_jira_issue_task_params_priority.py index 7cebbff3..7f761ba0 100644 --- a/rootly_sdk/models/create_jira_issue_task_params_priority.py +++ b/rootly_sdk/models/create_jira_issue_task_params_priority.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -18,8 +18,8 @@ class CreateJiraIssueTaskParamsPriority: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_jira_issue_task_params_status.py b/rootly_sdk/models/create_jira_issue_task_params_status.py index 4073c439..1fbaa1b7 100644 --- a/rootly_sdk/models/create_jira_issue_task_params_status.py +++ b/rootly_sdk/models/create_jira_issue_task_params_status.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -18,8 +18,8 @@ class CreateJiraIssueTaskParamsStatus: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_jira_subtask_task_params.py b/rootly_sdk/models/create_jira_subtask_task_params.py index e93a9a9c..ce6f02e8 100644 --- a/rootly_sdk/models/create_jira_subtask_task_params.py +++ b/rootly_sdk/models/create_jira_subtask_task_params.py @@ -51,19 +51,19 @@ class CreateJiraSubtaskTaskParams: parent_issue_id: str title: str subtask_issue_type: "CreateJiraSubtaskTaskParamsSubtaskIssueType" - task_type: Union[Unset, CreateJiraSubtaskTaskParamsTaskType] = UNSET + task_type: Unset | CreateJiraSubtaskTaskParamsTaskType = UNSET integration: Union[Unset, "CreateJiraSubtaskTaskParamsIntegration"] = UNSET - description: Union[Unset, str] = UNSET - labels: Union[Unset, str] = UNSET - due_date: Union[Unset, str] = UNSET - assign_user_email: Union[Unset, str] = UNSET - reporter_user_email: Union[Unset, str] = UNSET + description: Unset | str = UNSET + labels: Unset | str = UNSET + due_date: Unset | str = UNSET + assign_user_email: Unset | str = UNSET + reporter_user_email: Unset | str = UNSET priority: Union[Unset, "CreateJiraSubtaskTaskParamsPriority"] = UNSET status: Union[Unset, "CreateJiraSubtaskTaskParamsStatus"] = UNSET - custom_fields_mapping: Union[None, Unset, str] = UNSET - update_payload: Union[None, Unset, str] = UNSET - retry_count: Union[Unset, int] = 0 - retry_wait_time: Union[Unset, int] = 1 + custom_fields_mapping: None | Unset | str = UNSET + update_payload: None | Unset | str = UNSET + retry_count: Unset | int = 0 + retry_wait_time: Unset | int = 1 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -75,11 +75,11 @@ def to_dict(self) -> dict[str, Any]: subtask_issue_type = self.subtask_issue_type.to_dict() - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - integration: Union[Unset, dict[str, Any]] = UNSET + integration: Unset | dict[str, Any] = UNSET if not isinstance(self.integration, Unset): integration = self.integration.to_dict() @@ -93,21 +93,21 @@ def to_dict(self) -> dict[str, Any]: reporter_user_email = self.reporter_user_email - priority: Union[Unset, dict[str, Any]] = UNSET + priority: Unset | dict[str, Any] = UNSET if not isinstance(self.priority, Unset): priority = self.priority.to_dict() - status: Union[Unset, dict[str, Any]] = UNSET + status: Unset | dict[str, Any] = UNSET if not isinstance(self.status, Unset): status = self.status.to_dict() - custom_fields_mapping: Union[None, Unset, str] + custom_fields_mapping: None | Unset | str if isinstance(self.custom_fields_mapping, Unset): custom_fields_mapping = UNSET else: custom_fields_mapping = self.custom_fields_mapping - update_payload: Union[None, Unset, str] + update_payload: None | Unset | str if isinstance(self.update_payload, Unset): update_payload = UNSET else: @@ -175,14 +175,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: subtask_issue_type = CreateJiraSubtaskTaskParamsSubtaskIssueType.from_dict(d.pop("subtask_issue_type")) _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, CreateJiraSubtaskTaskParamsTaskType] + task_type: Unset | CreateJiraSubtaskTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: task_type = check_create_jira_subtask_task_params_task_type(_task_type) _integration = d.pop("integration", UNSET) - integration: Union[Unset, CreateJiraSubtaskTaskParamsIntegration] + integration: Unset | CreateJiraSubtaskTaskParamsIntegration if isinstance(_integration, Unset): integration = UNSET else: @@ -199,34 +199,34 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: reporter_user_email = d.pop("reporter_user_email", UNSET) _priority = d.pop("priority", UNSET) - priority: Union[Unset, CreateJiraSubtaskTaskParamsPriority] + priority: Unset | CreateJiraSubtaskTaskParamsPriority if isinstance(_priority, Unset): priority = UNSET else: priority = CreateJiraSubtaskTaskParamsPriority.from_dict(_priority) _status = d.pop("status", UNSET) - status: Union[Unset, CreateJiraSubtaskTaskParamsStatus] + status: Unset | CreateJiraSubtaskTaskParamsStatus if isinstance(_status, Unset): status = UNSET else: status = CreateJiraSubtaskTaskParamsStatus.from_dict(_status) - def _parse_custom_fields_mapping(data: object) -> Union[None, Unset, str]: + def _parse_custom_fields_mapping(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) custom_fields_mapping = _parse_custom_fields_mapping(d.pop("custom_fields_mapping", UNSET)) - def _parse_update_payload(data: object) -> Union[None, Unset, str]: + def _parse_update_payload(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) update_payload = _parse_update_payload(d.pop("update_payload", UNSET)) diff --git a/rootly_sdk/models/create_jira_subtask_task_params_integration.py b/rootly_sdk/models/create_jira_subtask_task_params_integration.py index 31d747de..da42dd97 100644 --- a/rootly_sdk/models/create_jira_subtask_task_params_integration.py +++ b/rootly_sdk/models/create_jira_subtask_task_params_integration.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -18,8 +18,8 @@ class CreateJiraSubtaskTaskParamsIntegration: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_jira_subtask_task_params_priority.py b/rootly_sdk/models/create_jira_subtask_task_params_priority.py index 8ce96950..0c90227e 100644 --- a/rootly_sdk/models/create_jira_subtask_task_params_priority.py +++ b/rootly_sdk/models/create_jira_subtask_task_params_priority.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -18,8 +18,8 @@ class CreateJiraSubtaskTaskParamsPriority: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_jira_subtask_task_params_status.py b/rootly_sdk/models/create_jira_subtask_task_params_status.py index 25c26cd9..3bc133f4 100644 --- a/rootly_sdk/models/create_jira_subtask_task_params_status.py +++ b/rootly_sdk/models/create_jira_subtask_task_params_status.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -18,8 +18,8 @@ class CreateJiraSubtaskTaskParamsStatus: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_jira_subtask_task_params_subtask_issue_type.py b/rootly_sdk/models/create_jira_subtask_task_params_subtask_issue_type.py index 58b554b6..dd079064 100644 --- a/rootly_sdk/models/create_jira_subtask_task_params_subtask_issue_type.py +++ b/rootly_sdk/models/create_jira_subtask_task_params_subtask_issue_type.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -18,8 +18,8 @@ class CreateJiraSubtaskTaskParamsSubtaskIssueType: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_jsmops_alert_task_params.py b/rootly_sdk/models/create_jsmops_alert_task_params.py index 4691f33d..1d88845f 100644 --- a/rootly_sdk/models/create_jsmops_alert_task_params.py +++ b/rootly_sdk/models/create_jsmops_alert_task_params.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -41,62 +41,62 @@ class CreateJsmopsAlertTaskParams: """ message: str - task_type: Union[Unset, CreateJsmopsAlertTaskParamsTaskType] = UNSET - description: Union[None, Unset, str] = UNSET - teams: Union[Unset, list["CreateJsmopsAlertTaskParamsTeamsItem"]] = UNSET - users: Union[Unset, list["CreateJsmopsAlertTaskParamsUsersItem"]] = UNSET - schedules: Union[Unset, list["CreateJsmopsAlertTaskParamsSchedulesItem"]] = UNSET - escalations: Union[Unset, list["CreateJsmopsAlertTaskParamsEscalationsItem"]] = UNSET - priority: Union[Unset, CreateJsmopsAlertTaskParamsPriority] = "P3" - details: Union[None, Unset, str] = UNSET + task_type: Unset | CreateJsmopsAlertTaskParamsTaskType = UNSET + description: None | Unset | str = UNSET + teams: Unset | list["CreateJsmopsAlertTaskParamsTeamsItem"] = UNSET + users: Unset | list["CreateJsmopsAlertTaskParamsUsersItem"] = UNSET + schedules: Unset | list["CreateJsmopsAlertTaskParamsSchedulesItem"] = UNSET + escalations: Unset | list["CreateJsmopsAlertTaskParamsEscalationsItem"] = UNSET + priority: Unset | CreateJsmopsAlertTaskParamsPriority = "P3" + details: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: message = self.message - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - teams: Union[Unset, list[dict[str, Any]]] = UNSET + teams: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.teams, Unset): teams = [] for teams_item_data in self.teams: teams_item = teams_item_data.to_dict() teams.append(teams_item) - users: Union[Unset, list[dict[str, Any]]] = UNSET + users: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.users, Unset): users = [] for users_item_data in self.users: users_item = users_item_data.to_dict() users.append(users_item) - schedules: Union[Unset, list[dict[str, Any]]] = UNSET + schedules: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.schedules, Unset): schedules = [] for schedules_item_data in self.schedules: schedules_item = schedules_item_data.to_dict() schedules.append(schedules_item) - escalations: Union[Unset, list[dict[str, Any]]] = UNSET + escalations: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.escalations, Unset): escalations = [] for escalations_item_data in self.escalations: escalations_item = escalations_item_data.to_dict() escalations.append(escalations_item) - priority: Union[Unset, str] = UNSET + priority: Unset | str = UNSET if not isinstance(self.priority, Unset): priority = self.priority - details: Union[None, Unset, str] + details: None | Unset | str if isinstance(self.details, Unset): details = UNSET else: @@ -139,18 +139,18 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: message = d.pop("message") _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, CreateJsmopsAlertTaskParamsTaskType] + task_type: Unset | CreateJsmopsAlertTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: task_type = check_create_jsmops_alert_task_params_task_type(_task_type) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) @@ -183,18 +183,18 @@ def _parse_description(data: object) -> Union[None, Unset, str]: escalations.append(escalations_item) _priority = d.pop("priority", UNSET) - priority: Union[Unset, CreateJsmopsAlertTaskParamsPriority] + priority: Unset | CreateJsmopsAlertTaskParamsPriority if isinstance(_priority, Unset): priority = UNSET else: priority = check_create_jsmops_alert_task_params_priority(_priority) - def _parse_details(data: object) -> Union[None, Unset, str]: + def _parse_details(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) details = _parse_details(d.pop("details", UNSET)) diff --git a/rootly_sdk/models/create_jsmops_alert_task_params_escalations_item.py b/rootly_sdk/models/create_jsmops_alert_task_params_escalations_item.py index 3c5ad133..c1b887fa 100644 --- a/rootly_sdk/models/create_jsmops_alert_task_params_escalations_item.py +++ b/rootly_sdk/models/create_jsmops_alert_task_params_escalations_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class CreateJsmopsAlertTaskParamsEscalationsItem: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_jsmops_alert_task_params_schedules_item.py b/rootly_sdk/models/create_jsmops_alert_task_params_schedules_item.py index 581d3df3..d17d7e27 100644 --- a/rootly_sdk/models/create_jsmops_alert_task_params_schedules_item.py +++ b/rootly_sdk/models/create_jsmops_alert_task_params_schedules_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class CreateJsmopsAlertTaskParamsSchedulesItem: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_jsmops_alert_task_params_teams_item.py b/rootly_sdk/models/create_jsmops_alert_task_params_teams_item.py index 090f0f22..8b6fd019 100644 --- a/rootly_sdk/models/create_jsmops_alert_task_params_teams_item.py +++ b/rootly_sdk/models/create_jsmops_alert_task_params_teams_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class CreateJsmopsAlertTaskParamsTeamsItem: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_jsmops_alert_task_params_users_item.py b/rootly_sdk/models/create_jsmops_alert_task_params_users_item.py index 4a9952ac..32e54d1d 100644 --- a/rootly_sdk/models/create_jsmops_alert_task_params_users_item.py +++ b/rootly_sdk/models/create_jsmops_alert_task_params_users_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class CreateJsmopsAlertTaskParamsUsersItem: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_linear_issue_comment_task_params.py b/rootly_sdk/models/create_linear_issue_comment_task_params.py index dc3ba833..85aa5e0e 100644 --- a/rootly_sdk/models/create_linear_issue_comment_task_params.py +++ b/rootly_sdk/models/create_linear_issue_comment_task_params.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -24,7 +24,7 @@ class CreateLinearIssueCommentTaskParams: issue_id: str body: str - task_type: Union[Unset, CreateLinearIssueCommentTaskParamsTaskType] = UNSET + task_type: Unset | CreateLinearIssueCommentTaskParamsTaskType = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -32,7 +32,7 @@ def to_dict(self) -> dict[str, Any]: body = self.body - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -57,7 +57,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: body = d.pop("body") _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, CreateLinearIssueCommentTaskParamsTaskType] + task_type: Unset | CreateLinearIssueCommentTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/create_linear_issue_task_params.py b/rootly_sdk/models/create_linear_issue_task_params.py index 4e93228b..ac4336dc 100644 --- a/rootly_sdk/models/create_linear_issue_task_params.py +++ b/rootly_sdk/models/create_linear_issue_task_params.py @@ -41,13 +41,13 @@ class CreateLinearIssueTaskParams: title: str team: "CreateLinearIssueTaskParamsTeam" state: "CreateLinearIssueTaskParamsState" - task_type: Union[Unset, CreateLinearIssueTaskParamsTaskType] = UNSET - description: Union[Unset, str] = UNSET + task_type: Unset | CreateLinearIssueTaskParamsTaskType = UNSET + description: Unset | str = UNSET project: Union[Unset, "CreateLinearIssueTaskParamsProject"] = UNSET - labels: Union[Unset, list["CreateLinearIssueTaskParamsLabelsItem"]] = UNSET + labels: Unset | list["CreateLinearIssueTaskParamsLabelsItem"] = UNSET priority: Union[Unset, "CreateLinearIssueTaskParamsPriority"] = UNSET - assign_user_email: Union[Unset, str] = UNSET - custom_fields_mapping: Union[None, Unset, str] = UNSET + assign_user_email: Unset | str = UNSET + custom_fields_mapping: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -57,30 +57,30 @@ def to_dict(self) -> dict[str, Any]: state = self.state.to_dict() - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type description = self.description - project: Union[Unset, dict[str, Any]] = UNSET + project: Unset | dict[str, Any] = UNSET if not isinstance(self.project, Unset): project = self.project.to_dict() - labels: Union[Unset, list[dict[str, Any]]] = UNSET + labels: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.labels, Unset): labels = [] for labels_item_data in self.labels: labels_item = labels_item_data.to_dict() labels.append(labels_item) - priority: Union[Unset, dict[str, Any]] = UNSET + priority: Unset | dict[str, Any] = UNSET if not isinstance(self.priority, Unset): priority = self.priority.to_dict() assign_user_email = self.assign_user_email - custom_fields_mapping: Union[None, Unset, str] + custom_fields_mapping: None | Unset | str if isinstance(self.custom_fields_mapping, Unset): custom_fields_mapping = UNSET else: @@ -128,7 +128,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: state = CreateLinearIssueTaskParamsState.from_dict(d.pop("state")) _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, CreateLinearIssueTaskParamsTaskType] + task_type: Unset | CreateLinearIssueTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: @@ -137,7 +137,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: description = d.pop("description", UNSET) _project = d.pop("project", UNSET) - project: Union[Unset, CreateLinearIssueTaskParamsProject] + project: Unset | CreateLinearIssueTaskParamsProject if isinstance(_project, Unset): project = UNSET else: @@ -151,7 +151,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: labels.append(labels_item) _priority = d.pop("priority", UNSET) - priority: Union[Unset, CreateLinearIssueTaskParamsPriority] + priority: Unset | CreateLinearIssueTaskParamsPriority if isinstance(_priority, Unset): priority = UNSET else: @@ -159,12 +159,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: assign_user_email = d.pop("assign_user_email", UNSET) - def _parse_custom_fields_mapping(data: object) -> Union[None, Unset, str]: + def _parse_custom_fields_mapping(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) custom_fields_mapping = _parse_custom_fields_mapping(d.pop("custom_fields_mapping", UNSET)) diff --git a/rootly_sdk/models/create_linear_issue_task_params_labels_item.py b/rootly_sdk/models/create_linear_issue_task_params_labels_item.py index def23341..7caa9c5c 100644 --- a/rootly_sdk/models/create_linear_issue_task_params_labels_item.py +++ b/rootly_sdk/models/create_linear_issue_task_params_labels_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class CreateLinearIssueTaskParamsLabelsItem: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_linear_issue_task_params_priority.py b/rootly_sdk/models/create_linear_issue_task_params_priority.py index 39e12e13..fd8fe0cb 100644 --- a/rootly_sdk/models/create_linear_issue_task_params_priority.py +++ b/rootly_sdk/models/create_linear_issue_task_params_priority.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -18,8 +18,8 @@ class CreateLinearIssueTaskParamsPriority: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_linear_issue_task_params_project.py b/rootly_sdk/models/create_linear_issue_task_params_project.py index b96fedf1..44dcbb73 100644 --- a/rootly_sdk/models/create_linear_issue_task_params_project.py +++ b/rootly_sdk/models/create_linear_issue_task_params_project.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -18,8 +18,8 @@ class CreateLinearIssueTaskParamsProject: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_linear_issue_task_params_state.py b/rootly_sdk/models/create_linear_issue_task_params_state.py index 7100aca7..8b9b28bb 100644 --- a/rootly_sdk/models/create_linear_issue_task_params_state.py +++ b/rootly_sdk/models/create_linear_issue_task_params_state.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -18,8 +18,8 @@ class CreateLinearIssueTaskParamsState: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_linear_issue_task_params_team.py b/rootly_sdk/models/create_linear_issue_task_params_team.py index 7919b34e..b87cee57 100644 --- a/rootly_sdk/models/create_linear_issue_task_params_team.py +++ b/rootly_sdk/models/create_linear_issue_task_params_team.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -18,8 +18,8 @@ class CreateLinearIssueTaskParamsTeam: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_linear_subtask_issue_task_params.py b/rootly_sdk/models/create_linear_subtask_issue_task_params.py index 05447c8e..62bf2363 100644 --- a/rootly_sdk/models/create_linear_subtask_issue_task_params.py +++ b/rootly_sdk/models/create_linear_subtask_issue_task_params.py @@ -40,12 +40,12 @@ class CreateLinearSubtaskIssueTaskParams: parent_issue_id: str title: str state: "CreateLinearSubtaskIssueTaskParamsState" - task_type: Union[Unset, CreateLinearSubtaskIssueTaskParamsTaskType] = UNSET - description: Union[Unset, str] = UNSET + task_type: Unset | CreateLinearSubtaskIssueTaskParamsTaskType = UNSET + description: Unset | str = UNSET priority: Union[Unset, "CreateLinearSubtaskIssueTaskParamsPriority"] = UNSET - labels: Union[Unset, list["CreateLinearSubtaskIssueTaskParamsLabelsItem"]] = UNSET - assign_user_email: Union[Unset, str] = UNSET - custom_fields_mapping: Union[None, Unset, str] = UNSET + labels: Unset | list["CreateLinearSubtaskIssueTaskParamsLabelsItem"] = UNSET + assign_user_email: Unset | str = UNSET + custom_fields_mapping: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -55,17 +55,17 @@ def to_dict(self) -> dict[str, Any]: state = self.state.to_dict() - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type description = self.description - priority: Union[Unset, dict[str, Any]] = UNSET + priority: Unset | dict[str, Any] = UNSET if not isinstance(self.priority, Unset): priority = self.priority.to_dict() - labels: Union[Unset, list[dict[str, Any]]] = UNSET + labels: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.labels, Unset): labels = [] for labels_item_data in self.labels: @@ -74,7 +74,7 @@ def to_dict(self) -> dict[str, Any]: assign_user_email = self.assign_user_email - custom_fields_mapping: Union[None, Unset, str] + custom_fields_mapping: None | Unset | str if isinstance(self.custom_fields_mapping, Unset): custom_fields_mapping = UNSET else: @@ -120,7 +120,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: state = CreateLinearSubtaskIssueTaskParamsState.from_dict(d.pop("state")) _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, CreateLinearSubtaskIssueTaskParamsTaskType] + task_type: Unset | CreateLinearSubtaskIssueTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: @@ -129,7 +129,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: description = d.pop("description", UNSET) _priority = d.pop("priority", UNSET) - priority: Union[Unset, CreateLinearSubtaskIssueTaskParamsPriority] + priority: Unset | CreateLinearSubtaskIssueTaskParamsPriority if isinstance(_priority, Unset): priority = UNSET else: @@ -144,12 +144,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: assign_user_email = d.pop("assign_user_email", UNSET) - def _parse_custom_fields_mapping(data: object) -> Union[None, Unset, str]: + def _parse_custom_fields_mapping(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) custom_fields_mapping = _parse_custom_fields_mapping(d.pop("custom_fields_mapping", UNSET)) diff --git a/rootly_sdk/models/create_linear_subtask_issue_task_params_labels_item.py b/rootly_sdk/models/create_linear_subtask_issue_task_params_labels_item.py index b57b3fd8..21339bcd 100644 --- a/rootly_sdk/models/create_linear_subtask_issue_task_params_labels_item.py +++ b/rootly_sdk/models/create_linear_subtask_issue_task_params_labels_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class CreateLinearSubtaskIssueTaskParamsLabelsItem: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_linear_subtask_issue_task_params_priority.py b/rootly_sdk/models/create_linear_subtask_issue_task_params_priority.py index f11c1e30..93f710e2 100644 --- a/rootly_sdk/models/create_linear_subtask_issue_task_params_priority.py +++ b/rootly_sdk/models/create_linear_subtask_issue_task_params_priority.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -18,8 +18,8 @@ class CreateLinearSubtaskIssueTaskParamsPriority: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_linear_subtask_issue_task_params_state.py b/rootly_sdk/models/create_linear_subtask_issue_task_params_state.py index 08f53201..1a12777e 100644 --- a/rootly_sdk/models/create_linear_subtask_issue_task_params_state.py +++ b/rootly_sdk/models/create_linear_subtask_issue_task_params_state.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -18,8 +18,8 @@ class CreateLinearSubtaskIssueTaskParamsState: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_microsoft_teams_channel_task_params.py b/rootly_sdk/models/create_microsoft_teams_channel_task_params.py index 1d098e85..f991a56e 100644 --- a/rootly_sdk/models/create_microsoft_teams_channel_task_params.py +++ b/rootly_sdk/models/create_microsoft_teams_channel_task_params.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -34,9 +34,9 @@ class CreateMicrosoftTeamsChannelTaskParams: team: "CreateMicrosoftTeamsChannelTaskParamsTeam" title: str - task_type: Union[Unset, CreateMicrosoftTeamsChannelTaskParamsTaskType] = UNSET - description: Union[Unset, str] = UNSET - private: Union[Unset, CreateMicrosoftTeamsChannelTaskParamsPrivate] = "auto" + task_type: Unset | CreateMicrosoftTeamsChannelTaskParamsTaskType = UNSET + description: Unset | str = UNSET + private: Unset | CreateMicrosoftTeamsChannelTaskParamsPrivate = "auto" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -44,13 +44,13 @@ def to_dict(self) -> dict[str, Any]: title = self.title - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type description = self.description - private: Union[Unset, str] = UNSET + private: Unset | str = UNSET if not isinstance(self.private, Unset): private = self.private @@ -81,7 +81,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: title = d.pop("title") _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, CreateMicrosoftTeamsChannelTaskParamsTaskType] + task_type: Unset | CreateMicrosoftTeamsChannelTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: @@ -90,7 +90,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: description = d.pop("description", UNSET) _private = d.pop("private", UNSET) - private: Union[Unset, CreateMicrosoftTeamsChannelTaskParamsPrivate] + private: Unset | CreateMicrosoftTeamsChannelTaskParamsPrivate if isinstance(_private, Unset): private = UNSET else: diff --git a/rootly_sdk/models/create_microsoft_teams_channel_task_params_team.py b/rootly_sdk/models/create_microsoft_teams_channel_task_params_team.py index 5d60d238..32f51411 100644 --- a/rootly_sdk/models/create_microsoft_teams_channel_task_params_team.py +++ b/rootly_sdk/models/create_microsoft_teams_channel_task_params_team.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class CreateMicrosoftTeamsChannelTaskParamsTeam: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_microsoft_teams_chat_task_params.py b/rootly_sdk/models/create_microsoft_teams_chat_task_params.py index dc41facf..b02e3b4a 100644 --- a/rootly_sdk/models/create_microsoft_teams_chat_task_params.py +++ b/rootly_sdk/models/create_microsoft_teams_chat_task_params.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -34,9 +34,9 @@ class CreateMicrosoftTeamsChatTaskParams: """ members: list["CreateMicrosoftTeamsChatTaskParamsMembersItem"] - task_type: Union[Unset, CreateMicrosoftTeamsChatTaskParamsTaskType] = UNSET - topic: Union[None, Unset, str] = UNSET - chat_type: Union[Unset, CreateMicrosoftTeamsChatTaskParamsChatType] = "group" + task_type: Unset | CreateMicrosoftTeamsChatTaskParamsTaskType = UNSET + topic: None | Unset | str = UNSET + chat_type: Unset | CreateMicrosoftTeamsChatTaskParamsChatType = "group" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -45,17 +45,17 @@ def to_dict(self) -> dict[str, Any]: members_item = members_item_data.to_dict() members.append(members_item) - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - topic: Union[None, Unset, str] + topic: None | Unset | str if isinstance(self.topic, Unset): topic = UNSET else: topic = self.topic - chat_type: Union[Unset, str] = UNSET + chat_type: Unset | str = UNSET if not isinstance(self.chat_type, Unset): chat_type = self.chat_type @@ -90,23 +90,23 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: members.append(members_item) _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, CreateMicrosoftTeamsChatTaskParamsTaskType] + task_type: Unset | CreateMicrosoftTeamsChatTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: task_type = check_create_microsoft_teams_chat_task_params_task_type(_task_type) - def _parse_topic(data: object) -> Union[None, Unset, str]: + def _parse_topic(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) topic = _parse_topic(d.pop("topic", UNSET)) _chat_type = d.pop("chat_type", UNSET) - chat_type: Union[Unset, CreateMicrosoftTeamsChatTaskParamsChatType] + chat_type: Unset | CreateMicrosoftTeamsChatTaskParamsChatType if isinstance(_chat_type, Unset): chat_type = UNSET else: diff --git a/rootly_sdk/models/create_microsoft_teams_chat_task_params_members_item.py b/rootly_sdk/models/create_microsoft_teams_chat_task_params_members_item.py index 2211ee50..5c2b3733 100644 --- a/rootly_sdk/models/create_microsoft_teams_chat_task_params_members_item.py +++ b/rootly_sdk/models/create_microsoft_teams_chat_task_params_members_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class CreateMicrosoftTeamsChatTaskParamsMembersItem: name (Union[Unset, str]): """ - email: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + email: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_microsoft_teams_meeting_task_params.py b/rootly_sdk/models/create_microsoft_teams_meeting_task_params.py index 71a9130a..af680a85 100644 --- a/rootly_sdk/models/create_microsoft_teams_meeting_task_params.py +++ b/rootly_sdk/models/create_microsoft_teams_meeting_task_params.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -40,11 +40,11 @@ class CreateMicrosoftTeamsMeetingTaskParams: name: str subject: str - task_type: Union[Unset, CreateMicrosoftTeamsMeetingTaskParamsTaskType] = UNSET - record_meeting: Union[Unset, bool] = UNSET - recording_mode: Union[Unset, CreateMicrosoftTeamsMeetingTaskParamsRecordingMode] = UNSET - post_to_incident_timeline: Union[Unset, bool] = UNSET - post_to_slack_channels: Union[Unset, list["CreateMicrosoftTeamsMeetingTaskParamsPostToSlackChannelsItem"]] = UNSET + task_type: Unset | CreateMicrosoftTeamsMeetingTaskParamsTaskType = UNSET + record_meeting: Unset | bool = UNSET + recording_mode: Unset | CreateMicrosoftTeamsMeetingTaskParamsRecordingMode = UNSET + post_to_incident_timeline: Unset | bool = UNSET + post_to_slack_channels: Unset | list["CreateMicrosoftTeamsMeetingTaskParamsPostToSlackChannelsItem"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -52,19 +52,19 @@ def to_dict(self) -> dict[str, Any]: subject = self.subject - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type record_meeting = self.record_meeting - recording_mode: Union[Unset, str] = UNSET + recording_mode: Unset | str = UNSET if not isinstance(self.recording_mode, Unset): recording_mode = self.recording_mode post_to_incident_timeline = self.post_to_incident_timeline - post_to_slack_channels: Union[Unset, list[dict[str, Any]]] = UNSET + post_to_slack_channels: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.post_to_slack_channels, Unset): post_to_slack_channels = [] for post_to_slack_channels_item_data in self.post_to_slack_channels: @@ -104,7 +104,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: subject = d.pop("subject") _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, CreateMicrosoftTeamsMeetingTaskParamsTaskType] + task_type: Unset | CreateMicrosoftTeamsMeetingTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: @@ -113,7 +113,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: record_meeting = d.pop("record_meeting", UNSET) _recording_mode = d.pop("recording_mode", UNSET) - recording_mode: Union[Unset, CreateMicrosoftTeamsMeetingTaskParamsRecordingMode] + recording_mode: Unset | CreateMicrosoftTeamsMeetingTaskParamsRecordingMode if isinstance(_recording_mode, Unset): recording_mode = UNSET else: diff --git a/rootly_sdk/models/create_microsoft_teams_meeting_task_params_post_to_slack_channels_item.py b/rootly_sdk/models/create_microsoft_teams_meeting_task_params_post_to_slack_channels_item.py index 6b90499a..7e910bdb 100644 --- a/rootly_sdk/models/create_microsoft_teams_meeting_task_params_post_to_slack_channels_item.py +++ b/rootly_sdk/models/create_microsoft_teams_meeting_task_params_post_to_slack_channels_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class CreateMicrosoftTeamsMeetingTaskParamsPostToSlackChannelsItem: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_mistral_chat_completion_task_params.py b/rootly_sdk/models/create_mistral_chat_completion_task_params.py index 3217bb2a..efd67bc9 100644 --- a/rootly_sdk/models/create_mistral_chat_completion_task_params.py +++ b/rootly_sdk/models/create_mistral_chat_completion_task_params.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -32,11 +32,11 @@ class CreateMistralChatCompletionTaskParams: model: "CreateMistralChatCompletionTaskParamsModel" prompt: str - task_type: Union[Unset, CreateMistralChatCompletionTaskParamsTaskType] = UNSET - system_prompt: Union[Unset, str] = UNSET - temperature: Union[Unset, float] = UNSET - max_tokens: Union[Unset, int] = UNSET - top_p: Union[Unset, float] = UNSET + task_type: Unset | CreateMistralChatCompletionTaskParamsTaskType = UNSET + system_prompt: Unset | str = UNSET + temperature: Unset | float = UNSET + max_tokens: Unset | int = UNSET + top_p: Unset | float = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -44,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: prompt = self.prompt - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -87,7 +87,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: prompt = d.pop("prompt") _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, CreateMistralChatCompletionTaskParamsTaskType] + task_type: Unset | CreateMistralChatCompletionTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/create_mistral_chat_completion_task_params_model.py b/rootly_sdk/models/create_mistral_chat_completion_task_params_model.py index e9e03abc..aa4b56d8 100644 --- a/rootly_sdk/models/create_mistral_chat_completion_task_params_model.py +++ b/rootly_sdk/models/create_mistral_chat_completion_task_params_model.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -18,8 +18,8 @@ class CreateMistralChatCompletionTaskParamsModel: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_motion_task_task_params.py b/rootly_sdk/models/create_motion_task_task_params.py index 992e8b54..287d06ef 100644 --- a/rootly_sdk/models/create_motion_task_task_params.py +++ b/rootly_sdk/models/create_motion_task_task_params.py @@ -38,14 +38,14 @@ class CreateMotionTaskTaskParams: workspace: "CreateMotionTaskTaskParamsWorkspace" title: str - task_type: Union[Unset, CreateMotionTaskTaskParamsTaskType] = UNSET + task_type: Unset | CreateMotionTaskTaskParamsTaskType = UNSET project: Union[Unset, "CreateMotionTaskTaskParamsProject"] = UNSET status: Union[Unset, "CreateMotionTaskTaskParamsStatus"] = UNSET - description: Union[Unset, str] = UNSET - labels: Union[Unset, str] = UNSET + description: Unset | str = UNSET + labels: Unset | str = UNSET priority: Union[Unset, "CreateMotionTaskTaskParamsPriority"] = UNSET - duration: Union[Unset, str] = UNSET - due_date: Union[Unset, str] = UNSET + duration: Unset | str = UNSET + due_date: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -53,15 +53,15 @@ def to_dict(self) -> dict[str, Any]: title = self.title - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - project: Union[Unset, dict[str, Any]] = UNSET + project: Unset | dict[str, Any] = UNSET if not isinstance(self.project, Unset): project = self.project.to_dict() - status: Union[Unset, dict[str, Any]] = UNSET + status: Unset | dict[str, Any] = UNSET if not isinstance(self.status, Unset): status = self.status.to_dict() @@ -69,7 +69,7 @@ def to_dict(self) -> dict[str, Any]: labels = self.labels - priority: Union[Unset, dict[str, Any]] = UNSET + priority: Unset | dict[str, Any] = UNSET if not isinstance(self.priority, Unset): priority = self.priority.to_dict() @@ -117,21 +117,21 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: title = d.pop("title") _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, CreateMotionTaskTaskParamsTaskType] + task_type: Unset | CreateMotionTaskTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: task_type = check_create_motion_task_task_params_task_type(_task_type) _project = d.pop("project", UNSET) - project: Union[Unset, CreateMotionTaskTaskParamsProject] + project: Unset | CreateMotionTaskTaskParamsProject if isinstance(_project, Unset): project = UNSET else: project = CreateMotionTaskTaskParamsProject.from_dict(_project) _status = d.pop("status", UNSET) - status: Union[Unset, CreateMotionTaskTaskParamsStatus] + status: Unset | CreateMotionTaskTaskParamsStatus if isinstance(_status, Unset): status = UNSET else: @@ -142,7 +142,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: labels = d.pop("labels", UNSET) _priority = d.pop("priority", UNSET) - priority: Union[Unset, CreateMotionTaskTaskParamsPriority] + priority: Unset | CreateMotionTaskTaskParamsPriority if isinstance(_priority, Unset): priority = UNSET else: diff --git a/rootly_sdk/models/create_motion_task_task_params_priority.py b/rootly_sdk/models/create_motion_task_task_params_priority.py index 802f2a1a..e8a31af7 100644 --- a/rootly_sdk/models/create_motion_task_task_params_priority.py +++ b/rootly_sdk/models/create_motion_task_task_params_priority.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -18,8 +18,8 @@ class CreateMotionTaskTaskParamsPriority: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_motion_task_task_params_project.py b/rootly_sdk/models/create_motion_task_task_params_project.py index 28dc0adb..a76a9455 100644 --- a/rootly_sdk/models/create_motion_task_task_params_project.py +++ b/rootly_sdk/models/create_motion_task_task_params_project.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class CreateMotionTaskTaskParamsProject: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_motion_task_task_params_status.py b/rootly_sdk/models/create_motion_task_task_params_status.py index 01eab0bf..43522fa2 100644 --- a/rootly_sdk/models/create_motion_task_task_params_status.py +++ b/rootly_sdk/models/create_motion_task_task_params_status.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class CreateMotionTaskTaskParamsStatus: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_motion_task_task_params_workspace.py b/rootly_sdk/models/create_motion_task_task_params_workspace.py index c63d7b3f..ff425137 100644 --- a/rootly_sdk/models/create_motion_task_task_params_workspace.py +++ b/rootly_sdk/models/create_motion_task_task_params_workspace.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class CreateMotionTaskTaskParamsWorkspace: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_notion_page_task_params.py b/rootly_sdk/models/create_notion_page_task_params.py index 2251c907..28bae0df 100644 --- a/rootly_sdk/models/create_notion_page_task_params.py +++ b/rootly_sdk/models/create_notion_page_task_params.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -34,12 +34,12 @@ class CreateNotionPageTaskParams: title: str parent_page: "CreateNotionPageTaskParamsParentPage" - task_type: Union[Unset, CreateNotionPageTaskParamsTaskType] = UNSET - post_mortem_template_id: Union[Unset, str] = UNSET - content: Union[Unset, str] = UNSET - mark_post_mortem_as_published: Union[Unset, bool] = True - show_timeline_as_table: Union[Unset, bool] = UNSET - show_action_items_as_table: Union[Unset, bool] = UNSET + task_type: Unset | CreateNotionPageTaskParamsTaskType = UNSET + post_mortem_template_id: Unset | str = UNSET + content: Unset | str = UNSET + mark_post_mortem_as_published: Unset | bool = True + show_timeline_as_table: Unset | bool = UNSET + show_action_items_as_table: Unset | bool = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -47,7 +47,7 @@ def to_dict(self) -> dict[str, Any]: parent_page = self.parent_page.to_dict() - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -94,7 +94,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: parent_page = CreateNotionPageTaskParamsParentPage.from_dict(d.pop("parent_page")) _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, CreateNotionPageTaskParamsTaskType] + task_type: Unset | CreateNotionPageTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/create_notion_page_task_params_parent_page.py b/rootly_sdk/models/create_notion_page_task_params_parent_page.py index 94cbc541..21c4244a 100644 --- a/rootly_sdk/models/create_notion_page_task_params_parent_page.py +++ b/rootly_sdk/models/create_notion_page_task_params_parent_page.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -18,8 +18,8 @@ class CreateNotionPageTaskParamsParentPage: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_openai_chat_completion_task_params.py b/rootly_sdk/models/create_openai_chat_completion_task_params.py index 06ae1f54..a917e34d 100644 --- a/rootly_sdk/models/create_openai_chat_completion_task_params.py +++ b/rootly_sdk/models/create_openai_chat_completion_task_params.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -44,13 +44,13 @@ class CreateOpenaiChatCompletionTaskParams: model: "CreateOpenaiChatCompletionTaskParamsModel" prompt: str - task_type: Union[Unset, CreateOpenaiChatCompletionTaskParamsTaskType] = UNSET - system_prompt: Union[Unset, str] = UNSET - temperature: Union[Unset, float] = UNSET - max_tokens: Union[Unset, int] = UNSET - top_p: Union[Unset, float] = UNSET - reasoning_effort: Union[Unset, CreateOpenaiChatCompletionTaskParamsReasoningEffort] = UNSET - reasoning_summary: Union[Unset, CreateOpenaiChatCompletionTaskParamsReasoningSummary] = UNSET + task_type: Unset | CreateOpenaiChatCompletionTaskParamsTaskType = UNSET + system_prompt: Unset | str = UNSET + temperature: Unset | float = UNSET + max_tokens: Unset | int = UNSET + top_p: Unset | float = UNSET + reasoning_effort: Unset | CreateOpenaiChatCompletionTaskParamsReasoningEffort = UNSET + reasoning_summary: Unset | CreateOpenaiChatCompletionTaskParamsReasoningSummary = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -58,7 +58,7 @@ def to_dict(self) -> dict[str, Any]: prompt = self.prompt - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -70,11 +70,11 @@ def to_dict(self) -> dict[str, Any]: top_p = self.top_p - reasoning_effort: Union[Unset, str] = UNSET + reasoning_effort: Unset | str = UNSET if not isinstance(self.reasoning_effort, Unset): reasoning_effort = self.reasoning_effort - reasoning_summary: Union[Unset, str] = UNSET + reasoning_summary: Unset | str = UNSET if not isinstance(self.reasoning_summary, Unset): reasoning_summary = self.reasoning_summary @@ -113,7 +113,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: prompt = d.pop("prompt") _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, CreateOpenaiChatCompletionTaskParamsTaskType] + task_type: Unset | CreateOpenaiChatCompletionTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: @@ -128,14 +128,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: top_p = d.pop("top_p", UNSET) _reasoning_effort = d.pop("reasoning_effort", UNSET) - reasoning_effort: Union[Unset, CreateOpenaiChatCompletionTaskParamsReasoningEffort] + reasoning_effort: Unset | CreateOpenaiChatCompletionTaskParamsReasoningEffort if isinstance(_reasoning_effort, Unset): reasoning_effort = UNSET else: reasoning_effort = check_create_openai_chat_completion_task_params_reasoning_effort(_reasoning_effort) _reasoning_summary = d.pop("reasoning_summary", UNSET) - reasoning_summary: Union[Unset, CreateOpenaiChatCompletionTaskParamsReasoningSummary] + reasoning_summary: Unset | CreateOpenaiChatCompletionTaskParamsReasoningSummary if isinstance(_reasoning_summary, Unset): reasoning_summary = UNSET else: diff --git a/rootly_sdk/models/create_openai_chat_completion_task_params_model.py b/rootly_sdk/models/create_openai_chat_completion_task_params_model.py index 4ed783a7..9e40d263 100644 --- a/rootly_sdk/models/create_openai_chat_completion_task_params_model.py +++ b/rootly_sdk/models/create_openai_chat_completion_task_params_model.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -18,8 +18,8 @@ class CreateOpenaiChatCompletionTaskParamsModel: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_opsgenie_alert_task_params.py b/rootly_sdk/models/create_opsgenie_alert_task_params.py index 52c552b3..fa9ee991 100644 --- a/rootly_sdk/models/create_opsgenie_alert_task_params.py +++ b/rootly_sdk/models/create_opsgenie_alert_task_params.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -41,58 +41,58 @@ class CreateOpsgenieAlertTaskParams: """ message: str - task_type: Union[Unset, CreateOpsgenieAlertTaskParamsTaskType] = UNSET - description: Union[Unset, str] = UNSET - teams: Union[Unset, list["CreateOpsgenieAlertTaskParamsTeamsItem"]] = UNSET - users: Union[Unset, list["CreateOpsgenieAlertTaskParamsUsersItem"]] = UNSET - schedules: Union[Unset, list["CreateOpsgenieAlertTaskParamsSchedulesItem"]] = UNSET - escalations: Union[Unset, list["CreateOpsgenieAlertTaskParamsEscalationsItem"]] = UNSET - priority: Union[Unset, CreateOpsgenieAlertTaskParamsPriority] = "P1" - details: Union[None, Unset, str] = UNSET + task_type: Unset | CreateOpsgenieAlertTaskParamsTaskType = UNSET + description: Unset | str = UNSET + teams: Unset | list["CreateOpsgenieAlertTaskParamsTeamsItem"] = UNSET + users: Unset | list["CreateOpsgenieAlertTaskParamsUsersItem"] = UNSET + schedules: Unset | list["CreateOpsgenieAlertTaskParamsSchedulesItem"] = UNSET + escalations: Unset | list["CreateOpsgenieAlertTaskParamsEscalationsItem"] = UNSET + priority: Unset | CreateOpsgenieAlertTaskParamsPriority = "P1" + details: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: message = self.message - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type description = self.description - teams: Union[Unset, list[dict[str, Any]]] = UNSET + teams: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.teams, Unset): teams = [] for teams_item_data in self.teams: teams_item = teams_item_data.to_dict() teams.append(teams_item) - users: Union[Unset, list[dict[str, Any]]] = UNSET + users: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.users, Unset): users = [] for users_item_data in self.users: users_item = users_item_data.to_dict() users.append(users_item) - schedules: Union[Unset, list[dict[str, Any]]] = UNSET + schedules: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.schedules, Unset): schedules = [] for schedules_item_data in self.schedules: schedules_item = schedules_item_data.to_dict() schedules.append(schedules_item) - escalations: Union[Unset, list[dict[str, Any]]] = UNSET + escalations: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.escalations, Unset): escalations = [] for escalations_item_data in self.escalations: escalations_item = escalations_item_data.to_dict() escalations.append(escalations_item) - priority: Union[Unset, str] = UNSET + priority: Unset | str = UNSET if not isinstance(self.priority, Unset): priority = self.priority - details: Union[None, Unset, str] + details: None | Unset | str if isinstance(self.details, Unset): details = UNSET else: @@ -137,7 +137,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: message = d.pop("message") _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, CreateOpsgenieAlertTaskParamsTaskType] + task_type: Unset | CreateOpsgenieAlertTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: @@ -174,18 +174,18 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: escalations.append(escalations_item) _priority = d.pop("priority", UNSET) - priority: Union[Unset, CreateOpsgenieAlertTaskParamsPriority] + priority: Unset | CreateOpsgenieAlertTaskParamsPriority if isinstance(_priority, Unset): priority = UNSET else: priority = check_create_opsgenie_alert_task_params_priority(_priority) - def _parse_details(data: object) -> Union[None, Unset, str]: + def _parse_details(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) details = _parse_details(d.pop("details", UNSET)) diff --git a/rootly_sdk/models/create_opsgenie_alert_task_params_escalations_item.py b/rootly_sdk/models/create_opsgenie_alert_task_params_escalations_item.py index 039e5b7e..23830de1 100644 --- a/rootly_sdk/models/create_opsgenie_alert_task_params_escalations_item.py +++ b/rootly_sdk/models/create_opsgenie_alert_task_params_escalations_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class CreateOpsgenieAlertTaskParamsEscalationsItem: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_opsgenie_alert_task_params_schedules_item.py b/rootly_sdk/models/create_opsgenie_alert_task_params_schedules_item.py index 1f0e7574..8e712954 100644 --- a/rootly_sdk/models/create_opsgenie_alert_task_params_schedules_item.py +++ b/rootly_sdk/models/create_opsgenie_alert_task_params_schedules_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class CreateOpsgenieAlertTaskParamsSchedulesItem: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_opsgenie_alert_task_params_teams_item.py b/rootly_sdk/models/create_opsgenie_alert_task_params_teams_item.py index f12aab5d..9da5b53b 100644 --- a/rootly_sdk/models/create_opsgenie_alert_task_params_teams_item.py +++ b/rootly_sdk/models/create_opsgenie_alert_task_params_teams_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class CreateOpsgenieAlertTaskParamsTeamsItem: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_opsgenie_alert_task_params_users_item.py b/rootly_sdk/models/create_opsgenie_alert_task_params_users_item.py index b5f34b33..f631ad3d 100644 --- a/rootly_sdk/models/create_opsgenie_alert_task_params_users_item.py +++ b/rootly_sdk/models/create_opsgenie_alert_task_params_users_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class CreateOpsgenieAlertTaskParamsUsersItem: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_outlook_event_task_params.py b/rootly_sdk/models/create_outlook_event_task_params.py index 3967e085..ff18c799 100644 --- a/rootly_sdk/models/create_outlook_event_task_params.py +++ b/rootly_sdk/models/create_outlook_event_task_params.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -45,13 +45,13 @@ class CreateOutlookEventTaskParams: meeting_duration: str summary: str description: str - task_type: Union[Unset, CreateOutlookEventTaskParamsTaskType] = UNSET - attendees: Union[Unset, list[str]] = UNSET - time_zone: Union[None, Unset, str] = UNSET - exclude_weekends: Union[Unset, bool] = UNSET - enable_online_meeting: Union[Unset, bool] = UNSET - post_to_incident_timeline: Union[Unset, bool] = UNSET - post_to_slack_channels: Union[Unset, list["CreateOutlookEventTaskParamsPostToSlackChannelsItem"]] = UNSET + task_type: Unset | CreateOutlookEventTaskParamsTaskType = UNSET + attendees: Unset | list[str] = UNSET + time_zone: None | Unset | str = UNSET + exclude_weekends: Unset | bool = UNSET + enable_online_meeting: Unset | bool = UNSET + post_to_incident_timeline: Unset | bool = UNSET + post_to_slack_channels: Unset | list["CreateOutlookEventTaskParamsPostToSlackChannelsItem"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -67,15 +67,15 @@ def to_dict(self) -> dict[str, Any]: description = self.description - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - attendees: Union[Unset, list[str]] = UNSET + attendees: Unset | list[str] = UNSET if not isinstance(self.attendees, Unset): attendees = self.attendees - time_zone: Union[None, Unset, str] + time_zone: None | Unset | str if isinstance(self.time_zone, Unset): time_zone = UNSET else: @@ -87,7 +87,7 @@ def to_dict(self) -> dict[str, Any]: post_to_incident_timeline = self.post_to_incident_timeline - post_to_slack_channels: Union[Unset, list[dict[str, Any]]] = UNSET + post_to_slack_channels: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.post_to_slack_channels, Unset): post_to_slack_channels = [] for post_to_slack_channels_item_data in self.post_to_slack_channels: @@ -144,7 +144,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: description = d.pop("description") _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, CreateOutlookEventTaskParamsTaskType] + task_type: Unset | CreateOutlookEventTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: @@ -152,12 +152,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attendees = cast(list[str], d.pop("attendees", UNSET)) - def _parse_time_zone(data: object) -> Union[None, Unset, str]: + def _parse_time_zone(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) time_zone = _parse_time_zone(d.pop("time_zone", UNSET)) diff --git a/rootly_sdk/models/create_outlook_event_task_params_calendar.py b/rootly_sdk/models/create_outlook_event_task_params_calendar.py index 84144b9f..5f79c9ee 100644 --- a/rootly_sdk/models/create_outlook_event_task_params_calendar.py +++ b/rootly_sdk/models/create_outlook_event_task_params_calendar.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class CreateOutlookEventTaskParamsCalendar: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_outlook_event_task_params_post_to_slack_channels_item.py b/rootly_sdk/models/create_outlook_event_task_params_post_to_slack_channels_item.py index a539cdc3..2349ee5e 100644 --- a/rootly_sdk/models/create_outlook_event_task_params_post_to_slack_channels_item.py +++ b/rootly_sdk/models/create_outlook_event_task_params_post_to_slack_channels_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class CreateOutlookEventTaskParamsPostToSlackChannelsItem: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_pagerduty_status_update_task_params.py b/rootly_sdk/models/create_pagerduty_status_update_task_params.py index f4ec2669..f836a566 100644 --- a/rootly_sdk/models/create_pagerduty_status_update_task_params.py +++ b/rootly_sdk/models/create_pagerduty_status_update_task_params.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -24,7 +24,7 @@ class CreatePagerdutyStatusUpdateTaskParams: pagerduty_incident_id: str message: str - task_type: Union[Unset, CreatePagerdutyStatusUpdateTaskParamsTaskType] = UNSET + task_type: Unset | CreatePagerdutyStatusUpdateTaskParamsTaskType = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -32,7 +32,7 @@ def to_dict(self) -> dict[str, Any]: message = self.message - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -57,7 +57,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: message = d.pop("message") _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, CreatePagerdutyStatusUpdateTaskParamsTaskType] + task_type: Unset | CreatePagerdutyStatusUpdateTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/create_pagertree_alert_task_params.py b/rootly_sdk/models/create_pagertree_alert_task_params.py index 32595c67..78a31a09 100644 --- a/rootly_sdk/models/create_pagertree_alert_task_params.py +++ b/rootly_sdk/models/create_pagertree_alert_task_params.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -40,18 +40,18 @@ class CreatePagertreeAlertTaskParams: incident (Union[Unset, bool]): Setting to true makes an alert a Pagertree incident """ - task_type: Union[Unset, CreatePagertreeAlertTaskParamsTaskType] = UNSET - title: Union[Unset, str] = UNSET - description: Union[Unset, str] = UNSET - urgency: Union[Unset, CreatePagertreeAlertTaskParamsUrgency] = UNSET - severity: Union[Unset, CreatePagertreeAlertTaskParamsSeverity] = UNSET - teams: Union[Unset, list["CreatePagertreeAlertTaskParamsTeamsItem"]] = UNSET - users: Union[Unset, list["CreatePagertreeAlertTaskParamsUsersItem"]] = UNSET - incident: Union[Unset, bool] = UNSET + task_type: Unset | CreatePagertreeAlertTaskParamsTaskType = UNSET + title: Unset | str = UNSET + description: Unset | str = UNSET + urgency: Unset | CreatePagertreeAlertTaskParamsUrgency = UNSET + severity: Unset | CreatePagertreeAlertTaskParamsSeverity = UNSET + teams: Unset | list["CreatePagertreeAlertTaskParamsTeamsItem"] = UNSET + users: Unset | list["CreatePagertreeAlertTaskParamsUsersItem"] = UNSET + incident: Unset | bool = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -59,22 +59,22 @@ def to_dict(self) -> dict[str, Any]: description = self.description - urgency: Union[Unset, str] = UNSET + urgency: Unset | str = UNSET if not isinstance(self.urgency, Unset): urgency = self.urgency - severity: Union[Unset, str] = UNSET + severity: Unset | str = UNSET if not isinstance(self.severity, Unset): severity = self.severity - teams: Union[Unset, list[dict[str, Any]]] = UNSET + teams: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.teams, Unset): teams = [] for teams_item_data in self.teams: teams_item = teams_item_data.to_dict() teams.append(teams_item) - users: Union[Unset, list[dict[str, Any]]] = UNSET + users: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.users, Unset): users = [] for users_item_data in self.users: @@ -112,7 +112,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, CreatePagertreeAlertTaskParamsTaskType] + task_type: Unset | CreatePagertreeAlertTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: @@ -123,14 +123,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: description = d.pop("description", UNSET) _urgency = d.pop("urgency", UNSET) - urgency: Union[Unset, CreatePagertreeAlertTaskParamsUrgency] + urgency: Unset | CreatePagertreeAlertTaskParamsUrgency if isinstance(_urgency, Unset): urgency = UNSET else: urgency = check_create_pagertree_alert_task_params_urgency(_urgency) _severity = d.pop("severity", UNSET) - severity: Union[Unset, CreatePagertreeAlertTaskParamsSeverity] + severity: Unset | CreatePagertreeAlertTaskParamsSeverity if isinstance(_severity, Unset): severity = UNSET else: diff --git a/rootly_sdk/models/create_pagertree_alert_task_params_teams_item.py b/rootly_sdk/models/create_pagertree_alert_task_params_teams_item.py index 3189b6cd..b863b3bb 100644 --- a/rootly_sdk/models/create_pagertree_alert_task_params_teams_item.py +++ b/rootly_sdk/models/create_pagertree_alert_task_params_teams_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class CreatePagertreeAlertTaskParamsTeamsItem: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_pagertree_alert_task_params_users_item.py b/rootly_sdk/models/create_pagertree_alert_task_params_users_item.py index 7c7a2f1b..2855febc 100644 --- a/rootly_sdk/models/create_pagertree_alert_task_params_users_item.py +++ b/rootly_sdk/models/create_pagertree_alert_task_params_users_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class CreatePagertreeAlertTaskParamsUsersItem: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_quip_page_task_params.py b/rootly_sdk/models/create_quip_page_task_params.py index 29637d36..619a1f99 100644 --- a/rootly_sdk/models/create_quip_page_task_params.py +++ b/rootly_sdk/models/create_quip_page_task_params.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -27,18 +27,18 @@ class CreateQuipPageTaskParams: """ title: str - task_type: Union[Unset, CreateQuipPageTaskParamsTaskType] = UNSET - post_mortem_template_id: Union[Unset, str] = UNSET - parent_folder_id: Union[Unset, str] = UNSET - content: Union[Unset, str] = UNSET - template_id: Union[Unset, str] = UNSET - mark_post_mortem_as_published: Union[Unset, bool] = True + task_type: Unset | CreateQuipPageTaskParamsTaskType = UNSET + post_mortem_template_id: Unset | str = UNSET + parent_folder_id: Unset | str = UNSET + content: Unset | str = UNSET + template_id: Unset | str = UNSET + mark_post_mortem_as_published: Unset | bool = True additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: title = self.title - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -80,7 +80,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: title = d.pop("title") _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, CreateQuipPageTaskParamsTaskType] + task_type: Unset | CreateQuipPageTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/create_service_now_incident_task_params.py b/rootly_sdk/models/create_service_now_incident_task_params.py index 883e4058..14cdd261 100644 --- a/rootly_sdk/models/create_service_now_incident_task_params.py +++ b/rootly_sdk/models/create_service_now_incident_task_params.py @@ -32,31 +32,31 @@ class CreateServiceNowIncidentTaskParams: """ title: str - task_type: Union[Unset, CreateServiceNowIncidentTaskParamsTaskType] = UNSET - description: Union[Unset, str] = UNSET + task_type: Unset | CreateServiceNowIncidentTaskParamsTaskType = UNSET + description: Unset | str = UNSET priority: Union[Unset, "CreateServiceNowIncidentTaskParamsPriority"] = UNSET completion: Union[Unset, "CreateServiceNowIncidentTaskParamsCompletion"] = UNSET - custom_fields_mapping: Union[None, Unset, str] = UNSET + custom_fields_mapping: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: title = self.title - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type description = self.description - priority: Union[Unset, dict[str, Any]] = UNSET + priority: Unset | dict[str, Any] = UNSET if not isinstance(self.priority, Unset): priority = self.priority.to_dict() - completion: Union[Unset, dict[str, Any]] = UNSET + completion: Unset | dict[str, Any] = UNSET if not isinstance(self.completion, Unset): completion = self.completion.to_dict() - custom_fields_mapping: Union[None, Unset, str] + custom_fields_mapping: None | Unset | str if isinstance(self.custom_fields_mapping, Unset): custom_fields_mapping = UNSET else: @@ -93,7 +93,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: title = d.pop("title") _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, CreateServiceNowIncidentTaskParamsTaskType] + task_type: Unset | CreateServiceNowIncidentTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: @@ -102,25 +102,25 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: description = d.pop("description", UNSET) _priority = d.pop("priority", UNSET) - priority: Union[Unset, CreateServiceNowIncidentTaskParamsPriority] + priority: Unset | CreateServiceNowIncidentTaskParamsPriority if isinstance(_priority, Unset): priority = UNSET else: priority = CreateServiceNowIncidentTaskParamsPriority.from_dict(_priority) _completion = d.pop("completion", UNSET) - completion: Union[Unset, CreateServiceNowIncidentTaskParamsCompletion] + completion: Unset | CreateServiceNowIncidentTaskParamsCompletion if isinstance(_completion, Unset): completion = UNSET else: completion = CreateServiceNowIncidentTaskParamsCompletion.from_dict(_completion) - def _parse_custom_fields_mapping(data: object) -> Union[None, Unset, str]: + def _parse_custom_fields_mapping(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) custom_fields_mapping = _parse_custom_fields_mapping(d.pop("custom_fields_mapping", UNSET)) diff --git a/rootly_sdk/models/create_service_now_incident_task_params_completion.py b/rootly_sdk/models/create_service_now_incident_task_params_completion.py index 428f06c1..ec01454d 100644 --- a/rootly_sdk/models/create_service_now_incident_task_params_completion.py +++ b/rootly_sdk/models/create_service_now_incident_task_params_completion.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -18,8 +18,8 @@ class CreateServiceNowIncidentTaskParamsCompletion: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_service_now_incident_task_params_priority.py b/rootly_sdk/models/create_service_now_incident_task_params_priority.py index ec2ef5ab..b1d196e4 100644 --- a/rootly_sdk/models/create_service_now_incident_task_params_priority.py +++ b/rootly_sdk/models/create_service_now_incident_task_params_priority.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -18,8 +18,8 @@ class CreateServiceNowIncidentTaskParamsPriority: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_sharepoint_page_task_params.py b/rootly_sdk/models/create_sharepoint_page_task_params.py index 2bac4432..b75eb1f2 100644 --- a/rootly_sdk/models/create_sharepoint_page_task_params.py +++ b/rootly_sdk/models/create_sharepoint_page_task_params.py @@ -37,12 +37,12 @@ class CreateSharepointPageTaskParams: title: str site: "CreateSharepointPageTaskParamsSite" drive: "CreateSharepointPageTaskParamsDrive" - task_type: Union[Unset, CreateSharepointPageTaskParamsTaskType] = UNSET - post_mortem_template_id: Union[Unset, str] = UNSET - mark_post_mortem_as_published: Union[Unset, bool] = True + task_type: Unset | CreateSharepointPageTaskParamsTaskType = UNSET + post_mortem_template_id: Unset | str = UNSET + mark_post_mortem_as_published: Unset | bool = True parent_folder: Union[Unset, "CreateSharepointPageTaskParamsParentFolder"] = UNSET - content: Union[Unset, str] = UNSET - template_id: Union[Unset, str] = UNSET + content: Unset | str = UNSET + template_id: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -52,7 +52,7 @@ def to_dict(self) -> dict[str, Any]: drive = self.drive.to_dict() - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -60,7 +60,7 @@ def to_dict(self) -> dict[str, Any]: mark_post_mortem_as_published = self.mark_post_mortem_as_published - parent_folder: Union[Unset, dict[str, Any]] = UNSET + parent_folder: Unset | dict[str, Any] = UNSET if not isinstance(self.parent_folder, Unset): parent_folder = self.parent_folder.to_dict() @@ -106,7 +106,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: drive = CreateSharepointPageTaskParamsDrive.from_dict(d.pop("drive")) _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, CreateSharepointPageTaskParamsTaskType] + task_type: Unset | CreateSharepointPageTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: @@ -117,7 +117,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: mark_post_mortem_as_published = d.pop("mark_post_mortem_as_published", UNSET) _parent_folder = d.pop("parent_folder", UNSET) - parent_folder: Union[Unset, CreateSharepointPageTaskParamsParentFolder] + parent_folder: Unset | CreateSharepointPageTaskParamsParentFolder if isinstance(_parent_folder, Unset): parent_folder = UNSET else: diff --git a/rootly_sdk/models/create_sharepoint_page_task_params_drive.py b/rootly_sdk/models/create_sharepoint_page_task_params_drive.py index 7bb221d5..eb8f611c 100644 --- a/rootly_sdk/models/create_sharepoint_page_task_params_drive.py +++ b/rootly_sdk/models/create_sharepoint_page_task_params_drive.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class CreateSharepointPageTaskParamsDrive: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_sharepoint_page_task_params_parent_folder.py b/rootly_sdk/models/create_sharepoint_page_task_params_parent_folder.py index 37a5e992..8bf706ee 100644 --- a/rootly_sdk/models/create_sharepoint_page_task_params_parent_folder.py +++ b/rootly_sdk/models/create_sharepoint_page_task_params_parent_folder.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class CreateSharepointPageTaskParamsParentFolder: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_sharepoint_page_task_params_site.py b/rootly_sdk/models/create_sharepoint_page_task_params_site.py index 7c12c695..10269545 100644 --- a/rootly_sdk/models/create_sharepoint_page_task_params_site.py +++ b/rootly_sdk/models/create_sharepoint_page_task_params_site.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class CreateSharepointPageTaskParamsSite: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_shortcut_story_task_params_type_0_project.py b/rootly_sdk/models/create_shortcut_story_task_params_type_0_project.py index d93e7f41..b27655da 100644 --- a/rootly_sdk/models/create_shortcut_story_task_params_type_0_project.py +++ b/rootly_sdk/models/create_shortcut_story_task_params_type_0_project.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class CreateShortcutStoryTaskParamsType0Project: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_shortcut_story_task_params_type_1_workflow_state.py b/rootly_sdk/models/create_shortcut_story_task_params_type_1_workflow_state.py index 595d71a9..ee086426 100644 --- a/rootly_sdk/models/create_shortcut_story_task_params_type_1_workflow_state.py +++ b/rootly_sdk/models/create_shortcut_story_task_params_type_1_workflow_state.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class CreateShortcutStoryTaskParamsType1WorkflowState: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_shortcut_task_task_params.py b/rootly_sdk/models/create_shortcut_task_task_params.py index 43779b59..13958785 100644 --- a/rootly_sdk/models/create_shortcut_task_task_params.py +++ b/rootly_sdk/models/create_shortcut_task_task_params.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -30,7 +30,7 @@ class CreateShortcutTaskTaskParams: parent_story_id: str description: str completion: "CreateShortcutTaskTaskParamsCompletion" - task_type: Union[Unset, CreateShortcutTaskTaskParamsTaskType] = UNSET + task_type: Unset | CreateShortcutTaskTaskParamsTaskType = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -40,7 +40,7 @@ def to_dict(self) -> dict[str, Any]: completion = self.completion.to_dict() - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -70,7 +70,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: completion = CreateShortcutTaskTaskParamsCompletion.from_dict(d.pop("completion")) _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, CreateShortcutTaskTaskParamsTaskType] + task_type: Unset | CreateShortcutTaskTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/create_shortcut_task_task_params_completion.py b/rootly_sdk/models/create_shortcut_task_task_params_completion.py index 806ecc67..be24cd42 100644 --- a/rootly_sdk/models/create_shortcut_task_task_params_completion.py +++ b/rootly_sdk/models/create_shortcut_task_task_params_completion.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -18,8 +18,8 @@ class CreateShortcutTaskTaskParamsCompletion: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_slack_channel_task_params.py b/rootly_sdk/models/create_slack_channel_task_params.py index 580266f5..18954329 100644 --- a/rootly_sdk/models/create_slack_channel_task_params.py +++ b/rootly_sdk/models/create_slack_channel_task_params.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -33,8 +33,8 @@ class CreateSlackChannelTaskParams: workspace: "CreateSlackChannelTaskParamsWorkspace" title: str - task_type: Union[Unset, CreateSlackChannelTaskParamsTaskType] = UNSET - private: Union[Unset, CreateSlackChannelTaskParamsPrivate] = "auto" + task_type: Unset | CreateSlackChannelTaskParamsTaskType = UNSET + private: Unset | CreateSlackChannelTaskParamsPrivate = "auto" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,11 +42,11 @@ def to_dict(self) -> dict[str, Any]: title = self.title - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - private: Union[Unset, str] = UNSET + private: Unset | str = UNSET if not isinstance(self.private, Unset): private = self.private @@ -75,14 +75,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: title = d.pop("title") _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, CreateSlackChannelTaskParamsTaskType] + task_type: Unset | CreateSlackChannelTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: task_type = check_create_slack_channel_task_params_task_type(_task_type) _private = d.pop("private", UNSET) - private: Union[Unset, CreateSlackChannelTaskParamsPrivate] + private: Unset | CreateSlackChannelTaskParamsPrivate if isinstance(_private, Unset): private = UNSET else: diff --git a/rootly_sdk/models/create_slack_channel_task_params_workspace.py b/rootly_sdk/models/create_slack_channel_task_params_workspace.py index 7c2b77b9..c2f64805 100644 --- a/rootly_sdk/models/create_slack_channel_task_params_workspace.py +++ b/rootly_sdk/models/create_slack_channel_task_params_workspace.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class CreateSlackChannelTaskParamsWorkspace: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_sub_incident_task_params.py b/rootly_sdk/models/create_sub_incident_task_params.py index 134914ca..4a0a9236 100644 --- a/rootly_sdk/models/create_sub_incident_task_params.py +++ b/rootly_sdk/models/create_sub_incident_task_params.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,14 +23,14 @@ class CreateSubIncidentTaskParams: """ title: str - task_type: Union[Unset, CreateSubIncidentTaskParamsTaskType] = UNSET - summary: Union[Unset, str] = UNSET + task_type: Unset | CreateSubIncidentTaskParamsTaskType = UNSET + summary: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: title = self.title - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -56,7 +56,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: title = d.pop("title") _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, CreateSubIncidentTaskParamsTaskType] + task_type: Unset | CreateSubIncidentTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/create_trello_card_task_params.py b/rootly_sdk/models/create_trello_card_task_params.py index 35c65013..af6370a8 100644 --- a/rootly_sdk/models/create_trello_card_task_params.py +++ b/rootly_sdk/models/create_trello_card_task_params.py @@ -37,10 +37,10 @@ class CreateTrelloCardTaskParams: title: str board: "CreateTrelloCardTaskParamsBoard" list_: "CreateTrelloCardTaskParamsList" - task_type: Union[Unset, CreateTrelloCardTaskParamsTaskType] = UNSET - description: Union[Unset, str] = UNSET - due_date: Union[Unset, str] = UNSET - labels: Union[Unset, list["CreateTrelloCardTaskParamsLabelsItem"]] = UNSET + task_type: Unset | CreateTrelloCardTaskParamsTaskType = UNSET + description: Unset | str = UNSET + due_date: Unset | str = UNSET + labels: Unset | list["CreateTrelloCardTaskParamsLabelsItem"] = UNSET archivation: Union[Unset, "CreateTrelloCardTaskParamsArchivation"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -51,7 +51,7 @@ def to_dict(self) -> dict[str, Any]: list_ = self.list_.to_dict() - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -59,14 +59,14 @@ def to_dict(self) -> dict[str, Any]: due_date = self.due_date - labels: Union[Unset, list[dict[str, Any]]] = UNSET + labels: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.labels, Unset): labels = [] for labels_item_data in self.labels: labels_item = labels_item_data.to_dict() labels.append(labels_item) - archivation: Union[Unset, dict[str, Any]] = UNSET + archivation: Unset | dict[str, Any] = UNSET if not isinstance(self.archivation, Unset): archivation = self.archivation.to_dict() @@ -107,7 +107,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: list_ = CreateTrelloCardTaskParamsList.from_dict(d.pop("list")) _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, CreateTrelloCardTaskParamsTaskType] + task_type: Unset | CreateTrelloCardTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: @@ -125,7 +125,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: labels.append(labels_item) _archivation = d.pop("archivation", UNSET) - archivation: Union[Unset, CreateTrelloCardTaskParamsArchivation] + archivation: Unset | CreateTrelloCardTaskParamsArchivation if isinstance(_archivation, Unset): archivation = UNSET else: diff --git a/rootly_sdk/models/create_trello_card_task_params_archivation.py b/rootly_sdk/models/create_trello_card_task_params_archivation.py index b432154f..34647fb8 100644 --- a/rootly_sdk/models/create_trello_card_task_params_archivation.py +++ b/rootly_sdk/models/create_trello_card_task_params_archivation.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -18,8 +18,8 @@ class CreateTrelloCardTaskParamsArchivation: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_trello_card_task_params_board.py b/rootly_sdk/models/create_trello_card_task_params_board.py index 2b2855d3..792a44b2 100644 --- a/rootly_sdk/models/create_trello_card_task_params_board.py +++ b/rootly_sdk/models/create_trello_card_task_params_board.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -18,8 +18,8 @@ class CreateTrelloCardTaskParamsBoard: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_trello_card_task_params_labels_item.py b/rootly_sdk/models/create_trello_card_task_params_labels_item.py index 4ec632a9..75cb16c4 100644 --- a/rootly_sdk/models/create_trello_card_task_params_labels_item.py +++ b/rootly_sdk/models/create_trello_card_task_params_labels_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class CreateTrelloCardTaskParamsLabelsItem: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_trello_card_task_params_list.py b/rootly_sdk/models/create_trello_card_task_params_list.py index 0d1e2083..7c2b9197 100644 --- a/rootly_sdk/models/create_trello_card_task_params_list.py +++ b/rootly_sdk/models/create_trello_card_task_params_list.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -18,8 +18,8 @@ class CreateTrelloCardTaskParamsList: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_watsonx_chat_completion_task_params.py b/rootly_sdk/models/create_watsonx_chat_completion_task_params.py index 5d22b575..ecf53077 100644 --- a/rootly_sdk/models/create_watsonx_chat_completion_task_params.py +++ b/rootly_sdk/models/create_watsonx_chat_completion_task_params.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -31,8 +31,8 @@ class CreateWatsonxChatCompletionTaskParams: model: "CreateWatsonxChatCompletionTaskParamsModel" prompt: str project_id: str - task_type: Union[Unset, CreateWatsonxChatCompletionTaskParamsTaskType] = UNSET - system_prompt: Union[Unset, str] = UNSET + task_type: Unset | CreateWatsonxChatCompletionTaskParamsTaskType = UNSET + system_prompt: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: project_id = self.project_id - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -76,7 +76,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: project_id = d.pop("project_id") _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, CreateWatsonxChatCompletionTaskParamsTaskType] + task_type: Unset | CreateWatsonxChatCompletionTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/create_watsonx_chat_completion_task_params_model.py b/rootly_sdk/models/create_watsonx_chat_completion_task_params_model.py index 63f60c8d..1a1b5d64 100644 --- a/rootly_sdk/models/create_watsonx_chat_completion_task_params_model.py +++ b/rootly_sdk/models/create_watsonx_chat_completion_task_params_model.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -18,8 +18,8 @@ class CreateWatsonxChatCompletionTaskParamsModel: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_webex_meeting_task_params.py b/rootly_sdk/models/create_webex_meeting_task_params.py index 7ee581d4..895ac35f 100644 --- a/rootly_sdk/models/create_webex_meeting_task_params.py +++ b/rootly_sdk/models/create_webex_meeting_task_params.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -39,18 +39,18 @@ class CreateWebexMeetingTaskParams: """ topic: str - task_type: Union[Unset, CreateWebexMeetingTaskParamsTaskType] = UNSET - password: Union[Unset, str] = UNSET - record_meeting: Union[Unset, bool] = UNSET - recording_mode: Union[Unset, CreateWebexMeetingTaskParamsRecordingMode] = UNSET - post_to_incident_timeline: Union[Unset, bool] = UNSET - post_to_slack_channels: Union[Unset, list["CreateWebexMeetingTaskParamsPostToSlackChannelsItem"]] = UNSET + task_type: Unset | CreateWebexMeetingTaskParamsTaskType = UNSET + password: Unset | str = UNSET + record_meeting: Unset | bool = UNSET + recording_mode: Unset | CreateWebexMeetingTaskParamsRecordingMode = UNSET + post_to_incident_timeline: Unset | bool = UNSET + post_to_slack_channels: Unset | list["CreateWebexMeetingTaskParamsPostToSlackChannelsItem"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: topic = self.topic - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -58,13 +58,13 @@ def to_dict(self) -> dict[str, Any]: record_meeting = self.record_meeting - recording_mode: Union[Unset, str] = UNSET + recording_mode: Unset | str = UNSET if not isinstance(self.recording_mode, Unset): recording_mode = self.recording_mode post_to_incident_timeline = self.post_to_incident_timeline - post_to_slack_channels: Union[Unset, list[dict[str, Any]]] = UNSET + post_to_slack_channels: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.post_to_slack_channels, Unset): post_to_slack_channels = [] for post_to_slack_channels_item_data in self.post_to_slack_channels: @@ -103,7 +103,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: topic = d.pop("topic") _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, CreateWebexMeetingTaskParamsTaskType] + task_type: Unset | CreateWebexMeetingTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: @@ -114,7 +114,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: record_meeting = d.pop("record_meeting", UNSET) _recording_mode = d.pop("recording_mode", UNSET) - recording_mode: Union[Unset, CreateWebexMeetingTaskParamsRecordingMode] + recording_mode: Unset | CreateWebexMeetingTaskParamsRecordingMode if isinstance(_recording_mode, Unset): recording_mode = UNSET else: diff --git a/rootly_sdk/models/create_webex_meeting_task_params_post_to_slack_channels_item.py b/rootly_sdk/models/create_webex_meeting_task_params_post_to_slack_channels_item.py index e96647db..8ed5a6db 100644 --- a/rootly_sdk/models/create_webex_meeting_task_params_post_to_slack_channels_item.py +++ b/rootly_sdk/models/create_webex_meeting_task_params_post_to_slack_channels_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class CreateWebexMeetingTaskParamsPostToSlackChannelsItem: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_zendesk_jira_link_task_params.py b/rootly_sdk/models/create_zendesk_jira_link_task_params.py index 7df7dbae..26ac50a0 100644 --- a/rootly_sdk/models/create_zendesk_jira_link_task_params.py +++ b/rootly_sdk/models/create_zendesk_jira_link_task_params.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -26,7 +26,7 @@ class CreateZendeskJiraLinkTaskParams: jira_issue_id: str jira_issue_key: str zendesk_ticket_id: str - task_type: Union[Unset, CreateZendeskJiraLinkTaskParamsTaskType] = UNSET + task_type: Unset | CreateZendeskJiraLinkTaskParamsTaskType = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -36,7 +36,7 @@ def to_dict(self) -> dict[str, Any]: zendesk_ticket_id = self.zendesk_ticket_id - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -64,7 +64,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: zendesk_ticket_id = d.pop("zendesk_ticket_id") _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, CreateZendeskJiraLinkTaskParamsTaskType] + task_type: Unset | CreateZendeskJiraLinkTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/create_zendesk_ticket_task_params.py b/rootly_sdk/models/create_zendesk_ticket_task_params.py index c452b886..8e5038ed 100644 --- a/rootly_sdk/models/create_zendesk_ticket_task_params.py +++ b/rootly_sdk/models/create_zendesk_ticket_task_params.py @@ -41,13 +41,13 @@ class CreateZendeskTicketTaskParams: kind: CreateZendeskTicketTaskParamsKind subject: str - task_type: Union[Unset, CreateZendeskTicketTaskParamsTaskType] = UNSET - comment: Union[Unset, str] = UNSET - tags: Union[Unset, str] = UNSET + task_type: Unset | CreateZendeskTicketTaskParamsTaskType = UNSET + comment: Unset | str = UNSET + tags: Unset | str = UNSET priority: Union[Unset, "CreateZendeskTicketTaskParamsPriority"] = UNSET completion: Union[Unset, "CreateZendeskTicketTaskParamsCompletion"] = UNSET - custom_fields_mapping: Union[None, Unset, str] = UNSET - ticket_payload: Union[None, Unset, str] = UNSET + custom_fields_mapping: None | Unset | str = UNSET + ticket_payload: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -55,7 +55,7 @@ def to_dict(self) -> dict[str, Any]: subject = self.subject - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -63,21 +63,21 @@ def to_dict(self) -> dict[str, Any]: tags = self.tags - priority: Union[Unset, dict[str, Any]] = UNSET + priority: Unset | dict[str, Any] = UNSET if not isinstance(self.priority, Unset): priority = self.priority.to_dict() - completion: Union[Unset, dict[str, Any]] = UNSET + completion: Unset | dict[str, Any] = UNSET if not isinstance(self.completion, Unset): completion = self.completion.to_dict() - custom_fields_mapping: Union[None, Unset, str] + custom_fields_mapping: None | Unset | str if isinstance(self.custom_fields_mapping, Unset): custom_fields_mapping = UNSET else: custom_fields_mapping = self.custom_fields_mapping - ticket_payload: Union[None, Unset, str] + ticket_payload: None | Unset | str if isinstance(self.ticket_payload, Unset): ticket_payload = UNSET else: @@ -119,7 +119,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: subject = d.pop("subject") _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, CreateZendeskTicketTaskParamsTaskType] + task_type: Unset | CreateZendeskTicketTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: @@ -130,34 +130,34 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: tags = d.pop("tags", UNSET) _priority = d.pop("priority", UNSET) - priority: Union[Unset, CreateZendeskTicketTaskParamsPriority] + priority: Unset | CreateZendeskTicketTaskParamsPriority if isinstance(_priority, Unset): priority = UNSET else: priority = CreateZendeskTicketTaskParamsPriority.from_dict(_priority) _completion = d.pop("completion", UNSET) - completion: Union[Unset, CreateZendeskTicketTaskParamsCompletion] + completion: Unset | CreateZendeskTicketTaskParamsCompletion if isinstance(_completion, Unset): completion = UNSET else: completion = CreateZendeskTicketTaskParamsCompletion.from_dict(_completion) - def _parse_custom_fields_mapping(data: object) -> Union[None, Unset, str]: + def _parse_custom_fields_mapping(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) custom_fields_mapping = _parse_custom_fields_mapping(d.pop("custom_fields_mapping", UNSET)) - def _parse_ticket_payload(data: object) -> Union[None, Unset, str]: + def _parse_ticket_payload(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) ticket_payload = _parse_ticket_payload(d.pop("ticket_payload", UNSET)) diff --git a/rootly_sdk/models/create_zendesk_ticket_task_params_completion.py b/rootly_sdk/models/create_zendesk_ticket_task_params_completion.py index ee0dad0a..e6192bfd 100644 --- a/rootly_sdk/models/create_zendesk_ticket_task_params_completion.py +++ b/rootly_sdk/models/create_zendesk_ticket_task_params_completion.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -18,8 +18,8 @@ class CreateZendeskTicketTaskParamsCompletion: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_zendesk_ticket_task_params_priority.py b/rootly_sdk/models/create_zendesk_ticket_task_params_priority.py index 93013f35..eaeb09b3 100644 --- a/rootly_sdk/models/create_zendesk_ticket_task_params_priority.py +++ b/rootly_sdk/models/create_zendesk_ticket_task_params_priority.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -18,8 +18,8 @@ class CreateZendeskTicketTaskParamsPriority: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/create_zoom_meeting_task_params.py b/rootly_sdk/models/create_zoom_meeting_task_params.py index 90a36924..9aa314b4 100644 --- a/rootly_sdk/models/create_zoom_meeting_task_params.py +++ b/rootly_sdk/models/create_zoom_meeting_task_params.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -48,22 +48,22 @@ class CreateZoomMeetingTaskParams: """ topic: str - task_type: Union[Unset, CreateZoomMeetingTaskParamsTaskType] = UNSET - password: Union[Unset, str] = UNSET - create_as_email: Union[Unset, str] = UNSET - alternative_hosts: Union[Unset, list[str]] = UNSET - auto_recording: Union[Unset, CreateZoomMeetingTaskParamsAutoRecording] = "none" - record_meeting: Union[Unset, bool] = UNSET - recording_mode: Union[Unset, CreateZoomMeetingTaskParamsRecordingMode] = UNSET - enable_zoom_bot_auto_join: Union[Unset, bool] = UNSET - post_to_incident_timeline: Union[Unset, bool] = UNSET - post_to_slack_channels: Union[Unset, list["CreateZoomMeetingTaskParamsPostToSlackChannelsItem"]] = UNSET + task_type: Unset | CreateZoomMeetingTaskParamsTaskType = UNSET + password: Unset | str = UNSET + create_as_email: Unset | str = UNSET + alternative_hosts: Unset | list[str] = UNSET + auto_recording: Unset | CreateZoomMeetingTaskParamsAutoRecording = "none" + record_meeting: Unset | bool = UNSET + recording_mode: Unset | CreateZoomMeetingTaskParamsRecordingMode = UNSET + enable_zoom_bot_auto_join: Unset | bool = UNSET + post_to_incident_timeline: Unset | bool = UNSET + post_to_slack_channels: Unset | list["CreateZoomMeetingTaskParamsPostToSlackChannelsItem"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: topic = self.topic - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -71,17 +71,17 @@ def to_dict(self) -> dict[str, Any]: create_as_email = self.create_as_email - alternative_hosts: Union[Unset, list[str]] = UNSET + alternative_hosts: Unset | list[str] = UNSET if not isinstance(self.alternative_hosts, Unset): alternative_hosts = self.alternative_hosts - auto_recording: Union[Unset, str] = UNSET + auto_recording: Unset | str = UNSET if not isinstance(self.auto_recording, Unset): auto_recording = self.auto_recording record_meeting = self.record_meeting - recording_mode: Union[Unset, str] = UNSET + recording_mode: Unset | str = UNSET if not isinstance(self.recording_mode, Unset): recording_mode = self.recording_mode @@ -89,7 +89,7 @@ def to_dict(self) -> dict[str, Any]: post_to_incident_timeline = self.post_to_incident_timeline - post_to_slack_channels: Union[Unset, list[dict[str, Any]]] = UNSET + post_to_slack_channels: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.post_to_slack_channels, Unset): post_to_slack_channels = [] for post_to_slack_channels_item_data in self.post_to_slack_channels: @@ -136,7 +136,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: topic = d.pop("topic") _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, CreateZoomMeetingTaskParamsTaskType] + task_type: Unset | CreateZoomMeetingTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: @@ -149,7 +149,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: alternative_hosts = cast(list[str], d.pop("alternative_hosts", UNSET)) _auto_recording = d.pop("auto_recording", UNSET) - auto_recording: Union[Unset, CreateZoomMeetingTaskParamsAutoRecording] + auto_recording: Unset | CreateZoomMeetingTaskParamsAutoRecording if isinstance(_auto_recording, Unset): auto_recording = UNSET else: @@ -158,7 +158,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: record_meeting = d.pop("record_meeting", UNSET) _recording_mode = d.pop("recording_mode", UNSET) - recording_mode: Union[Unset, CreateZoomMeetingTaskParamsRecordingMode] + recording_mode: Unset | CreateZoomMeetingTaskParamsRecordingMode if isinstance(_recording_mode, Unset): recording_mode = UNSET else: diff --git a/rootly_sdk/models/create_zoom_meeting_task_params_post_to_slack_channels_item.py b/rootly_sdk/models/create_zoom_meeting_task_params_post_to_slack_channels_item.py index c9c207da..e468c08c 100644 --- a/rootly_sdk/models/create_zoom_meeting_task_params_post_to_slack_channels_item.py +++ b/rootly_sdk/models/create_zoom_meeting_task_params_post_to_slack_channels_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class CreateZoomMeetingTaskParamsPostToSlackChannelsItem: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/custom_field.py b/rootly_sdk/models/custom_field.py index 540808c2..3396bd0b 100644 --- a/rootly_sdk/models/custom_field.py +++ b/rootly_sdk/models/custom_field.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -35,16 +35,16 @@ class CustomField: label: str shown: list[CustomFieldShownItem] - required: Union[None, list[CustomFieldRequiredType0Item]] + required: None | list[CustomFieldRequiredType0Item] position: int created_at: str updated_at: str - kind: Union[Unset, str] = UNSET - enabled: Union[Unset, bool] = UNSET - slug: Union[Unset, str] = UNSET - resource_type: Union[Unset, CustomFieldResourceType] = UNSET - description: Union[None, Unset, str] = UNSET - default: Union[None, Unset, str] = UNSET + kind: Unset | str = UNSET + enabled: Unset | bool = UNSET + slug: Unset | str = UNSET + resource_type: Unset | CustomFieldResourceType = UNSET + description: None | Unset | str = UNSET + default: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -55,7 +55,7 @@ def to_dict(self) -> dict[str, Any]: shown_item: str = shown_item_data shown.append(shown_item) - required: Union[None, list[str]] + required: None | list[str] if isinstance(self.required, list): required = [] for required_type_0_item_data in self.required: @@ -77,17 +77,17 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - resource_type: Union[Unset, str] = UNSET + resource_type: Unset | str = UNSET if not isinstance(self.resource_type, Unset): resource_type = self.resource_type - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - default: Union[None, Unset, str] + default: None | Unset | str if isinstance(self.default, Unset): default = UNSET else: @@ -132,7 +132,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: shown.append(shown_item) - def _parse_required(data: object) -> Union[None, list[CustomFieldRequiredType0Item]]: + def _parse_required(data: object) -> None | list[CustomFieldRequiredType0Item]: if data is None: return data try: @@ -148,7 +148,7 @@ def _parse_required(data: object) -> Union[None, list[CustomFieldRequiredType0It return required_type_0 except: # noqa: E722 pass - return cast(Union[None, list[CustomFieldRequiredType0Item]], data) + return cast(None | list[CustomFieldRequiredType0Item], data) required = _parse_required(d.pop("required")) @@ -165,27 +165,27 @@ def _parse_required(data: object) -> Union[None, list[CustomFieldRequiredType0It slug = d.pop("slug", UNSET) _resource_type = d.pop("resource_type", UNSET) - resource_type: Union[Unset, CustomFieldResourceType] + resource_type: Unset | CustomFieldResourceType if isinstance(_resource_type, Unset): resource_type = UNSET else: resource_type = check_custom_field_resource_type(_resource_type) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_default(data: object) -> Union[None, Unset, str]: + def _parse_default(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) default = _parse_default(d.pop("default", UNSET)) diff --git a/rootly_sdk/models/custom_field_list.py b/rootly_sdk/models/custom_field_list.py index 45ec18a8..6e733b5a 100644 --- a/rootly_sdk/models/custom_field_list.py +++ b/rootly_sdk/models/custom_field_list.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,7 +29,7 @@ class CustomFieldList: data: list["CustomFieldListDataItem"] links: "Links" meta: "Meta" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/custom_field_option.py b/rootly_sdk/models/custom_field_option.py index 5e03e83d..68edd831 100644 --- a/rootly_sdk/models/custom_field_option.py +++ b/rootly_sdk/models/custom_field_option.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -27,8 +27,8 @@ class CustomFieldOption: position: int created_at: str updated_at: str - custom_field_id: Union[Unset, int] = UNSET - default: Union[Unset, bool] = UNSET + custom_field_id: Unset | int = UNSET + default: Unset | bool = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/custom_field_option_list.py b/rootly_sdk/models/custom_field_option_list.py index 253ea8a4..c6152167 100644 --- a/rootly_sdk/models/custom_field_option_list.py +++ b/rootly_sdk/models/custom_field_option_list.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,7 +29,7 @@ class CustomFieldOptionList: data: list["CustomFieldOptionListDataItem"] links: "Links" meta: "Meta" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/custom_field_option_response.py b/rootly_sdk/models/custom_field_option_response.py index b40ffc86..3e9da894 100644 --- a/rootly_sdk/models/custom_field_option_response.py +++ b/rootly_sdk/models/custom_field_option_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,13 +23,13 @@ class CustomFieldOptionResponse: """ data: "CustomFieldOptionResponseData" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/custom_field_response.py b/rootly_sdk/models/custom_field_response.py index 6b255031..751fb9c3 100644 --- a/rootly_sdk/models/custom_field_response.py +++ b/rootly_sdk/models/custom_field_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,13 +23,13 @@ class CustomFieldResponse: """ data: "CustomFieldResponseData" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/custom_form.py b/rootly_sdk/models/custom_form.py index c4f1c8dc..5e5b7092 100644 --- a/rootly_sdk/models/custom_form.py +++ b/rootly_sdk/models/custom_form.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -28,8 +28,8 @@ class CustomForm: command: str created_at: str updated_at: str - slug: Union[Unset, str] = UNSET - description: Union[None, Unset, str] = UNSET + slug: Unset | str = UNSET + description: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -45,7 +45,7 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: @@ -84,12 +84,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: slug = d.pop("slug", UNSET) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) diff --git a/rootly_sdk/models/custom_form_list.py b/rootly_sdk/models/custom_form_list.py index 63cbed22..4f876e98 100644 --- a/rootly_sdk/models/custom_form_list.py +++ b/rootly_sdk/models/custom_form_list.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,7 +29,7 @@ class CustomFormList: data: list["CustomFormListDataItem"] links: "Links" meta: "Meta" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/custom_form_response.py b/rootly_sdk/models/custom_form_response.py index 1ec19f52..1d2dd1cc 100644 --- a/rootly_sdk/models/custom_form_response.py +++ b/rootly_sdk/models/custom_form_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,13 +23,13 @@ class CustomFormResponse: """ data: "CustomFormResponseData" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/dashboard.py b/rootly_sdk/models/dashboard.py index c7faeb2b..ce1b6222 100644 --- a/rootly_sdk/models/dashboard.py +++ b/rootly_sdk/models/dashboard.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -33,16 +33,16 @@ class Dashboard: name: str owner: DashboardOwner public: bool - team_id: Union[Unset, int] = UNSET - user_id: Union[None, Unset, int] = UNSET - description: Union[None, Unset, str] = UNSET - range_: Union[None, Unset, str] = UNSET - period: Union[None, Unset, str] = UNSET - auto_refresh: Union[Unset, bool] = UNSET - color: Union[Unset, DashboardColor] = UNSET - icon: Union[Unset, str] = UNSET - created_at: Union[Unset, str] = UNSET - updated_at: Union[Unset, str] = UNSET + team_id: Unset | int = UNSET + user_id: None | Unset | int = UNSET + description: None | Unset | str = UNSET + range_: None | Unset | str = UNSET + period: None | Unset | str = UNSET + auto_refresh: Unset | bool = UNSET + color: Unset | DashboardColor = UNSET + icon: Unset | str = UNSET + created_at: Unset | str = UNSET + updated_at: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -54,25 +54,25 @@ def to_dict(self) -> dict[str, Any]: team_id = self.team_id - user_id: Union[None, Unset, int] + user_id: None | Unset | int if isinstance(self.user_id, Unset): user_id = UNSET else: user_id = self.user_id - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - range_: Union[None, Unset, str] + range_: None | Unset | str if isinstance(self.range_, Unset): range_ = UNSET else: range_ = self.range_ - period: Union[None, Unset, str] + period: None | Unset | str if isinstance(self.period, Unset): period = UNSET else: @@ -80,7 +80,7 @@ def to_dict(self) -> dict[str, Any]: auto_refresh = self.auto_refresh - color: Union[Unset, str] = UNSET + color: Unset | str = UNSET if not isinstance(self.color, Unset): color = self.color @@ -133,46 +133,46 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: team_id = d.pop("team_id", UNSET) - def _parse_user_id(data: object) -> Union[None, Unset, int]: + def _parse_user_id(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) user_id = _parse_user_id(d.pop("user_id", UNSET)) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_range_(data: object) -> Union[None, Unset, str]: + def _parse_range_(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) range_ = _parse_range_(d.pop("range", UNSET)) - def _parse_period(data: object) -> Union[None, Unset, str]: + def _parse_period(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) period = _parse_period(d.pop("period", UNSET)) auto_refresh = d.pop("auto_refresh", UNSET) _color = d.pop("color", UNSET) - color: Union[Unset, DashboardColor] + color: Unset | DashboardColor if isinstance(_color, Unset): color = UNSET else: diff --git a/rootly_sdk/models/dashboard_list.py b/rootly_sdk/models/dashboard_list.py index baa91216..ff4b99da 100644 --- a/rootly_sdk/models/dashboard_list.py +++ b/rootly_sdk/models/dashboard_list.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,7 +29,7 @@ class DashboardList: data: list["DashboardListDataItem"] links: "Links" meta: "Meta" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/dashboard_panel.py b/rootly_sdk/models/dashboard_panel.py index c0a4c63f..26995283 100644 --- a/rootly_sdk/models/dashboard_panel.py +++ b/rootly_sdk/models/dashboard_panel.py @@ -27,10 +27,10 @@ class DashboardPanel: """ params: "DashboardPanelParams" - dashboard_id: Union[Unset, str] = UNSET - name: Union[None, Unset, str] = UNSET + dashboard_id: Unset | str = UNSET + name: None | Unset | str = UNSET position: Union["DashboardPanelPositionType0", None, Unset] = UNSET - data: Union[Unset, list["DashboardPanelDataItem"]] = UNSET + data: Unset | list["DashboardPanelDataItem"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -40,13 +40,13 @@ def to_dict(self) -> dict[str, Any]: dashboard_id = self.dashboard_id - name: Union[None, Unset, str] + name: None | Unset | str if isinstance(self.name, Unset): name = UNSET else: name = self.name - position: Union[None, Unset, dict[str, Any]] + position: None | Unset | dict[str, Any] if isinstance(self.position, Unset): position = UNSET elif isinstance(self.position, DashboardPanelPositionType0): @@ -54,7 +54,7 @@ def to_dict(self) -> dict[str, Any]: else: position = self.position - data: Union[Unset, list[dict[str, Any]]] = UNSET + data: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.data, Unset): data = [] for data_item_data in self.data: @@ -90,12 +90,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: dashboard_id = d.pop("dashboard_id", UNSET) - def _parse_name(data: object) -> Union[None, Unset, str]: + def _parse_name(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) name = _parse_name(d.pop("name", UNSET)) diff --git a/rootly_sdk/models/dashboard_panel_list.py b/rootly_sdk/models/dashboard_panel_list.py index 57e81259..fa664bcd 100644 --- a/rootly_sdk/models/dashboard_panel_list.py +++ b/rootly_sdk/models/dashboard_panel_list.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,7 +29,7 @@ class DashboardPanelList: data: list["DashboardPanelListDataItem"] links: "Links" meta: "Meta" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/dashboard_panel_params.py b/rootly_sdk/models/dashboard_panel_params.py index 13056bab..14a50bbc 100644 --- a/rootly_sdk/models/dashboard_panel_params.py +++ b/rootly_sdk/models/dashboard_panel_params.py @@ -28,34 +28,34 @@ class DashboardPanelParams: datasets (Union[Unset, list['DashboardPanelParamsDatasetsItem']]): """ - display: Union[Unset, DashboardPanelParamsDisplay] = UNSET - description: Union[Unset, str] = UNSET - table_fields: Union[Unset, list[str]] = UNSET + display: Unset | DashboardPanelParamsDisplay = UNSET + description: Unset | str = UNSET + table_fields: Unset | list[str] = UNSET legend: Union[Unset, "DashboardPanelParamsLegend"] = UNSET datalabels: Union[Unset, "DashboardPanelParamsDatalabels"] = UNSET - datasets: Union[Unset, list["DashboardPanelParamsDatasetsItem"]] = UNSET + datasets: Unset | list["DashboardPanelParamsDatasetsItem"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - display: Union[Unset, str] = UNSET + display: Unset | str = UNSET if not isinstance(self.display, Unset): display = self.display description = self.description - table_fields: Union[Unset, list[str]] = UNSET + table_fields: Unset | list[str] = UNSET if not isinstance(self.table_fields, Unset): table_fields = self.table_fields - legend: Union[Unset, dict[str, Any]] = UNSET + legend: Unset | dict[str, Any] = UNSET if not isinstance(self.legend, Unset): legend = self.legend.to_dict() - datalabels: Union[Unset, dict[str, Any]] = UNSET + datalabels: Unset | dict[str, Any] = UNSET if not isinstance(self.datalabels, Unset): datalabels = self.datalabels.to_dict() - datasets: Union[Unset, list[dict[str, Any]]] = UNSET + datasets: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.datasets, Unset): datasets = [] for datasets_item_data in self.datasets: @@ -88,7 +88,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _display = d.pop("display", UNSET) - display: Union[Unset, DashboardPanelParamsDisplay] + display: Unset | DashboardPanelParamsDisplay if isinstance(_display, Unset): display = UNSET else: @@ -99,14 +99,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: table_fields = cast(list[str], d.pop("table_fields", UNSET)) _legend = d.pop("legend", UNSET) - legend: Union[Unset, DashboardPanelParamsLegend] + legend: Unset | DashboardPanelParamsLegend if isinstance(_legend, Unset): legend = UNSET else: legend = DashboardPanelParamsLegend.from_dict(_legend) _datalabels = d.pop("datalabels", UNSET) - datalabels: Union[Unset, DashboardPanelParamsDatalabels] + datalabels: Unset | DashboardPanelParamsDatalabels if isinstance(_datalabels, Unset): datalabels = UNSET else: diff --git a/rootly_sdk/models/dashboard_panel_params_datalabels.py b/rootly_sdk/models/dashboard_panel_params_datalabels.py index 6a1dc92e..c1e1055e 100644 --- a/rootly_sdk/models/dashboard_panel_params_datalabels.py +++ b/rootly_sdk/models/dashboard_panel_params_datalabels.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,7 +16,7 @@ class DashboardPanelParamsDatalabels: enabled (Union[Unset, bool]): """ - enabled: Union[Unset, bool] = UNSET + enabled: Unset | bool = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/dashboard_panel_params_datasets_item.py b/rootly_sdk/models/dashboard_panel_params_datasets_item.py index 452418c4..36291daf 100644 --- a/rootly_sdk/models/dashboard_panel_params_datasets_item.py +++ b/rootly_sdk/models/dashboard_panel_params_datasets_item.py @@ -34,9 +34,9 @@ class DashboardPanelParamsDatasetsItem: aggregate (Union['DashboardPanelParamsDatasetsItemAggregateType0', None, Unset]): """ - name: Union[None, Unset, str] = UNSET - collection: Union[Unset, DashboardPanelParamsDatasetsItemCollection] = UNSET - filter_: Union[Unset, list["DashboardPanelParamsDatasetsItemFilterItem"]] = UNSET + name: None | Unset | str = UNSET + collection: Unset | DashboardPanelParamsDatasetsItemCollection = UNSET + filter_: Unset | list["DashboardPanelParamsDatasetsItemFilterItem"] = UNSET group_by: Union["DashboardPanelParamsDatasetsItemGroupByType1Type0", None, Unset, str] = UNSET aggregate: Union["DashboardPanelParamsDatasetsItemAggregateType0", None, Unset] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -49,24 +49,24 @@ def to_dict(self) -> dict[str, Any]: DashboardPanelParamsDatasetsItemGroupByType1Type0, ) - name: Union[None, Unset, str] + name: None | Unset | str if isinstance(self.name, Unset): name = UNSET else: name = self.name - collection: Union[Unset, str] = UNSET + collection: Unset | str = UNSET if not isinstance(self.collection, Unset): collection = self.collection - filter_: Union[Unset, list[dict[str, Any]]] = UNSET + filter_: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.filter_, Unset): filter_ = [] for filter_item_data in self.filter_: filter_item = filter_item_data.to_dict() filter_.append(filter_item) - group_by: Union[None, Unset, dict[str, Any], str] + group_by: None | Unset | dict[str, Any] | str if isinstance(self.group_by, Unset): group_by = UNSET elif isinstance(self.group_by, DashboardPanelParamsDatasetsItemGroupByType1Type0): @@ -74,7 +74,7 @@ def to_dict(self) -> dict[str, Any]: else: group_by = self.group_by - aggregate: Union[None, Unset, dict[str, Any]] + aggregate: None | Unset | dict[str, Any] if isinstance(self.aggregate, Unset): aggregate = UNSET elif isinstance(self.aggregate, DashboardPanelParamsDatasetsItemAggregateType0): @@ -110,17 +110,17 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_name(data: object) -> Union[None, Unset, str]: + def _parse_name(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) name = _parse_name(d.pop("name", UNSET)) _collection = d.pop("collection", UNSET) - collection: Union[Unset, DashboardPanelParamsDatasetsItemCollection] + collection: Unset | DashboardPanelParamsDatasetsItemCollection if isinstance(_collection, Unset): collection = UNSET else: diff --git a/rootly_sdk/models/dashboard_panel_params_datasets_item_aggregate_type_0.py b/rootly_sdk/models/dashboard_panel_params_datasets_item_aggregate_type_0.py index 6d86cc2f..3cd5dba9 100644 --- a/rootly_sdk/models/dashboard_panel_params_datasets_item_aggregate_type_0.py +++ b/rootly_sdk/models/dashboard_panel_params_datasets_item_aggregate_type_0.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,23 +22,23 @@ class DashboardPanelParamsDatasetsItemAggregateType0: cumulative (Union[None, Unset, bool]): """ - operation: Union[Unset, DashboardPanelParamsDatasetsItemAggregateType0Operation] = UNSET - key: Union[None, Unset, str] = UNSET - cumulative: Union[None, Unset, bool] = UNSET + operation: Unset | DashboardPanelParamsDatasetsItemAggregateType0Operation = UNSET + key: None | Unset | str = UNSET + cumulative: None | Unset | bool = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - operation: Union[Unset, str] = UNSET + operation: Unset | str = UNSET if not isinstance(self.operation, Unset): operation = self.operation - key: Union[None, Unset, str] + key: None | Unset | str if isinstance(self.key, Unset): key = UNSET else: key = self.key - cumulative: Union[None, Unset, bool] + cumulative: None | Unset | bool if isinstance(self.cumulative, Unset): cumulative = UNSET else: @@ -60,27 +60,27 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _operation = d.pop("operation", UNSET) - operation: Union[Unset, DashboardPanelParamsDatasetsItemAggregateType0Operation] + operation: Unset | DashboardPanelParamsDatasetsItemAggregateType0Operation if isinstance(_operation, Unset): operation = UNSET else: operation = check_dashboard_panel_params_datasets_item_aggregate_type_0_operation(_operation) - def _parse_key(data: object) -> Union[None, Unset, str]: + def _parse_key(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) key = _parse_key(d.pop("key", UNSET)) - def _parse_cumulative(data: object) -> Union[None, Unset, bool]: + def _parse_cumulative(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) cumulative = _parse_cumulative(d.pop("cumulative", UNSET)) diff --git a/rootly_sdk/models/dashboard_panel_params_datasets_item_filter_item.py b/rootly_sdk/models/dashboard_panel_params_datasets_item_filter_item.py index 6a9aa89c..fc6cf609 100644 --- a/rootly_sdk/models/dashboard_panel_params_datasets_item_filter_item.py +++ b/rootly_sdk/models/dashboard_panel_params_datasets_item_filter_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -27,16 +27,16 @@ class DashboardPanelParamsDatasetsItemFilterItem: rules (Union[Unset, list['DashboardPanelParamsDatasetsItemFilterItemRulesItem']]): """ - operation: Union[Unset, DashboardPanelParamsDatasetsItemFilterItemOperation] = UNSET - rules: Union[Unset, list["DashboardPanelParamsDatasetsItemFilterItemRulesItem"]] = UNSET + operation: Unset | DashboardPanelParamsDatasetsItemFilterItemOperation = UNSET + rules: Unset | list["DashboardPanelParamsDatasetsItemFilterItemRulesItem"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - operation: Union[Unset, str] = UNSET + operation: Unset | str = UNSET if not isinstance(self.operation, Unset): operation = self.operation - rules: Union[Unset, list[dict[str, Any]]] = UNSET + rules: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.rules, Unset): rules = [] for rules_item_data in self.rules: @@ -61,7 +61,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _operation = d.pop("operation", UNSET) - operation: Union[Unset, DashboardPanelParamsDatasetsItemFilterItemOperation] + operation: Unset | DashboardPanelParamsDatasetsItemFilterItemOperation if isinstance(_operation, Unset): operation = UNSET else: diff --git a/rootly_sdk/models/dashboard_panel_params_datasets_item_filter_item_rules_item.py b/rootly_sdk/models/dashboard_panel_params_datasets_item_filter_item_rules_item.py index 60055ad7..172edea7 100644 --- a/rootly_sdk/models/dashboard_panel_params_datasets_item_filter_item_rules_item.py +++ b/rootly_sdk/models/dashboard_panel_params_datasets_item_filter_item_rules_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -27,18 +27,18 @@ class DashboardPanelParamsDatasetsItemFilterItemRulesItem: value (Union[Unset, str]): """ - operation: Union[Unset, DashboardPanelParamsDatasetsItemFilterItemRulesItemOperation] = UNSET - condition: Union[Unset, DashboardPanelParamsDatasetsItemFilterItemRulesItemCondition] = UNSET - key: Union[Unset, str] = UNSET - value: Union[Unset, str] = UNSET + operation: Unset | DashboardPanelParamsDatasetsItemFilterItemRulesItemOperation = UNSET + condition: Unset | DashboardPanelParamsDatasetsItemFilterItemRulesItemCondition = UNSET + key: Unset | str = UNSET + value: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - operation: Union[Unset, str] = UNSET + operation: Unset | str = UNSET if not isinstance(self.operation, Unset): operation = self.operation - condition: Union[Unset, str] = UNSET + condition: Unset | str = UNSET if not isinstance(self.condition, Unset): condition = self.condition @@ -64,14 +64,14 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _operation = d.pop("operation", UNSET) - operation: Union[Unset, DashboardPanelParamsDatasetsItemFilterItemRulesItemOperation] + operation: Unset | DashboardPanelParamsDatasetsItemFilterItemRulesItemOperation if isinstance(_operation, Unset): operation = UNSET else: operation = check_dashboard_panel_params_datasets_item_filter_item_rules_item_operation(_operation) _condition = d.pop("condition", UNSET) - condition: Union[Unset, DashboardPanelParamsDatasetsItemFilterItemRulesItemCondition] + condition: Unset | DashboardPanelParamsDatasetsItemFilterItemRulesItemCondition if isinstance(_condition, Unset): condition = UNSET else: diff --git a/rootly_sdk/models/dashboard_panel_params_legend.py b/rootly_sdk/models/dashboard_panel_params_legend.py index 04c082b3..51b35f9d 100644 --- a/rootly_sdk/models/dashboard_panel_params_legend.py +++ b/rootly_sdk/models/dashboard_panel_params_legend.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -20,11 +20,11 @@ class DashboardPanelParamsLegend: groups (Union[Unset, DashboardPanelParamsLegendGroups]): Default: 'all'. """ - groups: Union[Unset, DashboardPanelParamsLegendGroups] = "all" + groups: Unset | DashboardPanelParamsLegendGroups = "all" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - groups: Union[Unset, str] = UNSET + groups: Unset | str = UNSET if not isinstance(self.groups, Unset): groups = self.groups @@ -40,7 +40,7 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _groups = d.pop("groups", UNSET) - groups: Union[Unset, DashboardPanelParamsLegendGroups] + groups: Unset | DashboardPanelParamsLegendGroups if isinstance(_groups, Unset): groups = UNSET else: diff --git a/rootly_sdk/models/dashboard_panel_response.py b/rootly_sdk/models/dashboard_panel_response.py index 00d625cc..f4667135 100644 --- a/rootly_sdk/models/dashboard_panel_response.py +++ b/rootly_sdk/models/dashboard_panel_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,13 +23,13 @@ class DashboardPanelResponse: """ data: "DashboardPanelResponseData" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/dashboard_response.py b/rootly_sdk/models/dashboard_response.py index 6f2b96b4..8f5c6935 100644 --- a/rootly_sdk/models/dashboard_response.py +++ b/rootly_sdk/models/dashboard_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,13 +23,13 @@ class DashboardResponse: """ data: "DashboardResponseData" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/delete_alert_route_response_200.py b/rootly_sdk/models/delete_alert_route_response_200.py index 0e0b800e..01c2a996 100644 --- a/rootly_sdk/models/delete_alert_route_response_200.py +++ b/rootly_sdk/models/delete_alert_route_response_200.py @@ -24,7 +24,7 @@ class DeleteAlertRouteResponse200: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data: Union[Unset, dict[str, Any]] = UNSET + data: Unset | dict[str, Any] = UNSET if not isinstance(self.data, Unset): data = self.data.to_dict() @@ -42,7 +42,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _data = d.pop("data", UNSET) - data: Union[Unset, DeleteAlertRouteResponse200Data] + data: Unset | DeleteAlertRouteResponse200Data if isinstance(_data, Unset): data = UNSET else: diff --git a/rootly_sdk/models/delete_alert_route_response_200_data.py b/rootly_sdk/models/delete_alert_route_response_200_data.py index cb14105c..4d975e7f 100644 --- a/rootly_sdk/models/delete_alert_route_response_200_data.py +++ b/rootly_sdk/models/delete_alert_route_response_200_data.py @@ -22,8 +22,8 @@ class DeleteAlertRouteResponse200Data: attributes (Union[Unset, DeleteAlertRouteResponse200DataAttributes]): """ - id: Union[Unset, str] = UNSET - type_: Union[Unset, str] = UNSET + id: Unset | str = UNSET + type_: Unset | str = UNSET attributes: Union[Unset, "DeleteAlertRouteResponse200DataAttributes"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -32,7 +32,7 @@ def to_dict(self) -> dict[str, Any]: type_ = self.type_ - attributes: Union[Unset, dict[str, Any]] = UNSET + attributes: Unset | dict[str, Any] = UNSET if not isinstance(self.attributes, Unset): attributes = self.attributes.to_dict() @@ -58,7 +58,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: type_ = d.pop("type", UNSET) _attributes = d.pop("attributes", UNSET) - attributes: Union[Unset, DeleteAlertRouteResponse200DataAttributes] + attributes: Unset | DeleteAlertRouteResponse200DataAttributes if isinstance(_attributes, Unset): attributes = UNSET else: diff --git a/rootly_sdk/models/delete_alert_route_response_200_data_attributes.py b/rootly_sdk/models/delete_alert_route_response_200_data_attributes.py index 20ef8390..1010554d 100644 --- a/rootly_sdk/models/delete_alert_route_response_200_data_attributes.py +++ b/rootly_sdk/models/delete_alert_route_response_200_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,7 +16,7 @@ class DeleteAlertRouteResponse200DataAttributes: deleted (Union[Unset, bool]): """ - deleted: Union[Unset, bool] = UNSET + deleted: Unset | bool = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/duplicate_incident_data_attributes.py b/rootly_sdk/models/duplicate_incident_data_attributes.py index feb76a0d..3ff52dac 100644 --- a/rootly_sdk/models/duplicate_incident_data_attributes.py +++ b/rootly_sdk/models/duplicate_incident_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -17,20 +17,20 @@ class DuplicateIncidentDataAttributes: reason_for_cancellation (Union[None, Unset, str]): Why was the incident cancelled? """ - duplicate_incident_id: Union[Unset, str] = UNSET - auto_cancel_incident: Union[None, Unset, bool] = True - reason_for_cancellation: Union[None, Unset, str] = UNSET + duplicate_incident_id: Unset | str = UNSET + auto_cancel_incident: None | Unset | bool = True + reason_for_cancellation: None | Unset | str = UNSET def to_dict(self) -> dict[str, Any]: duplicate_incident_id = self.duplicate_incident_id - auto_cancel_incident: Union[None, Unset, bool] + auto_cancel_incident: None | Unset | bool if isinstance(self.auto_cancel_incident, Unset): auto_cancel_incident = UNSET else: auto_cancel_incident = self.auto_cancel_incident - reason_for_cancellation: Union[None, Unset, str] + reason_for_cancellation: None | Unset | str if isinstance(self.reason_for_cancellation, Unset): reason_for_cancellation = UNSET else: @@ -53,21 +53,21 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) duplicate_incident_id = d.pop("duplicate_incident_id", UNSET) - def _parse_auto_cancel_incident(data: object) -> Union[None, Unset, bool]: + def _parse_auto_cancel_incident(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) auto_cancel_incident = _parse_auto_cancel_incident(d.pop("auto_cancel_incident", UNSET)) - def _parse_reason_for_cancellation(data: object) -> Union[None, Unset, str]: + def _parse_reason_for_cancellation(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) reason_for_cancellation = _parse_reason_for_cancellation(d.pop("reason_for_cancellation", UNSET)) diff --git a/rootly_sdk/models/edge_connector_action_data_attributes.py b/rootly_sdk/models/edge_connector_action_data_attributes.py index 32bfb0ff..4ab3bd1f 100644 --- a/rootly_sdk/models/edge_connector_action_data_attributes.py +++ b/rootly_sdk/models/edge_connector_action_data_attributes.py @@ -1,6 +1,6 @@ import datetime from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -44,14 +44,14 @@ class EdgeConnectorActionDataAttributes: name: str action_type: EdgeConnectorActionDataAttributesActionType - slug: Union[Unset, str] = UNSET - icon: Union[Unset, EdgeConnectorActionDataAttributesIcon] = UNSET - description: Union[None, Unset, str] = UNSET - timeout: Union[None, Unset, int] = UNSET - parameters: Union[None, Unset, list["EdgeConnectorActionDataAttributesParametersType0Item"]] = UNSET - last_executed_at: Union[None, Unset, datetime.datetime] = UNSET - created_at: Union[Unset, datetime.datetime] = UNSET - updated_at: Union[Unset, datetime.datetime] = UNSET + slug: Unset | str = UNSET + icon: Unset | EdgeConnectorActionDataAttributesIcon = UNSET + description: None | Unset | str = UNSET + timeout: None | Unset | int = UNSET + parameters: None | Unset | list["EdgeConnectorActionDataAttributesParametersType0Item"] = UNSET + last_executed_at: None | Unset | datetime.datetime = UNSET + created_at: Unset | datetime.datetime = UNSET + updated_at: Unset | datetime.datetime = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -61,23 +61,23 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - icon: Union[Unset, str] = UNSET + icon: Unset | str = UNSET if not isinstance(self.icon, Unset): icon = self.icon - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - timeout: Union[None, Unset, int] + timeout: None | Unset | int if isinstance(self.timeout, Unset): timeout = UNSET else: timeout = self.timeout - parameters: Union[None, Unset, list[dict[str, Any]]] + parameters: None | Unset | list[dict[str, Any]] if isinstance(self.parameters, Unset): parameters = UNSET elif isinstance(self.parameters, list): @@ -89,7 +89,7 @@ def to_dict(self) -> dict[str, Any]: else: parameters = self.parameters - last_executed_at: Union[None, Unset, str] + last_executed_at: None | Unset | str if isinstance(self.last_executed_at, Unset): last_executed_at = UNSET elif isinstance(self.last_executed_at, datetime.datetime): @@ -97,11 +97,11 @@ def to_dict(self) -> dict[str, Any]: else: last_executed_at = self.last_executed_at - created_at: Union[Unset, str] = UNSET + created_at: Unset | str = UNSET if not isinstance(self.created_at, Unset): created_at = self.created_at.isoformat() - updated_at: Union[Unset, str] = UNSET + updated_at: Unset | str = UNSET if not isinstance(self.updated_at, Unset): updated_at = self.updated_at.isoformat() @@ -146,33 +146,33 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: slug = d.pop("slug", UNSET) _icon = d.pop("icon", UNSET) - icon: Union[Unset, EdgeConnectorActionDataAttributesIcon] + icon: Unset | EdgeConnectorActionDataAttributesIcon if isinstance(_icon, Unset): icon = UNSET else: icon = check_edge_connector_action_data_attributes_icon(_icon) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_timeout(data: object) -> Union[None, Unset, int]: + def _parse_timeout(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) timeout = _parse_timeout(d.pop("timeout", UNSET)) def _parse_parameters( data: object, - ) -> Union[None, Unset, list["EdgeConnectorActionDataAttributesParametersType0Item"]]: + ) -> None | Unset | list["EdgeConnectorActionDataAttributesParametersType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -192,11 +192,11 @@ def _parse_parameters( return parameters_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list["EdgeConnectorActionDataAttributesParametersType0Item"]], data) + return cast(None | Unset | list["EdgeConnectorActionDataAttributesParametersType0Item"], data) parameters = _parse_parameters(d.pop("parameters", UNSET)) - def _parse_last_executed_at(data: object) -> Union[None, Unset, datetime.datetime]: + def _parse_last_executed_at(data: object) -> None | Unset | datetime.datetime: if data is None: return data if isinstance(data, Unset): @@ -209,19 +209,19 @@ def _parse_last_executed_at(data: object) -> Union[None, Unset, datetime.datetim return last_executed_at_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, datetime.datetime], data) + return cast(None | Unset | datetime.datetime, data) last_executed_at = _parse_last_executed_at(d.pop("last_executed_at", UNSET)) _created_at = d.pop("created_at", UNSET) - created_at: Union[Unset, datetime.datetime] + created_at: Unset | datetime.datetime if isinstance(_created_at, Unset): created_at = UNSET else: created_at = isoparse(_created_at) _updated_at = d.pop("updated_at", UNSET) - updated_at: Union[Unset, datetime.datetime] + updated_at: Unset | datetime.datetime if isinstance(_updated_at, Unset): updated_at = UNSET else: diff --git a/rootly_sdk/models/edge_connector_action_data_attributes_parameters_type_0_item.py b/rootly_sdk/models/edge_connector_action_data_attributes_parameters_type_0_item.py index b50cdd6e..1f89cdc2 100644 --- a/rootly_sdk/models/edge_connector_action_data_attributes_parameters_type_0_item.py +++ b/rootly_sdk/models/edge_connector_action_data_attributes_parameters_type_0_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -25,36 +25,36 @@ class EdgeConnectorActionDataAttributesParametersType0Item: options (Union[None, Unset, list[str]]): """ - name: Union[Unset, str] = UNSET - type_: Union[Unset, EdgeConnectorActionDataAttributesParametersType0ItemType] = UNSET - required: Union[Unset, bool] = UNSET - description: Union[None, Unset, str] = UNSET - default: Union[None, Unset, str] = UNSET - options: Union[None, Unset, list[str]] = UNSET + name: Unset | str = UNSET + type_: Unset | EdgeConnectorActionDataAttributesParametersType0ItemType = UNSET + required: Unset | bool = UNSET + description: None | Unset | str = UNSET + default: None | Unset | str = UNSET + options: None | Unset | list[str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: name = self.name - type_: Union[Unset, str] = UNSET + type_: Unset | str = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ required = self.required - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - default: Union[None, Unset, str] + default: None | Unset | str if isinstance(self.default, Unset): default = UNSET else: default = self.default - options: Union[None, Unset, list[str]] + options: None | Unset | list[str] if isinstance(self.options, Unset): options = UNSET elif isinstance(self.options, list): @@ -87,7 +87,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name = d.pop("name", UNSET) _type_ = d.pop("type", UNSET) - type_: Union[Unset, EdgeConnectorActionDataAttributesParametersType0ItemType] + type_: Unset | EdgeConnectorActionDataAttributesParametersType0ItemType if isinstance(_type_, Unset): type_ = UNSET else: @@ -95,25 +95,25 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: required = d.pop("required", UNSET) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_default(data: object) -> Union[None, Unset, str]: + def _parse_default(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) default = _parse_default(d.pop("default", UNSET)) - def _parse_options(data: object) -> Union[None, Unset, list[str]]: + def _parse_options(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -126,7 +126,7 @@ def _parse_options(data: object) -> Union[None, Unset, list[str]]: return options_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) options = _parse_options(d.pop("options", UNSET)) diff --git a/rootly_sdk/models/edge_connector_data_attributes.py b/rootly_sdk/models/edge_connector_data_attributes.py index 91e8ba9c..07ae460c 100644 --- a/rootly_sdk/models/edge_connector_data_attributes.py +++ b/rootly_sdk/models/edge_connector_data_attributes.py @@ -1,6 +1,6 @@ import datetime from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -36,17 +36,17 @@ class EdgeConnectorDataAttributes: name: str status: EdgeConnectorDataAttributesStatus - description: Union[None, Unset, str] = UNSET - subscriptions: Union[Unset, list[str]] = UNSET - last_poll_at: Union[None, Unset, datetime.datetime] = UNSET - online: Union[Unset, bool] = UNSET - deliveries_count: Union[Unset, int] = UNSET - deliveries_queued_count: Union[Unset, int] = UNSET - deliveries_running_count: Union[Unset, int] = UNSET - deliveries_completed_count: Union[Unset, int] = UNSET - deliveries_failed_count: Union[Unset, int] = UNSET - created_at: Union[Unset, datetime.datetime] = UNSET - updated_at: Union[Unset, datetime.datetime] = UNSET + description: None | Unset | str = UNSET + subscriptions: Unset | list[str] = UNSET + last_poll_at: None | Unset | datetime.datetime = UNSET + online: Unset | bool = UNSET + deliveries_count: Unset | int = UNSET + deliveries_queued_count: Unset | int = UNSET + deliveries_running_count: Unset | int = UNSET + deliveries_completed_count: Unset | int = UNSET + deliveries_failed_count: Unset | int = UNSET + created_at: Unset | datetime.datetime = UNSET + updated_at: Unset | datetime.datetime = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -54,17 +54,17 @@ def to_dict(self) -> dict[str, Any]: status: str = self.status - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - subscriptions: Union[Unset, list[str]] = UNSET + subscriptions: Unset | list[str] = UNSET if not isinstance(self.subscriptions, Unset): subscriptions = self.subscriptions - last_poll_at: Union[None, Unset, str] + last_poll_at: None | Unset | str if isinstance(self.last_poll_at, Unset): last_poll_at = UNSET elif isinstance(self.last_poll_at, datetime.datetime): @@ -84,11 +84,11 @@ def to_dict(self) -> dict[str, Any]: deliveries_failed_count = self.deliveries_failed_count - created_at: Union[Unset, str] = UNSET + created_at: Unset | str = UNSET if not isinstance(self.created_at, Unset): created_at = self.created_at.isoformat() - updated_at: Union[Unset, str] = UNSET + updated_at: Unset | str = UNSET if not isinstance(self.updated_at, Unset): updated_at = self.updated_at.isoformat() @@ -132,18 +132,18 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: status = check_edge_connector_data_attributes_status(d.pop("status")) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) subscriptions = cast(list[str], d.pop("subscriptions", UNSET)) - def _parse_last_poll_at(data: object) -> Union[None, Unset, datetime.datetime]: + def _parse_last_poll_at(data: object) -> None | Unset | datetime.datetime: if data is None: return data if isinstance(data, Unset): @@ -156,7 +156,7 @@ def _parse_last_poll_at(data: object) -> Union[None, Unset, datetime.datetime]: return last_poll_at_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, datetime.datetime], data) + return cast(None | Unset | datetime.datetime, data) last_poll_at = _parse_last_poll_at(d.pop("last_poll_at", UNSET)) @@ -173,14 +173,14 @@ def _parse_last_poll_at(data: object) -> Union[None, Unset, datetime.datetime]: deliveries_failed_count = d.pop("deliveries_failed_count", UNSET) _created_at = d.pop("created_at", UNSET) - created_at: Union[Unset, datetime.datetime] + created_at: Unset | datetime.datetime if isinstance(_created_at, Unset): created_at = UNSET else: created_at = isoparse(_created_at) _updated_at = d.pop("updated_at", UNSET) - updated_at: Union[Unset, datetime.datetime] + updated_at: Unset | datetime.datetime if isinstance(_updated_at, Unset): updated_at = UNSET else: diff --git a/rootly_sdk/models/environment.py b/rootly_sdk/models/environment.py index 88ebfe56..06b0a454 100644 --- a/rootly_sdk/models/environment.py +++ b/rootly_sdk/models/environment.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -43,17 +43,17 @@ class Environment: name: str created_at: str updated_at: str - slug: Union[Unset, str] = UNSET - managed_by: Union[Unset, EnvironmentManagedBy] = UNSET - external_id: Union[None, Unset, str] = UNSET - description: Union[None, Unset, str] = UNSET - public_description: Union[None, Unset, str] = UNSET - notify_emails: Union[None, Unset, list[str]] = UNSET - color: Union[None, Unset, str] = UNSET - position: Union[None, Unset, int] = UNSET - slack_channels: Union[None, Unset, list["EnvironmentSlackChannelsType0Item"]] = UNSET - slack_aliases: Union[None, Unset, list["EnvironmentSlackAliasesType0Item"]] = UNSET - properties: Union[None, Unset, list["EnvironmentPropertiesType0Item"]] = UNSET + slug: Unset | str = UNSET + managed_by: Unset | EnvironmentManagedBy = UNSET + external_id: None | Unset | str = UNSET + description: None | Unset | str = UNSET + public_description: None | Unset | str = UNSET + notify_emails: None | Unset | list[str] = UNSET + color: None | Unset | str = UNSET + position: None | Unset | int = UNSET + slack_channels: None | Unset | list["EnvironmentSlackChannelsType0Item"] = UNSET + slack_aliases: None | Unset | list["EnvironmentSlackAliasesType0Item"] = UNSET + properties: None | Unset | list["EnvironmentPropertiesType0Item"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -65,29 +65,29 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - managed_by: Union[Unset, str] = UNSET + managed_by: Unset | str = UNSET if not isinstance(self.managed_by, Unset): managed_by = self.managed_by - external_id: Union[None, Unset, str] + external_id: None | Unset | str if isinstance(self.external_id, Unset): external_id = UNSET else: external_id = self.external_id - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - public_description: Union[None, Unset, str] + public_description: None | Unset | str if isinstance(self.public_description, Unset): public_description = UNSET else: public_description = self.public_description - notify_emails: Union[None, Unset, list[str]] + notify_emails: None | Unset | list[str] if isinstance(self.notify_emails, Unset): notify_emails = UNSET elif isinstance(self.notify_emails, list): @@ -96,19 +96,19 @@ def to_dict(self) -> dict[str, Any]: else: notify_emails = self.notify_emails - color: Union[None, Unset, str] + color: None | Unset | str if isinstance(self.color, Unset): color = UNSET else: color = self.color - position: Union[None, Unset, int] + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: position = self.position - slack_channels: Union[None, Unset, list[dict[str, Any]]] + slack_channels: None | Unset | list[dict[str, Any]] if isinstance(self.slack_channels, Unset): slack_channels = UNSET elif isinstance(self.slack_channels, list): @@ -120,7 +120,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_channels = self.slack_channels - slack_aliases: Union[None, Unset, list[dict[str, Any]]] + slack_aliases: None | Unset | list[dict[str, Any]] if isinstance(self.slack_aliases, Unset): slack_aliases = UNSET elif isinstance(self.slack_aliases, list): @@ -132,7 +132,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_aliases = self.slack_aliases - properties: Union[None, Unset, list[dict[str, Any]]] + properties: None | Unset | list[dict[str, Any]] if isinstance(self.properties, Unset): properties = UNSET elif isinstance(self.properties, list): @@ -194,40 +194,40 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: slug = d.pop("slug", UNSET) _managed_by = d.pop("managed_by", UNSET) - managed_by: Union[Unset, EnvironmentManagedBy] + managed_by: Unset | EnvironmentManagedBy if isinstance(_managed_by, Unset): managed_by = UNSET else: managed_by = check_environment_managed_by(_managed_by) - def _parse_external_id(data: object) -> Union[None, Unset, str]: + def _parse_external_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) external_id = _parse_external_id(d.pop("external_id", UNSET)) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_public_description(data: object) -> Union[None, Unset, str]: + def _parse_public_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) public_description = _parse_public_description(d.pop("public_description", UNSET)) - def _parse_notify_emails(data: object) -> Union[None, Unset, list[str]]: + def _parse_notify_emails(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -240,29 +240,29 @@ def _parse_notify_emails(data: object) -> Union[None, Unset, list[str]]: return notify_emails_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) notify_emails = _parse_notify_emails(d.pop("notify_emails", UNSET)) - def _parse_color(data: object) -> Union[None, Unset, str]: + def _parse_color(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) color = _parse_color(d.pop("color", UNSET)) - def _parse_position(data: object) -> Union[None, Unset, int]: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) - def _parse_slack_channels(data: object) -> Union[None, Unset, list["EnvironmentSlackChannelsType0Item"]]: + def _parse_slack_channels(data: object) -> None | Unset | list["EnvironmentSlackChannelsType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -282,11 +282,11 @@ def _parse_slack_channels(data: object) -> Union[None, Unset, list["EnvironmentS return slack_channels_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list["EnvironmentSlackChannelsType0Item"]], data) + return cast(None | Unset | list["EnvironmentSlackChannelsType0Item"], data) slack_channels = _parse_slack_channels(d.pop("slack_channels", UNSET)) - def _parse_slack_aliases(data: object) -> Union[None, Unset, list["EnvironmentSlackAliasesType0Item"]]: + def _parse_slack_aliases(data: object) -> None | Unset | list["EnvironmentSlackAliasesType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -306,11 +306,11 @@ def _parse_slack_aliases(data: object) -> Union[None, Unset, list["EnvironmentSl return slack_aliases_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list["EnvironmentSlackAliasesType0Item"]], data) + return cast(None | Unset | list["EnvironmentSlackAliasesType0Item"], data) slack_aliases = _parse_slack_aliases(d.pop("slack_aliases", UNSET)) - def _parse_properties(data: object) -> Union[None, Unset, list["EnvironmentPropertiesType0Item"]]: + def _parse_properties(data: object) -> None | Unset | list["EnvironmentPropertiesType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -328,7 +328,7 @@ def _parse_properties(data: object) -> Union[None, Unset, list["EnvironmentPrope return properties_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list["EnvironmentPropertiesType0Item"]], data) + return cast(None | Unset | list["EnvironmentPropertiesType0Item"], data) properties = _parse_properties(d.pop("properties", UNSET)) diff --git a/rootly_sdk/models/environment_list.py b/rootly_sdk/models/environment_list.py index 7d8c1875..2df8b7b3 100644 --- a/rootly_sdk/models/environment_list.py +++ b/rootly_sdk/models/environment_list.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,7 +29,7 @@ class EnvironmentList: data: list["EnvironmentListDataItem"] links: "Links" meta: "Meta" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/environment_response.py b/rootly_sdk/models/environment_response.py index 400f7207..de2f9bd3 100644 --- a/rootly_sdk/models/environment_response.py +++ b/rootly_sdk/models/environment_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,13 +23,13 @@ class EnvironmentResponse: """ data: "EnvironmentResponseData" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/errors_list.py b/rootly_sdk/models/errors_list.py index ae2486d0..af2abffb 100644 --- a/rootly_sdk/models/errors_list.py +++ b/rootly_sdk/models/errors_list.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -20,11 +20,11 @@ class ErrorsList: errors (Union[Unset, list['ErrorsListErrorsItem']]): """ - errors: Union[Unset, list["ErrorsListErrorsItem"]] = UNSET + errors: Unset | list["ErrorsListErrorsItem"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - errors: Union[Unset, list[dict[str, Any]]] = UNSET + errors: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.errors, Unset): errors = [] for errors_item_data in self.errors: diff --git a/rootly_sdk/models/errors_list_errors_item.py b/rootly_sdk/models/errors_list_errors_item.py index 23fd669d..d4a4f5c2 100644 --- a/rootly_sdk/models/errors_list_errors_item.py +++ b/rootly_sdk/models/errors_list_errors_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,8 +21,8 @@ class ErrorsListErrorsItem: title: str status: str - code: Union[None, Unset, str] = UNSET - detail: Union[None, Unset, str] = UNSET + code: None | Unset | str = UNSET + detail: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -30,13 +30,13 @@ def to_dict(self) -> dict[str, Any]: status = self.status - code: Union[None, Unset, str] + code: None | Unset | str if isinstance(self.code, Unset): code = UNSET else: code = self.code - detail: Union[None, Unset, str] + detail: None | Unset | str if isinstance(self.detail, Unset): detail = UNSET else: @@ -64,21 +64,21 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: status = d.pop("status") - def _parse_code(data: object) -> Union[None, Unset, str]: + def _parse_code(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) code = _parse_code(d.pop("code", UNSET)) - def _parse_detail(data: object) -> Union[None, Unset, str]: + def _parse_detail(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) detail = _parse_detail(d.pop("detail", UNSET)) diff --git a/rootly_sdk/models/escalate_alert.py b/rootly_sdk/models/escalate_alert.py index 4db6ccb0..a42c7953 100644 --- a/rootly_sdk/models/escalate_alert.py +++ b/rootly_sdk/models/escalate_alert.py @@ -24,7 +24,7 @@ class EscalateAlert: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data: Union[Unset, dict[str, Any]] = UNSET + data: Unset | dict[str, Any] = UNSET if not isinstance(self.data, Unset): data = self.data.to_dict() @@ -42,7 +42,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _data = d.pop("data", UNSET) - data: Union[Unset, EscalateAlertData] + data: Unset | EscalateAlertData if isinstance(_data, Unset): data = UNSET else: diff --git a/rootly_sdk/models/escalate_alert_data.py b/rootly_sdk/models/escalate_alert_data.py index a1cfa223..8f065bd2 100644 --- a/rootly_sdk/models/escalate_alert_data.py +++ b/rootly_sdk/models/escalate_alert_data.py @@ -22,16 +22,16 @@ class EscalateAlertData: attributes (Union[Unset, EscalateAlertDataAttributes]): """ - type_: Union[Unset, EscalateAlertDataType] = UNSET + type_: Unset | EscalateAlertDataType = UNSET attributes: Union[Unset, "EscalateAlertDataAttributes"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: Union[Unset, str] = UNSET + type_: Unset | str = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ - attributes: Union[Unset, dict[str, Any]] = UNSET + attributes: Unset | dict[str, Any] = UNSET if not isinstance(self.attributes, Unset): attributes = self.attributes.to_dict() @@ -51,14 +51,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _type_ = d.pop("type", UNSET) - type_: Union[Unset, EscalateAlertDataType] + type_: Unset | EscalateAlertDataType if isinstance(_type_, Unset): type_ = UNSET else: type_ = check_escalate_alert_data_type(_type_) _attributes = d.pop("attributes", UNSET) - attributes: Union[Unset, EscalateAlertDataAttributes] + attributes: Unset | EscalateAlertDataAttributes if isinstance(_attributes, Unset): attributes = UNSET else: diff --git a/rootly_sdk/models/escalate_alert_data_attributes.py b/rootly_sdk/models/escalate_alert_data_attributes.py index e99366d0..5eae0b81 100644 --- a/rootly_sdk/models/escalate_alert_data_attributes.py +++ b/rootly_sdk/models/escalate_alert_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define @@ -19,8 +19,8 @@ class EscalateAlertDataAttributes: the next level (same EP) or level 1 (different EP). """ - escalation_policy_id: Union[Unset, str] = UNSET - escalation_policy_level: Union[Unset, int] = UNSET + escalation_policy_id: Unset | str = UNSET + escalation_policy_level: Unset | int = UNSET def to_dict(self) -> dict[str, Any]: escalation_policy_id = self.escalation_policy_id diff --git a/rootly_sdk/models/escalation_policy.py b/rootly_sdk/models/escalation_policy.py index ad114b37..5e7daa37 100644 --- a/rootly_sdk/models/escalation_policy.py +++ b/rootly_sdk/models/escalation_policy.py @@ -32,13 +32,13 @@ class EscalationPolicy: name: str repeat_count: int created_by_user_id: int - description: Union[None, Unset, str] = UNSET - last_updated_by_user_id: Union[Unset, int] = UNSET - group_ids: Union[Unset, list[str]] = UNSET - service_ids: Union[Unset, list[str]] = UNSET + description: None | Unset | str = UNSET + last_updated_by_user_id: Unset | int = UNSET + group_ids: Unset | list[str] = UNSET + service_ids: Unset | list[str] = UNSET business_hours: Union["EscalationPolicyBusinessHoursType0", None, Unset] = UNSET - created_at: Union[Unset, str] = UNSET - updated_at: Union[Unset, str] = UNSET + created_at: Unset | str = UNSET + updated_at: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -50,7 +50,7 @@ def to_dict(self) -> dict[str, Any]: created_by_user_id = self.created_by_user_id - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: @@ -58,15 +58,15 @@ def to_dict(self) -> dict[str, Any]: last_updated_by_user_id = self.last_updated_by_user_id - group_ids: Union[Unset, list[str]] = UNSET + group_ids: Unset | list[str] = UNSET if not isinstance(self.group_ids, Unset): group_ids = self.group_ids - service_ids: Union[Unset, list[str]] = UNSET + service_ids: Unset | list[str] = UNSET if not isinstance(self.service_ids, Unset): service_ids = self.service_ids - business_hours: Union[None, Unset, dict[str, Any]] + business_hours: None | Unset | dict[str, Any] if isinstance(self.business_hours, Unset): business_hours = UNSET elif isinstance(self.business_hours, EscalationPolicyBusinessHoursType0): @@ -115,12 +115,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: created_by_user_id = d.pop("created_by_user_id") - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) diff --git a/rootly_sdk/models/escalation_policy_business_hours_type_0.py b/rootly_sdk/models/escalation_policy_business_hours_type_0.py index 21d025cb..e5081210 100644 --- a/rootly_sdk/models/escalation_policy_business_hours_type_0.py +++ b/rootly_sdk/models/escalation_policy_business_hours_type_0.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -27,18 +27,18 @@ class EscalationPolicyBusinessHoursType0: end_time (Union[None, Unset, str]): End time for business hours (HH:MM) """ - time_zone: Union[Unset, EscalationPolicyBusinessHoursType0TimeZone] = UNSET - days: Union[None, Unset, list[EscalationPolicyBusinessHoursType0DaysType0Item]] = UNSET - start_time: Union[None, Unset, str] = UNSET - end_time: Union[None, Unset, str] = UNSET + time_zone: Unset | EscalationPolicyBusinessHoursType0TimeZone = UNSET + days: None | Unset | list[EscalationPolicyBusinessHoursType0DaysType0Item] = UNSET + start_time: None | Unset | str = UNSET + end_time: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - time_zone: Union[Unset, str] = UNSET + time_zone: Unset | str = UNSET if not isinstance(self.time_zone, Unset): time_zone = self.time_zone - days: Union[None, Unset, list[str]] + days: None | Unset | list[str] if isinstance(self.days, Unset): days = UNSET elif isinstance(self.days, list): @@ -50,13 +50,13 @@ def to_dict(self) -> dict[str, Any]: else: days = self.days - start_time: Union[None, Unset, str] + start_time: None | Unset | str if isinstance(self.start_time, Unset): start_time = UNSET else: start_time = self.start_time - end_time: Union[None, Unset, str] + end_time: None | Unset | str if isinstance(self.end_time, Unset): end_time = UNSET else: @@ -80,13 +80,13 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _time_zone = d.pop("time_zone", UNSET) - time_zone: Union[Unset, EscalationPolicyBusinessHoursType0TimeZone] + time_zone: Unset | EscalationPolicyBusinessHoursType0TimeZone if isinstance(_time_zone, Unset): time_zone = UNSET else: time_zone = check_escalation_policy_business_hours_type_0_time_zone(_time_zone) - def _parse_days(data: object) -> Union[None, Unset, list[EscalationPolicyBusinessHoursType0DaysType0Item]]: + def _parse_days(data: object) -> None | Unset | list[EscalationPolicyBusinessHoursType0DaysType0Item]: if data is None: return data if isinstance(data, Unset): @@ -106,25 +106,25 @@ def _parse_days(data: object) -> Union[None, Unset, list[EscalationPolicyBusines return days_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[EscalationPolicyBusinessHoursType0DaysType0Item]], data) + return cast(None | Unset | list[EscalationPolicyBusinessHoursType0DaysType0Item], data) days = _parse_days(d.pop("days", UNSET)) - def _parse_start_time(data: object) -> Union[None, Unset, str]: + def _parse_start_time(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) start_time = _parse_start_time(d.pop("start_time", UNSET)) - def _parse_end_time(data: object) -> Union[None, Unset, str]: + def _parse_end_time(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) end_time = _parse_end_time(d.pop("end_time", UNSET)) diff --git a/rootly_sdk/models/escalation_policy_level.py b/rootly_sdk/models/escalation_policy_level.py index 9acbada9..15e38d09 100644 --- a/rootly_sdk/models/escalation_policy_level.py +++ b/rootly_sdk/models/escalation_policy_level.py @@ -64,23 +64,21 @@ class EscalationPolicyLevel: delay: int position: int notification_target_params: list[Union["EscalationPolicyLevelNotificationTargetParamsItemType0", None]] - escalation_policy_path_id: Union[None, Unset, str] = UNSET - paging_strategy_configuration_strategy: Union[Unset, EscalationPolicyLevelPagingStrategyConfigurationStrategy] = ( - "default" + escalation_policy_path_id: None | Unset | str = UNSET + paging_strategy_configuration_strategy: Unset | EscalationPolicyLevelPagingStrategyConfigurationStrategy = "default" + paging_strategy_configuration_schedule_strategy: ( + Unset | EscalationPolicyLevelPagingStrategyConfigurationScheduleStrategy + ) = "on_call_only" + paging_strategy_configuration_repeats: None | Unset | int = UNSET + paging_strategy_configuration_repeats_mode: Unset | EscalationPolicyLevelPagingStrategyConfigurationRepeatsMode = ( + UNSET ) - paging_strategy_configuration_schedule_strategy: Union[ - Unset, EscalationPolicyLevelPagingStrategyConfigurationScheduleStrategy - ] = "on_call_only" - paging_strategy_configuration_repeats: Union[None, Unset, int] = UNSET - paging_strategy_configuration_repeats_mode: Union[ - Unset, EscalationPolicyLevelPagingStrategyConfigurationRepeatsMode - ] = UNSET - paging_strategy_configuration_rotation_scope: Union[ - Unset, EscalationPolicyLevelPagingStrategyConfigurationRotationScope - ] = UNSET - paging_strategy_configuration_page_users_count: Union[None, Unset, int] = UNSET - created_at: Union[Unset, str] = UNSET - updated_at: Union[Unset, str] = UNSET + paging_strategy_configuration_rotation_scope: ( + Unset | EscalationPolicyLevelPagingStrategyConfigurationRotationScope + ) = UNSET + paging_strategy_configuration_page_users_count: None | Unset | int = UNSET + created_at: Unset | str = UNSET + updated_at: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -96,42 +94,42 @@ def to_dict(self) -> dict[str, Any]: notification_target_params = [] for notification_target_params_item_data in self.notification_target_params: - notification_target_params_item: Union[None, dict[str, Any]] + notification_target_params_item: None | dict[str, Any] if isinstance(notification_target_params_item_data, EscalationPolicyLevelNotificationTargetParamsItemType0): notification_target_params_item = notification_target_params_item_data.to_dict() else: notification_target_params_item = notification_target_params_item_data notification_target_params.append(notification_target_params_item) - escalation_policy_path_id: Union[None, Unset, str] + escalation_policy_path_id: None | Unset | str if isinstance(self.escalation_policy_path_id, Unset): escalation_policy_path_id = UNSET else: escalation_policy_path_id = self.escalation_policy_path_id - paging_strategy_configuration_strategy: Union[Unset, str] = UNSET + paging_strategy_configuration_strategy: Unset | str = UNSET if not isinstance(self.paging_strategy_configuration_strategy, Unset): paging_strategy_configuration_strategy = self.paging_strategy_configuration_strategy - paging_strategy_configuration_schedule_strategy: Union[Unset, str] = UNSET + paging_strategy_configuration_schedule_strategy: Unset | str = UNSET if not isinstance(self.paging_strategy_configuration_schedule_strategy, Unset): paging_strategy_configuration_schedule_strategy = self.paging_strategy_configuration_schedule_strategy - paging_strategy_configuration_repeats: Union[None, Unset, int] + paging_strategy_configuration_repeats: None | Unset | int if isinstance(self.paging_strategy_configuration_repeats, Unset): paging_strategy_configuration_repeats = UNSET else: paging_strategy_configuration_repeats = self.paging_strategy_configuration_repeats - paging_strategy_configuration_repeats_mode: Union[Unset, str] = UNSET + paging_strategy_configuration_repeats_mode: Unset | str = UNSET if not isinstance(self.paging_strategy_configuration_repeats_mode, Unset): paging_strategy_configuration_repeats_mode = self.paging_strategy_configuration_repeats_mode - paging_strategy_configuration_rotation_scope: Union[Unset, str] = UNSET + paging_strategy_configuration_rotation_scope: Unset | str = UNSET if not isinstance(self.paging_strategy_configuration_rotation_scope, Unset): paging_strategy_configuration_rotation_scope = self.paging_strategy_configuration_rotation_scope - paging_strategy_configuration_page_users_count: Union[None, Unset, int] + paging_strategy_configuration_page_users_count: None | Unset | int if isinstance(self.paging_strategy_configuration_page_users_count, Unset): paging_strategy_configuration_page_users_count = UNSET else: @@ -216,17 +214,17 @@ def _parse_notification_target_params_item( notification_target_params.append(notification_target_params_item) - def _parse_escalation_policy_path_id(data: object) -> Union[None, Unset, str]: + def _parse_escalation_policy_path_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) escalation_policy_path_id = _parse_escalation_policy_path_id(d.pop("escalation_policy_path_id", UNSET)) _paging_strategy_configuration_strategy = d.pop("paging_strategy_configuration_strategy", UNSET) - paging_strategy_configuration_strategy: Union[Unset, EscalationPolicyLevelPagingStrategyConfigurationStrategy] + paging_strategy_configuration_strategy: Unset | EscalationPolicyLevelPagingStrategyConfigurationStrategy if isinstance(_paging_strategy_configuration_strategy, Unset): paging_strategy_configuration_strategy = UNSET else: @@ -239,9 +237,9 @@ def _parse_escalation_policy_path_id(data: object) -> Union[None, Unset, str]: _paging_strategy_configuration_schedule_strategy = d.pop( "paging_strategy_configuration_schedule_strategy", UNSET ) - paging_strategy_configuration_schedule_strategy: Union[ - Unset, EscalationPolicyLevelPagingStrategyConfigurationScheduleStrategy - ] + paging_strategy_configuration_schedule_strategy: ( + Unset | EscalationPolicyLevelPagingStrategyConfigurationScheduleStrategy + ) if isinstance(_paging_strategy_configuration_schedule_strategy, Unset): paging_strategy_configuration_schedule_strategy = UNSET else: @@ -251,21 +249,19 @@ def _parse_escalation_policy_path_id(data: object) -> Union[None, Unset, str]: ) ) - def _parse_paging_strategy_configuration_repeats(data: object) -> Union[None, Unset, int]: + def _parse_paging_strategy_configuration_repeats(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) paging_strategy_configuration_repeats = _parse_paging_strategy_configuration_repeats( d.pop("paging_strategy_configuration_repeats", UNSET) ) _paging_strategy_configuration_repeats_mode = d.pop("paging_strategy_configuration_repeats_mode", UNSET) - paging_strategy_configuration_repeats_mode: Union[ - Unset, EscalationPolicyLevelPagingStrategyConfigurationRepeatsMode - ] + paging_strategy_configuration_repeats_mode: Unset | EscalationPolicyLevelPagingStrategyConfigurationRepeatsMode if isinstance(_paging_strategy_configuration_repeats_mode, Unset): paging_strategy_configuration_repeats_mode = UNSET else: @@ -276,9 +272,9 @@ def _parse_paging_strategy_configuration_repeats(data: object) -> Union[None, Un ) _paging_strategy_configuration_rotation_scope = d.pop("paging_strategy_configuration_rotation_scope", UNSET) - paging_strategy_configuration_rotation_scope: Union[ - Unset, EscalationPolicyLevelPagingStrategyConfigurationRotationScope - ] + paging_strategy_configuration_rotation_scope: ( + Unset | EscalationPolicyLevelPagingStrategyConfigurationRotationScope + ) if isinstance(_paging_strategy_configuration_rotation_scope, Unset): paging_strategy_configuration_rotation_scope = UNSET else: @@ -288,12 +284,12 @@ def _parse_paging_strategy_configuration_repeats(data: object) -> Union[None, Un ) ) - def _parse_paging_strategy_configuration_page_users_count(data: object) -> Union[None, Unset, int]: + def _parse_paging_strategy_configuration_page_users_count(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) paging_strategy_configuration_page_users_count = _parse_paging_strategy_configuration_page_users_count( d.pop("paging_strategy_configuration_page_users_count", UNSET) diff --git a/rootly_sdk/models/escalation_policy_level_list.py b/rootly_sdk/models/escalation_policy_level_list.py index df9ea619..3e8b9295 100644 --- a/rootly_sdk/models/escalation_policy_level_list.py +++ b/rootly_sdk/models/escalation_policy_level_list.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,7 +29,7 @@ class EscalationPolicyLevelList: data: list["EscalationPolicyLevelListDataItem"] links: "Links" meta: "Meta" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/escalation_policy_level_notification_target_params_item_type_0.py b/rootly_sdk/models/escalation_policy_level_notification_target_params_item_type_0.py index 93e7b5a0..6fc369bc 100644 --- a/rootly_sdk/models/escalation_policy_level_notification_target_params_item_type_0.py +++ b/rootly_sdk/models/escalation_policy_level_notification_target_params_item_type_0.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,7 +29,7 @@ class EscalationPolicyLevelNotificationTargetParamsItemType0: id: str type_: EscalationPolicyLevelNotificationTargetParamsItemType0Type - team_members: Union[Unset, EscalationPolicyLevelNotificationTargetParamsItemType0TeamMembers] = UNSET + team_members: Unset | EscalationPolicyLevelNotificationTargetParamsItemType0TeamMembers = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -37,7 +37,7 @@ def to_dict(self) -> dict[str, Any]: type_: str = self.type_ - team_members: Union[Unset, str] = UNSET + team_members: Unset | str = UNSET if not isinstance(self.team_members, Unset): team_members = self.team_members @@ -62,7 +62,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: type_ = check_escalation_policy_level_notification_target_params_item_type_0_type(d.pop("type")) _team_members = d.pop("team_members", UNSET) - team_members: Union[Unset, EscalationPolicyLevelNotificationTargetParamsItemType0TeamMembers] + team_members: Unset | EscalationPolicyLevelNotificationTargetParamsItemType0TeamMembers if isinstance(_team_members, Unset): team_members = UNSET else: diff --git a/rootly_sdk/models/escalation_policy_level_response.py b/rootly_sdk/models/escalation_policy_level_response.py index 845a27b3..9976067b 100644 --- a/rootly_sdk/models/escalation_policy_level_response.py +++ b/rootly_sdk/models/escalation_policy_level_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,13 +23,13 @@ class EscalationPolicyLevelResponse: """ data: "EscalationPolicyLevelResponseData" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/escalation_policy_level_response_data.py b/rootly_sdk/models/escalation_policy_level_response_data.py index f952ff87..430b5a17 100644 --- a/rootly_sdk/models/escalation_policy_level_response_data.py +++ b/rootly_sdk/models/escalation_policy_level_response_data.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -28,7 +28,7 @@ class EscalationPolicyLevelResponseData: id: str attributes: "EscalationPolicyLevel" - type_: Union[Unset, EscalationPolicyLevelResponseDataType] = UNSET + type_: Unset | EscalationPolicyLevelResponseDataType = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -36,7 +36,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() - type_: Union[Unset, str] = UNSET + type_: Unset | str = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ @@ -63,7 +63,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = EscalationPolicyLevel.from_dict(d.pop("attributes")) _type_ = d.pop("type", UNSET) - type_: Union[Unset, EscalationPolicyLevelResponseDataType] + type_: Unset | EscalationPolicyLevelResponseDataType if isinstance(_type_, Unset): type_ = UNSET else: diff --git a/rootly_sdk/models/escalation_policy_list.py b/rootly_sdk/models/escalation_policy_list.py index 9dc1fac7..4e153033 100644 --- a/rootly_sdk/models/escalation_policy_list.py +++ b/rootly_sdk/models/escalation_policy_list.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,7 +29,7 @@ class EscalationPolicyList: data: list["EscalationPolicyListDataItem"] links: "Links" meta: "Meta" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/escalation_policy_path.py b/rootly_sdk/models/escalation_policy_path.py index 05626e4d..6273b8ba 100644 --- a/rootly_sdk/models/escalation_policy_path.py +++ b/rootly_sdk/models/escalation_policy_path.py @@ -98,20 +98,20 @@ class EscalationPolicyPath: default: bool notification_type: str escalation_policy_id: str - repeat: Union[None, bool] - repeat_count: Union[None, int] - path_type: Union[Unset, EscalationPolicyPathPathType] = UNSET - after_deferral_behavior: Union[Unset, EscalationPolicyPathAfterDeferralBehavior] = UNSET - after_deferral_path_id: Union[None, Unset, str] = UNSET - match_mode: Union[Unset, EscalationPolicyPathMatchMode] = UNSET - position: Union[Unset, int] = UNSET - initial_delay: Union[Unset, int] = UNSET - retrigger_timeout_minutes: Union[None, Unset, int] = UNSET - created_at: Union[Unset, str] = UNSET - updated_at: Union[Unset, str] = UNSET - rules: Union[ - Unset, - list[ + repeat: None | bool + repeat_count: None | int + path_type: Unset | EscalationPolicyPathPathType = UNSET + after_deferral_behavior: Unset | EscalationPolicyPathAfterDeferralBehavior = UNSET + after_deferral_path_id: None | Unset | str = UNSET + match_mode: Unset | EscalationPolicyPathMatchMode = UNSET + position: Unset | int = UNSET + initial_delay: Unset | int = UNSET + retrigger_timeout_minutes: None | Unset | int = UNSET + created_at: Unset | str = UNSET + updated_at: Unset | str = UNSET + rules: ( + Unset + | list[ Union[ "EscalationPolicyPathRulesItemType0", "EscalationPolicyPathRulesItemType1", @@ -138,10 +138,10 @@ class EscalationPolicyPath: "EscalationPolicyPathRulesItemType9Type6", "EscalationPolicyPathRulesItemType9Type7", ] - ], - ] = UNSET - time_restriction_time_zone: Union[Unset, EscalationPolicyPathTimeRestrictionTimeZone] = UNSET - time_restrictions: Union[Unset, list["EscalationPolicyPathTimeRestrictionsItem"]] = UNSET + ] + ) = UNSET + time_restriction_time_zone: Unset | EscalationPolicyPathTimeRestrictionTimeZone = UNSET + time_restrictions: Unset | list["EscalationPolicyPathTimeRestrictionsItem"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -177,27 +177,27 @@ def to_dict(self) -> dict[str, Any]: escalation_policy_id = self.escalation_policy_id - repeat: Union[None, bool] + repeat: None | bool repeat = self.repeat - repeat_count: Union[None, int] + repeat_count: None | int repeat_count = self.repeat_count - path_type: Union[Unset, str] = UNSET + path_type: Unset | str = UNSET if not isinstance(self.path_type, Unset): path_type = self.path_type - after_deferral_behavior: Union[Unset, str] = UNSET + after_deferral_behavior: Unset | str = UNSET if not isinstance(self.after_deferral_behavior, Unset): after_deferral_behavior = self.after_deferral_behavior - after_deferral_path_id: Union[None, Unset, str] + after_deferral_path_id: None | Unset | str if isinstance(self.after_deferral_path_id, Unset): after_deferral_path_id = UNSET else: after_deferral_path_id = self.after_deferral_path_id - match_mode: Union[Unset, str] = UNSET + match_mode: Unset | str = UNSET if not isinstance(self.match_mode, Unset): match_mode = self.match_mode @@ -205,7 +205,7 @@ def to_dict(self) -> dict[str, Any]: initial_delay = self.initial_delay - retrigger_timeout_minutes: Union[None, Unset, int] + retrigger_timeout_minutes: None | Unset | int if isinstance(self.retrigger_timeout_minutes, Unset): retrigger_timeout_minutes = UNSET else: @@ -215,7 +215,7 @@ def to_dict(self) -> dict[str, Any]: updated_at = self.updated_at - rules: Union[Unset, list[dict[str, Any]]] = UNSET + rules: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.rules, Unset): rules = [] for rules_item_data in self.rules: @@ -271,11 +271,11 @@ def to_dict(self) -> dict[str, Any]: rules.append(rules_item) - time_restriction_time_zone: Union[Unset, str] = UNSET + time_restriction_time_zone: Unset | str = UNSET if not isinstance(self.time_restriction_time_zone, Unset): time_restriction_time_zone = self.time_restriction_time_zone - time_restrictions: Union[Unset, list[dict[str, Any]]] = UNSET + time_restrictions: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.time_restrictions, Unset): time_restrictions = [] for time_restrictions_item_data in self.time_restrictions: @@ -358,45 +358,45 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: escalation_policy_id = d.pop("escalation_policy_id") - def _parse_repeat(data: object) -> Union[None, bool]: + def _parse_repeat(data: object) -> None | bool: if data is None: return data - return cast(Union[None, bool], data) + return cast(None | bool, data) repeat = _parse_repeat(d.pop("repeat")) - def _parse_repeat_count(data: object) -> Union[None, int]: + def _parse_repeat_count(data: object) -> None | int: if data is None: return data - return cast(Union[None, int], data) + return cast(None | int, data) repeat_count = _parse_repeat_count(d.pop("repeat_count")) _path_type = d.pop("path_type", UNSET) - path_type: Union[Unset, EscalationPolicyPathPathType] + path_type: Unset | EscalationPolicyPathPathType if isinstance(_path_type, Unset): path_type = UNSET else: path_type = check_escalation_policy_path_path_type(_path_type) _after_deferral_behavior = d.pop("after_deferral_behavior", UNSET) - after_deferral_behavior: Union[Unset, EscalationPolicyPathAfterDeferralBehavior] + after_deferral_behavior: Unset | EscalationPolicyPathAfterDeferralBehavior if isinstance(_after_deferral_behavior, Unset): after_deferral_behavior = UNSET else: after_deferral_behavior = check_escalation_policy_path_after_deferral_behavior(_after_deferral_behavior) - def _parse_after_deferral_path_id(data: object) -> Union[None, Unset, str]: + def _parse_after_deferral_path_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) after_deferral_path_id = _parse_after_deferral_path_id(d.pop("after_deferral_path_id", UNSET)) _match_mode = d.pop("match_mode", UNSET) - match_mode: Union[Unset, EscalationPolicyPathMatchMode] + match_mode: Unset | EscalationPolicyPathMatchMode if isinstance(_match_mode, Unset): match_mode = UNSET else: @@ -406,12 +406,12 @@ def _parse_after_deferral_path_id(data: object) -> Union[None, Unset, str]: initial_delay = d.pop("initial_delay", UNSET) - def _parse_retrigger_timeout_minutes(data: object) -> Union[None, Unset, int]: + def _parse_retrigger_timeout_minutes(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) retrigger_timeout_minutes = _parse_retrigger_timeout_minutes(d.pop("retrigger_timeout_minutes", UNSET)) @@ -646,7 +646,7 @@ def _parse_rules_item( rules.append(rules_item) _time_restriction_time_zone = d.pop("time_restriction_time_zone", UNSET) - time_restriction_time_zone: Union[Unset, EscalationPolicyPathTimeRestrictionTimeZone] + time_restriction_time_zone: Unset | EscalationPolicyPathTimeRestrictionTimeZone if isinstance(_time_restriction_time_zone, Unset): time_restriction_time_zone = UNSET else: diff --git a/rootly_sdk/models/escalation_policy_path_list.py b/rootly_sdk/models/escalation_policy_path_list.py index d54509fd..2ce01f9c 100644 --- a/rootly_sdk/models/escalation_policy_path_list.py +++ b/rootly_sdk/models/escalation_policy_path_list.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,7 +29,7 @@ class EscalationPolicyPathList: data: list["EscalationPolicyPathListDataItem"] links: "Links" meta: "Meta" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/escalation_policy_path_response.py b/rootly_sdk/models/escalation_policy_path_response.py index faaab210..4715e25f 100644 --- a/rootly_sdk/models/escalation_policy_path_response.py +++ b/rootly_sdk/models/escalation_policy_path_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,13 +23,13 @@ class EscalationPolicyPathResponse: """ data: "EscalationPolicyPathResponseData" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/escalation_policy_path_response_data.py b/rootly_sdk/models/escalation_policy_path_response_data.py index 1417198b..18916f6d 100644 --- a/rootly_sdk/models/escalation_policy_path_response_data.py +++ b/rootly_sdk/models/escalation_policy_path_response_data.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -28,7 +28,7 @@ class EscalationPolicyPathResponseData: id: str attributes: "EscalationPolicyPath" - type_: Union[Unset, EscalationPolicyPathResponseDataType] = UNSET + type_: Unset | EscalationPolicyPathResponseDataType = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -36,7 +36,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() - type_: Union[Unset, str] = UNSET + type_: Unset | str = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ @@ -63,7 +63,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = EscalationPolicyPath.from_dict(d.pop("attributes")) _type_ = d.pop("type", UNSET) - type_: Union[Unset, EscalationPolicyPathResponseDataType] + type_: Unset | EscalationPolicyPathResponseDataType if isinstance(_type_, Unset): type_ = UNSET else: diff --git a/rootly_sdk/models/escalation_policy_path_rules_item_type_2.py b/rootly_sdk/models/escalation_policy_path_rules_item_type_2.py index 341a688b..567cf452 100644 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_2.py +++ b/rootly_sdk/models/escalation_policy_path_rules_item_type_2.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -31,8 +31,8 @@ class EscalationPolicyPathRulesItemType2: rule_type: EscalationPolicyPathRulesItemType2RuleType json_path: str operator: EscalationPolicyPathRulesItemType2Operator - value: Union[None, Unset, str] = UNSET - values: Union[Unset, list[str]] = UNSET + value: None | Unset | str = UNSET + values: Unset | list[str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,13 +42,13 @@ def to_dict(self) -> dict[str, Any]: operator: str = self.operator - value: Union[None, Unset, str] + value: None | Unset | str if isinstance(self.value, Unset): value = UNSET else: value = self.value - values: Union[Unset, list[str]] = UNSET + values: Unset | list[str] = UNSET if not isinstance(self.values, Unset): values = self.values @@ -77,12 +77,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: operator = check_escalation_policy_path_rules_item_type_2_operator(d.pop("operator")) - def _parse_value(data: object) -> Union[None, Unset, str]: + def _parse_value(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) value = _parse_value(d.pop("value", UNSET)) diff --git a/rootly_sdk/models/escalation_policy_path_rules_item_type_3.py b/rootly_sdk/models/escalation_policy_path_rules_item_type_3.py index 2774cb75..3ed06c03 100644 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_3.py +++ b/rootly_sdk/models/escalation_policy_path_rules_item_type_3.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -32,7 +32,7 @@ class EscalationPolicyPathRulesItemType3: fieldable_type: str fieldable_id: str operator: EscalationPolicyPathRulesItemType3Operator - values: Union[Unset, list[str]] = UNSET + values: Unset | list[str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -44,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: operator: str = self.operator - values: Union[Unset, list[str]] = UNSET + values: Unset | list[str] = UNSET if not isinstance(self.values, Unset): values = self.values diff --git a/rootly_sdk/models/escalation_policy_path_rules_item_type_5_time_blocks_item.py b/rootly_sdk/models/escalation_policy_path_rules_item_type_5_time_blocks_item.py index 8a295592..4f035199 100644 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_5_time_blocks_item.py +++ b/rootly_sdk/models/escalation_policy_path_rules_item_type_5_time_blocks_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -26,17 +26,17 @@ class EscalationPolicyPathRulesItemType5TimeBlocksItem: position (Union[None, Unset, int]): """ - monday: Union[Unset, bool] = False - tuesday: Union[Unset, bool] = False - wednesday: Union[Unset, bool] = False - thursday: Union[Unset, bool] = False - friday: Union[Unset, bool] = False - saturday: Union[Unset, bool] = False - sunday: Union[Unset, bool] = False - start_time: Union[Unset, str] = UNSET - end_time: Union[Unset, str] = UNSET - all_day: Union[Unset, bool] = False - position: Union[None, Unset, int] = UNSET + monday: Unset | bool = False + tuesday: Unset | bool = False + wednesday: Unset | bool = False + thursday: Unset | bool = False + friday: Unset | bool = False + saturday: Unset | bool = False + sunday: Unset | bool = False + start_time: Unset | str = UNSET + end_time: Unset | str = UNSET + all_day: Unset | bool = False + position: None | Unset | int = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -60,7 +60,7 @@ def to_dict(self) -> dict[str, Any]: all_day = self.all_day - position: Union[None, Unset, int] + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: @@ -117,12 +117,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: all_day = d.pop("all_day", UNSET) - def _parse_position(data: object) -> Union[None, Unset, int]: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) diff --git a/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_2.py b/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_2.py index 34fc5c39..da128c49 100644 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_2.py +++ b/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_2.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -31,8 +31,8 @@ class EscalationPolicyPathRulesItemType8Type2: rule_type: EscalationPolicyPathRulesItemType8Type2RuleType json_path: str operator: EscalationPolicyPathRulesItemType8Type2Operator - value: Union[None, Unset, str] = UNSET - values: Union[Unset, list[str]] = UNSET + value: None | Unset | str = UNSET + values: Unset | list[str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,13 +42,13 @@ def to_dict(self) -> dict[str, Any]: operator: str = self.operator - value: Union[None, Unset, str] + value: None | Unset | str if isinstance(self.value, Unset): value = UNSET else: value = self.value - values: Union[Unset, list[str]] = UNSET + values: Unset | list[str] = UNSET if not isinstance(self.values, Unset): values = self.values @@ -77,12 +77,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: operator = check_escalation_policy_path_rules_item_type_8_type_2_operator(d.pop("operator")) - def _parse_value(data: object) -> Union[None, Unset, str]: + def _parse_value(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) value = _parse_value(d.pop("value", UNSET)) diff --git a/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_3.py b/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_3.py index 6641c227..a632ce68 100644 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_3.py +++ b/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_3.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -32,7 +32,7 @@ class EscalationPolicyPathRulesItemType8Type3: fieldable_type: str fieldable_id: str operator: EscalationPolicyPathRulesItemType8Type3Operator - values: Union[Unset, list[str]] = UNSET + values: Unset | list[str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -44,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: operator: str = self.operator - values: Union[Unset, list[str]] = UNSET + values: Unset | list[str] = UNSET if not isinstance(self.values, Unset): values = self.values diff --git a/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_5_time_blocks_item.py b/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_5_time_blocks_item.py index 71fc93b1..98a58ca4 100644 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_5_time_blocks_item.py +++ b/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_5_time_blocks_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -26,17 +26,17 @@ class EscalationPolicyPathRulesItemType8Type5TimeBlocksItem: position (Union[None, Unset, int]): """ - monday: Union[Unset, bool] = False - tuesday: Union[Unset, bool] = False - wednesday: Union[Unset, bool] = False - thursday: Union[Unset, bool] = False - friday: Union[Unset, bool] = False - saturday: Union[Unset, bool] = False - sunday: Union[Unset, bool] = False - start_time: Union[Unset, str] = UNSET - end_time: Union[Unset, str] = UNSET - all_day: Union[Unset, bool] = False - position: Union[None, Unset, int] = UNSET + monday: Unset | bool = False + tuesday: Unset | bool = False + wednesday: Unset | bool = False + thursday: Unset | bool = False + friday: Unset | bool = False + saturday: Unset | bool = False + sunday: Unset | bool = False + start_time: Unset | str = UNSET + end_time: Unset | str = UNSET + all_day: Unset | bool = False + position: None | Unset | int = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -60,7 +60,7 @@ def to_dict(self) -> dict[str, Any]: all_day = self.all_day - position: Union[None, Unset, int] + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: @@ -117,12 +117,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: all_day = d.pop("all_day", UNSET) - def _parse_position(data: object) -> Union[None, Unset, int]: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) diff --git a/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_2.py b/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_2.py index 39b9fb39..6e441992 100644 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_2.py +++ b/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_2.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -31,8 +31,8 @@ class EscalationPolicyPathRulesItemType9Type2: rule_type: EscalationPolicyPathRulesItemType9Type2RuleType json_path: str operator: EscalationPolicyPathRulesItemType9Type2Operator - value: Union[None, Unset, str] = UNSET - values: Union[Unset, list[str]] = UNSET + value: None | Unset | str = UNSET + values: Unset | list[str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,13 +42,13 @@ def to_dict(self) -> dict[str, Any]: operator: str = self.operator - value: Union[None, Unset, str] + value: None | Unset | str if isinstance(self.value, Unset): value = UNSET else: value = self.value - values: Union[Unset, list[str]] = UNSET + values: Unset | list[str] = UNSET if not isinstance(self.values, Unset): values = self.values @@ -77,12 +77,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: operator = check_escalation_policy_path_rules_item_type_9_type_2_operator(d.pop("operator")) - def _parse_value(data: object) -> Union[None, Unset, str]: + def _parse_value(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) value = _parse_value(d.pop("value", UNSET)) diff --git a/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_3.py b/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_3.py index da1b85d9..5f33ce05 100644 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_3.py +++ b/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_3.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -32,7 +32,7 @@ class EscalationPolicyPathRulesItemType9Type3: fieldable_type: str fieldable_id: str operator: EscalationPolicyPathRulesItemType9Type3Operator - values: Union[Unset, list[str]] = UNSET + values: Unset | list[str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -44,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: operator: str = self.operator - values: Union[Unset, list[str]] = UNSET + values: Unset | list[str] = UNSET if not isinstance(self.values, Unset): values = self.values diff --git a/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_5_time_blocks_item.py b/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_5_time_blocks_item.py index 179c7129..a369c539 100644 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_5_time_blocks_item.py +++ b/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_5_time_blocks_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -26,17 +26,17 @@ class EscalationPolicyPathRulesItemType9Type5TimeBlocksItem: position (Union[None, Unset, int]): """ - monday: Union[Unset, bool] = False - tuesday: Union[Unset, bool] = False - wednesday: Union[Unset, bool] = False - thursday: Union[Unset, bool] = False - friday: Union[Unset, bool] = False - saturday: Union[Unset, bool] = False - sunday: Union[Unset, bool] = False - start_time: Union[Unset, str] = UNSET - end_time: Union[Unset, str] = UNSET - all_day: Union[Unset, bool] = False - position: Union[None, Unset, int] = UNSET + monday: Unset | bool = False + tuesday: Unset | bool = False + wednesday: Unset | bool = False + thursday: Unset | bool = False + friday: Unset | bool = False + saturday: Unset | bool = False + sunday: Unset | bool = False + start_time: Unset | str = UNSET + end_time: Unset | str = UNSET + all_day: Unset | bool = False + position: None | Unset | int = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -60,7 +60,7 @@ def to_dict(self) -> dict[str, Any]: all_day = self.all_day - position: Union[None, Unset, int] + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: @@ -117,12 +117,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: all_day = d.pop("all_day", UNSET) - def _parse_position(data: object) -> Union[None, Unset, int]: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) diff --git a/rootly_sdk/models/escalation_policy_path_time_restrictions_item.py b/rootly_sdk/models/escalation_policy_path_time_restrictions_item.py index a5c85c16..789ccb5f 100644 --- a/rootly_sdk/models/escalation_policy_path_time_restrictions_item.py +++ b/rootly_sdk/models/escalation_policy_path_time_restrictions_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -27,20 +27,20 @@ class EscalationPolicyPathTimeRestrictionsItem: end_time (Union[Unset, str]): Formatted as HH:MM """ - start_day: Union[Unset, EscalationPolicyPathTimeRestrictionsItemStartDay] = UNSET - start_time: Union[Unset, str] = UNSET - end_day: Union[Unset, EscalationPolicyPathTimeRestrictionsItemEndDay] = UNSET - end_time: Union[Unset, str] = UNSET + start_day: Unset | EscalationPolicyPathTimeRestrictionsItemStartDay = UNSET + start_time: Unset | str = UNSET + end_day: Unset | EscalationPolicyPathTimeRestrictionsItemEndDay = UNSET + end_time: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - start_day: Union[Unset, str] = UNSET + start_day: Unset | str = UNSET if not isinstance(self.start_day, Unset): start_day = self.start_day start_time = self.start_time - end_day: Union[Unset, str] = UNSET + end_day: Unset | str = UNSET if not isinstance(self.end_day, Unset): end_day = self.end_day @@ -64,7 +64,7 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _start_day = d.pop("start_day", UNSET) - start_day: Union[Unset, EscalationPolicyPathTimeRestrictionsItemStartDay] + start_day: Unset | EscalationPolicyPathTimeRestrictionsItemStartDay if isinstance(_start_day, Unset): start_day = UNSET else: @@ -73,7 +73,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: start_time = d.pop("start_time", UNSET) _end_day = d.pop("end_day", UNSET) - end_day: Union[Unset, EscalationPolicyPathTimeRestrictionsItemEndDay] + end_day: Unset | EscalationPolicyPathTimeRestrictionsItemEndDay if isinstance(_end_day, Unset): end_day = UNSET else: diff --git a/rootly_sdk/models/escalation_policy_response.py b/rootly_sdk/models/escalation_policy_response.py index c7c3f21c..a6804191 100644 --- a/rootly_sdk/models/escalation_policy_response.py +++ b/rootly_sdk/models/escalation_policy_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,13 +23,13 @@ class EscalationPolicyResponse: """ data: "EscalationPolicyResponseData" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/form_field.py b/rootly_sdk/models/form_field.py index 88fbe7c6..61e4bb5e 100644 --- a/rootly_sdk/models/form_field.py +++ b/rootly_sdk/models/form_field.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -45,13 +45,13 @@ class FormField: default_values: list[str] created_at: str updated_at: str - value_kind_catalog_id: Union[None, Unset, str] = UNSET - slug: Union[Unset, str] = UNSET - resource_type: Union[Unset, FormFieldResourceType] = UNSET - description: Union[None, Unset, str] = UNSET - show_on_incident_details: Union[Unset, bool] = UNSET - enabled: Union[Unset, bool] = UNSET - auto_set_by_catalog_property_id: Union[None, Unset, str] = UNSET + value_kind_catalog_id: None | Unset | str = UNSET + slug: Unset | str = UNSET + resource_type: Unset | FormFieldResourceType = UNSET + description: None | Unset | str = UNSET + show_on_incident_details: Unset | bool = UNSET + enabled: Unset | bool = UNSET + auto_set_by_catalog_property_id: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -73,7 +73,7 @@ def to_dict(self) -> dict[str, Any]: updated_at = self.updated_at - value_kind_catalog_id: Union[None, Unset, str] + value_kind_catalog_id: None | Unset | str if isinstance(self.value_kind_catalog_id, Unset): value_kind_catalog_id = UNSET else: @@ -81,11 +81,11 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - resource_type: Union[Unset, str] = UNSET + resource_type: Unset | str = UNSET if not isinstance(self.resource_type, Unset): resource_type = self.resource_type - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: @@ -95,7 +95,7 @@ def to_dict(self) -> dict[str, Any]: enabled = self.enabled - auto_set_by_catalog_property_id: Union[None, Unset, str] + auto_set_by_catalog_property_id: None | Unset | str if isinstance(self.auto_set_by_catalog_property_id, Unset): auto_set_by_catalog_property_id = UNSET else: @@ -154,30 +154,30 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: updated_at = d.pop("updated_at") - def _parse_value_kind_catalog_id(data: object) -> Union[None, Unset, str]: + def _parse_value_kind_catalog_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) value_kind_catalog_id = _parse_value_kind_catalog_id(d.pop("value_kind_catalog_id", UNSET)) slug = d.pop("slug", UNSET) _resource_type = d.pop("resource_type", UNSET) - resource_type: Union[Unset, FormFieldResourceType] + resource_type: Unset | FormFieldResourceType if isinstance(_resource_type, Unset): resource_type = UNSET else: resource_type = check_form_field_resource_type(_resource_type) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) @@ -185,12 +185,12 @@ def _parse_description(data: object) -> Union[None, Unset, str]: enabled = d.pop("enabled", UNSET) - def _parse_auto_set_by_catalog_property_id(data: object) -> Union[None, Unset, str]: + def _parse_auto_set_by_catalog_property_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) auto_set_by_catalog_property_id = _parse_auto_set_by_catalog_property_id( d.pop("auto_set_by_catalog_property_id", UNSET) diff --git a/rootly_sdk/models/form_field_list.py b/rootly_sdk/models/form_field_list.py index d9ce56cc..62e11107 100644 --- a/rootly_sdk/models/form_field_list.py +++ b/rootly_sdk/models/form_field_list.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,7 +29,7 @@ class FormFieldList: data: list["FormFieldListDataItem"] links: "Links" meta: "Meta" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/form_field_option.py b/rootly_sdk/models/form_field_option.py index 9b5587c7..c5a5b667 100644 --- a/rootly_sdk/models/form_field_option.py +++ b/rootly_sdk/models/form_field_option.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -28,9 +28,9 @@ class FormFieldOption: position: int created_at: str updated_at: str - id: Union[Unset, str] = UNSET - form_field_id: Union[Unset, str] = UNSET - default: Union[Unset, bool] = UNSET + id: Unset | str = UNSET + form_field_id: Unset | str = UNSET + default: Unset | bool = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/form_field_option_list.py b/rootly_sdk/models/form_field_option_list.py index a7fad052..0df3186c 100644 --- a/rootly_sdk/models/form_field_option_list.py +++ b/rootly_sdk/models/form_field_option_list.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,7 +29,7 @@ class FormFieldOptionList: data: list["FormFieldOptionListDataItem"] links: "Links" meta: "Meta" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/form_field_option_response.py b/rootly_sdk/models/form_field_option_response.py index d5626af5..7693a9f7 100644 --- a/rootly_sdk/models/form_field_option_response.py +++ b/rootly_sdk/models/form_field_option_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,13 +23,13 @@ class FormFieldOptionResponse: """ data: "FormFieldOptionResponseData" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/form_field_placement.py b/rootly_sdk/models/form_field_placement.py index 0ea3e48f..56b64baf 100644 --- a/rootly_sdk/models/form_field_placement.py +++ b/rootly_sdk/models/form_field_placement.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -39,9 +39,9 @@ class FormFieldPlacement: form: str position: int required: bool - required_operator: Union[Unset, FormFieldPlacementRequiredOperator] = UNSET - placement_operator: Union[Unset, FormFieldPlacementPlacementOperator] = UNSET - non_editable: Union[Unset, bool] = UNSET + required_operator: Unset | FormFieldPlacementRequiredOperator = UNSET + placement_operator: Unset | FormFieldPlacementPlacementOperator = UNSET + non_editable: Unset | bool = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -55,11 +55,11 @@ def to_dict(self) -> dict[str, Any]: required = self.required - required_operator: Union[Unset, str] = UNSET + required_operator: Unset | str = UNSET if not isinstance(self.required_operator, Unset): required_operator = self.required_operator - placement_operator: Union[Unset, str] = UNSET + placement_operator: Unset | str = UNSET if not isinstance(self.placement_operator, Unset): placement_operator = self.placement_operator @@ -99,14 +99,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: required = d.pop("required") _required_operator = d.pop("required_operator", UNSET) - required_operator: Union[Unset, FormFieldPlacementRequiredOperator] + required_operator: Unset | FormFieldPlacementRequiredOperator if isinstance(_required_operator, Unset): required_operator = UNSET else: required_operator = check_form_field_placement_required_operator(_required_operator) _placement_operator = d.pop("placement_operator", UNSET) - placement_operator: Union[Unset, FormFieldPlacementPlacementOperator] + placement_operator: Unset | FormFieldPlacementPlacementOperator if isinstance(_placement_operator, Unset): placement_operator = UNSET else: diff --git a/rootly_sdk/models/form_field_placement_condition_list.py b/rootly_sdk/models/form_field_placement_condition_list.py index e1af6e80..fc68a3af 100644 --- a/rootly_sdk/models/form_field_placement_condition_list.py +++ b/rootly_sdk/models/form_field_placement_condition_list.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,7 +29,7 @@ class FormFieldPlacementConditionList: data: list["FormFieldPlacementConditionListDataItem"] links: "Links" meta: "Meta" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/form_field_placement_condition_response.py b/rootly_sdk/models/form_field_placement_condition_response.py index fade16d6..f781783b 100644 --- a/rootly_sdk/models/form_field_placement_condition_response.py +++ b/rootly_sdk/models/form_field_placement_condition_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,13 +23,13 @@ class FormFieldPlacementConditionResponse: """ data: "FormFieldPlacementConditionResponseData" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/form_field_placement_list.py b/rootly_sdk/models/form_field_placement_list.py index 3c124396..4a2d176b 100644 --- a/rootly_sdk/models/form_field_placement_list.py +++ b/rootly_sdk/models/form_field_placement_list.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,7 +29,7 @@ class FormFieldPlacementList: data: list["FormFieldPlacementListDataItem"] links: "Links" meta: "Meta" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/form_field_placement_response.py b/rootly_sdk/models/form_field_placement_response.py index 91b6be49..8181d071 100644 --- a/rootly_sdk/models/form_field_placement_response.py +++ b/rootly_sdk/models/form_field_placement_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,13 +23,13 @@ class FormFieldPlacementResponse: """ data: "FormFieldPlacementResponseData" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/form_field_position_list.py b/rootly_sdk/models/form_field_position_list.py index b88186e0..2b2b0ecf 100644 --- a/rootly_sdk/models/form_field_position_list.py +++ b/rootly_sdk/models/form_field_position_list.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,7 +29,7 @@ class FormFieldPositionList: data: list["FormFieldPositionListDataItem"] links: "Links" meta: "Meta" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/form_field_position_response.py b/rootly_sdk/models/form_field_position_response.py index c29d22b0..ae3d2a61 100644 --- a/rootly_sdk/models/form_field_position_response.py +++ b/rootly_sdk/models/form_field_position_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,13 +23,13 @@ class FormFieldPositionResponse: """ data: "FormFieldPositionResponseData" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/form_field_response.py b/rootly_sdk/models/form_field_response.py index 3a5e0c31..3bdf968b 100644 --- a/rootly_sdk/models/form_field_response.py +++ b/rootly_sdk/models/form_field_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,13 +23,13 @@ class FormFieldResponse: """ data: "FormFieldResponseData" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/form_set.py b/rootly_sdk/models/form_set.py index 06a2c575..bfa1ffaa 100644 --- a/rootly_sdk/models/form_set.py +++ b/rootly_sdk/models/form_set.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -33,7 +33,7 @@ class FormSet: forms: list[str] created_at: str updated_at: str - slug: Union[Unset, str] = UNSET + slug: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/form_set_condition_list.py b/rootly_sdk/models/form_set_condition_list.py index 47b4c827..8d87b92e 100644 --- a/rootly_sdk/models/form_set_condition_list.py +++ b/rootly_sdk/models/form_set_condition_list.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,7 +29,7 @@ class FormSetConditionList: data: list["FormSetConditionListDataItem"] links: "Links" meta: "Meta" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/form_set_condition_response.py b/rootly_sdk/models/form_set_condition_response.py index 5fe98304..2534ba03 100644 --- a/rootly_sdk/models/form_set_condition_response.py +++ b/rootly_sdk/models/form_set_condition_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,13 +23,13 @@ class FormSetConditionResponse: """ data: "FormSetConditionResponseData" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/form_set_list.py b/rootly_sdk/models/form_set_list.py index 772d6ca0..cd9fdf90 100644 --- a/rootly_sdk/models/form_set_list.py +++ b/rootly_sdk/models/form_set_list.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,7 +29,7 @@ class FormSetList: data: list["FormSetListDataItem"] links: "Links" meta: "Meta" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/form_set_response.py b/rootly_sdk/models/form_set_response.py index 06b688d9..318e9a40 100644 --- a/rootly_sdk/models/form_set_response.py +++ b/rootly_sdk/models/form_set_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,13 +23,13 @@ class FormSetResponse: """ data: "FormSetResponseData" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/functionality.py b/rootly_sdk/models/functionality.py index 2930af54..3bb6db57 100644 --- a/rootly_sdk/models/functionality.py +++ b/rootly_sdk/models/functionality.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -55,28 +55,28 @@ class Functionality: name: str created_at: str updated_at: str - slug: Union[Unset, str] = UNSET - managed_by: Union[Unset, FunctionalityManagedBy] = UNSET - description: Union[None, Unset, str] = UNSET - public_description: Union[None, Unset, str] = UNSET - notify_emails: Union[None, Unset, list[str]] = UNSET - color: Union[None, Unset, str] = UNSET - backstage_id: Union[None, Unset, str] = UNSET - external_id: Union[None, Unset, str] = UNSET - pagerduty_id: Union[None, Unset, str] = UNSET - opsgenie_id: Union[None, Unset, str] = UNSET - opsgenie_team_id: Union[None, Unset, str] = UNSET - cortex_id: Union[None, Unset, str] = UNSET - service_now_ci_sys_id: Union[None, Unset, str] = UNSET - position: Union[None, Unset, int] = UNSET - environment_ids: Union[None, Unset, list[str]] = UNSET - service_ids: Union[None, Unset, list[str]] = UNSET - owner_group_ids: Union[None, Unset, list[str]] = UNSET - owner_user_ids: Union[None, Unset, list[int]] = UNSET - escalation_policy_id: Union[None, Unset, str] = UNSET - slack_channels: Union[None, Unset, list["FunctionalitySlackChannelsType0Item"]] = UNSET - slack_aliases: Union[None, Unset, list["FunctionalitySlackAliasesType0Item"]] = UNSET - properties: Union[None, Unset, list["FunctionalityPropertiesType0Item"]] = UNSET + slug: Unset | str = UNSET + managed_by: Unset | FunctionalityManagedBy = UNSET + description: None | Unset | str = UNSET + public_description: None | Unset | str = UNSET + notify_emails: None | Unset | list[str] = UNSET + color: None | Unset | str = UNSET + backstage_id: None | Unset | str = UNSET + external_id: None | Unset | str = UNSET + pagerduty_id: None | Unset | str = UNSET + opsgenie_id: None | Unset | str = UNSET + opsgenie_team_id: None | Unset | str = UNSET + cortex_id: None | Unset | str = UNSET + service_now_ci_sys_id: None | Unset | str = UNSET + position: None | Unset | int = UNSET + environment_ids: None | Unset | list[str] = UNSET + service_ids: None | Unset | list[str] = UNSET + owner_group_ids: None | Unset | list[str] = UNSET + owner_user_ids: None | Unset | list[int] = UNSET + escalation_policy_id: None | Unset | str = UNSET + slack_channels: None | Unset | list["FunctionalitySlackChannelsType0Item"] = UNSET + slack_aliases: None | Unset | list["FunctionalitySlackAliasesType0Item"] = UNSET + properties: None | Unset | list["FunctionalityPropertiesType0Item"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -88,23 +88,23 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - managed_by: Union[Unset, str] = UNSET + managed_by: Unset | str = UNSET if not isinstance(self.managed_by, Unset): managed_by = self.managed_by - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - public_description: Union[None, Unset, str] + public_description: None | Unset | str if isinstance(self.public_description, Unset): public_description = UNSET else: public_description = self.public_description - notify_emails: Union[None, Unset, list[str]] + notify_emails: None | Unset | list[str] if isinstance(self.notify_emails, Unset): notify_emails = UNSET elif isinstance(self.notify_emails, list): @@ -113,61 +113,61 @@ def to_dict(self) -> dict[str, Any]: else: notify_emails = self.notify_emails - color: Union[None, Unset, str] + color: None | Unset | str if isinstance(self.color, Unset): color = UNSET else: color = self.color - backstage_id: Union[None, Unset, str] + backstage_id: None | Unset | str if isinstance(self.backstage_id, Unset): backstage_id = UNSET else: backstage_id = self.backstage_id - external_id: Union[None, Unset, str] + external_id: None | Unset | str if isinstance(self.external_id, Unset): external_id = UNSET else: external_id = self.external_id - pagerduty_id: Union[None, Unset, str] + pagerduty_id: None | Unset | str if isinstance(self.pagerduty_id, Unset): pagerduty_id = UNSET else: pagerduty_id = self.pagerduty_id - opsgenie_id: Union[None, Unset, str] + opsgenie_id: None | Unset | str if isinstance(self.opsgenie_id, Unset): opsgenie_id = UNSET else: opsgenie_id = self.opsgenie_id - opsgenie_team_id: Union[None, Unset, str] + opsgenie_team_id: None | Unset | str if isinstance(self.opsgenie_team_id, Unset): opsgenie_team_id = UNSET else: opsgenie_team_id = self.opsgenie_team_id - cortex_id: Union[None, Unset, str] + cortex_id: None | Unset | str if isinstance(self.cortex_id, Unset): cortex_id = UNSET else: cortex_id = self.cortex_id - service_now_ci_sys_id: Union[None, Unset, str] + service_now_ci_sys_id: None | Unset | str if isinstance(self.service_now_ci_sys_id, Unset): service_now_ci_sys_id = UNSET else: service_now_ci_sys_id = self.service_now_ci_sys_id - position: Union[None, Unset, int] + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: position = self.position - environment_ids: Union[None, Unset, list[str]] + environment_ids: None | Unset | list[str] if isinstance(self.environment_ids, Unset): environment_ids = UNSET elif isinstance(self.environment_ids, list): @@ -176,7 +176,7 @@ def to_dict(self) -> dict[str, Any]: else: environment_ids = self.environment_ids - service_ids: Union[None, Unset, list[str]] + service_ids: None | Unset | list[str] if isinstance(self.service_ids, Unset): service_ids = UNSET elif isinstance(self.service_ids, list): @@ -185,7 +185,7 @@ def to_dict(self) -> dict[str, Any]: else: service_ids = self.service_ids - owner_group_ids: Union[None, Unset, list[str]] + owner_group_ids: None | Unset | list[str] if isinstance(self.owner_group_ids, Unset): owner_group_ids = UNSET elif isinstance(self.owner_group_ids, list): @@ -194,7 +194,7 @@ def to_dict(self) -> dict[str, Any]: else: owner_group_ids = self.owner_group_ids - owner_user_ids: Union[None, Unset, list[int]] + owner_user_ids: None | Unset | list[int] if isinstance(self.owner_user_ids, Unset): owner_user_ids = UNSET elif isinstance(self.owner_user_ids, list): @@ -203,13 +203,13 @@ def to_dict(self) -> dict[str, Any]: else: owner_user_ids = self.owner_user_ids - escalation_policy_id: Union[None, Unset, str] + escalation_policy_id: None | Unset | str if isinstance(self.escalation_policy_id, Unset): escalation_policy_id = UNSET else: escalation_policy_id = self.escalation_policy_id - slack_channels: Union[None, Unset, list[dict[str, Any]]] + slack_channels: None | Unset | list[dict[str, Any]] if isinstance(self.slack_channels, Unset): slack_channels = UNSET elif isinstance(self.slack_channels, list): @@ -221,7 +221,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_channels = self.slack_channels - slack_aliases: Union[None, Unset, list[dict[str, Any]]] + slack_aliases: None | Unset | list[dict[str, Any]] if isinstance(self.slack_aliases, Unset): slack_aliases = UNSET elif isinstance(self.slack_aliases, list): @@ -233,7 +233,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_aliases = self.slack_aliases - properties: Union[None, Unset, list[dict[str, Any]]] + properties: None | Unset | list[dict[str, Any]] if isinstance(self.properties, Unset): properties = UNSET elif isinstance(self.properties, list): @@ -317,31 +317,31 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: slug = d.pop("slug", UNSET) _managed_by = d.pop("managed_by", UNSET) - managed_by: Union[Unset, FunctionalityManagedBy] + managed_by: Unset | FunctionalityManagedBy if isinstance(_managed_by, Unset): managed_by = UNSET else: managed_by = check_functionality_managed_by(_managed_by) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_public_description(data: object) -> Union[None, Unset, str]: + def _parse_public_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) public_description = _parse_public_description(d.pop("public_description", UNSET)) - def _parse_notify_emails(data: object) -> Union[None, Unset, list[str]]: + def _parse_notify_emails(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -354,92 +354,92 @@ def _parse_notify_emails(data: object) -> Union[None, Unset, list[str]]: return notify_emails_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) notify_emails = _parse_notify_emails(d.pop("notify_emails", UNSET)) - def _parse_color(data: object) -> Union[None, Unset, str]: + def _parse_color(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) color = _parse_color(d.pop("color", UNSET)) - def _parse_backstage_id(data: object) -> Union[None, Unset, str]: + def _parse_backstage_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) backstage_id = _parse_backstage_id(d.pop("backstage_id", UNSET)) - def _parse_external_id(data: object) -> Union[None, Unset, str]: + def _parse_external_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) external_id = _parse_external_id(d.pop("external_id", UNSET)) - def _parse_pagerduty_id(data: object) -> Union[None, Unset, str]: + def _parse_pagerduty_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) pagerduty_id = _parse_pagerduty_id(d.pop("pagerduty_id", UNSET)) - def _parse_opsgenie_id(data: object) -> Union[None, Unset, str]: + def _parse_opsgenie_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) opsgenie_id = _parse_opsgenie_id(d.pop("opsgenie_id", UNSET)) - def _parse_opsgenie_team_id(data: object) -> Union[None, Unset, str]: + def _parse_opsgenie_team_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) opsgenie_team_id = _parse_opsgenie_team_id(d.pop("opsgenie_team_id", UNSET)) - def _parse_cortex_id(data: object) -> Union[None, Unset, str]: + def _parse_cortex_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) cortex_id = _parse_cortex_id(d.pop("cortex_id", UNSET)) - def _parse_service_now_ci_sys_id(data: object) -> Union[None, Unset, str]: + def _parse_service_now_ci_sys_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) service_now_ci_sys_id = _parse_service_now_ci_sys_id(d.pop("service_now_ci_sys_id", UNSET)) - def _parse_position(data: object) -> Union[None, Unset, int]: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) - def _parse_environment_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_environment_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -452,11 +452,11 @@ def _parse_environment_ids(data: object) -> Union[None, Unset, list[str]]: return environment_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) environment_ids = _parse_environment_ids(d.pop("environment_ids", UNSET)) - def _parse_service_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_service_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -469,11 +469,11 @@ def _parse_service_ids(data: object) -> Union[None, Unset, list[str]]: return service_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) service_ids = _parse_service_ids(d.pop("service_ids", UNSET)) - def _parse_owner_group_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_owner_group_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -486,11 +486,11 @@ def _parse_owner_group_ids(data: object) -> Union[None, Unset, list[str]]: return owner_group_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) owner_group_ids = _parse_owner_group_ids(d.pop("owner_group_ids", UNSET)) - def _parse_owner_user_ids(data: object) -> Union[None, Unset, list[int]]: + def _parse_owner_user_ids(data: object) -> None | Unset | list[int]: if data is None: return data if isinstance(data, Unset): @@ -503,20 +503,20 @@ def _parse_owner_user_ids(data: object) -> Union[None, Unset, list[int]]: return owner_user_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[int]], data) + return cast(None | Unset | list[int], data) owner_user_ids = _parse_owner_user_ids(d.pop("owner_user_ids", UNSET)) - def _parse_escalation_policy_id(data: object) -> Union[None, Unset, str]: + def _parse_escalation_policy_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) escalation_policy_id = _parse_escalation_policy_id(d.pop("escalation_policy_id", UNSET)) - def _parse_slack_channels(data: object) -> Union[None, Unset, list["FunctionalitySlackChannelsType0Item"]]: + def _parse_slack_channels(data: object) -> None | Unset | list["FunctionalitySlackChannelsType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -536,11 +536,11 @@ def _parse_slack_channels(data: object) -> Union[None, Unset, list["Functionalit return slack_channels_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list["FunctionalitySlackChannelsType0Item"]], data) + return cast(None | Unset | list["FunctionalitySlackChannelsType0Item"], data) slack_channels = _parse_slack_channels(d.pop("slack_channels", UNSET)) - def _parse_slack_aliases(data: object) -> Union[None, Unset, list["FunctionalitySlackAliasesType0Item"]]: + def _parse_slack_aliases(data: object) -> None | Unset | list["FunctionalitySlackAliasesType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -560,11 +560,11 @@ def _parse_slack_aliases(data: object) -> Union[None, Unset, list["Functionality return slack_aliases_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list["FunctionalitySlackAliasesType0Item"]], data) + return cast(None | Unset | list["FunctionalitySlackAliasesType0Item"], data) slack_aliases = _parse_slack_aliases(d.pop("slack_aliases", UNSET)) - def _parse_properties(data: object) -> Union[None, Unset, list["FunctionalityPropertiesType0Item"]]: + def _parse_properties(data: object) -> None | Unset | list["FunctionalityPropertiesType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -582,7 +582,7 @@ def _parse_properties(data: object) -> Union[None, Unset, list["FunctionalityPro return properties_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list["FunctionalityPropertiesType0Item"]], data) + return cast(None | Unset | list["FunctionalityPropertiesType0Item"], data) properties = _parse_properties(d.pop("properties", UNSET)) diff --git a/rootly_sdk/models/functionality_list.py b/rootly_sdk/models/functionality_list.py index a9092a9e..7f3dfca7 100644 --- a/rootly_sdk/models/functionality_list.py +++ b/rootly_sdk/models/functionality_list.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,7 +29,7 @@ class FunctionalityList: data: list["FunctionalityListDataItem"] links: "Links" meta: "Meta" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/functionality_response.py b/rootly_sdk/models/functionality_response.py index 43017ba7..6cbeba67 100644 --- a/rootly_sdk/models/functionality_response.py +++ b/rootly_sdk/models/functionality_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,13 +23,13 @@ class FunctionalityResponse: """ data: "FunctionalityResponseData" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/get_alerts_task_params.py b/rootly_sdk/models/get_alerts_task_params.py index 37821b7f..22f9f5da 100644 --- a/rootly_sdk/models/get_alerts_task_params.py +++ b/rootly_sdk/models/get_alerts_task_params.py @@ -38,38 +38,38 @@ class GetAlertsTaskParams: """ past_duration: str - task_type: Union[Unset, GetAlertsTaskParamsTaskType] = UNSET - service_ids: Union[Unset, list[str]] = UNSET - environment_ids: Union[Unset, list[str]] = UNSET - labels: Union[Unset, list[str]] = UNSET - sources: Union[Unset, list[str]] = UNSET - services_impacted_by_incident: Union[Unset, bool] = UNSET - environments_impacted_by_incident: Union[Unset, bool] = UNSET - post_to_incident_timeline: Union[Unset, bool] = UNSET - post_to_slack_channels: Union[Unset, list["GetAlertsTaskParamsPostToSlackChannelsItem"]] = UNSET + task_type: Unset | GetAlertsTaskParamsTaskType = UNSET + service_ids: Unset | list[str] = UNSET + environment_ids: Unset | list[str] = UNSET + labels: Unset | list[str] = UNSET + sources: Unset | list[str] = UNSET + services_impacted_by_incident: Unset | bool = UNSET + environments_impacted_by_incident: Unset | bool = UNSET + post_to_incident_timeline: Unset | bool = UNSET + post_to_slack_channels: Unset | list["GetAlertsTaskParamsPostToSlackChannelsItem"] = UNSET parent_message_thread_task: Union[Unset, "GetAlertsTaskParamsParentMessageThreadTask"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: past_duration = self.past_duration - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - service_ids: Union[Unset, list[str]] = UNSET + service_ids: Unset | list[str] = UNSET if not isinstance(self.service_ids, Unset): service_ids = self.service_ids - environment_ids: Union[Unset, list[str]] = UNSET + environment_ids: Unset | list[str] = UNSET if not isinstance(self.environment_ids, Unset): environment_ids = self.environment_ids - labels: Union[Unset, list[str]] = UNSET + labels: Unset | list[str] = UNSET if not isinstance(self.labels, Unset): labels = self.labels - sources: Union[Unset, list[str]] = UNSET + sources: Unset | list[str] = UNSET if not isinstance(self.sources, Unset): sources = self.sources @@ -79,14 +79,14 @@ def to_dict(self) -> dict[str, Any]: post_to_incident_timeline = self.post_to_incident_timeline - post_to_slack_channels: Union[Unset, list[dict[str, Any]]] = UNSET + post_to_slack_channels: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.post_to_slack_channels, Unset): post_to_slack_channels = [] for post_to_slack_channels_item_data in self.post_to_slack_channels: post_to_slack_channels_item = post_to_slack_channels_item_data.to_dict() post_to_slack_channels.append(post_to_slack_channels_item) - parent_message_thread_task: Union[Unset, dict[str, Any]] = UNSET + parent_message_thread_task: Unset | dict[str, Any] = UNSET if not isinstance(self.parent_message_thread_task, Unset): parent_message_thread_task = self.parent_message_thread_task.to_dict() @@ -133,7 +133,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: past_duration = d.pop("past_duration") _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, GetAlertsTaskParamsTaskType] + task_type: Unset | GetAlertsTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: @@ -163,7 +163,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: post_to_slack_channels.append(post_to_slack_channels_item) _parent_message_thread_task = d.pop("parent_message_thread_task", UNSET) - parent_message_thread_task: Union[Unset, GetAlertsTaskParamsParentMessageThreadTask] + parent_message_thread_task: Unset | GetAlertsTaskParamsParentMessageThreadTask if isinstance(_parent_message_thread_task, Unset): parent_message_thread_task = UNSET else: diff --git a/rootly_sdk/models/get_alerts_task_params_parent_message_thread_task.py b/rootly_sdk/models/get_alerts_task_params_parent_message_thread_task.py index 5f0736a3..9b7c21dc 100644 --- a/rootly_sdk/models/get_alerts_task_params_parent_message_thread_task.py +++ b/rootly_sdk/models/get_alerts_task_params_parent_message_thread_task.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -18,8 +18,8 @@ class GetAlertsTaskParamsParentMessageThreadTask: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/get_alerts_task_params_post_to_slack_channels_item.py b/rootly_sdk/models/get_alerts_task_params_post_to_slack_channels_item.py index e8f32ca9..cf579af1 100644 --- a/rootly_sdk/models/get_alerts_task_params_post_to_slack_channels_item.py +++ b/rootly_sdk/models/get_alerts_task_params_post_to_slack_channels_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class GetAlertsTaskParamsPostToSlackChannelsItem: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/get_pulses_task_params.py b/rootly_sdk/models/get_pulses_task_params.py index 3a943691..7db72bae 100644 --- a/rootly_sdk/models/get_pulses_task_params.py +++ b/rootly_sdk/models/get_pulses_task_params.py @@ -39,43 +39,43 @@ class GetPulsesTaskParams: """ past_duration: str - task_type: Union[Unset, GetPulsesTaskParamsTaskType] = UNSET - service_ids: Union[Unset, list[str]] = UNSET - environment_ids: Union[Unset, list[str]] = UNSET - labels: Union[Unset, list[str]] = UNSET - refs: Union[Unset, list[str]] = UNSET - sources: Union[Unset, list[str]] = UNSET - services_impacted_by_incident: Union[Unset, bool] = UNSET - environments_impacted_by_incident: Union[Unset, bool] = UNSET - post_to_incident_timeline: Union[Unset, bool] = UNSET - post_to_slack_channels: Union[Unset, list["GetPulsesTaskParamsPostToSlackChannelsItem"]] = UNSET + task_type: Unset | GetPulsesTaskParamsTaskType = UNSET + service_ids: Unset | list[str] = UNSET + environment_ids: Unset | list[str] = UNSET + labels: Unset | list[str] = UNSET + refs: Unset | list[str] = UNSET + sources: Unset | list[str] = UNSET + services_impacted_by_incident: Unset | bool = UNSET + environments_impacted_by_incident: Unset | bool = UNSET + post_to_incident_timeline: Unset | bool = UNSET + post_to_slack_channels: Unset | list["GetPulsesTaskParamsPostToSlackChannelsItem"] = UNSET parent_message_thread_task: Union[Unset, "GetPulsesTaskParamsParentMessageThreadTask"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: past_duration = self.past_duration - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - service_ids: Union[Unset, list[str]] = UNSET + service_ids: Unset | list[str] = UNSET if not isinstance(self.service_ids, Unset): service_ids = self.service_ids - environment_ids: Union[Unset, list[str]] = UNSET + environment_ids: Unset | list[str] = UNSET if not isinstance(self.environment_ids, Unset): environment_ids = self.environment_ids - labels: Union[Unset, list[str]] = UNSET + labels: Unset | list[str] = UNSET if not isinstance(self.labels, Unset): labels = self.labels - refs: Union[Unset, list[str]] = UNSET + refs: Unset | list[str] = UNSET if not isinstance(self.refs, Unset): refs = self.refs - sources: Union[Unset, list[str]] = UNSET + sources: Unset | list[str] = UNSET if not isinstance(self.sources, Unset): sources = self.sources @@ -85,14 +85,14 @@ def to_dict(self) -> dict[str, Any]: post_to_incident_timeline = self.post_to_incident_timeline - post_to_slack_channels: Union[Unset, list[dict[str, Any]]] = UNSET + post_to_slack_channels: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.post_to_slack_channels, Unset): post_to_slack_channels = [] for post_to_slack_channels_item_data in self.post_to_slack_channels: post_to_slack_channels_item = post_to_slack_channels_item_data.to_dict() post_to_slack_channels.append(post_to_slack_channels_item) - parent_message_thread_task: Union[Unset, dict[str, Any]] = UNSET + parent_message_thread_task: Unset | dict[str, Any] = UNSET if not isinstance(self.parent_message_thread_task, Unset): parent_message_thread_task = self.parent_message_thread_task.to_dict() @@ -141,7 +141,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: past_duration = d.pop("past_duration") _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, GetPulsesTaskParamsTaskType] + task_type: Unset | GetPulsesTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: @@ -173,7 +173,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: post_to_slack_channels.append(post_to_slack_channels_item) _parent_message_thread_task = d.pop("parent_message_thread_task", UNSET) - parent_message_thread_task: Union[Unset, GetPulsesTaskParamsParentMessageThreadTask] + parent_message_thread_task: Unset | GetPulsesTaskParamsParentMessageThreadTask if isinstance(_parent_message_thread_task, Unset): parent_message_thread_task = UNSET else: diff --git a/rootly_sdk/models/get_pulses_task_params_parent_message_thread_task.py b/rootly_sdk/models/get_pulses_task_params_parent_message_thread_task.py index 7903abb8..09881017 100644 --- a/rootly_sdk/models/get_pulses_task_params_parent_message_thread_task.py +++ b/rootly_sdk/models/get_pulses_task_params_parent_message_thread_task.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -18,8 +18,8 @@ class GetPulsesTaskParamsParentMessageThreadTask: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/get_pulses_task_params_post_to_slack_channels_item.py b/rootly_sdk/models/get_pulses_task_params_post_to_slack_channels_item.py index c9f3b6da..17ab4fa8 100644 --- a/rootly_sdk/models/get_pulses_task_params_post_to_slack_channels_item.py +++ b/rootly_sdk/models/get_pulses_task_params_post_to_slack_channels_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class GetPulsesTaskParamsPostToSlackChannelsItem: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/heartbeat.py b/rootly_sdk/models/heartbeat.py index e1d52ac2..3a8716a8 100644 --- a/rootly_sdk/models/heartbeat.py +++ b/rootly_sdk/models/heartbeat.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -53,14 +53,14 @@ class Heartbeat: email_address: str created_at: str updated_at: str - description: Union[None, Unset, str] = UNSET - alert_description: Union[None, Unset, str] = UNSET - alert_urgency_id: Union[None, Unset, str] = UNSET - owner_group_ids: Union[Unset, list[str]] = UNSET - ping_url: Union[None, Unset, str] = UNSET - secret: Union[None, Unset, str] = UNSET - last_pinged_at: Union[None, Unset, str] = UNSET - expires_at: Union[None, Unset, str] = UNSET + description: None | Unset | str = UNSET + alert_description: None | Unset | str = UNSET + alert_urgency_id: None | Unset | str = UNSET + owner_group_ids: Unset | list[str] = UNSET + ping_url: None | Unset | str = UNSET + secret: None | Unset | str = UNSET + last_pinged_at: None | Unset | str = UNSET + expires_at: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -86,47 +86,47 @@ def to_dict(self) -> dict[str, Any]: updated_at = self.updated_at - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - alert_description: Union[None, Unset, str] + alert_description: None | Unset | str if isinstance(self.alert_description, Unset): alert_description = UNSET else: alert_description = self.alert_description - alert_urgency_id: Union[None, Unset, str] + alert_urgency_id: None | Unset | str if isinstance(self.alert_urgency_id, Unset): alert_urgency_id = UNSET else: alert_urgency_id = self.alert_urgency_id - owner_group_ids: Union[Unset, list[str]] = UNSET + owner_group_ids: Unset | list[str] = UNSET if not isinstance(self.owner_group_ids, Unset): owner_group_ids = self.owner_group_ids - ping_url: Union[None, Unset, str] + ping_url: None | Unset | str if isinstance(self.ping_url, Unset): ping_url = UNSET else: ping_url = self.ping_url - secret: Union[None, Unset, str] + secret: None | Unset | str if isinstance(self.secret, Unset): secret = UNSET else: secret = self.secret - last_pinged_at: Union[None, Unset, str] + last_pinged_at: None | Unset | str if isinstance(self.last_pinged_at, Unset): last_pinged_at = UNSET else: last_pinged_at = self.last_pinged_at - expires_at: Union[None, Unset, str] + expires_at: None | Unset | str if isinstance(self.expires_at, Unset): expires_at = UNSET else: @@ -193,68 +193,68 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: updated_at = d.pop("updated_at") - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_alert_description(data: object) -> Union[None, Unset, str]: + def _parse_alert_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) alert_description = _parse_alert_description(d.pop("alert_description", UNSET)) - def _parse_alert_urgency_id(data: object) -> Union[None, Unset, str]: + def _parse_alert_urgency_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) alert_urgency_id = _parse_alert_urgency_id(d.pop("alert_urgency_id", UNSET)) owner_group_ids = cast(list[str], d.pop("owner_group_ids", UNSET)) - def _parse_ping_url(data: object) -> Union[None, Unset, str]: + def _parse_ping_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) ping_url = _parse_ping_url(d.pop("ping_url", UNSET)) - def _parse_secret(data: object) -> Union[None, Unset, str]: + def _parse_secret(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) secret = _parse_secret(d.pop("secret", UNSET)) - def _parse_last_pinged_at(data: object) -> Union[None, Unset, str]: + def _parse_last_pinged_at(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) last_pinged_at = _parse_last_pinged_at(d.pop("last_pinged_at", UNSET)) - def _parse_expires_at(data: object) -> Union[None, Unset, str]: + def _parse_expires_at(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) expires_at = _parse_expires_at(d.pop("expires_at", UNSET)) diff --git a/rootly_sdk/models/heartbeat_list.py b/rootly_sdk/models/heartbeat_list.py index f21016c6..85d81821 100644 --- a/rootly_sdk/models/heartbeat_list.py +++ b/rootly_sdk/models/heartbeat_list.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,7 +29,7 @@ class HeartbeatList: data: list["HeartbeatListDataItem"] links: "Links" meta: "Meta" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/heartbeat_response.py b/rootly_sdk/models/heartbeat_response.py index bcaca387..f914eac7 100644 --- a/rootly_sdk/models/heartbeat_response.py +++ b/rootly_sdk/models/heartbeat_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,13 +23,13 @@ class HeartbeatResponse: """ data: "HeartbeatResponseData" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/http_client_task_params.py b/rootly_sdk/models/http_client_task_params.py index 24a105e0..6ed518b8 100644 --- a/rootly_sdk/models/http_client_task_params.py +++ b/rootly_sdk/models/http_client_task_params.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -42,17 +42,17 @@ class HttpClientTaskParams: url: str succeed_on_status: str - task_type: Union[Unset, HttpClientTaskParamsTaskType] = UNSET - headers: Union[Unset, str] = UNSET - params: Union[Unset, str] = UNSET - body: Union[Unset, str] = UNSET - event_url: Union[Unset, str] = UNSET - event_message: Union[Unset, str] = UNSET - method: Union[Unset, HttpClientTaskParamsMethod] = "GET" - post_to_incident_timeline: Union[Unset, bool] = UNSET - post_to_slack_channels: Union[Unset, list["HttpClientTaskParamsPostToSlackChannelsItem"]] = UNSET - retry_count: Union[Unset, int] = 0 - retry_wait_time: Union[Unset, int] = 1 + task_type: Unset | HttpClientTaskParamsTaskType = UNSET + headers: Unset | str = UNSET + params: Unset | str = UNSET + body: Unset | str = UNSET + event_url: Unset | str = UNSET + event_message: Unset | str = UNSET + method: Unset | HttpClientTaskParamsMethod = "GET" + post_to_incident_timeline: Unset | bool = UNSET + post_to_slack_channels: Unset | list["HttpClientTaskParamsPostToSlackChannelsItem"] = UNSET + retry_count: Unset | int = 0 + retry_wait_time: Unset | int = 1 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -60,7 +60,7 @@ def to_dict(self) -> dict[str, Any]: succeed_on_status = self.succeed_on_status - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -74,13 +74,13 @@ def to_dict(self) -> dict[str, Any]: event_message = self.event_message - method: Union[Unset, str] = UNSET + method: Unset | str = UNSET if not isinstance(self.method, Unset): method = self.method post_to_incident_timeline = self.post_to_incident_timeline - post_to_slack_channels: Union[Unset, list[dict[str, Any]]] = UNSET + post_to_slack_channels: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.post_to_slack_channels, Unset): post_to_slack_channels = [] for post_to_slack_channels_item_data in self.post_to_slack_channels: @@ -136,7 +136,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: succeed_on_status = d.pop("succeed_on_status") _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, HttpClientTaskParamsTaskType] + task_type: Unset | HttpClientTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: @@ -153,7 +153,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: event_message = d.pop("event_message", UNSET) _method = d.pop("method", UNSET) - method: Union[Unset, HttpClientTaskParamsMethod] + method: Unset | HttpClientTaskParamsMethod if isinstance(_method, Unset): method = UNSET else: diff --git a/rootly_sdk/models/http_client_task_params_post_to_slack_channels_item.py b/rootly_sdk/models/http_client_task_params_post_to_slack_channels_item.py index 5e6b391a..619d65ed 100644 --- a/rootly_sdk/models/http_client_task_params_post_to_slack_channels_item.py +++ b/rootly_sdk/models/http_client_task_params_post_to_slack_channels_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class HttpClientTaskParamsPostToSlackChannelsItem: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/import_meeting_recording.py b/rootly_sdk/models/import_meeting_recording.py index 2535268a..9b3c6214 100644 --- a/rootly_sdk/models/import_meeting_recording.py +++ b/rootly_sdk/models/import_meeting_recording.py @@ -1,6 +1,6 @@ import datetime from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from uuid import UUID from attrs import define as _attrs_define @@ -32,9 +32,9 @@ class ImportMeetingRecording: source: ImportMeetingRecordingSource recall_recording_id: UUID platform: ImportMeetingRecordingPlatform - started_at: Union[None, Unset, datetime.datetime] = UNSET - ended_at: Union[None, Unset, datetime.datetime] = UNSET - meeting_url: Union[None, Unset, str] = UNSET + started_at: None | Unset | datetime.datetime = UNSET + ended_at: None | Unset | datetime.datetime = UNSET + meeting_url: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -44,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: platform: str = self.platform - started_at: Union[None, Unset, str] + started_at: None | Unset | str if isinstance(self.started_at, Unset): started_at = UNSET elif isinstance(self.started_at, datetime.datetime): @@ -52,7 +52,7 @@ def to_dict(self) -> dict[str, Any]: else: started_at = self.started_at - ended_at: Union[None, Unset, str] + ended_at: None | Unset | str if isinstance(self.ended_at, Unset): ended_at = UNSET elif isinstance(self.ended_at, datetime.datetime): @@ -60,7 +60,7 @@ def to_dict(self) -> dict[str, Any]: else: ended_at = self.ended_at - meeting_url: Union[None, Unset, str] + meeting_url: None | Unset | str if isinstance(self.meeting_url, Unset): meeting_url = UNSET else: @@ -93,7 +93,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: platform = check_import_meeting_recording_platform(d.pop("platform")) - def _parse_started_at(data: object) -> Union[None, Unset, datetime.datetime]: + def _parse_started_at(data: object) -> None | Unset | datetime.datetime: if data is None: return data if isinstance(data, Unset): @@ -106,11 +106,11 @@ def _parse_started_at(data: object) -> Union[None, Unset, datetime.datetime]: return started_at_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, datetime.datetime], data) + return cast(None | Unset | datetime.datetime, data) started_at = _parse_started_at(d.pop("started_at", UNSET)) - def _parse_ended_at(data: object) -> Union[None, Unset, datetime.datetime]: + def _parse_ended_at(data: object) -> None | Unset | datetime.datetime: if data is None: return data if isinstance(data, Unset): @@ -123,16 +123,16 @@ def _parse_ended_at(data: object) -> Union[None, Unset, datetime.datetime]: return ended_at_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, datetime.datetime], data) + return cast(None | Unset | datetime.datetime, data) ended_at = _parse_ended_at(d.pop("ended_at", UNSET)) - def _parse_meeting_url(data: object) -> Union[None, Unset, str]: + def _parse_meeting_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) meeting_url = _parse_meeting_url(d.pop("meeting_url", UNSET)) diff --git a/rootly_sdk/models/incident.py b/rootly_sdk/models/incident.py index af66f397..ee5817ae 100644 --- a/rootly_sdk/models/incident.py +++ b/rootly_sdk/models/incident.py @@ -181,140 +181,138 @@ class Incident: title: str created_at: str updated_at: str - id: Union[Unset, str] = UNSET - sequential_id: Union[Unset, int] = UNSET - kind: Union[Unset, str] = UNSET - slug: Union[Unset, str] = UNSET - parent_incident_id: Union[None, Unset, str] = UNSET - duplicate_incident_id: Union[None, Unset, str] = UNSET - summary: Union[None, Unset, str] = UNSET - private: Union[Unset, bool] = False - source: Union[None, Unset, str] = UNSET - status: Union[None, Unset, str] = UNSET - url: Union[None, Unset, str] = UNSET - short_url: Union[None, Unset, str] = UNSET - public_title: Union[None, Unset, str] = UNSET + id: Unset | str = UNSET + sequential_id: Unset | int = UNSET + kind: Unset | str = UNSET + slug: Unset | str = UNSET + parent_incident_id: None | Unset | str = UNSET + duplicate_incident_id: None | Unset | str = UNSET + summary: None | Unset | str = UNSET + private: Unset | bool = False + source: None | Unset | str = UNSET + status: None | Unset | str = UNSET + url: None | Unset | str = UNSET + short_url: None | Unset | str = UNSET + public_title: None | Unset | str = UNSET user: Union["IncidentUserType0", None, Unset] = UNSET severity: Union[Unset, "SeverityResponse"] = UNSET - environments: Union[None, Unset, list["EnvironmentResponse"]] = UNSET - incident_types: Union[None, Unset, list["IncidentTypeResponse"]] = UNSET - services: Union[None, Unset, list["ServiceResponse"]] = UNSET - functionalities: Union[None, Unset, list["FunctionalityResponse"]] = UNSET - groups: Union[None, Unset, list["TeamResponse"]] = UNSET + environments: None | Unset | list["EnvironmentResponse"] = UNSET + incident_types: None | Unset | list["IncidentTypeResponse"] = UNSET + services: None | Unset | list["ServiceResponse"] = UNSET + functionalities: None | Unset | list["FunctionalityResponse"] = UNSET + groups: None | Unset | list["TeamResponse"] = UNSET labels: Union["IncidentLabelsType0", None, Unset] = UNSET - slack_channel_id: Union[None, Unset, str] = UNSET - slack_channel_name: Union[None, Unset, str] = UNSET - slack_channel_url: Union[None, Unset, str] = UNSET - slack_channel_short_url: Union[None, Unset, str] = UNSET - slack_channel_deep_link: Union[None, Unset, str] = UNSET - slack_channel_archived: Union[None, Unset, bool] = UNSET - slack_last_message_ts: Union[None, Unset, str] = UNSET - zoom_meeting_id: Union[None, Unset, str] = UNSET - zoom_meeting_start_url: Union[None, Unset, str] = UNSET - zoom_meeting_join_url: Union[None, Unset, str] = UNSET - zoom_meeting_password: Union[None, Unset, str] = UNSET - zoom_meeting_pstn_password: Union[None, Unset, str] = UNSET - zoom_meeting_h323_password: Union[None, Unset, str] = UNSET - zoom_meeting_global_dial_in_numbers: Union[None, Unset, list["IncidentZoomMeetingGlobalDialInNumbersType0Item"]] = ( - UNSET - ) - google_drive_id: Union[None, Unset, str] = UNSET - google_drive_parent_id: Union[None, Unset, str] = UNSET - google_drive_url: Union[None, Unset, str] = UNSET - google_meeting_id: Union[None, Unset, str] = UNSET - google_meeting_url: Union[None, Unset, str] = UNSET - microsoft_teams_meeting_id: Union[None, Unset, str] = UNSET - microsoft_teams_meeting_url: Union[None, Unset, str] = UNSET - microsoft_teams_channel_id: Union[None, Unset, str] = UNSET - microsoft_teams_channel_name: Union[None, Unset, str] = UNSET - microsoft_teams_channel_url: Union[None, Unset, str] = UNSET - microsoft_teams_channel_short_url: Union[None, Unset, str] = UNSET - microsoft_teams_chat_id: Union[None, Unset, str] = UNSET - microsoft_teams_chat_url: Union[None, Unset, str] = UNSET - microsoft_teams_team_id: Union[None, Unset, str] = UNSET - google_chat_space_id: Union[None, Unset, str] = UNSET - google_chat_space_name: Union[None, Unset, str] = UNSET - google_chat_space_url: Union[None, Unset, str] = UNSET - google_chat_space_short_url: Union[None, Unset, str] = UNSET - google_chat_space_archived: Union[None, Unset, bool] = UNSET - google_chat_space_domain_id: Union[None, Unset, str] = UNSET - webex_meeting_id: Union[None, Unset, str] = UNSET - webex_meeting_url: Union[None, Unset, str] = UNSET - jira_issue_key: Union[None, Unset, str] = UNSET - jira_issue_id: Union[None, Unset, str] = UNSET - jira_issue_url: Union[None, Unset, str] = UNSET - github_issue_id: Union[None, Unset, str] = UNSET - github_issue_url: Union[None, Unset, str] = UNSET - gitlab_issue_id: Union[None, Unset, str] = UNSET - gitlab_issue_url: Union[None, Unset, str] = UNSET - asana_task_id: Union[None, Unset, str] = UNSET - asana_task_url: Union[None, Unset, str] = UNSET - linear_issue_id: Union[None, Unset, str] = UNSET - linear_issue_url: Union[None, Unset, str] = UNSET - trello_card_id: Union[None, Unset, str] = UNSET - trello_card_url: Union[None, Unset, str] = UNSET - zendesk_ticket_id: Union[None, Unset, str] = UNSET - zendesk_ticket_url: Union[None, Unset, str] = UNSET - pagerduty_incident_id: Union[None, Unset, str] = UNSET - pagerduty_incident_number: Union[None, Unset, str] = UNSET - pagerduty_incident_url: Union[None, Unset, str] = UNSET - opsgenie_incident_id: Union[None, Unset, str] = UNSET - opsgenie_incident_url: Union[None, Unset, str] = UNSET - opsgenie_alert_id: Union[None, Unset, str] = UNSET - opsgenie_alert_url: Union[None, Unset, str] = UNSET - service_now_incident_id: Union[None, Unset, str] = UNSET - service_now_incident_key: Union[None, Unset, str] = UNSET - service_now_incident_url: Union[None, Unset, str] = UNSET - mattermost_channel_id: Union[None, Unset, str] = UNSET - mattermost_channel_name: Union[None, Unset, str] = UNSET - mattermost_channel_url: Union[None, Unset, str] = UNSET - confluence_page_id: Union[None, Unset, str] = UNSET - confluence_page_url: Union[None, Unset, str] = UNSET - datadog_notebook_id: Union[None, Unset, str] = UNSET - datadog_notebook_url: Union[None, Unset, str] = UNSET - shortcut_story_id: Union[None, Unset, str] = UNSET - shortcut_story_url: Union[None, Unset, str] = UNSET - shortcut_task_id: Union[None, Unset, str] = UNSET - shortcut_task_url: Union[None, Unset, str] = UNSET - motion_task_id: Union[None, Unset, str] = UNSET - motion_task_url: Union[None, Unset, str] = UNSET - clickup_task_id: Union[None, Unset, str] = UNSET - clickup_task_url: Union[None, Unset, str] = UNSET - victor_ops_incident_id: Union[None, Unset, str] = UNSET - victor_ops_incident_url: Union[None, Unset, str] = UNSET - quip_page_id: Union[None, Unset, str] = UNSET - quip_page_url: Union[None, Unset, str] = UNSET - sharepoint_page_id: Union[None, Unset, str] = UNSET - sharepoint_page_url: Union[None, Unset, str] = UNSET - airtable_base_key: Union[None, Unset, str] = UNSET - airtable_table_name: Union[None, Unset, str] = UNSET - airtable_record_id: Union[None, Unset, str] = UNSET - airtable_record_url: Union[None, Unset, str] = UNSET - freshservice_ticket_id: Union[None, Unset, str] = UNSET - freshservice_ticket_url: Union[None, Unset, str] = UNSET - freshservice_task_id: Union[None, Unset, str] = UNSET - freshservice_task_url: Union[None, Unset, str] = UNSET - mitigation_message: Union[None, Unset, str] = UNSET - resolution_message: Union[None, Unset, str] = UNSET - cancellation_message: Union[None, Unset, str] = UNSET - scheduled_for: Union[None, Unset, str] = UNSET - scheduled_until: Union[None, Unset, str] = UNSET - muted_service_ids: Union[None, Unset, list[str]] = UNSET - retrospective_progress_status: Union[Unset, IncidentRetrospectiveProgressStatus] = UNSET + slack_channel_id: None | Unset | str = UNSET + slack_channel_name: None | Unset | str = UNSET + slack_channel_url: None | Unset | str = UNSET + slack_channel_short_url: None | Unset | str = UNSET + slack_channel_deep_link: None | Unset | str = UNSET + slack_channel_archived: None | Unset | bool = UNSET + slack_last_message_ts: None | Unset | str = UNSET + zoom_meeting_id: None | Unset | str = UNSET + zoom_meeting_start_url: None | Unset | str = UNSET + zoom_meeting_join_url: None | Unset | str = UNSET + zoom_meeting_password: None | Unset | str = UNSET + zoom_meeting_pstn_password: None | Unset | str = UNSET + zoom_meeting_h323_password: None | Unset | str = UNSET + zoom_meeting_global_dial_in_numbers: None | Unset | list["IncidentZoomMeetingGlobalDialInNumbersType0Item"] = UNSET + google_drive_id: None | Unset | str = UNSET + google_drive_parent_id: None | Unset | str = UNSET + google_drive_url: None | Unset | str = UNSET + google_meeting_id: None | Unset | str = UNSET + google_meeting_url: None | Unset | str = UNSET + microsoft_teams_meeting_id: None | Unset | str = UNSET + microsoft_teams_meeting_url: None | Unset | str = UNSET + microsoft_teams_channel_id: None | Unset | str = UNSET + microsoft_teams_channel_name: None | Unset | str = UNSET + microsoft_teams_channel_url: None | Unset | str = UNSET + microsoft_teams_channel_short_url: None | Unset | str = UNSET + microsoft_teams_chat_id: None | Unset | str = UNSET + microsoft_teams_chat_url: None | Unset | str = UNSET + microsoft_teams_team_id: None | Unset | str = UNSET + google_chat_space_id: None | Unset | str = UNSET + google_chat_space_name: None | Unset | str = UNSET + google_chat_space_url: None | Unset | str = UNSET + google_chat_space_short_url: None | Unset | str = UNSET + google_chat_space_archived: None | Unset | bool = UNSET + google_chat_space_domain_id: None | Unset | str = UNSET + webex_meeting_id: None | Unset | str = UNSET + webex_meeting_url: None | Unset | str = UNSET + jira_issue_key: None | Unset | str = UNSET + jira_issue_id: None | Unset | str = UNSET + jira_issue_url: None | Unset | str = UNSET + github_issue_id: None | Unset | str = UNSET + github_issue_url: None | Unset | str = UNSET + gitlab_issue_id: None | Unset | str = UNSET + gitlab_issue_url: None | Unset | str = UNSET + asana_task_id: None | Unset | str = UNSET + asana_task_url: None | Unset | str = UNSET + linear_issue_id: None | Unset | str = UNSET + linear_issue_url: None | Unset | str = UNSET + trello_card_id: None | Unset | str = UNSET + trello_card_url: None | Unset | str = UNSET + zendesk_ticket_id: None | Unset | str = UNSET + zendesk_ticket_url: None | Unset | str = UNSET + pagerduty_incident_id: None | Unset | str = UNSET + pagerduty_incident_number: None | Unset | str = UNSET + pagerduty_incident_url: None | Unset | str = UNSET + opsgenie_incident_id: None | Unset | str = UNSET + opsgenie_incident_url: None | Unset | str = UNSET + opsgenie_alert_id: None | Unset | str = UNSET + opsgenie_alert_url: None | Unset | str = UNSET + service_now_incident_id: None | Unset | str = UNSET + service_now_incident_key: None | Unset | str = UNSET + service_now_incident_url: None | Unset | str = UNSET + mattermost_channel_id: None | Unset | str = UNSET + mattermost_channel_name: None | Unset | str = UNSET + mattermost_channel_url: None | Unset | str = UNSET + confluence_page_id: None | Unset | str = UNSET + confluence_page_url: None | Unset | str = UNSET + datadog_notebook_id: None | Unset | str = UNSET + datadog_notebook_url: None | Unset | str = UNSET + shortcut_story_id: None | Unset | str = UNSET + shortcut_story_url: None | Unset | str = UNSET + shortcut_task_id: None | Unset | str = UNSET + shortcut_task_url: None | Unset | str = UNSET + motion_task_id: None | Unset | str = UNSET + motion_task_url: None | Unset | str = UNSET + clickup_task_id: None | Unset | str = UNSET + clickup_task_url: None | Unset | str = UNSET + victor_ops_incident_id: None | Unset | str = UNSET + victor_ops_incident_url: None | Unset | str = UNSET + quip_page_id: None | Unset | str = UNSET + quip_page_url: None | Unset | str = UNSET + sharepoint_page_id: None | Unset | str = UNSET + sharepoint_page_url: None | Unset | str = UNSET + airtable_base_key: None | Unset | str = UNSET + airtable_table_name: None | Unset | str = UNSET + airtable_record_id: None | Unset | str = UNSET + airtable_record_url: None | Unset | str = UNSET + freshservice_ticket_id: None | Unset | str = UNSET + freshservice_ticket_url: None | Unset | str = UNSET + freshservice_task_id: None | Unset | str = UNSET + freshservice_task_url: None | Unset | str = UNSET + mitigation_message: None | Unset | str = UNSET + resolution_message: None | Unset | str = UNSET + cancellation_message: None | Unset | str = UNSET + scheduled_for: None | Unset | str = UNSET + scheduled_until: None | Unset | str = UNSET + muted_service_ids: None | Unset | list[str] = UNSET + retrospective_progress_status: Unset | IncidentRetrospectiveProgressStatus = UNSET in_triage_by: Union["IncidentInTriageByType0", None, Unset] = UNSET started_by: Union["IncidentStartedByType0", None, Unset] = UNSET mitigated_by: Union["IncidentMitigatedByType0", None, Unset] = UNSET resolved_by: Union["IncidentResolvedByType0", None, Unset] = UNSET closed_by: Union["IncidentClosedByType0", None, Unset] = UNSET cancelled_by: Union["IncidentCancelledByType0", None, Unset] = UNSET - in_triage_at: Union[None, Unset, str] = UNSET - started_at: Union[None, Unset, str] = UNSET - detected_at: Union[None, Unset, str] = UNSET - acknowledged_at: Union[None, Unset, str] = UNSET - mitigated_at: Union[None, Unset, str] = UNSET - resolved_at: Union[None, Unset, str] = UNSET - closed_at: Union[None, Unset, str] = UNSET - cancelled_at: Union[None, Unset, str] = UNSET + in_triage_at: None | Unset | str = UNSET + started_at: None | Unset | str = UNSET + detected_at: None | Unset | str = UNSET + acknowledged_at: None | Unset | str = UNSET + mitigated_at: None | Unset | str = UNSET + resolved_at: None | Unset | str = UNSET + closed_at: None | Unset | str = UNSET + cancelled_at: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -341,19 +339,19 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - parent_incident_id: Union[None, Unset, str] + parent_incident_id: None | Unset | str if isinstance(self.parent_incident_id, Unset): parent_incident_id = UNSET else: parent_incident_id = self.parent_incident_id - duplicate_incident_id: Union[None, Unset, str] + duplicate_incident_id: None | Unset | str if isinstance(self.duplicate_incident_id, Unset): duplicate_incident_id = UNSET else: duplicate_incident_id = self.duplicate_incident_id - summary: Union[None, Unset, str] + summary: None | Unset | str if isinstance(self.summary, Unset): summary = UNSET else: @@ -361,37 +359,37 @@ def to_dict(self) -> dict[str, Any]: private = self.private - source: Union[None, Unset, str] + source: None | Unset | str if isinstance(self.source, Unset): source = UNSET else: source = self.source - status: Union[None, Unset, str] + status: None | Unset | str if isinstance(self.status, Unset): status = UNSET else: status = self.status - url: Union[None, Unset, str] + url: None | Unset | str if isinstance(self.url, Unset): url = UNSET else: url = self.url - short_url: Union[None, Unset, str] + short_url: None | Unset | str if isinstance(self.short_url, Unset): short_url = UNSET else: short_url = self.short_url - public_title: Union[None, Unset, str] + public_title: None | Unset | str if isinstance(self.public_title, Unset): public_title = UNSET else: public_title = self.public_title - user: Union[None, Unset, dict[str, Any]] + user: None | Unset | dict[str, Any] if isinstance(self.user, Unset): user = UNSET elif isinstance(self.user, IncidentUserType0): @@ -399,11 +397,11 @@ def to_dict(self) -> dict[str, Any]: else: user = self.user - severity: Union[Unset, dict[str, Any]] = UNSET + severity: Unset | dict[str, Any] = UNSET if not isinstance(self.severity, Unset): severity = self.severity.to_dict() - environments: Union[None, Unset, list[dict[str, Any]]] + environments: None | Unset | list[dict[str, Any]] if isinstance(self.environments, Unset): environments = UNSET elif isinstance(self.environments, list): @@ -415,7 +413,7 @@ def to_dict(self) -> dict[str, Any]: else: environments = self.environments - incident_types: Union[None, Unset, list[dict[str, Any]]] + incident_types: None | Unset | list[dict[str, Any]] if isinstance(self.incident_types, Unset): incident_types = UNSET elif isinstance(self.incident_types, list): @@ -427,7 +425,7 @@ def to_dict(self) -> dict[str, Any]: else: incident_types = self.incident_types - services: Union[None, Unset, list[dict[str, Any]]] + services: None | Unset | list[dict[str, Any]] if isinstance(self.services, Unset): services = UNSET elif isinstance(self.services, list): @@ -439,7 +437,7 @@ def to_dict(self) -> dict[str, Any]: else: services = self.services - functionalities: Union[None, Unset, list[dict[str, Any]]] + functionalities: None | Unset | list[dict[str, Any]] if isinstance(self.functionalities, Unset): functionalities = UNSET elif isinstance(self.functionalities, list): @@ -451,7 +449,7 @@ def to_dict(self) -> dict[str, Any]: else: functionalities = self.functionalities - groups: Union[None, Unset, list[dict[str, Any]]] + groups: None | Unset | list[dict[str, Any]] if isinstance(self.groups, Unset): groups = UNSET elif isinstance(self.groups, list): @@ -463,7 +461,7 @@ def to_dict(self) -> dict[str, Any]: else: groups = self.groups - labels: Union[None, Unset, dict[str, Any]] + labels: None | Unset | dict[str, Any] if isinstance(self.labels, Unset): labels = UNSET elif isinstance(self.labels, IncidentLabelsType0): @@ -471,85 +469,85 @@ def to_dict(self) -> dict[str, Any]: else: labels = self.labels - slack_channel_id: Union[None, Unset, str] + slack_channel_id: None | Unset | str if isinstance(self.slack_channel_id, Unset): slack_channel_id = UNSET else: slack_channel_id = self.slack_channel_id - slack_channel_name: Union[None, Unset, str] + slack_channel_name: None | Unset | str if isinstance(self.slack_channel_name, Unset): slack_channel_name = UNSET else: slack_channel_name = self.slack_channel_name - slack_channel_url: Union[None, Unset, str] + slack_channel_url: None | Unset | str if isinstance(self.slack_channel_url, Unset): slack_channel_url = UNSET else: slack_channel_url = self.slack_channel_url - slack_channel_short_url: Union[None, Unset, str] + slack_channel_short_url: None | Unset | str if isinstance(self.slack_channel_short_url, Unset): slack_channel_short_url = UNSET else: slack_channel_short_url = self.slack_channel_short_url - slack_channel_deep_link: Union[None, Unset, str] + slack_channel_deep_link: None | Unset | str if isinstance(self.slack_channel_deep_link, Unset): slack_channel_deep_link = UNSET else: slack_channel_deep_link = self.slack_channel_deep_link - slack_channel_archived: Union[None, Unset, bool] + slack_channel_archived: None | Unset | bool if isinstance(self.slack_channel_archived, Unset): slack_channel_archived = UNSET else: slack_channel_archived = self.slack_channel_archived - slack_last_message_ts: Union[None, Unset, str] + slack_last_message_ts: None | Unset | str if isinstance(self.slack_last_message_ts, Unset): slack_last_message_ts = UNSET else: slack_last_message_ts = self.slack_last_message_ts - zoom_meeting_id: Union[None, Unset, str] + zoom_meeting_id: None | Unset | str if isinstance(self.zoom_meeting_id, Unset): zoom_meeting_id = UNSET else: zoom_meeting_id = self.zoom_meeting_id - zoom_meeting_start_url: Union[None, Unset, str] + zoom_meeting_start_url: None | Unset | str if isinstance(self.zoom_meeting_start_url, Unset): zoom_meeting_start_url = UNSET else: zoom_meeting_start_url = self.zoom_meeting_start_url - zoom_meeting_join_url: Union[None, Unset, str] + zoom_meeting_join_url: None | Unset | str if isinstance(self.zoom_meeting_join_url, Unset): zoom_meeting_join_url = UNSET else: zoom_meeting_join_url = self.zoom_meeting_join_url - zoom_meeting_password: Union[None, Unset, str] + zoom_meeting_password: None | Unset | str if isinstance(self.zoom_meeting_password, Unset): zoom_meeting_password = UNSET else: zoom_meeting_password = self.zoom_meeting_password - zoom_meeting_pstn_password: Union[None, Unset, str] + zoom_meeting_pstn_password: None | Unset | str if isinstance(self.zoom_meeting_pstn_password, Unset): zoom_meeting_pstn_password = UNSET else: zoom_meeting_pstn_password = self.zoom_meeting_pstn_password - zoom_meeting_h323_password: Union[None, Unset, str] + zoom_meeting_h323_password: None | Unset | str if isinstance(self.zoom_meeting_h323_password, Unset): zoom_meeting_h323_password = UNSET else: zoom_meeting_h323_password = self.zoom_meeting_h323_password - zoom_meeting_global_dial_in_numbers: Union[None, Unset, list[dict[str, Any]]] + zoom_meeting_global_dial_in_numbers: None | Unset | list[dict[str, Any]] if isinstance(self.zoom_meeting_global_dial_in_numbers, Unset): zoom_meeting_global_dial_in_numbers = UNSET elif isinstance(self.zoom_meeting_global_dial_in_numbers, list): @@ -563,493 +561,493 @@ def to_dict(self) -> dict[str, Any]: else: zoom_meeting_global_dial_in_numbers = self.zoom_meeting_global_dial_in_numbers - google_drive_id: Union[None, Unset, str] + google_drive_id: None | Unset | str if isinstance(self.google_drive_id, Unset): google_drive_id = UNSET else: google_drive_id = self.google_drive_id - google_drive_parent_id: Union[None, Unset, str] + google_drive_parent_id: None | Unset | str if isinstance(self.google_drive_parent_id, Unset): google_drive_parent_id = UNSET else: google_drive_parent_id = self.google_drive_parent_id - google_drive_url: Union[None, Unset, str] + google_drive_url: None | Unset | str if isinstance(self.google_drive_url, Unset): google_drive_url = UNSET else: google_drive_url = self.google_drive_url - google_meeting_id: Union[None, Unset, str] + google_meeting_id: None | Unset | str if isinstance(self.google_meeting_id, Unset): google_meeting_id = UNSET else: google_meeting_id = self.google_meeting_id - google_meeting_url: Union[None, Unset, str] + google_meeting_url: None | Unset | str if isinstance(self.google_meeting_url, Unset): google_meeting_url = UNSET else: google_meeting_url = self.google_meeting_url - microsoft_teams_meeting_id: Union[None, Unset, str] + microsoft_teams_meeting_id: None | Unset | str if isinstance(self.microsoft_teams_meeting_id, Unset): microsoft_teams_meeting_id = UNSET else: microsoft_teams_meeting_id = self.microsoft_teams_meeting_id - microsoft_teams_meeting_url: Union[None, Unset, str] + microsoft_teams_meeting_url: None | Unset | str if isinstance(self.microsoft_teams_meeting_url, Unset): microsoft_teams_meeting_url = UNSET else: microsoft_teams_meeting_url = self.microsoft_teams_meeting_url - microsoft_teams_channel_id: Union[None, Unset, str] + microsoft_teams_channel_id: None | Unset | str if isinstance(self.microsoft_teams_channel_id, Unset): microsoft_teams_channel_id = UNSET else: microsoft_teams_channel_id = self.microsoft_teams_channel_id - microsoft_teams_channel_name: Union[None, Unset, str] + microsoft_teams_channel_name: None | Unset | str if isinstance(self.microsoft_teams_channel_name, Unset): microsoft_teams_channel_name = UNSET else: microsoft_teams_channel_name = self.microsoft_teams_channel_name - microsoft_teams_channel_url: Union[None, Unset, str] + microsoft_teams_channel_url: None | Unset | str if isinstance(self.microsoft_teams_channel_url, Unset): microsoft_teams_channel_url = UNSET else: microsoft_teams_channel_url = self.microsoft_teams_channel_url - microsoft_teams_channel_short_url: Union[None, Unset, str] + microsoft_teams_channel_short_url: None | Unset | str if isinstance(self.microsoft_teams_channel_short_url, Unset): microsoft_teams_channel_short_url = UNSET else: microsoft_teams_channel_short_url = self.microsoft_teams_channel_short_url - microsoft_teams_chat_id: Union[None, Unset, str] + microsoft_teams_chat_id: None | Unset | str if isinstance(self.microsoft_teams_chat_id, Unset): microsoft_teams_chat_id = UNSET else: microsoft_teams_chat_id = self.microsoft_teams_chat_id - microsoft_teams_chat_url: Union[None, Unset, str] + microsoft_teams_chat_url: None | Unset | str if isinstance(self.microsoft_teams_chat_url, Unset): microsoft_teams_chat_url = UNSET else: microsoft_teams_chat_url = self.microsoft_teams_chat_url - microsoft_teams_team_id: Union[None, Unset, str] + microsoft_teams_team_id: None | Unset | str if isinstance(self.microsoft_teams_team_id, Unset): microsoft_teams_team_id = UNSET else: microsoft_teams_team_id = self.microsoft_teams_team_id - google_chat_space_id: Union[None, Unset, str] + google_chat_space_id: None | Unset | str if isinstance(self.google_chat_space_id, Unset): google_chat_space_id = UNSET else: google_chat_space_id = self.google_chat_space_id - google_chat_space_name: Union[None, Unset, str] + google_chat_space_name: None | Unset | str if isinstance(self.google_chat_space_name, Unset): google_chat_space_name = UNSET else: google_chat_space_name = self.google_chat_space_name - google_chat_space_url: Union[None, Unset, str] + google_chat_space_url: None | Unset | str if isinstance(self.google_chat_space_url, Unset): google_chat_space_url = UNSET else: google_chat_space_url = self.google_chat_space_url - google_chat_space_short_url: Union[None, Unset, str] + google_chat_space_short_url: None | Unset | str if isinstance(self.google_chat_space_short_url, Unset): google_chat_space_short_url = UNSET else: google_chat_space_short_url = self.google_chat_space_short_url - google_chat_space_archived: Union[None, Unset, bool] + google_chat_space_archived: None | Unset | bool if isinstance(self.google_chat_space_archived, Unset): google_chat_space_archived = UNSET else: google_chat_space_archived = self.google_chat_space_archived - google_chat_space_domain_id: Union[None, Unset, str] + google_chat_space_domain_id: None | Unset | str if isinstance(self.google_chat_space_domain_id, Unset): google_chat_space_domain_id = UNSET else: google_chat_space_domain_id = self.google_chat_space_domain_id - webex_meeting_id: Union[None, Unset, str] + webex_meeting_id: None | Unset | str if isinstance(self.webex_meeting_id, Unset): webex_meeting_id = UNSET else: webex_meeting_id = self.webex_meeting_id - webex_meeting_url: Union[None, Unset, str] + webex_meeting_url: None | Unset | str if isinstance(self.webex_meeting_url, Unset): webex_meeting_url = UNSET else: webex_meeting_url = self.webex_meeting_url - jira_issue_key: Union[None, Unset, str] + jira_issue_key: None | Unset | str if isinstance(self.jira_issue_key, Unset): jira_issue_key = UNSET else: jira_issue_key = self.jira_issue_key - jira_issue_id: Union[None, Unset, str] + jira_issue_id: None | Unset | str if isinstance(self.jira_issue_id, Unset): jira_issue_id = UNSET else: jira_issue_id = self.jira_issue_id - jira_issue_url: Union[None, Unset, str] + jira_issue_url: None | Unset | str if isinstance(self.jira_issue_url, Unset): jira_issue_url = UNSET else: jira_issue_url = self.jira_issue_url - github_issue_id: Union[None, Unset, str] + github_issue_id: None | Unset | str if isinstance(self.github_issue_id, Unset): github_issue_id = UNSET else: github_issue_id = self.github_issue_id - github_issue_url: Union[None, Unset, str] + github_issue_url: None | Unset | str if isinstance(self.github_issue_url, Unset): github_issue_url = UNSET else: github_issue_url = self.github_issue_url - gitlab_issue_id: Union[None, Unset, str] + gitlab_issue_id: None | Unset | str if isinstance(self.gitlab_issue_id, Unset): gitlab_issue_id = UNSET else: gitlab_issue_id = self.gitlab_issue_id - gitlab_issue_url: Union[None, Unset, str] + gitlab_issue_url: None | Unset | str if isinstance(self.gitlab_issue_url, Unset): gitlab_issue_url = UNSET else: gitlab_issue_url = self.gitlab_issue_url - asana_task_id: Union[None, Unset, str] + asana_task_id: None | Unset | str if isinstance(self.asana_task_id, Unset): asana_task_id = UNSET else: asana_task_id = self.asana_task_id - asana_task_url: Union[None, Unset, str] + asana_task_url: None | Unset | str if isinstance(self.asana_task_url, Unset): asana_task_url = UNSET else: asana_task_url = self.asana_task_url - linear_issue_id: Union[None, Unset, str] + linear_issue_id: None | Unset | str if isinstance(self.linear_issue_id, Unset): linear_issue_id = UNSET else: linear_issue_id = self.linear_issue_id - linear_issue_url: Union[None, Unset, str] + linear_issue_url: None | Unset | str if isinstance(self.linear_issue_url, Unset): linear_issue_url = UNSET else: linear_issue_url = self.linear_issue_url - trello_card_id: Union[None, Unset, str] + trello_card_id: None | Unset | str if isinstance(self.trello_card_id, Unset): trello_card_id = UNSET else: trello_card_id = self.trello_card_id - trello_card_url: Union[None, Unset, str] + trello_card_url: None | Unset | str if isinstance(self.trello_card_url, Unset): trello_card_url = UNSET else: trello_card_url = self.trello_card_url - zendesk_ticket_id: Union[None, Unset, str] + zendesk_ticket_id: None | Unset | str if isinstance(self.zendesk_ticket_id, Unset): zendesk_ticket_id = UNSET else: zendesk_ticket_id = self.zendesk_ticket_id - zendesk_ticket_url: Union[None, Unset, str] + zendesk_ticket_url: None | Unset | str if isinstance(self.zendesk_ticket_url, Unset): zendesk_ticket_url = UNSET else: zendesk_ticket_url = self.zendesk_ticket_url - pagerduty_incident_id: Union[None, Unset, str] + pagerduty_incident_id: None | Unset | str if isinstance(self.pagerduty_incident_id, Unset): pagerduty_incident_id = UNSET else: pagerduty_incident_id = self.pagerduty_incident_id - pagerduty_incident_number: Union[None, Unset, str] + pagerduty_incident_number: None | Unset | str if isinstance(self.pagerduty_incident_number, Unset): pagerduty_incident_number = UNSET else: pagerduty_incident_number = self.pagerduty_incident_number - pagerduty_incident_url: Union[None, Unset, str] + pagerduty_incident_url: None | Unset | str if isinstance(self.pagerduty_incident_url, Unset): pagerduty_incident_url = UNSET else: pagerduty_incident_url = self.pagerduty_incident_url - opsgenie_incident_id: Union[None, Unset, str] + opsgenie_incident_id: None | Unset | str if isinstance(self.opsgenie_incident_id, Unset): opsgenie_incident_id = UNSET else: opsgenie_incident_id = self.opsgenie_incident_id - opsgenie_incident_url: Union[None, Unset, str] + opsgenie_incident_url: None | Unset | str if isinstance(self.opsgenie_incident_url, Unset): opsgenie_incident_url = UNSET else: opsgenie_incident_url = self.opsgenie_incident_url - opsgenie_alert_id: Union[None, Unset, str] + opsgenie_alert_id: None | Unset | str if isinstance(self.opsgenie_alert_id, Unset): opsgenie_alert_id = UNSET else: opsgenie_alert_id = self.opsgenie_alert_id - opsgenie_alert_url: Union[None, Unset, str] + opsgenie_alert_url: None | Unset | str if isinstance(self.opsgenie_alert_url, Unset): opsgenie_alert_url = UNSET else: opsgenie_alert_url = self.opsgenie_alert_url - service_now_incident_id: Union[None, Unset, str] + service_now_incident_id: None | Unset | str if isinstance(self.service_now_incident_id, Unset): service_now_incident_id = UNSET else: service_now_incident_id = self.service_now_incident_id - service_now_incident_key: Union[None, Unset, str] + service_now_incident_key: None | Unset | str if isinstance(self.service_now_incident_key, Unset): service_now_incident_key = UNSET else: service_now_incident_key = self.service_now_incident_key - service_now_incident_url: Union[None, Unset, str] + service_now_incident_url: None | Unset | str if isinstance(self.service_now_incident_url, Unset): service_now_incident_url = UNSET else: service_now_incident_url = self.service_now_incident_url - mattermost_channel_id: Union[None, Unset, str] + mattermost_channel_id: None | Unset | str if isinstance(self.mattermost_channel_id, Unset): mattermost_channel_id = UNSET else: mattermost_channel_id = self.mattermost_channel_id - mattermost_channel_name: Union[None, Unset, str] + mattermost_channel_name: None | Unset | str if isinstance(self.mattermost_channel_name, Unset): mattermost_channel_name = UNSET else: mattermost_channel_name = self.mattermost_channel_name - mattermost_channel_url: Union[None, Unset, str] + mattermost_channel_url: None | Unset | str if isinstance(self.mattermost_channel_url, Unset): mattermost_channel_url = UNSET else: mattermost_channel_url = self.mattermost_channel_url - confluence_page_id: Union[None, Unset, str] + confluence_page_id: None | Unset | str if isinstance(self.confluence_page_id, Unset): confluence_page_id = UNSET else: confluence_page_id = self.confluence_page_id - confluence_page_url: Union[None, Unset, str] + confluence_page_url: None | Unset | str if isinstance(self.confluence_page_url, Unset): confluence_page_url = UNSET else: confluence_page_url = self.confluence_page_url - datadog_notebook_id: Union[None, Unset, str] + datadog_notebook_id: None | Unset | str if isinstance(self.datadog_notebook_id, Unset): datadog_notebook_id = UNSET else: datadog_notebook_id = self.datadog_notebook_id - datadog_notebook_url: Union[None, Unset, str] + datadog_notebook_url: None | Unset | str if isinstance(self.datadog_notebook_url, Unset): datadog_notebook_url = UNSET else: datadog_notebook_url = self.datadog_notebook_url - shortcut_story_id: Union[None, Unset, str] + shortcut_story_id: None | Unset | str if isinstance(self.shortcut_story_id, Unset): shortcut_story_id = UNSET else: shortcut_story_id = self.shortcut_story_id - shortcut_story_url: Union[None, Unset, str] + shortcut_story_url: None | Unset | str if isinstance(self.shortcut_story_url, Unset): shortcut_story_url = UNSET else: shortcut_story_url = self.shortcut_story_url - shortcut_task_id: Union[None, Unset, str] + shortcut_task_id: None | Unset | str if isinstance(self.shortcut_task_id, Unset): shortcut_task_id = UNSET else: shortcut_task_id = self.shortcut_task_id - shortcut_task_url: Union[None, Unset, str] + shortcut_task_url: None | Unset | str if isinstance(self.shortcut_task_url, Unset): shortcut_task_url = UNSET else: shortcut_task_url = self.shortcut_task_url - motion_task_id: Union[None, Unset, str] + motion_task_id: None | Unset | str if isinstance(self.motion_task_id, Unset): motion_task_id = UNSET else: motion_task_id = self.motion_task_id - motion_task_url: Union[None, Unset, str] + motion_task_url: None | Unset | str if isinstance(self.motion_task_url, Unset): motion_task_url = UNSET else: motion_task_url = self.motion_task_url - clickup_task_id: Union[None, Unset, str] + clickup_task_id: None | Unset | str if isinstance(self.clickup_task_id, Unset): clickup_task_id = UNSET else: clickup_task_id = self.clickup_task_id - clickup_task_url: Union[None, Unset, str] + clickup_task_url: None | Unset | str if isinstance(self.clickup_task_url, Unset): clickup_task_url = UNSET else: clickup_task_url = self.clickup_task_url - victor_ops_incident_id: Union[None, Unset, str] + victor_ops_incident_id: None | Unset | str if isinstance(self.victor_ops_incident_id, Unset): victor_ops_incident_id = UNSET else: victor_ops_incident_id = self.victor_ops_incident_id - victor_ops_incident_url: Union[None, Unset, str] + victor_ops_incident_url: None | Unset | str if isinstance(self.victor_ops_incident_url, Unset): victor_ops_incident_url = UNSET else: victor_ops_incident_url = self.victor_ops_incident_url - quip_page_id: Union[None, Unset, str] + quip_page_id: None | Unset | str if isinstance(self.quip_page_id, Unset): quip_page_id = UNSET else: quip_page_id = self.quip_page_id - quip_page_url: Union[None, Unset, str] + quip_page_url: None | Unset | str if isinstance(self.quip_page_url, Unset): quip_page_url = UNSET else: quip_page_url = self.quip_page_url - sharepoint_page_id: Union[None, Unset, str] + sharepoint_page_id: None | Unset | str if isinstance(self.sharepoint_page_id, Unset): sharepoint_page_id = UNSET else: sharepoint_page_id = self.sharepoint_page_id - sharepoint_page_url: Union[None, Unset, str] + sharepoint_page_url: None | Unset | str if isinstance(self.sharepoint_page_url, Unset): sharepoint_page_url = UNSET else: sharepoint_page_url = self.sharepoint_page_url - airtable_base_key: Union[None, Unset, str] + airtable_base_key: None | Unset | str if isinstance(self.airtable_base_key, Unset): airtable_base_key = UNSET else: airtable_base_key = self.airtable_base_key - airtable_table_name: Union[None, Unset, str] + airtable_table_name: None | Unset | str if isinstance(self.airtable_table_name, Unset): airtable_table_name = UNSET else: airtable_table_name = self.airtable_table_name - airtable_record_id: Union[None, Unset, str] + airtable_record_id: None | Unset | str if isinstance(self.airtable_record_id, Unset): airtable_record_id = UNSET else: airtable_record_id = self.airtable_record_id - airtable_record_url: Union[None, Unset, str] + airtable_record_url: None | Unset | str if isinstance(self.airtable_record_url, Unset): airtable_record_url = UNSET else: airtable_record_url = self.airtable_record_url - freshservice_ticket_id: Union[None, Unset, str] + freshservice_ticket_id: None | Unset | str if isinstance(self.freshservice_ticket_id, Unset): freshservice_ticket_id = UNSET else: freshservice_ticket_id = self.freshservice_ticket_id - freshservice_ticket_url: Union[None, Unset, str] + freshservice_ticket_url: None | Unset | str if isinstance(self.freshservice_ticket_url, Unset): freshservice_ticket_url = UNSET else: freshservice_ticket_url = self.freshservice_ticket_url - freshservice_task_id: Union[None, Unset, str] + freshservice_task_id: None | Unset | str if isinstance(self.freshservice_task_id, Unset): freshservice_task_id = UNSET else: freshservice_task_id = self.freshservice_task_id - freshservice_task_url: Union[None, Unset, str] + freshservice_task_url: None | Unset | str if isinstance(self.freshservice_task_url, Unset): freshservice_task_url = UNSET else: freshservice_task_url = self.freshservice_task_url - mitigation_message: Union[None, Unset, str] + mitigation_message: None | Unset | str if isinstance(self.mitigation_message, Unset): mitigation_message = UNSET else: mitigation_message = self.mitigation_message - resolution_message: Union[None, Unset, str] + resolution_message: None | Unset | str if isinstance(self.resolution_message, Unset): resolution_message = UNSET else: resolution_message = self.resolution_message - cancellation_message: Union[None, Unset, str] + cancellation_message: None | Unset | str if isinstance(self.cancellation_message, Unset): cancellation_message = UNSET else: cancellation_message = self.cancellation_message - scheduled_for: Union[None, Unset, str] + scheduled_for: None | Unset | str if isinstance(self.scheduled_for, Unset): scheduled_for = UNSET else: scheduled_for = self.scheduled_for - scheduled_until: Union[None, Unset, str] + scheduled_until: None | Unset | str if isinstance(self.scheduled_until, Unset): scheduled_until = UNSET else: scheduled_until = self.scheduled_until - muted_service_ids: Union[None, Unset, list[str]] + muted_service_ids: None | Unset | list[str] if isinstance(self.muted_service_ids, Unset): muted_service_ids = UNSET elif isinstance(self.muted_service_ids, list): @@ -1058,11 +1056,11 @@ def to_dict(self) -> dict[str, Any]: else: muted_service_ids = self.muted_service_ids - retrospective_progress_status: Union[Unset, str] = UNSET + retrospective_progress_status: Unset | str = UNSET if not isinstance(self.retrospective_progress_status, Unset): retrospective_progress_status = self.retrospective_progress_status - in_triage_by: Union[None, Unset, dict[str, Any]] + in_triage_by: None | Unset | dict[str, Any] if isinstance(self.in_triage_by, Unset): in_triage_by = UNSET elif isinstance(self.in_triage_by, IncidentInTriageByType0): @@ -1070,7 +1068,7 @@ def to_dict(self) -> dict[str, Any]: else: in_triage_by = self.in_triage_by - started_by: Union[None, Unset, dict[str, Any]] + started_by: None | Unset | dict[str, Any] if isinstance(self.started_by, Unset): started_by = UNSET elif isinstance(self.started_by, IncidentStartedByType0): @@ -1078,7 +1076,7 @@ def to_dict(self) -> dict[str, Any]: else: started_by = self.started_by - mitigated_by: Union[None, Unset, dict[str, Any]] + mitigated_by: None | Unset | dict[str, Any] if isinstance(self.mitigated_by, Unset): mitigated_by = UNSET elif isinstance(self.mitigated_by, IncidentMitigatedByType0): @@ -1086,7 +1084,7 @@ def to_dict(self) -> dict[str, Any]: else: mitigated_by = self.mitigated_by - resolved_by: Union[None, Unset, dict[str, Any]] + resolved_by: None | Unset | dict[str, Any] if isinstance(self.resolved_by, Unset): resolved_by = UNSET elif isinstance(self.resolved_by, IncidentResolvedByType0): @@ -1094,7 +1092,7 @@ def to_dict(self) -> dict[str, Any]: else: resolved_by = self.resolved_by - closed_by: Union[None, Unset, dict[str, Any]] + closed_by: None | Unset | dict[str, Any] if isinstance(self.closed_by, Unset): closed_by = UNSET elif isinstance(self.closed_by, IncidentClosedByType0): @@ -1102,7 +1100,7 @@ def to_dict(self) -> dict[str, Any]: else: closed_by = self.closed_by - cancelled_by: Union[None, Unset, dict[str, Any]] + cancelled_by: None | Unset | dict[str, Any] if isinstance(self.cancelled_by, Unset): cancelled_by = UNSET elif isinstance(self.cancelled_by, IncidentCancelledByType0): @@ -1110,49 +1108,49 @@ def to_dict(self) -> dict[str, Any]: else: cancelled_by = self.cancelled_by - in_triage_at: Union[None, Unset, str] + in_triage_at: None | Unset | str if isinstance(self.in_triage_at, Unset): in_triage_at = UNSET else: in_triage_at = self.in_triage_at - started_at: Union[None, Unset, str] + started_at: None | Unset | str if isinstance(self.started_at, Unset): started_at = UNSET else: started_at = self.started_at - detected_at: Union[None, Unset, str] + detected_at: None | Unset | str if isinstance(self.detected_at, Unset): detected_at = UNSET else: detected_at = self.detected_at - acknowledged_at: Union[None, Unset, str] + acknowledged_at: None | Unset | str if isinstance(self.acknowledged_at, Unset): acknowledged_at = UNSET else: acknowledged_at = self.acknowledged_at - mitigated_at: Union[None, Unset, str] + mitigated_at: None | Unset | str if isinstance(self.mitigated_at, Unset): mitigated_at = UNSET else: mitigated_at = self.mitigated_at - resolved_at: Union[None, Unset, str] + resolved_at: None | Unset | str if isinstance(self.resolved_at, Unset): resolved_at = UNSET else: resolved_at = self.resolved_at - closed_at: Union[None, Unset, str] + closed_at: None | Unset | str if isinstance(self.closed_at, Unset): closed_at = UNSET else: closed_at = self.closed_at - cancelled_at: Union[None, Unset, str] + cancelled_at: None | Unset | str if isinstance(self.cancelled_at, Unset): cancelled_at = UNSET else: @@ -1469,77 +1467,77 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: slug = d.pop("slug", UNSET) - def _parse_parent_incident_id(data: object) -> Union[None, Unset, str]: + def _parse_parent_incident_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) parent_incident_id = _parse_parent_incident_id(d.pop("parent_incident_id", UNSET)) - def _parse_duplicate_incident_id(data: object) -> Union[None, Unset, str]: + def _parse_duplicate_incident_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) duplicate_incident_id = _parse_duplicate_incident_id(d.pop("duplicate_incident_id", UNSET)) - def _parse_summary(data: object) -> Union[None, Unset, str]: + def _parse_summary(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) summary = _parse_summary(d.pop("summary", UNSET)) private = d.pop("private", UNSET) - def _parse_source(data: object) -> Union[None, Unset, str]: + def _parse_source(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) source = _parse_source(d.pop("source", UNSET)) - def _parse_status(data: object) -> Union[None, Unset, str]: + def _parse_status(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) status = _parse_status(d.pop("status", UNSET)) - def _parse_url(data: object) -> Union[None, Unset, str]: + def _parse_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) url = _parse_url(d.pop("url", UNSET)) - def _parse_short_url(data: object) -> Union[None, Unset, str]: + def _parse_short_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) short_url = _parse_short_url(d.pop("short_url", UNSET)) - def _parse_public_title(data: object) -> Union[None, Unset, str]: + def _parse_public_title(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) public_title = _parse_public_title(d.pop("public_title", UNSET)) @@ -1561,13 +1559,13 @@ def _parse_user(data: object) -> Union["IncidentUserType0", None, Unset]: user = _parse_user(d.pop("user", UNSET)) _severity = d.pop("severity", UNSET) - severity: Union[Unset, SeverityResponse] + severity: Unset | SeverityResponse if isinstance(_severity, Unset): severity = UNSET else: severity = SeverityResponse.from_dict(_severity) - def _parse_environments(data: object) -> Union[None, Unset, list["EnvironmentResponse"]]: + def _parse_environments(data: object) -> None | Unset | list["EnvironmentResponse"]: if data is None: return data if isinstance(data, Unset): @@ -1585,11 +1583,11 @@ def _parse_environments(data: object) -> Union[None, Unset, list["EnvironmentRes return environments_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list["EnvironmentResponse"]], data) + return cast(None | Unset | list["EnvironmentResponse"], data) environments = _parse_environments(d.pop("environments", UNSET)) - def _parse_incident_types(data: object) -> Union[None, Unset, list["IncidentTypeResponse"]]: + def _parse_incident_types(data: object) -> None | Unset | list["IncidentTypeResponse"]: if data is None: return data if isinstance(data, Unset): @@ -1607,11 +1605,11 @@ def _parse_incident_types(data: object) -> Union[None, Unset, list["IncidentType return incident_types_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list["IncidentTypeResponse"]], data) + return cast(None | Unset | list["IncidentTypeResponse"], data) incident_types = _parse_incident_types(d.pop("incident_types", UNSET)) - def _parse_services(data: object) -> Union[None, Unset, list["ServiceResponse"]]: + def _parse_services(data: object) -> None | Unset | list["ServiceResponse"]: if data is None: return data if isinstance(data, Unset): @@ -1629,11 +1627,11 @@ def _parse_services(data: object) -> Union[None, Unset, list["ServiceResponse"]] return services_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list["ServiceResponse"]], data) + return cast(None | Unset | list["ServiceResponse"], data) services = _parse_services(d.pop("services", UNSET)) - def _parse_functionalities(data: object) -> Union[None, Unset, list["FunctionalityResponse"]]: + def _parse_functionalities(data: object) -> None | Unset | list["FunctionalityResponse"]: if data is None: return data if isinstance(data, Unset): @@ -1651,11 +1649,11 @@ def _parse_functionalities(data: object) -> Union[None, Unset, list["Functionali return functionalities_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list["FunctionalityResponse"]], data) + return cast(None | Unset | list["FunctionalityResponse"], data) functionalities = _parse_functionalities(d.pop("functionalities", UNSET)) - def _parse_groups(data: object) -> Union[None, Unset, list["TeamResponse"]]: + def _parse_groups(data: object) -> None | Unset | list["TeamResponse"]: if data is None: return data if isinstance(data, Unset): @@ -1673,7 +1671,7 @@ def _parse_groups(data: object) -> Union[None, Unset, list["TeamResponse"]]: return groups_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list["TeamResponse"]], data) + return cast(None | Unset | list["TeamResponse"], data) groups = _parse_groups(d.pop("groups", UNSET)) @@ -1694,126 +1692,126 @@ def _parse_labels(data: object) -> Union["IncidentLabelsType0", None, Unset]: labels = _parse_labels(d.pop("labels", UNSET)) - def _parse_slack_channel_id(data: object) -> Union[None, Unset, str]: + def _parse_slack_channel_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) slack_channel_id = _parse_slack_channel_id(d.pop("slack_channel_id", UNSET)) - def _parse_slack_channel_name(data: object) -> Union[None, Unset, str]: + def _parse_slack_channel_name(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) slack_channel_name = _parse_slack_channel_name(d.pop("slack_channel_name", UNSET)) - def _parse_slack_channel_url(data: object) -> Union[None, Unset, str]: + def _parse_slack_channel_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) slack_channel_url = _parse_slack_channel_url(d.pop("slack_channel_url", UNSET)) - def _parse_slack_channel_short_url(data: object) -> Union[None, Unset, str]: + def _parse_slack_channel_short_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) slack_channel_short_url = _parse_slack_channel_short_url(d.pop("slack_channel_short_url", UNSET)) - def _parse_slack_channel_deep_link(data: object) -> Union[None, Unset, str]: + def _parse_slack_channel_deep_link(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) slack_channel_deep_link = _parse_slack_channel_deep_link(d.pop("slack_channel_deep_link", UNSET)) - def _parse_slack_channel_archived(data: object) -> Union[None, Unset, bool]: + def _parse_slack_channel_archived(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) slack_channel_archived = _parse_slack_channel_archived(d.pop("slack_channel_archived", UNSET)) - def _parse_slack_last_message_ts(data: object) -> Union[None, Unset, str]: + def _parse_slack_last_message_ts(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) slack_last_message_ts = _parse_slack_last_message_ts(d.pop("slack_last_message_ts", UNSET)) - def _parse_zoom_meeting_id(data: object) -> Union[None, Unset, str]: + def _parse_zoom_meeting_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) zoom_meeting_id = _parse_zoom_meeting_id(d.pop("zoom_meeting_id", UNSET)) - def _parse_zoom_meeting_start_url(data: object) -> Union[None, Unset, str]: + def _parse_zoom_meeting_start_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) zoom_meeting_start_url = _parse_zoom_meeting_start_url(d.pop("zoom_meeting_start_url", UNSET)) - def _parse_zoom_meeting_join_url(data: object) -> Union[None, Unset, str]: + def _parse_zoom_meeting_join_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) zoom_meeting_join_url = _parse_zoom_meeting_join_url(d.pop("zoom_meeting_join_url", UNSET)) - def _parse_zoom_meeting_password(data: object) -> Union[None, Unset, str]: + def _parse_zoom_meeting_password(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) zoom_meeting_password = _parse_zoom_meeting_password(d.pop("zoom_meeting_password", UNSET)) - def _parse_zoom_meeting_pstn_password(data: object) -> Union[None, Unset, str]: + def _parse_zoom_meeting_pstn_password(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) zoom_meeting_pstn_password = _parse_zoom_meeting_pstn_password(d.pop("zoom_meeting_pstn_password", UNSET)) - def _parse_zoom_meeting_h323_password(data: object) -> Union[None, Unset, str]: + def _parse_zoom_meeting_h323_password(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) zoom_meeting_h323_password = _parse_zoom_meeting_h323_password(d.pop("zoom_meeting_h323_password", UNSET)) def _parse_zoom_meeting_global_dial_in_numbers( data: object, - ) -> Union[None, Unset, list["IncidentZoomMeetingGlobalDialInNumbersType0Item"]]: + ) -> None | Unset | list["IncidentZoomMeetingGlobalDialInNumbersType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -1835,744 +1833,744 @@ def _parse_zoom_meeting_global_dial_in_numbers( return zoom_meeting_global_dial_in_numbers_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list["IncidentZoomMeetingGlobalDialInNumbersType0Item"]], data) + return cast(None | Unset | list["IncidentZoomMeetingGlobalDialInNumbersType0Item"], data) zoom_meeting_global_dial_in_numbers = _parse_zoom_meeting_global_dial_in_numbers( d.pop("zoom_meeting_global_dial_in_numbers", UNSET) ) - def _parse_google_drive_id(data: object) -> Union[None, Unset, str]: + def _parse_google_drive_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) google_drive_id = _parse_google_drive_id(d.pop("google_drive_id", UNSET)) - def _parse_google_drive_parent_id(data: object) -> Union[None, Unset, str]: + def _parse_google_drive_parent_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) google_drive_parent_id = _parse_google_drive_parent_id(d.pop("google_drive_parent_id", UNSET)) - def _parse_google_drive_url(data: object) -> Union[None, Unset, str]: + def _parse_google_drive_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) google_drive_url = _parse_google_drive_url(d.pop("google_drive_url", UNSET)) - def _parse_google_meeting_id(data: object) -> Union[None, Unset, str]: + def _parse_google_meeting_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) google_meeting_id = _parse_google_meeting_id(d.pop("google_meeting_id", UNSET)) - def _parse_google_meeting_url(data: object) -> Union[None, Unset, str]: + def _parse_google_meeting_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) google_meeting_url = _parse_google_meeting_url(d.pop("google_meeting_url", UNSET)) - def _parse_microsoft_teams_meeting_id(data: object) -> Union[None, Unset, str]: + def _parse_microsoft_teams_meeting_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) microsoft_teams_meeting_id = _parse_microsoft_teams_meeting_id(d.pop("microsoft_teams_meeting_id", UNSET)) - def _parse_microsoft_teams_meeting_url(data: object) -> Union[None, Unset, str]: + def _parse_microsoft_teams_meeting_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) microsoft_teams_meeting_url = _parse_microsoft_teams_meeting_url(d.pop("microsoft_teams_meeting_url", UNSET)) - def _parse_microsoft_teams_channel_id(data: object) -> Union[None, Unset, str]: + def _parse_microsoft_teams_channel_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) microsoft_teams_channel_id = _parse_microsoft_teams_channel_id(d.pop("microsoft_teams_channel_id", UNSET)) - def _parse_microsoft_teams_channel_name(data: object) -> Union[None, Unset, str]: + def _parse_microsoft_teams_channel_name(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) microsoft_teams_channel_name = _parse_microsoft_teams_channel_name(d.pop("microsoft_teams_channel_name", UNSET)) - def _parse_microsoft_teams_channel_url(data: object) -> Union[None, Unset, str]: + def _parse_microsoft_teams_channel_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) microsoft_teams_channel_url = _parse_microsoft_teams_channel_url(d.pop("microsoft_teams_channel_url", UNSET)) - def _parse_microsoft_teams_channel_short_url(data: object) -> Union[None, Unset, str]: + def _parse_microsoft_teams_channel_short_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) microsoft_teams_channel_short_url = _parse_microsoft_teams_channel_short_url( d.pop("microsoft_teams_channel_short_url", UNSET) ) - def _parse_microsoft_teams_chat_id(data: object) -> Union[None, Unset, str]: + def _parse_microsoft_teams_chat_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) microsoft_teams_chat_id = _parse_microsoft_teams_chat_id(d.pop("microsoft_teams_chat_id", UNSET)) - def _parse_microsoft_teams_chat_url(data: object) -> Union[None, Unset, str]: + def _parse_microsoft_teams_chat_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) microsoft_teams_chat_url = _parse_microsoft_teams_chat_url(d.pop("microsoft_teams_chat_url", UNSET)) - def _parse_microsoft_teams_team_id(data: object) -> Union[None, Unset, str]: + def _parse_microsoft_teams_team_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) microsoft_teams_team_id = _parse_microsoft_teams_team_id(d.pop("microsoft_teams_team_id", UNSET)) - def _parse_google_chat_space_id(data: object) -> Union[None, Unset, str]: + def _parse_google_chat_space_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) google_chat_space_id = _parse_google_chat_space_id(d.pop("google_chat_space_id", UNSET)) - def _parse_google_chat_space_name(data: object) -> Union[None, Unset, str]: + def _parse_google_chat_space_name(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) google_chat_space_name = _parse_google_chat_space_name(d.pop("google_chat_space_name", UNSET)) - def _parse_google_chat_space_url(data: object) -> Union[None, Unset, str]: + def _parse_google_chat_space_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) google_chat_space_url = _parse_google_chat_space_url(d.pop("google_chat_space_url", UNSET)) - def _parse_google_chat_space_short_url(data: object) -> Union[None, Unset, str]: + def _parse_google_chat_space_short_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) google_chat_space_short_url = _parse_google_chat_space_short_url(d.pop("google_chat_space_short_url", UNSET)) - def _parse_google_chat_space_archived(data: object) -> Union[None, Unset, bool]: + def _parse_google_chat_space_archived(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) google_chat_space_archived = _parse_google_chat_space_archived(d.pop("google_chat_space_archived", UNSET)) - def _parse_google_chat_space_domain_id(data: object) -> Union[None, Unset, str]: + def _parse_google_chat_space_domain_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) google_chat_space_domain_id = _parse_google_chat_space_domain_id(d.pop("google_chat_space_domain_id", UNSET)) - def _parse_webex_meeting_id(data: object) -> Union[None, Unset, str]: + def _parse_webex_meeting_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) webex_meeting_id = _parse_webex_meeting_id(d.pop("webex_meeting_id", UNSET)) - def _parse_webex_meeting_url(data: object) -> Union[None, Unset, str]: + def _parse_webex_meeting_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) webex_meeting_url = _parse_webex_meeting_url(d.pop("webex_meeting_url", UNSET)) - def _parse_jira_issue_key(data: object) -> Union[None, Unset, str]: + def _parse_jira_issue_key(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) jira_issue_key = _parse_jira_issue_key(d.pop("jira_issue_key", UNSET)) - def _parse_jira_issue_id(data: object) -> Union[None, Unset, str]: + def _parse_jira_issue_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) jira_issue_id = _parse_jira_issue_id(d.pop("jira_issue_id", UNSET)) - def _parse_jira_issue_url(data: object) -> Union[None, Unset, str]: + def _parse_jira_issue_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) jira_issue_url = _parse_jira_issue_url(d.pop("jira_issue_url", UNSET)) - def _parse_github_issue_id(data: object) -> Union[None, Unset, str]: + def _parse_github_issue_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) github_issue_id = _parse_github_issue_id(d.pop("github_issue_id", UNSET)) - def _parse_github_issue_url(data: object) -> Union[None, Unset, str]: + def _parse_github_issue_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) github_issue_url = _parse_github_issue_url(d.pop("github_issue_url", UNSET)) - def _parse_gitlab_issue_id(data: object) -> Union[None, Unset, str]: + def _parse_gitlab_issue_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) gitlab_issue_id = _parse_gitlab_issue_id(d.pop("gitlab_issue_id", UNSET)) - def _parse_gitlab_issue_url(data: object) -> Union[None, Unset, str]: + def _parse_gitlab_issue_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) gitlab_issue_url = _parse_gitlab_issue_url(d.pop("gitlab_issue_url", UNSET)) - def _parse_asana_task_id(data: object) -> Union[None, Unset, str]: + def _parse_asana_task_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) asana_task_id = _parse_asana_task_id(d.pop("asana_task_id", UNSET)) - def _parse_asana_task_url(data: object) -> Union[None, Unset, str]: + def _parse_asana_task_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) asana_task_url = _parse_asana_task_url(d.pop("asana_task_url", UNSET)) - def _parse_linear_issue_id(data: object) -> Union[None, Unset, str]: + def _parse_linear_issue_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) linear_issue_id = _parse_linear_issue_id(d.pop("linear_issue_id", UNSET)) - def _parse_linear_issue_url(data: object) -> Union[None, Unset, str]: + def _parse_linear_issue_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) linear_issue_url = _parse_linear_issue_url(d.pop("linear_issue_url", UNSET)) - def _parse_trello_card_id(data: object) -> Union[None, Unset, str]: + def _parse_trello_card_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) trello_card_id = _parse_trello_card_id(d.pop("trello_card_id", UNSET)) - def _parse_trello_card_url(data: object) -> Union[None, Unset, str]: + def _parse_trello_card_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) trello_card_url = _parse_trello_card_url(d.pop("trello_card_url", UNSET)) - def _parse_zendesk_ticket_id(data: object) -> Union[None, Unset, str]: + def _parse_zendesk_ticket_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) zendesk_ticket_id = _parse_zendesk_ticket_id(d.pop("zendesk_ticket_id", UNSET)) - def _parse_zendesk_ticket_url(data: object) -> Union[None, Unset, str]: + def _parse_zendesk_ticket_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) zendesk_ticket_url = _parse_zendesk_ticket_url(d.pop("zendesk_ticket_url", UNSET)) - def _parse_pagerduty_incident_id(data: object) -> Union[None, Unset, str]: + def _parse_pagerduty_incident_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) pagerduty_incident_id = _parse_pagerduty_incident_id(d.pop("pagerduty_incident_id", UNSET)) - def _parse_pagerduty_incident_number(data: object) -> Union[None, Unset, str]: + def _parse_pagerduty_incident_number(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) pagerduty_incident_number = _parse_pagerduty_incident_number(d.pop("pagerduty_incident_number", UNSET)) - def _parse_pagerduty_incident_url(data: object) -> Union[None, Unset, str]: + def _parse_pagerduty_incident_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) pagerduty_incident_url = _parse_pagerduty_incident_url(d.pop("pagerduty_incident_url", UNSET)) - def _parse_opsgenie_incident_id(data: object) -> Union[None, Unset, str]: + def _parse_opsgenie_incident_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) opsgenie_incident_id = _parse_opsgenie_incident_id(d.pop("opsgenie_incident_id", UNSET)) - def _parse_opsgenie_incident_url(data: object) -> Union[None, Unset, str]: + def _parse_opsgenie_incident_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) opsgenie_incident_url = _parse_opsgenie_incident_url(d.pop("opsgenie_incident_url", UNSET)) - def _parse_opsgenie_alert_id(data: object) -> Union[None, Unset, str]: + def _parse_opsgenie_alert_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) opsgenie_alert_id = _parse_opsgenie_alert_id(d.pop("opsgenie_alert_id", UNSET)) - def _parse_opsgenie_alert_url(data: object) -> Union[None, Unset, str]: + def _parse_opsgenie_alert_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) opsgenie_alert_url = _parse_opsgenie_alert_url(d.pop("opsgenie_alert_url", UNSET)) - def _parse_service_now_incident_id(data: object) -> Union[None, Unset, str]: + def _parse_service_now_incident_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) service_now_incident_id = _parse_service_now_incident_id(d.pop("service_now_incident_id", UNSET)) - def _parse_service_now_incident_key(data: object) -> Union[None, Unset, str]: + def _parse_service_now_incident_key(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) service_now_incident_key = _parse_service_now_incident_key(d.pop("service_now_incident_key", UNSET)) - def _parse_service_now_incident_url(data: object) -> Union[None, Unset, str]: + def _parse_service_now_incident_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) service_now_incident_url = _parse_service_now_incident_url(d.pop("service_now_incident_url", UNSET)) - def _parse_mattermost_channel_id(data: object) -> Union[None, Unset, str]: + def _parse_mattermost_channel_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) mattermost_channel_id = _parse_mattermost_channel_id(d.pop("mattermost_channel_id", UNSET)) - def _parse_mattermost_channel_name(data: object) -> Union[None, Unset, str]: + def _parse_mattermost_channel_name(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) mattermost_channel_name = _parse_mattermost_channel_name(d.pop("mattermost_channel_name", UNSET)) - def _parse_mattermost_channel_url(data: object) -> Union[None, Unset, str]: + def _parse_mattermost_channel_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) mattermost_channel_url = _parse_mattermost_channel_url(d.pop("mattermost_channel_url", UNSET)) - def _parse_confluence_page_id(data: object) -> Union[None, Unset, str]: + def _parse_confluence_page_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) confluence_page_id = _parse_confluence_page_id(d.pop("confluence_page_id", UNSET)) - def _parse_confluence_page_url(data: object) -> Union[None, Unset, str]: + def _parse_confluence_page_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) confluence_page_url = _parse_confluence_page_url(d.pop("confluence_page_url", UNSET)) - def _parse_datadog_notebook_id(data: object) -> Union[None, Unset, str]: + def _parse_datadog_notebook_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) datadog_notebook_id = _parse_datadog_notebook_id(d.pop("datadog_notebook_id", UNSET)) - def _parse_datadog_notebook_url(data: object) -> Union[None, Unset, str]: + def _parse_datadog_notebook_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) datadog_notebook_url = _parse_datadog_notebook_url(d.pop("datadog_notebook_url", UNSET)) - def _parse_shortcut_story_id(data: object) -> Union[None, Unset, str]: + def _parse_shortcut_story_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) shortcut_story_id = _parse_shortcut_story_id(d.pop("shortcut_story_id", UNSET)) - def _parse_shortcut_story_url(data: object) -> Union[None, Unset, str]: + def _parse_shortcut_story_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) shortcut_story_url = _parse_shortcut_story_url(d.pop("shortcut_story_url", UNSET)) - def _parse_shortcut_task_id(data: object) -> Union[None, Unset, str]: + def _parse_shortcut_task_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) shortcut_task_id = _parse_shortcut_task_id(d.pop("shortcut_task_id", UNSET)) - def _parse_shortcut_task_url(data: object) -> Union[None, Unset, str]: + def _parse_shortcut_task_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) shortcut_task_url = _parse_shortcut_task_url(d.pop("shortcut_task_url", UNSET)) - def _parse_motion_task_id(data: object) -> Union[None, Unset, str]: + def _parse_motion_task_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) motion_task_id = _parse_motion_task_id(d.pop("motion_task_id", UNSET)) - def _parse_motion_task_url(data: object) -> Union[None, Unset, str]: + def _parse_motion_task_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) motion_task_url = _parse_motion_task_url(d.pop("motion_task_url", UNSET)) - def _parse_clickup_task_id(data: object) -> Union[None, Unset, str]: + def _parse_clickup_task_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) clickup_task_id = _parse_clickup_task_id(d.pop("clickup_task_id", UNSET)) - def _parse_clickup_task_url(data: object) -> Union[None, Unset, str]: + def _parse_clickup_task_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) clickup_task_url = _parse_clickup_task_url(d.pop("clickup_task_url", UNSET)) - def _parse_victor_ops_incident_id(data: object) -> Union[None, Unset, str]: + def _parse_victor_ops_incident_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) victor_ops_incident_id = _parse_victor_ops_incident_id(d.pop("victor_ops_incident_id", UNSET)) - def _parse_victor_ops_incident_url(data: object) -> Union[None, Unset, str]: + def _parse_victor_ops_incident_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) victor_ops_incident_url = _parse_victor_ops_incident_url(d.pop("victor_ops_incident_url", UNSET)) - def _parse_quip_page_id(data: object) -> Union[None, Unset, str]: + def _parse_quip_page_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) quip_page_id = _parse_quip_page_id(d.pop("quip_page_id", UNSET)) - def _parse_quip_page_url(data: object) -> Union[None, Unset, str]: + def _parse_quip_page_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) quip_page_url = _parse_quip_page_url(d.pop("quip_page_url", UNSET)) - def _parse_sharepoint_page_id(data: object) -> Union[None, Unset, str]: + def _parse_sharepoint_page_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) sharepoint_page_id = _parse_sharepoint_page_id(d.pop("sharepoint_page_id", UNSET)) - def _parse_sharepoint_page_url(data: object) -> Union[None, Unset, str]: + def _parse_sharepoint_page_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) sharepoint_page_url = _parse_sharepoint_page_url(d.pop("sharepoint_page_url", UNSET)) - def _parse_airtable_base_key(data: object) -> Union[None, Unset, str]: + def _parse_airtable_base_key(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) airtable_base_key = _parse_airtable_base_key(d.pop("airtable_base_key", UNSET)) - def _parse_airtable_table_name(data: object) -> Union[None, Unset, str]: + def _parse_airtable_table_name(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) airtable_table_name = _parse_airtable_table_name(d.pop("airtable_table_name", UNSET)) - def _parse_airtable_record_id(data: object) -> Union[None, Unset, str]: + def _parse_airtable_record_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) airtable_record_id = _parse_airtable_record_id(d.pop("airtable_record_id", UNSET)) - def _parse_airtable_record_url(data: object) -> Union[None, Unset, str]: + def _parse_airtable_record_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) airtable_record_url = _parse_airtable_record_url(d.pop("airtable_record_url", UNSET)) - def _parse_freshservice_ticket_id(data: object) -> Union[None, Unset, str]: + def _parse_freshservice_ticket_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) freshservice_ticket_id = _parse_freshservice_ticket_id(d.pop("freshservice_ticket_id", UNSET)) - def _parse_freshservice_ticket_url(data: object) -> Union[None, Unset, str]: + def _parse_freshservice_ticket_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) freshservice_ticket_url = _parse_freshservice_ticket_url(d.pop("freshservice_ticket_url", UNSET)) - def _parse_freshservice_task_id(data: object) -> Union[None, Unset, str]: + def _parse_freshservice_task_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) freshservice_task_id = _parse_freshservice_task_id(d.pop("freshservice_task_id", UNSET)) - def _parse_freshservice_task_url(data: object) -> Union[None, Unset, str]: + def _parse_freshservice_task_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) freshservice_task_url = _parse_freshservice_task_url(d.pop("freshservice_task_url", UNSET)) - def _parse_mitigation_message(data: object) -> Union[None, Unset, str]: + def _parse_mitigation_message(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) mitigation_message = _parse_mitigation_message(d.pop("mitigation_message", UNSET)) - def _parse_resolution_message(data: object) -> Union[None, Unset, str]: + def _parse_resolution_message(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) resolution_message = _parse_resolution_message(d.pop("resolution_message", UNSET)) - def _parse_cancellation_message(data: object) -> Union[None, Unset, str]: + def _parse_cancellation_message(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) cancellation_message = _parse_cancellation_message(d.pop("cancellation_message", UNSET)) - def _parse_scheduled_for(data: object) -> Union[None, Unset, str]: + def _parse_scheduled_for(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) scheduled_for = _parse_scheduled_for(d.pop("scheduled_for", UNSET)) - def _parse_scheduled_until(data: object) -> Union[None, Unset, str]: + def _parse_scheduled_until(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) scheduled_until = _parse_scheduled_until(d.pop("scheduled_until", UNSET)) - def _parse_muted_service_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_muted_service_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -2585,12 +2583,12 @@ def _parse_muted_service_ids(data: object) -> Union[None, Unset, list[str]]: return muted_service_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) muted_service_ids = _parse_muted_service_ids(d.pop("muted_service_ids", UNSET)) _retrospective_progress_status = d.pop("retrospective_progress_status", UNSET) - retrospective_progress_status: Union[Unset, IncidentRetrospectiveProgressStatus] + retrospective_progress_status: Unset | IncidentRetrospectiveProgressStatus if isinstance(_retrospective_progress_status, Unset): retrospective_progress_status = UNSET else: @@ -2698,75 +2696,75 @@ def _parse_cancelled_by(data: object) -> Union["IncidentCancelledByType0", None, cancelled_by = _parse_cancelled_by(d.pop("cancelled_by", UNSET)) - def _parse_in_triage_at(data: object) -> Union[None, Unset, str]: + def _parse_in_triage_at(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) in_triage_at = _parse_in_triage_at(d.pop("in_triage_at", UNSET)) - def _parse_started_at(data: object) -> Union[None, Unset, str]: + def _parse_started_at(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) started_at = _parse_started_at(d.pop("started_at", UNSET)) - def _parse_detected_at(data: object) -> Union[None, Unset, str]: + def _parse_detected_at(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) detected_at = _parse_detected_at(d.pop("detected_at", UNSET)) - def _parse_acknowledged_at(data: object) -> Union[None, Unset, str]: + def _parse_acknowledged_at(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) acknowledged_at = _parse_acknowledged_at(d.pop("acknowledged_at", UNSET)) - def _parse_mitigated_at(data: object) -> Union[None, Unset, str]: + def _parse_mitigated_at(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) mitigated_at = _parse_mitigated_at(d.pop("mitigated_at", UNSET)) - def _parse_resolved_at(data: object) -> Union[None, Unset, str]: + def _parse_resolved_at(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) resolved_at = _parse_resolved_at(d.pop("resolved_at", UNSET)) - def _parse_closed_at(data: object) -> Union[None, Unset, str]: + def _parse_closed_at(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) closed_at = _parse_closed_at(d.pop("closed_at", UNSET)) - def _parse_cancelled_at(data: object) -> Union[None, Unset, str]: + def _parse_cancelled_at(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) cancelled_at = _parse_cancelled_at(d.pop("cancelled_at", UNSET)) diff --git a/rootly_sdk/models/incident_action_item.py b/rootly_sdk/models/incident_action_item.py index 332f70c7..cdb4826d 100644 --- a/rootly_sdk/models/incident_action_item.py +++ b/rootly_sdk/models/incident_action_item.py @@ -41,16 +41,16 @@ class IncidentActionItem: summary: str created_at: str updated_at: str - description: Union[None, Unset, str] = UNSET - kind: Union[Unset, IncidentActionItemKind] = UNSET + description: None | Unset | str = UNSET + kind: Unset | IncidentActionItemKind = UNSET assigned_to: Union[Unset, "UserFlatResponse"] = UNSET - assigned_to_group_ids: Union[None, Unset, list[str]] = UNSET - priority: Union[Unset, IncidentActionItemPriority] = UNSET - status: Union[Unset, IncidentActionItemStatus] = UNSET - due_date: Union[None, Unset, str] = UNSET - jira_issue_id: Union[None, Unset, str] = UNSET - jira_issue_key: Union[None, Unset, str] = UNSET - jira_issue_url: Union[None, Unset, str] = UNSET + assigned_to_group_ids: None | Unset | list[str] = UNSET + priority: Unset | IncidentActionItemPriority = UNSET + status: Unset | IncidentActionItemStatus = UNSET + due_date: None | Unset | str = UNSET + jira_issue_id: None | Unset | str = UNSET + jira_issue_key: None | Unset | str = UNSET + jira_issue_url: None | Unset | str = UNSET created_by: Union[Unset, "UserFlatResponse"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -61,21 +61,21 @@ def to_dict(self) -> dict[str, Any]: updated_at = self.updated_at - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - kind: Union[Unset, str] = UNSET + kind: Unset | str = UNSET if not isinstance(self.kind, Unset): kind = self.kind - assigned_to: Union[Unset, dict[str, Any]] = UNSET + assigned_to: Unset | dict[str, Any] = UNSET if not isinstance(self.assigned_to, Unset): assigned_to = self.assigned_to.to_dict() - assigned_to_group_ids: Union[None, Unset, list[str]] + assigned_to_group_ids: None | Unset | list[str] if isinstance(self.assigned_to_group_ids, Unset): assigned_to_group_ids = UNSET elif isinstance(self.assigned_to_group_ids, list): @@ -84,39 +84,39 @@ def to_dict(self) -> dict[str, Any]: else: assigned_to_group_ids = self.assigned_to_group_ids - priority: Union[Unset, str] = UNSET + priority: Unset | str = UNSET if not isinstance(self.priority, Unset): priority = self.priority - status: Union[Unset, str] = UNSET + status: Unset | str = UNSET if not isinstance(self.status, Unset): status = self.status - due_date: Union[None, Unset, str] + due_date: None | Unset | str if isinstance(self.due_date, Unset): due_date = UNSET else: due_date = self.due_date - jira_issue_id: Union[None, Unset, str] + jira_issue_id: None | Unset | str if isinstance(self.jira_issue_id, Unset): jira_issue_id = UNSET else: jira_issue_id = self.jira_issue_id - jira_issue_key: Union[None, Unset, str] + jira_issue_key: None | Unset | str if isinstance(self.jira_issue_key, Unset): jira_issue_key = UNSET else: jira_issue_key = self.jira_issue_key - jira_issue_url: Union[None, Unset, str] + jira_issue_url: None | Unset | str if isinstance(self.jira_issue_url, Unset): jira_issue_url = UNSET else: jira_issue_url = self.jira_issue_url - created_by: Union[Unset, dict[str, Any]] = UNSET + created_by: Unset | dict[str, Any] = UNSET if not isinstance(self.created_by, Unset): created_by = self.created_by.to_dict() @@ -165,30 +165,30 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: updated_at = d.pop("updated_at") - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) _kind = d.pop("kind", UNSET) - kind: Union[Unset, IncidentActionItemKind] + kind: Unset | IncidentActionItemKind if isinstance(_kind, Unset): kind = UNSET else: kind = check_incident_action_item_kind(_kind) _assigned_to = d.pop("assigned_to", UNSET) - assigned_to: Union[Unset, UserFlatResponse] + assigned_to: Unset | UserFlatResponse if isinstance(_assigned_to, Unset): assigned_to = UNSET else: assigned_to = UserFlatResponse.from_dict(_assigned_to) - def _parse_assigned_to_group_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_assigned_to_group_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -201,62 +201,62 @@ def _parse_assigned_to_group_ids(data: object) -> Union[None, Unset, list[str]]: return assigned_to_group_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) assigned_to_group_ids = _parse_assigned_to_group_ids(d.pop("assigned_to_group_ids", UNSET)) _priority = d.pop("priority", UNSET) - priority: Union[Unset, IncidentActionItemPriority] + priority: Unset | IncidentActionItemPriority if isinstance(_priority, Unset): priority = UNSET else: priority = check_incident_action_item_priority(_priority) _status = d.pop("status", UNSET) - status: Union[Unset, IncidentActionItemStatus] + status: Unset | IncidentActionItemStatus if isinstance(_status, Unset): status = UNSET else: status = check_incident_action_item_status(_status) - def _parse_due_date(data: object) -> Union[None, Unset, str]: + def _parse_due_date(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) due_date = _parse_due_date(d.pop("due_date", UNSET)) - def _parse_jira_issue_id(data: object) -> Union[None, Unset, str]: + def _parse_jira_issue_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) jira_issue_id = _parse_jira_issue_id(d.pop("jira_issue_id", UNSET)) - def _parse_jira_issue_key(data: object) -> Union[None, Unset, str]: + def _parse_jira_issue_key(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) jira_issue_key = _parse_jira_issue_key(d.pop("jira_issue_key", UNSET)) - def _parse_jira_issue_url(data: object) -> Union[None, Unset, str]: + def _parse_jira_issue_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) jira_issue_url = _parse_jira_issue_url(d.pop("jira_issue_url", UNSET)) _created_by = d.pop("created_by", UNSET) - created_by: Union[Unset, UserFlatResponse] + created_by: Unset | UserFlatResponse if isinstance(_created_by, Unset): created_by = UNSET else: diff --git a/rootly_sdk/models/incident_action_item_list.py b/rootly_sdk/models/incident_action_item_list.py index 69503bcb..4644a6d0 100644 --- a/rootly_sdk/models/incident_action_item_list.py +++ b/rootly_sdk/models/incident_action_item_list.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,7 +29,7 @@ class IncidentActionItemList: data: list["IncidentActionItemListDataItem"] links: "Links" meta: "Meta" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/incident_action_item_response.py b/rootly_sdk/models/incident_action_item_response.py index be2da360..a6bfaa1a 100644 --- a/rootly_sdk/models/incident_action_item_response.py +++ b/rootly_sdk/models/incident_action_item_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,13 +23,13 @@ class IncidentActionItemResponse: """ data: "IncidentActionItemResponseData" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/incident_custom_field_selection.py b/rootly_sdk/models/incident_custom_field_selection.py index 5002b00e..d1a07a29 100644 --- a/rootly_sdk/models/incident_custom_field_selection.py +++ b/rootly_sdk/models/incident_custom_field_selection.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,14 +19,14 @@ class IncidentCustomFieldSelection: custom_field_id (Union[Unset, int]): """ - value: Union[None, str] + value: None | str selected_option_ids: list[int] - incident_id: Union[Unset, str] = UNSET - custom_field_id: Union[Unset, int] = UNSET + incident_id: Unset | str = UNSET + custom_field_id: Unset | int = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - value: Union[None, str] + value: None | str value = self.value selected_option_ids = self.selected_option_ids @@ -54,10 +54,10 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_value(data: object) -> Union[None, str]: + def _parse_value(data: object) -> None | str: if data is None: return data - return cast(Union[None, str], data) + return cast(None | str, data) value = _parse_value(d.pop("value")) diff --git a/rootly_sdk/models/incident_custom_field_selection_list.py b/rootly_sdk/models/incident_custom_field_selection_list.py index 91616131..e43b5ed7 100644 --- a/rootly_sdk/models/incident_custom_field_selection_list.py +++ b/rootly_sdk/models/incident_custom_field_selection_list.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,7 +29,7 @@ class IncidentCustomFieldSelectionList: data: list["IncidentCustomFieldSelectionListDataItem"] links: "Links" meta: "Meta" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/incident_custom_field_selection_response.py b/rootly_sdk/models/incident_custom_field_selection_response.py index 1660f39d..a9b02f9c 100644 --- a/rootly_sdk/models/incident_custom_field_selection_response.py +++ b/rootly_sdk/models/incident_custom_field_selection_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,13 +23,13 @@ class IncidentCustomFieldSelectionResponse: """ data: "IncidentCustomFieldSelectionResponseData" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/incident_event.py b/rootly_sdk/models/incident_event.py index 389298bb..0b4a0f1a 100644 --- a/rootly_sdk/models/incident_event.py +++ b/rootly_sdk/models/incident_event.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -25,7 +25,7 @@ class IncidentEvent: occurred_at: str created_at: str updated_at: str - visibility: Union[Unset, IncidentEventVisibility] = UNSET + visibility: Unset | IncidentEventVisibility = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -37,7 +37,7 @@ def to_dict(self) -> dict[str, Any]: updated_at = self.updated_at - visibility: Union[Unset, str] = UNSET + visibility: Unset | str = UNSET if not isinstance(self.visibility, Unset): visibility = self.visibility @@ -68,7 +68,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: updated_at = d.pop("updated_at") _visibility = d.pop("visibility", UNSET) - visibility: Union[Unset, IncidentEventVisibility] + visibility: Unset | IncidentEventVisibility if isinstance(_visibility, Unset): visibility = UNSET else: diff --git a/rootly_sdk/models/incident_event_functionality_list.py b/rootly_sdk/models/incident_event_functionality_list.py index 775ed9ae..54d1a8ed 100644 --- a/rootly_sdk/models/incident_event_functionality_list.py +++ b/rootly_sdk/models/incident_event_functionality_list.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,7 +29,7 @@ class IncidentEventFunctionalityList: data: list["IncidentEventFunctionalityListDataItem"] links: "Links" meta: "Meta" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/incident_event_functionality_response.py b/rootly_sdk/models/incident_event_functionality_response.py index 7b0c7e98..df64b5a3 100644 --- a/rootly_sdk/models/incident_event_functionality_response.py +++ b/rootly_sdk/models/incident_event_functionality_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,13 +23,13 @@ class IncidentEventFunctionalityResponse: """ data: "IncidentEventFunctionalityResponseData" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/incident_event_list.py b/rootly_sdk/models/incident_event_list.py index 59b0ab96..de72b0b5 100644 --- a/rootly_sdk/models/incident_event_list.py +++ b/rootly_sdk/models/incident_event_list.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,7 +29,7 @@ class IncidentEventList: data: list["IncidentEventListDataItem"] links: "Links" meta: "Meta" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/incident_event_response.py b/rootly_sdk/models/incident_event_response.py index b63254b8..32ea9040 100644 --- a/rootly_sdk/models/incident_event_response.py +++ b/rootly_sdk/models/incident_event_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,13 +23,13 @@ class IncidentEventResponse: """ data: "IncidentEventResponseData" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/incident_event_service_list.py b/rootly_sdk/models/incident_event_service_list.py index d618b50c..4b620aab 100644 --- a/rootly_sdk/models/incident_event_service_list.py +++ b/rootly_sdk/models/incident_event_service_list.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,7 +29,7 @@ class IncidentEventServiceList: data: list["IncidentEventServiceListDataItem"] links: "Links" meta: "Meta" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/incident_event_service_response.py b/rootly_sdk/models/incident_event_service_response.py index 594a3460..a0abbb81 100644 --- a/rootly_sdk/models/incident_event_service_response.py +++ b/rootly_sdk/models/incident_event_service_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,13 +23,13 @@ class IncidentEventServiceResponse: """ data: "IncidentEventServiceResponseData" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/incident_feedback_list.py b/rootly_sdk/models/incident_feedback_list.py index 2c6a03ae..43c7dfb8 100644 --- a/rootly_sdk/models/incident_feedback_list.py +++ b/rootly_sdk/models/incident_feedback_list.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,7 +29,7 @@ class IncidentFeedbackList: data: list["IncidentFeedbackListDataItem"] links: "Links" meta: "Meta" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/incident_feedback_response.py b/rootly_sdk/models/incident_feedback_response.py index ba7e01cf..62f27c11 100644 --- a/rootly_sdk/models/incident_feedback_response.py +++ b/rootly_sdk/models/incident_feedback_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,13 +23,13 @@ class IncidentFeedbackResponse: """ data: "IncidentFeedbackResponseData" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/incident_form_field_selection.py b/rootly_sdk/models/incident_form_field_selection.py index 2fa61a86..97ee3216 100644 --- a/rootly_sdk/models/incident_form_field_selection.py +++ b/rootly_sdk/models/incident_form_field_selection.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,16 +29,16 @@ class IncidentFormFieldSelection: incident_id: str form_field_id: str - value: Union[None, Unset, str] = UNSET - selected_catalog_entity_ids: Union[Unset, list[str]] = UNSET - selected_group_ids: Union[Unset, list[str]] = UNSET - selected_option_ids: Union[Unset, list[str]] = UNSET - selected_service_ids: Union[Unset, list[str]] = UNSET - selected_functionality_ids: Union[Unset, list[str]] = UNSET - selected_user_ids: Union[Unset, list[int]] = UNSET - selected_environment_ids: Union[Unset, list[str]] = UNSET - selected_cause_ids: Union[Unset, list[str]] = UNSET - selected_incident_type_ids: Union[Unset, list[str]] = UNSET + value: None | Unset | str = UNSET + selected_catalog_entity_ids: Unset | list[str] = UNSET + selected_group_ids: Unset | list[str] = UNSET + selected_option_ids: Unset | list[str] = UNSET + selected_service_ids: Unset | list[str] = UNSET + selected_functionality_ids: Unset | list[str] = UNSET + selected_user_ids: Unset | list[int] = UNSET + selected_environment_ids: Unset | list[str] = UNSET + selected_cause_ids: Unset | list[str] = UNSET + selected_incident_type_ids: Unset | list[str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -46,45 +46,45 @@ def to_dict(self) -> dict[str, Any]: form_field_id = self.form_field_id - value: Union[None, Unset, str] + value: None | Unset | str if isinstance(self.value, Unset): value = UNSET else: value = self.value - selected_catalog_entity_ids: Union[Unset, list[str]] = UNSET + selected_catalog_entity_ids: Unset | list[str] = UNSET if not isinstance(self.selected_catalog_entity_ids, Unset): selected_catalog_entity_ids = self.selected_catalog_entity_ids - selected_group_ids: Union[Unset, list[str]] = UNSET + selected_group_ids: Unset | list[str] = UNSET if not isinstance(self.selected_group_ids, Unset): selected_group_ids = self.selected_group_ids - selected_option_ids: Union[Unset, list[str]] = UNSET + selected_option_ids: Unset | list[str] = UNSET if not isinstance(self.selected_option_ids, Unset): selected_option_ids = self.selected_option_ids - selected_service_ids: Union[Unset, list[str]] = UNSET + selected_service_ids: Unset | list[str] = UNSET if not isinstance(self.selected_service_ids, Unset): selected_service_ids = self.selected_service_ids - selected_functionality_ids: Union[Unset, list[str]] = UNSET + selected_functionality_ids: Unset | list[str] = UNSET if not isinstance(self.selected_functionality_ids, Unset): selected_functionality_ids = self.selected_functionality_ids - selected_user_ids: Union[Unset, list[int]] = UNSET + selected_user_ids: Unset | list[int] = UNSET if not isinstance(self.selected_user_ids, Unset): selected_user_ids = self.selected_user_ids - selected_environment_ids: Union[Unset, list[str]] = UNSET + selected_environment_ids: Unset | list[str] = UNSET if not isinstance(self.selected_environment_ids, Unset): selected_environment_ids = self.selected_environment_ids - selected_cause_ids: Union[Unset, list[str]] = UNSET + selected_cause_ids: Unset | list[str] = UNSET if not isinstance(self.selected_cause_ids, Unset): selected_cause_ids = self.selected_cause_ids - selected_incident_type_ids: Union[Unset, list[str]] = UNSET + selected_incident_type_ids: Unset | list[str] = UNSET if not isinstance(self.selected_incident_type_ids, Unset): selected_incident_type_ids = self.selected_incident_type_ids @@ -126,12 +126,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: form_field_id = d.pop("form_field_id") - def _parse_value(data: object) -> Union[None, Unset, str]: + def _parse_value(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) value = _parse_value(d.pop("value", UNSET)) diff --git a/rootly_sdk/models/incident_form_field_selection_list.py b/rootly_sdk/models/incident_form_field_selection_list.py index 5bd0fc8c..f16f722a 100644 --- a/rootly_sdk/models/incident_form_field_selection_list.py +++ b/rootly_sdk/models/incident_form_field_selection_list.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,7 +29,7 @@ class IncidentFormFieldSelectionList: data: list["IncidentFormFieldSelectionListDataItem"] links: "Links" meta: "Meta" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/incident_form_field_selection_response.py b/rootly_sdk/models/incident_form_field_selection_response.py index 45575848..b7e4c36f 100644 --- a/rootly_sdk/models/incident_form_field_selection_response.py +++ b/rootly_sdk/models/incident_form_field_selection_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,13 +23,13 @@ class IncidentFormFieldSelectionResponse: """ data: "IncidentFormFieldSelectionResponseData" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/incident_list.py b/rootly_sdk/models/incident_list.py index 61e13bb1..da1fff97 100644 --- a/rootly_sdk/models/incident_list.py +++ b/rootly_sdk/models/incident_list.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,7 +29,7 @@ class IncidentList: data: list["IncidentListDataItem"] links: "Links" meta: "Meta" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/incident_permission_set.py b/rootly_sdk/models/incident_permission_set.py index 2c549ea8..ca9eaaf7 100644 --- a/rootly_sdk/models/incident_permission_set.py +++ b/rootly_sdk/models/incident_permission_set.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -33,10 +33,10 @@ class IncidentPermissionSet: name: str created_at: str updated_at: str - slug: Union[Unset, str] = UNSET - description: Union[None, Unset, str] = UNSET - private_incident_permissions: Union[Unset, list[IncidentPermissionSetPrivateIncidentPermissionsItem]] = UNSET - public_incident_permissions: Union[Unset, list[IncidentPermissionSetPublicIncidentPermissionsItem]] = UNSET + slug: Unset | str = UNSET + description: None | Unset | str = UNSET + private_incident_permissions: Unset | list[IncidentPermissionSetPrivateIncidentPermissionsItem] = UNSET + public_incident_permissions: Unset | list[IncidentPermissionSetPublicIncidentPermissionsItem] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -48,20 +48,20 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - private_incident_permissions: Union[Unset, list[str]] = UNSET + private_incident_permissions: Unset | list[str] = UNSET if not isinstance(self.private_incident_permissions, Unset): private_incident_permissions = [] for private_incident_permissions_item_data in self.private_incident_permissions: private_incident_permissions_item: str = private_incident_permissions_item_data private_incident_permissions.append(private_incident_permissions_item) - public_incident_permissions: Union[Unset, list[str]] = UNSET + public_incident_permissions: Unset | list[str] = UNSET if not isinstance(self.public_incident_permissions, Unset): public_incident_permissions = [] for public_incident_permissions_item_data in self.public_incident_permissions: @@ -99,12 +99,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: slug = d.pop("slug", UNSET) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) diff --git a/rootly_sdk/models/incident_permission_set_boolean.py b/rootly_sdk/models/incident_permission_set_boolean.py index 25f42881..a61795ab 100644 --- a/rootly_sdk/models/incident_permission_set_boolean.py +++ b/rootly_sdk/models/incident_permission_set_boolean.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -28,9 +28,9 @@ class IncidentPermissionSetBoolean: kind: IncidentPermissionSetBooleanKind created_at: str updated_at: str - incident_permission_set_id: Union[Unset, str] = UNSET - private: Union[Unset, bool] = UNSET - enabled: Union[Unset, bool] = UNSET + incident_permission_set_id: Unset | str = UNSET + private: Unset | bool = UNSET + enabled: Unset | bool = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/incident_permission_set_boolean_list.py b/rootly_sdk/models/incident_permission_set_boolean_list.py index bf0e1697..aaf3a5d4 100644 --- a/rootly_sdk/models/incident_permission_set_boolean_list.py +++ b/rootly_sdk/models/incident_permission_set_boolean_list.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,7 +29,7 @@ class IncidentPermissionSetBooleanList: data: list["IncidentPermissionSetBooleanListDataItem"] links: "Links" meta: "Meta" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/incident_permission_set_boolean_response.py b/rootly_sdk/models/incident_permission_set_boolean_response.py index 42264ffd..4400150a 100644 --- a/rootly_sdk/models/incident_permission_set_boolean_response.py +++ b/rootly_sdk/models/incident_permission_set_boolean_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,13 +23,13 @@ class IncidentPermissionSetBooleanResponse: """ data: "IncidentPermissionSetBooleanResponseData" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/incident_permission_set_list.py b/rootly_sdk/models/incident_permission_set_list.py index 93150071..d847ecac 100644 --- a/rootly_sdk/models/incident_permission_set_list.py +++ b/rootly_sdk/models/incident_permission_set_list.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,7 +29,7 @@ class IncidentPermissionSetList: data: list["IncidentPermissionSetListDataItem"] links: "Links" meta: "Meta" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/incident_permission_set_resource.py b/rootly_sdk/models/incident_permission_set_resource.py index 9831ac62..9a6e6ccd 100644 --- a/rootly_sdk/models/incident_permission_set_resource.py +++ b/rootly_sdk/models/incident_permission_set_resource.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -30,9 +30,9 @@ class IncidentPermissionSetResource: kind: IncidentPermissionSetResourceKind created_at: str updated_at: str - private: Union[Unset, bool] = UNSET - resource_id: Union[Unset, str] = UNSET - resource_type: Union[Unset, str] = UNSET + private: Unset | bool = UNSET + resource_id: Unset | str = UNSET + resource_type: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/incident_permission_set_resource_list.py b/rootly_sdk/models/incident_permission_set_resource_list.py index 3f818b66..4ea3383e 100644 --- a/rootly_sdk/models/incident_permission_set_resource_list.py +++ b/rootly_sdk/models/incident_permission_set_resource_list.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,7 +29,7 @@ class IncidentPermissionSetResourceList: data: list["IncidentPermissionSetResourceListDataItem"] links: "Links" meta: "Meta" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/incident_permission_set_resource_response.py b/rootly_sdk/models/incident_permission_set_resource_response.py index 4fffb208..fc0bb33c 100644 --- a/rootly_sdk/models/incident_permission_set_resource_response.py +++ b/rootly_sdk/models/incident_permission_set_resource_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,13 +23,13 @@ class IncidentPermissionSetResourceResponse: """ data: "IncidentPermissionSetResourceResponseData" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/incident_permission_set_response.py b/rootly_sdk/models/incident_permission_set_response.py index 5ca5aa1a..f777d861 100644 --- a/rootly_sdk/models/incident_permission_set_response.py +++ b/rootly_sdk/models/incident_permission_set_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,13 +23,13 @@ class IncidentPermissionSetResponse: """ data: "IncidentPermissionSetResponseData" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/incident_post_mortem.py b/rootly_sdk/models/incident_post_mortem.py index 9f1e7134..73b656dc 100644 --- a/rootly_sdk/models/incident_post_mortem.py +++ b/rootly_sdk/models/incident_post_mortem.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -43,22 +43,22 @@ class IncidentPostMortem: title: str created_at: str updated_at: str - content: Union[None, Unset, str] = UNSET - status: Union[Unset, IncidentPostMortemStatus] = UNSET - started_at: Union[None, Unset, str] = UNSET - mitigated_at: Union[None, Unset, str] = UNSET - resolved_at: Union[None, Unset, str] = UNSET - show_timeline: Union[Unset, bool] = UNSET - show_timeline_trail: Union[Unset, bool] = UNSET - show_timeline_genius: Union[Unset, bool] = UNSET - show_timeline_tasks: Union[Unset, bool] = UNSET - show_timeline_action_items: Union[Unset, bool] = UNSET - show_timeline_order: Union[Unset, IncidentPostMortemShowTimelineOrder] = "desc" - show_services_impacted: Union[Unset, bool] = UNSET - show_functionalities_impacted: Union[Unset, bool] = UNSET - show_groups_impacted: Union[Unset, bool] = UNSET - show_alerts_attached: Union[Unset, bool] = UNSET - url: Union[Unset, str] = UNSET + content: None | Unset | str = UNSET + status: Unset | IncidentPostMortemStatus = UNSET + started_at: None | Unset | str = UNSET + mitigated_at: None | Unset | str = UNSET + resolved_at: None | Unset | str = UNSET + show_timeline: Unset | bool = UNSET + show_timeline_trail: Unset | bool = UNSET + show_timeline_genius: Unset | bool = UNSET + show_timeline_tasks: Unset | bool = UNSET + show_timeline_action_items: Unset | bool = UNSET + show_timeline_order: Unset | IncidentPostMortemShowTimelineOrder = "desc" + show_services_impacted: Unset | bool = UNSET + show_functionalities_impacted: Unset | bool = UNSET + show_groups_impacted: Unset | bool = UNSET + show_alerts_attached: Unset | bool = UNSET + url: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -68,29 +68,29 @@ def to_dict(self) -> dict[str, Any]: updated_at = self.updated_at - content: Union[None, Unset, str] + content: None | Unset | str if isinstance(self.content, Unset): content = UNSET else: content = self.content - status: Union[Unset, str] = UNSET + status: Unset | str = UNSET if not isinstance(self.status, Unset): status = self.status - started_at: Union[None, Unset, str] + started_at: None | Unset | str if isinstance(self.started_at, Unset): started_at = UNSET else: started_at = self.started_at - mitigated_at: Union[None, Unset, str] + mitigated_at: None | Unset | str if isinstance(self.mitigated_at, Unset): mitigated_at = UNSET else: mitigated_at = self.mitigated_at - resolved_at: Union[None, Unset, str] + resolved_at: None | Unset | str if isinstance(self.resolved_at, Unset): resolved_at = UNSET else: @@ -106,7 +106,7 @@ def to_dict(self) -> dict[str, Any]: show_timeline_action_items = self.show_timeline_action_items - show_timeline_order: Union[Unset, str] = UNSET + show_timeline_order: Unset | str = UNSET if not isinstance(self.show_timeline_order, Unset): show_timeline_order = self.show_timeline_order @@ -173,46 +173,46 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: updated_at = d.pop("updated_at") - def _parse_content(data: object) -> Union[None, Unset, str]: + def _parse_content(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) content = _parse_content(d.pop("content", UNSET)) _status = d.pop("status", UNSET) - status: Union[Unset, IncidentPostMortemStatus] + status: Unset | IncidentPostMortemStatus if isinstance(_status, Unset): status = UNSET else: status = check_incident_post_mortem_status(_status) - def _parse_started_at(data: object) -> Union[None, Unset, str]: + def _parse_started_at(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) started_at = _parse_started_at(d.pop("started_at", UNSET)) - def _parse_mitigated_at(data: object) -> Union[None, Unset, str]: + def _parse_mitigated_at(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) mitigated_at = _parse_mitigated_at(d.pop("mitigated_at", UNSET)) - def _parse_resolved_at(data: object) -> Union[None, Unset, str]: + def _parse_resolved_at(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) resolved_at = _parse_resolved_at(d.pop("resolved_at", UNSET)) @@ -227,7 +227,7 @@ def _parse_resolved_at(data: object) -> Union[None, Unset, str]: show_timeline_action_items = d.pop("show_timeline_action_items", UNSET) _show_timeline_order = d.pop("show_timeline_order", UNSET) - show_timeline_order: Union[Unset, IncidentPostMortemShowTimelineOrder] + show_timeline_order: Unset | IncidentPostMortemShowTimelineOrder if isinstance(_show_timeline_order, Unset): show_timeline_order = UNSET else: diff --git a/rootly_sdk/models/incident_post_mortem_list.py b/rootly_sdk/models/incident_post_mortem_list.py index e52082cc..f7efcaa0 100644 --- a/rootly_sdk/models/incident_post_mortem_list.py +++ b/rootly_sdk/models/incident_post_mortem_list.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,7 +29,7 @@ class IncidentPostMortemList: data: list["IncidentPostMortemListDataItem"] links: "Links" meta: "Meta" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/incident_post_mortem_response.py b/rootly_sdk/models/incident_post_mortem_response.py index 56ff66c1..1a0c29ab 100644 --- a/rootly_sdk/models/incident_post_mortem_response.py +++ b/rootly_sdk/models/incident_post_mortem_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,13 +23,13 @@ class IncidentPostMortemResponse: """ data: "IncidentPostMortemResponseData" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/incident_response.py b/rootly_sdk/models/incident_response.py index 9badb2d6..e77f749c 100644 --- a/rootly_sdk/models/incident_response.py +++ b/rootly_sdk/models/incident_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,13 +23,13 @@ class IncidentResponse: """ data: "IncidentResponseData" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/incident_retrospective_step.py b/rootly_sdk/models/incident_retrospective_step.py index 42814112..bdd48caa 100644 --- a/rootly_sdk/models/incident_retrospective_step.py +++ b/rootly_sdk/models/incident_retrospective_step.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -35,12 +35,12 @@ class IncidentRetrospectiveStep: title: str created_at: str updated_at: str - description: Union[None, Unset, str] = UNSET - status: Union[Unset, IncidentRetrospectiveStepStatus] = UNSET - kind: Union[None, Unset, str] = UNSET - due_date: Union[None, Unset, str] = UNSET - position: Union[Unset, int] = UNSET - skippable: Union[Unset, bool] = UNSET + description: None | Unset | str = UNSET + status: Unset | IncidentRetrospectiveStepStatus = UNSET + kind: None | Unset | str = UNSET + due_date: None | Unset | str = UNSET + position: Unset | int = UNSET + skippable: Unset | bool = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -54,23 +54,23 @@ def to_dict(self) -> dict[str, Any]: updated_at = self.updated_at - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - status: Union[Unset, str] = UNSET + status: Unset | str = UNSET if not isinstance(self.status, Unset): status = self.status - kind: Union[None, Unset, str] + kind: None | Unset | str if isinstance(self.kind, Unset): kind = UNSET else: kind = self.kind - due_date: Union[None, Unset, str] + due_date: None | Unset | str if isinstance(self.due_date, Unset): due_date = UNSET else: @@ -119,37 +119,37 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: updated_at = d.pop("updated_at") - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) _status = d.pop("status", UNSET) - status: Union[Unset, IncidentRetrospectiveStepStatus] + status: Unset | IncidentRetrospectiveStepStatus if isinstance(_status, Unset): status = UNSET else: status = check_incident_retrospective_step_status(_status) - def _parse_kind(data: object) -> Union[None, Unset, str]: + def _parse_kind(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) kind = _parse_kind(d.pop("kind", UNSET)) - def _parse_due_date(data: object) -> Union[None, Unset, str]: + def _parse_due_date(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) due_date = _parse_due_date(d.pop("due_date", UNSET)) diff --git a/rootly_sdk/models/incident_retrospective_step_response.py b/rootly_sdk/models/incident_retrospective_step_response.py index 820bea09..a30d5e05 100644 --- a/rootly_sdk/models/incident_retrospective_step_response.py +++ b/rootly_sdk/models/incident_retrospective_step_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,13 +23,13 @@ class IncidentRetrospectiveStepResponse: """ data: "IncidentRetrospectiveStepResponseData" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/incident_role.py b/rootly_sdk/models/incident_role.py index 5c3d680b..c5216257 100644 --- a/rootly_sdk/models/incident_role.py +++ b/rootly_sdk/models/incident_role.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -28,13 +28,13 @@ class IncidentRole: name: str created_at: str updated_at: str - slug: Union[Unset, str] = UNSET - summary: Union[None, Unset, str] = UNSET - description: Union[None, Unset, str] = UNSET - position: Union[None, Unset, int] = UNSET - optional: Union[Unset, bool] = UNSET - enabled: Union[Unset, bool] = UNSET - allow_multi_user_assignment: Union[Unset, bool] = UNSET + slug: Unset | str = UNSET + summary: None | Unset | str = UNSET + description: None | Unset | str = UNSET + position: None | Unset | int = UNSET + optional: Unset | bool = UNSET + enabled: Unset | bool = UNSET + allow_multi_user_assignment: Unset | bool = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -46,19 +46,19 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - summary: Union[None, Unset, str] + summary: None | Unset | str if isinstance(self.summary, Unset): summary = UNSET else: summary = self.summary - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - position: Union[None, Unset, int] + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: @@ -107,30 +107,30 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: slug = d.pop("slug", UNSET) - def _parse_summary(data: object) -> Union[None, Unset, str]: + def _parse_summary(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) summary = _parse_summary(d.pop("summary", UNSET)) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_position(data: object) -> Union[None, Unset, int]: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) diff --git a/rootly_sdk/models/incident_role_list.py b/rootly_sdk/models/incident_role_list.py index 3c85074f..1f71ce7f 100644 --- a/rootly_sdk/models/incident_role_list.py +++ b/rootly_sdk/models/incident_role_list.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,7 +29,7 @@ class IncidentRoleList: data: list["IncidentRoleListDataItem"] links: "Links" meta: "Meta" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/incident_role_response.py b/rootly_sdk/models/incident_role_response.py index d6be3898..6a7cd413 100644 --- a/rootly_sdk/models/incident_role_response.py +++ b/rootly_sdk/models/incident_role_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,13 +23,13 @@ class IncidentRoleResponse: """ data: "IncidentRoleResponseData" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/incident_role_task.py b/rootly_sdk/models/incident_role_task.py index 2a87f93d..16646549 100644 --- a/rootly_sdk/models/incident_role_task.py +++ b/rootly_sdk/models/incident_role_task.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -25,9 +25,9 @@ class IncidentRoleTask: task: str created_at: str updated_at: str - incident_role_id: Union[Unset, str] = UNSET - description: Union[None, Unset, str] = UNSET - priority: Union[Unset, IncidentRoleTaskPriority] = UNSET + incident_role_id: Unset | str = UNSET + description: None | Unset | str = UNSET + priority: Unset | IncidentRoleTaskPriority = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -39,13 +39,13 @@ def to_dict(self) -> dict[str, Any]: incident_role_id = self.incident_role_id - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - priority: Union[Unset, str] = UNSET + priority: Unset | str = UNSET if not isinstance(self.priority, Unset): priority = self.priority @@ -78,17 +78,17 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: incident_role_id = d.pop("incident_role_id", UNSET) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) _priority = d.pop("priority", UNSET) - priority: Union[Unset, IncidentRoleTaskPriority] + priority: Unset | IncidentRoleTaskPriority if isinstance(_priority, Unset): priority = UNSET else: diff --git a/rootly_sdk/models/incident_role_task_list.py b/rootly_sdk/models/incident_role_task_list.py index c5d25b74..481d26cb 100644 --- a/rootly_sdk/models/incident_role_task_list.py +++ b/rootly_sdk/models/incident_role_task_list.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,7 +29,7 @@ class IncidentRoleTaskList: data: list["IncidentRoleTaskListDataItem"] links: "Links" meta: "Meta" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/incident_role_task_response.py b/rootly_sdk/models/incident_role_task_response.py index 660c1d91..7716f2b0 100644 --- a/rootly_sdk/models/incident_role_task_response.py +++ b/rootly_sdk/models/incident_role_task_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,13 +23,13 @@ class IncidentRoleTaskResponse: """ data: "IncidentRoleTaskResponseData" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/incident_status_page_event.py b/rootly_sdk/models/incident_status_page_event.py index 3f1a49d5..048ce5a7 100644 --- a/rootly_sdk/models/incident_status_page_event.py +++ b/rootly_sdk/models/incident_status_page_event.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -39,11 +39,11 @@ class IncidentStatusPageEvent: started_at: str created_at: str updated_at: str - status_page_id: Union[Unset, str] = UNSET - status: Union[Unset, IncidentStatusPageEventStatus] = UNSET - notify_subscribers: Union[Unset, bool] = UNSET - should_tweet: Union[Unset, bool] = UNSET - status_page_components: Union[Unset, list["IncidentStatusPageEventStatusPageComponentsItem"]] = UNSET + status_page_id: Unset | str = UNSET + status: Unset | IncidentStatusPageEventStatus = UNSET + notify_subscribers: Unset | bool = UNSET + should_tweet: Unset | bool = UNSET + status_page_components: Unset | list["IncidentStatusPageEventStatusPageComponentsItem"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -57,7 +57,7 @@ def to_dict(self) -> dict[str, Any]: status_page_id = self.status_page_id - status: Union[Unset, str] = UNSET + status: Unset | str = UNSET if not isinstance(self.status, Unset): status = self.status @@ -65,7 +65,7 @@ def to_dict(self) -> dict[str, Any]: should_tweet = self.should_tweet - status_page_components: Union[Unset, list[dict[str, Any]]] = UNSET + status_page_components: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.status_page_components, Unset): status_page_components = [] for status_page_components_item_data in self.status_page_components: @@ -113,7 +113,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: status_page_id = d.pop("status_page_id", UNSET) _status = d.pop("status", UNSET) - status: Union[Unset, IncidentStatusPageEventStatus] + status: Unset | IncidentStatusPageEventStatus if isinstance(_status, Unset): status = UNSET else: diff --git a/rootly_sdk/models/incident_status_page_event_list.py b/rootly_sdk/models/incident_status_page_event_list.py index c3935dc9..73ece2a3 100644 --- a/rootly_sdk/models/incident_status_page_event_list.py +++ b/rootly_sdk/models/incident_status_page_event_list.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,7 +29,7 @@ class IncidentStatusPageEventList: data: list["IncidentStatusPageEventListDataItem"] links: "Links" meta: "Meta" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/incident_status_page_event_response.py b/rootly_sdk/models/incident_status_page_event_response.py index 7818f4f9..53860c68 100644 --- a/rootly_sdk/models/incident_status_page_event_response.py +++ b/rootly_sdk/models/incident_status_page_event_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,13 +23,13 @@ class IncidentStatusPageEventResponse: """ data: "IncidentStatusPageEventResponseData" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/incident_status_page_event_status_page_components_item.py b/rootly_sdk/models/incident_status_page_event_status_page_components_item.py index 28a43416..930468ea 100644 --- a/rootly_sdk/models/incident_status_page_event_status_page_components_item.py +++ b/rootly_sdk/models/incident_status_page_event_status_page_components_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,13 +23,13 @@ class IncidentStatusPageEventStatusPageComponentsItem: """ status_page_component_id: str - status: Union[Unset, IncidentStatusPageEventStatusPageComponentsItemStatus] = UNSET + status: Unset | IncidentStatusPageEventStatusPageComponentsItemStatus = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: status_page_component_id = self.status_page_component_id - status: Union[Unset, str] = UNSET + status: Unset | str = UNSET if not isinstance(self.status, Unset): status = self.status @@ -51,7 +51,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: status_page_component_id = d.pop("status_page_component_id") _status = d.pop("status", UNSET) - status: Union[Unset, IncidentStatusPageEventStatusPageComponentsItemStatus] + status: Unset | IncidentStatusPageEventStatusPageComponentsItemStatus if isinstance(_status, Unset): status = UNSET else: diff --git a/rootly_sdk/models/incident_sub_status.py b/rootly_sdk/models/incident_sub_status.py index 20c90209..62537e7e 100644 --- a/rootly_sdk/models/incident_sub_status.py +++ b/rootly_sdk/models/incident_sub_status.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -24,7 +24,7 @@ class IncidentSubStatus: incident_id: str sub_status_id: str assigned_at: str - assigned_by_user_id: Union[None, Unset, int] = UNSET + assigned_by_user_id: None | Unset | int = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -34,7 +34,7 @@ def to_dict(self) -> dict[str, Any]: assigned_at = self.assigned_at - assigned_by_user_id: Union[None, Unset, int] + assigned_by_user_id: None | Unset | int if isinstance(self.assigned_by_user_id, Unset): assigned_by_user_id = UNSET else: @@ -63,12 +63,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: assigned_at = d.pop("assigned_at") - def _parse_assigned_by_user_id(data: object) -> Union[None, Unset, int]: + def _parse_assigned_by_user_id(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) assigned_by_user_id = _parse_assigned_by_user_id(d.pop("assigned_by_user_id", UNSET)) diff --git a/rootly_sdk/models/incident_sub_status_list.py b/rootly_sdk/models/incident_sub_status_list.py index 397436be..2ce4f83f 100644 --- a/rootly_sdk/models/incident_sub_status_list.py +++ b/rootly_sdk/models/incident_sub_status_list.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,7 +29,7 @@ class IncidentSubStatusList: data: list["IncidentSubStatusListDataItem"] links: "Links" meta: "Meta" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/incident_sub_status_response.py b/rootly_sdk/models/incident_sub_status_response.py index 844091af..0a92311a 100644 --- a/rootly_sdk/models/incident_sub_status_response.py +++ b/rootly_sdk/models/incident_sub_status_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,13 +23,13 @@ class IncidentSubStatusResponse: """ data: "IncidentSubStatusResponseData" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/incident_trigger_params.py b/rootly_sdk/models/incident_trigger_params.py index 7e468bc3..317b8c86 100644 --- a/rootly_sdk/models/incident_trigger_params.py +++ b/rootly_sdk/models/incident_trigger_params.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -151,159 +151,159 @@ class IncidentTriggerParams: """ trigger_type: IncidentTriggerParamsTriggerType - triggers: Union[Unset, list[str]] = UNSET - incident_visibilities: Union[Unset, list[bool]] = UNSET - incident_kinds: Union[Unset, list[IncidentTriggerParamsIncidentKindsItem]] = UNSET - incident_statuses: Union[Unset, list[IncidentTriggerParamsIncidentStatusesItem]] = UNSET - incident_inactivity_duration: Union[None, Unset, str] = UNSET - incident_condition: Union[Unset, IncidentTriggerParamsIncidentCondition] = "ALL" - incident_condition_visibility: Union[Unset, IncidentTriggerParamsIncidentConditionVisibility] = "ANY" - incident_condition_kind: Union[Unset, IncidentTriggerParamsIncidentConditionKind] = "IS" - incident_condition_status: Union[Unset, IncidentTriggerParamsIncidentConditionStatus] = "ANY" - incident_condition_sub_status: Union[Unset, IncidentTriggerParamsIncidentConditionSubStatus] = "ANY" - incident_condition_environment: Union[Unset, IncidentTriggerParamsIncidentConditionEnvironment] = "ANY" - incident_condition_severity: Union[Unset, IncidentTriggerParamsIncidentConditionSeverity] = "ANY" - incident_condition_incident_type: Union[Unset, IncidentTriggerParamsIncidentConditionIncidentType] = "ANY" - incident_condition_incident_roles: Union[Unset, IncidentTriggerParamsIncidentConditionIncidentRoles] = "ANY" - incident_condition_service: Union[Unset, IncidentTriggerParamsIncidentConditionService] = "ANY" - incident_condition_functionality: Union[Unset, IncidentTriggerParamsIncidentConditionFunctionality] = "ANY" - incident_condition_group: Union[Unset, IncidentTriggerParamsIncidentConditionGroup] = "ANY" - incident_condition_cause: Union[Unset, IncidentTriggerParamsIncidentConditionCause] = "ANY" - incident_condition_label: Union[Unset, IncidentTriggerParamsIncidentConditionLabel] = "ANY" - incident_condition_label_use_regexp: Union[Unset, bool] = False - incident_labels: Union[Unset, list[str]] = UNSET - incident_post_mortem_condition_cause: Union[Unset, IncidentTriggerParamsIncidentPostMortemConditionCause] = "ANY" - incident_condition_summary: Union[Unset, IncidentTriggerParamsIncidentConditionSummary] = UNSET - incident_condition_started_at: Union[Unset, IncidentTriggerParamsIncidentConditionStartedAt] = UNSET - incident_condition_detected_at: Union[Unset, IncidentTriggerParamsIncidentConditionDetectedAt] = UNSET - incident_condition_acknowledged_at: Union[Unset, IncidentTriggerParamsIncidentConditionAcknowledgedAt] = UNSET - incident_condition_mitigated_at: Union[Unset, IncidentTriggerParamsIncidentConditionMitigatedAt] = UNSET - incident_condition_resolved_at: Union[Unset, IncidentTriggerParamsIncidentConditionResolvedAt] = UNSET - incident_conditional_inactivity: Union[Unset, IncidentTriggerParamsIncidentConditionalInactivity] = UNSET + triggers: Unset | list[str] = UNSET + incident_visibilities: Unset | list[bool] = UNSET + incident_kinds: Unset | list[IncidentTriggerParamsIncidentKindsItem] = UNSET + incident_statuses: Unset | list[IncidentTriggerParamsIncidentStatusesItem] = UNSET + incident_inactivity_duration: None | Unset | str = UNSET + incident_condition: Unset | IncidentTriggerParamsIncidentCondition = "ALL" + incident_condition_visibility: Unset | IncidentTriggerParamsIncidentConditionVisibility = "ANY" + incident_condition_kind: Unset | IncidentTriggerParamsIncidentConditionKind = "IS" + incident_condition_status: Unset | IncidentTriggerParamsIncidentConditionStatus = "ANY" + incident_condition_sub_status: Unset | IncidentTriggerParamsIncidentConditionSubStatus = "ANY" + incident_condition_environment: Unset | IncidentTriggerParamsIncidentConditionEnvironment = "ANY" + incident_condition_severity: Unset | IncidentTriggerParamsIncidentConditionSeverity = "ANY" + incident_condition_incident_type: Unset | IncidentTriggerParamsIncidentConditionIncidentType = "ANY" + incident_condition_incident_roles: Unset | IncidentTriggerParamsIncidentConditionIncidentRoles = "ANY" + incident_condition_service: Unset | IncidentTriggerParamsIncidentConditionService = "ANY" + incident_condition_functionality: Unset | IncidentTriggerParamsIncidentConditionFunctionality = "ANY" + incident_condition_group: Unset | IncidentTriggerParamsIncidentConditionGroup = "ANY" + incident_condition_cause: Unset | IncidentTriggerParamsIncidentConditionCause = "ANY" + incident_condition_label: Unset | IncidentTriggerParamsIncidentConditionLabel = "ANY" + incident_condition_label_use_regexp: Unset | bool = False + incident_labels: Unset | list[str] = UNSET + incident_post_mortem_condition_cause: Unset | IncidentTriggerParamsIncidentPostMortemConditionCause = "ANY" + incident_condition_summary: Unset | IncidentTriggerParamsIncidentConditionSummary = UNSET + incident_condition_started_at: Unset | IncidentTriggerParamsIncidentConditionStartedAt = UNSET + incident_condition_detected_at: Unset | IncidentTriggerParamsIncidentConditionDetectedAt = UNSET + incident_condition_acknowledged_at: Unset | IncidentTriggerParamsIncidentConditionAcknowledgedAt = UNSET + incident_condition_mitigated_at: Unset | IncidentTriggerParamsIncidentConditionMitigatedAt = UNSET + incident_condition_resolved_at: Unset | IncidentTriggerParamsIncidentConditionResolvedAt = UNSET + incident_conditional_inactivity: Unset | IncidentTriggerParamsIncidentConditionalInactivity = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: trigger_type: str = self.trigger_type - triggers: Union[Unset, list[str]] = UNSET + triggers: Unset | list[str] = UNSET if not isinstance(self.triggers, Unset): triggers = self.triggers - incident_visibilities: Union[Unset, list[bool]] = UNSET + incident_visibilities: Unset | list[bool] = UNSET if not isinstance(self.incident_visibilities, Unset): incident_visibilities = self.incident_visibilities - incident_kinds: Union[Unset, list[str]] = UNSET + incident_kinds: Unset | list[str] = UNSET if not isinstance(self.incident_kinds, Unset): incident_kinds = [] for incident_kinds_item_data in self.incident_kinds: incident_kinds_item: str = incident_kinds_item_data incident_kinds.append(incident_kinds_item) - incident_statuses: Union[Unset, list[str]] = UNSET + incident_statuses: Unset | list[str] = UNSET if not isinstance(self.incident_statuses, Unset): incident_statuses = [] for incident_statuses_item_data in self.incident_statuses: incident_statuses_item: str = incident_statuses_item_data incident_statuses.append(incident_statuses_item) - incident_inactivity_duration: Union[None, Unset, str] + incident_inactivity_duration: None | Unset | str if isinstance(self.incident_inactivity_duration, Unset): incident_inactivity_duration = UNSET else: incident_inactivity_duration = self.incident_inactivity_duration - incident_condition: Union[Unset, str] = UNSET + incident_condition: Unset | str = UNSET if not isinstance(self.incident_condition, Unset): incident_condition = self.incident_condition - incident_condition_visibility: Union[Unset, str] = UNSET + incident_condition_visibility: Unset | str = UNSET if not isinstance(self.incident_condition_visibility, Unset): incident_condition_visibility = self.incident_condition_visibility - incident_condition_kind: Union[Unset, str] = UNSET + incident_condition_kind: Unset | str = UNSET if not isinstance(self.incident_condition_kind, Unset): incident_condition_kind = self.incident_condition_kind - incident_condition_status: Union[Unset, str] = UNSET + incident_condition_status: Unset | str = UNSET if not isinstance(self.incident_condition_status, Unset): incident_condition_status = self.incident_condition_status - incident_condition_sub_status: Union[Unset, str] = UNSET + incident_condition_sub_status: Unset | str = UNSET if not isinstance(self.incident_condition_sub_status, Unset): incident_condition_sub_status = self.incident_condition_sub_status - incident_condition_environment: Union[Unset, str] = UNSET + incident_condition_environment: Unset | str = UNSET if not isinstance(self.incident_condition_environment, Unset): incident_condition_environment = self.incident_condition_environment - incident_condition_severity: Union[Unset, str] = UNSET + incident_condition_severity: Unset | str = UNSET if not isinstance(self.incident_condition_severity, Unset): incident_condition_severity = self.incident_condition_severity - incident_condition_incident_type: Union[Unset, str] = UNSET + incident_condition_incident_type: Unset | str = UNSET if not isinstance(self.incident_condition_incident_type, Unset): incident_condition_incident_type = self.incident_condition_incident_type - incident_condition_incident_roles: Union[Unset, str] = UNSET + incident_condition_incident_roles: Unset | str = UNSET if not isinstance(self.incident_condition_incident_roles, Unset): incident_condition_incident_roles = self.incident_condition_incident_roles - incident_condition_service: Union[Unset, str] = UNSET + incident_condition_service: Unset | str = UNSET if not isinstance(self.incident_condition_service, Unset): incident_condition_service = self.incident_condition_service - incident_condition_functionality: Union[Unset, str] = UNSET + incident_condition_functionality: Unset | str = UNSET if not isinstance(self.incident_condition_functionality, Unset): incident_condition_functionality = self.incident_condition_functionality - incident_condition_group: Union[Unset, str] = UNSET + incident_condition_group: Unset | str = UNSET if not isinstance(self.incident_condition_group, Unset): incident_condition_group = self.incident_condition_group - incident_condition_cause: Union[Unset, str] = UNSET + incident_condition_cause: Unset | str = UNSET if not isinstance(self.incident_condition_cause, Unset): incident_condition_cause = self.incident_condition_cause - incident_condition_label: Union[Unset, str] = UNSET + incident_condition_label: Unset | str = UNSET if not isinstance(self.incident_condition_label, Unset): incident_condition_label = self.incident_condition_label incident_condition_label_use_regexp = self.incident_condition_label_use_regexp - incident_labels: Union[Unset, list[str]] = UNSET + incident_labels: Unset | list[str] = UNSET if not isinstance(self.incident_labels, Unset): incident_labels = self.incident_labels - incident_post_mortem_condition_cause: Union[Unset, str] = UNSET + incident_post_mortem_condition_cause: Unset | str = UNSET if not isinstance(self.incident_post_mortem_condition_cause, Unset): incident_post_mortem_condition_cause = self.incident_post_mortem_condition_cause - incident_condition_summary: Union[Unset, str] = UNSET + incident_condition_summary: Unset | str = UNSET if not isinstance(self.incident_condition_summary, Unset): incident_condition_summary = self.incident_condition_summary - incident_condition_started_at: Union[Unset, str] = UNSET + incident_condition_started_at: Unset | str = UNSET if not isinstance(self.incident_condition_started_at, Unset): incident_condition_started_at = self.incident_condition_started_at - incident_condition_detected_at: Union[Unset, str] = UNSET + incident_condition_detected_at: Unset | str = UNSET if not isinstance(self.incident_condition_detected_at, Unset): incident_condition_detected_at = self.incident_condition_detected_at - incident_condition_acknowledged_at: Union[Unset, str] = UNSET + incident_condition_acknowledged_at: Unset | str = UNSET if not isinstance(self.incident_condition_acknowledged_at, Unset): incident_condition_acknowledged_at = self.incident_condition_acknowledged_at - incident_condition_mitigated_at: Union[Unset, str] = UNSET + incident_condition_mitigated_at: Unset | str = UNSET if not isinstance(self.incident_condition_mitigated_at, Unset): incident_condition_mitigated_at = self.incident_condition_mitigated_at - incident_condition_resolved_at: Union[Unset, str] = UNSET + incident_condition_resolved_at: Unset | str = UNSET if not isinstance(self.incident_condition_resolved_at, Unset): incident_condition_resolved_at = self.incident_condition_resolved_at - incident_conditional_inactivity: Union[Unset, str] = UNSET + incident_conditional_inactivity: Unset | str = UNSET if not isinstance(self.incident_conditional_inactivity, Unset): incident_conditional_inactivity = self.incident_conditional_inactivity @@ -398,24 +398,24 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: incident_statuses.append(incident_statuses_item) - def _parse_incident_inactivity_duration(data: object) -> Union[None, Unset, str]: + def _parse_incident_inactivity_duration(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) incident_inactivity_duration = _parse_incident_inactivity_duration(d.pop("incident_inactivity_duration", UNSET)) _incident_condition = d.pop("incident_condition", UNSET) - incident_condition: Union[Unset, IncidentTriggerParamsIncidentCondition] + incident_condition: Unset | IncidentTriggerParamsIncidentCondition if isinstance(_incident_condition, Unset): incident_condition = UNSET else: incident_condition = check_incident_trigger_params_incident_condition(_incident_condition) _incident_condition_visibility = d.pop("incident_condition_visibility", UNSET) - incident_condition_visibility: Union[Unset, IncidentTriggerParamsIncidentConditionVisibility] + incident_condition_visibility: Unset | IncidentTriggerParamsIncidentConditionVisibility if isinstance(_incident_condition_visibility, Unset): incident_condition_visibility = UNSET else: @@ -424,14 +424,14 @@ def _parse_incident_inactivity_duration(data: object) -> Union[None, Unset, str] ) _incident_condition_kind = d.pop("incident_condition_kind", UNSET) - incident_condition_kind: Union[Unset, IncidentTriggerParamsIncidentConditionKind] + incident_condition_kind: Unset | IncidentTriggerParamsIncidentConditionKind if isinstance(_incident_condition_kind, Unset): incident_condition_kind = UNSET else: incident_condition_kind = check_incident_trigger_params_incident_condition_kind(_incident_condition_kind) _incident_condition_status = d.pop("incident_condition_status", UNSET) - incident_condition_status: Union[Unset, IncidentTriggerParamsIncidentConditionStatus] + incident_condition_status: Unset | IncidentTriggerParamsIncidentConditionStatus if isinstance(_incident_condition_status, Unset): incident_condition_status = UNSET else: @@ -440,7 +440,7 @@ def _parse_incident_inactivity_duration(data: object) -> Union[None, Unset, str] ) _incident_condition_sub_status = d.pop("incident_condition_sub_status", UNSET) - incident_condition_sub_status: Union[Unset, IncidentTriggerParamsIncidentConditionSubStatus] + incident_condition_sub_status: Unset | IncidentTriggerParamsIncidentConditionSubStatus if isinstance(_incident_condition_sub_status, Unset): incident_condition_sub_status = UNSET else: @@ -449,7 +449,7 @@ def _parse_incident_inactivity_duration(data: object) -> Union[None, Unset, str] ) _incident_condition_environment = d.pop("incident_condition_environment", UNSET) - incident_condition_environment: Union[Unset, IncidentTriggerParamsIncidentConditionEnvironment] + incident_condition_environment: Unset | IncidentTriggerParamsIncidentConditionEnvironment if isinstance(_incident_condition_environment, Unset): incident_condition_environment = UNSET else: @@ -458,7 +458,7 @@ def _parse_incident_inactivity_duration(data: object) -> Union[None, Unset, str] ) _incident_condition_severity = d.pop("incident_condition_severity", UNSET) - incident_condition_severity: Union[Unset, IncidentTriggerParamsIncidentConditionSeverity] + incident_condition_severity: Unset | IncidentTriggerParamsIncidentConditionSeverity if isinstance(_incident_condition_severity, Unset): incident_condition_severity = UNSET else: @@ -467,7 +467,7 @@ def _parse_incident_inactivity_duration(data: object) -> Union[None, Unset, str] ) _incident_condition_incident_type = d.pop("incident_condition_incident_type", UNSET) - incident_condition_incident_type: Union[Unset, IncidentTriggerParamsIncidentConditionIncidentType] + incident_condition_incident_type: Unset | IncidentTriggerParamsIncidentConditionIncidentType if isinstance(_incident_condition_incident_type, Unset): incident_condition_incident_type = UNSET else: @@ -476,7 +476,7 @@ def _parse_incident_inactivity_duration(data: object) -> Union[None, Unset, str] ) _incident_condition_incident_roles = d.pop("incident_condition_incident_roles", UNSET) - incident_condition_incident_roles: Union[Unset, IncidentTriggerParamsIncidentConditionIncidentRoles] + incident_condition_incident_roles: Unset | IncidentTriggerParamsIncidentConditionIncidentRoles if isinstance(_incident_condition_incident_roles, Unset): incident_condition_incident_roles = UNSET else: @@ -485,7 +485,7 @@ def _parse_incident_inactivity_duration(data: object) -> Union[None, Unset, str] ) _incident_condition_service = d.pop("incident_condition_service", UNSET) - incident_condition_service: Union[Unset, IncidentTriggerParamsIncidentConditionService] + incident_condition_service: Unset | IncidentTriggerParamsIncidentConditionService if isinstance(_incident_condition_service, Unset): incident_condition_service = UNSET else: @@ -494,7 +494,7 @@ def _parse_incident_inactivity_duration(data: object) -> Union[None, Unset, str] ) _incident_condition_functionality = d.pop("incident_condition_functionality", UNSET) - incident_condition_functionality: Union[Unset, IncidentTriggerParamsIncidentConditionFunctionality] + incident_condition_functionality: Unset | IncidentTriggerParamsIncidentConditionFunctionality if isinstance(_incident_condition_functionality, Unset): incident_condition_functionality = UNSET else: @@ -503,21 +503,21 @@ def _parse_incident_inactivity_duration(data: object) -> Union[None, Unset, str] ) _incident_condition_group = d.pop("incident_condition_group", UNSET) - incident_condition_group: Union[Unset, IncidentTriggerParamsIncidentConditionGroup] + incident_condition_group: Unset | IncidentTriggerParamsIncidentConditionGroup if isinstance(_incident_condition_group, Unset): incident_condition_group = UNSET else: incident_condition_group = check_incident_trigger_params_incident_condition_group(_incident_condition_group) _incident_condition_cause = d.pop("incident_condition_cause", UNSET) - incident_condition_cause: Union[Unset, IncidentTriggerParamsIncidentConditionCause] + incident_condition_cause: Unset | IncidentTriggerParamsIncidentConditionCause if isinstance(_incident_condition_cause, Unset): incident_condition_cause = UNSET else: incident_condition_cause = check_incident_trigger_params_incident_condition_cause(_incident_condition_cause) _incident_condition_label = d.pop("incident_condition_label", UNSET) - incident_condition_label: Union[Unset, IncidentTriggerParamsIncidentConditionLabel] + incident_condition_label: Unset | IncidentTriggerParamsIncidentConditionLabel if isinstance(_incident_condition_label, Unset): incident_condition_label = UNSET else: @@ -528,7 +528,7 @@ def _parse_incident_inactivity_duration(data: object) -> Union[None, Unset, str] incident_labels = cast(list[str], d.pop("incident_labels", UNSET)) _incident_post_mortem_condition_cause = d.pop("incident_post_mortem_condition_cause", UNSET) - incident_post_mortem_condition_cause: Union[Unset, IncidentTriggerParamsIncidentPostMortemConditionCause] + incident_post_mortem_condition_cause: Unset | IncidentTriggerParamsIncidentPostMortemConditionCause if isinstance(_incident_post_mortem_condition_cause, Unset): incident_post_mortem_condition_cause = UNSET else: @@ -537,7 +537,7 @@ def _parse_incident_inactivity_duration(data: object) -> Union[None, Unset, str] ) _incident_condition_summary = d.pop("incident_condition_summary", UNSET) - incident_condition_summary: Union[Unset, IncidentTriggerParamsIncidentConditionSummary] + incident_condition_summary: Unset | IncidentTriggerParamsIncidentConditionSummary if isinstance(_incident_condition_summary, Unset): incident_condition_summary = UNSET else: @@ -546,7 +546,7 @@ def _parse_incident_inactivity_duration(data: object) -> Union[None, Unset, str] ) _incident_condition_started_at = d.pop("incident_condition_started_at", UNSET) - incident_condition_started_at: Union[Unset, IncidentTriggerParamsIncidentConditionStartedAt] + incident_condition_started_at: Unset | IncidentTriggerParamsIncidentConditionStartedAt if isinstance(_incident_condition_started_at, Unset): incident_condition_started_at = UNSET else: @@ -555,7 +555,7 @@ def _parse_incident_inactivity_duration(data: object) -> Union[None, Unset, str] ) _incident_condition_detected_at = d.pop("incident_condition_detected_at", UNSET) - incident_condition_detected_at: Union[Unset, IncidentTriggerParamsIncidentConditionDetectedAt] + incident_condition_detected_at: Unset | IncidentTriggerParamsIncidentConditionDetectedAt if isinstance(_incident_condition_detected_at, Unset): incident_condition_detected_at = UNSET else: @@ -564,7 +564,7 @@ def _parse_incident_inactivity_duration(data: object) -> Union[None, Unset, str] ) _incident_condition_acknowledged_at = d.pop("incident_condition_acknowledged_at", UNSET) - incident_condition_acknowledged_at: Union[Unset, IncidentTriggerParamsIncidentConditionAcknowledgedAt] + incident_condition_acknowledged_at: Unset | IncidentTriggerParamsIncidentConditionAcknowledgedAt if isinstance(_incident_condition_acknowledged_at, Unset): incident_condition_acknowledged_at = UNSET else: @@ -573,7 +573,7 @@ def _parse_incident_inactivity_duration(data: object) -> Union[None, Unset, str] ) _incident_condition_mitigated_at = d.pop("incident_condition_mitigated_at", UNSET) - incident_condition_mitigated_at: Union[Unset, IncidentTriggerParamsIncidentConditionMitigatedAt] + incident_condition_mitigated_at: Unset | IncidentTriggerParamsIncidentConditionMitigatedAt if isinstance(_incident_condition_mitigated_at, Unset): incident_condition_mitigated_at = UNSET else: @@ -582,7 +582,7 @@ def _parse_incident_inactivity_duration(data: object) -> Union[None, Unset, str] ) _incident_condition_resolved_at = d.pop("incident_condition_resolved_at", UNSET) - incident_condition_resolved_at: Union[Unset, IncidentTriggerParamsIncidentConditionResolvedAt] + incident_condition_resolved_at: Unset | IncidentTriggerParamsIncidentConditionResolvedAt if isinstance(_incident_condition_resolved_at, Unset): incident_condition_resolved_at = UNSET else: @@ -591,7 +591,7 @@ def _parse_incident_inactivity_duration(data: object) -> Union[None, Unset, str] ) _incident_conditional_inactivity = d.pop("incident_conditional_inactivity", UNSET) - incident_conditional_inactivity: Union[Unset, IncidentTriggerParamsIncidentConditionalInactivity] + incident_conditional_inactivity: Unset | IncidentTriggerParamsIncidentConditionalInactivity if isinstance(_incident_conditional_inactivity, Unset): incident_conditional_inactivity = UNSET else: diff --git a/rootly_sdk/models/incident_type.py b/rootly_sdk/models/incident_type.py index 3e89c51e..3ebd7402 100644 --- a/rootly_sdk/models/incident_type.py +++ b/rootly_sdk/models/incident_type.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -38,15 +38,15 @@ class IncidentType: name: str created_at: str updated_at: str - slug: Union[Unset, str] = UNSET - description: Union[None, Unset, str] = UNSET - public_description: Union[None, Unset, str] = UNSET - color: Union[None, Unset, str] = UNSET - position: Union[None, Unset, int] = UNSET - notify_emails: Union[None, Unset, list[str]] = UNSET - slack_channels: Union[None, Unset, list["IncidentTypeSlackChannelsType0Item"]] = UNSET - slack_aliases: Union[None, Unset, list["IncidentTypeSlackAliasesType0Item"]] = UNSET - properties: Union[Unset, list["IncidentTypePropertiesItem"]] = UNSET + slug: Unset | str = UNSET + description: None | Unset | str = UNSET + public_description: None | Unset | str = UNSET + color: None | Unset | str = UNSET + position: None | Unset | int = UNSET + notify_emails: None | Unset | list[str] = UNSET + slack_channels: None | Unset | list["IncidentTypeSlackChannelsType0Item"] = UNSET + slack_aliases: None | Unset | list["IncidentTypeSlackAliasesType0Item"] = UNSET + properties: Unset | list["IncidentTypePropertiesItem"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -58,31 +58,31 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - public_description: Union[None, Unset, str] + public_description: None | Unset | str if isinstance(self.public_description, Unset): public_description = UNSET else: public_description = self.public_description - color: Union[None, Unset, str] + color: None | Unset | str if isinstance(self.color, Unset): color = UNSET else: color = self.color - position: Union[None, Unset, int] + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: position = self.position - notify_emails: Union[None, Unset, list[str]] + notify_emails: None | Unset | list[str] if isinstance(self.notify_emails, Unset): notify_emails = UNSET elif isinstance(self.notify_emails, list): @@ -91,7 +91,7 @@ def to_dict(self) -> dict[str, Any]: else: notify_emails = self.notify_emails - slack_channels: Union[None, Unset, list[dict[str, Any]]] + slack_channels: None | Unset | list[dict[str, Any]] if isinstance(self.slack_channels, Unset): slack_channels = UNSET elif isinstance(self.slack_channels, list): @@ -103,7 +103,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_channels = self.slack_channels - slack_aliases: Union[None, Unset, list[dict[str, Any]]] + slack_aliases: None | Unset | list[dict[str, Any]] if isinstance(self.slack_aliases, Unset): slack_aliases = UNSET elif isinstance(self.slack_aliases, list): @@ -115,7 +115,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_aliases = self.slack_aliases - properties: Union[Unset, list[dict[str, Any]]] = UNSET + properties: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.properties, Unset): properties = [] for properties_item_data in self.properties: @@ -167,43 +167,43 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: slug = d.pop("slug", UNSET) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_public_description(data: object) -> Union[None, Unset, str]: + def _parse_public_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) public_description = _parse_public_description(d.pop("public_description", UNSET)) - def _parse_color(data: object) -> Union[None, Unset, str]: + def _parse_color(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) color = _parse_color(d.pop("color", UNSET)) - def _parse_position(data: object) -> Union[None, Unset, int]: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) - def _parse_notify_emails(data: object) -> Union[None, Unset, list[str]]: + def _parse_notify_emails(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -216,11 +216,11 @@ def _parse_notify_emails(data: object) -> Union[None, Unset, list[str]]: return notify_emails_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) notify_emails = _parse_notify_emails(d.pop("notify_emails", UNSET)) - def _parse_slack_channels(data: object) -> Union[None, Unset, list["IncidentTypeSlackChannelsType0Item"]]: + def _parse_slack_channels(data: object) -> None | Unset | list["IncidentTypeSlackChannelsType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -240,11 +240,11 @@ def _parse_slack_channels(data: object) -> Union[None, Unset, list["IncidentType return slack_channels_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list["IncidentTypeSlackChannelsType0Item"]], data) + return cast(None | Unset | list["IncidentTypeSlackChannelsType0Item"], data) slack_channels = _parse_slack_channels(d.pop("slack_channels", UNSET)) - def _parse_slack_aliases(data: object) -> Union[None, Unset, list["IncidentTypeSlackAliasesType0Item"]]: + def _parse_slack_aliases(data: object) -> None | Unset | list["IncidentTypeSlackAliasesType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -264,7 +264,7 @@ def _parse_slack_aliases(data: object) -> Union[None, Unset, list["IncidentTypeS return slack_aliases_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list["IncidentTypeSlackAliasesType0Item"]], data) + return cast(None | Unset | list["IncidentTypeSlackAliasesType0Item"], data) slack_aliases = _parse_slack_aliases(d.pop("slack_aliases", UNSET)) diff --git a/rootly_sdk/models/incident_type_list.py b/rootly_sdk/models/incident_type_list.py index bb4419bc..e33a72b9 100644 --- a/rootly_sdk/models/incident_type_list.py +++ b/rootly_sdk/models/incident_type_list.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,7 +29,7 @@ class IncidentTypeList: data: list["IncidentTypeListDataItem"] links: "Links" meta: "Meta" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/incident_type_response.py b/rootly_sdk/models/incident_type_response.py index aa97ceaf..dd8fc4e3 100644 --- a/rootly_sdk/models/incident_type_response.py +++ b/rootly_sdk/models/incident_type_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,13 +23,13 @@ class IncidentTypeResponse: """ data: "IncidentTypeResponseData" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/incident_zoom_meeting_global_dial_in_numbers_type_0_item.py b/rootly_sdk/models/incident_zoom_meeting_global_dial_in_numbers_type_0_item.py index 6415f035..06ca093e 100644 --- a/rootly_sdk/models/incident_zoom_meeting_global_dial_in_numbers_type_0_item.py +++ b/rootly_sdk/models/incident_zoom_meeting_global_dial_in_numbers_type_0_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -20,11 +20,11 @@ class IncidentZoomMeetingGlobalDialInNumbersType0Item: type_ (Union[Unset, str]): """ - country: Union[Unset, str] = UNSET - country_name: Union[Unset, str] = UNSET - city: Union[Unset, str] = UNSET - number: Union[Unset, str] = UNSET - type_: Union[Unset, str] = UNSET + country: Unset | str = UNSET + country_name: Unset | str = UNSET + city: Unset | str = UNSET + number: Unset | str = UNSET + type_: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/invite_to_google_chat_space_task_params.py b/rootly_sdk/models/invite_to_google_chat_space_task_params.py index 2f17c470..6a099867 100644 --- a/rootly_sdk/models/invite_to_google_chat_space_task_params.py +++ b/rootly_sdk/models/invite_to_google_chat_space_task_params.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -28,7 +28,7 @@ class InviteToGoogleChatSpaceTaskParams: space: "InviteToGoogleChatSpaceTaskParamsSpace" emails: str - task_type: Union[Unset, InviteToGoogleChatSpaceTaskParamsTaskType] = UNSET + task_type: Unset | InviteToGoogleChatSpaceTaskParamsTaskType = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -36,7 +36,7 @@ def to_dict(self) -> dict[str, Any]: emails = self.emails - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -63,7 +63,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: emails = d.pop("emails") _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, InviteToGoogleChatSpaceTaskParamsTaskType] + task_type: Unset | InviteToGoogleChatSpaceTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/invite_to_google_chat_space_task_params_space.py b/rootly_sdk/models/invite_to_google_chat_space_task_params_space.py index 121591c6..0b0940eb 100644 --- a/rootly_sdk/models/invite_to_google_chat_space_task_params_space.py +++ b/rootly_sdk/models/invite_to_google_chat_space_task_params_space.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class InviteToGoogleChatSpaceTaskParamsSpace: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/invite_to_microsoft_teams_channel_rootly_task_params.py b/rootly_sdk/models/invite_to_microsoft_teams_channel_rootly_task_params.py index 5583046e..ac0cac25 100644 --- a/rootly_sdk/models/invite_to_microsoft_teams_channel_rootly_task_params.py +++ b/rootly_sdk/models/invite_to_microsoft_teams_channel_rootly_task_params.py @@ -53,7 +53,7 @@ class InviteToMicrosoftTeamsChannelRootlyTaskParams: team: "InviteToMicrosoftTeamsChannelRootlyTaskParamsTeam" channel: "InviteToMicrosoftTeamsChannelRootlyTaskParamsChannel" - task_type: Union[Unset, InviteToMicrosoftTeamsChannelRootlyTaskParamsTaskType] = UNSET + task_type: Unset | InviteToMicrosoftTeamsChannelRootlyTaskParamsTaskType = UNSET escalation_policy_target: Union[Unset, "InviteToMicrosoftTeamsChannelRootlyTaskParamsEscalationPolicyTarget"] = ( UNSET ) @@ -68,27 +68,27 @@ def to_dict(self) -> dict[str, Any]: channel = self.channel.to_dict() - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - escalation_policy_target: Union[Unset, dict[str, Any]] = UNSET + escalation_policy_target: Unset | dict[str, Any] = UNSET if not isinstance(self.escalation_policy_target, Unset): escalation_policy_target = self.escalation_policy_target.to_dict() - service_target: Union[Unset, dict[str, Any]] = UNSET + service_target: Unset | dict[str, Any] = UNSET if not isinstance(self.service_target, Unset): service_target = self.service_target.to_dict() - user_target: Union[Unset, dict[str, Any]] = UNSET + user_target: Unset | dict[str, Any] = UNSET if not isinstance(self.user_target, Unset): user_target = self.user_target.to_dict() - group_target: Union[Unset, dict[str, Any]] = UNSET + group_target: Unset | dict[str, Any] = UNSET if not isinstance(self.group_target, Unset): group_target = self.group_target.to_dict() - schedule_target: Union[Unset, dict[str, Any]] = UNSET + schedule_target: Unset | dict[str, Any] = UNSET if not isinstance(self.schedule_target, Unset): schedule_target = self.schedule_target.to_dict() @@ -145,14 +145,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: channel = InviteToMicrosoftTeamsChannelRootlyTaskParamsChannel.from_dict(d.pop("channel")) _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, InviteToMicrosoftTeamsChannelRootlyTaskParamsTaskType] + task_type: Unset | InviteToMicrosoftTeamsChannelRootlyTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: task_type = check_invite_to_microsoft_teams_channel_rootly_task_params_task_type(_task_type) _escalation_policy_target = d.pop("escalation_policy_target", UNSET) - escalation_policy_target: Union[Unset, InviteToMicrosoftTeamsChannelRootlyTaskParamsEscalationPolicyTarget] + escalation_policy_target: Unset | InviteToMicrosoftTeamsChannelRootlyTaskParamsEscalationPolicyTarget if isinstance(_escalation_policy_target, Unset): escalation_policy_target = UNSET else: @@ -161,28 +161,28 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: ) _service_target = d.pop("service_target", UNSET) - service_target: Union[Unset, InviteToMicrosoftTeamsChannelRootlyTaskParamsServiceTarget] + service_target: Unset | InviteToMicrosoftTeamsChannelRootlyTaskParamsServiceTarget if isinstance(_service_target, Unset): service_target = UNSET else: service_target = InviteToMicrosoftTeamsChannelRootlyTaskParamsServiceTarget.from_dict(_service_target) _user_target = d.pop("user_target", UNSET) - user_target: Union[Unset, InviteToMicrosoftTeamsChannelRootlyTaskParamsUserTarget] + user_target: Unset | InviteToMicrosoftTeamsChannelRootlyTaskParamsUserTarget if isinstance(_user_target, Unset): user_target = UNSET else: user_target = InviteToMicrosoftTeamsChannelRootlyTaskParamsUserTarget.from_dict(_user_target) _group_target = d.pop("group_target", UNSET) - group_target: Union[Unset, InviteToMicrosoftTeamsChannelRootlyTaskParamsGroupTarget] + group_target: Unset | InviteToMicrosoftTeamsChannelRootlyTaskParamsGroupTarget if isinstance(_group_target, Unset): group_target = UNSET else: group_target = InviteToMicrosoftTeamsChannelRootlyTaskParamsGroupTarget.from_dict(_group_target) _schedule_target = d.pop("schedule_target", UNSET) - schedule_target: Union[Unset, InviteToMicrosoftTeamsChannelRootlyTaskParamsScheduleTarget] + schedule_target: Unset | InviteToMicrosoftTeamsChannelRootlyTaskParamsScheduleTarget if isinstance(_schedule_target, Unset): schedule_target = UNSET else: diff --git a/rootly_sdk/models/invite_to_microsoft_teams_channel_rootly_task_params_channel.py b/rootly_sdk/models/invite_to_microsoft_teams_channel_rootly_task_params_channel.py index bfe76649..4c24a4ac 100644 --- a/rootly_sdk/models/invite_to_microsoft_teams_channel_rootly_task_params_channel.py +++ b/rootly_sdk/models/invite_to_microsoft_teams_channel_rootly_task_params_channel.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class InviteToMicrosoftTeamsChannelRootlyTaskParamsChannel: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/invite_to_microsoft_teams_channel_rootly_task_params_escalation_policy_target.py b/rootly_sdk/models/invite_to_microsoft_teams_channel_rootly_task_params_escalation_policy_target.py index 5af582a4..4d3d9bd8 100644 --- a/rootly_sdk/models/invite_to_microsoft_teams_channel_rootly_task_params_escalation_policy_target.py +++ b/rootly_sdk/models/invite_to_microsoft_teams_channel_rootly_task_params_escalation_policy_target.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class InviteToMicrosoftTeamsChannelRootlyTaskParamsEscalationPolicyTarget: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/invite_to_microsoft_teams_channel_rootly_task_params_group_target.py b/rootly_sdk/models/invite_to_microsoft_teams_channel_rootly_task_params_group_target.py index 2635fcdf..0434c72b 100644 --- a/rootly_sdk/models/invite_to_microsoft_teams_channel_rootly_task_params_group_target.py +++ b/rootly_sdk/models/invite_to_microsoft_teams_channel_rootly_task_params_group_target.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class InviteToMicrosoftTeamsChannelRootlyTaskParamsGroupTarget: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/invite_to_microsoft_teams_channel_rootly_task_params_schedule_target.py b/rootly_sdk/models/invite_to_microsoft_teams_channel_rootly_task_params_schedule_target.py index 221f1422..1e28a267 100644 --- a/rootly_sdk/models/invite_to_microsoft_teams_channel_rootly_task_params_schedule_target.py +++ b/rootly_sdk/models/invite_to_microsoft_teams_channel_rootly_task_params_schedule_target.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class InviteToMicrosoftTeamsChannelRootlyTaskParamsScheduleTarget: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/invite_to_microsoft_teams_channel_rootly_task_params_service_target.py b/rootly_sdk/models/invite_to_microsoft_teams_channel_rootly_task_params_service_target.py index 1d82f146..6a401033 100644 --- a/rootly_sdk/models/invite_to_microsoft_teams_channel_rootly_task_params_service_target.py +++ b/rootly_sdk/models/invite_to_microsoft_teams_channel_rootly_task_params_service_target.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class InviteToMicrosoftTeamsChannelRootlyTaskParamsServiceTarget: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/invite_to_microsoft_teams_channel_rootly_task_params_team.py b/rootly_sdk/models/invite_to_microsoft_teams_channel_rootly_task_params_team.py index 5f3bfd04..f8579431 100644 --- a/rootly_sdk/models/invite_to_microsoft_teams_channel_rootly_task_params_team.py +++ b/rootly_sdk/models/invite_to_microsoft_teams_channel_rootly_task_params_team.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class InviteToMicrosoftTeamsChannelRootlyTaskParamsTeam: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/invite_to_microsoft_teams_channel_rootly_task_params_user_target.py b/rootly_sdk/models/invite_to_microsoft_teams_channel_rootly_task_params_user_target.py index d33ced93..0c1ffc90 100644 --- a/rootly_sdk/models/invite_to_microsoft_teams_channel_rootly_task_params_user_target.py +++ b/rootly_sdk/models/invite_to_microsoft_teams_channel_rootly_task_params_user_target.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class InviteToMicrosoftTeamsChannelRootlyTaskParamsUserTarget: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/invite_to_microsoft_teams_channel_task_params.py b/rootly_sdk/models/invite_to_microsoft_teams_channel_task_params.py index 59f2624e..00939f9c 100644 --- a/rootly_sdk/models/invite_to_microsoft_teams_channel_task_params.py +++ b/rootly_sdk/models/invite_to_microsoft_teams_channel_task_params.py @@ -32,7 +32,7 @@ class InviteToMicrosoftTeamsChannelTaskParams: channel: "InviteToMicrosoftTeamsChannelTaskParamsChannel" emails: str - task_type: Union[Unset, InviteToMicrosoftTeamsChannelTaskParamsTaskType] = UNSET + task_type: Unset | InviteToMicrosoftTeamsChannelTaskParamsTaskType = UNSET team: Union[Unset, "InviteToMicrosoftTeamsChannelTaskParamsTeam"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -41,11 +41,11 @@ def to_dict(self) -> dict[str, Any]: emails = self.emails - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - team: Union[Unset, dict[str, Any]] = UNSET + team: Unset | dict[str, Any] = UNSET if not isinstance(self.team, Unset): team = self.team.to_dict() @@ -79,14 +79,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: emails = d.pop("emails") _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, InviteToMicrosoftTeamsChannelTaskParamsTaskType] + task_type: Unset | InviteToMicrosoftTeamsChannelTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: task_type = check_invite_to_microsoft_teams_channel_task_params_task_type(_task_type) _team = d.pop("team", UNSET) - team: Union[Unset, InviteToMicrosoftTeamsChannelTaskParamsTeam] + team: Unset | InviteToMicrosoftTeamsChannelTaskParamsTeam if isinstance(_team, Unset): team = UNSET else: diff --git a/rootly_sdk/models/invite_to_microsoft_teams_channel_task_params_channel.py b/rootly_sdk/models/invite_to_microsoft_teams_channel_task_params_channel.py index 4d55cec2..5c59110f 100644 --- a/rootly_sdk/models/invite_to_microsoft_teams_channel_task_params_channel.py +++ b/rootly_sdk/models/invite_to_microsoft_teams_channel_task_params_channel.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class InviteToMicrosoftTeamsChannelTaskParamsChannel: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/invite_to_microsoft_teams_channel_task_params_team.py b/rootly_sdk/models/invite_to_microsoft_teams_channel_task_params_team.py index 3b0fa373..00f2cd5d 100644 --- a/rootly_sdk/models/invite_to_microsoft_teams_channel_task_params_team.py +++ b/rootly_sdk/models/invite_to_microsoft_teams_channel_task_params_team.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class InviteToMicrosoftTeamsChannelTaskParamsTeam: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/invite_to_slack_channel_opsgenie_task_params.py b/rootly_sdk/models/invite_to_slack_channel_opsgenie_task_params.py index df9f8677..b26c113a 100644 --- a/rootly_sdk/models/invite_to_slack_channel_opsgenie_task_params.py +++ b/rootly_sdk/models/invite_to_slack_channel_opsgenie_task_params.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -33,7 +33,7 @@ class InviteToSlackChannelOpsgenieTaskParams: channels: list["InviteToSlackChannelOpsgenieTaskParamsChannelsItem"] schedule: "InviteToSlackChannelOpsgenieTaskParamsSchedule" - task_type: Union[Unset, InviteToSlackChannelOpsgenieTaskParamsTaskType] = UNSET + task_type: Unset | InviteToSlackChannelOpsgenieTaskParamsTaskType = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -44,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: schedule = self.schedule.to_dict() - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -81,7 +81,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: schedule = InviteToSlackChannelOpsgenieTaskParamsSchedule.from_dict(d.pop("schedule")) _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, InviteToSlackChannelOpsgenieTaskParamsTaskType] + task_type: Unset | InviteToSlackChannelOpsgenieTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/invite_to_slack_channel_opsgenie_task_params_channels_item.py b/rootly_sdk/models/invite_to_slack_channel_opsgenie_task_params_channels_item.py index e55f3f03..45a6009d 100644 --- a/rootly_sdk/models/invite_to_slack_channel_opsgenie_task_params_channels_item.py +++ b/rootly_sdk/models/invite_to_slack_channel_opsgenie_task_params_channels_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class InviteToSlackChannelOpsgenieTaskParamsChannelsItem: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/invite_to_slack_channel_opsgenie_task_params_schedule.py b/rootly_sdk/models/invite_to_slack_channel_opsgenie_task_params_schedule.py index 39e7d1a6..496748be 100644 --- a/rootly_sdk/models/invite_to_slack_channel_opsgenie_task_params_schedule.py +++ b/rootly_sdk/models/invite_to_slack_channel_opsgenie_task_params_schedule.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class InviteToSlackChannelOpsgenieTaskParamsSchedule: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/invite_to_slack_channel_pagerduty_task_params_type_0_escalation_policy.py b/rootly_sdk/models/invite_to_slack_channel_pagerduty_task_params_type_0_escalation_policy.py index 95548e6b..009cd231 100644 --- a/rootly_sdk/models/invite_to_slack_channel_pagerduty_task_params_type_0_escalation_policy.py +++ b/rootly_sdk/models/invite_to_slack_channel_pagerduty_task_params_type_0_escalation_policy.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class InviteToSlackChannelPagerdutyTaskParamsType0EscalationPolicy: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/invite_to_slack_channel_pagerduty_task_params_type_1_schedule.py b/rootly_sdk/models/invite_to_slack_channel_pagerduty_task_params_type_1_schedule.py index d8db577c..7e1c28ab 100644 --- a/rootly_sdk/models/invite_to_slack_channel_pagerduty_task_params_type_1_schedule.py +++ b/rootly_sdk/models/invite_to_slack_channel_pagerduty_task_params_type_1_schedule.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class InviteToSlackChannelPagerdutyTaskParamsType1Schedule: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/invite_to_slack_channel_rootly_task_params.py b/rootly_sdk/models/invite_to_slack_channel_rootly_task_params.py index a743a964..070af339 100644 --- a/rootly_sdk/models/invite_to_slack_channel_rootly_task_params.py +++ b/rootly_sdk/models/invite_to_slack_channel_rootly_task_params.py @@ -48,7 +48,7 @@ class InviteToSlackChannelRootlyTaskParams: """ channels: list["InviteToSlackChannelRootlyTaskParamsChannelsItem"] - task_type: Union[Unset, InviteToSlackChannelRootlyTaskParamsTaskType] = UNSET + task_type: Unset | InviteToSlackChannelRootlyTaskParamsTaskType = UNSET escalation_policy_target: Union[Unset, "InviteToSlackChannelRootlyTaskParamsEscalationPolicyTarget"] = UNSET service_target: Union[Unset, "InviteToSlackChannelRootlyTaskParamsServiceTarget"] = UNSET user_target: Union[Unset, "InviteToSlackChannelRootlyTaskParamsUserTarget"] = UNSET @@ -62,27 +62,27 @@ def to_dict(self) -> dict[str, Any]: channels_item = channels_item_data.to_dict() channels.append(channels_item) - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - escalation_policy_target: Union[Unset, dict[str, Any]] = UNSET + escalation_policy_target: Unset | dict[str, Any] = UNSET if not isinstance(self.escalation_policy_target, Unset): escalation_policy_target = self.escalation_policy_target.to_dict() - service_target: Union[Unset, dict[str, Any]] = UNSET + service_target: Unset | dict[str, Any] = UNSET if not isinstance(self.service_target, Unset): service_target = self.service_target.to_dict() - user_target: Union[Unset, dict[str, Any]] = UNSET + user_target: Unset | dict[str, Any] = UNSET if not isinstance(self.user_target, Unset): user_target = self.user_target.to_dict() - group_target: Union[Unset, dict[str, Any]] = UNSET + group_target: Unset | dict[str, Any] = UNSET if not isinstance(self.group_target, Unset): group_target = self.group_target.to_dict() - schedule_target: Union[Unset, dict[str, Any]] = UNSET + schedule_target: Unset | dict[str, Any] = UNSET if not isinstance(self.schedule_target, Unset): schedule_target = self.schedule_target.to_dict() @@ -138,14 +138,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: channels.append(channels_item) _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, InviteToSlackChannelRootlyTaskParamsTaskType] + task_type: Unset | InviteToSlackChannelRootlyTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: task_type = check_invite_to_slack_channel_rootly_task_params_task_type(_task_type) _escalation_policy_target = d.pop("escalation_policy_target", UNSET) - escalation_policy_target: Union[Unset, InviteToSlackChannelRootlyTaskParamsEscalationPolicyTarget] + escalation_policy_target: Unset | InviteToSlackChannelRootlyTaskParamsEscalationPolicyTarget if isinstance(_escalation_policy_target, Unset): escalation_policy_target = UNSET else: @@ -154,28 +154,28 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: ) _service_target = d.pop("service_target", UNSET) - service_target: Union[Unset, InviteToSlackChannelRootlyTaskParamsServiceTarget] + service_target: Unset | InviteToSlackChannelRootlyTaskParamsServiceTarget if isinstance(_service_target, Unset): service_target = UNSET else: service_target = InviteToSlackChannelRootlyTaskParamsServiceTarget.from_dict(_service_target) _user_target = d.pop("user_target", UNSET) - user_target: Union[Unset, InviteToSlackChannelRootlyTaskParamsUserTarget] + user_target: Unset | InviteToSlackChannelRootlyTaskParamsUserTarget if isinstance(_user_target, Unset): user_target = UNSET else: user_target = InviteToSlackChannelRootlyTaskParamsUserTarget.from_dict(_user_target) _group_target = d.pop("group_target", UNSET) - group_target: Union[Unset, InviteToSlackChannelRootlyTaskParamsGroupTarget] + group_target: Unset | InviteToSlackChannelRootlyTaskParamsGroupTarget if isinstance(_group_target, Unset): group_target = UNSET else: group_target = InviteToSlackChannelRootlyTaskParamsGroupTarget.from_dict(_group_target) _schedule_target = d.pop("schedule_target", UNSET) - schedule_target: Union[Unset, InviteToSlackChannelRootlyTaskParamsScheduleTarget] + schedule_target: Unset | InviteToSlackChannelRootlyTaskParamsScheduleTarget if isinstance(_schedule_target, Unset): schedule_target = UNSET else: diff --git a/rootly_sdk/models/invite_to_slack_channel_rootly_task_params_channels_item.py b/rootly_sdk/models/invite_to_slack_channel_rootly_task_params_channels_item.py index 7d494ebc..40e8480b 100644 --- a/rootly_sdk/models/invite_to_slack_channel_rootly_task_params_channels_item.py +++ b/rootly_sdk/models/invite_to_slack_channel_rootly_task_params_channels_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class InviteToSlackChannelRootlyTaskParamsChannelsItem: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/invite_to_slack_channel_rootly_task_params_escalation_policy_target.py b/rootly_sdk/models/invite_to_slack_channel_rootly_task_params_escalation_policy_target.py index 40e4f039..b7f8aae0 100644 --- a/rootly_sdk/models/invite_to_slack_channel_rootly_task_params_escalation_policy_target.py +++ b/rootly_sdk/models/invite_to_slack_channel_rootly_task_params_escalation_policy_target.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class InviteToSlackChannelRootlyTaskParamsEscalationPolicyTarget: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/invite_to_slack_channel_rootly_task_params_group_target.py b/rootly_sdk/models/invite_to_slack_channel_rootly_task_params_group_target.py index 5b361f3a..e22e4a4c 100644 --- a/rootly_sdk/models/invite_to_slack_channel_rootly_task_params_group_target.py +++ b/rootly_sdk/models/invite_to_slack_channel_rootly_task_params_group_target.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class InviteToSlackChannelRootlyTaskParamsGroupTarget: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/invite_to_slack_channel_rootly_task_params_schedule_target.py b/rootly_sdk/models/invite_to_slack_channel_rootly_task_params_schedule_target.py index ed1a9069..68ad559b 100644 --- a/rootly_sdk/models/invite_to_slack_channel_rootly_task_params_schedule_target.py +++ b/rootly_sdk/models/invite_to_slack_channel_rootly_task_params_schedule_target.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class InviteToSlackChannelRootlyTaskParamsScheduleTarget: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/invite_to_slack_channel_rootly_task_params_service_target.py b/rootly_sdk/models/invite_to_slack_channel_rootly_task_params_service_target.py index dc1ab327..b9f9bd54 100644 --- a/rootly_sdk/models/invite_to_slack_channel_rootly_task_params_service_target.py +++ b/rootly_sdk/models/invite_to_slack_channel_rootly_task_params_service_target.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class InviteToSlackChannelRootlyTaskParamsServiceTarget: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/invite_to_slack_channel_rootly_task_params_user_target.py b/rootly_sdk/models/invite_to_slack_channel_rootly_task_params_user_target.py index fbe2f84c..ac6987fd 100644 --- a/rootly_sdk/models/invite_to_slack_channel_rootly_task_params_user_target.py +++ b/rootly_sdk/models/invite_to_slack_channel_rootly_task_params_user_target.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class InviteToSlackChannelRootlyTaskParamsUserTarget: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/invite_to_slack_channel_task_params_type_0_slack_users_item.py b/rootly_sdk/models/invite_to_slack_channel_task_params_type_0_slack_users_item.py index a5f2ca53..1d7557f8 100644 --- a/rootly_sdk/models/invite_to_slack_channel_task_params_type_0_slack_users_item.py +++ b/rootly_sdk/models/invite_to_slack_channel_task_params_type_0_slack_users_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class InviteToSlackChannelTaskParamsType0SlackUsersItem: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/invite_to_slack_channel_task_params_type_1_slack_user_groups_item.py b/rootly_sdk/models/invite_to_slack_channel_task_params_type_1_slack_user_groups_item.py index 6429f5f5..f262daae 100644 --- a/rootly_sdk/models/invite_to_slack_channel_task_params_type_1_slack_user_groups_item.py +++ b/rootly_sdk/models/invite_to_slack_channel_task_params_type_1_slack_user_groups_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class InviteToSlackChannelTaskParamsType1SlackUserGroupsItem: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/invite_to_slack_channel_victor_ops_task_params.py b/rootly_sdk/models/invite_to_slack_channel_victor_ops_task_params.py index 551f2556..fe9170b0 100644 --- a/rootly_sdk/models/invite_to_slack_channel_victor_ops_task_params.py +++ b/rootly_sdk/models/invite_to_slack_channel_victor_ops_task_params.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -31,7 +31,7 @@ class InviteToSlackChannelVictorOpsTaskParams: channels: list["InviteToSlackChannelVictorOpsTaskParamsChannelsItem"] team: "InviteToSlackChannelVictorOpsTaskParamsTeam" - task_type: Union[Unset, InviteToSlackChannelVictorOpsTaskParamsTaskType] = UNSET + task_type: Unset | InviteToSlackChannelVictorOpsTaskParamsTaskType = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: team = self.team.to_dict() - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -79,7 +79,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: team = InviteToSlackChannelVictorOpsTaskParamsTeam.from_dict(d.pop("team")) _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, InviteToSlackChannelVictorOpsTaskParamsTaskType] + task_type: Unset | InviteToSlackChannelVictorOpsTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/invite_to_slack_channel_victor_ops_task_params_channels_item.py b/rootly_sdk/models/invite_to_slack_channel_victor_ops_task_params_channels_item.py index 92b84c9d..65599a9a 100644 --- a/rootly_sdk/models/invite_to_slack_channel_victor_ops_task_params_channels_item.py +++ b/rootly_sdk/models/invite_to_slack_channel_victor_ops_task_params_channels_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class InviteToSlackChannelVictorOpsTaskParamsChannelsItem: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/invite_to_slack_channel_victor_ops_task_params_team.py b/rootly_sdk/models/invite_to_slack_channel_victor_ops_task_params_team.py index 21056115..fda1a9f0 100644 --- a/rootly_sdk/models/invite_to_slack_channel_victor_ops_task_params_team.py +++ b/rootly_sdk/models/invite_to_slack_channel_victor_ops_task_params_team.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class InviteToSlackChannelVictorOpsTaskParamsTeam: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/jsonapi_included_resource.py b/rootly_sdk/models/jsonapi_included_resource.py index ec33a94e..cf6c95bf 100644 --- a/rootly_sdk/models/jsonapi_included_resource.py +++ b/rootly_sdk/models/jsonapi_included_resource.py @@ -35,11 +35,11 @@ def to_dict(self) -> dict[str, Any]: type_ = self.type_ - attributes: Union[Unset, dict[str, Any]] = UNSET + attributes: Unset | dict[str, Any] = UNSET if not isinstance(self.attributes, Unset): attributes = self.attributes.to_dict() - relationships: Union[Unset, dict[str, Any]] = UNSET + relationships: Unset | dict[str, Any] = UNSET if not isinstance(self.relationships, Unset): relationships = self.relationships.to_dict() @@ -69,14 +69,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: type_ = d.pop("type") _attributes = d.pop("attributes", UNSET) - attributes: Union[Unset, JsonapiIncludedResourceAttributes] + attributes: Unset | JsonapiIncludedResourceAttributes if isinstance(_attributes, Unset): attributes = UNSET else: attributes = JsonapiIncludedResourceAttributes.from_dict(_attributes) _relationships = d.pop("relationships", UNSET) - relationships: Union[Unset, JsonapiIncludedResourceRelationships] + relationships: Unset | JsonapiIncludedResourceRelationships if isinstance(_relationships, Unset): relationships = UNSET else: diff --git a/rootly_sdk/models/links.py b/rootly_sdk/models/links.py index 75915bf1..0aba5061 100644 --- a/rootly_sdk/models/links.py +++ b/rootly_sdk/models/links.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -20,9 +20,9 @@ class Links: self_: str first: str - prev: Union[None, str] - next_: Union[None, str] - last: Union[None, str] + prev: None | str + next_: None | str + last: None | str additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -30,13 +30,13 @@ def to_dict(self) -> dict[str, Any]: first = self.first - prev: Union[None, str] + prev: None | str prev = self.prev - next_: Union[None, str] + next_: None | str next_ = self.next_ - last: Union[None, str] + last: None | str last = self.last field_dict: dict[str, Any] = {} @@ -60,24 +60,24 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: first = d.pop("first") - def _parse_prev(data: object) -> Union[None, str]: + def _parse_prev(data: object) -> None | str: if data is None: return data - return cast(Union[None, str], data) + return cast(None | str, data) prev = _parse_prev(d.pop("prev")) - def _parse_next_(data: object) -> Union[None, str]: + def _parse_next_(data: object) -> None | str: if data is None: return data - return cast(Union[None, str], data) + return cast(None | str, data) next_ = _parse_next_(d.pop("next")) - def _parse_last(data: object) -> Union[None, str]: + def _parse_last(data: object) -> None | str: if data is None: return data - return cast(Union[None, str], data) + return cast(None | str, data) last = _parse_last(d.pop("last")) diff --git a/rootly_sdk/models/live_call_router.py b/rootly_sdk/models/live_call_router.py index affdc705..ba86dbf4 100644 --- a/rootly_sdk/models/live_call_router.py +++ b/rootly_sdk/models/live_call_router.py @@ -65,25 +65,25 @@ class LiveCallRouter: name: str created_at: str updated_at: str - kind: Union[Unset, LiveCallRouterKind] = UNSET - enabled: Union[Unset, bool] = UNSET - country_code: Union[Unset, LiveCallRouterCountryCode] = UNSET - phone_type: Union[Unset, LiveCallRouterPhoneType] = UNSET - phone_number: Union[Unset, str] = UNSET - voicemail_greeting: Union[Unset, str] = UNSET - caller_greeting: Union[Unset, str] = UNSET - unavailable_responder_message: Union[None, Unset, str] = UNSET - waiting_music_url: Union[Unset, LiveCallRouterWaitingMusicUrl] = UNSET - sent_to_voicemail_delay: Union[Unset, int] = UNSET - should_redirect_to_voicemail_on_no_answer: Union[Unset, bool] = UNSET - escalation_level_delay_in_seconds: Union[Unset, int] = UNSET - should_auto_resolve_alert_on_call_end: Union[Unset, bool] = UNSET - notify_via_sms: Union[Unset, bool] = UNSET - notify_via_push_notification: Union[Unset, bool] = UNSET - informational_notification_message: Union[None, Unset, str] = UNSET - alert_urgency_id: Union[Unset, str] = UNSET - calling_tree_prompt: Union[Unset, str] = UNSET - paging_targets: Union[Unset, list["LiveCallRouterPagingTargetsItem"]] = UNSET + kind: Unset | LiveCallRouterKind = UNSET + enabled: Unset | bool = UNSET + country_code: Unset | LiveCallRouterCountryCode = UNSET + phone_type: Unset | LiveCallRouterPhoneType = UNSET + phone_number: Unset | str = UNSET + voicemail_greeting: Unset | str = UNSET + caller_greeting: Unset | str = UNSET + unavailable_responder_message: None | Unset | str = UNSET + waiting_music_url: Unset | LiveCallRouterWaitingMusicUrl = UNSET + sent_to_voicemail_delay: Unset | int = UNSET + should_redirect_to_voicemail_on_no_answer: Unset | bool = UNSET + escalation_level_delay_in_seconds: Unset | int = UNSET + should_auto_resolve_alert_on_call_end: Unset | bool = UNSET + notify_via_sms: Unset | bool = UNSET + notify_via_push_notification: Unset | bool = UNSET + informational_notification_message: None | Unset | str = UNSET + alert_urgency_id: Unset | str = UNSET + calling_tree_prompt: Unset | str = UNSET + paging_targets: Unset | list["LiveCallRouterPagingTargetsItem"] = UNSET escalation_policy_trigger_params: Union[Unset, "LiveCallRouterEscalationPolicyTriggerParams"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -94,17 +94,17 @@ def to_dict(self) -> dict[str, Any]: updated_at = self.updated_at - kind: Union[Unset, str] = UNSET + kind: Unset | str = UNSET if not isinstance(self.kind, Unset): kind = self.kind enabled = self.enabled - country_code: Union[Unset, str] = UNSET + country_code: Unset | str = UNSET if not isinstance(self.country_code, Unset): country_code = self.country_code - phone_type: Union[Unset, str] = UNSET + phone_type: Unset | str = UNSET if not isinstance(self.phone_type, Unset): phone_type = self.phone_type @@ -114,13 +114,13 @@ def to_dict(self) -> dict[str, Any]: caller_greeting = self.caller_greeting - unavailable_responder_message: Union[None, Unset, str] + unavailable_responder_message: None | Unset | str if isinstance(self.unavailable_responder_message, Unset): unavailable_responder_message = UNSET else: unavailable_responder_message = self.unavailable_responder_message - waiting_music_url: Union[Unset, str] = UNSET + waiting_music_url: Unset | str = UNSET if not isinstance(self.waiting_music_url, Unset): waiting_music_url = self.waiting_music_url @@ -136,7 +136,7 @@ def to_dict(self) -> dict[str, Any]: notify_via_push_notification = self.notify_via_push_notification - informational_notification_message: Union[None, Unset, str] + informational_notification_message: None | Unset | str if isinstance(self.informational_notification_message, Unset): informational_notification_message = UNSET else: @@ -146,14 +146,14 @@ def to_dict(self) -> dict[str, Any]: calling_tree_prompt = self.calling_tree_prompt - paging_targets: Union[Unset, list[dict[str, Any]]] = UNSET + paging_targets: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.paging_targets, Unset): paging_targets = [] for paging_targets_item_data in self.paging_targets: paging_targets_item = paging_targets_item_data.to_dict() paging_targets.append(paging_targets_item) - escalation_policy_trigger_params: Union[Unset, dict[str, Any]] = UNSET + escalation_policy_trigger_params: Unset | dict[str, Any] = UNSET if not isinstance(self.escalation_policy_trigger_params, Unset): escalation_policy_trigger_params = self.escalation_policy_trigger_params.to_dict() @@ -224,7 +224,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: updated_at = d.pop("updated_at") _kind = d.pop("kind", UNSET) - kind: Union[Unset, LiveCallRouterKind] + kind: Unset | LiveCallRouterKind if isinstance(_kind, Unset): kind = UNSET else: @@ -233,14 +233,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: enabled = d.pop("enabled", UNSET) _country_code = d.pop("country_code", UNSET) - country_code: Union[Unset, LiveCallRouterCountryCode] + country_code: Unset | LiveCallRouterCountryCode if isinstance(_country_code, Unset): country_code = UNSET else: country_code = check_live_call_router_country_code(_country_code) _phone_type = d.pop("phone_type", UNSET) - phone_type: Union[Unset, LiveCallRouterPhoneType] + phone_type: Unset | LiveCallRouterPhoneType if isinstance(_phone_type, Unset): phone_type = UNSET else: @@ -252,19 +252,19 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: caller_greeting = d.pop("caller_greeting", UNSET) - def _parse_unavailable_responder_message(data: object) -> Union[None, Unset, str]: + def _parse_unavailable_responder_message(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) unavailable_responder_message = _parse_unavailable_responder_message( d.pop("unavailable_responder_message", UNSET) ) _waiting_music_url = d.pop("waiting_music_url", UNSET) - waiting_music_url: Union[Unset, LiveCallRouterWaitingMusicUrl] + waiting_music_url: Unset | LiveCallRouterWaitingMusicUrl if isinstance(_waiting_music_url, Unset): waiting_music_url = UNSET else: @@ -282,12 +282,12 @@ def _parse_unavailable_responder_message(data: object) -> Union[None, Unset, str notify_via_push_notification = d.pop("notify_via_push_notification", UNSET) - def _parse_informational_notification_message(data: object) -> Union[None, Unset, str]: + def _parse_informational_notification_message(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) informational_notification_message = _parse_informational_notification_message( d.pop("informational_notification_message", UNSET) @@ -305,7 +305,7 @@ def _parse_informational_notification_message(data: object) -> Union[None, Unset paging_targets.append(paging_targets_item) _escalation_policy_trigger_params = d.pop("escalation_policy_trigger_params", UNSET) - escalation_policy_trigger_params: Union[Unset, LiveCallRouterEscalationPolicyTriggerParams] + escalation_policy_trigger_params: Unset | LiveCallRouterEscalationPolicyTriggerParams if isinstance(_escalation_policy_trigger_params, Unset): escalation_policy_trigger_params = UNSET else: diff --git a/rootly_sdk/models/live_call_router_list.py b/rootly_sdk/models/live_call_router_list.py index 02c7cbff..77f66edd 100644 --- a/rootly_sdk/models/live_call_router_list.py +++ b/rootly_sdk/models/live_call_router_list.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,7 +29,7 @@ class LiveCallRouterList: data: list["LiveCallRouterListDataItem"] links: "Links" meta: "Meta" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/live_call_router_response.py b/rootly_sdk/models/live_call_router_response.py index e4063db1..4feab05c 100644 --- a/rootly_sdk/models/live_call_router_response.py +++ b/rootly_sdk/models/live_call_router_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,13 +23,13 @@ class LiveCallRouterResponse: """ data: "LiveCallRouterResponseData" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/meeting_recording.py b/rootly_sdk/models/meeting_recording.py index 829dd35c..e32e79c8 100644 --- a/rootly_sdk/models/meeting_recording.py +++ b/rootly_sdk/models/meeting_recording.py @@ -1,6 +1,6 @@ import datetime from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -41,16 +41,16 @@ class MeetingRecording: status: MeetingRecordingStatus created_at: datetime.datetime updated_at: datetime.datetime - started_at: Union[None, Unset, datetime.datetime] = UNSET - ended_at: Union[None, Unset, datetime.datetime] = UNSET - duration_minutes: Union[None, Unset, float] = UNSET - speaker_count: Union[Unset, int] = UNSET - word_count: Union[Unset, int] = UNSET - transcript_summary: Union[None, Unset, str] = UNSET - title: Union[None, Unset, str] = UNSET - meeting_url: Union[None, Unset, str] = UNSET - video_url: Union[None, Unset, str] = UNSET - created_by: Union[None, Unset, str] = UNSET + started_at: None | Unset | datetime.datetime = UNSET + ended_at: None | Unset | datetime.datetime = UNSET + duration_minutes: None | Unset | float = UNSET + speaker_count: Unset | int = UNSET + word_count: Unset | int = UNSET + transcript_summary: None | Unset | str = UNSET + title: None | Unset | str = UNSET + meeting_url: None | Unset | str = UNSET + video_url: None | Unset | str = UNSET + created_by: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -64,7 +64,7 @@ def to_dict(self) -> dict[str, Any]: updated_at = self.updated_at.isoformat() - started_at: Union[None, Unset, str] + started_at: None | Unset | str if isinstance(self.started_at, Unset): started_at = UNSET elif isinstance(self.started_at, datetime.datetime): @@ -72,7 +72,7 @@ def to_dict(self) -> dict[str, Any]: else: started_at = self.started_at - ended_at: Union[None, Unset, str] + ended_at: None | Unset | str if isinstance(self.ended_at, Unset): ended_at = UNSET elif isinstance(self.ended_at, datetime.datetime): @@ -80,7 +80,7 @@ def to_dict(self) -> dict[str, Any]: else: ended_at = self.ended_at - duration_minutes: Union[None, Unset, float] + duration_minutes: None | Unset | float if isinstance(self.duration_minutes, Unset): duration_minutes = UNSET else: @@ -90,31 +90,31 @@ def to_dict(self) -> dict[str, Any]: word_count = self.word_count - transcript_summary: Union[None, Unset, str] + transcript_summary: None | Unset | str if isinstance(self.transcript_summary, Unset): transcript_summary = UNSET else: transcript_summary = self.transcript_summary - title: Union[None, Unset, str] + title: None | Unset | str if isinstance(self.title, Unset): title = UNSET else: title = self.title - meeting_url: Union[None, Unset, str] + meeting_url: None | Unset | str if isinstance(self.meeting_url, Unset): meeting_url = UNSET else: meeting_url = self.meeting_url - video_url: Union[None, Unset, str] + video_url: None | Unset | str if isinstance(self.video_url, Unset): video_url = UNSET else: video_url = self.video_url - created_by: Union[None, Unset, str] + created_by: None | Unset | str if isinstance(self.created_by, Unset): created_by = UNSET else: @@ -167,7 +167,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: updated_at = isoparse(d.pop("updated_at")) - def _parse_started_at(data: object) -> Union[None, Unset, datetime.datetime]: + def _parse_started_at(data: object) -> None | Unset | datetime.datetime: if data is None: return data if isinstance(data, Unset): @@ -180,11 +180,11 @@ def _parse_started_at(data: object) -> Union[None, Unset, datetime.datetime]: return started_at_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, datetime.datetime], data) + return cast(None | Unset | datetime.datetime, data) started_at = _parse_started_at(d.pop("started_at", UNSET)) - def _parse_ended_at(data: object) -> Union[None, Unset, datetime.datetime]: + def _parse_ended_at(data: object) -> None | Unset | datetime.datetime: if data is None: return data if isinstance(data, Unset): @@ -197,16 +197,16 @@ def _parse_ended_at(data: object) -> Union[None, Unset, datetime.datetime]: return ended_at_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, datetime.datetime], data) + return cast(None | Unset | datetime.datetime, data) ended_at = _parse_ended_at(d.pop("ended_at", UNSET)) - def _parse_duration_minutes(data: object) -> Union[None, Unset, float]: + def _parse_duration_minutes(data: object) -> None | Unset | float: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, float], data) + return cast(None | Unset | float, data) duration_minutes = _parse_duration_minutes(d.pop("duration_minutes", UNSET)) @@ -214,48 +214,48 @@ def _parse_duration_minutes(data: object) -> Union[None, Unset, float]: word_count = d.pop("word_count", UNSET) - def _parse_transcript_summary(data: object) -> Union[None, Unset, str]: + def _parse_transcript_summary(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) transcript_summary = _parse_transcript_summary(d.pop("transcript_summary", UNSET)) - def _parse_title(data: object) -> Union[None, Unset, str]: + def _parse_title(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) title = _parse_title(d.pop("title", UNSET)) - def _parse_meeting_url(data: object) -> Union[None, Unset, str]: + def _parse_meeting_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) meeting_url = _parse_meeting_url(d.pop("meeting_url", UNSET)) - def _parse_video_url(data: object) -> Union[None, Unset, str]: + def _parse_video_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) video_url = _parse_video_url(d.pop("video_url", UNSET)) - def _parse_created_by(data: object) -> Union[None, Unset, str]: + def _parse_created_by(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) created_by = _parse_created_by(d.pop("created_by", UNSET)) diff --git a/rootly_sdk/models/meeting_recording_detail.py b/rootly_sdk/models/meeting_recording_detail.py index 4e6145fb..7be0306d 100644 --- a/rootly_sdk/models/meeting_recording_detail.py +++ b/rootly_sdk/models/meeting_recording_detail.py @@ -51,20 +51,20 @@ class MeetingRecordingDetail: status: MeetingRecordingStatus created_at: datetime.datetime updated_at: datetime.datetime - started_at: Union[None, Unset, datetime.datetime] = UNSET - ended_at: Union[None, Unset, datetime.datetime] = UNSET - duration_minutes: Union[None, Unset, float] = UNSET - speaker_count: Union[Unset, int] = UNSET - word_count: Union[Unset, int] = UNSET - transcript_summary: Union[None, Unset, str] = UNSET - title: Union[None, Unset, str] = UNSET - meeting_url: Union[None, Unset, str] = UNSET - video_url: Union[None, Unset, str] = UNSET - created_by: Union[None, Unset, str] = UNSET + started_at: None | Unset | datetime.datetime = UNSET + ended_at: None | Unset | datetime.datetime = UNSET + duration_minutes: None | Unset | float = UNSET + speaker_count: Unset | int = UNSET + word_count: Unset | int = UNSET + transcript_summary: None | Unset | str = UNSET + title: None | Unset | str = UNSET + meeting_url: None | Unset | str = UNSET + video_url: None | Unset | str = UNSET + created_by: None | Unset | str = UNSET transcript: Union["MeetingRecordingDetailTranscriptType1", Unset, list["MeetingRecordingTranscriptSegment"]] = UNSET - recall_upload_id: Union[None, Unset, str] = UNSET - recordable_id: Union[None, Unset, str] = UNSET - recordable_type: Union[None, Unset, str] = UNSET + recall_upload_id: None | Unset | str = UNSET + recordable_id: None | Unset | str = UNSET + recordable_type: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -78,7 +78,7 @@ def to_dict(self) -> dict[str, Any]: updated_at = self.updated_at.isoformat() - started_at: Union[None, Unset, str] + started_at: None | Unset | str if isinstance(self.started_at, Unset): started_at = UNSET elif isinstance(self.started_at, datetime.datetime): @@ -86,7 +86,7 @@ def to_dict(self) -> dict[str, Any]: else: started_at = self.started_at - ended_at: Union[None, Unset, str] + ended_at: None | Unset | str if isinstance(self.ended_at, Unset): ended_at = UNSET elif isinstance(self.ended_at, datetime.datetime): @@ -94,7 +94,7 @@ def to_dict(self) -> dict[str, Any]: else: ended_at = self.ended_at - duration_minutes: Union[None, Unset, float] + duration_minutes: None | Unset | float if isinstance(self.duration_minutes, Unset): duration_minutes = UNSET else: @@ -104,37 +104,37 @@ def to_dict(self) -> dict[str, Any]: word_count = self.word_count - transcript_summary: Union[None, Unset, str] + transcript_summary: None | Unset | str if isinstance(self.transcript_summary, Unset): transcript_summary = UNSET else: transcript_summary = self.transcript_summary - title: Union[None, Unset, str] + title: None | Unset | str if isinstance(self.title, Unset): title = UNSET else: title = self.title - meeting_url: Union[None, Unset, str] + meeting_url: None | Unset | str if isinstance(self.meeting_url, Unset): meeting_url = UNSET else: meeting_url = self.meeting_url - video_url: Union[None, Unset, str] + video_url: None | Unset | str if isinstance(self.video_url, Unset): video_url = UNSET else: video_url = self.video_url - created_by: Union[None, Unset, str] + created_by: None | Unset | str if isinstance(self.created_by, Unset): created_by = UNSET else: created_by = self.created_by - transcript: Union[Unset, dict[str, Any], list[dict[str, Any]]] + transcript: Unset | dict[str, Any] | list[dict[str, Any]] if isinstance(self.transcript, Unset): transcript = UNSET elif isinstance(self.transcript, list): @@ -146,19 +146,19 @@ def to_dict(self) -> dict[str, Any]: else: transcript = self.transcript.to_dict() - recall_upload_id: Union[None, Unset, str] + recall_upload_id: None | Unset | str if isinstance(self.recall_upload_id, Unset): recall_upload_id = UNSET else: recall_upload_id = self.recall_upload_id - recordable_id: Union[None, Unset, str] + recordable_id: None | Unset | str if isinstance(self.recordable_id, Unset): recordable_id = UNSET else: recordable_id = self.recordable_id - recordable_type: Union[None, Unset, str] + recordable_type: None | Unset | str if isinstance(self.recordable_type, Unset): recordable_type = UNSET else: @@ -222,7 +222,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: updated_at = isoparse(d.pop("updated_at")) - def _parse_started_at(data: object) -> Union[None, Unset, datetime.datetime]: + def _parse_started_at(data: object) -> None | Unset | datetime.datetime: if data is None: return data if isinstance(data, Unset): @@ -235,11 +235,11 @@ def _parse_started_at(data: object) -> Union[None, Unset, datetime.datetime]: return started_at_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, datetime.datetime], data) + return cast(None | Unset | datetime.datetime, data) started_at = _parse_started_at(d.pop("started_at", UNSET)) - def _parse_ended_at(data: object) -> Union[None, Unset, datetime.datetime]: + def _parse_ended_at(data: object) -> None | Unset | datetime.datetime: if data is None: return data if isinstance(data, Unset): @@ -252,16 +252,16 @@ def _parse_ended_at(data: object) -> Union[None, Unset, datetime.datetime]: return ended_at_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, datetime.datetime], data) + return cast(None | Unset | datetime.datetime, data) ended_at = _parse_ended_at(d.pop("ended_at", UNSET)) - def _parse_duration_minutes(data: object) -> Union[None, Unset, float]: + def _parse_duration_minutes(data: object) -> None | Unset | float: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, float], data) + return cast(None | Unset | float, data) duration_minutes = _parse_duration_minutes(d.pop("duration_minutes", UNSET)) @@ -269,48 +269,48 @@ def _parse_duration_minutes(data: object) -> Union[None, Unset, float]: word_count = d.pop("word_count", UNSET) - def _parse_transcript_summary(data: object) -> Union[None, Unset, str]: + def _parse_transcript_summary(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) transcript_summary = _parse_transcript_summary(d.pop("transcript_summary", UNSET)) - def _parse_title(data: object) -> Union[None, Unset, str]: + def _parse_title(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) title = _parse_title(d.pop("title", UNSET)) - def _parse_meeting_url(data: object) -> Union[None, Unset, str]: + def _parse_meeting_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) meeting_url = _parse_meeting_url(d.pop("meeting_url", UNSET)) - def _parse_video_url(data: object) -> Union[None, Unset, str]: + def _parse_video_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) video_url = _parse_video_url(d.pop("video_url", UNSET)) - def _parse_created_by(data: object) -> Union[None, Unset, str]: + def _parse_created_by(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) created_by = _parse_created_by(d.pop("created_by", UNSET)) @@ -340,30 +340,30 @@ def _parse_transcript( transcript = _parse_transcript(d.pop("transcript", UNSET)) - def _parse_recall_upload_id(data: object) -> Union[None, Unset, str]: + def _parse_recall_upload_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) recall_upload_id = _parse_recall_upload_id(d.pop("recall_upload_id", UNSET)) - def _parse_recordable_id(data: object) -> Union[None, Unset, str]: + def _parse_recordable_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) recordable_id = _parse_recordable_id(d.pop("recordable_id", UNSET)) - def _parse_recordable_type(data: object) -> Union[None, Unset, str]: + def _parse_recordable_type(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) recordable_type = _parse_recordable_type(d.pop("recordable_type", UNSET)) diff --git a/rootly_sdk/models/meeting_recording_list.py b/rootly_sdk/models/meeting_recording_list.py index 5683c11c..d4a6ce0a 100644 --- a/rootly_sdk/models/meeting_recording_list.py +++ b/rootly_sdk/models/meeting_recording_list.py @@ -32,7 +32,7 @@ def to_dict(self) -> dict[str, Any]: data_item = data_item_data.to_dict() data.append(data_item) - meta: Union[Unset, dict[str, Any]] = UNSET + meta: Unset | dict[str, Any] = UNSET if not isinstance(self.meta, Unset): meta = self.meta.to_dict() @@ -62,7 +62,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data.append(data_item) _meta = d.pop("meta", UNSET) - meta: Union[Unset, Meta] + meta: Unset | Meta if isinstance(_meta, Unset): meta = UNSET else: diff --git a/rootly_sdk/models/meeting_recording_transcript_word.py b/rootly_sdk/models/meeting_recording_transcript_word.py index 14465cae..114bcf09 100644 --- a/rootly_sdk/models/meeting_recording_transcript_word.py +++ b/rootly_sdk/models/meeting_recording_transcript_word.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,8 +19,8 @@ class MeetingRecordingTranscriptWord: """ text: str - start_timestamp: Union[Unset, float] = UNSET - end_timestamp: Union[Unset, float] = UNSET + start_timestamp: Unset | float = UNSET + end_timestamp: Unset | float = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/meta.py b/rootly_sdk/models/meta.py index ea619323..66e5874d 100644 --- a/rootly_sdk/models/meta.py +++ b/rootly_sdk/models/meta.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,29 +21,29 @@ class Meta: next_cursor (Union[None, Unset, str]): """ - current_page: Union[None, int] - next_page: Union[None, int] - prev_page: Union[None, int] + current_page: None | int + next_page: None | int + prev_page: None | int total_count: int total_pages: int - next_cursor: Union[None, Unset, str] = UNSET + next_cursor: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - current_page: Union[None, int] + current_page: None | int current_page = self.current_page - next_page: Union[None, int] + next_page: None | int next_page = self.next_page - prev_page: Union[None, int] + prev_page: None | int prev_page = self.prev_page total_count = self.total_count total_pages = self.total_pages - next_cursor: Union[None, Unset, str] + next_cursor: None | Unset | str if isinstance(self.next_cursor, Unset): next_cursor = UNSET else: @@ -69,24 +69,24 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_current_page(data: object) -> Union[None, int]: + def _parse_current_page(data: object) -> None | int: if data is None: return data - return cast(Union[None, int], data) + return cast(None | int, data) current_page = _parse_current_page(d.pop("current_page")) - def _parse_next_page(data: object) -> Union[None, int]: + def _parse_next_page(data: object) -> None | int: if data is None: return data - return cast(Union[None, int], data) + return cast(None | int, data) next_page = _parse_next_page(d.pop("next_page")) - def _parse_prev_page(data: object) -> Union[None, int]: + def _parse_prev_page(data: object) -> None | int: if data is None: return data - return cast(Union[None, int], data) + return cast(None | int, data) prev_page = _parse_prev_page(d.pop("prev_page")) @@ -94,12 +94,12 @@ def _parse_prev_page(data: object) -> Union[None, int]: total_pages = d.pop("total_pages") - def _parse_next_cursor(data: object) -> Union[None, Unset, str]: + def _parse_next_cursor(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) next_cursor = _parse_next_cursor(d.pop("next_cursor", UNSET)) diff --git a/rootly_sdk/models/mitigate_incident_data_attributes.py b/rootly_sdk/models/mitigate_incident_data_attributes.py index b70dceba..d18c92cc 100644 --- a/rootly_sdk/models/mitigate_incident_data_attributes.py +++ b/rootly_sdk/models/mitigate_incident_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -15,10 +15,10 @@ class MitigateIncidentDataAttributes: mitigation_message (Union[None, Unset, str]): How was the incident mitigated? """ - mitigation_message: Union[None, Unset, str] = UNSET + mitigation_message: None | Unset | str = UNSET def to_dict(self) -> dict[str, Any]: - mitigation_message: Union[None, Unset, str] + mitigation_message: None | Unset | str if isinstance(self.mitigation_message, Unset): mitigation_message = UNSET else: @@ -36,12 +36,12 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_mitigation_message(data: object) -> Union[None, Unset, str]: + def _parse_mitigation_message(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) mitigation_message = _parse_mitigation_message(d.pop("mitigation_message", UNSET)) diff --git a/rootly_sdk/models/new_alert_data_attributes.py b/rootly_sdk/models/new_alert_data_attributes.py index 59543ee6..7082ee65 100644 --- a/rootly_sdk/models/new_alert_data_attributes.py +++ b/rootly_sdk/models/new_alert_data_attributes.py @@ -73,28 +73,28 @@ class NewAlertDataAttributes: """ summary: str - noise: Union[Unset, NewAlertDataAttributesNoise] = UNSET - source: Union[Unset, str] = UNSET - status: Union[Unset, NewAlertDataAttributesStatus] = UNSET - description: Union[None, Unset, str] = UNSET - service_ids: Union[None, Unset, list[str]] = UNSET - group_ids: Union[None, Unset, list[str]] = UNSET - functionality_ids: Union[None, Unset, list[str]] = UNSET - environment_ids: Union[None, Unset, list[str]] = UNSET - started_at: Union[None, Unset, datetime.datetime] = UNSET - ended_at: Union[None, Unset, datetime.datetime] = UNSET - external_id: Union[None, Unset, str] = UNSET - external_url: Union[None, Unset, str] = UNSET - alert_urgency_id: Union[None, Unset, str] = UNSET - notification_target_type: Union[Unset, NewAlertDataAttributesNotificationTargetType] = UNSET - notification_target_id: Union[None, Unset, str] = UNSET - notification_targets: Union[None, Unset, list["NewAlertDataAttributesNotificationTargetsType0Item"]] = UNSET - labels: Union[Unset, list[Union["NewAlertDataAttributesLabelsItemType0", None]]] = UNSET + noise: Unset | NewAlertDataAttributesNoise = UNSET + source: Unset | str = UNSET + status: Unset | NewAlertDataAttributesStatus = UNSET + description: None | Unset | str = UNSET + service_ids: None | Unset | list[str] = UNSET + group_ids: None | Unset | list[str] = UNSET + functionality_ids: None | Unset | list[str] = UNSET + environment_ids: None | Unset | list[str] = UNSET + started_at: None | Unset | datetime.datetime = UNSET + ended_at: None | Unset | datetime.datetime = UNSET + external_id: None | Unset | str = UNSET + external_url: None | Unset | str = UNSET + alert_urgency_id: None | Unset | str = UNSET + notification_target_type: Unset | NewAlertDataAttributesNotificationTargetType = UNSET + notification_target_id: None | Unset | str = UNSET + notification_targets: None | Unset | list["NewAlertDataAttributesNotificationTargetsType0Item"] = UNSET + labels: Unset | list[Union["NewAlertDataAttributesLabelsItemType0", None]] = UNSET data: Union["NewAlertDataAttributesDataType0", None, Unset] = UNSET - deduplication_key: Union[None, Unset, str] = UNSET - alert_field_values_attributes: Union[ - Unset, list[Union["NewAlertDataAttributesAlertFieldValuesAttributesItemType0", None]] - ] = UNSET + deduplication_key: None | Unset | str = UNSET + alert_field_values_attributes: ( + Unset | list[Union["NewAlertDataAttributesAlertFieldValuesAttributesItemType0", None]] + ) = UNSET def to_dict(self) -> dict[str, Any]: from ..models.new_alert_data_attributes_alert_field_values_attributes_item_type_0 import ( @@ -105,23 +105,23 @@ def to_dict(self) -> dict[str, Any]: summary = self.summary - noise: Union[Unset, str] = UNSET + noise: Unset | str = UNSET if not isinstance(self.noise, Unset): noise = self.noise source = self.source - status: Union[Unset, str] = UNSET + status: Unset | str = UNSET if not isinstance(self.status, Unset): status = self.status - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - service_ids: Union[None, Unset, list[str]] + service_ids: None | Unset | list[str] if isinstance(self.service_ids, Unset): service_ids = UNSET elif isinstance(self.service_ids, list): @@ -130,7 +130,7 @@ def to_dict(self) -> dict[str, Any]: else: service_ids = self.service_ids - group_ids: Union[None, Unset, list[str]] + group_ids: None | Unset | list[str] if isinstance(self.group_ids, Unset): group_ids = UNSET elif isinstance(self.group_ids, list): @@ -139,7 +139,7 @@ def to_dict(self) -> dict[str, Any]: else: group_ids = self.group_ids - functionality_ids: Union[None, Unset, list[str]] + functionality_ids: None | Unset | list[str] if isinstance(self.functionality_ids, Unset): functionality_ids = UNSET elif isinstance(self.functionality_ids, list): @@ -148,7 +148,7 @@ def to_dict(self) -> dict[str, Any]: else: functionality_ids = self.functionality_ids - environment_ids: Union[None, Unset, list[str]] + environment_ids: None | Unset | list[str] if isinstance(self.environment_ids, Unset): environment_ids = UNSET elif isinstance(self.environment_ids, list): @@ -157,7 +157,7 @@ def to_dict(self) -> dict[str, Any]: else: environment_ids = self.environment_ids - started_at: Union[None, Unset, str] + started_at: None | Unset | str if isinstance(self.started_at, Unset): started_at = UNSET elif isinstance(self.started_at, datetime.datetime): @@ -165,7 +165,7 @@ def to_dict(self) -> dict[str, Any]: else: started_at = self.started_at - ended_at: Union[None, Unset, str] + ended_at: None | Unset | str if isinstance(self.ended_at, Unset): ended_at = UNSET elif isinstance(self.ended_at, datetime.datetime): @@ -173,35 +173,35 @@ def to_dict(self) -> dict[str, Any]: else: ended_at = self.ended_at - external_id: Union[None, Unset, str] + external_id: None | Unset | str if isinstance(self.external_id, Unset): external_id = UNSET else: external_id = self.external_id - external_url: Union[None, Unset, str] + external_url: None | Unset | str if isinstance(self.external_url, Unset): external_url = UNSET else: external_url = self.external_url - alert_urgency_id: Union[None, Unset, str] + alert_urgency_id: None | Unset | str if isinstance(self.alert_urgency_id, Unset): alert_urgency_id = UNSET else: alert_urgency_id = self.alert_urgency_id - notification_target_type: Union[Unset, str] = UNSET + notification_target_type: Unset | str = UNSET if not isinstance(self.notification_target_type, Unset): notification_target_type = self.notification_target_type - notification_target_id: Union[None, Unset, str] + notification_target_id: None | Unset | str if isinstance(self.notification_target_id, Unset): notification_target_id = UNSET else: notification_target_id = self.notification_target_id - notification_targets: Union[None, Unset, list[dict[str, Any]]] + notification_targets: None | Unset | list[dict[str, Any]] if isinstance(self.notification_targets, Unset): notification_targets = UNSET elif isinstance(self.notification_targets, list): @@ -213,18 +213,18 @@ def to_dict(self) -> dict[str, Any]: else: notification_targets = self.notification_targets - labels: Union[Unset, list[Union[None, dict[str, Any]]]] = UNSET + labels: Unset | list[None | dict[str, Any]] = UNSET if not isinstance(self.labels, Unset): labels = [] for labels_item_data in self.labels: - labels_item: Union[None, dict[str, Any]] + labels_item: None | dict[str, Any] if isinstance(labels_item_data, NewAlertDataAttributesLabelsItemType0): labels_item = labels_item_data.to_dict() else: labels_item = labels_item_data labels.append(labels_item) - data: Union[None, Unset, dict[str, Any]] + data: None | Unset | dict[str, Any] if isinstance(self.data, Unset): data = UNSET elif isinstance(self.data, NewAlertDataAttributesDataType0): @@ -232,17 +232,17 @@ def to_dict(self) -> dict[str, Any]: else: data = self.data - deduplication_key: Union[None, Unset, str] + deduplication_key: None | Unset | str if isinstance(self.deduplication_key, Unset): deduplication_key = UNSET else: deduplication_key = self.deduplication_key - alert_field_values_attributes: Union[Unset, list[Union[None, dict[str, Any]]]] = UNSET + alert_field_values_attributes: Unset | list[None | dict[str, Any]] = UNSET if not isinstance(self.alert_field_values_attributes, Unset): alert_field_values_attributes = [] for alert_field_values_attributes_item_data in self.alert_field_values_attributes: - alert_field_values_attributes_item: Union[None, dict[str, Any]] + alert_field_values_attributes_item: None | dict[str, Any] if isinstance( alert_field_values_attributes_item_data, NewAlertDataAttributesAlertFieldValuesAttributesItemType0 ): @@ -316,7 +316,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: summary = d.pop("summary") _noise = d.pop("noise", UNSET) - noise: Union[Unset, NewAlertDataAttributesNoise] + noise: Unset | NewAlertDataAttributesNoise if isinstance(_noise, Unset): noise = UNSET else: @@ -325,22 +325,22 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: source = d.pop("source", UNSET) _status = d.pop("status", UNSET) - status: Union[Unset, NewAlertDataAttributesStatus] + status: Unset | NewAlertDataAttributesStatus if isinstance(_status, Unset): status = UNSET else: status = check_new_alert_data_attributes_status(_status) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_service_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_service_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -353,11 +353,11 @@ def _parse_service_ids(data: object) -> Union[None, Unset, list[str]]: return service_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) service_ids = _parse_service_ids(d.pop("service_ids", UNSET)) - def _parse_group_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_group_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -370,11 +370,11 @@ def _parse_group_ids(data: object) -> Union[None, Unset, list[str]]: return group_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) group_ids = _parse_group_ids(d.pop("group_ids", UNSET)) - def _parse_functionality_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_functionality_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -387,11 +387,11 @@ def _parse_functionality_ids(data: object) -> Union[None, Unset, list[str]]: return functionality_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) functionality_ids = _parse_functionality_ids(d.pop("functionality_ids", UNSET)) - def _parse_environment_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_environment_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -404,11 +404,11 @@ def _parse_environment_ids(data: object) -> Union[None, Unset, list[str]]: return environment_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) environment_ids = _parse_environment_ids(d.pop("environment_ids", UNSET)) - def _parse_started_at(data: object) -> Union[None, Unset, datetime.datetime]: + def _parse_started_at(data: object) -> None | Unset | datetime.datetime: if data is None: return data if isinstance(data, Unset): @@ -421,11 +421,11 @@ def _parse_started_at(data: object) -> Union[None, Unset, datetime.datetime]: return started_at_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, datetime.datetime], data) + return cast(None | Unset | datetime.datetime, data) started_at = _parse_started_at(d.pop("started_at", UNSET)) - def _parse_ended_at(data: object) -> Union[None, Unset, datetime.datetime]: + def _parse_ended_at(data: object) -> None | Unset | datetime.datetime: if data is None: return data if isinstance(data, Unset): @@ -438,39 +438,39 @@ def _parse_ended_at(data: object) -> Union[None, Unset, datetime.datetime]: return ended_at_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, datetime.datetime], data) + return cast(None | Unset | datetime.datetime, data) ended_at = _parse_ended_at(d.pop("ended_at", UNSET)) - def _parse_external_id(data: object) -> Union[None, Unset, str]: + def _parse_external_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) external_id = _parse_external_id(d.pop("external_id", UNSET)) - def _parse_external_url(data: object) -> Union[None, Unset, str]: + def _parse_external_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) external_url = _parse_external_url(d.pop("external_url", UNSET)) - def _parse_alert_urgency_id(data: object) -> Union[None, Unset, str]: + def _parse_alert_urgency_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) alert_urgency_id = _parse_alert_urgency_id(d.pop("alert_urgency_id", UNSET)) _notification_target_type = d.pop("notification_target_type", UNSET) - notification_target_type: Union[Unset, NewAlertDataAttributesNotificationTargetType] + notification_target_type: Unset | NewAlertDataAttributesNotificationTargetType if isinstance(_notification_target_type, Unset): notification_target_type = UNSET else: @@ -478,18 +478,18 @@ def _parse_alert_urgency_id(data: object) -> Union[None, Unset, str]: _notification_target_type ) - def _parse_notification_target_id(data: object) -> Union[None, Unset, str]: + def _parse_notification_target_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) notification_target_id = _parse_notification_target_id(d.pop("notification_target_id", UNSET)) def _parse_notification_targets( data: object, - ) -> Union[None, Unset, list["NewAlertDataAttributesNotificationTargetsType0Item"]]: + ) -> None | Unset | list["NewAlertDataAttributesNotificationTargetsType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -509,7 +509,7 @@ def _parse_notification_targets( return notification_targets_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list["NewAlertDataAttributesNotificationTargetsType0Item"]], data) + return cast(None | Unset | list["NewAlertDataAttributesNotificationTargetsType0Item"], data) notification_targets = _parse_notification_targets(d.pop("notification_targets", UNSET)) @@ -551,12 +551,12 @@ def _parse_data(data: object) -> Union["NewAlertDataAttributesDataType0", None, data = _parse_data(d.pop("data", UNSET)) - def _parse_deduplication_key(data: object) -> Union[None, Unset, str]: + def _parse_deduplication_key(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) deduplication_key = _parse_deduplication_key(d.pop("deduplication_key", UNSET)) diff --git a/rootly_sdk/models/new_alert_data_attributes_labels_item_type_0.py b/rootly_sdk/models/new_alert_data_attributes_labels_item_type_0.py index 5599a981..d3341fa6 100644 --- a/rootly_sdk/models/new_alert_data_attributes_labels_item_type_0.py +++ b/rootly_sdk/models/new_alert_data_attributes_labels_item_type_0.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,13 +16,13 @@ class NewAlertDataAttributesLabelsItemType0: """ key: str - value: Union[bool, float, str] + value: bool | float | str additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: key = self.key - value: Union[bool, float, str] + value: bool | float | str value = self.value field_dict: dict[str, Any] = {} @@ -41,8 +41,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) key = d.pop("key") - def _parse_value(data: object) -> Union[bool, float, str]: - return cast(Union[bool, float, str], data) + def _parse_value(data: object) -> bool | float | str: + return cast(bool | float | str, data) value = _parse_value(d.pop("value")) diff --git a/rootly_sdk/models/new_alert_event_data_attributes.py b/rootly_sdk/models/new_alert_event_data_attributes.py index fa2d9ae7..be5da6d1 100644 --- a/rootly_sdk/models/new_alert_event_data_attributes.py +++ b/rootly_sdk/models/new_alert_event_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define @@ -23,7 +23,7 @@ class NewAlertEventDataAttributes: kind: NewAlertEventDataAttributesKind details: str - user_id: Union[Unset, int] = UNSET + user_id: Unset | int = UNSET def to_dict(self) -> dict[str, Any]: kind: str = self.kind diff --git a/rootly_sdk/models/new_alert_field_data_attributes.py b/rootly_sdk/models/new_alert_field_data_attributes.py index 86fe695d..3ca9b928 100644 --- a/rootly_sdk/models/new_alert_field_data_attributes.py +++ b/rootly_sdk/models/new_alert_field_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -18,12 +18,12 @@ class NewAlertFieldDataAttributes: """ name: str - slug: Union[None, Unset, str] = UNSET + slug: None | Unset | str = UNSET def to_dict(self) -> dict[str, Any]: name = self.name - slug: Union[None, Unset, str] + slug: None | Unset | str if isinstance(self.slug, Unset): slug = UNSET else: @@ -46,12 +46,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name") - def _parse_slug(data: object) -> Union[None, Unset, str]: + def _parse_slug(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) slug = _parse_slug(d.pop("slug", UNSET)) diff --git a/rootly_sdk/models/new_alert_group_data_attributes.py b/rootly_sdk/models/new_alert_group_data_attributes.py index 50241211..fbc22242 100644 --- a/rootly_sdk/models/new_alert_group_data_attributes.py +++ b/rootly_sdk/models/new_alert_group_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define @@ -50,26 +50,26 @@ class NewAlertGroupDataAttributes: """ name: str - slug: Union[None, Unset, str] = UNSET - description: Union[None, Unset, str] = UNSET - time_window: Union[Unset, int] = UNSET - targets: Union[Unset, list["NewAlertGroupDataAttributesTargetsItem"]] = UNSET - attributes: Union[Unset, list["NewAlertGroupDataAttributesAttributesItem"]] = UNSET - group_by_alert_title: Union[Unset, NewAlertGroupDataAttributesGroupByAlertTitle] = UNSET - group_by_alert_urgency: Union[Unset, NewAlertGroupDataAttributesGroupByAlertUrgency] = UNSET - condition_type: Union[Unset, NewAlertGroupDataAttributesConditionType] = UNSET - conditions: Union[Unset, list["NewAlertGroupDataAttributesConditionsItem"]] = UNSET + slug: None | Unset | str = UNSET + description: None | Unset | str = UNSET + time_window: Unset | int = UNSET + targets: Unset | list["NewAlertGroupDataAttributesTargetsItem"] = UNSET + attributes: Unset | list["NewAlertGroupDataAttributesAttributesItem"] = UNSET + group_by_alert_title: Unset | NewAlertGroupDataAttributesGroupByAlertTitle = UNSET + group_by_alert_urgency: Unset | NewAlertGroupDataAttributesGroupByAlertUrgency = UNSET + condition_type: Unset | NewAlertGroupDataAttributesConditionType = UNSET + conditions: Unset | list["NewAlertGroupDataAttributesConditionsItem"] = UNSET def to_dict(self) -> dict[str, Any]: name = self.name - slug: Union[None, Unset, str] + slug: None | Unset | str if isinstance(self.slug, Unset): slug = UNSET else: slug = self.slug - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: @@ -77,33 +77,33 @@ def to_dict(self) -> dict[str, Any]: time_window = self.time_window - targets: Union[Unset, list[dict[str, Any]]] = UNSET + targets: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.targets, Unset): targets = [] for targets_item_data in self.targets: targets_item = targets_item_data.to_dict() targets.append(targets_item) - attributes: Union[Unset, list[dict[str, Any]]] = UNSET + attributes: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.attributes, Unset): attributes = [] for attributes_item_data in self.attributes: attributes_item = attributes_item_data.to_dict() attributes.append(attributes_item) - group_by_alert_title: Union[Unset, int] = UNSET + group_by_alert_title: Unset | int = UNSET if not isinstance(self.group_by_alert_title, Unset): group_by_alert_title = self.group_by_alert_title - group_by_alert_urgency: Union[Unset, int] = UNSET + group_by_alert_urgency: Unset | int = UNSET if not isinstance(self.group_by_alert_urgency, Unset): group_by_alert_urgency = self.group_by_alert_urgency - condition_type: Union[Unset, str] = UNSET + condition_type: Unset | str = UNSET if not isinstance(self.condition_type, Unset): condition_type = self.condition_type - conditions: Union[Unset, list[dict[str, Any]]] = UNSET + conditions: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.conditions, Unset): conditions = [] for conditions_item_data in self.conditions: @@ -147,21 +147,21 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name") - def _parse_slug(data: object) -> Union[None, Unset, str]: + def _parse_slug(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) slug = _parse_slug(d.pop("slug", UNSET)) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) @@ -182,14 +182,14 @@ def _parse_description(data: object) -> Union[None, Unset, str]: attributes.append(attributes_item) _group_by_alert_title = d.pop("group_by_alert_title", UNSET) - group_by_alert_title: Union[Unset, NewAlertGroupDataAttributesGroupByAlertTitle] + group_by_alert_title: Unset | NewAlertGroupDataAttributesGroupByAlertTitle if isinstance(_group_by_alert_title, Unset): group_by_alert_title = UNSET else: group_by_alert_title = check_new_alert_group_data_attributes_group_by_alert_title(_group_by_alert_title) _group_by_alert_urgency = d.pop("group_by_alert_urgency", UNSET) - group_by_alert_urgency: Union[Unset, NewAlertGroupDataAttributesGroupByAlertUrgency] + group_by_alert_urgency: Unset | NewAlertGroupDataAttributesGroupByAlertUrgency if isinstance(_group_by_alert_urgency, Unset): group_by_alert_urgency = UNSET else: @@ -198,7 +198,7 @@ def _parse_description(data: object) -> Union[None, Unset, str]: ) _condition_type = d.pop("condition_type", UNSET) - condition_type: Union[Unset, NewAlertGroupDataAttributesConditionType] + condition_type: Unset | NewAlertGroupDataAttributesConditionType if isinstance(_condition_type, Unset): condition_type = UNSET else: diff --git a/rootly_sdk/models/new_alert_group_data_attributes_attributes_item.py b/rootly_sdk/models/new_alert_group_data_attributes_attributes_item.py index f5f8d58b..7137d960 100644 --- a/rootly_sdk/models/new_alert_group_data_attributes_attributes_item.py +++ b/rootly_sdk/models/new_alert_group_data_attributes_attributes_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,7 +16,7 @@ class NewAlertGroupDataAttributesAttributesItem: json_path (Union[Unset, str]): The JSON path to the value to group by. """ - json_path: Union[Unset, str] = UNSET + json_path: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/new_alert_group_data_attributes_conditions_item.py b/rootly_sdk/models/new_alert_group_data_attributes_conditions_item.py index 8bc32b4a..bc64e1f2 100644 --- a/rootly_sdk/models/new_alert_group_data_attributes_conditions_item.py +++ b/rootly_sdk/models/new_alert_group_data_attributes_conditions_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -48,12 +48,12 @@ class NewAlertGroupDataAttributesConditionsItem: property_field_type: NewAlertGroupDataAttributesConditionsItemPropertyFieldType property_field_condition_type: NewAlertGroupDataAttributesConditionsItemPropertyFieldConditionType - property_field_name: Union[Unset, str] = UNSET - property_field_value: Union[Unset, str] = UNSET - property_field_values: Union[Unset, list[str]] = UNSET - alert_urgency_ids: Union[None, Unset, list[str]] = UNSET - conditionable_type: Union[Unset, NewAlertGroupDataAttributesConditionsItemConditionableType] = UNSET - conditionable_id: Union[Unset, str] = UNSET + property_field_name: Unset | str = UNSET + property_field_value: Unset | str = UNSET + property_field_values: Unset | list[str] = UNSET + alert_urgency_ids: None | Unset | list[str] = UNSET + conditionable_type: Unset | NewAlertGroupDataAttributesConditionsItemConditionableType = UNSET + conditionable_id: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -65,11 +65,11 @@ def to_dict(self) -> dict[str, Any]: property_field_value = self.property_field_value - property_field_values: Union[Unset, list[str]] = UNSET + property_field_values: Unset | list[str] = UNSET if not isinstance(self.property_field_values, Unset): property_field_values = self.property_field_values - alert_urgency_ids: Union[None, Unset, list[str]] + alert_urgency_ids: None | Unset | list[str] if isinstance(self.alert_urgency_ids, Unset): alert_urgency_ids = UNSET elif isinstance(self.alert_urgency_ids, list): @@ -78,7 +78,7 @@ def to_dict(self) -> dict[str, Any]: else: alert_urgency_ids = self.alert_urgency_ids - conditionable_type: Union[Unset, str] = UNSET + conditionable_type: Unset | str = UNSET if not isinstance(self.conditionable_type, Unset): conditionable_type = self.conditionable_type @@ -126,7 +126,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: property_field_values = cast(list[str], d.pop("property_field_values", UNSET)) - def _parse_alert_urgency_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_alert_urgency_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -139,12 +139,12 @@ def _parse_alert_urgency_ids(data: object) -> Union[None, Unset, list[str]]: return alert_urgency_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) alert_urgency_ids = _parse_alert_urgency_ids(d.pop("alert_urgency_ids", UNSET)) _conditionable_type = d.pop("conditionable_type", UNSET) - conditionable_type: Union[Unset, NewAlertGroupDataAttributesConditionsItemConditionableType] + conditionable_type: Unset | NewAlertGroupDataAttributesConditionsItemConditionableType if isinstance(_conditionable_type, Unset): conditionable_type = UNSET else: diff --git a/rootly_sdk/models/new_alert_retrigger_rule_data_attributes.py b/rootly_sdk/models/new_alert_retrigger_rule_data_attributes.py index 886274a7..1711e7d1 100644 --- a/rootly_sdk/models/new_alert_retrigger_rule_data_attributes.py +++ b/rootly_sdk/models/new_alert_retrigger_rule_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define @@ -38,25 +38,25 @@ class NewAlertRetriggerRuleDataAttributes: """ name: str - match_mode: Union[Unset, NewAlertRetriggerRuleDataAttributesMatchMode] = UNSET - timeout_minutes: Union[Unset, NewAlertRetriggerRuleDataAttributesTimeoutMinutes] = UNSET - position: Union[Unset, int] = UNSET - conditions: Union[Unset, list["NewAlertRetriggerRuleDataAttributesConditionsItem"]] = UNSET + match_mode: Unset | NewAlertRetriggerRuleDataAttributesMatchMode = UNSET + timeout_minutes: Unset | NewAlertRetriggerRuleDataAttributesTimeoutMinutes = UNSET + position: Unset | int = UNSET + conditions: Unset | list["NewAlertRetriggerRuleDataAttributesConditionsItem"] = UNSET def to_dict(self) -> dict[str, Any]: name = self.name - match_mode: Union[Unset, str] = UNSET + match_mode: Unset | str = UNSET if not isinstance(self.match_mode, Unset): match_mode = self.match_mode - timeout_minutes: Union[Unset, int] = UNSET + timeout_minutes: Unset | int = UNSET if not isinstance(self.timeout_minutes, Unset): timeout_minutes = self.timeout_minutes position = self.position - conditions: Union[Unset, list[dict[str, Any]]] = UNSET + conditions: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.conditions, Unset): conditions = [] for conditions_item_data in self.conditions: @@ -91,14 +91,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name = d.pop("name") _match_mode = d.pop("match_mode", UNSET) - match_mode: Union[Unset, NewAlertRetriggerRuleDataAttributesMatchMode] + match_mode: Unset | NewAlertRetriggerRuleDataAttributesMatchMode if isinstance(_match_mode, Unset): match_mode = UNSET else: match_mode = check_new_alert_retrigger_rule_data_attributes_match_mode(_match_mode) _timeout_minutes = d.pop("timeout_minutes", UNSET) - timeout_minutes: Union[Unset, NewAlertRetriggerRuleDataAttributesTimeoutMinutes] + timeout_minutes: Unset | NewAlertRetriggerRuleDataAttributesTimeoutMinutes if isinstance(_timeout_minutes, Unset): timeout_minutes = UNSET else: diff --git a/rootly_sdk/models/new_alert_retrigger_rule_data_attributes_conditions_item.py b/rootly_sdk/models/new_alert_retrigger_rule_data_attributes_conditions_item.py index 41d09961..ebf1e048 100644 --- a/rootly_sdk/models/new_alert_retrigger_rule_data_attributes_conditions_item.py +++ b/rootly_sdk/models/new_alert_retrigger_rule_data_attributes_conditions_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from uuid import UUID from attrs import define as _attrs_define @@ -37,9 +37,9 @@ class NewAlertRetriggerRuleDataAttributesConditionsItem: kind: NewAlertRetriggerRuleDataAttributesConditionsItemKind operator: NewAlertRetriggerRuleDataAttributesConditionsItemOperator - record_ids: Union[Unset, list[UUID]] = UNSET - values: Union[Unset, list[str]] = UNSET - property_field_name: Union[Unset, str] = UNSET + record_ids: Unset | list[UUID] = UNSET + values: Unset | list[str] = UNSET + property_field_name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -47,14 +47,14 @@ def to_dict(self) -> dict[str, Any]: operator: str = self.operator - record_ids: Union[Unset, list[str]] = UNSET + record_ids: Unset | list[str] = UNSET if not isinstance(self.record_ids, Unset): record_ids = [] for record_ids_item_data in self.record_ids: record_ids_item = str(record_ids_item_data) record_ids.append(record_ids_item) - values: Union[Unset, list[str]] = UNSET + values: Unset | list[str] = UNSET if not isinstance(self.values, Unset): values = self.values diff --git a/rootly_sdk/models/new_alert_route.py b/rootly_sdk/models/new_alert_route.py index 19ca824c..44053e1b 100644 --- a/rootly_sdk/models/new_alert_route.py +++ b/rootly_sdk/models/new_alert_route.py @@ -24,7 +24,7 @@ class NewAlertRoute: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data: Union[Unset, dict[str, Any]] = UNSET + data: Unset | dict[str, Any] = UNSET if not isinstance(self.data, Unset): data = self.data.to_dict() @@ -42,7 +42,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _data = d.pop("data", UNSET) - data: Union[Unset, NewAlertRouteData] + data: Unset | NewAlertRouteData if isinstance(_data, Unset): data = UNSET else: diff --git a/rootly_sdk/models/new_alert_route_data.py b/rootly_sdk/models/new_alert_route_data.py index e871ca08..8f32aa22 100644 --- a/rootly_sdk/models/new_alert_route_data.py +++ b/rootly_sdk/models/new_alert_route_data.py @@ -22,16 +22,16 @@ class NewAlertRouteData: attributes (Union[Unset, NewAlertRouteDataAttributes]): """ - type_: Union[Unset, NewAlertRouteDataType] = UNSET + type_: Unset | NewAlertRouteDataType = UNSET attributes: Union[Unset, "NewAlertRouteDataAttributes"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: Union[Unset, str] = UNSET + type_: Unset | str = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ - attributes: Union[Unset, dict[str, Any]] = UNSET + attributes: Unset | dict[str, Any] = UNSET if not isinstance(self.attributes, Unset): attributes = self.attributes.to_dict() @@ -51,14 +51,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _type_ = d.pop("type", UNSET) - type_: Union[Unset, NewAlertRouteDataType] + type_: Unset | NewAlertRouteDataType if isinstance(_type_, Unset): type_ = UNSET else: type_ = check_new_alert_route_data_type(_type_) _attributes = d.pop("attributes", UNSET) - attributes: Union[Unset, NewAlertRouteDataAttributes] + attributes: Unset | NewAlertRouteDataAttributes if isinstance(_attributes, Unset): attributes = UNSET else: diff --git a/rootly_sdk/models/new_alert_route_data_attributes.py b/rootly_sdk/models/new_alert_route_data_attributes.py index d5d7ffc1..6f14fe06 100644 --- a/rootly_sdk/models/new_alert_route_data_attributes.py +++ b/rootly_sdk/models/new_alert_route_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from uuid import UUID from attrs import define as _attrs_define @@ -27,9 +27,9 @@ class NewAlertRouteDataAttributes: name: str alerts_source_ids: list[UUID] - enabled: Union[Unset, bool] = UNSET - owning_team_ids: Union[Unset, list[UUID]] = UNSET - rules: Union[Unset, list["NewAlertRouteDataAttributesRulesItem"]] = UNSET + enabled: Unset | bool = UNSET + owning_team_ids: Unset | list[UUID] = UNSET + rules: Unset | list["NewAlertRouteDataAttributesRulesItem"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,14 +42,14 @@ def to_dict(self) -> dict[str, Any]: enabled = self.enabled - owning_team_ids: Union[Unset, list[str]] = UNSET + owning_team_ids: Unset | list[str] = UNSET if not isinstance(self.owning_team_ids, Unset): owning_team_ids = [] for owning_team_ids_item_data in self.owning_team_ids: owning_team_ids_item = str(owning_team_ids_item_data) owning_team_ids.append(owning_team_ids_item) - rules: Union[Unset, list[dict[str, Any]]] = UNSET + rules: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.rules, Unset): rules = [] for rules_item_data in self.rules: diff --git a/rootly_sdk/models/new_alert_route_data_attributes_rules_item.py b/rootly_sdk/models/new_alert_route_data_attributes_rules_item.py index 3d9ca0fa..ccc3722c 100644 --- a/rootly_sdk/models/new_alert_route_data_attributes_rules_item.py +++ b/rootly_sdk/models/new_alert_route_data_attributes_rules_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -32,8 +32,8 @@ class NewAlertRouteDataAttributesRulesItem: name: str destinations: list["NewAlertRouteDataAttributesRulesItemDestinationsItem"] condition_groups: list["NewAlertRouteDataAttributesRulesItemConditionGroupsItem"] - position: Union[Unset, int] = UNSET - fallback_rule: Union[Unset, bool] = False + position: Unset | int = UNSET + fallback_rule: Unset | bool = False additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/new_alert_route_data_attributes_rules_item_condition_groups_item.py b/rootly_sdk/models/new_alert_route_data_attributes_rules_item_condition_groups_item.py index dfeb1d5f..68d9d2c3 100644 --- a/rootly_sdk/models/new_alert_route_data_attributes_rules_item_condition_groups_item.py +++ b/rootly_sdk/models/new_alert_route_data_attributes_rules_item_condition_groups_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -24,7 +24,7 @@ class NewAlertRouteDataAttributesRulesItemConditionGroupsItem: """ conditions: list["NewAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItem"] - position: Union[Unset, int] = UNSET + position: Unset | int = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/new_alert_route_data_attributes_rules_item_condition_groups_item_conditions_item.py b/rootly_sdk/models/new_alert_route_data_attributes_rules_item_condition_groups_item_conditions_item.py index 919e1392..76514557 100644 --- a/rootly_sdk/models/new_alert_route_data_attributes_rules_item_condition_groups_item_conditions_item.py +++ b/rootly_sdk/models/new_alert_route_data_attributes_rules_item_condition_groups_item_conditions_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from uuid import UUID from attrs import define as _attrs_define @@ -43,14 +43,14 @@ class NewAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItem: NewAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemPropertyFieldConditionType ) property_field_type: NewAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemPropertyFieldType - property_field_name: Union[Unset, str] = UNSET - property_field_value: Union[None, Unset, str] = UNSET - property_field_values: Union[None, Unset, list[str]] = UNSET - alert_urgency_ids: Union[None, Unset, list[str]] = UNSET - conditionable_type: Union[ - Unset, NewAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemConditionableType - ] = UNSET - conditionable_id: Union[None, UUID, Unset] = UNSET + property_field_name: Unset | str = UNSET + property_field_value: None | Unset | str = UNSET + property_field_values: None | Unset | list[str] = UNSET + alert_urgency_ids: None | Unset | list[str] = UNSET + conditionable_type: ( + Unset | NewAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemConditionableType + ) = UNSET + conditionable_id: None | UUID | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -60,13 +60,13 @@ def to_dict(self) -> dict[str, Any]: property_field_name = self.property_field_name - property_field_value: Union[None, Unset, str] + property_field_value: None | Unset | str if isinstance(self.property_field_value, Unset): property_field_value = UNSET else: property_field_value = self.property_field_value - property_field_values: Union[None, Unset, list[str]] + property_field_values: None | Unset | list[str] if isinstance(self.property_field_values, Unset): property_field_values = UNSET elif isinstance(self.property_field_values, list): @@ -75,7 +75,7 @@ def to_dict(self) -> dict[str, Any]: else: property_field_values = self.property_field_values - alert_urgency_ids: Union[None, Unset, list[str]] + alert_urgency_ids: None | Unset | list[str] if isinstance(self.alert_urgency_ids, Unset): alert_urgency_ids = UNSET elif isinstance(self.alert_urgency_ids, list): @@ -84,11 +84,11 @@ def to_dict(self) -> dict[str, Any]: else: alert_urgency_ids = self.alert_urgency_ids - conditionable_type: Union[Unset, str] = UNSET + conditionable_type: Unset | str = UNSET if not isinstance(self.conditionable_type, Unset): conditionable_type = self.conditionable_type - conditionable_id: Union[None, Unset, str] + conditionable_id: None | Unset | str if isinstance(self.conditionable_id, Unset): conditionable_id = UNSET elif isinstance(self.conditionable_id, UUID): @@ -134,16 +134,16 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: property_field_name = d.pop("property_field_name", UNSET) - def _parse_property_field_value(data: object) -> Union[None, Unset, str]: + def _parse_property_field_value(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) property_field_value = _parse_property_field_value(d.pop("property_field_value", UNSET)) - def _parse_property_field_values(data: object) -> Union[None, Unset, list[str]]: + def _parse_property_field_values(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -156,11 +156,11 @@ def _parse_property_field_values(data: object) -> Union[None, Unset, list[str]]: return property_field_values_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) property_field_values = _parse_property_field_values(d.pop("property_field_values", UNSET)) - def _parse_alert_urgency_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_alert_urgency_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -173,14 +173,14 @@ def _parse_alert_urgency_ids(data: object) -> Union[None, Unset, list[str]]: return alert_urgency_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) alert_urgency_ids = _parse_alert_urgency_ids(d.pop("alert_urgency_ids", UNSET)) _conditionable_type = d.pop("conditionable_type", UNSET) - conditionable_type: Union[ - Unset, NewAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemConditionableType - ] + conditionable_type: ( + Unset | NewAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemConditionableType + ) if isinstance(_conditionable_type, Unset): conditionable_type = UNSET else: @@ -188,7 +188,7 @@ def _parse_alert_urgency_ids(data: object) -> Union[None, Unset, list[str]]: _conditionable_type ) - def _parse_conditionable_id(data: object) -> Union[None, UUID, Unset]: + def _parse_conditionable_id(data: object) -> None | UUID | Unset: if data is None: return data if isinstance(data, Unset): @@ -201,7 +201,7 @@ def _parse_conditionable_id(data: object) -> Union[None, UUID, Unset]: return conditionable_id_type_0 except: # noqa: E722 pass - return cast(Union[None, UUID, Unset], data) + return cast(None | UUID | Unset, data) conditionable_id = _parse_conditionable_id(d.pop("conditionable_id", UNSET)) diff --git a/rootly_sdk/models/new_alert_routing_rule_data_attributes.py b/rootly_sdk/models/new_alert_routing_rule_data_attributes.py index 68978b08..e6198f3d 100644 --- a/rootly_sdk/models/new_alert_routing_rule_data_attributes.py +++ b/rootly_sdk/models/new_alert_routing_rule_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from uuid import UUID from attrs import define as _attrs_define @@ -40,11 +40,11 @@ class NewAlertRoutingRuleDataAttributes: name: str alerts_source_id: UUID destination: "NewAlertRoutingRuleDataAttributesDestination" - enabled: Union[Unset, bool] = UNSET - owning_team_ids: Union[Unset, list[UUID]] = UNSET - position: Union[Unset, int] = UNSET - condition_type: Union[Unset, NewAlertRoutingRuleDataAttributesConditionType] = UNSET - conditions: Union[Unset, list["NewAlertRoutingRuleDataAttributesConditionsItem"]] = UNSET + enabled: Unset | bool = UNSET + owning_team_ids: Unset | list[UUID] = UNSET + position: Unset | int = UNSET + condition_type: Unset | NewAlertRoutingRuleDataAttributesConditionType = UNSET + conditions: Unset | list["NewAlertRoutingRuleDataAttributesConditionsItem"] = UNSET def to_dict(self) -> dict[str, Any]: name = self.name @@ -55,7 +55,7 @@ def to_dict(self) -> dict[str, Any]: enabled = self.enabled - owning_team_ids: Union[Unset, list[str]] = UNSET + owning_team_ids: Unset | list[str] = UNSET if not isinstance(self.owning_team_ids, Unset): owning_team_ids = [] for owning_team_ids_item_data in self.owning_team_ids: @@ -64,11 +64,11 @@ def to_dict(self) -> dict[str, Any]: position = self.position - condition_type: Union[Unset, str] = UNSET + condition_type: Unset | str = UNSET if not isinstance(self.condition_type, Unset): condition_type = self.condition_type - conditions: Union[Unset, list[dict[str, Any]]] = UNSET + conditions: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.conditions, Unset): conditions = [] for conditions_item_data in self.conditions: @@ -125,7 +125,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: position = d.pop("position", UNSET) _condition_type = d.pop("condition_type", UNSET) - condition_type: Union[Unset, NewAlertRoutingRuleDataAttributesConditionType] + condition_type: Unset | NewAlertRoutingRuleDataAttributesConditionType if isinstance(_condition_type, Unset): condition_type = UNSET else: diff --git a/rootly_sdk/models/new_alert_routing_rule_data_attributes_conditions_item.py b/rootly_sdk/models/new_alert_routing_rule_data_attributes_conditions_item.py index f91fa1c5..2ec23593 100644 --- a/rootly_sdk/models/new_alert_routing_rule_data_attributes_conditions_item.py +++ b/rootly_sdk/models/new_alert_routing_rule_data_attributes_conditions_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -39,8 +39,8 @@ class NewAlertRoutingRuleDataAttributesConditionsItem: property_field_type: NewAlertRoutingRuleDataAttributesConditionsItemPropertyFieldType property_field_name: str property_field_condition_type: NewAlertRoutingRuleDataAttributesConditionsItemPropertyFieldConditionType - property_field_value: Union[Unset, str] = UNSET - property_field_values: Union[Unset, list[str]] = UNSET + property_field_value: Unset | str = UNSET + property_field_values: Unset | list[str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -52,7 +52,7 @@ def to_dict(self) -> dict[str, Any]: property_field_value = self.property_field_value - property_field_values: Union[Unset, list[str]] = UNSET + property_field_values: Unset | list[str] = UNSET if not isinstance(self.property_field_values, Unset): property_field_values = self.property_field_values diff --git a/rootly_sdk/models/new_alert_urgency_data_attributes.py b/rootly_sdk/models/new_alert_urgency_data_attributes.py index acf399da..6ec17750 100644 --- a/rootly_sdk/models/new_alert_urgency_data_attributes.py +++ b/rootly_sdk/models/new_alert_urgency_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -21,21 +21,21 @@ class NewAlertUrgencyDataAttributes: name: str description: str - position: Union[None, Unset, int] = UNSET - retrigger_timeout_minutes: Union[None, Unset, int] = UNSET + position: None | Unset | int = UNSET + retrigger_timeout_minutes: None | Unset | int = UNSET def to_dict(self) -> dict[str, Any]: name = self.name description = self.description - position: Union[None, Unset, int] + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: position = self.position - retrigger_timeout_minutes: Union[None, Unset, int] + retrigger_timeout_minutes: None | Unset | int if isinstance(self.retrigger_timeout_minutes, Unset): retrigger_timeout_minutes = UNSET else: @@ -63,21 +63,21 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: description = d.pop("description") - def _parse_position(data: object) -> Union[None, Unset, int]: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) - def _parse_retrigger_timeout_minutes(data: object) -> Union[None, Unset, int]: + def _parse_retrigger_timeout_minutes(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) retrigger_timeout_minutes = _parse_retrigger_timeout_minutes(d.pop("retrigger_timeout_minutes", UNSET)) diff --git a/rootly_sdk/models/new_alerts_source_data_attributes.py b/rootly_sdk/models/new_alerts_source_data_attributes.py index 12be6991..18dec5e7 100644 --- a/rootly_sdk/models/new_alerts_source_data_attributes.py +++ b/rootly_sdk/models/new_alerts_source_data_attributes.py @@ -68,23 +68,21 @@ class NewAlertsSourceDataAttributes: """ name: str - enabled: Union[Unset, bool] = UNSET - source_type: Union[Unset, NewAlertsSourceDataAttributesSourceType] = UNSET - alert_urgency_id: Union[Unset, str] = UNSET - deduplicate_alerts_by_key: Union[Unset, bool] = UNSET - deduplication_key_kind: Union[Unset, NewAlertsSourceDataAttributesDeduplicationKeyKind] = UNSET - deduplication_key_path: Union[None, Unset, str] = UNSET - deduplication_key_regexp: Union[None, Unset, str] = UNSET - owner_group_ids: Union[Unset, list[str]] = UNSET + enabled: Unset | bool = UNSET + source_type: Unset | NewAlertsSourceDataAttributesSourceType = UNSET + alert_urgency_id: Unset | str = UNSET + deduplicate_alerts_by_key: Unset | bool = UNSET + deduplication_key_kind: Unset | NewAlertsSourceDataAttributesDeduplicationKeyKind = UNSET + deduplication_key_path: None | Unset | str = UNSET + deduplication_key_regexp: None | Unset | str = UNSET + owner_group_ids: Unset | list[str] = UNSET alert_template_attributes: Union["NewAlertsSourceDataAttributesAlertTemplateAttributesType0", None, Unset] = UNSET - alert_source_urgency_rules_attributes: Union[ - Unset, list["NewAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItem"] - ] = UNSET + alert_source_urgency_rules_attributes: ( + Unset | list["NewAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItem"] + ) = UNSET sourceable_attributes: Union["NewAlertsSourceDataAttributesSourceableAttributesType0", None, Unset] = UNSET resolution_rule_attributes: Union["NewAlertsSourceDataAttributesResolutionRuleAttributesType0", None, Unset] = UNSET - alert_source_fields_attributes: Union[ - Unset, list["NewAlertsSourceDataAttributesAlertSourceFieldsAttributesItem"] - ] = UNSET + alert_source_fields_attributes: Unset | list["NewAlertsSourceDataAttributesAlertSourceFieldsAttributesItem"] = UNSET def to_dict(self) -> dict[str, Any]: from ..models.new_alerts_source_data_attributes_alert_template_attributes_type_0 import ( @@ -101,7 +99,7 @@ def to_dict(self) -> dict[str, Any]: enabled = self.enabled - source_type: Union[Unset, str] = UNSET + source_type: Unset | str = UNSET if not isinstance(self.source_type, Unset): source_type = self.source_type @@ -109,27 +107,27 @@ def to_dict(self) -> dict[str, Any]: deduplicate_alerts_by_key = self.deduplicate_alerts_by_key - deduplication_key_kind: Union[Unset, str] = UNSET + deduplication_key_kind: Unset | str = UNSET if not isinstance(self.deduplication_key_kind, Unset): deduplication_key_kind = self.deduplication_key_kind - deduplication_key_path: Union[None, Unset, str] + deduplication_key_path: None | Unset | str if isinstance(self.deduplication_key_path, Unset): deduplication_key_path = UNSET else: deduplication_key_path = self.deduplication_key_path - deduplication_key_regexp: Union[None, Unset, str] + deduplication_key_regexp: None | Unset | str if isinstance(self.deduplication_key_regexp, Unset): deduplication_key_regexp = UNSET else: deduplication_key_regexp = self.deduplication_key_regexp - owner_group_ids: Union[Unset, list[str]] = UNSET + owner_group_ids: Unset | list[str] = UNSET if not isinstance(self.owner_group_ids, Unset): owner_group_ids = self.owner_group_ids - alert_template_attributes: Union[None, Unset, dict[str, Any]] + alert_template_attributes: None | Unset | dict[str, Any] if isinstance(self.alert_template_attributes, Unset): alert_template_attributes = UNSET elif isinstance(self.alert_template_attributes, NewAlertsSourceDataAttributesAlertTemplateAttributesType0): @@ -137,14 +135,14 @@ def to_dict(self) -> dict[str, Any]: else: alert_template_attributes = self.alert_template_attributes - alert_source_urgency_rules_attributes: Union[Unset, list[dict[str, Any]]] = UNSET + alert_source_urgency_rules_attributes: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.alert_source_urgency_rules_attributes, Unset): alert_source_urgency_rules_attributes = [] for alert_source_urgency_rules_attributes_item_data in self.alert_source_urgency_rules_attributes: alert_source_urgency_rules_attributes_item = alert_source_urgency_rules_attributes_item_data.to_dict() alert_source_urgency_rules_attributes.append(alert_source_urgency_rules_attributes_item) - sourceable_attributes: Union[None, Unset, dict[str, Any]] + sourceable_attributes: None | Unset | dict[str, Any] if isinstance(self.sourceable_attributes, Unset): sourceable_attributes = UNSET elif isinstance(self.sourceable_attributes, NewAlertsSourceDataAttributesSourceableAttributesType0): @@ -152,7 +150,7 @@ def to_dict(self) -> dict[str, Any]: else: sourceable_attributes = self.sourceable_attributes - resolution_rule_attributes: Union[None, Unset, dict[str, Any]] + resolution_rule_attributes: None | Unset | dict[str, Any] if isinstance(self.resolution_rule_attributes, Unset): resolution_rule_attributes = UNSET elif isinstance(self.resolution_rule_attributes, NewAlertsSourceDataAttributesResolutionRuleAttributesType0): @@ -160,7 +158,7 @@ def to_dict(self) -> dict[str, Any]: else: resolution_rule_attributes = self.resolution_rule_attributes - alert_source_fields_attributes: Union[Unset, list[dict[str, Any]]] = UNSET + alert_source_fields_attributes: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.alert_source_fields_attributes, Unset): alert_source_fields_attributes = [] for alert_source_fields_attributes_item_data in self.alert_source_fields_attributes: @@ -227,7 +225,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: enabled = d.pop("enabled", UNSET) _source_type = d.pop("source_type", UNSET) - source_type: Union[Unset, NewAlertsSourceDataAttributesSourceType] + source_type: Unset | NewAlertsSourceDataAttributesSourceType if isinstance(_source_type, Unset): source_type = UNSET else: @@ -238,7 +236,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: deduplicate_alerts_by_key = d.pop("deduplicate_alerts_by_key", UNSET) _deduplication_key_kind = d.pop("deduplication_key_kind", UNSET) - deduplication_key_kind: Union[Unset, NewAlertsSourceDataAttributesDeduplicationKeyKind] + deduplication_key_kind: Unset | NewAlertsSourceDataAttributesDeduplicationKeyKind if isinstance(_deduplication_key_kind, Unset): deduplication_key_kind = UNSET else: @@ -246,21 +244,21 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: _deduplication_key_kind ) - def _parse_deduplication_key_path(data: object) -> Union[None, Unset, str]: + def _parse_deduplication_key_path(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) deduplication_key_path = _parse_deduplication_key_path(d.pop("deduplication_key_path", UNSET)) - def _parse_deduplication_key_regexp(data: object) -> Union[None, Unset, str]: + def _parse_deduplication_key_regexp(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) deduplication_key_regexp = _parse_deduplication_key_regexp(d.pop("deduplication_key_regexp", UNSET)) diff --git a/rootly_sdk/models/new_alerts_source_data_attributes_alert_source_fields_attributes_item.py b/rootly_sdk/models/new_alerts_source_data_attributes_alert_source_fields_attributes_item.py index ebf68c2b..9604cf22 100644 --- a/rootly_sdk/models/new_alerts_source_data_attributes_alert_source_fields_attributes_item.py +++ b/rootly_sdk/models/new_alerts_source_data_attributes_alert_source_fields_attributes_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -18,14 +18,14 @@ class NewAlertsSourceDataAttributesAlertSourceFieldsAttributesItem: for evaluation """ - alert_field_id: Union[Unset, str] = UNSET - template_body: Union[None, Unset, str] = UNSET + alert_field_id: Unset | str = UNSET + template_body: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: alert_field_id = self.alert_field_id - template_body: Union[None, Unset, str] + template_body: None | Unset | str if isinstance(self.template_body, Unset): template_body = UNSET else: @@ -46,12 +46,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) alert_field_id = d.pop("alert_field_id", UNSET) - def _parse_template_body(data: object) -> Union[None, Unset, str]: + def _parse_template_body(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) template_body = _parse_template_body(d.pop("template_body", UNSET)) diff --git a/rootly_sdk/models/new_alerts_source_data_attributes_alert_source_urgency_rules_attributes_item.py b/rootly_sdk/models/new_alerts_source_data_attributes_alert_source_urgency_rules_attributes_item.py index 761b4fe4..936d25df 100644 --- a/rootly_sdk/models/new_alerts_source_data_attributes_alert_source_urgency_rules_attributes_item.py +++ b/rootly_sdk/models/new_alerts_source_data_attributes_alert_source_urgency_rules_attributes_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -41,41 +41,41 @@ class NewAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItem: alert_urgency_id (Union[Unset, str]): The ID of the alert urgency """ - json_path: Union[None, Unset, str] = UNSET - operator: Union[Unset, NewAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemOperator] = UNSET - value: Union[Unset, str] = UNSET - conditionable_type: Union[ - Unset, NewAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemConditionableType - ] = UNSET - conditionable_id: Union[None, Unset, str] = UNSET - kind: Union[Unset, NewAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemKind] = UNSET - alert_urgency_id: Union[Unset, str] = UNSET + json_path: None | Unset | str = UNSET + operator: Unset | NewAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemOperator = UNSET + value: Unset | str = UNSET + conditionable_type: Unset | NewAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemConditionableType = ( + UNSET + ) + conditionable_id: None | Unset | str = UNSET + kind: Unset | NewAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemKind = UNSET + alert_urgency_id: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - json_path: Union[None, Unset, str] + json_path: None | Unset | str if isinstance(self.json_path, Unset): json_path = UNSET else: json_path = self.json_path - operator: Union[Unset, str] = UNSET + operator: Unset | str = UNSET if not isinstance(self.operator, Unset): operator = self.operator value = self.value - conditionable_type: Union[Unset, str] = UNSET + conditionable_type: Unset | str = UNSET if not isinstance(self.conditionable_type, Unset): conditionable_type = self.conditionable_type - conditionable_id: Union[None, Unset, str] + conditionable_id: None | Unset | str if isinstance(self.conditionable_id, Unset): conditionable_id = UNSET else: conditionable_id = self.conditionable_id - kind: Union[Unset, str] = UNSET + kind: Unset | str = UNSET if not isinstance(self.kind, Unset): kind = self.kind @@ -105,17 +105,17 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_json_path(data: object) -> Union[None, Unset, str]: + def _parse_json_path(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) json_path = _parse_json_path(d.pop("json_path", UNSET)) _operator = d.pop("operator", UNSET) - operator: Union[Unset, NewAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemOperator] + operator: Unset | NewAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemOperator if isinstance(_operator, Unset): operator = UNSET else: @@ -126,9 +126,7 @@ def _parse_json_path(data: object) -> Union[None, Unset, str]: value = d.pop("value", UNSET) _conditionable_type = d.pop("conditionable_type", UNSET) - conditionable_type: Union[ - Unset, NewAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemConditionableType - ] + conditionable_type: Unset | NewAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemConditionableType if isinstance(_conditionable_type, Unset): conditionable_type = UNSET else: @@ -138,17 +136,17 @@ def _parse_json_path(data: object) -> Union[None, Unset, str]: ) ) - def _parse_conditionable_id(data: object) -> Union[None, Unset, str]: + def _parse_conditionable_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) conditionable_id = _parse_conditionable_id(d.pop("conditionable_id", UNSET)) _kind = d.pop("kind", UNSET) - kind: Union[Unset, NewAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemKind] + kind: Unset | NewAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemKind if isinstance(_kind, Unset): kind = UNSET else: diff --git a/rootly_sdk/models/new_alerts_source_data_attributes_alert_template_attributes_type_0.py b/rootly_sdk/models/new_alerts_source_data_attributes_alert_template_attributes_type_0.py index 84b8f1f6..f4593a89 100644 --- a/rootly_sdk/models/new_alerts_source_data_attributes_alert_template_attributes_type_0.py +++ b/rootly_sdk/models/new_alerts_source_data_attributes_alert_template_attributes_type_0.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -18,25 +18,25 @@ class NewAlertsSourceDataAttributesAlertTemplateAttributesType0: external_url (Union[None, Unset, str]): The alert URL. """ - title: Union[None, Unset, str] = UNSET - description: Union[None, Unset, str] = UNSET - external_url: Union[None, Unset, str] = UNSET + title: None | Unset | str = UNSET + description: None | Unset | str = UNSET + external_url: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - title: Union[None, Unset, str] + title: None | Unset | str if isinstance(self.title, Unset): title = UNSET else: title = self.title - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - external_url: Union[None, Unset, str] + external_url: None | Unset | str if isinstance(self.external_url, Unset): external_url = UNSET else: @@ -58,30 +58,30 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_title(data: object) -> Union[None, Unset, str]: + def _parse_title(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) title = _parse_title(d.pop("title", UNSET)) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_external_url(data: object) -> Union[None, Unset, str]: + def _parse_external_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) external_url = _parse_external_url(d.pop("external_url", UNSET)) diff --git a/rootly_sdk/models/new_alerts_source_data_attributes_resolution_rule_attributes_type_0.py b/rootly_sdk/models/new_alerts_source_data_attributes_resolution_rule_attributes_type_0.py index e16dba6a..534a697e 100644 --- a/rootly_sdk/models/new_alerts_source_data_attributes_resolution_rule_attributes_type_0.py +++ b/rootly_sdk/models/new_alerts_source_data_attributes_resolution_rule_attributes_type_0.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -52,56 +52,56 @@ class NewAlertsSourceDataAttributesResolutionRuleAttributesType0: to evaluate for auto resolution """ - enabled: Union[Unset, bool] = UNSET - condition_type: Union[Unset, NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionType] = UNSET - identifier_matchable_type: Union[ - Unset, NewAlertsSourceDataAttributesResolutionRuleAttributesType0IdentifierMatchableType - ] = UNSET - identifier_matchable_id: Union[None, Unset, str] = UNSET - identifier_reference_kind: Union[ - Unset, NewAlertsSourceDataAttributesResolutionRuleAttributesType0IdentifierReferenceKind - ] = UNSET - identifier_json_path: Union[None, Unset, str] = UNSET - identifier_value_regex: Union[None, Unset, str] = UNSET - conditions_attributes: Union[ - Unset, list["NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItem"] - ] = UNSET + enabled: Unset | bool = UNSET + condition_type: Unset | NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionType = UNSET + identifier_matchable_type: ( + Unset | NewAlertsSourceDataAttributesResolutionRuleAttributesType0IdentifierMatchableType + ) = UNSET + identifier_matchable_id: None | Unset | str = UNSET + identifier_reference_kind: ( + Unset | NewAlertsSourceDataAttributesResolutionRuleAttributesType0IdentifierReferenceKind + ) = UNSET + identifier_json_path: None | Unset | str = UNSET + identifier_value_regex: None | Unset | str = UNSET + conditions_attributes: ( + Unset | list["NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItem"] + ) = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: enabled = self.enabled - condition_type: Union[Unset, str] = UNSET + condition_type: Unset | str = UNSET if not isinstance(self.condition_type, Unset): condition_type = self.condition_type - identifier_matchable_type: Union[Unset, str] = UNSET + identifier_matchable_type: Unset | str = UNSET if not isinstance(self.identifier_matchable_type, Unset): identifier_matchable_type = self.identifier_matchable_type - identifier_matchable_id: Union[None, Unset, str] + identifier_matchable_id: None | Unset | str if isinstance(self.identifier_matchable_id, Unset): identifier_matchable_id = UNSET else: identifier_matchable_id = self.identifier_matchable_id - identifier_reference_kind: Union[Unset, str] = UNSET + identifier_reference_kind: Unset | str = UNSET if not isinstance(self.identifier_reference_kind, Unset): identifier_reference_kind = self.identifier_reference_kind - identifier_json_path: Union[None, Unset, str] + identifier_json_path: None | Unset | str if isinstance(self.identifier_json_path, Unset): identifier_json_path = UNSET else: identifier_json_path = self.identifier_json_path - identifier_value_regex: Union[None, Unset, str] + identifier_value_regex: None | Unset | str if isinstance(self.identifier_value_regex, Unset): identifier_value_regex = UNSET else: identifier_value_regex = self.identifier_value_regex - conditions_attributes: Union[Unset, list[dict[str, Any]]] = UNSET + conditions_attributes: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.conditions_attributes, Unset): conditions_attributes = [] for conditions_attributes_item_data in self.conditions_attributes: @@ -140,7 +140,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: enabled = d.pop("enabled", UNSET) _condition_type = d.pop("condition_type", UNSET) - condition_type: Union[Unset, NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionType] + condition_type: Unset | NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionType if isinstance(_condition_type, Unset): condition_type = UNSET else: @@ -149,9 +149,9 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: ) _identifier_matchable_type = d.pop("identifier_matchable_type", UNSET) - identifier_matchable_type: Union[ - Unset, NewAlertsSourceDataAttributesResolutionRuleAttributesType0IdentifierMatchableType - ] + identifier_matchable_type: ( + Unset | NewAlertsSourceDataAttributesResolutionRuleAttributesType0IdentifierMatchableType + ) if isinstance(_identifier_matchable_type, Unset): identifier_matchable_type = UNSET else: @@ -161,19 +161,19 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: ) ) - def _parse_identifier_matchable_id(data: object) -> Union[None, Unset, str]: + def _parse_identifier_matchable_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) identifier_matchable_id = _parse_identifier_matchable_id(d.pop("identifier_matchable_id", UNSET)) _identifier_reference_kind = d.pop("identifier_reference_kind", UNSET) - identifier_reference_kind: Union[ - Unset, NewAlertsSourceDataAttributesResolutionRuleAttributesType0IdentifierReferenceKind - ] + identifier_reference_kind: ( + Unset | NewAlertsSourceDataAttributesResolutionRuleAttributesType0IdentifierReferenceKind + ) if isinstance(_identifier_reference_kind, Unset): identifier_reference_kind = UNSET else: @@ -183,21 +183,21 @@ def _parse_identifier_matchable_id(data: object) -> Union[None, Unset, str]: ) ) - def _parse_identifier_json_path(data: object) -> Union[None, Unset, str]: + def _parse_identifier_json_path(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) identifier_json_path = _parse_identifier_json_path(d.pop("identifier_json_path", UNSET)) - def _parse_identifier_value_regex(data: object) -> Union[None, Unset, str]: + def _parse_identifier_value_regex(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) identifier_value_regex = _parse_identifier_value_regex(d.pop("identifier_value_regex", UNSET)) diff --git a/rootly_sdk/models/new_alerts_source_data_attributes_resolution_rule_attributes_type_0_conditions_attributes_item.py b/rootly_sdk/models/new_alerts_source_data_attributes_resolution_rule_attributes_type_0_conditions_attributes_item.py index 8088ee20..111fd8fc 100644 --- a/rootly_sdk/models/new_alerts_source_data_attributes_resolution_rule_attributes_type_0_conditions_attributes_item.py +++ b/rootly_sdk/models/new_alerts_source_data_attributes_resolution_rule_attributes_type_0_conditions_attributes_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -41,42 +41,40 @@ class NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttrib kind of the conditionable """ - field: Union[None, Unset, str] = UNSET - operator: Union[ - Unset, NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemOperator - ] = UNSET - value: Union[Unset, str] = UNSET - conditionable_type: Union[ - Unset, NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemConditionableType - ] = UNSET - conditionable_id: Union[None, Unset, str] = UNSET - kind: Union[Unset, NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemKind] = UNSET + field: None | Unset | str = UNSET + operator: Unset | NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemOperator = UNSET + value: Unset | str = UNSET + conditionable_type: ( + Unset | NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemConditionableType + ) = UNSET + conditionable_id: None | Unset | str = UNSET + kind: Unset | NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemKind = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - field: Union[None, Unset, str] + field: None | Unset | str if isinstance(self.field, Unset): field = UNSET else: field = self.field - operator: Union[Unset, str] = UNSET + operator: Unset | str = UNSET if not isinstance(self.operator, Unset): operator = self.operator value = self.value - conditionable_type: Union[Unset, str] = UNSET + conditionable_type: Unset | str = UNSET if not isinstance(self.conditionable_type, Unset): conditionable_type = self.conditionable_type - conditionable_id: Union[None, Unset, str] + conditionable_id: None | Unset | str if isinstance(self.conditionable_id, Unset): conditionable_id = UNSET else: conditionable_id = self.conditionable_id - kind: Union[Unset, str] = UNSET + kind: Unset | str = UNSET if not isinstance(self.kind, Unset): kind = self.kind @@ -102,19 +100,17 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_field(data: object) -> Union[None, Unset, str]: + def _parse_field(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) field = _parse_field(d.pop("field", UNSET)) _operator = d.pop("operator", UNSET) - operator: Union[ - Unset, NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemOperator - ] + operator: Unset | NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemOperator if isinstance(_operator, Unset): operator = UNSET else: @@ -125,9 +121,9 @@ def _parse_field(data: object) -> Union[None, Unset, str]: value = d.pop("value", UNSET) _conditionable_type = d.pop("conditionable_type", UNSET) - conditionable_type: Union[ - Unset, NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemConditionableType - ] + conditionable_type: ( + Unset | NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemConditionableType + ) if isinstance(_conditionable_type, Unset): conditionable_type = UNSET else: @@ -135,17 +131,17 @@ def _parse_field(data: object) -> Union[None, Unset, str]: _conditionable_type ) - def _parse_conditionable_id(data: object) -> Union[None, Unset, str]: + def _parse_conditionable_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) conditionable_id = _parse_conditionable_id(d.pop("conditionable_id", UNSET)) _kind = d.pop("kind", UNSET) - kind: Union[Unset, NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemKind] + kind: Unset | NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemKind if isinstance(_kind, Unset): kind = UNSET else: diff --git a/rootly_sdk/models/new_alerts_source_data_attributes_sourceable_attributes_type_0.py b/rootly_sdk/models/new_alerts_source_data_attributes_sourceable_attributes_type_0.py index c02891bc..4b8318ca 100644 --- a/rootly_sdk/models/new_alerts_source_data_attributes_sourceable_attributes_type_0.py +++ b/rootly_sdk/models/new_alerts_source_data_attributes_sourceable_attributes_type_0.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -31,18 +31,18 @@ class NewAlertsSourceDataAttributesSourceableAttributesType0: auto resolve alerts """ - auto_resolve: Union[Unset, bool] = UNSET - resolve_state: Union[None, Unset, str] = UNSET - accept_threaded_emails: Union[Unset, bool] = UNSET - field_mappings_attributes: Union[ - Unset, list["NewAlertsSourceDataAttributesSourceableAttributesType0FieldMappingsAttributesItem"] - ] = UNSET + auto_resolve: Unset | bool = UNSET + resolve_state: None | Unset | str = UNSET + accept_threaded_emails: Unset | bool = UNSET + field_mappings_attributes: ( + Unset | list["NewAlertsSourceDataAttributesSourceableAttributesType0FieldMappingsAttributesItem"] + ) = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: auto_resolve = self.auto_resolve - resolve_state: Union[None, Unset, str] + resolve_state: None | Unset | str if isinstance(self.resolve_state, Unset): resolve_state = UNSET else: @@ -50,7 +50,7 @@ def to_dict(self) -> dict[str, Any]: accept_threaded_emails = self.accept_threaded_emails - field_mappings_attributes: Union[Unset, list[dict[str, Any]]] = UNSET + field_mappings_attributes: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.field_mappings_attributes, Unset): field_mappings_attributes = [] for field_mappings_attributes_item_data in self.field_mappings_attributes: @@ -80,12 +80,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) auto_resolve = d.pop("auto_resolve", UNSET) - def _parse_resolve_state(data: object) -> Union[None, Unset, str]: + def _parse_resolve_state(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) resolve_state = _parse_resolve_state(d.pop("resolve_state", UNSET)) diff --git a/rootly_sdk/models/new_alerts_source_data_attributes_sourceable_attributes_type_0_field_mappings_attributes_item.py b/rootly_sdk/models/new_alerts_source_data_attributes_sourceable_attributes_type_0_field_mappings_attributes_item.py index 986ab601..1aa55748 100644 --- a/rootly_sdk/models/new_alerts_source_data_attributes_sourceable_attributes_type_0_field_mappings_attributes_item.py +++ b/rootly_sdk/models/new_alerts_source_data_attributes_sourceable_attributes_type_0_field_mappings_attributes_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -24,12 +24,12 @@ class NewAlertsSourceDataAttributesSourceableAttributesType0FieldMappingsAttribu this may also be a Liquid template that resolves to a notification target id at routing time. """ - field: Union[Unset, NewAlertsSourceDataAttributesSourceableAttributesType0FieldMappingsAttributesItemField] = UNSET - json_path: Union[Unset, str] = UNSET + field: Unset | NewAlertsSourceDataAttributesSourceableAttributesType0FieldMappingsAttributesItemField = UNSET + json_path: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - field: Union[Unset, str] = UNSET + field: Unset | str = UNSET if not isinstance(self.field, Unset): field = self.field @@ -49,7 +49,7 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _field = d.pop("field", UNSET) - field: Union[Unset, NewAlertsSourceDataAttributesSourceableAttributesType0FieldMappingsAttributesItemField] + field: Unset | NewAlertsSourceDataAttributesSourceableAttributesType0FieldMappingsAttributesItemField if isinstance(_field, Unset): field = UNSET else: diff --git a/rootly_sdk/models/new_api_key_data_attributes.py b/rootly_sdk/models/new_api_key_data_attributes.py index c4edb3e5..207abe0d 100644 --- a/rootly_sdk/models/new_api_key_data_attributes.py +++ b/rootly_sdk/models/new_api_key_data_attributes.py @@ -1,6 +1,6 @@ import datetime from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from dateutil.parser import isoparse @@ -30,10 +30,10 @@ class NewApiKeyDataAttributes: name: str kind: NewApiKeyDataAttributesKind expires_at: datetime.datetime - description: Union[None, Unset, str] = UNSET - group_id: Union[None, Unset, str] = UNSET - role_id: Union[None, Unset, str] = UNSET - on_call_role_id: Union[None, Unset, str] = UNSET + description: None | Unset | str = UNSET + group_id: None | Unset | str = UNSET + role_id: None | Unset | str = UNSET + on_call_role_id: None | Unset | str = UNSET def to_dict(self) -> dict[str, Any]: name = self.name @@ -42,25 +42,25 @@ def to_dict(self) -> dict[str, Any]: expires_at = self.expires_at.isoformat() - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - group_id: Union[None, Unset, str] + group_id: None | Unset | str if isinstance(self.group_id, Unset): group_id = UNSET else: group_id = self.group_id - role_id: Union[None, Unset, str] + role_id: None | Unset | str if isinstance(self.role_id, Unset): role_id = UNSET else: role_id = self.role_id - on_call_role_id: Union[None, Unset, str] + on_call_role_id: None | Unset | str if isinstance(self.on_call_role_id, Unset): on_call_role_id = UNSET else: @@ -95,39 +95,39 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: expires_at = isoparse(d.pop("expires_at")) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_group_id(data: object) -> Union[None, Unset, str]: + def _parse_group_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) group_id = _parse_group_id(d.pop("group_id", UNSET)) - def _parse_role_id(data: object) -> Union[None, Unset, str]: + def _parse_role_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) role_id = _parse_role_id(d.pop("role_id", UNSET)) - def _parse_on_call_role_id(data: object) -> Union[None, Unset, str]: + def _parse_on_call_role_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) on_call_role_id = _parse_on_call_role_id(d.pop("on_call_role_id", UNSET)) diff --git a/rootly_sdk/models/new_catalog_checklist_template_data_attributes.py b/rootly_sdk/models/new_catalog_checklist_template_data_attributes.py index 3e08421f..3720364b 100644 --- a/rootly_sdk/models/new_catalog_checklist_template_data_attributes.py +++ b/rootly_sdk/models/new_catalog_checklist_template_data_attributes.py @@ -48,20 +48,20 @@ class NewCatalogChecklistTemplateDataAttributes: name: str catalog_type: NewCatalogChecklistTemplateDataAttributesCatalogType scope_type: NewCatalogChecklistTemplateDataAttributesScopeType - slug: Union[None, Unset, str] = UNSET - description: Union[None, Unset, str] = UNSET - scope_id: Union[Unset, str] = UNSET - fields: Union[ - None, - Unset, - list[ + slug: None | Unset | str = UNSET + description: None | Unset | str = UNSET + scope_id: Unset | str = UNSET + fields: ( + None + | Unset + | list[ Union[ "NewCatalogChecklistTemplateDataAttributesBuiltinField", "NewCatalogChecklistTemplateDataAttributesCustomField", ] - ], - ] = UNSET - owners: Union[None, Unset, list["NewCatalogChecklistTemplateDataAttributesOwnersType0Item"]] = UNSET + ] + ) = UNSET + owners: None | Unset | list["NewCatalogChecklistTemplateDataAttributesOwnersType0Item"] = UNSET def to_dict(self) -> dict[str, Any]: from ..models.new_catalog_checklist_template_data_attributes_builtin_field import ( @@ -74,13 +74,13 @@ def to_dict(self) -> dict[str, Any]: scope_type: str = self.scope_type - slug: Union[None, Unset, str] + slug: None | Unset | str if isinstance(self.slug, Unset): slug = UNSET else: slug = self.slug - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: @@ -88,7 +88,7 @@ def to_dict(self) -> dict[str, Any]: scope_id = self.scope_id - fields: Union[None, Unset, list[dict[str, Any]]] + fields: None | Unset | list[dict[str, Any]] if isinstance(self.fields, Unset): fields = UNSET elif isinstance(self.fields, list): @@ -105,7 +105,7 @@ def to_dict(self) -> dict[str, Any]: else: fields = self.fields - owners: Union[None, Unset, list[dict[str, Any]]] + owners: None | Unset | list[dict[str, Any]] if isinstance(self.owners, Unset): owners = UNSET elif isinstance(self.owners, list): @@ -158,21 +158,21 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: scope_type = check_new_catalog_checklist_template_data_attributes_scope_type(d.pop("scope_type")) - def _parse_slug(data: object) -> Union[None, Unset, str]: + def _parse_slug(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) slug = _parse_slug(d.pop("slug", UNSET)) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) @@ -180,16 +180,16 @@ def _parse_description(data: object) -> Union[None, Unset, str]: def _parse_fields( data: object, - ) -> Union[ - None, - Unset, - list[ + ) -> ( + None + | Unset + | list[ Union[ "NewCatalogChecklistTemplateDataAttributesBuiltinField", "NewCatalogChecklistTemplateDataAttributesCustomField", ] - ], - ]: + ] + ): if data is None: return data if isinstance(data, Unset): @@ -233,15 +233,13 @@ def _parse_fields_type_0_item( except: # noqa: E722 pass return cast( - Union[ - None, - Unset, - list[ - Union[ - "NewCatalogChecklistTemplateDataAttributesBuiltinField", - "NewCatalogChecklistTemplateDataAttributesCustomField", - ] - ], + None + | Unset + | list[ + Union[ + "NewCatalogChecklistTemplateDataAttributesBuiltinField", + "NewCatalogChecklistTemplateDataAttributesCustomField", + ] ], data, ) @@ -250,7 +248,7 @@ def _parse_fields_type_0_item( def _parse_owners( data: object, - ) -> Union[None, Unset, list["NewCatalogChecklistTemplateDataAttributesOwnersType0Item"]]: + ) -> None | Unset | list["NewCatalogChecklistTemplateDataAttributesOwnersType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -270,7 +268,7 @@ def _parse_owners( return owners_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list["NewCatalogChecklistTemplateDataAttributesOwnersType0Item"]], data) + return cast(None | Unset | list["NewCatalogChecklistTemplateDataAttributesOwnersType0Item"], data) owners = _parse_owners(d.pop("owners", UNSET)) diff --git a/rootly_sdk/models/new_catalog_checklist_template_data_attributes_custom_field.py b/rootly_sdk/models/new_catalog_checklist_template_data_attributes_custom_field.py index f950f201..df6f9e42 100644 --- a/rootly_sdk/models/new_catalog_checklist_template_data_attributes_custom_field.py +++ b/rootly_sdk/models/new_catalog_checklist_template_data_attributes_custom_field.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -24,7 +24,7 @@ class NewCatalogChecklistTemplateDataAttributesCustomField: field_source: NewCatalogChecklistTemplateDataAttributesCustomFieldFieldSource catalog_property_id: str - field_key: Union[Unset, str] = UNSET + field_key: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/new_catalog_data_attributes.py b/rootly_sdk/models/new_catalog_data_attributes.py index 3b37f2a6..cbfab9ba 100644 --- a/rootly_sdk/models/new_catalog_data_attributes.py +++ b/rootly_sdk/models/new_catalog_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -26,38 +26,38 @@ class NewCatalogDataAttributes: """ name: str - slug: Union[None, Unset, str] = UNSET - description: Union[None, Unset, str] = UNSET - icon: Union[Unset, NewCatalogDataAttributesIcon] = UNSET - position: Union[None, Unset, int] = UNSET - external_id: Union[None, Unset, str] = UNSET + slug: None | Unset | str = UNSET + description: None | Unset | str = UNSET + icon: Unset | NewCatalogDataAttributesIcon = UNSET + position: None | Unset | int = UNSET + external_id: None | Unset | str = UNSET def to_dict(self) -> dict[str, Any]: name = self.name - slug: Union[None, Unset, str] + slug: None | Unset | str if isinstance(self.slug, Unset): slug = UNSET else: slug = self.slug - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - icon: Union[Unset, str] = UNSET + icon: Unset | str = UNSET if not isinstance(self.icon, Unset): icon = self.icon - position: Union[None, Unset, int] + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: position = self.position - external_id: Union[None, Unset, str] + external_id: None | Unset | str if isinstance(self.external_id, Unset): external_id = UNSET else: @@ -88,46 +88,46 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name") - def _parse_slug(data: object) -> Union[None, Unset, str]: + def _parse_slug(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) slug = _parse_slug(d.pop("slug", UNSET)) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) _icon = d.pop("icon", UNSET) - icon: Union[Unset, NewCatalogDataAttributesIcon] + icon: Unset | NewCatalogDataAttributesIcon if isinstance(_icon, Unset): icon = UNSET else: icon = check_new_catalog_data_attributes_icon(_icon) - def _parse_position(data: object) -> Union[None, Unset, int]: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) - def _parse_external_id(data: object) -> Union[None, Unset, str]: + def _parse_external_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) external_id = _parse_external_id(d.pop("external_id", UNSET)) diff --git a/rootly_sdk/models/new_catalog_entity_data_attributes.py b/rootly_sdk/models/new_catalog_entity_data_attributes.py index 347f9041..ae5463dc 100644 --- a/rootly_sdk/models/new_catalog_entity_data_attributes.py +++ b/rootly_sdk/models/new_catalog_entity_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define @@ -30,54 +30,54 @@ class NewCatalogEntityDataAttributes: """ name: str - slug: Union[None, Unset, str] = UNSET - description: Union[None, Unset, str] = UNSET - public_description: Union[None, Unset, str] = UNSET - position: Union[None, Unset, int] = UNSET - backstage_id: Union[None, Unset, str] = UNSET - external_id: Union[None, Unset, str] = UNSET - properties: Union[Unset, list["NewCatalogEntityDataAttributesPropertiesItem"]] = UNSET + slug: None | Unset | str = UNSET + description: None | Unset | str = UNSET + public_description: None | Unset | str = UNSET + position: None | Unset | int = UNSET + backstage_id: None | Unset | str = UNSET + external_id: None | Unset | str = UNSET + properties: Unset | list["NewCatalogEntityDataAttributesPropertiesItem"] = UNSET def to_dict(self) -> dict[str, Any]: name = self.name - slug: Union[None, Unset, str] + slug: None | Unset | str if isinstance(self.slug, Unset): slug = UNSET else: slug = self.slug - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - public_description: Union[None, Unset, str] + public_description: None | Unset | str if isinstance(self.public_description, Unset): public_description = UNSET else: public_description = self.public_description - position: Union[None, Unset, int] + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: position = self.position - backstage_id: Union[None, Unset, str] + backstage_id: None | Unset | str if isinstance(self.backstage_id, Unset): backstage_id = UNSET else: backstage_id = self.backstage_id - external_id: Union[None, Unset, str] + external_id: None | Unset | str if isinstance(self.external_id, Unset): external_id = UNSET else: external_id = self.external_id - properties: Union[Unset, list[dict[str, Any]]] = UNSET + properties: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.properties, Unset): properties = [] for properties_item_data in self.properties: @@ -117,57 +117,57 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name") - def _parse_slug(data: object) -> Union[None, Unset, str]: + def _parse_slug(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) slug = _parse_slug(d.pop("slug", UNSET)) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_public_description(data: object) -> Union[None, Unset, str]: + def _parse_public_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) public_description = _parse_public_description(d.pop("public_description", UNSET)) - def _parse_position(data: object) -> Union[None, Unset, int]: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) - def _parse_backstage_id(data: object) -> Union[None, Unset, str]: + def _parse_backstage_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) backstage_id = _parse_backstage_id(d.pop("backstage_id", UNSET)) - def _parse_external_id(data: object) -> Union[None, Unset, str]: + def _parse_external_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) external_id = _parse_external_id(d.pop("external_id", UNSET)) diff --git a/rootly_sdk/models/new_catalog_entity_property_data_attributes.py b/rootly_sdk/models/new_catalog_entity_property_data_attributes.py index 31cc6588..c3ae6eaa 100644 --- a/rootly_sdk/models/new_catalog_entity_property_data_attributes.py +++ b/rootly_sdk/models/new_catalog_entity_property_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define @@ -26,7 +26,7 @@ class NewCatalogEntityPropertyDataAttributes: catalog_field_id: str key: NewCatalogEntityPropertyDataAttributesKey value: str - catalog_entity_id: Union[Unset, str] = UNSET + catalog_entity_id: Unset | str = UNSET def to_dict(self) -> dict[str, Any]: catalog_field_id = self.catalog_field_id diff --git a/rootly_sdk/models/new_catalog_field_data_attributes.py b/rootly_sdk/models/new_catalog_field_data_attributes.py index 7b1f73fe..60698e04 100644 --- a/rootly_sdk/models/new_catalog_field_data_attributes.py +++ b/rootly_sdk/models/new_catalog_field_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -35,26 +35,26 @@ class NewCatalogFieldDataAttributes: name: str kind: NewCatalogFieldDataAttributesKind - slug: Union[None, Unset, str] = UNSET - kind_catalog_id: Union[None, Unset, str] = UNSET - multiple: Union[Unset, bool] = UNSET - position: Union[None, Unset, int] = UNSET - required: Union[Unset, bool] = UNSET - catalog_type: Union[Unset, NewCatalogFieldDataAttributesCatalogType] = UNSET - external_id: Union[None, Unset, str] = UNSET + slug: None | Unset | str = UNSET + kind_catalog_id: None | Unset | str = UNSET + multiple: Unset | bool = UNSET + position: None | Unset | int = UNSET + required: Unset | bool = UNSET + catalog_type: Unset | NewCatalogFieldDataAttributesCatalogType = UNSET + external_id: None | Unset | str = UNSET def to_dict(self) -> dict[str, Any]: name = self.name kind: str = self.kind - slug: Union[None, Unset, str] + slug: None | Unset | str if isinstance(self.slug, Unset): slug = UNSET else: slug = self.slug - kind_catalog_id: Union[None, Unset, str] + kind_catalog_id: None | Unset | str if isinstance(self.kind_catalog_id, Unset): kind_catalog_id = UNSET else: @@ -62,7 +62,7 @@ def to_dict(self) -> dict[str, Any]: multiple = self.multiple - position: Union[None, Unset, int] + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: @@ -70,11 +70,11 @@ def to_dict(self) -> dict[str, Any]: required = self.required - catalog_type: Union[Unset, str] = UNSET + catalog_type: Unset | str = UNSET if not isinstance(self.catalog_type, Unset): catalog_type = self.catalog_type - external_id: Union[None, Unset, str] + external_id: None | Unset | str if isinstance(self.external_id, Unset): external_id = UNSET else: @@ -112,50 +112,50 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: kind = check_new_catalog_field_data_attributes_kind(d.pop("kind")) - def _parse_slug(data: object) -> Union[None, Unset, str]: + def _parse_slug(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) slug = _parse_slug(d.pop("slug", UNSET)) - def _parse_kind_catalog_id(data: object) -> Union[None, Unset, str]: + def _parse_kind_catalog_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) kind_catalog_id = _parse_kind_catalog_id(d.pop("kind_catalog_id", UNSET)) multiple = d.pop("multiple", UNSET) - def _parse_position(data: object) -> Union[None, Unset, int]: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) required = d.pop("required", UNSET) _catalog_type = d.pop("catalog_type", UNSET) - catalog_type: Union[Unset, NewCatalogFieldDataAttributesCatalogType] + catalog_type: Unset | NewCatalogFieldDataAttributesCatalogType if isinstance(_catalog_type, Unset): catalog_type = UNSET else: catalog_type = check_new_catalog_field_data_attributes_catalog_type(_catalog_type) - def _parse_external_id(data: object) -> Union[None, Unset, str]: + def _parse_external_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) external_id = _parse_external_id(d.pop("external_id", UNSET)) diff --git a/rootly_sdk/models/new_catalog_property_data_attributes.py b/rootly_sdk/models/new_catalog_property_data_attributes.py index e7a0eb78..0f8c785a 100644 --- a/rootly_sdk/models/new_catalog_property_data_attributes.py +++ b/rootly_sdk/models/new_catalog_property_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -36,26 +36,26 @@ class NewCatalogPropertyDataAttributes: name: str kind: NewCatalogPropertyDataAttributesKind - slug: Union[None, Unset, str] = UNSET - kind_catalog_id: Union[None, Unset, str] = UNSET - multiple: Union[Unset, bool] = UNSET - position: Union[None, Unset, int] = UNSET - required: Union[Unset, bool] = UNSET - catalog_type: Union[Unset, NewCatalogPropertyDataAttributesCatalogType] = UNSET - external_id: Union[None, Unset, str] = UNSET + slug: None | Unset | str = UNSET + kind_catalog_id: None | Unset | str = UNSET + multiple: Unset | bool = UNSET + position: None | Unset | int = UNSET + required: Unset | bool = UNSET + catalog_type: Unset | NewCatalogPropertyDataAttributesCatalogType = UNSET + external_id: None | Unset | str = UNSET def to_dict(self) -> dict[str, Any]: name = self.name kind: str = self.kind - slug: Union[None, Unset, str] + slug: None | Unset | str if isinstance(self.slug, Unset): slug = UNSET else: slug = self.slug - kind_catalog_id: Union[None, Unset, str] + kind_catalog_id: None | Unset | str if isinstance(self.kind_catalog_id, Unset): kind_catalog_id = UNSET else: @@ -63,7 +63,7 @@ def to_dict(self) -> dict[str, Any]: multiple = self.multiple - position: Union[None, Unset, int] + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: @@ -71,11 +71,11 @@ def to_dict(self) -> dict[str, Any]: required = self.required - catalog_type: Union[Unset, str] = UNSET + catalog_type: Unset | str = UNSET if not isinstance(self.catalog_type, Unset): catalog_type = self.catalog_type - external_id: Union[None, Unset, str] + external_id: None | Unset | str if isinstance(self.external_id, Unset): external_id = UNSET else: @@ -113,50 +113,50 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: kind = check_new_catalog_property_data_attributes_kind(d.pop("kind")) - def _parse_slug(data: object) -> Union[None, Unset, str]: + def _parse_slug(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) slug = _parse_slug(d.pop("slug", UNSET)) - def _parse_kind_catalog_id(data: object) -> Union[None, Unset, str]: + def _parse_kind_catalog_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) kind_catalog_id = _parse_kind_catalog_id(d.pop("kind_catalog_id", UNSET)) multiple = d.pop("multiple", UNSET) - def _parse_position(data: object) -> Union[None, Unset, int]: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) required = d.pop("required", UNSET) _catalog_type = d.pop("catalog_type", UNSET) - catalog_type: Union[Unset, NewCatalogPropertyDataAttributesCatalogType] + catalog_type: Unset | NewCatalogPropertyDataAttributesCatalogType if isinstance(_catalog_type, Unset): catalog_type = UNSET else: catalog_type = check_new_catalog_property_data_attributes_catalog_type(_catalog_type) - def _parse_external_id(data: object) -> Union[None, Unset, str]: + def _parse_external_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) external_id = _parse_external_id(d.pop("external_id", UNSET)) diff --git a/rootly_sdk/models/new_cause_data_attributes.py b/rootly_sdk/models/new_cause_data_attributes.py index e2970a15..c44dfc09 100644 --- a/rootly_sdk/models/new_cause_data_attributes.py +++ b/rootly_sdk/models/new_cause_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define @@ -27,40 +27,40 @@ class NewCauseDataAttributes: """ name: str - slug: Union[None, Unset, str] = UNSET - description: Union[None, Unset, str] = UNSET - public_description: Union[None, Unset, str] = UNSET - position: Union[None, Unset, int] = UNSET - properties: Union[Unset, list["NewCauseDataAttributesPropertiesItem"]] = UNSET + slug: None | Unset | str = UNSET + description: None | Unset | str = UNSET + public_description: None | Unset | str = UNSET + position: None | Unset | int = UNSET + properties: Unset | list["NewCauseDataAttributesPropertiesItem"] = UNSET def to_dict(self) -> dict[str, Any]: name = self.name - slug: Union[None, Unset, str] + slug: None | Unset | str if isinstance(self.slug, Unset): slug = UNSET else: slug = self.slug - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - public_description: Union[None, Unset, str] + public_description: None | Unset | str if isinstance(self.public_description, Unset): public_description = UNSET else: public_description = self.public_description - position: Union[None, Unset, int] + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: position = self.position - properties: Union[Unset, list[dict[str, Any]]] = UNSET + properties: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.properties, Unset): properties = [] for properties_item_data in self.properties: @@ -94,39 +94,39 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name") - def _parse_slug(data: object) -> Union[None, Unset, str]: + def _parse_slug(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) slug = _parse_slug(d.pop("slug", UNSET)) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_public_description(data: object) -> Union[None, Unset, str]: + def _parse_public_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) public_description = _parse_public_description(d.pop("public_description", UNSET)) - def _parse_position(data: object) -> Union[None, Unset, int]: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) diff --git a/rootly_sdk/models/new_communications_group_data_attributes.py b/rootly_sdk/models/new_communications_group_data_attributes.py index 95462b5e..8f9e4197 100644 --- a/rootly_sdk/models/new_communications_group_data_attributes.py +++ b/rootly_sdk/models/new_communications_group_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define @@ -43,54 +43,54 @@ class NewCommunicationsGroupDataAttributes: name: str communication_type_id: str - description: Union[None, Unset, str] = UNSET - is_private: Union[None, Unset, bool] = UNSET - condition_type: Union[Unset, NewCommunicationsGroupDataAttributesConditionType] = UNSET - sms_channel: Union[None, Unset, bool] = UNSET - email_channel: Union[None, Unset, bool] = UNSET - member_ids: Union[None, Unset, list[int]] = UNSET - slack_channel_ids: Union[None, Unset, list[str]] = UNSET - communication_group_conditions: Union[ - None, Unset, list["NewCommunicationsGroupDataAttributesCommunicationGroupConditionsType0Item"] - ] = UNSET - communication_external_group_members: Union[ - None, Unset, list["NewCommunicationsGroupDataAttributesCommunicationExternalGroupMembersType0Item"] - ] = UNSET + description: None | Unset | str = UNSET + is_private: None | Unset | bool = UNSET + condition_type: Unset | NewCommunicationsGroupDataAttributesConditionType = UNSET + sms_channel: None | Unset | bool = UNSET + email_channel: None | Unset | bool = UNSET + member_ids: None | Unset | list[int] = UNSET + slack_channel_ids: None | Unset | list[str] = UNSET + communication_group_conditions: ( + None | Unset | list["NewCommunicationsGroupDataAttributesCommunicationGroupConditionsType0Item"] + ) = UNSET + communication_external_group_members: ( + None | Unset | list["NewCommunicationsGroupDataAttributesCommunicationExternalGroupMembersType0Item"] + ) = UNSET def to_dict(self) -> dict[str, Any]: name = self.name communication_type_id = self.communication_type_id - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - is_private: Union[None, Unset, bool] + is_private: None | Unset | bool if isinstance(self.is_private, Unset): is_private = UNSET else: is_private = self.is_private - condition_type: Union[Unset, str] = UNSET + condition_type: Unset | str = UNSET if not isinstance(self.condition_type, Unset): condition_type = self.condition_type - sms_channel: Union[None, Unset, bool] + sms_channel: None | Unset | bool if isinstance(self.sms_channel, Unset): sms_channel = UNSET else: sms_channel = self.sms_channel - email_channel: Union[None, Unset, bool] + email_channel: None | Unset | bool if isinstance(self.email_channel, Unset): email_channel = UNSET else: email_channel = self.email_channel - member_ids: Union[None, Unset, list[int]] + member_ids: None | Unset | list[int] if isinstance(self.member_ids, Unset): member_ids = UNSET elif isinstance(self.member_ids, list): @@ -99,7 +99,7 @@ def to_dict(self) -> dict[str, Any]: else: member_ids = self.member_ids - slack_channel_ids: Union[None, Unset, list[str]] + slack_channel_ids: None | Unset | list[str] if isinstance(self.slack_channel_ids, Unset): slack_channel_ids = UNSET elif isinstance(self.slack_channel_ids, list): @@ -108,7 +108,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_channel_ids = self.slack_channel_ids - communication_group_conditions: Union[None, Unset, list[dict[str, Any]]] + communication_group_conditions: None | Unset | list[dict[str, Any]] if isinstance(self.communication_group_conditions, Unset): communication_group_conditions = UNSET elif isinstance(self.communication_group_conditions, list): @@ -120,7 +120,7 @@ def to_dict(self) -> dict[str, Any]: else: communication_group_conditions = self.communication_group_conditions - communication_external_group_members: Union[None, Unset, list[dict[str, Any]]] + communication_external_group_members: None | Unset | list[dict[str, Any]] if isinstance(self.communication_external_group_members, Unset): communication_external_group_members = UNSET elif isinstance(self.communication_external_group_members, list): @@ -177,50 +177,50 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: communication_type_id = d.pop("communication_type_id") - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_is_private(data: object) -> Union[None, Unset, bool]: + def _parse_is_private(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) is_private = _parse_is_private(d.pop("is_private", UNSET)) _condition_type = d.pop("condition_type", UNSET) - condition_type: Union[Unset, NewCommunicationsGroupDataAttributesConditionType] + condition_type: Unset | NewCommunicationsGroupDataAttributesConditionType if isinstance(_condition_type, Unset): condition_type = UNSET else: condition_type = check_new_communications_group_data_attributes_condition_type(_condition_type) - def _parse_sms_channel(data: object) -> Union[None, Unset, bool]: + def _parse_sms_channel(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) sms_channel = _parse_sms_channel(d.pop("sms_channel", UNSET)) - def _parse_email_channel(data: object) -> Union[None, Unset, bool]: + def _parse_email_channel(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) email_channel = _parse_email_channel(d.pop("email_channel", UNSET)) - def _parse_member_ids(data: object) -> Union[None, Unset, list[int]]: + def _parse_member_ids(data: object) -> None | Unset | list[int]: if data is None: return data if isinstance(data, Unset): @@ -233,11 +233,11 @@ def _parse_member_ids(data: object) -> Union[None, Unset, list[int]]: return member_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[int]], data) + return cast(None | Unset | list[int], data) member_ids = _parse_member_ids(d.pop("member_ids", UNSET)) - def _parse_slack_channel_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_slack_channel_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -250,13 +250,13 @@ def _parse_slack_channel_ids(data: object) -> Union[None, Unset, list[str]]: return slack_channel_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) slack_channel_ids = _parse_slack_channel_ids(d.pop("slack_channel_ids", UNSET)) def _parse_communication_group_conditions( data: object, - ) -> Union[None, Unset, list["NewCommunicationsGroupDataAttributesCommunicationGroupConditionsType0Item"]]: + ) -> None | Unset | list["NewCommunicationsGroupDataAttributesCommunicationGroupConditionsType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -279,7 +279,7 @@ def _parse_communication_group_conditions( except: # noqa: E722 pass return cast( - Union[None, Unset, list["NewCommunicationsGroupDataAttributesCommunicationGroupConditionsType0Item"]], + None | Unset | list["NewCommunicationsGroupDataAttributesCommunicationGroupConditionsType0Item"], data, ) @@ -289,7 +289,7 @@ def _parse_communication_group_conditions( def _parse_communication_external_group_members( data: object, - ) -> Union[None, Unset, list["NewCommunicationsGroupDataAttributesCommunicationExternalGroupMembersType0Item"]]: + ) -> None | Unset | list["NewCommunicationsGroupDataAttributesCommunicationExternalGroupMembersType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -314,9 +314,7 @@ def _parse_communication_external_group_members( except: # noqa: E722 pass return cast( - Union[ - None, Unset, list["NewCommunicationsGroupDataAttributesCommunicationExternalGroupMembersType0Item"] - ], + None | Unset | list["NewCommunicationsGroupDataAttributesCommunicationExternalGroupMembersType0Item"], data, ) diff --git a/rootly_sdk/models/new_communications_group_data_attributes_communication_external_group_members_type_0_item.py b/rootly_sdk/models/new_communications_group_data_attributes_communication_external_group_members_type_0_item.py index ad18565e..ef8f8260 100644 --- a/rootly_sdk/models/new_communications_group_data_attributes_communication_external_group_members_type_0_item.py +++ b/rootly_sdk/models/new_communications_group_data_attributes_communication_external_group_members_type_0_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -18,9 +18,9 @@ class NewCommunicationsGroupDataAttributesCommunicationExternalGroupMembersType0 phone_number (Union[Unset, str]): Phone number of the external member """ - name: Union[Unset, str] = UNSET - email: Union[Unset, str] = UNSET - phone_number: Union[Unset, str] = UNSET + name: Unset | str = UNSET + email: Unset | str = UNSET + phone_number: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/new_communications_group_data_attributes_communication_group_conditions_type_0_item.py b/rootly_sdk/models/new_communications_group_data_attributes_communication_group_conditions_type_0_item.py index 5adb07cb..e5b2ed63 100644 --- a/rootly_sdk/models/new_communications_group_data_attributes_communication_group_conditions_type_0_item.py +++ b/rootly_sdk/models/new_communications_group_data_attributes_communication_group_conditions_type_0_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -26,22 +26,20 @@ class NewCommunicationsGroupDataAttributesCommunicationGroupConditionsType0Item: incident_type_ids (Union[None, Unset, list[str]]): Array of incident type IDs """ - property_type: Union[ - Unset, NewCommunicationsGroupDataAttributesCommunicationGroupConditionsType0ItemPropertyType - ] = UNSET - service_ids: Union[None, Unset, list[str]] = UNSET - severity_ids: Union[None, Unset, list[str]] = UNSET - functionality_ids: Union[None, Unset, list[str]] = UNSET - group_ids: Union[None, Unset, list[str]] = UNSET - incident_type_ids: Union[None, Unset, list[str]] = UNSET + property_type: Unset | NewCommunicationsGroupDataAttributesCommunicationGroupConditionsType0ItemPropertyType = UNSET + service_ids: None | Unset | list[str] = UNSET + severity_ids: None | Unset | list[str] = UNSET + functionality_ids: None | Unset | list[str] = UNSET + group_ids: None | Unset | list[str] = UNSET + incident_type_ids: None | Unset | list[str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - property_type: Union[Unset, str] = UNSET + property_type: Unset | str = UNSET if not isinstance(self.property_type, Unset): property_type = self.property_type - service_ids: Union[None, Unset, list[str]] + service_ids: None | Unset | list[str] if isinstance(self.service_ids, Unset): service_ids = UNSET elif isinstance(self.service_ids, list): @@ -50,7 +48,7 @@ def to_dict(self) -> dict[str, Any]: else: service_ids = self.service_ids - severity_ids: Union[None, Unset, list[str]] + severity_ids: None | Unset | list[str] if isinstance(self.severity_ids, Unset): severity_ids = UNSET elif isinstance(self.severity_ids, list): @@ -59,7 +57,7 @@ def to_dict(self) -> dict[str, Any]: else: severity_ids = self.severity_ids - functionality_ids: Union[None, Unset, list[str]] + functionality_ids: None | Unset | list[str] if isinstance(self.functionality_ids, Unset): functionality_ids = UNSET elif isinstance(self.functionality_ids, list): @@ -68,7 +66,7 @@ def to_dict(self) -> dict[str, Any]: else: functionality_ids = self.functionality_ids - group_ids: Union[None, Unset, list[str]] + group_ids: None | Unset | list[str] if isinstance(self.group_ids, Unset): group_ids = UNSET elif isinstance(self.group_ids, list): @@ -77,7 +75,7 @@ def to_dict(self) -> dict[str, Any]: else: group_ids = self.group_ids - incident_type_ids: Union[None, Unset, list[str]] + incident_type_ids: None | Unset | list[str] if isinstance(self.incident_type_ids, Unset): incident_type_ids = UNSET elif isinstance(self.incident_type_ids, list): @@ -108,9 +106,7 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _property_type = d.pop("property_type", UNSET) - property_type: Union[ - Unset, NewCommunicationsGroupDataAttributesCommunicationGroupConditionsType0ItemPropertyType - ] + property_type: Unset | NewCommunicationsGroupDataAttributesCommunicationGroupConditionsType0ItemPropertyType if isinstance(_property_type, Unset): property_type = UNSET else: @@ -120,7 +116,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: ) ) - def _parse_service_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_service_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -133,11 +129,11 @@ def _parse_service_ids(data: object) -> Union[None, Unset, list[str]]: return service_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) service_ids = _parse_service_ids(d.pop("service_ids", UNSET)) - def _parse_severity_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_severity_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -150,11 +146,11 @@ def _parse_severity_ids(data: object) -> Union[None, Unset, list[str]]: return severity_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) severity_ids = _parse_severity_ids(d.pop("severity_ids", UNSET)) - def _parse_functionality_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_functionality_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -167,11 +163,11 @@ def _parse_functionality_ids(data: object) -> Union[None, Unset, list[str]]: return functionality_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) functionality_ids = _parse_functionality_ids(d.pop("functionality_ids", UNSET)) - def _parse_group_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_group_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -184,11 +180,11 @@ def _parse_group_ids(data: object) -> Union[None, Unset, list[str]]: return group_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) group_ids = _parse_group_ids(d.pop("group_ids", UNSET)) - def _parse_incident_type_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_incident_type_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -201,7 +197,7 @@ def _parse_incident_type_ids(data: object) -> Union[None, Unset, list[str]]: return incident_type_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) incident_type_ids = _parse_incident_type_ids(d.pop("incident_type_ids", UNSET)) diff --git a/rootly_sdk/models/new_communications_stage_data_attributes.py b/rootly_sdk/models/new_communications_stage_data_attributes.py index 14e2fcdf..602a9fe6 100644 --- a/rootly_sdk/models/new_communications_stage_data_attributes.py +++ b/rootly_sdk/models/new_communications_stage_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -20,26 +20,26 @@ class NewCommunicationsStageDataAttributes: """ name: str - slug: Union[None, Unset, str] = UNSET - description: Union[None, Unset, str] = UNSET - position: Union[None, Unset, int] = UNSET + slug: None | Unset | str = UNSET + description: None | Unset | str = UNSET + position: None | Unset | int = UNSET def to_dict(self) -> dict[str, Any]: name = self.name - slug: Union[None, Unset, str] + slug: None | Unset | str if isinstance(self.slug, Unset): slug = UNSET else: slug = self.slug - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - position: Union[None, Unset, int] + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: @@ -66,30 +66,30 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name") - def _parse_slug(data: object) -> Union[None, Unset, str]: + def _parse_slug(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) slug = _parse_slug(d.pop("slug", UNSET)) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_position(data: object) -> Union[None, Unset, int]: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) diff --git a/rootly_sdk/models/new_communications_template_data_attributes.py b/rootly_sdk/models/new_communications_template_data_attributes.py index 3d97aef7..e25d102a 100644 --- a/rootly_sdk/models/new_communications_template_data_attributes.py +++ b/rootly_sdk/models/new_communications_template_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define @@ -29,30 +29,30 @@ class NewCommunicationsTemplateDataAttributes: name: str communication_type_id: str - description: Union[None, Unset, str] = UNSET - position: Union[None, Unset, int] = UNSET - communication_template_stages_attributes: Union[ - None, Unset, list["NewCommunicationsTemplateDataAttributesCommunicationTemplateStagesAttributesType0Item"] - ] = UNSET + description: None | Unset | str = UNSET + position: None | Unset | int = UNSET + communication_template_stages_attributes: ( + None | Unset | list["NewCommunicationsTemplateDataAttributesCommunicationTemplateStagesAttributesType0Item"] + ) = UNSET def to_dict(self) -> dict[str, Any]: name = self.name communication_type_id = self.communication_type_id - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - position: Union[None, Unset, int] + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: position = self.position - communication_template_stages_attributes: Union[None, Unset, list[dict[str, Any]]] + communication_template_stages_attributes: None | Unset | list[dict[str, Any]] if isinstance(self.communication_template_stages_attributes, Unset): communication_template_stages_attributes = UNSET elif isinstance(self.communication_template_stages_attributes, list): @@ -96,29 +96,29 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: communication_type_id = d.pop("communication_type_id") - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_position(data: object) -> Union[None, Unset, int]: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) def _parse_communication_template_stages_attributes( data: object, - ) -> Union[ - None, Unset, list["NewCommunicationsTemplateDataAttributesCommunicationTemplateStagesAttributesType0Item"] - ]: + ) -> ( + None | Unset | list["NewCommunicationsTemplateDataAttributesCommunicationTemplateStagesAttributesType0Item"] + ): if data is None: return data if isinstance(data, Unset): @@ -145,11 +145,9 @@ def _parse_communication_template_stages_attributes( except: # noqa: E722 pass return cast( - Union[ - None, - Unset, - list["NewCommunicationsTemplateDataAttributesCommunicationTemplateStagesAttributesType0Item"], - ], + None + | Unset + | list["NewCommunicationsTemplateDataAttributesCommunicationTemplateStagesAttributesType0Item"], data, ) diff --git a/rootly_sdk/models/new_communications_template_data_attributes_communication_template_stages_attributes_type_0_item.py b/rootly_sdk/models/new_communications_template_data_attributes_communication_template_stages_attributes_type_0_item.py index 748dc958..1a52b6f1 100644 --- a/rootly_sdk/models/new_communications_template_data_attributes_communication_template_stages_attributes_type_0_item.py +++ b/rootly_sdk/models/new_communications_template_data_attributes_communication_template_stages_attributes_type_0_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -20,35 +20,35 @@ class NewCommunicationsTemplateDataAttributesCommunicationTemplateStagesAttribut slack_content (Union[None, Unset, str]): Slack content for the stage """ - communication_stage_id: Union[Unset, str] = UNSET - sms_content: Union[None, Unset, str] = UNSET - email_subject: Union[None, Unset, str] = UNSET - email_body: Union[None, Unset, str] = UNSET - slack_content: Union[None, Unset, str] = UNSET + communication_stage_id: Unset | str = UNSET + sms_content: None | Unset | str = UNSET + email_subject: None | Unset | str = UNSET + email_body: None | Unset | str = UNSET + slack_content: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: communication_stage_id = self.communication_stage_id - sms_content: Union[None, Unset, str] + sms_content: None | Unset | str if isinstance(self.sms_content, Unset): sms_content = UNSET else: sms_content = self.sms_content - email_subject: Union[None, Unset, str] + email_subject: None | Unset | str if isinstance(self.email_subject, Unset): email_subject = UNSET else: email_subject = self.email_subject - email_body: Union[None, Unset, str] + email_body: None | Unset | str if isinstance(self.email_body, Unset): email_body = UNSET else: email_body = self.email_body - slack_content: Union[None, Unset, str] + slack_content: None | Unset | str if isinstance(self.slack_content, Unset): slack_content = UNSET else: @@ -75,39 +75,39 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) communication_stage_id = d.pop("communication_stage_id", UNSET) - def _parse_sms_content(data: object) -> Union[None, Unset, str]: + def _parse_sms_content(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) sms_content = _parse_sms_content(d.pop("sms_content", UNSET)) - def _parse_email_subject(data: object) -> Union[None, Unset, str]: + def _parse_email_subject(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) email_subject = _parse_email_subject(d.pop("email_subject", UNSET)) - def _parse_email_body(data: object) -> Union[None, Unset, str]: + def _parse_email_body(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) email_body = _parse_email_body(d.pop("email_body", UNSET)) - def _parse_slack_content(data: object) -> Union[None, Unset, str]: + def _parse_slack_content(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) slack_content = _parse_slack_content(d.pop("slack_content", UNSET)) diff --git a/rootly_sdk/models/new_communications_type_data_attributes.py b/rootly_sdk/models/new_communications_type_data_attributes.py index 4e0cb79d..d988abff 100644 --- a/rootly_sdk/models/new_communications_type_data_attributes.py +++ b/rootly_sdk/models/new_communications_type_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -21,30 +21,30 @@ class NewCommunicationsTypeDataAttributes: """ name: str - color: Union[None, str] - slug: Union[None, Unset, str] = UNSET - description: Union[None, Unset, str] = UNSET - position: Union[None, Unset, int] = UNSET + color: None | str + slug: None | Unset | str = UNSET + description: None | Unset | str = UNSET + position: None | Unset | int = UNSET def to_dict(self) -> dict[str, Any]: name = self.name - color: Union[None, str] + color: None | str color = self.color - slug: Union[None, Unset, str] + slug: None | Unset | str if isinstance(self.slug, Unset): slug = UNSET else: slug = self.slug - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - position: Union[None, Unset, int] + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: @@ -72,37 +72,37 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name") - def _parse_color(data: object) -> Union[None, str]: + def _parse_color(data: object) -> None | str: if data is None: return data - return cast(Union[None, str], data) + return cast(None | str, data) color = _parse_color(d.pop("color")) - def _parse_slug(data: object) -> Union[None, Unset, str]: + def _parse_slug(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) slug = _parse_slug(d.pop("slug", UNSET)) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_position(data: object) -> Union[None, Unset, int]: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) diff --git a/rootly_sdk/models/new_custom_field_data_attributes.py b/rootly_sdk/models/new_custom_field_data_attributes.py index 303d3003..93a5e0aa 100644 --- a/rootly_sdk/models/new_custom_field_data_attributes.py +++ b/rootly_sdk/models/new_custom_field_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -29,29 +29,29 @@ class NewCustomFieldDataAttributes: """ label: str - description: Union[None, Unset, str] = UNSET - shown: Union[Unset, list[NewCustomFieldDataAttributesShownItem]] = UNSET - required: Union[None, Unset, list[NewCustomFieldDataAttributesRequiredType0Item]] = UNSET - default: Union[None, Unset, str] = UNSET - position: Union[Unset, int] = UNSET + description: None | Unset | str = UNSET + shown: Unset | list[NewCustomFieldDataAttributesShownItem] = UNSET + required: None | Unset | list[NewCustomFieldDataAttributesRequiredType0Item] = UNSET + default: None | Unset | str = UNSET + position: Unset | int = UNSET def to_dict(self) -> dict[str, Any]: label = self.label - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - shown: Union[Unset, list[str]] = UNSET + shown: Unset | list[str] = UNSET if not isinstance(self.shown, Unset): shown = [] for shown_item_data in self.shown: shown_item: str = shown_item_data shown.append(shown_item) - required: Union[None, Unset, list[str]] + required: None | Unset | list[str] if isinstance(self.required, Unset): required = UNSET elif isinstance(self.required, list): @@ -63,7 +63,7 @@ def to_dict(self) -> dict[str, Any]: else: required = self.required - default: Union[None, Unset, str] + default: None | Unset | str if isinstance(self.default, Unset): default = UNSET else: @@ -96,12 +96,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) label = d.pop("label") - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) @@ -112,7 +112,7 @@ def _parse_description(data: object) -> Union[None, Unset, str]: shown.append(shown_item) - def _parse_required(data: object) -> Union[None, Unset, list[NewCustomFieldDataAttributesRequiredType0Item]]: + def _parse_required(data: object) -> None | Unset | list[NewCustomFieldDataAttributesRequiredType0Item]: if data is None: return data if isinstance(data, Unset): @@ -132,16 +132,16 @@ def _parse_required(data: object) -> Union[None, Unset, list[NewCustomFieldDataA return required_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[NewCustomFieldDataAttributesRequiredType0Item]], data) + return cast(None | Unset | list[NewCustomFieldDataAttributesRequiredType0Item], data) required = _parse_required(d.pop("required", UNSET)) - def _parse_default(data: object) -> Union[None, Unset, str]: + def _parse_default(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) default = _parse_default(d.pop("default", UNSET)) diff --git a/rootly_sdk/models/new_custom_field_option_data_attributes.py b/rootly_sdk/models/new_custom_field_option_data_attributes.py index b02253d4..6316c183 100644 --- a/rootly_sdk/models/new_custom_field_option_data_attributes.py +++ b/rootly_sdk/models/new_custom_field_option_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define @@ -19,9 +19,9 @@ class NewCustomFieldOptionDataAttributes: """ value: str - color: Union[Unset, str] = UNSET - default: Union[Unset, bool] = UNSET - position: Union[Unset, int] = UNSET + color: Unset | str = UNSET + default: Unset | bool = UNSET + position: Unset | int = UNSET def to_dict(self) -> dict[str, Any]: value = self.value diff --git a/rootly_sdk/models/new_custom_form_data_attributes.py b/rootly_sdk/models/new_custom_form_data_attributes.py index fba6ae44..dc91ded9 100644 --- a/rootly_sdk/models/new_custom_form_data_attributes.py +++ b/rootly_sdk/models/new_custom_form_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -22,22 +22,22 @@ class NewCustomFormDataAttributes: name: str command: str - slug: Union[None, Unset, str] = UNSET - description: Union[None, Unset, str] = UNSET - enabled: Union[Unset, bool] = UNSET + slug: None | Unset | str = UNSET + description: None | Unset | str = UNSET + enabled: Unset | bool = UNSET def to_dict(self) -> dict[str, Any]: name = self.name command = self.command - slug: Union[None, Unset, str] + slug: None | Unset | str if isinstance(self.slug, Unset): slug = UNSET else: slug = self.slug - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: @@ -69,21 +69,21 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: command = d.pop("command") - def _parse_slug(data: object) -> Union[None, Unset, str]: + def _parse_slug(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) slug = _parse_slug(d.pop("slug", UNSET)) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) diff --git a/rootly_sdk/models/new_dashboard_data_attributes.py b/rootly_sdk/models/new_dashboard_data_attributes.py index 0d84864f..81e91767 100644 --- a/rootly_sdk/models/new_dashboard_data_attributes.py +++ b/rootly_sdk/models/new_dashboard_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -37,20 +37,20 @@ class NewDashboardDataAttributes: name: str owner: NewDashboardDataAttributesOwner - description: Union[None, Unset, str] = UNSET - public: Union[Unset, bool] = UNSET - range_: Union[None, Unset, str] = UNSET - auto_refresh: Union[Unset, bool] = UNSET - color: Union[Unset, NewDashboardDataAttributesColor] = UNSET - icon: Union[Unset, str] = UNSET - period: Union[Unset, NewDashboardDataAttributesPeriod] = UNSET + description: None | Unset | str = UNSET + public: Unset | bool = UNSET + range_: None | Unset | str = UNSET + auto_refresh: Unset | bool = UNSET + color: Unset | NewDashboardDataAttributesColor = UNSET + icon: Unset | str = UNSET + period: Unset | NewDashboardDataAttributesPeriod = UNSET def to_dict(self) -> dict[str, Any]: name = self.name owner: str = self.owner - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: @@ -58,7 +58,7 @@ def to_dict(self) -> dict[str, Any]: public = self.public - range_: Union[None, Unset, str] + range_: None | Unset | str if isinstance(self.range_, Unset): range_ = UNSET else: @@ -66,13 +66,13 @@ def to_dict(self) -> dict[str, Any]: auto_refresh = self.auto_refresh - color: Union[Unset, str] = UNSET + color: Unset | str = UNSET if not isinstance(self.color, Unset): color = self.color icon = self.icon - period: Union[Unset, str] = UNSET + period: Unset | str = UNSET if not isinstance(self.period, Unset): period = self.period @@ -108,30 +108,30 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: owner = check_new_dashboard_data_attributes_owner(d.pop("owner")) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) public = d.pop("public", UNSET) - def _parse_range_(data: object) -> Union[None, Unset, str]: + def _parse_range_(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) range_ = _parse_range_(d.pop("range", UNSET)) auto_refresh = d.pop("auto_refresh", UNSET) _color = d.pop("color", UNSET) - color: Union[Unset, NewDashboardDataAttributesColor] + color: Unset | NewDashboardDataAttributesColor if isinstance(_color, Unset): color = UNSET else: @@ -140,7 +140,7 @@ def _parse_range_(data: object) -> Union[None, Unset, str]: icon = d.pop("icon", UNSET) _period = d.pop("period", UNSET) - period: Union[Unset, NewDashboardDataAttributesPeriod] + period: Unset | NewDashboardDataAttributesPeriod if isinstance(_period, Unset): period = UNSET else: diff --git a/rootly_sdk/models/new_dashboard_panel_data_attributes.py b/rootly_sdk/models/new_dashboard_panel_data_attributes.py index d81d40cb..26381827 100644 --- a/rootly_sdk/models/new_dashboard_panel_data_attributes.py +++ b/rootly_sdk/models/new_dashboard_panel_data_attributes.py @@ -25,7 +25,7 @@ class NewDashboardPanelDataAttributes: """ params: "NewDashboardPanelDataAttributesParams" - name: Union[None, Unset, str] = UNSET + name: None | Unset | str = UNSET position: Union["NewDashboardPanelDataAttributesPositionType0", None, Unset] = UNSET def to_dict(self) -> dict[str, Any]: @@ -35,13 +35,13 @@ def to_dict(self) -> dict[str, Any]: params = self.params.to_dict() - name: Union[None, Unset, str] + name: None | Unset | str if isinstance(self.name, Unset): name = UNSET else: name = self.name - position: Union[None, Unset, dict[str, Any]] + position: None | Unset | dict[str, Any] if isinstance(self.position, Unset): position = UNSET elif isinstance(self.position, NewDashboardPanelDataAttributesPositionType0): @@ -73,12 +73,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) params = NewDashboardPanelDataAttributesParams.from_dict(d.pop("params")) - def _parse_name(data: object) -> Union[None, Unset, str]: + def _parse_name(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) name = _parse_name(d.pop("name", UNSET)) diff --git a/rootly_sdk/models/new_dashboard_panel_data_attributes_params.py b/rootly_sdk/models/new_dashboard_panel_data_attributes_params.py index aadf6fd5..866c7b91 100644 --- a/rootly_sdk/models/new_dashboard_panel_data_attributes_params.py +++ b/rootly_sdk/models/new_dashboard_panel_data_attributes_params.py @@ -35,34 +35,34 @@ class NewDashboardPanelDataAttributesParams: datasets (Union[Unset, list['NewDashboardPanelDataAttributesParamsDatasetsItem']]): """ - display: Union[Unset, NewDashboardPanelDataAttributesParamsDisplay] = UNSET - description: Union[Unset, str] = UNSET - table_fields: Union[Unset, list[str]] = UNSET + display: Unset | NewDashboardPanelDataAttributesParamsDisplay = UNSET + description: Unset | str = UNSET + table_fields: Unset | list[str] = UNSET legend: Union[Unset, "NewDashboardPanelDataAttributesParamsLegend"] = UNSET datalabels: Union[Unset, "NewDashboardPanelDataAttributesParamsDatalabels"] = UNSET - datasets: Union[Unset, list["NewDashboardPanelDataAttributesParamsDatasetsItem"]] = UNSET + datasets: Unset | list["NewDashboardPanelDataAttributesParamsDatasetsItem"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - display: Union[Unset, str] = UNSET + display: Unset | str = UNSET if not isinstance(self.display, Unset): display = self.display description = self.description - table_fields: Union[Unset, list[str]] = UNSET + table_fields: Unset | list[str] = UNSET if not isinstance(self.table_fields, Unset): table_fields = self.table_fields - legend: Union[Unset, dict[str, Any]] = UNSET + legend: Unset | dict[str, Any] = UNSET if not isinstance(self.legend, Unset): legend = self.legend.to_dict() - datalabels: Union[Unset, dict[str, Any]] = UNSET + datalabels: Unset | dict[str, Any] = UNSET if not isinstance(self.datalabels, Unset): datalabels = self.datalabels.to_dict() - datasets: Union[Unset, list[dict[str, Any]]] = UNSET + datasets: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.datasets, Unset): datasets = [] for datasets_item_data in self.datasets: @@ -101,7 +101,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _display = d.pop("display", UNSET) - display: Union[Unset, NewDashboardPanelDataAttributesParamsDisplay] + display: Unset | NewDashboardPanelDataAttributesParamsDisplay if isinstance(_display, Unset): display = UNSET else: @@ -112,14 +112,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: table_fields = cast(list[str], d.pop("table_fields", UNSET)) _legend = d.pop("legend", UNSET) - legend: Union[Unset, NewDashboardPanelDataAttributesParamsLegend] + legend: Unset | NewDashboardPanelDataAttributesParamsLegend if isinstance(_legend, Unset): legend = UNSET else: legend = NewDashboardPanelDataAttributesParamsLegend.from_dict(_legend) _datalabels = d.pop("datalabels", UNSET) - datalabels: Union[Unset, NewDashboardPanelDataAttributesParamsDatalabels] + datalabels: Unset | NewDashboardPanelDataAttributesParamsDatalabels if isinstance(_datalabels, Unset): datalabels = UNSET else: diff --git a/rootly_sdk/models/new_dashboard_panel_data_attributes_params_datalabels.py b/rootly_sdk/models/new_dashboard_panel_data_attributes_params_datalabels.py index 3090bdc2..2293464d 100644 --- a/rootly_sdk/models/new_dashboard_panel_data_attributes_params_datalabels.py +++ b/rootly_sdk/models/new_dashboard_panel_data_attributes_params_datalabels.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,7 +16,7 @@ class NewDashboardPanelDataAttributesParamsDatalabels: enabled (Union[Unset, bool]): """ - enabled: Union[Unset, bool] = UNSET + enabled: Unset | bool = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/new_dashboard_panel_data_attributes_params_datasets_item.py b/rootly_sdk/models/new_dashboard_panel_data_attributes_params_datasets_item.py index 1c35197c..64e20254 100644 --- a/rootly_sdk/models/new_dashboard_panel_data_attributes_params_datasets_item.py +++ b/rootly_sdk/models/new_dashboard_panel_data_attributes_params_datasets_item.py @@ -36,9 +36,9 @@ class NewDashboardPanelDataAttributesParamsDatasetsItem: aggregate (Union['NewDashboardPanelDataAttributesParamsDatasetsItemAggregateType0', None, Unset]): """ - name: Union[None, Unset, str] = UNSET - collection: Union[Unset, NewDashboardPanelDataAttributesParamsDatasetsItemCollection] = UNSET - filter_: Union[Unset, list["NewDashboardPanelDataAttributesParamsDatasetsItemFilterItem"]] = UNSET + name: None | Unset | str = UNSET + collection: Unset | NewDashboardPanelDataAttributesParamsDatasetsItemCollection = UNSET + filter_: Unset | list["NewDashboardPanelDataAttributesParamsDatasetsItemFilterItem"] = UNSET group_by: Union["NewDashboardPanelDataAttributesParamsDatasetsItemGroupByType1Type0", None, Unset, str] = UNSET aggregate: Union["NewDashboardPanelDataAttributesParamsDatasetsItemAggregateType0", None, Unset] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -51,24 +51,24 @@ def to_dict(self) -> dict[str, Any]: NewDashboardPanelDataAttributesParamsDatasetsItemGroupByType1Type0, ) - name: Union[None, Unset, str] + name: None | Unset | str if isinstance(self.name, Unset): name = UNSET else: name = self.name - collection: Union[Unset, str] = UNSET + collection: Unset | str = UNSET if not isinstance(self.collection, Unset): collection = self.collection - filter_: Union[Unset, list[dict[str, Any]]] = UNSET + filter_: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.filter_, Unset): filter_ = [] for filter_item_data in self.filter_: filter_item = filter_item_data.to_dict() filter_.append(filter_item) - group_by: Union[None, Unset, dict[str, Any], str] + group_by: None | Unset | dict[str, Any] | str if isinstance(self.group_by, Unset): group_by = UNSET elif isinstance(self.group_by, NewDashboardPanelDataAttributesParamsDatasetsItemGroupByType1Type0): @@ -76,7 +76,7 @@ def to_dict(self) -> dict[str, Any]: else: group_by = self.group_by - aggregate: Union[None, Unset, dict[str, Any]] + aggregate: None | Unset | dict[str, Any] if isinstance(self.aggregate, Unset): aggregate = UNSET elif isinstance(self.aggregate, NewDashboardPanelDataAttributesParamsDatasetsItemAggregateType0): @@ -114,17 +114,17 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_name(data: object) -> Union[None, Unset, str]: + def _parse_name(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) name = _parse_name(d.pop("name", UNSET)) _collection = d.pop("collection", UNSET) - collection: Union[Unset, NewDashboardPanelDataAttributesParamsDatasetsItemCollection] + collection: Unset | NewDashboardPanelDataAttributesParamsDatasetsItemCollection if isinstance(_collection, Unset): collection = UNSET else: diff --git a/rootly_sdk/models/new_dashboard_panel_data_attributes_params_datasets_item_aggregate_type_0.py b/rootly_sdk/models/new_dashboard_panel_data_attributes_params_datasets_item_aggregate_type_0.py index f54c1d15..a92aa09f 100644 --- a/rootly_sdk/models/new_dashboard_panel_data_attributes_params_datasets_item_aggregate_type_0.py +++ b/rootly_sdk/models/new_dashboard_panel_data_attributes_params_datasets_item_aggregate_type_0.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,23 +22,23 @@ class NewDashboardPanelDataAttributesParamsDatasetsItemAggregateType0: cumulative (Union[None, Unset, bool]): """ - operation: Union[Unset, NewDashboardPanelDataAttributesParamsDatasetsItemAggregateType0Operation] = UNSET - key: Union[None, Unset, str] = UNSET - cumulative: Union[None, Unset, bool] = UNSET + operation: Unset | NewDashboardPanelDataAttributesParamsDatasetsItemAggregateType0Operation = UNSET + key: None | Unset | str = UNSET + cumulative: None | Unset | bool = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - operation: Union[Unset, str] = UNSET + operation: Unset | str = UNSET if not isinstance(self.operation, Unset): operation = self.operation - key: Union[None, Unset, str] + key: None | Unset | str if isinstance(self.key, Unset): key = UNSET else: key = self.key - cumulative: Union[None, Unset, bool] + cumulative: None | Unset | bool if isinstance(self.cumulative, Unset): cumulative = UNSET else: @@ -60,7 +60,7 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _operation = d.pop("operation", UNSET) - operation: Union[Unset, NewDashboardPanelDataAttributesParamsDatasetsItemAggregateType0Operation] + operation: Unset | NewDashboardPanelDataAttributesParamsDatasetsItemAggregateType0Operation if isinstance(_operation, Unset): operation = UNSET else: @@ -68,21 +68,21 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: _operation ) - def _parse_key(data: object) -> Union[None, Unset, str]: + def _parse_key(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) key = _parse_key(d.pop("key", UNSET)) - def _parse_cumulative(data: object) -> Union[None, Unset, bool]: + def _parse_cumulative(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) cumulative = _parse_cumulative(d.pop("cumulative", UNSET)) diff --git a/rootly_sdk/models/new_dashboard_panel_data_attributes_params_datasets_item_filter_item.py b/rootly_sdk/models/new_dashboard_panel_data_attributes_params_datasets_item_filter_item.py index 2995d60d..628c4993 100644 --- a/rootly_sdk/models/new_dashboard_panel_data_attributes_params_datasets_item_filter_item.py +++ b/rootly_sdk/models/new_dashboard_panel_data_attributes_params_datasets_item_filter_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -27,16 +27,16 @@ class NewDashboardPanelDataAttributesParamsDatasetsItemFilterItem: rules (Union[Unset, list['NewDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItem']]): """ - operation: Union[Unset, NewDashboardPanelDataAttributesParamsDatasetsItemFilterItemOperation] = UNSET - rules: Union[Unset, list["NewDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItem"]] = UNSET + operation: Unset | NewDashboardPanelDataAttributesParamsDatasetsItemFilterItemOperation = UNSET + rules: Unset | list["NewDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItem"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - operation: Union[Unset, str] = UNSET + operation: Unset | str = UNSET if not isinstance(self.operation, Unset): operation = self.operation - rules: Union[Unset, list[dict[str, Any]]] = UNSET + rules: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.rules, Unset): rules = [] for rules_item_data in self.rules: @@ -61,7 +61,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _operation = d.pop("operation", UNSET) - operation: Union[Unset, NewDashboardPanelDataAttributesParamsDatasetsItemFilterItemOperation] + operation: Unset | NewDashboardPanelDataAttributesParamsDatasetsItemFilterItemOperation if isinstance(_operation, Unset): operation = UNSET else: diff --git a/rootly_sdk/models/new_dashboard_panel_data_attributes_params_datasets_item_filter_item_rules_item.py b/rootly_sdk/models/new_dashboard_panel_data_attributes_params_datasets_item_filter_item_rules_item.py index c6659413..64adb14c 100644 --- a/rootly_sdk/models/new_dashboard_panel_data_attributes_params_datasets_item_filter_item_rules_item.py +++ b/rootly_sdk/models/new_dashboard_panel_data_attributes_params_datasets_item_filter_item_rules_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -27,18 +27,18 @@ class NewDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItem: value (Union[Unset, str]): """ - operation: Union[Unset, NewDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItemOperation] = UNSET - condition: Union[Unset, NewDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItemCondition] = UNSET - key: Union[Unset, str] = UNSET - value: Union[Unset, str] = UNSET + operation: Unset | NewDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItemOperation = UNSET + condition: Unset | NewDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItemCondition = UNSET + key: Unset | str = UNSET + value: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - operation: Union[Unset, str] = UNSET + operation: Unset | str = UNSET if not isinstance(self.operation, Unset): operation = self.operation - condition: Union[Unset, str] = UNSET + condition: Unset | str = UNSET if not isinstance(self.condition, Unset): condition = self.condition @@ -64,7 +64,7 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _operation = d.pop("operation", UNSET) - operation: Union[Unset, NewDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItemOperation] + operation: Unset | NewDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItemOperation if isinstance(_operation, Unset): operation = UNSET else: @@ -73,7 +73,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: ) _condition = d.pop("condition", UNSET) - condition: Union[Unset, NewDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItemCondition] + condition: Unset | NewDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItemCondition if isinstance(_condition, Unset): condition = UNSET else: diff --git a/rootly_sdk/models/new_dashboard_panel_data_attributes_params_legend.py b/rootly_sdk/models/new_dashboard_panel_data_attributes_params_legend.py index 45cfea4e..2b500d0d 100644 --- a/rootly_sdk/models/new_dashboard_panel_data_attributes_params_legend.py +++ b/rootly_sdk/models/new_dashboard_panel_data_attributes_params_legend.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -20,11 +20,11 @@ class NewDashboardPanelDataAttributesParamsLegend: groups (Union[Unset, NewDashboardPanelDataAttributesParamsLegendGroups]): Default: 'all'. """ - groups: Union[Unset, NewDashboardPanelDataAttributesParamsLegendGroups] = "all" + groups: Unset | NewDashboardPanelDataAttributesParamsLegendGroups = "all" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - groups: Union[Unset, str] = UNSET + groups: Unset | str = UNSET if not isinstance(self.groups, Unset): groups = self.groups @@ -40,7 +40,7 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _groups = d.pop("groups", UNSET) - groups: Union[Unset, NewDashboardPanelDataAttributesParamsLegendGroups] + groups: Unset | NewDashboardPanelDataAttributesParamsLegendGroups if isinstance(_groups, Unset): groups = UNSET else: diff --git a/rootly_sdk/models/new_edge_connector_action_action.py b/rootly_sdk/models/new_edge_connector_action_action.py index 758e00ee..0d749327 100644 --- a/rootly_sdk/models/new_edge_connector_action_action.py +++ b/rootly_sdk/models/new_edge_connector_action_action.py @@ -36,7 +36,7 @@ def to_dict(self) -> dict[str, Any]: action_type: str = self.action_type - metadata: Union[Unset, dict[str, Any]] = UNSET + metadata: Unset | dict[str, Any] = UNSET if not isinstance(self.metadata, Unset): metadata = self.metadata.to_dict() @@ -63,7 +63,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: action_type = check_new_edge_connector_action_action_action_type(d.pop("action_type")) _metadata = d.pop("metadata", UNSET) - metadata: Union[Unset, NewEdgeConnectorActionActionMetadata] + metadata: Unset | NewEdgeConnectorActionActionMetadata if isinstance(_metadata, Unset): metadata = UNSET else: diff --git a/rootly_sdk/models/new_edge_connector_action_action_metadata.py b/rootly_sdk/models/new_edge_connector_action_action_metadata.py index fae24058..2af21e6c 100644 --- a/rootly_sdk/models/new_edge_connector_action_action_metadata.py +++ b/rootly_sdk/models/new_edge_connector_action_action_metadata.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,30 +29,30 @@ class NewEdgeConnectorActionActionMetadata: parameters (Union[None, Unset, list['NewEdgeConnectorActionActionMetadataParametersType0Item']]): """ - description: Union[None, Unset, str] = UNSET - timeout: Union[None, Unset, int] = UNSET - icon: Union[Unset, NewEdgeConnectorActionActionMetadataIcon] = UNSET - parameters: Union[None, Unset, list["NewEdgeConnectorActionActionMetadataParametersType0Item"]] = UNSET + description: None | Unset | str = UNSET + timeout: None | Unset | int = UNSET + icon: Unset | NewEdgeConnectorActionActionMetadataIcon = UNSET + parameters: None | Unset | list["NewEdgeConnectorActionActionMetadataParametersType0Item"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - timeout: Union[None, Unset, int] + timeout: None | Unset | int if isinstance(self.timeout, Unset): timeout = UNSET else: timeout = self.timeout - icon: Union[Unset, str] = UNSET + icon: Unset | str = UNSET if not isinstance(self.icon, Unset): icon = self.icon - parameters: Union[None, Unset, list[dict[str, Any]]] + parameters: None | Unset | list[dict[str, Any]] if isinstance(self.parameters, Unset): parameters = UNSET elif isinstance(self.parameters, list): @@ -86,26 +86,26 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_timeout(data: object) -> Union[None, Unset, int]: + def _parse_timeout(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) timeout = _parse_timeout(d.pop("timeout", UNSET)) _icon = d.pop("icon", UNSET) - icon: Union[Unset, NewEdgeConnectorActionActionMetadataIcon] + icon: Unset | NewEdgeConnectorActionActionMetadataIcon if isinstance(_icon, Unset): icon = UNSET else: @@ -113,7 +113,7 @@ def _parse_timeout(data: object) -> Union[None, Unset, int]: def _parse_parameters( data: object, - ) -> Union[None, Unset, list["NewEdgeConnectorActionActionMetadataParametersType0Item"]]: + ) -> None | Unset | list["NewEdgeConnectorActionActionMetadataParametersType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -133,7 +133,7 @@ def _parse_parameters( return parameters_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list["NewEdgeConnectorActionActionMetadataParametersType0Item"]], data) + return cast(None | Unset | list["NewEdgeConnectorActionActionMetadataParametersType0Item"], data) parameters = _parse_parameters(d.pop("parameters", UNSET)) diff --git a/rootly_sdk/models/new_edge_connector_action_action_metadata_parameters_type_0_item.py b/rootly_sdk/models/new_edge_connector_action_action_metadata_parameters_type_0_item.py index e1ed3967..3d886db6 100644 --- a/rootly_sdk/models/new_edge_connector_action_action_metadata_parameters_type_0_item.py +++ b/rootly_sdk/models/new_edge_connector_action_action_metadata_parameters_type_0_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -25,36 +25,36 @@ class NewEdgeConnectorActionActionMetadataParametersType0Item: options (Union[None, Unset, list[str]]): """ - name: Union[Unset, str] = UNSET - type_: Union[Unset, NewEdgeConnectorActionActionMetadataParametersType0ItemType] = UNSET - required: Union[Unset, bool] = UNSET - description: Union[None, Unset, str] = UNSET - default: Union[None, Unset, str] = UNSET - options: Union[None, Unset, list[str]] = UNSET + name: Unset | str = UNSET + type_: Unset | NewEdgeConnectorActionActionMetadataParametersType0ItemType = UNSET + required: Unset | bool = UNSET + description: None | Unset | str = UNSET + default: None | Unset | str = UNSET + options: None | Unset | list[str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: name = self.name - type_: Union[Unset, str] = UNSET + type_: Unset | str = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ required = self.required - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - default: Union[None, Unset, str] + default: None | Unset | str if isinstance(self.default, Unset): default = UNSET else: default = self.default - options: Union[None, Unset, list[str]] + options: None | Unset | list[str] if isinstance(self.options, Unset): options = UNSET elif isinstance(self.options, list): @@ -87,7 +87,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name = d.pop("name", UNSET) _type_ = d.pop("type", UNSET) - type_: Union[Unset, NewEdgeConnectorActionActionMetadataParametersType0ItemType] + type_: Unset | NewEdgeConnectorActionActionMetadataParametersType0ItemType if isinstance(_type_, Unset): type_ = UNSET else: @@ -95,25 +95,25 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: required = d.pop("required", UNSET) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_default(data: object) -> Union[None, Unset, str]: + def _parse_default(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) default = _parse_default(d.pop("default", UNSET)) - def _parse_options(data: object) -> Union[None, Unset, list[str]]: + def _parse_options(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -126,7 +126,7 @@ def _parse_options(data: object) -> Union[None, Unset, list[str]]: return options_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) options = _parse_options(d.pop("options", UNSET)) diff --git a/rootly_sdk/models/new_edge_connector_edge_connector.py b/rootly_sdk/models/new_edge_connector_edge_connector.py index 92174a8c..1a8c5d5c 100644 --- a/rootly_sdk/models/new_edge_connector_edge_connector.py +++ b/rootly_sdk/models/new_edge_connector_edge_connector.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -24,25 +24,25 @@ class NewEdgeConnectorEdgeConnector: """ name: str - description: Union[None, Unset, str] = UNSET - status: Union[Unset, NewEdgeConnectorEdgeConnectorStatus] = UNSET - subscriptions: Union[Unset, list[str]] = UNSET + description: None | Unset | str = UNSET + status: Unset | NewEdgeConnectorEdgeConnectorStatus = UNSET + subscriptions: Unset | list[str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: name = self.name - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - status: Union[Unset, str] = UNSET + status: Unset | str = UNSET if not isinstance(self.status, Unset): status = self.status - subscriptions: Union[Unset, list[str]] = UNSET + subscriptions: Unset | list[str] = UNSET if not isinstance(self.subscriptions, Unset): subscriptions = self.subscriptions @@ -67,17 +67,17 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name") - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) _status = d.pop("status", UNSET) - status: Union[Unset, NewEdgeConnectorEdgeConnectorStatus] + status: Unset | NewEdgeConnectorEdgeConnectorStatus if isinstance(_status, Unset): status = UNSET else: diff --git a/rootly_sdk/models/new_environment_data_attributes.py b/rootly_sdk/models/new_environment_data_attributes.py index c893d272..654b7bf5 100644 --- a/rootly_sdk/models/new_environment_data_attributes.py +++ b/rootly_sdk/models/new_environment_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define @@ -40,57 +40,57 @@ class NewEnvironmentDataAttributes: """ name: str - slug: Union[None, Unset, str] = UNSET - description: Union[None, Unset, str] = UNSET - public_description: Union[None, Unset, str] = UNSET - color: Union[None, Unset, str] = UNSET - position: Union[None, Unset, int] = UNSET - external_id: Union[None, Unset, str] = UNSET - notify_emails: Union[None, Unset, list[str]] = UNSET - slack_channels: Union[None, Unset, list["NewEnvironmentDataAttributesSlackChannelsType0Item"]] = UNSET - slack_aliases: Union[None, Unset, list["NewEnvironmentDataAttributesSlackAliasesType0Item"]] = UNSET - properties: Union[Unset, list["NewEnvironmentDataAttributesPropertiesItem"]] = UNSET + slug: None | Unset | str = UNSET + description: None | Unset | str = UNSET + public_description: None | Unset | str = UNSET + color: None | Unset | str = UNSET + position: None | Unset | int = UNSET + external_id: None | Unset | str = UNSET + notify_emails: None | Unset | list[str] = UNSET + slack_channels: None | Unset | list["NewEnvironmentDataAttributesSlackChannelsType0Item"] = UNSET + slack_aliases: None | Unset | list["NewEnvironmentDataAttributesSlackAliasesType0Item"] = UNSET + properties: Unset | list["NewEnvironmentDataAttributesPropertiesItem"] = UNSET def to_dict(self) -> dict[str, Any]: name = self.name - slug: Union[None, Unset, str] + slug: None | Unset | str if isinstance(self.slug, Unset): slug = UNSET else: slug = self.slug - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - public_description: Union[None, Unset, str] + public_description: None | Unset | str if isinstance(self.public_description, Unset): public_description = UNSET else: public_description = self.public_description - color: Union[None, Unset, str] + color: None | Unset | str if isinstance(self.color, Unset): color = UNSET else: color = self.color - position: Union[None, Unset, int] + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: position = self.position - external_id: Union[None, Unset, str] + external_id: None | Unset | str if isinstance(self.external_id, Unset): external_id = UNSET else: external_id = self.external_id - notify_emails: Union[None, Unset, list[str]] + notify_emails: None | Unset | list[str] if isinstance(self.notify_emails, Unset): notify_emails = UNSET elif isinstance(self.notify_emails, list): @@ -99,7 +99,7 @@ def to_dict(self) -> dict[str, Any]: else: notify_emails = self.notify_emails - slack_channels: Union[None, Unset, list[dict[str, Any]]] + slack_channels: None | Unset | list[dict[str, Any]] if isinstance(self.slack_channels, Unset): slack_channels = UNSET elif isinstance(self.slack_channels, list): @@ -111,7 +111,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_channels = self.slack_channels - slack_aliases: Union[None, Unset, list[dict[str, Any]]] + slack_aliases: None | Unset | list[dict[str, Any]] if isinstance(self.slack_aliases, Unset): slack_aliases = UNSET elif isinstance(self.slack_aliases, list): @@ -123,7 +123,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_aliases = self.slack_aliases - properties: Union[Unset, list[dict[str, Any]]] = UNSET + properties: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.properties, Unset): properties = [] for properties_item_data in self.properties: @@ -173,61 +173,61 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name") - def _parse_slug(data: object) -> Union[None, Unset, str]: + def _parse_slug(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) slug = _parse_slug(d.pop("slug", UNSET)) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_public_description(data: object) -> Union[None, Unset, str]: + def _parse_public_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) public_description = _parse_public_description(d.pop("public_description", UNSET)) - def _parse_color(data: object) -> Union[None, Unset, str]: + def _parse_color(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) color = _parse_color(d.pop("color", UNSET)) - def _parse_position(data: object) -> Union[None, Unset, int]: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) - def _parse_external_id(data: object) -> Union[None, Unset, str]: + def _parse_external_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) external_id = _parse_external_id(d.pop("external_id", UNSET)) - def _parse_notify_emails(data: object) -> Union[None, Unset, list[str]]: + def _parse_notify_emails(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -240,13 +240,13 @@ def _parse_notify_emails(data: object) -> Union[None, Unset, list[str]]: return notify_emails_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) notify_emails = _parse_notify_emails(d.pop("notify_emails", UNSET)) def _parse_slack_channels( data: object, - ) -> Union[None, Unset, list["NewEnvironmentDataAttributesSlackChannelsType0Item"]]: + ) -> None | Unset | list["NewEnvironmentDataAttributesSlackChannelsType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -266,13 +266,13 @@ def _parse_slack_channels( return slack_channels_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list["NewEnvironmentDataAttributesSlackChannelsType0Item"]], data) + return cast(None | Unset | list["NewEnvironmentDataAttributesSlackChannelsType0Item"], data) slack_channels = _parse_slack_channels(d.pop("slack_channels", UNSET)) def _parse_slack_aliases( data: object, - ) -> Union[None, Unset, list["NewEnvironmentDataAttributesSlackAliasesType0Item"]]: + ) -> None | Unset | list["NewEnvironmentDataAttributesSlackAliasesType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -292,7 +292,7 @@ def _parse_slack_aliases( return slack_aliases_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list["NewEnvironmentDataAttributesSlackAliasesType0Item"]], data) + return cast(None | Unset | list["NewEnvironmentDataAttributesSlackAliasesType0Item"], data) slack_aliases = _parse_slack_aliases(d.pop("slack_aliases", UNSET)) diff --git a/rootly_sdk/models/new_escalation_policy_data_attributes.py b/rootly_sdk/models/new_escalation_policy_data_attributes.py index 7f1317c8..79022943 100644 --- a/rootly_sdk/models/new_escalation_policy_data_attributes.py +++ b/rootly_sdk/models/new_escalation_policy_data_attributes.py @@ -28,10 +28,10 @@ class NewEscalationPolicyDataAttributes: """ name: str - description: Union[None, Unset, str] = UNSET - repeat_count: Union[Unset, int] = UNSET - group_ids: Union[Unset, list[str]] = UNSET - service_ids: Union[Unset, list[str]] = UNSET + description: None | Unset | str = UNSET + repeat_count: Unset | int = UNSET + group_ids: Unset | list[str] = UNSET + service_ids: Unset | list[str] = UNSET business_hours: Union["NewEscalationPolicyDataAttributesBusinessHoursType0", None, Unset] = UNSET def to_dict(self) -> dict[str, Any]: @@ -41,7 +41,7 @@ def to_dict(self) -> dict[str, Any]: name = self.name - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: @@ -49,15 +49,15 @@ def to_dict(self) -> dict[str, Any]: repeat_count = self.repeat_count - group_ids: Union[Unset, list[str]] = UNSET + group_ids: Unset | list[str] = UNSET if not isinstance(self.group_ids, Unset): group_ids = self.group_ids - service_ids: Union[Unset, list[str]] = UNSET + service_ids: Unset | list[str] = UNSET if not isinstance(self.service_ids, Unset): service_ids = self.service_ids - business_hours: Union[None, Unset, dict[str, Any]] + business_hours: None | Unset | dict[str, Any] if isinstance(self.business_hours, Unset): business_hours = UNSET elif isinstance(self.business_hours, NewEscalationPolicyDataAttributesBusinessHoursType0): @@ -94,12 +94,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name") - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) diff --git a/rootly_sdk/models/new_escalation_policy_data_attributes_business_hours_type_0.py b/rootly_sdk/models/new_escalation_policy_data_attributes_business_hours_type_0.py index 05ef0d16..3b974e86 100644 --- a/rootly_sdk/models/new_escalation_policy_data_attributes_business_hours_type_0.py +++ b/rootly_sdk/models/new_escalation_policy_data_attributes_business_hours_type_0.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -28,18 +28,18 @@ class NewEscalationPolicyDataAttributesBusinessHoursType0: end_time (Union[None, Unset, str]): End time for business hours (HH:MM) """ - time_zone: Union[Unset, NewEscalationPolicyDataAttributesBusinessHoursType0TimeZone] = UNSET - days: Union[None, Unset, list[NewEscalationPolicyDataAttributesBusinessHoursType0DaysType0Item]] = UNSET - start_time: Union[None, Unset, str] = UNSET - end_time: Union[None, Unset, str] = UNSET + time_zone: Unset | NewEscalationPolicyDataAttributesBusinessHoursType0TimeZone = UNSET + days: None | Unset | list[NewEscalationPolicyDataAttributesBusinessHoursType0DaysType0Item] = UNSET + start_time: None | Unset | str = UNSET + end_time: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - time_zone: Union[Unset, str] = UNSET + time_zone: Unset | str = UNSET if not isinstance(self.time_zone, Unset): time_zone = self.time_zone - days: Union[None, Unset, list[str]] + days: None | Unset | list[str] if isinstance(self.days, Unset): days = UNSET elif isinstance(self.days, list): @@ -51,13 +51,13 @@ def to_dict(self) -> dict[str, Any]: else: days = self.days - start_time: Union[None, Unset, str] + start_time: None | Unset | str if isinstance(self.start_time, Unset): start_time = UNSET else: start_time = self.start_time - end_time: Union[None, Unset, str] + end_time: None | Unset | str if isinstance(self.end_time, Unset): end_time = UNSET else: @@ -81,7 +81,7 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _time_zone = d.pop("time_zone", UNSET) - time_zone: Union[Unset, NewEscalationPolicyDataAttributesBusinessHoursType0TimeZone] + time_zone: Unset | NewEscalationPolicyDataAttributesBusinessHoursType0TimeZone if isinstance(_time_zone, Unset): time_zone = UNSET else: @@ -89,7 +89,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: def _parse_days( data: object, - ) -> Union[None, Unset, list[NewEscalationPolicyDataAttributesBusinessHoursType0DaysType0Item]]: + ) -> None | Unset | list[NewEscalationPolicyDataAttributesBusinessHoursType0DaysType0Item]: if data is None: return data if isinstance(data, Unset): @@ -111,27 +111,25 @@ def _parse_days( return days_type_0 except: # noqa: E722 pass - return cast( - Union[None, Unset, list[NewEscalationPolicyDataAttributesBusinessHoursType0DaysType0Item]], data - ) + return cast(None | Unset | list[NewEscalationPolicyDataAttributesBusinessHoursType0DaysType0Item], data) days = _parse_days(d.pop("days", UNSET)) - def _parse_start_time(data: object) -> Union[None, Unset, str]: + def _parse_start_time(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) start_time = _parse_start_time(d.pop("start_time", UNSET)) - def _parse_end_time(data: object) -> Union[None, Unset, str]: + def _parse_end_time(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) end_time = _parse_end_time(d.pop("end_time", UNSET)) diff --git a/rootly_sdk/models/new_escalation_policy_level_data_attributes.py b/rootly_sdk/models/new_escalation_policy_level_data_attributes.py index b92c2f8e..1ada703f 100644 --- a/rootly_sdk/models/new_escalation_policy_level_data_attributes.py +++ b/rootly_sdk/models/new_escalation_policy_level_data_attributes.py @@ -61,22 +61,22 @@ class NewEscalationPolicyLevelDataAttributes: notification_target_params: list[ Union["NewEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0", None] ] - delay: Union[Unset, int] = UNSET - paging_strategy_configuration_strategy: Union[ - Unset, NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationStrategy - ] = "default" - paging_strategy_configuration_schedule_strategy: Union[ - Unset, NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationScheduleStrategy - ] = "on_call_only" - paging_strategy_configuration_repeats: Union[None, Unset, int] = UNSET - paging_strategy_configuration_repeats_mode: Union[ - Unset, NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRepeatsMode - ] = UNSET - paging_strategy_configuration_rotation_scope: Union[ - Unset, NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRotationScope - ] = UNSET - paging_strategy_configuration_page_users_count: Union[None, Unset, int] = UNSET - escalation_policy_path_id: Union[None, Unset, str] = UNSET + delay: Unset | int = UNSET + paging_strategy_configuration_strategy: ( + Unset | NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationStrategy + ) = "default" + paging_strategy_configuration_schedule_strategy: ( + Unset | NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationScheduleStrategy + ) = "on_call_only" + paging_strategy_configuration_repeats: None | Unset | int = UNSET + paging_strategy_configuration_repeats_mode: ( + Unset | NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRepeatsMode + ) = UNSET + paging_strategy_configuration_rotation_scope: ( + Unset | NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRotationScope + ) = UNSET + paging_strategy_configuration_page_users_count: None | Unset | int = UNSET + escalation_policy_path_id: None | Unset | str = UNSET def to_dict(self) -> dict[str, Any]: from ..models.new_escalation_policy_level_data_attributes_notification_target_params_item_type_0 import ( @@ -87,7 +87,7 @@ def to_dict(self) -> dict[str, Any]: notification_target_params = [] for notification_target_params_item_data in self.notification_target_params: - notification_target_params_item: Union[None, dict[str, Any]] + notification_target_params_item: None | dict[str, Any] if isinstance( notification_target_params_item_data, NewEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0, @@ -99,35 +99,35 @@ def to_dict(self) -> dict[str, Any]: delay = self.delay - paging_strategy_configuration_strategy: Union[Unset, str] = UNSET + paging_strategy_configuration_strategy: Unset | str = UNSET if not isinstance(self.paging_strategy_configuration_strategy, Unset): paging_strategy_configuration_strategy = self.paging_strategy_configuration_strategy - paging_strategy_configuration_schedule_strategy: Union[Unset, str] = UNSET + paging_strategy_configuration_schedule_strategy: Unset | str = UNSET if not isinstance(self.paging_strategy_configuration_schedule_strategy, Unset): paging_strategy_configuration_schedule_strategy = self.paging_strategy_configuration_schedule_strategy - paging_strategy_configuration_repeats: Union[None, Unset, int] + paging_strategy_configuration_repeats: None | Unset | int if isinstance(self.paging_strategy_configuration_repeats, Unset): paging_strategy_configuration_repeats = UNSET else: paging_strategy_configuration_repeats = self.paging_strategy_configuration_repeats - paging_strategy_configuration_repeats_mode: Union[Unset, str] = UNSET + paging_strategy_configuration_repeats_mode: Unset | str = UNSET if not isinstance(self.paging_strategy_configuration_repeats_mode, Unset): paging_strategy_configuration_repeats_mode = self.paging_strategy_configuration_repeats_mode - paging_strategy_configuration_rotation_scope: Union[Unset, str] = UNSET + paging_strategy_configuration_rotation_scope: Unset | str = UNSET if not isinstance(self.paging_strategy_configuration_rotation_scope, Unset): paging_strategy_configuration_rotation_scope = self.paging_strategy_configuration_rotation_scope - paging_strategy_configuration_page_users_count: Union[None, Unset, int] + paging_strategy_configuration_page_users_count: None | Unset | int if isinstance(self.paging_strategy_configuration_page_users_count, Unset): paging_strategy_configuration_page_users_count = UNSET else: paging_strategy_configuration_page_users_count = self.paging_strategy_configuration_page_users_count - escalation_policy_path_id: Union[None, Unset, str] + escalation_policy_path_id: None | Unset | str if isinstance(self.escalation_policy_path_id, Unset): escalation_policy_path_id = UNSET else: @@ -205,9 +205,9 @@ def _parse_notification_target_params_item( delay = d.pop("delay", UNSET) _paging_strategy_configuration_strategy = d.pop("paging_strategy_configuration_strategy", UNSET) - paging_strategy_configuration_strategy: Union[ - Unset, NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationStrategy - ] + paging_strategy_configuration_strategy: ( + Unset | NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationStrategy + ) if isinstance(_paging_strategy_configuration_strategy, Unset): paging_strategy_configuration_strategy = UNSET else: @@ -220,9 +220,9 @@ def _parse_notification_target_params_item( _paging_strategy_configuration_schedule_strategy = d.pop( "paging_strategy_configuration_schedule_strategy", UNSET ) - paging_strategy_configuration_schedule_strategy: Union[ - Unset, NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationScheduleStrategy - ] + paging_strategy_configuration_schedule_strategy: ( + Unset | NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationScheduleStrategy + ) if isinstance(_paging_strategy_configuration_schedule_strategy, Unset): paging_strategy_configuration_schedule_strategy = UNSET else: @@ -232,21 +232,21 @@ def _parse_notification_target_params_item( ) ) - def _parse_paging_strategy_configuration_repeats(data: object) -> Union[None, Unset, int]: + def _parse_paging_strategy_configuration_repeats(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) paging_strategy_configuration_repeats = _parse_paging_strategy_configuration_repeats( d.pop("paging_strategy_configuration_repeats", UNSET) ) _paging_strategy_configuration_repeats_mode = d.pop("paging_strategy_configuration_repeats_mode", UNSET) - paging_strategy_configuration_repeats_mode: Union[ - Unset, NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRepeatsMode - ] + paging_strategy_configuration_repeats_mode: ( + Unset | NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRepeatsMode + ) if isinstance(_paging_strategy_configuration_repeats_mode, Unset): paging_strategy_configuration_repeats_mode = UNSET else: @@ -257,9 +257,9 @@ def _parse_paging_strategy_configuration_repeats(data: object) -> Union[None, Un ) _paging_strategy_configuration_rotation_scope = d.pop("paging_strategy_configuration_rotation_scope", UNSET) - paging_strategy_configuration_rotation_scope: Union[ - Unset, NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRotationScope - ] + paging_strategy_configuration_rotation_scope: ( + Unset | NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRotationScope + ) if isinstance(_paging_strategy_configuration_rotation_scope, Unset): paging_strategy_configuration_rotation_scope = UNSET else: @@ -269,23 +269,23 @@ def _parse_paging_strategy_configuration_repeats(data: object) -> Union[None, Un ) ) - def _parse_paging_strategy_configuration_page_users_count(data: object) -> Union[None, Unset, int]: + def _parse_paging_strategy_configuration_page_users_count(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) paging_strategy_configuration_page_users_count = _parse_paging_strategy_configuration_page_users_count( d.pop("paging_strategy_configuration_page_users_count", UNSET) ) - def _parse_escalation_policy_path_id(data: object) -> Union[None, Unset, str]: + def _parse_escalation_policy_path_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) escalation_policy_path_id = _parse_escalation_policy_path_id(d.pop("escalation_policy_path_id", UNSET)) diff --git a/rootly_sdk/models/new_escalation_policy_level_data_attributes_notification_target_params_item_type_0.py b/rootly_sdk/models/new_escalation_policy_level_data_attributes_notification_target_params_item_type_0.py index 7c1e735b..fa456696 100644 --- a/rootly_sdk/models/new_escalation_policy_level_data_attributes_notification_target_params_item_type_0.py +++ b/rootly_sdk/models/new_escalation_policy_level_data_attributes_notification_target_params_item_type_0.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -31,9 +31,7 @@ class NewEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0: id: str type_: NewEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0Type - team_members: Union[Unset, NewEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0TeamMembers] = ( - UNSET - ) + team_members: Unset | NewEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0TeamMembers = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -41,7 +39,7 @@ def to_dict(self) -> dict[str, Any]: type_: str = self.type_ - team_members: Union[Unset, str] = UNSET + team_members: Unset | str = UNSET if not isinstance(self.team_members, Unset): team_members = self.team_members @@ -68,7 +66,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: ) _team_members = d.pop("team_members", UNSET) - team_members: Union[Unset, NewEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0TeamMembers] + team_members: Unset | NewEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0TeamMembers if isinstance(_team_members, Unset): team_members = UNSET else: diff --git a/rootly_sdk/models/new_escalation_policy_path_data_attributes.py b/rootly_sdk/models/new_escalation_policy_path_data_attributes.py index c106d139..2e64dd84 100644 --- a/rootly_sdk/models/new_escalation_policy_path_data_attributes.py +++ b/rootly_sdk/models/new_escalation_policy_path_data_attributes.py @@ -94,20 +94,20 @@ class NewEscalationPolicyPathDataAttributes: """ name: str - notification_type: Union[Unset, NewEscalationPolicyPathDataAttributesNotificationType] = "audible" - path_type: Union[Unset, NewEscalationPolicyPathDataAttributesPathType] = "escalation" - after_deferral_behavior: Union[Unset, NewEscalationPolicyPathDataAttributesAfterDeferralBehavior] = UNSET - after_deferral_path_id: Union[None, Unset, str] = UNSET - default: Union[None, Unset, bool] = UNSET - match_mode: Union[Unset, NewEscalationPolicyPathDataAttributesMatchMode] = "match-all-rules" - position: Union[Unset, int] = UNSET - repeat: Union[None, Unset, bool] = UNSET - repeat_count: Union[None, Unset, int] = UNSET - initial_delay: Union[Unset, int] = UNSET - retrigger_timeout_minutes: Union[None, Unset, int] = UNSET - rules: Union[ - Unset, - list[ + notification_type: Unset | NewEscalationPolicyPathDataAttributesNotificationType = "audible" + path_type: Unset | NewEscalationPolicyPathDataAttributesPathType = "escalation" + after_deferral_behavior: Unset | NewEscalationPolicyPathDataAttributesAfterDeferralBehavior = UNSET + after_deferral_path_id: None | Unset | str = UNSET + default: None | Unset | bool = UNSET + match_mode: Unset | NewEscalationPolicyPathDataAttributesMatchMode = "match-all-rules" + position: Unset | int = UNSET + repeat: None | Unset | bool = UNSET + repeat_count: None | Unset | int = UNSET + initial_delay: Unset | int = UNSET + retrigger_timeout_minutes: None | Unset | int = UNSET + rules: ( + Unset + | list[ Union[ "NewEscalationPolicyPathDataAttributesRulesItemType0", "NewEscalationPolicyPathDataAttributesRulesItemType1", @@ -118,10 +118,10 @@ class NewEscalationPolicyPathDataAttributes: "NewEscalationPolicyPathDataAttributesRulesItemType6", "NewEscalationPolicyPathDataAttributesRulesItemType7", ] - ], - ] = UNSET - time_restriction_time_zone: Union[Unset, NewEscalationPolicyPathDataAttributesTimeRestrictionTimeZone] = UNSET - time_restrictions: Union[Unset, list["NewEscalationPolicyPathDataAttributesTimeRestrictionsItem"]] = UNSET + ] + ) = UNSET + time_restriction_time_zone: Unset | NewEscalationPolicyPathDataAttributesTimeRestrictionTimeZone = UNSET + time_restrictions: Unset | list["NewEscalationPolicyPathDataAttributesTimeRestrictionsItem"] = UNSET def to_dict(self) -> dict[str, Any]: from ..models.new_escalation_policy_path_data_attributes_rules_item_type_0 import ( @@ -148,43 +148,43 @@ def to_dict(self) -> dict[str, Any]: name = self.name - notification_type: Union[Unset, str] = UNSET + notification_type: Unset | str = UNSET if not isinstance(self.notification_type, Unset): notification_type = self.notification_type - path_type: Union[Unset, str] = UNSET + path_type: Unset | str = UNSET if not isinstance(self.path_type, Unset): path_type = self.path_type - after_deferral_behavior: Union[Unset, str] = UNSET + after_deferral_behavior: Unset | str = UNSET if not isinstance(self.after_deferral_behavior, Unset): after_deferral_behavior = self.after_deferral_behavior - after_deferral_path_id: Union[None, Unset, str] + after_deferral_path_id: None | Unset | str if isinstance(self.after_deferral_path_id, Unset): after_deferral_path_id = UNSET else: after_deferral_path_id = self.after_deferral_path_id - default: Union[None, Unset, bool] + default: None | Unset | bool if isinstance(self.default, Unset): default = UNSET else: default = self.default - match_mode: Union[Unset, str] = UNSET + match_mode: Unset | str = UNSET if not isinstance(self.match_mode, Unset): match_mode = self.match_mode position = self.position - repeat: Union[None, Unset, bool] + repeat: None | Unset | bool if isinstance(self.repeat, Unset): repeat = UNSET else: repeat = self.repeat - repeat_count: Union[None, Unset, int] + repeat_count: None | Unset | int if isinstance(self.repeat_count, Unset): repeat_count = UNSET else: @@ -192,13 +192,13 @@ def to_dict(self) -> dict[str, Any]: initial_delay = self.initial_delay - retrigger_timeout_minutes: Union[None, Unset, int] + retrigger_timeout_minutes: None | Unset | int if isinstance(self.retrigger_timeout_minutes, Unset): retrigger_timeout_minutes = UNSET else: retrigger_timeout_minutes = self.retrigger_timeout_minutes - rules: Union[Unset, list[dict[str, Any]]] = UNSET + rules: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.rules, Unset): rules = [] for rules_item_data in self.rules: @@ -222,11 +222,11 @@ def to_dict(self) -> dict[str, Any]: rules.append(rules_item) - time_restriction_time_zone: Union[Unset, str] = UNSET + time_restriction_time_zone: Unset | str = UNSET if not isinstance(self.time_restriction_time_zone, Unset): time_restriction_time_zone = self.time_restriction_time_zone - time_restrictions: Union[Unset, list[dict[str, Any]]] = UNSET + time_restrictions: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.time_restrictions, Unset): time_restrictions = [] for time_restrictions_item_data in self.time_restrictions: @@ -305,21 +305,21 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name = d.pop("name") _notification_type = d.pop("notification_type", UNSET) - notification_type: Union[Unset, NewEscalationPolicyPathDataAttributesNotificationType] + notification_type: Unset | NewEscalationPolicyPathDataAttributesNotificationType if isinstance(_notification_type, Unset): notification_type = UNSET else: notification_type = check_new_escalation_policy_path_data_attributes_notification_type(_notification_type) _path_type = d.pop("path_type", UNSET) - path_type: Union[Unset, NewEscalationPolicyPathDataAttributesPathType] + path_type: Unset | NewEscalationPolicyPathDataAttributesPathType if isinstance(_path_type, Unset): path_type = UNSET else: path_type = check_new_escalation_policy_path_data_attributes_path_type(_path_type) _after_deferral_behavior = d.pop("after_deferral_behavior", UNSET) - after_deferral_behavior: Union[Unset, NewEscalationPolicyPathDataAttributesAfterDeferralBehavior] + after_deferral_behavior: Unset | NewEscalationPolicyPathDataAttributesAfterDeferralBehavior if isinstance(_after_deferral_behavior, Unset): after_deferral_behavior = UNSET else: @@ -327,26 +327,26 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: _after_deferral_behavior ) - def _parse_after_deferral_path_id(data: object) -> Union[None, Unset, str]: + def _parse_after_deferral_path_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) after_deferral_path_id = _parse_after_deferral_path_id(d.pop("after_deferral_path_id", UNSET)) - def _parse_default(data: object) -> Union[None, Unset, bool]: + def _parse_default(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) default = _parse_default(d.pop("default", UNSET)) _match_mode = d.pop("match_mode", UNSET) - match_mode: Union[Unset, NewEscalationPolicyPathDataAttributesMatchMode] + match_mode: Unset | NewEscalationPolicyPathDataAttributesMatchMode if isinstance(_match_mode, Unset): match_mode = UNSET else: @@ -354,32 +354,32 @@ def _parse_default(data: object) -> Union[None, Unset, bool]: position = d.pop("position", UNSET) - def _parse_repeat(data: object) -> Union[None, Unset, bool]: + def _parse_repeat(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) repeat = _parse_repeat(d.pop("repeat", UNSET)) - def _parse_repeat_count(data: object) -> Union[None, Unset, int]: + def _parse_repeat_count(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) repeat_count = _parse_repeat_count(d.pop("repeat_count", UNSET)) initial_delay = d.pop("initial_delay", UNSET) - def _parse_retrigger_timeout_minutes(data: object) -> Union[None, Unset, int]: + def _parse_retrigger_timeout_minutes(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) retrigger_timeout_minutes = _parse_retrigger_timeout_minutes(d.pop("retrigger_timeout_minutes", UNSET)) @@ -466,7 +466,7 @@ def _parse_rules_item( rules.append(rules_item) _time_restriction_time_zone = d.pop("time_restriction_time_zone", UNSET) - time_restriction_time_zone: Union[Unset, NewEscalationPolicyPathDataAttributesTimeRestrictionTimeZone] + time_restriction_time_zone: Unset | NewEscalationPolicyPathDataAttributesTimeRestrictionTimeZone if isinstance(_time_restriction_time_zone, Unset): time_restriction_time_zone = UNSET else: diff --git a/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_2.py b/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_2.py index 5f3acff9..173fe30c 100644 --- a/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_2.py +++ b/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_2.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -31,8 +31,8 @@ class NewEscalationPolicyPathDataAttributesRulesItemType2: rule_type: NewEscalationPolicyPathDataAttributesRulesItemType2RuleType json_path: str operator: NewEscalationPolicyPathDataAttributesRulesItemType2Operator - value: Union[None, Unset, str] = UNSET - values: Union[Unset, list[str]] = UNSET + value: None | Unset | str = UNSET + values: Unset | list[str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,13 +42,13 @@ def to_dict(self) -> dict[str, Any]: operator: str = self.operator - value: Union[None, Unset, str] + value: None | Unset | str if isinstance(self.value, Unset): value = UNSET else: value = self.value - values: Union[Unset, list[str]] = UNSET + values: Unset | list[str] = UNSET if not isinstance(self.values, Unset): values = self.values @@ -77,12 +77,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: operator = check_new_escalation_policy_path_data_attributes_rules_item_type_2_operator(d.pop("operator")) - def _parse_value(data: object) -> Union[None, Unset, str]: + def _parse_value(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) value = _parse_value(d.pop("value", UNSET)) diff --git a/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_3.py b/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_3.py index 6a34e20e..e5bc643d 100644 --- a/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_3.py +++ b/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_3.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -33,7 +33,7 @@ class NewEscalationPolicyPathDataAttributesRulesItemType3: fieldable_type: str fieldable_id: str operator: NewEscalationPolicyPathDataAttributesRulesItemType3Operator - values: Union[Unset, list[str]] = UNSET + values: Unset | list[str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -45,7 +45,7 @@ def to_dict(self) -> dict[str, Any]: operator: str = self.operator - values: Union[Unset, list[str]] = UNSET + values: Unset | list[str] = UNSET if not isinstance(self.values, Unset): values = self.values diff --git a/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_5_time_blocks_item.py b/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_5_time_blocks_item.py index 25997d60..ea865059 100644 --- a/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_5_time_blocks_item.py +++ b/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_5_time_blocks_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -26,17 +26,17 @@ class NewEscalationPolicyPathDataAttributesRulesItemType5TimeBlocksItem: position (Union[None, Unset, int]): """ - monday: Union[Unset, bool] = False - tuesday: Union[Unset, bool] = False - wednesday: Union[Unset, bool] = False - thursday: Union[Unset, bool] = False - friday: Union[Unset, bool] = False - saturday: Union[Unset, bool] = False - sunday: Union[Unset, bool] = False - start_time: Union[Unset, str] = UNSET - end_time: Union[Unset, str] = UNSET - all_day: Union[Unset, bool] = False - position: Union[None, Unset, int] = UNSET + monday: Unset | bool = False + tuesday: Unset | bool = False + wednesday: Unset | bool = False + thursday: Unset | bool = False + friday: Unset | bool = False + saturday: Unset | bool = False + sunday: Unset | bool = False + start_time: Unset | str = UNSET + end_time: Unset | str = UNSET + all_day: Unset | bool = False + position: None | Unset | int = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -60,7 +60,7 @@ def to_dict(self) -> dict[str, Any]: all_day = self.all_day - position: Union[None, Unset, int] + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: @@ -117,12 +117,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: all_day = d.pop("all_day", UNSET) - def _parse_position(data: object) -> Union[None, Unset, int]: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) diff --git a/rootly_sdk/models/new_form_field_data_attributes.py b/rootly_sdk/models/new_form_field_data_attributes.py index 38f6c56b..04f0bbef 100644 --- a/rootly_sdk/models/new_form_field_data_attributes.py +++ b/rootly_sdk/models/new_form_field_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -43,54 +43,54 @@ class NewFormFieldDataAttributes: kind: NewFormFieldDataAttributesKind name: str - slug: Union[None, Unset, str] = UNSET - input_kind: Union[Unset, NewFormFieldDataAttributesInputKind] = UNSET - value_kind: Union[Unset, NewFormFieldDataAttributesValueKind] = UNSET - value_kind_catalog_id: Union[None, Unset, str] = UNSET - description: Union[None, Unset, str] = UNSET - shown: Union[Unset, list[str]] = UNSET - required: Union[Unset, list[str]] = UNSET - show_on_incident_details: Union[Unset, bool] = UNSET - enabled: Union[Unset, bool] = UNSET - default_values: Union[Unset, list[str]] = UNSET - auto_set_by_catalog_property_id: Union[None, Unset, str] = UNSET + slug: None | Unset | str = UNSET + input_kind: Unset | NewFormFieldDataAttributesInputKind = UNSET + value_kind: Unset | NewFormFieldDataAttributesValueKind = UNSET + value_kind_catalog_id: None | Unset | str = UNSET + description: None | Unset | str = UNSET + shown: Unset | list[str] = UNSET + required: Unset | list[str] = UNSET + show_on_incident_details: Unset | bool = UNSET + enabled: Unset | bool = UNSET + default_values: Unset | list[str] = UNSET + auto_set_by_catalog_property_id: None | Unset | str = UNSET def to_dict(self) -> dict[str, Any]: kind: str = self.kind name = self.name - slug: Union[None, Unset, str] + slug: None | Unset | str if isinstance(self.slug, Unset): slug = UNSET else: slug = self.slug - input_kind: Union[Unset, str] = UNSET + input_kind: Unset | str = UNSET if not isinstance(self.input_kind, Unset): input_kind = self.input_kind - value_kind: Union[Unset, str] = UNSET + value_kind: Unset | str = UNSET if not isinstance(self.value_kind, Unset): value_kind = self.value_kind - value_kind_catalog_id: Union[None, Unset, str] + value_kind_catalog_id: None | Unset | str if isinstance(self.value_kind_catalog_id, Unset): value_kind_catalog_id = UNSET else: value_kind_catalog_id = self.value_kind_catalog_id - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - shown: Union[Unset, list[str]] = UNSET + shown: Unset | list[str] = UNSET if not isinstance(self.shown, Unset): shown = self.shown - required: Union[Unset, list[str]] = UNSET + required: Unset | list[str] = UNSET if not isinstance(self.required, Unset): required = self.required @@ -98,11 +98,11 @@ def to_dict(self) -> dict[str, Any]: enabled = self.enabled - default_values: Union[Unset, list[str]] = UNSET + default_values: Unset | list[str] = UNSET if not isinstance(self.default_values, Unset): default_values = self.default_values - auto_set_by_catalog_property_id: Union[None, Unset, str] + auto_set_by_catalog_property_id: None | Unset | str if isinstance(self.auto_set_by_catalog_property_id, Unset): auto_set_by_catalog_property_id = UNSET else: @@ -148,44 +148,44 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name = d.pop("name") - def _parse_slug(data: object) -> Union[None, Unset, str]: + def _parse_slug(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) slug = _parse_slug(d.pop("slug", UNSET)) _input_kind = d.pop("input_kind", UNSET) - input_kind: Union[Unset, NewFormFieldDataAttributesInputKind] + input_kind: Unset | NewFormFieldDataAttributesInputKind if isinstance(_input_kind, Unset): input_kind = UNSET else: input_kind = check_new_form_field_data_attributes_input_kind(_input_kind) _value_kind = d.pop("value_kind", UNSET) - value_kind: Union[Unset, NewFormFieldDataAttributesValueKind] + value_kind: Unset | NewFormFieldDataAttributesValueKind if isinstance(_value_kind, Unset): value_kind = UNSET else: value_kind = check_new_form_field_data_attributes_value_kind(_value_kind) - def _parse_value_kind_catalog_id(data: object) -> Union[None, Unset, str]: + def _parse_value_kind_catalog_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) value_kind_catalog_id = _parse_value_kind_catalog_id(d.pop("value_kind_catalog_id", UNSET)) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) @@ -199,12 +199,12 @@ def _parse_description(data: object) -> Union[None, Unset, str]: default_values = cast(list[str], d.pop("default_values", UNSET)) - def _parse_auto_set_by_catalog_property_id(data: object) -> Union[None, Unset, str]: + def _parse_auto_set_by_catalog_property_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) auto_set_by_catalog_property_id = _parse_auto_set_by_catalog_property_id( d.pop("auto_set_by_catalog_property_id", UNSET) diff --git a/rootly_sdk/models/new_form_field_option_data_attributes.py b/rootly_sdk/models/new_form_field_option_data_attributes.py index c250076d..0ea3b51f 100644 --- a/rootly_sdk/models/new_form_field_option_data_attributes.py +++ b/rootly_sdk/models/new_form_field_option_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define @@ -21,9 +21,9 @@ class NewFormFieldOptionDataAttributes: form_field_id: str value: str - color: Union[Unset, str] = UNSET - default: Union[Unset, bool] = UNSET - position: Union[Unset, int] = UNSET + color: Unset | str = UNSET + default: Unset | bool = UNSET + position: Unset | int = UNSET def to_dict(self) -> dict[str, Any]: form_field_id = self.form_field_id diff --git a/rootly_sdk/models/new_form_field_placement_condition_data_attributes.py b/rootly_sdk/models/new_form_field_placement_condition_data_attributes.py index cf410bed..e99d57d1 100644 --- a/rootly_sdk/models/new_form_field_placement_condition_data_attributes.py +++ b/rootly_sdk/models/new_form_field_placement_condition_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -33,7 +33,7 @@ class NewFormFieldPlacementConditionDataAttributes: form_field_id: str comparison: NewFormFieldPlacementConditionDataAttributesComparison values: list[str] - position: Union[Unset, int] = UNSET + position: Unset | int = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/new_form_field_placement_data_attributes.py b/rootly_sdk/models/new_form_field_placement_data_attributes.py index 63631e1e..ae44a676 100644 --- a/rootly_sdk/models/new_form_field_placement_data_attributes.py +++ b/rootly_sdk/models/new_form_field_placement_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -35,11 +35,11 @@ class NewFormFieldPlacementDataAttributes: form_set_id: str form: str - position: Union[Unset, int] = UNSET - required: Union[Unset, bool] = UNSET - required_operator: Union[Unset, NewFormFieldPlacementDataAttributesRequiredOperator] = UNSET - placement_operator: Union[Unset, NewFormFieldPlacementDataAttributesPlacementOperator] = UNSET - non_editable: Union[Unset, bool] = UNSET + position: Unset | int = UNSET + required: Unset | bool = UNSET + required_operator: Unset | NewFormFieldPlacementDataAttributesRequiredOperator = UNSET + placement_operator: Unset | NewFormFieldPlacementDataAttributesPlacementOperator = UNSET + non_editable: Unset | bool = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -51,11 +51,11 @@ def to_dict(self) -> dict[str, Any]: required = self.required - required_operator: Union[Unset, str] = UNSET + required_operator: Unset | str = UNSET if not isinstance(self.required_operator, Unset): required_operator = self.required_operator - placement_operator: Union[Unset, str] = UNSET + placement_operator: Unset | str = UNSET if not isinstance(self.placement_operator, Unset): placement_operator = self.placement_operator @@ -94,14 +94,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: required = d.pop("required", UNSET) _required_operator = d.pop("required_operator", UNSET) - required_operator: Union[Unset, NewFormFieldPlacementDataAttributesRequiredOperator] + required_operator: Unset | NewFormFieldPlacementDataAttributesRequiredOperator if isinstance(_required_operator, Unset): required_operator = UNSET else: required_operator = check_new_form_field_placement_data_attributes_required_operator(_required_operator) _placement_operator = d.pop("placement_operator", UNSET) - placement_operator: Union[Unset, NewFormFieldPlacementDataAttributesPlacementOperator] + placement_operator: Unset | NewFormFieldPlacementDataAttributesPlacementOperator if isinstance(_placement_operator, Unset): placement_operator = UNSET else: diff --git a/rootly_sdk/models/new_form_set_data_attributes.py b/rootly_sdk/models/new_form_set_data_attributes.py index 82df17ba..6b8ce73d 100644 --- a/rootly_sdk/models/new_form_set_data_attributes.py +++ b/rootly_sdk/models/new_form_set_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -27,14 +27,14 @@ class NewFormSetDataAttributes: name: str forms: list[str] - slug: Union[None, Unset, str] = UNSET + slug: None | Unset | str = UNSET def to_dict(self) -> dict[str, Any]: name = self.name forms = self.forms - slug: Union[None, Unset, str] + slug: None | Unset | str if isinstance(self.slug, Unset): slug = UNSET else: @@ -60,12 +60,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: forms = cast(list[str], d.pop("forms")) - def _parse_slug(data: object) -> Union[None, Unset, str]: + def _parse_slug(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) slug = _parse_slug(d.pop("slug", UNSET)) diff --git a/rootly_sdk/models/new_functionality_data_attributes.py b/rootly_sdk/models/new_functionality_data_attributes.py index be1a2755..6afdde6a 100644 --- a/rootly_sdk/models/new_functionality_data_attributes.py +++ b/rootly_sdk/models/new_functionality_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define @@ -59,52 +59,52 @@ class NewFunctionalityDataAttributes: """ name: str - slug: Union[None, Unset, str] = UNSET - description: Union[None, Unset, str] = UNSET - public_description: Union[None, Unset, str] = UNSET - notify_emails: Union[None, Unset, list[str]] = UNSET - color: Union[None, Unset, str] = UNSET - position: Union[None, Unset, int] = UNSET - backstage_id: Union[None, Unset, str] = UNSET - external_id: Union[None, Unset, str] = UNSET - pagerduty_id: Union[None, Unset, str] = UNSET - opsgenie_id: Union[None, Unset, str] = UNSET - opsgenie_team_id: Union[None, Unset, str] = UNSET - cortex_id: Union[None, Unset, str] = UNSET - service_now_ci_sys_id: Union[None, Unset, str] = UNSET - show_uptime: Union[None, Unset, bool] = UNSET - show_uptime_last_days: Union[Unset, NewFunctionalityDataAttributesShowUptimeLastDays] = 60 - environment_ids: Union[None, Unset, list[str]] = UNSET - service_ids: Union[None, Unset, list[str]] = UNSET - owner_group_ids: Union[None, Unset, list[str]] = UNSET - owner_user_ids: Union[None, Unset, list[int]] = UNSET - escalation_policy_id: Union[None, Unset, str] = UNSET - slack_channels: Union[None, Unset, list["NewFunctionalityDataAttributesSlackChannelsType0Item"]] = UNSET - slack_aliases: Union[None, Unset, list["NewFunctionalityDataAttributesSlackAliasesType0Item"]] = UNSET - properties: Union[Unset, list["NewFunctionalityDataAttributesPropertiesItem"]] = UNSET + slug: None | Unset | str = UNSET + description: None | Unset | str = UNSET + public_description: None | Unset | str = UNSET + notify_emails: None | Unset | list[str] = UNSET + color: None | Unset | str = UNSET + position: None | Unset | int = UNSET + backstage_id: None | Unset | str = UNSET + external_id: None | Unset | str = UNSET + pagerduty_id: None | Unset | str = UNSET + opsgenie_id: None | Unset | str = UNSET + opsgenie_team_id: None | Unset | str = UNSET + cortex_id: None | Unset | str = UNSET + service_now_ci_sys_id: None | Unset | str = UNSET + show_uptime: None | Unset | bool = UNSET + show_uptime_last_days: Unset | NewFunctionalityDataAttributesShowUptimeLastDays = 60 + environment_ids: None | Unset | list[str] = UNSET + service_ids: None | Unset | list[str] = UNSET + owner_group_ids: None | Unset | list[str] = UNSET + owner_user_ids: None | Unset | list[int] = UNSET + escalation_policy_id: None | Unset | str = UNSET + slack_channels: None | Unset | list["NewFunctionalityDataAttributesSlackChannelsType0Item"] = UNSET + slack_aliases: None | Unset | list["NewFunctionalityDataAttributesSlackAliasesType0Item"] = UNSET + properties: Unset | list["NewFunctionalityDataAttributesPropertiesItem"] = UNSET def to_dict(self) -> dict[str, Any]: name = self.name - slug: Union[None, Unset, str] + slug: None | Unset | str if isinstance(self.slug, Unset): slug = UNSET else: slug = self.slug - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - public_description: Union[None, Unset, str] + public_description: None | Unset | str if isinstance(self.public_description, Unset): public_description = UNSET else: public_description = self.public_description - notify_emails: Union[None, Unset, list[str]] + notify_emails: None | Unset | list[str] if isinstance(self.notify_emails, Unset): notify_emails = UNSET elif isinstance(self.notify_emails, list): @@ -113,71 +113,71 @@ def to_dict(self) -> dict[str, Any]: else: notify_emails = self.notify_emails - color: Union[None, Unset, str] + color: None | Unset | str if isinstance(self.color, Unset): color = UNSET else: color = self.color - position: Union[None, Unset, int] + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: position = self.position - backstage_id: Union[None, Unset, str] + backstage_id: None | Unset | str if isinstance(self.backstage_id, Unset): backstage_id = UNSET else: backstage_id = self.backstage_id - external_id: Union[None, Unset, str] + external_id: None | Unset | str if isinstance(self.external_id, Unset): external_id = UNSET else: external_id = self.external_id - pagerduty_id: Union[None, Unset, str] + pagerduty_id: None | Unset | str if isinstance(self.pagerduty_id, Unset): pagerduty_id = UNSET else: pagerduty_id = self.pagerduty_id - opsgenie_id: Union[None, Unset, str] + opsgenie_id: None | Unset | str if isinstance(self.opsgenie_id, Unset): opsgenie_id = UNSET else: opsgenie_id = self.opsgenie_id - opsgenie_team_id: Union[None, Unset, str] + opsgenie_team_id: None | Unset | str if isinstance(self.opsgenie_team_id, Unset): opsgenie_team_id = UNSET else: opsgenie_team_id = self.opsgenie_team_id - cortex_id: Union[None, Unset, str] + cortex_id: None | Unset | str if isinstance(self.cortex_id, Unset): cortex_id = UNSET else: cortex_id = self.cortex_id - service_now_ci_sys_id: Union[None, Unset, str] + service_now_ci_sys_id: None | Unset | str if isinstance(self.service_now_ci_sys_id, Unset): service_now_ci_sys_id = UNSET else: service_now_ci_sys_id = self.service_now_ci_sys_id - show_uptime: Union[None, Unset, bool] + show_uptime: None | Unset | bool if isinstance(self.show_uptime, Unset): show_uptime = UNSET else: show_uptime = self.show_uptime - show_uptime_last_days: Union[Unset, int] = UNSET + show_uptime_last_days: Unset | int = UNSET if not isinstance(self.show_uptime_last_days, Unset): show_uptime_last_days = self.show_uptime_last_days - environment_ids: Union[None, Unset, list[str]] + environment_ids: None | Unset | list[str] if isinstance(self.environment_ids, Unset): environment_ids = UNSET elif isinstance(self.environment_ids, list): @@ -186,7 +186,7 @@ def to_dict(self) -> dict[str, Any]: else: environment_ids = self.environment_ids - service_ids: Union[None, Unset, list[str]] + service_ids: None | Unset | list[str] if isinstance(self.service_ids, Unset): service_ids = UNSET elif isinstance(self.service_ids, list): @@ -195,7 +195,7 @@ def to_dict(self) -> dict[str, Any]: else: service_ids = self.service_ids - owner_group_ids: Union[None, Unset, list[str]] + owner_group_ids: None | Unset | list[str] if isinstance(self.owner_group_ids, Unset): owner_group_ids = UNSET elif isinstance(self.owner_group_ids, list): @@ -204,7 +204,7 @@ def to_dict(self) -> dict[str, Any]: else: owner_group_ids = self.owner_group_ids - owner_user_ids: Union[None, Unset, list[int]] + owner_user_ids: None | Unset | list[int] if isinstance(self.owner_user_ids, Unset): owner_user_ids = UNSET elif isinstance(self.owner_user_ids, list): @@ -213,13 +213,13 @@ def to_dict(self) -> dict[str, Any]: else: owner_user_ids = self.owner_user_ids - escalation_policy_id: Union[None, Unset, str] + escalation_policy_id: None | Unset | str if isinstance(self.escalation_policy_id, Unset): escalation_policy_id = UNSET else: escalation_policy_id = self.escalation_policy_id - slack_channels: Union[None, Unset, list[dict[str, Any]]] + slack_channels: None | Unset | list[dict[str, Any]] if isinstance(self.slack_channels, Unset): slack_channels = UNSET elif isinstance(self.slack_channels, list): @@ -231,7 +231,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_channels = self.slack_channels - slack_aliases: Union[None, Unset, list[dict[str, Any]]] + slack_aliases: None | Unset | list[dict[str, Any]] if isinstance(self.slack_aliases, Unset): slack_aliases = UNSET elif isinstance(self.slack_aliases, list): @@ -243,7 +243,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_aliases = self.slack_aliases - properties: Union[Unset, list[dict[str, Any]]] = UNSET + properties: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.properties, Unset): properties = [] for properties_item_data in self.properties: @@ -321,34 +321,34 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name") - def _parse_slug(data: object) -> Union[None, Unset, str]: + def _parse_slug(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) slug = _parse_slug(d.pop("slug", UNSET)) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_public_description(data: object) -> Union[None, Unset, str]: + def _parse_public_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) public_description = _parse_public_description(d.pop("public_description", UNSET)) - def _parse_notify_emails(data: object) -> Union[None, Unset, list[str]]: + def _parse_notify_emails(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -361,102 +361,102 @@ def _parse_notify_emails(data: object) -> Union[None, Unset, list[str]]: return notify_emails_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) notify_emails = _parse_notify_emails(d.pop("notify_emails", UNSET)) - def _parse_color(data: object) -> Union[None, Unset, str]: + def _parse_color(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) color = _parse_color(d.pop("color", UNSET)) - def _parse_position(data: object) -> Union[None, Unset, int]: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) - def _parse_backstage_id(data: object) -> Union[None, Unset, str]: + def _parse_backstage_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) backstage_id = _parse_backstage_id(d.pop("backstage_id", UNSET)) - def _parse_external_id(data: object) -> Union[None, Unset, str]: + def _parse_external_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) external_id = _parse_external_id(d.pop("external_id", UNSET)) - def _parse_pagerduty_id(data: object) -> Union[None, Unset, str]: + def _parse_pagerduty_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) pagerduty_id = _parse_pagerduty_id(d.pop("pagerduty_id", UNSET)) - def _parse_opsgenie_id(data: object) -> Union[None, Unset, str]: + def _parse_opsgenie_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) opsgenie_id = _parse_opsgenie_id(d.pop("opsgenie_id", UNSET)) - def _parse_opsgenie_team_id(data: object) -> Union[None, Unset, str]: + def _parse_opsgenie_team_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) opsgenie_team_id = _parse_opsgenie_team_id(d.pop("opsgenie_team_id", UNSET)) - def _parse_cortex_id(data: object) -> Union[None, Unset, str]: + def _parse_cortex_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) cortex_id = _parse_cortex_id(d.pop("cortex_id", UNSET)) - def _parse_service_now_ci_sys_id(data: object) -> Union[None, Unset, str]: + def _parse_service_now_ci_sys_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) service_now_ci_sys_id = _parse_service_now_ci_sys_id(d.pop("service_now_ci_sys_id", UNSET)) - def _parse_show_uptime(data: object) -> Union[None, Unset, bool]: + def _parse_show_uptime(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) show_uptime = _parse_show_uptime(d.pop("show_uptime", UNSET)) _show_uptime_last_days = d.pop("show_uptime_last_days", UNSET) - show_uptime_last_days: Union[Unset, NewFunctionalityDataAttributesShowUptimeLastDays] + show_uptime_last_days: Unset | NewFunctionalityDataAttributesShowUptimeLastDays if isinstance(_show_uptime_last_days, Unset): show_uptime_last_days = UNSET else: @@ -464,7 +464,7 @@ def _parse_show_uptime(data: object) -> Union[None, Unset, bool]: _show_uptime_last_days ) - def _parse_environment_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_environment_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -477,11 +477,11 @@ def _parse_environment_ids(data: object) -> Union[None, Unset, list[str]]: return environment_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) environment_ids = _parse_environment_ids(d.pop("environment_ids", UNSET)) - def _parse_service_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_service_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -494,11 +494,11 @@ def _parse_service_ids(data: object) -> Union[None, Unset, list[str]]: return service_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) service_ids = _parse_service_ids(d.pop("service_ids", UNSET)) - def _parse_owner_group_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_owner_group_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -511,11 +511,11 @@ def _parse_owner_group_ids(data: object) -> Union[None, Unset, list[str]]: return owner_group_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) owner_group_ids = _parse_owner_group_ids(d.pop("owner_group_ids", UNSET)) - def _parse_owner_user_ids(data: object) -> Union[None, Unset, list[int]]: + def _parse_owner_user_ids(data: object) -> None | Unset | list[int]: if data is None: return data if isinstance(data, Unset): @@ -528,22 +528,22 @@ def _parse_owner_user_ids(data: object) -> Union[None, Unset, list[int]]: return owner_user_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[int]], data) + return cast(None | Unset | list[int], data) owner_user_ids = _parse_owner_user_ids(d.pop("owner_user_ids", UNSET)) - def _parse_escalation_policy_id(data: object) -> Union[None, Unset, str]: + def _parse_escalation_policy_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) escalation_policy_id = _parse_escalation_policy_id(d.pop("escalation_policy_id", UNSET)) def _parse_slack_channels( data: object, - ) -> Union[None, Unset, list["NewFunctionalityDataAttributesSlackChannelsType0Item"]]: + ) -> None | Unset | list["NewFunctionalityDataAttributesSlackChannelsType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -563,13 +563,13 @@ def _parse_slack_channels( return slack_channels_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list["NewFunctionalityDataAttributesSlackChannelsType0Item"]], data) + return cast(None | Unset | list["NewFunctionalityDataAttributesSlackChannelsType0Item"], data) slack_channels = _parse_slack_channels(d.pop("slack_channels", UNSET)) def _parse_slack_aliases( data: object, - ) -> Union[None, Unset, list["NewFunctionalityDataAttributesSlackAliasesType0Item"]]: + ) -> None | Unset | list["NewFunctionalityDataAttributesSlackAliasesType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -589,7 +589,7 @@ def _parse_slack_aliases( return slack_aliases_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list["NewFunctionalityDataAttributesSlackAliasesType0Item"]], data) + return cast(None | Unset | list["NewFunctionalityDataAttributesSlackAliasesType0Item"], data) slack_aliases = _parse_slack_aliases(d.pop("slack_aliases", UNSET)) diff --git a/rootly_sdk/models/new_heartbeat_data_attributes.py b/rootly_sdk/models/new_heartbeat_data_attributes.py index ba3d7419..628ddb7e 100644 --- a/rootly_sdk/models/new_heartbeat_data_attributes.py +++ b/rootly_sdk/models/new_heartbeat_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -40,11 +40,11 @@ class NewHeartbeatDataAttributes: interval_unit: NewHeartbeatDataAttributesIntervalUnit notification_target_id: str notification_target_type: NewHeartbeatDataAttributesNotificationTargetType - description: Union[None, Unset, str] = UNSET - alert_description: Union[None, Unset, str] = UNSET - alert_urgency_id: Union[None, Unset, str] = UNSET - owner_group_ids: Union[Unset, list[str]] = UNSET - enabled: Union[Unset, bool] = UNSET + description: None | Unset | str = UNSET + alert_description: None | Unset | str = UNSET + alert_urgency_id: None | Unset | str = UNSET + owner_group_ids: Unset | list[str] = UNSET + enabled: Unset | bool = UNSET def to_dict(self) -> dict[str, Any]: name = self.name @@ -59,25 +59,25 @@ def to_dict(self) -> dict[str, Any]: notification_target_type: str = self.notification_target_type - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - alert_description: Union[None, Unset, str] + alert_description: None | Unset | str if isinstance(self.alert_description, Unset): alert_description = UNSET else: alert_description = self.alert_description - alert_urgency_id: Union[None, Unset, str] + alert_urgency_id: None | Unset | str if isinstance(self.alert_urgency_id, Unset): alert_urgency_id = UNSET else: alert_urgency_id = self.alert_urgency_id - owner_group_ids: Union[Unset, list[str]] = UNSET + owner_group_ids: Unset | list[str] = UNSET if not isinstance(self.owner_group_ids, Unset): owner_group_ids = self.owner_group_ids @@ -125,30 +125,30 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d.pop("notification_target_type") ) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_alert_description(data: object) -> Union[None, Unset, str]: + def _parse_alert_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) alert_description = _parse_alert_description(d.pop("alert_description", UNSET)) - def _parse_alert_urgency_id(data: object) -> Union[None, Unset, str]: + def _parse_alert_urgency_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) alert_urgency_id = _parse_alert_urgency_id(d.pop("alert_urgency_id", UNSET)) diff --git a/rootly_sdk/models/new_incident_action_item_data_attributes.py b/rootly_sdk/models/new_incident_action_item_data_attributes.py index aa64b82e..9e4f798d 100644 --- a/rootly_sdk/models/new_incident_action_item_data_attributes.py +++ b/rootly_sdk/models/new_incident_action_item_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define @@ -47,76 +47,76 @@ class NewIncidentActionItemDataAttributes: """ summary: str - description: Union[None, Unset, str] = UNSET - kind: Union[Unset, NewIncidentActionItemDataAttributesKind] = UNSET - assigned_to_user_id: Union[None, Unset, int] = UNSET - assigned_to_group_ids: Union[Unset, list[str]] = UNSET - priority: Union[Unset, NewIncidentActionItemDataAttributesPriority] = UNSET - status: Union[Unset, NewIncidentActionItemDataAttributesStatus] = UNSET - due_date: Union[None, Unset, str] = UNSET - jira_issue_id: Union[None, Unset, str] = UNSET - jira_issue_key: Union[None, Unset, str] = UNSET - jira_issue_url: Union[None, Unset, str] = UNSET - form_field_selections: Union[ - None, Unset, list["NewIncidentActionItemDataAttributesFormFieldSelectionsType0Item"] - ] = UNSET + description: None | Unset | str = UNSET + kind: Unset | NewIncidentActionItemDataAttributesKind = UNSET + assigned_to_user_id: None | Unset | int = UNSET + assigned_to_group_ids: Unset | list[str] = UNSET + priority: Unset | NewIncidentActionItemDataAttributesPriority = UNSET + status: Unset | NewIncidentActionItemDataAttributesStatus = UNSET + due_date: None | Unset | str = UNSET + jira_issue_id: None | Unset | str = UNSET + jira_issue_key: None | Unset | str = UNSET + jira_issue_url: None | Unset | str = UNSET + form_field_selections: None | Unset | list["NewIncidentActionItemDataAttributesFormFieldSelectionsType0Item"] = ( + UNSET + ) def to_dict(self) -> dict[str, Any]: summary = self.summary - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - kind: Union[Unset, str] = UNSET + kind: Unset | str = UNSET if not isinstance(self.kind, Unset): kind = self.kind - assigned_to_user_id: Union[None, Unset, int] + assigned_to_user_id: None | Unset | int if isinstance(self.assigned_to_user_id, Unset): assigned_to_user_id = UNSET else: assigned_to_user_id = self.assigned_to_user_id - assigned_to_group_ids: Union[Unset, list[str]] = UNSET + assigned_to_group_ids: Unset | list[str] = UNSET if not isinstance(self.assigned_to_group_ids, Unset): assigned_to_group_ids = self.assigned_to_group_ids - priority: Union[Unset, str] = UNSET + priority: Unset | str = UNSET if not isinstance(self.priority, Unset): priority = self.priority - status: Union[Unset, str] = UNSET + status: Unset | str = UNSET if not isinstance(self.status, Unset): status = self.status - due_date: Union[None, Unset, str] + due_date: None | Unset | str if isinstance(self.due_date, Unset): due_date = UNSET else: due_date = self.due_date - jira_issue_id: Union[None, Unset, str] + jira_issue_id: None | Unset | str if isinstance(self.jira_issue_id, Unset): jira_issue_id = UNSET else: jira_issue_id = self.jira_issue_id - jira_issue_key: Union[None, Unset, str] + jira_issue_key: None | Unset | str if isinstance(self.jira_issue_key, Unset): jira_issue_key = UNSET else: jira_issue_key = self.jira_issue_key - jira_issue_url: Union[None, Unset, str] + jira_issue_url: None | Unset | str if isinstance(self.jira_issue_url, Unset): jira_issue_url = UNSET else: jira_issue_url = self.jira_issue_url - form_field_selections: Union[None, Unset, list[dict[str, Any]]] + form_field_selections: None | Unset | list[dict[str, Any]] if isinstance(self.form_field_selections, Unset): form_field_selections = UNSET elif isinstance(self.form_field_selections, list): @@ -169,86 +169,86 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) summary = d.pop("summary") - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) _kind = d.pop("kind", UNSET) - kind: Union[Unset, NewIncidentActionItemDataAttributesKind] + kind: Unset | NewIncidentActionItemDataAttributesKind if isinstance(_kind, Unset): kind = UNSET else: kind = check_new_incident_action_item_data_attributes_kind(_kind) - def _parse_assigned_to_user_id(data: object) -> Union[None, Unset, int]: + def _parse_assigned_to_user_id(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) assigned_to_user_id = _parse_assigned_to_user_id(d.pop("assigned_to_user_id", UNSET)) assigned_to_group_ids = cast(list[str], d.pop("assigned_to_group_ids", UNSET)) _priority = d.pop("priority", UNSET) - priority: Union[Unset, NewIncidentActionItemDataAttributesPriority] + priority: Unset | NewIncidentActionItemDataAttributesPriority if isinstance(_priority, Unset): priority = UNSET else: priority = check_new_incident_action_item_data_attributes_priority(_priority) _status = d.pop("status", UNSET) - status: Union[Unset, NewIncidentActionItemDataAttributesStatus] + status: Unset | NewIncidentActionItemDataAttributesStatus if isinstance(_status, Unset): status = UNSET else: status = check_new_incident_action_item_data_attributes_status(_status) - def _parse_due_date(data: object) -> Union[None, Unset, str]: + def _parse_due_date(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) due_date = _parse_due_date(d.pop("due_date", UNSET)) - def _parse_jira_issue_id(data: object) -> Union[None, Unset, str]: + def _parse_jira_issue_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) jira_issue_id = _parse_jira_issue_id(d.pop("jira_issue_id", UNSET)) - def _parse_jira_issue_key(data: object) -> Union[None, Unset, str]: + def _parse_jira_issue_key(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) jira_issue_key = _parse_jira_issue_key(d.pop("jira_issue_key", UNSET)) - def _parse_jira_issue_url(data: object) -> Union[None, Unset, str]: + def _parse_jira_issue_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) jira_issue_url = _parse_jira_issue_url(d.pop("jira_issue_url", UNSET)) def _parse_form_field_selections( data: object, - ) -> Union[None, Unset, list["NewIncidentActionItemDataAttributesFormFieldSelectionsType0Item"]]: + ) -> None | Unset | list["NewIncidentActionItemDataAttributesFormFieldSelectionsType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -270,9 +270,7 @@ def _parse_form_field_selections( return form_field_selections_type_0 except: # noqa: E722 pass - return cast( - Union[None, Unset, list["NewIncidentActionItemDataAttributesFormFieldSelectionsType0Item"]], data - ) + return cast(None | Unset | list["NewIncidentActionItemDataAttributesFormFieldSelectionsType0Item"], data) form_field_selections = _parse_form_field_selections(d.pop("form_field_selections", UNSET)) diff --git a/rootly_sdk/models/new_incident_action_item_data_attributes_form_field_selections_type_0_item.py b/rootly_sdk/models/new_incident_action_item_data_attributes_form_field_selections_type_0_item.py index e4ad6aab..d7c28de8 100644 --- a/rootly_sdk/models/new_incident_action_item_data_attributes_form_field_selections_type_0_item.py +++ b/rootly_sdk/models/new_incident_action_item_data_attributes_form_field_selections_type_0_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -30,25 +30,25 @@ class NewIncidentActionItemDataAttributesFormFieldSelectionsType0Item: """ form_field_id: str - id: Union[Unset, str] = UNSET - value: Union[None, Unset, list[str], str] = UNSET - selected_option_ids: Union[Unset, list[str]] = UNSET - selected_user_ids: Union[Unset, list[int]] = UNSET - selected_group_ids: Union[Unset, list[str]] = UNSET - selected_service_ids: Union[Unset, list[str]] = UNSET - selected_functionality_ids: Union[Unset, list[str]] = UNSET - selected_catalog_entity_ids: Union[Unset, list[str]] = UNSET - selected_environment_ids: Union[Unset, list[str]] = UNSET - selected_cause_ids: Union[Unset, list[str]] = UNSET - selected_incident_type_ids: Union[Unset, list[str]] = UNSET - field_destroy: Union[None, Unset, bool] = UNSET + id: Unset | str = UNSET + value: None | Unset | list[str] | str = UNSET + selected_option_ids: Unset | list[str] = UNSET + selected_user_ids: Unset | list[int] = UNSET + selected_group_ids: Unset | list[str] = UNSET + selected_service_ids: Unset | list[str] = UNSET + selected_functionality_ids: Unset | list[str] = UNSET + selected_catalog_entity_ids: Unset | list[str] = UNSET + selected_environment_ids: Unset | list[str] = UNSET + selected_cause_ids: Unset | list[str] = UNSET + selected_incident_type_ids: Unset | list[str] = UNSET + field_destroy: None | Unset | bool = UNSET def to_dict(self) -> dict[str, Any]: form_field_id = self.form_field_id id = self.id - value: Union[None, Unset, list[str], str] + value: None | Unset | list[str] | str if isinstance(self.value, Unset): value = UNSET elif isinstance(self.value, list): @@ -57,43 +57,43 @@ def to_dict(self) -> dict[str, Any]: else: value = self.value - selected_option_ids: Union[Unset, list[str]] = UNSET + selected_option_ids: Unset | list[str] = UNSET if not isinstance(self.selected_option_ids, Unset): selected_option_ids = self.selected_option_ids - selected_user_ids: Union[Unset, list[int]] = UNSET + selected_user_ids: Unset | list[int] = UNSET if not isinstance(self.selected_user_ids, Unset): selected_user_ids = self.selected_user_ids - selected_group_ids: Union[Unset, list[str]] = UNSET + selected_group_ids: Unset | list[str] = UNSET if not isinstance(self.selected_group_ids, Unset): selected_group_ids = self.selected_group_ids - selected_service_ids: Union[Unset, list[str]] = UNSET + selected_service_ids: Unset | list[str] = UNSET if not isinstance(self.selected_service_ids, Unset): selected_service_ids = self.selected_service_ids - selected_functionality_ids: Union[Unset, list[str]] = UNSET + selected_functionality_ids: Unset | list[str] = UNSET if not isinstance(self.selected_functionality_ids, Unset): selected_functionality_ids = self.selected_functionality_ids - selected_catalog_entity_ids: Union[Unset, list[str]] = UNSET + selected_catalog_entity_ids: Unset | list[str] = UNSET if not isinstance(self.selected_catalog_entity_ids, Unset): selected_catalog_entity_ids = self.selected_catalog_entity_ids - selected_environment_ids: Union[Unset, list[str]] = UNSET + selected_environment_ids: Unset | list[str] = UNSET if not isinstance(self.selected_environment_ids, Unset): selected_environment_ids = self.selected_environment_ids - selected_cause_ids: Union[Unset, list[str]] = UNSET + selected_cause_ids: Unset | list[str] = UNSET if not isinstance(self.selected_cause_ids, Unset): selected_cause_ids = self.selected_cause_ids - selected_incident_type_ids: Union[Unset, list[str]] = UNSET + selected_incident_type_ids: Unset | list[str] = UNSET if not isinstance(self.selected_incident_type_ids, Unset): selected_incident_type_ids = self.selected_incident_type_ids - field_destroy: Union[None, Unset, bool] + field_destroy: None | Unset | bool if isinstance(self.field_destroy, Unset): field_destroy = UNSET else: @@ -140,7 +140,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: id = d.pop("id", UNSET) - def _parse_value(data: object) -> Union[None, Unset, list[str], str]: + def _parse_value(data: object) -> None | Unset | list[str] | str: if data is None: return data if isinstance(data, Unset): @@ -153,7 +153,7 @@ def _parse_value(data: object) -> Union[None, Unset, list[str], str]: return value_type_1 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str], str], data) + return cast(None | Unset | list[str] | str, data) value = _parse_value(d.pop("value", UNSET)) @@ -175,12 +175,12 @@ def _parse_value(data: object) -> Union[None, Unset, list[str], str]: selected_incident_type_ids = cast(list[str], d.pop("selected_incident_type_ids", UNSET)) - def _parse_field_destroy(data: object) -> Union[None, Unset, bool]: + def _parse_field_destroy(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) field_destroy = _parse_field_destroy(d.pop("_destroy", UNSET)) diff --git a/rootly_sdk/models/new_incident_custom_field_selection_data_attributes.py b/rootly_sdk/models/new_incident_custom_field_selection_data_attributes.py index 8d3e4709..31f89ff4 100644 --- a/rootly_sdk/models/new_incident_custom_field_selection_data_attributes.py +++ b/rootly_sdk/models/new_incident_custom_field_selection_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -18,16 +18,16 @@ class NewIncidentCustomFieldSelectionDataAttributes: """ custom_field_id: int - value: Union[None, str] - selected_option_ids: Union[Unset, list[int]] = UNSET + value: None | str + selected_option_ids: Unset | list[int] = UNSET def to_dict(self) -> dict[str, Any]: custom_field_id = self.custom_field_id - value: Union[None, str] + value: None | str value = self.value - selected_option_ids: Union[Unset, list[int]] = UNSET + selected_option_ids: Unset | list[int] = UNSET if not isinstance(self.selected_option_ids, Unset): selected_option_ids = self.selected_option_ids @@ -49,10 +49,10 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) custom_field_id = d.pop("custom_field_id") - def _parse_value(data: object) -> Union[None, str]: + def _parse_value(data: object) -> None | str: if data is None: return data - return cast(Union[None, str], data) + return cast(None | str, data) value = _parse_value(d.pop("value")) diff --git a/rootly_sdk/models/new_incident_data_attributes.py b/rootly_sdk/models/new_incident_data_attributes.py index f5d5a0f1..abb989bf 100644 --- a/rootly_sdk/models/new_incident_data_attributes.py +++ b/rootly_sdk/models/new_incident_data_attributes.py @@ -70,103 +70,103 @@ class NewIncidentDataAttributes: cancelled_at (Union[None, Unset, str]): Date of cancellation """ - title: Union[None, Unset, str] = UNSET - kind: Union[Unset, NewIncidentDataAttributesKind] = "normal" - parent_incident_id: Union[None, Unset, str] = UNSET - duplicate_incident_id: Union[None, Unset, str] = UNSET - private: Union[None, Unset, bool] = False - summary: Union[None, Unset, str] = UNSET - user_id: Union[None, Unset, str] = UNSET - severity_id: Union[None, Unset, str] = UNSET - public_title: Union[None, Unset, str] = UNSET - alert_ids: Union[None, Unset, list[str]] = UNSET - environment_ids: Union[None, Unset, list[str]] = UNSET - incident_type_ids: Union[None, Unset, list[str]] = UNSET - service_ids: Union[None, Unset, list[str]] = UNSET - functionality_ids: Union[None, Unset, list[str]] = UNSET - group_ids: Union[None, Unset, list[str]] = UNSET - cause_ids: Union[None, Unset, list[str]] = UNSET - muted_service_ids: Union[None, Unset, list[str]] = UNSET + title: None | Unset | str = UNSET + kind: Unset | NewIncidentDataAttributesKind = "normal" + parent_incident_id: None | Unset | str = UNSET + duplicate_incident_id: None | Unset | str = UNSET + private: None | Unset | bool = False + summary: None | Unset | str = UNSET + user_id: None | Unset | str = UNSET + severity_id: None | Unset | str = UNSET + public_title: None | Unset | str = UNSET + alert_ids: None | Unset | list[str] = UNSET + environment_ids: None | Unset | list[str] = UNSET + incident_type_ids: None | Unset | list[str] = UNSET + service_ids: None | Unset | list[str] = UNSET + functionality_ids: None | Unset | list[str] = UNSET + group_ids: None | Unset | list[str] = UNSET + cause_ids: None | Unset | list[str] = UNSET + muted_service_ids: None | Unset | list[str] = UNSET labels: Union["NewIncidentDataAttributesLabelsType0", None, Unset] = UNSET - slack_channel_name: Union[None, Unset, str] = UNSET - slack_channel_id: Union[None, Unset, str] = UNSET - slack_channel_url: Union[None, Unset, str] = UNSET - slack_channel_archived: Union[None, Unset, bool] = UNSET - google_drive_parent_id: Union[None, Unset, str] = UNSET - google_drive_url: Union[None, Unset, str] = UNSET - jira_issue_key: Union[None, Unset, str] = UNSET - jira_issue_id: Union[None, Unset, str] = UNSET - jira_issue_url: Union[None, Unset, str] = UNSET - notify_emails: Union[None, Unset, list[str]] = UNSET - status: Union[Unset, NewIncidentDataAttributesStatus] = UNSET - url: Union[Unset, str] = UNSET - scheduled_for: Union[None, Unset, str] = UNSET - scheduled_until: Union[None, Unset, str] = UNSET - in_triage_at: Union[None, Unset, str] = UNSET - started_at: Union[None, Unset, str] = UNSET - detected_at: Union[None, Unset, str] = UNSET - acknowledged_at: Union[None, Unset, str] = UNSET - mitigated_at: Union[None, Unset, str] = UNSET - resolved_at: Union[None, Unset, str] = UNSET - closed_at: Union[None, Unset, str] = UNSET - cancelled_at: Union[None, Unset, str] = UNSET + slack_channel_name: None | Unset | str = UNSET + slack_channel_id: None | Unset | str = UNSET + slack_channel_url: None | Unset | str = UNSET + slack_channel_archived: None | Unset | bool = UNSET + google_drive_parent_id: None | Unset | str = UNSET + google_drive_url: None | Unset | str = UNSET + jira_issue_key: None | Unset | str = UNSET + jira_issue_id: None | Unset | str = UNSET + jira_issue_url: None | Unset | str = UNSET + notify_emails: None | Unset | list[str] = UNSET + status: Unset | NewIncidentDataAttributesStatus = UNSET + url: Unset | str = UNSET + scheduled_for: None | Unset | str = UNSET + scheduled_until: None | Unset | str = UNSET + in_triage_at: None | Unset | str = UNSET + started_at: None | Unset | str = UNSET + detected_at: None | Unset | str = UNSET + acknowledged_at: None | Unset | str = UNSET + mitigated_at: None | Unset | str = UNSET + resolved_at: None | Unset | str = UNSET + closed_at: None | Unset | str = UNSET + cancelled_at: None | Unset | str = UNSET def to_dict(self) -> dict[str, Any]: from ..models.new_incident_data_attributes_labels_type_0 import NewIncidentDataAttributesLabelsType0 - title: Union[None, Unset, str] + title: None | Unset | str if isinstance(self.title, Unset): title = UNSET else: title = self.title - kind: Union[Unset, str] = UNSET + kind: Unset | str = UNSET if not isinstance(self.kind, Unset): kind = self.kind - parent_incident_id: Union[None, Unset, str] + parent_incident_id: None | Unset | str if isinstance(self.parent_incident_id, Unset): parent_incident_id = UNSET else: parent_incident_id = self.parent_incident_id - duplicate_incident_id: Union[None, Unset, str] + duplicate_incident_id: None | Unset | str if isinstance(self.duplicate_incident_id, Unset): duplicate_incident_id = UNSET else: duplicate_incident_id = self.duplicate_incident_id - private: Union[None, Unset, bool] + private: None | Unset | bool if isinstance(self.private, Unset): private = UNSET else: private = self.private - summary: Union[None, Unset, str] + summary: None | Unset | str if isinstance(self.summary, Unset): summary = UNSET else: summary = self.summary - user_id: Union[None, Unset, str] + user_id: None | Unset | str if isinstance(self.user_id, Unset): user_id = UNSET else: user_id = self.user_id - severity_id: Union[None, Unset, str] + severity_id: None | Unset | str if isinstance(self.severity_id, Unset): severity_id = UNSET else: severity_id = self.severity_id - public_title: Union[None, Unset, str] + public_title: None | Unset | str if isinstance(self.public_title, Unset): public_title = UNSET else: public_title = self.public_title - alert_ids: Union[None, Unset, list[str]] + alert_ids: None | Unset | list[str] if isinstance(self.alert_ids, Unset): alert_ids = UNSET elif isinstance(self.alert_ids, list): @@ -175,7 +175,7 @@ def to_dict(self) -> dict[str, Any]: else: alert_ids = self.alert_ids - environment_ids: Union[None, Unset, list[str]] + environment_ids: None | Unset | list[str] if isinstance(self.environment_ids, Unset): environment_ids = UNSET elif isinstance(self.environment_ids, list): @@ -184,7 +184,7 @@ def to_dict(self) -> dict[str, Any]: else: environment_ids = self.environment_ids - incident_type_ids: Union[None, Unset, list[str]] + incident_type_ids: None | Unset | list[str] if isinstance(self.incident_type_ids, Unset): incident_type_ids = UNSET elif isinstance(self.incident_type_ids, list): @@ -193,7 +193,7 @@ def to_dict(self) -> dict[str, Any]: else: incident_type_ids = self.incident_type_ids - service_ids: Union[None, Unset, list[str]] + service_ids: None | Unset | list[str] if isinstance(self.service_ids, Unset): service_ids = UNSET elif isinstance(self.service_ids, list): @@ -202,7 +202,7 @@ def to_dict(self) -> dict[str, Any]: else: service_ids = self.service_ids - functionality_ids: Union[None, Unset, list[str]] + functionality_ids: None | Unset | list[str] if isinstance(self.functionality_ids, Unset): functionality_ids = UNSET elif isinstance(self.functionality_ids, list): @@ -211,7 +211,7 @@ def to_dict(self) -> dict[str, Any]: else: functionality_ids = self.functionality_ids - group_ids: Union[None, Unset, list[str]] + group_ids: None | Unset | list[str] if isinstance(self.group_ids, Unset): group_ids = UNSET elif isinstance(self.group_ids, list): @@ -220,7 +220,7 @@ def to_dict(self) -> dict[str, Any]: else: group_ids = self.group_ids - cause_ids: Union[None, Unset, list[str]] + cause_ids: None | Unset | list[str] if isinstance(self.cause_ids, Unset): cause_ids = UNSET elif isinstance(self.cause_ids, list): @@ -229,7 +229,7 @@ def to_dict(self) -> dict[str, Any]: else: cause_ids = self.cause_ids - muted_service_ids: Union[None, Unset, list[str]] + muted_service_ids: None | Unset | list[str] if isinstance(self.muted_service_ids, Unset): muted_service_ids = UNSET elif isinstance(self.muted_service_ids, list): @@ -238,7 +238,7 @@ def to_dict(self) -> dict[str, Any]: else: muted_service_ids = self.muted_service_ids - labels: Union[None, Unset, dict[str, Any]] + labels: None | Unset | dict[str, Any] if isinstance(self.labels, Unset): labels = UNSET elif isinstance(self.labels, NewIncidentDataAttributesLabelsType0): @@ -246,61 +246,61 @@ def to_dict(self) -> dict[str, Any]: else: labels = self.labels - slack_channel_name: Union[None, Unset, str] + slack_channel_name: None | Unset | str if isinstance(self.slack_channel_name, Unset): slack_channel_name = UNSET else: slack_channel_name = self.slack_channel_name - slack_channel_id: Union[None, Unset, str] + slack_channel_id: None | Unset | str if isinstance(self.slack_channel_id, Unset): slack_channel_id = UNSET else: slack_channel_id = self.slack_channel_id - slack_channel_url: Union[None, Unset, str] + slack_channel_url: None | Unset | str if isinstance(self.slack_channel_url, Unset): slack_channel_url = UNSET else: slack_channel_url = self.slack_channel_url - slack_channel_archived: Union[None, Unset, bool] + slack_channel_archived: None | Unset | bool if isinstance(self.slack_channel_archived, Unset): slack_channel_archived = UNSET else: slack_channel_archived = self.slack_channel_archived - google_drive_parent_id: Union[None, Unset, str] + google_drive_parent_id: None | Unset | str if isinstance(self.google_drive_parent_id, Unset): google_drive_parent_id = UNSET else: google_drive_parent_id = self.google_drive_parent_id - google_drive_url: Union[None, Unset, str] + google_drive_url: None | Unset | str if isinstance(self.google_drive_url, Unset): google_drive_url = UNSET else: google_drive_url = self.google_drive_url - jira_issue_key: Union[None, Unset, str] + jira_issue_key: None | Unset | str if isinstance(self.jira_issue_key, Unset): jira_issue_key = UNSET else: jira_issue_key = self.jira_issue_key - jira_issue_id: Union[None, Unset, str] + jira_issue_id: None | Unset | str if isinstance(self.jira_issue_id, Unset): jira_issue_id = UNSET else: jira_issue_id = self.jira_issue_id - jira_issue_url: Union[None, Unset, str] + jira_issue_url: None | Unset | str if isinstance(self.jira_issue_url, Unset): jira_issue_url = UNSET else: jira_issue_url = self.jira_issue_url - notify_emails: Union[None, Unset, list[str]] + notify_emails: None | Unset | list[str] if isinstance(self.notify_emails, Unset): notify_emails = UNSET elif isinstance(self.notify_emails, list): @@ -309,67 +309,67 @@ def to_dict(self) -> dict[str, Any]: else: notify_emails = self.notify_emails - status: Union[Unset, str] = UNSET + status: Unset | str = UNSET if not isinstance(self.status, Unset): status = self.status url = self.url - scheduled_for: Union[None, Unset, str] + scheduled_for: None | Unset | str if isinstance(self.scheduled_for, Unset): scheduled_for = UNSET else: scheduled_for = self.scheduled_for - scheduled_until: Union[None, Unset, str] + scheduled_until: None | Unset | str if isinstance(self.scheduled_until, Unset): scheduled_until = UNSET else: scheduled_until = self.scheduled_until - in_triage_at: Union[None, Unset, str] + in_triage_at: None | Unset | str if isinstance(self.in_triage_at, Unset): in_triage_at = UNSET else: in_triage_at = self.in_triage_at - started_at: Union[None, Unset, str] + started_at: None | Unset | str if isinstance(self.started_at, Unset): started_at = UNSET else: started_at = self.started_at - detected_at: Union[None, Unset, str] + detected_at: None | Unset | str if isinstance(self.detected_at, Unset): detected_at = UNSET else: detected_at = self.detected_at - acknowledged_at: Union[None, Unset, str] + acknowledged_at: None | Unset | str if isinstance(self.acknowledged_at, Unset): acknowledged_at = UNSET else: acknowledged_at = self.acknowledged_at - mitigated_at: Union[None, Unset, str] + mitigated_at: None | Unset | str if isinstance(self.mitigated_at, Unset): mitigated_at = UNSET else: mitigated_at = self.mitigated_at - resolved_at: Union[None, Unset, str] + resolved_at: None | Unset | str if isinstance(self.resolved_at, Unset): resolved_at = UNSET else: resolved_at = self.resolved_at - closed_at: Union[None, Unset, str] + closed_at: None | Unset | str if isinstance(self.closed_at, Unset): closed_at = UNSET else: closed_at = self.closed_at - cancelled_at: Union[None, Unset, str] + cancelled_at: None | Unset | str if isinstance(self.cancelled_at, Unset): cancelled_at = UNSET else: @@ -467,86 +467,86 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_title(data: object) -> Union[None, Unset, str]: + def _parse_title(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) title = _parse_title(d.pop("title", UNSET)) _kind = d.pop("kind", UNSET) - kind: Union[Unset, NewIncidentDataAttributesKind] + kind: Unset | NewIncidentDataAttributesKind if isinstance(_kind, Unset): kind = UNSET else: kind = check_new_incident_data_attributes_kind(_kind) - def _parse_parent_incident_id(data: object) -> Union[None, Unset, str]: + def _parse_parent_incident_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) parent_incident_id = _parse_parent_incident_id(d.pop("parent_incident_id", UNSET)) - def _parse_duplicate_incident_id(data: object) -> Union[None, Unset, str]: + def _parse_duplicate_incident_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) duplicate_incident_id = _parse_duplicate_incident_id(d.pop("duplicate_incident_id", UNSET)) - def _parse_private(data: object) -> Union[None, Unset, bool]: + def _parse_private(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) private = _parse_private(d.pop("private", UNSET)) - def _parse_summary(data: object) -> Union[None, Unset, str]: + def _parse_summary(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) summary = _parse_summary(d.pop("summary", UNSET)) - def _parse_user_id(data: object) -> Union[None, Unset, str]: + def _parse_user_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) user_id = _parse_user_id(d.pop("user_id", UNSET)) - def _parse_severity_id(data: object) -> Union[None, Unset, str]: + def _parse_severity_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) severity_id = _parse_severity_id(d.pop("severity_id", UNSET)) - def _parse_public_title(data: object) -> Union[None, Unset, str]: + def _parse_public_title(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) public_title = _parse_public_title(d.pop("public_title", UNSET)) - def _parse_alert_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_alert_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -559,11 +559,11 @@ def _parse_alert_ids(data: object) -> Union[None, Unset, list[str]]: return alert_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) alert_ids = _parse_alert_ids(d.pop("alert_ids", UNSET)) - def _parse_environment_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_environment_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -576,11 +576,11 @@ def _parse_environment_ids(data: object) -> Union[None, Unset, list[str]]: return environment_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) environment_ids = _parse_environment_ids(d.pop("environment_ids", UNSET)) - def _parse_incident_type_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_incident_type_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -593,11 +593,11 @@ def _parse_incident_type_ids(data: object) -> Union[None, Unset, list[str]]: return incident_type_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) incident_type_ids = _parse_incident_type_ids(d.pop("incident_type_ids", UNSET)) - def _parse_service_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_service_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -610,11 +610,11 @@ def _parse_service_ids(data: object) -> Union[None, Unset, list[str]]: return service_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) service_ids = _parse_service_ids(d.pop("service_ids", UNSET)) - def _parse_functionality_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_functionality_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -627,11 +627,11 @@ def _parse_functionality_ids(data: object) -> Union[None, Unset, list[str]]: return functionality_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) functionality_ids = _parse_functionality_ids(d.pop("functionality_ids", UNSET)) - def _parse_group_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_group_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -644,11 +644,11 @@ def _parse_group_ids(data: object) -> Union[None, Unset, list[str]]: return group_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) group_ids = _parse_group_ids(d.pop("group_ids", UNSET)) - def _parse_cause_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_cause_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -661,11 +661,11 @@ def _parse_cause_ids(data: object) -> Union[None, Unset, list[str]]: return cause_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) cause_ids = _parse_cause_ids(d.pop("cause_ids", UNSET)) - def _parse_muted_service_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_muted_service_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -678,7 +678,7 @@ def _parse_muted_service_ids(data: object) -> Union[None, Unset, list[str]]: return muted_service_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) muted_service_ids = _parse_muted_service_ids(d.pop("muted_service_ids", UNSET)) @@ -699,88 +699,88 @@ def _parse_labels(data: object) -> Union["NewIncidentDataAttributesLabelsType0", labels = _parse_labels(d.pop("labels", UNSET)) - def _parse_slack_channel_name(data: object) -> Union[None, Unset, str]: + def _parse_slack_channel_name(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) slack_channel_name = _parse_slack_channel_name(d.pop("slack_channel_name", UNSET)) - def _parse_slack_channel_id(data: object) -> Union[None, Unset, str]: + def _parse_slack_channel_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) slack_channel_id = _parse_slack_channel_id(d.pop("slack_channel_id", UNSET)) - def _parse_slack_channel_url(data: object) -> Union[None, Unset, str]: + def _parse_slack_channel_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) slack_channel_url = _parse_slack_channel_url(d.pop("slack_channel_url", UNSET)) - def _parse_slack_channel_archived(data: object) -> Union[None, Unset, bool]: + def _parse_slack_channel_archived(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) slack_channel_archived = _parse_slack_channel_archived(d.pop("slack_channel_archived", UNSET)) - def _parse_google_drive_parent_id(data: object) -> Union[None, Unset, str]: + def _parse_google_drive_parent_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) google_drive_parent_id = _parse_google_drive_parent_id(d.pop("google_drive_parent_id", UNSET)) - def _parse_google_drive_url(data: object) -> Union[None, Unset, str]: + def _parse_google_drive_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) google_drive_url = _parse_google_drive_url(d.pop("google_drive_url", UNSET)) - def _parse_jira_issue_key(data: object) -> Union[None, Unset, str]: + def _parse_jira_issue_key(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) jira_issue_key = _parse_jira_issue_key(d.pop("jira_issue_key", UNSET)) - def _parse_jira_issue_id(data: object) -> Union[None, Unset, str]: + def _parse_jira_issue_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) jira_issue_id = _parse_jira_issue_id(d.pop("jira_issue_id", UNSET)) - def _parse_jira_issue_url(data: object) -> Union[None, Unset, str]: + def _parse_jira_issue_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) jira_issue_url = _parse_jira_issue_url(d.pop("jira_issue_url", UNSET)) - def _parse_notify_emails(data: object) -> Union[None, Unset, list[str]]: + def _parse_notify_emails(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -793,12 +793,12 @@ def _parse_notify_emails(data: object) -> Union[None, Unset, list[str]]: return notify_emails_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) notify_emails = _parse_notify_emails(d.pop("notify_emails", UNSET)) _status = d.pop("status", UNSET) - status: Union[Unset, NewIncidentDataAttributesStatus] + status: Unset | NewIncidentDataAttributesStatus if isinstance(_status, Unset): status = UNSET else: @@ -806,93 +806,93 @@ def _parse_notify_emails(data: object) -> Union[None, Unset, list[str]]: url = d.pop("url", UNSET) - def _parse_scheduled_for(data: object) -> Union[None, Unset, str]: + def _parse_scheduled_for(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) scheduled_for = _parse_scheduled_for(d.pop("scheduled_for", UNSET)) - def _parse_scheduled_until(data: object) -> Union[None, Unset, str]: + def _parse_scheduled_until(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) scheduled_until = _parse_scheduled_until(d.pop("scheduled_until", UNSET)) - def _parse_in_triage_at(data: object) -> Union[None, Unset, str]: + def _parse_in_triage_at(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) in_triage_at = _parse_in_triage_at(d.pop("in_triage_at", UNSET)) - def _parse_started_at(data: object) -> Union[None, Unset, str]: + def _parse_started_at(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) started_at = _parse_started_at(d.pop("started_at", UNSET)) - def _parse_detected_at(data: object) -> Union[None, Unset, str]: + def _parse_detected_at(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) detected_at = _parse_detected_at(d.pop("detected_at", UNSET)) - def _parse_acknowledged_at(data: object) -> Union[None, Unset, str]: + def _parse_acknowledged_at(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) acknowledged_at = _parse_acknowledged_at(d.pop("acknowledged_at", UNSET)) - def _parse_mitigated_at(data: object) -> Union[None, Unset, str]: + def _parse_mitigated_at(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) mitigated_at = _parse_mitigated_at(d.pop("mitigated_at", UNSET)) - def _parse_resolved_at(data: object) -> Union[None, Unset, str]: + def _parse_resolved_at(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) resolved_at = _parse_resolved_at(d.pop("resolved_at", UNSET)) - def _parse_closed_at(data: object) -> Union[None, Unset, str]: + def _parse_closed_at(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) closed_at = _parse_closed_at(d.pop("closed_at", UNSET)) - def _parse_cancelled_at(data: object) -> Union[None, Unset, str]: + def _parse_cancelled_at(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) cancelled_at = _parse_cancelled_at(d.pop("cancelled_at", UNSET)) diff --git a/rootly_sdk/models/new_incident_event_data_attributes.py b/rootly_sdk/models/new_incident_event_data_attributes.py index 2d703729..1255db60 100644 --- a/rootly_sdk/models/new_incident_event_data_attributes.py +++ b/rootly_sdk/models/new_incident_event_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define @@ -21,12 +21,12 @@ class NewIncidentEventDataAttributes: """ event: str - visibility: Union[Unset, NewIncidentEventDataAttributesVisibility] = UNSET + visibility: Unset | NewIncidentEventDataAttributesVisibility = UNSET def to_dict(self) -> dict[str, Any]: event = self.event - visibility: Union[Unset, str] = UNSET + visibility: Unset | str = UNSET if not isinstance(self.visibility, Unset): visibility = self.visibility @@ -48,7 +48,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: event = d.pop("event") _visibility = d.pop("visibility", UNSET) - visibility: Union[Unset, NewIncidentEventDataAttributesVisibility] + visibility: Unset | NewIncidentEventDataAttributesVisibility if isinstance(_visibility, Unset): visibility = UNSET else: diff --git a/rootly_sdk/models/new_incident_feedback_data_attributes.py b/rootly_sdk/models/new_incident_feedback_data_attributes.py index c1691aa8..eea1850a 100644 --- a/rootly_sdk/models/new_incident_feedback_data_attributes.py +++ b/rootly_sdk/models/new_incident_feedback_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define @@ -23,7 +23,7 @@ class NewIncidentFeedbackDataAttributes: feedback: str rating: NewIncidentFeedbackDataAttributesRating - anonymous: Union[Unset, bool] = UNSET + anonymous: Unset | bool = UNSET def to_dict(self) -> dict[str, Any]: feedback = self.feedback diff --git a/rootly_sdk/models/new_incident_form_field_selection_data_attributes.py b/rootly_sdk/models/new_incident_form_field_selection_data_attributes.py index e7adc0fd..5eb356f5 100644 --- a/rootly_sdk/models/new_incident_form_field_selection_data_attributes.py +++ b/rootly_sdk/models/new_incident_form_field_selection_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -28,61 +28,61 @@ class NewIncidentFormFieldSelectionDataAttributes: incident_id: str form_field_id: str - value: Union[None, Unset, str] = UNSET - selected_catalog_entity_ids: Union[Unset, list[str]] = UNSET - selected_group_ids: Union[Unset, list[str]] = UNSET - selected_option_ids: Union[Unset, list[str]] = UNSET - selected_service_ids: Union[Unset, list[str]] = UNSET - selected_functionality_ids: Union[Unset, list[str]] = UNSET - selected_user_ids: Union[Unset, list[int]] = UNSET - selected_environment_ids: Union[Unset, list[str]] = UNSET - selected_cause_ids: Union[Unset, list[str]] = UNSET - selected_incident_type_ids: Union[Unset, list[str]] = UNSET + value: None | Unset | str = UNSET + selected_catalog_entity_ids: Unset | list[str] = UNSET + selected_group_ids: Unset | list[str] = UNSET + selected_option_ids: Unset | list[str] = UNSET + selected_service_ids: Unset | list[str] = UNSET + selected_functionality_ids: Unset | list[str] = UNSET + selected_user_ids: Unset | list[int] = UNSET + selected_environment_ids: Unset | list[str] = UNSET + selected_cause_ids: Unset | list[str] = UNSET + selected_incident_type_ids: Unset | list[str] = UNSET def to_dict(self) -> dict[str, Any]: incident_id = self.incident_id form_field_id = self.form_field_id - value: Union[None, Unset, str] + value: None | Unset | str if isinstance(self.value, Unset): value = UNSET else: value = self.value - selected_catalog_entity_ids: Union[Unset, list[str]] = UNSET + selected_catalog_entity_ids: Unset | list[str] = UNSET if not isinstance(self.selected_catalog_entity_ids, Unset): selected_catalog_entity_ids = self.selected_catalog_entity_ids - selected_group_ids: Union[Unset, list[str]] = UNSET + selected_group_ids: Unset | list[str] = UNSET if not isinstance(self.selected_group_ids, Unset): selected_group_ids = self.selected_group_ids - selected_option_ids: Union[Unset, list[str]] = UNSET + selected_option_ids: Unset | list[str] = UNSET if not isinstance(self.selected_option_ids, Unset): selected_option_ids = self.selected_option_ids - selected_service_ids: Union[Unset, list[str]] = UNSET + selected_service_ids: Unset | list[str] = UNSET if not isinstance(self.selected_service_ids, Unset): selected_service_ids = self.selected_service_ids - selected_functionality_ids: Union[Unset, list[str]] = UNSET + selected_functionality_ids: Unset | list[str] = UNSET if not isinstance(self.selected_functionality_ids, Unset): selected_functionality_ids = self.selected_functionality_ids - selected_user_ids: Union[Unset, list[int]] = UNSET + selected_user_ids: Unset | list[int] = UNSET if not isinstance(self.selected_user_ids, Unset): selected_user_ids = self.selected_user_ids - selected_environment_ids: Union[Unset, list[str]] = UNSET + selected_environment_ids: Unset | list[str] = UNSET if not isinstance(self.selected_environment_ids, Unset): selected_environment_ids = self.selected_environment_ids - selected_cause_ids: Union[Unset, list[str]] = UNSET + selected_cause_ids: Unset | list[str] = UNSET if not isinstance(self.selected_cause_ids, Unset): selected_cause_ids = self.selected_cause_ids - selected_incident_type_ids: Union[Unset, list[str]] = UNSET + selected_incident_type_ids: Unset | list[str] = UNSET if not isinstance(self.selected_incident_type_ids, Unset): selected_incident_type_ids = self.selected_incident_type_ids @@ -124,12 +124,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: form_field_id = d.pop("form_field_id") - def _parse_value(data: object) -> Union[None, Unset, str]: + def _parse_value(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) value = _parse_value(d.pop("value", UNSET)) diff --git a/rootly_sdk/models/new_incident_permission_set_boolean_data_attributes.py b/rootly_sdk/models/new_incident_permission_set_boolean_data_attributes.py index 446e4fb2..ae802724 100644 --- a/rootly_sdk/models/new_incident_permission_set_boolean_data_attributes.py +++ b/rootly_sdk/models/new_incident_permission_set_boolean_data_attributes.py @@ -31,8 +31,8 @@ class NewIncidentPermissionSetBooleanDataAttributes: incident_permission_set_id: str kind: NewIncidentPermissionSetBooleanDataAttributesKind - private: Union[Unset, bool] = UNSET - enabled: Union[Unset, bool] = UNSET + private: Unset | bool = UNSET + enabled: Unset | bool = UNSET severity_params: Union[Unset, "NewIncidentPermissionSetBooleanDataAttributesSeverityParams"] = UNSET def to_dict(self) -> dict[str, Any]: @@ -44,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: enabled = self.enabled - severity_params: Union[Unset, dict[str, Any]] = UNSET + severity_params: Unset | dict[str, Any] = UNSET if not isinstance(self.severity_params, Unset): severity_params = self.severity_params.to_dict() @@ -81,7 +81,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: enabled = d.pop("enabled", UNSET) _severity_params = d.pop("severity_params", UNSET) - severity_params: Union[Unset, NewIncidentPermissionSetBooleanDataAttributesSeverityParams] + severity_params: Unset | NewIncidentPermissionSetBooleanDataAttributesSeverityParams if isinstance(_severity_params, Unset): severity_params = UNSET else: diff --git a/rootly_sdk/models/new_incident_permission_set_boolean_data_attributes_severity_params.py b/rootly_sdk/models/new_incident_permission_set_boolean_data_attributes_severity_params.py index 17f2f0de..fd4c5616 100644 --- a/rootly_sdk/models/new_incident_permission_set_boolean_data_attributes_severity_params.py +++ b/rootly_sdk/models/new_incident_permission_set_boolean_data_attributes_severity_params.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,10 +21,10 @@ class NewIncidentPermissionSetBooleanDataAttributesSeverityParams: matching severity """ - fully_enabled: Union[Unset, bool] = True - create_enabled: Union[Unset, bool] = False - applies_to_unassigned: Union[Unset, bool] = True - severity_ids: Union[None, Unset, list[str]] = UNSET + fully_enabled: Unset | bool = True + create_enabled: Unset | bool = False + applies_to_unassigned: Unset | bool = True + severity_ids: None | Unset | list[str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -34,7 +34,7 @@ def to_dict(self) -> dict[str, Any]: applies_to_unassigned = self.applies_to_unassigned - severity_ids: Union[None, Unset, list[str]] + severity_ids: None | Unset | list[str] if isinstance(self.severity_ids, Unset): severity_ids = UNSET elif isinstance(self.severity_ids, list): @@ -66,7 +66,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: applies_to_unassigned = d.pop("applies_to_unassigned", UNSET) - def _parse_severity_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_severity_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -79,7 +79,7 @@ def _parse_severity_ids(data: object) -> Union[None, Unset, list[str]]: return severity_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) severity_ids = _parse_severity_ids(d.pop("severity_ids", UNSET)) diff --git a/rootly_sdk/models/new_incident_permission_set_data_attributes.py b/rootly_sdk/models/new_incident_permission_set_data_attributes.py index 5765511f..dc5020e0 100644 --- a/rootly_sdk/models/new_incident_permission_set_data_attributes.py +++ b/rootly_sdk/models/new_incident_permission_set_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -31,38 +31,38 @@ class NewIncidentPermissionSetDataAttributes: """ name: str - slug: Union[None, Unset, str] = UNSET - description: Union[None, Unset, str] = UNSET - private_incident_permissions: Union[ - Unset, list[NewIncidentPermissionSetDataAttributesPrivateIncidentPermissionsItem] - ] = UNSET - public_incident_permissions: Union[ - Unset, list[NewIncidentPermissionSetDataAttributesPublicIncidentPermissionsItem] - ] = UNSET + slug: None | Unset | str = UNSET + description: None | Unset | str = UNSET + private_incident_permissions: Unset | list[NewIncidentPermissionSetDataAttributesPrivateIncidentPermissionsItem] = ( + UNSET + ) + public_incident_permissions: Unset | list[NewIncidentPermissionSetDataAttributesPublicIncidentPermissionsItem] = ( + UNSET + ) def to_dict(self) -> dict[str, Any]: name = self.name - slug: Union[None, Unset, str] + slug: None | Unset | str if isinstance(self.slug, Unset): slug = UNSET else: slug = self.slug - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - private_incident_permissions: Union[Unset, list[str]] = UNSET + private_incident_permissions: Unset | list[str] = UNSET if not isinstance(self.private_incident_permissions, Unset): private_incident_permissions = [] for private_incident_permissions_item_data in self.private_incident_permissions: private_incident_permissions_item: str = private_incident_permissions_item_data private_incident_permissions.append(private_incident_permissions_item) - public_incident_permissions: Union[Unset, list[str]] = UNSET + public_incident_permissions: Unset | list[str] = UNSET if not isinstance(self.public_incident_permissions, Unset): public_incident_permissions = [] for public_incident_permissions_item_data in self.public_incident_permissions: @@ -92,21 +92,21 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name") - def _parse_slug(data: object) -> Union[None, Unset, str]: + def _parse_slug(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) slug = _parse_slug(d.pop("slug", UNSET)) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) diff --git a/rootly_sdk/models/new_incident_permission_set_resource_data_attributes.py b/rootly_sdk/models/new_incident_permission_set_resource_data_attributes.py index 82ff2824..e195b196 100644 --- a/rootly_sdk/models/new_incident_permission_set_resource_data_attributes.py +++ b/rootly_sdk/models/new_incident_permission_set_resource_data_attributes.py @@ -32,9 +32,9 @@ class NewIncidentPermissionSetResourceDataAttributes: incident_permission_set_id: str kind: NewIncidentPermissionSetResourceDataAttributesKind - private: Union[Unset, bool] = UNSET - resource_id: Union[Unset, str] = UNSET - resource_type: Union[Unset, str] = UNSET + private: Unset | bool = UNSET + resource_id: Unset | str = UNSET + resource_type: Unset | str = UNSET severity_params: Union[Unset, "NewIncidentPermissionSetResourceDataAttributesSeverityParams"] = UNSET def to_dict(self) -> dict[str, Any]: @@ -48,7 +48,7 @@ def to_dict(self) -> dict[str, Any]: resource_type = self.resource_type - severity_params: Union[Unset, dict[str, Any]] = UNSET + severity_params: Unset | dict[str, Any] = UNSET if not isinstance(self.severity_params, Unset): severity_params = self.severity_params.to_dict() @@ -89,7 +89,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: resource_type = d.pop("resource_type", UNSET) _severity_params = d.pop("severity_params", UNSET) - severity_params: Union[Unset, NewIncidentPermissionSetResourceDataAttributesSeverityParams] + severity_params: Unset | NewIncidentPermissionSetResourceDataAttributesSeverityParams if isinstance(_severity_params, Unset): severity_params = UNSET else: diff --git a/rootly_sdk/models/new_incident_permission_set_resource_data_attributes_severity_params.py b/rootly_sdk/models/new_incident_permission_set_resource_data_attributes_severity_params.py index 72c8ef82..e610b5e1 100644 --- a/rootly_sdk/models/new_incident_permission_set_resource_data_attributes_severity_params.py +++ b/rootly_sdk/models/new_incident_permission_set_resource_data_attributes_severity_params.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,10 +21,10 @@ class NewIncidentPermissionSetResourceDataAttributesSeverityParams: matching severity """ - fully_enabled: Union[Unset, bool] = True - create_enabled: Union[Unset, bool] = False - applies_to_unassigned: Union[Unset, bool] = True - severity_ids: Union[None, Unset, list[str]] = UNSET + fully_enabled: Unset | bool = True + create_enabled: Unset | bool = False + applies_to_unassigned: Unset | bool = True + severity_ids: None | Unset | list[str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -34,7 +34,7 @@ def to_dict(self) -> dict[str, Any]: applies_to_unassigned = self.applies_to_unassigned - severity_ids: Union[None, Unset, list[str]] + severity_ids: None | Unset | list[str] if isinstance(self.severity_ids, Unset): severity_ids = UNSET elif isinstance(self.severity_ids, list): @@ -66,7 +66,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: applies_to_unassigned = d.pop("applies_to_unassigned", UNSET) - def _parse_severity_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_severity_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -79,7 +79,7 @@ def _parse_severity_ids(data: object) -> Union[None, Unset, list[str]]: return severity_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) severity_ids = _parse_severity_ids(d.pop("severity_ids", UNSET)) diff --git a/rootly_sdk/models/new_incident_role_data_attributes.py b/rootly_sdk/models/new_incident_role_data_attributes.py index 50825d41..b9d3caf1 100644 --- a/rootly_sdk/models/new_incident_role_data_attributes.py +++ b/rootly_sdk/models/new_incident_role_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -24,36 +24,36 @@ class NewIncidentRoleDataAttributes: """ name: str - slug: Union[None, Unset, str] = UNSET - summary: Union[None, Unset, str] = UNSET - description: Union[None, Unset, str] = UNSET - position: Union[None, Unset, int] = UNSET - optional: Union[Unset, bool] = UNSET - enabled: Union[Unset, bool] = UNSET - allow_multi_user_assignment: Union[Unset, bool] = UNSET + slug: None | Unset | str = UNSET + summary: None | Unset | str = UNSET + description: None | Unset | str = UNSET + position: None | Unset | int = UNSET + optional: Unset | bool = UNSET + enabled: Unset | bool = UNSET + allow_multi_user_assignment: Unset | bool = UNSET def to_dict(self) -> dict[str, Any]: name = self.name - slug: Union[None, Unset, str] + slug: None | Unset | str if isinstance(self.slug, Unset): slug = UNSET else: slug = self.slug - summary: Union[None, Unset, str] + summary: None | Unset | str if isinstance(self.summary, Unset): summary = UNSET else: summary = self.summary - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - position: Union[None, Unset, int] + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: @@ -94,39 +94,39 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name") - def _parse_slug(data: object) -> Union[None, Unset, str]: + def _parse_slug(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) slug = _parse_slug(d.pop("slug", UNSET)) - def _parse_summary(data: object) -> Union[None, Unset, str]: + def _parse_summary(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) summary = _parse_summary(d.pop("summary", UNSET)) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_position(data: object) -> Union[None, Unset, int]: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) diff --git a/rootly_sdk/models/new_incident_role_task_data_attributes.py b/rootly_sdk/models/new_incident_role_task_data_attributes.py index b7b5b260..02f7f4c8 100644 --- a/rootly_sdk/models/new_incident_role_task_data_attributes.py +++ b/rootly_sdk/models/new_incident_role_task_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -23,22 +23,22 @@ class NewIncidentRoleTaskDataAttributes: """ task: str - incident_role_id: Union[Unset, str] = UNSET - description: Union[None, Unset, str] = UNSET - priority: Union[Unset, NewIncidentRoleTaskDataAttributesPriority] = UNSET + incident_role_id: Unset | str = UNSET + description: None | Unset | str = UNSET + priority: Unset | NewIncidentRoleTaskDataAttributesPriority = UNSET def to_dict(self) -> dict[str, Any]: task = self.task incident_role_id = self.incident_role_id - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - priority: Union[Unset, str] = UNSET + priority: Unset | str = UNSET if not isinstance(self.priority, Unset): priority = self.priority @@ -65,17 +65,17 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: incident_role_id = d.pop("incident_role_id", UNSET) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) _priority = d.pop("priority", UNSET) - priority: Union[Unset, NewIncidentRoleTaskDataAttributesPriority] + priority: Unset | NewIncidentRoleTaskDataAttributesPriority if isinstance(_priority, Unset): priority = UNSET else: diff --git a/rootly_sdk/models/new_incident_status_page_event_data_attributes.py b/rootly_sdk/models/new_incident_status_page_event_data_attributes.py index f1ecd25c..064c28c0 100644 --- a/rootly_sdk/models/new_incident_status_page_event_data_attributes.py +++ b/rootly_sdk/models/new_incident_status_page_event_data_attributes.py @@ -1,6 +1,6 @@ import datetime from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from dateutil.parser import isoparse @@ -39,37 +39,37 @@ class NewIncidentStatusPageEventDataAttributes: """ event: str - status_page_id: Union[Unset, str] = UNSET - status: Union[Unset, NewIncidentStatusPageEventDataAttributesStatus] = UNSET - notify_subscribers: Union[None, Unset, bool] = False - should_tweet: Union[None, Unset, bool] = False - started_at: Union[None, Unset, datetime.datetime] = UNSET - status_page_components: Union[ - None, Unset, list["NewIncidentStatusPageEventDataAttributesStatusPageComponentsType0Item"] - ] = UNSET + status_page_id: Unset | str = UNSET + status: Unset | NewIncidentStatusPageEventDataAttributesStatus = UNSET + notify_subscribers: None | Unset | bool = False + should_tweet: None | Unset | bool = False + started_at: None | Unset | datetime.datetime = UNSET + status_page_components: ( + None | Unset | list["NewIncidentStatusPageEventDataAttributesStatusPageComponentsType0Item"] + ) = UNSET def to_dict(self) -> dict[str, Any]: event = self.event status_page_id = self.status_page_id - status: Union[Unset, str] = UNSET + status: Unset | str = UNSET if not isinstance(self.status, Unset): status = self.status - notify_subscribers: Union[None, Unset, bool] + notify_subscribers: None | Unset | bool if isinstance(self.notify_subscribers, Unset): notify_subscribers = UNSET else: notify_subscribers = self.notify_subscribers - should_tweet: Union[None, Unset, bool] + should_tweet: None | Unset | bool if isinstance(self.should_tweet, Unset): should_tweet = UNSET else: should_tweet = self.should_tweet - started_at: Union[None, Unset, str] + started_at: None | Unset | str if isinstance(self.started_at, Unset): started_at = UNSET elif isinstance(self.started_at, datetime.datetime): @@ -77,7 +77,7 @@ def to_dict(self) -> dict[str, Any]: else: started_at = self.started_at - status_page_components: Union[None, Unset, list[dict[str, Any]]] + status_page_components: None | Unset | list[dict[str, Any]] if isinstance(self.status_page_components, Unset): status_page_components = UNSET elif isinstance(self.status_page_components, list): @@ -123,31 +123,31 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: status_page_id = d.pop("status_page_id", UNSET) _status = d.pop("status", UNSET) - status: Union[Unset, NewIncidentStatusPageEventDataAttributesStatus] + status: Unset | NewIncidentStatusPageEventDataAttributesStatus if isinstance(_status, Unset): status = UNSET else: status = check_new_incident_status_page_event_data_attributes_status(_status) - def _parse_notify_subscribers(data: object) -> Union[None, Unset, bool]: + def _parse_notify_subscribers(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) notify_subscribers = _parse_notify_subscribers(d.pop("notify_subscribers", UNSET)) - def _parse_should_tweet(data: object) -> Union[None, Unset, bool]: + def _parse_should_tweet(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) should_tweet = _parse_should_tweet(d.pop("should_tweet", UNSET)) - def _parse_started_at(data: object) -> Union[None, Unset, datetime.datetime]: + def _parse_started_at(data: object) -> None | Unset | datetime.datetime: if data is None: return data if isinstance(data, Unset): @@ -160,13 +160,13 @@ def _parse_started_at(data: object) -> Union[None, Unset, datetime.datetime]: return started_at_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, datetime.datetime], data) + return cast(None | Unset | datetime.datetime, data) started_at = _parse_started_at(d.pop("started_at", UNSET)) def _parse_status_page_components( data: object, - ) -> Union[None, Unset, list["NewIncidentStatusPageEventDataAttributesStatusPageComponentsType0Item"]]: + ) -> None | Unset | list["NewIncidentStatusPageEventDataAttributesStatusPageComponentsType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -189,7 +189,7 @@ def _parse_status_page_components( except: # noqa: E722 pass return cast( - Union[None, Unset, list["NewIncidentStatusPageEventDataAttributesStatusPageComponentsType0Item"]], data + None | Unset | list["NewIncidentStatusPageEventDataAttributesStatusPageComponentsType0Item"], data ) status_page_components = _parse_status_page_components(d.pop("status_page_components", UNSET)) diff --git a/rootly_sdk/models/new_incident_status_page_event_data_attributes_status_page_components_type_0_item.py b/rootly_sdk/models/new_incident_status_page_event_data_attributes_status_page_components_type_0_item.py index 2f6a5959..61be84a5 100644 --- a/rootly_sdk/models/new_incident_status_page_event_data_attributes_status_page_components_type_0_item.py +++ b/rootly_sdk/models/new_incident_status_page_event_data_attributes_status_page_components_type_0_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define @@ -22,12 +22,12 @@ class NewIncidentStatusPageEventDataAttributesStatusPageComponentsType0Item: """ status_page_component_id: str - status: Union[Unset, NewIncidentStatusPageEventDataAttributesStatusPageComponentsType0ItemStatus] = UNSET + status: Unset | NewIncidentStatusPageEventDataAttributesStatusPageComponentsType0ItemStatus = UNSET def to_dict(self) -> dict[str, Any]: status_page_component_id = self.status_page_component_id - status: Union[Unset, str] = UNSET + status: Unset | str = UNSET if not isinstance(self.status, Unset): status = self.status @@ -49,7 +49,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: status_page_component_id = d.pop("status_page_component_id") _status = d.pop("status", UNSET) - status: Union[Unset, NewIncidentStatusPageEventDataAttributesStatusPageComponentsType0ItemStatus] + status: Unset | NewIncidentStatusPageEventDataAttributesStatusPageComponentsType0ItemStatus if isinstance(_status, Unset): status = UNSET else: diff --git a/rootly_sdk/models/new_incident_sub_status_data_attributes.py b/rootly_sdk/models/new_incident_sub_status_data_attributes.py index 03aadab4..27d2e96e 100644 --- a/rootly_sdk/models/new_incident_sub_status_data_attributes.py +++ b/rootly_sdk/models/new_incident_sub_status_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -21,14 +21,14 @@ class NewIncidentSubStatusDataAttributes: sub_status_id: str assigned_at: str - assigned_by_user_id: Union[None, Unset, int] = UNSET + assigned_by_user_id: None | Unset | int = UNSET def to_dict(self) -> dict[str, Any]: sub_status_id = self.sub_status_id assigned_at = self.assigned_at - assigned_by_user_id: Union[None, Unset, int] + assigned_by_user_id: None | Unset | int if isinstance(self.assigned_by_user_id, Unset): assigned_by_user_id = UNSET else: @@ -54,12 +54,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: assigned_at = d.pop("assigned_at") - def _parse_assigned_by_user_id(data: object) -> Union[None, Unset, int]: + def _parse_assigned_by_user_id(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) assigned_by_user_id = _parse_assigned_by_user_id(d.pop("assigned_by_user_id", UNSET)) diff --git a/rootly_sdk/models/new_incident_type_data_attributes.py b/rootly_sdk/models/new_incident_type_data_attributes.py index 20c1fffa..895db080 100644 --- a/rootly_sdk/models/new_incident_type_data_attributes.py +++ b/rootly_sdk/models/new_incident_type_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define @@ -39,50 +39,50 @@ class NewIncidentTypeDataAttributes: """ name: str - slug: Union[None, Unset, str] = UNSET - description: Union[None, Unset, str] = UNSET - public_description: Union[None, Unset, str] = UNSET - color: Union[None, Unset, str] = UNSET - position: Union[None, Unset, int] = UNSET - notify_emails: Union[None, Unset, list[str]] = UNSET - slack_channels: Union[None, Unset, list["NewIncidentTypeDataAttributesSlackChannelsType0Item"]] = UNSET - slack_aliases: Union[None, Unset, list["NewIncidentTypeDataAttributesSlackAliasesType0Item"]] = UNSET - properties: Union[Unset, list["NewIncidentTypeDataAttributesPropertiesItem"]] = UNSET + slug: None | Unset | str = UNSET + description: None | Unset | str = UNSET + public_description: None | Unset | str = UNSET + color: None | Unset | str = UNSET + position: None | Unset | int = UNSET + notify_emails: None | Unset | list[str] = UNSET + slack_channels: None | Unset | list["NewIncidentTypeDataAttributesSlackChannelsType0Item"] = UNSET + slack_aliases: None | Unset | list["NewIncidentTypeDataAttributesSlackAliasesType0Item"] = UNSET + properties: Unset | list["NewIncidentTypeDataAttributesPropertiesItem"] = UNSET def to_dict(self) -> dict[str, Any]: name = self.name - slug: Union[None, Unset, str] + slug: None | Unset | str if isinstance(self.slug, Unset): slug = UNSET else: slug = self.slug - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - public_description: Union[None, Unset, str] + public_description: None | Unset | str if isinstance(self.public_description, Unset): public_description = UNSET else: public_description = self.public_description - color: Union[None, Unset, str] + color: None | Unset | str if isinstance(self.color, Unset): color = UNSET else: color = self.color - position: Union[None, Unset, int] + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: position = self.position - notify_emails: Union[None, Unset, list[str]] + notify_emails: None | Unset | list[str] if isinstance(self.notify_emails, Unset): notify_emails = UNSET elif isinstance(self.notify_emails, list): @@ -91,7 +91,7 @@ def to_dict(self) -> dict[str, Any]: else: notify_emails = self.notify_emails - slack_channels: Union[None, Unset, list[dict[str, Any]]] + slack_channels: None | Unset | list[dict[str, Any]] if isinstance(self.slack_channels, Unset): slack_channels = UNSET elif isinstance(self.slack_channels, list): @@ -103,7 +103,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_channels = self.slack_channels - slack_aliases: Union[None, Unset, list[dict[str, Any]]] + slack_aliases: None | Unset | list[dict[str, Any]] if isinstance(self.slack_aliases, Unset): slack_aliases = UNSET elif isinstance(self.slack_aliases, list): @@ -115,7 +115,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_aliases = self.slack_aliases - properties: Union[Unset, list[dict[str, Any]]] = UNSET + properties: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.properties, Unset): properties = [] for properties_item_data in self.properties: @@ -165,52 +165,52 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name") - def _parse_slug(data: object) -> Union[None, Unset, str]: + def _parse_slug(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) slug = _parse_slug(d.pop("slug", UNSET)) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_public_description(data: object) -> Union[None, Unset, str]: + def _parse_public_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) public_description = _parse_public_description(d.pop("public_description", UNSET)) - def _parse_color(data: object) -> Union[None, Unset, str]: + def _parse_color(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) color = _parse_color(d.pop("color", UNSET)) - def _parse_position(data: object) -> Union[None, Unset, int]: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) - def _parse_notify_emails(data: object) -> Union[None, Unset, list[str]]: + def _parse_notify_emails(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -223,13 +223,13 @@ def _parse_notify_emails(data: object) -> Union[None, Unset, list[str]]: return notify_emails_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) notify_emails = _parse_notify_emails(d.pop("notify_emails", UNSET)) def _parse_slack_channels( data: object, - ) -> Union[None, Unset, list["NewIncidentTypeDataAttributesSlackChannelsType0Item"]]: + ) -> None | Unset | list["NewIncidentTypeDataAttributesSlackChannelsType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -249,13 +249,13 @@ def _parse_slack_channels( return slack_channels_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list["NewIncidentTypeDataAttributesSlackChannelsType0Item"]], data) + return cast(None | Unset | list["NewIncidentTypeDataAttributesSlackChannelsType0Item"], data) slack_channels = _parse_slack_channels(d.pop("slack_channels", UNSET)) def _parse_slack_aliases( data: object, - ) -> Union[None, Unset, list["NewIncidentTypeDataAttributesSlackAliasesType0Item"]]: + ) -> None | Unset | list["NewIncidentTypeDataAttributesSlackAliasesType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -275,7 +275,7 @@ def _parse_slack_aliases( return slack_aliases_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list["NewIncidentTypeDataAttributesSlackAliasesType0Item"]], data) + return cast(None | Unset | list["NewIncidentTypeDataAttributesSlackAliasesType0Item"], data) slack_aliases = _parse_slack_aliases(d.pop("slack_aliases", UNSET)) diff --git a/rootly_sdk/models/new_live_call_router_data_attributes.py b/rootly_sdk/models/new_live_call_router_data_attributes.py index 6ce57b42..af5e361b 100644 --- a/rootly_sdk/models/new_live_call_router_data_attributes.py +++ b/rootly_sdk/models/new_live_call_router_data_attributes.py @@ -82,20 +82,20 @@ class NewLiveCallRouterDataAttributes: phone_number: str voicemail_greeting: str paging_targets: list["NewLiveCallRouterDataAttributesPagingTargetsItem"] - enabled: Union[Unset, bool] = UNSET - caller_greeting: Union[Unset, str] = UNSET - unavailable_responder_message: Union[None, Unset, str] = UNSET - waiting_music_url: Union[Unset, NewLiveCallRouterDataAttributesWaitingMusicUrl] = UNSET - sent_to_voicemail_delay: Union[Unset, int] = UNSET - should_redirect_to_voicemail_on_no_answer: Union[Unset, bool] = UNSET - escalation_level_delay_in_seconds: Union[Unset, int] = UNSET - should_auto_resolve_alert_on_call_end: Union[Unset, bool] = UNSET - notify_via_sms: Union[Unset, bool] = UNSET - notify_via_push_notification: Union[Unset, bool] = UNSET - informational_notification_message: Union[None, Unset, str] = UNSET - alert_urgency_id: Union[Unset, str] = UNSET - calling_tree_enabled: Union[Unset, bool] = UNSET - calling_tree_prompt: Union[Unset, str] = UNSET + enabled: Unset | bool = UNSET + caller_greeting: Unset | str = UNSET + unavailable_responder_message: None | Unset | str = UNSET + waiting_music_url: Unset | NewLiveCallRouterDataAttributesWaitingMusicUrl = UNSET + sent_to_voicemail_delay: Unset | int = UNSET + should_redirect_to_voicemail_on_no_answer: Unset | bool = UNSET + escalation_level_delay_in_seconds: Unset | int = UNSET + should_auto_resolve_alert_on_call_end: Unset | bool = UNSET + notify_via_sms: Unset | bool = UNSET + notify_via_push_notification: Unset | bool = UNSET + informational_notification_message: None | Unset | str = UNSET + alert_urgency_id: Unset | str = UNSET + calling_tree_enabled: Unset | bool = UNSET + calling_tree_prompt: Unset | str = UNSET escalation_policy_trigger_params: Union[Unset, "NewLiveCallRouterDataAttributesEscalationPolicyTriggerParams"] = ( UNSET ) @@ -122,13 +122,13 @@ def to_dict(self) -> dict[str, Any]: caller_greeting = self.caller_greeting - unavailable_responder_message: Union[None, Unset, str] + unavailable_responder_message: None | Unset | str if isinstance(self.unavailable_responder_message, Unset): unavailable_responder_message = UNSET else: unavailable_responder_message = self.unavailable_responder_message - waiting_music_url: Union[Unset, str] = UNSET + waiting_music_url: Unset | str = UNSET if not isinstance(self.waiting_music_url, Unset): waiting_music_url = self.waiting_music_url @@ -144,7 +144,7 @@ def to_dict(self) -> dict[str, Any]: notify_via_push_notification = self.notify_via_push_notification - informational_notification_message: Union[None, Unset, str] + informational_notification_message: None | Unset | str if isinstance(self.informational_notification_message, Unset): informational_notification_message = UNSET else: @@ -156,7 +156,7 @@ def to_dict(self) -> dict[str, Any]: calling_tree_prompt = self.calling_tree_prompt - escalation_policy_trigger_params: Union[Unset, dict[str, Any]] = UNSET + escalation_policy_trigger_params: Unset | dict[str, Any] = UNSET if not isinstance(self.escalation_policy_trigger_params, Unset): escalation_policy_trigger_params = self.escalation_policy_trigger_params.to_dict() @@ -239,19 +239,19 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: caller_greeting = d.pop("caller_greeting", UNSET) - def _parse_unavailable_responder_message(data: object) -> Union[None, Unset, str]: + def _parse_unavailable_responder_message(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) unavailable_responder_message = _parse_unavailable_responder_message( d.pop("unavailable_responder_message", UNSET) ) _waiting_music_url = d.pop("waiting_music_url", UNSET) - waiting_music_url: Union[Unset, NewLiveCallRouterDataAttributesWaitingMusicUrl] + waiting_music_url: Unset | NewLiveCallRouterDataAttributesWaitingMusicUrl if isinstance(_waiting_music_url, Unset): waiting_music_url = UNSET else: @@ -269,12 +269,12 @@ def _parse_unavailable_responder_message(data: object) -> Union[None, Unset, str notify_via_push_notification = d.pop("notify_via_push_notification", UNSET) - def _parse_informational_notification_message(data: object) -> Union[None, Unset, str]: + def _parse_informational_notification_message(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) informational_notification_message = _parse_informational_notification_message( d.pop("informational_notification_message", UNSET) @@ -287,7 +287,7 @@ def _parse_informational_notification_message(data: object) -> Union[None, Unset calling_tree_prompt = d.pop("calling_tree_prompt", UNSET) _escalation_policy_trigger_params = d.pop("escalation_policy_trigger_params", UNSET) - escalation_policy_trigger_params: Union[Unset, NewLiveCallRouterDataAttributesEscalationPolicyTriggerParams] + escalation_policy_trigger_params: Unset | NewLiveCallRouterDataAttributesEscalationPolicyTriggerParams if isinstance(_escalation_policy_trigger_params, Unset): escalation_policy_trigger_params = UNSET else: diff --git a/rootly_sdk/models/new_on_call_pay_report_data_attributes.py b/rootly_sdk/models/new_on_call_pay_report_data_attributes.py index d9212e3c..120e42a2 100644 --- a/rootly_sdk/models/new_on_call_pay_report_data_attributes.py +++ b/rootly_sdk/models/new_on_call_pay_report_data_attributes.py @@ -1,6 +1,6 @@ import datetime from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from dateutil.parser import isoparse @@ -25,16 +25,16 @@ class NewOnCallPayReportDataAttributes: start_date: datetime.date end_date: datetime.date - schedule_ids: Union[Unset, list[str]] = UNSET - time_zone: Union[Unset, str] = UNSET - use_responders_time_zone: Union[Unset, bool] = UNSET + schedule_ids: Unset | list[str] = UNSET + time_zone: Unset | str = UNSET + use_responders_time_zone: Unset | bool = UNSET def to_dict(self) -> dict[str, Any]: start_date = self.start_date.isoformat() end_date = self.end_date.isoformat() - schedule_ids: Union[Unset, list[str]] = UNSET + schedule_ids: Unset | list[str] = UNSET if not isinstance(self.schedule_ids, Unset): schedule_ids = self.schedule_ids diff --git a/rootly_sdk/models/new_on_call_role_data_attributes.py b/rootly_sdk/models/new_on_call_role_data_attributes.py index 28278864..cd1c4d48 100644 --- a/rootly_sdk/models/new_on_call_role_data_attributes.py +++ b/rootly_sdk/models/new_on_call_role_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -143,45 +143,39 @@ class NewOnCallRoleDataAttributes: """ name: str - slug: Union[None, Unset, str] = UNSET - system_role: Union[Unset, str] = "custom" - alert_fields_permissions: Union[Unset, list[NewOnCallRoleDataAttributesAlertFieldsPermissionsItem]] = UNSET - alert_groups_permissions: Union[Unset, list[NewOnCallRoleDataAttributesAlertGroupsPermissionsItem]] = UNSET - alert_routing_rules_permissions: Union[Unset, list[NewOnCallRoleDataAttributesAlertRoutingRulesPermissionsItem]] = ( - UNSET - ) - on_call_readiness_report_permissions: Union[ - Unset, list[NewOnCallRoleDataAttributesOnCallReadinessReportPermissionsItem] - ] = UNSET - on_call_roles_permissions: Union[Unset, list[NewOnCallRoleDataAttributesOnCallRolesPermissionsItem]] = UNSET - alert_sources_permissions: Union[Unset, list[NewOnCallRoleDataAttributesAlertSourcesPermissionsItem]] = UNSET - alert_urgency_permissions: Union[Unset, list[NewOnCallRoleDataAttributesAlertUrgencyPermissionsItem]] = UNSET - alerts_permissions: Union[Unset, list[NewOnCallRoleDataAttributesAlertsPermissionsItem]] = UNSET - api_keys_permissions: Union[Unset, list[NewOnCallRoleDataAttributesApiKeysPermissionsItem]] = UNSET - audits_permissions: Union[Unset, list[NewOnCallRoleDataAttributesAuditsPermissionsItem]] = UNSET - contacts_permissions: Union[Unset, list[NewOnCallRoleDataAttributesContactsPermissionsItem]] = UNSET - escalation_policies_permissions: Union[ - Unset, list[NewOnCallRoleDataAttributesEscalationPoliciesPermissionsItem] - ] = UNSET - groups_permissions: Union[Unset, list[NewOnCallRoleDataAttributesGroupsPermissionsItem]] = UNSET - heartbeats_permissions: Union[Unset, list[NewOnCallRoleDataAttributesHeartbeatsPermissionsItem]] = UNSET - integrations_permissions: Union[Unset, list[NewOnCallRoleDataAttributesIntegrationsPermissionsItem]] = UNSET - invitations_permissions: Union[Unset, list[NewOnCallRoleDataAttributesInvitationsPermissionsItem]] = UNSET - live_call_routing_permissions: Union[Unset, list[NewOnCallRoleDataAttributesLiveCallRoutingPermissionsItem]] = UNSET - schedule_override_permissions: Union[Unset, list[NewOnCallRoleDataAttributesScheduleOverridePermissionsItem]] = ( - UNSET - ) - schedules_permissions: Union[Unset, list[NewOnCallRoleDataAttributesSchedulesPermissionsItem]] = UNSET - services_permissions: Union[Unset, list[NewOnCallRoleDataAttributesServicesPermissionsItem]] = UNSET - functionalities_permissions: Union[Unset, list[NewOnCallRoleDataAttributesFunctionalitiesPermissionsItem]] = UNSET - webhooks_permissions: Union[Unset, list[NewOnCallRoleDataAttributesWebhooksPermissionsItem]] = UNSET - workflows_permissions: Union[Unset, list[NewOnCallRoleDataAttributesWorkflowsPermissionsItem]] = UNSET - catalogs_permissions: Union[Unset, list[NewOnCallRoleDataAttributesCatalogsPermissionsItem]] = UNSET + slug: None | Unset | str = UNSET + system_role: Unset | str = "custom" + alert_fields_permissions: Unset | list[NewOnCallRoleDataAttributesAlertFieldsPermissionsItem] = UNSET + alert_groups_permissions: Unset | list[NewOnCallRoleDataAttributesAlertGroupsPermissionsItem] = UNSET + alert_routing_rules_permissions: Unset | list[NewOnCallRoleDataAttributesAlertRoutingRulesPermissionsItem] = UNSET + on_call_readiness_report_permissions: ( + Unset | list[NewOnCallRoleDataAttributesOnCallReadinessReportPermissionsItem] + ) = UNSET + on_call_roles_permissions: Unset | list[NewOnCallRoleDataAttributesOnCallRolesPermissionsItem] = UNSET + alert_sources_permissions: Unset | list[NewOnCallRoleDataAttributesAlertSourcesPermissionsItem] = UNSET + alert_urgency_permissions: Unset | list[NewOnCallRoleDataAttributesAlertUrgencyPermissionsItem] = UNSET + alerts_permissions: Unset | list[NewOnCallRoleDataAttributesAlertsPermissionsItem] = UNSET + api_keys_permissions: Unset | list[NewOnCallRoleDataAttributesApiKeysPermissionsItem] = UNSET + audits_permissions: Unset | list[NewOnCallRoleDataAttributesAuditsPermissionsItem] = UNSET + contacts_permissions: Unset | list[NewOnCallRoleDataAttributesContactsPermissionsItem] = UNSET + escalation_policies_permissions: Unset | list[NewOnCallRoleDataAttributesEscalationPoliciesPermissionsItem] = UNSET + groups_permissions: Unset | list[NewOnCallRoleDataAttributesGroupsPermissionsItem] = UNSET + heartbeats_permissions: Unset | list[NewOnCallRoleDataAttributesHeartbeatsPermissionsItem] = UNSET + integrations_permissions: Unset | list[NewOnCallRoleDataAttributesIntegrationsPermissionsItem] = UNSET + invitations_permissions: Unset | list[NewOnCallRoleDataAttributesInvitationsPermissionsItem] = UNSET + live_call_routing_permissions: Unset | list[NewOnCallRoleDataAttributesLiveCallRoutingPermissionsItem] = UNSET + schedule_override_permissions: Unset | list[NewOnCallRoleDataAttributesScheduleOverridePermissionsItem] = UNSET + schedules_permissions: Unset | list[NewOnCallRoleDataAttributesSchedulesPermissionsItem] = UNSET + services_permissions: Unset | list[NewOnCallRoleDataAttributesServicesPermissionsItem] = UNSET + functionalities_permissions: Unset | list[NewOnCallRoleDataAttributesFunctionalitiesPermissionsItem] = UNSET + webhooks_permissions: Unset | list[NewOnCallRoleDataAttributesWebhooksPermissionsItem] = UNSET + workflows_permissions: Unset | list[NewOnCallRoleDataAttributesWorkflowsPermissionsItem] = UNSET + catalogs_permissions: Unset | list[NewOnCallRoleDataAttributesCatalogsPermissionsItem] = UNSET def to_dict(self) -> dict[str, Any]: name = self.name - slug: Union[None, Unset, str] + slug: None | Unset | str if isinstance(self.slug, Unset): slug = UNSET else: @@ -189,168 +183,168 @@ def to_dict(self) -> dict[str, Any]: system_role = self.system_role - alert_fields_permissions: Union[Unset, list[str]] = UNSET + alert_fields_permissions: Unset | list[str] = UNSET if not isinstance(self.alert_fields_permissions, Unset): alert_fields_permissions = [] for alert_fields_permissions_item_data in self.alert_fields_permissions: alert_fields_permissions_item: str = alert_fields_permissions_item_data alert_fields_permissions.append(alert_fields_permissions_item) - alert_groups_permissions: Union[Unset, list[str]] = UNSET + alert_groups_permissions: Unset | list[str] = UNSET if not isinstance(self.alert_groups_permissions, Unset): alert_groups_permissions = [] for alert_groups_permissions_item_data in self.alert_groups_permissions: alert_groups_permissions_item: str = alert_groups_permissions_item_data alert_groups_permissions.append(alert_groups_permissions_item) - alert_routing_rules_permissions: Union[Unset, list[str]] = UNSET + alert_routing_rules_permissions: Unset | list[str] = UNSET if not isinstance(self.alert_routing_rules_permissions, Unset): alert_routing_rules_permissions = [] for alert_routing_rules_permissions_item_data in self.alert_routing_rules_permissions: alert_routing_rules_permissions_item: str = alert_routing_rules_permissions_item_data alert_routing_rules_permissions.append(alert_routing_rules_permissions_item) - on_call_readiness_report_permissions: Union[Unset, list[str]] = UNSET + on_call_readiness_report_permissions: Unset | list[str] = UNSET if not isinstance(self.on_call_readiness_report_permissions, Unset): on_call_readiness_report_permissions = [] for on_call_readiness_report_permissions_item_data in self.on_call_readiness_report_permissions: on_call_readiness_report_permissions_item: str = on_call_readiness_report_permissions_item_data on_call_readiness_report_permissions.append(on_call_readiness_report_permissions_item) - on_call_roles_permissions: Union[Unset, list[str]] = UNSET + on_call_roles_permissions: Unset | list[str] = UNSET if not isinstance(self.on_call_roles_permissions, Unset): on_call_roles_permissions = [] for on_call_roles_permissions_item_data in self.on_call_roles_permissions: on_call_roles_permissions_item: str = on_call_roles_permissions_item_data on_call_roles_permissions.append(on_call_roles_permissions_item) - alert_sources_permissions: Union[Unset, list[str]] = UNSET + alert_sources_permissions: Unset | list[str] = UNSET if not isinstance(self.alert_sources_permissions, Unset): alert_sources_permissions = [] for alert_sources_permissions_item_data in self.alert_sources_permissions: alert_sources_permissions_item: str = alert_sources_permissions_item_data alert_sources_permissions.append(alert_sources_permissions_item) - alert_urgency_permissions: Union[Unset, list[str]] = UNSET + alert_urgency_permissions: Unset | list[str] = UNSET if not isinstance(self.alert_urgency_permissions, Unset): alert_urgency_permissions = [] for alert_urgency_permissions_item_data in self.alert_urgency_permissions: alert_urgency_permissions_item: str = alert_urgency_permissions_item_data alert_urgency_permissions.append(alert_urgency_permissions_item) - alerts_permissions: Union[Unset, list[str]] = UNSET + alerts_permissions: Unset | list[str] = UNSET if not isinstance(self.alerts_permissions, Unset): alerts_permissions = [] for alerts_permissions_item_data in self.alerts_permissions: alerts_permissions_item: str = alerts_permissions_item_data alerts_permissions.append(alerts_permissions_item) - api_keys_permissions: Union[Unset, list[str]] = UNSET + api_keys_permissions: Unset | list[str] = UNSET if not isinstance(self.api_keys_permissions, Unset): api_keys_permissions = [] for api_keys_permissions_item_data in self.api_keys_permissions: api_keys_permissions_item: str = api_keys_permissions_item_data api_keys_permissions.append(api_keys_permissions_item) - audits_permissions: Union[Unset, list[str]] = UNSET + audits_permissions: Unset | list[str] = UNSET if not isinstance(self.audits_permissions, Unset): audits_permissions = [] for audits_permissions_item_data in self.audits_permissions: audits_permissions_item: str = audits_permissions_item_data audits_permissions.append(audits_permissions_item) - contacts_permissions: Union[Unset, list[str]] = UNSET + contacts_permissions: Unset | list[str] = UNSET if not isinstance(self.contacts_permissions, Unset): contacts_permissions = [] for contacts_permissions_item_data in self.contacts_permissions: contacts_permissions_item: str = contacts_permissions_item_data contacts_permissions.append(contacts_permissions_item) - escalation_policies_permissions: Union[Unset, list[str]] = UNSET + escalation_policies_permissions: Unset | list[str] = UNSET if not isinstance(self.escalation_policies_permissions, Unset): escalation_policies_permissions = [] for escalation_policies_permissions_item_data in self.escalation_policies_permissions: escalation_policies_permissions_item: str = escalation_policies_permissions_item_data escalation_policies_permissions.append(escalation_policies_permissions_item) - groups_permissions: Union[Unset, list[str]] = UNSET + groups_permissions: Unset | list[str] = UNSET if not isinstance(self.groups_permissions, Unset): groups_permissions = [] for groups_permissions_item_data in self.groups_permissions: groups_permissions_item: str = groups_permissions_item_data groups_permissions.append(groups_permissions_item) - heartbeats_permissions: Union[Unset, list[str]] = UNSET + heartbeats_permissions: Unset | list[str] = UNSET if not isinstance(self.heartbeats_permissions, Unset): heartbeats_permissions = [] for heartbeats_permissions_item_data in self.heartbeats_permissions: heartbeats_permissions_item: str = heartbeats_permissions_item_data heartbeats_permissions.append(heartbeats_permissions_item) - integrations_permissions: Union[Unset, list[str]] = UNSET + integrations_permissions: Unset | list[str] = UNSET if not isinstance(self.integrations_permissions, Unset): integrations_permissions = [] for integrations_permissions_item_data in self.integrations_permissions: integrations_permissions_item: str = integrations_permissions_item_data integrations_permissions.append(integrations_permissions_item) - invitations_permissions: Union[Unset, list[str]] = UNSET + invitations_permissions: Unset | list[str] = UNSET if not isinstance(self.invitations_permissions, Unset): invitations_permissions = [] for invitations_permissions_item_data in self.invitations_permissions: invitations_permissions_item: str = invitations_permissions_item_data invitations_permissions.append(invitations_permissions_item) - live_call_routing_permissions: Union[Unset, list[str]] = UNSET + live_call_routing_permissions: Unset | list[str] = UNSET if not isinstance(self.live_call_routing_permissions, Unset): live_call_routing_permissions = [] for live_call_routing_permissions_item_data in self.live_call_routing_permissions: live_call_routing_permissions_item: str = live_call_routing_permissions_item_data live_call_routing_permissions.append(live_call_routing_permissions_item) - schedule_override_permissions: Union[Unset, list[str]] = UNSET + schedule_override_permissions: Unset | list[str] = UNSET if not isinstance(self.schedule_override_permissions, Unset): schedule_override_permissions = [] for schedule_override_permissions_item_data in self.schedule_override_permissions: schedule_override_permissions_item: str = schedule_override_permissions_item_data schedule_override_permissions.append(schedule_override_permissions_item) - schedules_permissions: Union[Unset, list[str]] = UNSET + schedules_permissions: Unset | list[str] = UNSET if not isinstance(self.schedules_permissions, Unset): schedules_permissions = [] for schedules_permissions_item_data in self.schedules_permissions: schedules_permissions_item: str = schedules_permissions_item_data schedules_permissions.append(schedules_permissions_item) - services_permissions: Union[Unset, list[str]] = UNSET + services_permissions: Unset | list[str] = UNSET if not isinstance(self.services_permissions, Unset): services_permissions = [] for services_permissions_item_data in self.services_permissions: services_permissions_item: str = services_permissions_item_data services_permissions.append(services_permissions_item) - functionalities_permissions: Union[Unset, list[str]] = UNSET + functionalities_permissions: Unset | list[str] = UNSET if not isinstance(self.functionalities_permissions, Unset): functionalities_permissions = [] for functionalities_permissions_item_data in self.functionalities_permissions: functionalities_permissions_item: str = functionalities_permissions_item_data functionalities_permissions.append(functionalities_permissions_item) - webhooks_permissions: Union[Unset, list[str]] = UNSET + webhooks_permissions: Unset | list[str] = UNSET if not isinstance(self.webhooks_permissions, Unset): webhooks_permissions = [] for webhooks_permissions_item_data in self.webhooks_permissions: webhooks_permissions_item: str = webhooks_permissions_item_data webhooks_permissions.append(webhooks_permissions_item) - workflows_permissions: Union[Unset, list[str]] = UNSET + workflows_permissions: Unset | list[str] = UNSET if not isinstance(self.workflows_permissions, Unset): workflows_permissions = [] for workflows_permissions_item_data in self.workflows_permissions: workflows_permissions_item: str = workflows_permissions_item_data workflows_permissions.append(workflows_permissions_item) - catalogs_permissions: Union[Unset, list[str]] = UNSET + catalogs_permissions: Unset | list[str] = UNSET if not isinstance(self.catalogs_permissions, Unset): catalogs_permissions = [] for catalogs_permissions_item_data in self.catalogs_permissions: @@ -424,12 +418,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name") - def _parse_slug(data: object) -> Union[None, Unset, str]: + def _parse_slug(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) slug = _parse_slug(d.pop("slug", UNSET)) diff --git a/rootly_sdk/models/new_playbook_data_attributes.py b/rootly_sdk/models/new_playbook_data_attributes.py index 35ffc7a5..bf242c06 100644 --- a/rootly_sdk/models/new_playbook_data_attributes.py +++ b/rootly_sdk/models/new_playbook_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -24,31 +24,31 @@ class NewPlaybookDataAttributes: """ title: str - summary: Union[None, Unset, str] = UNSET - external_url: Union[None, Unset, str] = UNSET - severity_ids: Union[None, Unset, list[str]] = UNSET - environment_ids: Union[None, Unset, list[str]] = UNSET - service_ids: Union[None, Unset, list[str]] = UNSET - functionality_ids: Union[None, Unset, list[str]] = UNSET - group_ids: Union[None, Unset, list[str]] = UNSET - incident_type_ids: Union[None, Unset, list[str]] = UNSET + summary: None | Unset | str = UNSET + external_url: None | Unset | str = UNSET + severity_ids: None | Unset | list[str] = UNSET + environment_ids: None | Unset | list[str] = UNSET + service_ids: None | Unset | list[str] = UNSET + functionality_ids: None | Unset | list[str] = UNSET + group_ids: None | Unset | list[str] = UNSET + incident_type_ids: None | Unset | list[str] = UNSET def to_dict(self) -> dict[str, Any]: title = self.title - summary: Union[None, Unset, str] + summary: None | Unset | str if isinstance(self.summary, Unset): summary = UNSET else: summary = self.summary - external_url: Union[None, Unset, str] + external_url: None | Unset | str if isinstance(self.external_url, Unset): external_url = UNSET else: external_url = self.external_url - severity_ids: Union[None, Unset, list[str]] + severity_ids: None | Unset | list[str] if isinstance(self.severity_ids, Unset): severity_ids = UNSET elif isinstance(self.severity_ids, list): @@ -57,7 +57,7 @@ def to_dict(self) -> dict[str, Any]: else: severity_ids = self.severity_ids - environment_ids: Union[None, Unset, list[str]] + environment_ids: None | Unset | list[str] if isinstance(self.environment_ids, Unset): environment_ids = UNSET elif isinstance(self.environment_ids, list): @@ -66,7 +66,7 @@ def to_dict(self) -> dict[str, Any]: else: environment_ids = self.environment_ids - service_ids: Union[None, Unset, list[str]] + service_ids: None | Unset | list[str] if isinstance(self.service_ids, Unset): service_ids = UNSET elif isinstance(self.service_ids, list): @@ -75,7 +75,7 @@ def to_dict(self) -> dict[str, Any]: else: service_ids = self.service_ids - functionality_ids: Union[None, Unset, list[str]] + functionality_ids: None | Unset | list[str] if isinstance(self.functionality_ids, Unset): functionality_ids = UNSET elif isinstance(self.functionality_ids, list): @@ -84,7 +84,7 @@ def to_dict(self) -> dict[str, Any]: else: functionality_ids = self.functionality_ids - group_ids: Union[None, Unset, list[str]] + group_ids: None | Unset | list[str] if isinstance(self.group_ids, Unset): group_ids = UNSET elif isinstance(self.group_ids, list): @@ -93,7 +93,7 @@ def to_dict(self) -> dict[str, Any]: else: group_ids = self.group_ids - incident_type_ids: Union[None, Unset, list[str]] + incident_type_ids: None | Unset | list[str] if isinstance(self.incident_type_ids, Unset): incident_type_ids = UNSET elif isinstance(self.incident_type_ids, list): @@ -133,25 +133,25 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) title = d.pop("title") - def _parse_summary(data: object) -> Union[None, Unset, str]: + def _parse_summary(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) summary = _parse_summary(d.pop("summary", UNSET)) - def _parse_external_url(data: object) -> Union[None, Unset, str]: + def _parse_external_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) external_url = _parse_external_url(d.pop("external_url", UNSET)) - def _parse_severity_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_severity_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -164,11 +164,11 @@ def _parse_severity_ids(data: object) -> Union[None, Unset, list[str]]: return severity_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) severity_ids = _parse_severity_ids(d.pop("severity_ids", UNSET)) - def _parse_environment_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_environment_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -181,11 +181,11 @@ def _parse_environment_ids(data: object) -> Union[None, Unset, list[str]]: return environment_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) environment_ids = _parse_environment_ids(d.pop("environment_ids", UNSET)) - def _parse_service_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_service_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -198,11 +198,11 @@ def _parse_service_ids(data: object) -> Union[None, Unset, list[str]]: return service_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) service_ids = _parse_service_ids(d.pop("service_ids", UNSET)) - def _parse_functionality_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_functionality_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -215,11 +215,11 @@ def _parse_functionality_ids(data: object) -> Union[None, Unset, list[str]]: return functionality_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) functionality_ids = _parse_functionality_ids(d.pop("functionality_ids", UNSET)) - def _parse_group_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_group_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -232,11 +232,11 @@ def _parse_group_ids(data: object) -> Union[None, Unset, list[str]]: return group_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) group_ids = _parse_group_ids(d.pop("group_ids", UNSET)) - def _parse_incident_type_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_incident_type_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -249,7 +249,7 @@ def _parse_incident_type_ids(data: object) -> Union[None, Unset, list[str]]: return incident_type_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) incident_type_ids = _parse_incident_type_ids(d.pop("incident_type_ids", UNSET)) diff --git a/rootly_sdk/models/new_playbook_task_data_attributes.py b/rootly_sdk/models/new_playbook_task_data_attributes.py index b659e577..b3f89bfd 100644 --- a/rootly_sdk/models/new_playbook_task_data_attributes.py +++ b/rootly_sdk/models/new_playbook_task_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -18,19 +18,19 @@ class NewPlaybookTaskDataAttributes: """ task: str - description: Union[None, Unset, str] = UNSET - position: Union[None, Unset, int] = UNSET + description: None | Unset | str = UNSET + position: None | Unset | int = UNSET def to_dict(self) -> dict[str, Any]: task = self.task - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - position: Union[None, Unset, int] + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: @@ -55,21 +55,21 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) task = d.pop("task") - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_position(data: object) -> Union[None, Unset, int]: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) diff --git a/rootly_sdk/models/new_post_mortem_template_data_attributes.py b/rootly_sdk/models/new_post_mortem_template_data_attributes.py index a3c0927e..7a2c63dd 100644 --- a/rootly_sdk/models/new_post_mortem_template_data_attributes.py +++ b/rootly_sdk/models/new_post_mortem_template_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -26,21 +26,21 @@ class NewPostMortemTemplateDataAttributes: """ name: str - slug: Union[None, Unset, str] = UNSET - default: Union[None, Unset, bool] = UNSET - content: Union[Unset, str] = UNSET - format_: Union[Unset, NewPostMortemTemplateDataAttributesFormat] = "html" + slug: None | Unset | str = UNSET + default: None | Unset | bool = UNSET + content: Unset | str = UNSET + format_: Unset | NewPostMortemTemplateDataAttributesFormat = "html" def to_dict(self) -> dict[str, Any]: name = self.name - slug: Union[None, Unset, str] + slug: None | Unset | str if isinstance(self.slug, Unset): slug = UNSET else: slug = self.slug - default: Union[None, Unset, bool] + default: None | Unset | bool if isinstance(self.default, Unset): default = UNSET else: @@ -48,7 +48,7 @@ def to_dict(self) -> dict[str, Any]: content = self.content - format_: Union[Unset, str] = UNSET + format_: Unset | str = UNSET if not isinstance(self.format_, Unset): format_ = self.format_ @@ -75,28 +75,28 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name") - def _parse_slug(data: object) -> Union[None, Unset, str]: + def _parse_slug(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) slug = _parse_slug(d.pop("slug", UNSET)) - def _parse_default(data: object) -> Union[None, Unset, bool]: + def _parse_default(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) default = _parse_default(d.pop("default", UNSET)) content = d.pop("content", UNSET) _format_ = d.pop("format", UNSET) - format_: Union[Unset, NewPostMortemTemplateDataAttributesFormat] + format_: Unset | NewPostMortemTemplateDataAttributesFormat if isinstance(_format_, Unset): format_ = UNSET else: diff --git a/rootly_sdk/models/new_pulse_data_attributes.py b/rootly_sdk/models/new_pulse_data_attributes.py index f15cf119..b230c418 100644 --- a/rootly_sdk/models/new_pulse_data_attributes.py +++ b/rootly_sdk/models/new_pulse_data_attributes.py @@ -33,14 +33,14 @@ class NewPulseDataAttributes: """ summary: str - source: Union[None, Unset, str] = UNSET - service_ids: Union[None, Unset, list[str]] = UNSET - environment_ids: Union[None, Unset, list[str]] = UNSET - started_at: Union[None, Unset, datetime.datetime] = UNSET - ended_at: Union[None, Unset, datetime.datetime] = UNSET - external_url: Union[None, Unset, str] = UNSET - labels: Union[Unset, list[Union["NewPulseDataAttributesLabelsItemType0", None]]] = UNSET - refs: Union[Unset, list[Union["NewPulseDataAttributesRefsItemType0", None]]] = UNSET + source: None | Unset | str = UNSET + service_ids: None | Unset | list[str] = UNSET + environment_ids: None | Unset | list[str] = UNSET + started_at: None | Unset | datetime.datetime = UNSET + ended_at: None | Unset | datetime.datetime = UNSET + external_url: None | Unset | str = UNSET + labels: Unset | list[Union["NewPulseDataAttributesLabelsItemType0", None]] = UNSET + refs: Unset | list[Union["NewPulseDataAttributesRefsItemType0", None]] = UNSET data: Union["NewPulseDataAttributesDataType0", None, Unset] = UNSET def to_dict(self) -> dict[str, Any]: @@ -50,13 +50,13 @@ def to_dict(self) -> dict[str, Any]: summary = self.summary - source: Union[None, Unset, str] + source: None | Unset | str if isinstance(self.source, Unset): source = UNSET else: source = self.source - service_ids: Union[None, Unset, list[str]] + service_ids: None | Unset | list[str] if isinstance(self.service_ids, Unset): service_ids = UNSET elif isinstance(self.service_ids, list): @@ -65,7 +65,7 @@ def to_dict(self) -> dict[str, Any]: else: service_ids = self.service_ids - environment_ids: Union[None, Unset, list[str]] + environment_ids: None | Unset | list[str] if isinstance(self.environment_ids, Unset): environment_ids = UNSET elif isinstance(self.environment_ids, list): @@ -74,7 +74,7 @@ def to_dict(self) -> dict[str, Any]: else: environment_ids = self.environment_ids - started_at: Union[None, Unset, str] + started_at: None | Unset | str if isinstance(self.started_at, Unset): started_at = UNSET elif isinstance(self.started_at, datetime.datetime): @@ -82,7 +82,7 @@ def to_dict(self) -> dict[str, Any]: else: started_at = self.started_at - ended_at: Union[None, Unset, str] + ended_at: None | Unset | str if isinstance(self.ended_at, Unset): ended_at = UNSET elif isinstance(self.ended_at, datetime.datetime): @@ -90,35 +90,35 @@ def to_dict(self) -> dict[str, Any]: else: ended_at = self.ended_at - external_url: Union[None, Unset, str] + external_url: None | Unset | str if isinstance(self.external_url, Unset): external_url = UNSET else: external_url = self.external_url - labels: Union[Unset, list[Union[None, dict[str, Any]]]] = UNSET + labels: Unset | list[None | dict[str, Any]] = UNSET if not isinstance(self.labels, Unset): labels = [] for labels_item_data in self.labels: - labels_item: Union[None, dict[str, Any]] + labels_item: None | dict[str, Any] if isinstance(labels_item_data, NewPulseDataAttributesLabelsItemType0): labels_item = labels_item_data.to_dict() else: labels_item = labels_item_data labels.append(labels_item) - refs: Union[Unset, list[Union[None, dict[str, Any]]]] = UNSET + refs: Unset | list[None | dict[str, Any]] = UNSET if not isinstance(self.refs, Unset): refs = [] for refs_item_data in self.refs: - refs_item: Union[None, dict[str, Any]] + refs_item: None | dict[str, Any] if isinstance(refs_item_data, NewPulseDataAttributesRefsItemType0): refs_item = refs_item_data.to_dict() else: refs_item = refs_item_data refs.append(refs_item) - data: Union[None, Unset, dict[str, Any]] + data: None | Unset | dict[str, Any] if isinstance(self.data, Unset): data = UNSET elif isinstance(self.data, NewPulseDataAttributesDataType0): @@ -163,16 +163,16 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) summary = d.pop("summary") - def _parse_source(data: object) -> Union[None, Unset, str]: + def _parse_source(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) source = _parse_source(d.pop("source", UNSET)) - def _parse_service_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_service_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -185,11 +185,11 @@ def _parse_service_ids(data: object) -> Union[None, Unset, list[str]]: return service_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) service_ids = _parse_service_ids(d.pop("service_ids", UNSET)) - def _parse_environment_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_environment_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -202,11 +202,11 @@ def _parse_environment_ids(data: object) -> Union[None, Unset, list[str]]: return environment_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) environment_ids = _parse_environment_ids(d.pop("environment_ids", UNSET)) - def _parse_started_at(data: object) -> Union[None, Unset, datetime.datetime]: + def _parse_started_at(data: object) -> None | Unset | datetime.datetime: if data is None: return data if isinstance(data, Unset): @@ -219,11 +219,11 @@ def _parse_started_at(data: object) -> Union[None, Unset, datetime.datetime]: return started_at_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, datetime.datetime], data) + return cast(None | Unset | datetime.datetime, data) started_at = _parse_started_at(d.pop("started_at", UNSET)) - def _parse_ended_at(data: object) -> Union[None, Unset, datetime.datetime]: + def _parse_ended_at(data: object) -> None | Unset | datetime.datetime: if data is None: return data if isinstance(data, Unset): @@ -236,16 +236,16 @@ def _parse_ended_at(data: object) -> Union[None, Unset, datetime.datetime]: return ended_at_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, datetime.datetime], data) + return cast(None | Unset | datetime.datetime, data) ended_at = _parse_ended_at(d.pop("ended_at", UNSET)) - def _parse_external_url(data: object) -> Union[None, Unset, str]: + def _parse_external_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) external_url = _parse_external_url(d.pop("external_url", UNSET)) diff --git a/rootly_sdk/models/new_retrospective_process_data_attributes.py b/rootly_sdk/models/new_retrospective_process_data_attributes.py index 6a809d77..b8865f21 100644 --- a/rootly_sdk/models/new_retrospective_process_data_attributes.py +++ b/rootly_sdk/models/new_retrospective_process_data_attributes.py @@ -36,7 +36,7 @@ class NewRetrospectiveProcessDataAttributes: name: str copy_from: str - description: Union[None, Unset, str] = UNSET + description: None | Unset | str = UNSET retrospective_process_matching_criteria: Union[ "NewRetrospectiveProcessDataAttributesRetrospectiveProcessMatchingCriteriaType0", "NewRetrospectiveProcessDataAttributesRetrospectiveProcessMatchingCriteriaType1", @@ -56,13 +56,13 @@ def to_dict(self) -> dict[str, Any]: copy_from = self.copy_from - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - retrospective_process_matching_criteria: Union[Unset, dict[str, Any]] + retrospective_process_matching_criteria: Unset | dict[str, Any] if isinstance(self.retrospective_process_matching_criteria, Unset): retrospective_process_matching_criteria = UNSET elif isinstance( @@ -110,12 +110,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: copy_from = d.pop("copy_from") - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) diff --git a/rootly_sdk/models/new_retrospective_process_group_data_attributes.py b/rootly_sdk/models/new_retrospective_process_group_data_attributes.py index 06bf8807..151d9a3e 100644 --- a/rootly_sdk/models/new_retrospective_process_group_data_attributes.py +++ b/rootly_sdk/models/new_retrospective_process_group_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define @@ -17,7 +17,7 @@ class NewRetrospectiveProcessGroupDataAttributes: """ sub_status_id: str - position: Union[Unset, int] = UNSET + position: Unset | int = UNSET def to_dict(self) -> dict[str, Any]: sub_status_id = self.sub_status_id diff --git a/rootly_sdk/models/new_retrospective_process_group_step_data_attributes.py b/rootly_sdk/models/new_retrospective_process_group_step_data_attributes.py index 6e0ec504..c25b7f09 100644 --- a/rootly_sdk/models/new_retrospective_process_group_step_data_attributes.py +++ b/rootly_sdk/models/new_retrospective_process_group_step_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define @@ -17,7 +17,7 @@ class NewRetrospectiveProcessGroupStepDataAttributes: """ retrospective_step_id: str - position: Union[Unset, int] = UNSET + position: Unset | int = UNSET def to_dict(self) -> dict[str, Any]: retrospective_step_id = self.retrospective_step_id diff --git a/rootly_sdk/models/new_retrospective_step_data_attributes.py b/rootly_sdk/models/new_retrospective_step_data_attributes.py index 2519eb1e..7a87c57d 100644 --- a/rootly_sdk/models/new_retrospective_step_data_attributes.py +++ b/rootly_sdk/models/new_retrospective_step_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -24,41 +24,41 @@ class NewRetrospectiveStepDataAttributes: """ title: str - slug: Union[None, Unset, str] = UNSET - description: Union[None, Unset, str] = UNSET - due_after_days: Union[None, Unset, int] = UNSET - incident_role_id: Union[None, Unset, str] = UNSET - position: Union[None, Unset, int] = UNSET - skippable: Union[Unset, bool] = UNSET + slug: None | Unset | str = UNSET + description: None | Unset | str = UNSET + due_after_days: None | Unset | int = UNSET + incident_role_id: None | Unset | str = UNSET + position: None | Unset | int = UNSET + skippable: Unset | bool = UNSET def to_dict(self) -> dict[str, Any]: title = self.title - slug: Union[None, Unset, str] + slug: None | Unset | str if isinstance(self.slug, Unset): slug = UNSET else: slug = self.slug - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - due_after_days: Union[None, Unset, int] + due_after_days: None | Unset | int if isinstance(self.due_after_days, Unset): due_after_days = UNSET else: due_after_days = self.due_after_days - incident_role_id: Union[None, Unset, str] + incident_role_id: None | Unset | str if isinstance(self.incident_role_id, Unset): incident_role_id = UNSET else: incident_role_id = self.incident_role_id - position: Union[None, Unset, int] + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: @@ -93,48 +93,48 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) title = d.pop("title") - def _parse_slug(data: object) -> Union[None, Unset, str]: + def _parse_slug(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) slug = _parse_slug(d.pop("slug", UNSET)) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_due_after_days(data: object) -> Union[None, Unset, int]: + def _parse_due_after_days(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) due_after_days = _parse_due_after_days(d.pop("due_after_days", UNSET)) - def _parse_incident_role_id(data: object) -> Union[None, Unset, str]: + def _parse_incident_role_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) incident_role_id = _parse_incident_role_id(d.pop("incident_role_id", UNSET)) - def _parse_position(data: object) -> Union[None, Unset, int]: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) diff --git a/rootly_sdk/models/new_role_data_attributes.py b/rootly_sdk/models/new_role_data_attributes.py index 38534612..748e90ff 100644 --- a/rootly_sdk/models/new_role_data_attributes.py +++ b/rootly_sdk/models/new_role_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -186,284 +186,282 @@ class NewRoleDataAttributes: """ name: str - slug: Union[None, Unset, str] = UNSET - incident_permission_set_id: Union[None, Unset, str] = UNSET - alerts_permissions: Union[Unset, list[NewRoleDataAttributesAlertsPermissionsItem]] = UNSET - api_keys_permissions: Union[Unset, list[NewRoleDataAttributesApiKeysPermissionsItem]] = UNSET - audits_permissions: Union[Unset, list[NewRoleDataAttributesAuditsPermissionsItem]] = UNSET - billing_permissions: Union[Unset, list[NewRoleDataAttributesBillingPermissionsItem]] = UNSET - environments_permissions: Union[Unset, list[NewRoleDataAttributesEnvironmentsPermissionsItem]] = UNSET - form_fields_permissions: Union[Unset, list[NewRoleDataAttributesFormFieldsPermissionsItem]] = UNSET - functionalities_permissions: Union[Unset, list[NewRoleDataAttributesFunctionalitiesPermissionsItem]] = UNSET - groups_permissions: Union[Unset, list[NewRoleDataAttributesGroupsPermissionsItem]] = UNSET - incident_causes_permissions: Union[Unset, list[NewRoleDataAttributesIncidentCausesPermissionsItem]] = UNSET - incident_feedbacks_permissions: Union[Unset, list[NewRoleDataAttributesIncidentFeedbacksPermissionsItem]] = UNSET - incident_roles_permissions: Union[Unset, list[NewRoleDataAttributesIncidentRolesPermissionsItem]] = UNSET - incident_types_permissions: Union[Unset, list[NewRoleDataAttributesIncidentTypesPermissionsItem]] = UNSET - incidents_permissions: Union[Unset, list[NewRoleDataAttributesIncidentsPermissionsItem]] = UNSET - integrations_permissions: Union[Unset, list[NewRoleDataAttributesIntegrationsPermissionsItem]] = UNSET - invitations_permissions: Union[Unset, list[NewRoleDataAttributesInvitationsPermissionsItem]] = UNSET - playbooks_permissions: Union[Unset, list[NewRoleDataAttributesPlaybooksPermissionsItem]] = UNSET - private_incidents_permissions: Union[Unset, list[NewRoleDataAttributesPrivateIncidentsPermissionsItem]] = UNSET - pulses_permissions: Union[Unset, list[NewRoleDataAttributesPulsesPermissionsItem]] = UNSET - retrospective_permissions: Union[Unset, list[NewRoleDataAttributesRetrospectivePermissionsItem]] = UNSET - roles_permissions: Union[Unset, list[NewRoleDataAttributesRolesPermissionsItem]] = UNSET - secrets_permissions: Union[Unset, list[NewRoleDataAttributesSecretsPermissionsItem]] = UNSET - services_permissions: Union[Unset, list[NewRoleDataAttributesServicesPermissionsItem]] = UNSET - severities_permissions: Union[Unset, list[NewRoleDataAttributesSeveritiesPermissionsItem]] = UNSET - status_pages_permissions: Union[Unset, list[NewRoleDataAttributesStatusPagesPermissionsItem]] = UNSET - webhooks_permissions: Union[Unset, list[NewRoleDataAttributesWebhooksPermissionsItem]] = UNSET - workflows_permissions: Union[Unset, list[NewRoleDataAttributesWorkflowsPermissionsItem]] = UNSET - catalogs_permissions: Union[Unset, list[NewRoleDataAttributesCatalogsPermissionsItem]] = UNSET - sub_statuses_permissions: Union[Unset, list[NewRoleDataAttributesSubStatusesPermissionsItem]] = UNSET - edge_connector_permissions: Union[Unset, list[NewRoleDataAttributesEdgeConnectorPermissionsItem]] = UNSET - slas_permissions: Union[Unset, list[NewRoleDataAttributesSlasPermissionsItem]] = UNSET - paging_permissions: Union[Unset, list[NewRoleDataAttributesPagingPermissionsItem]] = UNSET - incident_communication_permissions: Union[ - Unset, list[NewRoleDataAttributesIncidentCommunicationPermissionsItem] - ] = UNSET - communication_permissions: Union[Unset, list[NewRoleDataAttributesCommunicationPermissionsItem]] = UNSET + slug: None | Unset | str = UNSET + incident_permission_set_id: None | Unset | str = UNSET + alerts_permissions: Unset | list[NewRoleDataAttributesAlertsPermissionsItem] = UNSET + api_keys_permissions: Unset | list[NewRoleDataAttributesApiKeysPermissionsItem] = UNSET + audits_permissions: Unset | list[NewRoleDataAttributesAuditsPermissionsItem] = UNSET + billing_permissions: Unset | list[NewRoleDataAttributesBillingPermissionsItem] = UNSET + environments_permissions: Unset | list[NewRoleDataAttributesEnvironmentsPermissionsItem] = UNSET + form_fields_permissions: Unset | list[NewRoleDataAttributesFormFieldsPermissionsItem] = UNSET + functionalities_permissions: Unset | list[NewRoleDataAttributesFunctionalitiesPermissionsItem] = UNSET + groups_permissions: Unset | list[NewRoleDataAttributesGroupsPermissionsItem] = UNSET + incident_causes_permissions: Unset | list[NewRoleDataAttributesIncidentCausesPermissionsItem] = UNSET + incident_feedbacks_permissions: Unset | list[NewRoleDataAttributesIncidentFeedbacksPermissionsItem] = UNSET + incident_roles_permissions: Unset | list[NewRoleDataAttributesIncidentRolesPermissionsItem] = UNSET + incident_types_permissions: Unset | list[NewRoleDataAttributesIncidentTypesPermissionsItem] = UNSET + incidents_permissions: Unset | list[NewRoleDataAttributesIncidentsPermissionsItem] = UNSET + integrations_permissions: Unset | list[NewRoleDataAttributesIntegrationsPermissionsItem] = UNSET + invitations_permissions: Unset | list[NewRoleDataAttributesInvitationsPermissionsItem] = UNSET + playbooks_permissions: Unset | list[NewRoleDataAttributesPlaybooksPermissionsItem] = UNSET + private_incidents_permissions: Unset | list[NewRoleDataAttributesPrivateIncidentsPermissionsItem] = UNSET + pulses_permissions: Unset | list[NewRoleDataAttributesPulsesPermissionsItem] = UNSET + retrospective_permissions: Unset | list[NewRoleDataAttributesRetrospectivePermissionsItem] = UNSET + roles_permissions: Unset | list[NewRoleDataAttributesRolesPermissionsItem] = UNSET + secrets_permissions: Unset | list[NewRoleDataAttributesSecretsPermissionsItem] = UNSET + services_permissions: Unset | list[NewRoleDataAttributesServicesPermissionsItem] = UNSET + severities_permissions: Unset | list[NewRoleDataAttributesSeveritiesPermissionsItem] = UNSET + status_pages_permissions: Unset | list[NewRoleDataAttributesStatusPagesPermissionsItem] = UNSET + webhooks_permissions: Unset | list[NewRoleDataAttributesWebhooksPermissionsItem] = UNSET + workflows_permissions: Unset | list[NewRoleDataAttributesWorkflowsPermissionsItem] = UNSET + catalogs_permissions: Unset | list[NewRoleDataAttributesCatalogsPermissionsItem] = UNSET + sub_statuses_permissions: Unset | list[NewRoleDataAttributesSubStatusesPermissionsItem] = UNSET + edge_connector_permissions: Unset | list[NewRoleDataAttributesEdgeConnectorPermissionsItem] = UNSET + slas_permissions: Unset | list[NewRoleDataAttributesSlasPermissionsItem] = UNSET + paging_permissions: Unset | list[NewRoleDataAttributesPagingPermissionsItem] = UNSET + incident_communication_permissions: Unset | list[NewRoleDataAttributesIncidentCommunicationPermissionsItem] = UNSET + communication_permissions: Unset | list[NewRoleDataAttributesCommunicationPermissionsItem] = UNSET def to_dict(self) -> dict[str, Any]: name = self.name - slug: Union[None, Unset, str] + slug: None | Unset | str if isinstance(self.slug, Unset): slug = UNSET else: slug = self.slug - incident_permission_set_id: Union[None, Unset, str] + incident_permission_set_id: None | Unset | str if isinstance(self.incident_permission_set_id, Unset): incident_permission_set_id = UNSET else: incident_permission_set_id = self.incident_permission_set_id - alerts_permissions: Union[Unset, list[str]] = UNSET + alerts_permissions: Unset | list[str] = UNSET if not isinstance(self.alerts_permissions, Unset): alerts_permissions = [] for alerts_permissions_item_data in self.alerts_permissions: alerts_permissions_item: str = alerts_permissions_item_data alerts_permissions.append(alerts_permissions_item) - api_keys_permissions: Union[Unset, list[str]] = UNSET + api_keys_permissions: Unset | list[str] = UNSET if not isinstance(self.api_keys_permissions, Unset): api_keys_permissions = [] for api_keys_permissions_item_data in self.api_keys_permissions: api_keys_permissions_item: str = api_keys_permissions_item_data api_keys_permissions.append(api_keys_permissions_item) - audits_permissions: Union[Unset, list[str]] = UNSET + audits_permissions: Unset | list[str] = UNSET if not isinstance(self.audits_permissions, Unset): audits_permissions = [] for audits_permissions_item_data in self.audits_permissions: audits_permissions_item: str = audits_permissions_item_data audits_permissions.append(audits_permissions_item) - billing_permissions: Union[Unset, list[str]] = UNSET + billing_permissions: Unset | list[str] = UNSET if not isinstance(self.billing_permissions, Unset): billing_permissions = [] for billing_permissions_item_data in self.billing_permissions: billing_permissions_item: str = billing_permissions_item_data billing_permissions.append(billing_permissions_item) - environments_permissions: Union[Unset, list[str]] = UNSET + environments_permissions: Unset | list[str] = UNSET if not isinstance(self.environments_permissions, Unset): environments_permissions = [] for environments_permissions_item_data in self.environments_permissions: environments_permissions_item: str = environments_permissions_item_data environments_permissions.append(environments_permissions_item) - form_fields_permissions: Union[Unset, list[str]] = UNSET + form_fields_permissions: Unset | list[str] = UNSET if not isinstance(self.form_fields_permissions, Unset): form_fields_permissions = [] for form_fields_permissions_item_data in self.form_fields_permissions: form_fields_permissions_item: str = form_fields_permissions_item_data form_fields_permissions.append(form_fields_permissions_item) - functionalities_permissions: Union[Unset, list[str]] = UNSET + functionalities_permissions: Unset | list[str] = UNSET if not isinstance(self.functionalities_permissions, Unset): functionalities_permissions = [] for functionalities_permissions_item_data in self.functionalities_permissions: functionalities_permissions_item: str = functionalities_permissions_item_data functionalities_permissions.append(functionalities_permissions_item) - groups_permissions: Union[Unset, list[str]] = UNSET + groups_permissions: Unset | list[str] = UNSET if not isinstance(self.groups_permissions, Unset): groups_permissions = [] for groups_permissions_item_data in self.groups_permissions: groups_permissions_item: str = groups_permissions_item_data groups_permissions.append(groups_permissions_item) - incident_causes_permissions: Union[Unset, list[str]] = UNSET + incident_causes_permissions: Unset | list[str] = UNSET if not isinstance(self.incident_causes_permissions, Unset): incident_causes_permissions = [] for incident_causes_permissions_item_data in self.incident_causes_permissions: incident_causes_permissions_item: str = incident_causes_permissions_item_data incident_causes_permissions.append(incident_causes_permissions_item) - incident_feedbacks_permissions: Union[Unset, list[str]] = UNSET + incident_feedbacks_permissions: Unset | list[str] = UNSET if not isinstance(self.incident_feedbacks_permissions, Unset): incident_feedbacks_permissions = [] for incident_feedbacks_permissions_item_data in self.incident_feedbacks_permissions: incident_feedbacks_permissions_item: str = incident_feedbacks_permissions_item_data incident_feedbacks_permissions.append(incident_feedbacks_permissions_item) - incident_roles_permissions: Union[Unset, list[str]] = UNSET + incident_roles_permissions: Unset | list[str] = UNSET if not isinstance(self.incident_roles_permissions, Unset): incident_roles_permissions = [] for incident_roles_permissions_item_data in self.incident_roles_permissions: incident_roles_permissions_item: str = incident_roles_permissions_item_data incident_roles_permissions.append(incident_roles_permissions_item) - incident_types_permissions: Union[Unset, list[str]] = UNSET + incident_types_permissions: Unset | list[str] = UNSET if not isinstance(self.incident_types_permissions, Unset): incident_types_permissions = [] for incident_types_permissions_item_data in self.incident_types_permissions: incident_types_permissions_item: str = incident_types_permissions_item_data incident_types_permissions.append(incident_types_permissions_item) - incidents_permissions: Union[Unset, list[str]] = UNSET + incidents_permissions: Unset | list[str] = UNSET if not isinstance(self.incidents_permissions, Unset): incidents_permissions = [] for incidents_permissions_item_data in self.incidents_permissions: incidents_permissions_item: str = incidents_permissions_item_data incidents_permissions.append(incidents_permissions_item) - integrations_permissions: Union[Unset, list[str]] = UNSET + integrations_permissions: Unset | list[str] = UNSET if not isinstance(self.integrations_permissions, Unset): integrations_permissions = [] for integrations_permissions_item_data in self.integrations_permissions: integrations_permissions_item: str = integrations_permissions_item_data integrations_permissions.append(integrations_permissions_item) - invitations_permissions: Union[Unset, list[str]] = UNSET + invitations_permissions: Unset | list[str] = UNSET if not isinstance(self.invitations_permissions, Unset): invitations_permissions = [] for invitations_permissions_item_data in self.invitations_permissions: invitations_permissions_item: str = invitations_permissions_item_data invitations_permissions.append(invitations_permissions_item) - playbooks_permissions: Union[Unset, list[str]] = UNSET + playbooks_permissions: Unset | list[str] = UNSET if not isinstance(self.playbooks_permissions, Unset): playbooks_permissions = [] for playbooks_permissions_item_data in self.playbooks_permissions: playbooks_permissions_item: str = playbooks_permissions_item_data playbooks_permissions.append(playbooks_permissions_item) - private_incidents_permissions: Union[Unset, list[str]] = UNSET + private_incidents_permissions: Unset | list[str] = UNSET if not isinstance(self.private_incidents_permissions, Unset): private_incidents_permissions = [] for private_incidents_permissions_item_data in self.private_incidents_permissions: private_incidents_permissions_item: str = private_incidents_permissions_item_data private_incidents_permissions.append(private_incidents_permissions_item) - pulses_permissions: Union[Unset, list[str]] = UNSET + pulses_permissions: Unset | list[str] = UNSET if not isinstance(self.pulses_permissions, Unset): pulses_permissions = [] for pulses_permissions_item_data in self.pulses_permissions: pulses_permissions_item: str = pulses_permissions_item_data pulses_permissions.append(pulses_permissions_item) - retrospective_permissions: Union[Unset, list[str]] = UNSET + retrospective_permissions: Unset | list[str] = UNSET if not isinstance(self.retrospective_permissions, Unset): retrospective_permissions = [] for retrospective_permissions_item_data in self.retrospective_permissions: retrospective_permissions_item: str = retrospective_permissions_item_data retrospective_permissions.append(retrospective_permissions_item) - roles_permissions: Union[Unset, list[str]] = UNSET + roles_permissions: Unset | list[str] = UNSET if not isinstance(self.roles_permissions, Unset): roles_permissions = [] for roles_permissions_item_data in self.roles_permissions: roles_permissions_item: str = roles_permissions_item_data roles_permissions.append(roles_permissions_item) - secrets_permissions: Union[Unset, list[str]] = UNSET + secrets_permissions: Unset | list[str] = UNSET if not isinstance(self.secrets_permissions, Unset): secrets_permissions = [] for secrets_permissions_item_data in self.secrets_permissions: secrets_permissions_item: str = secrets_permissions_item_data secrets_permissions.append(secrets_permissions_item) - services_permissions: Union[Unset, list[str]] = UNSET + services_permissions: Unset | list[str] = UNSET if not isinstance(self.services_permissions, Unset): services_permissions = [] for services_permissions_item_data in self.services_permissions: services_permissions_item: str = services_permissions_item_data services_permissions.append(services_permissions_item) - severities_permissions: Union[Unset, list[str]] = UNSET + severities_permissions: Unset | list[str] = UNSET if not isinstance(self.severities_permissions, Unset): severities_permissions = [] for severities_permissions_item_data in self.severities_permissions: severities_permissions_item: str = severities_permissions_item_data severities_permissions.append(severities_permissions_item) - status_pages_permissions: Union[Unset, list[str]] = UNSET + status_pages_permissions: Unset | list[str] = UNSET if not isinstance(self.status_pages_permissions, Unset): status_pages_permissions = [] for status_pages_permissions_item_data in self.status_pages_permissions: status_pages_permissions_item: str = status_pages_permissions_item_data status_pages_permissions.append(status_pages_permissions_item) - webhooks_permissions: Union[Unset, list[str]] = UNSET + webhooks_permissions: Unset | list[str] = UNSET if not isinstance(self.webhooks_permissions, Unset): webhooks_permissions = [] for webhooks_permissions_item_data in self.webhooks_permissions: webhooks_permissions_item: str = webhooks_permissions_item_data webhooks_permissions.append(webhooks_permissions_item) - workflows_permissions: Union[Unset, list[str]] = UNSET + workflows_permissions: Unset | list[str] = UNSET if not isinstance(self.workflows_permissions, Unset): workflows_permissions = [] for workflows_permissions_item_data in self.workflows_permissions: workflows_permissions_item: str = workflows_permissions_item_data workflows_permissions.append(workflows_permissions_item) - catalogs_permissions: Union[Unset, list[str]] = UNSET + catalogs_permissions: Unset | list[str] = UNSET if not isinstance(self.catalogs_permissions, Unset): catalogs_permissions = [] for catalogs_permissions_item_data in self.catalogs_permissions: catalogs_permissions_item: str = catalogs_permissions_item_data catalogs_permissions.append(catalogs_permissions_item) - sub_statuses_permissions: Union[Unset, list[str]] = UNSET + sub_statuses_permissions: Unset | list[str] = UNSET if not isinstance(self.sub_statuses_permissions, Unset): sub_statuses_permissions = [] for sub_statuses_permissions_item_data in self.sub_statuses_permissions: sub_statuses_permissions_item: str = sub_statuses_permissions_item_data sub_statuses_permissions.append(sub_statuses_permissions_item) - edge_connector_permissions: Union[Unset, list[str]] = UNSET + edge_connector_permissions: Unset | list[str] = UNSET if not isinstance(self.edge_connector_permissions, Unset): edge_connector_permissions = [] for edge_connector_permissions_item_data in self.edge_connector_permissions: edge_connector_permissions_item: str = edge_connector_permissions_item_data edge_connector_permissions.append(edge_connector_permissions_item) - slas_permissions: Union[Unset, list[str]] = UNSET + slas_permissions: Unset | list[str] = UNSET if not isinstance(self.slas_permissions, Unset): slas_permissions = [] for slas_permissions_item_data in self.slas_permissions: slas_permissions_item: str = slas_permissions_item_data slas_permissions.append(slas_permissions_item) - paging_permissions: Union[Unset, list[str]] = UNSET + paging_permissions: Unset | list[str] = UNSET if not isinstance(self.paging_permissions, Unset): paging_permissions = [] for paging_permissions_item_data in self.paging_permissions: paging_permissions_item: str = paging_permissions_item_data paging_permissions.append(paging_permissions_item) - incident_communication_permissions: Union[Unset, list[str]] = UNSET + incident_communication_permissions: Unset | list[str] = UNSET if not isinstance(self.incident_communication_permissions, Unset): incident_communication_permissions = [] for incident_communication_permissions_item_data in self.incident_communication_permissions: incident_communication_permissions_item: str = incident_communication_permissions_item_data incident_communication_permissions.append(incident_communication_permissions_item) - communication_permissions: Union[Unset, list[str]] = UNSET + communication_permissions: Unset | list[str] = UNSET if not isinstance(self.communication_permissions, Unset): communication_permissions = [] for communication_permissions_item_data in self.communication_permissions: @@ -555,21 +553,21 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name") - def _parse_slug(data: object) -> Union[None, Unset, str]: + def _parse_slug(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) slug = _parse_slug(d.pop("slug", UNSET)) - def _parse_incident_permission_set_id(data: object) -> Union[None, Unset, str]: + def _parse_incident_permission_set_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) incident_permission_set_id = _parse_incident_permission_set_id(d.pop("incident_permission_set_id", UNSET)) diff --git a/rootly_sdk/models/new_schedule_data_attributes.py b/rootly_sdk/models/new_schedule_data_attributes.py index 3b17d640..99d05545 100644 --- a/rootly_sdk/models/new_schedule_data_attributes.py +++ b/rootly_sdk/models/new_schedule_data_attributes.py @@ -47,19 +47,19 @@ class NewScheduleDataAttributes: name: str owner_user_id: int - description: Union[None, Unset, str] = UNSET - all_time_coverage: Union[None, Unset, bool] = UNSET + description: None | Unset | str = UNSET + all_time_coverage: None | Unset | bool = UNSET slack_user_group: Union[Unset, "NewScheduleDataAttributesSlackUserGroup"] = UNSET slack_channel: Union["NewScheduleDataAttributesSlackChannelType0", None, Unset] = UNSET - owner_group_ids: Union[Unset, list[str]] = UNSET - sync_linear_enabled: Union[None, Unset, bool] = UNSET - include_shadows_in_slack_notifications: Union[None, Unset, bool] = UNSET - shift_start_notifications_enabled: Union[None, Unset, bool] = UNSET - shift_update_notifications_enabled: Union[None, Unset, bool] = UNSET - shift_report_enabled: Union[None, Unset, bool] = UNSET - shift_report_day_of_week: Union[Unset, NewScheduleDataAttributesShiftReportDayOfWeek] = UNSET - shift_report_time_of_day: Union[None, Unset, str] = UNSET - shift_report_time_zone: Union[None, Unset, str] = UNSET + owner_group_ids: Unset | list[str] = UNSET + sync_linear_enabled: None | Unset | bool = UNSET + include_shadows_in_slack_notifications: None | Unset | bool = UNSET + shift_start_notifications_enabled: None | Unset | bool = UNSET + shift_update_notifications_enabled: None | Unset | bool = UNSET + shift_report_enabled: None | Unset | bool = UNSET + shift_report_day_of_week: Unset | NewScheduleDataAttributesShiftReportDayOfWeek = UNSET + shift_report_time_of_day: None | Unset | str = UNSET + shift_report_time_zone: None | Unset | str = UNSET def to_dict(self) -> dict[str, Any]: from ..models.new_schedule_data_attributes_slack_channel_type_0 import ( @@ -70,23 +70,23 @@ def to_dict(self) -> dict[str, Any]: owner_user_id = self.owner_user_id - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - all_time_coverage: Union[None, Unset, bool] + all_time_coverage: None | Unset | bool if isinstance(self.all_time_coverage, Unset): all_time_coverage = UNSET else: all_time_coverage = self.all_time_coverage - slack_user_group: Union[Unset, dict[str, Any]] = UNSET + slack_user_group: Unset | dict[str, Any] = UNSET if not isinstance(self.slack_user_group, Unset): slack_user_group = self.slack_user_group.to_dict() - slack_channel: Union[None, Unset, dict[str, Any]] + slack_channel: None | Unset | dict[str, Any] if isinstance(self.slack_channel, Unset): slack_channel = UNSET elif isinstance(self.slack_channel, NewScheduleDataAttributesSlackChannelType0): @@ -94,51 +94,51 @@ def to_dict(self) -> dict[str, Any]: else: slack_channel = self.slack_channel - owner_group_ids: Union[Unset, list[str]] = UNSET + owner_group_ids: Unset | list[str] = UNSET if not isinstance(self.owner_group_ids, Unset): owner_group_ids = self.owner_group_ids - sync_linear_enabled: Union[None, Unset, bool] + sync_linear_enabled: None | Unset | bool if isinstance(self.sync_linear_enabled, Unset): sync_linear_enabled = UNSET else: sync_linear_enabled = self.sync_linear_enabled - include_shadows_in_slack_notifications: Union[None, Unset, bool] + include_shadows_in_slack_notifications: None | Unset | bool if isinstance(self.include_shadows_in_slack_notifications, Unset): include_shadows_in_slack_notifications = UNSET else: include_shadows_in_slack_notifications = self.include_shadows_in_slack_notifications - shift_start_notifications_enabled: Union[None, Unset, bool] + shift_start_notifications_enabled: None | Unset | bool if isinstance(self.shift_start_notifications_enabled, Unset): shift_start_notifications_enabled = UNSET else: shift_start_notifications_enabled = self.shift_start_notifications_enabled - shift_update_notifications_enabled: Union[None, Unset, bool] + shift_update_notifications_enabled: None | Unset | bool if isinstance(self.shift_update_notifications_enabled, Unset): shift_update_notifications_enabled = UNSET else: shift_update_notifications_enabled = self.shift_update_notifications_enabled - shift_report_enabled: Union[None, Unset, bool] + shift_report_enabled: None | Unset | bool if isinstance(self.shift_report_enabled, Unset): shift_report_enabled = UNSET else: shift_report_enabled = self.shift_report_enabled - shift_report_day_of_week: Union[Unset, str] = UNSET + shift_report_day_of_week: Unset | str = UNSET if not isinstance(self.shift_report_day_of_week, Unset): shift_report_day_of_week = self.shift_report_day_of_week - shift_report_time_of_day: Union[None, Unset, str] + shift_report_time_of_day: None | Unset | str if isinstance(self.shift_report_time_of_day, Unset): shift_report_time_of_day = UNSET else: shift_report_time_of_day = self.shift_report_time_of_day - shift_report_time_zone: Union[None, Unset, str] + shift_report_time_zone: None | Unset | str if isinstance(self.shift_report_time_zone, Unset): shift_report_time_zone = UNSET else: @@ -193,26 +193,26 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: owner_user_id = d.pop("owner_user_id") - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_all_time_coverage(data: object) -> Union[None, Unset, bool]: + def _parse_all_time_coverage(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) all_time_coverage = _parse_all_time_coverage(d.pop("all_time_coverage", UNSET)) _slack_user_group = d.pop("slack_user_group", UNSET) - slack_user_group: Union[Unset, NewScheduleDataAttributesSlackUserGroup] + slack_user_group: Unset | NewScheduleDataAttributesSlackUserGroup if isinstance(_slack_user_group, Unset): slack_user_group = UNSET else: @@ -237,59 +237,59 @@ def _parse_slack_channel(data: object) -> Union["NewScheduleDataAttributesSlackC owner_group_ids = cast(list[str], d.pop("owner_group_ids", UNSET)) - def _parse_sync_linear_enabled(data: object) -> Union[None, Unset, bool]: + def _parse_sync_linear_enabled(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) sync_linear_enabled = _parse_sync_linear_enabled(d.pop("sync_linear_enabled", UNSET)) - def _parse_include_shadows_in_slack_notifications(data: object) -> Union[None, Unset, bool]: + def _parse_include_shadows_in_slack_notifications(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) include_shadows_in_slack_notifications = _parse_include_shadows_in_slack_notifications( d.pop("include_shadows_in_slack_notifications", UNSET) ) - def _parse_shift_start_notifications_enabled(data: object) -> Union[None, Unset, bool]: + def _parse_shift_start_notifications_enabled(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) shift_start_notifications_enabled = _parse_shift_start_notifications_enabled( d.pop("shift_start_notifications_enabled", UNSET) ) - def _parse_shift_update_notifications_enabled(data: object) -> Union[None, Unset, bool]: + def _parse_shift_update_notifications_enabled(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) shift_update_notifications_enabled = _parse_shift_update_notifications_enabled( d.pop("shift_update_notifications_enabled", UNSET) ) - def _parse_shift_report_enabled(data: object) -> Union[None, Unset, bool]: + def _parse_shift_report_enabled(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) shift_report_enabled = _parse_shift_report_enabled(d.pop("shift_report_enabled", UNSET)) _shift_report_day_of_week = d.pop("shift_report_day_of_week", UNSET) - shift_report_day_of_week: Union[Unset, NewScheduleDataAttributesShiftReportDayOfWeek] + shift_report_day_of_week: Unset | NewScheduleDataAttributesShiftReportDayOfWeek if isinstance(_shift_report_day_of_week, Unset): shift_report_day_of_week = UNSET else: @@ -297,21 +297,21 @@ def _parse_shift_report_enabled(data: object) -> Union[None, Unset, bool]: _shift_report_day_of_week ) - def _parse_shift_report_time_of_day(data: object) -> Union[None, Unset, str]: + def _parse_shift_report_time_of_day(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) shift_report_time_of_day = _parse_shift_report_time_of_day(d.pop("shift_report_time_of_day", UNSET)) - def _parse_shift_report_time_zone(data: object) -> Union[None, Unset, str]: + def _parse_shift_report_time_zone(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) shift_report_time_zone = _parse_shift_report_time_zone(d.pop("shift_report_time_zone", UNSET)) diff --git a/rootly_sdk/models/new_schedule_data_attributes_slack_channel_type_0.py b/rootly_sdk/models/new_schedule_data_attributes_slack_channel_type_0.py index d4b97eb4..88d154f3 100644 --- a/rootly_sdk/models/new_schedule_data_attributes_slack_channel_type_0.py +++ b/rootly_sdk/models/new_schedule_data_attributes_slack_channel_type_0.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class NewScheduleDataAttributesSlackChannelType0: name (Union[Unset, str]): Slack channel name """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/new_schedule_data_attributes_slack_user_group.py b/rootly_sdk/models/new_schedule_data_attributes_slack_user_group.py index 903d1c8b..cf79f8e0 100644 --- a/rootly_sdk/models/new_schedule_data_attributes_slack_user_group.py +++ b/rootly_sdk/models/new_schedule_data_attributes_slack_user_group.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class NewScheduleDataAttributesSlackUserGroup: name (Union[Unset, str]): Slack user group name """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/new_schedule_rotation_active_day_data_attributes_active_time_attributes_item.py b/rootly_sdk/models/new_schedule_rotation_active_day_data_attributes_active_time_attributes_item.py index 5ed3f2be..b99cbf6b 100644 --- a/rootly_sdk/models/new_schedule_rotation_active_day_data_attributes_active_time_attributes_item.py +++ b/rootly_sdk/models/new_schedule_rotation_active_day_data_attributes_active_time_attributes_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class NewScheduleRotationActiveDayDataAttributesActiveTimeAttributesItem: end_time (Union[Unset, str]): End time for schedule rotation active time """ - start_time: Union[Unset, str] = UNSET - end_time: Union[Unset, str] = UNSET + start_time: Unset | str = UNSET + end_time: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/new_schedule_rotation_data_attributes.py b/rootly_sdk/models/new_schedule_rotation_data_attributes.py index a4bbaa44..726f5b1a 100644 --- a/rootly_sdk/models/new_schedule_rotation_data_attributes.py +++ b/rootly_sdk/models/new_schedule_rotation_data_attributes.py @@ -73,17 +73,17 @@ class NewScheduleRotationDataAttributes: "NewScheduleRotationDataAttributesScheduleRotationableAttributesType2", "NewScheduleRotationDataAttributesScheduleRotationableAttributesType3", ] - position: Union[Unset, int] = UNSET - active_all_week: Union[Unset, bool] = True - active_days: Union[Unset, list[NewScheduleRotationDataAttributesActiveDaysItem]] = UNSET - active_time_type: Union[Unset, str] = UNSET - active_time_attributes: Union[Unset, list["NewScheduleRotationDataAttributesActiveTimeAttributesItem"]] = UNSET - time_zone: Union[Unset, str] = "Etc/UTC" - start_time: Union[None, Unset, datetime.datetime] = UNSET - end_time: Union[None, Unset, datetime.datetime] = UNSET - schedule_rotation_members: Union[ - None, Unset, list["NewScheduleRotationDataAttributesScheduleRotationMembersType0Item"] - ] = UNSET + position: Unset | int = UNSET + active_all_week: Unset | bool = True + active_days: Unset | list[NewScheduleRotationDataAttributesActiveDaysItem] = UNSET + active_time_type: Unset | str = UNSET + active_time_attributes: Unset | list["NewScheduleRotationDataAttributesActiveTimeAttributesItem"] = UNSET + time_zone: Unset | str = "Etc/UTC" + start_time: None | Unset | datetime.datetime = UNSET + end_time: None | Unset | datetime.datetime = UNSET + schedule_rotation_members: ( + None | Unset | list["NewScheduleRotationDataAttributesScheduleRotationMembersType0Item"] + ) = UNSET def to_dict(self) -> dict[str, Any]: from ..models.new_schedule_rotation_data_attributes_schedule_rotationable_attributes_type_0 import ( @@ -120,7 +120,7 @@ def to_dict(self) -> dict[str, Any]: active_all_week = self.active_all_week - active_days: Union[Unset, list[str]] = UNSET + active_days: Unset | list[str] = UNSET if not isinstance(self.active_days, Unset): active_days = [] for active_days_item_data in self.active_days: @@ -129,7 +129,7 @@ def to_dict(self) -> dict[str, Any]: active_time_type = self.active_time_type - active_time_attributes: Union[Unset, list[dict[str, Any]]] = UNSET + active_time_attributes: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.active_time_attributes, Unset): active_time_attributes = [] for active_time_attributes_item_data in self.active_time_attributes: @@ -138,7 +138,7 @@ def to_dict(self) -> dict[str, Any]: time_zone = self.time_zone - start_time: Union[None, Unset, str] + start_time: None | Unset | str if isinstance(self.start_time, Unset): start_time = UNSET elif isinstance(self.start_time, datetime.datetime): @@ -146,7 +146,7 @@ def to_dict(self) -> dict[str, Any]: else: start_time = self.start_time - end_time: Union[None, Unset, str] + end_time: None | Unset | str if isinstance(self.end_time, Unset): end_time = UNSET elif isinstance(self.end_time, datetime.datetime): @@ -154,7 +154,7 @@ def to_dict(self) -> dict[str, Any]: else: end_time = self.end_time - schedule_rotation_members: Union[None, Unset, list[dict[str, Any]]] + schedule_rotation_members: None | Unset | list[dict[str, Any]] if isinstance(self.schedule_rotation_members, Unset): schedule_rotation_members = UNSET elif isinstance(self.schedule_rotation_members, list): @@ -298,7 +298,7 @@ def _parse_schedule_rotationable_attributes( time_zone = d.pop("time_zone", UNSET) - def _parse_start_time(data: object) -> Union[None, Unset, datetime.datetime]: + def _parse_start_time(data: object) -> None | Unset | datetime.datetime: if data is None: return data if isinstance(data, Unset): @@ -311,11 +311,11 @@ def _parse_start_time(data: object) -> Union[None, Unset, datetime.datetime]: return start_time_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, datetime.datetime], data) + return cast(None | Unset | datetime.datetime, data) start_time = _parse_start_time(d.pop("start_time", UNSET)) - def _parse_end_time(data: object) -> Union[None, Unset, datetime.datetime]: + def _parse_end_time(data: object) -> None | Unset | datetime.datetime: if data is None: return data if isinstance(data, Unset): @@ -328,13 +328,13 @@ def _parse_end_time(data: object) -> Union[None, Unset, datetime.datetime]: return end_time_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, datetime.datetime], data) + return cast(None | Unset | datetime.datetime, data) end_time = _parse_end_time(d.pop("end_time", UNSET)) def _parse_schedule_rotation_members( data: object, - ) -> Union[None, Unset, list["NewScheduleRotationDataAttributesScheduleRotationMembersType0Item"]]: + ) -> None | Unset | list["NewScheduleRotationDataAttributesScheduleRotationMembersType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -356,9 +356,7 @@ def _parse_schedule_rotation_members( return schedule_rotation_members_type_0 except: # noqa: E722 pass - return cast( - Union[None, Unset, list["NewScheduleRotationDataAttributesScheduleRotationMembersType0Item"]], data - ) + return cast(None | Unset | list["NewScheduleRotationDataAttributesScheduleRotationMembersType0Item"], data) schedule_rotation_members = _parse_schedule_rotation_members(d.pop("schedule_rotation_members", UNSET)) diff --git a/rootly_sdk/models/new_schedule_rotation_data_attributes_schedule_rotation_members_type_0_item.py b/rootly_sdk/models/new_schedule_rotation_data_attributes_schedule_rotation_members_type_0_item.py index b438d01b..7d563c07 100644 --- a/rootly_sdk/models/new_schedule_rotation_data_attributes_schedule_rotation_members_type_0_item.py +++ b/rootly_sdk/models/new_schedule_rotation_data_attributes_schedule_rotation_members_type_0_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -24,7 +24,7 @@ class NewScheduleRotationDataAttributesScheduleRotationMembersType0Item: member_type: NewScheduleRotationDataAttributesScheduleRotationMembersType0ItemMemberType member_id: str - position: Union[Unset, int] = UNSET + position: Unset | int = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/new_schedule_rotation_user.py b/rootly_sdk/models/new_schedule_rotation_user.py index 0f37ecad..70c1f040 100644 --- a/rootly_sdk/models/new_schedule_rotation_user.py +++ b/rootly_sdk/models/new_schedule_rotation_user.py @@ -24,7 +24,7 @@ class NewScheduleRotationUser: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data: Union[Unset, dict[str, Any]] = UNSET + data: Unset | dict[str, Any] = UNSET if not isinstance(self.data, Unset): data = self.data.to_dict() @@ -42,7 +42,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _data = d.pop("data", UNSET) - data: Union[Unset, NewScheduleRotationUserData] + data: Unset | NewScheduleRotationUserData if isinstance(_data, Unset): data = UNSET else: diff --git a/rootly_sdk/models/new_schedule_rotation_user_data.py b/rootly_sdk/models/new_schedule_rotation_user_data.py index 163d0d55..45266c80 100644 --- a/rootly_sdk/models/new_schedule_rotation_user_data.py +++ b/rootly_sdk/models/new_schedule_rotation_user_data.py @@ -25,16 +25,16 @@ class NewScheduleRotationUserData: attributes (Union[Unset, NewScheduleRotationUserDataAttributes]): """ - type_: Union[Unset, NewScheduleRotationUserDataType] = UNSET + type_: Unset | NewScheduleRotationUserDataType = UNSET attributes: Union[Unset, "NewScheduleRotationUserDataAttributes"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: Union[Unset, str] = UNSET + type_: Unset | str = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ - attributes: Union[Unset, dict[str, Any]] = UNSET + attributes: Unset | dict[str, Any] = UNSET if not isinstance(self.attributes, Unset): attributes = self.attributes.to_dict() @@ -54,14 +54,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _type_ = d.pop("type", UNSET) - type_: Union[Unset, NewScheduleRotationUserDataType] + type_: Unset | NewScheduleRotationUserDataType if isinstance(_type_, Unset): type_ = UNSET else: type_ = check_new_schedule_rotation_user_data_type(_type_) _attributes = d.pop("attributes", UNSET) - attributes: Union[Unset, NewScheduleRotationUserDataAttributes] + attributes: Unset | NewScheduleRotationUserDataAttributes if isinstance(_attributes, Unset): attributes = UNSET else: diff --git a/rootly_sdk/models/new_schedule_rotation_user_data_attributes.py b/rootly_sdk/models/new_schedule_rotation_user_data_attributes.py index ed140dcd..ce6d4a42 100644 --- a/rootly_sdk/models/new_schedule_rotation_user_data_attributes.py +++ b/rootly_sdk/models/new_schedule_rotation_user_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define @@ -17,7 +17,7 @@ class NewScheduleRotationUserDataAttributes: """ user_id: int - position: Union[Unset, int] = UNSET + position: Unset | int = UNSET def to_dict(self) -> dict[str, Any]: user_id = self.user_id diff --git a/rootly_sdk/models/new_secret_data_attributes.py b/rootly_sdk/models/new_secret_data_attributes.py index f76cd353..47851d3b 100644 --- a/rootly_sdk/models/new_secret_data_attributes.py +++ b/rootly_sdk/models/new_secret_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -23,33 +23,33 @@ class NewSecretDataAttributes: name: str secret: str - kind: Union[Unset, NewSecretDataAttributesKind] = UNSET - hashicorp_vault_mount: Union[None, Unset, str] = "secret" - hashicorp_vault_path: Union[None, Unset, str] = UNSET - hashicorp_vault_version: Union[None, Unset, str] = "0" + kind: Unset | NewSecretDataAttributesKind = UNSET + hashicorp_vault_mount: None | Unset | str = "secret" + hashicorp_vault_path: None | Unset | str = UNSET + hashicorp_vault_version: None | Unset | str = "0" def to_dict(self) -> dict[str, Any]: name = self.name secret = self.secret - kind: Union[Unset, str] = UNSET + kind: Unset | str = UNSET if not isinstance(self.kind, Unset): kind = self.kind - hashicorp_vault_mount: Union[None, Unset, str] + hashicorp_vault_mount: None | Unset | str if isinstance(self.hashicorp_vault_mount, Unset): hashicorp_vault_mount = UNSET else: hashicorp_vault_mount = self.hashicorp_vault_mount - hashicorp_vault_path: Union[None, Unset, str] + hashicorp_vault_path: None | Unset | str if isinstance(self.hashicorp_vault_path, Unset): hashicorp_vault_path = UNSET else: hashicorp_vault_path = self.hashicorp_vault_path - hashicorp_vault_version: Union[None, Unset, str] + hashicorp_vault_version: None | Unset | str if isinstance(self.hashicorp_vault_version, Unset): hashicorp_vault_version = UNSET else: @@ -82,36 +82,36 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: secret = d.pop("secret") _kind = d.pop("kind", UNSET) - kind: Union[Unset, NewSecretDataAttributesKind] + kind: Unset | NewSecretDataAttributesKind if isinstance(_kind, Unset): kind = UNSET else: kind = check_new_secret_data_attributes_kind(_kind) - def _parse_hashicorp_vault_mount(data: object) -> Union[None, Unset, str]: + def _parse_hashicorp_vault_mount(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) hashicorp_vault_mount = _parse_hashicorp_vault_mount(d.pop("hashicorp_vault_mount", UNSET)) - def _parse_hashicorp_vault_path(data: object) -> Union[None, Unset, str]: + def _parse_hashicorp_vault_path(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) hashicorp_vault_path = _parse_hashicorp_vault_path(d.pop("hashicorp_vault_path", UNSET)) - def _parse_hashicorp_vault_version(data: object) -> Union[None, Unset, str]: + def _parse_hashicorp_vault_version(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) hashicorp_vault_version = _parse_hashicorp_vault_version(d.pop("hashicorp_vault_version", UNSET)) diff --git a/rootly_sdk/models/new_service_data_attributes.py b/rootly_sdk/models/new_service_data_attributes.py index 5c6c8fbd..6dda8535 100644 --- a/rootly_sdk/models/new_service_data_attributes.py +++ b/rootly_sdk/models/new_service_data_attributes.py @@ -83,40 +83,40 @@ class NewServiceDataAttributes: """ name: str - slug: Union[None, Unset, str] = UNSET - description: Union[None, Unset, str] = UNSET - public_description: Union[None, Unset, str] = UNSET - notify_emails: Union[None, Unset, list[str]] = UNSET - color: Union[None, Unset, str] = UNSET - position: Union[None, Unset, int] = UNSET - show_uptime: Union[None, Unset, bool] = UNSET - show_uptime_last_days: Union[Unset, NewServiceDataAttributesShowUptimeLastDays] = 60 - backstage_id: Union[None, Unset, str] = UNSET - pagerduty_id: Union[None, Unset, str] = UNSET - external_id: Union[None, Unset, str] = UNSET - opsgenie_id: Union[None, Unset, str] = UNSET - opsgenie_team_id: Union[None, Unset, str] = UNSET - cortex_id: Union[None, Unset, str] = UNSET - service_now_ci_sys_id: Union[None, Unset, str] = UNSET - github_repository_name: Union[None, Unset, str] = UNSET - github_repository_branch: Union[None, Unset, str] = UNSET - gitlab_repository_name: Union[None, Unset, str] = UNSET - gitlab_repository_branch: Union[None, Unset, str] = UNSET - environment_ids: Union[None, Unset, list[str]] = UNSET - service_ids: Union[None, Unset, list[str]] = UNSET - owner_group_ids: Union[None, Unset, list[str]] = UNSET - owner_user_ids: Union[None, Unset, list[int]] = UNSET - kubernetes_deployment_name: Union[None, Unset, str] = UNSET - alerts_email_enabled: Union[None, Unset, bool] = UNSET - alert_urgency_id: Union[None, Unset, str] = UNSET - escalation_policy_id: Union[None, Unset, str] = UNSET - slack_channels: Union[None, Unset, list["NewServiceDataAttributesSlackChannelsType0Item"]] = UNSET - slack_aliases: Union[None, Unset, list["NewServiceDataAttributesSlackAliasesType0Item"]] = UNSET - alert_broadcast_enabled: Union[None, Unset, bool] = UNSET + slug: None | Unset | str = UNSET + description: None | Unset | str = UNSET + public_description: None | Unset | str = UNSET + notify_emails: None | Unset | list[str] = UNSET + color: None | Unset | str = UNSET + position: None | Unset | int = UNSET + show_uptime: None | Unset | bool = UNSET + show_uptime_last_days: Unset | NewServiceDataAttributesShowUptimeLastDays = 60 + backstage_id: None | Unset | str = UNSET + pagerduty_id: None | Unset | str = UNSET + external_id: None | Unset | str = UNSET + opsgenie_id: None | Unset | str = UNSET + opsgenie_team_id: None | Unset | str = UNSET + cortex_id: None | Unset | str = UNSET + service_now_ci_sys_id: None | Unset | str = UNSET + github_repository_name: None | Unset | str = UNSET + github_repository_branch: None | Unset | str = UNSET + gitlab_repository_name: None | Unset | str = UNSET + gitlab_repository_branch: None | Unset | str = UNSET + environment_ids: None | Unset | list[str] = UNSET + service_ids: None | Unset | list[str] = UNSET + owner_group_ids: None | Unset | list[str] = UNSET + owner_user_ids: None | Unset | list[int] = UNSET + kubernetes_deployment_name: None | Unset | str = UNSET + alerts_email_enabled: None | Unset | bool = UNSET + alert_urgency_id: None | Unset | str = UNSET + escalation_policy_id: None | Unset | str = UNSET + slack_channels: None | Unset | list["NewServiceDataAttributesSlackChannelsType0Item"] = UNSET + slack_aliases: None | Unset | list["NewServiceDataAttributesSlackAliasesType0Item"] = UNSET + alert_broadcast_enabled: None | Unset | bool = UNSET alert_broadcast_channel: Union["NewServiceDataAttributesAlertBroadcastChannelType0", None, Unset] = UNSET - incident_broadcast_enabled: Union[None, Unset, bool] = UNSET + incident_broadcast_enabled: None | Unset | bool = UNSET incident_broadcast_channel: Union["NewServiceDataAttributesIncidentBroadcastChannelType0", None, Unset] = UNSET - properties: Union[Unset, list["NewServiceDataAttributesPropertiesItem"]] = UNSET + properties: Unset | list["NewServiceDataAttributesPropertiesItem"] = UNSET def to_dict(self) -> dict[str, Any]: from ..models.new_service_data_attributes_alert_broadcast_channel_type_0 import ( @@ -128,25 +128,25 @@ def to_dict(self) -> dict[str, Any]: name = self.name - slug: Union[None, Unset, str] + slug: None | Unset | str if isinstance(self.slug, Unset): slug = UNSET else: slug = self.slug - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - public_description: Union[None, Unset, str] + public_description: None | Unset | str if isinstance(self.public_description, Unset): public_description = UNSET else: public_description = self.public_description - notify_emails: Union[None, Unset, list[str]] + notify_emails: None | Unset | list[str] if isinstance(self.notify_emails, Unset): notify_emails = UNSET elif isinstance(self.notify_emails, list): @@ -155,95 +155,95 @@ def to_dict(self) -> dict[str, Any]: else: notify_emails = self.notify_emails - color: Union[None, Unset, str] + color: None | Unset | str if isinstance(self.color, Unset): color = UNSET else: color = self.color - position: Union[None, Unset, int] + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: position = self.position - show_uptime: Union[None, Unset, bool] + show_uptime: None | Unset | bool if isinstance(self.show_uptime, Unset): show_uptime = UNSET else: show_uptime = self.show_uptime - show_uptime_last_days: Union[Unset, int] = UNSET + show_uptime_last_days: Unset | int = UNSET if not isinstance(self.show_uptime_last_days, Unset): show_uptime_last_days = self.show_uptime_last_days - backstage_id: Union[None, Unset, str] + backstage_id: None | Unset | str if isinstance(self.backstage_id, Unset): backstage_id = UNSET else: backstage_id = self.backstage_id - pagerduty_id: Union[None, Unset, str] + pagerduty_id: None | Unset | str if isinstance(self.pagerduty_id, Unset): pagerduty_id = UNSET else: pagerduty_id = self.pagerduty_id - external_id: Union[None, Unset, str] + external_id: None | Unset | str if isinstance(self.external_id, Unset): external_id = UNSET else: external_id = self.external_id - opsgenie_id: Union[None, Unset, str] + opsgenie_id: None | Unset | str if isinstance(self.opsgenie_id, Unset): opsgenie_id = UNSET else: opsgenie_id = self.opsgenie_id - opsgenie_team_id: Union[None, Unset, str] + opsgenie_team_id: None | Unset | str if isinstance(self.opsgenie_team_id, Unset): opsgenie_team_id = UNSET else: opsgenie_team_id = self.opsgenie_team_id - cortex_id: Union[None, Unset, str] + cortex_id: None | Unset | str if isinstance(self.cortex_id, Unset): cortex_id = UNSET else: cortex_id = self.cortex_id - service_now_ci_sys_id: Union[None, Unset, str] + service_now_ci_sys_id: None | Unset | str if isinstance(self.service_now_ci_sys_id, Unset): service_now_ci_sys_id = UNSET else: service_now_ci_sys_id = self.service_now_ci_sys_id - github_repository_name: Union[None, Unset, str] + github_repository_name: None | Unset | str if isinstance(self.github_repository_name, Unset): github_repository_name = UNSET else: github_repository_name = self.github_repository_name - github_repository_branch: Union[None, Unset, str] + github_repository_branch: None | Unset | str if isinstance(self.github_repository_branch, Unset): github_repository_branch = UNSET else: github_repository_branch = self.github_repository_branch - gitlab_repository_name: Union[None, Unset, str] + gitlab_repository_name: None | Unset | str if isinstance(self.gitlab_repository_name, Unset): gitlab_repository_name = UNSET else: gitlab_repository_name = self.gitlab_repository_name - gitlab_repository_branch: Union[None, Unset, str] + gitlab_repository_branch: None | Unset | str if isinstance(self.gitlab_repository_branch, Unset): gitlab_repository_branch = UNSET else: gitlab_repository_branch = self.gitlab_repository_branch - environment_ids: Union[None, Unset, list[str]] + environment_ids: None | Unset | list[str] if isinstance(self.environment_ids, Unset): environment_ids = UNSET elif isinstance(self.environment_ids, list): @@ -252,7 +252,7 @@ def to_dict(self) -> dict[str, Any]: else: environment_ids = self.environment_ids - service_ids: Union[None, Unset, list[str]] + service_ids: None | Unset | list[str] if isinstance(self.service_ids, Unset): service_ids = UNSET elif isinstance(self.service_ids, list): @@ -261,7 +261,7 @@ def to_dict(self) -> dict[str, Any]: else: service_ids = self.service_ids - owner_group_ids: Union[None, Unset, list[str]] + owner_group_ids: None | Unset | list[str] if isinstance(self.owner_group_ids, Unset): owner_group_ids = UNSET elif isinstance(self.owner_group_ids, list): @@ -270,7 +270,7 @@ def to_dict(self) -> dict[str, Any]: else: owner_group_ids = self.owner_group_ids - owner_user_ids: Union[None, Unset, list[int]] + owner_user_ids: None | Unset | list[int] if isinstance(self.owner_user_ids, Unset): owner_user_ids = UNSET elif isinstance(self.owner_user_ids, list): @@ -279,31 +279,31 @@ def to_dict(self) -> dict[str, Any]: else: owner_user_ids = self.owner_user_ids - kubernetes_deployment_name: Union[None, Unset, str] + kubernetes_deployment_name: None | Unset | str if isinstance(self.kubernetes_deployment_name, Unset): kubernetes_deployment_name = UNSET else: kubernetes_deployment_name = self.kubernetes_deployment_name - alerts_email_enabled: Union[None, Unset, bool] + alerts_email_enabled: None | Unset | bool if isinstance(self.alerts_email_enabled, Unset): alerts_email_enabled = UNSET else: alerts_email_enabled = self.alerts_email_enabled - alert_urgency_id: Union[None, Unset, str] + alert_urgency_id: None | Unset | str if isinstance(self.alert_urgency_id, Unset): alert_urgency_id = UNSET else: alert_urgency_id = self.alert_urgency_id - escalation_policy_id: Union[None, Unset, str] + escalation_policy_id: None | Unset | str if isinstance(self.escalation_policy_id, Unset): escalation_policy_id = UNSET else: escalation_policy_id = self.escalation_policy_id - slack_channels: Union[None, Unset, list[dict[str, Any]]] + slack_channels: None | Unset | list[dict[str, Any]] if isinstance(self.slack_channels, Unset): slack_channels = UNSET elif isinstance(self.slack_channels, list): @@ -315,7 +315,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_channels = self.slack_channels - slack_aliases: Union[None, Unset, list[dict[str, Any]]] + slack_aliases: None | Unset | list[dict[str, Any]] if isinstance(self.slack_aliases, Unset): slack_aliases = UNSET elif isinstance(self.slack_aliases, list): @@ -327,13 +327,13 @@ def to_dict(self) -> dict[str, Any]: else: slack_aliases = self.slack_aliases - alert_broadcast_enabled: Union[None, Unset, bool] + alert_broadcast_enabled: None | Unset | bool if isinstance(self.alert_broadcast_enabled, Unset): alert_broadcast_enabled = UNSET else: alert_broadcast_enabled = self.alert_broadcast_enabled - alert_broadcast_channel: Union[None, Unset, dict[str, Any]] + alert_broadcast_channel: None | Unset | dict[str, Any] if isinstance(self.alert_broadcast_channel, Unset): alert_broadcast_channel = UNSET elif isinstance(self.alert_broadcast_channel, NewServiceDataAttributesAlertBroadcastChannelType0): @@ -341,13 +341,13 @@ def to_dict(self) -> dict[str, Any]: else: alert_broadcast_channel = self.alert_broadcast_channel - incident_broadcast_enabled: Union[None, Unset, bool] + incident_broadcast_enabled: None | Unset | bool if isinstance(self.incident_broadcast_enabled, Unset): incident_broadcast_enabled = UNSET else: incident_broadcast_enabled = self.incident_broadcast_enabled - incident_broadcast_channel: Union[None, Unset, dict[str, Any]] + incident_broadcast_channel: None | Unset | dict[str, Any] if isinstance(self.incident_broadcast_channel, Unset): incident_broadcast_channel = UNSET elif isinstance(self.incident_broadcast_channel, NewServiceDataAttributesIncidentBroadcastChannelType0): @@ -355,7 +355,7 @@ def to_dict(self) -> dict[str, Any]: else: incident_broadcast_channel = self.incident_broadcast_channel - properties: Union[Unset, list[dict[str, Any]]] = UNSET + properties: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.properties, Unset): properties = [] for properties_item_data in self.properties: @@ -459,34 +459,34 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name") - def _parse_slug(data: object) -> Union[None, Unset, str]: + def _parse_slug(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) slug = _parse_slug(d.pop("slug", UNSET)) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_public_description(data: object) -> Union[None, Unset, str]: + def _parse_public_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) public_description = _parse_public_description(d.pop("public_description", UNSET)) - def _parse_notify_emails(data: object) -> Union[None, Unset, list[str]]: + def _parse_notify_emails(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -499,144 +499,144 @@ def _parse_notify_emails(data: object) -> Union[None, Unset, list[str]]: return notify_emails_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) notify_emails = _parse_notify_emails(d.pop("notify_emails", UNSET)) - def _parse_color(data: object) -> Union[None, Unset, str]: + def _parse_color(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) color = _parse_color(d.pop("color", UNSET)) - def _parse_position(data: object) -> Union[None, Unset, int]: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) - def _parse_show_uptime(data: object) -> Union[None, Unset, bool]: + def _parse_show_uptime(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) show_uptime = _parse_show_uptime(d.pop("show_uptime", UNSET)) _show_uptime_last_days = d.pop("show_uptime_last_days", UNSET) - show_uptime_last_days: Union[Unset, NewServiceDataAttributesShowUptimeLastDays] + show_uptime_last_days: Unset | NewServiceDataAttributesShowUptimeLastDays if isinstance(_show_uptime_last_days, Unset): show_uptime_last_days = UNSET else: show_uptime_last_days = check_new_service_data_attributes_show_uptime_last_days(_show_uptime_last_days) - def _parse_backstage_id(data: object) -> Union[None, Unset, str]: + def _parse_backstage_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) backstage_id = _parse_backstage_id(d.pop("backstage_id", UNSET)) - def _parse_pagerduty_id(data: object) -> Union[None, Unset, str]: + def _parse_pagerduty_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) pagerduty_id = _parse_pagerduty_id(d.pop("pagerduty_id", UNSET)) - def _parse_external_id(data: object) -> Union[None, Unset, str]: + def _parse_external_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) external_id = _parse_external_id(d.pop("external_id", UNSET)) - def _parse_opsgenie_id(data: object) -> Union[None, Unset, str]: + def _parse_opsgenie_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) opsgenie_id = _parse_opsgenie_id(d.pop("opsgenie_id", UNSET)) - def _parse_opsgenie_team_id(data: object) -> Union[None, Unset, str]: + def _parse_opsgenie_team_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) opsgenie_team_id = _parse_opsgenie_team_id(d.pop("opsgenie_team_id", UNSET)) - def _parse_cortex_id(data: object) -> Union[None, Unset, str]: + def _parse_cortex_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) cortex_id = _parse_cortex_id(d.pop("cortex_id", UNSET)) - def _parse_service_now_ci_sys_id(data: object) -> Union[None, Unset, str]: + def _parse_service_now_ci_sys_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) service_now_ci_sys_id = _parse_service_now_ci_sys_id(d.pop("service_now_ci_sys_id", UNSET)) - def _parse_github_repository_name(data: object) -> Union[None, Unset, str]: + def _parse_github_repository_name(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) github_repository_name = _parse_github_repository_name(d.pop("github_repository_name", UNSET)) - def _parse_github_repository_branch(data: object) -> Union[None, Unset, str]: + def _parse_github_repository_branch(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) github_repository_branch = _parse_github_repository_branch(d.pop("github_repository_branch", UNSET)) - def _parse_gitlab_repository_name(data: object) -> Union[None, Unset, str]: + def _parse_gitlab_repository_name(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) gitlab_repository_name = _parse_gitlab_repository_name(d.pop("gitlab_repository_name", UNSET)) - def _parse_gitlab_repository_branch(data: object) -> Union[None, Unset, str]: + def _parse_gitlab_repository_branch(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) gitlab_repository_branch = _parse_gitlab_repository_branch(d.pop("gitlab_repository_branch", UNSET)) - def _parse_environment_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_environment_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -649,11 +649,11 @@ def _parse_environment_ids(data: object) -> Union[None, Unset, list[str]]: return environment_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) environment_ids = _parse_environment_ids(d.pop("environment_ids", UNSET)) - def _parse_service_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_service_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -666,11 +666,11 @@ def _parse_service_ids(data: object) -> Union[None, Unset, list[str]]: return service_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) service_ids = _parse_service_ids(d.pop("service_ids", UNSET)) - def _parse_owner_group_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_owner_group_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -683,11 +683,11 @@ def _parse_owner_group_ids(data: object) -> Union[None, Unset, list[str]]: return owner_group_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) owner_group_ids = _parse_owner_group_ids(d.pop("owner_group_ids", UNSET)) - def _parse_owner_user_ids(data: object) -> Union[None, Unset, list[int]]: + def _parse_owner_user_ids(data: object) -> None | Unset | list[int]: if data is None: return data if isinstance(data, Unset): @@ -700,49 +700,49 @@ def _parse_owner_user_ids(data: object) -> Union[None, Unset, list[int]]: return owner_user_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[int]], data) + return cast(None | Unset | list[int], data) owner_user_ids = _parse_owner_user_ids(d.pop("owner_user_ids", UNSET)) - def _parse_kubernetes_deployment_name(data: object) -> Union[None, Unset, str]: + def _parse_kubernetes_deployment_name(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) kubernetes_deployment_name = _parse_kubernetes_deployment_name(d.pop("kubernetes_deployment_name", UNSET)) - def _parse_alerts_email_enabled(data: object) -> Union[None, Unset, bool]: + def _parse_alerts_email_enabled(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) alerts_email_enabled = _parse_alerts_email_enabled(d.pop("alerts_email_enabled", UNSET)) - def _parse_alert_urgency_id(data: object) -> Union[None, Unset, str]: + def _parse_alert_urgency_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) alert_urgency_id = _parse_alert_urgency_id(d.pop("alert_urgency_id", UNSET)) - def _parse_escalation_policy_id(data: object) -> Union[None, Unset, str]: + def _parse_escalation_policy_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) escalation_policy_id = _parse_escalation_policy_id(d.pop("escalation_policy_id", UNSET)) def _parse_slack_channels( data: object, - ) -> Union[None, Unset, list["NewServiceDataAttributesSlackChannelsType0Item"]]: + ) -> None | Unset | list["NewServiceDataAttributesSlackChannelsType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -762,13 +762,13 @@ def _parse_slack_channels( return slack_channels_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list["NewServiceDataAttributesSlackChannelsType0Item"]], data) + return cast(None | Unset | list["NewServiceDataAttributesSlackChannelsType0Item"], data) slack_channels = _parse_slack_channels(d.pop("slack_channels", UNSET)) def _parse_slack_aliases( data: object, - ) -> Union[None, Unset, list["NewServiceDataAttributesSlackAliasesType0Item"]]: + ) -> None | Unset | list["NewServiceDataAttributesSlackAliasesType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -788,16 +788,16 @@ def _parse_slack_aliases( return slack_aliases_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list["NewServiceDataAttributesSlackAliasesType0Item"]], data) + return cast(None | Unset | list["NewServiceDataAttributesSlackAliasesType0Item"], data) slack_aliases = _parse_slack_aliases(d.pop("slack_aliases", UNSET)) - def _parse_alert_broadcast_enabled(data: object) -> Union[None, Unset, bool]: + def _parse_alert_broadcast_enabled(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) alert_broadcast_enabled = _parse_alert_broadcast_enabled(d.pop("alert_broadcast_enabled", UNSET)) @@ -820,12 +820,12 @@ def _parse_alert_broadcast_channel( alert_broadcast_channel = _parse_alert_broadcast_channel(d.pop("alert_broadcast_channel", UNSET)) - def _parse_incident_broadcast_enabled(data: object) -> Union[None, Unset, bool]: + def _parse_incident_broadcast_enabled(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) incident_broadcast_enabled = _parse_incident_broadcast_enabled(d.pop("incident_broadcast_enabled", UNSET)) diff --git a/rootly_sdk/models/new_service_data_attributes_alert_broadcast_channel_type_0.py b/rootly_sdk/models/new_service_data_attributes_alert_broadcast_channel_type_0.py index 1917c613..f7eeb8cc 100644 --- a/rootly_sdk/models/new_service_data_attributes_alert_broadcast_channel_type_0.py +++ b/rootly_sdk/models/new_service_data_attributes_alert_broadcast_channel_type_0.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,7 +19,7 @@ class NewServiceDataAttributesAlertBroadcastChannelType0: """ id: str - name: Union[Unset, str] = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/new_service_data_attributes_incident_broadcast_channel_type_0.py b/rootly_sdk/models/new_service_data_attributes_incident_broadcast_channel_type_0.py index 6c8f9fa1..e28f2d61 100644 --- a/rootly_sdk/models/new_service_data_attributes_incident_broadcast_channel_type_0.py +++ b/rootly_sdk/models/new_service_data_attributes_incident_broadcast_channel_type_0.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,7 +19,7 @@ class NewServiceDataAttributesIncidentBroadcastChannelType0: """ id: str - name: Union[Unset, str] = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/new_severity_data_attributes.py b/rootly_sdk/models/new_severity_data_attributes.py index 21d72d6b..5a95537e 100644 --- a/rootly_sdk/models/new_severity_data_attributes.py +++ b/rootly_sdk/models/new_severity_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define @@ -40,47 +40,47 @@ class NewSeverityDataAttributes: """ name: str - slug: Union[None, Unset, str] = UNSET - description: Union[None, Unset, str] = UNSET - severity: Union[Unset, NewSeverityDataAttributesSeverity] = UNSET - color: Union[None, Unset, str] = UNSET - position: Union[None, Unset, int] = UNSET - notify_emails: Union[None, Unset, list[str]] = UNSET - slack_channels: Union[None, Unset, list["NewSeverityDataAttributesSlackChannelsType0Item"]] = UNSET - slack_aliases: Union[None, Unset, list["NewSeverityDataAttributesSlackAliasesType0Item"]] = UNSET + slug: None | Unset | str = UNSET + description: None | Unset | str = UNSET + severity: Unset | NewSeverityDataAttributesSeverity = UNSET + color: None | Unset | str = UNSET + position: None | Unset | int = UNSET + notify_emails: None | Unset | list[str] = UNSET + slack_channels: None | Unset | list["NewSeverityDataAttributesSlackChannelsType0Item"] = UNSET + slack_aliases: None | Unset | list["NewSeverityDataAttributesSlackAliasesType0Item"] = UNSET def to_dict(self) -> dict[str, Any]: name = self.name - slug: Union[None, Unset, str] + slug: None | Unset | str if isinstance(self.slug, Unset): slug = UNSET else: slug = self.slug - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - severity: Union[Unset, str] = UNSET + severity: Unset | str = UNSET if not isinstance(self.severity, Unset): severity = self.severity - color: Union[None, Unset, str] + color: None | Unset | str if isinstance(self.color, Unset): color = UNSET else: color = self.color - position: Union[None, Unset, int] + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: position = self.position - notify_emails: Union[None, Unset, list[str]] + notify_emails: None | Unset | list[str] if isinstance(self.notify_emails, Unset): notify_emails = UNSET elif isinstance(self.notify_emails, list): @@ -89,7 +89,7 @@ def to_dict(self) -> dict[str, Any]: else: notify_emails = self.notify_emails - slack_channels: Union[None, Unset, list[dict[str, Any]]] + slack_channels: None | Unset | list[dict[str, Any]] if isinstance(self.slack_channels, Unset): slack_channels = UNSET elif isinstance(self.slack_channels, list): @@ -101,7 +101,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_channels = self.slack_channels - slack_aliases: Union[None, Unset, list[dict[str, Any]]] + slack_aliases: None | Unset | list[dict[str, Any]] if isinstance(self.slack_aliases, Unset): slack_aliases = UNSET elif isinstance(self.slack_aliases, list): @@ -151,50 +151,50 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name") - def _parse_slug(data: object) -> Union[None, Unset, str]: + def _parse_slug(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) slug = _parse_slug(d.pop("slug", UNSET)) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) _severity = d.pop("severity", UNSET) - severity: Union[Unset, NewSeverityDataAttributesSeverity] + severity: Unset | NewSeverityDataAttributesSeverity if isinstance(_severity, Unset): severity = UNSET else: severity = check_new_severity_data_attributes_severity(_severity) - def _parse_color(data: object) -> Union[None, Unset, str]: + def _parse_color(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) color = _parse_color(d.pop("color", UNSET)) - def _parse_position(data: object) -> Union[None, Unset, int]: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) - def _parse_notify_emails(data: object) -> Union[None, Unset, list[str]]: + def _parse_notify_emails(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -207,13 +207,13 @@ def _parse_notify_emails(data: object) -> Union[None, Unset, list[str]]: return notify_emails_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) notify_emails = _parse_notify_emails(d.pop("notify_emails", UNSET)) def _parse_slack_channels( data: object, - ) -> Union[None, Unset, list["NewSeverityDataAttributesSlackChannelsType0Item"]]: + ) -> None | Unset | list["NewSeverityDataAttributesSlackChannelsType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -233,13 +233,13 @@ def _parse_slack_channels( return slack_channels_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list["NewSeverityDataAttributesSlackChannelsType0Item"]], data) + return cast(None | Unset | list["NewSeverityDataAttributesSlackChannelsType0Item"], data) slack_channels = _parse_slack_channels(d.pop("slack_channels", UNSET)) def _parse_slack_aliases( data: object, - ) -> Union[None, Unset, list["NewSeverityDataAttributesSlackAliasesType0Item"]]: + ) -> None | Unset | list["NewSeverityDataAttributesSlackAliasesType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -259,7 +259,7 @@ def _parse_slack_aliases( return slack_aliases_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list["NewSeverityDataAttributesSlackAliasesType0Item"]], data) + return cast(None | Unset | list["NewSeverityDataAttributesSlackAliasesType0Item"], data) slack_aliases = _parse_slack_aliases(d.pop("slack_aliases", UNSET)) diff --git a/rootly_sdk/models/new_shift_coverage_request_data_attributes.py b/rootly_sdk/models/new_shift_coverage_request_data_attributes.py index b5efc7fd..ecaedf6f 100644 --- a/rootly_sdk/models/new_shift_coverage_request_data_attributes.py +++ b/rootly_sdk/models/new_shift_coverage_request_data_attributes.py @@ -1,6 +1,6 @@ import datetime from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from dateutil.parser import isoparse @@ -22,7 +22,7 @@ class NewShiftCoverageRequestDataAttributes: starts_at: datetime.datetime ends_at: datetime.datetime - user_id: Union[Unset, int] = UNSET + user_id: Unset | int = UNSET def to_dict(self) -> dict[str, Any]: starts_at = self.starts_at.isoformat() diff --git a/rootly_sdk/models/new_sla_data_attributes.py b/rootly_sdk/models/new_sla_data_attributes.py index abf46f1c..75e8ca2d 100644 --- a/rootly_sdk/models/new_sla_data_attributes.py +++ b/rootly_sdk/models/new_sla_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from uuid import UUID from attrs import define as _attrs_define @@ -76,18 +76,18 @@ class NewSlaDataAttributes: assignment_deadline_parent_status: NewSlaDataAttributesAssignmentDeadlineParentStatus completion_deadline_days: NewSlaDataAttributesCompletionDeadlineDays completion_deadline_parent_status: NewSlaDataAttributesCompletionDeadlineParentStatus - slug: Union[None, Unset, str] = UNSET - description: Union[None, Unset, str] = UNSET - position: Union[None, Unset, int] = UNSET - condition_match_type: Union[Unset, NewSlaDataAttributesConditionMatchType] = UNSET - manager_role_id: Union[None, UUID, Unset] = UNSET - manager_user_id: Union[None, Unset, int] = UNSET - assignment_deadline_sub_status_id: Union[None, UUID, Unset] = UNSET - assignment_skip_weekends: Union[Unset, bool] = UNSET - completion_deadline_sub_status_id: Union[None, UUID, Unset] = UNSET - completion_skip_weekends: Union[Unset, bool] = UNSET - conditions: Union[Unset, list["NewSlaDataAttributesConditionsItem"]] = UNSET - notification_configurations: Union[Unset, list["NewSlaDataAttributesNotificationConfigurationsItem"]] = UNSET + slug: None | Unset | str = UNSET + description: None | Unset | str = UNSET + position: None | Unset | int = UNSET + condition_match_type: Unset | NewSlaDataAttributesConditionMatchType = UNSET + manager_role_id: None | UUID | Unset = UNSET + manager_user_id: None | Unset | int = UNSET + assignment_deadline_sub_status_id: None | UUID | Unset = UNSET + assignment_skip_weekends: Unset | bool = UNSET + completion_deadline_sub_status_id: None | UUID | Unset = UNSET + completion_skip_weekends: Unset | bool = UNSET + conditions: Unset | list["NewSlaDataAttributesConditionsItem"] = UNSET + notification_configurations: Unset | list["NewSlaDataAttributesNotificationConfigurationsItem"] = UNSET def to_dict(self) -> dict[str, Any]: name = self.name @@ -100,29 +100,29 @@ def to_dict(self) -> dict[str, Any]: completion_deadline_parent_status: str = self.completion_deadline_parent_status - slug: Union[None, Unset, str] + slug: None | Unset | str if isinstance(self.slug, Unset): slug = UNSET else: slug = self.slug - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - position: Union[None, Unset, int] + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: position = self.position - condition_match_type: Union[Unset, str] = UNSET + condition_match_type: Unset | str = UNSET if not isinstance(self.condition_match_type, Unset): condition_match_type = self.condition_match_type - manager_role_id: Union[None, Unset, str] + manager_role_id: None | Unset | str if isinstance(self.manager_role_id, Unset): manager_role_id = UNSET elif isinstance(self.manager_role_id, UUID): @@ -130,13 +130,13 @@ def to_dict(self) -> dict[str, Any]: else: manager_role_id = self.manager_role_id - manager_user_id: Union[None, Unset, int] + manager_user_id: None | Unset | int if isinstance(self.manager_user_id, Unset): manager_user_id = UNSET else: manager_user_id = self.manager_user_id - assignment_deadline_sub_status_id: Union[None, Unset, str] + assignment_deadline_sub_status_id: None | Unset | str if isinstance(self.assignment_deadline_sub_status_id, Unset): assignment_deadline_sub_status_id = UNSET elif isinstance(self.assignment_deadline_sub_status_id, UUID): @@ -146,7 +146,7 @@ def to_dict(self) -> dict[str, Any]: assignment_skip_weekends = self.assignment_skip_weekends - completion_deadline_sub_status_id: Union[None, Unset, str] + completion_deadline_sub_status_id: None | Unset | str if isinstance(self.completion_deadline_sub_status_id, Unset): completion_deadline_sub_status_id = UNSET elif isinstance(self.completion_deadline_sub_status_id, UUID): @@ -156,14 +156,14 @@ def to_dict(self) -> dict[str, Any]: completion_skip_weekends = self.completion_skip_weekends - conditions: Union[Unset, list[dict[str, Any]]] = UNSET + conditions: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.conditions, Unset): conditions = [] for conditions_item_data in self.conditions: conditions_item = conditions_item_data.to_dict() conditions.append(conditions_item) - notification_configurations: Union[Unset, list[dict[str, Any]]] = UNSET + notification_configurations: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.notification_configurations, Unset): notification_configurations = [] for notification_configurations_item_data in self.notification_configurations: @@ -234,41 +234,41 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d.pop("completion_deadline_parent_status") ) - def _parse_slug(data: object) -> Union[None, Unset, str]: + def _parse_slug(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) slug = _parse_slug(d.pop("slug", UNSET)) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_position(data: object) -> Union[None, Unset, int]: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) _condition_match_type = d.pop("condition_match_type", UNSET) - condition_match_type: Union[Unset, NewSlaDataAttributesConditionMatchType] + condition_match_type: Unset | NewSlaDataAttributesConditionMatchType if isinstance(_condition_match_type, Unset): condition_match_type = UNSET else: condition_match_type = check_new_sla_data_attributes_condition_match_type(_condition_match_type) - def _parse_manager_role_id(data: object) -> Union[None, UUID, Unset]: + def _parse_manager_role_id(data: object) -> None | UUID | Unset: if data is None: return data if isinstance(data, Unset): @@ -281,20 +281,20 @@ def _parse_manager_role_id(data: object) -> Union[None, UUID, Unset]: return manager_role_id_type_0 except: # noqa: E722 pass - return cast(Union[None, UUID, Unset], data) + return cast(None | UUID | Unset, data) manager_role_id = _parse_manager_role_id(d.pop("manager_role_id", UNSET)) - def _parse_manager_user_id(data: object) -> Union[None, Unset, int]: + def _parse_manager_user_id(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) manager_user_id = _parse_manager_user_id(d.pop("manager_user_id", UNSET)) - def _parse_assignment_deadline_sub_status_id(data: object) -> Union[None, UUID, Unset]: + def _parse_assignment_deadline_sub_status_id(data: object) -> None | UUID | Unset: if data is None: return data if isinstance(data, Unset): @@ -307,7 +307,7 @@ def _parse_assignment_deadline_sub_status_id(data: object) -> Union[None, UUID, return assignment_deadline_sub_status_id_type_0 except: # noqa: E722 pass - return cast(Union[None, UUID, Unset], data) + return cast(None | UUID | Unset, data) assignment_deadline_sub_status_id = _parse_assignment_deadline_sub_status_id( d.pop("assignment_deadline_sub_status_id", UNSET) @@ -315,7 +315,7 @@ def _parse_assignment_deadline_sub_status_id(data: object) -> Union[None, UUID, assignment_skip_weekends = d.pop("assignment_skip_weekends", UNSET) - def _parse_completion_deadline_sub_status_id(data: object) -> Union[None, UUID, Unset]: + def _parse_completion_deadline_sub_status_id(data: object) -> None | UUID | Unset: if data is None: return data if isinstance(data, Unset): @@ -328,7 +328,7 @@ def _parse_completion_deadline_sub_status_id(data: object) -> Union[None, UUID, return completion_deadline_sub_status_id_type_0 except: # noqa: E722 pass - return cast(Union[None, UUID, Unset], data) + return cast(None | UUID | Unset, data) completion_deadline_sub_status_id = _parse_completion_deadline_sub_status_id( d.pop("completion_deadline_sub_status_id", UNSET) diff --git a/rootly_sdk/models/new_sla_data_attributes_conditions_item.py b/rootly_sdk/models/new_sla_data_attributes_conditions_item.py index 624d1bef..25e9f894 100644 --- a/rootly_sdk/models/new_sla_data_attributes_conditions_item.py +++ b/rootly_sdk/models/new_sla_data_attributes_conditions_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from uuid import UUID from attrs import define as _attrs_define @@ -35,10 +35,10 @@ class NewSlaDataAttributesConditionsItem: conditionable_type: NewSlaDataAttributesConditionsItemConditionableType operator: str - property_: Union[Unset, NewSlaDataAttributesConditionsItemProperty] = UNSET - values: Union[None, Unset, list[str]] = UNSET - form_field_id: Union[None, UUID, Unset] = UNSET - position: Union[Unset, int] = UNSET + property_: Unset | NewSlaDataAttributesConditionsItemProperty = UNSET + values: None | Unset | list[str] = UNSET + form_field_id: None | UUID | Unset = UNSET + position: Unset | int = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -46,11 +46,11 @@ def to_dict(self) -> dict[str, Any]: operator = self.operator - property_: Union[Unset, str] = UNSET + property_: Unset | str = UNSET if not isinstance(self.property_, Unset): property_ = self.property_ - values: Union[None, Unset, list[str]] + values: None | Unset | list[str] if isinstance(self.values, Unset): values = UNSET elif isinstance(self.values, list): @@ -59,7 +59,7 @@ def to_dict(self) -> dict[str, Any]: else: values = self.values - form_field_id: Union[None, Unset, str] + form_field_id: None | Unset | str if isinstance(self.form_field_id, Unset): form_field_id = UNSET elif isinstance(self.form_field_id, UUID): @@ -98,13 +98,13 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: operator = d.pop("operator") _property_ = d.pop("property", UNSET) - property_: Union[Unset, NewSlaDataAttributesConditionsItemProperty] + property_: Unset | NewSlaDataAttributesConditionsItemProperty if isinstance(_property_, Unset): property_ = UNSET else: property_ = check_new_sla_data_attributes_conditions_item_property(_property_) - def _parse_values(data: object) -> Union[None, Unset, list[str]]: + def _parse_values(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -117,11 +117,11 @@ def _parse_values(data: object) -> Union[None, Unset, list[str]]: return values_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) values = _parse_values(d.pop("values", UNSET)) - def _parse_form_field_id(data: object) -> Union[None, UUID, Unset]: + def _parse_form_field_id(data: object) -> None | UUID | Unset: if data is None: return data if isinstance(data, Unset): @@ -134,7 +134,7 @@ def _parse_form_field_id(data: object) -> Union[None, UUID, Unset]: return form_field_id_type_0 except: # noqa: E722 pass - return cast(Union[None, UUID, Unset], data) + return cast(None | UUID | Unset, data) form_field_id = _parse_form_field_id(d.pop("form_field_id", UNSET)) diff --git a/rootly_sdk/models/new_status_page_announcement_data_attributes.py b/rootly_sdk/models/new_status_page_announcement_data_attributes.py index e96d8db6..424a5690 100644 --- a/rootly_sdk/models/new_status_page_announcement_data_attributes.py +++ b/rootly_sdk/models/new_status_page_announcement_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define @@ -20,7 +20,7 @@ class NewStatusPageAnnouncementDataAttributes: title: str body: str - notify_subscribers: Union[Unset, bool] = UNSET + notify_subscribers: Unset | bool = UNSET def to_dict(self) -> dict[str, Any]: title = self.title diff --git a/rootly_sdk/models/new_status_page_component_data_attributes.py b/rootly_sdk/models/new_status_page_component_data_attributes.py index 83afe3cd..858cf79b 100644 --- a/rootly_sdk/models/new_status_page_component_data_attributes.py +++ b/rootly_sdk/models/new_status_page_component_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -27,27 +27,27 @@ class NewStatusPageComponentDataAttributes: source_id (Union[None, Unset, str]): ID of the catalog source backing the component """ - name: Union[None, Unset, str] = UNSET - description: Union[None, Unset, str] = UNSET - status_page_component_group_id: Union[None, Unset, str] = UNSET - position: Union[Unset, int] = UNSET - source_type: Union[Unset, NewStatusPageComponentDataAttributesSourceType] = UNSET - source_id: Union[None, Unset, str] = UNSET + name: None | Unset | str = UNSET + description: None | Unset | str = UNSET + status_page_component_group_id: None | Unset | str = UNSET + position: Unset | int = UNSET + source_type: Unset | NewStatusPageComponentDataAttributesSourceType = UNSET + source_id: None | Unset | str = UNSET def to_dict(self) -> dict[str, Any]: - name: Union[None, Unset, str] + name: None | Unset | str if isinstance(self.name, Unset): name = UNSET else: name = self.name - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - status_page_component_group_id: Union[None, Unset, str] + status_page_component_group_id: None | Unset | str if isinstance(self.status_page_component_group_id, Unset): status_page_component_group_id = UNSET else: @@ -55,11 +55,11 @@ def to_dict(self) -> dict[str, Any]: position = self.position - source_type: Union[Unset, str] = UNSET + source_type: Unset | str = UNSET if not isinstance(self.source_type, Unset): source_type = self.source_type - source_id: Union[None, Unset, str] + source_id: None | Unset | str if isinstance(self.source_id, Unset): source_id = UNSET else: @@ -87,30 +87,30 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_name(data: object) -> Union[None, Unset, str]: + def _parse_name(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) name = _parse_name(d.pop("name", UNSET)) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_status_page_component_group_id(data: object) -> Union[None, Unset, str]: + def _parse_status_page_component_group_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) status_page_component_group_id = _parse_status_page_component_group_id( d.pop("status_page_component_group_id", UNSET) @@ -119,18 +119,18 @@ def _parse_status_page_component_group_id(data: object) -> Union[None, Unset, st position = d.pop("position", UNSET) _source_type = d.pop("source_type", UNSET) - source_type: Union[Unset, NewStatusPageComponentDataAttributesSourceType] + source_type: Unset | NewStatusPageComponentDataAttributesSourceType if isinstance(_source_type, Unset): source_type = UNSET else: source_type = check_new_status_page_component_data_attributes_source_type(_source_type) - def _parse_source_id(data: object) -> Union[None, Unset, str]: + def _parse_source_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) source_id = _parse_source_id(d.pop("source_id", UNSET)) diff --git a/rootly_sdk/models/new_status_page_component_group_data_attributes.py b/rootly_sdk/models/new_status_page_component_group_data_attributes.py index 859f82f8..e5bb5855 100644 --- a/rootly_sdk/models/new_status_page_component_group_data_attributes.py +++ b/rootly_sdk/models/new_status_page_component_group_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -20,14 +20,14 @@ class NewStatusPageComponentGroupDataAttributes: """ name: str - description: Union[None, Unset, str] = UNSET - position: Union[Unset, int] = UNSET - collapsed_by_default: Union[None, Unset, bool] = UNSET + description: None | Unset | str = UNSET + position: Unset | int = UNSET + collapsed_by_default: None | Unset | bool = UNSET def to_dict(self) -> dict[str, Any]: name = self.name - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: @@ -35,7 +35,7 @@ def to_dict(self) -> dict[str, Any]: position = self.position - collapsed_by_default: Union[None, Unset, bool] + collapsed_by_default: None | Unset | bool if isinstance(self.collapsed_by_default, Unset): collapsed_by_default = UNSET else: @@ -62,23 +62,23 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name") - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) position = d.pop("position", UNSET) - def _parse_collapsed_by_default(data: object) -> Union[None, Unset, bool]: + def _parse_collapsed_by_default(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) collapsed_by_default = _parse_collapsed_by_default(d.pop("collapsed_by_default", UNSET)) diff --git a/rootly_sdk/models/new_status_page_data_attributes.py b/rootly_sdk/models/new_status_page_data_attributes.py index dc6c5f99..079589e8 100644 --- a/rootly_sdk/models/new_status_page_data_attributes.py +++ b/rootly_sdk/models/new_status_page_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -67,142 +67,142 @@ class NewStatusPageDataAttributes: """ title: str - slug: Union[None, Unset, str] = UNSET - public_title: Union[None, Unset, str] = UNSET - description: Union[None, Unset, str] = UNSET - public_description: Union[None, Unset, str] = UNSET - header_color: Union[None, Unset, str] = UNSET - footer_color: Union[None, Unset, str] = UNSET - allow_search_engine_index: Union[None, Unset, bool] = UNSET - show_uptime: Union[None, Unset, bool] = UNSET - show_uptime_last_days: Union[Unset, NewStatusPageDataAttributesShowUptimeLastDays] = UNSET - success_message: Union[None, Unset, str] = UNSET - failure_message: Union[None, Unset, str] = UNSET - authentication_method: Union[Unset, NewStatusPageDataAttributesAuthenticationMethod] = "none" - authentication_enabled: Union[None, Unset, bool] = False - authentication_password: Union[None, Unset, str] = UNSET - saml_idp_sso_service_url: Union[None, Unset, str] = UNSET - saml_idp_slo_service_url: Union[None, Unset, str] = UNSET - saml_idp_cert: Union[None, Unset, str] = UNSET - saml_name_identifier_format: Union[Unset, NewStatusPageDataAttributesSamlNameIdentifierFormat] = UNSET - section_order: Union[None, Unset, list[NewStatusPageDataAttributesSectionOrderType0Item]] = UNSET - external_domain_names: Union[None, Unset, list[str]] = UNSET - website_url: Union[None, Unset, str] = UNSET - website_privacy_url: Union[None, Unset, str] = UNSET - website_support_url: Union[None, Unset, str] = UNSET - ga_tracking_id: Union[None, Unset, str] = UNSET - time_zone: Union[None, Unset, str] = "Etc/UTC" - public: Union[None, Unset, bool] = UNSET - service_ids: Union[Unset, list[str]] = UNSET - functionality_ids: Union[Unset, list[str]] = UNSET - enabled: Union[None, Unset, bool] = UNSET + slug: None | Unset | str = UNSET + public_title: None | Unset | str = UNSET + description: None | Unset | str = UNSET + public_description: None | Unset | str = UNSET + header_color: None | Unset | str = UNSET + footer_color: None | Unset | str = UNSET + allow_search_engine_index: None | Unset | bool = UNSET + show_uptime: None | Unset | bool = UNSET + show_uptime_last_days: Unset | NewStatusPageDataAttributesShowUptimeLastDays = UNSET + success_message: None | Unset | str = UNSET + failure_message: None | Unset | str = UNSET + authentication_method: Unset | NewStatusPageDataAttributesAuthenticationMethod = "none" + authentication_enabled: None | Unset | bool = False + authentication_password: None | Unset | str = UNSET + saml_idp_sso_service_url: None | Unset | str = UNSET + saml_idp_slo_service_url: None | Unset | str = UNSET + saml_idp_cert: None | Unset | str = UNSET + saml_name_identifier_format: Unset | NewStatusPageDataAttributesSamlNameIdentifierFormat = UNSET + section_order: None | Unset | list[NewStatusPageDataAttributesSectionOrderType0Item] = UNSET + external_domain_names: None | Unset | list[str] = UNSET + website_url: None | Unset | str = UNSET + website_privacy_url: None | Unset | str = UNSET + website_support_url: None | Unset | str = UNSET + ga_tracking_id: None | Unset | str = UNSET + time_zone: None | Unset | str = "Etc/UTC" + public: None | Unset | bool = UNSET + service_ids: Unset | list[str] = UNSET + functionality_ids: Unset | list[str] = UNSET + enabled: None | Unset | bool = UNSET def to_dict(self) -> dict[str, Any]: title = self.title - slug: Union[None, Unset, str] + slug: None | Unset | str if isinstance(self.slug, Unset): slug = UNSET else: slug = self.slug - public_title: Union[None, Unset, str] + public_title: None | Unset | str if isinstance(self.public_title, Unset): public_title = UNSET else: public_title = self.public_title - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - public_description: Union[None, Unset, str] + public_description: None | Unset | str if isinstance(self.public_description, Unset): public_description = UNSET else: public_description = self.public_description - header_color: Union[None, Unset, str] + header_color: None | Unset | str if isinstance(self.header_color, Unset): header_color = UNSET else: header_color = self.header_color - footer_color: Union[None, Unset, str] + footer_color: None | Unset | str if isinstance(self.footer_color, Unset): footer_color = UNSET else: footer_color = self.footer_color - allow_search_engine_index: Union[None, Unset, bool] + allow_search_engine_index: None | Unset | bool if isinstance(self.allow_search_engine_index, Unset): allow_search_engine_index = UNSET else: allow_search_engine_index = self.allow_search_engine_index - show_uptime: Union[None, Unset, bool] + show_uptime: None | Unset | bool if isinstance(self.show_uptime, Unset): show_uptime = UNSET else: show_uptime = self.show_uptime - show_uptime_last_days: Union[Unset, int] = UNSET + show_uptime_last_days: Unset | int = UNSET if not isinstance(self.show_uptime_last_days, Unset): show_uptime_last_days = self.show_uptime_last_days - success_message: Union[None, Unset, str] + success_message: None | Unset | str if isinstance(self.success_message, Unset): success_message = UNSET else: success_message = self.success_message - failure_message: Union[None, Unset, str] + failure_message: None | Unset | str if isinstance(self.failure_message, Unset): failure_message = UNSET else: failure_message = self.failure_message - authentication_method: Union[Unset, str] = UNSET + authentication_method: Unset | str = UNSET if not isinstance(self.authentication_method, Unset): authentication_method = self.authentication_method - authentication_enabled: Union[None, Unset, bool] + authentication_enabled: None | Unset | bool if isinstance(self.authentication_enabled, Unset): authentication_enabled = UNSET else: authentication_enabled = self.authentication_enabled - authentication_password: Union[None, Unset, str] + authentication_password: None | Unset | str if isinstance(self.authentication_password, Unset): authentication_password = UNSET else: authentication_password = self.authentication_password - saml_idp_sso_service_url: Union[None, Unset, str] + saml_idp_sso_service_url: None | Unset | str if isinstance(self.saml_idp_sso_service_url, Unset): saml_idp_sso_service_url = UNSET else: saml_idp_sso_service_url = self.saml_idp_sso_service_url - saml_idp_slo_service_url: Union[None, Unset, str] + saml_idp_slo_service_url: None | Unset | str if isinstance(self.saml_idp_slo_service_url, Unset): saml_idp_slo_service_url = UNSET else: saml_idp_slo_service_url = self.saml_idp_slo_service_url - saml_idp_cert: Union[None, Unset, str] + saml_idp_cert: None | Unset | str if isinstance(self.saml_idp_cert, Unset): saml_idp_cert = UNSET else: saml_idp_cert = self.saml_idp_cert - saml_name_identifier_format: Union[Unset, str] = UNSET + saml_name_identifier_format: Unset | str = UNSET if not isinstance(self.saml_name_identifier_format, Unset): saml_name_identifier_format = self.saml_name_identifier_format - section_order: Union[None, Unset, list[str]] + section_order: None | Unset | list[str] if isinstance(self.section_order, Unset): section_order = UNSET elif isinstance(self.section_order, list): @@ -214,7 +214,7 @@ def to_dict(self) -> dict[str, Any]: else: section_order = self.section_order - external_domain_names: Union[None, Unset, list[str]] + external_domain_names: None | Unset | list[str] if isinstance(self.external_domain_names, Unset): external_domain_names = UNSET elif isinstance(self.external_domain_names, list): @@ -223,51 +223,51 @@ def to_dict(self) -> dict[str, Any]: else: external_domain_names = self.external_domain_names - website_url: Union[None, Unset, str] + website_url: None | Unset | str if isinstance(self.website_url, Unset): website_url = UNSET else: website_url = self.website_url - website_privacy_url: Union[None, Unset, str] + website_privacy_url: None | Unset | str if isinstance(self.website_privacy_url, Unset): website_privacy_url = UNSET else: website_privacy_url = self.website_privacy_url - website_support_url: Union[None, Unset, str] + website_support_url: None | Unset | str if isinstance(self.website_support_url, Unset): website_support_url = UNSET else: website_support_url = self.website_support_url - ga_tracking_id: Union[None, Unset, str] + ga_tracking_id: None | Unset | str if isinstance(self.ga_tracking_id, Unset): ga_tracking_id = UNSET else: ga_tracking_id = self.ga_tracking_id - time_zone: Union[None, Unset, str] + time_zone: None | Unset | str if isinstance(self.time_zone, Unset): time_zone = UNSET else: time_zone = self.time_zone - public: Union[None, Unset, bool] + public: None | Unset | bool if isinstance(self.public, Unset): public = UNSET else: public = self.public - service_ids: Union[Unset, list[str]] = UNSET + service_ids: Unset | list[str] = UNSET if not isinstance(self.service_ids, Unset): service_ids = self.service_ids - functionality_ids: Union[Unset, list[str]] = UNSET + functionality_ids: Unset | list[str] = UNSET if not isinstance(self.functionality_ids, Unset): functionality_ids = self.functionality_ids - enabled: Union[None, Unset, bool] + enabled: None | Unset | bool if isinstance(self.enabled, Unset): enabled = UNSET else: @@ -346,157 +346,157 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) title = d.pop("title") - def _parse_slug(data: object) -> Union[None, Unset, str]: + def _parse_slug(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) slug = _parse_slug(d.pop("slug", UNSET)) - def _parse_public_title(data: object) -> Union[None, Unset, str]: + def _parse_public_title(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) public_title = _parse_public_title(d.pop("public_title", UNSET)) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_public_description(data: object) -> Union[None, Unset, str]: + def _parse_public_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) public_description = _parse_public_description(d.pop("public_description", UNSET)) - def _parse_header_color(data: object) -> Union[None, Unset, str]: + def _parse_header_color(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) header_color = _parse_header_color(d.pop("header_color", UNSET)) - def _parse_footer_color(data: object) -> Union[None, Unset, str]: + def _parse_footer_color(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) footer_color = _parse_footer_color(d.pop("footer_color", UNSET)) - def _parse_allow_search_engine_index(data: object) -> Union[None, Unset, bool]: + def _parse_allow_search_engine_index(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) allow_search_engine_index = _parse_allow_search_engine_index(d.pop("allow_search_engine_index", UNSET)) - def _parse_show_uptime(data: object) -> Union[None, Unset, bool]: + def _parse_show_uptime(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) show_uptime = _parse_show_uptime(d.pop("show_uptime", UNSET)) _show_uptime_last_days = d.pop("show_uptime_last_days", UNSET) - show_uptime_last_days: Union[Unset, NewStatusPageDataAttributesShowUptimeLastDays] + show_uptime_last_days: Unset | NewStatusPageDataAttributesShowUptimeLastDays if isinstance(_show_uptime_last_days, Unset): show_uptime_last_days = UNSET else: show_uptime_last_days = check_new_status_page_data_attributes_show_uptime_last_days(_show_uptime_last_days) - def _parse_success_message(data: object) -> Union[None, Unset, str]: + def _parse_success_message(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) success_message = _parse_success_message(d.pop("success_message", UNSET)) - def _parse_failure_message(data: object) -> Union[None, Unset, str]: + def _parse_failure_message(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) failure_message = _parse_failure_message(d.pop("failure_message", UNSET)) _authentication_method = d.pop("authentication_method", UNSET) - authentication_method: Union[Unset, NewStatusPageDataAttributesAuthenticationMethod] + authentication_method: Unset | NewStatusPageDataAttributesAuthenticationMethod if isinstance(_authentication_method, Unset): authentication_method = UNSET else: authentication_method = check_new_status_page_data_attributes_authentication_method(_authentication_method) - def _parse_authentication_enabled(data: object) -> Union[None, Unset, bool]: + def _parse_authentication_enabled(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) authentication_enabled = _parse_authentication_enabled(d.pop("authentication_enabled", UNSET)) - def _parse_authentication_password(data: object) -> Union[None, Unset, str]: + def _parse_authentication_password(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) authentication_password = _parse_authentication_password(d.pop("authentication_password", UNSET)) - def _parse_saml_idp_sso_service_url(data: object) -> Union[None, Unset, str]: + def _parse_saml_idp_sso_service_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) saml_idp_sso_service_url = _parse_saml_idp_sso_service_url(d.pop("saml_idp_sso_service_url", UNSET)) - def _parse_saml_idp_slo_service_url(data: object) -> Union[None, Unset, str]: + def _parse_saml_idp_slo_service_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) saml_idp_slo_service_url = _parse_saml_idp_slo_service_url(d.pop("saml_idp_slo_service_url", UNSET)) - def _parse_saml_idp_cert(data: object) -> Union[None, Unset, str]: + def _parse_saml_idp_cert(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) saml_idp_cert = _parse_saml_idp_cert(d.pop("saml_idp_cert", UNSET)) _saml_name_identifier_format = d.pop("saml_name_identifier_format", UNSET) - saml_name_identifier_format: Union[Unset, NewStatusPageDataAttributesSamlNameIdentifierFormat] + saml_name_identifier_format: Unset | NewStatusPageDataAttributesSamlNameIdentifierFormat if isinstance(_saml_name_identifier_format, Unset): saml_name_identifier_format = UNSET else: @@ -506,7 +506,7 @@ def _parse_saml_idp_cert(data: object) -> Union[None, Unset, str]: def _parse_section_order( data: object, - ) -> Union[None, Unset, list[NewStatusPageDataAttributesSectionOrderType0Item]]: + ) -> None | Unset | list[NewStatusPageDataAttributesSectionOrderType0Item]: if data is None: return data if isinstance(data, Unset): @@ -526,11 +526,11 @@ def _parse_section_order( return section_order_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[NewStatusPageDataAttributesSectionOrderType0Item]], data) + return cast(None | Unset | list[NewStatusPageDataAttributesSectionOrderType0Item], data) section_order = _parse_section_order(d.pop("section_order", UNSET)) - def _parse_external_domain_names(data: object) -> Union[None, Unset, list[str]]: + def _parse_external_domain_names(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -543,61 +543,61 @@ def _parse_external_domain_names(data: object) -> Union[None, Unset, list[str]]: return external_domain_names_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) external_domain_names = _parse_external_domain_names(d.pop("external_domain_names", UNSET)) - def _parse_website_url(data: object) -> Union[None, Unset, str]: + def _parse_website_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) website_url = _parse_website_url(d.pop("website_url", UNSET)) - def _parse_website_privacy_url(data: object) -> Union[None, Unset, str]: + def _parse_website_privacy_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) website_privacy_url = _parse_website_privacy_url(d.pop("website_privacy_url", UNSET)) - def _parse_website_support_url(data: object) -> Union[None, Unset, str]: + def _parse_website_support_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) website_support_url = _parse_website_support_url(d.pop("website_support_url", UNSET)) - def _parse_ga_tracking_id(data: object) -> Union[None, Unset, str]: + def _parse_ga_tracking_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) ga_tracking_id = _parse_ga_tracking_id(d.pop("ga_tracking_id", UNSET)) - def _parse_time_zone(data: object) -> Union[None, Unset, str]: + def _parse_time_zone(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) time_zone = _parse_time_zone(d.pop("time_zone", UNSET)) - def _parse_public(data: object) -> Union[None, Unset, bool]: + def _parse_public(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) public = _parse_public(d.pop("public", UNSET)) @@ -605,12 +605,12 @@ def _parse_public(data: object) -> Union[None, Unset, bool]: functionality_ids = cast(list[str], d.pop("functionality_ids", UNSET)) - def _parse_enabled(data: object) -> Union[None, Unset, bool]: + def _parse_enabled(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) enabled = _parse_enabled(d.pop("enabled", UNSET)) diff --git a/rootly_sdk/models/new_status_page_template_data_attributes.py b/rootly_sdk/models/new_status_page_template_data_attributes.py index dbe7cd40..b1927d4e 100644 --- a/rootly_sdk/models/new_status_page_template_data_attributes.py +++ b/rootly_sdk/models/new_status_page_template_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -34,13 +34,13 @@ class NewStatusPageTemplateDataAttributes: title: str body: str - status_page_id: Union[Unset, str] = UNSET - update_title: Union[None, Unset, str] = UNSET - update_status: Union[Unset, NewStatusPageTemplateDataAttributesUpdateStatus] = UNSET - kind: Union[Unset, NewStatusPageTemplateDataAttributesKind] = UNSET - should_notify_subscribers: Union[None, Unset, bool] = UNSET - position: Union[Unset, int] = UNSET - enabled: Union[None, Unset, bool] = UNSET + status_page_id: Unset | str = UNSET + update_title: None | Unset | str = UNSET + update_status: Unset | NewStatusPageTemplateDataAttributesUpdateStatus = UNSET + kind: Unset | NewStatusPageTemplateDataAttributesKind = UNSET + should_notify_subscribers: None | Unset | bool = UNSET + position: Unset | int = UNSET + enabled: None | Unset | bool = UNSET def to_dict(self) -> dict[str, Any]: title = self.title @@ -49,21 +49,21 @@ def to_dict(self) -> dict[str, Any]: status_page_id = self.status_page_id - update_title: Union[None, Unset, str] + update_title: None | Unset | str if isinstance(self.update_title, Unset): update_title = UNSET else: update_title = self.update_title - update_status: Union[Unset, str] = UNSET + update_status: Unset | str = UNSET if not isinstance(self.update_status, Unset): update_status = self.update_status - kind: Union[Unset, str] = UNSET + kind: Unset | str = UNSET if not isinstance(self.kind, Unset): kind = self.kind - should_notify_subscribers: Union[None, Unset, bool] + should_notify_subscribers: None | Unset | bool if isinstance(self.should_notify_subscribers, Unset): should_notify_subscribers = UNSET else: @@ -71,7 +71,7 @@ def to_dict(self) -> dict[str, Any]: position = self.position - enabled: Union[None, Unset, bool] + enabled: None | Unset | bool if isinstance(self.enabled, Unset): enabled = UNSET else: @@ -111,46 +111,46 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: status_page_id = d.pop("status_page_id", UNSET) - def _parse_update_title(data: object) -> Union[None, Unset, str]: + def _parse_update_title(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) update_title = _parse_update_title(d.pop("update_title", UNSET)) _update_status = d.pop("update_status", UNSET) - update_status: Union[Unset, NewStatusPageTemplateDataAttributesUpdateStatus] + update_status: Unset | NewStatusPageTemplateDataAttributesUpdateStatus if isinstance(_update_status, Unset): update_status = UNSET else: update_status = check_new_status_page_template_data_attributes_update_status(_update_status) _kind = d.pop("kind", UNSET) - kind: Union[Unset, NewStatusPageTemplateDataAttributesKind] + kind: Unset | NewStatusPageTemplateDataAttributesKind if isinstance(_kind, Unset): kind = UNSET else: kind = check_new_status_page_template_data_attributes_kind(_kind) - def _parse_should_notify_subscribers(data: object) -> Union[None, Unset, bool]: + def _parse_should_notify_subscribers(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) should_notify_subscribers = _parse_should_notify_subscribers(d.pop("should_notify_subscribers", UNSET)) position = d.pop("position", UNSET) - def _parse_enabled(data: object) -> Union[None, Unset, bool]: + def _parse_enabled(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) enabled = _parse_enabled(d.pop("enabled", UNSET)) diff --git a/rootly_sdk/models/new_sub_status_data_attributes.py b/rootly_sdk/models/new_sub_status_data_attributes.py index 76682939..08b4e3bb 100644 --- a/rootly_sdk/models/new_sub_status_data_attributes.py +++ b/rootly_sdk/models/new_sub_status_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -26,28 +26,28 @@ class NewSubStatusDataAttributes: name: str parent_status: NewSubStatusDataAttributesParentStatus - slug: Union[None, Unset, str] = UNSET - description: Union[None, Unset, str] = UNSET - position: Union[None, Unset, int] = UNSET + slug: None | Unset | str = UNSET + description: None | Unset | str = UNSET + position: None | Unset | int = UNSET def to_dict(self) -> dict[str, Any]: name = self.name parent_status: str = self.parent_status - slug: Union[None, Unset, str] + slug: None | Unset | str if isinstance(self.slug, Unset): slug = UNSET else: slug = self.slug - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - position: Union[None, Unset, int] + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: @@ -77,30 +77,30 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: parent_status = check_new_sub_status_data_attributes_parent_status(d.pop("parent_status")) - def _parse_slug(data: object) -> Union[None, Unset, str]: + def _parse_slug(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) slug = _parse_slug(d.pop("slug", UNSET)) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_position(data: object) -> Union[None, Unset, int]: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) diff --git a/rootly_sdk/models/new_team_data_attributes.py b/rootly_sdk/models/new_team_data_attributes.py index d177dd58..19f2852b 100644 --- a/rootly_sdk/models/new_team_data_attributes.py +++ b/rootly_sdk/models/new_team_data_attributes.py @@ -71,35 +71,35 @@ class NewTeamDataAttributes: """ name: str - slug: Union[None, Unset, str] = UNSET - description: Union[None, Unset, str] = UNSET - public_description: Union[None, Unset, str] = UNSET - notify_emails: Union[None, Unset, list[str]] = UNSET - color: Union[None, Unset, str] = UNSET - position: Union[None, Unset, int] = UNSET - backstage_id: Union[None, Unset, str] = UNSET - external_id: Union[None, Unset, str] = UNSET - pagerduty_id: Union[None, Unset, str] = UNSET - pagerduty_service_id: Union[None, Unset, str] = UNSET - opsgenie_id: Union[None, Unset, str] = UNSET - opsgenie_team_id: Union[None, Unset, str] = UNSET - victor_ops_id: Union[None, Unset, str] = UNSET - pagertree_id: Union[None, Unset, str] = UNSET - cortex_id: Union[None, Unset, str] = UNSET - service_now_ci_sys_id: Union[None, Unset, str] = UNSET - user_ids: Union[None, Unset, list[int]] = UNSET - admin_ids: Union[None, Unset, list[int]] = UNSET - alerts_email_enabled: Union[None, Unset, bool] = UNSET - alert_urgency_id: Union[None, Unset, str] = UNSET - slack_channels: Union[None, Unset, list["NewTeamDataAttributesSlackChannelsType0Item"]] = UNSET - slack_aliases: Union[None, Unset, list["NewTeamDataAttributesSlackAliasesType0Item"]] = UNSET - alert_broadcast_enabled: Union[None, Unset, bool] = UNSET + slug: None | Unset | str = UNSET + description: None | Unset | str = UNSET + public_description: None | Unset | str = UNSET + notify_emails: None | Unset | list[str] = UNSET + color: None | Unset | str = UNSET + position: None | Unset | int = UNSET + backstage_id: None | Unset | str = UNSET + external_id: None | Unset | str = UNSET + pagerduty_id: None | Unset | str = UNSET + pagerduty_service_id: None | Unset | str = UNSET + opsgenie_id: None | Unset | str = UNSET + opsgenie_team_id: None | Unset | str = UNSET + victor_ops_id: None | Unset | str = UNSET + pagertree_id: None | Unset | str = UNSET + cortex_id: None | Unset | str = UNSET + service_now_ci_sys_id: None | Unset | str = UNSET + user_ids: None | Unset | list[int] = UNSET + admin_ids: None | Unset | list[int] = UNSET + alerts_email_enabled: None | Unset | bool = UNSET + alert_urgency_id: None | Unset | str = UNSET + slack_channels: None | Unset | list["NewTeamDataAttributesSlackChannelsType0Item"] = UNSET + slack_aliases: None | Unset | list["NewTeamDataAttributesSlackAliasesType0Item"] = UNSET + alert_broadcast_enabled: None | Unset | bool = UNSET alert_broadcast_channel: Union["NewTeamDataAttributesAlertBroadcastChannelType0", None, Unset] = UNSET - incident_broadcast_enabled: Union[None, Unset, bool] = UNSET + incident_broadcast_enabled: None | Unset | bool = UNSET incident_broadcast_channel: Union["NewTeamDataAttributesIncidentBroadcastChannelType0", None, Unset] = UNSET - auto_add_members_when_attached: Union[None, Unset, bool] = UNSET - auto_add_members_scope: Union[Unset, NewTeamDataAttributesAutoAddMembersScope] = UNSET - properties: Union[Unset, list["NewTeamDataAttributesPropertiesItem"]] = UNSET + auto_add_members_when_attached: None | Unset | bool = UNSET + auto_add_members_scope: Unset | NewTeamDataAttributesAutoAddMembersScope = UNSET + properties: Unset | list["NewTeamDataAttributesPropertiesItem"] = UNSET def to_dict(self) -> dict[str, Any]: from ..models.new_team_data_attributes_alert_broadcast_channel_type_0 import ( @@ -111,25 +111,25 @@ def to_dict(self) -> dict[str, Any]: name = self.name - slug: Union[None, Unset, str] + slug: None | Unset | str if isinstance(self.slug, Unset): slug = UNSET else: slug = self.slug - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - public_description: Union[None, Unset, str] + public_description: None | Unset | str if isinstance(self.public_description, Unset): public_description = UNSET else: public_description = self.public_description - notify_emails: Union[None, Unset, list[str]] + notify_emails: None | Unset | list[str] if isinstance(self.notify_emails, Unset): notify_emails = UNSET elif isinstance(self.notify_emails, list): @@ -138,79 +138,79 @@ def to_dict(self) -> dict[str, Any]: else: notify_emails = self.notify_emails - color: Union[None, Unset, str] + color: None | Unset | str if isinstance(self.color, Unset): color = UNSET else: color = self.color - position: Union[None, Unset, int] + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: position = self.position - backstage_id: Union[None, Unset, str] + backstage_id: None | Unset | str if isinstance(self.backstage_id, Unset): backstage_id = UNSET else: backstage_id = self.backstage_id - external_id: Union[None, Unset, str] + external_id: None | Unset | str if isinstance(self.external_id, Unset): external_id = UNSET else: external_id = self.external_id - pagerduty_id: Union[None, Unset, str] + pagerduty_id: None | Unset | str if isinstance(self.pagerduty_id, Unset): pagerduty_id = UNSET else: pagerduty_id = self.pagerduty_id - pagerduty_service_id: Union[None, Unset, str] + pagerduty_service_id: None | Unset | str if isinstance(self.pagerduty_service_id, Unset): pagerduty_service_id = UNSET else: pagerduty_service_id = self.pagerduty_service_id - opsgenie_id: Union[None, Unset, str] + opsgenie_id: None | Unset | str if isinstance(self.opsgenie_id, Unset): opsgenie_id = UNSET else: opsgenie_id = self.opsgenie_id - opsgenie_team_id: Union[None, Unset, str] + opsgenie_team_id: None | Unset | str if isinstance(self.opsgenie_team_id, Unset): opsgenie_team_id = UNSET else: opsgenie_team_id = self.opsgenie_team_id - victor_ops_id: Union[None, Unset, str] + victor_ops_id: None | Unset | str if isinstance(self.victor_ops_id, Unset): victor_ops_id = UNSET else: victor_ops_id = self.victor_ops_id - pagertree_id: Union[None, Unset, str] + pagertree_id: None | Unset | str if isinstance(self.pagertree_id, Unset): pagertree_id = UNSET else: pagertree_id = self.pagertree_id - cortex_id: Union[None, Unset, str] + cortex_id: None | Unset | str if isinstance(self.cortex_id, Unset): cortex_id = UNSET else: cortex_id = self.cortex_id - service_now_ci_sys_id: Union[None, Unset, str] + service_now_ci_sys_id: None | Unset | str if isinstance(self.service_now_ci_sys_id, Unset): service_now_ci_sys_id = UNSET else: service_now_ci_sys_id = self.service_now_ci_sys_id - user_ids: Union[None, Unset, list[int]] + user_ids: None | Unset | list[int] if isinstance(self.user_ids, Unset): user_ids = UNSET elif isinstance(self.user_ids, list): @@ -219,7 +219,7 @@ def to_dict(self) -> dict[str, Any]: else: user_ids = self.user_ids - admin_ids: Union[None, Unset, list[int]] + admin_ids: None | Unset | list[int] if isinstance(self.admin_ids, Unset): admin_ids = UNSET elif isinstance(self.admin_ids, list): @@ -228,19 +228,19 @@ def to_dict(self) -> dict[str, Any]: else: admin_ids = self.admin_ids - alerts_email_enabled: Union[None, Unset, bool] + alerts_email_enabled: None | Unset | bool if isinstance(self.alerts_email_enabled, Unset): alerts_email_enabled = UNSET else: alerts_email_enabled = self.alerts_email_enabled - alert_urgency_id: Union[None, Unset, str] + alert_urgency_id: None | Unset | str if isinstance(self.alert_urgency_id, Unset): alert_urgency_id = UNSET else: alert_urgency_id = self.alert_urgency_id - slack_channels: Union[None, Unset, list[dict[str, Any]]] + slack_channels: None | Unset | list[dict[str, Any]] if isinstance(self.slack_channels, Unset): slack_channels = UNSET elif isinstance(self.slack_channels, list): @@ -252,7 +252,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_channels = self.slack_channels - slack_aliases: Union[None, Unset, list[dict[str, Any]]] + slack_aliases: None | Unset | list[dict[str, Any]] if isinstance(self.slack_aliases, Unset): slack_aliases = UNSET elif isinstance(self.slack_aliases, list): @@ -264,13 +264,13 @@ def to_dict(self) -> dict[str, Any]: else: slack_aliases = self.slack_aliases - alert_broadcast_enabled: Union[None, Unset, bool] + alert_broadcast_enabled: None | Unset | bool if isinstance(self.alert_broadcast_enabled, Unset): alert_broadcast_enabled = UNSET else: alert_broadcast_enabled = self.alert_broadcast_enabled - alert_broadcast_channel: Union[None, Unset, dict[str, Any]] + alert_broadcast_channel: None | Unset | dict[str, Any] if isinstance(self.alert_broadcast_channel, Unset): alert_broadcast_channel = UNSET elif isinstance(self.alert_broadcast_channel, NewTeamDataAttributesAlertBroadcastChannelType0): @@ -278,13 +278,13 @@ def to_dict(self) -> dict[str, Any]: else: alert_broadcast_channel = self.alert_broadcast_channel - incident_broadcast_enabled: Union[None, Unset, bool] + incident_broadcast_enabled: None | Unset | bool if isinstance(self.incident_broadcast_enabled, Unset): incident_broadcast_enabled = UNSET else: incident_broadcast_enabled = self.incident_broadcast_enabled - incident_broadcast_channel: Union[None, Unset, dict[str, Any]] + incident_broadcast_channel: None | Unset | dict[str, Any] if isinstance(self.incident_broadcast_channel, Unset): incident_broadcast_channel = UNSET elif isinstance(self.incident_broadcast_channel, NewTeamDataAttributesIncidentBroadcastChannelType0): @@ -292,17 +292,17 @@ def to_dict(self) -> dict[str, Any]: else: incident_broadcast_channel = self.incident_broadcast_channel - auto_add_members_when_attached: Union[None, Unset, bool] + auto_add_members_when_attached: None | Unset | bool if isinstance(self.auto_add_members_when_attached, Unset): auto_add_members_when_attached = UNSET else: auto_add_members_when_attached = self.auto_add_members_when_attached - auto_add_members_scope: Union[Unset, str] = UNSET + auto_add_members_scope: Unset | str = UNSET if not isinstance(self.auto_add_members_scope, Unset): auto_add_members_scope = self.auto_add_members_scope - properties: Union[Unset, list[dict[str, Any]]] = UNSET + properties: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.properties, Unset): properties = [] for properties_item_data in self.properties: @@ -396,34 +396,34 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name") - def _parse_slug(data: object) -> Union[None, Unset, str]: + def _parse_slug(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) slug = _parse_slug(d.pop("slug", UNSET)) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_public_description(data: object) -> Union[None, Unset, str]: + def _parse_public_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) public_description = _parse_public_description(d.pop("public_description", UNSET)) - def _parse_notify_emails(data: object) -> Union[None, Unset, list[str]]: + def _parse_notify_emails(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -436,119 +436,119 @@ def _parse_notify_emails(data: object) -> Union[None, Unset, list[str]]: return notify_emails_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) notify_emails = _parse_notify_emails(d.pop("notify_emails", UNSET)) - def _parse_color(data: object) -> Union[None, Unset, str]: + def _parse_color(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) color = _parse_color(d.pop("color", UNSET)) - def _parse_position(data: object) -> Union[None, Unset, int]: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) - def _parse_backstage_id(data: object) -> Union[None, Unset, str]: + def _parse_backstage_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) backstage_id = _parse_backstage_id(d.pop("backstage_id", UNSET)) - def _parse_external_id(data: object) -> Union[None, Unset, str]: + def _parse_external_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) external_id = _parse_external_id(d.pop("external_id", UNSET)) - def _parse_pagerduty_id(data: object) -> Union[None, Unset, str]: + def _parse_pagerduty_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) pagerduty_id = _parse_pagerduty_id(d.pop("pagerduty_id", UNSET)) - def _parse_pagerduty_service_id(data: object) -> Union[None, Unset, str]: + def _parse_pagerduty_service_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) pagerduty_service_id = _parse_pagerduty_service_id(d.pop("pagerduty_service_id", UNSET)) - def _parse_opsgenie_id(data: object) -> Union[None, Unset, str]: + def _parse_opsgenie_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) opsgenie_id = _parse_opsgenie_id(d.pop("opsgenie_id", UNSET)) - def _parse_opsgenie_team_id(data: object) -> Union[None, Unset, str]: + def _parse_opsgenie_team_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) opsgenie_team_id = _parse_opsgenie_team_id(d.pop("opsgenie_team_id", UNSET)) - def _parse_victor_ops_id(data: object) -> Union[None, Unset, str]: + def _parse_victor_ops_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) victor_ops_id = _parse_victor_ops_id(d.pop("victor_ops_id", UNSET)) - def _parse_pagertree_id(data: object) -> Union[None, Unset, str]: + def _parse_pagertree_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) pagertree_id = _parse_pagertree_id(d.pop("pagertree_id", UNSET)) - def _parse_cortex_id(data: object) -> Union[None, Unset, str]: + def _parse_cortex_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) cortex_id = _parse_cortex_id(d.pop("cortex_id", UNSET)) - def _parse_service_now_ci_sys_id(data: object) -> Union[None, Unset, str]: + def _parse_service_now_ci_sys_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) service_now_ci_sys_id = _parse_service_now_ci_sys_id(d.pop("service_now_ci_sys_id", UNSET)) - def _parse_user_ids(data: object) -> Union[None, Unset, list[int]]: + def _parse_user_ids(data: object) -> None | Unset | list[int]: if data is None: return data if isinstance(data, Unset): @@ -561,11 +561,11 @@ def _parse_user_ids(data: object) -> Union[None, Unset, list[int]]: return user_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[int]], data) + return cast(None | Unset | list[int], data) user_ids = _parse_user_ids(d.pop("user_ids", UNSET)) - def _parse_admin_ids(data: object) -> Union[None, Unset, list[int]]: + def _parse_admin_ids(data: object) -> None | Unset | list[int]: if data is None: return data if isinstance(data, Unset): @@ -578,31 +578,31 @@ def _parse_admin_ids(data: object) -> Union[None, Unset, list[int]]: return admin_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[int]], data) + return cast(None | Unset | list[int], data) admin_ids = _parse_admin_ids(d.pop("admin_ids", UNSET)) - def _parse_alerts_email_enabled(data: object) -> Union[None, Unset, bool]: + def _parse_alerts_email_enabled(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) alerts_email_enabled = _parse_alerts_email_enabled(d.pop("alerts_email_enabled", UNSET)) - def _parse_alert_urgency_id(data: object) -> Union[None, Unset, str]: + def _parse_alert_urgency_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) alert_urgency_id = _parse_alert_urgency_id(d.pop("alert_urgency_id", UNSET)) def _parse_slack_channels( data: object, - ) -> Union[None, Unset, list["NewTeamDataAttributesSlackChannelsType0Item"]]: + ) -> None | Unset | list["NewTeamDataAttributesSlackChannelsType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -622,13 +622,13 @@ def _parse_slack_channels( return slack_channels_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list["NewTeamDataAttributesSlackChannelsType0Item"]], data) + return cast(None | Unset | list["NewTeamDataAttributesSlackChannelsType0Item"], data) slack_channels = _parse_slack_channels(d.pop("slack_channels", UNSET)) def _parse_slack_aliases( data: object, - ) -> Union[None, Unset, list["NewTeamDataAttributesSlackAliasesType0Item"]]: + ) -> None | Unset | list["NewTeamDataAttributesSlackAliasesType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -648,16 +648,16 @@ def _parse_slack_aliases( return slack_aliases_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list["NewTeamDataAttributesSlackAliasesType0Item"]], data) + return cast(None | Unset | list["NewTeamDataAttributesSlackAliasesType0Item"], data) slack_aliases = _parse_slack_aliases(d.pop("slack_aliases", UNSET)) - def _parse_alert_broadcast_enabled(data: object) -> Union[None, Unset, bool]: + def _parse_alert_broadcast_enabled(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) alert_broadcast_enabled = _parse_alert_broadcast_enabled(d.pop("alert_broadcast_enabled", UNSET)) @@ -680,12 +680,12 @@ def _parse_alert_broadcast_channel( alert_broadcast_channel = _parse_alert_broadcast_channel(d.pop("alert_broadcast_channel", UNSET)) - def _parse_incident_broadcast_enabled(data: object) -> Union[None, Unset, bool]: + def _parse_incident_broadcast_enabled(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) incident_broadcast_enabled = _parse_incident_broadcast_enabled(d.pop("incident_broadcast_enabled", UNSET)) @@ -708,19 +708,19 @@ def _parse_incident_broadcast_channel( incident_broadcast_channel = _parse_incident_broadcast_channel(d.pop("incident_broadcast_channel", UNSET)) - def _parse_auto_add_members_when_attached(data: object) -> Union[None, Unset, bool]: + def _parse_auto_add_members_when_attached(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) auto_add_members_when_attached = _parse_auto_add_members_when_attached( d.pop("auto_add_members_when_attached", UNSET) ) _auto_add_members_scope = d.pop("auto_add_members_scope", UNSET) - auto_add_members_scope: Union[Unset, NewTeamDataAttributesAutoAddMembersScope] + auto_add_members_scope: Unset | NewTeamDataAttributesAutoAddMembersScope if isinstance(_auto_add_members_scope, Unset): auto_add_members_scope = UNSET else: diff --git a/rootly_sdk/models/new_team_data_attributes_alert_broadcast_channel_type_0.py b/rootly_sdk/models/new_team_data_attributes_alert_broadcast_channel_type_0.py index 131ecc3f..d896ddc6 100644 --- a/rootly_sdk/models/new_team_data_attributes_alert_broadcast_channel_type_0.py +++ b/rootly_sdk/models/new_team_data_attributes_alert_broadcast_channel_type_0.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,7 +19,7 @@ class NewTeamDataAttributesAlertBroadcastChannelType0: """ id: str - name: Union[Unset, str] = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/new_team_data_attributes_incident_broadcast_channel_type_0.py b/rootly_sdk/models/new_team_data_attributes_incident_broadcast_channel_type_0.py index f7d6275e..5ed832f1 100644 --- a/rootly_sdk/models/new_team_data_attributes_incident_broadcast_channel_type_0.py +++ b/rootly_sdk/models/new_team_data_attributes_incident_broadcast_channel_type_0.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,7 +19,7 @@ class NewTeamDataAttributesIncidentBroadcastChannelType0: """ id: str - name: Union[Unset, str] = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/new_user_notification_rule_data_attributes.py b/rootly_sdk/models/new_user_notification_rule_data_attributes.py index a885f0d2..b5846f02 100644 --- a/rootly_sdk/models/new_user_notification_rule_data_attributes.py +++ b/rootly_sdk/models/new_user_notification_rule_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -27,12 +27,12 @@ class NewUserNotificationRuleDataAttributes: """ enabled_contact_types: list[NewUserNotificationRuleDataAttributesEnabledContactTypesItem] - delay: Union[None, Unset, int] = UNSET - position: Union[None, Unset, int] = UNSET - user_email_address_id: Union[None, Unset, str] = UNSET - user_call_number_id: Union[None, Unset, str] = UNSET - user_sms_number_id: Union[None, Unset, str] = UNSET - user_device_id: Union[None, Unset, str] = UNSET + delay: None | Unset | int = UNSET + position: None | Unset | int = UNSET + user_email_address_id: None | Unset | str = UNSET + user_call_number_id: None | Unset | str = UNSET + user_sms_number_id: None | Unset | str = UNSET + user_device_id: None | Unset | str = UNSET def to_dict(self) -> dict[str, Any]: enabled_contact_types = [] @@ -40,37 +40,37 @@ def to_dict(self) -> dict[str, Any]: enabled_contact_types_item: str = enabled_contact_types_item_data enabled_contact_types.append(enabled_contact_types_item) - delay: Union[None, Unset, int] + delay: None | Unset | int if isinstance(self.delay, Unset): delay = UNSET else: delay = self.delay - position: Union[None, Unset, int] + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: position = self.position - user_email_address_id: Union[None, Unset, str] + user_email_address_id: None | Unset | str if isinstance(self.user_email_address_id, Unset): user_email_address_id = UNSET else: user_email_address_id = self.user_email_address_id - user_call_number_id: Union[None, Unset, str] + user_call_number_id: None | Unset | str if isinstance(self.user_call_number_id, Unset): user_call_number_id = UNSET else: user_call_number_id = self.user_call_number_id - user_sms_number_id: Union[None, Unset, str] + user_sms_number_id: None | Unset | str if isinstance(self.user_sms_number_id, Unset): user_sms_number_id = UNSET else: user_sms_number_id = self.user_sms_number_id - user_device_id: Union[None, Unset, str] + user_device_id: None | Unset | str if isinstance(self.user_device_id, Unset): user_device_id = UNSET else: @@ -110,57 +110,57 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: enabled_contact_types.append(enabled_contact_types_item) - def _parse_delay(data: object) -> Union[None, Unset, int]: + def _parse_delay(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) delay = _parse_delay(d.pop("delay", UNSET)) - def _parse_position(data: object) -> Union[None, Unset, int]: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) - def _parse_user_email_address_id(data: object) -> Union[None, Unset, str]: + def _parse_user_email_address_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) user_email_address_id = _parse_user_email_address_id(d.pop("user_email_address_id", UNSET)) - def _parse_user_call_number_id(data: object) -> Union[None, Unset, str]: + def _parse_user_call_number_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) user_call_number_id = _parse_user_call_number_id(d.pop("user_call_number_id", UNSET)) - def _parse_user_sms_number_id(data: object) -> Union[None, Unset, str]: + def _parse_user_sms_number_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) user_sms_number_id = _parse_user_sms_number_id(d.pop("user_sms_number_id", UNSET)) - def _parse_user_device_id(data: object) -> Union[None, Unset, str]: + def _parse_user_device_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) user_device_id = _parse_user_device_id(d.pop("user_device_id", UNSET)) diff --git a/rootly_sdk/models/new_webhooks_endpoint_data_attributes.py b/rootly_sdk/models/new_webhooks_endpoint_data_attributes.py index f24cac89..f67b14a6 100644 --- a/rootly_sdk/models/new_webhooks_endpoint_data_attributes.py +++ b/rootly_sdk/models/new_webhooks_endpoint_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define @@ -35,18 +35,18 @@ class NewWebhooksEndpointDataAttributes: name: str url: str - slug: Union[None, Unset, str] = UNSET - secret: Union[Unset, str] = UNSET - event_types: Union[Unset, list[NewWebhooksEndpointDataAttributesEventTypesItem]] = UNSET - enabled: Union[Unset, bool] = UNSET - custom_headers: Union[Unset, list["NewWebhooksEndpointDataAttributesCustomHeadersItem"]] = UNSET + slug: None | Unset | str = UNSET + secret: Unset | str = UNSET + event_types: Unset | list[NewWebhooksEndpointDataAttributesEventTypesItem] = UNSET + enabled: Unset | bool = UNSET + custom_headers: Unset | list["NewWebhooksEndpointDataAttributesCustomHeadersItem"] = UNSET def to_dict(self) -> dict[str, Any]: name = self.name url = self.url - slug: Union[None, Unset, str] + slug: None | Unset | str if isinstance(self.slug, Unset): slug = UNSET else: @@ -54,7 +54,7 @@ def to_dict(self) -> dict[str, Any]: secret = self.secret - event_types: Union[Unset, list[str]] = UNSET + event_types: Unset | list[str] = UNSET if not isinstance(self.event_types, Unset): event_types = [] for event_types_item_data in self.event_types: @@ -63,7 +63,7 @@ def to_dict(self) -> dict[str, Any]: enabled = self.enabled - custom_headers: Union[Unset, list[dict[str, Any]]] = UNSET + custom_headers: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.custom_headers, Unset): custom_headers = [] for custom_headers_item_data in self.custom_headers: @@ -102,12 +102,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: url = d.pop("url") - def _parse_slug(data: object) -> Union[None, Unset, str]: + def _parse_slug(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) slug = _parse_slug(d.pop("slug", UNSET)) diff --git a/rootly_sdk/models/new_workflow_action_item_form_field_condition_data_attributes.py b/rootly_sdk/models/new_workflow_action_item_form_field_condition_data_attributes.py index 06d69d9d..fa2a2968 100644 --- a/rootly_sdk/models/new_workflow_action_item_form_field_condition_data_attributes.py +++ b/rootly_sdk/models/new_workflow_action_item_form_field_condition_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -33,59 +33,59 @@ class NewWorkflowActionItemFormFieldConditionDataAttributes: form_field_id: str action_item_condition: NewWorkflowActionItemFormFieldConditionDataAttributesActionItemCondition = "ANY" - values: Union[Unset, list[str]] = UNSET - selected_catalog_entity_ids: Union[Unset, list[str]] = UNSET - selected_functionality_ids: Union[Unset, list[str]] = UNSET - selected_group_ids: Union[Unset, list[str]] = UNSET - selected_option_ids: Union[Unset, list[str]] = UNSET - selected_service_ids: Union[Unset, list[str]] = UNSET - selected_user_ids: Union[Unset, list[int]] = UNSET - selected_cause_ids: Union[Unset, list[str]] = UNSET - selected_environment_ids: Union[Unset, list[str]] = UNSET - selected_incident_type_ids: Union[Unset, list[str]] = UNSET + values: Unset | list[str] = UNSET + selected_catalog_entity_ids: Unset | list[str] = UNSET + selected_functionality_ids: Unset | list[str] = UNSET + selected_group_ids: Unset | list[str] = UNSET + selected_option_ids: Unset | list[str] = UNSET + selected_service_ids: Unset | list[str] = UNSET + selected_user_ids: Unset | list[int] = UNSET + selected_cause_ids: Unset | list[str] = UNSET + selected_environment_ids: Unset | list[str] = UNSET + selected_incident_type_ids: Unset | list[str] = UNSET def to_dict(self) -> dict[str, Any]: form_field_id = self.form_field_id action_item_condition: str = self.action_item_condition - values: Union[Unset, list[str]] = UNSET + values: Unset | list[str] = UNSET if not isinstance(self.values, Unset): values = self.values - selected_catalog_entity_ids: Union[Unset, list[str]] = UNSET + selected_catalog_entity_ids: Unset | list[str] = UNSET if not isinstance(self.selected_catalog_entity_ids, Unset): selected_catalog_entity_ids = self.selected_catalog_entity_ids - selected_functionality_ids: Union[Unset, list[str]] = UNSET + selected_functionality_ids: Unset | list[str] = UNSET if not isinstance(self.selected_functionality_ids, Unset): selected_functionality_ids = self.selected_functionality_ids - selected_group_ids: Union[Unset, list[str]] = UNSET + selected_group_ids: Unset | list[str] = UNSET if not isinstance(self.selected_group_ids, Unset): selected_group_ids = self.selected_group_ids - selected_option_ids: Union[Unset, list[str]] = UNSET + selected_option_ids: Unset | list[str] = UNSET if not isinstance(self.selected_option_ids, Unset): selected_option_ids = self.selected_option_ids - selected_service_ids: Union[Unset, list[str]] = UNSET + selected_service_ids: Unset | list[str] = UNSET if not isinstance(self.selected_service_ids, Unset): selected_service_ids = self.selected_service_ids - selected_user_ids: Union[Unset, list[int]] = UNSET + selected_user_ids: Unset | list[int] = UNSET if not isinstance(self.selected_user_ids, Unset): selected_user_ids = self.selected_user_ids - selected_cause_ids: Union[Unset, list[str]] = UNSET + selected_cause_ids: Unset | list[str] = UNSET if not isinstance(self.selected_cause_ids, Unset): selected_cause_ids = self.selected_cause_ids - selected_environment_ids: Union[Unset, list[str]] = UNSET + selected_environment_ids: Unset | list[str] = UNSET if not isinstance(self.selected_environment_ids, Unset): selected_environment_ids = self.selected_environment_ids - selected_incident_type_ids: Union[Unset, list[str]] = UNSET + selected_incident_type_ids: Unset | list[str] = UNSET if not isinstance(self.selected_incident_type_ids, Unset): selected_incident_type_ids = self.selected_incident_type_ids diff --git a/rootly_sdk/models/new_workflow_custom_field_selection_data_attributes.py b/rootly_sdk/models/new_workflow_custom_field_selection_data_attributes.py index 5658825f..00110ee1 100644 --- a/rootly_sdk/models/new_workflow_custom_field_selection_data_attributes.py +++ b/rootly_sdk/models/new_workflow_custom_field_selection_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -26,9 +26,9 @@ class NewWorkflowCustomFieldSelectionDataAttributes: custom_field_id: int incident_condition: NewWorkflowCustomFieldSelectionDataAttributesIncidentCondition = "ANY" - workflow_id: Union[Unset, str] = UNSET - values: Union[Unset, list[str]] = UNSET - selected_option_ids: Union[Unset, list[int]] = UNSET + workflow_id: Unset | str = UNSET + values: Unset | list[str] = UNSET + selected_option_ids: Unset | list[int] = UNSET def to_dict(self) -> dict[str, Any]: custom_field_id = self.custom_field_id @@ -37,11 +37,11 @@ def to_dict(self) -> dict[str, Any]: workflow_id = self.workflow_id - values: Union[Unset, list[str]] = UNSET + values: Unset | list[str] = UNSET if not isinstance(self.values, Unset): values = self.values - selected_option_ids: Union[Unset, list[int]] = UNSET + selected_option_ids: Unset | list[int] = UNSET if not isinstance(self.selected_option_ids, Unset): selected_option_ids = self.selected_option_ids diff --git a/rootly_sdk/models/new_workflow_data_attributes.py b/rootly_sdk/models/new_workflow_data_attributes.py index 60aa3f04..9224ab83 100644 --- a/rootly_sdk/models/new_workflow_data_attributes.py +++ b/rootly_sdk/models/new_workflow_data_attributes.py @@ -63,21 +63,21 @@ class NewWorkflowDataAttributes: """ name: str - slug: Union[None, Unset, str] = UNSET - description: Union[None, Unset, str] = UNSET - command: Union[None, Unset, str] = UNSET - command_feedback_enabled: Union[None, Unset, bool] = UNSET - wait: Union[None, Unset, str] = UNSET - priority: Union[Unset, NewWorkflowDataAttributesPriority] = UNSET - repeat_every_duration: Union[None, Unset, str] = UNSET - repeat_condition_duration_since_first_run: Union[None, Unset, str] = UNSET - repeat_condition_number_of_repeats: Union[Unset, int] = UNSET - continuously_repeat: Union[Unset, bool] = UNSET - repeat_on: Union[Unset, list[NewWorkflowDataAttributesRepeatOnItem]] = UNSET - enabled: Union[Unset, bool] = UNSET - locked: Union[Unset, bool] = UNSET - position: Union[Unset, int] = UNSET - workflow_group_id: Union[None, Unset, str] = UNSET + slug: None | Unset | str = UNSET + description: None | Unset | str = UNSET + command: None | Unset | str = UNSET + command_feedback_enabled: None | Unset | bool = UNSET + wait: None | Unset | str = UNSET + priority: Unset | NewWorkflowDataAttributesPriority = UNSET + repeat_every_duration: None | Unset | str = UNSET + repeat_condition_duration_since_first_run: None | Unset | str = UNSET + repeat_condition_number_of_repeats: Unset | int = UNSET + continuously_repeat: Unset | bool = UNSET + repeat_on: Unset | list[NewWorkflowDataAttributesRepeatOnItem] = UNSET + enabled: Unset | bool = UNSET + locked: Unset | bool = UNSET + position: Unset | int = UNSET + workflow_group_id: None | Unset | str = UNSET trigger_params: Union[ "ActionItemTriggerParams", "AlertTriggerParams", @@ -86,15 +86,15 @@ class NewWorkflowDataAttributes: "SimpleTriggerParams", Unset, ] = UNSET - environment_ids: Union[Unset, list[str]] = UNSET - severity_ids: Union[Unset, list[str]] = UNSET - incident_type_ids: Union[Unset, list[str]] = UNSET - incident_role_ids: Union[Unset, list[str]] = UNSET - service_ids: Union[Unset, list[str]] = UNSET - functionality_ids: Union[Unset, list[str]] = UNSET - group_ids: Union[Unset, list[str]] = UNSET - cause_ids: Union[Unset, list[str]] = UNSET - sub_status_ids: Union[Unset, list[str]] = UNSET + environment_ids: Unset | list[str] = UNSET + severity_ids: Unset | list[str] = UNSET + incident_type_ids: Unset | list[str] = UNSET + incident_role_ids: Unset | list[str] = UNSET + service_ids: Unset | list[str] = UNSET + functionality_ids: Unset | list[str] = UNSET + group_ids: Unset | list[str] = UNSET + cause_ids: Unset | list[str] = UNSET + sub_status_ids: Unset | list[str] = UNSET def to_dict(self) -> dict[str, Any]: from ..models.action_item_trigger_params import ActionItemTriggerParams @@ -104,47 +104,47 @@ def to_dict(self) -> dict[str, Any]: name = self.name - slug: Union[None, Unset, str] + slug: None | Unset | str if isinstance(self.slug, Unset): slug = UNSET else: slug = self.slug - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - command: Union[None, Unset, str] + command: None | Unset | str if isinstance(self.command, Unset): command = UNSET else: command = self.command - command_feedback_enabled: Union[None, Unset, bool] + command_feedback_enabled: None | Unset | bool if isinstance(self.command_feedback_enabled, Unset): command_feedback_enabled = UNSET else: command_feedback_enabled = self.command_feedback_enabled - wait: Union[None, Unset, str] + wait: None | Unset | str if isinstance(self.wait, Unset): wait = UNSET else: wait = self.wait - priority: Union[Unset, str] = UNSET + priority: Unset | str = UNSET if not isinstance(self.priority, Unset): priority = self.priority - repeat_every_duration: Union[None, Unset, str] + repeat_every_duration: None | Unset | str if isinstance(self.repeat_every_duration, Unset): repeat_every_duration = UNSET else: repeat_every_duration = self.repeat_every_duration - repeat_condition_duration_since_first_run: Union[None, Unset, str] + repeat_condition_duration_since_first_run: None | Unset | str if isinstance(self.repeat_condition_duration_since_first_run, Unset): repeat_condition_duration_since_first_run = UNSET else: @@ -154,7 +154,7 @@ def to_dict(self) -> dict[str, Any]: continuously_repeat = self.continuously_repeat - repeat_on: Union[Unset, list[str]] = UNSET + repeat_on: Unset | list[str] = UNSET if not isinstance(self.repeat_on, Unset): repeat_on = [] for repeat_on_item_data in self.repeat_on: @@ -167,13 +167,13 @@ def to_dict(self) -> dict[str, Any]: position = self.position - workflow_group_id: Union[None, Unset, str] + workflow_group_id: None | Unset | str if isinstance(self.workflow_group_id, Unset): workflow_group_id = UNSET else: workflow_group_id = self.workflow_group_id - trigger_params: Union[Unset, dict[str, Any]] + trigger_params: Unset | dict[str, Any] if isinstance(self.trigger_params, Unset): trigger_params = UNSET elif isinstance(self.trigger_params, IncidentTriggerParams): @@ -187,39 +187,39 @@ def to_dict(self) -> dict[str, Any]: else: trigger_params = self.trigger_params.to_dict() - environment_ids: Union[Unset, list[str]] = UNSET + environment_ids: Unset | list[str] = UNSET if not isinstance(self.environment_ids, Unset): environment_ids = self.environment_ids - severity_ids: Union[Unset, list[str]] = UNSET + severity_ids: Unset | list[str] = UNSET if not isinstance(self.severity_ids, Unset): severity_ids = self.severity_ids - incident_type_ids: Union[Unset, list[str]] = UNSET + incident_type_ids: Unset | list[str] = UNSET if not isinstance(self.incident_type_ids, Unset): incident_type_ids = self.incident_type_ids - incident_role_ids: Union[Unset, list[str]] = UNSET + incident_role_ids: Unset | list[str] = UNSET if not isinstance(self.incident_role_ids, Unset): incident_role_ids = self.incident_role_ids - service_ids: Union[Unset, list[str]] = UNSET + service_ids: Unset | list[str] = UNSET if not isinstance(self.service_ids, Unset): service_ids = self.service_ids - functionality_ids: Union[Unset, list[str]] = UNSET + functionality_ids: Unset | list[str] = UNSET if not isinstance(self.functionality_ids, Unset): functionality_ids = self.functionality_ids - group_ids: Union[Unset, list[str]] = UNSET + group_ids: Unset | list[str] = UNSET if not isinstance(self.group_ids, Unset): group_ids = self.group_ids - cause_ids: Union[Unset, list[str]] = UNSET + cause_ids: Unset | list[str] = UNSET if not isinstance(self.cause_ids, Unset): cause_ids = self.cause_ids - sub_status_ids: Union[Unset, list[str]] = UNSET + sub_status_ids: Unset | list[str] = UNSET if not isinstance(self.sub_status_ids, Unset): sub_status_ids = self.sub_status_ids @@ -294,73 +294,73 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name") - def _parse_slug(data: object) -> Union[None, Unset, str]: + def _parse_slug(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) slug = _parse_slug(d.pop("slug", UNSET)) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_command(data: object) -> Union[None, Unset, str]: + def _parse_command(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) command = _parse_command(d.pop("command", UNSET)) - def _parse_command_feedback_enabled(data: object) -> Union[None, Unset, bool]: + def _parse_command_feedback_enabled(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) command_feedback_enabled = _parse_command_feedback_enabled(d.pop("command_feedback_enabled", UNSET)) - def _parse_wait(data: object) -> Union[None, Unset, str]: + def _parse_wait(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) wait = _parse_wait(d.pop("wait", UNSET)) _priority = d.pop("priority", UNSET) - priority: Union[Unset, NewWorkflowDataAttributesPriority] + priority: Unset | NewWorkflowDataAttributesPriority if isinstance(_priority, Unset): priority = UNSET else: priority = check_new_workflow_data_attributes_priority(_priority) - def _parse_repeat_every_duration(data: object) -> Union[None, Unset, str]: + def _parse_repeat_every_duration(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) repeat_every_duration = _parse_repeat_every_duration(d.pop("repeat_every_duration", UNSET)) - def _parse_repeat_condition_duration_since_first_run(data: object) -> Union[None, Unset, str]: + def _parse_repeat_condition_duration_since_first_run(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) repeat_condition_duration_since_first_run = _parse_repeat_condition_duration_since_first_run( d.pop("repeat_condition_duration_since_first_run", UNSET) @@ -383,12 +383,12 @@ def _parse_repeat_condition_duration_since_first_run(data: object) -> Union[None position = d.pop("position", UNSET) - def _parse_workflow_group_id(data: object) -> Union[None, Unset, str]: + def _parse_workflow_group_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) workflow_group_id = _parse_workflow_group_id(d.pop("workflow_group_id", UNSET)) diff --git a/rootly_sdk/models/new_workflow_form_field_condition_data_attributes.py b/rootly_sdk/models/new_workflow_form_field_condition_data_attributes.py index dc1dbdee..b07a145f 100644 --- a/rootly_sdk/models/new_workflow_form_field_condition_data_attributes.py +++ b/rootly_sdk/models/new_workflow_form_field_condition_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -34,17 +34,17 @@ class NewWorkflowFormFieldConditionDataAttributes: form_field_id: str incident_condition: NewWorkflowFormFieldConditionDataAttributesIncidentCondition = "ANY" - workflow_id: Union[Unset, str] = UNSET - values: Union[Unset, list[str]] = UNSET - selected_catalog_entity_ids: Union[Unset, list[str]] = UNSET - selected_functionality_ids: Union[Unset, list[str]] = UNSET - selected_group_ids: Union[Unset, list[str]] = UNSET - selected_option_ids: Union[Unset, list[str]] = UNSET - selected_service_ids: Union[Unset, list[str]] = UNSET - selected_user_ids: Union[Unset, list[int]] = UNSET - selected_cause_ids: Union[Unset, list[str]] = UNSET - selected_environment_ids: Union[Unset, list[str]] = UNSET - selected_incident_type_ids: Union[Unset, list[str]] = UNSET + workflow_id: Unset | str = UNSET + values: Unset | list[str] = UNSET + selected_catalog_entity_ids: Unset | list[str] = UNSET + selected_functionality_ids: Unset | list[str] = UNSET + selected_group_ids: Unset | list[str] = UNSET + selected_option_ids: Unset | list[str] = UNSET + selected_service_ids: Unset | list[str] = UNSET + selected_user_ids: Unset | list[int] = UNSET + selected_cause_ids: Unset | list[str] = UNSET + selected_environment_ids: Unset | list[str] = UNSET + selected_incident_type_ids: Unset | list[str] = UNSET def to_dict(self) -> dict[str, Any]: form_field_id = self.form_field_id @@ -53,43 +53,43 @@ def to_dict(self) -> dict[str, Any]: workflow_id = self.workflow_id - values: Union[Unset, list[str]] = UNSET + values: Unset | list[str] = UNSET if not isinstance(self.values, Unset): values = self.values - selected_catalog_entity_ids: Union[Unset, list[str]] = UNSET + selected_catalog_entity_ids: Unset | list[str] = UNSET if not isinstance(self.selected_catalog_entity_ids, Unset): selected_catalog_entity_ids = self.selected_catalog_entity_ids - selected_functionality_ids: Union[Unset, list[str]] = UNSET + selected_functionality_ids: Unset | list[str] = UNSET if not isinstance(self.selected_functionality_ids, Unset): selected_functionality_ids = self.selected_functionality_ids - selected_group_ids: Union[Unset, list[str]] = UNSET + selected_group_ids: Unset | list[str] = UNSET if not isinstance(self.selected_group_ids, Unset): selected_group_ids = self.selected_group_ids - selected_option_ids: Union[Unset, list[str]] = UNSET + selected_option_ids: Unset | list[str] = UNSET if not isinstance(self.selected_option_ids, Unset): selected_option_ids = self.selected_option_ids - selected_service_ids: Union[Unset, list[str]] = UNSET + selected_service_ids: Unset | list[str] = UNSET if not isinstance(self.selected_service_ids, Unset): selected_service_ids = self.selected_service_ids - selected_user_ids: Union[Unset, list[int]] = UNSET + selected_user_ids: Unset | list[int] = UNSET if not isinstance(self.selected_user_ids, Unset): selected_user_ids = self.selected_user_ids - selected_cause_ids: Union[Unset, list[str]] = UNSET + selected_cause_ids: Unset | list[str] = UNSET if not isinstance(self.selected_cause_ids, Unset): selected_cause_ids = self.selected_cause_ids - selected_environment_ids: Union[Unset, list[str]] = UNSET + selected_environment_ids: Unset | list[str] = UNSET if not isinstance(self.selected_environment_ids, Unset): selected_environment_ids = self.selected_environment_ids - selected_incident_type_ids: Union[Unset, list[str]] = UNSET + selected_incident_type_ids: Unset | list[str] = UNSET if not isinstance(self.selected_incident_type_ids, Unset): selected_incident_type_ids = self.selected_incident_type_ids diff --git a/rootly_sdk/models/new_workflow_group_data_attributes.py b/rootly_sdk/models/new_workflow_group_data_attributes.py index c95066e2..2ca72540 100644 --- a/rootly_sdk/models/new_workflow_group_data_attributes.py +++ b/rootly_sdk/models/new_workflow_group_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -28,28 +28,28 @@ class NewWorkflowGroupDataAttributes: """ name: str - slug: Union[None, Unset, str] = UNSET - kind: Union[Unset, NewWorkflowGroupDataAttributesKind] = UNSET - description: Union[None, Unset, str] = UNSET - icon: Union[Unset, str] = UNSET - expanded: Union[Unset, bool] = UNSET - position: Union[Unset, int] = UNSET + slug: None | Unset | str = UNSET + kind: Unset | NewWorkflowGroupDataAttributesKind = UNSET + description: None | Unset | str = UNSET + icon: Unset | str = UNSET + expanded: Unset | bool = UNSET + position: Unset | int = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: name = self.name - slug: Union[None, Unset, str] + slug: None | Unset | str if isinstance(self.slug, Unset): slug = UNSET else: slug = self.slug - kind: Union[Unset, str] = UNSET + kind: Unset | str = UNSET if not isinstance(self.kind, Unset): kind = self.kind - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: @@ -88,28 +88,28 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name") - def _parse_slug(data: object) -> Union[None, Unset, str]: + def _parse_slug(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) slug = _parse_slug(d.pop("slug", UNSET)) _kind = d.pop("kind", UNSET) - kind: Union[Unset, NewWorkflowGroupDataAttributesKind] + kind: Unset | NewWorkflowGroupDataAttributesKind if isinstance(_kind, Unset): kind = UNSET else: kind = check_new_workflow_group_data_attributes_kind(_kind) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) diff --git a/rootly_sdk/models/new_workflow_run_data_attributes_type_0.py b/rootly_sdk/models/new_workflow_run_data_attributes_type_0.py index f02eb4ff..ae4f183a 100644 --- a/rootly_sdk/models/new_workflow_run_data_attributes_type_0.py +++ b/rootly_sdk/models/new_workflow_run_data_attributes_type_0.py @@ -24,25 +24,25 @@ class NewWorkflowRunDataAttributesType0: context (Union[Unset, NewWorkflowRunDataAttributesType0Context]): """ - immediate: Union[None, Unset, bool] = True - check_conditions: Union[None, Unset, bool] = False + immediate: None | Unset | bool = True + check_conditions: None | Unset | bool = False context: Union[Unset, "NewWorkflowRunDataAttributesType0Context"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - immediate: Union[None, Unset, bool] + immediate: None | Unset | bool if isinstance(self.immediate, Unset): immediate = UNSET else: immediate = self.immediate - check_conditions: Union[None, Unset, bool] + check_conditions: None | Unset | bool if isinstance(self.check_conditions, Unset): check_conditions = UNSET else: check_conditions = self.check_conditions - context: Union[Unset, dict[str, Any]] = UNSET + context: Unset | dict[str, Any] = UNSET if not isinstance(self.context, Unset): context = self.context.to_dict() @@ -64,26 +64,26 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_immediate(data: object) -> Union[None, Unset, bool]: + def _parse_immediate(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) immediate = _parse_immediate(d.pop("immediate", UNSET)) - def _parse_check_conditions(data: object) -> Union[None, Unset, bool]: + def _parse_check_conditions(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) check_conditions = _parse_check_conditions(d.pop("check_conditions", UNSET)) _context = d.pop("context", UNSET) - context: Union[Unset, NewWorkflowRunDataAttributesType0Context] + context: Unset | NewWorkflowRunDataAttributesType0Context if isinstance(_context, Unset): context = UNSET else: diff --git a/rootly_sdk/models/new_workflow_run_data_attributes_type_1.py b/rootly_sdk/models/new_workflow_run_data_attributes_type_1.py index 0d8099a0..6c0a8724 100644 --- a/rootly_sdk/models/new_workflow_run_data_attributes_type_1.py +++ b/rootly_sdk/models/new_workflow_run_data_attributes_type_1.py @@ -26,27 +26,27 @@ class NewWorkflowRunDataAttributesType1: """ incident_id: str - immediate: Union[None, Unset, bool] = True - check_conditions: Union[None, Unset, bool] = False + immediate: None | Unset | bool = True + check_conditions: None | Unset | bool = False context: Union[Unset, "NewWorkflowRunDataAttributesType1Context"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: incident_id = self.incident_id - immediate: Union[None, Unset, bool] + immediate: None | Unset | bool if isinstance(self.immediate, Unset): immediate = UNSET else: immediate = self.immediate - check_conditions: Union[None, Unset, bool] + check_conditions: None | Unset | bool if isinstance(self.check_conditions, Unset): check_conditions = UNSET else: check_conditions = self.check_conditions - context: Union[Unset, dict[str, Any]] = UNSET + context: Unset | dict[str, Any] = UNSET if not isinstance(self.context, Unset): context = self.context.to_dict() @@ -73,26 +73,26 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) incident_id = d.pop("incident_id") - def _parse_immediate(data: object) -> Union[None, Unset, bool]: + def _parse_immediate(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) immediate = _parse_immediate(d.pop("immediate", UNSET)) - def _parse_check_conditions(data: object) -> Union[None, Unset, bool]: + def _parse_check_conditions(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) check_conditions = _parse_check_conditions(d.pop("check_conditions", UNSET)) _context = d.pop("context", UNSET) - context: Union[Unset, NewWorkflowRunDataAttributesType1Context] + context: Unset | NewWorkflowRunDataAttributesType1Context if isinstance(_context, Unset): context = UNSET else: diff --git a/rootly_sdk/models/new_workflow_run_data_attributes_type_2.py b/rootly_sdk/models/new_workflow_run_data_attributes_type_2.py index 2a550f68..eaefbd9c 100644 --- a/rootly_sdk/models/new_workflow_run_data_attributes_type_2.py +++ b/rootly_sdk/models/new_workflow_run_data_attributes_type_2.py @@ -26,27 +26,27 @@ class NewWorkflowRunDataAttributesType2: """ post_mortem_id: str - immediate: Union[None, Unset, bool] = True - check_conditions: Union[None, Unset, bool] = False + immediate: None | Unset | bool = True + check_conditions: None | Unset | bool = False context: Union[Unset, "NewWorkflowRunDataAttributesType2Context"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: post_mortem_id = self.post_mortem_id - immediate: Union[None, Unset, bool] + immediate: None | Unset | bool if isinstance(self.immediate, Unset): immediate = UNSET else: immediate = self.immediate - check_conditions: Union[None, Unset, bool] + check_conditions: None | Unset | bool if isinstance(self.check_conditions, Unset): check_conditions = UNSET else: check_conditions = self.check_conditions - context: Union[Unset, dict[str, Any]] = UNSET + context: Unset | dict[str, Any] = UNSET if not isinstance(self.context, Unset): context = self.context.to_dict() @@ -73,26 +73,26 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) post_mortem_id = d.pop("post_mortem_id") - def _parse_immediate(data: object) -> Union[None, Unset, bool]: + def _parse_immediate(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) immediate = _parse_immediate(d.pop("immediate", UNSET)) - def _parse_check_conditions(data: object) -> Union[None, Unset, bool]: + def _parse_check_conditions(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) check_conditions = _parse_check_conditions(d.pop("check_conditions", UNSET)) _context = d.pop("context", UNSET) - context: Union[Unset, NewWorkflowRunDataAttributesType2Context] + context: Unset | NewWorkflowRunDataAttributesType2Context if isinstance(_context, Unset): context = UNSET else: diff --git a/rootly_sdk/models/new_workflow_run_data_attributes_type_3.py b/rootly_sdk/models/new_workflow_run_data_attributes_type_3.py index cf3abb0d..42aa6168 100644 --- a/rootly_sdk/models/new_workflow_run_data_attributes_type_3.py +++ b/rootly_sdk/models/new_workflow_run_data_attributes_type_3.py @@ -26,27 +26,27 @@ class NewWorkflowRunDataAttributesType3: """ action_item_id: str - immediate: Union[None, Unset, bool] = True - check_conditions: Union[None, Unset, bool] = False + immediate: None | Unset | bool = True + check_conditions: None | Unset | bool = False context: Union[Unset, "NewWorkflowRunDataAttributesType3Context"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: action_item_id = self.action_item_id - immediate: Union[None, Unset, bool] + immediate: None | Unset | bool if isinstance(self.immediate, Unset): immediate = UNSET else: immediate = self.immediate - check_conditions: Union[None, Unset, bool] + check_conditions: None | Unset | bool if isinstance(self.check_conditions, Unset): check_conditions = UNSET else: check_conditions = self.check_conditions - context: Union[Unset, dict[str, Any]] = UNSET + context: Unset | dict[str, Any] = UNSET if not isinstance(self.context, Unset): context = self.context.to_dict() @@ -73,26 +73,26 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) action_item_id = d.pop("action_item_id") - def _parse_immediate(data: object) -> Union[None, Unset, bool]: + def _parse_immediate(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) immediate = _parse_immediate(d.pop("immediate", UNSET)) - def _parse_check_conditions(data: object) -> Union[None, Unset, bool]: + def _parse_check_conditions(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) check_conditions = _parse_check_conditions(d.pop("check_conditions", UNSET)) _context = d.pop("context", UNSET) - context: Union[Unset, NewWorkflowRunDataAttributesType3Context] + context: Unset | NewWorkflowRunDataAttributesType3Context if isinstance(_context, Unset): context = UNSET else: diff --git a/rootly_sdk/models/new_workflow_run_data_attributes_type_4.py b/rootly_sdk/models/new_workflow_run_data_attributes_type_4.py index e5ac19c1..7fecfc0a 100644 --- a/rootly_sdk/models/new_workflow_run_data_attributes_type_4.py +++ b/rootly_sdk/models/new_workflow_run_data_attributes_type_4.py @@ -26,27 +26,27 @@ class NewWorkflowRunDataAttributesType4: """ alert_id: str - immediate: Union[None, Unset, bool] = True - check_conditions: Union[None, Unset, bool] = False + immediate: None | Unset | bool = True + check_conditions: None | Unset | bool = False context: Union[Unset, "NewWorkflowRunDataAttributesType4Context"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: alert_id = self.alert_id - immediate: Union[None, Unset, bool] + immediate: None | Unset | bool if isinstance(self.immediate, Unset): immediate = UNSET else: immediate = self.immediate - check_conditions: Union[None, Unset, bool] + check_conditions: None | Unset | bool if isinstance(self.check_conditions, Unset): check_conditions = UNSET else: check_conditions = self.check_conditions - context: Union[Unset, dict[str, Any]] = UNSET + context: Unset | dict[str, Any] = UNSET if not isinstance(self.context, Unset): context = self.context.to_dict() @@ -73,26 +73,26 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) alert_id = d.pop("alert_id") - def _parse_immediate(data: object) -> Union[None, Unset, bool]: + def _parse_immediate(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) immediate = _parse_immediate(d.pop("immediate", UNSET)) - def _parse_check_conditions(data: object) -> Union[None, Unset, bool]: + def _parse_check_conditions(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) check_conditions = _parse_check_conditions(d.pop("check_conditions", UNSET)) _context = d.pop("context", UNSET) - context: Union[Unset, NewWorkflowRunDataAttributesType4Context] + context: Unset | NewWorkflowRunDataAttributesType4Context if isinstance(_context, Unset): context = UNSET else: diff --git a/rootly_sdk/models/new_workflow_run_data_attributes_type_5.py b/rootly_sdk/models/new_workflow_run_data_attributes_type_5.py index 1e2b9a66..047f5885 100644 --- a/rootly_sdk/models/new_workflow_run_data_attributes_type_5.py +++ b/rootly_sdk/models/new_workflow_run_data_attributes_type_5.py @@ -26,27 +26,27 @@ class NewWorkflowRunDataAttributesType5: """ pulse_id: str - immediate: Union[None, Unset, bool] = True - check_conditions: Union[None, Unset, bool] = False + immediate: None | Unset | bool = True + check_conditions: None | Unset | bool = False context: Union[Unset, "NewWorkflowRunDataAttributesType5Context"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: pulse_id = self.pulse_id - immediate: Union[None, Unset, bool] + immediate: None | Unset | bool if isinstance(self.immediate, Unset): immediate = UNSET else: immediate = self.immediate - check_conditions: Union[None, Unset, bool] + check_conditions: None | Unset | bool if isinstance(self.check_conditions, Unset): check_conditions = UNSET else: check_conditions = self.check_conditions - context: Union[Unset, dict[str, Any]] = UNSET + context: Unset | dict[str, Any] = UNSET if not isinstance(self.context, Unset): context = self.context.to_dict() @@ -73,26 +73,26 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) pulse_id = d.pop("pulse_id") - def _parse_immediate(data: object) -> Union[None, Unset, bool]: + def _parse_immediate(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) immediate = _parse_immediate(d.pop("immediate", UNSET)) - def _parse_check_conditions(data: object) -> Union[None, Unset, bool]: + def _parse_check_conditions(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) check_conditions = _parse_check_conditions(d.pop("check_conditions", UNSET)) _context = d.pop("context", UNSET) - context: Union[Unset, NewWorkflowRunDataAttributesType5Context] + context: Unset | NewWorkflowRunDataAttributesType5Context if isinstance(_context, Unset): context = UNSET else: diff --git a/rootly_sdk/models/new_workflow_task_data_attributes.py b/rootly_sdk/models/new_workflow_task_data_attributes.py index 0918a4db..9e7fb4b3 100644 --- a/rootly_sdk/models/new_workflow_task_data_attributes.py +++ b/rootly_sdk/models/new_workflow_task_data_attributes.py @@ -430,10 +430,10 @@ class NewWorkflowTaskDataAttributes: "UpdateVictorOpsIncidentTaskParams", "UpdateZendeskTicketTaskParams", ] - name: Union[Unset, str] = UNSET - position: Union[Unset, int] = UNSET - skip_on_failure: Union[Unset, bool] = UNSET - enabled: Union[Unset, bool] = True + name: Unset | str = UNSET + position: Unset | int = UNSET + skip_on_failure: Unset | bool = UNSET + enabled: Unset | bool = True def to_dict(self) -> dict[str, Any]: from ..models.add_action_item_task_params import AddActionItemTaskParams diff --git a/rootly_sdk/models/on_call_pay_report.py b/rootly_sdk/models/on_call_pay_report.py index 385e790c..f3c8c775 100644 --- a/rootly_sdk/models/on_call_pay_report.py +++ b/rootly_sdk/models/on_call_pay_report.py @@ -1,6 +1,6 @@ import datetime from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -49,22 +49,22 @@ class OnCallPayReport: end_date: datetime.date created_at: datetime.datetime updated_at: datetime.datetime - total_duration: Union[Unset, int] = UNSET - users_count: Union[Unset, int] = UNSET - currency: Union[Unset, str] = UNSET - pay_type: Union[Unset, OnCallPayReportPayType] = UNSET - hourly_rate_cents: Union[Unset, int] = UNSET - daily_rate_cents: Union[Unset, int] = UNSET - total_pay_cents: Union[Unset, int] = UNSET - include_shadow: Union[Unset, bool] = UNSET - show_individual_shift_data: Union[Unset, bool] = UNSET - has_single_rate: Union[Unset, bool] = UNSET - enabled_granular_time_breakdown: Union[Unset, bool] = UNSET - last_generated_at: Union[None, Unset, datetime.datetime] = UNSET - time_zone: Union[None, Unset, str] = UNSET - use_responders_time_zone: Union[Unset, bool] = UNSET - csv_file_url: Union[None, Unset, str] = UNSET - xlsx_file_url: Union[None, Unset, str] = UNSET + total_duration: Unset | int = UNSET + users_count: Unset | int = UNSET + currency: Unset | str = UNSET + pay_type: Unset | OnCallPayReportPayType = UNSET + hourly_rate_cents: Unset | int = UNSET + daily_rate_cents: Unset | int = UNSET + total_pay_cents: Unset | int = UNSET + include_shadow: Unset | bool = UNSET + show_individual_shift_data: Unset | bool = UNSET + has_single_rate: Unset | bool = UNSET + enabled_granular_time_breakdown: Unset | bool = UNSET + last_generated_at: None | Unset | datetime.datetime = UNSET + time_zone: None | Unset | str = UNSET + use_responders_time_zone: Unset | bool = UNSET + csv_file_url: None | Unset | str = UNSET + xlsx_file_url: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -84,7 +84,7 @@ def to_dict(self) -> dict[str, Any]: currency = self.currency - pay_type: Union[Unset, str] = UNSET + pay_type: Unset | str = UNSET if not isinstance(self.pay_type, Unset): pay_type = self.pay_type @@ -102,7 +102,7 @@ def to_dict(self) -> dict[str, Any]: enabled_granular_time_breakdown = self.enabled_granular_time_breakdown - last_generated_at: Union[None, Unset, str] + last_generated_at: None | Unset | str if isinstance(self.last_generated_at, Unset): last_generated_at = UNSET elif isinstance(self.last_generated_at, datetime.datetime): @@ -110,7 +110,7 @@ def to_dict(self) -> dict[str, Any]: else: last_generated_at = self.last_generated_at - time_zone: Union[None, Unset, str] + time_zone: None | Unset | str if isinstance(self.time_zone, Unset): time_zone = UNSET else: @@ -118,13 +118,13 @@ def to_dict(self) -> dict[str, Any]: use_responders_time_zone = self.use_responders_time_zone - csv_file_url: Union[None, Unset, str] + csv_file_url: None | Unset | str if isinstance(self.csv_file_url, Unset): csv_file_url = UNSET else: csv_file_url = self.csv_file_url - xlsx_file_url: Union[None, Unset, str] + xlsx_file_url: None | Unset | str if isinstance(self.xlsx_file_url, Unset): xlsx_file_url = UNSET else: @@ -196,7 +196,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: currency = d.pop("currency", UNSET) _pay_type = d.pop("pay_type", UNSET) - pay_type: Union[Unset, OnCallPayReportPayType] + pay_type: Unset | OnCallPayReportPayType if isinstance(_pay_type, Unset): pay_type = UNSET else: @@ -216,7 +216,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: enabled_granular_time_breakdown = d.pop("enabled_granular_time_breakdown", UNSET) - def _parse_last_generated_at(data: object) -> Union[None, Unset, datetime.datetime]: + def _parse_last_generated_at(data: object) -> None | Unset | datetime.datetime: if data is None: return data if isinstance(data, Unset): @@ -229,36 +229,36 @@ def _parse_last_generated_at(data: object) -> Union[None, Unset, datetime.dateti return last_generated_at_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, datetime.datetime], data) + return cast(None | Unset | datetime.datetime, data) last_generated_at = _parse_last_generated_at(d.pop("last_generated_at", UNSET)) - def _parse_time_zone(data: object) -> Union[None, Unset, str]: + def _parse_time_zone(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) time_zone = _parse_time_zone(d.pop("time_zone", UNSET)) use_responders_time_zone = d.pop("use_responders_time_zone", UNSET) - def _parse_csv_file_url(data: object) -> Union[None, Unset, str]: + def _parse_csv_file_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) csv_file_url = _parse_csv_file_url(d.pop("csv_file_url", UNSET)) - def _parse_xlsx_file_url(data: object) -> Union[None, Unset, str]: + def _parse_xlsx_file_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) xlsx_file_url = _parse_xlsx_file_url(d.pop("xlsx_file_url", UNSET)) diff --git a/rootly_sdk/models/on_call_pay_report_list.py b/rootly_sdk/models/on_call_pay_report_list.py index 9e48be5a..352a865d 100644 --- a/rootly_sdk/models/on_call_pay_report_list.py +++ b/rootly_sdk/models/on_call_pay_report_list.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,7 +29,7 @@ class OnCallPayReportList: data: list["OnCallPayReportListDataItem"] links: "Links" meta: "Meta" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/on_call_pay_report_response.py b/rootly_sdk/models/on_call_pay_report_response.py index 428cb766..31a0f1f0 100644 --- a/rootly_sdk/models/on_call_pay_report_response.py +++ b/rootly_sdk/models/on_call_pay_report_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,13 +23,13 @@ class OnCallPayReportResponse: """ data: "OnCallPayReportResponseData" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/on_call_role.py b/rootly_sdk/models/on_call_role.py index 7e596bbc..b5117f44 100644 --- a/rootly_sdk/models/on_call_role.py +++ b/rootly_sdk/models/on_call_role.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -143,32 +143,32 @@ class OnCallRole: name: str created_at: str updated_at: str - slug: Union[Unset, str] = UNSET - system_role: Union[Unset, str] = "custom" - alert_sources_permissions: Union[Unset, list[OnCallRoleAlertSourcesPermissionsItem]] = UNSET - alert_urgency_permissions: Union[Unset, list[OnCallRoleAlertUrgencyPermissionsItem]] = UNSET - alert_fields_permissions: Union[Unset, list[OnCallRoleAlertFieldsPermissionsItem]] = UNSET - alert_groups_permissions: Union[Unset, list[OnCallRoleAlertGroupsPermissionsItem]] = UNSET - alert_routing_rules_permissions: Union[Unset, list[OnCallRoleAlertRoutingRulesPermissionsItem]] = UNSET - on_call_readiness_report_permissions: Union[Unset, list[OnCallRoleOnCallReadinessReportPermissionsItem]] = UNSET - on_call_roles_permissions: Union[Unset, list[OnCallRoleOnCallRolesPermissionsItem]] = UNSET - alerts_permissions: Union[Unset, list[OnCallRoleAlertsPermissionsItem]] = UNSET - api_keys_permissions: Union[Unset, list[OnCallRoleApiKeysPermissionsItem]] = UNSET - audits_permissions: Union[Unset, list[OnCallRoleAuditsPermissionsItem]] = UNSET - contacts_permissions: Union[Unset, list[OnCallRoleContactsPermissionsItem]] = UNSET - escalation_policies_permissions: Union[Unset, list[OnCallRoleEscalationPoliciesPermissionsItem]] = UNSET - groups_permissions: Union[Unset, list[OnCallRoleGroupsPermissionsItem]] = UNSET - heartbeats_permissions: Union[Unset, list[OnCallRoleHeartbeatsPermissionsItem]] = UNSET - integrations_permissions: Union[Unset, list[OnCallRoleIntegrationsPermissionsItem]] = UNSET - invitations_permissions: Union[Unset, list[OnCallRoleInvitationsPermissionsItem]] = UNSET - live_call_routing_permissions: Union[Unset, list[OnCallRoleLiveCallRoutingPermissionsItem]] = UNSET - schedule_override_permissions: Union[Unset, list[OnCallRoleScheduleOverridePermissionsItem]] = UNSET - schedules_permissions: Union[Unset, list[OnCallRoleSchedulesPermissionsItem]] = UNSET - services_permissions: Union[Unset, list[OnCallRoleServicesPermissionsItem]] = UNSET - functionalities_permissions: Union[Unset, list[OnCallRoleFunctionalitiesPermissionsItem]] = UNSET - webhooks_permissions: Union[Unset, list[OnCallRoleWebhooksPermissionsItem]] = UNSET - workflows_permissions: Union[Unset, list[OnCallRoleWorkflowsPermissionsItem]] = UNSET - catalogs_permissions: Union[Unset, list[OnCallRoleCatalogsPermissionsItem]] = UNSET + slug: Unset | str = UNSET + system_role: Unset | str = "custom" + alert_sources_permissions: Unset | list[OnCallRoleAlertSourcesPermissionsItem] = UNSET + alert_urgency_permissions: Unset | list[OnCallRoleAlertUrgencyPermissionsItem] = UNSET + alert_fields_permissions: Unset | list[OnCallRoleAlertFieldsPermissionsItem] = UNSET + alert_groups_permissions: Unset | list[OnCallRoleAlertGroupsPermissionsItem] = UNSET + alert_routing_rules_permissions: Unset | list[OnCallRoleAlertRoutingRulesPermissionsItem] = UNSET + on_call_readiness_report_permissions: Unset | list[OnCallRoleOnCallReadinessReportPermissionsItem] = UNSET + on_call_roles_permissions: Unset | list[OnCallRoleOnCallRolesPermissionsItem] = UNSET + alerts_permissions: Unset | list[OnCallRoleAlertsPermissionsItem] = UNSET + api_keys_permissions: Unset | list[OnCallRoleApiKeysPermissionsItem] = UNSET + audits_permissions: Unset | list[OnCallRoleAuditsPermissionsItem] = UNSET + contacts_permissions: Unset | list[OnCallRoleContactsPermissionsItem] = UNSET + escalation_policies_permissions: Unset | list[OnCallRoleEscalationPoliciesPermissionsItem] = UNSET + groups_permissions: Unset | list[OnCallRoleGroupsPermissionsItem] = UNSET + heartbeats_permissions: Unset | list[OnCallRoleHeartbeatsPermissionsItem] = UNSET + integrations_permissions: Unset | list[OnCallRoleIntegrationsPermissionsItem] = UNSET + invitations_permissions: Unset | list[OnCallRoleInvitationsPermissionsItem] = UNSET + live_call_routing_permissions: Unset | list[OnCallRoleLiveCallRoutingPermissionsItem] = UNSET + schedule_override_permissions: Unset | list[OnCallRoleScheduleOverridePermissionsItem] = UNSET + schedules_permissions: Unset | list[OnCallRoleSchedulesPermissionsItem] = UNSET + services_permissions: Unset | list[OnCallRoleServicesPermissionsItem] = UNSET + functionalities_permissions: Unset | list[OnCallRoleFunctionalitiesPermissionsItem] = UNSET + webhooks_permissions: Unset | list[OnCallRoleWebhooksPermissionsItem] = UNSET + workflows_permissions: Unset | list[OnCallRoleWorkflowsPermissionsItem] = UNSET + catalogs_permissions: Unset | list[OnCallRoleCatalogsPermissionsItem] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -182,168 +182,168 @@ def to_dict(self) -> dict[str, Any]: system_role = self.system_role - alert_sources_permissions: Union[Unset, list[str]] = UNSET + alert_sources_permissions: Unset | list[str] = UNSET if not isinstance(self.alert_sources_permissions, Unset): alert_sources_permissions = [] for alert_sources_permissions_item_data in self.alert_sources_permissions: alert_sources_permissions_item: str = alert_sources_permissions_item_data alert_sources_permissions.append(alert_sources_permissions_item) - alert_urgency_permissions: Union[Unset, list[str]] = UNSET + alert_urgency_permissions: Unset | list[str] = UNSET if not isinstance(self.alert_urgency_permissions, Unset): alert_urgency_permissions = [] for alert_urgency_permissions_item_data in self.alert_urgency_permissions: alert_urgency_permissions_item: str = alert_urgency_permissions_item_data alert_urgency_permissions.append(alert_urgency_permissions_item) - alert_fields_permissions: Union[Unset, list[str]] = UNSET + alert_fields_permissions: Unset | list[str] = UNSET if not isinstance(self.alert_fields_permissions, Unset): alert_fields_permissions = [] for alert_fields_permissions_item_data in self.alert_fields_permissions: alert_fields_permissions_item: str = alert_fields_permissions_item_data alert_fields_permissions.append(alert_fields_permissions_item) - alert_groups_permissions: Union[Unset, list[str]] = UNSET + alert_groups_permissions: Unset | list[str] = UNSET if not isinstance(self.alert_groups_permissions, Unset): alert_groups_permissions = [] for alert_groups_permissions_item_data in self.alert_groups_permissions: alert_groups_permissions_item: str = alert_groups_permissions_item_data alert_groups_permissions.append(alert_groups_permissions_item) - alert_routing_rules_permissions: Union[Unset, list[str]] = UNSET + alert_routing_rules_permissions: Unset | list[str] = UNSET if not isinstance(self.alert_routing_rules_permissions, Unset): alert_routing_rules_permissions = [] for alert_routing_rules_permissions_item_data in self.alert_routing_rules_permissions: alert_routing_rules_permissions_item: str = alert_routing_rules_permissions_item_data alert_routing_rules_permissions.append(alert_routing_rules_permissions_item) - on_call_readiness_report_permissions: Union[Unset, list[str]] = UNSET + on_call_readiness_report_permissions: Unset | list[str] = UNSET if not isinstance(self.on_call_readiness_report_permissions, Unset): on_call_readiness_report_permissions = [] for on_call_readiness_report_permissions_item_data in self.on_call_readiness_report_permissions: on_call_readiness_report_permissions_item: str = on_call_readiness_report_permissions_item_data on_call_readiness_report_permissions.append(on_call_readiness_report_permissions_item) - on_call_roles_permissions: Union[Unset, list[str]] = UNSET + on_call_roles_permissions: Unset | list[str] = UNSET if not isinstance(self.on_call_roles_permissions, Unset): on_call_roles_permissions = [] for on_call_roles_permissions_item_data in self.on_call_roles_permissions: on_call_roles_permissions_item: str = on_call_roles_permissions_item_data on_call_roles_permissions.append(on_call_roles_permissions_item) - alerts_permissions: Union[Unset, list[str]] = UNSET + alerts_permissions: Unset | list[str] = UNSET if not isinstance(self.alerts_permissions, Unset): alerts_permissions = [] for alerts_permissions_item_data in self.alerts_permissions: alerts_permissions_item: str = alerts_permissions_item_data alerts_permissions.append(alerts_permissions_item) - api_keys_permissions: Union[Unset, list[str]] = UNSET + api_keys_permissions: Unset | list[str] = UNSET if not isinstance(self.api_keys_permissions, Unset): api_keys_permissions = [] for api_keys_permissions_item_data in self.api_keys_permissions: api_keys_permissions_item: str = api_keys_permissions_item_data api_keys_permissions.append(api_keys_permissions_item) - audits_permissions: Union[Unset, list[str]] = UNSET + audits_permissions: Unset | list[str] = UNSET if not isinstance(self.audits_permissions, Unset): audits_permissions = [] for audits_permissions_item_data in self.audits_permissions: audits_permissions_item: str = audits_permissions_item_data audits_permissions.append(audits_permissions_item) - contacts_permissions: Union[Unset, list[str]] = UNSET + contacts_permissions: Unset | list[str] = UNSET if not isinstance(self.contacts_permissions, Unset): contacts_permissions = [] for contacts_permissions_item_data in self.contacts_permissions: contacts_permissions_item: str = contacts_permissions_item_data contacts_permissions.append(contacts_permissions_item) - escalation_policies_permissions: Union[Unset, list[str]] = UNSET + escalation_policies_permissions: Unset | list[str] = UNSET if not isinstance(self.escalation_policies_permissions, Unset): escalation_policies_permissions = [] for escalation_policies_permissions_item_data in self.escalation_policies_permissions: escalation_policies_permissions_item: str = escalation_policies_permissions_item_data escalation_policies_permissions.append(escalation_policies_permissions_item) - groups_permissions: Union[Unset, list[str]] = UNSET + groups_permissions: Unset | list[str] = UNSET if not isinstance(self.groups_permissions, Unset): groups_permissions = [] for groups_permissions_item_data in self.groups_permissions: groups_permissions_item: str = groups_permissions_item_data groups_permissions.append(groups_permissions_item) - heartbeats_permissions: Union[Unset, list[str]] = UNSET + heartbeats_permissions: Unset | list[str] = UNSET if not isinstance(self.heartbeats_permissions, Unset): heartbeats_permissions = [] for heartbeats_permissions_item_data in self.heartbeats_permissions: heartbeats_permissions_item: str = heartbeats_permissions_item_data heartbeats_permissions.append(heartbeats_permissions_item) - integrations_permissions: Union[Unset, list[str]] = UNSET + integrations_permissions: Unset | list[str] = UNSET if not isinstance(self.integrations_permissions, Unset): integrations_permissions = [] for integrations_permissions_item_data in self.integrations_permissions: integrations_permissions_item: str = integrations_permissions_item_data integrations_permissions.append(integrations_permissions_item) - invitations_permissions: Union[Unset, list[str]] = UNSET + invitations_permissions: Unset | list[str] = UNSET if not isinstance(self.invitations_permissions, Unset): invitations_permissions = [] for invitations_permissions_item_data in self.invitations_permissions: invitations_permissions_item: str = invitations_permissions_item_data invitations_permissions.append(invitations_permissions_item) - live_call_routing_permissions: Union[Unset, list[str]] = UNSET + live_call_routing_permissions: Unset | list[str] = UNSET if not isinstance(self.live_call_routing_permissions, Unset): live_call_routing_permissions = [] for live_call_routing_permissions_item_data in self.live_call_routing_permissions: live_call_routing_permissions_item: str = live_call_routing_permissions_item_data live_call_routing_permissions.append(live_call_routing_permissions_item) - schedule_override_permissions: Union[Unset, list[str]] = UNSET + schedule_override_permissions: Unset | list[str] = UNSET if not isinstance(self.schedule_override_permissions, Unset): schedule_override_permissions = [] for schedule_override_permissions_item_data in self.schedule_override_permissions: schedule_override_permissions_item: str = schedule_override_permissions_item_data schedule_override_permissions.append(schedule_override_permissions_item) - schedules_permissions: Union[Unset, list[str]] = UNSET + schedules_permissions: Unset | list[str] = UNSET if not isinstance(self.schedules_permissions, Unset): schedules_permissions = [] for schedules_permissions_item_data in self.schedules_permissions: schedules_permissions_item: str = schedules_permissions_item_data schedules_permissions.append(schedules_permissions_item) - services_permissions: Union[Unset, list[str]] = UNSET + services_permissions: Unset | list[str] = UNSET if not isinstance(self.services_permissions, Unset): services_permissions = [] for services_permissions_item_data in self.services_permissions: services_permissions_item: str = services_permissions_item_data services_permissions.append(services_permissions_item) - functionalities_permissions: Union[Unset, list[str]] = UNSET + functionalities_permissions: Unset | list[str] = UNSET if not isinstance(self.functionalities_permissions, Unset): functionalities_permissions = [] for functionalities_permissions_item_data in self.functionalities_permissions: functionalities_permissions_item: str = functionalities_permissions_item_data functionalities_permissions.append(functionalities_permissions_item) - webhooks_permissions: Union[Unset, list[str]] = UNSET + webhooks_permissions: Unset | list[str] = UNSET if not isinstance(self.webhooks_permissions, Unset): webhooks_permissions = [] for webhooks_permissions_item_data in self.webhooks_permissions: webhooks_permissions_item: str = webhooks_permissions_item_data webhooks_permissions.append(webhooks_permissions_item) - workflows_permissions: Union[Unset, list[str]] = UNSET + workflows_permissions: Unset | list[str] = UNSET if not isinstance(self.workflows_permissions, Unset): workflows_permissions = [] for workflows_permissions_item_data in self.workflows_permissions: workflows_permissions_item: str = workflows_permissions_item_data workflows_permissions.append(workflows_permissions_item) - catalogs_permissions: Union[Unset, list[str]] = UNSET + catalogs_permissions: Unset | list[str] = UNSET if not isinstance(self.catalogs_permissions, Unset): catalogs_permissions = [] for catalogs_permissions_item_data in self.catalogs_permissions: diff --git a/rootly_sdk/models/on_call_role_list.py b/rootly_sdk/models/on_call_role_list.py index 473c4983..87c265c3 100644 --- a/rootly_sdk/models/on_call_role_list.py +++ b/rootly_sdk/models/on_call_role_list.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,7 +29,7 @@ class OnCallRoleList: data: list["OnCallRoleListDataItem"] links: "Links" meta: "Meta" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/on_call_role_relationship.py b/rootly_sdk/models/on_call_role_relationship.py index 72d980db..8e9f610d 100644 --- a/rootly_sdk/models/on_call_role_relationship.py +++ b/rootly_sdk/models/on_call_role_relationship.py @@ -26,7 +26,7 @@ class OnCallRoleRelationship: def to_dict(self) -> dict[str, Any]: from ..models.on_call_role_relationship_data_type_0 import OnCallRoleRelationshipDataType0 - data: Union[None, Unset, dict[str, Any]] + data: None | Unset | dict[str, Any] if isinstance(self.data, Unset): data = UNSET elif isinstance(self.data, OnCallRoleRelationshipDataType0): diff --git a/rootly_sdk/models/on_call_role_relationship_data_type_0.py b/rootly_sdk/models/on_call_role_relationship_data_type_0.py index 2ade575d..16815aea 100644 --- a/rootly_sdk/models/on_call_role_relationship_data_type_0.py +++ b/rootly_sdk/models/on_call_role_relationship_data_type_0.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,14 +21,14 @@ class OnCallRoleRelationshipDataType0: type_ (Union[Unset, OnCallRoleRelationshipDataType0Type]): """ - id: Union[Unset, str] = UNSET - type_: Union[Unset, OnCallRoleRelationshipDataType0Type] = UNSET + id: Unset | str = UNSET + type_: Unset | OnCallRoleRelationshipDataType0Type = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: id = self.id - type_: Union[Unset, str] = UNSET + type_: Unset | str = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ @@ -48,7 +48,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: id = d.pop("id", UNSET) _type_ = d.pop("type", UNSET) - type_: Union[Unset, OnCallRoleRelationshipDataType0Type] + type_: Unset | OnCallRoleRelationshipDataType0Type if isinstance(_type_, Unset): type_ = UNSET else: diff --git a/rootly_sdk/models/on_call_role_response.py b/rootly_sdk/models/on_call_role_response.py index 6920d5d2..ddca24ce 100644 --- a/rootly_sdk/models/on_call_role_response.py +++ b/rootly_sdk/models/on_call_role_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,13 +23,13 @@ class OnCallRoleResponse: """ data: "OnCallRoleResponseData" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/on_call_shadow.py b/rootly_sdk/models/on_call_shadow.py index 6148cde7..372d29f8 100644 --- a/rootly_sdk/models/on_call_shadow.py +++ b/rootly_sdk/models/on_call_shadow.py @@ -1,6 +1,6 @@ import datetime from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -32,8 +32,8 @@ class OnCallShadow: shadow_user_id: int starts_at: datetime.datetime ends_at: datetime.datetime - created_at: Union[Unset, str] = UNSET - updated_at: Union[Unset, str] = UNSET + created_at: Unset | str = UNSET + updated_at: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/on_call_shadow_response.py b/rootly_sdk/models/on_call_shadow_response.py index 1931bdbd..021e0251 100644 --- a/rootly_sdk/models/on_call_shadow_response.py +++ b/rootly_sdk/models/on_call_shadow_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,13 +23,13 @@ class OnCallShadowResponse: """ data: "OnCallShadowResponseData" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/on_call_shadows_list.py b/rootly_sdk/models/on_call_shadows_list.py index b3e47d71..936dc57b 100644 --- a/rootly_sdk/models/on_call_shadows_list.py +++ b/rootly_sdk/models/on_call_shadows_list.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,7 +29,7 @@ class OnCallShadowsList: data: list["OnCallShadowsListDataItem"] links: "Links" meta: "Meta" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/oncall.py b/rootly_sdk/models/oncall.py index 75746f3c..15574aea 100644 --- a/rootly_sdk/models/oncall.py +++ b/rootly_sdk/models/oncall.py @@ -1,6 +1,6 @@ import datetime from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -36,13 +36,13 @@ class Oncall: user_id: int starts_at: datetime.datetime ends_at: datetime.datetime - escalation_policy_path_id: Union[None, Unset, str] = UNSET - escalation_policy_path_name: Union[None, Unset, str] = UNSET - notification_type: Union[Unset, OncallNotificationType] = UNSET - is_default_path: Union[None, Unset, bool] = UNSET - escalation_level: Union[Unset, int] = UNSET - schedule_id: Union[None, Unset, str] = UNSET - schedule_name: Union[None, Unset, str] = UNSET + escalation_policy_path_id: None | Unset | str = UNSET + escalation_policy_path_name: None | Unset | str = UNSET + notification_type: Unset | OncallNotificationType = UNSET + is_default_path: None | Unset | bool = UNSET + escalation_level: Unset | int = UNSET + schedule_id: None | Unset | str = UNSET + schedule_name: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -56,23 +56,23 @@ def to_dict(self) -> dict[str, Any]: ends_at = self.ends_at.isoformat() - escalation_policy_path_id: Union[None, Unset, str] + escalation_policy_path_id: None | Unset | str if isinstance(self.escalation_policy_path_id, Unset): escalation_policy_path_id = UNSET else: escalation_policy_path_id = self.escalation_policy_path_id - escalation_policy_path_name: Union[None, Unset, str] + escalation_policy_path_name: None | Unset | str if isinstance(self.escalation_policy_path_name, Unset): escalation_policy_path_name = UNSET else: escalation_policy_path_name = self.escalation_policy_path_name - notification_type: Union[Unset, str] = UNSET + notification_type: Unset | str = UNSET if not isinstance(self.notification_type, Unset): notification_type = self.notification_type - is_default_path: Union[None, Unset, bool] + is_default_path: None | Unset | bool if isinstance(self.is_default_path, Unset): is_default_path = UNSET else: @@ -80,13 +80,13 @@ def to_dict(self) -> dict[str, Any]: escalation_level = self.escalation_level - schedule_id: Union[None, Unset, str] + schedule_id: None | Unset | str if isinstance(self.schedule_id, Unset): schedule_id = UNSET else: schedule_id = self.schedule_id - schedule_name: Union[None, Unset, str] + schedule_name: None | Unset | str if isinstance(self.schedule_name, Unset): schedule_name = UNSET else: @@ -133,57 +133,57 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: ends_at = isoparse(d.pop("ends_at")) - def _parse_escalation_policy_path_id(data: object) -> Union[None, Unset, str]: + def _parse_escalation_policy_path_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) escalation_policy_path_id = _parse_escalation_policy_path_id(d.pop("escalation_policy_path_id", UNSET)) - def _parse_escalation_policy_path_name(data: object) -> Union[None, Unset, str]: + def _parse_escalation_policy_path_name(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) escalation_policy_path_name = _parse_escalation_policy_path_name(d.pop("escalation_policy_path_name", UNSET)) _notification_type = d.pop("notification_type", UNSET) - notification_type: Union[Unset, OncallNotificationType] + notification_type: Unset | OncallNotificationType if isinstance(_notification_type, Unset): notification_type = UNSET else: notification_type = check_oncall_notification_type(_notification_type) - def _parse_is_default_path(data: object) -> Union[None, Unset, bool]: + def _parse_is_default_path(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) is_default_path = _parse_is_default_path(d.pop("is_default_path", UNSET)) escalation_level = d.pop("escalation_level", UNSET) - def _parse_schedule_id(data: object) -> Union[None, Unset, str]: + def _parse_schedule_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) schedule_id = _parse_schedule_id(d.pop("schedule_id", UNSET)) - def _parse_schedule_name(data: object) -> Union[None, Unset, str]: + def _parse_schedule_name(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) schedule_name = _parse_schedule_name(d.pop("schedule_name", UNSET)) diff --git a/rootly_sdk/models/oncall_list.py b/rootly_sdk/models/oncall_list.py index 4401d2e6..1263f2c9 100644 --- a/rootly_sdk/models/oncall_list.py +++ b/rootly_sdk/models/oncall_list.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,7 +23,7 @@ class OncallList: """ data: list["OncallListDataItem"] - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -32,7 +32,7 @@ def to_dict(self) -> dict[str, Any]: data_item = data_item_data.to_dict() data.append(data_item) - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/oncall_list_data_item.py b/rootly_sdk/models/oncall_list_data_item.py index 47296e95..2ebdd767 100644 --- a/rootly_sdk/models/oncall_list_data_item.py +++ b/rootly_sdk/models/oncall_list_data_item.py @@ -38,7 +38,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() - relationships: Union[Unset, dict[str, Any]] = UNSET + relationships: Unset | dict[str, Any] = UNSET if not isinstance(self.relationships, Unset): relationships = self.relationships.to_dict() @@ -69,7 +69,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = Oncall.from_dict(d.pop("attributes")) _relationships = d.pop("relationships", UNSET) - relationships: Union[Unset, OncallRelationships] + relationships: Unset | OncallRelationships if isinstance(_relationships, Unset): relationships = UNSET else: diff --git a/rootly_sdk/models/oncall_relationships.py b/rootly_sdk/models/oncall_relationships.py index 9ce3782b..3566df31 100644 --- a/rootly_sdk/models/oncall_relationships.py +++ b/rootly_sdk/models/oncall_relationships.py @@ -30,15 +30,15 @@ class OncallRelationships: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - user: Union[Unset, dict[str, Any]] = UNSET + user: Unset | dict[str, Any] = UNSET if not isinstance(self.user, Unset): user = self.user.to_dict() - schedule: Union[Unset, dict[str, Any]] = UNSET + schedule: Unset | dict[str, Any] = UNSET if not isinstance(self.schedule, Unset): schedule = self.schedule.to_dict() - escalation_policy: Union[Unset, dict[str, Any]] = UNSET + escalation_policy: Unset | dict[str, Any] = UNSET if not isinstance(self.escalation_policy, Unset): escalation_policy = self.escalation_policy.to_dict() @@ -62,21 +62,21 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _user = d.pop("user", UNSET) - user: Union[Unset, OncallRelationshipsUser] + user: Unset | OncallRelationshipsUser if isinstance(_user, Unset): user = UNSET else: user = OncallRelationshipsUser.from_dict(_user) _schedule = d.pop("schedule", UNSET) - schedule: Union[Unset, OncallRelationshipsSchedule] + schedule: Unset | OncallRelationshipsSchedule if isinstance(_schedule, Unset): schedule = UNSET else: schedule = OncallRelationshipsSchedule.from_dict(_schedule) _escalation_policy = d.pop("escalation_policy", UNSET) - escalation_policy: Union[Unset, OncallRelationshipsEscalationPolicy] + escalation_policy: Unset | OncallRelationshipsEscalationPolicy if isinstance(_escalation_policy, Unset): escalation_policy = UNSET else: diff --git a/rootly_sdk/models/oncall_relationships_escalation_policy.py b/rootly_sdk/models/oncall_relationships_escalation_policy.py index d780c90c..e69ff1cb 100644 --- a/rootly_sdk/models/oncall_relationships_escalation_policy.py +++ b/rootly_sdk/models/oncall_relationships_escalation_policy.py @@ -28,7 +28,7 @@ def to_dict(self) -> dict[str, Any]: OncallRelationshipsEscalationPolicyDataType0, ) - data: Union[None, Unset, dict[str, Any]] + data: None | Unset | dict[str, Any] if isinstance(self.data, Unset): data = UNSET elif isinstance(self.data, OncallRelationshipsEscalationPolicyDataType0): diff --git a/rootly_sdk/models/oncall_relationships_escalation_policy_data_type_0.py b/rootly_sdk/models/oncall_relationships_escalation_policy_data_type_0.py index 2107f220..8fd70eac 100644 --- a/rootly_sdk/models/oncall_relationships_escalation_policy_data_type_0.py +++ b/rootly_sdk/models/oncall_relationships_escalation_policy_data_type_0.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,14 +21,14 @@ class OncallRelationshipsEscalationPolicyDataType0: type_ (Union[Unset, OncallRelationshipsEscalationPolicyDataType0Type]): """ - id: Union[Unset, str] = UNSET - type_: Union[Unset, OncallRelationshipsEscalationPolicyDataType0Type] = UNSET + id: Unset | str = UNSET + type_: Unset | OncallRelationshipsEscalationPolicyDataType0Type = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: id = self.id - type_: Union[Unset, str] = UNSET + type_: Unset | str = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ @@ -48,7 +48,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: id = d.pop("id", UNSET) _type_ = d.pop("type", UNSET) - type_: Union[Unset, OncallRelationshipsEscalationPolicyDataType0Type] + type_: Unset | OncallRelationshipsEscalationPolicyDataType0Type if isinstance(_type_, Unset): type_ = UNSET else: diff --git a/rootly_sdk/models/oncall_relationships_schedule.py b/rootly_sdk/models/oncall_relationships_schedule.py index 05330719..bc122047 100644 --- a/rootly_sdk/models/oncall_relationships_schedule.py +++ b/rootly_sdk/models/oncall_relationships_schedule.py @@ -26,7 +26,7 @@ class OncallRelationshipsSchedule: def to_dict(self) -> dict[str, Any]: from ..models.oncall_relationships_schedule_data_type_0 import OncallRelationshipsScheduleDataType0 - data: Union[None, Unset, dict[str, Any]] + data: None | Unset | dict[str, Any] if isinstance(self.data, Unset): data = UNSET elif isinstance(self.data, OncallRelationshipsScheduleDataType0): diff --git a/rootly_sdk/models/oncall_relationships_schedule_data_type_0.py b/rootly_sdk/models/oncall_relationships_schedule_data_type_0.py index 583ee769..5cfe8fbc 100644 --- a/rootly_sdk/models/oncall_relationships_schedule_data_type_0.py +++ b/rootly_sdk/models/oncall_relationships_schedule_data_type_0.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,14 +21,14 @@ class OncallRelationshipsScheduleDataType0: type_ (Union[Unset, OncallRelationshipsScheduleDataType0Type]): """ - id: Union[Unset, str] = UNSET - type_: Union[Unset, OncallRelationshipsScheduleDataType0Type] = UNSET + id: Unset | str = UNSET + type_: Unset | OncallRelationshipsScheduleDataType0Type = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: id = self.id - type_: Union[Unset, str] = UNSET + type_: Unset | str = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ @@ -48,7 +48,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: id = d.pop("id", UNSET) _type_ = d.pop("type", UNSET) - type_: Union[Unset, OncallRelationshipsScheduleDataType0Type] + type_: Unset | OncallRelationshipsScheduleDataType0Type if isinstance(_type_, Unset): type_ = UNSET else: diff --git a/rootly_sdk/models/oncall_relationships_user.py b/rootly_sdk/models/oncall_relationships_user.py index 726ebef2..9d1f9b5d 100644 --- a/rootly_sdk/models/oncall_relationships_user.py +++ b/rootly_sdk/models/oncall_relationships_user.py @@ -26,7 +26,7 @@ class OncallRelationshipsUser: def to_dict(self) -> dict[str, Any]: from ..models.oncall_relationships_user_data_type_0 import OncallRelationshipsUserDataType0 - data: Union[None, Unset, dict[str, Any]] + data: None | Unset | dict[str, Any] if isinstance(self.data, Unset): data = UNSET elif isinstance(self.data, OncallRelationshipsUserDataType0): diff --git a/rootly_sdk/models/oncall_relationships_user_data_type_0.py b/rootly_sdk/models/oncall_relationships_user_data_type_0.py index a3797b4b..3771fba7 100644 --- a/rootly_sdk/models/oncall_relationships_user_data_type_0.py +++ b/rootly_sdk/models/oncall_relationships_user_data_type_0.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,14 +21,14 @@ class OncallRelationshipsUserDataType0: type_ (Union[Unset, OncallRelationshipsUserDataType0Type]): """ - id: Union[Unset, str] = UNSET - type_: Union[Unset, OncallRelationshipsUserDataType0Type] = UNSET + id: Unset | str = UNSET + type_: Unset | OncallRelationshipsUserDataType0Type = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: id = self.id - type_: Union[Unset, str] = UNSET + type_: Unset | str = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ @@ -48,7 +48,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: id = d.pop("id", UNSET) _type_ = d.pop("type", UNSET) - type_: Union[Unset, OncallRelationshipsUserDataType0Type] + type_: Unset | OncallRelationshipsUserDataType0Type if isinstance(_type_, Unset): type_ = UNSET else: diff --git a/rootly_sdk/models/override_shift.py b/rootly_sdk/models/override_shift.py index b7e1b33f..b37efd61 100644 --- a/rootly_sdk/models/override_shift.py +++ b/rootly_sdk/models/override_shift.py @@ -31,21 +31,21 @@ class OverrideShift: """ schedule_id: str - rotation_id: Union[None, str] + rotation_id: None | str starts_at: str ends_at: str is_override: bool - created_at: Union[Unset, str] = UNSET - updated_at: Union[Unset, str] = UNSET + created_at: Unset | str = UNSET + updated_at: Unset | str = UNSET shift_override: Union[Unset, "ShiftOverrideResponse"] = UNSET - user_id: Union[Unset, int] = UNSET + user_id: Unset | int = UNSET user: Union[Unset, "UserResponse"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: schedule_id = self.schedule_id - rotation_id: Union[None, str] + rotation_id: None | str rotation_id = self.rotation_id starts_at = self.starts_at @@ -58,13 +58,13 @@ def to_dict(self) -> dict[str, Any]: updated_at = self.updated_at - shift_override: Union[Unset, dict[str, Any]] = UNSET + shift_override: Unset | dict[str, Any] = UNSET if not isinstance(self.shift_override, Unset): shift_override = self.shift_override.to_dict() user_id = self.user_id - user: Union[Unset, dict[str, Any]] = UNSET + user: Unset | dict[str, Any] = UNSET if not isinstance(self.user, Unset): user = self.user.to_dict() @@ -100,10 +100,10 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) schedule_id = d.pop("schedule_id") - def _parse_rotation_id(data: object) -> Union[None, str]: + def _parse_rotation_id(data: object) -> None | str: if data is None: return data - return cast(Union[None, str], data) + return cast(None | str, data) rotation_id = _parse_rotation_id(d.pop("rotation_id")) @@ -118,7 +118,7 @@ def _parse_rotation_id(data: object) -> Union[None, str]: updated_at = d.pop("updated_at", UNSET) _shift_override = d.pop("shift_override", UNSET) - shift_override: Union[Unset, ShiftOverrideResponse] + shift_override: Unset | ShiftOverrideResponse if isinstance(_shift_override, Unset): shift_override = UNSET else: @@ -127,7 +127,7 @@ def _parse_rotation_id(data: object) -> Union[None, str]: user_id = d.pop("user_id", UNSET) _user = d.pop("user", UNSET) - user: Union[Unset, UserResponse] + user: Unset | UserResponse if isinstance(_user, Unset): user = UNSET else: diff --git a/rootly_sdk/models/override_shift_list.py b/rootly_sdk/models/override_shift_list.py index 96713f10..62db7a61 100644 --- a/rootly_sdk/models/override_shift_list.py +++ b/rootly_sdk/models/override_shift_list.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,7 +29,7 @@ class OverrideShiftList: data: list["OverrideShiftListDataItem"] links: "Links" meta: "Meta" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/override_shift_response.py b/rootly_sdk/models/override_shift_response.py index 44131cb3..9b082260 100644 --- a/rootly_sdk/models/override_shift_response.py +++ b/rootly_sdk/models/override_shift_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,13 +23,13 @@ class OverrideShiftResponse: """ data: "OverrideShiftResponseData" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/page_jsmops_on_call_responders_task_params.py b/rootly_sdk/models/page_jsmops_on_call_responders_task_params.py index e02b9715..9079ba31 100644 --- a/rootly_sdk/models/page_jsmops_on_call_responders_task_params.py +++ b/rootly_sdk/models/page_jsmops_on_call_responders_task_params.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -40,21 +40,21 @@ class PageJsmopsOnCallRespondersTaskParams: priority (Union[Unset, PageJsmopsOnCallRespondersTaskParamsPriority]): Default: 'P3'. """ - task_type: Union[Unset, PageJsmopsOnCallRespondersTaskParamsTaskType] = UNSET - title: Union[None, Unset, str] = UNSET - message: Union[Unset, str] = UNSET - description: Union[Unset, str] = UNSET - teams: Union[Unset, list["PageJsmopsOnCallRespondersTaskParamsTeamsItem"]] = UNSET - users: Union[Unset, list["PageJsmopsOnCallRespondersTaskParamsUsersItem"]] = UNSET - priority: Union[Unset, PageJsmopsOnCallRespondersTaskParamsPriority] = "P3" + task_type: Unset | PageJsmopsOnCallRespondersTaskParamsTaskType = UNSET + title: None | Unset | str = UNSET + message: Unset | str = UNSET + description: Unset | str = UNSET + teams: Unset | list["PageJsmopsOnCallRespondersTaskParamsTeamsItem"] = UNSET + users: Unset | list["PageJsmopsOnCallRespondersTaskParamsUsersItem"] = UNSET + priority: Unset | PageJsmopsOnCallRespondersTaskParamsPriority = "P3" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - title: Union[None, Unset, str] + title: None | Unset | str if isinstance(self.title, Unset): title = UNSET else: @@ -64,21 +64,21 @@ def to_dict(self) -> dict[str, Any]: description = self.description - teams: Union[Unset, list[dict[str, Any]]] = UNSET + teams: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.teams, Unset): teams = [] for teams_item_data in self.teams: teams_item = teams_item_data.to_dict() teams.append(teams_item) - users: Union[Unset, list[dict[str, Any]]] = UNSET + users: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.users, Unset): users = [] for users_item_data in self.users: users_item = users_item_data.to_dict() users.append(users_item) - priority: Union[Unset, str] = UNSET + priority: Unset | str = UNSET if not isinstance(self.priority, Unset): priority = self.priority @@ -113,18 +113,18 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, PageJsmopsOnCallRespondersTaskParamsTaskType] + task_type: Unset | PageJsmopsOnCallRespondersTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: task_type = check_page_jsmops_on_call_responders_task_params_task_type(_task_type) - def _parse_title(data: object) -> Union[None, Unset, str]: + def _parse_title(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) title = _parse_title(d.pop("title", UNSET)) @@ -147,7 +147,7 @@ def _parse_title(data: object) -> Union[None, Unset, str]: users.append(users_item) _priority = d.pop("priority", UNSET) - priority: Union[Unset, PageJsmopsOnCallRespondersTaskParamsPriority] + priority: Unset | PageJsmopsOnCallRespondersTaskParamsPriority if isinstance(_priority, Unset): priority = UNSET else: diff --git a/rootly_sdk/models/page_jsmops_on_call_responders_task_params_teams_item.py b/rootly_sdk/models/page_jsmops_on_call_responders_task_params_teams_item.py index 74fcc7a2..913616a2 100644 --- a/rootly_sdk/models/page_jsmops_on_call_responders_task_params_teams_item.py +++ b/rootly_sdk/models/page_jsmops_on_call_responders_task_params_teams_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class PageJsmopsOnCallRespondersTaskParamsTeamsItem: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/page_jsmops_on_call_responders_task_params_users_item.py b/rootly_sdk/models/page_jsmops_on_call_responders_task_params_users_item.py index 1ed78255..7b755781 100644 --- a/rootly_sdk/models/page_jsmops_on_call_responders_task_params_users_item.py +++ b/rootly_sdk/models/page_jsmops_on_call_responders_task_params_users_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class PageJsmopsOnCallRespondersTaskParamsUsersItem: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/page_opsgenie_on_call_responders_task_params.py b/rootly_sdk/models/page_opsgenie_on_call_responders_task_params.py index 9fd85ab0..ad72c711 100644 --- a/rootly_sdk/models/page_opsgenie_on_call_responders_task_params.py +++ b/rootly_sdk/models/page_opsgenie_on_call_responders_task_params.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -40,21 +40,21 @@ class PageOpsgenieOnCallRespondersTaskParams: priority (Union[Unset, PageOpsgenieOnCallRespondersTaskParamsPriority]): Default: 'P1'. """ - task_type: Union[Unset, PageOpsgenieOnCallRespondersTaskParamsTaskType] = UNSET - title: Union[None, Unset, str] = UNSET - message: Union[Unset, str] = UNSET - description: Union[Unset, str] = UNSET - teams: Union[Unset, list["PageOpsgenieOnCallRespondersTaskParamsTeamsItem"]] = UNSET - users: Union[Unset, list["PageOpsgenieOnCallRespondersTaskParamsUsersItem"]] = UNSET - priority: Union[Unset, PageOpsgenieOnCallRespondersTaskParamsPriority] = "P1" + task_type: Unset | PageOpsgenieOnCallRespondersTaskParamsTaskType = UNSET + title: None | Unset | str = UNSET + message: Unset | str = UNSET + description: Unset | str = UNSET + teams: Unset | list["PageOpsgenieOnCallRespondersTaskParamsTeamsItem"] = UNSET + users: Unset | list["PageOpsgenieOnCallRespondersTaskParamsUsersItem"] = UNSET + priority: Unset | PageOpsgenieOnCallRespondersTaskParamsPriority = "P1" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - title: Union[None, Unset, str] + title: None | Unset | str if isinstance(self.title, Unset): title = UNSET else: @@ -64,21 +64,21 @@ def to_dict(self) -> dict[str, Any]: description = self.description - teams: Union[Unset, list[dict[str, Any]]] = UNSET + teams: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.teams, Unset): teams = [] for teams_item_data in self.teams: teams_item = teams_item_data.to_dict() teams.append(teams_item) - users: Union[Unset, list[dict[str, Any]]] = UNSET + users: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.users, Unset): users = [] for users_item_data in self.users: users_item = users_item_data.to_dict() users.append(users_item) - priority: Union[Unset, str] = UNSET + priority: Unset | str = UNSET if not isinstance(self.priority, Unset): priority = self.priority @@ -113,18 +113,18 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, PageOpsgenieOnCallRespondersTaskParamsTaskType] + task_type: Unset | PageOpsgenieOnCallRespondersTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: task_type = check_page_opsgenie_on_call_responders_task_params_task_type(_task_type) - def _parse_title(data: object) -> Union[None, Unset, str]: + def _parse_title(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) title = _parse_title(d.pop("title", UNSET)) @@ -147,7 +147,7 @@ def _parse_title(data: object) -> Union[None, Unset, str]: users.append(users_item) _priority = d.pop("priority", UNSET) - priority: Union[Unset, PageOpsgenieOnCallRespondersTaskParamsPriority] + priority: Unset | PageOpsgenieOnCallRespondersTaskParamsPriority if isinstance(_priority, Unset): priority = UNSET else: diff --git a/rootly_sdk/models/page_opsgenie_on_call_responders_task_params_teams_item.py b/rootly_sdk/models/page_opsgenie_on_call_responders_task_params_teams_item.py index 9a4555d7..d60d0421 100644 --- a/rootly_sdk/models/page_opsgenie_on_call_responders_task_params_teams_item.py +++ b/rootly_sdk/models/page_opsgenie_on_call_responders_task_params_teams_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class PageOpsgenieOnCallRespondersTaskParamsTeamsItem: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/page_opsgenie_on_call_responders_task_params_users_item.py b/rootly_sdk/models/page_opsgenie_on_call_responders_task_params_users_item.py index a0cde509..7eeaf177 100644 --- a/rootly_sdk/models/page_opsgenie_on_call_responders_task_params_users_item.py +++ b/rootly_sdk/models/page_opsgenie_on_call_responders_task_params_users_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class PageOpsgenieOnCallRespondersTaskParamsUsersItem: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/page_pagerduty_on_call_responders_task_params.py b/rootly_sdk/models/page_pagerduty_on_call_responders_task_params.py index 3f8661ed..69db5e99 100644 --- a/rootly_sdk/models/page_pagerduty_on_call_responders_task_params.py +++ b/rootly_sdk/models/page_pagerduty_on_call_responders_task_params.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -49,38 +49,38 @@ class PagePagerdutyOnCallRespondersTaskParams: """ service: "PagePagerdutyOnCallRespondersTaskParamsService" - task_type: Union[Unset, PagePagerdutyOnCallRespondersTaskParamsTaskType] = UNSET - escalation_policies: Union[Unset, list["PagePagerdutyOnCallRespondersTaskParamsEscalationPoliciesItem"]] = UNSET - users: Union[Unset, list["PagePagerdutyOnCallRespondersTaskParamsUsersItem"]] = UNSET - title: Union[None, Unset, str] = UNSET - message: Union[Unset, str] = UNSET - urgency: Union[Unset, PagePagerdutyOnCallRespondersTaskParamsUrgency] = "high" - priority: Union[Unset, str] = UNSET - create_new_incident_on_conflict: Union[Unset, bool] = False + task_type: Unset | PagePagerdutyOnCallRespondersTaskParamsTaskType = UNSET + escalation_policies: Unset | list["PagePagerdutyOnCallRespondersTaskParamsEscalationPoliciesItem"] = UNSET + users: Unset | list["PagePagerdutyOnCallRespondersTaskParamsUsersItem"] = UNSET + title: None | Unset | str = UNSET + message: Unset | str = UNSET + urgency: Unset | PagePagerdutyOnCallRespondersTaskParamsUrgency = "high" + priority: Unset | str = UNSET + create_new_incident_on_conflict: Unset | bool = False additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: service = self.service.to_dict() - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - escalation_policies: Union[Unset, list[dict[str, Any]]] = UNSET + escalation_policies: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.escalation_policies, Unset): escalation_policies = [] for escalation_policies_item_data in self.escalation_policies: escalation_policies_item = escalation_policies_item_data.to_dict() escalation_policies.append(escalation_policies_item) - users: Union[Unset, list[dict[str, Any]]] = UNSET + users: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.users, Unset): users = [] for users_item_data in self.users: users_item = users_item_data.to_dict() users.append(users_item) - title: Union[None, Unset, str] + title: None | Unset | str if isinstance(self.title, Unset): title = UNSET else: @@ -88,7 +88,7 @@ def to_dict(self) -> dict[str, Any]: message = self.message - urgency: Union[Unset, str] = UNSET + urgency: Unset | str = UNSET if not isinstance(self.urgency, Unset): urgency = self.urgency @@ -138,7 +138,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: service = PagePagerdutyOnCallRespondersTaskParamsService.from_dict(d.pop("service")) _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, PagePagerdutyOnCallRespondersTaskParamsTaskType] + task_type: Unset | PagePagerdutyOnCallRespondersTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: @@ -160,19 +160,19 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: users.append(users_item) - def _parse_title(data: object) -> Union[None, Unset, str]: + def _parse_title(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) title = _parse_title(d.pop("title", UNSET)) message = d.pop("message", UNSET) _urgency = d.pop("urgency", UNSET) - urgency: Union[Unset, PagePagerdutyOnCallRespondersTaskParamsUrgency] + urgency: Unset | PagePagerdutyOnCallRespondersTaskParamsUrgency if isinstance(_urgency, Unset): urgency = UNSET else: diff --git a/rootly_sdk/models/page_pagerduty_on_call_responders_task_params_escalation_policies_item.py b/rootly_sdk/models/page_pagerduty_on_call_responders_task_params_escalation_policies_item.py index 467a5ccf..4384233c 100644 --- a/rootly_sdk/models/page_pagerduty_on_call_responders_task_params_escalation_policies_item.py +++ b/rootly_sdk/models/page_pagerduty_on_call_responders_task_params_escalation_policies_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class PagePagerdutyOnCallRespondersTaskParamsEscalationPoliciesItem: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/page_pagerduty_on_call_responders_task_params_service.py b/rootly_sdk/models/page_pagerduty_on_call_responders_task_params_service.py index 476c5091..2e52e7c6 100644 --- a/rootly_sdk/models/page_pagerduty_on_call_responders_task_params_service.py +++ b/rootly_sdk/models/page_pagerduty_on_call_responders_task_params_service.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class PagePagerdutyOnCallRespondersTaskParamsService: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/page_pagerduty_on_call_responders_task_params_users_item.py b/rootly_sdk/models/page_pagerduty_on_call_responders_task_params_users_item.py index b58945c3..1ce3b023 100644 --- a/rootly_sdk/models/page_pagerduty_on_call_responders_task_params_users_item.py +++ b/rootly_sdk/models/page_pagerduty_on_call_responders_task_params_users_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class PagePagerdutyOnCallRespondersTaskParamsUsersItem: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/page_rootly_on_call_responders_task_params.py b/rootly_sdk/models/page_rootly_on_call_responders_task_params.py index 1cbec64b..0a67bd82 100644 --- a/rootly_sdk/models/page_rootly_on_call_responders_task_params.py +++ b/rootly_sdk/models/page_rootly_on_call_responders_task_params.py @@ -51,15 +51,15 @@ class PageRootlyOnCallRespondersTaskParams: alert_urgency_id: str summary: str - task_type: Union[Unset, PageRootlyOnCallRespondersTaskParamsTaskType] = UNSET + task_type: Unset | PageRootlyOnCallRespondersTaskParamsTaskType = UNSET escalation_policy_target: Union[Unset, "PageRootlyOnCallRespondersTaskParamsEscalationPolicyTarget"] = UNSET service_target: Union[Unset, "PageRootlyOnCallRespondersTaskParamsServiceTarget"] = UNSET user_target: Union[Unset, "PageRootlyOnCallRespondersTaskParamsUserTarget"] = UNSET group_target: Union[Unset, "PageRootlyOnCallRespondersTaskParamsGroupTarget"] = UNSET functionality_target: Union[Unset, "PageRootlyOnCallRespondersTaskParamsFunctionalityTarget"] = UNSET - description: Union[Unset, str] = UNSET - escalation_note: Union[Unset, str] = UNSET - create_new_alert: Union[Unset, bool] = False + description: Unset | str = UNSET + escalation_note: Unset | str = UNSET + create_new_alert: Unset | bool = False additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -67,27 +67,27 @@ def to_dict(self) -> dict[str, Any]: summary = self.summary - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - escalation_policy_target: Union[Unset, dict[str, Any]] = UNSET + escalation_policy_target: Unset | dict[str, Any] = UNSET if not isinstance(self.escalation_policy_target, Unset): escalation_policy_target = self.escalation_policy_target.to_dict() - service_target: Union[Unset, dict[str, Any]] = UNSET + service_target: Unset | dict[str, Any] = UNSET if not isinstance(self.service_target, Unset): service_target = self.service_target.to_dict() - user_target: Union[Unset, dict[str, Any]] = UNSET + user_target: Unset | dict[str, Any] = UNSET if not isinstance(self.user_target, Unset): user_target = self.user_target.to_dict() - group_target: Union[Unset, dict[str, Any]] = UNSET + group_target: Unset | dict[str, Any] = UNSET if not isinstance(self.group_target, Unset): group_target = self.group_target.to_dict() - functionality_target: Union[Unset, dict[str, Any]] = UNSET + functionality_target: Unset | dict[str, Any] = UNSET if not isinstance(self.functionality_target, Unset): functionality_target = self.functionality_target.to_dict() @@ -150,14 +150,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: summary = d.pop("summary") _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, PageRootlyOnCallRespondersTaskParamsTaskType] + task_type: Unset | PageRootlyOnCallRespondersTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: task_type = check_page_rootly_on_call_responders_task_params_task_type(_task_type) _escalation_policy_target = d.pop("escalation_policy_target", UNSET) - escalation_policy_target: Union[Unset, PageRootlyOnCallRespondersTaskParamsEscalationPolicyTarget] + escalation_policy_target: Unset | PageRootlyOnCallRespondersTaskParamsEscalationPolicyTarget if isinstance(_escalation_policy_target, Unset): escalation_policy_target = UNSET else: @@ -166,28 +166,28 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: ) _service_target = d.pop("service_target", UNSET) - service_target: Union[Unset, PageRootlyOnCallRespondersTaskParamsServiceTarget] + service_target: Unset | PageRootlyOnCallRespondersTaskParamsServiceTarget if isinstance(_service_target, Unset): service_target = UNSET else: service_target = PageRootlyOnCallRespondersTaskParamsServiceTarget.from_dict(_service_target) _user_target = d.pop("user_target", UNSET) - user_target: Union[Unset, PageRootlyOnCallRespondersTaskParamsUserTarget] + user_target: Unset | PageRootlyOnCallRespondersTaskParamsUserTarget if isinstance(_user_target, Unset): user_target = UNSET else: user_target = PageRootlyOnCallRespondersTaskParamsUserTarget.from_dict(_user_target) _group_target = d.pop("group_target", UNSET) - group_target: Union[Unset, PageRootlyOnCallRespondersTaskParamsGroupTarget] + group_target: Unset | PageRootlyOnCallRespondersTaskParamsGroupTarget if isinstance(_group_target, Unset): group_target = UNSET else: group_target = PageRootlyOnCallRespondersTaskParamsGroupTarget.from_dict(_group_target) _functionality_target = d.pop("functionality_target", UNSET) - functionality_target: Union[Unset, PageRootlyOnCallRespondersTaskParamsFunctionalityTarget] + functionality_target: Unset | PageRootlyOnCallRespondersTaskParamsFunctionalityTarget if isinstance(_functionality_target, Unset): functionality_target = UNSET else: diff --git a/rootly_sdk/models/page_rootly_on_call_responders_task_params_escalation_policy_target.py b/rootly_sdk/models/page_rootly_on_call_responders_task_params_escalation_policy_target.py index db502e6d..8eb10f74 100644 --- a/rootly_sdk/models/page_rootly_on_call_responders_task_params_escalation_policy_target.py +++ b/rootly_sdk/models/page_rootly_on_call_responders_task_params_escalation_policy_target.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class PageRootlyOnCallRespondersTaskParamsEscalationPolicyTarget: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/page_rootly_on_call_responders_task_params_functionality_target.py b/rootly_sdk/models/page_rootly_on_call_responders_task_params_functionality_target.py index cc5b98fe..f57ba69b 100644 --- a/rootly_sdk/models/page_rootly_on_call_responders_task_params_functionality_target.py +++ b/rootly_sdk/models/page_rootly_on_call_responders_task_params_functionality_target.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class PageRootlyOnCallRespondersTaskParamsFunctionalityTarget: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/page_rootly_on_call_responders_task_params_group_target.py b/rootly_sdk/models/page_rootly_on_call_responders_task_params_group_target.py index 06fbf368..491fc701 100644 --- a/rootly_sdk/models/page_rootly_on_call_responders_task_params_group_target.py +++ b/rootly_sdk/models/page_rootly_on_call_responders_task_params_group_target.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class PageRootlyOnCallRespondersTaskParamsGroupTarget: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/page_rootly_on_call_responders_task_params_service_target.py b/rootly_sdk/models/page_rootly_on_call_responders_task_params_service_target.py index 520cbee4..c7f7fdc3 100644 --- a/rootly_sdk/models/page_rootly_on_call_responders_task_params_service_target.py +++ b/rootly_sdk/models/page_rootly_on_call_responders_task_params_service_target.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class PageRootlyOnCallRespondersTaskParamsServiceTarget: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/page_rootly_on_call_responders_task_params_user_target.py b/rootly_sdk/models/page_rootly_on_call_responders_task_params_user_target.py index 04a462a5..e66fae34 100644 --- a/rootly_sdk/models/page_rootly_on_call_responders_task_params_user_target.py +++ b/rootly_sdk/models/page_rootly_on_call_responders_task_params_user_target.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class PageRootlyOnCallRespondersTaskParamsUserTarget: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/page_victor_ops_on_call_responders_task_params_type_0_users_item.py b/rootly_sdk/models/page_victor_ops_on_call_responders_task_params_type_0_users_item.py index 755d03c9..d87c9af5 100644 --- a/rootly_sdk/models/page_victor_ops_on_call_responders_task_params_type_0_users_item.py +++ b/rootly_sdk/models/page_victor_ops_on_call_responders_task_params_type_0_users_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class PageVictorOpsOnCallRespondersTaskParamsType0UsersItem: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/page_victor_ops_on_call_responders_task_params_type_1_escalation_policies_item.py b/rootly_sdk/models/page_victor_ops_on_call_responders_task_params_type_1_escalation_policies_item.py index 87fee989..575d7525 100644 --- a/rootly_sdk/models/page_victor_ops_on_call_responders_task_params_type_1_escalation_policies_item.py +++ b/rootly_sdk/models/page_victor_ops_on_call_responders_task_params_type_1_escalation_policies_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class PageVictorOpsOnCallRespondersTaskParamsType1EscalationPoliciesItem: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/patch_alert_route_data_attributes.py b/rootly_sdk/models/patch_alert_route_data_attributes.py index 21b83a0f..7ce0b72e 100644 --- a/rootly_sdk/models/patch_alert_route_data_attributes.py +++ b/rootly_sdk/models/patch_alert_route_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from uuid import UUID from attrs import define as _attrs_define @@ -24,32 +24,32 @@ class PatchAlertRouteDataAttributes: rules (Union[Unset, list['PatchAlertRouteDataAttributesRulesItem']]): """ - name: Union[Unset, str] = UNSET - enabled: Union[Unset, bool] = UNSET - alerts_source_ids: Union[Unset, list[UUID]] = UNSET - owning_team_ids: Union[Unset, list[UUID]] = UNSET - rules: Union[Unset, list["PatchAlertRouteDataAttributesRulesItem"]] = UNSET + name: Unset | str = UNSET + enabled: Unset | bool = UNSET + alerts_source_ids: Unset | list[UUID] = UNSET + owning_team_ids: Unset | list[UUID] = UNSET + rules: Unset | list["PatchAlertRouteDataAttributesRulesItem"] = UNSET def to_dict(self) -> dict[str, Any]: name = self.name enabled = self.enabled - alerts_source_ids: Union[Unset, list[str]] = UNSET + alerts_source_ids: Unset | list[str] = UNSET if not isinstance(self.alerts_source_ids, Unset): alerts_source_ids = [] for alerts_source_ids_item_data in self.alerts_source_ids: alerts_source_ids_item = str(alerts_source_ids_item_data) alerts_source_ids.append(alerts_source_ids_item) - owning_team_ids: Union[Unset, list[str]] = UNSET + owning_team_ids: Unset | list[str] = UNSET if not isinstance(self.owning_team_ids, Unset): owning_team_ids = [] for owning_team_ids_item_data in self.owning_team_ids: owning_team_ids_item = str(owning_team_ids_item_data) owning_team_ids.append(owning_team_ids_item) - rules: Union[Unset, list[dict[str, Any]]] = UNSET + rules: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.rules, Unset): rules = [] for rules_item_data in self.rules: diff --git a/rootly_sdk/models/patch_alert_route_data_attributes_rules_item.py b/rootly_sdk/models/patch_alert_route_data_attributes_rules_item.py index 2d1a67a8..0a3db1c0 100644 --- a/rootly_sdk/models/patch_alert_route_data_attributes_rules_item.py +++ b/rootly_sdk/models/patch_alert_route_data_attributes_rules_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from uuid import UUID from attrs import define as _attrs_define @@ -32,17 +32,17 @@ class PatchAlertRouteDataAttributesRulesItem: condition_groups (Union[Unset, list['PatchAlertRouteDataAttributesRulesItemConditionGroupsItem']]): """ - id: Union[Unset, UUID] = UNSET - field_destroy: Union[Unset, bool] = UNSET - name: Union[Unset, str] = UNSET - position: Union[Unset, int] = UNSET - fallback_rule: Union[Unset, bool] = False - destinations: Union[Unset, list["PatchAlertRouteDataAttributesRulesItemDestinationsItem"]] = UNSET - condition_groups: Union[Unset, list["PatchAlertRouteDataAttributesRulesItemConditionGroupsItem"]] = UNSET + id: Unset | UUID = UNSET + field_destroy: Unset | bool = UNSET + name: Unset | str = UNSET + position: Unset | int = UNSET + fallback_rule: Unset | bool = False + destinations: Unset | list["PatchAlertRouteDataAttributesRulesItemDestinationsItem"] = UNSET + condition_groups: Unset | list["PatchAlertRouteDataAttributesRulesItemConditionGroupsItem"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id: Union[Unset, str] = UNSET + id: Unset | str = UNSET if not isinstance(self.id, Unset): id = str(self.id) @@ -54,14 +54,14 @@ def to_dict(self) -> dict[str, Any]: fallback_rule = self.fallback_rule - destinations: Union[Unset, list[dict[str, Any]]] = UNSET + destinations: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.destinations, Unset): destinations = [] for destinations_item_data in self.destinations: destinations_item = destinations_item_data.to_dict() destinations.append(destinations_item) - condition_groups: Union[Unset, list[dict[str, Any]]] = UNSET + condition_groups: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.condition_groups, Unset): condition_groups = [] for condition_groups_item_data in self.condition_groups: @@ -99,7 +99,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _id = d.pop("id", UNSET) - id: Union[Unset, UUID] + id: Unset | UUID if isinstance(_id, Unset): id = UNSET else: diff --git a/rootly_sdk/models/patch_alert_route_data_attributes_rules_item_condition_groups_item.py b/rootly_sdk/models/patch_alert_route_data_attributes_rules_item_condition_groups_item.py index 2257b8c1..e7c6bfbb 100644 --- a/rootly_sdk/models/patch_alert_route_data_attributes_rules_item_condition_groups_item.py +++ b/rootly_sdk/models/patch_alert_route_data_attributes_rules_item_condition_groups_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from uuid import UUID from attrs import define as _attrs_define @@ -27,14 +27,14 @@ class PatchAlertRouteDataAttributesRulesItemConditionGroupsItem: conditions (Union[Unset, list['PatchAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItem']]): """ - id: Union[Unset, UUID] = UNSET - field_destroy: Union[Unset, bool] = UNSET - position: Union[Unset, int] = UNSET - conditions: Union[Unset, list["PatchAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItem"]] = UNSET + id: Unset | UUID = UNSET + field_destroy: Unset | bool = UNSET + position: Unset | int = UNSET + conditions: Unset | list["PatchAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItem"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id: Union[Unset, str] = UNSET + id: Unset | str = UNSET if not isinstance(self.id, Unset): id = str(self.id) @@ -42,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: position = self.position - conditions: Union[Unset, list[dict[str, Any]]] = UNSET + conditions: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.conditions, Unset): conditions = [] for conditions_item_data in self.conditions: @@ -71,7 +71,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _id = d.pop("id", UNSET) - id: Union[Unset, UUID] + id: Unset | UUID if isinstance(_id, Unset): id = UNSET else: diff --git a/rootly_sdk/models/patch_alert_route_data_attributes_rules_item_condition_groups_item_conditions_item.py b/rootly_sdk/models/patch_alert_route_data_attributes_rules_item_condition_groups_item_conditions_item.py index a196441c..0c6a94c1 100644 --- a/rootly_sdk/models/patch_alert_route_data_attributes_rules_item_condition_groups_item_conditions_item.py +++ b/rootly_sdk/models/patch_alert_route_data_attributes_rules_item_condition_groups_item_conditions_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from uuid import UUID from attrs import define as _attrs_define @@ -42,48 +42,48 @@ class PatchAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItem: conditionable_id (Union[None, UUID, Unset]): The ID of the conditionable """ - id: Union[Unset, UUID] = UNSET - field_destroy: Union[Unset, bool] = UNSET - property_field_condition_type: Union[ - Unset, PatchAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemPropertyFieldConditionType - ] = UNSET - property_field_name: Union[Unset, str] = UNSET - property_field_type: Union[ - Unset, PatchAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemPropertyFieldType - ] = UNSET - property_field_value: Union[None, Unset, str] = UNSET - property_field_values: Union[None, Unset, list[str]] = UNSET - alert_urgency_ids: Union[None, Unset, list[str]] = UNSET - conditionable_type: Union[ - Unset, PatchAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemConditionableType - ] = UNSET - conditionable_id: Union[None, UUID, Unset] = UNSET + id: Unset | UUID = UNSET + field_destroy: Unset | bool = UNSET + property_field_condition_type: ( + Unset | PatchAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemPropertyFieldConditionType + ) = UNSET + property_field_name: Unset | str = UNSET + property_field_type: ( + Unset | PatchAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemPropertyFieldType + ) = UNSET + property_field_value: None | Unset | str = UNSET + property_field_values: None | Unset | list[str] = UNSET + alert_urgency_ids: None | Unset | list[str] = UNSET + conditionable_type: ( + Unset | PatchAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemConditionableType + ) = UNSET + conditionable_id: None | UUID | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id: Union[Unset, str] = UNSET + id: Unset | str = UNSET if not isinstance(self.id, Unset): id = str(self.id) field_destroy = self.field_destroy - property_field_condition_type: Union[Unset, str] = UNSET + property_field_condition_type: Unset | str = UNSET if not isinstance(self.property_field_condition_type, Unset): property_field_condition_type = self.property_field_condition_type property_field_name = self.property_field_name - property_field_type: Union[Unset, str] = UNSET + property_field_type: Unset | str = UNSET if not isinstance(self.property_field_type, Unset): property_field_type = self.property_field_type - property_field_value: Union[None, Unset, str] + property_field_value: None | Unset | str if isinstance(self.property_field_value, Unset): property_field_value = UNSET else: property_field_value = self.property_field_value - property_field_values: Union[None, Unset, list[str]] + property_field_values: None | Unset | list[str] if isinstance(self.property_field_values, Unset): property_field_values = UNSET elif isinstance(self.property_field_values, list): @@ -92,7 +92,7 @@ def to_dict(self) -> dict[str, Any]: else: property_field_values = self.property_field_values - alert_urgency_ids: Union[None, Unset, list[str]] + alert_urgency_ids: None | Unset | list[str] if isinstance(self.alert_urgency_ids, Unset): alert_urgency_ids = UNSET elif isinstance(self.alert_urgency_ids, list): @@ -101,11 +101,11 @@ def to_dict(self) -> dict[str, Any]: else: alert_urgency_ids = self.alert_urgency_ids - conditionable_type: Union[Unset, str] = UNSET + conditionable_type: Unset | str = UNSET if not isinstance(self.conditionable_type, Unset): conditionable_type = self.conditionable_type - conditionable_id: Union[None, Unset, str] + conditionable_id: None | Unset | str if isinstance(self.conditionable_id, Unset): conditionable_id = UNSET elif isinstance(self.conditionable_id, UUID): @@ -143,7 +143,7 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _id = d.pop("id", UNSET) - id: Union[Unset, UUID] + id: Unset | UUID if isinstance(_id, Unset): id = UNSET else: @@ -152,9 +152,9 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: field_destroy = d.pop("_destroy", UNSET) _property_field_condition_type = d.pop("property_field_condition_type", UNSET) - property_field_condition_type: Union[ - Unset, PatchAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemPropertyFieldConditionType - ] + property_field_condition_type: ( + Unset | PatchAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemPropertyFieldConditionType + ) if isinstance(_property_field_condition_type, Unset): property_field_condition_type = UNSET else: @@ -165,9 +165,9 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: property_field_name = d.pop("property_field_name", UNSET) _property_field_type = d.pop("property_field_type", UNSET) - property_field_type: Union[ - Unset, PatchAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemPropertyFieldType - ] + property_field_type: ( + Unset | PatchAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemPropertyFieldType + ) if isinstance(_property_field_type, Unset): property_field_type = UNSET else: @@ -175,16 +175,16 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: _property_field_type ) - def _parse_property_field_value(data: object) -> Union[None, Unset, str]: + def _parse_property_field_value(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) property_field_value = _parse_property_field_value(d.pop("property_field_value", UNSET)) - def _parse_property_field_values(data: object) -> Union[None, Unset, list[str]]: + def _parse_property_field_values(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -197,11 +197,11 @@ def _parse_property_field_values(data: object) -> Union[None, Unset, list[str]]: return property_field_values_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) property_field_values = _parse_property_field_values(d.pop("property_field_values", UNSET)) - def _parse_alert_urgency_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_alert_urgency_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -214,14 +214,14 @@ def _parse_alert_urgency_ids(data: object) -> Union[None, Unset, list[str]]: return alert_urgency_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) alert_urgency_ids = _parse_alert_urgency_ids(d.pop("alert_urgency_ids", UNSET)) _conditionable_type = d.pop("conditionable_type", UNSET) - conditionable_type: Union[ - Unset, PatchAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemConditionableType - ] + conditionable_type: ( + Unset | PatchAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemConditionableType + ) if isinstance(_conditionable_type, Unset): conditionable_type = UNSET else: @@ -229,7 +229,7 @@ def _parse_alert_urgency_ids(data: object) -> Union[None, Unset, list[str]]: _conditionable_type ) - def _parse_conditionable_id(data: object) -> Union[None, UUID, Unset]: + def _parse_conditionable_id(data: object) -> None | UUID | Unset: if data is None: return data if isinstance(data, Unset): @@ -242,7 +242,7 @@ def _parse_conditionable_id(data: object) -> Union[None, UUID, Unset]: return conditionable_id_type_0 except: # noqa: E722 pass - return cast(Union[None, UUID, Unset], data) + return cast(None | UUID | Unset, data) conditionable_id = _parse_conditionable_id(d.pop("conditionable_id", UNSET)) diff --git a/rootly_sdk/models/patch_alert_route_data_attributes_rules_item_destinations_item.py b/rootly_sdk/models/patch_alert_route_data_attributes_rules_item_destinations_item.py index cf1045da..f9641168 100644 --- a/rootly_sdk/models/patch_alert_route_data_attributes_rules_item_destinations_item.py +++ b/rootly_sdk/models/patch_alert_route_data_attributes_rules_item_destinations_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from uuid import UUID from attrs import define as _attrs_define @@ -25,24 +25,24 @@ class PatchAlertRouteDataAttributesRulesItemDestinationsItem: target_id (Union[Unset, UUID]): The ID of the target """ - id: Union[Unset, UUID] = UNSET - field_destroy: Union[Unset, bool] = UNSET - target_type: Union[Unset, PatchAlertRouteDataAttributesRulesItemDestinationsItemTargetType] = UNSET - target_id: Union[Unset, UUID] = UNSET + id: Unset | UUID = UNSET + field_destroy: Unset | bool = UNSET + target_type: Unset | PatchAlertRouteDataAttributesRulesItemDestinationsItemTargetType = UNSET + target_id: Unset | UUID = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id: Union[Unset, str] = UNSET + id: Unset | str = UNSET if not isinstance(self.id, Unset): id = str(self.id) field_destroy = self.field_destroy - target_type: Union[Unset, str] = UNSET + target_type: Unset | str = UNSET if not isinstance(self.target_type, Unset): target_type = self.target_type - target_id: Union[Unset, str] = UNSET + target_id: Unset | str = UNSET if not isinstance(self.target_id, Unset): target_id = str(self.target_id) @@ -64,7 +64,7 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _id = d.pop("id", UNSET) - id: Union[Unset, UUID] + id: Unset | UUID if isinstance(_id, Unset): id = UNSET else: @@ -73,14 +73,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: field_destroy = d.pop("_destroy", UNSET) _target_type = d.pop("target_type", UNSET) - target_type: Union[Unset, PatchAlertRouteDataAttributesRulesItemDestinationsItemTargetType] + target_type: Unset | PatchAlertRouteDataAttributesRulesItemDestinationsItemTargetType if isinstance(_target_type, Unset): target_type = UNSET else: target_type = check_patch_alert_route_data_attributes_rules_item_destinations_item_target_type(_target_type) _target_id = d.pop("target_id", UNSET) - target_id: Union[Unset, UUID] + target_id: Unset | UUID if isinstance(_target_id, Unset): target_id = UNSET else: diff --git a/rootly_sdk/models/phone_verification_response.py b/rootly_sdk/models/phone_verification_response.py index dfc508cd..f04e1cf3 100644 --- a/rootly_sdk/models/phone_verification_response.py +++ b/rootly_sdk/models/phone_verification_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class PhoneVerificationResponse: error (Union[Unset, str]): Error message """ - message: Union[Unset, str] = UNSET - error: Union[Unset, str] = UNSET + message: Unset | str = UNSET + error: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/playbook.py b/rootly_sdk/models/playbook.py index c2ff44fd..a2d1dac4 100644 --- a/rootly_sdk/models/playbook.py +++ b/rootly_sdk/models/playbook.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,14 +29,14 @@ class Playbook: title: str created_at: str updated_at: str - summary: Union[None, Unset, str] = UNSET - external_url: Union[None, Unset, str] = UNSET - severity_ids: Union[None, Unset, list[str]] = UNSET - environment_ids: Union[None, Unset, list[str]] = UNSET - functionality_ids: Union[None, Unset, list[str]] = UNSET - service_ids: Union[None, Unset, list[str]] = UNSET - group_ids: Union[None, Unset, list[str]] = UNSET - incident_type_ids: Union[None, Unset, list[str]] = UNSET + summary: None | Unset | str = UNSET + external_url: None | Unset | str = UNSET + severity_ids: None | Unset | list[str] = UNSET + environment_ids: None | Unset | list[str] = UNSET + functionality_ids: None | Unset | list[str] = UNSET + service_ids: None | Unset | list[str] = UNSET + group_ids: None | Unset | list[str] = UNSET + incident_type_ids: None | Unset | list[str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -46,19 +46,19 @@ def to_dict(self) -> dict[str, Any]: updated_at = self.updated_at - summary: Union[None, Unset, str] + summary: None | Unset | str if isinstance(self.summary, Unset): summary = UNSET else: summary = self.summary - external_url: Union[None, Unset, str] + external_url: None | Unset | str if isinstance(self.external_url, Unset): external_url = UNSET else: external_url = self.external_url - severity_ids: Union[None, Unset, list[str]] + severity_ids: None | Unset | list[str] if isinstance(self.severity_ids, Unset): severity_ids = UNSET elif isinstance(self.severity_ids, list): @@ -67,7 +67,7 @@ def to_dict(self) -> dict[str, Any]: else: severity_ids = self.severity_ids - environment_ids: Union[None, Unset, list[str]] + environment_ids: None | Unset | list[str] if isinstance(self.environment_ids, Unset): environment_ids = UNSET elif isinstance(self.environment_ids, list): @@ -76,7 +76,7 @@ def to_dict(self) -> dict[str, Any]: else: environment_ids = self.environment_ids - functionality_ids: Union[None, Unset, list[str]] + functionality_ids: None | Unset | list[str] if isinstance(self.functionality_ids, Unset): functionality_ids = UNSET elif isinstance(self.functionality_ids, list): @@ -85,7 +85,7 @@ def to_dict(self) -> dict[str, Any]: else: functionality_ids = self.functionality_ids - service_ids: Union[None, Unset, list[str]] + service_ids: None | Unset | list[str] if isinstance(self.service_ids, Unset): service_ids = UNSET elif isinstance(self.service_ids, list): @@ -94,7 +94,7 @@ def to_dict(self) -> dict[str, Any]: else: service_ids = self.service_ids - group_ids: Union[None, Unset, list[str]] + group_ids: None | Unset | list[str] if isinstance(self.group_ids, Unset): group_ids = UNSET elif isinstance(self.group_ids, list): @@ -103,7 +103,7 @@ def to_dict(self) -> dict[str, Any]: else: group_ids = self.group_ids - incident_type_ids: Union[None, Unset, list[str]] + incident_type_ids: None | Unset | list[str] if isinstance(self.incident_type_ids, Unset): incident_type_ids = UNSET elif isinstance(self.incident_type_ids, list): @@ -149,25 +149,25 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: updated_at = d.pop("updated_at") - def _parse_summary(data: object) -> Union[None, Unset, str]: + def _parse_summary(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) summary = _parse_summary(d.pop("summary", UNSET)) - def _parse_external_url(data: object) -> Union[None, Unset, str]: + def _parse_external_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) external_url = _parse_external_url(d.pop("external_url", UNSET)) - def _parse_severity_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_severity_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -180,11 +180,11 @@ def _parse_severity_ids(data: object) -> Union[None, Unset, list[str]]: return severity_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) severity_ids = _parse_severity_ids(d.pop("severity_ids", UNSET)) - def _parse_environment_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_environment_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -197,11 +197,11 @@ def _parse_environment_ids(data: object) -> Union[None, Unset, list[str]]: return environment_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) environment_ids = _parse_environment_ids(d.pop("environment_ids", UNSET)) - def _parse_functionality_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_functionality_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -214,11 +214,11 @@ def _parse_functionality_ids(data: object) -> Union[None, Unset, list[str]]: return functionality_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) functionality_ids = _parse_functionality_ids(d.pop("functionality_ids", UNSET)) - def _parse_service_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_service_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -231,11 +231,11 @@ def _parse_service_ids(data: object) -> Union[None, Unset, list[str]]: return service_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) service_ids = _parse_service_ids(d.pop("service_ids", UNSET)) - def _parse_group_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_group_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -248,11 +248,11 @@ def _parse_group_ids(data: object) -> Union[None, Unset, list[str]]: return group_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) group_ids = _parse_group_ids(d.pop("group_ids", UNSET)) - def _parse_incident_type_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_incident_type_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -265,7 +265,7 @@ def _parse_incident_type_ids(data: object) -> Union[None, Unset, list[str]]: return incident_type_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) incident_type_ids = _parse_incident_type_ids(d.pop("incident_type_ids", UNSET)) diff --git a/rootly_sdk/models/playbook_list.py b/rootly_sdk/models/playbook_list.py index 6ac76719..9c4e42b7 100644 --- a/rootly_sdk/models/playbook_list.py +++ b/rootly_sdk/models/playbook_list.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,7 +29,7 @@ class PlaybookList: data: list["PlaybookListDataItem"] links: "Links" meta: "Meta" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/playbook_response.py b/rootly_sdk/models/playbook_response.py index 09ddbadf..55dcfd53 100644 --- a/rootly_sdk/models/playbook_response.py +++ b/rootly_sdk/models/playbook_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,13 +23,13 @@ class PlaybookResponse: """ data: "PlaybookResponseData" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/playbook_task.py b/rootly_sdk/models/playbook_task.py index 92ded9d0..3aad84ad 100644 --- a/rootly_sdk/models/playbook_task.py +++ b/rootly_sdk/models/playbook_task.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -24,9 +24,9 @@ class PlaybookTask: task: str created_at: str updated_at: str - playbook_id: Union[Unset, str] = UNSET - description: Union[None, Unset, str] = UNSET - position: Union[None, Unset, int] = UNSET + playbook_id: Unset | str = UNSET + description: None | Unset | str = UNSET + position: None | Unset | int = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -38,13 +38,13 @@ def to_dict(self) -> dict[str, Any]: playbook_id = self.playbook_id - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - position: Union[None, Unset, int] + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: @@ -79,21 +79,21 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: playbook_id = d.pop("playbook_id", UNSET) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_position(data: object) -> Union[None, Unset, int]: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) diff --git a/rootly_sdk/models/playbook_task_list.py b/rootly_sdk/models/playbook_task_list.py index 9ccef753..e93328d3 100644 --- a/rootly_sdk/models/playbook_task_list.py +++ b/rootly_sdk/models/playbook_task_list.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,7 +29,7 @@ class PlaybookTaskList: data: list["PlaybookTaskListDataItem"] links: "Links" meta: "Meta" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/playbook_task_response.py b/rootly_sdk/models/playbook_task_response.py index 6ac98183..7ce3df22 100644 --- a/rootly_sdk/models/playbook_task_response.py +++ b/rootly_sdk/models/playbook_task_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,13 +23,13 @@ class PlaybookTaskResponse: """ data: "PlaybookTaskResponseData" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/post_mortem_template.py b/rootly_sdk/models/post_mortem_template.py index 568536a6..48bfd505 100644 --- a/rootly_sdk/models/post_mortem_template.py +++ b/rootly_sdk/models/post_mortem_template.py @@ -34,12 +34,12 @@ class PostMortemTemplate: name: str created_at: str updated_at: str - slug: Union[Unset, str] = UNSET - default: Union[None, Unset, bool] = UNSET - content: Union[Unset, str] = UNSET - content_html: Union[None, Unset, str] = UNSET + slug: Unset | str = UNSET + default: None | Unset | bool = UNSET + content: Unset | str = UNSET + content_html: None | Unset | str = UNSET content_json: Union["PostMortemTemplateContentJsonType0", None, Unset] = UNSET - format_: Union[Unset, PostMortemTemplateFormat] = UNSET + format_: Unset | PostMortemTemplateFormat = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -53,7 +53,7 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - default: Union[None, Unset, bool] + default: None | Unset | bool if isinstance(self.default, Unset): default = UNSET else: @@ -61,13 +61,13 @@ def to_dict(self) -> dict[str, Any]: content = self.content - content_html: Union[None, Unset, str] + content_html: None | Unset | str if isinstance(self.content_html, Unset): content_html = UNSET else: content_html = self.content_html - content_json: Union[None, Unset, dict[str, Any]] + content_json: None | Unset | dict[str, Any] if isinstance(self.content_json, Unset): content_json = UNSET elif isinstance(self.content_json, PostMortemTemplateContentJsonType0): @@ -75,7 +75,7 @@ def to_dict(self) -> dict[str, Any]: else: content_json = self.content_json - format_: Union[Unset, str] = UNSET + format_: Unset | str = UNSET if not isinstance(self.format_, Unset): format_ = self.format_ @@ -116,23 +116,23 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: slug = d.pop("slug", UNSET) - def _parse_default(data: object) -> Union[None, Unset, bool]: + def _parse_default(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) default = _parse_default(d.pop("default", UNSET)) content = d.pop("content", UNSET) - def _parse_content_html(data: object) -> Union[None, Unset, str]: + def _parse_content_html(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) content_html = _parse_content_html(d.pop("content_html", UNSET)) @@ -154,7 +154,7 @@ def _parse_content_json(data: object) -> Union["PostMortemTemplateContentJsonTyp content_json = _parse_content_json(d.pop("content_json", UNSET)) _format_ = d.pop("format", UNSET) - format_: Union[Unset, PostMortemTemplateFormat] + format_: Unset | PostMortemTemplateFormat if isinstance(_format_, Unset): format_ = UNSET else: diff --git a/rootly_sdk/models/post_mortem_template_list.py b/rootly_sdk/models/post_mortem_template_list.py index 954c2436..d8515f04 100644 --- a/rootly_sdk/models/post_mortem_template_list.py +++ b/rootly_sdk/models/post_mortem_template_list.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,7 +29,7 @@ class PostMortemTemplateList: data: list["PostMortemTemplateListDataItem"] links: "Links" meta: "Meta" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/post_mortem_template_response.py b/rootly_sdk/models/post_mortem_template_response.py index 7cb5b4db..fe5da9dd 100644 --- a/rootly_sdk/models/post_mortem_template_response.py +++ b/rootly_sdk/models/post_mortem_template_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,13 +23,13 @@ class PostMortemTemplateResponse: """ data: "PostMortemTemplateResponseData" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/post_mortem_trigger_params.py b/rootly_sdk/models/post_mortem_trigger_params.py index 5e90bbe2..0abd7368 100644 --- a/rootly_sdk/models/post_mortem_trigger_params.py +++ b/rootly_sdk/models/post_mortem_trigger_params.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -169,176 +169,174 @@ class PostMortemTriggerParams: """ trigger_type: PostMortemTriggerParamsTriggerType - triggers: Union[Unset, list[str]] = UNSET - incident_visibilities: Union[Unset, list[bool]] = UNSET - incident_kinds: Union[Unset, list[PostMortemTriggerParamsIncidentKindsItem]] = UNSET - incident_statuses: Union[Unset, list[PostMortemTriggerParamsIncidentStatusesItem]] = UNSET - incident_inactivity_duration: Union[None, Unset, str] = UNSET - incident_condition: Union[Unset, PostMortemTriggerParamsIncidentCondition] = "ALL" - incident_condition_visibility: Union[Unset, PostMortemTriggerParamsIncidentConditionVisibility] = "ANY" - incident_condition_kind: Union[Unset, PostMortemTriggerParamsIncidentConditionKind] = "IS" - incident_condition_status: Union[Unset, PostMortemTriggerParamsIncidentConditionStatus] = "ANY" - incident_condition_sub_status: Union[Unset, PostMortemTriggerParamsIncidentConditionSubStatus] = "ANY" - incident_condition_environment: Union[Unset, PostMortemTriggerParamsIncidentConditionEnvironment] = "ANY" - incident_condition_severity: Union[Unset, PostMortemTriggerParamsIncidentConditionSeverity] = "ANY" - incident_condition_incident_type: Union[Unset, PostMortemTriggerParamsIncidentConditionIncidentType] = "ANY" - incident_condition_incident_roles: Union[Unset, PostMortemTriggerParamsIncidentConditionIncidentRoles] = "ANY" - incident_condition_service: Union[Unset, PostMortemTriggerParamsIncidentConditionService] = "ANY" - incident_condition_functionality: Union[Unset, PostMortemTriggerParamsIncidentConditionFunctionality] = "ANY" - incident_condition_group: Union[Unset, PostMortemTriggerParamsIncidentConditionGroup] = "ANY" - incident_condition_cause: Union[Unset, PostMortemTriggerParamsIncidentConditionCause] = "ANY" - incident_condition_label: Union[Unset, PostMortemTriggerParamsIncidentConditionLabel] = "ANY" - incident_condition_label_use_regexp: Union[Unset, bool] = False - incident_labels: Union[Unset, list[str]] = UNSET - incident_post_mortem_condition_cause: Union[Unset, PostMortemTriggerParamsIncidentPostMortemConditionCause] = "ANY" - incident_condition_summary: Union[Unset, PostMortemTriggerParamsIncidentConditionSummary] = UNSET - incident_condition_started_at: Union[Unset, PostMortemTriggerParamsIncidentConditionStartedAt] = UNSET - incident_condition_detected_at: Union[Unset, PostMortemTriggerParamsIncidentConditionDetectedAt] = UNSET - incident_condition_acknowledged_at: Union[Unset, PostMortemTriggerParamsIncidentConditionAcknowledgedAt] = UNSET - incident_condition_mitigated_at: Union[Unset, PostMortemTriggerParamsIncidentConditionMitigatedAt] = UNSET - incident_condition_resolved_at: Union[Unset, PostMortemTriggerParamsIncidentConditionResolvedAt] = UNSET - incident_conditional_inactivity: Union[Unset, PostMortemTriggerParamsIncidentConditionalInactivity] = UNSET - incident_post_mortem_condition: Union[Unset, PostMortemTriggerParamsIncidentPostMortemCondition] = UNSET - incident_post_mortem_condition_status: Union[Unset, PostMortemTriggerParamsIncidentPostMortemConditionStatus] = ( - "ANY" - ) - incident_post_mortem_statuses: Union[Unset, list[PostMortemTriggerParamsIncidentPostMortemStatusesItem]] = UNSET + triggers: Unset | list[str] = UNSET + incident_visibilities: Unset | list[bool] = UNSET + incident_kinds: Unset | list[PostMortemTriggerParamsIncidentKindsItem] = UNSET + incident_statuses: Unset | list[PostMortemTriggerParamsIncidentStatusesItem] = UNSET + incident_inactivity_duration: None | Unset | str = UNSET + incident_condition: Unset | PostMortemTriggerParamsIncidentCondition = "ALL" + incident_condition_visibility: Unset | PostMortemTriggerParamsIncidentConditionVisibility = "ANY" + incident_condition_kind: Unset | PostMortemTriggerParamsIncidentConditionKind = "IS" + incident_condition_status: Unset | PostMortemTriggerParamsIncidentConditionStatus = "ANY" + incident_condition_sub_status: Unset | PostMortemTriggerParamsIncidentConditionSubStatus = "ANY" + incident_condition_environment: Unset | PostMortemTriggerParamsIncidentConditionEnvironment = "ANY" + incident_condition_severity: Unset | PostMortemTriggerParamsIncidentConditionSeverity = "ANY" + incident_condition_incident_type: Unset | PostMortemTriggerParamsIncidentConditionIncidentType = "ANY" + incident_condition_incident_roles: Unset | PostMortemTriggerParamsIncidentConditionIncidentRoles = "ANY" + incident_condition_service: Unset | PostMortemTriggerParamsIncidentConditionService = "ANY" + incident_condition_functionality: Unset | PostMortemTriggerParamsIncidentConditionFunctionality = "ANY" + incident_condition_group: Unset | PostMortemTriggerParamsIncidentConditionGroup = "ANY" + incident_condition_cause: Unset | PostMortemTriggerParamsIncidentConditionCause = "ANY" + incident_condition_label: Unset | PostMortemTriggerParamsIncidentConditionLabel = "ANY" + incident_condition_label_use_regexp: Unset | bool = False + incident_labels: Unset | list[str] = UNSET + incident_post_mortem_condition_cause: Unset | PostMortemTriggerParamsIncidentPostMortemConditionCause = "ANY" + incident_condition_summary: Unset | PostMortemTriggerParamsIncidentConditionSummary = UNSET + incident_condition_started_at: Unset | PostMortemTriggerParamsIncidentConditionStartedAt = UNSET + incident_condition_detected_at: Unset | PostMortemTriggerParamsIncidentConditionDetectedAt = UNSET + incident_condition_acknowledged_at: Unset | PostMortemTriggerParamsIncidentConditionAcknowledgedAt = UNSET + incident_condition_mitigated_at: Unset | PostMortemTriggerParamsIncidentConditionMitigatedAt = UNSET + incident_condition_resolved_at: Unset | PostMortemTriggerParamsIncidentConditionResolvedAt = UNSET + incident_conditional_inactivity: Unset | PostMortemTriggerParamsIncidentConditionalInactivity = UNSET + incident_post_mortem_condition: Unset | PostMortemTriggerParamsIncidentPostMortemCondition = UNSET + incident_post_mortem_condition_status: Unset | PostMortemTriggerParamsIncidentPostMortemConditionStatus = "ANY" + incident_post_mortem_statuses: Unset | list[PostMortemTriggerParamsIncidentPostMortemStatusesItem] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: trigger_type: str = self.trigger_type - triggers: Union[Unset, list[str]] = UNSET + triggers: Unset | list[str] = UNSET if not isinstance(self.triggers, Unset): triggers = self.triggers - incident_visibilities: Union[Unset, list[bool]] = UNSET + incident_visibilities: Unset | list[bool] = UNSET if not isinstance(self.incident_visibilities, Unset): incident_visibilities = self.incident_visibilities - incident_kinds: Union[Unset, list[str]] = UNSET + incident_kinds: Unset | list[str] = UNSET if not isinstance(self.incident_kinds, Unset): incident_kinds = [] for incident_kinds_item_data in self.incident_kinds: incident_kinds_item: str = incident_kinds_item_data incident_kinds.append(incident_kinds_item) - incident_statuses: Union[Unset, list[str]] = UNSET + incident_statuses: Unset | list[str] = UNSET if not isinstance(self.incident_statuses, Unset): incident_statuses = [] for incident_statuses_item_data in self.incident_statuses: incident_statuses_item: str = incident_statuses_item_data incident_statuses.append(incident_statuses_item) - incident_inactivity_duration: Union[None, Unset, str] + incident_inactivity_duration: None | Unset | str if isinstance(self.incident_inactivity_duration, Unset): incident_inactivity_duration = UNSET else: incident_inactivity_duration = self.incident_inactivity_duration - incident_condition: Union[Unset, str] = UNSET + incident_condition: Unset | str = UNSET if not isinstance(self.incident_condition, Unset): incident_condition = self.incident_condition - incident_condition_visibility: Union[Unset, str] = UNSET + incident_condition_visibility: Unset | str = UNSET if not isinstance(self.incident_condition_visibility, Unset): incident_condition_visibility = self.incident_condition_visibility - incident_condition_kind: Union[Unset, str] = UNSET + incident_condition_kind: Unset | str = UNSET if not isinstance(self.incident_condition_kind, Unset): incident_condition_kind = self.incident_condition_kind - incident_condition_status: Union[Unset, str] = UNSET + incident_condition_status: Unset | str = UNSET if not isinstance(self.incident_condition_status, Unset): incident_condition_status = self.incident_condition_status - incident_condition_sub_status: Union[Unset, str] = UNSET + incident_condition_sub_status: Unset | str = UNSET if not isinstance(self.incident_condition_sub_status, Unset): incident_condition_sub_status = self.incident_condition_sub_status - incident_condition_environment: Union[Unset, str] = UNSET + incident_condition_environment: Unset | str = UNSET if not isinstance(self.incident_condition_environment, Unset): incident_condition_environment = self.incident_condition_environment - incident_condition_severity: Union[Unset, str] = UNSET + incident_condition_severity: Unset | str = UNSET if not isinstance(self.incident_condition_severity, Unset): incident_condition_severity = self.incident_condition_severity - incident_condition_incident_type: Union[Unset, str] = UNSET + incident_condition_incident_type: Unset | str = UNSET if not isinstance(self.incident_condition_incident_type, Unset): incident_condition_incident_type = self.incident_condition_incident_type - incident_condition_incident_roles: Union[Unset, str] = UNSET + incident_condition_incident_roles: Unset | str = UNSET if not isinstance(self.incident_condition_incident_roles, Unset): incident_condition_incident_roles = self.incident_condition_incident_roles - incident_condition_service: Union[Unset, str] = UNSET + incident_condition_service: Unset | str = UNSET if not isinstance(self.incident_condition_service, Unset): incident_condition_service = self.incident_condition_service - incident_condition_functionality: Union[Unset, str] = UNSET + incident_condition_functionality: Unset | str = UNSET if not isinstance(self.incident_condition_functionality, Unset): incident_condition_functionality = self.incident_condition_functionality - incident_condition_group: Union[Unset, str] = UNSET + incident_condition_group: Unset | str = UNSET if not isinstance(self.incident_condition_group, Unset): incident_condition_group = self.incident_condition_group - incident_condition_cause: Union[Unset, str] = UNSET + incident_condition_cause: Unset | str = UNSET if not isinstance(self.incident_condition_cause, Unset): incident_condition_cause = self.incident_condition_cause - incident_condition_label: Union[Unset, str] = UNSET + incident_condition_label: Unset | str = UNSET if not isinstance(self.incident_condition_label, Unset): incident_condition_label = self.incident_condition_label incident_condition_label_use_regexp = self.incident_condition_label_use_regexp - incident_labels: Union[Unset, list[str]] = UNSET + incident_labels: Unset | list[str] = UNSET if not isinstance(self.incident_labels, Unset): incident_labels = self.incident_labels - incident_post_mortem_condition_cause: Union[Unset, str] = UNSET + incident_post_mortem_condition_cause: Unset | str = UNSET if not isinstance(self.incident_post_mortem_condition_cause, Unset): incident_post_mortem_condition_cause = self.incident_post_mortem_condition_cause - incident_condition_summary: Union[Unset, str] = UNSET + incident_condition_summary: Unset | str = UNSET if not isinstance(self.incident_condition_summary, Unset): incident_condition_summary = self.incident_condition_summary - incident_condition_started_at: Union[Unset, str] = UNSET + incident_condition_started_at: Unset | str = UNSET if not isinstance(self.incident_condition_started_at, Unset): incident_condition_started_at = self.incident_condition_started_at - incident_condition_detected_at: Union[Unset, str] = UNSET + incident_condition_detected_at: Unset | str = UNSET if not isinstance(self.incident_condition_detected_at, Unset): incident_condition_detected_at = self.incident_condition_detected_at - incident_condition_acknowledged_at: Union[Unset, str] = UNSET + incident_condition_acknowledged_at: Unset | str = UNSET if not isinstance(self.incident_condition_acknowledged_at, Unset): incident_condition_acknowledged_at = self.incident_condition_acknowledged_at - incident_condition_mitigated_at: Union[Unset, str] = UNSET + incident_condition_mitigated_at: Unset | str = UNSET if not isinstance(self.incident_condition_mitigated_at, Unset): incident_condition_mitigated_at = self.incident_condition_mitigated_at - incident_condition_resolved_at: Union[Unset, str] = UNSET + incident_condition_resolved_at: Unset | str = UNSET if not isinstance(self.incident_condition_resolved_at, Unset): incident_condition_resolved_at = self.incident_condition_resolved_at - incident_conditional_inactivity: Union[Unset, str] = UNSET + incident_conditional_inactivity: Unset | str = UNSET if not isinstance(self.incident_conditional_inactivity, Unset): incident_conditional_inactivity = self.incident_conditional_inactivity - incident_post_mortem_condition: Union[Unset, str] = UNSET + incident_post_mortem_condition: Unset | str = UNSET if not isinstance(self.incident_post_mortem_condition, Unset): incident_post_mortem_condition = self.incident_post_mortem_condition - incident_post_mortem_condition_status: Union[Unset, str] = UNSET + incident_post_mortem_condition_status: Unset | str = UNSET if not isinstance(self.incident_post_mortem_condition_status, Unset): incident_post_mortem_condition_status = self.incident_post_mortem_condition_status - incident_post_mortem_statuses: Union[Unset, list[str]] = UNSET + incident_post_mortem_statuses: Unset | list[str] = UNSET if not isinstance(self.incident_post_mortem_statuses, Unset): incident_post_mortem_statuses = [] for incident_post_mortem_statuses_item_data in self.incident_post_mortem_statuses: @@ -444,24 +442,24 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: incident_statuses.append(incident_statuses_item) - def _parse_incident_inactivity_duration(data: object) -> Union[None, Unset, str]: + def _parse_incident_inactivity_duration(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) incident_inactivity_duration = _parse_incident_inactivity_duration(d.pop("incident_inactivity_duration", UNSET)) _incident_condition = d.pop("incident_condition", UNSET) - incident_condition: Union[Unset, PostMortemTriggerParamsIncidentCondition] + incident_condition: Unset | PostMortemTriggerParamsIncidentCondition if isinstance(_incident_condition, Unset): incident_condition = UNSET else: incident_condition = check_post_mortem_trigger_params_incident_condition(_incident_condition) _incident_condition_visibility = d.pop("incident_condition_visibility", UNSET) - incident_condition_visibility: Union[Unset, PostMortemTriggerParamsIncidentConditionVisibility] + incident_condition_visibility: Unset | PostMortemTriggerParamsIncidentConditionVisibility if isinstance(_incident_condition_visibility, Unset): incident_condition_visibility = UNSET else: @@ -470,14 +468,14 @@ def _parse_incident_inactivity_duration(data: object) -> Union[None, Unset, str] ) _incident_condition_kind = d.pop("incident_condition_kind", UNSET) - incident_condition_kind: Union[Unset, PostMortemTriggerParamsIncidentConditionKind] + incident_condition_kind: Unset | PostMortemTriggerParamsIncidentConditionKind if isinstance(_incident_condition_kind, Unset): incident_condition_kind = UNSET else: incident_condition_kind = check_post_mortem_trigger_params_incident_condition_kind(_incident_condition_kind) _incident_condition_status = d.pop("incident_condition_status", UNSET) - incident_condition_status: Union[Unset, PostMortemTriggerParamsIncidentConditionStatus] + incident_condition_status: Unset | PostMortemTriggerParamsIncidentConditionStatus if isinstance(_incident_condition_status, Unset): incident_condition_status = UNSET else: @@ -486,7 +484,7 @@ def _parse_incident_inactivity_duration(data: object) -> Union[None, Unset, str] ) _incident_condition_sub_status = d.pop("incident_condition_sub_status", UNSET) - incident_condition_sub_status: Union[Unset, PostMortemTriggerParamsIncidentConditionSubStatus] + incident_condition_sub_status: Unset | PostMortemTriggerParamsIncidentConditionSubStatus if isinstance(_incident_condition_sub_status, Unset): incident_condition_sub_status = UNSET else: @@ -495,7 +493,7 @@ def _parse_incident_inactivity_duration(data: object) -> Union[None, Unset, str] ) _incident_condition_environment = d.pop("incident_condition_environment", UNSET) - incident_condition_environment: Union[Unset, PostMortemTriggerParamsIncidentConditionEnvironment] + incident_condition_environment: Unset | PostMortemTriggerParamsIncidentConditionEnvironment if isinstance(_incident_condition_environment, Unset): incident_condition_environment = UNSET else: @@ -504,7 +502,7 @@ def _parse_incident_inactivity_duration(data: object) -> Union[None, Unset, str] ) _incident_condition_severity = d.pop("incident_condition_severity", UNSET) - incident_condition_severity: Union[Unset, PostMortemTriggerParamsIncidentConditionSeverity] + incident_condition_severity: Unset | PostMortemTriggerParamsIncidentConditionSeverity if isinstance(_incident_condition_severity, Unset): incident_condition_severity = UNSET else: @@ -513,7 +511,7 @@ def _parse_incident_inactivity_duration(data: object) -> Union[None, Unset, str] ) _incident_condition_incident_type = d.pop("incident_condition_incident_type", UNSET) - incident_condition_incident_type: Union[Unset, PostMortemTriggerParamsIncidentConditionIncidentType] + incident_condition_incident_type: Unset | PostMortemTriggerParamsIncidentConditionIncidentType if isinstance(_incident_condition_incident_type, Unset): incident_condition_incident_type = UNSET else: @@ -522,7 +520,7 @@ def _parse_incident_inactivity_duration(data: object) -> Union[None, Unset, str] ) _incident_condition_incident_roles = d.pop("incident_condition_incident_roles", UNSET) - incident_condition_incident_roles: Union[Unset, PostMortemTriggerParamsIncidentConditionIncidentRoles] + incident_condition_incident_roles: Unset | PostMortemTriggerParamsIncidentConditionIncidentRoles if isinstance(_incident_condition_incident_roles, Unset): incident_condition_incident_roles = UNSET else: @@ -531,7 +529,7 @@ def _parse_incident_inactivity_duration(data: object) -> Union[None, Unset, str] ) _incident_condition_service = d.pop("incident_condition_service", UNSET) - incident_condition_service: Union[Unset, PostMortemTriggerParamsIncidentConditionService] + incident_condition_service: Unset | PostMortemTriggerParamsIncidentConditionService if isinstance(_incident_condition_service, Unset): incident_condition_service = UNSET else: @@ -540,7 +538,7 @@ def _parse_incident_inactivity_duration(data: object) -> Union[None, Unset, str] ) _incident_condition_functionality = d.pop("incident_condition_functionality", UNSET) - incident_condition_functionality: Union[Unset, PostMortemTriggerParamsIncidentConditionFunctionality] + incident_condition_functionality: Unset | PostMortemTriggerParamsIncidentConditionFunctionality if isinstance(_incident_condition_functionality, Unset): incident_condition_functionality = UNSET else: @@ -549,7 +547,7 @@ def _parse_incident_inactivity_duration(data: object) -> Union[None, Unset, str] ) _incident_condition_group = d.pop("incident_condition_group", UNSET) - incident_condition_group: Union[Unset, PostMortemTriggerParamsIncidentConditionGroup] + incident_condition_group: Unset | PostMortemTriggerParamsIncidentConditionGroup if isinstance(_incident_condition_group, Unset): incident_condition_group = UNSET else: @@ -558,7 +556,7 @@ def _parse_incident_inactivity_duration(data: object) -> Union[None, Unset, str] ) _incident_condition_cause = d.pop("incident_condition_cause", UNSET) - incident_condition_cause: Union[Unset, PostMortemTriggerParamsIncidentConditionCause] + incident_condition_cause: Unset | PostMortemTriggerParamsIncidentConditionCause if isinstance(_incident_condition_cause, Unset): incident_condition_cause = UNSET else: @@ -567,7 +565,7 @@ def _parse_incident_inactivity_duration(data: object) -> Union[None, Unset, str] ) _incident_condition_label = d.pop("incident_condition_label", UNSET) - incident_condition_label: Union[Unset, PostMortemTriggerParamsIncidentConditionLabel] + incident_condition_label: Unset | PostMortemTriggerParamsIncidentConditionLabel if isinstance(_incident_condition_label, Unset): incident_condition_label = UNSET else: @@ -580,7 +578,7 @@ def _parse_incident_inactivity_duration(data: object) -> Union[None, Unset, str] incident_labels = cast(list[str], d.pop("incident_labels", UNSET)) _incident_post_mortem_condition_cause = d.pop("incident_post_mortem_condition_cause", UNSET) - incident_post_mortem_condition_cause: Union[Unset, PostMortemTriggerParamsIncidentPostMortemConditionCause] + incident_post_mortem_condition_cause: Unset | PostMortemTriggerParamsIncidentPostMortemConditionCause if isinstance(_incident_post_mortem_condition_cause, Unset): incident_post_mortem_condition_cause = UNSET else: @@ -591,7 +589,7 @@ def _parse_incident_inactivity_duration(data: object) -> Union[None, Unset, str] ) _incident_condition_summary = d.pop("incident_condition_summary", UNSET) - incident_condition_summary: Union[Unset, PostMortemTriggerParamsIncidentConditionSummary] + incident_condition_summary: Unset | PostMortemTriggerParamsIncidentConditionSummary if isinstance(_incident_condition_summary, Unset): incident_condition_summary = UNSET else: @@ -600,7 +598,7 @@ def _parse_incident_inactivity_duration(data: object) -> Union[None, Unset, str] ) _incident_condition_started_at = d.pop("incident_condition_started_at", UNSET) - incident_condition_started_at: Union[Unset, PostMortemTriggerParamsIncidentConditionStartedAt] + incident_condition_started_at: Unset | PostMortemTriggerParamsIncidentConditionStartedAt if isinstance(_incident_condition_started_at, Unset): incident_condition_started_at = UNSET else: @@ -609,7 +607,7 @@ def _parse_incident_inactivity_duration(data: object) -> Union[None, Unset, str] ) _incident_condition_detected_at = d.pop("incident_condition_detected_at", UNSET) - incident_condition_detected_at: Union[Unset, PostMortemTriggerParamsIncidentConditionDetectedAt] + incident_condition_detected_at: Unset | PostMortemTriggerParamsIncidentConditionDetectedAt if isinstance(_incident_condition_detected_at, Unset): incident_condition_detected_at = UNSET else: @@ -618,7 +616,7 @@ def _parse_incident_inactivity_duration(data: object) -> Union[None, Unset, str] ) _incident_condition_acknowledged_at = d.pop("incident_condition_acknowledged_at", UNSET) - incident_condition_acknowledged_at: Union[Unset, PostMortemTriggerParamsIncidentConditionAcknowledgedAt] + incident_condition_acknowledged_at: Unset | PostMortemTriggerParamsIncidentConditionAcknowledgedAt if isinstance(_incident_condition_acknowledged_at, Unset): incident_condition_acknowledged_at = UNSET else: @@ -627,7 +625,7 @@ def _parse_incident_inactivity_duration(data: object) -> Union[None, Unset, str] ) _incident_condition_mitigated_at = d.pop("incident_condition_mitigated_at", UNSET) - incident_condition_mitigated_at: Union[Unset, PostMortemTriggerParamsIncidentConditionMitigatedAt] + incident_condition_mitigated_at: Unset | PostMortemTriggerParamsIncidentConditionMitigatedAt if isinstance(_incident_condition_mitigated_at, Unset): incident_condition_mitigated_at = UNSET else: @@ -636,7 +634,7 @@ def _parse_incident_inactivity_duration(data: object) -> Union[None, Unset, str] ) _incident_condition_resolved_at = d.pop("incident_condition_resolved_at", UNSET) - incident_condition_resolved_at: Union[Unset, PostMortemTriggerParamsIncidentConditionResolvedAt] + incident_condition_resolved_at: Unset | PostMortemTriggerParamsIncidentConditionResolvedAt if isinstance(_incident_condition_resolved_at, Unset): incident_condition_resolved_at = UNSET else: @@ -645,7 +643,7 @@ def _parse_incident_inactivity_duration(data: object) -> Union[None, Unset, str] ) _incident_conditional_inactivity = d.pop("incident_conditional_inactivity", UNSET) - incident_conditional_inactivity: Union[Unset, PostMortemTriggerParamsIncidentConditionalInactivity] + incident_conditional_inactivity: Unset | PostMortemTriggerParamsIncidentConditionalInactivity if isinstance(_incident_conditional_inactivity, Unset): incident_conditional_inactivity = UNSET else: @@ -654,7 +652,7 @@ def _parse_incident_inactivity_duration(data: object) -> Union[None, Unset, str] ) _incident_post_mortem_condition = d.pop("incident_post_mortem_condition", UNSET) - incident_post_mortem_condition: Union[Unset, PostMortemTriggerParamsIncidentPostMortemCondition] + incident_post_mortem_condition: Unset | PostMortemTriggerParamsIncidentPostMortemCondition if isinstance(_incident_post_mortem_condition, Unset): incident_post_mortem_condition = UNSET else: @@ -663,7 +661,7 @@ def _parse_incident_inactivity_duration(data: object) -> Union[None, Unset, str] ) _incident_post_mortem_condition_status = d.pop("incident_post_mortem_condition_status", UNSET) - incident_post_mortem_condition_status: Union[Unset, PostMortemTriggerParamsIncidentPostMortemConditionStatus] + incident_post_mortem_condition_status: Unset | PostMortemTriggerParamsIncidentPostMortemConditionStatus if isinstance(_incident_post_mortem_condition_status, Unset): incident_post_mortem_condition_status = UNSET else: diff --git a/rootly_sdk/models/print_task_params.py b/rootly_sdk/models/print_task_params.py index e83aed48..c781290e 100644 --- a/rootly_sdk/models/print_task_params.py +++ b/rootly_sdk/models/print_task_params.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,13 +19,13 @@ class PrintTaskParams: """ message: str - task_type: Union[Unset, PrintTaskParamsTaskType] = UNSET + task_type: Unset | PrintTaskParamsTaskType = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: message = self.message - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -47,7 +47,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: message = d.pop("message") _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, PrintTaskParamsTaskType] + task_type: Unset | PrintTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/publish_incident_task_params.py b/rootly_sdk/models/publish_incident_task_params.py index 60caa06c..3a5074ae 100644 --- a/rootly_sdk/models/publish_incident_task_params.py +++ b/rootly_sdk/models/publish_incident_task_params.py @@ -48,13 +48,13 @@ class PublishIncidentTaskParams: public_title: str status_page_id: str status: PublishIncidentTaskParamsStatus = "resolved" - task_type: Union[Unset, PublishIncidentTaskParamsTaskType] = UNSET - event: Union[Unset, str] = UNSET - notify_subscribers: Union[Unset, bool] = False - should_tweet: Union[Unset, bool] = False + task_type: Unset | PublishIncidentTaskParamsTaskType = UNSET + event: Unset | str = UNSET + notify_subscribers: Unset | bool = False + should_tweet: Unset | bool = False status_page_template: Union[Unset, "PublishIncidentTaskParamsStatusPageTemplate"] = UNSET - status_page_ids: Union[Unset, list[str]] = UNSET - integration_payload: Union[None, Unset, str] = UNSET + status_page_ids: Unset | list[str] = UNSET + integration_payload: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -66,7 +66,7 @@ def to_dict(self) -> dict[str, Any]: status_page_id = self.status_page_id - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -76,15 +76,15 @@ def to_dict(self) -> dict[str, Any]: should_tweet = self.should_tweet - status_page_template: Union[Unset, dict[str, Any]] = UNSET + status_page_template: Unset | dict[str, Any] = UNSET if not isinstance(self.status_page_template, Unset): status_page_template = self.status_page_template.to_dict() - status_page_ids: Union[Unset, list[str]] = UNSET + status_page_ids: Unset | list[str] = UNSET if not isinstance(self.status_page_ids, Unset): status_page_ids = self.status_page_ids - integration_payload: Union[None, Unset, str] + integration_payload: None | Unset | str if isinstance(self.integration_payload, Unset): integration_payload = UNSET else: @@ -134,7 +134,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: status_page_id = d.pop("status_page_id") _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, PublishIncidentTaskParamsTaskType] + task_type: Unset | PublishIncidentTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: @@ -147,7 +147,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: should_tweet = d.pop("should_tweet", UNSET) _status_page_template = d.pop("status_page_template", UNSET) - status_page_template: Union[Unset, PublishIncidentTaskParamsStatusPageTemplate] + status_page_template: Unset | PublishIncidentTaskParamsStatusPageTemplate if isinstance(_status_page_template, Unset): status_page_template = UNSET else: @@ -155,12 +155,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: status_page_ids = cast(list[str], d.pop("status_page_ids", UNSET)) - def _parse_integration_payload(data: object) -> Union[None, Unset, str]: + def _parse_integration_payload(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) integration_payload = _parse_integration_payload(d.pop("integration_payload", UNSET)) diff --git a/rootly_sdk/models/publish_incident_task_params_incident.py b/rootly_sdk/models/publish_incident_task_params_incident.py index 7ce4ad55..01e13aec 100644 --- a/rootly_sdk/models/publish_incident_task_params_incident.py +++ b/rootly_sdk/models/publish_incident_task_params_incident.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class PublishIncidentTaskParamsIncident: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/publish_incident_task_params_status_page_template.py b/rootly_sdk/models/publish_incident_task_params_status_page_template.py index 734a2e7f..fb64cc16 100644 --- a/rootly_sdk/models/publish_incident_task_params_status_page_template.py +++ b/rootly_sdk/models/publish_incident_task_params_status_page_template.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class PublishIncidentTaskParamsStatusPageTemplate: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/pulse.py b/rootly_sdk/models/pulse.py index 0755c3dd..f2638491 100644 --- a/rootly_sdk/models/pulse.py +++ b/rootly_sdk/models/pulse.py @@ -36,12 +36,12 @@ class Pulse: summary: str created_at: str updated_at: str - source: Union[None, Unset, str] = UNSET - services: Union[Unset, list["Service"]] = UNSET - environments: Union[Unset, list["Environment"]] = UNSET - external_url: Union[None, Unset, str] = UNSET - labels: Union[Unset, list[Union["PulseLabelsItemType0", None]]] = UNSET - refs: Union[Unset, list[Union["PulseRefsItemType0", None]]] = UNSET + source: None | Unset | str = UNSET + services: Unset | list["Service"] = UNSET + environments: Unset | list["Environment"] = UNSET + external_url: None | Unset | str = UNSET + labels: Unset | list[Union["PulseLabelsItemType0", None]] = UNSET + refs: Unset | list[Union["PulseRefsItemType0", None]] = UNSET data: Union["PulseDataType0", None, Unset] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -56,55 +56,55 @@ def to_dict(self) -> dict[str, Any]: updated_at = self.updated_at - source: Union[None, Unset, str] + source: None | Unset | str if isinstance(self.source, Unset): source = UNSET else: source = self.source - services: Union[Unset, list[dict[str, Any]]] = UNSET + services: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.services, Unset): services = [] for services_item_data in self.services: services_item = services_item_data.to_dict() services.append(services_item) - environments: Union[Unset, list[dict[str, Any]]] = UNSET + environments: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.environments, Unset): environments = [] for environments_item_data in self.environments: environments_item = environments_item_data.to_dict() environments.append(environments_item) - external_url: Union[None, Unset, str] + external_url: None | Unset | str if isinstance(self.external_url, Unset): external_url = UNSET else: external_url = self.external_url - labels: Union[Unset, list[Union[None, dict[str, Any]]]] = UNSET + labels: Unset | list[None | dict[str, Any]] = UNSET if not isinstance(self.labels, Unset): labels = [] for labels_item_data in self.labels: - labels_item: Union[None, dict[str, Any]] + labels_item: None | dict[str, Any] if isinstance(labels_item_data, PulseLabelsItemType0): labels_item = labels_item_data.to_dict() else: labels_item = labels_item_data labels.append(labels_item) - refs: Union[Unset, list[Union[None, dict[str, Any]]]] = UNSET + refs: Unset | list[None | dict[str, Any]] = UNSET if not isinstance(self.refs, Unset): refs = [] for refs_item_data in self.refs: - refs_item: Union[None, dict[str, Any]] + refs_item: None | dict[str, Any] if isinstance(refs_item_data, PulseRefsItemType0): refs_item = refs_item_data.to_dict() else: refs_item = refs_item_data refs.append(refs_item) - data: Union[None, Unset, dict[str, Any]] + data: None | Unset | dict[str, Any] if isinstance(self.data, Unset): data = UNSET elif isinstance(self.data, PulseDataType0): @@ -153,12 +153,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: updated_at = d.pop("updated_at") - def _parse_source(data: object) -> Union[None, Unset, str]: + def _parse_source(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) source = _parse_source(d.pop("source", UNSET)) @@ -176,12 +176,12 @@ def _parse_source(data: object) -> Union[None, Unset, str]: environments.append(environments_item) - def _parse_external_url(data: object) -> Union[None, Unset, str]: + def _parse_external_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) external_url = _parse_external_url(d.pop("external_url", UNSET)) diff --git a/rootly_sdk/models/pulse_list.py b/rootly_sdk/models/pulse_list.py index b6cdfb55..c83b7397 100644 --- a/rootly_sdk/models/pulse_list.py +++ b/rootly_sdk/models/pulse_list.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,7 +29,7 @@ class PulseList: data: list["PulseListDataItem"] links: "Links" meta: "Meta" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/pulse_response.py b/rootly_sdk/models/pulse_response.py index 175dc3d1..d5b9e15c 100644 --- a/rootly_sdk/models/pulse_response.py +++ b/rootly_sdk/models/pulse_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,13 +23,13 @@ class PulseResponse: """ data: "PulseResponseData" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/pulse_trigger_params.py b/rootly_sdk/models/pulse_trigger_params.py index 9d2eee3f..e96eb5f8 100644 --- a/rootly_sdk/models/pulse_trigger_params.py +++ b/rootly_sdk/models/pulse_trigger_params.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -53,65 +53,65 @@ class PulseTriggerParams: """ trigger_type: PulseTriggerParamsTriggerType - triggers: Union[Unset, list[PulseTriggerParamsTriggersItem]] = UNSET - pulse_condition: Union[Unset, PulseTriggerParamsPulseCondition] = UNSET - pulse_condition_source: Union[Unset, PulseTriggerParamsPulseConditionSource] = "ANY" - pulse_condition_source_use_regexp: Union[Unset, bool] = False - pulse_sources: Union[Unset, list[str]] = UNSET - pulse_condition_label: Union[Unset, PulseTriggerParamsPulseConditionLabel] = "ANY" - pulse_condition_label_use_regexp: Union[Unset, bool] = False - pulse_labels: Union[Unset, list[str]] = UNSET - pulse_condition_payload: Union[Unset, PulseTriggerParamsPulseConditionPayload] = "ANY" - pulse_condition_payload_use_regexp: Union[Unset, bool] = False - pulse_payload: Union[Unset, list[str]] = UNSET - pulse_query_payload: Union[None, Unset, str] = UNSET + triggers: Unset | list[PulseTriggerParamsTriggersItem] = UNSET + pulse_condition: Unset | PulseTriggerParamsPulseCondition = UNSET + pulse_condition_source: Unset | PulseTriggerParamsPulseConditionSource = "ANY" + pulse_condition_source_use_regexp: Unset | bool = False + pulse_sources: Unset | list[str] = UNSET + pulse_condition_label: Unset | PulseTriggerParamsPulseConditionLabel = "ANY" + pulse_condition_label_use_regexp: Unset | bool = False + pulse_labels: Unset | list[str] = UNSET + pulse_condition_payload: Unset | PulseTriggerParamsPulseConditionPayload = "ANY" + pulse_condition_payload_use_regexp: Unset | bool = False + pulse_payload: Unset | list[str] = UNSET + pulse_query_payload: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: trigger_type: str = self.trigger_type - triggers: Union[Unset, list[str]] = UNSET + triggers: Unset | list[str] = UNSET if not isinstance(self.triggers, Unset): triggers = [] for triggers_item_data in self.triggers: triggers_item: str = triggers_item_data triggers.append(triggers_item) - pulse_condition: Union[Unset, str] = UNSET + pulse_condition: Unset | str = UNSET if not isinstance(self.pulse_condition, Unset): pulse_condition = self.pulse_condition - pulse_condition_source: Union[Unset, str] = UNSET + pulse_condition_source: Unset | str = UNSET if not isinstance(self.pulse_condition_source, Unset): pulse_condition_source = self.pulse_condition_source pulse_condition_source_use_regexp = self.pulse_condition_source_use_regexp - pulse_sources: Union[Unset, list[str]] = UNSET + pulse_sources: Unset | list[str] = UNSET if not isinstance(self.pulse_sources, Unset): pulse_sources = self.pulse_sources - pulse_condition_label: Union[Unset, str] = UNSET + pulse_condition_label: Unset | str = UNSET if not isinstance(self.pulse_condition_label, Unset): pulse_condition_label = self.pulse_condition_label pulse_condition_label_use_regexp = self.pulse_condition_label_use_regexp - pulse_labels: Union[Unset, list[str]] = UNSET + pulse_labels: Unset | list[str] = UNSET if not isinstance(self.pulse_labels, Unset): pulse_labels = self.pulse_labels - pulse_condition_payload: Union[Unset, str] = UNSET + pulse_condition_payload: Unset | str = UNSET if not isinstance(self.pulse_condition_payload, Unset): pulse_condition_payload = self.pulse_condition_payload pulse_condition_payload_use_regexp = self.pulse_condition_payload_use_regexp - pulse_payload: Union[Unset, list[str]] = UNSET + pulse_payload: Unset | list[str] = UNSET if not isinstance(self.pulse_payload, Unset): pulse_payload = self.pulse_payload - pulse_query_payload: Union[None, Unset, str] + pulse_query_payload: None | Unset | str if isinstance(self.pulse_query_payload, Unset): pulse_query_payload = UNSET else: @@ -164,14 +164,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: triggers.append(triggers_item) _pulse_condition = d.pop("pulse_condition", UNSET) - pulse_condition: Union[Unset, PulseTriggerParamsPulseCondition] + pulse_condition: Unset | PulseTriggerParamsPulseCondition if isinstance(_pulse_condition, Unset): pulse_condition = UNSET else: pulse_condition = check_pulse_trigger_params_pulse_condition(_pulse_condition) _pulse_condition_source = d.pop("pulse_condition_source", UNSET) - pulse_condition_source: Union[Unset, PulseTriggerParamsPulseConditionSource] + pulse_condition_source: Unset | PulseTriggerParamsPulseConditionSource if isinstance(_pulse_condition_source, Unset): pulse_condition_source = UNSET else: @@ -182,7 +182,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: pulse_sources = cast(list[str], d.pop("pulse_sources", UNSET)) _pulse_condition_label = d.pop("pulse_condition_label", UNSET) - pulse_condition_label: Union[Unset, PulseTriggerParamsPulseConditionLabel] + pulse_condition_label: Unset | PulseTriggerParamsPulseConditionLabel if isinstance(_pulse_condition_label, Unset): pulse_condition_label = UNSET else: @@ -193,7 +193,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: pulse_labels = cast(list[str], d.pop("pulse_labels", UNSET)) _pulse_condition_payload = d.pop("pulse_condition_payload", UNSET) - pulse_condition_payload: Union[Unset, PulseTriggerParamsPulseConditionPayload] + pulse_condition_payload: Unset | PulseTriggerParamsPulseConditionPayload if isinstance(_pulse_condition_payload, Unset): pulse_condition_payload = UNSET else: @@ -203,12 +203,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: pulse_payload = cast(list[str], d.pop("pulse_payload", UNSET)) - def _parse_pulse_query_payload(data: object) -> Union[None, Unset, str]: + def _parse_pulse_query_payload(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) pulse_query_payload = _parse_pulse_query_payload(d.pop("pulse_query_payload", UNSET)) diff --git a/rootly_sdk/models/receipt.py b/rootly_sdk/models/receipt.py index 7c947c92..56511e01 100644 --- a/rootly_sdk/models/receipt.py +++ b/rootly_sdk/models/receipt.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,15 +22,15 @@ class Receipt: """ state: ReceiptState - reason: Union[Unset, ReceiptReason] = UNSET - resource_type: Union[Unset, str] = UNSET - resource_id: Union[Unset, str] = UNSET + reason: Unset | ReceiptReason = UNSET + resource_type: Unset | str = UNSET + resource_id: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: state: str = self.state - reason: Union[Unset, str] = UNSET + reason: Unset | str = UNSET if not isinstance(self.reason, Unset): reason = self.reason @@ -60,7 +60,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: state = check_receipt_state(d.pop("state")) _reason = d.pop("reason", UNSET) - reason: Union[Unset, ReceiptReason] + reason: Unset | ReceiptReason if isinstance(_reason, Unset): reason = UNSET else: diff --git a/rootly_sdk/models/redis_client_task_params.py b/rootly_sdk/models/redis_client_task_params.py index 735dcd1c..6aa2959c 100644 --- a/rootly_sdk/models/redis_client_task_params.py +++ b/rootly_sdk/models/redis_client_task_params.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -34,11 +34,11 @@ class RedisClientTaskParams: url: str commands: str - task_type: Union[Unset, RedisClientTaskParamsTaskType] = UNSET - event_url: Union[Unset, str] = UNSET - event_message: Union[Unset, str] = UNSET - post_to_incident_timeline: Union[Unset, bool] = UNSET - post_to_slack_channels: Union[Unset, list["RedisClientTaskParamsPostToSlackChannelsItem"]] = UNSET + task_type: Unset | RedisClientTaskParamsTaskType = UNSET + event_url: Unset | str = UNSET + event_message: Unset | str = UNSET + post_to_incident_timeline: Unset | bool = UNSET + post_to_slack_channels: Unset | list["RedisClientTaskParamsPostToSlackChannelsItem"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -46,7 +46,7 @@ def to_dict(self) -> dict[str, Any]: commands = self.commands - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -56,7 +56,7 @@ def to_dict(self) -> dict[str, Any]: post_to_incident_timeline = self.post_to_incident_timeline - post_to_slack_channels: Union[Unset, list[dict[str, Any]]] = UNSET + post_to_slack_channels: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.post_to_slack_channels, Unset): post_to_slack_channels = [] for post_to_slack_channels_item_data in self.post_to_slack_channels: @@ -96,7 +96,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: commands = d.pop("commands") _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, RedisClientTaskParamsTaskType] + task_type: Unset | RedisClientTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/redis_client_task_params_post_to_slack_channels_item.py b/rootly_sdk/models/redis_client_task_params_post_to_slack_channels_item.py index 653b0d57..43f76fd7 100644 --- a/rootly_sdk/models/redis_client_task_params_post_to_slack_channels_item.py +++ b/rootly_sdk/models/redis_client_task_params_post_to_slack_channels_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class RedisClientTaskParamsPostToSlackChannelsItem: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/remove_google_docs_permissions_task_params.py b/rootly_sdk/models/remove_google_docs_permissions_task_params.py index 24cec19a..6b299669 100644 --- a/rootly_sdk/models/remove_google_docs_permissions_task_params.py +++ b/rootly_sdk/models/remove_google_docs_permissions_task_params.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -30,7 +30,7 @@ class RemoveGoogleDocsPermissionsTaskParams: file_id: str value: str attribute_to_query_by: RemoveGoogleDocsPermissionsTaskParamsAttributeToQueryBy = "email_address" - task_type: Union[Unset, RemoveGoogleDocsPermissionsTaskParamsTaskType] = UNSET + task_type: Unset | RemoveGoogleDocsPermissionsTaskParamsTaskType = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -40,7 +40,7 @@ def to_dict(self) -> dict[str, Any]: value = self.value - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -70,7 +70,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: value = d.pop("value") _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, RemoveGoogleDocsPermissionsTaskParamsTaskType] + task_type: Unset | RemoveGoogleDocsPermissionsTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/remove_subscribers_data_attributes.py b/rootly_sdk/models/remove_subscribers_data_attributes.py index 40408536..c8933597 100644 --- a/rootly_sdk/models/remove_subscribers_data_attributes.py +++ b/rootly_sdk/models/remove_subscribers_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -18,11 +18,11 @@ class RemoveSubscribersDataAttributes: private incidents will be removed from the subscriber list of this incident Default: False. """ - user_ids: Union[None, Unset, list[str]] = UNSET - remove_users_with_no_private_incident_access: Union[None, Unset, bool] = False + user_ids: None | Unset | list[str] = UNSET + remove_users_with_no_private_incident_access: None | Unset | bool = False def to_dict(self) -> dict[str, Any]: - user_ids: Union[None, Unset, list[str]] + user_ids: None | Unset | list[str] if isinstance(self.user_ids, Unset): user_ids = UNSET elif isinstance(self.user_ids, list): @@ -31,7 +31,7 @@ def to_dict(self) -> dict[str, Any]: else: user_ids = self.user_ids - remove_users_with_no_private_incident_access: Union[None, Unset, bool] + remove_users_with_no_private_incident_access: None | Unset | bool if isinstance(self.remove_users_with_no_private_incident_access, Unset): remove_users_with_no_private_incident_access = UNSET else: @@ -51,7 +51,7 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_user_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_user_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -64,16 +64,16 @@ def _parse_user_ids(data: object) -> Union[None, Unset, list[str]]: return user_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) user_ids = _parse_user_ids(d.pop("user_ids", UNSET)) - def _parse_remove_users_with_no_private_incident_access(data: object) -> Union[None, Unset, bool]: + def _parse_remove_users_with_no_private_incident_access(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) remove_users_with_no_private_incident_access = _parse_remove_users_with_no_private_incident_access( d.pop("remove_users_with_no_private_incident_access", UNSET) diff --git a/rootly_sdk/models/rename_google_chat_space_task_params.py b/rootly_sdk/models/rename_google_chat_space_task_params.py index c2925c80..7d91f3e8 100644 --- a/rootly_sdk/models/rename_google_chat_space_task_params.py +++ b/rootly_sdk/models/rename_google_chat_space_task_params.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -28,7 +28,7 @@ class RenameGoogleChatSpaceTaskParams: space: "RenameGoogleChatSpaceTaskParamsSpace" title: str - task_type: Union[Unset, RenameGoogleChatSpaceTaskParamsTaskType] = UNSET + task_type: Unset | RenameGoogleChatSpaceTaskParamsTaskType = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -36,7 +36,7 @@ def to_dict(self) -> dict[str, Any]: title = self.title - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -63,7 +63,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: title = d.pop("title") _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, RenameGoogleChatSpaceTaskParamsTaskType] + task_type: Unset | RenameGoogleChatSpaceTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/rename_google_chat_space_task_params_space.py b/rootly_sdk/models/rename_google_chat_space_task_params_space.py index 64d818a9..d121c0ac 100644 --- a/rootly_sdk/models/rename_google_chat_space_task_params_space.py +++ b/rootly_sdk/models/rename_google_chat_space_task_params_space.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class RenameGoogleChatSpaceTaskParamsSpace: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/rename_microsoft_teams_channel_task_params.py b/rootly_sdk/models/rename_microsoft_teams_channel_task_params.py index 69d52b46..4e0c3dfe 100644 --- a/rootly_sdk/models/rename_microsoft_teams_channel_task_params.py +++ b/rootly_sdk/models/rename_microsoft_teams_channel_task_params.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -31,7 +31,7 @@ class RenameMicrosoftTeamsChannelTaskParams: team: "RenameMicrosoftTeamsChannelTaskParamsTeam" channel: "RenameMicrosoftTeamsChannelTaskParamsChannel" title: str - task_type: Union[Unset, RenameMicrosoftTeamsChannelTaskParamsTaskType] = UNSET + task_type: Unset | RenameMicrosoftTeamsChannelTaskParamsTaskType = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -41,7 +41,7 @@ def to_dict(self) -> dict[str, Any]: title = self.title - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -74,7 +74,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: title = d.pop("title") _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, RenameMicrosoftTeamsChannelTaskParamsTaskType] + task_type: Unset | RenameMicrosoftTeamsChannelTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/rename_microsoft_teams_channel_task_params_channel.py b/rootly_sdk/models/rename_microsoft_teams_channel_task_params_channel.py index 47416216..40a6795c 100644 --- a/rootly_sdk/models/rename_microsoft_teams_channel_task_params_channel.py +++ b/rootly_sdk/models/rename_microsoft_teams_channel_task_params_channel.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class RenameMicrosoftTeamsChannelTaskParamsChannel: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/rename_microsoft_teams_channel_task_params_team.py b/rootly_sdk/models/rename_microsoft_teams_channel_task_params_team.py index fa57019d..40409c1b 100644 --- a/rootly_sdk/models/rename_microsoft_teams_channel_task_params_team.py +++ b/rootly_sdk/models/rename_microsoft_teams_channel_task_params_team.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class RenameMicrosoftTeamsChannelTaskParamsTeam: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/rename_slack_channel_task_params.py b/rootly_sdk/models/rename_slack_channel_task_params.py index 453acd53..47cecb7e 100644 --- a/rootly_sdk/models/rename_slack_channel_task_params.py +++ b/rootly_sdk/models/rename_slack_channel_task_params.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -28,7 +28,7 @@ class RenameSlackChannelTaskParams: channel: "RenameSlackChannelTaskParamsChannel" title: str - task_type: Union[Unset, RenameSlackChannelTaskParamsTaskType] = UNSET + task_type: Unset | RenameSlackChannelTaskParamsTaskType = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -36,7 +36,7 @@ def to_dict(self) -> dict[str, Any]: title = self.title - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -63,7 +63,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: title = d.pop("title") _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, RenameSlackChannelTaskParamsTaskType] + task_type: Unset | RenameSlackChannelTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/rename_slack_channel_task_params_channel.py b/rootly_sdk/models/rename_slack_channel_task_params_channel.py index 8588e3dd..4d14a018 100644 --- a/rootly_sdk/models/rename_slack_channel_task_params_channel.py +++ b/rootly_sdk/models/rename_slack_channel_task_params_channel.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class RenameSlackChannelTaskParamsChannel: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/resolve_alert.py b/rootly_sdk/models/resolve_alert.py index 102c0d5a..d14428fe 100644 --- a/rootly_sdk/models/resolve_alert.py +++ b/rootly_sdk/models/resolve_alert.py @@ -24,7 +24,7 @@ class ResolveAlert: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data: Union[Unset, dict[str, Any]] = UNSET + data: Unset | dict[str, Any] = UNSET if not isinstance(self.data, Unset): data = self.data.to_dict() @@ -42,7 +42,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _data = d.pop("data", UNSET) - data: Union[Unset, ResolveAlertData] + data: Unset | ResolveAlertData if isinstance(_data, Unset): data = UNSET else: diff --git a/rootly_sdk/models/resolve_alert_data.py b/rootly_sdk/models/resolve_alert_data.py index acb87f35..7286461f 100644 --- a/rootly_sdk/models/resolve_alert_data.py +++ b/rootly_sdk/models/resolve_alert_data.py @@ -22,16 +22,16 @@ class ResolveAlertData: attributes (Union[Unset, ResolveAlertDataAttributes]): """ - type_: Union[Unset, ResolveAlertDataType] = UNSET + type_: Unset | ResolveAlertDataType = UNSET attributes: Union[Unset, "ResolveAlertDataAttributes"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: Union[Unset, str] = UNSET + type_: Unset | str = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ - attributes: Union[Unset, dict[str, Any]] = UNSET + attributes: Unset | dict[str, Any] = UNSET if not isinstance(self.attributes, Unset): attributes = self.attributes.to_dict() @@ -51,14 +51,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _type_ = d.pop("type", UNSET) - type_: Union[Unset, ResolveAlertDataType] + type_: Unset | ResolveAlertDataType if isinstance(_type_, Unset): type_ = UNSET else: type_ = check_resolve_alert_data_type(_type_) _attributes = d.pop("attributes", UNSET) - attributes: Union[Unset, ResolveAlertDataAttributes] + attributes: Unset | ResolveAlertDataAttributes if isinstance(_attributes, Unset): attributes = UNSET else: diff --git a/rootly_sdk/models/resolve_alert_data_attributes.py b/rootly_sdk/models/resolve_alert_data_attributes.py index 22a9497b..a074323f 100644 --- a/rootly_sdk/models/resolve_alert_data_attributes.py +++ b/rootly_sdk/models/resolve_alert_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -16,17 +16,17 @@ class ResolveAlertDataAttributes: resolve_related_incidents (Union[None, Unset, bool]): Resolve all associated incidents """ - resolution_message: Union[None, Unset, str] = UNSET - resolve_related_incidents: Union[None, Unset, bool] = UNSET + resolution_message: None | Unset | str = UNSET + resolve_related_incidents: None | Unset | bool = UNSET def to_dict(self) -> dict[str, Any]: - resolution_message: Union[None, Unset, str] + resolution_message: None | Unset | str if isinstance(self.resolution_message, Unset): resolution_message = UNSET else: resolution_message = self.resolution_message - resolve_related_incidents: Union[None, Unset, bool] + resolve_related_incidents: None | Unset | bool if isinstance(self.resolve_related_incidents, Unset): resolve_related_incidents = UNSET else: @@ -46,21 +46,21 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_resolution_message(data: object) -> Union[None, Unset, str]: + def _parse_resolution_message(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) resolution_message = _parse_resolution_message(d.pop("resolution_message", UNSET)) - def _parse_resolve_related_incidents(data: object) -> Union[None, Unset, bool]: + def _parse_resolve_related_incidents(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) resolve_related_incidents = _parse_resolve_related_incidents(d.pop("resolve_related_incidents", UNSET)) diff --git a/rootly_sdk/models/resolve_incident_data_attributes.py b/rootly_sdk/models/resolve_incident_data_attributes.py index 5497d44c..779a6bc0 100644 --- a/rootly_sdk/models/resolve_incident_data_attributes.py +++ b/rootly_sdk/models/resolve_incident_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -15,10 +15,10 @@ class ResolveIncidentDataAttributes: resolution_message (Union[None, Unset, str]): How was the incident resolved? """ - resolution_message: Union[None, Unset, str] = UNSET + resolution_message: None | Unset | str = UNSET def to_dict(self) -> dict[str, Any]: - resolution_message: Union[None, Unset, str] + resolution_message: None | Unset | str if isinstance(self.resolution_message, Unset): resolution_message = UNSET else: @@ -36,12 +36,12 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_resolution_message(data: object) -> Union[None, Unset, str]: + def _parse_resolution_message(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) resolution_message = _parse_resolution_message(d.pop("resolution_message", UNSET)) diff --git a/rootly_sdk/models/restart_incident_data.py b/rootly_sdk/models/restart_incident_data.py index 2c5becde..ac26db8c 100644 --- a/rootly_sdk/models/restart_incident_data.py +++ b/rootly_sdk/models/restart_incident_data.py @@ -29,7 +29,7 @@ class RestartIncidentData: def to_dict(self) -> dict[str, Any]: type_: str = self.type_ - attributes: Union[Unset, dict[str, Any]] = UNSET + attributes: Unset | dict[str, Any] = UNSET if not isinstance(self.attributes, Unset): attributes = self.attributes.to_dict() @@ -53,7 +53,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: type_ = check_restart_incident_data_type(d.pop("type")) _attributes = d.pop("attributes", UNSET) - attributes: Union[Unset, RestartIncidentDataAttributes] + attributes: Unset | RestartIncidentDataAttributes if isinstance(_attributes, Unset): attributes = UNSET else: diff --git a/rootly_sdk/models/retrospective_configuration.py b/rootly_sdk/models/retrospective_configuration.py index a1a1c02c..3374e771 100644 --- a/rootly_sdk/models/retrospective_configuration.py +++ b/rootly_sdk/models/retrospective_configuration.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -26,20 +26,20 @@ class RetrospectiveConfiguration: updated_at (Union[Unset, str]): Date of last update """ - kind: Union[Unset, RetrospectiveConfigurationKind] = UNSET - severity_ids: Union[None, Unset, list[str]] = UNSET - group_ids: Union[None, Unset, list[str]] = UNSET - incident_type_ids: Union[None, Unset, list[str]] = UNSET - created_at: Union[Unset, str] = UNSET - updated_at: Union[Unset, str] = UNSET + kind: Unset | RetrospectiveConfigurationKind = UNSET + severity_ids: None | Unset | list[str] = UNSET + group_ids: None | Unset | list[str] = UNSET + incident_type_ids: None | Unset | list[str] = UNSET + created_at: Unset | str = UNSET + updated_at: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - kind: Union[Unset, str] = UNSET + kind: Unset | str = UNSET if not isinstance(self.kind, Unset): kind = self.kind - severity_ids: Union[None, Unset, list[str]] + severity_ids: None | Unset | list[str] if isinstance(self.severity_ids, Unset): severity_ids = UNSET elif isinstance(self.severity_ids, list): @@ -48,7 +48,7 @@ def to_dict(self) -> dict[str, Any]: else: severity_ids = self.severity_ids - group_ids: Union[None, Unset, list[str]] + group_ids: None | Unset | list[str] if isinstance(self.group_ids, Unset): group_ids = UNSET elif isinstance(self.group_ids, list): @@ -57,7 +57,7 @@ def to_dict(self) -> dict[str, Any]: else: group_ids = self.group_ids - incident_type_ids: Union[None, Unset, list[str]] + incident_type_ids: None | Unset | list[str] if isinstance(self.incident_type_ids, Unset): incident_type_ids = UNSET elif isinstance(self.incident_type_ids, list): @@ -92,13 +92,13 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _kind = d.pop("kind", UNSET) - kind: Union[Unset, RetrospectiveConfigurationKind] + kind: Unset | RetrospectiveConfigurationKind if isinstance(_kind, Unset): kind = UNSET else: kind = check_retrospective_configuration_kind(_kind) - def _parse_severity_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_severity_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -111,11 +111,11 @@ def _parse_severity_ids(data: object) -> Union[None, Unset, list[str]]: return severity_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) severity_ids = _parse_severity_ids(d.pop("severity_ids", UNSET)) - def _parse_group_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_group_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -128,11 +128,11 @@ def _parse_group_ids(data: object) -> Union[None, Unset, list[str]]: return group_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) group_ids = _parse_group_ids(d.pop("group_ids", UNSET)) - def _parse_incident_type_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_incident_type_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -145,7 +145,7 @@ def _parse_incident_type_ids(data: object) -> Union[None, Unset, list[str]]: return incident_type_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) incident_type_ids = _parse_incident_type_ids(d.pop("incident_type_ids", UNSET)) diff --git a/rootly_sdk/models/retrospective_configuration_list.py b/rootly_sdk/models/retrospective_configuration_list.py index 2cb1305c..825d65e8 100644 --- a/rootly_sdk/models/retrospective_configuration_list.py +++ b/rootly_sdk/models/retrospective_configuration_list.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,7 +23,7 @@ class RetrospectiveConfigurationList: """ data: list["RetrospectiveConfigurationListDataItem"] - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -32,7 +32,7 @@ def to_dict(self) -> dict[str, Any]: data_item = data_item_data.to_dict() data.append(data_item) - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/retrospective_configuration_response.py b/rootly_sdk/models/retrospective_configuration_response.py index d6cb05cc..42219f57 100644 --- a/rootly_sdk/models/retrospective_configuration_response.py +++ b/rootly_sdk/models/retrospective_configuration_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,13 +23,13 @@ class RetrospectiveConfigurationResponse: """ data: "RetrospectiveConfigurationResponseData" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/retrospective_process.py b/rootly_sdk/models/retrospective_process.py index 7ff00a97..7f16675f 100644 --- a/rootly_sdk/models/retrospective_process.py +++ b/rootly_sdk/models/retrospective_process.py @@ -37,11 +37,11 @@ class RetrospectiveProcess: 'RetrospectiveProcessRetrospectiveProcessMatchingCriteriaType2', Unset]): """ - name: Union[Unset, str] = UNSET - description: Union[None, Unset, str] = UNSET - is_default: Union[None, Unset, bool] = UNSET - created_at: Union[Unset, str] = UNSET - updated_at: Union[Unset, str] = UNSET + name: Unset | str = UNSET + description: None | Unset | str = UNSET + is_default: None | Unset | bool = UNSET + created_at: Unset | str = UNSET + updated_at: Unset | str = UNSET retrospective_process_matching_criteria: Union[ "RetrospectiveProcessRetrospectiveProcessMatchingCriteriaType0", "RetrospectiveProcessRetrospectiveProcessMatchingCriteriaType1", @@ -60,13 +60,13 @@ def to_dict(self) -> dict[str, Any]: name = self.name - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - is_default: Union[None, Unset, bool] + is_default: None | Unset | bool if isinstance(self.is_default, Unset): is_default = UNSET else: @@ -76,7 +76,7 @@ def to_dict(self) -> dict[str, Any]: updated_at = self.updated_at - retrospective_process_matching_criteria: Union[Unset, dict[str, Any]] + retrospective_process_matching_criteria: Unset | dict[str, Any] if isinstance(self.retrospective_process_matching_criteria, Unset): retrospective_process_matching_criteria = UNSET elif isinstance( @@ -123,21 +123,21 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name", UNSET) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_is_default(data: object) -> Union[None, Unset, bool]: + def _parse_is_default(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) is_default = _parse_is_default(d.pop("is_default", UNSET)) diff --git a/rootly_sdk/models/retrospective_process_group_list.py b/rootly_sdk/models/retrospective_process_group_list.py index a91aea8b..49950afc 100644 --- a/rootly_sdk/models/retrospective_process_group_list.py +++ b/rootly_sdk/models/retrospective_process_group_list.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,7 +29,7 @@ class RetrospectiveProcessGroupList: data: list["RetrospectiveProcessGroupListDataItem"] links: "Links" meta: "Meta" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/retrospective_process_group_response.py b/rootly_sdk/models/retrospective_process_group_response.py index c1584891..dd1146e7 100644 --- a/rootly_sdk/models/retrospective_process_group_response.py +++ b/rootly_sdk/models/retrospective_process_group_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,13 +23,13 @@ class RetrospectiveProcessGroupResponse: """ data: "RetrospectiveProcessGroupResponseData" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/retrospective_process_group_step_list.py b/rootly_sdk/models/retrospective_process_group_step_list.py index 61db9bed..da4c38c5 100644 --- a/rootly_sdk/models/retrospective_process_group_step_list.py +++ b/rootly_sdk/models/retrospective_process_group_step_list.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,7 +29,7 @@ class RetrospectiveProcessGroupStepList: data: list["RetrospectiveProcessGroupStepListDataItem"] links: "Links" meta: "Meta" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/retrospective_process_group_step_response.py b/rootly_sdk/models/retrospective_process_group_step_response.py index 951cf308..dfcd4544 100644 --- a/rootly_sdk/models/retrospective_process_group_step_response.py +++ b/rootly_sdk/models/retrospective_process_group_step_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,13 +23,13 @@ class RetrospectiveProcessGroupStepResponse: """ data: "RetrospectiveProcessGroupStepResponseData" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/retrospective_process_list.py b/rootly_sdk/models/retrospective_process_list.py index f04181ec..e8bb5dd4 100644 --- a/rootly_sdk/models/retrospective_process_list.py +++ b/rootly_sdk/models/retrospective_process_list.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,7 +29,7 @@ class RetrospectiveProcessList: data: list["RetrospectiveProcessListDataItem"] links: "Links" meta: "Meta" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/retrospective_process_response.py b/rootly_sdk/models/retrospective_process_response.py index 11f9ebae..1a67a415 100644 --- a/rootly_sdk/models/retrospective_process_response.py +++ b/rootly_sdk/models/retrospective_process_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,13 +23,13 @@ class RetrospectiveProcessResponse: """ data: "RetrospectiveProcessResponseData" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/retrospective_step.py b/rootly_sdk/models/retrospective_step.py index 7676bb7c..753bfd37 100644 --- a/rootly_sdk/models/retrospective_step.py +++ b/rootly_sdk/models/retrospective_step.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -30,12 +30,12 @@ class RetrospectiveStep: title: str created_at: str updated_at: str - slug: Union[Unset, str] = UNSET - description: Union[None, Unset, str] = UNSET - incident_role_id: Union[None, Unset, str] = UNSET - due_after_days: Union[None, Unset, int] = UNSET - position: Union[Unset, int] = UNSET - skippable: Union[Unset, bool] = UNSET + slug: Unset | str = UNSET + description: None | Unset | str = UNSET + incident_role_id: None | Unset | str = UNSET + due_after_days: None | Unset | int = UNSET + position: Unset | int = UNSET + skippable: Unset | bool = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -49,19 +49,19 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - incident_role_id: Union[None, Unset, str] + incident_role_id: None | Unset | str if isinstance(self.incident_role_id, Unset): incident_role_id = UNSET else: incident_role_id = self.incident_role_id - due_after_days: Union[None, Unset, int] + due_after_days: None | Unset | int if isinstance(self.due_after_days, Unset): due_after_days = UNSET else: @@ -109,30 +109,30 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: slug = d.pop("slug", UNSET) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_incident_role_id(data: object) -> Union[None, Unset, str]: + def _parse_incident_role_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) incident_role_id = _parse_incident_role_id(d.pop("incident_role_id", UNSET)) - def _parse_due_after_days(data: object) -> Union[None, Unset, int]: + def _parse_due_after_days(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) due_after_days = _parse_due_after_days(d.pop("due_after_days", UNSET)) diff --git a/rootly_sdk/models/retrospective_step_list.py b/rootly_sdk/models/retrospective_step_list.py index e1abc33f..eff55e6a 100644 --- a/rootly_sdk/models/retrospective_step_list.py +++ b/rootly_sdk/models/retrospective_step_list.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,7 +29,7 @@ class RetrospectiveStepList: data: list["RetrospectiveStepListDataItem"] links: "Links" meta: "Meta" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/retrospective_step_response.py b/rootly_sdk/models/retrospective_step_response.py index 6c65072a..2caec2db 100644 --- a/rootly_sdk/models/retrospective_step_response.py +++ b/rootly_sdk/models/retrospective_step_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,13 +23,13 @@ class RetrospectiveStepResponse: """ data: "RetrospectiveStepResponseData" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/role.py b/rootly_sdk/models/role.py index c7fb2ce2..5bcb4b61 100644 --- a/rootly_sdk/models/role.py +++ b/rootly_sdk/models/role.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -142,43 +142,43 @@ class Role: name: str created_at: str updated_at: str - slug: Union[Unset, str] = UNSET - incident_permission_set_id: Union[None, Unset, str] = UNSET - is_deletable: Union[Unset, bool] = UNSET - is_editable: Union[Unset, bool] = UNSET - alerts_permissions: Union[Unset, list[RoleAlertsPermissionsItem]] = UNSET - api_keys_permissions: Union[Unset, list[RoleApiKeysPermissionsItem]] = UNSET - audits_permissions: Union[Unset, list[RoleAuditsPermissionsItem]] = UNSET - billing_permissions: Union[Unset, list[RoleBillingPermissionsItem]] = UNSET - environments_permissions: Union[Unset, list[RoleEnvironmentsPermissionsItem]] = UNSET - form_fields_permissions: Union[Unset, list[RoleFormFieldsPermissionsItem]] = UNSET - functionalities_permissions: Union[Unset, list[RoleFunctionalitiesPermissionsItem]] = UNSET - groups_permissions: Union[Unset, list[RoleGroupsPermissionsItem]] = UNSET - incident_causes_permissions: Union[Unset, list[RoleIncidentCausesPermissionsItem]] = UNSET - incident_feedbacks_permissions: Union[Unset, list[RoleIncidentFeedbacksPermissionsItem]] = UNSET - incident_roles_permissions: Union[Unset, list[RoleIncidentRolesPermissionsItem]] = UNSET - incident_types_permissions: Union[Unset, list[RoleIncidentTypesPermissionsItem]] = UNSET - incidents_permissions: Union[Unset, list[RoleIncidentsPermissionsItem]] = UNSET - integrations_permissions: Union[Unset, list[RoleIntegrationsPermissionsItem]] = UNSET - invitations_permissions: Union[Unset, list[RoleInvitationsPermissionsItem]] = UNSET - playbooks_permissions: Union[Unset, list[RolePlaybooksPermissionsItem]] = UNSET - private_incidents_permissions: Union[Unset, list[RolePrivateIncidentsPermissionsItem]] = UNSET - pulses_permissions: Union[Unset, list[RolePulsesPermissionsItem]] = UNSET - retrospective_permissions: Union[Unset, list[RoleRetrospectivePermissionsItem]] = UNSET - roles_permissions: Union[Unset, list[RoleRolesPermissionsItem]] = UNSET - secrets_permissions: Union[Unset, list[RoleSecretsPermissionsItem]] = UNSET - services_permissions: Union[Unset, list[RoleServicesPermissionsItem]] = UNSET - severities_permissions: Union[Unset, list[RoleSeveritiesPermissionsItem]] = UNSET - status_pages_permissions: Union[Unset, list[RoleStatusPagesPermissionsItem]] = UNSET - webhooks_permissions: Union[Unset, list[RoleWebhooksPermissionsItem]] = UNSET - workflows_permissions: Union[Unset, list[RoleWorkflowsPermissionsItem]] = UNSET - catalogs_permissions: Union[Unset, list[RoleCatalogsPermissionsItem]] = UNSET - sub_statuses_permissions: Union[Unset, list[RoleSubStatusesPermissionsItem]] = UNSET - edge_connector_permissions: Union[Unset, list[RoleEdgeConnectorPermissionsItem]] = UNSET - slas_permissions: Union[Unset, list[RoleSlasPermissionsItem]] = UNSET - paging_permissions: Union[Unset, list[RolePagingPermissionsItem]] = UNSET - incident_communication_permissions: Union[Unset, list[RoleIncidentCommunicationPermissionsItem]] = UNSET - communication_permissions: Union[Unset, list[RoleCommunicationPermissionsItem]] = UNSET + slug: Unset | str = UNSET + incident_permission_set_id: None | Unset | str = UNSET + is_deletable: Unset | bool = UNSET + is_editable: Unset | bool = UNSET + alerts_permissions: Unset | list[RoleAlertsPermissionsItem] = UNSET + api_keys_permissions: Unset | list[RoleApiKeysPermissionsItem] = UNSET + audits_permissions: Unset | list[RoleAuditsPermissionsItem] = UNSET + billing_permissions: Unset | list[RoleBillingPermissionsItem] = UNSET + environments_permissions: Unset | list[RoleEnvironmentsPermissionsItem] = UNSET + form_fields_permissions: Unset | list[RoleFormFieldsPermissionsItem] = UNSET + functionalities_permissions: Unset | list[RoleFunctionalitiesPermissionsItem] = UNSET + groups_permissions: Unset | list[RoleGroupsPermissionsItem] = UNSET + incident_causes_permissions: Unset | list[RoleIncidentCausesPermissionsItem] = UNSET + incident_feedbacks_permissions: Unset | list[RoleIncidentFeedbacksPermissionsItem] = UNSET + incident_roles_permissions: Unset | list[RoleIncidentRolesPermissionsItem] = UNSET + incident_types_permissions: Unset | list[RoleIncidentTypesPermissionsItem] = UNSET + incidents_permissions: Unset | list[RoleIncidentsPermissionsItem] = UNSET + integrations_permissions: Unset | list[RoleIntegrationsPermissionsItem] = UNSET + invitations_permissions: Unset | list[RoleInvitationsPermissionsItem] = UNSET + playbooks_permissions: Unset | list[RolePlaybooksPermissionsItem] = UNSET + private_incidents_permissions: Unset | list[RolePrivateIncidentsPermissionsItem] = UNSET + pulses_permissions: Unset | list[RolePulsesPermissionsItem] = UNSET + retrospective_permissions: Unset | list[RoleRetrospectivePermissionsItem] = UNSET + roles_permissions: Unset | list[RoleRolesPermissionsItem] = UNSET + secrets_permissions: Unset | list[RoleSecretsPermissionsItem] = UNSET + services_permissions: Unset | list[RoleServicesPermissionsItem] = UNSET + severities_permissions: Unset | list[RoleSeveritiesPermissionsItem] = UNSET + status_pages_permissions: Unset | list[RoleStatusPagesPermissionsItem] = UNSET + webhooks_permissions: Unset | list[RoleWebhooksPermissionsItem] = UNSET + workflows_permissions: Unset | list[RoleWorkflowsPermissionsItem] = UNSET + catalogs_permissions: Unset | list[RoleCatalogsPermissionsItem] = UNSET + sub_statuses_permissions: Unset | list[RoleSubStatusesPermissionsItem] = UNSET + edge_connector_permissions: Unset | list[RoleEdgeConnectorPermissionsItem] = UNSET + slas_permissions: Unset | list[RoleSlasPermissionsItem] = UNSET + paging_permissions: Unset | list[RolePagingPermissionsItem] = UNSET + incident_communication_permissions: Unset | list[RoleIncidentCommunicationPermissionsItem] = UNSET + communication_permissions: Unset | list[RoleCommunicationPermissionsItem] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -190,7 +190,7 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - incident_permission_set_id: Union[None, Unset, str] + incident_permission_set_id: None | Unset | str if isinstance(self.incident_permission_set_id, Unset): incident_permission_set_id = UNSET else: @@ -200,231 +200,231 @@ def to_dict(self) -> dict[str, Any]: is_editable = self.is_editable - alerts_permissions: Union[Unset, list[str]] = UNSET + alerts_permissions: Unset | list[str] = UNSET if not isinstance(self.alerts_permissions, Unset): alerts_permissions = [] for alerts_permissions_item_data in self.alerts_permissions: alerts_permissions_item: str = alerts_permissions_item_data alerts_permissions.append(alerts_permissions_item) - api_keys_permissions: Union[Unset, list[str]] = UNSET + api_keys_permissions: Unset | list[str] = UNSET if not isinstance(self.api_keys_permissions, Unset): api_keys_permissions = [] for api_keys_permissions_item_data in self.api_keys_permissions: api_keys_permissions_item: str = api_keys_permissions_item_data api_keys_permissions.append(api_keys_permissions_item) - audits_permissions: Union[Unset, list[str]] = UNSET + audits_permissions: Unset | list[str] = UNSET if not isinstance(self.audits_permissions, Unset): audits_permissions = [] for audits_permissions_item_data in self.audits_permissions: audits_permissions_item: str = audits_permissions_item_data audits_permissions.append(audits_permissions_item) - billing_permissions: Union[Unset, list[str]] = UNSET + billing_permissions: Unset | list[str] = UNSET if not isinstance(self.billing_permissions, Unset): billing_permissions = [] for billing_permissions_item_data in self.billing_permissions: billing_permissions_item: str = billing_permissions_item_data billing_permissions.append(billing_permissions_item) - environments_permissions: Union[Unset, list[str]] = UNSET + environments_permissions: Unset | list[str] = UNSET if not isinstance(self.environments_permissions, Unset): environments_permissions = [] for environments_permissions_item_data in self.environments_permissions: environments_permissions_item: str = environments_permissions_item_data environments_permissions.append(environments_permissions_item) - form_fields_permissions: Union[Unset, list[str]] = UNSET + form_fields_permissions: Unset | list[str] = UNSET if not isinstance(self.form_fields_permissions, Unset): form_fields_permissions = [] for form_fields_permissions_item_data in self.form_fields_permissions: form_fields_permissions_item: str = form_fields_permissions_item_data form_fields_permissions.append(form_fields_permissions_item) - functionalities_permissions: Union[Unset, list[str]] = UNSET + functionalities_permissions: Unset | list[str] = UNSET if not isinstance(self.functionalities_permissions, Unset): functionalities_permissions = [] for functionalities_permissions_item_data in self.functionalities_permissions: functionalities_permissions_item: str = functionalities_permissions_item_data functionalities_permissions.append(functionalities_permissions_item) - groups_permissions: Union[Unset, list[str]] = UNSET + groups_permissions: Unset | list[str] = UNSET if not isinstance(self.groups_permissions, Unset): groups_permissions = [] for groups_permissions_item_data in self.groups_permissions: groups_permissions_item: str = groups_permissions_item_data groups_permissions.append(groups_permissions_item) - incident_causes_permissions: Union[Unset, list[str]] = UNSET + incident_causes_permissions: Unset | list[str] = UNSET if not isinstance(self.incident_causes_permissions, Unset): incident_causes_permissions = [] for incident_causes_permissions_item_data in self.incident_causes_permissions: incident_causes_permissions_item: str = incident_causes_permissions_item_data incident_causes_permissions.append(incident_causes_permissions_item) - incident_feedbacks_permissions: Union[Unset, list[str]] = UNSET + incident_feedbacks_permissions: Unset | list[str] = UNSET if not isinstance(self.incident_feedbacks_permissions, Unset): incident_feedbacks_permissions = [] for incident_feedbacks_permissions_item_data in self.incident_feedbacks_permissions: incident_feedbacks_permissions_item: str = incident_feedbacks_permissions_item_data incident_feedbacks_permissions.append(incident_feedbacks_permissions_item) - incident_roles_permissions: Union[Unset, list[str]] = UNSET + incident_roles_permissions: Unset | list[str] = UNSET if not isinstance(self.incident_roles_permissions, Unset): incident_roles_permissions = [] for incident_roles_permissions_item_data in self.incident_roles_permissions: incident_roles_permissions_item: str = incident_roles_permissions_item_data incident_roles_permissions.append(incident_roles_permissions_item) - incident_types_permissions: Union[Unset, list[str]] = UNSET + incident_types_permissions: Unset | list[str] = UNSET if not isinstance(self.incident_types_permissions, Unset): incident_types_permissions = [] for incident_types_permissions_item_data in self.incident_types_permissions: incident_types_permissions_item: str = incident_types_permissions_item_data incident_types_permissions.append(incident_types_permissions_item) - incidents_permissions: Union[Unset, list[str]] = UNSET + incidents_permissions: Unset | list[str] = UNSET if not isinstance(self.incidents_permissions, Unset): incidents_permissions = [] for incidents_permissions_item_data in self.incidents_permissions: incidents_permissions_item: str = incidents_permissions_item_data incidents_permissions.append(incidents_permissions_item) - integrations_permissions: Union[Unset, list[str]] = UNSET + integrations_permissions: Unset | list[str] = UNSET if not isinstance(self.integrations_permissions, Unset): integrations_permissions = [] for integrations_permissions_item_data in self.integrations_permissions: integrations_permissions_item: str = integrations_permissions_item_data integrations_permissions.append(integrations_permissions_item) - invitations_permissions: Union[Unset, list[str]] = UNSET + invitations_permissions: Unset | list[str] = UNSET if not isinstance(self.invitations_permissions, Unset): invitations_permissions = [] for invitations_permissions_item_data in self.invitations_permissions: invitations_permissions_item: str = invitations_permissions_item_data invitations_permissions.append(invitations_permissions_item) - playbooks_permissions: Union[Unset, list[str]] = UNSET + playbooks_permissions: Unset | list[str] = UNSET if not isinstance(self.playbooks_permissions, Unset): playbooks_permissions = [] for playbooks_permissions_item_data in self.playbooks_permissions: playbooks_permissions_item: str = playbooks_permissions_item_data playbooks_permissions.append(playbooks_permissions_item) - private_incidents_permissions: Union[Unset, list[str]] = UNSET + private_incidents_permissions: Unset | list[str] = UNSET if not isinstance(self.private_incidents_permissions, Unset): private_incidents_permissions = [] for private_incidents_permissions_item_data in self.private_incidents_permissions: private_incidents_permissions_item: str = private_incidents_permissions_item_data private_incidents_permissions.append(private_incidents_permissions_item) - pulses_permissions: Union[Unset, list[str]] = UNSET + pulses_permissions: Unset | list[str] = UNSET if not isinstance(self.pulses_permissions, Unset): pulses_permissions = [] for pulses_permissions_item_data in self.pulses_permissions: pulses_permissions_item: str = pulses_permissions_item_data pulses_permissions.append(pulses_permissions_item) - retrospective_permissions: Union[Unset, list[str]] = UNSET + retrospective_permissions: Unset | list[str] = UNSET if not isinstance(self.retrospective_permissions, Unset): retrospective_permissions = [] for retrospective_permissions_item_data in self.retrospective_permissions: retrospective_permissions_item: str = retrospective_permissions_item_data retrospective_permissions.append(retrospective_permissions_item) - roles_permissions: Union[Unset, list[str]] = UNSET + roles_permissions: Unset | list[str] = UNSET if not isinstance(self.roles_permissions, Unset): roles_permissions = [] for roles_permissions_item_data in self.roles_permissions: roles_permissions_item: str = roles_permissions_item_data roles_permissions.append(roles_permissions_item) - secrets_permissions: Union[Unset, list[str]] = UNSET + secrets_permissions: Unset | list[str] = UNSET if not isinstance(self.secrets_permissions, Unset): secrets_permissions = [] for secrets_permissions_item_data in self.secrets_permissions: secrets_permissions_item: str = secrets_permissions_item_data secrets_permissions.append(secrets_permissions_item) - services_permissions: Union[Unset, list[str]] = UNSET + services_permissions: Unset | list[str] = UNSET if not isinstance(self.services_permissions, Unset): services_permissions = [] for services_permissions_item_data in self.services_permissions: services_permissions_item: str = services_permissions_item_data services_permissions.append(services_permissions_item) - severities_permissions: Union[Unset, list[str]] = UNSET + severities_permissions: Unset | list[str] = UNSET if not isinstance(self.severities_permissions, Unset): severities_permissions = [] for severities_permissions_item_data in self.severities_permissions: severities_permissions_item: str = severities_permissions_item_data severities_permissions.append(severities_permissions_item) - status_pages_permissions: Union[Unset, list[str]] = UNSET + status_pages_permissions: Unset | list[str] = UNSET if not isinstance(self.status_pages_permissions, Unset): status_pages_permissions = [] for status_pages_permissions_item_data in self.status_pages_permissions: status_pages_permissions_item: str = status_pages_permissions_item_data status_pages_permissions.append(status_pages_permissions_item) - webhooks_permissions: Union[Unset, list[str]] = UNSET + webhooks_permissions: Unset | list[str] = UNSET if not isinstance(self.webhooks_permissions, Unset): webhooks_permissions = [] for webhooks_permissions_item_data in self.webhooks_permissions: webhooks_permissions_item: str = webhooks_permissions_item_data webhooks_permissions.append(webhooks_permissions_item) - workflows_permissions: Union[Unset, list[str]] = UNSET + workflows_permissions: Unset | list[str] = UNSET if not isinstance(self.workflows_permissions, Unset): workflows_permissions = [] for workflows_permissions_item_data in self.workflows_permissions: workflows_permissions_item: str = workflows_permissions_item_data workflows_permissions.append(workflows_permissions_item) - catalogs_permissions: Union[Unset, list[str]] = UNSET + catalogs_permissions: Unset | list[str] = UNSET if not isinstance(self.catalogs_permissions, Unset): catalogs_permissions = [] for catalogs_permissions_item_data in self.catalogs_permissions: catalogs_permissions_item: str = catalogs_permissions_item_data catalogs_permissions.append(catalogs_permissions_item) - sub_statuses_permissions: Union[Unset, list[str]] = UNSET + sub_statuses_permissions: Unset | list[str] = UNSET if not isinstance(self.sub_statuses_permissions, Unset): sub_statuses_permissions = [] for sub_statuses_permissions_item_data in self.sub_statuses_permissions: sub_statuses_permissions_item: str = sub_statuses_permissions_item_data sub_statuses_permissions.append(sub_statuses_permissions_item) - edge_connector_permissions: Union[Unset, list[str]] = UNSET + edge_connector_permissions: Unset | list[str] = UNSET if not isinstance(self.edge_connector_permissions, Unset): edge_connector_permissions = [] for edge_connector_permissions_item_data in self.edge_connector_permissions: edge_connector_permissions_item: str = edge_connector_permissions_item_data edge_connector_permissions.append(edge_connector_permissions_item) - slas_permissions: Union[Unset, list[str]] = UNSET + slas_permissions: Unset | list[str] = UNSET if not isinstance(self.slas_permissions, Unset): slas_permissions = [] for slas_permissions_item_data in self.slas_permissions: slas_permissions_item: str = slas_permissions_item_data slas_permissions.append(slas_permissions_item) - paging_permissions: Union[Unset, list[str]] = UNSET + paging_permissions: Unset | list[str] = UNSET if not isinstance(self.paging_permissions, Unset): paging_permissions = [] for paging_permissions_item_data in self.paging_permissions: paging_permissions_item: str = paging_permissions_item_data paging_permissions.append(paging_permissions_item) - incident_communication_permissions: Union[Unset, list[str]] = UNSET + incident_communication_permissions: Unset | list[str] = UNSET if not isinstance(self.incident_communication_permissions, Unset): incident_communication_permissions = [] for incident_communication_permissions_item_data in self.incident_communication_permissions: incident_communication_permissions_item: str = incident_communication_permissions_item_data incident_communication_permissions.append(incident_communication_permissions_item) - communication_permissions: Union[Unset, list[str]] = UNSET + communication_permissions: Unset | list[str] = UNSET if not isinstance(self.communication_permissions, Unset): communication_permissions = [] for communication_permissions_item_data in self.communication_permissions: @@ -528,12 +528,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: slug = d.pop("slug", UNSET) - def _parse_incident_permission_set_id(data: object) -> Union[None, Unset, str]: + def _parse_incident_permission_set_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) incident_permission_set_id = _parse_incident_permission_set_id(d.pop("incident_permission_set_id", UNSET)) diff --git a/rootly_sdk/models/role_list.py b/rootly_sdk/models/role_list.py index dc988965..39a5997a 100644 --- a/rootly_sdk/models/role_list.py +++ b/rootly_sdk/models/role_list.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,7 +29,7 @@ class RoleList: data: list["RoleListDataItem"] links: "Links" meta: "Meta" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/role_relationship.py b/rootly_sdk/models/role_relationship.py index 416aeb1a..3bd40da5 100644 --- a/rootly_sdk/models/role_relationship.py +++ b/rootly_sdk/models/role_relationship.py @@ -26,7 +26,7 @@ class RoleRelationship: def to_dict(self) -> dict[str, Any]: from ..models.role_relationship_data_type_0 import RoleRelationshipDataType0 - data: Union[None, Unset, dict[str, Any]] + data: None | Unset | dict[str, Any] if isinstance(self.data, Unset): data = UNSET elif isinstance(self.data, RoleRelationshipDataType0): diff --git a/rootly_sdk/models/role_relationship_data_type_0.py b/rootly_sdk/models/role_relationship_data_type_0.py index 0b449301..5f7ec2fe 100644 --- a/rootly_sdk/models/role_relationship_data_type_0.py +++ b/rootly_sdk/models/role_relationship_data_type_0.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,14 +21,14 @@ class RoleRelationshipDataType0: type_ (Union[Unset, RoleRelationshipDataType0Type]): """ - id: Union[Unset, str] = UNSET - type_: Union[Unset, RoleRelationshipDataType0Type] = UNSET + id: Unset | str = UNSET + type_: Unset | RoleRelationshipDataType0Type = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: id = self.id - type_: Union[Unset, str] = UNSET + type_: Unset | str = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ @@ -48,7 +48,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: id = d.pop("id", UNSET) _type_ = d.pop("type", UNSET) - type_: Union[Unset, RoleRelationshipDataType0Type] + type_: Unset | RoleRelationshipDataType0Type if isinstance(_type_, Unset): type_ = UNSET else: diff --git a/rootly_sdk/models/role_response.py b/rootly_sdk/models/role_response.py index 1cfdcb50..85bba452 100644 --- a/rootly_sdk/models/role_response.py +++ b/rootly_sdk/models/role_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,13 +23,13 @@ class RoleResponse: """ data: "RoleResponseData" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/rotate_api_key_data_attributes.py b/rootly_sdk/models/rotate_api_key_data_attributes.py index f7f599a9..d6e37992 100644 --- a/rootly_sdk/models/rotate_api_key_data_attributes.py +++ b/rootly_sdk/models/rotate_api_key_data_attributes.py @@ -1,6 +1,6 @@ import datetime from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from dateutil.parser import isoparse @@ -19,11 +19,11 @@ class RotateApiKeyDataAttributes: grace period feature is enabled for your organization. Defaults to 30. Default: 30. """ - expires_at: Union[None, Unset, datetime.datetime] = UNSET - grace_period_minutes: Union[Unset, int] = 30 + expires_at: None | Unset | datetime.datetime = UNSET + grace_period_minutes: Unset | int = 30 def to_dict(self) -> dict[str, Any]: - expires_at: Union[None, Unset, str] + expires_at: None | Unset | str if isinstance(self.expires_at, Unset): expires_at = UNSET elif isinstance(self.expires_at, datetime.datetime): @@ -47,7 +47,7 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_expires_at(data: object) -> Union[None, Unset, datetime.datetime]: + def _parse_expires_at(data: object) -> None | Unset | datetime.datetime: if data is None: return data if isinstance(data, Unset): @@ -60,7 +60,7 @@ def _parse_expires_at(data: object) -> Union[None, Unset, datetime.datetime]: return expires_at_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, datetime.datetime], data) + return cast(None | Unset | datetime.datetime, data) expires_at = _parse_expires_at(d.pop("expires_at", UNSET)) diff --git a/rootly_sdk/models/run_command_heroku_task_params.py b/rootly_sdk/models/run_command_heroku_task_params.py index 22a205b9..49a46930 100644 --- a/rootly_sdk/models/run_command_heroku_task_params.py +++ b/rootly_sdk/models/run_command_heroku_task_params.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -38,9 +38,9 @@ class RunCommandHerokuTaskParams: command: str app_name: str size: RunCommandHerokuTaskParamsSize - task_type: Union[Unset, RunCommandHerokuTaskParamsTaskType] = UNSET - post_to_incident_timeline: Union[Unset, bool] = UNSET - post_to_slack_channels: Union[Unset, list["RunCommandHerokuTaskParamsPostToSlackChannelsItem"]] = UNSET + task_type: Unset | RunCommandHerokuTaskParamsTaskType = UNSET + post_to_incident_timeline: Unset | bool = UNSET + post_to_slack_channels: Unset | list["RunCommandHerokuTaskParamsPostToSlackChannelsItem"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -50,13 +50,13 @@ def to_dict(self) -> dict[str, Any]: size: str = self.size - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type post_to_incident_timeline = self.post_to_incident_timeline - post_to_slack_channels: Union[Unset, list[dict[str, Any]]] = UNSET + post_to_slack_channels: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.post_to_slack_channels, Unset): post_to_slack_channels = [] for post_to_slack_channels_item_data in self.post_to_slack_channels: @@ -95,7 +95,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: size = check_run_command_heroku_task_params_size(d.pop("size")) _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, RunCommandHerokuTaskParamsTaskType] + task_type: Unset | RunCommandHerokuTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/run_command_heroku_task_params_post_to_slack_channels_item.py b/rootly_sdk/models/run_command_heroku_task_params_post_to_slack_channels_item.py index 9f903c50..27b0a046 100644 --- a/rootly_sdk/models/run_command_heroku_task_params_post_to_slack_channels_item.py +++ b/rootly_sdk/models/run_command_heroku_task_params_post_to_slack_channels_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class RunCommandHerokuTaskParamsPostToSlackChannelsItem: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/schedule.py b/rootly_sdk/models/schedule.py index baadb11e..01b2ec58 100644 --- a/rootly_sdk/models/schedule.py +++ b/rootly_sdk/models/schedule.py @@ -52,19 +52,19 @@ class Schedule: owner_user_id: int created_at: str updated_at: str - description: Union[None, Unset, str] = UNSET - all_time_coverage: Union[None, Unset, bool] = UNSET + description: None | Unset | str = UNSET + all_time_coverage: None | Unset | bool = UNSET slack_user_group: Union["ScheduleSlackUserGroupType0", None, Unset] = UNSET slack_channel: Union["ScheduleSlackChannelType0", None, Unset] = UNSET - owner_group_ids: Union[Unset, list[str]] = UNSET - sync_linear_enabled: Union[Unset, bool] = UNSET - include_shadows_in_slack_notifications: Union[Unset, bool] = UNSET - shift_start_notifications_enabled: Union[Unset, bool] = UNSET - shift_update_notifications_enabled: Union[Unset, bool] = UNSET - shift_report_enabled: Union[Unset, bool] = UNSET - shift_report_day_of_week: Union[Unset, ScheduleShiftReportDayOfWeek] = UNSET - shift_report_time_of_day: Union[Unset, str] = UNSET - shift_report_time_zone: Union[Unset, str] = UNSET + owner_group_ids: Unset | list[str] = UNSET + sync_linear_enabled: Unset | bool = UNSET + include_shadows_in_slack_notifications: Unset | bool = UNSET + shift_start_notifications_enabled: Unset | bool = UNSET + shift_update_notifications_enabled: Unset | bool = UNSET + shift_report_enabled: Unset | bool = UNSET + shift_report_day_of_week: Unset | ScheduleShiftReportDayOfWeek = UNSET + shift_report_time_of_day: Unset | str = UNSET + shift_report_time_zone: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -79,19 +79,19 @@ def to_dict(self) -> dict[str, Any]: updated_at = self.updated_at - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - all_time_coverage: Union[None, Unset, bool] + all_time_coverage: None | Unset | bool if isinstance(self.all_time_coverage, Unset): all_time_coverage = UNSET else: all_time_coverage = self.all_time_coverage - slack_user_group: Union[None, Unset, dict[str, Any]] + slack_user_group: None | Unset | dict[str, Any] if isinstance(self.slack_user_group, Unset): slack_user_group = UNSET elif isinstance(self.slack_user_group, ScheduleSlackUserGroupType0): @@ -99,7 +99,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_user_group = self.slack_user_group - slack_channel: Union[None, Unset, dict[str, Any]] + slack_channel: None | Unset | dict[str, Any] if isinstance(self.slack_channel, Unset): slack_channel = UNSET elif isinstance(self.slack_channel, ScheduleSlackChannelType0): @@ -107,7 +107,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_channel = self.slack_channel - owner_group_ids: Union[Unset, list[str]] = UNSET + owner_group_ids: Unset | list[str] = UNSET if not isinstance(self.owner_group_ids, Unset): owner_group_ids = self.owner_group_ids @@ -121,7 +121,7 @@ def to_dict(self) -> dict[str, Any]: shift_report_enabled = self.shift_report_enabled - shift_report_day_of_week: Union[Unset, str] = UNSET + shift_report_day_of_week: Unset | str = UNSET if not isinstance(self.shift_report_day_of_week, Unset): shift_report_day_of_week = self.shift_report_day_of_week @@ -182,21 +182,21 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: updated_at = d.pop("updated_at") - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_all_time_coverage(data: object) -> Union[None, Unset, bool]: + def _parse_all_time_coverage(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) all_time_coverage = _parse_all_time_coverage(d.pop("all_time_coverage", UNSET)) @@ -247,7 +247,7 @@ def _parse_slack_channel(data: object) -> Union["ScheduleSlackChannelType0", Non shift_report_enabled = d.pop("shift_report_enabled", UNSET) _shift_report_day_of_week = d.pop("shift_report_day_of_week", UNSET) - shift_report_day_of_week: Union[Unset, ScheduleShiftReportDayOfWeek] + shift_report_day_of_week: Unset | ScheduleShiftReportDayOfWeek if isinstance(_shift_report_day_of_week, Unset): shift_report_day_of_week = UNSET else: diff --git a/rootly_sdk/models/schedule_list.py b/rootly_sdk/models/schedule_list.py index ae508220..52a5d577 100644 --- a/rootly_sdk/models/schedule_list.py +++ b/rootly_sdk/models/schedule_list.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,7 +29,7 @@ class ScheduleList: data: list["ScheduleListDataItem"] links: "Links" meta: "Meta" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/schedule_response.py b/rootly_sdk/models/schedule_response.py index c637bfbd..7a59fdfe 100644 --- a/rootly_sdk/models/schedule_response.py +++ b/rootly_sdk/models/schedule_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,13 +23,13 @@ class ScheduleResponse: """ data: "ScheduleResponseData" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/schedule_rotation.py b/rootly_sdk/models/schedule_rotation.py index 933d5e27..53d1f657 100644 --- a/rootly_sdk/models/schedule_rotation.py +++ b/rootly_sdk/models/schedule_rotation.py @@ -67,14 +67,14 @@ class ScheduleRotation: "ScheduleRotationScheduleRotationableAttributesType2", "ScheduleRotationScheduleRotationableAttributesType3", ] - position: Union[Unset, int] = UNSET - active_all_week: Union[Unset, bool] = True - active_days: Union[Unset, list[ScheduleRotationActiveDaysItem]] = UNSET - active_time_type: Union[Unset, str] = UNSET - active_time_attributes: Union[Unset, list["ScheduleRotationActiveTimeAttributesItem"]] = UNSET - time_zone: Union[Unset, str] = "Etc/UTC" - start_time: Union[None, Unset, datetime.datetime] = UNSET - end_time: Union[None, Unset, datetime.datetime] = UNSET + position: Unset | int = UNSET + active_all_week: Unset | bool = True + active_days: Unset | list[ScheduleRotationActiveDaysItem] = UNSET + active_time_type: Unset | str = UNSET + active_time_attributes: Unset | list["ScheduleRotationActiveTimeAttributesItem"] = UNSET + time_zone: Unset | str = "Etc/UTC" + start_time: None | Unset | datetime.datetime = UNSET + end_time: None | Unset | datetime.datetime = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -108,7 +108,7 @@ def to_dict(self) -> dict[str, Any]: active_all_week = self.active_all_week - active_days: Union[Unset, list[str]] = UNSET + active_days: Unset | list[str] = UNSET if not isinstance(self.active_days, Unset): active_days = [] for active_days_item_data in self.active_days: @@ -117,7 +117,7 @@ def to_dict(self) -> dict[str, Any]: active_time_type = self.active_time_type - active_time_attributes: Union[Unset, list[dict[str, Any]]] = UNSET + active_time_attributes: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.active_time_attributes, Unset): active_time_attributes = [] for active_time_attributes_item_data in self.active_time_attributes: @@ -126,7 +126,7 @@ def to_dict(self) -> dict[str, Any]: time_zone = self.time_zone - start_time: Union[None, Unset, str] + start_time: None | Unset | str if isinstance(self.start_time, Unset): start_time = UNSET elif isinstance(self.start_time, datetime.datetime): @@ -134,7 +134,7 @@ def to_dict(self) -> dict[str, Any]: else: start_time = self.start_time - end_time: Union[None, Unset, str] + end_time: None | Unset | str if isinstance(self.end_time, Unset): end_time = UNSET elif isinstance(self.end_time, datetime.datetime): @@ -270,7 +270,7 @@ def _parse_schedule_rotationable_attributes( time_zone = d.pop("time_zone", UNSET) - def _parse_start_time(data: object) -> Union[None, Unset, datetime.datetime]: + def _parse_start_time(data: object) -> None | Unset | datetime.datetime: if data is None: return data if isinstance(data, Unset): @@ -283,11 +283,11 @@ def _parse_start_time(data: object) -> Union[None, Unset, datetime.datetime]: return start_time_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, datetime.datetime], data) + return cast(None | Unset | datetime.datetime, data) start_time = _parse_start_time(d.pop("start_time", UNSET)) - def _parse_end_time(data: object) -> Union[None, Unset, datetime.datetime]: + def _parse_end_time(data: object) -> None | Unset | datetime.datetime: if data is None: return data if isinstance(data, Unset): @@ -300,7 +300,7 @@ def _parse_end_time(data: object) -> Union[None, Unset, datetime.datetime]: return end_time_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, datetime.datetime], data) + return cast(None | Unset | datetime.datetime, data) end_time = _parse_end_time(d.pop("end_time", UNSET)) diff --git a/rootly_sdk/models/schedule_rotation_active_day_active_time_attributes_item.py b/rootly_sdk/models/schedule_rotation_active_day_active_time_attributes_item.py index 55fc8ea7..ee238b25 100644 --- a/rootly_sdk/models/schedule_rotation_active_day_active_time_attributes_item.py +++ b/rootly_sdk/models/schedule_rotation_active_day_active_time_attributes_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class ScheduleRotationActiveDayActiveTimeAttributesItem: end_time (Union[Unset, str]): End time for schedule rotation active time """ - start_time: Union[Unset, str] = UNSET - end_time: Union[Unset, str] = UNSET + start_time: Unset | str = UNSET + end_time: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/schedule_rotation_active_day_list.py b/rootly_sdk/models/schedule_rotation_active_day_list.py index f3da6279..68ad8077 100644 --- a/rootly_sdk/models/schedule_rotation_active_day_list.py +++ b/rootly_sdk/models/schedule_rotation_active_day_list.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,7 +29,7 @@ class ScheduleRotationActiveDayList: data: list["ScheduleRotationActiveDayListDataItem"] links: "Links" meta: "Meta" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/schedule_rotation_active_day_response.py b/rootly_sdk/models/schedule_rotation_active_day_response.py index 51843698..0bcef0d5 100644 --- a/rootly_sdk/models/schedule_rotation_active_day_response.py +++ b/rootly_sdk/models/schedule_rotation_active_day_response.py @@ -23,15 +23,15 @@ class ScheduleRotationActiveDayResponse: """ data: Union[Unset, "ScheduleRotationActiveDayResponseData"] = UNSET - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data: Union[Unset, dict[str, Any]] = UNSET + data: Unset | dict[str, Any] = UNSET if not isinstance(self.data, Unset): data = self.data.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -55,7 +55,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _data = d.pop("data", UNSET) - data: Union[Unset, ScheduleRotationActiveDayResponseData] + data: Unset | ScheduleRotationActiveDayResponseData if isinstance(_data, Unset): data = UNSET else: diff --git a/rootly_sdk/models/schedule_rotation_active_day_response_data.py b/rootly_sdk/models/schedule_rotation_active_day_response_data.py index db954886..97dce826 100644 --- a/rootly_sdk/models/schedule_rotation_active_day_response_data.py +++ b/rootly_sdk/models/schedule_rotation_active_day_response_data.py @@ -26,19 +26,19 @@ class ScheduleRotationActiveDayResponseData: attributes (Union[Unset, ScheduleRotationActiveDay]): """ - id: Union[Unset, str] = UNSET - type_: Union[Unset, ScheduleRotationActiveDayResponseDataType] = UNSET + id: Unset | str = UNSET + type_: Unset | ScheduleRotationActiveDayResponseDataType = UNSET attributes: Union[Unset, "ScheduleRotationActiveDay"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: id = self.id - type_: Union[Unset, str] = UNSET + type_: Unset | str = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ - attributes: Union[Unset, dict[str, Any]] = UNSET + attributes: Unset | dict[str, Any] = UNSET if not isinstance(self.attributes, Unset): attributes = self.attributes.to_dict() @@ -62,14 +62,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: id = d.pop("id", UNSET) _type_ = d.pop("type", UNSET) - type_: Union[Unset, ScheduleRotationActiveDayResponseDataType] + type_: Unset | ScheduleRotationActiveDayResponseDataType if isinstance(_type_, Unset): type_ = UNSET else: type_ = check_schedule_rotation_active_day_response_data_type(_type_) _attributes = d.pop("attributes", UNSET) - attributes: Union[Unset, ScheduleRotationActiveDay] + attributes: Unset | ScheduleRotationActiveDay if isinstance(_attributes, Unset): attributes = UNSET else: diff --git a/rootly_sdk/models/schedule_rotation_list.py b/rootly_sdk/models/schedule_rotation_list.py index 66443d0c..0c67d4c7 100644 --- a/rootly_sdk/models/schedule_rotation_list.py +++ b/rootly_sdk/models/schedule_rotation_list.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,7 +29,7 @@ class ScheduleRotationList: data: list["ScheduleRotationListDataItem"] links: "Links" meta: "Meta" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/schedule_rotation_response.py b/rootly_sdk/models/schedule_rotation_response.py index 8fa1e883..a0fd94db 100644 --- a/rootly_sdk/models/schedule_rotation_response.py +++ b/rootly_sdk/models/schedule_rotation_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,13 +23,13 @@ class ScheduleRotationResponse: """ data: "ScheduleRotationResponseData" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/schedule_rotation_user_list.py b/rootly_sdk/models/schedule_rotation_user_list.py index b1aaec64..df975947 100644 --- a/rootly_sdk/models/schedule_rotation_user_list.py +++ b/rootly_sdk/models/schedule_rotation_user_list.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,7 +29,7 @@ class ScheduleRotationUserList: data: list["ScheduleRotationUserListDataItem"] links: "Links" meta: "Meta" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/schedule_rotation_user_response.py b/rootly_sdk/models/schedule_rotation_user_response.py index 4980425e..16d4fcf2 100644 --- a/rootly_sdk/models/schedule_rotation_user_response.py +++ b/rootly_sdk/models/schedule_rotation_user_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,13 +23,13 @@ class ScheduleRotationUserResponse: """ data: "ScheduleRotationUserResponseData" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/schedule_slack_channel_type_0.py b/rootly_sdk/models/schedule_slack_channel_type_0.py index 20f0bbb2..ec9d0e00 100644 --- a/rootly_sdk/models/schedule_slack_channel_type_0.py +++ b/rootly_sdk/models/schedule_slack_channel_type_0.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -18,8 +18,8 @@ class ScheduleSlackChannelType0: name (Union[Unset, str]): Slack channel name """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/schedule_slack_user_group_type_0.py b/rootly_sdk/models/schedule_slack_user_group_type_0.py index de8cbb15..692964b9 100644 --- a/rootly_sdk/models/schedule_slack_user_group_type_0.py +++ b/rootly_sdk/models/schedule_slack_user_group_type_0.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -18,8 +18,8 @@ class ScheduleSlackUserGroupType0: name (Union[Unset, str]): Slack user group name """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/secret.py b/rootly_sdk/models/secret.py index d0e57e2a..e3fd23f3 100644 --- a/rootly_sdk/models/secret.py +++ b/rootly_sdk/models/secret.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -25,10 +25,10 @@ class Secret: name: str created_at: str updated_at: str - secret: Union[Unset, str] = UNSET - hashicorp_vault_mount: Union[Unset, str] = UNSET - hashicorp_vault_path: Union[None, Unset, str] = UNSET - hashicorp_vault_version: Union[Unset, int] = UNSET + secret: Unset | str = UNSET + hashicorp_vault_mount: Unset | str = UNSET + hashicorp_vault_path: None | Unset | str = UNSET + hashicorp_vault_version: Unset | int = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: hashicorp_vault_mount = self.hashicorp_vault_mount - hashicorp_vault_path: Union[None, Unset, str] + hashicorp_vault_path: None | Unset | str if isinstance(self.hashicorp_vault_path, Unset): hashicorp_vault_path = UNSET else: @@ -83,12 +83,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: hashicorp_vault_mount = d.pop("hashicorp_vault_mount", UNSET) - def _parse_hashicorp_vault_path(data: object) -> Union[None, Unset, str]: + def _parse_hashicorp_vault_path(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) hashicorp_vault_path = _parse_hashicorp_vault_path(d.pop("hashicorp_vault_path", UNSET)) diff --git a/rootly_sdk/models/secret_list.py b/rootly_sdk/models/secret_list.py index d5c71667..f08a58b1 100644 --- a/rootly_sdk/models/secret_list.py +++ b/rootly_sdk/models/secret_list.py @@ -35,11 +35,11 @@ def to_dict(self) -> dict[str, Any]: data_item = data_item_data.to_dict() data.append(data_item) - links: Union[Unset, dict[str, Any]] = UNSET + links: Unset | dict[str, Any] = UNSET if not isinstance(self.links, Unset): links = self.links.to_dict() - meta: Union[Unset, dict[str, Any]] = UNSET + meta: Unset | dict[str, Any] = UNSET if not isinstance(self.meta, Unset): meta = self.meta.to_dict() @@ -72,14 +72,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data.append(data_item) _links = d.pop("links", UNSET) - links: Union[Unset, Links] + links: Unset | Links if isinstance(_links, Unset): links = UNSET else: links = Links.from_dict(_links) _meta = d.pop("meta", UNSET) - meta: Union[Unset, Meta] + meta: Unset | Meta if isinstance(_meta, Unset): meta = UNSET else: diff --git a/rootly_sdk/models/send_dashboard_report_task_params.py b/rootly_sdk/models/send_dashboard_report_task_params.py index 4cf9ceb6..66a38904 100644 --- a/rootly_sdk/models/send_dashboard_report_task_params.py +++ b/rootly_sdk/models/send_dashboard_report_task_params.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -30,10 +30,10 @@ class SendDashboardReportTaskParams: dashboard_ids: list[str] to: list[str] subject: str - body: Union[None, str] - task_type: Union[Unset, SendDashboardReportTaskParamsTaskType] = UNSET - from_: Union[Unset, str] = "Rootly " - preheader: Union[None, Unset, str] = UNSET + body: None | str + task_type: Unset | SendDashboardReportTaskParamsTaskType = UNSET + from_: Unset | str = "Rootly " + preheader: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -43,16 +43,16 @@ def to_dict(self) -> dict[str, Any]: subject = self.subject - body: Union[None, str] + body: None | str body = self.body - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type from_ = self.from_ - preheader: Union[None, Unset, str] + preheader: None | Unset | str if isinstance(self.preheader, Unset): preheader = UNSET else: @@ -86,15 +86,15 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: subject = d.pop("subject") - def _parse_body(data: object) -> Union[None, str]: + def _parse_body(data: object) -> None | str: if data is None: return data - return cast(Union[None, str], data) + return cast(None | str, data) body = _parse_body(d.pop("body")) _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, SendDashboardReportTaskParamsTaskType] + task_type: Unset | SendDashboardReportTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: @@ -102,12 +102,12 @@ def _parse_body(data: object) -> Union[None, str]: from_ = d.pop("from", UNSET) - def _parse_preheader(data: object) -> Union[None, Unset, str]: + def _parse_preheader(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) preheader = _parse_preheader(d.pop("preheader", UNSET)) diff --git a/rootly_sdk/models/send_email_task_params.py b/rootly_sdk/models/send_email_task_params.py index b9f93c42..4f63f560 100644 --- a/rootly_sdk/models/send_email_task_params.py +++ b/rootly_sdk/models/send_email_task_params.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -33,15 +33,15 @@ class SendEmailTaskParams: to: list[str] subject: str - body: Union[None, str] - task_type: Union[Unset, SendEmailTaskParamsTaskType] = UNSET - from_: Union[Unset, str] = "Rootly " - cc: Union[Unset, list[str]] = UNSET - bcc: Union[Unset, list[str]] = UNSET - preheader: Union[None, Unset, str] = UNSET - include_header: Union[Unset, bool] = UNSET - include_footer: Union[Unset, bool] = UNSET - custom_logo_url: Union[None, Unset, str] = UNSET + body: None | str + task_type: Unset | SendEmailTaskParamsTaskType = UNSET + from_: Unset | str = "Rootly " + cc: Unset | list[str] = UNSET + bcc: Unset | list[str] = UNSET + preheader: None | Unset | str = UNSET + include_header: Unset | bool = UNSET + include_footer: Unset | bool = UNSET + custom_logo_url: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -49,24 +49,24 @@ def to_dict(self) -> dict[str, Any]: subject = self.subject - body: Union[None, str] + body: None | str body = self.body - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type from_ = self.from_ - cc: Union[Unset, list[str]] = UNSET + cc: Unset | list[str] = UNSET if not isinstance(self.cc, Unset): cc = self.cc - bcc: Union[Unset, list[str]] = UNSET + bcc: Unset | list[str] = UNSET if not isinstance(self.bcc, Unset): bcc = self.bcc - preheader: Union[None, Unset, str] + preheader: None | Unset | str if isinstance(self.preheader, Unset): preheader = UNSET else: @@ -76,7 +76,7 @@ def to_dict(self) -> dict[str, Any]: include_footer = self.include_footer - custom_logo_url: Union[None, Unset, str] + custom_logo_url: None | Unset | str if isinstance(self.custom_logo_url, Unset): custom_logo_url = UNSET else: @@ -117,15 +117,15 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: subject = d.pop("subject") - def _parse_body(data: object) -> Union[None, str]: + def _parse_body(data: object) -> None | str: if data is None: return data - return cast(Union[None, str], data) + return cast(None | str, data) body = _parse_body(d.pop("body")) _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, SendEmailTaskParamsTaskType] + task_type: Unset | SendEmailTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: @@ -137,12 +137,12 @@ def _parse_body(data: object) -> Union[None, str]: bcc = cast(list[str], d.pop("bcc", UNSET)) - def _parse_preheader(data: object) -> Union[None, Unset, str]: + def _parse_preheader(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) preheader = _parse_preheader(d.pop("preheader", UNSET)) @@ -150,12 +150,12 @@ def _parse_preheader(data: object) -> Union[None, Unset, str]: include_footer = d.pop("include_footer", UNSET) - def _parse_custom_logo_url(data: object) -> Union[None, Unset, str]: + def _parse_custom_logo_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) custom_logo_url = _parse_custom_logo_url(d.pop("custom_logo_url", UNSET)) diff --git a/rootly_sdk/models/send_google_chat_attachments_task_params.py b/rootly_sdk/models/send_google_chat_attachments_task_params.py index 6e5fadff..9b409f79 100644 --- a/rootly_sdk/models/send_google_chat_attachments_task_params.py +++ b/rootly_sdk/models/send_google_chat_attachments_task_params.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -30,7 +30,7 @@ class SendGoogleChatAttachmentsTaskParams: spaces: list["SendGoogleChatAttachmentsTaskParamsSpacesItem"] attachments: str - task_type: Union[Unset, SendGoogleChatAttachmentsTaskParamsTaskType] = UNSET + task_type: Unset | SendGoogleChatAttachmentsTaskParamsTaskType = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -41,7 +41,7 @@ def to_dict(self) -> dict[str, Any]: attachments = self.attachments - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -75,7 +75,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attachments = d.pop("attachments") _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, SendGoogleChatAttachmentsTaskParamsTaskType] + task_type: Unset | SendGoogleChatAttachmentsTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/send_google_chat_attachments_task_params_spaces_item.py b/rootly_sdk/models/send_google_chat_attachments_task_params_spaces_item.py index 10b0636d..325dca5e 100644 --- a/rootly_sdk/models/send_google_chat_attachments_task_params_spaces_item.py +++ b/rootly_sdk/models/send_google_chat_attachments_task_params_spaces_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class SendGoogleChatAttachmentsTaskParamsSpacesItem: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/send_google_chat_message_task_params.py b/rootly_sdk/models/send_google_chat_message_task_params.py index bdce55c2..800495c3 100644 --- a/rootly_sdk/models/send_google_chat_message_task_params.py +++ b/rootly_sdk/models/send_google_chat_message_task_params.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -30,8 +30,8 @@ class SendGoogleChatMessageTaskParams: spaces: list["SendGoogleChatMessageTaskParamsSpacesItem"] text: str - task_type: Union[Unset, SendGoogleChatMessageTaskParamsTaskType] = UNSET - thread_key: Union[None, Unset, str] = UNSET + task_type: Unset | SendGoogleChatMessageTaskParamsTaskType = UNSET + thread_key: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,11 +42,11 @@ def to_dict(self) -> dict[str, Any]: text = self.text - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - thread_key: Union[None, Unset, str] + thread_key: None | Unset | str if isinstance(self.thread_key, Unset): thread_key = UNSET else: @@ -82,18 +82,18 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: text = d.pop("text") _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, SendGoogleChatMessageTaskParamsTaskType] + task_type: Unset | SendGoogleChatMessageTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: task_type = check_send_google_chat_message_task_params_task_type(_task_type) - def _parse_thread_key(data: object) -> Union[None, Unset, str]: + def _parse_thread_key(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) thread_key = _parse_thread_key(d.pop("thread_key", UNSET)) diff --git a/rootly_sdk/models/send_google_chat_message_task_params_spaces_item.py b/rootly_sdk/models/send_google_chat_message_task_params_spaces_item.py index a817fef4..2d271390 100644 --- a/rootly_sdk/models/send_google_chat_message_task_params_spaces_item.py +++ b/rootly_sdk/models/send_google_chat_message_task_params_spaces_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class SendGoogleChatMessageTaskParamsSpacesItem: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/send_microsoft_teams_blocks_task_params_type_0_channels_item.py b/rootly_sdk/models/send_microsoft_teams_blocks_task_params_type_0_channels_item.py index db62f598..d0df8bde 100644 --- a/rootly_sdk/models/send_microsoft_teams_blocks_task_params_type_0_channels_item.py +++ b/rootly_sdk/models/send_microsoft_teams_blocks_task_params_type_0_channels_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class SendMicrosoftTeamsBlocksTaskParamsType0ChannelsItem: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/send_microsoft_teams_chat_message_task_params.py b/rootly_sdk/models/send_microsoft_teams_chat_message_task_params.py index 0cec2355..a0c00b13 100644 --- a/rootly_sdk/models/send_microsoft_teams_chat_message_task_params.py +++ b/rootly_sdk/models/send_microsoft_teams_chat_message_task_params.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -30,7 +30,7 @@ class SendMicrosoftTeamsChatMessageTaskParams: chats: list["SendMicrosoftTeamsChatMessageTaskParamsChatsItem"] text: str - task_type: Union[Unset, SendMicrosoftTeamsChatMessageTaskParamsTaskType] = UNSET + task_type: Unset | SendMicrosoftTeamsChatMessageTaskParamsTaskType = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -41,7 +41,7 @@ def to_dict(self) -> dict[str, Any]: text = self.text - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -75,7 +75,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: text = d.pop("text") _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, SendMicrosoftTeamsChatMessageTaskParamsTaskType] + task_type: Unset | SendMicrosoftTeamsChatMessageTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/send_microsoft_teams_chat_message_task_params_chats_item.py b/rootly_sdk/models/send_microsoft_teams_chat_message_task_params_chats_item.py index a31722c3..79ad0464 100644 --- a/rootly_sdk/models/send_microsoft_teams_chat_message_task_params_chats_item.py +++ b/rootly_sdk/models/send_microsoft_teams_chat_message_task_params_chats_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class SendMicrosoftTeamsChatMessageTaskParamsChatsItem: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/send_microsoft_teams_message_task_params_type_0_channels_item.py b/rootly_sdk/models/send_microsoft_teams_message_task_params_type_0_channels_item.py index 561a2dc7..4d1cc584 100644 --- a/rootly_sdk/models/send_microsoft_teams_message_task_params_type_0_channels_item.py +++ b/rootly_sdk/models/send_microsoft_teams_message_task_params_type_0_channels_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class SendMicrosoftTeamsMessageTaskParamsType0ChannelsItem: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/send_slack_blocks_task_params_type_0_channels_item.py b/rootly_sdk/models/send_slack_blocks_task_params_type_0_channels_item.py index ef88c493..9ac42fea 100644 --- a/rootly_sdk/models/send_slack_blocks_task_params_type_0_channels_item.py +++ b/rootly_sdk/models/send_slack_blocks_task_params_type_0_channels_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class SendSlackBlocksTaskParamsType0ChannelsItem: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/send_slack_blocks_task_params_type_1_slack_users_item.py b/rootly_sdk/models/send_slack_blocks_task_params_type_1_slack_users_item.py index 61aa3c92..c5f42e8d 100644 --- a/rootly_sdk/models/send_slack_blocks_task_params_type_1_slack_users_item.py +++ b/rootly_sdk/models/send_slack_blocks_task_params_type_1_slack_users_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class SendSlackBlocksTaskParamsType1SlackUsersItem: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/send_slack_blocks_task_params_type_2_slack_user_groups_item.py b/rootly_sdk/models/send_slack_blocks_task_params_type_2_slack_user_groups_item.py index dcd96927..15cbd40a 100644 --- a/rootly_sdk/models/send_slack_blocks_task_params_type_2_slack_user_groups_item.py +++ b/rootly_sdk/models/send_slack_blocks_task_params_type_2_slack_user_groups_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class SendSlackBlocksTaskParamsType2SlackUserGroupsItem: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/send_slack_message_task_params_type_0_channels_item.py b/rootly_sdk/models/send_slack_message_task_params_type_0_channels_item.py index ed7932a4..ed01664b 100644 --- a/rootly_sdk/models/send_slack_message_task_params_type_0_channels_item.py +++ b/rootly_sdk/models/send_slack_message_task_params_type_0_channels_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class SendSlackMessageTaskParamsType0ChannelsItem: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/send_slack_message_task_params_type_1_slack_users_item.py b/rootly_sdk/models/send_slack_message_task_params_type_1_slack_users_item.py index 72f117d9..59d8c659 100644 --- a/rootly_sdk/models/send_slack_message_task_params_type_1_slack_users_item.py +++ b/rootly_sdk/models/send_slack_message_task_params_type_1_slack_users_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class SendSlackMessageTaskParamsType1SlackUsersItem: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/send_slack_message_task_params_type_2_slack_user_groups_item.py b/rootly_sdk/models/send_slack_message_task_params_type_2_slack_user_groups_item.py index 5577122a..642e8eb2 100644 --- a/rootly_sdk/models/send_slack_message_task_params_type_2_slack_user_groups_item.py +++ b/rootly_sdk/models/send_slack_message_task_params_type_2_slack_user_groups_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class SendSlackMessageTaskParamsType2SlackUserGroupsItem: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/send_sms_task_params.py b/rootly_sdk/models/send_sms_task_params.py index 71105076..a7013664 100644 --- a/rootly_sdk/models/send_sms_task_params.py +++ b/rootly_sdk/models/send_sms_task_params.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,7 +23,7 @@ class SendSmsTaskParams: phone_numbers: list[str] name: str content: str - task_type: Union[Unset, SendSmsTaskParamsTaskType] = UNSET + task_type: Unset | SendSmsTaskParamsTaskType = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -33,7 +33,7 @@ def to_dict(self) -> dict[str, Any]: content = self.content - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -61,7 +61,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: content = d.pop("content") _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, SendSmsTaskParamsTaskType] + task_type: Unset | SendSmsTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/send_whatsapp_message_task_params.py b/rootly_sdk/models/send_whatsapp_message_task_params.py index 49e21a94..afc93d42 100644 --- a/rootly_sdk/models/send_whatsapp_message_task_params.py +++ b/rootly_sdk/models/send_whatsapp_message_task_params.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -26,7 +26,7 @@ class SendWhatsappMessageTaskParams: phone_numbers: list[str] name: str content: str - task_type: Union[Unset, SendWhatsappMessageTaskParamsTaskType] = UNSET + task_type: Unset | SendWhatsappMessageTaskParamsTaskType = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -36,7 +36,7 @@ def to_dict(self) -> dict[str, Any]: content = self.content - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -64,7 +64,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: content = d.pop("content") _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, SendWhatsappMessageTaskParamsTaskType] + task_type: Unset | SendWhatsappMessageTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/service.py b/rootly_sdk/models/service.py index 4ecb2e63..9dbc0f56 100644 --- a/rootly_sdk/models/service.py +++ b/rootly_sdk/models/service.py @@ -74,39 +74,39 @@ class Service: name: str created_at: str updated_at: str - slug: Union[Unset, str] = UNSET - managed_by: Union[Unset, ServiceManagedBy] = UNSET - description: Union[None, Unset, str] = UNSET - public_description: Union[None, Unset, str] = UNSET - notify_emails: Union[None, Unset, list[str]] = UNSET - color: Union[None, Unset, str] = UNSET - position: Union[None, Unset, int] = UNSET - backstage_id: Union[None, Unset, str] = UNSET - external_id: Union[None, Unset, str] = UNSET - pagerduty_id: Union[None, Unset, str] = UNSET - opsgenie_id: Union[None, Unset, str] = UNSET - cortex_id: Union[None, Unset, str] = UNSET - service_now_ci_sys_id: Union[None, Unset, str] = UNSET - github_repository_name: Union[None, Unset, str] = UNSET - github_repository_branch: Union[None, Unset, str] = UNSET - gitlab_repository_name: Union[None, Unset, str] = UNSET - gitlab_repository_branch: Union[None, Unset, str] = UNSET - kubernetes_deployment_name: Union[None, Unset, str] = UNSET - environment_ids: Union[None, Unset, list[str]] = UNSET - service_ids: Union[None, Unset, list[str]] = UNSET - owner_group_ids: Union[None, Unset, list[str]] = UNSET - owner_user_ids: Union[None, Unset, list[int]] = UNSET - alert_urgency_id: Union[None, Unset, str] = UNSET - escalation_policy_id: Union[None, Unset, str] = UNSET - alerts_email_enabled: Union[None, Unset, bool] = UNSET - alerts_email_address: Union[None, Unset, str] = UNSET - slack_channels: Union[None, Unset, list["ServiceSlackChannelsType0Item"]] = UNSET - slack_aliases: Union[None, Unset, list["ServiceSlackAliasesType0Item"]] = UNSET - alert_broadcast_enabled: Union[None, Unset, bool] = UNSET + slug: Unset | str = UNSET + managed_by: Unset | ServiceManagedBy = UNSET + description: None | Unset | str = UNSET + public_description: None | Unset | str = UNSET + notify_emails: None | Unset | list[str] = UNSET + color: None | Unset | str = UNSET + position: None | Unset | int = UNSET + backstage_id: None | Unset | str = UNSET + external_id: None | Unset | str = UNSET + pagerduty_id: None | Unset | str = UNSET + opsgenie_id: None | Unset | str = UNSET + cortex_id: None | Unset | str = UNSET + service_now_ci_sys_id: None | Unset | str = UNSET + github_repository_name: None | Unset | str = UNSET + github_repository_branch: None | Unset | str = UNSET + gitlab_repository_name: None | Unset | str = UNSET + gitlab_repository_branch: None | Unset | str = UNSET + kubernetes_deployment_name: None | Unset | str = UNSET + environment_ids: None | Unset | list[str] = UNSET + service_ids: None | Unset | list[str] = UNSET + owner_group_ids: None | Unset | list[str] = UNSET + owner_user_ids: None | Unset | list[int] = UNSET + alert_urgency_id: None | Unset | str = UNSET + escalation_policy_id: None | Unset | str = UNSET + alerts_email_enabled: None | Unset | bool = UNSET + alerts_email_address: None | Unset | str = UNSET + slack_channels: None | Unset | list["ServiceSlackChannelsType0Item"] = UNSET + slack_aliases: None | Unset | list["ServiceSlackAliasesType0Item"] = UNSET + alert_broadcast_enabled: None | Unset | bool = UNSET alert_broadcast_channel: Union["ServiceAlertBroadcastChannelType0", None, Unset] = UNSET - incident_broadcast_enabled: Union[None, Unset, bool] = UNSET + incident_broadcast_enabled: None | Unset | bool = UNSET incident_broadcast_channel: Union["ServiceIncidentBroadcastChannelType0", None, Unset] = UNSET - properties: Union[None, Unset, list["ServicePropertiesType0Item"]] = UNSET + properties: None | Unset | list["ServicePropertiesType0Item"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -121,23 +121,23 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - managed_by: Union[Unset, str] = UNSET + managed_by: Unset | str = UNSET if not isinstance(self.managed_by, Unset): managed_by = self.managed_by - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - public_description: Union[None, Unset, str] + public_description: None | Unset | str if isinstance(self.public_description, Unset): public_description = UNSET else: public_description = self.public_description - notify_emails: Union[None, Unset, list[str]] + notify_emails: None | Unset | list[str] if isinstance(self.notify_emails, Unset): notify_emails = UNSET elif isinstance(self.notify_emails, list): @@ -146,85 +146,85 @@ def to_dict(self) -> dict[str, Any]: else: notify_emails = self.notify_emails - color: Union[None, Unset, str] + color: None | Unset | str if isinstance(self.color, Unset): color = UNSET else: color = self.color - position: Union[None, Unset, int] + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: position = self.position - backstage_id: Union[None, Unset, str] + backstage_id: None | Unset | str if isinstance(self.backstage_id, Unset): backstage_id = UNSET else: backstage_id = self.backstage_id - external_id: Union[None, Unset, str] + external_id: None | Unset | str if isinstance(self.external_id, Unset): external_id = UNSET else: external_id = self.external_id - pagerduty_id: Union[None, Unset, str] + pagerduty_id: None | Unset | str if isinstance(self.pagerduty_id, Unset): pagerduty_id = UNSET else: pagerduty_id = self.pagerduty_id - opsgenie_id: Union[None, Unset, str] + opsgenie_id: None | Unset | str if isinstance(self.opsgenie_id, Unset): opsgenie_id = UNSET else: opsgenie_id = self.opsgenie_id - cortex_id: Union[None, Unset, str] + cortex_id: None | Unset | str if isinstance(self.cortex_id, Unset): cortex_id = UNSET else: cortex_id = self.cortex_id - service_now_ci_sys_id: Union[None, Unset, str] + service_now_ci_sys_id: None | Unset | str if isinstance(self.service_now_ci_sys_id, Unset): service_now_ci_sys_id = UNSET else: service_now_ci_sys_id = self.service_now_ci_sys_id - github_repository_name: Union[None, Unset, str] + github_repository_name: None | Unset | str if isinstance(self.github_repository_name, Unset): github_repository_name = UNSET else: github_repository_name = self.github_repository_name - github_repository_branch: Union[None, Unset, str] + github_repository_branch: None | Unset | str if isinstance(self.github_repository_branch, Unset): github_repository_branch = UNSET else: github_repository_branch = self.github_repository_branch - gitlab_repository_name: Union[None, Unset, str] + gitlab_repository_name: None | Unset | str if isinstance(self.gitlab_repository_name, Unset): gitlab_repository_name = UNSET else: gitlab_repository_name = self.gitlab_repository_name - gitlab_repository_branch: Union[None, Unset, str] + gitlab_repository_branch: None | Unset | str if isinstance(self.gitlab_repository_branch, Unset): gitlab_repository_branch = UNSET else: gitlab_repository_branch = self.gitlab_repository_branch - kubernetes_deployment_name: Union[None, Unset, str] + kubernetes_deployment_name: None | Unset | str if isinstance(self.kubernetes_deployment_name, Unset): kubernetes_deployment_name = UNSET else: kubernetes_deployment_name = self.kubernetes_deployment_name - environment_ids: Union[None, Unset, list[str]] + environment_ids: None | Unset | list[str] if isinstance(self.environment_ids, Unset): environment_ids = UNSET elif isinstance(self.environment_ids, list): @@ -233,7 +233,7 @@ def to_dict(self) -> dict[str, Any]: else: environment_ids = self.environment_ids - service_ids: Union[None, Unset, list[str]] + service_ids: None | Unset | list[str] if isinstance(self.service_ids, Unset): service_ids = UNSET elif isinstance(self.service_ids, list): @@ -242,7 +242,7 @@ def to_dict(self) -> dict[str, Any]: else: service_ids = self.service_ids - owner_group_ids: Union[None, Unset, list[str]] + owner_group_ids: None | Unset | list[str] if isinstance(self.owner_group_ids, Unset): owner_group_ids = UNSET elif isinstance(self.owner_group_ids, list): @@ -251,7 +251,7 @@ def to_dict(self) -> dict[str, Any]: else: owner_group_ids = self.owner_group_ids - owner_user_ids: Union[None, Unset, list[int]] + owner_user_ids: None | Unset | list[int] if isinstance(self.owner_user_ids, Unset): owner_user_ids = UNSET elif isinstance(self.owner_user_ids, list): @@ -260,31 +260,31 @@ def to_dict(self) -> dict[str, Any]: else: owner_user_ids = self.owner_user_ids - alert_urgency_id: Union[None, Unset, str] + alert_urgency_id: None | Unset | str if isinstance(self.alert_urgency_id, Unset): alert_urgency_id = UNSET else: alert_urgency_id = self.alert_urgency_id - escalation_policy_id: Union[None, Unset, str] + escalation_policy_id: None | Unset | str if isinstance(self.escalation_policy_id, Unset): escalation_policy_id = UNSET else: escalation_policy_id = self.escalation_policy_id - alerts_email_enabled: Union[None, Unset, bool] + alerts_email_enabled: None | Unset | bool if isinstance(self.alerts_email_enabled, Unset): alerts_email_enabled = UNSET else: alerts_email_enabled = self.alerts_email_enabled - alerts_email_address: Union[None, Unset, str] + alerts_email_address: None | Unset | str if isinstance(self.alerts_email_address, Unset): alerts_email_address = UNSET else: alerts_email_address = self.alerts_email_address - slack_channels: Union[None, Unset, list[dict[str, Any]]] + slack_channels: None | Unset | list[dict[str, Any]] if isinstance(self.slack_channels, Unset): slack_channels = UNSET elif isinstance(self.slack_channels, list): @@ -296,7 +296,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_channels = self.slack_channels - slack_aliases: Union[None, Unset, list[dict[str, Any]]] + slack_aliases: None | Unset | list[dict[str, Any]] if isinstance(self.slack_aliases, Unset): slack_aliases = UNSET elif isinstance(self.slack_aliases, list): @@ -308,13 +308,13 @@ def to_dict(self) -> dict[str, Any]: else: slack_aliases = self.slack_aliases - alert_broadcast_enabled: Union[None, Unset, bool] + alert_broadcast_enabled: None | Unset | bool if isinstance(self.alert_broadcast_enabled, Unset): alert_broadcast_enabled = UNSET else: alert_broadcast_enabled = self.alert_broadcast_enabled - alert_broadcast_channel: Union[None, Unset, dict[str, Any]] + alert_broadcast_channel: None | Unset | dict[str, Any] if isinstance(self.alert_broadcast_channel, Unset): alert_broadcast_channel = UNSET elif isinstance(self.alert_broadcast_channel, ServiceAlertBroadcastChannelType0): @@ -322,13 +322,13 @@ def to_dict(self) -> dict[str, Any]: else: alert_broadcast_channel = self.alert_broadcast_channel - incident_broadcast_enabled: Union[None, Unset, bool] + incident_broadcast_enabled: None | Unset | bool if isinstance(self.incident_broadcast_enabled, Unset): incident_broadcast_enabled = UNSET else: incident_broadcast_enabled = self.incident_broadcast_enabled - incident_broadcast_channel: Union[None, Unset, dict[str, Any]] + incident_broadcast_channel: None | Unset | dict[str, Any] if isinstance(self.incident_broadcast_channel, Unset): incident_broadcast_channel = UNSET elif isinstance(self.incident_broadcast_channel, ServiceIncidentBroadcastChannelType0): @@ -336,7 +336,7 @@ def to_dict(self) -> dict[str, Any]: else: incident_broadcast_channel = self.incident_broadcast_channel - properties: Union[None, Unset, list[dict[str, Any]]] + properties: None | Unset | list[dict[str, Any]] if isinstance(self.properties, Unset): properties = UNSET elif isinstance(self.properties, list): @@ -444,31 +444,31 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: slug = d.pop("slug", UNSET) _managed_by = d.pop("managed_by", UNSET) - managed_by: Union[Unset, ServiceManagedBy] + managed_by: Unset | ServiceManagedBy if isinstance(_managed_by, Unset): managed_by = UNSET else: managed_by = check_service_managed_by(_managed_by) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_public_description(data: object) -> Union[None, Unset, str]: + def _parse_public_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) public_description = _parse_public_description(d.pop("public_description", UNSET)) - def _parse_notify_emails(data: object) -> Union[None, Unset, list[str]]: + def _parse_notify_emails(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -481,128 +481,128 @@ def _parse_notify_emails(data: object) -> Union[None, Unset, list[str]]: return notify_emails_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) notify_emails = _parse_notify_emails(d.pop("notify_emails", UNSET)) - def _parse_color(data: object) -> Union[None, Unset, str]: + def _parse_color(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) color = _parse_color(d.pop("color", UNSET)) - def _parse_position(data: object) -> Union[None, Unset, int]: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) - def _parse_backstage_id(data: object) -> Union[None, Unset, str]: + def _parse_backstage_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) backstage_id = _parse_backstage_id(d.pop("backstage_id", UNSET)) - def _parse_external_id(data: object) -> Union[None, Unset, str]: + def _parse_external_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) external_id = _parse_external_id(d.pop("external_id", UNSET)) - def _parse_pagerduty_id(data: object) -> Union[None, Unset, str]: + def _parse_pagerduty_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) pagerduty_id = _parse_pagerduty_id(d.pop("pagerduty_id", UNSET)) - def _parse_opsgenie_id(data: object) -> Union[None, Unset, str]: + def _parse_opsgenie_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) opsgenie_id = _parse_opsgenie_id(d.pop("opsgenie_id", UNSET)) - def _parse_cortex_id(data: object) -> Union[None, Unset, str]: + def _parse_cortex_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) cortex_id = _parse_cortex_id(d.pop("cortex_id", UNSET)) - def _parse_service_now_ci_sys_id(data: object) -> Union[None, Unset, str]: + def _parse_service_now_ci_sys_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) service_now_ci_sys_id = _parse_service_now_ci_sys_id(d.pop("service_now_ci_sys_id", UNSET)) - def _parse_github_repository_name(data: object) -> Union[None, Unset, str]: + def _parse_github_repository_name(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) github_repository_name = _parse_github_repository_name(d.pop("github_repository_name", UNSET)) - def _parse_github_repository_branch(data: object) -> Union[None, Unset, str]: + def _parse_github_repository_branch(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) github_repository_branch = _parse_github_repository_branch(d.pop("github_repository_branch", UNSET)) - def _parse_gitlab_repository_name(data: object) -> Union[None, Unset, str]: + def _parse_gitlab_repository_name(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) gitlab_repository_name = _parse_gitlab_repository_name(d.pop("gitlab_repository_name", UNSET)) - def _parse_gitlab_repository_branch(data: object) -> Union[None, Unset, str]: + def _parse_gitlab_repository_branch(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) gitlab_repository_branch = _parse_gitlab_repository_branch(d.pop("gitlab_repository_branch", UNSET)) - def _parse_kubernetes_deployment_name(data: object) -> Union[None, Unset, str]: + def _parse_kubernetes_deployment_name(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) kubernetes_deployment_name = _parse_kubernetes_deployment_name(d.pop("kubernetes_deployment_name", UNSET)) - def _parse_environment_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_environment_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -615,11 +615,11 @@ def _parse_environment_ids(data: object) -> Union[None, Unset, list[str]]: return environment_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) environment_ids = _parse_environment_ids(d.pop("environment_ids", UNSET)) - def _parse_service_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_service_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -632,11 +632,11 @@ def _parse_service_ids(data: object) -> Union[None, Unset, list[str]]: return service_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) service_ids = _parse_service_ids(d.pop("service_ids", UNSET)) - def _parse_owner_group_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_owner_group_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -649,11 +649,11 @@ def _parse_owner_group_ids(data: object) -> Union[None, Unset, list[str]]: return owner_group_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) owner_group_ids = _parse_owner_group_ids(d.pop("owner_group_ids", UNSET)) - def _parse_owner_user_ids(data: object) -> Union[None, Unset, list[int]]: + def _parse_owner_user_ids(data: object) -> None | Unset | list[int]: if data is None: return data if isinstance(data, Unset): @@ -666,47 +666,47 @@ def _parse_owner_user_ids(data: object) -> Union[None, Unset, list[int]]: return owner_user_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[int]], data) + return cast(None | Unset | list[int], data) owner_user_ids = _parse_owner_user_ids(d.pop("owner_user_ids", UNSET)) - def _parse_alert_urgency_id(data: object) -> Union[None, Unset, str]: + def _parse_alert_urgency_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) alert_urgency_id = _parse_alert_urgency_id(d.pop("alert_urgency_id", UNSET)) - def _parse_escalation_policy_id(data: object) -> Union[None, Unset, str]: + def _parse_escalation_policy_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) escalation_policy_id = _parse_escalation_policy_id(d.pop("escalation_policy_id", UNSET)) - def _parse_alerts_email_enabled(data: object) -> Union[None, Unset, bool]: + def _parse_alerts_email_enabled(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) alerts_email_enabled = _parse_alerts_email_enabled(d.pop("alerts_email_enabled", UNSET)) - def _parse_alerts_email_address(data: object) -> Union[None, Unset, str]: + def _parse_alerts_email_address(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) alerts_email_address = _parse_alerts_email_address(d.pop("alerts_email_address", UNSET)) - def _parse_slack_channels(data: object) -> Union[None, Unset, list["ServiceSlackChannelsType0Item"]]: + def _parse_slack_channels(data: object) -> None | Unset | list["ServiceSlackChannelsType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -726,11 +726,11 @@ def _parse_slack_channels(data: object) -> Union[None, Unset, list["ServiceSlack return slack_channels_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list["ServiceSlackChannelsType0Item"]], data) + return cast(None | Unset | list["ServiceSlackChannelsType0Item"], data) slack_channels = _parse_slack_channels(d.pop("slack_channels", UNSET)) - def _parse_slack_aliases(data: object) -> Union[None, Unset, list["ServiceSlackAliasesType0Item"]]: + def _parse_slack_aliases(data: object) -> None | Unset | list["ServiceSlackAliasesType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -748,16 +748,16 @@ def _parse_slack_aliases(data: object) -> Union[None, Unset, list["ServiceSlackA return slack_aliases_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list["ServiceSlackAliasesType0Item"]], data) + return cast(None | Unset | list["ServiceSlackAliasesType0Item"], data) slack_aliases = _parse_slack_aliases(d.pop("slack_aliases", UNSET)) - def _parse_alert_broadcast_enabled(data: object) -> Union[None, Unset, bool]: + def _parse_alert_broadcast_enabled(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) alert_broadcast_enabled = _parse_alert_broadcast_enabled(d.pop("alert_broadcast_enabled", UNSET)) @@ -778,12 +778,12 @@ def _parse_alert_broadcast_channel(data: object) -> Union["ServiceAlertBroadcast alert_broadcast_channel = _parse_alert_broadcast_channel(d.pop("alert_broadcast_channel", UNSET)) - def _parse_incident_broadcast_enabled(data: object) -> Union[None, Unset, bool]: + def _parse_incident_broadcast_enabled(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) incident_broadcast_enabled = _parse_incident_broadcast_enabled(d.pop("incident_broadcast_enabled", UNSET)) @@ -806,7 +806,7 @@ def _parse_incident_broadcast_channel( incident_broadcast_channel = _parse_incident_broadcast_channel(d.pop("incident_broadcast_channel", UNSET)) - def _parse_properties(data: object) -> Union[None, Unset, list["ServicePropertiesType0Item"]]: + def _parse_properties(data: object) -> None | Unset | list["ServicePropertiesType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -824,7 +824,7 @@ def _parse_properties(data: object) -> Union[None, Unset, list["ServicePropertie return properties_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list["ServicePropertiesType0Item"]], data) + return cast(None | Unset | list["ServicePropertiesType0Item"], data) properties = _parse_properties(d.pop("properties", UNSET)) diff --git a/rootly_sdk/models/service_alert_broadcast_channel_type_0.py b/rootly_sdk/models/service_alert_broadcast_channel_type_0.py index b3122a4d..c8429803 100644 --- a/rootly_sdk/models/service_alert_broadcast_channel_type_0.py +++ b/rootly_sdk/models/service_alert_broadcast_channel_type_0.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -18,8 +18,8 @@ class ServiceAlertBroadcastChannelType0: name (Union[Unset, str]): Slack channel name """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/service_incident_broadcast_channel_type_0.py b/rootly_sdk/models/service_incident_broadcast_channel_type_0.py index 329e92e3..801815e9 100644 --- a/rootly_sdk/models/service_incident_broadcast_channel_type_0.py +++ b/rootly_sdk/models/service_incident_broadcast_channel_type_0.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -18,8 +18,8 @@ class ServiceIncidentBroadcastChannelType0: name (Union[Unset, str]): Slack channel name """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/service_list.py b/rootly_sdk/models/service_list.py index 83a5874d..5cde24ed 100644 --- a/rootly_sdk/models/service_list.py +++ b/rootly_sdk/models/service_list.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,7 +29,7 @@ class ServiceList: data: list["ServiceListDataItem"] links: "Links" meta: "Meta" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/service_response.py b/rootly_sdk/models/service_response.py index a35d3ee1..645fe2d2 100644 --- a/rootly_sdk/models/service_response.py +++ b/rootly_sdk/models/service_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,13 +23,13 @@ class ServiceResponse: """ data: "ServiceResponseData" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/severity.py b/rootly_sdk/models/severity.py index 2ddcf16f..91ec5e93 100644 --- a/rootly_sdk/models/severity.py +++ b/rootly_sdk/models/severity.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -37,14 +37,14 @@ class Severity: name: str created_at: str updated_at: str - slug: Union[Unset, str] = UNSET - description: Union[None, Unset, str] = UNSET - severity: Union[Unset, SeveritySeverity] = UNSET - color: Union[None, Unset, str] = UNSET - position: Union[None, Unset, int] = UNSET - notify_emails: Union[None, Unset, list[str]] = UNSET - slack_channels: Union[None, Unset, list["SeveritySlackChannelsType0Item"]] = UNSET - slack_aliases: Union[None, Unset, list["SeveritySlackAliasesType0Item"]] = UNSET + slug: Unset | str = UNSET + description: None | Unset | str = UNSET + severity: Unset | SeveritySeverity = UNSET + color: None | Unset | str = UNSET + position: None | Unset | int = UNSET + notify_emails: None | Unset | list[str] = UNSET + slack_channels: None | Unset | list["SeveritySlackChannelsType0Item"] = UNSET + slack_aliases: None | Unset | list["SeveritySlackAliasesType0Item"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -56,29 +56,29 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - severity: Union[Unset, str] = UNSET + severity: Unset | str = UNSET if not isinstance(self.severity, Unset): severity = self.severity - color: Union[None, Unset, str] + color: None | Unset | str if isinstance(self.color, Unset): color = UNSET else: color = self.color - position: Union[None, Unset, int] + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: position = self.position - notify_emails: Union[None, Unset, list[str]] + notify_emails: None | Unset | list[str] if isinstance(self.notify_emails, Unset): notify_emails = UNSET elif isinstance(self.notify_emails, list): @@ -87,7 +87,7 @@ def to_dict(self) -> dict[str, Any]: else: notify_emails = self.notify_emails - slack_channels: Union[None, Unset, list[dict[str, Any]]] + slack_channels: None | Unset | list[dict[str, Any]] if isinstance(self.slack_channels, Unset): slack_channels = UNSET elif isinstance(self.slack_channels, list): @@ -99,7 +99,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_channels = self.slack_channels - slack_aliases: Union[None, Unset, list[dict[str, Any]]] + slack_aliases: None | Unset | list[dict[str, Any]] if isinstance(self.slack_aliases, Unset): slack_aliases = UNSET elif isinstance(self.slack_aliases, list): @@ -153,41 +153,41 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: slug = d.pop("slug", UNSET) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) _severity = d.pop("severity", UNSET) - severity: Union[Unset, SeveritySeverity] + severity: Unset | SeveritySeverity if isinstance(_severity, Unset): severity = UNSET else: severity = check_severity_severity(_severity) - def _parse_color(data: object) -> Union[None, Unset, str]: + def _parse_color(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) color = _parse_color(d.pop("color", UNSET)) - def _parse_position(data: object) -> Union[None, Unset, int]: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) - def _parse_notify_emails(data: object) -> Union[None, Unset, list[str]]: + def _parse_notify_emails(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -200,11 +200,11 @@ def _parse_notify_emails(data: object) -> Union[None, Unset, list[str]]: return notify_emails_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) notify_emails = _parse_notify_emails(d.pop("notify_emails", UNSET)) - def _parse_slack_channels(data: object) -> Union[None, Unset, list["SeveritySlackChannelsType0Item"]]: + def _parse_slack_channels(data: object) -> None | Unset | list["SeveritySlackChannelsType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -224,11 +224,11 @@ def _parse_slack_channels(data: object) -> Union[None, Unset, list["SeveritySlac return slack_channels_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list["SeveritySlackChannelsType0Item"]], data) + return cast(None | Unset | list["SeveritySlackChannelsType0Item"], data) slack_channels = _parse_slack_channels(d.pop("slack_channels", UNSET)) - def _parse_slack_aliases(data: object) -> Union[None, Unset, list["SeveritySlackAliasesType0Item"]]: + def _parse_slack_aliases(data: object) -> None | Unset | list["SeveritySlackAliasesType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -246,7 +246,7 @@ def _parse_slack_aliases(data: object) -> Union[None, Unset, list["SeveritySlack return slack_aliases_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list["SeveritySlackAliasesType0Item"]], data) + return cast(None | Unset | list["SeveritySlackAliasesType0Item"], data) slack_aliases = _parse_slack_aliases(d.pop("slack_aliases", UNSET)) diff --git a/rootly_sdk/models/severity_list.py b/rootly_sdk/models/severity_list.py index 9b35bde0..efdf692d 100644 --- a/rootly_sdk/models/severity_list.py +++ b/rootly_sdk/models/severity_list.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,7 +29,7 @@ class SeverityList: data: list["SeverityListDataItem"] links: "Links" meta: "Meta" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/severity_response.py b/rootly_sdk/models/severity_response.py index 7c4877c7..9c282bba 100644 --- a/rootly_sdk/models/severity_response.py +++ b/rootly_sdk/models/severity_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,13 +23,13 @@ class SeverityResponse: """ data: "SeverityResponseData" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/shift.py b/rootly_sdk/models/shift.py index bdffa207..bc776d7d 100644 --- a/rootly_sdk/models/shift.py +++ b/rootly_sdk/models/shift.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,18 +23,18 @@ class Shift: """ schedule_id: str - rotation_id: Union[None, str] + rotation_id: None | str starts_at: str ends_at: str is_override: bool is_shadow: bool - user_id: Union[None, Unset, int] = UNSET + user_id: None | Unset | int = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: schedule_id = self.schedule_id - rotation_id: Union[None, str] + rotation_id: None | str rotation_id = self.rotation_id starts_at = self.starts_at @@ -45,7 +45,7 @@ def to_dict(self) -> dict[str, Any]: is_shadow = self.is_shadow - user_id: Union[None, Unset, int] + user_id: None | Unset | int if isinstance(self.user_id, Unset): user_id = UNSET else: @@ -73,10 +73,10 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) schedule_id = d.pop("schedule_id") - def _parse_rotation_id(data: object) -> Union[None, str]: + def _parse_rotation_id(data: object) -> None | str: if data is None: return data - return cast(Union[None, str], data) + return cast(None | str, data) rotation_id = _parse_rotation_id(d.pop("rotation_id")) @@ -88,12 +88,12 @@ def _parse_rotation_id(data: object) -> Union[None, str]: is_shadow = d.pop("is_shadow") - def _parse_user_id(data: object) -> Union[None, Unset, int]: + def _parse_user_id(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) user_id = _parse_user_id(d.pop("user_id", UNSET)) diff --git a/rootly_sdk/models/shift_coverage_request.py b/rootly_sdk/models/shift_coverage_request.py index 17460e8d..79e36899 100644 --- a/rootly_sdk/models/shift_coverage_request.py +++ b/rootly_sdk/models/shift_coverage_request.py @@ -39,8 +39,8 @@ class ShiftCoverageRequest: created_by_user_id: int starts_at: str ends_at: str - created_at: Union[Unset, str] = UNSET - updated_at: Union[Unset, str] = UNSET + created_at: Unset | str = UNSET + updated_at: Unset | str = UNSET schedule: Union[Unset, "ScheduleResponse"] = UNSET shift: Union[Unset, "Shift"] = UNSET original_shift_user: Union[Unset, "UserResponse"] = UNSET @@ -64,19 +64,19 @@ def to_dict(self) -> dict[str, Any]: updated_at = self.updated_at - schedule: Union[Unset, dict[str, Any]] = UNSET + schedule: Unset | dict[str, Any] = UNSET if not isinstance(self.schedule, Unset): schedule = self.schedule.to_dict() - shift: Union[Unset, dict[str, Any]] = UNSET + shift: Unset | dict[str, Any] = UNSET if not isinstance(self.shift, Unset): shift = self.shift.to_dict() - original_shift_user: Union[Unset, dict[str, Any]] = UNSET + original_shift_user: Unset | dict[str, Any] = UNSET if not isinstance(self.original_shift_user, Unset): original_shift_user = self.original_shift_user.to_dict() - created_by_user: Union[Unset, dict[str, Any]] = UNSET + created_by_user: Unset | dict[str, Any] = UNSET if not isinstance(self.created_by_user, Unset): created_by_user = self.created_by_user.to_dict() @@ -131,28 +131,28 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: updated_at = d.pop("updated_at", UNSET) _schedule = d.pop("schedule", UNSET) - schedule: Union[Unset, ScheduleResponse] + schedule: Unset | ScheduleResponse if isinstance(_schedule, Unset): schedule = UNSET else: schedule = ScheduleResponse.from_dict(_schedule) _shift = d.pop("shift", UNSET) - shift: Union[Unset, Shift] + shift: Unset | Shift if isinstance(_shift, Unset): shift = UNSET else: shift = Shift.from_dict(_shift) _original_shift_user = d.pop("original_shift_user", UNSET) - original_shift_user: Union[Unset, UserResponse] + original_shift_user: Unset | UserResponse if isinstance(_original_shift_user, Unset): original_shift_user = UNSET else: original_shift_user = UserResponse.from_dict(_original_shift_user) _created_by_user = d.pop("created_by_user", UNSET) - created_by_user: Union[Unset, UserResponse] + created_by_user: Unset | UserResponse if isinstance(_created_by_user, Unset): created_by_user = UNSET else: diff --git a/rootly_sdk/models/shift_coverage_request_list.py b/rootly_sdk/models/shift_coverage_request_list.py index 7b83fa4a..2b73e0c5 100644 --- a/rootly_sdk/models/shift_coverage_request_list.py +++ b/rootly_sdk/models/shift_coverage_request_list.py @@ -29,7 +29,7 @@ class ShiftCoverageRequestList: data: list["ShiftCoverageRequestListDataItem"] links: Union[Unset, "Links"] = UNSET meta: Union[Unset, "Meta"] = UNSET - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -38,15 +38,15 @@ def to_dict(self) -> dict[str, Any]: data_item = data_item_data.to_dict() data.append(data_item) - links: Union[Unset, dict[str, Any]] = UNSET + links: Unset | dict[str, Any] = UNSET if not isinstance(self.links, Unset): links = self.links.to_dict() - meta: Union[Unset, dict[str, Any]] = UNSET + meta: Unset | dict[str, Any] = UNSET if not isinstance(self.meta, Unset): meta = self.meta.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +85,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data.append(data_item) _links = d.pop("links", UNSET) - links: Union[Unset, Links] + links: Unset | Links if isinstance(_links, Unset): links = UNSET else: links = Links.from_dict(_links) _meta = d.pop("meta", UNSET) - meta: Union[Unset, Meta] + meta: Unset | Meta if isinstance(_meta, Unset): meta = UNSET else: diff --git a/rootly_sdk/models/shift_coverage_request_response.py b/rootly_sdk/models/shift_coverage_request_response.py index 9af3f855..33e4ac04 100644 --- a/rootly_sdk/models/shift_coverage_request_response.py +++ b/rootly_sdk/models/shift_coverage_request_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,13 +23,13 @@ class ShiftCoverageRequestResponse: """ data: "ShiftCoverageRequestResponseData" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/shift_list.py b/rootly_sdk/models/shift_list.py index de3b755d..29673dab 100644 --- a/rootly_sdk/models/shift_list.py +++ b/rootly_sdk/models/shift_list.py @@ -26,7 +26,7 @@ class ShiftList: data: list["ShiftListDataItem"] meta: Union[Unset, "Meta"] = UNSET - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -35,11 +35,11 @@ def to_dict(self) -> dict[str, Any]: data_item = data_item_data.to_dict() data.append(data_item) - meta: Union[Unset, dict[str, Any]] = UNSET + meta: Unset | dict[str, Any] = UNSET if not isinstance(self.meta, Unset): meta = self.meta.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -75,7 +75,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data.append(data_item) _meta = d.pop("meta", UNSET) - meta: Union[Unset, Meta] + meta: Unset | Meta if isinstance(_meta, Unset): meta = UNSET else: diff --git a/rootly_sdk/models/shift_list_data_item.py b/rootly_sdk/models/shift_list_data_item.py index 01605618..430d4e47 100644 --- a/rootly_sdk/models/shift_list_data_item.py +++ b/rootly_sdk/models/shift_list_data_item.py @@ -38,7 +38,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() - relationships: Union[Unset, dict[str, Any]] = UNSET + relationships: Unset | dict[str, Any] = UNSET if not isinstance(self.relationships, Unset): relationships = self.relationships.to_dict() @@ -69,7 +69,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = Shift.from_dict(d.pop("attributes")) _relationships = d.pop("relationships", UNSET) - relationships: Union[Unset, ShiftRelationships] + relationships: Unset | ShiftRelationships if isinstance(_relationships, Unset): relationships = UNSET else: diff --git a/rootly_sdk/models/shift_override.py b/rootly_sdk/models/shift_override.py index 96131f40..93b17a4c 100644 --- a/rootly_sdk/models/shift_override.py +++ b/rootly_sdk/models/shift_override.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,8 +21,8 @@ class ShiftOverride: shift_id: str created_by_user_id: int - created_at: Union[Unset, str] = UNSET - updated_at: Union[Unset, str] = UNSET + created_at: Unset | str = UNSET + updated_at: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/shift_override_response.py b/rootly_sdk/models/shift_override_response.py index 170701b7..4c8f6d9d 100644 --- a/rootly_sdk/models/shift_override_response.py +++ b/rootly_sdk/models/shift_override_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,13 +23,13 @@ class ShiftOverrideResponse: """ data: "ShiftOverrideResponseData" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/shift_relationships.py b/rootly_sdk/models/shift_relationships.py index bf4234f8..0c6fc19b 100644 --- a/rootly_sdk/models/shift_relationships.py +++ b/rootly_sdk/models/shift_relationships.py @@ -30,15 +30,15 @@ class ShiftRelationships: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - shift_override: Union[Unset, dict[str, Any]] = UNSET + shift_override: Unset | dict[str, Any] = UNSET if not isinstance(self.shift_override, Unset): shift_override = self.shift_override.to_dict() - user: Union[Unset, dict[str, Any]] = UNSET + user: Unset | dict[str, Any] = UNSET if not isinstance(self.user, Unset): user = self.user.to_dict() - assignee: Union[Unset, dict[str, Any]] = UNSET + assignee: Unset | dict[str, Any] = UNSET if not isinstance(self.assignee, Unset): assignee = self.assignee.to_dict() @@ -62,21 +62,21 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _shift_override = d.pop("shift_override", UNSET) - shift_override: Union[Unset, ShiftRelationshipsShiftOverride] + shift_override: Unset | ShiftRelationshipsShiftOverride if isinstance(_shift_override, Unset): shift_override = UNSET else: shift_override = ShiftRelationshipsShiftOverride.from_dict(_shift_override) _user = d.pop("user", UNSET) - user: Union[Unset, ShiftRelationshipsUser] + user: Unset | ShiftRelationshipsUser if isinstance(_user, Unset): user = UNSET else: user = ShiftRelationshipsUser.from_dict(_user) _assignee = d.pop("assignee", UNSET) - assignee: Union[Unset, ShiftRelationshipsAssignee] + assignee: Unset | ShiftRelationshipsAssignee if isinstance(_assignee, Unset): assignee = UNSET else: diff --git a/rootly_sdk/models/shift_relationships_assignee.py b/rootly_sdk/models/shift_relationships_assignee.py index 30a885f0..fc798a60 100644 --- a/rootly_sdk/models/shift_relationships_assignee.py +++ b/rootly_sdk/models/shift_relationships_assignee.py @@ -27,7 +27,7 @@ class ShiftRelationshipsAssignee: def to_dict(self) -> dict[str, Any]: from ..models.shift_relationships_assignee_data_type_0 import ShiftRelationshipsAssigneeDataType0 - data: Union[None, Unset, dict[str, Any]] + data: None | Unset | dict[str, Any] if isinstance(self.data, Unset): data = UNSET elif isinstance(self.data, ShiftRelationshipsAssigneeDataType0): diff --git a/rootly_sdk/models/shift_relationships_assignee_data_type_0.py b/rootly_sdk/models/shift_relationships_assignee_data_type_0.py index 378c8a6b..aeb1080c 100644 --- a/rootly_sdk/models/shift_relationships_assignee_data_type_0.py +++ b/rootly_sdk/models/shift_relationships_assignee_data_type_0.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class ShiftRelationshipsAssigneeDataType0: type_ (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - type_: Union[Unset, str] = UNSET + id: Unset | str = UNSET + type_: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/shift_relationships_shift_override.py b/rootly_sdk/models/shift_relationships_shift_override.py index e070c6bb..d90fc42e 100644 --- a/rootly_sdk/models/shift_relationships_shift_override.py +++ b/rootly_sdk/models/shift_relationships_shift_override.py @@ -26,7 +26,7 @@ class ShiftRelationshipsShiftOverride: def to_dict(self) -> dict[str, Any]: from ..models.shift_relationships_shift_override_data_type_0 import ShiftRelationshipsShiftOverrideDataType0 - data: Union[None, Unset, dict[str, Any]] + data: None | Unset | dict[str, Any] if isinstance(self.data, Unset): data = UNSET elif isinstance(self.data, ShiftRelationshipsShiftOverrideDataType0): diff --git a/rootly_sdk/models/shift_relationships_shift_override_data_type_0.py b/rootly_sdk/models/shift_relationships_shift_override_data_type_0.py index d9ecf6b6..914df41a 100644 --- a/rootly_sdk/models/shift_relationships_shift_override_data_type_0.py +++ b/rootly_sdk/models/shift_relationships_shift_override_data_type_0.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,14 +21,14 @@ class ShiftRelationshipsShiftOverrideDataType0: type_ (Union[Unset, ShiftRelationshipsShiftOverrideDataType0Type]): """ - id: Union[Unset, str] = UNSET - type_: Union[Unset, ShiftRelationshipsShiftOverrideDataType0Type] = UNSET + id: Unset | str = UNSET + type_: Unset | ShiftRelationshipsShiftOverrideDataType0Type = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: id = self.id - type_: Union[Unset, str] = UNSET + type_: Unset | str = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ @@ -48,7 +48,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: id = d.pop("id", UNSET) _type_ = d.pop("type", UNSET) - type_: Union[Unset, ShiftRelationshipsShiftOverrideDataType0Type] + type_: Unset | ShiftRelationshipsShiftOverrideDataType0Type if isinstance(_type_, Unset): type_ = UNSET else: diff --git a/rootly_sdk/models/shift_relationships_user.py b/rootly_sdk/models/shift_relationships_user.py index 69e23839..b8b6e5f6 100644 --- a/rootly_sdk/models/shift_relationships_user.py +++ b/rootly_sdk/models/shift_relationships_user.py @@ -26,7 +26,7 @@ class ShiftRelationshipsUser: def to_dict(self) -> dict[str, Any]: from ..models.shift_relationships_user_data_type_0 import ShiftRelationshipsUserDataType0 - data: Union[None, Unset, dict[str, Any]] + data: None | Unset | dict[str, Any] if isinstance(self.data, Unset): data = UNSET elif isinstance(self.data, ShiftRelationshipsUserDataType0): diff --git a/rootly_sdk/models/shift_relationships_user_data_type_0.py b/rootly_sdk/models/shift_relationships_user_data_type_0.py index 39d6ebf6..d7a7fea9 100644 --- a/rootly_sdk/models/shift_relationships_user_data_type_0.py +++ b/rootly_sdk/models/shift_relationships_user_data_type_0.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,14 +21,14 @@ class ShiftRelationshipsUserDataType0: type_ (Union[Unset, ShiftRelationshipsUserDataType0Type]): """ - id: Union[Unset, str] = UNSET - type_: Union[Unset, ShiftRelationshipsUserDataType0Type] = UNSET + id: Unset | str = UNSET + type_: Unset | ShiftRelationshipsUserDataType0Type = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: id = self.id - type_: Union[Unset, str] = UNSET + type_: Unset | str = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ @@ -48,7 +48,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: id = d.pop("id", UNSET) _type_ = d.pop("type", UNSET) - type_: Union[Unset, ShiftRelationshipsUserDataType0Type] + type_: Unset | ShiftRelationshipsUserDataType0Type if isinstance(_type_, Unset): type_ = UNSET else: diff --git a/rootly_sdk/models/simple_trigger_params.py b/rootly_sdk/models/simple_trigger_params.py index dbe827df..de2934e1 100644 --- a/rootly_sdk/models/simple_trigger_params.py +++ b/rootly_sdk/models/simple_trigger_params.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -26,13 +26,13 @@ class SimpleTriggerParams: """ trigger_type: SimpleTriggerParamsTriggerType - triggers: Union[Unset, list[SimpleTriggerParamsTriggersItem]] = UNSET + triggers: Unset | list[SimpleTriggerParamsTriggersItem] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: trigger_type: str = self.trigger_type - triggers: Union[Unset, list[str]] = UNSET + triggers: Unset | list[str] = UNSET if not isinstance(self.triggers, Unset): triggers = [] for triggers_item_data in self.triggers: diff --git a/rootly_sdk/models/sla.py b/rootly_sdk/models/sla.py index 370aff94..97f74a91 100644 --- a/rootly_sdk/models/sla.py +++ b/rootly_sdk/models/sla.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from uuid import UUID from attrs import define as _attrs_define @@ -57,18 +57,18 @@ class Sla: completion_deadline_parent_status: str created_at: str updated_at: str - slug: Union[Unset, str] = UNSET - description: Union[None, Unset, str] = UNSET - position: Union[Unset, int] = UNSET - entity_type: Union[Unset, SlaEntityType] = UNSET - manager_role_id: Union[None, UUID, Unset] = UNSET - manager_user_id: Union[None, Unset, int] = UNSET - assignment_deadline_sub_status_id: Union[None, UUID, Unset] = UNSET - assignment_skip_weekends: Union[Unset, bool] = UNSET - completion_deadline_sub_status_id: Union[None, UUID, Unset] = UNSET - completion_skip_weekends: Union[Unset, bool] = UNSET - conditions: Union[Unset, list["SlaConditionsItem"]] = UNSET - notification_configurations: Union[Unset, list["SlaNotificationConfigurationsItem"]] = UNSET + slug: Unset | str = UNSET + description: None | Unset | str = UNSET + position: Unset | int = UNSET + entity_type: Unset | SlaEntityType = UNSET + manager_role_id: None | UUID | Unset = UNSET + manager_user_id: None | Unset | int = UNSET + assignment_deadline_sub_status_id: None | UUID | Unset = UNSET + assignment_skip_weekends: Unset | bool = UNSET + completion_deadline_sub_status_id: None | UUID | Unset = UNSET + completion_skip_weekends: Unset | bool = UNSET + conditions: Unset | list["SlaConditionsItem"] = UNSET + notification_configurations: Unset | list["SlaNotificationConfigurationsItem"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -90,7 +90,7 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: @@ -98,11 +98,11 @@ def to_dict(self) -> dict[str, Any]: position = self.position - entity_type: Union[Unset, str] = UNSET + entity_type: Unset | str = UNSET if not isinstance(self.entity_type, Unset): entity_type = self.entity_type - manager_role_id: Union[None, Unset, str] + manager_role_id: None | Unset | str if isinstance(self.manager_role_id, Unset): manager_role_id = UNSET elif isinstance(self.manager_role_id, UUID): @@ -110,13 +110,13 @@ def to_dict(self) -> dict[str, Any]: else: manager_role_id = self.manager_role_id - manager_user_id: Union[None, Unset, int] + manager_user_id: None | Unset | int if isinstance(self.manager_user_id, Unset): manager_user_id = UNSET else: manager_user_id = self.manager_user_id - assignment_deadline_sub_status_id: Union[None, Unset, str] + assignment_deadline_sub_status_id: None | Unset | str if isinstance(self.assignment_deadline_sub_status_id, Unset): assignment_deadline_sub_status_id = UNSET elif isinstance(self.assignment_deadline_sub_status_id, UUID): @@ -126,7 +126,7 @@ def to_dict(self) -> dict[str, Any]: assignment_skip_weekends = self.assignment_skip_weekends - completion_deadline_sub_status_id: Union[None, Unset, str] + completion_deadline_sub_status_id: None | Unset | str if isinstance(self.completion_deadline_sub_status_id, Unset): completion_deadline_sub_status_id = UNSET elif isinstance(self.completion_deadline_sub_status_id, UUID): @@ -136,14 +136,14 @@ def to_dict(self) -> dict[str, Any]: completion_skip_weekends = self.completion_skip_weekends - conditions: Union[Unset, list[dict[str, Any]]] = UNSET + conditions: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.conditions, Unset): conditions = [] for conditions_item_data in self.conditions: conditions_item = conditions_item_data.to_dict() conditions.append(conditions_item) - notification_configurations: Union[Unset, list[dict[str, Any]]] = UNSET + notification_configurations: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.notification_configurations, Unset): notification_configurations = [] for notification_configurations_item_data in self.notification_configurations: @@ -215,25 +215,25 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: slug = d.pop("slug", UNSET) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) position = d.pop("position", UNSET) _entity_type = d.pop("entity_type", UNSET) - entity_type: Union[Unset, SlaEntityType] + entity_type: Unset | SlaEntityType if isinstance(_entity_type, Unset): entity_type = UNSET else: entity_type = check_sla_entity_type(_entity_type) - def _parse_manager_role_id(data: object) -> Union[None, UUID, Unset]: + def _parse_manager_role_id(data: object) -> None | UUID | Unset: if data is None: return data if isinstance(data, Unset): @@ -246,20 +246,20 @@ def _parse_manager_role_id(data: object) -> Union[None, UUID, Unset]: return manager_role_id_type_0 except: # noqa: E722 pass - return cast(Union[None, UUID, Unset], data) + return cast(None | UUID | Unset, data) manager_role_id = _parse_manager_role_id(d.pop("manager_role_id", UNSET)) - def _parse_manager_user_id(data: object) -> Union[None, Unset, int]: + def _parse_manager_user_id(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) manager_user_id = _parse_manager_user_id(d.pop("manager_user_id", UNSET)) - def _parse_assignment_deadline_sub_status_id(data: object) -> Union[None, UUID, Unset]: + def _parse_assignment_deadline_sub_status_id(data: object) -> None | UUID | Unset: if data is None: return data if isinstance(data, Unset): @@ -272,7 +272,7 @@ def _parse_assignment_deadline_sub_status_id(data: object) -> Union[None, UUID, return assignment_deadline_sub_status_id_type_0 except: # noqa: E722 pass - return cast(Union[None, UUID, Unset], data) + return cast(None | UUID | Unset, data) assignment_deadline_sub_status_id = _parse_assignment_deadline_sub_status_id( d.pop("assignment_deadline_sub_status_id", UNSET) @@ -280,7 +280,7 @@ def _parse_assignment_deadline_sub_status_id(data: object) -> Union[None, UUID, assignment_skip_weekends = d.pop("assignment_skip_weekends", UNSET) - def _parse_completion_deadline_sub_status_id(data: object) -> Union[None, UUID, Unset]: + def _parse_completion_deadline_sub_status_id(data: object) -> None | UUID | Unset: if data is None: return data if isinstance(data, Unset): @@ -293,7 +293,7 @@ def _parse_completion_deadline_sub_status_id(data: object) -> Union[None, UUID, return completion_deadline_sub_status_id_type_0 except: # noqa: E722 pass - return cast(Union[None, UUID, Unset], data) + return cast(None | UUID | Unset, data) completion_deadline_sub_status_id = _parse_completion_deadline_sub_status_id( d.pop("completion_deadline_sub_status_id", UNSET) diff --git a/rootly_sdk/models/sla_conditions_item.py b/rootly_sdk/models/sla_conditions_item.py index 6042e1f8..cdaffff6 100644 --- a/rootly_sdk/models/sla_conditions_item.py +++ b/rootly_sdk/models/sla_conditions_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from uuid import UUID from attrs import define as _attrs_define @@ -27,27 +27,27 @@ class SlaConditionsItem: form_field_id (Union[None, UUID, Unset]): The ID of the form field (for custom field conditions) """ - id: Union[Unset, UUID] = UNSET - position: Union[Unset, int] = UNSET - conditionable_type: Union[Unset, SlaConditionsItemConditionableType] = UNSET - property_: Union[None, Unset, str] = UNSET - operator: Union[Unset, str] = UNSET - values: Union[None, Unset, list[str]] = UNSET - form_field_id: Union[None, UUID, Unset] = UNSET + id: Unset | UUID = UNSET + position: Unset | int = UNSET + conditionable_type: Unset | SlaConditionsItemConditionableType = UNSET + property_: None | Unset | str = UNSET + operator: Unset | str = UNSET + values: None | Unset | list[str] = UNSET + form_field_id: None | UUID | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id: Union[Unset, str] = UNSET + id: Unset | str = UNSET if not isinstance(self.id, Unset): id = str(self.id) position = self.position - conditionable_type: Union[Unset, str] = UNSET + conditionable_type: Unset | str = UNSET if not isinstance(self.conditionable_type, Unset): conditionable_type = self.conditionable_type - property_: Union[None, Unset, str] + property_: None | Unset | str if isinstance(self.property_, Unset): property_ = UNSET else: @@ -55,7 +55,7 @@ def to_dict(self) -> dict[str, Any]: operator = self.operator - values: Union[None, Unset, list[str]] + values: None | Unset | list[str] if isinstance(self.values, Unset): values = UNSET elif isinstance(self.values, list): @@ -64,7 +64,7 @@ def to_dict(self) -> dict[str, Any]: else: values = self.values - form_field_id: Union[None, Unset, str] + form_field_id: None | Unset | str if isinstance(self.form_field_id, Unset): form_field_id = UNSET elif isinstance(self.form_field_id, UUID): @@ -96,7 +96,7 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _id = d.pop("id", UNSET) - id: Union[Unset, UUID] + id: Unset | UUID if isinstance(_id, Unset): id = UNSET else: @@ -105,24 +105,24 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: position = d.pop("position", UNSET) _conditionable_type = d.pop("conditionable_type", UNSET) - conditionable_type: Union[Unset, SlaConditionsItemConditionableType] + conditionable_type: Unset | SlaConditionsItemConditionableType if isinstance(_conditionable_type, Unset): conditionable_type = UNSET else: conditionable_type = check_sla_conditions_item_conditionable_type(_conditionable_type) - def _parse_property_(data: object) -> Union[None, Unset, str]: + def _parse_property_(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) property_ = _parse_property_(d.pop("property", UNSET)) operator = d.pop("operator", UNSET) - def _parse_values(data: object) -> Union[None, Unset, list[str]]: + def _parse_values(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -135,11 +135,11 @@ def _parse_values(data: object) -> Union[None, Unset, list[str]]: return values_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) values = _parse_values(d.pop("values", UNSET)) - def _parse_form_field_id(data: object) -> Union[None, UUID, Unset]: + def _parse_form_field_id(data: object) -> None | UUID | Unset: if data is None: return data if isinstance(data, Unset): @@ -152,7 +152,7 @@ def _parse_form_field_id(data: object) -> Union[None, UUID, Unset]: return form_field_id_type_0 except: # noqa: E722 pass - return cast(Union[None, UUID, Unset], data) + return cast(None | UUID | Unset, data) form_field_id = _parse_form_field_id(d.pop("form_field_id", UNSET)) diff --git a/rootly_sdk/models/sla_list.py b/rootly_sdk/models/sla_list.py index 0f4611af..0294d0ef 100644 --- a/rootly_sdk/models/sla_list.py +++ b/rootly_sdk/models/sla_list.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,7 +29,7 @@ class SlaList: data: list["SlaListDataItem"] links: "Links" meta: "Meta" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/sla_notification_configurations_item.py b/rootly_sdk/models/sla_notification_configurations_item.py index 26abd32e..0bb4b920 100644 --- a/rootly_sdk/models/sla_notification_configurations_item.py +++ b/rootly_sdk/models/sla_notification_configurations_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from uuid import UUID from attrs import define as _attrs_define @@ -26,19 +26,19 @@ class SlaNotificationConfigurationsItem: updated_at (Union[Unset, str]): Date of last update """ - id: Union[Unset, UUID] = UNSET - offset_type: Union[Unset, SlaNotificationConfigurationsItemOffsetType] = UNSET - offset_days: Union[Unset, int] = UNSET - created_at: Union[Unset, str] = UNSET - updated_at: Union[Unset, str] = UNSET + id: Unset | UUID = UNSET + offset_type: Unset | SlaNotificationConfigurationsItemOffsetType = UNSET + offset_days: Unset | int = UNSET + created_at: Unset | str = UNSET + updated_at: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id: Union[Unset, str] = UNSET + id: Unset | str = UNSET if not isinstance(self.id, Unset): id = str(self.id) - offset_type: Union[Unset, str] = UNSET + offset_type: Unset | str = UNSET if not isinstance(self.offset_type, Unset): offset_type = self.offset_type @@ -68,14 +68,14 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _id = d.pop("id", UNSET) - id: Union[Unset, UUID] + id: Unset | UUID if isinstance(_id, Unset): id = UNSET else: id = UUID(_id) _offset_type = d.pop("offset_type", UNSET) - offset_type: Union[Unset, SlaNotificationConfigurationsItemOffsetType] + offset_type: Unset | SlaNotificationConfigurationsItemOffsetType if isinstance(_offset_type, Unset): offset_type = UNSET else: diff --git a/rootly_sdk/models/sla_response.py b/rootly_sdk/models/sla_response.py index 2b0d485c..c884fbe7 100644 --- a/rootly_sdk/models/sla_response.py +++ b/rootly_sdk/models/sla_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,13 +23,13 @@ class SlaResponse: """ data: "SlaResponseData" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/snapshot_datadog_graph_task_params.py b/rootly_sdk/models/snapshot_datadog_graph_task_params.py index 5f545c82..f4a21240 100644 --- a/rootly_sdk/models/snapshot_datadog_graph_task_params.py +++ b/rootly_sdk/models/snapshot_datadog_graph_task_params.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -33,34 +33,34 @@ class SnapshotDatadogGraphTaskParams: """ past_duration: str - task_type: Union[Unset, SnapshotDatadogGraphTaskParamsTaskType] = UNSET - dashboards: Union[Unset, list["SnapshotDatadogGraphTaskParamsDashboardsItem"]] = UNSET - metric_queries: Union[Unset, list[str]] = UNSET - post_to_incident_timeline: Union[Unset, bool] = UNSET - post_to_slack_channels: Union[Unset, list["SnapshotDatadogGraphTaskParamsPostToSlackChannelsItem"]] = UNSET + task_type: Unset | SnapshotDatadogGraphTaskParamsTaskType = UNSET + dashboards: Unset | list["SnapshotDatadogGraphTaskParamsDashboardsItem"] = UNSET + metric_queries: Unset | list[str] = UNSET + post_to_incident_timeline: Unset | bool = UNSET + post_to_slack_channels: Unset | list["SnapshotDatadogGraphTaskParamsPostToSlackChannelsItem"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: past_duration = self.past_duration - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - dashboards: Union[Unset, list[dict[str, Any]]] = UNSET + dashboards: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.dashboards, Unset): dashboards = [] for dashboards_item_data in self.dashboards: dashboards_item = dashboards_item_data.to_dict() dashboards.append(dashboards_item) - metric_queries: Union[Unset, list[str]] = UNSET + metric_queries: Unset | list[str] = UNSET if not isinstance(self.metric_queries, Unset): metric_queries = self.metric_queries post_to_incident_timeline = self.post_to_incident_timeline - post_to_slack_channels: Union[Unset, list[dict[str, Any]]] = UNSET + post_to_slack_channels: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.post_to_slack_channels, Unset): post_to_slack_channels = [] for post_to_slack_channels_item_data in self.post_to_slack_channels: @@ -100,7 +100,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: past_duration = d.pop("past_duration") _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, SnapshotDatadogGraphTaskParamsTaskType] + task_type: Unset | SnapshotDatadogGraphTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/snapshot_datadog_graph_task_params_dashboards_item.py b/rootly_sdk/models/snapshot_datadog_graph_task_params_dashboards_item.py index fe4cdea2..7b7b6330 100644 --- a/rootly_sdk/models/snapshot_datadog_graph_task_params_dashboards_item.py +++ b/rootly_sdk/models/snapshot_datadog_graph_task_params_dashboards_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class SnapshotDatadogGraphTaskParamsDashboardsItem: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/snapshot_datadog_graph_task_params_post_to_slack_channels_item.py b/rootly_sdk/models/snapshot_datadog_graph_task_params_post_to_slack_channels_item.py index b020eb6b..ea37cf49 100644 --- a/rootly_sdk/models/snapshot_datadog_graph_task_params_post_to_slack_channels_item.py +++ b/rootly_sdk/models/snapshot_datadog_graph_task_params_post_to_slack_channels_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class SnapshotDatadogGraphTaskParamsPostToSlackChannelsItem: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/snapshot_grafana_dashboard_task_params.py b/rootly_sdk/models/snapshot_grafana_dashboard_task_params.py index fe9d2ab9..96877abd 100644 --- a/rootly_sdk/models/snapshot_grafana_dashboard_task_params.py +++ b/rootly_sdk/models/snapshot_grafana_dashboard_task_params.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -33,9 +33,9 @@ class SnapshotGrafanaDashboardTaskParams: """ dashboards: list["SnapshotGrafanaDashboardTaskParamsDashboardsItem"] - task_type: Union[Unset, SnapshotGrafanaDashboardTaskParamsTaskType] = UNSET - post_to_incident_timeline: Union[Unset, bool] = UNSET - post_to_slack_channels: Union[Unset, list["SnapshotGrafanaDashboardTaskParamsPostToSlackChannelsItem"]] = UNSET + task_type: Unset | SnapshotGrafanaDashboardTaskParamsTaskType = UNSET + post_to_incident_timeline: Unset | bool = UNSET + post_to_slack_channels: Unset | list["SnapshotGrafanaDashboardTaskParamsPostToSlackChannelsItem"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -44,13 +44,13 @@ def to_dict(self) -> dict[str, Any]: dashboards_item = dashboards_item_data.to_dict() dashboards.append(dashboards_item) - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type post_to_incident_timeline = self.post_to_incident_timeline - post_to_slack_channels: Union[Unset, list[dict[str, Any]]] = UNSET + post_to_slack_channels: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.post_to_slack_channels, Unset): post_to_slack_channels = [] for post_to_slack_channels_item_data in self.post_to_slack_channels: @@ -91,7 +91,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: dashboards.append(dashboards_item) _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, SnapshotGrafanaDashboardTaskParamsTaskType] + task_type: Unset | SnapshotGrafanaDashboardTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/snapshot_grafana_dashboard_task_params_dashboards_item.py b/rootly_sdk/models/snapshot_grafana_dashboard_task_params_dashboards_item.py index af6bbf6b..4c028f49 100644 --- a/rootly_sdk/models/snapshot_grafana_dashboard_task_params_dashboards_item.py +++ b/rootly_sdk/models/snapshot_grafana_dashboard_task_params_dashboards_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class SnapshotGrafanaDashboardTaskParamsDashboardsItem: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/snapshot_grafana_dashboard_task_params_post_to_slack_channels_item.py b/rootly_sdk/models/snapshot_grafana_dashboard_task_params_post_to_slack_channels_item.py index 465e50ef..0edaa27c 100644 --- a/rootly_sdk/models/snapshot_grafana_dashboard_task_params_post_to_slack_channels_item.py +++ b/rootly_sdk/models/snapshot_grafana_dashboard_task_params_post_to_slack_channels_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class SnapshotGrafanaDashboardTaskParamsPostToSlackChannelsItem: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/snapshot_looker_look_task_params.py b/rootly_sdk/models/snapshot_looker_look_task_params.py index f4cf0f08..87fb439c 100644 --- a/rootly_sdk/models/snapshot_looker_look_task_params.py +++ b/rootly_sdk/models/snapshot_looker_look_task_params.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -31,9 +31,9 @@ class SnapshotLookerLookTaskParams: """ dashboards: list["SnapshotLookerLookTaskParamsDashboardsItem"] - task_type: Union[Unset, SnapshotLookerLookTaskParamsTaskType] = UNSET - post_to_incident_timeline: Union[Unset, bool] = UNSET - post_to_slack_channels: Union[Unset, list["SnapshotLookerLookTaskParamsPostToSlackChannelsItem"]] = UNSET + task_type: Unset | SnapshotLookerLookTaskParamsTaskType = UNSET + post_to_incident_timeline: Unset | bool = UNSET + post_to_slack_channels: Unset | list["SnapshotLookerLookTaskParamsPostToSlackChannelsItem"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,13 +42,13 @@ def to_dict(self) -> dict[str, Any]: dashboards_item = dashboards_item_data.to_dict() dashboards.append(dashboards_item) - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type post_to_incident_timeline = self.post_to_incident_timeline - post_to_slack_channels: Union[Unset, list[dict[str, Any]]] = UNSET + post_to_slack_channels: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.post_to_slack_channels, Unset): post_to_slack_channels = [] for post_to_slack_channels_item_data in self.post_to_slack_channels: @@ -87,7 +87,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: dashboards.append(dashboards_item) _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, SnapshotLookerLookTaskParamsTaskType] + task_type: Unset | SnapshotLookerLookTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/snapshot_looker_look_task_params_dashboards_item.py b/rootly_sdk/models/snapshot_looker_look_task_params_dashboards_item.py index 11a21793..3a5baf68 100644 --- a/rootly_sdk/models/snapshot_looker_look_task_params_dashboards_item.py +++ b/rootly_sdk/models/snapshot_looker_look_task_params_dashboards_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class SnapshotLookerLookTaskParamsDashboardsItem: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/snapshot_looker_look_task_params_post_to_slack_channels_item.py b/rootly_sdk/models/snapshot_looker_look_task_params_post_to_slack_channels_item.py index 949b2090..fde08d8f 100644 --- a/rootly_sdk/models/snapshot_looker_look_task_params_post_to_slack_channels_item.py +++ b/rootly_sdk/models/snapshot_looker_look_task_params_post_to_slack_channels_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class SnapshotLookerLookTaskParamsPostToSlackChannelsItem: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/snapshot_new_relic_graph_task_params.py b/rootly_sdk/models/snapshot_new_relic_graph_task_params.py index 7dda353c..aa99c427 100644 --- a/rootly_sdk/models/snapshot_new_relic_graph_task_params.py +++ b/rootly_sdk/models/snapshot_new_relic_graph_task_params.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -36,9 +36,9 @@ class SnapshotNewRelicGraphTaskParams: metric_query: str metric_type: SnapshotNewRelicGraphTaskParamsMetricType - task_type: Union[Unset, SnapshotNewRelicGraphTaskParamsTaskType] = UNSET - post_to_incident_timeline: Union[Unset, bool] = UNSET - post_to_slack_channels: Union[Unset, list["SnapshotNewRelicGraphTaskParamsPostToSlackChannelsItem"]] = UNSET + task_type: Unset | SnapshotNewRelicGraphTaskParamsTaskType = UNSET + post_to_incident_timeline: Unset | bool = UNSET + post_to_slack_channels: Unset | list["SnapshotNewRelicGraphTaskParamsPostToSlackChannelsItem"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -46,13 +46,13 @@ def to_dict(self) -> dict[str, Any]: metric_type: str = self.metric_type - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type post_to_incident_timeline = self.post_to_incident_timeline - post_to_slack_channels: Union[Unset, list[dict[str, Any]]] = UNSET + post_to_slack_channels: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.post_to_slack_channels, Unset): post_to_slack_channels = [] for post_to_slack_channels_item_data in self.post_to_slack_channels: @@ -88,7 +88,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: metric_type = check_snapshot_new_relic_graph_task_params_metric_type(d.pop("metric_type")) _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, SnapshotNewRelicGraphTaskParamsTaskType] + task_type: Unset | SnapshotNewRelicGraphTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/snapshot_new_relic_graph_task_params_post_to_slack_channels_item.py b/rootly_sdk/models/snapshot_new_relic_graph_task_params_post_to_slack_channels_item.py index e26e74be..b56e5eee 100644 --- a/rootly_sdk/models/snapshot_new_relic_graph_task_params_post_to_slack_channels_item.py +++ b/rootly_sdk/models/snapshot_new_relic_graph_task_params_post_to_slack_channels_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class SnapshotNewRelicGraphTaskParamsPostToSlackChannelsItem: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/start_session_request.py b/rootly_sdk/models/start_session_request.py index 37104e49..53697c40 100644 --- a/rootly_sdk/models/start_session_request.py +++ b/rootly_sdk/models/start_session_request.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -18,16 +18,16 @@ class StartSessionRequest: title (Union[None, Unset, str]): Human-readable label for the recording session """ - platform: Union[Unset, StartSessionRequestPlatform] = UNSET - title: Union[None, Unset, str] = UNSET + platform: Unset | StartSessionRequestPlatform = UNSET + title: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - platform: Union[Unset, str] = UNSET + platform: Unset | str = UNSET if not isinstance(self.platform, Unset): platform = self.platform - title: Union[None, Unset, str] + title: None | Unset | str if isinstance(self.title, Unset): title = UNSET else: @@ -47,18 +47,18 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _platform = d.pop("platform", UNSET) - platform: Union[Unset, StartSessionRequestPlatform] + platform: Unset | StartSessionRequestPlatform if isinstance(_platform, Unset): platform = UNSET else: platform = check_start_session_request_platform(_platform) - def _parse_title(data: object) -> Union[None, Unset, str]: + def _parse_title(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) title = _parse_title(d.pop("title", UNSET)) diff --git a/rootly_sdk/models/start_session_response.py b/rootly_sdk/models/start_session_response.py index f4d7fe0a..91ebd275 100644 --- a/rootly_sdk/models/start_session_response.py +++ b/rootly_sdk/models/start_session_response.py @@ -24,7 +24,7 @@ class StartSessionResponse: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data: Union[Unset, dict[str, Any]] = UNSET + data: Unset | dict[str, Any] = UNSET if not isinstance(self.data, Unset): data = self.data.to_dict() @@ -42,7 +42,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _data = d.pop("data", UNSET) - data: Union[Unset, StartSessionResponseData] + data: Unset | StartSessionResponseData if isinstance(_data, Unset): data = UNSET else: diff --git a/rootly_sdk/models/status.py b/rootly_sdk/models/status.py index 83d5aa1c..4059997d 100644 --- a/rootly_sdk/models/status.py +++ b/rootly_sdk/models/status.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -27,8 +27,8 @@ class Status: enabled: bool created_at: str updated_at: str - slug: Union[Unset, str] = UNSET - description: Union[None, Unset, str] = UNSET + slug: Unset | str = UNSET + description: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -44,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: @@ -83,12 +83,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: slug = d.pop("slug", UNSET) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) diff --git a/rootly_sdk/models/status_list.py b/rootly_sdk/models/status_list.py index de17d50d..56f94dd4 100644 --- a/rootly_sdk/models/status_list.py +++ b/rootly_sdk/models/status_list.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,7 +29,7 @@ class StatusList: data: list["StatusListDataItem"] links: "Links" meta: "Meta" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/status_page.py b/rootly_sdk/models/status_page.py index 964e1d2a..c6c47a56 100644 --- a/rootly_sdk/models/status_page.py +++ b/rootly_sdk/models/status_page.py @@ -75,37 +75,37 @@ class StatusPage: title: str created_at: str updated_at: str - slug: Union[Unset, str] = UNSET - public_title: Union[None, Unset, str] = UNSET - description: Union[None, Unset, str] = UNSET - public_description: Union[None, Unset, str] = UNSET - header_color: Union[None, Unset, str] = UNSET - footer_color: Union[None, Unset, str] = UNSET - allow_search_engine_index: Union[None, Unset, bool] = UNSET - show_uptime: Union[None, Unset, bool] = UNSET - show_uptime_last_days: Union[Unset, StatusPageShowUptimeLastDays] = UNSET - success_message: Union[None, Unset, str] = UNSET - failure_message: Union[None, Unset, str] = UNSET - authentication_method: Union[Unset, StatusPageAuthenticationMethod] = "none" - authentication_enabled: Union[None, Unset, bool] = False - authentication_password: Union[None, Unset, str] = UNSET - saml_idp_sso_service_url: Union[None, Unset, str] = UNSET - saml_idp_slo_service_url: Union[None, Unset, str] = UNSET - saml_idp_cert: Union[None, Unset, str] = UNSET - saml_idp_cert_fingerprint: Union[None, Unset, str] = UNSET - saml_name_identifier_format: Union[Unset, StatusPageSamlNameIdentifierFormat] = UNSET - section_order: Union[None, Unset, list[StatusPageSectionOrderType0Item]] = UNSET - website_url: Union[None, Unset, str] = UNSET - website_privacy_url: Union[None, Unset, str] = UNSET - website_support_url: Union[None, Unset, str] = UNSET - ga_tracking_id: Union[None, Unset, str] = UNSET - time_zone: Union[None, Unset, str] = "Etc/UTC" - public: Union[None, Unset, bool] = UNSET - service_ids: Union[Unset, list[str]] = UNSET - functionality_ids: Union[Unset, list[str]] = UNSET - external_domain_names: Union[Unset, list[str]] = UNSET + slug: Unset | str = UNSET + public_title: None | Unset | str = UNSET + description: None | Unset | str = UNSET + public_description: None | Unset | str = UNSET + header_color: None | Unset | str = UNSET + footer_color: None | Unset | str = UNSET + allow_search_engine_index: None | Unset | bool = UNSET + show_uptime: None | Unset | bool = UNSET + show_uptime_last_days: Unset | StatusPageShowUptimeLastDays = UNSET + success_message: None | Unset | str = UNSET + failure_message: None | Unset | str = UNSET + authentication_method: Unset | StatusPageAuthenticationMethod = "none" + authentication_enabled: None | Unset | bool = False + authentication_password: None | Unset | str = UNSET + saml_idp_sso_service_url: None | Unset | str = UNSET + saml_idp_slo_service_url: None | Unset | str = UNSET + saml_idp_cert: None | Unset | str = UNSET + saml_idp_cert_fingerprint: None | Unset | str = UNSET + saml_name_identifier_format: Unset | StatusPageSamlNameIdentifierFormat = UNSET + section_order: None | Unset | list[StatusPageSectionOrderType0Item] = UNSET + website_url: None | Unset | str = UNSET + website_privacy_url: None | Unset | str = UNSET + website_support_url: None | Unset | str = UNSET + ga_tracking_id: None | Unset | str = UNSET + time_zone: None | Unset | str = "Etc/UTC" + public: None | Unset | bool = UNSET + service_ids: Unset | list[str] = UNSET + functionality_ids: Unset | list[str] = UNSET + external_domain_names: Unset | list[str] = UNSET cname_records: Union["StatusPageCnameRecordsType0", None, Unset] = UNSET - enabled: Union[None, Unset, bool] = UNSET + enabled: None | Unset | bool = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -119,109 +119,109 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - public_title: Union[None, Unset, str] + public_title: None | Unset | str if isinstance(self.public_title, Unset): public_title = UNSET else: public_title = self.public_title - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - public_description: Union[None, Unset, str] + public_description: None | Unset | str if isinstance(self.public_description, Unset): public_description = UNSET else: public_description = self.public_description - header_color: Union[None, Unset, str] + header_color: None | Unset | str if isinstance(self.header_color, Unset): header_color = UNSET else: header_color = self.header_color - footer_color: Union[None, Unset, str] + footer_color: None | Unset | str if isinstance(self.footer_color, Unset): footer_color = UNSET else: footer_color = self.footer_color - allow_search_engine_index: Union[None, Unset, bool] + allow_search_engine_index: None | Unset | bool if isinstance(self.allow_search_engine_index, Unset): allow_search_engine_index = UNSET else: allow_search_engine_index = self.allow_search_engine_index - show_uptime: Union[None, Unset, bool] + show_uptime: None | Unset | bool if isinstance(self.show_uptime, Unset): show_uptime = UNSET else: show_uptime = self.show_uptime - show_uptime_last_days: Union[Unset, int] = UNSET + show_uptime_last_days: Unset | int = UNSET if not isinstance(self.show_uptime_last_days, Unset): show_uptime_last_days = self.show_uptime_last_days - success_message: Union[None, Unset, str] + success_message: None | Unset | str if isinstance(self.success_message, Unset): success_message = UNSET else: success_message = self.success_message - failure_message: Union[None, Unset, str] + failure_message: None | Unset | str if isinstance(self.failure_message, Unset): failure_message = UNSET else: failure_message = self.failure_message - authentication_method: Union[Unset, str] = UNSET + authentication_method: Unset | str = UNSET if not isinstance(self.authentication_method, Unset): authentication_method = self.authentication_method - authentication_enabled: Union[None, Unset, bool] + authentication_enabled: None | Unset | bool if isinstance(self.authentication_enabled, Unset): authentication_enabled = UNSET else: authentication_enabled = self.authentication_enabled - authentication_password: Union[None, Unset, str] + authentication_password: None | Unset | str if isinstance(self.authentication_password, Unset): authentication_password = UNSET else: authentication_password = self.authentication_password - saml_idp_sso_service_url: Union[None, Unset, str] + saml_idp_sso_service_url: None | Unset | str if isinstance(self.saml_idp_sso_service_url, Unset): saml_idp_sso_service_url = UNSET else: saml_idp_sso_service_url = self.saml_idp_sso_service_url - saml_idp_slo_service_url: Union[None, Unset, str] + saml_idp_slo_service_url: None | Unset | str if isinstance(self.saml_idp_slo_service_url, Unset): saml_idp_slo_service_url = UNSET else: saml_idp_slo_service_url = self.saml_idp_slo_service_url - saml_idp_cert: Union[None, Unset, str] + saml_idp_cert: None | Unset | str if isinstance(self.saml_idp_cert, Unset): saml_idp_cert = UNSET else: saml_idp_cert = self.saml_idp_cert - saml_idp_cert_fingerprint: Union[None, Unset, str] + saml_idp_cert_fingerprint: None | Unset | str if isinstance(self.saml_idp_cert_fingerprint, Unset): saml_idp_cert_fingerprint = UNSET else: saml_idp_cert_fingerprint = self.saml_idp_cert_fingerprint - saml_name_identifier_format: Union[Unset, str] = UNSET + saml_name_identifier_format: Unset | str = UNSET if not isinstance(self.saml_name_identifier_format, Unset): saml_name_identifier_format = self.saml_name_identifier_format - section_order: Union[None, Unset, list[str]] + section_order: None | Unset | list[str] if isinstance(self.section_order, Unset): section_order = UNSET elif isinstance(self.section_order, list): @@ -233,55 +233,55 @@ def to_dict(self) -> dict[str, Any]: else: section_order = self.section_order - website_url: Union[None, Unset, str] + website_url: None | Unset | str if isinstance(self.website_url, Unset): website_url = UNSET else: website_url = self.website_url - website_privacy_url: Union[None, Unset, str] + website_privacy_url: None | Unset | str if isinstance(self.website_privacy_url, Unset): website_privacy_url = UNSET else: website_privacy_url = self.website_privacy_url - website_support_url: Union[None, Unset, str] + website_support_url: None | Unset | str if isinstance(self.website_support_url, Unset): website_support_url = UNSET else: website_support_url = self.website_support_url - ga_tracking_id: Union[None, Unset, str] + ga_tracking_id: None | Unset | str if isinstance(self.ga_tracking_id, Unset): ga_tracking_id = UNSET else: ga_tracking_id = self.ga_tracking_id - time_zone: Union[None, Unset, str] + time_zone: None | Unset | str if isinstance(self.time_zone, Unset): time_zone = UNSET else: time_zone = self.time_zone - public: Union[None, Unset, bool] + public: None | Unset | bool if isinstance(self.public, Unset): public = UNSET else: public = self.public - service_ids: Union[Unset, list[str]] = UNSET + service_ids: Unset | list[str] = UNSET if not isinstance(self.service_ids, Unset): service_ids = self.service_ids - functionality_ids: Union[Unset, list[str]] = UNSET + functionality_ids: Unset | list[str] = UNSET if not isinstance(self.functionality_ids, Unset): functionality_ids = self.functionality_ids - external_domain_names: Union[Unset, list[str]] = UNSET + external_domain_names: Unset | list[str] = UNSET if not isinstance(self.external_domain_names, Unset): external_domain_names = self.external_domain_names - cname_records: Union[None, Unset, dict[str, Any]] + cname_records: None | Unset | dict[str, Any] if isinstance(self.cname_records, Unset): cname_records = UNSET elif isinstance(self.cname_records, StatusPageCnameRecordsType0): @@ -289,7 +289,7 @@ def to_dict(self) -> dict[str, Any]: else: cname_records = self.cname_records - enabled: Union[None, Unset, bool] + enabled: None | Unset | bool if isinstance(self.enabled, Unset): enabled = UNSET else: @@ -382,163 +382,163 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: slug = d.pop("slug", UNSET) - def _parse_public_title(data: object) -> Union[None, Unset, str]: + def _parse_public_title(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) public_title = _parse_public_title(d.pop("public_title", UNSET)) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_public_description(data: object) -> Union[None, Unset, str]: + def _parse_public_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) public_description = _parse_public_description(d.pop("public_description", UNSET)) - def _parse_header_color(data: object) -> Union[None, Unset, str]: + def _parse_header_color(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) header_color = _parse_header_color(d.pop("header_color", UNSET)) - def _parse_footer_color(data: object) -> Union[None, Unset, str]: + def _parse_footer_color(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) footer_color = _parse_footer_color(d.pop("footer_color", UNSET)) - def _parse_allow_search_engine_index(data: object) -> Union[None, Unset, bool]: + def _parse_allow_search_engine_index(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) allow_search_engine_index = _parse_allow_search_engine_index(d.pop("allow_search_engine_index", UNSET)) - def _parse_show_uptime(data: object) -> Union[None, Unset, bool]: + def _parse_show_uptime(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) show_uptime = _parse_show_uptime(d.pop("show_uptime", UNSET)) _show_uptime_last_days = d.pop("show_uptime_last_days", UNSET) - show_uptime_last_days: Union[Unset, StatusPageShowUptimeLastDays] + show_uptime_last_days: Unset | StatusPageShowUptimeLastDays if isinstance(_show_uptime_last_days, Unset): show_uptime_last_days = UNSET else: show_uptime_last_days = check_status_page_show_uptime_last_days(_show_uptime_last_days) - def _parse_success_message(data: object) -> Union[None, Unset, str]: + def _parse_success_message(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) success_message = _parse_success_message(d.pop("success_message", UNSET)) - def _parse_failure_message(data: object) -> Union[None, Unset, str]: + def _parse_failure_message(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) failure_message = _parse_failure_message(d.pop("failure_message", UNSET)) _authentication_method = d.pop("authentication_method", UNSET) - authentication_method: Union[Unset, StatusPageAuthenticationMethod] + authentication_method: Unset | StatusPageAuthenticationMethod if isinstance(_authentication_method, Unset): authentication_method = UNSET else: authentication_method = check_status_page_authentication_method(_authentication_method) - def _parse_authentication_enabled(data: object) -> Union[None, Unset, bool]: + def _parse_authentication_enabled(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) authentication_enabled = _parse_authentication_enabled(d.pop("authentication_enabled", UNSET)) - def _parse_authentication_password(data: object) -> Union[None, Unset, str]: + def _parse_authentication_password(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) authentication_password = _parse_authentication_password(d.pop("authentication_password", UNSET)) - def _parse_saml_idp_sso_service_url(data: object) -> Union[None, Unset, str]: + def _parse_saml_idp_sso_service_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) saml_idp_sso_service_url = _parse_saml_idp_sso_service_url(d.pop("saml_idp_sso_service_url", UNSET)) - def _parse_saml_idp_slo_service_url(data: object) -> Union[None, Unset, str]: + def _parse_saml_idp_slo_service_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) saml_idp_slo_service_url = _parse_saml_idp_slo_service_url(d.pop("saml_idp_slo_service_url", UNSET)) - def _parse_saml_idp_cert(data: object) -> Union[None, Unset, str]: + def _parse_saml_idp_cert(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) saml_idp_cert = _parse_saml_idp_cert(d.pop("saml_idp_cert", UNSET)) - def _parse_saml_idp_cert_fingerprint(data: object) -> Union[None, Unset, str]: + def _parse_saml_idp_cert_fingerprint(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) saml_idp_cert_fingerprint = _parse_saml_idp_cert_fingerprint(d.pop("saml_idp_cert_fingerprint", UNSET)) _saml_name_identifier_format = d.pop("saml_name_identifier_format", UNSET) - saml_name_identifier_format: Union[Unset, StatusPageSamlNameIdentifierFormat] + saml_name_identifier_format: Unset | StatusPageSamlNameIdentifierFormat if isinstance(_saml_name_identifier_format, Unset): saml_name_identifier_format = UNSET else: saml_name_identifier_format = check_status_page_saml_name_identifier_format(_saml_name_identifier_format) - def _parse_section_order(data: object) -> Union[None, Unset, list[StatusPageSectionOrderType0Item]]: + def _parse_section_order(data: object) -> None | Unset | list[StatusPageSectionOrderType0Item]: if data is None: return data if isinstance(data, Unset): @@ -558,61 +558,61 @@ def _parse_section_order(data: object) -> Union[None, Unset, list[StatusPageSect return section_order_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[StatusPageSectionOrderType0Item]], data) + return cast(None | Unset | list[StatusPageSectionOrderType0Item], data) section_order = _parse_section_order(d.pop("section_order", UNSET)) - def _parse_website_url(data: object) -> Union[None, Unset, str]: + def _parse_website_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) website_url = _parse_website_url(d.pop("website_url", UNSET)) - def _parse_website_privacy_url(data: object) -> Union[None, Unset, str]: + def _parse_website_privacy_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) website_privacy_url = _parse_website_privacy_url(d.pop("website_privacy_url", UNSET)) - def _parse_website_support_url(data: object) -> Union[None, Unset, str]: + def _parse_website_support_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) website_support_url = _parse_website_support_url(d.pop("website_support_url", UNSET)) - def _parse_ga_tracking_id(data: object) -> Union[None, Unset, str]: + def _parse_ga_tracking_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) ga_tracking_id = _parse_ga_tracking_id(d.pop("ga_tracking_id", UNSET)) - def _parse_time_zone(data: object) -> Union[None, Unset, str]: + def _parse_time_zone(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) time_zone = _parse_time_zone(d.pop("time_zone", UNSET)) - def _parse_public(data: object) -> Union[None, Unset, bool]: + def _parse_public(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) public = _parse_public(d.pop("public", UNSET)) @@ -639,12 +639,12 @@ def _parse_cname_records(data: object) -> Union["StatusPageCnameRecordsType0", N cname_records = _parse_cname_records(d.pop("cname_records", UNSET)) - def _parse_enabled(data: object) -> Union[None, Unset, bool]: + def _parse_enabled(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) enabled = _parse_enabled(d.pop("enabled", UNSET)) diff --git a/rootly_sdk/models/status_page_announcement.py b/rootly_sdk/models/status_page_announcement.py index 534a280e..db5f70ea 100644 --- a/rootly_sdk/models/status_page_announcement.py +++ b/rootly_sdk/models/status_page_announcement.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -28,7 +28,7 @@ class StatusPageAnnouncement: published_at: str created_at: str updated_at: str - user_id: Union[None, Unset, int] = UNSET + user_id: None | Unset | int = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -44,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: updated_at = self.updated_at - user_id: Union[None, Unset, int] + user_id: None | Unset | int if isinstance(self.user_id, Unset): user_id = UNSET else: @@ -82,12 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: updated_at = d.pop("updated_at") - def _parse_user_id(data: object) -> Union[None, Unset, int]: + def _parse_user_id(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) user_id = _parse_user_id(d.pop("user_id", UNSET)) diff --git a/rootly_sdk/models/status_page_announcement_list.py b/rootly_sdk/models/status_page_announcement_list.py index 60e83b61..bc302093 100644 --- a/rootly_sdk/models/status_page_announcement_list.py +++ b/rootly_sdk/models/status_page_announcement_list.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,7 +29,7 @@ class StatusPageAnnouncementList: data: list["StatusPageAnnouncementListDataItem"] links: "Links" meta: "Meta" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/status_page_announcement_response.py b/rootly_sdk/models/status_page_announcement_response.py index 42d4333a..cc87ac39 100644 --- a/rootly_sdk/models/status_page_announcement_response.py +++ b/rootly_sdk/models/status_page_announcement_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,13 +23,13 @@ class StatusPageAnnouncementResponse: """ data: "StatusPageAnnouncementResponseData" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/status_page_component.py b/rootly_sdk/models/status_page_component.py index 8b6f6853..e6b86be7 100644 --- a/rootly_sdk/models/status_page_component.py +++ b/rootly_sdk/models/status_page_component.py @@ -1,6 +1,6 @@ import datetime from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -33,12 +33,12 @@ class StatusPageComponent: position: int created_at: datetime.datetime updated_at: datetime.datetime - status_page_component_group_id: Union[None, Unset, str] = UNSET - name: Union[None, Unset, str] = UNSET - description: Union[None, Unset, str] = UNSET - source_type: Union[None, Unset, str] = UNSET - source_id: Union[None, Unset, str] = UNSET - status: Union[Unset, StatusPageComponentStatus] = UNSET + status_page_component_group_id: None | Unset | str = UNSET + name: None | Unset | str = UNSET + description: None | Unset | str = UNSET + source_type: None | Unset | str = UNSET + source_id: None | Unset | str = UNSET + status: Unset | StatusPageComponentStatus = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -50,37 +50,37 @@ def to_dict(self) -> dict[str, Any]: updated_at = self.updated_at.isoformat() - status_page_component_group_id: Union[None, Unset, str] + status_page_component_group_id: None | Unset | str if isinstance(self.status_page_component_group_id, Unset): status_page_component_group_id = UNSET else: status_page_component_group_id = self.status_page_component_group_id - name: Union[None, Unset, str] + name: None | Unset | str if isinstance(self.name, Unset): name = UNSET else: name = self.name - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - source_type: Union[None, Unset, str] + source_type: None | Unset | str if isinstance(self.source_type, Unset): source_type = UNSET else: source_type = self.source_type - source_id: Union[None, Unset, str] + source_id: None | Unset | str if isinstance(self.source_id, Unset): source_id = UNSET else: source_id = self.source_id - status: Union[Unset, str] = UNSET + status: Unset | str = UNSET if not isinstance(self.status, Unset): status = self.status @@ -120,55 +120,55 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: updated_at = isoparse(d.pop("updated_at")) - def _parse_status_page_component_group_id(data: object) -> Union[None, Unset, str]: + def _parse_status_page_component_group_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) status_page_component_group_id = _parse_status_page_component_group_id( d.pop("status_page_component_group_id", UNSET) ) - def _parse_name(data: object) -> Union[None, Unset, str]: + def _parse_name(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) name = _parse_name(d.pop("name", UNSET)) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_source_type(data: object) -> Union[None, Unset, str]: + def _parse_source_type(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) source_type = _parse_source_type(d.pop("source_type", UNSET)) - def _parse_source_id(data: object) -> Union[None, Unset, str]: + def _parse_source_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) source_id = _parse_source_id(d.pop("source_id", UNSET)) _status = d.pop("status", UNSET) - status: Union[Unset, StatusPageComponentStatus] + status: Unset | StatusPageComponentStatus if isinstance(_status, Unset): status = UNSET else: diff --git a/rootly_sdk/models/status_page_component_group.py b/rootly_sdk/models/status_page_component_group.py index 00716130..f1847065 100644 --- a/rootly_sdk/models/status_page_component_group.py +++ b/rootly_sdk/models/status_page_component_group.py @@ -1,6 +1,6 @@ import datetime from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,8 +29,8 @@ class StatusPageComponentGroup: position: int created_at: datetime.datetime updated_at: datetime.datetime - description: Union[None, Unset, str] = UNSET - collapsed_by_default: Union[Unset, bool] = UNSET + description: None | Unset | str = UNSET + collapsed_by_default: Unset | bool = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -44,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: updated_at = self.updated_at.isoformat() - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: @@ -83,12 +83,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: updated_at = isoparse(d.pop("updated_at")) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) diff --git a/rootly_sdk/models/status_page_component_group_list.py b/rootly_sdk/models/status_page_component_group_list.py index 7b19916d..75c0e109 100644 --- a/rootly_sdk/models/status_page_component_group_list.py +++ b/rootly_sdk/models/status_page_component_group_list.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,7 +29,7 @@ class StatusPageComponentGroupList: data: list["StatusPageComponentGroupListDataItem"] links: "Links" meta: "Meta" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/status_page_component_group_response.py b/rootly_sdk/models/status_page_component_group_response.py index dc741b20..1a0db82b 100644 --- a/rootly_sdk/models/status_page_component_group_response.py +++ b/rootly_sdk/models/status_page_component_group_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,13 +23,13 @@ class StatusPageComponentGroupResponse: """ data: "StatusPageComponentGroupResponseData" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/status_page_component_list.py b/rootly_sdk/models/status_page_component_list.py index 9c570b62..7104d30e 100644 --- a/rootly_sdk/models/status_page_component_list.py +++ b/rootly_sdk/models/status_page_component_list.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,7 +29,7 @@ class StatusPageComponentList: data: list["StatusPageComponentListDataItem"] links: "Links" meta: "Meta" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/status_page_component_response.py b/rootly_sdk/models/status_page_component_response.py index 0f7c67e0..5330bd92 100644 --- a/rootly_sdk/models/status_page_component_response.py +++ b/rootly_sdk/models/status_page_component_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,13 +23,13 @@ class StatusPageComponentResponse: """ data: "StatusPageComponentResponseData" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/status_page_list.py b/rootly_sdk/models/status_page_list.py index b641db36..7fa0f7d9 100644 --- a/rootly_sdk/models/status_page_list.py +++ b/rootly_sdk/models/status_page_list.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,7 +29,7 @@ class StatusPageList: data: list["StatusPageListDataItem"] links: "Links" meta: "Meta" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/status_page_response.py b/rootly_sdk/models/status_page_response.py index a9e41904..62760d31 100644 --- a/rootly_sdk/models/status_page_response.py +++ b/rootly_sdk/models/status_page_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,13 +23,13 @@ class StatusPageResponse: """ data: "StatusPageResponseData" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/status_page_template.py b/rootly_sdk/models/status_page_template.py index 97e07199..993227c1 100644 --- a/rootly_sdk/models/status_page_template.py +++ b/rootly_sdk/models/status_page_template.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -32,12 +32,12 @@ class StatusPageTemplate: body: str created_at: str updated_at: str - update_title: Union[None, Unset, str] = UNSET - update_status: Union[None, Unset, str] = UNSET - kind: Union[Unset, StatusPageTemplateKind] = UNSET - should_notify_subscribers: Union[None, Unset, bool] = UNSET - enabled: Union[None, Unset, bool] = UNSET - position: Union[Unset, int] = UNSET + update_title: None | Unset | str = UNSET + update_status: None | Unset | str = UNSET + kind: Unset | StatusPageTemplateKind = UNSET + should_notify_subscribers: None | Unset | bool = UNSET + enabled: None | Unset | bool = UNSET + position: Unset | int = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -51,29 +51,29 @@ def to_dict(self) -> dict[str, Any]: updated_at = self.updated_at - update_title: Union[None, Unset, str] + update_title: None | Unset | str if isinstance(self.update_title, Unset): update_title = UNSET else: update_title = self.update_title - update_status: Union[None, Unset, str] + update_status: None | Unset | str if isinstance(self.update_status, Unset): update_status = UNSET else: update_status = self.update_status - kind: Union[Unset, str] = UNSET + kind: Unset | str = UNSET if not isinstance(self.kind, Unset): kind = self.kind - should_notify_subscribers: Union[None, Unset, bool] + should_notify_subscribers: None | Unset | bool if isinstance(self.should_notify_subscribers, Unset): should_notify_subscribers = UNSET else: should_notify_subscribers = self.should_notify_subscribers - enabled: Union[None, Unset, bool] + enabled: None | Unset | bool if isinstance(self.enabled, Unset): enabled = UNSET else: @@ -120,46 +120,46 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: updated_at = d.pop("updated_at") - def _parse_update_title(data: object) -> Union[None, Unset, str]: + def _parse_update_title(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) update_title = _parse_update_title(d.pop("update_title", UNSET)) - def _parse_update_status(data: object) -> Union[None, Unset, str]: + def _parse_update_status(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) update_status = _parse_update_status(d.pop("update_status", UNSET)) _kind = d.pop("kind", UNSET) - kind: Union[Unset, StatusPageTemplateKind] + kind: Unset | StatusPageTemplateKind if isinstance(_kind, Unset): kind = UNSET else: kind = check_status_page_template_kind(_kind) - def _parse_should_notify_subscribers(data: object) -> Union[None, Unset, bool]: + def _parse_should_notify_subscribers(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) should_notify_subscribers = _parse_should_notify_subscribers(d.pop("should_notify_subscribers", UNSET)) - def _parse_enabled(data: object) -> Union[None, Unset, bool]: + def _parse_enabled(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) enabled = _parse_enabled(d.pop("enabled", UNSET)) diff --git a/rootly_sdk/models/status_page_template_list.py b/rootly_sdk/models/status_page_template_list.py index 8afba654..e99a7e7a 100644 --- a/rootly_sdk/models/status_page_template_list.py +++ b/rootly_sdk/models/status_page_template_list.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,7 +29,7 @@ class StatusPageTemplateList: data: list["StatusPageTemplateListDataItem"] links: "Links" meta: "Meta" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/status_page_template_response.py b/rootly_sdk/models/status_page_template_response.py index d100ad98..70f7dfc2 100644 --- a/rootly_sdk/models/status_page_template_response.py +++ b/rootly_sdk/models/status_page_template_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,13 +23,13 @@ class StatusPageTemplateResponse: """ data: "StatusPageTemplateResponseData" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/status_response.py b/rootly_sdk/models/status_response.py index 15ec719c..cf5eaa4a 100644 --- a/rootly_sdk/models/status_response.py +++ b/rootly_sdk/models/status_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,13 +23,13 @@ class StatusResponse: """ data: "StatusResponseData" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/sub_status.py b/rootly_sdk/models/sub_status.py index bccec872..890672f8 100644 --- a/rootly_sdk/models/sub_status.py +++ b/rootly_sdk/models/sub_status.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -27,9 +27,9 @@ class SubStatus: parent_status: SubStatusParentStatus created_at: str updated_at: str - slug: Union[Unset, str] = UNSET - description: Union[None, Unset, str] = UNSET - position: Union[None, Unset, int] = UNSET + slug: Unset | str = UNSET + description: None | Unset | str = UNSET + position: None | Unset | int = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -43,13 +43,13 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - position: Union[None, Unset, int] + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: @@ -87,21 +87,21 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: slug = d.pop("slug", UNSET) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_position(data: object) -> Union[None, Unset, int]: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) diff --git a/rootly_sdk/models/sub_status_list.py b/rootly_sdk/models/sub_status_list.py index d8b8d99f..e9eaec8c 100644 --- a/rootly_sdk/models/sub_status_list.py +++ b/rootly_sdk/models/sub_status_list.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,7 +29,7 @@ class SubStatusList: data: list["SubStatusListDataItem"] links: "Links" meta: "Meta" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/sub_status_response.py b/rootly_sdk/models/sub_status_response.py index fcbf7375..06ad1b35 100644 --- a/rootly_sdk/models/sub_status_response.py +++ b/rootly_sdk/models/sub_status_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,13 +23,13 @@ class SubStatusResponse: """ data: "SubStatusResponseData" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/team.py b/rootly_sdk/models/team.py index b4a68a9e..84566f7a 100644 --- a/rootly_sdk/models/team.py +++ b/rootly_sdk/models/team.py @@ -70,36 +70,36 @@ class Team: name: str created_at: str updated_at: str - slug: Union[Unset, str] = UNSET - managed_by: Union[Unset, TeamManagedBy] = UNSET - description: Union[None, Unset, str] = UNSET - public_description: Union[None, Unset, str] = UNSET - notify_emails: Union[None, Unset, list[str]] = UNSET - color: Union[None, Unset, str] = UNSET - position: Union[None, Unset, int] = UNSET - backstage_id: Union[None, Unset, str] = UNSET - external_id: Union[None, Unset, str] = UNSET - pagerduty_id: Union[None, Unset, str] = UNSET - pagerduty_service_id: Union[None, Unset, str] = UNSET - opsgenie_id: Union[None, Unset, str] = UNSET - victor_ops_id: Union[None, Unset, str] = UNSET - pagertree_id: Union[None, Unset, str] = UNSET - cortex_id: Union[None, Unset, str] = UNSET - service_now_ci_sys_id: Union[None, Unset, str] = UNSET - user_ids: Union[None, Unset, list[int]] = UNSET - admin_ids: Union[None, Unset, list[int]] = UNSET - alerts_email_enabled: Union[None, Unset, bool] = UNSET - alerts_email_address: Union[None, Unset, str] = UNSET - alert_urgency_id: Union[None, Unset, str] = UNSET - slack_channels: Union[None, Unset, list["TeamSlackChannelsType0Item"]] = UNSET - slack_aliases: Union[None, Unset, list["TeamSlackAliasesType0Item"]] = UNSET - alert_broadcast_enabled: Union[None, Unset, bool] = UNSET + slug: Unset | str = UNSET + managed_by: Unset | TeamManagedBy = UNSET + description: None | Unset | str = UNSET + public_description: None | Unset | str = UNSET + notify_emails: None | Unset | list[str] = UNSET + color: None | Unset | str = UNSET + position: None | Unset | int = UNSET + backstage_id: None | Unset | str = UNSET + external_id: None | Unset | str = UNSET + pagerduty_id: None | Unset | str = UNSET + pagerduty_service_id: None | Unset | str = UNSET + opsgenie_id: None | Unset | str = UNSET + victor_ops_id: None | Unset | str = UNSET + pagertree_id: None | Unset | str = UNSET + cortex_id: None | Unset | str = UNSET + service_now_ci_sys_id: None | Unset | str = UNSET + user_ids: None | Unset | list[int] = UNSET + admin_ids: None | Unset | list[int] = UNSET + alerts_email_enabled: None | Unset | bool = UNSET + alerts_email_address: None | Unset | str = UNSET + alert_urgency_id: None | Unset | str = UNSET + slack_channels: None | Unset | list["TeamSlackChannelsType0Item"] = UNSET + slack_aliases: None | Unset | list["TeamSlackAliasesType0Item"] = UNSET + alert_broadcast_enabled: None | Unset | bool = UNSET alert_broadcast_channel: Union["TeamAlertBroadcastChannelType0", None, Unset] = UNSET - incident_broadcast_enabled: Union[None, Unset, bool] = UNSET + incident_broadcast_enabled: None | Unset | bool = UNSET incident_broadcast_channel: Union["TeamIncidentBroadcastChannelType0", None, Unset] = UNSET - auto_add_members_when_attached: Union[None, Unset, bool] = UNSET - auto_add_members_scope: Union[Unset, TeamAutoAddMembersScope] = UNSET - properties: Union[None, Unset, list["TeamPropertiesType0Item"]] = UNSET + auto_add_members_when_attached: None | Unset | bool = UNSET + auto_add_members_scope: Unset | TeamAutoAddMembersScope = UNSET + properties: None | Unset | list["TeamPropertiesType0Item"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -114,23 +114,23 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - managed_by: Union[Unset, str] = UNSET + managed_by: Unset | str = UNSET if not isinstance(self.managed_by, Unset): managed_by = self.managed_by - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - public_description: Union[None, Unset, str] + public_description: None | Unset | str if isinstance(self.public_description, Unset): public_description = UNSET else: public_description = self.public_description - notify_emails: Union[None, Unset, list[str]] + notify_emails: None | Unset | list[str] if isinstance(self.notify_emails, Unset): notify_emails = UNSET elif isinstance(self.notify_emails, list): @@ -139,73 +139,73 @@ def to_dict(self) -> dict[str, Any]: else: notify_emails = self.notify_emails - color: Union[None, Unset, str] + color: None | Unset | str if isinstance(self.color, Unset): color = UNSET else: color = self.color - position: Union[None, Unset, int] + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: position = self.position - backstage_id: Union[None, Unset, str] + backstage_id: None | Unset | str if isinstance(self.backstage_id, Unset): backstage_id = UNSET else: backstage_id = self.backstage_id - external_id: Union[None, Unset, str] + external_id: None | Unset | str if isinstance(self.external_id, Unset): external_id = UNSET else: external_id = self.external_id - pagerduty_id: Union[None, Unset, str] + pagerduty_id: None | Unset | str if isinstance(self.pagerduty_id, Unset): pagerduty_id = UNSET else: pagerduty_id = self.pagerduty_id - pagerduty_service_id: Union[None, Unset, str] + pagerduty_service_id: None | Unset | str if isinstance(self.pagerduty_service_id, Unset): pagerduty_service_id = UNSET else: pagerduty_service_id = self.pagerduty_service_id - opsgenie_id: Union[None, Unset, str] + opsgenie_id: None | Unset | str if isinstance(self.opsgenie_id, Unset): opsgenie_id = UNSET else: opsgenie_id = self.opsgenie_id - victor_ops_id: Union[None, Unset, str] + victor_ops_id: None | Unset | str if isinstance(self.victor_ops_id, Unset): victor_ops_id = UNSET else: victor_ops_id = self.victor_ops_id - pagertree_id: Union[None, Unset, str] + pagertree_id: None | Unset | str if isinstance(self.pagertree_id, Unset): pagertree_id = UNSET else: pagertree_id = self.pagertree_id - cortex_id: Union[None, Unset, str] + cortex_id: None | Unset | str if isinstance(self.cortex_id, Unset): cortex_id = UNSET else: cortex_id = self.cortex_id - service_now_ci_sys_id: Union[None, Unset, str] + service_now_ci_sys_id: None | Unset | str if isinstance(self.service_now_ci_sys_id, Unset): service_now_ci_sys_id = UNSET else: service_now_ci_sys_id = self.service_now_ci_sys_id - user_ids: Union[None, Unset, list[int]] + user_ids: None | Unset | list[int] if isinstance(self.user_ids, Unset): user_ids = UNSET elif isinstance(self.user_ids, list): @@ -214,7 +214,7 @@ def to_dict(self) -> dict[str, Any]: else: user_ids = self.user_ids - admin_ids: Union[None, Unset, list[int]] + admin_ids: None | Unset | list[int] if isinstance(self.admin_ids, Unset): admin_ids = UNSET elif isinstance(self.admin_ids, list): @@ -223,25 +223,25 @@ def to_dict(self) -> dict[str, Any]: else: admin_ids = self.admin_ids - alerts_email_enabled: Union[None, Unset, bool] + alerts_email_enabled: None | Unset | bool if isinstance(self.alerts_email_enabled, Unset): alerts_email_enabled = UNSET else: alerts_email_enabled = self.alerts_email_enabled - alerts_email_address: Union[None, Unset, str] + alerts_email_address: None | Unset | str if isinstance(self.alerts_email_address, Unset): alerts_email_address = UNSET else: alerts_email_address = self.alerts_email_address - alert_urgency_id: Union[None, Unset, str] + alert_urgency_id: None | Unset | str if isinstance(self.alert_urgency_id, Unset): alert_urgency_id = UNSET else: alert_urgency_id = self.alert_urgency_id - slack_channels: Union[None, Unset, list[dict[str, Any]]] + slack_channels: None | Unset | list[dict[str, Any]] if isinstance(self.slack_channels, Unset): slack_channels = UNSET elif isinstance(self.slack_channels, list): @@ -253,7 +253,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_channels = self.slack_channels - slack_aliases: Union[None, Unset, list[dict[str, Any]]] + slack_aliases: None | Unset | list[dict[str, Any]] if isinstance(self.slack_aliases, Unset): slack_aliases = UNSET elif isinstance(self.slack_aliases, list): @@ -265,13 +265,13 @@ def to_dict(self) -> dict[str, Any]: else: slack_aliases = self.slack_aliases - alert_broadcast_enabled: Union[None, Unset, bool] + alert_broadcast_enabled: None | Unset | bool if isinstance(self.alert_broadcast_enabled, Unset): alert_broadcast_enabled = UNSET else: alert_broadcast_enabled = self.alert_broadcast_enabled - alert_broadcast_channel: Union[None, Unset, dict[str, Any]] + alert_broadcast_channel: None | Unset | dict[str, Any] if isinstance(self.alert_broadcast_channel, Unset): alert_broadcast_channel = UNSET elif isinstance(self.alert_broadcast_channel, TeamAlertBroadcastChannelType0): @@ -279,13 +279,13 @@ def to_dict(self) -> dict[str, Any]: else: alert_broadcast_channel = self.alert_broadcast_channel - incident_broadcast_enabled: Union[None, Unset, bool] + incident_broadcast_enabled: None | Unset | bool if isinstance(self.incident_broadcast_enabled, Unset): incident_broadcast_enabled = UNSET else: incident_broadcast_enabled = self.incident_broadcast_enabled - incident_broadcast_channel: Union[None, Unset, dict[str, Any]] + incident_broadcast_channel: None | Unset | dict[str, Any] if isinstance(self.incident_broadcast_channel, Unset): incident_broadcast_channel = UNSET elif isinstance(self.incident_broadcast_channel, TeamIncidentBroadcastChannelType0): @@ -293,17 +293,17 @@ def to_dict(self) -> dict[str, Any]: else: incident_broadcast_channel = self.incident_broadcast_channel - auto_add_members_when_attached: Union[None, Unset, bool] + auto_add_members_when_attached: None | Unset | bool if isinstance(self.auto_add_members_when_attached, Unset): auto_add_members_when_attached = UNSET else: auto_add_members_when_attached = self.auto_add_members_when_attached - auto_add_members_scope: Union[Unset, str] = UNSET + auto_add_members_scope: Unset | str = UNSET if not isinstance(self.auto_add_members_scope, Unset): auto_add_members_scope = self.auto_add_members_scope - properties: Union[None, Unset, list[dict[str, Any]]] + properties: None | Unset | list[dict[str, Any]] if isinstance(self.properties, Unset): properties = UNSET elif isinstance(self.properties, list): @@ -405,31 +405,31 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: slug = d.pop("slug", UNSET) _managed_by = d.pop("managed_by", UNSET) - managed_by: Union[Unset, TeamManagedBy] + managed_by: Unset | TeamManagedBy if isinstance(_managed_by, Unset): managed_by = UNSET else: managed_by = check_team_managed_by(_managed_by) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_public_description(data: object) -> Union[None, Unset, str]: + def _parse_public_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) public_description = _parse_public_description(d.pop("public_description", UNSET)) - def _parse_notify_emails(data: object) -> Union[None, Unset, list[str]]: + def _parse_notify_emails(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -442,110 +442,110 @@ def _parse_notify_emails(data: object) -> Union[None, Unset, list[str]]: return notify_emails_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) notify_emails = _parse_notify_emails(d.pop("notify_emails", UNSET)) - def _parse_color(data: object) -> Union[None, Unset, str]: + def _parse_color(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) color = _parse_color(d.pop("color", UNSET)) - def _parse_position(data: object) -> Union[None, Unset, int]: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) - def _parse_backstage_id(data: object) -> Union[None, Unset, str]: + def _parse_backstage_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) backstage_id = _parse_backstage_id(d.pop("backstage_id", UNSET)) - def _parse_external_id(data: object) -> Union[None, Unset, str]: + def _parse_external_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) external_id = _parse_external_id(d.pop("external_id", UNSET)) - def _parse_pagerduty_id(data: object) -> Union[None, Unset, str]: + def _parse_pagerduty_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) pagerduty_id = _parse_pagerduty_id(d.pop("pagerduty_id", UNSET)) - def _parse_pagerduty_service_id(data: object) -> Union[None, Unset, str]: + def _parse_pagerduty_service_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) pagerduty_service_id = _parse_pagerduty_service_id(d.pop("pagerduty_service_id", UNSET)) - def _parse_opsgenie_id(data: object) -> Union[None, Unset, str]: + def _parse_opsgenie_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) opsgenie_id = _parse_opsgenie_id(d.pop("opsgenie_id", UNSET)) - def _parse_victor_ops_id(data: object) -> Union[None, Unset, str]: + def _parse_victor_ops_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) victor_ops_id = _parse_victor_ops_id(d.pop("victor_ops_id", UNSET)) - def _parse_pagertree_id(data: object) -> Union[None, Unset, str]: + def _parse_pagertree_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) pagertree_id = _parse_pagertree_id(d.pop("pagertree_id", UNSET)) - def _parse_cortex_id(data: object) -> Union[None, Unset, str]: + def _parse_cortex_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) cortex_id = _parse_cortex_id(d.pop("cortex_id", UNSET)) - def _parse_service_now_ci_sys_id(data: object) -> Union[None, Unset, str]: + def _parse_service_now_ci_sys_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) service_now_ci_sys_id = _parse_service_now_ci_sys_id(d.pop("service_now_ci_sys_id", UNSET)) - def _parse_user_ids(data: object) -> Union[None, Unset, list[int]]: + def _parse_user_ids(data: object) -> None | Unset | list[int]: if data is None: return data if isinstance(data, Unset): @@ -558,11 +558,11 @@ def _parse_user_ids(data: object) -> Union[None, Unset, list[int]]: return user_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[int]], data) + return cast(None | Unset | list[int], data) user_ids = _parse_user_ids(d.pop("user_ids", UNSET)) - def _parse_admin_ids(data: object) -> Union[None, Unset, list[int]]: + def _parse_admin_ids(data: object) -> None | Unset | list[int]: if data is None: return data if isinstance(data, Unset): @@ -575,38 +575,38 @@ def _parse_admin_ids(data: object) -> Union[None, Unset, list[int]]: return admin_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[int]], data) + return cast(None | Unset | list[int], data) admin_ids = _parse_admin_ids(d.pop("admin_ids", UNSET)) - def _parse_alerts_email_enabled(data: object) -> Union[None, Unset, bool]: + def _parse_alerts_email_enabled(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) alerts_email_enabled = _parse_alerts_email_enabled(d.pop("alerts_email_enabled", UNSET)) - def _parse_alerts_email_address(data: object) -> Union[None, Unset, str]: + def _parse_alerts_email_address(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) alerts_email_address = _parse_alerts_email_address(d.pop("alerts_email_address", UNSET)) - def _parse_alert_urgency_id(data: object) -> Union[None, Unset, str]: + def _parse_alert_urgency_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) alert_urgency_id = _parse_alert_urgency_id(d.pop("alert_urgency_id", UNSET)) - def _parse_slack_channels(data: object) -> Union[None, Unset, list["TeamSlackChannelsType0Item"]]: + def _parse_slack_channels(data: object) -> None | Unset | list["TeamSlackChannelsType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -624,11 +624,11 @@ def _parse_slack_channels(data: object) -> Union[None, Unset, list["TeamSlackCha return slack_channels_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list["TeamSlackChannelsType0Item"]], data) + return cast(None | Unset | list["TeamSlackChannelsType0Item"], data) slack_channels = _parse_slack_channels(d.pop("slack_channels", UNSET)) - def _parse_slack_aliases(data: object) -> Union[None, Unset, list["TeamSlackAliasesType0Item"]]: + def _parse_slack_aliases(data: object) -> None | Unset | list["TeamSlackAliasesType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -646,16 +646,16 @@ def _parse_slack_aliases(data: object) -> Union[None, Unset, list["TeamSlackAlia return slack_aliases_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list["TeamSlackAliasesType0Item"]], data) + return cast(None | Unset | list["TeamSlackAliasesType0Item"], data) slack_aliases = _parse_slack_aliases(d.pop("slack_aliases", UNSET)) - def _parse_alert_broadcast_enabled(data: object) -> Union[None, Unset, bool]: + def _parse_alert_broadcast_enabled(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) alert_broadcast_enabled = _parse_alert_broadcast_enabled(d.pop("alert_broadcast_enabled", UNSET)) @@ -676,12 +676,12 @@ def _parse_alert_broadcast_channel(data: object) -> Union["TeamAlertBroadcastCha alert_broadcast_channel = _parse_alert_broadcast_channel(d.pop("alert_broadcast_channel", UNSET)) - def _parse_incident_broadcast_enabled(data: object) -> Union[None, Unset, bool]: + def _parse_incident_broadcast_enabled(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) incident_broadcast_enabled = _parse_incident_broadcast_enabled(d.pop("incident_broadcast_enabled", UNSET)) @@ -702,25 +702,25 @@ def _parse_incident_broadcast_channel(data: object) -> Union["TeamIncidentBroadc incident_broadcast_channel = _parse_incident_broadcast_channel(d.pop("incident_broadcast_channel", UNSET)) - def _parse_auto_add_members_when_attached(data: object) -> Union[None, Unset, bool]: + def _parse_auto_add_members_when_attached(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) auto_add_members_when_attached = _parse_auto_add_members_when_attached( d.pop("auto_add_members_when_attached", UNSET) ) _auto_add_members_scope = d.pop("auto_add_members_scope", UNSET) - auto_add_members_scope: Union[Unset, TeamAutoAddMembersScope] + auto_add_members_scope: Unset | TeamAutoAddMembersScope if isinstance(_auto_add_members_scope, Unset): auto_add_members_scope = UNSET else: auto_add_members_scope = check_team_auto_add_members_scope(_auto_add_members_scope) - def _parse_properties(data: object) -> Union[None, Unset, list["TeamPropertiesType0Item"]]: + def _parse_properties(data: object) -> None | Unset | list["TeamPropertiesType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -738,7 +738,7 @@ def _parse_properties(data: object) -> Union[None, Unset, list["TeamPropertiesTy return properties_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list["TeamPropertiesType0Item"]], data) + return cast(None | Unset | list["TeamPropertiesType0Item"], data) properties = _parse_properties(d.pop("properties", UNSET)) diff --git a/rootly_sdk/models/team_alert_broadcast_channel_type_0.py b/rootly_sdk/models/team_alert_broadcast_channel_type_0.py index f7564e63..091dde36 100644 --- a/rootly_sdk/models/team_alert_broadcast_channel_type_0.py +++ b/rootly_sdk/models/team_alert_broadcast_channel_type_0.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -18,8 +18,8 @@ class TeamAlertBroadcastChannelType0: name (Union[Unset, str]): Slack channel name """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/team_incident_broadcast_channel_type_0.py b/rootly_sdk/models/team_incident_broadcast_channel_type_0.py index 2f452281..43046eb0 100644 --- a/rootly_sdk/models/team_incident_broadcast_channel_type_0.py +++ b/rootly_sdk/models/team_incident_broadcast_channel_type_0.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -18,8 +18,8 @@ class TeamIncidentBroadcastChannelType0: name (Union[Unset, str]): Slack channel name """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/team_list.py b/rootly_sdk/models/team_list.py index 31fce59f..614907f6 100644 --- a/rootly_sdk/models/team_list.py +++ b/rootly_sdk/models/team_list.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,7 +29,7 @@ class TeamList: data: list["TeamListDataItem"] links: "Links" meta: "Meta" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/team_response.py b/rootly_sdk/models/team_response.py index 908ce6c6..ec639c53 100644 --- a/rootly_sdk/models/team_response.py +++ b/rootly_sdk/models/team_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,13 +23,13 @@ class TeamResponse: """ data: "TeamResponseData" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/tiptap_block_schema.py b/rootly_sdk/models/tiptap_block_schema.py index 17261904..e0255e8f 100644 --- a/rootly_sdk/models/tiptap_block_schema.py +++ b/rootly_sdk/models/tiptap_block_schema.py @@ -28,11 +28,11 @@ class TiptapBlockSchema: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - followup_component: Union[Unset, dict[str, Any]] = UNSET + followup_component: Unset | dict[str, Any] = UNSET if not isinstance(self.followup_component, Unset): followup_component = self.followup_component.to_dict() - timeline_component: Union[Unset, dict[str, Any]] = UNSET + timeline_component: Unset | dict[str, Any] = UNSET if not isinstance(self.timeline_component, Unset): timeline_component = self.timeline_component.to_dict() @@ -53,14 +53,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _followup_component = d.pop("followup_component", UNSET) - followup_component: Union[Unset, TiptapBlockSchemaFollowupComponent] + followup_component: Unset | TiptapBlockSchemaFollowupComponent if isinstance(_followup_component, Unset): followup_component = UNSET else: followup_component = TiptapBlockSchemaFollowupComponent.from_dict(_followup_component) _timeline_component = d.pop("timeline_component", UNSET) - timeline_component: Union[Unset, TiptapBlockSchemaTimelineComponent] + timeline_component: Unset | TiptapBlockSchemaTimelineComponent if isinstance(_timeline_component, Unset): timeline_component = UNSET else: diff --git a/rootly_sdk/models/tiptap_block_schema_followup_component.py b/rootly_sdk/models/tiptap_block_schema_followup_component.py index 6f23f72d..d233714d 100644 --- a/rootly_sdk/models/tiptap_block_schema_followup_component.py +++ b/rootly_sdk/models/tiptap_block_schema_followup_component.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -26,13 +26,13 @@ class TiptapBlockSchemaFollowupComponent: """ html: str - data_sort: Union[Unset, TiptapBlockSchemaFollowupComponentDataSort] = "due_date" + data_sort: Unset | TiptapBlockSchemaFollowupComponentDataSort = "due_date" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: html = self.html - data_sort: Union[Unset, str] = UNSET + data_sort: Unset | str = UNSET if not isinstance(self.data_sort, Unset): data_sort = self.data_sort @@ -54,7 +54,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: html = d.pop("html") _data_sort = d.pop("data_sort", UNSET) - data_sort: Union[Unset, TiptapBlockSchemaFollowupComponentDataSort] + data_sort: Unset | TiptapBlockSchemaFollowupComponentDataSort if isinstance(_data_sort, Unset): data_sort = UNSET else: diff --git a/rootly_sdk/models/trigger_workflow_task_params.py b/rootly_sdk/models/trigger_workflow_task_params.py index 09835fb3..cfae5e0b 100644 --- a/rootly_sdk/models/trigger_workflow_task_params.py +++ b/rootly_sdk/models/trigger_workflow_task_params.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -49,8 +49,8 @@ class TriggerWorkflowTaskParams: workflow: "TriggerWorkflowTaskParamsWorkflow" kind: TriggerWorkflowTaskParamsKind = "incident" attribute_to_query_by: TriggerWorkflowTaskParamsAttributeToQueryBy = "id" - task_type: Union[Unset, TriggerWorkflowTaskParamsTaskType] = UNSET - check_workflow_conditions: Union[Unset, bool] = UNSET + task_type: Unset | TriggerWorkflowTaskParamsTaskType = UNSET + check_workflow_conditions: Unset | bool = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -62,7 +62,7 @@ def to_dict(self) -> dict[str, Any]: workflow = self.workflow.to_dict() - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -100,7 +100,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: workflow = TriggerWorkflowTaskParamsWorkflow.from_dict(d.pop("workflow")) _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, TriggerWorkflowTaskParamsTaskType] + task_type: Unset | TriggerWorkflowTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/trigger_workflow_task_params_resource.py b/rootly_sdk/models/trigger_workflow_task_params_resource.py index 9edc0181..00c4d41f 100644 --- a/rootly_sdk/models/trigger_workflow_task_params_resource.py +++ b/rootly_sdk/models/trigger_workflow_task_params_resource.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class TriggerWorkflowTaskParamsResource: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/trigger_workflow_task_params_workflow.py b/rootly_sdk/models/trigger_workflow_task_params_workflow.py index 39e0422b..4eb056c6 100644 --- a/rootly_sdk/models/trigger_workflow_task_params_workflow.py +++ b/rootly_sdk/models/trigger_workflow_task_params_workflow.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class TriggerWorkflowTaskParamsWorkflow: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/tweet_twitter_message_task_params.py b/rootly_sdk/models/tweet_twitter_message_task_params.py index 3839d3c5..41f13fc8 100644 --- a/rootly_sdk/models/tweet_twitter_message_task_params.py +++ b/rootly_sdk/models/tweet_twitter_message_task_params.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,13 +22,13 @@ class TweetTwitterMessageTaskParams: """ message: str - task_type: Union[Unset, TweetTwitterMessageTaskParamsTaskType] = UNSET + task_type: Unset | TweetTwitterMessageTaskParamsTaskType = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: message = self.message - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -50,7 +50,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: message = d.pop("message") _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, TweetTwitterMessageTaskParamsTaskType] + task_type: Unset | TweetTwitterMessageTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/unassign_role_from_user_data_attributes.py b/rootly_sdk/models/unassign_role_from_user_data_attributes.py index 68894b5f..6f79ddc6 100644 --- a/rootly_sdk/models/unassign_role_from_user_data_attributes.py +++ b/rootly_sdk/models/unassign_role_from_user_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define @@ -16,8 +16,8 @@ class UnassignRoleFromUserDataAttributes: incident_role_id (Union[Unset, str]): ID of the incident role """ - user_id: Union[Unset, str] = UNSET - incident_role_id: Union[Unset, str] = UNSET + user_id: Unset | str = UNSET + incident_role_id: Unset | str = UNSET def to_dict(self) -> dict[str, Any]: user_id = self.user_id diff --git a/rootly_sdk/models/update_action_item_task_params.py b/rootly_sdk/models/update_action_item_task_params.py index 85f735dc..f7d9e4bd 100644 --- a/rootly_sdk/models/update_action_item_task_params.py +++ b/rootly_sdk/models/update_action_item_task_params.py @@ -53,16 +53,16 @@ class UpdateActionItemTaskParams: query_value: str attribute_to_query_by: UpdateActionItemTaskParamsAttributeToQueryBy = "id" - task_type: Union[Unset, UpdateActionItemTaskParamsTaskType] = UNSET - summary: Union[Unset, str] = UNSET - assigned_to_user_id: Union[Unset, str] = UNSET + task_type: Unset | UpdateActionItemTaskParamsTaskType = UNSET + summary: Unset | str = UNSET + assigned_to_user_id: Unset | str = UNSET assigned_to_user: Union[Unset, "UpdateActionItemTaskParamsAssignedToUser"] = UNSET - group_ids: Union[None, Unset, list[str]] = UNSET - description: Union[Unset, str] = UNSET - priority: Union[Unset, UpdateActionItemTaskParamsPriority] = UNSET - status: Union[Unset, UpdateActionItemTaskParamsStatus] = UNSET - custom_fields_mapping: Union[None, Unset, str] = UNSET - post_to_incident_timeline: Union[Unset, bool] = UNSET + group_ids: None | Unset | list[str] = UNSET + description: Unset | str = UNSET + priority: Unset | UpdateActionItemTaskParamsPriority = UNSET + status: Unset | UpdateActionItemTaskParamsStatus = UNSET + custom_fields_mapping: None | Unset | str = UNSET + post_to_incident_timeline: Unset | bool = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -70,7 +70,7 @@ def to_dict(self) -> dict[str, Any]: attribute_to_query_by: str = self.attribute_to_query_by - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -78,11 +78,11 @@ def to_dict(self) -> dict[str, Any]: assigned_to_user_id = self.assigned_to_user_id - assigned_to_user: Union[Unset, dict[str, Any]] = UNSET + assigned_to_user: Unset | dict[str, Any] = UNSET if not isinstance(self.assigned_to_user, Unset): assigned_to_user = self.assigned_to_user.to_dict() - group_ids: Union[None, Unset, list[str]] + group_ids: None | Unset | list[str] if isinstance(self.group_ids, Unset): group_ids = UNSET elif isinstance(self.group_ids, list): @@ -93,15 +93,15 @@ def to_dict(self) -> dict[str, Any]: description = self.description - priority: Union[Unset, str] = UNSET + priority: Unset | str = UNSET if not isinstance(self.priority, Unset): priority = self.priority - status: Union[Unset, str] = UNSET + status: Unset | str = UNSET if not isinstance(self.status, Unset): status = self.status - custom_fields_mapping: Union[None, Unset, str] + custom_fields_mapping: None | Unset | str if isinstance(self.custom_fields_mapping, Unset): custom_fields_mapping = UNSET else: @@ -152,7 +152,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: ) _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, UpdateActionItemTaskParamsTaskType] + task_type: Unset | UpdateActionItemTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: @@ -163,13 +163,13 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: assigned_to_user_id = d.pop("assigned_to_user_id", UNSET) _assigned_to_user = d.pop("assigned_to_user", UNSET) - assigned_to_user: Union[Unset, UpdateActionItemTaskParamsAssignedToUser] + assigned_to_user: Unset | UpdateActionItemTaskParamsAssignedToUser if isinstance(_assigned_to_user, Unset): assigned_to_user = UNSET else: assigned_to_user = UpdateActionItemTaskParamsAssignedToUser.from_dict(_assigned_to_user) - def _parse_group_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_group_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -182,32 +182,32 @@ def _parse_group_ids(data: object) -> Union[None, Unset, list[str]]: return group_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) group_ids = _parse_group_ids(d.pop("group_ids", UNSET)) description = d.pop("description", UNSET) _priority = d.pop("priority", UNSET) - priority: Union[Unset, UpdateActionItemTaskParamsPriority] + priority: Unset | UpdateActionItemTaskParamsPriority if isinstance(_priority, Unset): priority = UNSET else: priority = check_update_action_item_task_params_priority(_priority) _status = d.pop("status", UNSET) - status: Union[Unset, UpdateActionItemTaskParamsStatus] + status: Unset | UpdateActionItemTaskParamsStatus if isinstance(_status, Unset): status = UNSET else: status = check_update_action_item_task_params_status(_status) - def _parse_custom_fields_mapping(data: object) -> Union[None, Unset, str]: + def _parse_custom_fields_mapping(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) custom_fields_mapping = _parse_custom_fields_mapping(d.pop("custom_fields_mapping", UNSET)) diff --git a/rootly_sdk/models/update_action_item_task_params_assigned_to_user.py b/rootly_sdk/models/update_action_item_task_params_assigned_to_user.py index 968fa698..e3bd45eb 100644 --- a/rootly_sdk/models/update_action_item_task_params_assigned_to_user.py +++ b/rootly_sdk/models/update_action_item_task_params_assigned_to_user.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -18,8 +18,8 @@ class UpdateActionItemTaskParamsAssignedToUser: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_airtable_table_record_task_params.py b/rootly_sdk/models/update_airtable_table_record_task_params.py index 4c1f093c..5df66fe6 100644 --- a/rootly_sdk/models/update_airtable_table_record_task_params.py +++ b/rootly_sdk/models/update_airtable_table_record_task_params.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -28,8 +28,8 @@ class UpdateAirtableTableRecordTaskParams: base_key: str table_name: str record_id: str - task_type: Union[Unset, UpdateAirtableTableRecordTaskParamsTaskType] = UNSET - custom_fields_mapping: Union[None, Unset, str] = UNSET + task_type: Unset | UpdateAirtableTableRecordTaskParamsTaskType = UNSET + custom_fields_mapping: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -39,11 +39,11 @@ def to_dict(self) -> dict[str, Any]: record_id = self.record_id - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - custom_fields_mapping: Union[None, Unset, str] + custom_fields_mapping: None | Unset | str if isinstance(self.custom_fields_mapping, Unset): custom_fields_mapping = UNSET else: @@ -75,18 +75,18 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: record_id = d.pop("record_id") _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, UpdateAirtableTableRecordTaskParamsTaskType] + task_type: Unset | UpdateAirtableTableRecordTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: task_type = check_update_airtable_table_record_task_params_task_type(_task_type) - def _parse_custom_fields_mapping(data: object) -> Union[None, Unset, str]: + def _parse_custom_fields_mapping(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) custom_fields_mapping = _parse_custom_fields_mapping(d.pop("custom_fields_mapping", UNSET)) diff --git a/rootly_sdk/models/update_alert_data_attributes.py b/rootly_sdk/models/update_alert_data_attributes.py index 452778c4..849255f4 100644 --- a/rootly_sdk/models/update_alert_data_attributes.py +++ b/rootly_sdk/models/update_alert_data_attributes.py @@ -49,25 +49,25 @@ class UpdateAlertDataAttributes: to create with the alert """ - noise: Union[Unset, UpdateAlertDataAttributesNoise] = UNSET - source: Union[Unset, str] = UNSET - summary: Union[Unset, str] = UNSET - description: Union[None, Unset, str] = UNSET - service_ids: Union[None, Unset, list[str]] = UNSET - group_ids: Union[None, Unset, list[str]] = UNSET - functionality_ids: Union[None, Unset, list[str]] = UNSET - environment_ids: Union[None, Unset, list[str]] = UNSET - started_at: Union[None, Unset, datetime.datetime] = UNSET - ended_at: Union[None, Unset, datetime.datetime] = UNSET - external_id: Union[None, Unset, str] = UNSET - external_url: Union[None, Unset, str] = UNSET - alert_urgency_id: Union[None, Unset, str] = UNSET - labels: Union[Unset, list[Union["UpdateAlertDataAttributesLabelsItemType0", None]]] = UNSET + noise: Unset | UpdateAlertDataAttributesNoise = UNSET + source: Unset | str = UNSET + summary: Unset | str = UNSET + description: None | Unset | str = UNSET + service_ids: None | Unset | list[str] = UNSET + group_ids: None | Unset | list[str] = UNSET + functionality_ids: None | Unset | list[str] = UNSET + environment_ids: None | Unset | list[str] = UNSET + started_at: None | Unset | datetime.datetime = UNSET + ended_at: None | Unset | datetime.datetime = UNSET + external_id: None | Unset | str = UNSET + external_url: None | Unset | str = UNSET + alert_urgency_id: None | Unset | str = UNSET + labels: Unset | list[Union["UpdateAlertDataAttributesLabelsItemType0", None]] = UNSET data: Union["UpdateAlertDataAttributesDataType0", None, Unset] = UNSET - deduplication_key: Union[None, Unset, str] = UNSET - alert_field_values_attributes: Union[ - Unset, list[Union["UpdateAlertDataAttributesAlertFieldValuesAttributesItemType0", None]] - ] = UNSET + deduplication_key: None | Unset | str = UNSET + alert_field_values_attributes: ( + Unset | list[Union["UpdateAlertDataAttributesAlertFieldValuesAttributesItemType0", None]] + ) = UNSET def to_dict(self) -> dict[str, Any]: from ..models.update_alert_data_attributes_alert_field_values_attributes_item_type_0 import ( @@ -76,7 +76,7 @@ def to_dict(self) -> dict[str, Any]: from ..models.update_alert_data_attributes_data_type_0 import UpdateAlertDataAttributesDataType0 from ..models.update_alert_data_attributes_labels_item_type_0 import UpdateAlertDataAttributesLabelsItemType0 - noise: Union[Unset, str] = UNSET + noise: Unset | str = UNSET if not isinstance(self.noise, Unset): noise = self.noise @@ -84,13 +84,13 @@ def to_dict(self) -> dict[str, Any]: summary = self.summary - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - service_ids: Union[None, Unset, list[str]] + service_ids: None | Unset | list[str] if isinstance(self.service_ids, Unset): service_ids = UNSET elif isinstance(self.service_ids, list): @@ -99,7 +99,7 @@ def to_dict(self) -> dict[str, Any]: else: service_ids = self.service_ids - group_ids: Union[None, Unset, list[str]] + group_ids: None | Unset | list[str] if isinstance(self.group_ids, Unset): group_ids = UNSET elif isinstance(self.group_ids, list): @@ -108,7 +108,7 @@ def to_dict(self) -> dict[str, Any]: else: group_ids = self.group_ids - functionality_ids: Union[None, Unset, list[str]] + functionality_ids: None | Unset | list[str] if isinstance(self.functionality_ids, Unset): functionality_ids = UNSET elif isinstance(self.functionality_ids, list): @@ -117,7 +117,7 @@ def to_dict(self) -> dict[str, Any]: else: functionality_ids = self.functionality_ids - environment_ids: Union[None, Unset, list[str]] + environment_ids: None | Unset | list[str] if isinstance(self.environment_ids, Unset): environment_ids = UNSET elif isinstance(self.environment_ids, list): @@ -126,7 +126,7 @@ def to_dict(self) -> dict[str, Any]: else: environment_ids = self.environment_ids - started_at: Union[None, Unset, str] + started_at: None | Unset | str if isinstance(self.started_at, Unset): started_at = UNSET elif isinstance(self.started_at, datetime.datetime): @@ -134,7 +134,7 @@ def to_dict(self) -> dict[str, Any]: else: started_at = self.started_at - ended_at: Union[None, Unset, str] + ended_at: None | Unset | str if isinstance(self.ended_at, Unset): ended_at = UNSET elif isinstance(self.ended_at, datetime.datetime): @@ -142,36 +142,36 @@ def to_dict(self) -> dict[str, Any]: else: ended_at = self.ended_at - external_id: Union[None, Unset, str] + external_id: None | Unset | str if isinstance(self.external_id, Unset): external_id = UNSET else: external_id = self.external_id - external_url: Union[None, Unset, str] + external_url: None | Unset | str if isinstance(self.external_url, Unset): external_url = UNSET else: external_url = self.external_url - alert_urgency_id: Union[None, Unset, str] + alert_urgency_id: None | Unset | str if isinstance(self.alert_urgency_id, Unset): alert_urgency_id = UNSET else: alert_urgency_id = self.alert_urgency_id - labels: Union[Unset, list[Union[None, dict[str, Any]]]] = UNSET + labels: Unset | list[None | dict[str, Any]] = UNSET if not isinstance(self.labels, Unset): labels = [] for labels_item_data in self.labels: - labels_item: Union[None, dict[str, Any]] + labels_item: None | dict[str, Any] if isinstance(labels_item_data, UpdateAlertDataAttributesLabelsItemType0): labels_item = labels_item_data.to_dict() else: labels_item = labels_item_data labels.append(labels_item) - data: Union[None, Unset, dict[str, Any]] + data: None | Unset | dict[str, Any] if isinstance(self.data, Unset): data = UNSET elif isinstance(self.data, UpdateAlertDataAttributesDataType0): @@ -179,17 +179,17 @@ def to_dict(self) -> dict[str, Any]: else: data = self.data - deduplication_key: Union[None, Unset, str] + deduplication_key: None | Unset | str if isinstance(self.deduplication_key, Unset): deduplication_key = UNSET else: deduplication_key = self.deduplication_key - alert_field_values_attributes: Union[Unset, list[Union[None, dict[str, Any]]]] = UNSET + alert_field_values_attributes: Unset | list[None | dict[str, Any]] = UNSET if not isinstance(self.alert_field_values_attributes, Unset): alert_field_values_attributes = [] for alert_field_values_attributes_item_data in self.alert_field_values_attributes: - alert_field_values_attributes_item: Union[None, dict[str, Any]] + alert_field_values_attributes_item: None | dict[str, Any] if isinstance( alert_field_values_attributes_item_data, UpdateAlertDataAttributesAlertFieldValuesAttributesItemType0, @@ -249,7 +249,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _noise = d.pop("noise", UNSET) - noise: Union[Unset, UpdateAlertDataAttributesNoise] + noise: Unset | UpdateAlertDataAttributesNoise if isinstance(_noise, Unset): noise = UNSET else: @@ -259,16 +259,16 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: summary = d.pop("summary", UNSET) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_service_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_service_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -281,11 +281,11 @@ def _parse_service_ids(data: object) -> Union[None, Unset, list[str]]: return service_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) service_ids = _parse_service_ids(d.pop("service_ids", UNSET)) - def _parse_group_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_group_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -298,11 +298,11 @@ def _parse_group_ids(data: object) -> Union[None, Unset, list[str]]: return group_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) group_ids = _parse_group_ids(d.pop("group_ids", UNSET)) - def _parse_functionality_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_functionality_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -315,11 +315,11 @@ def _parse_functionality_ids(data: object) -> Union[None, Unset, list[str]]: return functionality_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) functionality_ids = _parse_functionality_ids(d.pop("functionality_ids", UNSET)) - def _parse_environment_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_environment_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -332,11 +332,11 @@ def _parse_environment_ids(data: object) -> Union[None, Unset, list[str]]: return environment_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) environment_ids = _parse_environment_ids(d.pop("environment_ids", UNSET)) - def _parse_started_at(data: object) -> Union[None, Unset, datetime.datetime]: + def _parse_started_at(data: object) -> None | Unset | datetime.datetime: if data is None: return data if isinstance(data, Unset): @@ -349,11 +349,11 @@ def _parse_started_at(data: object) -> Union[None, Unset, datetime.datetime]: return started_at_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, datetime.datetime], data) + return cast(None | Unset | datetime.datetime, data) started_at = _parse_started_at(d.pop("started_at", UNSET)) - def _parse_ended_at(data: object) -> Union[None, Unset, datetime.datetime]: + def _parse_ended_at(data: object) -> None | Unset | datetime.datetime: if data is None: return data if isinstance(data, Unset): @@ -366,34 +366,34 @@ def _parse_ended_at(data: object) -> Union[None, Unset, datetime.datetime]: return ended_at_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, datetime.datetime], data) + return cast(None | Unset | datetime.datetime, data) ended_at = _parse_ended_at(d.pop("ended_at", UNSET)) - def _parse_external_id(data: object) -> Union[None, Unset, str]: + def _parse_external_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) external_id = _parse_external_id(d.pop("external_id", UNSET)) - def _parse_external_url(data: object) -> Union[None, Unset, str]: + def _parse_external_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) external_url = _parse_external_url(d.pop("external_url", UNSET)) - def _parse_alert_urgency_id(data: object) -> Union[None, Unset, str]: + def _parse_alert_urgency_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) alert_urgency_id = _parse_alert_urgency_id(d.pop("alert_urgency_id", UNSET)) @@ -435,12 +435,12 @@ def _parse_data(data: object) -> Union["UpdateAlertDataAttributesDataType0", Non data = _parse_data(d.pop("data", UNSET)) - def _parse_deduplication_key(data: object) -> Union[None, Unset, str]: + def _parse_deduplication_key(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) deduplication_key = _parse_deduplication_key(d.pop("deduplication_key", UNSET)) diff --git a/rootly_sdk/models/update_alert_data_attributes_labels_item_type_0.py b/rootly_sdk/models/update_alert_data_attributes_labels_item_type_0.py index 1ec75897..369b1029 100644 --- a/rootly_sdk/models/update_alert_data_attributes_labels_item_type_0.py +++ b/rootly_sdk/models/update_alert_data_attributes_labels_item_type_0.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,13 +16,13 @@ class UpdateAlertDataAttributesLabelsItemType0: """ key: str - value: Union[bool, float, str] + value: bool | float | str additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: key = self.key - value: Union[bool, float, str] + value: bool | float | str value = self.value field_dict: dict[str, Any] = {} @@ -41,8 +41,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) key = d.pop("key") - def _parse_value(data: object) -> Union[bool, float, str]: - return cast(Union[bool, float, str], data) + def _parse_value(data: object) -> bool | float | str: + return cast(bool | float | str, data) value = _parse_value(d.pop("value")) diff --git a/rootly_sdk/models/update_alert_event_data_attributes.py b/rootly_sdk/models/update_alert_event_data_attributes.py index 9728bcf2..03b49195 100644 --- a/rootly_sdk/models/update_alert_event_data_attributes.py +++ b/rootly_sdk/models/update_alert_event_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define @@ -17,7 +17,7 @@ class UpdateAlertEventDataAttributes: """ details: str - user_id: Union[Unset, int] = UNSET + user_id: Unset | int = UNSET def to_dict(self) -> dict[str, Any]: details = self.details diff --git a/rootly_sdk/models/update_alert_field_data_attributes.py b/rootly_sdk/models/update_alert_field_data_attributes.py index 84ab4e68..cee07f25 100644 --- a/rootly_sdk/models/update_alert_field_data_attributes.py +++ b/rootly_sdk/models/update_alert_field_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -17,11 +17,11 @@ class UpdateAlertFieldDataAttributes: name (Union[Unset, str]): The name of the alert field """ - slug: Union[None, Unset, str] = UNSET - name: Union[Unset, str] = UNSET + slug: None | Unset | str = UNSET + name: Unset | str = UNSET def to_dict(self) -> dict[str, Any]: - slug: Union[None, Unset, str] + slug: None | Unset | str if isinstance(self.slug, Unset): slug = UNSET else: @@ -43,12 +43,12 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_slug(data: object) -> Union[None, Unset, str]: + def _parse_slug(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) slug = _parse_slug(d.pop("slug", UNSET)) diff --git a/rootly_sdk/models/update_alert_group_data_attributes.py b/rootly_sdk/models/update_alert_group_data_attributes.py index 6e642c0a..cb9224ed 100644 --- a/rootly_sdk/models/update_alert_group_data_attributes.py +++ b/rootly_sdk/models/update_alert_group_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define @@ -49,19 +49,19 @@ class UpdateAlertGroupDataAttributes: conditions (Union[Unset, list['UpdateAlertGroupDataAttributesConditionsItem']]): """ - slug: Union[None, Unset, str] = UNSET - name: Union[Unset, str] = UNSET - description: Union[None, Unset, str] = UNSET - time_window: Union[Unset, int] = UNSET - targets: Union[Unset, list["UpdateAlertGroupDataAttributesTargetsItem"]] = UNSET - attributes: Union[Unset, list["UpdateAlertGroupDataAttributesAttributesItem"]] = UNSET - group_by_alert_title: Union[Unset, UpdateAlertGroupDataAttributesGroupByAlertTitle] = UNSET - group_by_alert_urgency: Union[Unset, UpdateAlertGroupDataAttributesGroupByAlertUrgency] = UNSET - condition_type: Union[Unset, UpdateAlertGroupDataAttributesConditionType] = UNSET - conditions: Union[Unset, list["UpdateAlertGroupDataAttributesConditionsItem"]] = UNSET + slug: None | Unset | str = UNSET + name: Unset | str = UNSET + description: None | Unset | str = UNSET + time_window: Unset | int = UNSET + targets: Unset | list["UpdateAlertGroupDataAttributesTargetsItem"] = UNSET + attributes: Unset | list["UpdateAlertGroupDataAttributesAttributesItem"] = UNSET + group_by_alert_title: Unset | UpdateAlertGroupDataAttributesGroupByAlertTitle = UNSET + group_by_alert_urgency: Unset | UpdateAlertGroupDataAttributesGroupByAlertUrgency = UNSET + condition_type: Unset | UpdateAlertGroupDataAttributesConditionType = UNSET + conditions: Unset | list["UpdateAlertGroupDataAttributesConditionsItem"] = UNSET def to_dict(self) -> dict[str, Any]: - slug: Union[None, Unset, str] + slug: None | Unset | str if isinstance(self.slug, Unset): slug = UNSET else: @@ -69,7 +69,7 @@ def to_dict(self) -> dict[str, Any]: name = self.name - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: @@ -77,33 +77,33 @@ def to_dict(self) -> dict[str, Any]: time_window = self.time_window - targets: Union[Unset, list[dict[str, Any]]] = UNSET + targets: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.targets, Unset): targets = [] for targets_item_data in self.targets: targets_item = targets_item_data.to_dict() targets.append(targets_item) - attributes: Union[Unset, list[dict[str, Any]]] = UNSET + attributes: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.attributes, Unset): attributes = [] for attributes_item_data in self.attributes: attributes_item = attributes_item_data.to_dict() attributes.append(attributes_item) - group_by_alert_title: Union[Unset, int] = UNSET + group_by_alert_title: Unset | int = UNSET if not isinstance(self.group_by_alert_title, Unset): group_by_alert_title = self.group_by_alert_title - group_by_alert_urgency: Union[Unset, int] = UNSET + group_by_alert_urgency: Unset | int = UNSET if not isinstance(self.group_by_alert_urgency, Unset): group_by_alert_urgency = self.group_by_alert_urgency - condition_type: Union[Unset, str] = UNSET + condition_type: Unset | str = UNSET if not isinstance(self.condition_type, Unset): condition_type = self.condition_type - conditions: Union[Unset, list[dict[str, Any]]] = UNSET + conditions: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.conditions, Unset): conditions = [] for conditions_item_data in self.conditions: @@ -148,23 +148,23 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_slug(data: object) -> Union[None, Unset, str]: + def _parse_slug(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) slug = _parse_slug(d.pop("slug", UNSET)) name = d.pop("name", UNSET) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) @@ -185,14 +185,14 @@ def _parse_description(data: object) -> Union[None, Unset, str]: attributes.append(attributes_item) _group_by_alert_title = d.pop("group_by_alert_title", UNSET) - group_by_alert_title: Union[Unset, UpdateAlertGroupDataAttributesGroupByAlertTitle] + group_by_alert_title: Unset | UpdateAlertGroupDataAttributesGroupByAlertTitle if isinstance(_group_by_alert_title, Unset): group_by_alert_title = UNSET else: group_by_alert_title = check_update_alert_group_data_attributes_group_by_alert_title(_group_by_alert_title) _group_by_alert_urgency = d.pop("group_by_alert_urgency", UNSET) - group_by_alert_urgency: Union[Unset, UpdateAlertGroupDataAttributesGroupByAlertUrgency] + group_by_alert_urgency: Unset | UpdateAlertGroupDataAttributesGroupByAlertUrgency if isinstance(_group_by_alert_urgency, Unset): group_by_alert_urgency = UNSET else: @@ -201,7 +201,7 @@ def _parse_description(data: object) -> Union[None, Unset, str]: ) _condition_type = d.pop("condition_type", UNSET) - condition_type: Union[Unset, UpdateAlertGroupDataAttributesConditionType] + condition_type: Unset | UpdateAlertGroupDataAttributesConditionType if isinstance(_condition_type, Unset): condition_type = UNSET else: diff --git a/rootly_sdk/models/update_alert_group_data_attributes_attributes_item.py b/rootly_sdk/models/update_alert_group_data_attributes_attributes_item.py index fb27fadb..b6248ab5 100644 --- a/rootly_sdk/models/update_alert_group_data_attributes_attributes_item.py +++ b/rootly_sdk/models/update_alert_group_data_attributes_attributes_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,7 +16,7 @@ class UpdateAlertGroupDataAttributesAttributesItem: json_path (Union[Unset, str]): The JSON path to the value to group by. """ - json_path: Union[Unset, str] = UNSET + json_path: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_alert_group_data_attributes_conditions_item.py b/rootly_sdk/models/update_alert_group_data_attributes_conditions_item.py index 801bdb07..57211825 100644 --- a/rootly_sdk/models/update_alert_group_data_attributes_conditions_item.py +++ b/rootly_sdk/models/update_alert_group_data_attributes_conditions_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -49,12 +49,12 @@ class UpdateAlertGroupDataAttributesConditionsItem: property_field_type: UpdateAlertGroupDataAttributesConditionsItemPropertyFieldType property_field_condition_type: UpdateAlertGroupDataAttributesConditionsItemPropertyFieldConditionType - property_field_name: Union[Unset, str] = UNSET - property_field_value: Union[Unset, str] = UNSET - property_field_values: Union[Unset, list[str]] = UNSET - alert_urgency_ids: Union[None, Unset, list[str]] = UNSET - conditionable_type: Union[Unset, UpdateAlertGroupDataAttributesConditionsItemConditionableType] = UNSET - conditionable_id: Union[Unset, str] = UNSET + property_field_name: Unset | str = UNSET + property_field_value: Unset | str = UNSET + property_field_values: Unset | list[str] = UNSET + alert_urgency_ids: None | Unset | list[str] = UNSET + conditionable_type: Unset | UpdateAlertGroupDataAttributesConditionsItemConditionableType = UNSET + conditionable_id: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -66,11 +66,11 @@ def to_dict(self) -> dict[str, Any]: property_field_value = self.property_field_value - property_field_values: Union[Unset, list[str]] = UNSET + property_field_values: Unset | list[str] = UNSET if not isinstance(self.property_field_values, Unset): property_field_values = self.property_field_values - alert_urgency_ids: Union[None, Unset, list[str]] + alert_urgency_ids: None | Unset | list[str] if isinstance(self.alert_urgency_ids, Unset): alert_urgency_ids = UNSET elif isinstance(self.alert_urgency_ids, list): @@ -79,7 +79,7 @@ def to_dict(self) -> dict[str, Any]: else: alert_urgency_ids = self.alert_urgency_ids - conditionable_type: Union[Unset, str] = UNSET + conditionable_type: Unset | str = UNSET if not isinstance(self.conditionable_type, Unset): conditionable_type = self.conditionable_type @@ -127,7 +127,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: property_field_values = cast(list[str], d.pop("property_field_values", UNSET)) - def _parse_alert_urgency_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_alert_urgency_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -140,12 +140,12 @@ def _parse_alert_urgency_ids(data: object) -> Union[None, Unset, list[str]]: return alert_urgency_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) alert_urgency_ids = _parse_alert_urgency_ids(d.pop("alert_urgency_ids", UNSET)) _conditionable_type = d.pop("conditionable_type", UNSET) - conditionable_type: Union[Unset, UpdateAlertGroupDataAttributesConditionsItemConditionableType] + conditionable_type: Unset | UpdateAlertGroupDataAttributesConditionsItemConditionableType if isinstance(_conditionable_type, Unset): conditionable_type = UNSET else: diff --git a/rootly_sdk/models/update_alert_retrigger_rule_data_attributes.py b/rootly_sdk/models/update_alert_retrigger_rule_data_attributes.py index e0c92c1e..af85c35c 100644 --- a/rootly_sdk/models/update_alert_retrigger_rule_data_attributes.py +++ b/rootly_sdk/models/update_alert_retrigger_rule_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define @@ -36,26 +36,26 @@ class UpdateAlertRetriggerRuleDataAttributes: conditions; replaces the rule's existing conditions. An empty array applies to every alert. """ - name: Union[Unset, str] = UNSET - match_mode: Union[Unset, UpdateAlertRetriggerRuleDataAttributesMatchMode] = UNSET - timeout_minutes: Union[Unset, UpdateAlertRetriggerRuleDataAttributesTimeoutMinutes] = UNSET - position: Union[Unset, int] = UNSET - conditions: Union[Unset, list["UpdateAlertRetriggerRuleDataAttributesConditionsItem"]] = UNSET + name: Unset | str = UNSET + match_mode: Unset | UpdateAlertRetriggerRuleDataAttributesMatchMode = UNSET + timeout_minutes: Unset | UpdateAlertRetriggerRuleDataAttributesTimeoutMinutes = UNSET + position: Unset | int = UNSET + conditions: Unset | list["UpdateAlertRetriggerRuleDataAttributesConditionsItem"] = UNSET def to_dict(self) -> dict[str, Any]: name = self.name - match_mode: Union[Unset, str] = UNSET + match_mode: Unset | str = UNSET if not isinstance(self.match_mode, Unset): match_mode = self.match_mode - timeout_minutes: Union[Unset, int] = UNSET + timeout_minutes: Unset | int = UNSET if not isinstance(self.timeout_minutes, Unset): timeout_minutes = self.timeout_minutes position = self.position - conditions: Union[Unset, list[dict[str, Any]]] = UNSET + conditions: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.conditions, Unset): conditions = [] for conditions_item_data in self.conditions: @@ -88,14 +88,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name = d.pop("name", UNSET) _match_mode = d.pop("match_mode", UNSET) - match_mode: Union[Unset, UpdateAlertRetriggerRuleDataAttributesMatchMode] + match_mode: Unset | UpdateAlertRetriggerRuleDataAttributesMatchMode if isinstance(_match_mode, Unset): match_mode = UNSET else: match_mode = check_update_alert_retrigger_rule_data_attributes_match_mode(_match_mode) _timeout_minutes = d.pop("timeout_minutes", UNSET) - timeout_minutes: Union[Unset, UpdateAlertRetriggerRuleDataAttributesTimeoutMinutes] + timeout_minutes: Unset | UpdateAlertRetriggerRuleDataAttributesTimeoutMinutes if isinstance(_timeout_minutes, Unset): timeout_minutes = UNSET else: diff --git a/rootly_sdk/models/update_alert_retrigger_rule_data_attributes_conditions_item.py b/rootly_sdk/models/update_alert_retrigger_rule_data_attributes_conditions_item.py index 48ab32ed..ff89af99 100644 --- a/rootly_sdk/models/update_alert_retrigger_rule_data_attributes_conditions_item.py +++ b/rootly_sdk/models/update_alert_retrigger_rule_data_attributes_conditions_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from uuid import UUID from attrs import define as _attrs_define @@ -37,9 +37,9 @@ class UpdateAlertRetriggerRuleDataAttributesConditionsItem: kind: UpdateAlertRetriggerRuleDataAttributesConditionsItemKind operator: UpdateAlertRetriggerRuleDataAttributesConditionsItemOperator - record_ids: Union[Unset, list[UUID]] = UNSET - values: Union[Unset, list[str]] = UNSET - property_field_name: Union[Unset, str] = UNSET + record_ids: Unset | list[UUID] = UNSET + values: Unset | list[str] = UNSET + property_field_name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -47,14 +47,14 @@ def to_dict(self) -> dict[str, Any]: operator: str = self.operator - record_ids: Union[Unset, list[str]] = UNSET + record_ids: Unset | list[str] = UNSET if not isinstance(self.record_ids, Unset): record_ids = [] for record_ids_item_data in self.record_ids: record_ids_item = str(record_ids_item_data) record_ids.append(record_ids_item) - values: Union[Unset, list[str]] = UNSET + values: Unset | list[str] = UNSET if not isinstance(self.values, Unset): values = self.values diff --git a/rootly_sdk/models/update_alert_route_data_attributes.py b/rootly_sdk/models/update_alert_route_data_attributes.py index 5001e80b..69d9ef89 100644 --- a/rootly_sdk/models/update_alert_route_data_attributes.py +++ b/rootly_sdk/models/update_alert_route_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from uuid import UUID from attrs import define as _attrs_define @@ -24,32 +24,32 @@ class UpdateAlertRouteDataAttributes: rules (Union[Unset, list['UpdateAlertRouteDataAttributesRulesItem']]): """ - name: Union[Unset, str] = UNSET - enabled: Union[Unset, bool] = UNSET - alerts_source_ids: Union[Unset, list[UUID]] = UNSET - owning_team_ids: Union[Unset, list[UUID]] = UNSET - rules: Union[Unset, list["UpdateAlertRouteDataAttributesRulesItem"]] = UNSET + name: Unset | str = UNSET + enabled: Unset | bool = UNSET + alerts_source_ids: Unset | list[UUID] = UNSET + owning_team_ids: Unset | list[UUID] = UNSET + rules: Unset | list["UpdateAlertRouteDataAttributesRulesItem"] = UNSET def to_dict(self) -> dict[str, Any]: name = self.name enabled = self.enabled - alerts_source_ids: Union[Unset, list[str]] = UNSET + alerts_source_ids: Unset | list[str] = UNSET if not isinstance(self.alerts_source_ids, Unset): alerts_source_ids = [] for alerts_source_ids_item_data in self.alerts_source_ids: alerts_source_ids_item = str(alerts_source_ids_item_data) alerts_source_ids.append(alerts_source_ids_item) - owning_team_ids: Union[Unset, list[str]] = UNSET + owning_team_ids: Unset | list[str] = UNSET if not isinstance(self.owning_team_ids, Unset): owning_team_ids = [] for owning_team_ids_item_data in self.owning_team_ids: owning_team_ids_item = str(owning_team_ids_item_data) owning_team_ids.append(owning_team_ids_item) - rules: Union[Unset, list[dict[str, Any]]] = UNSET + rules: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.rules, Unset): rules = [] for rules_item_data in self.rules: diff --git a/rootly_sdk/models/update_alert_route_data_attributes_rules_item.py b/rootly_sdk/models/update_alert_route_data_attributes_rules_item.py index 9790a35c..086dd93d 100644 --- a/rootly_sdk/models/update_alert_route_data_attributes_rules_item.py +++ b/rootly_sdk/models/update_alert_route_data_attributes_rules_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -32,8 +32,8 @@ class UpdateAlertRouteDataAttributesRulesItem: name: str destinations: list["UpdateAlertRouteDataAttributesRulesItemDestinationsItem"] condition_groups: list["UpdateAlertRouteDataAttributesRulesItemConditionGroupsItem"] - position: Union[Unset, int] = UNSET - fallback_rule: Union[Unset, bool] = False + position: Unset | int = UNSET + fallback_rule: Unset | bool = False additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_alert_route_data_attributes_rules_item_condition_groups_item.py b/rootly_sdk/models/update_alert_route_data_attributes_rules_item_condition_groups_item.py index a9fda9b6..69d9514c 100644 --- a/rootly_sdk/models/update_alert_route_data_attributes_rules_item_condition_groups_item.py +++ b/rootly_sdk/models/update_alert_route_data_attributes_rules_item_condition_groups_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -24,7 +24,7 @@ class UpdateAlertRouteDataAttributesRulesItemConditionGroupsItem: """ conditions: list["UpdateAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItem"] - position: Union[Unset, int] = UNSET + position: Unset | int = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_alert_route_data_attributes_rules_item_condition_groups_item_conditions_item.py b/rootly_sdk/models/update_alert_route_data_attributes_rules_item_condition_groups_item_conditions_item.py index 0ccedbfb..3e3d2b07 100644 --- a/rootly_sdk/models/update_alert_route_data_attributes_rules_item_condition_groups_item_conditions_item.py +++ b/rootly_sdk/models/update_alert_route_data_attributes_rules_item_condition_groups_item_conditions_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from uuid import UUID from attrs import define as _attrs_define @@ -43,14 +43,14 @@ class UpdateAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItem: UpdateAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemPropertyFieldConditionType ) property_field_type: UpdateAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemPropertyFieldType - property_field_name: Union[Unset, str] = UNSET - property_field_value: Union[None, Unset, str] = UNSET - property_field_values: Union[None, Unset, list[str]] = UNSET - alert_urgency_ids: Union[None, Unset, list[str]] = UNSET - conditionable_type: Union[ - Unset, UpdateAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemConditionableType - ] = UNSET - conditionable_id: Union[None, UUID, Unset] = UNSET + property_field_name: Unset | str = UNSET + property_field_value: None | Unset | str = UNSET + property_field_values: None | Unset | list[str] = UNSET + alert_urgency_ids: None | Unset | list[str] = UNSET + conditionable_type: ( + Unset | UpdateAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemConditionableType + ) = UNSET + conditionable_id: None | UUID | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -60,13 +60,13 @@ def to_dict(self) -> dict[str, Any]: property_field_name = self.property_field_name - property_field_value: Union[None, Unset, str] + property_field_value: None | Unset | str if isinstance(self.property_field_value, Unset): property_field_value = UNSET else: property_field_value = self.property_field_value - property_field_values: Union[None, Unset, list[str]] + property_field_values: None | Unset | list[str] if isinstance(self.property_field_values, Unset): property_field_values = UNSET elif isinstance(self.property_field_values, list): @@ -75,7 +75,7 @@ def to_dict(self) -> dict[str, Any]: else: property_field_values = self.property_field_values - alert_urgency_ids: Union[None, Unset, list[str]] + alert_urgency_ids: None | Unset | list[str] if isinstance(self.alert_urgency_ids, Unset): alert_urgency_ids = UNSET elif isinstance(self.alert_urgency_ids, list): @@ -84,11 +84,11 @@ def to_dict(self) -> dict[str, Any]: else: alert_urgency_ids = self.alert_urgency_ids - conditionable_type: Union[Unset, str] = UNSET + conditionable_type: Unset | str = UNSET if not isinstance(self.conditionable_type, Unset): conditionable_type = self.conditionable_type - conditionable_id: Union[None, Unset, str] + conditionable_id: None | Unset | str if isinstance(self.conditionable_id, Unset): conditionable_id = UNSET elif isinstance(self.conditionable_id, UUID): @@ -132,16 +132,16 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: property_field_name = d.pop("property_field_name", UNSET) - def _parse_property_field_value(data: object) -> Union[None, Unset, str]: + def _parse_property_field_value(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) property_field_value = _parse_property_field_value(d.pop("property_field_value", UNSET)) - def _parse_property_field_values(data: object) -> Union[None, Unset, list[str]]: + def _parse_property_field_values(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -154,11 +154,11 @@ def _parse_property_field_values(data: object) -> Union[None, Unset, list[str]]: return property_field_values_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) property_field_values = _parse_property_field_values(d.pop("property_field_values", UNSET)) - def _parse_alert_urgency_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_alert_urgency_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -171,14 +171,14 @@ def _parse_alert_urgency_ids(data: object) -> Union[None, Unset, list[str]]: return alert_urgency_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) alert_urgency_ids = _parse_alert_urgency_ids(d.pop("alert_urgency_ids", UNSET)) _conditionable_type = d.pop("conditionable_type", UNSET) - conditionable_type: Union[ - Unset, UpdateAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemConditionableType - ] + conditionable_type: ( + Unset | UpdateAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemConditionableType + ) if isinstance(_conditionable_type, Unset): conditionable_type = UNSET else: @@ -186,7 +186,7 @@ def _parse_alert_urgency_ids(data: object) -> Union[None, Unset, list[str]]: _conditionable_type ) - def _parse_conditionable_id(data: object) -> Union[None, UUID, Unset]: + def _parse_conditionable_id(data: object) -> None | UUID | Unset: if data is None: return data if isinstance(data, Unset): @@ -199,7 +199,7 @@ def _parse_conditionable_id(data: object) -> Union[None, UUID, Unset]: return conditionable_id_type_0 except: # noqa: E722 pass - return cast(Union[None, UUID, Unset], data) + return cast(None | UUID | Unset, data) conditionable_id = _parse_conditionable_id(d.pop("conditionable_id", UNSET)) diff --git a/rootly_sdk/models/update_alert_routing_rule_data_attributes.py b/rootly_sdk/models/update_alert_routing_rule_data_attributes.py index c77e21c2..181ae760 100644 --- a/rootly_sdk/models/update_alert_routing_rule_data_attributes.py +++ b/rootly_sdk/models/update_alert_routing_rule_data_attributes.py @@ -37,13 +37,13 @@ class UpdateAlertRoutingRuleDataAttributes: destination (Union[Unset, UpdateAlertRoutingRuleDataAttributesDestination]): """ - name: Union[Unset, str] = UNSET - enabled: Union[Unset, bool] = UNSET - alerts_source_id: Union[Unset, UUID] = UNSET - position: Union[Unset, int] = UNSET - owning_team_ids: Union[Unset, list[UUID]] = UNSET - condition_type: Union[Unset, UpdateAlertRoutingRuleDataAttributesConditionType] = UNSET - conditions: Union[Unset, list["UpdateAlertRoutingRuleDataAttributesConditionsItem"]] = UNSET + name: Unset | str = UNSET + enabled: Unset | bool = UNSET + alerts_source_id: Unset | UUID = UNSET + position: Unset | int = UNSET + owning_team_ids: Unset | list[UUID] = UNSET + condition_type: Unset | UpdateAlertRoutingRuleDataAttributesConditionType = UNSET + conditions: Unset | list["UpdateAlertRoutingRuleDataAttributesConditionsItem"] = UNSET destination: Union[Unset, "UpdateAlertRoutingRuleDataAttributesDestination"] = UNSET def to_dict(self) -> dict[str, Any]: @@ -51,31 +51,31 @@ def to_dict(self) -> dict[str, Any]: enabled = self.enabled - alerts_source_id: Union[Unset, str] = UNSET + alerts_source_id: Unset | str = UNSET if not isinstance(self.alerts_source_id, Unset): alerts_source_id = str(self.alerts_source_id) position = self.position - owning_team_ids: Union[Unset, list[str]] = UNSET + owning_team_ids: Unset | list[str] = UNSET if not isinstance(self.owning_team_ids, Unset): owning_team_ids = [] for owning_team_ids_item_data in self.owning_team_ids: owning_team_ids_item = str(owning_team_ids_item_data) owning_team_ids.append(owning_team_ids_item) - condition_type: Union[Unset, str] = UNSET + condition_type: Unset | str = UNSET if not isinstance(self.condition_type, Unset): condition_type = self.condition_type - conditions: Union[Unset, list[dict[str, Any]]] = UNSET + conditions: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.conditions, Unset): conditions = [] for conditions_item_data in self.conditions: conditions_item = conditions_item_data.to_dict() conditions.append(conditions_item) - destination: Union[Unset, dict[str, Any]] = UNSET + destination: Unset | dict[str, Any] = UNSET if not isinstance(self.destination, Unset): destination = self.destination.to_dict() @@ -116,7 +116,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: enabled = d.pop("enabled", UNSET) _alerts_source_id = d.pop("alerts_source_id", UNSET) - alerts_source_id: Union[Unset, UUID] + alerts_source_id: Unset | UUID if isinstance(_alerts_source_id, Unset): alerts_source_id = UNSET else: @@ -132,7 +132,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: owning_team_ids.append(owning_team_ids_item) _condition_type = d.pop("condition_type", UNSET) - condition_type: Union[Unset, UpdateAlertRoutingRuleDataAttributesConditionType] + condition_type: Unset | UpdateAlertRoutingRuleDataAttributesConditionType if isinstance(_condition_type, Unset): condition_type = UNSET else: @@ -146,7 +146,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: conditions.append(conditions_item) _destination = d.pop("destination", UNSET) - destination: Union[Unset, UpdateAlertRoutingRuleDataAttributesDestination] + destination: Unset | UpdateAlertRoutingRuleDataAttributesDestination if isinstance(_destination, Unset): destination = UNSET else: diff --git a/rootly_sdk/models/update_alert_routing_rule_data_attributes_conditions_item.py b/rootly_sdk/models/update_alert_routing_rule_data_attributes_conditions_item.py index 0c0e3001..4c4aa987 100644 --- a/rootly_sdk/models/update_alert_routing_rule_data_attributes_conditions_item.py +++ b/rootly_sdk/models/update_alert_routing_rule_data_attributes_conditions_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from uuid import UUID from attrs import define as _attrs_define @@ -38,38 +38,38 @@ class UpdateAlertRoutingRuleDataAttributesConditionsItem: condition type is 'is_one_of' or 'is_not_one_of' except for when property field name is 'alert_urgency' """ - id: Union[Unset, UUID] = UNSET - property_field_type: Union[Unset, UpdateAlertRoutingRuleDataAttributesConditionsItemPropertyFieldType] = UNSET - property_field_name: Union[Unset, str] = UNSET - property_field_condition_type: Union[ - Unset, UpdateAlertRoutingRuleDataAttributesConditionsItemPropertyFieldConditionType - ] = UNSET - property_field_value: Union[None, Unset, str] = UNSET - property_field_values: Union[Unset, list[str]] = UNSET + id: Unset | UUID = UNSET + property_field_type: Unset | UpdateAlertRoutingRuleDataAttributesConditionsItemPropertyFieldType = UNSET + property_field_name: Unset | str = UNSET + property_field_condition_type: ( + Unset | UpdateAlertRoutingRuleDataAttributesConditionsItemPropertyFieldConditionType + ) = UNSET + property_field_value: None | Unset | str = UNSET + property_field_values: Unset | list[str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id: Union[Unset, str] = UNSET + id: Unset | str = UNSET if not isinstance(self.id, Unset): id = str(self.id) - property_field_type: Union[Unset, str] = UNSET + property_field_type: Unset | str = UNSET if not isinstance(self.property_field_type, Unset): property_field_type = self.property_field_type property_field_name = self.property_field_name - property_field_condition_type: Union[Unset, str] = UNSET + property_field_condition_type: Unset | str = UNSET if not isinstance(self.property_field_condition_type, Unset): property_field_condition_type = self.property_field_condition_type - property_field_value: Union[None, Unset, str] + property_field_value: None | Unset | str if isinstance(self.property_field_value, Unset): property_field_value = UNSET else: property_field_value = self.property_field_value - property_field_values: Union[Unset, list[str]] = UNSET + property_field_values: Unset | list[str] = UNSET if not isinstance(self.property_field_values, Unset): property_field_values = self.property_field_values @@ -95,14 +95,14 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _id = d.pop("id", UNSET) - id: Union[Unset, UUID] + id: Unset | UUID if isinstance(_id, Unset): id = UNSET else: id = UUID(_id) _property_field_type = d.pop("property_field_type", UNSET) - property_field_type: Union[Unset, UpdateAlertRoutingRuleDataAttributesConditionsItemPropertyFieldType] + property_field_type: Unset | UpdateAlertRoutingRuleDataAttributesConditionsItemPropertyFieldType if isinstance(_property_field_type, Unset): property_field_type = UNSET else: @@ -113,9 +113,9 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: property_field_name = d.pop("property_field_name", UNSET) _property_field_condition_type = d.pop("property_field_condition_type", UNSET) - property_field_condition_type: Union[ - Unset, UpdateAlertRoutingRuleDataAttributesConditionsItemPropertyFieldConditionType - ] + property_field_condition_type: ( + Unset | UpdateAlertRoutingRuleDataAttributesConditionsItemPropertyFieldConditionType + ) if isinstance(_property_field_condition_type, Unset): property_field_condition_type = UNSET else: @@ -125,12 +125,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: ) ) - def _parse_property_field_value(data: object) -> Union[None, Unset, str]: + def _parse_property_field_value(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) property_field_value = _parse_property_field_value(d.pop("property_field_value", UNSET)) diff --git a/rootly_sdk/models/update_alert_routing_rule_data_attributes_destination.py b/rootly_sdk/models/update_alert_routing_rule_data_attributes_destination.py index d9e2a74b..f573dc7e 100644 --- a/rootly_sdk/models/update_alert_routing_rule_data_attributes_destination.py +++ b/rootly_sdk/models/update_alert_routing_rule_data_attributes_destination.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from uuid import UUID from attrs import define as _attrs_define @@ -23,16 +23,16 @@ class UpdateAlertRoutingRuleDataAttributesDestination: target_id (Union[Unset, UUID]): The ID of the target """ - target_type: Union[Unset, UpdateAlertRoutingRuleDataAttributesDestinationTargetType] = UNSET - target_id: Union[Unset, UUID] = UNSET + target_type: Unset | UpdateAlertRoutingRuleDataAttributesDestinationTargetType = UNSET + target_id: Unset | UUID = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - target_type: Union[Unset, str] = UNSET + target_type: Unset | str = UNSET if not isinstance(self.target_type, Unset): target_type = self.target_type - target_id: Union[Unset, str] = UNSET + target_id: Unset | str = UNSET if not isinstance(self.target_id, Unset): target_id = str(self.target_id) @@ -50,14 +50,14 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _target_type = d.pop("target_type", UNSET) - target_type: Union[Unset, UpdateAlertRoutingRuleDataAttributesDestinationTargetType] + target_type: Unset | UpdateAlertRoutingRuleDataAttributesDestinationTargetType if isinstance(_target_type, Unset): target_type = UNSET else: target_type = check_update_alert_routing_rule_data_attributes_destination_target_type(_target_type) _target_id = d.pop("target_id", UNSET) - target_id: Union[Unset, UUID] + target_id: Unset | UUID if isinstance(_target_id, Unset): target_id = UNSET else: diff --git a/rootly_sdk/models/update_alert_urgency_data_attributes.py b/rootly_sdk/models/update_alert_urgency_data_attributes.py index 1424511a..f9137d5c 100644 --- a/rootly_sdk/models/update_alert_urgency_data_attributes.py +++ b/rootly_sdk/models/update_alert_urgency_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -19,23 +19,23 @@ class UpdateAlertUrgencyDataAttributes: minutes; null inherits the workspace default, negative = never. """ - name: Union[Unset, str] = UNSET - description: Union[Unset, str] = UNSET - position: Union[None, Unset, int] = UNSET - retrigger_timeout_minutes: Union[None, Unset, int] = UNSET + name: Unset | str = UNSET + description: Unset | str = UNSET + position: None | Unset | int = UNSET + retrigger_timeout_minutes: None | Unset | int = UNSET def to_dict(self) -> dict[str, Any]: name = self.name description = self.description - position: Union[None, Unset, int] + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: position = self.position - retrigger_timeout_minutes: Union[None, Unset, int] + retrigger_timeout_minutes: None | Unset | int if isinstance(self.retrigger_timeout_minutes, Unset): retrigger_timeout_minutes = UNSET else: @@ -62,21 +62,21 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: description = d.pop("description", UNSET) - def _parse_position(data: object) -> Union[None, Unset, int]: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) - def _parse_retrigger_timeout_minutes(data: object) -> Union[None, Unset, int]: + def _parse_retrigger_timeout_minutes(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) retrigger_timeout_minutes = _parse_retrigger_timeout_minutes(d.pop("retrigger_timeout_minutes", UNSET)) diff --git a/rootly_sdk/models/update_alerts_source_data_attributes.py b/rootly_sdk/models/update_alerts_source_data_attributes.py index 3d057466..514858bd 100644 --- a/rootly_sdk/models/update_alerts_source_data_attributes.py +++ b/rootly_sdk/models/update_alerts_source_data_attributes.py @@ -67,28 +67,28 @@ class UpdateAlertsSourceDataAttributes: Rootly customer support if you need assistance with this feature. """ - name: Union[Unset, str] = UNSET - enabled: Union[Unset, bool] = UNSET - source_type: Union[Unset, UpdateAlertsSourceDataAttributesSourceType] = UNSET - alert_urgency_id: Union[Unset, str] = UNSET - deduplicate_alerts_by_key: Union[Unset, bool] = UNSET - deduplication_key_kind: Union[Unset, UpdateAlertsSourceDataAttributesDeduplicationKeyKind] = UNSET - deduplication_key_path: Union[None, Unset, str] = UNSET - deduplication_key_regexp: Union[None, Unset, str] = UNSET - owner_group_ids: Union[Unset, list[str]] = UNSET + name: Unset | str = UNSET + enabled: Unset | bool = UNSET + source_type: Unset | UpdateAlertsSourceDataAttributesSourceType = UNSET + alert_urgency_id: Unset | str = UNSET + deduplicate_alerts_by_key: Unset | bool = UNSET + deduplication_key_kind: Unset | UpdateAlertsSourceDataAttributesDeduplicationKeyKind = UNSET + deduplication_key_path: None | Unset | str = UNSET + deduplication_key_regexp: None | Unset | str = UNSET + owner_group_ids: Unset | list[str] = UNSET alert_template_attributes: Union["UpdateAlertsSourceDataAttributesAlertTemplateAttributesType0", None, Unset] = ( UNSET ) - alert_source_urgency_rules_attributes: Union[ - Unset, list["UpdateAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItem"] - ] = UNSET + alert_source_urgency_rules_attributes: ( + Unset | list["UpdateAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItem"] + ) = UNSET sourceable_attributes: Union["UpdateAlertsSourceDataAttributesSourceableAttributesType0", None, Unset] = UNSET resolution_rule_attributes: Union["UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0", None, Unset] = ( UNSET ) - alert_source_fields_attributes: Union[ - Unset, list["UpdateAlertsSourceDataAttributesAlertSourceFieldsAttributesItem"] - ] = UNSET + alert_source_fields_attributes: Unset | list["UpdateAlertsSourceDataAttributesAlertSourceFieldsAttributesItem"] = ( + UNSET + ) def to_dict(self) -> dict[str, Any]: from ..models.update_alerts_source_data_attributes_alert_template_attributes_type_0 import ( @@ -105,7 +105,7 @@ def to_dict(self) -> dict[str, Any]: enabled = self.enabled - source_type: Union[Unset, str] = UNSET + source_type: Unset | str = UNSET if not isinstance(self.source_type, Unset): source_type = self.source_type @@ -113,27 +113,27 @@ def to_dict(self) -> dict[str, Any]: deduplicate_alerts_by_key = self.deduplicate_alerts_by_key - deduplication_key_kind: Union[Unset, str] = UNSET + deduplication_key_kind: Unset | str = UNSET if not isinstance(self.deduplication_key_kind, Unset): deduplication_key_kind = self.deduplication_key_kind - deduplication_key_path: Union[None, Unset, str] + deduplication_key_path: None | Unset | str if isinstance(self.deduplication_key_path, Unset): deduplication_key_path = UNSET else: deduplication_key_path = self.deduplication_key_path - deduplication_key_regexp: Union[None, Unset, str] + deduplication_key_regexp: None | Unset | str if isinstance(self.deduplication_key_regexp, Unset): deduplication_key_regexp = UNSET else: deduplication_key_regexp = self.deduplication_key_regexp - owner_group_ids: Union[Unset, list[str]] = UNSET + owner_group_ids: Unset | list[str] = UNSET if not isinstance(self.owner_group_ids, Unset): owner_group_ids = self.owner_group_ids - alert_template_attributes: Union[None, Unset, dict[str, Any]] + alert_template_attributes: None | Unset | dict[str, Any] if isinstance(self.alert_template_attributes, Unset): alert_template_attributes = UNSET elif isinstance(self.alert_template_attributes, UpdateAlertsSourceDataAttributesAlertTemplateAttributesType0): @@ -141,14 +141,14 @@ def to_dict(self) -> dict[str, Any]: else: alert_template_attributes = self.alert_template_attributes - alert_source_urgency_rules_attributes: Union[Unset, list[dict[str, Any]]] = UNSET + alert_source_urgency_rules_attributes: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.alert_source_urgency_rules_attributes, Unset): alert_source_urgency_rules_attributes = [] for alert_source_urgency_rules_attributes_item_data in self.alert_source_urgency_rules_attributes: alert_source_urgency_rules_attributes_item = alert_source_urgency_rules_attributes_item_data.to_dict() alert_source_urgency_rules_attributes.append(alert_source_urgency_rules_attributes_item) - sourceable_attributes: Union[None, Unset, dict[str, Any]] + sourceable_attributes: None | Unset | dict[str, Any] if isinstance(self.sourceable_attributes, Unset): sourceable_attributes = UNSET elif isinstance(self.sourceable_attributes, UpdateAlertsSourceDataAttributesSourceableAttributesType0): @@ -156,7 +156,7 @@ def to_dict(self) -> dict[str, Any]: else: sourceable_attributes = self.sourceable_attributes - resolution_rule_attributes: Union[None, Unset, dict[str, Any]] + resolution_rule_attributes: None | Unset | dict[str, Any] if isinstance(self.resolution_rule_attributes, Unset): resolution_rule_attributes = UNSET elif isinstance(self.resolution_rule_attributes, UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0): @@ -164,7 +164,7 @@ def to_dict(self) -> dict[str, Any]: else: resolution_rule_attributes = self.resolution_rule_attributes - alert_source_fields_attributes: Union[Unset, list[dict[str, Any]]] = UNSET + alert_source_fields_attributes: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.alert_source_fields_attributes, Unset): alert_source_fields_attributes = [] for alert_source_fields_attributes_item_data in self.alert_source_fields_attributes: @@ -229,7 +229,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: enabled = d.pop("enabled", UNSET) _source_type = d.pop("source_type", UNSET) - source_type: Union[Unset, UpdateAlertsSourceDataAttributesSourceType] + source_type: Unset | UpdateAlertsSourceDataAttributesSourceType if isinstance(_source_type, Unset): source_type = UNSET else: @@ -240,7 +240,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: deduplicate_alerts_by_key = d.pop("deduplicate_alerts_by_key", UNSET) _deduplication_key_kind = d.pop("deduplication_key_kind", UNSET) - deduplication_key_kind: Union[Unset, UpdateAlertsSourceDataAttributesDeduplicationKeyKind] + deduplication_key_kind: Unset | UpdateAlertsSourceDataAttributesDeduplicationKeyKind if isinstance(_deduplication_key_kind, Unset): deduplication_key_kind = UNSET else: @@ -248,21 +248,21 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: _deduplication_key_kind ) - def _parse_deduplication_key_path(data: object) -> Union[None, Unset, str]: + def _parse_deduplication_key_path(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) deduplication_key_path = _parse_deduplication_key_path(d.pop("deduplication_key_path", UNSET)) - def _parse_deduplication_key_regexp(data: object) -> Union[None, Unset, str]: + def _parse_deduplication_key_regexp(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) deduplication_key_regexp = _parse_deduplication_key_regexp(d.pop("deduplication_key_regexp", UNSET)) diff --git a/rootly_sdk/models/update_alerts_source_data_attributes_alert_source_fields_attributes_item.py b/rootly_sdk/models/update_alerts_source_data_attributes_alert_source_fields_attributes_item.py index a1bd277d..954963ad 100644 --- a/rootly_sdk/models/update_alerts_source_data_attributes_alert_source_fields_attributes_item.py +++ b/rootly_sdk/models/update_alerts_source_data_attributes_alert_source_fields_attributes_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -18,14 +18,14 @@ class UpdateAlertsSourceDataAttributesAlertSourceFieldsAttributesItem: for evaluation """ - alert_field_id: Union[Unset, str] = UNSET - template_body: Union[None, Unset, str] = UNSET + alert_field_id: Unset | str = UNSET + template_body: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: alert_field_id = self.alert_field_id - template_body: Union[None, Unset, str] + template_body: None | Unset | str if isinstance(self.template_body, Unset): template_body = UNSET else: @@ -46,12 +46,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) alert_field_id = d.pop("alert_field_id", UNSET) - def _parse_template_body(data: object) -> Union[None, Unset, str]: + def _parse_template_body(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) template_body = _parse_template_body(d.pop("template_body", UNSET)) diff --git a/rootly_sdk/models/update_alerts_source_data_attributes_alert_source_urgency_rules_attributes_item.py b/rootly_sdk/models/update_alerts_source_data_attributes_alert_source_urgency_rules_attributes_item.py index f4f49e29..4542ac61 100644 --- a/rootly_sdk/models/update_alerts_source_data_attributes_alert_source_urgency_rules_attributes_item.py +++ b/rootly_sdk/models/update_alerts_source_data_attributes_alert_source_urgency_rules_attributes_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -41,41 +41,41 @@ class UpdateAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItem: alert_urgency_id (Union[Unset, str]): The ID of the alert urgency """ - json_path: Union[None, Unset, str] = UNSET - operator: Union[Unset, UpdateAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemOperator] = UNSET - value: Union[Unset, str] = UNSET - conditionable_type: Union[ - Unset, UpdateAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemConditionableType - ] = UNSET - conditionable_id: Union[None, Unset, str] = UNSET - kind: Union[Unset, UpdateAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemKind] = UNSET - alert_urgency_id: Union[Unset, str] = UNSET + json_path: None | Unset | str = UNSET + operator: Unset | UpdateAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemOperator = UNSET + value: Unset | str = UNSET + conditionable_type: ( + Unset | UpdateAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemConditionableType + ) = UNSET + conditionable_id: None | Unset | str = UNSET + kind: Unset | UpdateAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemKind = UNSET + alert_urgency_id: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - json_path: Union[None, Unset, str] + json_path: None | Unset | str if isinstance(self.json_path, Unset): json_path = UNSET else: json_path = self.json_path - operator: Union[Unset, str] = UNSET + operator: Unset | str = UNSET if not isinstance(self.operator, Unset): operator = self.operator value = self.value - conditionable_type: Union[Unset, str] = UNSET + conditionable_type: Unset | str = UNSET if not isinstance(self.conditionable_type, Unset): conditionable_type = self.conditionable_type - conditionable_id: Union[None, Unset, str] + conditionable_id: None | Unset | str if isinstance(self.conditionable_id, Unset): conditionable_id = UNSET else: conditionable_id = self.conditionable_id - kind: Union[Unset, str] = UNSET + kind: Unset | str = UNSET if not isinstance(self.kind, Unset): kind = self.kind @@ -105,17 +105,17 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_json_path(data: object) -> Union[None, Unset, str]: + def _parse_json_path(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) json_path = _parse_json_path(d.pop("json_path", UNSET)) _operator = d.pop("operator", UNSET) - operator: Union[Unset, UpdateAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemOperator] + operator: Unset | UpdateAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemOperator if isinstance(_operator, Unset): operator = UNSET else: @@ -126,9 +126,9 @@ def _parse_json_path(data: object) -> Union[None, Unset, str]: value = d.pop("value", UNSET) _conditionable_type = d.pop("conditionable_type", UNSET) - conditionable_type: Union[ - Unset, UpdateAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemConditionableType - ] + conditionable_type: ( + Unset | UpdateAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemConditionableType + ) if isinstance(_conditionable_type, Unset): conditionable_type = UNSET else: @@ -136,17 +136,17 @@ def _parse_json_path(data: object) -> Union[None, Unset, str]: _conditionable_type ) - def _parse_conditionable_id(data: object) -> Union[None, Unset, str]: + def _parse_conditionable_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) conditionable_id = _parse_conditionable_id(d.pop("conditionable_id", UNSET)) _kind = d.pop("kind", UNSET) - kind: Union[Unset, UpdateAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemKind] + kind: Unset | UpdateAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemKind if isinstance(_kind, Unset): kind = UNSET else: diff --git a/rootly_sdk/models/update_alerts_source_data_attributes_alert_template_attributes_type_0.py b/rootly_sdk/models/update_alerts_source_data_attributes_alert_template_attributes_type_0.py index c5c9d6ac..9e04ab56 100644 --- a/rootly_sdk/models/update_alerts_source_data_attributes_alert_template_attributes_type_0.py +++ b/rootly_sdk/models/update_alerts_source_data_attributes_alert_template_attributes_type_0.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -18,25 +18,25 @@ class UpdateAlertsSourceDataAttributesAlertTemplateAttributesType0: external_url (Union[None, Unset, str]): The alert URL. """ - title: Union[None, Unset, str] = UNSET - description: Union[None, Unset, str] = UNSET - external_url: Union[None, Unset, str] = UNSET + title: None | Unset | str = UNSET + description: None | Unset | str = UNSET + external_url: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - title: Union[None, Unset, str] + title: None | Unset | str if isinstance(self.title, Unset): title = UNSET else: title = self.title - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - external_url: Union[None, Unset, str] + external_url: None | Unset | str if isinstance(self.external_url, Unset): external_url = UNSET else: @@ -58,30 +58,30 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_title(data: object) -> Union[None, Unset, str]: + def _parse_title(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) title = _parse_title(d.pop("title", UNSET)) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_external_url(data: object) -> Union[None, Unset, str]: + def _parse_external_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) external_url = _parse_external_url(d.pop("external_url", UNSET)) diff --git a/rootly_sdk/models/update_alerts_source_data_attributes_resolution_rule_attributes_type_0.py b/rootly_sdk/models/update_alerts_source_data_attributes_resolution_rule_attributes_type_0.py index 7f1b3ae2..2dce4d7d 100644 --- a/rootly_sdk/models/update_alerts_source_data_attributes_resolution_rule_attributes_type_0.py +++ b/rootly_sdk/models/update_alerts_source_data_attributes_resolution_rule_attributes_type_0.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -52,56 +52,56 @@ class UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0: conditions to evaluate for auto resolution """ - enabled: Union[Unset, bool] = UNSET - condition_type: Union[Unset, UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionType] = UNSET - identifier_matchable_type: Union[ - Unset, UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0IdentifierMatchableType - ] = UNSET - identifier_matchable_id: Union[None, Unset, str] = UNSET - identifier_reference_kind: Union[ - Unset, UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0IdentifierReferenceKind - ] = UNSET - identifier_json_path: Union[None, Unset, str] = UNSET - identifier_value_regex: Union[None, Unset, str] = UNSET - conditions_attributes: Union[ - Unset, list["UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItem"] - ] = UNSET + enabled: Unset | bool = UNSET + condition_type: Unset | UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionType = UNSET + identifier_matchable_type: ( + Unset | UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0IdentifierMatchableType + ) = UNSET + identifier_matchable_id: None | Unset | str = UNSET + identifier_reference_kind: ( + Unset | UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0IdentifierReferenceKind + ) = UNSET + identifier_json_path: None | Unset | str = UNSET + identifier_value_regex: None | Unset | str = UNSET + conditions_attributes: ( + Unset | list["UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItem"] + ) = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: enabled = self.enabled - condition_type: Union[Unset, str] = UNSET + condition_type: Unset | str = UNSET if not isinstance(self.condition_type, Unset): condition_type = self.condition_type - identifier_matchable_type: Union[Unset, str] = UNSET + identifier_matchable_type: Unset | str = UNSET if not isinstance(self.identifier_matchable_type, Unset): identifier_matchable_type = self.identifier_matchable_type - identifier_matchable_id: Union[None, Unset, str] + identifier_matchable_id: None | Unset | str if isinstance(self.identifier_matchable_id, Unset): identifier_matchable_id = UNSET else: identifier_matchable_id = self.identifier_matchable_id - identifier_reference_kind: Union[Unset, str] = UNSET + identifier_reference_kind: Unset | str = UNSET if not isinstance(self.identifier_reference_kind, Unset): identifier_reference_kind = self.identifier_reference_kind - identifier_json_path: Union[None, Unset, str] + identifier_json_path: None | Unset | str if isinstance(self.identifier_json_path, Unset): identifier_json_path = UNSET else: identifier_json_path = self.identifier_json_path - identifier_value_regex: Union[None, Unset, str] + identifier_value_regex: None | Unset | str if isinstance(self.identifier_value_regex, Unset): identifier_value_regex = UNSET else: identifier_value_regex = self.identifier_value_regex - conditions_attributes: Union[Unset, list[dict[str, Any]]] = UNSET + conditions_attributes: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.conditions_attributes, Unset): conditions_attributes = [] for conditions_attributes_item_data in self.conditions_attributes: @@ -140,7 +140,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: enabled = d.pop("enabled", UNSET) _condition_type = d.pop("condition_type", UNSET) - condition_type: Union[Unset, UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionType] + condition_type: Unset | UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionType if isinstance(_condition_type, Unset): condition_type = UNSET else: @@ -151,9 +151,9 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: ) _identifier_matchable_type = d.pop("identifier_matchable_type", UNSET) - identifier_matchable_type: Union[ - Unset, UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0IdentifierMatchableType - ] + identifier_matchable_type: ( + Unset | UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0IdentifierMatchableType + ) if isinstance(_identifier_matchable_type, Unset): identifier_matchable_type = UNSET else: @@ -163,19 +163,19 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: ) ) - def _parse_identifier_matchable_id(data: object) -> Union[None, Unset, str]: + def _parse_identifier_matchable_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) identifier_matchable_id = _parse_identifier_matchable_id(d.pop("identifier_matchable_id", UNSET)) _identifier_reference_kind = d.pop("identifier_reference_kind", UNSET) - identifier_reference_kind: Union[ - Unset, UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0IdentifierReferenceKind - ] + identifier_reference_kind: ( + Unset | UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0IdentifierReferenceKind + ) if isinstance(_identifier_reference_kind, Unset): identifier_reference_kind = UNSET else: @@ -185,21 +185,21 @@ def _parse_identifier_matchable_id(data: object) -> Union[None, Unset, str]: ) ) - def _parse_identifier_json_path(data: object) -> Union[None, Unset, str]: + def _parse_identifier_json_path(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) identifier_json_path = _parse_identifier_json_path(d.pop("identifier_json_path", UNSET)) - def _parse_identifier_value_regex(data: object) -> Union[None, Unset, str]: + def _parse_identifier_value_regex(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) identifier_value_regex = _parse_identifier_value_regex(d.pop("identifier_value_regex", UNSET)) diff --git a/rootly_sdk/models/update_alerts_source_data_attributes_resolution_rule_attributes_type_0_conditions_attributes_item.py b/rootly_sdk/models/update_alerts_source_data_attributes_resolution_rule_attributes_type_0_conditions_attributes_item.py index dbfcaa07..c991994f 100644 --- a/rootly_sdk/models/update_alerts_source_data_attributes_resolution_rule_attributes_type_0_conditions_attributes_item.py +++ b/rootly_sdk/models/update_alerts_source_data_attributes_resolution_rule_attributes_type_0_conditions_attributes_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -41,44 +41,42 @@ class UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAtt The kind of the conditionable """ - field: Union[None, Unset, str] = UNSET - operator: Union[ - Unset, UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemOperator - ] = UNSET - value: Union[Unset, str] = UNSET - conditionable_type: Union[ - Unset, UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemConditionableType - ] = UNSET - conditionable_id: Union[None, Unset, str] = UNSET - kind: Union[Unset, UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemKind] = ( + field: None | Unset | str = UNSET + operator: Unset | UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemOperator = ( UNSET ) + value: Unset | str = UNSET + conditionable_type: ( + Unset | UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemConditionableType + ) = UNSET + conditionable_id: None | Unset | str = UNSET + kind: Unset | UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemKind = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - field: Union[None, Unset, str] + field: None | Unset | str if isinstance(self.field, Unset): field = UNSET else: field = self.field - operator: Union[Unset, str] = UNSET + operator: Unset | str = UNSET if not isinstance(self.operator, Unset): operator = self.operator value = self.value - conditionable_type: Union[Unset, str] = UNSET + conditionable_type: Unset | str = UNSET if not isinstance(self.conditionable_type, Unset): conditionable_type = self.conditionable_type - conditionable_id: Union[None, Unset, str] + conditionable_id: None | Unset | str if isinstance(self.conditionable_id, Unset): conditionable_id = UNSET else: conditionable_id = self.conditionable_id - kind: Union[Unset, str] = UNSET + kind: Unset | str = UNSET if not isinstance(self.kind, Unset): kind = self.kind @@ -104,19 +102,17 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_field(data: object) -> Union[None, Unset, str]: + def _parse_field(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) field = _parse_field(d.pop("field", UNSET)) _operator = d.pop("operator", UNSET) - operator: Union[ - Unset, UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemOperator - ] + operator: Unset | UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemOperator if isinstance(_operator, Unset): operator = UNSET else: @@ -127,10 +123,10 @@ def _parse_field(data: object) -> Union[None, Unset, str]: value = d.pop("value", UNSET) _conditionable_type = d.pop("conditionable_type", UNSET) - conditionable_type: Union[ - Unset, - UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemConditionableType, - ] + conditionable_type: ( + Unset + | UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemConditionableType + ) if isinstance(_conditionable_type, Unset): conditionable_type = UNSET else: @@ -138,17 +134,17 @@ def _parse_field(data: object) -> Union[None, Unset, str]: _conditionable_type ) - def _parse_conditionable_id(data: object) -> Union[None, Unset, str]: + def _parse_conditionable_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) conditionable_id = _parse_conditionable_id(d.pop("conditionable_id", UNSET)) _kind = d.pop("kind", UNSET) - kind: Union[Unset, UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemKind] + kind: Unset | UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemKind if isinstance(_kind, Unset): kind = UNSET else: diff --git a/rootly_sdk/models/update_alerts_source_data_attributes_sourceable_attributes_type_0.py b/rootly_sdk/models/update_alerts_source_data_attributes_sourceable_attributes_type_0.py index d2c515c9..c7bd0543 100644 --- a/rootly_sdk/models/update_alerts_source_data_attributes_sourceable_attributes_type_0.py +++ b/rootly_sdk/models/update_alerts_source_data_attributes_sourceable_attributes_type_0.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -31,18 +31,18 @@ class UpdateAlertsSourceDataAttributesSourceableAttributesType0: auto resolve alerts """ - auto_resolve: Union[Unset, bool] = UNSET - resolve_state: Union[None, Unset, str] = UNSET - accept_threaded_emails: Union[Unset, bool] = UNSET - field_mappings_attributes: Union[ - Unset, list["UpdateAlertsSourceDataAttributesSourceableAttributesType0FieldMappingsAttributesItem"] - ] = UNSET + auto_resolve: Unset | bool = UNSET + resolve_state: None | Unset | str = UNSET + accept_threaded_emails: Unset | bool = UNSET + field_mappings_attributes: ( + Unset | list["UpdateAlertsSourceDataAttributesSourceableAttributesType0FieldMappingsAttributesItem"] + ) = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: auto_resolve = self.auto_resolve - resolve_state: Union[None, Unset, str] + resolve_state: None | Unset | str if isinstance(self.resolve_state, Unset): resolve_state = UNSET else: @@ -50,7 +50,7 @@ def to_dict(self) -> dict[str, Any]: accept_threaded_emails = self.accept_threaded_emails - field_mappings_attributes: Union[Unset, list[dict[str, Any]]] = UNSET + field_mappings_attributes: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.field_mappings_attributes, Unset): field_mappings_attributes = [] for field_mappings_attributes_item_data in self.field_mappings_attributes: @@ -80,12 +80,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) auto_resolve = d.pop("auto_resolve", UNSET) - def _parse_resolve_state(data: object) -> Union[None, Unset, str]: + def _parse_resolve_state(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) resolve_state = _parse_resolve_state(d.pop("resolve_state", UNSET)) diff --git a/rootly_sdk/models/update_alerts_source_data_attributes_sourceable_attributes_type_0_field_mappings_attributes_item.py b/rootly_sdk/models/update_alerts_source_data_attributes_sourceable_attributes_type_0_field_mappings_attributes_item.py index ae9c0e6d..e1ec5f6a 100644 --- a/rootly_sdk/models/update_alerts_source_data_attributes_sourceable_attributes_type_0_field_mappings_attributes_item.py +++ b/rootly_sdk/models/update_alerts_source_data_attributes_sourceable_attributes_type_0_field_mappings_attributes_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -24,14 +24,12 @@ class UpdateAlertsSourceDataAttributesSourceableAttributesType0FieldMappingsAttr this may also be a Liquid template that resolves to a notification target id at routing time. """ - field: Union[Unset, UpdateAlertsSourceDataAttributesSourceableAttributesType0FieldMappingsAttributesItemField] = ( - UNSET - ) - json_path: Union[Unset, str] = UNSET + field: Unset | UpdateAlertsSourceDataAttributesSourceableAttributesType0FieldMappingsAttributesItemField = UNSET + json_path: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - field: Union[Unset, str] = UNSET + field: Unset | str = UNSET if not isinstance(self.field, Unset): field = self.field @@ -51,7 +49,7 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _field = d.pop("field", UNSET) - field: Union[Unset, UpdateAlertsSourceDataAttributesSourceableAttributesType0FieldMappingsAttributesItemField] + field: Unset | UpdateAlertsSourceDataAttributesSourceableAttributesType0FieldMappingsAttributesItemField if isinstance(_field, Unset): field = UNSET else: diff --git a/rootly_sdk/models/update_api_key_data_attributes.py b/rootly_sdk/models/update_api_key_data_attributes.py index 9087ddd9..56b49b6c 100644 --- a/rootly_sdk/models/update_api_key_data_attributes.py +++ b/rootly_sdk/models/update_api_key_data_attributes.py @@ -1,6 +1,6 @@ import datetime from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from dateutil.parser import isoparse @@ -19,20 +19,20 @@ class UpdateApiKeyDataAttributes: expires_at (Union[None, Unset, datetime.datetime]): The expiration date of the API key (ISO 8601) """ - name: Union[Unset, str] = UNSET - description: Union[None, Unset, str] = UNSET - expires_at: Union[None, Unset, datetime.datetime] = UNSET + name: Unset | str = UNSET + description: None | Unset | str = UNSET + expires_at: None | Unset | datetime.datetime = UNSET def to_dict(self) -> dict[str, Any]: name = self.name - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - expires_at: Union[None, Unset, str] + expires_at: None | Unset | str if isinstance(self.expires_at, Unset): expires_at = UNSET elif isinstance(self.expires_at, datetime.datetime): @@ -57,16 +57,16 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name", UNSET) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_expires_at(data: object) -> Union[None, Unset, datetime.datetime]: + def _parse_expires_at(data: object) -> None | Unset | datetime.datetime: if data is None: return data if isinstance(data, Unset): @@ -79,7 +79,7 @@ def _parse_expires_at(data: object) -> Union[None, Unset, datetime.datetime]: return expires_at_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, datetime.datetime], data) + return cast(None | Unset | datetime.datetime, data) expires_at = _parse_expires_at(d.pop("expires_at", UNSET)) diff --git a/rootly_sdk/models/update_asana_task_task_params.py b/rootly_sdk/models/update_asana_task_task_params.py index 2641b28e..87c64f6c 100644 --- a/rootly_sdk/models/update_asana_task_task_params.py +++ b/rootly_sdk/models/update_asana_task_task_params.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -40,14 +40,14 @@ class UpdateAsanaTaskTaskParams: task_id: str completion: "UpdateAsanaTaskTaskParamsCompletion" - task_type: Union[Unset, UpdateAsanaTaskTaskParamsTaskType] = UNSET - title: Union[Unset, str] = UNSET - notes: Union[Unset, str] = UNSET - assign_user_email: Union[Unset, str] = UNSET - due_date: Union[Unset, str] = UNSET - custom_fields_mapping: Union[None, Unset, str] = UNSET - dependency_direction: Union[Unset, UpdateAsanaTaskTaskParamsDependencyDirection] = "blocking" - dependent_task_ids: Union[None, Unset, list[str]] = UNSET + task_type: Unset | UpdateAsanaTaskTaskParamsTaskType = UNSET + title: Unset | str = UNSET + notes: Unset | str = UNSET + assign_user_email: Unset | str = UNSET + due_date: Unset | str = UNSET + custom_fields_mapping: None | Unset | str = UNSET + dependency_direction: Unset | UpdateAsanaTaskTaskParamsDependencyDirection = "blocking" + dependent_task_ids: None | Unset | list[str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -55,7 +55,7 @@ def to_dict(self) -> dict[str, Any]: completion = self.completion.to_dict() - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -67,17 +67,17 @@ def to_dict(self) -> dict[str, Any]: due_date = self.due_date - custom_fields_mapping: Union[None, Unset, str] + custom_fields_mapping: None | Unset | str if isinstance(self.custom_fields_mapping, Unset): custom_fields_mapping = UNSET else: custom_fields_mapping = self.custom_fields_mapping - dependency_direction: Union[Unset, str] = UNSET + dependency_direction: Unset | str = UNSET if not isinstance(self.dependency_direction, Unset): dependency_direction = self.dependency_direction - dependent_task_ids: Union[None, Unset, list[str]] + dependent_task_ids: None | Unset | list[str] if isinstance(self.dependent_task_ids, Unset): dependent_task_ids = UNSET elif isinstance(self.dependent_task_ids, list): @@ -123,7 +123,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: completion = UpdateAsanaTaskTaskParamsCompletion.from_dict(d.pop("completion")) _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, UpdateAsanaTaskTaskParamsTaskType] + task_type: Unset | UpdateAsanaTaskTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: @@ -137,23 +137,23 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: due_date = d.pop("due_date", UNSET) - def _parse_custom_fields_mapping(data: object) -> Union[None, Unset, str]: + def _parse_custom_fields_mapping(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) custom_fields_mapping = _parse_custom_fields_mapping(d.pop("custom_fields_mapping", UNSET)) _dependency_direction = d.pop("dependency_direction", UNSET) - dependency_direction: Union[Unset, UpdateAsanaTaskTaskParamsDependencyDirection] + dependency_direction: Unset | UpdateAsanaTaskTaskParamsDependencyDirection if isinstance(_dependency_direction, Unset): dependency_direction = UNSET else: dependency_direction = check_update_asana_task_task_params_dependency_direction(_dependency_direction) - def _parse_dependent_task_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_dependent_task_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -166,7 +166,7 @@ def _parse_dependent_task_ids(data: object) -> Union[None, Unset, list[str]]: return dependent_task_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) dependent_task_ids = _parse_dependent_task_ids(d.pop("dependent_task_ids", UNSET)) diff --git a/rootly_sdk/models/update_asana_task_task_params_completion.py b/rootly_sdk/models/update_asana_task_task_params_completion.py index 854d9df0..83952ce3 100644 --- a/rootly_sdk/models/update_asana_task_task_params_completion.py +++ b/rootly_sdk/models/update_asana_task_task_params_completion.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class UpdateAsanaTaskTaskParamsCompletion: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_attached_alerts_task_params.py b/rootly_sdk/models/update_attached_alerts_task_params.py index 46707f73..5220d7fb 100644 --- a/rootly_sdk/models/update_attached_alerts_task_params.py +++ b/rootly_sdk/models/update_attached_alerts_task_params.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -26,13 +26,13 @@ class UpdateAttachedAlertsTaskParams: """ status: UpdateAttachedAlertsTaskParamsStatus - task_type: Union[Unset, UpdateAttachedAlertsTaskParamsTaskType] = UNSET + task_type: Unset | UpdateAttachedAlertsTaskParamsTaskType = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: status: str = self.status - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -54,7 +54,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: status = check_update_attached_alerts_task_params_status(d.pop("status")) _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, UpdateAttachedAlertsTaskParamsTaskType] + task_type: Unset | UpdateAttachedAlertsTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/update_authorization_data_attributes.py b/rootly_sdk/models/update_authorization_data_attributes.py index c1f8c304..e0ed42b6 100644 --- a/rootly_sdk/models/update_authorization_data_attributes.py +++ b/rootly_sdk/models/update_authorization_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define @@ -19,10 +19,10 @@ class UpdateAuthorizationDataAttributes: permissions (Union[Unset, list[UpdateAuthorizationDataAttributesPermissionsItem]]): """ - permissions: Union[Unset, list[UpdateAuthorizationDataAttributesPermissionsItem]] = UNSET + permissions: Unset | list[UpdateAuthorizationDataAttributesPermissionsItem] = UNSET def to_dict(self) -> dict[str, Any]: - permissions: Union[Unset, list[str]] = UNSET + permissions: Unset | list[str] = UNSET if not isinstance(self.permissions, Unset): permissions = [] for permissions_item_data in self.permissions: diff --git a/rootly_sdk/models/update_catalog_checklist_template_data_attributes.py b/rootly_sdk/models/update_catalog_checklist_template_data_attributes.py index bbb0af15..36041da9 100644 --- a/rootly_sdk/models/update_catalog_checklist_template_data_attributes.py +++ b/rootly_sdk/models/update_catalog_checklist_template_data_attributes.py @@ -35,27 +35,27 @@ class UpdateCatalogChecklistTemplateDataAttributes: owners. Replaces all existing owners. """ - slug: Union[None, Unset, str] = UNSET - name: Union[Unset, str] = UNSET - description: Union[None, Unset, str] = UNSET - fields: Union[ - None, - Unset, - list[ + slug: None | Unset | str = UNSET + name: Unset | str = UNSET + description: None | Unset | str = UNSET + fields: ( + None + | Unset + | list[ Union[ "UpdateCatalogChecklistTemplateDataAttributesBuiltinField", "UpdateCatalogChecklistTemplateDataAttributesCustomField", ] - ], - ] = UNSET - owners: Union[None, Unset, list["UpdateCatalogChecklistTemplateDataAttributesOwnersType0Item"]] = UNSET + ] + ) = UNSET + owners: None | Unset | list["UpdateCatalogChecklistTemplateDataAttributesOwnersType0Item"] = UNSET def to_dict(self) -> dict[str, Any]: from ..models.update_catalog_checklist_template_data_attributes_builtin_field import ( UpdateCatalogChecklistTemplateDataAttributesBuiltinField, ) - slug: Union[None, Unset, str] + slug: None | Unset | str if isinstance(self.slug, Unset): slug = UNSET else: @@ -63,13 +63,13 @@ def to_dict(self) -> dict[str, Any]: name = self.name - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - fields: Union[None, Unset, list[dict[str, Any]]] + fields: None | Unset | list[dict[str, Any]] if isinstance(self.fields, Unset): fields = UNSET elif isinstance(self.fields, list): @@ -86,7 +86,7 @@ def to_dict(self) -> dict[str, Any]: else: fields = self.fields - owners: Union[None, Unset, list[dict[str, Any]]] + owners: None | Unset | list[dict[str, Any]] if isinstance(self.owners, Unset): owners = UNSET elif isinstance(self.owners, list): @@ -128,38 +128,38 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_slug(data: object) -> Union[None, Unset, str]: + def _parse_slug(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) slug = _parse_slug(d.pop("slug", UNSET)) name = d.pop("name", UNSET) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) def _parse_fields( data: object, - ) -> Union[ - None, - Unset, - list[ + ) -> ( + None + | Unset + | list[ Union[ "UpdateCatalogChecklistTemplateDataAttributesBuiltinField", "UpdateCatalogChecklistTemplateDataAttributesCustomField", ] - ], - ]: + ] + ): if data is None: return data if isinstance(data, Unset): @@ -203,15 +203,13 @@ def _parse_fields_type_0_item( except: # noqa: E722 pass return cast( - Union[ - None, - Unset, - list[ - Union[ - "UpdateCatalogChecklistTemplateDataAttributesBuiltinField", - "UpdateCatalogChecklistTemplateDataAttributesCustomField", - ] - ], + None + | Unset + | list[ + Union[ + "UpdateCatalogChecklistTemplateDataAttributesBuiltinField", + "UpdateCatalogChecklistTemplateDataAttributesCustomField", + ] ], data, ) @@ -220,7 +218,7 @@ def _parse_fields_type_0_item( def _parse_owners( data: object, - ) -> Union[None, Unset, list["UpdateCatalogChecklistTemplateDataAttributesOwnersType0Item"]]: + ) -> None | Unset | list["UpdateCatalogChecklistTemplateDataAttributesOwnersType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -240,7 +238,7 @@ def _parse_owners( return owners_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list["UpdateCatalogChecklistTemplateDataAttributesOwnersType0Item"]], data) + return cast(None | Unset | list["UpdateCatalogChecklistTemplateDataAttributesOwnersType0Item"], data) owners = _parse_owners(d.pop("owners", UNSET)) diff --git a/rootly_sdk/models/update_catalog_checklist_template_data_attributes_custom_field.py b/rootly_sdk/models/update_catalog_checklist_template_data_attributes_custom_field.py index 20cc0e59..9ff528c0 100644 --- a/rootly_sdk/models/update_catalog_checklist_template_data_attributes_custom_field.py +++ b/rootly_sdk/models/update_catalog_checklist_template_data_attributes_custom_field.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -24,7 +24,7 @@ class UpdateCatalogChecklistTemplateDataAttributesCustomField: field_source: UpdateCatalogChecklistTemplateDataAttributesCustomFieldFieldSource catalog_property_id: str - field_key: Union[Unset, str] = UNSET + field_key: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_catalog_data_attributes.py b/rootly_sdk/models/update_catalog_data_attributes.py index 5b28ba36..35787e3d 100644 --- a/rootly_sdk/models/update_catalog_data_attributes.py +++ b/rootly_sdk/models/update_catalog_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -25,15 +25,15 @@ class UpdateCatalogDataAttributes: external_id (Union[None, Unset, str]): An external identifier for this catalog. Must be unique within the team. """ - slug: Union[None, Unset, str] = UNSET - name: Union[Unset, str] = UNSET - description: Union[None, Unset, str] = UNSET - icon: Union[Unset, UpdateCatalogDataAttributesIcon] = UNSET - position: Union[None, Unset, int] = UNSET - external_id: Union[None, Unset, str] = UNSET + slug: None | Unset | str = UNSET + name: Unset | str = UNSET + description: None | Unset | str = UNSET + icon: Unset | UpdateCatalogDataAttributesIcon = UNSET + position: None | Unset | int = UNSET + external_id: None | Unset | str = UNSET def to_dict(self) -> dict[str, Any]: - slug: Union[None, Unset, str] + slug: None | Unset | str if isinstance(self.slug, Unset): slug = UNSET else: @@ -41,23 +41,23 @@ def to_dict(self) -> dict[str, Any]: name = self.name - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - icon: Union[Unset, str] = UNSET + icon: Unset | str = UNSET if not isinstance(self.icon, Unset): icon = self.icon - position: Union[None, Unset, int] + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: position = self.position - external_id: Union[None, Unset, str] + external_id: None | Unset | str if isinstance(self.external_id, Unset): external_id = UNSET else: @@ -85,48 +85,48 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_slug(data: object) -> Union[None, Unset, str]: + def _parse_slug(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) slug = _parse_slug(d.pop("slug", UNSET)) name = d.pop("name", UNSET) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) _icon = d.pop("icon", UNSET) - icon: Union[Unset, UpdateCatalogDataAttributesIcon] + icon: Unset | UpdateCatalogDataAttributesIcon if isinstance(_icon, Unset): icon = UNSET else: icon = check_update_catalog_data_attributes_icon(_icon) - def _parse_position(data: object) -> Union[None, Unset, int]: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) - def _parse_external_id(data: object) -> Union[None, Unset, str]: + def _parse_external_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) external_id = _parse_external_id(d.pop("external_id", UNSET)) diff --git a/rootly_sdk/models/update_catalog_entity_data_attributes.py b/rootly_sdk/models/update_catalog_entity_data_attributes.py index 5e302ad0..f4039184 100644 --- a/rootly_sdk/models/update_catalog_entity_data_attributes.py +++ b/rootly_sdk/models/update_catalog_entity_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define @@ -31,17 +31,17 @@ class UpdateCatalogEntityDataAttributes: this catalog entity """ - slug: Union[None, Unset, str] = UNSET - name: Union[Unset, str] = UNSET - description: Union[None, Unset, str] = UNSET - public_description: Union[None, Unset, str] = UNSET - position: Union[None, Unset, int] = UNSET - backstage_id: Union[None, Unset, str] = UNSET - external_id: Union[None, Unset, str] = UNSET - properties: Union[Unset, list["UpdateCatalogEntityDataAttributesPropertiesItem"]] = UNSET + slug: None | Unset | str = UNSET + name: Unset | str = UNSET + description: None | Unset | str = UNSET + public_description: None | Unset | str = UNSET + position: None | Unset | int = UNSET + backstage_id: None | Unset | str = UNSET + external_id: None | Unset | str = UNSET + properties: Unset | list["UpdateCatalogEntityDataAttributesPropertiesItem"] = UNSET def to_dict(self) -> dict[str, Any]: - slug: Union[None, Unset, str] + slug: None | Unset | str if isinstance(self.slug, Unset): slug = UNSET else: @@ -49,37 +49,37 @@ def to_dict(self) -> dict[str, Any]: name = self.name - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - public_description: Union[None, Unset, str] + public_description: None | Unset | str if isinstance(self.public_description, Unset): public_description = UNSET else: public_description = self.public_description - position: Union[None, Unset, int] + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: position = self.position - backstage_id: Union[None, Unset, str] + backstage_id: None | Unset | str if isinstance(self.backstage_id, Unset): backstage_id = UNSET else: backstage_id = self.backstage_id - external_id: Union[None, Unset, str] + external_id: None | Unset | str if isinstance(self.external_id, Unset): external_id = UNSET else: external_id = self.external_id - properties: Union[Unset, list[dict[str, Any]]] = UNSET + properties: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.properties, Unset): properties = [] for properties_item_data in self.properties: @@ -116,59 +116,59 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_slug(data: object) -> Union[None, Unset, str]: + def _parse_slug(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) slug = _parse_slug(d.pop("slug", UNSET)) name = d.pop("name", UNSET) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_public_description(data: object) -> Union[None, Unset, str]: + def _parse_public_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) public_description = _parse_public_description(d.pop("public_description", UNSET)) - def _parse_position(data: object) -> Union[None, Unset, int]: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) - def _parse_backstage_id(data: object) -> Union[None, Unset, str]: + def _parse_backstage_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) backstage_id = _parse_backstage_id(d.pop("backstage_id", UNSET)) - def _parse_external_id(data: object) -> Union[None, Unset, str]: + def _parse_external_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) external_id = _parse_external_id(d.pop("external_id", UNSET)) diff --git a/rootly_sdk/models/update_catalog_entity_property_data_attributes.py b/rootly_sdk/models/update_catalog_entity_property_data_attributes.py index 25f2e03b..82f8b56c 100644 --- a/rootly_sdk/models/update_catalog_entity_property_data_attributes.py +++ b/rootly_sdk/models/update_catalog_entity_property_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define @@ -20,11 +20,11 @@ class UpdateCatalogEntityPropertyDataAttributes: value (Union[Unset, str]): """ - key: Union[Unset, UpdateCatalogEntityPropertyDataAttributesKey] = UNSET - value: Union[Unset, str] = UNSET + key: Unset | UpdateCatalogEntityPropertyDataAttributesKey = UNSET + value: Unset | str = UNSET def to_dict(self) -> dict[str, Any]: - key: Union[Unset, str] = UNSET + key: Unset | str = UNSET if not isinstance(self.key, Unset): key = self.key @@ -44,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _key = d.pop("key", UNSET) - key: Union[Unset, UpdateCatalogEntityPropertyDataAttributesKey] + key: Unset | UpdateCatalogEntityPropertyDataAttributesKey if isinstance(_key, Unset): key = UNSET else: diff --git a/rootly_sdk/models/update_catalog_field_data_attributes.py b/rootly_sdk/models/update_catalog_field_data_attributes.py index 33b11e7d..3783689b 100644 --- a/rootly_sdk/models/update_catalog_field_data_attributes.py +++ b/rootly_sdk/models/update_catalog_field_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -33,17 +33,17 @@ class UpdateCatalogFieldDataAttributes: scope. """ - slug: Union[None, Unset, str] = UNSET - name: Union[Unset, str] = UNSET - kind: Union[Unset, UpdateCatalogFieldDataAttributesKind] = UNSET - kind_catalog_id: Union[None, Unset, str] = UNSET - position: Union[None, Unset, int] = UNSET - required: Union[Unset, bool] = UNSET - catalog_type: Union[Unset, UpdateCatalogFieldDataAttributesCatalogType] = UNSET - external_id: Union[None, Unset, str] = UNSET + slug: None | Unset | str = UNSET + name: Unset | str = UNSET + kind: Unset | UpdateCatalogFieldDataAttributesKind = UNSET + kind_catalog_id: None | Unset | str = UNSET + position: None | Unset | int = UNSET + required: Unset | bool = UNSET + catalog_type: Unset | UpdateCatalogFieldDataAttributesCatalogType = UNSET + external_id: None | Unset | str = UNSET def to_dict(self) -> dict[str, Any]: - slug: Union[None, Unset, str] + slug: None | Unset | str if isinstance(self.slug, Unset): slug = UNSET else: @@ -51,17 +51,17 @@ def to_dict(self) -> dict[str, Any]: name = self.name - kind: Union[Unset, str] = UNSET + kind: Unset | str = UNSET if not isinstance(self.kind, Unset): kind = self.kind - kind_catalog_id: Union[None, Unset, str] + kind_catalog_id: None | Unset | str if isinstance(self.kind_catalog_id, Unset): kind_catalog_id = UNSET else: kind_catalog_id = self.kind_catalog_id - position: Union[None, Unset, int] + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: @@ -69,11 +69,11 @@ def to_dict(self) -> dict[str, Any]: required = self.required - catalog_type: Union[Unset, str] = UNSET + catalog_type: Unset | str = UNSET if not isinstance(self.catalog_type, Unset): catalog_type = self.catalog_type - external_id: Union[None, Unset, str] + external_id: None | Unset | str if isinstance(self.external_id, Unset): external_id = UNSET else: @@ -105,57 +105,57 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_slug(data: object) -> Union[None, Unset, str]: + def _parse_slug(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) slug = _parse_slug(d.pop("slug", UNSET)) name = d.pop("name", UNSET) _kind = d.pop("kind", UNSET) - kind: Union[Unset, UpdateCatalogFieldDataAttributesKind] + kind: Unset | UpdateCatalogFieldDataAttributesKind if isinstance(_kind, Unset): kind = UNSET else: kind = check_update_catalog_field_data_attributes_kind(_kind) - def _parse_kind_catalog_id(data: object) -> Union[None, Unset, str]: + def _parse_kind_catalog_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) kind_catalog_id = _parse_kind_catalog_id(d.pop("kind_catalog_id", UNSET)) - def _parse_position(data: object) -> Union[None, Unset, int]: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) required = d.pop("required", UNSET) _catalog_type = d.pop("catalog_type", UNSET) - catalog_type: Union[Unset, UpdateCatalogFieldDataAttributesCatalogType] + catalog_type: Unset | UpdateCatalogFieldDataAttributesCatalogType if isinstance(_catalog_type, Unset): catalog_type = UNSET else: catalog_type = check_update_catalog_field_data_attributes_catalog_type(_catalog_type) - def _parse_external_id(data: object) -> Union[None, Unset, str]: + def _parse_external_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) external_id = _parse_external_id(d.pop("external_id", UNSET)) diff --git a/rootly_sdk/models/update_catalog_property_data_attributes.py b/rootly_sdk/models/update_catalog_property_data_attributes.py index fca776fe..c6dd568b 100644 --- a/rootly_sdk/models/update_catalog_property_data_attributes.py +++ b/rootly_sdk/models/update_catalog_property_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -33,17 +33,17 @@ class UpdateCatalogPropertyDataAttributes: the scope. """ - slug: Union[None, Unset, str] = UNSET - name: Union[Unset, str] = UNSET - kind: Union[Unset, UpdateCatalogPropertyDataAttributesKind] = UNSET - kind_catalog_id: Union[None, Unset, str] = UNSET - position: Union[None, Unset, int] = UNSET - required: Union[Unset, bool] = UNSET - catalog_type: Union[Unset, UpdateCatalogPropertyDataAttributesCatalogType] = UNSET - external_id: Union[None, Unset, str] = UNSET + slug: None | Unset | str = UNSET + name: Unset | str = UNSET + kind: Unset | UpdateCatalogPropertyDataAttributesKind = UNSET + kind_catalog_id: None | Unset | str = UNSET + position: None | Unset | int = UNSET + required: Unset | bool = UNSET + catalog_type: Unset | UpdateCatalogPropertyDataAttributesCatalogType = UNSET + external_id: None | Unset | str = UNSET def to_dict(self) -> dict[str, Any]: - slug: Union[None, Unset, str] + slug: None | Unset | str if isinstance(self.slug, Unset): slug = UNSET else: @@ -51,17 +51,17 @@ def to_dict(self) -> dict[str, Any]: name = self.name - kind: Union[Unset, str] = UNSET + kind: Unset | str = UNSET if not isinstance(self.kind, Unset): kind = self.kind - kind_catalog_id: Union[None, Unset, str] + kind_catalog_id: None | Unset | str if isinstance(self.kind_catalog_id, Unset): kind_catalog_id = UNSET else: kind_catalog_id = self.kind_catalog_id - position: Union[None, Unset, int] + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: @@ -69,11 +69,11 @@ def to_dict(self) -> dict[str, Any]: required = self.required - catalog_type: Union[Unset, str] = UNSET + catalog_type: Unset | str = UNSET if not isinstance(self.catalog_type, Unset): catalog_type = self.catalog_type - external_id: Union[None, Unset, str] + external_id: None | Unset | str if isinstance(self.external_id, Unset): external_id = UNSET else: @@ -105,57 +105,57 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_slug(data: object) -> Union[None, Unset, str]: + def _parse_slug(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) slug = _parse_slug(d.pop("slug", UNSET)) name = d.pop("name", UNSET) _kind = d.pop("kind", UNSET) - kind: Union[Unset, UpdateCatalogPropertyDataAttributesKind] + kind: Unset | UpdateCatalogPropertyDataAttributesKind if isinstance(_kind, Unset): kind = UNSET else: kind = check_update_catalog_property_data_attributes_kind(_kind) - def _parse_kind_catalog_id(data: object) -> Union[None, Unset, str]: + def _parse_kind_catalog_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) kind_catalog_id = _parse_kind_catalog_id(d.pop("kind_catalog_id", UNSET)) - def _parse_position(data: object) -> Union[None, Unset, int]: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) required = d.pop("required", UNSET) _catalog_type = d.pop("catalog_type", UNSET) - catalog_type: Union[Unset, UpdateCatalogPropertyDataAttributesCatalogType] + catalog_type: Unset | UpdateCatalogPropertyDataAttributesCatalogType if isinstance(_catalog_type, Unset): catalog_type = UNSET else: catalog_type = check_update_catalog_property_data_attributes_catalog_type(_catalog_type) - def _parse_external_id(data: object) -> Union[None, Unset, str]: + def _parse_external_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) external_id = _parse_external_id(d.pop("external_id", UNSET)) diff --git a/rootly_sdk/models/update_cause_data_attributes.py b/rootly_sdk/models/update_cause_data_attributes.py index 5ce86a0a..04ac0a70 100644 --- a/rootly_sdk/models/update_cause_data_attributes.py +++ b/rootly_sdk/models/update_cause_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define @@ -26,15 +26,15 @@ class UpdateCauseDataAttributes: cause. """ - slug: Union[None, Unset, str] = UNSET - name: Union[Unset, str] = UNSET - description: Union[None, Unset, str] = UNSET - public_description: Union[None, Unset, str] = UNSET - position: Union[None, Unset, int] = UNSET - properties: Union[Unset, list["UpdateCauseDataAttributesPropertiesItem"]] = UNSET + slug: None | Unset | str = UNSET + name: Unset | str = UNSET + description: None | Unset | str = UNSET + public_description: None | Unset | str = UNSET + position: None | Unset | int = UNSET + properties: Unset | list["UpdateCauseDataAttributesPropertiesItem"] = UNSET def to_dict(self) -> dict[str, Any]: - slug: Union[None, Unset, str] + slug: None | Unset | str if isinstance(self.slug, Unset): slug = UNSET else: @@ -42,25 +42,25 @@ def to_dict(self) -> dict[str, Any]: name = self.name - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - public_description: Union[None, Unset, str] + public_description: None | Unset | str if isinstance(self.public_description, Unset): public_description = UNSET else: public_description = self.public_description - position: Union[None, Unset, int] + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: position = self.position - properties: Union[Unset, list[dict[str, Any]]] = UNSET + properties: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.properties, Unset): properties = [] for properties_item_data in self.properties: @@ -91,41 +91,41 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_slug(data: object) -> Union[None, Unset, str]: + def _parse_slug(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) slug = _parse_slug(d.pop("slug", UNSET)) name = d.pop("name", UNSET) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_public_description(data: object) -> Union[None, Unset, str]: + def _parse_public_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) public_description = _parse_public_description(d.pop("public_description", UNSET)) - def _parse_position(data: object) -> Union[None, Unset, int]: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) diff --git a/rootly_sdk/models/update_clickup_task_task_params.py b/rootly_sdk/models/update_clickup_task_task_params.py index c0da612d..a1a7d6a6 100644 --- a/rootly_sdk/models/update_clickup_task_task_params.py +++ b/rootly_sdk/models/update_clickup_task_task_params.py @@ -35,20 +35,20 @@ class UpdateClickupTaskTaskParams: """ task_id: str - task_type: Union[Unset, UpdateClickupTaskTaskParamsTaskType] = UNSET - title: Union[Unset, str] = UNSET - description: Union[Unset, str] = UNSET - tags: Union[Unset, str] = UNSET + task_type: Unset | UpdateClickupTaskTaskParamsTaskType = UNSET + title: Unset | str = UNSET + description: Unset | str = UNSET + tags: Unset | str = UNSET priority: Union[Unset, "UpdateClickupTaskTaskParamsPriority"] = UNSET - due_date: Union[Unset, str] = UNSET - custom_fields_mapping: Union[None, Unset, str] = UNSET - task_payload: Union[None, Unset, str] = UNSET + due_date: Unset | str = UNSET + custom_fields_mapping: None | Unset | str = UNSET + task_payload: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: task_id = self.task_id - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -58,19 +58,19 @@ def to_dict(self) -> dict[str, Any]: tags = self.tags - priority: Union[Unset, dict[str, Any]] = UNSET + priority: Unset | dict[str, Any] = UNSET if not isinstance(self.priority, Unset): priority = self.priority.to_dict() due_date = self.due_date - custom_fields_mapping: Union[None, Unset, str] + custom_fields_mapping: None | Unset | str if isinstance(self.custom_fields_mapping, Unset): custom_fields_mapping = UNSET else: custom_fields_mapping = self.custom_fields_mapping - task_payload: Union[None, Unset, str] + task_payload: None | Unset | str if isinstance(self.task_payload, Unset): task_payload = UNSET else: @@ -110,7 +110,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: task_id = d.pop("task_id") _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, UpdateClickupTaskTaskParamsTaskType] + task_type: Unset | UpdateClickupTaskTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: @@ -123,7 +123,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: tags = d.pop("tags", UNSET) _priority = d.pop("priority", UNSET) - priority: Union[Unset, UpdateClickupTaskTaskParamsPriority] + priority: Unset | UpdateClickupTaskTaskParamsPriority if isinstance(_priority, Unset): priority = UNSET else: @@ -131,21 +131,21 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: due_date = d.pop("due_date", UNSET) - def _parse_custom_fields_mapping(data: object) -> Union[None, Unset, str]: + def _parse_custom_fields_mapping(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) custom_fields_mapping = _parse_custom_fields_mapping(d.pop("custom_fields_mapping", UNSET)) - def _parse_task_payload(data: object) -> Union[None, Unset, str]: + def _parse_task_payload(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) task_payload = _parse_task_payload(d.pop("task_payload", UNSET)) diff --git a/rootly_sdk/models/update_clickup_task_task_params_priority.py b/rootly_sdk/models/update_clickup_task_task_params_priority.py index 5e453aac..eb3024d0 100644 --- a/rootly_sdk/models/update_clickup_task_task_params_priority.py +++ b/rootly_sdk/models/update_clickup_task_task_params_priority.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -18,8 +18,8 @@ class UpdateClickupTaskTaskParamsPriority: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_coda_page_task_params.py b/rootly_sdk/models/update_coda_page_task_params.py index 33ea3732..f36a0719 100644 --- a/rootly_sdk/models/update_coda_page_task_params.py +++ b/rootly_sdk/models/update_coda_page_task_params.py @@ -31,18 +31,18 @@ class UpdateCodaPageTaskParams: """ page_id: str - task_type: Union[Unset, UpdateCodaPageTaskParamsTaskType] = UNSET - doc_id: Union[Unset, str] = UNSET - title: Union[Unset, str] = UNSET - subtitle: Union[Unset, str] = UNSET - content: Union[Unset, str] = UNSET + task_type: Unset | UpdateCodaPageTaskParamsTaskType = UNSET + doc_id: Unset | str = UNSET + title: Unset | str = UNSET + subtitle: Unset | str = UNSET + content: Unset | str = UNSET template: Union[Unset, "UpdateCodaPageTaskParamsTemplate"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: page_id = self.page_id - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -54,7 +54,7 @@ def to_dict(self) -> dict[str, Any]: content = self.content - template: Union[Unset, dict[str, Any]] = UNSET + template: Unset | dict[str, Any] = UNSET if not isinstance(self.template, Unset): template = self.template.to_dict() @@ -88,7 +88,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: page_id = d.pop("page_id") _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, UpdateCodaPageTaskParamsTaskType] + task_type: Unset | UpdateCodaPageTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: @@ -103,7 +103,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: content = d.pop("content", UNSET) _template = d.pop("template", UNSET) - template: Union[Unset, UpdateCodaPageTaskParamsTemplate] + template: Unset | UpdateCodaPageTaskParamsTemplate if isinstance(_template, Unset): template = UNSET else: diff --git a/rootly_sdk/models/update_coda_page_task_params_template.py b/rootly_sdk/models/update_coda_page_task_params_template.py index c7f8c73a..267641e6 100644 --- a/rootly_sdk/models/update_coda_page_task_params_template.py +++ b/rootly_sdk/models/update_coda_page_task_params_template.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class UpdateCodaPageTaskParamsTemplate: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_communications_group_data_attributes.py b/rootly_sdk/models/update_communications_group_data_attributes.py index 7ba2875a..65184abe 100644 --- a/rootly_sdk/models/update_communications_group_data_attributes.py +++ b/rootly_sdk/models/update_communications_group_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define @@ -42,26 +42,26 @@ class UpdateCommunicationsGroupDataAttributes: members attributes """ - name: Union[Unset, str] = UNSET - description: Union[None, Unset, str] = UNSET - communication_type_id: Union[Unset, str] = UNSET - is_private: Union[None, Unset, bool] = UNSET - condition_type: Union[Unset, UpdateCommunicationsGroupDataAttributesConditionType] = UNSET - sms_channel: Union[None, Unset, bool] = UNSET - email_channel: Union[None, Unset, bool] = UNSET - member_ids: Union[None, Unset, list[int]] = UNSET - slack_channel_ids: Union[None, Unset, list[str]] = UNSET - communication_group_conditions: Union[ - None, Unset, list["UpdateCommunicationsGroupDataAttributesCommunicationGroupConditionsType0Item"] - ] = UNSET - communication_external_group_members: Union[ - None, Unset, list["UpdateCommunicationsGroupDataAttributesCommunicationExternalGroupMembersType0Item"] - ] = UNSET + name: Unset | str = UNSET + description: None | Unset | str = UNSET + communication_type_id: Unset | str = UNSET + is_private: None | Unset | bool = UNSET + condition_type: Unset | UpdateCommunicationsGroupDataAttributesConditionType = UNSET + sms_channel: None | Unset | bool = UNSET + email_channel: None | Unset | bool = UNSET + member_ids: None | Unset | list[int] = UNSET + slack_channel_ids: None | Unset | list[str] = UNSET + communication_group_conditions: ( + None | Unset | list["UpdateCommunicationsGroupDataAttributesCommunicationGroupConditionsType0Item"] + ) = UNSET + communication_external_group_members: ( + None | Unset | list["UpdateCommunicationsGroupDataAttributesCommunicationExternalGroupMembersType0Item"] + ) = UNSET def to_dict(self) -> dict[str, Any]: name = self.name - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: @@ -69,29 +69,29 @@ def to_dict(self) -> dict[str, Any]: communication_type_id = self.communication_type_id - is_private: Union[None, Unset, bool] + is_private: None | Unset | bool if isinstance(self.is_private, Unset): is_private = UNSET else: is_private = self.is_private - condition_type: Union[Unset, str] = UNSET + condition_type: Unset | str = UNSET if not isinstance(self.condition_type, Unset): condition_type = self.condition_type - sms_channel: Union[None, Unset, bool] + sms_channel: None | Unset | bool if isinstance(self.sms_channel, Unset): sms_channel = UNSET else: sms_channel = self.sms_channel - email_channel: Union[None, Unset, bool] + email_channel: None | Unset | bool if isinstance(self.email_channel, Unset): email_channel = UNSET else: email_channel = self.email_channel - member_ids: Union[None, Unset, list[int]] + member_ids: None | Unset | list[int] if isinstance(self.member_ids, Unset): member_ids = UNSET elif isinstance(self.member_ids, list): @@ -100,7 +100,7 @@ def to_dict(self) -> dict[str, Any]: else: member_ids = self.member_ids - slack_channel_ids: Union[None, Unset, list[str]] + slack_channel_ids: None | Unset | list[str] if isinstance(self.slack_channel_ids, Unset): slack_channel_ids = UNSET elif isinstance(self.slack_channel_ids, list): @@ -109,7 +109,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_channel_ids = self.slack_channel_ids - communication_group_conditions: Union[None, Unset, list[dict[str, Any]]] + communication_group_conditions: None | Unset | list[dict[str, Any]] if isinstance(self.communication_group_conditions, Unset): communication_group_conditions = UNSET elif isinstance(self.communication_group_conditions, list): @@ -121,7 +121,7 @@ def to_dict(self) -> dict[str, Any]: else: communication_group_conditions = self.communication_group_conditions - communication_external_group_members: Union[None, Unset, list[dict[str, Any]]] + communication_external_group_members: None | Unset | list[dict[str, Any]] if isinstance(self.communication_external_group_members, Unset): communication_external_group_members = UNSET elif isinstance(self.communication_external_group_members, list): @@ -175,52 +175,52 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name", UNSET) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) communication_type_id = d.pop("communication_type_id", UNSET) - def _parse_is_private(data: object) -> Union[None, Unset, bool]: + def _parse_is_private(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) is_private = _parse_is_private(d.pop("is_private", UNSET)) _condition_type = d.pop("condition_type", UNSET) - condition_type: Union[Unset, UpdateCommunicationsGroupDataAttributesConditionType] + condition_type: Unset | UpdateCommunicationsGroupDataAttributesConditionType if isinstance(_condition_type, Unset): condition_type = UNSET else: condition_type = check_update_communications_group_data_attributes_condition_type(_condition_type) - def _parse_sms_channel(data: object) -> Union[None, Unset, bool]: + def _parse_sms_channel(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) sms_channel = _parse_sms_channel(d.pop("sms_channel", UNSET)) - def _parse_email_channel(data: object) -> Union[None, Unset, bool]: + def _parse_email_channel(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) email_channel = _parse_email_channel(d.pop("email_channel", UNSET)) - def _parse_member_ids(data: object) -> Union[None, Unset, list[int]]: + def _parse_member_ids(data: object) -> None | Unset | list[int]: if data is None: return data if isinstance(data, Unset): @@ -233,11 +233,11 @@ def _parse_member_ids(data: object) -> Union[None, Unset, list[int]]: return member_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[int]], data) + return cast(None | Unset | list[int], data) member_ids = _parse_member_ids(d.pop("member_ids", UNSET)) - def _parse_slack_channel_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_slack_channel_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -250,13 +250,13 @@ def _parse_slack_channel_ids(data: object) -> Union[None, Unset, list[str]]: return slack_channel_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) slack_channel_ids = _parse_slack_channel_ids(d.pop("slack_channel_ids", UNSET)) def _parse_communication_group_conditions( data: object, - ) -> Union[None, Unset, list["UpdateCommunicationsGroupDataAttributesCommunicationGroupConditionsType0Item"]]: + ) -> None | Unset | list["UpdateCommunicationsGroupDataAttributesCommunicationGroupConditionsType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -279,9 +279,7 @@ def _parse_communication_group_conditions( except: # noqa: E722 pass return cast( - Union[ - None, Unset, list["UpdateCommunicationsGroupDataAttributesCommunicationGroupConditionsType0Item"] - ], + None | Unset | list["UpdateCommunicationsGroupDataAttributesCommunicationGroupConditionsType0Item"], data, ) @@ -291,9 +289,7 @@ def _parse_communication_group_conditions( def _parse_communication_external_group_members( data: object, - ) -> Union[ - None, Unset, list["UpdateCommunicationsGroupDataAttributesCommunicationExternalGroupMembersType0Item"] - ]: + ) -> None | Unset | list["UpdateCommunicationsGroupDataAttributesCommunicationExternalGroupMembersType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -318,11 +314,9 @@ def _parse_communication_external_group_members( except: # noqa: E722 pass return cast( - Union[ - None, - Unset, - list["UpdateCommunicationsGroupDataAttributesCommunicationExternalGroupMembersType0Item"], - ], + None + | Unset + | list["UpdateCommunicationsGroupDataAttributesCommunicationExternalGroupMembersType0Item"], data, ) diff --git a/rootly_sdk/models/update_communications_group_data_attributes_communication_external_group_members_type_0_item.py b/rootly_sdk/models/update_communications_group_data_attributes_communication_external_group_members_type_0_item.py index afd96522..8634430c 100644 --- a/rootly_sdk/models/update_communications_group_data_attributes_communication_external_group_members_type_0_item.py +++ b/rootly_sdk/models/update_communications_group_data_attributes_communication_external_group_members_type_0_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,14 +19,14 @@ class UpdateCommunicationsGroupDataAttributesCommunicationExternalGroupMembersTy phone_number (Union[Unset, str]): Phone number of the external member """ - id: Union[None, Unset, str] = UNSET - name: Union[Unset, str] = UNSET - email: Union[Unset, str] = UNSET - phone_number: Union[Unset, str] = UNSET + id: None | Unset | str = UNSET + name: Unset | str = UNSET + email: Unset | str = UNSET + phone_number: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id: Union[None, Unset, str] + id: None | Unset | str if isinstance(self.id, Unset): id = UNSET else: @@ -56,12 +56,12 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_id(data: object) -> Union[None, Unset, str]: + def _parse_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) id = _parse_id(d.pop("id", UNSET)) diff --git a/rootly_sdk/models/update_communications_group_data_attributes_communication_group_conditions_type_0_item.py b/rootly_sdk/models/update_communications_group_data_attributes_communication_group_conditions_type_0_item.py index 12e43e41..8de71c14 100644 --- a/rootly_sdk/models/update_communications_group_data_attributes_communication_group_conditions_type_0_item.py +++ b/rootly_sdk/models/update_communications_group_data_attributes_communication_group_conditions_type_0_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -27,29 +27,29 @@ class UpdateCommunicationsGroupDataAttributesCommunicationGroupConditionsType0It incident_type_ids (Union[None, Unset, list[str]]): Array of incident type IDs """ - id: Union[None, Unset, str] = UNSET - property_type: Union[ - Unset, UpdateCommunicationsGroupDataAttributesCommunicationGroupConditionsType0ItemPropertyType - ] = UNSET - service_ids: Union[None, Unset, list[str]] = UNSET - severity_ids: Union[None, Unset, list[str]] = UNSET - functionality_ids: Union[None, Unset, list[str]] = UNSET - group_ids: Union[None, Unset, list[str]] = UNSET - incident_type_ids: Union[None, Unset, list[str]] = UNSET + id: None | Unset | str = UNSET + property_type: Unset | UpdateCommunicationsGroupDataAttributesCommunicationGroupConditionsType0ItemPropertyType = ( + UNSET + ) + service_ids: None | Unset | list[str] = UNSET + severity_ids: None | Unset | list[str] = UNSET + functionality_ids: None | Unset | list[str] = UNSET + group_ids: None | Unset | list[str] = UNSET + incident_type_ids: None | Unset | list[str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id: Union[None, Unset, str] + id: None | Unset | str if isinstance(self.id, Unset): id = UNSET else: id = self.id - property_type: Union[Unset, str] = UNSET + property_type: Unset | str = UNSET if not isinstance(self.property_type, Unset): property_type = self.property_type - service_ids: Union[None, Unset, list[str]] + service_ids: None | Unset | list[str] if isinstance(self.service_ids, Unset): service_ids = UNSET elif isinstance(self.service_ids, list): @@ -58,7 +58,7 @@ def to_dict(self) -> dict[str, Any]: else: service_ids = self.service_ids - severity_ids: Union[None, Unset, list[str]] + severity_ids: None | Unset | list[str] if isinstance(self.severity_ids, Unset): severity_ids = UNSET elif isinstance(self.severity_ids, list): @@ -67,7 +67,7 @@ def to_dict(self) -> dict[str, Any]: else: severity_ids = self.severity_ids - functionality_ids: Union[None, Unset, list[str]] + functionality_ids: None | Unset | list[str] if isinstance(self.functionality_ids, Unset): functionality_ids = UNSET elif isinstance(self.functionality_ids, list): @@ -76,7 +76,7 @@ def to_dict(self) -> dict[str, Any]: else: functionality_ids = self.functionality_ids - group_ids: Union[None, Unset, list[str]] + group_ids: None | Unset | list[str] if isinstance(self.group_ids, Unset): group_ids = UNSET elif isinstance(self.group_ids, list): @@ -85,7 +85,7 @@ def to_dict(self) -> dict[str, Any]: else: group_ids = self.group_ids - incident_type_ids: Union[None, Unset, list[str]] + incident_type_ids: None | Unset | list[str] if isinstance(self.incident_type_ids, Unset): incident_type_ids = UNSET elif isinstance(self.incident_type_ids, list): @@ -118,19 +118,17 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_id(data: object) -> Union[None, Unset, str]: + def _parse_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) id = _parse_id(d.pop("id", UNSET)) _property_type = d.pop("property_type", UNSET) - property_type: Union[ - Unset, UpdateCommunicationsGroupDataAttributesCommunicationGroupConditionsType0ItemPropertyType - ] + property_type: Unset | UpdateCommunicationsGroupDataAttributesCommunicationGroupConditionsType0ItemPropertyType if isinstance(_property_type, Unset): property_type = UNSET else: @@ -138,7 +136,7 @@ def _parse_id(data: object) -> Union[None, Unset, str]: _property_type ) - def _parse_service_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_service_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -151,11 +149,11 @@ def _parse_service_ids(data: object) -> Union[None, Unset, list[str]]: return service_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) service_ids = _parse_service_ids(d.pop("service_ids", UNSET)) - def _parse_severity_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_severity_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -168,11 +166,11 @@ def _parse_severity_ids(data: object) -> Union[None, Unset, list[str]]: return severity_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) severity_ids = _parse_severity_ids(d.pop("severity_ids", UNSET)) - def _parse_functionality_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_functionality_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -185,11 +183,11 @@ def _parse_functionality_ids(data: object) -> Union[None, Unset, list[str]]: return functionality_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) functionality_ids = _parse_functionality_ids(d.pop("functionality_ids", UNSET)) - def _parse_group_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_group_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -202,11 +200,11 @@ def _parse_group_ids(data: object) -> Union[None, Unset, list[str]]: return group_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) group_ids = _parse_group_ids(d.pop("group_ids", UNSET)) - def _parse_incident_type_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_incident_type_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -219,7 +217,7 @@ def _parse_incident_type_ids(data: object) -> Union[None, Unset, list[str]]: return incident_type_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) incident_type_ids = _parse_incident_type_ids(d.pop("incident_type_ids", UNSET)) diff --git a/rootly_sdk/models/update_communications_stage_data_attributes.py b/rootly_sdk/models/update_communications_stage_data_attributes.py index 92fc2017..2c399d85 100644 --- a/rootly_sdk/models/update_communications_stage_data_attributes.py +++ b/rootly_sdk/models/update_communications_stage_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -19,13 +19,13 @@ class UpdateCommunicationsStageDataAttributes: position (Union[None, Unset, int]): Position of the communications stage """ - slug: Union[None, Unset, str] = UNSET - name: Union[Unset, str] = UNSET - description: Union[None, Unset, str] = UNSET - position: Union[None, Unset, int] = UNSET + slug: None | Unset | str = UNSET + name: Unset | str = UNSET + description: None | Unset | str = UNSET + position: None | Unset | int = UNSET def to_dict(self) -> dict[str, Any]: - slug: Union[None, Unset, str] + slug: None | Unset | str if isinstance(self.slug, Unset): slug = UNSET else: @@ -33,13 +33,13 @@ def to_dict(self) -> dict[str, Any]: name = self.name - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - position: Union[None, Unset, int] + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: @@ -63,32 +63,32 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_slug(data: object) -> Union[None, Unset, str]: + def _parse_slug(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) slug = _parse_slug(d.pop("slug", UNSET)) name = d.pop("name", UNSET) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_position(data: object) -> Union[None, Unset, int]: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) diff --git a/rootly_sdk/models/update_communications_template_data_attributes.py b/rootly_sdk/models/update_communications_template_data_attributes.py index 4a8c5bb4..ceb94ac5 100644 --- a/rootly_sdk/models/update_communications_template_data_attributes.py +++ b/rootly_sdk/models/update_communications_template_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define @@ -27,18 +27,18 @@ class UpdateCommunicationsTemplateDataAttributes: stages attributes """ - name: Union[Unset, str] = UNSET - description: Union[None, Unset, str] = UNSET - communication_type_id: Union[Unset, str] = UNSET - position: Union[None, Unset, int] = UNSET - communication_template_stages_attributes: Union[ - None, Unset, list["UpdateCommunicationsTemplateDataAttributesCommunicationTemplateStagesAttributesType0Item"] - ] = UNSET + name: Unset | str = UNSET + description: None | Unset | str = UNSET + communication_type_id: Unset | str = UNSET + position: None | Unset | int = UNSET + communication_template_stages_attributes: ( + None | Unset | list["UpdateCommunicationsTemplateDataAttributesCommunicationTemplateStagesAttributesType0Item"] + ) = UNSET def to_dict(self) -> dict[str, Any]: name = self.name - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: @@ -46,13 +46,13 @@ def to_dict(self) -> dict[str, Any]: communication_type_id = self.communication_type_id - position: Union[None, Unset, int] + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: position = self.position - communication_template_stages_attributes: Union[None, Unset, list[dict[str, Any]]] + communication_template_stages_attributes: None | Unset | list[dict[str, Any]] if isinstance(self.communication_template_stages_attributes, Unset): communication_template_stages_attributes = UNSET elif isinstance(self.communication_template_stages_attributes, list): @@ -93,33 +93,33 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name", UNSET) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) communication_type_id = d.pop("communication_type_id", UNSET) - def _parse_position(data: object) -> Union[None, Unset, int]: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) def _parse_communication_template_stages_attributes( data: object, - ) -> Union[ - None, - Unset, - list["UpdateCommunicationsTemplateDataAttributesCommunicationTemplateStagesAttributesType0Item"], - ]: + ) -> ( + None + | Unset + | list["UpdateCommunicationsTemplateDataAttributesCommunicationTemplateStagesAttributesType0Item"] + ): if data is None: return data if isinstance(data, Unset): @@ -144,11 +144,9 @@ def _parse_communication_template_stages_attributes( except: # noqa: E722 pass return cast( - Union[ - None, - Unset, - list["UpdateCommunicationsTemplateDataAttributesCommunicationTemplateStagesAttributesType0Item"], - ], + None + | Unset + | list["UpdateCommunicationsTemplateDataAttributesCommunicationTemplateStagesAttributesType0Item"], data, ) diff --git a/rootly_sdk/models/update_communications_template_data_attributes_communication_template_stages_attributes_type_0_item.py b/rootly_sdk/models/update_communications_template_data_attributes_communication_template_stages_attributes_type_0_item.py index 1c8482c1..70e273b7 100644 --- a/rootly_sdk/models/update_communications_template_data_attributes_communication_template_stages_attributes_type_0_item.py +++ b/rootly_sdk/models/update_communications_template_data_attributes_communication_template_stages_attributes_type_0_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -20,39 +20,39 @@ class UpdateCommunicationsTemplateDataAttributesCommunicationTemplateStagesAttri slack_content (Union[None, Unset, str]): Slack content for the stage """ - id: Union[None, Unset, str] = UNSET - sms_content: Union[None, Unset, str] = UNSET - email_subject: Union[None, Unset, str] = UNSET - email_body: Union[None, Unset, str] = UNSET - slack_content: Union[None, Unset, str] = UNSET + id: None | Unset | str = UNSET + sms_content: None | Unset | str = UNSET + email_subject: None | Unset | str = UNSET + email_body: None | Unset | str = UNSET + slack_content: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id: Union[None, Unset, str] + id: None | Unset | str if isinstance(self.id, Unset): id = UNSET else: id = self.id - sms_content: Union[None, Unset, str] + sms_content: None | Unset | str if isinstance(self.sms_content, Unset): sms_content = UNSET else: sms_content = self.sms_content - email_subject: Union[None, Unset, str] + email_subject: None | Unset | str if isinstance(self.email_subject, Unset): email_subject = UNSET else: email_subject = self.email_subject - email_body: Union[None, Unset, str] + email_body: None | Unset | str if isinstance(self.email_body, Unset): email_body = UNSET else: email_body = self.email_body - slack_content: Union[None, Unset, str] + slack_content: None | Unset | str if isinstance(self.slack_content, Unset): slack_content = UNSET else: @@ -78,48 +78,48 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_id(data: object) -> Union[None, Unset, str]: + def _parse_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) id = _parse_id(d.pop("id", UNSET)) - def _parse_sms_content(data: object) -> Union[None, Unset, str]: + def _parse_sms_content(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) sms_content = _parse_sms_content(d.pop("sms_content", UNSET)) - def _parse_email_subject(data: object) -> Union[None, Unset, str]: + def _parse_email_subject(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) email_subject = _parse_email_subject(d.pop("email_subject", UNSET)) - def _parse_email_body(data: object) -> Union[None, Unset, str]: + def _parse_email_body(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) email_body = _parse_email_body(d.pop("email_body", UNSET)) - def _parse_slack_content(data: object) -> Union[None, Unset, str]: + def _parse_slack_content(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) slack_content = _parse_slack_content(d.pop("slack_content", UNSET)) diff --git a/rootly_sdk/models/update_communications_type_data_attributes.py b/rootly_sdk/models/update_communications_type_data_attributes.py index 15fbe5ff..dd596593 100644 --- a/rootly_sdk/models/update_communications_type_data_attributes.py +++ b/rootly_sdk/models/update_communications_type_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -20,14 +20,14 @@ class UpdateCommunicationsTypeDataAttributes: position (Union[None, Unset, int]): Position of the communications type """ - slug: Union[None, Unset, str] = UNSET - name: Union[Unset, str] = UNSET - description: Union[None, Unset, str] = UNSET - color: Union[None, Unset, str] = UNSET - position: Union[None, Unset, int] = UNSET + slug: None | Unset | str = UNSET + name: Unset | str = UNSET + description: None | Unset | str = UNSET + color: None | Unset | str = UNSET + position: None | Unset | int = UNSET def to_dict(self) -> dict[str, Any]: - slug: Union[None, Unset, str] + slug: None | Unset | str if isinstance(self.slug, Unset): slug = UNSET else: @@ -35,19 +35,19 @@ def to_dict(self) -> dict[str, Any]: name = self.name - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - color: Union[None, Unset, str] + color: None | Unset | str if isinstance(self.color, Unset): color = UNSET else: color = self.color - position: Union[None, Unset, int] + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: @@ -73,41 +73,41 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_slug(data: object) -> Union[None, Unset, str]: + def _parse_slug(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) slug = _parse_slug(d.pop("slug", UNSET)) name = d.pop("name", UNSET) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_color(data: object) -> Union[None, Unset, str]: + def _parse_color(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) color = _parse_color(d.pop("color", UNSET)) - def _parse_position(data: object) -> Union[None, Unset, int]: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) diff --git a/rootly_sdk/models/update_confluence_page_task_params.py b/rootly_sdk/models/update_confluence_page_task_params.py index cf93c06a..ce40e240 100644 --- a/rootly_sdk/models/update_confluence_page_task_params.py +++ b/rootly_sdk/models/update_confluence_page_task_params.py @@ -36,25 +36,25 @@ class UpdateConfluencePageTaskParams: """ file_id: str - task_type: Union[Unset, UpdateConfluencePageTaskParamsTaskType] = UNSET + task_type: Unset | UpdateConfluencePageTaskParamsTaskType = UNSET integration: Union[Unset, "UpdateConfluencePageTaskParamsIntegration"] = UNSET - title: Union[Unset, str] = UNSET - content: Union[Unset, str] = UNSET - post_mortem_template_id: Union[Unset, str] = UNSET + title: Unset | str = UNSET + content: Unset | str = UNSET + post_mortem_template_id: Unset | str = UNSET template: Union[Unset, "UpdateConfluencePageTaskParamsTemplate"] = UNSET - include_overview: Union[Unset, bool] = True - include_timeline: Union[Unset, bool] = True - include_follow_ups: Union[Unset, bool] = True + include_overview: Unset | bool = True + include_timeline: Unset | bool = True + include_follow_ups: Unset | bool = True additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: file_id = self.file_id - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - integration: Union[Unset, dict[str, Any]] = UNSET + integration: Unset | dict[str, Any] = UNSET if not isinstance(self.integration, Unset): integration = self.integration.to_dict() @@ -64,7 +64,7 @@ def to_dict(self) -> dict[str, Any]: post_mortem_template_id = self.post_mortem_template_id - template: Union[Unset, dict[str, Any]] = UNSET + template: Unset | dict[str, Any] = UNSET if not isinstance(self.template, Unset): template = self.template.to_dict() @@ -111,14 +111,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: file_id = d.pop("file_id") _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, UpdateConfluencePageTaskParamsTaskType] + task_type: Unset | UpdateConfluencePageTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: task_type = check_update_confluence_page_task_params_task_type(_task_type) _integration = d.pop("integration", UNSET) - integration: Union[Unset, UpdateConfluencePageTaskParamsIntegration] + integration: Unset | UpdateConfluencePageTaskParamsIntegration if isinstance(_integration, Unset): integration = UNSET else: @@ -131,7 +131,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: post_mortem_template_id = d.pop("post_mortem_template_id", UNSET) _template = d.pop("template", UNSET) - template: Union[Unset, UpdateConfluencePageTaskParamsTemplate] + template: Unset | UpdateConfluencePageTaskParamsTemplate if isinstance(_template, Unset): template = UNSET else: diff --git a/rootly_sdk/models/update_confluence_page_task_params_integration.py b/rootly_sdk/models/update_confluence_page_task_params_integration.py index 01e0c6e9..81dfec1a 100644 --- a/rootly_sdk/models/update_confluence_page_task_params_integration.py +++ b/rootly_sdk/models/update_confluence_page_task_params_integration.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -18,8 +18,8 @@ class UpdateConfluencePageTaskParamsIntegration: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_confluence_page_task_params_template.py b/rootly_sdk/models/update_confluence_page_task_params_template.py index 321a6a7b..92bc9f06 100644 --- a/rootly_sdk/models/update_confluence_page_task_params_template.py +++ b/rootly_sdk/models/update_confluence_page_task_params_template.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -18,8 +18,8 @@ class UpdateConfluencePageTaskParamsTemplate: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_custom_field_data_attributes.py b/rootly_sdk/models/update_custom_field_data_attributes.py index d163a6da..0abc43ab 100644 --- a/rootly_sdk/models/update_custom_field_data_attributes.py +++ b/rootly_sdk/models/update_custom_field_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -28,30 +28,30 @@ class UpdateCustomFieldDataAttributes: position (Union[Unset, int]): The position of the custom_field """ - label: Union[Unset, str] = UNSET - description: Union[None, Unset, str] = UNSET - shown: Union[Unset, list[UpdateCustomFieldDataAttributesShownItem]] = UNSET - required: Union[None, Unset, list[UpdateCustomFieldDataAttributesRequiredType0Item]] = UNSET - default: Union[None, Unset, str] = UNSET - position: Union[Unset, int] = UNSET + label: Unset | str = UNSET + description: None | Unset | str = UNSET + shown: Unset | list[UpdateCustomFieldDataAttributesShownItem] = UNSET + required: None | Unset | list[UpdateCustomFieldDataAttributesRequiredType0Item] = UNSET + default: None | Unset | str = UNSET + position: Unset | int = UNSET def to_dict(self) -> dict[str, Any]: label = self.label - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - shown: Union[Unset, list[str]] = UNSET + shown: Unset | list[str] = UNSET if not isinstance(self.shown, Unset): shown = [] for shown_item_data in self.shown: shown_item: str = shown_item_data shown.append(shown_item) - required: Union[None, Unset, list[str]] + required: None | Unset | list[str] if isinstance(self.required, Unset): required = UNSET elif isinstance(self.required, list): @@ -63,7 +63,7 @@ def to_dict(self) -> dict[str, Any]: else: required = self.required - default: Union[None, Unset, str] + default: None | Unset | str if isinstance(self.default, Unset): default = UNSET else: @@ -94,12 +94,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) label = d.pop("label", UNSET) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) @@ -110,7 +110,7 @@ def _parse_description(data: object) -> Union[None, Unset, str]: shown.append(shown_item) - def _parse_required(data: object) -> Union[None, Unset, list[UpdateCustomFieldDataAttributesRequiredType0Item]]: + def _parse_required(data: object) -> None | Unset | list[UpdateCustomFieldDataAttributesRequiredType0Item]: if data is None: return data if isinstance(data, Unset): @@ -130,16 +130,16 @@ def _parse_required(data: object) -> Union[None, Unset, list[UpdateCustomFieldDa return required_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[UpdateCustomFieldDataAttributesRequiredType0Item]], data) + return cast(None | Unset | list[UpdateCustomFieldDataAttributesRequiredType0Item], data) required = _parse_required(d.pop("required", UNSET)) - def _parse_default(data: object) -> Union[None, Unset, str]: + def _parse_default(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) default = _parse_default(d.pop("default", UNSET)) diff --git a/rootly_sdk/models/update_custom_field_option_data_attributes.py b/rootly_sdk/models/update_custom_field_option_data_attributes.py index e7b3bcd0..b39881c6 100644 --- a/rootly_sdk/models/update_custom_field_option_data_attributes.py +++ b/rootly_sdk/models/update_custom_field_option_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define @@ -18,10 +18,10 @@ class UpdateCustomFieldOptionDataAttributes: position (Union[Unset, int]): The position of the custom_field_option """ - value: Union[Unset, str] = UNSET - color: Union[Unset, str] = UNSET - default: Union[Unset, bool] = UNSET - position: Union[Unset, int] = UNSET + value: Unset | str = UNSET + color: Unset | str = UNSET + default: Unset | bool = UNSET + position: Unset | int = UNSET def to_dict(self) -> dict[str, Any]: value = self.value diff --git a/rootly_sdk/models/update_custom_form_data_attributes.py b/rootly_sdk/models/update_custom_form_data_attributes.py index 9075d956..c6dee99f 100644 --- a/rootly_sdk/models/update_custom_form_data_attributes.py +++ b/rootly_sdk/models/update_custom_form_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -20,14 +20,14 @@ class UpdateCustomFormDataAttributes: command (Union[Unset, str]): The Slack command used to trigger this form. """ - slug: Union[None, Unset, str] = UNSET - name: Union[Unset, str] = UNSET - description: Union[None, Unset, str] = UNSET - enabled: Union[Unset, bool] = UNSET - command: Union[Unset, str] = UNSET + slug: None | Unset | str = UNSET + name: Unset | str = UNSET + description: None | Unset | str = UNSET + enabled: Unset | bool = UNSET + command: Unset | str = UNSET def to_dict(self) -> dict[str, Any]: - slug: Union[None, Unset, str] + slug: None | Unset | str if isinstance(self.slug, Unset): slug = UNSET else: @@ -35,7 +35,7 @@ def to_dict(self) -> dict[str, Any]: name = self.name - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: @@ -65,23 +65,23 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_slug(data: object) -> Union[None, Unset, str]: + def _parse_slug(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) slug = _parse_slug(d.pop("slug", UNSET)) name = d.pop("name", UNSET) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) diff --git a/rootly_sdk/models/update_dashboard_data.py b/rootly_sdk/models/update_dashboard_data.py index 665ce88f..849bda0a 100644 --- a/rootly_sdk/models/update_dashboard_data.py +++ b/rootly_sdk/models/update_dashboard_data.py @@ -22,16 +22,16 @@ class UpdateDashboardData: attributes (Union[Unset, UpdateDashboardDataAttributes]): """ - type_: Union[Unset, UpdateDashboardDataType] = UNSET + type_: Unset | UpdateDashboardDataType = UNSET attributes: Union[Unset, "UpdateDashboardDataAttributes"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: Union[Unset, str] = UNSET + type_: Unset | str = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ - attributes: Union[Unset, dict[str, Any]] = UNSET + attributes: Unset | dict[str, Any] = UNSET if not isinstance(self.attributes, Unset): attributes = self.attributes.to_dict() @@ -51,14 +51,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _type_ = d.pop("type", UNSET) - type_: Union[Unset, UpdateDashboardDataType] + type_: Unset | UpdateDashboardDataType if isinstance(_type_, Unset): type_ = UNSET else: type_ = check_update_dashboard_data_type(_type_) _attributes = d.pop("attributes", UNSET) - attributes: Union[Unset, UpdateDashboardDataAttributes] + attributes: Unset | UpdateDashboardDataAttributes if isinstance(_attributes, Unset): attributes = UNSET else: diff --git a/rootly_sdk/models/update_dashboard_data_attributes.py b/rootly_sdk/models/update_dashboard_data_attributes.py index 91d6dabd..148b4538 100644 --- a/rootly_sdk/models/update_dashboard_data_attributes.py +++ b/rootly_sdk/models/update_dashboard_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -35,32 +35,32 @@ class UpdateDashboardDataAttributes: period (Union[Unset, UpdateDashboardDataAttributesPeriod]): The grouping period for dashboard panel data """ - name: Union[Unset, str] = UNSET - description: Union[None, Unset, str] = UNSET - owner: Union[Unset, UpdateDashboardDataAttributesOwner] = UNSET - public: Union[Unset, bool] = UNSET - range_: Union[None, Unset, str] = UNSET - auto_refresh: Union[Unset, bool] = UNSET - color: Union[Unset, UpdateDashboardDataAttributesColor] = UNSET - icon: Union[Unset, str] = UNSET - period: Union[Unset, UpdateDashboardDataAttributesPeriod] = UNSET + name: Unset | str = UNSET + description: None | Unset | str = UNSET + owner: Unset | UpdateDashboardDataAttributesOwner = UNSET + public: Unset | bool = UNSET + range_: None | Unset | str = UNSET + auto_refresh: Unset | bool = UNSET + color: Unset | UpdateDashboardDataAttributesColor = UNSET + icon: Unset | str = UNSET + period: Unset | UpdateDashboardDataAttributesPeriod = UNSET def to_dict(self) -> dict[str, Any]: name = self.name - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - owner: Union[Unset, str] = UNSET + owner: Unset | str = UNSET if not isinstance(self.owner, Unset): owner = self.owner public = self.public - range_: Union[None, Unset, str] + range_: None | Unset | str if isinstance(self.range_, Unset): range_ = UNSET else: @@ -68,13 +68,13 @@ def to_dict(self) -> dict[str, Any]: auto_refresh = self.auto_refresh - color: Union[Unset, str] = UNSET + color: Unset | str = UNSET if not isinstance(self.color, Unset): color = self.color icon = self.icon - period: Union[Unset, str] = UNSET + period: Unset | str = UNSET if not isinstance(self.period, Unset): period = self.period @@ -107,17 +107,17 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name", UNSET) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) _owner = d.pop("owner", UNSET) - owner: Union[Unset, UpdateDashboardDataAttributesOwner] + owner: Unset | UpdateDashboardDataAttributesOwner if isinstance(_owner, Unset): owner = UNSET else: @@ -125,19 +125,19 @@ def _parse_description(data: object) -> Union[None, Unset, str]: public = d.pop("public", UNSET) - def _parse_range_(data: object) -> Union[None, Unset, str]: + def _parse_range_(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) range_ = _parse_range_(d.pop("range", UNSET)) auto_refresh = d.pop("auto_refresh", UNSET) _color = d.pop("color", UNSET) - color: Union[Unset, UpdateDashboardDataAttributesColor] + color: Unset | UpdateDashboardDataAttributesColor if isinstance(_color, Unset): color = UNSET else: @@ -146,7 +146,7 @@ def _parse_range_(data: object) -> Union[None, Unset, str]: icon = d.pop("icon", UNSET) _period = d.pop("period", UNSET) - period: Union[Unset, UpdateDashboardDataAttributesPeriod] + period: Unset | UpdateDashboardDataAttributesPeriod if isinstance(_period, Unset): period = UNSET else: diff --git a/rootly_sdk/models/update_dashboard_panel_data.py b/rootly_sdk/models/update_dashboard_panel_data.py index 867603fc..31d0f4d5 100644 --- a/rootly_sdk/models/update_dashboard_panel_data.py +++ b/rootly_sdk/models/update_dashboard_panel_data.py @@ -25,16 +25,16 @@ class UpdateDashboardPanelData: attributes (Union[Unset, UpdateDashboardPanelDataAttributes]): """ - type_: Union[Unset, UpdateDashboardPanelDataType] = UNSET + type_: Unset | UpdateDashboardPanelDataType = UNSET attributes: Union[Unset, "UpdateDashboardPanelDataAttributes"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: Union[Unset, str] = UNSET + type_: Unset | str = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ - attributes: Union[Unset, dict[str, Any]] = UNSET + attributes: Unset | dict[str, Any] = UNSET if not isinstance(self.attributes, Unset): attributes = self.attributes.to_dict() @@ -54,14 +54,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _type_ = d.pop("type", UNSET) - type_: Union[Unset, UpdateDashboardPanelDataType] + type_: Unset | UpdateDashboardPanelDataType if isinstance(_type_, Unset): type_ = UNSET else: type_ = check_update_dashboard_panel_data_type(_type_) _attributes = d.pop("attributes", UNSET) - attributes: Union[Unset, UpdateDashboardPanelDataAttributes] + attributes: Unset | UpdateDashboardPanelDataAttributes if isinstance(_attributes, Unset): attributes = UNSET else: diff --git a/rootly_sdk/models/update_dashboard_panel_data_attributes.py b/rootly_sdk/models/update_dashboard_panel_data_attributes.py index 738fd7fa..f59d99d7 100644 --- a/rootly_sdk/models/update_dashboard_panel_data_attributes.py +++ b/rootly_sdk/models/update_dashboard_panel_data_attributes.py @@ -24,7 +24,7 @@ class UpdateDashboardPanelDataAttributes: position (Union['UpdateDashboardPanelDataAttributesPositionType0', None, Unset]): """ - name: Union[None, Unset, str] = UNSET + name: None | Unset | str = UNSET params: Union[Unset, "UpdateDashboardPanelDataAttributesParams"] = UNSET position: Union["UpdateDashboardPanelDataAttributesPositionType0", None, Unset] = UNSET @@ -33,17 +33,17 @@ def to_dict(self) -> dict[str, Any]: UpdateDashboardPanelDataAttributesPositionType0, ) - name: Union[None, Unset, str] + name: None | Unset | str if isinstance(self.name, Unset): name = UNSET else: name = self.name - params: Union[Unset, dict[str, Any]] = UNSET + params: Unset | dict[str, Any] = UNSET if not isinstance(self.params, Unset): params = self.params.to_dict() - position: Union[None, Unset, dict[str, Any]] + position: None | Unset | dict[str, Any] if isinstance(self.position, Unset): position = UNSET elif isinstance(self.position, UpdateDashboardPanelDataAttributesPositionType0): @@ -72,17 +72,17 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_name(data: object) -> Union[None, Unset, str]: + def _parse_name(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) name = _parse_name(d.pop("name", UNSET)) _params = d.pop("params", UNSET) - params: Union[Unset, UpdateDashboardPanelDataAttributesParams] + params: Unset | UpdateDashboardPanelDataAttributesParams if isinstance(_params, Unset): params = UNSET else: diff --git a/rootly_sdk/models/update_dashboard_panel_data_attributes_params.py b/rootly_sdk/models/update_dashboard_panel_data_attributes_params.py index 5afee492..2cd1a381 100644 --- a/rootly_sdk/models/update_dashboard_panel_data_attributes_params.py +++ b/rootly_sdk/models/update_dashboard_panel_data_attributes_params.py @@ -37,34 +37,34 @@ class UpdateDashboardPanelDataAttributesParams: datasets (Union[Unset, list['UpdateDashboardPanelDataAttributesParamsDatasetsItem']]): """ - display: Union[Unset, UpdateDashboardPanelDataAttributesParamsDisplay] = UNSET - description: Union[Unset, str] = UNSET - table_fields: Union[Unset, list[str]] = UNSET + display: Unset | UpdateDashboardPanelDataAttributesParamsDisplay = UNSET + description: Unset | str = UNSET + table_fields: Unset | list[str] = UNSET legend: Union[Unset, "UpdateDashboardPanelDataAttributesParamsLegend"] = UNSET datalabels: Union[Unset, "UpdateDashboardPanelDataAttributesParamsDatalabels"] = UNSET - datasets: Union[Unset, list["UpdateDashboardPanelDataAttributesParamsDatasetsItem"]] = UNSET + datasets: Unset | list["UpdateDashboardPanelDataAttributesParamsDatasetsItem"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - display: Union[Unset, str] = UNSET + display: Unset | str = UNSET if not isinstance(self.display, Unset): display = self.display description = self.description - table_fields: Union[Unset, list[str]] = UNSET + table_fields: Unset | list[str] = UNSET if not isinstance(self.table_fields, Unset): table_fields = self.table_fields - legend: Union[Unset, dict[str, Any]] = UNSET + legend: Unset | dict[str, Any] = UNSET if not isinstance(self.legend, Unset): legend = self.legend.to_dict() - datalabels: Union[Unset, dict[str, Any]] = UNSET + datalabels: Unset | dict[str, Any] = UNSET if not isinstance(self.datalabels, Unset): datalabels = self.datalabels.to_dict() - datasets: Union[Unset, list[dict[str, Any]]] = UNSET + datasets: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.datasets, Unset): datasets = [] for datasets_item_data in self.datasets: @@ -103,7 +103,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _display = d.pop("display", UNSET) - display: Union[Unset, UpdateDashboardPanelDataAttributesParamsDisplay] + display: Unset | UpdateDashboardPanelDataAttributesParamsDisplay if isinstance(_display, Unset): display = UNSET else: @@ -114,14 +114,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: table_fields = cast(list[str], d.pop("table_fields", UNSET)) _legend = d.pop("legend", UNSET) - legend: Union[Unset, UpdateDashboardPanelDataAttributesParamsLegend] + legend: Unset | UpdateDashboardPanelDataAttributesParamsLegend if isinstance(_legend, Unset): legend = UNSET else: legend = UpdateDashboardPanelDataAttributesParamsLegend.from_dict(_legend) _datalabels = d.pop("datalabels", UNSET) - datalabels: Union[Unset, UpdateDashboardPanelDataAttributesParamsDatalabels] + datalabels: Unset | UpdateDashboardPanelDataAttributesParamsDatalabels if isinstance(_datalabels, Unset): datalabels = UNSET else: diff --git a/rootly_sdk/models/update_dashboard_panel_data_attributes_params_datalabels.py b/rootly_sdk/models/update_dashboard_panel_data_attributes_params_datalabels.py index 62d0be8d..91983f14 100644 --- a/rootly_sdk/models/update_dashboard_panel_data_attributes_params_datalabels.py +++ b/rootly_sdk/models/update_dashboard_panel_data_attributes_params_datalabels.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,7 +16,7 @@ class UpdateDashboardPanelDataAttributesParamsDatalabels: enabled (Union[Unset, bool]): """ - enabled: Union[Unset, bool] = UNSET + enabled: Unset | bool = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_dashboard_panel_data_attributes_params_datasets_item.py b/rootly_sdk/models/update_dashboard_panel_data_attributes_params_datasets_item.py index 2977680e..0523caa2 100644 --- a/rootly_sdk/models/update_dashboard_panel_data_attributes_params_datasets_item.py +++ b/rootly_sdk/models/update_dashboard_panel_data_attributes_params_datasets_item.py @@ -36,9 +36,9 @@ class UpdateDashboardPanelDataAttributesParamsDatasetsItem: aggregate (Union['UpdateDashboardPanelDataAttributesParamsDatasetsItemAggregateType0', None, Unset]): """ - name: Union[None, Unset, str] = UNSET - collection: Union[Unset, UpdateDashboardPanelDataAttributesParamsDatasetsItemCollection] = UNSET - filter_: Union[Unset, list["UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItem"]] = UNSET + name: None | Unset | str = UNSET + collection: Unset | UpdateDashboardPanelDataAttributesParamsDatasetsItemCollection = UNSET + filter_: Unset | list["UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItem"] = UNSET group_by: Union["UpdateDashboardPanelDataAttributesParamsDatasetsItemGroupByType1Type0", None, Unset, str] = UNSET aggregate: Union["UpdateDashboardPanelDataAttributesParamsDatasetsItemAggregateType0", None, Unset] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -51,24 +51,24 @@ def to_dict(self) -> dict[str, Any]: UpdateDashboardPanelDataAttributesParamsDatasetsItemGroupByType1Type0, ) - name: Union[None, Unset, str] + name: None | Unset | str if isinstance(self.name, Unset): name = UNSET else: name = self.name - collection: Union[Unset, str] = UNSET + collection: Unset | str = UNSET if not isinstance(self.collection, Unset): collection = self.collection - filter_: Union[Unset, list[dict[str, Any]]] = UNSET + filter_: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.filter_, Unset): filter_ = [] for filter_item_data in self.filter_: filter_item = filter_item_data.to_dict() filter_.append(filter_item) - group_by: Union[None, Unset, dict[str, Any], str] + group_by: None | Unset | dict[str, Any] | str if isinstance(self.group_by, Unset): group_by = UNSET elif isinstance(self.group_by, UpdateDashboardPanelDataAttributesParamsDatasetsItemGroupByType1Type0): @@ -76,7 +76,7 @@ def to_dict(self) -> dict[str, Any]: else: group_by = self.group_by - aggregate: Union[None, Unset, dict[str, Any]] + aggregate: None | Unset | dict[str, Any] if isinstance(self.aggregate, Unset): aggregate = UNSET elif isinstance(self.aggregate, UpdateDashboardPanelDataAttributesParamsDatasetsItemAggregateType0): @@ -114,17 +114,17 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_name(data: object) -> Union[None, Unset, str]: + def _parse_name(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) name = _parse_name(d.pop("name", UNSET)) _collection = d.pop("collection", UNSET) - collection: Union[Unset, UpdateDashboardPanelDataAttributesParamsDatasetsItemCollection] + collection: Unset | UpdateDashboardPanelDataAttributesParamsDatasetsItemCollection if isinstance(_collection, Unset): collection = UNSET else: diff --git a/rootly_sdk/models/update_dashboard_panel_data_attributes_params_datasets_item_aggregate_type_0.py b/rootly_sdk/models/update_dashboard_panel_data_attributes_params_datasets_item_aggregate_type_0.py index 6aee7aac..2e1d3fbc 100644 --- a/rootly_sdk/models/update_dashboard_panel_data_attributes_params_datasets_item_aggregate_type_0.py +++ b/rootly_sdk/models/update_dashboard_panel_data_attributes_params_datasets_item_aggregate_type_0.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,23 +22,23 @@ class UpdateDashboardPanelDataAttributesParamsDatasetsItemAggregateType0: cumulative (Union[None, Unset, bool]): """ - operation: Union[Unset, UpdateDashboardPanelDataAttributesParamsDatasetsItemAggregateType0Operation] = UNSET - key: Union[None, Unset, str] = UNSET - cumulative: Union[None, Unset, bool] = UNSET + operation: Unset | UpdateDashboardPanelDataAttributesParamsDatasetsItemAggregateType0Operation = UNSET + key: None | Unset | str = UNSET + cumulative: None | Unset | bool = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - operation: Union[Unset, str] = UNSET + operation: Unset | str = UNSET if not isinstance(self.operation, Unset): operation = self.operation - key: Union[None, Unset, str] + key: None | Unset | str if isinstance(self.key, Unset): key = UNSET else: key = self.key - cumulative: Union[None, Unset, bool] + cumulative: None | Unset | bool if isinstance(self.cumulative, Unset): cumulative = UNSET else: @@ -60,7 +60,7 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _operation = d.pop("operation", UNSET) - operation: Union[Unset, UpdateDashboardPanelDataAttributesParamsDatasetsItemAggregateType0Operation] + operation: Unset | UpdateDashboardPanelDataAttributesParamsDatasetsItemAggregateType0Operation if isinstance(_operation, Unset): operation = UNSET else: @@ -68,21 +68,21 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: _operation ) - def _parse_key(data: object) -> Union[None, Unset, str]: + def _parse_key(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) key = _parse_key(d.pop("key", UNSET)) - def _parse_cumulative(data: object) -> Union[None, Unset, bool]: + def _parse_cumulative(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) cumulative = _parse_cumulative(d.pop("cumulative", UNSET)) diff --git a/rootly_sdk/models/update_dashboard_panel_data_attributes_params_datasets_item_filter_item.py b/rootly_sdk/models/update_dashboard_panel_data_attributes_params_datasets_item_filter_item.py index 952159f0..7c091524 100644 --- a/rootly_sdk/models/update_dashboard_panel_data_attributes_params_datasets_item_filter_item.py +++ b/rootly_sdk/models/update_dashboard_panel_data_attributes_params_datasets_item_filter_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -27,16 +27,16 @@ class UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItem: rules (Union[Unset, list['UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItem']]): """ - operation: Union[Unset, UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItemOperation] = UNSET - rules: Union[Unset, list["UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItem"]] = UNSET + operation: Unset | UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItemOperation = UNSET + rules: Unset | list["UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItem"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - operation: Union[Unset, str] = UNSET + operation: Unset | str = UNSET if not isinstance(self.operation, Unset): operation = self.operation - rules: Union[Unset, list[dict[str, Any]]] = UNSET + rules: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.rules, Unset): rules = [] for rules_item_data in self.rules: @@ -61,7 +61,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _operation = d.pop("operation", UNSET) - operation: Union[Unset, UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItemOperation] + operation: Unset | UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItemOperation if isinstance(_operation, Unset): operation = UNSET else: diff --git a/rootly_sdk/models/update_dashboard_panel_data_attributes_params_datasets_item_filter_item_rules_item.py b/rootly_sdk/models/update_dashboard_panel_data_attributes_params_datasets_item_filter_item_rules_item.py index e5489af9..eaaf8471 100644 --- a/rootly_sdk/models/update_dashboard_panel_data_attributes_params_datasets_item_filter_item_rules_item.py +++ b/rootly_sdk/models/update_dashboard_panel_data_attributes_params_datasets_item_filter_item_rules_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -27,18 +27,18 @@ class UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItem: value (Union[Unset, str]): """ - operation: Union[Unset, UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItemOperation] = UNSET - condition: Union[Unset, UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItemCondition] = UNSET - key: Union[Unset, str] = UNSET - value: Union[Unset, str] = UNSET + operation: Unset | UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItemOperation = UNSET + condition: Unset | UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItemCondition = UNSET + key: Unset | str = UNSET + value: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - operation: Union[Unset, str] = UNSET + operation: Unset | str = UNSET if not isinstance(self.operation, Unset): operation = self.operation - condition: Union[Unset, str] = UNSET + condition: Unset | str = UNSET if not isinstance(self.condition, Unset): condition = self.condition @@ -64,7 +64,7 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _operation = d.pop("operation", UNSET) - operation: Union[Unset, UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItemOperation] + operation: Unset | UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItemOperation if isinstance(_operation, Unset): operation = UNSET else: @@ -75,7 +75,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: ) _condition = d.pop("condition", UNSET) - condition: Union[Unset, UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItemCondition] + condition: Unset | UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItemCondition if isinstance(_condition, Unset): condition = UNSET else: diff --git a/rootly_sdk/models/update_dashboard_panel_data_attributes_params_legend.py b/rootly_sdk/models/update_dashboard_panel_data_attributes_params_legend.py index 51cd4d8e..24a0af4a 100644 --- a/rootly_sdk/models/update_dashboard_panel_data_attributes_params_legend.py +++ b/rootly_sdk/models/update_dashboard_panel_data_attributes_params_legend.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -20,11 +20,11 @@ class UpdateDashboardPanelDataAttributesParamsLegend: groups (Union[Unset, UpdateDashboardPanelDataAttributesParamsLegendGroups]): Default: 'all'. """ - groups: Union[Unset, UpdateDashboardPanelDataAttributesParamsLegendGroups] = "all" + groups: Unset | UpdateDashboardPanelDataAttributesParamsLegendGroups = "all" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - groups: Union[Unset, str] = UNSET + groups: Unset | str = UNSET if not isinstance(self.groups, Unset): groups = self.groups @@ -40,7 +40,7 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _groups = d.pop("groups", UNSET) - groups: Union[Unset, UpdateDashboardPanelDataAttributesParamsLegendGroups] + groups: Unset | UpdateDashboardPanelDataAttributesParamsLegendGroups if isinstance(_groups, Unset): groups = UNSET else: diff --git a/rootly_sdk/models/update_datadog_notebook_task_params.py b/rootly_sdk/models/update_datadog_notebook_task_params.py index 1dee9c60..d67ddc1b 100644 --- a/rootly_sdk/models/update_datadog_notebook_task_params.py +++ b/rootly_sdk/models/update_datadog_notebook_task_params.py @@ -35,18 +35,18 @@ class UpdateDatadogNotebookTaskParams: """ file_id: str - task_type: Union[Unset, UpdateDatadogNotebookTaskParamsTaskType] = UNSET - title: Union[Unset, str] = UNSET - content: Union[Unset, str] = UNSET - kind: Union[Unset, UpdateDatadogNotebookTaskParamsKind] = UNSET - post_mortem_template_id: Union[Unset, str] = UNSET + task_type: Unset | UpdateDatadogNotebookTaskParamsTaskType = UNSET + title: Unset | str = UNSET + content: Unset | str = UNSET + kind: Unset | UpdateDatadogNotebookTaskParamsKind = UNSET + post_mortem_template_id: Unset | str = UNSET template: Union[Unset, "UpdateDatadogNotebookTaskParamsTemplate"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: file_id = self.file_id - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -54,13 +54,13 @@ def to_dict(self) -> dict[str, Any]: content = self.content - kind: Union[Unset, str] = UNSET + kind: Unset | str = UNSET if not isinstance(self.kind, Unset): kind = self.kind post_mortem_template_id = self.post_mortem_template_id - template: Union[Unset, dict[str, Any]] = UNSET + template: Unset | dict[str, Any] = UNSET if not isinstance(self.template, Unset): template = self.template.to_dict() @@ -94,7 +94,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: file_id = d.pop("file_id") _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, UpdateDatadogNotebookTaskParamsTaskType] + task_type: Unset | UpdateDatadogNotebookTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: @@ -105,7 +105,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: content = d.pop("content", UNSET) _kind = d.pop("kind", UNSET) - kind: Union[Unset, UpdateDatadogNotebookTaskParamsKind] + kind: Unset | UpdateDatadogNotebookTaskParamsKind if isinstance(_kind, Unset): kind = UNSET else: @@ -114,7 +114,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: post_mortem_template_id = d.pop("post_mortem_template_id", UNSET) _template = d.pop("template", UNSET) - template: Union[Unset, UpdateDatadogNotebookTaskParamsTemplate] + template: Unset | UpdateDatadogNotebookTaskParamsTemplate if isinstance(_template, Unset): template = UNSET else: diff --git a/rootly_sdk/models/update_datadog_notebook_task_params_template.py b/rootly_sdk/models/update_datadog_notebook_task_params_template.py index 50db4337..8b3f916d 100644 --- a/rootly_sdk/models/update_datadog_notebook_task_params_template.py +++ b/rootly_sdk/models/update_datadog_notebook_task_params_template.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -18,8 +18,8 @@ class UpdateDatadogNotebookTaskParamsTemplate: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_dropbox_paper_page_task_params.py b/rootly_sdk/models/update_dropbox_paper_page_task_params.py index e252c4ac..285ebb2c 100644 --- a/rootly_sdk/models/update_dropbox_paper_page_task_params.py +++ b/rootly_sdk/models/update_dropbox_paper_page_task_params.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -25,16 +25,16 @@ class UpdateDropboxPaperPageTaskParams: """ file_id: str - task_type: Union[Unset, UpdateDropboxPaperPageTaskParamsTaskType] = UNSET - title: Union[Unset, str] = UNSET - content: Union[Unset, str] = UNSET - post_mortem_template_id: Union[Unset, str] = UNSET + task_type: Unset | UpdateDropboxPaperPageTaskParamsTaskType = UNSET + title: Unset | str = UNSET + content: Unset | str = UNSET + post_mortem_template_id: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: file_id = self.file_id - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -68,7 +68,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: file_id = d.pop("file_id") _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, UpdateDropboxPaperPageTaskParamsTaskType] + task_type: Unset | UpdateDropboxPaperPageTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/update_edge_connector_action_action.py b/rootly_sdk/models/update_edge_connector_action_action.py index 5eaf8755..508ccc77 100644 --- a/rootly_sdk/models/update_edge_connector_action_action.py +++ b/rootly_sdk/models/update_edge_connector_action_action.py @@ -26,19 +26,19 @@ class UpdateEdgeConnectorActionAction: metadata (Union[Unset, UpdateEdgeConnectorActionActionMetadata]): """ - name: Union[Unset, str] = UNSET - action_type: Union[Unset, UpdateEdgeConnectorActionActionActionType] = UNSET + name: Unset | str = UNSET + action_type: Unset | UpdateEdgeConnectorActionActionActionType = UNSET metadata: Union[Unset, "UpdateEdgeConnectorActionActionMetadata"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: name = self.name - action_type: Union[Unset, str] = UNSET + action_type: Unset | str = UNSET if not isinstance(self.action_type, Unset): action_type = self.action_type - metadata: Union[Unset, dict[str, Any]] = UNSET + metadata: Unset | dict[str, Any] = UNSET if not isinstance(self.metadata, Unset): metadata = self.metadata.to_dict() @@ -62,14 +62,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name = d.pop("name", UNSET) _action_type = d.pop("action_type", UNSET) - action_type: Union[Unset, UpdateEdgeConnectorActionActionActionType] + action_type: Unset | UpdateEdgeConnectorActionActionActionType if isinstance(_action_type, Unset): action_type = UNSET else: action_type = check_update_edge_connector_action_action_action_type(_action_type) _metadata = d.pop("metadata", UNSET) - metadata: Union[Unset, UpdateEdgeConnectorActionActionMetadata] + metadata: Unset | UpdateEdgeConnectorActionActionMetadata if isinstance(_metadata, Unset): metadata = UNSET else: diff --git a/rootly_sdk/models/update_edge_connector_action_body.py b/rootly_sdk/models/update_edge_connector_action_body.py index ec92d9bc..ab2138ac 100644 --- a/rootly_sdk/models/update_edge_connector_action_body.py +++ b/rootly_sdk/models/update_edge_connector_action_body.py @@ -24,7 +24,7 @@ class UpdateEdgeConnectorActionBody: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - action: Union[Unset, dict[str, Any]] = UNSET + action: Unset | dict[str, Any] = UNSET if not isinstance(self.action, Unset): action = self.action.to_dict() @@ -42,7 +42,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _action = d.pop("action", UNSET) - action: Union[Unset, UpdateEdgeConnectorActionBodyAction] + action: Unset | UpdateEdgeConnectorActionBodyAction if isinstance(_action, Unset): action = UNSET else: diff --git a/rootly_sdk/models/update_edge_connector_action_body_action.py b/rootly_sdk/models/update_edge_connector_action_body_action.py index ed704dd0..5b27c01f 100644 --- a/rootly_sdk/models/update_edge_connector_action_body_action.py +++ b/rootly_sdk/models/update_edge_connector_action_body_action.py @@ -26,19 +26,19 @@ class UpdateEdgeConnectorActionBodyAction: metadata (Union[Unset, UpdateEdgeConnectorActionBodyActionMetadata]): """ - name: Union[Unset, str] = UNSET - action_type: Union[Unset, UpdateEdgeConnectorActionBodyActionActionType] = UNSET + name: Unset | str = UNSET + action_type: Unset | UpdateEdgeConnectorActionBodyActionActionType = UNSET metadata: Union[Unset, "UpdateEdgeConnectorActionBodyActionMetadata"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: name = self.name - action_type: Union[Unset, str] = UNSET + action_type: Unset | str = UNSET if not isinstance(self.action_type, Unset): action_type = self.action_type - metadata: Union[Unset, dict[str, Any]] = UNSET + metadata: Unset | dict[str, Any] = UNSET if not isinstance(self.metadata, Unset): metadata = self.metadata.to_dict() @@ -64,14 +64,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name = d.pop("name", UNSET) _action_type = d.pop("action_type", UNSET) - action_type: Union[Unset, UpdateEdgeConnectorActionBodyActionActionType] + action_type: Unset | UpdateEdgeConnectorActionBodyActionActionType if isinstance(_action_type, Unset): action_type = UNSET else: action_type = check_update_edge_connector_action_body_action_action_type(_action_type) _metadata = d.pop("metadata", UNSET) - metadata: Union[Unset, UpdateEdgeConnectorActionBodyActionMetadata] + metadata: Unset | UpdateEdgeConnectorActionBodyActionMetadata if isinstance(_metadata, Unset): metadata = UNSET else: diff --git a/rootly_sdk/models/update_edge_connector_body.py b/rootly_sdk/models/update_edge_connector_body.py index 32b92ecf..996b1d4d 100644 --- a/rootly_sdk/models/update_edge_connector_body.py +++ b/rootly_sdk/models/update_edge_connector_body.py @@ -24,7 +24,7 @@ class UpdateEdgeConnectorBody: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data: Union[Unset, dict[str, Any]] = UNSET + data: Unset | dict[str, Any] = UNSET if not isinstance(self.data, Unset): data = self.data.to_dict() @@ -42,7 +42,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _data = d.pop("data", UNSET) - data: Union[Unset, UpdateEdgeConnectorBodyData] + data: Unset | UpdateEdgeConnectorBodyData if isinstance(_data, Unset): data = UNSET else: diff --git a/rootly_sdk/models/update_edge_connector_body_data.py b/rootly_sdk/models/update_edge_connector_body_data.py index a7aa90ae..7e203ba0 100644 --- a/rootly_sdk/models/update_edge_connector_body_data.py +++ b/rootly_sdk/models/update_edge_connector_body_data.py @@ -26,19 +26,19 @@ class UpdateEdgeConnectorBodyData: attributes (Union[Unset, UpdateEdgeConnectorBodyDataAttributes]): """ - type_: Union[Unset, UpdateEdgeConnectorBodyDataType] = UNSET - id: Union[Unset, str] = UNSET + type_: Unset | UpdateEdgeConnectorBodyDataType = UNSET + id: Unset | str = UNSET attributes: Union[Unset, "UpdateEdgeConnectorBodyDataAttributes"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: Union[Unset, str] = UNSET + type_: Unset | str = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ id = self.id - attributes: Union[Unset, dict[str, Any]] = UNSET + attributes: Unset | dict[str, Any] = UNSET if not isinstance(self.attributes, Unset): attributes = self.attributes.to_dict() @@ -60,7 +60,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _type_ = d.pop("type", UNSET) - type_: Union[Unset, UpdateEdgeConnectorBodyDataType] + type_: Unset | UpdateEdgeConnectorBodyDataType if isinstance(_type_, Unset): type_ = UNSET else: @@ -69,7 +69,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: id = d.pop("id", UNSET) _attributes = d.pop("attributes", UNSET) - attributes: Union[Unset, UpdateEdgeConnectorBodyDataAttributes] + attributes: Unset | UpdateEdgeConnectorBodyDataAttributes if isinstance(_attributes, Unset): attributes = UNSET else: diff --git a/rootly_sdk/models/update_edge_connector_body_data_attributes.py b/rootly_sdk/models/update_edge_connector_body_data_attributes.py index ae3b14dd..abde96dc 100644 --- a/rootly_sdk/models/update_edge_connector_body_data_attributes.py +++ b/rootly_sdk/models/update_edge_connector_body_data_attributes.py @@ -28,10 +28,10 @@ class UpdateEdgeConnectorBodyDataAttributes: filters (Union[Unset, UpdateEdgeConnectorBodyDataAttributesFilters]): Event filters """ - name: Union[Unset, str] = UNSET - description: Union[Unset, str] = UNSET - status: Union[Unset, UpdateEdgeConnectorBodyDataAttributesStatus] = UNSET - subscriptions: Union[Unset, list[str]] = UNSET + name: Unset | str = UNSET + description: Unset | str = UNSET + status: Unset | UpdateEdgeConnectorBodyDataAttributesStatus = UNSET + subscriptions: Unset | list[str] = UNSET filters: Union[Unset, "UpdateEdgeConnectorBodyDataAttributesFilters"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -40,15 +40,15 @@ def to_dict(self) -> dict[str, Any]: description = self.description - status: Union[Unset, str] = UNSET + status: Unset | str = UNSET if not isinstance(self.status, Unset): status = self.status - subscriptions: Union[Unset, list[str]] = UNSET + subscriptions: Unset | list[str] = UNSET if not isinstance(self.subscriptions, Unset): subscriptions = self.subscriptions - filters: Union[Unset, dict[str, Any]] = UNSET + filters: Unset | dict[str, Any] = UNSET if not isinstance(self.filters, Unset): filters = self.filters.to_dict() @@ -80,7 +80,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: description = d.pop("description", UNSET) _status = d.pop("status", UNSET) - status: Union[Unset, UpdateEdgeConnectorBodyDataAttributesStatus] + status: Unset | UpdateEdgeConnectorBodyDataAttributesStatus if isinstance(_status, Unset): status = UNSET else: @@ -89,7 +89,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: subscriptions = cast(list[str], d.pop("subscriptions", UNSET)) _filters = d.pop("filters", UNSET) - filters: Union[Unset, UpdateEdgeConnectorBodyDataAttributesFilters] + filters: Unset | UpdateEdgeConnectorBodyDataAttributesFilters if isinstance(_filters, Unset): filters = UNSET else: diff --git a/rootly_sdk/models/update_edge_connector_edge_connector.py b/rootly_sdk/models/update_edge_connector_edge_connector.py index 0923247a..3bbc9ead 100644 --- a/rootly_sdk/models/update_edge_connector_edge_connector.py +++ b/rootly_sdk/models/update_edge_connector_edge_connector.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,10 +23,10 @@ class UpdateEdgeConnectorEdgeConnector: subscriptions (Union[Unset, list[str]]): """ - name: Union[Unset, str] = UNSET - description: Union[Unset, str] = UNSET - status: Union[Unset, UpdateEdgeConnectorEdgeConnectorStatus] = UNSET - subscriptions: Union[Unset, list[str]] = UNSET + name: Unset | str = UNSET + description: Unset | str = UNSET + status: Unset | UpdateEdgeConnectorEdgeConnectorStatus = UNSET + subscriptions: Unset | list[str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -34,11 +34,11 @@ def to_dict(self) -> dict[str, Any]: description = self.description - status: Union[Unset, str] = UNSET + status: Unset | str = UNSET if not isinstance(self.status, Unset): status = self.status - subscriptions: Union[Unset, list[str]] = UNSET + subscriptions: Unset | list[str] = UNSET if not isinstance(self.subscriptions, Unset): subscriptions = self.subscriptions @@ -64,7 +64,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: description = d.pop("description", UNSET) _status = d.pop("status", UNSET) - status: Union[Unset, UpdateEdgeConnectorEdgeConnectorStatus] + status: Unset | UpdateEdgeConnectorEdgeConnectorStatus if isinstance(_status, Unset): status = UNSET else: diff --git a/rootly_sdk/models/update_environment_data_attributes.py b/rootly_sdk/models/update_environment_data_attributes.py index a67e70aa..5964309a 100644 --- a/rootly_sdk/models/update_environment_data_attributes.py +++ b/rootly_sdk/models/update_environment_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define @@ -41,20 +41,20 @@ class UpdateEnvironmentDataAttributes: this environment. """ - slug: Union[None, Unset, str] = UNSET - name: Union[Unset, str] = UNSET - description: Union[None, Unset, str] = UNSET - public_description: Union[None, Unset, str] = UNSET - color: Union[None, Unset, str] = UNSET - position: Union[None, Unset, int] = UNSET - external_id: Union[None, Unset, str] = UNSET - notify_emails: Union[None, Unset, list[str]] = UNSET - slack_channels: Union[None, Unset, list["UpdateEnvironmentDataAttributesSlackChannelsType0Item"]] = UNSET - slack_aliases: Union[None, Unset, list["UpdateEnvironmentDataAttributesSlackAliasesType0Item"]] = UNSET - properties: Union[Unset, list["UpdateEnvironmentDataAttributesPropertiesItem"]] = UNSET + slug: None | Unset | str = UNSET + name: Unset | str = UNSET + description: None | Unset | str = UNSET + public_description: None | Unset | str = UNSET + color: None | Unset | str = UNSET + position: None | Unset | int = UNSET + external_id: None | Unset | str = UNSET + notify_emails: None | Unset | list[str] = UNSET + slack_channels: None | Unset | list["UpdateEnvironmentDataAttributesSlackChannelsType0Item"] = UNSET + slack_aliases: None | Unset | list["UpdateEnvironmentDataAttributesSlackAliasesType0Item"] = UNSET + properties: Unset | list["UpdateEnvironmentDataAttributesPropertiesItem"] = UNSET def to_dict(self) -> dict[str, Any]: - slug: Union[None, Unset, str] + slug: None | Unset | str if isinstance(self.slug, Unset): slug = UNSET else: @@ -62,37 +62,37 @@ def to_dict(self) -> dict[str, Any]: name = self.name - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - public_description: Union[None, Unset, str] + public_description: None | Unset | str if isinstance(self.public_description, Unset): public_description = UNSET else: public_description = self.public_description - color: Union[None, Unset, str] + color: None | Unset | str if isinstance(self.color, Unset): color = UNSET else: color = self.color - position: Union[None, Unset, int] + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: position = self.position - external_id: Union[None, Unset, str] + external_id: None | Unset | str if isinstance(self.external_id, Unset): external_id = UNSET else: external_id = self.external_id - notify_emails: Union[None, Unset, list[str]] + notify_emails: None | Unset | list[str] if isinstance(self.notify_emails, Unset): notify_emails = UNSET elif isinstance(self.notify_emails, list): @@ -101,7 +101,7 @@ def to_dict(self) -> dict[str, Any]: else: notify_emails = self.notify_emails - slack_channels: Union[None, Unset, list[dict[str, Any]]] + slack_channels: None | Unset | list[dict[str, Any]] if isinstance(self.slack_channels, Unset): slack_channels = UNSET elif isinstance(self.slack_channels, list): @@ -113,7 +113,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_channels = self.slack_channels - slack_aliases: Union[None, Unset, list[dict[str, Any]]] + slack_aliases: None | Unset | list[dict[str, Any]] if isinstance(self.slack_aliases, Unset): slack_aliases = UNSET elif isinstance(self.slack_aliases, list): @@ -125,7 +125,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_aliases = self.slack_aliases - properties: Union[Unset, list[dict[str, Any]]] = UNSET + properties: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.properties, Unset): properties = [] for properties_item_data in self.properties: @@ -174,63 +174,63 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_slug(data: object) -> Union[None, Unset, str]: + def _parse_slug(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) slug = _parse_slug(d.pop("slug", UNSET)) name = d.pop("name", UNSET) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_public_description(data: object) -> Union[None, Unset, str]: + def _parse_public_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) public_description = _parse_public_description(d.pop("public_description", UNSET)) - def _parse_color(data: object) -> Union[None, Unset, str]: + def _parse_color(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) color = _parse_color(d.pop("color", UNSET)) - def _parse_position(data: object) -> Union[None, Unset, int]: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) - def _parse_external_id(data: object) -> Union[None, Unset, str]: + def _parse_external_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) external_id = _parse_external_id(d.pop("external_id", UNSET)) - def _parse_notify_emails(data: object) -> Union[None, Unset, list[str]]: + def _parse_notify_emails(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -243,13 +243,13 @@ def _parse_notify_emails(data: object) -> Union[None, Unset, list[str]]: return notify_emails_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) notify_emails = _parse_notify_emails(d.pop("notify_emails", UNSET)) def _parse_slack_channels( data: object, - ) -> Union[None, Unset, list["UpdateEnvironmentDataAttributesSlackChannelsType0Item"]]: + ) -> None | Unset | list["UpdateEnvironmentDataAttributesSlackChannelsType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -269,13 +269,13 @@ def _parse_slack_channels( return slack_channels_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list["UpdateEnvironmentDataAttributesSlackChannelsType0Item"]], data) + return cast(None | Unset | list["UpdateEnvironmentDataAttributesSlackChannelsType0Item"], data) slack_channels = _parse_slack_channels(d.pop("slack_channels", UNSET)) def _parse_slack_aliases( data: object, - ) -> Union[None, Unset, list["UpdateEnvironmentDataAttributesSlackAliasesType0Item"]]: + ) -> None | Unset | list["UpdateEnvironmentDataAttributesSlackAliasesType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -295,7 +295,7 @@ def _parse_slack_aliases( return slack_aliases_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list["UpdateEnvironmentDataAttributesSlackAliasesType0Item"]], data) + return cast(None | Unset | list["UpdateEnvironmentDataAttributesSlackAliasesType0Item"], data) slack_aliases = _parse_slack_aliases(d.pop("slack_aliases", UNSET)) diff --git a/rootly_sdk/models/update_escalation_policy_data_attributes.py b/rootly_sdk/models/update_escalation_policy_data_attributes.py index e4ed13bc..aad07d04 100644 --- a/rootly_sdk/models/update_escalation_policy_data_attributes.py +++ b/rootly_sdk/models/update_escalation_policy_data_attributes.py @@ -27,11 +27,11 @@ class UpdateEscalationPolicyDataAttributes: business_hours (Union['UpdateEscalationPolicyDataAttributesBusinessHoursType0', None, Unset]): """ - name: Union[Unset, str] = UNSET - description: Union[None, Unset, str] = UNSET - repeat_count: Union[Unset, int] = UNSET - group_ids: Union[Unset, list[str]] = UNSET - service_ids: Union[Unset, list[str]] = UNSET + name: Unset | str = UNSET + description: None | Unset | str = UNSET + repeat_count: Unset | int = UNSET + group_ids: Unset | list[str] = UNSET + service_ids: Unset | list[str] = UNSET business_hours: Union["UpdateEscalationPolicyDataAttributesBusinessHoursType0", None, Unset] = UNSET def to_dict(self) -> dict[str, Any]: @@ -41,7 +41,7 @@ def to_dict(self) -> dict[str, Any]: name = self.name - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: @@ -49,15 +49,15 @@ def to_dict(self) -> dict[str, Any]: repeat_count = self.repeat_count - group_ids: Union[Unset, list[str]] = UNSET + group_ids: Unset | list[str] = UNSET if not isinstance(self.group_ids, Unset): group_ids = self.group_ids - service_ids: Union[Unset, list[str]] = UNSET + service_ids: Unset | list[str] = UNSET if not isinstance(self.service_ids, Unset): service_ids = self.service_ids - business_hours: Union[None, Unset, dict[str, Any]] + business_hours: None | Unset | dict[str, Any] if isinstance(self.business_hours, Unset): business_hours = UNSET elif isinstance(self.business_hours, UpdateEscalationPolicyDataAttributesBusinessHoursType0): @@ -92,12 +92,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name", UNSET) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) diff --git a/rootly_sdk/models/update_escalation_policy_data_attributes_business_hours_type_0.py b/rootly_sdk/models/update_escalation_policy_data_attributes_business_hours_type_0.py index 309c198d..49ec4302 100644 --- a/rootly_sdk/models/update_escalation_policy_data_attributes_business_hours_type_0.py +++ b/rootly_sdk/models/update_escalation_policy_data_attributes_business_hours_type_0.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,18 +29,18 @@ class UpdateEscalationPolicyDataAttributesBusinessHoursType0: end_time (Union[None, Unset, str]): End time for business hours (HH:MM) """ - time_zone: Union[Unset, UpdateEscalationPolicyDataAttributesBusinessHoursType0TimeZone] = UNSET - days: Union[None, Unset, list[UpdateEscalationPolicyDataAttributesBusinessHoursType0DaysType0Item]] = UNSET - start_time: Union[None, Unset, str] = UNSET - end_time: Union[None, Unset, str] = UNSET + time_zone: Unset | UpdateEscalationPolicyDataAttributesBusinessHoursType0TimeZone = UNSET + days: None | Unset | list[UpdateEscalationPolicyDataAttributesBusinessHoursType0DaysType0Item] = UNSET + start_time: None | Unset | str = UNSET + end_time: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - time_zone: Union[Unset, str] = UNSET + time_zone: Unset | str = UNSET if not isinstance(self.time_zone, Unset): time_zone = self.time_zone - days: Union[None, Unset, list[str]] + days: None | Unset | list[str] if isinstance(self.days, Unset): days = UNSET elif isinstance(self.days, list): @@ -52,13 +52,13 @@ def to_dict(self) -> dict[str, Any]: else: days = self.days - start_time: Union[None, Unset, str] + start_time: None | Unset | str if isinstance(self.start_time, Unset): start_time = UNSET else: start_time = self.start_time - end_time: Union[None, Unset, str] + end_time: None | Unset | str if isinstance(self.end_time, Unset): end_time = UNSET else: @@ -82,7 +82,7 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _time_zone = d.pop("time_zone", UNSET) - time_zone: Union[Unset, UpdateEscalationPolicyDataAttributesBusinessHoursType0TimeZone] + time_zone: Unset | UpdateEscalationPolicyDataAttributesBusinessHoursType0TimeZone if isinstance(_time_zone, Unset): time_zone = UNSET else: @@ -90,7 +90,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: def _parse_days( data: object, - ) -> Union[None, Unset, list[UpdateEscalationPolicyDataAttributesBusinessHoursType0DaysType0Item]]: + ) -> None | Unset | list[UpdateEscalationPolicyDataAttributesBusinessHoursType0DaysType0Item]: if data is None: return data if isinstance(data, Unset): @@ -112,27 +112,25 @@ def _parse_days( return days_type_0 except: # noqa: E722 pass - return cast( - Union[None, Unset, list[UpdateEscalationPolicyDataAttributesBusinessHoursType0DaysType0Item]], data - ) + return cast(None | Unset | list[UpdateEscalationPolicyDataAttributesBusinessHoursType0DaysType0Item], data) days = _parse_days(d.pop("days", UNSET)) - def _parse_start_time(data: object) -> Union[None, Unset, str]: + def _parse_start_time(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) start_time = _parse_start_time(d.pop("start_time", UNSET)) - def _parse_end_time(data: object) -> Union[None, Unset, str]: + def _parse_end_time(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) end_time = _parse_end_time(d.pop("end_time", UNSET)) diff --git a/rootly_sdk/models/update_escalation_policy_level_data_attributes.py b/rootly_sdk/models/update_escalation_policy_level_data_attributes.py index 3f37bc30..3fdb235e 100644 --- a/rootly_sdk/models/update_escalation_policy_level_data_attributes.py +++ b/rootly_sdk/models/update_escalation_policy_level_data_attributes.py @@ -58,26 +58,26 @@ class UpdateEscalationPolicyLevelDataAttributes: level's notification targets """ - delay: Union[Unset, int] = UNSET - position: Union[Unset, int] = UNSET - escalation_policy_path_id: Union[None, Unset, str] = UNSET - paging_strategy_configuration_strategy: Union[ - Unset, UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationStrategy - ] = "default" - paging_strategy_configuration_schedule_strategy: Union[ - Unset, UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationScheduleStrategy - ] = "on_call_only" - paging_strategy_configuration_repeats: Union[None, Unset, int] = UNSET - paging_strategy_configuration_repeats_mode: Union[ - Unset, UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRepeatsMode - ] = UNSET - paging_strategy_configuration_rotation_scope: Union[ - Unset, UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRotationScope - ] = UNSET - paging_strategy_configuration_page_users_count: Union[None, Unset, int] = UNSET - notification_target_params: Union[ - Unset, list[Union["UpdateEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0", None]] - ] = UNSET + delay: Unset | int = UNSET + position: Unset | int = UNSET + escalation_policy_path_id: None | Unset | str = UNSET + paging_strategy_configuration_strategy: ( + Unset | UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationStrategy + ) = "default" + paging_strategy_configuration_schedule_strategy: ( + Unset | UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationScheduleStrategy + ) = "on_call_only" + paging_strategy_configuration_repeats: None | Unset | int = UNSET + paging_strategy_configuration_repeats_mode: ( + Unset | UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRepeatsMode + ) = UNSET + paging_strategy_configuration_rotation_scope: ( + Unset | UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRotationScope + ) = UNSET + paging_strategy_configuration_page_users_count: None | Unset | int = UNSET + notification_target_params: ( + Unset | list[Union["UpdateEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0", None]] + ) = UNSET def to_dict(self) -> dict[str, Any]: from ..models.update_escalation_policy_level_data_attributes_notification_target_params_item_type_0 import ( @@ -88,45 +88,45 @@ def to_dict(self) -> dict[str, Any]: position = self.position - escalation_policy_path_id: Union[None, Unset, str] + escalation_policy_path_id: None | Unset | str if isinstance(self.escalation_policy_path_id, Unset): escalation_policy_path_id = UNSET else: escalation_policy_path_id = self.escalation_policy_path_id - paging_strategy_configuration_strategy: Union[Unset, str] = UNSET + paging_strategy_configuration_strategy: Unset | str = UNSET if not isinstance(self.paging_strategy_configuration_strategy, Unset): paging_strategy_configuration_strategy = self.paging_strategy_configuration_strategy - paging_strategy_configuration_schedule_strategy: Union[Unset, str] = UNSET + paging_strategy_configuration_schedule_strategy: Unset | str = UNSET if not isinstance(self.paging_strategy_configuration_schedule_strategy, Unset): paging_strategy_configuration_schedule_strategy = self.paging_strategy_configuration_schedule_strategy - paging_strategy_configuration_repeats: Union[None, Unset, int] + paging_strategy_configuration_repeats: None | Unset | int if isinstance(self.paging_strategy_configuration_repeats, Unset): paging_strategy_configuration_repeats = UNSET else: paging_strategy_configuration_repeats = self.paging_strategy_configuration_repeats - paging_strategy_configuration_repeats_mode: Union[Unset, str] = UNSET + paging_strategy_configuration_repeats_mode: Unset | str = UNSET if not isinstance(self.paging_strategy_configuration_repeats_mode, Unset): paging_strategy_configuration_repeats_mode = self.paging_strategy_configuration_repeats_mode - paging_strategy_configuration_rotation_scope: Union[Unset, str] = UNSET + paging_strategy_configuration_rotation_scope: Unset | str = UNSET if not isinstance(self.paging_strategy_configuration_rotation_scope, Unset): paging_strategy_configuration_rotation_scope = self.paging_strategy_configuration_rotation_scope - paging_strategy_configuration_page_users_count: Union[None, Unset, int] + paging_strategy_configuration_page_users_count: None | Unset | int if isinstance(self.paging_strategy_configuration_page_users_count, Unset): paging_strategy_configuration_page_users_count = UNSET else: paging_strategy_configuration_page_users_count = self.paging_strategy_configuration_page_users_count - notification_target_params: Union[Unset, list[Union[None, dict[str, Any]]]] = UNSET + notification_target_params: Unset | list[None | dict[str, Any]] = UNSET if not isinstance(self.notification_target_params, Unset): notification_target_params = [] for notification_target_params_item_data in self.notification_target_params: - notification_target_params_item: Union[None, dict[str, Any]] + notification_target_params_item: None | dict[str, Any] if isinstance( notification_target_params_item_data, UpdateEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0, @@ -177,19 +177,19 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: position = d.pop("position", UNSET) - def _parse_escalation_policy_path_id(data: object) -> Union[None, Unset, str]: + def _parse_escalation_policy_path_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) escalation_policy_path_id = _parse_escalation_policy_path_id(d.pop("escalation_policy_path_id", UNSET)) _paging_strategy_configuration_strategy = d.pop("paging_strategy_configuration_strategy", UNSET) - paging_strategy_configuration_strategy: Union[ - Unset, UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationStrategy - ] + paging_strategy_configuration_strategy: ( + Unset | UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationStrategy + ) if isinstance(_paging_strategy_configuration_strategy, Unset): paging_strategy_configuration_strategy = UNSET else: @@ -202,9 +202,9 @@ def _parse_escalation_policy_path_id(data: object) -> Union[None, Unset, str]: _paging_strategy_configuration_schedule_strategy = d.pop( "paging_strategy_configuration_schedule_strategy", UNSET ) - paging_strategy_configuration_schedule_strategy: Union[ - Unset, UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationScheduleStrategy - ] + paging_strategy_configuration_schedule_strategy: ( + Unset | UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationScheduleStrategy + ) if isinstance(_paging_strategy_configuration_schedule_strategy, Unset): paging_strategy_configuration_schedule_strategy = UNSET else: @@ -214,21 +214,21 @@ def _parse_escalation_policy_path_id(data: object) -> Union[None, Unset, str]: ) ) - def _parse_paging_strategy_configuration_repeats(data: object) -> Union[None, Unset, int]: + def _parse_paging_strategy_configuration_repeats(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) paging_strategy_configuration_repeats = _parse_paging_strategy_configuration_repeats( d.pop("paging_strategy_configuration_repeats", UNSET) ) _paging_strategy_configuration_repeats_mode = d.pop("paging_strategy_configuration_repeats_mode", UNSET) - paging_strategy_configuration_repeats_mode: Union[ - Unset, UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRepeatsMode - ] + paging_strategy_configuration_repeats_mode: ( + Unset | UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRepeatsMode + ) if isinstance(_paging_strategy_configuration_repeats_mode, Unset): paging_strategy_configuration_repeats_mode = UNSET else: @@ -239,9 +239,9 @@ def _parse_paging_strategy_configuration_repeats(data: object) -> Union[None, Un ) _paging_strategy_configuration_rotation_scope = d.pop("paging_strategy_configuration_rotation_scope", UNSET) - paging_strategy_configuration_rotation_scope: Union[ - Unset, UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRotationScope - ] + paging_strategy_configuration_rotation_scope: ( + Unset | UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRotationScope + ) if isinstance(_paging_strategy_configuration_rotation_scope, Unset): paging_strategy_configuration_rotation_scope = UNSET else: @@ -251,12 +251,12 @@ def _parse_paging_strategy_configuration_repeats(data: object) -> Union[None, Un ) ) - def _parse_paging_strategy_configuration_page_users_count(data: object) -> Union[None, Unset, int]: + def _parse_paging_strategy_configuration_page_users_count(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) paging_strategy_configuration_page_users_count = _parse_paging_strategy_configuration_page_users_count( d.pop("paging_strategy_configuration_page_users_count", UNSET) diff --git a/rootly_sdk/models/update_escalation_policy_level_data_attributes_notification_target_params_item_type_0.py b/rootly_sdk/models/update_escalation_policy_level_data_attributes_notification_target_params_item_type_0.py index 79130e7d..f9f312b1 100644 --- a/rootly_sdk/models/update_escalation_policy_level_data_attributes_notification_target_params_item_type_0.py +++ b/rootly_sdk/models/update_escalation_policy_level_data_attributes_notification_target_params_item_type_0.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -31,9 +31,7 @@ class UpdateEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0 id: str type_: UpdateEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0Type - team_members: Union[ - Unset, UpdateEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0TeamMembers - ] = UNSET + team_members: Unset | UpdateEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0TeamMembers = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -41,7 +39,7 @@ def to_dict(self) -> dict[str, Any]: type_: str = self.type_ - team_members: Union[Unset, str] = UNSET + team_members: Unset | str = UNSET if not isinstance(self.team_members, Unset): team_members = self.team_members @@ -68,9 +66,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: ) _team_members = d.pop("team_members", UNSET) - team_members: Union[ - Unset, UpdateEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0TeamMembers - ] + team_members: Unset | UpdateEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0TeamMembers if isinstance(_team_members, Unset): team_members = UNSET else: diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes.py index b4b92fd5..d5c61ae4 100644 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes.py +++ b/rootly_sdk/models/update_escalation_policy_path_data_attributes.py @@ -160,21 +160,21 @@ class UpdateEscalationPolicyPathDataAttributes: the rules. """ - name: Union[Unset, str] = UNSET - notification_type: Union[Unset, UpdateEscalationPolicyPathDataAttributesNotificationType] = "audible" - path_type: Union[Unset, UpdateEscalationPolicyPathDataAttributesPathType] = UNSET - after_deferral_behavior: Union[Unset, UpdateEscalationPolicyPathDataAttributesAfterDeferralBehavior] = UNSET - after_deferral_path_id: Union[None, Unset, str] = UNSET - default: Union[None, Unset, bool] = UNSET - match_mode: Union[Unset, UpdateEscalationPolicyPathDataAttributesMatchMode] = "match-all-rules" - position: Union[Unset, int] = UNSET - repeat: Union[None, Unset, bool] = UNSET - repeat_count: Union[None, Unset, int] = UNSET - initial_delay: Union[Unset, int] = UNSET - retrigger_timeout_minutes: Union[None, Unset, int] = UNSET - rules: Union[ - Unset, - list[ + name: Unset | str = UNSET + notification_type: Unset | UpdateEscalationPolicyPathDataAttributesNotificationType = "audible" + path_type: Unset | UpdateEscalationPolicyPathDataAttributesPathType = UNSET + after_deferral_behavior: Unset | UpdateEscalationPolicyPathDataAttributesAfterDeferralBehavior = UNSET + after_deferral_path_id: None | Unset | str = UNSET + default: None | Unset | bool = UNSET + match_mode: Unset | UpdateEscalationPolicyPathDataAttributesMatchMode = "match-all-rules" + position: Unset | int = UNSET + repeat: None | Unset | bool = UNSET + repeat_count: None | Unset | int = UNSET + initial_delay: Unset | int = UNSET + retrigger_timeout_minutes: None | Unset | int = UNSET + rules: ( + Unset + | list[ Union[ "UpdateEscalationPolicyPathDataAttributesRulesItemType0", "UpdateEscalationPolicyPathDataAttributesRulesItemType1", @@ -201,10 +201,10 @@ class UpdateEscalationPolicyPathDataAttributes: "UpdateEscalationPolicyPathDataAttributesRulesItemType9Type6", "UpdateEscalationPolicyPathDataAttributesRulesItemType9Type7", ] - ], - ] = UNSET - time_restriction_time_zone: Union[Unset, UpdateEscalationPolicyPathDataAttributesTimeRestrictionTimeZone] = UNSET - time_restrictions: Union[Unset, list["UpdateEscalationPolicyPathDataAttributesTimeRestrictionsItem"]] = UNSET + ] + ) = UNSET + time_restriction_time_zone: Unset | UpdateEscalationPolicyPathDataAttributesTimeRestrictionTimeZone = UNSET + time_restrictions: Unset | list["UpdateEscalationPolicyPathDataAttributesTimeRestrictionsItem"] = UNSET def to_dict(self) -> dict[str, Any]: from ..models.update_escalation_policy_path_data_attributes_rules_item_type_0 import ( @@ -279,43 +279,43 @@ def to_dict(self) -> dict[str, Any]: name = self.name - notification_type: Union[Unset, str] = UNSET + notification_type: Unset | str = UNSET if not isinstance(self.notification_type, Unset): notification_type = self.notification_type - path_type: Union[Unset, str] = UNSET + path_type: Unset | str = UNSET if not isinstance(self.path_type, Unset): path_type = self.path_type - after_deferral_behavior: Union[Unset, str] = UNSET + after_deferral_behavior: Unset | str = UNSET if not isinstance(self.after_deferral_behavior, Unset): after_deferral_behavior = self.after_deferral_behavior - after_deferral_path_id: Union[None, Unset, str] + after_deferral_path_id: None | Unset | str if isinstance(self.after_deferral_path_id, Unset): after_deferral_path_id = UNSET else: after_deferral_path_id = self.after_deferral_path_id - default: Union[None, Unset, bool] + default: None | Unset | bool if isinstance(self.default, Unset): default = UNSET else: default = self.default - match_mode: Union[Unset, str] = UNSET + match_mode: Unset | str = UNSET if not isinstance(self.match_mode, Unset): match_mode = self.match_mode position = self.position - repeat: Union[None, Unset, bool] + repeat: None | Unset | bool if isinstance(self.repeat, Unset): repeat = UNSET else: repeat = self.repeat - repeat_count: Union[None, Unset, int] + repeat_count: None | Unset | int if isinstance(self.repeat_count, Unset): repeat_count = UNSET else: @@ -323,13 +323,13 @@ def to_dict(self) -> dict[str, Any]: initial_delay = self.initial_delay - retrigger_timeout_minutes: Union[None, Unset, int] + retrigger_timeout_minutes: None | Unset | int if isinstance(self.retrigger_timeout_minutes, Unset): retrigger_timeout_minutes = UNSET else: retrigger_timeout_minutes = self.retrigger_timeout_minutes - rules: Union[Unset, list[dict[str, Any]]] = UNSET + rules: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.rules, Unset): rules = [] for rules_item_data in self.rules: @@ -385,11 +385,11 @@ def to_dict(self) -> dict[str, Any]: rules.append(rules_item) - time_restriction_time_zone: Union[Unset, str] = UNSET + time_restriction_time_zone: Unset | str = UNSET if not isinstance(self.time_restriction_time_zone, Unset): time_restriction_time_zone = self.time_restriction_time_zone - time_restrictions: Union[Unset, list[dict[str, Any]]] = UNSET + time_restrictions: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.time_restrictions, Unset): time_restrictions = [] for time_restrictions_item_data in self.time_restrictions: @@ -514,7 +514,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name = d.pop("name", UNSET) _notification_type = d.pop("notification_type", UNSET) - notification_type: Union[Unset, UpdateEscalationPolicyPathDataAttributesNotificationType] + notification_type: Unset | UpdateEscalationPolicyPathDataAttributesNotificationType if isinstance(_notification_type, Unset): notification_type = UNSET else: @@ -523,14 +523,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: ) _path_type = d.pop("path_type", UNSET) - path_type: Union[Unset, UpdateEscalationPolicyPathDataAttributesPathType] + path_type: Unset | UpdateEscalationPolicyPathDataAttributesPathType if isinstance(_path_type, Unset): path_type = UNSET else: path_type = check_update_escalation_policy_path_data_attributes_path_type(_path_type) _after_deferral_behavior = d.pop("after_deferral_behavior", UNSET) - after_deferral_behavior: Union[Unset, UpdateEscalationPolicyPathDataAttributesAfterDeferralBehavior] + after_deferral_behavior: Unset | UpdateEscalationPolicyPathDataAttributesAfterDeferralBehavior if isinstance(_after_deferral_behavior, Unset): after_deferral_behavior = UNSET else: @@ -538,26 +538,26 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: _after_deferral_behavior ) - def _parse_after_deferral_path_id(data: object) -> Union[None, Unset, str]: + def _parse_after_deferral_path_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) after_deferral_path_id = _parse_after_deferral_path_id(d.pop("after_deferral_path_id", UNSET)) - def _parse_default(data: object) -> Union[None, Unset, bool]: + def _parse_default(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) default = _parse_default(d.pop("default", UNSET)) _match_mode = d.pop("match_mode", UNSET) - match_mode: Union[Unset, UpdateEscalationPolicyPathDataAttributesMatchMode] + match_mode: Unset | UpdateEscalationPolicyPathDataAttributesMatchMode if isinstance(_match_mode, Unset): match_mode = UNSET else: @@ -565,32 +565,32 @@ def _parse_default(data: object) -> Union[None, Unset, bool]: position = d.pop("position", UNSET) - def _parse_repeat(data: object) -> Union[None, Unset, bool]: + def _parse_repeat(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) repeat = _parse_repeat(d.pop("repeat", UNSET)) - def _parse_repeat_count(data: object) -> Union[None, Unset, int]: + def _parse_repeat_count(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) repeat_count = _parse_repeat_count(d.pop("repeat_count", UNSET)) initial_delay = d.pop("initial_delay", UNSET) - def _parse_retrigger_timeout_minutes(data: object) -> Union[None, Unset, int]: + def _parse_retrigger_timeout_minutes(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) retrigger_timeout_minutes = _parse_retrigger_timeout_minutes(d.pop("retrigger_timeout_minutes", UNSET)) @@ -851,7 +851,7 @@ def _parse_rules_item( rules.append(rules_item) _time_restriction_time_zone = d.pop("time_restriction_time_zone", UNSET) - time_restriction_time_zone: Union[Unset, UpdateEscalationPolicyPathDataAttributesTimeRestrictionTimeZone] + time_restriction_time_zone: Unset | UpdateEscalationPolicyPathDataAttributesTimeRestrictionTimeZone if isinstance(_time_restriction_time_zone, Unset): time_restriction_time_zone = UNSET else: diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_2.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_2.py index bd2c5269..0f849085 100644 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_2.py +++ b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_2.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -31,8 +31,8 @@ class UpdateEscalationPolicyPathDataAttributesRulesItemType2: rule_type: UpdateEscalationPolicyPathDataAttributesRulesItemType2RuleType json_path: str operator: UpdateEscalationPolicyPathDataAttributesRulesItemType2Operator - value: Union[None, Unset, str] = UNSET - values: Union[Unset, list[str]] = UNSET + value: None | Unset | str = UNSET + values: Unset | list[str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,13 +42,13 @@ def to_dict(self) -> dict[str, Any]: operator: str = self.operator - value: Union[None, Unset, str] + value: None | Unset | str if isinstance(self.value, Unset): value = UNSET else: value = self.value - values: Union[Unset, list[str]] = UNSET + values: Unset | list[str] = UNSET if not isinstance(self.values, Unset): values = self.values @@ -77,12 +77,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: operator = check_update_escalation_policy_path_data_attributes_rules_item_type_2_operator(d.pop("operator")) - def _parse_value(data: object) -> Union[None, Unset, str]: + def _parse_value(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) value = _parse_value(d.pop("value", UNSET)) diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_3.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_3.py index cbcdd9bc..0b645f2f 100644 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_3.py +++ b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_3.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -33,7 +33,7 @@ class UpdateEscalationPolicyPathDataAttributesRulesItemType3: fieldable_type: str fieldable_id: str operator: UpdateEscalationPolicyPathDataAttributesRulesItemType3Operator - values: Union[Unset, list[str]] = UNSET + values: Unset | list[str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -45,7 +45,7 @@ def to_dict(self) -> dict[str, Any]: operator: str = self.operator - values: Union[Unset, list[str]] = UNSET + values: Unset | list[str] = UNSET if not isinstance(self.values, Unset): values = self.values diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_5_time_blocks_item.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_5_time_blocks_item.py index d949b1d9..1bc78b6f 100644 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_5_time_blocks_item.py +++ b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_5_time_blocks_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -26,17 +26,17 @@ class UpdateEscalationPolicyPathDataAttributesRulesItemType5TimeBlocksItem: position (Union[None, Unset, int]): """ - monday: Union[Unset, bool] = False - tuesday: Union[Unset, bool] = False - wednesday: Union[Unset, bool] = False - thursday: Union[Unset, bool] = False - friday: Union[Unset, bool] = False - saturday: Union[Unset, bool] = False - sunday: Union[Unset, bool] = False - start_time: Union[Unset, str] = UNSET - end_time: Union[Unset, str] = UNSET - all_day: Union[Unset, bool] = False - position: Union[None, Unset, int] = UNSET + monday: Unset | bool = False + tuesday: Unset | bool = False + wednesday: Unset | bool = False + thursday: Unset | bool = False + friday: Unset | bool = False + saturday: Unset | bool = False + sunday: Unset | bool = False + start_time: Unset | str = UNSET + end_time: Unset | str = UNSET + all_day: Unset | bool = False + position: None | Unset | int = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -60,7 +60,7 @@ def to_dict(self) -> dict[str, Any]: all_day = self.all_day - position: Union[None, Unset, int] + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: @@ -117,12 +117,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: all_day = d.pop("all_day", UNSET) - def _parse_position(data: object) -> Union[None, Unset, int]: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_2.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_2.py index 716f6576..d3282b15 100644 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_2.py +++ b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_2.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -33,8 +33,8 @@ class UpdateEscalationPolicyPathDataAttributesRulesItemType8Type2: rule_type: UpdateEscalationPolicyPathDataAttributesRulesItemType8Type2RuleType json_path: str operator: UpdateEscalationPolicyPathDataAttributesRulesItemType8Type2Operator - value: Union[None, Unset, str] = UNSET - values: Union[Unset, list[str]] = UNSET + value: None | Unset | str = UNSET + values: Unset | list[str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -44,13 +44,13 @@ def to_dict(self) -> dict[str, Any]: operator: str = self.operator - value: Union[None, Unset, str] + value: None | Unset | str if isinstance(self.value, Unset): value = UNSET else: value = self.value - values: Union[Unset, list[str]] = UNSET + values: Unset | list[str] = UNSET if not isinstance(self.values, Unset): values = self.values @@ -83,12 +83,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d.pop("operator") ) - def _parse_value(data: object) -> Union[None, Unset, str]: + def _parse_value(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) value = _parse_value(d.pop("value", UNSET)) diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_3.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_3.py index 0943798d..9d1030c3 100644 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_3.py +++ b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_3.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -34,7 +34,7 @@ class UpdateEscalationPolicyPathDataAttributesRulesItemType8Type3: fieldable_type: str fieldable_id: str operator: UpdateEscalationPolicyPathDataAttributesRulesItemType8Type3Operator - values: Union[Unset, list[str]] = UNSET + values: Unset | list[str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -46,7 +46,7 @@ def to_dict(self) -> dict[str, Any]: operator: str = self.operator - values: Union[Unset, list[str]] = UNSET + values: Unset | list[str] = UNSET if not isinstance(self.values, Unset): values = self.values diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_5_time_blocks_item.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_5_time_blocks_item.py index 44223b76..0e8296e6 100644 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_5_time_blocks_item.py +++ b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_5_time_blocks_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -26,17 +26,17 @@ class UpdateEscalationPolicyPathDataAttributesRulesItemType8Type5TimeBlocksItem: position (Union[None, Unset, int]): """ - monday: Union[Unset, bool] = False - tuesday: Union[Unset, bool] = False - wednesday: Union[Unset, bool] = False - thursday: Union[Unset, bool] = False - friday: Union[Unset, bool] = False - saturday: Union[Unset, bool] = False - sunday: Union[Unset, bool] = False - start_time: Union[Unset, str] = UNSET - end_time: Union[Unset, str] = UNSET - all_day: Union[Unset, bool] = False - position: Union[None, Unset, int] = UNSET + monday: Unset | bool = False + tuesday: Unset | bool = False + wednesday: Unset | bool = False + thursday: Unset | bool = False + friday: Unset | bool = False + saturday: Unset | bool = False + sunday: Unset | bool = False + start_time: Unset | str = UNSET + end_time: Unset | str = UNSET + all_day: Unset | bool = False + position: None | Unset | int = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -60,7 +60,7 @@ def to_dict(self) -> dict[str, Any]: all_day = self.all_day - position: Union[None, Unset, int] + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: @@ -117,12 +117,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: all_day = d.pop("all_day", UNSET) - def _parse_position(data: object) -> Union[None, Unset, int]: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_2.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_2.py index deace1cf..50ab7788 100644 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_2.py +++ b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_2.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -33,8 +33,8 @@ class UpdateEscalationPolicyPathDataAttributesRulesItemType9Type2: rule_type: UpdateEscalationPolicyPathDataAttributesRulesItemType9Type2RuleType json_path: str operator: UpdateEscalationPolicyPathDataAttributesRulesItemType9Type2Operator - value: Union[None, Unset, str] = UNSET - values: Union[Unset, list[str]] = UNSET + value: None | Unset | str = UNSET + values: Unset | list[str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -44,13 +44,13 @@ def to_dict(self) -> dict[str, Any]: operator: str = self.operator - value: Union[None, Unset, str] + value: None | Unset | str if isinstance(self.value, Unset): value = UNSET else: value = self.value - values: Union[Unset, list[str]] = UNSET + values: Unset | list[str] = UNSET if not isinstance(self.values, Unset): values = self.values @@ -83,12 +83,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d.pop("operator") ) - def _parse_value(data: object) -> Union[None, Unset, str]: + def _parse_value(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) value = _parse_value(d.pop("value", UNSET)) diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_3.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_3.py index 24a1a718..ef4214fe 100644 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_3.py +++ b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_3.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -34,7 +34,7 @@ class UpdateEscalationPolicyPathDataAttributesRulesItemType9Type3: fieldable_type: str fieldable_id: str operator: UpdateEscalationPolicyPathDataAttributesRulesItemType9Type3Operator - values: Union[Unset, list[str]] = UNSET + values: Unset | list[str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -46,7 +46,7 @@ def to_dict(self) -> dict[str, Any]: operator: str = self.operator - values: Union[Unset, list[str]] = UNSET + values: Unset | list[str] = UNSET if not isinstance(self.values, Unset): values = self.values diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_5_time_blocks_item.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_5_time_blocks_item.py index b641c0fa..615fb586 100644 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_5_time_blocks_item.py +++ b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_5_time_blocks_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -26,17 +26,17 @@ class UpdateEscalationPolicyPathDataAttributesRulesItemType9Type5TimeBlocksItem: position (Union[None, Unset, int]): """ - monday: Union[Unset, bool] = False - tuesday: Union[Unset, bool] = False - wednesday: Union[Unset, bool] = False - thursday: Union[Unset, bool] = False - friday: Union[Unset, bool] = False - saturday: Union[Unset, bool] = False - sunday: Union[Unset, bool] = False - start_time: Union[Unset, str] = UNSET - end_time: Union[Unset, str] = UNSET - all_day: Union[Unset, bool] = False - position: Union[None, Unset, int] = UNSET + monday: Unset | bool = False + tuesday: Unset | bool = False + wednesday: Unset | bool = False + thursday: Unset | bool = False + friday: Unset | bool = False + saturday: Unset | bool = False + sunday: Unset | bool = False + start_time: Unset | str = UNSET + end_time: Unset | str = UNSET + all_day: Unset | bool = False + position: None | Unset | int = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -60,7 +60,7 @@ def to_dict(self) -> dict[str, Any]: all_day = self.all_day - position: Union[None, Unset, int] + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: @@ -117,12 +117,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: all_day = d.pop("all_day", UNSET) - def _parse_position(data: object) -> Union[None, Unset, int]: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_time_restrictions_item.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_time_restrictions_item.py index 62a8b40a..e729e6f7 100644 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_time_restrictions_item.py +++ b/rootly_sdk/models/update_escalation_policy_path_data_attributes_time_restrictions_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -27,20 +27,20 @@ class UpdateEscalationPolicyPathDataAttributesTimeRestrictionsItem: end_time (Union[Unset, str]): Formatted as HH:MM """ - start_day: Union[Unset, UpdateEscalationPolicyPathDataAttributesTimeRestrictionsItemStartDay] = UNSET - start_time: Union[Unset, str] = UNSET - end_day: Union[Unset, UpdateEscalationPolicyPathDataAttributesTimeRestrictionsItemEndDay] = UNSET - end_time: Union[Unset, str] = UNSET + start_day: Unset | UpdateEscalationPolicyPathDataAttributesTimeRestrictionsItemStartDay = UNSET + start_time: Unset | str = UNSET + end_day: Unset | UpdateEscalationPolicyPathDataAttributesTimeRestrictionsItemEndDay = UNSET + end_time: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - start_day: Union[Unset, str] = UNSET + start_day: Unset | str = UNSET if not isinstance(self.start_day, Unset): start_day = self.start_day start_time = self.start_time - end_day: Union[Unset, str] = UNSET + end_day: Unset | str = UNSET if not isinstance(self.end_day, Unset): end_day = self.end_day @@ -64,7 +64,7 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _start_day = d.pop("start_day", UNSET) - start_day: Union[Unset, UpdateEscalationPolicyPathDataAttributesTimeRestrictionsItemStartDay] + start_day: Unset | UpdateEscalationPolicyPathDataAttributesTimeRestrictionsItemStartDay if isinstance(_start_day, Unset): start_day = UNSET else: @@ -73,7 +73,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: start_time = d.pop("start_time", UNSET) _end_day = d.pop("end_day", UNSET) - end_day: Union[Unset, UpdateEscalationPolicyPathDataAttributesTimeRestrictionsItemEndDay] + end_day: Unset | UpdateEscalationPolicyPathDataAttributesTimeRestrictionsItemEndDay if isinstance(_end_day, Unset): end_day = UNSET else: diff --git a/rootly_sdk/models/update_form_field_data_attributes.py b/rootly_sdk/models/update_form_field_data_attributes.py index bb7e8c98..055611ae 100644 --- a/rootly_sdk/models/update_form_field_data_attributes.py +++ b/rootly_sdk/models/update_form_field_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -41,40 +41,40 @@ class UpdateFormFieldDataAttributes: reference-kind catalog properties are supported. """ - slug: Union[None, Unset, str] = UNSET - kind: Union[Unset, UpdateFormFieldDataAttributesKind] = UNSET - input_kind: Union[Unset, UpdateFormFieldDataAttributesInputKind] = UNSET - value_kind: Union[Unset, UpdateFormFieldDataAttributesValueKind] = UNSET - value_kind_catalog_id: Union[None, Unset, str] = UNSET - name: Union[Unset, str] = UNSET - description: Union[None, Unset, str] = UNSET - shown: Union[Unset, list[str]] = UNSET - required: Union[Unset, list[str]] = UNSET - show_on_incident_details: Union[Unset, bool] = UNSET - enabled: Union[Unset, bool] = UNSET - default_values: Union[Unset, list[str]] = UNSET - auto_set_by_catalog_property_id: Union[None, Unset, str] = UNSET + slug: None | Unset | str = UNSET + kind: Unset | UpdateFormFieldDataAttributesKind = UNSET + input_kind: Unset | UpdateFormFieldDataAttributesInputKind = UNSET + value_kind: Unset | UpdateFormFieldDataAttributesValueKind = UNSET + value_kind_catalog_id: None | Unset | str = UNSET + name: Unset | str = UNSET + description: None | Unset | str = UNSET + shown: Unset | list[str] = UNSET + required: Unset | list[str] = UNSET + show_on_incident_details: Unset | bool = UNSET + enabled: Unset | bool = UNSET + default_values: Unset | list[str] = UNSET + auto_set_by_catalog_property_id: None | Unset | str = UNSET def to_dict(self) -> dict[str, Any]: - slug: Union[None, Unset, str] + slug: None | Unset | str if isinstance(self.slug, Unset): slug = UNSET else: slug = self.slug - kind: Union[Unset, str] = UNSET + kind: Unset | str = UNSET if not isinstance(self.kind, Unset): kind = self.kind - input_kind: Union[Unset, str] = UNSET + input_kind: Unset | str = UNSET if not isinstance(self.input_kind, Unset): input_kind = self.input_kind - value_kind: Union[Unset, str] = UNSET + value_kind: Unset | str = UNSET if not isinstance(self.value_kind, Unset): value_kind = self.value_kind - value_kind_catalog_id: Union[None, Unset, str] + value_kind_catalog_id: None | Unset | str if isinstance(self.value_kind_catalog_id, Unset): value_kind_catalog_id = UNSET else: @@ -82,17 +82,17 @@ def to_dict(self) -> dict[str, Any]: name = self.name - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - shown: Union[Unset, list[str]] = UNSET + shown: Unset | list[str] = UNSET if not isinstance(self.shown, Unset): shown = self.shown - required: Union[Unset, list[str]] = UNSET + required: Unset | list[str] = UNSET if not isinstance(self.required, Unset): required = self.required @@ -100,11 +100,11 @@ def to_dict(self) -> dict[str, Any]: enabled = self.enabled - default_values: Union[Unset, list[str]] = UNSET + default_values: Unset | list[str] = UNSET if not isinstance(self.default_values, Unset): default_values = self.default_values - auto_set_by_catalog_property_id: Union[None, Unset, str] + auto_set_by_catalog_property_id: None | Unset | str if isinstance(self.auto_set_by_catalog_property_id, Unset): auto_set_by_catalog_property_id = UNSET else: @@ -146,53 +146,53 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_slug(data: object) -> Union[None, Unset, str]: + def _parse_slug(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) slug = _parse_slug(d.pop("slug", UNSET)) _kind = d.pop("kind", UNSET) - kind: Union[Unset, UpdateFormFieldDataAttributesKind] + kind: Unset | UpdateFormFieldDataAttributesKind if isinstance(_kind, Unset): kind = UNSET else: kind = check_update_form_field_data_attributes_kind(_kind) _input_kind = d.pop("input_kind", UNSET) - input_kind: Union[Unset, UpdateFormFieldDataAttributesInputKind] + input_kind: Unset | UpdateFormFieldDataAttributesInputKind if isinstance(_input_kind, Unset): input_kind = UNSET else: input_kind = check_update_form_field_data_attributes_input_kind(_input_kind) _value_kind = d.pop("value_kind", UNSET) - value_kind: Union[Unset, UpdateFormFieldDataAttributesValueKind] + value_kind: Unset | UpdateFormFieldDataAttributesValueKind if isinstance(_value_kind, Unset): value_kind = UNSET else: value_kind = check_update_form_field_data_attributes_value_kind(_value_kind) - def _parse_value_kind_catalog_id(data: object) -> Union[None, Unset, str]: + def _parse_value_kind_catalog_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) value_kind_catalog_id = _parse_value_kind_catalog_id(d.pop("value_kind_catalog_id", UNSET)) name = d.pop("name", UNSET) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) @@ -206,12 +206,12 @@ def _parse_description(data: object) -> Union[None, Unset, str]: default_values = cast(list[str], d.pop("default_values", UNSET)) - def _parse_auto_set_by_catalog_property_id(data: object) -> Union[None, Unset, str]: + def _parse_auto_set_by_catalog_property_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) auto_set_by_catalog_property_id = _parse_auto_set_by_catalog_property_id( d.pop("auto_set_by_catalog_property_id", UNSET) diff --git a/rootly_sdk/models/update_form_field_option_data_attributes.py b/rootly_sdk/models/update_form_field_option_data_attributes.py index df60aac8..592e45ed 100644 --- a/rootly_sdk/models/update_form_field_option_data_attributes.py +++ b/rootly_sdk/models/update_form_field_option_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define @@ -18,10 +18,10 @@ class UpdateFormFieldOptionDataAttributes: position (Union[Unset, int]): The position of the form field option """ - value: Union[Unset, str] = UNSET - color: Union[Unset, str] = UNSET - default: Union[Unset, bool] = UNSET - position: Union[Unset, int] = UNSET + value: Unset | str = UNSET + color: Unset | str = UNSET + default: Unset | bool = UNSET + position: Unset | int = UNSET def to_dict(self) -> dict[str, Any]: value = self.value diff --git a/rootly_sdk/models/update_form_field_placement_condition_data_attributes.py b/rootly_sdk/models/update_form_field_placement_condition_data_attributes.py index 659c18cb..f7498f29 100644 --- a/rootly_sdk/models/update_form_field_placement_condition_data_attributes.py +++ b/rootly_sdk/models/update_form_field_placement_condition_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -28,14 +28,14 @@ class UpdateFormFieldPlacementConditionDataAttributes: values (Union[Unset, list[str]]): The values for comparison. """ - conditioned: Union[Unset, UpdateFormFieldPlacementConditionDataAttributesConditioned] = UNSET - position: Union[Unset, int] = UNSET - form_field_id: Union[Unset, str] = UNSET - comparison: Union[Unset, UpdateFormFieldPlacementConditionDataAttributesComparison] = UNSET - values: Union[Unset, list[str]] = UNSET + conditioned: Unset | UpdateFormFieldPlacementConditionDataAttributesConditioned = UNSET + position: Unset | int = UNSET + form_field_id: Unset | str = UNSET + comparison: Unset | UpdateFormFieldPlacementConditionDataAttributesComparison = UNSET + values: Unset | list[str] = UNSET def to_dict(self) -> dict[str, Any]: - conditioned: Union[Unset, str] = UNSET + conditioned: Unset | str = UNSET if not isinstance(self.conditioned, Unset): conditioned = self.conditioned @@ -43,11 +43,11 @@ def to_dict(self) -> dict[str, Any]: form_field_id = self.form_field_id - comparison: Union[Unset, str] = UNSET + comparison: Unset | str = UNSET if not isinstance(self.comparison, Unset): comparison = self.comparison - values: Union[Unset, list[str]] = UNSET + values: Unset | list[str] = UNSET if not isinstance(self.values, Unset): values = self.values @@ -71,7 +71,7 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _conditioned = d.pop("conditioned", UNSET) - conditioned: Union[Unset, UpdateFormFieldPlacementConditionDataAttributesConditioned] + conditioned: Unset | UpdateFormFieldPlacementConditionDataAttributesConditioned if isinstance(_conditioned, Unset): conditioned = UNSET else: @@ -82,7 +82,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: form_field_id = d.pop("form_field_id", UNSET) _comparison = d.pop("comparison", UNSET) - comparison: Union[Unset, UpdateFormFieldPlacementConditionDataAttributesComparison] + comparison: Unset | UpdateFormFieldPlacementConditionDataAttributesComparison if isinstance(_comparison, Unset): comparison = UNSET else: diff --git a/rootly_sdk/models/update_form_field_placement_data_attributes.py b/rootly_sdk/models/update_form_field_placement_data_attributes.py index 3b0c18b3..ab3ed2c6 100644 --- a/rootly_sdk/models/update_form_field_placement_data_attributes.py +++ b/rootly_sdk/models/update_form_field_placement_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define @@ -32,13 +32,13 @@ class UpdateFormFieldPlacementDataAttributes: non_editable (Union[Unset, bool]): Whether the field is read-only and cannot be edited by users. """ - form_set_id: Union[Unset, str] = UNSET - form: Union[Unset, str] = UNSET - position: Union[Unset, int] = UNSET - required: Union[Unset, bool] = UNSET - required_operator: Union[Unset, UpdateFormFieldPlacementDataAttributesRequiredOperator] = UNSET - placement_operator: Union[Unset, UpdateFormFieldPlacementDataAttributesPlacementOperator] = UNSET - non_editable: Union[Unset, bool] = UNSET + form_set_id: Unset | str = UNSET + form: Unset | str = UNSET + position: Unset | int = UNSET + required: Unset | bool = UNSET + required_operator: Unset | UpdateFormFieldPlacementDataAttributesRequiredOperator = UNSET + placement_operator: Unset | UpdateFormFieldPlacementDataAttributesPlacementOperator = UNSET + non_editable: Unset | bool = UNSET def to_dict(self) -> dict[str, Any]: form_set_id = self.form_set_id @@ -49,11 +49,11 @@ def to_dict(self) -> dict[str, Any]: required = self.required - required_operator: Union[Unset, str] = UNSET + required_operator: Unset | str = UNSET if not isinstance(self.required_operator, Unset): required_operator = self.required_operator - placement_operator: Union[Unset, str] = UNSET + placement_operator: Unset | str = UNSET if not isinstance(self.placement_operator, Unset): placement_operator = self.placement_operator @@ -91,14 +91,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: required = d.pop("required", UNSET) _required_operator = d.pop("required_operator", UNSET) - required_operator: Union[Unset, UpdateFormFieldPlacementDataAttributesRequiredOperator] + required_operator: Unset | UpdateFormFieldPlacementDataAttributesRequiredOperator if isinstance(_required_operator, Unset): required_operator = UNSET else: required_operator = check_update_form_field_placement_data_attributes_required_operator(_required_operator) _placement_operator = d.pop("placement_operator", UNSET) - placement_operator: Union[Unset, UpdateFormFieldPlacementDataAttributesPlacementOperator] + placement_operator: Unset | UpdateFormFieldPlacementDataAttributesPlacementOperator if isinstance(_placement_operator, Unset): placement_operator = UNSET else: diff --git a/rootly_sdk/models/update_form_field_position_data_attributes.py b/rootly_sdk/models/update_form_field_position_data_attributes.py index dd6bde48..11487ec7 100644 --- a/rootly_sdk/models/update_form_field_position_data_attributes.py +++ b/rootly_sdk/models/update_form_field_position_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define @@ -21,14 +21,14 @@ class UpdateFormFieldPositionDataAttributes: position (Union[Unset, int]): The position of the form_field_position """ - form_field_id: Union[Unset, str] = UNSET - form: Union[Unset, UpdateFormFieldPositionDataAttributesForm] = UNSET - position: Union[Unset, int] = UNSET + form_field_id: Unset | str = UNSET + form: Unset | UpdateFormFieldPositionDataAttributesForm = UNSET + position: Unset | int = UNSET def to_dict(self) -> dict[str, Any]: form_field_id = self.form_field_id - form: Union[Unset, str] = UNSET + form: Unset | str = UNSET if not isinstance(self.form, Unset): form = self.form @@ -52,7 +52,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: form_field_id = d.pop("form_field_id", UNSET) _form = d.pop("form", UNSET) - form: Union[Unset, UpdateFormFieldPositionDataAttributesForm] + form: Unset | UpdateFormFieldPositionDataAttributesForm if isinstance(_form, Unset): form = UNSET else: diff --git a/rootly_sdk/models/update_form_set_condition_data_attributes.py b/rootly_sdk/models/update_form_set_condition_data_attributes.py index 545896d3..6a6f053b 100644 --- a/rootly_sdk/models/update_form_set_condition_data_attributes.py +++ b/rootly_sdk/models/update_form_set_condition_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -21,18 +21,18 @@ class UpdateFormSetConditionDataAttributes: values (Union[Unset, list[str]]): The values for comparison. """ - form_field_id: Union[Unset, str] = UNSET - comparison: Union[Unset, UpdateFormSetConditionDataAttributesComparison] = UNSET - values: Union[Unset, list[str]] = UNSET + form_field_id: Unset | str = UNSET + comparison: Unset | UpdateFormSetConditionDataAttributesComparison = UNSET + values: Unset | list[str] = UNSET def to_dict(self) -> dict[str, Any]: form_field_id = self.form_field_id - comparison: Union[Unset, str] = UNSET + comparison: Unset | str = UNSET if not isinstance(self.comparison, Unset): comparison = self.comparison - values: Union[Unset, list[str]] = UNSET + values: Unset | list[str] = UNSET if not isinstance(self.values, Unset): values = self.values @@ -54,7 +54,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: form_field_id = d.pop("form_field_id", UNSET) _comparison = d.pop("comparison", UNSET) - comparison: Union[Unset, UpdateFormSetConditionDataAttributesComparison] + comparison: Unset | UpdateFormSetConditionDataAttributesComparison if isinstance(_comparison, Unset): comparison = UNSET else: diff --git a/rootly_sdk/models/update_form_set_data_attributes.py b/rootly_sdk/models/update_form_set_data_attributes.py index 08c9e121..e9bc5ab6 100644 --- a/rootly_sdk/models/update_form_set_data_attributes.py +++ b/rootly_sdk/models/update_form_set_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -25,12 +25,12 @@ class UpdateFormSetDataAttributes: `google_chat_update_incident_form`, `microsoft_teams_new_incident_form` """ - slug: Union[None, Unset, str] = UNSET - name: Union[Unset, str] = UNSET - forms: Union[Unset, list[str]] = UNSET + slug: None | Unset | str = UNSET + name: Unset | str = UNSET + forms: Unset | list[str] = UNSET def to_dict(self) -> dict[str, Any]: - slug: Union[None, Unset, str] + slug: None | Unset | str if isinstance(self.slug, Unset): slug = UNSET else: @@ -38,7 +38,7 @@ def to_dict(self) -> dict[str, Any]: name = self.name - forms: Union[Unset, list[str]] = UNSET + forms: Unset | list[str] = UNSET if not isinstance(self.forms, Unset): forms = self.forms @@ -58,12 +58,12 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_slug(data: object) -> Union[None, Unset, str]: + def _parse_slug(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) slug = _parse_slug(d.pop("slug", UNSET)) diff --git a/rootly_sdk/models/update_functionality_data_attributes.py b/rootly_sdk/models/update_functionality_data_attributes.py index b430ee6d..81ef1a0e 100644 --- a/rootly_sdk/models/update_functionality_data_attributes.py +++ b/rootly_sdk/models/update_functionality_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define @@ -55,31 +55,31 @@ class UpdateFunctionalityDataAttributes: this functionality. """ - slug: Union[None, Unset, str] = UNSET - name: Union[Unset, str] = UNSET - description: Union[None, Unset, str] = UNSET - public_description: Union[None, Unset, str] = UNSET - notify_emails: Union[None, Unset, list[str]] = UNSET - color: Union[None, Unset, str] = UNSET - position: Union[None, Unset, int] = UNSET - backstage_id: Union[None, Unset, str] = UNSET - external_id: Union[None, Unset, str] = UNSET - pagerduty_id: Union[None, Unset, str] = UNSET - opsgenie_id: Union[None, Unset, str] = UNSET - opsgenie_team_id: Union[None, Unset, str] = UNSET - cortex_id: Union[None, Unset, str] = UNSET - service_now_ci_sys_id: Union[None, Unset, str] = UNSET - environment_ids: Union[None, Unset, list[str]] = UNSET - service_ids: Union[None, Unset, list[str]] = UNSET - owner_group_ids: Union[None, Unset, list[str]] = UNSET - owner_user_ids: Union[None, Unset, list[int]] = UNSET - escalation_policy_id: Union[None, Unset, str] = UNSET - slack_channels: Union[None, Unset, list["UpdateFunctionalityDataAttributesSlackChannelsType0Item"]] = UNSET - slack_aliases: Union[None, Unset, list["UpdateFunctionalityDataAttributesSlackAliasesType0Item"]] = UNSET - properties: Union[Unset, list["UpdateFunctionalityDataAttributesPropertiesItem"]] = UNSET + slug: None | Unset | str = UNSET + name: Unset | str = UNSET + description: None | Unset | str = UNSET + public_description: None | Unset | str = UNSET + notify_emails: None | Unset | list[str] = UNSET + color: None | Unset | str = UNSET + position: None | Unset | int = UNSET + backstage_id: None | Unset | str = UNSET + external_id: None | Unset | str = UNSET + pagerduty_id: None | Unset | str = UNSET + opsgenie_id: None | Unset | str = UNSET + opsgenie_team_id: None | Unset | str = UNSET + cortex_id: None | Unset | str = UNSET + service_now_ci_sys_id: None | Unset | str = UNSET + environment_ids: None | Unset | list[str] = UNSET + service_ids: None | Unset | list[str] = UNSET + owner_group_ids: None | Unset | list[str] = UNSET + owner_user_ids: None | Unset | list[int] = UNSET + escalation_policy_id: None | Unset | str = UNSET + slack_channels: None | Unset | list["UpdateFunctionalityDataAttributesSlackChannelsType0Item"] = UNSET + slack_aliases: None | Unset | list["UpdateFunctionalityDataAttributesSlackAliasesType0Item"] = UNSET + properties: Unset | list["UpdateFunctionalityDataAttributesPropertiesItem"] = UNSET def to_dict(self) -> dict[str, Any]: - slug: Union[None, Unset, str] + slug: None | Unset | str if isinstance(self.slug, Unset): slug = UNSET else: @@ -87,19 +87,19 @@ def to_dict(self) -> dict[str, Any]: name = self.name - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - public_description: Union[None, Unset, str] + public_description: None | Unset | str if isinstance(self.public_description, Unset): public_description = UNSET else: public_description = self.public_description - notify_emails: Union[None, Unset, list[str]] + notify_emails: None | Unset | list[str] if isinstance(self.notify_emails, Unset): notify_emails = UNSET elif isinstance(self.notify_emails, list): @@ -108,61 +108,61 @@ def to_dict(self) -> dict[str, Any]: else: notify_emails = self.notify_emails - color: Union[None, Unset, str] + color: None | Unset | str if isinstance(self.color, Unset): color = UNSET else: color = self.color - position: Union[None, Unset, int] + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: position = self.position - backstage_id: Union[None, Unset, str] + backstage_id: None | Unset | str if isinstance(self.backstage_id, Unset): backstage_id = UNSET else: backstage_id = self.backstage_id - external_id: Union[None, Unset, str] + external_id: None | Unset | str if isinstance(self.external_id, Unset): external_id = UNSET else: external_id = self.external_id - pagerduty_id: Union[None, Unset, str] + pagerduty_id: None | Unset | str if isinstance(self.pagerduty_id, Unset): pagerduty_id = UNSET else: pagerduty_id = self.pagerduty_id - opsgenie_id: Union[None, Unset, str] + opsgenie_id: None | Unset | str if isinstance(self.opsgenie_id, Unset): opsgenie_id = UNSET else: opsgenie_id = self.opsgenie_id - opsgenie_team_id: Union[None, Unset, str] + opsgenie_team_id: None | Unset | str if isinstance(self.opsgenie_team_id, Unset): opsgenie_team_id = UNSET else: opsgenie_team_id = self.opsgenie_team_id - cortex_id: Union[None, Unset, str] + cortex_id: None | Unset | str if isinstance(self.cortex_id, Unset): cortex_id = UNSET else: cortex_id = self.cortex_id - service_now_ci_sys_id: Union[None, Unset, str] + service_now_ci_sys_id: None | Unset | str if isinstance(self.service_now_ci_sys_id, Unset): service_now_ci_sys_id = UNSET else: service_now_ci_sys_id = self.service_now_ci_sys_id - environment_ids: Union[None, Unset, list[str]] + environment_ids: None | Unset | list[str] if isinstance(self.environment_ids, Unset): environment_ids = UNSET elif isinstance(self.environment_ids, list): @@ -171,7 +171,7 @@ def to_dict(self) -> dict[str, Any]: else: environment_ids = self.environment_ids - service_ids: Union[None, Unset, list[str]] + service_ids: None | Unset | list[str] if isinstance(self.service_ids, Unset): service_ids = UNSET elif isinstance(self.service_ids, list): @@ -180,7 +180,7 @@ def to_dict(self) -> dict[str, Any]: else: service_ids = self.service_ids - owner_group_ids: Union[None, Unset, list[str]] + owner_group_ids: None | Unset | list[str] if isinstance(self.owner_group_ids, Unset): owner_group_ids = UNSET elif isinstance(self.owner_group_ids, list): @@ -189,7 +189,7 @@ def to_dict(self) -> dict[str, Any]: else: owner_group_ids = self.owner_group_ids - owner_user_ids: Union[None, Unset, list[int]] + owner_user_ids: None | Unset | list[int] if isinstance(self.owner_user_ids, Unset): owner_user_ids = UNSET elif isinstance(self.owner_user_ids, list): @@ -198,13 +198,13 @@ def to_dict(self) -> dict[str, Any]: else: owner_user_ids = self.owner_user_ids - escalation_policy_id: Union[None, Unset, str] + escalation_policy_id: None | Unset | str if isinstance(self.escalation_policy_id, Unset): escalation_policy_id = UNSET else: escalation_policy_id = self.escalation_policy_id - slack_channels: Union[None, Unset, list[dict[str, Any]]] + slack_channels: None | Unset | list[dict[str, Any]] if isinstance(self.slack_channels, Unset): slack_channels = UNSET elif isinstance(self.slack_channels, list): @@ -216,7 +216,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_channels = self.slack_channels - slack_aliases: Union[None, Unset, list[dict[str, Any]]] + slack_aliases: None | Unset | list[dict[str, Any]] if isinstance(self.slack_aliases, Unset): slack_aliases = UNSET elif isinstance(self.slack_aliases, list): @@ -228,7 +228,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_aliases = self.slack_aliases - properties: Union[Unset, list[dict[str, Any]]] = UNSET + properties: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.properties, Unset): properties = [] for properties_item_data in self.properties: @@ -299,36 +299,36 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_slug(data: object) -> Union[None, Unset, str]: + def _parse_slug(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) slug = _parse_slug(d.pop("slug", UNSET)) name = d.pop("name", UNSET) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_public_description(data: object) -> Union[None, Unset, str]: + def _parse_public_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) public_description = _parse_public_description(d.pop("public_description", UNSET)) - def _parse_notify_emails(data: object) -> Union[None, Unset, list[str]]: + def _parse_notify_emails(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -341,92 +341,92 @@ def _parse_notify_emails(data: object) -> Union[None, Unset, list[str]]: return notify_emails_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) notify_emails = _parse_notify_emails(d.pop("notify_emails", UNSET)) - def _parse_color(data: object) -> Union[None, Unset, str]: + def _parse_color(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) color = _parse_color(d.pop("color", UNSET)) - def _parse_position(data: object) -> Union[None, Unset, int]: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) - def _parse_backstage_id(data: object) -> Union[None, Unset, str]: + def _parse_backstage_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) backstage_id = _parse_backstage_id(d.pop("backstage_id", UNSET)) - def _parse_external_id(data: object) -> Union[None, Unset, str]: + def _parse_external_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) external_id = _parse_external_id(d.pop("external_id", UNSET)) - def _parse_pagerduty_id(data: object) -> Union[None, Unset, str]: + def _parse_pagerduty_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) pagerduty_id = _parse_pagerduty_id(d.pop("pagerduty_id", UNSET)) - def _parse_opsgenie_id(data: object) -> Union[None, Unset, str]: + def _parse_opsgenie_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) opsgenie_id = _parse_opsgenie_id(d.pop("opsgenie_id", UNSET)) - def _parse_opsgenie_team_id(data: object) -> Union[None, Unset, str]: + def _parse_opsgenie_team_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) opsgenie_team_id = _parse_opsgenie_team_id(d.pop("opsgenie_team_id", UNSET)) - def _parse_cortex_id(data: object) -> Union[None, Unset, str]: + def _parse_cortex_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) cortex_id = _parse_cortex_id(d.pop("cortex_id", UNSET)) - def _parse_service_now_ci_sys_id(data: object) -> Union[None, Unset, str]: + def _parse_service_now_ci_sys_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) service_now_ci_sys_id = _parse_service_now_ci_sys_id(d.pop("service_now_ci_sys_id", UNSET)) - def _parse_environment_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_environment_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -439,11 +439,11 @@ def _parse_environment_ids(data: object) -> Union[None, Unset, list[str]]: return environment_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) environment_ids = _parse_environment_ids(d.pop("environment_ids", UNSET)) - def _parse_service_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_service_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -456,11 +456,11 @@ def _parse_service_ids(data: object) -> Union[None, Unset, list[str]]: return service_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) service_ids = _parse_service_ids(d.pop("service_ids", UNSET)) - def _parse_owner_group_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_owner_group_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -473,11 +473,11 @@ def _parse_owner_group_ids(data: object) -> Union[None, Unset, list[str]]: return owner_group_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) owner_group_ids = _parse_owner_group_ids(d.pop("owner_group_ids", UNSET)) - def _parse_owner_user_ids(data: object) -> Union[None, Unset, list[int]]: + def _parse_owner_user_ids(data: object) -> None | Unset | list[int]: if data is None: return data if isinstance(data, Unset): @@ -490,22 +490,22 @@ def _parse_owner_user_ids(data: object) -> Union[None, Unset, list[int]]: return owner_user_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[int]], data) + return cast(None | Unset | list[int], data) owner_user_ids = _parse_owner_user_ids(d.pop("owner_user_ids", UNSET)) - def _parse_escalation_policy_id(data: object) -> Union[None, Unset, str]: + def _parse_escalation_policy_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) escalation_policy_id = _parse_escalation_policy_id(d.pop("escalation_policy_id", UNSET)) def _parse_slack_channels( data: object, - ) -> Union[None, Unset, list["UpdateFunctionalityDataAttributesSlackChannelsType0Item"]]: + ) -> None | Unset | list["UpdateFunctionalityDataAttributesSlackChannelsType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -525,13 +525,13 @@ def _parse_slack_channels( return slack_channels_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list["UpdateFunctionalityDataAttributesSlackChannelsType0Item"]], data) + return cast(None | Unset | list["UpdateFunctionalityDataAttributesSlackChannelsType0Item"], data) slack_channels = _parse_slack_channels(d.pop("slack_channels", UNSET)) def _parse_slack_aliases( data: object, - ) -> Union[None, Unset, list["UpdateFunctionalityDataAttributesSlackAliasesType0Item"]]: + ) -> None | Unset | list["UpdateFunctionalityDataAttributesSlackAliasesType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -551,7 +551,7 @@ def _parse_slack_aliases( return slack_aliases_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list["UpdateFunctionalityDataAttributesSlackAliasesType0Item"]], data) + return cast(None | Unset | list["UpdateFunctionalityDataAttributesSlackAliasesType0Item"], data) slack_aliases = _parse_slack_aliases(d.pop("slack_aliases", UNSET)) diff --git a/rootly_sdk/models/update_github_issue_task_params.py b/rootly_sdk/models/update_github_issue_task_params.py index 395aa88c..1bd52cf9 100644 --- a/rootly_sdk/models/update_github_issue_task_params.py +++ b/rootly_sdk/models/update_github_issue_task_params.py @@ -45,14 +45,14 @@ class UpdateGithubIssueTaskParams: issue_id: str completion: "UpdateGithubIssueTaskParamsCompletion" - task_type: Union[Unset, UpdateGithubIssueTaskParamsTaskType] = UNSET + task_type: Unset | UpdateGithubIssueTaskParamsTaskType = UNSET repository: Union[Unset, "UpdateGithubIssueTaskParamsRepository"] = UNSET - title: Union[Unset, str] = UNSET - body: Union[Unset, str] = UNSET - labels: Union[Unset, list["UpdateGithubIssueTaskParamsLabelsItem"]] = UNSET - labels_mode: Union[Unset, UpdateGithubIssueTaskParamsLabelsMode] = "replace" + title: Unset | str = UNSET + body: Unset | str = UNSET + labels: Unset | list["UpdateGithubIssueTaskParamsLabelsItem"] = UNSET + labels_mode: Unset | UpdateGithubIssueTaskParamsLabelsMode = "replace" issue_type: Union[Unset, "UpdateGithubIssueTaskParamsIssueType"] = UNSET - custom_fields_mapping: Union[None, Unset, str] = UNSET + custom_fields_mapping: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -60,11 +60,11 @@ def to_dict(self) -> dict[str, Any]: completion = self.completion.to_dict() - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - repository: Union[Unset, dict[str, Any]] = UNSET + repository: Unset | dict[str, Any] = UNSET if not isinstance(self.repository, Unset): repository = self.repository.to_dict() @@ -72,22 +72,22 @@ def to_dict(self) -> dict[str, Any]: body = self.body - labels: Union[Unset, list[dict[str, Any]]] = UNSET + labels: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.labels, Unset): labels = [] for labels_item_data in self.labels: labels_item = labels_item_data.to_dict() labels.append(labels_item) - labels_mode: Union[Unset, str] = UNSET + labels_mode: Unset | str = UNSET if not isinstance(self.labels_mode, Unset): labels_mode = self.labels_mode - issue_type: Union[Unset, dict[str, Any]] = UNSET + issue_type: Unset | dict[str, Any] = UNSET if not isinstance(self.issue_type, Unset): issue_type = self.issue_type.to_dict() - custom_fields_mapping: Union[None, Unset, str] + custom_fields_mapping: None | Unset | str if isinstance(self.custom_fields_mapping, Unset): custom_fields_mapping = UNSET else: @@ -133,14 +133,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: completion = UpdateGithubIssueTaskParamsCompletion.from_dict(d.pop("completion")) _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, UpdateGithubIssueTaskParamsTaskType] + task_type: Unset | UpdateGithubIssueTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: task_type = check_update_github_issue_task_params_task_type(_task_type) _repository = d.pop("repository", UNSET) - repository: Union[Unset, UpdateGithubIssueTaskParamsRepository] + repository: Unset | UpdateGithubIssueTaskParamsRepository if isinstance(_repository, Unset): repository = UNSET else: @@ -158,25 +158,25 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: labels.append(labels_item) _labels_mode = d.pop("labels_mode", UNSET) - labels_mode: Union[Unset, UpdateGithubIssueTaskParamsLabelsMode] + labels_mode: Unset | UpdateGithubIssueTaskParamsLabelsMode if isinstance(_labels_mode, Unset): labels_mode = UNSET else: labels_mode = check_update_github_issue_task_params_labels_mode(_labels_mode) _issue_type = d.pop("issue_type", UNSET) - issue_type: Union[Unset, UpdateGithubIssueTaskParamsIssueType] + issue_type: Unset | UpdateGithubIssueTaskParamsIssueType if isinstance(_issue_type, Unset): issue_type = UNSET else: issue_type = UpdateGithubIssueTaskParamsIssueType.from_dict(_issue_type) - def _parse_custom_fields_mapping(data: object) -> Union[None, Unset, str]: + def _parse_custom_fields_mapping(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) custom_fields_mapping = _parse_custom_fields_mapping(d.pop("custom_fields_mapping", UNSET)) diff --git a/rootly_sdk/models/update_github_issue_task_params_completion.py b/rootly_sdk/models/update_github_issue_task_params_completion.py index 80c76623..003e9917 100644 --- a/rootly_sdk/models/update_github_issue_task_params_completion.py +++ b/rootly_sdk/models/update_github_issue_task_params_completion.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class UpdateGithubIssueTaskParamsCompletion: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_github_issue_task_params_issue_type.py b/rootly_sdk/models/update_github_issue_task_params_issue_type.py index d9154a54..70e2dbaa 100644 --- a/rootly_sdk/models/update_github_issue_task_params_issue_type.py +++ b/rootly_sdk/models/update_github_issue_task_params_issue_type.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -18,8 +18,8 @@ class UpdateGithubIssueTaskParamsIssueType: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_github_issue_task_params_labels_item.py b/rootly_sdk/models/update_github_issue_task_params_labels_item.py index 0b7e2859..913a6763 100644 --- a/rootly_sdk/models/update_github_issue_task_params_labels_item.py +++ b/rootly_sdk/models/update_github_issue_task_params_labels_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class UpdateGithubIssueTaskParamsLabelsItem: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_github_issue_task_params_repository.py b/rootly_sdk/models/update_github_issue_task_params_repository.py index 9d732125..1d2587b7 100644 --- a/rootly_sdk/models/update_github_issue_task_params_repository.py +++ b/rootly_sdk/models/update_github_issue_task_params_repository.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -18,8 +18,8 @@ class UpdateGithubIssueTaskParamsRepository: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_gitlab_issue_task_params.py b/rootly_sdk/models/update_gitlab_issue_task_params.py index d6915d5f..691d232a 100644 --- a/rootly_sdk/models/update_gitlab_issue_task_params.py +++ b/rootly_sdk/models/update_gitlab_issue_task_params.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -37,12 +37,12 @@ class UpdateGitlabIssueTaskParams: issue_id: str completion: "UpdateGitlabIssueTaskParamsCompletion" - task_type: Union[Unset, UpdateGitlabIssueTaskParamsTaskType] = UNSET - issue_type: Union[Unset, UpdateGitlabIssueTaskParamsIssueType] = UNSET - title: Union[Unset, str] = UNSET - description: Union[Unset, str] = UNSET - labels: Union[Unset, str] = UNSET - due_date: Union[Unset, str] = UNSET + task_type: Unset | UpdateGitlabIssueTaskParamsTaskType = UNSET + issue_type: Unset | UpdateGitlabIssueTaskParamsIssueType = UNSET + title: Unset | str = UNSET + description: Unset | str = UNSET + labels: Unset | str = UNSET + due_date: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -50,11 +50,11 @@ def to_dict(self) -> dict[str, Any]: completion = self.completion.to_dict() - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - issue_type: Union[Unset, str] = UNSET + issue_type: Unset | str = UNSET if not isinstance(self.issue_type, Unset): issue_type = self.issue_type @@ -99,14 +99,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: completion = UpdateGitlabIssueTaskParamsCompletion.from_dict(d.pop("completion")) _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, UpdateGitlabIssueTaskParamsTaskType] + task_type: Unset | UpdateGitlabIssueTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: task_type = check_update_gitlab_issue_task_params_task_type(_task_type) _issue_type = d.pop("issue_type", UNSET) - issue_type: Union[Unset, UpdateGitlabIssueTaskParamsIssueType] + issue_type: Unset | UpdateGitlabIssueTaskParamsIssueType if isinstance(_issue_type, Unset): issue_type = UNSET else: diff --git a/rootly_sdk/models/update_gitlab_issue_task_params_completion.py b/rootly_sdk/models/update_gitlab_issue_task_params_completion.py index 0dab22ae..c563e990 100644 --- a/rootly_sdk/models/update_gitlab_issue_task_params_completion.py +++ b/rootly_sdk/models/update_gitlab_issue_task_params_completion.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class UpdateGitlabIssueTaskParamsCompletion: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_google_calendar_event_task_params.py b/rootly_sdk/models/update_google_calendar_event_task_params.py index 1131111d..81eeceb0 100644 --- a/rootly_sdk/models/update_google_calendar_event_task_params.py +++ b/rootly_sdk/models/update_google_calendar_event_task_params.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -48,32 +48,32 @@ class UpdateGoogleCalendarEventTaskParams: """ event_id: str - task_type: Union[Unset, UpdateGoogleCalendarEventTaskParamsTaskType] = UNSET - calendar_id: Union[None, Unset, str] = "primary" - summary: Union[Unset, str] = UNSET - description: Union[Unset, str] = UNSET - adjustment_days: Union[Unset, int] = UNSET - time_of_meeting: Union[Unset, str] = UNSET - meeting_duration: Union[Unset, str] = UNSET - send_updates: Union[Unset, bool] = UNSET - can_guests_modify_event: Union[Unset, bool] = UNSET - can_guests_see_other_guests: Union[Unset, bool] = UNSET - can_guests_invite_others: Union[Unset, bool] = UNSET - attendees: Union[Unset, list[str]] = UNSET - replace_attendees: Union[Unset, bool] = UNSET - conference_solution_key: Union[Unset, UpdateGoogleCalendarEventTaskParamsConferenceSolutionKey] = UNSET - post_to_incident_timeline: Union[Unset, bool] = UNSET - post_to_slack_channels: Union[Unset, list["UpdateGoogleCalendarEventTaskParamsPostToSlackChannelsItem"]] = UNSET + task_type: Unset | UpdateGoogleCalendarEventTaskParamsTaskType = UNSET + calendar_id: None | Unset | str = "primary" + summary: Unset | str = UNSET + description: Unset | str = UNSET + adjustment_days: Unset | int = UNSET + time_of_meeting: Unset | str = UNSET + meeting_duration: Unset | str = UNSET + send_updates: Unset | bool = UNSET + can_guests_modify_event: Unset | bool = UNSET + can_guests_see_other_guests: Unset | bool = UNSET + can_guests_invite_others: Unset | bool = UNSET + attendees: Unset | list[str] = UNSET + replace_attendees: Unset | bool = UNSET + conference_solution_key: Unset | UpdateGoogleCalendarEventTaskParamsConferenceSolutionKey = UNSET + post_to_incident_timeline: Unset | bool = UNSET + post_to_slack_channels: Unset | list["UpdateGoogleCalendarEventTaskParamsPostToSlackChannelsItem"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: event_id = self.event_id - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - calendar_id: Union[None, Unset, str] + calendar_id: None | Unset | str if isinstance(self.calendar_id, Unset): calendar_id = UNSET else: @@ -97,19 +97,19 @@ def to_dict(self) -> dict[str, Any]: can_guests_invite_others = self.can_guests_invite_others - attendees: Union[Unset, list[str]] = UNSET + attendees: Unset | list[str] = UNSET if not isinstance(self.attendees, Unset): attendees = self.attendees replace_attendees = self.replace_attendees - conference_solution_key: Union[Unset, str] = UNSET + conference_solution_key: Unset | str = UNSET if not isinstance(self.conference_solution_key, Unset): conference_solution_key = self.conference_solution_key post_to_incident_timeline = self.post_to_incident_timeline - post_to_slack_channels: Union[Unset, list[dict[str, Any]]] = UNSET + post_to_slack_channels: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.post_to_slack_channels, Unset): post_to_slack_channels = [] for post_to_slack_channels_item_data in self.post_to_slack_channels: @@ -168,18 +168,18 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: event_id = d.pop("event_id") _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, UpdateGoogleCalendarEventTaskParamsTaskType] + task_type: Unset | UpdateGoogleCalendarEventTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: task_type = check_update_google_calendar_event_task_params_task_type(_task_type) - def _parse_calendar_id(data: object) -> Union[None, Unset, str]: + def _parse_calendar_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) calendar_id = _parse_calendar_id(d.pop("calendar_id", UNSET)) @@ -206,7 +206,7 @@ def _parse_calendar_id(data: object) -> Union[None, Unset, str]: replace_attendees = d.pop("replace_attendees", UNSET) _conference_solution_key = d.pop("conference_solution_key", UNSET) - conference_solution_key: Union[Unset, UpdateGoogleCalendarEventTaskParamsConferenceSolutionKey] + conference_solution_key: Unset | UpdateGoogleCalendarEventTaskParamsConferenceSolutionKey if isinstance(_conference_solution_key, Unset): conference_solution_key = UNSET else: diff --git a/rootly_sdk/models/update_google_calendar_event_task_params_post_to_slack_channels_item.py b/rootly_sdk/models/update_google_calendar_event_task_params_post_to_slack_channels_item.py index 77f62cdf..e92620d2 100644 --- a/rootly_sdk/models/update_google_calendar_event_task_params_post_to_slack_channels_item.py +++ b/rootly_sdk/models/update_google_calendar_event_task_params_post_to_slack_channels_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class UpdateGoogleCalendarEventTaskParamsPostToSlackChannelsItem: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_google_chat_space_description_task_params.py b/rootly_sdk/models/update_google_chat_space_description_task_params.py index d16fd40a..9e20b3d5 100644 --- a/rootly_sdk/models/update_google_chat_space_description_task_params.py +++ b/rootly_sdk/models/update_google_chat_space_description_task_params.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -30,7 +30,7 @@ class UpdateGoogleChatSpaceDescriptionTaskParams: space: "UpdateGoogleChatSpaceDescriptionTaskParamsSpace" description: str - task_type: Union[Unset, UpdateGoogleChatSpaceDescriptionTaskParamsTaskType] = UNSET + task_type: Unset | UpdateGoogleChatSpaceDescriptionTaskParamsTaskType = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -38,7 +38,7 @@ def to_dict(self) -> dict[str, Any]: description = self.description - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -67,7 +67,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: description = d.pop("description") _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, UpdateGoogleChatSpaceDescriptionTaskParamsTaskType] + task_type: Unset | UpdateGoogleChatSpaceDescriptionTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/update_google_chat_space_description_task_params_space.py b/rootly_sdk/models/update_google_chat_space_description_task_params_space.py index 19d7fa6e..ca1a54af 100644 --- a/rootly_sdk/models/update_google_chat_space_description_task_params_space.py +++ b/rootly_sdk/models/update_google_chat_space_description_task_params_space.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class UpdateGoogleChatSpaceDescriptionTaskParamsSpace: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_google_docs_page_task_params.py b/rootly_sdk/models/update_google_docs_page_task_params.py index 07521363..adc6e256 100644 --- a/rootly_sdk/models/update_google_docs_page_task_params.py +++ b/rootly_sdk/models/update_google_docs_page_task_params.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,20 +29,20 @@ class UpdateGoogleDocsPageTaskParams: """ file_id: str - task_type: Union[Unset, UpdateGoogleDocsPageTaskParamsTaskType] = UNSET - title: Union[Unset, str] = UNSET - content: Union[Unset, str] = UNSET - post_mortem_template_id: Union[Unset, str] = UNSET - template_id: Union[Unset, str] = UNSET - include_overview: Union[Unset, bool] = True - include_timeline: Union[Unset, bool] = True - include_follow_ups: Union[Unset, bool] = True + task_type: Unset | UpdateGoogleDocsPageTaskParamsTaskType = UNSET + title: Unset | str = UNSET + content: Unset | str = UNSET + post_mortem_template_id: Unset | str = UNSET + template_id: Unset | str = UNSET + include_overview: Unset | bool = True + include_timeline: Unset | bool = True + include_follow_ups: Unset | bool = True additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: file_id = self.file_id - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -92,7 +92,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: file_id = d.pop("file_id") _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, UpdateGoogleDocsPageTaskParamsTaskType] + task_type: Unset | UpdateGoogleDocsPageTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/update_heartbeat_data_attributes.py b/rootly_sdk/models/update_heartbeat_data_attributes.py index f2792b39..e605b3c1 100644 --- a/rootly_sdk/models/update_heartbeat_data_attributes.py +++ b/rootly_sdk/models/update_heartbeat_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -34,22 +34,22 @@ class UpdateHeartbeatDataAttributes: enabled (Union[Unset, bool]): Whether to trigger alerts when heartbeat is expired. """ - name: Union[Unset, str] = UNSET - description: Union[None, Unset, str] = UNSET - alert_summary: Union[Unset, str] = UNSET - alert_description: Union[None, Unset, str] = UNSET - alert_urgency_id: Union[None, Unset, str] = UNSET - interval: Union[Unset, int] = UNSET - interval_unit: Union[Unset, UpdateHeartbeatDataAttributesIntervalUnit] = UNSET - notification_target_id: Union[Unset, str] = UNSET - notification_target_type: Union[Unset, UpdateHeartbeatDataAttributesNotificationTargetType] = UNSET - owner_group_ids: Union[Unset, list[str]] = UNSET - enabled: Union[Unset, bool] = UNSET + name: Unset | str = UNSET + description: None | Unset | str = UNSET + alert_summary: Unset | str = UNSET + alert_description: None | Unset | str = UNSET + alert_urgency_id: None | Unset | str = UNSET + interval: Unset | int = UNSET + interval_unit: Unset | UpdateHeartbeatDataAttributesIntervalUnit = UNSET + notification_target_id: Unset | str = UNSET + notification_target_type: Unset | UpdateHeartbeatDataAttributesNotificationTargetType = UNSET + owner_group_ids: Unset | list[str] = UNSET + enabled: Unset | bool = UNSET def to_dict(self) -> dict[str, Any]: name = self.name - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: @@ -57,13 +57,13 @@ def to_dict(self) -> dict[str, Any]: alert_summary = self.alert_summary - alert_description: Union[None, Unset, str] + alert_description: None | Unset | str if isinstance(self.alert_description, Unset): alert_description = UNSET else: alert_description = self.alert_description - alert_urgency_id: Union[None, Unset, str] + alert_urgency_id: None | Unset | str if isinstance(self.alert_urgency_id, Unset): alert_urgency_id = UNSET else: @@ -71,17 +71,17 @@ def to_dict(self) -> dict[str, Any]: interval = self.interval - interval_unit: Union[Unset, str] = UNSET + interval_unit: Unset | str = UNSET if not isinstance(self.interval_unit, Unset): interval_unit = self.interval_unit notification_target_id = self.notification_target_id - notification_target_type: Union[Unset, str] = UNSET + notification_target_type: Unset | str = UNSET if not isinstance(self.notification_target_type, Unset): notification_target_type = self.notification_target_type - owner_group_ids: Union[Unset, list[str]] = UNSET + owner_group_ids: Unset | list[str] = UNSET if not isinstance(self.owner_group_ids, Unset): owner_group_ids = self.owner_group_ids @@ -120,39 +120,39 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name", UNSET) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) alert_summary = d.pop("alert_summary", UNSET) - def _parse_alert_description(data: object) -> Union[None, Unset, str]: + def _parse_alert_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) alert_description = _parse_alert_description(d.pop("alert_description", UNSET)) - def _parse_alert_urgency_id(data: object) -> Union[None, Unset, str]: + def _parse_alert_urgency_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) alert_urgency_id = _parse_alert_urgency_id(d.pop("alert_urgency_id", UNSET)) interval = d.pop("interval", UNSET) _interval_unit = d.pop("interval_unit", UNSET) - interval_unit: Union[Unset, UpdateHeartbeatDataAttributesIntervalUnit] + interval_unit: Unset | UpdateHeartbeatDataAttributesIntervalUnit if isinstance(_interval_unit, Unset): interval_unit = UNSET else: @@ -161,7 +161,7 @@ def _parse_alert_urgency_id(data: object) -> Union[None, Unset, str]: notification_target_id = d.pop("notification_target_id", UNSET) _notification_target_type = d.pop("notification_target_type", UNSET) - notification_target_type: Union[Unset, UpdateHeartbeatDataAttributesNotificationTargetType] + notification_target_type: Unset | UpdateHeartbeatDataAttributesNotificationTargetType if isinstance(_notification_target_type, Unset): notification_target_type = UNSET else: diff --git a/rootly_sdk/models/update_incident_action_item_data_attributes.py b/rootly_sdk/models/update_incident_action_item_data_attributes.py index fd6d7282..e4bda19b 100644 --- a/rootly_sdk/models/update_incident_action_item_data_attributes.py +++ b/rootly_sdk/models/update_incident_action_item_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define @@ -46,41 +46,41 @@ class UpdateIncidentActionItemDataAttributes: action item. Ignored unless custom fields for action items are enabled for the organization. """ - summary: Union[Unset, str] = UNSET - description: Union[None, Unset, str] = UNSET - kind: Union[Unset, UpdateIncidentActionItemDataAttributesKind] = UNSET - assigned_to_user_id: Union[None, Unset, int] = UNSET - assigned_to_group_ids: Union[None, Unset, list[str]] = UNSET - priority: Union[Unset, UpdateIncidentActionItemDataAttributesPriority] = UNSET - status: Union[Unset, UpdateIncidentActionItemDataAttributesStatus] = UNSET - due_date: Union[None, Unset, str] = UNSET - jira_issue_id: Union[None, Unset, str] = UNSET - jira_issue_key: Union[None, Unset, str] = UNSET - jira_issue_url: Union[None, Unset, str] = UNSET - form_field_selections: Union[ - None, Unset, list["UpdateIncidentActionItemDataAttributesFormFieldSelectionsType0Item"] - ] = UNSET + summary: Unset | str = UNSET + description: None | Unset | str = UNSET + kind: Unset | UpdateIncidentActionItemDataAttributesKind = UNSET + assigned_to_user_id: None | Unset | int = UNSET + assigned_to_group_ids: None | Unset | list[str] = UNSET + priority: Unset | UpdateIncidentActionItemDataAttributesPriority = UNSET + status: Unset | UpdateIncidentActionItemDataAttributesStatus = UNSET + due_date: None | Unset | str = UNSET + jira_issue_id: None | Unset | str = UNSET + jira_issue_key: None | Unset | str = UNSET + jira_issue_url: None | Unset | str = UNSET + form_field_selections: None | Unset | list["UpdateIncidentActionItemDataAttributesFormFieldSelectionsType0Item"] = ( + UNSET + ) def to_dict(self) -> dict[str, Any]: summary = self.summary - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - kind: Union[Unset, str] = UNSET + kind: Unset | str = UNSET if not isinstance(self.kind, Unset): kind = self.kind - assigned_to_user_id: Union[None, Unset, int] + assigned_to_user_id: None | Unset | int if isinstance(self.assigned_to_user_id, Unset): assigned_to_user_id = UNSET else: assigned_to_user_id = self.assigned_to_user_id - assigned_to_group_ids: Union[None, Unset, list[str]] + assigned_to_group_ids: None | Unset | list[str] if isinstance(self.assigned_to_group_ids, Unset): assigned_to_group_ids = UNSET elif isinstance(self.assigned_to_group_ids, list): @@ -89,39 +89,39 @@ def to_dict(self) -> dict[str, Any]: else: assigned_to_group_ids = self.assigned_to_group_ids - priority: Union[Unset, str] = UNSET + priority: Unset | str = UNSET if not isinstance(self.priority, Unset): priority = self.priority - status: Union[Unset, str] = UNSET + status: Unset | str = UNSET if not isinstance(self.status, Unset): status = self.status - due_date: Union[None, Unset, str] + due_date: None | Unset | str if isinstance(self.due_date, Unset): due_date = UNSET else: due_date = self.due_date - jira_issue_id: Union[None, Unset, str] + jira_issue_id: None | Unset | str if isinstance(self.jira_issue_id, Unset): jira_issue_id = UNSET else: jira_issue_id = self.jira_issue_id - jira_issue_key: Union[None, Unset, str] + jira_issue_key: None | Unset | str if isinstance(self.jira_issue_key, Unset): jira_issue_key = UNSET else: jira_issue_key = self.jira_issue_key - jira_issue_url: Union[None, Unset, str] + jira_issue_url: None | Unset | str if isinstance(self.jira_issue_url, Unset): jira_issue_url = UNSET else: jira_issue_url = self.jira_issue_url - form_field_selections: Union[None, Unset, list[dict[str, Any]]] + form_field_selections: None | Unset | list[dict[str, Any]] if isinstance(self.form_field_selections, Unset): form_field_selections = UNSET elif isinstance(self.form_field_selections, list): @@ -172,32 +172,32 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) summary = d.pop("summary", UNSET) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) _kind = d.pop("kind", UNSET) - kind: Union[Unset, UpdateIncidentActionItemDataAttributesKind] + kind: Unset | UpdateIncidentActionItemDataAttributesKind if isinstance(_kind, Unset): kind = UNSET else: kind = check_update_incident_action_item_data_attributes_kind(_kind) - def _parse_assigned_to_user_id(data: object) -> Union[None, Unset, int]: + def _parse_assigned_to_user_id(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) assigned_to_user_id = _parse_assigned_to_user_id(d.pop("assigned_to_user_id", UNSET)) - def _parse_assigned_to_group_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_assigned_to_group_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -210,63 +210,63 @@ def _parse_assigned_to_group_ids(data: object) -> Union[None, Unset, list[str]]: return assigned_to_group_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) assigned_to_group_ids = _parse_assigned_to_group_ids(d.pop("assigned_to_group_ids", UNSET)) _priority = d.pop("priority", UNSET) - priority: Union[Unset, UpdateIncidentActionItemDataAttributesPriority] + priority: Unset | UpdateIncidentActionItemDataAttributesPriority if isinstance(_priority, Unset): priority = UNSET else: priority = check_update_incident_action_item_data_attributes_priority(_priority) _status = d.pop("status", UNSET) - status: Union[Unset, UpdateIncidentActionItemDataAttributesStatus] + status: Unset | UpdateIncidentActionItemDataAttributesStatus if isinstance(_status, Unset): status = UNSET else: status = check_update_incident_action_item_data_attributes_status(_status) - def _parse_due_date(data: object) -> Union[None, Unset, str]: + def _parse_due_date(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) due_date = _parse_due_date(d.pop("due_date", UNSET)) - def _parse_jira_issue_id(data: object) -> Union[None, Unset, str]: + def _parse_jira_issue_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) jira_issue_id = _parse_jira_issue_id(d.pop("jira_issue_id", UNSET)) - def _parse_jira_issue_key(data: object) -> Union[None, Unset, str]: + def _parse_jira_issue_key(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) jira_issue_key = _parse_jira_issue_key(d.pop("jira_issue_key", UNSET)) - def _parse_jira_issue_url(data: object) -> Union[None, Unset, str]: + def _parse_jira_issue_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) jira_issue_url = _parse_jira_issue_url(d.pop("jira_issue_url", UNSET)) def _parse_form_field_selections( data: object, - ) -> Union[None, Unset, list["UpdateIncidentActionItemDataAttributesFormFieldSelectionsType0Item"]]: + ) -> None | Unset | list["UpdateIncidentActionItemDataAttributesFormFieldSelectionsType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -288,9 +288,7 @@ def _parse_form_field_selections( return form_field_selections_type_0 except: # noqa: E722 pass - return cast( - Union[None, Unset, list["UpdateIncidentActionItemDataAttributesFormFieldSelectionsType0Item"]], data - ) + return cast(None | Unset | list["UpdateIncidentActionItemDataAttributesFormFieldSelectionsType0Item"], data) form_field_selections = _parse_form_field_selections(d.pop("form_field_selections", UNSET)) diff --git a/rootly_sdk/models/update_incident_action_item_data_attributes_form_field_selections_type_0_item.py b/rootly_sdk/models/update_incident_action_item_data_attributes_form_field_selections_type_0_item.py index 3314f34c..1285dd67 100644 --- a/rootly_sdk/models/update_incident_action_item_data_attributes_form_field_selections_type_0_item.py +++ b/rootly_sdk/models/update_incident_action_item_data_attributes_form_field_selections_type_0_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -30,25 +30,25 @@ class UpdateIncidentActionItemDataAttributesFormFieldSelectionsType0Item: """ form_field_id: str - id: Union[Unset, str] = UNSET - value: Union[None, Unset, list[str], str] = UNSET - selected_option_ids: Union[Unset, list[str]] = UNSET - selected_user_ids: Union[Unset, list[int]] = UNSET - selected_group_ids: Union[Unset, list[str]] = UNSET - selected_service_ids: Union[Unset, list[str]] = UNSET - selected_functionality_ids: Union[Unset, list[str]] = UNSET - selected_catalog_entity_ids: Union[Unset, list[str]] = UNSET - selected_environment_ids: Union[Unset, list[str]] = UNSET - selected_cause_ids: Union[Unset, list[str]] = UNSET - selected_incident_type_ids: Union[Unset, list[str]] = UNSET - field_destroy: Union[None, Unset, bool] = UNSET + id: Unset | str = UNSET + value: None | Unset | list[str] | str = UNSET + selected_option_ids: Unset | list[str] = UNSET + selected_user_ids: Unset | list[int] = UNSET + selected_group_ids: Unset | list[str] = UNSET + selected_service_ids: Unset | list[str] = UNSET + selected_functionality_ids: Unset | list[str] = UNSET + selected_catalog_entity_ids: Unset | list[str] = UNSET + selected_environment_ids: Unset | list[str] = UNSET + selected_cause_ids: Unset | list[str] = UNSET + selected_incident_type_ids: Unset | list[str] = UNSET + field_destroy: None | Unset | bool = UNSET def to_dict(self) -> dict[str, Any]: form_field_id = self.form_field_id id = self.id - value: Union[None, Unset, list[str], str] + value: None | Unset | list[str] | str if isinstance(self.value, Unset): value = UNSET elif isinstance(self.value, list): @@ -57,43 +57,43 @@ def to_dict(self) -> dict[str, Any]: else: value = self.value - selected_option_ids: Union[Unset, list[str]] = UNSET + selected_option_ids: Unset | list[str] = UNSET if not isinstance(self.selected_option_ids, Unset): selected_option_ids = self.selected_option_ids - selected_user_ids: Union[Unset, list[int]] = UNSET + selected_user_ids: Unset | list[int] = UNSET if not isinstance(self.selected_user_ids, Unset): selected_user_ids = self.selected_user_ids - selected_group_ids: Union[Unset, list[str]] = UNSET + selected_group_ids: Unset | list[str] = UNSET if not isinstance(self.selected_group_ids, Unset): selected_group_ids = self.selected_group_ids - selected_service_ids: Union[Unset, list[str]] = UNSET + selected_service_ids: Unset | list[str] = UNSET if not isinstance(self.selected_service_ids, Unset): selected_service_ids = self.selected_service_ids - selected_functionality_ids: Union[Unset, list[str]] = UNSET + selected_functionality_ids: Unset | list[str] = UNSET if not isinstance(self.selected_functionality_ids, Unset): selected_functionality_ids = self.selected_functionality_ids - selected_catalog_entity_ids: Union[Unset, list[str]] = UNSET + selected_catalog_entity_ids: Unset | list[str] = UNSET if not isinstance(self.selected_catalog_entity_ids, Unset): selected_catalog_entity_ids = self.selected_catalog_entity_ids - selected_environment_ids: Union[Unset, list[str]] = UNSET + selected_environment_ids: Unset | list[str] = UNSET if not isinstance(self.selected_environment_ids, Unset): selected_environment_ids = self.selected_environment_ids - selected_cause_ids: Union[Unset, list[str]] = UNSET + selected_cause_ids: Unset | list[str] = UNSET if not isinstance(self.selected_cause_ids, Unset): selected_cause_ids = self.selected_cause_ids - selected_incident_type_ids: Union[Unset, list[str]] = UNSET + selected_incident_type_ids: Unset | list[str] = UNSET if not isinstance(self.selected_incident_type_ids, Unset): selected_incident_type_ids = self.selected_incident_type_ids - field_destroy: Union[None, Unset, bool] + field_destroy: None | Unset | bool if isinstance(self.field_destroy, Unset): field_destroy = UNSET else: @@ -140,7 +140,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: id = d.pop("id", UNSET) - def _parse_value(data: object) -> Union[None, Unset, list[str], str]: + def _parse_value(data: object) -> None | Unset | list[str] | str: if data is None: return data if isinstance(data, Unset): @@ -153,7 +153,7 @@ def _parse_value(data: object) -> Union[None, Unset, list[str], str]: return value_type_1 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str], str], data) + return cast(None | Unset | list[str] | str, data) value = _parse_value(d.pop("value", UNSET)) @@ -175,12 +175,12 @@ def _parse_value(data: object) -> Union[None, Unset, list[str], str]: selected_incident_type_ids = cast(list[str], d.pop("selected_incident_type_ids", UNSET)) - def _parse_field_destroy(data: object) -> Union[None, Unset, bool]: + def _parse_field_destroy(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) field_destroy = _parse_field_destroy(d.pop("_destroy", UNSET)) diff --git a/rootly_sdk/models/update_incident_custom_field_selection_data_attributes.py b/rootly_sdk/models/update_incident_custom_field_selection_data_attributes.py index b55e5a4f..ddd3fa07 100644 --- a/rootly_sdk/models/update_incident_custom_field_selection_data_attributes.py +++ b/rootly_sdk/models/update_incident_custom_field_selection_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -16,17 +16,17 @@ class UpdateIncidentCustomFieldSelectionDataAttributes: selected_option_ids (Union[Unset, list[int]]): """ - value: Union[None, Unset, str] = UNSET - selected_option_ids: Union[Unset, list[int]] = UNSET + value: None | Unset | str = UNSET + selected_option_ids: Unset | list[int] = UNSET def to_dict(self) -> dict[str, Any]: - value: Union[None, Unset, str] + value: None | Unset | str if isinstance(self.value, Unset): value = UNSET else: value = self.value - selected_option_ids: Union[Unset, list[int]] = UNSET + selected_option_ids: Unset | list[int] = UNSET if not isinstance(self.selected_option_ids, Unset): selected_option_ids = self.selected_option_ids @@ -44,12 +44,12 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_value(data: object) -> Union[None, Unset, str]: + def _parse_value(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) value = _parse_value(d.pop("value", UNSET)) diff --git a/rootly_sdk/models/update_incident_data_attributes.py b/rootly_sdk/models/update_incident_data_attributes.py index 21d40aa6..0d2246cf 100644 --- a/rootly_sdk/models/update_incident_data_attributes.py +++ b/rootly_sdk/models/update_incident_data_attributes.py @@ -69,101 +69,101 @@ class UpdateIncidentDataAttributes: cancellation_message (Union[None, Unset, str]): Why was the incident cancelled? """ - title: Union[None, Unset, str] = UNSET - kind: Union[Unset, UpdateIncidentDataAttributesKind] = "normal" - parent_incident_id: Union[None, Unset, str] = UNSET - duplicate_incident_id: Union[None, Unset, str] = UNSET - summary: Union[None, Unset, str] = UNSET - status: Union[Unset, UpdateIncidentDataAttributesStatus] = UNSET - private: Union[None, Unset, bool] = False - severity_id: Union[None, Unset, str] = UNSET - public_title: Union[None, Unset, str] = UNSET - alert_ids: Union[None, Unset, list[str]] = UNSET - environment_ids: Union[None, Unset, list[str]] = UNSET - incident_type_ids: Union[None, Unset, list[str]] = UNSET - service_ids: Union[None, Unset, list[str]] = UNSET - functionality_ids: Union[None, Unset, list[str]] = UNSET - muted_service_ids: Union[None, Unset, list[str]] = UNSET - group_ids: Union[None, Unset, list[str]] = UNSET - cause_ids: Union[None, Unset, list[str]] = UNSET + title: None | Unset | str = UNSET + kind: Unset | UpdateIncidentDataAttributesKind = "normal" + parent_incident_id: None | Unset | str = UNSET + duplicate_incident_id: None | Unset | str = UNSET + summary: None | Unset | str = UNSET + status: Unset | UpdateIncidentDataAttributesStatus = UNSET + private: None | Unset | bool = False + severity_id: None | Unset | str = UNSET + public_title: None | Unset | str = UNSET + alert_ids: None | Unset | list[str] = UNSET + environment_ids: None | Unset | list[str] = UNSET + incident_type_ids: None | Unset | list[str] = UNSET + service_ids: None | Unset | list[str] = UNSET + functionality_ids: None | Unset | list[str] = UNSET + muted_service_ids: None | Unset | list[str] = UNSET + group_ids: None | Unset | list[str] = UNSET + cause_ids: None | Unset | list[str] = UNSET labels: Union["UpdateIncidentDataAttributesLabelsType0", None, Unset] = UNSET - slack_channel_id: Union[None, Unset, str] = UNSET - slack_channel_name: Union[None, Unset, str] = UNSET - slack_channel_url: Union[None, Unset, str] = UNSET - slack_channel_archived: Union[None, Unset, bool] = UNSET - google_drive_parent_id: Union[None, Unset, str] = UNSET - google_drive_url: Union[None, Unset, str] = UNSET - jira_issue_key: Union[None, Unset, str] = UNSET - jira_issue_id: Union[None, Unset, str] = UNSET - jira_issue_url: Union[None, Unset, str] = UNSET - scheduled_for: Union[None, Unset, str] = UNSET - scheduled_until: Union[None, Unset, str] = UNSET - in_triage_at: Union[None, Unset, str] = UNSET - started_at: Union[None, Unset, str] = UNSET - detected_at: Union[None, Unset, str] = UNSET - acknowledged_at: Union[None, Unset, str] = UNSET - mitigated_at: Union[None, Unset, str] = UNSET - resolved_at: Union[None, Unset, str] = UNSET - closed_at: Union[None, Unset, str] = UNSET - cancelled_at: Union[None, Unset, str] = UNSET - mitigation_message: Union[None, Unset, str] = UNSET - resolution_message: Union[None, Unset, str] = UNSET - cancellation_message: Union[None, Unset, str] = UNSET + slack_channel_id: None | Unset | str = UNSET + slack_channel_name: None | Unset | str = UNSET + slack_channel_url: None | Unset | str = UNSET + slack_channel_archived: None | Unset | bool = UNSET + google_drive_parent_id: None | Unset | str = UNSET + google_drive_url: None | Unset | str = UNSET + jira_issue_key: None | Unset | str = UNSET + jira_issue_id: None | Unset | str = UNSET + jira_issue_url: None | Unset | str = UNSET + scheduled_for: None | Unset | str = UNSET + scheduled_until: None | Unset | str = UNSET + in_triage_at: None | Unset | str = UNSET + started_at: None | Unset | str = UNSET + detected_at: None | Unset | str = UNSET + acknowledged_at: None | Unset | str = UNSET + mitigated_at: None | Unset | str = UNSET + resolved_at: None | Unset | str = UNSET + closed_at: None | Unset | str = UNSET + cancelled_at: None | Unset | str = UNSET + mitigation_message: None | Unset | str = UNSET + resolution_message: None | Unset | str = UNSET + cancellation_message: None | Unset | str = UNSET def to_dict(self) -> dict[str, Any]: from ..models.update_incident_data_attributes_labels_type_0 import UpdateIncidentDataAttributesLabelsType0 - title: Union[None, Unset, str] + title: None | Unset | str if isinstance(self.title, Unset): title = UNSET else: title = self.title - kind: Union[Unset, str] = UNSET + kind: Unset | str = UNSET if not isinstance(self.kind, Unset): kind = self.kind - parent_incident_id: Union[None, Unset, str] + parent_incident_id: None | Unset | str if isinstance(self.parent_incident_id, Unset): parent_incident_id = UNSET else: parent_incident_id = self.parent_incident_id - duplicate_incident_id: Union[None, Unset, str] + duplicate_incident_id: None | Unset | str if isinstance(self.duplicate_incident_id, Unset): duplicate_incident_id = UNSET else: duplicate_incident_id = self.duplicate_incident_id - summary: Union[None, Unset, str] + summary: None | Unset | str if isinstance(self.summary, Unset): summary = UNSET else: summary = self.summary - status: Union[Unset, str] = UNSET + status: Unset | str = UNSET if not isinstance(self.status, Unset): status = self.status - private: Union[None, Unset, bool] + private: None | Unset | bool if isinstance(self.private, Unset): private = UNSET else: private = self.private - severity_id: Union[None, Unset, str] + severity_id: None | Unset | str if isinstance(self.severity_id, Unset): severity_id = UNSET else: severity_id = self.severity_id - public_title: Union[None, Unset, str] + public_title: None | Unset | str if isinstance(self.public_title, Unset): public_title = UNSET else: public_title = self.public_title - alert_ids: Union[None, Unset, list[str]] + alert_ids: None | Unset | list[str] if isinstance(self.alert_ids, Unset): alert_ids = UNSET elif isinstance(self.alert_ids, list): @@ -172,7 +172,7 @@ def to_dict(self) -> dict[str, Any]: else: alert_ids = self.alert_ids - environment_ids: Union[None, Unset, list[str]] + environment_ids: None | Unset | list[str] if isinstance(self.environment_ids, Unset): environment_ids = UNSET elif isinstance(self.environment_ids, list): @@ -181,7 +181,7 @@ def to_dict(self) -> dict[str, Any]: else: environment_ids = self.environment_ids - incident_type_ids: Union[None, Unset, list[str]] + incident_type_ids: None | Unset | list[str] if isinstance(self.incident_type_ids, Unset): incident_type_ids = UNSET elif isinstance(self.incident_type_ids, list): @@ -190,7 +190,7 @@ def to_dict(self) -> dict[str, Any]: else: incident_type_ids = self.incident_type_ids - service_ids: Union[None, Unset, list[str]] + service_ids: None | Unset | list[str] if isinstance(self.service_ids, Unset): service_ids = UNSET elif isinstance(self.service_ids, list): @@ -199,7 +199,7 @@ def to_dict(self) -> dict[str, Any]: else: service_ids = self.service_ids - functionality_ids: Union[None, Unset, list[str]] + functionality_ids: None | Unset | list[str] if isinstance(self.functionality_ids, Unset): functionality_ids = UNSET elif isinstance(self.functionality_ids, list): @@ -208,7 +208,7 @@ def to_dict(self) -> dict[str, Any]: else: functionality_ids = self.functionality_ids - muted_service_ids: Union[None, Unset, list[str]] + muted_service_ids: None | Unset | list[str] if isinstance(self.muted_service_ids, Unset): muted_service_ids = UNSET elif isinstance(self.muted_service_ids, list): @@ -217,7 +217,7 @@ def to_dict(self) -> dict[str, Any]: else: muted_service_ids = self.muted_service_ids - group_ids: Union[None, Unset, list[str]] + group_ids: None | Unset | list[str] if isinstance(self.group_ids, Unset): group_ids = UNSET elif isinstance(self.group_ids, list): @@ -226,7 +226,7 @@ def to_dict(self) -> dict[str, Any]: else: group_ids = self.group_ids - cause_ids: Union[None, Unset, list[str]] + cause_ids: None | Unset | list[str] if isinstance(self.cause_ids, Unset): cause_ids = UNSET elif isinstance(self.cause_ids, list): @@ -235,7 +235,7 @@ def to_dict(self) -> dict[str, Any]: else: cause_ids = self.cause_ids - labels: Union[None, Unset, dict[str, Any]] + labels: None | Unset | dict[str, Any] if isinstance(self.labels, Unset): labels = UNSET elif isinstance(self.labels, UpdateIncidentDataAttributesLabelsType0): @@ -243,133 +243,133 @@ def to_dict(self) -> dict[str, Any]: else: labels = self.labels - slack_channel_id: Union[None, Unset, str] + slack_channel_id: None | Unset | str if isinstance(self.slack_channel_id, Unset): slack_channel_id = UNSET else: slack_channel_id = self.slack_channel_id - slack_channel_name: Union[None, Unset, str] + slack_channel_name: None | Unset | str if isinstance(self.slack_channel_name, Unset): slack_channel_name = UNSET else: slack_channel_name = self.slack_channel_name - slack_channel_url: Union[None, Unset, str] + slack_channel_url: None | Unset | str if isinstance(self.slack_channel_url, Unset): slack_channel_url = UNSET else: slack_channel_url = self.slack_channel_url - slack_channel_archived: Union[None, Unset, bool] + slack_channel_archived: None | Unset | bool if isinstance(self.slack_channel_archived, Unset): slack_channel_archived = UNSET else: slack_channel_archived = self.slack_channel_archived - google_drive_parent_id: Union[None, Unset, str] + google_drive_parent_id: None | Unset | str if isinstance(self.google_drive_parent_id, Unset): google_drive_parent_id = UNSET else: google_drive_parent_id = self.google_drive_parent_id - google_drive_url: Union[None, Unset, str] + google_drive_url: None | Unset | str if isinstance(self.google_drive_url, Unset): google_drive_url = UNSET else: google_drive_url = self.google_drive_url - jira_issue_key: Union[None, Unset, str] + jira_issue_key: None | Unset | str if isinstance(self.jira_issue_key, Unset): jira_issue_key = UNSET else: jira_issue_key = self.jira_issue_key - jira_issue_id: Union[None, Unset, str] + jira_issue_id: None | Unset | str if isinstance(self.jira_issue_id, Unset): jira_issue_id = UNSET else: jira_issue_id = self.jira_issue_id - jira_issue_url: Union[None, Unset, str] + jira_issue_url: None | Unset | str if isinstance(self.jira_issue_url, Unset): jira_issue_url = UNSET else: jira_issue_url = self.jira_issue_url - scheduled_for: Union[None, Unset, str] + scheduled_for: None | Unset | str if isinstance(self.scheduled_for, Unset): scheduled_for = UNSET else: scheduled_for = self.scheduled_for - scheduled_until: Union[None, Unset, str] + scheduled_until: None | Unset | str if isinstance(self.scheduled_until, Unset): scheduled_until = UNSET else: scheduled_until = self.scheduled_until - in_triage_at: Union[None, Unset, str] + in_triage_at: None | Unset | str if isinstance(self.in_triage_at, Unset): in_triage_at = UNSET else: in_triage_at = self.in_triage_at - started_at: Union[None, Unset, str] + started_at: None | Unset | str if isinstance(self.started_at, Unset): started_at = UNSET else: started_at = self.started_at - detected_at: Union[None, Unset, str] + detected_at: None | Unset | str if isinstance(self.detected_at, Unset): detected_at = UNSET else: detected_at = self.detected_at - acknowledged_at: Union[None, Unset, str] + acknowledged_at: None | Unset | str if isinstance(self.acknowledged_at, Unset): acknowledged_at = UNSET else: acknowledged_at = self.acknowledged_at - mitigated_at: Union[None, Unset, str] + mitigated_at: None | Unset | str if isinstance(self.mitigated_at, Unset): mitigated_at = UNSET else: mitigated_at = self.mitigated_at - resolved_at: Union[None, Unset, str] + resolved_at: None | Unset | str if isinstance(self.resolved_at, Unset): resolved_at = UNSET else: resolved_at = self.resolved_at - closed_at: Union[None, Unset, str] + closed_at: None | Unset | str if isinstance(self.closed_at, Unset): closed_at = UNSET else: closed_at = self.closed_at - cancelled_at: Union[None, Unset, str] + cancelled_at: None | Unset | str if isinstance(self.cancelled_at, Unset): cancelled_at = UNSET else: cancelled_at = self.cancelled_at - mitigation_message: Union[None, Unset, str] + mitigation_message: None | Unset | str if isinstance(self.mitigation_message, Unset): mitigation_message = UNSET else: mitigation_message = self.mitigation_message - resolution_message: Union[None, Unset, str] + resolution_message: None | Unset | str if isinstance(self.resolution_message, Unset): resolution_message = UNSET else: resolution_message = self.resolution_message - cancellation_message: Union[None, Unset, str] + cancellation_message: None | Unset | str if isinstance(self.cancellation_message, Unset): cancellation_message = UNSET else: @@ -467,84 +467,84 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_title(data: object) -> Union[None, Unset, str]: + def _parse_title(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) title = _parse_title(d.pop("title", UNSET)) _kind = d.pop("kind", UNSET) - kind: Union[Unset, UpdateIncidentDataAttributesKind] + kind: Unset | UpdateIncidentDataAttributesKind if isinstance(_kind, Unset): kind = UNSET else: kind = check_update_incident_data_attributes_kind(_kind) - def _parse_parent_incident_id(data: object) -> Union[None, Unset, str]: + def _parse_parent_incident_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) parent_incident_id = _parse_parent_incident_id(d.pop("parent_incident_id", UNSET)) - def _parse_duplicate_incident_id(data: object) -> Union[None, Unset, str]: + def _parse_duplicate_incident_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) duplicate_incident_id = _parse_duplicate_incident_id(d.pop("duplicate_incident_id", UNSET)) - def _parse_summary(data: object) -> Union[None, Unset, str]: + def _parse_summary(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) summary = _parse_summary(d.pop("summary", UNSET)) _status = d.pop("status", UNSET) - status: Union[Unset, UpdateIncidentDataAttributesStatus] + status: Unset | UpdateIncidentDataAttributesStatus if isinstance(_status, Unset): status = UNSET else: status = check_update_incident_data_attributes_status(_status) - def _parse_private(data: object) -> Union[None, Unset, bool]: + def _parse_private(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) private = _parse_private(d.pop("private", UNSET)) - def _parse_severity_id(data: object) -> Union[None, Unset, str]: + def _parse_severity_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) severity_id = _parse_severity_id(d.pop("severity_id", UNSET)) - def _parse_public_title(data: object) -> Union[None, Unset, str]: + def _parse_public_title(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) public_title = _parse_public_title(d.pop("public_title", UNSET)) - def _parse_alert_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_alert_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -557,11 +557,11 @@ def _parse_alert_ids(data: object) -> Union[None, Unset, list[str]]: return alert_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) alert_ids = _parse_alert_ids(d.pop("alert_ids", UNSET)) - def _parse_environment_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_environment_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -574,11 +574,11 @@ def _parse_environment_ids(data: object) -> Union[None, Unset, list[str]]: return environment_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) environment_ids = _parse_environment_ids(d.pop("environment_ids", UNSET)) - def _parse_incident_type_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_incident_type_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -591,11 +591,11 @@ def _parse_incident_type_ids(data: object) -> Union[None, Unset, list[str]]: return incident_type_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) incident_type_ids = _parse_incident_type_ids(d.pop("incident_type_ids", UNSET)) - def _parse_service_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_service_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -608,11 +608,11 @@ def _parse_service_ids(data: object) -> Union[None, Unset, list[str]]: return service_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) service_ids = _parse_service_ids(d.pop("service_ids", UNSET)) - def _parse_functionality_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_functionality_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -625,11 +625,11 @@ def _parse_functionality_ids(data: object) -> Union[None, Unset, list[str]]: return functionality_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) functionality_ids = _parse_functionality_ids(d.pop("functionality_ids", UNSET)) - def _parse_muted_service_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_muted_service_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -642,11 +642,11 @@ def _parse_muted_service_ids(data: object) -> Union[None, Unset, list[str]]: return muted_service_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) muted_service_ids = _parse_muted_service_ids(d.pop("muted_service_ids", UNSET)) - def _parse_group_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_group_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -659,11 +659,11 @@ def _parse_group_ids(data: object) -> Union[None, Unset, list[str]]: return group_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) group_ids = _parse_group_ids(d.pop("group_ids", UNSET)) - def _parse_cause_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_cause_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -676,7 +676,7 @@ def _parse_cause_ids(data: object) -> Union[None, Unset, list[str]]: return cause_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) cause_ids = _parse_cause_ids(d.pop("cause_ids", UNSET)) @@ -697,201 +697,201 @@ def _parse_labels(data: object) -> Union["UpdateIncidentDataAttributesLabelsType labels = _parse_labels(d.pop("labels", UNSET)) - def _parse_slack_channel_id(data: object) -> Union[None, Unset, str]: + def _parse_slack_channel_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) slack_channel_id = _parse_slack_channel_id(d.pop("slack_channel_id", UNSET)) - def _parse_slack_channel_name(data: object) -> Union[None, Unset, str]: + def _parse_slack_channel_name(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) slack_channel_name = _parse_slack_channel_name(d.pop("slack_channel_name", UNSET)) - def _parse_slack_channel_url(data: object) -> Union[None, Unset, str]: + def _parse_slack_channel_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) slack_channel_url = _parse_slack_channel_url(d.pop("slack_channel_url", UNSET)) - def _parse_slack_channel_archived(data: object) -> Union[None, Unset, bool]: + def _parse_slack_channel_archived(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) slack_channel_archived = _parse_slack_channel_archived(d.pop("slack_channel_archived", UNSET)) - def _parse_google_drive_parent_id(data: object) -> Union[None, Unset, str]: + def _parse_google_drive_parent_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) google_drive_parent_id = _parse_google_drive_parent_id(d.pop("google_drive_parent_id", UNSET)) - def _parse_google_drive_url(data: object) -> Union[None, Unset, str]: + def _parse_google_drive_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) google_drive_url = _parse_google_drive_url(d.pop("google_drive_url", UNSET)) - def _parse_jira_issue_key(data: object) -> Union[None, Unset, str]: + def _parse_jira_issue_key(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) jira_issue_key = _parse_jira_issue_key(d.pop("jira_issue_key", UNSET)) - def _parse_jira_issue_id(data: object) -> Union[None, Unset, str]: + def _parse_jira_issue_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) jira_issue_id = _parse_jira_issue_id(d.pop("jira_issue_id", UNSET)) - def _parse_jira_issue_url(data: object) -> Union[None, Unset, str]: + def _parse_jira_issue_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) jira_issue_url = _parse_jira_issue_url(d.pop("jira_issue_url", UNSET)) - def _parse_scheduled_for(data: object) -> Union[None, Unset, str]: + def _parse_scheduled_for(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) scheduled_for = _parse_scheduled_for(d.pop("scheduled_for", UNSET)) - def _parse_scheduled_until(data: object) -> Union[None, Unset, str]: + def _parse_scheduled_until(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) scheduled_until = _parse_scheduled_until(d.pop("scheduled_until", UNSET)) - def _parse_in_triage_at(data: object) -> Union[None, Unset, str]: + def _parse_in_triage_at(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) in_triage_at = _parse_in_triage_at(d.pop("in_triage_at", UNSET)) - def _parse_started_at(data: object) -> Union[None, Unset, str]: + def _parse_started_at(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) started_at = _parse_started_at(d.pop("started_at", UNSET)) - def _parse_detected_at(data: object) -> Union[None, Unset, str]: + def _parse_detected_at(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) detected_at = _parse_detected_at(d.pop("detected_at", UNSET)) - def _parse_acknowledged_at(data: object) -> Union[None, Unset, str]: + def _parse_acknowledged_at(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) acknowledged_at = _parse_acknowledged_at(d.pop("acknowledged_at", UNSET)) - def _parse_mitigated_at(data: object) -> Union[None, Unset, str]: + def _parse_mitigated_at(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) mitigated_at = _parse_mitigated_at(d.pop("mitigated_at", UNSET)) - def _parse_resolved_at(data: object) -> Union[None, Unset, str]: + def _parse_resolved_at(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) resolved_at = _parse_resolved_at(d.pop("resolved_at", UNSET)) - def _parse_closed_at(data: object) -> Union[None, Unset, str]: + def _parse_closed_at(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) closed_at = _parse_closed_at(d.pop("closed_at", UNSET)) - def _parse_cancelled_at(data: object) -> Union[None, Unset, str]: + def _parse_cancelled_at(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) cancelled_at = _parse_cancelled_at(d.pop("cancelled_at", UNSET)) - def _parse_mitigation_message(data: object) -> Union[None, Unset, str]: + def _parse_mitigation_message(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) mitigation_message = _parse_mitigation_message(d.pop("mitigation_message", UNSET)) - def _parse_resolution_message(data: object) -> Union[None, Unset, str]: + def _parse_resolution_message(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) resolution_message = _parse_resolution_message(d.pop("resolution_message", UNSET)) - def _parse_cancellation_message(data: object) -> Union[None, Unset, str]: + def _parse_cancellation_message(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) cancellation_message = _parse_cancellation_message(d.pop("cancellation_message", UNSET)) diff --git a/rootly_sdk/models/update_incident_event_data_attributes.py b/rootly_sdk/models/update_incident_event_data_attributes.py index 20040686..07151a8c 100644 --- a/rootly_sdk/models/update_incident_event_data_attributes.py +++ b/rootly_sdk/models/update_incident_event_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define @@ -21,13 +21,13 @@ class UpdateIncidentEventDataAttributes: item """ - event: Union[Unset, str] = UNSET - visibility: Union[Unset, UpdateIncidentEventDataAttributesVisibility] = UNSET + event: Unset | str = UNSET + visibility: Unset | UpdateIncidentEventDataAttributesVisibility = UNSET def to_dict(self) -> dict[str, Any]: event = self.event - visibility: Union[Unset, str] = UNSET + visibility: Unset | str = UNSET if not isinstance(self.visibility, Unset): visibility = self.visibility @@ -47,7 +47,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: event = d.pop("event", UNSET) _visibility = d.pop("visibility", UNSET) - visibility: Union[Unset, UpdateIncidentEventDataAttributesVisibility] + visibility: Unset | UpdateIncidentEventDataAttributesVisibility if isinstance(_visibility, Unset): visibility = UNSET else: diff --git a/rootly_sdk/models/update_incident_feedback_data_attributes.py b/rootly_sdk/models/update_incident_feedback_data_attributes.py index 55342d09..952fc058 100644 --- a/rootly_sdk/models/update_incident_feedback_data_attributes.py +++ b/rootly_sdk/models/update_incident_feedback_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define @@ -21,14 +21,14 @@ class UpdateIncidentFeedbackDataAttributes: anonymous (Union[Unset, bool]): Is the feedback anonymous? """ - feedback: Union[Unset, str] = UNSET - rating: Union[Unset, UpdateIncidentFeedbackDataAttributesRating] = UNSET - anonymous: Union[Unset, bool] = UNSET + feedback: Unset | str = UNSET + rating: Unset | UpdateIncidentFeedbackDataAttributesRating = UNSET + anonymous: Unset | bool = UNSET def to_dict(self) -> dict[str, Any]: feedback = self.feedback - rating: Union[Unset, int] = UNSET + rating: Unset | int = UNSET if not isinstance(self.rating, Unset): rating = self.rating @@ -52,7 +52,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: feedback = d.pop("feedback", UNSET) _rating = d.pop("rating", UNSET) - rating: Union[Unset, UpdateIncidentFeedbackDataAttributesRating] + rating: Unset | UpdateIncidentFeedbackDataAttributesRating if isinstance(_rating, Unset): rating = UNSET else: diff --git a/rootly_sdk/models/update_incident_form_field_selection_data_attributes.py b/rootly_sdk/models/update_incident_form_field_selection_data_attributes.py index 37059083..9f4884c4 100644 --- a/rootly_sdk/models/update_incident_form_field_selection_data_attributes.py +++ b/rootly_sdk/models/update_incident_form_field_selection_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -24,57 +24,57 @@ class UpdateIncidentFormFieldSelectionDataAttributes: selected_incident_type_ids (Union[Unset, list[str]]): """ - value: Union[None, Unset, str] = UNSET - selected_catalog_entity_ids: Union[Unset, list[str]] = UNSET - selected_group_ids: Union[Unset, list[str]] = UNSET - selected_option_ids: Union[Unset, list[str]] = UNSET - selected_service_ids: Union[Unset, list[str]] = UNSET - selected_functionality_ids: Union[Unset, list[str]] = UNSET - selected_user_ids: Union[Unset, list[int]] = UNSET - selected_environment_ids: Union[Unset, list[str]] = UNSET - selected_cause_ids: Union[Unset, list[str]] = UNSET - selected_incident_type_ids: Union[Unset, list[str]] = UNSET + value: None | Unset | str = UNSET + selected_catalog_entity_ids: Unset | list[str] = UNSET + selected_group_ids: Unset | list[str] = UNSET + selected_option_ids: Unset | list[str] = UNSET + selected_service_ids: Unset | list[str] = UNSET + selected_functionality_ids: Unset | list[str] = UNSET + selected_user_ids: Unset | list[int] = UNSET + selected_environment_ids: Unset | list[str] = UNSET + selected_cause_ids: Unset | list[str] = UNSET + selected_incident_type_ids: Unset | list[str] = UNSET def to_dict(self) -> dict[str, Any]: - value: Union[None, Unset, str] + value: None | Unset | str if isinstance(self.value, Unset): value = UNSET else: value = self.value - selected_catalog_entity_ids: Union[Unset, list[str]] = UNSET + selected_catalog_entity_ids: Unset | list[str] = UNSET if not isinstance(self.selected_catalog_entity_ids, Unset): selected_catalog_entity_ids = self.selected_catalog_entity_ids - selected_group_ids: Union[Unset, list[str]] = UNSET + selected_group_ids: Unset | list[str] = UNSET if not isinstance(self.selected_group_ids, Unset): selected_group_ids = self.selected_group_ids - selected_option_ids: Union[Unset, list[str]] = UNSET + selected_option_ids: Unset | list[str] = UNSET if not isinstance(self.selected_option_ids, Unset): selected_option_ids = self.selected_option_ids - selected_service_ids: Union[Unset, list[str]] = UNSET + selected_service_ids: Unset | list[str] = UNSET if not isinstance(self.selected_service_ids, Unset): selected_service_ids = self.selected_service_ids - selected_functionality_ids: Union[Unset, list[str]] = UNSET + selected_functionality_ids: Unset | list[str] = UNSET if not isinstance(self.selected_functionality_ids, Unset): selected_functionality_ids = self.selected_functionality_ids - selected_user_ids: Union[Unset, list[int]] = UNSET + selected_user_ids: Unset | list[int] = UNSET if not isinstance(self.selected_user_ids, Unset): selected_user_ids = self.selected_user_ids - selected_environment_ids: Union[Unset, list[str]] = UNSET + selected_environment_ids: Unset | list[str] = UNSET if not isinstance(self.selected_environment_ids, Unset): selected_environment_ids = self.selected_environment_ids - selected_cause_ids: Union[Unset, list[str]] = UNSET + selected_cause_ids: Unset | list[str] = UNSET if not isinstance(self.selected_cause_ids, Unset): selected_cause_ids = self.selected_cause_ids - selected_incident_type_ids: Union[Unset, list[str]] = UNSET + selected_incident_type_ids: Unset | list[str] = UNSET if not isinstance(self.selected_incident_type_ids, Unset): selected_incident_type_ids = self.selected_incident_type_ids @@ -108,12 +108,12 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_value(data: object) -> Union[None, Unset, str]: + def _parse_value(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) value = _parse_value(d.pop("value", UNSET)) diff --git a/rootly_sdk/models/update_incident_permission_set_boolean_data_attributes.py b/rootly_sdk/models/update_incident_permission_set_boolean_data_attributes.py index 156d76d7..09ba597e 100644 --- a/rootly_sdk/models/update_incident_permission_set_boolean_data_attributes.py +++ b/rootly_sdk/models/update_incident_permission_set_boolean_data_attributes.py @@ -28,13 +28,13 @@ class UpdateIncidentPermissionSetBooleanDataAttributes: severity_params (Union[Unset, UpdateIncidentPermissionSetBooleanDataAttributesSeverityParams]): """ - kind: Union[Unset, UpdateIncidentPermissionSetBooleanDataAttributesKind] = UNSET - private: Union[Unset, bool] = UNSET - enabled: Union[Unset, bool] = UNSET + kind: Unset | UpdateIncidentPermissionSetBooleanDataAttributesKind = UNSET + private: Unset | bool = UNSET + enabled: Unset | bool = UNSET severity_params: Union[Unset, "UpdateIncidentPermissionSetBooleanDataAttributesSeverityParams"] = UNSET def to_dict(self) -> dict[str, Any]: - kind: Union[Unset, str] = UNSET + kind: Unset | str = UNSET if not isinstance(self.kind, Unset): kind = self.kind @@ -42,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: enabled = self.enabled - severity_params: Union[Unset, dict[str, Any]] = UNSET + severity_params: Unset | dict[str, Any] = UNSET if not isinstance(self.severity_params, Unset): severity_params = self.severity_params.to_dict() @@ -68,7 +68,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _kind = d.pop("kind", UNSET) - kind: Union[Unset, UpdateIncidentPermissionSetBooleanDataAttributesKind] + kind: Unset | UpdateIncidentPermissionSetBooleanDataAttributesKind if isinstance(_kind, Unset): kind = UNSET else: @@ -79,7 +79,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: enabled = d.pop("enabled", UNSET) _severity_params = d.pop("severity_params", UNSET) - severity_params: Union[Unset, UpdateIncidentPermissionSetBooleanDataAttributesSeverityParams] + severity_params: Unset | UpdateIncidentPermissionSetBooleanDataAttributesSeverityParams if isinstance(_severity_params, Unset): severity_params = UNSET else: diff --git a/rootly_sdk/models/update_incident_permission_set_boolean_data_attributes_severity_params.py b/rootly_sdk/models/update_incident_permission_set_boolean_data_attributes_severity_params.py index d6db9a16..1c6c224e 100644 --- a/rootly_sdk/models/update_incident_permission_set_boolean_data_attributes_severity_params.py +++ b/rootly_sdk/models/update_incident_permission_set_boolean_data_attributes_severity_params.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,10 +21,10 @@ class UpdateIncidentPermissionSetBooleanDataAttributesSeverityParams: matching severity """ - fully_enabled: Union[Unset, bool] = True - applies_to_unassigned: Union[Unset, bool] = True - create_enabled: Union[Unset, bool] = False - severity_ids: Union[None, Unset, list[str]] = UNSET + fully_enabled: Unset | bool = True + applies_to_unassigned: Unset | bool = True + create_enabled: Unset | bool = False + severity_ids: None | Unset | list[str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -34,7 +34,7 @@ def to_dict(self) -> dict[str, Any]: create_enabled = self.create_enabled - severity_ids: Union[None, Unset, list[str]] + severity_ids: None | Unset | list[str] if isinstance(self.severity_ids, Unset): severity_ids = UNSET elif isinstance(self.severity_ids, list): @@ -66,7 +66,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: create_enabled = d.pop("create_enabled", UNSET) - def _parse_severity_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_severity_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -79,7 +79,7 @@ def _parse_severity_ids(data: object) -> Union[None, Unset, list[str]]: return severity_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) severity_ids = _parse_severity_ids(d.pop("severity_ids", UNSET)) diff --git a/rootly_sdk/models/update_incident_permission_set_data_attributes.py b/rootly_sdk/models/update_incident_permission_set_data_attributes.py index 4e96485d..10626000 100644 --- a/rootly_sdk/models/update_incident_permission_set_data_attributes.py +++ b/rootly_sdk/models/update_incident_permission_set_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -30,18 +30,18 @@ class UpdateIncidentPermissionSetDataAttributes: list[UpdateIncidentPermissionSetDataAttributesPublicIncidentPermissionsItem]]): """ - slug: Union[None, Unset, str] = UNSET - name: Union[Unset, str] = UNSET - description: Union[None, Unset, str] = UNSET - private_incident_permissions: Union[ - Unset, list[UpdateIncidentPermissionSetDataAttributesPrivateIncidentPermissionsItem] - ] = UNSET - public_incident_permissions: Union[ - Unset, list[UpdateIncidentPermissionSetDataAttributesPublicIncidentPermissionsItem] - ] = UNSET + slug: None | Unset | str = UNSET + name: Unset | str = UNSET + description: None | Unset | str = UNSET + private_incident_permissions: ( + Unset | list[UpdateIncidentPermissionSetDataAttributesPrivateIncidentPermissionsItem] + ) = UNSET + public_incident_permissions: ( + Unset | list[UpdateIncidentPermissionSetDataAttributesPublicIncidentPermissionsItem] + ) = UNSET def to_dict(self) -> dict[str, Any]: - slug: Union[None, Unset, str] + slug: None | Unset | str if isinstance(self.slug, Unset): slug = UNSET else: @@ -49,20 +49,20 @@ def to_dict(self) -> dict[str, Any]: name = self.name - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - private_incident_permissions: Union[Unset, list[str]] = UNSET + private_incident_permissions: Unset | list[str] = UNSET if not isinstance(self.private_incident_permissions, Unset): private_incident_permissions = [] for private_incident_permissions_item_data in self.private_incident_permissions: private_incident_permissions_item: str = private_incident_permissions_item_data private_incident_permissions.append(private_incident_permissions_item) - public_incident_permissions: Union[Unset, list[str]] = UNSET + public_incident_permissions: Unset | list[str] = UNSET if not isinstance(self.public_incident_permissions, Unset): public_incident_permissions = [] for public_incident_permissions_item_data in self.public_incident_permissions: @@ -89,23 +89,23 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_slug(data: object) -> Union[None, Unset, str]: + def _parse_slug(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) slug = _parse_slug(d.pop("slug", UNSET)) name = d.pop("name", UNSET) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) diff --git a/rootly_sdk/models/update_incident_permission_set_resource_data_attributes.py b/rootly_sdk/models/update_incident_permission_set_resource_data_attributes.py index b8d7899f..a1a06597 100644 --- a/rootly_sdk/models/update_incident_permission_set_resource_data_attributes.py +++ b/rootly_sdk/models/update_incident_permission_set_resource_data_attributes.py @@ -29,14 +29,14 @@ class UpdateIncidentPermissionSetResourceDataAttributes: severity_params (Union[Unset, UpdateIncidentPermissionSetResourceDataAttributesSeverityParams]): """ - kind: Union[Unset, UpdateIncidentPermissionSetResourceDataAttributesKind] = UNSET - private: Union[Unset, bool] = UNSET - resource_id: Union[Unset, str] = UNSET - resource_type: Union[Unset, str] = UNSET + kind: Unset | UpdateIncidentPermissionSetResourceDataAttributesKind = UNSET + private: Unset | bool = UNSET + resource_id: Unset | str = UNSET + resource_type: Unset | str = UNSET severity_params: Union[Unset, "UpdateIncidentPermissionSetResourceDataAttributesSeverityParams"] = UNSET def to_dict(self) -> dict[str, Any]: - kind: Union[Unset, str] = UNSET + kind: Unset | str = UNSET if not isinstance(self.kind, Unset): kind = self.kind @@ -46,7 +46,7 @@ def to_dict(self) -> dict[str, Any]: resource_type = self.resource_type - severity_params: Union[Unset, dict[str, Any]] = UNSET + severity_params: Unset | dict[str, Any] = UNSET if not isinstance(self.severity_params, Unset): severity_params = self.severity_params.to_dict() @@ -74,7 +74,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _kind = d.pop("kind", UNSET) - kind: Union[Unset, UpdateIncidentPermissionSetResourceDataAttributesKind] + kind: Unset | UpdateIncidentPermissionSetResourceDataAttributesKind if isinstance(_kind, Unset): kind = UNSET else: @@ -87,7 +87,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: resource_type = d.pop("resource_type", UNSET) _severity_params = d.pop("severity_params", UNSET) - severity_params: Union[Unset, UpdateIncidentPermissionSetResourceDataAttributesSeverityParams] + severity_params: Unset | UpdateIncidentPermissionSetResourceDataAttributesSeverityParams if isinstance(_severity_params, Unset): severity_params = UNSET else: diff --git a/rootly_sdk/models/update_incident_permission_set_resource_data_attributes_severity_params.py b/rootly_sdk/models/update_incident_permission_set_resource_data_attributes_severity_params.py index 779e2bb7..eb5ea221 100644 --- a/rootly_sdk/models/update_incident_permission_set_resource_data_attributes_severity_params.py +++ b/rootly_sdk/models/update_incident_permission_set_resource_data_attributes_severity_params.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,10 +21,10 @@ class UpdateIncidentPermissionSetResourceDataAttributesSeverityParams: matching severity """ - fully_enabled: Union[Unset, bool] = True - create_enabled: Union[Unset, bool] = False - applies_to_unassigned: Union[Unset, bool] = True - severity_ids: Union[None, Unset, list[str]] = UNSET + fully_enabled: Unset | bool = True + create_enabled: Unset | bool = False + applies_to_unassigned: Unset | bool = True + severity_ids: None | Unset | list[str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -34,7 +34,7 @@ def to_dict(self) -> dict[str, Any]: applies_to_unassigned = self.applies_to_unassigned - severity_ids: Union[None, Unset, list[str]] + severity_ids: None | Unset | list[str] if isinstance(self.severity_ids, Unset): severity_ids = UNSET elif isinstance(self.severity_ids, list): @@ -66,7 +66,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: applies_to_unassigned = d.pop("applies_to_unassigned", UNSET) - def _parse_severity_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_severity_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -79,7 +79,7 @@ def _parse_severity_ids(data: object) -> Union[None, Unset, list[str]]: return severity_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) severity_ids = _parse_severity_ids(d.pop("severity_ids", UNSET)) diff --git a/rootly_sdk/models/update_incident_post_mortem_data_attributes.py b/rootly_sdk/models/update_incident_post_mortem_data_attributes.py index 32b1703b..231645bc 100644 --- a/rootly_sdk/models/update_incident_post_mortem_data_attributes.py +++ b/rootly_sdk/models/update_incident_post_mortem_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -34,43 +34,43 @@ class UpdateIncidentPostMortemDataAttributes: cause_ids (Union[None, Unset, list[str]]): The Cause IDs to attach to the incident retrospective """ - title: Union[Unset, str] = UNSET - status: Union[Unset, UpdateIncidentPostMortemDataAttributesStatus] = UNSET - started_at: Union[None, Unset, str] = UNSET - mitigated_at: Union[None, Unset, str] = UNSET - resolved_at: Union[None, Unset, str] = UNSET - show_timeline: Union[Unset, bool] = UNSET - show_timeline_trail: Union[Unset, bool] = UNSET - show_timeline_genius: Union[Unset, bool] = UNSET - show_timeline_tasks: Union[Unset, bool] = UNSET - show_timeline_action_items: Union[Unset, bool] = UNSET - show_services_impacted: Union[Unset, bool] = UNSET - show_functionalities_impacted: Union[Unset, bool] = UNSET - show_groups_impacted: Union[Unset, bool] = UNSET - show_alerts_attached: Union[Unset, bool] = UNSET - show_action_items: Union[Unset, bool] = UNSET - cause_ids: Union[None, Unset, list[str]] = UNSET + title: Unset | str = UNSET + status: Unset | UpdateIncidentPostMortemDataAttributesStatus = UNSET + started_at: None | Unset | str = UNSET + mitigated_at: None | Unset | str = UNSET + resolved_at: None | Unset | str = UNSET + show_timeline: Unset | bool = UNSET + show_timeline_trail: Unset | bool = UNSET + show_timeline_genius: Unset | bool = UNSET + show_timeline_tasks: Unset | bool = UNSET + show_timeline_action_items: Unset | bool = UNSET + show_services_impacted: Unset | bool = UNSET + show_functionalities_impacted: Unset | bool = UNSET + show_groups_impacted: Unset | bool = UNSET + show_alerts_attached: Unset | bool = UNSET + show_action_items: Unset | bool = UNSET + cause_ids: None | Unset | list[str] = UNSET def to_dict(self) -> dict[str, Any]: title = self.title - status: Union[Unset, str] = UNSET + status: Unset | str = UNSET if not isinstance(self.status, Unset): status = self.status - started_at: Union[None, Unset, str] + started_at: None | Unset | str if isinstance(self.started_at, Unset): started_at = UNSET else: started_at = self.started_at - mitigated_at: Union[None, Unset, str] + mitigated_at: None | Unset | str if isinstance(self.mitigated_at, Unset): mitigated_at = UNSET else: mitigated_at = self.mitigated_at - resolved_at: Union[None, Unset, str] + resolved_at: None | Unset | str if isinstance(self.resolved_at, Unset): resolved_at = UNSET else: @@ -96,7 +96,7 @@ def to_dict(self) -> dict[str, Any]: show_action_items = self.show_action_items - cause_ids: Union[None, Unset, list[str]] + cause_ids: None | Unset | list[str] if isinstance(self.cause_ids, Unset): cause_ids = UNSET elif isinstance(self.cause_ids, list): @@ -149,36 +149,36 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: title = d.pop("title", UNSET) _status = d.pop("status", UNSET) - status: Union[Unset, UpdateIncidentPostMortemDataAttributesStatus] + status: Unset | UpdateIncidentPostMortemDataAttributesStatus if isinstance(_status, Unset): status = UNSET else: status = check_update_incident_post_mortem_data_attributes_status(_status) - def _parse_started_at(data: object) -> Union[None, Unset, str]: + def _parse_started_at(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) started_at = _parse_started_at(d.pop("started_at", UNSET)) - def _parse_mitigated_at(data: object) -> Union[None, Unset, str]: + def _parse_mitigated_at(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) mitigated_at = _parse_mitigated_at(d.pop("mitigated_at", UNSET)) - def _parse_resolved_at(data: object) -> Union[None, Unset, str]: + def _parse_resolved_at(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) resolved_at = _parse_resolved_at(d.pop("resolved_at", UNSET)) @@ -202,7 +202,7 @@ def _parse_resolved_at(data: object) -> Union[None, Unset, str]: show_action_items = d.pop("show_action_items", UNSET) - def _parse_cause_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_cause_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -215,7 +215,7 @@ def _parse_cause_ids(data: object) -> Union[None, Unset, list[str]]: return cause_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) cause_ids = _parse_cause_ids(d.pop("cause_ids", UNSET)) diff --git a/rootly_sdk/models/update_incident_postmortem_task_params.py b/rootly_sdk/models/update_incident_postmortem_task_params.py index e942111a..8d742a44 100644 --- a/rootly_sdk/models/update_incident_postmortem_task_params.py +++ b/rootly_sdk/models/update_incident_postmortem_task_params.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -24,25 +24,25 @@ class UpdateIncidentPostmortemTaskParams: """ postmortem_id: str - task_type: Union[Unset, UpdateIncidentPostmortemTaskParamsTaskType] = UNSET - title: Union[None, Unset, str] = UNSET - status: Union[None, Unset, str] = UNSET + task_type: Unset | UpdateIncidentPostmortemTaskParamsTaskType = UNSET + title: None | Unset | str = UNSET + status: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: postmortem_id = self.postmortem_id - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - title: Union[None, Unset, str] + title: None | Unset | str if isinstance(self.title, Unset): title = UNSET else: title = self.title - status: Union[None, Unset, str] + status: None | Unset | str if isinstance(self.status, Unset): status = UNSET else: @@ -70,27 +70,27 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: postmortem_id = d.pop("postmortem_id") _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, UpdateIncidentPostmortemTaskParamsTaskType] + task_type: Unset | UpdateIncidentPostmortemTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: task_type = check_update_incident_postmortem_task_params_task_type(_task_type) - def _parse_title(data: object) -> Union[None, Unset, str]: + def _parse_title(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) title = _parse_title(d.pop("title", UNSET)) - def _parse_status(data: object) -> Union[None, Unset, str]: + def _parse_status(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) status = _parse_status(d.pop("status", UNSET)) diff --git a/rootly_sdk/models/update_incident_retrospective_step_data_attributes.py b/rootly_sdk/models/update_incident_retrospective_step_data_attributes.py index fa50532e..9b8c22d6 100644 --- a/rootly_sdk/models/update_incident_retrospective_step_data_attributes.py +++ b/rootly_sdk/models/update_incident_retrospective_step_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -25,29 +25,29 @@ class UpdateIncidentRetrospectiveStepDataAttributes: step """ - title: Union[Unset, str] = UNSET - description: Union[None, Unset, str] = UNSET - due_date: Union[None, Unset, str] = UNSET - position: Union[None, Unset, int] = UNSET - skippable: Union[Unset, bool] = UNSET - status: Union[Unset, UpdateIncidentRetrospectiveStepDataAttributesStatus] = UNSET + title: Unset | str = UNSET + description: None | Unset | str = UNSET + due_date: None | Unset | str = UNSET + position: None | Unset | int = UNSET + skippable: Unset | bool = UNSET + status: Unset | UpdateIncidentRetrospectiveStepDataAttributesStatus = UNSET def to_dict(self) -> dict[str, Any]: title = self.title - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - due_date: Union[None, Unset, str] + due_date: None | Unset | str if isinstance(self.due_date, Unset): due_date = UNSET else: due_date = self.due_date - position: Union[None, Unset, int] + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: @@ -55,7 +55,7 @@ def to_dict(self) -> dict[str, Any]: skippable = self.skippable - status: Union[Unset, str] = UNSET + status: Unset | str = UNSET if not isinstance(self.status, Unset): status = self.status @@ -82,37 +82,37 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) title = d.pop("title", UNSET) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_due_date(data: object) -> Union[None, Unset, str]: + def _parse_due_date(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) due_date = _parse_due_date(d.pop("due_date", UNSET)) - def _parse_position(data: object) -> Union[None, Unset, int]: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) skippable = d.pop("skippable", UNSET) _status = d.pop("status", UNSET) - status: Union[Unset, UpdateIncidentRetrospectiveStepDataAttributesStatus] + status: Unset | UpdateIncidentRetrospectiveStepDataAttributesStatus if isinstance(_status, Unset): status = UNSET else: diff --git a/rootly_sdk/models/update_incident_role_data_attributes.py b/rootly_sdk/models/update_incident_role_data_attributes.py index b028b29e..4282bbfb 100644 --- a/rootly_sdk/models/update_incident_role_data_attributes.py +++ b/rootly_sdk/models/update_incident_role_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -23,17 +23,17 @@ class UpdateIncidentRoleDataAttributes: allow_multi_user_assignment (Union[Unset, bool]): """ - slug: Union[None, Unset, str] = UNSET - name: Union[Unset, str] = UNSET - summary: Union[None, Unset, str] = UNSET - description: Union[None, Unset, str] = UNSET - position: Union[None, Unset, int] = UNSET - optional: Union[Unset, bool] = UNSET - enabled: Union[Unset, bool] = UNSET - allow_multi_user_assignment: Union[Unset, bool] = UNSET + slug: None | Unset | str = UNSET + name: Unset | str = UNSET + summary: None | Unset | str = UNSET + description: None | Unset | str = UNSET + position: None | Unset | int = UNSET + optional: Unset | bool = UNSET + enabled: Unset | bool = UNSET + allow_multi_user_assignment: Unset | bool = UNSET def to_dict(self) -> dict[str, Any]: - slug: Union[None, Unset, str] + slug: None | Unset | str if isinstance(self.slug, Unset): slug = UNSET else: @@ -41,19 +41,19 @@ def to_dict(self) -> dict[str, Any]: name = self.name - summary: Union[None, Unset, str] + summary: None | Unset | str if isinstance(self.summary, Unset): summary = UNSET else: summary = self.summary - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - position: Union[None, Unset, int] + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: @@ -91,41 +91,41 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_slug(data: object) -> Union[None, Unset, str]: + def _parse_slug(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) slug = _parse_slug(d.pop("slug", UNSET)) name = d.pop("name", UNSET) - def _parse_summary(data: object) -> Union[None, Unset, str]: + def _parse_summary(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) summary = _parse_summary(d.pop("summary", UNSET)) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_position(data: object) -> Union[None, Unset, int]: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) diff --git a/rootly_sdk/models/update_incident_role_task_data_attributes.py b/rootly_sdk/models/update_incident_role_task_data_attributes.py index aa79b49d..877ac36e 100644 --- a/rootly_sdk/models/update_incident_role_task_data_attributes.py +++ b/rootly_sdk/models/update_incident_role_task_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -21,20 +21,20 @@ class UpdateIncidentRoleTaskDataAttributes: priority (Union[Unset, UpdateIncidentRoleTaskDataAttributesPriority]): The priority of the incident task """ - task: Union[Unset, str] = UNSET - description: Union[None, Unset, str] = UNSET - priority: Union[Unset, UpdateIncidentRoleTaskDataAttributesPriority] = UNSET + task: Unset | str = UNSET + description: None | Unset | str = UNSET + priority: Unset | UpdateIncidentRoleTaskDataAttributesPriority = UNSET def to_dict(self) -> dict[str, Any]: task = self.task - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - priority: Union[Unset, str] = UNSET + priority: Unset | str = UNSET if not isinstance(self.priority, Unset): priority = self.priority @@ -55,17 +55,17 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) task = d.pop("task", UNSET) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) _priority = d.pop("priority", UNSET) - priority: Union[Unset, UpdateIncidentRoleTaskDataAttributesPriority] + priority: Unset | UpdateIncidentRoleTaskDataAttributesPriority if isinstance(_priority, Unset): priority = UNSET else: diff --git a/rootly_sdk/models/update_incident_status_page_event_data_attributes.py b/rootly_sdk/models/update_incident_status_page_event_data_attributes.py index 4301ad3a..a768cbf3 100644 --- a/rootly_sdk/models/update_incident_status_page_event_data_attributes.py +++ b/rootly_sdk/models/update_incident_status_page_event_data_attributes.py @@ -1,6 +1,6 @@ import datetime from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from dateutil.parser import isoparse @@ -27,35 +27,35 @@ class UpdateIncidentStatusPageEventDataAttributes: started_at (Union[None, Unset, datetime.datetime]): When the event started. """ - event: Union[Unset, str] = UNSET - status_page_id: Union[Unset, str] = UNSET - status: Union[Unset, UpdateIncidentStatusPageEventDataAttributesStatus] = UNSET - notify_subscribers: Union[None, Unset, bool] = False - should_tweet: Union[None, Unset, bool] = False - started_at: Union[None, Unset, datetime.datetime] = UNSET + event: Unset | str = UNSET + status_page_id: Unset | str = UNSET + status: Unset | UpdateIncidentStatusPageEventDataAttributesStatus = UNSET + notify_subscribers: None | Unset | bool = False + should_tweet: None | Unset | bool = False + started_at: None | Unset | datetime.datetime = UNSET def to_dict(self) -> dict[str, Any]: event = self.event status_page_id = self.status_page_id - status: Union[Unset, str] = UNSET + status: Unset | str = UNSET if not isinstance(self.status, Unset): status = self.status - notify_subscribers: Union[None, Unset, bool] + notify_subscribers: None | Unset | bool if isinstance(self.notify_subscribers, Unset): notify_subscribers = UNSET else: notify_subscribers = self.notify_subscribers - should_tweet: Union[None, Unset, bool] + should_tweet: None | Unset | bool if isinstance(self.should_tweet, Unset): should_tweet = UNSET else: should_tweet = self.should_tweet - started_at: Union[None, Unset, str] + started_at: None | Unset | str if isinstance(self.started_at, Unset): started_at = UNSET elif isinstance(self.started_at, datetime.datetime): @@ -89,31 +89,31 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: status_page_id = d.pop("status_page_id", UNSET) _status = d.pop("status", UNSET) - status: Union[Unset, UpdateIncidentStatusPageEventDataAttributesStatus] + status: Unset | UpdateIncidentStatusPageEventDataAttributesStatus if isinstance(_status, Unset): status = UNSET else: status = check_update_incident_status_page_event_data_attributes_status(_status) - def _parse_notify_subscribers(data: object) -> Union[None, Unset, bool]: + def _parse_notify_subscribers(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) notify_subscribers = _parse_notify_subscribers(d.pop("notify_subscribers", UNSET)) - def _parse_should_tweet(data: object) -> Union[None, Unset, bool]: + def _parse_should_tweet(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) should_tweet = _parse_should_tweet(d.pop("should_tweet", UNSET)) - def _parse_started_at(data: object) -> Union[None, Unset, datetime.datetime]: + def _parse_started_at(data: object) -> None | Unset | datetime.datetime: if data is None: return data if isinstance(data, Unset): @@ -126,7 +126,7 @@ def _parse_started_at(data: object) -> Union[None, Unset, datetime.datetime]: return started_at_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, datetime.datetime], data) + return cast(None | Unset | datetime.datetime, data) started_at = _parse_started_at(d.pop("started_at", UNSET)) diff --git a/rootly_sdk/models/update_incident_status_timestamp_task_params.py b/rootly_sdk/models/update_incident_status_timestamp_task_params.py index bb817768..dca1d18e 100644 --- a/rootly_sdk/models/update_incident_status_timestamp_task_params.py +++ b/rootly_sdk/models/update_incident_status_timestamp_task_params.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -24,7 +24,7 @@ class UpdateIncidentStatusTimestampTaskParams: sub_status_id: str assigned_at: str - task_type: Union[Unset, UpdateIncidentStatusTimestampTaskParamsTaskType] = UNSET + task_type: Unset | UpdateIncidentStatusTimestampTaskParamsTaskType = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -32,7 +32,7 @@ def to_dict(self) -> dict[str, Any]: assigned_at = self.assigned_at - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -57,7 +57,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: assigned_at = d.pop("assigned_at") _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, UpdateIncidentStatusTimestampTaskParamsTaskType] + task_type: Unset | UpdateIncidentStatusTimestampTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/update_incident_sub_status_data_attributes.py b/rootly_sdk/models/update_incident_sub_status_data_attributes.py index b7d0cf44..bac58bb0 100644 --- a/rootly_sdk/models/update_incident_sub_status_data_attributes.py +++ b/rootly_sdk/models/update_incident_sub_status_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -19,16 +19,16 @@ class UpdateIncidentSubStatusDataAttributes: assigned_by_user_id (Union[None, Unset, int]): """ - sub_status_id: Union[Unset, str] = UNSET - assigned_at: Union[Unset, str] = UNSET - assigned_by_user_id: Union[None, Unset, int] = UNSET + sub_status_id: Unset | str = UNSET + assigned_at: Unset | str = UNSET + assigned_by_user_id: None | Unset | int = UNSET def to_dict(self) -> dict[str, Any]: sub_status_id = self.sub_status_id assigned_at = self.assigned_at - assigned_by_user_id: Union[None, Unset, int] + assigned_by_user_id: None | Unset | int if isinstance(self.assigned_by_user_id, Unset): assigned_by_user_id = UNSET else: @@ -53,12 +53,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: assigned_at = d.pop("assigned_at", UNSET) - def _parse_assigned_by_user_id(data: object) -> Union[None, Unset, int]: + def _parse_assigned_by_user_id(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) assigned_by_user_id = _parse_assigned_by_user_id(d.pop("assigned_by_user_id", UNSET)) diff --git a/rootly_sdk/models/update_incident_task_params.py b/rootly_sdk/models/update_incident_task_params.py index acfc21b9..65baa1d0 100644 --- a/rootly_sdk/models/update_incident_task_params.py +++ b/rootly_sdk/models/update_incident_task_params.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -44,62 +44,62 @@ class UpdateIncidentTaskParams: """ incident_id: str - task_type: Union[Unset, UpdateIncidentTaskParamsTaskType] = UNSET - attribute_to_query_by: Union[Unset, UpdateIncidentTaskParamsAttributeToQueryBy] = "id" - title: Union[None, Unset, str] = UNSET - summary: Union[None, Unset, str] = UNSET - status: Union[None, Unset, str] = UNSET - severity_id: Union[None, Unset, str] = UNSET - incident_type_ids: Union[None, Unset, list[str]] = UNSET - service_ids: Union[None, Unset, list[str]] = UNSET - functionality_ids: Union[None, Unset, list[str]] = UNSET - environment_ids: Union[None, Unset, list[str]] = UNSET - group_ids: Union[None, Unset, list[str]] = UNSET - started_at: Union[None, Unset, str] = UNSET - detected_at: Union[None, Unset, str] = UNSET - acknowledged_at: Union[None, Unset, str] = UNSET - mitigated_at: Union[None, Unset, str] = UNSET - resolved_at: Union[None, Unset, str] = UNSET - private: Union[Unset, bool] = UNSET - custom_fields_mapping: Union[None, Unset, str] = UNSET + task_type: Unset | UpdateIncidentTaskParamsTaskType = UNSET + attribute_to_query_by: Unset | UpdateIncidentTaskParamsAttributeToQueryBy = "id" + title: None | Unset | str = UNSET + summary: None | Unset | str = UNSET + status: None | Unset | str = UNSET + severity_id: None | Unset | str = UNSET + incident_type_ids: None | Unset | list[str] = UNSET + service_ids: None | Unset | list[str] = UNSET + functionality_ids: None | Unset | list[str] = UNSET + environment_ids: None | Unset | list[str] = UNSET + group_ids: None | Unset | list[str] = UNSET + started_at: None | Unset | str = UNSET + detected_at: None | Unset | str = UNSET + acknowledged_at: None | Unset | str = UNSET + mitigated_at: None | Unset | str = UNSET + resolved_at: None | Unset | str = UNSET + private: Unset | bool = UNSET + custom_fields_mapping: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: incident_id = self.incident_id - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - attribute_to_query_by: Union[Unset, str] = UNSET + attribute_to_query_by: Unset | str = UNSET if not isinstance(self.attribute_to_query_by, Unset): attribute_to_query_by = self.attribute_to_query_by - title: Union[None, Unset, str] + title: None | Unset | str if isinstance(self.title, Unset): title = UNSET else: title = self.title - summary: Union[None, Unset, str] + summary: None | Unset | str if isinstance(self.summary, Unset): summary = UNSET else: summary = self.summary - status: Union[None, Unset, str] + status: None | Unset | str if isinstance(self.status, Unset): status = UNSET else: status = self.status - severity_id: Union[None, Unset, str] + severity_id: None | Unset | str if isinstance(self.severity_id, Unset): severity_id = UNSET else: severity_id = self.severity_id - incident_type_ids: Union[None, Unset, list[str]] + incident_type_ids: None | Unset | list[str] if isinstance(self.incident_type_ids, Unset): incident_type_ids = UNSET elif isinstance(self.incident_type_ids, list): @@ -108,7 +108,7 @@ def to_dict(self) -> dict[str, Any]: else: incident_type_ids = self.incident_type_ids - service_ids: Union[None, Unset, list[str]] + service_ids: None | Unset | list[str] if isinstance(self.service_ids, Unset): service_ids = UNSET elif isinstance(self.service_ids, list): @@ -117,7 +117,7 @@ def to_dict(self) -> dict[str, Any]: else: service_ids = self.service_ids - functionality_ids: Union[None, Unset, list[str]] + functionality_ids: None | Unset | list[str] if isinstance(self.functionality_ids, Unset): functionality_ids = UNSET elif isinstance(self.functionality_ids, list): @@ -126,7 +126,7 @@ def to_dict(self) -> dict[str, Any]: else: functionality_ids = self.functionality_ids - environment_ids: Union[None, Unset, list[str]] + environment_ids: None | Unset | list[str] if isinstance(self.environment_ids, Unset): environment_ids = UNSET elif isinstance(self.environment_ids, list): @@ -135,7 +135,7 @@ def to_dict(self) -> dict[str, Any]: else: environment_ids = self.environment_ids - group_ids: Union[None, Unset, list[str]] + group_ids: None | Unset | list[str] if isinstance(self.group_ids, Unset): group_ids = UNSET elif isinstance(self.group_ids, list): @@ -144,31 +144,31 @@ def to_dict(self) -> dict[str, Any]: else: group_ids = self.group_ids - started_at: Union[None, Unset, str] + started_at: None | Unset | str if isinstance(self.started_at, Unset): started_at = UNSET else: started_at = self.started_at - detected_at: Union[None, Unset, str] + detected_at: None | Unset | str if isinstance(self.detected_at, Unset): detected_at = UNSET else: detected_at = self.detected_at - acknowledged_at: Union[None, Unset, str] + acknowledged_at: None | Unset | str if isinstance(self.acknowledged_at, Unset): acknowledged_at = UNSET else: acknowledged_at = self.acknowledged_at - mitigated_at: Union[None, Unset, str] + mitigated_at: None | Unset | str if isinstance(self.mitigated_at, Unset): mitigated_at = UNSET else: mitigated_at = self.mitigated_at - resolved_at: Union[None, Unset, str] + resolved_at: None | Unset | str if isinstance(self.resolved_at, Unset): resolved_at = UNSET else: @@ -176,7 +176,7 @@ def to_dict(self) -> dict[str, Any]: private = self.private - custom_fields_mapping: Union[None, Unset, str] + custom_fields_mapping: None | Unset | str if isinstance(self.custom_fields_mapping, Unset): custom_fields_mapping = UNSET else: @@ -234,56 +234,56 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: incident_id = d.pop("incident_id") _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, UpdateIncidentTaskParamsTaskType] + task_type: Unset | UpdateIncidentTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: task_type = check_update_incident_task_params_task_type(_task_type) _attribute_to_query_by = d.pop("attribute_to_query_by", UNSET) - attribute_to_query_by: Union[Unset, UpdateIncidentTaskParamsAttributeToQueryBy] + attribute_to_query_by: Unset | UpdateIncidentTaskParamsAttributeToQueryBy if isinstance(_attribute_to_query_by, Unset): attribute_to_query_by = UNSET else: attribute_to_query_by = check_update_incident_task_params_attribute_to_query_by(_attribute_to_query_by) - def _parse_title(data: object) -> Union[None, Unset, str]: + def _parse_title(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) title = _parse_title(d.pop("title", UNSET)) - def _parse_summary(data: object) -> Union[None, Unset, str]: + def _parse_summary(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) summary = _parse_summary(d.pop("summary", UNSET)) - def _parse_status(data: object) -> Union[None, Unset, str]: + def _parse_status(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) status = _parse_status(d.pop("status", UNSET)) - def _parse_severity_id(data: object) -> Union[None, Unset, str]: + def _parse_severity_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) severity_id = _parse_severity_id(d.pop("severity_id", UNSET)) - def _parse_incident_type_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_incident_type_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -296,11 +296,11 @@ def _parse_incident_type_ids(data: object) -> Union[None, Unset, list[str]]: return incident_type_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) incident_type_ids = _parse_incident_type_ids(d.pop("incident_type_ids", UNSET)) - def _parse_service_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_service_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -313,11 +313,11 @@ def _parse_service_ids(data: object) -> Union[None, Unset, list[str]]: return service_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) service_ids = _parse_service_ids(d.pop("service_ids", UNSET)) - def _parse_functionality_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_functionality_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -330,11 +330,11 @@ def _parse_functionality_ids(data: object) -> Union[None, Unset, list[str]]: return functionality_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) functionality_ids = _parse_functionality_ids(d.pop("functionality_ids", UNSET)) - def _parse_environment_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_environment_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -347,11 +347,11 @@ def _parse_environment_ids(data: object) -> Union[None, Unset, list[str]]: return environment_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) environment_ids = _parse_environment_ids(d.pop("environment_ids", UNSET)) - def _parse_group_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_group_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -364,63 +364,63 @@ def _parse_group_ids(data: object) -> Union[None, Unset, list[str]]: return group_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) group_ids = _parse_group_ids(d.pop("group_ids", UNSET)) - def _parse_started_at(data: object) -> Union[None, Unset, str]: + def _parse_started_at(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) started_at = _parse_started_at(d.pop("started_at", UNSET)) - def _parse_detected_at(data: object) -> Union[None, Unset, str]: + def _parse_detected_at(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) detected_at = _parse_detected_at(d.pop("detected_at", UNSET)) - def _parse_acknowledged_at(data: object) -> Union[None, Unset, str]: + def _parse_acknowledged_at(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) acknowledged_at = _parse_acknowledged_at(d.pop("acknowledged_at", UNSET)) - def _parse_mitigated_at(data: object) -> Union[None, Unset, str]: + def _parse_mitigated_at(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) mitigated_at = _parse_mitigated_at(d.pop("mitigated_at", UNSET)) - def _parse_resolved_at(data: object) -> Union[None, Unset, str]: + def _parse_resolved_at(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) resolved_at = _parse_resolved_at(d.pop("resolved_at", UNSET)) private = d.pop("private", UNSET) - def _parse_custom_fields_mapping(data: object) -> Union[None, Unset, str]: + def _parse_custom_fields_mapping(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) custom_fields_mapping = _parse_custom_fields_mapping(d.pop("custom_fields_mapping", UNSET)) diff --git a/rootly_sdk/models/update_incident_type_data_attributes.py b/rootly_sdk/models/update_incident_type_data_attributes.py index 8d234f4a..4559b0ec 100644 --- a/rootly_sdk/models/update_incident_type_data_attributes.py +++ b/rootly_sdk/models/update_incident_type_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define @@ -40,19 +40,19 @@ class UpdateIncidentTypeDataAttributes: this incident type. """ - slug: Union[None, Unset, str] = UNSET - name: Union[Unset, str] = UNSET - description: Union[None, Unset, str] = UNSET - public_description: Union[None, Unset, str] = UNSET - color: Union[None, Unset, str] = UNSET - position: Union[None, Unset, int] = UNSET - notify_emails: Union[None, Unset, list[str]] = UNSET - slack_channels: Union[None, Unset, list["UpdateIncidentTypeDataAttributesSlackChannelsType0Item"]] = UNSET - slack_aliases: Union[None, Unset, list["UpdateIncidentTypeDataAttributesSlackAliasesType0Item"]] = UNSET - properties: Union[Unset, list["UpdateIncidentTypeDataAttributesPropertiesItem"]] = UNSET + slug: None | Unset | str = UNSET + name: Unset | str = UNSET + description: None | Unset | str = UNSET + public_description: None | Unset | str = UNSET + color: None | Unset | str = UNSET + position: None | Unset | int = UNSET + notify_emails: None | Unset | list[str] = UNSET + slack_channels: None | Unset | list["UpdateIncidentTypeDataAttributesSlackChannelsType0Item"] = UNSET + slack_aliases: None | Unset | list["UpdateIncidentTypeDataAttributesSlackAliasesType0Item"] = UNSET + properties: Unset | list["UpdateIncidentTypeDataAttributesPropertiesItem"] = UNSET def to_dict(self) -> dict[str, Any]: - slug: Union[None, Unset, str] + slug: None | Unset | str if isinstance(self.slug, Unset): slug = UNSET else: @@ -60,31 +60,31 @@ def to_dict(self) -> dict[str, Any]: name = self.name - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - public_description: Union[None, Unset, str] + public_description: None | Unset | str if isinstance(self.public_description, Unset): public_description = UNSET else: public_description = self.public_description - color: Union[None, Unset, str] + color: None | Unset | str if isinstance(self.color, Unset): color = UNSET else: color = self.color - position: Union[None, Unset, int] + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: position = self.position - notify_emails: Union[None, Unset, list[str]] + notify_emails: None | Unset | list[str] if isinstance(self.notify_emails, Unset): notify_emails = UNSET elif isinstance(self.notify_emails, list): @@ -93,7 +93,7 @@ def to_dict(self) -> dict[str, Any]: else: notify_emails = self.notify_emails - slack_channels: Union[None, Unset, list[dict[str, Any]]] + slack_channels: None | Unset | list[dict[str, Any]] if isinstance(self.slack_channels, Unset): slack_channels = UNSET elif isinstance(self.slack_channels, list): @@ -105,7 +105,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_channels = self.slack_channels - slack_aliases: Union[None, Unset, list[dict[str, Any]]] + slack_aliases: None | Unset | list[dict[str, Any]] if isinstance(self.slack_aliases, Unset): slack_aliases = UNSET elif isinstance(self.slack_aliases, list): @@ -117,7 +117,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_aliases = self.slack_aliases - properties: Union[Unset, list[dict[str, Any]]] = UNSET + properties: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.properties, Unset): properties = [] for properties_item_data in self.properties: @@ -164,54 +164,54 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_slug(data: object) -> Union[None, Unset, str]: + def _parse_slug(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) slug = _parse_slug(d.pop("slug", UNSET)) name = d.pop("name", UNSET) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_public_description(data: object) -> Union[None, Unset, str]: + def _parse_public_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) public_description = _parse_public_description(d.pop("public_description", UNSET)) - def _parse_color(data: object) -> Union[None, Unset, str]: + def _parse_color(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) color = _parse_color(d.pop("color", UNSET)) - def _parse_position(data: object) -> Union[None, Unset, int]: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) - def _parse_notify_emails(data: object) -> Union[None, Unset, list[str]]: + def _parse_notify_emails(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -224,13 +224,13 @@ def _parse_notify_emails(data: object) -> Union[None, Unset, list[str]]: return notify_emails_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) notify_emails = _parse_notify_emails(d.pop("notify_emails", UNSET)) def _parse_slack_channels( data: object, - ) -> Union[None, Unset, list["UpdateIncidentTypeDataAttributesSlackChannelsType0Item"]]: + ) -> None | Unset | list["UpdateIncidentTypeDataAttributesSlackChannelsType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -250,13 +250,13 @@ def _parse_slack_channels( return slack_channels_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list["UpdateIncidentTypeDataAttributesSlackChannelsType0Item"]], data) + return cast(None | Unset | list["UpdateIncidentTypeDataAttributesSlackChannelsType0Item"], data) slack_channels = _parse_slack_channels(d.pop("slack_channels", UNSET)) def _parse_slack_aliases( data: object, - ) -> Union[None, Unset, list["UpdateIncidentTypeDataAttributesSlackAliasesType0Item"]]: + ) -> None | Unset | list["UpdateIncidentTypeDataAttributesSlackAliasesType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -276,7 +276,7 @@ def _parse_slack_aliases( return slack_aliases_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list["UpdateIncidentTypeDataAttributesSlackAliasesType0Item"]], data) + return cast(None | Unset | list["UpdateIncidentTypeDataAttributesSlackAliasesType0Item"], data) slack_aliases = _parse_slack_aliases(d.pop("slack_aliases", UNSET)) diff --git a/rootly_sdk/models/update_jira_issue_task_params.py b/rootly_sdk/models/update_jira_issue_task_params.py index 9fbc9e06..05e65d09 100644 --- a/rootly_sdk/models/update_jira_issue_task_params.py +++ b/rootly_sdk/models/update_jira_issue_task_params.py @@ -47,20 +47,20 @@ class UpdateJiraIssueTaskParams: issue_id: str project_key: str - task_type: Union[Unset, UpdateJiraIssueTaskParamsTaskType] = UNSET + task_type: Unset | UpdateJiraIssueTaskParamsTaskType = UNSET integration: Union[Unset, "UpdateJiraIssueTaskParamsIntegration"] = UNSET - title: Union[Unset, str] = UNSET - description: Union[Unset, str] = UNSET - labels: Union[Unset, str] = UNSET - assign_user_email: Union[Unset, str] = UNSET - reporter_user_email: Union[Unset, str] = UNSET - due_date: Union[Unset, str] = UNSET + title: Unset | str = UNSET + description: Unset | str = UNSET + labels: Unset | str = UNSET + assign_user_email: Unset | str = UNSET + reporter_user_email: Unset | str = UNSET + due_date: Unset | str = UNSET priority: Union[Unset, "UpdateJiraIssueTaskParamsPriority"] = UNSET status: Union[Unset, "UpdateJiraIssueTaskParamsStatus"] = UNSET - custom_fields_mapping: Union[None, Unset, str] = UNSET - update_payload: Union[None, Unset, str] = UNSET - retry_count: Union[Unset, int] = 0 - retry_wait_time: Union[Unset, int] = 1 + custom_fields_mapping: None | Unset | str = UNSET + update_payload: None | Unset | str = UNSET + retry_count: Unset | int = 0 + retry_wait_time: Unset | int = 1 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -68,11 +68,11 @@ def to_dict(self) -> dict[str, Any]: project_key = self.project_key - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - integration: Union[Unset, dict[str, Any]] = UNSET + integration: Unset | dict[str, Any] = UNSET if not isinstance(self.integration, Unset): integration = self.integration.to_dict() @@ -88,21 +88,21 @@ def to_dict(self) -> dict[str, Any]: due_date = self.due_date - priority: Union[Unset, dict[str, Any]] = UNSET + priority: Unset | dict[str, Any] = UNSET if not isinstance(self.priority, Unset): priority = self.priority.to_dict() - status: Union[Unset, dict[str, Any]] = UNSET + status: Unset | dict[str, Any] = UNSET if not isinstance(self.status, Unset): status = self.status.to_dict() - custom_fields_mapping: Union[None, Unset, str] + custom_fields_mapping: None | Unset | str if isinstance(self.custom_fields_mapping, Unset): custom_fields_mapping = UNSET else: custom_fields_mapping = self.custom_fields_mapping - update_payload: Union[None, Unset, str] + update_payload: None | Unset | str if isinstance(self.update_payload, Unset): update_payload = UNSET else: @@ -163,14 +163,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: project_key = d.pop("project_key") _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, UpdateJiraIssueTaskParamsTaskType] + task_type: Unset | UpdateJiraIssueTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: task_type = check_update_jira_issue_task_params_task_type(_task_type) _integration = d.pop("integration", UNSET) - integration: Union[Unset, UpdateJiraIssueTaskParamsIntegration] + integration: Unset | UpdateJiraIssueTaskParamsIntegration if isinstance(_integration, Unset): integration = UNSET else: @@ -189,34 +189,34 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: due_date = d.pop("due_date", UNSET) _priority = d.pop("priority", UNSET) - priority: Union[Unset, UpdateJiraIssueTaskParamsPriority] + priority: Unset | UpdateJiraIssueTaskParamsPriority if isinstance(_priority, Unset): priority = UNSET else: priority = UpdateJiraIssueTaskParamsPriority.from_dict(_priority) _status = d.pop("status", UNSET) - status: Union[Unset, UpdateJiraIssueTaskParamsStatus] + status: Unset | UpdateJiraIssueTaskParamsStatus if isinstance(_status, Unset): status = UNSET else: status = UpdateJiraIssueTaskParamsStatus.from_dict(_status) - def _parse_custom_fields_mapping(data: object) -> Union[None, Unset, str]: + def _parse_custom_fields_mapping(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) custom_fields_mapping = _parse_custom_fields_mapping(d.pop("custom_fields_mapping", UNSET)) - def _parse_update_payload(data: object) -> Union[None, Unset, str]: + def _parse_update_payload(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) update_payload = _parse_update_payload(d.pop("update_payload", UNSET)) diff --git a/rootly_sdk/models/update_jira_issue_task_params_integration.py b/rootly_sdk/models/update_jira_issue_task_params_integration.py index b877c632..238ad0fc 100644 --- a/rootly_sdk/models/update_jira_issue_task_params_integration.py +++ b/rootly_sdk/models/update_jira_issue_task_params_integration.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -18,8 +18,8 @@ class UpdateJiraIssueTaskParamsIntegration: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_jira_issue_task_params_priority.py b/rootly_sdk/models/update_jira_issue_task_params_priority.py index 2a70fb58..f932d3d4 100644 --- a/rootly_sdk/models/update_jira_issue_task_params_priority.py +++ b/rootly_sdk/models/update_jira_issue_task_params_priority.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -18,8 +18,8 @@ class UpdateJiraIssueTaskParamsPriority: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_jira_issue_task_params_status.py b/rootly_sdk/models/update_jira_issue_task_params_status.py index 00266d58..f7e32704 100644 --- a/rootly_sdk/models/update_jira_issue_task_params_status.py +++ b/rootly_sdk/models/update_jira_issue_task_params_status.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -18,8 +18,8 @@ class UpdateJiraIssueTaskParamsStatus: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_linear_issue_task_params.py b/rootly_sdk/models/update_linear_issue_task_params.py index de2087f1..6f7c3236 100644 --- a/rootly_sdk/models/update_linear_issue_task_params.py +++ b/rootly_sdk/models/update_linear_issue_task_params.py @@ -38,15 +38,15 @@ class UpdateLinearIssueTaskParams: """ issue_id: str - task_type: Union[Unset, UpdateLinearIssueTaskParamsTaskType] = UNSET - title: Union[Unset, str] = UNSET - description: Union[Unset, str] = UNSET + task_type: Unset | UpdateLinearIssueTaskParamsTaskType = UNSET + title: Unset | str = UNSET + description: Unset | str = UNSET state: Union["UpdateLinearIssueTaskParamsStateType0", None, Unset] = UNSET project: Union[Unset, "UpdateLinearIssueTaskParamsProject"] = UNSET - labels: Union[Unset, list["UpdateLinearIssueTaskParamsLabelsItem"]] = UNSET + labels: Unset | list["UpdateLinearIssueTaskParamsLabelsItem"] = UNSET priority: Union[Unset, "UpdateLinearIssueTaskParamsPriority"] = UNSET - assign_user_email: Union[Unset, str] = UNSET - custom_fields_mapping: Union[None, Unset, str] = UNSET + assign_user_email: Unset | str = UNSET + custom_fields_mapping: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -54,7 +54,7 @@ def to_dict(self) -> dict[str, Any]: issue_id = self.issue_id - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -62,7 +62,7 @@ def to_dict(self) -> dict[str, Any]: description = self.description - state: Union[None, Unset, dict[str, Any]] + state: None | Unset | dict[str, Any] if isinstance(self.state, Unset): state = UNSET elif isinstance(self.state, UpdateLinearIssueTaskParamsStateType0): @@ -70,24 +70,24 @@ def to_dict(self) -> dict[str, Any]: else: state = self.state - project: Union[Unset, dict[str, Any]] = UNSET + project: Unset | dict[str, Any] = UNSET if not isinstance(self.project, Unset): project = self.project.to_dict() - labels: Union[Unset, list[dict[str, Any]]] = UNSET + labels: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.labels, Unset): labels = [] for labels_item_data in self.labels: labels_item = labels_item_data.to_dict() labels.append(labels_item) - priority: Union[Unset, dict[str, Any]] = UNSET + priority: Unset | dict[str, Any] = UNSET if not isinstance(self.priority, Unset): priority = self.priority.to_dict() assign_user_email = self.assign_user_email - custom_fields_mapping: Union[None, Unset, str] + custom_fields_mapping: None | Unset | str if isinstance(self.custom_fields_mapping, Unset): custom_fields_mapping = UNSET else: @@ -132,7 +132,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: issue_id = d.pop("issue_id") _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, UpdateLinearIssueTaskParamsTaskType] + task_type: Unset | UpdateLinearIssueTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: @@ -160,7 +160,7 @@ def _parse_state(data: object) -> Union["UpdateLinearIssueTaskParamsStateType0", state = _parse_state(d.pop("state", UNSET)) _project = d.pop("project", UNSET) - project: Union[Unset, UpdateLinearIssueTaskParamsProject] + project: Unset | UpdateLinearIssueTaskParamsProject if isinstance(_project, Unset): project = UNSET else: @@ -174,7 +174,7 @@ def _parse_state(data: object) -> Union["UpdateLinearIssueTaskParamsStateType0", labels.append(labels_item) _priority = d.pop("priority", UNSET) - priority: Union[Unset, UpdateLinearIssueTaskParamsPriority] + priority: Unset | UpdateLinearIssueTaskParamsPriority if isinstance(_priority, Unset): priority = UNSET else: @@ -182,12 +182,12 @@ def _parse_state(data: object) -> Union["UpdateLinearIssueTaskParamsStateType0", assign_user_email = d.pop("assign_user_email", UNSET) - def _parse_custom_fields_mapping(data: object) -> Union[None, Unset, str]: + def _parse_custom_fields_mapping(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) custom_fields_mapping = _parse_custom_fields_mapping(d.pop("custom_fields_mapping", UNSET)) diff --git a/rootly_sdk/models/update_linear_issue_task_params_labels_item.py b/rootly_sdk/models/update_linear_issue_task_params_labels_item.py index 8abb3770..244efd9a 100644 --- a/rootly_sdk/models/update_linear_issue_task_params_labels_item.py +++ b/rootly_sdk/models/update_linear_issue_task_params_labels_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class UpdateLinearIssueTaskParamsLabelsItem: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_linear_issue_task_params_priority.py b/rootly_sdk/models/update_linear_issue_task_params_priority.py index 2a3129f2..4ca581ca 100644 --- a/rootly_sdk/models/update_linear_issue_task_params_priority.py +++ b/rootly_sdk/models/update_linear_issue_task_params_priority.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -18,8 +18,8 @@ class UpdateLinearIssueTaskParamsPriority: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_linear_issue_task_params_project.py b/rootly_sdk/models/update_linear_issue_task_params_project.py index bdf883c5..7bea360a 100644 --- a/rootly_sdk/models/update_linear_issue_task_params_project.py +++ b/rootly_sdk/models/update_linear_issue_task_params_project.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -18,8 +18,8 @@ class UpdateLinearIssueTaskParamsProject: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_linear_issue_task_params_state_type_0.py b/rootly_sdk/models/update_linear_issue_task_params_state_type_0.py index c35745ae..b18324bb 100644 --- a/rootly_sdk/models/update_linear_issue_task_params_state_type_0.py +++ b/rootly_sdk/models/update_linear_issue_task_params_state_type_0.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -18,8 +18,8 @@ class UpdateLinearIssueTaskParamsStateType0: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_live_call_router_data_attributes.py b/rootly_sdk/models/update_live_call_router_data_attributes.py index 4c965b60..e6799896 100644 --- a/rootly_sdk/models/update_live_call_router_data_attributes.py +++ b/rootly_sdk/models/update_live_call_router_data_attributes.py @@ -74,32 +74,32 @@ class UpdateLiveCallRouterDataAttributes: UpdateLiveCallRouterDataAttributesEscalationPolicyTriggerParams]): """ - kind: Union[Unset, UpdateLiveCallRouterDataAttributesKind] = UNSET - enabled: Union[Unset, bool] = UNSET - name: Union[Unset, str] = UNSET - country_code: Union[Unset, UpdateLiveCallRouterDataAttributesCountryCode] = UNSET - phone_type: Union[Unset, UpdateLiveCallRouterDataAttributesPhoneType] = UNSET - voicemail_greeting: Union[Unset, str] = UNSET - caller_greeting: Union[Unset, str] = UNSET - unavailable_responder_message: Union[None, Unset, str] = UNSET - waiting_music_url: Union[Unset, UpdateLiveCallRouterDataAttributesWaitingMusicUrl] = UNSET - sent_to_voicemail_delay: Union[Unset, int] = UNSET - should_redirect_to_voicemail_on_no_answer: Union[Unset, bool] = UNSET - escalation_level_delay_in_seconds: Union[Unset, int] = UNSET - should_auto_resolve_alert_on_call_end: Union[Unset, bool] = UNSET - notify_via_sms: Union[Unset, bool] = UNSET - notify_via_push_notification: Union[Unset, bool] = UNSET - informational_notification_message: Union[None, Unset, str] = UNSET - alert_urgency_id: Union[Unset, str] = UNSET - calling_tree_enabled: Union[Unset, bool] = UNSET - calling_tree_prompt: Union[Unset, str] = UNSET - paging_targets: Union[Unset, list["UpdateLiveCallRouterDataAttributesPagingTargetsItem"]] = UNSET + kind: Unset | UpdateLiveCallRouterDataAttributesKind = UNSET + enabled: Unset | bool = UNSET + name: Unset | str = UNSET + country_code: Unset | UpdateLiveCallRouterDataAttributesCountryCode = UNSET + phone_type: Unset | UpdateLiveCallRouterDataAttributesPhoneType = UNSET + voicemail_greeting: Unset | str = UNSET + caller_greeting: Unset | str = UNSET + unavailable_responder_message: None | Unset | str = UNSET + waiting_music_url: Unset | UpdateLiveCallRouterDataAttributesWaitingMusicUrl = UNSET + sent_to_voicemail_delay: Unset | int = UNSET + should_redirect_to_voicemail_on_no_answer: Unset | bool = UNSET + escalation_level_delay_in_seconds: Unset | int = UNSET + should_auto_resolve_alert_on_call_end: Unset | bool = UNSET + notify_via_sms: Unset | bool = UNSET + notify_via_push_notification: Unset | bool = UNSET + informational_notification_message: None | Unset | str = UNSET + alert_urgency_id: Unset | str = UNSET + calling_tree_enabled: Unset | bool = UNSET + calling_tree_prompt: Unset | str = UNSET + paging_targets: Unset | list["UpdateLiveCallRouterDataAttributesPagingTargetsItem"] = UNSET escalation_policy_trigger_params: Union[ Unset, "UpdateLiveCallRouterDataAttributesEscalationPolicyTriggerParams" ] = UNSET def to_dict(self) -> dict[str, Any]: - kind: Union[Unset, str] = UNSET + kind: Unset | str = UNSET if not isinstance(self.kind, Unset): kind = self.kind @@ -107,11 +107,11 @@ def to_dict(self) -> dict[str, Any]: name = self.name - country_code: Union[Unset, str] = UNSET + country_code: Unset | str = UNSET if not isinstance(self.country_code, Unset): country_code = self.country_code - phone_type: Union[Unset, str] = UNSET + phone_type: Unset | str = UNSET if not isinstance(self.phone_type, Unset): phone_type = self.phone_type @@ -119,13 +119,13 @@ def to_dict(self) -> dict[str, Any]: caller_greeting = self.caller_greeting - unavailable_responder_message: Union[None, Unset, str] + unavailable_responder_message: None | Unset | str if isinstance(self.unavailable_responder_message, Unset): unavailable_responder_message = UNSET else: unavailable_responder_message = self.unavailable_responder_message - waiting_music_url: Union[Unset, str] = UNSET + waiting_music_url: Unset | str = UNSET if not isinstance(self.waiting_music_url, Unset): waiting_music_url = self.waiting_music_url @@ -141,7 +141,7 @@ def to_dict(self) -> dict[str, Any]: notify_via_push_notification = self.notify_via_push_notification - informational_notification_message: Union[None, Unset, str] + informational_notification_message: None | Unset | str if isinstance(self.informational_notification_message, Unset): informational_notification_message = UNSET else: @@ -153,14 +153,14 @@ def to_dict(self) -> dict[str, Any]: calling_tree_prompt = self.calling_tree_prompt - paging_targets: Union[Unset, list[dict[str, Any]]] = UNSET + paging_targets: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.paging_targets, Unset): paging_targets = [] for paging_targets_item_data in self.paging_targets: paging_targets_item = paging_targets_item_data.to_dict() paging_targets.append(paging_targets_item) - escalation_policy_trigger_params: Union[Unset, dict[str, Any]] = UNSET + escalation_policy_trigger_params: Unset | dict[str, Any] = UNSET if not isinstance(self.escalation_policy_trigger_params, Unset): escalation_policy_trigger_params = self.escalation_policy_trigger_params.to_dict() @@ -223,7 +223,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _kind = d.pop("kind", UNSET) - kind: Union[Unset, UpdateLiveCallRouterDataAttributesKind] + kind: Unset | UpdateLiveCallRouterDataAttributesKind if isinstance(_kind, Unset): kind = UNSET else: @@ -234,14 +234,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name = d.pop("name", UNSET) _country_code = d.pop("country_code", UNSET) - country_code: Union[Unset, UpdateLiveCallRouterDataAttributesCountryCode] + country_code: Unset | UpdateLiveCallRouterDataAttributesCountryCode if isinstance(_country_code, Unset): country_code = UNSET else: country_code = check_update_live_call_router_data_attributes_country_code(_country_code) _phone_type = d.pop("phone_type", UNSET) - phone_type: Union[Unset, UpdateLiveCallRouterDataAttributesPhoneType] + phone_type: Unset | UpdateLiveCallRouterDataAttributesPhoneType if isinstance(_phone_type, Unset): phone_type = UNSET else: @@ -251,19 +251,19 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: caller_greeting = d.pop("caller_greeting", UNSET) - def _parse_unavailable_responder_message(data: object) -> Union[None, Unset, str]: + def _parse_unavailable_responder_message(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) unavailable_responder_message = _parse_unavailable_responder_message( d.pop("unavailable_responder_message", UNSET) ) _waiting_music_url = d.pop("waiting_music_url", UNSET) - waiting_music_url: Union[Unset, UpdateLiveCallRouterDataAttributesWaitingMusicUrl] + waiting_music_url: Unset | UpdateLiveCallRouterDataAttributesWaitingMusicUrl if isinstance(_waiting_music_url, Unset): waiting_music_url = UNSET else: @@ -281,12 +281,12 @@ def _parse_unavailable_responder_message(data: object) -> Union[None, Unset, str notify_via_push_notification = d.pop("notify_via_push_notification", UNSET) - def _parse_informational_notification_message(data: object) -> Union[None, Unset, str]: + def _parse_informational_notification_message(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) informational_notification_message = _parse_informational_notification_message( d.pop("informational_notification_message", UNSET) @@ -308,7 +308,7 @@ def _parse_informational_notification_message(data: object) -> Union[None, Unset paging_targets.append(paging_targets_item) _escalation_policy_trigger_params = d.pop("escalation_policy_trigger_params", UNSET) - escalation_policy_trigger_params: Union[Unset, UpdateLiveCallRouterDataAttributesEscalationPolicyTriggerParams] + escalation_policy_trigger_params: Unset | UpdateLiveCallRouterDataAttributesEscalationPolicyTriggerParams if isinstance(_escalation_policy_trigger_params, Unset): escalation_policy_trigger_params = UNSET else: diff --git a/rootly_sdk/models/update_motion_task_task_params.py b/rootly_sdk/models/update_motion_task_task_params.py index 9522bc21..47b708b5 100644 --- a/rootly_sdk/models/update_motion_task_task_params.py +++ b/rootly_sdk/models/update_motion_task_task_params.py @@ -32,19 +32,19 @@ class UpdateMotionTaskTaskParams: """ task_id: str - task_type: Union[Unset, UpdateMotionTaskTaskParamsTaskType] = UNSET - title: Union[Unset, str] = UNSET - description: Union[Unset, str] = UNSET - labels: Union[Unset, list[str]] = UNSET + task_type: Unset | UpdateMotionTaskTaskParamsTaskType = UNSET + title: Unset | str = UNSET + description: Unset | str = UNSET + labels: Unset | list[str] = UNSET priority: Union[Unset, "UpdateMotionTaskTaskParamsPriority"] = UNSET - duration: Union[Unset, str] = UNSET - due_date: Union[Unset, str] = UNSET + duration: Unset | str = UNSET + due_date: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: task_id = self.task_id - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -52,11 +52,11 @@ def to_dict(self) -> dict[str, Any]: description = self.description - labels: Union[Unset, list[str]] = UNSET + labels: Unset | list[str] = UNSET if not isinstance(self.labels, Unset): labels = self.labels - priority: Union[Unset, dict[str, Any]] = UNSET + priority: Unset | dict[str, Any] = UNSET if not isinstance(self.priority, Unset): priority = self.priority.to_dict() @@ -96,7 +96,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: task_id = d.pop("task_id") _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, UpdateMotionTaskTaskParamsTaskType] + task_type: Unset | UpdateMotionTaskTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: @@ -109,7 +109,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: labels = cast(list[str], d.pop("labels", UNSET)) _priority = d.pop("priority", UNSET) - priority: Union[Unset, UpdateMotionTaskTaskParamsPriority] + priority: Unset | UpdateMotionTaskTaskParamsPriority if isinstance(_priority, Unset): priority = UNSET else: diff --git a/rootly_sdk/models/update_motion_task_task_params_priority.py b/rootly_sdk/models/update_motion_task_task_params_priority.py index 1a01e035..54667733 100644 --- a/rootly_sdk/models/update_motion_task_task_params_priority.py +++ b/rootly_sdk/models/update_motion_task_task_params_priority.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -18,8 +18,8 @@ class UpdateMotionTaskTaskParamsPriority: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_notion_page_task_params.py b/rootly_sdk/models/update_notion_page_task_params.py index 308c177e..bfc0e927 100644 --- a/rootly_sdk/models/update_notion_page_task_params.py +++ b/rootly_sdk/models/update_notion_page_task_params.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -28,18 +28,18 @@ class UpdateNotionPageTaskParams: """ file_id: str - task_type: Union[Unset, UpdateNotionPageTaskParamsTaskType] = UNSET - title: Union[Unset, str] = UNSET - post_mortem_template_id: Union[Unset, str] = UNSET - content: Union[Unset, str] = UNSET - show_timeline_as_table: Union[Unset, bool] = UNSET - show_action_items_as_table: Union[Unset, bool] = UNSET + task_type: Unset | UpdateNotionPageTaskParamsTaskType = UNSET + title: Unset | str = UNSET + post_mortem_template_id: Unset | str = UNSET + content: Unset | str = UNSET + show_timeline_as_table: Unset | bool = UNSET + show_action_items_as_table: Unset | bool = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: file_id = self.file_id - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -81,7 +81,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: file_id = d.pop("file_id") _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, UpdateNotionPageTaskParamsTaskType] + task_type: Unset | UpdateNotionPageTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/update_on_call_pay_report_data_attributes.py b/rootly_sdk/models/update_on_call_pay_report_data_attributes.py index f274a069..3b473545 100644 --- a/rootly_sdk/models/update_on_call_pay_report_data_attributes.py +++ b/rootly_sdk/models/update_on_call_pay_report_data_attributes.py @@ -1,6 +1,6 @@ import datetime from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from dateutil.parser import isoparse @@ -22,22 +22,22 @@ class UpdateOnCallPayReportDataAttributes: responder's personal timezone instead of the report-wide timezone. """ - start_date: Union[Unset, datetime.date] = UNSET - end_date: Union[Unset, datetime.date] = UNSET - schedule_ids: Union[Unset, list[str]] = UNSET - time_zone: Union[Unset, str] = UNSET - use_responders_time_zone: Union[Unset, bool] = UNSET + start_date: Unset | datetime.date = UNSET + end_date: Unset | datetime.date = UNSET + schedule_ids: Unset | list[str] = UNSET + time_zone: Unset | str = UNSET + use_responders_time_zone: Unset | bool = UNSET def to_dict(self) -> dict[str, Any]: - start_date: Union[Unset, str] = UNSET + start_date: Unset | str = UNSET if not isinstance(self.start_date, Unset): start_date = self.start_date.isoformat() - end_date: Union[Unset, str] = UNSET + end_date: Unset | str = UNSET if not isinstance(self.end_date, Unset): end_date = self.end_date.isoformat() - schedule_ids: Union[Unset, list[str]] = UNSET + schedule_ids: Unset | list[str] = UNSET if not isinstance(self.schedule_ids, Unset): schedule_ids = self.schedule_ids @@ -65,14 +65,14 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _start_date = d.pop("start_date", UNSET) - start_date: Union[Unset, datetime.date] + start_date: Unset | datetime.date if isinstance(_start_date, Unset): start_date = UNSET else: start_date = isoparse(_start_date).date() _end_date = d.pop("end_date", UNSET) - end_date: Union[Unset, datetime.date] + end_date: Unset | datetime.date if isinstance(_end_date, Unset): end_date = UNSET else: diff --git a/rootly_sdk/models/update_on_call_role_data_attributes.py b/rootly_sdk/models/update_on_call_role_data_attributes.py index 9d96123d..cedd2246 100644 --- a/rootly_sdk/models/update_on_call_role_data_attributes.py +++ b/rootly_sdk/models/update_on_call_role_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -144,48 +144,42 @@ class UpdateOnCallRoleDataAttributes: catalogs_permissions (Union[Unset, list[UpdateOnCallRoleDataAttributesCatalogsPermissionsItem]]): """ - slug: Union[None, Unset, str] = UNSET - name: Union[Unset, str] = UNSET - system_role: Union[Unset, str] = "custom" - alert_sources_permissions: Union[Unset, list[UpdateOnCallRoleDataAttributesAlertSourcesPermissionsItem]] = UNSET - alert_urgency_permissions: Union[Unset, list[UpdateOnCallRoleDataAttributesAlertUrgencyPermissionsItem]] = UNSET - alert_fields_permissions: Union[Unset, list[UpdateOnCallRoleDataAttributesAlertFieldsPermissionsItem]] = UNSET - alert_groups_permissions: Union[Unset, list[UpdateOnCallRoleDataAttributesAlertGroupsPermissionsItem]] = UNSET - alert_routing_rules_permissions: Union[ - Unset, list[UpdateOnCallRoleDataAttributesAlertRoutingRulesPermissionsItem] - ] = UNSET - on_call_readiness_report_permissions: Union[ - Unset, list[UpdateOnCallRoleDataAttributesOnCallReadinessReportPermissionsItem] - ] = UNSET - on_call_roles_permissions: Union[Unset, list[UpdateOnCallRoleDataAttributesOnCallRolesPermissionsItem]] = UNSET - alerts_permissions: Union[Unset, list[UpdateOnCallRoleDataAttributesAlertsPermissionsItem]] = UNSET - api_keys_permissions: Union[Unset, list[UpdateOnCallRoleDataAttributesApiKeysPermissionsItem]] = UNSET - audits_permissions: Union[Unset, list[UpdateOnCallRoleDataAttributesAuditsPermissionsItem]] = UNSET - contacts_permissions: Union[Unset, list[UpdateOnCallRoleDataAttributesContactsPermissionsItem]] = UNSET - escalation_policies_permissions: Union[ - Unset, list[UpdateOnCallRoleDataAttributesEscalationPoliciesPermissionsItem] - ] = UNSET - groups_permissions: Union[Unset, list[UpdateOnCallRoleDataAttributesGroupsPermissionsItem]] = UNSET - heartbeats_permissions: Union[Unset, list[UpdateOnCallRoleDataAttributesHeartbeatsPermissionsItem]] = UNSET - integrations_permissions: Union[Unset, list[UpdateOnCallRoleDataAttributesIntegrationsPermissionsItem]] = UNSET - invitations_permissions: Union[Unset, list[UpdateOnCallRoleDataAttributesInvitationsPermissionsItem]] = UNSET - live_call_routing_permissions: Union[Unset, list[UpdateOnCallRoleDataAttributesLiveCallRoutingPermissionsItem]] = ( + slug: None | Unset | str = UNSET + name: Unset | str = UNSET + system_role: Unset | str = "custom" + alert_sources_permissions: Unset | list[UpdateOnCallRoleDataAttributesAlertSourcesPermissionsItem] = UNSET + alert_urgency_permissions: Unset | list[UpdateOnCallRoleDataAttributesAlertUrgencyPermissionsItem] = UNSET + alert_fields_permissions: Unset | list[UpdateOnCallRoleDataAttributesAlertFieldsPermissionsItem] = UNSET + alert_groups_permissions: Unset | list[UpdateOnCallRoleDataAttributesAlertGroupsPermissionsItem] = UNSET + alert_routing_rules_permissions: Unset | list[UpdateOnCallRoleDataAttributesAlertRoutingRulesPermissionsItem] = ( UNSET ) - schedule_override_permissions: Union[Unset, list[UpdateOnCallRoleDataAttributesScheduleOverridePermissionsItem]] = ( + on_call_readiness_report_permissions: ( + Unset | list[UpdateOnCallRoleDataAttributesOnCallReadinessReportPermissionsItem] + ) = UNSET + on_call_roles_permissions: Unset | list[UpdateOnCallRoleDataAttributesOnCallRolesPermissionsItem] = UNSET + alerts_permissions: Unset | list[UpdateOnCallRoleDataAttributesAlertsPermissionsItem] = UNSET + api_keys_permissions: Unset | list[UpdateOnCallRoleDataAttributesApiKeysPermissionsItem] = UNSET + audits_permissions: Unset | list[UpdateOnCallRoleDataAttributesAuditsPermissionsItem] = UNSET + contacts_permissions: Unset | list[UpdateOnCallRoleDataAttributesContactsPermissionsItem] = UNSET + escalation_policies_permissions: Unset | list[UpdateOnCallRoleDataAttributesEscalationPoliciesPermissionsItem] = ( UNSET ) - schedules_permissions: Union[Unset, list[UpdateOnCallRoleDataAttributesSchedulesPermissionsItem]] = UNSET - services_permissions: Union[Unset, list[UpdateOnCallRoleDataAttributesServicesPermissionsItem]] = UNSET - functionalities_permissions: Union[Unset, list[UpdateOnCallRoleDataAttributesFunctionalitiesPermissionsItem]] = ( - UNSET - ) - webhooks_permissions: Union[Unset, list[UpdateOnCallRoleDataAttributesWebhooksPermissionsItem]] = UNSET - workflows_permissions: Union[Unset, list[UpdateOnCallRoleDataAttributesWorkflowsPermissionsItem]] = UNSET - catalogs_permissions: Union[Unset, list[UpdateOnCallRoleDataAttributesCatalogsPermissionsItem]] = UNSET + groups_permissions: Unset | list[UpdateOnCallRoleDataAttributesGroupsPermissionsItem] = UNSET + heartbeats_permissions: Unset | list[UpdateOnCallRoleDataAttributesHeartbeatsPermissionsItem] = UNSET + integrations_permissions: Unset | list[UpdateOnCallRoleDataAttributesIntegrationsPermissionsItem] = UNSET + invitations_permissions: Unset | list[UpdateOnCallRoleDataAttributesInvitationsPermissionsItem] = UNSET + live_call_routing_permissions: Unset | list[UpdateOnCallRoleDataAttributesLiveCallRoutingPermissionsItem] = UNSET + schedule_override_permissions: Unset | list[UpdateOnCallRoleDataAttributesScheduleOverridePermissionsItem] = UNSET + schedules_permissions: Unset | list[UpdateOnCallRoleDataAttributesSchedulesPermissionsItem] = UNSET + services_permissions: Unset | list[UpdateOnCallRoleDataAttributesServicesPermissionsItem] = UNSET + functionalities_permissions: Unset | list[UpdateOnCallRoleDataAttributesFunctionalitiesPermissionsItem] = UNSET + webhooks_permissions: Unset | list[UpdateOnCallRoleDataAttributesWebhooksPermissionsItem] = UNSET + workflows_permissions: Unset | list[UpdateOnCallRoleDataAttributesWorkflowsPermissionsItem] = UNSET + catalogs_permissions: Unset | list[UpdateOnCallRoleDataAttributesCatalogsPermissionsItem] = UNSET def to_dict(self) -> dict[str, Any]: - slug: Union[None, Unset, str] + slug: None | Unset | str if isinstance(self.slug, Unset): slug = UNSET else: @@ -195,168 +189,168 @@ def to_dict(self) -> dict[str, Any]: system_role = self.system_role - alert_sources_permissions: Union[Unset, list[str]] = UNSET + alert_sources_permissions: Unset | list[str] = UNSET if not isinstance(self.alert_sources_permissions, Unset): alert_sources_permissions = [] for alert_sources_permissions_item_data in self.alert_sources_permissions: alert_sources_permissions_item: str = alert_sources_permissions_item_data alert_sources_permissions.append(alert_sources_permissions_item) - alert_urgency_permissions: Union[Unset, list[str]] = UNSET + alert_urgency_permissions: Unset | list[str] = UNSET if not isinstance(self.alert_urgency_permissions, Unset): alert_urgency_permissions = [] for alert_urgency_permissions_item_data in self.alert_urgency_permissions: alert_urgency_permissions_item: str = alert_urgency_permissions_item_data alert_urgency_permissions.append(alert_urgency_permissions_item) - alert_fields_permissions: Union[Unset, list[str]] = UNSET + alert_fields_permissions: Unset | list[str] = UNSET if not isinstance(self.alert_fields_permissions, Unset): alert_fields_permissions = [] for alert_fields_permissions_item_data in self.alert_fields_permissions: alert_fields_permissions_item: str = alert_fields_permissions_item_data alert_fields_permissions.append(alert_fields_permissions_item) - alert_groups_permissions: Union[Unset, list[str]] = UNSET + alert_groups_permissions: Unset | list[str] = UNSET if not isinstance(self.alert_groups_permissions, Unset): alert_groups_permissions = [] for alert_groups_permissions_item_data in self.alert_groups_permissions: alert_groups_permissions_item: str = alert_groups_permissions_item_data alert_groups_permissions.append(alert_groups_permissions_item) - alert_routing_rules_permissions: Union[Unset, list[str]] = UNSET + alert_routing_rules_permissions: Unset | list[str] = UNSET if not isinstance(self.alert_routing_rules_permissions, Unset): alert_routing_rules_permissions = [] for alert_routing_rules_permissions_item_data in self.alert_routing_rules_permissions: alert_routing_rules_permissions_item: str = alert_routing_rules_permissions_item_data alert_routing_rules_permissions.append(alert_routing_rules_permissions_item) - on_call_readiness_report_permissions: Union[Unset, list[str]] = UNSET + on_call_readiness_report_permissions: Unset | list[str] = UNSET if not isinstance(self.on_call_readiness_report_permissions, Unset): on_call_readiness_report_permissions = [] for on_call_readiness_report_permissions_item_data in self.on_call_readiness_report_permissions: on_call_readiness_report_permissions_item: str = on_call_readiness_report_permissions_item_data on_call_readiness_report_permissions.append(on_call_readiness_report_permissions_item) - on_call_roles_permissions: Union[Unset, list[str]] = UNSET + on_call_roles_permissions: Unset | list[str] = UNSET if not isinstance(self.on_call_roles_permissions, Unset): on_call_roles_permissions = [] for on_call_roles_permissions_item_data in self.on_call_roles_permissions: on_call_roles_permissions_item: str = on_call_roles_permissions_item_data on_call_roles_permissions.append(on_call_roles_permissions_item) - alerts_permissions: Union[Unset, list[str]] = UNSET + alerts_permissions: Unset | list[str] = UNSET if not isinstance(self.alerts_permissions, Unset): alerts_permissions = [] for alerts_permissions_item_data in self.alerts_permissions: alerts_permissions_item: str = alerts_permissions_item_data alerts_permissions.append(alerts_permissions_item) - api_keys_permissions: Union[Unset, list[str]] = UNSET + api_keys_permissions: Unset | list[str] = UNSET if not isinstance(self.api_keys_permissions, Unset): api_keys_permissions = [] for api_keys_permissions_item_data in self.api_keys_permissions: api_keys_permissions_item: str = api_keys_permissions_item_data api_keys_permissions.append(api_keys_permissions_item) - audits_permissions: Union[Unset, list[str]] = UNSET + audits_permissions: Unset | list[str] = UNSET if not isinstance(self.audits_permissions, Unset): audits_permissions = [] for audits_permissions_item_data in self.audits_permissions: audits_permissions_item: str = audits_permissions_item_data audits_permissions.append(audits_permissions_item) - contacts_permissions: Union[Unset, list[str]] = UNSET + contacts_permissions: Unset | list[str] = UNSET if not isinstance(self.contacts_permissions, Unset): contacts_permissions = [] for contacts_permissions_item_data in self.contacts_permissions: contacts_permissions_item: str = contacts_permissions_item_data contacts_permissions.append(contacts_permissions_item) - escalation_policies_permissions: Union[Unset, list[str]] = UNSET + escalation_policies_permissions: Unset | list[str] = UNSET if not isinstance(self.escalation_policies_permissions, Unset): escalation_policies_permissions = [] for escalation_policies_permissions_item_data in self.escalation_policies_permissions: escalation_policies_permissions_item: str = escalation_policies_permissions_item_data escalation_policies_permissions.append(escalation_policies_permissions_item) - groups_permissions: Union[Unset, list[str]] = UNSET + groups_permissions: Unset | list[str] = UNSET if not isinstance(self.groups_permissions, Unset): groups_permissions = [] for groups_permissions_item_data in self.groups_permissions: groups_permissions_item: str = groups_permissions_item_data groups_permissions.append(groups_permissions_item) - heartbeats_permissions: Union[Unset, list[str]] = UNSET + heartbeats_permissions: Unset | list[str] = UNSET if not isinstance(self.heartbeats_permissions, Unset): heartbeats_permissions = [] for heartbeats_permissions_item_data in self.heartbeats_permissions: heartbeats_permissions_item: str = heartbeats_permissions_item_data heartbeats_permissions.append(heartbeats_permissions_item) - integrations_permissions: Union[Unset, list[str]] = UNSET + integrations_permissions: Unset | list[str] = UNSET if not isinstance(self.integrations_permissions, Unset): integrations_permissions = [] for integrations_permissions_item_data in self.integrations_permissions: integrations_permissions_item: str = integrations_permissions_item_data integrations_permissions.append(integrations_permissions_item) - invitations_permissions: Union[Unset, list[str]] = UNSET + invitations_permissions: Unset | list[str] = UNSET if not isinstance(self.invitations_permissions, Unset): invitations_permissions = [] for invitations_permissions_item_data in self.invitations_permissions: invitations_permissions_item: str = invitations_permissions_item_data invitations_permissions.append(invitations_permissions_item) - live_call_routing_permissions: Union[Unset, list[str]] = UNSET + live_call_routing_permissions: Unset | list[str] = UNSET if not isinstance(self.live_call_routing_permissions, Unset): live_call_routing_permissions = [] for live_call_routing_permissions_item_data in self.live_call_routing_permissions: live_call_routing_permissions_item: str = live_call_routing_permissions_item_data live_call_routing_permissions.append(live_call_routing_permissions_item) - schedule_override_permissions: Union[Unset, list[str]] = UNSET + schedule_override_permissions: Unset | list[str] = UNSET if not isinstance(self.schedule_override_permissions, Unset): schedule_override_permissions = [] for schedule_override_permissions_item_data in self.schedule_override_permissions: schedule_override_permissions_item: str = schedule_override_permissions_item_data schedule_override_permissions.append(schedule_override_permissions_item) - schedules_permissions: Union[Unset, list[str]] = UNSET + schedules_permissions: Unset | list[str] = UNSET if not isinstance(self.schedules_permissions, Unset): schedules_permissions = [] for schedules_permissions_item_data in self.schedules_permissions: schedules_permissions_item: str = schedules_permissions_item_data schedules_permissions.append(schedules_permissions_item) - services_permissions: Union[Unset, list[str]] = UNSET + services_permissions: Unset | list[str] = UNSET if not isinstance(self.services_permissions, Unset): services_permissions = [] for services_permissions_item_data in self.services_permissions: services_permissions_item: str = services_permissions_item_data services_permissions.append(services_permissions_item) - functionalities_permissions: Union[Unset, list[str]] = UNSET + functionalities_permissions: Unset | list[str] = UNSET if not isinstance(self.functionalities_permissions, Unset): functionalities_permissions = [] for functionalities_permissions_item_data in self.functionalities_permissions: functionalities_permissions_item: str = functionalities_permissions_item_data functionalities_permissions.append(functionalities_permissions_item) - webhooks_permissions: Union[Unset, list[str]] = UNSET + webhooks_permissions: Unset | list[str] = UNSET if not isinstance(self.webhooks_permissions, Unset): webhooks_permissions = [] for webhooks_permissions_item_data in self.webhooks_permissions: webhooks_permissions_item: str = webhooks_permissions_item_data webhooks_permissions.append(webhooks_permissions_item) - workflows_permissions: Union[Unset, list[str]] = UNSET + workflows_permissions: Unset | list[str] = UNSET if not isinstance(self.workflows_permissions, Unset): workflows_permissions = [] for workflows_permissions_item_data in self.workflows_permissions: workflows_permissions_item: str = workflows_permissions_item_data workflows_permissions.append(workflows_permissions_item) - catalogs_permissions: Union[Unset, list[str]] = UNSET + catalogs_permissions: Unset | list[str] = UNSET if not isinstance(self.catalogs_permissions, Unset): catalogs_permissions = [] for catalogs_permissions_item_data in self.catalogs_permissions: @@ -427,12 +421,12 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_slug(data: object) -> Union[None, Unset, str]: + def _parse_slug(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) slug = _parse_slug(d.pop("slug", UNSET)) diff --git a/rootly_sdk/models/update_on_call_shadow_data_attributes.py b/rootly_sdk/models/update_on_call_shadow_data_attributes.py index b807bf35..5f937250 100644 --- a/rootly_sdk/models/update_on_call_shadow_data_attributes.py +++ b/rootly_sdk/models/update_on_call_shadow_data_attributes.py @@ -1,6 +1,6 @@ import datetime from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from dateutil.parser import isoparse @@ -26,17 +26,17 @@ class UpdateOnCallShadowDataAttributes: ends_at (Union[Unset, datetime.datetime]): End datetime for shadow shift """ - schedule_id: Union[Unset, str] = UNSET - shadowable_type: Union[Unset, UpdateOnCallShadowDataAttributesShadowableType] = UNSET - shadowable_id: Union[Unset, str] = UNSET - shadow_user_id: Union[Unset, int] = UNSET - starts_at: Union[Unset, datetime.datetime] = UNSET - ends_at: Union[Unset, datetime.datetime] = UNSET + schedule_id: Unset | str = UNSET + shadowable_type: Unset | UpdateOnCallShadowDataAttributesShadowableType = UNSET + shadowable_id: Unset | str = UNSET + shadow_user_id: Unset | int = UNSET + starts_at: Unset | datetime.datetime = UNSET + ends_at: Unset | datetime.datetime = UNSET def to_dict(self) -> dict[str, Any]: schedule_id = self.schedule_id - shadowable_type: Union[Unset, str] = UNSET + shadowable_type: Unset | str = UNSET if not isinstance(self.shadowable_type, Unset): shadowable_type = self.shadowable_type @@ -44,11 +44,11 @@ def to_dict(self) -> dict[str, Any]: shadow_user_id = self.shadow_user_id - starts_at: Union[Unset, str] = UNSET + starts_at: Unset | str = UNSET if not isinstance(self.starts_at, Unset): starts_at = self.starts_at.isoformat() - ends_at: Union[Unset, str] = UNSET + ends_at: Unset | str = UNSET if not isinstance(self.ends_at, Unset): ends_at = self.ends_at.isoformat() @@ -76,7 +76,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: schedule_id = d.pop("schedule_id", UNSET) _shadowable_type = d.pop("shadowable_type", UNSET) - shadowable_type: Union[Unset, UpdateOnCallShadowDataAttributesShadowableType] + shadowable_type: Unset | UpdateOnCallShadowDataAttributesShadowableType if isinstance(_shadowable_type, Unset): shadowable_type = UNSET else: @@ -87,14 +87,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: shadow_user_id = d.pop("shadow_user_id", UNSET) _starts_at = d.pop("starts_at", UNSET) - starts_at: Union[Unset, datetime.datetime] + starts_at: Unset | datetime.datetime if isinstance(_starts_at, Unset): starts_at = UNSET else: starts_at = isoparse(_starts_at) _ends_at = d.pop("ends_at", UNSET) - ends_at: Union[Unset, datetime.datetime] + ends_at: Unset | datetime.datetime if isinstance(_ends_at, Unset): ends_at = UNSET else: diff --git a/rootly_sdk/models/update_opsgenie_alert_task_params.py b/rootly_sdk/models/update_opsgenie_alert_task_params.py index f25161bd..983c4f88 100644 --- a/rootly_sdk/models/update_opsgenie_alert_task_params.py +++ b/rootly_sdk/models/update_opsgenie_alert_task_params.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -37,9 +37,9 @@ class UpdateOpsgenieAlertTaskParams: alert_id: str priority: UpdateOpsgenieAlertTaskParamsPriority completion: "UpdateOpsgenieAlertTaskParamsCompletion" - task_type: Union[Unset, UpdateOpsgenieAlertTaskParamsTaskType] = UNSET - message: Union[Unset, str] = UNSET - description: Union[Unset, str] = UNSET + task_type: Unset | UpdateOpsgenieAlertTaskParamsTaskType = UNSET + message: Unset | str = UNSET + description: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -49,7 +49,7 @@ def to_dict(self) -> dict[str, Any]: completion = self.completion.to_dict() - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -87,7 +87,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: completion = UpdateOpsgenieAlertTaskParamsCompletion.from_dict(d.pop("completion")) _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, UpdateOpsgenieAlertTaskParamsTaskType] + task_type: Unset | UpdateOpsgenieAlertTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/update_opsgenie_alert_task_params_completion.py b/rootly_sdk/models/update_opsgenie_alert_task_params_completion.py index 519aef27..74ddc709 100644 --- a/rootly_sdk/models/update_opsgenie_alert_task_params_completion.py +++ b/rootly_sdk/models/update_opsgenie_alert_task_params_completion.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class UpdateOpsgenieAlertTaskParamsCompletion: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_opsgenie_incident_task_params.py b/rootly_sdk/models/update_opsgenie_incident_task_params.py index 7e3aa3b8..a7d8ec23 100644 --- a/rootly_sdk/models/update_opsgenie_incident_task_params.py +++ b/rootly_sdk/models/update_opsgenie_incident_task_params.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -36,17 +36,17 @@ class UpdateOpsgenieIncidentTaskParams: """ opsgenie_incident_id: str - task_type: Union[Unset, UpdateOpsgenieIncidentTaskParamsTaskType] = UNSET - message: Union[Unset, str] = UNSET - description: Union[Unset, str] = UNSET - status: Union[Unset, UpdateOpsgenieIncidentTaskParamsStatus] = UNSET - priority: Union[Unset, UpdateOpsgenieIncidentTaskParamsPriority] = UNSET + task_type: Unset | UpdateOpsgenieIncidentTaskParamsTaskType = UNSET + message: Unset | str = UNSET + description: Unset | str = UNSET + status: Unset | UpdateOpsgenieIncidentTaskParamsStatus = UNSET + priority: Unset | UpdateOpsgenieIncidentTaskParamsPriority = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: opsgenie_incident_id = self.opsgenie_incident_id - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -54,11 +54,11 @@ def to_dict(self) -> dict[str, Any]: description = self.description - status: Union[Unset, str] = UNSET + status: Unset | str = UNSET if not isinstance(self.status, Unset): status = self.status - priority: Union[Unset, str] = UNSET + priority: Unset | str = UNSET if not isinstance(self.priority, Unset): priority = self.priority @@ -88,7 +88,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: opsgenie_incident_id = d.pop("opsgenie_incident_id") _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, UpdateOpsgenieIncidentTaskParamsTaskType] + task_type: Unset | UpdateOpsgenieIncidentTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: @@ -99,14 +99,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: description = d.pop("description", UNSET) _status = d.pop("status", UNSET) - status: Union[Unset, UpdateOpsgenieIncidentTaskParamsStatus] + status: Unset | UpdateOpsgenieIncidentTaskParamsStatus if isinstance(_status, Unset): status = UNSET else: status = check_update_opsgenie_incident_task_params_status(_status) _priority = d.pop("priority", UNSET) - priority: Union[Unset, UpdateOpsgenieIncidentTaskParamsPriority] + priority: Unset | UpdateOpsgenieIncidentTaskParamsPriority if isinstance(_priority, Unset): priority = UNSET else: diff --git a/rootly_sdk/models/update_pagerduty_incident_task_params.py b/rootly_sdk/models/update_pagerduty_incident_task_params.py index b7bfb25a..fc8753f0 100644 --- a/rootly_sdk/models/update_pagerduty_incident_task_params.py +++ b/rootly_sdk/models/update_pagerduty_incident_task_params.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -38,25 +38,25 @@ class UpdatePagerdutyIncidentTaskParams: """ pagerduty_incident_id: str - task_type: Union[Unset, UpdatePagerdutyIncidentTaskParamsTaskType] = UNSET - title: Union[Unset, str] = UNSET - status: Union[Unset, UpdatePagerdutyIncidentTaskParamsStatus] = UNSET - resolution: Union[Unset, str] = UNSET - escalation_level: Union[Unset, int] = UNSET - urgency: Union[Unset, UpdatePagerdutyIncidentTaskParamsUrgency] = UNSET - priority: Union[Unset, str] = UNSET + task_type: Unset | UpdatePagerdutyIncidentTaskParamsTaskType = UNSET + title: Unset | str = UNSET + status: Unset | UpdatePagerdutyIncidentTaskParamsStatus = UNSET + resolution: Unset | str = UNSET + escalation_level: Unset | int = UNSET + urgency: Unset | UpdatePagerdutyIncidentTaskParamsUrgency = UNSET + priority: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: pagerduty_incident_id = self.pagerduty_incident_id - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type title = self.title - status: Union[Unset, str] = UNSET + status: Unset | str = UNSET if not isinstance(self.status, Unset): status = self.status @@ -64,7 +64,7 @@ def to_dict(self) -> dict[str, Any]: escalation_level = self.escalation_level - urgency: Union[Unset, str] = UNSET + urgency: Unset | str = UNSET if not isinstance(self.urgency, Unset): urgency = self.urgency @@ -100,7 +100,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: pagerduty_incident_id = d.pop("pagerduty_incident_id") _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, UpdatePagerdutyIncidentTaskParamsTaskType] + task_type: Unset | UpdatePagerdutyIncidentTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: @@ -109,7 +109,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: title = d.pop("title", UNSET) _status = d.pop("status", UNSET) - status: Union[Unset, UpdatePagerdutyIncidentTaskParamsStatus] + status: Unset | UpdatePagerdutyIncidentTaskParamsStatus if isinstance(_status, Unset): status = UNSET else: @@ -120,7 +120,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: escalation_level = d.pop("escalation_level", UNSET) _urgency = d.pop("urgency", UNSET) - urgency: Union[Unset, UpdatePagerdutyIncidentTaskParamsUrgency] + urgency: Unset | UpdatePagerdutyIncidentTaskParamsUrgency if isinstance(_urgency, Unset): urgency = UNSET else: diff --git a/rootly_sdk/models/update_pagertree_alert_task_params.py b/rootly_sdk/models/update_pagertree_alert_task_params.py index ca5430ba..b59eca40 100644 --- a/rootly_sdk/models/update_pagertree_alert_task_params.py +++ b/rootly_sdk/models/update_pagertree_alert_task_params.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -41,19 +41,19 @@ class UpdatePagertreeAlertTaskParams: incident (Union[Unset, bool]): Setting to true makes an alert a Pagertree incident """ - task_type: Union[Unset, UpdatePagertreeAlertTaskParamsTaskType] = UNSET - pagertree_alert_id: Union[Unset, str] = UNSET - title: Union[Unset, str] = UNSET - description: Union[Unset, str] = UNSET - urgency: Union[Unset, UpdatePagertreeAlertTaskParamsUrgency] = UNSET - severity: Union[Unset, UpdatePagertreeAlertTaskParamsSeverity] = UNSET - teams: Union[Unset, list["UpdatePagertreeAlertTaskParamsTeamsItem"]] = UNSET - users: Union[Unset, list["UpdatePagertreeAlertTaskParamsUsersItem"]] = UNSET - incident: Union[Unset, bool] = UNSET + task_type: Unset | UpdatePagertreeAlertTaskParamsTaskType = UNSET + pagertree_alert_id: Unset | str = UNSET + title: Unset | str = UNSET + description: Unset | str = UNSET + urgency: Unset | UpdatePagertreeAlertTaskParamsUrgency = UNSET + severity: Unset | UpdatePagertreeAlertTaskParamsSeverity = UNSET + teams: Unset | list["UpdatePagertreeAlertTaskParamsTeamsItem"] = UNSET + users: Unset | list["UpdatePagertreeAlertTaskParamsUsersItem"] = UNSET + incident: Unset | bool = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -63,22 +63,22 @@ def to_dict(self) -> dict[str, Any]: description = self.description - urgency: Union[Unset, str] = UNSET + urgency: Unset | str = UNSET if not isinstance(self.urgency, Unset): urgency = self.urgency - severity: Union[Unset, str] = UNSET + severity: Unset | str = UNSET if not isinstance(self.severity, Unset): severity = self.severity - teams: Union[Unset, list[dict[str, Any]]] = UNSET + teams: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.teams, Unset): teams = [] for teams_item_data in self.teams: teams_item = teams_item_data.to_dict() teams.append(teams_item) - users: Union[Unset, list[dict[str, Any]]] = UNSET + users: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.users, Unset): users = [] for users_item_data in self.users: @@ -118,7 +118,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, UpdatePagertreeAlertTaskParamsTaskType] + task_type: Unset | UpdatePagertreeAlertTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: @@ -131,14 +131,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: description = d.pop("description", UNSET) _urgency = d.pop("urgency", UNSET) - urgency: Union[Unset, UpdatePagertreeAlertTaskParamsUrgency] + urgency: Unset | UpdatePagertreeAlertTaskParamsUrgency if isinstance(_urgency, Unset): urgency = UNSET else: urgency = check_update_pagertree_alert_task_params_urgency(_urgency) _severity = d.pop("severity", UNSET) - severity: Union[Unset, UpdatePagertreeAlertTaskParamsSeverity] + severity: Unset | UpdatePagertreeAlertTaskParamsSeverity if isinstance(_severity, Unset): severity = UNSET else: diff --git a/rootly_sdk/models/update_pagertree_alert_task_params_teams_item.py b/rootly_sdk/models/update_pagertree_alert_task_params_teams_item.py index 67af10df..1c7a5f64 100644 --- a/rootly_sdk/models/update_pagertree_alert_task_params_teams_item.py +++ b/rootly_sdk/models/update_pagertree_alert_task_params_teams_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class UpdatePagertreeAlertTaskParamsTeamsItem: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_pagertree_alert_task_params_users_item.py b/rootly_sdk/models/update_pagertree_alert_task_params_users_item.py index dcd684b6..fbf4cec1 100644 --- a/rootly_sdk/models/update_pagertree_alert_task_params_users_item.py +++ b/rootly_sdk/models/update_pagertree_alert_task_params_users_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class UpdatePagertreeAlertTaskParamsUsersItem: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_playbook_data_attributes.py b/rootly_sdk/models/update_playbook_data_attributes.py index a44192cc..78d0a41a 100644 --- a/rootly_sdk/models/update_playbook_data_attributes.py +++ b/rootly_sdk/models/update_playbook_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -23,32 +23,32 @@ class UpdatePlaybookDataAttributes: incident_type_ids (Union[None, Unset, list[str]]): The Incident Type IDs to attach to the incident """ - title: Union[Unset, str] = UNSET - summary: Union[None, Unset, str] = UNSET - external_url: Union[None, Unset, str] = UNSET - severity_ids: Union[None, Unset, list[str]] = UNSET - environment_ids: Union[None, Unset, list[str]] = UNSET - service_ids: Union[None, Unset, list[str]] = UNSET - functionality_ids: Union[None, Unset, list[str]] = UNSET - group_ids: Union[None, Unset, list[str]] = UNSET - incident_type_ids: Union[None, Unset, list[str]] = UNSET + title: Unset | str = UNSET + summary: None | Unset | str = UNSET + external_url: None | Unset | str = UNSET + severity_ids: None | Unset | list[str] = UNSET + environment_ids: None | Unset | list[str] = UNSET + service_ids: None | Unset | list[str] = UNSET + functionality_ids: None | Unset | list[str] = UNSET + group_ids: None | Unset | list[str] = UNSET + incident_type_ids: None | Unset | list[str] = UNSET def to_dict(self) -> dict[str, Any]: title = self.title - summary: Union[None, Unset, str] + summary: None | Unset | str if isinstance(self.summary, Unset): summary = UNSET else: summary = self.summary - external_url: Union[None, Unset, str] + external_url: None | Unset | str if isinstance(self.external_url, Unset): external_url = UNSET else: external_url = self.external_url - severity_ids: Union[None, Unset, list[str]] + severity_ids: None | Unset | list[str] if isinstance(self.severity_ids, Unset): severity_ids = UNSET elif isinstance(self.severity_ids, list): @@ -57,7 +57,7 @@ def to_dict(self) -> dict[str, Any]: else: severity_ids = self.severity_ids - environment_ids: Union[None, Unset, list[str]] + environment_ids: None | Unset | list[str] if isinstance(self.environment_ids, Unset): environment_ids = UNSET elif isinstance(self.environment_ids, list): @@ -66,7 +66,7 @@ def to_dict(self) -> dict[str, Any]: else: environment_ids = self.environment_ids - service_ids: Union[None, Unset, list[str]] + service_ids: None | Unset | list[str] if isinstance(self.service_ids, Unset): service_ids = UNSET elif isinstance(self.service_ids, list): @@ -75,7 +75,7 @@ def to_dict(self) -> dict[str, Any]: else: service_ids = self.service_ids - functionality_ids: Union[None, Unset, list[str]] + functionality_ids: None | Unset | list[str] if isinstance(self.functionality_ids, Unset): functionality_ids = UNSET elif isinstance(self.functionality_ids, list): @@ -84,7 +84,7 @@ def to_dict(self) -> dict[str, Any]: else: functionality_ids = self.functionality_ids - group_ids: Union[None, Unset, list[str]] + group_ids: None | Unset | list[str] if isinstance(self.group_ids, Unset): group_ids = UNSET elif isinstance(self.group_ids, list): @@ -93,7 +93,7 @@ def to_dict(self) -> dict[str, Any]: else: group_ids = self.group_ids - incident_type_ids: Union[None, Unset, list[str]] + incident_type_ids: None | Unset | list[str] if isinstance(self.incident_type_ids, Unset): incident_type_ids = UNSET elif isinstance(self.incident_type_ids, list): @@ -131,25 +131,25 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) title = d.pop("title", UNSET) - def _parse_summary(data: object) -> Union[None, Unset, str]: + def _parse_summary(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) summary = _parse_summary(d.pop("summary", UNSET)) - def _parse_external_url(data: object) -> Union[None, Unset, str]: + def _parse_external_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) external_url = _parse_external_url(d.pop("external_url", UNSET)) - def _parse_severity_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_severity_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -162,11 +162,11 @@ def _parse_severity_ids(data: object) -> Union[None, Unset, list[str]]: return severity_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) severity_ids = _parse_severity_ids(d.pop("severity_ids", UNSET)) - def _parse_environment_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_environment_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -179,11 +179,11 @@ def _parse_environment_ids(data: object) -> Union[None, Unset, list[str]]: return environment_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) environment_ids = _parse_environment_ids(d.pop("environment_ids", UNSET)) - def _parse_service_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_service_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -196,11 +196,11 @@ def _parse_service_ids(data: object) -> Union[None, Unset, list[str]]: return service_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) service_ids = _parse_service_ids(d.pop("service_ids", UNSET)) - def _parse_functionality_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_functionality_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -213,11 +213,11 @@ def _parse_functionality_ids(data: object) -> Union[None, Unset, list[str]]: return functionality_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) functionality_ids = _parse_functionality_ids(d.pop("functionality_ids", UNSET)) - def _parse_group_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_group_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -230,11 +230,11 @@ def _parse_group_ids(data: object) -> Union[None, Unset, list[str]]: return group_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) group_ids = _parse_group_ids(d.pop("group_ids", UNSET)) - def _parse_incident_type_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_incident_type_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -247,7 +247,7 @@ def _parse_incident_type_ids(data: object) -> Union[None, Unset, list[str]]: return incident_type_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) incident_type_ids = _parse_incident_type_ids(d.pop("incident_type_ids", UNSET)) diff --git a/rootly_sdk/models/update_playbook_task_data_attributes.py b/rootly_sdk/models/update_playbook_task_data_attributes.py index 8a12fa42..858224cb 100644 --- a/rootly_sdk/models/update_playbook_task_data_attributes.py +++ b/rootly_sdk/models/update_playbook_task_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -17,20 +17,20 @@ class UpdatePlaybookTaskDataAttributes: position (Union[None, Unset, int]): The position of the task """ - task: Union[Unset, str] = UNSET - description: Union[None, Unset, str] = UNSET - position: Union[None, Unset, int] = UNSET + task: Unset | str = UNSET + description: None | Unset | str = UNSET + position: None | Unset | int = UNSET def to_dict(self) -> dict[str, Any]: task = self.task - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - position: Union[None, Unset, int] + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: @@ -53,21 +53,21 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) task = d.pop("task", UNSET) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_position(data: object) -> Union[None, Unset, int]: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) diff --git a/rootly_sdk/models/update_post_mortem_template_data_attributes.py b/rootly_sdk/models/update_post_mortem_template_data_attributes.py index bbbeb2e8..8ecd5181 100644 --- a/rootly_sdk/models/update_post_mortem_template_data_attributes.py +++ b/rootly_sdk/models/update_post_mortem_template_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -25,14 +25,14 @@ class UpdatePostMortemTemplateDataAttributes: format_ (Union[Unset, UpdatePostMortemTemplateDataAttributesFormat]): The format of the input Default: 'html'. """ - slug: Union[None, Unset, str] = UNSET - name: Union[Unset, str] = UNSET - default: Union[None, Unset, bool] = UNSET - content: Union[Unset, str] = UNSET - format_: Union[Unset, UpdatePostMortemTemplateDataAttributesFormat] = "html" + slug: None | Unset | str = UNSET + name: Unset | str = UNSET + default: None | Unset | bool = UNSET + content: Unset | str = UNSET + format_: Unset | UpdatePostMortemTemplateDataAttributesFormat = "html" def to_dict(self) -> dict[str, Any]: - slug: Union[None, Unset, str] + slug: None | Unset | str if isinstance(self.slug, Unset): slug = UNSET else: @@ -40,7 +40,7 @@ def to_dict(self) -> dict[str, Any]: name = self.name - default: Union[None, Unset, bool] + default: None | Unset | bool if isinstance(self.default, Unset): default = UNSET else: @@ -48,7 +48,7 @@ def to_dict(self) -> dict[str, Any]: content = self.content - format_: Union[Unset, str] = UNSET + format_: Unset | str = UNSET if not isinstance(self.format_, Unset): format_ = self.format_ @@ -72,30 +72,30 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_slug(data: object) -> Union[None, Unset, str]: + def _parse_slug(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) slug = _parse_slug(d.pop("slug", UNSET)) name = d.pop("name", UNSET) - def _parse_default(data: object) -> Union[None, Unset, bool]: + def _parse_default(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) default = _parse_default(d.pop("default", UNSET)) content = d.pop("content", UNSET) _format_ = d.pop("format", UNSET) - format_: Union[Unset, UpdatePostMortemTemplateDataAttributesFormat] + format_: Unset | UpdatePostMortemTemplateDataAttributesFormat if isinstance(_format_, Unset): format_ = UNSET else: diff --git a/rootly_sdk/models/update_pulse_data_attributes.py b/rootly_sdk/models/update_pulse_data_attributes.py index b7c865aa..8451d755 100644 --- a/rootly_sdk/models/update_pulse_data_attributes.py +++ b/rootly_sdk/models/update_pulse_data_attributes.py @@ -32,15 +32,15 @@ class UpdatePulseDataAttributes: data (Union['UpdatePulseDataAttributesDataType0', None, Unset]): Additional data """ - source: Union[None, Unset, str] = UNSET - summary: Union[Unset, str] = UNSET - service_ids: Union[None, Unset, list[str]] = UNSET - environment_ids: Union[None, Unset, list[str]] = UNSET - started_at: Union[None, Unset, datetime.datetime] = UNSET - ended_at: Union[None, Unset, datetime.datetime] = UNSET - external_url: Union[None, Unset, str] = UNSET - labels: Union[Unset, list[Union["UpdatePulseDataAttributesLabelsItemType0", None]]] = UNSET - refs: Union[Unset, list[Union["UpdatePulseDataAttributesRefsItemType0", None]]] = UNSET + source: None | Unset | str = UNSET + summary: Unset | str = UNSET + service_ids: None | Unset | list[str] = UNSET + environment_ids: None | Unset | list[str] = UNSET + started_at: None | Unset | datetime.datetime = UNSET + ended_at: None | Unset | datetime.datetime = UNSET + external_url: None | Unset | str = UNSET + labels: Unset | list[Union["UpdatePulseDataAttributesLabelsItemType0", None]] = UNSET + refs: Unset | list[Union["UpdatePulseDataAttributesRefsItemType0", None]] = UNSET data: Union["UpdatePulseDataAttributesDataType0", None, Unset] = UNSET def to_dict(self) -> dict[str, Any]: @@ -48,7 +48,7 @@ def to_dict(self) -> dict[str, Any]: from ..models.update_pulse_data_attributes_labels_item_type_0 import UpdatePulseDataAttributesLabelsItemType0 from ..models.update_pulse_data_attributes_refs_item_type_0 import UpdatePulseDataAttributesRefsItemType0 - source: Union[None, Unset, str] + source: None | Unset | str if isinstance(self.source, Unset): source = UNSET else: @@ -56,7 +56,7 @@ def to_dict(self) -> dict[str, Any]: summary = self.summary - service_ids: Union[None, Unset, list[str]] + service_ids: None | Unset | list[str] if isinstance(self.service_ids, Unset): service_ids = UNSET elif isinstance(self.service_ids, list): @@ -65,7 +65,7 @@ def to_dict(self) -> dict[str, Any]: else: service_ids = self.service_ids - environment_ids: Union[None, Unset, list[str]] + environment_ids: None | Unset | list[str] if isinstance(self.environment_ids, Unset): environment_ids = UNSET elif isinstance(self.environment_ids, list): @@ -74,7 +74,7 @@ def to_dict(self) -> dict[str, Any]: else: environment_ids = self.environment_ids - started_at: Union[None, Unset, str] + started_at: None | Unset | str if isinstance(self.started_at, Unset): started_at = UNSET elif isinstance(self.started_at, datetime.datetime): @@ -82,7 +82,7 @@ def to_dict(self) -> dict[str, Any]: else: started_at = self.started_at - ended_at: Union[None, Unset, str] + ended_at: None | Unset | str if isinstance(self.ended_at, Unset): ended_at = UNSET elif isinstance(self.ended_at, datetime.datetime): @@ -90,35 +90,35 @@ def to_dict(self) -> dict[str, Any]: else: ended_at = self.ended_at - external_url: Union[None, Unset, str] + external_url: None | Unset | str if isinstance(self.external_url, Unset): external_url = UNSET else: external_url = self.external_url - labels: Union[Unset, list[Union[None, dict[str, Any]]]] = UNSET + labels: Unset | list[None | dict[str, Any]] = UNSET if not isinstance(self.labels, Unset): labels = [] for labels_item_data in self.labels: - labels_item: Union[None, dict[str, Any]] + labels_item: None | dict[str, Any] if isinstance(labels_item_data, UpdatePulseDataAttributesLabelsItemType0): labels_item = labels_item_data.to_dict() else: labels_item = labels_item_data labels.append(labels_item) - refs: Union[Unset, list[Union[None, dict[str, Any]]]] = UNSET + refs: Unset | list[None | dict[str, Any]] = UNSET if not isinstance(self.refs, Unset): refs = [] for refs_item_data in self.refs: - refs_item: Union[None, dict[str, Any]] + refs_item: None | dict[str, Any] if isinstance(refs_item_data, UpdatePulseDataAttributesRefsItemType0): refs_item = refs_item_data.to_dict() else: refs_item = refs_item_data refs.append(refs_item) - data: Union[None, Unset, dict[str, Any]] + data: None | Unset | dict[str, Any] if isinstance(self.data, Unset): data = UNSET elif isinstance(self.data, UpdatePulseDataAttributesDataType0): @@ -160,18 +160,18 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_source(data: object) -> Union[None, Unset, str]: + def _parse_source(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) source = _parse_source(d.pop("source", UNSET)) summary = d.pop("summary", UNSET) - def _parse_service_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_service_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -184,11 +184,11 @@ def _parse_service_ids(data: object) -> Union[None, Unset, list[str]]: return service_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) service_ids = _parse_service_ids(d.pop("service_ids", UNSET)) - def _parse_environment_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_environment_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -201,11 +201,11 @@ def _parse_environment_ids(data: object) -> Union[None, Unset, list[str]]: return environment_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) environment_ids = _parse_environment_ids(d.pop("environment_ids", UNSET)) - def _parse_started_at(data: object) -> Union[None, Unset, datetime.datetime]: + def _parse_started_at(data: object) -> None | Unset | datetime.datetime: if data is None: return data if isinstance(data, Unset): @@ -218,11 +218,11 @@ def _parse_started_at(data: object) -> Union[None, Unset, datetime.datetime]: return started_at_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, datetime.datetime], data) + return cast(None | Unset | datetime.datetime, data) started_at = _parse_started_at(d.pop("started_at", UNSET)) - def _parse_ended_at(data: object) -> Union[None, Unset, datetime.datetime]: + def _parse_ended_at(data: object) -> None | Unset | datetime.datetime: if data is None: return data if isinstance(data, Unset): @@ -235,16 +235,16 @@ def _parse_ended_at(data: object) -> Union[None, Unset, datetime.datetime]: return ended_at_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, datetime.datetime], data) + return cast(None | Unset | datetime.datetime, data) ended_at = _parse_ended_at(d.pop("ended_at", UNSET)) - def _parse_external_url(data: object) -> Union[None, Unset, str]: + def _parse_external_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) external_url = _parse_external_url(d.pop("external_url", UNSET)) diff --git a/rootly_sdk/models/update_quip_page_task_params.py b/rootly_sdk/models/update_quip_page_task_params.py index a2284a2b..de4bf983 100644 --- a/rootly_sdk/models/update_quip_page_task_params.py +++ b/rootly_sdk/models/update_quip_page_task_params.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -26,17 +26,17 @@ class UpdateQuipPageTaskParams: """ file_id: str - task_type: Union[Unset, UpdateQuipPageTaskParamsTaskType] = UNSET - title: Union[Unset, str] = UNSET - content: Union[Unset, str] = UNSET - post_mortem_template_id: Union[Unset, str] = UNSET - template_id: Union[Unset, str] = UNSET + task_type: Unset | UpdateQuipPageTaskParamsTaskType = UNSET + title: Unset | str = UNSET + content: Unset | str = UNSET + post_mortem_template_id: Unset | str = UNSET + template_id: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: file_id = self.file_id - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -74,7 +74,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: file_id = d.pop("file_id") _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, UpdateQuipPageTaskParamsTaskType] + task_type: Unset | UpdateQuipPageTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/update_retrospective_configuration_data_attributes.py b/rootly_sdk/models/update_retrospective_configuration_data_attributes.py index 169ae1da..318b73d8 100644 --- a/rootly_sdk/models/update_retrospective_configuration_data_attributes.py +++ b/rootly_sdk/models/update_retrospective_configuration_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -18,12 +18,12 @@ class UpdateRetrospectiveConfigurationDataAttributes: configuration """ - severity_ids: Union[None, Unset, list[str]] = UNSET - group_ids: Union[None, Unset, list[str]] = UNSET - incident_type_ids: Union[None, Unset, list[str]] = UNSET + severity_ids: None | Unset | list[str] = UNSET + group_ids: None | Unset | list[str] = UNSET + incident_type_ids: None | Unset | list[str] = UNSET def to_dict(self) -> dict[str, Any]: - severity_ids: Union[None, Unset, list[str]] + severity_ids: None | Unset | list[str] if isinstance(self.severity_ids, Unset): severity_ids = UNSET elif isinstance(self.severity_ids, list): @@ -32,7 +32,7 @@ def to_dict(self) -> dict[str, Any]: else: severity_ids = self.severity_ids - group_ids: Union[None, Unset, list[str]] + group_ids: None | Unset | list[str] if isinstance(self.group_ids, Unset): group_ids = UNSET elif isinstance(self.group_ids, list): @@ -41,7 +41,7 @@ def to_dict(self) -> dict[str, Any]: else: group_ids = self.group_ids - incident_type_ids: Union[None, Unset, list[str]] + incident_type_ids: None | Unset | list[str] if isinstance(self.incident_type_ids, Unset): incident_type_ids = UNSET elif isinstance(self.incident_type_ids, list): @@ -66,7 +66,7 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_severity_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_severity_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -79,11 +79,11 @@ def _parse_severity_ids(data: object) -> Union[None, Unset, list[str]]: return severity_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) severity_ids = _parse_severity_ids(d.pop("severity_ids", UNSET)) - def _parse_group_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_group_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -96,11 +96,11 @@ def _parse_group_ids(data: object) -> Union[None, Unset, list[str]]: return group_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) group_ids = _parse_group_ids(d.pop("group_ids", UNSET)) - def _parse_incident_type_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_incident_type_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -113,7 +113,7 @@ def _parse_incident_type_ids(data: object) -> Union[None, Unset, list[str]]: return incident_type_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) incident_type_ids = _parse_incident_type_ids(d.pop("incident_type_ids", UNSET)) diff --git a/rootly_sdk/models/update_retrospective_process_data_attributes.py b/rootly_sdk/models/update_retrospective_process_data_attributes.py index 7bd9c504..36f56c48 100644 --- a/rootly_sdk/models/update_retrospective_process_data_attributes.py +++ b/rootly_sdk/models/update_retrospective_process_data_attributes.py @@ -32,8 +32,8 @@ class UpdateRetrospectiveProcessDataAttributes: 'UpdateRetrospectiveProcessDataAttributesRetrospectiveProcessMatchingCriteriaType2', Unset]): """ - name: Union[Unset, str] = UNSET - description: Union[None, Unset, str] = UNSET + name: Unset | str = UNSET + description: None | Unset | str = UNSET retrospective_process_matching_criteria: Union[ "UpdateRetrospectiveProcessDataAttributesRetrospectiveProcessMatchingCriteriaType0", "UpdateRetrospectiveProcessDataAttributesRetrospectiveProcessMatchingCriteriaType1", @@ -51,13 +51,13 @@ def to_dict(self) -> dict[str, Any]: name = self.name - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - retrospective_process_matching_criteria: Union[Unset, dict[str, Any]] + retrospective_process_matching_criteria: Unset | dict[str, Any] if isinstance(self.retrospective_process_matching_criteria, Unset): retrospective_process_matching_criteria = UNSET elif isinstance( @@ -100,12 +100,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name", UNSET) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) diff --git a/rootly_sdk/models/update_retrospective_process_group_data_attributes.py b/rootly_sdk/models/update_retrospective_process_group_data_attributes.py index 65ee8899..6c573ac5 100644 --- a/rootly_sdk/models/update_retrospective_process_group_data_attributes.py +++ b/rootly_sdk/models/update_retrospective_process_group_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define @@ -16,8 +16,8 @@ class UpdateRetrospectiveProcessGroupDataAttributes: position (Union[Unset, int]): """ - sub_status_id: Union[Unset, str] = UNSET - position: Union[Unset, int] = UNSET + sub_status_id: Unset | str = UNSET + position: Unset | int = UNSET def to_dict(self) -> dict[str, Any]: sub_status_id = self.sub_status_id diff --git a/rootly_sdk/models/update_retrospective_process_group_step_data_attributes.py b/rootly_sdk/models/update_retrospective_process_group_step_data_attributes.py index 646f609e..2568f90e 100644 --- a/rootly_sdk/models/update_retrospective_process_group_step_data_attributes.py +++ b/rootly_sdk/models/update_retrospective_process_group_step_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define @@ -15,7 +15,7 @@ class UpdateRetrospectiveProcessGroupStepDataAttributes: position (Union[Unset, int]): """ - position: Union[Unset, int] = UNSET + position: Unset | int = UNSET def to_dict(self) -> dict[str, Any]: position = self.position diff --git a/rootly_sdk/models/update_retrospective_step_data_attributes.py b/rootly_sdk/models/update_retrospective_step_data_attributes.py index e01a5182..a1e7a4fa 100644 --- a/rootly_sdk/models/update_retrospective_step_data_attributes.py +++ b/rootly_sdk/models/update_retrospective_step_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -23,16 +23,16 @@ class UpdateRetrospectiveStepDataAttributes: skippable (Union[Unset, bool]): Is the step skippable? """ - slug: Union[None, Unset, str] = UNSET - title: Union[Unset, str] = UNSET - description: Union[None, Unset, str] = UNSET - incident_role_id: Union[None, Unset, str] = UNSET - due_after_days: Union[None, Unset, int] = UNSET - position: Union[None, Unset, int] = UNSET - skippable: Union[Unset, bool] = UNSET + slug: None | Unset | str = UNSET + title: Unset | str = UNSET + description: None | Unset | str = UNSET + incident_role_id: None | Unset | str = UNSET + due_after_days: None | Unset | int = UNSET + position: None | Unset | int = UNSET + skippable: Unset | bool = UNSET def to_dict(self) -> dict[str, Any]: - slug: Union[None, Unset, str] + slug: None | Unset | str if isinstance(self.slug, Unset): slug = UNSET else: @@ -40,25 +40,25 @@ def to_dict(self) -> dict[str, Any]: title = self.title - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - incident_role_id: Union[None, Unset, str] + incident_role_id: None | Unset | str if isinstance(self.incident_role_id, Unset): incident_role_id = UNSET else: incident_role_id = self.incident_role_id - due_after_days: Union[None, Unset, int] + due_after_days: None | Unset | int if isinstance(self.due_after_days, Unset): due_after_days = UNSET else: due_after_days = self.due_after_days - position: Union[None, Unset, int] + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: @@ -90,50 +90,50 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_slug(data: object) -> Union[None, Unset, str]: + def _parse_slug(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) slug = _parse_slug(d.pop("slug", UNSET)) title = d.pop("title", UNSET) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_incident_role_id(data: object) -> Union[None, Unset, str]: + def _parse_incident_role_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) incident_role_id = _parse_incident_role_id(d.pop("incident_role_id", UNSET)) - def _parse_due_after_days(data: object) -> Union[None, Unset, int]: + def _parse_due_after_days(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) due_after_days = _parse_due_after_days(d.pop("due_after_days", UNSET)) - def _parse_position(data: object) -> Union[None, Unset, int]: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) diff --git a/rootly_sdk/models/update_role_data_attributes.py b/rootly_sdk/models/update_role_data_attributes.py index 9a4e1bd9..b802aa29 100644 --- a/rootly_sdk/models/update_role_data_attributes.py +++ b/rootly_sdk/models/update_role_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -177,47 +177,47 @@ class UpdateRoleDataAttributes: communication_permissions (Union[Unset, list[UpdateRoleDataAttributesCommunicationPermissionsItem]]): """ - slug: Union[None, Unset, str] = UNSET - name: Union[Unset, str] = UNSET - incident_permission_set_id: Union[None, Unset, str] = UNSET - is_deletable: Union[Unset, bool] = UNSET - is_editable: Union[Unset, bool] = UNSET - api_keys_permissions: Union[Unset, list[UpdateRoleDataAttributesApiKeysPermissionsItem]] = UNSET - audits_permissions: Union[Unset, list[UpdateRoleDataAttributesAuditsPermissionsItem]] = UNSET - billing_permissions: Union[Unset, list[UpdateRoleDataAttributesBillingPermissionsItem]] = UNSET - environments_permissions: Union[Unset, list[UpdateRoleDataAttributesEnvironmentsPermissionsItem]] = UNSET - form_fields_permissions: Union[Unset, list[UpdateRoleDataAttributesFormFieldsPermissionsItem]] = UNSET - functionalities_permissions: Union[Unset, list[UpdateRoleDataAttributesFunctionalitiesPermissionsItem]] = UNSET - groups_permissions: Union[Unset, list[UpdateRoleDataAttributesGroupsPermissionsItem]] = UNSET - incident_causes_permissions: Union[Unset, list[UpdateRoleDataAttributesIncidentCausesPermissionsItem]] = UNSET - incident_feedbacks_permissions: Union[Unset, list[UpdateRoleDataAttributesIncidentFeedbacksPermissionsItem]] = UNSET - incident_roles_permissions: Union[Unset, list[UpdateRoleDataAttributesIncidentRolesPermissionsItem]] = UNSET - incident_types_permissions: Union[Unset, list[UpdateRoleDataAttributesIncidentTypesPermissionsItem]] = UNSET - incidents_permissions: Union[Unset, list[UpdateRoleDataAttributesIncidentsPermissionsItem]] = UNSET - integrations_permissions: Union[Unset, list[UpdateRoleDataAttributesIntegrationsPermissionsItem]] = UNSET - invitations_permissions: Union[Unset, list[UpdateRoleDataAttributesInvitationsPermissionsItem]] = UNSET - playbooks_permissions: Union[Unset, list[UpdateRoleDataAttributesPlaybooksPermissionsItem]] = UNSET - private_incidents_permissions: Union[Unset, list[UpdateRoleDataAttributesPrivateIncidentsPermissionsItem]] = UNSET - retrospective_permissions: Union[Unset, list[UpdateRoleDataAttributesRetrospectivePermissionsItem]] = UNSET - roles_permissions: Union[Unset, list[UpdateRoleDataAttributesRolesPermissionsItem]] = UNSET - secrets_permissions: Union[Unset, list[UpdateRoleDataAttributesSecretsPermissionsItem]] = UNSET - services_permissions: Union[Unset, list[UpdateRoleDataAttributesServicesPermissionsItem]] = UNSET - severities_permissions: Union[Unset, list[UpdateRoleDataAttributesSeveritiesPermissionsItem]] = UNSET - status_pages_permissions: Union[Unset, list[UpdateRoleDataAttributesStatusPagesPermissionsItem]] = UNSET - webhooks_permissions: Union[Unset, list[UpdateRoleDataAttributesWebhooksPermissionsItem]] = UNSET - workflows_permissions: Union[Unset, list[UpdateRoleDataAttributesWorkflowsPermissionsItem]] = UNSET - catalogs_permissions: Union[Unset, list[UpdateRoleDataAttributesCatalogsPermissionsItem]] = UNSET - sub_statuses_permissions: Union[Unset, list[UpdateRoleDataAttributesSubStatusesPermissionsItem]] = UNSET - edge_connector_permissions: Union[Unset, list[UpdateRoleDataAttributesEdgeConnectorPermissionsItem]] = UNSET - slas_permissions: Union[Unset, list[UpdateRoleDataAttributesSlasPermissionsItem]] = UNSET - paging_permissions: Union[Unset, list[UpdateRoleDataAttributesPagingPermissionsItem]] = UNSET - incident_communication_permissions: Union[ - Unset, list[UpdateRoleDataAttributesIncidentCommunicationPermissionsItem] - ] = UNSET - communication_permissions: Union[Unset, list[UpdateRoleDataAttributesCommunicationPermissionsItem]] = UNSET + slug: None | Unset | str = UNSET + name: Unset | str = UNSET + incident_permission_set_id: None | Unset | str = UNSET + is_deletable: Unset | bool = UNSET + is_editable: Unset | bool = UNSET + api_keys_permissions: Unset | list[UpdateRoleDataAttributesApiKeysPermissionsItem] = UNSET + audits_permissions: Unset | list[UpdateRoleDataAttributesAuditsPermissionsItem] = UNSET + billing_permissions: Unset | list[UpdateRoleDataAttributesBillingPermissionsItem] = UNSET + environments_permissions: Unset | list[UpdateRoleDataAttributesEnvironmentsPermissionsItem] = UNSET + form_fields_permissions: Unset | list[UpdateRoleDataAttributesFormFieldsPermissionsItem] = UNSET + functionalities_permissions: Unset | list[UpdateRoleDataAttributesFunctionalitiesPermissionsItem] = UNSET + groups_permissions: Unset | list[UpdateRoleDataAttributesGroupsPermissionsItem] = UNSET + incident_causes_permissions: Unset | list[UpdateRoleDataAttributesIncidentCausesPermissionsItem] = UNSET + incident_feedbacks_permissions: Unset | list[UpdateRoleDataAttributesIncidentFeedbacksPermissionsItem] = UNSET + incident_roles_permissions: Unset | list[UpdateRoleDataAttributesIncidentRolesPermissionsItem] = UNSET + incident_types_permissions: Unset | list[UpdateRoleDataAttributesIncidentTypesPermissionsItem] = UNSET + incidents_permissions: Unset | list[UpdateRoleDataAttributesIncidentsPermissionsItem] = UNSET + integrations_permissions: Unset | list[UpdateRoleDataAttributesIntegrationsPermissionsItem] = UNSET + invitations_permissions: Unset | list[UpdateRoleDataAttributesInvitationsPermissionsItem] = UNSET + playbooks_permissions: Unset | list[UpdateRoleDataAttributesPlaybooksPermissionsItem] = UNSET + private_incidents_permissions: Unset | list[UpdateRoleDataAttributesPrivateIncidentsPermissionsItem] = UNSET + retrospective_permissions: Unset | list[UpdateRoleDataAttributesRetrospectivePermissionsItem] = UNSET + roles_permissions: Unset | list[UpdateRoleDataAttributesRolesPermissionsItem] = UNSET + secrets_permissions: Unset | list[UpdateRoleDataAttributesSecretsPermissionsItem] = UNSET + services_permissions: Unset | list[UpdateRoleDataAttributesServicesPermissionsItem] = UNSET + severities_permissions: Unset | list[UpdateRoleDataAttributesSeveritiesPermissionsItem] = UNSET + status_pages_permissions: Unset | list[UpdateRoleDataAttributesStatusPagesPermissionsItem] = UNSET + webhooks_permissions: Unset | list[UpdateRoleDataAttributesWebhooksPermissionsItem] = UNSET + workflows_permissions: Unset | list[UpdateRoleDataAttributesWorkflowsPermissionsItem] = UNSET + catalogs_permissions: Unset | list[UpdateRoleDataAttributesCatalogsPermissionsItem] = UNSET + sub_statuses_permissions: Unset | list[UpdateRoleDataAttributesSubStatusesPermissionsItem] = UNSET + edge_connector_permissions: Unset | list[UpdateRoleDataAttributesEdgeConnectorPermissionsItem] = UNSET + slas_permissions: Unset | list[UpdateRoleDataAttributesSlasPermissionsItem] = UNSET + paging_permissions: Unset | list[UpdateRoleDataAttributesPagingPermissionsItem] = UNSET + incident_communication_permissions: Unset | list[UpdateRoleDataAttributesIncidentCommunicationPermissionsItem] = ( + UNSET + ) + communication_permissions: Unset | list[UpdateRoleDataAttributesCommunicationPermissionsItem] = UNSET def to_dict(self) -> dict[str, Any]: - slug: Union[None, Unset, str] + slug: None | Unset | str if isinstance(self.slug, Unset): slug = UNSET else: @@ -225,7 +225,7 @@ def to_dict(self) -> dict[str, Any]: name = self.name - incident_permission_set_id: Union[None, Unset, str] + incident_permission_set_id: None | Unset | str if isinstance(self.incident_permission_set_id, Unset): incident_permission_set_id = UNSET else: @@ -235,217 +235,217 @@ def to_dict(self) -> dict[str, Any]: is_editable = self.is_editable - api_keys_permissions: Union[Unset, list[str]] = UNSET + api_keys_permissions: Unset | list[str] = UNSET if not isinstance(self.api_keys_permissions, Unset): api_keys_permissions = [] for api_keys_permissions_item_data in self.api_keys_permissions: api_keys_permissions_item: str = api_keys_permissions_item_data api_keys_permissions.append(api_keys_permissions_item) - audits_permissions: Union[Unset, list[str]] = UNSET + audits_permissions: Unset | list[str] = UNSET if not isinstance(self.audits_permissions, Unset): audits_permissions = [] for audits_permissions_item_data in self.audits_permissions: audits_permissions_item: str = audits_permissions_item_data audits_permissions.append(audits_permissions_item) - billing_permissions: Union[Unset, list[str]] = UNSET + billing_permissions: Unset | list[str] = UNSET if not isinstance(self.billing_permissions, Unset): billing_permissions = [] for billing_permissions_item_data in self.billing_permissions: billing_permissions_item: str = billing_permissions_item_data billing_permissions.append(billing_permissions_item) - environments_permissions: Union[Unset, list[str]] = UNSET + environments_permissions: Unset | list[str] = UNSET if not isinstance(self.environments_permissions, Unset): environments_permissions = [] for environments_permissions_item_data in self.environments_permissions: environments_permissions_item: str = environments_permissions_item_data environments_permissions.append(environments_permissions_item) - form_fields_permissions: Union[Unset, list[str]] = UNSET + form_fields_permissions: Unset | list[str] = UNSET if not isinstance(self.form_fields_permissions, Unset): form_fields_permissions = [] for form_fields_permissions_item_data in self.form_fields_permissions: form_fields_permissions_item: str = form_fields_permissions_item_data form_fields_permissions.append(form_fields_permissions_item) - functionalities_permissions: Union[Unset, list[str]] = UNSET + functionalities_permissions: Unset | list[str] = UNSET if not isinstance(self.functionalities_permissions, Unset): functionalities_permissions = [] for functionalities_permissions_item_data in self.functionalities_permissions: functionalities_permissions_item: str = functionalities_permissions_item_data functionalities_permissions.append(functionalities_permissions_item) - groups_permissions: Union[Unset, list[str]] = UNSET + groups_permissions: Unset | list[str] = UNSET if not isinstance(self.groups_permissions, Unset): groups_permissions = [] for groups_permissions_item_data in self.groups_permissions: groups_permissions_item: str = groups_permissions_item_data groups_permissions.append(groups_permissions_item) - incident_causes_permissions: Union[Unset, list[str]] = UNSET + incident_causes_permissions: Unset | list[str] = UNSET if not isinstance(self.incident_causes_permissions, Unset): incident_causes_permissions = [] for incident_causes_permissions_item_data in self.incident_causes_permissions: incident_causes_permissions_item: str = incident_causes_permissions_item_data incident_causes_permissions.append(incident_causes_permissions_item) - incident_feedbacks_permissions: Union[Unset, list[str]] = UNSET + incident_feedbacks_permissions: Unset | list[str] = UNSET if not isinstance(self.incident_feedbacks_permissions, Unset): incident_feedbacks_permissions = [] for incident_feedbacks_permissions_item_data in self.incident_feedbacks_permissions: incident_feedbacks_permissions_item: str = incident_feedbacks_permissions_item_data incident_feedbacks_permissions.append(incident_feedbacks_permissions_item) - incident_roles_permissions: Union[Unset, list[str]] = UNSET + incident_roles_permissions: Unset | list[str] = UNSET if not isinstance(self.incident_roles_permissions, Unset): incident_roles_permissions = [] for incident_roles_permissions_item_data in self.incident_roles_permissions: incident_roles_permissions_item: str = incident_roles_permissions_item_data incident_roles_permissions.append(incident_roles_permissions_item) - incident_types_permissions: Union[Unset, list[str]] = UNSET + incident_types_permissions: Unset | list[str] = UNSET if not isinstance(self.incident_types_permissions, Unset): incident_types_permissions = [] for incident_types_permissions_item_data in self.incident_types_permissions: incident_types_permissions_item: str = incident_types_permissions_item_data incident_types_permissions.append(incident_types_permissions_item) - incidents_permissions: Union[Unset, list[str]] = UNSET + incidents_permissions: Unset | list[str] = UNSET if not isinstance(self.incidents_permissions, Unset): incidents_permissions = [] for incidents_permissions_item_data in self.incidents_permissions: incidents_permissions_item: str = incidents_permissions_item_data incidents_permissions.append(incidents_permissions_item) - integrations_permissions: Union[Unset, list[str]] = UNSET + integrations_permissions: Unset | list[str] = UNSET if not isinstance(self.integrations_permissions, Unset): integrations_permissions = [] for integrations_permissions_item_data in self.integrations_permissions: integrations_permissions_item: str = integrations_permissions_item_data integrations_permissions.append(integrations_permissions_item) - invitations_permissions: Union[Unset, list[str]] = UNSET + invitations_permissions: Unset | list[str] = UNSET if not isinstance(self.invitations_permissions, Unset): invitations_permissions = [] for invitations_permissions_item_data in self.invitations_permissions: invitations_permissions_item: str = invitations_permissions_item_data invitations_permissions.append(invitations_permissions_item) - playbooks_permissions: Union[Unset, list[str]] = UNSET + playbooks_permissions: Unset | list[str] = UNSET if not isinstance(self.playbooks_permissions, Unset): playbooks_permissions = [] for playbooks_permissions_item_data in self.playbooks_permissions: playbooks_permissions_item: str = playbooks_permissions_item_data playbooks_permissions.append(playbooks_permissions_item) - private_incidents_permissions: Union[Unset, list[str]] = UNSET + private_incidents_permissions: Unset | list[str] = UNSET if not isinstance(self.private_incidents_permissions, Unset): private_incidents_permissions = [] for private_incidents_permissions_item_data in self.private_incidents_permissions: private_incidents_permissions_item: str = private_incidents_permissions_item_data private_incidents_permissions.append(private_incidents_permissions_item) - retrospective_permissions: Union[Unset, list[str]] = UNSET + retrospective_permissions: Unset | list[str] = UNSET if not isinstance(self.retrospective_permissions, Unset): retrospective_permissions = [] for retrospective_permissions_item_data in self.retrospective_permissions: retrospective_permissions_item: str = retrospective_permissions_item_data retrospective_permissions.append(retrospective_permissions_item) - roles_permissions: Union[Unset, list[str]] = UNSET + roles_permissions: Unset | list[str] = UNSET if not isinstance(self.roles_permissions, Unset): roles_permissions = [] for roles_permissions_item_data in self.roles_permissions: roles_permissions_item: str = roles_permissions_item_data roles_permissions.append(roles_permissions_item) - secrets_permissions: Union[Unset, list[str]] = UNSET + secrets_permissions: Unset | list[str] = UNSET if not isinstance(self.secrets_permissions, Unset): secrets_permissions = [] for secrets_permissions_item_data in self.secrets_permissions: secrets_permissions_item: str = secrets_permissions_item_data secrets_permissions.append(secrets_permissions_item) - services_permissions: Union[Unset, list[str]] = UNSET + services_permissions: Unset | list[str] = UNSET if not isinstance(self.services_permissions, Unset): services_permissions = [] for services_permissions_item_data in self.services_permissions: services_permissions_item: str = services_permissions_item_data services_permissions.append(services_permissions_item) - severities_permissions: Union[Unset, list[str]] = UNSET + severities_permissions: Unset | list[str] = UNSET if not isinstance(self.severities_permissions, Unset): severities_permissions = [] for severities_permissions_item_data in self.severities_permissions: severities_permissions_item: str = severities_permissions_item_data severities_permissions.append(severities_permissions_item) - status_pages_permissions: Union[Unset, list[str]] = UNSET + status_pages_permissions: Unset | list[str] = UNSET if not isinstance(self.status_pages_permissions, Unset): status_pages_permissions = [] for status_pages_permissions_item_data in self.status_pages_permissions: status_pages_permissions_item: str = status_pages_permissions_item_data status_pages_permissions.append(status_pages_permissions_item) - webhooks_permissions: Union[Unset, list[str]] = UNSET + webhooks_permissions: Unset | list[str] = UNSET if not isinstance(self.webhooks_permissions, Unset): webhooks_permissions = [] for webhooks_permissions_item_data in self.webhooks_permissions: webhooks_permissions_item: str = webhooks_permissions_item_data webhooks_permissions.append(webhooks_permissions_item) - workflows_permissions: Union[Unset, list[str]] = UNSET + workflows_permissions: Unset | list[str] = UNSET if not isinstance(self.workflows_permissions, Unset): workflows_permissions = [] for workflows_permissions_item_data in self.workflows_permissions: workflows_permissions_item: str = workflows_permissions_item_data workflows_permissions.append(workflows_permissions_item) - catalogs_permissions: Union[Unset, list[str]] = UNSET + catalogs_permissions: Unset | list[str] = UNSET if not isinstance(self.catalogs_permissions, Unset): catalogs_permissions = [] for catalogs_permissions_item_data in self.catalogs_permissions: catalogs_permissions_item: str = catalogs_permissions_item_data catalogs_permissions.append(catalogs_permissions_item) - sub_statuses_permissions: Union[Unset, list[str]] = UNSET + sub_statuses_permissions: Unset | list[str] = UNSET if not isinstance(self.sub_statuses_permissions, Unset): sub_statuses_permissions = [] for sub_statuses_permissions_item_data in self.sub_statuses_permissions: sub_statuses_permissions_item: str = sub_statuses_permissions_item_data sub_statuses_permissions.append(sub_statuses_permissions_item) - edge_connector_permissions: Union[Unset, list[str]] = UNSET + edge_connector_permissions: Unset | list[str] = UNSET if not isinstance(self.edge_connector_permissions, Unset): edge_connector_permissions = [] for edge_connector_permissions_item_data in self.edge_connector_permissions: edge_connector_permissions_item: str = edge_connector_permissions_item_data edge_connector_permissions.append(edge_connector_permissions_item) - slas_permissions: Union[Unset, list[str]] = UNSET + slas_permissions: Unset | list[str] = UNSET if not isinstance(self.slas_permissions, Unset): slas_permissions = [] for slas_permissions_item_data in self.slas_permissions: slas_permissions_item: str = slas_permissions_item_data slas_permissions.append(slas_permissions_item) - paging_permissions: Union[Unset, list[str]] = UNSET + paging_permissions: Unset | list[str] = UNSET if not isinstance(self.paging_permissions, Unset): paging_permissions = [] for paging_permissions_item_data in self.paging_permissions: paging_permissions_item: str = paging_permissions_item_data paging_permissions.append(paging_permissions_item) - incident_communication_permissions: Union[Unset, list[str]] = UNSET + incident_communication_permissions: Unset | list[str] = UNSET if not isinstance(self.incident_communication_permissions, Unset): incident_communication_permissions = [] for incident_communication_permissions_item_data in self.incident_communication_permissions: incident_communication_permissions_item: str = incident_communication_permissions_item_data incident_communication_permissions.append(incident_communication_permissions_item) - communication_permissions: Union[Unset, list[str]] = UNSET + communication_permissions: Unset | list[str] = UNSET if not isinstance(self.communication_permissions, Unset): communication_permissions = [] for communication_permissions_item_data in self.communication_permissions: @@ -534,23 +534,23 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_slug(data: object) -> Union[None, Unset, str]: + def _parse_slug(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) slug = _parse_slug(d.pop("slug", UNSET)) name = d.pop("name", UNSET) - def _parse_incident_permission_set_id(data: object) -> Union[None, Unset, str]: + def _parse_incident_permission_set_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) incident_permission_set_id = _parse_incident_permission_set_id(d.pop("incident_permission_set_id", UNSET)) diff --git a/rootly_sdk/models/update_schedule_data_attributes.py b/rootly_sdk/models/update_schedule_data_attributes.py index 33e9e293..894682df 100644 --- a/rootly_sdk/models/update_schedule_data_attributes.py +++ b/rootly_sdk/models/update_schedule_data_attributes.py @@ -47,21 +47,21 @@ class UpdateScheduleDataAttributes: shift_report_time_zone (Union[None, Unset, str]): IANA time zone used for the weekly shift summary """ - name: Union[Unset, str] = UNSET - description: Union[None, Unset, str] = UNSET - all_time_coverage: Union[None, Unset, bool] = UNSET + name: Unset | str = UNSET + description: None | Unset | str = UNSET + all_time_coverage: None | Unset | bool = UNSET slack_user_group: Union[Unset, "UpdateScheduleDataAttributesSlackUserGroup"] = UNSET slack_channel: Union["UpdateScheduleDataAttributesSlackChannelType0", None, Unset] = UNSET - owner_group_ids: Union[Unset, list[str]] = UNSET - owner_user_id: Union[None, Unset, int] = UNSET - sync_linear_enabled: Union[None, Unset, bool] = UNSET - include_shadows_in_slack_notifications: Union[None, Unset, bool] = UNSET - shift_start_notifications_enabled: Union[None, Unset, bool] = UNSET - shift_update_notifications_enabled: Union[None, Unset, bool] = UNSET - shift_report_enabled: Union[None, Unset, bool] = UNSET - shift_report_day_of_week: Union[Unset, UpdateScheduleDataAttributesShiftReportDayOfWeek] = UNSET - shift_report_time_of_day: Union[None, Unset, str] = UNSET - shift_report_time_zone: Union[None, Unset, str] = UNSET + owner_group_ids: Unset | list[str] = UNSET + owner_user_id: None | Unset | int = UNSET + sync_linear_enabled: None | Unset | bool = UNSET + include_shadows_in_slack_notifications: None | Unset | bool = UNSET + shift_start_notifications_enabled: None | Unset | bool = UNSET + shift_update_notifications_enabled: None | Unset | bool = UNSET + shift_report_enabled: None | Unset | bool = UNSET + shift_report_day_of_week: Unset | UpdateScheduleDataAttributesShiftReportDayOfWeek = UNSET + shift_report_time_of_day: None | Unset | str = UNSET + shift_report_time_zone: None | Unset | str = UNSET def to_dict(self) -> dict[str, Any]: from ..models.update_schedule_data_attributes_slack_channel_type_0 import ( @@ -70,23 +70,23 @@ def to_dict(self) -> dict[str, Any]: name = self.name - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - all_time_coverage: Union[None, Unset, bool] + all_time_coverage: None | Unset | bool if isinstance(self.all_time_coverage, Unset): all_time_coverage = UNSET else: all_time_coverage = self.all_time_coverage - slack_user_group: Union[Unset, dict[str, Any]] = UNSET + slack_user_group: Unset | dict[str, Any] = UNSET if not isinstance(self.slack_user_group, Unset): slack_user_group = self.slack_user_group.to_dict() - slack_channel: Union[None, Unset, dict[str, Any]] + slack_channel: None | Unset | dict[str, Any] if isinstance(self.slack_channel, Unset): slack_channel = UNSET elif isinstance(self.slack_channel, UpdateScheduleDataAttributesSlackChannelType0): @@ -94,57 +94,57 @@ def to_dict(self) -> dict[str, Any]: else: slack_channel = self.slack_channel - owner_group_ids: Union[Unset, list[str]] = UNSET + owner_group_ids: Unset | list[str] = UNSET if not isinstance(self.owner_group_ids, Unset): owner_group_ids = self.owner_group_ids - owner_user_id: Union[None, Unset, int] + owner_user_id: None | Unset | int if isinstance(self.owner_user_id, Unset): owner_user_id = UNSET else: owner_user_id = self.owner_user_id - sync_linear_enabled: Union[None, Unset, bool] + sync_linear_enabled: None | Unset | bool if isinstance(self.sync_linear_enabled, Unset): sync_linear_enabled = UNSET else: sync_linear_enabled = self.sync_linear_enabled - include_shadows_in_slack_notifications: Union[None, Unset, bool] + include_shadows_in_slack_notifications: None | Unset | bool if isinstance(self.include_shadows_in_slack_notifications, Unset): include_shadows_in_slack_notifications = UNSET else: include_shadows_in_slack_notifications = self.include_shadows_in_slack_notifications - shift_start_notifications_enabled: Union[None, Unset, bool] + shift_start_notifications_enabled: None | Unset | bool if isinstance(self.shift_start_notifications_enabled, Unset): shift_start_notifications_enabled = UNSET else: shift_start_notifications_enabled = self.shift_start_notifications_enabled - shift_update_notifications_enabled: Union[None, Unset, bool] + shift_update_notifications_enabled: None | Unset | bool if isinstance(self.shift_update_notifications_enabled, Unset): shift_update_notifications_enabled = UNSET else: shift_update_notifications_enabled = self.shift_update_notifications_enabled - shift_report_enabled: Union[None, Unset, bool] + shift_report_enabled: None | Unset | bool if isinstance(self.shift_report_enabled, Unset): shift_report_enabled = UNSET else: shift_report_enabled = self.shift_report_enabled - shift_report_day_of_week: Union[Unset, str] = UNSET + shift_report_day_of_week: Unset | str = UNSET if not isinstance(self.shift_report_day_of_week, Unset): shift_report_day_of_week = self.shift_report_day_of_week - shift_report_time_of_day: Union[None, Unset, str] + shift_report_time_of_day: None | Unset | str if isinstance(self.shift_report_time_of_day, Unset): shift_report_time_of_day = UNSET else: shift_report_time_of_day = self.shift_report_time_of_day - shift_report_time_zone: Union[None, Unset, str] + shift_report_time_zone: None | Unset | str if isinstance(self.shift_report_time_zone, Unset): shift_report_time_zone = UNSET else: @@ -196,26 +196,26 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name", UNSET) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_all_time_coverage(data: object) -> Union[None, Unset, bool]: + def _parse_all_time_coverage(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) all_time_coverage = _parse_all_time_coverage(d.pop("all_time_coverage", UNSET)) _slack_user_group = d.pop("slack_user_group", UNSET) - slack_user_group: Union[Unset, UpdateScheduleDataAttributesSlackUserGroup] + slack_user_group: Unset | UpdateScheduleDataAttributesSlackUserGroup if isinstance(_slack_user_group, Unset): slack_user_group = UNSET else: @@ -240,68 +240,68 @@ def _parse_slack_channel(data: object) -> Union["UpdateScheduleDataAttributesSla owner_group_ids = cast(list[str], d.pop("owner_group_ids", UNSET)) - def _parse_owner_user_id(data: object) -> Union[None, Unset, int]: + def _parse_owner_user_id(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) owner_user_id = _parse_owner_user_id(d.pop("owner_user_id", UNSET)) - def _parse_sync_linear_enabled(data: object) -> Union[None, Unset, bool]: + def _parse_sync_linear_enabled(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) sync_linear_enabled = _parse_sync_linear_enabled(d.pop("sync_linear_enabled", UNSET)) - def _parse_include_shadows_in_slack_notifications(data: object) -> Union[None, Unset, bool]: + def _parse_include_shadows_in_slack_notifications(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) include_shadows_in_slack_notifications = _parse_include_shadows_in_slack_notifications( d.pop("include_shadows_in_slack_notifications", UNSET) ) - def _parse_shift_start_notifications_enabled(data: object) -> Union[None, Unset, bool]: + def _parse_shift_start_notifications_enabled(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) shift_start_notifications_enabled = _parse_shift_start_notifications_enabled( d.pop("shift_start_notifications_enabled", UNSET) ) - def _parse_shift_update_notifications_enabled(data: object) -> Union[None, Unset, bool]: + def _parse_shift_update_notifications_enabled(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) shift_update_notifications_enabled = _parse_shift_update_notifications_enabled( d.pop("shift_update_notifications_enabled", UNSET) ) - def _parse_shift_report_enabled(data: object) -> Union[None, Unset, bool]: + def _parse_shift_report_enabled(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) shift_report_enabled = _parse_shift_report_enabled(d.pop("shift_report_enabled", UNSET)) _shift_report_day_of_week = d.pop("shift_report_day_of_week", UNSET) - shift_report_day_of_week: Union[Unset, UpdateScheduleDataAttributesShiftReportDayOfWeek] + shift_report_day_of_week: Unset | UpdateScheduleDataAttributesShiftReportDayOfWeek if isinstance(_shift_report_day_of_week, Unset): shift_report_day_of_week = UNSET else: @@ -309,21 +309,21 @@ def _parse_shift_report_enabled(data: object) -> Union[None, Unset, bool]: _shift_report_day_of_week ) - def _parse_shift_report_time_of_day(data: object) -> Union[None, Unset, str]: + def _parse_shift_report_time_of_day(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) shift_report_time_of_day = _parse_shift_report_time_of_day(d.pop("shift_report_time_of_day", UNSET)) - def _parse_shift_report_time_zone(data: object) -> Union[None, Unset, str]: + def _parse_shift_report_time_zone(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) shift_report_time_zone = _parse_shift_report_time_zone(d.pop("shift_report_time_zone", UNSET)) diff --git a/rootly_sdk/models/update_schedule_data_attributes_slack_channel_type_0.py b/rootly_sdk/models/update_schedule_data_attributes_slack_channel_type_0.py index a00cd723..46ca63e0 100644 --- a/rootly_sdk/models/update_schedule_data_attributes_slack_channel_type_0.py +++ b/rootly_sdk/models/update_schedule_data_attributes_slack_channel_type_0.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class UpdateScheduleDataAttributesSlackChannelType0: name (Union[Unset, str]): Slack channel name """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_schedule_data_attributes_slack_user_group.py b/rootly_sdk/models/update_schedule_data_attributes_slack_user_group.py index c7c9aac4..23c6060f 100644 --- a/rootly_sdk/models/update_schedule_data_attributes_slack_user_group.py +++ b/rootly_sdk/models/update_schedule_data_attributes_slack_user_group.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class UpdateScheduleDataAttributesSlackUserGroup: name (Union[Unset, str]): Slack user group name """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_schedule_rotation_active_day_data_attributes.py b/rootly_sdk/models/update_schedule_rotation_active_day_data_attributes.py index 34bacfbc..90525656 100644 --- a/rootly_sdk/models/update_schedule_rotation_active_day_data_attributes.py +++ b/rootly_sdk/models/update_schedule_rotation_active_day_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define @@ -29,17 +29,17 @@ class UpdateScheduleRotationActiveDayDataAttributes: per day """ - day_name: Union[Unset, UpdateScheduleRotationActiveDayDataAttributesDayName] = UNSET - active_time_attributes: Union[ - Unset, list["UpdateScheduleRotationActiveDayDataAttributesActiveTimeAttributesItem"] - ] = UNSET + day_name: Unset | UpdateScheduleRotationActiveDayDataAttributesDayName = UNSET + active_time_attributes: Unset | list["UpdateScheduleRotationActiveDayDataAttributesActiveTimeAttributesItem"] = ( + UNSET + ) def to_dict(self) -> dict[str, Any]: - day_name: Union[Unset, str] = UNSET + day_name: Unset | str = UNSET if not isinstance(self.day_name, Unset): day_name = self.day_name - active_time_attributes: Union[Unset, list[dict[str, Any]]] = UNSET + active_time_attributes: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.active_time_attributes, Unset): active_time_attributes = [] for active_time_attributes_item_data in self.active_time_attributes: @@ -64,7 +64,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _day_name = d.pop("day_name", UNSET) - day_name: Union[Unset, UpdateScheduleRotationActiveDayDataAttributesDayName] + day_name: Unset | UpdateScheduleRotationActiveDayDataAttributesDayName if isinstance(_day_name, Unset): day_name = UNSET else: diff --git a/rootly_sdk/models/update_schedule_rotation_active_day_data_attributes_active_time_attributes_item.py b/rootly_sdk/models/update_schedule_rotation_active_day_data_attributes_active_time_attributes_item.py index f439f8c5..1c322623 100644 --- a/rootly_sdk/models/update_schedule_rotation_active_day_data_attributes_active_time_attributes_item.py +++ b/rootly_sdk/models/update_schedule_rotation_active_day_data_attributes_active_time_attributes_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class UpdateScheduleRotationActiveDayDataAttributesActiveTimeAttributesItem: end_time (Union[Unset, str]): End time for schedule rotation active time """ - start_time: Union[Unset, str] = UNSET - end_time: Union[Unset, str] = UNSET + start_time: Unset | str = UNSET + end_time: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_schedule_rotation_data_attributes.py b/rootly_sdk/models/update_schedule_rotation_data_attributes.py index b51dddcf..33ed6694 100644 --- a/rootly_sdk/models/update_schedule_rotation_data_attributes.py +++ b/rootly_sdk/models/update_schedule_rotation_data_attributes.py @@ -68,13 +68,13 @@ class UpdateScheduleRotationDataAttributes: """ schedule_rotationable_type: UpdateScheduleRotationDataAttributesScheduleRotationableType - name: Union[Unset, str] = UNSET - position: Union[Unset, int] = UNSET - active_all_week: Union[Unset, bool] = True - active_days: Union[Unset, list[UpdateScheduleRotationDataAttributesActiveDaysItem]] = UNSET - active_time_type: Union[Unset, str] = UNSET - active_time_attributes: Union[Unset, list["UpdateScheduleRotationDataAttributesActiveTimeAttributesItem"]] = UNSET - time_zone: Union[Unset, str] = "Etc/UTC" + name: Unset | str = UNSET + position: Unset | int = UNSET + active_all_week: Unset | bool = True + active_days: Unset | list[UpdateScheduleRotationDataAttributesActiveDaysItem] = UNSET + active_time_type: Unset | str = UNSET + active_time_attributes: Unset | list["UpdateScheduleRotationDataAttributesActiveTimeAttributesItem"] = UNSET + time_zone: Unset | str = "Etc/UTC" schedule_rotationable_attributes: Union[ "UpdateScheduleRotationDataAttributesScheduleRotationableAttributesType0", "UpdateScheduleRotationDataAttributesScheduleRotationableAttributesType1", @@ -82,11 +82,11 @@ class UpdateScheduleRotationDataAttributes: "UpdateScheduleRotationDataAttributesScheduleRotationableAttributesType3", Unset, ] = UNSET - start_time: Union[None, Unset, datetime.datetime] = UNSET - end_time: Union[None, Unset, datetime.datetime] = UNSET - schedule_rotation_members: Union[ - None, Unset, list["UpdateScheduleRotationDataAttributesScheduleRotationMembersType0Item"] - ] = UNSET + start_time: None | Unset | datetime.datetime = UNSET + end_time: None | Unset | datetime.datetime = UNSET + schedule_rotation_members: ( + None | Unset | list["UpdateScheduleRotationDataAttributesScheduleRotationMembersType0Item"] + ) = UNSET def to_dict(self) -> dict[str, Any]: from ..models.update_schedule_rotation_data_attributes_schedule_rotationable_attributes_type_0 import ( @@ -107,7 +107,7 @@ def to_dict(self) -> dict[str, Any]: active_all_week = self.active_all_week - active_days: Union[Unset, list[str]] = UNSET + active_days: Unset | list[str] = UNSET if not isinstance(self.active_days, Unset): active_days = [] for active_days_item_data in self.active_days: @@ -116,7 +116,7 @@ def to_dict(self) -> dict[str, Any]: active_time_type = self.active_time_type - active_time_attributes: Union[Unset, list[dict[str, Any]]] = UNSET + active_time_attributes: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.active_time_attributes, Unset): active_time_attributes = [] for active_time_attributes_item_data in self.active_time_attributes: @@ -125,7 +125,7 @@ def to_dict(self) -> dict[str, Any]: time_zone = self.time_zone - schedule_rotationable_attributes: Union[Unset, dict[str, Any]] + schedule_rotationable_attributes: Unset | dict[str, Any] if isinstance(self.schedule_rotationable_attributes, Unset): schedule_rotationable_attributes = UNSET elif isinstance( @@ -146,7 +146,7 @@ def to_dict(self) -> dict[str, Any]: else: schedule_rotationable_attributes = self.schedule_rotationable_attributes.to_dict() - start_time: Union[None, Unset, str] + start_time: None | Unset | str if isinstance(self.start_time, Unset): start_time = UNSET elif isinstance(self.start_time, datetime.datetime): @@ -154,7 +154,7 @@ def to_dict(self) -> dict[str, Any]: else: start_time = self.start_time - end_time: Union[None, Unset, str] + end_time: None | Unset | str if isinstance(self.end_time, Unset): end_time = UNSET elif isinstance(self.end_time, datetime.datetime): @@ -162,7 +162,7 @@ def to_dict(self) -> dict[str, Any]: else: end_time = self.end_time - schedule_rotation_members: Union[None, Unset, list[dict[str, Any]]] + schedule_rotation_members: None | Unset | list[dict[str, Any]] if isinstance(self.schedule_rotation_members, Unset): schedule_rotation_members = UNSET elif isinstance(self.schedule_rotation_members, list): @@ -311,7 +311,7 @@ def _parse_schedule_rotationable_attributes( d.pop("schedule_rotationable_attributes", UNSET) ) - def _parse_start_time(data: object) -> Union[None, Unset, datetime.datetime]: + def _parse_start_time(data: object) -> None | Unset | datetime.datetime: if data is None: return data if isinstance(data, Unset): @@ -324,11 +324,11 @@ def _parse_start_time(data: object) -> Union[None, Unset, datetime.datetime]: return start_time_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, datetime.datetime], data) + return cast(None | Unset | datetime.datetime, data) start_time = _parse_start_time(d.pop("start_time", UNSET)) - def _parse_end_time(data: object) -> Union[None, Unset, datetime.datetime]: + def _parse_end_time(data: object) -> None | Unset | datetime.datetime: if data is None: return data if isinstance(data, Unset): @@ -341,13 +341,13 @@ def _parse_end_time(data: object) -> Union[None, Unset, datetime.datetime]: return end_time_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, datetime.datetime], data) + return cast(None | Unset | datetime.datetime, data) end_time = _parse_end_time(d.pop("end_time", UNSET)) def _parse_schedule_rotation_members( data: object, - ) -> Union[None, Unset, list["UpdateScheduleRotationDataAttributesScheduleRotationMembersType0Item"]]: + ) -> None | Unset | list["UpdateScheduleRotationDataAttributesScheduleRotationMembersType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -370,7 +370,7 @@ def _parse_schedule_rotation_members( except: # noqa: E722 pass return cast( - Union[None, Unset, list["UpdateScheduleRotationDataAttributesScheduleRotationMembersType0Item"]], data + None | Unset | list["UpdateScheduleRotationDataAttributesScheduleRotationMembersType0Item"], data ) schedule_rotation_members = _parse_schedule_rotation_members(d.pop("schedule_rotation_members", UNSET)) diff --git a/rootly_sdk/models/update_schedule_rotation_data_attributes_schedule_rotation_members_type_0_item.py b/rootly_sdk/models/update_schedule_rotation_data_attributes_schedule_rotation_members_type_0_item.py index e4e69c60..26bb8869 100644 --- a/rootly_sdk/models/update_schedule_rotation_data_attributes_schedule_rotation_members_type_0_item.py +++ b/rootly_sdk/models/update_schedule_rotation_data_attributes_schedule_rotation_members_type_0_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -24,7 +24,7 @@ class UpdateScheduleRotationDataAttributesScheduleRotationMembersType0Item: member_type: UpdateScheduleRotationDataAttributesScheduleRotationMembersType0ItemMemberType member_id: str - position: Union[Unset, int] = UNSET + position: Unset | int = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_schedule_rotation_user_data_attributes.py b/rootly_sdk/models/update_schedule_rotation_user_data_attributes.py index 8e746aa6..7861c6a9 100644 --- a/rootly_sdk/models/update_schedule_rotation_user_data_attributes.py +++ b/rootly_sdk/models/update_schedule_rotation_user_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define @@ -16,8 +16,8 @@ class UpdateScheduleRotationUserDataAttributes: position (Union[Unset, int]): Position of the user inside rotation """ - user_id: Union[Unset, int] = UNSET - position: Union[Unset, int] = UNSET + user_id: Unset | int = UNSET + position: Unset | int = UNSET def to_dict(self) -> dict[str, Any]: user_id = self.user_id diff --git a/rootly_sdk/models/update_secret_data_attributes.py b/rootly_sdk/models/update_secret_data_attributes.py index 60710d00..58b2ee38 100644 --- a/rootly_sdk/models/update_secret_data_attributes.py +++ b/rootly_sdk/models/update_secret_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -20,29 +20,29 @@ class UpdateSecretDataAttributes: """ name: str - secret: Union[Unset, str] = UNSET - hashicorp_vault_mount: Union[None, Unset, str] = "secret" - hashicorp_vault_path: Union[None, Unset, str] = UNSET - hashicorp_vault_version: Union[None, Unset, int] = 0 + secret: Unset | str = UNSET + hashicorp_vault_mount: None | Unset | str = "secret" + hashicorp_vault_path: None | Unset | str = UNSET + hashicorp_vault_version: None | Unset | int = 0 def to_dict(self) -> dict[str, Any]: name = self.name secret = self.secret - hashicorp_vault_mount: Union[None, Unset, str] + hashicorp_vault_mount: None | Unset | str if isinstance(self.hashicorp_vault_mount, Unset): hashicorp_vault_mount = UNSET else: hashicorp_vault_mount = self.hashicorp_vault_mount - hashicorp_vault_path: Union[None, Unset, str] + hashicorp_vault_path: None | Unset | str if isinstance(self.hashicorp_vault_path, Unset): hashicorp_vault_path = UNSET else: hashicorp_vault_path = self.hashicorp_vault_path - hashicorp_vault_version: Union[None, Unset, int] + hashicorp_vault_version: None | Unset | int if isinstance(self.hashicorp_vault_version, Unset): hashicorp_vault_version = UNSET else: @@ -73,30 +73,30 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: secret = d.pop("secret", UNSET) - def _parse_hashicorp_vault_mount(data: object) -> Union[None, Unset, str]: + def _parse_hashicorp_vault_mount(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) hashicorp_vault_mount = _parse_hashicorp_vault_mount(d.pop("hashicorp_vault_mount", UNSET)) - def _parse_hashicorp_vault_path(data: object) -> Union[None, Unset, str]: + def _parse_hashicorp_vault_path(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) hashicorp_vault_path = _parse_hashicorp_vault_path(d.pop("hashicorp_vault_path", UNSET)) - def _parse_hashicorp_vault_version(data: object) -> Union[None, Unset, int]: + def _parse_hashicorp_vault_version(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) hashicorp_vault_version = _parse_hashicorp_vault_version(d.pop("hashicorp_vault_version", UNSET)) diff --git a/rootly_sdk/models/update_service_data_attributes.py b/rootly_sdk/models/update_service_data_attributes.py index 03f9b612..3782a4e9 100644 --- a/rootly_sdk/models/update_service_data_attributes.py +++ b/rootly_sdk/models/update_service_data_attributes.py @@ -76,38 +76,38 @@ class UpdateServiceDataAttributes: service. """ - slug: Union[None, Unset, str] = UNSET - name: Union[Unset, str] = UNSET - description: Union[None, Unset, str] = UNSET - public_description: Union[None, Unset, str] = UNSET - notify_emails: Union[None, Unset, list[str]] = UNSET - color: Union[None, Unset, str] = UNSET - position: Union[None, Unset, int] = UNSET - backstage_id: Union[None, Unset, str] = UNSET - external_id: Union[None, Unset, str] = UNSET - pagerduty_id: Union[None, Unset, str] = UNSET - opsgenie_id: Union[None, Unset, str] = UNSET - cortex_id: Union[None, Unset, str] = UNSET - service_now_ci_sys_id: Union[None, Unset, str] = UNSET - github_repository_name: Union[None, Unset, str] = UNSET - github_repository_branch: Union[None, Unset, str] = UNSET - gitlab_repository_name: Union[None, Unset, str] = UNSET - gitlab_repository_branch: Union[None, Unset, str] = UNSET - environment_ids: Union[None, Unset, list[str]] = UNSET - service_ids: Union[None, Unset, list[str]] = UNSET - owner_group_ids: Union[None, Unset, list[str]] = UNSET - owner_user_ids: Union[None, Unset, list[int]] = UNSET - alerts_email_enabled: Union[None, Unset, bool] = UNSET - alert_urgency_id: Union[None, Unset, str] = UNSET - escalation_policy_id: Union[None, Unset, str] = UNSET - kubernetes_deployment_name: Union[None, Unset, str] = UNSET - slack_channels: Union[None, Unset, list["UpdateServiceDataAttributesSlackChannelsType0Item"]] = UNSET - slack_aliases: Union[None, Unset, list["UpdateServiceDataAttributesSlackAliasesType0Item"]] = UNSET - alert_broadcast_enabled: Union[None, Unset, bool] = UNSET + slug: None | Unset | str = UNSET + name: Unset | str = UNSET + description: None | Unset | str = UNSET + public_description: None | Unset | str = UNSET + notify_emails: None | Unset | list[str] = UNSET + color: None | Unset | str = UNSET + position: None | Unset | int = UNSET + backstage_id: None | Unset | str = UNSET + external_id: None | Unset | str = UNSET + pagerduty_id: None | Unset | str = UNSET + opsgenie_id: None | Unset | str = UNSET + cortex_id: None | Unset | str = UNSET + service_now_ci_sys_id: None | Unset | str = UNSET + github_repository_name: None | Unset | str = UNSET + github_repository_branch: None | Unset | str = UNSET + gitlab_repository_name: None | Unset | str = UNSET + gitlab_repository_branch: None | Unset | str = UNSET + environment_ids: None | Unset | list[str] = UNSET + service_ids: None | Unset | list[str] = UNSET + owner_group_ids: None | Unset | list[str] = UNSET + owner_user_ids: None | Unset | list[int] = UNSET + alerts_email_enabled: None | Unset | bool = UNSET + alert_urgency_id: None | Unset | str = UNSET + escalation_policy_id: None | Unset | str = UNSET + kubernetes_deployment_name: None | Unset | str = UNSET + slack_channels: None | Unset | list["UpdateServiceDataAttributesSlackChannelsType0Item"] = UNSET + slack_aliases: None | Unset | list["UpdateServiceDataAttributesSlackAliasesType0Item"] = UNSET + alert_broadcast_enabled: None | Unset | bool = UNSET alert_broadcast_channel: Union["UpdateServiceDataAttributesAlertBroadcastChannelType0", None, Unset] = UNSET - incident_broadcast_enabled: Union[None, Unset, bool] = UNSET + incident_broadcast_enabled: None | Unset | bool = UNSET incident_broadcast_channel: Union["UpdateServiceDataAttributesIncidentBroadcastChannelType0", None, Unset] = UNSET - properties: Union[Unset, list["UpdateServiceDataAttributesPropertiesItem"]] = UNSET + properties: Unset | list["UpdateServiceDataAttributesPropertiesItem"] = UNSET def to_dict(self) -> dict[str, Any]: from ..models.update_service_data_attributes_alert_broadcast_channel_type_0 import ( @@ -117,7 +117,7 @@ def to_dict(self) -> dict[str, Any]: UpdateServiceDataAttributesIncidentBroadcastChannelType0, ) - slug: Union[None, Unset, str] + slug: None | Unset | str if isinstance(self.slug, Unset): slug = UNSET else: @@ -125,19 +125,19 @@ def to_dict(self) -> dict[str, Any]: name = self.name - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - public_description: Union[None, Unset, str] + public_description: None | Unset | str if isinstance(self.public_description, Unset): public_description = UNSET else: public_description = self.public_description - notify_emails: Union[None, Unset, list[str]] + notify_emails: None | Unset | list[str] if isinstance(self.notify_emails, Unset): notify_emails = UNSET elif isinstance(self.notify_emails, list): @@ -146,79 +146,79 @@ def to_dict(self) -> dict[str, Any]: else: notify_emails = self.notify_emails - color: Union[None, Unset, str] + color: None | Unset | str if isinstance(self.color, Unset): color = UNSET else: color = self.color - position: Union[None, Unset, int] + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: position = self.position - backstage_id: Union[None, Unset, str] + backstage_id: None | Unset | str if isinstance(self.backstage_id, Unset): backstage_id = UNSET else: backstage_id = self.backstage_id - external_id: Union[None, Unset, str] + external_id: None | Unset | str if isinstance(self.external_id, Unset): external_id = UNSET else: external_id = self.external_id - pagerduty_id: Union[None, Unset, str] + pagerduty_id: None | Unset | str if isinstance(self.pagerduty_id, Unset): pagerduty_id = UNSET else: pagerduty_id = self.pagerduty_id - opsgenie_id: Union[None, Unset, str] + opsgenie_id: None | Unset | str if isinstance(self.opsgenie_id, Unset): opsgenie_id = UNSET else: opsgenie_id = self.opsgenie_id - cortex_id: Union[None, Unset, str] + cortex_id: None | Unset | str if isinstance(self.cortex_id, Unset): cortex_id = UNSET else: cortex_id = self.cortex_id - service_now_ci_sys_id: Union[None, Unset, str] + service_now_ci_sys_id: None | Unset | str if isinstance(self.service_now_ci_sys_id, Unset): service_now_ci_sys_id = UNSET else: service_now_ci_sys_id = self.service_now_ci_sys_id - github_repository_name: Union[None, Unset, str] + github_repository_name: None | Unset | str if isinstance(self.github_repository_name, Unset): github_repository_name = UNSET else: github_repository_name = self.github_repository_name - github_repository_branch: Union[None, Unset, str] + github_repository_branch: None | Unset | str if isinstance(self.github_repository_branch, Unset): github_repository_branch = UNSET else: github_repository_branch = self.github_repository_branch - gitlab_repository_name: Union[None, Unset, str] + gitlab_repository_name: None | Unset | str if isinstance(self.gitlab_repository_name, Unset): gitlab_repository_name = UNSET else: gitlab_repository_name = self.gitlab_repository_name - gitlab_repository_branch: Union[None, Unset, str] + gitlab_repository_branch: None | Unset | str if isinstance(self.gitlab_repository_branch, Unset): gitlab_repository_branch = UNSET else: gitlab_repository_branch = self.gitlab_repository_branch - environment_ids: Union[None, Unset, list[str]] + environment_ids: None | Unset | list[str] if isinstance(self.environment_ids, Unset): environment_ids = UNSET elif isinstance(self.environment_ids, list): @@ -227,7 +227,7 @@ def to_dict(self) -> dict[str, Any]: else: environment_ids = self.environment_ids - service_ids: Union[None, Unset, list[str]] + service_ids: None | Unset | list[str] if isinstance(self.service_ids, Unset): service_ids = UNSET elif isinstance(self.service_ids, list): @@ -236,7 +236,7 @@ def to_dict(self) -> dict[str, Any]: else: service_ids = self.service_ids - owner_group_ids: Union[None, Unset, list[str]] + owner_group_ids: None | Unset | list[str] if isinstance(self.owner_group_ids, Unset): owner_group_ids = UNSET elif isinstance(self.owner_group_ids, list): @@ -245,7 +245,7 @@ def to_dict(self) -> dict[str, Any]: else: owner_group_ids = self.owner_group_ids - owner_user_ids: Union[None, Unset, list[int]] + owner_user_ids: None | Unset | list[int] if isinstance(self.owner_user_ids, Unset): owner_user_ids = UNSET elif isinstance(self.owner_user_ids, list): @@ -254,31 +254,31 @@ def to_dict(self) -> dict[str, Any]: else: owner_user_ids = self.owner_user_ids - alerts_email_enabled: Union[None, Unset, bool] + alerts_email_enabled: None | Unset | bool if isinstance(self.alerts_email_enabled, Unset): alerts_email_enabled = UNSET else: alerts_email_enabled = self.alerts_email_enabled - alert_urgency_id: Union[None, Unset, str] + alert_urgency_id: None | Unset | str if isinstance(self.alert_urgency_id, Unset): alert_urgency_id = UNSET else: alert_urgency_id = self.alert_urgency_id - escalation_policy_id: Union[None, Unset, str] + escalation_policy_id: None | Unset | str if isinstance(self.escalation_policy_id, Unset): escalation_policy_id = UNSET else: escalation_policy_id = self.escalation_policy_id - kubernetes_deployment_name: Union[None, Unset, str] + kubernetes_deployment_name: None | Unset | str if isinstance(self.kubernetes_deployment_name, Unset): kubernetes_deployment_name = UNSET else: kubernetes_deployment_name = self.kubernetes_deployment_name - slack_channels: Union[None, Unset, list[dict[str, Any]]] + slack_channels: None | Unset | list[dict[str, Any]] if isinstance(self.slack_channels, Unset): slack_channels = UNSET elif isinstance(self.slack_channels, list): @@ -290,7 +290,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_channels = self.slack_channels - slack_aliases: Union[None, Unset, list[dict[str, Any]]] + slack_aliases: None | Unset | list[dict[str, Any]] if isinstance(self.slack_aliases, Unset): slack_aliases = UNSET elif isinstance(self.slack_aliases, list): @@ -302,13 +302,13 @@ def to_dict(self) -> dict[str, Any]: else: slack_aliases = self.slack_aliases - alert_broadcast_enabled: Union[None, Unset, bool] + alert_broadcast_enabled: None | Unset | bool if isinstance(self.alert_broadcast_enabled, Unset): alert_broadcast_enabled = UNSET else: alert_broadcast_enabled = self.alert_broadcast_enabled - alert_broadcast_channel: Union[None, Unset, dict[str, Any]] + alert_broadcast_channel: None | Unset | dict[str, Any] if isinstance(self.alert_broadcast_channel, Unset): alert_broadcast_channel = UNSET elif isinstance(self.alert_broadcast_channel, UpdateServiceDataAttributesAlertBroadcastChannelType0): @@ -316,13 +316,13 @@ def to_dict(self) -> dict[str, Any]: else: alert_broadcast_channel = self.alert_broadcast_channel - incident_broadcast_enabled: Union[None, Unset, bool] + incident_broadcast_enabled: None | Unset | bool if isinstance(self.incident_broadcast_enabled, Unset): incident_broadcast_enabled = UNSET else: incident_broadcast_enabled = self.incident_broadcast_enabled - incident_broadcast_channel: Union[None, Unset, dict[str, Any]] + incident_broadcast_channel: None | Unset | dict[str, Any] if isinstance(self.incident_broadcast_channel, Unset): incident_broadcast_channel = UNSET elif isinstance(self.incident_broadcast_channel, UpdateServiceDataAttributesIncidentBroadcastChannelType0): @@ -330,7 +330,7 @@ def to_dict(self) -> dict[str, Any]: else: incident_broadcast_channel = self.incident_broadcast_channel - properties: Union[Unset, list[dict[str, Any]]] = UNSET + properties: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.properties, Unset): properties = [] for properties_item_data in self.properties: @@ -425,36 +425,36 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_slug(data: object) -> Union[None, Unset, str]: + def _parse_slug(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) slug = _parse_slug(d.pop("slug", UNSET)) name = d.pop("name", UNSET) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_public_description(data: object) -> Union[None, Unset, str]: + def _parse_public_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) public_description = _parse_public_description(d.pop("public_description", UNSET)) - def _parse_notify_emails(data: object) -> Union[None, Unset, list[str]]: + def _parse_notify_emails(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -467,119 +467,119 @@ def _parse_notify_emails(data: object) -> Union[None, Unset, list[str]]: return notify_emails_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) notify_emails = _parse_notify_emails(d.pop("notify_emails", UNSET)) - def _parse_color(data: object) -> Union[None, Unset, str]: + def _parse_color(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) color = _parse_color(d.pop("color", UNSET)) - def _parse_position(data: object) -> Union[None, Unset, int]: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) - def _parse_backstage_id(data: object) -> Union[None, Unset, str]: + def _parse_backstage_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) backstage_id = _parse_backstage_id(d.pop("backstage_id", UNSET)) - def _parse_external_id(data: object) -> Union[None, Unset, str]: + def _parse_external_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) external_id = _parse_external_id(d.pop("external_id", UNSET)) - def _parse_pagerduty_id(data: object) -> Union[None, Unset, str]: + def _parse_pagerduty_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) pagerduty_id = _parse_pagerduty_id(d.pop("pagerduty_id", UNSET)) - def _parse_opsgenie_id(data: object) -> Union[None, Unset, str]: + def _parse_opsgenie_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) opsgenie_id = _parse_opsgenie_id(d.pop("opsgenie_id", UNSET)) - def _parse_cortex_id(data: object) -> Union[None, Unset, str]: + def _parse_cortex_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) cortex_id = _parse_cortex_id(d.pop("cortex_id", UNSET)) - def _parse_service_now_ci_sys_id(data: object) -> Union[None, Unset, str]: + def _parse_service_now_ci_sys_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) service_now_ci_sys_id = _parse_service_now_ci_sys_id(d.pop("service_now_ci_sys_id", UNSET)) - def _parse_github_repository_name(data: object) -> Union[None, Unset, str]: + def _parse_github_repository_name(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) github_repository_name = _parse_github_repository_name(d.pop("github_repository_name", UNSET)) - def _parse_github_repository_branch(data: object) -> Union[None, Unset, str]: + def _parse_github_repository_branch(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) github_repository_branch = _parse_github_repository_branch(d.pop("github_repository_branch", UNSET)) - def _parse_gitlab_repository_name(data: object) -> Union[None, Unset, str]: + def _parse_gitlab_repository_name(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) gitlab_repository_name = _parse_gitlab_repository_name(d.pop("gitlab_repository_name", UNSET)) - def _parse_gitlab_repository_branch(data: object) -> Union[None, Unset, str]: + def _parse_gitlab_repository_branch(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) gitlab_repository_branch = _parse_gitlab_repository_branch(d.pop("gitlab_repository_branch", UNSET)) - def _parse_environment_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_environment_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -592,11 +592,11 @@ def _parse_environment_ids(data: object) -> Union[None, Unset, list[str]]: return environment_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) environment_ids = _parse_environment_ids(d.pop("environment_ids", UNSET)) - def _parse_service_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_service_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -609,11 +609,11 @@ def _parse_service_ids(data: object) -> Union[None, Unset, list[str]]: return service_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) service_ids = _parse_service_ids(d.pop("service_ids", UNSET)) - def _parse_owner_group_ids(data: object) -> Union[None, Unset, list[str]]: + def _parse_owner_group_ids(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -626,11 +626,11 @@ def _parse_owner_group_ids(data: object) -> Union[None, Unset, list[str]]: return owner_group_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) owner_group_ids = _parse_owner_group_ids(d.pop("owner_group_ids", UNSET)) - def _parse_owner_user_ids(data: object) -> Union[None, Unset, list[int]]: + def _parse_owner_user_ids(data: object) -> None | Unset | list[int]: if data is None: return data if isinstance(data, Unset): @@ -643,49 +643,49 @@ def _parse_owner_user_ids(data: object) -> Union[None, Unset, list[int]]: return owner_user_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[int]], data) + return cast(None | Unset | list[int], data) owner_user_ids = _parse_owner_user_ids(d.pop("owner_user_ids", UNSET)) - def _parse_alerts_email_enabled(data: object) -> Union[None, Unset, bool]: + def _parse_alerts_email_enabled(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) alerts_email_enabled = _parse_alerts_email_enabled(d.pop("alerts_email_enabled", UNSET)) - def _parse_alert_urgency_id(data: object) -> Union[None, Unset, str]: + def _parse_alert_urgency_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) alert_urgency_id = _parse_alert_urgency_id(d.pop("alert_urgency_id", UNSET)) - def _parse_escalation_policy_id(data: object) -> Union[None, Unset, str]: + def _parse_escalation_policy_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) escalation_policy_id = _parse_escalation_policy_id(d.pop("escalation_policy_id", UNSET)) - def _parse_kubernetes_deployment_name(data: object) -> Union[None, Unset, str]: + def _parse_kubernetes_deployment_name(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) kubernetes_deployment_name = _parse_kubernetes_deployment_name(d.pop("kubernetes_deployment_name", UNSET)) def _parse_slack_channels( data: object, - ) -> Union[None, Unset, list["UpdateServiceDataAttributesSlackChannelsType0Item"]]: + ) -> None | Unset | list["UpdateServiceDataAttributesSlackChannelsType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -705,13 +705,13 @@ def _parse_slack_channels( return slack_channels_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list["UpdateServiceDataAttributesSlackChannelsType0Item"]], data) + return cast(None | Unset | list["UpdateServiceDataAttributesSlackChannelsType0Item"], data) slack_channels = _parse_slack_channels(d.pop("slack_channels", UNSET)) def _parse_slack_aliases( data: object, - ) -> Union[None, Unset, list["UpdateServiceDataAttributesSlackAliasesType0Item"]]: + ) -> None | Unset | list["UpdateServiceDataAttributesSlackAliasesType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -731,16 +731,16 @@ def _parse_slack_aliases( return slack_aliases_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list["UpdateServiceDataAttributesSlackAliasesType0Item"]], data) + return cast(None | Unset | list["UpdateServiceDataAttributesSlackAliasesType0Item"], data) slack_aliases = _parse_slack_aliases(d.pop("slack_aliases", UNSET)) - def _parse_alert_broadcast_enabled(data: object) -> Union[None, Unset, bool]: + def _parse_alert_broadcast_enabled(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) alert_broadcast_enabled = _parse_alert_broadcast_enabled(d.pop("alert_broadcast_enabled", UNSET)) @@ -763,12 +763,12 @@ def _parse_alert_broadcast_channel( alert_broadcast_channel = _parse_alert_broadcast_channel(d.pop("alert_broadcast_channel", UNSET)) - def _parse_incident_broadcast_enabled(data: object) -> Union[None, Unset, bool]: + def _parse_incident_broadcast_enabled(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) incident_broadcast_enabled = _parse_incident_broadcast_enabled(d.pop("incident_broadcast_enabled", UNSET)) diff --git a/rootly_sdk/models/update_service_data_attributes_alert_broadcast_channel_type_0.py b/rootly_sdk/models/update_service_data_attributes_alert_broadcast_channel_type_0.py index f5f466b5..d153a8a6 100644 --- a/rootly_sdk/models/update_service_data_attributes_alert_broadcast_channel_type_0.py +++ b/rootly_sdk/models/update_service_data_attributes_alert_broadcast_channel_type_0.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,7 +19,7 @@ class UpdateServiceDataAttributesAlertBroadcastChannelType0: """ id: str - name: Union[Unset, str] = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_service_data_attributes_incident_broadcast_channel_type_0.py b/rootly_sdk/models/update_service_data_attributes_incident_broadcast_channel_type_0.py index 0e88f29b..8de96ac0 100644 --- a/rootly_sdk/models/update_service_data_attributes_incident_broadcast_channel_type_0.py +++ b/rootly_sdk/models/update_service_data_attributes_incident_broadcast_channel_type_0.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,7 +19,7 @@ class UpdateServiceDataAttributesIncidentBroadcastChannelType0: """ id: str - name: Union[Unset, str] = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_service_now_incident_task_params.py b/rootly_sdk/models/update_service_now_incident_task_params.py index cdc60655..2b6e9bdc 100644 --- a/rootly_sdk/models/update_service_now_incident_task_params.py +++ b/rootly_sdk/models/update_service_now_incident_task_params.py @@ -33,18 +33,18 @@ class UpdateServiceNowIncidentTaskParams: """ incident_id: str - task_type: Union[Unset, UpdateServiceNowIncidentTaskParamsTaskType] = UNSET - title: Union[Unset, str] = UNSET - description: Union[Unset, str] = UNSET + task_type: Unset | UpdateServiceNowIncidentTaskParamsTaskType = UNSET + title: Unset | str = UNSET + description: Unset | str = UNSET priority: Union[Unset, "UpdateServiceNowIncidentTaskParamsPriority"] = UNSET completion: Union[Unset, "UpdateServiceNowIncidentTaskParamsCompletion"] = UNSET - custom_fields_mapping: Union[None, Unset, str] = UNSET + custom_fields_mapping: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: incident_id = self.incident_id - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -52,15 +52,15 @@ def to_dict(self) -> dict[str, Any]: description = self.description - priority: Union[Unset, dict[str, Any]] = UNSET + priority: Unset | dict[str, Any] = UNSET if not isinstance(self.priority, Unset): priority = self.priority.to_dict() - completion: Union[Unset, dict[str, Any]] = UNSET + completion: Unset | dict[str, Any] = UNSET if not isinstance(self.completion, Unset): completion = self.completion.to_dict() - custom_fields_mapping: Union[None, Unset, str] + custom_fields_mapping: None | Unset | str if isinstance(self.custom_fields_mapping, Unset): custom_fields_mapping = UNSET else: @@ -99,7 +99,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: incident_id = d.pop("incident_id") _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, UpdateServiceNowIncidentTaskParamsTaskType] + task_type: Unset | UpdateServiceNowIncidentTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: @@ -110,25 +110,25 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: description = d.pop("description", UNSET) _priority = d.pop("priority", UNSET) - priority: Union[Unset, UpdateServiceNowIncidentTaskParamsPriority] + priority: Unset | UpdateServiceNowIncidentTaskParamsPriority if isinstance(_priority, Unset): priority = UNSET else: priority = UpdateServiceNowIncidentTaskParamsPriority.from_dict(_priority) _completion = d.pop("completion", UNSET) - completion: Union[Unset, UpdateServiceNowIncidentTaskParamsCompletion] + completion: Unset | UpdateServiceNowIncidentTaskParamsCompletion if isinstance(_completion, Unset): completion = UNSET else: completion = UpdateServiceNowIncidentTaskParamsCompletion.from_dict(_completion) - def _parse_custom_fields_mapping(data: object) -> Union[None, Unset, str]: + def _parse_custom_fields_mapping(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) custom_fields_mapping = _parse_custom_fields_mapping(d.pop("custom_fields_mapping", UNSET)) diff --git a/rootly_sdk/models/update_service_now_incident_task_params_completion.py b/rootly_sdk/models/update_service_now_incident_task_params_completion.py index 5c4a45fc..8c295c19 100644 --- a/rootly_sdk/models/update_service_now_incident_task_params_completion.py +++ b/rootly_sdk/models/update_service_now_incident_task_params_completion.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -18,8 +18,8 @@ class UpdateServiceNowIncidentTaskParamsCompletion: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_service_now_incident_task_params_priority.py b/rootly_sdk/models/update_service_now_incident_task_params_priority.py index 05a8ddf4..f71ab86f 100644 --- a/rootly_sdk/models/update_service_now_incident_task_params_priority.py +++ b/rootly_sdk/models/update_service_now_incident_task_params_priority.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -18,8 +18,8 @@ class UpdateServiceNowIncidentTaskParamsPriority: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_severity_data_attributes.py b/rootly_sdk/models/update_severity_data_attributes.py index a5c4b508..4eac8106 100644 --- a/rootly_sdk/models/update_severity_data_attributes.py +++ b/rootly_sdk/models/update_severity_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define @@ -39,18 +39,18 @@ class UpdateSeverityDataAttributes: associated with this severity """ - slug: Union[None, Unset, str] = UNSET - name: Union[Unset, str] = UNSET - description: Union[None, Unset, str] = UNSET - severity: Union[Unset, UpdateSeverityDataAttributesSeverity] = UNSET - color: Union[None, Unset, str] = UNSET - position: Union[None, Unset, int] = UNSET - notify_emails: Union[None, Unset, list[str]] = UNSET - slack_channels: Union[None, Unset, list["UpdateSeverityDataAttributesSlackChannelsType0Item"]] = UNSET - slack_aliases: Union[None, Unset, list["UpdateSeverityDataAttributesSlackAliasesType0Item"]] = UNSET + slug: None | Unset | str = UNSET + name: Unset | str = UNSET + description: None | Unset | str = UNSET + severity: Unset | UpdateSeverityDataAttributesSeverity = UNSET + color: None | Unset | str = UNSET + position: None | Unset | int = UNSET + notify_emails: None | Unset | list[str] = UNSET + slack_channels: None | Unset | list["UpdateSeverityDataAttributesSlackChannelsType0Item"] = UNSET + slack_aliases: None | Unset | list["UpdateSeverityDataAttributesSlackAliasesType0Item"] = UNSET def to_dict(self) -> dict[str, Any]: - slug: Union[None, Unset, str] + slug: None | Unset | str if isinstance(self.slug, Unset): slug = UNSET else: @@ -58,29 +58,29 @@ def to_dict(self) -> dict[str, Any]: name = self.name - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - severity: Union[Unset, str] = UNSET + severity: Unset | str = UNSET if not isinstance(self.severity, Unset): severity = self.severity - color: Union[None, Unset, str] + color: None | Unset | str if isinstance(self.color, Unset): color = UNSET else: color = self.color - position: Union[None, Unset, int] + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: position = self.position - notify_emails: Union[None, Unset, list[str]] + notify_emails: None | Unset | list[str] if isinstance(self.notify_emails, Unset): notify_emails = UNSET elif isinstance(self.notify_emails, list): @@ -89,7 +89,7 @@ def to_dict(self) -> dict[str, Any]: else: notify_emails = self.notify_emails - slack_channels: Union[None, Unset, list[dict[str, Any]]] + slack_channels: None | Unset | list[dict[str, Any]] if isinstance(self.slack_channels, Unset): slack_channels = UNSET elif isinstance(self.slack_channels, list): @@ -101,7 +101,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_channels = self.slack_channels - slack_aliases: Union[None, Unset, list[dict[str, Any]]] + slack_aliases: None | Unset | list[dict[str, Any]] if isinstance(self.slack_aliases, Unset): slack_aliases = UNSET elif isinstance(self.slack_aliases, list): @@ -148,52 +148,52 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_slug(data: object) -> Union[None, Unset, str]: + def _parse_slug(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) slug = _parse_slug(d.pop("slug", UNSET)) name = d.pop("name", UNSET) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) _severity = d.pop("severity", UNSET) - severity: Union[Unset, UpdateSeverityDataAttributesSeverity] + severity: Unset | UpdateSeverityDataAttributesSeverity if isinstance(_severity, Unset): severity = UNSET else: severity = check_update_severity_data_attributes_severity(_severity) - def _parse_color(data: object) -> Union[None, Unset, str]: + def _parse_color(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) color = _parse_color(d.pop("color", UNSET)) - def _parse_position(data: object) -> Union[None, Unset, int]: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) - def _parse_notify_emails(data: object) -> Union[None, Unset, list[str]]: + def _parse_notify_emails(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -206,13 +206,13 @@ def _parse_notify_emails(data: object) -> Union[None, Unset, list[str]]: return notify_emails_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) notify_emails = _parse_notify_emails(d.pop("notify_emails", UNSET)) def _parse_slack_channels( data: object, - ) -> Union[None, Unset, list["UpdateSeverityDataAttributesSlackChannelsType0Item"]]: + ) -> None | Unset | list["UpdateSeverityDataAttributesSlackChannelsType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -232,13 +232,13 @@ def _parse_slack_channels( return slack_channels_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list["UpdateSeverityDataAttributesSlackChannelsType0Item"]], data) + return cast(None | Unset | list["UpdateSeverityDataAttributesSlackChannelsType0Item"], data) slack_channels = _parse_slack_channels(d.pop("slack_channels", UNSET)) def _parse_slack_aliases( data: object, - ) -> Union[None, Unset, list["UpdateSeverityDataAttributesSlackAliasesType0Item"]]: + ) -> None | Unset | list["UpdateSeverityDataAttributesSlackAliasesType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -258,7 +258,7 @@ def _parse_slack_aliases( return slack_aliases_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list["UpdateSeverityDataAttributesSlackAliasesType0Item"]], data) + return cast(None | Unset | list["UpdateSeverityDataAttributesSlackAliasesType0Item"], data) slack_aliases = _parse_slack_aliases(d.pop("slack_aliases", UNSET)) diff --git a/rootly_sdk/models/update_sharepoint_page_task_params.py b/rootly_sdk/models/update_sharepoint_page_task_params.py index 6f3ae806..280b8bbb 100644 --- a/rootly_sdk/models/update_sharepoint_page_task_params.py +++ b/rootly_sdk/models/update_sharepoint_page_task_params.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -25,16 +25,16 @@ class UpdateSharepointPageTaskParams: """ file_id: str - task_type: Union[Unset, UpdateSharepointPageTaskParamsTaskType] = UNSET - title: Union[Unset, str] = UNSET - content: Union[Unset, str] = UNSET - post_mortem_template_id: Union[Unset, str] = UNSET + task_type: Unset | UpdateSharepointPageTaskParamsTaskType = UNSET + title: Unset | str = UNSET + content: Unset | str = UNSET + post_mortem_template_id: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: file_id = self.file_id - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -68,7 +68,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: file_id = d.pop("file_id") _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, UpdateSharepointPageTaskParamsTaskType] + task_type: Unset | UpdateSharepointPageTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/update_shortcut_story_task_params.py b/rootly_sdk/models/update_shortcut_story_task_params.py index d822fa64..96ad23fa 100644 --- a/rootly_sdk/models/update_shortcut_story_task_params.py +++ b/rootly_sdk/models/update_shortcut_story_task_params.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -32,11 +32,11 @@ class UpdateShortcutStoryTaskParams: story_id: str archivation: "UpdateShortcutStoryTaskParamsArchivation" - task_type: Union[Unset, UpdateShortcutStoryTaskParamsTaskType] = UNSET - title: Union[Unset, str] = UNSET - description: Union[Unset, str] = UNSET - labels: Union[Unset, str] = UNSET - due_date: Union[Unset, str] = UNSET + task_type: Unset | UpdateShortcutStoryTaskParamsTaskType = UNSET + title: Unset | str = UNSET + description: Unset | str = UNSET + labels: Unset | str = UNSET + due_date: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -44,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: archivation = self.archivation.to_dict() - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -87,7 +87,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: archivation = UpdateShortcutStoryTaskParamsArchivation.from_dict(d.pop("archivation")) _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, UpdateShortcutStoryTaskParamsTaskType] + task_type: Unset | UpdateShortcutStoryTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/update_shortcut_story_task_params_archivation.py b/rootly_sdk/models/update_shortcut_story_task_params_archivation.py index c8b5d40e..95ac2aae 100644 --- a/rootly_sdk/models/update_shortcut_story_task_params_archivation.py +++ b/rootly_sdk/models/update_shortcut_story_task_params_archivation.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -18,8 +18,8 @@ class UpdateShortcutStoryTaskParamsArchivation: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_shortcut_task_task_params.py b/rootly_sdk/models/update_shortcut_task_task_params.py index eb00d6f2..e1168caf 100644 --- a/rootly_sdk/models/update_shortcut_task_task_params.py +++ b/rootly_sdk/models/update_shortcut_task_task_params.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -31,8 +31,8 @@ class UpdateShortcutTaskTaskParams: task_id: str parent_story_id: str completion: "UpdateShortcutTaskTaskParamsCompletion" - task_type: Union[Unset, UpdateShortcutTaskTaskParamsTaskType] = UNSET - description: Union[Unset, str] = UNSET + task_type: Unset | UpdateShortcutTaskTaskParamsTaskType = UNSET + description: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: completion = self.completion.to_dict() - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -76,7 +76,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: completion = UpdateShortcutTaskTaskParamsCompletion.from_dict(d.pop("completion")) _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, UpdateShortcutTaskTaskParamsTaskType] + task_type: Unset | UpdateShortcutTaskTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/update_shortcut_task_task_params_completion.py b/rootly_sdk/models/update_shortcut_task_task_params_completion.py index c38cfc45..fed6aadd 100644 --- a/rootly_sdk/models/update_shortcut_task_task_params_completion.py +++ b/rootly_sdk/models/update_shortcut_task_task_params_completion.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -18,8 +18,8 @@ class UpdateShortcutTaskTaskParamsCompletion: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_sla_data_attributes.py b/rootly_sdk/models/update_sla_data_attributes.py index 9629d9da..e16d8136 100644 --- a/rootly_sdk/models/update_sla_data_attributes.py +++ b/rootly_sdk/models/update_sla_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from uuid import UUID from attrs import define as _attrs_define @@ -71,26 +71,26 @@ class UpdateSlaDataAttributes: Notification timing configurations. Replaces all existing configurations. """ - slug: Union[None, Unset, str] = UNSET - name: Union[Unset, str] = UNSET - description: Union[None, Unset, str] = UNSET - position: Union[None, Unset, int] = UNSET - condition_match_type: Union[Unset, UpdateSlaDataAttributesConditionMatchType] = UNSET - manager_role_id: Union[None, UUID, Unset] = UNSET - manager_user_id: Union[None, Unset, int] = UNSET - assignment_deadline_days: Union[Unset, UpdateSlaDataAttributesAssignmentDeadlineDays] = UNSET - assignment_deadline_parent_status: Union[Unset, UpdateSlaDataAttributesAssignmentDeadlineParentStatus] = UNSET - assignment_deadline_sub_status_id: Union[None, UUID, Unset] = UNSET - assignment_skip_weekends: Union[Unset, bool] = UNSET - completion_deadline_days: Union[Unset, UpdateSlaDataAttributesCompletionDeadlineDays] = UNSET - completion_deadline_parent_status: Union[Unset, UpdateSlaDataAttributesCompletionDeadlineParentStatus] = UNSET - completion_deadline_sub_status_id: Union[None, UUID, Unset] = UNSET - completion_skip_weekends: Union[Unset, bool] = UNSET - conditions: Union[Unset, list["UpdateSlaDataAttributesConditionsItem"]] = UNSET - notification_configurations: Union[Unset, list["UpdateSlaDataAttributesNotificationConfigurationsItem"]] = UNSET + slug: None | Unset | str = UNSET + name: Unset | str = UNSET + description: None | Unset | str = UNSET + position: None | Unset | int = UNSET + condition_match_type: Unset | UpdateSlaDataAttributesConditionMatchType = UNSET + manager_role_id: None | UUID | Unset = UNSET + manager_user_id: None | Unset | int = UNSET + assignment_deadline_days: Unset | UpdateSlaDataAttributesAssignmentDeadlineDays = UNSET + assignment_deadline_parent_status: Unset | UpdateSlaDataAttributesAssignmentDeadlineParentStatus = UNSET + assignment_deadline_sub_status_id: None | UUID | Unset = UNSET + assignment_skip_weekends: Unset | bool = UNSET + completion_deadline_days: Unset | UpdateSlaDataAttributesCompletionDeadlineDays = UNSET + completion_deadline_parent_status: Unset | UpdateSlaDataAttributesCompletionDeadlineParentStatus = UNSET + completion_deadline_sub_status_id: None | UUID | Unset = UNSET + completion_skip_weekends: Unset | bool = UNSET + conditions: Unset | list["UpdateSlaDataAttributesConditionsItem"] = UNSET + notification_configurations: Unset | list["UpdateSlaDataAttributesNotificationConfigurationsItem"] = UNSET def to_dict(self) -> dict[str, Any]: - slug: Union[None, Unset, str] + slug: None | Unset | str if isinstance(self.slug, Unset): slug = UNSET else: @@ -98,23 +98,23 @@ def to_dict(self) -> dict[str, Any]: name = self.name - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - position: Union[None, Unset, int] + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: position = self.position - condition_match_type: Union[Unset, str] = UNSET + condition_match_type: Unset | str = UNSET if not isinstance(self.condition_match_type, Unset): condition_match_type = self.condition_match_type - manager_role_id: Union[None, Unset, str] + manager_role_id: None | Unset | str if isinstance(self.manager_role_id, Unset): manager_role_id = UNSET elif isinstance(self.manager_role_id, UUID): @@ -122,21 +122,21 @@ def to_dict(self) -> dict[str, Any]: else: manager_role_id = self.manager_role_id - manager_user_id: Union[None, Unset, int] + manager_user_id: None | Unset | int if isinstance(self.manager_user_id, Unset): manager_user_id = UNSET else: manager_user_id = self.manager_user_id - assignment_deadline_days: Union[Unset, int] = UNSET + assignment_deadline_days: Unset | int = UNSET if not isinstance(self.assignment_deadline_days, Unset): assignment_deadline_days = self.assignment_deadline_days - assignment_deadline_parent_status: Union[Unset, str] = UNSET + assignment_deadline_parent_status: Unset | str = UNSET if not isinstance(self.assignment_deadline_parent_status, Unset): assignment_deadline_parent_status = self.assignment_deadline_parent_status - assignment_deadline_sub_status_id: Union[None, Unset, str] + assignment_deadline_sub_status_id: None | Unset | str if isinstance(self.assignment_deadline_sub_status_id, Unset): assignment_deadline_sub_status_id = UNSET elif isinstance(self.assignment_deadline_sub_status_id, UUID): @@ -146,15 +146,15 @@ def to_dict(self) -> dict[str, Any]: assignment_skip_weekends = self.assignment_skip_weekends - completion_deadline_days: Union[Unset, int] = UNSET + completion_deadline_days: Unset | int = UNSET if not isinstance(self.completion_deadline_days, Unset): completion_deadline_days = self.completion_deadline_days - completion_deadline_parent_status: Union[Unset, str] = UNSET + completion_deadline_parent_status: Unset | str = UNSET if not isinstance(self.completion_deadline_parent_status, Unset): completion_deadline_parent_status = self.completion_deadline_parent_status - completion_deadline_sub_status_id: Union[None, Unset, str] + completion_deadline_sub_status_id: None | Unset | str if isinstance(self.completion_deadline_sub_status_id, Unset): completion_deadline_sub_status_id = UNSET elif isinstance(self.completion_deadline_sub_status_id, UUID): @@ -164,14 +164,14 @@ def to_dict(self) -> dict[str, Any]: completion_skip_weekends = self.completion_skip_weekends - conditions: Union[Unset, list[dict[str, Any]]] = UNSET + conditions: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.conditions, Unset): conditions = [] for conditions_item_data in self.conditions: conditions_item = conditions_item_data.to_dict() conditions.append(conditions_item) - notification_configurations: Union[Unset, list[dict[str, Any]]] = UNSET + notification_configurations: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.notification_configurations, Unset): notification_configurations = [] for notification_configurations_item_data in self.notification_configurations: @@ -227,43 +227,43 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_slug(data: object) -> Union[None, Unset, str]: + def _parse_slug(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) slug = _parse_slug(d.pop("slug", UNSET)) name = d.pop("name", UNSET) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_position(data: object) -> Union[None, Unset, int]: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) _condition_match_type = d.pop("condition_match_type", UNSET) - condition_match_type: Union[Unset, UpdateSlaDataAttributesConditionMatchType] + condition_match_type: Unset | UpdateSlaDataAttributesConditionMatchType if isinstance(_condition_match_type, Unset): condition_match_type = UNSET else: condition_match_type = check_update_sla_data_attributes_condition_match_type(_condition_match_type) - def _parse_manager_role_id(data: object) -> Union[None, UUID, Unset]: + def _parse_manager_role_id(data: object) -> None | UUID | Unset: if data is None: return data if isinstance(data, Unset): @@ -276,21 +276,21 @@ def _parse_manager_role_id(data: object) -> Union[None, UUID, Unset]: return manager_role_id_type_0 except: # noqa: E722 pass - return cast(Union[None, UUID, Unset], data) + return cast(None | UUID | Unset, data) manager_role_id = _parse_manager_role_id(d.pop("manager_role_id", UNSET)) - def _parse_manager_user_id(data: object) -> Union[None, Unset, int]: + def _parse_manager_user_id(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) manager_user_id = _parse_manager_user_id(d.pop("manager_user_id", UNSET)) _assignment_deadline_days = d.pop("assignment_deadline_days", UNSET) - assignment_deadline_days: Union[Unset, UpdateSlaDataAttributesAssignmentDeadlineDays] + assignment_deadline_days: Unset | UpdateSlaDataAttributesAssignmentDeadlineDays if isinstance(_assignment_deadline_days, Unset): assignment_deadline_days = UNSET else: @@ -299,7 +299,7 @@ def _parse_manager_user_id(data: object) -> Union[None, Unset, int]: ) _assignment_deadline_parent_status = d.pop("assignment_deadline_parent_status", UNSET) - assignment_deadline_parent_status: Union[Unset, UpdateSlaDataAttributesAssignmentDeadlineParentStatus] + assignment_deadline_parent_status: Unset | UpdateSlaDataAttributesAssignmentDeadlineParentStatus if isinstance(_assignment_deadline_parent_status, Unset): assignment_deadline_parent_status = UNSET else: @@ -307,7 +307,7 @@ def _parse_manager_user_id(data: object) -> Union[None, Unset, int]: _assignment_deadline_parent_status ) - def _parse_assignment_deadline_sub_status_id(data: object) -> Union[None, UUID, Unset]: + def _parse_assignment_deadline_sub_status_id(data: object) -> None | UUID | Unset: if data is None: return data if isinstance(data, Unset): @@ -320,7 +320,7 @@ def _parse_assignment_deadline_sub_status_id(data: object) -> Union[None, UUID, return assignment_deadline_sub_status_id_type_0 except: # noqa: E722 pass - return cast(Union[None, UUID, Unset], data) + return cast(None | UUID | Unset, data) assignment_deadline_sub_status_id = _parse_assignment_deadline_sub_status_id( d.pop("assignment_deadline_sub_status_id", UNSET) @@ -329,7 +329,7 @@ def _parse_assignment_deadline_sub_status_id(data: object) -> Union[None, UUID, assignment_skip_weekends = d.pop("assignment_skip_weekends", UNSET) _completion_deadline_days = d.pop("completion_deadline_days", UNSET) - completion_deadline_days: Union[Unset, UpdateSlaDataAttributesCompletionDeadlineDays] + completion_deadline_days: Unset | UpdateSlaDataAttributesCompletionDeadlineDays if isinstance(_completion_deadline_days, Unset): completion_deadline_days = UNSET else: @@ -338,7 +338,7 @@ def _parse_assignment_deadline_sub_status_id(data: object) -> Union[None, UUID, ) _completion_deadline_parent_status = d.pop("completion_deadline_parent_status", UNSET) - completion_deadline_parent_status: Union[Unset, UpdateSlaDataAttributesCompletionDeadlineParentStatus] + completion_deadline_parent_status: Unset | UpdateSlaDataAttributesCompletionDeadlineParentStatus if isinstance(_completion_deadline_parent_status, Unset): completion_deadline_parent_status = UNSET else: @@ -346,7 +346,7 @@ def _parse_assignment_deadline_sub_status_id(data: object) -> Union[None, UUID, _completion_deadline_parent_status ) - def _parse_completion_deadline_sub_status_id(data: object) -> Union[None, UUID, Unset]: + def _parse_completion_deadline_sub_status_id(data: object) -> None | UUID | Unset: if data is None: return data if isinstance(data, Unset): @@ -359,7 +359,7 @@ def _parse_completion_deadline_sub_status_id(data: object) -> Union[None, UUID, return completion_deadline_sub_status_id_type_0 except: # noqa: E722 pass - return cast(Union[None, UUID, Unset], data) + return cast(None | UUID | Unset, data) completion_deadline_sub_status_id = _parse_completion_deadline_sub_status_id( d.pop("completion_deadline_sub_status_id", UNSET) diff --git a/rootly_sdk/models/update_sla_data_attributes_conditions_item.py b/rootly_sdk/models/update_sla_data_attributes_conditions_item.py index e7decffd..82f24748 100644 --- a/rootly_sdk/models/update_sla_data_attributes_conditions_item.py +++ b/rootly_sdk/models/update_sla_data_attributes_conditions_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from uuid import UUID from attrs import define as _attrs_define @@ -35,10 +35,10 @@ class UpdateSlaDataAttributesConditionsItem: conditionable_type: UpdateSlaDataAttributesConditionsItemConditionableType operator: str - property_: Union[Unset, UpdateSlaDataAttributesConditionsItemProperty] = UNSET - values: Union[None, Unset, list[str]] = UNSET - form_field_id: Union[None, UUID, Unset] = UNSET - position: Union[Unset, int] = UNSET + property_: Unset | UpdateSlaDataAttributesConditionsItemProperty = UNSET + values: None | Unset | list[str] = UNSET + form_field_id: None | UUID | Unset = UNSET + position: Unset | int = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -46,11 +46,11 @@ def to_dict(self) -> dict[str, Any]: operator = self.operator - property_: Union[Unset, str] = UNSET + property_: Unset | str = UNSET if not isinstance(self.property_, Unset): property_ = self.property_ - values: Union[None, Unset, list[str]] + values: None | Unset | list[str] if isinstance(self.values, Unset): values = UNSET elif isinstance(self.values, list): @@ -59,7 +59,7 @@ def to_dict(self) -> dict[str, Any]: else: values = self.values - form_field_id: Union[None, Unset, str] + form_field_id: None | Unset | str if isinstance(self.form_field_id, Unset): form_field_id = UNSET elif isinstance(self.form_field_id, UUID): @@ -98,13 +98,13 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: operator = d.pop("operator") _property_ = d.pop("property", UNSET) - property_: Union[Unset, UpdateSlaDataAttributesConditionsItemProperty] + property_: Unset | UpdateSlaDataAttributesConditionsItemProperty if isinstance(_property_, Unset): property_ = UNSET else: property_ = check_update_sla_data_attributes_conditions_item_property(_property_) - def _parse_values(data: object) -> Union[None, Unset, list[str]]: + def _parse_values(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -117,11 +117,11 @@ def _parse_values(data: object) -> Union[None, Unset, list[str]]: return values_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) values = _parse_values(d.pop("values", UNSET)) - def _parse_form_field_id(data: object) -> Union[None, UUID, Unset]: + def _parse_form_field_id(data: object) -> None | UUID | Unset: if data is None: return data if isinstance(data, Unset): @@ -134,7 +134,7 @@ def _parse_form_field_id(data: object) -> Union[None, UUID, Unset]: return form_field_id_type_0 except: # noqa: E722 pass - return cast(Union[None, UUID, Unset], data) + return cast(None | UUID | Unset, data) form_field_id = _parse_form_field_id(d.pop("form_field_id", UNSET)) diff --git a/rootly_sdk/models/update_slack_channel_topic_task_params.py b/rootly_sdk/models/update_slack_channel_topic_task_params.py index 8a1b913b..50023adc 100644 --- a/rootly_sdk/models/update_slack_channel_topic_task_params.py +++ b/rootly_sdk/models/update_slack_channel_topic_task_params.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -28,7 +28,7 @@ class UpdateSlackChannelTopicTaskParams: channel: "UpdateSlackChannelTopicTaskParamsChannel" topic: str - task_type: Union[Unset, UpdateSlackChannelTopicTaskParamsTaskType] = UNSET + task_type: Unset | UpdateSlackChannelTopicTaskParamsTaskType = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -36,7 +36,7 @@ def to_dict(self) -> dict[str, Any]: topic = self.topic - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -63,7 +63,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: topic = d.pop("topic") _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, UpdateSlackChannelTopicTaskParamsTaskType] + task_type: Unset | UpdateSlackChannelTopicTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/update_slack_channel_topic_task_params_channel.py b/rootly_sdk/models/update_slack_channel_topic_task_params_channel.py index 26ab56c7..fc44769d 100644 --- a/rootly_sdk/models/update_slack_channel_topic_task_params_channel.py +++ b/rootly_sdk/models/update_slack_channel_topic_task_params_channel.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class UpdateSlackChannelTopicTaskParamsChannel: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_status_page_announcement_data_attributes.py b/rootly_sdk/models/update_status_page_announcement_data_attributes.py index b6d4f22a..3e6c7fbe 100644 --- a/rootly_sdk/models/update_status_page_announcement_data_attributes.py +++ b/rootly_sdk/models/update_status_page_announcement_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define @@ -16,8 +16,8 @@ class UpdateStatusPageAnnouncementDataAttributes: body (Union[Unset, str]): Body of the announcement """ - title: Union[Unset, str] = UNSET - body: Union[Unset, str] = UNSET + title: Unset | str = UNSET + body: Unset | str = UNSET def to_dict(self) -> dict[str, Any]: title = self.title diff --git a/rootly_sdk/models/update_status_page_component_data_attributes.py b/rootly_sdk/models/update_status_page_component_data_attributes.py index b7ddafbd..ede7577d 100644 --- a/rootly_sdk/models/update_status_page_component_data_attributes.py +++ b/rootly_sdk/models/update_status_page_component_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -20,25 +20,25 @@ class UpdateStatusPageComponentDataAttributes: ungrouped) """ - name: Union[None, Unset, str] = UNSET - description: Union[None, Unset, str] = UNSET - status_page_component_group_id: Union[None, Unset, str] = UNSET - position: Union[Unset, int] = UNSET + name: None | Unset | str = UNSET + description: None | Unset | str = UNSET + status_page_component_group_id: None | Unset | str = UNSET + position: Unset | int = UNSET def to_dict(self) -> dict[str, Any]: - name: Union[None, Unset, str] + name: None | Unset | str if isinstance(self.name, Unset): name = UNSET else: name = self.name - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - status_page_component_group_id: Union[None, Unset, str] + status_page_component_group_id: None | Unset | str if isinstance(self.status_page_component_group_id, Unset): status_page_component_group_id = UNSET else: @@ -64,30 +64,30 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_name(data: object) -> Union[None, Unset, str]: + def _parse_name(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) name = _parse_name(d.pop("name", UNSET)) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_status_page_component_group_id(data: object) -> Union[None, Unset, str]: + def _parse_status_page_component_group_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) status_page_component_group_id = _parse_status_page_component_group_id( d.pop("status_page_component_group_id", UNSET) diff --git a/rootly_sdk/models/update_status_page_component_group_data_attributes.py b/rootly_sdk/models/update_status_page_component_group_data_attributes.py index b587bfb5..addfcaed 100644 --- a/rootly_sdk/models/update_status_page_component_group_data_attributes.py +++ b/rootly_sdk/models/update_status_page_component_group_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -19,15 +19,15 @@ class UpdateStatusPageComponentGroupDataAttributes: collapsed_by_default (Union[None, Unset, bool]): Whether the group renders collapsed on the public page """ - name: Union[Unset, str] = UNSET - description: Union[None, Unset, str] = UNSET - position: Union[Unset, int] = UNSET - collapsed_by_default: Union[None, Unset, bool] = UNSET + name: Unset | str = UNSET + description: None | Unset | str = UNSET + position: Unset | int = UNSET + collapsed_by_default: None | Unset | bool = UNSET def to_dict(self) -> dict[str, Any]: name = self.name - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: @@ -35,7 +35,7 @@ def to_dict(self) -> dict[str, Any]: position = self.position - collapsed_by_default: Union[None, Unset, bool] + collapsed_by_default: None | Unset | bool if isinstance(self.collapsed_by_default, Unset): collapsed_by_default = UNSET else: @@ -60,23 +60,23 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name", UNSET) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) position = d.pop("position", UNSET) - def _parse_collapsed_by_default(data: object) -> Union[None, Unset, bool]: + def _parse_collapsed_by_default(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) collapsed_by_default = _parse_collapsed_by_default(d.pop("collapsed_by_default", UNSET)) diff --git a/rootly_sdk/models/update_status_page_data_attributes.py b/rootly_sdk/models/update_status_page_data_attributes.py index 479659b1..49be7823 100644 --- a/rootly_sdk/models/update_status_page_data_attributes.py +++ b/rootly_sdk/models/update_status_page_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -66,39 +66,39 @@ class UpdateStatusPageDataAttributes: enabled (Union[None, Unset, bool]): Enabled / Disable the status page """ - slug: Union[None, Unset, str] = UNSET - title: Union[Unset, str] = UNSET - public_title: Union[None, Unset, str] = UNSET - description: Union[None, Unset, str] = UNSET - public_description: Union[None, Unset, str] = UNSET - header_color: Union[None, Unset, str] = UNSET - footer_color: Union[None, Unset, str] = UNSET - allow_search_engine_index: Union[None, Unset, bool] = UNSET - show_uptime: Union[None, Unset, bool] = UNSET - show_uptime_last_days: Union[Unset, UpdateStatusPageDataAttributesShowUptimeLastDays] = UNSET - success_message: Union[None, Unset, str] = UNSET - failure_message: Union[None, Unset, str] = UNSET - authentication_method: Union[Unset, UpdateStatusPageDataAttributesAuthenticationMethod] = "none" - authentication_enabled: Union[None, Unset, bool] = False - authentication_password: Union[None, Unset, str] = UNSET - saml_idp_sso_service_url: Union[None, Unset, str] = UNSET - saml_idp_slo_service_url: Union[None, Unset, str] = UNSET - saml_idp_cert: Union[None, Unset, str] = UNSET - saml_name_identifier_format: Union[Unset, UpdateStatusPageDataAttributesSamlNameIdentifierFormat] = UNSET - section_order: Union[None, Unset, list[UpdateStatusPageDataAttributesSectionOrderType0Item]] = UNSET - external_domain_names: Union[None, Unset, list[str]] = UNSET - website_url: Union[None, Unset, str] = UNSET - website_privacy_url: Union[None, Unset, str] = UNSET - website_support_url: Union[None, Unset, str] = UNSET - ga_tracking_id: Union[None, Unset, str] = UNSET - time_zone: Union[None, Unset, str] = "Etc/UTC" - public: Union[None, Unset, bool] = UNSET - service_ids: Union[Unset, list[str]] = UNSET - functionality_ids: Union[Unset, list[str]] = UNSET - enabled: Union[None, Unset, bool] = UNSET + slug: None | Unset | str = UNSET + title: Unset | str = UNSET + public_title: None | Unset | str = UNSET + description: None | Unset | str = UNSET + public_description: None | Unset | str = UNSET + header_color: None | Unset | str = UNSET + footer_color: None | Unset | str = UNSET + allow_search_engine_index: None | Unset | bool = UNSET + show_uptime: None | Unset | bool = UNSET + show_uptime_last_days: Unset | UpdateStatusPageDataAttributesShowUptimeLastDays = UNSET + success_message: None | Unset | str = UNSET + failure_message: None | Unset | str = UNSET + authentication_method: Unset | UpdateStatusPageDataAttributesAuthenticationMethod = "none" + authentication_enabled: None | Unset | bool = False + authentication_password: None | Unset | str = UNSET + saml_idp_sso_service_url: None | Unset | str = UNSET + saml_idp_slo_service_url: None | Unset | str = UNSET + saml_idp_cert: None | Unset | str = UNSET + saml_name_identifier_format: Unset | UpdateStatusPageDataAttributesSamlNameIdentifierFormat = UNSET + section_order: None | Unset | list[UpdateStatusPageDataAttributesSectionOrderType0Item] = UNSET + external_domain_names: None | Unset | list[str] = UNSET + website_url: None | Unset | str = UNSET + website_privacy_url: None | Unset | str = UNSET + website_support_url: None | Unset | str = UNSET + ga_tracking_id: None | Unset | str = UNSET + time_zone: None | Unset | str = "Etc/UTC" + public: None | Unset | bool = UNSET + service_ids: Unset | list[str] = UNSET + functionality_ids: Unset | list[str] = UNSET + enabled: None | Unset | bool = UNSET def to_dict(self) -> dict[str, Any]: - slug: Union[None, Unset, str] + slug: None | Unset | str if isinstance(self.slug, Unset): slug = UNSET else: @@ -106,103 +106,103 @@ def to_dict(self) -> dict[str, Any]: title = self.title - public_title: Union[None, Unset, str] + public_title: None | Unset | str if isinstance(self.public_title, Unset): public_title = UNSET else: public_title = self.public_title - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - public_description: Union[None, Unset, str] + public_description: None | Unset | str if isinstance(self.public_description, Unset): public_description = UNSET else: public_description = self.public_description - header_color: Union[None, Unset, str] + header_color: None | Unset | str if isinstance(self.header_color, Unset): header_color = UNSET else: header_color = self.header_color - footer_color: Union[None, Unset, str] + footer_color: None | Unset | str if isinstance(self.footer_color, Unset): footer_color = UNSET else: footer_color = self.footer_color - allow_search_engine_index: Union[None, Unset, bool] + allow_search_engine_index: None | Unset | bool if isinstance(self.allow_search_engine_index, Unset): allow_search_engine_index = UNSET else: allow_search_engine_index = self.allow_search_engine_index - show_uptime: Union[None, Unset, bool] + show_uptime: None | Unset | bool if isinstance(self.show_uptime, Unset): show_uptime = UNSET else: show_uptime = self.show_uptime - show_uptime_last_days: Union[Unset, int] = UNSET + show_uptime_last_days: Unset | int = UNSET if not isinstance(self.show_uptime_last_days, Unset): show_uptime_last_days = self.show_uptime_last_days - success_message: Union[None, Unset, str] + success_message: None | Unset | str if isinstance(self.success_message, Unset): success_message = UNSET else: success_message = self.success_message - failure_message: Union[None, Unset, str] + failure_message: None | Unset | str if isinstance(self.failure_message, Unset): failure_message = UNSET else: failure_message = self.failure_message - authentication_method: Union[Unset, str] = UNSET + authentication_method: Unset | str = UNSET if not isinstance(self.authentication_method, Unset): authentication_method = self.authentication_method - authentication_enabled: Union[None, Unset, bool] + authentication_enabled: None | Unset | bool if isinstance(self.authentication_enabled, Unset): authentication_enabled = UNSET else: authentication_enabled = self.authentication_enabled - authentication_password: Union[None, Unset, str] + authentication_password: None | Unset | str if isinstance(self.authentication_password, Unset): authentication_password = UNSET else: authentication_password = self.authentication_password - saml_idp_sso_service_url: Union[None, Unset, str] + saml_idp_sso_service_url: None | Unset | str if isinstance(self.saml_idp_sso_service_url, Unset): saml_idp_sso_service_url = UNSET else: saml_idp_sso_service_url = self.saml_idp_sso_service_url - saml_idp_slo_service_url: Union[None, Unset, str] + saml_idp_slo_service_url: None | Unset | str if isinstance(self.saml_idp_slo_service_url, Unset): saml_idp_slo_service_url = UNSET else: saml_idp_slo_service_url = self.saml_idp_slo_service_url - saml_idp_cert: Union[None, Unset, str] + saml_idp_cert: None | Unset | str if isinstance(self.saml_idp_cert, Unset): saml_idp_cert = UNSET else: saml_idp_cert = self.saml_idp_cert - saml_name_identifier_format: Union[Unset, str] = UNSET + saml_name_identifier_format: Unset | str = UNSET if not isinstance(self.saml_name_identifier_format, Unset): saml_name_identifier_format = self.saml_name_identifier_format - section_order: Union[None, Unset, list[str]] + section_order: None | Unset | list[str] if isinstance(self.section_order, Unset): section_order = UNSET elif isinstance(self.section_order, list): @@ -214,7 +214,7 @@ def to_dict(self) -> dict[str, Any]: else: section_order = self.section_order - external_domain_names: Union[None, Unset, list[str]] + external_domain_names: None | Unset | list[str] if isinstance(self.external_domain_names, Unset): external_domain_names = UNSET elif isinstance(self.external_domain_names, list): @@ -223,51 +223,51 @@ def to_dict(self) -> dict[str, Any]: else: external_domain_names = self.external_domain_names - website_url: Union[None, Unset, str] + website_url: None | Unset | str if isinstance(self.website_url, Unset): website_url = UNSET else: website_url = self.website_url - website_privacy_url: Union[None, Unset, str] + website_privacy_url: None | Unset | str if isinstance(self.website_privacy_url, Unset): website_privacy_url = UNSET else: website_privacy_url = self.website_privacy_url - website_support_url: Union[None, Unset, str] + website_support_url: None | Unset | str if isinstance(self.website_support_url, Unset): website_support_url = UNSET else: website_support_url = self.website_support_url - ga_tracking_id: Union[None, Unset, str] + ga_tracking_id: None | Unset | str if isinstance(self.ga_tracking_id, Unset): ga_tracking_id = UNSET else: ga_tracking_id = self.ga_tracking_id - time_zone: Union[None, Unset, str] + time_zone: None | Unset | str if isinstance(self.time_zone, Unset): time_zone = UNSET else: time_zone = self.time_zone - public: Union[None, Unset, bool] + public: None | Unset | bool if isinstance(self.public, Unset): public = UNSET else: public = self.public - service_ids: Union[Unset, list[str]] = UNSET + service_ids: Unset | list[str] = UNSET if not isinstance(self.service_ids, Unset): service_ids = self.service_ids - functionality_ids: Union[Unset, list[str]] = UNSET + functionality_ids: Unset | list[str] = UNSET if not isinstance(self.functionality_ids, Unset): functionality_ids = self.functionality_ids - enabled: Union[None, Unset, bool] + enabled: None | Unset | bool if isinstance(self.enabled, Unset): enabled = UNSET else: @@ -343,82 +343,82 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_slug(data: object) -> Union[None, Unset, str]: + def _parse_slug(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) slug = _parse_slug(d.pop("slug", UNSET)) title = d.pop("title", UNSET) - def _parse_public_title(data: object) -> Union[None, Unset, str]: + def _parse_public_title(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) public_title = _parse_public_title(d.pop("public_title", UNSET)) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_public_description(data: object) -> Union[None, Unset, str]: + def _parse_public_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) public_description = _parse_public_description(d.pop("public_description", UNSET)) - def _parse_header_color(data: object) -> Union[None, Unset, str]: + def _parse_header_color(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) header_color = _parse_header_color(d.pop("header_color", UNSET)) - def _parse_footer_color(data: object) -> Union[None, Unset, str]: + def _parse_footer_color(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) footer_color = _parse_footer_color(d.pop("footer_color", UNSET)) - def _parse_allow_search_engine_index(data: object) -> Union[None, Unset, bool]: + def _parse_allow_search_engine_index(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) allow_search_engine_index = _parse_allow_search_engine_index(d.pop("allow_search_engine_index", UNSET)) - def _parse_show_uptime(data: object) -> Union[None, Unset, bool]: + def _parse_show_uptime(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) show_uptime = _parse_show_uptime(d.pop("show_uptime", UNSET)) _show_uptime_last_days = d.pop("show_uptime_last_days", UNSET) - show_uptime_last_days: Union[Unset, UpdateStatusPageDataAttributesShowUptimeLastDays] + show_uptime_last_days: Unset | UpdateStatusPageDataAttributesShowUptimeLastDays if isinstance(_show_uptime_last_days, Unset): show_uptime_last_days = UNSET else: @@ -426,26 +426,26 @@ def _parse_show_uptime(data: object) -> Union[None, Unset, bool]: _show_uptime_last_days ) - def _parse_success_message(data: object) -> Union[None, Unset, str]: + def _parse_success_message(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) success_message = _parse_success_message(d.pop("success_message", UNSET)) - def _parse_failure_message(data: object) -> Union[None, Unset, str]: + def _parse_failure_message(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) failure_message = _parse_failure_message(d.pop("failure_message", UNSET)) _authentication_method = d.pop("authentication_method", UNSET) - authentication_method: Union[Unset, UpdateStatusPageDataAttributesAuthenticationMethod] + authentication_method: Unset | UpdateStatusPageDataAttributesAuthenticationMethod if isinstance(_authentication_method, Unset): authentication_method = UNSET else: @@ -453,53 +453,53 @@ def _parse_failure_message(data: object) -> Union[None, Unset, str]: _authentication_method ) - def _parse_authentication_enabled(data: object) -> Union[None, Unset, bool]: + def _parse_authentication_enabled(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) authentication_enabled = _parse_authentication_enabled(d.pop("authentication_enabled", UNSET)) - def _parse_authentication_password(data: object) -> Union[None, Unset, str]: + def _parse_authentication_password(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) authentication_password = _parse_authentication_password(d.pop("authentication_password", UNSET)) - def _parse_saml_idp_sso_service_url(data: object) -> Union[None, Unset, str]: + def _parse_saml_idp_sso_service_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) saml_idp_sso_service_url = _parse_saml_idp_sso_service_url(d.pop("saml_idp_sso_service_url", UNSET)) - def _parse_saml_idp_slo_service_url(data: object) -> Union[None, Unset, str]: + def _parse_saml_idp_slo_service_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) saml_idp_slo_service_url = _parse_saml_idp_slo_service_url(d.pop("saml_idp_slo_service_url", UNSET)) - def _parse_saml_idp_cert(data: object) -> Union[None, Unset, str]: + def _parse_saml_idp_cert(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) saml_idp_cert = _parse_saml_idp_cert(d.pop("saml_idp_cert", UNSET)) _saml_name_identifier_format = d.pop("saml_name_identifier_format", UNSET) - saml_name_identifier_format: Union[Unset, UpdateStatusPageDataAttributesSamlNameIdentifierFormat] + saml_name_identifier_format: Unset | UpdateStatusPageDataAttributesSamlNameIdentifierFormat if isinstance(_saml_name_identifier_format, Unset): saml_name_identifier_format = UNSET else: @@ -509,7 +509,7 @@ def _parse_saml_idp_cert(data: object) -> Union[None, Unset, str]: def _parse_section_order( data: object, - ) -> Union[None, Unset, list[UpdateStatusPageDataAttributesSectionOrderType0Item]]: + ) -> None | Unset | list[UpdateStatusPageDataAttributesSectionOrderType0Item]: if data is None: return data if isinstance(data, Unset): @@ -529,11 +529,11 @@ def _parse_section_order( return section_order_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[UpdateStatusPageDataAttributesSectionOrderType0Item]], data) + return cast(None | Unset | list[UpdateStatusPageDataAttributesSectionOrderType0Item], data) section_order = _parse_section_order(d.pop("section_order", UNSET)) - def _parse_external_domain_names(data: object) -> Union[None, Unset, list[str]]: + def _parse_external_domain_names(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -546,61 +546,61 @@ def _parse_external_domain_names(data: object) -> Union[None, Unset, list[str]]: return external_domain_names_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) external_domain_names = _parse_external_domain_names(d.pop("external_domain_names", UNSET)) - def _parse_website_url(data: object) -> Union[None, Unset, str]: + def _parse_website_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) website_url = _parse_website_url(d.pop("website_url", UNSET)) - def _parse_website_privacy_url(data: object) -> Union[None, Unset, str]: + def _parse_website_privacy_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) website_privacy_url = _parse_website_privacy_url(d.pop("website_privacy_url", UNSET)) - def _parse_website_support_url(data: object) -> Union[None, Unset, str]: + def _parse_website_support_url(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) website_support_url = _parse_website_support_url(d.pop("website_support_url", UNSET)) - def _parse_ga_tracking_id(data: object) -> Union[None, Unset, str]: + def _parse_ga_tracking_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) ga_tracking_id = _parse_ga_tracking_id(d.pop("ga_tracking_id", UNSET)) - def _parse_time_zone(data: object) -> Union[None, Unset, str]: + def _parse_time_zone(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) time_zone = _parse_time_zone(d.pop("time_zone", UNSET)) - def _parse_public(data: object) -> Union[None, Unset, bool]: + def _parse_public(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) public = _parse_public(d.pop("public", UNSET)) @@ -608,12 +608,12 @@ def _parse_public(data: object) -> Union[None, Unset, bool]: functionality_ids = cast(list[str], d.pop("functionality_ids", UNSET)) - def _parse_enabled(data: object) -> Union[None, Unset, bool]: + def _parse_enabled(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) enabled = _parse_enabled(d.pop("enabled", UNSET)) diff --git a/rootly_sdk/models/update_status_page_template_data_attributes.py b/rootly_sdk/models/update_status_page_template_data_attributes.py index 3ae0f197..a05b3365 100644 --- a/rootly_sdk/models/update_status_page_template_data_attributes.py +++ b/rootly_sdk/models/update_status_page_template_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -33,33 +33,33 @@ class UpdateStatusPageTemplateDataAttributes: title: str body: str - update_title: Union[None, Unset, str] = UNSET - update_status: Union[Unset, UpdateStatusPageTemplateDataAttributesUpdateStatus] = UNSET - kind: Union[Unset, UpdateStatusPageTemplateDataAttributesKind] = UNSET - should_notify_subscribers: Union[None, Unset, bool] = UNSET - position: Union[Unset, int] = UNSET - enabled: Union[None, Unset, bool] = UNSET + update_title: None | Unset | str = UNSET + update_status: Unset | UpdateStatusPageTemplateDataAttributesUpdateStatus = UNSET + kind: Unset | UpdateStatusPageTemplateDataAttributesKind = UNSET + should_notify_subscribers: None | Unset | bool = UNSET + position: Unset | int = UNSET + enabled: None | Unset | bool = UNSET def to_dict(self) -> dict[str, Any]: title = self.title body = self.body - update_title: Union[None, Unset, str] + update_title: None | Unset | str if isinstance(self.update_title, Unset): update_title = UNSET else: update_title = self.update_title - update_status: Union[Unset, str] = UNSET + update_status: Unset | str = UNSET if not isinstance(self.update_status, Unset): update_status = self.update_status - kind: Union[Unset, str] = UNSET + kind: Unset | str = UNSET if not isinstance(self.kind, Unset): kind = self.kind - should_notify_subscribers: Union[None, Unset, bool] + should_notify_subscribers: None | Unset | bool if isinstance(self.should_notify_subscribers, Unset): should_notify_subscribers = UNSET else: @@ -67,7 +67,7 @@ def to_dict(self) -> dict[str, Any]: position = self.position - enabled: Union[None, Unset, bool] + enabled: None | Unset | bool if isinstance(self.enabled, Unset): enabled = UNSET else: @@ -103,46 +103,46 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: body = d.pop("body") - def _parse_update_title(data: object) -> Union[None, Unset, str]: + def _parse_update_title(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) update_title = _parse_update_title(d.pop("update_title", UNSET)) _update_status = d.pop("update_status", UNSET) - update_status: Union[Unset, UpdateStatusPageTemplateDataAttributesUpdateStatus] + update_status: Unset | UpdateStatusPageTemplateDataAttributesUpdateStatus if isinstance(_update_status, Unset): update_status = UNSET else: update_status = check_update_status_page_template_data_attributes_update_status(_update_status) _kind = d.pop("kind", UNSET) - kind: Union[Unset, UpdateStatusPageTemplateDataAttributesKind] + kind: Unset | UpdateStatusPageTemplateDataAttributesKind if isinstance(_kind, Unset): kind = UNSET else: kind = check_update_status_page_template_data_attributes_kind(_kind) - def _parse_should_notify_subscribers(data: object) -> Union[None, Unset, bool]: + def _parse_should_notify_subscribers(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) should_notify_subscribers = _parse_should_notify_subscribers(d.pop("should_notify_subscribers", UNSET)) position = d.pop("position", UNSET) - def _parse_enabled(data: object) -> Union[None, Unset, bool]: + def _parse_enabled(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) enabled = _parse_enabled(d.pop("enabled", UNSET)) diff --git a/rootly_sdk/models/update_status_task_params.py b/rootly_sdk/models/update_status_task_params.py index a3474000..24deaf51 100644 --- a/rootly_sdk/models/update_status_task_params.py +++ b/rootly_sdk/models/update_status_task_params.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -27,14 +27,14 @@ class UpdateStatusTaskParams: """ status: UpdateStatusTaskParamsStatus - task_type: Union[Unset, UpdateStatusTaskParamsTaskType] = UNSET - inactivity_timeout: Union[Unset, str] = UNSET + task_type: Unset | UpdateStatusTaskParamsTaskType = UNSET + inactivity_timeout: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: status: str = self.status - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -60,7 +60,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: status = check_update_status_task_params_status(d.pop("status")) _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, UpdateStatusTaskParamsTaskType] + task_type: Unset | UpdateStatusTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/update_sub_status_data_attributes.py b/rootly_sdk/models/update_sub_status_data_attributes.py index d5c7eee3..ff3812d8 100644 --- a/rootly_sdk/models/update_sub_status_data_attributes.py +++ b/rootly_sdk/models/update_sub_status_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -19,13 +19,13 @@ class UpdateSubStatusDataAttributes: position (Union[None, Unset, int]): """ - slug: Union[None, Unset, str] = UNSET - name: Union[Unset, str] = UNSET - description: Union[None, Unset, str] = UNSET - position: Union[None, Unset, int] = UNSET + slug: None | Unset | str = UNSET + name: Unset | str = UNSET + description: None | Unset | str = UNSET + position: None | Unset | int = UNSET def to_dict(self) -> dict[str, Any]: - slug: Union[None, Unset, str] + slug: None | Unset | str if isinstance(self.slug, Unset): slug = UNSET else: @@ -33,13 +33,13 @@ def to_dict(self) -> dict[str, Any]: name = self.name - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - position: Union[None, Unset, int] + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: @@ -63,32 +63,32 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_slug(data: object) -> Union[None, Unset, str]: + def _parse_slug(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) slug = _parse_slug(d.pop("slug", UNSET)) name = d.pop("name", UNSET) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_position(data: object) -> Union[None, Unset, int]: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) diff --git a/rootly_sdk/models/update_team_data_attributes.py b/rootly_sdk/models/update_team_data_attributes.py index 46b62b11..b3563194 100644 --- a/rootly_sdk/models/update_team_data_attributes.py +++ b/rootly_sdk/models/update_team_data_attributes.py @@ -74,35 +74,35 @@ class UpdateTeamDataAttributes: team. """ - slug: Union[None, Unset, str] = UNSET - name: Union[Unset, str] = UNSET - description: Union[None, Unset, str] = UNSET - public_description: Union[None, Unset, str] = UNSET - notify_emails: Union[None, Unset, list[str]] = UNSET - color: Union[None, Unset, str] = UNSET - position: Union[None, Unset, int] = UNSET - backstage_id: Union[None, Unset, str] = UNSET - external_id: Union[None, Unset, str] = UNSET - pagerduty_id: Union[None, Unset, str] = UNSET - pagerduty_service_id: Union[None, Unset, str] = UNSET - opsgenie_id: Union[None, Unset, str] = UNSET - victor_ops_id: Union[None, Unset, str] = UNSET - pagertree_id: Union[None, Unset, str] = UNSET - cortex_id: Union[None, Unset, str] = UNSET - service_now_ci_sys_id: Union[None, Unset, str] = UNSET - user_ids: Union[None, Unset, list[int]] = UNSET - admin_ids: Union[None, Unset, list[int]] = UNSET - alerts_email_enabled: Union[None, Unset, bool] = UNSET - alert_urgency_id: Union[None, Unset, str] = UNSET - slack_channels: Union[None, Unset, list["UpdateTeamDataAttributesSlackChannelsType0Item"]] = UNSET - slack_aliases: Union[None, Unset, list["UpdateTeamDataAttributesSlackAliasesType0Item"]] = UNSET - alert_broadcast_enabled: Union[None, Unset, bool] = UNSET + slug: None | Unset | str = UNSET + name: Unset | str = UNSET + description: None | Unset | str = UNSET + public_description: None | Unset | str = UNSET + notify_emails: None | Unset | list[str] = UNSET + color: None | Unset | str = UNSET + position: None | Unset | int = UNSET + backstage_id: None | Unset | str = UNSET + external_id: None | Unset | str = UNSET + pagerduty_id: None | Unset | str = UNSET + pagerduty_service_id: None | Unset | str = UNSET + opsgenie_id: None | Unset | str = UNSET + victor_ops_id: None | Unset | str = UNSET + pagertree_id: None | Unset | str = UNSET + cortex_id: None | Unset | str = UNSET + service_now_ci_sys_id: None | Unset | str = UNSET + user_ids: None | Unset | list[int] = UNSET + admin_ids: None | Unset | list[int] = UNSET + alerts_email_enabled: None | Unset | bool = UNSET + alert_urgency_id: None | Unset | str = UNSET + slack_channels: None | Unset | list["UpdateTeamDataAttributesSlackChannelsType0Item"] = UNSET + slack_aliases: None | Unset | list["UpdateTeamDataAttributesSlackAliasesType0Item"] = UNSET + alert_broadcast_enabled: None | Unset | bool = UNSET alert_broadcast_channel: Union["UpdateTeamDataAttributesAlertBroadcastChannelType0", None, Unset] = UNSET - incident_broadcast_enabled: Union[None, Unset, bool] = UNSET + incident_broadcast_enabled: None | Unset | bool = UNSET incident_broadcast_channel: Union["UpdateTeamDataAttributesIncidentBroadcastChannelType0", None, Unset] = UNSET - auto_add_members_when_attached: Union[None, Unset, bool] = UNSET - auto_add_members_scope: Union[Unset, UpdateTeamDataAttributesAutoAddMembersScope] = UNSET - properties: Union[Unset, list["UpdateTeamDataAttributesPropertiesItem"]] = UNSET + auto_add_members_when_attached: None | Unset | bool = UNSET + auto_add_members_scope: Unset | UpdateTeamDataAttributesAutoAddMembersScope = UNSET + properties: Unset | list["UpdateTeamDataAttributesPropertiesItem"] = UNSET def to_dict(self) -> dict[str, Any]: from ..models.update_team_data_attributes_alert_broadcast_channel_type_0 import ( @@ -112,7 +112,7 @@ def to_dict(self) -> dict[str, Any]: UpdateTeamDataAttributesIncidentBroadcastChannelType0, ) - slug: Union[None, Unset, str] + slug: None | Unset | str if isinstance(self.slug, Unset): slug = UNSET else: @@ -120,19 +120,19 @@ def to_dict(self) -> dict[str, Any]: name = self.name - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - public_description: Union[None, Unset, str] + public_description: None | Unset | str if isinstance(self.public_description, Unset): public_description = UNSET else: public_description = self.public_description - notify_emails: Union[None, Unset, list[str]] + notify_emails: None | Unset | list[str] if isinstance(self.notify_emails, Unset): notify_emails = UNSET elif isinstance(self.notify_emails, list): @@ -141,73 +141,73 @@ def to_dict(self) -> dict[str, Any]: else: notify_emails = self.notify_emails - color: Union[None, Unset, str] + color: None | Unset | str if isinstance(self.color, Unset): color = UNSET else: color = self.color - position: Union[None, Unset, int] + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: position = self.position - backstage_id: Union[None, Unset, str] + backstage_id: None | Unset | str if isinstance(self.backstage_id, Unset): backstage_id = UNSET else: backstage_id = self.backstage_id - external_id: Union[None, Unset, str] + external_id: None | Unset | str if isinstance(self.external_id, Unset): external_id = UNSET else: external_id = self.external_id - pagerduty_id: Union[None, Unset, str] + pagerduty_id: None | Unset | str if isinstance(self.pagerduty_id, Unset): pagerduty_id = UNSET else: pagerduty_id = self.pagerduty_id - pagerduty_service_id: Union[None, Unset, str] + pagerduty_service_id: None | Unset | str if isinstance(self.pagerduty_service_id, Unset): pagerduty_service_id = UNSET else: pagerduty_service_id = self.pagerduty_service_id - opsgenie_id: Union[None, Unset, str] + opsgenie_id: None | Unset | str if isinstance(self.opsgenie_id, Unset): opsgenie_id = UNSET else: opsgenie_id = self.opsgenie_id - victor_ops_id: Union[None, Unset, str] + victor_ops_id: None | Unset | str if isinstance(self.victor_ops_id, Unset): victor_ops_id = UNSET else: victor_ops_id = self.victor_ops_id - pagertree_id: Union[None, Unset, str] + pagertree_id: None | Unset | str if isinstance(self.pagertree_id, Unset): pagertree_id = UNSET else: pagertree_id = self.pagertree_id - cortex_id: Union[None, Unset, str] + cortex_id: None | Unset | str if isinstance(self.cortex_id, Unset): cortex_id = UNSET else: cortex_id = self.cortex_id - service_now_ci_sys_id: Union[None, Unset, str] + service_now_ci_sys_id: None | Unset | str if isinstance(self.service_now_ci_sys_id, Unset): service_now_ci_sys_id = UNSET else: service_now_ci_sys_id = self.service_now_ci_sys_id - user_ids: Union[None, Unset, list[int]] + user_ids: None | Unset | list[int] if isinstance(self.user_ids, Unset): user_ids = UNSET elif isinstance(self.user_ids, list): @@ -216,7 +216,7 @@ def to_dict(self) -> dict[str, Any]: else: user_ids = self.user_ids - admin_ids: Union[None, Unset, list[int]] + admin_ids: None | Unset | list[int] if isinstance(self.admin_ids, Unset): admin_ids = UNSET elif isinstance(self.admin_ids, list): @@ -225,19 +225,19 @@ def to_dict(self) -> dict[str, Any]: else: admin_ids = self.admin_ids - alerts_email_enabled: Union[None, Unset, bool] + alerts_email_enabled: None | Unset | bool if isinstance(self.alerts_email_enabled, Unset): alerts_email_enabled = UNSET else: alerts_email_enabled = self.alerts_email_enabled - alert_urgency_id: Union[None, Unset, str] + alert_urgency_id: None | Unset | str if isinstance(self.alert_urgency_id, Unset): alert_urgency_id = UNSET else: alert_urgency_id = self.alert_urgency_id - slack_channels: Union[None, Unset, list[dict[str, Any]]] + slack_channels: None | Unset | list[dict[str, Any]] if isinstance(self.slack_channels, Unset): slack_channels = UNSET elif isinstance(self.slack_channels, list): @@ -249,7 +249,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_channels = self.slack_channels - slack_aliases: Union[None, Unset, list[dict[str, Any]]] + slack_aliases: None | Unset | list[dict[str, Any]] if isinstance(self.slack_aliases, Unset): slack_aliases = UNSET elif isinstance(self.slack_aliases, list): @@ -261,13 +261,13 @@ def to_dict(self) -> dict[str, Any]: else: slack_aliases = self.slack_aliases - alert_broadcast_enabled: Union[None, Unset, bool] + alert_broadcast_enabled: None | Unset | bool if isinstance(self.alert_broadcast_enabled, Unset): alert_broadcast_enabled = UNSET else: alert_broadcast_enabled = self.alert_broadcast_enabled - alert_broadcast_channel: Union[None, Unset, dict[str, Any]] + alert_broadcast_channel: None | Unset | dict[str, Any] if isinstance(self.alert_broadcast_channel, Unset): alert_broadcast_channel = UNSET elif isinstance(self.alert_broadcast_channel, UpdateTeamDataAttributesAlertBroadcastChannelType0): @@ -275,13 +275,13 @@ def to_dict(self) -> dict[str, Any]: else: alert_broadcast_channel = self.alert_broadcast_channel - incident_broadcast_enabled: Union[None, Unset, bool] + incident_broadcast_enabled: None | Unset | bool if isinstance(self.incident_broadcast_enabled, Unset): incident_broadcast_enabled = UNSET else: incident_broadcast_enabled = self.incident_broadcast_enabled - incident_broadcast_channel: Union[None, Unset, dict[str, Any]] + incident_broadcast_channel: None | Unset | dict[str, Any] if isinstance(self.incident_broadcast_channel, Unset): incident_broadcast_channel = UNSET elif isinstance(self.incident_broadcast_channel, UpdateTeamDataAttributesIncidentBroadcastChannelType0): @@ -289,17 +289,17 @@ def to_dict(self) -> dict[str, Any]: else: incident_broadcast_channel = self.incident_broadcast_channel - auto_add_members_when_attached: Union[None, Unset, bool] + auto_add_members_when_attached: None | Unset | bool if isinstance(self.auto_add_members_when_attached, Unset): auto_add_members_when_attached = UNSET else: auto_add_members_when_attached = self.auto_add_members_when_attached - auto_add_members_scope: Union[Unset, str] = UNSET + auto_add_members_scope: Unset | str = UNSET if not isinstance(self.auto_add_members_scope, Unset): auto_add_members_scope = self.auto_add_members_scope - properties: Union[Unset, list[dict[str, Any]]] = UNSET + properties: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.properties, Unset): properties = [] for properties_item_data in self.properties: @@ -388,36 +388,36 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_slug(data: object) -> Union[None, Unset, str]: + def _parse_slug(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) slug = _parse_slug(d.pop("slug", UNSET)) name = d.pop("name", UNSET) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_public_description(data: object) -> Union[None, Unset, str]: + def _parse_public_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) public_description = _parse_public_description(d.pop("public_description", UNSET)) - def _parse_notify_emails(data: object) -> Union[None, Unset, list[str]]: + def _parse_notify_emails(data: object) -> None | Unset | list[str]: if data is None: return data if isinstance(data, Unset): @@ -430,110 +430,110 @@ def _parse_notify_emails(data: object) -> Union[None, Unset, list[str]]: return notify_emails_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[str]], data) + return cast(None | Unset | list[str], data) notify_emails = _parse_notify_emails(d.pop("notify_emails", UNSET)) - def _parse_color(data: object) -> Union[None, Unset, str]: + def _parse_color(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) color = _parse_color(d.pop("color", UNSET)) - def _parse_position(data: object) -> Union[None, Unset, int]: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) - def _parse_backstage_id(data: object) -> Union[None, Unset, str]: + def _parse_backstage_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) backstage_id = _parse_backstage_id(d.pop("backstage_id", UNSET)) - def _parse_external_id(data: object) -> Union[None, Unset, str]: + def _parse_external_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) external_id = _parse_external_id(d.pop("external_id", UNSET)) - def _parse_pagerduty_id(data: object) -> Union[None, Unset, str]: + def _parse_pagerduty_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) pagerduty_id = _parse_pagerduty_id(d.pop("pagerduty_id", UNSET)) - def _parse_pagerduty_service_id(data: object) -> Union[None, Unset, str]: + def _parse_pagerduty_service_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) pagerduty_service_id = _parse_pagerduty_service_id(d.pop("pagerduty_service_id", UNSET)) - def _parse_opsgenie_id(data: object) -> Union[None, Unset, str]: + def _parse_opsgenie_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) opsgenie_id = _parse_opsgenie_id(d.pop("opsgenie_id", UNSET)) - def _parse_victor_ops_id(data: object) -> Union[None, Unset, str]: + def _parse_victor_ops_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) victor_ops_id = _parse_victor_ops_id(d.pop("victor_ops_id", UNSET)) - def _parse_pagertree_id(data: object) -> Union[None, Unset, str]: + def _parse_pagertree_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) pagertree_id = _parse_pagertree_id(d.pop("pagertree_id", UNSET)) - def _parse_cortex_id(data: object) -> Union[None, Unset, str]: + def _parse_cortex_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) cortex_id = _parse_cortex_id(d.pop("cortex_id", UNSET)) - def _parse_service_now_ci_sys_id(data: object) -> Union[None, Unset, str]: + def _parse_service_now_ci_sys_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) service_now_ci_sys_id = _parse_service_now_ci_sys_id(d.pop("service_now_ci_sys_id", UNSET)) - def _parse_user_ids(data: object) -> Union[None, Unset, list[int]]: + def _parse_user_ids(data: object) -> None | Unset | list[int]: if data is None: return data if isinstance(data, Unset): @@ -546,11 +546,11 @@ def _parse_user_ids(data: object) -> Union[None, Unset, list[int]]: return user_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[int]], data) + return cast(None | Unset | list[int], data) user_ids = _parse_user_ids(d.pop("user_ids", UNSET)) - def _parse_admin_ids(data: object) -> Union[None, Unset, list[int]]: + def _parse_admin_ids(data: object) -> None | Unset | list[int]: if data is None: return data if isinstance(data, Unset): @@ -563,31 +563,31 @@ def _parse_admin_ids(data: object) -> Union[None, Unset, list[int]]: return admin_ids_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[int]], data) + return cast(None | Unset | list[int], data) admin_ids = _parse_admin_ids(d.pop("admin_ids", UNSET)) - def _parse_alerts_email_enabled(data: object) -> Union[None, Unset, bool]: + def _parse_alerts_email_enabled(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) alerts_email_enabled = _parse_alerts_email_enabled(d.pop("alerts_email_enabled", UNSET)) - def _parse_alert_urgency_id(data: object) -> Union[None, Unset, str]: + def _parse_alert_urgency_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) alert_urgency_id = _parse_alert_urgency_id(d.pop("alert_urgency_id", UNSET)) def _parse_slack_channels( data: object, - ) -> Union[None, Unset, list["UpdateTeamDataAttributesSlackChannelsType0Item"]]: + ) -> None | Unset | list["UpdateTeamDataAttributesSlackChannelsType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -607,13 +607,13 @@ def _parse_slack_channels( return slack_channels_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list["UpdateTeamDataAttributesSlackChannelsType0Item"]], data) + return cast(None | Unset | list["UpdateTeamDataAttributesSlackChannelsType0Item"], data) slack_channels = _parse_slack_channels(d.pop("slack_channels", UNSET)) def _parse_slack_aliases( data: object, - ) -> Union[None, Unset, list["UpdateTeamDataAttributesSlackAliasesType0Item"]]: + ) -> None | Unset | list["UpdateTeamDataAttributesSlackAliasesType0Item"]: if data is None: return data if isinstance(data, Unset): @@ -633,16 +633,16 @@ def _parse_slack_aliases( return slack_aliases_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list["UpdateTeamDataAttributesSlackAliasesType0Item"]], data) + return cast(None | Unset | list["UpdateTeamDataAttributesSlackAliasesType0Item"], data) slack_aliases = _parse_slack_aliases(d.pop("slack_aliases", UNSET)) - def _parse_alert_broadcast_enabled(data: object) -> Union[None, Unset, bool]: + def _parse_alert_broadcast_enabled(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) alert_broadcast_enabled = _parse_alert_broadcast_enabled(d.pop("alert_broadcast_enabled", UNSET)) @@ -665,12 +665,12 @@ def _parse_alert_broadcast_channel( alert_broadcast_channel = _parse_alert_broadcast_channel(d.pop("alert_broadcast_channel", UNSET)) - def _parse_incident_broadcast_enabled(data: object) -> Union[None, Unset, bool]: + def _parse_incident_broadcast_enabled(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) incident_broadcast_enabled = _parse_incident_broadcast_enabled(d.pop("incident_broadcast_enabled", UNSET)) @@ -695,19 +695,19 @@ def _parse_incident_broadcast_channel( incident_broadcast_channel = _parse_incident_broadcast_channel(d.pop("incident_broadcast_channel", UNSET)) - def _parse_auto_add_members_when_attached(data: object) -> Union[None, Unset, bool]: + def _parse_auto_add_members_when_attached(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) auto_add_members_when_attached = _parse_auto_add_members_when_attached( d.pop("auto_add_members_when_attached", UNSET) ) _auto_add_members_scope = d.pop("auto_add_members_scope", UNSET) - auto_add_members_scope: Union[Unset, UpdateTeamDataAttributesAutoAddMembersScope] + auto_add_members_scope: Unset | UpdateTeamDataAttributesAutoAddMembersScope if isinstance(_auto_add_members_scope, Unset): auto_add_members_scope = UNSET else: diff --git a/rootly_sdk/models/update_team_data_attributes_alert_broadcast_channel_type_0.py b/rootly_sdk/models/update_team_data_attributes_alert_broadcast_channel_type_0.py index 129bb572..bb588d8e 100644 --- a/rootly_sdk/models/update_team_data_attributes_alert_broadcast_channel_type_0.py +++ b/rootly_sdk/models/update_team_data_attributes_alert_broadcast_channel_type_0.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,7 +19,7 @@ class UpdateTeamDataAttributesAlertBroadcastChannelType0: """ id: str - name: Union[Unset, str] = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_team_data_attributes_incident_broadcast_channel_type_0.py b/rootly_sdk/models/update_team_data_attributes_incident_broadcast_channel_type_0.py index 32c1a0f4..88354504 100644 --- a/rootly_sdk/models/update_team_data_attributes_incident_broadcast_channel_type_0.py +++ b/rootly_sdk/models/update_team_data_attributes_incident_broadcast_channel_type_0.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,7 +19,7 @@ class UpdateTeamDataAttributesIncidentBroadcastChannelType0: """ id: str - name: Union[Unset, str] = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_trello_card_task_params.py b/rootly_sdk/models/update_trello_card_task_params.py index 9effa774..36e4ee8b 100644 --- a/rootly_sdk/models/update_trello_card_task_params.py +++ b/rootly_sdk/models/update_trello_card_task_params.py @@ -37,13 +37,13 @@ class UpdateTrelloCardTaskParams: card_id: str archivation: "UpdateTrelloCardTaskParamsArchivation" - task_type: Union[Unset, UpdateTrelloCardTaskParamsTaskType] = UNSET - title: Union[Unset, str] = UNSET - description: Union[Unset, str] = UNSET - due_date: Union[Unset, str] = UNSET + task_type: Unset | UpdateTrelloCardTaskParamsTaskType = UNSET + title: Unset | str = UNSET + description: Unset | str = UNSET + due_date: Unset | str = UNSET board: Union[Unset, "UpdateTrelloCardTaskParamsBoard"] = UNSET list_: Union[Unset, "UpdateTrelloCardTaskParamsList"] = UNSET - labels: Union[Unset, list["UpdateTrelloCardTaskParamsLabelsItem"]] = UNSET + labels: Unset | list["UpdateTrelloCardTaskParamsLabelsItem"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -51,7 +51,7 @@ def to_dict(self) -> dict[str, Any]: archivation = self.archivation.to_dict() - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -61,15 +61,15 @@ def to_dict(self) -> dict[str, Any]: due_date = self.due_date - board: Union[Unset, dict[str, Any]] = UNSET + board: Unset | dict[str, Any] = UNSET if not isinstance(self.board, Unset): board = self.board.to_dict() - list_: Union[Unset, dict[str, Any]] = UNSET + list_: Unset | dict[str, Any] = UNSET if not isinstance(self.list_, Unset): list_ = self.list_.to_dict() - labels: Union[Unset, list[dict[str, Any]]] = UNSET + labels: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.labels, Unset): labels = [] for labels_item_data in self.labels: @@ -114,7 +114,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: archivation = UpdateTrelloCardTaskParamsArchivation.from_dict(d.pop("archivation")) _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, UpdateTrelloCardTaskParamsTaskType] + task_type: Unset | UpdateTrelloCardTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: @@ -127,14 +127,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: due_date = d.pop("due_date", UNSET) _board = d.pop("board", UNSET) - board: Union[Unset, UpdateTrelloCardTaskParamsBoard] + board: Unset | UpdateTrelloCardTaskParamsBoard if isinstance(_board, Unset): board = UNSET else: board = UpdateTrelloCardTaskParamsBoard.from_dict(_board) _list_ = d.pop("list", UNSET) - list_: Union[Unset, UpdateTrelloCardTaskParamsList] + list_: Unset | UpdateTrelloCardTaskParamsList if isinstance(_list_, Unset): list_ = UNSET else: diff --git a/rootly_sdk/models/update_trello_card_task_params_archivation.py b/rootly_sdk/models/update_trello_card_task_params_archivation.py index 5a575507..6196d586 100644 --- a/rootly_sdk/models/update_trello_card_task_params_archivation.py +++ b/rootly_sdk/models/update_trello_card_task_params_archivation.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -18,8 +18,8 @@ class UpdateTrelloCardTaskParamsArchivation: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_trello_card_task_params_board.py b/rootly_sdk/models/update_trello_card_task_params_board.py index 169d1d14..71073b9f 100644 --- a/rootly_sdk/models/update_trello_card_task_params_board.py +++ b/rootly_sdk/models/update_trello_card_task_params_board.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -18,8 +18,8 @@ class UpdateTrelloCardTaskParamsBoard: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_trello_card_task_params_labels_item.py b/rootly_sdk/models/update_trello_card_task_params_labels_item.py index 823f1b25..ab0604a8 100644 --- a/rootly_sdk/models/update_trello_card_task_params_labels_item.py +++ b/rootly_sdk/models/update_trello_card_task_params_labels_item.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,8 +17,8 @@ class UpdateTrelloCardTaskParamsLabelsItem: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_trello_card_task_params_list.py b/rootly_sdk/models/update_trello_card_task_params_list.py index e8a7f44b..1fd02aee 100644 --- a/rootly_sdk/models/update_trello_card_task_params_list.py +++ b/rootly_sdk/models/update_trello_card_task_params_list.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -18,8 +18,8 @@ class UpdateTrelloCardTaskParamsList: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_user_data_attributes.py b/rootly_sdk/models/update_user_data_attributes.py index be2b7a50..acf3a634 100644 --- a/rootly_sdk/models/update_user_data_attributes.py +++ b/rootly_sdk/models/update_user_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -18,31 +18,31 @@ class UpdateUserDataAttributes: on_call_role_id (Union[None, Unset, str]): ID of the on-call role to assign """ - first_name: Union[None, Unset, str] = UNSET - last_name: Union[None, Unset, str] = UNSET - role_id: Union[None, Unset, str] = UNSET - on_call_role_id: Union[None, Unset, str] = UNSET + first_name: None | Unset | str = UNSET + last_name: None | Unset | str = UNSET + role_id: None | Unset | str = UNSET + on_call_role_id: None | Unset | str = UNSET def to_dict(self) -> dict[str, Any]: - first_name: Union[None, Unset, str] + first_name: None | Unset | str if isinstance(self.first_name, Unset): first_name = UNSET else: first_name = self.first_name - last_name: Union[None, Unset, str] + last_name: None | Unset | str if isinstance(self.last_name, Unset): last_name = UNSET else: last_name = self.last_name - role_id: Union[None, Unset, str] + role_id: None | Unset | str if isinstance(self.role_id, Unset): role_id = UNSET else: role_id = self.role_id - on_call_role_id: Union[None, Unset, str] + on_call_role_id: None | Unset | str if isinstance(self.on_call_role_id, Unset): on_call_role_id = UNSET else: @@ -66,39 +66,39 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_first_name(data: object) -> Union[None, Unset, str]: + def _parse_first_name(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) first_name = _parse_first_name(d.pop("first_name", UNSET)) - def _parse_last_name(data: object) -> Union[None, Unset, str]: + def _parse_last_name(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) last_name = _parse_last_name(d.pop("last_name", UNSET)) - def _parse_role_id(data: object) -> Union[None, Unset, str]: + def _parse_role_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) role_id = _parse_role_id(d.pop("role_id", UNSET)) - def _parse_on_call_role_id(data: object) -> Union[None, Unset, str]: + def _parse_on_call_role_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) on_call_role_id = _parse_on_call_role_id(d.pop("on_call_role_id", UNSET)) diff --git a/rootly_sdk/models/update_user_email_address_data_attributes.py b/rootly_sdk/models/update_user_email_address_data_attributes.py index 0ee8f1dd..021d4325 100644 --- a/rootly_sdk/models/update_user_email_address_data_attributes.py +++ b/rootly_sdk/models/update_user_email_address_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define @@ -15,7 +15,7 @@ class UpdateUserEmailAddressDataAttributes: email (Union[Unset, str]): Email address """ - email: Union[Unset, str] = UNSET + email: Unset | str = UNSET def to_dict(self) -> dict[str, Any]: email = self.email diff --git a/rootly_sdk/models/update_user_notification_rule_data_attributes.py b/rootly_sdk/models/update_user_notification_rule_data_attributes.py index c508d7e0..145fe36f 100644 --- a/rootly_sdk/models/update_user_notification_rule_data_attributes.py +++ b/rootly_sdk/models/update_user_notification_rule_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -26,52 +26,52 @@ class UpdateUserNotificationRuleDataAttributes: Contact types for which notification needs to be enabled """ - delay: Union[None, Unset, int] = UNSET - position: Union[None, Unset, int] = UNSET - user_email_address_id: Union[None, Unset, str] = UNSET - user_call_number_id: Union[None, Unset, str] = UNSET - user_sms_number_id: Union[None, Unset, str] = UNSET - user_device_id: Union[None, Unset, str] = UNSET - enabled_contact_types: Union[Unset, list[UpdateUserNotificationRuleDataAttributesEnabledContactTypesItem]] = UNSET + delay: None | Unset | int = UNSET + position: None | Unset | int = UNSET + user_email_address_id: None | Unset | str = UNSET + user_call_number_id: None | Unset | str = UNSET + user_sms_number_id: None | Unset | str = UNSET + user_device_id: None | Unset | str = UNSET + enabled_contact_types: Unset | list[UpdateUserNotificationRuleDataAttributesEnabledContactTypesItem] = UNSET def to_dict(self) -> dict[str, Any]: - delay: Union[None, Unset, int] + delay: None | Unset | int if isinstance(self.delay, Unset): delay = UNSET else: delay = self.delay - position: Union[None, Unset, int] + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: position = self.position - user_email_address_id: Union[None, Unset, str] + user_email_address_id: None | Unset | str if isinstance(self.user_email_address_id, Unset): user_email_address_id = UNSET else: user_email_address_id = self.user_email_address_id - user_call_number_id: Union[None, Unset, str] + user_call_number_id: None | Unset | str if isinstance(self.user_call_number_id, Unset): user_call_number_id = UNSET else: user_call_number_id = self.user_call_number_id - user_sms_number_id: Union[None, Unset, str] + user_sms_number_id: None | Unset | str if isinstance(self.user_sms_number_id, Unset): user_sms_number_id = UNSET else: user_sms_number_id = self.user_sms_number_id - user_device_id: Union[None, Unset, str] + user_device_id: None | Unset | str if isinstance(self.user_device_id, Unset): user_device_id = UNSET else: user_device_id = self.user_device_id - enabled_contact_types: Union[Unset, list[str]] = UNSET + enabled_contact_types: Unset | list[str] = UNSET if not isinstance(self.enabled_contact_types, Unset): enabled_contact_types = [] for enabled_contact_types_item_data in self.enabled_contact_types: @@ -102,57 +102,57 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_delay(data: object) -> Union[None, Unset, int]: + def _parse_delay(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) delay = _parse_delay(d.pop("delay", UNSET)) - def _parse_position(data: object) -> Union[None, Unset, int]: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) - def _parse_user_email_address_id(data: object) -> Union[None, Unset, str]: + def _parse_user_email_address_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) user_email_address_id = _parse_user_email_address_id(d.pop("user_email_address_id", UNSET)) - def _parse_user_call_number_id(data: object) -> Union[None, Unset, str]: + def _parse_user_call_number_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) user_call_number_id = _parse_user_call_number_id(d.pop("user_call_number_id", UNSET)) - def _parse_user_sms_number_id(data: object) -> Union[None, Unset, str]: + def _parse_user_sms_number_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) user_sms_number_id = _parse_user_sms_number_id(d.pop("user_sms_number_id", UNSET)) - def _parse_user_device_id(data: object) -> Union[None, Unset, str]: + def _parse_user_device_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) user_device_id = _parse_user_device_id(d.pop("user_device_id", UNSET)) diff --git a/rootly_sdk/models/update_user_phone_number_data_attributes.py b/rootly_sdk/models/update_user_phone_number_data_attributes.py index 425d0c24..bb449a53 100644 --- a/rootly_sdk/models/update_user_phone_number_data_attributes.py +++ b/rootly_sdk/models/update_user_phone_number_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define @@ -15,7 +15,7 @@ class UpdateUserPhoneNumberDataAttributes: phone (Union[Unset, str]): Phone number in international format """ - phone: Union[Unset, str] = UNSET + phone: Unset | str = UNSET def to_dict(self) -> dict[str, Any]: phone = self.phone diff --git a/rootly_sdk/models/update_victor_ops_incident_task_params.py b/rootly_sdk/models/update_victor_ops_incident_task_params.py index 6608833b..990a3a5b 100644 --- a/rootly_sdk/models/update_victor_ops_incident_task_params.py +++ b/rootly_sdk/models/update_victor_ops_incident_task_params.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -30,8 +30,8 @@ class UpdateVictorOpsIncidentTaskParams: victor_ops_incident_id: str status: UpdateVictorOpsIncidentTaskParamsStatus - task_type: Union[Unset, UpdateVictorOpsIncidentTaskParamsTaskType] = UNSET - resolution_message: Union[Unset, str] = UNSET + task_type: Unset | UpdateVictorOpsIncidentTaskParamsTaskType = UNSET + resolution_message: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -39,7 +39,7 @@ def to_dict(self) -> dict[str, Any]: status: str = self.status - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -68,7 +68,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: status = check_update_victor_ops_incident_task_params_status(d.pop("status")) _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, UpdateVictorOpsIncidentTaskParamsTaskType] + task_type: Unset | UpdateVictorOpsIncidentTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/update_webhooks_endpoint_data_attributes.py b/rootly_sdk/models/update_webhooks_endpoint_data_attributes.py index 3d0c9d6c..99f06e24 100644 --- a/rootly_sdk/models/update_webhooks_endpoint_data_attributes.py +++ b/rootly_sdk/models/update_webhooks_endpoint_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define @@ -32,14 +32,14 @@ class UpdateWebhooksEndpointDataAttributes: rejected. """ - slug: Union[None, Unset, str] = UNSET - name: Union[Unset, str] = UNSET - event_types: Union[Unset, list[UpdateWebhooksEndpointDataAttributesEventTypesItem]] = UNSET - enabled: Union[Unset, bool] = UNSET - custom_headers: Union[Unset, list["UpdateWebhooksEndpointDataAttributesCustomHeadersItem"]] = UNSET + slug: None | Unset | str = UNSET + name: Unset | str = UNSET + event_types: Unset | list[UpdateWebhooksEndpointDataAttributesEventTypesItem] = UNSET + enabled: Unset | bool = UNSET + custom_headers: Unset | list["UpdateWebhooksEndpointDataAttributesCustomHeadersItem"] = UNSET def to_dict(self) -> dict[str, Any]: - slug: Union[None, Unset, str] + slug: None | Unset | str if isinstance(self.slug, Unset): slug = UNSET else: @@ -47,7 +47,7 @@ def to_dict(self) -> dict[str, Any]: name = self.name - event_types: Union[Unset, list[str]] = UNSET + event_types: Unset | list[str] = UNSET if not isinstance(self.event_types, Unset): event_types = [] for event_types_item_data in self.event_types: @@ -56,7 +56,7 @@ def to_dict(self) -> dict[str, Any]: enabled = self.enabled - custom_headers: Union[Unset, list[dict[str, Any]]] = UNSET + custom_headers: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.custom_headers, Unset): custom_headers = [] for custom_headers_item_data in self.custom_headers: @@ -87,12 +87,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_slug(data: object) -> Union[None, Unset, str]: + def _parse_slug(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) slug = _parse_slug(d.pop("slug", UNSET)) diff --git a/rootly_sdk/models/update_workflow_action_item_form_field_condition_data_attributes.py b/rootly_sdk/models/update_workflow_action_item_form_field_condition_data_attributes.py index 042401cd..a13ba23d 100644 --- a/rootly_sdk/models/update_workflow_action_item_form_field_condition_data_attributes.py +++ b/rootly_sdk/models/update_workflow_action_item_form_field_condition_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -31,62 +31,60 @@ class UpdateWorkflowActionItemFormFieldConditionDataAttributes: selected_incident_type_ids (Union[Unset, list[str]]): """ - action_item_condition: Union[Unset, UpdateWorkflowActionItemFormFieldConditionDataAttributesActionItemCondition] = ( - "ANY" - ) - values: Union[Unset, list[str]] = UNSET - selected_catalog_entity_ids: Union[Unset, list[str]] = UNSET - selected_functionality_ids: Union[Unset, list[str]] = UNSET - selected_group_ids: Union[Unset, list[str]] = UNSET - selected_option_ids: Union[Unset, list[str]] = UNSET - selected_service_ids: Union[Unset, list[str]] = UNSET - selected_user_ids: Union[Unset, list[int]] = UNSET - selected_cause_ids: Union[Unset, list[str]] = UNSET - selected_environment_ids: Union[Unset, list[str]] = UNSET - selected_incident_type_ids: Union[Unset, list[str]] = UNSET + action_item_condition: Unset | UpdateWorkflowActionItemFormFieldConditionDataAttributesActionItemCondition = "ANY" + values: Unset | list[str] = UNSET + selected_catalog_entity_ids: Unset | list[str] = UNSET + selected_functionality_ids: Unset | list[str] = UNSET + selected_group_ids: Unset | list[str] = UNSET + selected_option_ids: Unset | list[str] = UNSET + selected_service_ids: Unset | list[str] = UNSET + selected_user_ids: Unset | list[int] = UNSET + selected_cause_ids: Unset | list[str] = UNSET + selected_environment_ids: Unset | list[str] = UNSET + selected_incident_type_ids: Unset | list[str] = UNSET def to_dict(self) -> dict[str, Any]: - action_item_condition: Union[Unset, str] = UNSET + action_item_condition: Unset | str = UNSET if not isinstance(self.action_item_condition, Unset): action_item_condition = self.action_item_condition - values: Union[Unset, list[str]] = UNSET + values: Unset | list[str] = UNSET if not isinstance(self.values, Unset): values = self.values - selected_catalog_entity_ids: Union[Unset, list[str]] = UNSET + selected_catalog_entity_ids: Unset | list[str] = UNSET if not isinstance(self.selected_catalog_entity_ids, Unset): selected_catalog_entity_ids = self.selected_catalog_entity_ids - selected_functionality_ids: Union[Unset, list[str]] = UNSET + selected_functionality_ids: Unset | list[str] = UNSET if not isinstance(self.selected_functionality_ids, Unset): selected_functionality_ids = self.selected_functionality_ids - selected_group_ids: Union[Unset, list[str]] = UNSET + selected_group_ids: Unset | list[str] = UNSET if not isinstance(self.selected_group_ids, Unset): selected_group_ids = self.selected_group_ids - selected_option_ids: Union[Unset, list[str]] = UNSET + selected_option_ids: Unset | list[str] = UNSET if not isinstance(self.selected_option_ids, Unset): selected_option_ids = self.selected_option_ids - selected_service_ids: Union[Unset, list[str]] = UNSET + selected_service_ids: Unset | list[str] = UNSET if not isinstance(self.selected_service_ids, Unset): selected_service_ids = self.selected_service_ids - selected_user_ids: Union[Unset, list[int]] = UNSET + selected_user_ids: Unset | list[int] = UNSET if not isinstance(self.selected_user_ids, Unset): selected_user_ids = self.selected_user_ids - selected_cause_ids: Union[Unset, list[str]] = UNSET + selected_cause_ids: Unset | list[str] = UNSET if not isinstance(self.selected_cause_ids, Unset): selected_cause_ids = self.selected_cause_ids - selected_environment_ids: Union[Unset, list[str]] = UNSET + selected_environment_ids: Unset | list[str] = UNSET if not isinstance(self.selected_environment_ids, Unset): selected_environment_ids = self.selected_environment_ids - selected_incident_type_ids: Union[Unset, list[str]] = UNSET + selected_incident_type_ids: Unset | list[str] = UNSET if not isinstance(self.selected_incident_type_ids, Unset): selected_incident_type_ids = self.selected_incident_type_ids @@ -122,7 +120,7 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _action_item_condition = d.pop("action_item_condition", UNSET) - action_item_condition: Union[Unset, UpdateWorkflowActionItemFormFieldConditionDataAttributesActionItemCondition] + action_item_condition: Unset | UpdateWorkflowActionItemFormFieldConditionDataAttributesActionItemCondition if isinstance(_action_item_condition, Unset): action_item_condition = UNSET else: diff --git a/rootly_sdk/models/update_workflow_custom_field_selection_data_attributes.py b/rootly_sdk/models/update_workflow_custom_field_selection_data_attributes.py index ab567ff9..f895b861 100644 --- a/rootly_sdk/models/update_workflow_custom_field_selection_data_attributes.py +++ b/rootly_sdk/models/update_workflow_custom_field_selection_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -22,20 +22,20 @@ class UpdateWorkflowCustomFieldSelectionDataAttributes: selected_option_ids (Union[Unset, list[int]]): """ - incident_condition: Union[Unset, UpdateWorkflowCustomFieldSelectionDataAttributesIncidentCondition] = "ANY" - values: Union[Unset, list[str]] = UNSET - selected_option_ids: Union[Unset, list[int]] = UNSET + incident_condition: Unset | UpdateWorkflowCustomFieldSelectionDataAttributesIncidentCondition = "ANY" + values: Unset | list[str] = UNSET + selected_option_ids: Unset | list[int] = UNSET def to_dict(self) -> dict[str, Any]: - incident_condition: Union[Unset, str] = UNSET + incident_condition: Unset | str = UNSET if not isinstance(self.incident_condition, Unset): incident_condition = self.incident_condition - values: Union[Unset, list[str]] = UNSET + values: Unset | list[str] = UNSET if not isinstance(self.values, Unset): values = self.values - selected_option_ids: Union[Unset, list[int]] = UNSET + selected_option_ids: Unset | list[int] = UNSET if not isinstance(self.selected_option_ids, Unset): selected_option_ids = self.selected_option_ids @@ -55,7 +55,7 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _incident_condition = d.pop("incident_condition", UNSET) - incident_condition: Union[Unset, UpdateWorkflowCustomFieldSelectionDataAttributesIncidentCondition] + incident_condition: Unset | UpdateWorkflowCustomFieldSelectionDataAttributesIncidentCondition if isinstance(_incident_condition, Unset): incident_condition = UNSET else: diff --git a/rootly_sdk/models/update_workflow_data.py b/rootly_sdk/models/update_workflow_data.py index 3283f669..0e2ef268 100644 --- a/rootly_sdk/models/update_workflow_data.py +++ b/rootly_sdk/models/update_workflow_data.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define @@ -25,7 +25,7 @@ class UpdateWorkflowData: type_: UpdateWorkflowDataType attributes: "UpdateWorkflowDataAttributes" - id: Union[Unset, str] = UNSET + id: Unset | str = UNSET def to_dict(self) -> dict[str, Any]: type_: str = self.type_ diff --git a/rootly_sdk/models/update_workflow_data_attributes.py b/rootly_sdk/models/update_workflow_data_attributes.py index 5f141d1f..0a0ddd2f 100644 --- a/rootly_sdk/models/update_workflow_data_attributes.py +++ b/rootly_sdk/models/update_workflow_data_attributes.py @@ -52,20 +52,20 @@ class UpdateWorkflowDataAttributes: sub_status_ids (Union[Unset, list[str]]): """ - slug: Union[None, Unset, str] = UNSET - name: Union[Unset, str] = UNSET - description: Union[None, Unset, str] = UNSET - command: Union[None, Unset, str] = UNSET - command_feedback_enabled: Union[None, Unset, bool] = UNSET - wait: Union[None, Unset, str] = UNSET - repeat_every_duration: Union[None, Unset, str] = UNSET - repeat_condition_duration_since_first_run: Union[None, Unset, str] = UNSET - repeat_condition_number_of_repeats: Union[Unset, int] = UNSET - continuously_repeat: Union[Unset, bool] = UNSET - enabled: Union[Unset, bool] = UNSET - locked: Union[Unset, bool] = UNSET - position: Union[Unset, int] = UNSET - workflow_group_id: Union[None, Unset, str] = UNSET + slug: None | Unset | str = UNSET + name: Unset | str = UNSET + description: None | Unset | str = UNSET + command: None | Unset | str = UNSET + command_feedback_enabled: None | Unset | bool = UNSET + wait: None | Unset | str = UNSET + repeat_every_duration: None | Unset | str = UNSET + repeat_condition_duration_since_first_run: None | Unset | str = UNSET + repeat_condition_number_of_repeats: Unset | int = UNSET + continuously_repeat: Unset | bool = UNSET + enabled: Unset | bool = UNSET + locked: Unset | bool = UNSET + position: Unset | int = UNSET + workflow_group_id: None | Unset | str = UNSET trigger_params: Union[ "ActionItemTriggerParams", "AlertTriggerParams", @@ -74,15 +74,15 @@ class UpdateWorkflowDataAttributes: "SimpleTriggerParams", Unset, ] = UNSET - environment_ids: Union[Unset, list[str]] = UNSET - severity_ids: Union[Unset, list[str]] = UNSET - incident_type_ids: Union[Unset, list[str]] = UNSET - incident_role_ids: Union[Unset, list[str]] = UNSET - service_ids: Union[Unset, list[str]] = UNSET - functionality_ids: Union[Unset, list[str]] = UNSET - group_ids: Union[Unset, list[str]] = UNSET - cause_ids: Union[Unset, list[str]] = UNSET - sub_status_ids: Union[Unset, list[str]] = UNSET + environment_ids: Unset | list[str] = UNSET + severity_ids: Unset | list[str] = UNSET + incident_type_ids: Unset | list[str] = UNSET + incident_role_ids: Unset | list[str] = UNSET + service_ids: Unset | list[str] = UNSET + functionality_ids: Unset | list[str] = UNSET + group_ids: Unset | list[str] = UNSET + cause_ids: Unset | list[str] = UNSET + sub_status_ids: Unset | list[str] = UNSET def to_dict(self) -> dict[str, Any]: from ..models.action_item_trigger_params import ActionItemTriggerParams @@ -90,7 +90,7 @@ def to_dict(self) -> dict[str, Any]: from ..models.incident_trigger_params import IncidentTriggerParams from ..models.pulse_trigger_params import PulseTriggerParams - slug: Union[None, Unset, str] + slug: None | Unset | str if isinstance(self.slug, Unset): slug = UNSET else: @@ -98,37 +98,37 @@ def to_dict(self) -> dict[str, Any]: name = self.name - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - command: Union[None, Unset, str] + command: None | Unset | str if isinstance(self.command, Unset): command = UNSET else: command = self.command - command_feedback_enabled: Union[None, Unset, bool] + command_feedback_enabled: None | Unset | bool if isinstance(self.command_feedback_enabled, Unset): command_feedback_enabled = UNSET else: command_feedback_enabled = self.command_feedback_enabled - wait: Union[None, Unset, str] + wait: None | Unset | str if isinstance(self.wait, Unset): wait = UNSET else: wait = self.wait - repeat_every_duration: Union[None, Unset, str] + repeat_every_duration: None | Unset | str if isinstance(self.repeat_every_duration, Unset): repeat_every_duration = UNSET else: repeat_every_duration = self.repeat_every_duration - repeat_condition_duration_since_first_run: Union[None, Unset, str] + repeat_condition_duration_since_first_run: None | Unset | str if isinstance(self.repeat_condition_duration_since_first_run, Unset): repeat_condition_duration_since_first_run = UNSET else: @@ -144,13 +144,13 @@ def to_dict(self) -> dict[str, Any]: position = self.position - workflow_group_id: Union[None, Unset, str] + workflow_group_id: None | Unset | str if isinstance(self.workflow_group_id, Unset): workflow_group_id = UNSET else: workflow_group_id = self.workflow_group_id - trigger_params: Union[Unset, dict[str, Any]] + trigger_params: Unset | dict[str, Any] if isinstance(self.trigger_params, Unset): trigger_params = UNSET elif isinstance(self.trigger_params, IncidentTriggerParams): @@ -164,39 +164,39 @@ def to_dict(self) -> dict[str, Any]: else: trigger_params = self.trigger_params.to_dict() - environment_ids: Union[Unset, list[str]] = UNSET + environment_ids: Unset | list[str] = UNSET if not isinstance(self.environment_ids, Unset): environment_ids = self.environment_ids - severity_ids: Union[Unset, list[str]] = UNSET + severity_ids: Unset | list[str] = UNSET if not isinstance(self.severity_ids, Unset): severity_ids = self.severity_ids - incident_type_ids: Union[Unset, list[str]] = UNSET + incident_type_ids: Unset | list[str] = UNSET if not isinstance(self.incident_type_ids, Unset): incident_type_ids = self.incident_type_ids - incident_role_ids: Union[Unset, list[str]] = UNSET + incident_role_ids: Unset | list[str] = UNSET if not isinstance(self.incident_role_ids, Unset): incident_role_ids = self.incident_role_ids - service_ids: Union[Unset, list[str]] = UNSET + service_ids: Unset | list[str] = UNSET if not isinstance(self.service_ids, Unset): service_ids = self.service_ids - functionality_ids: Union[Unset, list[str]] = UNSET + functionality_ids: Unset | list[str] = UNSET if not isinstance(self.functionality_ids, Unset): functionality_ids = self.functionality_ids - group_ids: Union[Unset, list[str]] = UNSET + group_ids: Unset | list[str] = UNSET if not isinstance(self.group_ids, Unset): group_ids = self.group_ids - cause_ids: Union[Unset, list[str]] = UNSET + cause_ids: Unset | list[str] = UNSET if not isinstance(self.cause_ids, Unset): cause_ids = self.cause_ids - sub_status_ids: Union[Unset, list[str]] = UNSET + sub_status_ids: Unset | list[str] = UNSET if not isinstance(self.sub_status_ids, Unset): sub_status_ids = self.sub_status_ids @@ -264,68 +264,68 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_slug(data: object) -> Union[None, Unset, str]: + def _parse_slug(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) slug = _parse_slug(d.pop("slug", UNSET)) name = d.pop("name", UNSET) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_command(data: object) -> Union[None, Unset, str]: + def _parse_command(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) command = _parse_command(d.pop("command", UNSET)) - def _parse_command_feedback_enabled(data: object) -> Union[None, Unset, bool]: + def _parse_command_feedback_enabled(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) command_feedback_enabled = _parse_command_feedback_enabled(d.pop("command_feedback_enabled", UNSET)) - def _parse_wait(data: object) -> Union[None, Unset, str]: + def _parse_wait(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) wait = _parse_wait(d.pop("wait", UNSET)) - def _parse_repeat_every_duration(data: object) -> Union[None, Unset, str]: + def _parse_repeat_every_duration(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) repeat_every_duration = _parse_repeat_every_duration(d.pop("repeat_every_duration", UNSET)) - def _parse_repeat_condition_duration_since_first_run(data: object) -> Union[None, Unset, str]: + def _parse_repeat_condition_duration_since_first_run(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) repeat_condition_duration_since_first_run = _parse_repeat_condition_duration_since_first_run( d.pop("repeat_condition_duration_since_first_run", UNSET) @@ -341,12 +341,12 @@ def _parse_repeat_condition_duration_since_first_run(data: object) -> Union[None position = d.pop("position", UNSET) - def _parse_workflow_group_id(data: object) -> Union[None, Unset, str]: + def _parse_workflow_group_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) workflow_group_id = _parse_workflow_group_id(d.pop("workflow_group_id", UNSET)) diff --git a/rootly_sdk/models/update_workflow_form_field_condition_data_attributes.py b/rootly_sdk/models/update_workflow_form_field_condition_data_attributes.py index dee79350..01865d0b 100644 --- a/rootly_sdk/models/update_workflow_form_field_condition_data_attributes.py +++ b/rootly_sdk/models/update_workflow_form_field_condition_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -30,60 +30,60 @@ class UpdateWorkflowFormFieldConditionDataAttributes: selected_incident_type_ids (Union[Unset, list[str]]): """ - incident_condition: Union[Unset, UpdateWorkflowFormFieldConditionDataAttributesIncidentCondition] = "ANY" - values: Union[Unset, list[str]] = UNSET - selected_catalog_entity_ids: Union[Unset, list[str]] = UNSET - selected_functionality_ids: Union[Unset, list[str]] = UNSET - selected_group_ids: Union[Unset, list[str]] = UNSET - selected_option_ids: Union[Unset, list[str]] = UNSET - selected_service_ids: Union[Unset, list[str]] = UNSET - selected_user_ids: Union[Unset, list[int]] = UNSET - selected_cause_ids: Union[Unset, list[str]] = UNSET - selected_environment_ids: Union[Unset, list[str]] = UNSET - selected_incident_type_ids: Union[Unset, list[str]] = UNSET + incident_condition: Unset | UpdateWorkflowFormFieldConditionDataAttributesIncidentCondition = "ANY" + values: Unset | list[str] = UNSET + selected_catalog_entity_ids: Unset | list[str] = UNSET + selected_functionality_ids: Unset | list[str] = UNSET + selected_group_ids: Unset | list[str] = UNSET + selected_option_ids: Unset | list[str] = UNSET + selected_service_ids: Unset | list[str] = UNSET + selected_user_ids: Unset | list[int] = UNSET + selected_cause_ids: Unset | list[str] = UNSET + selected_environment_ids: Unset | list[str] = UNSET + selected_incident_type_ids: Unset | list[str] = UNSET def to_dict(self) -> dict[str, Any]: - incident_condition: Union[Unset, str] = UNSET + incident_condition: Unset | str = UNSET if not isinstance(self.incident_condition, Unset): incident_condition = self.incident_condition - values: Union[Unset, list[str]] = UNSET + values: Unset | list[str] = UNSET if not isinstance(self.values, Unset): values = self.values - selected_catalog_entity_ids: Union[Unset, list[str]] = UNSET + selected_catalog_entity_ids: Unset | list[str] = UNSET if not isinstance(self.selected_catalog_entity_ids, Unset): selected_catalog_entity_ids = self.selected_catalog_entity_ids - selected_functionality_ids: Union[Unset, list[str]] = UNSET + selected_functionality_ids: Unset | list[str] = UNSET if not isinstance(self.selected_functionality_ids, Unset): selected_functionality_ids = self.selected_functionality_ids - selected_group_ids: Union[Unset, list[str]] = UNSET + selected_group_ids: Unset | list[str] = UNSET if not isinstance(self.selected_group_ids, Unset): selected_group_ids = self.selected_group_ids - selected_option_ids: Union[Unset, list[str]] = UNSET + selected_option_ids: Unset | list[str] = UNSET if not isinstance(self.selected_option_ids, Unset): selected_option_ids = self.selected_option_ids - selected_service_ids: Union[Unset, list[str]] = UNSET + selected_service_ids: Unset | list[str] = UNSET if not isinstance(self.selected_service_ids, Unset): selected_service_ids = self.selected_service_ids - selected_user_ids: Union[Unset, list[int]] = UNSET + selected_user_ids: Unset | list[int] = UNSET if not isinstance(self.selected_user_ids, Unset): selected_user_ids = self.selected_user_ids - selected_cause_ids: Union[Unset, list[str]] = UNSET + selected_cause_ids: Unset | list[str] = UNSET if not isinstance(self.selected_cause_ids, Unset): selected_cause_ids = self.selected_cause_ids - selected_environment_ids: Union[Unset, list[str]] = UNSET + selected_environment_ids: Unset | list[str] = UNSET if not isinstance(self.selected_environment_ids, Unset): selected_environment_ids = self.selected_environment_ids - selected_incident_type_ids: Union[Unset, list[str]] = UNSET + selected_incident_type_ids: Unset | list[str] = UNSET if not isinstance(self.selected_incident_type_ids, Unset): selected_incident_type_ids = self.selected_incident_type_ids @@ -119,7 +119,7 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _incident_condition = d.pop("incident_condition", UNSET) - incident_condition: Union[Unset, UpdateWorkflowFormFieldConditionDataAttributesIncidentCondition] + incident_condition: Unset | UpdateWorkflowFormFieldConditionDataAttributesIncidentCondition if isinstance(_incident_condition, Unset): incident_condition = UNSET else: diff --git a/rootly_sdk/models/update_workflow_group_data_attributes.py b/rootly_sdk/models/update_workflow_group_data_attributes.py index 356af9ef..4050895d 100644 --- a/rootly_sdk/models/update_workflow_group_data_attributes.py +++ b/rootly_sdk/models/update_workflow_group_data_attributes.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -27,29 +27,29 @@ class UpdateWorkflowGroupDataAttributes: position (Union[Unset, int]): The position of the workflow group """ - slug: Union[None, Unset, str] = UNSET - kind: Union[Unset, UpdateWorkflowGroupDataAttributesKind] = UNSET - name: Union[Unset, str] = UNSET - description: Union[None, Unset, str] = UNSET - icon: Union[Unset, str] = UNSET - expanded: Union[Unset, bool] = UNSET - position: Union[Unset, int] = UNSET + slug: None | Unset | str = UNSET + kind: Unset | UpdateWorkflowGroupDataAttributesKind = UNSET + name: Unset | str = UNSET + description: None | Unset | str = UNSET + icon: Unset | str = UNSET + expanded: Unset | bool = UNSET + position: Unset | int = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - slug: Union[None, Unset, str] + slug: None | Unset | str if isinstance(self.slug, Unset): slug = UNSET else: slug = self.slug - kind: Union[Unset, str] = UNSET + kind: Unset | str = UNSET if not isinstance(self.kind, Unset): kind = self.kind name = self.name - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: @@ -85,17 +85,17 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_slug(data: object) -> Union[None, Unset, str]: + def _parse_slug(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) slug = _parse_slug(d.pop("slug", UNSET)) _kind = d.pop("kind", UNSET) - kind: Union[Unset, UpdateWorkflowGroupDataAttributesKind] + kind: Unset | UpdateWorkflowGroupDataAttributesKind if isinstance(_kind, Unset): kind = UNSET else: @@ -103,12 +103,12 @@ def _parse_slug(data: object) -> Union[None, Unset, str]: name = d.pop("name", UNSET) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) diff --git a/rootly_sdk/models/update_workflow_task_data_attributes.py b/rootly_sdk/models/update_workflow_task_data_attributes.py index f3d880be..0dc74eb8 100644 --- a/rootly_sdk/models/update_workflow_task_data_attributes.py +++ b/rootly_sdk/models/update_workflow_task_data_attributes.py @@ -262,10 +262,10 @@ class UpdateWorkflowTaskDataAttributes: 'UpdateTrelloCardTaskParams', 'UpdateVictorOpsIncidentTaskParams', 'UpdateZendeskTicketTaskParams', Unset]): """ - name: Union[Unset, str] = UNSET - position: Union[Unset, int] = UNSET - skip_on_failure: Union[Unset, bool] = UNSET - enabled: Union[Unset, bool] = True + name: Unset | str = UNSET + position: Unset | int = UNSET + skip_on_failure: Unset | bool = UNSET + enabled: Unset | bool = True task_params: Union[ "AddActionItemTaskParams", "AddMicrosoftTeamsChatTabTaskParams", @@ -625,7 +625,7 @@ def to_dict(self) -> dict[str, Any]: enabled = self.enabled - task_params: Union[Unset, dict[str, Any]] + task_params: Unset | dict[str, Any] if isinstance(self.task_params, Unset): task_params = UNSET elif isinstance(self.task_params, AddActionItemTaskParams): diff --git a/rootly_sdk/models/update_zendesk_ticket_task_params.py b/rootly_sdk/models/update_zendesk_ticket_task_params.py index 278fa3a5..17aeb783 100644 --- a/rootly_sdk/models/update_zendesk_ticket_task_params.py +++ b/rootly_sdk/models/update_zendesk_ticket_task_params.py @@ -35,19 +35,19 @@ class UpdateZendeskTicketTaskParams: """ ticket_id: str - task_type: Union[Unset, UpdateZendeskTicketTaskParamsTaskType] = UNSET - subject: Union[Unset, str] = UNSET - tags: Union[Unset, str] = UNSET + task_type: Unset | UpdateZendeskTicketTaskParamsTaskType = UNSET + subject: Unset | str = UNSET + tags: Unset | str = UNSET priority: Union[Unset, "UpdateZendeskTicketTaskParamsPriority"] = UNSET completion: Union[Unset, "UpdateZendeskTicketTaskParamsCompletion"] = UNSET - custom_fields_mapping: Union[None, Unset, str] = UNSET - ticket_payload: Union[None, Unset, str] = UNSET + custom_fields_mapping: None | Unset | str = UNSET + ticket_payload: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: ticket_id = self.ticket_id - task_type: Union[Unset, str] = UNSET + task_type: Unset | str = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -55,21 +55,21 @@ def to_dict(self) -> dict[str, Any]: tags = self.tags - priority: Union[Unset, dict[str, Any]] = UNSET + priority: Unset | dict[str, Any] = UNSET if not isinstance(self.priority, Unset): priority = self.priority.to_dict() - completion: Union[Unset, dict[str, Any]] = UNSET + completion: Unset | dict[str, Any] = UNSET if not isinstance(self.completion, Unset): completion = self.completion.to_dict() - custom_fields_mapping: Union[None, Unset, str] + custom_fields_mapping: None | Unset | str if isinstance(self.custom_fields_mapping, Unset): custom_fields_mapping = UNSET else: custom_fields_mapping = self.custom_fields_mapping - ticket_payload: Union[None, Unset, str] + ticket_payload: None | Unset | str if isinstance(self.ticket_payload, Unset): ticket_payload = UNSET else: @@ -108,7 +108,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: ticket_id = d.pop("ticket_id") _task_type = d.pop("task_type", UNSET) - task_type: Union[Unset, UpdateZendeskTicketTaskParamsTaskType] + task_type: Unset | UpdateZendeskTicketTaskParamsTaskType if isinstance(_task_type, Unset): task_type = UNSET else: @@ -119,34 +119,34 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: tags = d.pop("tags", UNSET) _priority = d.pop("priority", UNSET) - priority: Union[Unset, UpdateZendeskTicketTaskParamsPriority] + priority: Unset | UpdateZendeskTicketTaskParamsPriority if isinstance(_priority, Unset): priority = UNSET else: priority = UpdateZendeskTicketTaskParamsPriority.from_dict(_priority) _completion = d.pop("completion", UNSET) - completion: Union[Unset, UpdateZendeskTicketTaskParamsCompletion] + completion: Unset | UpdateZendeskTicketTaskParamsCompletion if isinstance(_completion, Unset): completion = UNSET else: completion = UpdateZendeskTicketTaskParamsCompletion.from_dict(_completion) - def _parse_custom_fields_mapping(data: object) -> Union[None, Unset, str]: + def _parse_custom_fields_mapping(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) custom_fields_mapping = _parse_custom_fields_mapping(d.pop("custom_fields_mapping", UNSET)) - def _parse_ticket_payload(data: object) -> Union[None, Unset, str]: + def _parse_ticket_payload(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) ticket_payload = _parse_ticket_payload(d.pop("ticket_payload", UNSET)) diff --git a/rootly_sdk/models/update_zendesk_ticket_task_params_completion.py b/rootly_sdk/models/update_zendesk_ticket_task_params_completion.py index ba9121d6..728efbab 100644 --- a/rootly_sdk/models/update_zendesk_ticket_task_params_completion.py +++ b/rootly_sdk/models/update_zendesk_ticket_task_params_completion.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -18,8 +18,8 @@ class UpdateZendeskTicketTaskParamsCompletion: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/update_zendesk_ticket_task_params_priority.py b/rootly_sdk/models/update_zendesk_ticket_task_params_priority.py index d79538c3..1545b485 100644 --- a/rootly_sdk/models/update_zendesk_ticket_task_params_priority.py +++ b/rootly_sdk/models/update_zendesk_ticket_task_params_priority.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -18,8 +18,8 @@ class UpdateZendeskTicketTaskParamsPriority: name (Union[Unset, str]): """ - id: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET + id: Unset | str = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/user.py b/rootly_sdk/models/user.py index dfcb1358..0d31891e 100644 --- a/rootly_sdk/models/user.py +++ b/rootly_sdk/models/user.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -26,11 +26,11 @@ class User: email: str created_at: str updated_at: str - first_name: Union[None, Unset, str] = UNSET - last_name: Union[None, Unset, str] = UNSET - full_name: Union[None, Unset, str] = UNSET - full_name_with_team: Union[None, Unset, str] = UNSET - time_zone: Union[None, Unset, str] = UNSET + first_name: None | Unset | str = UNSET + last_name: None | Unset | str = UNSET + full_name: None | Unset | str = UNSET + full_name_with_team: None | Unset | str = UNSET + time_zone: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -40,31 +40,31 @@ def to_dict(self) -> dict[str, Any]: updated_at = self.updated_at - first_name: Union[None, Unset, str] + first_name: None | Unset | str if isinstance(self.first_name, Unset): first_name = UNSET else: first_name = self.first_name - last_name: Union[None, Unset, str] + last_name: None | Unset | str if isinstance(self.last_name, Unset): last_name = UNSET else: last_name = self.last_name - full_name: Union[None, Unset, str] + full_name: None | Unset | str if isinstance(self.full_name, Unset): full_name = UNSET else: full_name = self.full_name - full_name_with_team: Union[None, Unset, str] + full_name_with_team: None | Unset | str if isinstance(self.full_name_with_team, Unset): full_name_with_team = UNSET else: full_name_with_team = self.full_name_with_team - time_zone: Union[None, Unset, str] + time_zone: None | Unset | str if isinstance(self.time_zone, Unset): time_zone = UNSET else: @@ -101,48 +101,48 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: updated_at = d.pop("updated_at") - def _parse_first_name(data: object) -> Union[None, Unset, str]: + def _parse_first_name(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) first_name = _parse_first_name(d.pop("first_name", UNSET)) - def _parse_last_name(data: object) -> Union[None, Unset, str]: + def _parse_last_name(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) last_name = _parse_last_name(d.pop("last_name", UNSET)) - def _parse_full_name(data: object) -> Union[None, Unset, str]: + def _parse_full_name(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) full_name = _parse_full_name(d.pop("full_name", UNSET)) - def _parse_full_name_with_team(data: object) -> Union[None, Unset, str]: + def _parse_full_name_with_team(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) full_name_with_team = _parse_full_name_with_team(d.pop("full_name_with_team", UNSET)) - def _parse_time_zone(data: object) -> Union[None, Unset, str]: + def _parse_time_zone(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) time_zone = _parse_time_zone(d.pop("time_zone", UNSET)) diff --git a/rootly_sdk/models/user_email_address.py b/rootly_sdk/models/user_email_address.py index cb07bb05..ada7931e 100644 --- a/rootly_sdk/models/user_email_address.py +++ b/rootly_sdk/models/user_email_address.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -20,11 +20,11 @@ class UserEmailAddress: updated_at (Union[Unset, str]): Date of last update """ - user_id: Union[Unset, int] = UNSET - email: Union[Unset, str] = UNSET - primary: Union[Unset, bool] = UNSET - created_at: Union[Unset, str] = UNSET - updated_at: Union[Unset, str] = UNSET + user_id: Unset | int = UNSET + email: Unset | str = UNSET + primary: Unset | bool = UNSET + created_at: Unset | str = UNSET + updated_at: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/user_email_address_list.py b/rootly_sdk/models/user_email_address_list.py index 170754cd..c79daafa 100644 --- a/rootly_sdk/models/user_email_address_list.py +++ b/rootly_sdk/models/user_email_address_list.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,7 +29,7 @@ class UserEmailAddressList: data: list["UserEmailAddressListDataItem"] links: "Links" meta: "Meta" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/user_email_address_response.py b/rootly_sdk/models/user_email_address_response.py index 957c753a..a85c64e3 100644 --- a/rootly_sdk/models/user_email_address_response.py +++ b/rootly_sdk/models/user_email_address_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,13 +23,13 @@ class UserEmailAddressResponse: """ data: "UserEmailAddressResponseData" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/user_flat_response.py b/rootly_sdk/models/user_flat_response.py index 91ac6ba8..dced1e40 100644 --- a/rootly_sdk/models/user_flat_response.py +++ b/rootly_sdk/models/user_flat_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -34,16 +34,16 @@ class UserFlatResponse: email: str created_at: str updated_at: str - name: Union[Unset, str] = UNSET - phone: Union[None, Unset, str] = UNSET - phone_2: Union[None, Unset, str] = UNSET - first_name: Union[None, Unset, str] = UNSET - last_name: Union[None, Unset, str] = UNSET - preferred_name: Union[None, Unset, str] = UNSET - full_name: Union[None, Unset, str] = UNSET - full_name_with_team: Union[None, Unset, str] = UNSET - slack_id: Union[None, Unset, str] = UNSET - time_zone: Union[None, Unset, str] = UNSET + name: Unset | str = UNSET + phone: None | Unset | str = UNSET + phone_2: None | Unset | str = UNSET + first_name: None | Unset | str = UNSET + last_name: None | Unset | str = UNSET + preferred_name: None | Unset | str = UNSET + full_name: None | Unset | str = UNSET + full_name_with_team: None | Unset | str = UNSET + slack_id: None | Unset | str = UNSET + time_zone: None | Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -57,55 +57,55 @@ def to_dict(self) -> dict[str, Any]: name = self.name - phone: Union[None, Unset, str] + phone: None | Unset | str if isinstance(self.phone, Unset): phone = UNSET else: phone = self.phone - phone_2: Union[None, Unset, str] + phone_2: None | Unset | str if isinstance(self.phone_2, Unset): phone_2 = UNSET else: phone_2 = self.phone_2 - first_name: Union[None, Unset, str] + first_name: None | Unset | str if isinstance(self.first_name, Unset): first_name = UNSET else: first_name = self.first_name - last_name: Union[None, Unset, str] + last_name: None | Unset | str if isinstance(self.last_name, Unset): last_name = UNSET else: last_name = self.last_name - preferred_name: Union[None, Unset, str] + preferred_name: None | Unset | str if isinstance(self.preferred_name, Unset): preferred_name = UNSET else: preferred_name = self.preferred_name - full_name: Union[None, Unset, str] + full_name: None | Unset | str if isinstance(self.full_name, Unset): full_name = UNSET else: full_name = self.full_name - full_name_with_team: Union[None, Unset, str] + full_name_with_team: None | Unset | str if isinstance(self.full_name_with_team, Unset): full_name_with_team = UNSET else: full_name_with_team = self.full_name_with_team - slack_id: Union[None, Unset, str] + slack_id: None | Unset | str if isinstance(self.slack_id, Unset): slack_id = UNSET else: slack_id = self.slack_id - time_zone: Union[None, Unset, str] + time_zone: None | Unset | str if isinstance(self.time_zone, Unset): time_zone = UNSET else: @@ -157,84 +157,84 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name = d.pop("name", UNSET) - def _parse_phone(data: object) -> Union[None, Unset, str]: + def _parse_phone(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) phone = _parse_phone(d.pop("phone", UNSET)) - def _parse_phone_2(data: object) -> Union[None, Unset, str]: + def _parse_phone_2(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) phone_2 = _parse_phone_2(d.pop("phone_2", UNSET)) - def _parse_first_name(data: object) -> Union[None, Unset, str]: + def _parse_first_name(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) first_name = _parse_first_name(d.pop("first_name", UNSET)) - def _parse_last_name(data: object) -> Union[None, Unset, str]: + def _parse_last_name(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) last_name = _parse_last_name(d.pop("last_name", UNSET)) - def _parse_preferred_name(data: object) -> Union[None, Unset, str]: + def _parse_preferred_name(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) preferred_name = _parse_preferred_name(d.pop("preferred_name", UNSET)) - def _parse_full_name(data: object) -> Union[None, Unset, str]: + def _parse_full_name(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) full_name = _parse_full_name(d.pop("full_name", UNSET)) - def _parse_full_name_with_team(data: object) -> Union[None, Unset, str]: + def _parse_full_name_with_team(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) full_name_with_team = _parse_full_name_with_team(d.pop("full_name_with_team", UNSET)) - def _parse_slack_id(data: object) -> Union[None, Unset, str]: + def _parse_slack_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) slack_id = _parse_slack_id(d.pop("slack_id", UNSET)) - def _parse_time_zone(data: object) -> Union[None, Unset, str]: + def _parse_time_zone(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) time_zone = _parse_time_zone(d.pop("time_zone", UNSET)) diff --git a/rootly_sdk/models/user_list.py b/rootly_sdk/models/user_list.py index 48603800..237ac482 100644 --- a/rootly_sdk/models/user_list.py +++ b/rootly_sdk/models/user_list.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,7 +29,7 @@ class UserList: data: list["UserListDataItem"] links: "Links" meta: "Meta" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/user_list_data_item.py b/rootly_sdk/models/user_list_data_item.py index da905a84..4abc12ea 100644 --- a/rootly_sdk/models/user_list_data_item.py +++ b/rootly_sdk/models/user_list_data_item.py @@ -38,7 +38,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() - relationships: Union[Unset, dict[str, Any]] = UNSET + relationships: Unset | dict[str, Any] = UNSET if not isinstance(self.relationships, Unset): relationships = self.relationships.to_dict() @@ -69,7 +69,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = User.from_dict(d.pop("attributes")) _relationships = d.pop("relationships", UNSET) - relationships: Union[Unset, UserRelationships] + relationships: Unset | UserRelationships if isinstance(_relationships, Unset): relationships = UNSET else: diff --git a/rootly_sdk/models/user_notification_rule.py b/rootly_sdk/models/user_notification_rule.py index b6c1d135..d271fc44 100644 --- a/rootly_sdk/models/user_notification_rule.py +++ b/rootly_sdk/models/user_notification_rule.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -36,66 +36,66 @@ class UserNotificationRule: updated_at (Union[Unset, str]): Date of last update """ - user_id: Union[Unset, int] = UNSET - delay: Union[None, Unset, int] = UNSET - position: Union[None, Unset, int] = UNSET - user_email_address_id: Union[None, Unset, str] = UNSET - user_call_number_id: Union[None, Unset, str] = UNSET - user_sms_number_id: Union[None, Unset, str] = UNSET - user_device_id: Union[None, Unset, str] = UNSET - enabled_contact_types: Union[Unset, list[UserNotificationRuleEnabledContactTypesItem]] = UNSET - notification_type: Union[Unset, UserNotificationRuleNotificationType] = UNSET - created_at: Union[Unset, str] = UNSET - updated_at: Union[Unset, str] = UNSET + user_id: Unset | int = UNSET + delay: None | Unset | int = UNSET + position: None | Unset | int = UNSET + user_email_address_id: None | Unset | str = UNSET + user_call_number_id: None | Unset | str = UNSET + user_sms_number_id: None | Unset | str = UNSET + user_device_id: None | Unset | str = UNSET + enabled_contact_types: Unset | list[UserNotificationRuleEnabledContactTypesItem] = UNSET + notification_type: Unset | UserNotificationRuleNotificationType = UNSET + created_at: Unset | str = UNSET + updated_at: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: user_id = self.user_id - delay: Union[None, Unset, int] + delay: None | Unset | int if isinstance(self.delay, Unset): delay = UNSET else: delay = self.delay - position: Union[None, Unset, int] + position: None | Unset | int if isinstance(self.position, Unset): position = UNSET else: position = self.position - user_email_address_id: Union[None, Unset, str] + user_email_address_id: None | Unset | str if isinstance(self.user_email_address_id, Unset): user_email_address_id = UNSET else: user_email_address_id = self.user_email_address_id - user_call_number_id: Union[None, Unset, str] + user_call_number_id: None | Unset | str if isinstance(self.user_call_number_id, Unset): user_call_number_id = UNSET else: user_call_number_id = self.user_call_number_id - user_sms_number_id: Union[None, Unset, str] + user_sms_number_id: None | Unset | str if isinstance(self.user_sms_number_id, Unset): user_sms_number_id = UNSET else: user_sms_number_id = self.user_sms_number_id - user_device_id: Union[None, Unset, str] + user_device_id: None | Unset | str if isinstance(self.user_device_id, Unset): user_device_id = UNSET else: user_device_id = self.user_device_id - enabled_contact_types: Union[Unset, list[str]] = UNSET + enabled_contact_types: Unset | list[str] = UNSET if not isinstance(self.enabled_contact_types, Unset): enabled_contact_types = [] for enabled_contact_types_item_data in self.enabled_contact_types: enabled_contact_types_item: str = enabled_contact_types_item_data enabled_contact_types.append(enabled_contact_types_item) - notification_type: Union[Unset, str] = UNSET + notification_type: Unset | str = UNSET if not isinstance(self.notification_type, Unset): notification_type = self.notification_type @@ -136,57 +136,57 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) user_id = d.pop("user_id", UNSET) - def _parse_delay(data: object) -> Union[None, Unset, int]: + def _parse_delay(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) delay = _parse_delay(d.pop("delay", UNSET)) - def _parse_position(data: object) -> Union[None, Unset, int]: + def _parse_position(data: object) -> None | Unset | int: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, int], data) + return cast(None | Unset | int, data) position = _parse_position(d.pop("position", UNSET)) - def _parse_user_email_address_id(data: object) -> Union[None, Unset, str]: + def _parse_user_email_address_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) user_email_address_id = _parse_user_email_address_id(d.pop("user_email_address_id", UNSET)) - def _parse_user_call_number_id(data: object) -> Union[None, Unset, str]: + def _parse_user_call_number_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) user_call_number_id = _parse_user_call_number_id(d.pop("user_call_number_id", UNSET)) - def _parse_user_sms_number_id(data: object) -> Union[None, Unset, str]: + def _parse_user_sms_number_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) user_sms_number_id = _parse_user_sms_number_id(d.pop("user_sms_number_id", UNSET)) - def _parse_user_device_id(data: object) -> Union[None, Unset, str]: + def _parse_user_device_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) user_device_id = _parse_user_device_id(d.pop("user_device_id", UNSET)) @@ -200,7 +200,7 @@ def _parse_user_device_id(data: object) -> Union[None, Unset, str]: enabled_contact_types.append(enabled_contact_types_item) _notification_type = d.pop("notification_type", UNSET) - notification_type: Union[Unset, UserNotificationRuleNotificationType] + notification_type: Unset | UserNotificationRuleNotificationType if isinstance(_notification_type, Unset): notification_type = UNSET else: diff --git a/rootly_sdk/models/user_notification_rule_list.py b/rootly_sdk/models/user_notification_rule_list.py index e173dd80..eed922a2 100644 --- a/rootly_sdk/models/user_notification_rule_list.py +++ b/rootly_sdk/models/user_notification_rule_list.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,7 +29,7 @@ class UserNotificationRuleList: data: list["UserNotificationRuleListDataItem"] links: "Links" meta: "Meta" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/user_notification_rule_response.py b/rootly_sdk/models/user_notification_rule_response.py index cbdce3c5..e3b158dd 100644 --- a/rootly_sdk/models/user_notification_rule_response.py +++ b/rootly_sdk/models/user_notification_rule_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,13 +23,13 @@ class UserNotificationRuleResponse: """ data: "UserNotificationRuleResponseData" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/user_phone_number.py b/rootly_sdk/models/user_phone_number.py index 8ef80129..a458ba06 100644 --- a/rootly_sdk/models/user_phone_number.py +++ b/rootly_sdk/models/user_phone_number.py @@ -1,6 +1,6 @@ import datetime from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -24,13 +24,13 @@ class UserPhoneNumber: updated_at (Union[Unset, str]): Date of last update """ - user_id: Union[Unset, int] = UNSET - phone: Union[Unset, str] = UNSET - primary: Union[Unset, bool] = UNSET - verified_at: Union[None, Unset, datetime.datetime] = UNSET - verification_attempts_today: Union[Unset, int] = UNSET - created_at: Union[Unset, str] = UNSET - updated_at: Union[Unset, str] = UNSET + user_id: Unset | int = UNSET + phone: Unset | str = UNSET + primary: Unset | bool = UNSET + verified_at: None | Unset | datetime.datetime = UNSET + verification_attempts_today: Unset | int = UNSET + created_at: Unset | str = UNSET + updated_at: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -40,7 +40,7 @@ def to_dict(self) -> dict[str, Any]: primary = self.primary - verified_at: Union[None, Unset, str] + verified_at: None | Unset | str if isinstance(self.verified_at, Unset): verified_at = UNSET elif isinstance(self.verified_at, datetime.datetime): @@ -83,7 +83,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: primary = d.pop("primary", UNSET) - def _parse_verified_at(data: object) -> Union[None, Unset, datetime.datetime]: + def _parse_verified_at(data: object) -> None | Unset | datetime.datetime: if data is None: return data if isinstance(data, Unset): @@ -96,7 +96,7 @@ def _parse_verified_at(data: object) -> Union[None, Unset, datetime.datetime]: return verified_at_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, datetime.datetime], data) + return cast(None | Unset | datetime.datetime, data) verified_at = _parse_verified_at(d.pop("verified_at", UNSET)) diff --git a/rootly_sdk/models/user_phone_number_list.py b/rootly_sdk/models/user_phone_number_list.py index 033976d2..e4eb2ca2 100644 --- a/rootly_sdk/models/user_phone_number_list.py +++ b/rootly_sdk/models/user_phone_number_list.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,7 +29,7 @@ class UserPhoneNumberList: data: list["UserPhoneNumberListDataItem"] links: "Links" meta: "Meta" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/user_phone_number_response.py b/rootly_sdk/models/user_phone_number_response.py index 2fba80f8..763bfc8b 100644 --- a/rootly_sdk/models/user_phone_number_response.py +++ b/rootly_sdk/models/user_phone_number_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,13 +23,13 @@ class UserPhoneNumberResponse: """ data: "UserPhoneNumberResponseData" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/user_relationships.py b/rootly_sdk/models/user_relationships.py index 4ae2784b..01891445 100644 --- a/rootly_sdk/models/user_relationships.py +++ b/rootly_sdk/models/user_relationships.py @@ -27,11 +27,11 @@ class UserRelationships: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - role: Union[Unset, dict[str, Any]] = UNSET + role: Unset | dict[str, Any] = UNSET if not isinstance(self.role, Unset): role = self.role.to_dict() - on_call_role: Union[Unset, dict[str, Any]] = UNSET + on_call_role: Unset | dict[str, Any] = UNSET if not isinstance(self.on_call_role, Unset): on_call_role = self.on_call_role.to_dict() @@ -52,14 +52,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _role = d.pop("role", UNSET) - role: Union[Unset, RoleRelationship] + role: Unset | RoleRelationship if isinstance(_role, Unset): role = UNSET else: role = RoleRelationship.from_dict(_role) _on_call_role = d.pop("on_call_role", UNSET) - on_call_role: Union[Unset, OnCallRoleRelationship] + on_call_role: Unset | OnCallRoleRelationship if isinstance(_on_call_role, Unset): on_call_role = UNSET else: diff --git a/rootly_sdk/models/user_response.py b/rootly_sdk/models/user_response.py index 519893b0..34ff082f 100644 --- a/rootly_sdk/models/user_response.py +++ b/rootly_sdk/models/user_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,13 +23,13 @@ class UserResponse: """ data: "UserResponseData" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/user_response_data.py b/rootly_sdk/models/user_response_data.py index eb26b052..48e292f5 100644 --- a/rootly_sdk/models/user_response_data.py +++ b/rootly_sdk/models/user_response_data.py @@ -38,7 +38,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() - relationships: Union[Unset, dict[str, Any]] = UNSET + relationships: Unset | dict[str, Any] = UNSET if not isinstance(self.relationships, Unset): relationships = self.relationships.to_dict() @@ -69,7 +69,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = User.from_dict(d.pop("attributes")) _relationships = d.pop("relationships", UNSET) - relationships: Union[Unset, UserRelationships] + relationships: Unset | UserRelationships if isinstance(_relationships, Unset): relationships = UNSET else: diff --git a/rootly_sdk/models/verified_domain.py b/rootly_sdk/models/verified_domain.py index 4246f8b7..6fc9bf7f 100644 --- a/rootly_sdk/models/verified_domain.py +++ b/rootly_sdk/models/verified_domain.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -39,11 +39,11 @@ class VerifiedDomain: txt_value: str created_at: str updated_at: str - verified_at: Union[None, Unset, str] = UNSET - last_checked_at: Union[None, Unset, str] = UNSET - last_check_passed_at: Union[None, Unset, str] = UNSET - check_failures_count: Union[Unset, int] = UNSET - source: Union[Unset, VerifiedDomainSource] = UNSET + verified_at: None | Unset | str = UNSET + last_checked_at: None | Unset | str = UNSET + last_check_passed_at: None | Unset | str = UNSET + check_failures_count: Unset | int = UNSET + source: Unset | VerifiedDomainSource = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -61,19 +61,19 @@ def to_dict(self) -> dict[str, Any]: updated_at = self.updated_at - verified_at: Union[None, Unset, str] + verified_at: None | Unset | str if isinstance(self.verified_at, Unset): verified_at = UNSET else: verified_at = self.verified_at - last_checked_at: Union[None, Unset, str] + last_checked_at: None | Unset | str if isinstance(self.last_checked_at, Unset): last_checked_at = UNSET else: last_checked_at = self.last_checked_at - last_check_passed_at: Union[None, Unset, str] + last_check_passed_at: None | Unset | str if isinstance(self.last_check_passed_at, Unset): last_check_passed_at = UNSET else: @@ -81,7 +81,7 @@ def to_dict(self) -> dict[str, Any]: check_failures_count = self.check_failures_count - source: Union[Unset, str] = UNSET + source: Unset | str = UNSET if not isinstance(self.source, Unset): source = self.source @@ -128,37 +128,37 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: updated_at = d.pop("updated_at") - def _parse_verified_at(data: object) -> Union[None, Unset, str]: + def _parse_verified_at(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) verified_at = _parse_verified_at(d.pop("verified_at", UNSET)) - def _parse_last_checked_at(data: object) -> Union[None, Unset, str]: + def _parse_last_checked_at(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) last_checked_at = _parse_last_checked_at(d.pop("last_checked_at", UNSET)) - def _parse_last_check_passed_at(data: object) -> Union[None, Unset, str]: + def _parse_last_check_passed_at(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) last_check_passed_at = _parse_last_check_passed_at(d.pop("last_check_passed_at", UNSET)) check_failures_count = d.pop("check_failures_count", UNSET) _source = d.pop("source", UNSET) - source: Union[Unset, VerifiedDomainSource] + source: Unset | VerifiedDomainSource if isinstance(_source, Unset): source = UNSET else: diff --git a/rootly_sdk/models/verified_domain_list.py b/rootly_sdk/models/verified_domain_list.py index 55b8aa5c..1b552bab 100644 --- a/rootly_sdk/models/verified_domain_list.py +++ b/rootly_sdk/models/verified_domain_list.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,7 +29,7 @@ class VerifiedDomainList: data: list["VerifiedDomainListDataItem"] links: "Links" meta: "Meta" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/verified_domain_response.py b/rootly_sdk/models/verified_domain_response.py index 9e345a3b..8ab2b86b 100644 --- a/rootly_sdk/models/verified_domain_response.py +++ b/rootly_sdk/models/verified_domain_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,13 +23,13 @@ class VerifiedDomainResponse: """ data: "VerifiedDomainResponseData" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/webhooks_delivery.py b/rootly_sdk/models/webhooks_delivery.py index 191854a4..9afad961 100644 --- a/rootly_sdk/models/webhooks_delivery.py +++ b/rootly_sdk/models/webhooks_delivery.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -27,8 +27,8 @@ class WebhooksDelivery: endpoint_id: str payload: str status: WebhooksDeliveryStatus - response_status: Union[None, int] - delivered_at: Union[None, str] + response_status: None | int + delivered_at: None | str created_at: str updated_at: str additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -40,10 +40,10 @@ def to_dict(self) -> dict[str, Any]: status: str = self.status - response_status: Union[None, int] + response_status: None | int response_status = self.response_status - delivered_at: Union[None, str] + delivered_at: None | str delivered_at = self.delivered_at created_at = self.created_at @@ -75,17 +75,17 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: status = check_webhooks_delivery_status(d.pop("status")) - def _parse_response_status(data: object) -> Union[None, int]: + def _parse_response_status(data: object) -> None | int: if data is None: return data - return cast(Union[None, int], data) + return cast(None | int, data) response_status = _parse_response_status(d.pop("response_status")) - def _parse_delivered_at(data: object) -> Union[None, str]: + def _parse_delivered_at(data: object) -> None | str: if data is None: return data - return cast(Union[None, str], data) + return cast(None | str, data) delivered_at = _parse_delivered_at(d.pop("delivered_at")) diff --git a/rootly_sdk/models/webhooks_delivery_list.py b/rootly_sdk/models/webhooks_delivery_list.py index 1817efc8..a03f917e 100644 --- a/rootly_sdk/models/webhooks_delivery_list.py +++ b/rootly_sdk/models/webhooks_delivery_list.py @@ -29,7 +29,7 @@ class WebhooksDeliveryList: data: list["WebhooksDeliveryListDataItem"] links: Union[Unset, "Links"] = UNSET meta: Union[Unset, "Meta"] = UNSET - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -38,15 +38,15 @@ def to_dict(self) -> dict[str, Any]: data_item = data_item_data.to_dict() data.append(data_item) - links: Union[Unset, dict[str, Any]] = UNSET + links: Unset | dict[str, Any] = UNSET if not isinstance(self.links, Unset): links = self.links.to_dict() - meta: Union[Unset, dict[str, Any]] = UNSET + meta: Unset | dict[str, Any] = UNSET if not isinstance(self.meta, Unset): meta = self.meta.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +85,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data.append(data_item) _links = d.pop("links", UNSET) - links: Union[Unset, Links] + links: Unset | Links if isinstance(_links, Unset): links = UNSET else: links = Links.from_dict(_links) _meta = d.pop("meta", UNSET) - meta: Union[Unset, Meta] + meta: Unset | Meta if isinstance(_meta, Unset): meta = UNSET else: diff --git a/rootly_sdk/models/webhooks_delivery_response.py b/rootly_sdk/models/webhooks_delivery_response.py index 21193c2a..d75b8899 100644 --- a/rootly_sdk/models/webhooks_delivery_response.py +++ b/rootly_sdk/models/webhooks_delivery_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,13 +23,13 @@ class WebhooksDeliveryResponse: """ data: "WebhooksDeliveryResponseData" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/webhooks_endpoint.py b/rootly_sdk/models/webhooks_endpoint.py index db31f9a3..2cd304b4 100644 --- a/rootly_sdk/models/webhooks_endpoint.py +++ b/rootly_sdk/models/webhooks_endpoint.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -40,8 +40,8 @@ class WebhooksEndpoint: enabled: bool created_at: str updated_at: str - slug: Union[Unset, str] = UNSET - custom_headers: Union[Unset, list["WebhooksEndpointCustomHeadersItem"]] = UNSET + slug: Unset | str = UNSET + custom_headers: Unset | list["WebhooksEndpointCustomHeadersItem"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -64,7 +64,7 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - custom_headers: Union[Unset, list[dict[str, Any]]] = UNSET + custom_headers: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.custom_headers, Unset): custom_headers = [] for custom_headers_item_data in self.custom_headers: diff --git a/rootly_sdk/models/webhooks_endpoint_list.py b/rootly_sdk/models/webhooks_endpoint_list.py index 3d1995b2..a4fd1daf 100644 --- a/rootly_sdk/models/webhooks_endpoint_list.py +++ b/rootly_sdk/models/webhooks_endpoint_list.py @@ -29,7 +29,7 @@ class WebhooksEndpointList: data: list["WebhooksEndpointListDataItem"] links: Union[Unset, "Links"] = UNSET meta: Union[Unset, "Meta"] = UNSET - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -38,15 +38,15 @@ def to_dict(self) -> dict[str, Any]: data_item = data_item_data.to_dict() data.append(data_item) - links: Union[Unset, dict[str, Any]] = UNSET + links: Unset | dict[str, Any] = UNSET if not isinstance(self.links, Unset): links = self.links.to_dict() - meta: Union[Unset, dict[str, Any]] = UNSET + meta: Unset | dict[str, Any] = UNSET if not isinstance(self.meta, Unset): meta = self.meta.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,14 +85,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data.append(data_item) _links = d.pop("links", UNSET) - links: Union[Unset, Links] + links: Unset | Links if isinstance(_links, Unset): links = UNSET else: links = Links.from_dict(_links) _meta = d.pop("meta", UNSET) - meta: Union[Unset, Meta] + meta: Unset | Meta if isinstance(_meta, Unset): meta = UNSET else: diff --git a/rootly_sdk/models/webhooks_endpoint_response.py b/rootly_sdk/models/webhooks_endpoint_response.py index a8b3cf62..be935fca 100644 --- a/rootly_sdk/models/webhooks_endpoint_response.py +++ b/rootly_sdk/models/webhooks_endpoint_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,13 +23,13 @@ class WebhooksEndpointResponse: """ data: "WebhooksEndpointResponseData" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/workflow.py b/rootly_sdk/models/workflow.py index 49fdb282..255a05be 100644 --- a/rootly_sdk/models/workflow.py +++ b/rootly_sdk/models/workflow.py @@ -59,20 +59,20 @@ class Workflow: name: str created_at: str updated_at: str - slug: Union[Unset, str] = UNSET - description: Union[None, Unset, str] = UNSET - command: Union[None, Unset, str] = UNSET - command_feedback_enabled: Union[None, Unset, bool] = UNSET - wait: Union[None, Unset, str] = UNSET - repeat_every_duration: Union[None, Unset, str] = UNSET - repeat_condition_duration_since_first_run: Union[None, Unset, str] = UNSET - repeat_condition_number_of_repeats: Union[Unset, int] = UNSET - continuously_repeat: Union[Unset, bool] = UNSET - repeat_on: Union[None, Unset, list[WorkflowRepeatOnType0Item]] = UNSET - enabled: Union[Unset, bool] = UNSET - locked: Union[Unset, bool] = UNSET - position: Union[Unset, int] = UNSET - workflow_group_id: Union[None, Unset, str] = UNSET + slug: Unset | str = UNSET + description: None | Unset | str = UNSET + command: None | Unset | str = UNSET + command_feedback_enabled: None | Unset | bool = UNSET + wait: None | Unset | str = UNSET + repeat_every_duration: None | Unset | str = UNSET + repeat_condition_duration_since_first_run: None | Unset | str = UNSET + repeat_condition_number_of_repeats: Unset | int = UNSET + continuously_repeat: Unset | bool = UNSET + repeat_on: None | Unset | list[WorkflowRepeatOnType0Item] = UNSET + enabled: Unset | bool = UNSET + locked: Unset | bool = UNSET + position: Unset | int = UNSET + workflow_group_id: None | Unset | str = UNSET trigger_params: Union[ "ActionItemTriggerParams", "AlertTriggerParams", @@ -81,15 +81,15 @@ class Workflow: "SimpleTriggerParams", Unset, ] = UNSET - environment_ids: Union[Unset, list[str]] = UNSET - severity_ids: Union[Unset, list[str]] = UNSET - incident_type_ids: Union[Unset, list[str]] = UNSET - incident_role_ids: Union[Unset, list[str]] = UNSET - service_ids: Union[Unset, list[str]] = UNSET - functionality_ids: Union[Unset, list[str]] = UNSET - group_ids: Union[Unset, list[str]] = UNSET - cause_ids: Union[Unset, list[str]] = UNSET - sub_status_ids: Union[Unset, list[str]] = UNSET + environment_ids: Unset | list[str] = UNSET + severity_ids: Unset | list[str] = UNSET + incident_type_ids: Unset | list[str] = UNSET + incident_role_ids: Unset | list[str] = UNSET + service_ids: Unset | list[str] = UNSET + functionality_ids: Unset | list[str] = UNSET + group_ids: Unset | list[str] = UNSET + cause_ids: Unset | list[str] = UNSET + sub_status_ids: Unset | list[str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -106,37 +106,37 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: description = self.description - command: Union[None, Unset, str] + command: None | Unset | str if isinstance(self.command, Unset): command = UNSET else: command = self.command - command_feedback_enabled: Union[None, Unset, bool] + command_feedback_enabled: None | Unset | bool if isinstance(self.command_feedback_enabled, Unset): command_feedback_enabled = UNSET else: command_feedback_enabled = self.command_feedback_enabled - wait: Union[None, Unset, str] + wait: None | Unset | str if isinstance(self.wait, Unset): wait = UNSET else: wait = self.wait - repeat_every_duration: Union[None, Unset, str] + repeat_every_duration: None | Unset | str if isinstance(self.repeat_every_duration, Unset): repeat_every_duration = UNSET else: repeat_every_duration = self.repeat_every_duration - repeat_condition_duration_since_first_run: Union[None, Unset, str] + repeat_condition_duration_since_first_run: None | Unset | str if isinstance(self.repeat_condition_duration_since_first_run, Unset): repeat_condition_duration_since_first_run = UNSET else: @@ -146,7 +146,7 @@ def to_dict(self) -> dict[str, Any]: continuously_repeat = self.continuously_repeat - repeat_on: Union[None, Unset, list[str]] + repeat_on: None | Unset | list[str] if isinstance(self.repeat_on, Unset): repeat_on = UNSET elif isinstance(self.repeat_on, list): @@ -164,13 +164,13 @@ def to_dict(self) -> dict[str, Any]: position = self.position - workflow_group_id: Union[None, Unset, str] + workflow_group_id: None | Unset | str if isinstance(self.workflow_group_id, Unset): workflow_group_id = UNSET else: workflow_group_id = self.workflow_group_id - trigger_params: Union[Unset, dict[str, Any]] + trigger_params: Unset | dict[str, Any] if isinstance(self.trigger_params, Unset): trigger_params = UNSET elif isinstance(self.trigger_params, IncidentTriggerParams): @@ -184,39 +184,39 @@ def to_dict(self) -> dict[str, Any]: else: trigger_params = self.trigger_params.to_dict() - environment_ids: Union[Unset, list[str]] = UNSET + environment_ids: Unset | list[str] = UNSET if not isinstance(self.environment_ids, Unset): environment_ids = self.environment_ids - severity_ids: Union[Unset, list[str]] = UNSET + severity_ids: Unset | list[str] = UNSET if not isinstance(self.severity_ids, Unset): severity_ids = self.severity_ids - incident_type_ids: Union[Unset, list[str]] = UNSET + incident_type_ids: Unset | list[str] = UNSET if not isinstance(self.incident_type_ids, Unset): incident_type_ids = self.incident_type_ids - incident_role_ids: Union[Unset, list[str]] = UNSET + incident_role_ids: Unset | list[str] = UNSET if not isinstance(self.incident_role_ids, Unset): incident_role_ids = self.incident_role_ids - service_ids: Union[Unset, list[str]] = UNSET + service_ids: Unset | list[str] = UNSET if not isinstance(self.service_ids, Unset): service_ids = self.service_ids - functionality_ids: Union[Unset, list[str]] = UNSET + functionality_ids: Unset | list[str] = UNSET if not isinstance(self.functionality_ids, Unset): functionality_ids = self.functionality_ids - group_ids: Union[Unset, list[str]] = UNSET + group_ids: Unset | list[str] = UNSET if not isinstance(self.group_ids, Unset): group_ids = self.group_ids - cause_ids: Union[Unset, list[str]] = UNSET + cause_ids: Unset | list[str] = UNSET if not isinstance(self.cause_ids, Unset): cause_ids = self.cause_ids - sub_status_ids: Union[Unset, list[str]] = UNSET + sub_status_ids: Unset | list[str] = UNSET if not isinstance(self.sub_status_ids, Unset): sub_status_ids = self.sub_status_ids @@ -297,57 +297,57 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: slug = d.pop("slug", UNSET) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_command(data: object) -> Union[None, Unset, str]: + def _parse_command(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) command = _parse_command(d.pop("command", UNSET)) - def _parse_command_feedback_enabled(data: object) -> Union[None, Unset, bool]: + def _parse_command_feedback_enabled(data: object) -> None | Unset | bool: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(None | Unset | bool, data) command_feedback_enabled = _parse_command_feedback_enabled(d.pop("command_feedback_enabled", UNSET)) - def _parse_wait(data: object) -> Union[None, Unset, str]: + def _parse_wait(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) wait = _parse_wait(d.pop("wait", UNSET)) - def _parse_repeat_every_duration(data: object) -> Union[None, Unset, str]: + def _parse_repeat_every_duration(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) repeat_every_duration = _parse_repeat_every_duration(d.pop("repeat_every_duration", UNSET)) - def _parse_repeat_condition_duration_since_first_run(data: object) -> Union[None, Unset, str]: + def _parse_repeat_condition_duration_since_first_run(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) repeat_condition_duration_since_first_run = _parse_repeat_condition_duration_since_first_run( d.pop("repeat_condition_duration_since_first_run", UNSET) @@ -357,7 +357,7 @@ def _parse_repeat_condition_duration_since_first_run(data: object) -> Union[None continuously_repeat = d.pop("continuously_repeat", UNSET) - def _parse_repeat_on(data: object) -> Union[None, Unset, list[WorkflowRepeatOnType0Item]]: + def _parse_repeat_on(data: object) -> None | Unset | list[WorkflowRepeatOnType0Item]: if data is None: return data if isinstance(data, Unset): @@ -375,7 +375,7 @@ def _parse_repeat_on(data: object) -> Union[None, Unset, list[WorkflowRepeatOnTy return repeat_on_type_0 except: # noqa: E722 pass - return cast(Union[None, Unset, list[WorkflowRepeatOnType0Item]], data) + return cast(None | Unset | list[WorkflowRepeatOnType0Item], data) repeat_on = _parse_repeat_on(d.pop("repeat_on", UNSET)) @@ -385,12 +385,12 @@ def _parse_repeat_on(data: object) -> Union[None, Unset, list[WorkflowRepeatOnTy position = d.pop("position", UNSET) - def _parse_workflow_group_id(data: object) -> Union[None, Unset, str]: + def _parse_workflow_group_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) workflow_group_id = _parse_workflow_group_id(d.pop("workflow_group_id", UNSET)) diff --git a/rootly_sdk/models/workflow_action_item_form_field_condition.py b/rootly_sdk/models/workflow_action_item_form_field_condition.py index 52a437fe..e483d466 100644 --- a/rootly_sdk/models/workflow_action_item_form_field_condition.py +++ b/rootly_sdk/models/workflow_action_item_form_field_condition.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -39,13 +39,13 @@ class WorkflowActionItemFormFieldCondition: selected_option_ids: list[str] selected_user_ids: list[int] action_item_condition: WorkflowActionItemFormFieldConditionActionItemCondition = "ANY" - values: Union[Unset, list[str]] = UNSET - selected_functionality_ids: Union[Unset, list[str]] = UNSET - selected_group_ids: Union[Unset, list[str]] = UNSET - selected_service_ids: Union[Unset, list[str]] = UNSET - selected_cause_ids: Union[Unset, list[str]] = UNSET - selected_environment_ids: Union[Unset, list[str]] = UNSET - selected_incident_type_ids: Union[Unset, list[str]] = UNSET + values: Unset | list[str] = UNSET + selected_functionality_ids: Unset | list[str] = UNSET + selected_group_ids: Unset | list[str] = UNSET + selected_service_ids: Unset | list[str] = UNSET + selected_cause_ids: Unset | list[str] = UNSET + selected_environment_ids: Unset | list[str] = UNSET + selected_incident_type_ids: Unset | list[str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -61,31 +61,31 @@ def to_dict(self) -> dict[str, Any]: selected_user_ids = self.selected_user_ids - values: Union[Unset, list[str]] = UNSET + values: Unset | list[str] = UNSET if not isinstance(self.values, Unset): values = self.values - selected_functionality_ids: Union[Unset, list[str]] = UNSET + selected_functionality_ids: Unset | list[str] = UNSET if not isinstance(self.selected_functionality_ids, Unset): selected_functionality_ids = self.selected_functionality_ids - selected_group_ids: Union[Unset, list[str]] = UNSET + selected_group_ids: Unset | list[str] = UNSET if not isinstance(self.selected_group_ids, Unset): selected_group_ids = self.selected_group_ids - selected_service_ids: Union[Unset, list[str]] = UNSET + selected_service_ids: Unset | list[str] = UNSET if not isinstance(self.selected_service_ids, Unset): selected_service_ids = self.selected_service_ids - selected_cause_ids: Union[Unset, list[str]] = UNSET + selected_cause_ids: Unset | list[str] = UNSET if not isinstance(self.selected_cause_ids, Unset): selected_cause_ids = self.selected_cause_ids - selected_environment_ids: Union[Unset, list[str]] = UNSET + selected_environment_ids: Unset | list[str] = UNSET if not isinstance(self.selected_environment_ids, Unset): selected_environment_ids = self.selected_environment_ids - selected_incident_type_ids: Union[Unset, list[str]] = UNSET + selected_incident_type_ids: Unset | list[str] = UNSET if not isinstance(self.selected_incident_type_ids, Unset): selected_incident_type_ids = self.selected_incident_type_ids diff --git a/rootly_sdk/models/workflow_action_item_form_field_condition_list.py b/rootly_sdk/models/workflow_action_item_form_field_condition_list.py index 93639cb9..cac4c8f0 100644 --- a/rootly_sdk/models/workflow_action_item_form_field_condition_list.py +++ b/rootly_sdk/models/workflow_action_item_form_field_condition_list.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -31,7 +31,7 @@ class WorkflowActionItemFormFieldConditionList: data: list["WorkflowActionItemFormFieldConditionListDataItem"] links: "Links" meta: "Meta" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -44,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/workflow_action_item_form_field_condition_response.py b/rootly_sdk/models/workflow_action_item_form_field_condition_response.py index 6bd44e41..10f0545c 100644 --- a/rootly_sdk/models/workflow_action_item_form_field_condition_response.py +++ b/rootly_sdk/models/workflow_action_item_form_field_condition_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -25,13 +25,13 @@ class WorkflowActionItemFormFieldConditionResponse: """ data: "WorkflowActionItemFormFieldConditionResponseData" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/workflow_custom_field_selection.py b/rootly_sdk/models/workflow_custom_field_selection.py index 3998395d..b236ae05 100644 --- a/rootly_sdk/models/workflow_custom_field_selection.py +++ b/rootly_sdk/models/workflow_custom_field_selection.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -28,7 +28,7 @@ class WorkflowCustomFieldSelection: custom_field_id: int selected_option_ids: list[int] incident_condition: WorkflowCustomFieldSelectionIncidentCondition = "ANY" - values: Union[Unset, list[str]] = UNSET + values: Unset | list[str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -40,7 +40,7 @@ def to_dict(self) -> dict[str, Any]: selected_option_ids = self.selected_option_ids - values: Union[Unset, list[str]] = UNSET + values: Unset | list[str] = UNSET if not isinstance(self.values, Unset): values = self.values diff --git a/rootly_sdk/models/workflow_custom_field_selection_list.py b/rootly_sdk/models/workflow_custom_field_selection_list.py index 2a5e0f68..88ea8c43 100644 --- a/rootly_sdk/models/workflow_custom_field_selection_list.py +++ b/rootly_sdk/models/workflow_custom_field_selection_list.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,7 +29,7 @@ class WorkflowCustomFieldSelectionList: data: list["WorkflowCustomFieldSelectionListDataItem"] links: "Links" meta: "Meta" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/workflow_custom_field_selection_response.py b/rootly_sdk/models/workflow_custom_field_selection_response.py index 1c4c5cee..dddd95eb 100644 --- a/rootly_sdk/models/workflow_custom_field_selection_response.py +++ b/rootly_sdk/models/workflow_custom_field_selection_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,13 +23,13 @@ class WorkflowCustomFieldSelectionResponse: """ data: "WorkflowCustomFieldSelectionResponseData" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/workflow_form_field_condition.py b/rootly_sdk/models/workflow_form_field_condition.py index 1fba73c3..b937c662 100644 --- a/rootly_sdk/models/workflow_form_field_condition.py +++ b/rootly_sdk/models/workflow_form_field_condition.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -38,13 +38,13 @@ class WorkflowFormFieldCondition: selected_option_ids: list[str] selected_user_ids: list[int] incident_condition: WorkflowFormFieldConditionIncidentCondition = "ANY" - values: Union[Unset, list[str]] = UNSET - selected_functionality_ids: Union[Unset, list[str]] = UNSET - selected_group_ids: Union[Unset, list[str]] = UNSET - selected_service_ids: Union[Unset, list[str]] = UNSET - selected_cause_ids: Union[Unset, list[str]] = UNSET - selected_environment_ids: Union[Unset, list[str]] = UNSET - selected_incident_type_ids: Union[Unset, list[str]] = UNSET + values: Unset | list[str] = UNSET + selected_functionality_ids: Unset | list[str] = UNSET + selected_group_ids: Unset | list[str] = UNSET + selected_service_ids: Unset | list[str] = UNSET + selected_cause_ids: Unset | list[str] = UNSET + selected_environment_ids: Unset | list[str] = UNSET + selected_incident_type_ids: Unset | list[str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -60,31 +60,31 @@ def to_dict(self) -> dict[str, Any]: selected_user_ids = self.selected_user_ids - values: Union[Unset, list[str]] = UNSET + values: Unset | list[str] = UNSET if not isinstance(self.values, Unset): values = self.values - selected_functionality_ids: Union[Unset, list[str]] = UNSET + selected_functionality_ids: Unset | list[str] = UNSET if not isinstance(self.selected_functionality_ids, Unset): selected_functionality_ids = self.selected_functionality_ids - selected_group_ids: Union[Unset, list[str]] = UNSET + selected_group_ids: Unset | list[str] = UNSET if not isinstance(self.selected_group_ids, Unset): selected_group_ids = self.selected_group_ids - selected_service_ids: Union[Unset, list[str]] = UNSET + selected_service_ids: Unset | list[str] = UNSET if not isinstance(self.selected_service_ids, Unset): selected_service_ids = self.selected_service_ids - selected_cause_ids: Union[Unset, list[str]] = UNSET + selected_cause_ids: Unset | list[str] = UNSET if not isinstance(self.selected_cause_ids, Unset): selected_cause_ids = self.selected_cause_ids - selected_environment_ids: Union[Unset, list[str]] = UNSET + selected_environment_ids: Unset | list[str] = UNSET if not isinstance(self.selected_environment_ids, Unset): selected_environment_ids = self.selected_environment_ids - selected_incident_type_ids: Union[Unset, list[str]] = UNSET + selected_incident_type_ids: Unset | list[str] = UNSET if not isinstance(self.selected_incident_type_ids, Unset): selected_incident_type_ids = self.selected_incident_type_ids diff --git a/rootly_sdk/models/workflow_form_field_condition_list.py b/rootly_sdk/models/workflow_form_field_condition_list.py index 581248e6..f3b99e98 100644 --- a/rootly_sdk/models/workflow_form_field_condition_list.py +++ b/rootly_sdk/models/workflow_form_field_condition_list.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,7 +29,7 @@ class WorkflowFormFieldConditionList: data: list["WorkflowFormFieldConditionListDataItem"] links: "Links" meta: "Meta" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/workflow_form_field_condition_response.py b/rootly_sdk/models/workflow_form_field_condition_response.py index 7aa2c3d1..671954a0 100644 --- a/rootly_sdk/models/workflow_form_field_condition_response.py +++ b/rootly_sdk/models/workflow_form_field_condition_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,13 +23,13 @@ class WorkflowFormFieldConditionResponse: """ data: "WorkflowFormFieldConditionResponseData" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/workflow_group.py b/rootly_sdk/models/workflow_group.py index a834661a..bc80f73e 100644 --- a/rootly_sdk/models/workflow_group.py +++ b/rootly_sdk/models/workflow_group.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -25,11 +25,11 @@ class WorkflowGroup: name: str position: int - kind: Union[Unset, WorkflowGroupKind] = UNSET - slug: Union[Unset, str] = UNSET - description: Union[None, Unset, str] = UNSET - icon: Union[Unset, str] = UNSET - expanded: Union[Unset, bool] = UNSET + kind: Unset | WorkflowGroupKind = UNSET + slug: Unset | str = UNSET + description: None | Unset | str = UNSET + icon: Unset | str = UNSET + expanded: Unset | bool = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -37,13 +37,13 @@ def to_dict(self) -> dict[str, Any]: position = self.position - kind: Union[Unset, str] = UNSET + kind: Unset | str = UNSET if not isinstance(self.kind, Unset): kind = self.kind slug = self.slug - description: Union[None, Unset, str] + description: None | Unset | str if isinstance(self.description, Unset): description = UNSET else: @@ -82,7 +82,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: position = d.pop("position") _kind = d.pop("kind", UNSET) - kind: Union[Unset, WorkflowGroupKind] + kind: Unset | WorkflowGroupKind if isinstance(_kind, Unset): kind = UNSET else: @@ -90,12 +90,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: slug = d.pop("slug", UNSET) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) description = _parse_description(d.pop("description", UNSET)) diff --git a/rootly_sdk/models/workflow_group_list.py b/rootly_sdk/models/workflow_group_list.py index ecc4f021..9a38d9db 100644 --- a/rootly_sdk/models/workflow_group_list.py +++ b/rootly_sdk/models/workflow_group_list.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,7 +29,7 @@ class WorkflowGroupList: data: list["WorkflowGroupListDataItem"] links: "Links" meta: "Meta" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/workflow_group_response.py b/rootly_sdk/models/workflow_group_response.py index ef0c5ad5..3dd3f4e3 100644 --- a/rootly_sdk/models/workflow_group_response.py +++ b/rootly_sdk/models/workflow_group_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,13 +23,13 @@ class WorkflowGroupResponse: """ data: "WorkflowGroupResponseData" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/workflow_list.py b/rootly_sdk/models/workflow_list.py index 94bf3795..b6b1a4f9 100644 --- a/rootly_sdk/models/workflow_list.py +++ b/rootly_sdk/models/workflow_list.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,7 +29,7 @@ class WorkflowList: data: list["WorkflowListDataItem"] links: "Links" meta: "Meta" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/workflow_response.py b/rootly_sdk/models/workflow_response.py index 638a1d68..1166b999 100644 --- a/rootly_sdk/models/workflow_response.py +++ b/rootly_sdk/models/workflow_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,13 +23,13 @@ class WorkflowResponse: """ data: "WorkflowResponseData" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/workflow_run.py b/rootly_sdk/models/workflow_run.py index 7dbf6bf7..53b52940 100644 --- a/rootly_sdk/models/workflow_run.py +++ b/rootly_sdk/models/workflow_run.py @@ -38,16 +38,16 @@ class WorkflowRun: workflow_id: str status: WorkflowRunStatus triggered_by: WorkflowRunTriggeredBy - status_message: Union[None, Unset, str] = UNSET - started_at: Union[None, Unset, str] = UNSET - completed_at: Union[None, Unset, str] = UNSET - failed_at: Union[None, Unset, str] = UNSET - canceled_at: Union[None, Unset, str] = UNSET - incident_id: Union[None, Unset, str] = UNSET - post_mortem_id: Union[None, Unset, str] = UNSET - action_item_id: Union[None, Unset, str] = UNSET - alert_id: Union[None, Unset, str] = UNSET - pulse_id: Union[None, Unset, str] = UNSET + status_message: None | Unset | str = UNSET + started_at: None | Unset | str = UNSET + completed_at: None | Unset | str = UNSET + failed_at: None | Unset | str = UNSET + canceled_at: None | Unset | str = UNSET + incident_id: None | Unset | str = UNSET + post_mortem_id: None | Unset | str = UNSET + action_item_id: None | Unset | str = UNSET + alert_id: None | Unset | str = UNSET + pulse_id: None | Unset | str = UNSET context: Union[Unset, "WorkflowRunContext"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -58,67 +58,67 @@ def to_dict(self) -> dict[str, Any]: triggered_by: str = self.triggered_by - status_message: Union[None, Unset, str] + status_message: None | Unset | str if isinstance(self.status_message, Unset): status_message = UNSET else: status_message = self.status_message - started_at: Union[None, Unset, str] + started_at: None | Unset | str if isinstance(self.started_at, Unset): started_at = UNSET else: started_at = self.started_at - completed_at: Union[None, Unset, str] + completed_at: None | Unset | str if isinstance(self.completed_at, Unset): completed_at = UNSET else: completed_at = self.completed_at - failed_at: Union[None, Unset, str] + failed_at: None | Unset | str if isinstance(self.failed_at, Unset): failed_at = UNSET else: failed_at = self.failed_at - canceled_at: Union[None, Unset, str] + canceled_at: None | Unset | str if isinstance(self.canceled_at, Unset): canceled_at = UNSET else: canceled_at = self.canceled_at - incident_id: Union[None, Unset, str] + incident_id: None | Unset | str if isinstance(self.incident_id, Unset): incident_id = UNSET else: incident_id = self.incident_id - post_mortem_id: Union[None, Unset, str] + post_mortem_id: None | Unset | str if isinstance(self.post_mortem_id, Unset): post_mortem_id = UNSET else: post_mortem_id = self.post_mortem_id - action_item_id: Union[None, Unset, str] + action_item_id: None | Unset | str if isinstance(self.action_item_id, Unset): action_item_id = UNSET else: action_item_id = self.action_item_id - alert_id: Union[None, Unset, str] + alert_id: None | Unset | str if isinstance(self.alert_id, Unset): alert_id = UNSET else: alert_id = self.alert_id - pulse_id: Union[None, Unset, str] + pulse_id: None | Unset | str if isinstance(self.pulse_id, Unset): pulse_id = UNSET else: pulse_id = self.pulse_id - context: Union[Unset, dict[str, Any]] = UNSET + context: Unset | dict[str, Any] = UNSET if not isinstance(self.context, Unset): context = self.context.to_dict() @@ -167,98 +167,98 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: triggered_by = check_workflow_run_triggered_by(d.pop("triggered_by")) - def _parse_status_message(data: object) -> Union[None, Unset, str]: + def _parse_status_message(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) status_message = _parse_status_message(d.pop("status_message", UNSET)) - def _parse_started_at(data: object) -> Union[None, Unset, str]: + def _parse_started_at(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) started_at = _parse_started_at(d.pop("started_at", UNSET)) - def _parse_completed_at(data: object) -> Union[None, Unset, str]: + def _parse_completed_at(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) completed_at = _parse_completed_at(d.pop("completed_at", UNSET)) - def _parse_failed_at(data: object) -> Union[None, Unset, str]: + def _parse_failed_at(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) failed_at = _parse_failed_at(d.pop("failed_at", UNSET)) - def _parse_canceled_at(data: object) -> Union[None, Unset, str]: + def _parse_canceled_at(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) canceled_at = _parse_canceled_at(d.pop("canceled_at", UNSET)) - def _parse_incident_id(data: object) -> Union[None, Unset, str]: + def _parse_incident_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) incident_id = _parse_incident_id(d.pop("incident_id", UNSET)) - def _parse_post_mortem_id(data: object) -> Union[None, Unset, str]: + def _parse_post_mortem_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) post_mortem_id = _parse_post_mortem_id(d.pop("post_mortem_id", UNSET)) - def _parse_action_item_id(data: object) -> Union[None, Unset, str]: + def _parse_action_item_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) action_item_id = _parse_action_item_id(d.pop("action_item_id", UNSET)) - def _parse_alert_id(data: object) -> Union[None, Unset, str]: + def _parse_alert_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) alert_id = _parse_alert_id(d.pop("alert_id", UNSET)) - def _parse_pulse_id(data: object) -> Union[None, Unset, str]: + def _parse_pulse_id(data: object) -> None | Unset | str: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | Unset | str, data) pulse_id = _parse_pulse_id(d.pop("pulse_id", UNSET)) _context = d.pop("context", UNSET) - context: Union[Unset, WorkflowRunContext] + context: Unset | WorkflowRunContext if isinstance(_context, Unset): context = UNSET else: diff --git a/rootly_sdk/models/workflow_run_response.py b/rootly_sdk/models/workflow_run_response.py index a4f24eed..50819314 100644 --- a/rootly_sdk/models/workflow_run_response.py +++ b/rootly_sdk/models/workflow_run_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,13 +23,13 @@ class WorkflowRunResponse: """ data: "WorkflowRunResponseData" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/workflow_runs_list.py b/rootly_sdk/models/workflow_runs_list.py index f174b18c..f4f48a91 100644 --- a/rootly_sdk/models/workflow_runs_list.py +++ b/rootly_sdk/models/workflow_runs_list.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,7 +29,7 @@ class WorkflowRunsList: data: list["WorkflowRunsListDataItem"] links: "Links" meta: "Meta" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/workflow_task.py b/rootly_sdk/models/workflow_task.py index 460fcb99..0804153f 100644 --- a/rootly_sdk/models/workflow_task.py +++ b/rootly_sdk/models/workflow_task.py @@ -440,7 +440,7 @@ class WorkflowTask: created_at: str updated_at: str enabled: bool = True - name: Union[Unset, str] = UNSET + name: Unset | str = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/workflow_task_list.py b/rootly_sdk/models/workflow_task_list.py index 10807fda..9fbe3d7b 100644 --- a/rootly_sdk/models/workflow_task_list.py +++ b/rootly_sdk/models/workflow_task_list.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,7 +29,7 @@ class WorkflowTaskList: data: list["WorkflowTaskListDataItem"] links: "Links" meta: "Meta" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/models/workflow_task_response.py b/rootly_sdk/models/workflow_task_response.py index 33601361..a50417be 100644 --- a/rootly_sdk/models/workflow_task_response.py +++ b/rootly_sdk/models/workflow_task_response.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,13 +23,13 @@ class WorkflowTaskResponse: """ data: "WorkflowTaskResponseData" - included: Union[Unset, list["JsonapiIncludedResource"]] = UNSET + included: Unset | list["JsonapiIncludedResource"] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Union[Unset, list[dict[str, Any]]] = UNSET + included: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: diff --git a/rootly_sdk/types.py b/rootly_sdk/types.py index 1b96ca40..7b033942 100644 --- a/rootly_sdk/types.py +++ b/rootly_sdk/types.py @@ -2,7 +2,7 @@ from collections.abc import Mapping, MutableMapping from http import HTTPStatus -from typing import IO, BinaryIO, Generic, Literal, Optional, TypeVar, Union +from typing import IO, BinaryIO, Generic, Literal, TypeVar from attrs import define @@ -15,13 +15,14 @@ def __bool__(self) -> Literal[False]: UNSET: Unset = Unset() # The types that `httpx.Client(files=)` can accept, copied from that library. -FileContent = Union[IO[bytes], bytes, str] -FileTypes = Union[ +FileContent = IO[bytes] | bytes | str +FileTypes = ( # (filename, file (or bytes), content_type) - tuple[Optional[str], FileContent, Optional[str]], + tuple[str | None, FileContent, str | None] + | # (filename, file (or bytes), content_type, headers) - tuple[Optional[str], FileContent, Optional[str], Mapping[str, str]], -] + tuple[str | None, FileContent, str | None, Mapping[str, str]] +) RequestFiles = list[tuple[str, FileTypes]] @@ -30,8 +31,8 @@ class File: """Contains information for file uploads""" payload: BinaryIO - file_name: Optional[str] = None - mime_type: Optional[str] = None + file_name: str | None = None + mime_type: str | None = None def to_tuple(self) -> FileTypes: """Return a tuple representation that httpx will accept for multipart/form-data""" @@ -48,7 +49,7 @@ class Response(Generic[T]): status_code: HTTPStatus content: bytes headers: MutableMapping[str, str] - parsed: Optional[T] + parsed: T | None __all__ = ["UNSET", "File", "FileTypes", "RequestFiles", "Response", "Unset"] From 285fea0301a0261d03cf013b9fa603135a36fbe3 Mon Sep 17 00:00:00 2001 From: Quentin Rousseau Date: Fri, 14 Aug 2026 09:43:26 -0700 Subject: [PATCH 3/5] Format generated README during regeneration --- Makefile | 4 ++-- README.md | 11 +++++------ 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 8f87260a..b35a8635 100644 --- a/Makefile +++ b/Makefile @@ -43,9 +43,9 @@ regenerate: @echo "Applying nullable enum fix..." @python tools/fix_nullable_enums.py @echo "Fixing lint errors..." - @uvx --from ruff==$(RUFF_VERSION) ruff check --fix rootly_sdk/ + @uvx --from ruff==$(RUFF_VERSION) ruff check --fix . @echo "Formatting patched files..." - @uvx --from ruff==$(RUFF_VERSION) ruff format rootly_sdk/ + @uvx --from ruff==$(RUFF_VERSION) ruff format . test: python -c "import rootly_sdk; print('SDK imports successfully')" diff --git a/README.md b/README.md index 9edfad5c..b038ee0b 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ By default, when you're calling an HTTPS API it will attempt to verify that SSL ```python client = AuthenticatedClient( - base_url="https://internal_api.example.com", + base_url="https://internal_api.example.com", token="SuperSecretToken", verify_ssl="/path/to/certificate_bundle.pem", ) @@ -56,11 +56,7 @@ client = AuthenticatedClient( You can also disable certificate validation altogether, but beware that **this is a security risk**. ```python -client = AuthenticatedClient( - base_url="https://internal_api.example.com", - token="SuperSecretToken", - verify_ssl=False -) +client = AuthenticatedClient(base_url="https://internal_api.example.com", token="SuperSecretToken", verify_ssl=False) ``` Things to know: @@ -81,13 +77,16 @@ There are more settings on the generated `Client` class which let you control mo ```python from rootly_sdk import Client + def log_request(request): print(f"Request event hook: {request.method} {request.url} - Waiting for response") + def log_response(response): request = response.request print(f"Response event hook: {request.method} {request.url} - Status {response.status_code}") + client = Client( base_url="https://api.example.com", httpx_args={"event_hooks": {"request": [log_request], "response": [log_response]}}, From c1ef01e09b2f54384cf1b116b30e764023482988 Mon Sep 17 00:00:00 2001 From: Quentin Rousseau Date: Fri, 14 Aug 2026 09:45:40 -0700 Subject: [PATCH 4/5] Test Python 3.13 and 3.14 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d0a654e5..4be4b154 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,7 +33,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ['3.10', '3.11', '3.12'] + python-version: ['3.10', '3.11', '3.12', '3.13', '3.14'] steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 From 4bf899e3b6b0d0601901e8708cc566391bebbea0 Mon Sep 17 00:00:00 2001 From: Quentin Rousseau Date: Fri, 14 Aug 2026 09:46:14 -0700 Subject: [PATCH 5/5] Move GitHub Actions to Blacksmith --- .github/workflows/ci.yml | 4 ++-- .github/workflows/publish.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4be4b154..9bc339ea 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,7 +8,7 @@ on: jobs: lint: - runs-on: ubuntu-latest + runs-on: blacksmith-2vcpu-ubuntu-2404 steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 @@ -30,7 +30,7 @@ jobs: run: ruff format --check . test: - runs-on: ubuntu-latest + runs-on: blacksmith-2vcpu-ubuntu-2404 strategy: matrix: python-version: ['3.10', '3.11', '3.12', '3.13', '3.14'] diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index af6265b9..63fd1bda 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -7,7 +7,7 @@ on: jobs: build-and-publish: - runs-on: ubuntu-latest + runs-on: blacksmith-2vcpu-ubuntu-2404 steps: - name: Checkout code uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 @@ -39,4 +39,4 @@ jobs: TWINE_USERNAME: __token__ TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} run: | - twine upload dist/* \ No newline at end of file + twine upload dist/*